From 8e8b8f78ec5127e9faf7a34d8ea38f555f600d2a Mon Sep 17 00:00:00 2001 From: David Craven Date: Mon, 10 Feb 2020 17:19:45 +0100 Subject: [PATCH 01/17] Make native-app-glue optional. --- android-ndk-sys/Cargo.toml | 1 + android-ndk-sys/src/lib.rs | 1 + android-ndk/Cargo.toml | 3 +-- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/android-ndk-sys/Cargo.toml b/android-ndk-sys/Cargo.toml index 8d9a78cb..e368ad81 100644 --- a/android-ndk-sys/Cargo.toml +++ b/android-ndk-sys/Cargo.toml @@ -18,6 +18,7 @@ include = [ ] [features] +native_app_glue = [] rustdoc = [] [package.metadata.docs.rs] diff --git a/android-ndk-sys/src/lib.rs b/android-ndk-sys/src/lib.rs index 4fe8fd8c..0fe8da23 100644 --- a/android-ndk-sys/src/lib.rs +++ b/android-ndk-sys/src/lib.rs @@ -13,6 +13,7 @@ // Test setup lints #![cfg_attr(test, allow(dead_code))] +#[cfg(feature = "native_app_glue")] pub mod native_app_glue; #[cfg(all(not(target_os = "android"), not(test), not(feature = "rustdoc")))] diff --git a/android-ndk/Cargo.toml b/android-ndk/Cargo.toml index 335933df..73de104d 100644 --- a/android-ndk/Cargo.toml +++ b/android-ndk/Cargo.toml @@ -18,9 +18,8 @@ include = [ ] [features] -default = ["native_app_glue"] rustdoc = ["ffi/rustdoc", "jni", "jni-glue"] -native_app_glue = [] +native_app_glue = ["ffi/native_app_glue"] [package.metadata.docs.rs] features = ["rustdoc"] From e9349a37c35d19f61812082b85e7378220535f52 Mon Sep 17 00:00:00 2001 From: David Craven Date: Mon, 10 Feb 2020 17:20:05 +0100 Subject: [PATCH 02/17] Link against libandroid.so --- android-ndk-sys/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/android-ndk-sys/src/lib.rs b/android-ndk-sys/src/lib.rs index 0fe8da23..1bb7e843 100644 --- a/android-ndk-sys/src/lib.rs +++ b/android-ndk-sys/src/lib.rs @@ -36,3 +36,7 @@ include!("ffi_i686.rs"); #[cfg(all(any(target_os = "android", test), target_arch = "x86_64"))] include!("ffi_x86_64.rs"); + +#[cfg(target_os = "android")] +#[link(name = "android")] +extern "C" {} From 52c80a6a8dd046e8d0398b890b86e9cb044eaa06 Mon Sep 17 00:00:00 2001 From: David Craven Date: Mon, 10 Feb 2020 17:20:29 +0100 Subject: [PATCH 03/17] Add some missing functions. * ThreadLooper::prepare * InputQueue::attach_looper * InputQueue::detach_looper * Configuration::from_asset_manager --- android-ndk/src/configuration.rs | 9 +++++++++ android-ndk/src/input_queue.rs | 19 +++++++++++++++++++ android-ndk/src/looper.rs | 12 ++++++++++++ 3 files changed, 40 insertions(+) diff --git a/android-ndk/src/configuration.rs b/android-ndk/src/configuration.rs index 604dce7a..b3345fec 100644 --- a/android-ndk/src/configuration.rs +++ b/android-ndk/src/configuration.rs @@ -7,6 +7,7 @@ //! javadoc](https://developer.android.com/reference/android/content/res/Configuration.html) may //! also have useful information. +use crate::asset::AssetManager; use num_enum::{IntoPrimitive, TryFromPrimitive}; use std::convert::TryInto; use std::fmt; @@ -92,6 +93,14 @@ impl Configuration { self.ptr } + pub fn from_asset_manager(am: &AssetManager) -> Self { + let config = Self::new(); + unsafe { + ffi::AConfiguration_fromAssetManager(config.ptr().as_mut(), am.ptr().as_mut()); + } + config + } + /// Create a new `Configuration`, with none of the values set. pub fn new() -> Self { unsafe { diff --git a/android-ndk/src/input_queue.rs b/android-ndk/src/input_queue.rs index 3ca7b476..6c392d63 100644 --- a/android-ndk/src/input_queue.rs +++ b/android-ndk/src/input_queue.rs @@ -5,6 +5,7 @@ use std::ptr; use std::ptr::NonNull; use crate::event::InputEvent; +use crate::looper::ForeignLooper; // TODO docs #[derive(Debug)] @@ -69,4 +70,22 @@ impl InputQueue { ffi::AInputQueue_finishEvent(self.ptr.as_ptr(), event.ptr().as_ptr(), handled as c_int); } } + + pub fn attach_looper(&self, looper: &ForeignLooper, id: u32) { + unsafe { + ffi::AInputQueue_attachLooper( + self.ptr.as_ptr(), + looper.ptr().as_ptr(), + id as _, + None, + id as _, + ); + } + } + + pub fn detach_looper(&self) { + unsafe { + ffi::AInputQueue_detachLooper(self.ptr.as_ptr()); + } + } } diff --git a/android-ndk/src/looper.rs b/android-ndk/src/looper.rs index 5803d3b4..60b1f2a8 100644 --- a/android-ndk/src/looper.rs +++ b/android-ndk/src/looper.rs @@ -53,6 +53,18 @@ impl fmt::Display for LooperError { impl std::error::Error for LooperError {} impl ThreadLooper { + /// Prepares a looper for the current thread and returns it + pub fn prepare() -> Self { + unsafe { + let ptr = ffi::ALooper_prepare(ffi::ALOOPER_PREPARE_ALLOW_NON_CALLBACKS as _); + let foreign = ForeignLooper::from_ptr(NonNull::new(ptr).expect("looper non null")); + Self { + _marker: std::marker::PhantomData, + foreign, + } + } + } + /// Returns the looper associated with the current thread, if any. pub fn for_thread() -> Option { Some(Self { From 77f5f3f3f6b21eff8e3e8442d4241b4ec792418a Mon Sep 17 00:00:00 2001 From: David Craven Date: Sun, 16 Feb 2020 19:39:22 +0100 Subject: [PATCH 04/17] Remove unnecessary armv7 bindings. --- android-ndk-sys/generate_bindings.sh | 2 - android-ndk-sys/src/ffi_armv7.rs | 13590 ------------------------- android-ndk-sys/src/lib.rs | 8 +- 3 files changed, 4 insertions(+), 13596 deletions(-) delete mode 100644 android-ndk-sys/src/ffi_armv7.rs diff --git a/android-ndk-sys/generate_bindings.sh b/android-ndk-sys/generate_bindings.sh index 7789cfad..4f3ad4de 100644 --- a/android-ndk-sys/generate_bindings.sh +++ b/android-ndk-sys/generate_bindings.sh @@ -5,8 +5,6 @@ while read ARCH && read TARGET ; do done << EOF arm arm-linux-androideabi -armv7 -armv7-linux-androideabi aarch64 aarch64-linux-android i686 diff --git a/android-ndk-sys/src/ffi_armv7.rs b/android-ndk-sys/src/ffi_armv7.rs deleted file mode 100644 index f987f7a2..00000000 --- a/android-ndk-sys/src/ffi_armv7.rs +++ /dev/null @@ -1,13590 +0,0 @@ -/* automatically generated by rust-bindgen */ - -pub const __BIONIC__: u32 = 1; -pub const __WORDSIZE: u32 = 32; -pub const __bos_level: u32 = 0; -pub const __ANDROID_API_FUTURE__: u32 = 10000; -pub const __ANDROID_API__: u32 = 10000; -pub const __ANDROID_API_G__: u32 = 9; -pub const __ANDROID_API_I__: u32 = 14; -pub const __ANDROID_API_J__: u32 = 16; -pub const __ANDROID_API_J_MR1__: u32 = 17; -pub const __ANDROID_API_J_MR2__: u32 = 18; -pub const __ANDROID_API_K__: u32 = 19; -pub const __ANDROID_API_L__: u32 = 21; -pub const __ANDROID_API_L_MR1__: u32 = 22; -pub const __ANDROID_API_M__: u32 = 23; -pub const __ANDROID_API_N__: u32 = 24; -pub const __ANDROID_API_N_MR1__: u32 = 25; -pub const __ANDROID_API_O__: u32 = 26; -pub const __ANDROID_API_O_MR1__: u32 = 27; -pub const __ANDROID_API_P__: u32 = 28; -pub const __ANDROID_API_Q__: u32 = 29; -pub const WCHAR_MIN: u8 = 0u8; -pub const INT8_MIN: i32 = -128; -pub const INT8_MAX: u32 = 127; -pub const INT_LEAST8_MIN: i32 = -128; -pub const INT_LEAST8_MAX: u32 = 127; -pub const INT_FAST8_MIN: i32 = -128; -pub const INT_FAST8_MAX: u32 = 127; -pub const UINT8_MAX: u32 = 255; -pub const UINT_LEAST8_MAX: u32 = 255; -pub const UINT_FAST8_MAX: u32 = 255; -pub const INT16_MIN: i32 = -32768; -pub const INT16_MAX: u32 = 32767; -pub const INT_LEAST16_MIN: i32 = -32768; -pub const INT_LEAST16_MAX: u32 = 32767; -pub const UINT16_MAX: u32 = 65535; -pub const UINT_LEAST16_MAX: u32 = 65535; -pub const INT32_MIN: i32 = -2147483648; -pub const INT32_MAX: u32 = 2147483647; -pub const INT_LEAST32_MIN: i32 = -2147483648; -pub const INT_LEAST32_MAX: u32 = 2147483647; -pub const INT_FAST32_MIN: i32 = -2147483648; -pub const INT_FAST32_MAX: u32 = 2147483647; -pub const UINT32_MAX: u32 = 4294967295; -pub const UINT_LEAST32_MAX: u32 = 4294967295; -pub const UINT_FAST32_MAX: u32 = 4294967295; -pub const SIG_ATOMIC_MAX: u32 = 2147483647; -pub const SIG_ATOMIC_MIN: i32 = -2147483648; -pub const WINT_MAX: u32 = 4294967295; -pub const WINT_MIN: u32 = 0; -pub const INTPTR_MIN: i32 = -2147483648; -pub const INTPTR_MAX: u32 = 2147483647; -pub const UINTPTR_MAX: u32 = 4294967295; -pub const PTRDIFF_MIN: i32 = -2147483648; -pub const PTRDIFF_MAX: u32 = 2147483647; -pub const SIZE_MAX: u32 = 4294967295; -pub const __BITS_PER_LONG: u32 = 32; -pub const __FD_SETSIZE: u32 = 1024; -pub const __GNUC_VA_LIST: u32 = 1; -pub const JNI_FALSE: u32 = 0; -pub const JNI_TRUE: u32 = 1; -pub const JNI_VERSION_1_1: u32 = 65537; -pub const JNI_VERSION_1_2: u32 = 65538; -pub const JNI_VERSION_1_4: u32 = 65540; -pub const JNI_VERSION_1_6: u32 = 65542; -pub const JNI_OK: u32 = 0; -pub const JNI_ERR: i32 = -1; -pub const JNI_EDETACHED: i32 = -2; -pub const JNI_EVERSION: i32 = -3; -pub const JNI_ENOMEM: i32 = -4; -pub const JNI_EEXIST: i32 = -5; -pub const JNI_EINVAL: i32 = -6; -pub const JNI_COMMIT: u32 = 1; -pub const JNI_ABORT: u32 = 2; -pub const __PRI_64_prefix: &'static [u8; 3usize] = b"ll\0"; -pub const PRId8: &'static [u8; 2usize] = b"d\0"; -pub const PRId16: &'static [u8; 2usize] = b"d\0"; -pub const PRId32: &'static [u8; 2usize] = b"d\0"; -pub const PRId64: &'static [u8; 4usize] = b"lld\0"; -pub const PRIdLEAST8: &'static [u8; 2usize] = b"d\0"; -pub const PRIdLEAST16: &'static [u8; 2usize] = b"d\0"; -pub const PRIdLEAST32: &'static [u8; 2usize] = b"d\0"; -pub const PRIdLEAST64: &'static [u8; 4usize] = b"lld\0"; -pub const PRIdFAST8: &'static [u8; 2usize] = b"d\0"; -pub const PRIdFAST64: &'static [u8; 4usize] = b"lld\0"; -pub const PRIdMAX: &'static [u8; 3usize] = b"jd\0"; -pub const PRIi8: &'static [u8; 2usize] = b"i\0"; -pub const PRIi16: &'static [u8; 2usize] = b"i\0"; -pub const PRIi32: &'static [u8; 2usize] = b"i\0"; -pub const PRIi64: &'static [u8; 4usize] = b"lli\0"; -pub const PRIiLEAST8: &'static [u8; 2usize] = b"i\0"; -pub const PRIiLEAST16: &'static [u8; 2usize] = b"i\0"; -pub const PRIiLEAST32: &'static [u8; 2usize] = b"i\0"; -pub const PRIiLEAST64: &'static [u8; 4usize] = b"lli\0"; -pub const PRIiFAST8: &'static [u8; 2usize] = b"i\0"; -pub const PRIiFAST64: &'static [u8; 4usize] = b"lli\0"; -pub const PRIiMAX: &'static [u8; 3usize] = b"ji\0"; -pub const PRIo8: &'static [u8; 2usize] = b"o\0"; -pub const PRIo16: &'static [u8; 2usize] = b"o\0"; -pub const PRIo32: &'static [u8; 2usize] = b"o\0"; -pub const PRIo64: &'static [u8; 4usize] = b"llo\0"; -pub const PRIoLEAST8: &'static [u8; 2usize] = b"o\0"; -pub const PRIoLEAST16: &'static [u8; 2usize] = b"o\0"; -pub const PRIoLEAST32: &'static [u8; 2usize] = b"o\0"; -pub const PRIoLEAST64: &'static [u8; 4usize] = b"llo\0"; -pub const PRIoFAST8: &'static [u8; 2usize] = b"o\0"; -pub const PRIoFAST64: &'static [u8; 4usize] = b"llo\0"; -pub const PRIoMAX: &'static [u8; 3usize] = b"jo\0"; -pub const PRIu8: &'static [u8; 2usize] = b"u\0"; -pub const PRIu16: &'static [u8; 2usize] = b"u\0"; -pub const PRIu32: &'static [u8; 2usize] = b"u\0"; -pub const PRIu64: &'static [u8; 4usize] = b"llu\0"; -pub const PRIuLEAST8: &'static [u8; 2usize] = b"u\0"; -pub const PRIuLEAST16: &'static [u8; 2usize] = b"u\0"; -pub const PRIuLEAST32: &'static [u8; 2usize] = b"u\0"; -pub const PRIuLEAST64: &'static [u8; 4usize] = b"llu\0"; -pub const PRIuFAST8: &'static [u8; 2usize] = b"u\0"; -pub const PRIuFAST64: &'static [u8; 4usize] = b"llu\0"; -pub const PRIuMAX: &'static [u8; 3usize] = b"ju\0"; -pub const PRIx8: &'static [u8; 2usize] = b"x\0"; -pub const PRIx16: &'static [u8; 2usize] = b"x\0"; -pub const PRIx32: &'static [u8; 2usize] = b"x\0"; -pub const PRIx64: &'static [u8; 4usize] = b"llx\0"; -pub const PRIxLEAST8: &'static [u8; 2usize] = b"x\0"; -pub const PRIxLEAST16: &'static [u8; 2usize] = b"x\0"; -pub const PRIxLEAST32: &'static [u8; 2usize] = b"x\0"; -pub const PRIxLEAST64: &'static [u8; 4usize] = b"llx\0"; -pub const PRIxFAST8: &'static [u8; 2usize] = b"x\0"; -pub const PRIxFAST64: &'static [u8; 4usize] = b"llx\0"; -pub const PRIxMAX: &'static [u8; 3usize] = b"jx\0"; -pub const PRIX8: &'static [u8; 2usize] = b"X\0"; -pub const PRIX16: &'static [u8; 2usize] = b"X\0"; -pub const PRIX32: &'static [u8; 2usize] = b"X\0"; -pub const PRIX64: &'static [u8; 4usize] = b"llX\0"; -pub const PRIXLEAST8: &'static [u8; 2usize] = b"X\0"; -pub const PRIXLEAST16: &'static [u8; 2usize] = b"X\0"; -pub const PRIXLEAST32: &'static [u8; 2usize] = b"X\0"; -pub const PRIXLEAST64: &'static [u8; 4usize] = b"llX\0"; -pub const PRIXFAST8: &'static [u8; 2usize] = b"X\0"; -pub const PRIXFAST64: &'static [u8; 4usize] = b"llX\0"; -pub const PRIXMAX: &'static [u8; 3usize] = b"jX\0"; -pub const SCNd8: &'static [u8; 4usize] = b"hhd\0"; -pub const SCNd16: &'static [u8; 3usize] = b"hd\0"; -pub const SCNd32: &'static [u8; 2usize] = b"d\0"; -pub const SCNd64: &'static [u8; 4usize] = b"lld\0"; -pub const SCNdLEAST8: &'static [u8; 4usize] = b"hhd\0"; -pub const SCNdLEAST16: &'static [u8; 3usize] = b"hd\0"; -pub const SCNdLEAST32: &'static [u8; 2usize] = b"d\0"; -pub const SCNdLEAST64: &'static [u8; 4usize] = b"lld\0"; -pub const SCNdFAST8: &'static [u8; 4usize] = b"hhd\0"; -pub const SCNdFAST64: &'static [u8; 4usize] = b"lld\0"; -pub const SCNdMAX: &'static [u8; 3usize] = b"jd\0"; -pub const SCNi8: &'static [u8; 4usize] = b"hhi\0"; -pub const SCNi16: &'static [u8; 3usize] = b"hi\0"; -pub const SCNi32: &'static [u8; 2usize] = b"i\0"; -pub const SCNi64: &'static [u8; 4usize] = b"lli\0"; -pub const SCNiLEAST8: &'static [u8; 4usize] = b"hhi\0"; -pub const SCNiLEAST16: &'static [u8; 3usize] = b"hi\0"; -pub const SCNiLEAST32: &'static [u8; 2usize] = b"i\0"; -pub const SCNiLEAST64: &'static [u8; 4usize] = b"lli\0"; -pub const SCNiFAST8: &'static [u8; 4usize] = b"hhi\0"; -pub const SCNiFAST64: &'static [u8; 4usize] = b"lli\0"; -pub const SCNiMAX: &'static [u8; 3usize] = b"ji\0"; -pub const SCNo8: &'static [u8; 4usize] = b"hho\0"; -pub const SCNo16: &'static [u8; 3usize] = b"ho\0"; -pub const SCNo32: &'static [u8; 2usize] = b"o\0"; -pub const SCNo64: &'static [u8; 4usize] = b"llo\0"; -pub const SCNoLEAST8: &'static [u8; 4usize] = b"hho\0"; -pub const SCNoLEAST16: &'static [u8; 3usize] = b"ho\0"; -pub const SCNoLEAST32: &'static [u8; 2usize] = b"o\0"; -pub const SCNoLEAST64: &'static [u8; 4usize] = b"llo\0"; -pub const SCNoFAST8: &'static [u8; 4usize] = b"hho\0"; -pub const SCNoFAST64: &'static [u8; 4usize] = b"llo\0"; -pub const SCNoMAX: &'static [u8; 3usize] = b"jo\0"; -pub const SCNu8: &'static [u8; 4usize] = b"hhu\0"; -pub const SCNu16: &'static [u8; 3usize] = b"hu\0"; -pub const SCNu32: &'static [u8; 2usize] = b"u\0"; -pub const SCNu64: &'static [u8; 4usize] = b"llu\0"; -pub const SCNuLEAST8: &'static [u8; 4usize] = b"hhu\0"; -pub const SCNuLEAST16: &'static [u8; 3usize] = b"hu\0"; -pub const SCNuLEAST32: &'static [u8; 2usize] = b"u\0"; -pub const SCNuLEAST64: &'static [u8; 4usize] = b"llu\0"; -pub const SCNuFAST8: &'static [u8; 4usize] = b"hhu\0"; -pub const SCNuFAST64: &'static [u8; 4usize] = b"llu\0"; -pub const SCNuMAX: &'static [u8; 3usize] = b"ju\0"; -pub const SCNx8: &'static [u8; 4usize] = b"hhx\0"; -pub const SCNx16: &'static [u8; 3usize] = b"hx\0"; -pub const SCNx32: &'static [u8; 2usize] = b"x\0"; -pub const SCNx64: &'static [u8; 4usize] = b"llx\0"; -pub const SCNxLEAST8: &'static [u8; 4usize] = b"hhx\0"; -pub const SCNxLEAST16: &'static [u8; 3usize] = b"hx\0"; -pub const SCNxLEAST32: &'static [u8; 2usize] = b"x\0"; -pub const SCNxLEAST64: &'static [u8; 4usize] = b"llx\0"; -pub const SCNxFAST8: &'static [u8; 4usize] = b"hhx\0"; -pub const SCNxFAST64: &'static [u8; 4usize] = b"llx\0"; -pub const SCNxMAX: &'static [u8; 3usize] = b"jx\0"; -pub const true_: u32 = 1; -pub const false_: u32 = 0; -pub const __bool_true_false_are_defined: u32 = 1; -pub const AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT: u32 = 8; -pub const _K_SS_MAXSIZE: u32 = 128; -pub const O_DIRECTORY: u32 = 16384; -pub const O_NOFOLLOW: u32 = 32768; -pub const O_DIRECT: u32 = 65536; -pub const O_LARGEFILE: u32 = 131072; -pub const O_ACCMODE: u32 = 3; -pub const O_RDONLY: u32 = 0; -pub const O_WRONLY: u32 = 1; -pub const O_RDWR: u32 = 2; -pub const O_CREAT: u32 = 64; -pub const O_EXCL: u32 = 128; -pub const O_NOCTTY: u32 = 256; -pub const O_TRUNC: u32 = 512; -pub const O_APPEND: u32 = 1024; -pub const O_NONBLOCK: u32 = 2048; -pub const O_DSYNC: u32 = 4096; -pub const FASYNC: u32 = 8192; -pub const O_NOATIME: u32 = 262144; -pub const O_CLOEXEC: u32 = 524288; -pub const __O_SYNC: u32 = 1048576; -pub const O_SYNC: u32 = 1052672; -pub const O_PATH: u32 = 2097152; -pub const __O_TMPFILE: u32 = 4194304; -pub const O_TMPFILE: u32 = 4210688; -pub const O_TMPFILE_MASK: u32 = 4210752; -pub const O_NDELAY: u32 = 2048; -pub const F_DUPFD: u32 = 0; -pub const F_GETFD: u32 = 1; -pub const F_SETFD: u32 = 2; -pub const F_GETFL: u32 = 3; -pub const F_SETFL: u32 = 4; -pub const F_GETLK: u32 = 5; -pub const F_SETLK: u32 = 6; -pub const F_SETLKW: u32 = 7; -pub const F_SETOWN: u32 = 8; -pub const F_GETOWN: u32 = 9; -pub const F_SETSIG: u32 = 10; -pub const F_GETSIG: u32 = 11; -pub const F_GETLK64: u32 = 12; -pub const F_SETLK64: u32 = 13; -pub const F_SETLKW64: u32 = 14; -pub const F_SETOWN_EX: u32 = 15; -pub const F_GETOWN_EX: u32 = 16; -pub const F_GETOWNER_UIDS: u32 = 17; -pub const F_OFD_GETLK: u32 = 36; -pub const F_OFD_SETLK: u32 = 37; -pub const F_OFD_SETLKW: u32 = 38; -pub const F_OWNER_TID: u32 = 0; -pub const F_OWNER_PID: u32 = 1; -pub const F_OWNER_PGRP: u32 = 2; -pub const FD_CLOEXEC: u32 = 1; -pub const F_RDLCK: u32 = 0; -pub const F_WRLCK: u32 = 1; -pub const F_UNLCK: u32 = 2; -pub const F_EXLCK: u32 = 4; -pub const F_SHLCK: u32 = 8; -pub const LOCK_SH: u32 = 1; -pub const LOCK_EX: u32 = 2; -pub const LOCK_NB: u32 = 4; -pub const LOCK_UN: u32 = 8; -pub const LOCK_MAND: u32 = 32; -pub const LOCK_READ: u32 = 64; -pub const LOCK_WRITE: u32 = 128; -pub const LOCK_RW: u32 = 192; -pub const F_LINUX_SPECIFIC_BASE: u32 = 1024; -pub const FIOSETOWN: u32 = 35073; -pub const SIOCSPGRP: u32 = 35074; -pub const FIOGETOWN: u32 = 35075; -pub const SIOCGPGRP: u32 = 35076; -pub const SIOCATMARK: u32 = 35077; -pub const SIOCGSTAMP: u32 = 35078; -pub const SIOCGSTAMPNS: u32 = 35079; -pub const SOL_SOCKET: u32 = 1; -pub const SO_DEBUG: u32 = 1; -pub const SO_REUSEADDR: u32 = 2; -pub const SO_TYPE: u32 = 3; -pub const SO_ERROR: u32 = 4; -pub const SO_DONTROUTE: u32 = 5; -pub const SO_BROADCAST: u32 = 6; -pub const SO_SNDBUF: u32 = 7; -pub const SO_RCVBUF: u32 = 8; -pub const SO_SNDBUFFORCE: u32 = 32; -pub const SO_RCVBUFFORCE: u32 = 33; -pub const SO_KEEPALIVE: u32 = 9; -pub const SO_OOBINLINE: u32 = 10; -pub const SO_NO_CHECK: u32 = 11; -pub const SO_PRIORITY: u32 = 12; -pub const SO_LINGER: u32 = 13; -pub const SO_BSDCOMPAT: u32 = 14; -pub const SO_REUSEPORT: u32 = 15; -pub const SO_PASSCRED: u32 = 16; -pub const SO_PEERCRED: u32 = 17; -pub const SO_RCVLOWAT: u32 = 18; -pub const SO_SNDLOWAT: u32 = 19; -pub const SO_RCVTIMEO: u32 = 20; -pub const SO_SNDTIMEO: u32 = 21; -pub const SO_SECURITY_AUTHENTICATION: u32 = 22; -pub const SO_SECURITY_ENCRYPTION_TRANSPORT: u32 = 23; -pub const SO_SECURITY_ENCRYPTION_NETWORK: u32 = 24; -pub const SO_BINDTODEVICE: u32 = 25; -pub const SO_ATTACH_FILTER: u32 = 26; -pub const SO_DETACH_FILTER: u32 = 27; -pub const SO_GET_FILTER: u32 = 26; -pub const SO_PEERNAME: u32 = 28; -pub const SO_TIMESTAMP: u32 = 29; -pub const SCM_TIMESTAMP: u32 = 29; -pub const SO_ACCEPTCONN: u32 = 30; -pub const SO_PEERSEC: u32 = 31; -pub const SO_PASSSEC: u32 = 34; -pub const SO_TIMESTAMPNS: u32 = 35; -pub const SCM_TIMESTAMPNS: u32 = 35; -pub const SO_MARK: u32 = 36; -pub const SO_TIMESTAMPING: u32 = 37; -pub const SCM_TIMESTAMPING: u32 = 37; -pub const SO_PROTOCOL: u32 = 38; -pub const SO_DOMAIN: u32 = 39; -pub const SO_RXQ_OVFL: u32 = 40; -pub const SO_WIFI_STATUS: u32 = 41; -pub const SCM_WIFI_STATUS: u32 = 41; -pub const SO_PEEK_OFF: u32 = 42; -pub const SO_NOFCS: u32 = 43; -pub const SO_LOCK_FILTER: u32 = 44; -pub const SO_SELECT_ERR_QUEUE: u32 = 45; -pub const SO_BUSY_POLL: u32 = 46; -pub const SO_MAX_PACING_RATE: u32 = 47; -pub const SO_BPF_EXTENSIONS: u32 = 48; -pub const SO_INCOMING_CPU: u32 = 49; -pub const SO_ATTACH_BPF: u32 = 50; -pub const SO_DETACH_BPF: u32 = 27; -pub const SO_ATTACH_REUSEPORT_CBPF: u32 = 51; -pub const SO_ATTACH_REUSEPORT_EBPF: u32 = 52; -pub const SO_CNX_ADVICE: u32 = 53; -pub const SCM_TIMESTAMPING_OPT_STATS: u32 = 54; -pub const SO_MEMINFO: u32 = 55; -pub const SO_INCOMING_NAPI_ID: u32 = 56; -pub const SO_COOKIE: u32 = 57; -pub const SCM_TIMESTAMPING_PKTINFO: u32 = 58; -pub const SO_PEERGROUPS: u32 = 59; -pub const SO_ZEROCOPY: u32 = 60; -pub const SO_TXTIME: u32 = 61; -pub const SCM_TXTIME: u32 = 61; -pub const SOCK_IOC_TYPE: u32 = 137; -pub const SIOCADDRT: u32 = 35083; -pub const SIOCDELRT: u32 = 35084; -pub const SIOCRTMSG: u32 = 35085; -pub const SIOCGIFNAME: u32 = 35088; -pub const SIOCSIFLINK: u32 = 35089; -pub const SIOCGIFCONF: u32 = 35090; -pub const SIOCGIFFLAGS: u32 = 35091; -pub const SIOCSIFFLAGS: u32 = 35092; -pub const SIOCGIFADDR: u32 = 35093; -pub const SIOCSIFADDR: u32 = 35094; -pub const SIOCGIFDSTADDR: u32 = 35095; -pub const SIOCSIFDSTADDR: u32 = 35096; -pub const SIOCGIFBRDADDR: u32 = 35097; -pub const SIOCSIFBRDADDR: u32 = 35098; -pub const SIOCGIFNETMASK: u32 = 35099; -pub const SIOCSIFNETMASK: u32 = 35100; -pub const SIOCGIFMETRIC: u32 = 35101; -pub const SIOCSIFMETRIC: u32 = 35102; -pub const SIOCGIFMEM: u32 = 35103; -pub const SIOCSIFMEM: u32 = 35104; -pub const SIOCGIFMTU: u32 = 35105; -pub const SIOCSIFMTU: u32 = 35106; -pub const SIOCSIFNAME: u32 = 35107; -pub const SIOCSIFHWADDR: u32 = 35108; -pub const SIOCGIFENCAP: u32 = 35109; -pub const SIOCSIFENCAP: u32 = 35110; -pub const SIOCGIFHWADDR: u32 = 35111; -pub const SIOCGIFSLAVE: u32 = 35113; -pub const SIOCSIFSLAVE: u32 = 35120; -pub const SIOCADDMULTI: u32 = 35121; -pub const SIOCDELMULTI: u32 = 35122; -pub const SIOCGIFINDEX: u32 = 35123; -pub const SIOGIFINDEX: u32 = 35123; -pub const SIOCSIFPFLAGS: u32 = 35124; -pub const SIOCGIFPFLAGS: u32 = 35125; -pub const SIOCDIFADDR: u32 = 35126; -pub const SIOCSIFHWBROADCAST: u32 = 35127; -pub const SIOCGIFCOUNT: u32 = 35128; -pub const SIOCGIFBR: u32 = 35136; -pub const SIOCSIFBR: u32 = 35137; -pub const SIOCGIFTXQLEN: u32 = 35138; -pub const SIOCSIFTXQLEN: u32 = 35139; -pub const SIOCETHTOOL: u32 = 35142; -pub const SIOCGMIIPHY: u32 = 35143; -pub const SIOCGMIIREG: u32 = 35144; -pub const SIOCSMIIREG: u32 = 35145; -pub const SIOCWANDEV: u32 = 35146; -pub const SIOCOUTQNSD: u32 = 35147; -pub const SIOCGSKNS: u32 = 35148; -pub const SIOCDARP: u32 = 35155; -pub const SIOCGARP: u32 = 35156; -pub const SIOCSARP: u32 = 35157; -pub const SIOCDRARP: u32 = 35168; -pub const SIOCGRARP: u32 = 35169; -pub const SIOCSRARP: u32 = 35170; -pub const SIOCGIFMAP: u32 = 35184; -pub const SIOCSIFMAP: u32 = 35185; -pub const SIOCADDDLCI: u32 = 35200; -pub const SIOCDELDLCI: u32 = 35201; -pub const SIOCGIFVLAN: u32 = 35202; -pub const SIOCSIFVLAN: u32 = 35203; -pub const SIOCBONDENSLAVE: u32 = 35216; -pub const SIOCBONDRELEASE: u32 = 35217; -pub const SIOCBONDSETHWADDR: u32 = 35218; -pub const SIOCBONDSLAVEINFOQUERY: u32 = 35219; -pub const SIOCBONDINFOQUERY: u32 = 35220; -pub const SIOCBONDCHANGEACTIVE: u32 = 35221; -pub const SIOCBRADDBR: u32 = 35232; -pub const SIOCBRDELBR: u32 = 35233; -pub const SIOCBRADDIF: u32 = 35234; -pub const SIOCBRDELIF: u32 = 35235; -pub const SIOCSHWTSTAMP: u32 = 35248; -pub const SIOCGHWTSTAMP: u32 = 35249; -pub const SIOCDEVPRIVATE: u32 = 35312; -pub const SIOCPROTOPRIVATE: u32 = 35296; -pub const UIO_FASTIOV: u32 = 8; -pub const UIO_MAXIOV: u32 = 1024; -pub const SOCK_STREAM: u32 = 1; -pub const SOCK_DGRAM: u32 = 2; -pub const SOCK_RAW: u32 = 3; -pub const SOCK_RDM: u32 = 4; -pub const SOCK_SEQPACKET: u32 = 5; -pub const SOCK_DCCP: u32 = 6; -pub const SOCK_PACKET: u32 = 10; -pub const SOCK_CLOEXEC: u32 = 524288; -pub const SOCK_NONBLOCK: u32 = 2048; -pub const SCM_RIGHTS: u32 = 1; -pub const SCM_CREDENTIALS: u32 = 2; -pub const SCM_SECURITY: u32 = 3; -pub const AF_UNSPEC: u32 = 0; -pub const AF_UNIX: u32 = 1; -pub const AF_LOCAL: u32 = 1; -pub const AF_INET: u32 = 2; -pub const AF_AX25: u32 = 3; -pub const AF_IPX: u32 = 4; -pub const AF_APPLETALK: u32 = 5; -pub const AF_NETROM: u32 = 6; -pub const AF_BRIDGE: u32 = 7; -pub const AF_ATMPVC: u32 = 8; -pub const AF_X25: u32 = 9; -pub const AF_INET6: u32 = 10; -pub const AF_ROSE: u32 = 11; -pub const AF_DECnet: u32 = 12; -pub const AF_NETBEUI: u32 = 13; -pub const AF_SECURITY: u32 = 14; -pub const AF_KEY: u32 = 15; -pub const AF_NETLINK: u32 = 16; -pub const AF_ROUTE: u32 = 16; -pub const AF_PACKET: u32 = 17; -pub const AF_ASH: u32 = 18; -pub const AF_ECONET: u32 = 19; -pub const AF_ATMSVC: u32 = 20; -pub const AF_RDS: u32 = 21; -pub const AF_SNA: u32 = 22; -pub const AF_IRDA: u32 = 23; -pub const AF_PPPOX: u32 = 24; -pub const AF_WANPIPE: u32 = 25; -pub const AF_LLC: u32 = 26; -pub const AF_CAN: u32 = 29; -pub const AF_TIPC: u32 = 30; -pub const AF_BLUETOOTH: u32 = 31; -pub const AF_IUCV: u32 = 32; -pub const AF_RXRPC: u32 = 33; -pub const AF_ISDN: u32 = 34; -pub const AF_PHONET: u32 = 35; -pub const AF_IEEE802154: u32 = 36; -pub const AF_CAIF: u32 = 37; -pub const AF_ALG: u32 = 38; -pub const AF_NFC: u32 = 39; -pub const AF_VSOCK: u32 = 40; -pub const AF_KCM: u32 = 41; -pub const AF_QIPCRTR: u32 = 42; -pub const AF_MAX: u32 = 43; -pub const PF_UNSPEC: u32 = 0; -pub const PF_UNIX: u32 = 1; -pub const PF_LOCAL: u32 = 1; -pub const PF_INET: u32 = 2; -pub const PF_AX25: u32 = 3; -pub const PF_IPX: u32 = 4; -pub const PF_APPLETALK: u32 = 5; -pub const PF_NETROM: u32 = 6; -pub const PF_BRIDGE: u32 = 7; -pub const PF_ATMPVC: u32 = 8; -pub const PF_X25: u32 = 9; -pub const PF_INET6: u32 = 10; -pub const PF_ROSE: u32 = 11; -pub const PF_DECnet: u32 = 12; -pub const PF_NETBEUI: u32 = 13; -pub const PF_SECURITY: u32 = 14; -pub const PF_KEY: u32 = 15; -pub const PF_NETLINK: u32 = 16; -pub const PF_ROUTE: u32 = 16; -pub const PF_PACKET: u32 = 17; -pub const PF_ASH: u32 = 18; -pub const PF_ECONET: u32 = 19; -pub const PF_ATMSVC: u32 = 20; -pub const PF_RDS: u32 = 21; -pub const PF_SNA: u32 = 22; -pub const PF_IRDA: u32 = 23; -pub const PF_PPPOX: u32 = 24; -pub const PF_WANPIPE: u32 = 25; -pub const PF_LLC: u32 = 26; -pub const PF_CAN: u32 = 29; -pub const PF_TIPC: u32 = 30; -pub const PF_BLUETOOTH: u32 = 31; -pub const PF_IUCV: u32 = 32; -pub const PF_RXRPC: u32 = 33; -pub const PF_ISDN: u32 = 34; -pub const PF_PHONET: u32 = 35; -pub const PF_IEEE802154: u32 = 36; -pub const PF_CAIF: u32 = 37; -pub const PF_ALG: u32 = 38; -pub const PF_NFC: u32 = 39; -pub const PF_VSOCK: u32 = 40; -pub const PF_KCM: u32 = 41; -pub const PF_QIPCRTR: u32 = 42; -pub const PF_MAX: u32 = 43; -pub const SOMAXCONN: u32 = 128; -pub const MSG_OOB: u32 = 1; -pub const MSG_PEEK: u32 = 2; -pub const MSG_DONTROUTE: u32 = 4; -pub const MSG_TRYHARD: u32 = 4; -pub const MSG_CTRUNC: u32 = 8; -pub const MSG_PROBE: u32 = 16; -pub const MSG_TRUNC: u32 = 32; -pub const MSG_DONTWAIT: u32 = 64; -pub const MSG_EOR: u32 = 128; -pub const MSG_WAITALL: u32 = 256; -pub const MSG_FIN: u32 = 512; -pub const MSG_SYN: u32 = 1024; -pub const MSG_CONFIRM: u32 = 2048; -pub const MSG_RST: u32 = 4096; -pub const MSG_ERRQUEUE: u32 = 8192; -pub const MSG_NOSIGNAL: u32 = 16384; -pub const MSG_MORE: u32 = 32768; -pub const MSG_WAITFORONE: u32 = 65536; -pub const MSG_BATCH: u32 = 262144; -pub const MSG_FASTOPEN: u32 = 536870912; -pub const MSG_CMSG_CLOEXEC: u32 = 1073741824; -pub const MSG_EOF: u32 = 512; -pub const MSG_CMSG_COMPAT: u32 = 0; -pub const SOL_IP: u32 = 0; -pub const SOL_TCP: u32 = 6; -pub const SOL_UDP: u32 = 17; -pub const SOL_IPV6: u32 = 41; -pub const SOL_ICMPV6: u32 = 58; -pub const SOL_SCTP: u32 = 132; -pub const SOL_RAW: u32 = 255; -pub const SOL_IPX: u32 = 256; -pub const SOL_AX25: u32 = 257; -pub const SOL_ATALK: u32 = 258; -pub const SOL_NETROM: u32 = 259; -pub const SOL_ROSE: u32 = 260; -pub const SOL_DECNET: u32 = 261; -pub const SOL_X25: u32 = 262; -pub const SOL_PACKET: u32 = 263; -pub const SOL_ATM: u32 = 264; -pub const SOL_AAL: u32 = 265; -pub const SOL_IRDA: u32 = 266; -pub const SOL_NETBEUI: u32 = 267; -pub const SOL_LLC: u32 = 268; -pub const SOL_DCCP: u32 = 269; -pub const SOL_NETLINK: u32 = 270; -pub const SOL_TIPC: u32 = 271; -pub const SOL_RXRPC: u32 = 272; -pub const SOL_PPPOL2TP: u32 = 273; -pub const SOL_BLUETOOTH: u32 = 274; -pub const SOL_PNPIPE: u32 = 275; -pub const SOL_RDS: u32 = 276; -pub const SOL_IUCV: u32 = 277; -pub const SOL_CAIF: u32 = 278; -pub const SOL_ALG: u32 = 279; -pub const SOL_NFC: u32 = 280; -pub const SOL_KCM: u32 = 281; -pub const SOL_TLS: u32 = 282; -pub const IPX_TYPE: u32 = 1; -pub const _PATH_HEQUIV: &'static [u8; 24usize] = b"/system/etc/hosts.equiv\0"; -pub const _PATH_HOSTS: &'static [u8; 18usize] = b"/system/etc/hosts\0"; -pub const _PATH_NETWORKS: &'static [u8; 21usize] = b"/system/etc/networks\0"; -pub const _PATH_PROTOCOLS: &'static [u8; 22usize] = b"/system/etc/protocols\0"; -pub const _PATH_SERVICES: &'static [u8; 21usize] = b"/system/etc/services\0"; -pub const NETDB_INTERNAL: i32 = -1; -pub const NETDB_SUCCESS: u32 = 0; -pub const HOST_NOT_FOUND: u32 = 1; -pub const TRY_AGAIN: u32 = 2; -pub const NO_RECOVERY: u32 = 3; -pub const NO_DATA: u32 = 4; -pub const NO_ADDRESS: u32 = 4; -pub const EAI_ADDRFAMILY: u32 = 1; -pub const EAI_AGAIN: u32 = 2; -pub const EAI_BADFLAGS: u32 = 3; -pub const EAI_FAIL: u32 = 4; -pub const EAI_FAMILY: u32 = 5; -pub const EAI_MEMORY: u32 = 6; -pub const EAI_NODATA: u32 = 7; -pub const EAI_NONAME: u32 = 8; -pub const EAI_SERVICE: u32 = 9; -pub const EAI_SOCKTYPE: u32 = 10; -pub const EAI_SYSTEM: u32 = 11; -pub const EAI_BADHINTS: u32 = 12; -pub const EAI_PROTOCOL: u32 = 13; -pub const EAI_OVERFLOW: u32 = 14; -pub const EAI_MAX: u32 = 15; -pub const AI_PASSIVE: u32 = 1; -pub const AI_CANONNAME: u32 = 2; -pub const AI_NUMERICHOST: u32 = 4; -pub const AI_NUMERICSERV: u32 = 8; -pub const AI_ALL: u32 = 256; -pub const AI_V4MAPPED_CFG: u32 = 512; -pub const AI_ADDRCONFIG: u32 = 1024; -pub const AI_V4MAPPED: u32 = 2048; -pub const AI_DEFAULT: u32 = 1536; -pub const NI_MAXHOST: u32 = 1025; -pub const NI_MAXSERV: u32 = 32; -pub const NI_NOFQDN: u32 = 1; -pub const NI_NUMERICHOST: u32 = 2; -pub const NI_NAMEREQD: u32 = 4; -pub const NI_NUMERICSERV: u32 = 8; -pub const NI_DGRAM: u32 = 16; -pub const SCOPE_DELIMITER: u8 = 37u8; -pub const IPPORT_RESERVED: u32 = 1024; -pub const WNOHANG: u32 = 1; -pub const WUNTRACED: u32 = 2; -pub const WSTOPPED: u32 = 2; -pub const WEXITED: u32 = 4; -pub const WCONTINUED: u32 = 8; -pub const WNOWAIT: u32 = 16777216; -pub const __WNOTHREAD: u32 = 536870912; -pub const __WALL: u32 = 1073741824; -pub const __WCLONE: u32 = 2147483648; -pub const P_ALL: u32 = 0; -pub const P_PID: u32 = 1; -pub const P_PGID: u32 = 2; -pub const SEEK_SET: u32 = 0; -pub const SEEK_CUR: u32 = 1; -pub const SEEK_END: u32 = 2; -pub const _IOFBF: u32 = 0; -pub const _IOLBF: u32 = 1; -pub const _IONBF: u32 = 2; -pub const BUFSIZ: u32 = 1024; -pub const EOF: i32 = -1; -pub const FOPEN_MAX: u32 = 20; -pub const FILENAME_MAX: u32 = 4096; -pub const L_tmpnam: u32 = 4096; -pub const TMP_MAX: u32 = 308915776; -pub const P_tmpdir: &'static [u8; 6usize] = b"/tmp/\0"; -pub const L_ctermid: u32 = 1024; -pub const STRUCT_MALLINFO_DECLARED: u32 = 1; -pub const M_DECAY_TIME: i32 = -100; -pub const M_PURGE: i32 = -101; -pub const EXIT_FAILURE: u32 = 1; -pub const EXIT_SUCCESS: u32 = 0; -pub const RAND_MAX: u32 = 2147483647; -pub const __NDK_MAJOR__: u32 = 20; -pub const __NDK_MINOR__: u32 = 0; -pub const __NDK_BETA__: u32 = 0; -pub const __NDK_BUILD__: u32 = 5594570; -pub const __NDK_CANARY__: u32 = 0; -pub const NR_OPEN: u32 = 1024; -pub const NGROUPS_MAX: u32 = 65536; -pub const ARG_MAX: u32 = 131072; -pub const LINK_MAX: u32 = 127; -pub const MAX_CANON: u32 = 255; -pub const MAX_INPUT: u32 = 255; -pub const NAME_MAX: u32 = 255; -pub const PATH_MAX: u32 = 4096; -pub const PIPE_BUF: u32 = 4096; -pub const XATTR_NAME_MAX: u32 = 255; -pub const XATTR_SIZE_MAX: u32 = 65536; -pub const XATTR_LIST_MAX: u32 = 65536; -pub const RTSIG_MAX: u32 = 32; -pub const PASS_MAX: u32 = 128; -pub const NL_ARGMAX: u32 = 9; -pub const NL_LANGMAX: u32 = 14; -pub const NL_MSGMAX: u32 = 32767; -pub const NL_NMAX: u32 = 1; -pub const NL_SETMAX: u32 = 255; -pub const NL_TEXTMAX: u32 = 255; -pub const CHAR_BIT: u32 = 8; -pub const LONG_BIT: u32 = 32; -pub const WORD_BIT: u32 = 32; -pub const SCHAR_MAX: u32 = 127; -pub const SCHAR_MIN: i32 = -128; -pub const UCHAR_MAX: u32 = 255; -pub const CHAR_MIN: u32 = 0; -pub const CHAR_MAX: u32 = 255; -pub const USHRT_MAX: u32 = 65535; -pub const SHRT_MAX: u32 = 32767; -pub const SHRT_MIN: i32 = -32768; -pub const UINT_MAX: u32 = 4294967295; -pub const INT_MAX: u32 = 2147483647; -pub const INT_MIN: i32 = -2147483648; -pub const ULONG_MAX: u32 = 4294967295; -pub const LONG_MAX: u32 = 2147483647; -pub const LONG_MIN: i32 = -2147483648; -pub const ULLONG_MAX: i32 = -1; -pub const LLONG_MAX: u64 = 9223372036854775807; -pub const LLONG_MIN: i64 = -9223372036854775808; -pub const LONG_LONG_MIN: i64 = -9223372036854775808; -pub const LONG_LONG_MAX: u64 = 9223372036854775807; -pub const ULONG_LONG_MAX: i32 = -1; -pub const UID_MAX: u32 = 4294967295; -pub const GID_MAX: u32 = 4294967295; -pub const SIZE_T_MAX: u32 = 4294967295; -pub const SSIZE_MAX: u32 = 2147483647; -pub const MB_LEN_MAX: u32 = 4; -pub const NZERO: u32 = 20; -pub const IOV_MAX: u32 = 1024; -pub const SEM_VALUE_MAX: u32 = 1073741823; -pub const _POSIX_VERSION: u32 = 200809; -pub const _POSIX2_VERSION: u32 = 200809; -pub const _XOPEN_VERSION: u32 = 700; -pub const __BIONIC_POSIX_FEATURE_MISSING: i32 = -1; -pub const _POSIX_ASYNCHRONOUS_IO: i32 = -1; -pub const _POSIX_CHOWN_RESTRICTED: u32 = 1; -pub const _POSIX_CPUTIME: u32 = 200809; -pub const _POSIX_FSYNC: u32 = 200809; -pub const _POSIX_IPV6: u32 = 200809; -pub const _POSIX_MAPPED_FILES: u32 = 200809; -pub const _POSIX_MEMLOCK_RANGE: u32 = 200809; -pub const _POSIX_MEMORY_PROTECTION: u32 = 200809; -pub const _POSIX_MESSAGE_PASSING: i32 = -1; -pub const _POSIX_MONOTONIC_CLOCK: u32 = 200809; -pub const _POSIX_NO_TRUNC: u32 = 1; -pub const _POSIX_PRIORITIZED_IO: i32 = -1; -pub const _POSIX_PRIORITY_SCHEDULING: u32 = 200809; -pub const _POSIX_RAW_SOCKETS: u32 = 200809; -pub const _POSIX_READER_WRITER_LOCKS: u32 = 200809; -pub const _POSIX_REGEXP: u32 = 1; -pub const _POSIX_SAVED_IDS: u32 = 1; -pub const _POSIX_SEMAPHORES: u32 = 200809; -pub const _POSIX_SHARED_MEMORY_OBJECTS: i32 = -1; -pub const _POSIX_SHELL: u32 = 1; -pub const _POSIX_SPORADIC_SERVER: i32 = -1; -pub const _POSIX_SYNCHRONIZED_IO: u32 = 200809; -pub const _POSIX_THREAD_ATTR_STACKADDR: u32 = 200809; -pub const _POSIX_THREAD_ATTR_STACKSIZE: u32 = 200809; -pub const _POSIX_THREAD_CPUTIME: u32 = 200809; -pub const _POSIX_THREAD_PRIO_INHERIT: i32 = -1; -pub const _POSIX_THREAD_PRIO_PROTECT: i32 = -1; -pub const _POSIX_THREAD_PRIORITY_SCHEDULING: u32 = 200809; -pub const _POSIX_THREAD_PROCESS_SHARED: u32 = 200809; -pub const _POSIX_THREAD_ROBUST_PRIO_INHERIT: i32 = -1; -pub const _POSIX_THREAD_ROBUST_PRIO_PROTECT: i32 = -1; -pub const _POSIX_THREAD_SAFE_FUNCTIONS: u32 = 200809; -pub const _POSIX_THREAD_SPORADIC_SERVER: i32 = -1; -pub const _POSIX_THREADS: u32 = 200809; -pub const _POSIX_TIMERS: u32 = 200809; -pub const _POSIX_TRACE: i32 = -1; -pub const _POSIX_TRACE_EVENT_FILTER: i32 = -1; -pub const _POSIX_TRACE_INHERIT: i32 = -1; -pub const _POSIX_TRACE_LOG: i32 = -1; -pub const _POSIX_TYPED_MEMORY_OBJECTS: i32 = -1; -pub const _POSIX_VDISABLE: u8 = 0u8; -pub const _POSIX2_C_BIND: u32 = 200809; -pub const _POSIX2_C_DEV: i32 = -1; -pub const _POSIX2_CHAR_TERM: u32 = 200809; -pub const _POSIX2_FORT_DEV: i32 = -1; -pub const _POSIX2_FORT_RUN: i32 = -1; -pub const _POSIX2_LOCALEDEF: i32 = -1; -pub const _POSIX2_SW_DEV: i32 = -1; -pub const _POSIX2_UPE: i32 = -1; -pub const _POSIX_V7_ILP32_OFF32: u32 = 1; -pub const _POSIX_V7_ILP32_OFFBIG: i32 = -1; -pub const _POSIX_V7_LP64_OFF64: i32 = -1; -pub const _POSIX_V7_LPBIG_OFFBIG: i32 = -1; -pub const _XOPEN_CRYPT: i32 = -1; -pub const _XOPEN_ENH_I18N: u32 = 1; -pub const _XOPEN_LEGACY: i32 = -1; -pub const _XOPEN_REALTIME: u32 = 1; -pub const _XOPEN_REALTIME_THREADS: u32 = 1; -pub const _XOPEN_SHM: u32 = 1; -pub const _XOPEN_STREAMS: i32 = -1; -pub const _XOPEN_UNIX: u32 = 1; -pub const _POSIX_AIO_LISTIO_MAX: u32 = 2; -pub const _POSIX_AIO_MAX: u32 = 1; -pub const _POSIX_ARG_MAX: u32 = 4096; -pub const _POSIX_CHILD_MAX: u32 = 25; -pub const _POSIX_CLOCKRES_MIN: u32 = 20000000; -pub const _POSIX_DELAYTIMER_MAX: u32 = 32; -pub const _POSIX_HOST_NAME_MAX: u32 = 255; -pub const _POSIX_LINK_MAX: u32 = 8; -pub const _POSIX_LOGIN_NAME_MAX: u32 = 9; -pub const _POSIX_MAX_CANON: u32 = 255; -pub const _POSIX_MAX_INPUT: u32 = 255; -pub const _POSIX_MQ_OPEN_MAX: u32 = 8; -pub const _POSIX_MQ_PRIO_MAX: u32 = 32; -pub const _POSIX_NAME_MAX: u32 = 14; -pub const _POSIX_NGROUPS_MAX: u32 = 8; -pub const _POSIX_OPEN_MAX: u32 = 20; -pub const _POSIX_PATH_MAX: u32 = 256; -pub const _POSIX_PIPE_BUF: u32 = 512; -pub const _POSIX_RE_DUP_MAX: u32 = 255; -pub const _POSIX_RTSIG_MAX: u32 = 8; -pub const _POSIX_SEM_NSEMS_MAX: u32 = 256; -pub const _POSIX_SEM_VALUE_MAX: u32 = 32767; -pub const _POSIX_SIGQUEUE_MAX: u32 = 32; -pub const _POSIX_SSIZE_MAX: u32 = 32767; -pub const _POSIX_STREAM_MAX: u32 = 8; -pub const _POSIX_SS_REPL_MAX: u32 = 4; -pub const _POSIX_SYMLINK_MAX: u32 = 255; -pub const _POSIX_SYMLOOP_MAX: u32 = 8; -pub const _POSIX_THREAD_DESTRUCTOR_ITERATIONS: u32 = 4; -pub const _POSIX_THREAD_KEYS_MAX: u32 = 128; -pub const _POSIX_THREAD_THREADS_MAX: u32 = 64; -pub const _POSIX_TIMER_MAX: u32 = 32; -pub const _POSIX_TRACE_EVENT_NAME_MAX: u32 = 30; -pub const _POSIX_TRACE_NAME_MAX: u32 = 8; -pub const _POSIX_TRACE_SYS_MAX: u32 = 8; -pub const _POSIX_TRACE_USER_EVENT_MAX: u32 = 32; -pub const _POSIX_TTY_NAME_MAX: u32 = 9; -pub const _POSIX_TZNAME_MAX: u32 = 6; -pub const _POSIX2_BC_BASE_MAX: u32 = 99; -pub const _POSIX2_BC_DIM_MAX: u32 = 2048; -pub const _POSIX2_BC_SCALE_MAX: u32 = 99; -pub const _POSIX2_BC_STRING_MAX: u32 = 1000; -pub const _POSIX2_CHARCLASS_NAME_MAX: u32 = 14; -pub const _POSIX2_COLL_WEIGHTS_MAX: u32 = 2; -pub const _POSIX2_EXPR_NEST_MAX: u32 = 32; -pub const _POSIX2_LINE_MAX: u32 = 2048; -pub const _POSIX2_RE_DUP_MAX: u32 = 255; -pub const _XOPEN_IOV_MAX: u32 = 16; -pub const _XOPEN_NAME_MAX: u32 = 255; -pub const _XOPEN_PATH_MAX: u32 = 1024; -pub const HOST_NAME_MAX: u32 = 255; -pub const LOGIN_NAME_MAX: u32 = 256; -pub const TTY_NAME_MAX: u32 = 32; -pub const PTHREAD_DESTRUCTOR_ITERATIONS: u32 = 4; -pub const PTHREAD_KEYS_MAX: u32 = 128; -pub const FP_INFINITE: u32 = 1; -pub const FP_NAN: u32 = 2; -pub const FP_NORMAL: u32 = 4; -pub const FP_SUBNORMAL: u32 = 8; -pub const FP_ZERO: u32 = 16; -pub const FP_ILOGB0: i32 = -2147483647; -pub const FP_ILOGBNAN: u32 = 2147483647; -pub const MATH_ERRNO: u32 = 1; -pub const MATH_ERREXCEPT: u32 = 2; -pub const math_errhandling: u32 = 2; -pub const M_E: f64 = 2.718281828459045; -pub const M_LOG2E: f64 = 1.4426950408889634; -pub const M_LOG10E: f64 = 0.4342944819032518; -pub const M_LN2: f64 = 0.6931471805599453; -pub const M_LN10: f64 = 2.302585092994046; -pub const M_PI: f64 = 3.141592653589793; -pub const M_PI_2: f64 = 1.5707963267948966; -pub const M_PI_4: f64 = 0.7853981633974483; -pub const M_1_PI: f64 = 0.3183098861837907; -pub const M_2_PI: f64 = 0.6366197723675814; -pub const M_2_SQRTPI: f64 = 1.1283791670955126; -pub const M_SQRT2: f64 = 1.4142135623730951; -pub const M_SQRT1_2: f64 = 0.7071067811865476; -pub const ASENSOR_FIFO_COUNT_INVALID: i32 = -1; -pub const ASENSOR_DELAY_INVALID: i32 = -2147483648; -pub const ASENSOR_INVALID: i32 = -1; -pub const ASENSOR_STANDARD_GRAVITY: f64 = 9.80665; -pub const ASENSOR_MAGNETIC_FIELD_EARTH_MAX: f64 = 60.0; -pub const ASENSOR_MAGNETIC_FIELD_EARTH_MIN: f64 = 30.0; -pub const _IOC_NRBITS: u32 = 8; -pub const _IOC_TYPEBITS: u32 = 8; -pub const _IOC_SIZEBITS: u32 = 14; -pub const _IOC_DIRBITS: u32 = 2; -pub const _IOC_NRMASK: u32 = 255; -pub const _IOC_TYPEMASK: u32 = 255; -pub const _IOC_SIZEMASK: u32 = 16383; -pub const _IOC_DIRMASK: u32 = 3; -pub const _IOC_NRSHIFT: u32 = 0; -pub const _IOC_TYPESHIFT: u32 = 8; -pub const _IOC_SIZESHIFT: u32 = 16; -pub const _IOC_DIRSHIFT: u32 = 30; -pub const _IOC_NONE: u32 = 0; -pub const _IOC_WRITE: u32 = 1; -pub const _IOC_READ: u32 = 2; -pub const IOC_IN: u32 = 1073741824; -pub const IOC_OUT: u32 = 2147483648; -pub const IOC_INOUT: u32 = 3221225472; -pub const IOCSIZE_MASK: u32 = 1073676288; -pub const IOCSIZE_SHIFT: u32 = 16; -pub const SYNC_IOC_MAGIC: u8 = 62u8; -extern "C" { - pub fn android_get_application_target_sdk_version() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn android_get_device_api_level() -> ::std::os::raw::c_int; -} -pub type wchar_t = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct max_align_t { - pub __clang_max_align_nonce1: ::std::os::raw::c_longlong, - pub __clang_max_align_nonce2: f64, -} -#[test] -fn bindgen_test_layout_max_align_t() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(max_align_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(max_align_t)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__clang_max_align_nonce1 as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(max_align_t), - "::", - stringify!(__clang_max_align_nonce1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__clang_max_align_nonce2 as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(max_align_t), - "::", - stringify!(__clang_max_align_nonce2) - ) - ); -} -pub type __int8_t = ::std::os::raw::c_schar; -pub type __uint8_t = ::std::os::raw::c_uchar; -pub type __int16_t = ::std::os::raw::c_short; -pub type __uint16_t = ::std::os::raw::c_ushort; -pub type __int32_t = ::std::os::raw::c_int; -pub type __uint32_t = ::std::os::raw::c_uint; -pub type __int64_t = ::std::os::raw::c_longlong; -pub type __uint64_t = ::std::os::raw::c_ulonglong; -pub type __intptr_t = ::std::os::raw::c_int; -pub type __uintptr_t = ::std::os::raw::c_uint; -pub type int_least8_t = i8; -pub type uint_least8_t = u8; -pub type int_least16_t = i16; -pub type uint_least16_t = u16; -pub type int_least32_t = i32; -pub type uint_least32_t = u32; -pub type int_least64_t = i64; -pub type uint_least64_t = u64; -pub type int_fast8_t = i8; -pub type uint_fast8_t = u8; -pub type int_fast64_t = i64; -pub type uint_fast64_t = u64; -pub type int_fast16_t = i32; -pub type uint_fast16_t = u32; -pub type int_fast32_t = i32; -pub type uint_fast32_t = u32; -pub type uintmax_t = u64; -pub type intmax_t = i64; -pub type __s8 = ::std::os::raw::c_schar; -pub type __u8 = ::std::os::raw::c_uchar; -pub type __s16 = ::std::os::raw::c_short; -pub type __u16 = ::std::os::raw::c_ushort; -pub type __s32 = ::std::os::raw::c_int; -pub type __u32 = ::std::os::raw::c_uint; -pub type __s64 = ::std::os::raw::c_longlong; -pub type __u64 = ::std::os::raw::c_ulonglong; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __kernel_fd_set { - pub fds_bits: [::std::os::raw::c_ulong; 32usize], -} -#[test] -fn bindgen_test_layout___kernel_fd_set() { - assert_eq!( - ::std::mem::size_of::<__kernel_fd_set>(), - 128usize, - concat!("Size of: ", stringify!(__kernel_fd_set)) - ); - assert_eq!( - ::std::mem::align_of::<__kernel_fd_set>(), - 4usize, - concat!("Alignment of ", stringify!(__kernel_fd_set)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_fd_set>())).fds_bits as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__kernel_fd_set), - "::", - stringify!(fds_bits) - ) - ); -} -pub type __kernel_sighandler_t = - ::std::option::Option; -pub type __kernel_key_t = ::std::os::raw::c_int; -pub type __kernel_mqd_t = ::std::os::raw::c_int; -pub type __kernel_mode_t = ::std::os::raw::c_ushort; -pub type __kernel_ipc_pid_t = ::std::os::raw::c_ushort; -pub type __kernel_uid_t = ::std::os::raw::c_ushort; -pub type __kernel_gid_t = ::std::os::raw::c_ushort; -pub type __kernel_old_dev_t = ::std::os::raw::c_ushort; -pub type __kernel_long_t = ::std::os::raw::c_long; -pub type __kernel_ulong_t = ::std::os::raw::c_ulong; -pub type __kernel_ino_t = __kernel_ulong_t; -pub type __kernel_pid_t = ::std::os::raw::c_int; -pub type __kernel_suseconds_t = __kernel_long_t; -pub type __kernel_daddr_t = ::std::os::raw::c_int; -pub type __kernel_uid32_t = ::std::os::raw::c_uint; -pub type __kernel_gid32_t = ::std::os::raw::c_uint; -pub type __kernel_old_uid_t = __kernel_uid_t; -pub type __kernel_old_gid_t = __kernel_gid_t; -pub type __kernel_size_t = ::std::os::raw::c_uint; -pub type __kernel_ssize_t = ::std::os::raw::c_int; -pub type __kernel_ptrdiff_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __kernel_fsid_t { - pub val: [::std::os::raw::c_int; 2usize], -} -#[test] -fn bindgen_test_layout___kernel_fsid_t() { - assert_eq!( - ::std::mem::size_of::<__kernel_fsid_t>(), - 8usize, - concat!("Size of: ", stringify!(__kernel_fsid_t)) - ); - assert_eq!( - ::std::mem::align_of::<__kernel_fsid_t>(), - 4usize, - concat!("Alignment of ", stringify!(__kernel_fsid_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__kernel_fsid_t>())).val as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__kernel_fsid_t), - "::", - stringify!(val) - ) - ); -} -pub type __kernel_off_t = __kernel_long_t; -pub type __kernel_loff_t = ::std::os::raw::c_longlong; -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; -pub type __kernel_timer_t = ::std::os::raw::c_int; -pub type __kernel_clockid_t = ::std::os::raw::c_int; -pub type __kernel_caddr_t = *mut ::std::os::raw::c_char; -pub type __kernel_uid16_t = ::std::os::raw::c_ushort; -pub type __kernel_gid16_t = ::std::os::raw::c_ushort; -pub type __le16 = __u16; -pub type __be16 = __u16; -pub type __le32 = __u32; -pub type __be32 = __u32; -pub type __le64 = __u64; -pub type __be64 = __u64; -pub type __sum16 = __u16; -pub type __wsum = __u32; -pub type __poll_t = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pthread_attr_t { - pub flags: u32, - pub stack_base: *mut ::std::os::raw::c_void, - pub stack_size: usize, - pub guard_size: usize, - pub sched_policy: i32, - pub sched_priority: i32, -} -#[test] -fn bindgen_test_layout_pthread_attr_t() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(pthread_attr_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pthread_attr_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).stack_base as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(stack_base) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).stack_size as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(stack_size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).guard_size as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(guard_size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sched_policy as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(sched_policy) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sched_priority as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(sched_priority) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pthread_barrier_t { - pub __private: [i32; 8usize], -} -#[test] -fn bindgen_test_layout_pthread_barrier_t() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(pthread_barrier_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pthread_barrier_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__private as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_barrier_t), - "::", - stringify!(__private) - ) - ); -} -pub type pthread_barrierattr_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pthread_cond_t { - pub __private: [i32; 1usize], -} -#[test] -fn bindgen_test_layout_pthread_cond_t() { - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(pthread_cond_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pthread_cond_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__private as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_cond_t), - "::", - stringify!(__private) - ) - ); -} -pub type pthread_condattr_t = ::std::os::raw::c_long; -pub type pthread_key_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pthread_mutex_t { - pub __private: [i32; 1usize], -} -#[test] -fn bindgen_test_layout_pthread_mutex_t() { - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(pthread_mutex_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pthread_mutex_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__private as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutex_t), - "::", - stringify!(__private) - ) - ); -} -pub type pthread_mutexattr_t = ::std::os::raw::c_long; -pub type pthread_once_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pthread_rwlock_t { - pub __private: [i32; 10usize], -} -#[test] -fn bindgen_test_layout_pthread_rwlock_t() { - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(pthread_rwlock_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pthread_rwlock_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__private as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_rwlock_t), - "::", - stringify!(__private) - ) - ); -} -pub type pthread_rwlockattr_t = ::std::os::raw::c_long; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pthread_spinlock_t { - pub __private: [i32; 2usize], -} -#[test] -fn bindgen_test_layout_pthread_spinlock_t() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(pthread_spinlock_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pthread_spinlock_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__private as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_spinlock_t), - "::", - stringify!(__private) - ) - ); -} -pub type pthread_t = ::std::os::raw::c_long; -pub type __gid_t = __kernel_gid32_t; -pub type gid_t = __gid_t; -pub type __uid_t = __kernel_uid32_t; -pub type uid_t = __uid_t; -pub type __pid_t = __kernel_pid_t; -pub type pid_t = __pid_t; -pub type __id_t = u32; -pub type id_t = __id_t; -pub type blkcnt_t = ::std::os::raw::c_ulong; -pub type blksize_t = ::std::os::raw::c_ulong; -pub type caddr_t = __kernel_caddr_t; -pub type clock_t = __kernel_clock_t; -pub type __clockid_t = __kernel_clockid_t; -pub type clockid_t = __clockid_t; -pub type daddr_t = __kernel_daddr_t; -pub type fsblkcnt_t = ::std::os::raw::c_ulong; -pub type fsfilcnt_t = ::std::os::raw::c_ulong; -pub type __mode_t = __kernel_mode_t; -pub type mode_t = __mode_t; -pub type __key_t = __kernel_key_t; -pub type key_t = __key_t; -pub type __ino_t = __kernel_ino_t; -pub type ino_t = __ino_t; -pub type ino64_t = u64; -pub type __nlink_t = u32; -pub type nlink_t = __nlink_t; -pub type __timer_t = *mut ::std::os::raw::c_void; -pub type timer_t = __timer_t; -pub type __suseconds_t = __kernel_suseconds_t; -pub type suseconds_t = __suseconds_t; -pub type __useconds_t = u32; -pub type useconds_t = __useconds_t; -pub type dev_t = u32; -pub type __time_t = __kernel_time_t; -pub type time_t = __time_t; -pub type off_t = __kernel_off_t; -pub type loff_t = __kernel_loff_t; -pub type off64_t = loff_t; -pub type __socklen_t = i32; -pub type socklen_t = __socklen_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; -pub type u_short = ::std::os::raw::c_ushort; -pub type u_int = ::std::os::raw::c_uint; -pub type u_long = ::std::os::raw::c_ulong; -pub type u_int32_t = u32; -pub type u_int16_t = u16; -pub type u_int8_t = u8; -pub type u_int64_t = u64; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct AAssetManager { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct AAssetDir { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct AAsset { - _unused: [u8; 0], -} -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 = u32; -extern "C" { - pub fn AAssetManager_openDir( - mgr: *mut AAssetManager, - dirName: *const ::std::os::raw::c_char, - ) -> *mut AAssetDir; -} -extern "C" { - pub fn AAssetManager_open( - mgr: *mut AAssetManager, - filename: *const ::std::os::raw::c_char, - mode: ::std::os::raw::c_int, - ) -> *mut AAsset; -} -extern "C" { - pub fn AAssetDir_getNextFileName(assetDir: *mut AAssetDir) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn AAssetDir_rewind(assetDir: *mut AAssetDir); -} -extern "C" { - pub fn AAssetDir_close(assetDir: *mut AAssetDir); -} -extern "C" { - pub fn AAsset_read( - asset: *mut AAsset, - buf: *mut ::std::os::raw::c_void, - count: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn AAsset_seek(asset: *mut AAsset, offset: off_t, whence: ::std::os::raw::c_int) -> off_t; -} -extern "C" { - pub fn AAsset_seek64( - asset: *mut AAsset, - offset: off64_t, - whence: ::std::os::raw::c_int, - ) -> off64_t; -} -extern "C" { - pub fn AAsset_close(asset: *mut AAsset); -} -extern "C" { - pub fn AAsset_getBuffer(asset: *mut AAsset) -> *const ::std::os::raw::c_void; -} -extern "C" { - pub fn AAsset_getLength(asset: *mut AAsset) -> off_t; -} -extern "C" { - pub fn AAsset_getLength64(asset: *mut AAsset) -> off64_t; -} -extern "C" { - pub fn AAsset_getRemainingLength(asset: *mut AAsset) -> off_t; -} -extern "C" { - pub fn AAsset_getRemainingLength64(asset: *mut AAsset) -> off64_t; -} -extern "C" { - pub fn AAsset_openFileDescriptor( - asset: *mut AAsset, - outStart: *mut off_t, - outLength: *mut off_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn AAsset_openFileDescriptor64( - asset: *mut AAsset, - outStart: *mut off64_t, - outLength: *mut off64_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn AAsset_isAllocated(asset: *mut AAsset) -> ::std::os::raw::c_int; -} -pub type va_list = __builtin_va_list; -pub type __gnuc_va_list = __builtin_va_list; -pub type jboolean = u8; -pub type jbyte = i8; -pub type jchar = u16; -pub type jshort = i16; -pub type jint = i32; -pub type jlong = i64; -pub type jfloat = f32; -pub type jdouble = f64; -pub type jsize = jint; -pub type jobject = *mut ::std::os::raw::c_void; -pub type jclass = jobject; -pub type jstring = jobject; -pub type jarray = jobject; -pub type jobjectArray = jarray; -pub type jbooleanArray = jarray; -pub type jbyteArray = jarray; -pub type jcharArray = jarray; -pub type jshortArray = jarray; -pub type jintArray = jarray; -pub type jlongArray = jarray; -pub type jfloatArray = jarray; -pub type jdoubleArray = jarray; -pub type jthrowable = jobject; -pub type jweak = jobject; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _jfieldID { - _unused: [u8; 0], -} -pub type jfieldID = *mut _jfieldID; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _jmethodID { - _unused: [u8; 0], -} -pub type jmethodID = *mut _jmethodID; -#[repr(C)] -#[derive(Copy, Clone)] -pub union jvalue { - pub z: jboolean, - pub b: jbyte, - pub c: jchar, - pub s: jshort, - pub i: jint, - pub j: jlong, - pub f: jfloat, - pub d: jdouble, - pub l: jobject, - _bindgen_union_align: u64, -} -#[test] -fn bindgen_test_layout_jvalue() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(jvalue)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(jvalue)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).z as *const _ as usize }, - 0usize, - concat!("Offset of field: ", stringify!(jvalue), "::", stringify!(z)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).b as *const _ as usize }, - 0usize, - concat!("Offset of field: ", stringify!(jvalue), "::", stringify!(b)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).c as *const _ as usize }, - 0usize, - concat!("Offset of field: ", stringify!(jvalue), "::", stringify!(c)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).s as *const _ as usize }, - 0usize, - concat!("Offset of field: ", stringify!(jvalue), "::", stringify!(s)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).i as *const _ as usize }, - 0usize, - concat!("Offset of field: ", stringify!(jvalue), "::", stringify!(i)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).j as *const _ as usize }, - 0usize, - concat!("Offset of field: ", stringify!(jvalue), "::", stringify!(j)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).f as *const _ as usize }, - 0usize, - concat!("Offset of field: ", stringify!(jvalue), "::", stringify!(f)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).d as *const _ as usize }, - 0usize, - concat!("Offset of field: ", stringify!(jvalue), "::", stringify!(d)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).l as *const _ as usize }, - 0usize, - concat!("Offset of field: ", stringify!(jvalue), "::", stringify!(l)) - ); -} -pub const jobjectRefType_JNIInvalidRefType: jobjectRefType = 0; -pub const jobjectRefType_JNILocalRefType: jobjectRefType = 1; -pub const jobjectRefType_JNIGlobalRefType: jobjectRefType = 2; -pub const jobjectRefType_JNIWeakGlobalRefType: jobjectRefType = 3; -pub type jobjectRefType = u32; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JNINativeMethod { - pub name: *const ::std::os::raw::c_char, - pub signature: *const ::std::os::raw::c_char, - pub fnPtr: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout_JNINativeMethod() { - assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(JNINativeMethod)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(JNINativeMethod)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).name as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JNINativeMethod), - "::", - stringify!(name) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).signature as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(JNINativeMethod), - "::", - stringify!(signature) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).fnPtr as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(JNINativeMethod), - "::", - stringify!(fnPtr) - ) - ); -} -pub type C_JNIEnv = *const JNINativeInterface; -pub type JNIEnv = *const JNINativeInterface; -pub type JavaVM = *const JNIInvokeInterface; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JNINativeInterface { - pub reserved0: *mut ::std::os::raw::c_void, - pub reserved1: *mut ::std::os::raw::c_void, - pub reserved2: *mut ::std::os::raw::c_void, - pub reserved3: *mut ::std::os::raw::c_void, - pub GetVersion: ::std::option::Option jint>, - pub DefineClass: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: *const ::std::os::raw::c_char, - arg3: jobject, - arg4: *const jbyte, - arg5: jsize, - ) -> jclass, - >, - pub FindClass: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: *const ::std::os::raw::c_char) -> jclass, - >, - pub FromReflectedMethod: - ::std::option::Option jmethodID>, - pub FromReflectedField: - ::std::option::Option jfieldID>, - pub ToReflectedMethod: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jclass, - arg3: jmethodID, - arg4: jboolean, - ) -> jobject, - >, - pub GetSuperclass: - ::std::option::Option jclass>, - pub IsAssignableFrom: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jclass, arg3: jclass) -> jboolean, - >, - pub ToReflectedField: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jclass, - arg3: jfieldID, - arg4: jboolean, - ) -> jobject, - >, - pub Throw: - ::std::option::Option jint>, - pub ThrowNew: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jclass, - arg3: *const ::std::os::raw::c_char, - ) -> jint, - >, - pub ExceptionOccurred: - ::std::option::Option jthrowable>, - pub ExceptionDescribe: ::std::option::Option, - pub ExceptionClear: ::std::option::Option, - pub FatalError: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: *const ::std::os::raw::c_char), - >, - pub PushLocalFrame: - ::std::option::Option jint>, - pub PopLocalFrame: - ::std::option::Option jobject>, - pub NewGlobalRef: - ::std::option::Option jobject>, - pub DeleteGlobalRef: - ::std::option::Option, - pub DeleteLocalRef: - ::std::option::Option, - pub IsSameObject: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobject, arg3: jobject) -> jboolean, - >, - pub NewLocalRef: - ::std::option::Option jobject>, - pub EnsureLocalCapacity: - ::std::option::Option jint>, - pub AllocObject: - ::std::option::Option jobject>, - pub NewObject: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jclass, arg3: jmethodID, ...) -> jobject, - >, - pub NewObjectV: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jclass, - arg3: jmethodID, - arg4: va_list, - ) -> jobject, - >, - pub NewObjectA: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jclass, - arg3: jmethodID, - arg4: *const jvalue, - ) -> jobject, - >, - pub GetObjectClass: - ::std::option::Option jclass>, - pub IsInstanceOf: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobject, arg3: jclass) -> jboolean, - >, - pub GetMethodID: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jclass, - arg3: *const ::std::os::raw::c_char, - arg4: *const ::std::os::raw::c_char, - ) -> jmethodID, - >, - pub CallObjectMethod: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobject, arg3: jmethodID, ...) -> jobject, - >, - pub CallObjectMethodV: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jmethodID, - arg4: va_list, - ) -> jobject, - >, - pub CallObjectMethodA: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jmethodID, - arg4: *const jvalue, - ) -> jobject, - >, - pub CallBooleanMethod: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobject, arg3: jmethodID, ...) -> jboolean, - >, - pub CallBooleanMethodV: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jmethodID, - arg4: va_list, - ) -> jboolean, - >, - pub CallBooleanMethodA: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jmethodID, - arg4: *const jvalue, - ) -> jboolean, - >, - pub CallByteMethod: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobject, arg3: jmethodID, ...) -> jbyte, - >, - pub CallByteMethodV: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jmethodID, - arg4: va_list, - ) -> jbyte, - >, - pub CallByteMethodA: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jmethodID, - arg4: *const jvalue, - ) -> jbyte, - >, - pub CallCharMethod: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobject, arg3: jmethodID, ...) -> jchar, - >, - pub CallCharMethodV: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jmethodID, - arg4: va_list, - ) -> jchar, - >, - pub CallCharMethodA: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jmethodID, - arg4: *const jvalue, - ) -> jchar, - >, - pub CallShortMethod: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobject, arg3: jmethodID, ...) -> jshort, - >, - pub CallShortMethodV: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jmethodID, - arg4: va_list, - ) -> jshort, - >, - pub CallShortMethodA: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jmethodID, - arg4: *const jvalue, - ) -> jshort, - >, - pub CallIntMethod: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobject, arg3: jmethodID, ...) -> jint, - >, - pub CallIntMethodV: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jmethodID, - arg4: va_list, - ) -> jint, - >, - pub CallIntMethodA: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jmethodID, - arg4: *const jvalue, - ) -> jint, - >, - pub CallLongMethod: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobject, arg3: jmethodID, ...) -> jlong, - >, - pub CallLongMethodV: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jmethodID, - arg4: va_list, - ) -> jlong, - >, - pub CallLongMethodA: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jmethodID, - arg4: *const jvalue, - ) -> jlong, - >, - pub CallFloatMethod: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobject, arg3: jmethodID, ...) -> jfloat, - >, - pub CallFloatMethodV: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jmethodID, - arg4: va_list, - ) -> jfloat, - >, - pub CallFloatMethodA: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jmethodID, - arg4: *const jvalue, - ) -> jfloat, - >, - pub CallDoubleMethod: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobject, arg3: jmethodID, ...) -> jdouble, - >, - pub CallDoubleMethodV: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jmethodID, - arg4: va_list, - ) -> jdouble, - >, - pub CallDoubleMethodA: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jmethodID, - arg4: *const jvalue, - ) -> jdouble, - >, - pub CallVoidMethod: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobject, arg3: jmethodID, ...), - >, - pub CallVoidMethodV: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobject, arg3: jmethodID, arg4: va_list), - >, - pub CallVoidMethodA: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jmethodID, - arg4: *const jvalue, - ), - >, - pub CallNonvirtualObjectMethod: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jclass, - arg4: jmethodID, - ... - ) -> jobject, - >, - pub CallNonvirtualObjectMethodV: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jclass, - arg4: jmethodID, - arg5: va_list, - ) -> jobject, - >, - pub CallNonvirtualObjectMethodA: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jclass, - arg4: jmethodID, - arg5: *const jvalue, - ) -> jobject, - >, - pub CallNonvirtualBooleanMethod: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jclass, - arg4: jmethodID, - ... - ) -> jboolean, - >, - pub CallNonvirtualBooleanMethodV: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jclass, - arg4: jmethodID, - arg5: va_list, - ) -> jboolean, - >, - pub CallNonvirtualBooleanMethodA: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jclass, - arg4: jmethodID, - arg5: *const jvalue, - ) -> jboolean, - >, - pub CallNonvirtualByteMethod: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jclass, - arg4: jmethodID, - ... - ) -> jbyte, - >, - pub CallNonvirtualByteMethodV: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jclass, - arg4: jmethodID, - arg5: va_list, - ) -> jbyte, - >, - pub CallNonvirtualByteMethodA: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jclass, - arg4: jmethodID, - arg5: *const jvalue, - ) -> jbyte, - >, - pub CallNonvirtualCharMethod: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jclass, - arg4: jmethodID, - ... - ) -> jchar, - >, - pub CallNonvirtualCharMethodV: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jclass, - arg4: jmethodID, - arg5: va_list, - ) -> jchar, - >, - pub CallNonvirtualCharMethodA: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jclass, - arg4: jmethodID, - arg5: *const jvalue, - ) -> jchar, - >, - pub CallNonvirtualShortMethod: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jclass, - arg4: jmethodID, - ... - ) -> jshort, - >, - pub CallNonvirtualShortMethodV: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jclass, - arg4: jmethodID, - arg5: va_list, - ) -> jshort, - >, - pub CallNonvirtualShortMethodA: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jclass, - arg4: jmethodID, - arg5: *const jvalue, - ) -> jshort, - >, - pub CallNonvirtualIntMethod: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jclass, - arg4: jmethodID, - ... - ) -> jint, - >, - pub CallNonvirtualIntMethodV: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jclass, - arg4: jmethodID, - arg5: va_list, - ) -> jint, - >, - pub CallNonvirtualIntMethodA: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jclass, - arg4: jmethodID, - arg5: *const jvalue, - ) -> jint, - >, - pub CallNonvirtualLongMethod: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jclass, - arg4: jmethodID, - ... - ) -> jlong, - >, - pub CallNonvirtualLongMethodV: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jclass, - arg4: jmethodID, - arg5: va_list, - ) -> jlong, - >, - pub CallNonvirtualLongMethodA: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jclass, - arg4: jmethodID, - arg5: *const jvalue, - ) -> jlong, - >, - pub CallNonvirtualFloatMethod: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jclass, - arg4: jmethodID, - ... - ) -> jfloat, - >, - pub CallNonvirtualFloatMethodV: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jclass, - arg4: jmethodID, - arg5: va_list, - ) -> jfloat, - >, - pub CallNonvirtualFloatMethodA: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jclass, - arg4: jmethodID, - arg5: *const jvalue, - ) -> jfloat, - >, - pub CallNonvirtualDoubleMethod: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jclass, - arg4: jmethodID, - ... - ) -> jdouble, - >, - pub CallNonvirtualDoubleMethodV: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jclass, - arg4: jmethodID, - arg5: va_list, - ) -> jdouble, - >, - pub CallNonvirtualDoubleMethodA: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jclass, - arg4: jmethodID, - arg5: *const jvalue, - ) -> jdouble, - >, - pub CallNonvirtualVoidMethod: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobject, arg3: jclass, arg4: jmethodID, ...), - >, - pub CallNonvirtualVoidMethodV: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jclass, - arg4: jmethodID, - arg5: va_list, - ), - >, - pub CallNonvirtualVoidMethodA: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jobject, - arg3: jclass, - arg4: jmethodID, - arg5: *const jvalue, - ), - >, - pub GetFieldID: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jclass, - arg3: *const ::std::os::raw::c_char, - arg4: *const ::std::os::raw::c_char, - ) -> jfieldID, - >, - pub GetObjectField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobject, arg3: jfieldID) -> jobject, - >, - pub GetBooleanField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobject, arg3: jfieldID) -> jboolean, - >, - pub GetByteField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobject, arg3: jfieldID) -> jbyte, - >, - pub GetCharField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobject, arg3: jfieldID) -> jchar, - >, - pub GetShortField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobject, arg3: jfieldID) -> jshort, - >, - pub GetIntField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobject, arg3: jfieldID) -> jint, - >, - pub GetLongField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobject, arg3: jfieldID) -> jlong, - >, - pub GetFloatField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobject, arg3: jfieldID) -> jfloat, - >, - pub GetDoubleField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobject, arg3: jfieldID) -> jdouble, - >, - pub SetObjectField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobject, arg3: jfieldID, arg4: jobject), - >, - pub SetBooleanField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobject, arg3: jfieldID, arg4: jboolean), - >, - pub SetByteField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobject, arg3: jfieldID, arg4: jbyte), - >, - pub SetCharField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobject, arg3: jfieldID, arg4: jchar), - >, - pub SetShortField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobject, arg3: jfieldID, arg4: jshort), - >, - pub SetIntField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobject, arg3: jfieldID, arg4: jint), - >, - pub SetLongField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobject, arg3: jfieldID, arg4: jlong), - >, - pub SetFloatField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobject, arg3: jfieldID, arg4: jfloat), - >, - pub SetDoubleField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobject, arg3: jfieldID, arg4: jdouble), - >, - pub GetStaticMethodID: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jclass, - arg3: *const ::std::os::raw::c_char, - arg4: *const ::std::os::raw::c_char, - ) -> jmethodID, - >, - pub CallStaticObjectMethod: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jclass, arg3: jmethodID, ...) -> jobject, - >, - pub CallStaticObjectMethodV: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jclass, - arg3: jmethodID, - arg4: va_list, - ) -> jobject, - >, - pub CallStaticObjectMethodA: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jclass, - arg3: jmethodID, - arg4: *const jvalue, - ) -> jobject, - >, - pub CallStaticBooleanMethod: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jclass, arg3: jmethodID, ...) -> jboolean, - >, - pub CallStaticBooleanMethodV: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jclass, - arg3: jmethodID, - arg4: va_list, - ) -> jboolean, - >, - pub CallStaticBooleanMethodA: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jclass, - arg3: jmethodID, - arg4: *const jvalue, - ) -> jboolean, - >, - pub CallStaticByteMethod: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jclass, arg3: jmethodID, ...) -> jbyte, - >, - pub CallStaticByteMethodV: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jclass, - arg3: jmethodID, - arg4: va_list, - ) -> jbyte, - >, - pub CallStaticByteMethodA: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jclass, - arg3: jmethodID, - arg4: *const jvalue, - ) -> jbyte, - >, - pub CallStaticCharMethod: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jclass, arg3: jmethodID, ...) -> jchar, - >, - pub CallStaticCharMethodV: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jclass, - arg3: jmethodID, - arg4: va_list, - ) -> jchar, - >, - pub CallStaticCharMethodA: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jclass, - arg3: jmethodID, - arg4: *const jvalue, - ) -> jchar, - >, - pub CallStaticShortMethod: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jclass, arg3: jmethodID, ...) -> jshort, - >, - pub CallStaticShortMethodV: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jclass, - arg3: jmethodID, - arg4: va_list, - ) -> jshort, - >, - pub CallStaticShortMethodA: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jclass, - arg3: jmethodID, - arg4: *const jvalue, - ) -> jshort, - >, - pub CallStaticIntMethod: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jclass, arg3: jmethodID, ...) -> jint, - >, - pub CallStaticIntMethodV: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jclass, - arg3: jmethodID, - arg4: va_list, - ) -> jint, - >, - pub CallStaticIntMethodA: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jclass, - arg3: jmethodID, - arg4: *const jvalue, - ) -> jint, - >, - pub CallStaticLongMethod: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jclass, arg3: jmethodID, ...) -> jlong, - >, - pub CallStaticLongMethodV: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jclass, - arg3: jmethodID, - arg4: va_list, - ) -> jlong, - >, - pub CallStaticLongMethodA: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jclass, - arg3: jmethodID, - arg4: *const jvalue, - ) -> jlong, - >, - pub CallStaticFloatMethod: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jclass, arg3: jmethodID, ...) -> jfloat, - >, - pub CallStaticFloatMethodV: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jclass, - arg3: jmethodID, - arg4: va_list, - ) -> jfloat, - >, - pub CallStaticFloatMethodA: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jclass, - arg3: jmethodID, - arg4: *const jvalue, - ) -> jfloat, - >, - pub CallStaticDoubleMethod: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jclass, arg3: jmethodID, ...) -> jdouble, - >, - pub CallStaticDoubleMethodV: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jclass, - arg3: jmethodID, - arg4: va_list, - ) -> jdouble, - >, - pub CallStaticDoubleMethodA: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jclass, - arg3: jmethodID, - arg4: *const jvalue, - ) -> jdouble, - >, - pub CallStaticVoidMethod: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jclass, arg3: jmethodID, ...), - >, - pub CallStaticVoidMethodV: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jclass, arg3: jmethodID, arg4: va_list), - >, - pub CallStaticVoidMethodA: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jclass, arg3: jmethodID, arg4: *const jvalue), - >, - pub GetStaticFieldID: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jclass, - arg3: *const ::std::os::raw::c_char, - arg4: *const ::std::os::raw::c_char, - ) -> jfieldID, - >, - pub GetStaticObjectField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jclass, arg3: jfieldID) -> jobject, - >, - pub GetStaticBooleanField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jclass, arg3: jfieldID) -> jboolean, - >, - pub GetStaticByteField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jclass, arg3: jfieldID) -> jbyte, - >, - pub GetStaticCharField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jclass, arg3: jfieldID) -> jchar, - >, - pub GetStaticShortField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jclass, arg3: jfieldID) -> jshort, - >, - pub GetStaticIntField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jclass, arg3: jfieldID) -> jint, - >, - pub GetStaticLongField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jclass, arg3: jfieldID) -> jlong, - >, - pub GetStaticFloatField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jclass, arg3: jfieldID) -> jfloat, - >, - pub GetStaticDoubleField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jclass, arg3: jfieldID) -> jdouble, - >, - pub SetStaticObjectField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jclass, arg3: jfieldID, arg4: jobject), - >, - pub SetStaticBooleanField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jclass, arg3: jfieldID, arg4: jboolean), - >, - pub SetStaticByteField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jclass, arg3: jfieldID, arg4: jbyte), - >, - pub SetStaticCharField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jclass, arg3: jfieldID, arg4: jchar), - >, - pub SetStaticShortField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jclass, arg3: jfieldID, arg4: jshort), - >, - pub SetStaticIntField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jclass, arg3: jfieldID, arg4: jint), - >, - pub SetStaticLongField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jclass, arg3: jfieldID, arg4: jlong), - >, - pub SetStaticFloatField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jclass, arg3: jfieldID, arg4: jfloat), - >, - pub SetStaticDoubleField: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jclass, arg3: jfieldID, arg4: jdouble), - >, - pub NewString: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: *const jchar, arg3: jsize) -> jstring, - >, - pub GetStringLength: - ::std::option::Option jsize>, - pub GetStringChars: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jstring, arg3: *mut jboolean) -> *const jchar, - >, - pub ReleaseStringChars: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jstring, arg3: *const jchar), - >, - pub NewStringUTF: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: *const ::std::os::raw::c_char) -> jstring, - >, - pub GetStringUTFLength: - ::std::option::Option jsize>, - pub GetStringUTFChars: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jstring, - arg3: *mut jboolean, - ) -> *const ::std::os::raw::c_char, - >, - pub ReleaseStringUTFChars: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jstring, arg3: *const ::std::os::raw::c_char), - >, - pub GetArrayLength: - ::std::option::Option jsize>, - pub NewObjectArray: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jsize, - arg3: jclass, - arg4: jobject, - ) -> jobjectArray, - >, - pub GetObjectArrayElement: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobjectArray, arg3: jsize) -> jobject, - >, - pub SetObjectArrayElement: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobjectArray, arg3: jsize, arg4: jobject), - >, - pub NewBooleanArray: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jsize) -> jbooleanArray, - >, - pub NewByteArray: - ::std::option::Option jbyteArray>, - pub NewCharArray: - ::std::option::Option jcharArray>, - pub NewShortArray: - ::std::option::Option jshortArray>, - pub NewIntArray: - ::std::option::Option jintArray>, - pub NewLongArray: - ::std::option::Option jlongArray>, - pub NewFloatArray: - ::std::option::Option jfloatArray>, - pub NewDoubleArray: - ::std::option::Option jdoubleArray>, - pub GetBooleanArrayElements: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jbooleanArray, - arg3: *mut jboolean, - ) -> *mut jboolean, - >, - pub GetByteArrayElements: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jbyteArray, - arg3: *mut jboolean, - ) -> *mut jbyte, - >, - pub GetCharArrayElements: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jcharArray, - arg3: *mut jboolean, - ) -> *mut jchar, - >, - pub GetShortArrayElements: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jshortArray, - arg3: *mut jboolean, - ) -> *mut jshort, - >, - pub GetIntArrayElements: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jintArray, arg3: *mut jboolean) -> *mut jint, - >, - pub GetLongArrayElements: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jlongArray, - arg3: *mut jboolean, - ) -> *mut jlong, - >, - pub GetFloatArrayElements: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jfloatArray, - arg3: *mut jboolean, - ) -> *mut jfloat, - >, - pub GetDoubleArrayElements: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jdoubleArray, - arg3: *mut jboolean, - ) -> *mut jdouble, - >, - pub ReleaseBooleanArrayElements: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jbooleanArray, - arg3: *mut jboolean, - arg4: jint, - ), - >, - pub ReleaseByteArrayElements: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jbyteArray, arg3: *mut jbyte, arg4: jint), - >, - pub ReleaseCharArrayElements: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jcharArray, arg3: *mut jchar, arg4: jint), - >, - pub ReleaseShortArrayElements: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jshortArray, arg3: *mut jshort, arg4: jint), - >, - pub ReleaseIntArrayElements: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jintArray, arg3: *mut jint, arg4: jint), - >, - pub ReleaseLongArrayElements: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jlongArray, arg3: *mut jlong, arg4: jint), - >, - pub ReleaseFloatArrayElements: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jfloatArray, arg3: *mut jfloat, arg4: jint), - >, - pub ReleaseDoubleArrayElements: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jdoubleArray, arg3: *mut jdouble, arg4: jint), - >, - pub GetBooleanArrayRegion: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jbooleanArray, - arg3: jsize, - arg4: jsize, - arg5: *mut jboolean, - ), - >, - pub GetByteArrayRegion: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jbyteArray, - arg3: jsize, - arg4: jsize, - arg5: *mut jbyte, - ), - >, - pub GetCharArrayRegion: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jcharArray, - arg3: jsize, - arg4: jsize, - arg5: *mut jchar, - ), - >, - pub GetShortArrayRegion: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jshortArray, - arg3: jsize, - arg4: jsize, - arg5: *mut jshort, - ), - >, - pub GetIntArrayRegion: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jintArray, - arg3: jsize, - arg4: jsize, - arg5: *mut jint, - ), - >, - pub GetLongArrayRegion: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jlongArray, - arg3: jsize, - arg4: jsize, - arg5: *mut jlong, - ), - >, - pub GetFloatArrayRegion: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jfloatArray, - arg3: jsize, - arg4: jsize, - arg5: *mut jfloat, - ), - >, - pub GetDoubleArrayRegion: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jdoubleArray, - arg3: jsize, - arg4: jsize, - arg5: *mut jdouble, - ), - >, - pub SetBooleanArrayRegion: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jbooleanArray, - arg3: jsize, - arg4: jsize, - arg5: *const jboolean, - ), - >, - pub SetByteArrayRegion: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jbyteArray, - arg3: jsize, - arg4: jsize, - arg5: *const jbyte, - ), - >, - pub SetCharArrayRegion: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jcharArray, - arg3: jsize, - arg4: jsize, - arg5: *const jchar, - ), - >, - pub SetShortArrayRegion: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jshortArray, - arg3: jsize, - arg4: jsize, - arg5: *const jshort, - ), - >, - pub SetIntArrayRegion: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jintArray, - arg3: jsize, - arg4: jsize, - arg5: *const jint, - ), - >, - pub SetLongArrayRegion: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jlongArray, - arg3: jsize, - arg4: jsize, - arg5: *const jlong, - ), - >, - pub SetFloatArrayRegion: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jfloatArray, - arg3: jsize, - arg4: jsize, - arg5: *const jfloat, - ), - >, - pub SetDoubleArrayRegion: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jdoubleArray, - arg3: jsize, - arg4: jsize, - arg5: *const jdouble, - ), - >, - pub RegisterNatives: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jclass, - arg3: *const JNINativeMethod, - arg4: jint, - ) -> jint, - >, - pub UnregisterNatives: - ::std::option::Option jint>, - pub MonitorEnter: - ::std::option::Option jint>, - pub MonitorExit: - ::std::option::Option jint>, - pub GetJavaVM: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: *mut *mut JavaVM) -> jint, - >, - pub GetStringRegion: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jstring, - arg3: jsize, - arg4: jsize, - arg5: *mut jchar, - ), - >, - pub GetStringUTFRegion: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jstring, - arg3: jsize, - arg4: jsize, - arg5: *mut ::std::os::raw::c_char, - ), - >, - pub GetPrimitiveArrayCritical: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jarray, - arg3: *mut jboolean, - ) -> *mut ::std::os::raw::c_void, - >, - pub ReleasePrimitiveArrayCritical: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: jarray, - arg3: *mut ::std::os::raw::c_void, - arg4: jint, - ), - >, - pub GetStringCritical: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jstring, arg3: *mut jboolean) -> *const jchar, - >, - pub ReleaseStringCritical: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jstring, arg3: *const jchar), - >, - pub NewWeakGlobalRef: - ::std::option::Option jweak>, - pub DeleteWeakGlobalRef: - ::std::option::Option, - pub ExceptionCheck: ::std::option::Option jboolean>, - pub NewDirectByteBuffer: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JNIEnv, - arg2: *mut ::std::os::raw::c_void, - arg3: jlong, - ) -> jobject, - >, - pub GetDirectBufferAddress: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobject) -> *mut ::std::os::raw::c_void, - >, - pub GetDirectBufferCapacity: - ::std::option::Option jlong>, - pub GetObjectRefType: ::std::option::Option< - unsafe extern "C" fn(arg1: *mut JNIEnv, arg2: jobject) -> jobjectRefType, - >, -} -#[test] -fn bindgen_test_layout_JNINativeInterface() { - assert_eq!( - ::std::mem::size_of::(), - 932usize, - concat!("Size of: ", stringify!(JNINativeInterface)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(JNINativeInterface)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved0 as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(reserved0) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved1 as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(reserved1) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved2 as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(reserved2) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved3 as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(reserved3) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).GetVersion as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetVersion) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).DefineClass as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(DefineClass) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).FindClass as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(FindClass) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).FromReflectedMethod as *const _ as usize - }, - 28usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(FromReflectedMethod) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).FromReflectedField as *const _ as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(FromReflectedField) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ToReflectedMethod as *const _ as usize - }, - 36usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(ToReflectedMethod) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetSuperclass as *const _ as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetSuperclass) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).IsAssignableFrom as *const _ as usize - }, - 44usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(IsAssignableFrom) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ToReflectedField as *const _ as usize - }, - 48usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(ToReflectedField) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).Throw as *const _ as usize }, - 52usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(Throw) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ThrowNew as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(ThrowNew) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ExceptionOccurred as *const _ as usize - }, - 60usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(ExceptionOccurred) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ExceptionDescribe as *const _ as usize - }, - 64usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(ExceptionDescribe) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ExceptionClear as *const _ as usize - }, - 68usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(ExceptionClear) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).FatalError as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(FatalError) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).PushLocalFrame as *const _ as usize - }, - 76usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(PushLocalFrame) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).PopLocalFrame as *const _ as usize - }, - 80usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(PopLocalFrame) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).NewGlobalRef as *const _ as usize }, - 84usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(NewGlobalRef) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).DeleteGlobalRef as *const _ as usize - }, - 88usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(DeleteGlobalRef) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).DeleteLocalRef as *const _ as usize - }, - 92usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(DeleteLocalRef) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).IsSameObject as *const _ as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(IsSameObject) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).NewLocalRef as *const _ as usize }, - 100usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(NewLocalRef) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).EnsureLocalCapacity as *const _ as usize - }, - 104usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(EnsureLocalCapacity) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).AllocObject as *const _ as usize }, - 108usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(AllocObject) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).NewObject as *const _ as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(NewObject) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).NewObjectV as *const _ as usize }, - 116usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(NewObjectV) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).NewObjectA as *const _ as usize }, - 120usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(NewObjectA) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetObjectClass as *const _ as usize - }, - 124usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetObjectClass) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).IsInstanceOf as *const _ as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(IsInstanceOf) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).GetMethodID as *const _ as usize }, - 132usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetMethodID) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallObjectMethod as *const _ as usize - }, - 136usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallObjectMethod) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallObjectMethodV as *const _ as usize - }, - 140usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallObjectMethodV) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallObjectMethodA as *const _ as usize - }, - 144usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallObjectMethodA) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallBooleanMethod as *const _ as usize - }, - 148usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallBooleanMethod) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallBooleanMethodV as *const _ as usize - }, - 152usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallBooleanMethodV) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallBooleanMethodA as *const _ as usize - }, - 156usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallBooleanMethodA) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallByteMethod as *const _ as usize - }, - 160usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallByteMethod) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallByteMethodV as *const _ as usize - }, - 164usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallByteMethodV) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallByteMethodA as *const _ as usize - }, - 168usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallByteMethodA) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallCharMethod as *const _ as usize - }, - 172usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallCharMethod) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallCharMethodV as *const _ as usize - }, - 176usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallCharMethodV) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallCharMethodA as *const _ as usize - }, - 180usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallCharMethodA) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallShortMethod as *const _ as usize - }, - 184usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallShortMethod) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallShortMethodV as *const _ as usize - }, - 188usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallShortMethodV) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallShortMethodA as *const _ as usize - }, - 192usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallShortMethodA) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallIntMethod as *const _ as usize - }, - 196usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallIntMethod) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallIntMethodV as *const _ as usize - }, - 200usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallIntMethodV) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallIntMethodA as *const _ as usize - }, - 204usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallIntMethodA) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallLongMethod as *const _ as usize - }, - 208usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallLongMethod) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallLongMethodV as *const _ as usize - }, - 212usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallLongMethodV) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallLongMethodA as *const _ as usize - }, - 216usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallLongMethodA) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallFloatMethod as *const _ as usize - }, - 220usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallFloatMethod) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallFloatMethodV as *const _ as usize - }, - 224usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallFloatMethodV) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallFloatMethodA as *const _ as usize - }, - 228usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallFloatMethodA) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallDoubleMethod as *const _ as usize - }, - 232usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallDoubleMethod) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallDoubleMethodV as *const _ as usize - }, - 236usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallDoubleMethodV) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallDoubleMethodA as *const _ as usize - }, - 240usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallDoubleMethodA) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallVoidMethod as *const _ as usize - }, - 244usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallVoidMethod) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallVoidMethodV as *const _ as usize - }, - 248usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallVoidMethodV) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallVoidMethodA as *const _ as usize - }, - 252usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallVoidMethodA) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallNonvirtualObjectMethod as *const _ - as usize - }, - 256usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallNonvirtualObjectMethod) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallNonvirtualObjectMethodV as *const _ - as usize - }, - 260usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallNonvirtualObjectMethodV) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallNonvirtualObjectMethodA as *const _ - as usize - }, - 264usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallNonvirtualObjectMethodA) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallNonvirtualBooleanMethod as *const _ - as usize - }, - 268usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallNonvirtualBooleanMethod) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallNonvirtualBooleanMethodV as *const _ - as usize - }, - 272usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallNonvirtualBooleanMethodV) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallNonvirtualBooleanMethodA as *const _ - as usize - }, - 276usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallNonvirtualBooleanMethodA) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallNonvirtualByteMethod as *const _ - as usize - }, - 280usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallNonvirtualByteMethod) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallNonvirtualByteMethodV as *const _ - as usize - }, - 284usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallNonvirtualByteMethodV) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallNonvirtualByteMethodA as *const _ - as usize - }, - 288usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallNonvirtualByteMethodA) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallNonvirtualCharMethod as *const _ - as usize - }, - 292usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallNonvirtualCharMethod) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallNonvirtualCharMethodV as *const _ - as usize - }, - 296usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallNonvirtualCharMethodV) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallNonvirtualCharMethodA as *const _ - as usize - }, - 300usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallNonvirtualCharMethodA) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallNonvirtualShortMethod as *const _ - as usize - }, - 304usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallNonvirtualShortMethod) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallNonvirtualShortMethodV as *const _ - as usize - }, - 308usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallNonvirtualShortMethodV) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallNonvirtualShortMethodA as *const _ - as usize - }, - 312usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallNonvirtualShortMethodA) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallNonvirtualIntMethod as *const _ - as usize - }, - 316usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallNonvirtualIntMethod) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallNonvirtualIntMethodV as *const _ - as usize - }, - 320usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallNonvirtualIntMethodV) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallNonvirtualIntMethodA as *const _ - as usize - }, - 324usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallNonvirtualIntMethodA) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallNonvirtualLongMethod as *const _ - as usize - }, - 328usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallNonvirtualLongMethod) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallNonvirtualLongMethodV as *const _ - as usize - }, - 332usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallNonvirtualLongMethodV) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallNonvirtualLongMethodA as *const _ - as usize - }, - 336usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallNonvirtualLongMethodA) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallNonvirtualFloatMethod as *const _ - as usize - }, - 340usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallNonvirtualFloatMethod) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallNonvirtualFloatMethodV as *const _ - as usize - }, - 344usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallNonvirtualFloatMethodV) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallNonvirtualFloatMethodA as *const _ - as usize - }, - 348usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallNonvirtualFloatMethodA) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallNonvirtualDoubleMethod as *const _ - as usize - }, - 352usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallNonvirtualDoubleMethod) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallNonvirtualDoubleMethodV as *const _ - as usize - }, - 356usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallNonvirtualDoubleMethodV) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallNonvirtualDoubleMethodA as *const _ - as usize - }, - 360usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallNonvirtualDoubleMethodA) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallNonvirtualVoidMethod as *const _ - as usize - }, - 364usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallNonvirtualVoidMethod) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallNonvirtualVoidMethodV as *const _ - as usize - }, - 368usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallNonvirtualVoidMethodV) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallNonvirtualVoidMethodA as *const _ - as usize - }, - 372usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallNonvirtualVoidMethodA) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).GetFieldID as *const _ as usize }, - 376usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetFieldID) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetObjectField as *const _ as usize - }, - 380usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetObjectField) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetBooleanField as *const _ as usize - }, - 384usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetBooleanField) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).GetByteField as *const _ as usize }, - 388usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetByteField) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).GetCharField as *const _ as usize }, - 392usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetCharField) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetShortField as *const _ as usize - }, - 396usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetShortField) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).GetIntField as *const _ as usize }, - 400usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetIntField) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).GetLongField as *const _ as usize }, - 404usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetLongField) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetFloatField as *const _ as usize - }, - 408usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetFloatField) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetDoubleField as *const _ as usize - }, - 412usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetDoubleField) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).SetObjectField as *const _ as usize - }, - 416usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(SetObjectField) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).SetBooleanField as *const _ as usize - }, - 420usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(SetBooleanField) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).SetByteField as *const _ as usize }, - 424usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(SetByteField) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).SetCharField as *const _ as usize }, - 428usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(SetCharField) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).SetShortField as *const _ as usize - }, - 432usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(SetShortField) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).SetIntField as *const _ as usize }, - 436usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(SetIntField) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).SetLongField as *const _ as usize }, - 440usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(SetLongField) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).SetFloatField as *const _ as usize - }, - 444usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(SetFloatField) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).SetDoubleField as *const _ as usize - }, - 448usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(SetDoubleField) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetStaticMethodID as *const _ as usize - }, - 452usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetStaticMethodID) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallStaticObjectMethod as *const _ - as usize - }, - 456usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallStaticObjectMethod) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallStaticObjectMethodV as *const _ - as usize - }, - 460usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallStaticObjectMethodV) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallStaticObjectMethodA as *const _ - as usize - }, - 464usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallStaticObjectMethodA) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallStaticBooleanMethod as *const _ - as usize - }, - 468usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallStaticBooleanMethod) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallStaticBooleanMethodV as *const _ - as usize - }, - 472usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallStaticBooleanMethodV) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallStaticBooleanMethodA as *const _ - as usize - }, - 476usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallStaticBooleanMethodA) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallStaticByteMethod as *const _ as usize - }, - 480usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallStaticByteMethod) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallStaticByteMethodV as *const _ - as usize - }, - 484usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallStaticByteMethodV) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallStaticByteMethodA as *const _ - as usize - }, - 488usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallStaticByteMethodA) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallStaticCharMethod as *const _ as usize - }, - 492usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallStaticCharMethod) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallStaticCharMethodV as *const _ - as usize - }, - 496usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallStaticCharMethodV) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallStaticCharMethodA as *const _ - as usize - }, - 500usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallStaticCharMethodA) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallStaticShortMethod as *const _ - as usize - }, - 504usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallStaticShortMethod) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallStaticShortMethodV as *const _ - as usize - }, - 508usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallStaticShortMethodV) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallStaticShortMethodA as *const _ - as usize - }, - 512usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallStaticShortMethodA) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallStaticIntMethod as *const _ as usize - }, - 516usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallStaticIntMethod) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallStaticIntMethodV as *const _ as usize - }, - 520usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallStaticIntMethodV) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallStaticIntMethodA as *const _ as usize - }, - 524usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallStaticIntMethodA) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallStaticLongMethod as *const _ as usize - }, - 528usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallStaticLongMethod) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallStaticLongMethodV as *const _ - as usize - }, - 532usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallStaticLongMethodV) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallStaticLongMethodA as *const _ - as usize - }, - 536usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallStaticLongMethodA) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallStaticFloatMethod as *const _ - as usize - }, - 540usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallStaticFloatMethod) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallStaticFloatMethodV as *const _ - as usize - }, - 544usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallStaticFloatMethodV) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallStaticFloatMethodA as *const _ - as usize - }, - 548usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallStaticFloatMethodA) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallStaticDoubleMethod as *const _ - as usize - }, - 552usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallStaticDoubleMethod) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallStaticDoubleMethodV as *const _ - as usize - }, - 556usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallStaticDoubleMethodV) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallStaticDoubleMethodA as *const _ - as usize - }, - 560usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallStaticDoubleMethodA) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallStaticVoidMethod as *const _ as usize - }, - 564usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallStaticVoidMethod) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallStaticVoidMethodV as *const _ - as usize - }, - 568usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallStaticVoidMethodV) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).CallStaticVoidMethodA as *const _ - as usize - }, - 572usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(CallStaticVoidMethodA) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetStaticFieldID as *const _ as usize - }, - 576usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetStaticFieldID) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetStaticObjectField as *const _ as usize - }, - 580usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetStaticObjectField) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetStaticBooleanField as *const _ - as usize - }, - 584usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetStaticBooleanField) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetStaticByteField as *const _ as usize - }, - 588usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetStaticByteField) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetStaticCharField as *const _ as usize - }, - 592usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetStaticCharField) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetStaticShortField as *const _ as usize - }, - 596usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetStaticShortField) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetStaticIntField as *const _ as usize - }, - 600usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetStaticIntField) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetStaticLongField as *const _ as usize - }, - 604usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetStaticLongField) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetStaticFloatField as *const _ as usize - }, - 608usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetStaticFloatField) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetStaticDoubleField as *const _ as usize - }, - 612usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetStaticDoubleField) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).SetStaticObjectField as *const _ as usize - }, - 616usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(SetStaticObjectField) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).SetStaticBooleanField as *const _ - as usize - }, - 620usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(SetStaticBooleanField) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).SetStaticByteField as *const _ as usize - }, - 624usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(SetStaticByteField) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).SetStaticCharField as *const _ as usize - }, - 628usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(SetStaticCharField) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).SetStaticShortField as *const _ as usize - }, - 632usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(SetStaticShortField) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).SetStaticIntField as *const _ as usize - }, - 636usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(SetStaticIntField) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).SetStaticLongField as *const _ as usize - }, - 640usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(SetStaticLongField) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).SetStaticFloatField as *const _ as usize - }, - 644usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(SetStaticFloatField) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).SetStaticDoubleField as *const _ as usize - }, - 648usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(SetStaticDoubleField) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).NewString as *const _ as usize }, - 652usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(NewString) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetStringLength as *const _ as usize - }, - 656usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetStringLength) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetStringChars as *const _ as usize - }, - 660usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetStringChars) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ReleaseStringChars as *const _ as usize - }, - 664usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(ReleaseStringChars) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).NewStringUTF as *const _ as usize }, - 668usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(NewStringUTF) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetStringUTFLength as *const _ as usize - }, - 672usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetStringUTFLength) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetStringUTFChars as *const _ as usize - }, - 676usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetStringUTFChars) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ReleaseStringUTFChars as *const _ - as usize - }, - 680usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(ReleaseStringUTFChars) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetArrayLength as *const _ as usize - }, - 684usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetArrayLength) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).NewObjectArray as *const _ as usize - }, - 688usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(NewObjectArray) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetObjectArrayElement as *const _ - as usize - }, - 692usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetObjectArrayElement) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).SetObjectArrayElement as *const _ - as usize - }, - 696usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(SetObjectArrayElement) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).NewBooleanArray as *const _ as usize - }, - 700usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(NewBooleanArray) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).NewByteArray as *const _ as usize }, - 704usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(NewByteArray) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).NewCharArray as *const _ as usize }, - 708usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(NewCharArray) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).NewShortArray as *const _ as usize - }, - 712usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(NewShortArray) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).NewIntArray as *const _ as usize }, - 716usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(NewIntArray) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).NewLongArray as *const _ as usize }, - 720usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(NewLongArray) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).NewFloatArray as *const _ as usize - }, - 724usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(NewFloatArray) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).NewDoubleArray as *const _ as usize - }, - 728usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(NewDoubleArray) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetBooleanArrayElements as *const _ - as usize - }, - 732usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetBooleanArrayElements) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetByteArrayElements as *const _ as usize - }, - 736usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetByteArrayElements) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetCharArrayElements as *const _ as usize - }, - 740usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetCharArrayElements) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetShortArrayElements as *const _ - as usize - }, - 744usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetShortArrayElements) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetIntArrayElements as *const _ as usize - }, - 748usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetIntArrayElements) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetLongArrayElements as *const _ as usize - }, - 752usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetLongArrayElements) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetFloatArrayElements as *const _ - as usize - }, - 756usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetFloatArrayElements) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetDoubleArrayElements as *const _ - as usize - }, - 760usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetDoubleArrayElements) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ReleaseBooleanArrayElements as *const _ - as usize - }, - 764usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(ReleaseBooleanArrayElements) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ReleaseByteArrayElements as *const _ - as usize - }, - 768usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(ReleaseByteArrayElements) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ReleaseCharArrayElements as *const _ - as usize - }, - 772usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(ReleaseCharArrayElements) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ReleaseShortArrayElements as *const _ - as usize - }, - 776usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(ReleaseShortArrayElements) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ReleaseIntArrayElements as *const _ - as usize - }, - 780usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(ReleaseIntArrayElements) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ReleaseLongArrayElements as *const _ - as usize - }, - 784usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(ReleaseLongArrayElements) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ReleaseFloatArrayElements as *const _ - as usize - }, - 788usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(ReleaseFloatArrayElements) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ReleaseDoubleArrayElements as *const _ - as usize - }, - 792usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(ReleaseDoubleArrayElements) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetBooleanArrayRegion as *const _ - as usize - }, - 796usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetBooleanArrayRegion) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetByteArrayRegion as *const _ as usize - }, - 800usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetByteArrayRegion) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetCharArrayRegion as *const _ as usize - }, - 804usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetCharArrayRegion) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetShortArrayRegion as *const _ as usize - }, - 808usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetShortArrayRegion) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetIntArrayRegion as *const _ as usize - }, - 812usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetIntArrayRegion) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetLongArrayRegion as *const _ as usize - }, - 816usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetLongArrayRegion) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetFloatArrayRegion as *const _ as usize - }, - 820usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetFloatArrayRegion) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetDoubleArrayRegion as *const _ as usize - }, - 824usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetDoubleArrayRegion) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).SetBooleanArrayRegion as *const _ - as usize - }, - 828usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(SetBooleanArrayRegion) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).SetByteArrayRegion as *const _ as usize - }, - 832usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(SetByteArrayRegion) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).SetCharArrayRegion as *const _ as usize - }, - 836usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(SetCharArrayRegion) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).SetShortArrayRegion as *const _ as usize - }, - 840usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(SetShortArrayRegion) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).SetIntArrayRegion as *const _ as usize - }, - 844usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(SetIntArrayRegion) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).SetLongArrayRegion as *const _ as usize - }, - 848usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(SetLongArrayRegion) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).SetFloatArrayRegion as *const _ as usize - }, - 852usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(SetFloatArrayRegion) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).SetDoubleArrayRegion as *const _ as usize - }, - 856usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(SetDoubleArrayRegion) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).RegisterNatives as *const _ as usize - }, - 860usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(RegisterNatives) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).UnregisterNatives as *const _ as usize - }, - 864usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(UnregisterNatives) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).MonitorEnter as *const _ as usize }, - 868usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(MonitorEnter) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).MonitorExit as *const _ as usize }, - 872usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(MonitorExit) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).GetJavaVM as *const _ as usize }, - 876usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetJavaVM) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetStringRegion as *const _ as usize - }, - 880usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetStringRegion) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetStringUTFRegion as *const _ as usize - }, - 884usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetStringUTFRegion) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetPrimitiveArrayCritical as *const _ - as usize - }, - 888usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetPrimitiveArrayCritical) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ReleasePrimitiveArrayCritical as *const _ - as usize - }, - 892usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(ReleasePrimitiveArrayCritical) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetStringCritical as *const _ as usize - }, - 896usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetStringCritical) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ReleaseStringCritical as *const _ - as usize - }, - 900usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(ReleaseStringCritical) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).NewWeakGlobalRef as *const _ as usize - }, - 904usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(NewWeakGlobalRef) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).DeleteWeakGlobalRef as *const _ as usize - }, - 908usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(DeleteWeakGlobalRef) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).ExceptionCheck as *const _ as usize - }, - 912usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(ExceptionCheck) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).NewDirectByteBuffer as *const _ as usize - }, - 916usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(NewDirectByteBuffer) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetDirectBufferAddress as *const _ - as usize - }, - 920usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetDirectBufferAddress) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetDirectBufferCapacity as *const _ - as usize - }, - 924usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetDirectBufferCapacity) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).GetObjectRefType as *const _ as usize - }, - 928usize, - concat!( - "Offset of field: ", - stringify!(JNINativeInterface), - "::", - stringify!(GetObjectRefType) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _JNIEnv { - pub functions: *const JNINativeInterface, -} -#[test] -fn bindgen_test_layout__JNIEnv() { - assert_eq!( - ::std::mem::size_of::<_JNIEnv>(), - 4usize, - concat!("Size of: ", stringify!(_JNIEnv)) - ); - assert_eq!( - ::std::mem::align_of::<_JNIEnv>(), - 4usize, - concat!("Alignment of ", stringify!(_JNIEnv)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_JNIEnv>())).functions as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JNIEnv), - "::", - stringify!(functions) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JNIInvokeInterface { - pub reserved0: *mut ::std::os::raw::c_void, - pub reserved1: *mut ::std::os::raw::c_void, - pub reserved2: *mut ::std::os::raw::c_void, - pub DestroyJavaVM: ::std::option::Option jint>, - pub AttachCurrentThread: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JavaVM, - arg2: *mut *mut JNIEnv, - arg3: *mut ::std::os::raw::c_void, - ) -> jint, - >, - pub DetachCurrentThread: ::std::option::Option jint>, - pub GetEnv: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JavaVM, - arg2: *mut *mut ::std::os::raw::c_void, - arg3: jint, - ) -> jint, - >, - pub AttachCurrentThreadAsDaemon: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut JavaVM, - arg2: *mut *mut JNIEnv, - arg3: *mut ::std::os::raw::c_void, - ) -> jint, - >, -} -#[test] -fn bindgen_test_layout_JNIInvokeInterface() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(JNIInvokeInterface)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(JNIInvokeInterface)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved0 as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JNIInvokeInterface), - "::", - stringify!(reserved0) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved1 as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(JNIInvokeInterface), - "::", - stringify!(reserved1) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved2 as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(JNIInvokeInterface), - "::", - stringify!(reserved2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).DestroyJavaVM as *const _ as usize - }, - 12usize, - concat!( - "Offset of field: ", - stringify!(JNIInvokeInterface), - "::", - stringify!(DestroyJavaVM) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).AttachCurrentThread as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(JNIInvokeInterface), - "::", - stringify!(AttachCurrentThread) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).DetachCurrentThread as *const _ as usize - }, - 20usize, - concat!( - "Offset of field: ", - stringify!(JNIInvokeInterface), - "::", - stringify!(DetachCurrentThread) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).GetEnv as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(JNIInvokeInterface), - "::", - stringify!(GetEnv) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).AttachCurrentThreadAsDaemon as *const _ - as usize - }, - 28usize, - concat!( - "Offset of field: ", - stringify!(JNIInvokeInterface), - "::", - stringify!(AttachCurrentThreadAsDaemon) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _JavaVM { - pub functions: *const JNIInvokeInterface, -} -#[test] -fn bindgen_test_layout__JavaVM() { - assert_eq!( - ::std::mem::size_of::<_JavaVM>(), - 4usize, - concat!("Size of: ", stringify!(_JavaVM)) - ); - assert_eq!( - ::std::mem::align_of::<_JavaVM>(), - 4usize, - concat!("Alignment of ", stringify!(_JavaVM)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_JavaVM>())).functions as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JavaVM), - "::", - stringify!(functions) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JavaVMAttachArgs { - pub version: jint, - pub name: *const ::std::os::raw::c_char, - pub group: jobject, -} -#[test] -fn bindgen_test_layout_JavaVMAttachArgs() { - assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(JavaVMAttachArgs)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(JavaVMAttachArgs)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).version as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JavaVMAttachArgs), - "::", - stringify!(version) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).name as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(JavaVMAttachArgs), - "::", - stringify!(name) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).group as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(JavaVMAttachArgs), - "::", - stringify!(group) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct JavaVMOption { - pub optionString: *const ::std::os::raw::c_char, - pub extraInfo: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout_JavaVMOption() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(JavaVMOption)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(JavaVMOption)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).optionString as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(JavaVMOption), - "::", - stringify!(optionString) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).extraInfo as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(JavaVMOption), - "::", - stringify!(extraInfo) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -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" { - pub fn JNI_GetDefaultJavaVMInitArgs(arg1: *mut ::std::os::raw::c_void) -> jint; -} -extern "C" { - pub fn JNI_CreateJavaVM( - arg1: *mut *mut JavaVM, - arg2: *mut *mut JNIEnv, - arg3: *mut ::std::os::raw::c_void, - ) -> jint; -} -extern "C" { - pub fn JNI_GetCreatedJavaVMs(arg1: *mut *mut JavaVM, arg2: jsize, arg3: *mut jsize) -> jint; -} -extern "C" { - pub fn JNI_OnLoad(vm: *mut JavaVM, reserved: *mut ::std::os::raw::c_void) -> jint; -} -extern "C" { - pub fn JNI_OnUnload(vm: *mut JavaVM, reserved: *mut ::std::os::raw::c_void); -} -extern "C" { - pub fn AAssetManager_fromJava(env: *mut JNIEnv, assetManager: jobject) -> *mut AAssetManager; -} -pub const ANDROID_BITMAP_RESULT_SUCCESS: _bindgen_ty_2 = 0; -pub const ANDROID_BITMAP_RESULT_BAD_PARAMETER: _bindgen_ty_2 = -1; -pub const ANDROID_BITMAP_RESULT_JNI_EXCEPTION: _bindgen_ty_2 = -2; -pub const ANDROID_BITMAP_RESULT_ALLOCATION_FAILED: _bindgen_ty_2 = -3; -pub type _bindgen_ty_2 = i32; -pub const AndroidBitmapFormat_ANDROID_BITMAP_FORMAT_NONE: AndroidBitmapFormat = 0; -pub const AndroidBitmapFormat_ANDROID_BITMAP_FORMAT_RGBA_8888: AndroidBitmapFormat = 1; -pub const AndroidBitmapFormat_ANDROID_BITMAP_FORMAT_RGB_565: AndroidBitmapFormat = 4; -pub const AndroidBitmapFormat_ANDROID_BITMAP_FORMAT_RGBA_4444: AndroidBitmapFormat = 7; -pub const AndroidBitmapFormat_ANDROID_BITMAP_FORMAT_A_8: AndroidBitmapFormat = 8; -pub type AndroidBitmapFormat = u32; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct AndroidBitmapInfo { - pub width: u32, - pub height: u32, - pub stride: u32, - pub format: i32, - pub flags: u32, -} -#[test] -fn bindgen_test_layout_AndroidBitmapInfo() { - assert_eq!( - ::std::mem::size_of::(), - 20usize, - concat!("Size of: ", stringify!(AndroidBitmapInfo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(AndroidBitmapInfo)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(AndroidBitmapInfo), - "::", - stringify!(width) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(AndroidBitmapInfo), - "::", - stringify!(height) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).stride as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(AndroidBitmapInfo), - "::", - stringify!(stride) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).format as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(AndroidBitmapInfo), - "::", - stringify!(format) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(AndroidBitmapInfo), - "::", - stringify!(flags) - ) - ); -} -extern "C" { - pub fn AndroidBitmap_getInfo( - env: *mut JNIEnv, - jbitmap: jobject, - info: *mut AndroidBitmapInfo, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn AndroidBitmap_lockPixels( - env: *mut JNIEnv, - jbitmap: jobject, - addrPtr: *mut *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn AndroidBitmap_unlockPixels(env: *mut JNIEnv, jbitmap: jobject) -> ::std::os::raw::c_int; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct AChoreographer { - _unused: [u8; 0], -} -pub type AChoreographer_frameCallback = ::std::option::Option< - unsafe extern "C" fn(frameTimeNanos: ::std::os::raw::c_long, data: *mut ::std::os::raw::c_void), ->; -pub type AChoreographer_frameCallback64 = ::std::option::Option< - unsafe extern "C" fn(frameTimeNanos: i64, data: *mut ::std::os::raw::c_void), ->; -extern "C" { - pub fn AChoreographer_getInstance() -> *mut AChoreographer; -} -extern "C" { - pub fn AChoreographer_postFrameCallback( - choreographer: *mut AChoreographer, - callback: AChoreographer_frameCallback, - data: *mut ::std::os::raw::c_void, - ); -} -extern "C" { - pub fn AChoreographer_postFrameCallbackDelayed( - choreographer: *mut AChoreographer, - callback: AChoreographer_frameCallback, - data: *mut ::std::os::raw::c_void, - delayMillis: ::std::os::raw::c_long, - ); -} -extern "C" { - pub fn AChoreographer_postFrameCallback64( - chroreographer: *mut AChoreographer, - callback: AChoreographer_frameCallback64, - data: *mut ::std::os::raw::c_void, - ); -} -extern "C" { - pub fn AChoreographer_postFrameCallbackDelayed64( - choreographer: *mut AChoreographer, - callback: AChoreographer_frameCallback64, - data: *mut ::std::os::raw::c_void, - delayMillis: u32, - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct AConfiguration { - _unused: [u8; 0], -} -pub const ACONFIGURATION_ORIENTATION_ANY: _bindgen_ty_3 = 0; -pub const ACONFIGURATION_ORIENTATION_PORT: _bindgen_ty_3 = 1; -pub const ACONFIGURATION_ORIENTATION_LAND: _bindgen_ty_3 = 2; -pub const ACONFIGURATION_ORIENTATION_SQUARE: _bindgen_ty_3 = 3; -pub const ACONFIGURATION_TOUCHSCREEN_ANY: _bindgen_ty_3 = 0; -pub const ACONFIGURATION_TOUCHSCREEN_NOTOUCH: _bindgen_ty_3 = 1; -pub const ACONFIGURATION_TOUCHSCREEN_STYLUS: _bindgen_ty_3 = 2; -pub const ACONFIGURATION_TOUCHSCREEN_FINGER: _bindgen_ty_3 = 3; -pub const ACONFIGURATION_DENSITY_DEFAULT: _bindgen_ty_3 = 0; -pub const ACONFIGURATION_DENSITY_LOW: _bindgen_ty_3 = 120; -pub const ACONFIGURATION_DENSITY_MEDIUM: _bindgen_ty_3 = 160; -pub const ACONFIGURATION_DENSITY_TV: _bindgen_ty_3 = 213; -pub const ACONFIGURATION_DENSITY_HIGH: _bindgen_ty_3 = 240; -pub const ACONFIGURATION_DENSITY_XHIGH: _bindgen_ty_3 = 320; -pub const ACONFIGURATION_DENSITY_XXHIGH: _bindgen_ty_3 = 480; -pub const ACONFIGURATION_DENSITY_XXXHIGH: _bindgen_ty_3 = 640; -pub const ACONFIGURATION_DENSITY_ANY: _bindgen_ty_3 = 65534; -pub const ACONFIGURATION_DENSITY_NONE: _bindgen_ty_3 = 65535; -pub const ACONFIGURATION_KEYBOARD_ANY: _bindgen_ty_3 = 0; -pub const ACONFIGURATION_KEYBOARD_NOKEYS: _bindgen_ty_3 = 1; -pub const ACONFIGURATION_KEYBOARD_QWERTY: _bindgen_ty_3 = 2; -pub const ACONFIGURATION_KEYBOARD_12KEY: _bindgen_ty_3 = 3; -pub const ACONFIGURATION_NAVIGATION_ANY: _bindgen_ty_3 = 0; -pub const ACONFIGURATION_NAVIGATION_NONAV: _bindgen_ty_3 = 1; -pub const ACONFIGURATION_NAVIGATION_DPAD: _bindgen_ty_3 = 2; -pub const ACONFIGURATION_NAVIGATION_TRACKBALL: _bindgen_ty_3 = 3; -pub const ACONFIGURATION_NAVIGATION_WHEEL: _bindgen_ty_3 = 4; -pub const ACONFIGURATION_KEYSHIDDEN_ANY: _bindgen_ty_3 = 0; -pub const ACONFIGURATION_KEYSHIDDEN_NO: _bindgen_ty_3 = 1; -pub const ACONFIGURATION_KEYSHIDDEN_YES: _bindgen_ty_3 = 2; -pub const ACONFIGURATION_KEYSHIDDEN_SOFT: _bindgen_ty_3 = 3; -pub const ACONFIGURATION_NAVHIDDEN_ANY: _bindgen_ty_3 = 0; -pub const ACONFIGURATION_NAVHIDDEN_NO: _bindgen_ty_3 = 1; -pub const ACONFIGURATION_NAVHIDDEN_YES: _bindgen_ty_3 = 2; -pub const ACONFIGURATION_SCREENSIZE_ANY: _bindgen_ty_3 = 0; -pub const ACONFIGURATION_SCREENSIZE_SMALL: _bindgen_ty_3 = 1; -pub const ACONFIGURATION_SCREENSIZE_NORMAL: _bindgen_ty_3 = 2; -pub const ACONFIGURATION_SCREENSIZE_LARGE: _bindgen_ty_3 = 3; -pub const ACONFIGURATION_SCREENSIZE_XLARGE: _bindgen_ty_3 = 4; -pub const ACONFIGURATION_SCREENLONG_ANY: _bindgen_ty_3 = 0; -pub const ACONFIGURATION_SCREENLONG_NO: _bindgen_ty_3 = 1; -pub const ACONFIGURATION_SCREENLONG_YES: _bindgen_ty_3 = 2; -pub const ACONFIGURATION_SCREENROUND_ANY: _bindgen_ty_3 = 0; -pub const ACONFIGURATION_SCREENROUND_NO: _bindgen_ty_3 = 1; -pub const ACONFIGURATION_SCREENROUND_YES: _bindgen_ty_3 = 2; -pub const ACONFIGURATION_WIDE_COLOR_GAMUT_ANY: _bindgen_ty_3 = 0; -pub const ACONFIGURATION_WIDE_COLOR_GAMUT_NO: _bindgen_ty_3 = 1; -pub const ACONFIGURATION_WIDE_COLOR_GAMUT_YES: _bindgen_ty_3 = 2; -pub const ACONFIGURATION_HDR_ANY: _bindgen_ty_3 = 0; -pub const ACONFIGURATION_HDR_NO: _bindgen_ty_3 = 1; -pub const ACONFIGURATION_HDR_YES: _bindgen_ty_3 = 2; -pub const ACONFIGURATION_UI_MODE_TYPE_ANY: _bindgen_ty_3 = 0; -pub const ACONFIGURATION_UI_MODE_TYPE_NORMAL: _bindgen_ty_3 = 1; -pub const ACONFIGURATION_UI_MODE_TYPE_DESK: _bindgen_ty_3 = 2; -pub const ACONFIGURATION_UI_MODE_TYPE_CAR: _bindgen_ty_3 = 3; -pub const ACONFIGURATION_UI_MODE_TYPE_TELEVISION: _bindgen_ty_3 = 4; -pub const ACONFIGURATION_UI_MODE_TYPE_APPLIANCE: _bindgen_ty_3 = 5; -pub const ACONFIGURATION_UI_MODE_TYPE_WATCH: _bindgen_ty_3 = 6; -pub const ACONFIGURATION_UI_MODE_TYPE_VR_HEADSET: _bindgen_ty_3 = 7; -pub const ACONFIGURATION_UI_MODE_NIGHT_ANY: _bindgen_ty_3 = 0; -pub const ACONFIGURATION_UI_MODE_NIGHT_NO: _bindgen_ty_3 = 1; -pub const ACONFIGURATION_UI_MODE_NIGHT_YES: _bindgen_ty_3 = 2; -pub const ACONFIGURATION_SCREEN_WIDTH_DP_ANY: _bindgen_ty_3 = 0; -pub const ACONFIGURATION_SCREEN_HEIGHT_DP_ANY: _bindgen_ty_3 = 0; -pub const ACONFIGURATION_SMALLEST_SCREEN_WIDTH_DP_ANY: _bindgen_ty_3 = 0; -pub const ACONFIGURATION_LAYOUTDIR_ANY: _bindgen_ty_3 = 0; -pub const ACONFIGURATION_LAYOUTDIR_LTR: _bindgen_ty_3 = 1; -pub const ACONFIGURATION_LAYOUTDIR_RTL: _bindgen_ty_3 = 2; -pub const ACONFIGURATION_MCC: _bindgen_ty_3 = 1; -pub const ACONFIGURATION_MNC: _bindgen_ty_3 = 2; -pub const ACONFIGURATION_LOCALE: _bindgen_ty_3 = 4; -pub const ACONFIGURATION_TOUCHSCREEN: _bindgen_ty_3 = 8; -pub const ACONFIGURATION_KEYBOARD: _bindgen_ty_3 = 16; -pub const ACONFIGURATION_KEYBOARD_HIDDEN: _bindgen_ty_3 = 32; -pub const ACONFIGURATION_NAVIGATION: _bindgen_ty_3 = 64; -pub const ACONFIGURATION_ORIENTATION: _bindgen_ty_3 = 128; -pub const ACONFIGURATION_DENSITY: _bindgen_ty_3 = 256; -pub const ACONFIGURATION_SCREEN_SIZE: _bindgen_ty_3 = 512; -pub const ACONFIGURATION_VERSION: _bindgen_ty_3 = 1024; -pub const ACONFIGURATION_SCREEN_LAYOUT: _bindgen_ty_3 = 2048; -pub const ACONFIGURATION_UI_MODE: _bindgen_ty_3 = 4096; -pub const ACONFIGURATION_SMALLEST_SCREEN_SIZE: _bindgen_ty_3 = 8192; -pub const ACONFIGURATION_LAYOUTDIR: _bindgen_ty_3 = 16384; -pub const ACONFIGURATION_SCREEN_ROUND: _bindgen_ty_3 = 32768; -pub const ACONFIGURATION_COLOR_MODE: _bindgen_ty_3 = 65536; -pub const ACONFIGURATION_MNC_ZERO: _bindgen_ty_3 = 65535; -pub type _bindgen_ty_3 = u32; -extern "C" { - pub fn AConfiguration_new() -> *mut AConfiguration; -} -extern "C" { - pub fn AConfiguration_delete(config: *mut AConfiguration); -} -extern "C" { - pub fn AConfiguration_fromAssetManager(out: *mut AConfiguration, am: *mut AAssetManager); -} -extern "C" { - pub fn AConfiguration_copy(dest: *mut AConfiguration, src: *mut AConfiguration); -} -extern "C" { - pub fn AConfiguration_getMcc(config: *mut AConfiguration) -> i32; -} -extern "C" { - pub fn AConfiguration_setMcc(config: *mut AConfiguration, mcc: i32); -} -extern "C" { - pub fn AConfiguration_getMnc(config: *mut AConfiguration) -> i32; -} -extern "C" { - pub fn AConfiguration_setMnc(config: *mut AConfiguration, mnc: i32); -} -extern "C" { - pub fn AConfiguration_getLanguage( - config: *mut AConfiguration, - outLanguage: *mut ::std::os::raw::c_char, - ); -} -extern "C" { - pub fn AConfiguration_setLanguage( - config: *mut AConfiguration, - language: *const ::std::os::raw::c_char, - ); -} -extern "C" { - pub fn AConfiguration_getCountry( - config: *mut AConfiguration, - outCountry: *mut ::std::os::raw::c_char, - ); -} -extern "C" { - pub fn AConfiguration_setCountry( - config: *mut AConfiguration, - country: *const ::std::os::raw::c_char, - ); -} -extern "C" { - pub fn AConfiguration_getOrientation(config: *mut AConfiguration) -> i32; -} -extern "C" { - pub fn AConfiguration_setOrientation(config: *mut AConfiguration, orientation: i32); -} -extern "C" { - pub fn AConfiguration_getTouchscreen(config: *mut AConfiguration) -> i32; -} -extern "C" { - pub fn AConfiguration_setTouchscreen(config: *mut AConfiguration, touchscreen: i32); -} -extern "C" { - pub fn AConfiguration_getDensity(config: *mut AConfiguration) -> i32; -} -extern "C" { - pub fn AConfiguration_setDensity(config: *mut AConfiguration, density: i32); -} -extern "C" { - pub fn AConfiguration_getKeyboard(config: *mut AConfiguration) -> i32; -} -extern "C" { - pub fn AConfiguration_setKeyboard(config: *mut AConfiguration, keyboard: i32); -} -extern "C" { - pub fn AConfiguration_getNavigation(config: *mut AConfiguration) -> i32; -} -extern "C" { - pub fn AConfiguration_setNavigation(config: *mut AConfiguration, navigation: i32); -} -extern "C" { - pub fn AConfiguration_getKeysHidden(config: *mut AConfiguration) -> i32; -} -extern "C" { - pub fn AConfiguration_setKeysHidden(config: *mut AConfiguration, keysHidden: i32); -} -extern "C" { - pub fn AConfiguration_getNavHidden(config: *mut AConfiguration) -> i32; -} -extern "C" { - pub fn AConfiguration_setNavHidden(config: *mut AConfiguration, navHidden: i32); -} -extern "C" { - pub fn AConfiguration_getSdkVersion(config: *mut AConfiguration) -> i32; -} -extern "C" { - pub fn AConfiguration_setSdkVersion(config: *mut AConfiguration, sdkVersion: i32); -} -extern "C" { - pub fn AConfiguration_getScreenSize(config: *mut AConfiguration) -> i32; -} -extern "C" { - pub fn AConfiguration_setScreenSize(config: *mut AConfiguration, screenSize: i32); -} -extern "C" { - pub fn AConfiguration_getScreenLong(config: *mut AConfiguration) -> i32; -} -extern "C" { - pub fn AConfiguration_setScreenLong(config: *mut AConfiguration, screenLong: i32); -} -extern "C" { - pub fn AConfiguration_getScreenRound(config: *mut AConfiguration) -> i32; -} -extern "C" { - pub fn AConfiguration_setScreenRound(config: *mut AConfiguration, screenRound: i32); -} -extern "C" { - pub fn AConfiguration_getUiModeType(config: *mut AConfiguration) -> i32; -} -extern "C" { - pub fn AConfiguration_setUiModeType(config: *mut AConfiguration, uiModeType: i32); -} -extern "C" { - pub fn AConfiguration_getUiModeNight(config: *mut AConfiguration) -> i32; -} -extern "C" { - pub fn AConfiguration_setUiModeNight(config: *mut AConfiguration, uiModeNight: i32); -} -extern "C" { - pub fn AConfiguration_getScreenWidthDp(config: *mut AConfiguration) -> i32; -} -extern "C" { - pub fn AConfiguration_setScreenWidthDp(config: *mut AConfiguration, value: i32); -} -extern "C" { - pub fn AConfiguration_getScreenHeightDp(config: *mut AConfiguration) -> i32; -} -extern "C" { - pub fn AConfiguration_setScreenHeightDp(config: *mut AConfiguration, value: i32); -} -extern "C" { - pub fn AConfiguration_getSmallestScreenWidthDp(config: *mut AConfiguration) -> i32; -} -extern "C" { - pub fn AConfiguration_setSmallestScreenWidthDp(config: *mut AConfiguration, value: i32); -} -extern "C" { - pub fn AConfiguration_getLayoutDirection(config: *mut AConfiguration) -> i32; -} -extern "C" { - pub fn AConfiguration_setLayoutDirection(config: *mut AConfiguration, value: i32); -} -extern "C" { - pub fn AConfiguration_diff(config1: *mut AConfiguration, config2: *mut AConfiguration) -> i32; -} -extern "C" { - pub fn AConfiguration_match(base: *mut AConfiguration, requested: *mut AConfiguration) -> i32; -} -extern "C" { - pub fn AConfiguration_isBetterThan( - base: *mut AConfiguration, - test: *mut AConfiguration, - requested: *mut AConfiguration, - ) -> i32; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct imaxdiv_t { - pub quot: intmax_t, - pub rem: intmax_t, -} -#[test] -fn bindgen_test_layout_imaxdiv_t() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(imaxdiv_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(imaxdiv_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).quot as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(imaxdiv_t), - "::", - stringify!(quot) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rem as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(imaxdiv_t), - "::", - stringify!(rem) - ) - ); -} -extern "C" { - pub fn imaxabs(__i: intmax_t) -> intmax_t; -} -extern "C" { - pub fn imaxdiv(__numerator: intmax_t, __denominator: intmax_t) -> imaxdiv_t; -} -extern "C" { - pub fn strtoimax( - __s: *const ::std::os::raw::c_char, - __end_ptr: *mut *mut ::std::os::raw::c_char, - __base: ::std::os::raw::c_int, - ) -> intmax_t; -} -extern "C" { - pub fn strtoumax( - __s: *const ::std::os::raw::c_char, - __end_ptr: *mut *mut ::std::os::raw::c_char, - __base: ::std::os::raw::c_int, - ) -> uintmax_t; -} -extern "C" { - pub fn wcstoimax( - __s: *const wchar_t, - __end_ptr: *mut *mut wchar_t, - __base: ::std::os::raw::c_int, - ) -> intmax_t; -} -extern "C" { - pub fn wcstoumax( - __s: *const wchar_t, - __end_ptr: *mut *mut wchar_t, - __base: ::std::os::raw::c_int, - ) -> uintmax_t; -} -pub const ADataSpace_ADATASPACE_UNKNOWN: ADataSpace = 0; -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 type ADataSpace = u32; -pub const ANDROID_DLEXT_RESERVED_ADDRESS: _bindgen_ty_4 = 1; -pub const ANDROID_DLEXT_RESERVED_ADDRESS_HINT: _bindgen_ty_4 = 2; -pub const ANDROID_DLEXT_WRITE_RELRO: _bindgen_ty_4 = 4; -pub const ANDROID_DLEXT_USE_RELRO: _bindgen_ty_4 = 8; -pub const ANDROID_DLEXT_USE_LIBRARY_FD: _bindgen_ty_4 = 16; -pub const ANDROID_DLEXT_USE_LIBRARY_FD_OFFSET: _bindgen_ty_4 = 32; -pub const ANDROID_DLEXT_FORCE_LOAD: _bindgen_ty_4 = 64; -pub const ANDROID_DLEXT_USE_NAMESPACE: _bindgen_ty_4 = 512; -pub const ANDROID_DLEXT_RESERVED_ADDRESS_RECURSIVE: _bindgen_ty_4 = 1024; -pub const ANDROID_DLEXT_VALID_FLAG_BITS: _bindgen_ty_4 = 1663; -pub type _bindgen_ty_4 = u32; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct android_namespace_t { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct android_dlextinfo { - pub flags: u64, - pub reserved_addr: *mut ::std::os::raw::c_void, - pub reserved_size: usize, - pub relro_fd: ::std::os::raw::c_int, - pub library_fd: ::std::os::raw::c_int, - pub library_fd_offset: off64_t, - pub library_namespace: *mut android_namespace_t, - pub __bindgen_padding_0: u32, -} -#[test] -fn bindgen_test_layout_android_dlextinfo() { - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(android_dlextinfo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(android_dlextinfo)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(android_dlextinfo), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved_addr as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(android_dlextinfo), - "::", - stringify!(reserved_addr) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved_size as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(android_dlextinfo), - "::", - stringify!(reserved_size) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).relro_fd as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(android_dlextinfo), - "::", - stringify!(relro_fd) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).library_fd as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(android_dlextinfo), - "::", - stringify!(library_fd) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).library_fd_offset as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(android_dlextinfo), - "::", - stringify!(library_fd_offset) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).library_namespace as *const _ as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(android_dlextinfo), - "::", - stringify!(library_namespace) - ) - ); -} -extern "C" { - pub fn android_dlopen_ext( - __filename: *const ::std::os::raw::c_char, - __flags: ::std::os::raw::c_int, - __info: *const android_dlextinfo, - ) -> *mut ::std::os::raw::c_void; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ARect { - pub left: i32, - pub top: i32, - pub right: i32, - pub bottom: i32, -} -#[test] -fn bindgen_test_layout_ARect() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(ARect)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(ARect)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).left as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ARect), - "::", - stringify!(left) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).top as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(ARect), - "::", - stringify!(top) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).right as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ARect), - "::", - stringify!(right) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).bottom as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(ARect), - "::", - stringify!(bottom) - ) - ); -} -pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM: AHardwareBuffer_Format = 1; -pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_R8G8B8X8_UNORM: AHardwareBuffer_Format = 2; -pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_R8G8B8_UNORM: AHardwareBuffer_Format = 3; -pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_R5G6B5_UNORM: AHardwareBuffer_Format = 4; -pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_R16G16B16A16_FLOAT: AHardwareBuffer_Format = - 22; -pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_R10G10B10A2_UNORM: AHardwareBuffer_Format = - 43; -pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_BLOB: AHardwareBuffer_Format = 33; -pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_D16_UNORM: AHardwareBuffer_Format = 48; -pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_D24_UNORM: AHardwareBuffer_Format = 49; -pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_D24_UNORM_S8_UINT: AHardwareBuffer_Format = - 50; -pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_D32_FLOAT: AHardwareBuffer_Format = 51; -pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_D32_FLOAT_S8_UINT: AHardwareBuffer_Format = - 52; -pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_S8_UINT: AHardwareBuffer_Format = 53; -pub const AHardwareBuffer_Format_AHARDWAREBUFFER_FORMAT_Y8Cb8Cr8_420: AHardwareBuffer_Format = 35; -pub type AHardwareBuffer_Format = u32; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_CPU_READ_NEVER: - AHardwareBuffer_UsageFlags = 0; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_CPU_READ_RARELY: - AHardwareBuffer_UsageFlags = 2; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_CPU_READ_OFTEN: - AHardwareBuffer_UsageFlags = 3; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_CPU_READ_MASK: - AHardwareBuffer_UsageFlags = 15; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_CPU_WRITE_NEVER: - AHardwareBuffer_UsageFlags = 0; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_CPU_WRITE_RARELY: - AHardwareBuffer_UsageFlags = 32; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_CPU_WRITE_OFTEN: - AHardwareBuffer_UsageFlags = 48; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_CPU_WRITE_MASK: - AHardwareBuffer_UsageFlags = 240; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE: - AHardwareBuffer_UsageFlags = 256; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_GPU_FRAMEBUFFER: - AHardwareBuffer_UsageFlags = 512; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_GPU_COLOR_OUTPUT: - AHardwareBuffer_UsageFlags = 512; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_COMPOSER_OVERLAY: - AHardwareBuffer_UsageFlags = 2048; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_PROTECTED_CONTENT: - AHardwareBuffer_UsageFlags = 16384; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_VIDEO_ENCODE: - AHardwareBuffer_UsageFlags = 65536; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_SENSOR_DIRECT_DATA: - AHardwareBuffer_UsageFlags = 8388608; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_GPU_DATA_BUFFER: - AHardwareBuffer_UsageFlags = 16777216; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_GPU_CUBE_MAP: - AHardwareBuffer_UsageFlags = 33554432; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_GPU_MIPMAP_COMPLETE: - AHardwareBuffer_UsageFlags = 67108864; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_VENDOR_0: AHardwareBuffer_UsageFlags = - 268435456; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_VENDOR_1: AHardwareBuffer_UsageFlags = - 536870912; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_VENDOR_2: AHardwareBuffer_UsageFlags = - 1073741824; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_VENDOR_3: AHardwareBuffer_UsageFlags = - 2147483648; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_VENDOR_4: AHardwareBuffer_UsageFlags = - 281474976710656; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_VENDOR_5: AHardwareBuffer_UsageFlags = - 562949953421312; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_VENDOR_6: AHardwareBuffer_UsageFlags = - 1125899906842624; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_VENDOR_7: AHardwareBuffer_UsageFlags = - 2251799813685248; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_VENDOR_8: AHardwareBuffer_UsageFlags = - 4503599627370496; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_VENDOR_9: AHardwareBuffer_UsageFlags = - 9007199254740992; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_VENDOR_10: AHardwareBuffer_UsageFlags = - 18014398509481984; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_VENDOR_11: AHardwareBuffer_UsageFlags = - 36028797018963968; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_VENDOR_12: AHardwareBuffer_UsageFlags = - 72057594037927936; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_VENDOR_13: AHardwareBuffer_UsageFlags = - 144115188075855872; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_VENDOR_14: AHardwareBuffer_UsageFlags = - 288230376151711744; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_VENDOR_15: AHardwareBuffer_UsageFlags = - 576460752303423488; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_VENDOR_16: AHardwareBuffer_UsageFlags = - 1152921504606846976; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_VENDOR_17: AHardwareBuffer_UsageFlags = - 2305843009213693952; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_VENDOR_18: AHardwareBuffer_UsageFlags = - 4611686018427387904; -pub const AHardwareBuffer_UsageFlags_AHARDWAREBUFFER_USAGE_VENDOR_19: AHardwareBuffer_UsageFlags = - 9223372036854775808; -pub type AHardwareBuffer_UsageFlags = u64; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct AHardwareBuffer_Desc { - pub width: u32, - pub height: u32, - pub layers: u32, - pub format: u32, - pub usage: u64, - pub stride: u32, - pub rfu0: u32, - pub rfu1: u64, -} -#[test] -fn bindgen_test_layout_AHardwareBuffer_Desc() { - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(AHardwareBuffer_Desc)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(AHardwareBuffer_Desc)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(AHardwareBuffer_Desc), - "::", - stringify!(width) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(AHardwareBuffer_Desc), - "::", - stringify!(height) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).layers as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(AHardwareBuffer_Desc), - "::", - stringify!(layers) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).format as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(AHardwareBuffer_Desc), - "::", - stringify!(format) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).usage as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(AHardwareBuffer_Desc), - "::", - stringify!(usage) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).stride as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(AHardwareBuffer_Desc), - "::", - stringify!(stride) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rfu0 as *const _ as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(AHardwareBuffer_Desc), - "::", - stringify!(rfu0) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rfu1 as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(AHardwareBuffer_Desc), - "::", - stringify!(rfu1) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct AHardwareBuffer_Plane { - pub data: *mut ::std::os::raw::c_void, - pub pixelStride: u32, - pub rowStride: u32, -} -#[test] -fn bindgen_test_layout_AHardwareBuffer_Plane() { - assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(AHardwareBuffer_Plane)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(AHardwareBuffer_Plane)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(AHardwareBuffer_Plane), - "::", - stringify!(data) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pixelStride as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(AHardwareBuffer_Plane), - "::", - stringify!(pixelStride) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rowStride as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(AHardwareBuffer_Plane), - "::", - stringify!(rowStride) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct AHardwareBuffer_Planes { - pub planeCount: u32, - pub planes: [AHardwareBuffer_Plane; 4usize], -} -#[test] -fn bindgen_test_layout_AHardwareBuffer_Planes() { - assert_eq!( - ::std::mem::size_of::(), - 52usize, - concat!("Size of: ", stringify!(AHardwareBuffer_Planes)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(AHardwareBuffer_Planes)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).planeCount as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(AHardwareBuffer_Planes), - "::", - stringify!(planeCount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).planes as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(AHardwareBuffer_Planes), - "::", - stringify!(planes) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct AHardwareBuffer { - _unused: [u8; 0], -} -extern "C" { - pub fn AHardwareBuffer_allocate( - desc: *const AHardwareBuffer_Desc, - outBuffer: *mut *mut AHardwareBuffer, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn AHardwareBuffer_acquire(buffer: *mut AHardwareBuffer); -} -extern "C" { - pub fn AHardwareBuffer_release(buffer: *mut AHardwareBuffer); -} -extern "C" { - pub fn AHardwareBuffer_describe( - buffer: *const AHardwareBuffer, - outDesc: *mut AHardwareBuffer_Desc, - ); -} -extern "C" { - pub fn AHardwareBuffer_lock( - buffer: *mut AHardwareBuffer, - usage: u64, - fence: i32, - rect: *const ARect, - 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, - fence: *mut i32, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn AHardwareBuffer_sendHandleToUnixSocket( - buffer: *const AHardwareBuffer, - socketFd: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn AHardwareBuffer_recvHandleFromUnixSocket( - socketFd: ::std::os::raw::c_int, - outBuffer: *mut *mut AHardwareBuffer, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn AHardwareBuffer_isSupported(desc: *const AHardwareBuffer_Desc) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn AHardwareBuffer_lockAndGetInfo( - buffer: *mut AHardwareBuffer, - usage: u64, - fence: i32, - rect: *const ARect, - outVirtualAddress: *mut *mut ::std::os::raw::c_void, - outBytesPerPixel: *mut i32, - outBytesPerStride: *mut i32, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn AHardwareBuffer_fromHardwareBuffer( - env: *mut JNIEnv, - hardwareBufferObj: jobject, - ) -> *mut AHardwareBuffer; -} -extern "C" { - pub fn AHardwareBuffer_toHardwareBuffer( - env: *mut JNIEnv, - hardwareBuffer: *mut AHardwareBuffer, - ) -> jobject; -} -pub const AKEYCODE_UNKNOWN: _bindgen_ty_5 = 0; -pub const AKEYCODE_SOFT_LEFT: _bindgen_ty_5 = 1; -pub const AKEYCODE_SOFT_RIGHT: _bindgen_ty_5 = 2; -pub const AKEYCODE_HOME: _bindgen_ty_5 = 3; -pub const AKEYCODE_BACK: _bindgen_ty_5 = 4; -pub const AKEYCODE_CALL: _bindgen_ty_5 = 5; -pub const AKEYCODE_ENDCALL: _bindgen_ty_5 = 6; -pub const AKEYCODE_0: _bindgen_ty_5 = 7; -pub const AKEYCODE_1: _bindgen_ty_5 = 8; -pub const AKEYCODE_2: _bindgen_ty_5 = 9; -pub const AKEYCODE_3: _bindgen_ty_5 = 10; -pub const AKEYCODE_4: _bindgen_ty_5 = 11; -pub const AKEYCODE_5: _bindgen_ty_5 = 12; -pub const AKEYCODE_6: _bindgen_ty_5 = 13; -pub const AKEYCODE_7: _bindgen_ty_5 = 14; -pub const AKEYCODE_8: _bindgen_ty_5 = 15; -pub const AKEYCODE_9: _bindgen_ty_5 = 16; -pub const AKEYCODE_STAR: _bindgen_ty_5 = 17; -pub const AKEYCODE_POUND: _bindgen_ty_5 = 18; -pub const AKEYCODE_DPAD_UP: _bindgen_ty_5 = 19; -pub const AKEYCODE_DPAD_DOWN: _bindgen_ty_5 = 20; -pub const AKEYCODE_DPAD_LEFT: _bindgen_ty_5 = 21; -pub const AKEYCODE_DPAD_RIGHT: _bindgen_ty_5 = 22; -pub const AKEYCODE_DPAD_CENTER: _bindgen_ty_5 = 23; -pub const AKEYCODE_VOLUME_UP: _bindgen_ty_5 = 24; -pub const AKEYCODE_VOLUME_DOWN: _bindgen_ty_5 = 25; -pub const AKEYCODE_POWER: _bindgen_ty_5 = 26; -pub const AKEYCODE_CAMERA: _bindgen_ty_5 = 27; -pub const AKEYCODE_CLEAR: _bindgen_ty_5 = 28; -pub const AKEYCODE_A: _bindgen_ty_5 = 29; -pub const AKEYCODE_B: _bindgen_ty_5 = 30; -pub const AKEYCODE_C: _bindgen_ty_5 = 31; -pub const AKEYCODE_D: _bindgen_ty_5 = 32; -pub const AKEYCODE_E: _bindgen_ty_5 = 33; -pub const AKEYCODE_F: _bindgen_ty_5 = 34; -pub const AKEYCODE_G: _bindgen_ty_5 = 35; -pub const AKEYCODE_H: _bindgen_ty_5 = 36; -pub const AKEYCODE_I: _bindgen_ty_5 = 37; -pub const AKEYCODE_J: _bindgen_ty_5 = 38; -pub const AKEYCODE_K: _bindgen_ty_5 = 39; -pub const AKEYCODE_L: _bindgen_ty_5 = 40; -pub const AKEYCODE_M: _bindgen_ty_5 = 41; -pub const AKEYCODE_N: _bindgen_ty_5 = 42; -pub const AKEYCODE_O: _bindgen_ty_5 = 43; -pub const AKEYCODE_P: _bindgen_ty_5 = 44; -pub const AKEYCODE_Q: _bindgen_ty_5 = 45; -pub const AKEYCODE_R: _bindgen_ty_5 = 46; -pub const AKEYCODE_S: _bindgen_ty_5 = 47; -pub const AKEYCODE_T: _bindgen_ty_5 = 48; -pub const AKEYCODE_U: _bindgen_ty_5 = 49; -pub const AKEYCODE_V: _bindgen_ty_5 = 50; -pub const AKEYCODE_W: _bindgen_ty_5 = 51; -pub const AKEYCODE_X: _bindgen_ty_5 = 52; -pub const AKEYCODE_Y: _bindgen_ty_5 = 53; -pub const AKEYCODE_Z: _bindgen_ty_5 = 54; -pub const AKEYCODE_COMMA: _bindgen_ty_5 = 55; -pub const AKEYCODE_PERIOD: _bindgen_ty_5 = 56; -pub const AKEYCODE_ALT_LEFT: _bindgen_ty_5 = 57; -pub const AKEYCODE_ALT_RIGHT: _bindgen_ty_5 = 58; -pub const AKEYCODE_SHIFT_LEFT: _bindgen_ty_5 = 59; -pub const AKEYCODE_SHIFT_RIGHT: _bindgen_ty_5 = 60; -pub const AKEYCODE_TAB: _bindgen_ty_5 = 61; -pub const AKEYCODE_SPACE: _bindgen_ty_5 = 62; -pub const AKEYCODE_SYM: _bindgen_ty_5 = 63; -pub const AKEYCODE_EXPLORER: _bindgen_ty_5 = 64; -pub const AKEYCODE_ENVELOPE: _bindgen_ty_5 = 65; -pub const AKEYCODE_ENTER: _bindgen_ty_5 = 66; -pub const AKEYCODE_DEL: _bindgen_ty_5 = 67; -pub const AKEYCODE_GRAVE: _bindgen_ty_5 = 68; -pub const AKEYCODE_MINUS: _bindgen_ty_5 = 69; -pub const AKEYCODE_EQUALS: _bindgen_ty_5 = 70; -pub const AKEYCODE_LEFT_BRACKET: _bindgen_ty_5 = 71; -pub const AKEYCODE_RIGHT_BRACKET: _bindgen_ty_5 = 72; -pub const AKEYCODE_BACKSLASH: _bindgen_ty_5 = 73; -pub const AKEYCODE_SEMICOLON: _bindgen_ty_5 = 74; -pub const AKEYCODE_APOSTROPHE: _bindgen_ty_5 = 75; -pub const AKEYCODE_SLASH: _bindgen_ty_5 = 76; -pub const AKEYCODE_AT: _bindgen_ty_5 = 77; -pub const AKEYCODE_NUM: _bindgen_ty_5 = 78; -pub const AKEYCODE_HEADSETHOOK: _bindgen_ty_5 = 79; -pub const AKEYCODE_FOCUS: _bindgen_ty_5 = 80; -pub const AKEYCODE_PLUS: _bindgen_ty_5 = 81; -pub const AKEYCODE_MENU: _bindgen_ty_5 = 82; -pub const AKEYCODE_NOTIFICATION: _bindgen_ty_5 = 83; -pub const AKEYCODE_SEARCH: _bindgen_ty_5 = 84; -pub const AKEYCODE_MEDIA_PLAY_PAUSE: _bindgen_ty_5 = 85; -pub const AKEYCODE_MEDIA_STOP: _bindgen_ty_5 = 86; -pub const AKEYCODE_MEDIA_NEXT: _bindgen_ty_5 = 87; -pub const AKEYCODE_MEDIA_PREVIOUS: _bindgen_ty_5 = 88; -pub const AKEYCODE_MEDIA_REWIND: _bindgen_ty_5 = 89; -pub const AKEYCODE_MEDIA_FAST_FORWARD: _bindgen_ty_5 = 90; -pub const AKEYCODE_MUTE: _bindgen_ty_5 = 91; -pub const AKEYCODE_PAGE_UP: _bindgen_ty_5 = 92; -pub const AKEYCODE_PAGE_DOWN: _bindgen_ty_5 = 93; -pub const AKEYCODE_PICTSYMBOLS: _bindgen_ty_5 = 94; -pub const AKEYCODE_SWITCH_CHARSET: _bindgen_ty_5 = 95; -pub const AKEYCODE_BUTTON_A: _bindgen_ty_5 = 96; -pub const AKEYCODE_BUTTON_B: _bindgen_ty_5 = 97; -pub const AKEYCODE_BUTTON_C: _bindgen_ty_5 = 98; -pub const AKEYCODE_BUTTON_X: _bindgen_ty_5 = 99; -pub const AKEYCODE_BUTTON_Y: _bindgen_ty_5 = 100; -pub const AKEYCODE_BUTTON_Z: _bindgen_ty_5 = 101; -pub const AKEYCODE_BUTTON_L1: _bindgen_ty_5 = 102; -pub const AKEYCODE_BUTTON_R1: _bindgen_ty_5 = 103; -pub const AKEYCODE_BUTTON_L2: _bindgen_ty_5 = 104; -pub const AKEYCODE_BUTTON_R2: _bindgen_ty_5 = 105; -pub const AKEYCODE_BUTTON_THUMBL: _bindgen_ty_5 = 106; -pub const AKEYCODE_BUTTON_THUMBR: _bindgen_ty_5 = 107; -pub const AKEYCODE_BUTTON_START: _bindgen_ty_5 = 108; -pub const AKEYCODE_BUTTON_SELECT: _bindgen_ty_5 = 109; -pub const AKEYCODE_BUTTON_MODE: _bindgen_ty_5 = 110; -pub const AKEYCODE_ESCAPE: _bindgen_ty_5 = 111; -pub const AKEYCODE_FORWARD_DEL: _bindgen_ty_5 = 112; -pub const AKEYCODE_CTRL_LEFT: _bindgen_ty_5 = 113; -pub const AKEYCODE_CTRL_RIGHT: _bindgen_ty_5 = 114; -pub const AKEYCODE_CAPS_LOCK: _bindgen_ty_5 = 115; -pub const AKEYCODE_SCROLL_LOCK: _bindgen_ty_5 = 116; -pub const AKEYCODE_META_LEFT: _bindgen_ty_5 = 117; -pub const AKEYCODE_META_RIGHT: _bindgen_ty_5 = 118; -pub const AKEYCODE_FUNCTION: _bindgen_ty_5 = 119; -pub const AKEYCODE_SYSRQ: _bindgen_ty_5 = 120; -pub const AKEYCODE_BREAK: _bindgen_ty_5 = 121; -pub const AKEYCODE_MOVE_HOME: _bindgen_ty_5 = 122; -pub const AKEYCODE_MOVE_END: _bindgen_ty_5 = 123; -pub const AKEYCODE_INSERT: _bindgen_ty_5 = 124; -pub const AKEYCODE_FORWARD: _bindgen_ty_5 = 125; -pub const AKEYCODE_MEDIA_PLAY: _bindgen_ty_5 = 126; -pub const AKEYCODE_MEDIA_PAUSE: _bindgen_ty_5 = 127; -pub const AKEYCODE_MEDIA_CLOSE: _bindgen_ty_5 = 128; -pub const AKEYCODE_MEDIA_EJECT: _bindgen_ty_5 = 129; -pub const AKEYCODE_MEDIA_RECORD: _bindgen_ty_5 = 130; -pub const AKEYCODE_F1: _bindgen_ty_5 = 131; -pub const AKEYCODE_F2: _bindgen_ty_5 = 132; -pub const AKEYCODE_F3: _bindgen_ty_5 = 133; -pub const AKEYCODE_F4: _bindgen_ty_5 = 134; -pub const AKEYCODE_F5: _bindgen_ty_5 = 135; -pub const AKEYCODE_F6: _bindgen_ty_5 = 136; -pub const AKEYCODE_F7: _bindgen_ty_5 = 137; -pub const AKEYCODE_F8: _bindgen_ty_5 = 138; -pub const AKEYCODE_F9: _bindgen_ty_5 = 139; -pub const AKEYCODE_F10: _bindgen_ty_5 = 140; -pub const AKEYCODE_F11: _bindgen_ty_5 = 141; -pub const AKEYCODE_F12: _bindgen_ty_5 = 142; -pub const AKEYCODE_NUM_LOCK: _bindgen_ty_5 = 143; -pub const AKEYCODE_NUMPAD_0: _bindgen_ty_5 = 144; -pub const AKEYCODE_NUMPAD_1: _bindgen_ty_5 = 145; -pub const AKEYCODE_NUMPAD_2: _bindgen_ty_5 = 146; -pub const AKEYCODE_NUMPAD_3: _bindgen_ty_5 = 147; -pub const AKEYCODE_NUMPAD_4: _bindgen_ty_5 = 148; -pub const AKEYCODE_NUMPAD_5: _bindgen_ty_5 = 149; -pub const AKEYCODE_NUMPAD_6: _bindgen_ty_5 = 150; -pub const AKEYCODE_NUMPAD_7: _bindgen_ty_5 = 151; -pub const AKEYCODE_NUMPAD_8: _bindgen_ty_5 = 152; -pub const AKEYCODE_NUMPAD_9: _bindgen_ty_5 = 153; -pub const AKEYCODE_NUMPAD_DIVIDE: _bindgen_ty_5 = 154; -pub const AKEYCODE_NUMPAD_MULTIPLY: _bindgen_ty_5 = 155; -pub const AKEYCODE_NUMPAD_SUBTRACT: _bindgen_ty_5 = 156; -pub const AKEYCODE_NUMPAD_ADD: _bindgen_ty_5 = 157; -pub const AKEYCODE_NUMPAD_DOT: _bindgen_ty_5 = 158; -pub const AKEYCODE_NUMPAD_COMMA: _bindgen_ty_5 = 159; -pub const AKEYCODE_NUMPAD_ENTER: _bindgen_ty_5 = 160; -pub const AKEYCODE_NUMPAD_EQUALS: _bindgen_ty_5 = 161; -pub const AKEYCODE_NUMPAD_LEFT_PAREN: _bindgen_ty_5 = 162; -pub const AKEYCODE_NUMPAD_RIGHT_PAREN: _bindgen_ty_5 = 163; -pub const AKEYCODE_VOLUME_MUTE: _bindgen_ty_5 = 164; -pub const AKEYCODE_INFO: _bindgen_ty_5 = 165; -pub const AKEYCODE_CHANNEL_UP: _bindgen_ty_5 = 166; -pub const AKEYCODE_CHANNEL_DOWN: _bindgen_ty_5 = 167; -pub const AKEYCODE_ZOOM_IN: _bindgen_ty_5 = 168; -pub const AKEYCODE_ZOOM_OUT: _bindgen_ty_5 = 169; -pub const AKEYCODE_TV: _bindgen_ty_5 = 170; -pub const AKEYCODE_WINDOW: _bindgen_ty_5 = 171; -pub const AKEYCODE_GUIDE: _bindgen_ty_5 = 172; -pub const AKEYCODE_DVR: _bindgen_ty_5 = 173; -pub const AKEYCODE_BOOKMARK: _bindgen_ty_5 = 174; -pub const AKEYCODE_CAPTIONS: _bindgen_ty_5 = 175; -pub const AKEYCODE_SETTINGS: _bindgen_ty_5 = 176; -pub const AKEYCODE_TV_POWER: _bindgen_ty_5 = 177; -pub const AKEYCODE_TV_INPUT: _bindgen_ty_5 = 178; -pub const AKEYCODE_STB_POWER: _bindgen_ty_5 = 179; -pub const AKEYCODE_STB_INPUT: _bindgen_ty_5 = 180; -pub const AKEYCODE_AVR_POWER: _bindgen_ty_5 = 181; -pub const AKEYCODE_AVR_INPUT: _bindgen_ty_5 = 182; -pub const AKEYCODE_PROG_RED: _bindgen_ty_5 = 183; -pub const AKEYCODE_PROG_GREEN: _bindgen_ty_5 = 184; -pub const AKEYCODE_PROG_YELLOW: _bindgen_ty_5 = 185; -pub const AKEYCODE_PROG_BLUE: _bindgen_ty_5 = 186; -pub const AKEYCODE_APP_SWITCH: _bindgen_ty_5 = 187; -pub const AKEYCODE_BUTTON_1: _bindgen_ty_5 = 188; -pub const AKEYCODE_BUTTON_2: _bindgen_ty_5 = 189; -pub const AKEYCODE_BUTTON_3: _bindgen_ty_5 = 190; -pub const AKEYCODE_BUTTON_4: _bindgen_ty_5 = 191; -pub const AKEYCODE_BUTTON_5: _bindgen_ty_5 = 192; -pub const AKEYCODE_BUTTON_6: _bindgen_ty_5 = 193; -pub const AKEYCODE_BUTTON_7: _bindgen_ty_5 = 194; -pub const AKEYCODE_BUTTON_8: _bindgen_ty_5 = 195; -pub const AKEYCODE_BUTTON_9: _bindgen_ty_5 = 196; -pub const AKEYCODE_BUTTON_10: _bindgen_ty_5 = 197; -pub const AKEYCODE_BUTTON_11: _bindgen_ty_5 = 198; -pub const AKEYCODE_BUTTON_12: _bindgen_ty_5 = 199; -pub const AKEYCODE_BUTTON_13: _bindgen_ty_5 = 200; -pub const AKEYCODE_BUTTON_14: _bindgen_ty_5 = 201; -pub const AKEYCODE_BUTTON_15: _bindgen_ty_5 = 202; -pub const AKEYCODE_BUTTON_16: _bindgen_ty_5 = 203; -pub const AKEYCODE_LANGUAGE_SWITCH: _bindgen_ty_5 = 204; -pub const AKEYCODE_MANNER_MODE: _bindgen_ty_5 = 205; -pub const AKEYCODE_3D_MODE: _bindgen_ty_5 = 206; -pub const AKEYCODE_CONTACTS: _bindgen_ty_5 = 207; -pub const AKEYCODE_CALENDAR: _bindgen_ty_5 = 208; -pub const AKEYCODE_MUSIC: _bindgen_ty_5 = 209; -pub const AKEYCODE_CALCULATOR: _bindgen_ty_5 = 210; -pub const AKEYCODE_ZENKAKU_HANKAKU: _bindgen_ty_5 = 211; -pub const AKEYCODE_EISU: _bindgen_ty_5 = 212; -pub const AKEYCODE_MUHENKAN: _bindgen_ty_5 = 213; -pub const AKEYCODE_HENKAN: _bindgen_ty_5 = 214; -pub const AKEYCODE_KATAKANA_HIRAGANA: _bindgen_ty_5 = 215; -pub const AKEYCODE_YEN: _bindgen_ty_5 = 216; -pub const AKEYCODE_RO: _bindgen_ty_5 = 217; -pub const AKEYCODE_KANA: _bindgen_ty_5 = 218; -pub const AKEYCODE_ASSIST: _bindgen_ty_5 = 219; -pub const AKEYCODE_BRIGHTNESS_DOWN: _bindgen_ty_5 = 220; -pub const AKEYCODE_BRIGHTNESS_UP: _bindgen_ty_5 = 221; -pub const AKEYCODE_MEDIA_AUDIO_TRACK: _bindgen_ty_5 = 222; -pub const AKEYCODE_SLEEP: _bindgen_ty_5 = 223; -pub const AKEYCODE_WAKEUP: _bindgen_ty_5 = 224; -pub const AKEYCODE_PAIRING: _bindgen_ty_5 = 225; -pub const AKEYCODE_MEDIA_TOP_MENU: _bindgen_ty_5 = 226; -pub const AKEYCODE_11: _bindgen_ty_5 = 227; -pub const AKEYCODE_12: _bindgen_ty_5 = 228; -pub const AKEYCODE_LAST_CHANNEL: _bindgen_ty_5 = 229; -pub const AKEYCODE_TV_DATA_SERVICE: _bindgen_ty_5 = 230; -pub const AKEYCODE_VOICE_ASSIST: _bindgen_ty_5 = 231; -pub const AKEYCODE_TV_RADIO_SERVICE: _bindgen_ty_5 = 232; -pub const AKEYCODE_TV_TELETEXT: _bindgen_ty_5 = 233; -pub const AKEYCODE_TV_NUMBER_ENTRY: _bindgen_ty_5 = 234; -pub const AKEYCODE_TV_TERRESTRIAL_ANALOG: _bindgen_ty_5 = 235; -pub const AKEYCODE_TV_TERRESTRIAL_DIGITAL: _bindgen_ty_5 = 236; -pub const AKEYCODE_TV_SATELLITE: _bindgen_ty_5 = 237; -pub const AKEYCODE_TV_SATELLITE_BS: _bindgen_ty_5 = 238; -pub const AKEYCODE_TV_SATELLITE_CS: _bindgen_ty_5 = 239; -pub const AKEYCODE_TV_SATELLITE_SERVICE: _bindgen_ty_5 = 240; -pub const AKEYCODE_TV_NETWORK: _bindgen_ty_5 = 241; -pub const AKEYCODE_TV_ANTENNA_CABLE: _bindgen_ty_5 = 242; -pub const AKEYCODE_TV_INPUT_HDMI_1: _bindgen_ty_5 = 243; -pub const AKEYCODE_TV_INPUT_HDMI_2: _bindgen_ty_5 = 244; -pub const AKEYCODE_TV_INPUT_HDMI_3: _bindgen_ty_5 = 245; -pub const AKEYCODE_TV_INPUT_HDMI_4: _bindgen_ty_5 = 246; -pub const AKEYCODE_TV_INPUT_COMPOSITE_1: _bindgen_ty_5 = 247; -pub const AKEYCODE_TV_INPUT_COMPOSITE_2: _bindgen_ty_5 = 248; -pub const AKEYCODE_TV_INPUT_COMPONENT_1: _bindgen_ty_5 = 249; -pub const AKEYCODE_TV_INPUT_COMPONENT_2: _bindgen_ty_5 = 250; -pub const AKEYCODE_TV_INPUT_VGA_1: _bindgen_ty_5 = 251; -pub const AKEYCODE_TV_AUDIO_DESCRIPTION: _bindgen_ty_5 = 252; -pub const AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP: _bindgen_ty_5 = 253; -pub const AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN: _bindgen_ty_5 = 254; -pub const AKEYCODE_TV_ZOOM_MODE: _bindgen_ty_5 = 255; -pub const AKEYCODE_TV_CONTENTS_MENU: _bindgen_ty_5 = 256; -pub const AKEYCODE_TV_MEDIA_CONTEXT_MENU: _bindgen_ty_5 = 257; -pub const AKEYCODE_TV_TIMER_PROGRAMMING: _bindgen_ty_5 = 258; -pub const AKEYCODE_HELP: _bindgen_ty_5 = 259; -pub const AKEYCODE_NAVIGATE_PREVIOUS: _bindgen_ty_5 = 260; -pub const AKEYCODE_NAVIGATE_NEXT: _bindgen_ty_5 = 261; -pub const AKEYCODE_NAVIGATE_IN: _bindgen_ty_5 = 262; -pub const AKEYCODE_NAVIGATE_OUT: _bindgen_ty_5 = 263; -pub const AKEYCODE_STEM_PRIMARY: _bindgen_ty_5 = 264; -pub const AKEYCODE_STEM_1: _bindgen_ty_5 = 265; -pub const AKEYCODE_STEM_2: _bindgen_ty_5 = 266; -pub const AKEYCODE_STEM_3: _bindgen_ty_5 = 267; -pub const AKEYCODE_DPAD_UP_LEFT: _bindgen_ty_5 = 268; -pub const AKEYCODE_DPAD_DOWN_LEFT: _bindgen_ty_5 = 269; -pub const AKEYCODE_DPAD_UP_RIGHT: _bindgen_ty_5 = 270; -pub const AKEYCODE_DPAD_DOWN_RIGHT: _bindgen_ty_5 = 271; -pub const AKEYCODE_MEDIA_SKIP_FORWARD: _bindgen_ty_5 = 272; -pub const AKEYCODE_MEDIA_SKIP_BACKWARD: _bindgen_ty_5 = 273; -pub const AKEYCODE_MEDIA_STEP_FORWARD: _bindgen_ty_5 = 274; -pub const AKEYCODE_MEDIA_STEP_BACKWARD: _bindgen_ty_5 = 275; -pub const AKEYCODE_SOFT_SLEEP: _bindgen_ty_5 = 276; -pub const AKEYCODE_CUT: _bindgen_ty_5 = 277; -pub const AKEYCODE_COPY: _bindgen_ty_5 = 278; -pub const AKEYCODE_PASTE: _bindgen_ty_5 = 279; -pub const AKEYCODE_SYSTEM_NAVIGATION_UP: _bindgen_ty_5 = 280; -pub const AKEYCODE_SYSTEM_NAVIGATION_DOWN: _bindgen_ty_5 = 281; -pub const AKEYCODE_SYSTEM_NAVIGATION_LEFT: _bindgen_ty_5 = 282; -pub const AKEYCODE_SYSTEM_NAVIGATION_RIGHT: _bindgen_ty_5 = 283; -pub const AKEYCODE_ALL_APPS: _bindgen_ty_5 = 284; -pub const AKEYCODE_REFRESH: _bindgen_ty_5 = 285; -pub const AKEYCODE_THUMBS_UP: _bindgen_ty_5 = 286; -pub const AKEYCODE_THUMBS_DOWN: _bindgen_ty_5 = 287; -pub const AKEYCODE_PROFILE_SWITCH: _bindgen_ty_5 = 288; -pub type _bindgen_ty_5 = u32; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ALooper { - _unused: [u8; 0], -} -extern "C" { - pub fn ALooper_forThread() -> *mut ALooper; -} -pub const ALOOPER_PREPARE_ALLOW_NON_CALLBACKS: _bindgen_ty_6 = 1; -pub type _bindgen_ty_6 = u32; -extern "C" { - pub fn ALooper_prepare(opts: ::std::os::raw::c_int) -> *mut ALooper; -} -pub const ALOOPER_POLL_WAKE: _bindgen_ty_7 = -1; -pub const ALOOPER_POLL_CALLBACK: _bindgen_ty_7 = -2; -pub const ALOOPER_POLL_TIMEOUT: _bindgen_ty_7 = -3; -pub const ALOOPER_POLL_ERROR: _bindgen_ty_7 = -4; -pub type _bindgen_ty_7 = i32; -extern "C" { - pub fn ALooper_acquire(looper: *mut ALooper); -} -extern "C" { - pub fn ALooper_release(looper: *mut ALooper); -} -pub const ALOOPER_EVENT_INPUT: _bindgen_ty_8 = 1; -pub const ALOOPER_EVENT_OUTPUT: _bindgen_ty_8 = 2; -pub const ALOOPER_EVENT_ERROR: _bindgen_ty_8 = 4; -pub const ALOOPER_EVENT_HANGUP: _bindgen_ty_8 = 8; -pub const ALOOPER_EVENT_INVALID: _bindgen_ty_8 = 16; -pub type _bindgen_ty_8 = u32; -pub type ALooper_callbackFunc = ::std::option::Option< - unsafe extern "C" fn( - fd: ::std::os::raw::c_int, - events: ::std::os::raw::c_int, - data: *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int, ->; -extern "C" { - pub fn ALooper_pollOnce( - timeoutMillis: ::std::os::raw::c_int, - outFd: *mut ::std::os::raw::c_int, - outEvents: *mut ::std::os::raw::c_int, - outData: *mut *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ALooper_pollAll( - timeoutMillis: ::std::os::raw::c_int, - outFd: *mut ::std::os::raw::c_int, - outEvents: *mut ::std::os::raw::c_int, - outData: *mut *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ALooper_wake(looper: *mut ALooper); -} -extern "C" { - pub fn ALooper_addFd( - looper: *mut ALooper, - fd: ::std::os::raw::c_int, - ident: ::std::os::raw::c_int, - events: ::std::os::raw::c_int, - callback: ALooper_callbackFunc, - data: *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ALooper_removeFd( - looper: *mut ALooper, - fd: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -pub const AKEY_STATE_UNKNOWN: _bindgen_ty_9 = -1; -pub const AKEY_STATE_UP: _bindgen_ty_9 = 0; -pub const AKEY_STATE_DOWN: _bindgen_ty_9 = 1; -pub const AKEY_STATE_VIRTUAL: _bindgen_ty_9 = 2; -pub type _bindgen_ty_9 = i32; -pub const AMETA_NONE: _bindgen_ty_10 = 0; -pub const AMETA_ALT_ON: _bindgen_ty_10 = 2; -pub const AMETA_ALT_LEFT_ON: _bindgen_ty_10 = 16; -pub const AMETA_ALT_RIGHT_ON: _bindgen_ty_10 = 32; -pub const AMETA_SHIFT_ON: _bindgen_ty_10 = 1; -pub const AMETA_SHIFT_LEFT_ON: _bindgen_ty_10 = 64; -pub const AMETA_SHIFT_RIGHT_ON: _bindgen_ty_10 = 128; -pub const AMETA_SYM_ON: _bindgen_ty_10 = 4; -pub const AMETA_FUNCTION_ON: _bindgen_ty_10 = 8; -pub const AMETA_CTRL_ON: _bindgen_ty_10 = 4096; -pub const AMETA_CTRL_LEFT_ON: _bindgen_ty_10 = 8192; -pub const AMETA_CTRL_RIGHT_ON: _bindgen_ty_10 = 16384; -pub const AMETA_META_ON: _bindgen_ty_10 = 65536; -pub const AMETA_META_LEFT_ON: _bindgen_ty_10 = 131072; -pub const AMETA_META_RIGHT_ON: _bindgen_ty_10 = 262144; -pub const AMETA_CAPS_LOCK_ON: _bindgen_ty_10 = 1048576; -pub const AMETA_NUM_LOCK_ON: _bindgen_ty_10 = 2097152; -pub const AMETA_SCROLL_LOCK_ON: _bindgen_ty_10 = 4194304; -pub type _bindgen_ty_10 = u32; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct AInputEvent { - _unused: [u8; 0], -} -pub const AINPUT_EVENT_TYPE_KEY: _bindgen_ty_11 = 1; -pub const AINPUT_EVENT_TYPE_MOTION: _bindgen_ty_11 = 2; -pub type _bindgen_ty_11 = u32; -pub const AKEY_EVENT_ACTION_DOWN: _bindgen_ty_12 = 0; -pub const AKEY_EVENT_ACTION_UP: _bindgen_ty_12 = 1; -pub const AKEY_EVENT_ACTION_MULTIPLE: _bindgen_ty_12 = 2; -pub type _bindgen_ty_12 = u32; -pub const AKEY_EVENT_FLAG_WOKE_HERE: _bindgen_ty_13 = 1; -pub const AKEY_EVENT_FLAG_SOFT_KEYBOARD: _bindgen_ty_13 = 2; -pub const AKEY_EVENT_FLAG_KEEP_TOUCH_MODE: _bindgen_ty_13 = 4; -pub const AKEY_EVENT_FLAG_FROM_SYSTEM: _bindgen_ty_13 = 8; -pub const AKEY_EVENT_FLAG_EDITOR_ACTION: _bindgen_ty_13 = 16; -pub const AKEY_EVENT_FLAG_CANCELED: _bindgen_ty_13 = 32; -pub const AKEY_EVENT_FLAG_VIRTUAL_HARD_KEY: _bindgen_ty_13 = 64; -pub const AKEY_EVENT_FLAG_LONG_PRESS: _bindgen_ty_13 = 128; -pub const AKEY_EVENT_FLAG_CANCELED_LONG_PRESS: _bindgen_ty_13 = 256; -pub const AKEY_EVENT_FLAG_TRACKING: _bindgen_ty_13 = 512; -pub const AKEY_EVENT_FLAG_FALLBACK: _bindgen_ty_13 = 1024; -pub type _bindgen_ty_13 = u32; -pub const AMOTION_EVENT_ACTION_MASK: _bindgen_ty_14 = 255; -pub const AMOTION_EVENT_ACTION_POINTER_INDEX_MASK: _bindgen_ty_14 = 65280; -pub const AMOTION_EVENT_ACTION_DOWN: _bindgen_ty_14 = 0; -pub const AMOTION_EVENT_ACTION_UP: _bindgen_ty_14 = 1; -pub const AMOTION_EVENT_ACTION_MOVE: _bindgen_ty_14 = 2; -pub const AMOTION_EVENT_ACTION_CANCEL: _bindgen_ty_14 = 3; -pub const AMOTION_EVENT_ACTION_OUTSIDE: _bindgen_ty_14 = 4; -pub const AMOTION_EVENT_ACTION_POINTER_DOWN: _bindgen_ty_14 = 5; -pub const AMOTION_EVENT_ACTION_POINTER_UP: _bindgen_ty_14 = 6; -pub const AMOTION_EVENT_ACTION_HOVER_MOVE: _bindgen_ty_14 = 7; -pub const AMOTION_EVENT_ACTION_SCROLL: _bindgen_ty_14 = 8; -pub const AMOTION_EVENT_ACTION_HOVER_ENTER: _bindgen_ty_14 = 9; -pub const AMOTION_EVENT_ACTION_HOVER_EXIT: _bindgen_ty_14 = 10; -pub const AMOTION_EVENT_ACTION_BUTTON_PRESS: _bindgen_ty_14 = 11; -pub const AMOTION_EVENT_ACTION_BUTTON_RELEASE: _bindgen_ty_14 = 12; -pub type _bindgen_ty_14 = u32; -pub const AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED: _bindgen_ty_15 = 1; -pub type _bindgen_ty_15 = u32; -pub const AMOTION_EVENT_EDGE_FLAG_NONE: _bindgen_ty_16 = 0; -pub const AMOTION_EVENT_EDGE_FLAG_TOP: _bindgen_ty_16 = 1; -pub const AMOTION_EVENT_EDGE_FLAG_BOTTOM: _bindgen_ty_16 = 2; -pub const AMOTION_EVENT_EDGE_FLAG_LEFT: _bindgen_ty_16 = 4; -pub const AMOTION_EVENT_EDGE_FLAG_RIGHT: _bindgen_ty_16 = 8; -pub type _bindgen_ty_16 = u32; -pub const AMOTION_EVENT_AXIS_X: _bindgen_ty_17 = 0; -pub const AMOTION_EVENT_AXIS_Y: _bindgen_ty_17 = 1; -pub const AMOTION_EVENT_AXIS_PRESSURE: _bindgen_ty_17 = 2; -pub const AMOTION_EVENT_AXIS_SIZE: _bindgen_ty_17 = 3; -pub const AMOTION_EVENT_AXIS_TOUCH_MAJOR: _bindgen_ty_17 = 4; -pub const AMOTION_EVENT_AXIS_TOUCH_MINOR: _bindgen_ty_17 = 5; -pub const AMOTION_EVENT_AXIS_TOOL_MAJOR: _bindgen_ty_17 = 6; -pub const AMOTION_EVENT_AXIS_TOOL_MINOR: _bindgen_ty_17 = 7; -pub const AMOTION_EVENT_AXIS_ORIENTATION: _bindgen_ty_17 = 8; -pub const AMOTION_EVENT_AXIS_VSCROLL: _bindgen_ty_17 = 9; -pub const AMOTION_EVENT_AXIS_HSCROLL: _bindgen_ty_17 = 10; -pub const AMOTION_EVENT_AXIS_Z: _bindgen_ty_17 = 11; -pub const AMOTION_EVENT_AXIS_RX: _bindgen_ty_17 = 12; -pub const AMOTION_EVENT_AXIS_RY: _bindgen_ty_17 = 13; -pub const AMOTION_EVENT_AXIS_RZ: _bindgen_ty_17 = 14; -pub const AMOTION_EVENT_AXIS_HAT_X: _bindgen_ty_17 = 15; -pub const AMOTION_EVENT_AXIS_HAT_Y: _bindgen_ty_17 = 16; -pub const AMOTION_EVENT_AXIS_LTRIGGER: _bindgen_ty_17 = 17; -pub const AMOTION_EVENT_AXIS_RTRIGGER: _bindgen_ty_17 = 18; -pub const AMOTION_EVENT_AXIS_THROTTLE: _bindgen_ty_17 = 19; -pub const AMOTION_EVENT_AXIS_RUDDER: _bindgen_ty_17 = 20; -pub const AMOTION_EVENT_AXIS_WHEEL: _bindgen_ty_17 = 21; -pub const AMOTION_EVENT_AXIS_GAS: _bindgen_ty_17 = 22; -pub const AMOTION_EVENT_AXIS_BRAKE: _bindgen_ty_17 = 23; -pub const AMOTION_EVENT_AXIS_DISTANCE: _bindgen_ty_17 = 24; -pub const AMOTION_EVENT_AXIS_TILT: _bindgen_ty_17 = 25; -pub const AMOTION_EVENT_AXIS_SCROLL: _bindgen_ty_17 = 26; -pub const AMOTION_EVENT_AXIS_RELATIVE_X: _bindgen_ty_17 = 27; -pub const AMOTION_EVENT_AXIS_RELATIVE_Y: _bindgen_ty_17 = 28; -pub const AMOTION_EVENT_AXIS_GENERIC_1: _bindgen_ty_17 = 32; -pub const AMOTION_EVENT_AXIS_GENERIC_2: _bindgen_ty_17 = 33; -pub const AMOTION_EVENT_AXIS_GENERIC_3: _bindgen_ty_17 = 34; -pub const AMOTION_EVENT_AXIS_GENERIC_4: _bindgen_ty_17 = 35; -pub const AMOTION_EVENT_AXIS_GENERIC_5: _bindgen_ty_17 = 36; -pub const AMOTION_EVENT_AXIS_GENERIC_6: _bindgen_ty_17 = 37; -pub const AMOTION_EVENT_AXIS_GENERIC_7: _bindgen_ty_17 = 38; -pub const AMOTION_EVENT_AXIS_GENERIC_8: _bindgen_ty_17 = 39; -pub const AMOTION_EVENT_AXIS_GENERIC_9: _bindgen_ty_17 = 40; -pub const AMOTION_EVENT_AXIS_GENERIC_10: _bindgen_ty_17 = 41; -pub const AMOTION_EVENT_AXIS_GENERIC_11: _bindgen_ty_17 = 42; -pub const AMOTION_EVENT_AXIS_GENERIC_12: _bindgen_ty_17 = 43; -pub const AMOTION_EVENT_AXIS_GENERIC_13: _bindgen_ty_17 = 44; -pub const AMOTION_EVENT_AXIS_GENERIC_14: _bindgen_ty_17 = 45; -pub const AMOTION_EVENT_AXIS_GENERIC_15: _bindgen_ty_17 = 46; -pub const AMOTION_EVENT_AXIS_GENERIC_16: _bindgen_ty_17 = 47; -pub type _bindgen_ty_17 = u32; -pub const AMOTION_EVENT_BUTTON_PRIMARY: _bindgen_ty_18 = 1; -pub const AMOTION_EVENT_BUTTON_SECONDARY: _bindgen_ty_18 = 2; -pub const AMOTION_EVENT_BUTTON_TERTIARY: _bindgen_ty_18 = 4; -pub const AMOTION_EVENT_BUTTON_BACK: _bindgen_ty_18 = 8; -pub const AMOTION_EVENT_BUTTON_FORWARD: _bindgen_ty_18 = 16; -pub const AMOTION_EVENT_BUTTON_STYLUS_PRIMARY: _bindgen_ty_18 = 32; -pub const AMOTION_EVENT_BUTTON_STYLUS_SECONDARY: _bindgen_ty_18 = 64; -pub type _bindgen_ty_18 = u32; -pub const AMOTION_EVENT_TOOL_TYPE_UNKNOWN: _bindgen_ty_19 = 0; -pub const AMOTION_EVENT_TOOL_TYPE_FINGER: _bindgen_ty_19 = 1; -pub const AMOTION_EVENT_TOOL_TYPE_STYLUS: _bindgen_ty_19 = 2; -pub const AMOTION_EVENT_TOOL_TYPE_MOUSE: _bindgen_ty_19 = 3; -pub const AMOTION_EVENT_TOOL_TYPE_ERASER: _bindgen_ty_19 = 4; -pub type _bindgen_ty_19 = u32; -pub const AINPUT_SOURCE_CLASS_MASK: _bindgen_ty_20 = 255; -pub const AINPUT_SOURCE_CLASS_NONE: _bindgen_ty_20 = 0; -pub const AINPUT_SOURCE_CLASS_BUTTON: _bindgen_ty_20 = 1; -pub const AINPUT_SOURCE_CLASS_POINTER: _bindgen_ty_20 = 2; -pub const AINPUT_SOURCE_CLASS_NAVIGATION: _bindgen_ty_20 = 4; -pub const AINPUT_SOURCE_CLASS_POSITION: _bindgen_ty_20 = 8; -pub const AINPUT_SOURCE_CLASS_JOYSTICK: _bindgen_ty_20 = 16; -pub type _bindgen_ty_20 = u32; -pub const AINPUT_SOURCE_UNKNOWN: _bindgen_ty_21 = 0; -pub const AINPUT_SOURCE_KEYBOARD: _bindgen_ty_21 = 257; -pub const AINPUT_SOURCE_DPAD: _bindgen_ty_21 = 513; -pub const AINPUT_SOURCE_GAMEPAD: _bindgen_ty_21 = 1025; -pub const AINPUT_SOURCE_TOUCHSCREEN: _bindgen_ty_21 = 4098; -pub const AINPUT_SOURCE_MOUSE: _bindgen_ty_21 = 8194; -pub const AINPUT_SOURCE_STYLUS: _bindgen_ty_21 = 16386; -pub const AINPUT_SOURCE_BLUETOOTH_STYLUS: _bindgen_ty_21 = 49154; -pub const AINPUT_SOURCE_TRACKBALL: _bindgen_ty_21 = 65540; -pub const AINPUT_SOURCE_MOUSE_RELATIVE: _bindgen_ty_21 = 131076; -pub const AINPUT_SOURCE_TOUCHPAD: _bindgen_ty_21 = 1048584; -pub const AINPUT_SOURCE_TOUCH_NAVIGATION: _bindgen_ty_21 = 2097152; -pub const AINPUT_SOURCE_JOYSTICK: _bindgen_ty_21 = 16777232; -pub const AINPUT_SOURCE_ROTARY_ENCODER: _bindgen_ty_21 = 4194304; -pub const AINPUT_SOURCE_ANY: _bindgen_ty_21 = 4294967040; -pub type _bindgen_ty_21 = u32; -pub const AINPUT_KEYBOARD_TYPE_NONE: _bindgen_ty_22 = 0; -pub const AINPUT_KEYBOARD_TYPE_NON_ALPHABETIC: _bindgen_ty_22 = 1; -pub const AINPUT_KEYBOARD_TYPE_ALPHABETIC: _bindgen_ty_22 = 2; -pub type _bindgen_ty_22 = u32; -pub const AINPUT_MOTION_RANGE_X: _bindgen_ty_23 = 0; -pub const AINPUT_MOTION_RANGE_Y: _bindgen_ty_23 = 1; -pub const AINPUT_MOTION_RANGE_PRESSURE: _bindgen_ty_23 = 2; -pub const AINPUT_MOTION_RANGE_SIZE: _bindgen_ty_23 = 3; -pub const AINPUT_MOTION_RANGE_TOUCH_MAJOR: _bindgen_ty_23 = 4; -pub const AINPUT_MOTION_RANGE_TOUCH_MINOR: _bindgen_ty_23 = 5; -pub const AINPUT_MOTION_RANGE_TOOL_MAJOR: _bindgen_ty_23 = 6; -pub const AINPUT_MOTION_RANGE_TOOL_MINOR: _bindgen_ty_23 = 7; -pub const AINPUT_MOTION_RANGE_ORIENTATION: _bindgen_ty_23 = 8; -pub type _bindgen_ty_23 = u32; -extern "C" { - pub fn AInputEvent_getType(event: *const AInputEvent) -> i32; -} -extern "C" { - pub fn AInputEvent_getDeviceId(event: *const AInputEvent) -> i32; -} -extern "C" { - pub fn AInputEvent_getSource(event: *const AInputEvent) -> i32; -} -extern "C" { - pub fn AKeyEvent_getAction(key_event: *const AInputEvent) -> i32; -} -extern "C" { - pub fn AKeyEvent_getFlags(key_event: *const AInputEvent) -> i32; -} -extern "C" { - pub fn AKeyEvent_getKeyCode(key_event: *const AInputEvent) -> i32; -} -extern "C" { - pub fn AKeyEvent_getScanCode(key_event: *const AInputEvent) -> i32; -} -extern "C" { - pub fn AKeyEvent_getMetaState(key_event: *const AInputEvent) -> i32; -} -extern "C" { - pub fn AKeyEvent_getRepeatCount(key_event: *const AInputEvent) -> i32; -} -extern "C" { - pub fn AKeyEvent_getDownTime(key_event: *const AInputEvent) -> i64; -} -extern "C" { - pub fn AKeyEvent_getEventTime(key_event: *const AInputEvent) -> i64; -} -extern "C" { - pub fn AMotionEvent_getAction(motion_event: *const AInputEvent) -> i32; -} -extern "C" { - pub fn AMotionEvent_getFlags(motion_event: *const AInputEvent) -> i32; -} -extern "C" { - pub fn AMotionEvent_getMetaState(motion_event: *const AInputEvent) -> i32; -} -extern "C" { - pub fn AMotionEvent_getButtonState(motion_event: *const AInputEvent) -> i32; -} -extern "C" { - pub fn AMotionEvent_getEdgeFlags(motion_event: *const AInputEvent) -> i32; -} -extern "C" { - pub fn AMotionEvent_getDownTime(motion_event: *const AInputEvent) -> i64; -} -extern "C" { - pub fn AMotionEvent_getEventTime(motion_event: *const AInputEvent) -> i64; -} -extern "C" { - pub fn AMotionEvent_getXOffset(motion_event: *const AInputEvent) -> f32; -} -extern "C" { - pub fn AMotionEvent_getYOffset(motion_event: *const AInputEvent) -> f32; -} -extern "C" { - pub fn AMotionEvent_getXPrecision(motion_event: *const AInputEvent) -> f32; -} -extern "C" { - pub fn AMotionEvent_getYPrecision(motion_event: *const AInputEvent) -> f32; -} -extern "C" { - pub fn AMotionEvent_getPointerCount(motion_event: *const AInputEvent) -> usize; -} -extern "C" { - pub fn AMotionEvent_getPointerId(motion_event: *const AInputEvent, pointer_index: usize) - -> i32; -} -extern "C" { - pub fn AMotionEvent_getToolType(motion_event: *const AInputEvent, pointer_index: usize) -> i32; -} -extern "C" { - pub fn AMotionEvent_getRawX(motion_event: *const AInputEvent, pointer_index: usize) -> f32; -} -extern "C" { - pub fn AMotionEvent_getRawY(motion_event: *const AInputEvent, pointer_index: usize) -> f32; -} -extern "C" { - pub fn AMotionEvent_getX(motion_event: *const AInputEvent, pointer_index: usize) -> f32; -} -extern "C" { - pub fn AMotionEvent_getY(motion_event: *const AInputEvent, pointer_index: usize) -> f32; -} -extern "C" { - pub fn AMotionEvent_getPressure(motion_event: *const AInputEvent, pointer_index: usize) -> f32; -} -extern "C" { - pub fn AMotionEvent_getSize(motion_event: *const AInputEvent, pointer_index: usize) -> f32; -} -extern "C" { - pub fn AMotionEvent_getTouchMajor( - motion_event: *const AInputEvent, - pointer_index: usize, - ) -> f32; -} -extern "C" { - pub fn AMotionEvent_getTouchMinor( - motion_event: *const AInputEvent, - pointer_index: usize, - ) -> f32; -} -extern "C" { - pub fn AMotionEvent_getToolMajor(motion_event: *const AInputEvent, pointer_index: usize) - -> f32; -} -extern "C" { - pub fn AMotionEvent_getToolMinor(motion_event: *const AInputEvent, pointer_index: usize) - -> f32; -} -extern "C" { - pub fn AMotionEvent_getOrientation( - motion_event: *const AInputEvent, - pointer_index: usize, - ) -> f32; -} -extern "C" { - pub fn AMotionEvent_getAxisValue( - motion_event: *const AInputEvent, - axis: i32, - pointer_index: usize, - ) -> f32; -} -extern "C" { - pub fn AMotionEvent_getHistorySize(motion_event: *const AInputEvent) -> usize; -} -extern "C" { - pub fn AMotionEvent_getHistoricalEventTime( - motion_event: *const AInputEvent, - history_index: usize, - ) -> i64; -} -extern "C" { - pub fn AMotionEvent_getHistoricalRawX( - motion_event: *const AInputEvent, - pointer_index: usize, - history_index: usize, - ) -> f32; -} -extern "C" { - pub fn AMotionEvent_getHistoricalRawY( - motion_event: *const AInputEvent, - pointer_index: usize, - history_index: usize, - ) -> f32; -} -extern "C" { - pub fn AMotionEvent_getHistoricalX( - motion_event: *const AInputEvent, - pointer_index: usize, - history_index: usize, - ) -> f32; -} -extern "C" { - pub fn AMotionEvent_getHistoricalY( - motion_event: *const AInputEvent, - pointer_index: usize, - history_index: usize, - ) -> f32; -} -extern "C" { - pub fn AMotionEvent_getHistoricalPressure( - motion_event: *const AInputEvent, - pointer_index: usize, - history_index: usize, - ) -> f32; -} -extern "C" { - pub fn AMotionEvent_getHistoricalSize( - motion_event: *const AInputEvent, - pointer_index: usize, - history_index: usize, - ) -> f32; -} -extern "C" { - pub fn AMotionEvent_getHistoricalTouchMajor( - motion_event: *const AInputEvent, - pointer_index: usize, - history_index: usize, - ) -> f32; -} -extern "C" { - pub fn AMotionEvent_getHistoricalTouchMinor( - motion_event: *const AInputEvent, - pointer_index: usize, - history_index: usize, - ) -> f32; -} -extern "C" { - pub fn AMotionEvent_getHistoricalToolMajor( - motion_event: *const AInputEvent, - pointer_index: usize, - history_index: usize, - ) -> f32; -} -extern "C" { - pub fn AMotionEvent_getHistoricalToolMinor( - motion_event: *const AInputEvent, - pointer_index: usize, - history_index: usize, - ) -> f32; -} -extern "C" { - pub fn AMotionEvent_getHistoricalOrientation( - motion_event: *const AInputEvent, - pointer_index: usize, - history_index: usize, - ) -> f32; -} -extern "C" { - pub fn AMotionEvent_getHistoricalAxisValue( - motion_event: *const AInputEvent, - axis: i32, - pointer_index: usize, - history_index: usize, - ) -> f32; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct AInputQueue { - _unused: [u8; 0], -} -extern "C" { - pub fn AInputQueue_attachLooper( - queue: *mut AInputQueue, - looper: *mut ALooper, - ident: ::std::os::raw::c_int, - callback: ALooper_callbackFunc, - data: *mut ::std::os::raw::c_void, - ); -} -extern "C" { - pub fn AInputQueue_detachLooper(queue: *mut AInputQueue); -} -extern "C" { - pub fn AInputQueue_hasEvents(queue: *mut AInputQueue) -> i32; -} -extern "C" { - pub fn AInputQueue_getEvent(queue: *mut AInputQueue, outEvent: *mut *mut AInputEvent) -> i32; -} -extern "C" { - pub fn AInputQueue_preDispatchEvent(queue: *mut AInputQueue, event: *mut AInputEvent) -> i32; -} -extern "C" { - pub fn AInputQueue_finishEvent( - queue: *mut AInputQueue, - event: *mut AInputEvent, - handled: ::std::os::raw::c_int, - ); -} -pub const android_LogPriority_ANDROID_LOG_UNKNOWN: android_LogPriority = 0; -pub const android_LogPriority_ANDROID_LOG_DEFAULT: android_LogPriority = 1; -pub const android_LogPriority_ANDROID_LOG_VERBOSE: android_LogPriority = 2; -pub const android_LogPriority_ANDROID_LOG_DEBUG: android_LogPriority = 3; -pub const android_LogPriority_ANDROID_LOG_INFO: android_LogPriority = 4; -pub const android_LogPriority_ANDROID_LOG_WARN: android_LogPriority = 5; -pub const android_LogPriority_ANDROID_LOG_ERROR: android_LogPriority = 6; -pub const android_LogPriority_ANDROID_LOG_FATAL: android_LogPriority = 7; -pub const android_LogPriority_ANDROID_LOG_SILENT: android_LogPriority = 8; -pub type android_LogPriority = u32; -extern "C" { - pub fn __android_log_write( - prio: ::std::os::raw::c_int, - tag: *const ::std::os::raw::c_char, - text: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __android_log_print( - prio: ::std::os::raw::c_int, - tag: *const ::std::os::raw::c_char, - fmt: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __android_log_vprint( - prio: ::std::os::raw::c_int, - tag: *const ::std::os::raw::c_char, - fmt: *const ::std::os::raw::c_char, - ap: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __android_log_assert( - cond: *const ::std::os::raw::c_char, - tag: *const ::std::os::raw::c_char, - fmt: *const ::std::os::raw::c_char, - ... - ); -} -pub const log_id_LOG_ID_MIN: log_id = 0; -pub const log_id_LOG_ID_MAIN: log_id = 0; -pub const log_id_LOG_ID_RADIO: log_id = 1; -pub const log_id_LOG_ID_EVENTS: log_id = 2; -pub const log_id_LOG_ID_SYSTEM: log_id = 3; -pub const log_id_LOG_ID_CRASH: log_id = 4; -pub const log_id_LOG_ID_STATS: log_id = 5; -pub const log_id_LOG_ID_SECURITY: log_id = 6; -pub const log_id_LOG_ID_KERNEL: log_id = 7; -pub const log_id_LOG_ID_MAX: log_id = 8; -pub type log_id = u32; -pub use self::log_id as log_id_t; -extern "C" { - pub fn __android_log_buf_write( - bufID: ::std::os::raw::c_int, - prio: ::std::os::raw::c_int, - tag: *const ::std::os::raw::c_char, - text: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __android_log_buf_print( - bufID: ::std::os::raw::c_int, - prio: ::std::os::raw::c_int, - tag: *const ::std::os::raw::c_char, - fmt: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -pub type __kernel_sa_family_t = ::std::os::raw::c_ushort; -#[repr(C)] -#[repr(align(4))] -#[derive(Copy, Clone)] -pub struct sockaddr_storage { - pub ss_family: __kernel_sa_family_t, - pub __data: [::std::os::raw::c_char; 126usize], -} -#[test] -fn bindgen_test_layout_sockaddr_storage() { - assert_eq!( - ::std::mem::size_of::(), - 128usize, - concat!("Size of: ", stringify!(sockaddr_storage)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(sockaddr_storage)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ss_family as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(sockaddr_storage), - "::", - stringify!(ss_family) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__data as *const _ as usize }, - 2usize, - concat!( - "Offset of field: ", - stringify!(sockaddr_storage), - "::", - stringify!(__data) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct f_owner_ex { - pub type_: ::std::os::raw::c_int, - pub pid: __kernel_pid_t, -} -#[test] -fn bindgen_test_layout_f_owner_ex() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(f_owner_ex)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(f_owner_ex)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(f_owner_ex), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).pid as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(f_owner_ex), - "::", - stringify!(pid) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct flock { - pub l_type: ::std::os::raw::c_short, - pub l_whence: ::std::os::raw::c_short, - pub l_start: __kernel_off_t, - pub l_len: __kernel_off_t, - pub l_pid: __kernel_pid_t, -} -#[test] -fn bindgen_test_layout_flock() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(flock)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(flock)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).l_type as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(flock), - "::", - stringify!(l_type) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).l_whence as *const _ as usize }, - 2usize, - concat!( - "Offset of field: ", - stringify!(flock), - "::", - stringify!(l_whence) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).l_start as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(flock), - "::", - stringify!(l_start) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).l_len as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(flock), - "::", - stringify!(l_len) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).l_pid as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(flock), - "::", - stringify!(l_pid) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct flock64 { - pub l_type: ::std::os::raw::c_short, - pub l_whence: ::std::os::raw::c_short, - pub __bindgen_padding_0: u32, - pub l_start: __kernel_loff_t, - pub l_len: __kernel_loff_t, - pub l_pid: __kernel_pid_t, - pub __bindgen_padding_1: u32, -} -#[test] -fn bindgen_test_layout_flock64() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(flock64)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(flock64)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).l_type as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(flock64), - "::", - stringify!(l_type) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).l_whence as *const _ as usize }, - 2usize, - concat!( - "Offset of field: ", - stringify!(flock64), - "::", - stringify!(l_whence) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).l_start as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(flock64), - "::", - stringify!(l_start) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).l_len as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(flock64), - "::", - stringify!(l_len) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).l_pid as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(flock64), - "::", - stringify!(l_pid) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct iovec { - pub iov_base: *mut ::std::os::raw::c_void, - pub iov_len: __kernel_size_t, -} -#[test] -fn bindgen_test_layout_iovec() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(iovec)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(iovec)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).iov_base as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(iovec), - "::", - stringify!(iov_base) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).iov_len as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(iovec), - "::", - stringify!(iov_len) - ) - ); -} -pub type sa_family_t = ::std::os::raw::c_ushort; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct timespec { - _unused: [u8; 0], -} -pub const SHUT_RD: _bindgen_ty_24 = 0; -pub const SHUT_WR: _bindgen_ty_24 = 1; -pub const SHUT_RDWR: _bindgen_ty_24 = 2; -pub type _bindgen_ty_24 = u32; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct sockaddr { - pub sa_family: sa_family_t, - pub sa_data: [::std::os::raw::c_char; 14usize], -} -#[test] -fn bindgen_test_layout_sockaddr() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(sockaddr)) - ); - assert_eq!( - ::std::mem::align_of::(), - 2usize, - concat!("Alignment of ", stringify!(sockaddr)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sa_family as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(sockaddr), - "::", - stringify!(sa_family) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sa_data as *const _ as usize }, - 2usize, - concat!( - "Offset of field: ", - stringify!(sockaddr), - "::", - stringify!(sa_data) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct linger { - pub l_onoff: ::std::os::raw::c_int, - pub l_linger: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_linger() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(linger)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(linger)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).l_onoff as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(linger), - "::", - stringify!(l_onoff) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).l_linger as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(linger), - "::", - stringify!(l_linger) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct msghdr { - pub msg_name: *mut ::std::os::raw::c_void, - pub msg_namelen: socklen_t, - pub msg_iov: *mut iovec, - pub msg_iovlen: usize, - pub msg_control: *mut ::std::os::raw::c_void, - pub msg_controllen: usize, - pub msg_flags: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_msghdr() { - assert_eq!( - ::std::mem::size_of::(), - 28usize, - concat!("Size of: ", stringify!(msghdr)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(msghdr)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).msg_name as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(msghdr), - "::", - stringify!(msg_name) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).msg_namelen as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(msghdr), - "::", - stringify!(msg_namelen) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).msg_iov as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(msghdr), - "::", - stringify!(msg_iov) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).msg_iovlen as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(msghdr), - "::", - stringify!(msg_iovlen) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).msg_control as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(msghdr), - "::", - stringify!(msg_control) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).msg_controllen as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(msghdr), - "::", - stringify!(msg_controllen) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).msg_flags as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(msghdr), - "::", - stringify!(msg_flags) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mmsghdr { - pub msg_hdr: msghdr, - pub msg_len: ::std::os::raw::c_uint, -} -#[test] -fn bindgen_test_layout_mmsghdr() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(mmsghdr)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(mmsghdr)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).msg_hdr as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mmsghdr), - "::", - stringify!(msg_hdr) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).msg_len as *const _ as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(mmsghdr), - "::", - stringify!(msg_len) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct cmsghdr { - pub cmsg_len: usize, - pub cmsg_level: ::std::os::raw::c_int, - pub cmsg_type: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_cmsghdr() { - assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(cmsghdr)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(cmsghdr)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).cmsg_len as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(cmsghdr), - "::", - stringify!(cmsg_len) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).cmsg_level as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(cmsghdr), - "::", - stringify!(cmsg_level) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).cmsg_type as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(cmsghdr), - "::", - stringify!(cmsg_type) - ) - ); -} -extern "C" { - pub fn __cmsg_nxthdr(__msg: *mut msghdr, __cmsg: *mut cmsghdr) -> *mut cmsghdr; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ucred { - pub pid: pid_t, - pub uid: uid_t, - pub gid: gid_t, -} -#[test] -fn bindgen_test_layout_ucred() { - assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(ucred)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(ucred)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).pid as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ucred), - "::", - stringify!(pid) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).uid as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(ucred), - "::", - stringify!(uid) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).gid as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ucred), - "::", - stringify!(gid) - ) - ); -} -extern "C" { - pub fn accept( - __fd: ::std::os::raw::c_int, - __addr: *mut sockaddr, - __addr_length: *mut socklen_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn accept4( - __fd: ::std::os::raw::c_int, - __addr: *mut sockaddr, - __addr_length: *mut socklen_t, - __flags: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn bind( - __fd: ::std::os::raw::c_int, - __addr: *const sockaddr, - __addr_length: socklen_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn connect( - __fd: ::std::os::raw::c_int, - __addr: *const sockaddr, - __addr_length: socklen_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getpeername( - __fd: ::std::os::raw::c_int, - __addr: *mut sockaddr, - __addr_length: *mut socklen_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getsockname( - __fd: ::std::os::raw::c_int, - __addr: *mut sockaddr, - __addr_length: *mut socklen_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getsockopt( - __fd: ::std::os::raw::c_int, - __level: ::std::os::raw::c_int, - __option: ::std::os::raw::c_int, - __value: *mut ::std::os::raw::c_void, - __value_length: *mut socklen_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn listen( - __fd: ::std::os::raw::c_int, - __backlog: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn recvmmsg( - __fd: ::std::os::raw::c_int, - __msgs: *mut mmsghdr, - __msg_count: ::std::os::raw::c_uint, - __flags: ::std::os::raw::c_int, - __timeout: *const timespec, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn recvmsg( - __fd: ::std::os::raw::c_int, - __msg: *mut msghdr, - __flags: ::std::os::raw::c_int, - ) -> isize; -} -extern "C" { - pub fn sendmmsg( - __fd: ::std::os::raw::c_int, - __msgs: *const mmsghdr, - __msg_count: ::std::os::raw::c_uint, - __flags: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sendmsg( - __fd: ::std::os::raw::c_int, - __msg: *const msghdr, - __flags: ::std::os::raw::c_int, - ) -> isize; -} -extern "C" { - pub fn setsockopt( - __fd: ::std::os::raw::c_int, - __level: ::std::os::raw::c_int, - __option: ::std::os::raw::c_int, - __value: *const ::std::os::raw::c_void, - __value_length: socklen_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn shutdown( - __fd: ::std::os::raw::c_int, - __how: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn socket( - __af: ::std::os::raw::c_int, - __type: ::std::os::raw::c_int, - __protocol: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn socketpair( - __af: ::std::os::raw::c_int, - __type: ::std::os::raw::c_int, - __protocol: ::std::os::raw::c_int, - __fds: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn recv( - __fd: ::std::os::raw::c_int, - __buf: *mut ::std::os::raw::c_void, - __n: usize, - __flags: ::std::os::raw::c_int, - ) -> isize; -} -extern "C" { - pub fn send( - __fd: ::std::os::raw::c_int, - __buf: *const ::std::os::raw::c_void, - __n: usize, - __flags: ::std::os::raw::c_int, - ) -> isize; -} -extern "C" { - pub fn sendto( - __fd: ::std::os::raw::c_int, - __buf: *const ::std::os::raw::c_void, - __n: usize, - __flags: ::std::os::raw::c_int, - __dst_addr: *const sockaddr, - __dst_addr_length: socklen_t, - ) -> isize; -} -extern "C" { - pub fn recvfrom( - __fd: ::std::os::raw::c_int, - __buf: *mut ::std::os::raw::c_void, - __n: usize, - __flags: ::std::os::raw::c_int, - __src_addr: *mut sockaddr, - __src_addr_length: *mut socklen_t, - ) -> isize; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct hostent { - pub h_name: *mut ::std::os::raw::c_char, - pub h_aliases: *mut *mut ::std::os::raw::c_char, - pub h_addrtype: ::std::os::raw::c_int, - pub h_length: ::std::os::raw::c_int, - pub h_addr_list: *mut *mut ::std::os::raw::c_char, -} -#[test] -fn bindgen_test_layout_hostent() { - assert_eq!( - ::std::mem::size_of::(), - 20usize, - concat!("Size of: ", stringify!(hostent)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(hostent)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).h_name as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(hostent), - "::", - stringify!(h_name) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).h_aliases as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(hostent), - "::", - stringify!(h_aliases) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).h_addrtype as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(hostent), - "::", - stringify!(h_addrtype) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).h_length as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(hostent), - "::", - stringify!(h_length) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).h_addr_list as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(hostent), - "::", - stringify!(h_addr_list) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct netent { - pub n_name: *mut ::std::os::raw::c_char, - pub n_aliases: *mut *mut ::std::os::raw::c_char, - pub n_addrtype: ::std::os::raw::c_int, - pub n_net: u32, -} -#[test] -fn bindgen_test_layout_netent() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(netent)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(netent)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).n_name as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(netent), - "::", - stringify!(n_name) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).n_aliases as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(netent), - "::", - stringify!(n_aliases) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).n_addrtype as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(netent), - "::", - stringify!(n_addrtype) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).n_net as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(netent), - "::", - stringify!(n_net) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct servent { - pub s_name: *mut ::std::os::raw::c_char, - pub s_aliases: *mut *mut ::std::os::raw::c_char, - pub s_port: ::std::os::raw::c_int, - pub s_proto: *mut ::std::os::raw::c_char, -} -#[test] -fn bindgen_test_layout_servent() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(servent)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(servent)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).s_name as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(servent), - "::", - stringify!(s_name) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).s_aliases as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(servent), - "::", - stringify!(s_aliases) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).s_port as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(servent), - "::", - stringify!(s_port) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).s_proto as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(servent), - "::", - stringify!(s_proto) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct protoent { - pub p_name: *mut ::std::os::raw::c_char, - pub p_aliases: *mut *mut ::std::os::raw::c_char, - pub p_proto: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_protoent() { - assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(protoent)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(protoent)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).p_name as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(protoent), - "::", - stringify!(p_name) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).p_aliases as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(protoent), - "::", - stringify!(p_aliases) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).p_proto as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(protoent), - "::", - stringify!(p_proto) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct addrinfo { - pub ai_flags: ::std::os::raw::c_int, - pub ai_family: ::std::os::raw::c_int, - pub ai_socktype: ::std::os::raw::c_int, - pub ai_protocol: ::std::os::raw::c_int, - pub ai_addrlen: socklen_t, - pub ai_canonname: *mut ::std::os::raw::c_char, - pub ai_addr: *mut sockaddr, - pub ai_next: *mut addrinfo, -} -#[test] -fn bindgen_test_layout_addrinfo() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(addrinfo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(addrinfo)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ai_flags as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(addrinfo), - "::", - stringify!(ai_flags) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ai_family as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(addrinfo), - "::", - stringify!(ai_family) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ai_socktype as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(addrinfo), - "::", - stringify!(ai_socktype) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ai_protocol as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(addrinfo), - "::", - stringify!(ai_protocol) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ai_addrlen as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(addrinfo), - "::", - stringify!(ai_addrlen) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ai_canonname as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(addrinfo), - "::", - stringify!(ai_canonname) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ai_addr as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(addrinfo), - "::", - stringify!(ai_addr) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ai_next as *const _ as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(addrinfo), - "::", - stringify!(ai_next) - ) - ); -} -extern "C" { - pub fn getaddrinfo( - __node: *const ::std::os::raw::c_char, - __service: *const ::std::os::raw::c_char, - __hints: *const addrinfo, - __result: *mut *mut addrinfo, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn freeaddrinfo(__ptr: *mut addrinfo); -} -extern "C" { - pub fn getnameinfo( - __sa: *const sockaddr, - __sa_length: socklen_t, - __host: *mut ::std::os::raw::c_char, - __host_length: usize, - __service: *mut ::std::os::raw::c_char, - __service_length: usize, - __flags: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn gai_strerror(__error: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn __get_h_errno() -> *mut ::std::os::raw::c_int; -} -extern "C" { - pub fn herror(__s: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn hstrerror(__error: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn gethostbyaddr( - __addr: *const ::std::os::raw::c_void, - __length: socklen_t, - __type: ::std::os::raw::c_int, - ) -> *mut hostent; -} -extern "C" { - pub fn gethostbyaddr_r( - __addr: *const ::std::os::raw::c_void, - __length: socklen_t, - __type: ::std::os::raw::c_int, - __ret: *mut hostent, - __buf: *mut ::std::os::raw::c_char, - __buf_size: usize, - __result: *mut *mut hostent, - __h_errno_ptr: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn gethostbyname(__name: *const ::std::os::raw::c_char) -> *mut hostent; -} -extern "C" { - pub fn gethostbyname_r( - __name: *const ::std::os::raw::c_char, - __ret: *mut hostent, - __buf: *mut ::std::os::raw::c_char, - __buf_size: usize, - __result: *mut *mut hostent, - __h_errno_ptr: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn gethostbyname2( - __name: *const ::std::os::raw::c_char, - __af: ::std::os::raw::c_int, - ) -> *mut hostent; -} -extern "C" { - pub fn gethostbyname2_r( - __name: *const ::std::os::raw::c_char, - __af: ::std::os::raw::c_int, - __ret: *mut hostent, - __buf: *mut ::std::os::raw::c_char, - __buf_size: usize, - __result: *mut *mut hostent, - __h_errno_ptr: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn endhostent(); -} -extern "C" { - pub fn gethostent() -> *mut hostent; -} -extern "C" { - pub fn sethostent(__stay_open: ::std::os::raw::c_int); -} -extern "C" { - pub fn endnetent(); -} -extern "C" { - pub fn getnetbyaddr(__net: u32, __type: ::std::os::raw::c_int) -> *mut netent; -} -extern "C" { - pub fn getnetbyname(__name: *const ::std::os::raw::c_char) -> *mut netent; -} -extern "C" { - pub fn getnetent() -> *mut netent; -} -extern "C" { - pub fn setnetent(__stay_open: ::std::os::raw::c_int); -} -extern "C" { - pub fn endprotoent(); -} -extern "C" { - pub fn getprotobyname(__name: *const ::std::os::raw::c_char) -> *mut protoent; -} -extern "C" { - pub fn getprotobynumber(__proto: ::std::os::raw::c_int) -> *mut protoent; -} -extern "C" { - pub fn getprotoent() -> *mut protoent; -} -extern "C" { - pub fn setprotoent(__stay_open: ::std::os::raw::c_int); -} -extern "C" { - pub fn endservent(); -} -extern "C" { - pub fn getservbyname( - __name: *const ::std::os::raw::c_char, - __proto: *const ::std::os::raw::c_char, - ) -> *mut servent; -} -extern "C" { - pub fn getservbyport( - __port_in_network_order: ::std::os::raw::c_int, - __proto: *const ::std::os::raw::c_char, - ) -> *mut servent; -} -extern "C" { - pub fn getservent() -> *mut servent; -} -extern "C" { - pub fn setservent(__stay_open: ::std::os::raw::c_int); -} -pub type fpos_t = off_t; -pub type fpos64_t = off64_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __sFILE { - _unused: [u8; 0], -} -pub type FILE = __sFILE; -extern "C" { - pub static mut stdin: *mut FILE; -} -extern "C" { - pub static mut stdout: *mut FILE; -} -extern "C" { - pub static mut stderr: *mut FILE; -} -extern "C" { - pub fn clearerr(__fp: *mut FILE); -} -extern "C" { - pub fn fclose(__fp: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn feof(__fp: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ferror(__fp: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fflush(__fp: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fgetc(__fp: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fgets( - __buf: *mut ::std::os::raw::c_char, - __size: ::std::os::raw::c_int, - __fp: *mut FILE, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn fprintf( - __fp: *mut FILE, - __fmt: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fputc(__ch: ::std::os::raw::c_int, __fp: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fputs(__s: *const ::std::os::raw::c_char, __fp: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fread( - __buf: *mut ::std::os::raw::c_void, - __size: ::std::os::raw::c_uint, - __count: ::std::os::raw::c_uint, - __fp: *mut FILE, - ) -> ::std::os::raw::c_uint; -} -extern "C" { - pub fn fscanf( - __fp: *mut FILE, - __fmt: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fwrite( - __buf: *const ::std::os::raw::c_void, - __size: ::std::os::raw::c_uint, - __count: ::std::os::raw::c_uint, - __fp: *mut FILE, - ) -> ::std::os::raw::c_uint; -} -extern "C" { - pub fn getc(__fp: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getchar() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getdelim( - __line_ptr: *mut *mut ::std::os::raw::c_char, - __line_length_ptr: *mut usize, - __delimiter: ::std::os::raw::c_int, - __fp: *mut FILE, - ) -> isize; -} -extern "C" { - pub fn getline( - __line_ptr: *mut *mut ::std::os::raw::c_char, - __line_length_ptr: *mut usize, - __fp: *mut FILE, - ) -> isize; -} -extern "C" { - pub fn perror(__msg: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn printf(__fmt: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn putc(__ch: ::std::os::raw::c_int, __fp: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn putchar(__ch: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn puts(__s: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn remove(__path: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn rewind(__fp: *mut FILE); -} -extern "C" { - pub fn scanf(__fmt: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn setbuf(__fp: *mut FILE, __buf: *mut ::std::os::raw::c_char); -} -extern "C" { - pub fn setvbuf( - __fp: *mut FILE, - __buf: *mut ::std::os::raw::c_char, - __mode: ::std::os::raw::c_int, - __size: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sscanf( - __s: *const ::std::os::raw::c_char, - __fmt: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ungetc(__ch: ::std::os::raw::c_int, __fp: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vfprintf( - __fp: *mut FILE, - __fmt: *const ::std::os::raw::c_char, - __args: __builtin_va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vprintf( - __fp: *const ::std::os::raw::c_char, - __args: __builtin_va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn dprintf( - __fd: ::std::os::raw::c_int, - __fmt: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vdprintf( - __fd: ::std::os::raw::c_int, - __fmt: *const ::std::os::raw::c_char, - __args: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sprintf( - __s: *mut ::std::os::raw::c_char, - __fmt: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vsprintf( - __s: *mut ::std::os::raw::c_char, - __fmt: *const ::std::os::raw::c_char, - __args: __builtin_va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn tmpnam(__s: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn tempnam( - __dir: *const ::std::os::raw::c_char, - __prefix: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn rename( - __old_path: *const ::std::os::raw::c_char, - __new_path: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn renameat( - __old_dir_fd: ::std::os::raw::c_int, - __old_path: *const ::std::os::raw::c_char, - __new_dir_fd: ::std::os::raw::c_int, - __new_path: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fseek( - __fp: *mut FILE, - __offset: ::std::os::raw::c_long, - __whence: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ftell(__fp: *mut FILE) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn fgetpos(__fp: *mut FILE, __pos: *mut fpos_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fsetpos(__fp: *mut FILE, __pos: *const fpos_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fseeko( - __fp: *mut FILE, - __offset: off_t, - __whence: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ftello(__fp: *mut FILE) -> off_t; -} -extern "C" { - pub fn fgetpos64(__fp: *mut FILE, __pos: *mut fpos64_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fsetpos64(__fp: *mut FILE, __pos: *const fpos64_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fseeko64( - __fp: *mut FILE, - __offset: off64_t, - __whence: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ftello64(__fp: *mut FILE) -> off64_t; -} -extern "C" { - pub fn fopen( - __path: *const ::std::os::raw::c_char, - __mode: *const ::std::os::raw::c_char, - ) -> *mut FILE; -} -extern "C" { - pub fn fopen64( - __path: *const ::std::os::raw::c_char, - __mode: *const ::std::os::raw::c_char, - ) -> *mut FILE; -} -extern "C" { - pub fn freopen( - __path: *const ::std::os::raw::c_char, - __mode: *const ::std::os::raw::c_char, - __fp: *mut FILE, - ) -> *mut FILE; -} -extern "C" { - pub fn freopen64( - __path: *const ::std::os::raw::c_char, - __mode: *const ::std::os::raw::c_char, - __fp: *mut FILE, - ) -> *mut FILE; -} -extern "C" { - pub fn tmpfile() -> *mut FILE; -} -extern "C" { - pub fn tmpfile64() -> *mut FILE; -} -extern "C" { - pub fn snprintf( - __buf: *mut ::std::os::raw::c_char, - __size: ::std::os::raw::c_uint, - __fmt: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vfscanf( - __fp: *mut FILE, - __fmt: *const ::std::os::raw::c_char, - __args: __builtin_va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vscanf( - __fmt: *const ::std::os::raw::c_char, - __args: __builtin_va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vsnprintf( - __buf: *mut ::std::os::raw::c_char, - __size: ::std::os::raw::c_uint, - __fmt: *const ::std::os::raw::c_char, - __args: __builtin_va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vsscanf( - __s: *const ::std::os::raw::c_char, - __fmt: *const ::std::os::raw::c_char, - __args: __builtin_va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ctermid(__buf: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn fdopen(__fd: ::std::os::raw::c_int, __mode: *const ::std::os::raw::c_char) -> *mut FILE; -} -extern "C" { - pub fn fileno(__fp: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pclose(__fp: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn popen( - __command: *const ::std::os::raw::c_char, - __mode: *const ::std::os::raw::c_char, - ) -> *mut FILE; -} -extern "C" { - pub fn flockfile(__fp: *mut FILE); -} -extern "C" { - pub fn ftrylockfile(__fp: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn funlockfile(__fp: *mut FILE); -} -extern "C" { - pub fn getc_unlocked(__fp: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getchar_unlocked() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn putc_unlocked(__ch: ::std::os::raw::c_int, __fp: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn putchar_unlocked(__ch: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fmemopen( - __buf: *mut ::std::os::raw::c_void, - __size: usize, - __mode: *const ::std::os::raw::c_char, - ) -> *mut FILE; -} -extern "C" { - pub fn open_memstream( - __ptr: *mut *mut ::std::os::raw::c_char, - __size_ptr: *mut usize, - ) -> *mut FILE; -} -extern "C" { - pub fn asprintf( - __s_ptr: *mut *mut ::std::os::raw::c_char, - __fmt: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fgetln(__fp: *mut FILE, __length_ptr: *mut usize) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn fpurge(__fp: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn setbuffer( - __fp: *mut FILE, - __buf: *mut ::std::os::raw::c_char, - __size: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn setlinebuf(__fp: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vasprintf( - __s_ptr: *mut *mut ::std::os::raw::c_char, - __fmt: *const ::std::os::raw::c_char, - __args: va_list, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn clearerr_unlocked(__fp: *mut FILE); -} -extern "C" { - pub fn feof_unlocked(__fp: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ferror_unlocked(__fp: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fileno_unlocked(__fp: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn malloc(__byte_count: ::std::os::raw::c_uint) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn calloc( - __item_count: ::std::os::raw::c_uint, - __item_size: ::std::os::raw::c_uint, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn realloc( - __ptr: *mut ::std::os::raw::c_void, - __byte_count: ::std::os::raw::c_uint, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn reallocarray( - __ptr: *mut ::std::os::raw::c_void, - __item_count: usize, - __item_size: usize, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn free(__ptr: *mut ::std::os::raw::c_void); -} -extern "C" { - pub fn memalign(__alignment: usize, __byte_count: usize) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn malloc_usable_size(__ptr: *const ::std::os::raw::c_void) -> usize; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct mallinfo { - pub arena: usize, - pub ordblks: usize, - pub smblks: usize, - pub hblks: usize, - pub hblkhd: usize, - pub usmblks: usize, - pub fsmblks: usize, - pub uordblks: usize, - pub fordblks: usize, - pub keepcost: usize, -} -#[test] -fn bindgen_test_layout_mallinfo() { - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(mallinfo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(mallinfo)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).arena as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mallinfo), - "::", - stringify!(arena) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ordblks as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(mallinfo), - "::", - stringify!(ordblks) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).smblks as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mallinfo), - "::", - stringify!(smblks) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).hblks as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(mallinfo), - "::", - stringify!(hblks) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).hblkhd as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mallinfo), - "::", - stringify!(hblkhd) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).usmblks as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(mallinfo), - "::", - stringify!(usmblks) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).fsmblks as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mallinfo), - "::", - stringify!(fsmblks) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).uordblks as *const _ as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(mallinfo), - "::", - stringify!(uordblks) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).fordblks as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mallinfo), - "::", - stringify!(fordblks) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).keepcost as *const _ as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(mallinfo), - "::", - stringify!(keepcost) - ) - ); -} -extern "C" { - pub fn mallinfo() -> mallinfo; -} -extern "C" { - pub fn malloc_info( - __must_be_zero: ::std::os::raw::c_int, - __fp: *mut FILE, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn mallopt( - __option: ::std::os::raw::c_int, - __value: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub static mut __malloc_hook: ::std::option::Option< - unsafe extern "C" fn( - __byte_count: usize, - __caller: *const ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void, - >; -} -extern "C" { - pub static mut __realloc_hook: ::std::option::Option< - unsafe extern "C" fn( - __ptr: *mut ::std::os::raw::c_void, - __byte_count: usize, - __caller: *const ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void, - >; -} -extern "C" { - pub static mut __free_hook: ::std::option::Option< - unsafe extern "C" fn( - __ptr: *mut ::std::os::raw::c_void, - __caller: *const ::std::os::raw::c_void, - ), - >; -} -extern "C" { - pub static mut __memalign_hook: ::std::option::Option< - unsafe extern "C" fn( - __alignment: usize, - __byte_count: usize, - __caller: *const ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void, - >; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __locale_t { - _unused: [u8; 0], -} -pub type locale_t = *mut __locale_t; -extern "C" { - pub fn abort(); -} -extern "C" { - pub fn exit(__status: ::std::os::raw::c_int); -} -extern "C" { - pub fn _Exit(__status: ::std::os::raw::c_int); -} -extern "C" { - pub fn atexit(__fn: ::std::option::Option) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn at_quick_exit( - __fn: ::std::option::Option, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn quick_exit(__status: ::std::os::raw::c_int); -} -extern "C" { - pub fn getenv(__name: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn putenv(__assignment: *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn setenv( - __name: *const ::std::os::raw::c_char, - __value: *const ::std::os::raw::c_char, - __overwrite: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn unsetenv(__name: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn clearenv() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn mkdtemp(__template: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn mktemp(__template: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn mkostemp64( - __template: *mut ::std::os::raw::c_char, - __flags: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn mkostemp( - __template: *mut ::std::os::raw::c_char, - __flags: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn mkostemps64( - __template: *mut ::std::os::raw::c_char, - __suffix_length: ::std::os::raw::c_int, - __flags: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn mkostemps( - __template: *mut ::std::os::raw::c_char, - __suffix_length: ::std::os::raw::c_int, - __flags: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn mkstemp64(__template: *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn mkstemp(__template: *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn mkstemps64( - __template: *mut ::std::os::raw::c_char, - __flags: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn mkstemps( - __template: *mut ::std::os::raw::c_char, - __flags: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn strtol( - __s: *const ::std::os::raw::c_char, - __end_ptr: *mut *mut ::std::os::raw::c_char, - __base: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn strtoll( - __s: *const ::std::os::raw::c_char, - __end_ptr: *mut *mut ::std::os::raw::c_char, - __base: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn strtoul( - __s: *const ::std::os::raw::c_char, - __end_ptr: *mut *mut ::std::os::raw::c_char, - __base: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_ulong; -} -extern "C" { - pub fn strtoull( - __s: *const ::std::os::raw::c_char, - __end_ptr: *mut *mut ::std::os::raw::c_char, - __base: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_ulonglong; -} -extern "C" { - pub fn posix_memalign( - __memptr: *mut *mut ::std::os::raw::c_void, - __alignment: usize, - __size: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn aligned_alloc(__alignment: usize, __size: usize) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn strtod( - __s: *const ::std::os::raw::c_char, - __end_ptr: *mut *mut ::std::os::raw::c_char, - ) -> f64; -} -extern "C" { - pub fn strtoul_l( - __s: *const ::std::os::raw::c_char, - __end_ptr: *mut *mut ::std::os::raw::c_char, - __base: ::std::os::raw::c_int, - __l: locale_t, - ) -> ::std::os::raw::c_ulong; -} -extern "C" { - pub fn atoi(__s: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn atol(__s: *const ::std::os::raw::c_char) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn atoll(__s: *const ::std::os::raw::c_char) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn realpath( - __path: *const ::std::os::raw::c_char, - __resolved: *mut ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn system(__command: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn bsearch( - __key: *const ::std::os::raw::c_void, - __base: *const ::std::os::raw::c_void, - __nmemb: usize, - __size: usize, - __comparator: ::std::option::Option< - unsafe extern "C" fn( - __lhs: *const ::std::os::raw::c_void, - __rhs: *const ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int, - >, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn qsort( - __base: *mut ::std::os::raw::c_void, - __nmemb: usize, - __size: usize, - __comparator: ::std::option::Option< - unsafe extern "C" fn( - __lhs: *const ::std::os::raw::c_void, - __rhs: *const ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int, - >, - ); -} -extern "C" { - pub fn arc4random() -> u32; -} -extern "C" { - pub fn arc4random_uniform(__upper_bound: u32) -> u32; -} -extern "C" { - pub fn arc4random_buf(__buf: *mut ::std::os::raw::c_void, __n: usize); -} -extern "C" { - pub fn rand_r(__seed_ptr: *mut ::std::os::raw::c_uint) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn drand48() -> f64; -} -extern "C" { - pub fn erand48(__xsubi: *mut ::std::os::raw::c_ushort) -> f64; -} -extern "C" { - pub fn jrand48(__xsubi: *mut ::std::os::raw::c_ushort) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn lcong48(__param: *mut ::std::os::raw::c_ushort); -} -extern "C" { - pub fn lrand48() -> ::std::os::raw::c_long; -} -extern "C" { - pub fn mrand48() -> ::std::os::raw::c_long; -} -extern "C" { - pub fn nrand48(__xsubi: *mut ::std::os::raw::c_ushort) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn seed48(__seed16v: *mut ::std::os::raw::c_ushort) -> *mut ::std::os::raw::c_ushort; -} -extern "C" { - pub fn srand48(__seed: ::std::os::raw::c_long); -} -extern "C" { - pub fn initstate( - __seed: ::std::os::raw::c_uint, - __state: *mut ::std::os::raw::c_char, - __n: usize, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn setstate(__state: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn getpt() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn posix_openpt(__flags: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ptsname(__fd: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn ptsname_r( - __fd: ::std::os::raw::c_int, - __buf: *mut ::std::os::raw::c_char, - __n: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn unlockpt(__fd: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getsubopt( - __option: *mut *mut ::std::os::raw::c_char, - __tokens: *const *mut ::std::os::raw::c_char, - __value_ptr: *mut *mut ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct div_t { - pub quot: ::std::os::raw::c_int, - pub rem: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_div_t() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(div_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(div_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).quot as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(div_t), - "::", - stringify!(quot) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rem as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(div_t), - "::", - stringify!(rem) - ) - ); -} -extern "C" { - pub fn div(__numerator: ::std::os::raw::c_int, __denominator: ::std::os::raw::c_int) -> div_t; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ldiv_t { - pub quot: ::std::os::raw::c_long, - pub rem: ::std::os::raw::c_long, -} -#[test] -fn bindgen_test_layout_ldiv_t() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(ldiv_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(ldiv_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).quot as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ldiv_t), - "::", - stringify!(quot) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rem as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(ldiv_t), - "::", - stringify!(rem) - ) - ); -} -extern "C" { - pub fn ldiv( - __numerator: ::std::os::raw::c_long, - __denominator: ::std::os::raw::c_long, - ) -> ldiv_t; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct lldiv_t { - pub quot: ::std::os::raw::c_longlong, - pub rem: ::std::os::raw::c_longlong, -} -#[test] -fn bindgen_test_layout_lldiv_t() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(lldiv_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(lldiv_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).quot as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(lldiv_t), - "::", - stringify!(quot) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rem as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(lldiv_t), - "::", - stringify!(rem) - ) - ); -} -extern "C" { - pub fn lldiv( - __numerator: ::std::os::raw::c_longlong, - __denominator: ::std::os::raw::c_longlong, - ) -> lldiv_t; -} -extern "C" { - pub fn getloadavg(__averages: *mut f64, __n: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getprogname() -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn setprogname(__name: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn mblen(__s: *const ::std::os::raw::c_char, __n: usize) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn mbstowcs(__dst: *mut wchar_t, __src: *const ::std::os::raw::c_char, __n: usize) - -> usize; -} -extern "C" { - pub fn mbtowc( - __wc_ptr: *mut wchar_t, - __s: *const ::std::os::raw::c_char, - __n: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn wctomb(__dst: *mut ::std::os::raw::c_char, __wc: wchar_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn wcstombs(__dst: *mut ::std::os::raw::c_char, __src: *const wchar_t, __n: usize) - -> usize; -} -extern "C" { - pub fn __ctype_get_mb_cur_max() -> usize; -} -extern "C" { - pub fn abs(__x: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn labs(__x: ::std::os::raw::c_long) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn llabs(__x: ::std::os::raw::c_longlong) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn strtof( - __s: *const ::std::os::raw::c_char, - __end_ptr: *mut *mut ::std::os::raw::c_char, - ) -> f32; -} -extern "C" { - pub fn atof(__s: *const ::std::os::raw::c_char) -> f64; -} -extern "C" { - pub fn rand() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn srand(__seed: ::std::os::raw::c_uint); -} -extern "C" { - pub fn random() -> ::std::os::raw::c_long; -} -extern "C" { - pub fn srandom(__seed: ::std::os::raw::c_uint); -} -extern "C" { - pub fn grantpt(__fd: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn strtoll_l( - __s: *const ::std::os::raw::c_char, - __end_ptr: *mut *mut ::std::os::raw::c_char, - __base: ::std::os::raw::c_int, - __l: locale_t, - ) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn strtoull_l( - __s: *const ::std::os::raw::c_char, - __end_ptr: *mut *mut ::std::os::raw::c_char, - __base: ::std::os::raw::c_int, - __l: locale_t, - ) -> ::std::os::raw::c_ulonglong; -} -extern "C" { - pub fn strtold_l( - __s: *const ::std::os::raw::c_char, - __end_ptr: *mut *mut ::std::os::raw::c_char, - __l: locale_t, - ) -> f64; -} -extern "C" { - pub fn strtod_l( - __s: *const ::std::os::raw::c_char, - __end_ptr: *mut *mut ::std::os::raw::c_char, - __l: locale_t, - ) -> f64; -} -extern "C" { - pub fn strtof_l( - __s: *const ::std::os::raw::c_char, - __end_ptr: *mut *mut ::std::os::raw::c_char, - __l: locale_t, - ) -> f32; -} -extern "C" { - pub fn strtol_l( - __s: *const ::std::os::raw::c_char, - __end_ptr: *mut *mut ::std::os::raw::c_char, - arg1: ::std::os::raw::c_int, - __l: locale_t, - ) -> ::std::os::raw::c_long; -} -pub type net_handle_t = u64; -extern "C" { - pub fn android_setsocknetwork( - network: net_handle_t, - fd: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn android_setprocnetwork(network: net_handle_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn android_getaddrinfofornetwork( - network: net_handle_t, - node: *const ::std::os::raw::c_char, - service: *const ::std::os::raw::c_char, - hints: *const addrinfo, - res: *mut *mut addrinfo, - ) -> ::std::os::raw::c_int; -} -pub const ResNsendFlags_ANDROID_RESOLV_NO_RETRY: ResNsendFlags = 1; -pub const ResNsendFlags_ANDROID_RESOLV_NO_CACHE_STORE: ResNsendFlags = 2; -pub const ResNsendFlags_ANDROID_RESOLV_NO_CACHE_LOOKUP: ResNsendFlags = 4; -pub type ResNsendFlags = u32; -extern "C" { - pub fn android_res_nquery( - network: net_handle_t, - dname: *const ::std::os::raw::c_char, - ns_class: ::std::os::raw::c_int, - ns_type: ::std::os::raw::c_int, - flags: u32, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn android_res_nsend( - network: net_handle_t, - msg: *const u8, - msglen: usize, - flags: u32, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn android_res_nresult( - fd: ::std::os::raw::c_int, - rcode: *mut ::std::os::raw::c_int, - answer: *mut u8, - anslen: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn android_res_cancel(nsend_fd: ::std::os::raw::c_int); -} -pub const OperandCode_ANEURALNETWORKS_FLOAT32: OperandCode = 0; -pub const OperandCode_ANEURALNETWORKS_INT32: OperandCode = 1; -pub const OperandCode_ANEURALNETWORKS_UINT32: OperandCode = 2; -pub const OperandCode_ANEURALNETWORKS_TENSOR_FLOAT32: OperandCode = 3; -pub const OperandCode_ANEURALNETWORKS_TENSOR_INT32: OperandCode = 4; -pub const OperandCode_ANEURALNETWORKS_TENSOR_QUANT8_ASYMM: OperandCode = 5; -pub const OperandCode_ANEURALNETWORKS_BOOL: OperandCode = 6; -pub const OperandCode_ANEURALNETWORKS_TENSOR_QUANT16_SYMM: OperandCode = 7; -pub const OperandCode_ANEURALNETWORKS_TENSOR_FLOAT16: OperandCode = 8; -pub const OperandCode_ANEURALNETWORKS_TENSOR_BOOL8: OperandCode = 9; -pub const OperandCode_ANEURALNETWORKS_FLOAT16: OperandCode = 10; -pub const OperandCode_ANEURALNETWORKS_TENSOR_QUANT8_SYMM_PER_CHANNEL: OperandCode = 11; -pub const OperandCode_ANEURALNETWORKS_TENSOR_QUANT16_ASYMM: OperandCode = 12; -pub const OperandCode_ANEURALNETWORKS_TENSOR_QUANT8_SYMM: OperandCode = 13; -pub type OperandCode = u32; -pub const OperationCode_ANEURALNETWORKS_ADD: OperationCode = 0; -pub const OperationCode_ANEURALNETWORKS_AVERAGE_POOL_2D: OperationCode = 1; -pub const OperationCode_ANEURALNETWORKS_CONCATENATION: OperationCode = 2; -pub const OperationCode_ANEURALNETWORKS_CONV_2D: OperationCode = 3; -pub const OperationCode_ANEURALNETWORKS_DEPTHWISE_CONV_2D: OperationCode = 4; -pub const OperationCode_ANEURALNETWORKS_DEPTH_TO_SPACE: OperationCode = 5; -pub const OperationCode_ANEURALNETWORKS_DEQUANTIZE: OperationCode = 6; -pub const OperationCode_ANEURALNETWORKS_EMBEDDING_LOOKUP: OperationCode = 7; -pub const OperationCode_ANEURALNETWORKS_FLOOR: OperationCode = 8; -pub const OperationCode_ANEURALNETWORKS_FULLY_CONNECTED: OperationCode = 9; -pub const OperationCode_ANEURALNETWORKS_HASHTABLE_LOOKUP: OperationCode = 10; -pub const OperationCode_ANEURALNETWORKS_L2_NORMALIZATION: OperationCode = 11; -pub const OperationCode_ANEURALNETWORKS_L2_POOL_2D: OperationCode = 12; -pub const OperationCode_ANEURALNETWORKS_LOCAL_RESPONSE_NORMALIZATION: OperationCode = 13; -pub const OperationCode_ANEURALNETWORKS_LOGISTIC: OperationCode = 14; -pub const OperationCode_ANEURALNETWORKS_LSH_PROJECTION: OperationCode = 15; -pub const OperationCode_ANEURALNETWORKS_LSTM: OperationCode = 16; -pub const OperationCode_ANEURALNETWORKS_MAX_POOL_2D: OperationCode = 17; -pub const OperationCode_ANEURALNETWORKS_MUL: OperationCode = 18; -pub const OperationCode_ANEURALNETWORKS_RELU: OperationCode = 19; -pub const OperationCode_ANEURALNETWORKS_RELU1: OperationCode = 20; -pub const OperationCode_ANEURALNETWORKS_RELU6: OperationCode = 21; -pub const OperationCode_ANEURALNETWORKS_RESHAPE: OperationCode = 22; -pub const OperationCode_ANEURALNETWORKS_RESIZE_BILINEAR: OperationCode = 23; -pub const OperationCode_ANEURALNETWORKS_RNN: OperationCode = 24; -pub const OperationCode_ANEURALNETWORKS_SOFTMAX: OperationCode = 25; -pub const OperationCode_ANEURALNETWORKS_SPACE_TO_DEPTH: OperationCode = 26; -pub const OperationCode_ANEURALNETWORKS_SVDF: OperationCode = 27; -pub const OperationCode_ANEURALNETWORKS_TANH: OperationCode = 28; -pub const OperationCode_ANEURALNETWORKS_BATCH_TO_SPACE_ND: OperationCode = 29; -pub const OperationCode_ANEURALNETWORKS_DIV: OperationCode = 30; -pub const OperationCode_ANEURALNETWORKS_MEAN: OperationCode = 31; -pub const OperationCode_ANEURALNETWORKS_PAD: OperationCode = 32; -pub const OperationCode_ANEURALNETWORKS_SPACE_TO_BATCH_ND: OperationCode = 33; -pub const OperationCode_ANEURALNETWORKS_SQUEEZE: OperationCode = 34; -pub const OperationCode_ANEURALNETWORKS_STRIDED_SLICE: OperationCode = 35; -pub const OperationCode_ANEURALNETWORKS_SUB: OperationCode = 36; -pub const OperationCode_ANEURALNETWORKS_TRANSPOSE: OperationCode = 37; -pub const OperationCode_ANEURALNETWORKS_ABS: OperationCode = 38; -pub const OperationCode_ANEURALNETWORKS_ARGMAX: OperationCode = 39; -pub const OperationCode_ANEURALNETWORKS_ARGMIN: OperationCode = 40; -pub const OperationCode_ANEURALNETWORKS_AXIS_ALIGNED_BBOX_TRANSFORM: OperationCode = 41; -pub const OperationCode_ANEURALNETWORKS_BIDIRECTIONAL_SEQUENCE_LSTM: OperationCode = 42; -pub const OperationCode_ANEURALNETWORKS_BIDIRECTIONAL_SEQUENCE_RNN: OperationCode = 43; -pub const OperationCode_ANEURALNETWORKS_BOX_WITH_NMS_LIMIT: OperationCode = 44; -pub const OperationCode_ANEURALNETWORKS_CAST: OperationCode = 45; -pub const OperationCode_ANEURALNETWORKS_CHANNEL_SHUFFLE: OperationCode = 46; -pub const OperationCode_ANEURALNETWORKS_DETECTION_POSTPROCESSING: OperationCode = 47; -pub const OperationCode_ANEURALNETWORKS_EQUAL: OperationCode = 48; -pub const OperationCode_ANEURALNETWORKS_EXP: OperationCode = 49; -pub const OperationCode_ANEURALNETWORKS_EXPAND_DIMS: OperationCode = 50; -pub const OperationCode_ANEURALNETWORKS_GATHER: OperationCode = 51; -pub const OperationCode_ANEURALNETWORKS_GENERATE_PROPOSALS: OperationCode = 52; -pub const OperationCode_ANEURALNETWORKS_GREATER: OperationCode = 53; -pub const OperationCode_ANEURALNETWORKS_GREATER_EQUAL: OperationCode = 54; -pub const OperationCode_ANEURALNETWORKS_GROUPED_CONV_2D: OperationCode = 55; -pub const OperationCode_ANEURALNETWORKS_HEATMAP_MAX_KEYPOINT: OperationCode = 56; -pub const OperationCode_ANEURALNETWORKS_INSTANCE_NORMALIZATION: OperationCode = 57; -pub const OperationCode_ANEURALNETWORKS_LESS: OperationCode = 58; -pub const OperationCode_ANEURALNETWORKS_LESS_EQUAL: OperationCode = 59; -pub const OperationCode_ANEURALNETWORKS_LOG: OperationCode = 60; -pub const OperationCode_ANEURALNETWORKS_LOGICAL_AND: OperationCode = 61; -pub const OperationCode_ANEURALNETWORKS_LOGICAL_NOT: OperationCode = 62; -pub const OperationCode_ANEURALNETWORKS_LOGICAL_OR: OperationCode = 63; -pub const OperationCode_ANEURALNETWORKS_LOG_SOFTMAX: OperationCode = 64; -pub const OperationCode_ANEURALNETWORKS_MAXIMUM: OperationCode = 65; -pub const OperationCode_ANEURALNETWORKS_MINIMUM: OperationCode = 66; -pub const OperationCode_ANEURALNETWORKS_NEG: OperationCode = 67; -pub const OperationCode_ANEURALNETWORKS_NOT_EQUAL: OperationCode = 68; -pub const OperationCode_ANEURALNETWORKS_PAD_V2: OperationCode = 69; -pub const OperationCode_ANEURALNETWORKS_POW: OperationCode = 70; -pub const OperationCode_ANEURALNETWORKS_PRELU: OperationCode = 71; -pub const OperationCode_ANEURALNETWORKS_QUANTIZE: OperationCode = 72; -pub const OperationCode_ANEURALNETWORKS_QUANTIZED_16BIT_LSTM: OperationCode = 73; -pub const OperationCode_ANEURALNETWORKS_RANDOM_MULTINOMIAL: OperationCode = 74; -pub const OperationCode_ANEURALNETWORKS_REDUCE_ALL: OperationCode = 75; -pub const OperationCode_ANEURALNETWORKS_REDUCE_ANY: OperationCode = 76; -pub const OperationCode_ANEURALNETWORKS_REDUCE_MAX: OperationCode = 77; -pub const OperationCode_ANEURALNETWORKS_REDUCE_MIN: OperationCode = 78; -pub const OperationCode_ANEURALNETWORKS_REDUCE_PROD: OperationCode = 79; -pub const OperationCode_ANEURALNETWORKS_REDUCE_SUM: OperationCode = 80; -pub const OperationCode_ANEURALNETWORKS_ROI_ALIGN: OperationCode = 81; -pub const OperationCode_ANEURALNETWORKS_ROI_POOLING: OperationCode = 82; -pub const OperationCode_ANEURALNETWORKS_RSQRT: OperationCode = 83; -pub const OperationCode_ANEURALNETWORKS_SELECT: OperationCode = 84; -pub const OperationCode_ANEURALNETWORKS_SIN: OperationCode = 85; -pub const OperationCode_ANEURALNETWORKS_SLICE: OperationCode = 86; -pub const OperationCode_ANEURALNETWORKS_SPLIT: OperationCode = 87; -pub const OperationCode_ANEURALNETWORKS_SQRT: OperationCode = 88; -pub const OperationCode_ANEURALNETWORKS_TILE: OperationCode = 89; -pub const OperationCode_ANEURALNETWORKS_TOPK_V2: OperationCode = 90; -pub const OperationCode_ANEURALNETWORKS_TRANSPOSE_CONV_2D: OperationCode = 91; -pub const OperationCode_ANEURALNETWORKS_UNIDIRECTIONAL_SEQUENCE_LSTM: OperationCode = 92; -pub const OperationCode_ANEURALNETWORKS_UNIDIRECTIONAL_SEQUENCE_RNN: OperationCode = 93; -pub const OperationCode_ANEURALNETWORKS_RESIZE_NEAREST_NEIGHBOR: OperationCode = 94; -pub type OperationCode = u32; -pub const FuseCode_ANEURALNETWORKS_FUSED_NONE: FuseCode = 0; -pub const FuseCode_ANEURALNETWORKS_FUSED_RELU: FuseCode = 1; -pub const FuseCode_ANEURALNETWORKS_FUSED_RELU1: FuseCode = 2; -pub const FuseCode_ANEURALNETWORKS_FUSED_RELU6: FuseCode = 3; -pub type FuseCode = u32; -pub const PaddingCode_ANEURALNETWORKS_PADDING_SAME: PaddingCode = 1; -pub const PaddingCode_ANEURALNETWORKS_PADDING_VALID: PaddingCode = 2; -pub type PaddingCode = u32; -pub const PreferenceCode_ANEURALNETWORKS_PREFER_LOW_POWER: PreferenceCode = 0; -pub const PreferenceCode_ANEURALNETWORKS_PREFER_FAST_SINGLE_ANSWER: PreferenceCode = 1; -pub const PreferenceCode_ANEURALNETWORKS_PREFER_SUSTAINED_SPEED: PreferenceCode = 2; -pub type PreferenceCode = u32; -pub const DeviceTypeCode_ANEURALNETWORKS_DEVICE_UNKNOWN: DeviceTypeCode = 0; -pub const DeviceTypeCode_ANEURALNETWORKS_DEVICE_OTHER: DeviceTypeCode = 1; -pub const DeviceTypeCode_ANEURALNETWORKS_DEVICE_CPU: DeviceTypeCode = 2; -pub const DeviceTypeCode_ANEURALNETWORKS_DEVICE_GPU: DeviceTypeCode = 3; -pub const DeviceTypeCode_ANEURALNETWORKS_DEVICE_ACCELERATOR: DeviceTypeCode = 4; -pub type DeviceTypeCode = u32; -pub const ResultCode_ANEURALNETWORKS_NO_ERROR: ResultCode = 0; -pub const ResultCode_ANEURALNETWORKS_OUT_OF_MEMORY: ResultCode = 1; -pub const ResultCode_ANEURALNETWORKS_INCOMPLETE: ResultCode = 2; -pub const ResultCode_ANEURALNETWORKS_UNEXPECTED_NULL: ResultCode = 3; -pub const ResultCode_ANEURALNETWORKS_BAD_DATA: ResultCode = 4; -pub const ResultCode_ANEURALNETWORKS_OP_FAILED: ResultCode = 5; -pub const ResultCode_ANEURALNETWORKS_BAD_STATE: ResultCode = 6; -pub const ResultCode_ANEURALNETWORKS_UNMAPPABLE: ResultCode = 7; -pub const ResultCode_ANEURALNETWORKS_OUTPUT_INSUFFICIENT_SIZE: ResultCode = 8; -pub const ResultCode_ANEURALNETWORKS_UNAVAILABLE_DEVICE: ResultCode = 9; -pub type ResultCode = u32; -pub const ANEURALNETWORKS_MAX_SIZE_OF_IMMEDIATELY_COPIED_VALUES: _bindgen_ty_25 = 128; -pub type _bindgen_ty_25 = u32; -pub const ANEURALNETWORKS_BYTE_SIZE_OF_CACHE_TOKEN: _bindgen_ty_26 = 32; -pub type _bindgen_ty_26 = u32; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ANeuralNetworksMemory { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ANeuralNetworksModel { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ANeuralNetworksCompilation { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ANeuralNetworksExecution { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ANeuralNetworksSymmPerChannelQuantParams { - pub channelDim: u32, - pub scaleCount: u32, - pub scales: *const f32, -} -#[test] -fn bindgen_test_layout_ANeuralNetworksSymmPerChannelQuantParams() { - assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!( - "Size of: ", - stringify!(ANeuralNetworksSymmPerChannelQuantParams) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(ANeuralNetworksSymmPerChannelQuantParams) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).channelDim - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ANeuralNetworksSymmPerChannelQuantParams), - "::", - stringify!(channelDim) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).scaleCount - as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(ANeuralNetworksSymmPerChannelQuantParams), - "::", - stringify!(scaleCount) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).scales as *const _ - as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ANeuralNetworksSymmPerChannelQuantParams), - "::", - stringify!(scales) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ANeuralNetworksBurst { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ANeuralNetworksOperandType { - pub type_: i32, - pub dimensionCount: u32, - pub dimensions: *const u32, - pub scale: f32, - pub zeroPoint: i32, -} -#[test] -fn bindgen_test_layout_ANeuralNetworksOperandType() { - assert_eq!( - ::std::mem::size_of::(), - 20usize, - concat!("Size of: ", stringify!(ANeuralNetworksOperandType)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(ANeuralNetworksOperandType)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).type_ as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ANeuralNetworksOperandType), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).dimensionCount as *const _ - as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(ANeuralNetworksOperandType), - "::", - stringify!(dimensionCount) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).dimensions as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ANeuralNetworksOperandType), - "::", - stringify!(dimensions) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).scale as *const _ as usize - }, - 12usize, - concat!( - "Offset of field: ", - stringify!(ANeuralNetworksOperandType), - "::", - stringify!(scale) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).zeroPoint as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(ANeuralNetworksOperandType), - "::", - stringify!(zeroPoint) - ) - ); -} -pub type ANeuralNetworksOperationType = i32; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ANeuralNetworksEvent { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ANeuralNetworksDevice { - _unused: [u8; 0], -} -extern "C" { - pub fn ANeuralNetworks_getDeviceCount(numDevices: *mut u32) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworks_getDevice( - devIndex: u32, - device: *mut *mut ANeuralNetworksDevice, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworksDevice_getName( - device: *const ANeuralNetworksDevice, - name: *mut *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworksDevice_getType( - device: *const ANeuralNetworksDevice, - type_: *mut i32, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworksDevice_getVersion( - device: *const ANeuralNetworksDevice, - version: *mut *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworksDevice_getFeatureLevel( - device: *const ANeuralNetworksDevice, - featureLevel: *mut i64, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworksModel_getSupportedOperationsForDevices( - model: *const ANeuralNetworksModel, - devices: *const *const ANeuralNetworksDevice, - numDevices: u32, - supportedOps: *mut bool, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworksCompilation_createForDevices( - model: *mut ANeuralNetworksModel, - devices: *const *const ANeuralNetworksDevice, - numDevices: u32, - compilation: *mut *mut ANeuralNetworksCompilation, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworksCompilation_setCaching( - compilation: *mut ANeuralNetworksCompilation, - cacheDir: *const ::std::os::raw::c_char, - token: *const u8, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworksExecution_compute( - execution: *mut ANeuralNetworksExecution, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworksExecution_getOutputOperandRank( - execution: *mut ANeuralNetworksExecution, - index: i32, - rank: *mut u32, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworksExecution_getOutputOperandDimensions( - execution: *mut ANeuralNetworksExecution, - index: i32, - dimensions: *mut u32, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworksBurst_create( - compilation: *mut ANeuralNetworksCompilation, - burst: *mut *mut ANeuralNetworksBurst, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworksBurst_free(burst: *mut ANeuralNetworksBurst); -} -extern "C" { - pub fn ANeuralNetworksExecution_burstCompute( - execution: *mut ANeuralNetworksExecution, - burst: *mut ANeuralNetworksBurst, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworksMemory_createFromAHardwareBuffer( - ahwb: *const AHardwareBuffer, - memory: *mut *mut ANeuralNetworksMemory, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworksExecution_setMeasureTiming( - execution: *mut ANeuralNetworksExecution, - measure: bool, - ) -> ::std::os::raw::c_int; -} -pub const DurationCode_ANEURALNETWORKS_DURATION_ON_HARDWARE: DurationCode = 0; -pub const DurationCode_ANEURALNETWORKS_DURATION_IN_DRIVER: DurationCode = 1; -pub type DurationCode = u32; -extern "C" { - pub fn ANeuralNetworksExecution_getDuration( - execution: *const ANeuralNetworksExecution, - durationCode: i32, - duration: *mut u64, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworksMemory_createFromFd( - size: usize, - protect: ::std::os::raw::c_int, - fd: ::std::os::raw::c_int, - offset: usize, - memory: *mut *mut ANeuralNetworksMemory, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworksMemory_free(memory: *mut ANeuralNetworksMemory); -} -extern "C" { - pub fn ANeuralNetworksModel_create( - model: *mut *mut ANeuralNetworksModel, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworksModel_free(model: *mut ANeuralNetworksModel); -} -extern "C" { - pub fn ANeuralNetworksModel_finish(model: *mut ANeuralNetworksModel) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworksModel_addOperand( - model: *mut ANeuralNetworksModel, - type_: *const ANeuralNetworksOperandType, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworksModel_setOperandValue( - model: *mut ANeuralNetworksModel, - index: i32, - buffer: *const ::std::os::raw::c_void, - length: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworksModel_setOperandSymmPerChannelQuantParams( - model: *mut ANeuralNetworksModel, - index: i32, - channelQuant: *const ANeuralNetworksSymmPerChannelQuantParams, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworksModel_setOperandValueFromMemory( - model: *mut ANeuralNetworksModel, - index: i32, - memory: *const ANeuralNetworksMemory, - offset: usize, - length: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworksModel_addOperation( - model: *mut ANeuralNetworksModel, - type_: ANeuralNetworksOperationType, - inputCount: u32, - inputs: *const u32, - outputCount: u32, - outputs: *const u32, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworksModel_identifyInputsAndOutputs( - model: *mut ANeuralNetworksModel, - inputCount: u32, - inputs: *const u32, - outputCount: u32, - outputs: *const u32, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworksModel_relaxComputationFloat32toFloat16( - model: *mut ANeuralNetworksModel, - allow: bool, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworksCompilation_create( - model: *mut ANeuralNetworksModel, - compilation: *mut *mut ANeuralNetworksCompilation, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworksCompilation_free(compilation: *mut ANeuralNetworksCompilation); -} -extern "C" { - pub fn ANeuralNetworksCompilation_setPreference( - compilation: *mut ANeuralNetworksCompilation, - preference: i32, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworksCompilation_finish( - compilation: *mut ANeuralNetworksCompilation, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworksExecution_create( - compilation: *mut ANeuralNetworksCompilation, - execution: *mut *mut ANeuralNetworksExecution, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworksExecution_free(execution: *mut ANeuralNetworksExecution); -} -extern "C" { - pub fn ANeuralNetworksExecution_setInput( - execution: *mut ANeuralNetworksExecution, - index: i32, - type_: *const ANeuralNetworksOperandType, - buffer: *const ::std::os::raw::c_void, - length: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworksExecution_setInputFromMemory( - execution: *mut ANeuralNetworksExecution, - index: i32, - type_: *const ANeuralNetworksOperandType, - memory: *const ANeuralNetworksMemory, - offset: usize, - length: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworksExecution_setOutput( - execution: *mut ANeuralNetworksExecution, - index: i32, - type_: *const ANeuralNetworksOperandType, - buffer: *mut ::std::os::raw::c_void, - length: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworksExecution_setOutputFromMemory( - execution: *mut ANeuralNetworksExecution, - index: i32, - type_: *const ANeuralNetworksOperandType, - memory: *const ANeuralNetworksMemory, - offset: usize, - length: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworksExecution_startCompute( - execution: *mut ANeuralNetworksExecution, - event: *mut *mut ANeuralNetworksEvent, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworksEvent_wait(event: *mut ANeuralNetworksEvent) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ANeuralNetworksEvent_free(event: *mut ANeuralNetworksEvent); -} -pub const ANativeWindow_LegacyFormat_WINDOW_FORMAT_RGBA_8888: ANativeWindow_LegacyFormat = 1; -pub const ANativeWindow_LegacyFormat_WINDOW_FORMAT_RGBX_8888: ANativeWindow_LegacyFormat = 2; -pub const ANativeWindow_LegacyFormat_WINDOW_FORMAT_RGB_565: ANativeWindow_LegacyFormat = 4; -pub type ANativeWindow_LegacyFormat = u32; -pub const ANativeWindowTransform_ANATIVEWINDOW_TRANSFORM_IDENTITY: ANativeWindowTransform = 0; -pub const ANativeWindowTransform_ANATIVEWINDOW_TRANSFORM_MIRROR_HORIZONTAL: ANativeWindowTransform = - 1; -pub const ANativeWindowTransform_ANATIVEWINDOW_TRANSFORM_MIRROR_VERTICAL: ANativeWindowTransform = - 2; -pub const ANativeWindowTransform_ANATIVEWINDOW_TRANSFORM_ROTATE_90: ANativeWindowTransform = 4; -pub const ANativeWindowTransform_ANATIVEWINDOW_TRANSFORM_ROTATE_180: ANativeWindowTransform = 3; -pub const ANativeWindowTransform_ANATIVEWINDOW_TRANSFORM_ROTATE_270: ANativeWindowTransform = 7; -pub type ANativeWindowTransform = u32; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ANativeWindow { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ANativeWindow_Buffer { - pub width: i32, - pub height: i32, - pub stride: i32, - pub format: i32, - pub bits: *mut ::std::os::raw::c_void, - pub reserved: [u32; 6usize], -} -#[test] -fn bindgen_test_layout_ANativeWindow_Buffer() { - assert_eq!( - ::std::mem::size_of::(), - 44usize, - concat!("Size of: ", stringify!(ANativeWindow_Buffer)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(ANativeWindow_Buffer)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ANativeWindow_Buffer), - "::", - stringify!(width) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(ANativeWindow_Buffer), - "::", - stringify!(height) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).stride as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ANativeWindow_Buffer), - "::", - stringify!(stride) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).format as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(ANativeWindow_Buffer), - "::", - stringify!(format) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).bits as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(ANativeWindow_Buffer), - "::", - stringify!(bits) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(ANativeWindow_Buffer), - "::", - stringify!(reserved) - ) - ); -} -extern "C" { - pub fn ANativeWindow_acquire(window: *mut ANativeWindow); -} -extern "C" { - pub fn ANativeWindow_release(window: *mut ANativeWindow); -} -extern "C" { - pub fn ANativeWindow_getWidth(window: *mut ANativeWindow) -> i32; -} -extern "C" { - pub fn ANativeWindow_getHeight(window: *mut ANativeWindow) -> i32; -} -extern "C" { - pub fn ANativeWindow_getFormat(window: *mut ANativeWindow) -> i32; -} -extern "C" { - pub fn ANativeWindow_setBuffersGeometry( - window: *mut ANativeWindow, - width: i32, - height: i32, - format: i32, - ) -> i32; -} -extern "C" { - pub fn ANativeWindow_lock( - window: *mut ANativeWindow, - outBuffer: *mut ANativeWindow_Buffer, - inOutDirtyBounds: *mut ARect, - ) -> i32; -} -extern "C" { - pub fn ANativeWindow_unlockAndPost(window: *mut ANativeWindow) -> i32; -} -extern "C" { - pub fn ANativeWindow_setBuffersTransform(window: *mut ANativeWindow, transform: i32) -> i32; -} -extern "C" { - pub fn ANativeWindow_setBuffersDataSpace(window: *mut ANativeWindow, dataSpace: i32) -> i32; -} -extern "C" { - pub fn ANativeWindow_getBuffersDataSpace(window: *mut ANativeWindow) -> i32; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ANativeActivity { - pub callbacks: *mut ANativeActivityCallbacks, - pub vm: *mut JavaVM, - pub env: *mut JNIEnv, - pub clazz: jobject, - pub internalDataPath: *const ::std::os::raw::c_char, - pub externalDataPath: *const ::std::os::raw::c_char, - pub sdkVersion: i32, - pub instance: *mut ::std::os::raw::c_void, - pub assetManager: *mut AAssetManager, - pub obbPath: *const ::std::os::raw::c_char, -} -#[test] -fn bindgen_test_layout_ANativeActivity() { - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(ANativeActivity)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(ANativeActivity)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).callbacks as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ANativeActivity), - "::", - stringify!(callbacks) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).vm as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(ANativeActivity), - "::", - stringify!(vm) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).env as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ANativeActivity), - "::", - stringify!(env) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).clazz as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(ANativeActivity), - "::", - stringify!(clazz) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).internalDataPath as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(ANativeActivity), - "::", - stringify!(internalDataPath) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).externalDataPath as *const _ as usize - }, - 20usize, - concat!( - "Offset of field: ", - stringify!(ANativeActivity), - "::", - stringify!(externalDataPath) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sdkVersion as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(ANativeActivity), - "::", - stringify!(sdkVersion) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).instance as *const _ as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(ANativeActivity), - "::", - stringify!(instance) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).assetManager as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(ANativeActivity), - "::", - stringify!(assetManager) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).obbPath as *const _ as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(ANativeActivity), - "::", - stringify!(obbPath) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ANativeActivityCallbacks { - pub onStart: ::std::option::Option, - pub onResume: ::std::option::Option, - pub onSaveInstanceState: ::std::option::Option< - unsafe extern "C" fn( - activity: *mut ANativeActivity, - outSize: *mut usize, - ) -> *mut ::std::os::raw::c_void, - >, - pub onPause: ::std::option::Option, - pub onStop: ::std::option::Option, - pub onDestroy: ::std::option::Option, - pub onWindowFocusChanged: ::std::option::Option< - unsafe extern "C" fn(activity: *mut ANativeActivity, hasFocus: ::std::os::raw::c_int), - >, - pub onNativeWindowCreated: ::std::option::Option< - unsafe extern "C" fn(activity: *mut ANativeActivity, window: *mut ANativeWindow), - >, - pub onNativeWindowResized: ::std::option::Option< - unsafe extern "C" fn(activity: *mut ANativeActivity, window: *mut ANativeWindow), - >, - pub onNativeWindowRedrawNeeded: ::std::option::Option< - unsafe extern "C" fn(activity: *mut ANativeActivity, window: *mut ANativeWindow), - >, - pub onNativeWindowDestroyed: ::std::option::Option< - unsafe extern "C" fn(activity: *mut ANativeActivity, window: *mut ANativeWindow), - >, - pub onInputQueueCreated: ::std::option::Option< - unsafe extern "C" fn(activity: *mut ANativeActivity, queue: *mut AInputQueue), - >, - pub onInputQueueDestroyed: ::std::option::Option< - unsafe extern "C" fn(activity: *mut ANativeActivity, queue: *mut AInputQueue), - >, - pub onContentRectChanged: ::std::option::Option< - unsafe extern "C" fn(activity: *mut ANativeActivity, rect: *const ARect), - >, - pub onConfigurationChanged: - ::std::option::Option, - pub onLowMemory: ::std::option::Option, -} -#[test] -fn bindgen_test_layout_ANativeActivityCallbacks() { - assert_eq!( - ::std::mem::size_of::(), - 64usize, - concat!("Size of: ", stringify!(ANativeActivityCallbacks)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(ANativeActivityCallbacks)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onStart as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ANativeActivityCallbacks), - "::", - stringify!(onStart) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onResume as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(ANativeActivityCallbacks), - "::", - stringify!(onResume) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onSaveInstanceState as *const _ - as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ANativeActivityCallbacks), - "::", - stringify!(onSaveInstanceState) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onPause as *const _ as usize - }, - 12usize, - concat!( - "Offset of field: ", - stringify!(ANativeActivityCallbacks), - "::", - stringify!(onPause) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).onStop as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(ANativeActivityCallbacks), - "::", - stringify!(onStop) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onDestroy as *const _ as usize - }, - 20usize, - concat!( - "Offset of field: ", - stringify!(ANativeActivityCallbacks), - "::", - stringify!(onDestroy) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onWindowFocusChanged as *const _ - as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(ANativeActivityCallbacks), - "::", - stringify!(onWindowFocusChanged) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onNativeWindowCreated as *const _ - as usize - }, - 28usize, - concat!( - "Offset of field: ", - stringify!(ANativeActivityCallbacks), - "::", - stringify!(onNativeWindowCreated) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onNativeWindowResized as *const _ - as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(ANativeActivityCallbacks), - "::", - stringify!(onNativeWindowResized) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onNativeWindowRedrawNeeded - as *const _ as usize - }, - 36usize, - concat!( - "Offset of field: ", - stringify!(ANativeActivityCallbacks), - "::", - stringify!(onNativeWindowRedrawNeeded) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onNativeWindowDestroyed as *const _ - as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(ANativeActivityCallbacks), - "::", - stringify!(onNativeWindowDestroyed) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onInputQueueCreated as *const _ - as usize - }, - 44usize, - concat!( - "Offset of field: ", - stringify!(ANativeActivityCallbacks), - "::", - stringify!(onInputQueueCreated) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onInputQueueDestroyed as *const _ - as usize - }, - 48usize, - concat!( - "Offset of field: ", - stringify!(ANativeActivityCallbacks), - "::", - stringify!(onInputQueueDestroyed) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onContentRectChanged as *const _ - as usize - }, - 52usize, - concat!( - "Offset of field: ", - stringify!(ANativeActivityCallbacks), - "::", - stringify!(onContentRectChanged) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onConfigurationChanged as *const _ - as usize - }, - 56usize, - concat!( - "Offset of field: ", - stringify!(ANativeActivityCallbacks), - "::", - stringify!(onConfigurationChanged) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).onLowMemory as *const _ as usize - }, - 60usize, - concat!( - "Offset of field: ", - stringify!(ANativeActivityCallbacks), - "::", - stringify!(onLowMemory) - ) - ); -} -pub type ANativeActivity_createFunc = ::std::option::Option< - unsafe extern "C" fn( - activity: *mut ANativeActivity, - savedState: *mut ::std::os::raw::c_void, - savedStateSize: usize, - ), ->; -extern "C" { - pub fn ANativeActivity_onCreate( - activity: *mut ANativeActivity, - savedState: *mut ::std::os::raw::c_void, - savedStateSize: usize, - ); -} -extern "C" { - pub fn ANativeActivity_finish(activity: *mut ANativeActivity); -} -extern "C" { - pub fn ANativeActivity_setWindowFormat(activity: *mut ANativeActivity, format: i32); -} -extern "C" { - pub fn ANativeActivity_setWindowFlags( - activity: *mut ANativeActivity, - addFlags: u32, - removeFlags: u32, - ); -} -pub const ANATIVEACTIVITY_SHOW_SOFT_INPUT_IMPLICIT: _bindgen_ty_27 = 1; -pub const ANATIVEACTIVITY_SHOW_SOFT_INPUT_FORCED: _bindgen_ty_27 = 2; -pub type _bindgen_ty_27 = u32; -extern "C" { - pub fn ANativeActivity_showSoftInput(activity: *mut ANativeActivity, flags: u32); -} -pub const ANATIVEACTIVITY_HIDE_SOFT_INPUT_IMPLICIT_ONLY: _bindgen_ty_28 = 1; -pub const ANATIVEACTIVITY_HIDE_SOFT_INPUT_NOT_ALWAYS: _bindgen_ty_28 = 2; -pub type _bindgen_ty_28 = u32; -extern "C" { - pub fn ANativeActivity_hideSoftInput(activity: *mut ANativeActivity, flags: u32); -} -extern "C" { - pub fn ANativeWindow_fromSurface(env: *mut JNIEnv, surface: jobject) -> *mut ANativeWindow; -} -extern "C" { - pub fn ANativeWindow_toSurface(env: *mut JNIEnv, window: *mut ANativeWindow) -> jobject; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct AObbInfo { - _unused: [u8; 0], -} -pub const AOBBINFO_OVERLAY: _bindgen_ty_29 = 1; -pub type _bindgen_ty_29 = u32; -extern "C" { - pub fn AObbScanner_getObbInfo(filename: *const ::std::os::raw::c_char) -> *mut AObbInfo; -} -extern "C" { - pub fn AObbInfo_delete(obbInfo: *mut AObbInfo); -} -extern "C" { - pub fn AObbInfo_getPackageName(obbInfo: *mut AObbInfo) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn AObbInfo_getVersion(obbInfo: *mut AObbInfo) -> i32; -} -extern "C" { - pub fn AObbInfo_getFlags(obbInfo: *mut AObbInfo) -> i32; -} -pub type __double_t = f64; -pub type double_t = __double_t; -pub type __float_t = f32; -pub type float_t = __float_t; -extern "C" { - pub fn acos(__x: f64) -> f64; -} -extern "C" { - pub fn acosf(__x: f32) -> f32; -} -extern "C" { - pub fn asin(__x: f64) -> f64; -} -extern "C" { - pub fn asinf(__x: f32) -> f32; -} -extern "C" { - pub fn atan(__x: f64) -> f64; -} -extern "C" { - pub fn atanf(__x: f32) -> f32; -} -extern "C" { - pub fn atan2(__y: f64, __x: f64) -> f64; -} -extern "C" { - pub fn atan2f(__y: f32, __x: f32) -> f32; -} -extern "C" { - pub fn cos(__x: f64) -> f64; -} -extern "C" { - pub fn cosf(__x: f32) -> f32; -} -extern "C" { - pub fn sin(__x: f64) -> f64; -} -extern "C" { - pub fn sinf(__x: f32) -> f32; -} -extern "C" { - pub fn tan(__x: f64) -> f64; -} -extern "C" { - pub fn tanf(__x: f32) -> f32; -} -extern "C" { - pub fn acosh(__x: f64) -> f64; -} -extern "C" { - pub fn acoshf(__x: f32) -> f32; -} -extern "C" { - pub fn asinh(__x: f64) -> f64; -} -extern "C" { - pub fn asinhf(__x: f32) -> f32; -} -extern "C" { - pub fn atanh(__x: f64) -> f64; -} -extern "C" { - pub fn atanhf(__x: f32) -> f32; -} -extern "C" { - pub fn cosh(__x: f64) -> f64; -} -extern "C" { - pub fn coshf(__x: f32) -> f32; -} -extern "C" { - pub fn sinh(__x: f64) -> f64; -} -extern "C" { - pub fn sinhf(__x: f32) -> f32; -} -extern "C" { - pub fn tanh(__x: f64) -> f64; -} -extern "C" { - pub fn tanhf(__x: f32) -> f32; -} -extern "C" { - pub fn exp(__x: f64) -> f64; -} -extern "C" { - pub fn expf(__x: f32) -> f32; -} -extern "C" { - pub fn exp2(__x: f64) -> f64; -} -extern "C" { - pub fn exp2f(__x: f32) -> f32; -} -extern "C" { - pub fn expm1(__x: f64) -> f64; -} -extern "C" { - pub fn expm1f(__x: f32) -> f32; -} -extern "C" { - pub fn frexp(__x: f64, __exponent: *mut ::std::os::raw::c_int) -> f64; -} -extern "C" { - pub fn frexpf(__x: f32, __exponent: *mut ::std::os::raw::c_int) -> f32; -} -extern "C" { - pub fn ilogb(__x: f64) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ilogbf(__x: f32) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ldexp(__x: f64, __exponent: ::std::os::raw::c_int) -> f64; -} -extern "C" { - pub fn ldexpf(__x: f32, __exponent: ::std::os::raw::c_int) -> f32; -} -extern "C" { - pub fn log(__x: f64) -> f64; -} -extern "C" { - pub fn logf(__x: f32) -> f32; -} -extern "C" { - pub fn log10(__x: f64) -> f64; -} -extern "C" { - pub fn log10f(__x: f32) -> f32; -} -extern "C" { - pub fn log1p(__x: f64) -> f64; -} -extern "C" { - pub fn log1pf(__x: f32) -> f32; -} -extern "C" { - pub fn log2(__x: f64) -> f64; -} -extern "C" { - pub fn log2f(__x: f32) -> f32; -} -extern "C" { - pub fn logb(__x: f64) -> f64; -} -extern "C" { - pub fn logbf(__x: f32) -> f32; -} -extern "C" { - pub fn modf(__x: f64, __integral_part: *mut f64) -> f64; -} -extern "C" { - pub fn modff(__x: f32, __integral_part: *mut f32) -> f32; -} -extern "C" { - pub fn scalbn(__x: f64, __exponent: ::std::os::raw::c_int) -> f64; -} -extern "C" { - pub fn scalbnf(__x: f32, __exponent: ::std::os::raw::c_int) -> f32; -} -extern "C" { - pub fn scalbln(__x: f64, __exponent: ::std::os::raw::c_long) -> f64; -} -extern "C" { - pub fn scalblnf(__x: f32, __exponent: ::std::os::raw::c_long) -> f32; -} -extern "C" { - pub fn scalblnl(__x: f64, __exponent: ::std::os::raw::c_long) -> f64; -} -extern "C" { - pub fn cbrt(__x: f64) -> f64; -} -extern "C" { - pub fn cbrtf(__x: f32) -> f32; -} -extern "C" { - pub fn fabs(__x: f64) -> f64; -} -extern "C" { - pub fn fabsf(__x: f32) -> f32; -} -extern "C" { - pub fn hypot(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn hypotf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn pow(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn powf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn sqrt(__x: f64) -> f64; -} -extern "C" { - pub fn sqrtf(__x: f32) -> f32; -} -extern "C" { - pub fn erf(__x: f64) -> f64; -} -extern "C" { - pub fn erff(__x: f32) -> f32; -} -extern "C" { - pub fn erfc(__x: f64) -> f64; -} -extern "C" { - pub fn erfcf(__x: f32) -> f32; -} -extern "C" { - pub fn lgamma(__x: f64) -> f64; -} -extern "C" { - pub fn lgammaf(__x: f32) -> f32; -} -extern "C" { - pub fn tgamma(__x: f64) -> f64; -} -extern "C" { - pub fn tgammaf(__x: f32) -> f32; -} -extern "C" { - pub fn ceil(__x: f64) -> f64; -} -extern "C" { - pub fn ceilf(__x: f32) -> f32; -} -extern "C" { - pub fn floor(__x: f64) -> f64; -} -extern "C" { - pub fn floorf(__x: f32) -> f32; -} -extern "C" { - pub fn nearbyint(__x: f64) -> f64; -} -extern "C" { - pub fn nearbyintf(__x: f32) -> f32; -} -extern "C" { - pub fn rint(__x: f64) -> f64; -} -extern "C" { - pub fn rintf(__x: f32) -> f32; -} -extern "C" { - pub fn lrint(__x: f64) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn lrintf(__x: f32) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn llrint(__x: f64) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn llrintf(__x: f32) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn round(__x: f64) -> f64; -} -extern "C" { - pub fn roundf(__x: f32) -> f32; -} -extern "C" { - pub fn roundl(__x: f64) -> f64; -} -extern "C" { - pub fn lround(__x: f64) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn lroundf(__x: f32) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn llround(__x: f64) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn llroundf(__x: f32) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn trunc(__x: f64) -> f64; -} -extern "C" { - pub fn truncf(__x: f32) -> f32; -} -extern "C" { - pub fn fmod(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn fmodf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn remainder(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn remainderf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn remquo(__x: f64, __y: f64, __quotient_bits: *mut ::std::os::raw::c_int) -> f64; -} -extern "C" { - pub fn remquof(__x: f32, __y: f32, __quotient_bits: *mut ::std::os::raw::c_int) -> f32; -} -extern "C" { - pub fn copysign(__value: f64, __sign: f64) -> f64; -} -extern "C" { - pub fn copysignf(__value: f32, __sign: f32) -> f32; -} -extern "C" { - pub fn nan(__kind: *const ::std::os::raw::c_char) -> f64; -} -extern "C" { - pub fn nanf(__kind: *const ::std::os::raw::c_char) -> f32; -} -extern "C" { - pub fn nextafter(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn nextafterf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn nexttoward(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn nexttowardf(__x: f32, __y: f64) -> f32; -} -extern "C" { - pub fn fdim(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn fdimf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn fmax(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn fmaxf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn fmin(__x: f64, __y: f64) -> f64; -} -extern "C" { - pub fn fminf(__x: f32, __y: f32) -> f32; -} -extern "C" { - pub fn fma(__x: f64, __y: f64, __z: f64) -> f64; -} -extern "C" { - pub fn fmaf(__x: f32, __y: f32, __z: f32) -> f32; -} -extern "C" { - pub fn isinf(__x: f64) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn isnan(__x: f64) -> ::std::os::raw::c_int; -} -extern "C" { - pub static mut signgam: ::std::os::raw::c_int; -} -extern "C" { - pub fn j0(__x: f64) -> f64; -} -extern "C" { - pub fn j1(__x: f64) -> f64; -} -extern "C" { - pub fn jn(__n: ::std::os::raw::c_int, __x: f64) -> f64; -} -extern "C" { - pub fn y0(__x: f64) -> f64; -} -extern "C" { - pub fn y1(__x: f64) -> f64; -} -extern "C" { - pub fn yn(__n: ::std::os::raw::c_int, __x: f64) -> f64; -} -pub const ASENSOR_TYPE_INVALID: _bindgen_ty_30 = -1; -pub const ASENSOR_TYPE_ACCELEROMETER: _bindgen_ty_30 = 1; -pub const ASENSOR_TYPE_MAGNETIC_FIELD: _bindgen_ty_30 = 2; -pub const ASENSOR_TYPE_GYROSCOPE: _bindgen_ty_30 = 4; -pub const ASENSOR_TYPE_LIGHT: _bindgen_ty_30 = 5; -pub const ASENSOR_TYPE_PRESSURE: _bindgen_ty_30 = 6; -pub const ASENSOR_TYPE_PROXIMITY: _bindgen_ty_30 = 8; -pub const ASENSOR_TYPE_GRAVITY: _bindgen_ty_30 = 9; -pub const ASENSOR_TYPE_LINEAR_ACCELERATION: _bindgen_ty_30 = 10; -pub const ASENSOR_TYPE_ROTATION_VECTOR: _bindgen_ty_30 = 11; -pub const ASENSOR_TYPE_RELATIVE_HUMIDITY: _bindgen_ty_30 = 12; -pub const ASENSOR_TYPE_AMBIENT_TEMPERATURE: _bindgen_ty_30 = 13; -pub const ASENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED: _bindgen_ty_30 = 14; -pub const ASENSOR_TYPE_GAME_ROTATION_VECTOR: _bindgen_ty_30 = 15; -pub const ASENSOR_TYPE_GYROSCOPE_UNCALIBRATED: _bindgen_ty_30 = 16; -pub const ASENSOR_TYPE_SIGNIFICANT_MOTION: _bindgen_ty_30 = 17; -pub const ASENSOR_TYPE_STEP_DETECTOR: _bindgen_ty_30 = 18; -pub const ASENSOR_TYPE_STEP_COUNTER: _bindgen_ty_30 = 19; -pub const ASENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR: _bindgen_ty_30 = 20; -pub const ASENSOR_TYPE_HEART_RATE: _bindgen_ty_30 = 21; -pub const ASENSOR_TYPE_POSE_6DOF: _bindgen_ty_30 = 28; -pub const ASENSOR_TYPE_STATIONARY_DETECT: _bindgen_ty_30 = 29; -pub const ASENSOR_TYPE_MOTION_DETECT: _bindgen_ty_30 = 30; -pub const ASENSOR_TYPE_HEART_BEAT: _bindgen_ty_30 = 31; -pub const ASENSOR_TYPE_ADDITIONAL_INFO: _bindgen_ty_30 = 33; -pub const ASENSOR_TYPE_LOW_LATENCY_OFFBODY_DETECT: _bindgen_ty_30 = 34; -pub const ASENSOR_TYPE_ACCELEROMETER_UNCALIBRATED: _bindgen_ty_30 = 35; -pub type _bindgen_ty_30 = i32; -pub const ASENSOR_STATUS_NO_CONTACT: _bindgen_ty_31 = -1; -pub const ASENSOR_STATUS_UNRELIABLE: _bindgen_ty_31 = 0; -pub const ASENSOR_STATUS_ACCURACY_LOW: _bindgen_ty_31 = 1; -pub const ASENSOR_STATUS_ACCURACY_MEDIUM: _bindgen_ty_31 = 2; -pub const ASENSOR_STATUS_ACCURACY_HIGH: _bindgen_ty_31 = 3; -pub type _bindgen_ty_31 = i32; -pub const AREPORTING_MODE_INVALID: _bindgen_ty_32 = -1; -pub const AREPORTING_MODE_CONTINUOUS: _bindgen_ty_32 = 0; -pub const AREPORTING_MODE_ON_CHANGE: _bindgen_ty_32 = 1; -pub const AREPORTING_MODE_ONE_SHOT: _bindgen_ty_32 = 2; -pub const AREPORTING_MODE_SPECIAL_TRIGGER: _bindgen_ty_32 = 3; -pub type _bindgen_ty_32 = i32; -pub const ASENSOR_DIRECT_RATE_STOP: _bindgen_ty_33 = 0; -pub const ASENSOR_DIRECT_RATE_NORMAL: _bindgen_ty_33 = 1; -pub const ASENSOR_DIRECT_RATE_FAST: _bindgen_ty_33 = 2; -pub const ASENSOR_DIRECT_RATE_VERY_FAST: _bindgen_ty_33 = 3; -pub type _bindgen_ty_33 = u32; -pub const ASENSOR_DIRECT_CHANNEL_TYPE_SHARED_MEMORY: _bindgen_ty_34 = 1; -pub const ASENSOR_DIRECT_CHANNEL_TYPE_HARDWARE_BUFFER: _bindgen_ty_34 = 2; -pub type _bindgen_ty_34 = u32; -pub const ASENSOR_ADDITIONAL_INFO_BEGIN: _bindgen_ty_35 = 0; -pub const ASENSOR_ADDITIONAL_INFO_END: _bindgen_ty_35 = 1; -pub const ASENSOR_ADDITIONAL_INFO_UNTRACKED_DELAY: _bindgen_ty_35 = 65536; -pub const ASENSOR_ADDITIONAL_INFO_INTERNAL_TEMPERATURE: _bindgen_ty_35 = 65537; -pub const ASENSOR_ADDITIONAL_INFO_VEC3_CALIBRATION: _bindgen_ty_35 = 65538; -pub const ASENSOR_ADDITIONAL_INFO_SENSOR_PLACEMENT: _bindgen_ty_35 = 65539; -pub const ASENSOR_ADDITIONAL_INFO_SAMPLING: _bindgen_ty_35 = 65540; -pub type _bindgen_ty_35 = u32; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct ASensorVector { - pub __bindgen_anon_1: ASensorVector__bindgen_ty_1, - pub status: i8, - pub reserved: [u8; 3usize], -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union ASensorVector__bindgen_ty_1 { - pub v: [f32; 3usize], - pub __bindgen_anon_1: ASensorVector__bindgen_ty_1__bindgen_ty_1, - pub __bindgen_anon_2: ASensorVector__bindgen_ty_1__bindgen_ty_2, - _bindgen_union_align: [u32; 3usize], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ASensorVector__bindgen_ty_1__bindgen_ty_1 { - pub x: f32, - pub y: f32, - pub z: f32, -} -#[test] -fn bindgen_test_layout_ASensorVector__bindgen_ty_1__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!( - "Size of: ", - stringify!(ASensorVector__bindgen_ty_1__bindgen_ty_1) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(ASensorVector__bindgen_ty_1__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).x as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ASensorVector__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(x) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).y as *const _ - as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(ASensorVector__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(y) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).z as *const _ - as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ASensorVector__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(z) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ASensorVector__bindgen_ty_1__bindgen_ty_2 { - pub azimuth: f32, - pub pitch: f32, - pub roll: f32, -} -#[test] -fn bindgen_test_layout_ASensorVector__bindgen_ty_1__bindgen_ty_2() { - assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!( - "Size of: ", - stringify!(ASensorVector__bindgen_ty_1__bindgen_ty_2) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(ASensorVector__bindgen_ty_1__bindgen_ty_2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).azimuth - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ASensorVector__bindgen_ty_1__bindgen_ty_2), - "::", - stringify!(azimuth) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pitch as *const _ - as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(ASensorVector__bindgen_ty_1__bindgen_ty_2), - "::", - stringify!(pitch) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).roll as *const _ - as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ASensorVector__bindgen_ty_1__bindgen_ty_2), - "::", - stringify!(roll) - ) - ); -} -#[test] -fn bindgen_test_layout_ASensorVector__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(ASensorVector__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(ASensorVector__bindgen_ty_1)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).v as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ASensorVector__bindgen_ty_1), - "::", - stringify!(v) - ) - ); -} -#[test] -fn bindgen_test_layout_ASensorVector() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(ASensorVector)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(ASensorVector)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).status as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(ASensorVector), - "::", - stringify!(status) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved as *const _ as usize }, - 13usize, - concat!( - "Offset of field: ", - stringify!(ASensorVector), - "::", - stringify!(reserved) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct AMetaDataEvent { - pub what: i32, - pub sensor: i32, -} -#[test] -fn bindgen_test_layout_AMetaDataEvent() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(AMetaDataEvent)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(AMetaDataEvent)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).what as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(AMetaDataEvent), - "::", - stringify!(what) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sensor as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(AMetaDataEvent), - "::", - stringify!(sensor) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct AUncalibratedEvent { - pub __bindgen_anon_1: AUncalibratedEvent__bindgen_ty_1, - pub __bindgen_anon_2: AUncalibratedEvent__bindgen_ty_2, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union AUncalibratedEvent__bindgen_ty_1 { - pub uncalib: [f32; 3usize], - pub __bindgen_anon_1: AUncalibratedEvent__bindgen_ty_1__bindgen_ty_1, - _bindgen_union_align: [u32; 3usize], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct AUncalibratedEvent__bindgen_ty_1__bindgen_ty_1 { - pub x_uncalib: f32, - pub y_uncalib: f32, - pub z_uncalib: f32, -} -#[test] -fn bindgen_test_layout_AUncalibratedEvent__bindgen_ty_1__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!( - "Size of: ", - stringify!(AUncalibratedEvent__bindgen_ty_1__bindgen_ty_1) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(AUncalibratedEvent__bindgen_ty_1__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).x_uncalib - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(AUncalibratedEvent__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(x_uncalib) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).y_uncalib - as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(AUncalibratedEvent__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(y_uncalib) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).z_uncalib - as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(AUncalibratedEvent__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(z_uncalib) - ) - ); -} -#[test] -fn bindgen_test_layout_AUncalibratedEvent__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(AUncalibratedEvent__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(AUncalibratedEvent__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).uncalib as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(AUncalibratedEvent__bindgen_ty_1), - "::", - stringify!(uncalib) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union AUncalibratedEvent__bindgen_ty_2 { - pub bias: [f32; 3usize], - pub __bindgen_anon_1: AUncalibratedEvent__bindgen_ty_2__bindgen_ty_1, - _bindgen_union_align: [u32; 3usize], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct AUncalibratedEvent__bindgen_ty_2__bindgen_ty_1 { - pub x_bias: f32, - pub y_bias: f32, - pub z_bias: f32, -} -#[test] -fn bindgen_test_layout_AUncalibratedEvent__bindgen_ty_2__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!( - "Size of: ", - stringify!(AUncalibratedEvent__bindgen_ty_2__bindgen_ty_1) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(AUncalibratedEvent__bindgen_ty_2__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).x_bias - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(AUncalibratedEvent__bindgen_ty_2__bindgen_ty_1), - "::", - stringify!(x_bias) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).y_bias - as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(AUncalibratedEvent__bindgen_ty_2__bindgen_ty_1), - "::", - stringify!(y_bias) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).z_bias - as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(AUncalibratedEvent__bindgen_ty_2__bindgen_ty_1), - "::", - stringify!(z_bias) - ) - ); -} -#[test] -fn bindgen_test_layout_AUncalibratedEvent__bindgen_ty_2() { - assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(AUncalibratedEvent__bindgen_ty_2)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(AUncalibratedEvent__bindgen_ty_2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).bias as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(AUncalibratedEvent__bindgen_ty_2), - "::", - stringify!(bias) - ) - ); -} -#[test] -fn bindgen_test_layout_AUncalibratedEvent() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(AUncalibratedEvent)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(AUncalibratedEvent)) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct AHeartRateEvent { - pub bpm: f32, - pub status: i8, -} -#[test] -fn bindgen_test_layout_AHeartRateEvent() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(AHeartRateEvent)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(AHeartRateEvent)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).bpm as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(AHeartRateEvent), - "::", - stringify!(bpm) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).status as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(AHeartRateEvent), - "::", - stringify!(status) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ADynamicSensorEvent { - pub connected: i32, - pub handle: i32, -} -#[test] -fn bindgen_test_layout_ADynamicSensorEvent() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(ADynamicSensorEvent)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(ADynamicSensorEvent)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).connected as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ADynamicSensorEvent), - "::", - stringify!(connected) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).handle as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(ADynamicSensorEvent), - "::", - stringify!(handle) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct AAdditionalInfoEvent { - pub type_: i32, - pub serial: i32, - pub __bindgen_anon_1: AAdditionalInfoEvent__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union AAdditionalInfoEvent__bindgen_ty_1 { - pub data_int32: [i32; 14usize], - pub data_float: [f32; 14usize], - _bindgen_union_align: [u32; 14usize], -} -#[test] -fn bindgen_test_layout_AAdditionalInfoEvent__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 56usize, - concat!("Size of: ", stringify!(AAdditionalInfoEvent__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(AAdditionalInfoEvent__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).data_int32 as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(AAdditionalInfoEvent__bindgen_ty_1), - "::", - stringify!(data_int32) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).data_float as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(AAdditionalInfoEvent__bindgen_ty_1), - "::", - stringify!(data_float) - ) - ); -} -#[test] -fn bindgen_test_layout_AAdditionalInfoEvent() { - assert_eq!( - ::std::mem::size_of::(), - 64usize, - concat!("Size of: ", stringify!(AAdditionalInfoEvent)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(AAdditionalInfoEvent)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(AAdditionalInfoEvent), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).serial as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(AAdditionalInfoEvent), - "::", - stringify!(serial) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct ASensorEvent { - pub version: i32, - pub sensor: i32, - pub type_: i32, - pub reserved0: i32, - pub timestamp: i64, - pub __bindgen_anon_1: ASensorEvent__bindgen_ty_1, - pub flags: u32, - pub reserved1: [i32; 3usize], -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union ASensorEvent__bindgen_ty_1 { - pub __bindgen_anon_1: ASensorEvent__bindgen_ty_1__bindgen_ty_1, - pub u64: ASensorEvent__bindgen_ty_1__bindgen_ty_2, - _bindgen_union_align: [u64; 8usize], -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union ASensorEvent__bindgen_ty_1__bindgen_ty_1 { - pub data: [f32; 16usize], - pub vector: ASensorVector, - pub acceleration: ASensorVector, - pub magnetic: ASensorVector, - pub temperature: f32, - pub distance: f32, - pub light: f32, - pub pressure: f32, - pub relative_humidity: f32, - pub uncalibrated_gyro: AUncalibratedEvent, - pub uncalibrated_magnetic: AUncalibratedEvent, - pub meta_data: AMetaDataEvent, - pub heart_rate: AHeartRateEvent, - pub dynamic_sensor_meta: ADynamicSensorEvent, - pub additional_info: AAdditionalInfoEvent, - _bindgen_union_align: [u32; 16usize], -} -#[test] -fn bindgen_test_layout_ASensorEvent__bindgen_ty_1__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 64usize, - concat!( - "Size of: ", - stringify!(ASensorEvent__bindgen_ty_1__bindgen_ty_1) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(ASensorEvent__bindgen_ty_1__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).data as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ASensorEvent__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(data) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).vector as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ASensorEvent__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(vector) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).acceleration - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ASensorEvent__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(acceleration) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).magnetic - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ASensorEvent__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(magnetic) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).temperature - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ASensorEvent__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(temperature) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).distance - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ASensorEvent__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(distance) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).light as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ASensorEvent__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(light) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).pressure - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ASensorEvent__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(pressure) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).relative_humidity - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ASensorEvent__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(relative_humidity) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).uncalibrated_gyro - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ASensorEvent__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(uncalibrated_gyro) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .uncalibrated_magnetic as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ASensorEvent__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(uncalibrated_magnetic) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).meta_data - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ASensorEvent__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(meta_data) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).heart_rate - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ASensorEvent__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(heart_rate) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).dynamic_sensor_meta - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ASensorEvent__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(dynamic_sensor_meta) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).additional_info - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ASensorEvent__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(additional_info) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union ASensorEvent__bindgen_ty_1__bindgen_ty_2 { - pub data: [u64; 8usize], - pub step_counter: u64, - _bindgen_union_align: [u64; 8usize], -} -#[test] -fn bindgen_test_layout_ASensorEvent__bindgen_ty_1__bindgen_ty_2() { - assert_eq!( - ::std::mem::size_of::(), - 64usize, - concat!( - "Size of: ", - stringify!(ASensorEvent__bindgen_ty_1__bindgen_ty_2) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(ASensorEvent__bindgen_ty_1__bindgen_ty_2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).data as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ASensorEvent__bindgen_ty_1__bindgen_ty_2), - "::", - stringify!(data) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).step_counter - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ASensorEvent__bindgen_ty_1__bindgen_ty_2), - "::", - stringify!(step_counter) - ) - ); -} -#[test] -fn bindgen_test_layout_ASensorEvent__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 64usize, - concat!("Size of: ", stringify!(ASensorEvent__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(ASensorEvent__bindgen_ty_1)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).u64 as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ASensorEvent__bindgen_ty_1), - "::", - stringify!(u64) - ) - ); -} -#[test] -fn bindgen_test_layout_ASensorEvent() { - assert_eq!( - ::std::mem::size_of::(), - 104usize, - concat!("Size of: ", stringify!(ASensorEvent)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(ASensorEvent)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).version as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ASensorEvent), - "::", - stringify!(version) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sensor as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(ASensorEvent), - "::", - stringify!(sensor) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ASensorEvent), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved0 as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(ASensorEvent), - "::", - stringify!(reserved0) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).timestamp as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(ASensorEvent), - "::", - stringify!(timestamp) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(ASensorEvent), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved1 as *const _ as usize }, - 92usize, - concat!( - "Offset of field: ", - stringify!(ASensorEvent), - "::", - stringify!(reserved1) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ASensorManager { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ASensorEventQueue { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ASensor { - _unused: [u8; 0], -} -pub type ASensorRef = *const ASensor; -pub type ASensorList = *const ASensorRef; -extern "C" { - pub fn ASensorManager_getInstance() -> *mut ASensorManager; -} -extern "C" { - pub fn ASensorManager_getInstanceForPackage( - packageName: *const ::std::os::raw::c_char, - ) -> *mut ASensorManager; -} -extern "C" { - pub fn ASensorManager_getSensorList( - manager: *mut ASensorManager, - list: *mut ASensorList, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ASensorManager_getDefaultSensor( - manager: *mut ASensorManager, - type_: ::std::os::raw::c_int, - ) -> *const ASensor; -} -extern "C" { - pub fn ASensorManager_getDefaultSensorEx( - manager: *mut ASensorManager, - type_: ::std::os::raw::c_int, - wakeUp: bool, - ) -> *const ASensor; -} -extern "C" { - pub fn ASensorManager_createEventQueue( - manager: *mut ASensorManager, - looper: *mut ALooper, - ident: ::std::os::raw::c_int, - callback: ALooper_callbackFunc, - data: *mut ::std::os::raw::c_void, - ) -> *mut ASensorEventQueue; -} -extern "C" { - pub fn ASensorManager_destroyEventQueue( - manager: *mut ASensorManager, - queue: *mut ASensorEventQueue, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ASensorManager_createSharedMemoryDirectChannel( - manager: *mut ASensorManager, - fd: ::std::os::raw::c_int, - size: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ASensorManager_createHardwareBufferDirectChannel( - manager: *mut ASensorManager, - buffer: *const AHardwareBuffer, - size: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ASensorManager_destroyDirectChannel( - manager: *mut ASensorManager, - channelId: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn ASensorManager_configureDirectReport( - manager: *mut ASensorManager, - sensor: *const ASensor, - channelId: ::std::os::raw::c_int, - rate: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ASensorEventQueue_registerSensor( - queue: *mut ASensorEventQueue, - sensor: *const ASensor, - samplingPeriodUs: i32, - maxBatchReportLatencyUs: i64, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ASensorEventQueue_enableSensor( - queue: *mut ASensorEventQueue, - sensor: *const ASensor, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ASensorEventQueue_disableSensor( - queue: *mut ASensorEventQueue, - sensor: *const ASensor, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ASensorEventQueue_setEventRate( - queue: *mut ASensorEventQueue, - sensor: *const ASensor, - usec: i32, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ASensorEventQueue_hasEvents(queue: *mut ASensorEventQueue) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ASensorEventQueue_getEvents( - queue: *mut ASensorEventQueue, - events: *mut ASensorEvent, - count: usize, - ) -> isize; -} -extern "C" { - pub fn ASensorEventQueue_requestAdditionalInfoEvents( - queue: *mut ASensorEventQueue, - enable: bool, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ASensor_getName(sensor: *const ASensor) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn ASensor_getVendor(sensor: *const ASensor) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn ASensor_getType(sensor: *const ASensor) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ASensor_getResolution(sensor: *const ASensor) -> f32; -} -extern "C" { - pub fn ASensor_getMinDelay(sensor: *const ASensor) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ASensor_getFifoMaxEventCount(sensor: *const ASensor) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ASensor_getFifoReservedEventCount(sensor: *const ASensor) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ASensor_getStringType(sensor: *const ASensor) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn ASensor_getReportingMode(sensor: *const ASensor) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ASensor_isWakeUpSensor(sensor: *const ASensor) -> bool; -} -extern "C" { - pub fn ASensor_isDirectChannelTypeSupported( - sensor: *const ASensor, - channelType: ::std::os::raw::c_int, - ) -> bool; -} -extern "C" { - pub fn ASensor_getHighestDirectReportRateLevel(sensor: *const ASensor) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ASensor_getHandle(sensor: *const ASensor) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn android_set_abort_message(__msg: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn ASharedMemory_create( - name: *const ::std::os::raw::c_char, - size: usize, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ASharedMemory_getSize(fd: ::std::os::raw::c_int) -> usize; -} -extern "C" { - pub fn ASharedMemory_setProt( - fd: ::std::os::raw::c_int, - prot: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ASharedMemory_dupFromJava( - env: *mut JNIEnv, - sharedMemory: jobject, - ) -> ::std::os::raw::c_int; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct AStorageManager { - _unused: [u8; 0], -} -pub const AOBB_STATE_MOUNTED: _bindgen_ty_36 = 1; -pub const AOBB_STATE_UNMOUNTED: _bindgen_ty_36 = 2; -pub const AOBB_STATE_ERROR_INTERNAL: _bindgen_ty_36 = 20; -pub const AOBB_STATE_ERROR_COULD_NOT_MOUNT: _bindgen_ty_36 = 21; -pub const AOBB_STATE_ERROR_COULD_NOT_UNMOUNT: _bindgen_ty_36 = 22; -pub const AOBB_STATE_ERROR_NOT_MOUNTED: _bindgen_ty_36 = 23; -pub const AOBB_STATE_ERROR_ALREADY_MOUNTED: _bindgen_ty_36 = 24; -pub const AOBB_STATE_ERROR_PERMISSION_DENIED: _bindgen_ty_36 = 25; -pub type _bindgen_ty_36 = u32; -extern "C" { - pub fn AStorageManager_new() -> *mut AStorageManager; -} -extern "C" { - pub fn AStorageManager_delete(mgr: *mut AStorageManager); -} -pub type AStorageManager_obbCallbackFunc = ::std::option::Option< - unsafe extern "C" fn( - filename: *const ::std::os::raw::c_char, - state: i32, - data: *mut ::std::os::raw::c_void, - ), ->; -extern "C" { - pub fn AStorageManager_mountObb( - mgr: *mut AStorageManager, - filename: *const ::std::os::raw::c_char, - key: *const ::std::os::raw::c_char, - cb: AStorageManager_obbCallbackFunc, - data: *mut ::std::os::raw::c_void, - ); -} -extern "C" { - pub fn AStorageManager_unmountObb( - mgr: *mut AStorageManager, - filename: *const ::std::os::raw::c_char, - force: ::std::os::raw::c_int, - cb: AStorageManager_obbCallbackFunc, - data: *mut ::std::os::raw::c_void, - ); -} -extern "C" { - pub fn AStorageManager_isObbMounted( - mgr: *mut AStorageManager, - filename: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn AStorageManager_getMountedObbPath( - mgr: *mut AStorageManager, - filename: *const ::std::os::raw::c_char, - ) -> *const ::std::os::raw::c_char; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ASurfaceTexture { - _unused: [u8; 0], -} -extern "C" { - pub fn ASurfaceTexture_release(st: *mut ASurfaceTexture); -} -extern "C" { - pub fn ASurfaceTexture_acquireANativeWindow(st: *mut ASurfaceTexture) -> *mut ANativeWindow; -} -extern "C" { - pub fn ASurfaceTexture_attachToGLContext( - st: *mut ASurfaceTexture, - texName: u32, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ASurfaceTexture_detachFromGLContext(st: *mut ASurfaceTexture) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ASurfaceTexture_updateTexImage(st: *mut ASurfaceTexture) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ASurfaceTexture_getTransformMatrix(st: *mut ASurfaceTexture, mtx: *mut f32); -} -extern "C" { - pub fn ASurfaceTexture_getTimestamp(st: *mut ASurfaceTexture) -> i64; -} -extern "C" { - pub fn ASurfaceTexture_fromSurfaceTexture( - env: *mut JNIEnv, - surfacetexture: jobject, - ) -> *mut ASurfaceTexture; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct sync_merge_data { - pub name: [::std::os::raw::c_char; 32usize], - pub fd2: __s32, - pub fence: __s32, - pub flags: __u32, - pub pad: __u32, -} -#[test] -fn bindgen_test_layout_sync_merge_data() { - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(sync_merge_data)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(sync_merge_data)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).name as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(sync_merge_data), - "::", - stringify!(name) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).fd2 as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(sync_merge_data), - "::", - stringify!(fd2) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).fence as *const _ as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(sync_merge_data), - "::", - stringify!(fence) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(sync_merge_data), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).pad as *const _ as usize }, - 44usize, - concat!( - "Offset of field: ", - stringify!(sync_merge_data), - "::", - stringify!(pad) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct sync_fence_info { - pub obj_name: [::std::os::raw::c_char; 32usize], - pub driver_name: [::std::os::raw::c_char; 32usize], - pub status: __s32, - pub flags: __u32, - pub timestamp_ns: __u64, -} -#[test] -fn bindgen_test_layout_sync_fence_info() { - assert_eq!( - ::std::mem::size_of::(), - 80usize, - concat!("Size of: ", stringify!(sync_fence_info)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(sync_fence_info)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).obj_name as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(sync_fence_info), - "::", - stringify!(obj_name) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).driver_name as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(sync_fence_info), - "::", - stringify!(driver_name) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).status as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(sync_fence_info), - "::", - stringify!(status) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, - 68usize, - concat!( - "Offset of field: ", - stringify!(sync_fence_info), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).timestamp_ns as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(sync_fence_info), - "::", - stringify!(timestamp_ns) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct sync_file_info { - pub name: [::std::os::raw::c_char; 32usize], - pub status: __s32, - pub flags: __u32, - pub num_fences: __u32, - pub pad: __u32, - pub sync_fence_info: __u64, -} -#[test] -fn bindgen_test_layout_sync_file_info() { - assert_eq!( - ::std::mem::size_of::(), - 56usize, - concat!("Size of: ", stringify!(sync_file_info)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(sync_file_info)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).name as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(sync_file_info), - "::", - stringify!(name) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).status as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(sync_file_info), - "::", - stringify!(status) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(sync_file_info), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).num_fences as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(sync_file_info), - "::", - stringify!(num_fences) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).pad as *const _ as usize }, - 44usize, - concat!( - "Offset of field: ", - stringify!(sync_file_info), - "::", - stringify!(pad) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).sync_fence_info as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(sync_file_info), - "::", - stringify!(sync_fence_info) - ) - ); -} -extern "C" { - pub fn sync_merge(name: *const ::std::os::raw::c_char, fd1: i32, fd2: i32) -> i32; -} -extern "C" { - pub fn sync_file_info(fd: i32) -> *mut sync_file_info; -} -extern "C" { - pub fn sync_file_info_free(info: *mut sync_file_info); -} -extern "C" { - pub fn ATrace_isEnabled() -> bool; -} -extern "C" { - pub fn ATrace_beginSection(sectionName: *const ::std::os::raw::c_char); -} -extern "C" { - pub fn ATrace_endSection(); -} -extern "C" { - pub fn ATrace_beginAsyncSection(sectionName: *const ::std::os::raw::c_char, cookie: i32); -} -extern "C" { - pub fn ATrace_endAsyncSection(sectionName: *const ::std::os::raw::c_char, cookie: i32); -} -extern "C" { - pub fn ATrace_setCounter(counterName: *const ::std::os::raw::c_char, counterValue: i64); -} -pub const AWINDOW_FLAG_ALLOW_LOCK_WHILE_SCREEN_ON: _bindgen_ty_37 = 1; -pub const AWINDOW_FLAG_DIM_BEHIND: _bindgen_ty_37 = 2; -pub const AWINDOW_FLAG_BLUR_BEHIND: _bindgen_ty_37 = 4; -pub const AWINDOW_FLAG_NOT_FOCUSABLE: _bindgen_ty_37 = 8; -pub const AWINDOW_FLAG_NOT_TOUCHABLE: _bindgen_ty_37 = 16; -pub const AWINDOW_FLAG_NOT_TOUCH_MODAL: _bindgen_ty_37 = 32; -pub const AWINDOW_FLAG_TOUCHABLE_WHEN_WAKING: _bindgen_ty_37 = 64; -pub const AWINDOW_FLAG_KEEP_SCREEN_ON: _bindgen_ty_37 = 128; -pub const AWINDOW_FLAG_LAYOUT_IN_SCREEN: _bindgen_ty_37 = 256; -pub const AWINDOW_FLAG_LAYOUT_NO_LIMITS: _bindgen_ty_37 = 512; -pub const AWINDOW_FLAG_FULLSCREEN: _bindgen_ty_37 = 1024; -pub const AWINDOW_FLAG_FORCE_NOT_FULLSCREEN: _bindgen_ty_37 = 2048; -pub const AWINDOW_FLAG_DITHER: _bindgen_ty_37 = 4096; -pub const AWINDOW_FLAG_SECURE: _bindgen_ty_37 = 8192; -pub const AWINDOW_FLAG_SCALED: _bindgen_ty_37 = 16384; -pub const AWINDOW_FLAG_IGNORE_CHEEK_PRESSES: _bindgen_ty_37 = 32768; -pub const AWINDOW_FLAG_LAYOUT_INSET_DECOR: _bindgen_ty_37 = 65536; -pub const AWINDOW_FLAG_ALT_FOCUSABLE_IM: _bindgen_ty_37 = 131072; -pub const AWINDOW_FLAG_WATCH_OUTSIDE_TOUCH: _bindgen_ty_37 = 262144; -pub const AWINDOW_FLAG_SHOW_WHEN_LOCKED: _bindgen_ty_37 = 524288; -pub const AWINDOW_FLAG_SHOW_WALLPAPER: _bindgen_ty_37 = 1048576; -pub const AWINDOW_FLAG_TURN_SCREEN_ON: _bindgen_ty_37 = 2097152; -pub const AWINDOW_FLAG_DISMISS_KEYGUARD: _bindgen_ty_37 = 4194304; -pub type _bindgen_ty_37 = u32; -pub type __builtin_va_list = __va_list; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __va_list { - pub __ap: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout___va_list() { - assert_eq!( - ::std::mem::size_of::<__va_list>(), - 4usize, - concat!("Size of: ", stringify!(__va_list)) - ); - assert_eq!( - ::std::mem::align_of::<__va_list>(), - 4usize, - concat!("Alignment of ", stringify!(__va_list)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__va_list>())).__ap as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__va_list), - "::", - stringify!(__ap) - ) - ); -} diff --git a/android-ndk-sys/src/lib.rs b/android-ndk-sys/src/lib.rs index 1bb7e843..75992625 100644 --- a/android-ndk-sys/src/lib.rs +++ b/android-ndk-sys/src/lib.rs @@ -20,14 +20,14 @@ pub mod native_app_glue; compile_error!("android-ndk-sys only supports compiling for Android"); #[cfg(any( - all(any(target_os = "android", test), target_arch = "arm"), + all( + any(target_os = "android", test), + any(target_arch = "arm", target_arch = "armv7") + ), feature = "rustdoc" ))] include!("ffi_arm.rs"); -#[cfg(all(any(target_os = "android", test), target_arch = "armv7"))] -include!("ffi_armv7.rs"); - #[cfg(all(any(target_os = "android", test), target_arch = "aarch64"))] include!("ffi_aarch64.rs"); From 0e179c855b079fd0ecc397211895f3f7773ccd4f Mon Sep 17 00:00:00 2001 From: David Craven Date: Mon, 10 Feb 2020 17:22:56 +0100 Subject: [PATCH 05/17] Android glue. --- Cargo.toml | 2 +- android-glue/Cargo.toml | 13 ++ android-glue/src/lib.rs | 278 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 292 insertions(+), 1 deletion(-) create mode 100644 android-glue/Cargo.toml create mode 100644 android-glue/src/lib.rs diff --git a/Cargo.toml b/Cargo.toml index aa152d79..53b09b55 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [workspace] - members = [ + "android-glue", "android-ndk-sys", "android-ndk", ] diff --git a/android-glue/Cargo.toml b/android-glue/Cargo.toml new file mode 100644 index 00000000..ea093023 --- /dev/null +++ b/android-glue/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "android-glue" +version = "0.1.0" +authors = ["David Craven "] +edition = "2018" + +[dependencies] +android_log-sys = "0.1.2" +android-ndk-sys = { path = "../android-ndk-sys" } +android-ndk = { path = "../android-ndk" } +lazy_static = "1.4.0" +libc = "0.2.66" +log = "0.4.8" diff --git a/android-glue/src/lib.rs b/android-glue/src/lib.rs new file mode 100644 index 00000000..0b88ca6c --- /dev/null +++ b/android-glue/src/lib.rs @@ -0,0 +1,278 @@ +use android_ndk::input_queue::InputQueue; +use android_ndk::looper::ThreadLooper; +use android_ndk::native_activity::NativeActivity; +use android_ndk::native_window::NativeWindow; +use android_ndk_sys::{AInputQueue, ANativeActivity, ANativeWindow, ARect, ALOOPER_EVENT_INPUT}; +use lazy_static::lazy_static; +use log::Level; +use std::ffi::{CStr, CString}; +use std::fs::File; +use std::io::{BufRead, BufReader}; +use std::os::raw; +use std::os::unix::prelude::*; +use std::ptr::NonNull; +use std::sync::{RwLock, RwLockReadGuard}; +use std::thread; + +pub fn android_log(level: Level, tag: &CStr, msg: &CStr) { + use android_log_sys::LogPriority; + let prio = match level { + Level::Error => LogPriority::ERROR, + Level::Warn => LogPriority::WARN, + Level::Info => LogPriority::INFO, + Level::Debug => LogPriority::DEBUG, + Level::Trace => LogPriority::VERBOSE, + }; + unsafe { + android_log_sys::__android_log_write( + prio as _, + tag.as_ptr() as *const _, + msg.as_ptr() as *const _, + ); + } +} + +lazy_static! { + static ref NATIVE_WINDOW: RwLock> = Default::default(); + static ref INPUT_QUEUE: RwLock> = Default::default(); + static ref CONTENT_RECT: RwLock = Default::default(); +} + +static mut NATIVE_ACTIVITY: Option = None; + +pub fn native_activity() -> &'static NativeActivity { + unsafe { NATIVE_ACTIVITY.as_ref().unwrap() } +} + +pub fn native_window() -> RwLockReadGuard<'static, Option> { + NATIVE_WINDOW.read().unwrap() +} + +pub fn input_queue() -> RwLockReadGuard<'static, Option> { + INPUT_QUEUE.read().unwrap() +} + +pub fn content_rect() -> Rect { + CONTENT_RECT.read().unwrap().clone() +} + +lazy_static! { + static ref PIPE: [RawFd; 2] = { + let mut pipe: [RawFd; 2] = Default::default(); + unsafe { libc::pipe(pipe.as_mut_ptr()) }; + pipe + }; +} + +pub fn poll_events() -> Option { + unsafe { + let size = std::mem::size_of::(); + let mut event = Event::Start; + if libc::read(PIPE[0], &mut event as *mut _ as *mut _, size) == size as _ { + Some(event) + } else { + None + } + } +} + +unsafe fn wake(_activity: *mut ANativeActivity, event: Event) { + log::trace!("{:?}", event); + let size = std::mem::size_of::(); + let res = libc::write(PIPE[1], &event as *const _ as *const _, size); + assert_eq!(res, size as _); +} + +#[derive(Clone, Debug, Default, Eq, PartialEq)] +pub struct Rect { + pub left: u32, + pub top: u32, + pub right: u32, + pub bottom: u32, +} + +#[derive(Clone, Debug, Eq, PartialEq)] +#[repr(u8)] +pub enum Event { + Start, + Resume, + SaveInstanceState, + Pause, + Stop, + Destroy, + ConfigChanged, + LowMemory, + WindowLostFocus, + WindowHasFocus, + WindowCreated, + WindowResized, + WindowRedrawNeeded, + WindowDestroyed, + InputQueueCreated, + InputQueueDestroyed, + ContentRectChanged, +} + +pub unsafe fn init( + activity: *mut ANativeActivity, + _saved_state: *mut u8, + _saved_state_size: usize, + main: fn(), +) { + let mut activity = NonNull::new(activity).unwrap(); + let mut callbacks = activity.as_mut().callbacks.as_mut().unwrap(); + callbacks.onStart = Some(on_start); + callbacks.onResume = Some(on_resume); + callbacks.onSaveInstanceState = Some(on_save_instance_state); + callbacks.onPause = Some(on_pause); + callbacks.onStop = Some(on_stop); + callbacks.onDestroy = Some(on_destroy); + callbacks.onWindowFocusChanged = Some(on_window_focus_changed); + callbacks.onNativeWindowCreated = Some(on_window_created); + callbacks.onNativeWindowResized = Some(on_window_resized); + callbacks.onNativeWindowRedrawNeeded = Some(on_window_redraw_needed); + callbacks.onNativeWindowDestroyed = Some(on_window_destroyed); + callbacks.onInputQueueCreated = Some(on_input_queue_created); + callbacks.onInputQueueDestroyed = Some(on_input_queue_destroyed); + callbacks.onContentRectChanged = Some(on_content_rect_changed); + callbacks.onConfigurationChanged = Some(on_configuration_changed); + callbacks.onLowMemory = Some(on_low_memory); + + let activity = NativeActivity::from_ptr(activity); + NATIVE_ACTIVITY = Some(activity); + + let mut logpipe: [RawFd; 2] = Default::default(); + libc::pipe(logpipe.as_mut_ptr()); + libc::dup2(logpipe[1], libc::STDOUT_FILENO); + libc::dup2(logpipe[1], libc::STDERR_FILENO); + thread::spawn(move || { + let tag = CStr::from_bytes_with_nul(b"RustStdoutStderr\0").unwrap(); + let file = File::from_raw_fd(logpipe[0]); + let mut reader = BufReader::new(file); + let mut buffer = String::new(); + loop { + buffer.clear(); + if let Ok(len) = reader.read_line(&mut buffer) { + if len == 0 { + break; + } else { + if let Ok(msg) = CString::new(buffer.clone()) { + android_log(Level::Info, tag, &msg); + } + } + } + } + }); + + thread::spawn(move || { + let looper = ThreadLooper::prepare(); + looper + .as_foreign() + .add_fd(PIPE[0], 0, ALOOPER_EVENT_INPUT as _, 0 as _) + .unwrap(); + main() + }); +} + +unsafe extern "C" fn on_start(activity: *mut ANativeActivity) { + wake(activity, Event::Start); +} + +unsafe extern "C" fn on_resume(activity: *mut ANativeActivity) { + wake(activity, Event::Resume); +} + +unsafe extern "C" fn on_save_instance_state( + activity: *mut ANativeActivity, + _out_size: *mut usize, +) -> *mut raw::c_void { + // TODO + wake(activity, Event::SaveInstanceState); + std::ptr::null_mut() +} + +unsafe extern "C" fn on_pause(activity: *mut ANativeActivity) { + wake(activity, Event::Pause); +} + +unsafe extern "C" fn on_stop(activity: *mut ANativeActivity) { + wake(activity, Event::Stop); +} + +unsafe extern "C" fn on_destroy(activity: *mut ANativeActivity) { + wake(activity, Event::Destroy); +} + +unsafe extern "C" fn on_configuration_changed(activity: *mut ANativeActivity) { + wake(activity, Event::ConfigChanged); +} + +unsafe extern "C" fn on_low_memory(activity: *mut ANativeActivity) { + wake(activity, Event::LowMemory); +} + +unsafe extern "C" fn on_window_focus_changed( + activity: *mut ANativeActivity, + has_focus: raw::c_int, +) { + let event = if has_focus == 0 { + Event::WindowLostFocus + } else { + Event::WindowHasFocus + }; + wake(activity, event); +} + +unsafe extern "C" fn on_window_created(activity: *mut ANativeActivity, window: *mut ANativeWindow) { + *NATIVE_WINDOW.write().unwrap() = Some(NativeWindow::from_ptr(NonNull::new(window).unwrap())); + wake(activity, Event::WindowCreated); +} + +unsafe extern "C" fn on_window_resized( + activity: *mut ANativeActivity, + _window: *mut ANativeWindow, +) { + wake(activity, Event::WindowResized); +} + +unsafe extern "C" fn on_window_redraw_needed( + activity: *mut ANativeActivity, + _window: *mut ANativeWindow, +) { + wake(activity, Event::WindowRedrawNeeded); +} + +unsafe extern "C" fn on_window_destroyed( + activity: *mut ANativeActivity, + _window: *mut ANativeWindow, +) { + *NATIVE_WINDOW.write().unwrap() = None; + wake(activity, Event::WindowDestroyed); +} + +unsafe extern "C" fn on_input_queue_created( + activity: *mut ANativeActivity, + queue: *mut AInputQueue, +) { + *INPUT_QUEUE.write().unwrap() = Some(InputQueue::from_ptr(NonNull::new(queue).unwrap())); + wake(activity, Event::InputQueueCreated); +} + +unsafe extern "C" fn on_input_queue_destroyed( + activity: *mut ANativeActivity, + _queue: *mut AInputQueue, +) { + *INPUT_QUEUE.write().unwrap() = None; + wake(activity, Event::InputQueueDestroyed); +} + +unsafe extern "C" fn on_content_rect_changed(activity: *mut ANativeActivity, rect: *const ARect) { + let rect = Rect { + left: (*rect).left as _, + top: (*rect).top as _, + right: (*rect).right as _, + bottom: (*rect).bottom as _, + }; + *CONTENT_RECT.write().unwrap() = rect; + wake(activity, Event::ContentRectChanged); +} From 4c0dc7b1c09822b9cfd0142d89851ea3f07dd621 Mon Sep 17 00:00:00 2001 From: David Craven Date: Tue, 11 Feb 2020 10:54:38 +0100 Subject: [PATCH 06/17] Add android-build-tools. --- Cargo.toml | 1 + android-build-tools/Cargo.toml | 16 ++ android-build-tools/src/apk.rs | 207 ++++++++++++++++++ android-build-tools/src/cargo.rs | 74 +++++++ android-build-tools/src/config.rs | 60 ++++++ android-build-tools/src/error.rs | 58 +++++ android-build-tools/src/lib.rs | 28 +++ android-build-tools/src/manifest.rs | 137 ++++++++++++ android-build-tools/src/ndk.rs | 318 ++++++++++++++++++++++++++++ android-build-tools/src/readelf.rs | 104 +++++++++ android-build-tools/src/target.rs | 79 +++++++ 11 files changed, 1082 insertions(+) create mode 100644 android-build-tools/Cargo.toml create mode 100644 android-build-tools/src/apk.rs create mode 100644 android-build-tools/src/cargo.rs create mode 100644 android-build-tools/src/config.rs create mode 100644 android-build-tools/src/error.rs create mode 100644 android-build-tools/src/lib.rs create mode 100644 android-build-tools/src/manifest.rs create mode 100644 android-build-tools/src/ndk.rs create mode 100644 android-build-tools/src/readelf.rs create mode 100644 android-build-tools/src/target.rs diff --git a/Cargo.toml b/Cargo.toml index 53b09b55..3e96ee7a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,6 @@ [workspace] members = [ + "android-build-tools", "android-glue", "android-ndk-sys", "android-ndk", diff --git a/android-build-tools/Cargo.toml b/android-build-tools/Cargo.toml new file mode 100644 index 00000000..9bcbbce0 --- /dev/null +++ b/android-build-tools/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "android-build-tools" +version = "0.1.0" +authors = ["David Craven "] +edition = "2018" +description = "Utilities for building android binaries" +license = "MIT OR Apache-2.0" +keywords = ["android", "ndk", "apk"] +documentation = "https://docs.rs/android-build-tools" +homepage = "https://github.com/rust-windowing/android-ndk-rs" +repository = "https://github.com/rust-windowing/android-ndk-rs" + +[dependencies] +dirs = "2.0.2" +serde = { version = "1.0.104", features = ["derive"] } +which = "3.1.0" diff --git a/android-build-tools/src/apk.rs b/android-build-tools/src/apk.rs new file mode 100644 index 00000000..d4ef9a00 --- /dev/null +++ b/android-build-tools/src/apk.rs @@ -0,0 +1,207 @@ +use crate::config::{Config, Metadata}; +use crate::error::NdkError; +use crate::manifest::Manifest; +use crate::ndk::{Key, Ndk}; +use crate::target::Target; +use std::path::{Path, PathBuf}; +use std::process::Command; + +pub struct ApkConfig { + pub ndk: Ndk, + pub build_dir: PathBuf, + pub assets: Option, + pub res: Option, + pub manifest: Manifest, +} + +impl ApkConfig { + pub fn from_config(config: Config, metadata: Metadata) -> Self { + let target_sdk_version = metadata + .target_sdk_version + .unwrap_or_else(|| config.ndk.default_platform()); + let features = metadata + .feature + .unwrap_or_default() + .into_iter() + .map(Into::into) + .collect(); + let permissions = metadata + .permission + .unwrap_or_default() + .into_iter() + .map(Into::into) + .collect(); + let manifest = Manifest { + package_name: config.package_name, + package_label: config.package_label, + version_name: config.version_name, + version_code: config.version_code, + split: config.split, + target_name: config.target_name, + debuggable: config.debuggable, + target_sdk_version, + min_sdk_version: metadata.min_sdk_version.unwrap_or(23), + opengles_version: metadata.opengles_version.unwrap_or((3, 1)), + features, + permissions, + icon: metadata.icon, + fullscreen: metadata.fullscreen.unwrap_or(false), + }; + Self { + ndk: config.ndk, + build_dir: config.build_dir, + assets: config.assets, + res: config.res, + manifest, + } + } + + fn build_tool(&self, tool: &'static str) -> Result { + let mut cmd = self.ndk.build_tool(tool)?; + cmd.current_dir(&self.build_dir); + Ok(cmd) + } + + fn unaligned_apk(&self) -> PathBuf { + self.build_dir + .join(format!("{}-unaligned.apk", self.manifest.package_label)) + } + + fn apk(&self) -> PathBuf { + self.build_dir + .join(format!("{}.apk", self.manifest.package_label)) + } + + pub fn create_apk(&self) -> Result { + std::fs::create_dir_all(&self.build_dir)?; + self.manifest.write_to(&self.build_dir)?; + + let mut aapt = self.build_tool(bin!("aapt"))?; + aapt.arg("package") + .arg("-f") + .arg("-F") + .arg(self.unaligned_apk()) + .arg("-M") + .arg("AndroidManifest.xml") + .arg("-I") + .arg(self.ndk.android_jar(self.manifest.target_sdk_version)?); + + if let Some(res) = &self.res { + aapt.arg("-S").arg(res); + } + + if let Some(assets) = &self.assets { + aapt.arg("-A").arg(assets); + } + + if !aapt.status()?.success() { + return Err(NdkError::CmdFailed(aapt)); + } + + Ok(UnalignedApk(self)) + } +} + +pub struct UnalignedApk<'a>(&'a ApkConfig); + +impl<'a> UnalignedApk<'a> { + pub fn config(&self) -> &ApkConfig { + self.0 + } + + pub fn add_lib(&self, path: &Path, target: Target) -> Result<(), NdkError> { + if !path.exists() { + return Err(NdkError::PathNotFound(path.into())); + } + let abi = target.android_abi(); + let file_name = path.file_name().unwrap(); + let out = self.0.build_dir.join("lib").join(abi); + std::fs::create_dir_all(&out)?; + std::fs::copy(path, out.join(&file_name))?; + + let mut aapt = self.0.build_tool(bin!("aapt"))?; + aapt.arg("add").arg(self.0.unaligned_apk()).arg(format!( + "lib/{}/{}", + abi, + file_name.to_str().unwrap() + )); + if !aapt.status()?.success() { + return Err(NdkError::CmdFailed(aapt)); + } + Ok(()) + } + + pub fn align(self) -> Result, NdkError> { + let mut zipalign = self.0.build_tool(bin!("zipalign"))?; + zipalign + .arg("-f") + .arg("-v") + .arg("4") + .arg(self.0.unaligned_apk()) + .arg(self.0.apk()); + if !zipalign.status()?.success() { + return Err(NdkError::CmdFailed(zipalign)); + } + Ok(UnsignedApk(self.0)) + } +} + +pub struct UnsignedApk<'a>(&'a ApkConfig); + +impl<'a> UnsignedApk<'a> { + pub fn sign(self, key: Key) -> Result { + let mut apksigner = self.0.build_tool(bat!("apksigner"))?; + apksigner + .arg("sign") + .arg("--ks") + .arg(&key.path) + .arg("--ks-pass") + .arg(format!("pass:{}", &key.password)) + .arg(self.0.apk()); + if !apksigner.status()?.success() { + return Err(NdkError::CmdFailed(apksigner)); + } + Ok(Apk::from_config(self.0)) + } +} + +pub struct Apk { + path: PathBuf, + package_name: String, + ndk: Ndk, +} + +impl Apk { + pub fn from_config(config: &ApkConfig) -> Self { + let ndk = config.ndk.clone(); + Self { + path: config.apk(), + package_name: config.manifest.package_name.clone(), + ndk, + } + } + + pub fn install(&self) -> Result<(), NdkError> { + let mut adb = self.ndk.platform_tool(bin!("adb"))?; + adb.arg("install").arg("-r").arg(&self.path); + if !adb.status()?.success() { + return Err(NdkError::CmdFailed(adb)); + } + Ok(()) + } + + pub fn start(&self) -> Result<(), NdkError> { + let mut adb = self.ndk.platform_tool(bin!("adb"))?; + adb.arg("shell") + .arg("am") + .arg("start") + .arg("-a") + .arg("android.intent.action.MAIN") + .arg("-n") + .arg(format!("{}/android.app.NativeActivity", &self.package_name)); + if !adb.status()?.success() { + return Err(NdkError::CmdFailed(adb)); + } + Ok(()) + } +} diff --git a/android-build-tools/src/cargo.rs b/android-build-tools/src/cargo.rs new file mode 100644 index 00000000..6fbc622e --- /dev/null +++ b/android-build-tools/src/cargo.rs @@ -0,0 +1,74 @@ +use crate::error::NdkError; +use crate::ndk::Ndk; +use crate::target::Target; +use std::process::Command; + +pub fn cargo_build(ndk: &Ndk, target: Target, sdk_version: u32) -> Result { + let triple = target.rust_triple(); + let mut cargo = Command::new("cargo"); + cargo.arg("build"); + + let clang = ndk.clang(target, sdk_version)?; + cargo.env(format!("CC_{}", triple), &clang); + cargo.env(cargo_env_target_cfg("LINKER", triple), &clang); + + let ar = ndk.toolchain_bin("ar", target)?; + cargo.env(format!("AR_{}", triple), &ar); + cargo.env(cargo_env_target_cfg("AR", triple), &ar); + + Ok(cargo) +} + +fn cargo_env_target_cfg(tool: &str, target: &str) -> String { + let utarget = target.replace("-", "_"); + let env = format!("CARGO_TARGET_{}_{}", &utarget, tool); + env.to_uppercase() +} + +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] +pub struct VersionCode { + major: u8, + minor: u8, + patch: u8, +} + +impl VersionCode { + pub fn new(major: u8, minor: u8, patch: u8) -> Self { + Self { + major, + minor, + patch, + } + } + + pub fn from_semver(version: &str) -> Result { + let mut iter = version.split(|c1| ['.', '-', '+'].iter().any(|c2| c1 == *c2)); + let mut p = || { + iter.next() + .ok_or(NdkError::InvalidSemver)? + .parse() + .map_err(|_| NdkError::InvalidSemver) + }; + Ok(Self::new(p()?, p()?, p()?)) + } + + pub fn to_code(&self, apk_id: u8) -> u32 { + (apk_id as u32) << 24 + | (self.major as u32) << 16 + | (self.minor as u32) << 8 + | self.patch as u32 + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn from_semver() { + let v = VersionCode::from_semver("0.0.0").unwrap(); + assert_eq!(v, VersionCode::new(0, 0, 0)); + let v = VersionCode::from_semver("254.254.254-alpha.fix+2").unwrap(); + assert_eq!(v, VersionCode::new(254, 254, 254)); + } +} diff --git a/android-build-tools/src/config.rs b/android-build-tools/src/config.rs new file mode 100644 index 00000000..abf29edc --- /dev/null +++ b/android-build-tools/src/config.rs @@ -0,0 +1,60 @@ +use crate::manifest::{Feature, Permission}; +use crate::ndk::Ndk; +use serde::Deserialize; +use std::path::PathBuf; + +#[derive(Debug)] +pub struct Config { + pub ndk: Ndk, + pub build_dir: PathBuf, + pub package_name: String, + pub package_label: String, + pub version_name: String, + pub version_code: u32, + pub split: Option, + pub target_name: String, + pub debuggable: bool, + pub assets: Option, + pub res: Option, +} + +#[derive(Clone, Debug, Default, Deserialize)] +pub struct Metadata { + pub(crate) target_sdk_version: Option, + pub(crate) min_sdk_version: Option, + pub(crate) icon: Option, + pub(crate) fullscreen: Option, + pub(crate) opengles_version: Option<(u8, u8)>, + pub(crate) feature: Option>, + pub(crate) permission: Option>, +} + +#[derive(Clone, Debug, Deserialize)] +pub(crate) struct FeatureConfig { + name: String, + required: Option, +} + +impl From for Feature { + fn from(config: FeatureConfig) -> Self { + Self { + name: config.name, + required: config.required.unwrap_or(true), + } + } +} + +#[derive(Clone, Debug, Deserialize)] +pub(crate) struct PermissionConfig { + name: String, + max_sdk_version: Option, +} + +impl From for Permission { + fn from(config: PermissionConfig) -> Self { + Self { + name: config.name, + max_sdk_version: config.max_sdk_version, + } + } +} diff --git a/android-build-tools/src/error.rs b/android-build-tools/src/error.rs new file mode 100644 index 00000000..c372a8bb --- /dev/null +++ b/android-build-tools/src/error.rs @@ -0,0 +1,58 @@ +use std::error::Error; +use std::fmt::{Display, Formatter, Result}; +use std::io::Error as IoError; +use std::path::PathBuf; +use std::process::Command; + +#[derive(Debug)] +pub enum NdkError { + SdkNotFound, + NdkNotFound, + PathNotFound(PathBuf), + CmdNotFound(String), + CmdFailed(Command), + BuildToolsNotFound, + NoPlatformFound, + PlatformNotFound(u32), + UnsupportedTarget, + Io(IoError), + InvalidSemver, +} + +impl Display for NdkError { + fn fmt(&self, f: &mut Formatter) -> Result { + let msg = match self { + Self::SdkNotFound => { + "Please set the path to the Android SDK with either the $ANDROID_SDK_HOME or \ + the $ANDROID_HOME environment variable." + } + Self::NdkNotFound => { + "Please set the path to the Android NDK with either the $ANDROID_NDK_HOME or \ + the $NDK_HOME environment variable." + } + Self::PathNotFound(path) => return write!(f, "Path {:?} doesn't exist.", path), + Self::CmdNotFound(cmd) => return write!(f, "Command {} not found.", cmd), + Self::CmdFailed(cmd) => { + let cmd = format!("{:?}", cmd).replace('"', ""); + return write!(f, "Command '{}' had a non-zero exit code.", cmd); + } + Self::BuildToolsNotFound => "Android SDK has no build tools.", + Self::NoPlatformFound => "Android SDK has no platforms installed.", + Self::PlatformNotFound(level) => { + return write!(f, "Platform {} is not installed.", level) + } + Self::UnsupportedTarget => "Target is not supported.", + Self::Io(error) => return error.fmt(f), + Self::InvalidSemver => return write!(f, "Invalid semver"), + }; + msg.fmt(f) + } +} + +impl Error for NdkError {} + +impl From for NdkError { + fn from(error: IoError) -> Self { + Self::Io(error) + } +} diff --git a/android-build-tools/src/lib.rs b/android-build-tools/src/lib.rs new file mode 100644 index 00000000..db7c6a75 --- /dev/null +++ b/android-build-tools/src/lib.rs @@ -0,0 +1,28 @@ +macro_rules! bin { + ($bin:expr) => {{ + #[cfg(not(target_os = "windows"))] + let bin = $bin; + #[cfg(target_os = "windows")] + let bin = format!("{}.exe", $bin); + bin + }}; +} + +macro_rules! bat { + ($bat:expr) => {{ + #[cfg(not(target_os = "windows"))] + let bat = $bat; + #[cfg(target_os = "windows")] + let bat = format!("{}.bat", $bat); + bat + }}; +} + +pub mod apk; +pub mod cargo; +pub mod config; +pub mod error; +pub mod manifest; +pub mod ndk; +pub mod readelf; +pub mod target; diff --git a/android-build-tools/src/manifest.rs b/android-build-tools/src/manifest.rs new file mode 100644 index 00000000..fd481e28 --- /dev/null +++ b/android-build-tools/src/manifest.rs @@ -0,0 +1,137 @@ +use crate::error::NdkError; +use std::fs::File; +use std::io::Write; +use std::path::Path; + +#[derive(Debug)] +pub struct Manifest { + pub package_name: String, + pub package_label: String, + pub version_name: String, + pub version_code: u32, + pub target_name: String, + pub target_sdk_version: u32, + pub min_sdk_version: u32, + pub opengles_version: (u8, u8), + pub features: Vec, + pub permissions: Vec, + pub icon: Option, + pub fullscreen: bool, + pub debuggable: bool, + pub split: Option, +} + +impl Manifest { + pub fn to_string(&self) -> String { + let split = if let Some(split) = self.split.as_ref() { + format!(r#"split="{}" android:isFeatureSplit="true""#, split) + } else { + "".to_string() + }; + let (major, minor) = self.opengles_version; + let opengles_version = format!("0x{:04}{:04}", major, minor); + + let icon = self + .icon + .as_ref() + .map(|icon| format!(r#"android:icon="{}""#, icon)) + .unwrap_or_default(); + + let fullscreen = if self.fullscreen { + r#"android:theme="@android:style/Theme.DeviceDefault.NoActionBar.Fullscreen""# + } else { + "" + }; + + let features: Vec = self.features.iter().map(|f| f.to_string()).collect(); + let permissions: Vec = self.permissions.iter().map(|p| p.to_string()).collect(); + + format!( + r#" + + + + {features} + {permissions} + + + + + + + + + +"#, + package_name = &self.package_name, + package_label = &self.package_label, + version_name = &self.version_name, + version_code = self.version_code, + split = split, + target_sdk_version = self.target_sdk_version, + min_sdk_version = self.min_sdk_version, + opengles_version = opengles_version, + target_name = &self.target_name, + icon = icon, + fullscreen = fullscreen, + debuggable = self.debuggable, + features = features.join("\n"), + permissions = permissions.join("\n"), + ) + } + + pub fn write_to(&self, dir: &Path) -> Result<(), NdkError> { + let mut file = File::create(dir.join("AndroidManifest.xml"))?; + writeln!(file, "{}", self.to_string())?; + Ok(()) + } +} + +#[derive(Debug)] +pub struct Feature { + pub name: String, + pub required: bool, +} + +impl Feature { + pub fn to_string(&self) -> String { + format!( + r#""#, + &self.name, self.required, + ) + } +} + +#[derive(Debug)] +pub struct Permission { + pub name: String, + pub max_sdk_version: Option, +} + +impl Permission { + pub fn to_string(&self) -> String { + let max_sdk_version = self + .max_sdk_version + .as_ref() + .map(|max_sdk_version| format!(r#"android:maxSdkVersion="{}""#, max_sdk_version)) + .unwrap_or_default(); + format!( + r#", +} + +impl Ndk { + pub fn from_env() -> Result { + let sdk_path = { + let mut sdk_path = std::env::var("ANDROID_SDK_HOME").ok(); + + if sdk_path.is_none() { + sdk_path = std::env::var("ANDROID_HOME").ok(); + } + + PathBuf::from(sdk_path.ok_or(NdkError::SdkNotFound)?) + }; + + let ndk_path = { + let mut ndk_path = std::env::var("ANDROID_NDK_HOME").ok(); + + if ndk_path.is_none() { + ndk_path = std::env::var("NDK_HOME").ok(); + } + + // default ndk installation path + if ndk_path.is_none() && sdk_path.join("ndk-bundle").exists() { + sdk_path.join("ndk-bundle") + } else { + PathBuf::from(ndk_path.ok_or(NdkError::NdkNotFound)?) + } + }; + + let build_tools_dir = sdk_path.join("build-tools"); + let build_tools_version = std::fs::read_dir(&build_tools_dir) + .or(Err(NdkError::PathNotFound(build_tools_dir)))? + .filter_map(|path| path.ok()) + .filter(|path| path.path().is_dir()) + .filter_map(|path| path.file_name().into_string().ok()) + .filter(|name| name.chars().next().unwrap().is_digit(10)) + .max() + .ok_or(NdkError::BuildToolsNotFound)?; + + let platforms_dir = sdk_path.join("platforms"); + let platforms: Vec = std::fs::read_dir(&platforms_dir) + .or(Err(NdkError::PathNotFound(platforms_dir)))? + .filter_map(|path| path.ok()) + .filter(|path| path.path().is_dir()) + .filter_map(|path| path.file_name().into_string().ok()) + .filter(|name| name.starts_with("android-")) + .filter_map(|name| name[8..].parse::().ok()) + .filter(|level| { + ndk_path + .join("platforms") + .join(format!("android-{}", level)) + .exists() + }) + .collect(); + + if platforms.len() < 1 { + return Err(NdkError::NoPlatformFound); + } + + Ok(Self { + sdk_path, + ndk_path, + build_tools_version, + platforms, + }) + } + + pub fn sdk(&self) -> &Path { + &self.sdk_path + } + + pub fn ndk(&self) -> &Path { + &self.ndk_path + } + + pub fn build_tools_version(&self) -> &str { + &self.build_tools_version + } + + pub fn platforms(&self) -> &[u32] { + &self.platforms + } + + pub fn build_tool(&self, tool: &str) -> Result { + let path = self + .sdk_path + .join("build-tools") + .join(&self.build_tools_version) + .join(tool); + if !path.exists() { + return Err(NdkError::CmdNotFound(tool.to_string())); + } + Ok(Command::new(std::fs::canonicalize(path)?)) + } + + pub fn platform_tool(&self, tool: &str) -> Result { + let path = self.sdk_path.join("platform-tools").join(tool); + if !path.exists() { + return Err(NdkError::CmdNotFound(tool.to_string())); + } + Ok(Command::new(std::fs::canonicalize(path)?)) + } + + pub fn default_platform(&self) -> u32 { + self.platforms().iter().max().cloned().unwrap() + } + + pub fn platform_dir(&self, platform: u32) -> Result { + let dir = self + .sdk_path + .join("platforms") + .join(format!("android-{}", platform)); + if !dir.exists() { + return Err(NdkError::PlatformNotFound(platform)); + } + Ok(dir) + } + + pub fn android_jar(&self, platform: u32) -> Result { + let android_jar = self.platform_dir(platform)?.join("android.jar"); + if !android_jar.exists() { + return Err(NdkError::PathNotFound(android_jar)); + } + Ok(android_jar) + } + + pub fn toolchain_dir(&self) -> Result { + #[cfg(target_os = "linux")] + let arch = "linux-x86_64"; + #[cfg(target_os = "macos")] + let arch = "darwin-x86_64"; + #[cfg(target_os = "windows")] + let arch = "windows-x86_64"; + + let toolchain_dir = self + .ndk_path + .join("toolchains") + .join("llvm") + .join("prebuilt") + .join(arch); + if !toolchain_dir.exists() { + return Err(NdkError::PathNotFound(toolchain_dir)); + } + Ok(toolchain_dir) + } + + pub fn clang(&self, target: Target, platform: u32) -> Result { + #[cfg(target_os = "windows")] + let ext = ".cmd"; + #[cfg(not(target_os = "windows"))] + let ext = ""; + + let clang = self.toolchain_dir()?.join("bin").join(format!( + "{}{}-clang{}", + target.ndk_llvm_triple(), + platform, + ext + )); + if !clang.exists() { + return Err(NdkError::PathNotFound(clang)); + } + Ok(clang) + } + + pub fn toolchain_bin(&self, bin: &str, target: Target) -> Result { + #[cfg(target_os = "windows")] + let ext = ".cmd"; + #[cfg(not(target_os = "windows"))] + let ext = ""; + + let bin = self.toolchain_dir()?.join("bin").join(format!( + "{}-{}{}", + target.ndk_triple(), + bin, + ext + )); + if !bin.exists() { + return Err(NdkError::PathNotFound(bin)); + } + Ok(bin) + } + + pub fn android_dir(&self) -> Result { + let android_dir = dirs::home_dir() + .ok_or(NdkError::PathNotFound(PathBuf::from("$HOME")))? + .join(".android"); + std::fs::create_dir_all(&android_dir)?; + Ok(android_dir) + } + + pub fn keytool(&self) -> Result { + if let Ok(keytool) = which::which(bin!("keytool")) { + return Ok(Command::new(keytool)); + } + if let Ok(java) = std::env::var("JAVA_HOME") { + let keytool = PathBuf::from(java).join("bin").join(bin!("keytool")); + if keytool.exists() { + return Ok(Command::new(keytool)); + } + } + Err(NdkError::CmdNotFound("keytool".to_string())) + } + + pub fn debug_key(&self) -> Result { + let path = self.android_dir()?.join("debug.keystore"); + let password = "android".to_string(); + if !path.exists() { + let mut keytool = self.keytool()?; + keytool + .arg("-genkey") + .arg("-v") + .arg("-keystore") + .arg(&path) + .arg("-storepass") + .arg("android") + .arg("-alias") + .arg("androiddebugkey") + .arg("-keypass") + .arg(&password) + .arg("-dname") + .arg("CN=Android Debug,O=Android,C=US") + .arg("-keyalg") + .arg("RSA") + .arg("-keysize") + .arg("2048") + .arg("-validity") + .arg("10000"); + if !keytool.status()?.success() { + return Err(NdkError::CmdFailed(keytool)); + } + } + Ok(Key { path, password }) + } + + pub fn sysroot_lib_dir(&self, target: Target) -> Result { + let sysroot_lib_dir = self + .toolchain_dir()? + .join("sysroot") + .join("usr") + .join("lib") + .join(target.ndk_triple()); + if !sysroot_lib_dir.exists() { + return Err(NdkError::PathNotFound(sysroot_lib_dir)); + } + Ok(sysroot_lib_dir) + } + + pub fn sysroot_platform_lib_dir( + &self, + target: Target, + min_sdk_version: u32, + ) -> Result { + let sysroot_lib_dir = self.sysroot_lib_dir(target)?; + + // Look for a platform <= min_sdk_version + let mut tmp_platform = min_sdk_version; + while tmp_platform > 1 { + let path = sysroot_lib_dir.join(tmp_platform.to_string()); + if path.exists() { + return Ok(path); + } + tmp_platform += 1; + } + + // Look for the minimum API level supported by the NDK + let mut tmp_platform = min_sdk_version; + while tmp_platform < 100 { + let path = sysroot_lib_dir.join(tmp_platform.to_string()); + if path.exists() { + return Ok(path); + } + tmp_platform += 1; + } + + Err(NdkError::PlatformNotFound(min_sdk_version)) + } + + pub fn detect_abi(&self) -> Result { + let stdout = self + .platform_tool("adb")? + .arg("shell") + .arg("getprop") + .arg("ro.product.cpu.abi") + .output()? + .stdout; + let abi = std::str::from_utf8(&stdout).or(Err(NdkError::UnsupportedTarget))?; + Target::from_android_abi(abi.trim()) + } +} + +pub struct Key { + pub path: PathBuf, + pub password: String, +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + #[ignore] + fn test_detect() { + let ndk = Ndk::from_env().unwrap(); + assert_eq!(ndk.build_tools_version(), "29.0.2"); + assert_eq!(ndk.platforms(), &[29, 28]); + } +} diff --git a/android-build-tools/src/readelf.rs b/android-build-tools/src/readelf.rs new file mode 100644 index 00000000..e09af5e9 --- /dev/null +++ b/android-build-tools/src/readelf.rs @@ -0,0 +1,104 @@ +use crate::apk::UnalignedApk; +use crate::error::NdkError; +use crate::target::Target; +use std::collections::HashSet; +use std::io::BufRead; +use std::path::{Path, PathBuf}; +use std::process::Command; + +impl<'a> UnalignedApk<'a> { + pub fn add_lib_recursively( + &self, + lib: &Path, + target: Target, + search_paths: &[&Path], + ) -> Result<(), NdkError> { + let ndk = &self.config().ndk; + let min_sdk_version = self.config().manifest.min_sdk_version; + let readelf_path = ndk.toolchain_bin("readelf", target)?; + + let android_search_paths = vec![ + ndk.sysroot_lib_dir(target)?, + ndk.sysroot_platform_lib_dir(target, min_sdk_version)?, + ]; + + let mut provided = HashSet::new(); + for path in &android_search_paths { + for lib in list_libs(path)? { + provided.insert(lib); + } + } + + let mut artifacts = vec![lib.to_path_buf()]; + while let Some(artifact) = artifacts.pop() { + self.add_lib(&artifact, target)?; + for need in list_needed_libs(&readelf_path, &artifact)? { + if provided.contains(&need) { + continue; + } + if let Some(path) = find_library_path(&search_paths, &need)? { + provided.insert(path.file_name().unwrap().to_str().unwrap().to_string()); + artifacts.push(path); + } else { + eprintln!("Shared library \"{}\" not found.", need); + } + } + } + + Ok(()) + } +} + +/// List all linked shared libraries +fn list_needed_libs(readelf_path: &Path, library_path: &Path) -> Result, NdkError> { + let mut readelf = Command::new(readelf_path); + let output = readelf.arg("-d").arg(library_path).output()?; + if !output.status.success() { + return Err(NdkError::CmdFailed(readelf)); + } + let mut needed = HashSet::new(); + for line in output.stdout.lines() { + let line = line?; + if line.contains("(NEEDED)") { + let lib = line + .split("Shared library: [") + .last() + .and_then(|line| line.split("]").next()); + if let Some(lib) = lib { + needed.insert(lib.to_string()); + } + } + } + Ok(needed) +} + +/// List shared libraries +fn list_libs(path: &Path) -> Result, NdkError> { + let mut libs = HashSet::new(); + let entries = std::fs::read_dir(path)?; + for entry in entries { + let entry = entry?; + if !entry.path().is_dir() { + if let Some(file_name) = entry.file_name().to_str() { + if file_name.ends_with(".so") { + libs.insert(file_name.to_string()); + } + } + } + } + Ok(libs) +} + +/// Resolves native library using search paths +fn find_library_path>( + paths: &[&Path], + library: S, +) -> Result, NdkError> { + for path in paths { + let lib_path = path.join(&library); + if lib_path.exists() { + return Ok(Some(std::fs::canonicalize(lib_path)?)); + } + } + Ok(None) +} diff --git a/android-build-tools/src/target.rs b/android-build-tools/src/target.rs new file mode 100644 index 00000000..676b9005 --- /dev/null +++ b/android-build-tools/src/target.rs @@ -0,0 +1,79 @@ +use crate::error::NdkError; +use serde::Deserialize; + +#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq)] +#[repr(u8)] +pub enum Target { + #[serde(rename = "armv7-linux-androideabi")] + ArmV7a = 1, + #[serde(rename = "aarch64-linux-android")] + Arm64V8a = 2, + #[serde(rename = "i686-linux-android")] + X86 = 3, + #[serde(rename = "x86_64-linux-android")] + X86_64 = 4, +} + +impl Target { + /// Identifier used in the NDK to refer to the ABI + pub fn android_abi(self) -> &'static str { + match self { + Self::Arm64V8a => "arm64-v8a", + Self::ArmV7a => "armeabi-v7a", + Self::X86 => "x86", + Self::X86_64 => "x86_64", + } + } + + /// Returns `Target` for abi. + pub fn from_android_abi(abi: &str) -> Result { + match abi { + "arm64-v8a" => Ok(Self::Arm64V8a), + "armeabi-v7a" => Ok(Self::ArmV7a), + "x86" => Ok(Self::X86), + "x86_64" => Ok(Self::X86_64), + _ => Err(NdkError::UnsupportedTarget), + } + } + + /// Returns the triple used by the rust build tools + pub fn rust_triple(self) -> &'static str { + match self { + Self::Arm64V8a => "aarch64-linux-android", + Self::ArmV7a => "armv7-linux-androideabi", + Self::X86 => "i686-linux-android", + Self::X86_64 => "x86_64-linux-android", + } + } + + /// Returns `Target` for rust triple. + pub fn from_rust_triple(triple: &str) -> Result { + match triple { + "aarch64-linux-android" => Ok(Self::Arm64V8a), + "armv7-linux-androideabi" => Ok(Self::ArmV7a), + "i686-linux-android" => Ok(Self::X86), + "x86_64-linux-android" => Ok(Self::X86_64), + _ => Err(NdkError::UnsupportedTarget), + } + } + + // Returns the triple NDK provided LLVM + pub fn ndk_llvm_triple(self) -> &'static str { + match self { + Self::Arm64V8a => "aarch64-linux-android", + Self::ArmV7a => "armv7a-linux-androideabi", + Self::X86 => "i686-linux-android", + Self::X86_64 => "x86_64-linux-android", + } + } + + /// Returns the triple used by the non-LLVM parts of the NDK + pub fn ndk_triple(self) -> &'static str { + match self { + Self::Arm64V8a => "aarch64-linux-android", + Self::ArmV7a => "arm-linux-androideabi", + Self::X86 => "i686-linux-android", + Self::X86_64 => "x86_64-linux-android", + } + } +} From 6b63fd16fcfa7c880ae68a9af477714a5b98f145 Mon Sep 17 00:00:00 2001 From: David Craven Date: Tue, 11 Feb 2020 22:18:19 +0100 Subject: [PATCH 07/17] Add cargo-apk. --- Cargo.toml | 1 + cargo-apk/Cargo.toml | 20 +++++++ cargo-apk/src/apk.rs | 113 ++++++++++++++++++++++++++++++++++++++ cargo-apk/src/error.rs | 56 +++++++++++++++++++ cargo-apk/src/lib.rs | 6 ++ cargo-apk/src/main.rs | 82 +++++++++++++++++++++++++++ cargo-apk/src/manifest.rs | 58 +++++++++++++++++++ 7 files changed, 336 insertions(+) create mode 100644 cargo-apk/Cargo.toml create mode 100644 cargo-apk/src/apk.rs create mode 100644 cargo-apk/src/error.rs create mode 100644 cargo-apk/src/lib.rs create mode 100644 cargo-apk/src/main.rs create mode 100644 cargo-apk/src/manifest.rs diff --git a/Cargo.toml b/Cargo.toml index 3e96ee7a..9ac4dd76 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,4 +4,5 @@ members = [ "android-glue", "android-ndk-sys", "android-ndk", + "cargo-apk", ] diff --git a/cargo-apk/Cargo.toml b/cargo-apk/Cargo.toml new file mode 100644 index 00000000..4f30d0d9 --- /dev/null +++ b/cargo-apk/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "cargo-apk" +version = "0.5.0" +authors = ["David Craven "] +edition = "2018" +description = "Helps cargo build apks" +license = "MIT OR Apache-2.0" +keywords = ["android", "ndk", "apk"] +documentation = "https://docs.rs/cargo-apk" +homepage = "https://github.com/rust-windowing/android-ndk-rs" +repository = "https://github.com/rust-windowing/android-ndk-rs" + +[dependencies] +android-build-tools = { path = "../android-build-tools" } +cargo-subcommand = "0.4.3" +env_logger = "0.7.1" +exitfailure = "0.5.1" +log = "0.4.8" +serde = "1.0.104" +toml = "0.5.6" diff --git a/cargo-apk/src/apk.rs b/cargo-apk/src/apk.rs new file mode 100644 index 00000000..5401ee20 --- /dev/null +++ b/cargo-apk/src/apk.rs @@ -0,0 +1,113 @@ +use crate::error::Error; +use crate::manifest::Manifest; +use android_build_tools::apk::{Apk, ApkConfig}; +use android_build_tools::cargo::{cargo_build, VersionCode}; +use android_build_tools::config::Config; +use android_build_tools::error::NdkError; +use android_build_tools::ndk::Ndk; +use android_build_tools::target::Target; +use cargo_subcommand::{Artifact, CrateType, Profile, Subcommand}; +use std::path::PathBuf; +use std::process::Command; + +pub struct ApkBuilder<'a> { + cmd: &'a Subcommand, + ndk: Ndk, + manifest: Manifest, + build_dir: PathBuf, + build_targets: Vec, +} + +impl<'a> ApkBuilder<'a> { + pub fn from_subcommand(cmd: &'a Subcommand) -> Result { + let ndk = Ndk::from_env()?; + let manifest = Manifest::parse_from_toml(cmd.manifest())?; + let build_targets = if let Some(target) = cmd.target() { + vec![Target::from_rust_triple(target)?] + } else { + if manifest.build_targets.len() > 0 { + manifest.build_targets.clone() + } else { + vec![ndk.detect_abi().unwrap_or(Target::Arm64V8a)] + } + }; + let build_dir = cmd.target_dir().join(cmd.profile()).join("apk"); + Ok(Self { + cmd, + ndk, + manifest, + build_dir, + build_targets, + }) + } + + pub fn build(&self, artifact: &Artifact) -> Result { + let package_name = match artifact { + Artifact::Root(name) => format!("rust.{}", name.replace("-", "_")), + Artifact::Example(name) => format!("rust.example.{}", name.replace("-", "_")), + }; + let config = Config { + ndk: self.ndk.clone(), + build_dir: self.build_dir.join(artifact), + package_name, + package_label: artifact.name().to_string(), + version_name: self.manifest.version.clone(), + version_code: VersionCode::from_semver(&self.manifest.version)?.to_code(1), + split: None, + target_name: artifact.name().replace("-", "_"), + debuggable: *self.cmd.profile() == Profile::Dev, + assets: self.manifest.assets.clone(), + res: self.manifest.res.clone(), + }; + let config = ApkConfig::from_config(config, self.manifest.metadata.clone()); + let apk = config.create_apk()?; + + for target in &self.build_targets { + let triple = target.rust_triple(); + let build_dir = self + .cmd + .target_dir() + .join(target.rust_triple()) + .join(self.cmd.profile()); + let artifact = build_dir + .join(artifact) + .join(artifact.file_name(CrateType::Cdylib, &triple)); + + let target_sdk_version = config.manifest.target_sdk_version; + + let mut cargo = cargo_build(&config.ndk, *target, target_sdk_version)?; + if self.cmd.target().is_none() { + cargo.arg("--target").arg(target.rust_triple()); + } + cargo.args(self.cmd.args()); + if !cargo.status()?.success() { + return Err(NdkError::CmdFailed(cargo).into()); + } + + apk.add_lib_recursively(&artifact, *target, &[&build_dir.join("deps")])?; + } + + Ok(apk.align()?.sign(config.ndk.debug_key()?)?) + } + + pub fn run(&self, artifact: &Artifact) -> Result<(), Error> { + let apk = self.build(artifact)?; + apk.install()?; + apk.start()?; + Ok(()) + } + + pub fn gdb(&self, artifact: &Artifact) -> Result<(), Error> { + self.run(artifact)?; + let abi = self.ndk.detect_abi()?; + let target_dir = self.build_dir.join(artifact); + let jni_dir = target_dir.join("jni"); + std::fs::create_dir_all(&jni_dir)?; + std::fs::write( + jni_dir.join("Android.mk"), + format!("APP_ABI=\"{}\"\nTARGET_OUT=\"\"\n", abi.android_abi()), + )?; + Command::new("ndk-gdb").current_dir(target_dir).status()?; + Ok(()) + } +} diff --git a/cargo-apk/src/error.rs b/cargo-apk/src/error.rs new file mode 100644 index 00000000..0a16a1ab --- /dev/null +++ b/cargo-apk/src/error.rs @@ -0,0 +1,56 @@ +use android_build_tools::error::NdkError; +use cargo_subcommand::Error as SubcommandError; +use std::fmt::{Display, Formatter, Result}; +use std::io::Error as IoError; +use toml::de::Error as TomlError; + +#[derive(Debug)] +pub enum Error { + Subcommand(SubcommandError), + Config(TomlError), + Ndk(NdkError), + Io(IoError), +} + +impl Error { + pub fn invalid_args() -> Self { + Self::Subcommand(SubcommandError::InvalidArgs) + } +} + +impl Display for Error { + fn fmt(&self, f: &mut Formatter) -> Result { + match self { + Self::Subcommand(error) => error.fmt(f), + Self::Config(error) => return write!(f, "Failed to parse config: {}.", error), + Self::Ndk(error) => error.fmt(f), + Self::Io(error) => error.fmt(f), + } + } +} + +impl std::error::Error for Error {} + +impl From for Error { + fn from(error: SubcommandError) -> Self { + Self::Subcommand(error) + } +} + +impl From for Error { + fn from(error: TomlError) -> Self { + Self::Config(error) + } +} + +impl From for Error { + fn from(error: NdkError) -> Self { + Self::Ndk(error) + } +} + +impl From for Error { + fn from(error: IoError) -> Self { + Self::Io(error) + } +} diff --git a/cargo-apk/src/lib.rs b/cargo-apk/src/lib.rs new file mode 100644 index 00000000..4288b6e7 --- /dev/null +++ b/cargo-apk/src/lib.rs @@ -0,0 +1,6 @@ +mod apk; +mod error; +mod manifest; + +pub use apk::ApkBuilder; +pub use error::Error; diff --git a/cargo-apk/src/main.rs b/cargo-apk/src/main.rs new file mode 100644 index 00000000..255e21a1 --- /dev/null +++ b/cargo-apk/src/main.rs @@ -0,0 +1,82 @@ +use cargo_apk::{ApkBuilder, Error}; +use cargo_subcommand::Subcommand; +use exitfailure::ExitDisplay; +use std::process::Command; + +fn main() -> Result<(), ExitDisplay> { + env_logger::init(); + + let cmd = Subcommand::new("apk", |_, _| Ok(false)).map_err(|e| Error::Subcommand(e))?; + let builder = ApkBuilder::from_subcommand(&cmd)?; + + match cmd.cmd() { + "build" => { + for artifact in cmd.artifacts() { + builder.build(artifact)?; + } + } + "run" => { + if cmd.artifacts().len() == 1 { + builder.run(&cmd.artifacts()[0])?; + } else { + return Err(Error::invalid_args().into()); + } + } + "gdb" => { + if cmd.artifacts().len() == 1 { + builder.gdb(&cmd.artifacts()[0])?; + } else { + return Err(Error::invalid_args().into()); + } + } + "help" => { + if let Some(arg) = cmd.args().get(0) { + match &**arg { + "build" | "run" => run_cargo(&cmd)?, + "gdb" => print_gdb_help(), + _ => print_help(), + } + } else { + print_help(); + } + } + _ => print_help(), + } + + Ok(()) +} + +fn run_cargo(cmd: &Subcommand) -> Result<(), Error> { + Command::new("cargo") + .arg(cmd.cmd()) + .args(cmd.args()) + .status()?; + Ok(()) +} + +fn print_help() { + println!( + r#"cargo-apk +Helps cargo build apk's for android + +USAGE: + cargo apk [SUBCOMMAND] + +SUBCOMMAND: + build Compiles the current package + run Run a binary or example of the local package + gdb Start a gdb session attached to an adb device with symbols loaded +"# + ); +} + +fn print_gdb_help() { + println!( + r#"cargo-apk gdb +Start a gdb session attached to an adb device with symbols loaded + +USAGE: + cargo apk gdb +"# + ); +} diff --git a/cargo-apk/src/manifest.rs b/cargo-apk/src/manifest.rs new file mode 100644 index 00000000..207f4286 --- /dev/null +++ b/cargo-apk/src/manifest.rs @@ -0,0 +1,58 @@ +use crate::error::Error; +use android_build_tools::config::Metadata; +use android_build_tools::target::Target; +use serde::Deserialize; +use std::path::Path; + +pub struct Manifest { + pub version: String, + pub metadata: Metadata, + pub build_targets: Vec, + pub assets: Option, + pub res: Option, +} + +impl Manifest { + pub fn parse_from_toml(path: &Path) -> Result { + let contents = std::fs::read_to_string(path)?; + let toml: Root = toml::from_str(&contents)?; + let metadata = toml + .package + .metadata + .unwrap_or_default() + .android + .unwrap_or_default(); + Ok(Self { + version: toml.package.version, + metadata: metadata.metadata, + build_targets: metadata.build_targets.unwrap_or_default(), + assets: metadata.assets, + res: metadata.res, + }) + } +} + +#[derive(Debug, Clone, Deserialize)] +struct Root { + package: Package, +} + +#[derive(Debug, Clone, Deserialize)] +struct Package { + version: String, + metadata: Option, +} + +#[derive(Clone, Debug, Default, Deserialize)] +struct PackageMetadata { + android: Option, +} + +#[derive(Clone, Debug, Default, Deserialize)] +struct AndroidMetadata { + #[serde(flatten)] + metadata: Metadata, + build_targets: Option>, + assets: Option, + res: Option, +} From af677c11f8cfccc2afac6b54c1cb425f21945ee3 Mon Sep 17 00:00:00 2001 From: David Craven Date: Tue, 11 Feb 2020 22:19:07 +0100 Subject: [PATCH 08/17] Add android-examples. --- Cargo.toml | 1 + android-examples/Cargo.toml | 13 +++++++++++++ android-examples/examples/hello_world.rs | 19 +++++++++++++++++++ android-examples/src/lib.rs | 1 + 4 files changed, 34 insertions(+) create mode 100644 android-examples/Cargo.toml create mode 100644 android-examples/examples/hello_world.rs create mode 100644 android-examples/src/lib.rs diff --git a/Cargo.toml b/Cargo.toml index 9ac4dd76..de808c0e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,7 @@ [workspace] members = [ "android-build-tools", + "android-examples", "android-glue", "android-ndk-sys", "android-ndk", diff --git a/android-examples/Cargo.toml b/android-examples/Cargo.toml new file mode 100644 index 00000000..d70cbb94 --- /dev/null +++ b/android-examples/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "android-examples" +version = "0.1.0" +authors = ["David Craven "] +edition = "2018" +publish = false + +[target.'cfg(target_os = "android")'.dependencies] +android-glue = { path = "../android-glue" } + +[[example]] +name = "hello_world" +crate-type = ["cdylib"] diff --git a/android-examples/examples/hello_world.rs b/android-examples/examples/hello_world.rs new file mode 100644 index 00000000..82b1cc56 --- /dev/null +++ b/android-examples/examples/hello_world.rs @@ -0,0 +1,19 @@ +#[cfg(target_os = "android")] +#[no_mangle] +pub unsafe extern "C" fn ANativeActivity_onCreate( + activity: *mut std::os::raw::c_void, + saved_state: *mut std::os::raw::c_void, + saved_state_size: usize, +) { + std::env::set_var("RUST_BACKTRACE", "1"); + android_glue::init( + activity as _, + saved_state as _, + saved_state_size as _, + app_main, + ); +} + +pub fn app_main() { + println!("hello world"); +} diff --git a/android-examples/src/lib.rs b/android-examples/src/lib.rs new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/android-examples/src/lib.rs @@ -0,0 +1 @@ + From afc01d7619f6d84ad7a008a0cbda13ef0e9702ca Mon Sep 17 00:00:00 2001 From: David Craven Date: Mon, 17 Feb 2020 16:32:00 +0100 Subject: [PATCH 09/17] Remove native-app-glue support. --- android-ndk-sys/.cargo/config | 2 - android-ndk-sys/Cargo.toml | 14 +- android-ndk-sys/src/lib.rs | 13 +- android-ndk-sys/src/native_app_glue.rs | 58 -------- android-ndk/.cargo/config | 2 - android-ndk/Cargo.toml | 17 +-- android-ndk/src/android_app.rs | 181 ------------------------- android-ndk/src/lib.rs | 3 - 8 files changed, 14 insertions(+), 276 deletions(-) delete mode 100644 android-ndk-sys/.cargo/config delete mode 100644 android-ndk-sys/src/native_app_glue.rs delete mode 100644 android-ndk/.cargo/config delete mode 100644 android-ndk/src/android_app.rs diff --git a/android-ndk-sys/.cargo/config b/android-ndk-sys/.cargo/config deleted file mode 100644 index 8e50cdeb..00000000 --- a/android-ndk-sys/.cargo/config +++ /dev/null @@ -1,2 +0,0 @@ -[build] -target = "armv7-linux-androideabi" diff --git a/android-ndk-sys/Cargo.toml b/android-ndk-sys/Cargo.toml index e368ad81..d210571c 100644 --- a/android-ndk-sys/Cargo.toml +++ b/android-ndk-sys/Cargo.toml @@ -1,25 +1,19 @@ [package] name = "android-ndk-sys" -version = "0.2.0" +version = "0.2.1" authors = ["Mark Barbone "] edition = "2018" description = "FFI bindings for the Android NDK" license = "MIT OR Apache-2.0" keywords = ["android", "ndk"] readme = "../README.md" - documentation = "https://docs.rs/android-ndk-sys" -homepage = "https://github.com/mb64/android-ndk-rs" -repository = "https://github.com/mb64/android-ndk-rs" - -include = [ - "src/*", - "Cargo.toml", -] +homepage = "https://github.com/rust-windowing/android-ndk-rs" +repository = "https://github.com/rust-windowing/android-ndk-rs" [features] -native_app_glue = [] rustdoc = [] +test = [] [package.metadata.docs.rs] features = ["rustdoc"] diff --git a/android-ndk-sys/src/lib.rs b/android-ndk-sys/src/lib.rs index 75992625..5322b6a7 100644 --- a/android-ndk-sys/src/lib.rs +++ b/android-ndk-sys/src/lib.rs @@ -13,28 +13,25 @@ // Test setup lints #![cfg_attr(test, allow(dead_code))] -#[cfg(feature = "native_app_glue")] -pub mod native_app_glue; - -#[cfg(all(not(target_os = "android"), not(test), not(feature = "rustdoc")))] +#[cfg(not(any(target_os = "android", feature = "test", feature = "rustdoc")))] compile_error!("android-ndk-sys only supports compiling for Android"); #[cfg(any( all( - any(target_os = "android", test), + any(target_os = "android", feature = "test"), any(target_arch = "arm", target_arch = "armv7") ), feature = "rustdoc" ))] include!("ffi_arm.rs"); -#[cfg(all(any(target_os = "android", test), target_arch = "aarch64"))] +#[cfg(all(any(target_os = "android", feature = "test"), target_arch = "aarch64"))] include!("ffi_aarch64.rs"); -#[cfg(all(any(target_os = "android", test), target_arch = "x86"))] +#[cfg(all(any(target_os = "android", feature = "test"), target_arch = "x86"))] include!("ffi_i686.rs"); -#[cfg(all(any(target_os = "android", test), target_arch = "x86_64"))] +#[cfg(all(any(target_os = "android", feature = "test"), target_arch = "x86_64"))] include!("ffi_x86_64.rs"); #[cfg(target_os = "android")] diff --git a/android-ndk-sys/src/native_app_glue.rs b/android-ndk-sys/src/native_app_glue.rs deleted file mode 100644 index 077b1fa4..00000000 --- a/android-ndk-sys/src/native_app_glue.rs +++ /dev/null @@ -1,58 +0,0 @@ -//! Bindings to the NDK's `android_native_app_glue.c` - -use super::{ - AConfiguration, AInputEvent, AInputQueue, ALooper, ANativeActivity, ANativeWindow, ARect, -}; -use std::os::raw::{c_int, c_void}; - -#[repr(C)] -pub struct android_app { - pub userData: *mut c_void, - pub onAppCmd: extern "C" fn(*mut android_app, i32), - pub onInputEvent: extern "C" fn(*mut android_app, *const AInputEvent) -> i32, - pub activity: *mut ANativeActivity, - pub config: *mut AConfiguration, - pub savedState: *mut c_void, - pub savedStateSize: usize, - pub looper: *mut ALooper, - pub inputQueue: *mut AInputQueue, - pub window: *mut ANativeWindow, - pub contentRect: ARect, - pub activityState: c_int, - pub destroyRequested: c_int, -} - -#[repr(C)] -pub struct android_poll_source { - pub id: i32, // can be LOOPER_ID_MAIN, LOOPER_ID_INPUT or LOOPER_ID_USER - pub app: *mut android_app, - pub process: extern "C" fn(*mut android_app, *mut android_poll_source), -} - -pub const LOOPER_ID_MAIN: i32 = 1; -pub const LOOPER_ID_INPUT: i32 = 2; -pub const LOOPER_ID_USER: i32 = 3; - -pub const APP_CMD_INPUT_CHANGED: i8 = 0; -pub const APP_CMD_INIT_WINDOW: i8 = 1; -pub const APP_CMD_TERM_WINDOW: i8 = 2; -pub const APP_CMD_WINDOW_RESIZED: i8 = 3; -pub const APP_CMD_WINDOW_REDRAW_NEEDED: i8 = 4; -pub const APP_CMD_CONTENT_RECT_CHANGED: i8 = 5; -pub const APP_CMD_GAINED_FOCUS: i8 = 6; -pub const APP_CMD_LOST_FOCUS: i8 = 7; -pub const APP_CMD_CONFIG_CHANGED: i8 = 8; -pub const APP_CMD_LOW_MEMORY: i8 = 9; -pub const APP_CMD_START: i8 = 10; -pub const APP_CMD_RESUME: i8 = 11; -pub const APP_CMD_SAVE_STATE: i8 = 12; -pub const APP_CMD_PAUSE: i8 = 13; -pub const APP_CMD_STOP: i8 = 14; -pub const APP_CMD_DESTROY: i8 = 15; - -extern "C" { - pub fn android_app_read_cmd(app: *mut android_app) -> i8; - pub fn android_app_pre_exec_cmd(app: *mut android_app, cmd: i8); - pub fn android_app_post_exec_cmd(app: *mut android_app, cmd: i8); - pub fn app_dummy(); -} diff --git a/android-ndk/.cargo/config b/android-ndk/.cargo/config deleted file mode 100644 index 8e50cdeb..00000000 --- a/android-ndk/.cargo/config +++ /dev/null @@ -1,2 +0,0 @@ -[build] -target = "armv7-linux-androideabi" diff --git a/android-ndk/Cargo.toml b/android-ndk/Cargo.toml index 73de104d..617081f8 100644 --- a/android-ndk/Cargo.toml +++ b/android-ndk/Cargo.toml @@ -1,31 +1,24 @@ [package] name = "android-ndk" -version = "0.0.6" +version = "0.1.0" authors = ["Mark Barbone "] edition = "2018" description = "Safe Rust bindings to the Android NDK" license = "MIT OR Apache-2.0" keywords = ["android", "ndk"] readme = "../README.md" - documentation = "https://docs.rs/android-ndk" -homepage = "https://github.com/mb64/android-ndk-rs" -repository = "https://github.com/mb64/android-ndk-rs" - -include = [ - "src/*", - "Cargo.toml", -] +homepage = "https://github.com/rust-windowing/android-ndk-rs" +repository = "https://github.com/rust-windowing/android-ndk-rs" [features] rustdoc = ["ffi/rustdoc", "jni", "jni-glue"] -native_app_glue = ["ffi/native_app_glue"] [package.metadata.docs.rs] features = ["rustdoc"] [dependencies] -num_enum = "0.2" +num_enum = "0.4.2" jni-sys = "0.3.0" [dependencies.jni] @@ -33,7 +26,7 @@ version = "0.14.0" optional = true [dependencies.jni-glue] -version = "0.0.9" +version = "0.0.10" optional = true [dependencies.ffi] diff --git a/android-ndk/src/android_app.rs b/android-ndk/src/android_app.rs deleted file mode 100644 index 0dacedf4..00000000 --- a/android-ndk/src/android_app.rs +++ /dev/null @@ -1,181 +0,0 @@ -//! Bindings for the `android_app` struct found in `android_native_app_glue.c` -//! -//! If you are not using `native_app_glue`, you can disable these bindings by disabling the -//! `native_app_glue` Cargo feature. - -use crate::configuration::Configuration; -use crate::input_queue::InputQueue; -use crate::looper::ForeignLooper; -use crate::native_activity::NativeActivity; -use crate::native_window::NativeWindow; - -use num_enum::{IntoPrimitive, TryFromPrimitive}; -use std::convert::TryInto; -use std::fmt; -use std::marker::PhantomData; -use std::mem::ManuallyDrop; -use std::ops::Deref; -use std::ptr::NonNull; - -/// A `struct android_app *`. -#[derive(Debug)] -pub struct AndroidApp { - ptr: NonNull, -} - -// It is used between threads in android_native_app_glue -unsafe impl Send for AndroidApp {} -unsafe impl Sync for AndroidApp {} - -// TODO: docs -impl AndroidApp { - pub unsafe fn from_ptr(ptr: NonNull) -> Self { - Self { ptr } - } - - pub fn ptr(&self) -> NonNull { - self.ptr - } - - // It's OK to not give a Ref<'_, _> because the ANativeActivity * will never change - pub fn activity(&self) -> NativeActivity { - unsafe { NativeActivity::from_ptr(NonNull::new(self.ptr.as_ref().activity).unwrap()) } - } - - pub fn native_window(&self) -> Option> { - unsafe { - if let Some(ptr) = NonNull::new(self.ptr.as_ref().window) { - return Some(Ref::new(NativeWindow::from_ptr(ptr))); - } - } - None - } - - pub fn input_queue(&self) -> Option> { - unsafe { - if let Some(ptr) = NonNull::new(self.ptr.as_ref().inputQueue) { - return Some(Ref::new(InputQueue::from_ptr(ptr))); - } - } - None - } - - pub fn config(&self) -> Ref<'_, Configuration> { - unsafe { - Ref::new(Configuration::from_ptr( - NonNull::new(self.ptr.as_ref().config).unwrap(), - )) - } - } - - /* pub */ - fn read_cmd(&mut self) -> Cmd { - unsafe { - ffi::native_app_glue::android_app_read_cmd(self.ptr.as_ptr()) - .try_into() - .unwrap() - } - } - - /* pub */ - fn pre_exec(&mut self, cmd: Cmd) { - unsafe { - ffi::native_app_glue::android_app_pre_exec_cmd(self.ptr.as_ptr(), cmd.into()); - } - } - - /* pub */ - fn post_exec(&mut self, cmd: Cmd) { - unsafe { - ffi::native_app_glue::android_app_post_exec_cmd(self.ptr.as_ptr(), cmd.into()); - } - } - - pub fn handle_cmd(&mut self, f: impl FnOnce(&mut Self, Cmd) -> T) -> T { - let cmd = self.read_cmd(); - self.pre_exec(cmd); - let res = f(self, cmd); - self.post_exec(cmd); - res - } - - pub fn saved_state(&self) -> Option<&[u8]> { - unsafe { - let ptr = self.ptr.as_ref().savedState; - if ptr.is_null() { - None - } else { - Some(std::slice::from_raw_parts( - ptr as *mut u8, - self.ptr.as_ref().savedStateSize, - )) - } - } - } - - pub fn content_rect(&self) -> ffi::ARect { - unsafe { self.ptr.as_ref().contentRect } - } - - // The looper will also never change - pub fn looper(&self) -> ForeignLooper { - unsafe { ForeignLooper::from_ptr(NonNull::new(self.ptr.as_ref().looper).unwrap()) } - } - - // TODO: all the other things -} - -// TODO docs -// Best thing would be to word-for-word copy the docs from android_native_app_glue.h to here, -// because there's really no good online source for it -#[derive(Debug, Clone, Copy, PartialEq, Eq, TryFromPrimitive, IntoPrimitive)] -#[repr(i8)] -pub enum Cmd { - InputChanged = ffi::native_app_glue::APP_CMD_INPUT_CHANGED, - InitWindow = ffi::native_app_glue::APP_CMD_INIT_WINDOW, - TermWindow = ffi::native_app_glue::APP_CMD_TERM_WINDOW, - WindowResized = ffi::native_app_glue::APP_CMD_WINDOW_RESIZED, - WindowRedrawNeeded = ffi::native_app_glue::APP_CMD_WINDOW_REDRAW_NEEDED, - ContentRectChanged = ffi::native_app_glue::APP_CMD_CONTENT_RECT_CHANGED, - GainedFocus = ffi::native_app_glue::APP_CMD_GAINED_FOCUS, - LostFocus = ffi::native_app_glue::APP_CMD_LOST_FOCUS, - ConfigChanged = ffi::native_app_glue::APP_CMD_CONFIG_CHANGED, - LowMemory = ffi::native_app_glue::APP_CMD_LOW_MEMORY, - Start = ffi::native_app_glue::APP_CMD_START, - Resume = ffi::native_app_glue::APP_CMD_RESUME, - SaveState = ffi::native_app_glue::APP_CMD_SAVE_STATE, - Pause = ffi::native_app_glue::APP_CMD_PAUSE, - Stop = ffi::native_app_glue::APP_CMD_STOP, - Destroy = ffi::native_app_glue::APP_CMD_DESTROY, -} - -/// A wrapper that associates a lifetime with data. -/// -/// This is used to ensure that data associated with an `AndroidApp` doesn't outlive its container. -pub struct Ref<'a, T> { - _marker: PhantomData<&'a T>, - data: ManuallyDrop, -} - -impl<'a, T: fmt::Debug> fmt::Debug for Ref<'a, T> { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "Ref {{ {:?} }}", &*self) - } -} - -impl<'a, T> Deref for Ref<'a, T> { - type Target = T; - - fn deref(&self) -> &T { - &*self.data - } -} - -impl<'a, T> Ref<'a, T> { - fn new(data: T) -> Self { - Self { - _marker: PhantomData, - data: ManuallyDrop::new(data), - } - } -} diff --git a/android-ndk/src/lib.rs b/android-ndk/src/lib.rs index 0b661440..f6b4b4f5 100644 --- a/android-ndk/src/lib.rs +++ b/android-ndk/src/lib.rs @@ -22,6 +22,3 @@ pub mod input_queue; pub mod looper; pub mod native_activity; pub mod native_window; - -#[cfg(feature = "native_app_glue")] -pub mod android_app; From 21d1401d74fa0ed9f71b46eb21f3f3f6d34391b4 Mon Sep 17 00:00:00 2001 From: David Craven Date: Mon, 17 Feb 2020 16:30:36 +0100 Subject: [PATCH 10/17] Update ci. --- .github/workflows/rust.yml | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index a2987f59..0479a9e0 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -9,11 +9,16 @@ jobs: fail-fast: false matrix: rust-channel: ['stable', 'nightly'] - rust-target: ['arm-linux-androideabi', 'armv7-linux-androideabi', 'aarch64-linux-android', 'i686-linux-android', 'x86_64-linux-android'] + rust-target: [ + 'armv7-linux-androideabi', + 'aarch64-linux-android', + 'i686-linux-android', + 'x86_64-linux-android', + ] steps: - uses: actions/checkout@v1 - + - name: Download NDK run: | curl -LO https://dl.google.com/android/repository/android-ndk-r20-linux-x86_64.zip @@ -28,13 +33,22 @@ jobs: - name: Check formating run: cargo fmt --all -- --check - - name: Check docs - run: cargo test --manifest-path android-ndk/Cargo.toml --doc --target=x86_64-unknown-linux-gnu --features rustdoc + - name: Run tests - run: cargo test --package android-ndk-sys --lib --target=x86_64-unknown-linux-gnu + run: | + cd android-ndk-sys && cargo test --features test && cd .. + cd android-ndk && cargo test --features rustdoc --doc && cd .. + cargo test -p android-build-tools + cargo test -p cargo-apk + + - name: Install cargo-apk + run: + cargo install --path cargo-apk + - name: Check compiling on target ${{ matrix.rust-target }} run: | export NDK_HOME="$GITHUB_WORKSPACE/android-ndk-r20" export CC="$NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/clang" export AR="$NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar" - cargo check --package android-ndk --target=${{ matrix.rust-target }} + cargo check -p android-ndk --target ${{ matrix.rust-target }} + cargo apk build -p android-examples --target ${{ matrix.rust-target }} --examples From 36d81dcb0f6453e5c9d793eb3dd066f23dea4148 Mon Sep 17 00:00:00 2001 From: David Craven Date: Mon, 17 Feb 2020 16:30:46 +0100 Subject: [PATCH 11/17] Update README. --- README.md | 74 +++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 61 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 6c3d79f3..4044f65f 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,66 @@ -# `android-ndk`: Rust bindings of the Android NDK +# Rust on Android -[![Build Status](https://travis-ci.org/mb64/android-ndk-rs.svg?branch=master)](https://travis-ci.org/mb64/android-ndk-rs) -[![Crates.io Status](https://meritbadge.herokuapp.com/android-ndk-sys)](https://crates.io/crates/android-ndk-sys) -[![Docs.rs Status](https://docs.rs/android-ndk-sys/badge.svg)](https://docs.rs/android-ndk-sys) -[![Crates.io Status](https://meritbadge.herokuapp.com/android-ndk)](https://crates.io/crates/android-ndk) -[![Docs.rs Status](https://docs.rs/android-ndk/badge.svg)](https://docs.rs/android-ndk) + - Raw FFI bindings to the NDK ![android-ndk-sys-docs][android-ndk-sys-badge] + - Safe abstraction of the bindings ![android-ndk-docs][android-ndk-badge] + - Startup code ![android-glue-docs][android-glue-badge] + - Everything for building apk's ![android-build-tools-docs][android-build-tools-badge] + - Build tool ![cargo-apk-docs][cargo-apk-badge] -This is a work in progress at the moment. +## Hello world -`android-ndk-sys` contains the raw FFI bindings, pre-generated from NDK r20, and `android-ndk` -provides a safe API over it. +```toml +[lib] +crate-type = ["cdylib"] +``` -Other helpful crates for Android: +```rust +#[cfg(target_os = "android")] +#[no_mangle] +pub unsafe extern "C" fn ANativeActivity_onCreate( + activity: *mut std::os::raw::c_void, + saved_state: *mut std::os::raw::c_void, + saved_state_size: usize, +) { + android_glue::init( + activity as _, + saved_state as _, + saved_state_size as _, + app_main, + ); +} - * [`jni`](https://crates.io/crates/jni), JNI bindings for Rust - * [`android_logger`](https://crates.io/crates/android_logger) and [`ndk-logger`](https://crates.io/crates/ndk-logger), - Android backends for the `log` crate +pub fn app_main() { + println!("hello world"); +} +``` + +```sh +cargo install cargo-apk +cargo apk run +``` + +## Logging and stdout +Stdout is redirected to the android log api when using `android-glue`. Any logger that logs to +stdout should therefore work. + +## JNI +TODO: talk more about jni and add some examples + +- [`jni`](https://crates.io/crates/jni), JNI bindings for Rust + +## Winit and glutin +TODO shameless plug + +## Flutter +TODO shameless plug + +[android-ndk-sys-docs]: https://docs.rs/android-ndk-sys +[android-ndk-sys-badge]: https://docs.rs/android-ndk-sys/badge.svg +[android-ndk-docs]: https://docs.rs/android-ndk +[android-ndk-badge]: https://docs.rs/android-ndk/badge.svg +[android-glue-docs]: https://docs.rs/android-glue +[android-glue-badge]: https://docs.rs/android-glue/badge.svg +[android-build-tools-docs]: https://docs.rs/android-build-tools +[android-build-tools-badge]: https://docs.rs/android-build-tools/badge.svg +[cargo-apk-docs]: https://docs.rs/cargo-apk +[cargo-apk-badge]: https://docs.rs/cargo-apk/badge.svg From 371f6d446280ec404dbf9edd150f1496ebe941ea Mon Sep 17 00:00:00 2001 From: David Craven Date: Mon, 17 Feb 2020 18:02:53 +0100 Subject: [PATCH 12/17] Support test and doc commands. --- android-build-tools/src/cargo.rs | 3 +-- android-build-tools/src/config.rs | 18 +++++++++--------- cargo-apk/src/apk.rs | 22 ++++++++++++++++++++-- cargo-apk/src/main.rs | 5 ++++- 4 files changed, 34 insertions(+), 14 deletions(-) diff --git a/android-build-tools/src/cargo.rs b/android-build-tools/src/cargo.rs index 6fbc622e..9b157734 100644 --- a/android-build-tools/src/cargo.rs +++ b/android-build-tools/src/cargo.rs @@ -3,10 +3,9 @@ use crate::ndk::Ndk; use crate::target::Target; use std::process::Command; -pub fn cargo_build(ndk: &Ndk, target: Target, sdk_version: u32) -> Result { +pub fn cargo_apk(ndk: &Ndk, target: Target, sdk_version: u32) -> Result { let triple = target.rust_triple(); let mut cargo = Command::new("cargo"); - cargo.arg("build"); let clang = ndk.clang(target, sdk_version)?; cargo.env(format!("CC_{}", triple), &clang); diff --git a/android-build-tools/src/config.rs b/android-build-tools/src/config.rs index abf29edc..68925519 100644 --- a/android-build-tools/src/config.rs +++ b/android-build-tools/src/config.rs @@ -20,17 +20,17 @@ pub struct Config { #[derive(Clone, Debug, Default, Deserialize)] pub struct Metadata { - pub(crate) target_sdk_version: Option, - pub(crate) min_sdk_version: Option, - pub(crate) icon: Option, - pub(crate) fullscreen: Option, - pub(crate) opengles_version: Option<(u8, u8)>, - pub(crate) feature: Option>, - pub(crate) permission: Option>, + pub target_sdk_version: Option, + pub min_sdk_version: Option, + pub icon: Option, + pub fullscreen: Option, + pub opengles_version: Option<(u8, u8)>, + pub feature: Option>, + pub permission: Option>, } #[derive(Clone, Debug, Deserialize)] -pub(crate) struct FeatureConfig { +pub struct FeatureConfig { name: String, required: Option, } @@ -45,7 +45,7 @@ impl From for Feature { } #[derive(Clone, Debug, Deserialize)] -pub(crate) struct PermissionConfig { +pub struct PermissionConfig { name: String, max_sdk_version: Option, } diff --git a/cargo-apk/src/apk.rs b/cargo-apk/src/apk.rs index 5401ee20..4491d029 100644 --- a/cargo-apk/src/apk.rs +++ b/cargo-apk/src/apk.rs @@ -1,7 +1,7 @@ use crate::error::Error; use crate::manifest::Manifest; use android_build_tools::apk::{Apk, ApkConfig}; -use android_build_tools::cargo::{cargo_build, VersionCode}; +use android_build_tools::cargo::{cargo_apk, VersionCode}; use android_build_tools::config::Config; use android_build_tools::error::NdkError; use android_build_tools::ndk::Ndk; @@ -75,7 +75,8 @@ impl<'a> ApkBuilder<'a> { let target_sdk_version = config.manifest.target_sdk_version; - let mut cargo = cargo_build(&config.ndk, *target, target_sdk_version)?; + let mut cargo = cargo_apk(&config.ndk, *target, target_sdk_version)?; + cargo.arg("build"); if self.cmd.target().is_none() { cargo.arg("--target").arg(target.rust_triple()); } @@ -110,4 +111,21 @@ impl<'a> ApkBuilder<'a> { Command::new("ndk-gdb").current_dir(target_dir).status()?; Ok(()) } + + pub fn default(&self) -> Result<(), Error> { + let ndk = Ndk::from_env()?; + let target_sdk_version = self + .manifest + .metadata + .target_sdk_version + .unwrap_or_else(|| ndk.default_platform()); + for target in &self.build_targets { + let mut cargo = cargo_apk(&ndk, *target, target_sdk_version)?; + cargo.args(self.cmd.args()); + if !cargo.status()?.success() { + return Err(NdkError::CmdFailed(cargo).into()); + } + } + Ok(()) + } } diff --git a/cargo-apk/src/main.rs b/cargo-apk/src/main.rs index 255e21a1..0cc54794 100644 --- a/cargo-apk/src/main.rs +++ b/cargo-apk/src/main.rs @@ -22,6 +22,9 @@ fn main() -> Result<(), ExitDisplay> { return Err(Error::invalid_args().into()); } } + "--" => { + builder.default()?; + } "gdb" => { if cmd.artifacts().len() == 1 { builder.gdb(&cmd.artifacts()[0])?; @@ -32,7 +35,7 @@ fn main() -> Result<(), ExitDisplay> { "help" => { if let Some(arg) = cmd.args().get(0) { match &**arg { - "build" | "run" => run_cargo(&cmd)?, + "build" | "run" | "test" | "doc" => run_cargo(&cmd)?, "gdb" => print_gdb_help(), _ => print_help(), } From a5c2576b9d4afcc8e930cb4a397176b55319f0b5 Mon Sep 17 00:00:00 2001 From: David Craven Date: Mon, 17 Feb 2020 20:05:28 +0100 Subject: [PATCH 13/17] Rename everything. --- .github/workflows/rust.yml | 10 +++---- Cargo.toml | 10 +++---- README.md | 28 +++++++++---------- cargo-apk/Cargo.toml | 2 +- cargo-apk/src/apk.rs | 12 ++++---- cargo-apk/src/error.rs | 2 +- cargo-apk/src/manifest.rs | 4 +-- {android-build-tools => ndk-build}/Cargo.toml | 2 +- {android-build-tools => ndk-build}/src/apk.rs | 0 .../src/cargo.rs | 0 .../src/config.rs | 0 .../src/error.rs | 0 {android-build-tools => ndk-build}/src/lib.rs | 0 .../src/manifest.rs | 0 {android-build-tools => ndk-build}/src/ndk.rs | 0 .../src/readelf.rs | 0 .../src/target.rs | 0 {android-examples => ndk-examples}/Cargo.toml | 4 +-- .../examples/hello_world.rs | 2 +- {android-examples => ndk-examples}/src/lib.rs | 0 {android-glue => ndk-glue}/Cargo.toml | 6 ++-- {android-glue => ndk-glue}/src/lib.rs | 10 +++---- {android-ndk-sys => ndk-sys}/.gitignore | 0 {android-ndk-sys => ndk-sys}/Cargo.toml | 4 +-- .../generate_bindings.sh | 0 .../src/ffi_aarch64.rs | 0 {android-ndk-sys => ndk-sys}/src/ffi_arm.rs | 0 {android-ndk-sys => ndk-sys}/src/ffi_i686.rs | 0 .../src/ffi_x86_64.rs | 0 {android-ndk-sys => ndk-sys}/src/lib.rs | 0 {android-ndk-sys => ndk-sys}/wrapper.h | 0 {android-ndk => ndk}/.gitignore | 0 {android-ndk => ndk}/Cargo.toml | 7 ++--- {android-ndk => ndk}/src/asset.rs | 0 {android-ndk => ndk}/src/configuration.rs | 0 {android-ndk => ndk}/src/event.rs | 0 {android-ndk => ndk}/src/input_queue.rs | 0 {android-ndk => ndk}/src/lib.rs | 0 {android-ndk => ndk}/src/looper.rs | 0 {android-ndk => ndk}/src/native_activity.rs | 0 {android-ndk => ndk}/src/native_window.rs | 0 41 files changed, 51 insertions(+), 52 deletions(-) rename {android-build-tools => ndk-build}/Cargo.toml (94%) rename {android-build-tools => ndk-build}/src/apk.rs (100%) rename {android-build-tools => ndk-build}/src/cargo.rs (100%) rename {android-build-tools => ndk-build}/src/config.rs (100%) rename {android-build-tools => ndk-build}/src/error.rs (100%) rename {android-build-tools => ndk-build}/src/lib.rs (100%) rename {android-build-tools => ndk-build}/src/manifest.rs (100%) rename {android-build-tools => ndk-build}/src/ndk.rs (100%) rename {android-build-tools => ndk-build}/src/readelf.rs (100%) rename {android-build-tools => ndk-build}/src/target.rs (100%) rename {android-examples => ndk-examples}/Cargo.toml (75%) rename {android-examples => ndk-examples}/examples/hello_world.rs (94%) rename {android-examples => ndk-examples}/src/lib.rs (100%) rename {android-glue => ndk-glue}/Cargo.toml (61%) rename {android-glue => ndk-glue}/src/lib.rs (96%) rename {android-ndk-sys => ndk-sys}/.gitignore (100%) rename {android-ndk-sys => ndk-sys}/Cargo.toml (91%) rename {android-ndk-sys => ndk-sys}/generate_bindings.sh (100%) rename {android-ndk-sys => ndk-sys}/src/ffi_aarch64.rs (100%) rename {android-ndk-sys => ndk-sys}/src/ffi_arm.rs (100%) rename {android-ndk-sys => ndk-sys}/src/ffi_i686.rs (100%) rename {android-ndk-sys => ndk-sys}/src/ffi_x86_64.rs (100%) rename {android-ndk-sys => ndk-sys}/src/lib.rs (100%) rename {android-ndk-sys => ndk-sys}/wrapper.h (100%) rename {android-ndk => ndk}/.gitignore (100%) rename {android-ndk => ndk}/Cargo.toml (88%) rename {android-ndk => ndk}/src/asset.rs (100%) rename {android-ndk => ndk}/src/configuration.rs (100%) rename {android-ndk => ndk}/src/event.rs (100%) rename {android-ndk => ndk}/src/input_queue.rs (100%) rename {android-ndk => ndk}/src/lib.rs (100%) rename {android-ndk => ndk}/src/looper.rs (100%) rename {android-ndk => ndk}/src/native_activity.rs (100%) rename {android-ndk => ndk}/src/native_window.rs (100%) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 0479a9e0..92c6d18d 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -36,9 +36,9 @@ jobs: - name: Run tests run: | - cd android-ndk-sys && cargo test --features test && cd .. - cd android-ndk && cargo test --features rustdoc --doc && cd .. - cargo test -p android-build-tools + cd ndk-sys && cargo test --features test && cd .. + cd ndk && cargo test --features rustdoc --doc && cd .. + cargo test -p ndk-build cargo test -p cargo-apk - name: Install cargo-apk @@ -50,5 +50,5 @@ jobs: export NDK_HOME="$GITHUB_WORKSPACE/android-ndk-r20" export CC="$NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/clang" export AR="$NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar" - cargo check -p android-ndk --target ${{ matrix.rust-target }} - cargo apk build -p android-examples --target ${{ matrix.rust-target }} --examples + cargo check -p ndk --target ${{ matrix.rust-target }} + cargo apk build -p ndk-examples --target ${{ matrix.rust-target }} --examples diff --git a/Cargo.toml b/Cargo.toml index de808c0e..36ad8a28 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,9 +1,9 @@ [workspace] members = [ - "android-build-tools", - "android-examples", - "android-glue", - "android-ndk-sys", - "android-ndk", + "ndk", + "ndk-build", + "ndk-examples", + "ndk-glue", + "ndk-sys", "cargo-apk", ] diff --git a/README.md b/README.md index 4044f65f..b0258495 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # Rust on Android - - Raw FFI bindings to the NDK ![android-ndk-sys-docs][android-ndk-sys-badge] - - Safe abstraction of the bindings ![android-ndk-docs][android-ndk-badge] - - Startup code ![android-glue-docs][android-glue-badge] - - Everything for building apk's ![android-build-tools-docs][android-build-tools-badge] + - Raw FFI bindings to the NDK ![ndk-sys-docs][ndk-sys-badge] + - Safe abstraction of the bindings ![ndk-docs][ndk-badge] + - Startup code ![ndk-glue-docs][ndk-glue-badge] + - Everything for building apk's ![ndk-build-docs][ndk-build-badge] - Build tool ![cargo-apk-docs][cargo-apk-badge] ## Hello world @@ -21,7 +21,7 @@ pub unsafe extern "C" fn ANativeActivity_onCreate( saved_state: *mut std::os::raw::c_void, saved_state_size: usize, ) { - android_glue::init( + ndk_glue::init( activity as _, saved_state as _, saved_state_size as _, @@ -40,7 +40,7 @@ cargo apk run ``` ## Logging and stdout -Stdout is redirected to the android log api when using `android-glue`. Any logger that logs to +Stdout is redirected to the android log api when using `ndk-glue`. Any logger that logs to stdout should therefore work. ## JNI @@ -54,13 +54,13 @@ TODO shameless plug ## Flutter TODO shameless plug -[android-ndk-sys-docs]: https://docs.rs/android-ndk-sys -[android-ndk-sys-badge]: https://docs.rs/android-ndk-sys/badge.svg -[android-ndk-docs]: https://docs.rs/android-ndk -[android-ndk-badge]: https://docs.rs/android-ndk/badge.svg -[android-glue-docs]: https://docs.rs/android-glue -[android-glue-badge]: https://docs.rs/android-glue/badge.svg -[android-build-tools-docs]: https://docs.rs/android-build-tools -[android-build-tools-badge]: https://docs.rs/android-build-tools/badge.svg +[ndk-sys-docs]: https://docs.rs/ndk-sys +[ndk-sys-badge]: https://docs.rs/ndk-sys/badge.svg +[ndk-docs]: https://docs.rs/ndk +[ndk-badge]: https://docs.rs/ndk/badge.svg +[ndk-glue-docs]: https://docs.rs/ndk-glue +[ndk-badge]: https://docs.rs/ndk-glue/badge.svg +[ndk-build-docs]: https://docs.rs/ndk-build +[ndk-build-badge]: https://docs.rs/ndk-build/badge.svg [cargo-apk-docs]: https://docs.rs/cargo-apk [cargo-apk-badge]: https://docs.rs/cargo-apk/badge.svg diff --git a/cargo-apk/Cargo.toml b/cargo-apk/Cargo.toml index 4f30d0d9..defe3cde 100644 --- a/cargo-apk/Cargo.toml +++ b/cargo-apk/Cargo.toml @@ -11,10 +11,10 @@ homepage = "https://github.com/rust-windowing/android-ndk-rs" repository = "https://github.com/rust-windowing/android-ndk-rs" [dependencies] -android-build-tools = { path = "../android-build-tools" } cargo-subcommand = "0.4.3" env_logger = "0.7.1" exitfailure = "0.5.1" log = "0.4.8" +ndk-build = { path = "../ndk-build" } serde = "1.0.104" toml = "0.5.6" diff --git a/cargo-apk/src/apk.rs b/cargo-apk/src/apk.rs index 4491d029..80c71491 100644 --- a/cargo-apk/src/apk.rs +++ b/cargo-apk/src/apk.rs @@ -1,12 +1,12 @@ use crate::error::Error; use crate::manifest::Manifest; -use android_build_tools::apk::{Apk, ApkConfig}; -use android_build_tools::cargo::{cargo_apk, VersionCode}; -use android_build_tools::config::Config; -use android_build_tools::error::NdkError; -use android_build_tools::ndk::Ndk; -use android_build_tools::target::Target; use cargo_subcommand::{Artifact, CrateType, Profile, Subcommand}; +use ndk_build::apk::{Apk, ApkConfig}; +use ndk_build::cargo::{cargo_apk, VersionCode}; +use ndk_build::config::Config; +use ndk_build::error::NdkError; +use ndk_build::ndk::Ndk; +use ndk_build::target::Target; use std::path::PathBuf; use std::process::Command; diff --git a/cargo-apk/src/error.rs b/cargo-apk/src/error.rs index 0a16a1ab..7a605f42 100644 --- a/cargo-apk/src/error.rs +++ b/cargo-apk/src/error.rs @@ -1,5 +1,5 @@ -use android_build_tools::error::NdkError; use cargo_subcommand::Error as SubcommandError; +use ndk_build::error::NdkError; use std::fmt::{Display, Formatter, Result}; use std::io::Error as IoError; use toml::de::Error as TomlError; diff --git a/cargo-apk/src/manifest.rs b/cargo-apk/src/manifest.rs index 207f4286..456fbea9 100644 --- a/cargo-apk/src/manifest.rs +++ b/cargo-apk/src/manifest.rs @@ -1,6 +1,6 @@ use crate::error::Error; -use android_build_tools::config::Metadata; -use android_build_tools::target::Target; +use ndk_build::config::Metadata; +use ndk_build::target::Target; use serde::Deserialize; use std::path::Path; diff --git a/android-build-tools/Cargo.toml b/ndk-build/Cargo.toml similarity index 94% rename from android-build-tools/Cargo.toml rename to ndk-build/Cargo.toml index 9bcbbce0..af25be1a 100644 --- a/android-build-tools/Cargo.toml +++ b/ndk-build/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "android-build-tools" +name = "ndk-build" version = "0.1.0" authors = ["David Craven "] edition = "2018" diff --git a/android-build-tools/src/apk.rs b/ndk-build/src/apk.rs similarity index 100% rename from android-build-tools/src/apk.rs rename to ndk-build/src/apk.rs diff --git a/android-build-tools/src/cargo.rs b/ndk-build/src/cargo.rs similarity index 100% rename from android-build-tools/src/cargo.rs rename to ndk-build/src/cargo.rs diff --git a/android-build-tools/src/config.rs b/ndk-build/src/config.rs similarity index 100% rename from android-build-tools/src/config.rs rename to ndk-build/src/config.rs diff --git a/android-build-tools/src/error.rs b/ndk-build/src/error.rs similarity index 100% rename from android-build-tools/src/error.rs rename to ndk-build/src/error.rs diff --git a/android-build-tools/src/lib.rs b/ndk-build/src/lib.rs similarity index 100% rename from android-build-tools/src/lib.rs rename to ndk-build/src/lib.rs diff --git a/android-build-tools/src/manifest.rs b/ndk-build/src/manifest.rs similarity index 100% rename from android-build-tools/src/manifest.rs rename to ndk-build/src/manifest.rs diff --git a/android-build-tools/src/ndk.rs b/ndk-build/src/ndk.rs similarity index 100% rename from android-build-tools/src/ndk.rs rename to ndk-build/src/ndk.rs diff --git a/android-build-tools/src/readelf.rs b/ndk-build/src/readelf.rs similarity index 100% rename from android-build-tools/src/readelf.rs rename to ndk-build/src/readelf.rs diff --git a/android-build-tools/src/target.rs b/ndk-build/src/target.rs similarity index 100% rename from android-build-tools/src/target.rs rename to ndk-build/src/target.rs diff --git a/android-examples/Cargo.toml b/ndk-examples/Cargo.toml similarity index 75% rename from android-examples/Cargo.toml rename to ndk-examples/Cargo.toml index d70cbb94..2932c2f1 100644 --- a/android-examples/Cargo.toml +++ b/ndk-examples/Cargo.toml @@ -1,12 +1,12 @@ [package] -name = "android-examples" +name = "ndk-examples" version = "0.1.0" authors = ["David Craven "] edition = "2018" publish = false [target.'cfg(target_os = "android")'.dependencies] -android-glue = { path = "../android-glue" } +ndk-glue = { path = "../ndk-glue" } [[example]] name = "hello_world" diff --git a/android-examples/examples/hello_world.rs b/ndk-examples/examples/hello_world.rs similarity index 94% rename from android-examples/examples/hello_world.rs rename to ndk-examples/examples/hello_world.rs index 82b1cc56..2cc1a236 100644 --- a/android-examples/examples/hello_world.rs +++ b/ndk-examples/examples/hello_world.rs @@ -6,7 +6,7 @@ pub unsafe extern "C" fn ANativeActivity_onCreate( saved_state_size: usize, ) { std::env::set_var("RUST_BACKTRACE", "1"); - android_glue::init( + ndk_glue::init( activity as _, saved_state as _, saved_state_size as _, diff --git a/android-examples/src/lib.rs b/ndk-examples/src/lib.rs similarity index 100% rename from android-examples/src/lib.rs rename to ndk-examples/src/lib.rs diff --git a/android-glue/Cargo.toml b/ndk-glue/Cargo.toml similarity index 61% rename from android-glue/Cargo.toml rename to ndk-glue/Cargo.toml index ea093023..69b7da23 100644 --- a/android-glue/Cargo.toml +++ b/ndk-glue/Cargo.toml @@ -1,13 +1,13 @@ [package] -name = "android-glue" +name = "ndk-glue" version = "0.1.0" authors = ["David Craven "] edition = "2018" [dependencies] android_log-sys = "0.1.2" -android-ndk-sys = { path = "../android-ndk-sys" } -android-ndk = { path = "../android-ndk" } +ndk = { path = "../ndk" } +ndk-sys = { path = "../ndk-sys" } lazy_static = "1.4.0" libc = "0.2.66" log = "0.4.8" diff --git a/android-glue/src/lib.rs b/ndk-glue/src/lib.rs similarity index 96% rename from android-glue/src/lib.rs rename to ndk-glue/src/lib.rs index 0b88ca6c..b367e2f8 100644 --- a/android-glue/src/lib.rs +++ b/ndk-glue/src/lib.rs @@ -1,10 +1,10 @@ -use android_ndk::input_queue::InputQueue; -use android_ndk::looper::ThreadLooper; -use android_ndk::native_activity::NativeActivity; -use android_ndk::native_window::NativeWindow; -use android_ndk_sys::{AInputQueue, ANativeActivity, ANativeWindow, ARect, ALOOPER_EVENT_INPUT}; use lazy_static::lazy_static; use log::Level; +use ndk::input_queue::InputQueue; +use ndk::looper::ThreadLooper; +use ndk::native_activity::NativeActivity; +use ndk::native_window::NativeWindow; +use ndk_sys::{AInputQueue, ANativeActivity, ANativeWindow, ARect, ALOOPER_EVENT_INPUT}; use std::ffi::{CStr, CString}; use std::fs::File; use std::io::{BufRead, BufReader}; diff --git a/android-ndk-sys/.gitignore b/ndk-sys/.gitignore similarity index 100% rename from android-ndk-sys/.gitignore rename to ndk-sys/.gitignore diff --git a/android-ndk-sys/Cargo.toml b/ndk-sys/Cargo.toml similarity index 91% rename from android-ndk-sys/Cargo.toml rename to ndk-sys/Cargo.toml index d210571c..8c9e1bb8 100644 --- a/android-ndk-sys/Cargo.toml +++ b/ndk-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "android-ndk-sys" -version = "0.2.1" +name = "ndk-sys" +version = "0.1.0" authors = ["Mark Barbone "] edition = "2018" description = "FFI bindings for the Android NDK" diff --git a/android-ndk-sys/generate_bindings.sh b/ndk-sys/generate_bindings.sh similarity index 100% rename from android-ndk-sys/generate_bindings.sh rename to ndk-sys/generate_bindings.sh diff --git a/android-ndk-sys/src/ffi_aarch64.rs b/ndk-sys/src/ffi_aarch64.rs similarity index 100% rename from android-ndk-sys/src/ffi_aarch64.rs rename to ndk-sys/src/ffi_aarch64.rs diff --git a/android-ndk-sys/src/ffi_arm.rs b/ndk-sys/src/ffi_arm.rs similarity index 100% rename from android-ndk-sys/src/ffi_arm.rs rename to ndk-sys/src/ffi_arm.rs diff --git a/android-ndk-sys/src/ffi_i686.rs b/ndk-sys/src/ffi_i686.rs similarity index 100% rename from android-ndk-sys/src/ffi_i686.rs rename to ndk-sys/src/ffi_i686.rs diff --git a/android-ndk-sys/src/ffi_x86_64.rs b/ndk-sys/src/ffi_x86_64.rs similarity index 100% rename from android-ndk-sys/src/ffi_x86_64.rs rename to ndk-sys/src/ffi_x86_64.rs diff --git a/android-ndk-sys/src/lib.rs b/ndk-sys/src/lib.rs similarity index 100% rename from android-ndk-sys/src/lib.rs rename to ndk-sys/src/lib.rs diff --git a/android-ndk-sys/wrapper.h b/ndk-sys/wrapper.h similarity index 100% rename from android-ndk-sys/wrapper.h rename to ndk-sys/wrapper.h diff --git a/android-ndk/.gitignore b/ndk/.gitignore similarity index 100% rename from android-ndk/.gitignore rename to ndk/.gitignore diff --git a/android-ndk/Cargo.toml b/ndk/Cargo.toml similarity index 88% rename from android-ndk/Cargo.toml rename to ndk/Cargo.toml index 617081f8..ab5e8fac 100644 --- a/android-ndk/Cargo.toml +++ b/ndk/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "android-ndk" +name = "ndk" version = "0.1.0" authors = ["Mark Barbone "] edition = "2018" @@ -30,6 +30,5 @@ version = "0.0.10" optional = true [dependencies.ffi] -package = "android-ndk-sys" -path = "../android-ndk-sys" -version = "0.2" +package = "ndk-sys" +path = "../ndk-sys" diff --git a/android-ndk/src/asset.rs b/ndk/src/asset.rs similarity index 100% rename from android-ndk/src/asset.rs rename to ndk/src/asset.rs diff --git a/android-ndk/src/configuration.rs b/ndk/src/configuration.rs similarity index 100% rename from android-ndk/src/configuration.rs rename to ndk/src/configuration.rs diff --git a/android-ndk/src/event.rs b/ndk/src/event.rs similarity index 100% rename from android-ndk/src/event.rs rename to ndk/src/event.rs diff --git a/android-ndk/src/input_queue.rs b/ndk/src/input_queue.rs similarity index 100% rename from android-ndk/src/input_queue.rs rename to ndk/src/input_queue.rs diff --git a/android-ndk/src/lib.rs b/ndk/src/lib.rs similarity index 100% rename from android-ndk/src/lib.rs rename to ndk/src/lib.rs diff --git a/android-ndk/src/looper.rs b/ndk/src/looper.rs similarity index 100% rename from android-ndk/src/looper.rs rename to ndk/src/looper.rs diff --git a/android-ndk/src/native_activity.rs b/ndk/src/native_activity.rs similarity index 100% rename from android-ndk/src/native_activity.rs rename to ndk/src/native_activity.rs diff --git a/android-ndk/src/native_window.rs b/ndk/src/native_window.rs similarity index 100% rename from android-ndk/src/native_window.rs rename to ndk/src/native_window.rs From 49b3110c3b7aaa1272f81f39194ded293f403de6 Mon Sep 17 00:00:00 2001 From: David Craven Date: Wed, 19 Feb 2020 08:44:43 +0100 Subject: [PATCH 14/17] Add ndk_glue macro. --- README.md | 18 +++--------------- ndk-examples/examples/hello_world.rs | 17 ++--------------- ndk-glue/src/lib.rs | 20 ++++++++++++++++++++ 3 files changed, 25 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index b0258495..e598dab9 100644 --- a/README.md +++ b/README.md @@ -10,26 +10,14 @@ ```toml [lib] -crate-type = ["cdylib"] +crate-type = ["lib", "cdylib"] ``` ```rust #[cfg(target_os = "android")] -#[no_mangle] -pub unsafe extern "C" fn ANativeActivity_onCreate( - activity: *mut std::os::raw::c_void, - saved_state: *mut std::os::raw::c_void, - saved_state_size: usize, -) { - ndk_glue::init( - activity as _, - saved_state as _, - saved_state_size as _, - app_main, - ); -} +ndk_glue::ndk_glue!(main); -pub fn app_main() { +fn main() { println!("hello world"); } ``` diff --git a/ndk-examples/examples/hello_world.rs b/ndk-examples/examples/hello_world.rs index 2cc1a236..8540c5e5 100644 --- a/ndk-examples/examples/hello_world.rs +++ b/ndk-examples/examples/hello_world.rs @@ -1,19 +1,6 @@ #[cfg(target_os = "android")] -#[no_mangle] -pub unsafe extern "C" fn ANativeActivity_onCreate( - activity: *mut std::os::raw::c_void, - saved_state: *mut std::os::raw::c_void, - saved_state_size: usize, -) { - std::env::set_var("RUST_BACKTRACE", "1"); - ndk_glue::init( - activity as _, - saved_state as _, - saved_state_size as _, - app_main, - ); -} +ndk_glue::ndk_glue!(main); -pub fn app_main() { +fn main() { println!("hello world"); } diff --git a/ndk-glue/src/lib.rs b/ndk-glue/src/lib.rs index b367e2f8..1afcd98d 100644 --- a/ndk-glue/src/lib.rs +++ b/ndk-glue/src/lib.rs @@ -14,6 +14,26 @@ use std::ptr::NonNull; use std::sync::{RwLock, RwLockReadGuard}; use std::thread; +#[macro_export] +macro_rules! ndk_glue { + ($main:ident) => { + #[no_mangle] + unsafe extern "C" fn ANativeActivity_onCreate( + activity: *mut std::os::raw::c_void, + saved_state: *mut std::os::raw::c_void, + saved_state_size: usize, + ) { + std::env::set_var("RUST_BACKTRACE", "1"); + $crate::init( + activity as _, + saved_state as _, + saved_state_size as _, + $main, + ); + } + }; +} + pub fn android_log(level: Level, tag: &CStr, msg: &CStr) { use android_log_sys::LogPriority; let prio = match level { From 3d8e2b706bcd0e80428c48a3d5192441977b9ec8 Mon Sep 17 00:00:00 2001 From: David Craven Date: Wed, 19 Feb 2020 09:34:34 +0100 Subject: [PATCH 15/17] Update cargo-subcommand. --- cargo-apk/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cargo-apk/Cargo.toml b/cargo-apk/Cargo.toml index defe3cde..86db1d3d 100644 --- a/cargo-apk/Cargo.toml +++ b/cargo-apk/Cargo.toml @@ -11,7 +11,7 @@ homepage = "https://github.com/rust-windowing/android-ndk-rs" repository = "https://github.com/rust-windowing/android-ndk-rs" [dependencies] -cargo-subcommand = "0.4.3" +cargo-subcommand = "0.4.4" env_logger = "0.7.1" exitfailure = "0.5.1" log = "0.4.8" From e78acbbbd356429797bda646b8b351090a852236 Mon Sep 17 00:00:00 2001 From: David Craven Date: Wed, 19 Feb 2020 10:30:47 +0100 Subject: [PATCH 16/17] Update README. --- README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e598dab9..4dd9257f 100644 --- a/README.md +++ b/README.md @@ -7,21 +7,29 @@ - Build tool ![cargo-apk-docs][cargo-apk-badge] ## Hello world - +`Cargo.toml` ```toml [lib] crate-type = ["lib", "cdylib"] ``` +`src/lib.rs` ```rust #[cfg(target_os = "android")] ndk_glue::ndk_glue!(main); -fn main() { +pub fn main() { println!("hello world"); } ``` +`src/main.rs` +```rust +fn main() { + $crate::main(); +} +``` + ```sh cargo install cargo-apk cargo apk run From f0f79fae5fef8ef21577a8f53377c4e937bf6edc Mon Sep 17 00:00:00 2001 From: David Craven Date: Wed, 19 Feb 2020 16:05:42 +0100 Subject: [PATCH 17/17] Fix panic on exit. --- ndk-glue/src/lib.rs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/ndk-glue/src/lib.rs b/ndk-glue/src/lib.rs index 1afcd98d..6969d634 100644 --- a/ndk-glue/src/lib.rs +++ b/ndk-glue/src/lib.rs @@ -1,7 +1,7 @@ use lazy_static::lazy_static; use log::Level; use ndk::input_queue::InputQueue; -use ndk::looper::ThreadLooper; +use ndk::looper::{ForeignLooper, ThreadLooper}; use ndk::native_activity::NativeActivity; use ndk::native_window::NativeWindow; use ndk_sys::{AInputQueue, ANativeActivity, ANativeWindow, ARect, ALOOPER_EVENT_INPUT}; @@ -59,6 +59,7 @@ lazy_static! { } static mut NATIVE_ACTIVITY: Option = None; +static mut LOOPER: Option = None; pub fn native_activity() -> &'static NativeActivity { unsafe { NATIVE_ACTIVITY.as_ref().unwrap() } @@ -186,10 +187,11 @@ pub unsafe fn init( thread::spawn(move || { let looper = ThreadLooper::prepare(); - looper - .as_foreign() + let foreign = looper.into_foreign(); + foreign .add_fd(PIPE[0], 0, ALOOPER_EVENT_INPUT as _, 0 as _) .unwrap(); + LOOPER = Some(foreign); main() }); } @@ -274,14 +276,19 @@ unsafe extern "C" fn on_input_queue_created( activity: *mut ANativeActivity, queue: *mut AInputQueue, ) { - *INPUT_QUEUE.write().unwrap() = Some(InputQueue::from_ptr(NonNull::new(queue).unwrap())); + let input_queue = InputQueue::from_ptr(NonNull::new(queue).unwrap()); + let looper = LOOPER.as_ref().unwrap(); + input_queue.attach_looper(looper, 1); + *INPUT_QUEUE.write().unwrap() = Some(input_queue); wake(activity, Event::InputQueueCreated); } unsafe extern "C" fn on_input_queue_destroyed( activity: *mut ANativeActivity, - _queue: *mut AInputQueue, + queue: *mut AInputQueue, ) { + let input_queue = InputQueue::from_ptr(NonNull::new(queue).unwrap()); + input_queue.detach_looper(); *INPUT_QUEUE.write().unwrap() = None; wake(activity, Event::InputQueueDestroyed); }