diff --git a/.travis.yml b/.travis.yml index 4697a97..3f9895c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: rust rust: - - nightly-2018-08-18 + - nightly-2019-01-16 install: - set -eo pipefail diff --git a/citro2d-sys/Cargo.toml b/citro2d-sys/Cargo.toml new file mode 100644 index 0000000..aecc672 --- /dev/null +++ b/citro2d-sys/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "citro3d-sys" +version = "0.1.0" +authors = ["Charlotte D. "] + +[dependencies.libc] +version = "0.2.43" +default-features = false +optional = true + +[features] +default = ["libc"] diff --git a/citro2d-sys/bindgen.sh b/citro2d-sys/bindgen.sh new file mode 100644 index 0000000..0f3af2e --- /dev/null +++ b/citro2d-sys/bindgen.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash + +clang_version=$1 + +if [ -z "$clang_version" ]; then + echo " usage: ./bindgen.sh " + echo "example: ./bindgen.sh 5.0.0" + echo "Check your current version with \`clang -v\`." + exit 1 +fi + +set -euxo pipefail + +bindgen "$DEVKITPRO/libctru/include/citro2d.h" \ + --rust-target nightly \ + --use-core \ + --distrust-clang-mangling \ + --no-doc-comments \ + --no-layout-tests \ + --ctypes-prefix "::libc" \ + --no-prepend-enum-name \ + --generate "functions,types,vars" \ + --blacklist-type "u(8|16|32|64)" \ + --blacklist-type "__builtin_va_list" \ + --blacklist-type "__va_list" \ + -- \ + --target=arm-none-eabi \ + --sysroot=$DEVKITARM/arm-none-eabi \ + -isystem$DEVKITARM/arm-none-eabi/include \ + -isystem/usr/lib/clang/$clang_version/include \ + -I$DEVKITPRO/libctru/include \ + -mfloat-abi=hard \ + -march=armv6k \ + -mtune=mpcore \ + -mfpu=vfp \ + -DARM11 \ + -D_3DS \ +> src/bindings.rs + diff --git a/citro2d-sys/build.rs b/citro2d-sys/build.rs new file mode 100644 index 0000000..857ad4c --- /dev/null +++ b/citro2d-sys/build.rs @@ -0,0 +1,12 @@ +use std::env; + +fn main() { + let dkp_path = env::var("DEVKITPRO").unwrap(); + + println!("cargo:rustc-link-search=native={}/libctru/lib", dkp_path); + println!("cargo:rustc-link-lib=static={}", match env::var("PROFILE").unwrap().as_str() { + "debug" => "citro2dd", + _ => "citro2d", + }); +} + diff --git a/citro2d-sys/src/bindings.rs b/citro2d-sys/src/bindings.rs new file mode 100644 index 0000000..41f80a5 --- /dev/null +++ b/citro2d-sys/src/bindings.rs @@ -0,0 +1,14176 @@ +/* automatically generated by rust-bindgen */ + +#[repr(C)] +#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] +pub struct __BindgenBitfieldUnit +where + Storage: AsRef<[u8]> + AsMut<[u8]>, +{ + storage: Storage, + align: [Align; 0], +} +impl __BindgenBitfieldUnit +where + Storage: AsRef<[u8]> + AsMut<[u8]>, +{ + #[inline] + pub fn new(storage: Storage) -> Self { + Self { storage, align: [] } + } + #[inline] + pub fn get_bit(&self, index: usize) -> bool { + debug_assert!(index / 8 < self.storage.as_ref().len()); + let byte_index = index / 8; + let byte = self.storage.as_ref()[byte_index]; + let bit_index = if cfg!(target_endian = "big") { + 7 - (index % 8) + } else { + index % 8 + }; + let mask = 1 << bit_index; + byte & mask == mask + } + #[inline] + pub fn set_bit(&mut self, index: usize, val: bool) { + debug_assert!(index / 8 < self.storage.as_ref().len()); + let byte_index = index / 8; + let byte = &mut self.storage.as_mut()[byte_index]; + let bit_index = if cfg!(target_endian = "big") { + 7 - (index % 8) + } else { + index % 8 + }; + let mask = 1 << bit_index; + if val { + *byte |= mask; + } else { + *byte &= !mask; + } + } + #[inline] + pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { + debug_assert!(bit_width <= 64); + debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); + debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + let mut val = 0; + for i in 0..(bit_width as usize) { + if self.get_bit(i + bit_offset) { + let index = if cfg!(target_endian = "big") { + bit_width as usize - 1 - i + } else { + i + }; + val |= 1 << index; + } + } + val + } + #[inline] + pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { + debug_assert!(bit_width <= 64); + debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); + debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + for i in 0..(bit_width as usize) { + let mask = 1 << i; + let val_bit_is_set = val & mask == mask; + let index = if cfg!(target_endian = "big") { + bit_width as usize - 1 - i + } else { + i + }; + self.set_bit(index + bit_offset, val_bit_is_set); + } + } +} +#[repr(C)] +#[derive(Default)] +pub struct __IncompleteArrayField(::core::marker::PhantomData, [T; 0]); +impl __IncompleteArrayField { + #[inline] + pub fn new() -> Self { + __IncompleteArrayField(::core::marker::PhantomData, []) + } + #[inline] + pub unsafe fn as_ptr(&self) -> *const T { + ::core::mem::transmute(self) + } + #[inline] + pub unsafe fn as_mut_ptr(&mut self) -> *mut T { + ::core::mem::transmute(self) + } + #[inline] + pub unsafe fn as_slice(&self, len: usize) -> &[T] { + ::core::slice::from_raw_parts(self.as_ptr(), len) + } + #[inline] + pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { + ::core::slice::from_raw_parts_mut(self.as_mut_ptr(), len) + } +} +impl ::core::fmt::Debug for __IncompleteArrayField { + fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fmt.write_str("__IncompleteArrayField") + } +} +impl ::core::clone::Clone for __IncompleteArrayField { + #[inline] + fn clone(&self) -> Self { + Self::new() + } +} +#[repr(C)] +pub struct __BindgenUnionField(::core::marker::PhantomData); +impl __BindgenUnionField { + #[inline] + pub fn new() -> Self { + __BindgenUnionField(::core::marker::PhantomData) + } + #[inline] + pub unsafe fn as_ref(&self) -> &T { + ::core::mem::transmute(self) + } + #[inline] + pub unsafe fn as_mut(&mut self) -> &mut T { + ::core::mem::transmute(self) + } +} +impl ::core::default::Default for __BindgenUnionField { + #[inline] + fn default() -> Self { + Self::new() + } +} +impl ::core::clone::Clone for __BindgenUnionField { + #[inline] + fn clone(&self) -> Self { + Self::new() + } +} +impl ::core::marker::Copy for __BindgenUnionField {} +impl ::core::fmt::Debug for __BindgenUnionField { + fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fmt.write_str("__BindgenUnionField") + } +} +impl ::core::hash::Hash for __BindgenUnionField { + fn hash(&self, _state: &mut H) {} +} +impl ::core::cmp::PartialEq for __BindgenUnionField { + fn eq(&self, _other: &__BindgenUnionField) -> bool { + true + } +} +impl ::core::cmp::Eq for __BindgenUnionField {} +pub const _NEWLIB_VERSION_H__: u32 = 1; +pub const _NEWLIB_VERSION: &'static [u8; 6usize] = b"3.1.0\0"; +pub const __NEWLIB__: u32 = 3; +pub const __NEWLIB_MINOR__: u32 = 1; +pub const __NEWLIB_PATCHLEVEL__: u32 = 0; +pub const _DEFAULT_SOURCE: u32 = 1; +pub const _POSIX_SOURCE: u32 = 1; +pub const _POSIX_C_SOURCE: u32 = 200809; +pub const _ATFILE_SOURCE: u32 = 1; +pub const __ATFILE_VISIBLE: u32 = 1; +pub const __BSD_VISIBLE: u32 = 1; +pub const __GNU_VISIBLE: u32 = 0; +pub const __ISO_C_VISIBLE: u32 = 2011; +pub const __LARGEFILE_VISIBLE: u32 = 0; +pub const __MISC_VISIBLE: u32 = 1; +pub const __POSIX_VISIBLE: u32 = 200809; +pub const __SVID_VISIBLE: u32 = 1; +pub const __XSI_VISIBLE: u32 = 0; +pub const __SSP_FORTIFY_LEVEL: u32 = 0; +pub const _POSIX_MONOTONIC_CLOCK: u32 = 200112; +pub const _POSIX_TIMERS: u32 = 1; +pub const __have_longlong64: u32 = 1; +pub const __have_long32: u32 = 1; +pub const ___int8_t_defined: u32 = 1; +pub const ___int16_t_defined: u32 = 1; +pub const ___int32_t_defined: u32 = 1; +pub const ___int64_t_defined: u32 = 1; +pub const ___int_least8_t_defined: u32 = 1; +pub const ___int_least16_t_defined: u32 = 1; +pub const ___int_least32_t_defined: u32 = 1; +pub const ___int_least64_t_defined: u32 = 1; +pub const __int20: u32 = 2; +pub const __INT8: &'static [u8; 3usize] = b"hh\0"; +pub const __INT16: &'static [u8; 2usize] = b"h\0"; +pub const __INT64: &'static [u8; 3usize] = b"ll\0"; +pub const __FAST8: &'static [u8; 3usize] = b"hh\0"; +pub const __FAST16: &'static [u8; 2usize] = b"h\0"; +pub const __FAST64: &'static [u8; 3usize] = b"ll\0"; +pub const __LEAST8: &'static [u8; 3usize] = b"hh\0"; +pub const __LEAST16: &'static [u8; 2usize] = b"h\0"; +pub const __LEAST64: &'static [u8; 3usize] = b"ll\0"; +pub const __int8_t_defined: u32 = 1; +pub const __int16_t_defined: u32 = 1; +pub const __int32_t_defined: u32 = 1; +pub const __int64_t_defined: u32 = 1; +pub const __int_least8_t_defined: u32 = 1; +pub const __int_least16_t_defined: u32 = 1; +pub const __int_least32_t_defined: u32 = 1; +pub const __int_least64_t_defined: u32 = 1; +pub const __int_fast8_t_defined: u32 = 1; +pub const __int_fast16_t_defined: u32 = 1; +pub const __int_fast32_t_defined: u32 = 1; +pub const __int_fast64_t_defined: u32 = 1; +pub const WINT_MIN: u32 = 0; +pub const true_: u32 = 1; +pub const false_: u32 = 0; +pub const __bool_true_false_are_defined: u32 = 1; +pub const CUR_PROCESS_HANDLE: u32 = 4294934529; +pub const ARBITRATION_SIGNAL_ALL: i32 = -1; +pub const CUR_THREAD_HANDLE: u32 = 4294934528; +pub const SYSCLOCK_SOC: u32 = 16756991; +pub const SYSCLOCK_ARM9: u32 = 134055928; +pub const SYSCLOCK_ARM11: u32 = 268111856; +pub const SYSCLOCK_ARM11_NEW: u32 = 804335568; +pub const CPU_TICKS_PER_MSEC: f64 = 268111.856; +pub const CPU_TICKS_PER_USEC: f64 = 268.111856; +pub const __NEWLIB_H__: u32 = 1; +pub const _WANT_IO_C99_FORMATS: u32 = 1; +pub const _WANT_IO_LONG_LONG: u32 = 1; +pub const _WANT_IO_POS_ARGS: u32 = 1; +pub const _MB_CAPABLE: u32 = 1; +pub const _MB_LEN_MAX: u32 = 8; +pub const HAVE_INITFINI_ARRAY: u32 = 1; +pub const _ATEXIT_DYNAMIC_ALLOC: u32 = 1; +pub const _HAVE_LONG_DOUBLE: u32 = 1; +pub const _HAVE_CC_INHIBIT_LOOP_TO_LIBCALL: u32 = 1; +pub const _LDBL_EQ_DBL: u32 = 1; +pub const _FVWRITE_IN_STREAMIO: u32 = 1; +pub const _FSEEK_OPTIMIZATION: u32 = 1; +pub const _UNBUF_STREAM_OPT: u32 = 1; +pub const __OBSOLETE_MATH_DEFAULT: u32 = 0; +pub const __OBSOLETE_MATH: u32 = 0; +pub const __RAND_MAX: u32 = 2147483647; +pub const CONSOLE_COLOR_BOLD: u32 = 1; +pub const CONSOLE_COLOR_FAINT: u32 = 2; +pub const CONSOLE_ITALIC: u32 = 4; +pub const CONSOLE_UNDERLINE: u32 = 8; +pub const CONSOLE_BLINK_SLOW: u32 = 16; +pub const CONSOLE_BLINK_FAST: u32 = 32; +pub const CONSOLE_COLOR_REVERSE: u32 = 64; +pub const CONSOLE_CONCEAL: u32 = 128; +pub const CONSOLE_CROSSED_OUT: u32 = 256; +pub const __GNUCLIKE_ASM: u32 = 3; +pub const __GNUCLIKE___TYPEOF: u32 = 1; +pub const __GNUCLIKE___OFFSETOF: u32 = 1; +pub const __GNUCLIKE___SECTION: u32 = 1; +pub const __GNUCLIKE_CTOR_SECTION_HANDLING: u32 = 1; +pub const __GNUCLIKE_BUILTIN_CONSTANT_P: u32 = 1; +pub const __GNUCLIKE_BUILTIN_VARARGS: u32 = 1; +pub const __GNUCLIKE_BUILTIN_STDARG: u32 = 1; +pub const __GNUCLIKE_BUILTIN_VAALIST: u32 = 1; +pub const __GNUC_VA_LIST_COMPATIBILITY: u32 = 1; +pub const __GNUCLIKE_BUILTIN_NEXT_ARG: u32 = 1; +pub const __GNUCLIKE_BUILTIN_MEMCPY: u32 = 1; +pub const __CC_SUPPORTS_INLINE: u32 = 1; +pub const __CC_SUPPORTS___INLINE: u32 = 1; +pub const __CC_SUPPORTS___INLINE__: u32 = 1; +pub const __CC_SUPPORTS___FUNC__: u32 = 1; +pub const __CC_SUPPORTS_WARNING: u32 = 1; +pub const __CC_SUPPORTS_VARADIC_XXX: u32 = 1; +pub const __CC_SUPPORTS_DYNAMIC_ARRAY_INIT: u32 = 1; +pub const __BIT_TYPES_DEFINED__: u32 = 1; +pub const _LITTLE_ENDIAN: u32 = 1234; +pub const _BIG_ENDIAN: u32 = 4321; +pub const _PDP_ENDIAN: u32 = 3412; +pub const _BYTE_ORDER: u32 = 1234; +pub const _QUAD_HIGHWORD: u32 = 1; +pub const _QUAD_LOWWORD: u32 = 0; +pub const LITTLE_ENDIAN: u32 = 1234; +pub const BIG_ENDIAN: u32 = 4321; +pub const PDP_ENDIAN: u32 = 3412; +pub const BYTE_ORDER: u32 = 1234; +pub const FD_SETSIZE: u32 = 64; +pub const SCHED_OTHER: u32 = 0; +pub const SCHED_FIFO: u32 = 1; +pub const SCHED_RR: u32 = 2; +pub const PTHREAD_SCOPE_PROCESS: u32 = 0; +pub const PTHREAD_SCOPE_SYSTEM: u32 = 1; +pub const PTHREAD_INHERIT_SCHED: u32 = 1; +pub const PTHREAD_EXPLICIT_SCHED: u32 = 2; +pub const PTHREAD_CREATE_DETACHED: u32 = 0; +pub const PTHREAD_CREATE_JOINABLE: u32 = 1; +pub const CSND_NUM_CHANNELS: u32 = 32; +pub const FRIEND_SCREEN_NAME_SIZE: u32 = 11; +pub const FRIEND_COMMENT_SIZE: u32 = 33; +pub const FRIEND_LIST_SIZE: u32 = 100; +pub const HTTPC_RESULTCODE_DOWNLOADPENDING: u32 = 3628113963; +pub const HTTPC_RESULTCODE_NOTFOUND: u32 = 3628113960; +pub const HTTPC_RESULTCODE_TIMEDOUT: u32 = 3626016873; +pub const UDS_MAXNODES: u32 = 16; +pub const UDS_BROADCAST_NETWORKNODEID: u32 = 65535; +pub const UDS_HOST_NETWORKNODEID: u32 = 1; +pub const UDS_DEFAULT_RECVBUFSIZE: u32 = 11824; +pub const UDS_DATAFRAME_MAXSIZE: u32 = 1478; +pub const DST_NONE: u32 = 0; +pub const DST_USA: u32 = 1; +pub const DST_AUST: u32 = 2; +pub const DST_WET: u32 = 3; +pub const DST_MET: u32 = 4; +pub const DST_EET: u32 = 5; +pub const DST_CAN: u32 = 6; +pub const SBT_MAX: u64 = 9223372036854775807; +pub const ITIMER_REAL: u32 = 0; +pub const ITIMER_VIRTUAL: u32 = 1; +pub const ITIMER_PROF: u32 = 2; +pub const _NULL: u32 = 0; +pub const _ATEXIT_SIZE: u32 = 32; +pub const _RAND48_SEED_0: u32 = 13070; +pub const _RAND48_SEED_1: u32 = 43981; +pub const _RAND48_SEED_2: u32 = 4660; +pub const _RAND48_MULT_0: u32 = 58989; +pub const _RAND48_MULT_1: u32 = 57068; +pub const _RAND48_MULT_2: u32 = 5; +pub const _RAND48_ADD: u32 = 11; +pub const _REENT_EMERGENCY_SIZE: u32 = 25; +pub const _REENT_ASCTIME_SIZE: u32 = 26; +pub const _REENT_SIGNAL_SIZE: u32 = 24; +pub const _N_LISTS: u32 = 30; +pub const _CLOCKS_PER_SEC_: u32 = 100; +pub const CLOCKS_PER_SEC: u32 = 100; +pub const CLK_TCK: u32 = 100; +pub const SIGEV_NONE: u32 = 1; +pub const SIGEV_SIGNAL: u32 = 2; +pub const SIGEV_THREAD: u32 = 3; +pub const SI_USER: u32 = 1; +pub const SI_QUEUE: u32 = 2; +pub const SI_TIMER: u32 = 3; +pub const SI_ASYNCIO: u32 = 4; +pub const SI_MESGQ: u32 = 5; +pub const SA_NOCLDSTOP: u32 = 1; +pub const MINSIGSTKSZ: u32 = 2048; +pub const SIGSTKSZ: u32 = 8192; +pub const SS_ONSTACK: u32 = 1; +pub const SS_DISABLE: u32 = 2; +pub const SIG_SETMASK: u32 = 0; +pub const SIG_BLOCK: u32 = 1; +pub const SIG_UNBLOCK: u32 = 2; +pub const SIGHUP: u32 = 1; +pub const SIGINT: u32 = 2; +pub const SIGQUIT: u32 = 3; +pub const SIGILL: u32 = 4; +pub const SIGTRAP: u32 = 5; +pub const SIGIOT: u32 = 6; +pub const SIGABRT: u32 = 6; +pub const SIGEMT: u32 = 7; +pub const SIGFPE: u32 = 8; +pub const SIGKILL: u32 = 9; +pub const SIGBUS: u32 = 10; +pub const SIGSEGV: u32 = 11; +pub const SIGSYS: u32 = 12; +pub const SIGPIPE: u32 = 13; +pub const SIGALRM: u32 = 14; +pub const SIGTERM: u32 = 15; +pub const SIGURG: u32 = 16; +pub const SIGSTOP: u32 = 17; +pub const SIGTSTP: u32 = 18; +pub const SIGCONT: u32 = 19; +pub const SIGCHLD: u32 = 20; +pub const SIGCLD: u32 = 20; +pub const SIGTTIN: u32 = 21; +pub const SIGTTOU: u32 = 22; +pub const SIGIO: u32 = 23; +pub const SIGPOLL: u32 = 23; +pub const SIGXCPU: u32 = 24; +pub const SIGXFSZ: u32 = 25; +pub const SIGVTALRM: u32 = 26; +pub const SIGPROF: u32 = 27; +pub const SIGWINCH: u32 = 28; +pub const SIGLOST: u32 = 29; +pub const SIGUSR1: u32 = 30; +pub const SIGUSR2: u32 = 31; +pub const NSIG: u32 = 32; +pub const CLOCK_ENABLED: u32 = 1; +pub const CLOCK_DISABLED: u32 = 0; +pub const CLOCK_ALLOWED: u32 = 1; +pub const CLOCK_DISALLOWED: u32 = 0; +pub const TIMER_ABSTIME: u32 = 4; +pub const SOL_SOCKET: u32 = 65535; +pub const PF_UNSPEC: u32 = 0; +pub const PF_INET: u32 = 2; +pub const PF_INET6: u32 = 23; +pub const AF_UNSPEC: u32 = 0; +pub const AF_INET: u32 = 2; +pub const AF_INET6: u32 = 23; +pub const SOCK_STREAM: u32 = 1; +pub const SOCK_DGRAM: u32 = 2; +pub const MSG_OOB: u32 = 1; +pub const MSG_PEEK: u32 = 2; +pub const MSG_DONTWAIT: u32 = 4; +pub const MSG_DONTROUTE: u32 = 0; +pub const MSG_WAITALL: u32 = 0; +pub const MSG_MORE: u32 = 0; +pub const MSG_NOSIGNAL: u32 = 0; +pub const SHUT_RD: u32 = 0; +pub const SHUT_WR: u32 = 1; +pub const SHUT_RDWR: u32 = 2; +pub const SO_REUSEADDR: u32 = 4; +pub const SO_LINGER: u32 = 128; +pub const SO_OOBINLINE: u32 = 256; +pub const SO_SNDBUF: u32 = 4097; +pub const SO_RCVBUF: u32 = 4098; +pub const SO_SNDLOWAT: u32 = 4099; +pub const SO_RCVLOWAT: u32 = 4100; +pub const SO_TYPE: u32 = 4104; +pub const SO_ERROR: u32 = 4105; +pub const INADDR_LOOPBACK: u32 = 2130706433; +pub const INADDR_ANY: u32 = 0; +pub const INADDR_BROADCAST: u32 = 4294967295; +pub const INADDR_NONE: u32 = 4294967295; +pub const INET_ADDRSTRLEN: u32 = 16; +pub const IPPROTO_IP: u32 = 0; +pub const IPPROTO_UDP: u32 = 17; +pub const IPPROTO_TCP: u32 = 6; +pub const IP_TOS: u32 = 7; +pub const IP_TTL: u32 = 8; +pub const IP_MULTICAST_LOOP: u32 = 9; +pub const IP_MULTICAST_TTL: u32 = 10; +pub const IP_ADD_MEMBERSHIP: u32 = 11; +pub const IP_DROP_MEMBERSHIP: u32 = 12; +pub const SOL_CONFIG: u32 = 65534; +pub const ROUTING_FLAG_G: u32 = 1; +pub const TCP_STATE_CLOSED: u32 = 1; +pub const TCP_STATE_LISTEN: u32 = 2; +pub const TCP_STATE_ESTABLISHED: u32 = 5; +pub const TCP_STATE_FINWAIT1: u32 = 6; +pub const TCP_STATE_FINWAIT2: u32 = 7; +pub const TCP_STATE_CLOSE_WAIT: u32 = 8; +pub const TCP_STATE_LAST_ACK: u32 = 9; +pub const TCP_STATE_TIME_WAIT: u32 = 11; +pub const MVD_STATUS_OK: u32 = 94208; +pub const MVD_STATUS_PARAMSET: u32 = 94209; +pub const MVD_STATUS_BUSY: u32 = 94210; +pub const MVD_STATUS_FRAMEREADY: u32 = 94211; +pub const MVD_STATUS_INCOMPLETEPROCESSING: u32 = 94212; +pub const MVD_STATUS_NALUPROCFLAG: u32 = 94215; +pub const MVD_DEFAULT_WORKBUF_SIZE: u32 = 9438920; +pub const NFC_ERR_INVALID_STATE: u32 = 3366024704; +pub const NFC_ERR_APPDATA_UNINITIALIZED: u32 = 3366024736; +pub const NFC_ERR_AMIIBO_NOTSETUP: u32 = 3366024744; +pub const NFC_ERR_APPID_MISMATCH: u32 = 3366024760; +pub const NFC_ERR_DATACORRUPTION0: u32 = 3368121868; +pub const NFC_ERR_DATACORRUPTION1: u32 = 3366024728; +pub const NFC_STARTSCAN_DEFAULTINPUT: u32 = 0; +pub const GPUREG_0000: u32 = 0; +pub const GPUREG_0001: u32 = 1; +pub const GPUREG_0002: u32 = 2; +pub const GPUREG_0003: u32 = 3; +pub const GPUREG_0004: u32 = 4; +pub const GPUREG_0005: u32 = 5; +pub const GPUREG_0006: u32 = 6; +pub const GPUREG_0007: u32 = 7; +pub const GPUREG_0008: u32 = 8; +pub const GPUREG_0009: u32 = 9; +pub const GPUREG_000A: u32 = 10; +pub const GPUREG_000B: u32 = 11; +pub const GPUREG_000C: u32 = 12; +pub const GPUREG_000D: u32 = 13; +pub const GPUREG_000E: u32 = 14; +pub const GPUREG_000F: u32 = 15; +pub const GPUREG_FINALIZE: u32 = 16; +pub const GPUREG_0011: u32 = 17; +pub const GPUREG_0012: u32 = 18; +pub const GPUREG_0013: u32 = 19; +pub const GPUREG_0014: u32 = 20; +pub const GPUREG_0015: u32 = 21; +pub const GPUREG_0016: u32 = 22; +pub const GPUREG_0017: u32 = 23; +pub const GPUREG_0018: u32 = 24; +pub const GPUREG_0019: u32 = 25; +pub const GPUREG_001A: u32 = 26; +pub const GPUREG_001B: u32 = 27; +pub const GPUREG_001C: u32 = 28; +pub const GPUREG_001D: u32 = 29; +pub const GPUREG_001E: u32 = 30; +pub const GPUREG_001F: u32 = 31; +pub const GPUREG_0020: u32 = 32; +pub const GPUREG_0021: u32 = 33; +pub const GPUREG_0022: u32 = 34; +pub const GPUREG_0023: u32 = 35; +pub const GPUREG_0024: u32 = 36; +pub const GPUREG_0025: u32 = 37; +pub const GPUREG_0026: u32 = 38; +pub const GPUREG_0027: u32 = 39; +pub const GPUREG_0028: u32 = 40; +pub const GPUREG_0029: u32 = 41; +pub const GPUREG_002A: u32 = 42; +pub const GPUREG_002B: u32 = 43; +pub const GPUREG_002C: u32 = 44; +pub const GPUREG_002D: u32 = 45; +pub const GPUREG_002E: u32 = 46; +pub const GPUREG_002F: u32 = 47; +pub const GPUREG_0030: u32 = 48; +pub const GPUREG_0031: u32 = 49; +pub const GPUREG_0032: u32 = 50; +pub const GPUREG_0033: u32 = 51; +pub const GPUREG_0034: u32 = 52; +pub const GPUREG_0035: u32 = 53; +pub const GPUREG_0036: u32 = 54; +pub const GPUREG_0037: u32 = 55; +pub const GPUREG_0038: u32 = 56; +pub const GPUREG_0039: u32 = 57; +pub const GPUREG_003A: u32 = 58; +pub const GPUREG_003B: u32 = 59; +pub const GPUREG_003C: u32 = 60; +pub const GPUREG_003D: u32 = 61; +pub const GPUREG_003E: u32 = 62; +pub const GPUREG_003F: u32 = 63; +pub const GPUREG_FACECULLING_CONFIG: u32 = 64; +pub const GPUREG_VIEWPORT_WIDTH: u32 = 65; +pub const GPUREG_VIEWPORT_INVW: u32 = 66; +pub const GPUREG_VIEWPORT_HEIGHT: u32 = 67; +pub const GPUREG_VIEWPORT_INVH: u32 = 68; +pub const GPUREG_0045: u32 = 69; +pub const GPUREG_0046: u32 = 70; +pub const GPUREG_FRAGOP_CLIP: u32 = 71; +pub const GPUREG_FRAGOP_CLIP_DATA0: u32 = 72; +pub const GPUREG_FRAGOP_CLIP_DATA1: u32 = 73; +pub const GPUREG_FRAGOP_CLIP_DATA2: u32 = 74; +pub const GPUREG_FRAGOP_CLIP_DATA3: u32 = 75; +pub const GPUREG_004C: u32 = 76; +pub const GPUREG_DEPTHMAP_SCALE: u32 = 77; +pub const GPUREG_DEPTHMAP_OFFSET: u32 = 78; +pub const GPUREG_SH_OUTMAP_TOTAL: u32 = 79; +pub const GPUREG_SH_OUTMAP_O0: u32 = 80; +pub const GPUREG_SH_OUTMAP_O1: u32 = 81; +pub const GPUREG_SH_OUTMAP_O2: u32 = 82; +pub const GPUREG_SH_OUTMAP_O3: u32 = 83; +pub const GPUREG_SH_OUTMAP_O4: u32 = 84; +pub const GPUREG_SH_OUTMAP_O5: u32 = 85; +pub const GPUREG_SH_OUTMAP_O6: u32 = 86; +pub const GPUREG_0057: u32 = 87; +pub const GPUREG_0058: u32 = 88; +pub const GPUREG_0059: u32 = 89; +pub const GPUREG_005A: u32 = 90; +pub const GPUREG_005B: u32 = 91; +pub const GPUREG_005C: u32 = 92; +pub const GPUREG_005D: u32 = 93; +pub const GPUREG_005E: u32 = 94; +pub const GPUREG_005F: u32 = 95; +pub const GPUREG_0060: u32 = 96; +pub const GPUREG_EARLYDEPTH_FUNC: u32 = 97; +pub const GPUREG_EARLYDEPTH_TEST1: u32 = 98; +pub const GPUREG_EARLYDEPTH_CLEAR: u32 = 99; +pub const GPUREG_SH_OUTATTR_MODE: u32 = 100; +pub const GPUREG_SCISSORTEST_MODE: u32 = 101; +pub const GPUREG_SCISSORTEST_POS: u32 = 102; +pub const GPUREG_SCISSORTEST_DIM: u32 = 103; +pub const GPUREG_VIEWPORT_XY: u32 = 104; +pub const GPUREG_0069: u32 = 105; +pub const GPUREG_EARLYDEPTH_DATA: u32 = 106; +pub const GPUREG_006B: u32 = 107; +pub const GPUREG_006C: u32 = 108; +pub const GPUREG_DEPTHMAP_ENABLE: u32 = 109; +pub const GPUREG_RENDERBUF_DIM: u32 = 110; +pub const GPUREG_SH_OUTATTR_CLOCK: u32 = 111; +pub const GPUREG_0070: u32 = 112; +pub const GPUREG_0071: u32 = 113; +pub const GPUREG_0072: u32 = 114; +pub const GPUREG_0073: u32 = 115; +pub const GPUREG_0074: u32 = 116; +pub const GPUREG_0075: u32 = 117; +pub const GPUREG_0076: u32 = 118; +pub const GPUREG_0077: u32 = 119; +pub const GPUREG_0078: u32 = 120; +pub const GPUREG_0079: u32 = 121; +pub const GPUREG_007A: u32 = 122; +pub const GPUREG_007B: u32 = 123; +pub const GPUREG_007C: u32 = 124; +pub const GPUREG_007D: u32 = 125; +pub const GPUREG_007E: u32 = 126; +pub const GPUREG_007F: u32 = 127; +pub const GPUREG_TEXUNIT_CONFIG: u32 = 128; +pub const GPUREG_TEXUNIT0_BORDER_COLOR: u32 = 129; +pub const GPUREG_TEXUNIT0_DIM: u32 = 130; +pub const GPUREG_TEXUNIT0_PARAM: u32 = 131; +pub const GPUREG_TEXUNIT0_LOD: u32 = 132; +pub const GPUREG_TEXUNIT0_ADDR1: u32 = 133; +pub const GPUREG_TEXUNIT0_ADDR2: u32 = 134; +pub const GPUREG_TEXUNIT0_ADDR3: u32 = 135; +pub const GPUREG_TEXUNIT0_ADDR4: u32 = 136; +pub const GPUREG_TEXUNIT0_ADDR5: u32 = 137; +pub const GPUREG_TEXUNIT0_ADDR6: u32 = 138; +pub const GPUREG_TEXUNIT0_SHADOW: u32 = 139; +pub const GPUREG_008C: u32 = 140; +pub const GPUREG_008D: u32 = 141; +pub const GPUREG_TEXUNIT0_TYPE: u32 = 142; +pub const GPUREG_LIGHTING_ENABLE0: u32 = 143; +pub const GPUREG_0090: u32 = 144; +pub const GPUREG_TEXUNIT1_BORDER_COLOR: u32 = 145; +pub const GPUREG_TEXUNIT1_DIM: u32 = 146; +pub const GPUREG_TEXUNIT1_PARAM: u32 = 147; +pub const GPUREG_TEXUNIT1_LOD: u32 = 148; +pub const GPUREG_TEXUNIT1_ADDR: u32 = 149; +pub const GPUREG_TEXUNIT1_TYPE: u32 = 150; +pub const GPUREG_0097: u32 = 151; +pub const GPUREG_0098: u32 = 152; +pub const GPUREG_TEXUNIT2_BORDER_COLOR: u32 = 153; +pub const GPUREG_TEXUNIT2_DIM: u32 = 154; +pub const GPUREG_TEXUNIT2_PARAM: u32 = 155; +pub const GPUREG_TEXUNIT2_LOD: u32 = 156; +pub const GPUREG_TEXUNIT2_ADDR: u32 = 157; +pub const GPUREG_TEXUNIT2_TYPE: u32 = 158; +pub const GPUREG_009F: u32 = 159; +pub const GPUREG_00A0: u32 = 160; +pub const GPUREG_00A1: u32 = 161; +pub const GPUREG_00A2: u32 = 162; +pub const GPUREG_00A3: u32 = 163; +pub const GPUREG_00A4: u32 = 164; +pub const GPUREG_00A5: u32 = 165; +pub const GPUREG_00A6: u32 = 166; +pub const GPUREG_00A7: u32 = 167; +pub const GPUREG_TEXUNIT3_PROCTEX0: u32 = 168; +pub const GPUREG_TEXUNIT3_PROCTEX1: u32 = 169; +pub const GPUREG_TEXUNIT3_PROCTEX2: u32 = 170; +pub const GPUREG_TEXUNIT3_PROCTEX3: u32 = 171; +pub const GPUREG_TEXUNIT3_PROCTEX4: u32 = 10; +pub const GPUREG_TEXUNIT3_PROCTEX5: u32 = 13; +pub const GPUREG_00AE: u32 = 174; +pub const GPUREG_PROCTEX_LUT: u32 = 175; +pub const GPUREG_PROCTEX_LUT_DATA0: u32 = 176; +pub const GPUREG_PROCTEX_LUT_DATA1: u32 = 177; +pub const GPUREG_PROCTEX_LUT_DATA2: u32 = 178; +pub const GPUREG_PROCTEX_LUT_DATA3: u32 = 179; +pub const GPUREG_PROCTEX_LUT_DATA4: u32 = 180; +pub const GPUREG_PROCTEX_LUT_DATA5: u32 = 181; +pub const GPUREG_PROCTEX_LUT_DATA6: u32 = 182; +pub const GPUREG_PROCTEX_LUT_DATA7: u32 = 183; +pub const GPUREG_00B8: u32 = 184; +pub const GPUREG_00B9: u32 = 185; +pub const GPUREG_00BA: u32 = 186; +pub const GPUREG_00BB: u32 = 187; +pub const GPUREG_00BC: u32 = 188; +pub const GPUREG_00BD: u32 = 189; +pub const GPUREG_00BE: u32 = 190; +pub const GPUREG_00BF: u32 = 191; +pub const GPUREG_TEXENV0_SOURCE: u32 = 192; +pub const GPUREG_TEXENV0_OPERAND: u32 = 193; +pub const GPUREG_TEXENV0_COMBINER: u32 = 194; +pub const GPUREG_TEXENV0_COLOR: u32 = 195; +pub const GPUREG_TEXENV0_SCALE: u32 = 196; +pub const GPUREG_00C5: u32 = 197; +pub const GPUREG_00C6: u32 = 198; +pub const GPUREG_00C7: u32 = 199; +pub const GPUREG_TEXENV1_SOURCE: u32 = 200; +pub const GPUREG_TEXENV1_OPERAND: u32 = 201; +pub const GPUREG_TEXENV1_COMBINER: u32 = 202; +pub const GPUREG_TEXENV1_COLOR: u32 = 203; +pub const GPUREG_TEXENV1_SCALE: u32 = 204; +pub const GPUREG_00CD: u32 = 205; +pub const GPUREG_00CE: u32 = 206; +pub const GPUREG_00CF: u32 = 207; +pub const GPUREG_TEXENV2_SOURCE: u32 = 208; +pub const GPUREG_TEXENV2_OPERAND: u32 = 209; +pub const GPUREG_TEXENV2_COMBINER: u32 = 210; +pub const GPUREG_TEXENV2_COLOR: u32 = 211; +pub const GPUREG_TEXENV2_SCALE: u32 = 212; +pub const GPUREG_00D5: u32 = 213; +pub const GPUREG_00D6: u32 = 214; +pub const GPUREG_00D7: u32 = 215; +pub const GPUREG_TEXENV3_SOURCE: u32 = 216; +pub const GPUREG_TEXENV3_OPERAND: u32 = 217; +pub const GPUREG_TEXENV3_COMBINER: u32 = 218; +pub const GPUREG_TEXENV3_COLOR: u32 = 219; +pub const GPUREG_TEXENV3_SCALE: u32 = 220; +pub const GPUREG_00DD: u32 = 221; +pub const GPUREG_00DE: u32 = 222; +pub const GPUREG_00DF: u32 = 223; +pub const GPUREG_TEXENV_UPDATE_BUFFER: u32 = 224; +pub const GPUREG_FOG_COLOR: u32 = 225; +pub const GPUREG_00E2: u32 = 226; +pub const GPUREG_00E3: u32 = 227; +pub const GPUREG_GAS_ATTENUATION: u32 = 228; +pub const GPUREG_GAS_ACCMAX: u32 = 229; +pub const GPUREG_FOG_LUT_INDEX: u32 = 230; +pub const GPUREG_00E7: u32 = 231; +pub const GPUREG_FOG_LUT_DATA0: u32 = 232; +pub const GPUREG_FOG_LUT_DATA1: u32 = 233; +pub const GPUREG_FOG_LUT_DATA2: u32 = 234; +pub const GPUREG_FOG_LUT_DATA3: u32 = 235; +pub const GPUREG_FOG_LUT_DATA4: u32 = 236; +pub const GPUREG_FOG_LUT_DATA5: u32 = 237; +pub const GPUREG_FOG_LUT_DATA6: u32 = 238; +pub const GPUREG_FOG_LUT_DATA7: u32 = 239; +pub const GPUREG_TEXENV4_SOURCE: u32 = 240; +pub const GPUREG_TEXENV4_OPERAND: u32 = 241; +pub const GPUREG_TEXENV4_COMBINER: u32 = 242; +pub const GPUREG_TEXENV4_COLOR: u32 = 243; +pub const GPUREG_TEXENV4_SCALE: u32 = 244; +pub const GPUREG_00F5: u32 = 245; +pub const GPUREG_00F6: u32 = 246; +pub const GPUREG_00F7: u32 = 247; +pub const GPUREG_TEXENV5_SOURCE: u32 = 248; +pub const GPUREG_TEXENV5_OPERAND: u32 = 249; +pub const GPUREG_TEXENV5_COMBINER: u32 = 250; +pub const GPUREG_TEXENV5_COLOR: u32 = 251; +pub const GPUREG_TEXENV5_SCALE: u32 = 252; +pub const GPUREG_TEXENV_BUFFER_COLOR: u32 = 253; +pub const GPUREG_00FE: u32 = 254; +pub const GPUREG_00FF: u32 = 255; +pub const GPUREG_COLOR_OPERATION: u32 = 256; +pub const GPUREG_BLEND_FUNC: u32 = 257; +pub const GPUREG_LOGIC_OP: u32 = 258; +pub const GPUREG_BLEND_COLOR: u32 = 259; +pub const GPUREG_FRAGOP_ALPHA_TEST: u32 = 260; +pub const GPUREG_STENCIL_TEST: u32 = 261; +pub const GPUREG_STENCIL_OP: u32 = 262; +pub const GPUREG_DEPTH_COLOR_MASK: u32 = 263; +pub const GPUREG_0108: u32 = 264; +pub const GPUREG_0109: u32 = 265; +pub const GPUREG_010A: u32 = 266; +pub const GPUREG_010B: u32 = 267; +pub const GPUREG_010C: u32 = 268; +pub const GPUREG_010D: u32 = 269; +pub const GPUREG_010E: u32 = 270; +pub const GPUREG_010F: u32 = 271; +pub const GPUREG_FRAMEBUFFER_INVALIDATE: u32 = 272; +pub const GPUREG_FRAMEBUFFER_FLUSH: u32 = 273; +pub const GPUREG_COLORBUFFER_READ: u32 = 274; +pub const GPUREG_COLORBUFFER_WRITE: u32 = 275; +pub const GPUREG_DEPTHBUFFER_READ: u32 = 276; +pub const GPUREG_DEPTHBUFFER_WRITE: u32 = 277; +pub const GPUREG_DEPTHBUFFER_FORMAT: u32 = 278; +pub const GPUREG_COLORBUFFER_FORMAT: u32 = 279; +pub const GPUREG_EARLYDEPTH_TEST2: u32 = 280; +pub const GPUREG_0119: u32 = 281; +pub const GPUREG_011A: u32 = 282; +pub const GPUREG_FRAMEBUFFER_BLOCK32: u32 = 283; +pub const GPUREG_DEPTHBUFFER_LOC: u32 = 284; +pub const GPUREG_COLORBUFFER_LOC: u32 = 285; +pub const GPUREG_FRAMEBUFFER_DIM: u32 = 286; +pub const GPUREG_011F: u32 = 287; +pub const GPUREG_GAS_LIGHT_XY: u32 = 288; +pub const GPUREG_GAS_LIGHT_Z: u32 = 289; +pub const GPUREG_GAS_LIGHT_Z_COLOR: u32 = 290; +pub const GPUREG_GAS_LUT_INDEX: u32 = 291; +pub const GPUREG_GAS_LUT_DATA: u32 = 292; +pub const GPUREG_GAS_ACCMAX_FEEDBACK: u32 = 293; +pub const GPUREG_GAS_DELTAZ_DEPTH: u32 = 294; +pub const GPUREG_0127: u32 = 295; +pub const GPUREG_0128: u32 = 296; +pub const GPUREG_0129: u32 = 297; +pub const GPUREG_012A: u32 = 298; +pub const GPUREG_012B: u32 = 299; +pub const GPUREG_012C: u32 = 300; +pub const GPUREG_012D: u32 = 301; +pub const GPUREG_012E: u32 = 302; +pub const GPUREG_012F: u32 = 303; +pub const GPUREG_FRAGOP_SHADOW: u32 = 304; +pub const GPUREG_0131: u32 = 305; +pub const GPUREG_0132: u32 = 306; +pub const GPUREG_0133: u32 = 307; +pub const GPUREG_0134: u32 = 308; +pub const GPUREG_0135: u32 = 309; +pub const GPUREG_0136: u32 = 310; +pub const GPUREG_0137: u32 = 311; +pub const GPUREG_0138: u32 = 312; +pub const GPUREG_0139: u32 = 313; +pub const GPUREG_013A: u32 = 314; +pub const GPUREG_013B: u32 = 315; +pub const GPUREG_013C: u32 = 316; +pub const GPUREG_013D: u32 = 317; +pub const GPUREG_013E: u32 = 318; +pub const GPUREG_013F: u32 = 319; +pub const GPUREG_LIGHT0_SPECULAR0: u32 = 320; +pub const GPUREG_LIGHT0_SPECULAR1: u32 = 321; +pub const GPUREG_LIGHT0_DIFFUSE: u32 = 322; +pub const GPUREG_LIGHT0_AMBIENT: u32 = 323; +pub const GPUREG_LIGHT0_XY: u32 = 324; +pub const GPUREG_LIGHT0_Z: u32 = 325; +pub const GPUREG_LIGHT0_SPOTDIR_XY: u32 = 326; +pub const GPUREG_LIGHT0_SPOTDIR_Z: u32 = 327; +pub const GPUREG_0148: u32 = 328; +pub const GPUREG_LIGHT0_CONFIG: u32 = 329; +pub const GPUREG_LIGHT0_ATTENUATION_BIAS: u32 = 330; +pub const GPUREG_LIGHT0_ATTENUATION_SCALE: u32 = 331; +pub const GPUREG_014C: u32 = 332; +pub const GPUREG_014D: u32 = 333; +pub const GPUREG_014E: u32 = 334; +pub const GPUREG_014F: u32 = 335; +pub const GPUREG_LIGHT1_SPECULAR0: u32 = 336; +pub const GPUREG_LIGHT1_SPECULAR1: u32 = 337; +pub const GPUREG_LIGHT1_DIFFUSE: u32 = 338; +pub const GPUREG_LIGHT1_AMBIENT: u32 = 339; +pub const GPUREG_LIGHT1_XY: u32 = 340; +pub const GPUREG_LIGHT1_Z: u32 = 341; +pub const GPUREG_LIGHT1_SPOTDIR_XY: u32 = 342; +pub const GPUREG_LIGHT1_SPOTDIR_Z: u32 = 343; +pub const GPUREG_0158: u32 = 344; +pub const GPUREG_LIGHT1_CONFIG: u32 = 345; +pub const GPUREG_LIGHT1_ATTENUATION_BIAS: u32 = 346; +pub const GPUREG_LIGHT1_ATTENUATION_SCALE: u32 = 347; +pub const GPUREG_015C: u32 = 348; +pub const GPUREG_015D: u32 = 349; +pub const GPUREG_015E: u32 = 350; +pub const GPUREG_015F: u32 = 351; +pub const GPUREG_LIGHT2_SPECULAR0: u32 = 352; +pub const GPUREG_LIGHT2_SPECULAR1: u32 = 353; +pub const GPUREG_LIGHT2_DIFFUSE: u32 = 354; +pub const GPUREG_LIGHT2_AMBIENT: u32 = 355; +pub const GPUREG_LIGHT2_XY: u32 = 356; +pub const GPUREG_LIGHT2_Z: u32 = 357; +pub const GPUREG_LIGHT2_SPOTDIR_XY: u32 = 358; +pub const GPUREG_LIGHT2_SPOTDIR_Z: u32 = 359; +pub const GPUREG_0168: u32 = 360; +pub const GPUREG_LIGHT2_CONFIG: u32 = 361; +pub const GPUREG_LIGHT2_ATTENUATION_BIAS: u32 = 362; +pub const GPUREG_LIGHT2_ATTENUATION_SCALE: u32 = 363; +pub const GPUREG_016C: u32 = 364; +pub const GPUREG_016D: u32 = 365; +pub const GPUREG_016E: u32 = 366; +pub const GPUREG_016F: u32 = 367; +pub const GPUREG_LIGHT3_SPECULAR0: u32 = 368; +pub const GPUREG_LIGHT3_SPECULAR1: u32 = 369; +pub const GPUREG_LIGHT3_DIFFUSE: u32 = 370; +pub const GPUREG_LIGHT3_AMBIENT: u32 = 371; +pub const GPUREG_LIGHT3_XY: u32 = 372; +pub const GPUREG_LIGHT3_Z: u32 = 373; +pub const GPUREG_LIGHT3_SPOTDIR_XY: u32 = 374; +pub const GPUREG_LIGHT3_SPOTDIR_Z: u32 = 375; +pub const GPUREG_0178: u32 = 376; +pub const GPUREG_LIGHT3_CONFIG: u32 = 377; +pub const GPUREG_LIGHT3_ATTENUATION_BIAS: u32 = 378; +pub const GPUREG_LIGHT3_ATTENUATION_SCALE: u32 = 379; +pub const GPUREG_017C: u32 = 380; +pub const GPUREG_017D: u32 = 381; +pub const GPUREG_017E: u32 = 382; +pub const GPUREG_017F: u32 = 383; +pub const GPUREG_LIGHT4_SPECULAR0: u32 = 384; +pub const GPUREG_LIGHT4_SPECULAR1: u32 = 385; +pub const GPUREG_LIGHT4_DIFFUSE: u32 = 386; +pub const GPUREG_LIGHT4_AMBIENT: u32 = 387; +pub const GPUREG_LIGHT4_XY: u32 = 388; +pub const GPUREG_LIGHT4_Z: u32 = 389; +pub const GPUREG_LIGHT4_SPOTDIR_XY: u32 = 390; +pub const GPUREG_LIGHT4_SPOTDIR_Z: u32 = 391; +pub const GPUREG_0188: u32 = 392; +pub const GPUREG_LIGHT4_CONFIG: u32 = 393; +pub const GPUREG_LIGHT4_ATTENUATION_BIAS: u32 = 394; +pub const GPUREG_LIGHT4_ATTENUATION_SCALE: u32 = 395; +pub const GPUREG_018C: u32 = 396; +pub const GPUREG_018D: u32 = 397; +pub const GPUREG_018E: u32 = 398; +pub const GPUREG_018F: u32 = 399; +pub const GPUREG_LIGHT5_SPECULAR0: u32 = 400; +pub const GPUREG_LIGHT5_SPECULAR1: u32 = 401; +pub const GPUREG_LIGHT5_DIFFUSE: u32 = 402; +pub const GPUREG_LIGHT5_AMBIENT: u32 = 403; +pub const GPUREG_LIGHT5_XY: u32 = 404; +pub const GPUREG_LIGHT5_Z: u32 = 405; +pub const GPUREG_LIGHT5_SPOTDIR_XY: u32 = 406; +pub const GPUREG_LIGHT5_SPOTDIR_Z: u32 = 407; +pub const GPUREG_0198: u32 = 408; +pub const GPUREG_LIGHT5_CONFIG: u32 = 409; +pub const GPUREG_LIGHT5_ATTENUATION_BIAS: u32 = 410; +pub const GPUREG_LIGHT5_ATTENUATION_SCALE: u32 = 411; +pub const GPUREG_019C: u32 = 412; +pub const GPUREG_019D: u32 = 413; +pub const GPUREG_019E: u32 = 414; +pub const GPUREG_019F: u32 = 415; +pub const GPUREG_LIGHT6_SPECULAR0: u32 = 416; +pub const GPUREG_LIGHT6_SPECULAR1: u32 = 417; +pub const GPUREG_LIGHT6_DIFFUSE: u32 = 418; +pub const GPUREG_LIGHT6_AMBIENT: u32 = 419; +pub const GPUREG_LIGHT6_XY: u32 = 420; +pub const GPUREG_LIGHT6_Z: u32 = 421; +pub const GPUREG_LIGHT6_SPOTDIR_XY: u32 = 422; +pub const GPUREG_LIGHT6_SPOTDIR_Z: u32 = 423; +pub const GPUREG_01A8: u32 = 424; +pub const GPUREG_LIGHT6_CONFIG: u32 = 425; +pub const GPUREG_LIGHT6_ATTENUATION_BIAS: u32 = 426; +pub const GPUREG_LIGHT6_ATTENUATION_SCALE: u32 = 427; +pub const GPUREG_01AC: u32 = 428; +pub const GPUREG_01AD: u32 = 429; +pub const GPUREG_01AE: u32 = 430; +pub const GPUREG_01AF: u32 = 431; +pub const GPUREG_LIGHT7_SPECULAR0: u32 = 432; +pub const GPUREG_LIGHT7_SPECULAR1: u32 = 433; +pub const GPUREG_LIGHT7_DIFFUSE: u32 = 434; +pub const GPUREG_LIGHT7_AMBIENT: u32 = 435; +pub const GPUREG_LIGHT7_XY: u32 = 436; +pub const GPUREG_LIGHT7_Z: u32 = 437; +pub const GPUREG_LIGHT7_SPOTDIR_XY: u32 = 438; +pub const GPUREG_LIGHT7_SPOTDIR_Z: u32 = 439; +pub const GPUREG_01B8: u32 = 440; +pub const GPUREG_LIGHT7_CONFIG: u32 = 441; +pub const GPUREG_LIGHT7_ATTENUATION_BIAS: u32 = 442; +pub const GPUREG_LIGHT7_ATTENUATION_SCALE: u32 = 443; +pub const GPUREG_01BC: u32 = 444; +pub const GPUREG_01BD: u32 = 445; +pub const GPUREG_01BE: u32 = 446; +pub const GPUREG_01BF: u32 = 447; +pub const GPUREG_LIGHTING_AMBIENT: u32 = 448; +pub const GPUREG_01C1: u32 = 449; +pub const GPUREG_LIGHTING_NUM_LIGHTS: u32 = 450; +pub const GPUREG_LIGHTING_CONFIG0: u32 = 451; +pub const GPUREG_LIGHTING_CONFIG1: u32 = 452; +pub const GPUREG_LIGHTING_LUT_INDEX: u32 = 453; +pub const GPUREG_LIGHTING_ENABLE1: u32 = 454; +pub const GPUREG_01C7: u32 = 455; +pub const GPUREG_LIGHTING_LUT_DATA0: u32 = 456; +pub const GPUREG_LIGHTING_LUT_DATA1: u32 = 457; +pub const GPUREG_LIGHTING_LUT_DATA2: u32 = 458; +pub const GPUREG_LIGHTING_LUT_DATA3: u32 = 459; +pub const GPUREG_LIGHTING_LUT_DATA4: u32 = 460; +pub const GPUREG_LIGHTING_LUT_DATA5: u32 = 461; +pub const GPUREG_LIGHTING_LUT_DATA6: u32 = 462; +pub const GPUREG_LIGHTING_LUT_DATA7: u32 = 463; +pub const GPUREG_LIGHTING_LUTINPUT_ABS: u32 = 464; +pub const GPUREG_LIGHTING_LUTINPUT_SELECT: u32 = 465; +pub const GPUREG_LIGHTING_LUTINPUT_SCALE: u32 = 466; +pub const GPUREG_01D3: u32 = 467; +pub const GPUREG_01D4: u32 = 468; +pub const GPUREG_01D5: u32 = 469; +pub const GPUREG_01D6: u32 = 470; +pub const GPUREG_01D7: u32 = 471; +pub const GPUREG_01D8: u32 = 472; +pub const GPUREG_LIGHTING_LIGHT_PERMUTATION: u32 = 473; +pub const GPUREG_01DA: u32 = 474; +pub const GPUREG_01DB: u32 = 475; +pub const GPUREG_01DC: u32 = 476; +pub const GPUREG_01DD: u32 = 477; +pub const GPUREG_01DE: u32 = 478; +pub const GPUREG_01DF: u32 = 479; +pub const GPUREG_01E0: u32 = 480; +pub const GPUREG_01E1: u32 = 481; +pub const GPUREG_01E2: u32 = 482; +pub const GPUREG_01E3: u32 = 483; +pub const GPUREG_01E4: u32 = 484; +pub const GPUREG_01E5: u32 = 485; +pub const GPUREG_01E6: u32 = 486; +pub const GPUREG_01E7: u32 = 487; +pub const GPUREG_01E8: u32 = 488; +pub const GPUREG_01E9: u32 = 489; +pub const GPUREG_01EA: u32 = 490; +pub const GPUREG_01EB: u32 = 491; +pub const GPUREG_01EC: u32 = 492; +pub const GPUREG_01ED: u32 = 493; +pub const GPUREG_01EE: u32 = 494; +pub const GPUREG_01EF: u32 = 495; +pub const GPUREG_01F0: u32 = 496; +pub const GPUREG_01F1: u32 = 497; +pub const GPUREG_01F2: u32 = 498; +pub const GPUREG_01F3: u32 = 499; +pub const GPUREG_01F4: u32 = 500; +pub const GPUREG_01F5: u32 = 501; +pub const GPUREG_01F6: u32 = 502; +pub const GPUREG_01F7: u32 = 503; +pub const GPUREG_01F8: u32 = 504; +pub const GPUREG_01F9: u32 = 505; +pub const GPUREG_01FA: u32 = 506; +pub const GPUREG_01FB: u32 = 507; +pub const GPUREG_01FC: u32 = 508; +pub const GPUREG_01FD: u32 = 509; +pub const GPUREG_01FE: u32 = 510; +pub const GPUREG_01FF: u32 = 511; +pub const GPUREG_ATTRIBBUFFERS_LOC: u32 = 512; +pub const GPUREG_ATTRIBBUFFERS_FORMAT_LOW: u32 = 513; +pub const GPUREG_ATTRIBBUFFERS_FORMAT_HIGH: u32 = 514; +pub const GPUREG_ATTRIBBUFFER0_OFFSET: u32 = 515; +pub const GPUREG_ATTRIBBUFFER0_CONFIG1: u32 = 516; +pub const GPUREG_ATTRIBBUFFER0_CONFIG2: u32 = 517; +pub const GPUREG_ATTRIBBUFFER1_OFFSET: u32 = 518; +pub const GPUREG_ATTRIBBUFFER1_CONFIG1: u32 = 519; +pub const GPUREG_ATTRIBBUFFER1_CONFIG2: u32 = 520; +pub const GPUREG_ATTRIBBUFFER2_OFFSET: u32 = 521; +pub const GPUREG_ATTRIBBUFFER2_CONFIG1: u32 = 522; +pub const GPUREG_ATTRIBBUFFER2_CONFIG2: u32 = 523; +pub const GPUREG_ATTRIBBUFFER3_OFFSET: u32 = 524; +pub const GPUREG_ATTRIBBUFFER3_CONFIG1: u32 = 525; +pub const GPUREG_ATTRIBBUFFER3_CONFIG2: u32 = 526; +pub const GPUREG_ATTRIBBUFFER4_OFFSET: u32 = 527; +pub const GPUREG_ATTRIBBUFFER4_CONFIG1: u32 = 528; +pub const GPUREG_ATTRIBBUFFER4_CONFIG2: u32 = 529; +pub const GPUREG_ATTRIBBUFFER5_OFFSET: u32 = 530; +pub const GPUREG_ATTRIBBUFFER5_CONFIG1: u32 = 531; +pub const GPUREG_ATTRIBBUFFER5_CONFIG2: u32 = 532; +pub const GPUREG_ATTRIBBUFFER6_OFFSET: u32 = 533; +pub const GPUREG_ATTRIBBUFFER6_CONFIG1: u32 = 534; +pub const GPUREG_ATTRIBBUFFER6_CONFIG2: u32 = 535; +pub const GPUREG_ATTRIBBUFFER7_OFFSET: u32 = 536; +pub const GPUREG_ATTRIBBUFFER7_CONFIG1: u32 = 537; +pub const GPUREG_ATTRIBBUFFER7_CONFIG2: u32 = 538; +pub const GPUREG_ATTRIBBUFFER8_OFFSET: u32 = 539; +pub const GPUREG_ATTRIBBUFFER8_CONFIG1: u32 = 540; +pub const GPUREG_ATTRIBBUFFER8_CONFIG2: u32 = 541; +pub const GPUREG_ATTRIBBUFFER9_OFFSET: u32 = 542; +pub const GPUREG_ATTRIBBUFFER9_CONFIG1: u32 = 543; +pub const GPUREG_ATTRIBBUFFER9_CONFIG2: u32 = 544; +pub const GPUREG_ATTRIBBUFFERA_OFFSET: u32 = 545; +pub const GPUREG_ATTRIBBUFFERA_CONFIG1: u32 = 546; +pub const GPUREG_ATTRIBBUFFERA_CONFIG2: u32 = 547; +pub const GPUREG_ATTRIBBUFFERB_OFFSET: u32 = 548; +pub const GPUREG_ATTRIBBUFFERB_CONFIG1: u32 = 549; +pub const GPUREG_ATTRIBBUFFERB_CONFIG2: u32 = 550; +pub const GPUREG_INDEXBUFFER_CONFIG: u32 = 551; +pub const GPUREG_NUMVERTICES: u32 = 552; +pub const GPUREG_GEOSTAGE_CONFIG: u32 = 553; +pub const GPUREG_VERTEX_OFFSET: u32 = 554; +pub const GPUREG_022B: u32 = 555; +pub const GPUREG_022C: u32 = 556; +pub const GPUREG_POST_VERTEX_CACHE_NUM: u32 = 557; +pub const GPUREG_DRAWARRAYS: u32 = 558; +pub const GPUREG_DRAWELEMENTS: u32 = 559; +pub const GPUREG_0230: u32 = 560; +pub const GPUREG_VTX_FUNC: u32 = 561; +pub const GPUREG_FIXEDATTRIB_INDEX: u32 = 562; +pub const GPUREG_FIXEDATTRIB_DATA0: u32 = 563; +pub const GPUREG_FIXEDATTRIB_DATA1: u32 = 564; +pub const GPUREG_FIXEDATTRIB_DATA2: u32 = 565; +pub const GPUREG_0236: u32 = 566; +pub const GPUREG_0237: u32 = 567; +pub const GPUREG_CMDBUF_SIZE0: u32 = 568; +pub const GPUREG_CMDBUF_SIZE1: u32 = 569; +pub const GPUREG_CMDBUF_ADDR0: u32 = 570; +pub const GPUREG_CMDBUF_ADDR1: u32 = 571; +pub const GPUREG_CMDBUF_JUMP0: u32 = 572; +pub const GPUREG_CMDBUF_JUMP1: u32 = 573; +pub const GPUREG_023E: u32 = 574; +pub const GPUREG_023F: u32 = 575; +pub const GPUREG_0240: u32 = 576; +pub const GPUREG_0241: u32 = 577; +pub const GPUREG_VSH_NUM_ATTR: u32 = 578; +pub const GPUREG_0243: u32 = 579; +pub const GPUREG_VSH_COM_MODE: u32 = 580; +pub const GPUREG_START_DRAW_FUNC0: u32 = 581; +pub const GPUREG_0246: u32 = 582; +pub const GPUREG_0247: u32 = 583; +pub const GPUREG_0248: u32 = 584; +pub const GPUREG_0249: u32 = 585; +pub const GPUREG_VSH_OUTMAP_TOTAL1: u32 = 586; +pub const GPUREG_024B: u32 = 587; +pub const GPUREG_024C: u32 = 588; +pub const GPUREG_024D: u32 = 589; +pub const GPUREG_024E: u32 = 590; +pub const GPUREG_024F: u32 = 591; +pub const GPUREG_0250: u32 = 592; +pub const GPUREG_VSH_OUTMAP_TOTAL2: u32 = 593; +pub const GPUREG_GSH_MISC0: u32 = 594; +pub const GPUREG_GEOSTAGE_CONFIG2: u32 = 595; +pub const GPUREG_GSH_MISC1: u32 = 596; +pub const GPUREG_0255: u32 = 597; +pub const GPUREG_0256: u32 = 598; +pub const GPUREG_0257: u32 = 599; +pub const GPUREG_0258: u32 = 600; +pub const GPUREG_0259: u32 = 601; +pub const GPUREG_025A: u32 = 602; +pub const GPUREG_025B: u32 = 603; +pub const GPUREG_025C: u32 = 604; +pub const GPUREG_025D: u32 = 605; +pub const GPUREG_PRIMITIVE_CONFIG: u32 = 606; +pub const GPUREG_RESTART_PRIMITIVE: u32 = 607; +pub const GPUREG_0260: u32 = 608; +pub const GPUREG_0261: u32 = 609; +pub const GPUREG_0262: u32 = 610; +pub const GPUREG_0263: u32 = 611; +pub const GPUREG_0264: u32 = 612; +pub const GPUREG_0265: u32 = 613; +pub const GPUREG_0266: u32 = 614; +pub const GPUREG_0267: u32 = 615; +pub const GPUREG_0268: u32 = 616; +pub const GPUREG_0269: u32 = 617; +pub const GPUREG_026A: u32 = 618; +pub const GPUREG_026B: u32 = 619; +pub const GPUREG_026C: u32 = 620; +pub const GPUREG_026D: u32 = 621; +pub const GPUREG_026E: u32 = 622; +pub const GPUREG_026F: u32 = 623; +pub const GPUREG_0270: u32 = 624; +pub const GPUREG_0271: u32 = 625; +pub const GPUREG_0272: u32 = 626; +pub const GPUREG_0273: u32 = 627; +pub const GPUREG_0274: u32 = 628; +pub const GPUREG_0275: u32 = 629; +pub const GPUREG_0276: u32 = 630; +pub const GPUREG_0277: u32 = 631; +pub const GPUREG_0278: u32 = 632; +pub const GPUREG_0279: u32 = 633; +pub const GPUREG_027A: u32 = 634; +pub const GPUREG_027B: u32 = 635; +pub const GPUREG_027C: u32 = 636; +pub const GPUREG_027D: u32 = 637; +pub const GPUREG_027E: u32 = 638; +pub const GPUREG_027F: u32 = 639; +pub const GPUREG_GSH_BOOLUNIFORM: u32 = 640; +pub const GPUREG_GSH_INTUNIFORM_I0: u32 = 641; +pub const GPUREG_GSH_INTUNIFORM_I1: u32 = 642; +pub const GPUREG_GSH_INTUNIFORM_I2: u32 = 643; +pub const GPUREG_GSH_INTUNIFORM_I3: u32 = 644; +pub const GPUREG_0285: u32 = 645; +pub const GPUREG_0286: u32 = 646; +pub const GPUREG_0287: u32 = 647; +pub const GPUREG_0288: u32 = 648; +pub const GPUREG_GSH_INPUTBUFFER_CONFIG: u32 = 649; +pub const GPUREG_GSH_ENTRYPOINT: u32 = 650; +pub const GPUREG_GSH_ATTRIBUTES_PERMUTATION_LOW: u32 = 651; +pub const GPUREG_GSH_ATTRIBUTES_PERMUTATION_HIGH: u32 = 652; +pub const GPUREG_GSH_OUTMAP_MASK: u32 = 653; +pub const GPUREG_028E: u32 = 654; +pub const GPUREG_GSH_CODETRANSFER_END: u32 = 655; +pub const GPUREG_GSH_FLOATUNIFORM_CONFIG: u32 = 656; +pub const GPUREG_GSH_FLOATUNIFORM_DATA: u32 = 657; +pub const GPUREG_0299: u32 = 665; +pub const GPUREG_029A: u32 = 666; +pub const GPUREG_GSH_CODETRANSFER_CONFIG: u32 = 667; +pub const GPUREG_GSH_CODETRANSFER_DATA: u32 = 668; +pub const GPUREG_02A4: u32 = 676; +pub const GPUREG_GSH_OPDESCS_CONFIG: u32 = 677; +pub const GPUREG_GSH_OPDESCS_DATA: u32 = 678; +pub const GPUREG_02AE: u32 = 686; +pub const GPUREG_02AF: u32 = 687; +pub const GPUREG_VSH_BOOLUNIFORM: u32 = 688; +pub const GPUREG_VSH_INTUNIFORM_I0: u32 = 689; +pub const GPUREG_VSH_INTUNIFORM_I1: u32 = 690; +pub const GPUREG_VSH_INTUNIFORM_I2: u32 = 691; +pub const GPUREG_VSH_INTUNIFORM_I3: u32 = 692; +pub const GPUREG_02B5: u32 = 693; +pub const GPUREG_02B6: u32 = 694; +pub const GPUREG_02B7: u32 = 695; +pub const GPUREG_02B8: u32 = 696; +pub const GPUREG_VSH_INPUTBUFFER_CONFIG: u32 = 697; +pub const GPUREG_VSH_ENTRYPOINT: u32 = 698; +pub const GPUREG_VSH_ATTRIBUTES_PERMUTATION_LOW: u32 = 699; +pub const GPUREG_VSH_ATTRIBUTES_PERMUTATION_HIGH: u32 = 700; +pub const GPUREG_VSH_OUTMAP_MASK: u32 = 701; +pub const GPUREG_02BE: u32 = 702; +pub const GPUREG_VSH_CODETRANSFER_END: u32 = 703; +pub const GPUREG_VSH_FLOATUNIFORM_CONFIG: u32 = 704; +pub const GPUREG_VSH_FLOATUNIFORM_DATA: u32 = 705; +pub const GPUREG_02C9: u32 = 713; +pub const GPUREG_02CA: u32 = 714; +pub const GPUREG_VSH_CODETRANSFER_CONFIG: u32 = 715; +pub const GPUREG_VSH_CODETRANSFER_DATA: u32 = 716; +pub const GPUREG_02D4: u32 = 724; +pub const GPUREG_VSH_OPDESCS_CONFIG: u32 = 725; +pub const GPUREG_VSH_OPDESCS_DATA: u32 = 726; +pub const GPUREG_02DE: u32 = 734; +pub const GPUREG_02DF: u32 = 735; +pub const GPUREG_02E0: u32 = 736; +pub const GPUREG_02E1: u32 = 737; +pub const GPUREG_02E2: u32 = 738; +pub const GPUREG_02E3: u32 = 739; +pub const GPUREG_02E4: u32 = 740; +pub const GPUREG_02E5: u32 = 741; +pub const GPUREG_02E6: u32 = 742; +pub const GPUREG_02E7: u32 = 743; +pub const GPUREG_02E8: u32 = 744; +pub const GPUREG_02E9: u32 = 745; +pub const GPUREG_02EA: u32 = 746; +pub const GPUREG_02EB: u32 = 747; +pub const GPUREG_02EC: u32 = 748; +pub const GPUREG_02ED: u32 = 749; +pub const GPUREG_02EE: u32 = 750; +pub const GPUREG_02EF: u32 = 751; +pub const GPUREG_02F0: u32 = 752; +pub const GPUREG_02F1: u32 = 753; +pub const GPUREG_02F2: u32 = 754; +pub const GPUREG_02F3: u32 = 755; +pub const GPUREG_02F4: u32 = 756; +pub const GPUREG_02F5: u32 = 757; +pub const GPUREG_02F6: u32 = 758; +pub const GPUREG_02F7: u32 = 759; +pub const GPUREG_02F8: u32 = 760; +pub const GPUREG_02F9: u32 = 761; +pub const GPUREG_02FA: u32 = 762; +pub const GPUREG_02FB: u32 = 763; +pub const GPUREG_02FC: u32 = 764; +pub const GPUREG_02FD: u32 = 765; +pub const GPUREG_02FE: u32 = 766; +pub const GPUREG_02FF: u32 = 767; +pub const NDSP_SAMPLE_RATE: f64 = 32728.498046875; +pub const SWKBD_MAX_WORD_LEN: u32 = 40; +pub const SWKBD_MAX_BUTTON_TEXT_LEN: u32 = 16; +pub const SWKBD_MAX_HINT_TEXT_LEN: u32 = 64; +pub const SWKBD_MAX_CALLBACK_MSG_LEN: u32 = 256; +pub const MIISELECTOR_MAGIC: u32 = 333326543; +pub const MIISELECTOR_TITLE_LEN: u32 = 64; +pub const MIISELECTOR_GUESTMII_SLOTS: u32 = 6; +pub const MIISELECTOR_USERMII_SLOTS: u32 = 100; +pub const MIISELECTOR_MIIDATA_SIZE: u32 = 92; +pub const MIISELECTOR_GUESTMII_NAME_LEN: u32 = 12; +pub const SDMC_DIRITER_MAGIC: u32 = 1935961443; +pub const _M_LN2: f64 = 0.6931471805599453; +pub const FP_NAN: u32 = 0; +pub const FP_INFINITE: u32 = 1; +pub const FP_ZERO: u32 = 2; +pub const FP_SUBNORMAL: u32 = 3; +pub const FP_NORMAL: u32 = 4; +pub const MATH_ERRNO: u32 = 1; +pub const MATH_ERREXCEPT: u32 = 2; +pub const math_errhandling: u32 = 1; +pub const DOMAIN: u32 = 1; +pub const SING: u32 = 2; +pub const OVERFLOW: u32 = 3; +pub const UNDERFLOW: u32 = 4; +pub const TLOSS: u32 = 5; +pub const PLOSS: u32 = 6; +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 M_TWOPI: f64 = 6.283185307179586; +pub const M_SQRTPI: f64 = 1.772453850905516; +pub const M_SQRT3: f64 = 1.7320508075688772; +pub const M_IVLN10: f64 = 0.4342944819032518; +pub const M_LOG2_E: f64 = 0.6931471805599453; +pub const M_TAU: f64 = 6.283185307179586; +pub const C3D_AspectRatioTop: f64 = 1.6666666666666667; +pub const C3D_AspectRatioBot: f64 = 1.3333333333333333; +pub const C3D_MTXSTACK_SIZE: u32 = 8; +pub const C3D_FVUNIF_COUNT: u32 = 96; +pub const C3D_IVUNIF_COUNT: u32 = 4; +pub const C3D_DEFAULT_CMDBUF_SIZE: u32 = 262144; +pub const C3DF_LightEnv_IsCP_Any: u32 = 66846720; +pub const C3DF_LightEnv_LutDirtyAll: u32 = 4227858432; +pub const __GNUC_VA_LIST: u32 = 1; +pub const __SLBF: u32 = 1; +pub const __SNBF: u32 = 2; +pub const __SRD: u32 = 4; +pub const __SWR: u32 = 8; +pub const __SRW: u32 = 16; +pub const __SEOF: u32 = 32; +pub const __SERR: u32 = 64; +pub const __SMBF: u32 = 128; +pub const __SAPP: u32 = 256; +pub const __SSTR: u32 = 512; +pub const __SOPT: u32 = 1024; +pub const __SNPT: u32 = 2048; +pub const __SOFF: u32 = 4096; +pub const __SORD: u32 = 8192; +pub const __SL64: u32 = 32768; +pub const __SNLK: u32 = 1; +pub const __SWID: u32 = 8192; +pub const _IOFBF: u32 = 0; +pub const _IOLBF: u32 = 1; +pub const _IONBF: u32 = 2; +pub const EOF: i32 = -1; +pub const BUFSIZ: u32 = 1024; +pub const FOPEN_MAX: u32 = 20; +pub const FILENAME_MAX: u32 = 1024; +pub const L_tmpnam: u32 = 1024; +pub const P_tmpdir: &'static [u8; 5usize] = b"/tmp\0"; +pub const SEEK_SET: u32 = 0; +pub const SEEK_CUR: u32 = 1; +pub const SEEK_END: u32 = 2; +pub const TMP_MAX: u32 = 26; +pub const L_ctermid: u32 = 16; +pub const C2D_DEFAULT_MAX_OBJECTS: u32 = 4096; +pub type __int8_t = ::libc::c_schar; +pub type __uint8_t = ::libc::c_uchar; +pub type __int16_t = ::libc::c_short; +pub type __uint16_t = ::libc::c_ushort; +pub type __int32_t = ::libc::c_int; +pub type __uint32_t = ::libc::c_uint; +pub type __int64_t = ::libc::c_longlong; +pub type __uint64_t = ::libc::c_ulonglong; +pub type __int_least8_t = ::libc::c_schar; +pub type __uint_least8_t = ::libc::c_uchar; +pub type __int_least16_t = ::libc::c_short; +pub type __uint_least16_t = ::libc::c_ushort; +pub type __int_least32_t = ::libc::c_int; +pub type __uint_least32_t = ::libc::c_uint; +pub type __int_least64_t = ::libc::c_longlong; +pub type __uint_least64_t = ::libc::c_ulonglong; +pub type __intmax_t = ::libc::c_longlong; +pub type __uintmax_t = ::libc::c_ulonglong; +pub type __intptr_t = ::libc::c_int; +pub type __uintptr_t = ::libc::c_uint; +pub type intmax_t = __intmax_t; +pub type uintmax_t = __uintmax_t; +pub type int_least8_t = __int_least8_t; +pub type uint_least8_t = __uint_least8_t; +pub type int_least16_t = __int_least16_t; +pub type uint_least16_t = __uint_least16_t; +pub type int_least32_t = __int_least32_t; +pub type uint_least32_t = __uint_least32_t; +pub type int_least64_t = __int_least64_t; +pub type uint_least64_t = __uint_least64_t; +pub type int_fast8_t = ::libc::c_schar; +pub type uint_fast8_t = ::libc::c_uchar; +pub type int_fast16_t = ::libc::c_short; +pub type uint_fast16_t = ::libc::c_ushort; +pub type int_fast32_t = ::libc::c_int; +pub type uint_fast32_t = ::libc::c_uint; +pub type int_fast64_t = ::libc::c_longlong; +pub type uint_fast64_t = ::libc::c_ulonglong; +pub type wchar_t = ::libc::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct max_align_t { + pub __clang_max_align_nonce1: ::libc::c_longlong, + pub __clang_max_align_nonce2: f64, +} +pub type s8 = i8; +pub type s16 = i16; +pub type s32 = i32; +pub type s64 = i64; +pub type vu8 = u8; +pub type vu16 = u16; +pub type vu32 = u32; +pub type vu64 = u64; +pub type vs8 = s8; +pub type vs16 = s16; +pub type vs32 = s32; +pub type vs64 = s64; +pub type Handle = u32; +pub type Result = s32; +pub type ThreadFunc = ::core::option::Option; +pub type voidfn = ::core::option::Option; +#[repr(C)] +pub struct CpuRegisters { + pub r: [u32; 13usize], + pub sp: u32, + pub lr: u32, + pub pc: u32, + pub cpsr: u32, +} +#[repr(C)] +pub struct FpuRegisters { + pub __bindgen_anon_1: FpuRegisters__bindgen_ty_1, + pub fpscr: u32, + pub fpexc: u32, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union FpuRegisters__bindgen_ty_1 { + pub __bindgen_anon_1: FpuRegisters__bindgen_ty_1__bindgen_ty_1, + pub s: [f32; 32usize], + _bindgen_union_align: [u32; 32usize], +} +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct FpuRegisters__bindgen_ty_1__bindgen_ty_1 { + pub d: [f64; 16usize], +} +pub const RL_SUCCESS: _bindgen_ty_1 = 0; +pub const RL_INFO: _bindgen_ty_1 = 1; +pub const RL_FATAL: _bindgen_ty_1 = 31; +pub const RL_RESET: _bindgen_ty_1 = 30; +pub const RL_REINITIALIZE: _bindgen_ty_1 = 29; +pub const RL_USAGE: _bindgen_ty_1 = 28; +pub const RL_PERMANENT: _bindgen_ty_1 = 27; +pub const RL_TEMPORARY: _bindgen_ty_1 = 26; +pub const RL_STATUS: _bindgen_ty_1 = 25; +pub type _bindgen_ty_1 = u32; +pub const RS_SUCCESS: _bindgen_ty_2 = 0; +pub const RS_NOP: _bindgen_ty_2 = 1; +pub const RS_WOULDBLOCK: _bindgen_ty_2 = 2; +pub const RS_OUTOFRESOURCE: _bindgen_ty_2 = 3; +pub const RS_NOTFOUND: _bindgen_ty_2 = 4; +pub const RS_INVALIDSTATE: _bindgen_ty_2 = 5; +pub const RS_NOTSUPPORTED: _bindgen_ty_2 = 6; +pub const RS_INVALIDARG: _bindgen_ty_2 = 7; +pub const RS_WRONGARG: _bindgen_ty_2 = 8; +pub const RS_CANCELED: _bindgen_ty_2 = 9; +pub const RS_STATUSCHANGED: _bindgen_ty_2 = 10; +pub const RS_INTERNAL: _bindgen_ty_2 = 11; +pub const RS_INVALIDRESVAL: _bindgen_ty_2 = 63; +pub type _bindgen_ty_2 = u32; +pub const RM_COMMON: _bindgen_ty_3 = 0; +pub const RM_KERNEL: _bindgen_ty_3 = 1; +pub const RM_UTIL: _bindgen_ty_3 = 2; +pub const RM_FILE_SERVER: _bindgen_ty_3 = 3; +pub const RM_LOADER_SERVER: _bindgen_ty_3 = 4; +pub const RM_TCB: _bindgen_ty_3 = 5; +pub const RM_OS: _bindgen_ty_3 = 6; +pub const RM_DBG: _bindgen_ty_3 = 7; +pub const RM_DMNT: _bindgen_ty_3 = 8; +pub const RM_PDN: _bindgen_ty_3 = 9; +pub const RM_GSP: _bindgen_ty_3 = 10; +pub const RM_I2C: _bindgen_ty_3 = 11; +pub const RM_GPIO: _bindgen_ty_3 = 12; +pub const RM_DD: _bindgen_ty_3 = 13; +pub const RM_CODEC: _bindgen_ty_3 = 14; +pub const RM_SPI: _bindgen_ty_3 = 15; +pub const RM_PXI: _bindgen_ty_3 = 16; +pub const RM_FS: _bindgen_ty_3 = 17; +pub const RM_DI: _bindgen_ty_3 = 18; +pub const RM_HID: _bindgen_ty_3 = 19; +pub const RM_CAM: _bindgen_ty_3 = 20; +pub const RM_PI: _bindgen_ty_3 = 21; +pub const RM_PM: _bindgen_ty_3 = 22; +pub const RM_PM_LOW: _bindgen_ty_3 = 23; +pub const RM_FSI: _bindgen_ty_3 = 24; +pub const RM_SRV: _bindgen_ty_3 = 25; +pub const RM_NDM: _bindgen_ty_3 = 26; +pub const RM_NWM: _bindgen_ty_3 = 27; +pub const RM_SOC: _bindgen_ty_3 = 28; +pub const RM_LDR: _bindgen_ty_3 = 29; +pub const RM_ACC: _bindgen_ty_3 = 30; +pub const RM_ROMFS: _bindgen_ty_3 = 31; +pub const RM_AM: _bindgen_ty_3 = 32; +pub const RM_HIO: _bindgen_ty_3 = 33; +pub const RM_UPDATER: _bindgen_ty_3 = 34; +pub const RM_MIC: _bindgen_ty_3 = 35; +pub const RM_FND: _bindgen_ty_3 = 36; +pub const RM_MP: _bindgen_ty_3 = 37; +pub const RM_MPWL: _bindgen_ty_3 = 38; +pub const RM_AC: _bindgen_ty_3 = 39; +pub const RM_HTTP: _bindgen_ty_3 = 40; +pub const RM_DSP: _bindgen_ty_3 = 41; +pub const RM_SND: _bindgen_ty_3 = 42; +pub const RM_DLP: _bindgen_ty_3 = 43; +pub const RM_HIO_LOW: _bindgen_ty_3 = 44; +pub const RM_CSND: _bindgen_ty_3 = 45; +pub const RM_SSL: _bindgen_ty_3 = 46; +pub const RM_AM_LOW: _bindgen_ty_3 = 47; +pub const RM_NEX: _bindgen_ty_3 = 48; +pub const RM_FRIENDS: _bindgen_ty_3 = 49; +pub const RM_RDT: _bindgen_ty_3 = 50; +pub const RM_APPLET: _bindgen_ty_3 = 51; +pub const RM_NIM: _bindgen_ty_3 = 52; +pub const RM_PTM: _bindgen_ty_3 = 53; +pub const RM_MIDI: _bindgen_ty_3 = 54; +pub const RM_MC: _bindgen_ty_3 = 55; +pub const RM_SWC: _bindgen_ty_3 = 56; +pub const RM_FATFS: _bindgen_ty_3 = 57; +pub const RM_NGC: _bindgen_ty_3 = 58; +pub const RM_CARD: _bindgen_ty_3 = 59; +pub const RM_CARDNOR: _bindgen_ty_3 = 60; +pub const RM_SDMC: _bindgen_ty_3 = 61; +pub const RM_BOSS: _bindgen_ty_3 = 62; +pub const RM_DBM: _bindgen_ty_3 = 63; +pub const RM_CONFIG: _bindgen_ty_3 = 64; +pub const RM_PS: _bindgen_ty_3 = 65; +pub const RM_CEC: _bindgen_ty_3 = 66; +pub const RM_IR: _bindgen_ty_3 = 67; +pub const RM_UDS: _bindgen_ty_3 = 68; +pub const RM_PL: _bindgen_ty_3 = 69; +pub const RM_CUP: _bindgen_ty_3 = 70; +pub const RM_GYROSCOPE: _bindgen_ty_3 = 71; +pub const RM_MCU: _bindgen_ty_3 = 72; +pub const RM_NS: _bindgen_ty_3 = 73; +pub const RM_NEWS: _bindgen_ty_3 = 74; +pub const RM_RO: _bindgen_ty_3 = 75; +pub const RM_GD: _bindgen_ty_3 = 76; +pub const RM_CARD_SPI: _bindgen_ty_3 = 77; +pub const RM_EC: _bindgen_ty_3 = 78; +pub const RM_WEB_BROWSER: _bindgen_ty_3 = 79; +pub const RM_TEST: _bindgen_ty_3 = 80; +pub const RM_ENC: _bindgen_ty_3 = 81; +pub const RM_PIA: _bindgen_ty_3 = 82; +pub const RM_ACT: _bindgen_ty_3 = 83; +pub const RM_VCTL: _bindgen_ty_3 = 84; +pub const RM_OLV: _bindgen_ty_3 = 85; +pub const RM_NEIA: _bindgen_ty_3 = 86; +pub const RM_NPNS: _bindgen_ty_3 = 87; +pub const RM_AVD: _bindgen_ty_3 = 90; +pub const RM_L2B: _bindgen_ty_3 = 91; +pub const RM_MVD: _bindgen_ty_3 = 92; +pub const RM_NFC: _bindgen_ty_3 = 93; +pub const RM_UART: _bindgen_ty_3 = 94; +pub const RM_SPM: _bindgen_ty_3 = 95; +pub const RM_QTM: _bindgen_ty_3 = 96; +pub const RM_NFP: _bindgen_ty_3 = 97; +pub const RM_APPLICATION: _bindgen_ty_3 = 254; +pub const RM_INVALIDRESVAL: _bindgen_ty_3 = 255; +pub type _bindgen_ty_3 = u32; +pub const RD_SUCCESS: _bindgen_ty_4 = 0; +pub const RD_INVALID_RESULT_VALUE: _bindgen_ty_4 = 1023; +pub const RD_TIMEOUT: _bindgen_ty_4 = 1022; +pub const RD_OUT_OF_RANGE: _bindgen_ty_4 = 1021; +pub const RD_ALREADY_EXISTS: _bindgen_ty_4 = 1020; +pub const RD_CANCEL_REQUESTED: _bindgen_ty_4 = 1019; +pub const RD_NOT_FOUND: _bindgen_ty_4 = 1018; +pub const RD_ALREADY_INITIALIZED: _bindgen_ty_4 = 1017; +pub const RD_NOT_INITIALIZED: _bindgen_ty_4 = 1016; +pub const RD_INVALID_HANDLE: _bindgen_ty_4 = 1015; +pub const RD_INVALID_POINTER: _bindgen_ty_4 = 1014; +pub const RD_INVALID_ADDRESS: _bindgen_ty_4 = 1013; +pub const RD_NOT_IMPLEMENTED: _bindgen_ty_4 = 1012; +pub const RD_OUT_OF_MEMORY: _bindgen_ty_4 = 1011; +pub const RD_MISALIGNED_SIZE: _bindgen_ty_4 = 1010; +pub const RD_MISALIGNED_ADDRESS: _bindgen_ty_4 = 1009; +pub const RD_BUSY: _bindgen_ty_4 = 1008; +pub const RD_NO_DATA: _bindgen_ty_4 = 1007; +pub const RD_INVALID_COMBINATION: _bindgen_ty_4 = 1006; +pub const RD_INVALID_ENUM_VALUE: _bindgen_ty_4 = 1005; +pub const RD_INVALID_SIZE: _bindgen_ty_4 = 1004; +pub const RD_ALREADY_DONE: _bindgen_ty_4 = 1003; +pub const RD_NOT_AUTHORIZED: _bindgen_ty_4 = 1002; +pub const RD_TOO_LARGE: _bindgen_ty_4 = 1001; +pub const RD_INVALID_SELECTION: _bindgen_ty_4 = 1000; +pub type _bindgen_ty_4 = u32; +pub const IPC_BUFFER_R: IPC_BufferRights = 2; +pub const IPC_BUFFER_W: IPC_BufferRights = 4; +pub const IPC_BUFFER_RW: IPC_BufferRights = 6; +pub type IPC_BufferRights = u32; +pub const MEMOP_FREE: MemOp = 1; +pub const MEMOP_RESERVE: MemOp = 2; +pub const MEMOP_ALLOC: MemOp = 3; +pub const MEMOP_MAP: MemOp = 4; +pub const MEMOP_UNMAP: MemOp = 5; +pub const MEMOP_PROT: MemOp = 6; +pub const MEMOP_REGION_APP: MemOp = 256; +pub const MEMOP_REGION_SYSTEM: MemOp = 512; +pub const MEMOP_REGION_BASE: MemOp = 768; +pub const MEMOP_OP_MASK: MemOp = 255; +pub const MEMOP_REGION_MASK: MemOp = 3840; +pub const MEMOP_LINEAR_FLAG: MemOp = 65536; +pub const MEMOP_ALLOC_LINEAR: MemOp = 65539; +pub type MemOp = u32; +pub const MEMSTATE_FREE: MemState = 0; +pub const MEMSTATE_RESERVED: MemState = 1; +pub const MEMSTATE_IO: MemState = 2; +pub const MEMSTATE_STATIC: MemState = 3; +pub const MEMSTATE_CODE: MemState = 4; +pub const MEMSTATE_PRIVATE: MemState = 5; +pub const MEMSTATE_SHARED: MemState = 6; +pub const MEMSTATE_CONTINUOUS: MemState = 7; +pub const MEMSTATE_ALIASED: MemState = 8; +pub const MEMSTATE_ALIAS: MemState = 9; +pub const MEMSTATE_ALIASCODE: MemState = 10; +pub const MEMSTATE_LOCKED: MemState = 11; +pub type MemState = u32; +pub const MEMPERM_READ: MemPerm = 1; +pub const MEMPERM_WRITE: MemPerm = 2; +pub const MEMPERM_EXECUTE: MemPerm = 4; +pub const MEMPERM_DONTCARE: MemPerm = 268435456; +pub type MemPerm = u32; +#[repr(C)] +pub struct MemInfo { + pub base_addr: u32, + pub size: u32, + pub perm: u32, + pub state: u32, +} +#[repr(C)] +pub struct PageInfo { + pub flags: u32, +} +pub const ARBITRATION_SIGNAL: ArbitrationType = 0; +pub const ARBITRATION_WAIT_IF_LESS_THAN: ArbitrationType = 1; +pub const ARBITRATION_DECREMENT_AND_WAIT_IF_LESS_THAN: ArbitrationType = 2; +pub const ARBITRATION_WAIT_IF_LESS_THAN_TIMEOUT: ArbitrationType = 3; +pub const ARBITRATION_DECREMENT_AND_WAIT_IF_LESS_THAN_TIMEOUT: ArbitrationType = 4; +pub type ArbitrationType = u32; +pub const RESET_ONESHOT: ResetType = 0; +pub const RESET_STICKY: ResetType = 1; +pub const RESET_PULSE: ResetType = 2; +pub type ResetType = u32; +pub const THREADINFO_TYPE_UNKNOWN: ThreadInfoType = 0; +pub type ThreadInfoType = u32; +pub const RESLIMIT_PRIORITY: ResourceLimitType = 0; +pub const RESLIMIT_COMMIT: ResourceLimitType = 1; +pub const RESLIMIT_THREAD: ResourceLimitType = 2; +pub const RESLIMIT_EVENT: ResourceLimitType = 3; +pub const RESLIMIT_MUTEX: ResourceLimitType = 4; +pub const RESLIMIT_SEMAPHORE: ResourceLimitType = 5; +pub const RESLIMIT_TIMER: ResourceLimitType = 6; +pub const RESLIMIT_SHAREDMEMORY: ResourceLimitType = 7; +pub const RESLIMIT_ADDRESSARBITER: ResourceLimitType = 8; +pub const RESLIMIT_CPUTIME: ResourceLimitType = 9; +pub const RESLIMIT_BIT: ResourceLimitType = 2147483648; +pub type ResourceLimitType = u32; +#[repr(C)] +pub struct AttachProcessEvent { + pub program_id: u64, + pub process_name: [::libc::c_char; 8usize], + pub process_id: u32, + pub other_flags: u32, +} +pub const EXITPROCESS_EVENT_EXIT: ExitProcessEventReason = 0; +pub const EXITPROCESS_EVENT_TERMINATE: ExitProcessEventReason = 1; +pub const EXITPROCESS_EVENT_DEBUG_TERMINATE: ExitProcessEventReason = 2; +pub type ExitProcessEventReason = u32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ExitProcessEvent { + pub reason: ExitProcessEventReason, +} +#[repr(C)] +pub struct AttachThreadEvent { + pub creator_thread_id: u32, + pub thread_local_storage: u32, + pub entry_point: u32, +} +pub const EXITTHREAD_EVENT_EXIT: ExitThreadEventReason = 0; +pub const EXITTHREAD_EVENT_TERMINATE: ExitThreadEventReason = 1; +pub const EXITTHREAD_EVENT_EXIT_PROCESS: ExitThreadEventReason = 2; +pub const EXITTHREAD_EVENT_TERMINATE_PROCESS: ExitThreadEventReason = 3; +pub type ExitThreadEventReason = u32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ExitThreadEvent { + pub reason: ExitThreadEventReason, +} +pub const USERBREAK_PANIC: UserBreakType = 0; +pub const USERBREAK_ASSERT: UserBreakType = 1; +pub const USERBREAK_USER: UserBreakType = 2; +pub const USERBREAK_LOAD_RO: UserBreakType = 3; +pub const USERBREAK_UNLOAD_RO: UserBreakType = 4; +pub type UserBreakType = u32; +pub const EXCEVENT_UNDEFINED_INSTRUCTION: ExceptionEventType = 0; +pub const EXCEVENT_PREFETCH_ABORT: ExceptionEventType = 1; +pub const EXCEVENT_DATA_ABORT: ExceptionEventType = 2; +pub const EXCEVENT_UNALIGNED_DATA_ACCESS: ExceptionEventType = 3; +pub const EXCEVENT_ATTACH_BREAK: ExceptionEventType = 4; +pub const EXCEVENT_STOP_POINT: ExceptionEventType = 5; +pub const EXCEVENT_USER_BREAK: ExceptionEventType = 6; +pub const EXCEVENT_DEBUGGER_BREAK: ExceptionEventType = 7; +pub const EXCEVENT_UNDEFINED_SYSCALL: ExceptionEventType = 8; +pub type ExceptionEventType = u32; +#[repr(C)] +pub struct FaultExceptionEvent { + pub fault_information: u32, +} +pub const STOPPOINT_SVC_FF: StopPointType = 0; +pub const STOPPOINT_BREAKPOINT: StopPointType = 1; +pub const STOPPOINT_WATCHPOINT: StopPointType = 2; +pub type StopPointType = u32; +#[repr(C)] +pub struct StopPointExceptionEvent { + pub type_: StopPointType, + pub fault_information: u32, +} +#[repr(C)] +pub struct UserBreakExceptionEvent { + pub type_: UserBreakType, + pub croInfo: u32, + pub croInfoSize: u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct DebuggerBreakExceptionEvent { + pub thread_ids: [s32; 4usize], +} +#[repr(C)] +pub struct ExceptionEvent { + pub type_: ExceptionEventType, + pub address: u32, + pub __bindgen_anon_1: ExceptionEvent__bindgen_ty_1, +} +#[repr(C)] +pub struct ExceptionEvent__bindgen_ty_1 { + pub fault: __BindgenUnionField, + pub stop_point: __BindgenUnionField, + pub user_break: __BindgenUnionField, + pub debugger_break: __BindgenUnionField, + pub bindgen_union_field: [u32; 4usize], +} +#[repr(C)] +pub struct ScheduleInOutEvent { + pub clock_tick: u64, +} +#[repr(C)] +pub struct SyscallInOutEvent { + pub clock_tick: u64, + pub syscall: u32, + pub __bindgen_padding_0: u32, +} +#[repr(C)] +pub struct OutputStringEvent { + pub string_addr: u32, + pub string_size: u32, +} +#[repr(C)] +pub struct MapEvent { + pub mapped_addr: u32, + pub mapped_size: u32, + pub memperm: MemPerm, + pub memstate: MemState, +} +pub const DBGEVENT_ATTACH_PROCESS: DebugEventType = 0; +pub const DBGEVENT_ATTACH_THREAD: DebugEventType = 1; +pub const DBGEVENT_EXIT_THREAD: DebugEventType = 2; +pub const DBGEVENT_EXIT_PROCESS: DebugEventType = 3; +pub const DBGEVENT_EXCEPTION: DebugEventType = 4; +pub const DBGEVENT_DLL_LOAD: DebugEventType = 5; +pub const DBGEVENT_DLL_UNLOAD: DebugEventType = 6; +pub const DBGEVENT_SCHEDULE_IN: DebugEventType = 7; +pub const DBGEVENT_SCHEDULE_OUT: DebugEventType = 8; +pub const DBGEVENT_SYSCALL_IN: DebugEventType = 9; +pub const DBGEVENT_SYSCALL_OUT: DebugEventType = 10; +pub const DBGEVENT_OUTPUT_STRING: DebugEventType = 11; +pub const DBGEVENT_MAP: DebugEventType = 12; +pub type DebugEventType = u32; +#[repr(C)] +pub struct DebugEventInfo { + pub type_: DebugEventType, + pub thread_id: u32, + pub flags: u32, + pub remnants: [u8; 4usize], + pub __bindgen_anon_1: DebugEventInfo__bindgen_ty_1, +} +#[repr(C)] +pub struct DebugEventInfo__bindgen_ty_1 { + pub attach_process: __BindgenUnionField, + pub attach_thread: __BindgenUnionField, + pub exit_thread: __BindgenUnionField, + pub exit_process: __BindgenUnionField, + pub exception: __BindgenUnionField, + pub scheduler: __BindgenUnionField, + pub syscall: __BindgenUnionField, + pub output_string: __BindgenUnionField, + pub map: __BindgenUnionField, + pub bindgen_union_field: [u64; 3usize], +} +pub const DBG_INHIBIT_USER_CPU_EXCEPTION_HANDLERS: DebugFlags = 1; +pub const DBG_SIGNAL_FAULT_EXCEPTION_EVENTS: DebugFlags = 2; +pub const DBG_SIGNAL_SCHEDULE_EVENTS: DebugFlags = 4; +pub const DBG_SIGNAL_SYSCALL_EVENTS: DebugFlags = 8; +pub const DBG_SIGNAL_MAP_EVENTS: DebugFlags = 16; +pub type DebugFlags = u32; +#[repr(C)] +pub struct ThreadContext { + pub cpu_registers: CpuRegisters, + pub fpu_registers: FpuRegisters, +} +pub const THREADCONTEXT_CONTROL_CPU_GPRS: ThreadContextControlFlags = 1; +pub const THREADCONTEXT_CONTROL_CPU_SPRS: ThreadContextControlFlags = 2; +pub const THREADCONTEXT_CONTROL_FPU_GPRS: ThreadContextControlFlags = 4; +pub const THREADCONTEXT_CONTROL_FPU_SPRS: ThreadContextControlFlags = 8; +pub const THREADCONTEXT_CONTROL_CPU_REGS: ThreadContextControlFlags = 3; +pub const THREADCONTEXT_CONTROL_FPU_REGS: ThreadContextControlFlags = 12; +pub const THREADCONTEXT_CONTROL_ALL: ThreadContextControlFlags = 15; +pub type ThreadContextControlFlags = u32; +pub const DBGTHREAD_PARAMETER_PRIORITY: DebugThreadParameter = 0; +pub const DBGTHREAD_PARAMETER_SCHEDULING_MASK_LOW: DebugThreadParameter = 1; +pub const DBGTHREAD_PARAMETER_CPU_IDEAL: DebugThreadParameter = 2; +pub const DBGTHREAD_PARAMETER_CPU_CREATOR: DebugThreadParameter = 3; +pub type DebugThreadParameter = u32; +#[repr(C)] +pub struct CodeSetInfo { + pub name: [u8; 8usize], + pub unk1: u16, + pub unk2: u16, + pub unk3: u32, + pub text_addr: u32, + pub text_size: u32, + pub ro_addr: u32, + pub ro_size: u32, + pub rw_addr: u32, + pub rw_size: u32, + pub text_size_total: u32, + pub ro_size_total: u32, + pub rw_size_total: u32, + pub unk4: u32, + pub program_id: u64, +} +#[repr(C)] +pub struct StartupInfo { + pub priority: ::libc::c_int, + pub stack_size: u32, + pub argc: ::libc::c_int, + pub argv: *mut u16, + pub envp: *mut u16, +} +extern "C" { + pub fn svcControlMemory( + addr_out: *mut u32, + addr0: u32, + addr1: u32, + size: u32, + op: MemOp, + perm: MemPerm, + ) -> Result; +} +extern "C" { + pub fn svcControlProcessMemory( + process: Handle, + addr0: u32, + addr1: u32, + size: u32, + type_: u32, + perm: u32, + ) -> Result; +} +extern "C" { + pub fn svcCreateMemoryBlock( + memblock: *mut Handle, + addr: u32, + size: u32, + my_perm: MemPerm, + other_perm: MemPerm, + ) -> Result; +} +extern "C" { + pub fn svcMapMemoryBlock( + memblock: Handle, + addr: u32, + my_perm: MemPerm, + other_perm: MemPerm, + ) -> Result; +} +extern "C" { + pub fn svcMapProcessMemory(process: Handle, destAddress: u32, size: u32) -> Result; +} +extern "C" { + pub fn svcUnmapProcessMemory(process: Handle, destAddress: u32, size: u32) -> Result; +} +extern "C" { + pub fn svcUnmapMemoryBlock(memblock: Handle, addr: u32) -> Result; +} +extern "C" { + pub fn svcStartInterProcessDma( + dma: *mut Handle, + dstProcess: Handle, + dst: *mut ::libc::c_void, + srcProcess: Handle, + src: *const ::libc::c_void, + size: u32, + dmaConfig: *mut ::libc::c_void, + ) -> Result; +} +extern "C" { + pub fn svcStopDma(dma: Handle) -> Result; +} +extern "C" { + pub fn svcGetDmaState(dmaState: *mut ::libc::c_void, dma: Handle) -> Result; +} +extern "C" { + pub fn svcQueryMemory(info: *mut MemInfo, out: *mut PageInfo, addr: u32) -> Result; +} +extern "C" { + pub fn svcQueryProcessMemory( + info: *mut MemInfo, + out: *mut PageInfo, + process: Handle, + addr: u32, + ) -> Result; +} +extern "C" { + pub fn svcInvalidateProcessDataCache( + process: Handle, + addr: *mut ::libc::c_void, + size: u32, + ) -> Result; +} +extern "C" { + pub fn svcStoreProcessDataCache( + process: Handle, + addr: *mut ::libc::c_void, + size: u32, + ) -> Result; +} +extern "C" { + pub fn svcFlushProcessDataCache( + process: Handle, + addr: *const ::libc::c_void, + size: u32, + ) -> Result; +} +extern "C" { + pub fn svcOpenProcess(process: *mut Handle, processId: u32) -> Result; +} +extern "C" { + pub fn svcExitProcess(); +} +extern "C" { + pub fn svcTerminateProcess(process: Handle) -> Result; +} +extern "C" { + pub fn svcGetProcessInfo(out: *mut s64, process: Handle, type_: u32) -> Result; +} +extern "C" { + pub fn svcGetProcessId(out: *mut u32, handle: Handle) -> Result; +} +extern "C" { + pub fn svcGetProcessList( + processCount: *mut s32, + processIds: *mut u32, + processIdMaxCount: s32, + ) -> Result; +} +extern "C" { + pub fn svcGetThreadList( + threadCount: *mut s32, + threadIds: *mut u32, + threadIdMaxCount: s32, + process: Handle, + ) -> Result; +} +extern "C" { + pub fn svcCreatePort( + portServer: *mut Handle, + portClient: *mut Handle, + name: *const ::libc::c_char, + maxSessions: s32, + ) -> Result; +} +extern "C" { + pub fn svcConnectToPort(out: *mut Handle, portName: *const ::libc::c_char) -> Result; +} +extern "C" { + pub fn svcCreateCodeSet( + out: *mut Handle, + info: *const CodeSetInfo, + code_ptr: *mut ::libc::c_void, + ro_ptr: *mut ::libc::c_void, + data_ptr: *mut ::libc::c_void, + ) -> Result; +} +extern "C" { + pub fn svcCreateProcess( + out: *mut Handle, + codeset: Handle, + arm11kernelcaps: *const u32, + arm11kernelcaps_num: u32, + ) -> Result; +} +extern "C" { + pub fn svcGetProcessAffinityMask( + affinitymask: *mut u8, + process: Handle, + processorcount: s32, + ) -> Result; +} +extern "C" { + pub fn svcSetProcessAffinityMask( + process: Handle, + affinitymask: *const u8, + processorcount: s32, + ) -> Result; +} +extern "C" { + pub fn svcGetProcessIdealProcessor(processorid: *mut s32, process: Handle) -> Result; +} +extern "C" { + pub fn svcSetProcessIdealProcessor(process: Handle, processorid: s32) -> Result; +} +extern "C" { + pub fn svcRun(process: Handle, info: *const StartupInfo) -> Result; +} +extern "C" { + pub fn svcCreateThread( + thread: *mut Handle, + entrypoint: ThreadFunc, + arg: u32, + stack_top: *mut u32, + thread_priority: s32, + processor_id: s32, + ) -> Result; +} +extern "C" { + pub fn svcOpenThread(thread: *mut Handle, process: Handle, threadId: u32) -> Result; +} +extern "C" { + pub fn svcExitThread(); +} +extern "C" { + pub fn svcSleepThread(ns: s64); +} +extern "C" { + pub fn svcGetThreadPriority(out: *mut s32, handle: Handle) -> Result; +} +extern "C" { + pub fn svcSetThreadPriority(thread: Handle, prio: s32) -> Result; +} +extern "C" { + pub fn svcGetThreadAffinityMask( + affinitymask: *mut u8, + thread: Handle, + processorcount: s32, + ) -> Result; +} +extern "C" { + pub fn svcSetThreadAffinityMask( + thread: Handle, + affinitymask: *const u8, + processorcount: s32, + ) -> Result; +} +extern "C" { + pub fn svcGetThreadIdealProcessor(processorid: *mut s32, thread: Handle) -> Result; +} +extern "C" { + pub fn svcSetThreadIdealProcessor(thread: Handle, processorid: s32) -> Result; +} +extern "C" { + pub fn svcGetProcessorID() -> s32; +} +extern "C" { + pub fn svcGetThreadId(out: *mut u32, handle: Handle) -> Result; +} +extern "C" { + pub fn svcGetResourceLimit(resourceLimit: *mut Handle, process: Handle) -> Result; +} +extern "C" { + pub fn svcGetResourceLimitLimitValues( + values: *mut s64, + resourceLimit: Handle, + names: *mut ResourceLimitType, + nameCount: s32, + ) -> Result; +} +extern "C" { + pub fn svcGetResourceLimitCurrentValues( + values: *mut s64, + resourceLimit: Handle, + names: *mut ResourceLimitType, + nameCount: s32, + ) -> Result; +} +extern "C" { + pub fn svcSetProcessResourceLimits(process: Handle, resourceLimit: Handle) -> Result; +} +extern "C" { + pub fn svcCreateResourceLimit(resourceLimit: *mut Handle) -> Result; +} +extern "C" { + pub fn svcSetResourceLimitValues( + resourceLimit: Handle, + names: *const ResourceLimitType, + values: *const s64, + nameCount: s32, + ) -> Result; +} +extern "C" { + pub fn svcGetProcessIdOfThread(out: *mut u32, handle: Handle) -> Result; +} +extern "C" { + pub fn svcGetThreadInfo(out: *mut s64, thread: Handle, type_: ThreadInfoType) -> Result; +} +extern "C" { + pub fn svcCreateMutex(mutex: *mut Handle, initially_locked: bool) -> Result; +} +extern "C" { + pub fn svcReleaseMutex(handle: Handle) -> Result; +} +extern "C" { + pub fn svcCreateSemaphore(semaphore: *mut Handle, initial_count: s32, max_count: s32) + -> Result; +} +extern "C" { + pub fn svcReleaseSemaphore(count: *mut s32, semaphore: Handle, release_count: s32) -> Result; +} +extern "C" { + pub fn svcCreateEvent(event: *mut Handle, reset_type: ResetType) -> Result; +} +extern "C" { + pub fn svcSignalEvent(handle: Handle) -> Result; +} +extern "C" { + pub fn svcClearEvent(handle: Handle) -> Result; +} +extern "C" { + pub fn svcWaitSynchronization(handle: Handle, nanoseconds: s64) -> Result; +} +extern "C" { + pub fn svcWaitSynchronizationN( + out: *mut s32, + handles: *const Handle, + handles_num: s32, + wait_all: bool, + nanoseconds: s64, + ) -> Result; +} +extern "C" { + pub fn svcCreateAddressArbiter(arbiter: *mut Handle) -> Result; +} +extern "C" { + pub fn svcArbitrateAddress( + arbiter: Handle, + addr: u32, + type_: ArbitrationType, + value: s32, + nanoseconds: s64, + ) -> Result; +} +extern "C" { + pub fn svcSendSyncRequest(session: Handle) -> Result; +} +extern "C" { + pub fn svcCreateSessionToPort(clientSession: *mut Handle, clientPort: Handle) -> Result; +} +extern "C" { + pub fn svcCreateSession(serverSession: *mut Handle, clientSession: *mut Handle) -> Result; +} +extern "C" { + pub fn svcAcceptSession(session: *mut Handle, port: Handle) -> Result; +} +extern "C" { + pub fn svcReplyAndReceive( + index: *mut s32, + handles: *const Handle, + handleCount: s32, + replyTarget: Handle, + ) -> Result; +} +extern "C" { + pub fn svcBindInterrupt( + interruptId: u32, + eventOrSemaphore: Handle, + priority: s32, + isManualClear: bool, + ) -> Result; +} +extern "C" { + pub fn svcUnbindInterrupt(interruptId: u32, eventOrSemaphore: Handle) -> Result; +} +extern "C" { + pub fn svcCreateTimer(timer: *mut Handle, reset_type: ResetType) -> Result; +} +extern "C" { + pub fn svcSetTimer(timer: Handle, initial: s64, interval: s64) -> Result; +} +extern "C" { + pub fn svcCancelTimer(timer: Handle) -> Result; +} +extern "C" { + pub fn svcClearTimer(timer: Handle) -> Result; +} +extern "C" { + pub fn svcGetSystemTick() -> u64; +} +extern "C" { + pub fn svcCloseHandle(handle: Handle) -> Result; +} +extern "C" { + pub fn svcDuplicateHandle(out: *mut Handle, original: Handle) -> Result; +} +extern "C" { + pub fn svcGetHandleInfo(out: *mut s64, handle: Handle, param: u32) -> Result; +} +extern "C" { + pub fn svcGetSystemInfo(out: *mut s64, type_: u32, param: s32) -> Result; +} +extern "C" { + pub fn svcSetGpuProt(useApplicationRestriction: bool) -> Result; +} +extern "C" { + pub fn svcSetWifiEnabled(enabled: bool) -> Result; +} +extern "C" { + pub fn svcKernelSetState(type_: u32, ...) -> Result; +} +extern "C" { + pub fn svcBreak(breakReason: UserBreakType); +} +extern "C" { + pub fn svcBreakRO(breakReason: UserBreakType, croInfo: *const ::libc::c_void, croInfoSize: u32); +} +extern "C" { + pub fn svcOutputDebugString(str: *const ::libc::c_char, length: s32) -> Result; +} +extern "C" { + pub fn svcDebugActiveProcess(debug: *mut Handle, processId: u32) -> Result; +} +extern "C" { + pub fn svcBreakDebugProcess(debug: Handle) -> Result; +} +extern "C" { + pub fn svcTerminateDebugProcess(debug: Handle) -> Result; +} +extern "C" { + pub fn svcGetProcessDebugEvent(info: *mut DebugEventInfo, debug: Handle) -> Result; +} +extern "C" { + pub fn svcContinueDebugEvent(debug: Handle, flags: DebugFlags) -> Result; +} +extern "C" { + pub fn svcGetDebugThreadContext( + context: *mut ThreadContext, + debug: Handle, + threadId: u32, + controlFlags: ThreadContextControlFlags, + ) -> Result; +} +extern "C" { + pub fn svcSetDebugThreadContext( + debug: Handle, + threadId: u32, + context: *mut ThreadContext, + controlFlags: ThreadContextControlFlags, + ) -> Result; +} +extern "C" { + pub fn svcQueryDebugProcessMemory( + info: *mut MemInfo, + out: *mut PageInfo, + debug: Handle, + addr: u32, + ) -> Result; +} +extern "C" { + pub fn svcReadProcessMemory( + buffer: *mut ::libc::c_void, + debug: Handle, + addr: u32, + size: u32, + ) -> Result; +} +extern "C" { + pub fn svcWriteProcessMemory( + debug: Handle, + buffer: *const ::libc::c_void, + addr: u32, + size: u32, + ) -> Result; +} +extern "C" { + pub fn svcSetHardwareBreakPoint(registerId: s32, control: u32, value: u32) -> Result; +} +extern "C" { + pub fn svcGetDebugThreadParam( + unused: *mut s64, + out: *mut u32, + debug: Handle, + threadId: u32, + parameter: DebugThreadParameter, + ) -> Result; +} +extern "C" { + pub fn svcBackdoor(callback: ::core::option::Option s32>) -> Result; +} +pub const ARM9DESC_MOUNT_NAND: _bindgen_ty_5 = 1; +pub const ARM9DESC_MOUNT_NANDRO_RW: _bindgen_ty_5 = 2; +pub const ARM9DESC_MOUNT_TWLN: _bindgen_ty_5 = 4; +pub const ARM9DESC_MOUNT_WNAND: _bindgen_ty_5 = 8; +pub const ARM9DESC_MOUNT_CARDSPI: _bindgen_ty_5 = 16; +pub const ARM9DESC_USE_SDIF3: _bindgen_ty_5 = 32; +pub const ARM9DESC_CREATE_SEED: _bindgen_ty_5 = 64; +pub const ARM9DESC_USE_CARD_SPI: _bindgen_ty_5 = 128; +pub const ARM9DESC_SD_APPLICATION: _bindgen_ty_5 = 256; +pub const ARM9DESC_MOUNT_SDMC_RW: _bindgen_ty_5 = 512; +pub type _bindgen_ty_5 = u32; +pub const FSACCESS_CATEGORY_SYSTEM_APPLICATION: _bindgen_ty_6 = 1; +pub const FSACCESS_CATEGORY_HARDWARE_CHECK: _bindgen_ty_6 = 2; +pub const FSACCESS_CATEGORY_FILESYSTEM_TOOL: _bindgen_ty_6 = 4; +pub const FSACCESS_DEBUG: _bindgen_ty_6 = 8; +pub const FSACCESS_TWLCARD_BACKUP: _bindgen_ty_6 = 16; +pub const FSACCESS_TWLNAND_DATA: _bindgen_ty_6 = 32; +pub const FSACCESS_BOSS: _bindgen_ty_6 = 64; +pub const FSACCESS_SDMC_RW: _bindgen_ty_6 = 128; +pub const FSACCESS_CORE: _bindgen_ty_6 = 256; +pub const FSACCESS_NANDRO_RO: _bindgen_ty_6 = 512; +pub const FSACCESS_NANDRW: _bindgen_ty_6 = 1024; +pub const FSACCESS_NANDRO_RW: _bindgen_ty_6 = 2048; +pub const FSACCESS_CATEGORY_SYSTEM_SETTINGS: _bindgen_ty_6 = 4096; +pub const FSACCESS_CARDBOARD: _bindgen_ty_6 = 8192; +pub const FSACCESS_EXPORT_IMPORT_IVS: _bindgen_ty_6 = 16384; +pub const FSACCESS_SDMC_WO: _bindgen_ty_6 = 32768; +pub const FSACCESS_SWITCH_CLEANUP: _bindgen_ty_6 = 65536; +pub const FSACCESS_SAVEDATA_MOVE: _bindgen_ty_6 = 131072; +pub const FSACCESS_SHOP: _bindgen_ty_6 = 262144; +pub const FSACCESS_SHELL: _bindgen_ty_6 = 524288; +pub const FSACCESS_CATEGORY_HOME_MENU: _bindgen_ty_6 = 1048576; +pub const FSACCESS_SEEDDB: _bindgen_ty_6 = 2097152; +pub type _bindgen_ty_6 = u32; +pub const RESLIMIT_CATEGORY_APPLICATION: ResourceLimitCategory = 0; +pub const RESLIMIT_CATEGORY_SYS_APPLET: ResourceLimitCategory = 1; +pub const RESLIMIT_CATEGORY_LIB_APPLET: ResourceLimitCategory = 2; +pub const RESLIMIT_CATEGORY_OTHER: ResourceLimitCategory = 3; +pub type ResourceLimitCategory = u32; +pub const SYSMODE_O3DS_PROD: SystemMode = 0; +pub const SYSMODE_N3DS_PROD: SystemMode = 1; +pub const SYSMODE_DEV1: SystemMode = 2; +pub const SYSMODE_DEV2: SystemMode = 3; +pub const SYSMODE_DEV3: SystemMode = 4; +pub const SYSMODE_DEV4: SystemMode = 5; +pub type SystemMode = u32; +#[repr(C)] +pub struct ExHeader_SystemInfoFlags { + pub reserved: [u8; 5usize], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>, + pub remaster_version: u16, +} +impl ExHeader_SystemInfoFlags { + #[inline] + pub fn compress_exefs_code(&self) -> bool { + unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } + } + #[inline] + pub fn set_compress_exefs_code(&mut self, val: bool) { + unsafe { + let val: u8 = ::core::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn is_sd_application(&self) -> bool { + unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) } + } + #[inline] + pub fn set_is_sd_application(&mut self, val: bool) { + unsafe { + let val: u8 = ::core::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + compress_exefs_code: bool, + is_sd_application: bool, + ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let compress_exefs_code: u8 = unsafe { ::core::mem::transmute(compress_exefs_code) }; + compress_exefs_code as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let is_sd_application: u8 = unsafe { ::core::mem::transmute(is_sd_application) }; + is_sd_application as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +pub struct ExHeader_CodeSectionInfo { + pub address: u32, + pub num_pages: u32, + pub size: u32, +} +#[repr(C)] +pub struct ExHeader_CodeSetInfo { + pub name: [::libc::c_char; 8usize], + pub flags: ExHeader_SystemInfoFlags, + pub text: ExHeader_CodeSectionInfo, + pub stack_size: u32, + pub rodata: ExHeader_CodeSectionInfo, + pub reserved: u32, + pub data: ExHeader_CodeSectionInfo, + pub bss_size: u32, +} +#[repr(C)] +pub struct ExHeader_SystemInfo { + pub savedata_size: u64, + pub jump_id: u64, + pub reserved: [u8; 48usize], +} +#[repr(C)] +pub struct ExHeader_SystemControlInfo { + pub codeset_info: ExHeader_CodeSetInfo, + pub dependencies: [u64; 48usize], + pub system_info: ExHeader_SystemInfo, +} +#[repr(C)] +pub struct ExHeader_Arm11StorageInfo { + pub extdata_id: u64, + pub system_savedata_ids: [u32; 2usize], + pub accessible_savedata_ids: u64, + pub fs_access_info: u32, + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>, +} +impl ExHeader_Arm11StorageInfo { + #[inline] + pub fn reserved(&self) -> u32 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 24u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: u32) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(0usize, 24u8, val as u64) + } + } + #[inline] + pub fn no_romfs(&self) -> bool { + unsafe { ::core::mem::transmute(self._bitfield_1.get(24usize, 1u8) as u8) } + } + #[inline] + pub fn set_no_romfs(&mut self, val: bool) { + unsafe { + let val: u8 = ::core::mem::transmute(val); + self._bitfield_1.set(24usize, 1u8, val as u64) + } + } + #[inline] + pub fn use_extended_savedata_access(&self) -> bool { + unsafe { ::core::mem::transmute(self._bitfield_1.get(25usize, 1u8) as u8) } + } + #[inline] + pub fn set_use_extended_savedata_access(&mut self, val: bool) { + unsafe { + let val: u8 = ::core::mem::transmute(val); + self._bitfield_1.set(25usize, 1u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + reserved: u32, + no_romfs: bool, + use_extended_savedata_access: bool, + ) -> __BindgenBitfieldUnit<[u8; 4usize], u32> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u32> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 24u8, { + let reserved: u32 = unsafe { ::core::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit.set(24usize, 1u8, { + let no_romfs: u8 = unsafe { ::core::mem::transmute(no_romfs) }; + no_romfs as u64 + }); + __bindgen_bitfield_unit.set(25usize, 1u8, { + let use_extended_savedata_access: u8 = + unsafe { ::core::mem::transmute(use_extended_savedata_access) }; + use_extended_savedata_access as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +pub struct ExHeader_Arm11CoreInfo { + pub core_version: u32, + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 3usize], u8>, + pub priority: u8, +} +impl ExHeader_Arm11CoreInfo { + #[inline] + pub fn use_cpu_clockrate_804MHz(&self) -> bool { + unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } + } + #[inline] + pub fn set_use_cpu_clockrate_804MHz(&mut self, val: bool) { + unsafe { + let val: u8 = ::core::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn enable_l2c(&self) -> bool { + unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) } + } + #[inline] + pub fn set_enable_l2c(&mut self, val: bool) { + unsafe { + let val: u8 = ::core::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub fn flag1_unused(&self) -> u8 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 6u8) as u8) } + } + #[inline] + pub fn set_flag1_unused(&mut self, val: u8) { + unsafe { + let val: u8 = ::core::mem::transmute(val); + self._bitfield_1.set(2usize, 6u8, val as u64) + } + } + #[inline] + pub fn n3ds_system_mode(&self) -> SystemMode { + unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 4u8) as u32) } + } + #[inline] + pub fn set_n3ds_system_mode(&mut self, val: SystemMode) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(8usize, 4u8, val as u64) + } + } + #[inline] + pub fn flag2_unused(&self) -> u8 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 4u8) as u8) } + } + #[inline] + pub fn set_flag2_unused(&mut self, val: u8) { + unsafe { + let val: u8 = ::core::mem::transmute(val); + self._bitfield_1.set(12usize, 4u8, val as u64) + } + } + #[inline] + pub fn ideal_processor(&self) -> u8 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(16usize, 2u8) as u8) } + } + #[inline] + pub fn set_ideal_processor(&mut self, val: u8) { + unsafe { + let val: u8 = ::core::mem::transmute(val); + self._bitfield_1.set(16usize, 2u8, val as u64) + } + } + #[inline] + pub fn affinity_mask(&self) -> u8 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(18usize, 2u8) as u8) } + } + #[inline] + pub fn set_affinity_mask(&mut self, val: u8) { + unsafe { + let val: u8 = ::core::mem::transmute(val); + self._bitfield_1.set(18usize, 2u8, val as u64) + } + } + #[inline] + pub fn o3ds_system_mode(&self) -> SystemMode { + unsafe { ::core::mem::transmute(self._bitfield_1.get(20usize, 4u8) as u32) } + } + #[inline] + pub fn set_o3ds_system_mode(&mut self, val: SystemMode) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(20usize, 4u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + use_cpu_clockrate_804MHz: bool, + enable_l2c: bool, + flag1_unused: u8, + n3ds_system_mode: SystemMode, + flag2_unused: u8, + ideal_processor: u8, + affinity_mask: u8, + o3ds_system_mode: SystemMode, + ) -> __BindgenBitfieldUnit<[u8; 3usize], u8> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 3usize], u8> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let use_cpu_clockrate_804MHz: u8 = + unsafe { ::core::mem::transmute(use_cpu_clockrate_804MHz) }; + use_cpu_clockrate_804MHz as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let enable_l2c: u8 = unsafe { ::core::mem::transmute(enable_l2c) }; + enable_l2c as u64 + }); + __bindgen_bitfield_unit.set(2usize, 6u8, { + let flag1_unused: u8 = unsafe { ::core::mem::transmute(flag1_unused) }; + flag1_unused as u64 + }); + __bindgen_bitfield_unit.set(8usize, 4u8, { + let n3ds_system_mode: u32 = unsafe { ::core::mem::transmute(n3ds_system_mode) }; + n3ds_system_mode as u64 + }); + __bindgen_bitfield_unit.set(12usize, 4u8, { + let flag2_unused: u8 = unsafe { ::core::mem::transmute(flag2_unused) }; + flag2_unused as u64 + }); + __bindgen_bitfield_unit.set(16usize, 2u8, { + let ideal_processor: u8 = unsafe { ::core::mem::transmute(ideal_processor) }; + ideal_processor as u64 + }); + __bindgen_bitfield_unit.set(18usize, 2u8, { + let affinity_mask: u8 = unsafe { ::core::mem::transmute(affinity_mask) }; + affinity_mask as u64 + }); + __bindgen_bitfield_unit.set(20usize, 4u8, { + let o3ds_system_mode: u32 = unsafe { ::core::mem::transmute(o3ds_system_mode) }; + o3ds_system_mode as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +pub struct ExHeader_Arm11SystemLocalCapabilities { + pub title_id: u64, + pub core_info: ExHeader_Arm11CoreInfo, + pub reslimits: [u16; 16usize], + pub storage_info: ExHeader_Arm11StorageInfo, + pub service_access: [[::libc::c_char; 8usize]; 34usize], + pub reserved: [u8; 15usize], + pub reslimit_category: ResourceLimitCategory, + pub __bindgen_padding_0: u32, +} +#[repr(C)] +pub struct ExHeader_Arm11KernelCapabilities { + pub descriptors: [u32; 28usize], + pub reserved: [u8; 16usize], +} +#[repr(C)] +pub struct ExHeader_Arm9AccessControl { + pub descriptors: [u8; 15usize], + pub descriptor_version: u8, +} +#[repr(C)] +pub struct ExHeader_AccessControlInfo { + pub local_caps: ExHeader_Arm11SystemLocalCapabilities, + pub kernel_caps: ExHeader_Arm11KernelCapabilities, + pub access_control: ExHeader_Arm9AccessControl, +} +#[repr(C)] +pub struct ExHeader_Info { + pub sci: ExHeader_SystemControlInfo, + pub aci: ExHeader_AccessControlInfo, +} +#[repr(C)] +pub struct ExHeader_AccessDescriptor { + pub signature: [u8; 256usize], + pub ncchModulus: [u8; 256usize], + pub acli: ExHeader_AccessControlInfo, +} +#[repr(C)] +pub struct ExHeader { + pub info: ExHeader_Info, + pub access_descriptor: ExHeader_AccessDescriptor, +} +extern "C" { + pub fn srvInit() -> Result; +} +extern "C" { + pub fn srvExit(); +} +extern "C" { + pub fn srvSetBlockingPolicy(nonBlocking: bool); +} +extern "C" { + pub fn srvGetSessionHandle() -> *mut Handle; +} +extern "C" { + pub fn srvGetServiceHandle(out: *mut Handle, name: *const ::libc::c_char) -> Result; +} +extern "C" { + pub fn srvRegisterClient() -> Result; +} +extern "C" { + pub fn srvEnableNotification(semaphoreOut: *mut Handle) -> Result; +} +extern "C" { + pub fn srvRegisterService( + out: *mut Handle, + name: *const ::libc::c_char, + maxSessions: ::libc::c_int, + ) -> Result; +} +extern "C" { + pub fn srvUnregisterService(name: *const ::libc::c_char) -> Result; +} +extern "C" { + pub fn srvGetServiceHandleDirect(out: *mut Handle, name: *const ::libc::c_char) -> Result; +} +extern "C" { + pub fn srvRegisterPort(name: *const ::libc::c_char, clientHandle: Handle) -> Result; +} +extern "C" { + pub fn srvUnregisterPort(name: *const ::libc::c_char) -> Result; +} +extern "C" { + pub fn srvGetPort(out: *mut Handle, name: *const ::libc::c_char) -> Result; +} +extern "C" { + pub fn srvWaitForPortRegistered(name: *const ::libc::c_char) -> Result; +} +extern "C" { + pub fn srvSubscribe(notificationId: u32) -> Result; +} +extern "C" { + pub fn srvUnsubscribe(notificationId: u32) -> Result; +} +extern "C" { + pub fn srvReceiveNotification(notificationIdOut: *mut u32) -> Result; +} +extern "C" { + pub fn srvPublishToSubscriber(notificationId: u32, flags: u32) -> Result; +} +extern "C" { + pub fn srvPublishAndGetSubscriber( + processIdCountOut: *mut u32, + processIdsOut: *mut u32, + notificationId: u32, + ) -> Result; +} +extern "C" { + pub fn srvIsServiceRegistered(registeredOut: *mut bool, name: *const ::libc::c_char) -> Result; +} +extern "C" { + pub fn srvIsPortRegistered(registeredOut: *mut bool, name: *const ::libc::c_char) -> Result; +} +pub const ERRF_ERRTYPE_GENERIC: ERRF_ErrType = 0; +pub const ERRF_ERRTYPE_MEM_CORRUPT: ERRF_ErrType = 1; +pub const ERRF_ERRTYPE_CARD_REMOVED: ERRF_ErrType = 2; +pub const ERRF_ERRTYPE_EXCEPTION: ERRF_ErrType = 3; +pub const ERRF_ERRTYPE_FAILURE: ERRF_ErrType = 4; +pub const ERRF_ERRTYPE_LOGGED: ERRF_ErrType = 5; +pub type ERRF_ErrType = u32; +pub const ERRF_EXCEPTION_PREFETCH_ABORT: ERRF_ExceptionType = 0; +pub const ERRF_EXCEPTION_DATA_ABORT: ERRF_ExceptionType = 1; +pub const ERRF_EXCEPTION_UNDEFINED: ERRF_ExceptionType = 2; +pub const ERRF_EXCEPTION_VFP: ERRF_ExceptionType = 3; +pub type ERRF_ExceptionType = u32; +#[repr(C)] +pub struct ERRF_ExceptionInfo { + pub type_: ERRF_ExceptionType, + pub reserved: [u8; 3usize], + pub fsr: u32, + pub far: u32, + pub fpexc: u32, + pub fpinst: u32, + pub fpinst2: u32, +} +#[repr(C)] +pub struct ERRF_ExceptionData { + pub excep: ERRF_ExceptionInfo, + pub regs: CpuRegisters, +} +#[repr(C)] +pub struct ERRF_FatalErrInfo { + pub type_: ERRF_ErrType, + pub revHigh: u8, + pub revLow: u16, + pub resCode: u32, + pub pcAddr: u32, + pub procId: u32, + pub __bindgen_padding_0: u32, + pub titleId: u64, + pub appTitleId: u64, + pub data: ERRF_FatalErrInfo__bindgen_ty_1, +} +#[repr(C)] +pub struct ERRF_FatalErrInfo__bindgen_ty_1 { + pub exception_data: __BindgenUnionField, + pub failure_mesg: __BindgenUnionField<[::libc::c_char; 96usize]>, + pub bindgen_union_field: [u32; 24usize], +} +extern "C" { + pub fn errfInit() -> Result; +} +extern "C" { + pub fn errfExit(); +} +extern "C" { + pub fn errfGetSessionHandle() -> *mut Handle; +} +extern "C" { + pub fn ERRF_Throw(error: *const ERRF_FatalErrInfo) -> Result; +} +extern "C" { + pub fn ERRF_ThrowResult(failure: Result) -> Result; +} +extern "C" { + pub fn ERRF_ThrowResultWithMessage(failure: Result, message: *const ::libc::c_char) -> Result; +} +extern "C" { + pub fn ERRF_ExceptionHandler(excep: *mut ERRF_ExceptionInfo, regs: *mut CpuRegisters); +} +pub const MEMREGION_ALL: MemRegion = 0; +pub const MEMREGION_APPLICATION: MemRegion = 1; +pub const MEMREGION_SYSTEM: MemRegion = 2; +pub const MEMREGION_BASE: MemRegion = 3; +pub type MemRegion = u32; +#[repr(C)] +pub struct TickCounter { + pub elapsed: u64, + pub reference: u64, +} +#[repr(C)] +pub struct OS_VersionBin { + pub build: u8, + pub minor: u8, + pub mainver: u8, + pub reserved_x3: u8, + pub region: ::libc::c_char, + pub reserved_x5: [u8; 3usize], +} +extern "C" { + pub fn osConvertVirtToPhys(vaddr: *const ::libc::c_void) -> u32; +} +extern "C" { + pub fn osConvertOldLINEARMemToNew(vaddr: *const ::libc::c_void) -> *mut ::libc::c_void; +} +extern "C" { + pub fn osStrError(error: u32) -> *const ::libc::c_char; +} +extern "C" { + pub fn osGetMemRegionUsed(region: MemRegion) -> s64; +} +extern "C" { + pub fn osGetTime() -> u64; +} +extern "C" { + pub fn osTickCounterRead(cnt: *const TickCounter) -> f64; +} +extern "C" { + pub fn osSetSpeedupEnable(enable: bool); +} +extern "C" { + pub fn osGetSystemVersionData( + nver_versionbin: *mut OS_VersionBin, + cver_versionbin: *mut OS_VersionBin, + ) -> Result; +} +extern "C" { + pub fn osGetSystemVersionDataString( + nver_versionbin: *mut OS_VersionBin, + cver_versionbin: *mut OS_VersionBin, + sysverstr: *mut ::libc::c_char, + sysverstr_maxsize: u32, + ) -> Result; +} +pub type _LOCK_T = i32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __lock_t { + pub lock: _LOCK_T, + pub thread_tag: u32, + pub counter: u32, +} +pub type _LOCK_RECURSIVE_T = __lock_t; +extern "C" { + pub fn __libc_lock_init(lock: *mut _LOCK_T); +} +extern "C" { + pub fn __libc_lock_init_recursive(lock: *mut _LOCK_RECURSIVE_T); +} +extern "C" { + pub fn __libc_lock_close(lock: *mut _LOCK_T); +} +extern "C" { + pub fn __libc_lock_close_recursive(lock: *mut _LOCK_RECURSIVE_T); +} +extern "C" { + pub fn __libc_lock_acquire(lock: *mut _LOCK_T); +} +extern "C" { + pub fn __libc_lock_acquire_recursive(lock: *mut _LOCK_RECURSIVE_T); +} +extern "C" { + pub fn __libc_lock_release(lock: *mut _LOCK_T); +} +extern "C" { + pub fn __libc_lock_release_recursive(lock: *mut _LOCK_RECURSIVE_T); +} +extern "C" { + pub fn __libc_lock_try_acquire(lock: *mut _LOCK_T) -> ::libc::c_int; +} +extern "C" { + pub fn __libc_lock_try_acquire_recursive(lock: *mut _LOCK_RECURSIVE_T) -> ::libc::c_int; +} +pub type LightLock = _LOCK_T; +pub type RecursiveLock = _LOCK_RECURSIVE_T; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LightEvent { + pub state: s32, + pub lock: LightLock, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LightSemaphore { + pub current_count: s32, + pub num_threads_acq: s16, + pub max_count: s16, +} +extern "C" { + pub fn __sync_get_arbiter() -> Handle; +} +extern "C" { + pub fn LightLock_Init(lock: *mut LightLock); +} +extern "C" { + pub fn LightLock_Lock(lock: *mut LightLock); +} +extern "C" { + pub fn LightLock_TryLock(lock: *mut LightLock) -> ::libc::c_int; +} +extern "C" { + pub fn LightLock_Unlock(lock: *mut LightLock); +} +extern "C" { + pub fn RecursiveLock_Init(lock: *mut RecursiveLock); +} +extern "C" { + pub fn RecursiveLock_Lock(lock: *mut RecursiveLock); +} +extern "C" { + pub fn RecursiveLock_TryLock(lock: *mut RecursiveLock) -> ::libc::c_int; +} +extern "C" { + pub fn RecursiveLock_Unlock(lock: *mut RecursiveLock); +} +extern "C" { + pub fn LightEvent_Init(event: *mut LightEvent, reset_type: ResetType); +} +extern "C" { + pub fn LightEvent_Clear(event: *mut LightEvent); +} +extern "C" { + pub fn LightEvent_Pulse(event: *mut LightEvent); +} +extern "C" { + pub fn LightEvent_Signal(event: *mut LightEvent); +} +extern "C" { + pub fn LightEvent_TryWait(event: *mut LightEvent) -> ::libc::c_int; +} +extern "C" { + pub fn LightEvent_Wait(event: *mut LightEvent); +} +extern "C" { + pub fn LightSemaphore_Init(semaphore: *mut LightSemaphore, initial_count: s16, max_count: s16); +} +extern "C" { + pub fn LightSemaphore_Acquire(semaphore: *mut LightSemaphore, count: s32); +} +extern "C" { + pub fn LightSemaphore_Release(semaphore: *mut LightSemaphore, count: s32); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct Thread_tag { + _unused: [u8; 0], +} +pub type Thread = *mut Thread_tag; +pub type ExceptionHandler = ::core::option::Option< + unsafe extern "C" fn(excep: *mut ERRF_ExceptionInfo, regs: *mut CpuRegisters), +>; +extern "C" { + pub fn threadCreate( + entrypoint: ThreadFunc, + arg: *mut ::libc::c_void, + stack_size: usize, + prio: ::libc::c_int, + affinity: ::libc::c_int, + detached: bool, + ) -> Thread; +} +extern "C" { + pub fn threadGetHandle(thread: Thread) -> Handle; +} +extern "C" { + pub fn threadGetExitCode(thread: Thread) -> ::libc::c_int; +} +extern "C" { + pub fn threadFree(thread: Thread); +} +extern "C" { + pub fn threadJoin(thread: Thread, timeout_ns: u64) -> Result; +} +extern "C" { + pub fn threadDetach(thread: Thread); +} +extern "C" { + pub fn threadGetCurrent() -> Thread; +} +extern "C" { + pub fn threadExit(rc: ::libc::c_int); +} +#[repr(C)] +pub struct GSPGPU_FramebufferInfo { + pub active_framebuf: u32, + pub framebuf0_vaddr: *mut u32, + pub framebuf1_vaddr: *mut u32, + pub framebuf_widthbytesize: u32, + pub format: u32, + pub framebuf_dispselect: u32, + pub unk: u32, +} +pub const GSP_RGBA8_OES: GSPGPU_FramebufferFormats = 0; +pub const GSP_BGR8_OES: GSPGPU_FramebufferFormats = 1; +pub const GSP_RGB565_OES: GSPGPU_FramebufferFormats = 2; +pub const GSP_RGB5_A1_OES: GSPGPU_FramebufferFormats = 3; +pub const GSP_RGBA4_OES: GSPGPU_FramebufferFormats = 4; +pub type GSPGPU_FramebufferFormats = u32; +#[repr(C)] +pub struct GSPGPU_CaptureInfoEntry { + pub framebuf0_vaddr: *mut u32, + pub framebuf1_vaddr: *mut u32, + pub format: u32, + pub framebuf_widthbytesize: u32, +} +#[repr(C)] +pub struct GSPGPU_CaptureInfo { + pub screencapture: [GSPGPU_CaptureInfoEntry; 2usize], +} +pub const GSPGPU_EVENT_PSC0: GSPGPU_Event = 0; +pub const GSPGPU_EVENT_PSC1: GSPGPU_Event = 1; +pub const GSPGPU_EVENT_VBlank0: GSPGPU_Event = 2; +pub const GSPGPU_EVENT_VBlank1: GSPGPU_Event = 3; +pub const GSPGPU_EVENT_PPF: GSPGPU_Event = 4; +pub const GSPGPU_EVENT_P3D: GSPGPU_Event = 5; +pub const GSPGPU_EVENT_DMA: GSPGPU_Event = 6; +pub const GSPGPU_EVENT_MAX: GSPGPU_Event = 7; +pub type GSPGPU_Event = u32; +extern "C" { + pub fn gspInit() -> Result; +} +extern "C" { + pub fn gspExit(); +} +extern "C" { + pub fn gspSetEventCallback( + id: GSPGPU_Event, + cb: ThreadFunc, + data: *mut ::libc::c_void, + oneShot: bool, + ); +} +extern "C" { + pub fn gspInitEventHandler(gspEvent: Handle, gspSharedMem: *mut vu8, gspThreadId: u8) + -> Result; +} +extern "C" { + pub fn gspExitEventHandler(); +} +extern "C" { + pub fn gspWaitForEvent(id: GSPGPU_Event, nextEvent: bool); +} +extern "C" { + pub fn gspWaitForAnyEvent() -> GSPGPU_Event; +} +extern "C" { + pub fn gspSubmitGxCommand(sharedGspCmdBuf: *mut u32, gxCommand: *mut u32) -> Result; +} +extern "C" { + pub fn GSPGPU_AcquireRight(flags: u8) -> Result; +} +extern "C" { + pub fn GSPGPU_ReleaseRight() -> Result; +} +extern "C" { + pub fn GSPGPU_ImportDisplayCaptureInfo(captureinfo: *mut GSPGPU_CaptureInfo) -> Result; +} +extern "C" { + pub fn GSPGPU_SaveVramSysArea() -> Result; +} +extern "C" { + pub fn GSPGPU_RestoreVramSysArea() -> Result; +} +extern "C" { + pub fn GSPGPU_SetLcdForceBlack(flags: u8) -> Result; +} +extern "C" { + pub fn GSPGPU_SetBufferSwap(screenid: u32, framebufinfo: *mut GSPGPU_FramebufferInfo) + -> Result; +} +extern "C" { + pub fn GSPGPU_FlushDataCache(adr: *const ::libc::c_void, size: u32) -> Result; +} +extern "C" { + pub fn GSPGPU_InvalidateDataCache(adr: *const ::libc::c_void, size: u32) -> Result; +} +extern "C" { + pub fn GSPGPU_WriteHWRegs(regAddr: u32, data: *mut u32, size: u8) -> Result; +} +extern "C" { + pub fn GSPGPU_WriteHWRegsWithMask( + regAddr: u32, + data: *mut u32, + datasize: u8, + maskdata: *mut u32, + masksize: u8, + ) -> Result; +} +extern "C" { + pub fn GSPGPU_ReadHWRegs(regAddr: u32, data: *mut u32, size: u8) -> Result; +} +extern "C" { + pub fn GSPGPU_RegisterInterruptRelayQueue( + eventHandle: Handle, + flags: u32, + outMemHandle: *mut Handle, + threadID: *mut u8, + ) -> Result; +} +extern "C" { + pub fn GSPGPU_UnregisterInterruptRelayQueue() -> Result; +} +extern "C" { + pub fn GSPGPU_TriggerCmdReqQueue() -> Result; +} +extern "C" { + pub fn GSPGPU_SetLedForceOff(disable: bool) -> Result; +} +pub const GFX_TOP: gfxScreen_t = 0; +pub const GFX_BOTTOM: gfxScreen_t = 1; +pub type gfxScreen_t = u32; +pub const GFX_LEFT: gfx3dSide_t = 0; +pub const GFX_RIGHT: gfx3dSide_t = 1; +pub type gfx3dSide_t = u32; +extern "C" { + pub fn gfxInitDefault(); +} +extern "C" { + pub fn gfxInit( + topFormat: GSPGPU_FramebufferFormats, + bottomFormat: GSPGPU_FramebufferFormats, + vrambuffers: bool, + ); +} +extern "C" { + pub fn gfxExit(); +} +extern "C" { + pub fn gfxSet3D(enable: bool); +} +extern "C" { + pub fn gfxIs3D() -> bool; +} +extern "C" { + pub fn gfxSetScreenFormat(screen: gfxScreen_t, format: GSPGPU_FramebufferFormats); +} +extern "C" { + pub fn gfxGetScreenFormat(screen: gfxScreen_t) -> GSPGPU_FramebufferFormats; +} +extern "C" { + pub fn gfxSetDoubleBuffering(screen: gfxScreen_t, doubleBuffering: bool); +} +extern "C" { + pub fn gfxFlushBuffers(); +} +extern "C" { + pub fn gfxConfigScreen(scr: gfxScreen_t, immediate: bool); +} +extern "C" { + pub fn gfxSwapBuffers(); +} +extern "C" { + pub fn gfxSwapBuffersGpu(); +} +extern "C" { + pub fn gfxGetFramebuffer( + screen: gfxScreen_t, + side: gfx3dSide_t, + width: *mut u16, + height: *mut u16, + ) -> *mut u8; +} +extern "C" { + pub static mut gfxTopLeftFramebuffers: [*mut u8; 2usize]; +} +extern "C" { + pub static mut gfxTopRightFramebuffers: [*mut u8; 2usize]; +} +extern "C" { + pub static mut gfxBottomFramebuffers: [*mut u8; 2usize]; +} +pub type ConsolePrint = ::core::option::Option< + unsafe extern "C" fn(con: *mut ::libc::c_void, c: ::libc::c_int) -> bool, +>; +#[repr(C)] +pub struct ConsoleFont { + pub gfx: *mut u8, + pub asciiOffset: u16, + pub numChars: u16, +} +#[repr(C)] +pub struct PrintConsole { + pub font: ConsoleFont, + pub frameBuffer: *mut u16, + pub cursorX: ::libc::c_int, + pub cursorY: ::libc::c_int, + pub prevCursorX: ::libc::c_int, + pub prevCursorY: ::libc::c_int, + pub consoleWidth: ::libc::c_int, + pub consoleHeight: ::libc::c_int, + pub windowX: ::libc::c_int, + pub windowY: ::libc::c_int, + pub windowWidth: ::libc::c_int, + pub windowHeight: ::libc::c_int, + pub tabSize: ::libc::c_int, + pub fg: ::libc::c_int, + pub bg: ::libc::c_int, + pub flags: ::libc::c_int, + pub PrintChar: ConsolePrint, + pub consoleInitialised: bool, +} +pub const debugDevice_NULL: debugDevice = 0; +pub const debugDevice_SVC: debugDevice = 1; +pub const debugDevice_CONSOLE: debugDevice = 2; +pub const debugDevice_3DMOO: debugDevice = 1; +pub type debugDevice = u32; +extern "C" { + pub fn consoleSetFont(console: *mut PrintConsole, font: *mut ConsoleFont); +} +extern "C" { + pub fn consoleSetWindow( + console: *mut PrintConsole, + x: ::libc::c_int, + y: ::libc::c_int, + width: ::libc::c_int, + height: ::libc::c_int, + ); +} +extern "C" { + pub fn consoleGetDefault() -> *mut PrintConsole; +} +extern "C" { + pub fn consoleSelect(console: *mut PrintConsole) -> *mut PrintConsole; +} +extern "C" { + pub fn consoleInit(screen: gfxScreen_t, console: *mut PrintConsole) -> *mut PrintConsole; +} +extern "C" { + pub fn consoleDebugInit(device: debugDevice); +} +extern "C" { + pub fn consoleClear(); +} +pub const RUNFLAG_APTWORKAROUND: _bindgen_ty_7 = 1; +pub const RUNFLAG_APTREINIT: _bindgen_ty_7 = 2; +pub const RUNFLAG_APTCHAINLOAD: _bindgen_ty_7 = 4; +pub type _bindgen_ty_7 = u32; +extern "C" { + pub fn envGetHandle(name: *const ::libc::c_char) -> Handle; +} +pub type _off_t = __int64_t; +pub type _fpos_t = __int64_t; +pub type __ino_t = __uint32_t; +pub type __dev_t = __uint32_t; +pub type u_int8_t = __uint8_t; +pub type u_int16_t = __uint16_t; +pub type u_int32_t = __uint32_t; +pub type u_int64_t = __uint64_t; +pub type register_t = ::libc::c_int; +pub type __blkcnt_t = ::libc::c_long; +pub type __blksize_t = ::libc::c_long; +pub type __fsblkcnt_t = __uint64_t; +pub type __fsfilcnt_t = __uint32_t; +pub type __pid_t = ::libc::c_int; +pub type __uid_t = ::libc::c_ushort; +pub type __gid_t = ::libc::c_ushort; +pub type __id_t = __uint32_t; +pub type __mode_t = __uint32_t; +pub type _off64_t = ::libc::c_longlong; +pub type __off_t = _off_t; +pub type __loff_t = _off64_t; +pub type __key_t = ::libc::c_long; +pub type __size_t = ::libc::c_uint; +pub type _ssize_t = ::libc::c_int; +pub type __ssize_t = _ssize_t; +pub type wint_t = ::libc::c_int; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _mbstate_t { + pub __count: ::libc::c_int, + pub __value: _mbstate_t__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _mbstate_t__bindgen_ty_1 { + pub __wch: wint_t, + pub __wchb: [::libc::c_uchar; 4usize], + _bindgen_union_align: u32, +} +pub type _flock_t = _LOCK_RECURSIVE_T; +pub type _iconv_t = *mut ::libc::c_void; +pub type __clock_t = ::libc::c_ulong; +pub type __time_t = __int_least64_t; +pub type __clockid_t = ::libc::c_ulong; +pub type __timer_t = ::libc::c_ulong; +pub type __sa_family_t = __uint8_t; +pub type __socklen_t = __uint32_t; +pub type __nl_item = ::libc::c_int; +pub type __nlink_t = ::libc::c_ushort; +pub type __suseconds_t = ::libc::c_long; +pub type __useconds_t = ::libc::c_ulong; +pub type __sigset_t = ::libc::c_ulong; +pub type suseconds_t = __suseconds_t; +pub type time_t = __int_least64_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct timeval { + pub tv_sec: time_t, + pub tv_usec: suseconds_t, + pub __bindgen_padding_0: u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct timespec { + pub tv_sec: time_t, + pub tv_nsec: ::libc::c_long, + pub __bindgen_padding_0: u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct itimerspec { + pub it_interval: timespec, + pub it_value: timespec, +} +pub type sigset_t = __sigset_t; +pub type fd_mask = ::libc::c_ulong; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _types_fd_set { + pub fds_bits: [fd_mask; 2usize], +} +extern "C" { + pub fn select( + __n: ::libc::c_int, + __readfds: *mut _types_fd_set, + __writefds: *mut _types_fd_set, + __exceptfds: *mut _types_fd_set, + __timeout: *mut timeval, + ) -> ::libc::c_int; +} +extern "C" { + pub fn pselect( + __n: ::libc::c_int, + __readfds: *mut _types_fd_set, + __writefds: *mut _types_fd_set, + __exceptfds: *mut _types_fd_set, + __timeout: *const timespec, + __set: *const sigset_t, + ) -> ::libc::c_int; +} +pub type in_addr_t = __uint32_t; +pub type in_port_t = __uint16_t; +pub type u_char = ::libc::c_uchar; +pub type u_short = ::libc::c_ushort; +pub type u_int = ::libc::c_uint; +pub type u_long = ::libc::c_ulong; +pub type ushort = ::libc::c_ushort; +pub type uint = ::libc::c_uint; +pub type ulong = ::libc::c_ulong; +pub type blkcnt_t = __blkcnt_t; +pub type blksize_t = __blksize_t; +pub type clock_t = ::libc::c_ulong; +pub type daddr_t = ::libc::c_long; +pub type caddr_t = *mut ::libc::c_char; +pub type fsblkcnt_t = __fsblkcnt_t; +pub type fsfilcnt_t = __fsfilcnt_t; +pub type id_t = __id_t; +pub type ino_t = __ino_t; +pub type off_t = __off_t; +pub type dev_t = __dev_t; +pub type uid_t = __uid_t; +pub type gid_t = __gid_t; +pub type pid_t = __pid_t; +pub type key_t = __key_t; +pub type mode_t = __mode_t; +pub type nlink_t = __nlink_t; +pub type clockid_t = __clockid_t; +pub type timer_t = __timer_t; +pub type useconds_t = __useconds_t; +pub type sbintime_t = __int64_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sched_param { + pub sched_priority: ::libc::c_int, +} +pub type pthread_t = __uint32_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pthread_attr_t { + pub is_initialized: ::libc::c_int, + pub stackaddr: *mut ::libc::c_void, + pub stacksize: ::libc::c_int, + pub contentionscope: ::libc::c_int, + pub inheritsched: ::libc::c_int, + pub schedpolicy: ::libc::c_int, + pub schedparam: sched_param, + pub detachstate: ::libc::c_int, +} +pub type pthread_mutex_t = __uint32_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pthread_mutexattr_t { + pub is_initialized: ::libc::c_int, + pub recursive: ::libc::c_int, +} +pub type pthread_cond_t = __uint32_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pthread_condattr_t { + pub is_initialized: ::libc::c_int, + pub clock: clock_t, +} +pub type pthread_key_t = __uint32_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pthread_once_t { + pub is_initialized: ::libc::c_int, + pub init_executed: ::libc::c_int, +} +pub const DECOMPRESS_DUMMY: decompressType = 0; +pub const DECOMPRESS_LZSS: decompressType = 16; +pub const DECOMPRESS_LZ10: decompressType = 16; +pub const DECOMPRESS_LZ11: decompressType = 17; +pub const DECOMPRESS_HUFF1: decompressType = 33; +pub const DECOMPRESS_HUFF2: decompressType = 34; +pub const DECOMPRESS_HUFF3: decompressType = 35; +pub const DECOMPRESS_HUFF4: decompressType = 36; +pub const DECOMPRESS_HUFF5: decompressType = 37; +pub const DECOMPRESS_HUFF6: decompressType = 38; +pub const DECOMPRESS_HUFF7: decompressType = 39; +pub const DECOMPRESS_HUFF8: decompressType = 40; +pub const DECOMPRESS_HUFF: decompressType = 40; +pub const DECOMPRESS_RLE: decompressType = 48; +pub type decompressType = u32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct decompressIOVec { + pub data: *mut ::libc::c_void, + pub size: usize, +} +pub type decompressCallback = ::core::option::Option< + unsafe extern "C" fn( + userdata: *mut ::libc::c_void, + buffer: *mut ::libc::c_void, + size: usize, + ) -> isize, +>; +extern "C" { + pub fn decompressCallback_FD( + userdata: *mut ::libc::c_void, + buffer: *mut ::libc::c_void, + size: usize, + ) -> isize; +} +extern "C" { + pub fn decompressCallback_Stdio( + userdata: *mut ::libc::c_void, + buffer: *mut ::libc::c_void, + size: usize, + ) -> isize; +} +extern "C" { + pub fn decompressHeader( + type_: *mut decompressType, + size: *mut usize, + callback: decompressCallback, + userdata: *mut ::libc::c_void, + insize: usize, + ) -> isize; +} +extern "C" { + pub fn decompressV( + iov: *const decompressIOVec, + iovcnt: usize, + callback: decompressCallback, + userdata: *mut ::libc::c_void, + insize: usize, + ) -> bool; +} +extern "C" { + pub fn decompressV_LZSS( + iov: *const decompressIOVec, + iovcnt: usize, + callback: decompressCallback, + userdata: *mut ::libc::c_void, + insize: usize, + ) -> bool; +} +extern "C" { + pub fn decompressV_LZ11( + iov: *const decompressIOVec, + iovcnt: usize, + callback: decompressCallback, + userdata: *mut ::libc::c_void, + insize: usize, + ) -> bool; +} +extern "C" { + pub fn decompressV_Huff( + bits: usize, + iov: *const decompressIOVec, + iovcnt: usize, + callback: decompressCallback, + userdata: *mut ::libc::c_void, + insize: usize, + ) -> bool; +} +extern "C" { + pub fn decompressV_RLE( + iov: *const decompressIOVec, + iovcnt: usize, + callback: decompressCallback, + userdata: *mut ::libc::c_void, + insize: usize, + ) -> bool; +} +extern "C" { + pub fn decode_utf8(out: *mut u32, in_: *const u8) -> isize; +} +extern "C" { + pub fn decode_utf16(out: *mut u32, in_: *const u16) -> isize; +} +extern "C" { + pub fn encode_utf8(out: *mut u8, in_: u32) -> isize; +} +extern "C" { + pub fn encode_utf16(out: *mut u16, in_: u32) -> isize; +} +extern "C" { + pub fn utf8_to_utf16(out: *mut u16, in_: *const u8, len: usize) -> isize; +} +extern "C" { + pub fn utf8_to_utf32(out: *mut u32, in_: *const u8, len: usize) -> isize; +} +extern "C" { + pub fn utf16_to_utf8(out: *mut u8, in_: *const u16, len: usize) -> isize; +} +extern "C" { + pub fn utf16_to_utf32(out: *mut u32, in_: *const u16, len: usize) -> isize; +} +extern "C" { + pub fn utf32_to_utf8(out: *mut u8, in_: *const u32, len: usize) -> isize; +} +extern "C" { + pub fn utf32_to_utf16(out: *mut u16, in_: *const u32, len: usize) -> isize; +} +extern "C" { + pub fn linearAlloc(size: usize) -> *mut ::libc::c_void; +} +extern "C" { + pub fn linearMemAlign(size: usize, alignment: usize) -> *mut ::libc::c_void; +} +extern "C" { + pub fn linearRealloc(mem: *mut ::libc::c_void, size: usize) -> *mut ::libc::c_void; +} +extern "C" { + pub fn linearGetSize(mem: *mut ::libc::c_void) -> usize; +} +extern "C" { + pub fn linearFree(mem: *mut ::libc::c_void); +} +extern "C" { + pub fn linearSpaceFree() -> u32; +} +extern "C" { + pub fn mappableAlloc(size: usize) -> *mut ::libc::c_void; +} +extern "C" { + pub fn mappableGetSize(mem: *mut ::libc::c_void) -> usize; +} +extern "C" { + pub fn mappableFree(mem: *mut ::libc::c_void); +} +extern "C" { + pub fn mappableSpaceFree() -> u32; +} +extern "C" { + pub fn vramAlloc(size: usize) -> *mut ::libc::c_void; +} +extern "C" { + pub fn vramMemAlign(size: usize, alignment: usize) -> *mut ::libc::c_void; +} +extern "C" { + pub fn vramRealloc(mem: *mut ::libc::c_void, size: usize) -> *mut ::libc::c_void; +} +extern "C" { + pub fn vramGetSize(mem: *mut ::libc::c_void) -> usize; +} +extern "C" { + pub fn vramFree(mem: *mut ::libc::c_void); +} +extern "C" { + pub fn vramSpaceFree() -> u32; +} +pub const AC_OPEN: acSecurityMode = 0; +pub const AC_WEP_40BIT: acSecurityMode = 1; +pub const AC_WEP_104BIT: acSecurityMode = 2; +pub const AC_WEP_128BIT: acSecurityMode = 3; +pub const AC_WPA_TKIP: acSecurityMode = 4; +pub const AC_WPA2_TKIP: acSecurityMode = 5; +pub const AC_WPA_AES: acSecurityMode = 6; +pub const AC_WPA2_AES: acSecurityMode = 7; +pub type acSecurityMode = u32; +extern "C" { + pub fn acInit() -> Result; +} +extern "C" { + pub fn acExit(); +} +extern "C" { + pub fn acWaitInternetConnection() -> Result; +} +extern "C" { + pub fn ACU_GetWifiStatus(out: *mut u32) -> Result; +} +extern "C" { + pub fn ACU_GetStatus(out: *mut u32) -> Result; +} +extern "C" { + pub fn ACU_GetSecurityMode(mode: *mut acSecurityMode) -> Result; +} +extern "C" { + pub fn ACU_GetSSID(SSID: *mut ::libc::c_char) -> Result; +} +extern "C" { + pub fn ACU_GetSSIDLength(out: *mut u32) -> Result; +} +extern "C" { + pub fn ACU_GetProxyEnable(enable: *mut bool) -> Result; +} +extern "C" { + pub fn ACU_GetProxyPort(out: *mut u32) -> Result; +} +extern "C" { + pub fn ACU_GetProxyUserName(username: *mut ::libc::c_char) -> Result; +} +extern "C" { + pub fn ACU_GetProxyPassword(password: *mut ::libc::c_char) -> Result; +} +extern "C" { + pub fn ACU_GetLastErrorCode(errorCode: *mut u32) -> Result; +} +extern "C" { + pub fn ACU_GetLastDetailErrorCode(errorCode: *mut u32) -> Result; +} +pub const FS_OPEN_READ: _bindgen_ty_8 = 1; +pub const FS_OPEN_WRITE: _bindgen_ty_8 = 2; +pub const FS_OPEN_CREATE: _bindgen_ty_8 = 4; +pub type _bindgen_ty_8 = u32; +pub const FS_WRITE_FLUSH: _bindgen_ty_9 = 1; +pub const FS_WRITE_UPDATE_TIME: _bindgen_ty_9 = 256; +pub type _bindgen_ty_9 = u32; +pub const FS_ATTRIBUTE_DIRECTORY: _bindgen_ty_10 = 1; +pub const FS_ATTRIBUTE_HIDDEN: _bindgen_ty_10 = 256; +pub const FS_ATTRIBUTE_ARCHIVE: _bindgen_ty_10 = 65536; +pub const FS_ATTRIBUTE_READ_ONLY: _bindgen_ty_10 = 16777216; +pub type _bindgen_ty_10 = u32; +pub const MEDIATYPE_NAND: FS_MediaType = 0; +pub const MEDIATYPE_SD: FS_MediaType = 1; +pub const MEDIATYPE_GAME_CARD: FS_MediaType = 2; +pub type FS_MediaType = u32; +pub const SYSTEM_MEDIATYPE_CTR_NAND: FS_SystemMediaType = 0; +pub const SYSTEM_MEDIATYPE_TWL_NAND: FS_SystemMediaType = 1; +pub const SYSTEM_MEDIATYPE_SD: FS_SystemMediaType = 2; +pub const SYSTEM_MEDIATYPE_TWL_PHOTO: FS_SystemMediaType = 3; +pub type FS_SystemMediaType = u32; +pub const ARCHIVE_ROMFS: FS_ArchiveID = 3; +pub const ARCHIVE_SAVEDATA: FS_ArchiveID = 4; +pub const ARCHIVE_EXTDATA: FS_ArchiveID = 6; +pub const ARCHIVE_SHARED_EXTDATA: FS_ArchiveID = 7; +pub const ARCHIVE_SYSTEM_SAVEDATA: FS_ArchiveID = 8; +pub const ARCHIVE_SDMC: FS_ArchiveID = 9; +pub const ARCHIVE_SDMC_WRITE_ONLY: FS_ArchiveID = 10; +pub const ARCHIVE_BOSS_EXTDATA: FS_ArchiveID = 305419896; +pub const ARCHIVE_CARD_SPIFS: FS_ArchiveID = 305419897; +pub const ARCHIVE_EXTDATA_AND_BOSS_EXTDATA: FS_ArchiveID = 305419899; +pub const ARCHIVE_SYSTEM_SAVEDATA2: FS_ArchiveID = 305419900; +pub const ARCHIVE_NAND_RW: FS_ArchiveID = 305419901; +pub const ARCHIVE_NAND_RO: FS_ArchiveID = 305419902; +pub const ARCHIVE_NAND_RO_WRITE_ACCESS: FS_ArchiveID = 305419903; +pub const ARCHIVE_SAVEDATA_AND_CONTENT: FS_ArchiveID = 591751050; +pub const ARCHIVE_SAVEDATA_AND_CONTENT2: FS_ArchiveID = 591751054; +pub const ARCHIVE_NAND_CTR_FS: FS_ArchiveID = 1450741931; +pub const ARCHIVE_TWL_PHOTO: FS_ArchiveID = 1450741932; +pub const ARCHIVE_TWL_SOUND: FS_ArchiveID = 1450741933; +pub const ARCHIVE_NAND_TWL_FS: FS_ArchiveID = 1450741934; +pub const ARCHIVE_NAND_W_FS: FS_ArchiveID = 1450741935; +pub const ARCHIVE_GAMECARD_SAVEDATA: FS_ArchiveID = 1450741937; +pub const ARCHIVE_USER_SAVEDATA: FS_ArchiveID = 1450741938; +pub const ARCHIVE_DEMO_SAVEDATA: FS_ArchiveID = 1450741940; +pub type FS_ArchiveID = u32; +pub const PATH_INVALID: FS_PathType = 0; +pub const PATH_EMPTY: FS_PathType = 1; +pub const PATH_BINARY: FS_PathType = 2; +pub const PATH_ASCII: FS_PathType = 3; +pub const PATH_UTF16: FS_PathType = 4; +pub type FS_PathType = u32; +pub const SECUREVALUE_SLOT_SD: FS_SecureValueSlot = 4096; +pub type FS_SecureValueSlot = u32; +pub const BAUDRATE_512KHZ: FS_CardSpiBaudRate = 0; +pub const BAUDRATE_1MHZ: FS_CardSpiBaudRate = 1; +pub const BAUDRATE_2MHZ: FS_CardSpiBaudRate = 2; +pub const BAUDRATE_4MHZ: FS_CardSpiBaudRate = 3; +pub const BAUDRATE_8MHZ: FS_CardSpiBaudRate = 4; +pub const BAUDRATE_16MHZ: FS_CardSpiBaudRate = 5; +pub type FS_CardSpiBaudRate = u32; +pub const BUSMODE_1BIT: FS_CardSpiBusMode = 0; +pub const BUSMODE_4BIT: FS_CardSpiBusMode = 1; +pub type FS_CardSpiBusMode = u32; +pub const SPECIALCONTENT_UPDATE: FS_SpecialContentType = 1; +pub const SPECIALCONTENT_MANUAL: FS_SpecialContentType = 2; +pub const SPECIALCONTENT_DLP_CHILD: FS_SpecialContentType = 3; +pub type FS_SpecialContentType = u32; +pub const CARD_CTR: FS_CardType = 0; +pub const CARD_TWL: FS_CardType = 1; +pub type FS_CardType = u32; +pub const FS_ACTION_UNKNOWN: FS_Action = 0; +pub type FS_Action = u32; +pub const ARCHIVE_ACTION_COMMIT_SAVE_DATA: FS_ArchiveAction = 0; +pub const ARCHIVE_ACTION_GET_TIMESTAMP: FS_ArchiveAction = 1; +pub type FS_ArchiveAction = u32; +pub const SECURESAVE_ACTION_DELETE: FS_SecureSaveAction = 0; +pub const SECURESAVE_ACTION_FORMAT: FS_SecureSaveAction = 1; +pub type FS_SecureSaveAction = u32; +pub const FILE_ACTION_UNKNOWN: FS_FileAction = 0; +pub type FS_FileAction = u32; +pub const DIRECTORY_ACTION_UNKNOWN: FS_DirectoryAction = 0; +pub type FS_DirectoryAction = u32; +#[repr(C)] +pub struct FS_DirectoryEntry { + pub name: [u16; 262usize], + pub shortName: [::libc::c_char; 10usize], + pub shortExt: [::libc::c_char; 4usize], + pub valid: u8, + pub reserved: u8, + pub attributes: u32, + pub fileSize: u64, +} +#[repr(C)] +pub struct FS_ArchiveResource { + pub sectorSize: u32, + pub clusterSize: u32, + pub totalClusters: u32, + pub freeClusters: u32, +} +#[repr(C)] +pub struct FS_ProgramInfo { + pub programId: u64, + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>, + pub padding: [u8; 7usize], +} +impl FS_ProgramInfo { + #[inline] + pub fn mediaType(&self) -> FS_MediaType { + unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 8u8) as u32) } + } + #[inline] + pub fn set_mediaType(&mut self, val: FS_MediaType) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(0usize, 8u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1(mediaType: FS_MediaType) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 8u8, { + let mediaType: u32 = unsafe { ::core::mem::transmute(mediaType) }; + mediaType as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +pub struct FS_ProductInfo { + pub productCode: [::libc::c_char; 16usize], + pub companyCode: [::libc::c_char; 2usize], + pub remasterVersion: u16, +} +#[repr(C)] +pub struct FS_IntegrityVerificationSeed { + pub aesCbcMac: [u8; 16usize], + pub movableSed: [u8; 288usize], +} +#[repr(C, packed)] +pub struct FS_ExtSaveDataInfo { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>, + pub unknown: u8, + pub reserved1: u16, + pub saveId: u64, + pub reserved2: u32, +} +impl FS_ExtSaveDataInfo { + #[inline] + pub fn mediaType(&self) -> FS_MediaType { + unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 8u8) as u32) } + } + #[inline] + pub fn set_mediaType(&mut self, val: FS_MediaType) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(0usize, 8u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1(mediaType: FS_MediaType) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 8u8, { + let mediaType: u32 = unsafe { ::core::mem::transmute(mediaType) }; + mediaType as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +pub struct FS_SystemSaveDataInfo { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>, + pub unknown: u8, + pub reserved: u16, + pub saveId: u32, +} +impl FS_SystemSaveDataInfo { + #[inline] + pub fn mediaType(&self) -> FS_MediaType { + unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 8u8) as u32) } + } + #[inline] + pub fn set_mediaType(&mut self, val: FS_MediaType) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(0usize, 8u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1(mediaType: FS_MediaType) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 8u8, { + let mediaType: u32 = unsafe { ::core::mem::transmute(mediaType) }; + mediaType as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +pub struct FS_DeviceMoveContext { + pub ivs: [u8; 16usize], + pub encryptParameter: [u8; 16usize], +} +#[repr(C)] +pub struct FS_Path { + pub type_: FS_PathType, + pub size: u32, + pub data: *const ::libc::c_void, +} +pub type FS_Archive = u64; +extern "C" { + pub fn fsInit() -> Result; +} +extern "C" { + pub fn fsExit(); +} +extern "C" { + pub fn fsUseSession(session: Handle); +} +extern "C" { + pub fn fsEndUseSession(); +} +extern "C" { + pub fn fsExemptFromSession(archive: FS_Archive); +} +extern "C" { + pub fn fsUnexemptFromSession(archive: FS_Archive); +} +extern "C" { + pub fn fsMakePath(type_: FS_PathType, path: *const ::libc::c_void) -> FS_Path; +} +extern "C" { + pub fn fsGetSessionHandle() -> *mut Handle; +} +extern "C" { + pub fn FSUSER_Control( + action: FS_Action, + input: *mut ::libc::c_void, + inputSize: u32, + output: *mut ::libc::c_void, + outputSize: u32, + ) -> Result; +} +extern "C" { + pub fn FSUSER_Initialize(session: Handle) -> Result; +} +extern "C" { + pub fn FSUSER_OpenFile( + out: *mut Handle, + archive: FS_Archive, + path: FS_Path, + openFlags: u32, + attributes: u32, + ) -> Result; +} +extern "C" { + pub fn FSUSER_OpenFileDirectly( + out: *mut Handle, + archiveId: FS_ArchiveID, + archivePath: FS_Path, + filePath: FS_Path, + openFlags: u32, + attributes: u32, + ) -> Result; +} +extern "C" { + pub fn FSUSER_DeleteFile(archive: FS_Archive, path: FS_Path) -> Result; +} +extern "C" { + pub fn FSUSER_RenameFile( + srcArchive: FS_Archive, + srcPath: FS_Path, + dstArchive: FS_Archive, + dstPath: FS_Path, + ) -> Result; +} +extern "C" { + pub fn FSUSER_DeleteDirectory(archive: FS_Archive, path: FS_Path) -> Result; +} +extern "C" { + pub fn FSUSER_DeleteDirectoryRecursively(archive: FS_Archive, path: FS_Path) -> Result; +} +extern "C" { + pub fn FSUSER_CreateFile( + archive: FS_Archive, + path: FS_Path, + attributes: u32, + fileSize: u64, + ) -> Result; +} +extern "C" { + pub fn FSUSER_CreateDirectory(archive: FS_Archive, path: FS_Path, attributes: u32) -> Result; +} +extern "C" { + pub fn FSUSER_RenameDirectory( + srcArchive: FS_Archive, + srcPath: FS_Path, + dstArchive: FS_Archive, + dstPath: FS_Path, + ) -> Result; +} +extern "C" { + pub fn FSUSER_OpenDirectory(out: *mut Handle, archive: FS_Archive, path: FS_Path) -> Result; +} +extern "C" { + pub fn FSUSER_OpenArchive(archive: *mut FS_Archive, id: FS_ArchiveID, path: FS_Path) -> Result; +} +extern "C" { + pub fn FSUSER_ControlArchive( + archive: FS_Archive, + action: FS_ArchiveAction, + input: *mut ::libc::c_void, + inputSize: u32, + output: *mut ::libc::c_void, + outputSize: u32, + ) -> Result; +} +extern "C" { + pub fn FSUSER_CloseArchive(archive: FS_Archive) -> Result; +} +extern "C" { + pub fn FSUSER_GetFreeBytes(freeBytes: *mut u64, archive: FS_Archive) -> Result; +} +extern "C" { + pub fn FSUSER_GetCardType(type_: *mut FS_CardType) -> Result; +} +extern "C" { + pub fn FSUSER_GetSdmcArchiveResource(archiveResource: *mut FS_ArchiveResource) -> Result; +} +extern "C" { + pub fn FSUSER_GetNandArchiveResource(archiveResource: *mut FS_ArchiveResource) -> Result; +} +extern "C" { + pub fn FSUSER_GetSdmcFatfsError(error: *mut u32) -> Result; +} +extern "C" { + pub fn FSUSER_IsSdmcDetected(detected: *mut bool) -> Result; +} +extern "C" { + pub fn FSUSER_IsSdmcWritable(writable: *mut bool) -> Result; +} +extern "C" { + pub fn FSUSER_GetSdmcCid(out: *mut u8, length: u32) -> Result; +} +extern "C" { + pub fn FSUSER_GetNandCid(out: *mut u8, length: u32) -> Result; +} +extern "C" { + pub fn FSUSER_GetSdmcSpeedInfo(speedInfo: *mut u32) -> Result; +} +extern "C" { + pub fn FSUSER_GetNandSpeedInfo(speedInfo: *mut u32) -> Result; +} +extern "C" { + pub fn FSUSER_GetSdmcLog(out: *mut u8, length: u32) -> Result; +} +extern "C" { + pub fn FSUSER_GetNandLog(out: *mut u8, length: u32) -> Result; +} +extern "C" { + pub fn FSUSER_ClearSdmcLog() -> Result; +} +extern "C" { + pub fn FSUSER_ClearNandLog() -> Result; +} +extern "C" { + pub fn FSUSER_CardSlotIsInserted(inserted: *mut bool) -> Result; +} +extern "C" { + pub fn FSUSER_CardSlotPowerOn(status: *mut bool) -> Result; +} +extern "C" { + pub fn FSUSER_CardSlotPowerOff(status: *mut bool) -> Result; +} +extern "C" { + pub fn FSUSER_CardSlotGetCardIFPowerStatus(status: *mut bool) -> Result; +} +extern "C" { + pub fn FSUSER_CardNorDirectCommand(commandId: u8) -> Result; +} +extern "C" { + pub fn FSUSER_CardNorDirectCommandWithAddress(commandId: u8, address: u32) -> Result; +} +extern "C" { + pub fn FSUSER_CardNorDirectRead(commandId: u8, size: u32, output: *mut u8) -> Result; +} +extern "C" { + pub fn FSUSER_CardNorDirectReadWithAddress( + commandId: u8, + address: u32, + size: u32, + output: *mut u8, + ) -> Result; +} +extern "C" { + pub fn FSUSER_CardNorDirectWrite(commandId: u8, size: u32, input: *mut u8) -> Result; +} +extern "C" { + pub fn FSUSER_CardNorDirectWriteWithAddress( + commandId: u8, + address: u32, + size: u32, + input: *mut u8, + ) -> Result; +} +extern "C" { + pub fn FSUSER_CardNorDirectRead_4xIO( + commandId: u8, + address: u32, + size: u32, + output: *mut u8, + ) -> Result; +} +extern "C" { + pub fn FSUSER_CardNorDirectCpuWriteWithoutVerify( + address: u32, + size: u32, + input: *mut u8, + ) -> Result; +} +extern "C" { + pub fn FSUSER_CardNorDirectSectorEraseWithoutVerify(address: u32) -> Result; +} +extern "C" { + pub fn FSUSER_GetProductInfo(info: *mut FS_ProductInfo, processId: u32) -> Result; +} +extern "C" { + pub fn FSUSER_GetProgramLaunchInfo(info: *mut FS_ProgramInfo, processId: u32) -> Result; +} +extern "C" { + pub fn FSUSER_SetCardSpiBaudRate(baudRate: FS_CardSpiBaudRate) -> Result; +} +extern "C" { + pub fn FSUSER_SetCardSpiBusMode(busMode: FS_CardSpiBusMode) -> Result; +} +extern "C" { + pub fn FSUSER_SendInitializeInfoTo9() -> Result; +} +extern "C" { + pub fn FSUSER_GetSpecialContentIndex( + index: *mut u16, + mediaType: FS_MediaType, + programId: u64, + type_: FS_SpecialContentType, + ) -> Result; +} +extern "C" { + pub fn FSUSER_GetLegacyRomHeader( + mediaType: FS_MediaType, + programId: u64, + header: *mut u8, + ) -> Result; +} +extern "C" { + pub fn FSUSER_GetLegacyBannerData( + mediaType: FS_MediaType, + programId: u64, + banner: *mut u8, + ) -> Result; +} +extern "C" { + pub fn FSUSER_CheckAuthorityToAccessExtSaveData( + access: *mut bool, + mediaType: FS_MediaType, + saveId: u64, + processId: u32, + ) -> Result; +} +extern "C" { + pub fn FSUSER_QueryTotalQuotaSize( + quotaSize: *mut u64, + directories: u32, + files: u32, + fileSizeCount: u32, + fileSizes: *mut u64, + ) -> Result; +} +extern "C" { + pub fn FSUSER_AbnegateAccessRight(accessRight: u32) -> Result; +} +extern "C" { + pub fn FSUSER_DeleteSdmcRoot() -> Result; +} +extern "C" { + pub fn FSUSER_DeleteAllExtSaveDataOnNand() -> Result; +} +extern "C" { + pub fn FSUSER_InitializeCtrFileSystem() -> Result; +} +extern "C" { + pub fn FSUSER_CreateSeed() -> Result; +} +extern "C" { + pub fn FSUSER_GetFormatInfo( + totalSize: *mut u32, + directories: *mut u32, + files: *mut u32, + duplicateData: *mut bool, + archiveId: FS_ArchiveID, + path: FS_Path, + ) -> Result; +} +extern "C" { + pub fn FSUSER_GetLegacyRomHeader2( + headerSize: u32, + mediaType: FS_MediaType, + programId: u64, + header: *mut u8, + ) -> Result; +} +extern "C" { + pub fn FSUSER_GetSdmcCtrRootPath(out: *mut u8, length: u32) -> Result; +} +extern "C" { + pub fn FSUSER_GetArchiveResource( + archiveResource: *mut FS_ArchiveResource, + mediaType: FS_SystemMediaType, + ) -> Result; +} +extern "C" { + pub fn FSUSER_ExportIntegrityVerificationSeed( + seed: *mut FS_IntegrityVerificationSeed, + ) -> Result; +} +extern "C" { + pub fn FSUSER_ImportIntegrityVerificationSeed( + seed: *mut FS_IntegrityVerificationSeed, + ) -> Result; +} +extern "C" { + pub fn FSUSER_FormatSaveData( + archiveId: FS_ArchiveID, + path: FS_Path, + blocks: u32, + directories: u32, + files: u32, + directoryBuckets: u32, + fileBuckets: u32, + duplicateData: bool, + ) -> Result; +} +extern "C" { + pub fn FSUSER_GetLegacySubBannerData( + bannerSize: u32, + mediaType: FS_MediaType, + programId: u64, + banner: *mut u8, + ) -> Result; +} +extern "C" { + pub fn FSUSER_UpdateSha256Context( + data: *const ::libc::c_void, + inputSize: u32, + hash: *mut u8, + ) -> Result; +} +extern "C" { + pub fn FSUSER_ReadSpecialFile( + bytesRead: *mut u32, + fileOffset: u64, + size: u32, + data: *mut u8, + ) -> Result; +} +extern "C" { + pub fn FSUSER_GetSpecialFileSize(fileSize: *mut u64) -> Result; +} +extern "C" { + pub fn FSUSER_CreateExtSaveData( + info: FS_ExtSaveDataInfo, + directories: u32, + files: u32, + sizeLimit: u64, + smdhSize: u32, + smdh: *mut u8, + ) -> Result; +} +extern "C" { + pub fn FSUSER_DeleteExtSaveData(info: FS_ExtSaveDataInfo) -> Result; +} +extern "C" { + pub fn FSUSER_ReadExtSaveDataIcon( + bytesRead: *mut u32, + info: FS_ExtSaveDataInfo, + smdhSize: u32, + smdh: *mut u8, + ) -> Result; +} +extern "C" { + pub fn FSUSER_GetExtDataBlockSize( + totalBlocks: *mut u64, + freeBlocks: *mut u64, + blockSize: *mut u32, + info: FS_ExtSaveDataInfo, + ) -> Result; +} +extern "C" { + pub fn FSUSER_EnumerateExtSaveData( + idsWritten: *mut u32, + idsSize: u32, + mediaType: FS_MediaType, + idSize: u32, + shared: bool, + ids: *mut u8, + ) -> Result; +} +extern "C" { + pub fn FSUSER_CreateSystemSaveData( + info: FS_SystemSaveDataInfo, + totalSize: u32, + blockSize: u32, + directories: u32, + files: u32, + directoryBuckets: u32, + fileBuckets: u32, + duplicateData: bool, + ) -> Result; +} +extern "C" { + pub fn FSUSER_DeleteSystemSaveData(info: FS_SystemSaveDataInfo) -> Result; +} +extern "C" { + pub fn FSUSER_StartDeviceMoveAsSource(context: *mut FS_DeviceMoveContext) -> Result; +} +extern "C" { + pub fn FSUSER_StartDeviceMoveAsDestination( + context: FS_DeviceMoveContext, + clear: bool, + ) -> Result; +} +extern "C" { + pub fn FSUSER_SetArchivePriority(archive: FS_Archive, priority: u32) -> Result; +} +extern "C" { + pub fn FSUSER_GetArchivePriority(priority: *mut u32, archive: FS_Archive) -> Result; +} +extern "C" { + pub fn FSUSER_SetCtrCardLatencyParameter(latency: u64, emulateEndurance: bool) -> Result; +} +extern "C" { + pub fn FSUSER_SwitchCleanupInvalidSaveData(enable: bool) -> Result; +} +extern "C" { + pub fn FSUSER_EnumerateSystemSaveData( + idsWritten: *mut u32, + idsSize: u32, + ids: *mut u32, + ) -> Result; +} +extern "C" { + pub fn FSUSER_InitializeWithSdkVersion(session: Handle, version: u32) -> Result; +} +extern "C" { + pub fn FSUSER_SetPriority(priority: u32) -> Result; +} +extern "C" { + pub fn FSUSER_GetPriority(priority: *mut u32) -> Result; +} +extern "C" { + pub fn FSUSER_SetSaveDataSecureValue( + value: u64, + slot: FS_SecureValueSlot, + titleUniqueId: u32, + titleVariation: u8, + ) -> Result; +} +extern "C" { + pub fn FSUSER_GetSaveDataSecureValue( + exists: *mut bool, + value: *mut u64, + slot: FS_SecureValueSlot, + titleUniqueId: u32, + titleVariation: u8, + ) -> Result; +} +extern "C" { + pub fn FSUSER_ControlSecureSave( + action: FS_SecureSaveAction, + input: *mut ::libc::c_void, + inputSize: u32, + output: *mut ::libc::c_void, + outputSize: u32, + ) -> Result; +} +extern "C" { + pub fn FSUSER_GetMediaType(mediaType: *mut FS_MediaType) -> Result; +} +extern "C" { + pub fn FSFILE_Control( + handle: Handle, + action: FS_FileAction, + input: *mut ::libc::c_void, + inputSize: u32, + output: *mut ::libc::c_void, + outputSize: u32, + ) -> Result; +} +extern "C" { + pub fn FSFILE_OpenSubFile( + handle: Handle, + subFile: *mut Handle, + offset: u64, + size: u64, + ) -> Result; +} +extern "C" { + pub fn FSFILE_Read( + handle: Handle, + bytesRead: *mut u32, + offset: u64, + buffer: *mut ::libc::c_void, + size: u32, + ) -> Result; +} +extern "C" { + pub fn FSFILE_Write( + handle: Handle, + bytesWritten: *mut u32, + offset: u64, + buffer: *const ::libc::c_void, + size: u32, + flags: u32, + ) -> Result; +} +extern "C" { + pub fn FSFILE_GetSize(handle: Handle, size: *mut u64) -> Result; +} +extern "C" { + pub fn FSFILE_SetSize(handle: Handle, size: u64) -> Result; +} +extern "C" { + pub fn FSFILE_GetAttributes(handle: Handle, attributes: *mut u32) -> Result; +} +extern "C" { + pub fn FSFILE_SetAttributes(handle: Handle, attributes: u32) -> Result; +} +extern "C" { + pub fn FSFILE_Close(handle: Handle) -> Result; +} +extern "C" { + pub fn FSFILE_Flush(handle: Handle) -> Result; +} +extern "C" { + pub fn FSFILE_SetPriority(handle: Handle, priority: u32) -> Result; +} +extern "C" { + pub fn FSFILE_GetPriority(handle: Handle, priority: *mut u32) -> Result; +} +extern "C" { + pub fn FSFILE_OpenLinkFile(handle: Handle, linkFile: *mut Handle) -> Result; +} +extern "C" { + pub fn FSDIR_Control( + handle: Handle, + action: FS_DirectoryAction, + input: *mut ::libc::c_void, + inputSize: u32, + output: *mut ::libc::c_void, + outputSize: u32, + ) -> Result; +} +extern "C" { + pub fn FSDIR_Read( + handle: Handle, + entriesRead: *mut u32, + entryCount: u32, + entries: *mut FS_DirectoryEntry, + ) -> Result; +} +extern "C" { + pub fn FSDIR_Close(handle: Handle) -> Result; +} +extern "C" { + pub fn FSDIR_SetPriority(handle: Handle, priority: u32) -> Result; +} +extern "C" { + pub fn FSDIR_GetPriority(handle: Handle, priority: *mut u32) -> Result; +} +#[repr(C)] +pub struct AM_TitleEntry { + pub titleID: u64, + pub size: u64, + pub version: u16, + pub unk: [u8; 6usize], +} +pub const AM_STATUS_MASK_INSTALLING: _bindgen_ty_11 = 1; +pub const AM_STATUS_MASK_AWAITING_FINALIZATION: _bindgen_ty_11 = 2; +pub type _bindgen_ty_11 = u32; +pub const AM_STATUS_ABORTED: AM_InstallStatus = 2; +pub const AM_STATUS_SAVED: AM_InstallStatus = 3; +pub const AM_STATUS_INSTALL_IN_PROGRESS: AM_InstallStatus = 2050; +pub const AM_STATUS_AWAITING_FINALIZATION: AM_InstallStatus = 2051; +pub type AM_InstallStatus = u32; +#[repr(C)] +pub struct AM_PendingTitleEntry { + pub titleId: u64, + pub version: u16, + pub status: u16, + pub titleType: u32, + pub unk: [u8; 8usize], +} +pub const AM_DELETE_PENDING_NON_SYSTEM: _bindgen_ty_12 = 1; +pub const AM_DELETE_PENDING_SYSTEM: _bindgen_ty_12 = 2; +pub type _bindgen_ty_12 = u32; +#[repr(C)] +pub struct AM_TWLPartitionInfo { + pub capacity: u64, + pub freeSpace: u64, + pub titlesCapacity: u64, + pub titlesFreeSpace: u64, +} +extern "C" { + pub fn amInit() -> Result; +} +extern "C" { + pub fn amAppInit() -> Result; +} +extern "C" { + pub fn amExit(); +} +extern "C" { + pub fn amGetSessionHandle() -> *mut Handle; +} +extern "C" { + pub fn AM_GetTitleCount(mediatype: FS_MediaType, count: *mut u32) -> Result; +} +extern "C" { + pub fn AM_GetTitleList( + titlesRead: *mut u32, + mediatype: FS_MediaType, + titleCount: u32, + titleIds: *mut u64, + ) -> Result; +} +extern "C" { + pub fn AM_GetTitleInfo( + mediatype: FS_MediaType, + titleCount: u32, + titleIds: *mut u64, + titleInfo: *mut AM_TitleEntry, + ) -> Result; +} +extern "C" { + pub fn AM_GetTicketCount(count: *mut u32) -> Result; +} +extern "C" { + pub fn AM_GetTicketList( + ticketsRead: *mut u32, + ticketCount: u32, + skip: u32, + ticketIds: *mut u64, + ) -> Result; +} +extern "C" { + pub fn AM_GetPendingTitleCount( + count: *mut u32, + mediatype: FS_MediaType, + statusMask: u32, + ) -> Result; +} +extern "C" { + pub fn AM_GetPendingTitleList( + titlesRead: *mut u32, + titleCount: u32, + mediatype: FS_MediaType, + statusMask: u32, + titleIds: *mut u64, + ) -> Result; +} +extern "C" { + pub fn AM_GetPendingTitleInfo( + titleCount: u32, + mediatype: FS_MediaType, + titleIds: *mut u64, + titleInfo: *mut AM_PendingTitleEntry, + ) -> Result; +} +extern "C" { + pub fn AM_GetDeviceId(deviceID: *mut u32) -> Result; +} +extern "C" { + pub fn AM_ExportTwlBackup( + titleID: u64, + operation: u8, + workbuf: *mut ::libc::c_void, + workbuf_size: u32, + filepath: *const ::libc::c_char, + ) -> Result; +} +extern "C" { + pub fn AM_ImportTwlBackup( + filehandle: Handle, + operation: u8, + buffer: *mut ::libc::c_void, + size: u32, + ) -> Result; +} +extern "C" { + pub fn AM_ReadTwlBackupInfo( + filehandle: Handle, + outinfo: *mut ::libc::c_void, + outinfo_size: u32, + workbuf: *mut ::libc::c_void, + workbuf_size: u32, + banner: *mut ::libc::c_void, + banner_size: u32, + ) -> Result; +} +extern "C" { + pub fn AM_GetTWLPartitionInfo(info: *mut AM_TWLPartitionInfo) -> Result; +} +extern "C" { + pub fn AM_StartCiaInstall(mediatype: FS_MediaType, ciaHandle: *mut Handle) -> Result; +} +extern "C" { + pub fn AM_StartDlpChildCiaInstall(ciaHandle: *mut Handle) -> Result; +} +extern "C" { + pub fn AM_CancelCIAInstall(ciaHandle: Handle) -> Result; +} +extern "C" { + pub fn AM_FinishCiaInstall(ciaHandle: Handle) -> Result; +} +extern "C" { + pub fn AM_FinishCiaInstallWithoutCommit(ciaHandle: Handle) -> Result; +} +extern "C" { + pub fn AM_CommitImportPrograms( + mediaType: FS_MediaType, + titleCount: u32, + temp: bool, + titleIds: *const u64, + ) -> Result; +} +extern "C" { + pub fn AM_DeleteTitle(mediatype: FS_MediaType, titleID: u64) -> Result; +} +extern "C" { + pub fn AM_DeleteAppTitle(mediatype: FS_MediaType, titleID: u64) -> Result; +} +extern "C" { + pub fn AM_DeleteTicket(ticketId: u64) -> Result; +} +extern "C" { + pub fn AM_DeletePendingTitle(mediatype: FS_MediaType, titleId: u64) -> Result; +} +extern "C" { + pub fn AM_DeletePendingTitles(mediatype: FS_MediaType, flags: u32) -> Result; +} +extern "C" { + pub fn AM_DeleteAllPendingTitles(mediatype: FS_MediaType) -> Result; +} +extern "C" { + pub fn AM_InstallNativeFirm() -> Result; +} +extern "C" { + pub fn AM_InstallFirm(titleID: u64) -> Result; +} +extern "C" { + pub fn AM_GetTitleProductCode( + mediatype: FS_MediaType, + titleId: u64, + productCode: *mut ::libc::c_char, + ) -> Result; +} +extern "C" { + pub fn AM_GetTitleExtDataId( + extDataId: *mut u64, + mediatype: FS_MediaType, + titleId: u64, + ) -> Result; +} +extern "C" { + pub fn AM_GetCiaFileInfo( + mediatype: FS_MediaType, + titleEntry: *mut AM_TitleEntry, + fileHandle: Handle, + ) -> Result; +} +extern "C" { + pub fn AM_GetCiaIcon(icon: *mut ::libc::c_void, fileHandle: Handle) -> Result; +} +extern "C" { + pub fn AM_GetCiaDependencies(dependencies: *mut u64, fileHandle: Handle) -> Result; +} +extern "C" { + pub fn AM_GetCiaMetaOffset(metaOffset: *mut u64, fileHandle: Handle) -> Result; +} +extern "C" { + pub fn AM_GetCiaCoreVersion(coreVersion: *mut u32, fileHandle: Handle) -> Result; +} +extern "C" { + pub fn AM_GetCiaRequiredSpace( + requiredSpace: *mut u64, + mediaType: FS_MediaType, + fileHandle: Handle, + ) -> Result; +} +extern "C" { + pub fn AM_GetCiaMetaSection(meta: *mut ::libc::c_void, size: u32, fileHandle: Handle) + -> Result; +} +extern "C" { + pub fn AM_InitializeExternalTitleDatabase(overwrite: bool) -> Result; +} +extern "C" { + pub fn AM_QueryAvailableExternalTitleDatabase(available: *mut bool) -> Result; +} +extern "C" { + pub fn AM_InstallTicketBegin(ticketHandle: *mut Handle) -> Result; +} +extern "C" { + pub fn AM_InstallTicketAbort(ticketHandle: Handle) -> Result; +} +extern "C" { + pub fn AM_InstallTicketFinish(ticketHandle: Handle) -> Result; +} +extern "C" { + pub fn AM_InstallTitleBegin(mediaType: FS_MediaType, titleId: u64, unk: bool) -> Result; +} +extern "C" { + pub fn AM_InstallTitleStop() -> Result; +} +extern "C" { + pub fn AM_InstallTitleResume(mediaType: FS_MediaType, titleId: u64) -> Result; +} +extern "C" { + pub fn AM_InstallTitleAbort() -> Result; +} +extern "C" { + pub fn AM_InstallTitleFinish() -> Result; +} +extern "C" { + pub fn AM_CommitImportTitles( + mediaType: FS_MediaType, + titleCount: u32, + temp: bool, + titleIds: *const u64, + ) -> Result; +} +extern "C" { + pub fn AM_InstallTmdBegin(tmdHandle: *mut Handle) -> Result; +} +extern "C" { + pub fn AM_InstallTmdAbort(tmdHandle: Handle) -> Result; +} +extern "C" { + pub fn AM_InstallTmdFinish(tmdHandle: Handle, unk: bool) -> Result; +} +extern "C" { + pub fn AM_CreateImportContentContexts(contentCount: u32, contentIndices: *mut u16) -> Result; +} +extern "C" { + pub fn AM_InstallContentBegin(contentHandle: *mut Handle, index: u16) -> Result; +} +extern "C" { + pub fn AM_InstallContentStop(contentHandle: Handle) -> Result; +} +extern "C" { + pub fn AM_InstallContentResume( + contentHandle: *mut Handle, + resumeOffset: *mut u64, + index: u16, + ) -> Result; +} +extern "C" { + pub fn AM_InstallContentCancel(contentHandle: Handle) -> Result; +} +extern "C" { + pub fn AM_InstallContentFinish(contentHandle: Handle) -> Result; +} +extern "C" { + pub fn AM_ImportCertificates( + cert1Size: u32, + cert1: *mut ::libc::c_void, + cert2Size: u32, + cert2: *mut ::libc::c_void, + cert3Size: u32, + cert3: *mut ::libc::c_void, + cert4Size: u32, + cert4: *mut ::libc::c_void, + ) -> Result; +} +extern "C" { + pub fn AM_ImportCertificate(certSize: u32, cert: *mut ::libc::c_void) -> Result; +} +extern "C" { + pub fn AM_CommitImportTitlesAndUpdateFirmwareAuto( + mediaType: FS_MediaType, + titleCount: u32, + temp: bool, + titleIds: *mut u64, + ) -> Result; +} +extern "C" { + pub fn AM_DeleteAllDemoLaunchInfos() -> Result; +} +extern "C" { + pub fn AM_DeleteAllTemporaryTitles() -> Result; +} +extern "C" { + pub fn AM_DeleteAllExpiredTitles(mediatype: FS_MediaType) -> Result; +} +extern "C" { + pub fn AM_DeleteAllTwlTitles() -> Result; +} +extern "C" { + pub fn ampxiInit(servhandle: Handle) -> Result; +} +extern "C" { + pub fn ampxiExit(); +} +extern "C" { + pub fn AMPXI_WriteTWLSavedata( + titleid: u64, + buffer: *mut u8, + size: u32, + image_filepos: u32, + section_type: u8, + operation: u8, + ) -> Result; +} +extern "C" { + pub fn AMPXI_InstallTitlesFinish( + mediaType: FS_MediaType, + db: u8, + titlecount: u32, + tidlist: *mut u64, + ) -> Result; +} +pub const APPID_NONE: NS_APPID = 0; +pub const APPID_HOMEMENU: NS_APPID = 257; +pub const APPID_CAMERA: NS_APPID = 272; +pub const APPID_FRIENDS_LIST: NS_APPID = 274; +pub const APPID_GAME_NOTES: NS_APPID = 275; +pub const APPID_WEB: NS_APPID = 276; +pub const APPID_INSTRUCTION_MANUAL: NS_APPID = 277; +pub const APPID_NOTIFICATIONS: NS_APPID = 278; +pub const APPID_MIIVERSE: NS_APPID = 279; +pub const APPID_MIIVERSE_POSTING: NS_APPID = 280; +pub const APPID_AMIIBO_SETTINGS: NS_APPID = 281; +pub const APPID_APPLICATION: NS_APPID = 768; +pub const APPID_ESHOP: NS_APPID = 769; +pub const APPID_SOFTWARE_KEYBOARD: NS_APPID = 1025; +pub const APPID_APPLETED: NS_APPID = 1026; +pub const APPID_PNOTE_AP: NS_APPID = 1028; +pub const APPID_SNOTE_AP: NS_APPID = 1029; +pub const APPID_ERROR: NS_APPID = 1030; +pub const APPID_MINT: NS_APPID = 1031; +pub const APPID_EXTRAPAD: NS_APPID = 1032; +pub const APPID_MEMOLIB: NS_APPID = 1033; +pub type NS_APPID = u32; +pub const APTPOS_NONE: APT_AppletPos = -1; +pub const APTPOS_APP: APT_AppletPos = 0; +pub const APTPOS_APPLIB: APT_AppletPos = 1; +pub const APTPOS_SYS: APT_AppletPos = 2; +pub const APTPOS_SYSLIB: APT_AppletPos = 3; +pub const APTPOS_RESIDENT: APT_AppletPos = 4; +pub type APT_AppletPos = i32; +pub type APT_AppletAttr = u8; +pub const APTREPLY_REJECT: APT_QueryReply = 0; +pub const APTREPLY_ACCEPT: APT_QueryReply = 1; +pub const APTREPLY_LATER: APT_QueryReply = 2; +pub type APT_QueryReply = u32; +pub const APTSIGNAL_NONE: APT_Signal = 0; +pub const APTSIGNAL_HOMEBUTTON: APT_Signal = 1; +pub const APTSIGNAL_HOMEBUTTON2: APT_Signal = 2; +pub const APTSIGNAL_SLEEP_QUERY: APT_Signal = 3; +pub const APTSIGNAL_SLEEP_CANCEL: APT_Signal = 4; +pub const APTSIGNAL_SLEEP_ENTER: APT_Signal = 5; +pub const APTSIGNAL_SLEEP_WAKEUP: APT_Signal = 6; +pub const APTSIGNAL_SHUTDOWN: APT_Signal = 7; +pub const APTSIGNAL_POWERBUTTON: APT_Signal = 8; +pub const APTSIGNAL_POWERBUTTON2: APT_Signal = 9; +pub const APTSIGNAL_TRY_SLEEP: APT_Signal = 10; +pub const APTSIGNAL_ORDERTOCLOSE: APT_Signal = 11; +pub type APT_Signal = u32; +pub const APTCMD_NONE: APT_Command = 0; +pub const APTCMD_WAKEUP: APT_Command = 1; +pub const APTCMD_REQUEST: APT_Command = 2; +pub const APTCMD_RESPONSE: APT_Command = 3; +pub const APTCMD_EXIT: APT_Command = 4; +pub const APTCMD_MESSAGE: APT_Command = 5; +pub const APTCMD_HOMEBUTTON_ONCE: APT_Command = 6; +pub const APTCMD_HOMEBUTTON_TWICE: APT_Command = 7; +pub const APTCMD_DSP_SLEEP: APT_Command = 8; +pub const APTCMD_DSP_WAKEUP: APT_Command = 9; +pub const APTCMD_WAKEUP_EXIT: APT_Command = 10; +pub const APTCMD_WAKEUP_PAUSE: APT_Command = 11; +pub const APTCMD_WAKEUP_CANCEL: APT_Command = 12; +pub const APTCMD_WAKEUP_CANCELALL: APT_Command = 13; +pub const APTCMD_WAKEUP_POWERBUTTON: APT_Command = 14; +pub const APTCMD_WAKEUP_JUMPTOHOME: APT_Command = 15; +pub const APTCMD_SYSAPPLET_REQUEST: APT_Command = 16; +pub const APTCMD_WAKEUP_LAUNCHAPP: APT_Command = 17; +pub type APT_Command = u32; +#[repr(C)] +pub struct aptCaptureBufInfo { + pub size: u32, + pub is3D: u32, + pub top: aptCaptureBufInfo__bindgen_ty_1, + pub bottom: aptCaptureBufInfo__bindgen_ty_1, +} +#[repr(C)] +pub struct aptCaptureBufInfo__bindgen_ty_1 { + pub leftOffset: u32, + pub rightOffset: u32, + pub format: u32, +} +pub const APTHOOK_ONSUSPEND: APT_HookType = 0; +pub const APTHOOK_ONRESTORE: APT_HookType = 1; +pub const APTHOOK_ONSLEEP: APT_HookType = 2; +pub const APTHOOK_ONWAKEUP: APT_HookType = 3; +pub const APTHOOK_ONEXIT: APT_HookType = 4; +pub const APTHOOK_COUNT: APT_HookType = 5; +pub type APT_HookType = u32; +pub type aptHookFn = + ::core::option::Option; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tag_aptHookCookie { + pub next: *mut tag_aptHookCookie, + pub callback: aptHookFn, + pub param: *mut ::libc::c_void, +} +pub type aptHookCookie = tag_aptHookCookie; +pub type aptMessageCb = ::core::option::Option< + unsafe extern "C" fn( + user: *mut ::libc::c_void, + sender: NS_APPID, + msg: *mut ::libc::c_void, + msgsize: usize, + ), +>; +extern "C" { + pub fn aptInit() -> Result; +} +extern "C" { + pub fn aptExit(); +} +extern "C" { + pub fn aptSendCommand(aptcmdbuf: *mut u32) -> Result; +} +extern "C" { + pub fn aptIsSleepAllowed() -> bool; +} +extern "C" { + pub fn aptSetSleepAllowed(allowed: bool); +} +extern "C" { + pub fn aptMainLoop() -> bool; +} +extern "C" { + pub fn aptHook(cookie: *mut aptHookCookie, callback: aptHookFn, param: *mut ::libc::c_void); +} +extern "C" { + pub fn aptUnhook(cookie: *mut aptHookCookie); +} +extern "C" { + pub fn aptSetMessageCallback(callback: aptMessageCb, user: *mut ::libc::c_void); +} +extern "C" { + pub fn aptLaunchLibraryApplet( + appId: NS_APPID, + buf: *mut ::libc::c_void, + bufsize: usize, + handle: Handle, + ) -> bool; +} +extern "C" { + pub fn aptSetChainloader(programID: u64, mediatype: u8); +} +extern "C" { + pub fn APT_GetLockHandle(flags: u16, lockHandle: *mut Handle) -> Result; +} +extern "C" { + pub fn APT_Initialize( + appId: NS_APPID, + attr: APT_AppletAttr, + signalEvent: *mut Handle, + resumeEvent: *mut Handle, + ) -> Result; +} +extern "C" { + pub fn APT_Finalize(appId: NS_APPID) -> Result; +} +extern "C" { + pub fn APT_HardwareResetAsync() -> Result; +} +extern "C" { + pub fn APT_Enable(attr: APT_AppletAttr) -> Result; +} +extern "C" { + pub fn APT_GetAppletManInfo( + inpos: APT_AppletPos, + outpos: *mut APT_AppletPos, + req_appid: *mut NS_APPID, + menu_appid: *mut NS_APPID, + active_appid: *mut NS_APPID, + ) -> Result; +} +extern "C" { + pub fn APT_GetAppletInfo( + appID: NS_APPID, + pProgramID: *mut u64, + pMediaType: *mut u8, + pRegistered: *mut bool, + pLoadState: *mut bool, + pAttributes: *mut APT_AppletAttr, + ) -> Result; +} +extern "C" { + pub fn APT_GetAppletProgramInfo(id: u32, flags: u32, titleversion: *mut u16) -> Result; +} +extern "C" { + pub fn APT_GetProgramID(pProgramID: *mut u64) -> Result; +} +extern "C" { + pub fn APT_PrepareToJumpToHomeMenu() -> Result; +} +extern "C" { + pub fn APT_JumpToHomeMenu( + param: *const ::libc::c_void, + paramSize: usize, + handle: Handle, + ) -> Result; +} +extern "C" { + pub fn APT_PrepareToJumpToApplication(exiting: bool) -> Result; +} +extern "C" { + pub fn APT_JumpToApplication( + param: *const ::libc::c_void, + paramSize: usize, + handle: Handle, + ) -> Result; +} +extern "C" { + pub fn APT_IsRegistered(appID: NS_APPID, out: *mut bool) -> Result; +} +extern "C" { + pub fn APT_InquireNotification(appID: u32, signalType: *mut APT_Signal) -> Result; +} +extern "C" { + pub fn APT_NotifyToWait(appID: NS_APPID) -> Result; +} +extern "C" { + pub fn APT_AppletUtility( + id: ::libc::c_int, + out: *mut ::libc::c_void, + outSize: usize, + in_: *const ::libc::c_void, + inSize: usize, + ) -> Result; +} +extern "C" { + pub fn APT_SleepIfShellClosed() -> Result; +} +extern "C" { + pub fn APT_TryLockTransition(transition: u32, succeeded: *mut bool) -> Result; +} +extern "C" { + pub fn APT_UnlockTransition(transition: u32) -> Result; +} +extern "C" { + pub fn APT_GlanceParameter( + appID: NS_APPID, + buffer: *mut ::libc::c_void, + bufferSize: usize, + sender: *mut NS_APPID, + command: *mut APT_Command, + actualSize: *mut usize, + parameter: *mut Handle, + ) -> Result; +} +extern "C" { + pub fn APT_ReceiveParameter( + appID: NS_APPID, + buffer: *mut ::libc::c_void, + bufferSize: usize, + sender: *mut NS_APPID, + command: *mut APT_Command, + actualSize: *mut usize, + parameter: *mut Handle, + ) -> Result; +} +extern "C" { + pub fn APT_SendParameter( + source: NS_APPID, + dest: NS_APPID, + command: APT_Command, + buffer: *const ::libc::c_void, + bufferSize: u32, + parameter: Handle, + ) -> Result; +} +extern "C" { + pub fn APT_CancelParameter(source: NS_APPID, dest: NS_APPID, success: *mut bool) -> Result; +} +extern "C" { + pub fn APT_SendCaptureBufferInfo(captureBuf: *const aptCaptureBufInfo) -> Result; +} +extern "C" { + pub fn APT_ReplySleepQuery(appID: NS_APPID, reply: APT_QueryReply) -> Result; +} +extern "C" { + pub fn APT_ReplySleepNotificationComplete(appID: NS_APPID) -> Result; +} +extern "C" { + pub fn APT_PrepareToCloseApplication(cancelPreload: bool) -> Result; +} +extern "C" { + pub fn APT_CloseApplication( + param: *const ::libc::c_void, + paramSize: usize, + handle: Handle, + ) -> Result; +} +extern "C" { + pub fn APT_SetAppCpuTimeLimit(percent: u32) -> Result; +} +extern "C" { + pub fn APT_GetAppCpuTimeLimit(percent: *mut u32) -> Result; +} +extern "C" { + pub fn APT_CheckNew3DS(out: *mut bool) -> Result; +} +extern "C" { + pub fn APT_PrepareToDoApplicationJump(flags: u8, programID: u64, mediatype: u8) -> Result; +} +extern "C" { + pub fn APT_DoApplicationJump( + param: *const ::libc::c_void, + paramSize: usize, + hmac: *const ::libc::c_void, + ) -> Result; +} +extern "C" { + pub fn APT_PrepareToStartLibraryApplet(appID: NS_APPID) -> Result; +} +extern "C" { + pub fn APT_StartLibraryApplet( + appID: NS_APPID, + param: *const ::libc::c_void, + paramSize: usize, + handle: Handle, + ) -> Result; +} +extern "C" { + pub fn APT_PrepareToStartSystemApplet(appID: NS_APPID) -> Result; +} +extern "C" { + pub fn APT_StartSystemApplet( + appID: NS_APPID, + param: *const ::libc::c_void, + paramSize: usize, + handle: Handle, + ) -> Result; +} +extern "C" { + pub fn APT_GetSharedFont(fontHandle: *mut Handle, mapAddr: *mut u32) -> Result; +} +extern "C" { + pub fn APT_ReceiveDeliverArg( + param: *const ::libc::c_void, + paramSize: usize, + hmac: *const ::libc::c_void, + sender: *mut u64, + received: *mut bool, + ) -> Result; +} +#[repr(C)] +pub struct bossContext { + pub property: [u32; 7usize], + pub url: [::libc::c_char; 512usize], + pub property_x8: u32, + pub property_x9: u8, + pub property_xa: [u8; 256usize], + pub property_xb: [u8; 512usize], + pub property_xd: [::libc::c_char; 864usize], + pub property_xe: u32, + pub property_xf: [u32; 3usize], + pub property_x10: u8, + pub property_x11: u8, + pub property_x12: u8, + pub property_x13: u32, + pub property_x14: u32, + pub property_x15: [u8; 64usize], + pub property_x16: u32, + pub property_x3b: u32, + pub property_x3e: [u8; 512usize], +} +pub const BOSSTASKSTATUS_STARTED: bossTaskStatus = 2; +pub const BOSSTASKSTATUS_ERROR: bossTaskStatus = 7; +pub type bossTaskStatus = u32; +pub const bossNsDataHeaderInfoType_ContentSize: bossNsDataHeaderInfoTypes = 3; +pub type bossNsDataHeaderInfoTypes = u32; +pub const bossNsDataHeaderInfoTypeSize_ContentSize: bossNsDataHeaderInfoTypeSizes = 4; +pub type bossNsDataHeaderInfoTypeSizes = u32; +extern "C" { + pub fn bossInit(programID: u64, force_user: bool) -> Result; +} +extern "C" { + pub fn bossReinit(programID: u64) -> Result; +} +extern "C" { + pub fn bossExit(); +} +extern "C" { + pub fn bossGetSessionHandle() -> Handle; +} +extern "C" { + pub fn bossSetStorageInfo(extdataID: u64, boss_size: u32, mediaType: u8) -> Result; +} +extern "C" { + pub fn bossUnregisterStorage() -> Result; +} +extern "C" { + pub fn bossRegisterTask(taskID: *const ::libc::c_char, unk0: u8, unk1: u8) -> Result; +} +extern "C" { + pub fn bossSendProperty(PropertyID: u16, buf: *const ::libc::c_void, size: u32) -> Result; +} +extern "C" { + pub fn bossDeleteNsData(NsDataId: u32) -> Result; +} +extern "C" { + pub fn bossGetNsDataHeaderInfo( + NsDataId: u32, + type_: u8, + buffer: *mut ::libc::c_void, + size: u32, + ) -> Result; +} +extern "C" { + pub fn bossReadNsData( + NsDataId: u32, + offset: u64, + buffer: *mut ::libc::c_void, + size: u32, + transfer_total: *mut u32, + unk_out: *mut u32, + ) -> Result; +} +extern "C" { + pub fn bossStartTaskImmediate(taskID: *const ::libc::c_char) -> Result; +} +extern "C" { + pub fn bossStartBgImmediate(taskID: *const ::libc::c_char) -> Result; +} +extern "C" { + pub fn bossDeleteTask(taskID: *const ::libc::c_char, unk: u32) -> Result; +} +extern "C" { + pub fn bossGetTaskState( + taskID: *const ::libc::c_char, + inval: s8, + status: *mut u8, + out1: *mut u32, + out2: *mut u8, + ) -> Result; +} +extern "C" { + pub fn bossGetTaskProperty0(taskID: *const ::libc::c_char, out: *mut u8) -> Result; +} +extern "C" { + pub fn bossSetupContextDefault( + ctx: *mut bossContext, + seconds_interval: u32, + url: *const ::libc::c_char, + ); +} +extern "C" { + pub fn bossSendContextConfig(ctx: *mut bossContext) -> Result; +} +pub const INPUT_YUV422_INDIV_8: Y2RU_InputFormat = 0; +pub const INPUT_YUV420_INDIV_8: Y2RU_InputFormat = 1; +pub const INPUT_YUV422_INDIV_16: Y2RU_InputFormat = 2; +pub const INPUT_YUV420_INDIV_16: Y2RU_InputFormat = 3; +pub const INPUT_YUV422_BATCH: Y2RU_InputFormat = 4; +pub type Y2RU_InputFormat = u32; +pub const OUTPUT_RGB_32: Y2RU_OutputFormat = 0; +pub const OUTPUT_RGB_24: Y2RU_OutputFormat = 1; +pub const OUTPUT_RGB_16_555: Y2RU_OutputFormat = 2; +pub const OUTPUT_RGB_16_565: Y2RU_OutputFormat = 3; +pub type Y2RU_OutputFormat = u32; +pub const ROTATION_NONE: Y2RU_Rotation = 0; +pub const ROTATION_CLOCKWISE_90: Y2RU_Rotation = 1; +pub const ROTATION_CLOCKWISE_180: Y2RU_Rotation = 2; +pub const ROTATION_CLOCKWISE_270: Y2RU_Rotation = 3; +pub type Y2RU_Rotation = u32; +pub const BLOCK_LINE: Y2RU_BlockAlignment = 0; +pub const BLOCK_8_BY_8: Y2RU_BlockAlignment = 1; +pub type Y2RU_BlockAlignment = u32; +#[repr(C)] +pub struct Y2RU_ColorCoefficients { + pub rgb_Y: u16, + pub r_V: u16, + pub g_V: u16, + pub g_U: u16, + pub b_U: u16, + pub r_offset: u16, + pub g_offset: u16, + pub b_offset: u16, +} +pub const COEFFICIENT_ITU_R_BT_601: Y2RU_StandardCoefficient = 0; +pub const COEFFICIENT_ITU_R_BT_709: Y2RU_StandardCoefficient = 1; +pub const COEFFICIENT_ITU_R_BT_601_SCALING: Y2RU_StandardCoefficient = 2; +pub const COEFFICIENT_ITU_R_BT_709_SCALING: Y2RU_StandardCoefficient = 3; +pub type Y2RU_StandardCoefficient = u32; +#[repr(C)] +#[repr(align(4))] +pub struct Y2RU_ConversionParams { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u8>, + pub input_line_width: s16, + pub input_lines: s16, + pub _bitfield_2: __BindgenBitfieldUnit<[u8; 1usize], u8>, + pub unused: u8, + pub alpha: u16, +} +impl Y2RU_ConversionParams { + #[inline] + pub fn input_format(&self) -> Y2RU_InputFormat { + unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 8u8) as u32) } + } + #[inline] + pub fn set_input_format(&mut self, val: Y2RU_InputFormat) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(0usize, 8u8, val as u64) + } + } + #[inline] + pub fn output_format(&self) -> Y2RU_OutputFormat { + unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 8u8) as u32) } + } + #[inline] + pub fn set_output_format(&mut self, val: Y2RU_OutputFormat) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(8usize, 8u8, val as u64) + } + } + #[inline] + pub fn rotation(&self) -> Y2RU_Rotation { + unsafe { ::core::mem::transmute(self._bitfield_1.get(16usize, 8u8) as u32) } + } + #[inline] + pub fn set_rotation(&mut self, val: Y2RU_Rotation) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(16usize, 8u8, val as u64) + } + } + #[inline] + pub fn block_alignment(&self) -> Y2RU_BlockAlignment { + unsafe { ::core::mem::transmute(self._bitfield_1.get(24usize, 8u8) as u32) } + } + #[inline] + pub fn set_block_alignment(&mut self, val: Y2RU_BlockAlignment) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(24usize, 8u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + input_format: Y2RU_InputFormat, + output_format: Y2RU_OutputFormat, + rotation: Y2RU_Rotation, + block_alignment: Y2RU_BlockAlignment, + ) -> __BindgenBitfieldUnit<[u8; 4usize], u8> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u8> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 8u8, { + let input_format: u32 = unsafe { ::core::mem::transmute(input_format) }; + input_format as u64 + }); + __bindgen_bitfield_unit.set(8usize, 8u8, { + let output_format: u32 = unsafe { ::core::mem::transmute(output_format) }; + output_format as u64 + }); + __bindgen_bitfield_unit.set(16usize, 8u8, { + let rotation: u32 = unsafe { ::core::mem::transmute(rotation) }; + rotation as u64 + }); + __bindgen_bitfield_unit.set(24usize, 8u8, { + let block_alignment: u32 = unsafe { ::core::mem::transmute(block_alignment) }; + block_alignment as u64 + }); + __bindgen_bitfield_unit + } + #[inline] + pub fn standard_coefficient(&self) -> Y2RU_StandardCoefficient { + unsafe { ::core::mem::transmute(self._bitfield_2.get(0usize, 8u8) as u32) } + } + #[inline] + pub fn set_standard_coefficient(&mut self, val: Y2RU_StandardCoefficient) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_2.set(0usize, 8u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_2( + standard_coefficient: Y2RU_StandardCoefficient, + ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 8u8, { + let standard_coefficient: u32 = unsafe { ::core::mem::transmute(standard_coefficient) }; + standard_coefficient as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +pub struct Y2RU_DitheringWeightParams { + pub w0_xEven_yEven: u16, + pub w0_xOdd_yEven: u16, + pub w0_xEven_yOdd: u16, + pub w0_xOdd_yOdd: u16, + pub w1_xEven_yEven: u16, + pub w1_xOdd_yEven: u16, + pub w1_xEven_yOdd: u16, + pub w1_xOdd_yOdd: u16, + pub w2_xEven_yEven: u16, + pub w2_xOdd_yEven: u16, + pub w2_xEven_yOdd: u16, + pub w2_xOdd_yOdd: u16, + pub w3_xEven_yEven: u16, + pub w3_xOdd_yEven: u16, + pub w3_xEven_yOdd: u16, + pub w3_xOdd_yOdd: u16, +} +extern "C" { + pub fn y2rInit() -> Result; +} +extern "C" { + pub fn y2rExit(); +} +extern "C" { + pub fn Y2RU_SetInputFormat(format: Y2RU_InputFormat) -> Result; +} +extern "C" { + pub fn Y2RU_GetInputFormat(format: *mut Y2RU_InputFormat) -> Result; +} +extern "C" { + pub fn Y2RU_SetOutputFormat(format: Y2RU_OutputFormat) -> Result; +} +extern "C" { + pub fn Y2RU_GetOutputFormat(format: *mut Y2RU_OutputFormat) -> Result; +} +extern "C" { + pub fn Y2RU_SetRotation(rotation: Y2RU_Rotation) -> Result; +} +extern "C" { + pub fn Y2RU_GetRotation(rotation: *mut Y2RU_Rotation) -> Result; +} +extern "C" { + pub fn Y2RU_SetBlockAlignment(alignment: Y2RU_BlockAlignment) -> Result; +} +extern "C" { + pub fn Y2RU_GetBlockAlignment(alignment: *mut Y2RU_BlockAlignment) -> Result; +} +extern "C" { + pub fn Y2RU_SetSpacialDithering(enable: bool) -> Result; +} +extern "C" { + pub fn Y2RU_GetSpacialDithering(enabled: *mut bool) -> Result; +} +extern "C" { + pub fn Y2RU_SetTemporalDithering(enable: bool) -> Result; +} +extern "C" { + pub fn Y2RU_GetTemporalDithering(enabled: *mut bool) -> Result; +} +extern "C" { + pub fn Y2RU_SetInputLineWidth(line_width: u16) -> Result; +} +extern "C" { + pub fn Y2RU_GetInputLineWidth(line_width: *mut u16) -> Result; +} +extern "C" { + pub fn Y2RU_SetInputLines(num_lines: u16) -> Result; +} +extern "C" { + pub fn Y2RU_GetInputLines(num_lines: *mut u16) -> Result; +} +extern "C" { + pub fn Y2RU_SetCoefficients(coefficients: *const Y2RU_ColorCoefficients) -> Result; +} +extern "C" { + pub fn Y2RU_GetCoefficients(coefficients: *mut Y2RU_ColorCoefficients) -> Result; +} +extern "C" { + pub fn Y2RU_SetStandardCoefficient(coefficient: Y2RU_StandardCoefficient) -> Result; +} +extern "C" { + pub fn Y2RU_GetStandardCoefficient( + coefficients: *mut Y2RU_ColorCoefficients, + standardCoeff: Y2RU_StandardCoefficient, + ) -> Result; +} +extern "C" { + pub fn Y2RU_SetAlpha(alpha: u16) -> Result; +} +extern "C" { + pub fn Y2RU_GetAlpha(alpha: *mut u16) -> Result; +} +extern "C" { + pub fn Y2RU_SetTransferEndInterrupt(should_interrupt: bool) -> Result; +} +extern "C" { + pub fn Y2RU_GetTransferEndInterrupt(should_interrupt: *mut bool) -> Result; +} +extern "C" { + pub fn Y2RU_GetTransferEndEvent(end_event: *mut Handle) -> Result; +} +extern "C" { + pub fn Y2RU_SetSendingY( + src_buf: *const ::libc::c_void, + image_size: u32, + transfer_unit: s16, + transfer_gap: s16, + ) -> Result; +} +extern "C" { + pub fn Y2RU_SetSendingU( + src_buf: *const ::libc::c_void, + image_size: u32, + transfer_unit: s16, + transfer_gap: s16, + ) -> Result; +} +extern "C" { + pub fn Y2RU_SetSendingV( + src_buf: *const ::libc::c_void, + image_size: u32, + transfer_unit: s16, + transfer_gap: s16, + ) -> Result; +} +extern "C" { + pub fn Y2RU_SetSendingYUYV( + src_buf: *const ::libc::c_void, + image_size: u32, + transfer_unit: s16, + transfer_gap: s16, + ) -> Result; +} +extern "C" { + pub fn Y2RU_SetReceiving( + dst_buf: *mut ::libc::c_void, + image_size: u32, + transfer_unit: s16, + transfer_gap: s16, + ) -> Result; +} +extern "C" { + pub fn Y2RU_IsDoneSendingY(is_done: *mut bool) -> Result; +} +extern "C" { + pub fn Y2RU_IsDoneSendingU(is_done: *mut bool) -> Result; +} +extern "C" { + pub fn Y2RU_IsDoneSendingV(is_done: *mut bool) -> Result; +} +extern "C" { + pub fn Y2RU_IsDoneSendingYUYV(is_done: *mut bool) -> Result; +} +extern "C" { + pub fn Y2RU_IsDoneReceiving(is_done: *mut bool) -> Result; +} +extern "C" { + pub fn Y2RU_SetDitheringWeightParams(params: *const Y2RU_DitheringWeightParams) -> Result; +} +extern "C" { + pub fn Y2RU_GetDitheringWeightParams(params: *mut Y2RU_DitheringWeightParams) -> Result; +} +extern "C" { + pub fn Y2RU_SetConversionParams(params: *const Y2RU_ConversionParams) -> Result; +} +extern "C" { + pub fn Y2RU_StartConversion() -> Result; +} +extern "C" { + pub fn Y2RU_StopConversion() -> Result; +} +extern "C" { + pub fn Y2RU_IsBusyConversion(is_busy: *mut bool) -> Result; +} +extern "C" { + pub fn Y2RU_PingProcess(ping: *mut u8) -> Result; +} +extern "C" { + pub fn Y2RU_DriverInitialize() -> Result; +} +extern "C" { + pub fn Y2RU_DriverFinalize() -> Result; +} +pub const PORT_NONE: _bindgen_ty_13 = 0; +pub const PORT_CAM1: _bindgen_ty_13 = 1; +pub const PORT_CAM2: _bindgen_ty_13 = 2; +pub const PORT_BOTH: _bindgen_ty_13 = 3; +pub type _bindgen_ty_13 = u32; +pub const SELECT_NONE: _bindgen_ty_14 = 0; +pub const SELECT_OUT1: _bindgen_ty_14 = 1; +pub const SELECT_IN1: _bindgen_ty_14 = 2; +pub const SELECT_OUT2: _bindgen_ty_14 = 4; +pub const SELECT_IN1_OUT1: _bindgen_ty_14 = 3; +pub const SELECT_OUT1_OUT2: _bindgen_ty_14 = 5; +pub const SELECT_IN1_OUT2: _bindgen_ty_14 = 6; +pub const SELECT_ALL: _bindgen_ty_14 = 7; +pub type _bindgen_ty_14 = u32; +pub const CONTEXT_NONE: CAMU_Context = 0; +pub const CONTEXT_A: CAMU_Context = 1; +pub const CONTEXT_B: CAMU_Context = 2; +pub const CONTEXT_BOTH: CAMU_Context = 3; +pub type CAMU_Context = u32; +pub const FLIP_NONE: CAMU_Flip = 0; +pub const FLIP_HORIZONTAL: CAMU_Flip = 1; +pub const FLIP_VERTICAL: CAMU_Flip = 2; +pub const FLIP_REVERSE: CAMU_Flip = 3; +pub type CAMU_Flip = u32; +pub const SIZE_VGA: CAMU_Size = 0; +pub const SIZE_QVGA: CAMU_Size = 1; +pub const SIZE_QQVGA: CAMU_Size = 2; +pub const SIZE_CIF: CAMU_Size = 3; +pub const SIZE_QCIF: CAMU_Size = 4; +pub const SIZE_DS_LCD: CAMU_Size = 5; +pub const SIZE_DS_LCDx4: CAMU_Size = 6; +pub const SIZE_CTR_TOP_LCD: CAMU_Size = 7; +pub const SIZE_CTR_BOTTOM_LCD: CAMU_Size = 1; +pub type CAMU_Size = u32; +pub const FRAME_RATE_15: CAMU_FrameRate = 0; +pub const FRAME_RATE_15_TO_5: CAMU_FrameRate = 1; +pub const FRAME_RATE_15_TO_2: CAMU_FrameRate = 2; +pub const FRAME_RATE_10: CAMU_FrameRate = 3; +pub const FRAME_RATE_8_5: CAMU_FrameRate = 4; +pub const FRAME_RATE_5: CAMU_FrameRate = 5; +pub const FRAME_RATE_20: CAMU_FrameRate = 6; +pub const FRAME_RATE_20_TO_5: CAMU_FrameRate = 7; +pub const FRAME_RATE_30: CAMU_FrameRate = 8; +pub const FRAME_RATE_30_TO_5: CAMU_FrameRate = 9; +pub const FRAME_RATE_15_TO_10: CAMU_FrameRate = 10; +pub const FRAME_RATE_20_TO_10: CAMU_FrameRate = 11; +pub const FRAME_RATE_30_TO_10: CAMU_FrameRate = 12; +pub type CAMU_FrameRate = u32; +pub const WHITE_BALANCE_AUTO: CAMU_WhiteBalance = 0; +pub const WHITE_BALANCE_3200K: CAMU_WhiteBalance = 1; +pub const WHITE_BALANCE_4150K: CAMU_WhiteBalance = 2; +pub const WHITE_BALANCE_5200K: CAMU_WhiteBalance = 3; +pub const WHITE_BALANCE_6000K: CAMU_WhiteBalance = 4; +pub const WHITE_BALANCE_7000K: CAMU_WhiteBalance = 5; +pub const WHITE_BALANCE_NORMAL: CAMU_WhiteBalance = 0; +pub const WHITE_BALANCE_TUNGSTEN: CAMU_WhiteBalance = 1; +pub const WHITE_BALANCE_WHITE_FLUORESCENT_LIGHT: CAMU_WhiteBalance = 2; +pub const WHITE_BALANCE_DAYLIGHT: CAMU_WhiteBalance = 3; +pub const WHITE_BALANCE_CLOUDY: CAMU_WhiteBalance = 4; +pub const WHITE_BALANCE_HORIZON: CAMU_WhiteBalance = 4; +pub const WHITE_BALANCE_SHADE: CAMU_WhiteBalance = 5; +pub type CAMU_WhiteBalance = u32; +pub const PHOTO_MODE_NORMAL: CAMU_PhotoMode = 0; +pub const PHOTO_MODE_PORTRAIT: CAMU_PhotoMode = 1; +pub const PHOTO_MODE_LANDSCAPE: CAMU_PhotoMode = 2; +pub const PHOTO_MODE_NIGHTVIEW: CAMU_PhotoMode = 3; +pub const PHOTO_MODE_LETTER: CAMU_PhotoMode = 4; +pub type CAMU_PhotoMode = u32; +pub const EFFECT_NONE: CAMU_Effect = 0; +pub const EFFECT_MONO: CAMU_Effect = 1; +pub const EFFECT_SEPIA: CAMU_Effect = 2; +pub const EFFECT_NEGATIVE: CAMU_Effect = 3; +pub const EFFECT_NEGAFILM: CAMU_Effect = 4; +pub const EFFECT_SEPIA01: CAMU_Effect = 5; +pub type CAMU_Effect = u32; +pub const CONTRAST_PATTERN_01: CAMU_Contrast = 0; +pub const CONTRAST_PATTERN_02: CAMU_Contrast = 1; +pub const CONTRAST_PATTERN_03: CAMU_Contrast = 2; +pub const CONTRAST_PATTERN_04: CAMU_Contrast = 3; +pub const CONTRAST_PATTERN_05: CAMU_Contrast = 4; +pub const CONTRAST_PATTERN_06: CAMU_Contrast = 5; +pub const CONTRAST_PATTERN_07: CAMU_Contrast = 6; +pub const CONTRAST_PATTERN_08: CAMU_Contrast = 7; +pub const CONTRAST_PATTERN_09: CAMU_Contrast = 8; +pub const CONTRAST_PATTERN_10: CAMU_Contrast = 9; +pub const CONTRAST_PATTERN_11: CAMU_Contrast = 10; +pub const CONTRAST_LOW: CAMU_Contrast = 4; +pub const CONTRAST_NORMAL: CAMU_Contrast = 5; +pub const CONTRAST_HIGH: CAMU_Contrast = 6; +pub type CAMU_Contrast = u32; +pub const LENS_CORRECTION_OFF: CAMU_LensCorrection = 0; +pub const LENS_CORRECTION_ON_70: CAMU_LensCorrection = 1; +pub const LENS_CORRECTION_ON_90: CAMU_LensCorrection = 2; +pub const LENS_CORRECTION_DARK: CAMU_LensCorrection = 0; +pub const LENS_CORRECTION_NORMAL: CAMU_LensCorrection = 1; +pub const LENS_CORRECTION_BRIGHT: CAMU_LensCorrection = 2; +pub type CAMU_LensCorrection = u32; +pub const OUTPUT_YUV_422: CAMU_OutputFormat = 0; +pub const OUTPUT_RGB_565: CAMU_OutputFormat = 1; +pub type CAMU_OutputFormat = u32; +pub const SHUTTER_SOUND_TYPE_NORMAL: CAMU_ShutterSoundType = 0; +pub const SHUTTER_SOUND_TYPE_MOVIE: CAMU_ShutterSoundType = 1; +pub const SHUTTER_SOUND_TYPE_MOVIE_END: CAMU_ShutterSoundType = 2; +pub type CAMU_ShutterSoundType = u32; +#[repr(C)] +pub struct CAMU_ImageQualityCalibrationData { + pub aeBaseTarget: s16, + pub kRL: s16, + pub kGL: s16, + pub kBL: s16, + pub ccmPosition: s16, + pub awbCcmL9Right: u16, + pub awbCcmL9Left: u16, + pub awbCcmL10Right: u16, + pub awbCcmL10Left: u16, + pub awbX0Right: u16, + pub awbX0Left: u16, +} +#[repr(C)] +pub struct CAMU_StereoCameraCalibrationData { + pub isValidRotationXY: u8, + pub padding: [u8; 3usize], + pub scale: f32, + pub rotationZ: f32, + pub translationX: f32, + pub translationY: f32, + pub rotationX: f32, + pub rotationY: f32, + pub angleOfViewRight: f32, + pub angleOfViewLeft: f32, + pub distanceToChart: f32, + pub distanceCameras: f32, + pub imageWidth: s16, + pub imageHeight: s16, + pub reserved: [u8; 16usize], +} +#[repr(C)] +pub struct CAMU_PackageParameterCameraSelect { + pub camera: u8, + pub exposure: s8, + pub whiteBalance: u8, + pub sharpness: s8, + pub autoExposureOn: u8, + pub autoWhiteBalanceOn: u8, + pub frameRate: u8, + pub photoMode: u8, + pub contrast: u8, + pub lensCorrection: u8, + pub noiseFilterOn: u8, + pub padding: u8, + pub autoExposureWindowX: s16, + pub autoExposureWindowY: s16, + pub autoExposureWindowWidth: s16, + pub autoExposureWindowHeight: s16, + pub autoWhiteBalanceWindowX: s16, + pub autoWhiteBalanceWindowY: s16, + pub autoWhiteBalanceWindowWidth: s16, + pub autoWhiteBalanceWindowHeight: s16, +} +#[repr(C)] +pub struct CAMU_PackageParameterContext { + pub camera: u8, + pub context: u8, + pub flip: u8, + pub effect: u8, + pub size: u8, +} +#[repr(C)] +pub struct CAMU_PackageParameterContextDetail { + pub camera: u8, + pub context: u8, + pub flip: u8, + pub effect: u8, + pub width: s16, + pub height: s16, + pub cropX0: s16, + pub cropY0: s16, + pub cropX1: s16, + pub cropY1: s16, +} +extern "C" { + pub fn camInit() -> Result; +} +extern "C" { + pub fn camExit(); +} +extern "C" { + pub fn CAMU_StartCapture(port: u32) -> Result; +} +extern "C" { + pub fn CAMU_StopCapture(port: u32) -> Result; +} +extern "C" { + pub fn CAMU_IsBusy(busy: *mut bool, port: u32) -> Result; +} +extern "C" { + pub fn CAMU_ClearBuffer(port: u32) -> Result; +} +extern "C" { + pub fn CAMU_GetVsyncInterruptEvent(event: *mut Handle, port: u32) -> Result; +} +extern "C" { + pub fn CAMU_GetBufferErrorInterruptEvent(event: *mut Handle, port: u32) -> Result; +} +extern "C" { + pub fn CAMU_SetReceiving( + event: *mut Handle, + dst: *mut ::libc::c_void, + port: u32, + imageSize: u32, + transferUnit: s16, + ) -> Result; +} +extern "C" { + pub fn CAMU_IsFinishedReceiving(finishedReceiving: *mut bool, port: u32) -> Result; +} +extern "C" { + pub fn CAMU_SetTransferLines(port: u32, lines: s16, width: s16, height: s16) -> Result; +} +extern "C" { + pub fn CAMU_GetMaxLines(maxLines: *mut s16, width: s16, height: s16) -> Result; +} +extern "C" { + pub fn CAMU_SetTransferBytes(port: u32, bytes: u32, width: s16, height: s16) -> Result; +} +extern "C" { + pub fn CAMU_GetTransferBytes(transferBytes: *mut u32, port: u32) -> Result; +} +extern "C" { + pub fn CAMU_GetMaxBytes(maxBytes: *mut u32, width: s16, height: s16) -> Result; +} +extern "C" { + pub fn CAMU_SetTrimming(port: u32, trimming: bool) -> Result; +} +extern "C" { + pub fn CAMU_IsTrimming(trimming: *mut bool, port: u32) -> Result; +} +extern "C" { + pub fn CAMU_SetTrimmingParams( + port: u32, + xStart: s16, + yStart: s16, + xEnd: s16, + yEnd: s16, + ) -> Result; +} +extern "C" { + pub fn CAMU_GetTrimmingParams( + xStart: *mut s16, + yStart: *mut s16, + xEnd: *mut s16, + yEnd: *mut s16, + port: u32, + ) -> Result; +} +extern "C" { + pub fn CAMU_SetTrimmingParamsCenter( + port: u32, + trimWidth: s16, + trimHeight: s16, + camWidth: s16, + camHeight: s16, + ) -> Result; +} +extern "C" { + pub fn CAMU_Activate(select: u32) -> Result; +} +extern "C" { + pub fn CAMU_SwitchContext(select: u32, context: CAMU_Context) -> Result; +} +extern "C" { + pub fn CAMU_SetExposure(select: u32, exposure: s8) -> Result; +} +extern "C" { + pub fn CAMU_SetWhiteBalance(select: u32, whiteBalance: CAMU_WhiteBalance) -> Result; +} +extern "C" { + pub fn CAMU_SetWhiteBalanceWithoutBaseUp( + select: u32, + whiteBalance: CAMU_WhiteBalance, + ) -> Result; +} +extern "C" { + pub fn CAMU_SetSharpness(select: u32, sharpness: s8) -> Result; +} +extern "C" { + pub fn CAMU_SetAutoExposure(select: u32, autoExposure: bool) -> Result; +} +extern "C" { + pub fn CAMU_IsAutoExposure(autoExposure: *mut bool, select: u32) -> Result; +} +extern "C" { + pub fn CAMU_SetAutoWhiteBalance(select: u32, autoWhiteBalance: bool) -> Result; +} +extern "C" { + pub fn CAMU_IsAutoWhiteBalance(autoWhiteBalance: *mut bool, select: u32) -> Result; +} +extern "C" { + pub fn CAMU_FlipImage(select: u32, flip: CAMU_Flip, context: CAMU_Context) -> Result; +} +extern "C" { + pub fn CAMU_SetDetailSize( + select: u32, + width: s16, + height: s16, + cropX0: s16, + cropY0: s16, + cropX1: s16, + cropY1: s16, + context: CAMU_Context, + ) -> Result; +} +extern "C" { + pub fn CAMU_SetSize(select: u32, size: CAMU_Size, context: CAMU_Context) -> Result; +} +extern "C" { + pub fn CAMU_SetFrameRate(select: u32, frameRate: CAMU_FrameRate) -> Result; +} +extern "C" { + pub fn CAMU_SetPhotoMode(select: u32, photoMode: CAMU_PhotoMode) -> Result; +} +extern "C" { + pub fn CAMU_SetEffect(select: u32, effect: CAMU_Effect, context: CAMU_Context) -> Result; +} +extern "C" { + pub fn CAMU_SetContrast(select: u32, contrast: CAMU_Contrast) -> Result; +} +extern "C" { + pub fn CAMU_SetLensCorrection(select: u32, lensCorrection: CAMU_LensCorrection) -> Result; +} +extern "C" { + pub fn CAMU_SetOutputFormat( + select: u32, + format: CAMU_OutputFormat, + context: CAMU_Context, + ) -> Result; +} +extern "C" { + pub fn CAMU_SetAutoExposureWindow( + select: u32, + x: s16, + y: s16, + width: s16, + height: s16, + ) -> Result; +} +extern "C" { + pub fn CAMU_SetAutoWhiteBalanceWindow( + select: u32, + x: s16, + y: s16, + width: s16, + height: s16, + ) -> Result; +} +extern "C" { + pub fn CAMU_SetNoiseFilter(select: u32, noiseFilter: bool) -> Result; +} +extern "C" { + pub fn CAMU_SynchronizeVsyncTiming(select1: u32, select2: u32) -> Result; +} +extern "C" { + pub fn CAMU_GetLatestVsyncTiming(timing: *mut s64, port: u32, past: u32) -> Result; +} +extern "C" { + pub fn CAMU_GetStereoCameraCalibrationData( + data: *mut CAMU_StereoCameraCalibrationData, + ) -> Result; +} +extern "C" { + pub fn CAMU_SetStereoCameraCalibrationData(data: CAMU_StereoCameraCalibrationData) -> Result; +} +extern "C" { + pub fn CAMU_WriteRegisterI2c(select: u32, addr: u16, data: u16) -> Result; +} +extern "C" { + pub fn CAMU_WriteMcuVariableI2c(select: u32, addr: u16, data: u16) -> Result; +} +extern "C" { + pub fn CAMU_ReadRegisterI2cExclusive(data: *mut u16, select: u32, addr: u16) -> Result; +} +extern "C" { + pub fn CAMU_ReadMcuVariableI2cExclusive(data: *mut u16, select: u32, addr: u16) -> Result; +} +extern "C" { + pub fn CAMU_SetImageQualityCalibrationData(data: CAMU_ImageQualityCalibrationData) -> Result; +} +extern "C" { + pub fn CAMU_GetImageQualityCalibrationData( + data: *mut CAMU_ImageQualityCalibrationData, + ) -> Result; +} +extern "C" { + pub fn CAMU_SetPackageParameterWithoutContext( + param: CAMU_PackageParameterCameraSelect, + ) -> Result; +} +extern "C" { + pub fn CAMU_SetPackageParameterWithContext(param: CAMU_PackageParameterContext) -> Result; +} +extern "C" { + pub fn CAMU_SetPackageParameterWithContextDetail( + param: CAMU_PackageParameterContextDetail, + ) -> Result; +} +extern "C" { + pub fn CAMU_GetSuitableY2rStandardCoefficient( + coefficient: *mut Y2RU_StandardCoefficient, + ) -> Result; +} +extern "C" { + pub fn CAMU_PlayShutterSound(sound: CAMU_ShutterSoundType) -> Result; +} +extern "C" { + pub fn CAMU_DriverInitialize() -> Result; +} +extern "C" { + pub fn CAMU_DriverFinalize() -> Result; +} +extern "C" { + pub fn CAMU_GetActivatedCamera(select: *mut u32) -> Result; +} +extern "C" { + pub fn CAMU_GetSleepCamera(select: *mut u32) -> Result; +} +extern "C" { + pub fn CAMU_SetSleepCamera(select: u32) -> Result; +} +extern "C" { + pub fn CAMU_SetBrightnessSynchronization(brightnessSynchronization: bool) -> Result; +} +extern "C" { + pub fn cfgnorInit(value: u8) -> Result; +} +extern "C" { + pub fn cfgnorExit(); +} +extern "C" { + pub fn cfgnorDumpFlash(buf: *mut u32, size: u32) -> Result; +} +extern "C" { + pub fn cfgnorWriteFlash(buf: *mut u32, size: u32) -> Result; +} +extern "C" { + pub fn CFGNOR_Initialize(value: u8) -> Result; +} +extern "C" { + pub fn CFGNOR_Shutdown() -> Result; +} +extern "C" { + pub fn CFGNOR_ReadData(offset: u32, buf: *mut u32, size: u32) -> Result; +} +extern "C" { + pub fn CFGNOR_WriteData(offset: u32, buf: *mut u32, size: u32) -> Result; +} +pub const CFG_REGION_JPN: CFG_Region = 0; +pub const CFG_REGION_USA: CFG_Region = 1; +pub const CFG_REGION_EUR: CFG_Region = 2; +pub const CFG_REGION_AUS: CFG_Region = 3; +pub const CFG_REGION_CHN: CFG_Region = 4; +pub const CFG_REGION_KOR: CFG_Region = 5; +pub const CFG_REGION_TWN: CFG_Region = 6; +pub type CFG_Region = u32; +pub const CFG_LANGUAGE_JP: CFG_Language = 0; +pub const CFG_LANGUAGE_EN: CFG_Language = 1; +pub const CFG_LANGUAGE_FR: CFG_Language = 2; +pub const CFG_LANGUAGE_DE: CFG_Language = 3; +pub const CFG_LANGUAGE_IT: CFG_Language = 4; +pub const CFG_LANGUAGE_ES: CFG_Language = 5; +pub const CFG_LANGUAGE_ZH: CFG_Language = 6; +pub const CFG_LANGUAGE_KO: CFG_Language = 7; +pub const CFG_LANGUAGE_NL: CFG_Language = 8; +pub const CFG_LANGUAGE_PT: CFG_Language = 9; +pub const CFG_LANGUAGE_RU: CFG_Language = 10; +pub const CFG_LANGUAGE_TW: CFG_Language = 11; +pub type CFG_Language = u32; +extern "C" { + pub fn cfguInit() -> Result; +} +extern "C" { + pub fn cfguExit(); +} +extern "C" { + pub fn CFGU_SecureInfoGetRegion(region: *mut u8) -> Result; +} +extern "C" { + pub fn CFGU_GenHashConsoleUnique(appIDSalt: u32, hash: *mut u64) -> Result; +} +extern "C" { + pub fn CFGU_GetRegionCanadaUSA(value: *mut u8) -> Result; +} +extern "C" { + pub fn CFGU_GetSystemModel(model: *mut u8) -> Result; +} +extern "C" { + pub fn CFGU_GetModelNintendo2DS(value: *mut u8) -> Result; +} +extern "C" { + pub fn CFGU_GetCountryCodeString(code: u16, string: *mut u16) -> Result; +} +extern "C" { + pub fn CFGU_GetCountryCodeID(string: u16, code: *mut u16) -> Result; +} +extern "C" { + pub fn CFGU_IsNFCSupported(isSupported: *mut bool) -> Result; +} +extern "C" { + pub fn CFGU_GetConfigInfoBlk2(size: u32, blkID: u32, outData: *mut u8) -> Result; +} +extern "C" { + pub fn CFG_GetConfigInfoBlk4(size: u32, blkID: u32, outData: *mut u8) -> Result; +} +extern "C" { + pub fn CFG_GetConfigInfoBlk8(size: u32, blkID: u32, outData: *mut u8) -> Result; +} +extern "C" { + pub fn CFG_SetConfigInfoBlk4(size: u32, blkID: u32, inData: *mut u8) -> Result; +} +extern "C" { + pub fn CFG_SetConfigInfoBlk8(size: u32, blkID: u32, inData: *mut u8) -> Result; +} +extern "C" { + pub fn CFG_UpdateConfigSavegame() -> Result; +} +extern "C" { + pub fn CFGU_GetSystemLanguage(language: *mut u8) -> Result; +} +extern "C" { + pub fn CFGI_RestoreLocalFriendCodeSeed() -> Result; +} +extern "C" { + pub fn CFGI_RestoreSecureInfo() -> Result; +} +extern "C" { + pub fn CFGI_DeleteConfigSavefile() -> Result; +} +extern "C" { + pub fn CFGI_FormatConfig() -> Result; +} +extern "C" { + pub fn CFGI_ClearParentalControls() -> Result; +} +extern "C" { + pub fn CFGI_VerifySigLocalFriendCodeSeed() -> Result; +} +extern "C" { + pub fn CFGI_VerifySigSecureInfo() -> Result; +} +extern "C" { + pub fn CFGI_SecureInfoGetSerialNumber(serial: *mut u8) -> Result; +} +extern "C" { + pub fn CFGI_GetLocalFriendCodeSeedData(data: *mut u8) -> Result; +} +extern "C" { + pub fn CFGI_GetLocalFriendCodeSeed(seed: *mut u64) -> Result; +} +extern "C" { + pub fn CFGI_GetSecureInfoData(data: *mut u8) -> Result; +} +extern "C" { + pub fn CFGI_GetSecureInfoSignature(data: *mut u8) -> Result; +} +pub const CSND_ENCODING_PCM8: _bindgen_ty_15 = 0; +pub const CSND_ENCODING_PCM16: _bindgen_ty_15 = 1; +pub const CSND_ENCODING_ADPCM: _bindgen_ty_15 = 2; +pub const CSND_ENCODING_PSG: _bindgen_ty_15 = 3; +pub type _bindgen_ty_15 = u32; +pub const CSND_LOOPMODE_MANUAL: _bindgen_ty_16 = 0; +pub const CSND_LOOPMODE_NORMAL: _bindgen_ty_16 = 1; +pub const CSND_LOOPMODE_ONESHOT: _bindgen_ty_16 = 2; +pub const CSND_LOOPMODE_NORELOAD: _bindgen_ty_16 = 3; +pub type _bindgen_ty_16 = u32; +pub const SOUND_LINEAR_INTERP: _bindgen_ty_17 = 64; +pub const SOUND_REPEAT: _bindgen_ty_17 = 1024; +pub const SOUND_ONE_SHOT: _bindgen_ty_17 = 2048; +pub const SOUND_FORMAT_8BIT: _bindgen_ty_17 = 0; +pub const SOUND_FORMAT_16BIT: _bindgen_ty_17 = 4096; +pub const SOUND_FORMAT_ADPCM: _bindgen_ty_17 = 8192; +pub const SOUND_FORMAT_PSG: _bindgen_ty_17 = 12288; +pub const SOUND_ENABLE: _bindgen_ty_17 = 16384; +pub type _bindgen_ty_17 = u32; +pub const CAPTURE_REPEAT: _bindgen_ty_18 = 0; +pub const CAPTURE_ONE_SHOT: _bindgen_ty_18 = 1; +pub const CAPTURE_FORMAT_16BIT: _bindgen_ty_18 = 0; +pub const CAPTURE_FORMAT_8BIT: _bindgen_ty_18 = 2; +pub const CAPTURE_ENABLE: _bindgen_ty_18 = 32768; +pub type _bindgen_ty_18 = u32; +pub const DutyCycle_0: CSND_DutyCycle = 7; +pub const DutyCycle_12: CSND_DutyCycle = 0; +pub const DutyCycle_25: CSND_DutyCycle = 1; +pub const DutyCycle_37: CSND_DutyCycle = 2; +pub const DutyCycle_50: CSND_DutyCycle = 3; +pub const DutyCycle_62: CSND_DutyCycle = 4; +pub const DutyCycle_75: CSND_DutyCycle = 5; +pub const DutyCycle_87: CSND_DutyCycle = 6; +pub type CSND_DutyCycle = u32; +#[repr(C)] +pub struct CSND_ChnInfo { + pub value: __BindgenUnionField<[u32; 3usize]>, + pub __bindgen_anon_1: __BindgenUnionField, + pub bindgen_union_field: [u32; 3usize], +} +#[repr(C)] +pub struct CSND_ChnInfo__bindgen_ty_1 { + pub active: u8, + pub _pad1: u8, + pub _pad2: u16, + pub adpcmSample: s16, + pub adpcmIndex: u8, + pub _pad3: u8, + pub unknownZero: u32, +} +#[repr(C)] +pub struct CSND_CapInfo { + pub value: __BindgenUnionField<[u32; 2usize]>, + pub __bindgen_anon_1: __BindgenUnionField, + pub bindgen_union_field: [u32; 2usize], +} +#[repr(C)] +pub struct CSND_CapInfo__bindgen_ty_1 { + pub active: u8, + pub _pad1: u8, + pub _pad2: u16, + pub unknownZero: u32, +} +extern "C" { + pub static mut csndSharedMem: *mut vu32; +} +extern "C" { + pub static mut csndSharedMemSize: u32; +} +extern "C" { + pub static mut csndChannels: u32; +} +extern "C" { + pub fn CSND_AcquireCapUnit(capUnit: *mut u32) -> Result; +} +extern "C" { + pub fn CSND_ReleaseCapUnit(capUnit: u32) -> Result; +} +extern "C" { + pub fn CSND_FlushDataCache(adr: *const ::libc::c_void, size: u32) -> Result; +} +extern "C" { + pub fn CSND_StoreDataCache(adr: *const ::libc::c_void, size: u32) -> Result; +} +extern "C" { + pub fn CSND_InvalidateDataCache(adr: *const ::libc::c_void, size: u32) -> Result; +} +extern "C" { + pub fn CSND_Reset() -> Result; +} +extern "C" { + pub fn csndInit() -> Result; +} +extern "C" { + pub fn csndExit(); +} +extern "C" { + pub fn csndAddCmd(cmdid: ::libc::c_int) -> *mut u32; +} +extern "C" { + pub fn csndWriteCmd(cmdid: ::libc::c_int, cmdparams: *mut u8); +} +extern "C" { + pub fn csndExecCmds(waitDone: bool) -> Result; +} +extern "C" { + pub fn CSND_SetPlayStateR(channel: u32, value: u32); +} +extern "C" { + pub fn CSND_SetPlayState(channel: u32, value: u32); +} +extern "C" { + pub fn CSND_SetEncoding(channel: u32, value: u32); +} +extern "C" { + pub fn CSND_SetBlock(channel: u32, block: ::libc::c_int, physaddr: u32, size: u32); +} +extern "C" { + pub fn CSND_SetLooping(channel: u32, value: u32); +} +extern "C" { + pub fn CSND_SetBit7(channel: u32, set: bool); +} +extern "C" { + pub fn CSND_SetInterp(channel: u32, interp: bool); +} +extern "C" { + pub fn CSND_SetDuty(channel: u32, duty: CSND_DutyCycle); +} +extern "C" { + pub fn CSND_SetTimer(channel: u32, timer: u32); +} +extern "C" { + pub fn CSND_SetVol(channel: u32, chnVolumes: u32, capVolumes: u32); +} +extern "C" { + pub fn CSND_SetAdpcmState( + channel: u32, + block: ::libc::c_int, + sample: ::libc::c_int, + index: ::libc::c_int, + ); +} +extern "C" { + pub fn CSND_SetAdpcmReload(channel: u32, reload: bool); +} +extern "C" { + pub fn CSND_SetChnRegs( + flags: u32, + physaddr0: u32, + physaddr1: u32, + totalbytesize: u32, + chnVolumes: u32, + capVolumes: u32, + ); +} +extern "C" { + pub fn CSND_SetChnRegsPSG(flags: u32, chnVolumes: u32, capVolumes: u32, duty: CSND_DutyCycle); +} +extern "C" { + pub fn CSND_SetChnRegsNoise(flags: u32, chnVolumes: u32, capVolumes: u32); +} +extern "C" { + pub fn CSND_CapEnable(capUnit: u32, enable: bool); +} +extern "C" { + pub fn CSND_CapSetRepeat(capUnit: u32, repeat: bool); +} +extern "C" { + pub fn CSND_CapSetFormat(capUnit: u32, eightbit: bool); +} +extern "C" { + pub fn CSND_CapSetBit2(capUnit: u32, set: bool); +} +extern "C" { + pub fn CSND_CapSetTimer(capUnit: u32, timer: u32); +} +extern "C" { + pub fn CSND_CapSetBuffer(capUnit: u32, addr: u32, size: u32); +} +extern "C" { + pub fn CSND_SetCapRegs(capUnit: u32, flags: u32, addr: u32, size: u32); +} +extern "C" { + pub fn CSND_SetDspFlags(waitDone: bool) -> Result; +} +extern "C" { + pub fn CSND_UpdateInfo(waitDone: bool) -> Result; +} +extern "C" { + pub fn csndPlaySound( + chn: ::libc::c_int, + flags: u32, + sampleRate: u32, + vol: f32, + pan: f32, + data0: *mut ::libc::c_void, + data1: *mut ::libc::c_void, + size: u32, + ) -> Result; +} +extern "C" { + pub fn csndGetDspFlags(outSemFlags: *mut u32, outIrqFlags: *mut u32); +} +extern "C" { + pub fn csndGetChnInfo(channel: u32) -> *mut CSND_ChnInfo; +} +extern "C" { + pub fn csndGetCapInfo(capUnit: u32) -> *mut CSND_CapInfo; +} +extern "C" { + pub fn csndGetState(channel: u32, out: *mut CSND_ChnInfo) -> Result; +} +extern "C" { + pub fn csndIsPlaying(channel: u32, status: *mut u8) -> Result; +} +pub const DSP_INTERRUPT_PIPE: DSP_InterruptType = 2; +pub type DSP_InterruptType = u32; +pub const DSP_PIPE_INPUT: DSP_PipeDirection = 0; +pub const DSP_PIPE_OUTPUT: DSP_PipeDirection = 1; +pub type DSP_PipeDirection = u32; +extern "C" { + pub fn dspInit() -> Result; +} +extern "C" { + pub fn dspExit(); +} +extern "C" { + pub fn DSP_GetHeadphoneStatus(is_inserted: *mut bool) -> Result; +} +extern "C" { + pub fn DSP_FlushDataCache(address: *const ::libc::c_void, size: u32) -> Result; +} +extern "C" { + pub fn DSP_InvalidateDataCache(address: *const ::libc::c_void, size: u32) -> Result; +} +extern "C" { + pub fn DSP_GetSemaphoreHandle(semaphore: *mut Handle) -> Result; +} +extern "C" { + pub fn DSP_SetSemaphore(value: u16) -> Result; +} +extern "C" { + pub fn DSP_SetSemaphoreMask(mask: u16) -> Result; +} +extern "C" { + pub fn DSP_LoadComponent( + component: *const ::libc::c_void, + size: u32, + prog_mask: u16, + data_mask: u16, + is_loaded: *mut bool, + ) -> Result; +} +extern "C" { + pub fn DSP_UnloadComponent() -> Result; +} +extern "C" { + pub fn DSP_RegisterInterruptEvents(handle: Handle, interrupt: u32, channel: u32) -> Result; +} +extern "C" { + pub fn DSP_ReadPipeIfPossible( + channel: u32, + peer: u32, + buffer: *mut ::libc::c_void, + length: u16, + length_read: *mut u16, + ) -> Result; +} +extern "C" { + pub fn DSP_WriteProcessPipe(channel: u32, buffer: *const ::libc::c_void, length: u32) + -> Result; +} +extern "C" { + pub fn DSP_ConvertProcessAddressFromDspDram(dsp_address: u32, arm_address: *mut u32) -> Result; +} +extern "C" { + pub fn DSP_RecvData(regNo: u16, value: *mut u16) -> Result; +} +extern "C" { + pub fn DSP_RecvDataIsReady(regNo: u16, is_ready: *mut bool) -> Result; +} +extern "C" { + pub fn DSP_SendData(regNo: u16, value: u16) -> Result; +} +extern "C" { + pub fn DSP_SendDataIsEmpty(regNo: u16, is_empty: *mut bool) -> Result; +} +#[repr(C, packed)] +pub struct FriendKey { + pub principalId: u32, + pub padding: u32, + pub localFriendCode: u64, +} +#[repr(C, packed)] +pub struct TitleData { + pub tid: u64, + pub version: u32, + pub unk: u32, +} +#[repr(C, packed)] +pub struct MiiData { + pub mii_id: u32, + pub system_id: u64, + pub cdate: u32, + pub mac: [u8; 6usize], + pub padding: u16, + pub misc1: u16, + pub mii_name: [u16; 11usize], + pub width: u8, + pub height: u8, + pub misc2: u32, + pub unknown1: u32, + pub misc3: u32, + pub unknown2: u32, + pub allow_copy: u8, + pub unknown3: [u8; 7usize], + pub author: [u16; 11usize], +} +#[repr(C, packed)] +pub struct FriendProfile { + pub region: u8, + pub country: u8, + pub area: u8, + pub language: u8, + pub platform: u8, + pub padding: u32, +} +#[repr(C, packed)] +pub struct GameDescription { + pub data: TitleData, + pub desc: [u16; 128usize], +} +#[repr(C, packed)] +pub struct NotificationEvent { + pub type_: u8, + pub padding3: [u8; 3usize], + pub padding: u32, + pub key: FriendKey, +} +pub const USER_WENT_ONLINE: NotificationTypes = 1; +pub const USER_WENT_OFFLINE: NotificationTypes = 2; +pub const FRIEND_WENT_ONLINE: NotificationTypes = 3; +pub const FRIEND_UPDATED_PRESENCE: NotificationTypes = 4; +pub const FRIEND_UPDATED_MII: NotificationTypes = 5; +pub const FRIEND_UPDATED_PROFILE: NotificationTypes = 6; +pub const FRIEND_WENT_OFFLINE: NotificationTypes = 7; +pub const FRIEND_REGISTERED_USER: NotificationTypes = 8; +pub const FRIEND_SENT_INVITATION: NotificationTypes = 9; +pub type NotificationTypes = u32; +extern "C" { + pub fn frdInit() -> Result; +} +extern "C" { + pub fn frdExit(); +} +extern "C" { + pub fn frdSessionGetHandle() -> *mut Handle; +} +extern "C" { + pub fn FRDU_HasLoggedIn(state: *mut bool) -> Result; +} +extern "C" { + pub fn FRDU_IsOnline(state: *mut bool) -> Result; +} +extern "C" { + pub fn FRD_Logout() -> Result; +} +extern "C" { + pub fn FRD_Login(event: Handle) -> Result; +} +extern "C" { + pub fn FRD_GetMyFriendKey(key: *mut FriendKey) -> Result; +} +extern "C" { + pub fn FRD_GetMyPreference( + isPublicMode: *mut bool, + isShowGameName: *mut bool, + isShowPlayedGame: *mut bool, + ) -> Result; +} +extern "C" { + pub fn FRD_GetMyProfile(profile: *mut FriendProfile) -> Result; +} +extern "C" { + pub fn FRD_GetMyScreenName(name: *mut ::libc::c_char, max_size: usize) -> Result; +} +extern "C" { + pub fn FRD_GetMyMii(mii: *mut MiiData) -> Result; +} +extern "C" { + pub fn FRD_GetMyPlayingGame(titleId: *mut u64) -> Result; +} +extern "C" { + pub fn FRD_GetMyFavoriteGame(titleId: *mut u64) -> Result; +} +extern "C" { + pub fn FRD_GetMyComment(comment: *mut ::libc::c_char, max_size: usize) -> Result; +} +extern "C" { + pub fn FRD_GetFriendKeyList( + friendKeyList: *mut FriendKey, + num: *mut u32, + offset: u32, + size: u32, + ) -> Result; +} +extern "C" { + pub fn FRD_GetFriendMii( + miiDataList: *mut MiiData, + friendKeyList: *const FriendKey, + size: usize, + ) -> Result; +} +extern "C" { + pub fn FRD_GetFriendProfile( + profile: *mut FriendProfile, + friendKeyList: *const FriendKey, + size: usize, + ) -> Result; +} +extern "C" { + pub fn FRD_GetFriendPlayingGame( + desc: *mut GameDescription, + friendKeyList: *const FriendKey, + size: usize, + ) -> Result; +} +extern "C" { + pub fn FRD_GetFriendFavouriteGame( + desc: *mut GameDescription, + friendKeyList: *const FriendKey, + count: u32, + ) -> Result; +} +extern "C" { + pub fn FRD_IsInFriendList(friendKeyList: *mut FriendKey, isFromList: *mut bool) -> Result; +} +extern "C" { + pub fn FRD_UpdateGameModeDescription(desc: *const ::libc::c_char) -> Result; +} +extern "C" { + pub fn FRD_AttachToEventNotification(event: Handle) -> Result; +} +extern "C" { + pub fn FRD_GetEventNotification( + event: *mut NotificationEvent, + count: u32, + recievedNotifCount: *mut u32, + ) -> Result; +} +extern "C" { + pub fn FRD_PrincipalIdToFriendCode(principalId: u32, friendCode: *mut u64) -> Result; +} +extern "C" { + pub fn FRD_FriendCodeToPrincipalId(friendCode: u64, principalId: *mut u32) -> Result; +} +extern "C" { + pub fn FRD_IsValidFriendCode(friendCode: u64, isValid: *mut bool) -> Result; +} +extern "C" { + pub fn FRD_SetClientSdkVersion(sdkVer: u32) -> Result; +} +extern "C" { + pub fn FRD_AddFriendOnline(event: Handle, principalId: u32) -> Result; +} +extern "C" { + pub fn FRD_RemoveFriend(principalId: u32, localFriendCode: u64) -> Result; +} +pub const GSPLCD_SCREEN_TOP: _bindgen_ty_19 = 1; +pub const GSPLCD_SCREEN_BOTTOM: _bindgen_ty_19 = 2; +pub const GSPLCD_SCREEN_BOTH: _bindgen_ty_19 = 3; +pub type _bindgen_ty_19 = u32; +extern "C" { + pub fn gspLcdInit() -> Result; +} +extern "C" { + pub fn gspLcdExit(); +} +extern "C" { + pub fn GSPLCD_PowerOnAllBacklights() -> Result; +} +extern "C" { + pub fn GSPLCD_PowerOffAllBacklights() -> Result; +} +extern "C" { + pub fn GSPLCD_PowerOnBacklight(screen: u32) -> Result; +} +extern "C" { + pub fn GSPLCD_PowerOffBacklight(screen: u32) -> Result; +} +extern "C" { + pub fn GSPLCD_SetLedForceOff(disable: bool) -> Result; +} +extern "C" { + pub fn GSPLCD_GetVendors(vendors: *mut u8) -> Result; +} +extern "C" { + pub fn GSPLCD_GetBrightness(screen: u32, brightness: *mut u32) -> Result; +} +extern "C" { + pub fn GSPLCD_SetBrightness(screen: u32, brightness: u32) -> Result; +} +extern "C" { + pub fn GSPLCD_SetBrightnessRaw(screen: u32, brightness: u32) -> Result; +} +pub const KEY_A: _bindgen_ty_20 = 1; +pub const KEY_B: _bindgen_ty_20 = 2; +pub const KEY_SELECT: _bindgen_ty_20 = 4; +pub const KEY_START: _bindgen_ty_20 = 8; +pub const KEY_DRIGHT: _bindgen_ty_20 = 16; +pub const KEY_DLEFT: _bindgen_ty_20 = 32; +pub const KEY_DUP: _bindgen_ty_20 = 64; +pub const KEY_DDOWN: _bindgen_ty_20 = 128; +pub const KEY_R: _bindgen_ty_20 = 256; +pub const KEY_L: _bindgen_ty_20 = 512; +pub const KEY_X: _bindgen_ty_20 = 1024; +pub const KEY_Y: _bindgen_ty_20 = 2048; +pub const KEY_ZL: _bindgen_ty_20 = 16384; +pub const KEY_ZR: _bindgen_ty_20 = 32768; +pub const KEY_TOUCH: _bindgen_ty_20 = 1048576; +pub const KEY_CSTICK_RIGHT: _bindgen_ty_20 = 16777216; +pub const KEY_CSTICK_LEFT: _bindgen_ty_20 = 33554432; +pub const KEY_CSTICK_UP: _bindgen_ty_20 = 67108864; +pub const KEY_CSTICK_DOWN: _bindgen_ty_20 = 134217728; +pub const KEY_CPAD_RIGHT: _bindgen_ty_20 = 268435456; +pub const KEY_CPAD_LEFT: _bindgen_ty_20 = 536870912; +pub const KEY_CPAD_UP: _bindgen_ty_20 = 1073741824; +pub const KEY_CPAD_DOWN: _bindgen_ty_20 = 2147483648; +pub const KEY_UP: _bindgen_ty_20 = 1073741888; +pub const KEY_DOWN: _bindgen_ty_20 = 2147483776; +pub const KEY_LEFT: _bindgen_ty_20 = 536870944; +pub const KEY_RIGHT: _bindgen_ty_20 = 268435472; +pub type _bindgen_ty_20 = u32; +#[repr(C)] +pub struct touchPosition { + pub px: u16, + pub py: u16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct circlePosition { + pub dx: s16, + pub dy: s16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct accelVector { + pub x: s16, + pub y: s16, + pub z: s16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct angularRate { + pub x: s16, + pub z: s16, + pub y: s16, +} +pub const HIDEVENT_PAD0: HID_Event = 0; +pub const HIDEVENT_PAD1: HID_Event = 1; +pub const HIDEVENT_Accel: HID_Event = 2; +pub const HIDEVENT_Gyro: HID_Event = 3; +pub const HIDEVENT_DebugPad: HID_Event = 4; +pub const HIDEVENT_MAX: HID_Event = 5; +pub type HID_Event = u32; +extern "C" { + pub static mut hidMemHandle: Handle; +} +extern "C" { + pub static mut hidSharedMem: *mut vu32; +} +extern "C" { + pub fn hidInit() -> Result; +} +extern "C" { + pub fn hidExit(); +} +extern "C" { + pub fn hidScanInput(); +} +extern "C" { + pub fn hidKeysHeld() -> u32; +} +extern "C" { + pub fn hidKeysDown() -> u32; +} +extern "C" { + pub fn hidKeysUp() -> u32; +} +extern "C" { + pub fn hidTouchRead(pos: *mut touchPosition); +} +extern "C" { + pub fn hidCircleRead(pos: *mut circlePosition); +} +extern "C" { + pub fn hidAccelRead(vector: *mut accelVector); +} +extern "C" { + pub fn hidGyroRead(rate: *mut angularRate); +} +extern "C" { + pub fn hidWaitForEvent(id: HID_Event, nextEvent: bool); +} +extern "C" { + pub fn HIDUSER_GetHandles( + outMemHandle: *mut Handle, + eventpad0: *mut Handle, + eventpad1: *mut Handle, + eventaccel: *mut Handle, + eventgyro: *mut Handle, + eventdebugpad: *mut Handle, + ) -> Result; +} +extern "C" { + pub fn HIDUSER_EnableAccelerometer() -> Result; +} +extern "C" { + pub fn HIDUSER_DisableAccelerometer() -> Result; +} +extern "C" { + pub fn HIDUSER_EnableGyroscope() -> Result; +} +extern "C" { + pub fn HIDUSER_DisableGyroscope() -> Result; +} +extern "C" { + pub fn HIDUSER_GetGyroscopeRawToDpsCoefficient(coeff: *mut f32) -> Result; +} +extern "C" { + pub fn HIDUSER_GetSoundVolume(volume: *mut u8) -> Result; +} +extern "C" { + pub static mut irrstMemHandle: Handle; +} +extern "C" { + pub static mut irrstSharedMem: *mut vu32; +} +extern "C" { + pub fn irrstInit() -> Result; +} +extern "C" { + pub fn irrstExit(); +} +extern "C" { + pub fn irrstScanInput(); +} +extern "C" { + pub fn irrstKeysHeld() -> u32; +} +extern "C" { + pub fn irrstCstickRead(pos: *mut circlePosition); +} +extern "C" { + pub fn irrstWaitForEvent(nextEvent: bool); +} +extern "C" { + pub fn IRRST_GetHandles(outMemHandle: *mut Handle, outEventHandle: *mut Handle) -> Result; +} +extern "C" { + pub fn IRRST_Initialize(unk1: u32, unk2: u8) -> Result; +} +extern "C" { + pub fn IRRST_Shutdown() -> Result; +} +#[repr(C)] +pub struct sslcContext { + pub servhandle: Handle, + pub sslchandle: u32, + pub sharedmem_handle: Handle, +} +pub const SSLC_DefaultRootCert_Nintendo_CA: SSLC_DefaultRootCert = 1; +pub const SSLC_DefaultRootCert_Nintendo_CA_G2: SSLC_DefaultRootCert = 2; +pub const SSLC_DefaultRootCert_Nintendo_CA_G3: SSLC_DefaultRootCert = 3; +pub const SSLC_DefaultRootCert_Nintendo_Class2_CA: SSLC_DefaultRootCert = 4; +pub const SSLC_DefaultRootCert_Nintendo_Class2_CA_G2: SSLC_DefaultRootCert = 5; +pub const SSLC_DefaultRootCert_Nintendo_Class2_CA_G3: SSLC_DefaultRootCert = 6; +pub const SSLC_DefaultRootCert_CyberTrust: SSLC_DefaultRootCert = 7; +pub const SSLC_DefaultRootCert_AddTrust_External_CA: SSLC_DefaultRootCert = 8; +pub const SSLC_DefaultRootCert_COMODO: SSLC_DefaultRootCert = 9; +pub const SSLC_DefaultRootCert_USERTrust: SSLC_DefaultRootCert = 10; +pub const SSLC_DefaultRootCert_DigiCert_EV: SSLC_DefaultRootCert = 11; +pub type SSLC_DefaultRootCert = u32; +pub const SSLC_DefaultClientCert_ClCertA: SSLC_DefaultClientCert = 64; +pub type SSLC_DefaultClientCert = u32; +pub const SSLCOPT_Default: _bindgen_ty_21 = 0; +pub const SSLCOPT_DisableVerify: _bindgen_ty_21 = 512; +pub const SSLCOPT_TLSv10: _bindgen_ty_21 = 2048; +pub type _bindgen_ty_21 = u32; +extern "C" { + pub fn sslcInit(session_handle: Handle) -> Result; +} +extern "C" { + pub fn sslcExit(); +} +extern "C" { + pub fn sslcCreateRootCertChain(RootCertChain_contexthandle: *mut u32) -> Result; +} +extern "C" { + pub fn sslcDestroyRootCertChain(RootCertChain_contexthandle: u32) -> Result; +} +extern "C" { + pub fn sslcAddTrustedRootCA( + RootCertChain_contexthandle: u32, + cert: *const u8, + certsize: u32, + cert_contexthandle: *mut u32, + ) -> Result; +} +extern "C" { + pub fn sslcRootCertChainAddDefaultCert( + RootCertChain_contexthandle: u32, + certID: SSLC_DefaultRootCert, + cert_contexthandle: *mut u32, + ) -> Result; +} +extern "C" { + pub fn sslcRootCertChainRemoveCert( + RootCertChain_contexthandle: u32, + cert_contexthandle: u32, + ) -> Result; +} +extern "C" { + pub fn sslcCreate8CertChain(CertChain_contexthandle: *mut u32) -> Result; +} +extern "C" { + pub fn sslcDestroy8CertChain(CertChain_contexthandle: u32) -> Result; +} +extern "C" { + pub fn sslc8CertChainAddCert( + CertChain_contexthandle: u32, + cert: *const u8, + certsize: u32, + cert_contexthandle: *mut u32, + ) -> Result; +} +extern "C" { + pub fn sslc8CertChainAddDefaultCert( + CertChain_contexthandle: u32, + certID: u8, + cert_contexthandle: *mut u32, + ) -> Result; +} +extern "C" { + pub fn sslc8CertChainRemoveCert( + CertChain_contexthandle: u32, + cert_contexthandle: u32, + ) -> Result; +} +extern "C" { + pub fn sslcOpenClientCertContext( + cert: *const u8, + certsize: u32, + key: *const u8, + keysize: u32, + ClientCert_contexthandle: *mut u32, + ) -> Result; +} +extern "C" { + pub fn sslcOpenDefaultClientCertContext( + certID: SSLC_DefaultClientCert, + ClientCert_contexthandle: *mut u32, + ) -> Result; +} +extern "C" { + pub fn sslcCloseClientCertContext(ClientCert_contexthandle: u32) -> Result; +} +extern "C" { + pub fn sslcSeedRNG() -> Result; +} +extern "C" { + pub fn sslcGenerateRandomData(buf: *mut u8, size: u32) -> Result; +} +extern "C" { + pub fn sslcCreateContext( + context: *mut sslcContext, + sockfd: ::libc::c_int, + input_opt: u32, + hostname: *const ::libc::c_char, + ) -> Result; +} +extern "C" { + pub fn sslcDestroyContext(context: *mut sslcContext) -> Result; +} +extern "C" { + pub fn sslcStartConnection( + context: *mut sslcContext, + internal_retval: *mut ::libc::c_int, + out: *mut u32, + ) -> Result; +} +extern "C" { + pub fn sslcRead( + context: *mut sslcContext, + buf: *mut ::libc::c_void, + len: usize, + peek: bool, + ) -> Result; +} +extern "C" { + pub fn sslcWrite(context: *mut sslcContext, buf: *const ::libc::c_void, len: usize) -> Result; +} +extern "C" { + pub fn sslcContextSetRootCertChain(context: *mut sslcContext, handle: u32) -> Result; +} +extern "C" { + pub fn sslcContextSetClientCert(context: *mut sslcContext, handle: u32) -> Result; +} +extern "C" { + pub fn sslcContextSetHandle8(context: *mut sslcContext, handle: u32) -> Result; +} +extern "C" { + pub fn sslcContextClearOpt(context: *mut sslcContext, bitmask: u32) -> Result; +} +extern "C" { + pub fn sslcContextGetProtocolCipher( + context: *mut sslcContext, + outprotocols: *mut ::libc::c_char, + outprotocols_maxsize: u32, + outcipher: *mut ::libc::c_char, + outcipher_maxsize: u32, + ) -> Result; +} +extern "C" { + pub fn sslcContextGetState(context: *mut sslcContext, out: *mut u32) -> Result; +} +extern "C" { + pub fn sslcContextInitSharedmem(context: *mut sslcContext, buf: *mut u8, size: u32) -> Result; +} +extern "C" { + pub fn sslcAddCert(context: *mut sslcContext, buf: *const u8, size: u32) -> Result; +} +#[repr(C)] +pub struct httpcContext { + pub servhandle: Handle, + pub httphandle: u32, +} +pub const HTTPC_METHOD_GET: HTTPC_RequestMethod = 1; +pub const HTTPC_METHOD_POST: HTTPC_RequestMethod = 2; +pub const HTTPC_METHOD_HEAD: HTTPC_RequestMethod = 3; +pub const HTTPC_METHOD_PUT: HTTPC_RequestMethod = 4; +pub const HTTPC_METHOD_DELETE: HTTPC_RequestMethod = 5; +pub type HTTPC_RequestMethod = u32; +pub const HTTPC_STATUS_REQUEST_IN_PROGRESS: HTTPC_RequestStatus = 5; +pub const HTTPC_STATUS_DOWNLOAD_READY: HTTPC_RequestStatus = 7; +pub type HTTPC_RequestStatus = u32; +pub const HTTPC_KEEPALIVE_DISABLED: HTTPC_KeepAlive = 0; +pub const HTTPC_KEEPALIVE_ENABLED: HTTPC_KeepAlive = 1; +pub type HTTPC_KeepAlive = u32; +extern "C" { + pub fn httpcInit(sharedmem_size: u32) -> Result; +} +extern "C" { + pub fn httpcExit(); +} +extern "C" { + pub fn httpcOpenContext( + context: *mut httpcContext, + method: HTTPC_RequestMethod, + url: *const ::libc::c_char, + use_defaultproxy: u32, + ) -> Result; +} +extern "C" { + pub fn httpcCloseContext(context: *mut httpcContext) -> Result; +} +extern "C" { + pub fn httpcCancelConnection(context: *mut httpcContext) -> Result; +} +extern "C" { + pub fn httpcAddRequestHeaderField( + context: *mut httpcContext, + name: *const ::libc::c_char, + value: *const ::libc::c_char, + ) -> Result; +} +extern "C" { + pub fn httpcAddPostDataAscii( + context: *mut httpcContext, + name: *const ::libc::c_char, + value: *const ::libc::c_char, + ) -> Result; +} +extern "C" { + pub fn httpcAddPostDataBinary( + context: *mut httpcContext, + name: *const ::libc::c_char, + value: *const u8, + len: u32, + ) -> Result; +} +extern "C" { + pub fn httpcAddPostDataRaw(context: *mut httpcContext, data: *const u32, len: u32) -> Result; +} +extern "C" { + pub fn httpcBeginRequest(context: *mut httpcContext) -> Result; +} +extern "C" { + pub fn httpcReceiveData(context: *mut httpcContext, buffer: *mut u8, size: u32) -> Result; +} +extern "C" { + pub fn httpcReceiveDataTimeout( + context: *mut httpcContext, + buffer: *mut u8, + size: u32, + timeout: u64, + ) -> Result; +} +extern "C" { + pub fn httpcGetRequestState( + context: *mut httpcContext, + out: *mut HTTPC_RequestStatus, + ) -> Result; +} +extern "C" { + pub fn httpcGetDownloadSizeState( + context: *mut httpcContext, + downloadedsize: *mut u32, + contentsize: *mut u32, + ) -> Result; +} +extern "C" { + pub fn httpcGetResponseStatusCode(context: *mut httpcContext, out: *mut u32) -> Result; +} +extern "C" { + pub fn httpcGetResponseStatusCodeTimeout( + context: *mut httpcContext, + out: *mut u32, + timeout: u64, + ) -> Result; +} +extern "C" { + pub fn httpcGetResponseHeader( + context: *mut httpcContext, + name: *const ::libc::c_char, + value: *mut ::libc::c_char, + valuebuf_maxsize: u32, + ) -> Result; +} +extern "C" { + pub fn httpcAddTrustedRootCA( + context: *mut httpcContext, + cert: *const u8, + certsize: u32, + ) -> Result; +} +extern "C" { + pub fn httpcAddDefaultCert(context: *mut httpcContext, certID: SSLC_DefaultRootCert) -> Result; +} +extern "C" { + pub fn httpcSelectRootCertChain( + context: *mut httpcContext, + RootCertChain_contexthandle: u32, + ) -> Result; +} +extern "C" { + pub fn httpcSetClientCert( + context: *mut httpcContext, + cert: *const u8, + certsize: u32, + privk: *const u8, + privk_size: u32, + ) -> Result; +} +extern "C" { + pub fn httpcSetClientCertDefault( + context: *mut httpcContext, + certID: SSLC_DefaultClientCert, + ) -> Result; +} +extern "C" { + pub fn httpcSetClientCertContext( + context: *mut httpcContext, + ClientCert_contexthandle: u32, + ) -> Result; +} +extern "C" { + pub fn httpcSetSSLOpt(context: *mut httpcContext, options: u32) -> Result; +} +extern "C" { + pub fn httpcSetSSLClearOpt(context: *mut httpcContext, options: u32) -> Result; +} +extern "C" { + pub fn httpcCreateRootCertChain(RootCertChain_contexthandle: *mut u32) -> Result; +} +extern "C" { + pub fn httpcDestroyRootCertChain(RootCertChain_contexthandle: u32) -> Result; +} +extern "C" { + pub fn httpcRootCertChainAddCert( + RootCertChain_contexthandle: u32, + cert: *const u8, + certsize: u32, + cert_contexthandle: *mut u32, + ) -> Result; +} +extern "C" { + pub fn httpcRootCertChainAddDefaultCert( + RootCertChain_contexthandle: u32, + certID: SSLC_DefaultRootCert, + cert_contexthandle: *mut u32, + ) -> Result; +} +extern "C" { + pub fn httpcRootCertChainRemoveCert( + RootCertChain_contexthandle: u32, + cert_contexthandle: u32, + ) -> Result; +} +extern "C" { + pub fn httpcOpenClientCertContext( + cert: *const u8, + certsize: u32, + privk: *const u8, + privk_size: u32, + ClientCert_contexthandle: *mut u32, + ) -> Result; +} +extern "C" { + pub fn httpcOpenDefaultClientCertContext( + certID: SSLC_DefaultClientCert, + ClientCert_contexthandle: *mut u32, + ) -> Result; +} +extern "C" { + pub fn httpcCloseClientCertContext(ClientCert_contexthandle: u32) -> Result; +} +extern "C" { + pub fn httpcDownloadData( + context: *mut httpcContext, + buffer: *mut u8, + size: u32, + downloadedsize: *mut u32, + ) -> Result; +} +extern "C" { + pub fn httpcSetKeepAlive(context: *mut httpcContext, option: HTTPC_KeepAlive) -> Result; +} +#[repr(C)] +pub struct udsNodeInfo { + pub uds_friendcodeseed: u64, + pub __bindgen_anon_1: udsNodeInfo__bindgen_ty_1, + pub NetworkNodeID: u16, + pub pad_x22: u16, + pub word_x24: u32, +} +#[repr(C)] +pub struct udsNodeInfo__bindgen_ty_1 { + pub usercfg: __BindgenUnionField<[u8; 24usize]>, + pub __bindgen_anon_1: __BindgenUnionField, + pub bindgen_union_field: [u16; 12usize], +} +#[repr(C)] +pub struct udsNodeInfo__bindgen_ty_1__bindgen_ty_1 { + pub username: [u16; 10usize], + pub unk_x1c: u16, + pub flag: u8, + pub pad_x1f: u8, +} +#[repr(C)] +pub struct udsConnectionStatus { + pub status: u32, + pub unk_x4: u32, + pub cur_NetworkNodeID: u16, + pub unk_xa: u16, + pub unk_xc: [u32; 8usize], + pub total_nodes: u8, + pub max_nodes: u8, + pub node_bitmask: u16, +} +#[repr(C)] +pub struct udsNetworkStruct { + pub host_macaddress: [u8; 6usize], + pub channel: u8, + pub pad_x7: u8, + pub initialized_flag: u8, + pub unk_x9: [u8; 3usize], + pub oui_value: [u8; 3usize], + pub oui_type: u8, + pub wlancommID: u32, + pub id8: u8, + pub unk_x15: u8, + pub attributes: u16, + pub networkID: u32, + pub total_nodes: u8, + pub max_nodes: u8, + pub unk_x1e: u8, + pub unk_x1f: u8, + pub unk_x20: [u8; 31usize], + pub appdata_size: u8, + pub appdata: [u8; 200usize], +} +#[repr(C)] +pub struct udsBindContext { + pub BindNodeID: u32, + pub event: Handle, + pub spectator: bool, +} +#[repr(C)] +pub struct nwmScanInputStruct { + pub unk_x0: u16, + pub unk_x2: u16, + pub unk_x4: u16, + pub unk_x6: u16, + pub mac_address: [u8; 6usize], + pub unk_xe: [u8; 38usize], +} +#[repr(C)] +pub struct nwmBeaconDataReplyHeader { + pub maxsize: u32, + pub size: u32, + pub total_entries: u32, +} +#[repr(C)] +pub struct nwmBeaconDataReplyEntry { + pub size: u32, + pub unk_x4: u8, + pub channel: u8, + pub unk_x6: u8, + pub unk_x7: u8, + pub mac_address: [u8; 6usize], + pub unk_xe: [u8; 6usize], + pub unk_x14: u32, + pub val_x1c: u32, +} +#[repr(C)] +#[repr(align(8))] +pub struct udsNetworkScanInfo { + pub datareply_entry: nwmBeaconDataReplyEntry, + pub network: udsNetworkStruct, + pub __bindgen_padding_0: u32, + pub nodes: [udsNodeInfo; 16usize], +} +pub const UDSNETATTR_DisableConnectSpectators: _bindgen_ty_22 = 1; +pub const UDSNETATTR_DisableConnectClients: _bindgen_ty_22 = 2; +pub const UDSNETATTR_x4: _bindgen_ty_22 = 4; +pub const UDSNETATTR_Default: _bindgen_ty_22 = 32768; +pub type _bindgen_ty_22 = u32; +pub const UDS_SENDFLAG_Default: _bindgen_ty_23 = 1; +pub const UDS_SENDFLAG_Broadcast: _bindgen_ty_23 = 2; +pub type _bindgen_ty_23 = u32; +pub const UDSCONTYPE_Client: udsConnectionType = 1; +pub const UDSCONTYPE_Spectator: udsConnectionType = 2; +pub type udsConnectionType = u32; +extern "C" { + pub fn udsInit(sharedmem_size: usize, username: *const ::libc::c_char) -> Result; +} +extern "C" { + pub fn udsExit(); +} +extern "C" { + pub fn udsGenerateNodeInfo( + nodeinfo: *mut udsNodeInfo, + username: *const ::libc::c_char, + ) -> Result; +} +extern "C" { + pub fn udsGetNodeInfoUsername( + nodeinfo: *const udsNodeInfo, + username: *mut ::libc::c_char, + ) -> Result; +} +extern "C" { + pub fn udsCheckNodeInfoInitialized(nodeinfo: *const udsNodeInfo) -> bool; +} +extern "C" { + pub fn udsGenerateDefaultNetworkStruct( + network: *mut udsNetworkStruct, + wlancommID: u32, + id8: u8, + max_nodes: u8, + ); +} +extern "C" { + pub fn udsScanBeacons( + outbuf: *mut ::libc::c_void, + maxsize: usize, + networks: *mut *mut udsNetworkScanInfo, + total_networks: *mut usize, + wlancommID: u32, + id8: u8, + host_macaddress: *const u8, + connected: bool, + ) -> Result; +} +extern "C" { + pub fn udsSetApplicationData(buf: *const ::libc::c_void, size: usize) -> Result; +} +extern "C" { + pub fn udsGetApplicationData( + buf: *mut ::libc::c_void, + size: usize, + actual_size: *mut usize, + ) -> Result; +} +extern "C" { + pub fn udsGetNetworkStructApplicationData( + network: *const udsNetworkStruct, + buf: *mut ::libc::c_void, + size: usize, + actual_size: *mut usize, + ) -> Result; +} +extern "C" { + pub fn udsBind( + bindcontext: *mut udsBindContext, + NetworkNodeID: u16, + spectator: bool, + data_channel: u8, + recv_buffer_size: u32, + ) -> Result; +} +extern "C" { + pub fn udsUnbind(bindcontext: *mut udsBindContext) -> Result; +} +extern "C" { + pub fn udsWaitDataAvailable( + bindcontext: *const udsBindContext, + nextEvent: bool, + wait: bool, + ) -> bool; +} +extern "C" { + pub fn udsPullPacket( + bindcontext: *const udsBindContext, + buf: *mut ::libc::c_void, + size: usize, + actual_size: *mut usize, + src_NetworkNodeID: *mut u16, + ) -> Result; +} +extern "C" { + pub fn udsSendTo( + dst_NetworkNodeID: u16, + data_channel: u8, + flags: u8, + buf: *const ::libc::c_void, + size: usize, + ) -> Result; +} +extern "C" { + pub fn udsGetChannel(channel: *mut u8) -> Result; +} +extern "C" { + pub fn udsCreateNetwork( + network: *const udsNetworkStruct, + passphrase: *const ::libc::c_void, + passphrase_size: usize, + context: *mut udsBindContext, + data_channel: u8, + recv_buffer_size: u32, + ) -> Result; +} +extern "C" { + pub fn udsConnectNetwork( + network: *const udsNetworkStruct, + passphrase: *const ::libc::c_void, + passphrase_size: usize, + context: *mut udsBindContext, + recv_NetworkNodeID: u16, + connection_type: udsConnectionType, + data_channel: u8, + recv_buffer_size: u32, + ) -> Result; +} +extern "C" { + pub fn udsDestroyNetwork() -> Result; +} +extern "C" { + pub fn udsDisconnectNetwork() -> Result; +} +extern "C" { + pub fn udsEjectClient(NetworkNodeID: u16) -> Result; +} +extern "C" { + pub fn udsEjectSpectator() -> Result; +} +extern "C" { + pub fn udsUpdateNetworkAttribute(bitmask: u16, flag: bool) -> Result; +} +extern "C" { + pub fn udsSetNewConnectionsBlocked(block: bool, clients: bool, flag: bool) -> Result; +} +extern "C" { + pub fn udsAllowSpectators() -> Result; +} +extern "C" { + pub fn udsGetConnectionStatus(output: *mut udsConnectionStatus) -> Result; +} +extern "C" { + pub fn udsWaitConnectionStatusEvent(nextEvent: bool, wait: bool) -> bool; +} +extern "C" { + pub fn udsGetNodeInformation(NetworkNodeID: u16, output: *mut udsNodeInfo) -> Result; +} +pub const EXCLUSIVE_STATE_NONE: ndmExclusiveState = 0; +pub const EXCLUSIVE_STATE_INFRASTRUCTURE: ndmExclusiveState = 1; +pub const EXCLUSIVE_STATE_LOCAL_COMMUNICATIONS: ndmExclusiveState = 2; +pub const EXCLUSIVE_STATE_STREETPASS: ndmExclusiveState = 3; +pub const EXCLUSIVE_STATE_STREETPASS_DATA: ndmExclusiveState = 4; +pub type ndmExclusiveState = u32; +pub const STATE_INITIAL: ndmState = 0; +pub const STATE_SUSPENDED: ndmState = 1; +pub const STATE_INFRASTRUCTURE_CONNECTING: ndmState = 2; +pub const STATE_INFRASTRUCTURE_CONNECTED: ndmState = 3; +pub const STATE_INFRASTRUCTURE_WORKING: ndmState = 4; +pub const STATE_INFRASTRUCTURE_SUSPENDING: ndmState = 5; +pub const STATE_INFRASTRUCTURE_FORCE_SUSPENDING: ndmState = 6; +pub const STATE_INFRASTRUCTURE_DISCONNECTING: ndmState = 7; +pub const STATE_INFRASTRUCTURE_FORCE_DISCONNECTING: ndmState = 8; +pub const STATE_CEC_WORKING: ndmState = 9; +pub const STATE_CEC_FORCE_SUSPENDING: ndmState = 10; +pub const STATE_CEC_SUSPENDING: ndmState = 11; +pub type ndmState = u32; +pub const DAEMON_CEC: ndmDaemon = 0; +pub const DAEMON_BOSS: ndmDaemon = 1; +pub const DAEMON_NIM: ndmDaemon = 2; +pub const DAEMON_FRIENDS: ndmDaemon = 3; +pub type ndmDaemon = u32; +pub const DAEMON_MASK_CEC: ndmDaemonMask = 1; +pub const DAEMON_MASK_BOSS: ndmDaemonMask = 2; +pub const DAEMON_MASK_NIM: ndmDaemonMask = 4; +pub const DAEMON_MASK_FRIENDS: ndmDaemonMask = 8; +pub const DAEMON_MASK_BACKGROUOND: ndmDaemonMask = 7; +pub const DAEMON_MASK_ALL: ndmDaemonMask = 15; +pub const DAEMON_MASK_DEFAULT: ndmDaemonMask = 9; +pub type ndmDaemonMask = u32; +pub const DAEMON_STATUS_BUSY: ndmDaemonStatus = 0; +pub const DAEMON_STATUS_IDLE: ndmDaemonStatus = 1; +pub const DAEMON_STATUS_SUSPENDING: ndmDaemonStatus = 2; +pub const DAEMON_STATUS_SUSPENDED: ndmDaemonStatus = 3; +pub type ndmDaemonStatus = u32; +extern "C" { + pub fn ndmuInit() -> Result; +} +extern "C" { + pub fn ndmuExit(); +} +extern "C" { + pub fn NDMU_EnterExclusiveState(state: ndmExclusiveState) -> Result; +} +extern "C" { + pub fn NDMU_LeaveExclusiveState() -> Result; +} +extern "C" { + pub fn NDMU_GetExclusiveState(state: *mut ndmExclusiveState) -> Result; +} +extern "C" { + pub fn NDMU_LockState() -> Result; +} +extern "C" { + pub fn NDMU_UnlockState() -> Result; +} +extern "C" { + pub fn NDMU_SuspendDaemons(mask: ndmDaemonMask) -> Result; +} +extern "C" { + pub fn NDMU_ResumeDaemons(mask: ndmDaemonMask) -> Result; +} +extern "C" { + pub fn NDMU_SuspendScheduler(flag: u32) -> Result; +} +extern "C" { + pub fn NDMU_ResumeScheduler() -> Result; +} +extern "C" { + pub fn NDMU_GetCurrentState(state: *mut ndmState) -> Result; +} +extern "C" { + pub fn NDMU_QueryStatus(status: *mut ndmDaemonStatus) -> Result; +} +extern "C" { + pub fn NDMU_SetScanInterval(interval: u32) -> Result; +} +extern "C" { + pub fn NDMU_GetScanInterval(interval: *mut u32) -> Result; +} +extern "C" { + pub fn NDMU_GetRetryInterval(interval: *mut u32) -> Result; +} +extern "C" { + pub fn NDMU_ResetDaemons() -> Result; +} +extern "C" { + pub fn NDMU_GetDefaultDaemons(mask: *mut ndmDaemonMask) -> Result; +} +extern "C" { + pub fn NDMU_ClearMacFilter() -> Result; +} +pub const IM_DEFAULT: NIM_InstallationMode = 0; +pub const IM_UNKNOWN1: NIM_InstallationMode = 1; +pub const IM_UNKNOWN2: NIM_InstallationMode = 2; +pub const IM_REINSTALL: NIM_InstallationMode = 3; +pub type NIM_InstallationMode = u32; +pub const DS_NOT_INITIALIZED: NIM_DownloadState = 0; +pub const DS_INITIALIZED: NIM_DownloadState = 1; +pub const DS_DOWNLOAD_TMD: NIM_DownloadState = 2; +pub const DS_PREPARE_SAVE_DATA: NIM_DownloadState = 3; +pub const DS_DOWNLOAD_CONTENTS: NIM_DownloadState = 4; +pub const DS_WAIT_COMMIT: NIM_DownloadState = 5; +pub const DS_COMMITTING: NIM_DownloadState = 6; +pub const DS_FINISHED: NIM_DownloadState = 7; +pub const DS_VERSION_ERROR: NIM_DownloadState = 8; +pub const DS_CREATE_CONTEXT: NIM_DownloadState = 9; +pub const DS_CANNOT_RECOVER: NIM_DownloadState = 10; +pub const DS_INVALID: NIM_DownloadState = 11; +pub type NIM_DownloadState = u32; +#[repr(C)] +pub struct NIM_TitleConfig { + pub titleId: u64, + pub version: u32, + pub unknown_0: u32, + pub ratingAge: u8, + pub mediaType: u8, + pub padding: [u8; 2usize], + pub unknown_1: u32, +} +#[repr(C)] +pub struct NIM_TitleProgress { + pub state: u32, + pub lastResult: Result, + pub downloadedSize: u64, + pub totalSize: u64, +} +extern "C" { + pub fn nimsInit(buffer: *mut ::libc::c_void, buffer_len: usize) -> Result; +} +extern "C" { + pub fn nimsInitWithTIN( + buffer: *mut ::libc::c_void, + buffer_len: usize, + TIN: *const ::libc::c_char, + ) -> Result; +} +extern "C" { + pub fn nimsExit(); +} +extern "C" { + pub fn nimsGetSessionHandle() -> *mut Handle; +} +extern "C" { + pub fn NIMS_SetAttribute(attr: *const ::libc::c_char, val: *const ::libc::c_char) -> Result; +} +extern "C" { + pub fn NIMS_WantUpdate(want_update: *mut bool) -> Result; +} +extern "C" { + pub fn NIMS_MakeTitleConfig( + cfg: *mut NIM_TitleConfig, + titleId: u64, + version: u32, + ratingAge: u8, + mediaType: FS_MediaType, + ); +} +extern "C" { + pub fn NIMS_RegisterTask( + cfg: *const NIM_TitleConfig, + name: *const ::libc::c_char, + maker: *const ::libc::c_char, + ) -> Result; +} +extern "C" { + pub fn NIMS_IsTaskRegistered(titleId: u64, registered: *mut bool) -> Result; +} +extern "C" { + pub fn NIMS_UnregisterTask(titleId: u64) -> Result; +} +extern "C" { + pub fn NIMS_StartDownload(cfg: *const NIM_TitleConfig, mode: NIM_InstallationMode) -> Result; +} +extern "C" { + pub fn NIMS_StartDownloadSimple(cfg: *const NIM_TitleConfig) -> Result; +} +extern "C" { + pub fn NIMS_GetProgress(tp: *mut NIM_TitleProgress) -> Result; +} +extern "C" { + pub fn NIMS_CancelDownload() -> Result; +} +extern "C" { + pub fn nwmExtInit() -> Result; +} +extern "C" { + pub fn nwmExtExit(); +} +extern "C" { + pub fn NWMEXT_ControlWirelessEnabled(enableWifi: bool) -> Result; +} +extern "C" { + pub fn iruInit(sharedmem_addr: *mut u32, sharedmem_size: u32) -> Result; +} +extern "C" { + pub fn iruExit(); +} +extern "C" { + pub fn iruGetServHandle() -> Handle; +} +extern "C" { + pub fn iruSendData(buf: *mut u8, size: u32, wait: bool) -> Result; +} +extern "C" { + pub fn iruRecvData( + buf: *mut u8, + size: u32, + flag: u8, + transfercount: *mut u32, + wait: bool, + ) -> Result; +} +extern "C" { + pub fn IRU_Initialize() -> Result; +} +extern "C" { + pub fn IRU_Shutdown() -> Result; +} +extern "C" { + pub fn IRU_StartSendTransfer(buf: *mut u8, size: u32) -> Result; +} +extern "C" { + pub fn IRU_WaitSendTransfer() -> Result; +} +extern "C" { + pub fn IRU_StartRecvTransfer(size: u32, flag: u8) -> Result; +} +extern "C" { + pub fn IRU_WaitRecvTransfer(transfercount: *mut u32) -> Result; +} +extern "C" { + pub fn IRU_SetBitRate(value: u8) -> Result; +} +extern "C" { + pub fn IRU_GetBitRate(out: *mut u8) -> Result; +} +extern "C" { + pub fn IRU_SetIRLEDState(value: u32) -> Result; +} +extern "C" { + pub fn IRU_GetIRLEDRecvState(out: *mut u32) -> Result; +} +extern "C" { + pub fn nsInit() -> Result; +} +extern "C" { + pub fn nsExit(); +} +extern "C" { + pub fn NS_LaunchFIRM(titleid: u64) -> Result; +} +extern "C" { + pub fn NS_LaunchTitle(titleid: u64, launch_flags: u32, procid: *mut u32) -> Result; +} +extern "C" { + pub fn NS_TerminateTitle() -> Result; +} +extern "C" { + pub fn NS_LaunchApplicationFIRM(titleid: u64, flags: u32) -> Result; +} +extern "C" { + pub fn NS_RebootToTitle(mediatype: u8, titleid: u64) -> Result; +} +extern "C" { + pub fn NS_TerminateProcessTID(titleid: u64, timeout: u64) -> Result; +} +extern "C" { + pub fn NS_RebootSystem() -> Result; +} +extern "C" { + pub fn pmInit() -> Result; +} +extern "C" { + pub fn pmExit(); +} +extern "C" { + pub fn PM_LaunchTitle(mediatype: u8, titleid: u64, launch_flags: u32) -> Result; +} +extern "C" { + pub fn PM_GetTitleExheaderFlags(mediatype: u8, titleid: u64, out: *mut u8) -> Result; +} +extern "C" { + pub fn PM_SetFIRMLaunchParams(size: u32, in_: *mut u8) -> Result; +} +extern "C" { + pub fn PM_GetFIRMLaunchParams(size: u32, out: *mut u8) -> Result; +} +extern "C" { + pub fn PM_LaunchFIRMSetParams(firm_titleid_low: u32, size: u32, in_: *mut u8) -> Result; +} +extern "C" { + pub fn PM_TerminateCurrentApplication(timeout: u64) -> Result; +} +extern "C" { + pub fn PM_TerminateProcess(pid: u8, timeout: u64) -> Result; +} +extern "C" { + pub fn PM_UnregisterProcess(tid: u64) -> Result; +} +pub const PS_ALGORITHM_CBC_ENC: PS_AESAlgorithm = 0; +pub const PS_ALGORITHM_CBC_DEC: PS_AESAlgorithm = 1; +pub const PS_ALGORITHM_CTR_ENC: PS_AESAlgorithm = 2; +pub const PS_ALGORITHM_CTR_DEC: PS_AESAlgorithm = 3; +pub const PS_ALGORITHM_CCM_ENC: PS_AESAlgorithm = 4; +pub const PS_ALGORITHM_CCM_DEC: PS_AESAlgorithm = 5; +pub type PS_AESAlgorithm = u32; +pub const PS_KEYSLOT_0D: PS_AESKeyType = 0; +pub const PS_KEYSLOT_2D: PS_AESKeyType = 1; +pub const PS_KEYSLOT_31: PS_AESKeyType = 2; +pub const PS_KEYSLOT_38: PS_AESKeyType = 3; +pub const PS_KEYSLOT_32: PS_AESKeyType = 4; +pub const PS_KEYSLOT_39_DLP: PS_AESKeyType = 5; +pub const PS_KEYSLOT_2E: PS_AESKeyType = 6; +pub const PS_KEYSLOT_INVALID: PS_AESKeyType = 7; +pub const PS_KEYSLOT_36: PS_AESKeyType = 8; +pub const PS_KEYSLOT_39_NFC: PS_AESKeyType = 9; +pub type PS_AESKeyType = u32; +#[repr(C)] +pub struct psRSAContext { + pub modulo: [u8; 256usize], + pub exponent: [u8; 256usize], + pub rsa_bitsize: u32, + pub unk: u32, +} +extern "C" { + pub fn psInit() -> Result; +} +extern "C" { + pub fn psInitHandle(handle: Handle) -> Result; +} +extern "C" { + pub fn psExit(); +} +extern "C" { + pub fn psGetSessionHandle() -> Handle; +} +extern "C" { + pub fn PS_SignRsaSha256(hash: *mut u8, ctx: *mut psRSAContext, signature: *mut u8) -> Result; +} +extern "C" { + pub fn PS_VerifyRsaSha256(hash: *mut u8, ctx: *mut psRSAContext, signature: *mut u8) -> Result; +} +extern "C" { + pub fn PS_EncryptDecryptAes( + size: u32, + in_: *mut u8, + out: *mut u8, + aes_algo: PS_AESAlgorithm, + key_type: PS_AESKeyType, + iv: *mut u8, + ) -> Result; +} +extern "C" { + pub fn PS_EncryptSignDecryptVerifyAesCcm( + in_: *mut u8, + in_size: u32, + out: *mut u8, + out_size: u32, + data_len: u32, + mac_data_len: u32, + mac_len: u32, + aes_algo: PS_AESAlgorithm, + key_type: PS_AESKeyType, + nonce: *mut u8, + ) -> Result; +} +extern "C" { + pub fn PS_GetLocalFriendCodeSeed(seed: *mut u64) -> Result; +} +extern "C" { + pub fn PS_GetDeviceId(device_id: *mut u32) -> Result; +} +extern "C" { + pub fn PS_GenerateRandomBytes(out: *mut ::libc::c_void, len: usize) -> Result; +} +extern "C" { + pub fn ptmuInit() -> Result; +} +extern "C" { + pub fn ptmuExit(); +} +extern "C" { + pub fn PTMU_GetShellState(out: *mut u8) -> Result; +} +extern "C" { + pub fn PTMU_GetBatteryLevel(out: *mut u8) -> Result; +} +extern "C" { + pub fn PTMU_GetBatteryChargeState(out: *mut u8) -> Result; +} +extern "C" { + pub fn PTMU_GetPedometerState(out: *mut u8) -> Result; +} +extern "C" { + pub fn PTMU_GetTotalStepCount(steps: *mut u32) -> Result; +} +extern "C" { + pub fn PTMU_GetAdapterState(out: *mut bool) -> Result; +} +extern "C" { + pub fn ptmSysmInit() -> Result; +} +extern "C" { + pub fn ptmSysmExit(); +} +extern "C" { + pub fn PTMSYSM_CheckNew3DS() -> Result; +} +extern "C" { + pub fn PTMSYSM_ConfigureNew3DSCPU(value: u8) -> Result; +} +extern "C" { + pub fn PTMSYSM_ShutdownAsync(timeout: u64) -> Result; +} +extern "C" { + pub fn PTMSYSM_RebootAsync(timeout: u64) -> Result; +} +pub const WAIT_NONE: PXIDEV_WaitType = 0; +pub const WAIT_SLEEP: PXIDEV_WaitType = 1; +pub const WAIT_IREQ_RETURN: PXIDEV_WaitType = 2; +pub const WAIT_IREQ_CONTINUE: PXIDEV_WaitType = 3; +pub type PXIDEV_WaitType = u32; +pub const DEASSERT_NONE: PXIDEV_DeassertType = 0; +pub const DEASSERT_BEFORE_WAIT: PXIDEV_DeassertType = 1; +pub const DEASSERT_AFTER_WAIT: PXIDEV_DeassertType = 2; +pub type PXIDEV_DeassertType = u32; +#[repr(C)] +pub struct PXIDEV_SPIBuffer { + pub ptr: *mut ::libc::c_void, + pub size: u32, + pub transferOption: u8, + pub __bindgen_padding_0: u32, + pub waitOperation: u64, +} +extern "C" { + pub fn pxiDevInit() -> Result; +} +extern "C" { + pub fn pxiDevExit(); +} +extern "C" { + pub fn PXIDEV_SPIMultiWriteRead( + header: *mut PXIDEV_SPIBuffer, + writeBuffer1: *mut PXIDEV_SPIBuffer, + readBuffer1: *mut PXIDEV_SPIBuffer, + writeBuffer2: *mut PXIDEV_SPIBuffer, + readBuffer2: *mut PXIDEV_SPIBuffer, + footer: *mut PXIDEV_SPIBuffer, + ) -> Result; +} +extern "C" { + pub fn PXIDEV_SPIWriteRead( + bytesRead: *mut u32, + initialWaitOperation: u64, + writeBuffer: *mut PXIDEV_SPIBuffer, + readBuffer: *mut PXIDEV_SPIBuffer, + ) -> Result; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct timezone { + pub tz_minuteswest: ::libc::c_int, + pub tz_dsttime: ::libc::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct bintime { + pub sec: time_t, + pub frac: u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct itimerval { + pub it_interval: timeval, + pub it_value: timeval, +} +pub type __ULong = ::libc::c_ulong; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __locale_t { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _Bigint { + pub _next: *mut _Bigint, + pub _k: ::libc::c_int, + pub _maxwds: ::libc::c_int, + pub _sign: ::libc::c_int, + pub _wds: ::libc::c_int, + pub _x: [__ULong; 1usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __tm { + pub __tm_sec: ::libc::c_int, + pub __tm_min: ::libc::c_int, + pub __tm_hour: ::libc::c_int, + pub __tm_mday: ::libc::c_int, + pub __tm_mon: ::libc::c_int, + pub __tm_year: ::libc::c_int, + pub __tm_wday: ::libc::c_int, + pub __tm_yday: ::libc::c_int, + pub __tm_isdst: ::libc::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _on_exit_args { + pub _fnargs: [*mut ::libc::c_void; 32usize], + pub _dso_handle: [*mut ::libc::c_void; 32usize], + pub _fntypes: __ULong, + pub _is_cxa: __ULong, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _atexit { + pub _next: *mut _atexit, + pub _ind: ::libc::c_int, + pub _fns: [::core::option::Option; 32usize], + pub _on_exit_args: _on_exit_args, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __sbuf { + pub _base: *mut ::libc::c_uchar, + pub _size: ::libc::c_int, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct __sFILE { + pub _p: *mut ::libc::c_uchar, + pub _r: ::libc::c_int, + pub _w: ::libc::c_int, + pub _flags: ::libc::c_short, + pub _file: ::libc::c_short, + pub _bf: __sbuf, + pub _lbfsize: ::libc::c_int, + pub _cookie: *mut ::libc::c_void, + pub _read: ::core::option::Option< + unsafe extern "C" fn( + arg1: *mut _reent, + arg2: *mut ::libc::c_void, + arg3: *mut ::libc::c_char, + arg4: ::libc::c_int, + ) -> ::libc::c_int, + >, + pub _write: ::core::option::Option< + unsafe extern "C" fn( + arg1: *mut _reent, + arg2: *mut ::libc::c_void, + arg3: *const ::libc::c_char, + arg4: ::libc::c_int, + ) -> ::libc::c_int, + >, + pub _seek: ::core::option::Option< + unsafe extern "C" fn( + arg1: *mut _reent, + arg2: *mut ::libc::c_void, + arg3: _fpos_t, + arg4: ::libc::c_int, + ) -> _fpos_t, + >, + pub _close: ::core::option::Option< + unsafe extern "C" fn(arg1: *mut _reent, arg2: *mut ::libc::c_void) -> ::libc::c_int, + >, + pub _ub: __sbuf, + pub _up: *mut ::libc::c_uchar, + pub _ur: ::libc::c_int, + pub _ubuf: [::libc::c_uchar; 3usize], + pub _nbuf: [::libc::c_uchar; 1usize], + pub _lb: __sbuf, + pub _blksize: ::libc::c_int, + pub _offset: _off_t, + pub _data: *mut _reent, + pub _lock: _flock_t, + pub _mbstate: _mbstate_t, + pub _flags2: ::libc::c_int, + pub __bindgen_padding_0: u32, +} +pub type __FILE = __sFILE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _glue { + pub _next: *mut _glue, + pub _niobs: ::libc::c_int, + pub _iobs: *mut __FILE, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _rand48 { + pub _seed: [::libc::c_ushort; 3usize], + pub _mult: [::libc::c_ushort; 3usize], + pub _add: ::libc::c_ushort, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _reent { + pub _errno: ::libc::c_int, + pub _stdin: *mut __FILE, + pub _stdout: *mut __FILE, + pub _stderr: *mut __FILE, + pub _inc: ::libc::c_int, + pub _emergency: [::libc::c_char; 25usize], + pub _unspecified_locale_info: ::libc::c_int, + pub _locale: *mut __locale_t, + pub __sdidinit: ::libc::c_int, + pub __cleanup: ::core::option::Option, + pub _result: *mut _Bigint, + pub _result_k: ::libc::c_int, + pub _p5s: *mut _Bigint, + pub _freelist: *mut *mut _Bigint, + pub _cvtlen: ::libc::c_int, + pub _cvtbuf: *mut ::libc::c_char, + pub _new: _reent__bindgen_ty_1, + pub _atexit: *mut _atexit, + pub _atexit0: _atexit, + pub _sig_func: *mut ::core::option::Option, + pub __sglue: _glue, + pub __bindgen_padding_0: u32, + pub __sf: [__FILE; 3usize], + pub deviceData: *mut ::libc::c_void, + pub __bindgen_padding_1: u32, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _reent__bindgen_ty_1 { + pub _reent: _reent__bindgen_ty_1__bindgen_ty_1, + pub _unused: _reent__bindgen_ty_1__bindgen_ty_2, + _bindgen_union_align: [u64; 30usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _reent__bindgen_ty_1__bindgen_ty_1 { + pub _unused_rand: ::libc::c_uint, + pub _strtok_last: *mut ::libc::c_char, + pub _asctime_buf: [::libc::c_char; 26usize], + pub _localtime_buf: __tm, + pub _gamma_signgam: ::libc::c_int, + pub __bindgen_padding_0: u32, + pub _rand_next: ::libc::c_ulonglong, + pub _r48: _rand48, + pub _mblen_state: _mbstate_t, + pub _mbtowc_state: _mbstate_t, + pub _wctomb_state: _mbstate_t, + pub _l64a_buf: [::libc::c_char; 8usize], + pub _signal_buf: [::libc::c_char; 24usize], + pub _getdate_err: ::libc::c_int, + pub _mbrlen_state: _mbstate_t, + pub _mbrtowc_state: _mbstate_t, + pub _mbsrtowcs_state: _mbstate_t, + pub _wcrtomb_state: _mbstate_t, + pub _wcsrtombs_state: _mbstate_t, + pub _h_errno: ::libc::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _reent__bindgen_ty_1__bindgen_ty_2 { + pub _nextf: [*mut ::libc::c_uchar; 30usize], + pub _nmalloc: [::libc::c_uint; 30usize], +} +extern "C" { + pub static mut _impure_ptr: *mut _reent; +} +extern "C" { + pub static _global_impure_ptr: *mut _reent; +} +extern "C" { + pub fn _reclaim_reent(arg1: *mut _reent); +} +extern "C" { + pub fn __getreent() -> *mut _reent; +} +pub type locale_t = *mut __locale_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tm { + pub tm_sec: ::libc::c_int, + pub tm_min: ::libc::c_int, + pub tm_hour: ::libc::c_int, + pub tm_mday: ::libc::c_int, + pub tm_mon: ::libc::c_int, + pub tm_year: ::libc::c_int, + pub tm_wday: ::libc::c_int, + pub tm_yday: ::libc::c_int, + pub tm_isdst: ::libc::c_int, +} +extern "C" { + pub fn clock() -> clock_t; +} +extern "C" { + pub fn difftime(_time2: time_t, _time1: time_t) -> f64; +} +extern "C" { + pub fn mktime(_timeptr: *mut tm) -> time_t; +} +extern "C" { + pub fn time(_timer: *mut time_t) -> time_t; +} +extern "C" { + pub fn asctime(_tblock: *const tm) -> *mut ::libc::c_char; +} +extern "C" { + pub fn ctime(_time: *const time_t) -> *mut ::libc::c_char; +} +extern "C" { + pub fn gmtime(_timer: *const time_t) -> *mut tm; +} +extern "C" { + pub fn localtime(_timer: *const time_t) -> *mut tm; +} +extern "C" { + pub fn strftime( + _s: *mut ::libc::c_char, + _maxsize: usize, + _fmt: *const ::libc::c_char, + _t: *const tm, + ) -> usize; +} +extern "C" { + pub fn strftime_l( + _s: *mut ::libc::c_char, + _maxsize: usize, + _fmt: *const ::libc::c_char, + _t: *const tm, + _l: locale_t, + ) -> usize; +} +extern "C" { + pub fn asctime_r(arg1: *const tm, arg2: *mut ::libc::c_char) -> *mut ::libc::c_char; +} +extern "C" { + pub fn ctime_r(arg1: *const time_t, arg2: *mut ::libc::c_char) -> *mut ::libc::c_char; +} +extern "C" { + pub fn gmtime_r(arg1: *const time_t, arg2: *mut tm) -> *mut tm; +} +extern "C" { + pub fn localtime_r(arg1: *const time_t, arg2: *mut tm) -> *mut tm; +} +extern "C" { + pub fn tzset(); +} +extern "C" { + pub fn _tzset_r(arg1: *mut _reent); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __tzrule_struct { + pub ch: ::libc::c_char, + pub m: ::libc::c_int, + pub n: ::libc::c_int, + pub d: ::libc::c_int, + pub s: ::libc::c_int, + pub __bindgen_padding_0: u32, + pub change: time_t, + pub offset: ::libc::c_long, + pub __bindgen_padding_1: u32, +} +pub type __tzrule_type = __tzrule_struct; +#[repr(C)] +#[repr(align(8))] +#[derive(Debug, Copy, Clone)] +pub struct __tzinfo_struct { + pub __tznorth: ::libc::c_int, + pub __tzyear: ::libc::c_int, + pub __tzrule: [__tzrule_type; 2usize], +} +pub type __tzinfo_type = __tzinfo_struct; +extern "C" { + pub fn __gettzinfo() -> *mut __tzinfo_type; +} +extern "C" { + pub static mut _timezone: ::libc::c_long; +} +extern "C" { + pub static mut _daylight: ::libc::c_int; +} +extern "C" { + pub static mut _tzname: [*mut ::libc::c_char; 2usize]; +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union sigval { + pub sival_int: ::libc::c_int, + pub sival_ptr: *mut ::libc::c_void, + _bindgen_union_align: u32, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct sigevent { + pub sigev_notify: ::libc::c_int, + pub sigev_signo: ::libc::c_int, + pub sigev_value: sigval, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct siginfo_t { + pub si_signo: ::libc::c_int, + pub si_code: ::libc::c_int, + pub si_value: sigval, +} +pub type _sig_func_ptr = ::core::option::Option; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sigaction { + pub sa_handler: _sig_func_ptr, + pub sa_mask: sigset_t, + pub sa_flags: ::libc::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sigaltstack { + pub ss_sp: *mut ::libc::c_void, + pub ss_flags: ::libc::c_int, + pub ss_size: usize, +} +pub type stack_t = sigaltstack; +extern "C" { + pub fn sigprocmask( + arg1: ::libc::c_int, + arg2: *const sigset_t, + arg3: *mut sigset_t, + ) -> ::libc::c_int; +} +extern "C" { + pub fn pthread_sigmask( + arg1: ::libc::c_int, + arg2: *const sigset_t, + arg3: *mut sigset_t, + ) -> ::libc::c_int; +} +extern "C" { + pub fn kill(arg1: pid_t, arg2: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn killpg(arg1: pid_t, arg2: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn sigaction( + arg1: ::libc::c_int, + arg2: *const sigaction, + arg3: *mut sigaction, + ) -> ::libc::c_int; +} +extern "C" { + pub fn sigaddset(arg1: *mut sigset_t, arg2: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn sigdelset(arg1: *mut sigset_t, arg2: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn sigismember(arg1: *const sigset_t, arg2: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn sigfillset(arg1: *mut sigset_t) -> ::libc::c_int; +} +extern "C" { + pub fn sigemptyset(arg1: *mut sigset_t) -> ::libc::c_int; +} +extern "C" { + pub fn sigpending(arg1: *mut sigset_t) -> ::libc::c_int; +} +extern "C" { + pub fn sigsuspend(arg1: *const sigset_t) -> ::libc::c_int; +} +extern "C" { + pub fn sigwait(arg1: *const sigset_t, arg2: *mut ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn sigpause(arg1: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn sigaltstack(arg1: *const stack_t, arg2: *mut stack_t) -> ::libc::c_int; +} +extern "C" { + pub fn pthread_kill(arg1: pthread_t, arg2: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn sigwaitinfo(arg1: *const sigset_t, arg2: *mut siginfo_t) -> ::libc::c_int; +} +extern "C" { + pub fn sigtimedwait( + arg1: *const sigset_t, + arg2: *mut siginfo_t, + arg3: *const timespec, + ) -> ::libc::c_int; +} +extern "C" { + pub fn sigqueue(arg1: pid_t, arg2: ::libc::c_int, arg3: sigval) -> ::libc::c_int; +} +pub type sig_atomic_t = ::libc::c_int; +pub type sig_t = _sig_func_ptr; +extern "C" { + pub fn _signal_r(arg1: *mut _reent, arg2: ::libc::c_int, arg3: _sig_func_ptr) -> _sig_func_ptr; +} +extern "C" { + pub fn _raise_r(arg1: *mut _reent, arg2: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn signal(arg1: ::libc::c_int, arg2: _sig_func_ptr) -> _sig_func_ptr; +} +extern "C" { + pub fn raise(arg1: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn psignal(arg1: ::libc::c_int, arg2: *const ::libc::c_char); +} +extern "C" { + pub fn clock_settime(clock_id: clockid_t, tp: *const timespec) -> ::libc::c_int; +} +extern "C" { + pub fn clock_gettime(clock_id: clockid_t, tp: *mut timespec) -> ::libc::c_int; +} +extern "C" { + pub fn clock_getres(clock_id: clockid_t, res: *mut timespec) -> ::libc::c_int; +} +extern "C" { + pub fn timer_create( + clock_id: clockid_t, + evp: *mut sigevent, + timerid: *mut timer_t, + ) -> ::libc::c_int; +} +extern "C" { + pub fn timer_delete(timerid: timer_t) -> ::libc::c_int; +} +extern "C" { + pub fn timer_settime( + timerid: timer_t, + flags: ::libc::c_int, + value: *const itimerspec, + ovalue: *mut itimerspec, + ) -> ::libc::c_int; +} +extern "C" { + pub fn timer_gettime(timerid: timer_t, value: *mut itimerspec) -> ::libc::c_int; +} +extern "C" { + pub fn timer_getoverrun(timerid: timer_t) -> ::libc::c_int; +} +extern "C" { + pub fn nanosleep(rqtp: *const timespec, rmtp: *mut timespec) -> ::libc::c_int; +} +extern "C" { + pub fn utimes(__path: *const ::libc::c_char, __tvp: *const timeval) -> ::libc::c_int; +} +extern "C" { + pub fn adjtime(arg1: *const timeval, arg2: *mut timeval) -> ::libc::c_int; +} +extern "C" { + pub fn futimes(arg1: ::libc::c_int, arg2: *const timeval) -> ::libc::c_int; +} +extern "C" { + pub fn lutimes(arg1: *const ::libc::c_char, arg2: *const timeval) -> ::libc::c_int; +} +extern "C" { + pub fn settimeofday(arg1: *const timeval, arg2: *const timezone) -> ::libc::c_int; +} +extern "C" { + pub fn getitimer(__which: ::libc::c_int, __value: *mut itimerval) -> ::libc::c_int; +} +extern "C" { + pub fn setitimer( + __which: ::libc::c_int, + __value: *const itimerval, + __ovalue: *mut itimerval, + ) -> ::libc::c_int; +} +extern "C" { + pub fn gettimeofday(__p: *mut timeval, __tz: *mut ::libc::c_void) -> ::libc::c_int; +} +pub type socklen_t = u32; +pub type sa_family_t = u16; +#[repr(C)] +#[derive(Debug)] +pub struct sockaddr { + pub sa_family: sa_family_t, + pub sa_data: __IncompleteArrayField<::libc::c_char>, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_storage { + pub ss_family: sa_family_t, + pub __ss_padding: [::libc::c_char; 26usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct linger { + pub l_onoff: ::libc::c_int, + pub l_linger: ::libc::c_int, +} +extern "C" { + pub fn accept( + sockfd: ::libc::c_int, + addr: *mut sockaddr, + addrlen: *mut socklen_t, + ) -> ::libc::c_int; +} +extern "C" { + pub fn bind(sockfd: ::libc::c_int, addr: *const sockaddr, addrlen: socklen_t) -> ::libc::c_int; +} +extern "C" { + pub fn closesocket(sockfd: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn connect( + sockfd: ::libc::c_int, + addr: *const sockaddr, + addrlen: socklen_t, + ) -> ::libc::c_int; +} +extern "C" { + pub fn getpeername( + sockfd: ::libc::c_int, + addr: *mut sockaddr, + addrlen: *mut socklen_t, + ) -> ::libc::c_int; +} +extern "C" { + pub fn getsockname( + sockfd: ::libc::c_int, + addr: *mut sockaddr, + addrlen: *mut socklen_t, + ) -> ::libc::c_int; +} +extern "C" { + pub fn getsockopt( + sockfd: ::libc::c_int, + level: ::libc::c_int, + optname: ::libc::c_int, + optval: *mut ::libc::c_void, + optlen: *mut socklen_t, + ) -> ::libc::c_int; +} +extern "C" { + pub fn listen(sockfd: ::libc::c_int, backlog: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn recv( + sockfd: ::libc::c_int, + buf: *mut ::libc::c_void, + len: usize, + flags: ::libc::c_int, + ) -> isize; +} +extern "C" { + pub fn recvfrom( + sockfd: ::libc::c_int, + buf: *mut ::libc::c_void, + len: usize, + flags: ::libc::c_int, + src_addr: *mut sockaddr, + addrlen: *mut socklen_t, + ) -> isize; +} +extern "C" { + pub fn send( + sockfd: ::libc::c_int, + buf: *const ::libc::c_void, + len: usize, + flags: ::libc::c_int, + ) -> isize; +} +extern "C" { + pub fn sendto( + sockfd: ::libc::c_int, + buf: *const ::libc::c_void, + len: usize, + flags: ::libc::c_int, + dest_addr: *const sockaddr, + addrlen: socklen_t, + ) -> isize; +} +extern "C" { + pub fn setsockopt( + sockfd: ::libc::c_int, + level: ::libc::c_int, + optname: ::libc::c_int, + optval: *const ::libc::c_void, + optlen: socklen_t, + ) -> ::libc::c_int; +} +extern "C" { + pub fn shutdown(sockfd: ::libc::c_int, how: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn socket( + domain: ::libc::c_int, + type_: ::libc::c_int, + protocol: ::libc::c_int, + ) -> ::libc::c_int; +} +extern "C" { + pub fn sockatmark(sockfd: ::libc::c_int) -> ::libc::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct in_addr { + pub s_addr: in_addr_t, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_in { + pub sin_family: sa_family_t, + pub sin_port: in_port_t, + pub sin_addr: in_addr, + pub sin_zero: [::libc::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ip_mreq { + pub imr_multiaddr: in_addr, + pub imr_interface: in_addr, +} +pub const NETOPT_MAC_ADDRESS: NetworkOpt = 4100; +pub const NETOPT_ARP_TABLE: NetworkOpt = 12290; +pub const NETOPT_IP_INFO: NetworkOpt = 16387; +pub const NETOPT_IP_MTU: NetworkOpt = 16388; +pub const NETOPT_ROUTING_TABLE: NetworkOpt = 16390; +pub const NETOPT_UDP_NUMBER: NetworkOpt = 32770; +pub const NETOPT_UDP_TABLE: NetworkOpt = 32771; +pub const NETOPT_TCP_NUMBER: NetworkOpt = 36866; +pub const NETOPT_TCP_TABLE: NetworkOpt = 36867; +pub const NETOPT_DNS_TABLE: NetworkOpt = 45059; +pub const NETOPT_DHCP_LEASE_TIME: NetworkOpt = 49153; +pub type NetworkOpt = u32; +#[repr(C)] +pub struct SOCU_ARPTableEntry { + pub unk0: u32, + pub ip: in_addr, + pub mac: [u8; 6usize], + pub padding: [u8; 2usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SOCU_IPInfo { + pub ip: in_addr, + pub netmask: in_addr, + pub broadcast: in_addr, +} +#[repr(C)] +pub struct SOCU_RoutingTableEntry { + pub dest_ip: in_addr, + pub netmask: in_addr, + pub gateway: in_addr, + pub flags: u32, + pub time: u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SOCU_UDPTableEntry { + pub local: sockaddr_storage, + pub remote: sockaddr_storage, +} +#[repr(C)] +pub struct SOCU_TCPTableEntry { + pub state: u32, + pub local: sockaddr_storage, + pub remote: sockaddr_storage, +} +#[repr(C)] +pub struct SOCU_DNSTableEntry { + pub family: u32, + pub ip: in_addr, + pub padding: [u8; 12usize], +} +extern "C" { + pub fn socInit(context_addr: *mut u32, context_size: u32) -> Result; +} +extern "C" { + pub fn socExit() -> Result; +} +extern "C" { + pub fn gethostid() -> ::libc::c_long; +} +extern "C" { + pub fn gethostname(name: *mut ::libc::c_char, namelen: usize) -> ::libc::c_int; +} +extern "C" { + pub fn SOCU_ShutdownSockets() -> ::libc::c_int; +} +extern "C" { + pub fn SOCU_CloseSockets() -> ::libc::c_int; +} +extern "C" { + pub fn SOCU_GetNetworkOpt( + level: ::libc::c_int, + optname: NetworkOpt, + optval: *mut ::libc::c_void, + optlen: *mut socklen_t, + ) -> ::libc::c_int; +} +extern "C" { + pub fn SOCU_GetIPInfo( + ip: *mut in_addr, + netmask: *mut in_addr, + broadcast: *mut in_addr, + ) -> ::libc::c_int; +} +extern "C" { + pub fn SOCU_AddGlobalSocket(sockfd: ::libc::c_int) -> ::libc::c_int; +} +pub const MICU_ENCODING_PCM8: MICU_Encoding = 0; +pub const MICU_ENCODING_PCM16: MICU_Encoding = 1; +pub const MICU_ENCODING_PCM8_SIGNED: MICU_Encoding = 2; +pub const MICU_ENCODING_PCM16_SIGNED: MICU_Encoding = 3; +pub type MICU_Encoding = u32; +pub const MICU_SAMPLE_RATE_32730: MICU_SampleRate = 0; +pub const MICU_SAMPLE_RATE_16360: MICU_SampleRate = 1; +pub const MICU_SAMPLE_RATE_10910: MICU_SampleRate = 2; +pub const MICU_SAMPLE_RATE_8180: MICU_SampleRate = 3; +pub type MICU_SampleRate = u32; +extern "C" { + pub fn micInit(buffer: *mut u8, bufferSize: u32) -> Result; +} +extern "C" { + pub fn micExit(); +} +extern "C" { + pub fn micGetSampleDataSize() -> u32; +} +extern "C" { + pub fn micGetLastSampleOffset() -> u32; +} +extern "C" { + pub fn MICU_MapSharedMem(size: u32, handle: Handle) -> Result; +} +extern "C" { + pub fn MICU_UnmapSharedMem() -> Result; +} +extern "C" { + pub fn MICU_StartSampling( + encoding: MICU_Encoding, + sampleRate: MICU_SampleRate, + offset: u32, + size: u32, + loop_: bool, + ) -> Result; +} +extern "C" { + pub fn MICU_AdjustSampling(sampleRate: MICU_SampleRate) -> Result; +} +extern "C" { + pub fn MICU_StopSampling() -> Result; +} +extern "C" { + pub fn MICU_IsSampling(sampling: *mut bool) -> Result; +} +extern "C" { + pub fn MICU_GetEventHandle(handle: *mut Handle) -> Result; +} +extern "C" { + pub fn MICU_SetGain(gain: u8) -> Result; +} +extern "C" { + pub fn MICU_GetGain(gain: *mut u8) -> Result; +} +extern "C" { + pub fn MICU_SetPower(power: bool) -> Result; +} +extern "C" { + pub fn MICU_GetPower(power: *mut bool) -> Result; +} +extern "C" { + pub fn MICU_SetClamp(clamp: bool) -> Result; +} +extern "C" { + pub fn MICU_GetClamp(clamp: *mut bool) -> Result; +} +extern "C" { + pub fn MICU_SetAllowShellClosed(allowShellClosed: bool) -> Result; +} +pub const MVDMODE_COLORFORMATCONV: MVDSTD_Mode = 0; +pub const MVDMODE_VIDEOPROCESSING: MVDSTD_Mode = 1; +pub type MVDSTD_Mode = u32; +pub const MVD_INPUT_YUYV422: MVDSTD_InputFormat = 65537; +pub const MVD_INPUT_H264: MVDSTD_InputFormat = 131073; +pub type MVDSTD_InputFormat = u32; +pub const MVD_OUTPUT_YUYV422: MVDSTD_OutputFormat = 65537; +pub const MVD_OUTPUT_BGR565: MVDSTD_OutputFormat = 262146; +pub const MVD_OUTPUT_RGB565: MVDSTD_OutputFormat = 262148; +pub type MVDSTD_OutputFormat = u32; +#[repr(C)] +pub struct MVDSTD_Config { + pub input_type: MVDSTD_InputFormat, + pub unk_x04: u32, + pub unk_x08: u32, + pub inwidth: u32, + pub inheight: u32, + pub physaddr_colorconv_indata: u32, + pub physaddr_colorconv_unk0: u32, + pub physaddr_colorconv_unk1: u32, + pub physaddr_colorconv_unk2: u32, + pub physaddr_colorconv_unk3: u32, + pub unk_x28: [u32; 6usize], + pub enable_cropping: u32, + pub input_crop_x_pos: u32, + pub input_crop_y_pos: u32, + pub input_crop_height: u32, + pub input_crop_width: u32, + pub unk_x54: u32, + pub output_type: MVDSTD_OutputFormat, + pub outwidth: u32, + pub outheight: u32, + pub physaddr_outdata0: u32, + pub physaddr_outdata1: u32, + pub unk_x6c: [u32; 38usize], + pub flag_x104: u32, + pub output_x_pos: u32, + pub output_y_pos: u32, + pub output_width_override: u32, + pub output_height_override: u32, + pub unk_x118: u32, +} +#[repr(C)] +pub struct MVDSTD_ProcessNALUnitOut { + pub end_vaddr: u32, + pub end_physaddr: u32, + pub remaining_size: u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct MVDSTD_OutputBuffersEntry { + pub outdata0: *mut ::libc::c_void, + pub outdata1: *mut ::libc::c_void, +} +#[repr(C)] +pub struct MVDSTD_OutputBuffersEntryList { + pub total_entries: u32, + pub entries: [MVDSTD_OutputBuffersEntry; 17usize], +} +#[repr(C)] +pub struct MVDSTD_InitStruct { + pub cmd5_inval0: s8, + pub cmd5_inval1: s8, + pub cmd5_inval2: s8, + pub cmd5_inval3: u32, + pub cmd1b_inval: u8, +} +extern "C" { + pub fn mvdstdInit( + mode: MVDSTD_Mode, + input_type: MVDSTD_InputFormat, + output_type: MVDSTD_OutputFormat, + size: u32, + initstruct: *mut MVDSTD_InitStruct, + ) -> Result; +} +extern "C" { + pub fn mvdstdExit(); +} +extern "C" { + pub fn mvdstdGenerateDefaultConfig( + config: *mut MVDSTD_Config, + input_width: u32, + input_height: u32, + output_width: u32, + output_height: u32, + vaddr_colorconv_indata: *mut u32, + vaddr_outdata0: *mut u32, + vaddr_outdata1: *mut u32, + ); +} +extern "C" { + pub fn mvdstdConvertImage(config: *mut MVDSTD_Config) -> Result; +} +extern "C" { + pub fn mvdstdProcessVideoFrame( + inbuf_vaddr: *mut ::libc::c_void, + size: usize, + flag: u32, + out: *mut MVDSTD_ProcessNALUnitOut, + ) -> Result; +} +extern "C" { + pub fn mvdstdRenderVideoFrame(config: *mut MVDSTD_Config, wait: bool) -> Result; +} +extern "C" { + pub fn MVDSTD_SetConfig(config: *mut MVDSTD_Config) -> Result; +} +extern "C" { + pub fn mvdstdSetupOutputBuffers( + entrylist: *mut MVDSTD_OutputBuffersEntryList, + bufsize: u32, + ) -> Result; +} +extern "C" { + pub fn mvdstdOverrideOutputBuffers( + cur_outdata0: *mut ::libc::c_void, + cur_outdata1: *mut ::libc::c_void, + new_outdata0: *mut ::libc::c_void, + new_outdata1: *mut ::libc::c_void, + ) -> Result; +} +pub const NFC_OpType_1: NFC_OpType = 1; +pub const NFC_OpType_NFCTag: NFC_OpType = 2; +pub const NFC_OpType_RawNFC: NFC_OpType = 3; +pub type NFC_OpType = u32; +pub const NFC_TagState_Uninitialized: NFC_TagState = 0; +pub const NFC_TagState_ScanningStopped: NFC_TagState = 1; +pub const NFC_TagState_Scanning: NFC_TagState = 2; +pub const NFC_TagState_InRange: NFC_TagState = 3; +pub const NFC_TagState_OutOfRange: NFC_TagState = 4; +pub const NFC_TagState_DataReady: NFC_TagState = 5; +pub type NFC_TagState = u32; +pub const NFC_amiiboFlag_Setup: _bindgen_ty_24 = 16; +pub const NFC_amiiboFlag_AppDataSetup: _bindgen_ty_24 = 32; +pub type _bindgen_ty_24 = u32; +#[repr(C)] +pub struct NFC_TagInfo { + pub id_offset_size: u16, + pub unk_x2: u8, + pub unk_x3: u8, + pub id: [u8; 40usize], +} +#[repr(C)] +pub struct NFC_AmiiboSettings { + pub mii: [u8; 96usize], + pub nickname: [u16; 11usize], + pub flags: u8, + pub countrycodeid: u8, + pub setupdate_year: u16, + pub setupdate_month: u8, + pub setupdate_day: u8, + pub unk_x7c: [u8; 44usize], +} +#[repr(C)] +pub struct NFC_AmiiboConfig { + pub lastwritedate_year: u16, + pub lastwritedate_month: u8, + pub lastwritedate_day: u8, + pub write_counter: u16, + pub characterID: [u8; 3usize], + pub series: u8, + pub amiiboID: u16, + pub type_: u8, + pub pagex4_byte3: u8, + pub appdata_size: u16, + pub zeros: [u8; 48usize], +} +#[repr(C)] +pub struct NFC_AppDataInitStruct { + pub data_x0: [u8; 12usize], + pub data_xc: [u8; 48usize], +} +#[repr(C)] +pub struct NFC_AppDataWriteStruct { + pub id: [u8; 10usize], + pub id_size: u8, + pub unused_xb: [u8; 21usize], +} +extern "C" { + pub fn nfcInit(type_: NFC_OpType) -> Result; +} +extern "C" { + pub fn nfcExit(); +} +extern "C" { + pub fn nfcGetSessionHandle() -> Handle; +} +extern "C" { + pub fn nfcStartScanning(inval: u16) -> Result; +} +extern "C" { + pub fn nfcStopScanning(); +} +extern "C" { + pub fn nfcLoadAmiiboData() -> Result; +} +extern "C" { + pub fn nfcResetTagScanState() -> Result; +} +extern "C" { + pub fn nfcUpdateStoredAmiiboData() -> Result; +} +extern "C" { + pub fn nfcGetTagState(state: *mut NFC_TagState) -> Result; +} +extern "C" { + pub fn nfcGetTagInfo(out: *mut NFC_TagInfo) -> Result; +} +extern "C" { + pub fn nfcOpenAppData(amiibo_appid: u32) -> Result; +} +extern "C" { + pub fn nfcInitializeWriteAppData( + amiibo_appid: u32, + buf: *const ::libc::c_void, + size: usize, + ) -> Result; +} +extern "C" { + pub fn nfcReadAppData(buf: *mut ::libc::c_void, size: usize) -> Result; +} +extern "C" { + pub fn nfcWriteAppData( + buf: *const ::libc::c_void, + size: usize, + taginfo: *mut NFC_TagInfo, + ) -> Result; +} +extern "C" { + pub fn nfcGetAmiiboSettings(out: *mut NFC_AmiiboSettings) -> Result; +} +extern "C" { + pub fn nfcGetAmiiboConfig(out: *mut NFC_AmiiboConfig) -> Result; +} +extern "C" { + pub fn nfcStartOtherTagScanning(unk0: u16, unk1: u32) -> Result; +} +extern "C" { + pub fn nfcSendTagCommand( + inbuf: *const ::libc::c_void, + insize: usize, + outbuf: *mut ::libc::c_void, + outsize: usize, + actual_transfer_size: *mut usize, + microseconds: u64, + ) -> Result; +} +extern "C" { + pub fn nfcCmd21() -> Result; +} +extern "C" { + pub fn nfcCmd22() -> Result; +} +#[repr(C)] +pub struct NotificationHeader { + pub dataSet: bool, + pub unread: bool, + pub enableJPEG: bool, + pub isSpotPass: bool, + pub isOptedOut: bool, + pub unkData: [u8; 3usize], + pub processID: u64, + pub unkData2: [u8; 8usize], + pub jumpParam: u64, + pub unkData3: [u8; 8usize], + pub time: u64, + pub title: [u16; 32usize], +} +extern "C" { + pub fn newsInit() -> Result; +} +extern "C" { + pub fn newsExit(); +} +extern "C" { + pub fn NEWS_AddNotification( + title: *const u16, + titleLength: u32, + message: *const u16, + messageLength: u32, + imageData: *const ::libc::c_void, + imageSize: u32, + jpeg: bool, + ) -> Result; +} +extern "C" { + pub fn NEWS_GetTotalNotifications(num: *mut u32) -> Result; +} +extern "C" { + pub fn NEWS_SetNotificationHeader(news_id: u32, header: *const NotificationHeader) -> Result; +} +extern "C" { + pub fn NEWS_GetNotificationHeader(news_id: u32, header: *mut NotificationHeader) -> Result; +} +extern "C" { + pub fn NEWS_SetNotificationMessage(news_id: u32, message: *const u16, size: u32) -> Result; +} +extern "C" { + pub fn NEWS_GetNotificationMessage(news_id: u32, message: *mut u16, size: *mut u32) -> Result; +} +extern "C" { + pub fn NEWS_SetNotificationImage( + news_id: u32, + buffer: *const ::libc::c_void, + size: u32, + ) -> Result; +} +extern "C" { + pub fn NEWS_GetNotificationImage( + news_id: u32, + buffer: *mut ::libc::c_void, + size: *mut u32, + ) -> Result; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QTM_HeadTrackingInfoCoord { + pub x: f32, + pub y: f32, +} +#[repr(C)] +pub struct QTM_HeadTrackingInfo { + pub flags: [u8; 5usize], + pub padding: [u8; 3usize], + pub floatdata_x08: f32, + pub coords0: [QTM_HeadTrackingInfoCoord; 4usize], + pub unk_x2c: [u32; 5usize], +} +extern "C" { + pub fn qtmInit() -> Result; +} +extern "C" { + pub fn qtmExit(); +} +extern "C" { + pub fn qtmCheckInitialized() -> bool; +} +extern "C" { + pub fn qtmCheckHeadFullyDetected(info: *mut QTM_HeadTrackingInfo) -> bool; +} +extern "C" { + pub fn qtmConvertCoordToScreen( + coord: *mut QTM_HeadTrackingInfoCoord, + screen_width: *mut f32, + screen_height: *mut f32, + x: *mut u32, + y: *mut u32, + ) -> Result; +} +extern "C" { + pub fn QTM_GetHeadTrackingInfo(val: u64, out: *mut QTM_HeadTrackingInfo) -> Result; +} +extern "C" { + pub fn srvPmInit() -> Result; +} +extern "C" { + pub fn srvPmExit(); +} +extern "C" { + pub fn srvPmGetSessionHandle() -> *mut Handle; +} +extern "C" { + pub fn SRVPM_PublishToProcess(notificationId: u32, process: Handle) -> Result; +} +extern "C" { + pub fn SRVPM_PublishToAll(notificationId: u32) -> Result; +} +extern "C" { + pub fn SRVPM_RegisterProcess( + pid: u32, + count: u32, + serviceAccessControlList: *mut [::libc::c_char; 8usize], + ) -> Result; +} +extern "C" { + pub fn SRVPM_UnregisterProcess(pid: u32) -> Result; +} +extern "C" { + pub fn loaderInit() -> Result; +} +extern "C" { + pub fn loaderExit(); +} +extern "C" { + pub fn LOADER_LoadProcess(process: *mut Handle, programHandle: u64) -> Result; +} +extern "C" { + pub fn LOADER_RegisterProgram( + programHandle: *mut u64, + titleId: u64, + mediaType: FS_MediaType, + updateTitleId: u64, + updateMediaType: FS_MediaType, + ) -> Result; +} +extern "C" { + pub fn LOADER_UnregisterProgram(programHandle: u64) -> Result; +} +extern "C" { + pub fn LOADER_GetProgramInfo(exheaderInfo: *mut ExHeader_Info, programHandle: u64) -> Result; +} +pub const LED_NORMAL: powerLedState = 1; +pub const LED_SLEEP_MODE: powerLedState = 2; +pub const LED_OFF: powerLedState = 3; +pub const LED_RED: powerLedState = 4; +pub const LED_BLUE: powerLedState = 5; +pub const LED_BLINK_RED: powerLedState = 6; +pub type powerLedState = u32; +extern "C" { + pub fn mcuHwcInit() -> Result; +} +extern "C" { + pub fn mcuHwcExit(); +} +extern "C" { + pub fn MCUHWC_ReadRegister(reg: u8, data: *mut ::libc::c_void, size: u32) -> Result; +} +extern "C" { + pub fn MCUHWC_WriteRegister(reg: u8, data: *const ::libc::c_void, size: u32) -> Result; +} +extern "C" { + pub fn MCUHWC_GetBatteryVoltage(voltage: *mut u8) -> Result; +} +extern "C" { + pub fn MCUHWC_GetBatteryLevel(level: *mut u8) -> Result; +} +extern "C" { + pub fn MCUHWC_GetSoundSliderLevel(level: *mut u8) -> Result; +} +extern "C" { + pub fn MCUHWC_SetWifiLedState(state: bool) -> Result; +} +extern "C" { + pub fn MCUHWC_SetPowerLedState(state: powerLedState) -> Result; +} +extern "C" { + pub fn MCUHWC_Get3dSliderLevel(level: *mut u8) -> Result; +} +extern "C" { + pub fn MCUHWC_GetFwVerHigh(out: *mut u8) -> Result; +} +extern "C" { + pub fn MCUHWC_GetFwVerLow(out: *mut u8) -> Result; +} +extern "C" { + pub fn hbInit() -> Result; +} +extern "C" { + pub fn hbExit(); +} +extern "C" { + pub fn HB_FlushInvalidateCache() -> Result; +} +extern "C" { + pub fn HB_GetBootloaderAddresses( + load3dsx: *mut *mut ::libc::c_void, + setArgv: *mut *mut ::libc::c_void, + ) -> Result; +} +extern "C" { + pub fn HB_ReprotectMemory( + addr: *mut u32, + pages: u32, + mode: u32, + reprotectedPages: *mut u32, + ) -> Result; +} +pub const GX_TRANSFER_FMT_RGBA8: GX_TRANSFER_FORMAT = 0; +pub const GX_TRANSFER_FMT_RGB8: GX_TRANSFER_FORMAT = 1; +pub const GX_TRANSFER_FMT_RGB565: GX_TRANSFER_FORMAT = 2; +pub const GX_TRANSFER_FMT_RGB5A1: GX_TRANSFER_FORMAT = 3; +pub const GX_TRANSFER_FMT_RGBA4: GX_TRANSFER_FORMAT = 4; +pub type GX_TRANSFER_FORMAT = u32; +pub const GX_TRANSFER_SCALE_NO: GX_TRANSFER_SCALE = 0; +pub const GX_TRANSFER_SCALE_X: GX_TRANSFER_SCALE = 1; +pub const GX_TRANSFER_SCALE_XY: GX_TRANSFER_SCALE = 2; +pub type GX_TRANSFER_SCALE = u32; +pub const GX_FILL_TRIGGER: GX_FILL_CONTROL = 1; +pub const GX_FILL_FINISHED: GX_FILL_CONTROL = 2; +pub const GX_FILL_16BIT_DEPTH: GX_FILL_CONTROL = 0; +pub const GX_FILL_24BIT_DEPTH: GX_FILL_CONTROL = 256; +pub const GX_FILL_32BIT_DEPTH: GX_FILL_CONTROL = 512; +pub type GX_FILL_CONTROL = u32; +extern "C" { + pub static mut gxCmdBuf: *mut u32; +} +#[repr(C)] +pub struct gxCmdEntry_s { + pub data: __BindgenUnionField<[u32; 8usize]>, + pub __bindgen_anon_1: __BindgenUnionField, + pub bindgen_union_field: [u32; 8usize], +} +#[repr(C)] +pub struct gxCmdEntry_s__bindgen_ty_1 { + pub type_: u8, + pub unk1: u8, + pub unk2: u8, + pub unk3: u8, + pub args: [u32; 7usize], +} +#[repr(C)] +pub struct tag_gxCmdQueue_s { + pub entries: *mut gxCmdEntry_s, + pub maxEntries: u16, + pub numEntries: u16, + pub curEntry: u16, + pub lastEntry: u16, + pub callback: ::core::option::Option, + pub user: *mut ::libc::c_void, +} +pub type gxCmdQueue_s = tag_gxCmdQueue_s; +extern "C" { + pub fn gxCmdQueueClear(queue: *mut gxCmdQueue_s); +} +extern "C" { + pub fn gxCmdQueueAdd(queue: *mut gxCmdQueue_s, entry: *const gxCmdEntry_s); +} +extern "C" { + pub fn gxCmdQueueRun(queue: *mut gxCmdQueue_s); +} +extern "C" { + pub fn gxCmdQueueStop(queue: *mut gxCmdQueue_s); +} +extern "C" { + pub fn gxCmdQueueWait(queue: *mut gxCmdQueue_s, timeout: s64) -> bool; +} +extern "C" { + pub fn GX_BindQueue(queue: *mut gxCmdQueue_s); +} +extern "C" { + pub fn GX_RequestDma(src: *mut u32, dst: *mut u32, length: u32) -> Result; +} +extern "C" { + pub fn GX_ProcessCommandList(buf0a: *mut u32, buf0s: u32, flags: u8) -> Result; +} +extern "C" { + pub fn GX_MemoryFill( + buf0a: *mut u32, + buf0v: u32, + buf0e: *mut u32, + control0: u16, + buf1a: *mut u32, + buf1v: u32, + buf1e: *mut u32, + control1: u16, + ) -> Result; +} +extern "C" { + pub fn GX_DisplayTransfer( + inadr: *mut u32, + indim: u32, + outadr: *mut u32, + outdim: u32, + flags: u32, + ) -> Result; +} +extern "C" { + pub fn GX_TextureCopy( + inadr: *mut u32, + indim: u32, + outadr: *mut u32, + outdim: u32, + size: u32, + flags: u32, + ) -> Result; +} +extern "C" { + pub fn GX_FlushCacheRegions( + buf0a: *mut u32, + buf0s: u32, + buf1a: *mut u32, + buf1s: u32, + buf2a: *mut u32, + buf2s: u32, + ) -> Result; +} +pub const GPU_NEAREST: GPU_TEXTURE_FILTER_PARAM = 0; +pub const GPU_LINEAR: GPU_TEXTURE_FILTER_PARAM = 1; +pub type GPU_TEXTURE_FILTER_PARAM = u32; +pub const GPU_CLAMP_TO_EDGE: GPU_TEXTURE_WRAP_PARAM = 0; +pub const GPU_CLAMP_TO_BORDER: GPU_TEXTURE_WRAP_PARAM = 1; +pub const GPU_REPEAT: GPU_TEXTURE_WRAP_PARAM = 2; +pub const GPU_MIRRORED_REPEAT: GPU_TEXTURE_WRAP_PARAM = 3; +pub type GPU_TEXTURE_WRAP_PARAM = u32; +pub const GPU_TEX_2D: GPU_TEXTURE_MODE_PARAM = 0; +pub const GPU_TEX_CUBE_MAP: GPU_TEXTURE_MODE_PARAM = 1; +pub const GPU_TEX_SHADOW_2D: GPU_TEXTURE_MODE_PARAM = 2; +pub const GPU_TEX_PROJECTION: GPU_TEXTURE_MODE_PARAM = 3; +pub const GPU_TEX_SHADOW_CUBE: GPU_TEXTURE_MODE_PARAM = 4; +pub const GPU_TEX_DISABLED: GPU_TEXTURE_MODE_PARAM = 5; +pub type GPU_TEXTURE_MODE_PARAM = u32; +pub const GPU_TEXUNIT0: GPU_TEXUNIT = 1; +pub const GPU_TEXUNIT1: GPU_TEXUNIT = 2; +pub const GPU_TEXUNIT2: GPU_TEXUNIT = 4; +pub type GPU_TEXUNIT = u32; +pub const GPU_RGBA8: GPU_TEXCOLOR = 0; +pub const GPU_RGB8: GPU_TEXCOLOR = 1; +pub const GPU_RGBA5551: GPU_TEXCOLOR = 2; +pub const GPU_RGB565: GPU_TEXCOLOR = 3; +pub const GPU_RGBA4: GPU_TEXCOLOR = 4; +pub const GPU_LA8: GPU_TEXCOLOR = 5; +pub const GPU_HILO8: GPU_TEXCOLOR = 6; +pub const GPU_L8: GPU_TEXCOLOR = 7; +pub const GPU_A8: GPU_TEXCOLOR = 8; +pub const GPU_LA4: GPU_TEXCOLOR = 9; +pub const GPU_L4: GPU_TEXCOLOR = 10; +pub const GPU_A4: GPU_TEXCOLOR = 11; +pub const GPU_ETC1: GPU_TEXCOLOR = 12; +pub const GPU_ETC1A4: GPU_TEXCOLOR = 13; +pub type GPU_TEXCOLOR = u32; +pub const GPU_TEXFACE_2D: GPU_TEXFACE = 0; +pub const GPU_POSITIVE_X: GPU_TEXFACE = 0; +pub const GPU_NEGATIVE_X: GPU_TEXFACE = 1; +pub const GPU_POSITIVE_Y: GPU_TEXFACE = 2; +pub const GPU_NEGATIVE_Y: GPU_TEXFACE = 3; +pub const GPU_POSITIVE_Z: GPU_TEXFACE = 4; +pub const GPU_NEGATIVE_Z: GPU_TEXFACE = 5; +pub type GPU_TEXFACE = u32; +pub const GPU_PT_CLAMP_TO_ZERO: GPU_PROCTEX_CLAMP = 0; +pub const GPU_PT_CLAMP_TO_EDGE: GPU_PROCTEX_CLAMP = 1; +pub const GPU_PT_REPEAT: GPU_PROCTEX_CLAMP = 2; +pub const GPU_PT_MIRRORED_REPEAT: GPU_PROCTEX_CLAMP = 3; +pub const GPU_PT_PULSE: GPU_PROCTEX_CLAMP = 4; +pub type GPU_PROCTEX_CLAMP = u32; +pub const GPU_PT_U: GPU_PROCTEX_MAPFUNC = 0; +pub const GPU_PT_U2: GPU_PROCTEX_MAPFUNC = 1; +pub const GPU_PT_V: GPU_PROCTEX_MAPFUNC = 2; +pub const GPU_PT_V2: GPU_PROCTEX_MAPFUNC = 3; +pub const GPU_PT_ADD: GPU_PROCTEX_MAPFUNC = 4; +pub const GPU_PT_ADD2: GPU_PROCTEX_MAPFUNC = 5; +pub const GPU_PT_SQRT2: GPU_PROCTEX_MAPFUNC = 6; +pub const GPU_PT_MIN: GPU_PROCTEX_MAPFUNC = 7; +pub const GPU_PT_MAX: GPU_PROCTEX_MAPFUNC = 8; +pub const GPU_PT_RMAX: GPU_PROCTEX_MAPFUNC = 9; +pub type GPU_PROCTEX_MAPFUNC = u32; +pub const GPU_PT_NONE: GPU_PROCTEX_SHIFT = 0; +pub const GPU_PT_ODD: GPU_PROCTEX_SHIFT = 1; +pub const GPU_PT_EVEN: GPU_PROCTEX_SHIFT = 2; +pub type GPU_PROCTEX_SHIFT = u32; +pub const GPU_PT_NEAREST: GPU_PROCTEX_FILTER = 0; +pub const GPU_PT_LINEAR: GPU_PROCTEX_FILTER = 1; +pub const GPU_PT_NEAREST_MIP_NEAREST: GPU_PROCTEX_FILTER = 2; +pub const GPU_PT_LINEAR_MIP_NEAREST: GPU_PROCTEX_FILTER = 3; +pub const GPU_PT_NEAREST_MIP_LINEAR: GPU_PROCTEX_FILTER = 4; +pub const GPU_PT_LINEAR_MIP_LINEAR: GPU_PROCTEX_FILTER = 5; +pub type GPU_PROCTEX_FILTER = u32; +pub const GPU_LUT_NOISE: GPU_PROCTEX_LUTID = 0; +pub const GPU_LUT_RGBMAP: GPU_PROCTEX_LUTID = 2; +pub const GPU_LUT_ALPHAMAP: GPU_PROCTEX_LUTID = 3; +pub const GPU_LUT_COLOR: GPU_PROCTEX_LUTID = 4; +pub const GPU_LUT_COLORDIF: GPU_PROCTEX_LUTID = 5; +pub type GPU_PROCTEX_LUTID = u32; +pub const GPU_RB_RGBA8: GPU_COLORBUF = 0; +pub const GPU_RB_RGB8: GPU_COLORBUF = 1; +pub const GPU_RB_RGBA5551: GPU_COLORBUF = 2; +pub const GPU_RB_RGB565: GPU_COLORBUF = 3; +pub const GPU_RB_RGBA4: GPU_COLORBUF = 4; +pub type GPU_COLORBUF = u32; +pub const GPU_RB_DEPTH16: GPU_DEPTHBUF = 0; +pub const GPU_RB_DEPTH24: GPU_DEPTHBUF = 2; +pub const GPU_RB_DEPTH24_STENCIL8: GPU_DEPTHBUF = 3; +pub type GPU_DEPTHBUF = u32; +pub const GPU_NEVER: GPU_TESTFUNC = 0; +pub const GPU_ALWAYS: GPU_TESTFUNC = 1; +pub const GPU_EQUAL: GPU_TESTFUNC = 2; +pub const GPU_NOTEQUAL: GPU_TESTFUNC = 3; +pub const GPU_LESS: GPU_TESTFUNC = 4; +pub const GPU_LEQUAL: GPU_TESTFUNC = 5; +pub const GPU_GREATER: GPU_TESTFUNC = 6; +pub const GPU_GEQUAL: GPU_TESTFUNC = 7; +pub type GPU_TESTFUNC = u32; +pub const GPU_EARLYDEPTH_GEQUAL: GPU_EARLYDEPTHFUNC = 0; +pub const GPU_EARLYDEPTH_GREATER: GPU_EARLYDEPTHFUNC = 1; +pub const GPU_EARLYDEPTH_LEQUAL: GPU_EARLYDEPTHFUNC = 2; +pub const GPU_EARLYDEPTH_LESS: GPU_EARLYDEPTHFUNC = 3; +pub type GPU_EARLYDEPTHFUNC = u32; +pub const GPU_GAS_NEVER: GPU_GASDEPTHFUNC = 0; +pub const GPU_GAS_ALWAYS: GPU_GASDEPTHFUNC = 1; +pub const GPU_GAS_GREATER: GPU_GASDEPTHFUNC = 2; +pub const GPU_GAS_LESS: GPU_GASDEPTHFUNC = 3; +pub type GPU_GASDEPTHFUNC = u32; +pub const GPU_SCISSOR_DISABLE: GPU_SCISSORMODE = 0; +pub const GPU_SCISSOR_INVERT: GPU_SCISSORMODE = 1; +pub const GPU_SCISSOR_NORMAL: GPU_SCISSORMODE = 3; +pub type GPU_SCISSORMODE = u32; +pub const GPU_STENCIL_KEEP: GPU_STENCILOP = 0; +pub const GPU_STENCIL_ZERO: GPU_STENCILOP = 1; +pub const GPU_STENCIL_REPLACE: GPU_STENCILOP = 2; +pub const GPU_STENCIL_INCR: GPU_STENCILOP = 3; +pub const GPU_STENCIL_DECR: GPU_STENCILOP = 4; +pub const GPU_STENCIL_INVERT: GPU_STENCILOP = 5; +pub const GPU_STENCIL_INCR_WRAP: GPU_STENCILOP = 6; +pub const GPU_STENCIL_DECR_WRAP: GPU_STENCILOP = 7; +pub type GPU_STENCILOP = u32; +pub const GPU_WRITE_RED: GPU_WRITEMASK = 1; +pub const GPU_WRITE_GREEN: GPU_WRITEMASK = 2; +pub const GPU_WRITE_BLUE: GPU_WRITEMASK = 4; +pub const GPU_WRITE_ALPHA: GPU_WRITEMASK = 8; +pub const GPU_WRITE_DEPTH: GPU_WRITEMASK = 16; +pub const GPU_WRITE_COLOR: GPU_WRITEMASK = 15; +pub const GPU_WRITE_ALL: GPU_WRITEMASK = 31; +pub type GPU_WRITEMASK = u32; +pub const GPU_BLEND_ADD: GPU_BLENDEQUATION = 0; +pub const GPU_BLEND_SUBTRACT: GPU_BLENDEQUATION = 1; +pub const GPU_BLEND_REVERSE_SUBTRACT: GPU_BLENDEQUATION = 2; +pub const GPU_BLEND_MIN: GPU_BLENDEQUATION = 3; +pub const GPU_BLEND_MAX: GPU_BLENDEQUATION = 4; +pub type GPU_BLENDEQUATION = u32; +pub const GPU_ZERO: GPU_BLENDFACTOR = 0; +pub const GPU_ONE: GPU_BLENDFACTOR = 1; +pub const GPU_SRC_COLOR: GPU_BLENDFACTOR = 2; +pub const GPU_ONE_MINUS_SRC_COLOR: GPU_BLENDFACTOR = 3; +pub const GPU_DST_COLOR: GPU_BLENDFACTOR = 4; +pub const GPU_ONE_MINUS_DST_COLOR: GPU_BLENDFACTOR = 5; +pub const GPU_SRC_ALPHA: GPU_BLENDFACTOR = 6; +pub const GPU_ONE_MINUS_SRC_ALPHA: GPU_BLENDFACTOR = 7; +pub const GPU_DST_ALPHA: GPU_BLENDFACTOR = 8; +pub const GPU_ONE_MINUS_DST_ALPHA: GPU_BLENDFACTOR = 9; +pub const GPU_CONSTANT_COLOR: GPU_BLENDFACTOR = 10; +pub const GPU_ONE_MINUS_CONSTANT_COLOR: GPU_BLENDFACTOR = 11; +pub const GPU_CONSTANT_ALPHA: GPU_BLENDFACTOR = 12; +pub const GPU_ONE_MINUS_CONSTANT_ALPHA: GPU_BLENDFACTOR = 13; +pub const GPU_SRC_ALPHA_SATURATE: GPU_BLENDFACTOR = 14; +pub type GPU_BLENDFACTOR = u32; +pub const GPU_LOGICOP_CLEAR: GPU_LOGICOP = 0; +pub const GPU_LOGICOP_AND: GPU_LOGICOP = 1; +pub const GPU_LOGICOP_AND_REVERSE: GPU_LOGICOP = 2; +pub const GPU_LOGICOP_COPY: GPU_LOGICOP = 3; +pub const GPU_LOGICOP_SET: GPU_LOGICOP = 4; +pub const GPU_LOGICOP_COPY_INVERTED: GPU_LOGICOP = 5; +pub const GPU_LOGICOP_NOOP: GPU_LOGICOP = 6; +pub const GPU_LOGICOP_INVERT: GPU_LOGICOP = 7; +pub const GPU_LOGICOP_NAND: GPU_LOGICOP = 8; +pub const GPU_LOGICOP_OR: GPU_LOGICOP = 9; +pub const GPU_LOGICOP_NOR: GPU_LOGICOP = 10; +pub const GPU_LOGICOP_XOR: GPU_LOGICOP = 11; +pub const GPU_LOGICOP_EQUIV: GPU_LOGICOP = 12; +pub const GPU_LOGICOP_AND_INVERTED: GPU_LOGICOP = 13; +pub const GPU_LOGICOP_OR_REVERSE: GPU_LOGICOP = 14; +pub const GPU_LOGICOP_OR_INVERTED: GPU_LOGICOP = 15; +pub type GPU_LOGICOP = u32; +pub const GPU_FRAGOPMODE_GL: GPU_FRAGOPMODE = 0; +pub const GPU_FRAGOPMODE_GAS_ACC: GPU_FRAGOPMODE = 1; +pub const GPU_FRAGOPMODE_SHADOW: GPU_FRAGOPMODE = 3; +pub type GPU_FRAGOPMODE = u32; +pub const GPU_BYTE: GPU_FORMATS = 0; +pub const GPU_UNSIGNED_BYTE: GPU_FORMATS = 1; +pub const GPU_SHORT: GPU_FORMATS = 2; +pub const GPU_FLOAT: GPU_FORMATS = 3; +pub type GPU_FORMATS = u32; +pub const GPU_CULL_NONE: GPU_CULLMODE = 0; +pub const GPU_CULL_FRONT_CCW: GPU_CULLMODE = 1; +pub const GPU_CULL_BACK_CCW: GPU_CULLMODE = 2; +pub type GPU_CULLMODE = u32; +pub const GPU_PRIMARY_COLOR: GPU_TEVSRC = 0; +pub const GPU_FRAGMENT_PRIMARY_COLOR: GPU_TEVSRC = 1; +pub const GPU_FRAGMENT_SECONDARY_COLOR: GPU_TEVSRC = 2; +pub const GPU_TEXTURE0: GPU_TEVSRC = 3; +pub const GPU_TEXTURE1: GPU_TEVSRC = 4; +pub const GPU_TEXTURE2: GPU_TEVSRC = 5; +pub const GPU_TEXTURE3: GPU_TEVSRC = 6; +pub const GPU_PREVIOUS_BUFFER: GPU_TEVSRC = 13; +pub const GPU_CONSTANT: GPU_TEVSRC = 14; +pub const GPU_PREVIOUS: GPU_TEVSRC = 15; +pub type GPU_TEVSRC = u32; +pub const GPU_TEVOP_RGB_SRC_COLOR: GPU_TEVOP_RGB = 0; +pub const GPU_TEVOP_RGB_ONE_MINUS_SRC_COLOR: GPU_TEVOP_RGB = 1; +pub const GPU_TEVOP_RGB_SRC_ALPHA: GPU_TEVOP_RGB = 2; +pub const GPU_TEVOP_RGB_ONE_MINUS_SRC_ALPHA: GPU_TEVOP_RGB = 3; +pub const GPU_TEVOP_RGB_SRC_R: GPU_TEVOP_RGB = 4; +pub const GPU_TEVOP_RGB_ONE_MINUS_SRC_R: GPU_TEVOP_RGB = 5; +pub const GPU_TEVOP_RGB_0x06: GPU_TEVOP_RGB = 6; +pub const GPU_TEVOP_RGB_0x07: GPU_TEVOP_RGB = 7; +pub const GPU_TEVOP_RGB_SRC_G: GPU_TEVOP_RGB = 8; +pub const GPU_TEVOP_RGB_ONE_MINUS_SRC_G: GPU_TEVOP_RGB = 9; +pub const GPU_TEVOP_RGB_0x0A: GPU_TEVOP_RGB = 10; +pub const GPU_TEVOP_RGB_0x0B: GPU_TEVOP_RGB = 11; +pub const GPU_TEVOP_RGB_SRC_B: GPU_TEVOP_RGB = 12; +pub const GPU_TEVOP_RGB_ONE_MINUS_SRC_B: GPU_TEVOP_RGB = 13; +pub const GPU_TEVOP_RGB_0x0E: GPU_TEVOP_RGB = 14; +pub const GPU_TEVOP_RGB_0x0F: GPU_TEVOP_RGB = 15; +pub type GPU_TEVOP_RGB = u32; +pub const GPU_TEVOP_A_SRC_ALPHA: GPU_TEVOP_A = 0; +pub const GPU_TEVOP_A_ONE_MINUS_SRC_ALPHA: GPU_TEVOP_A = 1; +pub const GPU_TEVOP_A_SRC_R: GPU_TEVOP_A = 2; +pub const GPU_TEVOP_A_ONE_MINUS_SRC_R: GPU_TEVOP_A = 3; +pub const GPU_TEVOP_A_SRC_G: GPU_TEVOP_A = 4; +pub const GPU_TEVOP_A_ONE_MINUS_SRC_G: GPU_TEVOP_A = 5; +pub const GPU_TEVOP_A_SRC_B: GPU_TEVOP_A = 6; +pub const GPU_TEVOP_A_ONE_MINUS_SRC_B: GPU_TEVOP_A = 7; +pub type GPU_TEVOP_A = u32; +pub const GPU_REPLACE: GPU_COMBINEFUNC = 0; +pub const GPU_MODULATE: GPU_COMBINEFUNC = 1; +pub const GPU_ADD: GPU_COMBINEFUNC = 2; +pub const GPU_ADD_SIGNED: GPU_COMBINEFUNC = 3; +pub const GPU_INTERPOLATE: GPU_COMBINEFUNC = 4; +pub const GPU_SUBTRACT: GPU_COMBINEFUNC = 5; +pub const GPU_DOT3_RGB: GPU_COMBINEFUNC = 6; +pub const GPU_MULTIPLY_ADD: GPU_COMBINEFUNC = 8; +pub const GPU_ADD_MULTIPLY: GPU_COMBINEFUNC = 9; +pub type GPU_COMBINEFUNC = u32; +pub const GPU_TEVSCALE_1: GPU_TEVSCALE = 0; +pub const GPU_TEVSCALE_2: GPU_TEVSCALE = 1; +pub const GPU_TEVSCALE_4: GPU_TEVSCALE = 2; +pub type GPU_TEVSCALE = u32; +pub const GPU_NO_FRESNEL: GPU_FRESNELSEL = 0; +pub const GPU_PRI_ALPHA_FRESNEL: GPU_FRESNELSEL = 1; +pub const GPU_SEC_ALPHA_FRESNEL: GPU_FRESNELSEL = 2; +pub const GPU_PRI_SEC_ALPHA_FRESNEL: GPU_FRESNELSEL = 3; +pub type GPU_FRESNELSEL = u32; +pub const GPU_BUMP_NOT_USED: GPU_BUMPMODE = 0; +pub const GPU_BUMP_AS_BUMP: GPU_BUMPMODE = 1; +pub const GPU_BUMP_AS_TANG: GPU_BUMPMODE = 2; +pub type GPU_BUMPMODE = u32; +pub const GPU_LUT_D0: GPU_LIGHTLUTID = 0; +pub const GPU_LUT_D1: GPU_LIGHTLUTID = 1; +pub const GPU_LUT_SP: GPU_LIGHTLUTID = 2; +pub const GPU_LUT_FR: GPU_LIGHTLUTID = 3; +pub const GPU_LUT_RB: GPU_LIGHTLUTID = 4; +pub const GPU_LUT_RG: GPU_LIGHTLUTID = 5; +pub const GPU_LUT_RR: GPU_LIGHTLUTID = 6; +pub const GPU_LUT_DA: GPU_LIGHTLUTID = 7; +pub type GPU_LIGHTLUTID = u32; +pub const GPU_LUTINPUT_NH: GPU_LIGHTLUTINPUT = 0; +pub const GPU_LUTINPUT_VH: GPU_LIGHTLUTINPUT = 1; +pub const GPU_LUTINPUT_NV: GPU_LIGHTLUTINPUT = 2; +pub const GPU_LUTINPUT_LN: GPU_LIGHTLUTINPUT = 3; +pub const GPU_LUTINPUT_SP: GPU_LIGHTLUTINPUT = 4; +pub const GPU_LUTINPUT_CP: GPU_LIGHTLUTINPUT = 5; +pub type GPU_LIGHTLUTINPUT = u32; +pub const GPU_LUTSCALER_1x: GPU_LIGHTLUTSCALER = 0; +pub const GPU_LUTSCALER_2x: GPU_LIGHTLUTSCALER = 1; +pub const GPU_LUTSCALER_4x: GPU_LIGHTLUTSCALER = 2; +pub const GPU_LUTSCALER_8x: GPU_LIGHTLUTSCALER = 3; +pub const GPU_LUTSCALER_0_25x: GPU_LIGHTLUTSCALER = 6; +pub const GPU_LUTSCALER_0_5x: GPU_LIGHTLUTSCALER = 7; +pub type GPU_LIGHTLUTSCALER = u32; +pub const GPU_LUTSELECT_COMMON: GPU_LIGHTLUTSELECT = 0; +pub const GPU_LUTSELECT_SP: GPU_LIGHTLUTSELECT = 1; +pub const GPU_LUTSELECT_DA: GPU_LIGHTLUTSELECT = 2; +pub type GPU_LIGHTLUTSELECT = u32; +pub const GPU_NO_FOG: GPU_FOGMODE = 0; +pub const GPU_FOG: GPU_FOGMODE = 5; +pub const GPU_GAS: GPU_FOGMODE = 7; +pub type GPU_FOGMODE = u32; +pub const GPU_PLAIN_DENSITY: GPU_GASMODE = 0; +pub const GPU_DEPTH_DENSITY: GPU_GASMODE = 1; +pub type GPU_GASMODE = u32; +pub const GPU_GAS_DENSITY: GPU_GASLUTINPUT = 0; +pub const GPU_GAS_LIGHT_FACTOR: GPU_GASLUTINPUT = 1; +pub type GPU_GASLUTINPUT = u32; +pub const GPU_TRIANGLES: GPU_Primitive_t = 0; +pub const GPU_TRIANGLE_STRIP: GPU_Primitive_t = 256; +pub const GPU_TRIANGLE_FAN: GPU_Primitive_t = 512; +pub const GPU_GEOMETRY_PRIM: GPU_Primitive_t = 768; +pub type GPU_Primitive_t = u32; +pub const GPU_VERTEX_SHADER: GPU_SHADER_TYPE = 0; +pub const GPU_GEOMETRY_SHADER: GPU_SHADER_TYPE = 1; +pub type GPU_SHADER_TYPE = u32; +extern "C" { + pub static mut gpuCmdBuf: *mut u32; +} +extern "C" { + pub static mut gpuCmdBufSize: u32; +} +extern "C" { + pub static mut gpuCmdBufOffset: u32; +} +extern "C" { + pub fn GPUCMD_AddRawCommands(cmd: *const u32, size: u32); +} +extern "C" { + pub fn GPUCMD_Add(header: u32, param: *const u32, paramlength: u32); +} +extern "C" { + pub fn GPUCMD_Split(addr: *mut *mut u32, size: *mut u32); +} +extern "C" { + pub fn f32tof16(f: f32) -> u32; +} +extern "C" { + pub fn f32tof20(f: f32) -> u32; +} +extern "C" { + pub fn f32tof24(f: f32) -> u32; +} +extern "C" { + pub fn f32tof31(f: f32) -> u32; +} +pub const VERTEX_SHDR: DVLE_type = 0; +pub const GEOMETRY_SHDR: DVLE_type = 1; +pub type DVLE_type = u32; +pub const DVLE_CONST_BOOL: DVLE_constantType = 0; +pub const DVLE_CONST_u8: DVLE_constantType = 1; +pub const DVLE_CONST_FLOAT24: DVLE_constantType = 2; +pub type DVLE_constantType = u32; +pub const RESULT_POSITION: DVLE_outputAttribute_t = 0; +pub const RESULT_NORMALQUAT: DVLE_outputAttribute_t = 1; +pub const RESULT_COLOR: DVLE_outputAttribute_t = 2; +pub const RESULT_TEXCOORD0: DVLE_outputAttribute_t = 3; +pub const RESULT_TEXCOORD0W: DVLE_outputAttribute_t = 4; +pub const RESULT_TEXCOORD1: DVLE_outputAttribute_t = 5; +pub const RESULT_TEXCOORD2: DVLE_outputAttribute_t = 6; +pub const RESULT_VIEW: DVLE_outputAttribute_t = 8; +pub const RESULT_DUMMY: DVLE_outputAttribute_t = 9; +pub type DVLE_outputAttribute_t = u32; +pub const GSH_POINT: DVLE_geoShaderMode = 0; +pub const GSH_VARIABLE_PRIM: DVLE_geoShaderMode = 1; +pub const GSH_FIXED_PRIM: DVLE_geoShaderMode = 2; +pub type DVLE_geoShaderMode = u32; +#[repr(C)] +pub struct DVLP_s { + pub codeSize: u32, + pub codeData: *mut u32, + pub opdescSize: u32, + pub opcdescData: *mut u32, +} +#[repr(C)] +pub struct DVLE_constEntry_s { + pub type_: u16, + pub id: u16, + pub data: [u32; 4usize], +} +#[repr(C)] +pub struct DVLE_outEntry_s { + pub type_: u16, + pub regID: u16, + pub mask: u8, + pub unk: [u8; 3usize], +} +#[repr(C)] +pub struct DVLE_uniformEntry_s { + pub symbolOffset: u32, + pub startReg: u16, + pub endReg: u16, +} +#[repr(C)] +pub struct DVLE_s { + pub type_: DVLE_type, + pub mergeOutmaps: bool, + pub gshMode: DVLE_geoShaderMode, + pub gshFixedVtxStart: u8, + pub gshVariableVtxNum: u8, + pub gshFixedVtxNum: u8, + pub dvlp: *mut DVLP_s, + pub mainOffset: u32, + pub endmainOffset: u32, + pub constTableSize: u32, + pub constTableData: *mut DVLE_constEntry_s, + pub outTableSize: u32, + pub outTableData: *mut DVLE_outEntry_s, + pub uniformTableSize: u32, + pub uniformTableData: *mut DVLE_uniformEntry_s, + pub symbolTableData: *mut ::libc::c_char, + pub outmapMask: u8, + pub outmapData: [u32; 8usize], + pub outmapMode: u32, + pub outmapClock: u32, +} +#[repr(C)] +pub struct DVLB_s { + pub numDVLE: u32, + pub DVLP: DVLP_s, + pub DVLE: *mut DVLE_s, +} +extern "C" { + pub fn DVLB_ParseFile(shbinData: *mut u32, shbinSize: u32) -> *mut DVLB_s; +} +extern "C" { + pub fn DVLB_Free(dvlb: *mut DVLB_s); +} +extern "C" { + pub fn DVLE_GetUniformRegister(dvle: *mut DVLE_s, name: *const ::libc::c_char) -> s8; +} +extern "C" { + pub fn DVLE_GenerateOutmap(dvle: *mut DVLE_s); +} +#[repr(C)] +pub struct float24Uniform_s { + pub id: u32, + pub data: [u32; 3usize], +} +#[repr(C)] +pub struct shaderInstance_s { + pub dvle: *mut DVLE_s, + pub boolUniforms: u16, + pub boolUniformMask: u16, + pub intUniforms: [u32; 4usize], + pub float24Uniforms: *mut float24Uniform_s, + pub intUniformMask: u8, + pub numFloat24Uniforms: u8, +} +#[repr(C)] +pub struct shaderProgram_s { + pub vertexShader: *mut shaderInstance_s, + pub geometryShader: *mut shaderInstance_s, + pub geoShaderInputPermutation: [u32; 2usize], + pub geoShaderInputStride: u8, +} +extern "C" { + pub fn shaderInstanceInit(si: *mut shaderInstance_s, dvle: *mut DVLE_s) -> Result; +} +extern "C" { + pub fn shaderInstanceFree(si: *mut shaderInstance_s) -> Result; +} +extern "C" { + pub fn shaderInstanceSetBool( + si: *mut shaderInstance_s, + id: ::libc::c_int, + value: bool, + ) -> Result; +} +extern "C" { + pub fn shaderInstanceGetBool( + si: *mut shaderInstance_s, + id: ::libc::c_int, + value: *mut bool, + ) -> Result; +} +extern "C" { + pub fn shaderInstanceGetUniformLocation( + si: *mut shaderInstance_s, + name: *const ::libc::c_char, + ) -> s8; +} +extern "C" { + pub fn shaderProgramInit(sp: *mut shaderProgram_s) -> Result; +} +extern "C" { + pub fn shaderProgramFree(sp: *mut shaderProgram_s) -> Result; +} +extern "C" { + pub fn shaderProgramSetVsh(sp: *mut shaderProgram_s, dvle: *mut DVLE_s) -> Result; +} +extern "C" { + pub fn shaderProgramSetGsh(sp: *mut shaderProgram_s, dvle: *mut DVLE_s, stride: u8) -> Result; +} +extern "C" { + pub fn shaderProgramSetGshInputPermutation( + sp: *mut shaderProgram_s, + permutation: u64, + ) -> Result; +} +extern "C" { + pub fn shaderProgramConfigure( + sp: *mut shaderProgram_s, + sendVshCode: bool, + sendGshCode: bool, + ) -> Result; +} +extern "C" { + pub fn shaderProgramUse(sp: *mut shaderProgram_s) -> Result; +} +pub const NDSP_OUTPUT_MONO: ndspOutputMode = 0; +pub const NDSP_OUTPUT_STEREO: ndspOutputMode = 1; +pub const NDSP_OUTPUT_SURROUND: ndspOutputMode = 2; +pub type ndspOutputMode = u32; +pub const NDSP_CLIP_NORMAL: ndspClippingMode = 0; +pub const NDSP_CLIP_SOFT: ndspClippingMode = 1; +pub type ndspClippingMode = u32; +pub const NDSP_SPKPOS_SQUARE: ndspSpeakerPos = 0; +pub const NDSP_SPKPOS_WIDE: ndspSpeakerPos = 1; +pub const NDSP_SPKPOS_NUM: ndspSpeakerPos = 2; +pub type ndspSpeakerPos = u32; +#[repr(C)] +pub struct ndspAdpcmData { + pub index: u16, + pub history0: s16, + pub history1: s16, +} +pub type ndspWaveBuf = tag_ndspWaveBuf; +pub const NDSP_WBUF_FREE: _bindgen_ty_25 = 0; +pub const NDSP_WBUF_QUEUED: _bindgen_ty_25 = 1; +pub const NDSP_WBUF_PLAYING: _bindgen_ty_25 = 2; +pub const NDSP_WBUF_DONE: _bindgen_ty_25 = 3; +pub type _bindgen_ty_25 = u32; +#[repr(C)] +pub struct tag_ndspWaveBuf { + pub __bindgen_anon_1: tag_ndspWaveBuf__bindgen_ty_1, + pub nsamples: u32, + pub adpcm_data: *mut ndspAdpcmData, + pub offset: u32, + pub looping: bool, + pub status: u8, + pub sequence_id: u16, + pub next: *mut ndspWaveBuf, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tag_ndspWaveBuf__bindgen_ty_1 { + pub data_pcm8: *mut s8, + pub data_pcm16: *mut s16, + pub data_adpcm: *mut u8, + pub data_vaddr: *const ::libc::c_void, + _bindgen_union_align: u32, +} +pub type ndspCallback = ::core::option::Option; +pub type ndspAuxCallback = ::core::option::Option< + unsafe extern "C" fn( + data: *mut ::libc::c_void, + nsamples: ::libc::c_int, + samples: *mut *mut ::libc::c_void, + ), +>; +extern "C" { + pub fn ndspUseComponent(binary: *const ::libc::c_void, size: u32, progMask: u16, dataMask: u16); +} +extern "C" { + pub fn ndspInit() -> Result; +} +extern "C" { + pub fn ndspExit(); +} +extern "C" { + pub fn ndspGetDroppedFrames() -> u32; +} +extern "C" { + pub fn ndspGetFrameCount() -> u32; +} +extern "C" { + pub fn ndspSetMasterVol(volume: f32); +} +extern "C" { + pub fn ndspSetOutputMode(mode: ndspOutputMode); +} +extern "C" { + pub fn ndspSetClippingMode(mode: ndspClippingMode); +} +extern "C" { + pub fn ndspSetOutputCount(count: ::libc::c_int); +} +extern "C" { + pub fn ndspSetCapture(capture: *mut ndspWaveBuf); +} +extern "C" { + pub fn ndspSetCallback(callback: ndspCallback, data: *mut ::libc::c_void); +} +extern "C" { + pub fn ndspSurroundSetDepth(depth: u16); +} +extern "C" { + pub fn ndspSurroundSetPos(pos: ndspSpeakerPos); +} +extern "C" { + pub fn ndspSurroundSetRearRatio(ratio: u16); +} +extern "C" { + pub fn ndspAuxSetEnable(id: ::libc::c_int, enable: bool); +} +extern "C" { + pub fn ndspAuxSetFrontBypass(id: ::libc::c_int, bypass: bool); +} +extern "C" { + pub fn ndspAuxSetVolume(id: ::libc::c_int, volume: f32); +} +extern "C" { + pub fn ndspAuxSetCallback( + id: ::libc::c_int, + callback: ndspAuxCallback, + data: *mut ::libc::c_void, + ); +} +pub const NDSP_ENCODING_PCM8: _bindgen_ty_26 = 0; +pub const NDSP_ENCODING_PCM16: _bindgen_ty_26 = 1; +pub const NDSP_ENCODING_ADPCM: _bindgen_ty_26 = 2; +pub type _bindgen_ty_26 = u32; +pub const NDSP_FORMAT_MONO_PCM8: _bindgen_ty_27 = 1; +pub const NDSP_FORMAT_MONO_PCM16: _bindgen_ty_27 = 5; +pub const NDSP_FORMAT_MONO_ADPCM: _bindgen_ty_27 = 9; +pub const NDSP_FORMAT_STEREO_PCM8: _bindgen_ty_27 = 2; +pub const NDSP_FORMAT_STEREO_PCM16: _bindgen_ty_27 = 6; +pub const NDSP_FORMAT_PCM8: _bindgen_ty_27 = 1; +pub const NDSP_FORMAT_PCM16: _bindgen_ty_27 = 5; +pub const NDSP_FORMAT_ADPCM: _bindgen_ty_27 = 9; +pub const NDSP_FRONT_BYPASS: _bindgen_ty_27 = 16; +pub const NDSP_3D_SURROUND_PREPROCESSED: _bindgen_ty_27 = 64; +pub type _bindgen_ty_27 = u32; +pub const NDSP_INTERP_POLYPHASE: ndspInterpType = 0; +pub const NDSP_INTERP_LINEAR: ndspInterpType = 1; +pub const NDSP_INTERP_NONE: ndspInterpType = 2; +pub type ndspInterpType = u32; +extern "C" { + pub fn ndspChnReset(id: ::libc::c_int); +} +extern "C" { + pub fn ndspChnInitParams(id: ::libc::c_int); +} +extern "C" { + pub fn ndspChnIsPlaying(id: ::libc::c_int) -> bool; +} +extern "C" { + pub fn ndspChnGetSamplePos(id: ::libc::c_int) -> u32; +} +extern "C" { + pub fn ndspChnGetWaveBufSeq(id: ::libc::c_int) -> u16; +} +extern "C" { + pub fn ndspChnIsPaused(id: ::libc::c_int) -> bool; +} +extern "C" { + pub fn ndspChnSetPaused(id: ::libc::c_int, paused: bool); +} +extern "C" { + pub fn ndspChnSetFormat(id: ::libc::c_int, format: u16); +} +extern "C" { + pub fn ndspChnSetInterp(id: ::libc::c_int, type_: ndspInterpType); +} +extern "C" { + pub fn ndspChnSetRate(id: ::libc::c_int, rate: f32); +} +extern "C" { + pub fn ndspChnSetMix(id: ::libc::c_int, mix: *mut f32); +} +extern "C" { + pub fn ndspChnSetAdpcmCoefs(id: ::libc::c_int, coefs: *mut u16); +} +extern "C" { + pub fn ndspChnWaveBufClear(id: ::libc::c_int); +} +extern "C" { + pub fn ndspChnWaveBufAdd(id: ::libc::c_int, buf: *mut ndspWaveBuf); +} +extern "C" { + pub fn ndspChnIirMonoSetEnable(id: ::libc::c_int, enable: bool); +} +extern "C" { + pub fn ndspChnIirMonoSetParamsCustomFilter( + id: ::libc::c_int, + a0: f32, + a1: f32, + b0: f32, + ) -> bool; +} +extern "C" { + pub fn ndspChnIirMonoSetParamsLowPassFilter(id: ::libc::c_int, f0: f32) -> bool; +} +extern "C" { + pub fn ndspChnIirMonoSetParamsHighPassFilter(id: ::libc::c_int, f0: f32) -> bool; +} +extern "C" { + pub fn ndspChnIirBiquadSetEnable(id: ::libc::c_int, enable: bool); +} +extern "C" { + pub fn ndspChnIirBiquadSetParamsCustomFilter( + id: ::libc::c_int, + a0: f32, + a1: f32, + a2: f32, + b0: f32, + b1: f32, + b2: f32, + ) -> bool; +} +extern "C" { + pub fn ndspChnIirBiquadSetParamsLowPassFilter(id: ::libc::c_int, f0: f32, Q: f32) -> bool; +} +extern "C" { + pub fn ndspChnIirBiquadSetParamsHighPassFilter(id: ::libc::c_int, f0: f32, Q: f32) -> bool; +} +extern "C" { + pub fn ndspChnIirBiquadSetParamsBandPassFilter(id: ::libc::c_int, f0: f32, Q: f32) -> bool; +} +extern "C" { + pub fn ndspChnIirBiquadSetParamsNotchFilter(id: ::libc::c_int, f0: f32, Q: f32) -> bool; +} +extern "C" { + pub fn ndspChnIirBiquadSetParamsPeakingEqualizer( + id: ::libc::c_int, + f0: f32, + Q: f32, + gain: f32, + ) -> bool; +} +pub const SWKBD_TYPE_NORMAL: SwkbdType = 0; +pub const SWKBD_TYPE_QWERTY: SwkbdType = 1; +pub const SWKBD_TYPE_NUMPAD: SwkbdType = 2; +pub const SWKBD_TYPE_WESTERN: SwkbdType = 3; +pub type SwkbdType = u32; +pub const SWKBD_ANYTHING: SwkbdValidInput = 0; +pub const SWKBD_NOTEMPTY: SwkbdValidInput = 1; +pub const SWKBD_NOTEMPTY_NOTBLANK: SwkbdValidInput = 2; +pub const SWKBD_NOTBLANK_NOTEMPTY: SwkbdValidInput = 2; +pub const SWKBD_NOTBLANK: SwkbdValidInput = 3; +pub const SWKBD_FIXEDLEN: SwkbdValidInput = 4; +pub type SwkbdValidInput = u32; +pub const SWKBD_BUTTON_LEFT: SwkbdButton = 0; +pub const SWKBD_BUTTON_MIDDLE: SwkbdButton = 1; +pub const SWKBD_BUTTON_RIGHT: SwkbdButton = 2; +pub const SWKBD_BUTTON_CONFIRM: SwkbdButton = 2; +pub const SWKBD_BUTTON_NONE: SwkbdButton = 3; +pub type SwkbdButton = u32; +pub const SWKBD_PASSWORD_NONE: SwkbdPasswordMode = 0; +pub const SWKBD_PASSWORD_HIDE: SwkbdPasswordMode = 1; +pub const SWKBD_PASSWORD_HIDE_DELAY: SwkbdPasswordMode = 2; +pub type SwkbdPasswordMode = u32; +pub const SWKBD_FILTER_DIGITS: _bindgen_ty_28 = 1; +pub const SWKBD_FILTER_AT: _bindgen_ty_28 = 2; +pub const SWKBD_FILTER_PERCENT: _bindgen_ty_28 = 4; +pub const SWKBD_FILTER_BACKSLASH: _bindgen_ty_28 = 8; +pub const SWKBD_FILTER_PROFANITY: _bindgen_ty_28 = 16; +pub const SWKBD_FILTER_CALLBACK: _bindgen_ty_28 = 32; +pub type _bindgen_ty_28 = u32; +pub const SWKBD_PARENTAL: _bindgen_ty_29 = 1; +pub const SWKBD_DARKEN_TOP_SCREEN: _bindgen_ty_29 = 2; +pub const SWKBD_PREDICTIVE_INPUT: _bindgen_ty_29 = 4; +pub const SWKBD_MULTILINE: _bindgen_ty_29 = 8; +pub const SWKBD_FIXED_WIDTH: _bindgen_ty_29 = 16; +pub const SWKBD_ALLOW_HOME: _bindgen_ty_29 = 32; +pub const SWKBD_ALLOW_RESET: _bindgen_ty_29 = 64; +pub const SWKBD_ALLOW_POWER: _bindgen_ty_29 = 128; +pub const SWKBD_DEFAULT_QWERTY: _bindgen_ty_29 = 512; +pub type _bindgen_ty_29 = u32; +pub const SWKBD_CALLBACK_OK: SwkbdCallbackResult = 0; +pub const SWKBD_CALLBACK_CLOSE: SwkbdCallbackResult = 1; +pub const SWKBD_CALLBACK_CONTINUE: SwkbdCallbackResult = 2; +pub type SwkbdCallbackResult = u32; +pub const SWKBD_NONE: SwkbdResult = -1; +pub const SWKBD_INVALID_INPUT: SwkbdResult = -2; +pub const SWKBD_OUTOFMEM: SwkbdResult = -3; +pub const SWKBD_D0_CLICK: SwkbdResult = 0; +pub const SWKBD_D1_CLICK0: SwkbdResult = 1; +pub const SWKBD_D1_CLICK1: SwkbdResult = 2; +pub const SWKBD_D2_CLICK0: SwkbdResult = 3; +pub const SWKBD_D2_CLICK1: SwkbdResult = 4; +pub const SWKBD_D2_CLICK2: SwkbdResult = 5; +pub const SWKBD_HOMEPRESSED: SwkbdResult = 10; +pub const SWKBD_RESETPRESSED: SwkbdResult = 11; +pub const SWKBD_POWERPRESSED: SwkbdResult = 12; +pub const SWKBD_PARENTAL_OK: SwkbdResult = 20; +pub const SWKBD_PARENTAL_FAIL: SwkbdResult = 21; +pub const SWKBD_BANNED_INPUT: SwkbdResult = 30; +pub type SwkbdResult = i32; +#[repr(C)] +pub struct SwkbdDictWord { + pub reading: [u16; 41usize], + pub word: [u16; 41usize], + pub language: u8, + pub all_languages: bool, +} +pub type SwkbdCallbackFn = ::core::option::Option< + unsafe extern "C" fn( + user: *mut ::libc::c_void, + ppMessage: *mut *const ::libc::c_char, + text: *const ::libc::c_char, + textlen: usize, + ) -> SwkbdCallbackResult, +>; +#[repr(C)] +pub struct SwkbdStatusData { + pub data: [u32; 17usize], +} +#[repr(C)] +pub struct SwkbdLearningData { + pub data: [u32; 10523usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SwkbdExtra { + pub initial_text: *const ::libc::c_char, + pub dict: *const SwkbdDictWord, + pub status_data: *mut SwkbdStatusData, + pub learning_data: *mut SwkbdLearningData, + pub callback: SwkbdCallbackFn, + pub callback_user: *mut ::libc::c_void, +} +#[repr(C)] +pub struct SwkbdState { + pub type_: ::libc::c_int, + pub num_buttons_m1: ::libc::c_int, + pub valid_input: ::libc::c_int, + pub password_mode: ::libc::c_int, + pub is_parental_screen: ::libc::c_int, + pub darken_top_screen: ::libc::c_int, + pub filter_flags: u32, + pub save_state_flags: u32, + pub max_text_len: u16, + pub dict_word_count: u16, + pub max_digits: u16, + pub button_text: [[u16; 17usize]; 3usize], + pub numpad_keys: [u16; 2usize], + pub hint_text: [u16; 65usize], + pub predictive_input: bool, + pub multiline: bool, + pub fixed_width: bool, + pub allow_home: bool, + pub allow_reset: bool, + pub allow_power: bool, + pub unknown: bool, + pub default_qwerty: bool, + pub button_submits_text: [bool; 4usize], + pub language: u16, + pub initial_text_offset: ::libc::c_int, + pub dict_offset: ::libc::c_int, + pub initial_status_offset: ::libc::c_int, + pub initial_learning_offset: ::libc::c_int, + pub shared_memory_size: usize, + pub version: u32, + pub result: SwkbdResult, + pub status_offset: ::libc::c_int, + pub learning_offset: ::libc::c_int, + pub text_offset: ::libc::c_int, + pub text_length: u16, + pub callback_result: ::libc::c_int, + pub callback_msg: [u16; 257usize], + pub skip_at_check: bool, + pub __bindgen_anon_1: SwkbdState__bindgen_ty_1, +} +#[repr(C)] +pub struct SwkbdState__bindgen_ty_1 { + pub reserved: __BindgenUnionField<[u8; 171usize]>, + pub extra: __BindgenUnionField, + pub bindgen_union_field: [u32; 43usize], +} +extern "C" { + pub fn swkbdInit( + swkbd: *mut SwkbdState, + type_: SwkbdType, + numButtons: ::libc::c_int, + maxTextLength: ::libc::c_int, + ); +} +extern "C" { + pub fn swkbdSetFeatures(swkbd: *mut SwkbdState, features: u32); +} +extern "C" { + pub fn swkbdSetHintText(swkbd: *mut SwkbdState, text: *const ::libc::c_char); +} +extern "C" { + pub fn swkbdSetButton( + swkbd: *mut SwkbdState, + button: SwkbdButton, + text: *const ::libc::c_char, + submit: bool, + ); +} +extern "C" { + pub fn swkbdSetInitialText(swkbd: *mut SwkbdState, text: *const ::libc::c_char); +} +extern "C" { + pub fn swkbdSetDictWord( + word: *mut SwkbdDictWord, + reading: *const ::libc::c_char, + text: *const ::libc::c_char, + ); +} +extern "C" { + pub fn swkbdSetDictionary( + swkbd: *mut SwkbdState, + dict: *const SwkbdDictWord, + wordCount: ::libc::c_int, + ); +} +extern "C" { + pub fn swkbdSetStatusData( + swkbd: *mut SwkbdState, + data: *mut SwkbdStatusData, + in_: bool, + out: bool, + ); +} +extern "C" { + pub fn swkbdSetLearningData( + swkbd: *mut SwkbdState, + data: *mut SwkbdLearningData, + in_: bool, + out: bool, + ); +} +extern "C" { + pub fn swkbdSetFilterCallback( + swkbd: *mut SwkbdState, + callback: SwkbdCallbackFn, + user: *mut ::libc::c_void, + ); +} +extern "C" { + pub fn swkbdInputText( + swkbd: *mut SwkbdState, + buf: *mut ::libc::c_char, + bufsize: usize, + ) -> SwkbdButton; +} +pub const ERROR_LANGUAGE_FLAG: _bindgen_ty_30 = 256; +pub const ERROR_WORD_WRAP_FLAG: _bindgen_ty_30 = 512; +pub type _bindgen_ty_30 = u32; +pub const ERROR_CODE: errorType = 0; +pub const ERROR_TEXT: errorType = 1; +pub const ERROR_EULA: errorType = 2; +pub const ERROR_TYPE_EULA_FIRST_BOOT: errorType = 3; +pub const ERROR_TYPE_EULA_DRAW_ONLY: errorType = 4; +pub const ERROR_TYPE_AGREE: errorType = 5; +pub const ERROR_CODE_LANGUAGE: errorType = 256; +pub const ERROR_TEXT_LANGUAGE: errorType = 257; +pub const ERROR_EULA_LANGUAGE: errorType = 258; +pub const ERROR_TEXT_WORD_WRAP: errorType = 513; +pub const ERROR_TEXT_LANGUAGE_WORD_WRAP: errorType = 769; +pub type errorType = u32; +pub const ERROR_NORMAL: errorScreenFlag = 0; +pub const ERROR_STEREO: errorScreenFlag = 1; +pub type errorScreenFlag = u32; +pub const ERROR_UNKNOWN: errorReturnCode = -1; +pub const ERROR_NONE: errorReturnCode = 0; +pub const ERROR_SUCCESS: errorReturnCode = 1; +pub const ERROR_NOT_SUPPORTED: errorReturnCode = 2; +pub const ERROR_HOME_BUTTON: errorReturnCode = 10; +pub const ERROR_SOFTWARE_RESET: errorReturnCode = 11; +pub const ERROR_POWER_BUTTON: errorReturnCode = 12; +pub type errorReturnCode = i32; +#[repr(C)] +pub struct errorConf { + pub type_: errorType, + pub errorCode: ::libc::c_int, + pub upperScreenFlag: errorScreenFlag, + pub useLanguage: u16, + pub Text: [u16; 1900usize], + pub homeButton: bool, + pub softwareReset: bool, + pub appJump: bool, + pub returnCode: errorReturnCode, + pub eulaVersion: u16, +} +extern "C" { + pub fn errorInit(err: *mut errorConf, type_: errorType, lang: CFG_Language); +} +extern "C" { + pub fn errorCode(err: *mut errorConf, error: ::libc::c_int); +} +extern "C" { + pub fn errorText(err: *mut errorConf, text: *const ::libc::c_char); +} +extern "C" { + pub fn errorDisp(err: *mut errorConf); +} +#[repr(C)] +pub struct MiiSelectorConf { + pub enable_cancel_button: ::libc::c_char, + pub enable_selecting_guests: ::libc::c_char, + pub show_on_top_screen: ::libc::c_char, + pub _unk0x3: [::libc::c_char; 5usize], + pub title: [u16; 64usize], + pub _unk0x88: [::libc::c_char; 4usize], + pub show_guest_page: ::libc::c_char, + pub _unk0x8D: [::libc::c_char; 3usize], + pub initial_index: u32, + pub mii_guest_whitelist: [::libc::c_char; 6usize], + pub mii_whitelist: [::libc::c_char; 100usize], + pub _unk0xFE: u16, + pub magic: u32, +} +#[repr(C)] +pub struct MiiSelectorReturn { + pub no_mii_selected: u32, + pub guest_mii_was_selected: u32, + pub guest_mii_index: u32, + pub mii: [::libc::c_char; 92usize], + pub _pad0x68: u16, + pub checksum: u16, + pub guest_mii_name: [u16; 12usize], +} +extern "C" { + pub fn miiSelectorLaunch( + conf: *const MiiSelectorConf, + returnbuf: *mut MiiSelectorReturn, + ) -> Result; +} +extern "C" { + pub fn miiSelectorChecksumIsValid(returnbuf: *const MiiSelectorReturn) -> bool; +} +#[repr(C)] +#[repr(align(8))] +pub struct sdmc_dir_t { + pub magic: u32, + pub fd: Handle, + pub index: isize, + pub size: usize, + pub entry_data: [FS_DirectoryEntry; 32usize], +} +extern "C" { + pub fn sdmcInit() -> Result; +} +extern "C" { + pub fn sdmcWriteSafe(enable: bool); +} +extern "C" { + pub fn sdmcExit() -> Result; +} +extern "C" { + pub fn sdmc_getmtime(name: *const ::libc::c_char, mtime: *mut u64) -> Result; +} +#[repr(C)] +pub struct romfs_header { + pub headerSize: u32, + pub dirHashTableOff: u32, + pub dirHashTableSize: u32, + pub dirTableOff: u32, + pub dirTableSize: u32, + pub fileHashTableOff: u32, + pub fileHashTableSize: u32, + pub fileTableOff: u32, + pub fileTableSize: u32, + pub fileDataOff: u32, +} +#[repr(C)] +pub struct romfs_dir { + pub parent: u32, + pub sibling: u32, + pub childDir: u32, + pub childFile: u32, + pub nextHash: u32, + pub nameLen: u32, + pub name: __IncompleteArrayField, +} +#[repr(C)] +pub struct romfs_file { + pub parent: u32, + pub sibling: u32, + pub dataOff: u64, + pub dataSize: u64, + pub nextHash: u32, + pub nameLen: u32, + pub name: __IncompleteArrayField, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct romfs_mount { + _unused: [u8; 0], +} +extern "C" { + pub fn romfsMount(mount: *mut *mut romfs_mount) -> Result; +} +extern "C" { + pub fn romfsMountFromFile(file: Handle, offset: u32, mount: *mut *mut romfs_mount) -> Result; +} +extern "C" { + pub fn romfsBind(mount: *mut romfs_mount) -> Result; +} +extern "C" { + pub fn romfsUnmount(mount: *mut romfs_mount) -> Result; +} +#[repr(C)] +pub struct charWidthInfo_s { + pub left: s8, + pub glyphWidth: u8, + pub charWidth: u8, +} +#[repr(C)] +pub struct TGLP_s { + pub cellWidth: u8, + pub cellHeight: u8, + pub baselinePos: u8, + pub maxCharWidth: u8, + pub sheetSize: u32, + pub nSheets: u16, + pub sheetFmt: u16, + pub nRows: u16, + pub nLines: u16, + pub sheetWidth: u16, + pub sheetHeight: u16, + pub sheetData: *mut u8, +} +pub type CWDH_s = tag_CWDH_s; +#[repr(C)] +pub struct tag_CWDH_s { + pub startIndex: u16, + pub endIndex: u16, + pub next: *mut CWDH_s, + pub widths: __IncompleteArrayField, +} +pub const CMAP_TYPE_DIRECT: _bindgen_ty_31 = 0; +pub const CMAP_TYPE_TABLE: _bindgen_ty_31 = 1; +pub const CMAP_TYPE_SCAN: _bindgen_ty_31 = 2; +pub type _bindgen_ty_31 = u32; +pub type CMAP_s = tag_CMAP_s; +#[repr(C)] +pub struct tag_CMAP_s { + pub codeBegin: u16, + pub codeEnd: u16, + pub mappingMethod: u16, + pub reserved: u16, + pub next: *mut CMAP_s, + pub __bindgen_anon_1: tag_CMAP_s__bindgen_ty_1, +} +#[repr(C)] +pub struct tag_CMAP_s__bindgen_ty_1 { + pub indexOffset: __BindgenUnionField, + pub indexTable: __BindgenUnionField<[u16; 0usize]>, + pub __bindgen_anon_1: __BindgenUnionField, + pub bindgen_union_field: u16, +} +#[repr(C)] +pub struct tag_CMAP_s__bindgen_ty_1__bindgen_ty_1 { + pub nScanEntries: u16, + pub scanEntries: __IncompleteArrayField, +} +#[repr(C)] +pub struct tag_CMAP_s__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 { + pub code: u16, + pub glyphIndex: u16, +} +#[repr(C)] +pub struct FINF_s { + pub signature: u32, + pub sectionSize: u32, + pub fontType: u8, + pub lineFeed: u8, + pub alterCharIndex: u16, + pub defaultWidth: charWidthInfo_s, + pub encoding: u8, + pub tglp: *mut TGLP_s, + pub cwdh: *mut CWDH_s, + pub cmap: *mut CMAP_s, + pub height: u8, + pub width: u8, + pub ascent: u8, + pub padding: u8, +} +#[repr(C)] +pub struct CFNT_s { + pub signature: u32, + pub endianness: u16, + pub headerSize: u16, + pub version: u32, + pub fileSize: u32, + pub nBlocks: u32, + pub finf: FINF_s, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct fontGlyphPos_s { + pub sheetIndex: ::libc::c_int, + pub xOffset: f32, + pub xAdvance: f32, + pub width: f32, + pub texcoord: fontGlyphPos_s__bindgen_ty_1, + pub vtxcoord: fontGlyphPos_s__bindgen_ty_2, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct fontGlyphPos_s__bindgen_ty_1 { + pub left: f32, + pub top: f32, + pub right: f32, + pub bottom: f32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct fontGlyphPos_s__bindgen_ty_2 { + pub left: f32, + pub top: f32, + pub right: f32, + pub bottom: f32, +} +pub const GLYPH_POS_CALC_VTXCOORD: _bindgen_ty_32 = 1; +pub const GLYPH_POS_AT_BASELINE: _bindgen_ty_32 = 2; +pub const GLYPH_POS_Y_POINTS_UP: _bindgen_ty_32 = 4; +pub type _bindgen_ty_32 = u32; +extern "C" { + pub fn fontEnsureMapped() -> Result; +} +extern "C" { + pub fn fontGlyphIndexFromCodePoint(codePoint: u32) -> ::libc::c_int; +} +extern "C" { + pub fn fontGetCharWidthInfo(glyphIndex: ::libc::c_int) -> *mut charWidthInfo_s; +} +extern "C" { + pub fn fontCalcGlyphPos( + out: *mut fontGlyphPos_s, + glyphIndex: ::libc::c_int, + flags: u32, + scaleX: f32, + scaleY: f32, + ); +} +pub type C3D_IVec = u32; +#[repr(C)] +#[derive(Copy, Clone)] +pub union C3D_FVec { + pub __bindgen_anon_1: C3D_FVec__bindgen_ty_1, + pub __bindgen_anon_2: C3D_FVec__bindgen_ty_2, + pub c: [f32; 4usize], + _bindgen_union_align: [u32; 4usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct C3D_FVec__bindgen_ty_1 { + pub w: f32, + pub z: f32, + pub y: f32, + pub x: f32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct C3D_FVec__bindgen_ty_2 { + pub r: f32, + pub k: f32, + pub j: f32, + pub i: f32, +} +pub type C3D_FQuat = C3D_FVec; +#[repr(C)] +#[derive(Copy, Clone)] +pub union C3D_Mtx { + pub r: [C3D_FVec; 4usize], + pub m: [f32; 16usize], + _bindgen_union_align: [u32; 16usize], +} +extern "C" { + pub fn atan(arg1: f64) -> f64; +} +extern "C" { + pub fn cos(arg1: f64) -> f64; +} +extern "C" { + pub fn sin(arg1: f64) -> f64; +} +extern "C" { + pub fn tan(arg1: f64) -> f64; +} +extern "C" { + pub fn tanh(arg1: f64) -> f64; +} +extern "C" { + pub fn frexp(arg1: f64, arg2: *mut ::libc::c_int) -> f64; +} +extern "C" { + pub fn modf(arg1: f64, arg2: *mut f64) -> f64; +} +extern "C" { + pub fn ceil(arg1: f64) -> f64; +} +extern "C" { + pub fn fabs(arg1: f64) -> f64; +} +extern "C" { + pub fn floor(arg1: f64) -> f64; +} +extern "C" { + pub fn acos(arg1: f64) -> f64; +} +extern "C" { + pub fn asin(arg1: f64) -> f64; +} +extern "C" { + pub fn atan2(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn cosh(arg1: f64) -> f64; +} +extern "C" { + pub fn sinh(arg1: f64) -> f64; +} +extern "C" { + pub fn exp(arg1: f64) -> f64; +} +extern "C" { + pub fn ldexp(arg1: f64, arg2: ::libc::c_int) -> f64; +} +extern "C" { + pub fn log(arg1: f64) -> f64; +} +extern "C" { + pub fn log10(arg1: f64) -> f64; +} +extern "C" { + pub fn pow(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn sqrt(arg1: f64) -> f64; +} +extern "C" { + pub fn fmod(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn finite(arg1: f64) -> ::libc::c_int; +} +extern "C" { + pub fn finitef(arg1: f32) -> ::libc::c_int; +} +extern "C" { + pub fn finitel(arg1: f64) -> ::libc::c_int; +} +extern "C" { + pub fn isinff(arg1: f32) -> ::libc::c_int; +} +extern "C" { + pub fn isnanf(arg1: f32) -> ::libc::c_int; +} +extern "C" { + pub fn isinf(arg1: f64) -> ::libc::c_int; +} +extern "C" { + pub fn isnan(arg1: f64) -> ::libc::c_int; +} +pub type float_t = f32; +pub type double_t = f64; +extern "C" { + pub fn __isinff(x: f32) -> ::libc::c_int; +} +extern "C" { + pub fn __isinfd(x: f64) -> ::libc::c_int; +} +extern "C" { + pub fn __isnanf(x: f32) -> ::libc::c_int; +} +extern "C" { + pub fn __isnand(x: f64) -> ::libc::c_int; +} +extern "C" { + pub fn __fpclassifyf(x: f32) -> ::libc::c_int; +} +extern "C" { + pub fn __fpclassifyd(x: f64) -> ::libc::c_int; +} +extern "C" { + pub fn __signbitf(x: f32) -> ::libc::c_int; +} +extern "C" { + pub fn __signbitd(x: f64) -> ::libc::c_int; +} +extern "C" { + pub fn infinity() -> f64; +} +extern "C" { + pub fn nan(arg1: *const ::libc::c_char) -> f64; +} +extern "C" { + pub fn copysign(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn logb(arg1: f64) -> f64; +} +extern "C" { + pub fn ilogb(arg1: f64) -> ::libc::c_int; +} +extern "C" { + pub fn asinh(arg1: f64) -> f64; +} +extern "C" { + pub fn cbrt(arg1: f64) -> f64; +} +extern "C" { + pub fn nextafter(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn rint(arg1: f64) -> f64; +} +extern "C" { + pub fn scalbn(arg1: f64, arg2: ::libc::c_int) -> f64; +} +extern "C" { + pub fn exp2(arg1: f64) -> f64; +} +extern "C" { + pub fn scalbln(arg1: f64, arg2: ::libc::c_long) -> f64; +} +extern "C" { + pub fn tgamma(arg1: f64) -> f64; +} +extern "C" { + pub fn nearbyint(arg1: f64) -> f64; +} +extern "C" { + pub fn lrint(arg1: f64) -> ::libc::c_long; +} +extern "C" { + pub fn llrint(arg1: f64) -> ::libc::c_longlong; +} +extern "C" { + pub fn round(arg1: f64) -> f64; +} +extern "C" { + pub fn lround(arg1: f64) -> ::libc::c_long; +} +extern "C" { + pub fn llround(arg1: f64) -> ::libc::c_longlong; +} +extern "C" { + pub fn trunc(arg1: f64) -> f64; +} +extern "C" { + pub fn remquo(arg1: f64, arg2: f64, arg3: *mut ::libc::c_int) -> f64; +} +extern "C" { + pub fn fdim(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn fmax(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn fmin(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn fma(arg1: f64, arg2: f64, arg3: f64) -> f64; +} +extern "C" { + pub fn log1p(arg1: f64) -> f64; +} +extern "C" { + pub fn expm1(arg1: f64) -> f64; +} +extern "C" { + pub fn acosh(arg1: f64) -> f64; +} +extern "C" { + pub fn atanh(arg1: f64) -> f64; +} +extern "C" { + pub fn remainder(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn gamma(arg1: f64) -> f64; +} +extern "C" { + pub fn lgamma(arg1: f64) -> f64; +} +extern "C" { + pub fn erf(arg1: f64) -> f64; +} +extern "C" { + pub fn erfc(arg1: f64) -> f64; +} +extern "C" { + pub fn log2(arg1: f64) -> f64; +} +extern "C" { + pub fn hypot(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn atanf(arg1: f32) -> f32; +} +extern "C" { + pub fn cosf(arg1: f32) -> f32; +} +extern "C" { + pub fn sinf(arg1: f32) -> f32; +} +extern "C" { + pub fn tanf(arg1: f32) -> f32; +} +extern "C" { + pub fn tanhf(arg1: f32) -> f32; +} +extern "C" { + pub fn frexpf(arg1: f32, arg2: *mut ::libc::c_int) -> f32; +} +extern "C" { + pub fn modff(arg1: f32, arg2: *mut f32) -> f32; +} +extern "C" { + pub fn ceilf(arg1: f32) -> f32; +} +extern "C" { + pub fn fabsf(arg1: f32) -> f32; +} +extern "C" { + pub fn floorf(arg1: f32) -> f32; +} +extern "C" { + pub fn acosf(arg1: f32) -> f32; +} +extern "C" { + pub fn asinf(arg1: f32) -> f32; +} +extern "C" { + pub fn atan2f(arg1: f32, arg2: f32) -> f32; +} +extern "C" { + pub fn coshf(arg1: f32) -> f32; +} +extern "C" { + pub fn sinhf(arg1: f32) -> f32; +} +extern "C" { + pub fn expf(arg1: f32) -> f32; +} +extern "C" { + pub fn ldexpf(arg1: f32, arg2: ::libc::c_int) -> f32; +} +extern "C" { + pub fn logf(arg1: f32) -> f32; +} +extern "C" { + pub fn log10f(arg1: f32) -> f32; +} +extern "C" { + pub fn powf(arg1: f32, arg2: f32) -> f32; +} +extern "C" { + pub fn sqrtf(arg1: f32) -> f32; +} +extern "C" { + pub fn fmodf(arg1: f32, arg2: f32) -> f32; +} +extern "C" { + pub fn exp2f(arg1: f32) -> f32; +} +extern "C" { + pub fn scalblnf(arg1: f32, arg2: ::libc::c_long) -> f32; +} +extern "C" { + pub fn tgammaf(arg1: f32) -> f32; +} +extern "C" { + pub fn nearbyintf(arg1: f32) -> f32; +} +extern "C" { + pub fn lrintf(arg1: f32) -> ::libc::c_long; +} +extern "C" { + pub fn llrintf(arg1: f32) -> ::libc::c_longlong; +} +extern "C" { + pub fn roundf(arg1: f32) -> f32; +} +extern "C" { + pub fn lroundf(arg1: f32) -> ::libc::c_long; +} +extern "C" { + pub fn llroundf(arg1: f32) -> ::libc::c_longlong; +} +extern "C" { + pub fn truncf(arg1: f32) -> f32; +} +extern "C" { + pub fn remquof(arg1: f32, arg2: f32, arg3: *mut ::libc::c_int) -> f32; +} +extern "C" { + pub fn fdimf(arg1: f32, arg2: f32) -> f32; +} +extern "C" { + pub fn fmaxf(arg1: f32, arg2: f32) -> f32; +} +extern "C" { + pub fn fminf(arg1: f32, arg2: f32) -> f32; +} +extern "C" { + pub fn fmaf(arg1: f32, arg2: f32, arg3: f32) -> f32; +} +extern "C" { + pub fn infinityf() -> f32; +} +extern "C" { + pub fn nanf(arg1: *const ::libc::c_char) -> f32; +} +extern "C" { + pub fn copysignf(arg1: f32, arg2: f32) -> f32; +} +extern "C" { + pub fn logbf(arg1: f32) -> f32; +} +extern "C" { + pub fn ilogbf(arg1: f32) -> ::libc::c_int; +} +extern "C" { + pub fn asinhf(arg1: f32) -> f32; +} +extern "C" { + pub fn cbrtf(arg1: f32) -> f32; +} +extern "C" { + pub fn nextafterf(arg1: f32, arg2: f32) -> f32; +} +extern "C" { + pub fn rintf(arg1: f32) -> f32; +} +extern "C" { + pub fn scalbnf(arg1: f32, arg2: ::libc::c_int) -> f32; +} +extern "C" { + pub fn log1pf(arg1: f32) -> f32; +} +extern "C" { + pub fn expm1f(arg1: f32) -> f32; +} +extern "C" { + pub fn acoshf(arg1: f32) -> f32; +} +extern "C" { + pub fn atanhf(arg1: f32) -> f32; +} +extern "C" { + pub fn remainderf(arg1: f32, arg2: f32) -> f32; +} +extern "C" { + pub fn gammaf(arg1: f32) -> f32; +} +extern "C" { + pub fn lgammaf(arg1: f32) -> f32; +} +extern "C" { + pub fn erff(arg1: f32) -> f32; +} +extern "C" { + pub fn erfcf(arg1: f32) -> f32; +} +extern "C" { + pub fn log2f(arg1: f32) -> f32; +} +extern "C" { + pub fn hypotf(arg1: f32, arg2: f32) -> f32; +} +extern "C" { + pub fn atanl(arg1: f64) -> f64; +} +extern "C" { + pub fn cosl(arg1: f64) -> f64; +} +extern "C" { + pub fn sinl(arg1: f64) -> f64; +} +extern "C" { + pub fn tanl(arg1: f64) -> f64; +} +extern "C" { + pub fn tanhl(arg1: f64) -> f64; +} +extern "C" { + pub fn frexpl(arg1: f64, arg2: *mut ::libc::c_int) -> f64; +} +extern "C" { + pub fn modfl(arg1: f64, arg2: *mut f64) -> f64; +} +extern "C" { + pub fn ceill(arg1: f64) -> f64; +} +extern "C" { + pub fn fabsl(arg1: f64) -> f64; +} +extern "C" { + pub fn floorl(arg1: f64) -> f64; +} +extern "C" { + pub fn log1pl(arg1: f64) -> f64; +} +extern "C" { + pub fn expm1l(arg1: f64) -> f64; +} +extern "C" { + pub fn acosl(arg1: f64) -> f64; +} +extern "C" { + pub fn asinl(arg1: f64) -> f64; +} +extern "C" { + pub fn atan2l(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn coshl(arg1: f64) -> f64; +} +extern "C" { + pub fn sinhl(arg1: f64) -> f64; +} +extern "C" { + pub fn expl(arg1: f64) -> f64; +} +extern "C" { + pub fn ldexpl(arg1: f64, arg2: ::libc::c_int) -> f64; +} +extern "C" { + pub fn logl(arg1: f64) -> f64; +} +extern "C" { + pub fn log10l(arg1: f64) -> f64; +} +extern "C" { + pub fn powl(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn sqrtl(arg1: f64) -> f64; +} +extern "C" { + pub fn fmodl(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn hypotl(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn copysignl(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn nanl(arg1: *const ::libc::c_char) -> f64; +} +extern "C" { + pub fn ilogbl(arg1: f64) -> ::libc::c_int; +} +extern "C" { + pub fn asinhl(arg1: f64) -> f64; +} +extern "C" { + pub fn cbrtl(arg1: f64) -> f64; +} +extern "C" { + pub fn nextafterl(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn nexttowardf(arg1: f32, arg2: f64) -> f32; +} +extern "C" { + pub fn nexttoward(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn nexttowardl(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn logbl(arg1: f64) -> f64; +} +extern "C" { + pub fn log2l(arg1: f64) -> f64; +} +extern "C" { + pub fn rintl(arg1: f64) -> f64; +} +extern "C" { + pub fn scalbnl(arg1: f64, arg2: ::libc::c_int) -> f64; +} +extern "C" { + pub fn exp2l(arg1: f64) -> f64; +} +extern "C" { + pub fn scalblnl(arg1: f64, arg2: ::libc::c_long) -> f64; +} +extern "C" { + pub fn tgammal(arg1: f64) -> f64; +} +extern "C" { + pub fn nearbyintl(arg1: f64) -> f64; +} +extern "C" { + pub fn lrintl(arg1: f64) -> ::libc::c_long; +} +extern "C" { + pub fn llrintl(arg1: f64) -> ::libc::c_longlong; +} +extern "C" { + pub fn roundl(arg1: f64) -> f64; +} +extern "C" { + pub fn lroundl(arg1: f64) -> ::libc::c_long; +} +extern "C" { + pub fn llroundl(arg1: f64) -> ::libc::c_longlong; +} +extern "C" { + pub fn truncl(arg1: f64) -> f64; +} +extern "C" { + pub fn remquol(arg1: f64, arg2: f64, arg3: *mut ::libc::c_int) -> f64; +} +extern "C" { + pub fn fdiml(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn fmaxl(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn fminl(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn fmal(arg1: f64, arg2: f64, arg3: f64) -> f64; +} +extern "C" { + pub fn acoshl(arg1: f64) -> f64; +} +extern "C" { + pub fn atanhl(arg1: f64) -> f64; +} +extern "C" { + pub fn remainderl(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn lgammal(arg1: f64) -> f64; +} +extern "C" { + pub fn erfl(arg1: f64) -> f64; +} +extern "C" { + pub fn erfcl(arg1: f64) -> f64; +} +extern "C" { + pub fn drem(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn dremf(arg1: f32, arg2: f32) -> f32; +} +extern "C" { + pub fn gamma_r(arg1: f64, arg2: *mut ::libc::c_int) -> f64; +} +extern "C" { + pub fn lgamma_r(arg1: f64, arg2: *mut ::libc::c_int) -> f64; +} +extern "C" { + pub fn gammaf_r(arg1: f32, arg2: *mut ::libc::c_int) -> f32; +} +extern "C" { + pub fn lgammaf_r(arg1: f32, arg2: *mut ::libc::c_int) -> f32; +} +extern "C" { + pub fn y0(arg1: f64) -> f64; +} +extern "C" { + pub fn y1(arg1: f64) -> f64; +} +extern "C" { + pub fn yn(arg1: ::libc::c_int, arg2: f64) -> f64; +} +extern "C" { + pub fn j0(arg1: f64) -> f64; +} +extern "C" { + pub fn j1(arg1: f64) -> f64; +} +extern "C" { + pub fn jn(arg1: ::libc::c_int, arg2: f64) -> f64; +} +extern "C" { + pub fn y0f(arg1: f32) -> f32; +} +extern "C" { + pub fn y1f(arg1: f32) -> f32; +} +extern "C" { + pub fn ynf(arg1: ::libc::c_int, arg2: f32) -> f32; +} +extern "C" { + pub fn j0f(arg1: f32) -> f32; +} +extern "C" { + pub fn j1f(arg1: f32) -> f32; +} +extern "C" { + pub fn jnf(arg1: ::libc::c_int, arg2: f32) -> f32; +} +extern "C" { + pub fn __signgam() -> *mut ::libc::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct exception { + pub type_: ::libc::c_int, + pub name: *mut ::libc::c_char, + pub arg1: f64, + pub arg2: f64, + pub retval: f64, + pub err: ::libc::c_int, + pub __bindgen_padding_0: u32, +} +extern "C" { + pub fn matherr(e: *mut exception) -> ::libc::c_int; +} +pub const __fdlibm_ieee: __fdlibm_version = -1; +pub const __fdlibm_svid: __fdlibm_version = 0; +pub const __fdlibm_xopen: __fdlibm_version = 1; +pub const __fdlibm_posix: __fdlibm_version = 2; +pub type __fdlibm_version = i32; +extern "C" { + pub static mut __fdlib_version: __fdlibm_version; +} +extern "C" { + pub fn bcmp( + arg1: *const ::libc::c_void, + arg2: *const ::libc::c_void, + arg3: usize, + ) -> ::libc::c_int; +} +extern "C" { + pub fn bcopy(arg1: *const ::libc::c_void, arg2: *mut ::libc::c_void, arg3: usize); +} +extern "C" { + pub fn bzero(arg1: *mut ::libc::c_void, arg2: ::libc::c_uint); +} +extern "C" { + pub fn explicit_bzero(arg1: *mut ::libc::c_void, arg2: usize); +} +extern "C" { + pub fn ffs(arg1: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn ffsl(arg1: ::libc::c_long) -> ::libc::c_int; +} +extern "C" { + pub fn ffsll(arg1: ::libc::c_longlong) -> ::libc::c_int; +} +extern "C" { + pub fn fls(arg1: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn flsl(arg1: ::libc::c_long) -> ::libc::c_int; +} +extern "C" { + pub fn flsll(arg1: ::libc::c_longlong) -> ::libc::c_int; +} +extern "C" { + pub fn index(arg1: *const ::libc::c_char, arg2: ::libc::c_int) -> *mut ::libc::c_char; +} +extern "C" { + pub fn rindex(arg1: *const ::libc::c_char, arg2: ::libc::c_int) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strcasecmp(arg1: *const ::libc::c_char, arg2: *const ::libc::c_char) -> ::libc::c_int; +} +extern "C" { + pub fn strncasecmp( + arg1: *const ::libc::c_char, + arg2: *const ::libc::c_char, + arg3: ::libc::c_uint, + ) -> ::libc::c_int; +} +extern "C" { + pub fn strcasecmp_l( + arg1: *const ::libc::c_char, + arg2: *const ::libc::c_char, + arg3: locale_t, + ) -> ::libc::c_int; +} +extern "C" { + pub fn strncasecmp_l( + arg1: *const ::libc::c_char, + arg2: *const ::libc::c_char, + arg3: usize, + arg4: locale_t, + ) -> ::libc::c_int; +} +extern "C" { + pub fn memchr( + arg1: *const ::libc::c_void, + arg2: ::libc::c_int, + arg3: ::libc::c_uint, + ) -> *mut ::libc::c_void; +} +extern "C" { + pub fn memcmp( + arg1: *const ::libc::c_void, + arg2: *const ::libc::c_void, + arg3: ::libc::c_uint, + ) -> ::libc::c_int; +} +extern "C" { + pub fn memcpy( + arg1: *mut ::libc::c_void, + arg2: *const ::libc::c_void, + arg3: ::libc::c_uint, + ) -> *mut ::libc::c_void; +} +extern "C" { + pub fn memmove( + arg1: *mut ::libc::c_void, + arg2: *const ::libc::c_void, + arg3: ::libc::c_uint, + ) -> *mut ::libc::c_void; +} +extern "C" { + pub fn memset( + arg1: *mut ::libc::c_void, + arg2: ::libc::c_int, + arg3: ::libc::c_uint, + ) -> *mut ::libc::c_void; +} +extern "C" { + pub fn strcat(arg1: *mut ::libc::c_char, arg2: *const ::libc::c_char) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strchr(arg1: *const ::libc::c_char, arg2: ::libc::c_int) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strcmp(arg1: *const ::libc::c_char, arg2: *const ::libc::c_char) -> ::libc::c_int; +} +extern "C" { + pub fn strcoll(arg1: *const ::libc::c_char, arg2: *const ::libc::c_char) -> ::libc::c_int; +} +extern "C" { + pub fn strcpy(arg1: *mut ::libc::c_char, arg2: *const ::libc::c_char) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strcspn(arg1: *const ::libc::c_char, arg2: *const ::libc::c_char) -> ::libc::c_uint; +} +extern "C" { + pub fn strerror(arg1: ::libc::c_int) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strlen(arg1: *const ::libc::c_char) -> ::libc::c_uint; +} +extern "C" { + pub fn strncat( + arg1: *mut ::libc::c_char, + arg2: *const ::libc::c_char, + arg3: ::libc::c_uint, + ) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strncmp( + arg1: *const ::libc::c_char, + arg2: *const ::libc::c_char, + arg3: ::libc::c_uint, + ) -> ::libc::c_int; +} +extern "C" { + pub fn strncpy( + arg1: *mut ::libc::c_char, + arg2: *const ::libc::c_char, + arg3: ::libc::c_uint, + ) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strpbrk(arg1: *const ::libc::c_char, arg2: *const ::libc::c_char) + -> *mut ::libc::c_char; +} +extern "C" { + pub fn strrchr(arg1: *const ::libc::c_char, arg2: ::libc::c_int) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strspn(arg1: *const ::libc::c_char, arg2: *const ::libc::c_char) -> ::libc::c_uint; +} +extern "C" { + pub fn strstr(arg1: *const ::libc::c_char, arg2: *const ::libc::c_char) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strtok(arg1: *mut ::libc::c_char, arg2: *const ::libc::c_char) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strxfrm( + arg1: *mut ::libc::c_char, + arg2: *const ::libc::c_char, + arg3: ::libc::c_uint, + ) -> ::libc::c_uint; +} +extern "C" { + pub fn strcoll_l( + arg1: *const ::libc::c_char, + arg2: *const ::libc::c_char, + arg3: locale_t, + ) -> ::libc::c_int; +} +extern "C" { + pub fn strerror_l(arg1: ::libc::c_int, arg2: locale_t) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strxfrm_l( + arg1: *mut ::libc::c_char, + arg2: *const ::libc::c_char, + arg3: usize, + arg4: locale_t, + ) -> usize; +} +extern "C" { + pub fn strtok_r( + arg1: *mut ::libc::c_char, + arg2: *const ::libc::c_char, + arg3: *mut *mut ::libc::c_char, + ) -> *mut ::libc::c_char; +} +extern "C" { + pub fn timingsafe_bcmp( + arg1: *const ::libc::c_void, + arg2: *const ::libc::c_void, + arg3: usize, + ) -> ::libc::c_int; +} +extern "C" { + pub fn timingsafe_memcmp( + arg1: *const ::libc::c_void, + arg2: *const ::libc::c_void, + arg3: usize, + ) -> ::libc::c_int; +} +extern "C" { + pub fn memccpy( + arg1: *mut ::libc::c_void, + arg2: *const ::libc::c_void, + arg3: ::libc::c_int, + arg4: usize, + ) -> *mut ::libc::c_void; +} +extern "C" { + pub fn stpcpy(arg1: *mut ::libc::c_char, arg2: *const ::libc::c_char) -> *mut ::libc::c_char; +} +extern "C" { + pub fn stpncpy( + arg1: *mut ::libc::c_char, + arg2: *const ::libc::c_char, + arg3: ::libc::c_uint, + ) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strdup(arg1: *const ::libc::c_char) -> *mut ::libc::c_char; +} +extern "C" { + pub fn _strdup_r(arg1: *mut _reent, arg2: *const ::libc::c_char) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strndup(arg1: *const ::libc::c_char, arg2: ::libc::c_uint) -> *mut ::libc::c_char; +} +extern "C" { + pub fn _strndup_r( + arg1: *mut _reent, + arg2: *const ::libc::c_char, + arg3: usize, + ) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strerror_r(arg1: ::libc::c_int, arg2: *mut ::libc::c_char, arg3: usize) + -> ::libc::c_int; +} +extern "C" { + pub fn _strerror_r( + arg1: *mut _reent, + arg2: ::libc::c_int, + arg3: ::libc::c_int, + arg4: *mut ::libc::c_int, + ) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strlcat( + arg1: *mut ::libc::c_char, + arg2: *const ::libc::c_char, + arg3: ::libc::c_uint, + ) -> ::libc::c_uint; +} +extern "C" { + pub fn strlcpy( + arg1: *mut ::libc::c_char, + arg2: *const ::libc::c_char, + arg3: ::libc::c_uint, + ) -> ::libc::c_uint; +} +extern "C" { + pub fn strnlen(arg1: *const ::libc::c_char, arg2: usize) -> usize; +} +extern "C" { + pub fn strsep( + arg1: *mut *mut ::libc::c_char, + arg2: *const ::libc::c_char, + ) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strnstr( + arg1: *const ::libc::c_char, + arg2: *const ::libc::c_char, + arg3: usize, + ) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strlwr(arg1: *mut ::libc::c_char) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strupr(arg1: *mut ::libc::c_char) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strsignal(__signo: ::libc::c_int) -> *mut ::libc::c_char; +} +extern "C" { + pub fn Mtx_Transpose(out: *mut C3D_Mtx); +} +extern "C" { + pub fn Mtx_Multiply(out: *mut C3D_Mtx, a: *const C3D_Mtx, b: *const C3D_Mtx); +} +extern "C" { + pub fn Mtx_Inverse(out: *mut C3D_Mtx) -> f32; +} +extern "C" { + pub fn Mtx_MultiplyFVec3(mtx: *const C3D_Mtx, v: C3D_FVec) -> C3D_FVec; +} +extern "C" { + pub fn Mtx_MultiplyFVec4(mtx: *const C3D_Mtx, v: C3D_FVec) -> C3D_FVec; +} +extern "C" { + pub fn Mtx_FromQuat(m: *mut C3D_Mtx, q: C3D_FQuat); +} +extern "C" { + pub fn Mtx_Translate(mtx: *mut C3D_Mtx, x: f32, y: f32, z: f32, bRightSide: bool); +} +extern "C" { + pub fn Mtx_Scale(mtx: *mut C3D_Mtx, x: f32, y: f32, z: f32); +} +extern "C" { + pub fn Mtx_Rotate(mtx: *mut C3D_Mtx, axis: C3D_FVec, angle: f32, bRightSide: bool); +} +extern "C" { + pub fn Mtx_RotateX(mtx: *mut C3D_Mtx, angle: f32, bRightSide: bool); +} +extern "C" { + pub fn Mtx_RotateY(mtx: *mut C3D_Mtx, angle: f32, bRightSide: bool); +} +extern "C" { + pub fn Mtx_RotateZ(mtx: *mut C3D_Mtx, angle: f32, bRightSide: bool); +} +extern "C" { + pub fn Mtx_Ortho( + mtx: *mut C3D_Mtx, + left: f32, + right: f32, + bottom: f32, + top: f32, + near: f32, + far: f32, + isLeftHanded: bool, + ); +} +extern "C" { + pub fn Mtx_Persp( + mtx: *mut C3D_Mtx, + fovy: f32, + aspect: f32, + near: f32, + far: f32, + isLeftHanded: bool, + ); +} +extern "C" { + pub fn Mtx_PerspStereo( + mtx: *mut C3D_Mtx, + fovy: f32, + aspect: f32, + near: f32, + far: f32, + iod: f32, + screen: f32, + isLeftHanded: bool, + ); +} +extern "C" { + pub fn Mtx_OrthoTilt( + mtx: *mut C3D_Mtx, + left: f32, + right: f32, + bottom: f32, + top: f32, + near: f32, + far: f32, + isLeftHanded: bool, + ); +} +extern "C" { + pub fn Mtx_PerspTilt( + mtx: *mut C3D_Mtx, + fovy: f32, + aspect: f32, + near: f32, + far: f32, + isLeftHanded: bool, + ); +} +extern "C" { + pub fn Mtx_PerspStereoTilt( + mtx: *mut C3D_Mtx, + fovy: f32, + aspect: f32, + near: f32, + far: f32, + iod: f32, + screen: f32, + isLeftHanded: bool, + ); +} +extern "C" { + pub fn Mtx_LookAt( + out: *mut C3D_Mtx, + cameraPosition: C3D_FVec, + cameraTarget: C3D_FVec, + cameraUpVector: C3D_FVec, + isLeftHanded: bool, + ); +} +extern "C" { + pub fn Quat_Multiply(lhs: C3D_FQuat, rhs: C3D_FQuat) -> C3D_FQuat; +} +extern "C" { + pub fn Quat_Pow(q: C3D_FQuat, p: f32) -> C3D_FQuat; +} +extern "C" { + pub fn Quat_CrossFVec3(q: C3D_FQuat, v: C3D_FVec) -> C3D_FVec; +} +extern "C" { + pub fn Quat_Rotate(q: C3D_FQuat, axis: C3D_FVec, r: f32, bRightSide: bool) -> C3D_FQuat; +} +extern "C" { + pub fn Quat_RotateX(q: C3D_FQuat, r: f32, bRightSide: bool) -> C3D_FQuat; +} +extern "C" { + pub fn Quat_RotateY(q: C3D_FQuat, r: f32, bRightSide: bool) -> C3D_FQuat; +} +extern "C" { + pub fn Quat_RotateZ(q: C3D_FQuat, r: f32, bRightSide: bool) -> C3D_FQuat; +} +extern "C" { + pub fn Quat_FromMtx(m: *const C3D_Mtx) -> C3D_FQuat; +} +extern "C" { + pub fn Quat_FromPitchYawRoll(pitch: f32, yaw: f32, roll: f32, bRightSide: bool) -> C3D_FQuat; +} +extern "C" { + pub fn Quat_LookAt( + source: C3D_FVec, + target: C3D_FVec, + forwardVector: C3D_FVec, + upVector: C3D_FVec, + ) -> C3D_FQuat; +} +extern "C" { + pub fn Quat_FromAxisAngle(axis: C3D_FVec, angle: f32) -> C3D_FQuat; +} +#[repr(C)] +pub struct C3D_MtxStack { + pub m: [C3D_Mtx; 8usize], + pub pos: ::libc::c_int, + pub unifType: u8, + pub unifPos: u8, + pub unifLen: u8, + pub isDirty: bool, +} +extern "C" { + pub fn MtxStack_Init(stk: *mut C3D_MtxStack); +} +extern "C" { + pub fn MtxStack_Bind( + stk: *mut C3D_MtxStack, + unifType: GPU_SHADER_TYPE, + unifPos: ::libc::c_int, + unifLen: ::libc::c_int, + ); +} +extern "C" { + pub fn MtxStack_Push(stk: *mut C3D_MtxStack) -> *mut C3D_Mtx; +} +extern "C" { + pub fn MtxStack_Pop(stk: *mut C3D_MtxStack) -> *mut C3D_Mtx; +} +extern "C" { + pub fn MtxStack_Update(stk: *mut C3D_MtxStack); +} +extern "C" { + pub static mut C3D_FVUnif: [[C3D_FVec; 96usize]; 2usize]; +} +extern "C" { + pub static mut C3D_IVUnif: [[C3D_IVec; 4usize]; 2usize]; +} +extern "C" { + pub static mut C3D_BoolUnifs: [u16; 2usize]; +} +extern "C" { + pub static mut C3D_FVUnifDirty: [[bool; 96usize]; 2usize]; +} +extern "C" { + pub static mut C3D_IVUnifDirty: [[bool; 4usize]; 2usize]; +} +extern "C" { + pub static mut C3D_BoolUnifsDirty: [bool; 2usize]; +} +extern "C" { + pub fn C3D_UpdateUniforms(type_: GPU_SHADER_TYPE); +} +#[repr(C)] +pub struct C3D_AttrInfo { + pub flags: [u32; 2usize], + pub permutation: u64, + pub attrCount: ::libc::c_int, + pub __bindgen_padding_0: u32, +} +extern "C" { + pub fn AttrInfo_Init(info: *mut C3D_AttrInfo); +} +extern "C" { + pub fn AttrInfo_AddLoader( + info: *mut C3D_AttrInfo, + regId: ::libc::c_int, + format: GPU_FORMATS, + count: ::libc::c_int, + ) -> ::libc::c_int; +} +extern "C" { + pub fn AttrInfo_AddFixed(info: *mut C3D_AttrInfo, regId: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn C3D_GetAttrInfo() -> *mut C3D_AttrInfo; +} +extern "C" { + pub fn C3D_SetAttrInfo(info: *mut C3D_AttrInfo); +} +#[repr(C)] +pub struct C3D_BufCfg { + pub offset: u32, + pub flags: [u32; 2usize], +} +#[repr(C)] +pub struct C3D_BufInfo { + pub base_paddr: u32, + pub bufCount: ::libc::c_int, + pub buffers: [C3D_BufCfg; 12usize], +} +extern "C" { + pub fn BufInfo_Init(info: *mut C3D_BufInfo); +} +extern "C" { + pub fn BufInfo_Add( + info: *mut C3D_BufInfo, + data: *const ::libc::c_void, + stride: isize, + attribCount: ::libc::c_int, + permutation: u64, + ) -> ::libc::c_int; +} +extern "C" { + pub fn C3D_GetBufInfo() -> *mut C3D_BufInfo; +} +extern "C" { + pub fn C3D_SetBufInfo(info: *mut C3D_BufInfo); +} +pub const C3D_UNSIGNED_BYTE: _bindgen_ty_33 = 0; +pub const C3D_UNSIGNED_SHORT: _bindgen_ty_33 = 1; +pub type _bindgen_ty_33 = u32; +extern "C" { + pub fn C3D_Init(cmdBufSize: usize) -> bool; +} +extern "C" { + pub fn C3D_FlushAsync(); +} +extern "C" { + pub fn C3D_Fini(); +} +extern "C" { + pub fn C3D_GetCmdBufUsage() -> f32; +} +extern "C" { + pub fn C3D_BindProgram(program: *mut shaderProgram_s); +} +extern "C" { + pub fn C3D_SetViewport(x: u32, y: u32, w: u32, h: u32); +} +extern "C" { + pub fn C3D_SetScissor(mode: GPU_SCISSORMODE, left: u32, top: u32, right: u32, bottom: u32); +} +extern "C" { + pub fn C3D_DrawArrays(primitive: GPU_Primitive_t, first: ::libc::c_int, size: ::libc::c_int); +} +extern "C" { + pub fn C3D_DrawElements( + primitive: GPU_Primitive_t, + count: ::libc::c_int, + type_: ::libc::c_int, + indices: *const ::libc::c_void, + ); +} +extern "C" { + pub fn C3D_ImmDrawBegin(primitive: GPU_Primitive_t); +} +extern "C" { + pub fn C3D_ImmSendAttrib(x: f32, y: f32, z: f32, w: f32); +} +extern "C" { + pub fn C3D_ImmDrawEnd(); +} +extern "C" { + pub fn C3D_FixedAttribGetWritePtr(id: ::libc::c_int) -> *mut C3D_FVec; +} +#[repr(C)] +pub struct C3D_TexEnv { + pub srcRgb: u16, + pub srcAlpha: u16, + pub __bindgen_anon_1: C3D_TexEnv__bindgen_ty_1, + pub funcRgb: u16, + pub funcAlpha: u16, + pub color: u32, + pub scaleRgb: u16, + pub scaleAlpha: u16, +} +#[repr(C)] +pub struct C3D_TexEnv__bindgen_ty_1 { + pub opAll: __BindgenUnionField, + pub __bindgen_anon_1: __BindgenUnionField, + pub bindgen_union_field: u32, +} +#[repr(C)] +#[repr(align(4))] +pub struct C3D_TexEnv__bindgen_ty_1__bindgen_ty_1 { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u16>, +} +impl C3D_TexEnv__bindgen_ty_1__bindgen_ty_1 { + #[inline] + pub fn opRgb(&self) -> u32 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 12u8) as u32) } + } + #[inline] + pub fn set_opRgb(&mut self, val: u32) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(0usize, 12u8, val as u64) + } + } + #[inline] + pub fn opAlpha(&self) -> u32 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 12u8) as u32) } + } + #[inline] + pub fn set_opAlpha(&mut self, val: u32) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(12usize, 12u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1(opRgb: u32, opAlpha: u32) -> __BindgenBitfieldUnit<[u8; 4usize], u16> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u16> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 12u8, { + let opRgb: u32 = unsafe { ::core::mem::transmute(opRgb) }; + opRgb as u64 + }); + __bindgen_bitfield_unit.set(12usize, 12u8, { + let opAlpha: u32 = unsafe { ::core::mem::transmute(opAlpha) }; + opAlpha as u64 + }); + __bindgen_bitfield_unit + } +} +pub const C3D_RGB: C3D_TexEnvMode = 1; +pub const C3D_Alpha: C3D_TexEnvMode = 2; +pub const C3D_Both: C3D_TexEnvMode = 3; +pub type C3D_TexEnvMode = u32; +extern "C" { + pub fn C3D_GetTexEnv(id: ::libc::c_int) -> *mut C3D_TexEnv; +} +extern "C" { + pub fn C3D_SetTexEnv(id: ::libc::c_int, env: *mut C3D_TexEnv); +} +extern "C" { + pub fn C3D_DirtyTexEnv(env: *mut C3D_TexEnv); +} +extern "C" { + pub fn C3D_TexEnvBufUpdate(mode: ::libc::c_int, mask: ::libc::c_int); +} +extern "C" { + pub fn C3D_TexEnvBufColor(color: u32); +} +extern "C" { + pub fn C3D_DepthMap(bIsZBuffer: bool, zScale: f32, zOffset: f32); +} +extern "C" { + pub fn C3D_CullFace(mode: GPU_CULLMODE); +} +extern "C" { + pub fn C3D_StencilTest( + enable: bool, + function: GPU_TESTFUNC, + ref_: ::libc::c_int, + inputMask: ::libc::c_int, + writeMask: ::libc::c_int, + ); +} +extern "C" { + pub fn C3D_StencilOp(sfail: GPU_STENCILOP, dfail: GPU_STENCILOP, pass: GPU_STENCILOP); +} +extern "C" { + pub fn C3D_BlendingColor(color: u32); +} +extern "C" { + pub fn C3D_EarlyDepthTest(enable: bool, function: GPU_EARLYDEPTHFUNC, ref_: u32); +} +extern "C" { + pub fn C3D_DepthTest(enable: bool, function: GPU_TESTFUNC, writemask: GPU_WRITEMASK); +} +extern "C" { + pub fn C3D_AlphaTest(enable: bool, function: GPU_TESTFUNC, ref_: ::libc::c_int); +} +extern "C" { + pub fn C3D_AlphaBlend( + colorEq: GPU_BLENDEQUATION, + alphaEq: GPU_BLENDEQUATION, + srcClr: GPU_BLENDFACTOR, + dstClr: GPU_BLENDFACTOR, + srcAlpha: GPU_BLENDFACTOR, + dstAlpha: GPU_BLENDFACTOR, + ); +} +extern "C" { + pub fn C3D_ColorLogicOp(op: GPU_LOGICOP); +} +extern "C" { + pub fn C3D_FragOpMode(mode: GPU_FRAGOPMODE); +} +extern "C" { + pub fn C3D_FragOpShadow(scale: f32, bias: f32); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct C3D_TexCube { + pub data: [*mut ::libc::c_void; 6usize], +} +#[repr(C)] +pub struct C3D_Tex { + pub __bindgen_anon_1: C3D_Tex__bindgen_ty_1, + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>, + pub __bindgen_anon_2: C3D_Tex__bindgen_ty_2, + pub param: u32, + pub border: u32, + pub __bindgen_anon_3: C3D_Tex__bindgen_ty_3, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union C3D_Tex__bindgen_ty_1 { + pub data: *mut ::libc::c_void, + pub cube: *mut C3D_TexCube, + _bindgen_union_align: u32, +} +#[repr(C)] +pub struct C3D_Tex__bindgen_ty_2 { + pub dim: __BindgenUnionField, + pub __bindgen_anon_1: __BindgenUnionField, + pub bindgen_union_field: u32, +} +#[repr(C)] +pub struct C3D_Tex__bindgen_ty_2__bindgen_ty_1 { + pub height: u16, + pub width: u16, +} +#[repr(C)] +pub struct C3D_Tex__bindgen_ty_3 { + pub lodParam: __BindgenUnionField, + pub __bindgen_anon_1: __BindgenUnionField, + pub bindgen_union_field: u32, +} +#[repr(C)] +pub struct C3D_Tex__bindgen_ty_3__bindgen_ty_1 { + pub lodBias: u16, + pub maxLevel: u8, + pub minLevel: u8, +} +impl C3D_Tex { + #[inline] + pub fn fmt(&self) -> GPU_TEXCOLOR { + unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u32) } + } + #[inline] + pub fn set_fmt(&mut self, val: GPU_TEXCOLOR) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(0usize, 4u8, val as u64) + } + } + #[inline] + pub fn size(&self) -> usize { + unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 28u8) as u32) } + } + #[inline] + pub fn set_size(&mut self, val: usize) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(4usize, 28u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + fmt: GPU_TEXCOLOR, + size: usize, + ) -> __BindgenBitfieldUnit<[u8; 4usize], u32> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u32> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 4u8, { + let fmt: u32 = unsafe { ::core::mem::transmute(fmt) }; + fmt as u64 + }); + __bindgen_bitfield_unit.set(4usize, 28u8, { + let size: u32 = unsafe { ::core::mem::transmute(size) }; + size as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +#[repr(align(8))] +pub struct C3D_TexInitParams { + pub width: u16, + pub height: u16, + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize], u8>, + pub __bindgen_padding_0: u16, +} +impl C3D_TexInitParams { + #[inline] + pub fn maxLevel(&self) -> u8 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) } + } + #[inline] + pub fn set_maxLevel(&mut self, val: u8) { + unsafe { + let val: u8 = ::core::mem::transmute(val); + self._bitfield_1.set(0usize, 4u8, val as u64) + } + } + #[inline] + pub fn format(&self) -> GPU_TEXCOLOR { + unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u32) } + } + #[inline] + pub fn set_format(&mut self, val: GPU_TEXCOLOR) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(4usize, 4u8, val as u64) + } + } + #[inline] + pub fn type_(&self) -> GPU_TEXTURE_MODE_PARAM { + unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 3u8) as u32) } + } + #[inline] + pub fn set_type(&mut self, val: GPU_TEXTURE_MODE_PARAM) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(8usize, 3u8, val as u64) + } + } + #[inline] + pub fn onVram(&self) -> bool { + unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u8) } + } + #[inline] + pub fn set_onVram(&mut self, val: bool) { + unsafe { + let val: u8 = ::core::mem::transmute(val); + self._bitfield_1.set(11usize, 1u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + maxLevel: u8, + format: GPU_TEXCOLOR, + type_: GPU_TEXTURE_MODE_PARAM, + onVram: bool, + ) -> __BindgenBitfieldUnit<[u8; 2usize], u8> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize], u8> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 4u8, { + let maxLevel: u8 = unsafe { ::core::mem::transmute(maxLevel) }; + maxLevel as u64 + }); + __bindgen_bitfield_unit.set(4usize, 4u8, { + let format: u32 = unsafe { ::core::mem::transmute(format) }; + format as u64 + }); + __bindgen_bitfield_unit.set(8usize, 3u8, { + let type_: u32 = unsafe { ::core::mem::transmute(type_) }; + type_ as u64 + }); + __bindgen_bitfield_unit.set(11usize, 1u8, { + let onVram: u8 = unsafe { ::core::mem::transmute(onVram) }; + onVram as u64 + }); + __bindgen_bitfield_unit + } +} +extern "C" { + pub fn C3D_TexInitWithParams( + tex: *mut C3D_Tex, + cube: *mut C3D_TexCube, + p: C3D_TexInitParams, + ) -> bool; +} +extern "C" { + pub fn C3D_TexLoadImage( + tex: *mut C3D_Tex, + data: *const ::libc::c_void, + face: GPU_TEXFACE, + level: ::libc::c_int, + ); +} +extern "C" { + pub fn C3D_TexGenerateMipmap(tex: *mut C3D_Tex, face: GPU_TEXFACE); +} +extern "C" { + pub fn C3D_TexBind(unitId: ::libc::c_int, tex: *mut C3D_Tex); +} +extern "C" { + pub fn C3D_TexFlush(tex: *mut C3D_Tex); +} +extern "C" { + pub fn C3D_TexDelete(tex: *mut C3D_Tex); +} +extern "C" { + pub fn C3D_TexShadowParams(perspective: bool, bias: f32); +} +#[repr(C)] +pub struct C3D_ProcTexColorLut { + pub color: [u32; 256usize], + pub diff: [u32; 256usize], +} +#[repr(C)] +pub struct C3D_ProcTex { + pub __bindgen_anon_1: C3D_ProcTex__bindgen_ty_1, + pub __bindgen_anon_2: C3D_ProcTex__bindgen_ty_2, + pub __bindgen_anon_3: C3D_ProcTex__bindgen_ty_3, + pub __bindgen_anon_4: C3D_ProcTex__bindgen_ty_4, + pub __bindgen_anon_5: C3D_ProcTex__bindgen_ty_5, + pub __bindgen_anon_6: C3D_ProcTex__bindgen_ty_6, +} +#[repr(C)] +pub struct C3D_ProcTex__bindgen_ty_1 { + pub proctex0: __BindgenUnionField, + pub __bindgen_anon_1: __BindgenUnionField, + pub bindgen_union_field: u32, +} +#[repr(C)] +#[repr(align(4))] +pub struct C3D_ProcTex__bindgen_ty_1__bindgen_ty_1 { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u8>, +} +impl C3D_ProcTex__bindgen_ty_1__bindgen_ty_1 { + #[inline] + pub fn uClamp(&self) -> u32 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 3u8) as u32) } + } + #[inline] + pub fn set_uClamp(&mut self, val: u32) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(0usize, 3u8, val as u64) + } + } + #[inline] + pub fn vClamp(&self) -> u32 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 3u8) as u32) } + } + #[inline] + pub fn set_vClamp(&mut self, val: u32) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(3usize, 3u8, val as u64) + } + } + #[inline] + pub fn rgbFunc(&self) -> u32 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(6usize, 4u8) as u32) } + } + #[inline] + pub fn set_rgbFunc(&mut self, val: u32) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(6usize, 4u8, val as u64) + } + } + #[inline] + pub fn alphaFunc(&self) -> u32 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 4u8) as u32) } + } + #[inline] + pub fn set_alphaFunc(&mut self, val: u32) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(10usize, 4u8, val as u64) + } + } + #[inline] + pub fn alphaSeparate(&self) -> bool { + unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u8) } + } + #[inline] + pub fn set_alphaSeparate(&mut self, val: bool) { + unsafe { + let val: u8 = ::core::mem::transmute(val); + self._bitfield_1.set(14usize, 1u8, val as u64) + } + } + #[inline] + pub fn enableNoise(&self) -> bool { + unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u8) } + } + #[inline] + pub fn set_enableNoise(&mut self, val: bool) { + unsafe { + let val: u8 = ::core::mem::transmute(val); + self._bitfield_1.set(15usize, 1u8, val as u64) + } + } + #[inline] + pub fn uShift(&self) -> u32 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(16usize, 2u8) as u32) } + } + #[inline] + pub fn set_uShift(&mut self, val: u32) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(16usize, 2u8, val as u64) + } + } + #[inline] + pub fn vShift(&self) -> u32 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(18usize, 2u8) as u32) } + } + #[inline] + pub fn set_vShift(&mut self, val: u32) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(18usize, 2u8, val as u64) + } + } + #[inline] + pub fn lodBiasLow(&self) -> u32 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(20usize, 8u8) as u32) } + } + #[inline] + pub fn set_lodBiasLow(&mut self, val: u32) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(20usize, 8u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + uClamp: u32, + vClamp: u32, + rgbFunc: u32, + alphaFunc: u32, + alphaSeparate: bool, + enableNoise: bool, + uShift: u32, + vShift: u32, + lodBiasLow: u32, + ) -> __BindgenBitfieldUnit<[u8; 4usize], u8> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u8> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 3u8, { + let uClamp: u32 = unsafe { ::core::mem::transmute(uClamp) }; + uClamp as u64 + }); + __bindgen_bitfield_unit.set(3usize, 3u8, { + let vClamp: u32 = unsafe { ::core::mem::transmute(vClamp) }; + vClamp as u64 + }); + __bindgen_bitfield_unit.set(6usize, 4u8, { + let rgbFunc: u32 = unsafe { ::core::mem::transmute(rgbFunc) }; + rgbFunc as u64 + }); + __bindgen_bitfield_unit.set(10usize, 4u8, { + let alphaFunc: u32 = unsafe { ::core::mem::transmute(alphaFunc) }; + alphaFunc as u64 + }); + __bindgen_bitfield_unit.set(14usize, 1u8, { + let alphaSeparate: u8 = unsafe { ::core::mem::transmute(alphaSeparate) }; + alphaSeparate as u64 + }); + __bindgen_bitfield_unit.set(15usize, 1u8, { + let enableNoise: u8 = unsafe { ::core::mem::transmute(enableNoise) }; + enableNoise as u64 + }); + __bindgen_bitfield_unit.set(16usize, 2u8, { + let uShift: u32 = unsafe { ::core::mem::transmute(uShift) }; + uShift as u64 + }); + __bindgen_bitfield_unit.set(18usize, 2u8, { + let vShift: u32 = unsafe { ::core::mem::transmute(vShift) }; + vShift as u64 + }); + __bindgen_bitfield_unit.set(20usize, 8u8, { + let lodBiasLow: u32 = unsafe { ::core::mem::transmute(lodBiasLow) }; + lodBiasLow as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +pub struct C3D_ProcTex__bindgen_ty_2 { + pub proctex1: __BindgenUnionField, + pub __bindgen_anon_1: __BindgenUnionField, + pub bindgen_union_field: u32, +} +#[repr(C)] +pub struct C3D_ProcTex__bindgen_ty_2__bindgen_ty_1 { + pub uNoiseAmpl: u16, + pub uNoisePhase: u16, +} +#[repr(C)] +pub struct C3D_ProcTex__bindgen_ty_3 { + pub proctex2: __BindgenUnionField, + pub __bindgen_anon_1: __BindgenUnionField, + pub bindgen_union_field: u32, +} +#[repr(C)] +pub struct C3D_ProcTex__bindgen_ty_3__bindgen_ty_1 { + pub vNoiseAmpl: u16, + pub vNoisePhase: u16, +} +#[repr(C)] +pub struct C3D_ProcTex__bindgen_ty_4 { + pub proctex3: __BindgenUnionField, + pub __bindgen_anon_1: __BindgenUnionField, + pub bindgen_union_field: u32, +} +#[repr(C)] +pub struct C3D_ProcTex__bindgen_ty_4__bindgen_ty_1 { + pub uNoiseFreq: u16, + pub vNoiseFreq: u16, +} +#[repr(C)] +pub struct C3D_ProcTex__bindgen_ty_5 { + pub proctex4: __BindgenUnionField, + pub __bindgen_anon_1: __BindgenUnionField, + pub bindgen_union_field: u32, +} +#[repr(C)] +#[repr(align(4))] +pub struct C3D_ProcTex__bindgen_ty_5__bindgen_ty_1 { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u8>, +} +impl C3D_ProcTex__bindgen_ty_5__bindgen_ty_1 { + #[inline] + pub fn minFilter(&self) -> u32 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 3u8) as u32) } + } + #[inline] + pub fn set_minFilter(&mut self, val: u32) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(0usize, 3u8, val as u64) + } + } + #[inline] + pub fn unknown1(&self) -> u32 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 8u8) as u32) } + } + #[inline] + pub fn set_unknown1(&mut self, val: u32) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(3usize, 8u8, val as u64) + } + } + #[inline] + pub fn width(&self) -> u32 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 8u8) as u32) } + } + #[inline] + pub fn set_width(&mut self, val: u32) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(11usize, 8u8, val as u64) + } + } + #[inline] + pub fn lodBiasHigh(&self) -> u32 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(19usize, 8u8) as u32) } + } + #[inline] + pub fn set_lodBiasHigh(&mut self, val: u32) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(19usize, 8u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + minFilter: u32, + unknown1: u32, + width: u32, + lodBiasHigh: u32, + ) -> __BindgenBitfieldUnit<[u8; 4usize], u8> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u8> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 3u8, { + let minFilter: u32 = unsafe { ::core::mem::transmute(minFilter) }; + minFilter as u64 + }); + __bindgen_bitfield_unit.set(3usize, 8u8, { + let unknown1: u32 = unsafe { ::core::mem::transmute(unknown1) }; + unknown1 as u64 + }); + __bindgen_bitfield_unit.set(11usize, 8u8, { + let width: u32 = unsafe { ::core::mem::transmute(width) }; + width as u64 + }); + __bindgen_bitfield_unit.set(19usize, 8u8, { + let lodBiasHigh: u32 = unsafe { ::core::mem::transmute(lodBiasHigh) }; + lodBiasHigh as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +pub struct C3D_ProcTex__bindgen_ty_6 { + pub proctex5: __BindgenUnionField, + pub __bindgen_anon_1: __BindgenUnionField, + pub bindgen_union_field: u32, +} +#[repr(C)] +#[repr(align(4))] +pub struct C3D_ProcTex__bindgen_ty_6__bindgen_ty_1 { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>, +} +impl C3D_ProcTex__bindgen_ty_6__bindgen_ty_1 { + #[inline] + pub fn offset(&self) -> u32 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 8u8) as u32) } + } + #[inline] + pub fn set_offset(&mut self, val: u32) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(0usize, 8u8, val as u64) + } + } + #[inline] + pub fn unknown2(&self) -> u32 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 24u8) as u32) } + } + #[inline] + pub fn set_unknown2(&mut self, val: u32) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(8usize, 24u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1(offset: u32, unknown2: u32) -> __BindgenBitfieldUnit<[u8; 4usize], u32> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u32> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 8u8, { + let offset: u32 = unsafe { ::core::mem::transmute(offset) }; + offset as u64 + }); + __bindgen_bitfield_unit.set(8usize, 24u8, { + let unknown2: u32 = unsafe { ::core::mem::transmute(unknown2) }; + unknown2 as u64 + }); + __bindgen_bitfield_unit + } +} +pub const C3D_ProcTex_U: _bindgen_ty_34 = 1; +pub const C3D_ProcTex_V: _bindgen_ty_34 = 2; +pub const C3D_ProcTex_UV: _bindgen_ty_34 = 3; +pub type _bindgen_ty_34 = u32; +extern "C" { + pub fn C3D_ProcTexInit(pt: *mut C3D_ProcTex, offset: ::libc::c_int, length: ::libc::c_int); +} +extern "C" { + pub fn C3D_ProcTexNoiseCoefs( + pt: *mut C3D_ProcTex, + mode: ::libc::c_int, + amplitude: f32, + frequency: f32, + phase: f32, + ); +} +extern "C" { + pub fn C3D_ProcTexLodBias(pt: *mut C3D_ProcTex, bias: f32); +} +extern "C" { + pub fn C3D_ProcTexBind(texCoordId: ::libc::c_int, pt: *mut C3D_ProcTex); +} +pub type C3D_ProcTexLut = [u32; 128usize]; +extern "C" { + pub fn C3D_ProcTexLutBind(id: GPU_PROCTEX_LUTID, lut: *mut C3D_ProcTexLut); +} +extern "C" { + pub fn ProcTexLut_FromArray(lut: *mut C3D_ProcTexLut, in_: *const f32); +} +extern "C" { + pub fn C3D_ProcTexColorLutBind(lut: *mut C3D_ProcTexColorLut); +} +extern "C" { + pub fn ProcTexColorLut_Write( + out: *mut C3D_ProcTexColorLut, + in_: *const u32, + offset: ::libc::c_int, + length: ::libc::c_int, + ); +} +#[repr(C)] +pub struct C3D_LightLut { + pub data: [u32; 256usize], +} +#[repr(C)] +pub struct C3D_LightLutDA { + pub lut: C3D_LightLut, + pub bias: f32, + pub scale: f32, +} +pub type C3D_LightLutFunc = ::core::option::Option f32>; +pub type C3D_LightLutFuncDA = + ::core::option::Option f32>; +extern "C" { + pub fn LightLut_FromArray(lut: *mut C3D_LightLut, data: *mut f32); +} +extern "C" { + pub fn LightLut_FromFunc( + lut: *mut C3D_LightLut, + func: C3D_LightLutFunc, + param: f32, + negative: bool, + ); +} +extern "C" { + pub fn LightLutDA_Create( + lut: *mut C3D_LightLutDA, + func: C3D_LightLutFuncDA, + from: f32, + to: f32, + arg0: f32, + arg1: f32, + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct C3D_Material { + pub ambient: [f32; 3usize], + pub diffuse: [f32; 3usize], + pub specular0: [f32; 3usize], + pub specular1: [f32; 3usize], + pub emission: [f32; 3usize], +} +pub type C3D_Light = C3D_Light_t; +pub type C3D_LightEnv = C3D_LightEnv_t; +#[repr(C)] +pub struct C3D_LightLutInputConf { + pub abs: u32, + pub select: u32, + pub scale: u32, +} +#[repr(C)] +pub struct C3D_LightEnvConf { + pub ambient: u32, + pub numLights: u32, + pub config: [u32; 2usize], + pub lutInput: C3D_LightLutInputConf, + pub permutation: u32, +} +pub const C3DF_LightEnv_Dirty: _bindgen_ty_35 = 1; +pub const C3DF_LightEnv_MtlDirty: _bindgen_ty_35 = 2; +pub const C3DF_LightEnv_LCDirty: _bindgen_ty_35 = 4; +pub type _bindgen_ty_35 = u32; +#[repr(C)] +pub struct C3D_LightEnv_t { + pub flags: u32, + pub luts: [*mut C3D_LightLut; 6usize], + pub ambient: [f32; 3usize], + pub lights: [*mut C3D_Light; 8usize], + pub conf: C3D_LightEnvConf, + pub material: C3D_Material, +} +extern "C" { + pub fn C3D_LightEnvInit(env: *mut C3D_LightEnv); +} +extern "C" { + pub fn C3D_LightEnvBind(env: *mut C3D_LightEnv); +} +extern "C" { + pub fn C3D_LightEnvMaterial(env: *mut C3D_LightEnv, mtl: *const C3D_Material); +} +extern "C" { + pub fn C3D_LightEnvAmbient(env: *mut C3D_LightEnv, r: f32, g: f32, b: f32); +} +extern "C" { + pub fn C3D_LightEnvLut( + env: *mut C3D_LightEnv, + lutId: GPU_LIGHTLUTID, + input: GPU_LIGHTLUTINPUT, + negative: bool, + lut: *mut C3D_LightLut, + ); +} +pub const GPU_SHADOW_PRIMARY: _bindgen_ty_36 = 65536; +pub const GPU_SHADOW_SECONDARY: _bindgen_ty_36 = 131072; +pub const GPU_INVERT_SHADOW: _bindgen_ty_36 = 262144; +pub const GPU_SHADOW_ALPHA: _bindgen_ty_36 = 524288; +pub type _bindgen_ty_36 = u32; +extern "C" { + pub fn C3D_LightEnvFresnel(env: *mut C3D_LightEnv, selector: GPU_FRESNELSEL); +} +extern "C" { + pub fn C3D_LightEnvBumpMode(env: *mut C3D_LightEnv, mode: GPU_BUMPMODE); +} +extern "C" { + pub fn C3D_LightEnvBumpSel(env: *mut C3D_LightEnv, texUnit: ::libc::c_int); +} +extern "C" { + pub fn C3D_LightEnvShadowMode(env: *mut C3D_LightEnv, mode: u32); +} +extern "C" { + pub fn C3D_LightEnvShadowSel(env: *mut C3D_LightEnv, texUnit: ::libc::c_int); +} +extern "C" { + pub fn C3D_LightEnvClampHighlights(env: *mut C3D_LightEnv, clamp: bool); +} +#[repr(C)] +pub struct C3D_LightMatConf { + pub specular0: u32, + pub specular1: u32, + pub diffuse: u32, + pub ambient: u32, +} +#[repr(C)] +pub struct C3D_LightConf { + pub material: C3D_LightMatConf, + pub position: [u16; 3usize], + pub padding0: u16, + pub spotDir: [u16; 3usize], + pub padding1: u16, + pub padding2: u32, + pub config: u32, + pub distAttnBias: u32, + pub distAttnScale: u32, +} +pub const C3DF_Light_Enabled: _bindgen_ty_37 = 1; +pub const C3DF_Light_Dirty: _bindgen_ty_37 = 2; +pub const C3DF_Light_MatDirty: _bindgen_ty_37 = 4; +pub const C3DF_Light_SPDirty: _bindgen_ty_37 = 16384; +pub const C3DF_Light_DADirty: _bindgen_ty_37 = 32768; +pub type _bindgen_ty_37 = u32; +#[repr(C)] +pub struct C3D_Light_t { + pub flags: u16, + pub id: u16, + pub parent: *mut C3D_LightEnv, + pub lut_SP: *mut C3D_LightLut, + pub lut_DA: *mut C3D_LightLut, + pub ambient: [f32; 3usize], + pub diffuse: [f32; 3usize], + pub specular0: [f32; 3usize], + pub specular1: [f32; 3usize], + pub conf: C3D_LightConf, +} +extern "C" { + pub fn C3D_LightInit(light: *mut C3D_Light, env: *mut C3D_LightEnv) -> ::libc::c_int; +} +extern "C" { + pub fn C3D_LightEnable(light: *mut C3D_Light, enable: bool); +} +extern "C" { + pub fn C3D_LightTwoSideDiffuse(light: *mut C3D_Light, enable: bool); +} +extern "C" { + pub fn C3D_LightGeoFactor(light: *mut C3D_Light, id: ::libc::c_int, enable: bool); +} +extern "C" { + pub fn C3D_LightAmbient(light: *mut C3D_Light, r: f32, g: f32, b: f32); +} +extern "C" { + pub fn C3D_LightDiffuse(light: *mut C3D_Light, r: f32, g: f32, b: f32); +} +extern "C" { + pub fn C3D_LightSpecular0(light: *mut C3D_Light, r: f32, g: f32, b: f32); +} +extern "C" { + pub fn C3D_LightSpecular1(light: *mut C3D_Light, r: f32, g: f32, b: f32); +} +extern "C" { + pub fn C3D_LightPosition(light: *mut C3D_Light, pos: *mut C3D_FVec); +} +extern "C" { + pub fn C3D_LightShadowEnable(light: *mut C3D_Light, enable: bool); +} +extern "C" { + pub fn C3D_LightSpotEnable(light: *mut C3D_Light, enable: bool); +} +extern "C" { + pub fn C3D_LightSpotDir(light: *mut C3D_Light, x: f32, y: f32, z: f32); +} +extern "C" { + pub fn C3D_LightSpotLut(light: *mut C3D_Light, lut: *mut C3D_LightLut); +} +extern "C" { + pub fn C3D_LightDistAttnEnable(light: *mut C3D_Light, enable: bool); +} +extern "C" { + pub fn C3D_LightDistAttn(light: *mut C3D_Light, lut: *mut C3D_LightLutDA); +} +#[repr(C)] +pub struct C3D_FogLut { + pub data: [u32; 128usize], +} +#[repr(C)] +pub struct C3D_GasLut { + pub diff: [u32; 8usize], + pub color: [u32; 8usize], +} +extern "C" { + pub fn FogLut_FromArray(lut: *mut C3D_FogLut, data: *const f32); +} +extern "C" { + pub fn FogLut_Exp(lut: *mut C3D_FogLut, density: f32, gradient: f32, near: f32, far: f32); +} +extern "C" { + pub fn C3D_FogGasMode(fogMode: GPU_FOGMODE, gasMode: GPU_GASMODE, zFlip: bool); +} +extern "C" { + pub fn C3D_FogColor(color: u32); +} +extern "C" { + pub fn C3D_FogLutBind(lut: *mut C3D_FogLut); +} +extern "C" { + pub fn GasLut_FromArray(lut: *mut C3D_GasLut, data: *const u32); +} +extern "C" { + pub fn C3D_GasBeginAcc(); +} +extern "C" { + pub fn C3D_GasDeltaZ(value: f32); +} +extern "C" { + pub fn C3D_GasAccMax(value: f32); +} +extern "C" { + pub fn C3D_GasAttn(value: f32); +} +extern "C" { + pub fn C3D_GasLightPlanar(min: f32, max: f32, attn: f32); +} +extern "C" { + pub fn C3D_GasLightView(min: f32, max: f32, attn: f32); +} +extern "C" { + pub fn C3D_GasLightDirection(dotp: f32); +} +extern "C" { + pub fn C3D_GasLutInput(input: GPU_GASLUTINPUT); +} +extern "C" { + pub fn C3D_GasLutBind(lut: *mut C3D_GasLut); +} +#[repr(C)] +pub struct C3D_FrameBuf { + pub colorBuf: *mut ::libc::c_void, + pub depthBuf: *mut ::libc::c_void, + pub width: u16, + pub height: u16, + pub colorFmt: GPU_COLORBUF, + pub depthFmt: GPU_DEPTHBUF, + pub block32: bool, + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>, + pub __bindgen_padding_0: u16, +} +impl C3D_FrameBuf { + #[inline] + pub fn colorMask(&self) -> u8 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) } + } + #[inline] + pub fn set_colorMask(&mut self, val: u8) { + unsafe { + let val: u8 = ::core::mem::transmute(val); + self._bitfield_1.set(0usize, 4u8, val as u64) + } + } + #[inline] + pub fn depthMask(&self) -> u8 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) } + } + #[inline] + pub fn set_depthMask(&mut self, val: u8) { + unsafe { + let val: u8 = ::core::mem::transmute(val); + self._bitfield_1.set(4usize, 4u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1(colorMask: u8, depthMask: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 4u8, { + let colorMask: u8 = unsafe { ::core::mem::transmute(colorMask) }; + colorMask as u64 + }); + __bindgen_bitfield_unit.set(4usize, 4u8, { + let depthMask: u8 = unsafe { ::core::mem::transmute(depthMask) }; + depthMask as u64 + }); + __bindgen_bitfield_unit + } +} +pub const C3D_CLEAR_COLOR: C3D_ClearBits = 1; +pub const C3D_CLEAR_DEPTH: C3D_ClearBits = 2; +pub const C3D_CLEAR_ALL: C3D_ClearBits = 3; +pub type C3D_ClearBits = u32; +extern "C" { + pub fn C3D_CalcColorBufSize(width: u32, height: u32, fmt: GPU_COLORBUF) -> u32; +} +extern "C" { + pub fn C3D_CalcDepthBufSize(width: u32, height: u32, fmt: GPU_DEPTHBUF) -> u32; +} +extern "C" { + pub fn C3D_GetFrameBuf() -> *mut C3D_FrameBuf; +} +extern "C" { + pub fn C3D_SetFrameBuf(fb: *mut C3D_FrameBuf); +} +extern "C" { + pub fn C3D_FrameBufTex( + fb: *mut C3D_FrameBuf, + tex: *mut C3D_Tex, + face: GPU_TEXFACE, + level: ::libc::c_int, + ); +} +extern "C" { + pub fn C3D_FrameBufClear( + fb: *mut C3D_FrameBuf, + clearBits: C3D_ClearBits, + clearColor: u32, + clearDepth: u32, + ); +} +extern "C" { + pub fn C3D_FrameBufTransfer( + fb: *mut C3D_FrameBuf, + screen: gfxScreen_t, + side: gfx3dSide_t, + transferFlags: u32, + ); +} +pub type C3D_RenderTarget = C3D_RenderTarget_tag; +#[repr(C)] +pub struct C3D_RenderTarget_tag { + pub next: *mut C3D_RenderTarget, + pub prev: *mut C3D_RenderTarget, + pub frameBuf: C3D_FrameBuf, + pub used: bool, + pub ownsColor: bool, + pub ownsDepth: bool, + pub linked: bool, + pub screen: gfxScreen_t, + pub side: gfx3dSide_t, + pub transferFlags: u32, +} +pub const C3D_FRAME_SYNCDRAW: _bindgen_ty_38 = 1; +pub const C3D_FRAME_NONBLOCK: _bindgen_ty_38 = 2; +pub type _bindgen_ty_38 = u32; +extern "C" { + pub fn C3D_FrameRate(fps: f32) -> f32; +} +extern "C" { + pub fn C3D_FrameSync(); +} +extern "C" { + pub fn C3D_FrameCounter(id: ::libc::c_int) -> u32; +} +extern "C" { + pub fn C3D_FrameBegin(flags: u8) -> bool; +} +extern "C" { + pub fn C3D_FrameDrawOn(target: *mut C3D_RenderTarget) -> bool; +} +extern "C" { + pub fn C3D_FrameSplit(flags: u8); +} +extern "C" { + pub fn C3D_FrameEnd(flags: u8); +} +extern "C" { + pub fn C3D_FrameEndHook( + hook: ::core::option::Option, + param: *mut ::libc::c_void, + ); +} +extern "C" { + pub fn C3D_GetDrawingTime() -> f32; +} +extern "C" { + pub fn C3D_GetProcessingTime() -> f32; +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union C3D_DEPTHTYPE { + pub __i: ::libc::c_int, + pub __e: GPU_DEPTHBUF, + _bindgen_union_align: u32, +} +extern "C" { + pub fn C3D_RenderTargetCreate( + width: ::libc::c_int, + height: ::libc::c_int, + colorFmt: GPU_COLORBUF, + depthFmt: C3D_DEPTHTYPE, + ) -> *mut C3D_RenderTarget; +} +extern "C" { + pub fn C3D_RenderTargetCreateFromTex( + tex: *mut C3D_Tex, + face: GPU_TEXFACE, + level: ::libc::c_int, + depthFmt: C3D_DEPTHTYPE, + ) -> *mut C3D_RenderTarget; +} +extern "C" { + pub fn C3D_RenderTargetDelete(target: *mut C3D_RenderTarget); +} +extern "C" { + pub fn C3D_RenderTargetSetOutput( + target: *mut C3D_RenderTarget, + screen: gfxScreen_t, + side: gfx3dSide_t, + transferFlags: u32, + ); +} +extern "C" { + pub fn C3D_SyncDisplayTransfer( + inadr: *mut u32, + indim: u32, + outadr: *mut u32, + outdim: u32, + flags: u32, + ); +} +extern "C" { + pub fn C3D_SyncTextureCopy( + inadr: *mut u32, + indim: u32, + outadr: *mut u32, + outdim: u32, + size: u32, + flags: u32, + ); +} +extern "C" { + pub fn C3D_SyncMemoryFill( + buf0a: *mut u32, + buf0v: u32, + buf0e: *mut u32, + control0: u16, + buf1a: *mut u32, + buf1v: u32, + buf1e: *mut u32, + control1: u16, + ); +} +pub type va_list = __builtin_va_list; +pub type __gnuc_va_list = __builtin_va_list; +pub type FILE = __FILE; +pub type fpos_t = _fpos_t; +extern "C" { + pub fn ctermid(arg1: *mut ::libc::c_char) -> *mut ::libc::c_char; +} +extern "C" { + pub fn tmpfile() -> *mut FILE; +} +extern "C" { + pub fn tmpnam(arg1: *mut ::libc::c_char) -> *mut ::libc::c_char; +} +extern "C" { + pub fn tempnam(arg1: *const ::libc::c_char, arg2: *const ::libc::c_char) + -> *mut ::libc::c_char; +} +extern "C" { + pub fn fclose(arg1: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn fflush(arg1: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn freopen( + arg1: *const ::libc::c_char, + arg2: *const ::libc::c_char, + arg3: *mut FILE, + ) -> *mut FILE; +} +extern "C" { + pub fn setbuf(arg1: *mut FILE, arg2: *mut ::libc::c_char); +} +extern "C" { + pub fn setvbuf( + arg1: *mut FILE, + arg2: *mut ::libc::c_char, + arg3: ::libc::c_int, + arg4: usize, + ) -> ::libc::c_int; +} +extern "C" { + pub fn fprintf(arg1: *mut FILE, arg2: *const ::libc::c_char, ...) -> ::libc::c_int; +} +extern "C" { + pub fn fscanf(arg1: *mut FILE, arg2: *const ::libc::c_char, ...) -> ::libc::c_int; +} +extern "C" { + pub fn printf(arg1: *const ::libc::c_char, ...) -> ::libc::c_int; +} +extern "C" { + pub fn scanf(arg1: *const ::libc::c_char, ...) -> ::libc::c_int; +} +extern "C" { + pub fn sscanf(arg1: *const ::libc::c_char, arg2: *const ::libc::c_char, ...) -> ::libc::c_int; +} +extern "C" { + pub fn vfprintf( + arg1: *mut FILE, + arg2: *const ::libc::c_char, + arg3: __builtin_va_list, + ) -> ::libc::c_int; +} +extern "C" { + pub fn vprintf(arg1: *const ::libc::c_char, arg2: __builtin_va_list) -> ::libc::c_int; +} +extern "C" { + pub fn vsprintf( + arg1: *mut ::libc::c_char, + arg2: *const ::libc::c_char, + arg3: __builtin_va_list, + ) -> ::libc::c_int; +} +extern "C" { + pub fn fgetc(arg1: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn fgets( + arg1: *mut ::libc::c_char, + arg2: ::libc::c_int, + arg3: *mut FILE, + ) -> *mut ::libc::c_char; +} +extern "C" { + pub fn fputc(arg1: ::libc::c_int, arg2: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn fputs(arg1: *const ::libc::c_char, arg2: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn getc(arg1: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn getchar() -> ::libc::c_int; +} +extern "C" { + pub fn gets(arg1: *mut ::libc::c_char) -> *mut ::libc::c_char; +} +extern "C" { + pub fn putc(arg1: ::libc::c_int, arg2: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn putchar(arg1: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn puts(arg1: *const ::libc::c_char) -> ::libc::c_int; +} +extern "C" { + pub fn ungetc(arg1: ::libc::c_int, arg2: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn fread( + arg1: *mut ::libc::c_void, + _size: ::libc::c_uint, + _n: ::libc::c_uint, + arg2: *mut FILE, + ) -> ::libc::c_uint; +} +extern "C" { + pub fn fwrite( + arg1: *const ::libc::c_void, + _size: ::libc::c_uint, + _n: ::libc::c_uint, + arg2: *mut FILE, + ) -> ::libc::c_uint; +} +extern "C" { + pub fn fgetpos(arg1: *mut FILE, arg2: *mut fpos_t) -> ::libc::c_int; +} +extern "C" { + pub fn fseek(arg1: *mut FILE, arg2: ::libc::c_long, arg3: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn fsetpos(arg1: *mut FILE, arg2: *const fpos_t) -> ::libc::c_int; +} +extern "C" { + pub fn ftell(arg1: *mut FILE) -> ::libc::c_long; +} +extern "C" { + pub fn rewind(arg1: *mut FILE); +} +extern "C" { + pub fn clearerr(arg1: *mut FILE); +} +extern "C" { + pub fn feof(arg1: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn ferror(arg1: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn perror(arg1: *const ::libc::c_char); +} +extern "C" { + pub fn fopen(_name: *const ::libc::c_char, _type: *const ::libc::c_char) -> *mut FILE; +} +extern "C" { + pub fn sprintf(arg1: *mut ::libc::c_char, arg2: *const ::libc::c_char, ...) -> ::libc::c_int; +} +extern "C" { + pub fn remove(arg1: *const ::libc::c_char) -> ::libc::c_int; +} +extern "C" { + pub fn rename(arg1: *const ::libc::c_char, arg2: *const ::libc::c_char) -> ::libc::c_int; +} +extern "C" { + pub fn fseeko(arg1: *mut FILE, arg2: off_t, arg3: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn ftello(arg1: *mut FILE) -> off_t; +} +extern "C" { + pub fn snprintf( + arg1: *mut ::libc::c_char, + arg2: ::libc::c_uint, + arg3: *const ::libc::c_char, + ... + ) -> ::libc::c_int; +} +extern "C" { + pub fn vsnprintf( + arg1: *mut ::libc::c_char, + arg2: ::libc::c_uint, + arg3: *const ::libc::c_char, + arg4: __builtin_va_list, + ) -> ::libc::c_int; +} +extern "C" { + pub fn vfscanf( + arg1: *mut FILE, + arg2: *const ::libc::c_char, + arg3: __builtin_va_list, + ) -> ::libc::c_int; +} +extern "C" { + pub fn vscanf(arg1: *const ::libc::c_char, arg2: __builtin_va_list) -> ::libc::c_int; +} +extern "C" { + pub fn vsscanf( + arg1: *const ::libc::c_char, + arg2: *const ::libc::c_char, + arg3: __builtin_va_list, + ) -> ::libc::c_int; +} +extern "C" { + pub fn asiprintf( + arg1: *mut *mut ::libc::c_char, + arg2: *const ::libc::c_char, + ... + ) -> ::libc::c_int; +} +extern "C" { + pub fn asniprintf( + arg1: *mut ::libc::c_char, + arg2: *mut usize, + arg3: *const ::libc::c_char, + ... + ) -> *mut ::libc::c_char; +} +extern "C" { + pub fn asnprintf( + arg1: *mut ::libc::c_char, + arg2: *mut usize, + arg3: *const ::libc::c_char, + ... + ) -> *mut ::libc::c_char; +} +extern "C" { + pub fn diprintf(arg1: ::libc::c_int, arg2: *const ::libc::c_char, ...) -> ::libc::c_int; +} +extern "C" { + pub fn fiprintf(arg1: *mut FILE, arg2: *const ::libc::c_char, ...) -> ::libc::c_int; +} +extern "C" { + pub fn fiscanf(arg1: *mut FILE, arg2: *const ::libc::c_char, ...) -> ::libc::c_int; +} +extern "C" { + pub fn iprintf(arg1: *const ::libc::c_char, ...) -> ::libc::c_int; +} +extern "C" { + pub fn iscanf(arg1: *const ::libc::c_char, ...) -> ::libc::c_int; +} +extern "C" { + pub fn siprintf(arg1: *mut ::libc::c_char, arg2: *const ::libc::c_char, ...) -> ::libc::c_int; +} +extern "C" { + pub fn siscanf(arg1: *const ::libc::c_char, arg2: *const ::libc::c_char, ...) -> ::libc::c_int; +} +extern "C" { + pub fn sniprintf( + arg1: *mut ::libc::c_char, + arg2: usize, + arg3: *const ::libc::c_char, + ... + ) -> ::libc::c_int; +} +extern "C" { + pub fn vasiprintf( + arg1: *mut *mut ::libc::c_char, + arg2: *const ::libc::c_char, + arg3: __gnuc_va_list, + ) -> ::libc::c_int; +} +extern "C" { + pub fn vasniprintf( + arg1: *mut ::libc::c_char, + arg2: *mut usize, + arg3: *const ::libc::c_char, + arg4: __gnuc_va_list, + ) -> *mut ::libc::c_char; +} +extern "C" { + pub fn vasnprintf( + arg1: *mut ::libc::c_char, + arg2: *mut usize, + arg3: *const ::libc::c_char, + arg4: __gnuc_va_list, + ) -> *mut ::libc::c_char; +} +extern "C" { + pub fn vdiprintf( + arg1: ::libc::c_int, + arg2: *const ::libc::c_char, + arg3: __gnuc_va_list, + ) -> ::libc::c_int; +} +extern "C" { + pub fn vfiprintf( + arg1: *mut FILE, + arg2: *const ::libc::c_char, + arg3: __gnuc_va_list, + ) -> ::libc::c_int; +} +extern "C" { + pub fn vfiscanf( + arg1: *mut FILE, + arg2: *const ::libc::c_char, + arg3: __gnuc_va_list, + ) -> ::libc::c_int; +} +extern "C" { + pub fn viprintf(arg1: *const ::libc::c_char, arg2: __gnuc_va_list) -> ::libc::c_int; +} +extern "C" { + pub fn viscanf(arg1: *const ::libc::c_char, arg2: __gnuc_va_list) -> ::libc::c_int; +} +extern "C" { + pub fn vsiprintf( + arg1: *mut ::libc::c_char, + arg2: *const ::libc::c_char, + arg3: __gnuc_va_list, + ) -> ::libc::c_int; +} +extern "C" { + pub fn vsiscanf( + arg1: *const ::libc::c_char, + arg2: *const ::libc::c_char, + arg3: __gnuc_va_list, + ) -> ::libc::c_int; +} +extern "C" { + pub fn vsniprintf( + arg1: *mut ::libc::c_char, + arg2: usize, + arg3: *const ::libc::c_char, + arg4: __gnuc_va_list, + ) -> ::libc::c_int; +} +extern "C" { + pub fn fdopen(arg1: ::libc::c_int, arg2: *const ::libc::c_char) -> *mut FILE; +} +extern "C" { + pub fn fileno(arg1: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn pclose(arg1: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn popen(arg1: *const ::libc::c_char, arg2: *const ::libc::c_char) -> *mut FILE; +} +extern "C" { + pub fn setbuffer(arg1: *mut FILE, arg2: *mut ::libc::c_char, arg3: ::libc::c_int); +} +extern "C" { + pub fn setlinebuf(arg1: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn getw(arg1: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn putw(arg1: ::libc::c_int, arg2: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn getc_unlocked(arg1: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn getchar_unlocked() -> ::libc::c_int; +} +extern "C" { + pub fn flockfile(arg1: *mut FILE); +} +extern "C" { + pub fn ftrylockfile(arg1: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn funlockfile(arg1: *mut FILE); +} +extern "C" { + pub fn putc_unlocked(arg1: ::libc::c_int, arg2: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn putchar_unlocked(arg1: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn dprintf(arg1: ::libc::c_int, arg2: *const ::libc::c_char, ...) -> ::libc::c_int; +} +extern "C" { + pub fn fmemopen( + arg1: *mut ::libc::c_void, + arg2: usize, + arg3: *const ::libc::c_char, + ) -> *mut FILE; +} +extern "C" { + pub fn open_memstream(arg1: *mut *mut ::libc::c_char, arg2: *mut usize) -> *mut FILE; +} +extern "C" { + pub fn vdprintf( + arg1: ::libc::c_int, + arg2: *const ::libc::c_char, + arg3: __gnuc_va_list, + ) -> ::libc::c_int; +} +extern "C" { + pub fn renameat( + arg1: ::libc::c_int, + arg2: *const ::libc::c_char, + arg3: ::libc::c_int, + arg4: *const ::libc::c_char, + ) -> ::libc::c_int; +} +extern "C" { + pub fn _asiprintf_r( + arg1: *mut _reent, + arg2: *mut *mut ::libc::c_char, + arg3: *const ::libc::c_char, + ... + ) -> ::libc::c_int; +} +extern "C" { + pub fn _asniprintf_r( + arg1: *mut _reent, + arg2: *mut ::libc::c_char, + arg3: *mut usize, + arg4: *const ::libc::c_char, + ... + ) -> *mut ::libc::c_char; +} +extern "C" { + pub fn _asnprintf_r( + arg1: *mut _reent, + arg2: *mut ::libc::c_char, + arg3: *mut usize, + arg4: *const ::libc::c_char, + ... + ) -> *mut ::libc::c_char; +} +extern "C" { + pub fn _asprintf_r( + arg1: *mut _reent, + arg2: *mut *mut ::libc::c_char, + arg3: *const ::libc::c_char, + ... + ) -> ::libc::c_int; +} +extern "C" { + pub fn _diprintf_r( + arg1: *mut _reent, + arg2: ::libc::c_int, + arg3: *const ::libc::c_char, + ... + ) -> ::libc::c_int; +} +extern "C" { + pub fn _dprintf_r( + arg1: *mut _reent, + arg2: ::libc::c_int, + arg3: *const ::libc::c_char, + ... + ) -> ::libc::c_int; +} +extern "C" { + pub fn _fclose_r(arg1: *mut _reent, arg2: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn _fcloseall_r(arg1: *mut _reent) -> ::libc::c_int; +} +extern "C" { + pub fn _fdopen_r( + arg1: *mut _reent, + arg2: ::libc::c_int, + arg3: *const ::libc::c_char, + ) -> *mut FILE; +} +extern "C" { + pub fn _fflush_r(arg1: *mut _reent, arg2: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn _fgetc_r(arg1: *mut _reent, arg2: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn _fgetc_unlocked_r(arg1: *mut _reent, arg2: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn _fgets_r( + arg1: *mut _reent, + arg2: *mut ::libc::c_char, + arg3: ::libc::c_int, + arg4: *mut FILE, + ) -> *mut ::libc::c_char; +} +extern "C" { + pub fn _fgets_unlocked_r( + arg1: *mut _reent, + arg2: *mut ::libc::c_char, + arg3: ::libc::c_int, + arg4: *mut FILE, + ) -> *mut ::libc::c_char; +} +extern "C" { + pub fn _fgetpos_r(arg1: *mut _reent, arg2: *mut FILE, arg3: *mut fpos_t) -> ::libc::c_int; +} +extern "C" { + pub fn _fsetpos_r(arg1: *mut _reent, arg2: *mut FILE, arg3: *const fpos_t) -> ::libc::c_int; +} +extern "C" { + pub fn _fiprintf_r( + arg1: *mut _reent, + arg2: *mut FILE, + arg3: *const ::libc::c_char, + ... + ) -> ::libc::c_int; +} +extern "C" { + pub fn _fiscanf_r( + arg1: *mut _reent, + arg2: *mut FILE, + arg3: *const ::libc::c_char, + ... + ) -> ::libc::c_int; +} +extern "C" { + pub fn _fmemopen_r( + arg1: *mut _reent, + arg2: *mut ::libc::c_void, + arg3: usize, + arg4: *const ::libc::c_char, + ) -> *mut FILE; +} +extern "C" { + pub fn _fopen_r( + arg1: *mut _reent, + arg2: *const ::libc::c_char, + arg3: *const ::libc::c_char, + ) -> *mut FILE; +} +extern "C" { + pub fn _freopen_r( + arg1: *mut _reent, + arg2: *const ::libc::c_char, + arg3: *const ::libc::c_char, + arg4: *mut FILE, + ) -> *mut FILE; +} +extern "C" { + pub fn _fprintf_r( + arg1: *mut _reent, + arg2: *mut FILE, + arg3: *const ::libc::c_char, + ... + ) -> ::libc::c_int; +} +extern "C" { + pub fn _fpurge_r(arg1: *mut _reent, arg2: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn _fputc_r(arg1: *mut _reent, arg2: ::libc::c_int, arg3: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn _fputc_unlocked_r( + arg1: *mut _reent, + arg2: ::libc::c_int, + arg3: *mut FILE, + ) -> ::libc::c_int; +} +extern "C" { + pub fn _fputs_r( + arg1: *mut _reent, + arg2: *const ::libc::c_char, + arg3: *mut FILE, + ) -> ::libc::c_int; +} +extern "C" { + pub fn _fputs_unlocked_r( + arg1: *mut _reent, + arg2: *const ::libc::c_char, + arg3: *mut FILE, + ) -> ::libc::c_int; +} +extern "C" { + pub fn _fread_r( + arg1: *mut _reent, + arg2: *mut ::libc::c_void, + _size: usize, + _n: usize, + arg3: *mut FILE, + ) -> usize; +} +extern "C" { + pub fn _fread_unlocked_r( + arg1: *mut _reent, + arg2: *mut ::libc::c_void, + _size: usize, + _n: usize, + arg3: *mut FILE, + ) -> usize; +} +extern "C" { + pub fn _fscanf_r( + arg1: *mut _reent, + arg2: *mut FILE, + arg3: *const ::libc::c_char, + ... + ) -> ::libc::c_int; +} +extern "C" { + pub fn _fseek_r( + arg1: *mut _reent, + arg2: *mut FILE, + arg3: ::libc::c_long, + arg4: ::libc::c_int, + ) -> ::libc::c_int; +} +extern "C" { + pub fn _fseeko_r( + arg1: *mut _reent, + arg2: *mut FILE, + arg3: _off_t, + arg4: ::libc::c_int, + ) -> ::libc::c_int; +} +extern "C" { + pub fn _ftell_r(arg1: *mut _reent, arg2: *mut FILE) -> ::libc::c_long; +} +extern "C" { + pub fn _ftello_r(arg1: *mut _reent, arg2: *mut FILE) -> _off_t; +} +extern "C" { + pub fn _rewind_r(arg1: *mut _reent, arg2: *mut FILE); +} +extern "C" { + pub fn _fwrite_r( + arg1: *mut _reent, + arg2: *const ::libc::c_void, + _size: usize, + _n: usize, + arg3: *mut FILE, + ) -> usize; +} +extern "C" { + pub fn _fwrite_unlocked_r( + arg1: *mut _reent, + arg2: *const ::libc::c_void, + _size: usize, + _n: usize, + arg3: *mut FILE, + ) -> usize; +} +extern "C" { + pub fn _getc_r(arg1: *mut _reent, arg2: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn _getc_unlocked_r(arg1: *mut _reent, arg2: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn _getchar_r(arg1: *mut _reent) -> ::libc::c_int; +} +extern "C" { + pub fn _getchar_unlocked_r(arg1: *mut _reent) -> ::libc::c_int; +} +extern "C" { + pub fn _gets_r(arg1: *mut _reent, arg2: *mut ::libc::c_char) -> *mut ::libc::c_char; +} +extern "C" { + pub fn _iprintf_r(arg1: *mut _reent, arg2: *const ::libc::c_char, ...) -> ::libc::c_int; +} +extern "C" { + pub fn _iscanf_r(arg1: *mut _reent, arg2: *const ::libc::c_char, ...) -> ::libc::c_int; +} +extern "C" { + pub fn _open_memstream_r( + arg1: *mut _reent, + arg2: *mut *mut ::libc::c_char, + arg3: *mut usize, + ) -> *mut FILE; +} +extern "C" { + pub fn _perror_r(arg1: *mut _reent, arg2: *const ::libc::c_char); +} +extern "C" { + pub fn _printf_r(arg1: *mut _reent, arg2: *const ::libc::c_char, ...) -> ::libc::c_int; +} +extern "C" { + pub fn _putc_r(arg1: *mut _reent, arg2: ::libc::c_int, arg3: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn _putc_unlocked_r( + arg1: *mut _reent, + arg2: ::libc::c_int, + arg3: *mut FILE, + ) -> ::libc::c_int; +} +extern "C" { + pub fn _putchar_unlocked_r(arg1: *mut _reent, arg2: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn _putchar_r(arg1: *mut _reent, arg2: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn _puts_r(arg1: *mut _reent, arg2: *const ::libc::c_char) -> ::libc::c_int; +} +extern "C" { + pub fn _remove_r(arg1: *mut _reent, arg2: *const ::libc::c_char) -> ::libc::c_int; +} +extern "C" { + pub fn _rename_r( + arg1: *mut _reent, + _old: *const ::libc::c_char, + _new: *const ::libc::c_char, + ) -> ::libc::c_int; +} +extern "C" { + pub fn _scanf_r(arg1: *mut _reent, arg2: *const ::libc::c_char, ...) -> ::libc::c_int; +} +extern "C" { + pub fn _siprintf_r( + arg1: *mut _reent, + arg2: *mut ::libc::c_char, + arg3: *const ::libc::c_char, + ... + ) -> ::libc::c_int; +} +extern "C" { + pub fn _siscanf_r( + arg1: *mut _reent, + arg2: *const ::libc::c_char, + arg3: *const ::libc::c_char, + ... + ) -> ::libc::c_int; +} +extern "C" { + pub fn _sniprintf_r( + arg1: *mut _reent, + arg2: *mut ::libc::c_char, + arg3: usize, + arg4: *const ::libc::c_char, + ... + ) -> ::libc::c_int; +} +extern "C" { + pub fn _snprintf_r( + arg1: *mut _reent, + arg2: *mut ::libc::c_char, + arg3: usize, + arg4: *const ::libc::c_char, + ... + ) -> ::libc::c_int; +} +extern "C" { + pub fn _sprintf_r( + arg1: *mut _reent, + arg2: *mut ::libc::c_char, + arg3: *const ::libc::c_char, + ... + ) -> ::libc::c_int; +} +extern "C" { + pub fn _sscanf_r( + arg1: *mut _reent, + arg2: *const ::libc::c_char, + arg3: *const ::libc::c_char, + ... + ) -> ::libc::c_int; +} +extern "C" { + pub fn _tempnam_r( + arg1: *mut _reent, + arg2: *const ::libc::c_char, + arg3: *const ::libc::c_char, + ) -> *mut ::libc::c_char; +} +extern "C" { + pub fn _tmpfile_r(arg1: *mut _reent) -> *mut FILE; +} +extern "C" { + pub fn _tmpnam_r(arg1: *mut _reent, arg2: *mut ::libc::c_char) -> *mut ::libc::c_char; +} +extern "C" { + pub fn _ungetc_r(arg1: *mut _reent, arg2: ::libc::c_int, arg3: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn _vasiprintf_r( + arg1: *mut _reent, + arg2: *mut *mut ::libc::c_char, + arg3: *const ::libc::c_char, + arg4: __gnuc_va_list, + ) -> ::libc::c_int; +} +extern "C" { + pub fn _vasniprintf_r( + arg1: *mut _reent, + arg2: *mut ::libc::c_char, + arg3: *mut usize, + arg4: *const ::libc::c_char, + arg5: __gnuc_va_list, + ) -> *mut ::libc::c_char; +} +extern "C" { + pub fn _vasnprintf_r( + arg1: *mut _reent, + arg2: *mut ::libc::c_char, + arg3: *mut usize, + arg4: *const ::libc::c_char, + arg5: __gnuc_va_list, + ) -> *mut ::libc::c_char; +} +extern "C" { + pub fn _vasprintf_r( + arg1: *mut _reent, + arg2: *mut *mut ::libc::c_char, + arg3: *const ::libc::c_char, + arg4: __gnuc_va_list, + ) -> ::libc::c_int; +} +extern "C" { + pub fn _vdiprintf_r( + arg1: *mut _reent, + arg2: ::libc::c_int, + arg3: *const ::libc::c_char, + arg4: __gnuc_va_list, + ) -> ::libc::c_int; +} +extern "C" { + pub fn _vdprintf_r( + arg1: *mut _reent, + arg2: ::libc::c_int, + arg3: *const ::libc::c_char, + arg4: __gnuc_va_list, + ) -> ::libc::c_int; +} +extern "C" { + pub fn _vfiprintf_r( + arg1: *mut _reent, + arg2: *mut FILE, + arg3: *const ::libc::c_char, + arg4: __gnuc_va_list, + ) -> ::libc::c_int; +} +extern "C" { + pub fn _vfiscanf_r( + arg1: *mut _reent, + arg2: *mut FILE, + arg3: *const ::libc::c_char, + arg4: __gnuc_va_list, + ) -> ::libc::c_int; +} +extern "C" { + pub fn _vfprintf_r( + arg1: *mut _reent, + arg2: *mut FILE, + arg3: *const ::libc::c_char, + arg4: __gnuc_va_list, + ) -> ::libc::c_int; +} +extern "C" { + pub fn _vfscanf_r( + arg1: *mut _reent, + arg2: *mut FILE, + arg3: *const ::libc::c_char, + arg4: __gnuc_va_list, + ) -> ::libc::c_int; +} +extern "C" { + pub fn _viprintf_r( + arg1: *mut _reent, + arg2: *const ::libc::c_char, + arg3: __gnuc_va_list, + ) -> ::libc::c_int; +} +extern "C" { + pub fn _viscanf_r( + arg1: *mut _reent, + arg2: *const ::libc::c_char, + arg3: __gnuc_va_list, + ) -> ::libc::c_int; +} +extern "C" { + pub fn _vprintf_r( + arg1: *mut _reent, + arg2: *const ::libc::c_char, + arg3: __gnuc_va_list, + ) -> ::libc::c_int; +} +extern "C" { + pub fn _vscanf_r( + arg1: *mut _reent, + arg2: *const ::libc::c_char, + arg3: __gnuc_va_list, + ) -> ::libc::c_int; +} +extern "C" { + pub fn _vsiprintf_r( + arg1: *mut _reent, + arg2: *mut ::libc::c_char, + arg3: *const ::libc::c_char, + arg4: __gnuc_va_list, + ) -> ::libc::c_int; +} +extern "C" { + pub fn _vsiscanf_r( + arg1: *mut _reent, + arg2: *const ::libc::c_char, + arg3: *const ::libc::c_char, + arg4: __gnuc_va_list, + ) -> ::libc::c_int; +} +extern "C" { + pub fn _vsniprintf_r( + arg1: *mut _reent, + arg2: *mut ::libc::c_char, + arg3: usize, + arg4: *const ::libc::c_char, + arg5: __gnuc_va_list, + ) -> ::libc::c_int; +} +extern "C" { + pub fn _vsnprintf_r( + arg1: *mut _reent, + arg2: *mut ::libc::c_char, + arg3: usize, + arg4: *const ::libc::c_char, + arg5: __gnuc_va_list, + ) -> ::libc::c_int; +} +extern "C" { + pub fn _vsprintf_r( + arg1: *mut _reent, + arg2: *mut ::libc::c_char, + arg3: *const ::libc::c_char, + arg4: __gnuc_va_list, + ) -> ::libc::c_int; +} +extern "C" { + pub fn _vsscanf_r( + arg1: *mut _reent, + arg2: *const ::libc::c_char, + arg3: *const ::libc::c_char, + arg4: __gnuc_va_list, + ) -> ::libc::c_int; +} +extern "C" { + pub fn fpurge(arg1: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn __getdelim( + arg1: *mut *mut ::libc::c_char, + arg2: *mut usize, + arg3: ::libc::c_int, + arg4: *mut FILE, + ) -> isize; +} +extern "C" { + pub fn __getline(arg1: *mut *mut ::libc::c_char, arg2: *mut usize, arg3: *mut FILE) -> isize; +} +extern "C" { + pub fn clearerr_unlocked(arg1: *mut FILE); +} +extern "C" { + pub fn feof_unlocked(arg1: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn ferror_unlocked(arg1: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn fileno_unlocked(arg1: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn fflush_unlocked(arg1: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn fgetc_unlocked(arg1: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn fputc_unlocked(arg1: ::libc::c_int, arg2: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn fread_unlocked( + arg1: *mut ::libc::c_void, + _size: usize, + _n: usize, + arg2: *mut FILE, + ) -> usize; +} +extern "C" { + pub fn fwrite_unlocked( + arg1: *const ::libc::c_void, + _size: usize, + _n: usize, + arg2: *mut FILE, + ) -> usize; +} +extern "C" { + pub fn __srget_r(arg1: *mut _reent, arg2: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn __swbuf_r(arg1: *mut _reent, arg2: ::libc::c_int, arg3: *mut FILE) -> ::libc::c_int; +} +extern "C" { + pub fn funopen( + __cookie: *const ::libc::c_void, + __readfn: ::core::option::Option< + unsafe extern "C" fn( + __cookie: *mut ::libc::c_void, + __readfn: *mut ::libc::c_char, + __writefn: ::libc::c_int, + ) -> ::libc::c_int, + >, + __writefn: ::core::option::Option< + unsafe extern "C" fn( + __cookie: *mut ::libc::c_void, + __readfn: *const ::libc::c_char, + __writefn: ::libc::c_int, + ) -> ::libc::c_int, + >, + __seekfn: ::core::option::Option< + unsafe extern "C" fn( + __cookie: *mut ::libc::c_void, + __readfn: fpos_t, + __writefn: ::libc::c_int, + ) -> fpos_t, + >, + __closefn: ::core::option::Option< + unsafe extern "C" fn(__cookie: *mut ::libc::c_void) -> ::libc::c_int, + >, + ) -> *mut FILE; +} +extern "C" { + pub fn _funopen_r( + arg1: *mut _reent, + __cookie: *const ::libc::c_void, + __readfn: ::core::option::Option< + unsafe extern "C" fn( + arg1: *mut ::libc::c_void, + __cookie: *mut ::libc::c_char, + __readfn: ::libc::c_int, + ) -> ::libc::c_int, + >, + __writefn: ::core::option::Option< + unsafe extern "C" fn( + arg1: *mut ::libc::c_void, + __cookie: *const ::libc::c_char, + __readfn: ::libc::c_int, + ) -> ::libc::c_int, + >, + __seekfn: ::core::option::Option< + unsafe extern "C" fn( + arg1: *mut ::libc::c_void, + __cookie: fpos_t, + __readfn: ::libc::c_int, + ) -> fpos_t, + >, + __closefn: ::core::option::Option< + unsafe extern "C" fn(arg1: *mut ::libc::c_void) -> ::libc::c_int, + >, + ) -> *mut FILE; +} +#[repr(C)] +pub struct Tex3DS_SubTexture { + pub width: u16, + pub height: u16, + pub left: f32, + pub top: f32, + pub right: f32, + pub bottom: f32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct Tex3DS_Texture_s { + _unused: [u8; 0], +} +pub type Tex3DS_Texture = *mut Tex3DS_Texture_s; +extern "C" { + pub fn Tex3DS_TextureImport( + input: *const ::libc::c_void, + insize: usize, + tex: *mut C3D_Tex, + texcube: *mut C3D_TexCube, + vram: bool, + ) -> Tex3DS_Texture; +} +extern "C" { + pub fn Tex3DS_TextureImportCallback( + tex: *mut C3D_Tex, + texcube: *mut C3D_TexCube, + vram: bool, + callback: decompressCallback, + userdata: *mut ::libc::c_void, + ) -> Tex3DS_Texture; +} +extern "C" { + pub fn Tex3DS_TextureImportFD( + fd: ::libc::c_int, + tex: *mut C3D_Tex, + texcube: *mut C3D_TexCube, + vram: bool, + ) -> Tex3DS_Texture; +} +extern "C" { + pub fn Tex3DS_TextureImportStdio( + fp: *mut FILE, + tex: *mut C3D_Tex, + texcube: *mut C3D_TexCube, + vram: bool, + ) -> Tex3DS_Texture; +} +extern "C" { + pub fn Tex3DS_GetNumSubTextures(texture: Tex3DS_Texture) -> usize; +} +extern "C" { + pub fn Tex3DS_GetSubTexture(texture: Tex3DS_Texture, index: usize) -> *const Tex3DS_SubTexture; +} +extern "C" { + pub fn Tex3DS_TextureFree(texture: Tex3DS_Texture); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct C2D_DrawParams { + pub pos: C2D_DrawParams__bindgen_ty_1, + pub center: C2D_DrawParams__bindgen_ty_2, + pub depth: f32, + pub angle: f32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct C2D_DrawParams__bindgen_ty_1 { + pub x: f32, + pub y: f32, + pub w: f32, + pub h: f32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct C2D_DrawParams__bindgen_ty_2 { + pub x: f32, + pub y: f32, +} +#[repr(C)] +pub struct C2D_Tint { + pub color: u32, + pub blend: f32, +} +pub const C2D_TopLeft: C2D_Corner = 0; +pub const C2D_TopRight: C2D_Corner = 1; +pub const C2D_BotLeft: C2D_Corner = 2; +pub const C2D_BotRight: C2D_Corner = 3; +pub type C2D_Corner = u32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct C2D_Image { + pub tex: *mut C3D_Tex, + pub subtex: *const Tex3DS_SubTexture, +} +#[repr(C)] +pub struct C2D_ImageTint { + pub corners: [C2D_Tint; 4usize], +} +extern "C" { + pub fn C2D_Init(maxObjects: usize) -> bool; +} +extern "C" { + pub fn C2D_Fini(); +} +extern "C" { + pub fn C2D_Prepare(); +} +extern "C" { + pub fn C2D_Flush(); +} +extern "C" { + pub fn C2D_SceneSize(width: u32, height: u32, tilt: bool); +} +extern "C" { + pub fn C2D_CreateScreenTarget(screen: gfxScreen_t, side: gfx3dSide_t) -> *mut C3D_RenderTarget; +} +extern "C" { + pub fn C2D_TargetClear(target: *mut C3D_RenderTarget, color: u32); +} +extern "C" { + pub fn C2D_Fade(color: u32); +} +extern "C" { + pub fn C2D_DrawImage( + img: C2D_Image, + params: *const C2D_DrawParams, + tint: *const C2D_ImageTint, + ) -> bool; +} +extern "C" { + pub fn C2D_DrawTriangle( + x0: f32, + y0: f32, + clr0: u32, + x1: f32, + y1: f32, + clr1: u32, + x2: f32, + y2: f32, + clr2: u32, + depth: f32, + ) -> bool; +} +extern "C" { + pub fn C2D_DrawRectangle( + x: f32, + y: f32, + z: f32, + w: f32, + h: f32, + clr0: u32, + clr1: u32, + clr2: u32, + clr3: u32, + ) -> bool; +} +extern "C" { + pub fn C2D_DrawEllipse( + x: f32, + y: f32, + z: f32, + w: f32, + h: f32, + clr0: u32, + clr1: u32, + clr2: u32, + clr3: u32, + ) -> bool; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct C2D_SpriteSheet_s { + _unused: [u8; 0], +} +pub type C2D_SpriteSheet = *mut C2D_SpriteSheet_s; +extern "C" { + pub fn C2D_SpriteSheetLoad(filename: *const ::libc::c_char) -> C2D_SpriteSheet; +} +extern "C" { + pub fn C2D_SpriteSheetLoadFromMem(data: *const ::libc::c_void, size: usize) -> C2D_SpriteSheet; +} +extern "C" { + pub fn C2D_SpriteSheetFromFD(fd: ::libc::c_int) -> C2D_SpriteSheet; +} +extern "C" { + pub fn C2D_SpriteSheetLoadFromHandle(f: *mut FILE) -> C2D_SpriteSheet; +} +extern "C" { + pub fn C2D_SpriteSheetFree(sheet: C2D_SpriteSheet); +} +extern "C" { + pub fn C2D_SpriteSheetCount(sheet: C2D_SpriteSheet) -> usize; +} +extern "C" { + pub fn C2D_SpriteSheetGetImage(sheet: C2D_SpriteSheet, index: usize) -> C2D_Image; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct C2D_Sprite { + pub image: C2D_Image, + pub params: C2D_DrawParams, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct C2D_TextBuf_s { + _unused: [u8; 0], +} +pub type C2D_TextBuf = *mut C2D_TextBuf_s; +#[repr(C)] +pub struct C2D_Text { + pub buf: C2D_TextBuf, + pub begin: usize, + pub end: usize, + pub width: f32, + pub lines: u32, +} +pub const C2D_AtBaseline: _bindgen_ty_39 = 1; +pub const C2D_WithColor: _bindgen_ty_39 = 2; +pub type _bindgen_ty_39 = u32; +extern "C" { + pub fn C2D_TextBufNew(maxGlyphs: usize) -> C2D_TextBuf; +} +extern "C" { + pub fn C2D_TextBufResize(buf: C2D_TextBuf, maxGlyphs: usize) -> C2D_TextBuf; +} +extern "C" { + pub fn C2D_TextBufDelete(buf: C2D_TextBuf); +} +extern "C" { + pub fn C2D_TextBufClear(buf: C2D_TextBuf); +} +extern "C" { + pub fn C2D_TextBufGetNumGlyphs(buf: C2D_TextBuf) -> usize; +} +extern "C" { + pub fn C2D_TextParseLine( + text: *mut C2D_Text, + buf: C2D_TextBuf, + str: *const ::libc::c_char, + lineNo: u32, + ) -> *const ::libc::c_char; +} +extern "C" { + pub fn C2D_TextParse( + text: *mut C2D_Text, + buf: C2D_TextBuf, + str: *const ::libc::c_char, + ) -> *const ::libc::c_char; +} +extern "C" { + pub fn C2D_TextOptimize(text: *const C2D_Text); +} +extern "C" { + pub fn C2D_TextGetDimensions( + text: *const C2D_Text, + scaleX: f32, + scaleY: f32, + outWidth: *mut f32, + outHeight: *mut f32, + ); +} +extern "C" { + pub fn C2D_DrawText( + text: *const C2D_Text, + flags: u32, + x: f32, + y: f32, + z: f32, + scaleX: f32, + scaleY: f32, + ... + ); +} diff --git a/citro2d-sys/src/lib.rs b/citro2d-sys/src/lib.rs new file mode 100644 index 0000000..274d43b --- /dev/null +++ b/citro2d-sys/src/lib.rs @@ -0,0 +1,13 @@ +#![allow(non_upper_case_globals)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] + +#![feature(const_fn)] + +#![no_std] + +#![cfg_attr(feature = "stdbuild", feature(libc))] + +extern crate libc; + +include!("bindings.rs"); diff --git a/citro3d-sys/Cargo.toml b/citro3d-sys/Cargo.toml new file mode 100644 index 0000000..24d62a2 --- /dev/null +++ b/citro3d-sys/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "citro2d-sys" +version = "0.1.0" +authors = ["Charlotte D. "] + +[dependencies.libc] +version = "0.2.43" +default-features = false +optional = true + +[features] +default = ["libc"] diff --git a/citro3d-sys/bindgen.sh b/citro3d-sys/bindgen.sh new file mode 100644 index 0000000..52491c3 --- /dev/null +++ b/citro3d-sys/bindgen.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash + +clang_version=$1 + +if [ -z "$clang_version" ]; then + echo " usage: ./bindgen.sh " + echo "example: ./bindgen.sh 5.0.0" + echo "Check your current version with \`clang -v\`." + exit 1 +fi + +set -euxo pipefail + +bindgen "$DEVKITPRO/libctru/include/citro3d.h" \ + --rust-target nightly \ + --use-core \ + --distrust-clang-mangling \ + --no-doc-comments \ + --no-layout-tests \ + --ctypes-prefix "::libc" \ + --no-prepend-enum-name \ + --generate "functions,types,vars" \ + --blacklist-type "u(8|16|32|64)" \ + --blacklist-type "__builtin_va_list" \ + --blacklist-type "__va_list" \ + -- \ + --target=arm-none-eabi \ + --sysroot=$DEVKITARM/arm-none-eabi \ + -isystem$DEVKITARM/arm-none-eabi/include \ + -isystem/usr/lib/clang/$clang_version/include \ + -I$DEVKITPRO/libctru/include \ + -mfloat-abi=hard \ + -march=armv6k \ + -mtune=mpcore \ + -mfpu=vfp \ + -DARM11 \ + -D_3DS \ +> src/bindings.rs + diff --git a/citro3d-sys/build.rs b/citro3d-sys/build.rs new file mode 100644 index 0000000..d49a376 --- /dev/null +++ b/citro3d-sys/build.rs @@ -0,0 +1,12 @@ +use std::env; + +fn main() { + let dkp_path = env::var("DEVKITPRO").unwrap(); + + println!("cargo:rustc-link-search=native={}/libctru/lib", dkp_path); + println!("cargo:rustc-link-lib=static={}", match env::var("PROFILE").unwrap().as_str() { + "debug" => "citro3dd", + _ => "citro3d", + }); +} + diff --git a/citro3d-sys/src/bindings.rs b/citro3d-sys/src/bindings.rs new file mode 100644 index 0000000..92b5853 --- /dev/null +++ b/citro3d-sys/src/bindings.rs @@ -0,0 +1,12822 @@ +/* automatically generated by rust-bindgen */ + +#[repr(C)] +#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] +pub struct __BindgenBitfieldUnit +where + Storage: AsRef<[u8]> + AsMut<[u8]>, +{ + storage: Storage, + align: [Align; 0], +} +impl __BindgenBitfieldUnit +where + Storage: AsRef<[u8]> + AsMut<[u8]>, +{ + #[inline] + pub fn new(storage: Storage) -> Self { + Self { storage, align: [] } + } + #[inline] + pub fn get_bit(&self, index: usize) -> bool { + debug_assert!(index / 8 < self.storage.as_ref().len()); + let byte_index = index / 8; + let byte = self.storage.as_ref()[byte_index]; + let bit_index = if cfg!(target_endian = "big") { + 7 - (index % 8) + } else { + index % 8 + }; + let mask = 1 << bit_index; + byte & mask == mask + } + #[inline] + pub fn set_bit(&mut self, index: usize, val: bool) { + debug_assert!(index / 8 < self.storage.as_ref().len()); + let byte_index = index / 8; + let byte = &mut self.storage.as_mut()[byte_index]; + let bit_index = if cfg!(target_endian = "big") { + 7 - (index % 8) + } else { + index % 8 + }; + let mask = 1 << bit_index; + if val { + *byte |= mask; + } else { + *byte &= !mask; + } + } + #[inline] + pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { + debug_assert!(bit_width <= 64); + debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); + debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + let mut val = 0; + for i in 0..(bit_width as usize) { + if self.get_bit(i + bit_offset) { + let index = if cfg!(target_endian = "big") { + bit_width as usize - 1 - i + } else { + i + }; + val |= 1 << index; + } + } + val + } + #[inline] + pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { + debug_assert!(bit_width <= 64); + debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); + debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + for i in 0..(bit_width as usize) { + let mask = 1 << i; + let val_bit_is_set = val & mask == mask; + let index = if cfg!(target_endian = "big") { + bit_width as usize - 1 - i + } else { + i + }; + self.set_bit(index + bit_offset, val_bit_is_set); + } + } +} +#[repr(C)] +#[derive(Default)] +pub struct __IncompleteArrayField(::core::marker::PhantomData, [T; 0]); +impl __IncompleteArrayField { + #[inline] + pub fn new() -> Self { + __IncompleteArrayField(::core::marker::PhantomData, []) + } + #[inline] + pub unsafe fn as_ptr(&self) -> *const T { + ::core::mem::transmute(self) + } + #[inline] + pub unsafe fn as_mut_ptr(&mut self) -> *mut T { + ::core::mem::transmute(self) + } + #[inline] + pub unsafe fn as_slice(&self, len: usize) -> &[T] { + ::core::slice::from_raw_parts(self.as_ptr(), len) + } + #[inline] + pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { + ::core::slice::from_raw_parts_mut(self.as_mut_ptr(), len) + } +} +impl ::core::fmt::Debug for __IncompleteArrayField { + fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fmt.write_str("__IncompleteArrayField") + } +} +impl ::core::clone::Clone for __IncompleteArrayField { + #[inline] + fn clone(&self) -> Self { + Self::new() + } +} +#[repr(C)] +pub struct __BindgenUnionField(::core::marker::PhantomData); +impl __BindgenUnionField { + #[inline] + pub fn new() -> Self { + __BindgenUnionField(::core::marker::PhantomData) + } + #[inline] + pub unsafe fn as_ref(&self) -> &T { + ::core::mem::transmute(self) + } + #[inline] + pub unsafe fn as_mut(&mut self) -> &mut T { + ::core::mem::transmute(self) + } +} +impl ::core::default::Default for __BindgenUnionField { + #[inline] + fn default() -> Self { + Self::new() + } +} +impl ::core::clone::Clone for __BindgenUnionField { + #[inline] + fn clone(&self) -> Self { + Self::new() + } +} +impl ::core::marker::Copy for __BindgenUnionField {} +impl ::core::fmt::Debug for __BindgenUnionField { + fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fmt.write_str("__BindgenUnionField") + } +} +impl ::core::hash::Hash for __BindgenUnionField { + fn hash(&self, _state: &mut H) {} +} +impl ::core::cmp::PartialEq for __BindgenUnionField { + fn eq(&self, _other: &__BindgenUnionField) -> bool { + true + } +} +impl ::core::cmp::Eq for __BindgenUnionField {} +pub const _NEWLIB_VERSION_H__: u32 = 1; +pub const _NEWLIB_VERSION: &'static [u8; 6usize] = b"3.1.0\0"; +pub const __NEWLIB__: u32 = 3; +pub const __NEWLIB_MINOR__: u32 = 1; +pub const __NEWLIB_PATCHLEVEL__: u32 = 0; +pub const _DEFAULT_SOURCE: u32 = 1; +pub const _POSIX_SOURCE: u32 = 1; +pub const _POSIX_C_SOURCE: u32 = 200809; +pub const _ATFILE_SOURCE: u32 = 1; +pub const __ATFILE_VISIBLE: u32 = 1; +pub const __BSD_VISIBLE: u32 = 1; +pub const __GNU_VISIBLE: u32 = 0; +pub const __ISO_C_VISIBLE: u32 = 2011; +pub const __LARGEFILE_VISIBLE: u32 = 0; +pub const __MISC_VISIBLE: u32 = 1; +pub const __POSIX_VISIBLE: u32 = 200809; +pub const __SVID_VISIBLE: u32 = 1; +pub const __XSI_VISIBLE: u32 = 0; +pub const __SSP_FORTIFY_LEVEL: u32 = 0; +pub const _POSIX_MONOTONIC_CLOCK: u32 = 200112; +pub const _POSIX_TIMERS: u32 = 1; +pub const __have_longlong64: u32 = 1; +pub const __have_long32: u32 = 1; +pub const ___int8_t_defined: u32 = 1; +pub const ___int16_t_defined: u32 = 1; +pub const ___int32_t_defined: u32 = 1; +pub const ___int64_t_defined: u32 = 1; +pub const ___int_least8_t_defined: u32 = 1; +pub const ___int_least16_t_defined: u32 = 1; +pub const ___int_least32_t_defined: u32 = 1; +pub const ___int_least64_t_defined: u32 = 1; +pub const __int20: u32 = 2; +pub const __INT8: &'static [u8; 3usize] = b"hh\0"; +pub const __INT16: &'static [u8; 2usize] = b"h\0"; +pub const __INT64: &'static [u8; 3usize] = b"ll\0"; +pub const __FAST8: &'static [u8; 3usize] = b"hh\0"; +pub const __FAST16: &'static [u8; 2usize] = b"h\0"; +pub const __FAST64: &'static [u8; 3usize] = b"ll\0"; +pub const __LEAST8: &'static [u8; 3usize] = b"hh\0"; +pub const __LEAST16: &'static [u8; 2usize] = b"h\0"; +pub const __LEAST64: &'static [u8; 3usize] = b"ll\0"; +pub const __int8_t_defined: u32 = 1; +pub const __int16_t_defined: u32 = 1; +pub const __int32_t_defined: u32 = 1; +pub const __int64_t_defined: u32 = 1; +pub const __int_least8_t_defined: u32 = 1; +pub const __int_least16_t_defined: u32 = 1; +pub const __int_least32_t_defined: u32 = 1; +pub const __int_least64_t_defined: u32 = 1; +pub const __int_fast8_t_defined: u32 = 1; +pub const __int_fast16_t_defined: u32 = 1; +pub const __int_fast32_t_defined: u32 = 1; +pub const __int_fast64_t_defined: u32 = 1; +pub const WINT_MIN: u32 = 0; +pub const true_: u32 = 1; +pub const false_: u32 = 0; +pub const __bool_true_false_are_defined: u32 = 1; +pub const CUR_PROCESS_HANDLE: u32 = 4294934529; +pub const ARBITRATION_SIGNAL_ALL: i32 = -1; +pub const CUR_THREAD_HANDLE: u32 = 4294934528; +pub const SYSCLOCK_SOC: u32 = 16756991; +pub const SYSCLOCK_ARM9: u32 = 134055928; +pub const SYSCLOCK_ARM11: u32 = 268111856; +pub const SYSCLOCK_ARM11_NEW: u32 = 804335568; +pub const CPU_TICKS_PER_MSEC: f64 = 268111.856; +pub const CPU_TICKS_PER_USEC: f64 = 268.111856; +pub const __NEWLIB_H__: u32 = 1; +pub const _WANT_IO_C99_FORMATS: u32 = 1; +pub const _WANT_IO_LONG_LONG: u32 = 1; +pub const _WANT_IO_POS_ARGS: u32 = 1; +pub const _MB_CAPABLE: u32 = 1; +pub const _MB_LEN_MAX: u32 = 8; +pub const HAVE_INITFINI_ARRAY: u32 = 1; +pub const _ATEXIT_DYNAMIC_ALLOC: u32 = 1; +pub const _HAVE_LONG_DOUBLE: u32 = 1; +pub const _HAVE_CC_INHIBIT_LOOP_TO_LIBCALL: u32 = 1; +pub const _LDBL_EQ_DBL: u32 = 1; +pub const _FVWRITE_IN_STREAMIO: u32 = 1; +pub const _FSEEK_OPTIMIZATION: u32 = 1; +pub const _UNBUF_STREAM_OPT: u32 = 1; +pub const __OBSOLETE_MATH_DEFAULT: u32 = 0; +pub const __OBSOLETE_MATH: u32 = 0; +pub const __RAND_MAX: u32 = 2147483647; +pub const CONSOLE_COLOR_BOLD: u32 = 1; +pub const CONSOLE_COLOR_FAINT: u32 = 2; +pub const CONSOLE_ITALIC: u32 = 4; +pub const CONSOLE_UNDERLINE: u32 = 8; +pub const CONSOLE_BLINK_SLOW: u32 = 16; +pub const CONSOLE_BLINK_FAST: u32 = 32; +pub const CONSOLE_COLOR_REVERSE: u32 = 64; +pub const CONSOLE_CONCEAL: u32 = 128; +pub const CONSOLE_CROSSED_OUT: u32 = 256; +pub const __GNUCLIKE_ASM: u32 = 3; +pub const __GNUCLIKE___TYPEOF: u32 = 1; +pub const __GNUCLIKE___OFFSETOF: u32 = 1; +pub const __GNUCLIKE___SECTION: u32 = 1; +pub const __GNUCLIKE_CTOR_SECTION_HANDLING: u32 = 1; +pub const __GNUCLIKE_BUILTIN_CONSTANT_P: u32 = 1; +pub const __GNUCLIKE_BUILTIN_VARARGS: u32 = 1; +pub const __GNUCLIKE_BUILTIN_STDARG: u32 = 1; +pub const __GNUCLIKE_BUILTIN_VAALIST: u32 = 1; +pub const __GNUC_VA_LIST_COMPATIBILITY: u32 = 1; +pub const __GNUCLIKE_BUILTIN_NEXT_ARG: u32 = 1; +pub const __GNUCLIKE_BUILTIN_MEMCPY: u32 = 1; +pub const __CC_SUPPORTS_INLINE: u32 = 1; +pub const __CC_SUPPORTS___INLINE: u32 = 1; +pub const __CC_SUPPORTS___INLINE__: u32 = 1; +pub const __CC_SUPPORTS___FUNC__: u32 = 1; +pub const __CC_SUPPORTS_WARNING: u32 = 1; +pub const __CC_SUPPORTS_VARADIC_XXX: u32 = 1; +pub const __CC_SUPPORTS_DYNAMIC_ARRAY_INIT: u32 = 1; +pub const __BIT_TYPES_DEFINED__: u32 = 1; +pub const _LITTLE_ENDIAN: u32 = 1234; +pub const _BIG_ENDIAN: u32 = 4321; +pub const _PDP_ENDIAN: u32 = 3412; +pub const _BYTE_ORDER: u32 = 1234; +pub const _QUAD_HIGHWORD: u32 = 1; +pub const _QUAD_LOWWORD: u32 = 0; +pub const LITTLE_ENDIAN: u32 = 1234; +pub const BIG_ENDIAN: u32 = 4321; +pub const PDP_ENDIAN: u32 = 3412; +pub const BYTE_ORDER: u32 = 1234; +pub const FD_SETSIZE: u32 = 64; +pub const SCHED_OTHER: u32 = 0; +pub const SCHED_FIFO: u32 = 1; +pub const SCHED_RR: u32 = 2; +pub const PTHREAD_SCOPE_PROCESS: u32 = 0; +pub const PTHREAD_SCOPE_SYSTEM: u32 = 1; +pub const PTHREAD_INHERIT_SCHED: u32 = 1; +pub const PTHREAD_EXPLICIT_SCHED: u32 = 2; +pub const PTHREAD_CREATE_DETACHED: u32 = 0; +pub const PTHREAD_CREATE_JOINABLE: u32 = 1; +pub const CSND_NUM_CHANNELS: u32 = 32; +pub const FRIEND_SCREEN_NAME_SIZE: u32 = 11; +pub const FRIEND_COMMENT_SIZE: u32 = 33; +pub const FRIEND_LIST_SIZE: u32 = 100; +pub const HTTPC_RESULTCODE_DOWNLOADPENDING: u32 = 3628113963; +pub const HTTPC_RESULTCODE_NOTFOUND: u32 = 3628113960; +pub const HTTPC_RESULTCODE_TIMEDOUT: u32 = 3626016873; +pub const UDS_MAXNODES: u32 = 16; +pub const UDS_BROADCAST_NETWORKNODEID: u32 = 65535; +pub const UDS_HOST_NETWORKNODEID: u32 = 1; +pub const UDS_DEFAULT_RECVBUFSIZE: u32 = 11824; +pub const UDS_DATAFRAME_MAXSIZE: u32 = 1478; +pub const DST_NONE: u32 = 0; +pub const DST_USA: u32 = 1; +pub const DST_AUST: u32 = 2; +pub const DST_WET: u32 = 3; +pub const DST_MET: u32 = 4; +pub const DST_EET: u32 = 5; +pub const DST_CAN: u32 = 6; +pub const SBT_MAX: u64 = 9223372036854775807; +pub const ITIMER_REAL: u32 = 0; +pub const ITIMER_VIRTUAL: u32 = 1; +pub const ITIMER_PROF: u32 = 2; +pub const _NULL: u32 = 0; +pub const _ATEXIT_SIZE: u32 = 32; +pub const _RAND48_SEED_0: u32 = 13070; +pub const _RAND48_SEED_1: u32 = 43981; +pub const _RAND48_SEED_2: u32 = 4660; +pub const _RAND48_MULT_0: u32 = 58989; +pub const _RAND48_MULT_1: u32 = 57068; +pub const _RAND48_MULT_2: u32 = 5; +pub const _RAND48_ADD: u32 = 11; +pub const _REENT_EMERGENCY_SIZE: u32 = 25; +pub const _REENT_ASCTIME_SIZE: u32 = 26; +pub const _REENT_SIGNAL_SIZE: u32 = 24; +pub const _N_LISTS: u32 = 30; +pub const _CLOCKS_PER_SEC_: u32 = 100; +pub const CLOCKS_PER_SEC: u32 = 100; +pub const CLK_TCK: u32 = 100; +pub const SIGEV_NONE: u32 = 1; +pub const SIGEV_SIGNAL: u32 = 2; +pub const SIGEV_THREAD: u32 = 3; +pub const SI_USER: u32 = 1; +pub const SI_QUEUE: u32 = 2; +pub const SI_TIMER: u32 = 3; +pub const SI_ASYNCIO: u32 = 4; +pub const SI_MESGQ: u32 = 5; +pub const SA_NOCLDSTOP: u32 = 1; +pub const MINSIGSTKSZ: u32 = 2048; +pub const SIGSTKSZ: u32 = 8192; +pub const SS_ONSTACK: u32 = 1; +pub const SS_DISABLE: u32 = 2; +pub const SIG_SETMASK: u32 = 0; +pub const SIG_BLOCK: u32 = 1; +pub const SIG_UNBLOCK: u32 = 2; +pub const SIGHUP: u32 = 1; +pub const SIGINT: u32 = 2; +pub const SIGQUIT: u32 = 3; +pub const SIGILL: u32 = 4; +pub const SIGTRAP: u32 = 5; +pub const SIGIOT: u32 = 6; +pub const SIGABRT: u32 = 6; +pub const SIGEMT: u32 = 7; +pub const SIGFPE: u32 = 8; +pub const SIGKILL: u32 = 9; +pub const SIGBUS: u32 = 10; +pub const SIGSEGV: u32 = 11; +pub const SIGSYS: u32 = 12; +pub const SIGPIPE: u32 = 13; +pub const SIGALRM: u32 = 14; +pub const SIGTERM: u32 = 15; +pub const SIGURG: u32 = 16; +pub const SIGSTOP: u32 = 17; +pub const SIGTSTP: u32 = 18; +pub const SIGCONT: u32 = 19; +pub const SIGCHLD: u32 = 20; +pub const SIGCLD: u32 = 20; +pub const SIGTTIN: u32 = 21; +pub const SIGTTOU: u32 = 22; +pub const SIGIO: u32 = 23; +pub const SIGPOLL: u32 = 23; +pub const SIGXCPU: u32 = 24; +pub const SIGXFSZ: u32 = 25; +pub const SIGVTALRM: u32 = 26; +pub const SIGPROF: u32 = 27; +pub const SIGWINCH: u32 = 28; +pub const SIGLOST: u32 = 29; +pub const SIGUSR1: u32 = 30; +pub const SIGUSR2: u32 = 31; +pub const NSIG: u32 = 32; +pub const CLOCK_ENABLED: u32 = 1; +pub const CLOCK_DISABLED: u32 = 0; +pub const CLOCK_ALLOWED: u32 = 1; +pub const CLOCK_DISALLOWED: u32 = 0; +pub const TIMER_ABSTIME: u32 = 4; +pub const SOL_SOCKET: u32 = 65535; +pub const PF_UNSPEC: u32 = 0; +pub const PF_INET: u32 = 2; +pub const PF_INET6: u32 = 23; +pub const AF_UNSPEC: u32 = 0; +pub const AF_INET: u32 = 2; +pub const AF_INET6: u32 = 23; +pub const SOCK_STREAM: u32 = 1; +pub const SOCK_DGRAM: u32 = 2; +pub const MSG_OOB: u32 = 1; +pub const MSG_PEEK: u32 = 2; +pub const MSG_DONTWAIT: u32 = 4; +pub const MSG_DONTROUTE: u32 = 0; +pub const MSG_WAITALL: u32 = 0; +pub const MSG_MORE: u32 = 0; +pub const MSG_NOSIGNAL: u32 = 0; +pub const SHUT_RD: u32 = 0; +pub const SHUT_WR: u32 = 1; +pub const SHUT_RDWR: u32 = 2; +pub const SO_REUSEADDR: u32 = 4; +pub const SO_LINGER: u32 = 128; +pub const SO_OOBINLINE: u32 = 256; +pub const SO_SNDBUF: u32 = 4097; +pub const SO_RCVBUF: u32 = 4098; +pub const SO_SNDLOWAT: u32 = 4099; +pub const SO_RCVLOWAT: u32 = 4100; +pub const SO_TYPE: u32 = 4104; +pub const SO_ERROR: u32 = 4105; +pub const INADDR_LOOPBACK: u32 = 2130706433; +pub const INADDR_ANY: u32 = 0; +pub const INADDR_BROADCAST: u32 = 4294967295; +pub const INADDR_NONE: u32 = 4294967295; +pub const INET_ADDRSTRLEN: u32 = 16; +pub const IPPROTO_IP: u32 = 0; +pub const IPPROTO_UDP: u32 = 17; +pub const IPPROTO_TCP: u32 = 6; +pub const IP_TOS: u32 = 7; +pub const IP_TTL: u32 = 8; +pub const IP_MULTICAST_LOOP: u32 = 9; +pub const IP_MULTICAST_TTL: u32 = 10; +pub const IP_ADD_MEMBERSHIP: u32 = 11; +pub const IP_DROP_MEMBERSHIP: u32 = 12; +pub const SOL_CONFIG: u32 = 65534; +pub const ROUTING_FLAG_G: u32 = 1; +pub const TCP_STATE_CLOSED: u32 = 1; +pub const TCP_STATE_LISTEN: u32 = 2; +pub const TCP_STATE_ESTABLISHED: u32 = 5; +pub const TCP_STATE_FINWAIT1: u32 = 6; +pub const TCP_STATE_FINWAIT2: u32 = 7; +pub const TCP_STATE_CLOSE_WAIT: u32 = 8; +pub const TCP_STATE_LAST_ACK: u32 = 9; +pub const TCP_STATE_TIME_WAIT: u32 = 11; +pub const MVD_STATUS_OK: u32 = 94208; +pub const MVD_STATUS_PARAMSET: u32 = 94209; +pub const MVD_STATUS_BUSY: u32 = 94210; +pub const MVD_STATUS_FRAMEREADY: u32 = 94211; +pub const MVD_STATUS_INCOMPLETEPROCESSING: u32 = 94212; +pub const MVD_STATUS_NALUPROCFLAG: u32 = 94215; +pub const MVD_DEFAULT_WORKBUF_SIZE: u32 = 9438920; +pub const NFC_ERR_INVALID_STATE: u32 = 3366024704; +pub const NFC_ERR_APPDATA_UNINITIALIZED: u32 = 3366024736; +pub const NFC_ERR_AMIIBO_NOTSETUP: u32 = 3366024744; +pub const NFC_ERR_APPID_MISMATCH: u32 = 3366024760; +pub const NFC_ERR_DATACORRUPTION0: u32 = 3368121868; +pub const NFC_ERR_DATACORRUPTION1: u32 = 3366024728; +pub const NFC_STARTSCAN_DEFAULTINPUT: u32 = 0; +pub const GPUREG_0000: u32 = 0; +pub const GPUREG_0001: u32 = 1; +pub const GPUREG_0002: u32 = 2; +pub const GPUREG_0003: u32 = 3; +pub const GPUREG_0004: u32 = 4; +pub const GPUREG_0005: u32 = 5; +pub const GPUREG_0006: u32 = 6; +pub const GPUREG_0007: u32 = 7; +pub const GPUREG_0008: u32 = 8; +pub const GPUREG_0009: u32 = 9; +pub const GPUREG_000A: u32 = 10; +pub const GPUREG_000B: u32 = 11; +pub const GPUREG_000C: u32 = 12; +pub const GPUREG_000D: u32 = 13; +pub const GPUREG_000E: u32 = 14; +pub const GPUREG_000F: u32 = 15; +pub const GPUREG_FINALIZE: u32 = 16; +pub const GPUREG_0011: u32 = 17; +pub const GPUREG_0012: u32 = 18; +pub const GPUREG_0013: u32 = 19; +pub const GPUREG_0014: u32 = 20; +pub const GPUREG_0015: u32 = 21; +pub const GPUREG_0016: u32 = 22; +pub const GPUREG_0017: u32 = 23; +pub const GPUREG_0018: u32 = 24; +pub const GPUREG_0019: u32 = 25; +pub const GPUREG_001A: u32 = 26; +pub const GPUREG_001B: u32 = 27; +pub const GPUREG_001C: u32 = 28; +pub const GPUREG_001D: u32 = 29; +pub const GPUREG_001E: u32 = 30; +pub const GPUREG_001F: u32 = 31; +pub const GPUREG_0020: u32 = 32; +pub const GPUREG_0021: u32 = 33; +pub const GPUREG_0022: u32 = 34; +pub const GPUREG_0023: u32 = 35; +pub const GPUREG_0024: u32 = 36; +pub const GPUREG_0025: u32 = 37; +pub const GPUREG_0026: u32 = 38; +pub const GPUREG_0027: u32 = 39; +pub const GPUREG_0028: u32 = 40; +pub const GPUREG_0029: u32 = 41; +pub const GPUREG_002A: u32 = 42; +pub const GPUREG_002B: u32 = 43; +pub const GPUREG_002C: u32 = 44; +pub const GPUREG_002D: u32 = 45; +pub const GPUREG_002E: u32 = 46; +pub const GPUREG_002F: u32 = 47; +pub const GPUREG_0030: u32 = 48; +pub const GPUREG_0031: u32 = 49; +pub const GPUREG_0032: u32 = 50; +pub const GPUREG_0033: u32 = 51; +pub const GPUREG_0034: u32 = 52; +pub const GPUREG_0035: u32 = 53; +pub const GPUREG_0036: u32 = 54; +pub const GPUREG_0037: u32 = 55; +pub const GPUREG_0038: u32 = 56; +pub const GPUREG_0039: u32 = 57; +pub const GPUREG_003A: u32 = 58; +pub const GPUREG_003B: u32 = 59; +pub const GPUREG_003C: u32 = 60; +pub const GPUREG_003D: u32 = 61; +pub const GPUREG_003E: u32 = 62; +pub const GPUREG_003F: u32 = 63; +pub const GPUREG_FACECULLING_CONFIG: u32 = 64; +pub const GPUREG_VIEWPORT_WIDTH: u32 = 65; +pub const GPUREG_VIEWPORT_INVW: u32 = 66; +pub const GPUREG_VIEWPORT_HEIGHT: u32 = 67; +pub const GPUREG_VIEWPORT_INVH: u32 = 68; +pub const GPUREG_0045: u32 = 69; +pub const GPUREG_0046: u32 = 70; +pub const GPUREG_FRAGOP_CLIP: u32 = 71; +pub const GPUREG_FRAGOP_CLIP_DATA0: u32 = 72; +pub const GPUREG_FRAGOP_CLIP_DATA1: u32 = 73; +pub const GPUREG_FRAGOP_CLIP_DATA2: u32 = 74; +pub const GPUREG_FRAGOP_CLIP_DATA3: u32 = 75; +pub const GPUREG_004C: u32 = 76; +pub const GPUREG_DEPTHMAP_SCALE: u32 = 77; +pub const GPUREG_DEPTHMAP_OFFSET: u32 = 78; +pub const GPUREG_SH_OUTMAP_TOTAL: u32 = 79; +pub const GPUREG_SH_OUTMAP_O0: u32 = 80; +pub const GPUREG_SH_OUTMAP_O1: u32 = 81; +pub const GPUREG_SH_OUTMAP_O2: u32 = 82; +pub const GPUREG_SH_OUTMAP_O3: u32 = 83; +pub const GPUREG_SH_OUTMAP_O4: u32 = 84; +pub const GPUREG_SH_OUTMAP_O5: u32 = 85; +pub const GPUREG_SH_OUTMAP_O6: u32 = 86; +pub const GPUREG_0057: u32 = 87; +pub const GPUREG_0058: u32 = 88; +pub const GPUREG_0059: u32 = 89; +pub const GPUREG_005A: u32 = 90; +pub const GPUREG_005B: u32 = 91; +pub const GPUREG_005C: u32 = 92; +pub const GPUREG_005D: u32 = 93; +pub const GPUREG_005E: u32 = 94; +pub const GPUREG_005F: u32 = 95; +pub const GPUREG_0060: u32 = 96; +pub const GPUREG_EARLYDEPTH_FUNC: u32 = 97; +pub const GPUREG_EARLYDEPTH_TEST1: u32 = 98; +pub const GPUREG_EARLYDEPTH_CLEAR: u32 = 99; +pub const GPUREG_SH_OUTATTR_MODE: u32 = 100; +pub const GPUREG_SCISSORTEST_MODE: u32 = 101; +pub const GPUREG_SCISSORTEST_POS: u32 = 102; +pub const GPUREG_SCISSORTEST_DIM: u32 = 103; +pub const GPUREG_VIEWPORT_XY: u32 = 104; +pub const GPUREG_0069: u32 = 105; +pub const GPUREG_EARLYDEPTH_DATA: u32 = 106; +pub const GPUREG_006B: u32 = 107; +pub const GPUREG_006C: u32 = 108; +pub const GPUREG_DEPTHMAP_ENABLE: u32 = 109; +pub const GPUREG_RENDERBUF_DIM: u32 = 110; +pub const GPUREG_SH_OUTATTR_CLOCK: u32 = 111; +pub const GPUREG_0070: u32 = 112; +pub const GPUREG_0071: u32 = 113; +pub const GPUREG_0072: u32 = 114; +pub const GPUREG_0073: u32 = 115; +pub const GPUREG_0074: u32 = 116; +pub const GPUREG_0075: u32 = 117; +pub const GPUREG_0076: u32 = 118; +pub const GPUREG_0077: u32 = 119; +pub const GPUREG_0078: u32 = 120; +pub const GPUREG_0079: u32 = 121; +pub const GPUREG_007A: u32 = 122; +pub const GPUREG_007B: u32 = 123; +pub const GPUREG_007C: u32 = 124; +pub const GPUREG_007D: u32 = 125; +pub const GPUREG_007E: u32 = 126; +pub const GPUREG_007F: u32 = 127; +pub const GPUREG_TEXUNIT_CONFIG: u32 = 128; +pub const GPUREG_TEXUNIT0_BORDER_COLOR: u32 = 129; +pub const GPUREG_TEXUNIT0_DIM: u32 = 130; +pub const GPUREG_TEXUNIT0_PARAM: u32 = 131; +pub const GPUREG_TEXUNIT0_LOD: u32 = 132; +pub const GPUREG_TEXUNIT0_ADDR1: u32 = 133; +pub const GPUREG_TEXUNIT0_ADDR2: u32 = 134; +pub const GPUREG_TEXUNIT0_ADDR3: u32 = 135; +pub const GPUREG_TEXUNIT0_ADDR4: u32 = 136; +pub const GPUREG_TEXUNIT0_ADDR5: u32 = 137; +pub const GPUREG_TEXUNIT0_ADDR6: u32 = 138; +pub const GPUREG_TEXUNIT0_SHADOW: u32 = 139; +pub const GPUREG_008C: u32 = 140; +pub const GPUREG_008D: u32 = 141; +pub const GPUREG_TEXUNIT0_TYPE: u32 = 142; +pub const GPUREG_LIGHTING_ENABLE0: u32 = 143; +pub const GPUREG_0090: u32 = 144; +pub const GPUREG_TEXUNIT1_BORDER_COLOR: u32 = 145; +pub const GPUREG_TEXUNIT1_DIM: u32 = 146; +pub const GPUREG_TEXUNIT1_PARAM: u32 = 147; +pub const GPUREG_TEXUNIT1_LOD: u32 = 148; +pub const GPUREG_TEXUNIT1_ADDR: u32 = 149; +pub const GPUREG_TEXUNIT1_TYPE: u32 = 150; +pub const GPUREG_0097: u32 = 151; +pub const GPUREG_0098: u32 = 152; +pub const GPUREG_TEXUNIT2_BORDER_COLOR: u32 = 153; +pub const GPUREG_TEXUNIT2_DIM: u32 = 154; +pub const GPUREG_TEXUNIT2_PARAM: u32 = 155; +pub const GPUREG_TEXUNIT2_LOD: u32 = 156; +pub const GPUREG_TEXUNIT2_ADDR: u32 = 157; +pub const GPUREG_TEXUNIT2_TYPE: u32 = 158; +pub const GPUREG_009F: u32 = 159; +pub const GPUREG_00A0: u32 = 160; +pub const GPUREG_00A1: u32 = 161; +pub const GPUREG_00A2: u32 = 162; +pub const GPUREG_00A3: u32 = 163; +pub const GPUREG_00A4: u32 = 164; +pub const GPUREG_00A5: u32 = 165; +pub const GPUREG_00A6: u32 = 166; +pub const GPUREG_00A7: u32 = 167; +pub const GPUREG_TEXUNIT3_PROCTEX0: u32 = 168; +pub const GPUREG_TEXUNIT3_PROCTEX1: u32 = 169; +pub const GPUREG_TEXUNIT3_PROCTEX2: u32 = 170; +pub const GPUREG_TEXUNIT3_PROCTEX3: u32 = 171; +pub const GPUREG_TEXUNIT3_PROCTEX4: u32 = 10; +pub const GPUREG_TEXUNIT3_PROCTEX5: u32 = 13; +pub const GPUREG_00AE: u32 = 174; +pub const GPUREG_PROCTEX_LUT: u32 = 175; +pub const GPUREG_PROCTEX_LUT_DATA0: u32 = 176; +pub const GPUREG_PROCTEX_LUT_DATA1: u32 = 177; +pub const GPUREG_PROCTEX_LUT_DATA2: u32 = 178; +pub const GPUREG_PROCTEX_LUT_DATA3: u32 = 179; +pub const GPUREG_PROCTEX_LUT_DATA4: u32 = 180; +pub const GPUREG_PROCTEX_LUT_DATA5: u32 = 181; +pub const GPUREG_PROCTEX_LUT_DATA6: u32 = 182; +pub const GPUREG_PROCTEX_LUT_DATA7: u32 = 183; +pub const GPUREG_00B8: u32 = 184; +pub const GPUREG_00B9: u32 = 185; +pub const GPUREG_00BA: u32 = 186; +pub const GPUREG_00BB: u32 = 187; +pub const GPUREG_00BC: u32 = 188; +pub const GPUREG_00BD: u32 = 189; +pub const GPUREG_00BE: u32 = 190; +pub const GPUREG_00BF: u32 = 191; +pub const GPUREG_TEXENV0_SOURCE: u32 = 192; +pub const GPUREG_TEXENV0_OPERAND: u32 = 193; +pub const GPUREG_TEXENV0_COMBINER: u32 = 194; +pub const GPUREG_TEXENV0_COLOR: u32 = 195; +pub const GPUREG_TEXENV0_SCALE: u32 = 196; +pub const GPUREG_00C5: u32 = 197; +pub const GPUREG_00C6: u32 = 198; +pub const GPUREG_00C7: u32 = 199; +pub const GPUREG_TEXENV1_SOURCE: u32 = 200; +pub const GPUREG_TEXENV1_OPERAND: u32 = 201; +pub const GPUREG_TEXENV1_COMBINER: u32 = 202; +pub const GPUREG_TEXENV1_COLOR: u32 = 203; +pub const GPUREG_TEXENV1_SCALE: u32 = 204; +pub const GPUREG_00CD: u32 = 205; +pub const GPUREG_00CE: u32 = 206; +pub const GPUREG_00CF: u32 = 207; +pub const GPUREG_TEXENV2_SOURCE: u32 = 208; +pub const GPUREG_TEXENV2_OPERAND: u32 = 209; +pub const GPUREG_TEXENV2_COMBINER: u32 = 210; +pub const GPUREG_TEXENV2_COLOR: u32 = 211; +pub const GPUREG_TEXENV2_SCALE: u32 = 212; +pub const GPUREG_00D5: u32 = 213; +pub const GPUREG_00D6: u32 = 214; +pub const GPUREG_00D7: u32 = 215; +pub const GPUREG_TEXENV3_SOURCE: u32 = 216; +pub const GPUREG_TEXENV3_OPERAND: u32 = 217; +pub const GPUREG_TEXENV3_COMBINER: u32 = 218; +pub const GPUREG_TEXENV3_COLOR: u32 = 219; +pub const GPUREG_TEXENV3_SCALE: u32 = 220; +pub const GPUREG_00DD: u32 = 221; +pub const GPUREG_00DE: u32 = 222; +pub const GPUREG_00DF: u32 = 223; +pub const GPUREG_TEXENV_UPDATE_BUFFER: u32 = 224; +pub const GPUREG_FOG_COLOR: u32 = 225; +pub const GPUREG_00E2: u32 = 226; +pub const GPUREG_00E3: u32 = 227; +pub const GPUREG_GAS_ATTENUATION: u32 = 228; +pub const GPUREG_GAS_ACCMAX: u32 = 229; +pub const GPUREG_FOG_LUT_INDEX: u32 = 230; +pub const GPUREG_00E7: u32 = 231; +pub const GPUREG_FOG_LUT_DATA0: u32 = 232; +pub const GPUREG_FOG_LUT_DATA1: u32 = 233; +pub const GPUREG_FOG_LUT_DATA2: u32 = 234; +pub const GPUREG_FOG_LUT_DATA3: u32 = 235; +pub const GPUREG_FOG_LUT_DATA4: u32 = 236; +pub const GPUREG_FOG_LUT_DATA5: u32 = 237; +pub const GPUREG_FOG_LUT_DATA6: u32 = 238; +pub const GPUREG_FOG_LUT_DATA7: u32 = 239; +pub const GPUREG_TEXENV4_SOURCE: u32 = 240; +pub const GPUREG_TEXENV4_OPERAND: u32 = 241; +pub const GPUREG_TEXENV4_COMBINER: u32 = 242; +pub const GPUREG_TEXENV4_COLOR: u32 = 243; +pub const GPUREG_TEXENV4_SCALE: u32 = 244; +pub const GPUREG_00F5: u32 = 245; +pub const GPUREG_00F6: u32 = 246; +pub const GPUREG_00F7: u32 = 247; +pub const GPUREG_TEXENV5_SOURCE: u32 = 248; +pub const GPUREG_TEXENV5_OPERAND: u32 = 249; +pub const GPUREG_TEXENV5_COMBINER: u32 = 250; +pub const GPUREG_TEXENV5_COLOR: u32 = 251; +pub const GPUREG_TEXENV5_SCALE: u32 = 252; +pub const GPUREG_TEXENV_BUFFER_COLOR: u32 = 253; +pub const GPUREG_00FE: u32 = 254; +pub const GPUREG_00FF: u32 = 255; +pub const GPUREG_COLOR_OPERATION: u32 = 256; +pub const GPUREG_BLEND_FUNC: u32 = 257; +pub const GPUREG_LOGIC_OP: u32 = 258; +pub const GPUREG_BLEND_COLOR: u32 = 259; +pub const GPUREG_FRAGOP_ALPHA_TEST: u32 = 260; +pub const GPUREG_STENCIL_TEST: u32 = 261; +pub const GPUREG_STENCIL_OP: u32 = 262; +pub const GPUREG_DEPTH_COLOR_MASK: u32 = 263; +pub const GPUREG_0108: u32 = 264; +pub const GPUREG_0109: u32 = 265; +pub const GPUREG_010A: u32 = 266; +pub const GPUREG_010B: u32 = 267; +pub const GPUREG_010C: u32 = 268; +pub const GPUREG_010D: u32 = 269; +pub const GPUREG_010E: u32 = 270; +pub const GPUREG_010F: u32 = 271; +pub const GPUREG_FRAMEBUFFER_INVALIDATE: u32 = 272; +pub const GPUREG_FRAMEBUFFER_FLUSH: u32 = 273; +pub const GPUREG_COLORBUFFER_READ: u32 = 274; +pub const GPUREG_COLORBUFFER_WRITE: u32 = 275; +pub const GPUREG_DEPTHBUFFER_READ: u32 = 276; +pub const GPUREG_DEPTHBUFFER_WRITE: u32 = 277; +pub const GPUREG_DEPTHBUFFER_FORMAT: u32 = 278; +pub const GPUREG_COLORBUFFER_FORMAT: u32 = 279; +pub const GPUREG_EARLYDEPTH_TEST2: u32 = 280; +pub const GPUREG_0119: u32 = 281; +pub const GPUREG_011A: u32 = 282; +pub const GPUREG_FRAMEBUFFER_BLOCK32: u32 = 283; +pub const GPUREG_DEPTHBUFFER_LOC: u32 = 284; +pub const GPUREG_COLORBUFFER_LOC: u32 = 285; +pub const GPUREG_FRAMEBUFFER_DIM: u32 = 286; +pub const GPUREG_011F: u32 = 287; +pub const GPUREG_GAS_LIGHT_XY: u32 = 288; +pub const GPUREG_GAS_LIGHT_Z: u32 = 289; +pub const GPUREG_GAS_LIGHT_Z_COLOR: u32 = 290; +pub const GPUREG_GAS_LUT_INDEX: u32 = 291; +pub const GPUREG_GAS_LUT_DATA: u32 = 292; +pub const GPUREG_GAS_ACCMAX_FEEDBACK: u32 = 293; +pub const GPUREG_GAS_DELTAZ_DEPTH: u32 = 294; +pub const GPUREG_0127: u32 = 295; +pub const GPUREG_0128: u32 = 296; +pub const GPUREG_0129: u32 = 297; +pub const GPUREG_012A: u32 = 298; +pub const GPUREG_012B: u32 = 299; +pub const GPUREG_012C: u32 = 300; +pub const GPUREG_012D: u32 = 301; +pub const GPUREG_012E: u32 = 302; +pub const GPUREG_012F: u32 = 303; +pub const GPUREG_FRAGOP_SHADOW: u32 = 304; +pub const GPUREG_0131: u32 = 305; +pub const GPUREG_0132: u32 = 306; +pub const GPUREG_0133: u32 = 307; +pub const GPUREG_0134: u32 = 308; +pub const GPUREG_0135: u32 = 309; +pub const GPUREG_0136: u32 = 310; +pub const GPUREG_0137: u32 = 311; +pub const GPUREG_0138: u32 = 312; +pub const GPUREG_0139: u32 = 313; +pub const GPUREG_013A: u32 = 314; +pub const GPUREG_013B: u32 = 315; +pub const GPUREG_013C: u32 = 316; +pub const GPUREG_013D: u32 = 317; +pub const GPUREG_013E: u32 = 318; +pub const GPUREG_013F: u32 = 319; +pub const GPUREG_LIGHT0_SPECULAR0: u32 = 320; +pub const GPUREG_LIGHT0_SPECULAR1: u32 = 321; +pub const GPUREG_LIGHT0_DIFFUSE: u32 = 322; +pub const GPUREG_LIGHT0_AMBIENT: u32 = 323; +pub const GPUREG_LIGHT0_XY: u32 = 324; +pub const GPUREG_LIGHT0_Z: u32 = 325; +pub const GPUREG_LIGHT0_SPOTDIR_XY: u32 = 326; +pub const GPUREG_LIGHT0_SPOTDIR_Z: u32 = 327; +pub const GPUREG_0148: u32 = 328; +pub const GPUREG_LIGHT0_CONFIG: u32 = 329; +pub const GPUREG_LIGHT0_ATTENUATION_BIAS: u32 = 330; +pub const GPUREG_LIGHT0_ATTENUATION_SCALE: u32 = 331; +pub const GPUREG_014C: u32 = 332; +pub const GPUREG_014D: u32 = 333; +pub const GPUREG_014E: u32 = 334; +pub const GPUREG_014F: u32 = 335; +pub const GPUREG_LIGHT1_SPECULAR0: u32 = 336; +pub const GPUREG_LIGHT1_SPECULAR1: u32 = 337; +pub const GPUREG_LIGHT1_DIFFUSE: u32 = 338; +pub const GPUREG_LIGHT1_AMBIENT: u32 = 339; +pub const GPUREG_LIGHT1_XY: u32 = 340; +pub const GPUREG_LIGHT1_Z: u32 = 341; +pub const GPUREG_LIGHT1_SPOTDIR_XY: u32 = 342; +pub const GPUREG_LIGHT1_SPOTDIR_Z: u32 = 343; +pub const GPUREG_0158: u32 = 344; +pub const GPUREG_LIGHT1_CONFIG: u32 = 345; +pub const GPUREG_LIGHT1_ATTENUATION_BIAS: u32 = 346; +pub const GPUREG_LIGHT1_ATTENUATION_SCALE: u32 = 347; +pub const GPUREG_015C: u32 = 348; +pub const GPUREG_015D: u32 = 349; +pub const GPUREG_015E: u32 = 350; +pub const GPUREG_015F: u32 = 351; +pub const GPUREG_LIGHT2_SPECULAR0: u32 = 352; +pub const GPUREG_LIGHT2_SPECULAR1: u32 = 353; +pub const GPUREG_LIGHT2_DIFFUSE: u32 = 354; +pub const GPUREG_LIGHT2_AMBIENT: u32 = 355; +pub const GPUREG_LIGHT2_XY: u32 = 356; +pub const GPUREG_LIGHT2_Z: u32 = 357; +pub const GPUREG_LIGHT2_SPOTDIR_XY: u32 = 358; +pub const GPUREG_LIGHT2_SPOTDIR_Z: u32 = 359; +pub const GPUREG_0168: u32 = 360; +pub const GPUREG_LIGHT2_CONFIG: u32 = 361; +pub const GPUREG_LIGHT2_ATTENUATION_BIAS: u32 = 362; +pub const GPUREG_LIGHT2_ATTENUATION_SCALE: u32 = 363; +pub const GPUREG_016C: u32 = 364; +pub const GPUREG_016D: u32 = 365; +pub const GPUREG_016E: u32 = 366; +pub const GPUREG_016F: u32 = 367; +pub const GPUREG_LIGHT3_SPECULAR0: u32 = 368; +pub const GPUREG_LIGHT3_SPECULAR1: u32 = 369; +pub const GPUREG_LIGHT3_DIFFUSE: u32 = 370; +pub const GPUREG_LIGHT3_AMBIENT: u32 = 371; +pub const GPUREG_LIGHT3_XY: u32 = 372; +pub const GPUREG_LIGHT3_Z: u32 = 373; +pub const GPUREG_LIGHT3_SPOTDIR_XY: u32 = 374; +pub const GPUREG_LIGHT3_SPOTDIR_Z: u32 = 375; +pub const GPUREG_0178: u32 = 376; +pub const GPUREG_LIGHT3_CONFIG: u32 = 377; +pub const GPUREG_LIGHT3_ATTENUATION_BIAS: u32 = 378; +pub const GPUREG_LIGHT3_ATTENUATION_SCALE: u32 = 379; +pub const GPUREG_017C: u32 = 380; +pub const GPUREG_017D: u32 = 381; +pub const GPUREG_017E: u32 = 382; +pub const GPUREG_017F: u32 = 383; +pub const GPUREG_LIGHT4_SPECULAR0: u32 = 384; +pub const GPUREG_LIGHT4_SPECULAR1: u32 = 385; +pub const GPUREG_LIGHT4_DIFFUSE: u32 = 386; +pub const GPUREG_LIGHT4_AMBIENT: u32 = 387; +pub const GPUREG_LIGHT4_XY: u32 = 388; +pub const GPUREG_LIGHT4_Z: u32 = 389; +pub const GPUREG_LIGHT4_SPOTDIR_XY: u32 = 390; +pub const GPUREG_LIGHT4_SPOTDIR_Z: u32 = 391; +pub const GPUREG_0188: u32 = 392; +pub const GPUREG_LIGHT4_CONFIG: u32 = 393; +pub const GPUREG_LIGHT4_ATTENUATION_BIAS: u32 = 394; +pub const GPUREG_LIGHT4_ATTENUATION_SCALE: u32 = 395; +pub const GPUREG_018C: u32 = 396; +pub const GPUREG_018D: u32 = 397; +pub const GPUREG_018E: u32 = 398; +pub const GPUREG_018F: u32 = 399; +pub const GPUREG_LIGHT5_SPECULAR0: u32 = 400; +pub const GPUREG_LIGHT5_SPECULAR1: u32 = 401; +pub const GPUREG_LIGHT5_DIFFUSE: u32 = 402; +pub const GPUREG_LIGHT5_AMBIENT: u32 = 403; +pub const GPUREG_LIGHT5_XY: u32 = 404; +pub const GPUREG_LIGHT5_Z: u32 = 405; +pub const GPUREG_LIGHT5_SPOTDIR_XY: u32 = 406; +pub const GPUREG_LIGHT5_SPOTDIR_Z: u32 = 407; +pub const GPUREG_0198: u32 = 408; +pub const GPUREG_LIGHT5_CONFIG: u32 = 409; +pub const GPUREG_LIGHT5_ATTENUATION_BIAS: u32 = 410; +pub const GPUREG_LIGHT5_ATTENUATION_SCALE: u32 = 411; +pub const GPUREG_019C: u32 = 412; +pub const GPUREG_019D: u32 = 413; +pub const GPUREG_019E: u32 = 414; +pub const GPUREG_019F: u32 = 415; +pub const GPUREG_LIGHT6_SPECULAR0: u32 = 416; +pub const GPUREG_LIGHT6_SPECULAR1: u32 = 417; +pub const GPUREG_LIGHT6_DIFFUSE: u32 = 418; +pub const GPUREG_LIGHT6_AMBIENT: u32 = 419; +pub const GPUREG_LIGHT6_XY: u32 = 420; +pub const GPUREG_LIGHT6_Z: u32 = 421; +pub const GPUREG_LIGHT6_SPOTDIR_XY: u32 = 422; +pub const GPUREG_LIGHT6_SPOTDIR_Z: u32 = 423; +pub const GPUREG_01A8: u32 = 424; +pub const GPUREG_LIGHT6_CONFIG: u32 = 425; +pub const GPUREG_LIGHT6_ATTENUATION_BIAS: u32 = 426; +pub const GPUREG_LIGHT6_ATTENUATION_SCALE: u32 = 427; +pub const GPUREG_01AC: u32 = 428; +pub const GPUREG_01AD: u32 = 429; +pub const GPUREG_01AE: u32 = 430; +pub const GPUREG_01AF: u32 = 431; +pub const GPUREG_LIGHT7_SPECULAR0: u32 = 432; +pub const GPUREG_LIGHT7_SPECULAR1: u32 = 433; +pub const GPUREG_LIGHT7_DIFFUSE: u32 = 434; +pub const GPUREG_LIGHT7_AMBIENT: u32 = 435; +pub const GPUREG_LIGHT7_XY: u32 = 436; +pub const GPUREG_LIGHT7_Z: u32 = 437; +pub const GPUREG_LIGHT7_SPOTDIR_XY: u32 = 438; +pub const GPUREG_LIGHT7_SPOTDIR_Z: u32 = 439; +pub const GPUREG_01B8: u32 = 440; +pub const GPUREG_LIGHT7_CONFIG: u32 = 441; +pub const GPUREG_LIGHT7_ATTENUATION_BIAS: u32 = 442; +pub const GPUREG_LIGHT7_ATTENUATION_SCALE: u32 = 443; +pub const GPUREG_01BC: u32 = 444; +pub const GPUREG_01BD: u32 = 445; +pub const GPUREG_01BE: u32 = 446; +pub const GPUREG_01BF: u32 = 447; +pub const GPUREG_LIGHTING_AMBIENT: u32 = 448; +pub const GPUREG_01C1: u32 = 449; +pub const GPUREG_LIGHTING_NUM_LIGHTS: u32 = 450; +pub const GPUREG_LIGHTING_CONFIG0: u32 = 451; +pub const GPUREG_LIGHTING_CONFIG1: u32 = 452; +pub const GPUREG_LIGHTING_LUT_INDEX: u32 = 453; +pub const GPUREG_LIGHTING_ENABLE1: u32 = 454; +pub const GPUREG_01C7: u32 = 455; +pub const GPUREG_LIGHTING_LUT_DATA0: u32 = 456; +pub const GPUREG_LIGHTING_LUT_DATA1: u32 = 457; +pub const GPUREG_LIGHTING_LUT_DATA2: u32 = 458; +pub const GPUREG_LIGHTING_LUT_DATA3: u32 = 459; +pub const GPUREG_LIGHTING_LUT_DATA4: u32 = 460; +pub const GPUREG_LIGHTING_LUT_DATA5: u32 = 461; +pub const GPUREG_LIGHTING_LUT_DATA6: u32 = 462; +pub const GPUREG_LIGHTING_LUT_DATA7: u32 = 463; +pub const GPUREG_LIGHTING_LUTINPUT_ABS: u32 = 464; +pub const GPUREG_LIGHTING_LUTINPUT_SELECT: u32 = 465; +pub const GPUREG_LIGHTING_LUTINPUT_SCALE: u32 = 466; +pub const GPUREG_01D3: u32 = 467; +pub const GPUREG_01D4: u32 = 468; +pub const GPUREG_01D5: u32 = 469; +pub const GPUREG_01D6: u32 = 470; +pub const GPUREG_01D7: u32 = 471; +pub const GPUREG_01D8: u32 = 472; +pub const GPUREG_LIGHTING_LIGHT_PERMUTATION: u32 = 473; +pub const GPUREG_01DA: u32 = 474; +pub const GPUREG_01DB: u32 = 475; +pub const GPUREG_01DC: u32 = 476; +pub const GPUREG_01DD: u32 = 477; +pub const GPUREG_01DE: u32 = 478; +pub const GPUREG_01DF: u32 = 479; +pub const GPUREG_01E0: u32 = 480; +pub const GPUREG_01E1: u32 = 481; +pub const GPUREG_01E2: u32 = 482; +pub const GPUREG_01E3: u32 = 483; +pub const GPUREG_01E4: u32 = 484; +pub const GPUREG_01E5: u32 = 485; +pub const GPUREG_01E6: u32 = 486; +pub const GPUREG_01E7: u32 = 487; +pub const GPUREG_01E8: u32 = 488; +pub const GPUREG_01E9: u32 = 489; +pub const GPUREG_01EA: u32 = 490; +pub const GPUREG_01EB: u32 = 491; +pub const GPUREG_01EC: u32 = 492; +pub const GPUREG_01ED: u32 = 493; +pub const GPUREG_01EE: u32 = 494; +pub const GPUREG_01EF: u32 = 495; +pub const GPUREG_01F0: u32 = 496; +pub const GPUREG_01F1: u32 = 497; +pub const GPUREG_01F2: u32 = 498; +pub const GPUREG_01F3: u32 = 499; +pub const GPUREG_01F4: u32 = 500; +pub const GPUREG_01F5: u32 = 501; +pub const GPUREG_01F6: u32 = 502; +pub const GPUREG_01F7: u32 = 503; +pub const GPUREG_01F8: u32 = 504; +pub const GPUREG_01F9: u32 = 505; +pub const GPUREG_01FA: u32 = 506; +pub const GPUREG_01FB: u32 = 507; +pub const GPUREG_01FC: u32 = 508; +pub const GPUREG_01FD: u32 = 509; +pub const GPUREG_01FE: u32 = 510; +pub const GPUREG_01FF: u32 = 511; +pub const GPUREG_ATTRIBBUFFERS_LOC: u32 = 512; +pub const GPUREG_ATTRIBBUFFERS_FORMAT_LOW: u32 = 513; +pub const GPUREG_ATTRIBBUFFERS_FORMAT_HIGH: u32 = 514; +pub const GPUREG_ATTRIBBUFFER0_OFFSET: u32 = 515; +pub const GPUREG_ATTRIBBUFFER0_CONFIG1: u32 = 516; +pub const GPUREG_ATTRIBBUFFER0_CONFIG2: u32 = 517; +pub const GPUREG_ATTRIBBUFFER1_OFFSET: u32 = 518; +pub const GPUREG_ATTRIBBUFFER1_CONFIG1: u32 = 519; +pub const GPUREG_ATTRIBBUFFER1_CONFIG2: u32 = 520; +pub const GPUREG_ATTRIBBUFFER2_OFFSET: u32 = 521; +pub const GPUREG_ATTRIBBUFFER2_CONFIG1: u32 = 522; +pub const GPUREG_ATTRIBBUFFER2_CONFIG2: u32 = 523; +pub const GPUREG_ATTRIBBUFFER3_OFFSET: u32 = 524; +pub const GPUREG_ATTRIBBUFFER3_CONFIG1: u32 = 525; +pub const GPUREG_ATTRIBBUFFER3_CONFIG2: u32 = 526; +pub const GPUREG_ATTRIBBUFFER4_OFFSET: u32 = 527; +pub const GPUREG_ATTRIBBUFFER4_CONFIG1: u32 = 528; +pub const GPUREG_ATTRIBBUFFER4_CONFIG2: u32 = 529; +pub const GPUREG_ATTRIBBUFFER5_OFFSET: u32 = 530; +pub const GPUREG_ATTRIBBUFFER5_CONFIG1: u32 = 531; +pub const GPUREG_ATTRIBBUFFER5_CONFIG2: u32 = 532; +pub const GPUREG_ATTRIBBUFFER6_OFFSET: u32 = 533; +pub const GPUREG_ATTRIBBUFFER6_CONFIG1: u32 = 534; +pub const GPUREG_ATTRIBBUFFER6_CONFIG2: u32 = 535; +pub const GPUREG_ATTRIBBUFFER7_OFFSET: u32 = 536; +pub const GPUREG_ATTRIBBUFFER7_CONFIG1: u32 = 537; +pub const GPUREG_ATTRIBBUFFER7_CONFIG2: u32 = 538; +pub const GPUREG_ATTRIBBUFFER8_OFFSET: u32 = 539; +pub const GPUREG_ATTRIBBUFFER8_CONFIG1: u32 = 540; +pub const GPUREG_ATTRIBBUFFER8_CONFIG2: u32 = 541; +pub const GPUREG_ATTRIBBUFFER9_OFFSET: u32 = 542; +pub const GPUREG_ATTRIBBUFFER9_CONFIG1: u32 = 543; +pub const GPUREG_ATTRIBBUFFER9_CONFIG2: u32 = 544; +pub const GPUREG_ATTRIBBUFFERA_OFFSET: u32 = 545; +pub const GPUREG_ATTRIBBUFFERA_CONFIG1: u32 = 546; +pub const GPUREG_ATTRIBBUFFERA_CONFIG2: u32 = 547; +pub const GPUREG_ATTRIBBUFFERB_OFFSET: u32 = 548; +pub const GPUREG_ATTRIBBUFFERB_CONFIG1: u32 = 549; +pub const GPUREG_ATTRIBBUFFERB_CONFIG2: u32 = 550; +pub const GPUREG_INDEXBUFFER_CONFIG: u32 = 551; +pub const GPUREG_NUMVERTICES: u32 = 552; +pub const GPUREG_GEOSTAGE_CONFIG: u32 = 553; +pub const GPUREG_VERTEX_OFFSET: u32 = 554; +pub const GPUREG_022B: u32 = 555; +pub const GPUREG_022C: u32 = 556; +pub const GPUREG_POST_VERTEX_CACHE_NUM: u32 = 557; +pub const GPUREG_DRAWARRAYS: u32 = 558; +pub const GPUREG_DRAWELEMENTS: u32 = 559; +pub const GPUREG_0230: u32 = 560; +pub const GPUREG_VTX_FUNC: u32 = 561; +pub const GPUREG_FIXEDATTRIB_INDEX: u32 = 562; +pub const GPUREG_FIXEDATTRIB_DATA0: u32 = 563; +pub const GPUREG_FIXEDATTRIB_DATA1: u32 = 564; +pub const GPUREG_FIXEDATTRIB_DATA2: u32 = 565; +pub const GPUREG_0236: u32 = 566; +pub const GPUREG_0237: u32 = 567; +pub const GPUREG_CMDBUF_SIZE0: u32 = 568; +pub const GPUREG_CMDBUF_SIZE1: u32 = 569; +pub const GPUREG_CMDBUF_ADDR0: u32 = 570; +pub const GPUREG_CMDBUF_ADDR1: u32 = 571; +pub const GPUREG_CMDBUF_JUMP0: u32 = 572; +pub const GPUREG_CMDBUF_JUMP1: u32 = 573; +pub const GPUREG_023E: u32 = 574; +pub const GPUREG_023F: u32 = 575; +pub const GPUREG_0240: u32 = 576; +pub const GPUREG_0241: u32 = 577; +pub const GPUREG_VSH_NUM_ATTR: u32 = 578; +pub const GPUREG_0243: u32 = 579; +pub const GPUREG_VSH_COM_MODE: u32 = 580; +pub const GPUREG_START_DRAW_FUNC0: u32 = 581; +pub const GPUREG_0246: u32 = 582; +pub const GPUREG_0247: u32 = 583; +pub const GPUREG_0248: u32 = 584; +pub const GPUREG_0249: u32 = 585; +pub const GPUREG_VSH_OUTMAP_TOTAL1: u32 = 586; +pub const GPUREG_024B: u32 = 587; +pub const GPUREG_024C: u32 = 588; +pub const GPUREG_024D: u32 = 589; +pub const GPUREG_024E: u32 = 590; +pub const GPUREG_024F: u32 = 591; +pub const GPUREG_0250: u32 = 592; +pub const GPUREG_VSH_OUTMAP_TOTAL2: u32 = 593; +pub const GPUREG_GSH_MISC0: u32 = 594; +pub const GPUREG_GEOSTAGE_CONFIG2: u32 = 595; +pub const GPUREG_GSH_MISC1: u32 = 596; +pub const GPUREG_0255: u32 = 597; +pub const GPUREG_0256: u32 = 598; +pub const GPUREG_0257: u32 = 599; +pub const GPUREG_0258: u32 = 600; +pub const GPUREG_0259: u32 = 601; +pub const GPUREG_025A: u32 = 602; +pub const GPUREG_025B: u32 = 603; +pub const GPUREG_025C: u32 = 604; +pub const GPUREG_025D: u32 = 605; +pub const GPUREG_PRIMITIVE_CONFIG: u32 = 606; +pub const GPUREG_RESTART_PRIMITIVE: u32 = 607; +pub const GPUREG_0260: u32 = 608; +pub const GPUREG_0261: u32 = 609; +pub const GPUREG_0262: u32 = 610; +pub const GPUREG_0263: u32 = 611; +pub const GPUREG_0264: u32 = 612; +pub const GPUREG_0265: u32 = 613; +pub const GPUREG_0266: u32 = 614; +pub const GPUREG_0267: u32 = 615; +pub const GPUREG_0268: u32 = 616; +pub const GPUREG_0269: u32 = 617; +pub const GPUREG_026A: u32 = 618; +pub const GPUREG_026B: u32 = 619; +pub const GPUREG_026C: u32 = 620; +pub const GPUREG_026D: u32 = 621; +pub const GPUREG_026E: u32 = 622; +pub const GPUREG_026F: u32 = 623; +pub const GPUREG_0270: u32 = 624; +pub const GPUREG_0271: u32 = 625; +pub const GPUREG_0272: u32 = 626; +pub const GPUREG_0273: u32 = 627; +pub const GPUREG_0274: u32 = 628; +pub const GPUREG_0275: u32 = 629; +pub const GPUREG_0276: u32 = 630; +pub const GPUREG_0277: u32 = 631; +pub const GPUREG_0278: u32 = 632; +pub const GPUREG_0279: u32 = 633; +pub const GPUREG_027A: u32 = 634; +pub const GPUREG_027B: u32 = 635; +pub const GPUREG_027C: u32 = 636; +pub const GPUREG_027D: u32 = 637; +pub const GPUREG_027E: u32 = 638; +pub const GPUREG_027F: u32 = 639; +pub const GPUREG_GSH_BOOLUNIFORM: u32 = 640; +pub const GPUREG_GSH_INTUNIFORM_I0: u32 = 641; +pub const GPUREG_GSH_INTUNIFORM_I1: u32 = 642; +pub const GPUREG_GSH_INTUNIFORM_I2: u32 = 643; +pub const GPUREG_GSH_INTUNIFORM_I3: u32 = 644; +pub const GPUREG_0285: u32 = 645; +pub const GPUREG_0286: u32 = 646; +pub const GPUREG_0287: u32 = 647; +pub const GPUREG_0288: u32 = 648; +pub const GPUREG_GSH_INPUTBUFFER_CONFIG: u32 = 649; +pub const GPUREG_GSH_ENTRYPOINT: u32 = 650; +pub const GPUREG_GSH_ATTRIBUTES_PERMUTATION_LOW: u32 = 651; +pub const GPUREG_GSH_ATTRIBUTES_PERMUTATION_HIGH: u32 = 652; +pub const GPUREG_GSH_OUTMAP_MASK: u32 = 653; +pub const GPUREG_028E: u32 = 654; +pub const GPUREG_GSH_CODETRANSFER_END: u32 = 655; +pub const GPUREG_GSH_FLOATUNIFORM_CONFIG: u32 = 656; +pub const GPUREG_GSH_FLOATUNIFORM_DATA: u32 = 657; +pub const GPUREG_0299: u32 = 665; +pub const GPUREG_029A: u32 = 666; +pub const GPUREG_GSH_CODETRANSFER_CONFIG: u32 = 667; +pub const GPUREG_GSH_CODETRANSFER_DATA: u32 = 668; +pub const GPUREG_02A4: u32 = 676; +pub const GPUREG_GSH_OPDESCS_CONFIG: u32 = 677; +pub const GPUREG_GSH_OPDESCS_DATA: u32 = 678; +pub const GPUREG_02AE: u32 = 686; +pub const GPUREG_02AF: u32 = 687; +pub const GPUREG_VSH_BOOLUNIFORM: u32 = 688; +pub const GPUREG_VSH_INTUNIFORM_I0: u32 = 689; +pub const GPUREG_VSH_INTUNIFORM_I1: u32 = 690; +pub const GPUREG_VSH_INTUNIFORM_I2: u32 = 691; +pub const GPUREG_VSH_INTUNIFORM_I3: u32 = 692; +pub const GPUREG_02B5: u32 = 693; +pub const GPUREG_02B6: u32 = 694; +pub const GPUREG_02B7: u32 = 695; +pub const GPUREG_02B8: u32 = 696; +pub const GPUREG_VSH_INPUTBUFFER_CONFIG: u32 = 697; +pub const GPUREG_VSH_ENTRYPOINT: u32 = 698; +pub const GPUREG_VSH_ATTRIBUTES_PERMUTATION_LOW: u32 = 699; +pub const GPUREG_VSH_ATTRIBUTES_PERMUTATION_HIGH: u32 = 700; +pub const GPUREG_VSH_OUTMAP_MASK: u32 = 701; +pub const GPUREG_02BE: u32 = 702; +pub const GPUREG_VSH_CODETRANSFER_END: u32 = 703; +pub const GPUREG_VSH_FLOATUNIFORM_CONFIG: u32 = 704; +pub const GPUREG_VSH_FLOATUNIFORM_DATA: u32 = 705; +pub const GPUREG_02C9: u32 = 713; +pub const GPUREG_02CA: u32 = 714; +pub const GPUREG_VSH_CODETRANSFER_CONFIG: u32 = 715; +pub const GPUREG_VSH_CODETRANSFER_DATA: u32 = 716; +pub const GPUREG_02D4: u32 = 724; +pub const GPUREG_VSH_OPDESCS_CONFIG: u32 = 725; +pub const GPUREG_VSH_OPDESCS_DATA: u32 = 726; +pub const GPUREG_02DE: u32 = 734; +pub const GPUREG_02DF: u32 = 735; +pub const GPUREG_02E0: u32 = 736; +pub const GPUREG_02E1: u32 = 737; +pub const GPUREG_02E2: u32 = 738; +pub const GPUREG_02E3: u32 = 739; +pub const GPUREG_02E4: u32 = 740; +pub const GPUREG_02E5: u32 = 741; +pub const GPUREG_02E6: u32 = 742; +pub const GPUREG_02E7: u32 = 743; +pub const GPUREG_02E8: u32 = 744; +pub const GPUREG_02E9: u32 = 745; +pub const GPUREG_02EA: u32 = 746; +pub const GPUREG_02EB: u32 = 747; +pub const GPUREG_02EC: u32 = 748; +pub const GPUREG_02ED: u32 = 749; +pub const GPUREG_02EE: u32 = 750; +pub const GPUREG_02EF: u32 = 751; +pub const GPUREG_02F0: u32 = 752; +pub const GPUREG_02F1: u32 = 753; +pub const GPUREG_02F2: u32 = 754; +pub const GPUREG_02F3: u32 = 755; +pub const GPUREG_02F4: u32 = 756; +pub const GPUREG_02F5: u32 = 757; +pub const GPUREG_02F6: u32 = 758; +pub const GPUREG_02F7: u32 = 759; +pub const GPUREG_02F8: u32 = 760; +pub const GPUREG_02F9: u32 = 761; +pub const GPUREG_02FA: u32 = 762; +pub const GPUREG_02FB: u32 = 763; +pub const GPUREG_02FC: u32 = 764; +pub const GPUREG_02FD: u32 = 765; +pub const GPUREG_02FE: u32 = 766; +pub const GPUREG_02FF: u32 = 767; +pub const NDSP_SAMPLE_RATE: f64 = 32728.498046875; +pub const SWKBD_MAX_WORD_LEN: u32 = 40; +pub const SWKBD_MAX_BUTTON_TEXT_LEN: u32 = 16; +pub const SWKBD_MAX_HINT_TEXT_LEN: u32 = 64; +pub const SWKBD_MAX_CALLBACK_MSG_LEN: u32 = 256; +pub const MIISELECTOR_MAGIC: u32 = 333326543; +pub const MIISELECTOR_TITLE_LEN: u32 = 64; +pub const MIISELECTOR_GUESTMII_SLOTS: u32 = 6; +pub const MIISELECTOR_USERMII_SLOTS: u32 = 100; +pub const MIISELECTOR_MIIDATA_SIZE: u32 = 92; +pub const MIISELECTOR_GUESTMII_NAME_LEN: u32 = 12; +pub const SDMC_DIRITER_MAGIC: u32 = 1935961443; +pub const _M_LN2: f64 = 0.6931471805599453; +pub const FP_NAN: u32 = 0; +pub const FP_INFINITE: u32 = 1; +pub const FP_ZERO: u32 = 2; +pub const FP_SUBNORMAL: u32 = 3; +pub const FP_NORMAL: u32 = 4; +pub const MATH_ERRNO: u32 = 1; +pub const MATH_ERREXCEPT: u32 = 2; +pub const math_errhandling: u32 = 1; +pub const DOMAIN: u32 = 1; +pub const SING: u32 = 2; +pub const OVERFLOW: u32 = 3; +pub const UNDERFLOW: u32 = 4; +pub const TLOSS: u32 = 5; +pub const PLOSS: u32 = 6; +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 M_TWOPI: f64 = 6.283185307179586; +pub const M_SQRTPI: f64 = 1.772453850905516; +pub const M_SQRT3: f64 = 1.7320508075688772; +pub const M_IVLN10: f64 = 0.4342944819032518; +pub const M_LOG2_E: f64 = 0.6931471805599453; +pub const M_TAU: f64 = 6.283185307179586; +pub const C3D_AspectRatioTop: f64 = 1.6666666666666667; +pub const C3D_AspectRatioBot: f64 = 1.3333333333333333; +pub const C3D_MTXSTACK_SIZE: u32 = 8; +pub const C3D_FVUNIF_COUNT: u32 = 96; +pub const C3D_IVUNIF_COUNT: u32 = 4; +pub const C3D_DEFAULT_CMDBUF_SIZE: u32 = 262144; +pub const C3DF_LightEnv_IsCP_Any: u32 = 66846720; +pub const C3DF_LightEnv_LutDirtyAll: u32 = 4227858432; +pub type __int8_t = ::libc::c_schar; +pub type __uint8_t = ::libc::c_uchar; +pub type __int16_t = ::libc::c_short; +pub type __uint16_t = ::libc::c_ushort; +pub type __int32_t = ::libc::c_int; +pub type __uint32_t = ::libc::c_uint; +pub type __int64_t = ::libc::c_longlong; +pub type __uint64_t = ::libc::c_ulonglong; +pub type __int_least8_t = ::libc::c_schar; +pub type __uint_least8_t = ::libc::c_uchar; +pub type __int_least16_t = ::libc::c_short; +pub type __uint_least16_t = ::libc::c_ushort; +pub type __int_least32_t = ::libc::c_int; +pub type __uint_least32_t = ::libc::c_uint; +pub type __int_least64_t = ::libc::c_longlong; +pub type __uint_least64_t = ::libc::c_ulonglong; +pub type __intmax_t = ::libc::c_longlong; +pub type __uintmax_t = ::libc::c_ulonglong; +pub type __intptr_t = ::libc::c_int; +pub type __uintptr_t = ::libc::c_uint; +pub type intmax_t = __intmax_t; +pub type uintmax_t = __uintmax_t; +pub type int_least8_t = __int_least8_t; +pub type uint_least8_t = __uint_least8_t; +pub type int_least16_t = __int_least16_t; +pub type uint_least16_t = __uint_least16_t; +pub type int_least32_t = __int_least32_t; +pub type uint_least32_t = __uint_least32_t; +pub type int_least64_t = __int_least64_t; +pub type uint_least64_t = __uint_least64_t; +pub type int_fast8_t = ::libc::c_schar; +pub type uint_fast8_t = ::libc::c_uchar; +pub type int_fast16_t = ::libc::c_short; +pub type uint_fast16_t = ::libc::c_ushort; +pub type int_fast32_t = ::libc::c_int; +pub type uint_fast32_t = ::libc::c_uint; +pub type int_fast64_t = ::libc::c_longlong; +pub type uint_fast64_t = ::libc::c_ulonglong; +pub type wchar_t = ::libc::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct max_align_t { + pub __clang_max_align_nonce1: ::libc::c_longlong, + pub __clang_max_align_nonce2: f64, +} +pub type s8 = i8; +pub type s16 = i16; +pub type s32 = i32; +pub type s64 = i64; +pub type vu8 = u8; +pub type vu16 = u16; +pub type vu32 = u32; +pub type vu64 = u64; +pub type vs8 = s8; +pub type vs16 = s16; +pub type vs32 = s32; +pub type vs64 = s64; +pub type Handle = u32; +pub type Result = s32; +pub type ThreadFunc = ::core::option::Option; +pub type voidfn = ::core::option::Option; +#[repr(C)] +pub struct CpuRegisters { + pub r: [u32; 13usize], + pub sp: u32, + pub lr: u32, + pub pc: u32, + pub cpsr: u32, +} +#[repr(C)] +pub struct FpuRegisters { + pub __bindgen_anon_1: FpuRegisters__bindgen_ty_1, + pub fpscr: u32, + pub fpexc: u32, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union FpuRegisters__bindgen_ty_1 { + pub __bindgen_anon_1: FpuRegisters__bindgen_ty_1__bindgen_ty_1, + pub s: [f32; 32usize], + _bindgen_union_align: [u32; 32usize], +} +#[repr(C, packed)] +#[derive(Debug, Copy, Clone)] +pub struct FpuRegisters__bindgen_ty_1__bindgen_ty_1 { + pub d: [f64; 16usize], +} +pub const RL_SUCCESS: _bindgen_ty_1 = 0; +pub const RL_INFO: _bindgen_ty_1 = 1; +pub const RL_FATAL: _bindgen_ty_1 = 31; +pub const RL_RESET: _bindgen_ty_1 = 30; +pub const RL_REINITIALIZE: _bindgen_ty_1 = 29; +pub const RL_USAGE: _bindgen_ty_1 = 28; +pub const RL_PERMANENT: _bindgen_ty_1 = 27; +pub const RL_TEMPORARY: _bindgen_ty_1 = 26; +pub const RL_STATUS: _bindgen_ty_1 = 25; +pub type _bindgen_ty_1 = u32; +pub const RS_SUCCESS: _bindgen_ty_2 = 0; +pub const RS_NOP: _bindgen_ty_2 = 1; +pub const RS_WOULDBLOCK: _bindgen_ty_2 = 2; +pub const RS_OUTOFRESOURCE: _bindgen_ty_2 = 3; +pub const RS_NOTFOUND: _bindgen_ty_2 = 4; +pub const RS_INVALIDSTATE: _bindgen_ty_2 = 5; +pub const RS_NOTSUPPORTED: _bindgen_ty_2 = 6; +pub const RS_INVALIDARG: _bindgen_ty_2 = 7; +pub const RS_WRONGARG: _bindgen_ty_2 = 8; +pub const RS_CANCELED: _bindgen_ty_2 = 9; +pub const RS_STATUSCHANGED: _bindgen_ty_2 = 10; +pub const RS_INTERNAL: _bindgen_ty_2 = 11; +pub const RS_INVALIDRESVAL: _bindgen_ty_2 = 63; +pub type _bindgen_ty_2 = u32; +pub const RM_COMMON: _bindgen_ty_3 = 0; +pub const RM_KERNEL: _bindgen_ty_3 = 1; +pub const RM_UTIL: _bindgen_ty_3 = 2; +pub const RM_FILE_SERVER: _bindgen_ty_3 = 3; +pub const RM_LOADER_SERVER: _bindgen_ty_3 = 4; +pub const RM_TCB: _bindgen_ty_3 = 5; +pub const RM_OS: _bindgen_ty_3 = 6; +pub const RM_DBG: _bindgen_ty_3 = 7; +pub const RM_DMNT: _bindgen_ty_3 = 8; +pub const RM_PDN: _bindgen_ty_3 = 9; +pub const RM_GSP: _bindgen_ty_3 = 10; +pub const RM_I2C: _bindgen_ty_3 = 11; +pub const RM_GPIO: _bindgen_ty_3 = 12; +pub const RM_DD: _bindgen_ty_3 = 13; +pub const RM_CODEC: _bindgen_ty_3 = 14; +pub const RM_SPI: _bindgen_ty_3 = 15; +pub const RM_PXI: _bindgen_ty_3 = 16; +pub const RM_FS: _bindgen_ty_3 = 17; +pub const RM_DI: _bindgen_ty_3 = 18; +pub const RM_HID: _bindgen_ty_3 = 19; +pub const RM_CAM: _bindgen_ty_3 = 20; +pub const RM_PI: _bindgen_ty_3 = 21; +pub const RM_PM: _bindgen_ty_3 = 22; +pub const RM_PM_LOW: _bindgen_ty_3 = 23; +pub const RM_FSI: _bindgen_ty_3 = 24; +pub const RM_SRV: _bindgen_ty_3 = 25; +pub const RM_NDM: _bindgen_ty_3 = 26; +pub const RM_NWM: _bindgen_ty_3 = 27; +pub const RM_SOC: _bindgen_ty_3 = 28; +pub const RM_LDR: _bindgen_ty_3 = 29; +pub const RM_ACC: _bindgen_ty_3 = 30; +pub const RM_ROMFS: _bindgen_ty_3 = 31; +pub const RM_AM: _bindgen_ty_3 = 32; +pub const RM_HIO: _bindgen_ty_3 = 33; +pub const RM_UPDATER: _bindgen_ty_3 = 34; +pub const RM_MIC: _bindgen_ty_3 = 35; +pub const RM_FND: _bindgen_ty_3 = 36; +pub const RM_MP: _bindgen_ty_3 = 37; +pub const RM_MPWL: _bindgen_ty_3 = 38; +pub const RM_AC: _bindgen_ty_3 = 39; +pub const RM_HTTP: _bindgen_ty_3 = 40; +pub const RM_DSP: _bindgen_ty_3 = 41; +pub const RM_SND: _bindgen_ty_3 = 42; +pub const RM_DLP: _bindgen_ty_3 = 43; +pub const RM_HIO_LOW: _bindgen_ty_3 = 44; +pub const RM_CSND: _bindgen_ty_3 = 45; +pub const RM_SSL: _bindgen_ty_3 = 46; +pub const RM_AM_LOW: _bindgen_ty_3 = 47; +pub const RM_NEX: _bindgen_ty_3 = 48; +pub const RM_FRIENDS: _bindgen_ty_3 = 49; +pub const RM_RDT: _bindgen_ty_3 = 50; +pub const RM_APPLET: _bindgen_ty_3 = 51; +pub const RM_NIM: _bindgen_ty_3 = 52; +pub const RM_PTM: _bindgen_ty_3 = 53; +pub const RM_MIDI: _bindgen_ty_3 = 54; +pub const RM_MC: _bindgen_ty_3 = 55; +pub const RM_SWC: _bindgen_ty_3 = 56; +pub const RM_FATFS: _bindgen_ty_3 = 57; +pub const RM_NGC: _bindgen_ty_3 = 58; +pub const RM_CARD: _bindgen_ty_3 = 59; +pub const RM_CARDNOR: _bindgen_ty_3 = 60; +pub const RM_SDMC: _bindgen_ty_3 = 61; +pub const RM_BOSS: _bindgen_ty_3 = 62; +pub const RM_DBM: _bindgen_ty_3 = 63; +pub const RM_CONFIG: _bindgen_ty_3 = 64; +pub const RM_PS: _bindgen_ty_3 = 65; +pub const RM_CEC: _bindgen_ty_3 = 66; +pub const RM_IR: _bindgen_ty_3 = 67; +pub const RM_UDS: _bindgen_ty_3 = 68; +pub const RM_PL: _bindgen_ty_3 = 69; +pub const RM_CUP: _bindgen_ty_3 = 70; +pub const RM_GYROSCOPE: _bindgen_ty_3 = 71; +pub const RM_MCU: _bindgen_ty_3 = 72; +pub const RM_NS: _bindgen_ty_3 = 73; +pub const RM_NEWS: _bindgen_ty_3 = 74; +pub const RM_RO: _bindgen_ty_3 = 75; +pub const RM_GD: _bindgen_ty_3 = 76; +pub const RM_CARD_SPI: _bindgen_ty_3 = 77; +pub const RM_EC: _bindgen_ty_3 = 78; +pub const RM_WEB_BROWSER: _bindgen_ty_3 = 79; +pub const RM_TEST: _bindgen_ty_3 = 80; +pub const RM_ENC: _bindgen_ty_3 = 81; +pub const RM_PIA: _bindgen_ty_3 = 82; +pub const RM_ACT: _bindgen_ty_3 = 83; +pub const RM_VCTL: _bindgen_ty_3 = 84; +pub const RM_OLV: _bindgen_ty_3 = 85; +pub const RM_NEIA: _bindgen_ty_3 = 86; +pub const RM_NPNS: _bindgen_ty_3 = 87; +pub const RM_AVD: _bindgen_ty_3 = 90; +pub const RM_L2B: _bindgen_ty_3 = 91; +pub const RM_MVD: _bindgen_ty_3 = 92; +pub const RM_NFC: _bindgen_ty_3 = 93; +pub const RM_UART: _bindgen_ty_3 = 94; +pub const RM_SPM: _bindgen_ty_3 = 95; +pub const RM_QTM: _bindgen_ty_3 = 96; +pub const RM_NFP: _bindgen_ty_3 = 97; +pub const RM_APPLICATION: _bindgen_ty_3 = 254; +pub const RM_INVALIDRESVAL: _bindgen_ty_3 = 255; +pub type _bindgen_ty_3 = u32; +pub const RD_SUCCESS: _bindgen_ty_4 = 0; +pub const RD_INVALID_RESULT_VALUE: _bindgen_ty_4 = 1023; +pub const RD_TIMEOUT: _bindgen_ty_4 = 1022; +pub const RD_OUT_OF_RANGE: _bindgen_ty_4 = 1021; +pub const RD_ALREADY_EXISTS: _bindgen_ty_4 = 1020; +pub const RD_CANCEL_REQUESTED: _bindgen_ty_4 = 1019; +pub const RD_NOT_FOUND: _bindgen_ty_4 = 1018; +pub const RD_ALREADY_INITIALIZED: _bindgen_ty_4 = 1017; +pub const RD_NOT_INITIALIZED: _bindgen_ty_4 = 1016; +pub const RD_INVALID_HANDLE: _bindgen_ty_4 = 1015; +pub const RD_INVALID_POINTER: _bindgen_ty_4 = 1014; +pub const RD_INVALID_ADDRESS: _bindgen_ty_4 = 1013; +pub const RD_NOT_IMPLEMENTED: _bindgen_ty_4 = 1012; +pub const RD_OUT_OF_MEMORY: _bindgen_ty_4 = 1011; +pub const RD_MISALIGNED_SIZE: _bindgen_ty_4 = 1010; +pub const RD_MISALIGNED_ADDRESS: _bindgen_ty_4 = 1009; +pub const RD_BUSY: _bindgen_ty_4 = 1008; +pub const RD_NO_DATA: _bindgen_ty_4 = 1007; +pub const RD_INVALID_COMBINATION: _bindgen_ty_4 = 1006; +pub const RD_INVALID_ENUM_VALUE: _bindgen_ty_4 = 1005; +pub const RD_INVALID_SIZE: _bindgen_ty_4 = 1004; +pub const RD_ALREADY_DONE: _bindgen_ty_4 = 1003; +pub const RD_NOT_AUTHORIZED: _bindgen_ty_4 = 1002; +pub const RD_TOO_LARGE: _bindgen_ty_4 = 1001; +pub const RD_INVALID_SELECTION: _bindgen_ty_4 = 1000; +pub type _bindgen_ty_4 = u32; +pub const IPC_BUFFER_R: IPC_BufferRights = 2; +pub const IPC_BUFFER_W: IPC_BufferRights = 4; +pub const IPC_BUFFER_RW: IPC_BufferRights = 6; +pub type IPC_BufferRights = u32; +pub const MEMOP_FREE: MemOp = 1; +pub const MEMOP_RESERVE: MemOp = 2; +pub const MEMOP_ALLOC: MemOp = 3; +pub const MEMOP_MAP: MemOp = 4; +pub const MEMOP_UNMAP: MemOp = 5; +pub const MEMOP_PROT: MemOp = 6; +pub const MEMOP_REGION_APP: MemOp = 256; +pub const MEMOP_REGION_SYSTEM: MemOp = 512; +pub const MEMOP_REGION_BASE: MemOp = 768; +pub const MEMOP_OP_MASK: MemOp = 255; +pub const MEMOP_REGION_MASK: MemOp = 3840; +pub const MEMOP_LINEAR_FLAG: MemOp = 65536; +pub const MEMOP_ALLOC_LINEAR: MemOp = 65539; +pub type MemOp = u32; +pub const MEMSTATE_FREE: MemState = 0; +pub const MEMSTATE_RESERVED: MemState = 1; +pub const MEMSTATE_IO: MemState = 2; +pub const MEMSTATE_STATIC: MemState = 3; +pub const MEMSTATE_CODE: MemState = 4; +pub const MEMSTATE_PRIVATE: MemState = 5; +pub const MEMSTATE_SHARED: MemState = 6; +pub const MEMSTATE_CONTINUOUS: MemState = 7; +pub const MEMSTATE_ALIASED: MemState = 8; +pub const MEMSTATE_ALIAS: MemState = 9; +pub const MEMSTATE_ALIASCODE: MemState = 10; +pub const MEMSTATE_LOCKED: MemState = 11; +pub type MemState = u32; +pub const MEMPERM_READ: MemPerm = 1; +pub const MEMPERM_WRITE: MemPerm = 2; +pub const MEMPERM_EXECUTE: MemPerm = 4; +pub const MEMPERM_DONTCARE: MemPerm = 268435456; +pub type MemPerm = u32; +#[repr(C)] +pub struct MemInfo { + pub base_addr: u32, + pub size: u32, + pub perm: u32, + pub state: u32, +} +#[repr(C)] +pub struct PageInfo { + pub flags: u32, +} +pub const ARBITRATION_SIGNAL: ArbitrationType = 0; +pub const ARBITRATION_WAIT_IF_LESS_THAN: ArbitrationType = 1; +pub const ARBITRATION_DECREMENT_AND_WAIT_IF_LESS_THAN: ArbitrationType = 2; +pub const ARBITRATION_WAIT_IF_LESS_THAN_TIMEOUT: ArbitrationType = 3; +pub const ARBITRATION_DECREMENT_AND_WAIT_IF_LESS_THAN_TIMEOUT: ArbitrationType = 4; +pub type ArbitrationType = u32; +pub const RESET_ONESHOT: ResetType = 0; +pub const RESET_STICKY: ResetType = 1; +pub const RESET_PULSE: ResetType = 2; +pub type ResetType = u32; +pub const THREADINFO_TYPE_UNKNOWN: ThreadInfoType = 0; +pub type ThreadInfoType = u32; +pub const RESLIMIT_PRIORITY: ResourceLimitType = 0; +pub const RESLIMIT_COMMIT: ResourceLimitType = 1; +pub const RESLIMIT_THREAD: ResourceLimitType = 2; +pub const RESLIMIT_EVENT: ResourceLimitType = 3; +pub const RESLIMIT_MUTEX: ResourceLimitType = 4; +pub const RESLIMIT_SEMAPHORE: ResourceLimitType = 5; +pub const RESLIMIT_TIMER: ResourceLimitType = 6; +pub const RESLIMIT_SHAREDMEMORY: ResourceLimitType = 7; +pub const RESLIMIT_ADDRESSARBITER: ResourceLimitType = 8; +pub const RESLIMIT_CPUTIME: ResourceLimitType = 9; +pub const RESLIMIT_BIT: ResourceLimitType = 2147483648; +pub type ResourceLimitType = u32; +#[repr(C)] +pub struct AttachProcessEvent { + pub program_id: u64, + pub process_name: [::libc::c_char; 8usize], + pub process_id: u32, + pub other_flags: u32, +} +pub const EXITPROCESS_EVENT_EXIT: ExitProcessEventReason = 0; +pub const EXITPROCESS_EVENT_TERMINATE: ExitProcessEventReason = 1; +pub const EXITPROCESS_EVENT_DEBUG_TERMINATE: ExitProcessEventReason = 2; +pub type ExitProcessEventReason = u32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ExitProcessEvent { + pub reason: ExitProcessEventReason, +} +#[repr(C)] +pub struct AttachThreadEvent { + pub creator_thread_id: u32, + pub thread_local_storage: u32, + pub entry_point: u32, +} +pub const EXITTHREAD_EVENT_EXIT: ExitThreadEventReason = 0; +pub const EXITTHREAD_EVENT_TERMINATE: ExitThreadEventReason = 1; +pub const EXITTHREAD_EVENT_EXIT_PROCESS: ExitThreadEventReason = 2; +pub const EXITTHREAD_EVENT_TERMINATE_PROCESS: ExitThreadEventReason = 3; +pub type ExitThreadEventReason = u32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ExitThreadEvent { + pub reason: ExitThreadEventReason, +} +pub const USERBREAK_PANIC: UserBreakType = 0; +pub const USERBREAK_ASSERT: UserBreakType = 1; +pub const USERBREAK_USER: UserBreakType = 2; +pub const USERBREAK_LOAD_RO: UserBreakType = 3; +pub const USERBREAK_UNLOAD_RO: UserBreakType = 4; +pub type UserBreakType = u32; +pub const EXCEVENT_UNDEFINED_INSTRUCTION: ExceptionEventType = 0; +pub const EXCEVENT_PREFETCH_ABORT: ExceptionEventType = 1; +pub const EXCEVENT_DATA_ABORT: ExceptionEventType = 2; +pub const EXCEVENT_UNALIGNED_DATA_ACCESS: ExceptionEventType = 3; +pub const EXCEVENT_ATTACH_BREAK: ExceptionEventType = 4; +pub const EXCEVENT_STOP_POINT: ExceptionEventType = 5; +pub const EXCEVENT_USER_BREAK: ExceptionEventType = 6; +pub const EXCEVENT_DEBUGGER_BREAK: ExceptionEventType = 7; +pub const EXCEVENT_UNDEFINED_SYSCALL: ExceptionEventType = 8; +pub type ExceptionEventType = u32; +#[repr(C)] +pub struct FaultExceptionEvent { + pub fault_information: u32, +} +pub const STOPPOINT_SVC_FF: StopPointType = 0; +pub const STOPPOINT_BREAKPOINT: StopPointType = 1; +pub const STOPPOINT_WATCHPOINT: StopPointType = 2; +pub type StopPointType = u32; +#[repr(C)] +pub struct StopPointExceptionEvent { + pub type_: StopPointType, + pub fault_information: u32, +} +#[repr(C)] +pub struct UserBreakExceptionEvent { + pub type_: UserBreakType, + pub croInfo: u32, + pub croInfoSize: u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct DebuggerBreakExceptionEvent { + pub thread_ids: [s32; 4usize], +} +#[repr(C)] +pub struct ExceptionEvent { + pub type_: ExceptionEventType, + pub address: u32, + pub __bindgen_anon_1: ExceptionEvent__bindgen_ty_1, +} +#[repr(C)] +pub struct ExceptionEvent__bindgen_ty_1 { + pub fault: __BindgenUnionField, + pub stop_point: __BindgenUnionField, + pub user_break: __BindgenUnionField, + pub debugger_break: __BindgenUnionField, + pub bindgen_union_field: [u32; 4usize], +} +#[repr(C)] +pub struct ScheduleInOutEvent { + pub clock_tick: u64, +} +#[repr(C)] +pub struct SyscallInOutEvent { + pub clock_tick: u64, + pub syscall: u32, + pub __bindgen_padding_0: u32, +} +#[repr(C)] +pub struct OutputStringEvent { + pub string_addr: u32, + pub string_size: u32, +} +#[repr(C)] +pub struct MapEvent { + pub mapped_addr: u32, + pub mapped_size: u32, + pub memperm: MemPerm, + pub memstate: MemState, +} +pub const DBGEVENT_ATTACH_PROCESS: DebugEventType = 0; +pub const DBGEVENT_ATTACH_THREAD: DebugEventType = 1; +pub const DBGEVENT_EXIT_THREAD: DebugEventType = 2; +pub const DBGEVENT_EXIT_PROCESS: DebugEventType = 3; +pub const DBGEVENT_EXCEPTION: DebugEventType = 4; +pub const DBGEVENT_DLL_LOAD: DebugEventType = 5; +pub const DBGEVENT_DLL_UNLOAD: DebugEventType = 6; +pub const DBGEVENT_SCHEDULE_IN: DebugEventType = 7; +pub const DBGEVENT_SCHEDULE_OUT: DebugEventType = 8; +pub const DBGEVENT_SYSCALL_IN: DebugEventType = 9; +pub const DBGEVENT_SYSCALL_OUT: DebugEventType = 10; +pub const DBGEVENT_OUTPUT_STRING: DebugEventType = 11; +pub const DBGEVENT_MAP: DebugEventType = 12; +pub type DebugEventType = u32; +#[repr(C)] +pub struct DebugEventInfo { + pub type_: DebugEventType, + pub thread_id: u32, + pub flags: u32, + pub remnants: [u8; 4usize], + pub __bindgen_anon_1: DebugEventInfo__bindgen_ty_1, +} +#[repr(C)] +pub struct DebugEventInfo__bindgen_ty_1 { + pub attach_process: __BindgenUnionField, + pub attach_thread: __BindgenUnionField, + pub exit_thread: __BindgenUnionField, + pub exit_process: __BindgenUnionField, + pub exception: __BindgenUnionField, + pub scheduler: __BindgenUnionField, + pub syscall: __BindgenUnionField, + pub output_string: __BindgenUnionField, + pub map: __BindgenUnionField, + pub bindgen_union_field: [u64; 3usize], +} +pub const DBG_INHIBIT_USER_CPU_EXCEPTION_HANDLERS: DebugFlags = 1; +pub const DBG_SIGNAL_FAULT_EXCEPTION_EVENTS: DebugFlags = 2; +pub const DBG_SIGNAL_SCHEDULE_EVENTS: DebugFlags = 4; +pub const DBG_SIGNAL_SYSCALL_EVENTS: DebugFlags = 8; +pub const DBG_SIGNAL_MAP_EVENTS: DebugFlags = 16; +pub type DebugFlags = u32; +#[repr(C)] +pub struct ThreadContext { + pub cpu_registers: CpuRegisters, + pub fpu_registers: FpuRegisters, +} +pub const THREADCONTEXT_CONTROL_CPU_GPRS: ThreadContextControlFlags = 1; +pub const THREADCONTEXT_CONTROL_CPU_SPRS: ThreadContextControlFlags = 2; +pub const THREADCONTEXT_CONTROL_FPU_GPRS: ThreadContextControlFlags = 4; +pub const THREADCONTEXT_CONTROL_FPU_SPRS: ThreadContextControlFlags = 8; +pub const THREADCONTEXT_CONTROL_CPU_REGS: ThreadContextControlFlags = 3; +pub const THREADCONTEXT_CONTROL_FPU_REGS: ThreadContextControlFlags = 12; +pub const THREADCONTEXT_CONTROL_ALL: ThreadContextControlFlags = 15; +pub type ThreadContextControlFlags = u32; +pub const DBGTHREAD_PARAMETER_PRIORITY: DebugThreadParameter = 0; +pub const DBGTHREAD_PARAMETER_SCHEDULING_MASK_LOW: DebugThreadParameter = 1; +pub const DBGTHREAD_PARAMETER_CPU_IDEAL: DebugThreadParameter = 2; +pub const DBGTHREAD_PARAMETER_CPU_CREATOR: DebugThreadParameter = 3; +pub type DebugThreadParameter = u32; +#[repr(C)] +pub struct CodeSetInfo { + pub name: [u8; 8usize], + pub unk1: u16, + pub unk2: u16, + pub unk3: u32, + pub text_addr: u32, + pub text_size: u32, + pub ro_addr: u32, + pub ro_size: u32, + pub rw_addr: u32, + pub rw_size: u32, + pub text_size_total: u32, + pub ro_size_total: u32, + pub rw_size_total: u32, + pub unk4: u32, + pub program_id: u64, +} +#[repr(C)] +pub struct StartupInfo { + pub priority: ::libc::c_int, + pub stack_size: u32, + pub argc: ::libc::c_int, + pub argv: *mut u16, + pub envp: *mut u16, +} +extern "C" { + pub fn svcControlMemory( + addr_out: *mut u32, + addr0: u32, + addr1: u32, + size: u32, + op: MemOp, + perm: MemPerm, + ) -> Result; +} +extern "C" { + pub fn svcControlProcessMemory( + process: Handle, + addr0: u32, + addr1: u32, + size: u32, + type_: u32, + perm: u32, + ) -> Result; +} +extern "C" { + pub fn svcCreateMemoryBlock( + memblock: *mut Handle, + addr: u32, + size: u32, + my_perm: MemPerm, + other_perm: MemPerm, + ) -> Result; +} +extern "C" { + pub fn svcMapMemoryBlock( + memblock: Handle, + addr: u32, + my_perm: MemPerm, + other_perm: MemPerm, + ) -> Result; +} +extern "C" { + pub fn svcMapProcessMemory(process: Handle, destAddress: u32, size: u32) -> Result; +} +extern "C" { + pub fn svcUnmapProcessMemory(process: Handle, destAddress: u32, size: u32) -> Result; +} +extern "C" { + pub fn svcUnmapMemoryBlock(memblock: Handle, addr: u32) -> Result; +} +extern "C" { + pub fn svcStartInterProcessDma( + dma: *mut Handle, + dstProcess: Handle, + dst: *mut ::libc::c_void, + srcProcess: Handle, + src: *const ::libc::c_void, + size: u32, + dmaConfig: *mut ::libc::c_void, + ) -> Result; +} +extern "C" { + pub fn svcStopDma(dma: Handle) -> Result; +} +extern "C" { + pub fn svcGetDmaState(dmaState: *mut ::libc::c_void, dma: Handle) -> Result; +} +extern "C" { + pub fn svcQueryMemory(info: *mut MemInfo, out: *mut PageInfo, addr: u32) -> Result; +} +extern "C" { + pub fn svcQueryProcessMemory( + info: *mut MemInfo, + out: *mut PageInfo, + process: Handle, + addr: u32, + ) -> Result; +} +extern "C" { + pub fn svcInvalidateProcessDataCache( + process: Handle, + addr: *mut ::libc::c_void, + size: u32, + ) -> Result; +} +extern "C" { + pub fn svcStoreProcessDataCache( + process: Handle, + addr: *mut ::libc::c_void, + size: u32, + ) -> Result; +} +extern "C" { + pub fn svcFlushProcessDataCache( + process: Handle, + addr: *const ::libc::c_void, + size: u32, + ) -> Result; +} +extern "C" { + pub fn svcOpenProcess(process: *mut Handle, processId: u32) -> Result; +} +extern "C" { + pub fn svcExitProcess(); +} +extern "C" { + pub fn svcTerminateProcess(process: Handle) -> Result; +} +extern "C" { + pub fn svcGetProcessInfo(out: *mut s64, process: Handle, type_: u32) -> Result; +} +extern "C" { + pub fn svcGetProcessId(out: *mut u32, handle: Handle) -> Result; +} +extern "C" { + pub fn svcGetProcessList( + processCount: *mut s32, + processIds: *mut u32, + processIdMaxCount: s32, + ) -> Result; +} +extern "C" { + pub fn svcGetThreadList( + threadCount: *mut s32, + threadIds: *mut u32, + threadIdMaxCount: s32, + process: Handle, + ) -> Result; +} +extern "C" { + pub fn svcCreatePort( + portServer: *mut Handle, + portClient: *mut Handle, + name: *const ::libc::c_char, + maxSessions: s32, + ) -> Result; +} +extern "C" { + pub fn svcConnectToPort(out: *mut Handle, portName: *const ::libc::c_char) -> Result; +} +extern "C" { + pub fn svcCreateCodeSet( + out: *mut Handle, + info: *const CodeSetInfo, + code_ptr: *mut ::libc::c_void, + ro_ptr: *mut ::libc::c_void, + data_ptr: *mut ::libc::c_void, + ) -> Result; +} +extern "C" { + pub fn svcCreateProcess( + out: *mut Handle, + codeset: Handle, + arm11kernelcaps: *const u32, + arm11kernelcaps_num: u32, + ) -> Result; +} +extern "C" { + pub fn svcGetProcessAffinityMask( + affinitymask: *mut u8, + process: Handle, + processorcount: s32, + ) -> Result; +} +extern "C" { + pub fn svcSetProcessAffinityMask( + process: Handle, + affinitymask: *const u8, + processorcount: s32, + ) -> Result; +} +extern "C" { + pub fn svcGetProcessIdealProcessor(processorid: *mut s32, process: Handle) -> Result; +} +extern "C" { + pub fn svcSetProcessIdealProcessor(process: Handle, processorid: s32) -> Result; +} +extern "C" { + pub fn svcRun(process: Handle, info: *const StartupInfo) -> Result; +} +extern "C" { + pub fn svcCreateThread( + thread: *mut Handle, + entrypoint: ThreadFunc, + arg: u32, + stack_top: *mut u32, + thread_priority: s32, + processor_id: s32, + ) -> Result; +} +extern "C" { + pub fn svcOpenThread(thread: *mut Handle, process: Handle, threadId: u32) -> Result; +} +extern "C" { + pub fn svcExitThread(); +} +extern "C" { + pub fn svcSleepThread(ns: s64); +} +extern "C" { + pub fn svcGetThreadPriority(out: *mut s32, handle: Handle) -> Result; +} +extern "C" { + pub fn svcSetThreadPriority(thread: Handle, prio: s32) -> Result; +} +extern "C" { + pub fn svcGetThreadAffinityMask( + affinitymask: *mut u8, + thread: Handle, + processorcount: s32, + ) -> Result; +} +extern "C" { + pub fn svcSetThreadAffinityMask( + thread: Handle, + affinitymask: *const u8, + processorcount: s32, + ) -> Result; +} +extern "C" { + pub fn svcGetThreadIdealProcessor(processorid: *mut s32, thread: Handle) -> Result; +} +extern "C" { + pub fn svcSetThreadIdealProcessor(thread: Handle, processorid: s32) -> Result; +} +extern "C" { + pub fn svcGetProcessorID() -> s32; +} +extern "C" { + pub fn svcGetThreadId(out: *mut u32, handle: Handle) -> Result; +} +extern "C" { + pub fn svcGetResourceLimit(resourceLimit: *mut Handle, process: Handle) -> Result; +} +extern "C" { + pub fn svcGetResourceLimitLimitValues( + values: *mut s64, + resourceLimit: Handle, + names: *mut ResourceLimitType, + nameCount: s32, + ) -> Result; +} +extern "C" { + pub fn svcGetResourceLimitCurrentValues( + values: *mut s64, + resourceLimit: Handle, + names: *mut ResourceLimitType, + nameCount: s32, + ) -> Result; +} +extern "C" { + pub fn svcSetProcessResourceLimits(process: Handle, resourceLimit: Handle) -> Result; +} +extern "C" { + pub fn svcCreateResourceLimit(resourceLimit: *mut Handle) -> Result; +} +extern "C" { + pub fn svcSetResourceLimitValues( + resourceLimit: Handle, + names: *const ResourceLimitType, + values: *const s64, + nameCount: s32, + ) -> Result; +} +extern "C" { + pub fn svcGetProcessIdOfThread(out: *mut u32, handle: Handle) -> Result; +} +extern "C" { + pub fn svcGetThreadInfo(out: *mut s64, thread: Handle, type_: ThreadInfoType) -> Result; +} +extern "C" { + pub fn svcCreateMutex(mutex: *mut Handle, initially_locked: bool) -> Result; +} +extern "C" { + pub fn svcReleaseMutex(handle: Handle) -> Result; +} +extern "C" { + pub fn svcCreateSemaphore(semaphore: *mut Handle, initial_count: s32, max_count: s32) + -> Result; +} +extern "C" { + pub fn svcReleaseSemaphore(count: *mut s32, semaphore: Handle, release_count: s32) -> Result; +} +extern "C" { + pub fn svcCreateEvent(event: *mut Handle, reset_type: ResetType) -> Result; +} +extern "C" { + pub fn svcSignalEvent(handle: Handle) -> Result; +} +extern "C" { + pub fn svcClearEvent(handle: Handle) -> Result; +} +extern "C" { + pub fn svcWaitSynchronization(handle: Handle, nanoseconds: s64) -> Result; +} +extern "C" { + pub fn svcWaitSynchronizationN( + out: *mut s32, + handles: *const Handle, + handles_num: s32, + wait_all: bool, + nanoseconds: s64, + ) -> Result; +} +extern "C" { + pub fn svcCreateAddressArbiter(arbiter: *mut Handle) -> Result; +} +extern "C" { + pub fn svcArbitrateAddress( + arbiter: Handle, + addr: u32, + type_: ArbitrationType, + value: s32, + nanoseconds: s64, + ) -> Result; +} +extern "C" { + pub fn svcSendSyncRequest(session: Handle) -> Result; +} +extern "C" { + pub fn svcCreateSessionToPort(clientSession: *mut Handle, clientPort: Handle) -> Result; +} +extern "C" { + pub fn svcCreateSession(serverSession: *mut Handle, clientSession: *mut Handle) -> Result; +} +extern "C" { + pub fn svcAcceptSession(session: *mut Handle, port: Handle) -> Result; +} +extern "C" { + pub fn svcReplyAndReceive( + index: *mut s32, + handles: *const Handle, + handleCount: s32, + replyTarget: Handle, + ) -> Result; +} +extern "C" { + pub fn svcBindInterrupt( + interruptId: u32, + eventOrSemaphore: Handle, + priority: s32, + isManualClear: bool, + ) -> Result; +} +extern "C" { + pub fn svcUnbindInterrupt(interruptId: u32, eventOrSemaphore: Handle) -> Result; +} +extern "C" { + pub fn svcCreateTimer(timer: *mut Handle, reset_type: ResetType) -> Result; +} +extern "C" { + pub fn svcSetTimer(timer: Handle, initial: s64, interval: s64) -> Result; +} +extern "C" { + pub fn svcCancelTimer(timer: Handle) -> Result; +} +extern "C" { + pub fn svcClearTimer(timer: Handle) -> Result; +} +extern "C" { + pub fn svcGetSystemTick() -> u64; +} +extern "C" { + pub fn svcCloseHandle(handle: Handle) -> Result; +} +extern "C" { + pub fn svcDuplicateHandle(out: *mut Handle, original: Handle) -> Result; +} +extern "C" { + pub fn svcGetHandleInfo(out: *mut s64, handle: Handle, param: u32) -> Result; +} +extern "C" { + pub fn svcGetSystemInfo(out: *mut s64, type_: u32, param: s32) -> Result; +} +extern "C" { + pub fn svcSetGpuProt(useApplicationRestriction: bool) -> Result; +} +extern "C" { + pub fn svcSetWifiEnabled(enabled: bool) -> Result; +} +extern "C" { + pub fn svcKernelSetState(type_: u32, ...) -> Result; +} +extern "C" { + pub fn svcBreak(breakReason: UserBreakType); +} +extern "C" { + pub fn svcBreakRO(breakReason: UserBreakType, croInfo: *const ::libc::c_void, croInfoSize: u32); +} +extern "C" { + pub fn svcOutputDebugString(str: *const ::libc::c_char, length: s32) -> Result; +} +extern "C" { + pub fn svcDebugActiveProcess(debug: *mut Handle, processId: u32) -> Result; +} +extern "C" { + pub fn svcBreakDebugProcess(debug: Handle) -> Result; +} +extern "C" { + pub fn svcTerminateDebugProcess(debug: Handle) -> Result; +} +extern "C" { + pub fn svcGetProcessDebugEvent(info: *mut DebugEventInfo, debug: Handle) -> Result; +} +extern "C" { + pub fn svcContinueDebugEvent(debug: Handle, flags: DebugFlags) -> Result; +} +extern "C" { + pub fn svcGetDebugThreadContext( + context: *mut ThreadContext, + debug: Handle, + threadId: u32, + controlFlags: ThreadContextControlFlags, + ) -> Result; +} +extern "C" { + pub fn svcSetDebugThreadContext( + debug: Handle, + threadId: u32, + context: *mut ThreadContext, + controlFlags: ThreadContextControlFlags, + ) -> Result; +} +extern "C" { + pub fn svcQueryDebugProcessMemory( + info: *mut MemInfo, + out: *mut PageInfo, + debug: Handle, + addr: u32, + ) -> Result; +} +extern "C" { + pub fn svcReadProcessMemory( + buffer: *mut ::libc::c_void, + debug: Handle, + addr: u32, + size: u32, + ) -> Result; +} +extern "C" { + pub fn svcWriteProcessMemory( + debug: Handle, + buffer: *const ::libc::c_void, + addr: u32, + size: u32, + ) -> Result; +} +extern "C" { + pub fn svcSetHardwareBreakPoint(registerId: s32, control: u32, value: u32) -> Result; +} +extern "C" { + pub fn svcGetDebugThreadParam( + unused: *mut s64, + out: *mut u32, + debug: Handle, + threadId: u32, + parameter: DebugThreadParameter, + ) -> Result; +} +extern "C" { + pub fn svcBackdoor(callback: ::core::option::Option s32>) -> Result; +} +pub const ARM9DESC_MOUNT_NAND: _bindgen_ty_5 = 1; +pub const ARM9DESC_MOUNT_NANDRO_RW: _bindgen_ty_5 = 2; +pub const ARM9DESC_MOUNT_TWLN: _bindgen_ty_5 = 4; +pub const ARM9DESC_MOUNT_WNAND: _bindgen_ty_5 = 8; +pub const ARM9DESC_MOUNT_CARDSPI: _bindgen_ty_5 = 16; +pub const ARM9DESC_USE_SDIF3: _bindgen_ty_5 = 32; +pub const ARM9DESC_CREATE_SEED: _bindgen_ty_5 = 64; +pub const ARM9DESC_USE_CARD_SPI: _bindgen_ty_5 = 128; +pub const ARM9DESC_SD_APPLICATION: _bindgen_ty_5 = 256; +pub const ARM9DESC_MOUNT_SDMC_RW: _bindgen_ty_5 = 512; +pub type _bindgen_ty_5 = u32; +pub const FSACCESS_CATEGORY_SYSTEM_APPLICATION: _bindgen_ty_6 = 1; +pub const FSACCESS_CATEGORY_HARDWARE_CHECK: _bindgen_ty_6 = 2; +pub const FSACCESS_CATEGORY_FILESYSTEM_TOOL: _bindgen_ty_6 = 4; +pub const FSACCESS_DEBUG: _bindgen_ty_6 = 8; +pub const FSACCESS_TWLCARD_BACKUP: _bindgen_ty_6 = 16; +pub const FSACCESS_TWLNAND_DATA: _bindgen_ty_6 = 32; +pub const FSACCESS_BOSS: _bindgen_ty_6 = 64; +pub const FSACCESS_SDMC_RW: _bindgen_ty_6 = 128; +pub const FSACCESS_CORE: _bindgen_ty_6 = 256; +pub const FSACCESS_NANDRO_RO: _bindgen_ty_6 = 512; +pub const FSACCESS_NANDRW: _bindgen_ty_6 = 1024; +pub const FSACCESS_NANDRO_RW: _bindgen_ty_6 = 2048; +pub const FSACCESS_CATEGORY_SYSTEM_SETTINGS: _bindgen_ty_6 = 4096; +pub const FSACCESS_CARDBOARD: _bindgen_ty_6 = 8192; +pub const FSACCESS_EXPORT_IMPORT_IVS: _bindgen_ty_6 = 16384; +pub const FSACCESS_SDMC_WO: _bindgen_ty_6 = 32768; +pub const FSACCESS_SWITCH_CLEANUP: _bindgen_ty_6 = 65536; +pub const FSACCESS_SAVEDATA_MOVE: _bindgen_ty_6 = 131072; +pub const FSACCESS_SHOP: _bindgen_ty_6 = 262144; +pub const FSACCESS_SHELL: _bindgen_ty_6 = 524288; +pub const FSACCESS_CATEGORY_HOME_MENU: _bindgen_ty_6 = 1048576; +pub const FSACCESS_SEEDDB: _bindgen_ty_6 = 2097152; +pub type _bindgen_ty_6 = u32; +pub const RESLIMIT_CATEGORY_APPLICATION: ResourceLimitCategory = 0; +pub const RESLIMIT_CATEGORY_SYS_APPLET: ResourceLimitCategory = 1; +pub const RESLIMIT_CATEGORY_LIB_APPLET: ResourceLimitCategory = 2; +pub const RESLIMIT_CATEGORY_OTHER: ResourceLimitCategory = 3; +pub type ResourceLimitCategory = u32; +pub const SYSMODE_O3DS_PROD: SystemMode = 0; +pub const SYSMODE_N3DS_PROD: SystemMode = 1; +pub const SYSMODE_DEV1: SystemMode = 2; +pub const SYSMODE_DEV2: SystemMode = 3; +pub const SYSMODE_DEV3: SystemMode = 4; +pub const SYSMODE_DEV4: SystemMode = 5; +pub type SystemMode = u32; +#[repr(C)] +pub struct ExHeader_SystemInfoFlags { + pub reserved: [u8; 5usize], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>, + pub remaster_version: u16, +} +impl ExHeader_SystemInfoFlags { + #[inline] + pub fn compress_exefs_code(&self) -> bool { + unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } + } + #[inline] + pub fn set_compress_exefs_code(&mut self, val: bool) { + unsafe { + let val: u8 = ::core::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn is_sd_application(&self) -> bool { + unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) } + } + #[inline] + pub fn set_is_sd_application(&mut self, val: bool) { + unsafe { + let val: u8 = ::core::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + compress_exefs_code: bool, + is_sd_application: bool, + ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let compress_exefs_code: u8 = unsafe { ::core::mem::transmute(compress_exefs_code) }; + compress_exefs_code as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let is_sd_application: u8 = unsafe { ::core::mem::transmute(is_sd_application) }; + is_sd_application as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +pub struct ExHeader_CodeSectionInfo { + pub address: u32, + pub num_pages: u32, + pub size: u32, +} +#[repr(C)] +pub struct ExHeader_CodeSetInfo { + pub name: [::libc::c_char; 8usize], + pub flags: ExHeader_SystemInfoFlags, + pub text: ExHeader_CodeSectionInfo, + pub stack_size: u32, + pub rodata: ExHeader_CodeSectionInfo, + pub reserved: u32, + pub data: ExHeader_CodeSectionInfo, + pub bss_size: u32, +} +#[repr(C)] +pub struct ExHeader_SystemInfo { + pub savedata_size: u64, + pub jump_id: u64, + pub reserved: [u8; 48usize], +} +#[repr(C)] +pub struct ExHeader_SystemControlInfo { + pub codeset_info: ExHeader_CodeSetInfo, + pub dependencies: [u64; 48usize], + pub system_info: ExHeader_SystemInfo, +} +#[repr(C)] +pub struct ExHeader_Arm11StorageInfo { + pub extdata_id: u64, + pub system_savedata_ids: [u32; 2usize], + pub accessible_savedata_ids: u64, + pub fs_access_info: u32, + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>, +} +impl ExHeader_Arm11StorageInfo { + #[inline] + pub fn reserved(&self) -> u32 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 24u8) as u32) } + } + #[inline] + pub fn set_reserved(&mut self, val: u32) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(0usize, 24u8, val as u64) + } + } + #[inline] + pub fn no_romfs(&self) -> bool { + unsafe { ::core::mem::transmute(self._bitfield_1.get(24usize, 1u8) as u8) } + } + #[inline] + pub fn set_no_romfs(&mut self, val: bool) { + unsafe { + let val: u8 = ::core::mem::transmute(val); + self._bitfield_1.set(24usize, 1u8, val as u64) + } + } + #[inline] + pub fn use_extended_savedata_access(&self) -> bool { + unsafe { ::core::mem::transmute(self._bitfield_1.get(25usize, 1u8) as u8) } + } + #[inline] + pub fn set_use_extended_savedata_access(&mut self, val: bool) { + unsafe { + let val: u8 = ::core::mem::transmute(val); + self._bitfield_1.set(25usize, 1u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + reserved: u32, + no_romfs: bool, + use_extended_savedata_access: bool, + ) -> __BindgenBitfieldUnit<[u8; 4usize], u32> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u32> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 24u8, { + let reserved: u32 = unsafe { ::core::mem::transmute(reserved) }; + reserved as u64 + }); + __bindgen_bitfield_unit.set(24usize, 1u8, { + let no_romfs: u8 = unsafe { ::core::mem::transmute(no_romfs) }; + no_romfs as u64 + }); + __bindgen_bitfield_unit.set(25usize, 1u8, { + let use_extended_savedata_access: u8 = + unsafe { ::core::mem::transmute(use_extended_savedata_access) }; + use_extended_savedata_access as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +pub struct ExHeader_Arm11CoreInfo { + pub core_version: u32, + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 3usize], u8>, + pub priority: u8, +} +impl ExHeader_Arm11CoreInfo { + #[inline] + pub fn use_cpu_clockrate_804MHz(&self) -> bool { + unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } + } + #[inline] + pub fn set_use_cpu_clockrate_804MHz(&mut self, val: bool) { + unsafe { + let val: u8 = ::core::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn enable_l2c(&self) -> bool { + unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) } + } + #[inline] + pub fn set_enable_l2c(&mut self, val: bool) { + unsafe { + let val: u8 = ::core::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub fn flag1_unused(&self) -> u8 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 6u8) as u8) } + } + #[inline] + pub fn set_flag1_unused(&mut self, val: u8) { + unsafe { + let val: u8 = ::core::mem::transmute(val); + self._bitfield_1.set(2usize, 6u8, val as u64) + } + } + #[inline] + pub fn n3ds_system_mode(&self) -> SystemMode { + unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 4u8) as u32) } + } + #[inline] + pub fn set_n3ds_system_mode(&mut self, val: SystemMode) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(8usize, 4u8, val as u64) + } + } + #[inline] + pub fn flag2_unused(&self) -> u8 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 4u8) as u8) } + } + #[inline] + pub fn set_flag2_unused(&mut self, val: u8) { + unsafe { + let val: u8 = ::core::mem::transmute(val); + self._bitfield_1.set(12usize, 4u8, val as u64) + } + } + #[inline] + pub fn ideal_processor(&self) -> u8 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(16usize, 2u8) as u8) } + } + #[inline] + pub fn set_ideal_processor(&mut self, val: u8) { + unsafe { + let val: u8 = ::core::mem::transmute(val); + self._bitfield_1.set(16usize, 2u8, val as u64) + } + } + #[inline] + pub fn affinity_mask(&self) -> u8 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(18usize, 2u8) as u8) } + } + #[inline] + pub fn set_affinity_mask(&mut self, val: u8) { + unsafe { + let val: u8 = ::core::mem::transmute(val); + self._bitfield_1.set(18usize, 2u8, val as u64) + } + } + #[inline] + pub fn o3ds_system_mode(&self) -> SystemMode { + unsafe { ::core::mem::transmute(self._bitfield_1.get(20usize, 4u8) as u32) } + } + #[inline] + pub fn set_o3ds_system_mode(&mut self, val: SystemMode) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(20usize, 4u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + use_cpu_clockrate_804MHz: bool, + enable_l2c: bool, + flag1_unused: u8, + n3ds_system_mode: SystemMode, + flag2_unused: u8, + ideal_processor: u8, + affinity_mask: u8, + o3ds_system_mode: SystemMode, + ) -> __BindgenBitfieldUnit<[u8; 3usize], u8> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 3usize], u8> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let use_cpu_clockrate_804MHz: u8 = + unsafe { ::core::mem::transmute(use_cpu_clockrate_804MHz) }; + use_cpu_clockrate_804MHz as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let enable_l2c: u8 = unsafe { ::core::mem::transmute(enable_l2c) }; + enable_l2c as u64 + }); + __bindgen_bitfield_unit.set(2usize, 6u8, { + let flag1_unused: u8 = unsafe { ::core::mem::transmute(flag1_unused) }; + flag1_unused as u64 + }); + __bindgen_bitfield_unit.set(8usize, 4u8, { + let n3ds_system_mode: u32 = unsafe { ::core::mem::transmute(n3ds_system_mode) }; + n3ds_system_mode as u64 + }); + __bindgen_bitfield_unit.set(12usize, 4u8, { + let flag2_unused: u8 = unsafe { ::core::mem::transmute(flag2_unused) }; + flag2_unused as u64 + }); + __bindgen_bitfield_unit.set(16usize, 2u8, { + let ideal_processor: u8 = unsafe { ::core::mem::transmute(ideal_processor) }; + ideal_processor as u64 + }); + __bindgen_bitfield_unit.set(18usize, 2u8, { + let affinity_mask: u8 = unsafe { ::core::mem::transmute(affinity_mask) }; + affinity_mask as u64 + }); + __bindgen_bitfield_unit.set(20usize, 4u8, { + let o3ds_system_mode: u32 = unsafe { ::core::mem::transmute(o3ds_system_mode) }; + o3ds_system_mode as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +pub struct ExHeader_Arm11SystemLocalCapabilities { + pub title_id: u64, + pub core_info: ExHeader_Arm11CoreInfo, + pub reslimits: [u16; 16usize], + pub storage_info: ExHeader_Arm11StorageInfo, + pub service_access: [[::libc::c_char; 8usize]; 34usize], + pub reserved: [u8; 15usize], + pub reslimit_category: ResourceLimitCategory, + pub __bindgen_padding_0: u32, +} +#[repr(C)] +pub struct ExHeader_Arm11KernelCapabilities { + pub descriptors: [u32; 28usize], + pub reserved: [u8; 16usize], +} +#[repr(C)] +pub struct ExHeader_Arm9AccessControl { + pub descriptors: [u8; 15usize], + pub descriptor_version: u8, +} +#[repr(C)] +pub struct ExHeader_AccessControlInfo { + pub local_caps: ExHeader_Arm11SystemLocalCapabilities, + pub kernel_caps: ExHeader_Arm11KernelCapabilities, + pub access_control: ExHeader_Arm9AccessControl, +} +#[repr(C)] +pub struct ExHeader_Info { + pub sci: ExHeader_SystemControlInfo, + pub aci: ExHeader_AccessControlInfo, +} +#[repr(C)] +pub struct ExHeader_AccessDescriptor { + pub signature: [u8; 256usize], + pub ncchModulus: [u8; 256usize], + pub acli: ExHeader_AccessControlInfo, +} +#[repr(C)] +pub struct ExHeader { + pub info: ExHeader_Info, + pub access_descriptor: ExHeader_AccessDescriptor, +} +extern "C" { + pub fn srvInit() -> Result; +} +extern "C" { + pub fn srvExit(); +} +extern "C" { + pub fn srvSetBlockingPolicy(nonBlocking: bool); +} +extern "C" { + pub fn srvGetSessionHandle() -> *mut Handle; +} +extern "C" { + pub fn srvGetServiceHandle(out: *mut Handle, name: *const ::libc::c_char) -> Result; +} +extern "C" { + pub fn srvRegisterClient() -> Result; +} +extern "C" { + pub fn srvEnableNotification(semaphoreOut: *mut Handle) -> Result; +} +extern "C" { + pub fn srvRegisterService( + out: *mut Handle, + name: *const ::libc::c_char, + maxSessions: ::libc::c_int, + ) -> Result; +} +extern "C" { + pub fn srvUnregisterService(name: *const ::libc::c_char) -> Result; +} +extern "C" { + pub fn srvGetServiceHandleDirect(out: *mut Handle, name: *const ::libc::c_char) -> Result; +} +extern "C" { + pub fn srvRegisterPort(name: *const ::libc::c_char, clientHandle: Handle) -> Result; +} +extern "C" { + pub fn srvUnregisterPort(name: *const ::libc::c_char) -> Result; +} +extern "C" { + pub fn srvGetPort(out: *mut Handle, name: *const ::libc::c_char) -> Result; +} +extern "C" { + pub fn srvWaitForPortRegistered(name: *const ::libc::c_char) -> Result; +} +extern "C" { + pub fn srvSubscribe(notificationId: u32) -> Result; +} +extern "C" { + pub fn srvUnsubscribe(notificationId: u32) -> Result; +} +extern "C" { + pub fn srvReceiveNotification(notificationIdOut: *mut u32) -> Result; +} +extern "C" { + pub fn srvPublishToSubscriber(notificationId: u32, flags: u32) -> Result; +} +extern "C" { + pub fn srvPublishAndGetSubscriber( + processIdCountOut: *mut u32, + processIdsOut: *mut u32, + notificationId: u32, + ) -> Result; +} +extern "C" { + pub fn srvIsServiceRegistered(registeredOut: *mut bool, name: *const ::libc::c_char) -> Result; +} +extern "C" { + pub fn srvIsPortRegistered(registeredOut: *mut bool, name: *const ::libc::c_char) -> Result; +} +pub const ERRF_ERRTYPE_GENERIC: ERRF_ErrType = 0; +pub const ERRF_ERRTYPE_MEM_CORRUPT: ERRF_ErrType = 1; +pub const ERRF_ERRTYPE_CARD_REMOVED: ERRF_ErrType = 2; +pub const ERRF_ERRTYPE_EXCEPTION: ERRF_ErrType = 3; +pub const ERRF_ERRTYPE_FAILURE: ERRF_ErrType = 4; +pub const ERRF_ERRTYPE_LOGGED: ERRF_ErrType = 5; +pub type ERRF_ErrType = u32; +pub const ERRF_EXCEPTION_PREFETCH_ABORT: ERRF_ExceptionType = 0; +pub const ERRF_EXCEPTION_DATA_ABORT: ERRF_ExceptionType = 1; +pub const ERRF_EXCEPTION_UNDEFINED: ERRF_ExceptionType = 2; +pub const ERRF_EXCEPTION_VFP: ERRF_ExceptionType = 3; +pub type ERRF_ExceptionType = u32; +#[repr(C)] +pub struct ERRF_ExceptionInfo { + pub type_: ERRF_ExceptionType, + pub reserved: [u8; 3usize], + pub fsr: u32, + pub far: u32, + pub fpexc: u32, + pub fpinst: u32, + pub fpinst2: u32, +} +#[repr(C)] +pub struct ERRF_ExceptionData { + pub excep: ERRF_ExceptionInfo, + pub regs: CpuRegisters, +} +#[repr(C)] +pub struct ERRF_FatalErrInfo { + pub type_: ERRF_ErrType, + pub revHigh: u8, + pub revLow: u16, + pub resCode: u32, + pub pcAddr: u32, + pub procId: u32, + pub __bindgen_padding_0: u32, + pub titleId: u64, + pub appTitleId: u64, + pub data: ERRF_FatalErrInfo__bindgen_ty_1, +} +#[repr(C)] +pub struct ERRF_FatalErrInfo__bindgen_ty_1 { + pub exception_data: __BindgenUnionField, + pub failure_mesg: __BindgenUnionField<[::libc::c_char; 96usize]>, + pub bindgen_union_field: [u32; 24usize], +} +extern "C" { + pub fn errfInit() -> Result; +} +extern "C" { + pub fn errfExit(); +} +extern "C" { + pub fn errfGetSessionHandle() -> *mut Handle; +} +extern "C" { + pub fn ERRF_Throw(error: *const ERRF_FatalErrInfo) -> Result; +} +extern "C" { + pub fn ERRF_ThrowResult(failure: Result) -> Result; +} +extern "C" { + pub fn ERRF_ThrowResultWithMessage(failure: Result, message: *const ::libc::c_char) -> Result; +} +extern "C" { + pub fn ERRF_ExceptionHandler(excep: *mut ERRF_ExceptionInfo, regs: *mut CpuRegisters); +} +pub const MEMREGION_ALL: MemRegion = 0; +pub const MEMREGION_APPLICATION: MemRegion = 1; +pub const MEMREGION_SYSTEM: MemRegion = 2; +pub const MEMREGION_BASE: MemRegion = 3; +pub type MemRegion = u32; +#[repr(C)] +pub struct TickCounter { + pub elapsed: u64, + pub reference: u64, +} +#[repr(C)] +pub struct OS_VersionBin { + pub build: u8, + pub minor: u8, + pub mainver: u8, + pub reserved_x3: u8, + pub region: ::libc::c_char, + pub reserved_x5: [u8; 3usize], +} +extern "C" { + pub fn osConvertVirtToPhys(vaddr: *const ::libc::c_void) -> u32; +} +extern "C" { + pub fn osConvertOldLINEARMemToNew(vaddr: *const ::libc::c_void) -> *mut ::libc::c_void; +} +extern "C" { + pub fn osStrError(error: u32) -> *const ::libc::c_char; +} +extern "C" { + pub fn osGetMemRegionUsed(region: MemRegion) -> s64; +} +extern "C" { + pub fn osGetTime() -> u64; +} +extern "C" { + pub fn osTickCounterRead(cnt: *const TickCounter) -> f64; +} +extern "C" { + pub fn osSetSpeedupEnable(enable: bool); +} +extern "C" { + pub fn osGetSystemVersionData( + nver_versionbin: *mut OS_VersionBin, + cver_versionbin: *mut OS_VersionBin, + ) -> Result; +} +extern "C" { + pub fn osGetSystemVersionDataString( + nver_versionbin: *mut OS_VersionBin, + cver_versionbin: *mut OS_VersionBin, + sysverstr: *mut ::libc::c_char, + sysverstr_maxsize: u32, + ) -> Result; +} +pub type _LOCK_T = i32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __lock_t { + pub lock: _LOCK_T, + pub thread_tag: u32, + pub counter: u32, +} +pub type _LOCK_RECURSIVE_T = __lock_t; +extern "C" { + pub fn __libc_lock_init(lock: *mut _LOCK_T); +} +extern "C" { + pub fn __libc_lock_init_recursive(lock: *mut _LOCK_RECURSIVE_T); +} +extern "C" { + pub fn __libc_lock_close(lock: *mut _LOCK_T); +} +extern "C" { + pub fn __libc_lock_close_recursive(lock: *mut _LOCK_RECURSIVE_T); +} +extern "C" { + pub fn __libc_lock_acquire(lock: *mut _LOCK_T); +} +extern "C" { + pub fn __libc_lock_acquire_recursive(lock: *mut _LOCK_RECURSIVE_T); +} +extern "C" { + pub fn __libc_lock_release(lock: *mut _LOCK_T); +} +extern "C" { + pub fn __libc_lock_release_recursive(lock: *mut _LOCK_RECURSIVE_T); +} +extern "C" { + pub fn __libc_lock_try_acquire(lock: *mut _LOCK_T) -> ::libc::c_int; +} +extern "C" { + pub fn __libc_lock_try_acquire_recursive(lock: *mut _LOCK_RECURSIVE_T) -> ::libc::c_int; +} +pub type LightLock = _LOCK_T; +pub type RecursiveLock = _LOCK_RECURSIVE_T; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LightEvent { + pub state: s32, + pub lock: LightLock, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct LightSemaphore { + pub current_count: s32, + pub num_threads_acq: s16, + pub max_count: s16, +} +extern "C" { + pub fn __sync_get_arbiter() -> Handle; +} +extern "C" { + pub fn LightLock_Init(lock: *mut LightLock); +} +extern "C" { + pub fn LightLock_Lock(lock: *mut LightLock); +} +extern "C" { + pub fn LightLock_TryLock(lock: *mut LightLock) -> ::libc::c_int; +} +extern "C" { + pub fn LightLock_Unlock(lock: *mut LightLock); +} +extern "C" { + pub fn RecursiveLock_Init(lock: *mut RecursiveLock); +} +extern "C" { + pub fn RecursiveLock_Lock(lock: *mut RecursiveLock); +} +extern "C" { + pub fn RecursiveLock_TryLock(lock: *mut RecursiveLock) -> ::libc::c_int; +} +extern "C" { + pub fn RecursiveLock_Unlock(lock: *mut RecursiveLock); +} +extern "C" { + pub fn LightEvent_Init(event: *mut LightEvent, reset_type: ResetType); +} +extern "C" { + pub fn LightEvent_Clear(event: *mut LightEvent); +} +extern "C" { + pub fn LightEvent_Pulse(event: *mut LightEvent); +} +extern "C" { + pub fn LightEvent_Signal(event: *mut LightEvent); +} +extern "C" { + pub fn LightEvent_TryWait(event: *mut LightEvent) -> ::libc::c_int; +} +extern "C" { + pub fn LightEvent_Wait(event: *mut LightEvent); +} +extern "C" { + pub fn LightSemaphore_Init(semaphore: *mut LightSemaphore, initial_count: s16, max_count: s16); +} +extern "C" { + pub fn LightSemaphore_Acquire(semaphore: *mut LightSemaphore, count: s32); +} +extern "C" { + pub fn LightSemaphore_Release(semaphore: *mut LightSemaphore, count: s32); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct Thread_tag { + _unused: [u8; 0], +} +pub type Thread = *mut Thread_tag; +pub type ExceptionHandler = ::core::option::Option< + unsafe extern "C" fn(excep: *mut ERRF_ExceptionInfo, regs: *mut CpuRegisters), +>; +extern "C" { + pub fn threadCreate( + entrypoint: ThreadFunc, + arg: *mut ::libc::c_void, + stack_size: usize, + prio: ::libc::c_int, + affinity: ::libc::c_int, + detached: bool, + ) -> Thread; +} +extern "C" { + pub fn threadGetHandle(thread: Thread) -> Handle; +} +extern "C" { + pub fn threadGetExitCode(thread: Thread) -> ::libc::c_int; +} +extern "C" { + pub fn threadFree(thread: Thread); +} +extern "C" { + pub fn threadJoin(thread: Thread, timeout_ns: u64) -> Result; +} +extern "C" { + pub fn threadDetach(thread: Thread); +} +extern "C" { + pub fn threadGetCurrent() -> Thread; +} +extern "C" { + pub fn threadExit(rc: ::libc::c_int); +} +#[repr(C)] +pub struct GSPGPU_FramebufferInfo { + pub active_framebuf: u32, + pub framebuf0_vaddr: *mut u32, + pub framebuf1_vaddr: *mut u32, + pub framebuf_widthbytesize: u32, + pub format: u32, + pub framebuf_dispselect: u32, + pub unk: u32, +} +pub const GSP_RGBA8_OES: GSPGPU_FramebufferFormats = 0; +pub const GSP_BGR8_OES: GSPGPU_FramebufferFormats = 1; +pub const GSP_RGB565_OES: GSPGPU_FramebufferFormats = 2; +pub const GSP_RGB5_A1_OES: GSPGPU_FramebufferFormats = 3; +pub const GSP_RGBA4_OES: GSPGPU_FramebufferFormats = 4; +pub type GSPGPU_FramebufferFormats = u32; +#[repr(C)] +pub struct GSPGPU_CaptureInfoEntry { + pub framebuf0_vaddr: *mut u32, + pub framebuf1_vaddr: *mut u32, + pub format: u32, + pub framebuf_widthbytesize: u32, +} +#[repr(C)] +pub struct GSPGPU_CaptureInfo { + pub screencapture: [GSPGPU_CaptureInfoEntry; 2usize], +} +pub const GSPGPU_EVENT_PSC0: GSPGPU_Event = 0; +pub const GSPGPU_EVENT_PSC1: GSPGPU_Event = 1; +pub const GSPGPU_EVENT_VBlank0: GSPGPU_Event = 2; +pub const GSPGPU_EVENT_VBlank1: GSPGPU_Event = 3; +pub const GSPGPU_EVENT_PPF: GSPGPU_Event = 4; +pub const GSPGPU_EVENT_P3D: GSPGPU_Event = 5; +pub const GSPGPU_EVENT_DMA: GSPGPU_Event = 6; +pub const GSPGPU_EVENT_MAX: GSPGPU_Event = 7; +pub type GSPGPU_Event = u32; +extern "C" { + pub fn gspInit() -> Result; +} +extern "C" { + pub fn gspExit(); +} +extern "C" { + pub fn gspSetEventCallback( + id: GSPGPU_Event, + cb: ThreadFunc, + data: *mut ::libc::c_void, + oneShot: bool, + ); +} +extern "C" { + pub fn gspInitEventHandler(gspEvent: Handle, gspSharedMem: *mut vu8, gspThreadId: u8) + -> Result; +} +extern "C" { + pub fn gspExitEventHandler(); +} +extern "C" { + pub fn gspWaitForEvent(id: GSPGPU_Event, nextEvent: bool); +} +extern "C" { + pub fn gspWaitForAnyEvent() -> GSPGPU_Event; +} +extern "C" { + pub fn gspSubmitGxCommand(sharedGspCmdBuf: *mut u32, gxCommand: *mut u32) -> Result; +} +extern "C" { + pub fn GSPGPU_AcquireRight(flags: u8) -> Result; +} +extern "C" { + pub fn GSPGPU_ReleaseRight() -> Result; +} +extern "C" { + pub fn GSPGPU_ImportDisplayCaptureInfo(captureinfo: *mut GSPGPU_CaptureInfo) -> Result; +} +extern "C" { + pub fn GSPGPU_SaveVramSysArea() -> Result; +} +extern "C" { + pub fn GSPGPU_RestoreVramSysArea() -> Result; +} +extern "C" { + pub fn GSPGPU_SetLcdForceBlack(flags: u8) -> Result; +} +extern "C" { + pub fn GSPGPU_SetBufferSwap(screenid: u32, framebufinfo: *mut GSPGPU_FramebufferInfo) + -> Result; +} +extern "C" { + pub fn GSPGPU_FlushDataCache(adr: *const ::libc::c_void, size: u32) -> Result; +} +extern "C" { + pub fn GSPGPU_InvalidateDataCache(adr: *const ::libc::c_void, size: u32) -> Result; +} +extern "C" { + pub fn GSPGPU_WriteHWRegs(regAddr: u32, data: *mut u32, size: u8) -> Result; +} +extern "C" { + pub fn GSPGPU_WriteHWRegsWithMask( + regAddr: u32, + data: *mut u32, + datasize: u8, + maskdata: *mut u32, + masksize: u8, + ) -> Result; +} +extern "C" { + pub fn GSPGPU_ReadHWRegs(regAddr: u32, data: *mut u32, size: u8) -> Result; +} +extern "C" { + pub fn GSPGPU_RegisterInterruptRelayQueue( + eventHandle: Handle, + flags: u32, + outMemHandle: *mut Handle, + threadID: *mut u8, + ) -> Result; +} +extern "C" { + pub fn GSPGPU_UnregisterInterruptRelayQueue() -> Result; +} +extern "C" { + pub fn GSPGPU_TriggerCmdReqQueue() -> Result; +} +extern "C" { + pub fn GSPGPU_SetLedForceOff(disable: bool) -> Result; +} +pub const GFX_TOP: gfxScreen_t = 0; +pub const GFX_BOTTOM: gfxScreen_t = 1; +pub type gfxScreen_t = u32; +pub const GFX_LEFT: gfx3dSide_t = 0; +pub const GFX_RIGHT: gfx3dSide_t = 1; +pub type gfx3dSide_t = u32; +extern "C" { + pub fn gfxInitDefault(); +} +extern "C" { + pub fn gfxInit( + topFormat: GSPGPU_FramebufferFormats, + bottomFormat: GSPGPU_FramebufferFormats, + vrambuffers: bool, + ); +} +extern "C" { + pub fn gfxExit(); +} +extern "C" { + pub fn gfxSet3D(enable: bool); +} +extern "C" { + pub fn gfxIs3D() -> bool; +} +extern "C" { + pub fn gfxSetScreenFormat(screen: gfxScreen_t, format: GSPGPU_FramebufferFormats); +} +extern "C" { + pub fn gfxGetScreenFormat(screen: gfxScreen_t) -> GSPGPU_FramebufferFormats; +} +extern "C" { + pub fn gfxSetDoubleBuffering(screen: gfxScreen_t, doubleBuffering: bool); +} +extern "C" { + pub fn gfxFlushBuffers(); +} +extern "C" { + pub fn gfxConfigScreen(scr: gfxScreen_t, immediate: bool); +} +extern "C" { + pub fn gfxSwapBuffers(); +} +extern "C" { + pub fn gfxSwapBuffersGpu(); +} +extern "C" { + pub fn gfxGetFramebuffer( + screen: gfxScreen_t, + side: gfx3dSide_t, + width: *mut u16, + height: *mut u16, + ) -> *mut u8; +} +extern "C" { + pub static mut gfxTopLeftFramebuffers: [*mut u8; 2usize]; +} +extern "C" { + pub static mut gfxTopRightFramebuffers: [*mut u8; 2usize]; +} +extern "C" { + pub static mut gfxBottomFramebuffers: [*mut u8; 2usize]; +} +pub type ConsolePrint = ::core::option::Option< + unsafe extern "C" fn(con: *mut ::libc::c_void, c: ::libc::c_int) -> bool, +>; +#[repr(C)] +pub struct ConsoleFont { + pub gfx: *mut u8, + pub asciiOffset: u16, + pub numChars: u16, +} +#[repr(C)] +pub struct PrintConsole { + pub font: ConsoleFont, + pub frameBuffer: *mut u16, + pub cursorX: ::libc::c_int, + pub cursorY: ::libc::c_int, + pub prevCursorX: ::libc::c_int, + pub prevCursorY: ::libc::c_int, + pub consoleWidth: ::libc::c_int, + pub consoleHeight: ::libc::c_int, + pub windowX: ::libc::c_int, + pub windowY: ::libc::c_int, + pub windowWidth: ::libc::c_int, + pub windowHeight: ::libc::c_int, + pub tabSize: ::libc::c_int, + pub fg: ::libc::c_int, + pub bg: ::libc::c_int, + pub flags: ::libc::c_int, + pub PrintChar: ConsolePrint, + pub consoleInitialised: bool, +} +pub const debugDevice_NULL: debugDevice = 0; +pub const debugDevice_SVC: debugDevice = 1; +pub const debugDevice_CONSOLE: debugDevice = 2; +pub const debugDevice_3DMOO: debugDevice = 1; +pub type debugDevice = u32; +extern "C" { + pub fn consoleSetFont(console: *mut PrintConsole, font: *mut ConsoleFont); +} +extern "C" { + pub fn consoleSetWindow( + console: *mut PrintConsole, + x: ::libc::c_int, + y: ::libc::c_int, + width: ::libc::c_int, + height: ::libc::c_int, + ); +} +extern "C" { + pub fn consoleGetDefault() -> *mut PrintConsole; +} +extern "C" { + pub fn consoleSelect(console: *mut PrintConsole) -> *mut PrintConsole; +} +extern "C" { + pub fn consoleInit(screen: gfxScreen_t, console: *mut PrintConsole) -> *mut PrintConsole; +} +extern "C" { + pub fn consoleDebugInit(device: debugDevice); +} +extern "C" { + pub fn consoleClear(); +} +pub const RUNFLAG_APTWORKAROUND: _bindgen_ty_7 = 1; +pub const RUNFLAG_APTREINIT: _bindgen_ty_7 = 2; +pub const RUNFLAG_APTCHAINLOAD: _bindgen_ty_7 = 4; +pub type _bindgen_ty_7 = u32; +extern "C" { + pub fn envGetHandle(name: *const ::libc::c_char) -> Handle; +} +pub type _off_t = __int64_t; +pub type _fpos_t = __int64_t; +pub type __ino_t = __uint32_t; +pub type __dev_t = __uint32_t; +pub type u_int8_t = __uint8_t; +pub type u_int16_t = __uint16_t; +pub type u_int32_t = __uint32_t; +pub type u_int64_t = __uint64_t; +pub type register_t = ::libc::c_int; +pub type __blkcnt_t = ::libc::c_long; +pub type __blksize_t = ::libc::c_long; +pub type __fsblkcnt_t = __uint64_t; +pub type __fsfilcnt_t = __uint32_t; +pub type __pid_t = ::libc::c_int; +pub type __uid_t = ::libc::c_ushort; +pub type __gid_t = ::libc::c_ushort; +pub type __id_t = __uint32_t; +pub type __mode_t = __uint32_t; +pub type _off64_t = ::libc::c_longlong; +pub type __off_t = _off_t; +pub type __loff_t = _off64_t; +pub type __key_t = ::libc::c_long; +pub type __size_t = ::libc::c_uint; +pub type _ssize_t = ::libc::c_int; +pub type __ssize_t = _ssize_t; +pub type wint_t = ::libc::c_int; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _mbstate_t { + pub __count: ::libc::c_int, + pub __value: _mbstate_t__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _mbstate_t__bindgen_ty_1 { + pub __wch: wint_t, + pub __wchb: [::libc::c_uchar; 4usize], + _bindgen_union_align: u32, +} +pub type _flock_t = _LOCK_RECURSIVE_T; +pub type _iconv_t = *mut ::libc::c_void; +pub type __clock_t = ::libc::c_ulong; +pub type __time_t = __int_least64_t; +pub type __clockid_t = ::libc::c_ulong; +pub type __timer_t = ::libc::c_ulong; +pub type __sa_family_t = __uint8_t; +pub type __socklen_t = __uint32_t; +pub type __nl_item = ::libc::c_int; +pub type __nlink_t = ::libc::c_ushort; +pub type __suseconds_t = ::libc::c_long; +pub type __useconds_t = ::libc::c_ulong; +pub type __sigset_t = ::libc::c_ulong; +pub type suseconds_t = __suseconds_t; +pub type time_t = __int_least64_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct timeval { + pub tv_sec: time_t, + pub tv_usec: suseconds_t, + pub __bindgen_padding_0: u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct timespec { + pub tv_sec: time_t, + pub tv_nsec: ::libc::c_long, + pub __bindgen_padding_0: u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct itimerspec { + pub it_interval: timespec, + pub it_value: timespec, +} +pub type sigset_t = __sigset_t; +pub type fd_mask = ::libc::c_ulong; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _types_fd_set { + pub fds_bits: [fd_mask; 2usize], +} +extern "C" { + pub fn select( + __n: ::libc::c_int, + __readfds: *mut _types_fd_set, + __writefds: *mut _types_fd_set, + __exceptfds: *mut _types_fd_set, + __timeout: *mut timeval, + ) -> ::libc::c_int; +} +extern "C" { + pub fn pselect( + __n: ::libc::c_int, + __readfds: *mut _types_fd_set, + __writefds: *mut _types_fd_set, + __exceptfds: *mut _types_fd_set, + __timeout: *const timespec, + __set: *const sigset_t, + ) -> ::libc::c_int; +} +pub type in_addr_t = __uint32_t; +pub type in_port_t = __uint16_t; +pub type u_char = ::libc::c_uchar; +pub type u_short = ::libc::c_ushort; +pub type u_int = ::libc::c_uint; +pub type u_long = ::libc::c_ulong; +pub type ushort = ::libc::c_ushort; +pub type uint = ::libc::c_uint; +pub type ulong = ::libc::c_ulong; +pub type blkcnt_t = __blkcnt_t; +pub type blksize_t = __blksize_t; +pub type clock_t = ::libc::c_ulong; +pub type daddr_t = ::libc::c_long; +pub type caddr_t = *mut ::libc::c_char; +pub type fsblkcnt_t = __fsblkcnt_t; +pub type fsfilcnt_t = __fsfilcnt_t; +pub type id_t = __id_t; +pub type ino_t = __ino_t; +pub type off_t = __off_t; +pub type dev_t = __dev_t; +pub type uid_t = __uid_t; +pub type gid_t = __gid_t; +pub type pid_t = __pid_t; +pub type key_t = __key_t; +pub type mode_t = __mode_t; +pub type nlink_t = __nlink_t; +pub type clockid_t = __clockid_t; +pub type timer_t = __timer_t; +pub type useconds_t = __useconds_t; +pub type sbintime_t = __int64_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sched_param { + pub sched_priority: ::libc::c_int, +} +pub type pthread_t = __uint32_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pthread_attr_t { + pub is_initialized: ::libc::c_int, + pub stackaddr: *mut ::libc::c_void, + pub stacksize: ::libc::c_int, + pub contentionscope: ::libc::c_int, + pub inheritsched: ::libc::c_int, + pub schedpolicy: ::libc::c_int, + pub schedparam: sched_param, + pub detachstate: ::libc::c_int, +} +pub type pthread_mutex_t = __uint32_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pthread_mutexattr_t { + pub is_initialized: ::libc::c_int, + pub recursive: ::libc::c_int, +} +pub type pthread_cond_t = __uint32_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pthread_condattr_t { + pub is_initialized: ::libc::c_int, + pub clock: clock_t, +} +pub type pthread_key_t = __uint32_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct pthread_once_t { + pub is_initialized: ::libc::c_int, + pub init_executed: ::libc::c_int, +} +pub const DECOMPRESS_DUMMY: decompressType = 0; +pub const DECOMPRESS_LZSS: decompressType = 16; +pub const DECOMPRESS_LZ10: decompressType = 16; +pub const DECOMPRESS_LZ11: decompressType = 17; +pub const DECOMPRESS_HUFF1: decompressType = 33; +pub const DECOMPRESS_HUFF2: decompressType = 34; +pub const DECOMPRESS_HUFF3: decompressType = 35; +pub const DECOMPRESS_HUFF4: decompressType = 36; +pub const DECOMPRESS_HUFF5: decompressType = 37; +pub const DECOMPRESS_HUFF6: decompressType = 38; +pub const DECOMPRESS_HUFF7: decompressType = 39; +pub const DECOMPRESS_HUFF8: decompressType = 40; +pub const DECOMPRESS_HUFF: decompressType = 40; +pub const DECOMPRESS_RLE: decompressType = 48; +pub type decompressType = u32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct decompressIOVec { + pub data: *mut ::libc::c_void, + pub size: usize, +} +pub type decompressCallback = ::core::option::Option< + unsafe extern "C" fn( + userdata: *mut ::libc::c_void, + buffer: *mut ::libc::c_void, + size: usize, + ) -> isize, +>; +extern "C" { + pub fn decompressCallback_FD( + userdata: *mut ::libc::c_void, + buffer: *mut ::libc::c_void, + size: usize, + ) -> isize; +} +extern "C" { + pub fn decompressCallback_Stdio( + userdata: *mut ::libc::c_void, + buffer: *mut ::libc::c_void, + size: usize, + ) -> isize; +} +extern "C" { + pub fn decompressHeader( + type_: *mut decompressType, + size: *mut usize, + callback: decompressCallback, + userdata: *mut ::libc::c_void, + insize: usize, + ) -> isize; +} +extern "C" { + pub fn decompressV( + iov: *const decompressIOVec, + iovcnt: usize, + callback: decompressCallback, + userdata: *mut ::libc::c_void, + insize: usize, + ) -> bool; +} +extern "C" { + pub fn decompressV_LZSS( + iov: *const decompressIOVec, + iovcnt: usize, + callback: decompressCallback, + userdata: *mut ::libc::c_void, + insize: usize, + ) -> bool; +} +extern "C" { + pub fn decompressV_LZ11( + iov: *const decompressIOVec, + iovcnt: usize, + callback: decompressCallback, + userdata: *mut ::libc::c_void, + insize: usize, + ) -> bool; +} +extern "C" { + pub fn decompressV_Huff( + bits: usize, + iov: *const decompressIOVec, + iovcnt: usize, + callback: decompressCallback, + userdata: *mut ::libc::c_void, + insize: usize, + ) -> bool; +} +extern "C" { + pub fn decompressV_RLE( + iov: *const decompressIOVec, + iovcnt: usize, + callback: decompressCallback, + userdata: *mut ::libc::c_void, + insize: usize, + ) -> bool; +} +extern "C" { + pub fn decode_utf8(out: *mut u32, in_: *const u8) -> isize; +} +extern "C" { + pub fn decode_utf16(out: *mut u32, in_: *const u16) -> isize; +} +extern "C" { + pub fn encode_utf8(out: *mut u8, in_: u32) -> isize; +} +extern "C" { + pub fn encode_utf16(out: *mut u16, in_: u32) -> isize; +} +extern "C" { + pub fn utf8_to_utf16(out: *mut u16, in_: *const u8, len: usize) -> isize; +} +extern "C" { + pub fn utf8_to_utf32(out: *mut u32, in_: *const u8, len: usize) -> isize; +} +extern "C" { + pub fn utf16_to_utf8(out: *mut u8, in_: *const u16, len: usize) -> isize; +} +extern "C" { + pub fn utf16_to_utf32(out: *mut u32, in_: *const u16, len: usize) -> isize; +} +extern "C" { + pub fn utf32_to_utf8(out: *mut u8, in_: *const u32, len: usize) -> isize; +} +extern "C" { + pub fn utf32_to_utf16(out: *mut u16, in_: *const u32, len: usize) -> isize; +} +extern "C" { + pub fn linearAlloc(size: usize) -> *mut ::libc::c_void; +} +extern "C" { + pub fn linearMemAlign(size: usize, alignment: usize) -> *mut ::libc::c_void; +} +extern "C" { + pub fn linearRealloc(mem: *mut ::libc::c_void, size: usize) -> *mut ::libc::c_void; +} +extern "C" { + pub fn linearGetSize(mem: *mut ::libc::c_void) -> usize; +} +extern "C" { + pub fn linearFree(mem: *mut ::libc::c_void); +} +extern "C" { + pub fn linearSpaceFree() -> u32; +} +extern "C" { + pub fn mappableAlloc(size: usize) -> *mut ::libc::c_void; +} +extern "C" { + pub fn mappableGetSize(mem: *mut ::libc::c_void) -> usize; +} +extern "C" { + pub fn mappableFree(mem: *mut ::libc::c_void); +} +extern "C" { + pub fn mappableSpaceFree() -> u32; +} +extern "C" { + pub fn vramAlloc(size: usize) -> *mut ::libc::c_void; +} +extern "C" { + pub fn vramMemAlign(size: usize, alignment: usize) -> *mut ::libc::c_void; +} +extern "C" { + pub fn vramRealloc(mem: *mut ::libc::c_void, size: usize) -> *mut ::libc::c_void; +} +extern "C" { + pub fn vramGetSize(mem: *mut ::libc::c_void) -> usize; +} +extern "C" { + pub fn vramFree(mem: *mut ::libc::c_void); +} +extern "C" { + pub fn vramSpaceFree() -> u32; +} +pub const AC_OPEN: acSecurityMode = 0; +pub const AC_WEP_40BIT: acSecurityMode = 1; +pub const AC_WEP_104BIT: acSecurityMode = 2; +pub const AC_WEP_128BIT: acSecurityMode = 3; +pub const AC_WPA_TKIP: acSecurityMode = 4; +pub const AC_WPA2_TKIP: acSecurityMode = 5; +pub const AC_WPA_AES: acSecurityMode = 6; +pub const AC_WPA2_AES: acSecurityMode = 7; +pub type acSecurityMode = u32; +extern "C" { + pub fn acInit() -> Result; +} +extern "C" { + pub fn acExit(); +} +extern "C" { + pub fn acWaitInternetConnection() -> Result; +} +extern "C" { + pub fn ACU_GetWifiStatus(out: *mut u32) -> Result; +} +extern "C" { + pub fn ACU_GetStatus(out: *mut u32) -> Result; +} +extern "C" { + pub fn ACU_GetSecurityMode(mode: *mut acSecurityMode) -> Result; +} +extern "C" { + pub fn ACU_GetSSID(SSID: *mut ::libc::c_char) -> Result; +} +extern "C" { + pub fn ACU_GetSSIDLength(out: *mut u32) -> Result; +} +extern "C" { + pub fn ACU_GetProxyEnable(enable: *mut bool) -> Result; +} +extern "C" { + pub fn ACU_GetProxyPort(out: *mut u32) -> Result; +} +extern "C" { + pub fn ACU_GetProxyUserName(username: *mut ::libc::c_char) -> Result; +} +extern "C" { + pub fn ACU_GetProxyPassword(password: *mut ::libc::c_char) -> Result; +} +extern "C" { + pub fn ACU_GetLastErrorCode(errorCode: *mut u32) -> Result; +} +extern "C" { + pub fn ACU_GetLastDetailErrorCode(errorCode: *mut u32) -> Result; +} +pub const FS_OPEN_READ: _bindgen_ty_8 = 1; +pub const FS_OPEN_WRITE: _bindgen_ty_8 = 2; +pub const FS_OPEN_CREATE: _bindgen_ty_8 = 4; +pub type _bindgen_ty_8 = u32; +pub const FS_WRITE_FLUSH: _bindgen_ty_9 = 1; +pub const FS_WRITE_UPDATE_TIME: _bindgen_ty_9 = 256; +pub type _bindgen_ty_9 = u32; +pub const FS_ATTRIBUTE_DIRECTORY: _bindgen_ty_10 = 1; +pub const FS_ATTRIBUTE_HIDDEN: _bindgen_ty_10 = 256; +pub const FS_ATTRIBUTE_ARCHIVE: _bindgen_ty_10 = 65536; +pub const FS_ATTRIBUTE_READ_ONLY: _bindgen_ty_10 = 16777216; +pub type _bindgen_ty_10 = u32; +pub const MEDIATYPE_NAND: FS_MediaType = 0; +pub const MEDIATYPE_SD: FS_MediaType = 1; +pub const MEDIATYPE_GAME_CARD: FS_MediaType = 2; +pub type FS_MediaType = u32; +pub const SYSTEM_MEDIATYPE_CTR_NAND: FS_SystemMediaType = 0; +pub const SYSTEM_MEDIATYPE_TWL_NAND: FS_SystemMediaType = 1; +pub const SYSTEM_MEDIATYPE_SD: FS_SystemMediaType = 2; +pub const SYSTEM_MEDIATYPE_TWL_PHOTO: FS_SystemMediaType = 3; +pub type FS_SystemMediaType = u32; +pub const ARCHIVE_ROMFS: FS_ArchiveID = 3; +pub const ARCHIVE_SAVEDATA: FS_ArchiveID = 4; +pub const ARCHIVE_EXTDATA: FS_ArchiveID = 6; +pub const ARCHIVE_SHARED_EXTDATA: FS_ArchiveID = 7; +pub const ARCHIVE_SYSTEM_SAVEDATA: FS_ArchiveID = 8; +pub const ARCHIVE_SDMC: FS_ArchiveID = 9; +pub const ARCHIVE_SDMC_WRITE_ONLY: FS_ArchiveID = 10; +pub const ARCHIVE_BOSS_EXTDATA: FS_ArchiveID = 305419896; +pub const ARCHIVE_CARD_SPIFS: FS_ArchiveID = 305419897; +pub const ARCHIVE_EXTDATA_AND_BOSS_EXTDATA: FS_ArchiveID = 305419899; +pub const ARCHIVE_SYSTEM_SAVEDATA2: FS_ArchiveID = 305419900; +pub const ARCHIVE_NAND_RW: FS_ArchiveID = 305419901; +pub const ARCHIVE_NAND_RO: FS_ArchiveID = 305419902; +pub const ARCHIVE_NAND_RO_WRITE_ACCESS: FS_ArchiveID = 305419903; +pub const ARCHIVE_SAVEDATA_AND_CONTENT: FS_ArchiveID = 591751050; +pub const ARCHIVE_SAVEDATA_AND_CONTENT2: FS_ArchiveID = 591751054; +pub const ARCHIVE_NAND_CTR_FS: FS_ArchiveID = 1450741931; +pub const ARCHIVE_TWL_PHOTO: FS_ArchiveID = 1450741932; +pub const ARCHIVE_TWL_SOUND: FS_ArchiveID = 1450741933; +pub const ARCHIVE_NAND_TWL_FS: FS_ArchiveID = 1450741934; +pub const ARCHIVE_NAND_W_FS: FS_ArchiveID = 1450741935; +pub const ARCHIVE_GAMECARD_SAVEDATA: FS_ArchiveID = 1450741937; +pub const ARCHIVE_USER_SAVEDATA: FS_ArchiveID = 1450741938; +pub const ARCHIVE_DEMO_SAVEDATA: FS_ArchiveID = 1450741940; +pub type FS_ArchiveID = u32; +pub const PATH_INVALID: FS_PathType = 0; +pub const PATH_EMPTY: FS_PathType = 1; +pub const PATH_BINARY: FS_PathType = 2; +pub const PATH_ASCII: FS_PathType = 3; +pub const PATH_UTF16: FS_PathType = 4; +pub type FS_PathType = u32; +pub const SECUREVALUE_SLOT_SD: FS_SecureValueSlot = 4096; +pub type FS_SecureValueSlot = u32; +pub const BAUDRATE_512KHZ: FS_CardSpiBaudRate = 0; +pub const BAUDRATE_1MHZ: FS_CardSpiBaudRate = 1; +pub const BAUDRATE_2MHZ: FS_CardSpiBaudRate = 2; +pub const BAUDRATE_4MHZ: FS_CardSpiBaudRate = 3; +pub const BAUDRATE_8MHZ: FS_CardSpiBaudRate = 4; +pub const BAUDRATE_16MHZ: FS_CardSpiBaudRate = 5; +pub type FS_CardSpiBaudRate = u32; +pub const BUSMODE_1BIT: FS_CardSpiBusMode = 0; +pub const BUSMODE_4BIT: FS_CardSpiBusMode = 1; +pub type FS_CardSpiBusMode = u32; +pub const SPECIALCONTENT_UPDATE: FS_SpecialContentType = 1; +pub const SPECIALCONTENT_MANUAL: FS_SpecialContentType = 2; +pub const SPECIALCONTENT_DLP_CHILD: FS_SpecialContentType = 3; +pub type FS_SpecialContentType = u32; +pub const CARD_CTR: FS_CardType = 0; +pub const CARD_TWL: FS_CardType = 1; +pub type FS_CardType = u32; +pub const FS_ACTION_UNKNOWN: FS_Action = 0; +pub type FS_Action = u32; +pub const ARCHIVE_ACTION_COMMIT_SAVE_DATA: FS_ArchiveAction = 0; +pub const ARCHIVE_ACTION_GET_TIMESTAMP: FS_ArchiveAction = 1; +pub type FS_ArchiveAction = u32; +pub const SECURESAVE_ACTION_DELETE: FS_SecureSaveAction = 0; +pub const SECURESAVE_ACTION_FORMAT: FS_SecureSaveAction = 1; +pub type FS_SecureSaveAction = u32; +pub const FILE_ACTION_UNKNOWN: FS_FileAction = 0; +pub type FS_FileAction = u32; +pub const DIRECTORY_ACTION_UNKNOWN: FS_DirectoryAction = 0; +pub type FS_DirectoryAction = u32; +#[repr(C)] +pub struct FS_DirectoryEntry { + pub name: [u16; 262usize], + pub shortName: [::libc::c_char; 10usize], + pub shortExt: [::libc::c_char; 4usize], + pub valid: u8, + pub reserved: u8, + pub attributes: u32, + pub fileSize: u64, +} +#[repr(C)] +pub struct FS_ArchiveResource { + pub sectorSize: u32, + pub clusterSize: u32, + pub totalClusters: u32, + pub freeClusters: u32, +} +#[repr(C)] +pub struct FS_ProgramInfo { + pub programId: u64, + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>, + pub padding: [u8; 7usize], +} +impl FS_ProgramInfo { + #[inline] + pub fn mediaType(&self) -> FS_MediaType { + unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 8u8) as u32) } + } + #[inline] + pub fn set_mediaType(&mut self, val: FS_MediaType) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(0usize, 8u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1(mediaType: FS_MediaType) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 8u8, { + let mediaType: u32 = unsafe { ::core::mem::transmute(mediaType) }; + mediaType as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +pub struct FS_ProductInfo { + pub productCode: [::libc::c_char; 16usize], + pub companyCode: [::libc::c_char; 2usize], + pub remasterVersion: u16, +} +#[repr(C)] +pub struct FS_IntegrityVerificationSeed { + pub aesCbcMac: [u8; 16usize], + pub movableSed: [u8; 288usize], +} +#[repr(C, packed)] +pub struct FS_ExtSaveDataInfo { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>, + pub unknown: u8, + pub reserved1: u16, + pub saveId: u64, + pub reserved2: u32, +} +impl FS_ExtSaveDataInfo { + #[inline] + pub fn mediaType(&self) -> FS_MediaType { + unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 8u8) as u32) } + } + #[inline] + pub fn set_mediaType(&mut self, val: FS_MediaType) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(0usize, 8u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1(mediaType: FS_MediaType) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 8u8, { + let mediaType: u32 = unsafe { ::core::mem::transmute(mediaType) }; + mediaType as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +pub struct FS_SystemSaveDataInfo { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>, + pub unknown: u8, + pub reserved: u16, + pub saveId: u32, +} +impl FS_SystemSaveDataInfo { + #[inline] + pub fn mediaType(&self) -> FS_MediaType { + unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 8u8) as u32) } + } + #[inline] + pub fn set_mediaType(&mut self, val: FS_MediaType) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(0usize, 8u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1(mediaType: FS_MediaType) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 8u8, { + let mediaType: u32 = unsafe { ::core::mem::transmute(mediaType) }; + mediaType as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +pub struct FS_DeviceMoveContext { + pub ivs: [u8; 16usize], + pub encryptParameter: [u8; 16usize], +} +#[repr(C)] +pub struct FS_Path { + pub type_: FS_PathType, + pub size: u32, + pub data: *const ::libc::c_void, +} +pub type FS_Archive = u64; +extern "C" { + pub fn fsInit() -> Result; +} +extern "C" { + pub fn fsExit(); +} +extern "C" { + pub fn fsUseSession(session: Handle); +} +extern "C" { + pub fn fsEndUseSession(); +} +extern "C" { + pub fn fsExemptFromSession(archive: FS_Archive); +} +extern "C" { + pub fn fsUnexemptFromSession(archive: FS_Archive); +} +extern "C" { + pub fn fsMakePath(type_: FS_PathType, path: *const ::libc::c_void) -> FS_Path; +} +extern "C" { + pub fn fsGetSessionHandle() -> *mut Handle; +} +extern "C" { + pub fn FSUSER_Control( + action: FS_Action, + input: *mut ::libc::c_void, + inputSize: u32, + output: *mut ::libc::c_void, + outputSize: u32, + ) -> Result; +} +extern "C" { + pub fn FSUSER_Initialize(session: Handle) -> Result; +} +extern "C" { + pub fn FSUSER_OpenFile( + out: *mut Handle, + archive: FS_Archive, + path: FS_Path, + openFlags: u32, + attributes: u32, + ) -> Result; +} +extern "C" { + pub fn FSUSER_OpenFileDirectly( + out: *mut Handle, + archiveId: FS_ArchiveID, + archivePath: FS_Path, + filePath: FS_Path, + openFlags: u32, + attributes: u32, + ) -> Result; +} +extern "C" { + pub fn FSUSER_DeleteFile(archive: FS_Archive, path: FS_Path) -> Result; +} +extern "C" { + pub fn FSUSER_RenameFile( + srcArchive: FS_Archive, + srcPath: FS_Path, + dstArchive: FS_Archive, + dstPath: FS_Path, + ) -> Result; +} +extern "C" { + pub fn FSUSER_DeleteDirectory(archive: FS_Archive, path: FS_Path) -> Result; +} +extern "C" { + pub fn FSUSER_DeleteDirectoryRecursively(archive: FS_Archive, path: FS_Path) -> Result; +} +extern "C" { + pub fn FSUSER_CreateFile( + archive: FS_Archive, + path: FS_Path, + attributes: u32, + fileSize: u64, + ) -> Result; +} +extern "C" { + pub fn FSUSER_CreateDirectory(archive: FS_Archive, path: FS_Path, attributes: u32) -> Result; +} +extern "C" { + pub fn FSUSER_RenameDirectory( + srcArchive: FS_Archive, + srcPath: FS_Path, + dstArchive: FS_Archive, + dstPath: FS_Path, + ) -> Result; +} +extern "C" { + pub fn FSUSER_OpenDirectory(out: *mut Handle, archive: FS_Archive, path: FS_Path) -> Result; +} +extern "C" { + pub fn FSUSER_OpenArchive(archive: *mut FS_Archive, id: FS_ArchiveID, path: FS_Path) -> Result; +} +extern "C" { + pub fn FSUSER_ControlArchive( + archive: FS_Archive, + action: FS_ArchiveAction, + input: *mut ::libc::c_void, + inputSize: u32, + output: *mut ::libc::c_void, + outputSize: u32, + ) -> Result; +} +extern "C" { + pub fn FSUSER_CloseArchive(archive: FS_Archive) -> Result; +} +extern "C" { + pub fn FSUSER_GetFreeBytes(freeBytes: *mut u64, archive: FS_Archive) -> Result; +} +extern "C" { + pub fn FSUSER_GetCardType(type_: *mut FS_CardType) -> Result; +} +extern "C" { + pub fn FSUSER_GetSdmcArchiveResource(archiveResource: *mut FS_ArchiveResource) -> Result; +} +extern "C" { + pub fn FSUSER_GetNandArchiveResource(archiveResource: *mut FS_ArchiveResource) -> Result; +} +extern "C" { + pub fn FSUSER_GetSdmcFatfsError(error: *mut u32) -> Result; +} +extern "C" { + pub fn FSUSER_IsSdmcDetected(detected: *mut bool) -> Result; +} +extern "C" { + pub fn FSUSER_IsSdmcWritable(writable: *mut bool) -> Result; +} +extern "C" { + pub fn FSUSER_GetSdmcCid(out: *mut u8, length: u32) -> Result; +} +extern "C" { + pub fn FSUSER_GetNandCid(out: *mut u8, length: u32) -> Result; +} +extern "C" { + pub fn FSUSER_GetSdmcSpeedInfo(speedInfo: *mut u32) -> Result; +} +extern "C" { + pub fn FSUSER_GetNandSpeedInfo(speedInfo: *mut u32) -> Result; +} +extern "C" { + pub fn FSUSER_GetSdmcLog(out: *mut u8, length: u32) -> Result; +} +extern "C" { + pub fn FSUSER_GetNandLog(out: *mut u8, length: u32) -> Result; +} +extern "C" { + pub fn FSUSER_ClearSdmcLog() -> Result; +} +extern "C" { + pub fn FSUSER_ClearNandLog() -> Result; +} +extern "C" { + pub fn FSUSER_CardSlotIsInserted(inserted: *mut bool) -> Result; +} +extern "C" { + pub fn FSUSER_CardSlotPowerOn(status: *mut bool) -> Result; +} +extern "C" { + pub fn FSUSER_CardSlotPowerOff(status: *mut bool) -> Result; +} +extern "C" { + pub fn FSUSER_CardSlotGetCardIFPowerStatus(status: *mut bool) -> Result; +} +extern "C" { + pub fn FSUSER_CardNorDirectCommand(commandId: u8) -> Result; +} +extern "C" { + pub fn FSUSER_CardNorDirectCommandWithAddress(commandId: u8, address: u32) -> Result; +} +extern "C" { + pub fn FSUSER_CardNorDirectRead(commandId: u8, size: u32, output: *mut u8) -> Result; +} +extern "C" { + pub fn FSUSER_CardNorDirectReadWithAddress( + commandId: u8, + address: u32, + size: u32, + output: *mut u8, + ) -> Result; +} +extern "C" { + pub fn FSUSER_CardNorDirectWrite(commandId: u8, size: u32, input: *mut u8) -> Result; +} +extern "C" { + pub fn FSUSER_CardNorDirectWriteWithAddress( + commandId: u8, + address: u32, + size: u32, + input: *mut u8, + ) -> Result; +} +extern "C" { + pub fn FSUSER_CardNorDirectRead_4xIO( + commandId: u8, + address: u32, + size: u32, + output: *mut u8, + ) -> Result; +} +extern "C" { + pub fn FSUSER_CardNorDirectCpuWriteWithoutVerify( + address: u32, + size: u32, + input: *mut u8, + ) -> Result; +} +extern "C" { + pub fn FSUSER_CardNorDirectSectorEraseWithoutVerify(address: u32) -> Result; +} +extern "C" { + pub fn FSUSER_GetProductInfo(info: *mut FS_ProductInfo, processId: u32) -> Result; +} +extern "C" { + pub fn FSUSER_GetProgramLaunchInfo(info: *mut FS_ProgramInfo, processId: u32) -> Result; +} +extern "C" { + pub fn FSUSER_SetCardSpiBaudRate(baudRate: FS_CardSpiBaudRate) -> Result; +} +extern "C" { + pub fn FSUSER_SetCardSpiBusMode(busMode: FS_CardSpiBusMode) -> Result; +} +extern "C" { + pub fn FSUSER_SendInitializeInfoTo9() -> Result; +} +extern "C" { + pub fn FSUSER_GetSpecialContentIndex( + index: *mut u16, + mediaType: FS_MediaType, + programId: u64, + type_: FS_SpecialContentType, + ) -> Result; +} +extern "C" { + pub fn FSUSER_GetLegacyRomHeader( + mediaType: FS_MediaType, + programId: u64, + header: *mut u8, + ) -> Result; +} +extern "C" { + pub fn FSUSER_GetLegacyBannerData( + mediaType: FS_MediaType, + programId: u64, + banner: *mut u8, + ) -> Result; +} +extern "C" { + pub fn FSUSER_CheckAuthorityToAccessExtSaveData( + access: *mut bool, + mediaType: FS_MediaType, + saveId: u64, + processId: u32, + ) -> Result; +} +extern "C" { + pub fn FSUSER_QueryTotalQuotaSize( + quotaSize: *mut u64, + directories: u32, + files: u32, + fileSizeCount: u32, + fileSizes: *mut u64, + ) -> Result; +} +extern "C" { + pub fn FSUSER_AbnegateAccessRight(accessRight: u32) -> Result; +} +extern "C" { + pub fn FSUSER_DeleteSdmcRoot() -> Result; +} +extern "C" { + pub fn FSUSER_DeleteAllExtSaveDataOnNand() -> Result; +} +extern "C" { + pub fn FSUSER_InitializeCtrFileSystem() -> Result; +} +extern "C" { + pub fn FSUSER_CreateSeed() -> Result; +} +extern "C" { + pub fn FSUSER_GetFormatInfo( + totalSize: *mut u32, + directories: *mut u32, + files: *mut u32, + duplicateData: *mut bool, + archiveId: FS_ArchiveID, + path: FS_Path, + ) -> Result; +} +extern "C" { + pub fn FSUSER_GetLegacyRomHeader2( + headerSize: u32, + mediaType: FS_MediaType, + programId: u64, + header: *mut u8, + ) -> Result; +} +extern "C" { + pub fn FSUSER_GetSdmcCtrRootPath(out: *mut u8, length: u32) -> Result; +} +extern "C" { + pub fn FSUSER_GetArchiveResource( + archiveResource: *mut FS_ArchiveResource, + mediaType: FS_SystemMediaType, + ) -> Result; +} +extern "C" { + pub fn FSUSER_ExportIntegrityVerificationSeed( + seed: *mut FS_IntegrityVerificationSeed, + ) -> Result; +} +extern "C" { + pub fn FSUSER_ImportIntegrityVerificationSeed( + seed: *mut FS_IntegrityVerificationSeed, + ) -> Result; +} +extern "C" { + pub fn FSUSER_FormatSaveData( + archiveId: FS_ArchiveID, + path: FS_Path, + blocks: u32, + directories: u32, + files: u32, + directoryBuckets: u32, + fileBuckets: u32, + duplicateData: bool, + ) -> Result; +} +extern "C" { + pub fn FSUSER_GetLegacySubBannerData( + bannerSize: u32, + mediaType: FS_MediaType, + programId: u64, + banner: *mut u8, + ) -> Result; +} +extern "C" { + pub fn FSUSER_UpdateSha256Context( + data: *const ::libc::c_void, + inputSize: u32, + hash: *mut u8, + ) -> Result; +} +extern "C" { + pub fn FSUSER_ReadSpecialFile( + bytesRead: *mut u32, + fileOffset: u64, + size: u32, + data: *mut u8, + ) -> Result; +} +extern "C" { + pub fn FSUSER_GetSpecialFileSize(fileSize: *mut u64) -> Result; +} +extern "C" { + pub fn FSUSER_CreateExtSaveData( + info: FS_ExtSaveDataInfo, + directories: u32, + files: u32, + sizeLimit: u64, + smdhSize: u32, + smdh: *mut u8, + ) -> Result; +} +extern "C" { + pub fn FSUSER_DeleteExtSaveData(info: FS_ExtSaveDataInfo) -> Result; +} +extern "C" { + pub fn FSUSER_ReadExtSaveDataIcon( + bytesRead: *mut u32, + info: FS_ExtSaveDataInfo, + smdhSize: u32, + smdh: *mut u8, + ) -> Result; +} +extern "C" { + pub fn FSUSER_GetExtDataBlockSize( + totalBlocks: *mut u64, + freeBlocks: *mut u64, + blockSize: *mut u32, + info: FS_ExtSaveDataInfo, + ) -> Result; +} +extern "C" { + pub fn FSUSER_EnumerateExtSaveData( + idsWritten: *mut u32, + idsSize: u32, + mediaType: FS_MediaType, + idSize: u32, + shared: bool, + ids: *mut u8, + ) -> Result; +} +extern "C" { + pub fn FSUSER_CreateSystemSaveData( + info: FS_SystemSaveDataInfo, + totalSize: u32, + blockSize: u32, + directories: u32, + files: u32, + directoryBuckets: u32, + fileBuckets: u32, + duplicateData: bool, + ) -> Result; +} +extern "C" { + pub fn FSUSER_DeleteSystemSaveData(info: FS_SystemSaveDataInfo) -> Result; +} +extern "C" { + pub fn FSUSER_StartDeviceMoveAsSource(context: *mut FS_DeviceMoveContext) -> Result; +} +extern "C" { + pub fn FSUSER_StartDeviceMoveAsDestination( + context: FS_DeviceMoveContext, + clear: bool, + ) -> Result; +} +extern "C" { + pub fn FSUSER_SetArchivePriority(archive: FS_Archive, priority: u32) -> Result; +} +extern "C" { + pub fn FSUSER_GetArchivePriority(priority: *mut u32, archive: FS_Archive) -> Result; +} +extern "C" { + pub fn FSUSER_SetCtrCardLatencyParameter(latency: u64, emulateEndurance: bool) -> Result; +} +extern "C" { + pub fn FSUSER_SwitchCleanupInvalidSaveData(enable: bool) -> Result; +} +extern "C" { + pub fn FSUSER_EnumerateSystemSaveData( + idsWritten: *mut u32, + idsSize: u32, + ids: *mut u32, + ) -> Result; +} +extern "C" { + pub fn FSUSER_InitializeWithSdkVersion(session: Handle, version: u32) -> Result; +} +extern "C" { + pub fn FSUSER_SetPriority(priority: u32) -> Result; +} +extern "C" { + pub fn FSUSER_GetPriority(priority: *mut u32) -> Result; +} +extern "C" { + pub fn FSUSER_SetSaveDataSecureValue( + value: u64, + slot: FS_SecureValueSlot, + titleUniqueId: u32, + titleVariation: u8, + ) -> Result; +} +extern "C" { + pub fn FSUSER_GetSaveDataSecureValue( + exists: *mut bool, + value: *mut u64, + slot: FS_SecureValueSlot, + titleUniqueId: u32, + titleVariation: u8, + ) -> Result; +} +extern "C" { + pub fn FSUSER_ControlSecureSave( + action: FS_SecureSaveAction, + input: *mut ::libc::c_void, + inputSize: u32, + output: *mut ::libc::c_void, + outputSize: u32, + ) -> Result; +} +extern "C" { + pub fn FSUSER_GetMediaType(mediaType: *mut FS_MediaType) -> Result; +} +extern "C" { + pub fn FSFILE_Control( + handle: Handle, + action: FS_FileAction, + input: *mut ::libc::c_void, + inputSize: u32, + output: *mut ::libc::c_void, + outputSize: u32, + ) -> Result; +} +extern "C" { + pub fn FSFILE_OpenSubFile( + handle: Handle, + subFile: *mut Handle, + offset: u64, + size: u64, + ) -> Result; +} +extern "C" { + pub fn FSFILE_Read( + handle: Handle, + bytesRead: *mut u32, + offset: u64, + buffer: *mut ::libc::c_void, + size: u32, + ) -> Result; +} +extern "C" { + pub fn FSFILE_Write( + handle: Handle, + bytesWritten: *mut u32, + offset: u64, + buffer: *const ::libc::c_void, + size: u32, + flags: u32, + ) -> Result; +} +extern "C" { + pub fn FSFILE_GetSize(handle: Handle, size: *mut u64) -> Result; +} +extern "C" { + pub fn FSFILE_SetSize(handle: Handle, size: u64) -> Result; +} +extern "C" { + pub fn FSFILE_GetAttributes(handle: Handle, attributes: *mut u32) -> Result; +} +extern "C" { + pub fn FSFILE_SetAttributes(handle: Handle, attributes: u32) -> Result; +} +extern "C" { + pub fn FSFILE_Close(handle: Handle) -> Result; +} +extern "C" { + pub fn FSFILE_Flush(handle: Handle) -> Result; +} +extern "C" { + pub fn FSFILE_SetPriority(handle: Handle, priority: u32) -> Result; +} +extern "C" { + pub fn FSFILE_GetPriority(handle: Handle, priority: *mut u32) -> Result; +} +extern "C" { + pub fn FSFILE_OpenLinkFile(handle: Handle, linkFile: *mut Handle) -> Result; +} +extern "C" { + pub fn FSDIR_Control( + handle: Handle, + action: FS_DirectoryAction, + input: *mut ::libc::c_void, + inputSize: u32, + output: *mut ::libc::c_void, + outputSize: u32, + ) -> Result; +} +extern "C" { + pub fn FSDIR_Read( + handle: Handle, + entriesRead: *mut u32, + entryCount: u32, + entries: *mut FS_DirectoryEntry, + ) -> Result; +} +extern "C" { + pub fn FSDIR_Close(handle: Handle) -> Result; +} +extern "C" { + pub fn FSDIR_SetPriority(handle: Handle, priority: u32) -> Result; +} +extern "C" { + pub fn FSDIR_GetPriority(handle: Handle, priority: *mut u32) -> Result; +} +#[repr(C)] +pub struct AM_TitleEntry { + pub titleID: u64, + pub size: u64, + pub version: u16, + pub unk: [u8; 6usize], +} +pub const AM_STATUS_MASK_INSTALLING: _bindgen_ty_11 = 1; +pub const AM_STATUS_MASK_AWAITING_FINALIZATION: _bindgen_ty_11 = 2; +pub type _bindgen_ty_11 = u32; +pub const AM_STATUS_ABORTED: AM_InstallStatus = 2; +pub const AM_STATUS_SAVED: AM_InstallStatus = 3; +pub const AM_STATUS_INSTALL_IN_PROGRESS: AM_InstallStatus = 2050; +pub const AM_STATUS_AWAITING_FINALIZATION: AM_InstallStatus = 2051; +pub type AM_InstallStatus = u32; +#[repr(C)] +pub struct AM_PendingTitleEntry { + pub titleId: u64, + pub version: u16, + pub status: u16, + pub titleType: u32, + pub unk: [u8; 8usize], +} +pub const AM_DELETE_PENDING_NON_SYSTEM: _bindgen_ty_12 = 1; +pub const AM_DELETE_PENDING_SYSTEM: _bindgen_ty_12 = 2; +pub type _bindgen_ty_12 = u32; +#[repr(C)] +pub struct AM_TWLPartitionInfo { + pub capacity: u64, + pub freeSpace: u64, + pub titlesCapacity: u64, + pub titlesFreeSpace: u64, +} +extern "C" { + pub fn amInit() -> Result; +} +extern "C" { + pub fn amAppInit() -> Result; +} +extern "C" { + pub fn amExit(); +} +extern "C" { + pub fn amGetSessionHandle() -> *mut Handle; +} +extern "C" { + pub fn AM_GetTitleCount(mediatype: FS_MediaType, count: *mut u32) -> Result; +} +extern "C" { + pub fn AM_GetTitleList( + titlesRead: *mut u32, + mediatype: FS_MediaType, + titleCount: u32, + titleIds: *mut u64, + ) -> Result; +} +extern "C" { + pub fn AM_GetTitleInfo( + mediatype: FS_MediaType, + titleCount: u32, + titleIds: *mut u64, + titleInfo: *mut AM_TitleEntry, + ) -> Result; +} +extern "C" { + pub fn AM_GetTicketCount(count: *mut u32) -> Result; +} +extern "C" { + pub fn AM_GetTicketList( + ticketsRead: *mut u32, + ticketCount: u32, + skip: u32, + ticketIds: *mut u64, + ) -> Result; +} +extern "C" { + pub fn AM_GetPendingTitleCount( + count: *mut u32, + mediatype: FS_MediaType, + statusMask: u32, + ) -> Result; +} +extern "C" { + pub fn AM_GetPendingTitleList( + titlesRead: *mut u32, + titleCount: u32, + mediatype: FS_MediaType, + statusMask: u32, + titleIds: *mut u64, + ) -> Result; +} +extern "C" { + pub fn AM_GetPendingTitleInfo( + titleCount: u32, + mediatype: FS_MediaType, + titleIds: *mut u64, + titleInfo: *mut AM_PendingTitleEntry, + ) -> Result; +} +extern "C" { + pub fn AM_GetDeviceId(deviceID: *mut u32) -> Result; +} +extern "C" { + pub fn AM_ExportTwlBackup( + titleID: u64, + operation: u8, + workbuf: *mut ::libc::c_void, + workbuf_size: u32, + filepath: *const ::libc::c_char, + ) -> Result; +} +extern "C" { + pub fn AM_ImportTwlBackup( + filehandle: Handle, + operation: u8, + buffer: *mut ::libc::c_void, + size: u32, + ) -> Result; +} +extern "C" { + pub fn AM_ReadTwlBackupInfo( + filehandle: Handle, + outinfo: *mut ::libc::c_void, + outinfo_size: u32, + workbuf: *mut ::libc::c_void, + workbuf_size: u32, + banner: *mut ::libc::c_void, + banner_size: u32, + ) -> Result; +} +extern "C" { + pub fn AM_GetTWLPartitionInfo(info: *mut AM_TWLPartitionInfo) -> Result; +} +extern "C" { + pub fn AM_StartCiaInstall(mediatype: FS_MediaType, ciaHandle: *mut Handle) -> Result; +} +extern "C" { + pub fn AM_StartDlpChildCiaInstall(ciaHandle: *mut Handle) -> Result; +} +extern "C" { + pub fn AM_CancelCIAInstall(ciaHandle: Handle) -> Result; +} +extern "C" { + pub fn AM_FinishCiaInstall(ciaHandle: Handle) -> Result; +} +extern "C" { + pub fn AM_FinishCiaInstallWithoutCommit(ciaHandle: Handle) -> Result; +} +extern "C" { + pub fn AM_CommitImportPrograms( + mediaType: FS_MediaType, + titleCount: u32, + temp: bool, + titleIds: *const u64, + ) -> Result; +} +extern "C" { + pub fn AM_DeleteTitle(mediatype: FS_MediaType, titleID: u64) -> Result; +} +extern "C" { + pub fn AM_DeleteAppTitle(mediatype: FS_MediaType, titleID: u64) -> Result; +} +extern "C" { + pub fn AM_DeleteTicket(ticketId: u64) -> Result; +} +extern "C" { + pub fn AM_DeletePendingTitle(mediatype: FS_MediaType, titleId: u64) -> Result; +} +extern "C" { + pub fn AM_DeletePendingTitles(mediatype: FS_MediaType, flags: u32) -> Result; +} +extern "C" { + pub fn AM_DeleteAllPendingTitles(mediatype: FS_MediaType) -> Result; +} +extern "C" { + pub fn AM_InstallNativeFirm() -> Result; +} +extern "C" { + pub fn AM_InstallFirm(titleID: u64) -> Result; +} +extern "C" { + pub fn AM_GetTitleProductCode( + mediatype: FS_MediaType, + titleId: u64, + productCode: *mut ::libc::c_char, + ) -> Result; +} +extern "C" { + pub fn AM_GetTitleExtDataId( + extDataId: *mut u64, + mediatype: FS_MediaType, + titleId: u64, + ) -> Result; +} +extern "C" { + pub fn AM_GetCiaFileInfo( + mediatype: FS_MediaType, + titleEntry: *mut AM_TitleEntry, + fileHandle: Handle, + ) -> Result; +} +extern "C" { + pub fn AM_GetCiaIcon(icon: *mut ::libc::c_void, fileHandle: Handle) -> Result; +} +extern "C" { + pub fn AM_GetCiaDependencies(dependencies: *mut u64, fileHandle: Handle) -> Result; +} +extern "C" { + pub fn AM_GetCiaMetaOffset(metaOffset: *mut u64, fileHandle: Handle) -> Result; +} +extern "C" { + pub fn AM_GetCiaCoreVersion(coreVersion: *mut u32, fileHandle: Handle) -> Result; +} +extern "C" { + pub fn AM_GetCiaRequiredSpace( + requiredSpace: *mut u64, + mediaType: FS_MediaType, + fileHandle: Handle, + ) -> Result; +} +extern "C" { + pub fn AM_GetCiaMetaSection(meta: *mut ::libc::c_void, size: u32, fileHandle: Handle) + -> Result; +} +extern "C" { + pub fn AM_InitializeExternalTitleDatabase(overwrite: bool) -> Result; +} +extern "C" { + pub fn AM_QueryAvailableExternalTitleDatabase(available: *mut bool) -> Result; +} +extern "C" { + pub fn AM_InstallTicketBegin(ticketHandle: *mut Handle) -> Result; +} +extern "C" { + pub fn AM_InstallTicketAbort(ticketHandle: Handle) -> Result; +} +extern "C" { + pub fn AM_InstallTicketFinish(ticketHandle: Handle) -> Result; +} +extern "C" { + pub fn AM_InstallTitleBegin(mediaType: FS_MediaType, titleId: u64, unk: bool) -> Result; +} +extern "C" { + pub fn AM_InstallTitleStop() -> Result; +} +extern "C" { + pub fn AM_InstallTitleResume(mediaType: FS_MediaType, titleId: u64) -> Result; +} +extern "C" { + pub fn AM_InstallTitleAbort() -> Result; +} +extern "C" { + pub fn AM_InstallTitleFinish() -> Result; +} +extern "C" { + pub fn AM_CommitImportTitles( + mediaType: FS_MediaType, + titleCount: u32, + temp: bool, + titleIds: *const u64, + ) -> Result; +} +extern "C" { + pub fn AM_InstallTmdBegin(tmdHandle: *mut Handle) -> Result; +} +extern "C" { + pub fn AM_InstallTmdAbort(tmdHandle: Handle) -> Result; +} +extern "C" { + pub fn AM_InstallTmdFinish(tmdHandle: Handle, unk: bool) -> Result; +} +extern "C" { + pub fn AM_CreateImportContentContexts(contentCount: u32, contentIndices: *mut u16) -> Result; +} +extern "C" { + pub fn AM_InstallContentBegin(contentHandle: *mut Handle, index: u16) -> Result; +} +extern "C" { + pub fn AM_InstallContentStop(contentHandle: Handle) -> Result; +} +extern "C" { + pub fn AM_InstallContentResume( + contentHandle: *mut Handle, + resumeOffset: *mut u64, + index: u16, + ) -> Result; +} +extern "C" { + pub fn AM_InstallContentCancel(contentHandle: Handle) -> Result; +} +extern "C" { + pub fn AM_InstallContentFinish(contentHandle: Handle) -> Result; +} +extern "C" { + pub fn AM_ImportCertificates( + cert1Size: u32, + cert1: *mut ::libc::c_void, + cert2Size: u32, + cert2: *mut ::libc::c_void, + cert3Size: u32, + cert3: *mut ::libc::c_void, + cert4Size: u32, + cert4: *mut ::libc::c_void, + ) -> Result; +} +extern "C" { + pub fn AM_ImportCertificate(certSize: u32, cert: *mut ::libc::c_void) -> Result; +} +extern "C" { + pub fn AM_CommitImportTitlesAndUpdateFirmwareAuto( + mediaType: FS_MediaType, + titleCount: u32, + temp: bool, + titleIds: *mut u64, + ) -> Result; +} +extern "C" { + pub fn AM_DeleteAllDemoLaunchInfos() -> Result; +} +extern "C" { + pub fn AM_DeleteAllTemporaryTitles() -> Result; +} +extern "C" { + pub fn AM_DeleteAllExpiredTitles(mediatype: FS_MediaType) -> Result; +} +extern "C" { + pub fn AM_DeleteAllTwlTitles() -> Result; +} +extern "C" { + pub fn ampxiInit(servhandle: Handle) -> Result; +} +extern "C" { + pub fn ampxiExit(); +} +extern "C" { + pub fn AMPXI_WriteTWLSavedata( + titleid: u64, + buffer: *mut u8, + size: u32, + image_filepos: u32, + section_type: u8, + operation: u8, + ) -> Result; +} +extern "C" { + pub fn AMPXI_InstallTitlesFinish( + mediaType: FS_MediaType, + db: u8, + titlecount: u32, + tidlist: *mut u64, + ) -> Result; +} +pub const APPID_NONE: NS_APPID = 0; +pub const APPID_HOMEMENU: NS_APPID = 257; +pub const APPID_CAMERA: NS_APPID = 272; +pub const APPID_FRIENDS_LIST: NS_APPID = 274; +pub const APPID_GAME_NOTES: NS_APPID = 275; +pub const APPID_WEB: NS_APPID = 276; +pub const APPID_INSTRUCTION_MANUAL: NS_APPID = 277; +pub const APPID_NOTIFICATIONS: NS_APPID = 278; +pub const APPID_MIIVERSE: NS_APPID = 279; +pub const APPID_MIIVERSE_POSTING: NS_APPID = 280; +pub const APPID_AMIIBO_SETTINGS: NS_APPID = 281; +pub const APPID_APPLICATION: NS_APPID = 768; +pub const APPID_ESHOP: NS_APPID = 769; +pub const APPID_SOFTWARE_KEYBOARD: NS_APPID = 1025; +pub const APPID_APPLETED: NS_APPID = 1026; +pub const APPID_PNOTE_AP: NS_APPID = 1028; +pub const APPID_SNOTE_AP: NS_APPID = 1029; +pub const APPID_ERROR: NS_APPID = 1030; +pub const APPID_MINT: NS_APPID = 1031; +pub const APPID_EXTRAPAD: NS_APPID = 1032; +pub const APPID_MEMOLIB: NS_APPID = 1033; +pub type NS_APPID = u32; +pub const APTPOS_NONE: APT_AppletPos = -1; +pub const APTPOS_APP: APT_AppletPos = 0; +pub const APTPOS_APPLIB: APT_AppletPos = 1; +pub const APTPOS_SYS: APT_AppletPos = 2; +pub const APTPOS_SYSLIB: APT_AppletPos = 3; +pub const APTPOS_RESIDENT: APT_AppletPos = 4; +pub type APT_AppletPos = i32; +pub type APT_AppletAttr = u8; +pub const APTREPLY_REJECT: APT_QueryReply = 0; +pub const APTREPLY_ACCEPT: APT_QueryReply = 1; +pub const APTREPLY_LATER: APT_QueryReply = 2; +pub type APT_QueryReply = u32; +pub const APTSIGNAL_NONE: APT_Signal = 0; +pub const APTSIGNAL_HOMEBUTTON: APT_Signal = 1; +pub const APTSIGNAL_HOMEBUTTON2: APT_Signal = 2; +pub const APTSIGNAL_SLEEP_QUERY: APT_Signal = 3; +pub const APTSIGNAL_SLEEP_CANCEL: APT_Signal = 4; +pub const APTSIGNAL_SLEEP_ENTER: APT_Signal = 5; +pub const APTSIGNAL_SLEEP_WAKEUP: APT_Signal = 6; +pub const APTSIGNAL_SHUTDOWN: APT_Signal = 7; +pub const APTSIGNAL_POWERBUTTON: APT_Signal = 8; +pub const APTSIGNAL_POWERBUTTON2: APT_Signal = 9; +pub const APTSIGNAL_TRY_SLEEP: APT_Signal = 10; +pub const APTSIGNAL_ORDERTOCLOSE: APT_Signal = 11; +pub type APT_Signal = u32; +pub const APTCMD_NONE: APT_Command = 0; +pub const APTCMD_WAKEUP: APT_Command = 1; +pub const APTCMD_REQUEST: APT_Command = 2; +pub const APTCMD_RESPONSE: APT_Command = 3; +pub const APTCMD_EXIT: APT_Command = 4; +pub const APTCMD_MESSAGE: APT_Command = 5; +pub const APTCMD_HOMEBUTTON_ONCE: APT_Command = 6; +pub const APTCMD_HOMEBUTTON_TWICE: APT_Command = 7; +pub const APTCMD_DSP_SLEEP: APT_Command = 8; +pub const APTCMD_DSP_WAKEUP: APT_Command = 9; +pub const APTCMD_WAKEUP_EXIT: APT_Command = 10; +pub const APTCMD_WAKEUP_PAUSE: APT_Command = 11; +pub const APTCMD_WAKEUP_CANCEL: APT_Command = 12; +pub const APTCMD_WAKEUP_CANCELALL: APT_Command = 13; +pub const APTCMD_WAKEUP_POWERBUTTON: APT_Command = 14; +pub const APTCMD_WAKEUP_JUMPTOHOME: APT_Command = 15; +pub const APTCMD_SYSAPPLET_REQUEST: APT_Command = 16; +pub const APTCMD_WAKEUP_LAUNCHAPP: APT_Command = 17; +pub type APT_Command = u32; +#[repr(C)] +pub struct aptCaptureBufInfo { + pub size: u32, + pub is3D: u32, + pub top: aptCaptureBufInfo__bindgen_ty_1, + pub bottom: aptCaptureBufInfo__bindgen_ty_1, +} +#[repr(C)] +pub struct aptCaptureBufInfo__bindgen_ty_1 { + pub leftOffset: u32, + pub rightOffset: u32, + pub format: u32, +} +pub const APTHOOK_ONSUSPEND: APT_HookType = 0; +pub const APTHOOK_ONRESTORE: APT_HookType = 1; +pub const APTHOOK_ONSLEEP: APT_HookType = 2; +pub const APTHOOK_ONWAKEUP: APT_HookType = 3; +pub const APTHOOK_ONEXIT: APT_HookType = 4; +pub const APTHOOK_COUNT: APT_HookType = 5; +pub type APT_HookType = u32; +pub type aptHookFn = + ::core::option::Option; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tag_aptHookCookie { + pub next: *mut tag_aptHookCookie, + pub callback: aptHookFn, + pub param: *mut ::libc::c_void, +} +pub type aptHookCookie = tag_aptHookCookie; +pub type aptMessageCb = ::core::option::Option< + unsafe extern "C" fn( + user: *mut ::libc::c_void, + sender: NS_APPID, + msg: *mut ::libc::c_void, + msgsize: usize, + ), +>; +extern "C" { + pub fn aptInit() -> Result; +} +extern "C" { + pub fn aptExit(); +} +extern "C" { + pub fn aptSendCommand(aptcmdbuf: *mut u32) -> Result; +} +extern "C" { + pub fn aptIsSleepAllowed() -> bool; +} +extern "C" { + pub fn aptSetSleepAllowed(allowed: bool); +} +extern "C" { + pub fn aptMainLoop() -> bool; +} +extern "C" { + pub fn aptHook(cookie: *mut aptHookCookie, callback: aptHookFn, param: *mut ::libc::c_void); +} +extern "C" { + pub fn aptUnhook(cookie: *mut aptHookCookie); +} +extern "C" { + pub fn aptSetMessageCallback(callback: aptMessageCb, user: *mut ::libc::c_void); +} +extern "C" { + pub fn aptLaunchLibraryApplet( + appId: NS_APPID, + buf: *mut ::libc::c_void, + bufsize: usize, + handle: Handle, + ) -> bool; +} +extern "C" { + pub fn aptSetChainloader(programID: u64, mediatype: u8); +} +extern "C" { + pub fn APT_GetLockHandle(flags: u16, lockHandle: *mut Handle) -> Result; +} +extern "C" { + pub fn APT_Initialize( + appId: NS_APPID, + attr: APT_AppletAttr, + signalEvent: *mut Handle, + resumeEvent: *mut Handle, + ) -> Result; +} +extern "C" { + pub fn APT_Finalize(appId: NS_APPID) -> Result; +} +extern "C" { + pub fn APT_HardwareResetAsync() -> Result; +} +extern "C" { + pub fn APT_Enable(attr: APT_AppletAttr) -> Result; +} +extern "C" { + pub fn APT_GetAppletManInfo( + inpos: APT_AppletPos, + outpos: *mut APT_AppletPos, + req_appid: *mut NS_APPID, + menu_appid: *mut NS_APPID, + active_appid: *mut NS_APPID, + ) -> Result; +} +extern "C" { + pub fn APT_GetAppletInfo( + appID: NS_APPID, + pProgramID: *mut u64, + pMediaType: *mut u8, + pRegistered: *mut bool, + pLoadState: *mut bool, + pAttributes: *mut APT_AppletAttr, + ) -> Result; +} +extern "C" { + pub fn APT_GetAppletProgramInfo(id: u32, flags: u32, titleversion: *mut u16) -> Result; +} +extern "C" { + pub fn APT_GetProgramID(pProgramID: *mut u64) -> Result; +} +extern "C" { + pub fn APT_PrepareToJumpToHomeMenu() -> Result; +} +extern "C" { + pub fn APT_JumpToHomeMenu( + param: *const ::libc::c_void, + paramSize: usize, + handle: Handle, + ) -> Result; +} +extern "C" { + pub fn APT_PrepareToJumpToApplication(exiting: bool) -> Result; +} +extern "C" { + pub fn APT_JumpToApplication( + param: *const ::libc::c_void, + paramSize: usize, + handle: Handle, + ) -> Result; +} +extern "C" { + pub fn APT_IsRegistered(appID: NS_APPID, out: *mut bool) -> Result; +} +extern "C" { + pub fn APT_InquireNotification(appID: u32, signalType: *mut APT_Signal) -> Result; +} +extern "C" { + pub fn APT_NotifyToWait(appID: NS_APPID) -> Result; +} +extern "C" { + pub fn APT_AppletUtility( + id: ::libc::c_int, + out: *mut ::libc::c_void, + outSize: usize, + in_: *const ::libc::c_void, + inSize: usize, + ) -> Result; +} +extern "C" { + pub fn APT_SleepIfShellClosed() -> Result; +} +extern "C" { + pub fn APT_TryLockTransition(transition: u32, succeeded: *mut bool) -> Result; +} +extern "C" { + pub fn APT_UnlockTransition(transition: u32) -> Result; +} +extern "C" { + pub fn APT_GlanceParameter( + appID: NS_APPID, + buffer: *mut ::libc::c_void, + bufferSize: usize, + sender: *mut NS_APPID, + command: *mut APT_Command, + actualSize: *mut usize, + parameter: *mut Handle, + ) -> Result; +} +extern "C" { + pub fn APT_ReceiveParameter( + appID: NS_APPID, + buffer: *mut ::libc::c_void, + bufferSize: usize, + sender: *mut NS_APPID, + command: *mut APT_Command, + actualSize: *mut usize, + parameter: *mut Handle, + ) -> Result; +} +extern "C" { + pub fn APT_SendParameter( + source: NS_APPID, + dest: NS_APPID, + command: APT_Command, + buffer: *const ::libc::c_void, + bufferSize: u32, + parameter: Handle, + ) -> Result; +} +extern "C" { + pub fn APT_CancelParameter(source: NS_APPID, dest: NS_APPID, success: *mut bool) -> Result; +} +extern "C" { + pub fn APT_SendCaptureBufferInfo(captureBuf: *const aptCaptureBufInfo) -> Result; +} +extern "C" { + pub fn APT_ReplySleepQuery(appID: NS_APPID, reply: APT_QueryReply) -> Result; +} +extern "C" { + pub fn APT_ReplySleepNotificationComplete(appID: NS_APPID) -> Result; +} +extern "C" { + pub fn APT_PrepareToCloseApplication(cancelPreload: bool) -> Result; +} +extern "C" { + pub fn APT_CloseApplication( + param: *const ::libc::c_void, + paramSize: usize, + handle: Handle, + ) -> Result; +} +extern "C" { + pub fn APT_SetAppCpuTimeLimit(percent: u32) -> Result; +} +extern "C" { + pub fn APT_GetAppCpuTimeLimit(percent: *mut u32) -> Result; +} +extern "C" { + pub fn APT_CheckNew3DS(out: *mut bool) -> Result; +} +extern "C" { + pub fn APT_PrepareToDoApplicationJump(flags: u8, programID: u64, mediatype: u8) -> Result; +} +extern "C" { + pub fn APT_DoApplicationJump( + param: *const ::libc::c_void, + paramSize: usize, + hmac: *const ::libc::c_void, + ) -> Result; +} +extern "C" { + pub fn APT_PrepareToStartLibraryApplet(appID: NS_APPID) -> Result; +} +extern "C" { + pub fn APT_StartLibraryApplet( + appID: NS_APPID, + param: *const ::libc::c_void, + paramSize: usize, + handle: Handle, + ) -> Result; +} +extern "C" { + pub fn APT_PrepareToStartSystemApplet(appID: NS_APPID) -> Result; +} +extern "C" { + pub fn APT_StartSystemApplet( + appID: NS_APPID, + param: *const ::libc::c_void, + paramSize: usize, + handle: Handle, + ) -> Result; +} +extern "C" { + pub fn APT_GetSharedFont(fontHandle: *mut Handle, mapAddr: *mut u32) -> Result; +} +extern "C" { + pub fn APT_ReceiveDeliverArg( + param: *const ::libc::c_void, + paramSize: usize, + hmac: *const ::libc::c_void, + sender: *mut u64, + received: *mut bool, + ) -> Result; +} +#[repr(C)] +pub struct bossContext { + pub property: [u32; 7usize], + pub url: [::libc::c_char; 512usize], + pub property_x8: u32, + pub property_x9: u8, + pub property_xa: [u8; 256usize], + pub property_xb: [u8; 512usize], + pub property_xd: [::libc::c_char; 864usize], + pub property_xe: u32, + pub property_xf: [u32; 3usize], + pub property_x10: u8, + pub property_x11: u8, + pub property_x12: u8, + pub property_x13: u32, + pub property_x14: u32, + pub property_x15: [u8; 64usize], + pub property_x16: u32, + pub property_x3b: u32, + pub property_x3e: [u8; 512usize], +} +pub const BOSSTASKSTATUS_STARTED: bossTaskStatus = 2; +pub const BOSSTASKSTATUS_ERROR: bossTaskStatus = 7; +pub type bossTaskStatus = u32; +pub const bossNsDataHeaderInfoType_ContentSize: bossNsDataHeaderInfoTypes = 3; +pub type bossNsDataHeaderInfoTypes = u32; +pub const bossNsDataHeaderInfoTypeSize_ContentSize: bossNsDataHeaderInfoTypeSizes = 4; +pub type bossNsDataHeaderInfoTypeSizes = u32; +extern "C" { + pub fn bossInit(programID: u64, force_user: bool) -> Result; +} +extern "C" { + pub fn bossReinit(programID: u64) -> Result; +} +extern "C" { + pub fn bossExit(); +} +extern "C" { + pub fn bossGetSessionHandle() -> Handle; +} +extern "C" { + pub fn bossSetStorageInfo(extdataID: u64, boss_size: u32, mediaType: u8) -> Result; +} +extern "C" { + pub fn bossUnregisterStorage() -> Result; +} +extern "C" { + pub fn bossRegisterTask(taskID: *const ::libc::c_char, unk0: u8, unk1: u8) -> Result; +} +extern "C" { + pub fn bossSendProperty(PropertyID: u16, buf: *const ::libc::c_void, size: u32) -> Result; +} +extern "C" { + pub fn bossDeleteNsData(NsDataId: u32) -> Result; +} +extern "C" { + pub fn bossGetNsDataHeaderInfo( + NsDataId: u32, + type_: u8, + buffer: *mut ::libc::c_void, + size: u32, + ) -> Result; +} +extern "C" { + pub fn bossReadNsData( + NsDataId: u32, + offset: u64, + buffer: *mut ::libc::c_void, + size: u32, + transfer_total: *mut u32, + unk_out: *mut u32, + ) -> Result; +} +extern "C" { + pub fn bossStartTaskImmediate(taskID: *const ::libc::c_char) -> Result; +} +extern "C" { + pub fn bossStartBgImmediate(taskID: *const ::libc::c_char) -> Result; +} +extern "C" { + pub fn bossDeleteTask(taskID: *const ::libc::c_char, unk: u32) -> Result; +} +extern "C" { + pub fn bossGetTaskState( + taskID: *const ::libc::c_char, + inval: s8, + status: *mut u8, + out1: *mut u32, + out2: *mut u8, + ) -> Result; +} +extern "C" { + pub fn bossGetTaskProperty0(taskID: *const ::libc::c_char, out: *mut u8) -> Result; +} +extern "C" { + pub fn bossSetupContextDefault( + ctx: *mut bossContext, + seconds_interval: u32, + url: *const ::libc::c_char, + ); +} +extern "C" { + pub fn bossSendContextConfig(ctx: *mut bossContext) -> Result; +} +pub const INPUT_YUV422_INDIV_8: Y2RU_InputFormat = 0; +pub const INPUT_YUV420_INDIV_8: Y2RU_InputFormat = 1; +pub const INPUT_YUV422_INDIV_16: Y2RU_InputFormat = 2; +pub const INPUT_YUV420_INDIV_16: Y2RU_InputFormat = 3; +pub const INPUT_YUV422_BATCH: Y2RU_InputFormat = 4; +pub type Y2RU_InputFormat = u32; +pub const OUTPUT_RGB_32: Y2RU_OutputFormat = 0; +pub const OUTPUT_RGB_24: Y2RU_OutputFormat = 1; +pub const OUTPUT_RGB_16_555: Y2RU_OutputFormat = 2; +pub const OUTPUT_RGB_16_565: Y2RU_OutputFormat = 3; +pub type Y2RU_OutputFormat = u32; +pub const ROTATION_NONE: Y2RU_Rotation = 0; +pub const ROTATION_CLOCKWISE_90: Y2RU_Rotation = 1; +pub const ROTATION_CLOCKWISE_180: Y2RU_Rotation = 2; +pub const ROTATION_CLOCKWISE_270: Y2RU_Rotation = 3; +pub type Y2RU_Rotation = u32; +pub const BLOCK_LINE: Y2RU_BlockAlignment = 0; +pub const BLOCK_8_BY_8: Y2RU_BlockAlignment = 1; +pub type Y2RU_BlockAlignment = u32; +#[repr(C)] +pub struct Y2RU_ColorCoefficients { + pub rgb_Y: u16, + pub r_V: u16, + pub g_V: u16, + pub g_U: u16, + pub b_U: u16, + pub r_offset: u16, + pub g_offset: u16, + pub b_offset: u16, +} +pub const COEFFICIENT_ITU_R_BT_601: Y2RU_StandardCoefficient = 0; +pub const COEFFICIENT_ITU_R_BT_709: Y2RU_StandardCoefficient = 1; +pub const COEFFICIENT_ITU_R_BT_601_SCALING: Y2RU_StandardCoefficient = 2; +pub const COEFFICIENT_ITU_R_BT_709_SCALING: Y2RU_StandardCoefficient = 3; +pub type Y2RU_StandardCoefficient = u32; +#[repr(C)] +#[repr(align(4))] +pub struct Y2RU_ConversionParams { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u8>, + pub input_line_width: s16, + pub input_lines: s16, + pub _bitfield_2: __BindgenBitfieldUnit<[u8; 1usize], u8>, + pub unused: u8, + pub alpha: u16, +} +impl Y2RU_ConversionParams { + #[inline] + pub fn input_format(&self) -> Y2RU_InputFormat { + unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 8u8) as u32) } + } + #[inline] + pub fn set_input_format(&mut self, val: Y2RU_InputFormat) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(0usize, 8u8, val as u64) + } + } + #[inline] + pub fn output_format(&self) -> Y2RU_OutputFormat { + unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 8u8) as u32) } + } + #[inline] + pub fn set_output_format(&mut self, val: Y2RU_OutputFormat) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(8usize, 8u8, val as u64) + } + } + #[inline] + pub fn rotation(&self) -> Y2RU_Rotation { + unsafe { ::core::mem::transmute(self._bitfield_1.get(16usize, 8u8) as u32) } + } + #[inline] + pub fn set_rotation(&mut self, val: Y2RU_Rotation) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(16usize, 8u8, val as u64) + } + } + #[inline] + pub fn block_alignment(&self) -> Y2RU_BlockAlignment { + unsafe { ::core::mem::transmute(self._bitfield_1.get(24usize, 8u8) as u32) } + } + #[inline] + pub fn set_block_alignment(&mut self, val: Y2RU_BlockAlignment) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(24usize, 8u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + input_format: Y2RU_InputFormat, + output_format: Y2RU_OutputFormat, + rotation: Y2RU_Rotation, + block_alignment: Y2RU_BlockAlignment, + ) -> __BindgenBitfieldUnit<[u8; 4usize], u8> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u8> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 8u8, { + let input_format: u32 = unsafe { ::core::mem::transmute(input_format) }; + input_format as u64 + }); + __bindgen_bitfield_unit.set(8usize, 8u8, { + let output_format: u32 = unsafe { ::core::mem::transmute(output_format) }; + output_format as u64 + }); + __bindgen_bitfield_unit.set(16usize, 8u8, { + let rotation: u32 = unsafe { ::core::mem::transmute(rotation) }; + rotation as u64 + }); + __bindgen_bitfield_unit.set(24usize, 8u8, { + let block_alignment: u32 = unsafe { ::core::mem::transmute(block_alignment) }; + block_alignment as u64 + }); + __bindgen_bitfield_unit + } + #[inline] + pub fn standard_coefficient(&self) -> Y2RU_StandardCoefficient { + unsafe { ::core::mem::transmute(self._bitfield_2.get(0usize, 8u8) as u32) } + } + #[inline] + pub fn set_standard_coefficient(&mut self, val: Y2RU_StandardCoefficient) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_2.set(0usize, 8u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_2( + standard_coefficient: Y2RU_StandardCoefficient, + ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 8u8, { + let standard_coefficient: u32 = unsafe { ::core::mem::transmute(standard_coefficient) }; + standard_coefficient as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +pub struct Y2RU_DitheringWeightParams { + pub w0_xEven_yEven: u16, + pub w0_xOdd_yEven: u16, + pub w0_xEven_yOdd: u16, + pub w0_xOdd_yOdd: u16, + pub w1_xEven_yEven: u16, + pub w1_xOdd_yEven: u16, + pub w1_xEven_yOdd: u16, + pub w1_xOdd_yOdd: u16, + pub w2_xEven_yEven: u16, + pub w2_xOdd_yEven: u16, + pub w2_xEven_yOdd: u16, + pub w2_xOdd_yOdd: u16, + pub w3_xEven_yEven: u16, + pub w3_xOdd_yEven: u16, + pub w3_xEven_yOdd: u16, + pub w3_xOdd_yOdd: u16, +} +extern "C" { + pub fn y2rInit() -> Result; +} +extern "C" { + pub fn y2rExit(); +} +extern "C" { + pub fn Y2RU_SetInputFormat(format: Y2RU_InputFormat) -> Result; +} +extern "C" { + pub fn Y2RU_GetInputFormat(format: *mut Y2RU_InputFormat) -> Result; +} +extern "C" { + pub fn Y2RU_SetOutputFormat(format: Y2RU_OutputFormat) -> Result; +} +extern "C" { + pub fn Y2RU_GetOutputFormat(format: *mut Y2RU_OutputFormat) -> Result; +} +extern "C" { + pub fn Y2RU_SetRotation(rotation: Y2RU_Rotation) -> Result; +} +extern "C" { + pub fn Y2RU_GetRotation(rotation: *mut Y2RU_Rotation) -> Result; +} +extern "C" { + pub fn Y2RU_SetBlockAlignment(alignment: Y2RU_BlockAlignment) -> Result; +} +extern "C" { + pub fn Y2RU_GetBlockAlignment(alignment: *mut Y2RU_BlockAlignment) -> Result; +} +extern "C" { + pub fn Y2RU_SetSpacialDithering(enable: bool) -> Result; +} +extern "C" { + pub fn Y2RU_GetSpacialDithering(enabled: *mut bool) -> Result; +} +extern "C" { + pub fn Y2RU_SetTemporalDithering(enable: bool) -> Result; +} +extern "C" { + pub fn Y2RU_GetTemporalDithering(enabled: *mut bool) -> Result; +} +extern "C" { + pub fn Y2RU_SetInputLineWidth(line_width: u16) -> Result; +} +extern "C" { + pub fn Y2RU_GetInputLineWidth(line_width: *mut u16) -> Result; +} +extern "C" { + pub fn Y2RU_SetInputLines(num_lines: u16) -> Result; +} +extern "C" { + pub fn Y2RU_GetInputLines(num_lines: *mut u16) -> Result; +} +extern "C" { + pub fn Y2RU_SetCoefficients(coefficients: *const Y2RU_ColorCoefficients) -> Result; +} +extern "C" { + pub fn Y2RU_GetCoefficients(coefficients: *mut Y2RU_ColorCoefficients) -> Result; +} +extern "C" { + pub fn Y2RU_SetStandardCoefficient(coefficient: Y2RU_StandardCoefficient) -> Result; +} +extern "C" { + pub fn Y2RU_GetStandardCoefficient( + coefficients: *mut Y2RU_ColorCoefficients, + standardCoeff: Y2RU_StandardCoefficient, + ) -> Result; +} +extern "C" { + pub fn Y2RU_SetAlpha(alpha: u16) -> Result; +} +extern "C" { + pub fn Y2RU_GetAlpha(alpha: *mut u16) -> Result; +} +extern "C" { + pub fn Y2RU_SetTransferEndInterrupt(should_interrupt: bool) -> Result; +} +extern "C" { + pub fn Y2RU_GetTransferEndInterrupt(should_interrupt: *mut bool) -> Result; +} +extern "C" { + pub fn Y2RU_GetTransferEndEvent(end_event: *mut Handle) -> Result; +} +extern "C" { + pub fn Y2RU_SetSendingY( + src_buf: *const ::libc::c_void, + image_size: u32, + transfer_unit: s16, + transfer_gap: s16, + ) -> Result; +} +extern "C" { + pub fn Y2RU_SetSendingU( + src_buf: *const ::libc::c_void, + image_size: u32, + transfer_unit: s16, + transfer_gap: s16, + ) -> Result; +} +extern "C" { + pub fn Y2RU_SetSendingV( + src_buf: *const ::libc::c_void, + image_size: u32, + transfer_unit: s16, + transfer_gap: s16, + ) -> Result; +} +extern "C" { + pub fn Y2RU_SetSendingYUYV( + src_buf: *const ::libc::c_void, + image_size: u32, + transfer_unit: s16, + transfer_gap: s16, + ) -> Result; +} +extern "C" { + pub fn Y2RU_SetReceiving( + dst_buf: *mut ::libc::c_void, + image_size: u32, + transfer_unit: s16, + transfer_gap: s16, + ) -> Result; +} +extern "C" { + pub fn Y2RU_IsDoneSendingY(is_done: *mut bool) -> Result; +} +extern "C" { + pub fn Y2RU_IsDoneSendingU(is_done: *mut bool) -> Result; +} +extern "C" { + pub fn Y2RU_IsDoneSendingV(is_done: *mut bool) -> Result; +} +extern "C" { + pub fn Y2RU_IsDoneSendingYUYV(is_done: *mut bool) -> Result; +} +extern "C" { + pub fn Y2RU_IsDoneReceiving(is_done: *mut bool) -> Result; +} +extern "C" { + pub fn Y2RU_SetDitheringWeightParams(params: *const Y2RU_DitheringWeightParams) -> Result; +} +extern "C" { + pub fn Y2RU_GetDitheringWeightParams(params: *mut Y2RU_DitheringWeightParams) -> Result; +} +extern "C" { + pub fn Y2RU_SetConversionParams(params: *const Y2RU_ConversionParams) -> Result; +} +extern "C" { + pub fn Y2RU_StartConversion() -> Result; +} +extern "C" { + pub fn Y2RU_StopConversion() -> Result; +} +extern "C" { + pub fn Y2RU_IsBusyConversion(is_busy: *mut bool) -> Result; +} +extern "C" { + pub fn Y2RU_PingProcess(ping: *mut u8) -> Result; +} +extern "C" { + pub fn Y2RU_DriverInitialize() -> Result; +} +extern "C" { + pub fn Y2RU_DriverFinalize() -> Result; +} +pub const PORT_NONE: _bindgen_ty_13 = 0; +pub const PORT_CAM1: _bindgen_ty_13 = 1; +pub const PORT_CAM2: _bindgen_ty_13 = 2; +pub const PORT_BOTH: _bindgen_ty_13 = 3; +pub type _bindgen_ty_13 = u32; +pub const SELECT_NONE: _bindgen_ty_14 = 0; +pub const SELECT_OUT1: _bindgen_ty_14 = 1; +pub const SELECT_IN1: _bindgen_ty_14 = 2; +pub const SELECT_OUT2: _bindgen_ty_14 = 4; +pub const SELECT_IN1_OUT1: _bindgen_ty_14 = 3; +pub const SELECT_OUT1_OUT2: _bindgen_ty_14 = 5; +pub const SELECT_IN1_OUT2: _bindgen_ty_14 = 6; +pub const SELECT_ALL: _bindgen_ty_14 = 7; +pub type _bindgen_ty_14 = u32; +pub const CONTEXT_NONE: CAMU_Context = 0; +pub const CONTEXT_A: CAMU_Context = 1; +pub const CONTEXT_B: CAMU_Context = 2; +pub const CONTEXT_BOTH: CAMU_Context = 3; +pub type CAMU_Context = u32; +pub const FLIP_NONE: CAMU_Flip = 0; +pub const FLIP_HORIZONTAL: CAMU_Flip = 1; +pub const FLIP_VERTICAL: CAMU_Flip = 2; +pub const FLIP_REVERSE: CAMU_Flip = 3; +pub type CAMU_Flip = u32; +pub const SIZE_VGA: CAMU_Size = 0; +pub const SIZE_QVGA: CAMU_Size = 1; +pub const SIZE_QQVGA: CAMU_Size = 2; +pub const SIZE_CIF: CAMU_Size = 3; +pub const SIZE_QCIF: CAMU_Size = 4; +pub const SIZE_DS_LCD: CAMU_Size = 5; +pub const SIZE_DS_LCDx4: CAMU_Size = 6; +pub const SIZE_CTR_TOP_LCD: CAMU_Size = 7; +pub const SIZE_CTR_BOTTOM_LCD: CAMU_Size = 1; +pub type CAMU_Size = u32; +pub const FRAME_RATE_15: CAMU_FrameRate = 0; +pub const FRAME_RATE_15_TO_5: CAMU_FrameRate = 1; +pub const FRAME_RATE_15_TO_2: CAMU_FrameRate = 2; +pub const FRAME_RATE_10: CAMU_FrameRate = 3; +pub const FRAME_RATE_8_5: CAMU_FrameRate = 4; +pub const FRAME_RATE_5: CAMU_FrameRate = 5; +pub const FRAME_RATE_20: CAMU_FrameRate = 6; +pub const FRAME_RATE_20_TO_5: CAMU_FrameRate = 7; +pub const FRAME_RATE_30: CAMU_FrameRate = 8; +pub const FRAME_RATE_30_TO_5: CAMU_FrameRate = 9; +pub const FRAME_RATE_15_TO_10: CAMU_FrameRate = 10; +pub const FRAME_RATE_20_TO_10: CAMU_FrameRate = 11; +pub const FRAME_RATE_30_TO_10: CAMU_FrameRate = 12; +pub type CAMU_FrameRate = u32; +pub const WHITE_BALANCE_AUTO: CAMU_WhiteBalance = 0; +pub const WHITE_BALANCE_3200K: CAMU_WhiteBalance = 1; +pub const WHITE_BALANCE_4150K: CAMU_WhiteBalance = 2; +pub const WHITE_BALANCE_5200K: CAMU_WhiteBalance = 3; +pub const WHITE_BALANCE_6000K: CAMU_WhiteBalance = 4; +pub const WHITE_BALANCE_7000K: CAMU_WhiteBalance = 5; +pub const WHITE_BALANCE_NORMAL: CAMU_WhiteBalance = 0; +pub const WHITE_BALANCE_TUNGSTEN: CAMU_WhiteBalance = 1; +pub const WHITE_BALANCE_WHITE_FLUORESCENT_LIGHT: CAMU_WhiteBalance = 2; +pub const WHITE_BALANCE_DAYLIGHT: CAMU_WhiteBalance = 3; +pub const WHITE_BALANCE_CLOUDY: CAMU_WhiteBalance = 4; +pub const WHITE_BALANCE_HORIZON: CAMU_WhiteBalance = 4; +pub const WHITE_BALANCE_SHADE: CAMU_WhiteBalance = 5; +pub type CAMU_WhiteBalance = u32; +pub const PHOTO_MODE_NORMAL: CAMU_PhotoMode = 0; +pub const PHOTO_MODE_PORTRAIT: CAMU_PhotoMode = 1; +pub const PHOTO_MODE_LANDSCAPE: CAMU_PhotoMode = 2; +pub const PHOTO_MODE_NIGHTVIEW: CAMU_PhotoMode = 3; +pub const PHOTO_MODE_LETTER: CAMU_PhotoMode = 4; +pub type CAMU_PhotoMode = u32; +pub const EFFECT_NONE: CAMU_Effect = 0; +pub const EFFECT_MONO: CAMU_Effect = 1; +pub const EFFECT_SEPIA: CAMU_Effect = 2; +pub const EFFECT_NEGATIVE: CAMU_Effect = 3; +pub const EFFECT_NEGAFILM: CAMU_Effect = 4; +pub const EFFECT_SEPIA01: CAMU_Effect = 5; +pub type CAMU_Effect = u32; +pub const CONTRAST_PATTERN_01: CAMU_Contrast = 0; +pub const CONTRAST_PATTERN_02: CAMU_Contrast = 1; +pub const CONTRAST_PATTERN_03: CAMU_Contrast = 2; +pub const CONTRAST_PATTERN_04: CAMU_Contrast = 3; +pub const CONTRAST_PATTERN_05: CAMU_Contrast = 4; +pub const CONTRAST_PATTERN_06: CAMU_Contrast = 5; +pub const CONTRAST_PATTERN_07: CAMU_Contrast = 6; +pub const CONTRAST_PATTERN_08: CAMU_Contrast = 7; +pub const CONTRAST_PATTERN_09: CAMU_Contrast = 8; +pub const CONTRAST_PATTERN_10: CAMU_Contrast = 9; +pub const CONTRAST_PATTERN_11: CAMU_Contrast = 10; +pub const CONTRAST_LOW: CAMU_Contrast = 4; +pub const CONTRAST_NORMAL: CAMU_Contrast = 5; +pub const CONTRAST_HIGH: CAMU_Contrast = 6; +pub type CAMU_Contrast = u32; +pub const LENS_CORRECTION_OFF: CAMU_LensCorrection = 0; +pub const LENS_CORRECTION_ON_70: CAMU_LensCorrection = 1; +pub const LENS_CORRECTION_ON_90: CAMU_LensCorrection = 2; +pub const LENS_CORRECTION_DARK: CAMU_LensCorrection = 0; +pub const LENS_CORRECTION_NORMAL: CAMU_LensCorrection = 1; +pub const LENS_CORRECTION_BRIGHT: CAMU_LensCorrection = 2; +pub type CAMU_LensCorrection = u32; +pub const OUTPUT_YUV_422: CAMU_OutputFormat = 0; +pub const OUTPUT_RGB_565: CAMU_OutputFormat = 1; +pub type CAMU_OutputFormat = u32; +pub const SHUTTER_SOUND_TYPE_NORMAL: CAMU_ShutterSoundType = 0; +pub const SHUTTER_SOUND_TYPE_MOVIE: CAMU_ShutterSoundType = 1; +pub const SHUTTER_SOUND_TYPE_MOVIE_END: CAMU_ShutterSoundType = 2; +pub type CAMU_ShutterSoundType = u32; +#[repr(C)] +pub struct CAMU_ImageQualityCalibrationData { + pub aeBaseTarget: s16, + pub kRL: s16, + pub kGL: s16, + pub kBL: s16, + pub ccmPosition: s16, + pub awbCcmL9Right: u16, + pub awbCcmL9Left: u16, + pub awbCcmL10Right: u16, + pub awbCcmL10Left: u16, + pub awbX0Right: u16, + pub awbX0Left: u16, +} +#[repr(C)] +pub struct CAMU_StereoCameraCalibrationData { + pub isValidRotationXY: u8, + pub padding: [u8; 3usize], + pub scale: f32, + pub rotationZ: f32, + pub translationX: f32, + pub translationY: f32, + pub rotationX: f32, + pub rotationY: f32, + pub angleOfViewRight: f32, + pub angleOfViewLeft: f32, + pub distanceToChart: f32, + pub distanceCameras: f32, + pub imageWidth: s16, + pub imageHeight: s16, + pub reserved: [u8; 16usize], +} +#[repr(C)] +pub struct CAMU_PackageParameterCameraSelect { + pub camera: u8, + pub exposure: s8, + pub whiteBalance: u8, + pub sharpness: s8, + pub autoExposureOn: u8, + pub autoWhiteBalanceOn: u8, + pub frameRate: u8, + pub photoMode: u8, + pub contrast: u8, + pub lensCorrection: u8, + pub noiseFilterOn: u8, + pub padding: u8, + pub autoExposureWindowX: s16, + pub autoExposureWindowY: s16, + pub autoExposureWindowWidth: s16, + pub autoExposureWindowHeight: s16, + pub autoWhiteBalanceWindowX: s16, + pub autoWhiteBalanceWindowY: s16, + pub autoWhiteBalanceWindowWidth: s16, + pub autoWhiteBalanceWindowHeight: s16, +} +#[repr(C)] +pub struct CAMU_PackageParameterContext { + pub camera: u8, + pub context: u8, + pub flip: u8, + pub effect: u8, + pub size: u8, +} +#[repr(C)] +pub struct CAMU_PackageParameterContextDetail { + pub camera: u8, + pub context: u8, + pub flip: u8, + pub effect: u8, + pub width: s16, + pub height: s16, + pub cropX0: s16, + pub cropY0: s16, + pub cropX1: s16, + pub cropY1: s16, +} +extern "C" { + pub fn camInit() -> Result; +} +extern "C" { + pub fn camExit(); +} +extern "C" { + pub fn CAMU_StartCapture(port: u32) -> Result; +} +extern "C" { + pub fn CAMU_StopCapture(port: u32) -> Result; +} +extern "C" { + pub fn CAMU_IsBusy(busy: *mut bool, port: u32) -> Result; +} +extern "C" { + pub fn CAMU_ClearBuffer(port: u32) -> Result; +} +extern "C" { + pub fn CAMU_GetVsyncInterruptEvent(event: *mut Handle, port: u32) -> Result; +} +extern "C" { + pub fn CAMU_GetBufferErrorInterruptEvent(event: *mut Handle, port: u32) -> Result; +} +extern "C" { + pub fn CAMU_SetReceiving( + event: *mut Handle, + dst: *mut ::libc::c_void, + port: u32, + imageSize: u32, + transferUnit: s16, + ) -> Result; +} +extern "C" { + pub fn CAMU_IsFinishedReceiving(finishedReceiving: *mut bool, port: u32) -> Result; +} +extern "C" { + pub fn CAMU_SetTransferLines(port: u32, lines: s16, width: s16, height: s16) -> Result; +} +extern "C" { + pub fn CAMU_GetMaxLines(maxLines: *mut s16, width: s16, height: s16) -> Result; +} +extern "C" { + pub fn CAMU_SetTransferBytes(port: u32, bytes: u32, width: s16, height: s16) -> Result; +} +extern "C" { + pub fn CAMU_GetTransferBytes(transferBytes: *mut u32, port: u32) -> Result; +} +extern "C" { + pub fn CAMU_GetMaxBytes(maxBytes: *mut u32, width: s16, height: s16) -> Result; +} +extern "C" { + pub fn CAMU_SetTrimming(port: u32, trimming: bool) -> Result; +} +extern "C" { + pub fn CAMU_IsTrimming(trimming: *mut bool, port: u32) -> Result; +} +extern "C" { + pub fn CAMU_SetTrimmingParams( + port: u32, + xStart: s16, + yStart: s16, + xEnd: s16, + yEnd: s16, + ) -> Result; +} +extern "C" { + pub fn CAMU_GetTrimmingParams( + xStart: *mut s16, + yStart: *mut s16, + xEnd: *mut s16, + yEnd: *mut s16, + port: u32, + ) -> Result; +} +extern "C" { + pub fn CAMU_SetTrimmingParamsCenter( + port: u32, + trimWidth: s16, + trimHeight: s16, + camWidth: s16, + camHeight: s16, + ) -> Result; +} +extern "C" { + pub fn CAMU_Activate(select: u32) -> Result; +} +extern "C" { + pub fn CAMU_SwitchContext(select: u32, context: CAMU_Context) -> Result; +} +extern "C" { + pub fn CAMU_SetExposure(select: u32, exposure: s8) -> Result; +} +extern "C" { + pub fn CAMU_SetWhiteBalance(select: u32, whiteBalance: CAMU_WhiteBalance) -> Result; +} +extern "C" { + pub fn CAMU_SetWhiteBalanceWithoutBaseUp( + select: u32, + whiteBalance: CAMU_WhiteBalance, + ) -> Result; +} +extern "C" { + pub fn CAMU_SetSharpness(select: u32, sharpness: s8) -> Result; +} +extern "C" { + pub fn CAMU_SetAutoExposure(select: u32, autoExposure: bool) -> Result; +} +extern "C" { + pub fn CAMU_IsAutoExposure(autoExposure: *mut bool, select: u32) -> Result; +} +extern "C" { + pub fn CAMU_SetAutoWhiteBalance(select: u32, autoWhiteBalance: bool) -> Result; +} +extern "C" { + pub fn CAMU_IsAutoWhiteBalance(autoWhiteBalance: *mut bool, select: u32) -> Result; +} +extern "C" { + pub fn CAMU_FlipImage(select: u32, flip: CAMU_Flip, context: CAMU_Context) -> Result; +} +extern "C" { + pub fn CAMU_SetDetailSize( + select: u32, + width: s16, + height: s16, + cropX0: s16, + cropY0: s16, + cropX1: s16, + cropY1: s16, + context: CAMU_Context, + ) -> Result; +} +extern "C" { + pub fn CAMU_SetSize(select: u32, size: CAMU_Size, context: CAMU_Context) -> Result; +} +extern "C" { + pub fn CAMU_SetFrameRate(select: u32, frameRate: CAMU_FrameRate) -> Result; +} +extern "C" { + pub fn CAMU_SetPhotoMode(select: u32, photoMode: CAMU_PhotoMode) -> Result; +} +extern "C" { + pub fn CAMU_SetEffect(select: u32, effect: CAMU_Effect, context: CAMU_Context) -> Result; +} +extern "C" { + pub fn CAMU_SetContrast(select: u32, contrast: CAMU_Contrast) -> Result; +} +extern "C" { + pub fn CAMU_SetLensCorrection(select: u32, lensCorrection: CAMU_LensCorrection) -> Result; +} +extern "C" { + pub fn CAMU_SetOutputFormat( + select: u32, + format: CAMU_OutputFormat, + context: CAMU_Context, + ) -> Result; +} +extern "C" { + pub fn CAMU_SetAutoExposureWindow( + select: u32, + x: s16, + y: s16, + width: s16, + height: s16, + ) -> Result; +} +extern "C" { + pub fn CAMU_SetAutoWhiteBalanceWindow( + select: u32, + x: s16, + y: s16, + width: s16, + height: s16, + ) -> Result; +} +extern "C" { + pub fn CAMU_SetNoiseFilter(select: u32, noiseFilter: bool) -> Result; +} +extern "C" { + pub fn CAMU_SynchronizeVsyncTiming(select1: u32, select2: u32) -> Result; +} +extern "C" { + pub fn CAMU_GetLatestVsyncTiming(timing: *mut s64, port: u32, past: u32) -> Result; +} +extern "C" { + pub fn CAMU_GetStereoCameraCalibrationData( + data: *mut CAMU_StereoCameraCalibrationData, + ) -> Result; +} +extern "C" { + pub fn CAMU_SetStereoCameraCalibrationData(data: CAMU_StereoCameraCalibrationData) -> Result; +} +extern "C" { + pub fn CAMU_WriteRegisterI2c(select: u32, addr: u16, data: u16) -> Result; +} +extern "C" { + pub fn CAMU_WriteMcuVariableI2c(select: u32, addr: u16, data: u16) -> Result; +} +extern "C" { + pub fn CAMU_ReadRegisterI2cExclusive(data: *mut u16, select: u32, addr: u16) -> Result; +} +extern "C" { + pub fn CAMU_ReadMcuVariableI2cExclusive(data: *mut u16, select: u32, addr: u16) -> Result; +} +extern "C" { + pub fn CAMU_SetImageQualityCalibrationData(data: CAMU_ImageQualityCalibrationData) -> Result; +} +extern "C" { + pub fn CAMU_GetImageQualityCalibrationData( + data: *mut CAMU_ImageQualityCalibrationData, + ) -> Result; +} +extern "C" { + pub fn CAMU_SetPackageParameterWithoutContext( + param: CAMU_PackageParameterCameraSelect, + ) -> Result; +} +extern "C" { + pub fn CAMU_SetPackageParameterWithContext(param: CAMU_PackageParameterContext) -> Result; +} +extern "C" { + pub fn CAMU_SetPackageParameterWithContextDetail( + param: CAMU_PackageParameterContextDetail, + ) -> Result; +} +extern "C" { + pub fn CAMU_GetSuitableY2rStandardCoefficient( + coefficient: *mut Y2RU_StandardCoefficient, + ) -> Result; +} +extern "C" { + pub fn CAMU_PlayShutterSound(sound: CAMU_ShutterSoundType) -> Result; +} +extern "C" { + pub fn CAMU_DriverInitialize() -> Result; +} +extern "C" { + pub fn CAMU_DriverFinalize() -> Result; +} +extern "C" { + pub fn CAMU_GetActivatedCamera(select: *mut u32) -> Result; +} +extern "C" { + pub fn CAMU_GetSleepCamera(select: *mut u32) -> Result; +} +extern "C" { + pub fn CAMU_SetSleepCamera(select: u32) -> Result; +} +extern "C" { + pub fn CAMU_SetBrightnessSynchronization(brightnessSynchronization: bool) -> Result; +} +extern "C" { + pub fn cfgnorInit(value: u8) -> Result; +} +extern "C" { + pub fn cfgnorExit(); +} +extern "C" { + pub fn cfgnorDumpFlash(buf: *mut u32, size: u32) -> Result; +} +extern "C" { + pub fn cfgnorWriteFlash(buf: *mut u32, size: u32) -> Result; +} +extern "C" { + pub fn CFGNOR_Initialize(value: u8) -> Result; +} +extern "C" { + pub fn CFGNOR_Shutdown() -> Result; +} +extern "C" { + pub fn CFGNOR_ReadData(offset: u32, buf: *mut u32, size: u32) -> Result; +} +extern "C" { + pub fn CFGNOR_WriteData(offset: u32, buf: *mut u32, size: u32) -> Result; +} +pub const CFG_REGION_JPN: CFG_Region = 0; +pub const CFG_REGION_USA: CFG_Region = 1; +pub const CFG_REGION_EUR: CFG_Region = 2; +pub const CFG_REGION_AUS: CFG_Region = 3; +pub const CFG_REGION_CHN: CFG_Region = 4; +pub const CFG_REGION_KOR: CFG_Region = 5; +pub const CFG_REGION_TWN: CFG_Region = 6; +pub type CFG_Region = u32; +pub const CFG_LANGUAGE_JP: CFG_Language = 0; +pub const CFG_LANGUAGE_EN: CFG_Language = 1; +pub const CFG_LANGUAGE_FR: CFG_Language = 2; +pub const CFG_LANGUAGE_DE: CFG_Language = 3; +pub const CFG_LANGUAGE_IT: CFG_Language = 4; +pub const CFG_LANGUAGE_ES: CFG_Language = 5; +pub const CFG_LANGUAGE_ZH: CFG_Language = 6; +pub const CFG_LANGUAGE_KO: CFG_Language = 7; +pub const CFG_LANGUAGE_NL: CFG_Language = 8; +pub const CFG_LANGUAGE_PT: CFG_Language = 9; +pub const CFG_LANGUAGE_RU: CFG_Language = 10; +pub const CFG_LANGUAGE_TW: CFG_Language = 11; +pub type CFG_Language = u32; +extern "C" { + pub fn cfguInit() -> Result; +} +extern "C" { + pub fn cfguExit(); +} +extern "C" { + pub fn CFGU_SecureInfoGetRegion(region: *mut u8) -> Result; +} +extern "C" { + pub fn CFGU_GenHashConsoleUnique(appIDSalt: u32, hash: *mut u64) -> Result; +} +extern "C" { + pub fn CFGU_GetRegionCanadaUSA(value: *mut u8) -> Result; +} +extern "C" { + pub fn CFGU_GetSystemModel(model: *mut u8) -> Result; +} +extern "C" { + pub fn CFGU_GetModelNintendo2DS(value: *mut u8) -> Result; +} +extern "C" { + pub fn CFGU_GetCountryCodeString(code: u16, string: *mut u16) -> Result; +} +extern "C" { + pub fn CFGU_GetCountryCodeID(string: u16, code: *mut u16) -> Result; +} +extern "C" { + pub fn CFGU_IsNFCSupported(isSupported: *mut bool) -> Result; +} +extern "C" { + pub fn CFGU_GetConfigInfoBlk2(size: u32, blkID: u32, outData: *mut u8) -> Result; +} +extern "C" { + pub fn CFG_GetConfigInfoBlk4(size: u32, blkID: u32, outData: *mut u8) -> Result; +} +extern "C" { + pub fn CFG_GetConfigInfoBlk8(size: u32, blkID: u32, outData: *mut u8) -> Result; +} +extern "C" { + pub fn CFG_SetConfigInfoBlk4(size: u32, blkID: u32, inData: *mut u8) -> Result; +} +extern "C" { + pub fn CFG_SetConfigInfoBlk8(size: u32, blkID: u32, inData: *mut u8) -> Result; +} +extern "C" { + pub fn CFG_UpdateConfigSavegame() -> Result; +} +extern "C" { + pub fn CFGU_GetSystemLanguage(language: *mut u8) -> Result; +} +extern "C" { + pub fn CFGI_RestoreLocalFriendCodeSeed() -> Result; +} +extern "C" { + pub fn CFGI_RestoreSecureInfo() -> Result; +} +extern "C" { + pub fn CFGI_DeleteConfigSavefile() -> Result; +} +extern "C" { + pub fn CFGI_FormatConfig() -> Result; +} +extern "C" { + pub fn CFGI_ClearParentalControls() -> Result; +} +extern "C" { + pub fn CFGI_VerifySigLocalFriendCodeSeed() -> Result; +} +extern "C" { + pub fn CFGI_VerifySigSecureInfo() -> Result; +} +extern "C" { + pub fn CFGI_SecureInfoGetSerialNumber(serial: *mut u8) -> Result; +} +extern "C" { + pub fn CFGI_GetLocalFriendCodeSeedData(data: *mut u8) -> Result; +} +extern "C" { + pub fn CFGI_GetLocalFriendCodeSeed(seed: *mut u64) -> Result; +} +extern "C" { + pub fn CFGI_GetSecureInfoData(data: *mut u8) -> Result; +} +extern "C" { + pub fn CFGI_GetSecureInfoSignature(data: *mut u8) -> Result; +} +pub const CSND_ENCODING_PCM8: _bindgen_ty_15 = 0; +pub const CSND_ENCODING_PCM16: _bindgen_ty_15 = 1; +pub const CSND_ENCODING_ADPCM: _bindgen_ty_15 = 2; +pub const CSND_ENCODING_PSG: _bindgen_ty_15 = 3; +pub type _bindgen_ty_15 = u32; +pub const CSND_LOOPMODE_MANUAL: _bindgen_ty_16 = 0; +pub const CSND_LOOPMODE_NORMAL: _bindgen_ty_16 = 1; +pub const CSND_LOOPMODE_ONESHOT: _bindgen_ty_16 = 2; +pub const CSND_LOOPMODE_NORELOAD: _bindgen_ty_16 = 3; +pub type _bindgen_ty_16 = u32; +pub const SOUND_LINEAR_INTERP: _bindgen_ty_17 = 64; +pub const SOUND_REPEAT: _bindgen_ty_17 = 1024; +pub const SOUND_ONE_SHOT: _bindgen_ty_17 = 2048; +pub const SOUND_FORMAT_8BIT: _bindgen_ty_17 = 0; +pub const SOUND_FORMAT_16BIT: _bindgen_ty_17 = 4096; +pub const SOUND_FORMAT_ADPCM: _bindgen_ty_17 = 8192; +pub const SOUND_FORMAT_PSG: _bindgen_ty_17 = 12288; +pub const SOUND_ENABLE: _bindgen_ty_17 = 16384; +pub type _bindgen_ty_17 = u32; +pub const CAPTURE_REPEAT: _bindgen_ty_18 = 0; +pub const CAPTURE_ONE_SHOT: _bindgen_ty_18 = 1; +pub const CAPTURE_FORMAT_16BIT: _bindgen_ty_18 = 0; +pub const CAPTURE_FORMAT_8BIT: _bindgen_ty_18 = 2; +pub const CAPTURE_ENABLE: _bindgen_ty_18 = 32768; +pub type _bindgen_ty_18 = u32; +pub const DutyCycle_0: CSND_DutyCycle = 7; +pub const DutyCycle_12: CSND_DutyCycle = 0; +pub const DutyCycle_25: CSND_DutyCycle = 1; +pub const DutyCycle_37: CSND_DutyCycle = 2; +pub const DutyCycle_50: CSND_DutyCycle = 3; +pub const DutyCycle_62: CSND_DutyCycle = 4; +pub const DutyCycle_75: CSND_DutyCycle = 5; +pub const DutyCycle_87: CSND_DutyCycle = 6; +pub type CSND_DutyCycle = u32; +#[repr(C)] +pub struct CSND_ChnInfo { + pub value: __BindgenUnionField<[u32; 3usize]>, + pub __bindgen_anon_1: __BindgenUnionField, + pub bindgen_union_field: [u32; 3usize], +} +#[repr(C)] +pub struct CSND_ChnInfo__bindgen_ty_1 { + pub active: u8, + pub _pad1: u8, + pub _pad2: u16, + pub adpcmSample: s16, + pub adpcmIndex: u8, + pub _pad3: u8, + pub unknownZero: u32, +} +#[repr(C)] +pub struct CSND_CapInfo { + pub value: __BindgenUnionField<[u32; 2usize]>, + pub __bindgen_anon_1: __BindgenUnionField, + pub bindgen_union_field: [u32; 2usize], +} +#[repr(C)] +pub struct CSND_CapInfo__bindgen_ty_1 { + pub active: u8, + pub _pad1: u8, + pub _pad2: u16, + pub unknownZero: u32, +} +extern "C" { + pub static mut csndSharedMem: *mut vu32; +} +extern "C" { + pub static mut csndSharedMemSize: u32; +} +extern "C" { + pub static mut csndChannels: u32; +} +extern "C" { + pub fn CSND_AcquireCapUnit(capUnit: *mut u32) -> Result; +} +extern "C" { + pub fn CSND_ReleaseCapUnit(capUnit: u32) -> Result; +} +extern "C" { + pub fn CSND_FlushDataCache(adr: *const ::libc::c_void, size: u32) -> Result; +} +extern "C" { + pub fn CSND_StoreDataCache(adr: *const ::libc::c_void, size: u32) -> Result; +} +extern "C" { + pub fn CSND_InvalidateDataCache(adr: *const ::libc::c_void, size: u32) -> Result; +} +extern "C" { + pub fn CSND_Reset() -> Result; +} +extern "C" { + pub fn csndInit() -> Result; +} +extern "C" { + pub fn csndExit(); +} +extern "C" { + pub fn csndAddCmd(cmdid: ::libc::c_int) -> *mut u32; +} +extern "C" { + pub fn csndWriteCmd(cmdid: ::libc::c_int, cmdparams: *mut u8); +} +extern "C" { + pub fn csndExecCmds(waitDone: bool) -> Result; +} +extern "C" { + pub fn CSND_SetPlayStateR(channel: u32, value: u32); +} +extern "C" { + pub fn CSND_SetPlayState(channel: u32, value: u32); +} +extern "C" { + pub fn CSND_SetEncoding(channel: u32, value: u32); +} +extern "C" { + pub fn CSND_SetBlock(channel: u32, block: ::libc::c_int, physaddr: u32, size: u32); +} +extern "C" { + pub fn CSND_SetLooping(channel: u32, value: u32); +} +extern "C" { + pub fn CSND_SetBit7(channel: u32, set: bool); +} +extern "C" { + pub fn CSND_SetInterp(channel: u32, interp: bool); +} +extern "C" { + pub fn CSND_SetDuty(channel: u32, duty: CSND_DutyCycle); +} +extern "C" { + pub fn CSND_SetTimer(channel: u32, timer: u32); +} +extern "C" { + pub fn CSND_SetVol(channel: u32, chnVolumes: u32, capVolumes: u32); +} +extern "C" { + pub fn CSND_SetAdpcmState( + channel: u32, + block: ::libc::c_int, + sample: ::libc::c_int, + index: ::libc::c_int, + ); +} +extern "C" { + pub fn CSND_SetAdpcmReload(channel: u32, reload: bool); +} +extern "C" { + pub fn CSND_SetChnRegs( + flags: u32, + physaddr0: u32, + physaddr1: u32, + totalbytesize: u32, + chnVolumes: u32, + capVolumes: u32, + ); +} +extern "C" { + pub fn CSND_SetChnRegsPSG(flags: u32, chnVolumes: u32, capVolumes: u32, duty: CSND_DutyCycle); +} +extern "C" { + pub fn CSND_SetChnRegsNoise(flags: u32, chnVolumes: u32, capVolumes: u32); +} +extern "C" { + pub fn CSND_CapEnable(capUnit: u32, enable: bool); +} +extern "C" { + pub fn CSND_CapSetRepeat(capUnit: u32, repeat: bool); +} +extern "C" { + pub fn CSND_CapSetFormat(capUnit: u32, eightbit: bool); +} +extern "C" { + pub fn CSND_CapSetBit2(capUnit: u32, set: bool); +} +extern "C" { + pub fn CSND_CapSetTimer(capUnit: u32, timer: u32); +} +extern "C" { + pub fn CSND_CapSetBuffer(capUnit: u32, addr: u32, size: u32); +} +extern "C" { + pub fn CSND_SetCapRegs(capUnit: u32, flags: u32, addr: u32, size: u32); +} +extern "C" { + pub fn CSND_SetDspFlags(waitDone: bool) -> Result; +} +extern "C" { + pub fn CSND_UpdateInfo(waitDone: bool) -> Result; +} +extern "C" { + pub fn csndPlaySound( + chn: ::libc::c_int, + flags: u32, + sampleRate: u32, + vol: f32, + pan: f32, + data0: *mut ::libc::c_void, + data1: *mut ::libc::c_void, + size: u32, + ) -> Result; +} +extern "C" { + pub fn csndGetDspFlags(outSemFlags: *mut u32, outIrqFlags: *mut u32); +} +extern "C" { + pub fn csndGetChnInfo(channel: u32) -> *mut CSND_ChnInfo; +} +extern "C" { + pub fn csndGetCapInfo(capUnit: u32) -> *mut CSND_CapInfo; +} +extern "C" { + pub fn csndGetState(channel: u32, out: *mut CSND_ChnInfo) -> Result; +} +extern "C" { + pub fn csndIsPlaying(channel: u32, status: *mut u8) -> Result; +} +pub const DSP_INTERRUPT_PIPE: DSP_InterruptType = 2; +pub type DSP_InterruptType = u32; +pub const DSP_PIPE_INPUT: DSP_PipeDirection = 0; +pub const DSP_PIPE_OUTPUT: DSP_PipeDirection = 1; +pub type DSP_PipeDirection = u32; +extern "C" { + pub fn dspInit() -> Result; +} +extern "C" { + pub fn dspExit(); +} +extern "C" { + pub fn DSP_GetHeadphoneStatus(is_inserted: *mut bool) -> Result; +} +extern "C" { + pub fn DSP_FlushDataCache(address: *const ::libc::c_void, size: u32) -> Result; +} +extern "C" { + pub fn DSP_InvalidateDataCache(address: *const ::libc::c_void, size: u32) -> Result; +} +extern "C" { + pub fn DSP_GetSemaphoreHandle(semaphore: *mut Handle) -> Result; +} +extern "C" { + pub fn DSP_SetSemaphore(value: u16) -> Result; +} +extern "C" { + pub fn DSP_SetSemaphoreMask(mask: u16) -> Result; +} +extern "C" { + pub fn DSP_LoadComponent( + component: *const ::libc::c_void, + size: u32, + prog_mask: u16, + data_mask: u16, + is_loaded: *mut bool, + ) -> Result; +} +extern "C" { + pub fn DSP_UnloadComponent() -> Result; +} +extern "C" { + pub fn DSP_RegisterInterruptEvents(handle: Handle, interrupt: u32, channel: u32) -> Result; +} +extern "C" { + pub fn DSP_ReadPipeIfPossible( + channel: u32, + peer: u32, + buffer: *mut ::libc::c_void, + length: u16, + length_read: *mut u16, + ) -> Result; +} +extern "C" { + pub fn DSP_WriteProcessPipe(channel: u32, buffer: *const ::libc::c_void, length: u32) + -> Result; +} +extern "C" { + pub fn DSP_ConvertProcessAddressFromDspDram(dsp_address: u32, arm_address: *mut u32) -> Result; +} +extern "C" { + pub fn DSP_RecvData(regNo: u16, value: *mut u16) -> Result; +} +extern "C" { + pub fn DSP_RecvDataIsReady(regNo: u16, is_ready: *mut bool) -> Result; +} +extern "C" { + pub fn DSP_SendData(regNo: u16, value: u16) -> Result; +} +extern "C" { + pub fn DSP_SendDataIsEmpty(regNo: u16, is_empty: *mut bool) -> Result; +} +#[repr(C, packed)] +pub struct FriendKey { + pub principalId: u32, + pub padding: u32, + pub localFriendCode: u64, +} +#[repr(C, packed)] +pub struct TitleData { + pub tid: u64, + pub version: u32, + pub unk: u32, +} +#[repr(C, packed)] +pub struct MiiData { + pub mii_id: u32, + pub system_id: u64, + pub cdate: u32, + pub mac: [u8; 6usize], + pub padding: u16, + pub misc1: u16, + pub mii_name: [u16; 11usize], + pub width: u8, + pub height: u8, + pub misc2: u32, + pub unknown1: u32, + pub misc3: u32, + pub unknown2: u32, + pub allow_copy: u8, + pub unknown3: [u8; 7usize], + pub author: [u16; 11usize], +} +#[repr(C, packed)] +pub struct FriendProfile { + pub region: u8, + pub country: u8, + pub area: u8, + pub language: u8, + pub platform: u8, + pub padding: u32, +} +#[repr(C, packed)] +pub struct GameDescription { + pub data: TitleData, + pub desc: [u16; 128usize], +} +#[repr(C, packed)] +pub struct NotificationEvent { + pub type_: u8, + pub padding3: [u8; 3usize], + pub padding: u32, + pub key: FriendKey, +} +pub const USER_WENT_ONLINE: NotificationTypes = 1; +pub const USER_WENT_OFFLINE: NotificationTypes = 2; +pub const FRIEND_WENT_ONLINE: NotificationTypes = 3; +pub const FRIEND_UPDATED_PRESENCE: NotificationTypes = 4; +pub const FRIEND_UPDATED_MII: NotificationTypes = 5; +pub const FRIEND_UPDATED_PROFILE: NotificationTypes = 6; +pub const FRIEND_WENT_OFFLINE: NotificationTypes = 7; +pub const FRIEND_REGISTERED_USER: NotificationTypes = 8; +pub const FRIEND_SENT_INVITATION: NotificationTypes = 9; +pub type NotificationTypes = u32; +extern "C" { + pub fn frdInit() -> Result; +} +extern "C" { + pub fn frdExit(); +} +extern "C" { + pub fn frdSessionGetHandle() -> *mut Handle; +} +extern "C" { + pub fn FRDU_HasLoggedIn(state: *mut bool) -> Result; +} +extern "C" { + pub fn FRDU_IsOnline(state: *mut bool) -> Result; +} +extern "C" { + pub fn FRD_Logout() -> Result; +} +extern "C" { + pub fn FRD_Login(event: Handle) -> Result; +} +extern "C" { + pub fn FRD_GetMyFriendKey(key: *mut FriendKey) -> Result; +} +extern "C" { + pub fn FRD_GetMyPreference( + isPublicMode: *mut bool, + isShowGameName: *mut bool, + isShowPlayedGame: *mut bool, + ) -> Result; +} +extern "C" { + pub fn FRD_GetMyProfile(profile: *mut FriendProfile) -> Result; +} +extern "C" { + pub fn FRD_GetMyScreenName(name: *mut ::libc::c_char, max_size: usize) -> Result; +} +extern "C" { + pub fn FRD_GetMyMii(mii: *mut MiiData) -> Result; +} +extern "C" { + pub fn FRD_GetMyPlayingGame(titleId: *mut u64) -> Result; +} +extern "C" { + pub fn FRD_GetMyFavoriteGame(titleId: *mut u64) -> Result; +} +extern "C" { + pub fn FRD_GetMyComment(comment: *mut ::libc::c_char, max_size: usize) -> Result; +} +extern "C" { + pub fn FRD_GetFriendKeyList( + friendKeyList: *mut FriendKey, + num: *mut u32, + offset: u32, + size: u32, + ) -> Result; +} +extern "C" { + pub fn FRD_GetFriendMii( + miiDataList: *mut MiiData, + friendKeyList: *const FriendKey, + size: usize, + ) -> Result; +} +extern "C" { + pub fn FRD_GetFriendProfile( + profile: *mut FriendProfile, + friendKeyList: *const FriendKey, + size: usize, + ) -> Result; +} +extern "C" { + pub fn FRD_GetFriendPlayingGame( + desc: *mut GameDescription, + friendKeyList: *const FriendKey, + size: usize, + ) -> Result; +} +extern "C" { + pub fn FRD_GetFriendFavouriteGame( + desc: *mut GameDescription, + friendKeyList: *const FriendKey, + count: u32, + ) -> Result; +} +extern "C" { + pub fn FRD_IsInFriendList(friendKeyList: *mut FriendKey, isFromList: *mut bool) -> Result; +} +extern "C" { + pub fn FRD_UpdateGameModeDescription(desc: *const ::libc::c_char) -> Result; +} +extern "C" { + pub fn FRD_AttachToEventNotification(event: Handle) -> Result; +} +extern "C" { + pub fn FRD_GetEventNotification( + event: *mut NotificationEvent, + count: u32, + recievedNotifCount: *mut u32, + ) -> Result; +} +extern "C" { + pub fn FRD_PrincipalIdToFriendCode(principalId: u32, friendCode: *mut u64) -> Result; +} +extern "C" { + pub fn FRD_FriendCodeToPrincipalId(friendCode: u64, principalId: *mut u32) -> Result; +} +extern "C" { + pub fn FRD_IsValidFriendCode(friendCode: u64, isValid: *mut bool) -> Result; +} +extern "C" { + pub fn FRD_SetClientSdkVersion(sdkVer: u32) -> Result; +} +extern "C" { + pub fn FRD_AddFriendOnline(event: Handle, principalId: u32) -> Result; +} +extern "C" { + pub fn FRD_RemoveFriend(principalId: u32, localFriendCode: u64) -> Result; +} +pub const GSPLCD_SCREEN_TOP: _bindgen_ty_19 = 1; +pub const GSPLCD_SCREEN_BOTTOM: _bindgen_ty_19 = 2; +pub const GSPLCD_SCREEN_BOTH: _bindgen_ty_19 = 3; +pub type _bindgen_ty_19 = u32; +extern "C" { + pub fn gspLcdInit() -> Result; +} +extern "C" { + pub fn gspLcdExit(); +} +extern "C" { + pub fn GSPLCD_PowerOnAllBacklights() -> Result; +} +extern "C" { + pub fn GSPLCD_PowerOffAllBacklights() -> Result; +} +extern "C" { + pub fn GSPLCD_PowerOnBacklight(screen: u32) -> Result; +} +extern "C" { + pub fn GSPLCD_PowerOffBacklight(screen: u32) -> Result; +} +extern "C" { + pub fn GSPLCD_SetLedForceOff(disable: bool) -> Result; +} +extern "C" { + pub fn GSPLCD_GetVendors(vendors: *mut u8) -> Result; +} +extern "C" { + pub fn GSPLCD_GetBrightness(screen: u32, brightness: *mut u32) -> Result; +} +extern "C" { + pub fn GSPLCD_SetBrightness(screen: u32, brightness: u32) -> Result; +} +extern "C" { + pub fn GSPLCD_SetBrightnessRaw(screen: u32, brightness: u32) -> Result; +} +pub const KEY_A: _bindgen_ty_20 = 1; +pub const KEY_B: _bindgen_ty_20 = 2; +pub const KEY_SELECT: _bindgen_ty_20 = 4; +pub const KEY_START: _bindgen_ty_20 = 8; +pub const KEY_DRIGHT: _bindgen_ty_20 = 16; +pub const KEY_DLEFT: _bindgen_ty_20 = 32; +pub const KEY_DUP: _bindgen_ty_20 = 64; +pub const KEY_DDOWN: _bindgen_ty_20 = 128; +pub const KEY_R: _bindgen_ty_20 = 256; +pub const KEY_L: _bindgen_ty_20 = 512; +pub const KEY_X: _bindgen_ty_20 = 1024; +pub const KEY_Y: _bindgen_ty_20 = 2048; +pub const KEY_ZL: _bindgen_ty_20 = 16384; +pub const KEY_ZR: _bindgen_ty_20 = 32768; +pub const KEY_TOUCH: _bindgen_ty_20 = 1048576; +pub const KEY_CSTICK_RIGHT: _bindgen_ty_20 = 16777216; +pub const KEY_CSTICK_LEFT: _bindgen_ty_20 = 33554432; +pub const KEY_CSTICK_UP: _bindgen_ty_20 = 67108864; +pub const KEY_CSTICK_DOWN: _bindgen_ty_20 = 134217728; +pub const KEY_CPAD_RIGHT: _bindgen_ty_20 = 268435456; +pub const KEY_CPAD_LEFT: _bindgen_ty_20 = 536870912; +pub const KEY_CPAD_UP: _bindgen_ty_20 = 1073741824; +pub const KEY_CPAD_DOWN: _bindgen_ty_20 = 2147483648; +pub const KEY_UP: _bindgen_ty_20 = 1073741888; +pub const KEY_DOWN: _bindgen_ty_20 = 2147483776; +pub const KEY_LEFT: _bindgen_ty_20 = 536870944; +pub const KEY_RIGHT: _bindgen_ty_20 = 268435472; +pub type _bindgen_ty_20 = u32; +#[repr(C)] +pub struct touchPosition { + pub px: u16, + pub py: u16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct circlePosition { + pub dx: s16, + pub dy: s16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct accelVector { + pub x: s16, + pub y: s16, + pub z: s16, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct angularRate { + pub x: s16, + pub z: s16, + pub y: s16, +} +pub const HIDEVENT_PAD0: HID_Event = 0; +pub const HIDEVENT_PAD1: HID_Event = 1; +pub const HIDEVENT_Accel: HID_Event = 2; +pub const HIDEVENT_Gyro: HID_Event = 3; +pub const HIDEVENT_DebugPad: HID_Event = 4; +pub const HIDEVENT_MAX: HID_Event = 5; +pub type HID_Event = u32; +extern "C" { + pub static mut hidMemHandle: Handle; +} +extern "C" { + pub static mut hidSharedMem: *mut vu32; +} +extern "C" { + pub fn hidInit() -> Result; +} +extern "C" { + pub fn hidExit(); +} +extern "C" { + pub fn hidScanInput(); +} +extern "C" { + pub fn hidKeysHeld() -> u32; +} +extern "C" { + pub fn hidKeysDown() -> u32; +} +extern "C" { + pub fn hidKeysUp() -> u32; +} +extern "C" { + pub fn hidTouchRead(pos: *mut touchPosition); +} +extern "C" { + pub fn hidCircleRead(pos: *mut circlePosition); +} +extern "C" { + pub fn hidAccelRead(vector: *mut accelVector); +} +extern "C" { + pub fn hidGyroRead(rate: *mut angularRate); +} +extern "C" { + pub fn hidWaitForEvent(id: HID_Event, nextEvent: bool); +} +extern "C" { + pub fn HIDUSER_GetHandles( + outMemHandle: *mut Handle, + eventpad0: *mut Handle, + eventpad1: *mut Handle, + eventaccel: *mut Handle, + eventgyro: *mut Handle, + eventdebugpad: *mut Handle, + ) -> Result; +} +extern "C" { + pub fn HIDUSER_EnableAccelerometer() -> Result; +} +extern "C" { + pub fn HIDUSER_DisableAccelerometer() -> Result; +} +extern "C" { + pub fn HIDUSER_EnableGyroscope() -> Result; +} +extern "C" { + pub fn HIDUSER_DisableGyroscope() -> Result; +} +extern "C" { + pub fn HIDUSER_GetGyroscopeRawToDpsCoefficient(coeff: *mut f32) -> Result; +} +extern "C" { + pub fn HIDUSER_GetSoundVolume(volume: *mut u8) -> Result; +} +extern "C" { + pub static mut irrstMemHandle: Handle; +} +extern "C" { + pub static mut irrstSharedMem: *mut vu32; +} +extern "C" { + pub fn irrstInit() -> Result; +} +extern "C" { + pub fn irrstExit(); +} +extern "C" { + pub fn irrstScanInput(); +} +extern "C" { + pub fn irrstKeysHeld() -> u32; +} +extern "C" { + pub fn irrstCstickRead(pos: *mut circlePosition); +} +extern "C" { + pub fn irrstWaitForEvent(nextEvent: bool); +} +extern "C" { + pub fn IRRST_GetHandles(outMemHandle: *mut Handle, outEventHandle: *mut Handle) -> Result; +} +extern "C" { + pub fn IRRST_Initialize(unk1: u32, unk2: u8) -> Result; +} +extern "C" { + pub fn IRRST_Shutdown() -> Result; +} +#[repr(C)] +pub struct sslcContext { + pub servhandle: Handle, + pub sslchandle: u32, + pub sharedmem_handle: Handle, +} +pub const SSLC_DefaultRootCert_Nintendo_CA: SSLC_DefaultRootCert = 1; +pub const SSLC_DefaultRootCert_Nintendo_CA_G2: SSLC_DefaultRootCert = 2; +pub const SSLC_DefaultRootCert_Nintendo_CA_G3: SSLC_DefaultRootCert = 3; +pub const SSLC_DefaultRootCert_Nintendo_Class2_CA: SSLC_DefaultRootCert = 4; +pub const SSLC_DefaultRootCert_Nintendo_Class2_CA_G2: SSLC_DefaultRootCert = 5; +pub const SSLC_DefaultRootCert_Nintendo_Class2_CA_G3: SSLC_DefaultRootCert = 6; +pub const SSLC_DefaultRootCert_CyberTrust: SSLC_DefaultRootCert = 7; +pub const SSLC_DefaultRootCert_AddTrust_External_CA: SSLC_DefaultRootCert = 8; +pub const SSLC_DefaultRootCert_COMODO: SSLC_DefaultRootCert = 9; +pub const SSLC_DefaultRootCert_USERTrust: SSLC_DefaultRootCert = 10; +pub const SSLC_DefaultRootCert_DigiCert_EV: SSLC_DefaultRootCert = 11; +pub type SSLC_DefaultRootCert = u32; +pub const SSLC_DefaultClientCert_ClCertA: SSLC_DefaultClientCert = 64; +pub type SSLC_DefaultClientCert = u32; +pub const SSLCOPT_Default: _bindgen_ty_21 = 0; +pub const SSLCOPT_DisableVerify: _bindgen_ty_21 = 512; +pub const SSLCOPT_TLSv10: _bindgen_ty_21 = 2048; +pub type _bindgen_ty_21 = u32; +extern "C" { + pub fn sslcInit(session_handle: Handle) -> Result; +} +extern "C" { + pub fn sslcExit(); +} +extern "C" { + pub fn sslcCreateRootCertChain(RootCertChain_contexthandle: *mut u32) -> Result; +} +extern "C" { + pub fn sslcDestroyRootCertChain(RootCertChain_contexthandle: u32) -> Result; +} +extern "C" { + pub fn sslcAddTrustedRootCA( + RootCertChain_contexthandle: u32, + cert: *const u8, + certsize: u32, + cert_contexthandle: *mut u32, + ) -> Result; +} +extern "C" { + pub fn sslcRootCertChainAddDefaultCert( + RootCertChain_contexthandle: u32, + certID: SSLC_DefaultRootCert, + cert_contexthandle: *mut u32, + ) -> Result; +} +extern "C" { + pub fn sslcRootCertChainRemoveCert( + RootCertChain_contexthandle: u32, + cert_contexthandle: u32, + ) -> Result; +} +extern "C" { + pub fn sslcCreate8CertChain(CertChain_contexthandle: *mut u32) -> Result; +} +extern "C" { + pub fn sslcDestroy8CertChain(CertChain_contexthandle: u32) -> Result; +} +extern "C" { + pub fn sslc8CertChainAddCert( + CertChain_contexthandle: u32, + cert: *const u8, + certsize: u32, + cert_contexthandle: *mut u32, + ) -> Result; +} +extern "C" { + pub fn sslc8CertChainAddDefaultCert( + CertChain_contexthandle: u32, + certID: u8, + cert_contexthandle: *mut u32, + ) -> Result; +} +extern "C" { + pub fn sslc8CertChainRemoveCert( + CertChain_contexthandle: u32, + cert_contexthandle: u32, + ) -> Result; +} +extern "C" { + pub fn sslcOpenClientCertContext( + cert: *const u8, + certsize: u32, + key: *const u8, + keysize: u32, + ClientCert_contexthandle: *mut u32, + ) -> Result; +} +extern "C" { + pub fn sslcOpenDefaultClientCertContext( + certID: SSLC_DefaultClientCert, + ClientCert_contexthandle: *mut u32, + ) -> Result; +} +extern "C" { + pub fn sslcCloseClientCertContext(ClientCert_contexthandle: u32) -> Result; +} +extern "C" { + pub fn sslcSeedRNG() -> Result; +} +extern "C" { + pub fn sslcGenerateRandomData(buf: *mut u8, size: u32) -> Result; +} +extern "C" { + pub fn sslcCreateContext( + context: *mut sslcContext, + sockfd: ::libc::c_int, + input_opt: u32, + hostname: *const ::libc::c_char, + ) -> Result; +} +extern "C" { + pub fn sslcDestroyContext(context: *mut sslcContext) -> Result; +} +extern "C" { + pub fn sslcStartConnection( + context: *mut sslcContext, + internal_retval: *mut ::libc::c_int, + out: *mut u32, + ) -> Result; +} +extern "C" { + pub fn sslcRead( + context: *mut sslcContext, + buf: *mut ::libc::c_void, + len: usize, + peek: bool, + ) -> Result; +} +extern "C" { + pub fn sslcWrite(context: *mut sslcContext, buf: *const ::libc::c_void, len: usize) -> Result; +} +extern "C" { + pub fn sslcContextSetRootCertChain(context: *mut sslcContext, handle: u32) -> Result; +} +extern "C" { + pub fn sslcContextSetClientCert(context: *mut sslcContext, handle: u32) -> Result; +} +extern "C" { + pub fn sslcContextSetHandle8(context: *mut sslcContext, handle: u32) -> Result; +} +extern "C" { + pub fn sslcContextClearOpt(context: *mut sslcContext, bitmask: u32) -> Result; +} +extern "C" { + pub fn sslcContextGetProtocolCipher( + context: *mut sslcContext, + outprotocols: *mut ::libc::c_char, + outprotocols_maxsize: u32, + outcipher: *mut ::libc::c_char, + outcipher_maxsize: u32, + ) -> Result; +} +extern "C" { + pub fn sslcContextGetState(context: *mut sslcContext, out: *mut u32) -> Result; +} +extern "C" { + pub fn sslcContextInitSharedmem(context: *mut sslcContext, buf: *mut u8, size: u32) -> Result; +} +extern "C" { + pub fn sslcAddCert(context: *mut sslcContext, buf: *const u8, size: u32) -> Result; +} +#[repr(C)] +pub struct httpcContext { + pub servhandle: Handle, + pub httphandle: u32, +} +pub const HTTPC_METHOD_GET: HTTPC_RequestMethod = 1; +pub const HTTPC_METHOD_POST: HTTPC_RequestMethod = 2; +pub const HTTPC_METHOD_HEAD: HTTPC_RequestMethod = 3; +pub const HTTPC_METHOD_PUT: HTTPC_RequestMethod = 4; +pub const HTTPC_METHOD_DELETE: HTTPC_RequestMethod = 5; +pub type HTTPC_RequestMethod = u32; +pub const HTTPC_STATUS_REQUEST_IN_PROGRESS: HTTPC_RequestStatus = 5; +pub const HTTPC_STATUS_DOWNLOAD_READY: HTTPC_RequestStatus = 7; +pub type HTTPC_RequestStatus = u32; +pub const HTTPC_KEEPALIVE_DISABLED: HTTPC_KeepAlive = 0; +pub const HTTPC_KEEPALIVE_ENABLED: HTTPC_KeepAlive = 1; +pub type HTTPC_KeepAlive = u32; +extern "C" { + pub fn httpcInit(sharedmem_size: u32) -> Result; +} +extern "C" { + pub fn httpcExit(); +} +extern "C" { + pub fn httpcOpenContext( + context: *mut httpcContext, + method: HTTPC_RequestMethod, + url: *const ::libc::c_char, + use_defaultproxy: u32, + ) -> Result; +} +extern "C" { + pub fn httpcCloseContext(context: *mut httpcContext) -> Result; +} +extern "C" { + pub fn httpcCancelConnection(context: *mut httpcContext) -> Result; +} +extern "C" { + pub fn httpcAddRequestHeaderField( + context: *mut httpcContext, + name: *const ::libc::c_char, + value: *const ::libc::c_char, + ) -> Result; +} +extern "C" { + pub fn httpcAddPostDataAscii( + context: *mut httpcContext, + name: *const ::libc::c_char, + value: *const ::libc::c_char, + ) -> Result; +} +extern "C" { + pub fn httpcAddPostDataBinary( + context: *mut httpcContext, + name: *const ::libc::c_char, + value: *const u8, + len: u32, + ) -> Result; +} +extern "C" { + pub fn httpcAddPostDataRaw(context: *mut httpcContext, data: *const u32, len: u32) -> Result; +} +extern "C" { + pub fn httpcBeginRequest(context: *mut httpcContext) -> Result; +} +extern "C" { + pub fn httpcReceiveData(context: *mut httpcContext, buffer: *mut u8, size: u32) -> Result; +} +extern "C" { + pub fn httpcReceiveDataTimeout( + context: *mut httpcContext, + buffer: *mut u8, + size: u32, + timeout: u64, + ) -> Result; +} +extern "C" { + pub fn httpcGetRequestState( + context: *mut httpcContext, + out: *mut HTTPC_RequestStatus, + ) -> Result; +} +extern "C" { + pub fn httpcGetDownloadSizeState( + context: *mut httpcContext, + downloadedsize: *mut u32, + contentsize: *mut u32, + ) -> Result; +} +extern "C" { + pub fn httpcGetResponseStatusCode(context: *mut httpcContext, out: *mut u32) -> Result; +} +extern "C" { + pub fn httpcGetResponseStatusCodeTimeout( + context: *mut httpcContext, + out: *mut u32, + timeout: u64, + ) -> Result; +} +extern "C" { + pub fn httpcGetResponseHeader( + context: *mut httpcContext, + name: *const ::libc::c_char, + value: *mut ::libc::c_char, + valuebuf_maxsize: u32, + ) -> Result; +} +extern "C" { + pub fn httpcAddTrustedRootCA( + context: *mut httpcContext, + cert: *const u8, + certsize: u32, + ) -> Result; +} +extern "C" { + pub fn httpcAddDefaultCert(context: *mut httpcContext, certID: SSLC_DefaultRootCert) -> Result; +} +extern "C" { + pub fn httpcSelectRootCertChain( + context: *mut httpcContext, + RootCertChain_contexthandle: u32, + ) -> Result; +} +extern "C" { + pub fn httpcSetClientCert( + context: *mut httpcContext, + cert: *const u8, + certsize: u32, + privk: *const u8, + privk_size: u32, + ) -> Result; +} +extern "C" { + pub fn httpcSetClientCertDefault( + context: *mut httpcContext, + certID: SSLC_DefaultClientCert, + ) -> Result; +} +extern "C" { + pub fn httpcSetClientCertContext( + context: *mut httpcContext, + ClientCert_contexthandle: u32, + ) -> Result; +} +extern "C" { + pub fn httpcSetSSLOpt(context: *mut httpcContext, options: u32) -> Result; +} +extern "C" { + pub fn httpcSetSSLClearOpt(context: *mut httpcContext, options: u32) -> Result; +} +extern "C" { + pub fn httpcCreateRootCertChain(RootCertChain_contexthandle: *mut u32) -> Result; +} +extern "C" { + pub fn httpcDestroyRootCertChain(RootCertChain_contexthandle: u32) -> Result; +} +extern "C" { + pub fn httpcRootCertChainAddCert( + RootCertChain_contexthandle: u32, + cert: *const u8, + certsize: u32, + cert_contexthandle: *mut u32, + ) -> Result; +} +extern "C" { + pub fn httpcRootCertChainAddDefaultCert( + RootCertChain_contexthandle: u32, + certID: SSLC_DefaultRootCert, + cert_contexthandle: *mut u32, + ) -> Result; +} +extern "C" { + pub fn httpcRootCertChainRemoveCert( + RootCertChain_contexthandle: u32, + cert_contexthandle: u32, + ) -> Result; +} +extern "C" { + pub fn httpcOpenClientCertContext( + cert: *const u8, + certsize: u32, + privk: *const u8, + privk_size: u32, + ClientCert_contexthandle: *mut u32, + ) -> Result; +} +extern "C" { + pub fn httpcOpenDefaultClientCertContext( + certID: SSLC_DefaultClientCert, + ClientCert_contexthandle: *mut u32, + ) -> Result; +} +extern "C" { + pub fn httpcCloseClientCertContext(ClientCert_contexthandle: u32) -> Result; +} +extern "C" { + pub fn httpcDownloadData( + context: *mut httpcContext, + buffer: *mut u8, + size: u32, + downloadedsize: *mut u32, + ) -> Result; +} +extern "C" { + pub fn httpcSetKeepAlive(context: *mut httpcContext, option: HTTPC_KeepAlive) -> Result; +} +#[repr(C)] +pub struct udsNodeInfo { + pub uds_friendcodeseed: u64, + pub __bindgen_anon_1: udsNodeInfo__bindgen_ty_1, + pub NetworkNodeID: u16, + pub pad_x22: u16, + pub word_x24: u32, +} +#[repr(C)] +pub struct udsNodeInfo__bindgen_ty_1 { + pub usercfg: __BindgenUnionField<[u8; 24usize]>, + pub __bindgen_anon_1: __BindgenUnionField, + pub bindgen_union_field: [u16; 12usize], +} +#[repr(C)] +pub struct udsNodeInfo__bindgen_ty_1__bindgen_ty_1 { + pub username: [u16; 10usize], + pub unk_x1c: u16, + pub flag: u8, + pub pad_x1f: u8, +} +#[repr(C)] +pub struct udsConnectionStatus { + pub status: u32, + pub unk_x4: u32, + pub cur_NetworkNodeID: u16, + pub unk_xa: u16, + pub unk_xc: [u32; 8usize], + pub total_nodes: u8, + pub max_nodes: u8, + pub node_bitmask: u16, +} +#[repr(C)] +pub struct udsNetworkStruct { + pub host_macaddress: [u8; 6usize], + pub channel: u8, + pub pad_x7: u8, + pub initialized_flag: u8, + pub unk_x9: [u8; 3usize], + pub oui_value: [u8; 3usize], + pub oui_type: u8, + pub wlancommID: u32, + pub id8: u8, + pub unk_x15: u8, + pub attributes: u16, + pub networkID: u32, + pub total_nodes: u8, + pub max_nodes: u8, + pub unk_x1e: u8, + pub unk_x1f: u8, + pub unk_x20: [u8; 31usize], + pub appdata_size: u8, + pub appdata: [u8; 200usize], +} +#[repr(C)] +pub struct udsBindContext { + pub BindNodeID: u32, + pub event: Handle, + pub spectator: bool, +} +#[repr(C)] +pub struct nwmScanInputStruct { + pub unk_x0: u16, + pub unk_x2: u16, + pub unk_x4: u16, + pub unk_x6: u16, + pub mac_address: [u8; 6usize], + pub unk_xe: [u8; 38usize], +} +#[repr(C)] +pub struct nwmBeaconDataReplyHeader { + pub maxsize: u32, + pub size: u32, + pub total_entries: u32, +} +#[repr(C)] +pub struct nwmBeaconDataReplyEntry { + pub size: u32, + pub unk_x4: u8, + pub channel: u8, + pub unk_x6: u8, + pub unk_x7: u8, + pub mac_address: [u8; 6usize], + pub unk_xe: [u8; 6usize], + pub unk_x14: u32, + pub val_x1c: u32, +} +#[repr(C)] +#[repr(align(8))] +pub struct udsNetworkScanInfo { + pub datareply_entry: nwmBeaconDataReplyEntry, + pub network: udsNetworkStruct, + pub __bindgen_padding_0: u32, + pub nodes: [udsNodeInfo; 16usize], +} +pub const UDSNETATTR_DisableConnectSpectators: _bindgen_ty_22 = 1; +pub const UDSNETATTR_DisableConnectClients: _bindgen_ty_22 = 2; +pub const UDSNETATTR_x4: _bindgen_ty_22 = 4; +pub const UDSNETATTR_Default: _bindgen_ty_22 = 32768; +pub type _bindgen_ty_22 = u32; +pub const UDS_SENDFLAG_Default: _bindgen_ty_23 = 1; +pub const UDS_SENDFLAG_Broadcast: _bindgen_ty_23 = 2; +pub type _bindgen_ty_23 = u32; +pub const UDSCONTYPE_Client: udsConnectionType = 1; +pub const UDSCONTYPE_Spectator: udsConnectionType = 2; +pub type udsConnectionType = u32; +extern "C" { + pub fn udsInit(sharedmem_size: usize, username: *const ::libc::c_char) -> Result; +} +extern "C" { + pub fn udsExit(); +} +extern "C" { + pub fn udsGenerateNodeInfo( + nodeinfo: *mut udsNodeInfo, + username: *const ::libc::c_char, + ) -> Result; +} +extern "C" { + pub fn udsGetNodeInfoUsername( + nodeinfo: *const udsNodeInfo, + username: *mut ::libc::c_char, + ) -> Result; +} +extern "C" { + pub fn udsCheckNodeInfoInitialized(nodeinfo: *const udsNodeInfo) -> bool; +} +extern "C" { + pub fn udsGenerateDefaultNetworkStruct( + network: *mut udsNetworkStruct, + wlancommID: u32, + id8: u8, + max_nodes: u8, + ); +} +extern "C" { + pub fn udsScanBeacons( + outbuf: *mut ::libc::c_void, + maxsize: usize, + networks: *mut *mut udsNetworkScanInfo, + total_networks: *mut usize, + wlancommID: u32, + id8: u8, + host_macaddress: *const u8, + connected: bool, + ) -> Result; +} +extern "C" { + pub fn udsSetApplicationData(buf: *const ::libc::c_void, size: usize) -> Result; +} +extern "C" { + pub fn udsGetApplicationData( + buf: *mut ::libc::c_void, + size: usize, + actual_size: *mut usize, + ) -> Result; +} +extern "C" { + pub fn udsGetNetworkStructApplicationData( + network: *const udsNetworkStruct, + buf: *mut ::libc::c_void, + size: usize, + actual_size: *mut usize, + ) -> Result; +} +extern "C" { + pub fn udsBind( + bindcontext: *mut udsBindContext, + NetworkNodeID: u16, + spectator: bool, + data_channel: u8, + recv_buffer_size: u32, + ) -> Result; +} +extern "C" { + pub fn udsUnbind(bindcontext: *mut udsBindContext) -> Result; +} +extern "C" { + pub fn udsWaitDataAvailable( + bindcontext: *const udsBindContext, + nextEvent: bool, + wait: bool, + ) -> bool; +} +extern "C" { + pub fn udsPullPacket( + bindcontext: *const udsBindContext, + buf: *mut ::libc::c_void, + size: usize, + actual_size: *mut usize, + src_NetworkNodeID: *mut u16, + ) -> Result; +} +extern "C" { + pub fn udsSendTo( + dst_NetworkNodeID: u16, + data_channel: u8, + flags: u8, + buf: *const ::libc::c_void, + size: usize, + ) -> Result; +} +extern "C" { + pub fn udsGetChannel(channel: *mut u8) -> Result; +} +extern "C" { + pub fn udsCreateNetwork( + network: *const udsNetworkStruct, + passphrase: *const ::libc::c_void, + passphrase_size: usize, + context: *mut udsBindContext, + data_channel: u8, + recv_buffer_size: u32, + ) -> Result; +} +extern "C" { + pub fn udsConnectNetwork( + network: *const udsNetworkStruct, + passphrase: *const ::libc::c_void, + passphrase_size: usize, + context: *mut udsBindContext, + recv_NetworkNodeID: u16, + connection_type: udsConnectionType, + data_channel: u8, + recv_buffer_size: u32, + ) -> Result; +} +extern "C" { + pub fn udsDestroyNetwork() -> Result; +} +extern "C" { + pub fn udsDisconnectNetwork() -> Result; +} +extern "C" { + pub fn udsEjectClient(NetworkNodeID: u16) -> Result; +} +extern "C" { + pub fn udsEjectSpectator() -> Result; +} +extern "C" { + pub fn udsUpdateNetworkAttribute(bitmask: u16, flag: bool) -> Result; +} +extern "C" { + pub fn udsSetNewConnectionsBlocked(block: bool, clients: bool, flag: bool) -> Result; +} +extern "C" { + pub fn udsAllowSpectators() -> Result; +} +extern "C" { + pub fn udsGetConnectionStatus(output: *mut udsConnectionStatus) -> Result; +} +extern "C" { + pub fn udsWaitConnectionStatusEvent(nextEvent: bool, wait: bool) -> bool; +} +extern "C" { + pub fn udsGetNodeInformation(NetworkNodeID: u16, output: *mut udsNodeInfo) -> Result; +} +pub const EXCLUSIVE_STATE_NONE: ndmExclusiveState = 0; +pub const EXCLUSIVE_STATE_INFRASTRUCTURE: ndmExclusiveState = 1; +pub const EXCLUSIVE_STATE_LOCAL_COMMUNICATIONS: ndmExclusiveState = 2; +pub const EXCLUSIVE_STATE_STREETPASS: ndmExclusiveState = 3; +pub const EXCLUSIVE_STATE_STREETPASS_DATA: ndmExclusiveState = 4; +pub type ndmExclusiveState = u32; +pub const STATE_INITIAL: ndmState = 0; +pub const STATE_SUSPENDED: ndmState = 1; +pub const STATE_INFRASTRUCTURE_CONNECTING: ndmState = 2; +pub const STATE_INFRASTRUCTURE_CONNECTED: ndmState = 3; +pub const STATE_INFRASTRUCTURE_WORKING: ndmState = 4; +pub const STATE_INFRASTRUCTURE_SUSPENDING: ndmState = 5; +pub const STATE_INFRASTRUCTURE_FORCE_SUSPENDING: ndmState = 6; +pub const STATE_INFRASTRUCTURE_DISCONNECTING: ndmState = 7; +pub const STATE_INFRASTRUCTURE_FORCE_DISCONNECTING: ndmState = 8; +pub const STATE_CEC_WORKING: ndmState = 9; +pub const STATE_CEC_FORCE_SUSPENDING: ndmState = 10; +pub const STATE_CEC_SUSPENDING: ndmState = 11; +pub type ndmState = u32; +pub const DAEMON_CEC: ndmDaemon = 0; +pub const DAEMON_BOSS: ndmDaemon = 1; +pub const DAEMON_NIM: ndmDaemon = 2; +pub const DAEMON_FRIENDS: ndmDaemon = 3; +pub type ndmDaemon = u32; +pub const DAEMON_MASK_CEC: ndmDaemonMask = 1; +pub const DAEMON_MASK_BOSS: ndmDaemonMask = 2; +pub const DAEMON_MASK_NIM: ndmDaemonMask = 4; +pub const DAEMON_MASK_FRIENDS: ndmDaemonMask = 8; +pub const DAEMON_MASK_BACKGROUOND: ndmDaemonMask = 7; +pub const DAEMON_MASK_ALL: ndmDaemonMask = 15; +pub const DAEMON_MASK_DEFAULT: ndmDaemonMask = 9; +pub type ndmDaemonMask = u32; +pub const DAEMON_STATUS_BUSY: ndmDaemonStatus = 0; +pub const DAEMON_STATUS_IDLE: ndmDaemonStatus = 1; +pub const DAEMON_STATUS_SUSPENDING: ndmDaemonStatus = 2; +pub const DAEMON_STATUS_SUSPENDED: ndmDaemonStatus = 3; +pub type ndmDaemonStatus = u32; +extern "C" { + pub fn ndmuInit() -> Result; +} +extern "C" { + pub fn ndmuExit(); +} +extern "C" { + pub fn NDMU_EnterExclusiveState(state: ndmExclusiveState) -> Result; +} +extern "C" { + pub fn NDMU_LeaveExclusiveState() -> Result; +} +extern "C" { + pub fn NDMU_GetExclusiveState(state: *mut ndmExclusiveState) -> Result; +} +extern "C" { + pub fn NDMU_LockState() -> Result; +} +extern "C" { + pub fn NDMU_UnlockState() -> Result; +} +extern "C" { + pub fn NDMU_SuspendDaemons(mask: ndmDaemonMask) -> Result; +} +extern "C" { + pub fn NDMU_ResumeDaemons(mask: ndmDaemonMask) -> Result; +} +extern "C" { + pub fn NDMU_SuspendScheduler(flag: u32) -> Result; +} +extern "C" { + pub fn NDMU_ResumeScheduler() -> Result; +} +extern "C" { + pub fn NDMU_GetCurrentState(state: *mut ndmState) -> Result; +} +extern "C" { + pub fn NDMU_QueryStatus(status: *mut ndmDaemonStatus) -> Result; +} +extern "C" { + pub fn NDMU_SetScanInterval(interval: u32) -> Result; +} +extern "C" { + pub fn NDMU_GetScanInterval(interval: *mut u32) -> Result; +} +extern "C" { + pub fn NDMU_GetRetryInterval(interval: *mut u32) -> Result; +} +extern "C" { + pub fn NDMU_ResetDaemons() -> Result; +} +extern "C" { + pub fn NDMU_GetDefaultDaemons(mask: *mut ndmDaemonMask) -> Result; +} +extern "C" { + pub fn NDMU_ClearMacFilter() -> Result; +} +pub const IM_DEFAULT: NIM_InstallationMode = 0; +pub const IM_UNKNOWN1: NIM_InstallationMode = 1; +pub const IM_UNKNOWN2: NIM_InstallationMode = 2; +pub const IM_REINSTALL: NIM_InstallationMode = 3; +pub type NIM_InstallationMode = u32; +pub const DS_NOT_INITIALIZED: NIM_DownloadState = 0; +pub const DS_INITIALIZED: NIM_DownloadState = 1; +pub const DS_DOWNLOAD_TMD: NIM_DownloadState = 2; +pub const DS_PREPARE_SAVE_DATA: NIM_DownloadState = 3; +pub const DS_DOWNLOAD_CONTENTS: NIM_DownloadState = 4; +pub const DS_WAIT_COMMIT: NIM_DownloadState = 5; +pub const DS_COMMITTING: NIM_DownloadState = 6; +pub const DS_FINISHED: NIM_DownloadState = 7; +pub const DS_VERSION_ERROR: NIM_DownloadState = 8; +pub const DS_CREATE_CONTEXT: NIM_DownloadState = 9; +pub const DS_CANNOT_RECOVER: NIM_DownloadState = 10; +pub const DS_INVALID: NIM_DownloadState = 11; +pub type NIM_DownloadState = u32; +#[repr(C)] +pub struct NIM_TitleConfig { + pub titleId: u64, + pub version: u32, + pub unknown_0: u32, + pub ratingAge: u8, + pub mediaType: u8, + pub padding: [u8; 2usize], + pub unknown_1: u32, +} +#[repr(C)] +pub struct NIM_TitleProgress { + pub state: u32, + pub lastResult: Result, + pub downloadedSize: u64, + pub totalSize: u64, +} +extern "C" { + pub fn nimsInit(buffer: *mut ::libc::c_void, buffer_len: usize) -> Result; +} +extern "C" { + pub fn nimsInitWithTIN( + buffer: *mut ::libc::c_void, + buffer_len: usize, + TIN: *const ::libc::c_char, + ) -> Result; +} +extern "C" { + pub fn nimsExit(); +} +extern "C" { + pub fn nimsGetSessionHandle() -> *mut Handle; +} +extern "C" { + pub fn NIMS_SetAttribute(attr: *const ::libc::c_char, val: *const ::libc::c_char) -> Result; +} +extern "C" { + pub fn NIMS_WantUpdate(want_update: *mut bool) -> Result; +} +extern "C" { + pub fn NIMS_MakeTitleConfig( + cfg: *mut NIM_TitleConfig, + titleId: u64, + version: u32, + ratingAge: u8, + mediaType: FS_MediaType, + ); +} +extern "C" { + pub fn NIMS_RegisterTask( + cfg: *const NIM_TitleConfig, + name: *const ::libc::c_char, + maker: *const ::libc::c_char, + ) -> Result; +} +extern "C" { + pub fn NIMS_IsTaskRegistered(titleId: u64, registered: *mut bool) -> Result; +} +extern "C" { + pub fn NIMS_UnregisterTask(titleId: u64) -> Result; +} +extern "C" { + pub fn NIMS_StartDownload(cfg: *const NIM_TitleConfig, mode: NIM_InstallationMode) -> Result; +} +extern "C" { + pub fn NIMS_StartDownloadSimple(cfg: *const NIM_TitleConfig) -> Result; +} +extern "C" { + pub fn NIMS_GetProgress(tp: *mut NIM_TitleProgress) -> Result; +} +extern "C" { + pub fn NIMS_CancelDownload() -> Result; +} +extern "C" { + pub fn nwmExtInit() -> Result; +} +extern "C" { + pub fn nwmExtExit(); +} +extern "C" { + pub fn NWMEXT_ControlWirelessEnabled(enableWifi: bool) -> Result; +} +extern "C" { + pub fn iruInit(sharedmem_addr: *mut u32, sharedmem_size: u32) -> Result; +} +extern "C" { + pub fn iruExit(); +} +extern "C" { + pub fn iruGetServHandle() -> Handle; +} +extern "C" { + pub fn iruSendData(buf: *mut u8, size: u32, wait: bool) -> Result; +} +extern "C" { + pub fn iruRecvData( + buf: *mut u8, + size: u32, + flag: u8, + transfercount: *mut u32, + wait: bool, + ) -> Result; +} +extern "C" { + pub fn IRU_Initialize() -> Result; +} +extern "C" { + pub fn IRU_Shutdown() -> Result; +} +extern "C" { + pub fn IRU_StartSendTransfer(buf: *mut u8, size: u32) -> Result; +} +extern "C" { + pub fn IRU_WaitSendTransfer() -> Result; +} +extern "C" { + pub fn IRU_StartRecvTransfer(size: u32, flag: u8) -> Result; +} +extern "C" { + pub fn IRU_WaitRecvTransfer(transfercount: *mut u32) -> Result; +} +extern "C" { + pub fn IRU_SetBitRate(value: u8) -> Result; +} +extern "C" { + pub fn IRU_GetBitRate(out: *mut u8) -> Result; +} +extern "C" { + pub fn IRU_SetIRLEDState(value: u32) -> Result; +} +extern "C" { + pub fn IRU_GetIRLEDRecvState(out: *mut u32) -> Result; +} +extern "C" { + pub fn nsInit() -> Result; +} +extern "C" { + pub fn nsExit(); +} +extern "C" { + pub fn NS_LaunchFIRM(titleid: u64) -> Result; +} +extern "C" { + pub fn NS_LaunchTitle(titleid: u64, launch_flags: u32, procid: *mut u32) -> Result; +} +extern "C" { + pub fn NS_TerminateTitle() -> Result; +} +extern "C" { + pub fn NS_LaunchApplicationFIRM(titleid: u64, flags: u32) -> Result; +} +extern "C" { + pub fn NS_RebootToTitle(mediatype: u8, titleid: u64) -> Result; +} +extern "C" { + pub fn NS_TerminateProcessTID(titleid: u64, timeout: u64) -> Result; +} +extern "C" { + pub fn NS_RebootSystem() -> Result; +} +extern "C" { + pub fn pmInit() -> Result; +} +extern "C" { + pub fn pmExit(); +} +extern "C" { + pub fn PM_LaunchTitle(mediatype: u8, titleid: u64, launch_flags: u32) -> Result; +} +extern "C" { + pub fn PM_GetTitleExheaderFlags(mediatype: u8, titleid: u64, out: *mut u8) -> Result; +} +extern "C" { + pub fn PM_SetFIRMLaunchParams(size: u32, in_: *mut u8) -> Result; +} +extern "C" { + pub fn PM_GetFIRMLaunchParams(size: u32, out: *mut u8) -> Result; +} +extern "C" { + pub fn PM_LaunchFIRMSetParams(firm_titleid_low: u32, size: u32, in_: *mut u8) -> Result; +} +extern "C" { + pub fn PM_TerminateCurrentApplication(timeout: u64) -> Result; +} +extern "C" { + pub fn PM_TerminateProcess(pid: u8, timeout: u64) -> Result; +} +extern "C" { + pub fn PM_UnregisterProcess(tid: u64) -> Result; +} +pub const PS_ALGORITHM_CBC_ENC: PS_AESAlgorithm = 0; +pub const PS_ALGORITHM_CBC_DEC: PS_AESAlgorithm = 1; +pub const PS_ALGORITHM_CTR_ENC: PS_AESAlgorithm = 2; +pub const PS_ALGORITHM_CTR_DEC: PS_AESAlgorithm = 3; +pub const PS_ALGORITHM_CCM_ENC: PS_AESAlgorithm = 4; +pub const PS_ALGORITHM_CCM_DEC: PS_AESAlgorithm = 5; +pub type PS_AESAlgorithm = u32; +pub const PS_KEYSLOT_0D: PS_AESKeyType = 0; +pub const PS_KEYSLOT_2D: PS_AESKeyType = 1; +pub const PS_KEYSLOT_31: PS_AESKeyType = 2; +pub const PS_KEYSLOT_38: PS_AESKeyType = 3; +pub const PS_KEYSLOT_32: PS_AESKeyType = 4; +pub const PS_KEYSLOT_39_DLP: PS_AESKeyType = 5; +pub const PS_KEYSLOT_2E: PS_AESKeyType = 6; +pub const PS_KEYSLOT_INVALID: PS_AESKeyType = 7; +pub const PS_KEYSLOT_36: PS_AESKeyType = 8; +pub const PS_KEYSLOT_39_NFC: PS_AESKeyType = 9; +pub type PS_AESKeyType = u32; +#[repr(C)] +pub struct psRSAContext { + pub modulo: [u8; 256usize], + pub exponent: [u8; 256usize], + pub rsa_bitsize: u32, + pub unk: u32, +} +extern "C" { + pub fn psInit() -> Result; +} +extern "C" { + pub fn psInitHandle(handle: Handle) -> Result; +} +extern "C" { + pub fn psExit(); +} +extern "C" { + pub fn psGetSessionHandle() -> Handle; +} +extern "C" { + pub fn PS_SignRsaSha256(hash: *mut u8, ctx: *mut psRSAContext, signature: *mut u8) -> Result; +} +extern "C" { + pub fn PS_VerifyRsaSha256(hash: *mut u8, ctx: *mut psRSAContext, signature: *mut u8) -> Result; +} +extern "C" { + pub fn PS_EncryptDecryptAes( + size: u32, + in_: *mut u8, + out: *mut u8, + aes_algo: PS_AESAlgorithm, + key_type: PS_AESKeyType, + iv: *mut u8, + ) -> Result; +} +extern "C" { + pub fn PS_EncryptSignDecryptVerifyAesCcm( + in_: *mut u8, + in_size: u32, + out: *mut u8, + out_size: u32, + data_len: u32, + mac_data_len: u32, + mac_len: u32, + aes_algo: PS_AESAlgorithm, + key_type: PS_AESKeyType, + nonce: *mut u8, + ) -> Result; +} +extern "C" { + pub fn PS_GetLocalFriendCodeSeed(seed: *mut u64) -> Result; +} +extern "C" { + pub fn PS_GetDeviceId(device_id: *mut u32) -> Result; +} +extern "C" { + pub fn PS_GenerateRandomBytes(out: *mut ::libc::c_void, len: usize) -> Result; +} +extern "C" { + pub fn ptmuInit() -> Result; +} +extern "C" { + pub fn ptmuExit(); +} +extern "C" { + pub fn PTMU_GetShellState(out: *mut u8) -> Result; +} +extern "C" { + pub fn PTMU_GetBatteryLevel(out: *mut u8) -> Result; +} +extern "C" { + pub fn PTMU_GetBatteryChargeState(out: *mut u8) -> Result; +} +extern "C" { + pub fn PTMU_GetPedometerState(out: *mut u8) -> Result; +} +extern "C" { + pub fn PTMU_GetTotalStepCount(steps: *mut u32) -> Result; +} +extern "C" { + pub fn PTMU_GetAdapterState(out: *mut bool) -> Result; +} +extern "C" { + pub fn ptmSysmInit() -> Result; +} +extern "C" { + pub fn ptmSysmExit(); +} +extern "C" { + pub fn PTMSYSM_CheckNew3DS() -> Result; +} +extern "C" { + pub fn PTMSYSM_ConfigureNew3DSCPU(value: u8) -> Result; +} +extern "C" { + pub fn PTMSYSM_ShutdownAsync(timeout: u64) -> Result; +} +extern "C" { + pub fn PTMSYSM_RebootAsync(timeout: u64) -> Result; +} +pub const WAIT_NONE: PXIDEV_WaitType = 0; +pub const WAIT_SLEEP: PXIDEV_WaitType = 1; +pub const WAIT_IREQ_RETURN: PXIDEV_WaitType = 2; +pub const WAIT_IREQ_CONTINUE: PXIDEV_WaitType = 3; +pub type PXIDEV_WaitType = u32; +pub const DEASSERT_NONE: PXIDEV_DeassertType = 0; +pub const DEASSERT_BEFORE_WAIT: PXIDEV_DeassertType = 1; +pub const DEASSERT_AFTER_WAIT: PXIDEV_DeassertType = 2; +pub type PXIDEV_DeassertType = u32; +#[repr(C)] +pub struct PXIDEV_SPIBuffer { + pub ptr: *mut ::libc::c_void, + pub size: u32, + pub transferOption: u8, + pub __bindgen_padding_0: u32, + pub waitOperation: u64, +} +extern "C" { + pub fn pxiDevInit() -> Result; +} +extern "C" { + pub fn pxiDevExit(); +} +extern "C" { + pub fn PXIDEV_SPIMultiWriteRead( + header: *mut PXIDEV_SPIBuffer, + writeBuffer1: *mut PXIDEV_SPIBuffer, + readBuffer1: *mut PXIDEV_SPIBuffer, + writeBuffer2: *mut PXIDEV_SPIBuffer, + readBuffer2: *mut PXIDEV_SPIBuffer, + footer: *mut PXIDEV_SPIBuffer, + ) -> Result; +} +extern "C" { + pub fn PXIDEV_SPIWriteRead( + bytesRead: *mut u32, + initialWaitOperation: u64, + writeBuffer: *mut PXIDEV_SPIBuffer, + readBuffer: *mut PXIDEV_SPIBuffer, + ) -> Result; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct timezone { + pub tz_minuteswest: ::libc::c_int, + pub tz_dsttime: ::libc::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct bintime { + pub sec: time_t, + pub frac: u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct itimerval { + pub it_interval: timeval, + pub it_value: timeval, +} +pub type __ULong = ::libc::c_ulong; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __locale_t { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _Bigint { + pub _next: *mut _Bigint, + pub _k: ::libc::c_int, + pub _maxwds: ::libc::c_int, + pub _sign: ::libc::c_int, + pub _wds: ::libc::c_int, + pub _x: [__ULong; 1usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __tm { + pub __tm_sec: ::libc::c_int, + pub __tm_min: ::libc::c_int, + pub __tm_hour: ::libc::c_int, + pub __tm_mday: ::libc::c_int, + pub __tm_mon: ::libc::c_int, + pub __tm_year: ::libc::c_int, + pub __tm_wday: ::libc::c_int, + pub __tm_yday: ::libc::c_int, + pub __tm_isdst: ::libc::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _on_exit_args { + pub _fnargs: [*mut ::libc::c_void; 32usize], + pub _dso_handle: [*mut ::libc::c_void; 32usize], + pub _fntypes: __ULong, + pub _is_cxa: __ULong, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _atexit { + pub _next: *mut _atexit, + pub _ind: ::libc::c_int, + pub _fns: [::core::option::Option; 32usize], + pub _on_exit_args: _on_exit_args, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __sbuf { + pub _base: *mut ::libc::c_uchar, + pub _size: ::libc::c_int, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct __sFILE { + pub _p: *mut ::libc::c_uchar, + pub _r: ::libc::c_int, + pub _w: ::libc::c_int, + pub _flags: ::libc::c_short, + pub _file: ::libc::c_short, + pub _bf: __sbuf, + pub _lbfsize: ::libc::c_int, + pub _cookie: *mut ::libc::c_void, + pub _read: ::core::option::Option< + unsafe extern "C" fn( + arg1: *mut _reent, + arg2: *mut ::libc::c_void, + arg3: *mut ::libc::c_char, + arg4: ::libc::c_int, + ) -> ::libc::c_int, + >, + pub _write: ::core::option::Option< + unsafe extern "C" fn( + arg1: *mut _reent, + arg2: *mut ::libc::c_void, + arg3: *const ::libc::c_char, + arg4: ::libc::c_int, + ) -> ::libc::c_int, + >, + pub _seek: ::core::option::Option< + unsafe extern "C" fn( + arg1: *mut _reent, + arg2: *mut ::libc::c_void, + arg3: _fpos_t, + arg4: ::libc::c_int, + ) -> _fpos_t, + >, + pub _close: ::core::option::Option< + unsafe extern "C" fn(arg1: *mut _reent, arg2: *mut ::libc::c_void) -> ::libc::c_int, + >, + pub _ub: __sbuf, + pub _up: *mut ::libc::c_uchar, + pub _ur: ::libc::c_int, + pub _ubuf: [::libc::c_uchar; 3usize], + pub _nbuf: [::libc::c_uchar; 1usize], + pub _lb: __sbuf, + pub _blksize: ::libc::c_int, + pub _offset: _off_t, + pub _data: *mut _reent, + pub _lock: _flock_t, + pub _mbstate: _mbstate_t, + pub _flags2: ::libc::c_int, + pub __bindgen_padding_0: u32, +} +pub type __FILE = __sFILE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _glue { + pub _next: *mut _glue, + pub _niobs: ::libc::c_int, + pub _iobs: *mut __FILE, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _rand48 { + pub _seed: [::libc::c_ushort; 3usize], + pub _mult: [::libc::c_ushort; 3usize], + pub _add: ::libc::c_ushort, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _reent { + pub _errno: ::libc::c_int, + pub _stdin: *mut __FILE, + pub _stdout: *mut __FILE, + pub _stderr: *mut __FILE, + pub _inc: ::libc::c_int, + pub _emergency: [::libc::c_char; 25usize], + pub _unspecified_locale_info: ::libc::c_int, + pub _locale: *mut __locale_t, + pub __sdidinit: ::libc::c_int, + pub __cleanup: ::core::option::Option, + pub _result: *mut _Bigint, + pub _result_k: ::libc::c_int, + pub _p5s: *mut _Bigint, + pub _freelist: *mut *mut _Bigint, + pub _cvtlen: ::libc::c_int, + pub _cvtbuf: *mut ::libc::c_char, + pub _new: _reent__bindgen_ty_1, + pub _atexit: *mut _atexit, + pub _atexit0: _atexit, + pub _sig_func: *mut ::core::option::Option, + pub __sglue: _glue, + pub __bindgen_padding_0: u32, + pub __sf: [__FILE; 3usize], + pub deviceData: *mut ::libc::c_void, + pub __bindgen_padding_1: u32, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union _reent__bindgen_ty_1 { + pub _reent: _reent__bindgen_ty_1__bindgen_ty_1, + pub _unused: _reent__bindgen_ty_1__bindgen_ty_2, + _bindgen_union_align: [u64; 30usize], +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct _reent__bindgen_ty_1__bindgen_ty_1 { + pub _unused_rand: ::libc::c_uint, + pub _strtok_last: *mut ::libc::c_char, + pub _asctime_buf: [::libc::c_char; 26usize], + pub _localtime_buf: __tm, + pub _gamma_signgam: ::libc::c_int, + pub __bindgen_padding_0: u32, + pub _rand_next: ::libc::c_ulonglong, + pub _r48: _rand48, + pub _mblen_state: _mbstate_t, + pub _mbtowc_state: _mbstate_t, + pub _wctomb_state: _mbstate_t, + pub _l64a_buf: [::libc::c_char; 8usize], + pub _signal_buf: [::libc::c_char; 24usize], + pub _getdate_err: ::libc::c_int, + pub _mbrlen_state: _mbstate_t, + pub _mbrtowc_state: _mbstate_t, + pub _mbsrtowcs_state: _mbstate_t, + pub _wcrtomb_state: _mbstate_t, + pub _wcsrtombs_state: _mbstate_t, + pub _h_errno: ::libc::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _reent__bindgen_ty_1__bindgen_ty_2 { + pub _nextf: [*mut ::libc::c_uchar; 30usize], + pub _nmalloc: [::libc::c_uint; 30usize], +} +extern "C" { + pub static mut _impure_ptr: *mut _reent; +} +extern "C" { + pub static _global_impure_ptr: *mut _reent; +} +extern "C" { + pub fn _reclaim_reent(arg1: *mut _reent); +} +extern "C" { + pub fn __getreent() -> *mut _reent; +} +pub type locale_t = *mut __locale_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tm { + pub tm_sec: ::libc::c_int, + pub tm_min: ::libc::c_int, + pub tm_hour: ::libc::c_int, + pub tm_mday: ::libc::c_int, + pub tm_mon: ::libc::c_int, + pub tm_year: ::libc::c_int, + pub tm_wday: ::libc::c_int, + pub tm_yday: ::libc::c_int, + pub tm_isdst: ::libc::c_int, +} +extern "C" { + pub fn clock() -> clock_t; +} +extern "C" { + pub fn difftime(_time2: time_t, _time1: time_t) -> f64; +} +extern "C" { + pub fn mktime(_timeptr: *mut tm) -> time_t; +} +extern "C" { + pub fn time(_timer: *mut time_t) -> time_t; +} +extern "C" { + pub fn asctime(_tblock: *const tm) -> *mut ::libc::c_char; +} +extern "C" { + pub fn ctime(_time: *const time_t) -> *mut ::libc::c_char; +} +extern "C" { + pub fn gmtime(_timer: *const time_t) -> *mut tm; +} +extern "C" { + pub fn localtime(_timer: *const time_t) -> *mut tm; +} +extern "C" { + pub fn strftime( + _s: *mut ::libc::c_char, + _maxsize: usize, + _fmt: *const ::libc::c_char, + _t: *const tm, + ) -> usize; +} +extern "C" { + pub fn strftime_l( + _s: *mut ::libc::c_char, + _maxsize: usize, + _fmt: *const ::libc::c_char, + _t: *const tm, + _l: locale_t, + ) -> usize; +} +extern "C" { + pub fn asctime_r(arg1: *const tm, arg2: *mut ::libc::c_char) -> *mut ::libc::c_char; +} +extern "C" { + pub fn ctime_r(arg1: *const time_t, arg2: *mut ::libc::c_char) -> *mut ::libc::c_char; +} +extern "C" { + pub fn gmtime_r(arg1: *const time_t, arg2: *mut tm) -> *mut tm; +} +extern "C" { + pub fn localtime_r(arg1: *const time_t, arg2: *mut tm) -> *mut tm; +} +extern "C" { + pub fn tzset(); +} +extern "C" { + pub fn _tzset_r(arg1: *mut _reent); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __tzrule_struct { + pub ch: ::libc::c_char, + pub m: ::libc::c_int, + pub n: ::libc::c_int, + pub d: ::libc::c_int, + pub s: ::libc::c_int, + pub __bindgen_padding_0: u32, + pub change: time_t, + pub offset: ::libc::c_long, + pub __bindgen_padding_1: u32, +} +pub type __tzrule_type = __tzrule_struct; +#[repr(C)] +#[repr(align(8))] +#[derive(Debug, Copy, Clone)] +pub struct __tzinfo_struct { + pub __tznorth: ::libc::c_int, + pub __tzyear: ::libc::c_int, + pub __tzrule: [__tzrule_type; 2usize], +} +pub type __tzinfo_type = __tzinfo_struct; +extern "C" { + pub fn __gettzinfo() -> *mut __tzinfo_type; +} +extern "C" { + pub static mut _timezone: ::libc::c_long; +} +extern "C" { + pub static mut _daylight: ::libc::c_int; +} +extern "C" { + pub static mut _tzname: [*mut ::libc::c_char; 2usize]; +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union sigval { + pub sival_int: ::libc::c_int, + pub sival_ptr: *mut ::libc::c_void, + _bindgen_union_align: u32, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct sigevent { + pub sigev_notify: ::libc::c_int, + pub sigev_signo: ::libc::c_int, + pub sigev_value: sigval, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct siginfo_t { + pub si_signo: ::libc::c_int, + pub si_code: ::libc::c_int, + pub si_value: sigval, +} +pub type _sig_func_ptr = ::core::option::Option; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sigaction { + pub sa_handler: _sig_func_ptr, + pub sa_mask: sigset_t, + pub sa_flags: ::libc::c_int, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sigaltstack { + pub ss_sp: *mut ::libc::c_void, + pub ss_flags: ::libc::c_int, + pub ss_size: usize, +} +pub type stack_t = sigaltstack; +extern "C" { + pub fn sigprocmask( + arg1: ::libc::c_int, + arg2: *const sigset_t, + arg3: *mut sigset_t, + ) -> ::libc::c_int; +} +extern "C" { + pub fn pthread_sigmask( + arg1: ::libc::c_int, + arg2: *const sigset_t, + arg3: *mut sigset_t, + ) -> ::libc::c_int; +} +extern "C" { + pub fn kill(arg1: pid_t, arg2: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn killpg(arg1: pid_t, arg2: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn sigaction( + arg1: ::libc::c_int, + arg2: *const sigaction, + arg3: *mut sigaction, + ) -> ::libc::c_int; +} +extern "C" { + pub fn sigaddset(arg1: *mut sigset_t, arg2: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn sigdelset(arg1: *mut sigset_t, arg2: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn sigismember(arg1: *const sigset_t, arg2: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn sigfillset(arg1: *mut sigset_t) -> ::libc::c_int; +} +extern "C" { + pub fn sigemptyset(arg1: *mut sigset_t) -> ::libc::c_int; +} +extern "C" { + pub fn sigpending(arg1: *mut sigset_t) -> ::libc::c_int; +} +extern "C" { + pub fn sigsuspend(arg1: *const sigset_t) -> ::libc::c_int; +} +extern "C" { + pub fn sigwait(arg1: *const sigset_t, arg2: *mut ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn sigpause(arg1: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn sigaltstack(arg1: *const stack_t, arg2: *mut stack_t) -> ::libc::c_int; +} +extern "C" { + pub fn pthread_kill(arg1: pthread_t, arg2: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn sigwaitinfo(arg1: *const sigset_t, arg2: *mut siginfo_t) -> ::libc::c_int; +} +extern "C" { + pub fn sigtimedwait( + arg1: *const sigset_t, + arg2: *mut siginfo_t, + arg3: *const timespec, + ) -> ::libc::c_int; +} +extern "C" { + pub fn sigqueue(arg1: pid_t, arg2: ::libc::c_int, arg3: sigval) -> ::libc::c_int; +} +pub type sig_atomic_t = ::libc::c_int; +pub type sig_t = _sig_func_ptr; +extern "C" { + pub fn _signal_r(arg1: *mut _reent, arg2: ::libc::c_int, arg3: _sig_func_ptr) -> _sig_func_ptr; +} +extern "C" { + pub fn _raise_r(arg1: *mut _reent, arg2: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn signal(arg1: ::libc::c_int, arg2: _sig_func_ptr) -> _sig_func_ptr; +} +extern "C" { + pub fn raise(arg1: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn psignal(arg1: ::libc::c_int, arg2: *const ::libc::c_char); +} +extern "C" { + pub fn clock_settime(clock_id: clockid_t, tp: *const timespec) -> ::libc::c_int; +} +extern "C" { + pub fn clock_gettime(clock_id: clockid_t, tp: *mut timespec) -> ::libc::c_int; +} +extern "C" { + pub fn clock_getres(clock_id: clockid_t, res: *mut timespec) -> ::libc::c_int; +} +extern "C" { + pub fn timer_create( + clock_id: clockid_t, + evp: *mut sigevent, + timerid: *mut timer_t, + ) -> ::libc::c_int; +} +extern "C" { + pub fn timer_delete(timerid: timer_t) -> ::libc::c_int; +} +extern "C" { + pub fn timer_settime( + timerid: timer_t, + flags: ::libc::c_int, + value: *const itimerspec, + ovalue: *mut itimerspec, + ) -> ::libc::c_int; +} +extern "C" { + pub fn timer_gettime(timerid: timer_t, value: *mut itimerspec) -> ::libc::c_int; +} +extern "C" { + pub fn timer_getoverrun(timerid: timer_t) -> ::libc::c_int; +} +extern "C" { + pub fn nanosleep(rqtp: *const timespec, rmtp: *mut timespec) -> ::libc::c_int; +} +extern "C" { + pub fn utimes(__path: *const ::libc::c_char, __tvp: *const timeval) -> ::libc::c_int; +} +extern "C" { + pub fn adjtime(arg1: *const timeval, arg2: *mut timeval) -> ::libc::c_int; +} +extern "C" { + pub fn futimes(arg1: ::libc::c_int, arg2: *const timeval) -> ::libc::c_int; +} +extern "C" { + pub fn lutimes(arg1: *const ::libc::c_char, arg2: *const timeval) -> ::libc::c_int; +} +extern "C" { + pub fn settimeofday(arg1: *const timeval, arg2: *const timezone) -> ::libc::c_int; +} +extern "C" { + pub fn getitimer(__which: ::libc::c_int, __value: *mut itimerval) -> ::libc::c_int; +} +extern "C" { + pub fn setitimer( + __which: ::libc::c_int, + __value: *const itimerval, + __ovalue: *mut itimerval, + ) -> ::libc::c_int; +} +extern "C" { + pub fn gettimeofday(__p: *mut timeval, __tz: *mut ::libc::c_void) -> ::libc::c_int; +} +pub type socklen_t = u32; +pub type sa_family_t = u16; +#[repr(C)] +#[derive(Debug)] +pub struct sockaddr { + pub sa_family: sa_family_t, + pub sa_data: __IncompleteArrayField<::libc::c_char>, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_storage { + pub ss_family: sa_family_t, + pub __ss_padding: [::libc::c_char; 26usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct linger { + pub l_onoff: ::libc::c_int, + pub l_linger: ::libc::c_int, +} +extern "C" { + pub fn accept( + sockfd: ::libc::c_int, + addr: *mut sockaddr, + addrlen: *mut socklen_t, + ) -> ::libc::c_int; +} +extern "C" { + pub fn bind(sockfd: ::libc::c_int, addr: *const sockaddr, addrlen: socklen_t) -> ::libc::c_int; +} +extern "C" { + pub fn closesocket(sockfd: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn connect( + sockfd: ::libc::c_int, + addr: *const sockaddr, + addrlen: socklen_t, + ) -> ::libc::c_int; +} +extern "C" { + pub fn getpeername( + sockfd: ::libc::c_int, + addr: *mut sockaddr, + addrlen: *mut socklen_t, + ) -> ::libc::c_int; +} +extern "C" { + pub fn getsockname( + sockfd: ::libc::c_int, + addr: *mut sockaddr, + addrlen: *mut socklen_t, + ) -> ::libc::c_int; +} +extern "C" { + pub fn getsockopt( + sockfd: ::libc::c_int, + level: ::libc::c_int, + optname: ::libc::c_int, + optval: *mut ::libc::c_void, + optlen: *mut socklen_t, + ) -> ::libc::c_int; +} +extern "C" { + pub fn listen(sockfd: ::libc::c_int, backlog: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn recv( + sockfd: ::libc::c_int, + buf: *mut ::libc::c_void, + len: usize, + flags: ::libc::c_int, + ) -> isize; +} +extern "C" { + pub fn recvfrom( + sockfd: ::libc::c_int, + buf: *mut ::libc::c_void, + len: usize, + flags: ::libc::c_int, + src_addr: *mut sockaddr, + addrlen: *mut socklen_t, + ) -> isize; +} +extern "C" { + pub fn send( + sockfd: ::libc::c_int, + buf: *const ::libc::c_void, + len: usize, + flags: ::libc::c_int, + ) -> isize; +} +extern "C" { + pub fn sendto( + sockfd: ::libc::c_int, + buf: *const ::libc::c_void, + len: usize, + flags: ::libc::c_int, + dest_addr: *const sockaddr, + addrlen: socklen_t, + ) -> isize; +} +extern "C" { + pub fn setsockopt( + sockfd: ::libc::c_int, + level: ::libc::c_int, + optname: ::libc::c_int, + optval: *const ::libc::c_void, + optlen: socklen_t, + ) -> ::libc::c_int; +} +extern "C" { + pub fn shutdown(sockfd: ::libc::c_int, how: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn socket( + domain: ::libc::c_int, + type_: ::libc::c_int, + protocol: ::libc::c_int, + ) -> ::libc::c_int; +} +extern "C" { + pub fn sockatmark(sockfd: ::libc::c_int) -> ::libc::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct in_addr { + pub s_addr: in_addr_t, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sockaddr_in { + pub sin_family: sa_family_t, + pub sin_port: in_port_t, + pub sin_addr: in_addr, + pub sin_zero: [::libc::c_uchar; 8usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ip_mreq { + pub imr_multiaddr: in_addr, + pub imr_interface: in_addr, +} +pub const NETOPT_MAC_ADDRESS: NetworkOpt = 4100; +pub const NETOPT_ARP_TABLE: NetworkOpt = 12290; +pub const NETOPT_IP_INFO: NetworkOpt = 16387; +pub const NETOPT_IP_MTU: NetworkOpt = 16388; +pub const NETOPT_ROUTING_TABLE: NetworkOpt = 16390; +pub const NETOPT_UDP_NUMBER: NetworkOpt = 32770; +pub const NETOPT_UDP_TABLE: NetworkOpt = 32771; +pub const NETOPT_TCP_NUMBER: NetworkOpt = 36866; +pub const NETOPT_TCP_TABLE: NetworkOpt = 36867; +pub const NETOPT_DNS_TABLE: NetworkOpt = 45059; +pub const NETOPT_DHCP_LEASE_TIME: NetworkOpt = 49153; +pub type NetworkOpt = u32; +#[repr(C)] +pub struct SOCU_ARPTableEntry { + pub unk0: u32, + pub ip: in_addr, + pub mac: [u8; 6usize], + pub padding: [u8; 2usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SOCU_IPInfo { + pub ip: in_addr, + pub netmask: in_addr, + pub broadcast: in_addr, +} +#[repr(C)] +pub struct SOCU_RoutingTableEntry { + pub dest_ip: in_addr, + pub netmask: in_addr, + pub gateway: in_addr, + pub flags: u32, + pub time: u64, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SOCU_UDPTableEntry { + pub local: sockaddr_storage, + pub remote: sockaddr_storage, +} +#[repr(C)] +pub struct SOCU_TCPTableEntry { + pub state: u32, + pub local: sockaddr_storage, + pub remote: sockaddr_storage, +} +#[repr(C)] +pub struct SOCU_DNSTableEntry { + pub family: u32, + pub ip: in_addr, + pub padding: [u8; 12usize], +} +extern "C" { + pub fn socInit(context_addr: *mut u32, context_size: u32) -> Result; +} +extern "C" { + pub fn socExit() -> Result; +} +extern "C" { + pub fn gethostid() -> ::libc::c_long; +} +extern "C" { + pub fn gethostname(name: *mut ::libc::c_char, namelen: usize) -> ::libc::c_int; +} +extern "C" { + pub fn SOCU_ShutdownSockets() -> ::libc::c_int; +} +extern "C" { + pub fn SOCU_CloseSockets() -> ::libc::c_int; +} +extern "C" { + pub fn SOCU_GetNetworkOpt( + level: ::libc::c_int, + optname: NetworkOpt, + optval: *mut ::libc::c_void, + optlen: *mut socklen_t, + ) -> ::libc::c_int; +} +extern "C" { + pub fn SOCU_GetIPInfo( + ip: *mut in_addr, + netmask: *mut in_addr, + broadcast: *mut in_addr, + ) -> ::libc::c_int; +} +extern "C" { + pub fn SOCU_AddGlobalSocket(sockfd: ::libc::c_int) -> ::libc::c_int; +} +pub const MICU_ENCODING_PCM8: MICU_Encoding = 0; +pub const MICU_ENCODING_PCM16: MICU_Encoding = 1; +pub const MICU_ENCODING_PCM8_SIGNED: MICU_Encoding = 2; +pub const MICU_ENCODING_PCM16_SIGNED: MICU_Encoding = 3; +pub type MICU_Encoding = u32; +pub const MICU_SAMPLE_RATE_32730: MICU_SampleRate = 0; +pub const MICU_SAMPLE_RATE_16360: MICU_SampleRate = 1; +pub const MICU_SAMPLE_RATE_10910: MICU_SampleRate = 2; +pub const MICU_SAMPLE_RATE_8180: MICU_SampleRate = 3; +pub type MICU_SampleRate = u32; +extern "C" { + pub fn micInit(buffer: *mut u8, bufferSize: u32) -> Result; +} +extern "C" { + pub fn micExit(); +} +extern "C" { + pub fn micGetSampleDataSize() -> u32; +} +extern "C" { + pub fn micGetLastSampleOffset() -> u32; +} +extern "C" { + pub fn MICU_MapSharedMem(size: u32, handle: Handle) -> Result; +} +extern "C" { + pub fn MICU_UnmapSharedMem() -> Result; +} +extern "C" { + pub fn MICU_StartSampling( + encoding: MICU_Encoding, + sampleRate: MICU_SampleRate, + offset: u32, + size: u32, + loop_: bool, + ) -> Result; +} +extern "C" { + pub fn MICU_AdjustSampling(sampleRate: MICU_SampleRate) -> Result; +} +extern "C" { + pub fn MICU_StopSampling() -> Result; +} +extern "C" { + pub fn MICU_IsSampling(sampling: *mut bool) -> Result; +} +extern "C" { + pub fn MICU_GetEventHandle(handle: *mut Handle) -> Result; +} +extern "C" { + pub fn MICU_SetGain(gain: u8) -> Result; +} +extern "C" { + pub fn MICU_GetGain(gain: *mut u8) -> Result; +} +extern "C" { + pub fn MICU_SetPower(power: bool) -> Result; +} +extern "C" { + pub fn MICU_GetPower(power: *mut bool) -> Result; +} +extern "C" { + pub fn MICU_SetClamp(clamp: bool) -> Result; +} +extern "C" { + pub fn MICU_GetClamp(clamp: *mut bool) -> Result; +} +extern "C" { + pub fn MICU_SetAllowShellClosed(allowShellClosed: bool) -> Result; +} +pub const MVDMODE_COLORFORMATCONV: MVDSTD_Mode = 0; +pub const MVDMODE_VIDEOPROCESSING: MVDSTD_Mode = 1; +pub type MVDSTD_Mode = u32; +pub const MVD_INPUT_YUYV422: MVDSTD_InputFormat = 65537; +pub const MVD_INPUT_H264: MVDSTD_InputFormat = 131073; +pub type MVDSTD_InputFormat = u32; +pub const MVD_OUTPUT_YUYV422: MVDSTD_OutputFormat = 65537; +pub const MVD_OUTPUT_BGR565: MVDSTD_OutputFormat = 262146; +pub const MVD_OUTPUT_RGB565: MVDSTD_OutputFormat = 262148; +pub type MVDSTD_OutputFormat = u32; +#[repr(C)] +pub struct MVDSTD_Config { + pub input_type: MVDSTD_InputFormat, + pub unk_x04: u32, + pub unk_x08: u32, + pub inwidth: u32, + pub inheight: u32, + pub physaddr_colorconv_indata: u32, + pub physaddr_colorconv_unk0: u32, + pub physaddr_colorconv_unk1: u32, + pub physaddr_colorconv_unk2: u32, + pub physaddr_colorconv_unk3: u32, + pub unk_x28: [u32; 6usize], + pub enable_cropping: u32, + pub input_crop_x_pos: u32, + pub input_crop_y_pos: u32, + pub input_crop_height: u32, + pub input_crop_width: u32, + pub unk_x54: u32, + pub output_type: MVDSTD_OutputFormat, + pub outwidth: u32, + pub outheight: u32, + pub physaddr_outdata0: u32, + pub physaddr_outdata1: u32, + pub unk_x6c: [u32; 38usize], + pub flag_x104: u32, + pub output_x_pos: u32, + pub output_y_pos: u32, + pub output_width_override: u32, + pub output_height_override: u32, + pub unk_x118: u32, +} +#[repr(C)] +pub struct MVDSTD_ProcessNALUnitOut { + pub end_vaddr: u32, + pub end_physaddr: u32, + pub remaining_size: u32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct MVDSTD_OutputBuffersEntry { + pub outdata0: *mut ::libc::c_void, + pub outdata1: *mut ::libc::c_void, +} +#[repr(C)] +pub struct MVDSTD_OutputBuffersEntryList { + pub total_entries: u32, + pub entries: [MVDSTD_OutputBuffersEntry; 17usize], +} +#[repr(C)] +pub struct MVDSTD_InitStruct { + pub cmd5_inval0: s8, + pub cmd5_inval1: s8, + pub cmd5_inval2: s8, + pub cmd5_inval3: u32, + pub cmd1b_inval: u8, +} +extern "C" { + pub fn mvdstdInit( + mode: MVDSTD_Mode, + input_type: MVDSTD_InputFormat, + output_type: MVDSTD_OutputFormat, + size: u32, + initstruct: *mut MVDSTD_InitStruct, + ) -> Result; +} +extern "C" { + pub fn mvdstdExit(); +} +extern "C" { + pub fn mvdstdGenerateDefaultConfig( + config: *mut MVDSTD_Config, + input_width: u32, + input_height: u32, + output_width: u32, + output_height: u32, + vaddr_colorconv_indata: *mut u32, + vaddr_outdata0: *mut u32, + vaddr_outdata1: *mut u32, + ); +} +extern "C" { + pub fn mvdstdConvertImage(config: *mut MVDSTD_Config) -> Result; +} +extern "C" { + pub fn mvdstdProcessVideoFrame( + inbuf_vaddr: *mut ::libc::c_void, + size: usize, + flag: u32, + out: *mut MVDSTD_ProcessNALUnitOut, + ) -> Result; +} +extern "C" { + pub fn mvdstdRenderVideoFrame(config: *mut MVDSTD_Config, wait: bool) -> Result; +} +extern "C" { + pub fn MVDSTD_SetConfig(config: *mut MVDSTD_Config) -> Result; +} +extern "C" { + pub fn mvdstdSetupOutputBuffers( + entrylist: *mut MVDSTD_OutputBuffersEntryList, + bufsize: u32, + ) -> Result; +} +extern "C" { + pub fn mvdstdOverrideOutputBuffers( + cur_outdata0: *mut ::libc::c_void, + cur_outdata1: *mut ::libc::c_void, + new_outdata0: *mut ::libc::c_void, + new_outdata1: *mut ::libc::c_void, + ) -> Result; +} +pub const NFC_OpType_1: NFC_OpType = 1; +pub const NFC_OpType_NFCTag: NFC_OpType = 2; +pub const NFC_OpType_RawNFC: NFC_OpType = 3; +pub type NFC_OpType = u32; +pub const NFC_TagState_Uninitialized: NFC_TagState = 0; +pub const NFC_TagState_ScanningStopped: NFC_TagState = 1; +pub const NFC_TagState_Scanning: NFC_TagState = 2; +pub const NFC_TagState_InRange: NFC_TagState = 3; +pub const NFC_TagState_OutOfRange: NFC_TagState = 4; +pub const NFC_TagState_DataReady: NFC_TagState = 5; +pub type NFC_TagState = u32; +pub const NFC_amiiboFlag_Setup: _bindgen_ty_24 = 16; +pub const NFC_amiiboFlag_AppDataSetup: _bindgen_ty_24 = 32; +pub type _bindgen_ty_24 = u32; +#[repr(C)] +pub struct NFC_TagInfo { + pub id_offset_size: u16, + pub unk_x2: u8, + pub unk_x3: u8, + pub id: [u8; 40usize], +} +#[repr(C)] +pub struct NFC_AmiiboSettings { + pub mii: [u8; 96usize], + pub nickname: [u16; 11usize], + pub flags: u8, + pub countrycodeid: u8, + pub setupdate_year: u16, + pub setupdate_month: u8, + pub setupdate_day: u8, + pub unk_x7c: [u8; 44usize], +} +#[repr(C)] +pub struct NFC_AmiiboConfig { + pub lastwritedate_year: u16, + pub lastwritedate_month: u8, + pub lastwritedate_day: u8, + pub write_counter: u16, + pub characterID: [u8; 3usize], + pub series: u8, + pub amiiboID: u16, + pub type_: u8, + pub pagex4_byte3: u8, + pub appdata_size: u16, + pub zeros: [u8; 48usize], +} +#[repr(C)] +pub struct NFC_AppDataInitStruct { + pub data_x0: [u8; 12usize], + pub data_xc: [u8; 48usize], +} +#[repr(C)] +pub struct NFC_AppDataWriteStruct { + pub id: [u8; 10usize], + pub id_size: u8, + pub unused_xb: [u8; 21usize], +} +extern "C" { + pub fn nfcInit(type_: NFC_OpType) -> Result; +} +extern "C" { + pub fn nfcExit(); +} +extern "C" { + pub fn nfcGetSessionHandle() -> Handle; +} +extern "C" { + pub fn nfcStartScanning(inval: u16) -> Result; +} +extern "C" { + pub fn nfcStopScanning(); +} +extern "C" { + pub fn nfcLoadAmiiboData() -> Result; +} +extern "C" { + pub fn nfcResetTagScanState() -> Result; +} +extern "C" { + pub fn nfcUpdateStoredAmiiboData() -> Result; +} +extern "C" { + pub fn nfcGetTagState(state: *mut NFC_TagState) -> Result; +} +extern "C" { + pub fn nfcGetTagInfo(out: *mut NFC_TagInfo) -> Result; +} +extern "C" { + pub fn nfcOpenAppData(amiibo_appid: u32) -> Result; +} +extern "C" { + pub fn nfcInitializeWriteAppData( + amiibo_appid: u32, + buf: *const ::libc::c_void, + size: usize, + ) -> Result; +} +extern "C" { + pub fn nfcReadAppData(buf: *mut ::libc::c_void, size: usize) -> Result; +} +extern "C" { + pub fn nfcWriteAppData( + buf: *const ::libc::c_void, + size: usize, + taginfo: *mut NFC_TagInfo, + ) -> Result; +} +extern "C" { + pub fn nfcGetAmiiboSettings(out: *mut NFC_AmiiboSettings) -> Result; +} +extern "C" { + pub fn nfcGetAmiiboConfig(out: *mut NFC_AmiiboConfig) -> Result; +} +extern "C" { + pub fn nfcStartOtherTagScanning(unk0: u16, unk1: u32) -> Result; +} +extern "C" { + pub fn nfcSendTagCommand( + inbuf: *const ::libc::c_void, + insize: usize, + outbuf: *mut ::libc::c_void, + outsize: usize, + actual_transfer_size: *mut usize, + microseconds: u64, + ) -> Result; +} +extern "C" { + pub fn nfcCmd21() -> Result; +} +extern "C" { + pub fn nfcCmd22() -> Result; +} +#[repr(C)] +pub struct NotificationHeader { + pub dataSet: bool, + pub unread: bool, + pub enableJPEG: bool, + pub isSpotPass: bool, + pub isOptedOut: bool, + pub unkData: [u8; 3usize], + pub processID: u64, + pub unkData2: [u8; 8usize], + pub jumpParam: u64, + pub unkData3: [u8; 8usize], + pub time: u64, + pub title: [u16; 32usize], +} +extern "C" { + pub fn newsInit() -> Result; +} +extern "C" { + pub fn newsExit(); +} +extern "C" { + pub fn NEWS_AddNotification( + title: *const u16, + titleLength: u32, + message: *const u16, + messageLength: u32, + imageData: *const ::libc::c_void, + imageSize: u32, + jpeg: bool, + ) -> Result; +} +extern "C" { + pub fn NEWS_GetTotalNotifications(num: *mut u32) -> Result; +} +extern "C" { + pub fn NEWS_SetNotificationHeader(news_id: u32, header: *const NotificationHeader) -> Result; +} +extern "C" { + pub fn NEWS_GetNotificationHeader(news_id: u32, header: *mut NotificationHeader) -> Result; +} +extern "C" { + pub fn NEWS_SetNotificationMessage(news_id: u32, message: *const u16, size: u32) -> Result; +} +extern "C" { + pub fn NEWS_GetNotificationMessage(news_id: u32, message: *mut u16, size: *mut u32) -> Result; +} +extern "C" { + pub fn NEWS_SetNotificationImage( + news_id: u32, + buffer: *const ::libc::c_void, + size: u32, + ) -> Result; +} +extern "C" { + pub fn NEWS_GetNotificationImage( + news_id: u32, + buffer: *mut ::libc::c_void, + size: *mut u32, + ) -> Result; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QTM_HeadTrackingInfoCoord { + pub x: f32, + pub y: f32, +} +#[repr(C)] +pub struct QTM_HeadTrackingInfo { + pub flags: [u8; 5usize], + pub padding: [u8; 3usize], + pub floatdata_x08: f32, + pub coords0: [QTM_HeadTrackingInfoCoord; 4usize], + pub unk_x2c: [u32; 5usize], +} +extern "C" { + pub fn qtmInit() -> Result; +} +extern "C" { + pub fn qtmExit(); +} +extern "C" { + pub fn qtmCheckInitialized() -> bool; +} +extern "C" { + pub fn qtmCheckHeadFullyDetected(info: *mut QTM_HeadTrackingInfo) -> bool; +} +extern "C" { + pub fn qtmConvertCoordToScreen( + coord: *mut QTM_HeadTrackingInfoCoord, + screen_width: *mut f32, + screen_height: *mut f32, + x: *mut u32, + y: *mut u32, + ) -> Result; +} +extern "C" { + pub fn QTM_GetHeadTrackingInfo(val: u64, out: *mut QTM_HeadTrackingInfo) -> Result; +} +extern "C" { + pub fn srvPmInit() -> Result; +} +extern "C" { + pub fn srvPmExit(); +} +extern "C" { + pub fn srvPmGetSessionHandle() -> *mut Handle; +} +extern "C" { + pub fn SRVPM_PublishToProcess(notificationId: u32, process: Handle) -> Result; +} +extern "C" { + pub fn SRVPM_PublishToAll(notificationId: u32) -> Result; +} +extern "C" { + pub fn SRVPM_RegisterProcess( + pid: u32, + count: u32, + serviceAccessControlList: *mut [::libc::c_char; 8usize], + ) -> Result; +} +extern "C" { + pub fn SRVPM_UnregisterProcess(pid: u32) -> Result; +} +extern "C" { + pub fn loaderInit() -> Result; +} +extern "C" { + pub fn loaderExit(); +} +extern "C" { + pub fn LOADER_LoadProcess(process: *mut Handle, programHandle: u64) -> Result; +} +extern "C" { + pub fn LOADER_RegisterProgram( + programHandle: *mut u64, + titleId: u64, + mediaType: FS_MediaType, + updateTitleId: u64, + updateMediaType: FS_MediaType, + ) -> Result; +} +extern "C" { + pub fn LOADER_UnregisterProgram(programHandle: u64) -> Result; +} +extern "C" { + pub fn LOADER_GetProgramInfo(exheaderInfo: *mut ExHeader_Info, programHandle: u64) -> Result; +} +pub const LED_NORMAL: powerLedState = 1; +pub const LED_SLEEP_MODE: powerLedState = 2; +pub const LED_OFF: powerLedState = 3; +pub const LED_RED: powerLedState = 4; +pub const LED_BLUE: powerLedState = 5; +pub const LED_BLINK_RED: powerLedState = 6; +pub type powerLedState = u32; +extern "C" { + pub fn mcuHwcInit() -> Result; +} +extern "C" { + pub fn mcuHwcExit(); +} +extern "C" { + pub fn MCUHWC_ReadRegister(reg: u8, data: *mut ::libc::c_void, size: u32) -> Result; +} +extern "C" { + pub fn MCUHWC_WriteRegister(reg: u8, data: *const ::libc::c_void, size: u32) -> Result; +} +extern "C" { + pub fn MCUHWC_GetBatteryVoltage(voltage: *mut u8) -> Result; +} +extern "C" { + pub fn MCUHWC_GetBatteryLevel(level: *mut u8) -> Result; +} +extern "C" { + pub fn MCUHWC_GetSoundSliderLevel(level: *mut u8) -> Result; +} +extern "C" { + pub fn MCUHWC_SetWifiLedState(state: bool) -> Result; +} +extern "C" { + pub fn MCUHWC_SetPowerLedState(state: powerLedState) -> Result; +} +extern "C" { + pub fn MCUHWC_Get3dSliderLevel(level: *mut u8) -> Result; +} +extern "C" { + pub fn MCUHWC_GetFwVerHigh(out: *mut u8) -> Result; +} +extern "C" { + pub fn MCUHWC_GetFwVerLow(out: *mut u8) -> Result; +} +extern "C" { + pub fn hbInit() -> Result; +} +extern "C" { + pub fn hbExit(); +} +extern "C" { + pub fn HB_FlushInvalidateCache() -> Result; +} +extern "C" { + pub fn HB_GetBootloaderAddresses( + load3dsx: *mut *mut ::libc::c_void, + setArgv: *mut *mut ::libc::c_void, + ) -> Result; +} +extern "C" { + pub fn HB_ReprotectMemory( + addr: *mut u32, + pages: u32, + mode: u32, + reprotectedPages: *mut u32, + ) -> Result; +} +pub const GX_TRANSFER_FMT_RGBA8: GX_TRANSFER_FORMAT = 0; +pub const GX_TRANSFER_FMT_RGB8: GX_TRANSFER_FORMAT = 1; +pub const GX_TRANSFER_FMT_RGB565: GX_TRANSFER_FORMAT = 2; +pub const GX_TRANSFER_FMT_RGB5A1: GX_TRANSFER_FORMAT = 3; +pub const GX_TRANSFER_FMT_RGBA4: GX_TRANSFER_FORMAT = 4; +pub type GX_TRANSFER_FORMAT = u32; +pub const GX_TRANSFER_SCALE_NO: GX_TRANSFER_SCALE = 0; +pub const GX_TRANSFER_SCALE_X: GX_TRANSFER_SCALE = 1; +pub const GX_TRANSFER_SCALE_XY: GX_TRANSFER_SCALE = 2; +pub type GX_TRANSFER_SCALE = u32; +pub const GX_FILL_TRIGGER: GX_FILL_CONTROL = 1; +pub const GX_FILL_FINISHED: GX_FILL_CONTROL = 2; +pub const GX_FILL_16BIT_DEPTH: GX_FILL_CONTROL = 0; +pub const GX_FILL_24BIT_DEPTH: GX_FILL_CONTROL = 256; +pub const GX_FILL_32BIT_DEPTH: GX_FILL_CONTROL = 512; +pub type GX_FILL_CONTROL = u32; +extern "C" { + pub static mut gxCmdBuf: *mut u32; +} +#[repr(C)] +pub struct gxCmdEntry_s { + pub data: __BindgenUnionField<[u32; 8usize]>, + pub __bindgen_anon_1: __BindgenUnionField, + pub bindgen_union_field: [u32; 8usize], +} +#[repr(C)] +pub struct gxCmdEntry_s__bindgen_ty_1 { + pub type_: u8, + pub unk1: u8, + pub unk2: u8, + pub unk3: u8, + pub args: [u32; 7usize], +} +#[repr(C)] +pub struct tag_gxCmdQueue_s { + pub entries: *mut gxCmdEntry_s, + pub maxEntries: u16, + pub numEntries: u16, + pub curEntry: u16, + pub lastEntry: u16, + pub callback: ::core::option::Option, + pub user: *mut ::libc::c_void, +} +pub type gxCmdQueue_s = tag_gxCmdQueue_s; +extern "C" { + pub fn gxCmdQueueClear(queue: *mut gxCmdQueue_s); +} +extern "C" { + pub fn gxCmdQueueAdd(queue: *mut gxCmdQueue_s, entry: *const gxCmdEntry_s); +} +extern "C" { + pub fn gxCmdQueueRun(queue: *mut gxCmdQueue_s); +} +extern "C" { + pub fn gxCmdQueueStop(queue: *mut gxCmdQueue_s); +} +extern "C" { + pub fn gxCmdQueueWait(queue: *mut gxCmdQueue_s, timeout: s64) -> bool; +} +extern "C" { + pub fn GX_BindQueue(queue: *mut gxCmdQueue_s); +} +extern "C" { + pub fn GX_RequestDma(src: *mut u32, dst: *mut u32, length: u32) -> Result; +} +extern "C" { + pub fn GX_ProcessCommandList(buf0a: *mut u32, buf0s: u32, flags: u8) -> Result; +} +extern "C" { + pub fn GX_MemoryFill( + buf0a: *mut u32, + buf0v: u32, + buf0e: *mut u32, + control0: u16, + buf1a: *mut u32, + buf1v: u32, + buf1e: *mut u32, + control1: u16, + ) -> Result; +} +extern "C" { + pub fn GX_DisplayTransfer( + inadr: *mut u32, + indim: u32, + outadr: *mut u32, + outdim: u32, + flags: u32, + ) -> Result; +} +extern "C" { + pub fn GX_TextureCopy( + inadr: *mut u32, + indim: u32, + outadr: *mut u32, + outdim: u32, + size: u32, + flags: u32, + ) -> Result; +} +extern "C" { + pub fn GX_FlushCacheRegions( + buf0a: *mut u32, + buf0s: u32, + buf1a: *mut u32, + buf1s: u32, + buf2a: *mut u32, + buf2s: u32, + ) -> Result; +} +pub const GPU_NEAREST: GPU_TEXTURE_FILTER_PARAM = 0; +pub const GPU_LINEAR: GPU_TEXTURE_FILTER_PARAM = 1; +pub type GPU_TEXTURE_FILTER_PARAM = u32; +pub const GPU_CLAMP_TO_EDGE: GPU_TEXTURE_WRAP_PARAM = 0; +pub const GPU_CLAMP_TO_BORDER: GPU_TEXTURE_WRAP_PARAM = 1; +pub const GPU_REPEAT: GPU_TEXTURE_WRAP_PARAM = 2; +pub const GPU_MIRRORED_REPEAT: GPU_TEXTURE_WRAP_PARAM = 3; +pub type GPU_TEXTURE_WRAP_PARAM = u32; +pub const GPU_TEX_2D: GPU_TEXTURE_MODE_PARAM = 0; +pub const GPU_TEX_CUBE_MAP: GPU_TEXTURE_MODE_PARAM = 1; +pub const GPU_TEX_SHADOW_2D: GPU_TEXTURE_MODE_PARAM = 2; +pub const GPU_TEX_PROJECTION: GPU_TEXTURE_MODE_PARAM = 3; +pub const GPU_TEX_SHADOW_CUBE: GPU_TEXTURE_MODE_PARAM = 4; +pub const GPU_TEX_DISABLED: GPU_TEXTURE_MODE_PARAM = 5; +pub type GPU_TEXTURE_MODE_PARAM = u32; +pub const GPU_TEXUNIT0: GPU_TEXUNIT = 1; +pub const GPU_TEXUNIT1: GPU_TEXUNIT = 2; +pub const GPU_TEXUNIT2: GPU_TEXUNIT = 4; +pub type GPU_TEXUNIT = u32; +pub const GPU_RGBA8: GPU_TEXCOLOR = 0; +pub const GPU_RGB8: GPU_TEXCOLOR = 1; +pub const GPU_RGBA5551: GPU_TEXCOLOR = 2; +pub const GPU_RGB565: GPU_TEXCOLOR = 3; +pub const GPU_RGBA4: GPU_TEXCOLOR = 4; +pub const GPU_LA8: GPU_TEXCOLOR = 5; +pub const GPU_HILO8: GPU_TEXCOLOR = 6; +pub const GPU_L8: GPU_TEXCOLOR = 7; +pub const GPU_A8: GPU_TEXCOLOR = 8; +pub const GPU_LA4: GPU_TEXCOLOR = 9; +pub const GPU_L4: GPU_TEXCOLOR = 10; +pub const GPU_A4: GPU_TEXCOLOR = 11; +pub const GPU_ETC1: GPU_TEXCOLOR = 12; +pub const GPU_ETC1A4: GPU_TEXCOLOR = 13; +pub type GPU_TEXCOLOR = u32; +pub const GPU_TEXFACE_2D: GPU_TEXFACE = 0; +pub const GPU_POSITIVE_X: GPU_TEXFACE = 0; +pub const GPU_NEGATIVE_X: GPU_TEXFACE = 1; +pub const GPU_POSITIVE_Y: GPU_TEXFACE = 2; +pub const GPU_NEGATIVE_Y: GPU_TEXFACE = 3; +pub const GPU_POSITIVE_Z: GPU_TEXFACE = 4; +pub const GPU_NEGATIVE_Z: GPU_TEXFACE = 5; +pub type GPU_TEXFACE = u32; +pub const GPU_PT_CLAMP_TO_ZERO: GPU_PROCTEX_CLAMP = 0; +pub const GPU_PT_CLAMP_TO_EDGE: GPU_PROCTEX_CLAMP = 1; +pub const GPU_PT_REPEAT: GPU_PROCTEX_CLAMP = 2; +pub const GPU_PT_MIRRORED_REPEAT: GPU_PROCTEX_CLAMP = 3; +pub const GPU_PT_PULSE: GPU_PROCTEX_CLAMP = 4; +pub type GPU_PROCTEX_CLAMP = u32; +pub const GPU_PT_U: GPU_PROCTEX_MAPFUNC = 0; +pub const GPU_PT_U2: GPU_PROCTEX_MAPFUNC = 1; +pub const GPU_PT_V: GPU_PROCTEX_MAPFUNC = 2; +pub const GPU_PT_V2: GPU_PROCTEX_MAPFUNC = 3; +pub const GPU_PT_ADD: GPU_PROCTEX_MAPFUNC = 4; +pub const GPU_PT_ADD2: GPU_PROCTEX_MAPFUNC = 5; +pub const GPU_PT_SQRT2: GPU_PROCTEX_MAPFUNC = 6; +pub const GPU_PT_MIN: GPU_PROCTEX_MAPFUNC = 7; +pub const GPU_PT_MAX: GPU_PROCTEX_MAPFUNC = 8; +pub const GPU_PT_RMAX: GPU_PROCTEX_MAPFUNC = 9; +pub type GPU_PROCTEX_MAPFUNC = u32; +pub const GPU_PT_NONE: GPU_PROCTEX_SHIFT = 0; +pub const GPU_PT_ODD: GPU_PROCTEX_SHIFT = 1; +pub const GPU_PT_EVEN: GPU_PROCTEX_SHIFT = 2; +pub type GPU_PROCTEX_SHIFT = u32; +pub const GPU_PT_NEAREST: GPU_PROCTEX_FILTER = 0; +pub const GPU_PT_LINEAR: GPU_PROCTEX_FILTER = 1; +pub const GPU_PT_NEAREST_MIP_NEAREST: GPU_PROCTEX_FILTER = 2; +pub const GPU_PT_LINEAR_MIP_NEAREST: GPU_PROCTEX_FILTER = 3; +pub const GPU_PT_NEAREST_MIP_LINEAR: GPU_PROCTEX_FILTER = 4; +pub const GPU_PT_LINEAR_MIP_LINEAR: GPU_PROCTEX_FILTER = 5; +pub type GPU_PROCTEX_FILTER = u32; +pub const GPU_LUT_NOISE: GPU_PROCTEX_LUTID = 0; +pub const GPU_LUT_RGBMAP: GPU_PROCTEX_LUTID = 2; +pub const GPU_LUT_ALPHAMAP: GPU_PROCTEX_LUTID = 3; +pub const GPU_LUT_COLOR: GPU_PROCTEX_LUTID = 4; +pub const GPU_LUT_COLORDIF: GPU_PROCTEX_LUTID = 5; +pub type GPU_PROCTEX_LUTID = u32; +pub const GPU_RB_RGBA8: GPU_COLORBUF = 0; +pub const GPU_RB_RGB8: GPU_COLORBUF = 1; +pub const GPU_RB_RGBA5551: GPU_COLORBUF = 2; +pub const GPU_RB_RGB565: GPU_COLORBUF = 3; +pub const GPU_RB_RGBA4: GPU_COLORBUF = 4; +pub type GPU_COLORBUF = u32; +pub const GPU_RB_DEPTH16: GPU_DEPTHBUF = 0; +pub const GPU_RB_DEPTH24: GPU_DEPTHBUF = 2; +pub const GPU_RB_DEPTH24_STENCIL8: GPU_DEPTHBUF = 3; +pub type GPU_DEPTHBUF = u32; +pub const GPU_NEVER: GPU_TESTFUNC = 0; +pub const GPU_ALWAYS: GPU_TESTFUNC = 1; +pub const GPU_EQUAL: GPU_TESTFUNC = 2; +pub const GPU_NOTEQUAL: GPU_TESTFUNC = 3; +pub const GPU_LESS: GPU_TESTFUNC = 4; +pub const GPU_LEQUAL: GPU_TESTFUNC = 5; +pub const GPU_GREATER: GPU_TESTFUNC = 6; +pub const GPU_GEQUAL: GPU_TESTFUNC = 7; +pub type GPU_TESTFUNC = u32; +pub const GPU_EARLYDEPTH_GEQUAL: GPU_EARLYDEPTHFUNC = 0; +pub const GPU_EARLYDEPTH_GREATER: GPU_EARLYDEPTHFUNC = 1; +pub const GPU_EARLYDEPTH_LEQUAL: GPU_EARLYDEPTHFUNC = 2; +pub const GPU_EARLYDEPTH_LESS: GPU_EARLYDEPTHFUNC = 3; +pub type GPU_EARLYDEPTHFUNC = u32; +pub const GPU_GAS_NEVER: GPU_GASDEPTHFUNC = 0; +pub const GPU_GAS_ALWAYS: GPU_GASDEPTHFUNC = 1; +pub const GPU_GAS_GREATER: GPU_GASDEPTHFUNC = 2; +pub const GPU_GAS_LESS: GPU_GASDEPTHFUNC = 3; +pub type GPU_GASDEPTHFUNC = u32; +pub const GPU_SCISSOR_DISABLE: GPU_SCISSORMODE = 0; +pub const GPU_SCISSOR_INVERT: GPU_SCISSORMODE = 1; +pub const GPU_SCISSOR_NORMAL: GPU_SCISSORMODE = 3; +pub type GPU_SCISSORMODE = u32; +pub const GPU_STENCIL_KEEP: GPU_STENCILOP = 0; +pub const GPU_STENCIL_ZERO: GPU_STENCILOP = 1; +pub const GPU_STENCIL_REPLACE: GPU_STENCILOP = 2; +pub const GPU_STENCIL_INCR: GPU_STENCILOP = 3; +pub const GPU_STENCIL_DECR: GPU_STENCILOP = 4; +pub const GPU_STENCIL_INVERT: GPU_STENCILOP = 5; +pub const GPU_STENCIL_INCR_WRAP: GPU_STENCILOP = 6; +pub const GPU_STENCIL_DECR_WRAP: GPU_STENCILOP = 7; +pub type GPU_STENCILOP = u32; +pub const GPU_WRITE_RED: GPU_WRITEMASK = 1; +pub const GPU_WRITE_GREEN: GPU_WRITEMASK = 2; +pub const GPU_WRITE_BLUE: GPU_WRITEMASK = 4; +pub const GPU_WRITE_ALPHA: GPU_WRITEMASK = 8; +pub const GPU_WRITE_DEPTH: GPU_WRITEMASK = 16; +pub const GPU_WRITE_COLOR: GPU_WRITEMASK = 15; +pub const GPU_WRITE_ALL: GPU_WRITEMASK = 31; +pub type GPU_WRITEMASK = u32; +pub const GPU_BLEND_ADD: GPU_BLENDEQUATION = 0; +pub const GPU_BLEND_SUBTRACT: GPU_BLENDEQUATION = 1; +pub const GPU_BLEND_REVERSE_SUBTRACT: GPU_BLENDEQUATION = 2; +pub const GPU_BLEND_MIN: GPU_BLENDEQUATION = 3; +pub const GPU_BLEND_MAX: GPU_BLENDEQUATION = 4; +pub type GPU_BLENDEQUATION = u32; +pub const GPU_ZERO: GPU_BLENDFACTOR = 0; +pub const GPU_ONE: GPU_BLENDFACTOR = 1; +pub const GPU_SRC_COLOR: GPU_BLENDFACTOR = 2; +pub const GPU_ONE_MINUS_SRC_COLOR: GPU_BLENDFACTOR = 3; +pub const GPU_DST_COLOR: GPU_BLENDFACTOR = 4; +pub const GPU_ONE_MINUS_DST_COLOR: GPU_BLENDFACTOR = 5; +pub const GPU_SRC_ALPHA: GPU_BLENDFACTOR = 6; +pub const GPU_ONE_MINUS_SRC_ALPHA: GPU_BLENDFACTOR = 7; +pub const GPU_DST_ALPHA: GPU_BLENDFACTOR = 8; +pub const GPU_ONE_MINUS_DST_ALPHA: GPU_BLENDFACTOR = 9; +pub const GPU_CONSTANT_COLOR: GPU_BLENDFACTOR = 10; +pub const GPU_ONE_MINUS_CONSTANT_COLOR: GPU_BLENDFACTOR = 11; +pub const GPU_CONSTANT_ALPHA: GPU_BLENDFACTOR = 12; +pub const GPU_ONE_MINUS_CONSTANT_ALPHA: GPU_BLENDFACTOR = 13; +pub const GPU_SRC_ALPHA_SATURATE: GPU_BLENDFACTOR = 14; +pub type GPU_BLENDFACTOR = u32; +pub const GPU_LOGICOP_CLEAR: GPU_LOGICOP = 0; +pub const GPU_LOGICOP_AND: GPU_LOGICOP = 1; +pub const GPU_LOGICOP_AND_REVERSE: GPU_LOGICOP = 2; +pub const GPU_LOGICOP_COPY: GPU_LOGICOP = 3; +pub const GPU_LOGICOP_SET: GPU_LOGICOP = 4; +pub const GPU_LOGICOP_COPY_INVERTED: GPU_LOGICOP = 5; +pub const GPU_LOGICOP_NOOP: GPU_LOGICOP = 6; +pub const GPU_LOGICOP_INVERT: GPU_LOGICOP = 7; +pub const GPU_LOGICOP_NAND: GPU_LOGICOP = 8; +pub const GPU_LOGICOP_OR: GPU_LOGICOP = 9; +pub const GPU_LOGICOP_NOR: GPU_LOGICOP = 10; +pub const GPU_LOGICOP_XOR: GPU_LOGICOP = 11; +pub const GPU_LOGICOP_EQUIV: GPU_LOGICOP = 12; +pub const GPU_LOGICOP_AND_INVERTED: GPU_LOGICOP = 13; +pub const GPU_LOGICOP_OR_REVERSE: GPU_LOGICOP = 14; +pub const GPU_LOGICOP_OR_INVERTED: GPU_LOGICOP = 15; +pub type GPU_LOGICOP = u32; +pub const GPU_FRAGOPMODE_GL: GPU_FRAGOPMODE = 0; +pub const GPU_FRAGOPMODE_GAS_ACC: GPU_FRAGOPMODE = 1; +pub const GPU_FRAGOPMODE_SHADOW: GPU_FRAGOPMODE = 3; +pub type GPU_FRAGOPMODE = u32; +pub const GPU_BYTE: GPU_FORMATS = 0; +pub const GPU_UNSIGNED_BYTE: GPU_FORMATS = 1; +pub const GPU_SHORT: GPU_FORMATS = 2; +pub const GPU_FLOAT: GPU_FORMATS = 3; +pub type GPU_FORMATS = u32; +pub const GPU_CULL_NONE: GPU_CULLMODE = 0; +pub const GPU_CULL_FRONT_CCW: GPU_CULLMODE = 1; +pub const GPU_CULL_BACK_CCW: GPU_CULLMODE = 2; +pub type GPU_CULLMODE = u32; +pub const GPU_PRIMARY_COLOR: GPU_TEVSRC = 0; +pub const GPU_FRAGMENT_PRIMARY_COLOR: GPU_TEVSRC = 1; +pub const GPU_FRAGMENT_SECONDARY_COLOR: GPU_TEVSRC = 2; +pub const GPU_TEXTURE0: GPU_TEVSRC = 3; +pub const GPU_TEXTURE1: GPU_TEVSRC = 4; +pub const GPU_TEXTURE2: GPU_TEVSRC = 5; +pub const GPU_TEXTURE3: GPU_TEVSRC = 6; +pub const GPU_PREVIOUS_BUFFER: GPU_TEVSRC = 13; +pub const GPU_CONSTANT: GPU_TEVSRC = 14; +pub const GPU_PREVIOUS: GPU_TEVSRC = 15; +pub type GPU_TEVSRC = u32; +pub const GPU_TEVOP_RGB_SRC_COLOR: GPU_TEVOP_RGB = 0; +pub const GPU_TEVOP_RGB_ONE_MINUS_SRC_COLOR: GPU_TEVOP_RGB = 1; +pub const GPU_TEVOP_RGB_SRC_ALPHA: GPU_TEVOP_RGB = 2; +pub const GPU_TEVOP_RGB_ONE_MINUS_SRC_ALPHA: GPU_TEVOP_RGB = 3; +pub const GPU_TEVOP_RGB_SRC_R: GPU_TEVOP_RGB = 4; +pub const GPU_TEVOP_RGB_ONE_MINUS_SRC_R: GPU_TEVOP_RGB = 5; +pub const GPU_TEVOP_RGB_0x06: GPU_TEVOP_RGB = 6; +pub const GPU_TEVOP_RGB_0x07: GPU_TEVOP_RGB = 7; +pub const GPU_TEVOP_RGB_SRC_G: GPU_TEVOP_RGB = 8; +pub const GPU_TEVOP_RGB_ONE_MINUS_SRC_G: GPU_TEVOP_RGB = 9; +pub const GPU_TEVOP_RGB_0x0A: GPU_TEVOP_RGB = 10; +pub const GPU_TEVOP_RGB_0x0B: GPU_TEVOP_RGB = 11; +pub const GPU_TEVOP_RGB_SRC_B: GPU_TEVOP_RGB = 12; +pub const GPU_TEVOP_RGB_ONE_MINUS_SRC_B: GPU_TEVOP_RGB = 13; +pub const GPU_TEVOP_RGB_0x0E: GPU_TEVOP_RGB = 14; +pub const GPU_TEVOP_RGB_0x0F: GPU_TEVOP_RGB = 15; +pub type GPU_TEVOP_RGB = u32; +pub const GPU_TEVOP_A_SRC_ALPHA: GPU_TEVOP_A = 0; +pub const GPU_TEVOP_A_ONE_MINUS_SRC_ALPHA: GPU_TEVOP_A = 1; +pub const GPU_TEVOP_A_SRC_R: GPU_TEVOP_A = 2; +pub const GPU_TEVOP_A_ONE_MINUS_SRC_R: GPU_TEVOP_A = 3; +pub const GPU_TEVOP_A_SRC_G: GPU_TEVOP_A = 4; +pub const GPU_TEVOP_A_ONE_MINUS_SRC_G: GPU_TEVOP_A = 5; +pub const GPU_TEVOP_A_SRC_B: GPU_TEVOP_A = 6; +pub const GPU_TEVOP_A_ONE_MINUS_SRC_B: GPU_TEVOP_A = 7; +pub type GPU_TEVOP_A = u32; +pub const GPU_REPLACE: GPU_COMBINEFUNC = 0; +pub const GPU_MODULATE: GPU_COMBINEFUNC = 1; +pub const GPU_ADD: GPU_COMBINEFUNC = 2; +pub const GPU_ADD_SIGNED: GPU_COMBINEFUNC = 3; +pub const GPU_INTERPOLATE: GPU_COMBINEFUNC = 4; +pub const GPU_SUBTRACT: GPU_COMBINEFUNC = 5; +pub const GPU_DOT3_RGB: GPU_COMBINEFUNC = 6; +pub const GPU_MULTIPLY_ADD: GPU_COMBINEFUNC = 8; +pub const GPU_ADD_MULTIPLY: GPU_COMBINEFUNC = 9; +pub type GPU_COMBINEFUNC = u32; +pub const GPU_TEVSCALE_1: GPU_TEVSCALE = 0; +pub const GPU_TEVSCALE_2: GPU_TEVSCALE = 1; +pub const GPU_TEVSCALE_4: GPU_TEVSCALE = 2; +pub type GPU_TEVSCALE = u32; +pub const GPU_NO_FRESNEL: GPU_FRESNELSEL = 0; +pub const GPU_PRI_ALPHA_FRESNEL: GPU_FRESNELSEL = 1; +pub const GPU_SEC_ALPHA_FRESNEL: GPU_FRESNELSEL = 2; +pub const GPU_PRI_SEC_ALPHA_FRESNEL: GPU_FRESNELSEL = 3; +pub type GPU_FRESNELSEL = u32; +pub const GPU_BUMP_NOT_USED: GPU_BUMPMODE = 0; +pub const GPU_BUMP_AS_BUMP: GPU_BUMPMODE = 1; +pub const GPU_BUMP_AS_TANG: GPU_BUMPMODE = 2; +pub type GPU_BUMPMODE = u32; +pub const GPU_LUT_D0: GPU_LIGHTLUTID = 0; +pub const GPU_LUT_D1: GPU_LIGHTLUTID = 1; +pub const GPU_LUT_SP: GPU_LIGHTLUTID = 2; +pub const GPU_LUT_FR: GPU_LIGHTLUTID = 3; +pub const GPU_LUT_RB: GPU_LIGHTLUTID = 4; +pub const GPU_LUT_RG: GPU_LIGHTLUTID = 5; +pub const GPU_LUT_RR: GPU_LIGHTLUTID = 6; +pub const GPU_LUT_DA: GPU_LIGHTLUTID = 7; +pub type GPU_LIGHTLUTID = u32; +pub const GPU_LUTINPUT_NH: GPU_LIGHTLUTINPUT = 0; +pub const GPU_LUTINPUT_VH: GPU_LIGHTLUTINPUT = 1; +pub const GPU_LUTINPUT_NV: GPU_LIGHTLUTINPUT = 2; +pub const GPU_LUTINPUT_LN: GPU_LIGHTLUTINPUT = 3; +pub const GPU_LUTINPUT_SP: GPU_LIGHTLUTINPUT = 4; +pub const GPU_LUTINPUT_CP: GPU_LIGHTLUTINPUT = 5; +pub type GPU_LIGHTLUTINPUT = u32; +pub const GPU_LUTSCALER_1x: GPU_LIGHTLUTSCALER = 0; +pub const GPU_LUTSCALER_2x: GPU_LIGHTLUTSCALER = 1; +pub const GPU_LUTSCALER_4x: GPU_LIGHTLUTSCALER = 2; +pub const GPU_LUTSCALER_8x: GPU_LIGHTLUTSCALER = 3; +pub const GPU_LUTSCALER_0_25x: GPU_LIGHTLUTSCALER = 6; +pub const GPU_LUTSCALER_0_5x: GPU_LIGHTLUTSCALER = 7; +pub type GPU_LIGHTLUTSCALER = u32; +pub const GPU_LUTSELECT_COMMON: GPU_LIGHTLUTSELECT = 0; +pub const GPU_LUTSELECT_SP: GPU_LIGHTLUTSELECT = 1; +pub const GPU_LUTSELECT_DA: GPU_LIGHTLUTSELECT = 2; +pub type GPU_LIGHTLUTSELECT = u32; +pub const GPU_NO_FOG: GPU_FOGMODE = 0; +pub const GPU_FOG: GPU_FOGMODE = 5; +pub const GPU_GAS: GPU_FOGMODE = 7; +pub type GPU_FOGMODE = u32; +pub const GPU_PLAIN_DENSITY: GPU_GASMODE = 0; +pub const GPU_DEPTH_DENSITY: GPU_GASMODE = 1; +pub type GPU_GASMODE = u32; +pub const GPU_GAS_DENSITY: GPU_GASLUTINPUT = 0; +pub const GPU_GAS_LIGHT_FACTOR: GPU_GASLUTINPUT = 1; +pub type GPU_GASLUTINPUT = u32; +pub const GPU_TRIANGLES: GPU_Primitive_t = 0; +pub const GPU_TRIANGLE_STRIP: GPU_Primitive_t = 256; +pub const GPU_TRIANGLE_FAN: GPU_Primitive_t = 512; +pub const GPU_GEOMETRY_PRIM: GPU_Primitive_t = 768; +pub type GPU_Primitive_t = u32; +pub const GPU_VERTEX_SHADER: GPU_SHADER_TYPE = 0; +pub const GPU_GEOMETRY_SHADER: GPU_SHADER_TYPE = 1; +pub type GPU_SHADER_TYPE = u32; +extern "C" { + pub static mut gpuCmdBuf: *mut u32; +} +extern "C" { + pub static mut gpuCmdBufSize: u32; +} +extern "C" { + pub static mut gpuCmdBufOffset: u32; +} +extern "C" { + pub fn GPUCMD_AddRawCommands(cmd: *const u32, size: u32); +} +extern "C" { + pub fn GPUCMD_Add(header: u32, param: *const u32, paramlength: u32); +} +extern "C" { + pub fn GPUCMD_Split(addr: *mut *mut u32, size: *mut u32); +} +extern "C" { + pub fn f32tof16(f: f32) -> u32; +} +extern "C" { + pub fn f32tof20(f: f32) -> u32; +} +extern "C" { + pub fn f32tof24(f: f32) -> u32; +} +extern "C" { + pub fn f32tof31(f: f32) -> u32; +} +pub const VERTEX_SHDR: DVLE_type = 0; +pub const GEOMETRY_SHDR: DVLE_type = 1; +pub type DVLE_type = u32; +pub const DVLE_CONST_BOOL: DVLE_constantType = 0; +pub const DVLE_CONST_u8: DVLE_constantType = 1; +pub const DVLE_CONST_FLOAT24: DVLE_constantType = 2; +pub type DVLE_constantType = u32; +pub const RESULT_POSITION: DVLE_outputAttribute_t = 0; +pub const RESULT_NORMALQUAT: DVLE_outputAttribute_t = 1; +pub const RESULT_COLOR: DVLE_outputAttribute_t = 2; +pub const RESULT_TEXCOORD0: DVLE_outputAttribute_t = 3; +pub const RESULT_TEXCOORD0W: DVLE_outputAttribute_t = 4; +pub const RESULT_TEXCOORD1: DVLE_outputAttribute_t = 5; +pub const RESULT_TEXCOORD2: DVLE_outputAttribute_t = 6; +pub const RESULT_VIEW: DVLE_outputAttribute_t = 8; +pub const RESULT_DUMMY: DVLE_outputAttribute_t = 9; +pub type DVLE_outputAttribute_t = u32; +pub const GSH_POINT: DVLE_geoShaderMode = 0; +pub const GSH_VARIABLE_PRIM: DVLE_geoShaderMode = 1; +pub const GSH_FIXED_PRIM: DVLE_geoShaderMode = 2; +pub type DVLE_geoShaderMode = u32; +#[repr(C)] +pub struct DVLP_s { + pub codeSize: u32, + pub codeData: *mut u32, + pub opdescSize: u32, + pub opcdescData: *mut u32, +} +#[repr(C)] +pub struct DVLE_constEntry_s { + pub type_: u16, + pub id: u16, + pub data: [u32; 4usize], +} +#[repr(C)] +pub struct DVLE_outEntry_s { + pub type_: u16, + pub regID: u16, + pub mask: u8, + pub unk: [u8; 3usize], +} +#[repr(C)] +pub struct DVLE_uniformEntry_s { + pub symbolOffset: u32, + pub startReg: u16, + pub endReg: u16, +} +#[repr(C)] +pub struct DVLE_s { + pub type_: DVLE_type, + pub mergeOutmaps: bool, + pub gshMode: DVLE_geoShaderMode, + pub gshFixedVtxStart: u8, + pub gshVariableVtxNum: u8, + pub gshFixedVtxNum: u8, + pub dvlp: *mut DVLP_s, + pub mainOffset: u32, + pub endmainOffset: u32, + pub constTableSize: u32, + pub constTableData: *mut DVLE_constEntry_s, + pub outTableSize: u32, + pub outTableData: *mut DVLE_outEntry_s, + pub uniformTableSize: u32, + pub uniformTableData: *mut DVLE_uniformEntry_s, + pub symbolTableData: *mut ::libc::c_char, + pub outmapMask: u8, + pub outmapData: [u32; 8usize], + pub outmapMode: u32, + pub outmapClock: u32, +} +#[repr(C)] +pub struct DVLB_s { + pub numDVLE: u32, + pub DVLP: DVLP_s, + pub DVLE: *mut DVLE_s, +} +extern "C" { + pub fn DVLB_ParseFile(shbinData: *mut u32, shbinSize: u32) -> *mut DVLB_s; +} +extern "C" { + pub fn DVLB_Free(dvlb: *mut DVLB_s); +} +extern "C" { + pub fn DVLE_GetUniformRegister(dvle: *mut DVLE_s, name: *const ::libc::c_char) -> s8; +} +extern "C" { + pub fn DVLE_GenerateOutmap(dvle: *mut DVLE_s); +} +#[repr(C)] +pub struct float24Uniform_s { + pub id: u32, + pub data: [u32; 3usize], +} +#[repr(C)] +pub struct shaderInstance_s { + pub dvle: *mut DVLE_s, + pub boolUniforms: u16, + pub boolUniformMask: u16, + pub intUniforms: [u32; 4usize], + pub float24Uniforms: *mut float24Uniform_s, + pub intUniformMask: u8, + pub numFloat24Uniforms: u8, +} +#[repr(C)] +pub struct shaderProgram_s { + pub vertexShader: *mut shaderInstance_s, + pub geometryShader: *mut shaderInstance_s, + pub geoShaderInputPermutation: [u32; 2usize], + pub geoShaderInputStride: u8, +} +extern "C" { + pub fn shaderInstanceInit(si: *mut shaderInstance_s, dvle: *mut DVLE_s) -> Result; +} +extern "C" { + pub fn shaderInstanceFree(si: *mut shaderInstance_s) -> Result; +} +extern "C" { + pub fn shaderInstanceSetBool( + si: *mut shaderInstance_s, + id: ::libc::c_int, + value: bool, + ) -> Result; +} +extern "C" { + pub fn shaderInstanceGetBool( + si: *mut shaderInstance_s, + id: ::libc::c_int, + value: *mut bool, + ) -> Result; +} +extern "C" { + pub fn shaderInstanceGetUniformLocation( + si: *mut shaderInstance_s, + name: *const ::libc::c_char, + ) -> s8; +} +extern "C" { + pub fn shaderProgramInit(sp: *mut shaderProgram_s) -> Result; +} +extern "C" { + pub fn shaderProgramFree(sp: *mut shaderProgram_s) -> Result; +} +extern "C" { + pub fn shaderProgramSetVsh(sp: *mut shaderProgram_s, dvle: *mut DVLE_s) -> Result; +} +extern "C" { + pub fn shaderProgramSetGsh(sp: *mut shaderProgram_s, dvle: *mut DVLE_s, stride: u8) -> Result; +} +extern "C" { + pub fn shaderProgramSetGshInputPermutation( + sp: *mut shaderProgram_s, + permutation: u64, + ) -> Result; +} +extern "C" { + pub fn shaderProgramConfigure( + sp: *mut shaderProgram_s, + sendVshCode: bool, + sendGshCode: bool, + ) -> Result; +} +extern "C" { + pub fn shaderProgramUse(sp: *mut shaderProgram_s) -> Result; +} +pub const NDSP_OUTPUT_MONO: ndspOutputMode = 0; +pub const NDSP_OUTPUT_STEREO: ndspOutputMode = 1; +pub const NDSP_OUTPUT_SURROUND: ndspOutputMode = 2; +pub type ndspOutputMode = u32; +pub const NDSP_CLIP_NORMAL: ndspClippingMode = 0; +pub const NDSP_CLIP_SOFT: ndspClippingMode = 1; +pub type ndspClippingMode = u32; +pub const NDSP_SPKPOS_SQUARE: ndspSpeakerPos = 0; +pub const NDSP_SPKPOS_WIDE: ndspSpeakerPos = 1; +pub const NDSP_SPKPOS_NUM: ndspSpeakerPos = 2; +pub type ndspSpeakerPos = u32; +#[repr(C)] +pub struct ndspAdpcmData { + pub index: u16, + pub history0: s16, + pub history1: s16, +} +pub type ndspWaveBuf = tag_ndspWaveBuf; +pub const NDSP_WBUF_FREE: _bindgen_ty_25 = 0; +pub const NDSP_WBUF_QUEUED: _bindgen_ty_25 = 1; +pub const NDSP_WBUF_PLAYING: _bindgen_ty_25 = 2; +pub const NDSP_WBUF_DONE: _bindgen_ty_25 = 3; +pub type _bindgen_ty_25 = u32; +#[repr(C)] +pub struct tag_ndspWaveBuf { + pub __bindgen_anon_1: tag_ndspWaveBuf__bindgen_ty_1, + pub nsamples: u32, + pub adpcm_data: *mut ndspAdpcmData, + pub offset: u32, + pub looping: bool, + pub status: u8, + pub sequence_id: u16, + pub next: *mut ndspWaveBuf, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union tag_ndspWaveBuf__bindgen_ty_1 { + pub data_pcm8: *mut s8, + pub data_pcm16: *mut s16, + pub data_adpcm: *mut u8, + pub data_vaddr: *const ::libc::c_void, + _bindgen_union_align: u32, +} +pub type ndspCallback = ::core::option::Option; +pub type ndspAuxCallback = ::core::option::Option< + unsafe extern "C" fn( + data: *mut ::libc::c_void, + nsamples: ::libc::c_int, + samples: *mut *mut ::libc::c_void, + ), +>; +extern "C" { + pub fn ndspUseComponent(binary: *const ::libc::c_void, size: u32, progMask: u16, dataMask: u16); +} +extern "C" { + pub fn ndspInit() -> Result; +} +extern "C" { + pub fn ndspExit(); +} +extern "C" { + pub fn ndspGetDroppedFrames() -> u32; +} +extern "C" { + pub fn ndspGetFrameCount() -> u32; +} +extern "C" { + pub fn ndspSetMasterVol(volume: f32); +} +extern "C" { + pub fn ndspSetOutputMode(mode: ndspOutputMode); +} +extern "C" { + pub fn ndspSetClippingMode(mode: ndspClippingMode); +} +extern "C" { + pub fn ndspSetOutputCount(count: ::libc::c_int); +} +extern "C" { + pub fn ndspSetCapture(capture: *mut ndspWaveBuf); +} +extern "C" { + pub fn ndspSetCallback(callback: ndspCallback, data: *mut ::libc::c_void); +} +extern "C" { + pub fn ndspSurroundSetDepth(depth: u16); +} +extern "C" { + pub fn ndspSurroundSetPos(pos: ndspSpeakerPos); +} +extern "C" { + pub fn ndspSurroundSetRearRatio(ratio: u16); +} +extern "C" { + pub fn ndspAuxSetEnable(id: ::libc::c_int, enable: bool); +} +extern "C" { + pub fn ndspAuxSetFrontBypass(id: ::libc::c_int, bypass: bool); +} +extern "C" { + pub fn ndspAuxSetVolume(id: ::libc::c_int, volume: f32); +} +extern "C" { + pub fn ndspAuxSetCallback( + id: ::libc::c_int, + callback: ndspAuxCallback, + data: *mut ::libc::c_void, + ); +} +pub const NDSP_ENCODING_PCM8: _bindgen_ty_26 = 0; +pub const NDSP_ENCODING_PCM16: _bindgen_ty_26 = 1; +pub const NDSP_ENCODING_ADPCM: _bindgen_ty_26 = 2; +pub type _bindgen_ty_26 = u32; +pub const NDSP_FORMAT_MONO_PCM8: _bindgen_ty_27 = 1; +pub const NDSP_FORMAT_MONO_PCM16: _bindgen_ty_27 = 5; +pub const NDSP_FORMAT_MONO_ADPCM: _bindgen_ty_27 = 9; +pub const NDSP_FORMAT_STEREO_PCM8: _bindgen_ty_27 = 2; +pub const NDSP_FORMAT_STEREO_PCM16: _bindgen_ty_27 = 6; +pub const NDSP_FORMAT_PCM8: _bindgen_ty_27 = 1; +pub const NDSP_FORMAT_PCM16: _bindgen_ty_27 = 5; +pub const NDSP_FORMAT_ADPCM: _bindgen_ty_27 = 9; +pub const NDSP_FRONT_BYPASS: _bindgen_ty_27 = 16; +pub const NDSP_3D_SURROUND_PREPROCESSED: _bindgen_ty_27 = 64; +pub type _bindgen_ty_27 = u32; +pub const NDSP_INTERP_POLYPHASE: ndspInterpType = 0; +pub const NDSP_INTERP_LINEAR: ndspInterpType = 1; +pub const NDSP_INTERP_NONE: ndspInterpType = 2; +pub type ndspInterpType = u32; +extern "C" { + pub fn ndspChnReset(id: ::libc::c_int); +} +extern "C" { + pub fn ndspChnInitParams(id: ::libc::c_int); +} +extern "C" { + pub fn ndspChnIsPlaying(id: ::libc::c_int) -> bool; +} +extern "C" { + pub fn ndspChnGetSamplePos(id: ::libc::c_int) -> u32; +} +extern "C" { + pub fn ndspChnGetWaveBufSeq(id: ::libc::c_int) -> u16; +} +extern "C" { + pub fn ndspChnIsPaused(id: ::libc::c_int) -> bool; +} +extern "C" { + pub fn ndspChnSetPaused(id: ::libc::c_int, paused: bool); +} +extern "C" { + pub fn ndspChnSetFormat(id: ::libc::c_int, format: u16); +} +extern "C" { + pub fn ndspChnSetInterp(id: ::libc::c_int, type_: ndspInterpType); +} +extern "C" { + pub fn ndspChnSetRate(id: ::libc::c_int, rate: f32); +} +extern "C" { + pub fn ndspChnSetMix(id: ::libc::c_int, mix: *mut f32); +} +extern "C" { + pub fn ndspChnSetAdpcmCoefs(id: ::libc::c_int, coefs: *mut u16); +} +extern "C" { + pub fn ndspChnWaveBufClear(id: ::libc::c_int); +} +extern "C" { + pub fn ndspChnWaveBufAdd(id: ::libc::c_int, buf: *mut ndspWaveBuf); +} +extern "C" { + pub fn ndspChnIirMonoSetEnable(id: ::libc::c_int, enable: bool); +} +extern "C" { + pub fn ndspChnIirMonoSetParamsCustomFilter( + id: ::libc::c_int, + a0: f32, + a1: f32, + b0: f32, + ) -> bool; +} +extern "C" { + pub fn ndspChnIirMonoSetParamsLowPassFilter(id: ::libc::c_int, f0: f32) -> bool; +} +extern "C" { + pub fn ndspChnIirMonoSetParamsHighPassFilter(id: ::libc::c_int, f0: f32) -> bool; +} +extern "C" { + pub fn ndspChnIirBiquadSetEnable(id: ::libc::c_int, enable: bool); +} +extern "C" { + pub fn ndspChnIirBiquadSetParamsCustomFilter( + id: ::libc::c_int, + a0: f32, + a1: f32, + a2: f32, + b0: f32, + b1: f32, + b2: f32, + ) -> bool; +} +extern "C" { + pub fn ndspChnIirBiquadSetParamsLowPassFilter(id: ::libc::c_int, f0: f32, Q: f32) -> bool; +} +extern "C" { + pub fn ndspChnIirBiquadSetParamsHighPassFilter(id: ::libc::c_int, f0: f32, Q: f32) -> bool; +} +extern "C" { + pub fn ndspChnIirBiquadSetParamsBandPassFilter(id: ::libc::c_int, f0: f32, Q: f32) -> bool; +} +extern "C" { + pub fn ndspChnIirBiquadSetParamsNotchFilter(id: ::libc::c_int, f0: f32, Q: f32) -> bool; +} +extern "C" { + pub fn ndspChnIirBiquadSetParamsPeakingEqualizer( + id: ::libc::c_int, + f0: f32, + Q: f32, + gain: f32, + ) -> bool; +} +pub const SWKBD_TYPE_NORMAL: SwkbdType = 0; +pub const SWKBD_TYPE_QWERTY: SwkbdType = 1; +pub const SWKBD_TYPE_NUMPAD: SwkbdType = 2; +pub const SWKBD_TYPE_WESTERN: SwkbdType = 3; +pub type SwkbdType = u32; +pub const SWKBD_ANYTHING: SwkbdValidInput = 0; +pub const SWKBD_NOTEMPTY: SwkbdValidInput = 1; +pub const SWKBD_NOTEMPTY_NOTBLANK: SwkbdValidInput = 2; +pub const SWKBD_NOTBLANK_NOTEMPTY: SwkbdValidInput = 2; +pub const SWKBD_NOTBLANK: SwkbdValidInput = 3; +pub const SWKBD_FIXEDLEN: SwkbdValidInput = 4; +pub type SwkbdValidInput = u32; +pub const SWKBD_BUTTON_LEFT: SwkbdButton = 0; +pub const SWKBD_BUTTON_MIDDLE: SwkbdButton = 1; +pub const SWKBD_BUTTON_RIGHT: SwkbdButton = 2; +pub const SWKBD_BUTTON_CONFIRM: SwkbdButton = 2; +pub const SWKBD_BUTTON_NONE: SwkbdButton = 3; +pub type SwkbdButton = u32; +pub const SWKBD_PASSWORD_NONE: SwkbdPasswordMode = 0; +pub const SWKBD_PASSWORD_HIDE: SwkbdPasswordMode = 1; +pub const SWKBD_PASSWORD_HIDE_DELAY: SwkbdPasswordMode = 2; +pub type SwkbdPasswordMode = u32; +pub const SWKBD_FILTER_DIGITS: _bindgen_ty_28 = 1; +pub const SWKBD_FILTER_AT: _bindgen_ty_28 = 2; +pub const SWKBD_FILTER_PERCENT: _bindgen_ty_28 = 4; +pub const SWKBD_FILTER_BACKSLASH: _bindgen_ty_28 = 8; +pub const SWKBD_FILTER_PROFANITY: _bindgen_ty_28 = 16; +pub const SWKBD_FILTER_CALLBACK: _bindgen_ty_28 = 32; +pub type _bindgen_ty_28 = u32; +pub const SWKBD_PARENTAL: _bindgen_ty_29 = 1; +pub const SWKBD_DARKEN_TOP_SCREEN: _bindgen_ty_29 = 2; +pub const SWKBD_PREDICTIVE_INPUT: _bindgen_ty_29 = 4; +pub const SWKBD_MULTILINE: _bindgen_ty_29 = 8; +pub const SWKBD_FIXED_WIDTH: _bindgen_ty_29 = 16; +pub const SWKBD_ALLOW_HOME: _bindgen_ty_29 = 32; +pub const SWKBD_ALLOW_RESET: _bindgen_ty_29 = 64; +pub const SWKBD_ALLOW_POWER: _bindgen_ty_29 = 128; +pub const SWKBD_DEFAULT_QWERTY: _bindgen_ty_29 = 512; +pub type _bindgen_ty_29 = u32; +pub const SWKBD_CALLBACK_OK: SwkbdCallbackResult = 0; +pub const SWKBD_CALLBACK_CLOSE: SwkbdCallbackResult = 1; +pub const SWKBD_CALLBACK_CONTINUE: SwkbdCallbackResult = 2; +pub type SwkbdCallbackResult = u32; +pub const SWKBD_NONE: SwkbdResult = -1; +pub const SWKBD_INVALID_INPUT: SwkbdResult = -2; +pub const SWKBD_OUTOFMEM: SwkbdResult = -3; +pub const SWKBD_D0_CLICK: SwkbdResult = 0; +pub const SWKBD_D1_CLICK0: SwkbdResult = 1; +pub const SWKBD_D1_CLICK1: SwkbdResult = 2; +pub const SWKBD_D2_CLICK0: SwkbdResult = 3; +pub const SWKBD_D2_CLICK1: SwkbdResult = 4; +pub const SWKBD_D2_CLICK2: SwkbdResult = 5; +pub const SWKBD_HOMEPRESSED: SwkbdResult = 10; +pub const SWKBD_RESETPRESSED: SwkbdResult = 11; +pub const SWKBD_POWERPRESSED: SwkbdResult = 12; +pub const SWKBD_PARENTAL_OK: SwkbdResult = 20; +pub const SWKBD_PARENTAL_FAIL: SwkbdResult = 21; +pub const SWKBD_BANNED_INPUT: SwkbdResult = 30; +pub type SwkbdResult = i32; +#[repr(C)] +pub struct SwkbdDictWord { + pub reading: [u16; 41usize], + pub word: [u16; 41usize], + pub language: u8, + pub all_languages: bool, +} +pub type SwkbdCallbackFn = ::core::option::Option< + unsafe extern "C" fn( + user: *mut ::libc::c_void, + ppMessage: *mut *const ::libc::c_char, + text: *const ::libc::c_char, + textlen: usize, + ) -> SwkbdCallbackResult, +>; +#[repr(C)] +pub struct SwkbdStatusData { + pub data: [u32; 17usize], +} +#[repr(C)] +pub struct SwkbdLearningData { + pub data: [u32; 10523usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SwkbdExtra { + pub initial_text: *const ::libc::c_char, + pub dict: *const SwkbdDictWord, + pub status_data: *mut SwkbdStatusData, + pub learning_data: *mut SwkbdLearningData, + pub callback: SwkbdCallbackFn, + pub callback_user: *mut ::libc::c_void, +} +#[repr(C)] +pub struct SwkbdState { + pub type_: ::libc::c_int, + pub num_buttons_m1: ::libc::c_int, + pub valid_input: ::libc::c_int, + pub password_mode: ::libc::c_int, + pub is_parental_screen: ::libc::c_int, + pub darken_top_screen: ::libc::c_int, + pub filter_flags: u32, + pub save_state_flags: u32, + pub max_text_len: u16, + pub dict_word_count: u16, + pub max_digits: u16, + pub button_text: [[u16; 17usize]; 3usize], + pub numpad_keys: [u16; 2usize], + pub hint_text: [u16; 65usize], + pub predictive_input: bool, + pub multiline: bool, + pub fixed_width: bool, + pub allow_home: bool, + pub allow_reset: bool, + pub allow_power: bool, + pub unknown: bool, + pub default_qwerty: bool, + pub button_submits_text: [bool; 4usize], + pub language: u16, + pub initial_text_offset: ::libc::c_int, + pub dict_offset: ::libc::c_int, + pub initial_status_offset: ::libc::c_int, + pub initial_learning_offset: ::libc::c_int, + pub shared_memory_size: usize, + pub version: u32, + pub result: SwkbdResult, + pub status_offset: ::libc::c_int, + pub learning_offset: ::libc::c_int, + pub text_offset: ::libc::c_int, + pub text_length: u16, + pub callback_result: ::libc::c_int, + pub callback_msg: [u16; 257usize], + pub skip_at_check: bool, + pub __bindgen_anon_1: SwkbdState__bindgen_ty_1, +} +#[repr(C)] +pub struct SwkbdState__bindgen_ty_1 { + pub reserved: __BindgenUnionField<[u8; 171usize]>, + pub extra: __BindgenUnionField, + pub bindgen_union_field: [u32; 43usize], +} +extern "C" { + pub fn swkbdInit( + swkbd: *mut SwkbdState, + type_: SwkbdType, + numButtons: ::libc::c_int, + maxTextLength: ::libc::c_int, + ); +} +extern "C" { + pub fn swkbdSetFeatures(swkbd: *mut SwkbdState, features: u32); +} +extern "C" { + pub fn swkbdSetHintText(swkbd: *mut SwkbdState, text: *const ::libc::c_char); +} +extern "C" { + pub fn swkbdSetButton( + swkbd: *mut SwkbdState, + button: SwkbdButton, + text: *const ::libc::c_char, + submit: bool, + ); +} +extern "C" { + pub fn swkbdSetInitialText(swkbd: *mut SwkbdState, text: *const ::libc::c_char); +} +extern "C" { + pub fn swkbdSetDictWord( + word: *mut SwkbdDictWord, + reading: *const ::libc::c_char, + text: *const ::libc::c_char, + ); +} +extern "C" { + pub fn swkbdSetDictionary( + swkbd: *mut SwkbdState, + dict: *const SwkbdDictWord, + wordCount: ::libc::c_int, + ); +} +extern "C" { + pub fn swkbdSetStatusData( + swkbd: *mut SwkbdState, + data: *mut SwkbdStatusData, + in_: bool, + out: bool, + ); +} +extern "C" { + pub fn swkbdSetLearningData( + swkbd: *mut SwkbdState, + data: *mut SwkbdLearningData, + in_: bool, + out: bool, + ); +} +extern "C" { + pub fn swkbdSetFilterCallback( + swkbd: *mut SwkbdState, + callback: SwkbdCallbackFn, + user: *mut ::libc::c_void, + ); +} +extern "C" { + pub fn swkbdInputText( + swkbd: *mut SwkbdState, + buf: *mut ::libc::c_char, + bufsize: usize, + ) -> SwkbdButton; +} +pub const ERROR_LANGUAGE_FLAG: _bindgen_ty_30 = 256; +pub const ERROR_WORD_WRAP_FLAG: _bindgen_ty_30 = 512; +pub type _bindgen_ty_30 = u32; +pub const ERROR_CODE: errorType = 0; +pub const ERROR_TEXT: errorType = 1; +pub const ERROR_EULA: errorType = 2; +pub const ERROR_TYPE_EULA_FIRST_BOOT: errorType = 3; +pub const ERROR_TYPE_EULA_DRAW_ONLY: errorType = 4; +pub const ERROR_TYPE_AGREE: errorType = 5; +pub const ERROR_CODE_LANGUAGE: errorType = 256; +pub const ERROR_TEXT_LANGUAGE: errorType = 257; +pub const ERROR_EULA_LANGUAGE: errorType = 258; +pub const ERROR_TEXT_WORD_WRAP: errorType = 513; +pub const ERROR_TEXT_LANGUAGE_WORD_WRAP: errorType = 769; +pub type errorType = u32; +pub const ERROR_NORMAL: errorScreenFlag = 0; +pub const ERROR_STEREO: errorScreenFlag = 1; +pub type errorScreenFlag = u32; +pub const ERROR_UNKNOWN: errorReturnCode = -1; +pub const ERROR_NONE: errorReturnCode = 0; +pub const ERROR_SUCCESS: errorReturnCode = 1; +pub const ERROR_NOT_SUPPORTED: errorReturnCode = 2; +pub const ERROR_HOME_BUTTON: errorReturnCode = 10; +pub const ERROR_SOFTWARE_RESET: errorReturnCode = 11; +pub const ERROR_POWER_BUTTON: errorReturnCode = 12; +pub type errorReturnCode = i32; +#[repr(C)] +pub struct errorConf { + pub type_: errorType, + pub errorCode: ::libc::c_int, + pub upperScreenFlag: errorScreenFlag, + pub useLanguage: u16, + pub Text: [u16; 1900usize], + pub homeButton: bool, + pub softwareReset: bool, + pub appJump: bool, + pub returnCode: errorReturnCode, + pub eulaVersion: u16, +} +extern "C" { + pub fn errorInit(err: *mut errorConf, type_: errorType, lang: CFG_Language); +} +extern "C" { + pub fn errorCode(err: *mut errorConf, error: ::libc::c_int); +} +extern "C" { + pub fn errorText(err: *mut errorConf, text: *const ::libc::c_char); +} +extern "C" { + pub fn errorDisp(err: *mut errorConf); +} +#[repr(C)] +pub struct MiiSelectorConf { + pub enable_cancel_button: ::libc::c_char, + pub enable_selecting_guests: ::libc::c_char, + pub show_on_top_screen: ::libc::c_char, + pub _unk0x3: [::libc::c_char; 5usize], + pub title: [u16; 64usize], + pub _unk0x88: [::libc::c_char; 4usize], + pub show_guest_page: ::libc::c_char, + pub _unk0x8D: [::libc::c_char; 3usize], + pub initial_index: u32, + pub mii_guest_whitelist: [::libc::c_char; 6usize], + pub mii_whitelist: [::libc::c_char; 100usize], + pub _unk0xFE: u16, + pub magic: u32, +} +#[repr(C)] +pub struct MiiSelectorReturn { + pub no_mii_selected: u32, + pub guest_mii_was_selected: u32, + pub guest_mii_index: u32, + pub mii: [::libc::c_char; 92usize], + pub _pad0x68: u16, + pub checksum: u16, + pub guest_mii_name: [u16; 12usize], +} +extern "C" { + pub fn miiSelectorLaunch( + conf: *const MiiSelectorConf, + returnbuf: *mut MiiSelectorReturn, + ) -> Result; +} +extern "C" { + pub fn miiSelectorChecksumIsValid(returnbuf: *const MiiSelectorReturn) -> bool; +} +#[repr(C)] +#[repr(align(8))] +pub struct sdmc_dir_t { + pub magic: u32, + pub fd: Handle, + pub index: isize, + pub size: usize, + pub entry_data: [FS_DirectoryEntry; 32usize], +} +extern "C" { + pub fn sdmcInit() -> Result; +} +extern "C" { + pub fn sdmcWriteSafe(enable: bool); +} +extern "C" { + pub fn sdmcExit() -> Result; +} +extern "C" { + pub fn sdmc_getmtime(name: *const ::libc::c_char, mtime: *mut u64) -> Result; +} +#[repr(C)] +pub struct romfs_header { + pub headerSize: u32, + pub dirHashTableOff: u32, + pub dirHashTableSize: u32, + pub dirTableOff: u32, + pub dirTableSize: u32, + pub fileHashTableOff: u32, + pub fileHashTableSize: u32, + pub fileTableOff: u32, + pub fileTableSize: u32, + pub fileDataOff: u32, +} +#[repr(C)] +pub struct romfs_dir { + pub parent: u32, + pub sibling: u32, + pub childDir: u32, + pub childFile: u32, + pub nextHash: u32, + pub nameLen: u32, + pub name: __IncompleteArrayField, +} +#[repr(C)] +pub struct romfs_file { + pub parent: u32, + pub sibling: u32, + pub dataOff: u64, + pub dataSize: u64, + pub nextHash: u32, + pub nameLen: u32, + pub name: __IncompleteArrayField, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct romfs_mount { + _unused: [u8; 0], +} +extern "C" { + pub fn romfsMount(mount: *mut *mut romfs_mount) -> Result; +} +extern "C" { + pub fn romfsMountFromFile(file: Handle, offset: u32, mount: *mut *mut romfs_mount) -> Result; +} +extern "C" { + pub fn romfsBind(mount: *mut romfs_mount) -> Result; +} +extern "C" { + pub fn romfsUnmount(mount: *mut romfs_mount) -> Result; +} +#[repr(C)] +pub struct charWidthInfo_s { + pub left: s8, + pub glyphWidth: u8, + pub charWidth: u8, +} +#[repr(C)] +pub struct TGLP_s { + pub cellWidth: u8, + pub cellHeight: u8, + pub baselinePos: u8, + pub maxCharWidth: u8, + pub sheetSize: u32, + pub nSheets: u16, + pub sheetFmt: u16, + pub nRows: u16, + pub nLines: u16, + pub sheetWidth: u16, + pub sheetHeight: u16, + pub sheetData: *mut u8, +} +pub type CWDH_s = tag_CWDH_s; +#[repr(C)] +pub struct tag_CWDH_s { + pub startIndex: u16, + pub endIndex: u16, + pub next: *mut CWDH_s, + pub widths: __IncompleteArrayField, +} +pub const CMAP_TYPE_DIRECT: _bindgen_ty_31 = 0; +pub const CMAP_TYPE_TABLE: _bindgen_ty_31 = 1; +pub const CMAP_TYPE_SCAN: _bindgen_ty_31 = 2; +pub type _bindgen_ty_31 = u32; +pub type CMAP_s = tag_CMAP_s; +#[repr(C)] +pub struct tag_CMAP_s { + pub codeBegin: u16, + pub codeEnd: u16, + pub mappingMethod: u16, + pub reserved: u16, + pub next: *mut CMAP_s, + pub __bindgen_anon_1: tag_CMAP_s__bindgen_ty_1, +} +#[repr(C)] +pub struct tag_CMAP_s__bindgen_ty_1 { + pub indexOffset: __BindgenUnionField, + pub indexTable: __BindgenUnionField<[u16; 0usize]>, + pub __bindgen_anon_1: __BindgenUnionField, + pub bindgen_union_field: u16, +} +#[repr(C)] +pub struct tag_CMAP_s__bindgen_ty_1__bindgen_ty_1 { + pub nScanEntries: u16, + pub scanEntries: __IncompleteArrayField, +} +#[repr(C)] +pub struct tag_CMAP_s__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 { + pub code: u16, + pub glyphIndex: u16, +} +#[repr(C)] +pub struct FINF_s { + pub signature: u32, + pub sectionSize: u32, + pub fontType: u8, + pub lineFeed: u8, + pub alterCharIndex: u16, + pub defaultWidth: charWidthInfo_s, + pub encoding: u8, + pub tglp: *mut TGLP_s, + pub cwdh: *mut CWDH_s, + pub cmap: *mut CMAP_s, + pub height: u8, + pub width: u8, + pub ascent: u8, + pub padding: u8, +} +#[repr(C)] +pub struct CFNT_s { + pub signature: u32, + pub endianness: u16, + pub headerSize: u16, + pub version: u32, + pub fileSize: u32, + pub nBlocks: u32, + pub finf: FINF_s, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct fontGlyphPos_s { + pub sheetIndex: ::libc::c_int, + pub xOffset: f32, + pub xAdvance: f32, + pub width: f32, + pub texcoord: fontGlyphPos_s__bindgen_ty_1, + pub vtxcoord: fontGlyphPos_s__bindgen_ty_2, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct fontGlyphPos_s__bindgen_ty_1 { + pub left: f32, + pub top: f32, + pub right: f32, + pub bottom: f32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct fontGlyphPos_s__bindgen_ty_2 { + pub left: f32, + pub top: f32, + pub right: f32, + pub bottom: f32, +} +pub const GLYPH_POS_CALC_VTXCOORD: _bindgen_ty_32 = 1; +pub const GLYPH_POS_AT_BASELINE: _bindgen_ty_32 = 2; +pub const GLYPH_POS_Y_POINTS_UP: _bindgen_ty_32 = 4; +pub type _bindgen_ty_32 = u32; +extern "C" { + pub fn fontEnsureMapped() -> Result; +} +extern "C" { + pub fn fontGlyphIndexFromCodePoint(codePoint: u32) -> ::libc::c_int; +} +extern "C" { + pub fn fontGetCharWidthInfo(glyphIndex: ::libc::c_int) -> *mut charWidthInfo_s; +} +extern "C" { + pub fn fontCalcGlyphPos( + out: *mut fontGlyphPos_s, + glyphIndex: ::libc::c_int, + flags: u32, + scaleX: f32, + scaleY: f32, + ); +} +pub type C3D_IVec = u32; +#[repr(C)] +#[derive(Copy, Clone)] +pub union C3D_FVec { + pub __bindgen_anon_1: C3D_FVec__bindgen_ty_1, + pub __bindgen_anon_2: C3D_FVec__bindgen_ty_2, + pub c: [f32; 4usize], + _bindgen_union_align: [u32; 4usize], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct C3D_FVec__bindgen_ty_1 { + pub w: f32, + pub z: f32, + pub y: f32, + pub x: f32, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct C3D_FVec__bindgen_ty_2 { + pub r: f32, + pub k: f32, + pub j: f32, + pub i: f32, +} +pub type C3D_FQuat = C3D_FVec; +#[repr(C)] +#[derive(Copy, Clone)] +pub union C3D_Mtx { + pub r: [C3D_FVec; 4usize], + pub m: [f32; 16usize], + _bindgen_union_align: [u32; 16usize], +} +extern "C" { + pub fn atan(arg1: f64) -> f64; +} +extern "C" { + pub fn cos(arg1: f64) -> f64; +} +extern "C" { + pub fn sin(arg1: f64) -> f64; +} +extern "C" { + pub fn tan(arg1: f64) -> f64; +} +extern "C" { + pub fn tanh(arg1: f64) -> f64; +} +extern "C" { + pub fn frexp(arg1: f64, arg2: *mut ::libc::c_int) -> f64; +} +extern "C" { + pub fn modf(arg1: f64, arg2: *mut f64) -> f64; +} +extern "C" { + pub fn ceil(arg1: f64) -> f64; +} +extern "C" { + pub fn fabs(arg1: f64) -> f64; +} +extern "C" { + pub fn floor(arg1: f64) -> f64; +} +extern "C" { + pub fn acos(arg1: f64) -> f64; +} +extern "C" { + pub fn asin(arg1: f64) -> f64; +} +extern "C" { + pub fn atan2(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn cosh(arg1: f64) -> f64; +} +extern "C" { + pub fn sinh(arg1: f64) -> f64; +} +extern "C" { + pub fn exp(arg1: f64) -> f64; +} +extern "C" { + pub fn ldexp(arg1: f64, arg2: ::libc::c_int) -> f64; +} +extern "C" { + pub fn log(arg1: f64) -> f64; +} +extern "C" { + pub fn log10(arg1: f64) -> f64; +} +extern "C" { + pub fn pow(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn sqrt(arg1: f64) -> f64; +} +extern "C" { + pub fn fmod(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn finite(arg1: f64) -> ::libc::c_int; +} +extern "C" { + pub fn finitef(arg1: f32) -> ::libc::c_int; +} +extern "C" { + pub fn finitel(arg1: f64) -> ::libc::c_int; +} +extern "C" { + pub fn isinff(arg1: f32) -> ::libc::c_int; +} +extern "C" { + pub fn isnanf(arg1: f32) -> ::libc::c_int; +} +extern "C" { + pub fn isinf(arg1: f64) -> ::libc::c_int; +} +extern "C" { + pub fn isnan(arg1: f64) -> ::libc::c_int; +} +pub type float_t = f32; +pub type double_t = f64; +extern "C" { + pub fn __isinff(x: f32) -> ::libc::c_int; +} +extern "C" { + pub fn __isinfd(x: f64) -> ::libc::c_int; +} +extern "C" { + pub fn __isnanf(x: f32) -> ::libc::c_int; +} +extern "C" { + pub fn __isnand(x: f64) -> ::libc::c_int; +} +extern "C" { + pub fn __fpclassifyf(x: f32) -> ::libc::c_int; +} +extern "C" { + pub fn __fpclassifyd(x: f64) -> ::libc::c_int; +} +extern "C" { + pub fn __signbitf(x: f32) -> ::libc::c_int; +} +extern "C" { + pub fn __signbitd(x: f64) -> ::libc::c_int; +} +extern "C" { + pub fn infinity() -> f64; +} +extern "C" { + pub fn nan(arg1: *const ::libc::c_char) -> f64; +} +extern "C" { + pub fn copysign(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn logb(arg1: f64) -> f64; +} +extern "C" { + pub fn ilogb(arg1: f64) -> ::libc::c_int; +} +extern "C" { + pub fn asinh(arg1: f64) -> f64; +} +extern "C" { + pub fn cbrt(arg1: f64) -> f64; +} +extern "C" { + pub fn nextafter(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn rint(arg1: f64) -> f64; +} +extern "C" { + pub fn scalbn(arg1: f64, arg2: ::libc::c_int) -> f64; +} +extern "C" { + pub fn exp2(arg1: f64) -> f64; +} +extern "C" { + pub fn scalbln(arg1: f64, arg2: ::libc::c_long) -> f64; +} +extern "C" { + pub fn tgamma(arg1: f64) -> f64; +} +extern "C" { + pub fn nearbyint(arg1: f64) -> f64; +} +extern "C" { + pub fn lrint(arg1: f64) -> ::libc::c_long; +} +extern "C" { + pub fn llrint(arg1: f64) -> ::libc::c_longlong; +} +extern "C" { + pub fn round(arg1: f64) -> f64; +} +extern "C" { + pub fn lround(arg1: f64) -> ::libc::c_long; +} +extern "C" { + pub fn llround(arg1: f64) -> ::libc::c_longlong; +} +extern "C" { + pub fn trunc(arg1: f64) -> f64; +} +extern "C" { + pub fn remquo(arg1: f64, arg2: f64, arg3: *mut ::libc::c_int) -> f64; +} +extern "C" { + pub fn fdim(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn fmax(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn fmin(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn fma(arg1: f64, arg2: f64, arg3: f64) -> f64; +} +extern "C" { + pub fn log1p(arg1: f64) -> f64; +} +extern "C" { + pub fn expm1(arg1: f64) -> f64; +} +extern "C" { + pub fn acosh(arg1: f64) -> f64; +} +extern "C" { + pub fn atanh(arg1: f64) -> f64; +} +extern "C" { + pub fn remainder(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn gamma(arg1: f64) -> f64; +} +extern "C" { + pub fn lgamma(arg1: f64) -> f64; +} +extern "C" { + pub fn erf(arg1: f64) -> f64; +} +extern "C" { + pub fn erfc(arg1: f64) -> f64; +} +extern "C" { + pub fn log2(arg1: f64) -> f64; +} +extern "C" { + pub fn hypot(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn atanf(arg1: f32) -> f32; +} +extern "C" { + pub fn cosf(arg1: f32) -> f32; +} +extern "C" { + pub fn sinf(arg1: f32) -> f32; +} +extern "C" { + pub fn tanf(arg1: f32) -> f32; +} +extern "C" { + pub fn tanhf(arg1: f32) -> f32; +} +extern "C" { + pub fn frexpf(arg1: f32, arg2: *mut ::libc::c_int) -> f32; +} +extern "C" { + pub fn modff(arg1: f32, arg2: *mut f32) -> f32; +} +extern "C" { + pub fn ceilf(arg1: f32) -> f32; +} +extern "C" { + pub fn fabsf(arg1: f32) -> f32; +} +extern "C" { + pub fn floorf(arg1: f32) -> f32; +} +extern "C" { + pub fn acosf(arg1: f32) -> f32; +} +extern "C" { + pub fn asinf(arg1: f32) -> f32; +} +extern "C" { + pub fn atan2f(arg1: f32, arg2: f32) -> f32; +} +extern "C" { + pub fn coshf(arg1: f32) -> f32; +} +extern "C" { + pub fn sinhf(arg1: f32) -> f32; +} +extern "C" { + pub fn expf(arg1: f32) -> f32; +} +extern "C" { + pub fn ldexpf(arg1: f32, arg2: ::libc::c_int) -> f32; +} +extern "C" { + pub fn logf(arg1: f32) -> f32; +} +extern "C" { + pub fn log10f(arg1: f32) -> f32; +} +extern "C" { + pub fn powf(arg1: f32, arg2: f32) -> f32; +} +extern "C" { + pub fn sqrtf(arg1: f32) -> f32; +} +extern "C" { + pub fn fmodf(arg1: f32, arg2: f32) -> f32; +} +extern "C" { + pub fn exp2f(arg1: f32) -> f32; +} +extern "C" { + pub fn scalblnf(arg1: f32, arg2: ::libc::c_long) -> f32; +} +extern "C" { + pub fn tgammaf(arg1: f32) -> f32; +} +extern "C" { + pub fn nearbyintf(arg1: f32) -> f32; +} +extern "C" { + pub fn lrintf(arg1: f32) -> ::libc::c_long; +} +extern "C" { + pub fn llrintf(arg1: f32) -> ::libc::c_longlong; +} +extern "C" { + pub fn roundf(arg1: f32) -> f32; +} +extern "C" { + pub fn lroundf(arg1: f32) -> ::libc::c_long; +} +extern "C" { + pub fn llroundf(arg1: f32) -> ::libc::c_longlong; +} +extern "C" { + pub fn truncf(arg1: f32) -> f32; +} +extern "C" { + pub fn remquof(arg1: f32, arg2: f32, arg3: *mut ::libc::c_int) -> f32; +} +extern "C" { + pub fn fdimf(arg1: f32, arg2: f32) -> f32; +} +extern "C" { + pub fn fmaxf(arg1: f32, arg2: f32) -> f32; +} +extern "C" { + pub fn fminf(arg1: f32, arg2: f32) -> f32; +} +extern "C" { + pub fn fmaf(arg1: f32, arg2: f32, arg3: f32) -> f32; +} +extern "C" { + pub fn infinityf() -> f32; +} +extern "C" { + pub fn nanf(arg1: *const ::libc::c_char) -> f32; +} +extern "C" { + pub fn copysignf(arg1: f32, arg2: f32) -> f32; +} +extern "C" { + pub fn logbf(arg1: f32) -> f32; +} +extern "C" { + pub fn ilogbf(arg1: f32) -> ::libc::c_int; +} +extern "C" { + pub fn asinhf(arg1: f32) -> f32; +} +extern "C" { + pub fn cbrtf(arg1: f32) -> f32; +} +extern "C" { + pub fn nextafterf(arg1: f32, arg2: f32) -> f32; +} +extern "C" { + pub fn rintf(arg1: f32) -> f32; +} +extern "C" { + pub fn scalbnf(arg1: f32, arg2: ::libc::c_int) -> f32; +} +extern "C" { + pub fn log1pf(arg1: f32) -> f32; +} +extern "C" { + pub fn expm1f(arg1: f32) -> f32; +} +extern "C" { + pub fn acoshf(arg1: f32) -> f32; +} +extern "C" { + pub fn atanhf(arg1: f32) -> f32; +} +extern "C" { + pub fn remainderf(arg1: f32, arg2: f32) -> f32; +} +extern "C" { + pub fn gammaf(arg1: f32) -> f32; +} +extern "C" { + pub fn lgammaf(arg1: f32) -> f32; +} +extern "C" { + pub fn erff(arg1: f32) -> f32; +} +extern "C" { + pub fn erfcf(arg1: f32) -> f32; +} +extern "C" { + pub fn log2f(arg1: f32) -> f32; +} +extern "C" { + pub fn hypotf(arg1: f32, arg2: f32) -> f32; +} +extern "C" { + pub fn atanl(arg1: f64) -> f64; +} +extern "C" { + pub fn cosl(arg1: f64) -> f64; +} +extern "C" { + pub fn sinl(arg1: f64) -> f64; +} +extern "C" { + pub fn tanl(arg1: f64) -> f64; +} +extern "C" { + pub fn tanhl(arg1: f64) -> f64; +} +extern "C" { + pub fn frexpl(arg1: f64, arg2: *mut ::libc::c_int) -> f64; +} +extern "C" { + pub fn modfl(arg1: f64, arg2: *mut f64) -> f64; +} +extern "C" { + pub fn ceill(arg1: f64) -> f64; +} +extern "C" { + pub fn fabsl(arg1: f64) -> f64; +} +extern "C" { + pub fn floorl(arg1: f64) -> f64; +} +extern "C" { + pub fn log1pl(arg1: f64) -> f64; +} +extern "C" { + pub fn expm1l(arg1: f64) -> f64; +} +extern "C" { + pub fn acosl(arg1: f64) -> f64; +} +extern "C" { + pub fn asinl(arg1: f64) -> f64; +} +extern "C" { + pub fn atan2l(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn coshl(arg1: f64) -> f64; +} +extern "C" { + pub fn sinhl(arg1: f64) -> f64; +} +extern "C" { + pub fn expl(arg1: f64) -> f64; +} +extern "C" { + pub fn ldexpl(arg1: f64, arg2: ::libc::c_int) -> f64; +} +extern "C" { + pub fn logl(arg1: f64) -> f64; +} +extern "C" { + pub fn log10l(arg1: f64) -> f64; +} +extern "C" { + pub fn powl(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn sqrtl(arg1: f64) -> f64; +} +extern "C" { + pub fn fmodl(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn hypotl(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn copysignl(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn nanl(arg1: *const ::libc::c_char) -> f64; +} +extern "C" { + pub fn ilogbl(arg1: f64) -> ::libc::c_int; +} +extern "C" { + pub fn asinhl(arg1: f64) -> f64; +} +extern "C" { + pub fn cbrtl(arg1: f64) -> f64; +} +extern "C" { + pub fn nextafterl(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn nexttowardf(arg1: f32, arg2: f64) -> f32; +} +extern "C" { + pub fn nexttoward(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn nexttowardl(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn logbl(arg1: f64) -> f64; +} +extern "C" { + pub fn log2l(arg1: f64) -> f64; +} +extern "C" { + pub fn rintl(arg1: f64) -> f64; +} +extern "C" { + pub fn scalbnl(arg1: f64, arg2: ::libc::c_int) -> f64; +} +extern "C" { + pub fn exp2l(arg1: f64) -> f64; +} +extern "C" { + pub fn scalblnl(arg1: f64, arg2: ::libc::c_long) -> f64; +} +extern "C" { + pub fn tgammal(arg1: f64) -> f64; +} +extern "C" { + pub fn nearbyintl(arg1: f64) -> f64; +} +extern "C" { + pub fn lrintl(arg1: f64) -> ::libc::c_long; +} +extern "C" { + pub fn llrintl(arg1: f64) -> ::libc::c_longlong; +} +extern "C" { + pub fn roundl(arg1: f64) -> f64; +} +extern "C" { + pub fn lroundl(arg1: f64) -> ::libc::c_long; +} +extern "C" { + pub fn llroundl(arg1: f64) -> ::libc::c_longlong; +} +extern "C" { + pub fn truncl(arg1: f64) -> f64; +} +extern "C" { + pub fn remquol(arg1: f64, arg2: f64, arg3: *mut ::libc::c_int) -> f64; +} +extern "C" { + pub fn fdiml(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn fmaxl(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn fminl(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn fmal(arg1: f64, arg2: f64, arg3: f64) -> f64; +} +extern "C" { + pub fn acoshl(arg1: f64) -> f64; +} +extern "C" { + pub fn atanhl(arg1: f64) -> f64; +} +extern "C" { + pub fn remainderl(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn lgammal(arg1: f64) -> f64; +} +extern "C" { + pub fn erfl(arg1: f64) -> f64; +} +extern "C" { + pub fn erfcl(arg1: f64) -> f64; +} +extern "C" { + pub fn drem(arg1: f64, arg2: f64) -> f64; +} +extern "C" { + pub fn dremf(arg1: f32, arg2: f32) -> f32; +} +extern "C" { + pub fn gamma_r(arg1: f64, arg2: *mut ::libc::c_int) -> f64; +} +extern "C" { + pub fn lgamma_r(arg1: f64, arg2: *mut ::libc::c_int) -> f64; +} +extern "C" { + pub fn gammaf_r(arg1: f32, arg2: *mut ::libc::c_int) -> f32; +} +extern "C" { + pub fn lgammaf_r(arg1: f32, arg2: *mut ::libc::c_int) -> f32; +} +extern "C" { + pub fn y0(arg1: f64) -> f64; +} +extern "C" { + pub fn y1(arg1: f64) -> f64; +} +extern "C" { + pub fn yn(arg1: ::libc::c_int, arg2: f64) -> f64; +} +extern "C" { + pub fn j0(arg1: f64) -> f64; +} +extern "C" { + pub fn j1(arg1: f64) -> f64; +} +extern "C" { + pub fn jn(arg1: ::libc::c_int, arg2: f64) -> f64; +} +extern "C" { + pub fn y0f(arg1: f32) -> f32; +} +extern "C" { + pub fn y1f(arg1: f32) -> f32; +} +extern "C" { + pub fn ynf(arg1: ::libc::c_int, arg2: f32) -> f32; +} +extern "C" { + pub fn j0f(arg1: f32) -> f32; +} +extern "C" { + pub fn j1f(arg1: f32) -> f32; +} +extern "C" { + pub fn jnf(arg1: ::libc::c_int, arg2: f32) -> f32; +} +extern "C" { + pub fn __signgam() -> *mut ::libc::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct exception { + pub type_: ::libc::c_int, + pub name: *mut ::libc::c_char, + pub arg1: f64, + pub arg2: f64, + pub retval: f64, + pub err: ::libc::c_int, + pub __bindgen_padding_0: u32, +} +extern "C" { + pub fn matherr(e: *mut exception) -> ::libc::c_int; +} +pub const __fdlibm_ieee: __fdlibm_version = -1; +pub const __fdlibm_svid: __fdlibm_version = 0; +pub const __fdlibm_xopen: __fdlibm_version = 1; +pub const __fdlibm_posix: __fdlibm_version = 2; +pub type __fdlibm_version = i32; +extern "C" { + pub static mut __fdlib_version: __fdlibm_version; +} +extern "C" { + pub fn bcmp( + arg1: *const ::libc::c_void, + arg2: *const ::libc::c_void, + arg3: usize, + ) -> ::libc::c_int; +} +extern "C" { + pub fn bcopy(arg1: *const ::libc::c_void, arg2: *mut ::libc::c_void, arg3: usize); +} +extern "C" { + pub fn bzero(arg1: *mut ::libc::c_void, arg2: ::libc::c_uint); +} +extern "C" { + pub fn explicit_bzero(arg1: *mut ::libc::c_void, arg2: usize); +} +extern "C" { + pub fn ffs(arg1: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn ffsl(arg1: ::libc::c_long) -> ::libc::c_int; +} +extern "C" { + pub fn ffsll(arg1: ::libc::c_longlong) -> ::libc::c_int; +} +extern "C" { + pub fn fls(arg1: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn flsl(arg1: ::libc::c_long) -> ::libc::c_int; +} +extern "C" { + pub fn flsll(arg1: ::libc::c_longlong) -> ::libc::c_int; +} +extern "C" { + pub fn index(arg1: *const ::libc::c_char, arg2: ::libc::c_int) -> *mut ::libc::c_char; +} +extern "C" { + pub fn rindex(arg1: *const ::libc::c_char, arg2: ::libc::c_int) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strcasecmp(arg1: *const ::libc::c_char, arg2: *const ::libc::c_char) -> ::libc::c_int; +} +extern "C" { + pub fn strncasecmp( + arg1: *const ::libc::c_char, + arg2: *const ::libc::c_char, + arg3: ::libc::c_uint, + ) -> ::libc::c_int; +} +extern "C" { + pub fn strcasecmp_l( + arg1: *const ::libc::c_char, + arg2: *const ::libc::c_char, + arg3: locale_t, + ) -> ::libc::c_int; +} +extern "C" { + pub fn strncasecmp_l( + arg1: *const ::libc::c_char, + arg2: *const ::libc::c_char, + arg3: usize, + arg4: locale_t, + ) -> ::libc::c_int; +} +extern "C" { + pub fn memchr( + arg1: *const ::libc::c_void, + arg2: ::libc::c_int, + arg3: ::libc::c_uint, + ) -> *mut ::libc::c_void; +} +extern "C" { + pub fn memcmp( + arg1: *const ::libc::c_void, + arg2: *const ::libc::c_void, + arg3: ::libc::c_uint, + ) -> ::libc::c_int; +} +extern "C" { + pub fn memcpy( + arg1: *mut ::libc::c_void, + arg2: *const ::libc::c_void, + arg3: ::libc::c_uint, + ) -> *mut ::libc::c_void; +} +extern "C" { + pub fn memmove( + arg1: *mut ::libc::c_void, + arg2: *const ::libc::c_void, + arg3: ::libc::c_uint, + ) -> *mut ::libc::c_void; +} +extern "C" { + pub fn memset( + arg1: *mut ::libc::c_void, + arg2: ::libc::c_int, + arg3: ::libc::c_uint, + ) -> *mut ::libc::c_void; +} +extern "C" { + pub fn strcat(arg1: *mut ::libc::c_char, arg2: *const ::libc::c_char) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strchr(arg1: *const ::libc::c_char, arg2: ::libc::c_int) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strcmp(arg1: *const ::libc::c_char, arg2: *const ::libc::c_char) -> ::libc::c_int; +} +extern "C" { + pub fn strcoll(arg1: *const ::libc::c_char, arg2: *const ::libc::c_char) -> ::libc::c_int; +} +extern "C" { + pub fn strcpy(arg1: *mut ::libc::c_char, arg2: *const ::libc::c_char) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strcspn(arg1: *const ::libc::c_char, arg2: *const ::libc::c_char) -> ::libc::c_uint; +} +extern "C" { + pub fn strerror(arg1: ::libc::c_int) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strlen(arg1: *const ::libc::c_char) -> ::libc::c_uint; +} +extern "C" { + pub fn strncat( + arg1: *mut ::libc::c_char, + arg2: *const ::libc::c_char, + arg3: ::libc::c_uint, + ) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strncmp( + arg1: *const ::libc::c_char, + arg2: *const ::libc::c_char, + arg3: ::libc::c_uint, + ) -> ::libc::c_int; +} +extern "C" { + pub fn strncpy( + arg1: *mut ::libc::c_char, + arg2: *const ::libc::c_char, + arg3: ::libc::c_uint, + ) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strpbrk(arg1: *const ::libc::c_char, arg2: *const ::libc::c_char) + -> *mut ::libc::c_char; +} +extern "C" { + pub fn strrchr(arg1: *const ::libc::c_char, arg2: ::libc::c_int) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strspn(arg1: *const ::libc::c_char, arg2: *const ::libc::c_char) -> ::libc::c_uint; +} +extern "C" { + pub fn strstr(arg1: *const ::libc::c_char, arg2: *const ::libc::c_char) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strtok(arg1: *mut ::libc::c_char, arg2: *const ::libc::c_char) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strxfrm( + arg1: *mut ::libc::c_char, + arg2: *const ::libc::c_char, + arg3: ::libc::c_uint, + ) -> ::libc::c_uint; +} +extern "C" { + pub fn strcoll_l( + arg1: *const ::libc::c_char, + arg2: *const ::libc::c_char, + arg3: locale_t, + ) -> ::libc::c_int; +} +extern "C" { + pub fn strerror_l(arg1: ::libc::c_int, arg2: locale_t) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strxfrm_l( + arg1: *mut ::libc::c_char, + arg2: *const ::libc::c_char, + arg3: usize, + arg4: locale_t, + ) -> usize; +} +extern "C" { + pub fn strtok_r( + arg1: *mut ::libc::c_char, + arg2: *const ::libc::c_char, + arg3: *mut *mut ::libc::c_char, + ) -> *mut ::libc::c_char; +} +extern "C" { + pub fn timingsafe_bcmp( + arg1: *const ::libc::c_void, + arg2: *const ::libc::c_void, + arg3: usize, + ) -> ::libc::c_int; +} +extern "C" { + pub fn timingsafe_memcmp( + arg1: *const ::libc::c_void, + arg2: *const ::libc::c_void, + arg3: usize, + ) -> ::libc::c_int; +} +extern "C" { + pub fn memccpy( + arg1: *mut ::libc::c_void, + arg2: *const ::libc::c_void, + arg3: ::libc::c_int, + arg4: usize, + ) -> *mut ::libc::c_void; +} +extern "C" { + pub fn stpcpy(arg1: *mut ::libc::c_char, arg2: *const ::libc::c_char) -> *mut ::libc::c_char; +} +extern "C" { + pub fn stpncpy( + arg1: *mut ::libc::c_char, + arg2: *const ::libc::c_char, + arg3: ::libc::c_uint, + ) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strdup(arg1: *const ::libc::c_char) -> *mut ::libc::c_char; +} +extern "C" { + pub fn _strdup_r(arg1: *mut _reent, arg2: *const ::libc::c_char) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strndup(arg1: *const ::libc::c_char, arg2: ::libc::c_uint) -> *mut ::libc::c_char; +} +extern "C" { + pub fn _strndup_r( + arg1: *mut _reent, + arg2: *const ::libc::c_char, + arg3: usize, + ) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strerror_r(arg1: ::libc::c_int, arg2: *mut ::libc::c_char, arg3: usize) + -> ::libc::c_int; +} +extern "C" { + pub fn _strerror_r( + arg1: *mut _reent, + arg2: ::libc::c_int, + arg3: ::libc::c_int, + arg4: *mut ::libc::c_int, + ) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strlcat( + arg1: *mut ::libc::c_char, + arg2: *const ::libc::c_char, + arg3: ::libc::c_uint, + ) -> ::libc::c_uint; +} +extern "C" { + pub fn strlcpy( + arg1: *mut ::libc::c_char, + arg2: *const ::libc::c_char, + arg3: ::libc::c_uint, + ) -> ::libc::c_uint; +} +extern "C" { + pub fn strnlen(arg1: *const ::libc::c_char, arg2: usize) -> usize; +} +extern "C" { + pub fn strsep( + arg1: *mut *mut ::libc::c_char, + arg2: *const ::libc::c_char, + ) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strnstr( + arg1: *const ::libc::c_char, + arg2: *const ::libc::c_char, + arg3: usize, + ) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strlwr(arg1: *mut ::libc::c_char) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strupr(arg1: *mut ::libc::c_char) -> *mut ::libc::c_char; +} +extern "C" { + pub fn strsignal(__signo: ::libc::c_int) -> *mut ::libc::c_char; +} +extern "C" { + pub fn Mtx_Transpose(out: *mut C3D_Mtx); +} +extern "C" { + pub fn Mtx_Multiply(out: *mut C3D_Mtx, a: *const C3D_Mtx, b: *const C3D_Mtx); +} +extern "C" { + pub fn Mtx_Inverse(out: *mut C3D_Mtx) -> f32; +} +extern "C" { + pub fn Mtx_MultiplyFVec3(mtx: *const C3D_Mtx, v: C3D_FVec) -> C3D_FVec; +} +extern "C" { + pub fn Mtx_MultiplyFVec4(mtx: *const C3D_Mtx, v: C3D_FVec) -> C3D_FVec; +} +extern "C" { + pub fn Mtx_FromQuat(m: *mut C3D_Mtx, q: C3D_FQuat); +} +extern "C" { + pub fn Mtx_Translate(mtx: *mut C3D_Mtx, x: f32, y: f32, z: f32, bRightSide: bool); +} +extern "C" { + pub fn Mtx_Scale(mtx: *mut C3D_Mtx, x: f32, y: f32, z: f32); +} +extern "C" { + pub fn Mtx_Rotate(mtx: *mut C3D_Mtx, axis: C3D_FVec, angle: f32, bRightSide: bool); +} +extern "C" { + pub fn Mtx_RotateX(mtx: *mut C3D_Mtx, angle: f32, bRightSide: bool); +} +extern "C" { + pub fn Mtx_RotateY(mtx: *mut C3D_Mtx, angle: f32, bRightSide: bool); +} +extern "C" { + pub fn Mtx_RotateZ(mtx: *mut C3D_Mtx, angle: f32, bRightSide: bool); +} +extern "C" { + pub fn Mtx_Ortho( + mtx: *mut C3D_Mtx, + left: f32, + right: f32, + bottom: f32, + top: f32, + near: f32, + far: f32, + isLeftHanded: bool, + ); +} +extern "C" { + pub fn Mtx_Persp( + mtx: *mut C3D_Mtx, + fovy: f32, + aspect: f32, + near: f32, + far: f32, + isLeftHanded: bool, + ); +} +extern "C" { + pub fn Mtx_PerspStereo( + mtx: *mut C3D_Mtx, + fovy: f32, + aspect: f32, + near: f32, + far: f32, + iod: f32, + screen: f32, + isLeftHanded: bool, + ); +} +extern "C" { + pub fn Mtx_OrthoTilt( + mtx: *mut C3D_Mtx, + left: f32, + right: f32, + bottom: f32, + top: f32, + near: f32, + far: f32, + isLeftHanded: bool, + ); +} +extern "C" { + pub fn Mtx_PerspTilt( + mtx: *mut C3D_Mtx, + fovy: f32, + aspect: f32, + near: f32, + far: f32, + isLeftHanded: bool, + ); +} +extern "C" { + pub fn Mtx_PerspStereoTilt( + mtx: *mut C3D_Mtx, + fovy: f32, + aspect: f32, + near: f32, + far: f32, + iod: f32, + screen: f32, + isLeftHanded: bool, + ); +} +extern "C" { + pub fn Mtx_LookAt( + out: *mut C3D_Mtx, + cameraPosition: C3D_FVec, + cameraTarget: C3D_FVec, + cameraUpVector: C3D_FVec, + isLeftHanded: bool, + ); +} +extern "C" { + pub fn Quat_Multiply(lhs: C3D_FQuat, rhs: C3D_FQuat) -> C3D_FQuat; +} +extern "C" { + pub fn Quat_Pow(q: C3D_FQuat, p: f32) -> C3D_FQuat; +} +extern "C" { + pub fn Quat_CrossFVec3(q: C3D_FQuat, v: C3D_FVec) -> C3D_FVec; +} +extern "C" { + pub fn Quat_Rotate(q: C3D_FQuat, axis: C3D_FVec, r: f32, bRightSide: bool) -> C3D_FQuat; +} +extern "C" { + pub fn Quat_RotateX(q: C3D_FQuat, r: f32, bRightSide: bool) -> C3D_FQuat; +} +extern "C" { + pub fn Quat_RotateY(q: C3D_FQuat, r: f32, bRightSide: bool) -> C3D_FQuat; +} +extern "C" { + pub fn Quat_RotateZ(q: C3D_FQuat, r: f32, bRightSide: bool) -> C3D_FQuat; +} +extern "C" { + pub fn Quat_FromMtx(m: *const C3D_Mtx) -> C3D_FQuat; +} +extern "C" { + pub fn Quat_FromPitchYawRoll(pitch: f32, yaw: f32, roll: f32, bRightSide: bool) -> C3D_FQuat; +} +extern "C" { + pub fn Quat_LookAt( + source: C3D_FVec, + target: C3D_FVec, + forwardVector: C3D_FVec, + upVector: C3D_FVec, + ) -> C3D_FQuat; +} +extern "C" { + pub fn Quat_FromAxisAngle(axis: C3D_FVec, angle: f32) -> C3D_FQuat; +} +#[repr(C)] +pub struct C3D_MtxStack { + pub m: [C3D_Mtx; 8usize], + pub pos: ::libc::c_int, + pub unifType: u8, + pub unifPos: u8, + pub unifLen: u8, + pub isDirty: bool, +} +extern "C" { + pub fn MtxStack_Init(stk: *mut C3D_MtxStack); +} +extern "C" { + pub fn MtxStack_Bind( + stk: *mut C3D_MtxStack, + unifType: GPU_SHADER_TYPE, + unifPos: ::libc::c_int, + unifLen: ::libc::c_int, + ); +} +extern "C" { + pub fn MtxStack_Push(stk: *mut C3D_MtxStack) -> *mut C3D_Mtx; +} +extern "C" { + pub fn MtxStack_Pop(stk: *mut C3D_MtxStack) -> *mut C3D_Mtx; +} +extern "C" { + pub fn MtxStack_Update(stk: *mut C3D_MtxStack); +} +extern "C" { + pub static mut C3D_FVUnif: [[C3D_FVec; 96usize]; 2usize]; +} +extern "C" { + pub static mut C3D_IVUnif: [[C3D_IVec; 4usize]; 2usize]; +} +extern "C" { + pub static mut C3D_BoolUnifs: [u16; 2usize]; +} +extern "C" { + pub static mut C3D_FVUnifDirty: [[bool; 96usize]; 2usize]; +} +extern "C" { + pub static mut C3D_IVUnifDirty: [[bool; 4usize]; 2usize]; +} +extern "C" { + pub static mut C3D_BoolUnifsDirty: [bool; 2usize]; +} +extern "C" { + pub fn C3D_UpdateUniforms(type_: GPU_SHADER_TYPE); +} +#[repr(C)] +pub struct C3D_AttrInfo { + pub flags: [u32; 2usize], + pub permutation: u64, + pub attrCount: ::libc::c_int, + pub __bindgen_padding_0: u32, +} +extern "C" { + pub fn AttrInfo_Init(info: *mut C3D_AttrInfo); +} +extern "C" { + pub fn AttrInfo_AddLoader( + info: *mut C3D_AttrInfo, + regId: ::libc::c_int, + format: GPU_FORMATS, + count: ::libc::c_int, + ) -> ::libc::c_int; +} +extern "C" { + pub fn AttrInfo_AddFixed(info: *mut C3D_AttrInfo, regId: ::libc::c_int) -> ::libc::c_int; +} +extern "C" { + pub fn C3D_GetAttrInfo() -> *mut C3D_AttrInfo; +} +extern "C" { + pub fn C3D_SetAttrInfo(info: *mut C3D_AttrInfo); +} +#[repr(C)] +pub struct C3D_BufCfg { + pub offset: u32, + pub flags: [u32; 2usize], +} +#[repr(C)] +pub struct C3D_BufInfo { + pub base_paddr: u32, + pub bufCount: ::libc::c_int, + pub buffers: [C3D_BufCfg; 12usize], +} +extern "C" { + pub fn BufInfo_Init(info: *mut C3D_BufInfo); +} +extern "C" { + pub fn BufInfo_Add( + info: *mut C3D_BufInfo, + data: *const ::libc::c_void, + stride: isize, + attribCount: ::libc::c_int, + permutation: u64, + ) -> ::libc::c_int; +} +extern "C" { + pub fn C3D_GetBufInfo() -> *mut C3D_BufInfo; +} +extern "C" { + pub fn C3D_SetBufInfo(info: *mut C3D_BufInfo); +} +pub const C3D_UNSIGNED_BYTE: _bindgen_ty_33 = 0; +pub const C3D_UNSIGNED_SHORT: _bindgen_ty_33 = 1; +pub type _bindgen_ty_33 = u32; +extern "C" { + pub fn C3D_Init(cmdBufSize: usize) -> bool; +} +extern "C" { + pub fn C3D_FlushAsync(); +} +extern "C" { + pub fn C3D_Fini(); +} +extern "C" { + pub fn C3D_GetCmdBufUsage() -> f32; +} +extern "C" { + pub fn C3D_BindProgram(program: *mut shaderProgram_s); +} +extern "C" { + pub fn C3D_SetViewport(x: u32, y: u32, w: u32, h: u32); +} +extern "C" { + pub fn C3D_SetScissor(mode: GPU_SCISSORMODE, left: u32, top: u32, right: u32, bottom: u32); +} +extern "C" { + pub fn C3D_DrawArrays(primitive: GPU_Primitive_t, first: ::libc::c_int, size: ::libc::c_int); +} +extern "C" { + pub fn C3D_DrawElements( + primitive: GPU_Primitive_t, + count: ::libc::c_int, + type_: ::libc::c_int, + indices: *const ::libc::c_void, + ); +} +extern "C" { + pub fn C3D_ImmDrawBegin(primitive: GPU_Primitive_t); +} +extern "C" { + pub fn C3D_ImmSendAttrib(x: f32, y: f32, z: f32, w: f32); +} +extern "C" { + pub fn C3D_ImmDrawEnd(); +} +extern "C" { + pub fn C3D_FixedAttribGetWritePtr(id: ::libc::c_int) -> *mut C3D_FVec; +} +#[repr(C)] +pub struct C3D_TexEnv { + pub srcRgb: u16, + pub srcAlpha: u16, + pub __bindgen_anon_1: C3D_TexEnv__bindgen_ty_1, + pub funcRgb: u16, + pub funcAlpha: u16, + pub color: u32, + pub scaleRgb: u16, + pub scaleAlpha: u16, +} +#[repr(C)] +pub struct C3D_TexEnv__bindgen_ty_1 { + pub opAll: __BindgenUnionField, + pub __bindgen_anon_1: __BindgenUnionField, + pub bindgen_union_field: u32, +} +#[repr(C)] +#[repr(align(4))] +pub struct C3D_TexEnv__bindgen_ty_1__bindgen_ty_1 { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u16>, +} +impl C3D_TexEnv__bindgen_ty_1__bindgen_ty_1 { + #[inline] + pub fn opRgb(&self) -> u32 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 12u8) as u32) } + } + #[inline] + pub fn set_opRgb(&mut self, val: u32) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(0usize, 12u8, val as u64) + } + } + #[inline] + pub fn opAlpha(&self) -> u32 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 12u8) as u32) } + } + #[inline] + pub fn set_opAlpha(&mut self, val: u32) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(12usize, 12u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1(opRgb: u32, opAlpha: u32) -> __BindgenBitfieldUnit<[u8; 4usize], u16> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u16> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 12u8, { + let opRgb: u32 = unsafe { ::core::mem::transmute(opRgb) }; + opRgb as u64 + }); + __bindgen_bitfield_unit.set(12usize, 12u8, { + let opAlpha: u32 = unsafe { ::core::mem::transmute(opAlpha) }; + opAlpha as u64 + }); + __bindgen_bitfield_unit + } +} +pub const C3D_RGB: C3D_TexEnvMode = 1; +pub const C3D_Alpha: C3D_TexEnvMode = 2; +pub const C3D_Both: C3D_TexEnvMode = 3; +pub type C3D_TexEnvMode = u32; +extern "C" { + pub fn C3D_GetTexEnv(id: ::libc::c_int) -> *mut C3D_TexEnv; +} +extern "C" { + pub fn C3D_SetTexEnv(id: ::libc::c_int, env: *mut C3D_TexEnv); +} +extern "C" { + pub fn C3D_DirtyTexEnv(env: *mut C3D_TexEnv); +} +extern "C" { + pub fn C3D_TexEnvBufUpdate(mode: ::libc::c_int, mask: ::libc::c_int); +} +extern "C" { + pub fn C3D_TexEnvBufColor(color: u32); +} +extern "C" { + pub fn C3D_DepthMap(bIsZBuffer: bool, zScale: f32, zOffset: f32); +} +extern "C" { + pub fn C3D_CullFace(mode: GPU_CULLMODE); +} +extern "C" { + pub fn C3D_StencilTest( + enable: bool, + function: GPU_TESTFUNC, + ref_: ::libc::c_int, + inputMask: ::libc::c_int, + writeMask: ::libc::c_int, + ); +} +extern "C" { + pub fn C3D_StencilOp(sfail: GPU_STENCILOP, dfail: GPU_STENCILOP, pass: GPU_STENCILOP); +} +extern "C" { + pub fn C3D_BlendingColor(color: u32); +} +extern "C" { + pub fn C3D_EarlyDepthTest(enable: bool, function: GPU_EARLYDEPTHFUNC, ref_: u32); +} +extern "C" { + pub fn C3D_DepthTest(enable: bool, function: GPU_TESTFUNC, writemask: GPU_WRITEMASK); +} +extern "C" { + pub fn C3D_AlphaTest(enable: bool, function: GPU_TESTFUNC, ref_: ::libc::c_int); +} +extern "C" { + pub fn C3D_AlphaBlend( + colorEq: GPU_BLENDEQUATION, + alphaEq: GPU_BLENDEQUATION, + srcClr: GPU_BLENDFACTOR, + dstClr: GPU_BLENDFACTOR, + srcAlpha: GPU_BLENDFACTOR, + dstAlpha: GPU_BLENDFACTOR, + ); +} +extern "C" { + pub fn C3D_ColorLogicOp(op: GPU_LOGICOP); +} +extern "C" { + pub fn C3D_FragOpMode(mode: GPU_FRAGOPMODE); +} +extern "C" { + pub fn C3D_FragOpShadow(scale: f32, bias: f32); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct C3D_TexCube { + pub data: [*mut ::libc::c_void; 6usize], +} +#[repr(C)] +pub struct C3D_Tex { + pub __bindgen_anon_1: C3D_Tex__bindgen_ty_1, + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>, + pub __bindgen_anon_2: C3D_Tex__bindgen_ty_2, + pub param: u32, + pub border: u32, + pub __bindgen_anon_3: C3D_Tex__bindgen_ty_3, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union C3D_Tex__bindgen_ty_1 { + pub data: *mut ::libc::c_void, + pub cube: *mut C3D_TexCube, + _bindgen_union_align: u32, +} +#[repr(C)] +pub struct C3D_Tex__bindgen_ty_2 { + pub dim: __BindgenUnionField, + pub __bindgen_anon_1: __BindgenUnionField, + pub bindgen_union_field: u32, +} +#[repr(C)] +pub struct C3D_Tex__bindgen_ty_2__bindgen_ty_1 { + pub height: u16, + pub width: u16, +} +#[repr(C)] +pub struct C3D_Tex__bindgen_ty_3 { + pub lodParam: __BindgenUnionField, + pub __bindgen_anon_1: __BindgenUnionField, + pub bindgen_union_field: u32, +} +#[repr(C)] +pub struct C3D_Tex__bindgen_ty_3__bindgen_ty_1 { + pub lodBias: u16, + pub maxLevel: u8, + pub minLevel: u8, +} +impl C3D_Tex { + #[inline] + pub fn fmt(&self) -> GPU_TEXCOLOR { + unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u32) } + } + #[inline] + pub fn set_fmt(&mut self, val: GPU_TEXCOLOR) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(0usize, 4u8, val as u64) + } + } + #[inline] + pub fn size(&self) -> usize { + unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 28u8) as u32) } + } + #[inline] + pub fn set_size(&mut self, val: usize) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(4usize, 28u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + fmt: GPU_TEXCOLOR, + size: usize, + ) -> __BindgenBitfieldUnit<[u8; 4usize], u32> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u32> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 4u8, { + let fmt: u32 = unsafe { ::core::mem::transmute(fmt) }; + fmt as u64 + }); + __bindgen_bitfield_unit.set(4usize, 28u8, { + let size: u32 = unsafe { ::core::mem::transmute(size) }; + size as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +#[repr(align(8))] +pub struct C3D_TexInitParams { + pub width: u16, + pub height: u16, + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize], u8>, + pub __bindgen_padding_0: u16, +} +impl C3D_TexInitParams { + #[inline] + pub fn maxLevel(&self) -> u8 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) } + } + #[inline] + pub fn set_maxLevel(&mut self, val: u8) { + unsafe { + let val: u8 = ::core::mem::transmute(val); + self._bitfield_1.set(0usize, 4u8, val as u64) + } + } + #[inline] + pub fn format(&self) -> GPU_TEXCOLOR { + unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u32) } + } + #[inline] + pub fn set_format(&mut self, val: GPU_TEXCOLOR) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(4usize, 4u8, val as u64) + } + } + #[inline] + pub fn type_(&self) -> GPU_TEXTURE_MODE_PARAM { + unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 3u8) as u32) } + } + #[inline] + pub fn set_type(&mut self, val: GPU_TEXTURE_MODE_PARAM) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(8usize, 3u8, val as u64) + } + } + #[inline] + pub fn onVram(&self) -> bool { + unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u8) } + } + #[inline] + pub fn set_onVram(&mut self, val: bool) { + unsafe { + let val: u8 = ::core::mem::transmute(val); + self._bitfield_1.set(11usize, 1u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + maxLevel: u8, + format: GPU_TEXCOLOR, + type_: GPU_TEXTURE_MODE_PARAM, + onVram: bool, + ) -> __BindgenBitfieldUnit<[u8; 2usize], u8> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize], u8> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 4u8, { + let maxLevel: u8 = unsafe { ::core::mem::transmute(maxLevel) }; + maxLevel as u64 + }); + __bindgen_bitfield_unit.set(4usize, 4u8, { + let format: u32 = unsafe { ::core::mem::transmute(format) }; + format as u64 + }); + __bindgen_bitfield_unit.set(8usize, 3u8, { + let type_: u32 = unsafe { ::core::mem::transmute(type_) }; + type_ as u64 + }); + __bindgen_bitfield_unit.set(11usize, 1u8, { + let onVram: u8 = unsafe { ::core::mem::transmute(onVram) }; + onVram as u64 + }); + __bindgen_bitfield_unit + } +} +extern "C" { + pub fn C3D_TexInitWithParams( + tex: *mut C3D_Tex, + cube: *mut C3D_TexCube, + p: C3D_TexInitParams, + ) -> bool; +} +extern "C" { + pub fn C3D_TexLoadImage( + tex: *mut C3D_Tex, + data: *const ::libc::c_void, + face: GPU_TEXFACE, + level: ::libc::c_int, + ); +} +extern "C" { + pub fn C3D_TexGenerateMipmap(tex: *mut C3D_Tex, face: GPU_TEXFACE); +} +extern "C" { + pub fn C3D_TexBind(unitId: ::libc::c_int, tex: *mut C3D_Tex); +} +extern "C" { + pub fn C3D_TexFlush(tex: *mut C3D_Tex); +} +extern "C" { + pub fn C3D_TexDelete(tex: *mut C3D_Tex); +} +extern "C" { + pub fn C3D_TexShadowParams(perspective: bool, bias: f32); +} +#[repr(C)] +pub struct C3D_ProcTexColorLut { + pub color: [u32; 256usize], + pub diff: [u32; 256usize], +} +#[repr(C)] +pub struct C3D_ProcTex { + pub __bindgen_anon_1: C3D_ProcTex__bindgen_ty_1, + pub __bindgen_anon_2: C3D_ProcTex__bindgen_ty_2, + pub __bindgen_anon_3: C3D_ProcTex__bindgen_ty_3, + pub __bindgen_anon_4: C3D_ProcTex__bindgen_ty_4, + pub __bindgen_anon_5: C3D_ProcTex__bindgen_ty_5, + pub __bindgen_anon_6: C3D_ProcTex__bindgen_ty_6, +} +#[repr(C)] +pub struct C3D_ProcTex__bindgen_ty_1 { + pub proctex0: __BindgenUnionField, + pub __bindgen_anon_1: __BindgenUnionField, + pub bindgen_union_field: u32, +} +#[repr(C)] +#[repr(align(4))] +pub struct C3D_ProcTex__bindgen_ty_1__bindgen_ty_1 { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u8>, +} +impl C3D_ProcTex__bindgen_ty_1__bindgen_ty_1 { + #[inline] + pub fn uClamp(&self) -> u32 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 3u8) as u32) } + } + #[inline] + pub fn set_uClamp(&mut self, val: u32) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(0usize, 3u8, val as u64) + } + } + #[inline] + pub fn vClamp(&self) -> u32 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 3u8) as u32) } + } + #[inline] + pub fn set_vClamp(&mut self, val: u32) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(3usize, 3u8, val as u64) + } + } + #[inline] + pub fn rgbFunc(&self) -> u32 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(6usize, 4u8) as u32) } + } + #[inline] + pub fn set_rgbFunc(&mut self, val: u32) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(6usize, 4u8, val as u64) + } + } + #[inline] + pub fn alphaFunc(&self) -> u32 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 4u8) as u32) } + } + #[inline] + pub fn set_alphaFunc(&mut self, val: u32) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(10usize, 4u8, val as u64) + } + } + #[inline] + pub fn alphaSeparate(&self) -> bool { + unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u8) } + } + #[inline] + pub fn set_alphaSeparate(&mut self, val: bool) { + unsafe { + let val: u8 = ::core::mem::transmute(val); + self._bitfield_1.set(14usize, 1u8, val as u64) + } + } + #[inline] + pub fn enableNoise(&self) -> bool { + unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u8) } + } + #[inline] + pub fn set_enableNoise(&mut self, val: bool) { + unsafe { + let val: u8 = ::core::mem::transmute(val); + self._bitfield_1.set(15usize, 1u8, val as u64) + } + } + #[inline] + pub fn uShift(&self) -> u32 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(16usize, 2u8) as u32) } + } + #[inline] + pub fn set_uShift(&mut self, val: u32) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(16usize, 2u8, val as u64) + } + } + #[inline] + pub fn vShift(&self) -> u32 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(18usize, 2u8) as u32) } + } + #[inline] + pub fn set_vShift(&mut self, val: u32) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(18usize, 2u8, val as u64) + } + } + #[inline] + pub fn lodBiasLow(&self) -> u32 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(20usize, 8u8) as u32) } + } + #[inline] + pub fn set_lodBiasLow(&mut self, val: u32) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(20usize, 8u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + uClamp: u32, + vClamp: u32, + rgbFunc: u32, + alphaFunc: u32, + alphaSeparate: bool, + enableNoise: bool, + uShift: u32, + vShift: u32, + lodBiasLow: u32, + ) -> __BindgenBitfieldUnit<[u8; 4usize], u8> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u8> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 3u8, { + let uClamp: u32 = unsafe { ::core::mem::transmute(uClamp) }; + uClamp as u64 + }); + __bindgen_bitfield_unit.set(3usize, 3u8, { + let vClamp: u32 = unsafe { ::core::mem::transmute(vClamp) }; + vClamp as u64 + }); + __bindgen_bitfield_unit.set(6usize, 4u8, { + let rgbFunc: u32 = unsafe { ::core::mem::transmute(rgbFunc) }; + rgbFunc as u64 + }); + __bindgen_bitfield_unit.set(10usize, 4u8, { + let alphaFunc: u32 = unsafe { ::core::mem::transmute(alphaFunc) }; + alphaFunc as u64 + }); + __bindgen_bitfield_unit.set(14usize, 1u8, { + let alphaSeparate: u8 = unsafe { ::core::mem::transmute(alphaSeparate) }; + alphaSeparate as u64 + }); + __bindgen_bitfield_unit.set(15usize, 1u8, { + let enableNoise: u8 = unsafe { ::core::mem::transmute(enableNoise) }; + enableNoise as u64 + }); + __bindgen_bitfield_unit.set(16usize, 2u8, { + let uShift: u32 = unsafe { ::core::mem::transmute(uShift) }; + uShift as u64 + }); + __bindgen_bitfield_unit.set(18usize, 2u8, { + let vShift: u32 = unsafe { ::core::mem::transmute(vShift) }; + vShift as u64 + }); + __bindgen_bitfield_unit.set(20usize, 8u8, { + let lodBiasLow: u32 = unsafe { ::core::mem::transmute(lodBiasLow) }; + lodBiasLow as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +pub struct C3D_ProcTex__bindgen_ty_2 { + pub proctex1: __BindgenUnionField, + pub __bindgen_anon_1: __BindgenUnionField, + pub bindgen_union_field: u32, +} +#[repr(C)] +pub struct C3D_ProcTex__bindgen_ty_2__bindgen_ty_1 { + pub uNoiseAmpl: u16, + pub uNoisePhase: u16, +} +#[repr(C)] +pub struct C3D_ProcTex__bindgen_ty_3 { + pub proctex2: __BindgenUnionField, + pub __bindgen_anon_1: __BindgenUnionField, + pub bindgen_union_field: u32, +} +#[repr(C)] +pub struct C3D_ProcTex__bindgen_ty_3__bindgen_ty_1 { + pub vNoiseAmpl: u16, + pub vNoisePhase: u16, +} +#[repr(C)] +pub struct C3D_ProcTex__bindgen_ty_4 { + pub proctex3: __BindgenUnionField, + pub __bindgen_anon_1: __BindgenUnionField, + pub bindgen_union_field: u32, +} +#[repr(C)] +pub struct C3D_ProcTex__bindgen_ty_4__bindgen_ty_1 { + pub uNoiseFreq: u16, + pub vNoiseFreq: u16, +} +#[repr(C)] +pub struct C3D_ProcTex__bindgen_ty_5 { + pub proctex4: __BindgenUnionField, + pub __bindgen_anon_1: __BindgenUnionField, + pub bindgen_union_field: u32, +} +#[repr(C)] +#[repr(align(4))] +pub struct C3D_ProcTex__bindgen_ty_5__bindgen_ty_1 { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u8>, +} +impl C3D_ProcTex__bindgen_ty_5__bindgen_ty_1 { + #[inline] + pub fn minFilter(&self) -> u32 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 3u8) as u32) } + } + #[inline] + pub fn set_minFilter(&mut self, val: u32) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(0usize, 3u8, val as u64) + } + } + #[inline] + pub fn unknown1(&self) -> u32 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 8u8) as u32) } + } + #[inline] + pub fn set_unknown1(&mut self, val: u32) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(3usize, 8u8, val as u64) + } + } + #[inline] + pub fn width(&self) -> u32 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 8u8) as u32) } + } + #[inline] + pub fn set_width(&mut self, val: u32) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(11usize, 8u8, val as u64) + } + } + #[inline] + pub fn lodBiasHigh(&self) -> u32 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(19usize, 8u8) as u32) } + } + #[inline] + pub fn set_lodBiasHigh(&mut self, val: u32) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(19usize, 8u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + minFilter: u32, + unknown1: u32, + width: u32, + lodBiasHigh: u32, + ) -> __BindgenBitfieldUnit<[u8; 4usize], u8> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u8> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 3u8, { + let minFilter: u32 = unsafe { ::core::mem::transmute(minFilter) }; + minFilter as u64 + }); + __bindgen_bitfield_unit.set(3usize, 8u8, { + let unknown1: u32 = unsafe { ::core::mem::transmute(unknown1) }; + unknown1 as u64 + }); + __bindgen_bitfield_unit.set(11usize, 8u8, { + let width: u32 = unsafe { ::core::mem::transmute(width) }; + width as u64 + }); + __bindgen_bitfield_unit.set(19usize, 8u8, { + let lodBiasHigh: u32 = unsafe { ::core::mem::transmute(lodBiasHigh) }; + lodBiasHigh as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +pub struct C3D_ProcTex__bindgen_ty_6 { + pub proctex5: __BindgenUnionField, + pub __bindgen_anon_1: __BindgenUnionField, + pub bindgen_union_field: u32, +} +#[repr(C)] +#[repr(align(4))] +pub struct C3D_ProcTex__bindgen_ty_6__bindgen_ty_1 { + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u32>, +} +impl C3D_ProcTex__bindgen_ty_6__bindgen_ty_1 { + #[inline] + pub fn offset(&self) -> u32 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 8u8) as u32) } + } + #[inline] + pub fn set_offset(&mut self, val: u32) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(0usize, 8u8, val as u64) + } + } + #[inline] + pub fn unknown2(&self) -> u32 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 24u8) as u32) } + } + #[inline] + pub fn set_unknown2(&mut self, val: u32) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(8usize, 24u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1(offset: u32, unknown2: u32) -> __BindgenBitfieldUnit<[u8; 4usize], u32> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u32> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 8u8, { + let offset: u32 = unsafe { ::core::mem::transmute(offset) }; + offset as u64 + }); + __bindgen_bitfield_unit.set(8usize, 24u8, { + let unknown2: u32 = unsafe { ::core::mem::transmute(unknown2) }; + unknown2 as u64 + }); + __bindgen_bitfield_unit + } +} +pub const C3D_ProcTex_U: _bindgen_ty_34 = 1; +pub const C3D_ProcTex_V: _bindgen_ty_34 = 2; +pub const C3D_ProcTex_UV: _bindgen_ty_34 = 3; +pub type _bindgen_ty_34 = u32; +extern "C" { + pub fn C3D_ProcTexInit(pt: *mut C3D_ProcTex, offset: ::libc::c_int, length: ::libc::c_int); +} +extern "C" { + pub fn C3D_ProcTexNoiseCoefs( + pt: *mut C3D_ProcTex, + mode: ::libc::c_int, + amplitude: f32, + frequency: f32, + phase: f32, + ); +} +extern "C" { + pub fn C3D_ProcTexLodBias(pt: *mut C3D_ProcTex, bias: f32); +} +extern "C" { + pub fn C3D_ProcTexBind(texCoordId: ::libc::c_int, pt: *mut C3D_ProcTex); +} +pub type C3D_ProcTexLut = [u32; 128usize]; +extern "C" { + pub fn C3D_ProcTexLutBind(id: GPU_PROCTEX_LUTID, lut: *mut C3D_ProcTexLut); +} +extern "C" { + pub fn ProcTexLut_FromArray(lut: *mut C3D_ProcTexLut, in_: *const f32); +} +extern "C" { + pub fn C3D_ProcTexColorLutBind(lut: *mut C3D_ProcTexColorLut); +} +extern "C" { + pub fn ProcTexColorLut_Write( + out: *mut C3D_ProcTexColorLut, + in_: *const u32, + offset: ::libc::c_int, + length: ::libc::c_int, + ); +} +#[repr(C)] +pub struct C3D_LightLut { + pub data: [u32; 256usize], +} +#[repr(C)] +pub struct C3D_LightLutDA { + pub lut: C3D_LightLut, + pub bias: f32, + pub scale: f32, +} +pub type C3D_LightLutFunc = ::core::option::Option f32>; +pub type C3D_LightLutFuncDA = + ::core::option::Option f32>; +extern "C" { + pub fn LightLut_FromArray(lut: *mut C3D_LightLut, data: *mut f32); +} +extern "C" { + pub fn LightLut_FromFunc( + lut: *mut C3D_LightLut, + func: C3D_LightLutFunc, + param: f32, + negative: bool, + ); +} +extern "C" { + pub fn LightLutDA_Create( + lut: *mut C3D_LightLutDA, + func: C3D_LightLutFuncDA, + from: f32, + to: f32, + arg0: f32, + arg1: f32, + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct C3D_Material { + pub ambient: [f32; 3usize], + pub diffuse: [f32; 3usize], + pub specular0: [f32; 3usize], + pub specular1: [f32; 3usize], + pub emission: [f32; 3usize], +} +pub type C3D_Light = C3D_Light_t; +pub type C3D_LightEnv = C3D_LightEnv_t; +#[repr(C)] +pub struct C3D_LightLutInputConf { + pub abs: u32, + pub select: u32, + pub scale: u32, +} +#[repr(C)] +pub struct C3D_LightEnvConf { + pub ambient: u32, + pub numLights: u32, + pub config: [u32; 2usize], + pub lutInput: C3D_LightLutInputConf, + pub permutation: u32, +} +pub const C3DF_LightEnv_Dirty: _bindgen_ty_35 = 1; +pub const C3DF_LightEnv_MtlDirty: _bindgen_ty_35 = 2; +pub const C3DF_LightEnv_LCDirty: _bindgen_ty_35 = 4; +pub type _bindgen_ty_35 = u32; +#[repr(C)] +pub struct C3D_LightEnv_t { + pub flags: u32, + pub luts: [*mut C3D_LightLut; 6usize], + pub ambient: [f32; 3usize], + pub lights: [*mut C3D_Light; 8usize], + pub conf: C3D_LightEnvConf, + pub material: C3D_Material, +} +extern "C" { + pub fn C3D_LightEnvInit(env: *mut C3D_LightEnv); +} +extern "C" { + pub fn C3D_LightEnvBind(env: *mut C3D_LightEnv); +} +extern "C" { + pub fn C3D_LightEnvMaterial(env: *mut C3D_LightEnv, mtl: *const C3D_Material); +} +extern "C" { + pub fn C3D_LightEnvAmbient(env: *mut C3D_LightEnv, r: f32, g: f32, b: f32); +} +extern "C" { + pub fn C3D_LightEnvLut( + env: *mut C3D_LightEnv, + lutId: GPU_LIGHTLUTID, + input: GPU_LIGHTLUTINPUT, + negative: bool, + lut: *mut C3D_LightLut, + ); +} +pub const GPU_SHADOW_PRIMARY: _bindgen_ty_36 = 65536; +pub const GPU_SHADOW_SECONDARY: _bindgen_ty_36 = 131072; +pub const GPU_INVERT_SHADOW: _bindgen_ty_36 = 262144; +pub const GPU_SHADOW_ALPHA: _bindgen_ty_36 = 524288; +pub type _bindgen_ty_36 = u32; +extern "C" { + pub fn C3D_LightEnvFresnel(env: *mut C3D_LightEnv, selector: GPU_FRESNELSEL); +} +extern "C" { + pub fn C3D_LightEnvBumpMode(env: *mut C3D_LightEnv, mode: GPU_BUMPMODE); +} +extern "C" { + pub fn C3D_LightEnvBumpSel(env: *mut C3D_LightEnv, texUnit: ::libc::c_int); +} +extern "C" { + pub fn C3D_LightEnvShadowMode(env: *mut C3D_LightEnv, mode: u32); +} +extern "C" { + pub fn C3D_LightEnvShadowSel(env: *mut C3D_LightEnv, texUnit: ::libc::c_int); +} +extern "C" { + pub fn C3D_LightEnvClampHighlights(env: *mut C3D_LightEnv, clamp: bool); +} +#[repr(C)] +pub struct C3D_LightMatConf { + pub specular0: u32, + pub specular1: u32, + pub diffuse: u32, + pub ambient: u32, +} +#[repr(C)] +pub struct C3D_LightConf { + pub material: C3D_LightMatConf, + pub position: [u16; 3usize], + pub padding0: u16, + pub spotDir: [u16; 3usize], + pub padding1: u16, + pub padding2: u32, + pub config: u32, + pub distAttnBias: u32, + pub distAttnScale: u32, +} +pub const C3DF_Light_Enabled: _bindgen_ty_37 = 1; +pub const C3DF_Light_Dirty: _bindgen_ty_37 = 2; +pub const C3DF_Light_MatDirty: _bindgen_ty_37 = 4; +pub const C3DF_Light_SPDirty: _bindgen_ty_37 = 16384; +pub const C3DF_Light_DADirty: _bindgen_ty_37 = 32768; +pub type _bindgen_ty_37 = u32; +#[repr(C)] +pub struct C3D_Light_t { + pub flags: u16, + pub id: u16, + pub parent: *mut C3D_LightEnv, + pub lut_SP: *mut C3D_LightLut, + pub lut_DA: *mut C3D_LightLut, + pub ambient: [f32; 3usize], + pub diffuse: [f32; 3usize], + pub specular0: [f32; 3usize], + pub specular1: [f32; 3usize], + pub conf: C3D_LightConf, +} +extern "C" { + pub fn C3D_LightInit(light: *mut C3D_Light, env: *mut C3D_LightEnv) -> ::libc::c_int; +} +extern "C" { + pub fn C3D_LightEnable(light: *mut C3D_Light, enable: bool); +} +extern "C" { + pub fn C3D_LightTwoSideDiffuse(light: *mut C3D_Light, enable: bool); +} +extern "C" { + pub fn C3D_LightGeoFactor(light: *mut C3D_Light, id: ::libc::c_int, enable: bool); +} +extern "C" { + pub fn C3D_LightAmbient(light: *mut C3D_Light, r: f32, g: f32, b: f32); +} +extern "C" { + pub fn C3D_LightDiffuse(light: *mut C3D_Light, r: f32, g: f32, b: f32); +} +extern "C" { + pub fn C3D_LightSpecular0(light: *mut C3D_Light, r: f32, g: f32, b: f32); +} +extern "C" { + pub fn C3D_LightSpecular1(light: *mut C3D_Light, r: f32, g: f32, b: f32); +} +extern "C" { + pub fn C3D_LightPosition(light: *mut C3D_Light, pos: *mut C3D_FVec); +} +extern "C" { + pub fn C3D_LightShadowEnable(light: *mut C3D_Light, enable: bool); +} +extern "C" { + pub fn C3D_LightSpotEnable(light: *mut C3D_Light, enable: bool); +} +extern "C" { + pub fn C3D_LightSpotDir(light: *mut C3D_Light, x: f32, y: f32, z: f32); +} +extern "C" { + pub fn C3D_LightSpotLut(light: *mut C3D_Light, lut: *mut C3D_LightLut); +} +extern "C" { + pub fn C3D_LightDistAttnEnable(light: *mut C3D_Light, enable: bool); +} +extern "C" { + pub fn C3D_LightDistAttn(light: *mut C3D_Light, lut: *mut C3D_LightLutDA); +} +#[repr(C)] +pub struct C3D_FogLut { + pub data: [u32; 128usize], +} +#[repr(C)] +pub struct C3D_GasLut { + pub diff: [u32; 8usize], + pub color: [u32; 8usize], +} +extern "C" { + pub fn FogLut_FromArray(lut: *mut C3D_FogLut, data: *const f32); +} +extern "C" { + pub fn FogLut_Exp(lut: *mut C3D_FogLut, density: f32, gradient: f32, near: f32, far: f32); +} +extern "C" { + pub fn C3D_FogGasMode(fogMode: GPU_FOGMODE, gasMode: GPU_GASMODE, zFlip: bool); +} +extern "C" { + pub fn C3D_FogColor(color: u32); +} +extern "C" { + pub fn C3D_FogLutBind(lut: *mut C3D_FogLut); +} +extern "C" { + pub fn GasLut_FromArray(lut: *mut C3D_GasLut, data: *const u32); +} +extern "C" { + pub fn C3D_GasBeginAcc(); +} +extern "C" { + pub fn C3D_GasDeltaZ(value: f32); +} +extern "C" { + pub fn C3D_GasAccMax(value: f32); +} +extern "C" { + pub fn C3D_GasAttn(value: f32); +} +extern "C" { + pub fn C3D_GasLightPlanar(min: f32, max: f32, attn: f32); +} +extern "C" { + pub fn C3D_GasLightView(min: f32, max: f32, attn: f32); +} +extern "C" { + pub fn C3D_GasLightDirection(dotp: f32); +} +extern "C" { + pub fn C3D_GasLutInput(input: GPU_GASLUTINPUT); +} +extern "C" { + pub fn C3D_GasLutBind(lut: *mut C3D_GasLut); +} +#[repr(C)] +pub struct C3D_FrameBuf { + pub colorBuf: *mut ::libc::c_void, + pub depthBuf: *mut ::libc::c_void, + pub width: u16, + pub height: u16, + pub colorFmt: GPU_COLORBUF, + pub depthFmt: GPU_DEPTHBUF, + pub block32: bool, + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>, + pub __bindgen_padding_0: u16, +} +impl C3D_FrameBuf { + #[inline] + pub fn colorMask(&self) -> u8 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) } + } + #[inline] + pub fn set_colorMask(&mut self, val: u8) { + unsafe { + let val: u8 = ::core::mem::transmute(val); + self._bitfield_1.set(0usize, 4u8, val as u64) + } + } + #[inline] + pub fn depthMask(&self) -> u8 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) } + } + #[inline] + pub fn set_depthMask(&mut self, val: u8) { + unsafe { + let val: u8 = ::core::mem::transmute(val); + self._bitfield_1.set(4usize, 4u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1(colorMask: u8, depthMask: u8) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = + Default::default(); + __bindgen_bitfield_unit.set(0usize, 4u8, { + let colorMask: u8 = unsafe { ::core::mem::transmute(colorMask) }; + colorMask as u64 + }); + __bindgen_bitfield_unit.set(4usize, 4u8, { + let depthMask: u8 = unsafe { ::core::mem::transmute(depthMask) }; + depthMask as u64 + }); + __bindgen_bitfield_unit + } +} +pub const C3D_CLEAR_COLOR: C3D_ClearBits = 1; +pub const C3D_CLEAR_DEPTH: C3D_ClearBits = 2; +pub const C3D_CLEAR_ALL: C3D_ClearBits = 3; +pub type C3D_ClearBits = u32; +extern "C" { + pub fn C3D_CalcColorBufSize(width: u32, height: u32, fmt: GPU_COLORBUF) -> u32; +} +extern "C" { + pub fn C3D_CalcDepthBufSize(width: u32, height: u32, fmt: GPU_DEPTHBUF) -> u32; +} +extern "C" { + pub fn C3D_GetFrameBuf() -> *mut C3D_FrameBuf; +} +extern "C" { + pub fn C3D_SetFrameBuf(fb: *mut C3D_FrameBuf); +} +extern "C" { + pub fn C3D_FrameBufTex( + fb: *mut C3D_FrameBuf, + tex: *mut C3D_Tex, + face: GPU_TEXFACE, + level: ::libc::c_int, + ); +} +extern "C" { + pub fn C3D_FrameBufClear( + fb: *mut C3D_FrameBuf, + clearBits: C3D_ClearBits, + clearColor: u32, + clearDepth: u32, + ); +} +extern "C" { + pub fn C3D_FrameBufTransfer( + fb: *mut C3D_FrameBuf, + screen: gfxScreen_t, + side: gfx3dSide_t, + transferFlags: u32, + ); +} +pub type C3D_RenderTarget = C3D_RenderTarget_tag; +#[repr(C)] +pub struct C3D_RenderTarget_tag { + pub next: *mut C3D_RenderTarget, + pub prev: *mut C3D_RenderTarget, + pub frameBuf: C3D_FrameBuf, + pub used: bool, + pub ownsColor: bool, + pub ownsDepth: bool, + pub linked: bool, + pub screen: gfxScreen_t, + pub side: gfx3dSide_t, + pub transferFlags: u32, +} +pub const C3D_FRAME_SYNCDRAW: _bindgen_ty_38 = 1; +pub const C3D_FRAME_NONBLOCK: _bindgen_ty_38 = 2; +pub type _bindgen_ty_38 = u32; +extern "C" { + pub fn C3D_FrameRate(fps: f32) -> f32; +} +extern "C" { + pub fn C3D_FrameSync(); +} +extern "C" { + pub fn C3D_FrameCounter(id: ::libc::c_int) -> u32; +} +extern "C" { + pub fn C3D_FrameBegin(flags: u8) -> bool; +} +extern "C" { + pub fn C3D_FrameDrawOn(target: *mut C3D_RenderTarget) -> bool; +} +extern "C" { + pub fn C3D_FrameSplit(flags: u8); +} +extern "C" { + pub fn C3D_FrameEnd(flags: u8); +} +extern "C" { + pub fn C3D_FrameEndHook( + hook: ::core::option::Option, + param: *mut ::libc::c_void, + ); +} +extern "C" { + pub fn C3D_GetDrawingTime() -> f32; +} +extern "C" { + pub fn C3D_GetProcessingTime() -> f32; +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union C3D_DEPTHTYPE { + pub __i: ::libc::c_int, + pub __e: GPU_DEPTHBUF, + _bindgen_union_align: u32, +} +extern "C" { + pub fn C3D_RenderTargetCreate( + width: ::libc::c_int, + height: ::libc::c_int, + colorFmt: GPU_COLORBUF, + depthFmt: C3D_DEPTHTYPE, + ) -> *mut C3D_RenderTarget; +} +extern "C" { + pub fn C3D_RenderTargetCreateFromTex( + tex: *mut C3D_Tex, + face: GPU_TEXFACE, + level: ::libc::c_int, + depthFmt: C3D_DEPTHTYPE, + ) -> *mut C3D_RenderTarget; +} +extern "C" { + pub fn C3D_RenderTargetDelete(target: *mut C3D_RenderTarget); +} +extern "C" { + pub fn C3D_RenderTargetSetOutput( + target: *mut C3D_RenderTarget, + screen: gfxScreen_t, + side: gfx3dSide_t, + transferFlags: u32, + ); +} +extern "C" { + pub fn C3D_SyncDisplayTransfer( + inadr: *mut u32, + indim: u32, + outadr: *mut u32, + outdim: u32, + flags: u32, + ); +} +extern "C" { + pub fn C3D_SyncTextureCopy( + inadr: *mut u32, + indim: u32, + outadr: *mut u32, + outdim: u32, + size: u32, + flags: u32, + ); +} +extern "C" { + pub fn C3D_SyncMemoryFill( + buf0a: *mut u32, + buf0v: u32, + buf0e: *mut u32, + control0: u16, + buf1a: *mut u32, + buf1v: u32, + buf1e: *mut u32, + control1: u16, + ); +} diff --git a/citro3d-sys/src/lib.rs b/citro3d-sys/src/lib.rs new file mode 100644 index 0000000..274d43b --- /dev/null +++ b/citro3d-sys/src/lib.rs @@ -0,0 +1,13 @@ +#![allow(non_upper_case_globals)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] + +#![feature(const_fn)] + +#![no_std] + +#![cfg_attr(feature = "stdbuild", feature(libc))] + +extern crate libc; + +include!("bindings.rs"); diff --git a/ctr-std/Cargo.toml b/ctr-std/Cargo.toml index 3424485..5a4948e 100644 --- a/ctr-std/Cargo.toml +++ b/ctr-std/Cargo.toml @@ -3,9 +3,6 @@ name = "std" version = "0.0.0" license = "MIT/Apache 2.0" -[dependencies.alloc_system] -git = "https://github.com/rust3ds/alloc_system3ds" - [dependencies.ctru-sys] path = "../ctru-sys" default-features = false diff --git a/ctr-std/src/alloc.rs b/ctr-std/src/alloc.rs index b9aba1e..a9e2ac9 100644 --- a/ctr-std/src/alloc.rs +++ b/ctr-std/src/alloc.rs @@ -13,13 +13,10 @@ //! In a given program, the standard library has one “global” memory allocator //! that is used for example by `Box` and `Vec`. //! -//! Currently the default global allocator is unspecified. -//! The compiler may link to a version of [jemalloc] on some platforms, -//! but this is not guaranteed. -//! Libraries, however, like `cdylib`s and `staticlib`s are guaranteed -//! to use the [`System`] by default. +//! Currently the default global allocator is unspecified. Libraries, however, +//! like `cdylib`s and `staticlib`s are guaranteed to use the [`System`] by +//! default. //! -//! [jemalloc]: https://github.com/jemalloc/jemalloc //! [`System`]: struct.System.html //! //! # The `#[global_allocator]` attribute @@ -76,15 +73,101 @@ use core::sync::atomic::{AtomicPtr, Ordering}; use core::{mem, ptr}; +use core::ptr::NonNull; use sys_common::util::dumb_print; #[stable(feature = "alloc_module", since = "1.28.0")] #[doc(inline)] pub use alloc_crate::alloc::*; +/// The default memory allocator provided by the operating system. +/// +/// This is based on `malloc` on Unix platforms and `HeapAlloc` on Windows, +/// plus related functions. +/// +/// This type implements the `GlobalAlloc` trait and Rust programs by default +/// work as if they had this definition: +/// +/// ```rust +/// use std::alloc::System; +/// +/// #[global_allocator] +/// static A: System = System; +/// +/// fn main() { +/// let a = Box::new(4); // Allocates from the system allocator. +/// println!("{}", a); +/// } +/// ``` +/// +/// You can also define your own wrapper around `System` if you'd like, such as +/// keeping track of the number of all bytes allocated: +/// +/// ```rust +/// use std::alloc::{System, GlobalAlloc, Layout}; +/// use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering::SeqCst}; +/// +/// struct Counter; +/// +/// static ALLOCATED: AtomicUsize = ATOMIC_USIZE_INIT; +/// +/// unsafe impl GlobalAlloc for Counter { +/// unsafe fn alloc(&self, layout: Layout) -> *mut u8 { +/// let ret = System.alloc(layout); +/// if !ret.is_null() { +/// ALLOCATED.fetch_add(layout.size(), SeqCst); +/// } +/// return ret +/// } +/// +/// unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) { +/// System.dealloc(ptr, layout); +/// ALLOCATED.fetch_sub(layout.size(), SeqCst); +/// } +/// } +/// +/// #[global_allocator] +/// static A: Counter = Counter; +/// +/// fn main() { +/// println!("allocated bytes before main: {}", ALLOCATED.load(SeqCst)); +/// } +/// ``` +/// +/// It can also be used directly to allocate memory independently of whatever +/// global allocator has been selected for a Rust program. For example if a Rust +/// program opts in to using jemalloc as the global allocator, `System` will +/// still allocate memory using `malloc` and `HeapAlloc`. #[stable(feature = "alloc_system_type", since = "1.28.0")] -#[doc(inline)] -pub use alloc_system::System; +#[derive(Debug, Copy, Clone)] +pub struct System; + +// The Alloc impl just forwards to the GlobalAlloc impl, which is in `std::sys::*::alloc`. +#[unstable(feature = "allocator_api", issue = "32838")] +unsafe impl Alloc for System { + #[inline] + unsafe fn alloc(&mut self, layout: Layout) -> Result, AllocErr> { + NonNull::new(GlobalAlloc::alloc(self, layout)).ok_or(AllocErr) + } + + #[inline] + unsafe fn alloc_zeroed(&mut self, layout: Layout) -> Result, AllocErr> { + NonNull::new(GlobalAlloc::alloc_zeroed(self, layout)).ok_or(AllocErr) + } + + #[inline] + unsafe fn dealloc(&mut self, ptr: NonNull, layout: Layout) { + GlobalAlloc::dealloc(self, ptr.as_ptr(), layout) + } + + #[inline] + unsafe fn realloc(&mut self, + ptr: NonNull, + layout: Layout, + new_size: usize) -> Result, AllocErr> { + NonNull::new(GlobalAlloc::realloc(self, ptr.as_ptr(), layout, new_size)).ok_or(AllocErr) + } +} static HOOK: AtomicPtr<()> = AtomicPtr::new(ptr::null_mut()); @@ -150,14 +233,12 @@ pub mod __default_lib_allocator { // linkage directives are provided as part of the current compiler allocator // ABI - #[no_mangle] #[rustc_std_internal_symbol] pub unsafe extern fn __rdl_alloc(size: usize, align: usize) -> *mut u8 { let layout = Layout::from_size_align_unchecked(size, align); System.alloc(layout) } - #[no_mangle] #[rustc_std_internal_symbol] pub unsafe extern fn __rdl_dealloc(ptr: *mut u8, size: usize, @@ -165,7 +246,6 @@ pub mod __default_lib_allocator { System.dealloc(ptr, Layout::from_size_align_unchecked(size, align)) } - #[no_mangle] #[rustc_std_internal_symbol] pub unsafe extern fn __rdl_realloc(ptr: *mut u8, old_size: usize, @@ -175,7 +255,6 @@ pub mod __default_lib_allocator { System.realloc(ptr, old_layout, new_size) } - #[no_mangle] #[rustc_std_internal_symbol] pub unsafe extern fn __rdl_alloc_zeroed(size: usize, align: usize) -> *mut u8 { let layout = Layout::from_size_align_unchecked(size, align); diff --git a/ctr-std/src/build.rs b/ctr-std/src/build.rs index 016e7ad..485471d 100644 --- a/ctr-std/src/build.rs +++ b/ctr-std/src/build.rs @@ -97,6 +97,10 @@ fn build_libbacktrace(target: &str) -> Result<(), ()> { .file("../libbacktrace/sort.c") .file("../libbacktrace/state.c"); + let any_debug = env::var("RUSTC_DEBUGINFO").unwrap_or_default()) == "true" || + env::var("RUSTC_DEBUGINFO_LINES").unwrap_or_defaultq() == "true"; + build.debug(any_debug); + if target.contains("darwin") { build.file("../libbacktrace/macho.c"); } else if target.contains("windows") { diff --git a/ctr-std/src/collections/hash/map.rs b/ctr-std/src/collections/hash/map.rs index 91912e5..b560685 100644 --- a/ctr-std/src/collections/hash/map.rs +++ b/ctr-std/src/collections/hash/map.rs @@ -20,7 +20,7 @@ use fmt::{self, Debug}; use hash::{Hash, Hasher, BuildHasher, SipHasher13}; use iter::{FromIterator, FusedIterator}; use mem::{self, replace}; -use ops::{Deref, Index}; +use ops::{Deref, DerefMut, Index}; use sys; use super::table::{self, Bucket, EmptyBucket, Fallibility, FullBucket, FullBucketMut, RawTable, @@ -166,14 +166,14 @@ impl DefaultResizePolicy { // Our hash generation scheme consists of generating a 64-bit hash and // truncating the most significant bits. When moving to the new table, we // simply introduce a new bit to the front of the hash. Therefore, if an -// elements has ideal index i in the old table, it can have one of two ideal +// element has ideal index i in the old table, it can have one of two ideal // locations in the new table. If the new bit is 0, then the new ideal index // is i. If the new bit is 1, then the new ideal index is n + i. Intuitively, // we are producing two independent tables of size n, and for each element we // independently choose which table to insert it into with equal probability. -// However the rather than wrapping around themselves on overflowing their -// indexes, the first table overflows into the first, and the first into the -// second. Visually, our new table will look something like: +// However, rather than wrapping around themselves on overflowing their +// indexes, the first table overflows into the second, and the second into the +// first. Visually, our new table will look something like: // // [yy_xxx_xxxx_xxx|xx_yyy_yyyy_yyy] // @@ -435,12 +435,13 @@ fn search_hashed(table: M, hash: SafeHash, is_match: F) -> InternalE return InternalEntry::TableIsEmpty; } - search_hashed_nonempty(table, hash, is_match) + search_hashed_nonempty(table, hash, is_match, true) } /// Search for a pre-hashed key when the hash map is known to be non-empty. #[inline] -fn search_hashed_nonempty(table: M, hash: SafeHash, mut is_match: F) +fn search_hashed_nonempty(table: M, hash: SafeHash, mut is_match: F, + compare_hashes: bool) -> InternalEntry where M: Deref>, F: FnMut(&K) -> bool @@ -476,7 +477,7 @@ fn search_hashed_nonempty(table: M, hash: SafeHash, mut is_match: F) } // If the hash doesn't match, it can't be this one.. - if hash == full.hash() { + if !compare_hashes || hash == full.hash() { // If the key doesn't match, it can't be this one.. if is_match(full.read().0) { return InternalEntry::Occupied { elem: full }; @@ -488,6 +489,57 @@ fn search_hashed_nonempty(table: M, hash: SafeHash, mut is_match: F) } } +/// Same as `search_hashed_nonempty` but for mutable access. +#[inline] +fn search_hashed_nonempty_mut(table: M, hash: SafeHash, mut is_match: F, + compare_hashes: bool) + -> InternalEntry + where M: DerefMut>, + F: FnMut(&K) -> bool +{ + // Do not check the capacity as an extra branch could slow the lookup. + + let size = table.size(); + let mut probe = Bucket::new(table, hash); + let mut displacement = 0; + + loop { + let mut full = match probe.peek() { + Empty(bucket) => { + // Found a hole! + return InternalEntry::Vacant { + hash, + elem: NoElem(bucket, displacement), + }; + } + Full(bucket) => bucket, + }; + + let probe_displacement = full.displacement(); + + if probe_displacement < displacement { + // Found a luckier bucket than me. + // We can finish the search early if we hit any bucket + // with a lower distance to initial bucket than we've probed. + return InternalEntry::Vacant { + hash, + elem: NeqElem(full, probe_displacement), + }; + } + + // If the hash doesn't match, it can't be this one.. + if hash == full.hash() || !compare_hashes { + // If the key doesn't match, it can't be this one.. + if is_match(full.read_mut().0) { + return InternalEntry::Occupied { elem: full }; + } + } + displacement += 1; + probe = full.next(); + debug_assert!(displacement <= size); + } +} + fn pop_internal(starting_bucket: FullBucketMut) -> (K, V, &mut RawTable) { @@ -593,7 +645,7 @@ impl HashMap } let hash = self.make_hash(q); - search_hashed_nonempty(&self.table, hash, |k| q.eq(k.borrow())) + search_hashed_nonempty(&self.table, hash, |k| q.eq(k.borrow()), true) .into_occupied_bucket() } @@ -608,7 +660,7 @@ impl HashMap } let hash = self.make_hash(q); - search_hashed_nonempty(&mut self.table, hash, |k| q.eq(k.borrow())) + search_hashed_nonempty(&mut self.table, hash, |k| q.eq(k.borrow()), true) .into_occupied_bucket() } @@ -797,6 +849,7 @@ impl HashMap /// let mut map: HashMap<&str, i32> = HashMap::new(); /// map.reserve(10); /// ``` + #[inline] #[stable(feature = "rust1", since = "1.0.0")] pub fn reserve(&mut self, additional: usize) { match self.reserve_internal(additional, Infallible) { @@ -828,6 +881,7 @@ impl HashMap self.reserve_internal(additional, Fallible) } + #[inline] fn reserve_internal(&mut self, additional: usize, fallibility: Fallibility) -> Result<(), CollectionAllocErr> { @@ -964,7 +1018,7 @@ impl HashMap /// map.shrink_to(0); /// assert!(map.capacity() >= 2); /// ``` - #[unstable(feature = "shrink_to", reason = "new API", issue="0")] + #[unstable(feature = "shrink_to", reason = "new API", issue="56431")] pub fn shrink_to(&mut self, min_capacity: usize) { assert!(self.capacity() >= min_capacity, "Tried to shrink to a larger capacity"); @@ -1484,6 +1538,69 @@ impl HashMap } } +impl HashMap + where K: Eq + Hash, + S: BuildHasher +{ + /// Creates a raw entry builder for the HashMap. + /// + /// Raw entries provide the lowest level of control for searching and + /// manipulating a map. They must be manually initialized with a hash and + /// then manually searched. After this, insertions into a vacant entry + /// still require an owned key to be provided. + /// + /// Raw entries are useful for such exotic situations as: + /// + /// * Hash memoization + /// * Deferring the creation of an owned key until it is known to be required + /// * Using a search key that doesn't work with the Borrow trait + /// * Using custom comparison logic without newtype wrappers + /// + /// Because raw entries provide much more low-level control, it's much easier + /// to put the HashMap into an inconsistent state which, while memory-safe, + /// will cause the map to produce seemingly random results. Higher-level and + /// more foolproof APIs like `entry` should be preferred when possible. + /// + /// In particular, the hash used to initialized the raw entry must still be + /// consistent with the hash of the key that is ultimately stored in the entry. + /// This is because implementations of HashMap may need to recompute hashes + /// when resizing, at which point only the keys are available. + /// + /// Raw entries give mutable access to the keys. This must not be used + /// to modify how the key would compare or hash, as the map will not re-evaluate + /// where the key should go, meaning the keys may become "lost" if their + /// location does not reflect their state. For instance, if you change a key + /// so that the map now contains keys which compare equal, search may start + /// acting erratically, with two keys randomly masking each other. Implementations + /// are free to assume this doesn't happen (within the limits of memory-safety). + #[inline(always)] + #[unstable(feature = "hash_raw_entry", issue = "56167")] + pub fn raw_entry_mut(&mut self) -> RawEntryBuilderMut { + self.reserve(1); + RawEntryBuilderMut { map: self } + } + + /// Creates a raw immutable entry builder for the HashMap. + /// + /// Raw entries provide the lowest level of control for searching and + /// manipulating a map. They must be manually initialized with a hash and + /// then manually searched. + /// + /// This is useful for + /// * Hash memoization + /// * Using a search key that doesn't work with the Borrow trait + /// * Using custom comparison logic without newtype wrappers + /// + /// Unless you are in such a situation, higher-level and more foolproof APIs like + /// `get` should be preferred. + /// + /// Immutable raw entries have very limited use; you might instead want `raw_entry_mut`. + #[unstable(feature = "hash_raw_entry", issue = "56167")] + pub fn raw_entry(&self) -> RawEntryBuilder { + RawEntryBuilder { map: self } + } +} + #[stable(feature = "rust1", since = "1.0.0")] impl PartialEq for HashMap where K: Eq + Hash, @@ -1724,6 +1841,460 @@ impl<'a, K, V> InternalEntry> { } } +/// A builder for computing where in a HashMap a key-value pair would be stored. +/// +/// See the [`HashMap::raw_entry_mut`] docs for usage examples. +/// +/// [`HashMap::raw_entry_mut`]: struct.HashMap.html#method.raw_entry_mut + +#[unstable(feature = "hash_raw_entry", issue = "56167")] +pub struct RawEntryBuilderMut<'a, K: 'a, V: 'a, S: 'a> { + map: &'a mut HashMap, +} + +/// A view into a single entry in a map, which may either be vacant or occupied. +/// +/// This is a lower-level version of [`Entry`]. +/// +/// This `enum` is constructed from the [`raw_entry`] method on [`HashMap`]. +/// +/// [`HashMap`]: struct.HashMap.html +/// [`Entry`]: enum.Entry.html +/// [`raw_entry`]: struct.HashMap.html#method.raw_entry +#[unstable(feature = "hash_raw_entry", issue = "56167")] +pub enum RawEntryMut<'a, K: 'a, V: 'a, S: 'a> { + /// An occupied entry. + Occupied(RawOccupiedEntryMut<'a, K, V>), + /// A vacant entry. + Vacant(RawVacantEntryMut<'a, K, V, S>), +} + +/// A view into an occupied entry in a `HashMap`. +/// It is part of the [`RawEntryMut`] enum. +/// +/// [`RawEntryMut`]: enum.RawEntryMut.html +#[unstable(feature = "hash_raw_entry", issue = "56167")] +pub struct RawOccupiedEntryMut<'a, K: 'a, V: 'a> { + elem: FullBucket>, +} + +/// A view into a vacant entry in a `HashMap`. +/// It is part of the [`RawEntryMut`] enum. +/// +/// [`RawEntryMut`]: enum.RawEntryMut.html +#[unstable(feature = "hash_raw_entry", issue = "56167")] +pub struct RawVacantEntryMut<'a, K: 'a, V: 'a, S: 'a> { + elem: VacantEntryState>, + hash_builder: &'a S, +} + +/// A builder for computing where in a HashMap a key-value pair would be stored. +/// +/// See the [`HashMap::raw_entry`] docs for usage examples. +/// +/// [`HashMap::raw_entry`]: struct.HashMap.html#method.raw_entry +#[unstable(feature = "hash_raw_entry", issue = "56167")] +pub struct RawEntryBuilder<'a, K: 'a, V: 'a, S: 'a> { + map: &'a HashMap, +} + +impl<'a, K, V, S> RawEntryBuilderMut<'a, K, V, S> + where S: BuildHasher, + K: Eq + Hash, +{ + /// Create a `RawEntryMut` from the given key. + #[unstable(feature = "hash_raw_entry", issue = "56167")] + pub fn from_key(self, k: &Q) -> RawEntryMut<'a, K, V, S> + where K: Borrow, + Q: Hash + Eq + { + let mut hasher = self.map.hash_builder.build_hasher(); + k.hash(&mut hasher); + self.from_key_hashed_nocheck(hasher.finish(), k) + } + + /// Create a `RawEntryMut` from the given key and its hash. + #[inline] + #[unstable(feature = "hash_raw_entry", issue = "56167")] + pub fn from_key_hashed_nocheck(self, hash: u64, k: &Q) -> RawEntryMut<'a, K, V, S> + where K: Borrow, + Q: Eq + { + self.from_hash(hash, |q| q.borrow().eq(k)) + } + + #[inline] + fn search(self, hash: u64, is_match: F, compare_hashes: bool) -> RawEntryMut<'a, K, V, S> + where for<'b> F: FnMut(&'b K) -> bool, + { + match search_hashed_nonempty_mut(&mut self.map.table, + SafeHash::new(hash), + is_match, + compare_hashes) { + InternalEntry::Occupied { elem } => { + RawEntryMut::Occupied(RawOccupiedEntryMut { elem }) + } + InternalEntry::Vacant { elem, .. } => { + RawEntryMut::Vacant(RawVacantEntryMut { + elem, + hash_builder: &self.map.hash_builder, + }) + } + InternalEntry::TableIsEmpty => { + unreachable!() + } + } + } + /// Create a `RawEntryMut` from the given hash. + #[inline] + #[unstable(feature = "hash_raw_entry", issue = "56167")] + pub fn from_hash(self, hash: u64, is_match: F) -> RawEntryMut<'a, K, V, S> + where for<'b> F: FnMut(&'b K) -> bool, + { + self.search(hash, is_match, true) + } + + /// Search possible locations for an element with hash `hash` until `is_match` returns true for + /// one of them. There is no guarantee that all keys passed to `is_match` will have the provided + /// hash. + #[unstable(feature = "hash_raw_entry", issue = "56167")] + pub fn search_bucket(self, hash: u64, is_match: F) -> RawEntryMut<'a, K, V, S> + where for<'b> F: FnMut(&'b K) -> bool, + { + self.search(hash, is_match, false) + } +} + +impl<'a, K, V, S> RawEntryBuilder<'a, K, V, S> + where S: BuildHasher, +{ + /// Access an entry by key. + #[unstable(feature = "hash_raw_entry", issue = "56167")] + pub fn from_key(self, k: &Q) -> Option<(&'a K, &'a V)> + where K: Borrow, + Q: Hash + Eq + { + let mut hasher = self.map.hash_builder.build_hasher(); + k.hash(&mut hasher); + self.from_key_hashed_nocheck(hasher.finish(), k) + } + + /// Access an entry by a key and its hash. + #[unstable(feature = "hash_raw_entry", issue = "56167")] + pub fn from_key_hashed_nocheck(self, hash: u64, k: &Q) -> Option<(&'a K, &'a V)> + where K: Borrow, + Q: Hash + Eq + + { + self.from_hash(hash, |q| q.borrow().eq(k)) + } + + fn search(self, hash: u64, is_match: F, compare_hashes: bool) -> Option<(&'a K, &'a V)> + where F: FnMut(&K) -> bool + { + match search_hashed_nonempty(&self.map.table, + SafeHash::new(hash), + is_match, + compare_hashes) { + InternalEntry::Occupied { elem } => Some(elem.into_refs()), + InternalEntry::Vacant { .. } => None, + InternalEntry::TableIsEmpty => unreachable!(), + } + } + + /// Access an entry by hash. + #[unstable(feature = "hash_raw_entry", issue = "56167")] + pub fn from_hash(self, hash: u64, is_match: F) -> Option<(&'a K, &'a V)> + where F: FnMut(&K) -> bool + { + self.search(hash, is_match, true) + } + + /// Search possible locations for an element with hash `hash` until `is_match` returns true for + /// one of them. There is no guarantee that all keys passed to `is_match` will have the provided + /// hash. + #[unstable(feature = "hash_raw_entry", issue = "56167")] + pub fn search_bucket(self, hash: u64, is_match: F) -> Option<(&'a K, &'a V)> + where F: FnMut(&K) -> bool + { + self.search(hash, is_match, false) + } +} + +impl<'a, K, V, S> RawEntryMut<'a, K, V, S> { + /// Ensures a value is in the entry by inserting the default if empty, and returns + /// mutable references to the key and value in the entry. + /// + /// # Examples + /// + /// ``` + /// #![feature(hash_raw_entry)] + /// use std::collections::HashMap; + /// + /// let mut map: HashMap<&str, u32> = HashMap::new(); + /// + /// map.raw_entry_mut().from_key("poneyland").or_insert("poneyland", 3); + /// assert_eq!(map["poneyland"], 3); + /// + /// *map.raw_entry_mut().from_key("poneyland").or_insert("poneyland", 10).1 *= 2; + /// assert_eq!(map["poneyland"], 6); + /// ``` + #[unstable(feature = "hash_raw_entry", issue = "56167")] + pub fn or_insert(self, default_key: K, default_val: V) -> (&'a mut K, &'a mut V) + where K: Hash, + S: BuildHasher, + { + match self { + RawEntryMut::Occupied(entry) => entry.into_key_value(), + RawEntryMut::Vacant(entry) => entry.insert(default_key, default_val), + } + } + + /// Ensures a value is in the entry by inserting the result of the default function if empty, + /// and returns mutable references to the key and value in the entry. + /// + /// # Examples + /// + /// ``` + /// #![feature(hash_raw_entry)] + /// use std::collections::HashMap; + /// + /// let mut map: HashMap<&str, String> = HashMap::new(); + /// + /// map.raw_entry_mut().from_key("poneyland").or_insert_with(|| { + /// ("poneyland", "hoho".to_string()) + /// }); + /// + /// assert_eq!(map["poneyland"], "hoho".to_string()); + /// ``` + #[unstable(feature = "hash_raw_entry", issue = "56167")] + pub fn or_insert_with(self, default: F) -> (&'a mut K, &'a mut V) + where F: FnOnce() -> (K, V), + K: Hash, + S: BuildHasher, + { + match self { + RawEntryMut::Occupied(entry) => entry.into_key_value(), + RawEntryMut::Vacant(entry) => { + let (k, v) = default(); + entry.insert(k, v) + } + } + } + + /// Provides in-place mutable access to an occupied entry before any + /// potential inserts into the map. + /// + /// # Examples + /// + /// ``` + /// #![feature(hash_raw_entry)] + /// use std::collections::HashMap; + /// + /// let mut map: HashMap<&str, u32> = HashMap::new(); + /// + /// map.raw_entry_mut() + /// .from_key("poneyland") + /// .and_modify(|_k, v| { *v += 1 }) + /// .or_insert("poneyland", 42); + /// assert_eq!(map["poneyland"], 42); + /// + /// map.raw_entry_mut() + /// .from_key("poneyland") + /// .and_modify(|_k, v| { *v += 1 }) + /// .or_insert("poneyland", 0); + /// assert_eq!(map["poneyland"], 43); + /// ``` + #[unstable(feature = "hash_raw_entry", issue = "56167")] + pub fn and_modify(self, f: F) -> Self + where F: FnOnce(&mut K, &mut V) + { + match self { + RawEntryMut::Occupied(mut entry) => { + { + let (k, v) = entry.get_key_value_mut(); + f(k, v); + } + RawEntryMut::Occupied(entry) + }, + RawEntryMut::Vacant(entry) => RawEntryMut::Vacant(entry), + } + } +} + +impl<'a, K, V> RawOccupiedEntryMut<'a, K, V> { + /// Gets a reference to the key in the entry. + #[unstable(feature = "hash_raw_entry", issue = "56167")] + pub fn key(&self) -> &K { + self.elem.read().0 + } + + /// Gets a mutable reference to the key in the entry. + #[unstable(feature = "hash_raw_entry", issue = "56167")] + pub fn key_mut(&mut self) -> &mut K { + self.elem.read_mut().0 + } + + /// Converts the entry into a mutable reference to the key in the entry + /// with a lifetime bound to the map itself. + #[unstable(feature = "hash_raw_entry", issue = "56167")] + pub fn into_key(self) -> &'a mut K { + self.elem.into_mut_refs().0 + } + + /// Gets a reference to the value in the entry. + #[unstable(feature = "hash_raw_entry", issue = "56167")] + pub fn get(&self) -> &V { + self.elem.read().1 + } + + /// Converts the OccupiedEntry into a mutable reference to the value in the entry + /// with a lifetime bound to the map itself. + #[unstable(feature = "hash_raw_entry", issue = "56167")] + pub fn into_mut(self) -> &'a mut V { + self.elem.into_mut_refs().1 + } + + /// Gets a mutable reference to the value in the entry. + #[unstable(feature = "hash_raw_entry", issue = "56167")] + pub fn get_mut(&mut self) -> &mut V { + self.elem.read_mut().1 + } + + /// Gets a reference to the key and value in the entry. + #[unstable(feature = "hash_raw_entry", issue = "56167")] + pub fn get_key_value(&mut self) -> (&K, &V) { + self.elem.read() + } + + /// Gets a mutable reference to the key and value in the entry. + #[unstable(feature = "hash_raw_entry", issue = "56167")] + pub fn get_key_value_mut(&mut self) -> (&mut K, &mut V) { + self.elem.read_mut() + } + + /// Converts the OccupiedEntry into a mutable reference to the key and value in the entry + /// with a lifetime bound to the map itself. + #[unstable(feature = "hash_raw_entry", issue = "56167")] + pub fn into_key_value(self) -> (&'a mut K, &'a mut V) { + self.elem.into_mut_refs() + } + + /// Sets the value of the entry, and returns the entry's old value. + #[unstable(feature = "hash_raw_entry", issue = "56167")] + pub fn insert(&mut self, value: V) -> V { + mem::replace(self.get_mut(), value) + } + + /// Sets the value of the entry, and returns the entry's old value. + #[unstable(feature = "hash_raw_entry", issue = "56167")] + pub fn insert_key(&mut self, key: K) -> K { + mem::replace(self.key_mut(), key) + } + + /// Takes the value out of the entry, and returns it. + #[unstable(feature = "hash_raw_entry", issue = "56167")] + pub fn remove(self) -> V { + pop_internal(self.elem).1 + } + + /// Take the ownership of the key and value from the map. + #[unstable(feature = "hash_raw_entry", issue = "56167")] + pub fn remove_entry(self) -> (K, V) { + let (k, v, _) = pop_internal(self.elem); + (k, v) + } +} + +impl<'a, K, V, S> RawVacantEntryMut<'a, K, V, S> { + /// Sets the value of the entry with the VacantEntry's key, + /// and returns a mutable reference to it. + #[unstable(feature = "hash_raw_entry", issue = "56167")] + pub fn insert(self, key: K, value: V) -> (&'a mut K, &'a mut V) + where K: Hash, + S: BuildHasher, + { + let mut hasher = self.hash_builder.build_hasher(); + key.hash(&mut hasher); + self.insert_hashed_nocheck(hasher.finish(), key, value) + } + + /// Sets the value of the entry with the VacantEntry's key, + /// and returns a mutable reference to it. + #[inline] + #[unstable(feature = "hash_raw_entry", issue = "56167")] + pub fn insert_hashed_nocheck(self, hash: u64, key: K, value: V) -> (&'a mut K, &'a mut V) { + let hash = SafeHash::new(hash); + let b = match self.elem { + NeqElem(mut bucket, disp) => { + if disp >= DISPLACEMENT_THRESHOLD { + bucket.table_mut().set_tag(true); + } + robin_hood(bucket, disp, hash, key, value) + }, + NoElem(mut bucket, disp) => { + if disp >= DISPLACEMENT_THRESHOLD { + bucket.table_mut().set_tag(true); + } + bucket.put(hash, key, value) + }, + }; + b.into_mut_refs() + } +} + +#[unstable(feature = "hash_raw_entry", issue = "56167")] +impl<'a, K, V, S> Debug for RawEntryBuilderMut<'a, K, V, S> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_struct("RawEntryBuilder") + .finish() + } +} + +#[unstable(feature = "hash_raw_entry", issue = "56167")] +impl<'a, K: Debug, V: Debug, S> Debug for RawEntryMut<'a, K, V, S> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match *self { + RawEntryMut::Vacant(ref v) => { + f.debug_tuple("RawEntry") + .field(v) + .finish() + } + RawEntryMut::Occupied(ref o) => { + f.debug_tuple("RawEntry") + .field(o) + .finish() + } + } + } +} + +#[unstable(feature = "hash_raw_entry", issue = "56167")] +impl<'a, K: Debug, V: Debug> Debug for RawOccupiedEntryMut<'a, K, V> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_struct("RawOccupiedEntryMut") + .field("key", self.key()) + .field("value", self.get()) + .finish() + } +} + +#[unstable(feature = "hash_raw_entry", issue = "56167")] +impl<'a, K, V, S> Debug for RawVacantEntryMut<'a, K, V, S> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_struct("RawVacantEntryMut") + .finish() + } +} + +#[unstable(feature = "hash_raw_entry", issue = "56167")] +impl<'a, K, V, S> Debug for RawEntryBuilder<'a, K, V, S> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_struct("RawEntryBuilder") + .finish() + } +} + /// A view into a single entry in a map, which may either be vacant or occupied. /// /// This `enum` is constructed from the [`entry`] method on [`HashMap`]. @@ -2655,9 +3226,8 @@ impl DefaultHasher { #[stable(feature = "hashmap_default_hasher", since = "1.13.0")] impl Default for DefaultHasher { - /// Creates a new `DefaultHasher` using [`new`]. See its documentation for more. - /// - /// [`new`]: #method.new + /// Creates a new `DefaultHasher` using [`new`][DefaultHasher::new]. + /// See its documentation for more. fn default() -> DefaultHasher { DefaultHasher::new() } @@ -2855,7 +3425,7 @@ mod test_map { slot.borrow_mut()[k] += 1; }); - Droppable { k: k } + Droppable { k } } } @@ -3533,12 +4103,11 @@ mod test_map { m.insert(x, ()); } - for i in 0..1000 { + for _ in 0..1000 { let x = rng.gen_range(-10, 10); match m.entry(x) { Vacant(_) => {} Occupied(e) => { - println!("{}: remove {}", i, x); e.remove(); } } diff --git a/ctr-std/src/collections/hash/set.rs b/ctr-std/src/collections/hash/set.rs index 5ac3e8f..4bb3ce0 100644 --- a/ctr-std/src/collections/hash/set.rs +++ b/ctr-std/src/collections/hash/set.rs @@ -315,7 +315,7 @@ impl HashSet /// assert!(set.capacity() >= 2); /// ``` #[inline] - #[unstable(feature = "shrink_to", reason = "new API", issue="0")] + #[unstable(feature = "shrink_to", reason = "new API", issue="56431")] pub fn shrink_to(&mut self, min_capacity: usize) { self.map.shrink_to(min_capacity) } diff --git a/ctr-std/src/collections/hash/table.rs b/ctr-std/src/collections/hash/table.rs index 2b31918..479e6dc 100644 --- a/ctr-std/src/collections/hash/table.rs +++ b/ctr-std/src/collections/hash/table.rs @@ -234,10 +234,10 @@ fn can_alias_safehash_as_hash() { // make a RawBucket point to invalid memory using safe code. impl RawBucket { unsafe fn hash(&self) -> *mut HashUint { - self.hash_start.offset(self.idx as isize) + self.hash_start.add(self.idx) } unsafe fn pair(&self) -> *mut (K, V) { - self.pair_start.offset(self.idx as isize) as *mut (K, V) + self.pair_start.add(self.idx) as *mut (K, V) } unsafe fn hash_pair(&self) -> (*mut HashUint, *mut (K, V)) { (self.hash(), self.pair()) @@ -329,6 +329,7 @@ impl Put for FullBucket } impl>> Bucket { + #[inline] pub fn new(table: M, hash: SafeHash) -> Bucket { Bucket::at_index(table, hash.inspect() as usize) } @@ -342,6 +343,7 @@ impl>> Bucket { } } + #[inline] pub fn at_index(table: M, ib_index: usize) -> Bucket { // if capacity is 0, then the RawBucket will be populated with bogus pointers. // This is an uncommon case though, so avoid it in release builds. @@ -654,6 +656,7 @@ impl GapThenFull // Returns a Layout which describes the allocation required for a hash table, // and the offset of the array of (key, value) pairs in the allocation. +#[inline(always)] fn calculate_layout(capacity: usize) -> Result<(Layout, usize), LayoutErr> { let hashes = Layout::array::(capacity)?; let pairs = Layout::array::<(K, V)>(capacity)?; @@ -722,6 +725,7 @@ impl RawTable { } } + #[inline(always)] fn raw_bucket_at(&self, index: usize) -> RawBucket { let (_, pairs_offset) = calculate_layout::(self.capacity()) .unwrap_or_else(|_| unsafe { hint::unreachable_unchecked() }); @@ -742,7 +746,9 @@ impl RawTable { ) -> Result, CollectionAllocErr> { unsafe { let ret = RawTable::new_uninitialized_internal(capacity, fallibility)?; - ptr::write_bytes(ret.hashes.ptr(), 0, capacity); + if capacity > 0 { + ptr::write_bytes(ret.hashes.ptr(), 0, capacity); + } Ok(ret) } } diff --git a/ctr-std/src/error.rs b/ctr-std/src/error.rs index 2953469..d3186f9 100644 --- a/ctr-std/src/error.rs +++ b/ctr-std/src/error.rs @@ -138,7 +138,72 @@ pub trait Error: Debug + Display { /// } /// ``` #[stable(feature = "rust1", since = "1.0.0")] - fn cause(&self) -> Option<&dyn Error> { None } + #[rustc_deprecated(since = "1.33.0", reason = "replaced by Error::source, which can support \ + downcasting")] + fn cause(&self) -> Option<&dyn Error> { + self.source() + } + /// The lower-level source of this error, if any. + /// + /// # Examples + /// + /// ``` + /// use std::error::Error; + /// use std::fmt; + /// + /// #[derive(Debug)] + /// struct SuperError { + /// side: SuperErrorSideKick, + /// } + /// + /// impl fmt::Display for SuperError { + /// fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + /// write!(f, "SuperError is here!") + /// } + /// } + /// + /// impl Error for SuperError { + /// fn description(&self) -> &str { + /// "I'm the superhero of errors" + /// } + /// + /// fn source(&self) -> Option<&(dyn Error + 'static)> { + /// Some(&self.side) + /// } + /// } + /// + /// #[derive(Debug)] + /// struct SuperErrorSideKick; + /// + /// impl fmt::Display for SuperErrorSideKick { + /// fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + /// write!(f, "SuperErrorSideKick is here!") + /// } + /// } + /// + /// impl Error for SuperErrorSideKick { + /// fn description(&self) -> &str { + /// "I'm SuperError side kick" + /// } + /// } + /// + /// fn get_super_error() -> Result<(), SuperError> { + /// Err(SuperError { side: SuperErrorSideKick }) + /// } + /// + /// fn main() { + /// match get_super_error() { + /// Err(e) => { + /// println!("Error: {}", e.description()); + /// println!("Caused by: {}", e.source().unwrap()); + /// } + /// _ => println!("No error"), + /// } + /// } + /// ``` + #[stable(feature = "error_source", since = "1.30.0")] + fn source(&self) -> Option<&(dyn Error + 'static)> { None } + /// Get the `TypeId` of `self` #[doc(hidden)] @@ -152,6 +217,35 @@ pub trait Error: Debug + Display { #[stable(feature = "rust1", since = "1.0.0")] impl<'a, E: Error + 'a> From for Box { + /// Converts a type of [`Error`] into a box of dyn [`Error`]. + /// + /// # Examples + /// + /// ``` + /// use std::error::Error; + /// use std::fmt; + /// use std::mem; + /// + /// #[derive(Debug)] + /// struct AnError; + /// + /// impl fmt::Display for AnError { + /// fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + /// write!(f , "An error") + /// } + /// } + /// + /// impl Error for AnError { + /// fn description(&self) -> &str { + /// "Description of an error" + /// } + /// } + /// + /// let an_error = AnError; + /// assert!(0 == mem::size_of_val(&an_error)); + /// let a_boxed_error = Box::::from(an_error); + /// assert!(mem::size_of::>() == mem::size_of_val(&a_boxed_error)) + /// ``` fn from(err: E) -> Box { Box::new(err) } @@ -159,6 +253,41 @@ impl<'a, E: Error + 'a> From for Box { #[stable(feature = "rust1", since = "1.0.0")] impl<'a, E: Error + Send + Sync + 'a> From for Box { + /// Converts a type of [`Error`] + [`Send`] + [`Sync`] into a box of dyn [`Error`] + + /// [`Send`] + [`Sync`]. + /// + /// # Examples + /// + /// ``` + /// use std::error::Error; + /// use std::fmt; + /// use std::mem; + /// + /// #[derive(Debug)] + /// struct AnError; + /// + /// impl fmt::Display for AnError { + /// fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + /// write!(f , "An error") + /// } + /// } + /// + /// impl Error for AnError { + /// fn description(&self) -> &str { + /// "Description of an error" + /// } + /// } + /// + /// unsafe impl Send for AnError {} + /// + /// unsafe impl Sync for AnError {} + /// + /// let an_error = AnError; + /// assert!(0 == mem::size_of_val(&an_error)); + /// let a_boxed_error = Box::::from(an_error); + /// assert!( + /// mem::size_of::>() == mem::size_of_val(&a_boxed_error)) + /// ``` fn from(err: E) -> Box { Box::new(err) } @@ -166,6 +295,19 @@ impl<'a, E: Error + Send + Sync + 'a> From for Box for Box { + /// Converts a [`String`] into a box of dyn [`Error`] + [`Send`] + [`Sync`]. + /// + /// # Examples + /// + /// ``` + /// use std::error::Error; + /// use std::mem; + /// + /// let a_string_error = "a string error".to_string(); + /// let a_boxed_error = Box::::from(a_string_error); + /// assert!( + /// mem::size_of::>() == mem::size_of_val(&a_boxed_error)) + /// ``` fn from(err: String) -> Box { #[derive(Debug)] struct StringError(String); @@ -186,6 +328,18 @@ impl From for Box { #[stable(feature = "string_box_error", since = "1.6.0")] impl From for Box { + /// Converts a [`String`] into a box of dyn [`Error`]. + /// + /// # Examples + /// + /// ``` + /// use std::error::Error; + /// use std::mem; + /// + /// let a_string_error = "a string error".to_string(); + /// let a_boxed_error = Box::::from(a_string_error); + /// assert!(mem::size_of::>() == mem::size_of_val(&a_boxed_error)) + /// ``` fn from(str_err: String) -> Box { let err1: Box = From::from(str_err); let err2: Box = err1; @@ -195,6 +349,19 @@ impl From for Box { #[stable(feature = "rust1", since = "1.0.0")] impl<'a, 'b> From<&'b str> for Box { + /// Converts a [`str`] into a box of dyn [`Error`] + [`Send`] + [`Sync`]. + /// + /// # Examples + /// + /// ``` + /// use std::error::Error; + /// use std::mem; + /// + /// let a_str_error = "a str error"; + /// let a_boxed_error = Box::::from(a_str_error); + /// assert!( + /// mem::size_of::>() == mem::size_of_val(&a_boxed_error)) + /// ``` fn from(err: &'b str) -> Box { From::from(String::from(err)) } @@ -202,6 +369,18 @@ impl<'a, 'b> From<&'b str> for Box { #[stable(feature = "string_box_error", since = "1.6.0")] impl<'a> From<&'a str> for Box { + /// Converts a [`str`] into a box of dyn [`Error`]. + /// + /// # Examples + /// + /// ``` + /// use std::error::Error; + /// use std::mem; + /// + /// let a_str_error = "a str error"; + /// let a_boxed_error = Box::::from(a_str_error); + /// assert!(mem::size_of::>() == mem::size_of_val(&a_boxed_error)) + /// ``` fn from(err: &'a str) -> Box { From::from(String::from(err)) } @@ -209,6 +388,20 @@ impl<'a> From<&'a str> for Box { #[stable(feature = "cow_box_error", since = "1.22.0")] impl<'a, 'b> From> for Box { + /// Converts a [`Cow`] into a box of dyn [`Error`] + [`Send`] + [`Sync`]. + /// + /// # Examples + /// + /// ``` + /// use std::error::Error; + /// use std::mem; + /// use std::borrow::Cow; + /// + /// let a_cow_str_error = Cow::from("a str error"); + /// let a_boxed_error = Box::::from(a_cow_str_error); + /// assert!( + /// mem::size_of::>() == mem::size_of_val(&a_boxed_error)) + /// ``` fn from(err: Cow<'b, str>) -> Box { From::from(String::from(err)) } @@ -216,6 +409,19 @@ impl<'a, 'b> From> for Box { #[stable(feature = "cow_box_error", since = "1.22.0")] impl<'a> From> for Box { + /// Converts a [`Cow`] into a box of dyn [`Error`]. + /// + /// # Examples + /// + /// ``` + /// use std::error::Error; + /// use std::mem; + /// use std::borrow::Cow; + /// + /// let a_cow_str_error = Cow::from("a str error"); + /// let a_boxed_error = Box::::from(a_cow_str_error); + /// assert!(mem::size_of::>() == mem::size_of_val(&a_boxed_error)) + /// ``` fn from(err: Cow<'a, str>) -> Box { From::from(String::from(err)) } diff --git a/ctr-std/src/f32.rs b/ctr-std/src/f32.rs index 8e8340b..7d17aaf 100644 --- a/ctr-std/src/f32.rs +++ b/ctr-std/src/f32.rs @@ -198,6 +198,35 @@ impl f32 { } } + /// Returns a number composed of the magnitude of `self` and the sign of + /// `y`. + /// + /// Equal to `self` if the sign of `self` and `y` are the same, otherwise + /// equal to `-self`. If `self` is a `NAN`, then a `NAN` with the sign of + /// `y` is returned. + /// + /// # Examples + /// + /// ``` + /// #![feature(copysign)] + /// use std::f32; + /// + /// let f = 3.5_f32; + /// + /// assert_eq!(f.copysign(0.42), 3.5_f32); + /// assert_eq!(f.copysign(-0.42), -3.5_f32); + /// assert_eq!((-f).copysign(0.42), 3.5_f32); + /// assert_eq!((-f).copysign(-0.42), -3.5_f32); + /// + /// assert!(f32::NAN.copysign(1.0).is_nan()); + /// ``` + #[inline] + #[must_use] + #[unstable(feature="copysign", issue="55169")] + pub fn copysign(self, y: f32) -> f32 { + unsafe { intrinsics::copysignf32(self, y) } + } + /// Fused multiply-add. Computes `(self * a) + b` with only one rounding /// error, yielding a more accurate result than an unfused multiply-add. /// diff --git a/ctr-std/src/f64.rs b/ctr-std/src/f64.rs index 6880294..ecaaf83 100644 --- a/ctr-std/src/f64.rs +++ b/ctr-std/src/f64.rs @@ -176,6 +176,35 @@ impl f64 { } } + /// Returns a number composed of the magnitude of `self` and the sign of + /// `y`. + /// + /// Equal to `self` if the sign of `self` and `y` are the same, otherwise + /// equal to `-self`. If `self` is a `NAN`, then a `NAN` with the sign of + /// `y` is returned. + /// + /// # Examples + /// + /// ``` + /// #![feature(copysign)] + /// use std::f64; + /// + /// let f = 3.5_f64; + /// + /// assert_eq!(f.copysign(0.42), 3.5_f64); + /// assert_eq!(f.copysign(-0.42), -3.5_f64); + /// assert_eq!((-f).copysign(0.42), 3.5_f64); + /// assert_eq!((-f).copysign(-0.42), -3.5_f64); + /// + /// assert!(f64::NAN.copysign(1.0).is_nan()); + /// ``` + #[inline] + #[must_use] + #[unstable(feature="copysign", issue="55169")] + pub fn copysign(self, y: f64) -> f64 { + unsafe { intrinsics::copysignf64(self, y) } + } + /// Fused multiply-add. Computes `(self * a) + b` with only one rounding /// error, yielding a more accurate result than an unfused multiply-add. /// diff --git a/ctr-std/src/ffi/c_str.rs b/ctr-std/src/ffi/c_str.rs index 06edd29..8483a5d 100644 --- a/ctr-std/src/ffi/c_str.rs +++ b/ctr-std/src/ffi/c_str.rs @@ -33,7 +33,7 @@ use sys; /// type is a static guarantee that the underlying bytes contain no interior 0 /// bytes ("nul characters") and that the final byte is 0 ("nul terminator"). /// -/// `CString` is to [`CStr`] as [`String`] is to [`&str`]: the former +/// `CString` is to [`&CStr`] as [`String`] is to [`&str`]: the former /// in each pair are owned strings; the latter are borrowed /// references. /// @@ -88,6 +88,7 @@ use sys; /// [slice.len]: ../primitive.slice.html#method.len /// [`Deref`]: ../ops/trait.Deref.html /// [`CStr`]: struct.CStr.html +/// [`&CStr`]: struct.CStr.html /// /// # Examples /// @@ -101,8 +102,8 @@ use sys; /// } /// /// // We are certain that our string doesn't have 0 bytes in the middle, -/// // so we can .unwrap() -/// let c_to_print = CString::new("Hello, world!").unwrap(); +/// // so we can .expect() +/// let c_to_print = CString::new("Hello, world!").expect("CString::new failed"); /// unsafe { /// my_printer(c_to_print.as_ptr()); /// } @@ -137,7 +138,7 @@ pub struct CString { /// converted to a Rust [`&str`] by performing UTF-8 validation, or /// into an owned [`CString`]. /// -/// `CStr` is to [`CString`] as [`&str`] is to [`String`]: the former +/// `&CStr` is to [`CString`] as [`&str`] is to [`String`]: the former /// in each pair are borrowed references; the latter are owned /// strings. /// @@ -174,7 +175,7 @@ pub struct CString { /// unsafe { work_with(data.as_ptr()) } /// } /// -/// let s = CString::new("data data data data").unwrap(); +/// let s = CString::new("data data data data").expect("CString::new failed"); /// work(&s); /// ``` /// @@ -313,7 +314,7 @@ impl CString { /// /// extern { fn puts(s: *const c_char); } /// - /// let to_print = CString::new("Hello!").unwrap(); + /// let to_print = CString::new("Hello!").expect("CString::new failed"); /// unsafe { /// puts(to_print.as_ptr()); /// } @@ -397,7 +398,7 @@ impl CString { /// fn some_extern_function(s: *mut c_char); /// } /// - /// let c_string = CString::new("Hello!").unwrap(); + /// let c_string = CString::new("Hello!").expect("CString::new failed"); /// let raw = c_string.into_raw(); /// unsafe { /// some_extern_function(raw); @@ -446,7 +447,7 @@ impl CString { /// fn some_extern_function(s: *mut c_char); /// } /// - /// let c_string = CString::new("Hello!").unwrap(); + /// let c_string = CString::new("Hello!").expect("CString::new failed"); /// let raw = c_string.into_raw(); /// unsafe { /// some_extern_function(raw); @@ -509,12 +510,12 @@ impl CString { /// use std::ffi::CString; /// /// let valid_utf8 = vec![b'f', b'o', b'o']; - /// let cstring = CString::new(valid_utf8).unwrap(); - /// assert_eq!(cstring.into_string().unwrap(), "foo"); + /// let cstring = CString::new(valid_utf8).expect("CString::new failed"); + /// assert_eq!(cstring.into_string().expect("into_string() call failed"), "foo"); /// /// let invalid_utf8 = vec![b'f', 0xff, b'o', b'o']; - /// let cstring = CString::new(invalid_utf8).unwrap(); - /// let err = cstring.into_string().err().unwrap(); + /// let cstring = CString::new(invalid_utf8).expect("CString::new failed"); + /// let err = cstring.into_string().err().expect("into_string().err() failed"); /// assert_eq!(err.utf8_error().valid_up_to(), 1); /// ``` @@ -538,7 +539,7 @@ impl CString { /// ``` /// use std::ffi::CString; /// - /// let c_string = CString::new("foo").unwrap(); + /// let c_string = CString::new("foo").expect("CString::new failed"); /// let bytes = c_string.into_bytes(); /// assert_eq!(bytes, vec![b'f', b'o', b'o']); /// ``` @@ -650,7 +651,7 @@ impl CString { unsafe { Box::from_raw(Box::into_raw(self.into_inner()) as *mut CStr) } } - // Bypass "move out of struct which implements [`Drop`] trait" restriction. + /// Bypass "move out of struct which implements [`Drop`] trait" restriction. /// /// [`Drop`]: ../ops/trait.Drop.html fn into_inner(self) -> Box<[u8]> { @@ -1130,7 +1131,8 @@ impl CStr { /// ``` #[inline] #[stable(feature = "cstr_from_bytes", since = "1.10.0")] - pub unsafe fn from_bytes_with_nul_unchecked(bytes: &[u8]) -> &CStr { + #[rustc_const_unstable(feature = "const_cstr_unchecked")] + pub const unsafe fn from_bytes_with_nul_unchecked(bytes: &[u8]) -> &CStr { &*(bytes as *const [u8] as *const CStr) } @@ -1180,7 +1182,7 @@ impl CStr { /// [`CString`]: struct.CString.html #[inline] #[stable(feature = "rust1", since = "1.0.0")] - pub fn as_ptr(&self) -> *const c_char { + pub const fn as_ptr(&self) -> *const c_char { self.inner.as_ptr() } @@ -1472,6 +1474,15 @@ mod tests { } } + #[test] + fn cstr_const_constructor() { + const CSTR: &'static CStr = unsafe { + CStr::from_bytes_with_nul_unchecked(b"Hello, world!\0") + }; + + assert_eq!(CSTR.to_str().unwrap(), "Hello, world!"); + } + #[test] fn to_owned() { let data = b"123\0"; diff --git a/ctr-std/src/ffi/mod.rs b/ctr-std/src/ffi/mod.rs index a37a5e8..b438417 100644 --- a/ctr-std/src/ffi/mod.rs +++ b/ctr-std/src/ffi/mod.rs @@ -171,5 +171,15 @@ pub use self::c_str::{FromBytesWithNulError}; #[stable(feature = "rust1", since = "1.0.0")] pub use self::os_str::{OsString, OsStr}; +#[stable(feature = "raw_os", since = "1.1.0")] +pub use core::ffi::c_void; + +#[cfg(not(stage0))] +#[unstable(feature = "c_variadic", + reason = "the `c_variadic` feature has not been properly tested on \ + all supported platforms", + issue = "27745")] +pub use core::ffi::VaList; + mod c_str; mod os_str; diff --git a/ctr-std/src/ffi/os_str.rs b/ctr-std/src/ffi/os_str.rs index 6bcd62d..b89c899 100644 --- a/ctr-std/src/ffi/os_str.rs +++ b/ctr-std/src/ffi/os_str.rs @@ -34,7 +34,9 @@ use sys_common::{AsInner, IntoInner, FromInner}; /// /// `OsString` and [`OsStr`] bridge this gap by simultaneously representing Rust /// and platform-native string values, and in particular allowing a Rust string -/// to be converted into an "OS" string with no cost if possible. +/// to be converted into an "OS" string with no cost if possible. A consequence +/// of this is that `OsString` instances are *not* `NUL` terminated; in order +/// to pass to e.g. Unix system call, you should create a [`CStr`]. /// /// `OsString` is to [`&OsStr`] as [`String`] is to [`&str`]: the former /// in each pair are owned strings; the latter are borrowed @@ -65,6 +67,7 @@ use sys_common::{AsInner, IntoInner, FromInner}; /// /// [`OsStr`]: struct.OsStr.html /// [`&OsStr`]: struct.OsStr.html +/// [`CStr`]: struct.CStr.html /// [`From`]: ../convert/trait.From.html /// [`String`]: ../string/struct.String.html /// [`&str`]: ../primitive.str.html @@ -321,7 +324,7 @@ impl OsString { /// assert!(s.capacity() >= 3); /// ``` #[inline] - #[unstable(feature = "shrink_to", reason = "new API", issue="0")] + #[unstable(feature = "shrink_to", reason = "new API", issue="56431")] pub fn shrink_to(&mut self, min_capacity: usize) { self.inner.shrink_to(min_capacity) } @@ -351,9 +354,6 @@ impl From for OsString { /// Converts a [`String`] into a [`OsString`]. /// /// The conversion copies the data, and includes an allocation on the heap. - /// - /// [`String`]: ../string/struct.String.html - /// [`OsString`]: struct.OsString.html fn from(s: String) -> OsString { OsString { inner: Buf::from_string(s) } } @@ -423,14 +423,14 @@ impl PartialEq for str { } } -#[stable(feature = "os_str_str_ref_eq", since = "1.28.0")] +#[stable(feature = "os_str_str_ref_eq", since = "1.29.0")] impl<'a> PartialEq<&'a str> for OsString { fn eq(&self, other: &&'a str) -> bool { **self == **other } } -#[stable(feature = "os_str_str_ref_eq", since = "1.28.0")] +#[stable(feature = "os_str_str_ref_eq", since = "1.29.0")] impl<'a> PartialEq for &'a str { fn eq(&self, other: &OsString) -> bool { **other == **self diff --git a/ctr-std/src/fs.rs b/ctr-std/src/fs.rs index 7632fbc..ffcade9 100644 --- a/ctr-std/src/fs.rs +++ b/ctr-std/src/fs.rs @@ -726,7 +726,7 @@ impl OpenOptions { /// If a file is opened with both read and append access, beware that after /// opening, and after every write, the position for reading may be set at the /// end of the file. So, before writing, save the current position (using - /// [`seek`]`(`[`SeekFrom`]`::`[`Current`]`(0))`, and restore it before the next read. + /// [`seek`]`(`[`SeekFrom`]`::`[`Current`]`(0))`), and restore it before the next read. /// /// ## Note /// @@ -877,7 +877,7 @@ impl OpenOptions { fn _open(&self, path: &Path) -> io::Result { let inner = fs_imp::File::open(path, &self.0)?; - Ok(File { inner: inner }) + Ok(File { inner }) } } @@ -1566,6 +1566,12 @@ pub fn rename, Q: AsRef>(from: P, to: Q) -> io::Result<()> /// On success, the total number of bytes copied is returned and it is equal to /// the length of the `to` file as reported by `metadata`. /// +/// If you’re wanting to copy the contents of one file to another and you’re +/// working with [`File`]s, see the [`io::copy`] function. +/// +/// [`io::copy`]: ../io/fn.copy.html +/// [`File`]: ./struct.File.html +/// /// # Platform-specific behavior /// /// This function currently corresponds to the `open` function in Unix @@ -2052,7 +2058,7 @@ impl DirBuilder { Err(e) => return Err(e), } match path.parent() { - Some(p) => try!(self.create_dir_all(p)), + Some(p) => self.create_dir_all(p)?, None => return Err(io::Error::new(io::ErrorKind::Other, "failed to create whole tree")), } match self.inner.mkdir(path) { @@ -2076,7 +2082,7 @@ mod tests { use fs::{self, File, OpenOptions}; use io::{ErrorKind, SeekFrom}; use path::Path; - use rand::{StdRng, Rng}; + use rand::{StdRng, FromEntropy, RngCore}; use str; use sys_common::io::test::{TempDir, tmpdir}; use thread; @@ -3110,7 +3116,7 @@ mod tests { #[test] fn binary_file() { let mut bytes = [0; 1024]; - StdRng::new().unwrap().fill_bytes(&mut bytes); + StdRng::from_entropy().fill_bytes(&mut bytes); let tmpdir = tmpdir(); @@ -3123,7 +3129,7 @@ mod tests { #[test] fn write_then_read() { let mut bytes = [0; 1024]; - StdRng::new().unwrap().fill_bytes(&mut bytes); + StdRng::from_entropy().fill_bytes(&mut bytes); let tmpdir = tmpdir(); diff --git a/ctr-std/src/future.rs b/ctr-std/src/future.rs index 12ea1ea..ae6c475 100644 --- a/ctr-std/src/future.rs +++ b/ctr-std/src/future.rs @@ -12,10 +12,10 @@ use core::cell::Cell; use core::marker::Unpin; -use core::mem::PinMut; +use core::pin::Pin; use core::option::Option; use core::ptr::NonNull; -use core::task::{self, Poll}; +use core::task::{LocalWaker, Poll}; use core::ops::{Drop, Generator, GeneratorState}; #[doc(inline)] @@ -42,8 +42,8 @@ impl> !Unpin for GenFuture {} #[unstable(feature = "gen_future", issue = "50547")] impl> Future for GenFuture { type Output = T::Return; - fn poll(self: PinMut, cx: &mut task::Context) -> Poll { - set_task_cx(cx, || match unsafe { PinMut::get_mut_unchecked(self).0.resume() } { + fn poll(self: Pin<&mut Self>, lw: &LocalWaker) -> Poll { + set_task_waker(lw, || match unsafe { Pin::get_unchecked_mut(self).0.resume() } { GeneratorState::Yielded(()) => Poll::Pending, GeneratorState::Complete(x) => Poll::Ready(x), }) @@ -51,66 +51,61 @@ impl> Future for GenFuture { } thread_local! { - static TLS_CX: Cell>>> = Cell::new(None); + static TLS_WAKER: Cell>> = Cell::new(None); } -struct SetOnDrop(Option>>); +struct SetOnDrop(Option>); impl Drop for SetOnDrop { fn drop(&mut self) { - TLS_CX.with(|tls_cx| { - tls_cx.set(self.0.take()); + TLS_WAKER.with(|tls_waker| { + tls_waker.set(self.0.take()); }); } } #[unstable(feature = "gen_future", issue = "50547")] /// Sets the thread-local task context used by async/await futures. -pub fn set_task_cx(cx: &mut task::Context, f: F) -> R +pub fn set_task_waker(lw: &LocalWaker, f: F) -> R where F: FnOnce() -> R { - let old_cx = TLS_CX.with(|tls_cx| { - tls_cx.replace(NonNull::new( - cx - as *mut task::Context - as *mut () - as *mut task::Context<'static> - )) + let old_waker = TLS_WAKER.with(|tls_waker| { + tls_waker.replace(Some(NonNull::from(lw))) }); - let _reset_cx = SetOnDrop(old_cx); + let _reset_waker = SetOnDrop(old_waker); f() } #[unstable(feature = "gen_future", issue = "50547")] -/// Retrieves the thread-local task context used by async/await futures. +/// Retrieves the thread-local task waker used by async/await futures. /// -/// This function acquires exclusive access to the task context. +/// This function acquires exclusive access to the task waker. /// -/// Panics if no task has been set or if the task context has already been -/// retrived by a surrounding call to get_task_cx. -pub fn get_task_cx(f: F) -> R +/// Panics if no task has been set or if the waker has already been +/// retrieved by a surrounding call to get_task_waker. +pub fn get_task_waker(f: F) -> R where - F: FnOnce(&mut task::Context) -> R + F: FnOnce(&LocalWaker) -> R { - let cx_ptr = TLS_CX.with(|tls_cx| { - // Clear the entry so that nested `with_get_cx` calls + let waker_ptr = TLS_WAKER.with(|tls_waker| { + // Clear the entry so that nested `with_get_waker` calls // will fail or set their own value. - tls_cx.replace(None) + tls_waker.replace(None) }); - let _reset_cx = SetOnDrop(cx_ptr); + let _reset_waker = SetOnDrop(waker_ptr); - let mut cx_ptr = cx_ptr.expect( - "TLS task::Context not set. This is a rustc bug. \ + let waker_ptr = waker_ptr.expect( + "TLS LocalWaker not set. This is a rustc bug. \ Please file an issue on https://github.com/rust-lang/rust."); - unsafe { f(cx_ptr.as_mut()) } + unsafe { f(waker_ptr.as_ref()) } } #[unstable(feature = "gen_future", issue = "50547")] -/// Polls a future in the current thread-local task context. -pub fn poll_in_task_cx(f: PinMut) -> Poll +/// Polls a future in the current thread-local task waker. +pub fn poll_in_task_waker(f: Pin<&mut F>) -> Poll where F: Future { - get_task_cx(|cx| f.poll(cx)) + get_task_waker(|lw| F::poll(f, lw)) } diff --git a/ctr-std/src/io/buffered.rs b/ctr-std/src/io/buffered.rs index 03c97de..e26e6d3 100644 --- a/ctr-std/src/io/buffered.rs +++ b/ctr-std/src/io/buffered.rs @@ -294,17 +294,15 @@ impl Seek for BufReader { /// `.into_inner()` immediately after a seek yields the underlying reader /// at the same position. /// - /// To seek without discarding the internal buffer, use [`seek_relative`]. + /// To seek without discarding the internal buffer, use [`Seek::seek_relative`]. /// - /// See `std::io::Seek` for more details. + /// See [`std::io::Seek`] for more details. /// /// Note: In the edge case where you're seeking with `SeekFrom::Current(n)` /// where `n` minus the internal buffer length overflows an `i64`, two /// seeks will be performed instead of one. If the second seek returns /// `Err`, the underlying reader will be left at the same position it would /// have if you called `seek` with `SeekFrom::Current(0)`. - /// - /// [`seek_relative`]: #method.seek_relative fn seek(&mut self, pos: SeekFrom) -> io::Result { let result: u64; if let SeekFrom::Current(n) = pos { @@ -889,7 +887,7 @@ impl Write for LineWriter { // Find the last newline character in the buffer provided. If found then // we're going to write all the data up to that point and then flush, - // otherewise we just write the whole block to the underlying writer. + // otherwise we just write the whole block to the underlying writer. let i = match memchr::memrchr(b'\n', buf) { Some(i) => i, None => return self.inner.write(buf), diff --git a/ctr-std/src/io/error.rs b/ctr-std/src/io/error.rs index 3e50988..386de08 100644 --- a/ctr-std/src/io/error.rs +++ b/ctr-std/src/io/error.rs @@ -212,6 +212,19 @@ impl ErrorKind { /// the heap (for normal construction via Error::new) is too costly. #[stable(feature = "io_error_from_errorkind", since = "1.14.0")] impl From for Error { + /// Converts an [`ErrorKind`] into an [`Error`]. + /// + /// This conversion allocates a new error with a simple representation of error kind. + /// + /// # Examples + /// + /// ``` + /// use std::io::{Error, ErrorKind}; + /// + /// let not_found = ErrorKind::NotFound; + /// let error = Error::from(not_found); + /// assert_eq!("entity not found", format!("{}", error)); + /// ``` #[inline] fn from(kind: ErrorKind) -> Error { Error { diff --git a/ctr-std/src/io/lazy.rs b/ctr-std/src/io/lazy.rs index 4fb367f..040540a 100644 --- a/ctr-std/src/io/lazy.rs +++ b/ctr-std/src/io/lazy.rs @@ -18,7 +18,6 @@ pub struct Lazy { // We never call `lock.init()`, so it is UB to attempt to acquire this mutex reentrantly! lock: Mutex, ptr: Cell<*mut Arc>, - init: fn() -> Arc, } #[inline] @@ -26,33 +25,32 @@ const fn done() -> *mut Arc { 1_usize as *mut _ } unsafe impl Sync for Lazy {} -impl Lazy { - /// Safety: `init` must not call `get` on the variable that is being - /// initialized. - pub const unsafe fn new(init: fn() -> Arc) -> Lazy { +impl Lazy { + pub const fn new() -> Lazy { Lazy { lock: Mutex::new(), ptr: Cell::new(ptr::null_mut()), - init, } } +} - pub fn get(&'static self) -> Option> { - unsafe { - let _guard = self.lock.lock(); - let ptr = self.ptr.get(); - if ptr.is_null() { - Some(self.init()) - } else if ptr == done() { - None - } else { - Some((*ptr).clone()) - } +impl Lazy { + /// Safety: `init` must not call `get` on the variable that is being + /// initialized. + pub unsafe fn get(&'static self, init: fn() -> Arc) -> Option> { + let _guard = self.lock.lock(); + let ptr = self.ptr.get(); + if ptr.is_null() { + Some(init()) + } else if ptr == done() { + None + } else { + Some((*ptr).clone()) } } // Must only be called with `lock` held - unsafe fn init(&'static self) -> Arc { + unsafe fn init(&'static self, init: fn() -> Arc) -> Arc { // If we successfully register an at exit handler, then we cache the // `Arc` allocation in our own internal box (it will get deallocated by // the at exit handler). Otherwise we just return the freshly allocated @@ -67,7 +65,7 @@ impl Lazy { // This could reentrantly call `init` again, which is a problem // because our `lock` allows reentrancy! // That's why `new` is unsafe and requires the caller to ensure no reentrancy happens. - let ret = (self.init)(); + let ret = init(); if registered.is_ok() { self.ptr.set(Box::into_raw(Box::new(ret.clone()))); } diff --git a/ctr-std/src/io/mod.rs b/ctr-std/src/io/mod.rs index b83f3fb..e263db2 100644 --- a/ctr-std/src/io/mod.rs +++ b/ctr-std/src/io/mod.rs @@ -1204,8 +1204,8 @@ pub trait Write { pub trait Seek { /// Seek to an offset, in bytes, in a stream. /// - /// A seek beyond the end of a stream is allowed, but implementation - /// defined. + /// A seek beyond the end of a stream is allowed, but behavior is defined + /// by the implementation. /// /// If the seek operation completed successfully, /// this method returns the new position from the start of the stream. @@ -1330,7 +1330,8 @@ fn read_until(r: &mut R, delim: u8, buf: &mut Vec) /// #[stable(feature = "rust1", since = "1.0.0")] pub trait BufRead: Read { - /// Fills the internal buffer of this object, returning the buffer contents. + /// Returns the contents of the internal buffer, filling it with more data + /// from the inner reader if it is empty. /// /// This function is a lower-level call. It needs to be paired with the /// [`consume`] method to function properly. When calling this diff --git a/ctr-std/src/io/stdio.rs b/ctr-std/src/io/stdio.rs index 1f256f5..5ba4bb3 100644 --- a/ctr-std/src/io/stdio.rs +++ b/ctr-std/src/io/stdio.rs @@ -197,9 +197,11 @@ pub struct StdinLock<'a> { /// ``` #[stable(feature = "rust1", since = "1.0.0")] pub fn stdin() -> Stdin { - static INSTANCE: Lazy>>> = unsafe { Lazy::new(stdin_init) }; + static INSTANCE: Lazy>>> = Lazy::new(); return Stdin { - inner: INSTANCE.get().expect("cannot access stdin during shutdown"), + inner: unsafe { + INSTANCE.get(stdin_init).expect("cannot access stdin during shutdown") + } }; fn stdin_init() -> Arc>>> { @@ -396,10 +398,11 @@ pub struct StdoutLock<'a> { /// ``` #[stable(feature = "rust1", since = "1.0.0")] pub fn stdout() -> Stdout { - static INSTANCE: Lazy>>>> - = unsafe { Lazy::new(stdout_init) }; + static INSTANCE: Lazy>>>> = Lazy::new(); return Stdout { - inner: INSTANCE.get().expect("cannot access stdout during shutdown"), + inner: unsafe { + INSTANCE.get(stdout_init).expect("cannot access stdout during shutdown") + } }; fn stdout_init() -> Arc>>>> { @@ -533,10 +536,11 @@ pub struct StderrLock<'a> { /// ``` #[stable(feature = "rust1", since = "1.0.0")] pub fn stderr() -> Stderr { - static INSTANCE: Lazy>>> = - unsafe { Lazy::new(stderr_init) }; + static INSTANCE: Lazy>>> = Lazy::new(); return Stderr { - inner: INSTANCE.get().expect("cannot access stderr during shutdown"), + inner: unsafe { + INSTANCE.get(stderr_init).expect("cannot access stderr during shutdown") + } }; fn stderr_init() -> Arc>>> { diff --git a/ctr-std/src/io/util.rs b/ctr-std/src/io/util.rs index 33f741d..bdd7eb6 100644 --- a/ctr-std/src/io/util.rs +++ b/ctr-std/src/io/util.rs @@ -23,6 +23,12 @@ use mem; /// On success, the total number of bytes that were copied from /// `reader` to `writer` is returned. /// +/// If you’re wanting to copy the contents of one file to another and you’re +/// working with filesystem paths, see the [`fs::copy`] function. +/// +/// [`fs::copy`]: ../fs/fn.copy.html +/// +/// /// # Errors /// /// This function will return an error immediately if any call to `read` or @@ -145,7 +151,7 @@ pub struct Repeat { byte: u8 } /// assert_eq!(buffer, [0b101, 0b101, 0b101]); /// ``` #[stable(feature = "rust1", since = "1.0.0")] -pub fn repeat(byte: u8) -> Repeat { Repeat { byte: byte } } +pub fn repeat(byte: u8) -> Repeat { Repeat { byte } } #[stable(feature = "rust1", since = "1.0.0")] impl Read for Repeat { diff --git a/ctr-std/src/keyword_docs.rs b/ctr-std/src/keyword_docs.rs index 4f6bda6..d70cf13 100644 --- a/ctr-std/src/keyword_docs.rs +++ b/ctr-std/src/keyword_docs.rs @@ -56,3 +56,24 @@ mod fn_keyword { } /// /// [book]: https://doc.rust-lang.org/book/second-edition/ch03-01-variables-and-mutability.html mod let_keyword { } + +#[doc(keyword = "struct")] +// +/// The `struct` keyword. +/// +/// The `struct` keyword is used to define a struct type. +/// +/// Example: +/// +/// ``` +/// struct Foo { +/// field1: u32, +/// field2: String, +/// } +/// ``` +/// +/// There are different kinds of structs. For more information, take a look at the +/// [Rust Book][book]. +/// +/// [book]: https://doc.rust-lang.org/book/second-edition/ch05-01-defining-structs.html +mod struct_keyword { } diff --git a/ctr-std/src/lib.rs b/ctr-std/src/lib.rs index 19ea930..bfbf2ca 100644 --- a/ctr-std/src/lib.rs +++ b/ctr-std/src/lib.rs @@ -185,7 +185,7 @@ //! [slice]: primitive.slice.html //! [`atomic`]: sync/atomic/index.html //! [`collections`]: collections/index.html -//! [`for`]: ../book/first-edition/loops.html#for +//! [`for`]: ../book/ch03-05-control-flow.html#looping-through-a-collection-with-for //! [`format!`]: macro.format.html //! [`fs`]: fs/index.html //! [`io`]: io/index.html @@ -243,18 +243,19 @@ #![feature(arbitrary_self_types)] #![feature(array_error_internals)] #![feature(asm)] -#![feature(attr_literals)] #![feature(box_syntax)] +#![feature(c_variadic)] #![feature(cfg_target_has_atomic)] #![feature(cfg_target_thread_local)] #![feature(cfg_target_vendor)] #![feature(char_error_internals)] #![feature(compiler_builtins_lib)] -#![feature(const_fn)] -#![feature(const_int_ops)] #![feature(const_ip)] +#![feature(const_raw_ptr_deref)] +#![feature(const_cstr_unchecked)] #![feature(core_intrinsics)] #![feature(dropck_eyepatch)] +#![feature(duration_as_u128)] #![feature(exact_size_is_empty)] #![feature(external_doc)] #![feature(fixed_size_array)] @@ -269,10 +270,9 @@ #![feature(libc)] #![feature(link_args)] #![feature(linkage)] -#![feature(macro_vis_matcher)] #![feature(needs_panic_runtime)] #![feature(never_type)] -#![cfg_attr(not(stage0), feature(nll))] +#![feature(nll)] #![feature(exhaustive_patterns)] #![feature(on_unimplemented)] #![feature(optin_builtin_traits)] @@ -282,10 +282,11 @@ #![feature(prelude_import)] #![feature(ptr_internals)] #![feature(raw)] +#![feature(hash_raw_entry)] #![feature(rustc_attrs)] #![feature(rustc_const_unstable)] #![feature(std_internals)] -#![feature(stdsimd)] +#![cfg_attr(not(stage0), feature(stdsimd))] #![feature(shrink_to)] #![feature(slice_concat_ext)] #![feature(slice_internals)] @@ -301,29 +302,21 @@ #![feature(unboxed_closures)] #![feature(untagged_unions)] #![feature(unwind_attributes)] -#![cfg_attr(stage0, feature(use_extern_macros))] #![feature(doc_cfg)] #![feature(doc_masked)] #![feature(doc_spotlight)] -#![cfg_attr(windows, feature(used))] #![feature(doc_alias)] #![feature(doc_keyword)] #![feature(panic_info_message)] -#![feature(panic_implementation)] #![feature(non_exhaustive)] +#![feature(alloc_layout_extra)] +#![feature(maybe_uninit)] #![default_lib_allocator] -// Always use alloc_system during stage0 since we don't know if the alloc_* -// crate the stage0 compiler will pick by default is enabled (e.g. -// if the user has disabled jemalloc in `./configure`). -// `force_alloc_system` is *only* intended as a workaround for local rebuilds -// with a rustc without jemalloc. -// FIXME(#44236) shouldn't need MSVC logic -#[cfg(all(not(target_env = "msvc"), - any(all(stage0, not(test)), feature = "force_alloc_system")))] +#[cfg(stage0)] #[global_allocator] -static ALLOC: alloc_system::System = alloc_system::System; +static ALLOC: alloc::System = alloc::System; // Explicitly import the prelude. The compiler uses this same unstable attribute // to import the prelude implicitly when building crates that depend on std. @@ -344,7 +337,6 @@ pub use core::{unreachable, unimplemented, write, writeln, try}; #[allow(unused_imports)] // macros from `alloc` are not used on all platforms #[macro_use] extern crate alloc as alloc_crate; -extern crate alloc_system; #[doc(masked)] extern crate libc; @@ -436,6 +428,8 @@ pub use alloc_crate::borrow; pub use alloc_crate::fmt; #[stable(feature = "rust1", since = "1.0.0")] pub use alloc_crate::format; +#[unstable(feature = "pin", issue = "49150")] +pub use core::pin; #[stable(feature = "rust1", since = "1.0.0")] pub use alloc_crate::slice; #[stable(feature = "rust1", since = "1.0.0")] diff --git a/ctr-std/src/macros.rs b/ctr-std/src/macros.rs index f15494c..56bfc7b 100644 --- a/ctr-std/src/macros.rs +++ b/ctr-std/src/macros.rs @@ -220,6 +220,23 @@ macro_rules! eprintln { }) } +#[stable(feature = "debug", since = "1.69.0")] +#[macro_export] +macro_rules! dbg { + ($val:expr) => { + // Use of `match` here is intentional because it affects the lifetimes + // of temporaries - https://stackoverflow.com/a/48732525/1063961 + match $val { + tmp => { + eprintln!("[{}:{}] {} = {:#?}", + file!(), line!(), stringify!($val), &tmp); + tmp + } + } + } +} + + #[macro_export] #[unstable(feature = "await_macro", issue = "50547")] #[allow_internal_unstable] @@ -229,8 +246,8 @@ macro_rules! await { let mut pinned = $e; loop { if let $crate::task::Poll::Ready(x) = - $crate::future::poll_in_task_cx(unsafe { - $crate::mem::PinMut::new_unchecked(&mut pinned) + $crate::future::poll_with_tls_waker(unsafe { + $crate::pin::Pin::new_unchecked(&mut pinned) }) { break x; @@ -279,6 +296,8 @@ macro_rules! await { /// For more information about select, see the `std::sync::mpsc::Select` structure. #[macro_export] #[unstable(feature = "mpsc_select", issue = "27800")] +#[rustc_deprecated(since = "1.32.0", + reason = "channel selection will be removed in a future release")] macro_rules! select { ( $($name:pat = $rx:ident.$meth:ident() => $code:expr),+ @@ -309,7 +328,7 @@ macro_rules! assert_approx_eq { /// These macros do not have any corresponding definition with a `macro_rules!` /// macro, but are documented here. Their implementations can be found hardcoded /// into libsyntax itself. -#[cfg(dox)] +#[cfg(rustdoc)] mod builtin { /// Unconditionally causes compilation to fail with the given error message when encountered. diff --git a/ctr-std/src/memchr.rs b/ctr-std/src/memchr.rs index 240e820..c28f3da 100644 --- a/ctr-std/src/memchr.rs +++ b/ctr-std/src/memchr.rs @@ -57,7 +57,7 @@ pub fn memrchr(needle: u8, haystack: &[u8]) -> Option { #[cfg(test)] mod tests { - // test the implementations for the current plattform + // test the implementations for the current platform use super::{memchr, memrchr}; #[test] diff --git a/ctr-std/src/net/ip.rs b/ctr-std/src/net/ip.rs index 9a610cd..2517c45 100644 --- a/ctr-std/src/net/ip.rs +++ b/ctr-std/src/net/ip.rs @@ -357,15 +357,12 @@ impl Ipv4Addr { /// # Examples /// /// ``` - /// #![feature(ip_constructors)] /// use std::net::Ipv4Addr; /// /// let addr = Ipv4Addr::LOCALHOST; /// assert_eq!(addr, Ipv4Addr::new(127, 0, 0, 1)); /// ``` - #[unstable(feature = "ip_constructors", - reason = "requires greater scrutiny before stabilization", - issue = "44582")] + #[stable(feature = "ip_constructors", since = "1.30.0")] pub const LOCALHOST: Self = Ipv4Addr::new(127, 0, 0, 1); /// An IPv4 address representing an unspecified address: 0.0.0.0 @@ -373,15 +370,12 @@ impl Ipv4Addr { /// # Examples /// /// ``` - /// #![feature(ip_constructors)] /// use std::net::Ipv4Addr; /// /// let addr = Ipv4Addr::UNSPECIFIED; /// assert_eq!(addr, Ipv4Addr::new(0, 0, 0, 0)); /// ``` - #[unstable(feature = "ip_constructors", - reason = "requires greater scrutiny before stabilization", - issue = "44582")] + #[stable(feature = "ip_constructors", since = "1.30.0")] pub const UNSPECIFIED: Self = Ipv4Addr::new(0, 0, 0, 0); /// An IPv4 address representing the broadcast address: 255.255.255.255 @@ -389,15 +383,12 @@ impl Ipv4Addr { /// # Examples /// /// ``` - /// #![feature(ip_constructors)] /// use std::net::Ipv4Addr; /// /// let addr = Ipv4Addr::BROADCAST; /// assert_eq!(addr, Ipv4Addr::new(255, 255, 255, 255)); /// ``` - #[unstable(feature = "ip_constructors", - reason = "requires greater scrutiny before stabilization", - issue = "44582")] + #[stable(feature = "ip_constructors", since = "1.30.0")] pub const BROADCAST: Self = Ipv4Addr::new(255, 255, 255, 255); /// Returns the four eight-bit integers that make up this address. @@ -433,7 +424,7 @@ impl Ipv4Addr { /// assert_eq!(Ipv4Addr::new(45, 22, 13, 197).is_unspecified(), false); /// ``` #[stable(feature = "ip_shared", since = "1.12.0")] - pub fn is_unspecified(&self) -> bool { + pub const fn is_unspecified(&self) -> bool { self.inner.s_addr == 0 } @@ -871,7 +862,6 @@ impl Ipv6Addr { /// let addr = Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_const_unstable(feature = "const_ip")] pub const fn new(a: u16, b: u16, c: u16, d: u16, e: u16, f: u16, g: u16, h: u16) -> Ipv6Addr { Ipv6Addr { @@ -896,15 +886,12 @@ impl Ipv6Addr { /// # Examples /// /// ``` - /// #![feature(ip_constructors)] /// use std::net::Ipv6Addr; /// /// let addr = Ipv6Addr::LOCALHOST; /// assert_eq!(addr, Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1)); /// ``` - #[unstable(feature = "ip_constructors", - reason = "requires greater scrutiny before stabilization", - issue = "44582")] + #[stable(feature = "ip_constructors", since = "1.30.0")] pub const LOCALHOST: Self = Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1); /// An IPv6 address representing the unspecified address: `::` @@ -912,15 +899,12 @@ impl Ipv6Addr { /// # Examples /// /// ``` - /// #![feature(ip_constructors)] /// use std::net::Ipv6Addr; /// /// let addr = Ipv6Addr::UNSPECIFIED; /// assert_eq!(addr, Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0)); /// ``` - #[unstable(feature = "ip_constructors", - reason = "requires greater scrutiny before stabilization", - issue = "44582")] + #[stable(feature = "ip_constructors", since = "1.30.0")] pub const UNSPECIFIED: Self = Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0); /// Returns the eight 16-bit segments that make up this address. @@ -1239,7 +1223,7 @@ impl Ipv6Addr { /// [255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); /// ``` #[stable(feature = "ipv6_to_octets", since = "1.12.0")] - pub fn octets(&self) -> [u8; 16] { + pub const fn octets(&self) -> [u8; 16] { self.inner.s6_addr } } diff --git a/ctr-std/src/os/mod.rs b/ctr-std/src/os/mod.rs index ff4dd4f..7ec66ce 100644 --- a/ctr-std/src/os/mod.rs +++ b/ctr-std/src/os/mod.rs @@ -11,7 +11,7 @@ //! OS-specific functionality. #![stable(feature = "os", since = "1.0.0")] -#![allow(missing_docs, bad_style, missing_debug_implementations)] +#![allow(missing_docs, nonstandard_style, missing_debug_implementations)] cfg_if! { if #[cfg(dox)] { diff --git a/ctr-std/src/os/raw/mod.rs b/ctr-std/src/os/raw/mod.rs index dc33747..95faf3a 100644 --- a/ctr-std/src/os/raw/mod.rs +++ b/ctr-std/src/os/raw/mod.rs @@ -18,8 +18,6 @@ #![stable(feature = "raw_os", since = "1.1.0")] -use fmt; - #[doc(include = "os/raw/char.md")] #[cfg(any(all(target_os = "linux", any(target_arch = "aarch64", target_arch = "arm", @@ -83,40 +81,9 @@ use fmt; #[doc(include = "os/raw/double.md")] #[stable(feature = "raw_os", since = "1.1.0")] pub type c_double = f64; -/// Equivalent to C's `void` type when used as a [pointer]. -/// -/// In essence, `*const c_void` is equivalent to C's `const void*` -/// and `*mut c_void` is equivalent to C's `void*`. That said, this is -/// *not* the same as C's `void` return type, which is Rust's `()` type. -/// -/// Ideally, this type would be equivalent to [`!`], but currently it may -/// be more ideal to use `c_void` for FFI purposes. -/// -/// [`!`]: ../../primitive.never.html -/// [pointer]: ../../primitive.pointer.html -// NB: For LLVM to recognize the void pointer type and by extension -// functions like malloc(), we need to have it represented as i8* in -// LLVM bitcode. The enum used here ensures this and prevents misuse -// of the "raw" type by only having private variants.. We need two -// variants, because the compiler complains about the repr attribute -// otherwise. -#[repr(u8)] #[stable(feature = "raw_os", since = "1.1.0")] -pub enum c_void { - #[unstable(feature = "c_void_variant", reason = "should not have to exist", - issue = "0")] - #[doc(hidden)] __variant1, - #[unstable(feature = "c_void_variant", reason = "should not have to exist", - issue = "0")] - #[doc(hidden)] __variant2, -} - -#[stable(feature = "std_debug", since = "1.16.0")] -impl fmt::Debug for c_void { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.pad("c_void") - } -} +#[doc(no_inline)] +pub use core::ffi::c_void; #[cfg(test)] #[allow(unused_imports)] diff --git a/ctr-std/src/panic.rs b/ctr-std/src/panic.rs index b8c1c4f..6dcc480 100644 --- a/ctr-std/src/panic.rs +++ b/ctr-std/src/panic.rs @@ -16,13 +16,13 @@ use any::Any; use cell::UnsafeCell; use fmt; use future::Future; -use mem::PinMut; +use pin::Pin; use ops::{Deref, DerefMut}; use panicking; use ptr::{Unique, NonNull}; use rc::Rc; use sync::{Arc, Mutex, RwLock, atomic}; -use task::{self, Poll}; +use task::{LocalWaker, Poll}; use thread::Result; #[stable(feature = "panic_hooks", since = "1.10.0")] @@ -264,6 +264,9 @@ impl RefUnwindSafe for atomic::AtomicI32 {} #[cfg(target_has_atomic = "64")] #[unstable(feature = "integer_atomics", issue = "32976")] impl RefUnwindSafe for atomic::AtomicI64 {} +#[cfg(all(not(stage0), target_has_atomic = "128"))] +#[unstable(feature = "integer_atomics", issue = "32976")] +impl RefUnwindSafe for atomic::AtomicI128 {} #[cfg(target_has_atomic = "ptr")] #[stable(feature = "unwind_safe_atomic_refs", since = "1.14.0")] @@ -280,6 +283,9 @@ impl RefUnwindSafe for atomic::AtomicU32 {} #[cfg(target_has_atomic = "64")] #[unstable(feature = "integer_atomics", issue = "32976")] impl RefUnwindSafe for atomic::AtomicU64 {} +#[cfg(all(not(stage0), target_has_atomic = "128"))] +#[unstable(feature = "integer_atomics", issue = "32976")] +impl RefUnwindSafe for atomic::AtomicU128 {} #[cfg(target_has_atomic = "8")] #[stable(feature = "unwind_safe_atomic_refs", since = "1.14.0")] @@ -327,9 +333,9 @@ impl fmt::Debug for AssertUnwindSafe { impl<'a, F: Future> Future for AssertUnwindSafe { type Output = F::Output; - fn poll(self: PinMut, cx: &mut task::Context) -> Poll { - let pinned_field = unsafe { PinMut::map_unchecked(self, |x| &mut x.0) }; - pinned_field.poll(cx) + fn poll(self: Pin<&mut Self>, lw: &LocalWaker) -> Poll { + let pinned_field = unsafe { Pin::map_unchecked_mut(self, |x| &mut x.0) }; + F::poll(pinned_field, lw) } } diff --git a/ctr-std/src/panicking.rs b/ctr-std/src/panicking.rs index c612604..1c6fd87 100644 --- a/ctr-std/src/panicking.rs +++ b/ctr-std/src/panicking.rs @@ -343,7 +343,7 @@ pub fn panicking() -> bool { /// Entry point of panic from the libcore crate. #[cfg(not(test))] -#[panic_implementation] +#[panic_handler] #[unwind(allowed)] pub fn rust_begin_panic(info: &PanicInfo) -> ! { continue_panic_fmt(&info) @@ -358,9 +358,15 @@ pub fn rust_begin_panic(info: &PanicInfo) -> ! { #[unstable(feature = "libstd_sys_internals", reason = "used by the panic! macro", issue = "0")] -#[inline(never)] #[cold] +#[cold] +#[cfg_attr(not(feature="panic_immediate_abort"),inline(never))] +#[cfg_attr( feature="panic_immediate_abort" ,inline)] pub fn begin_panic_fmt(msg: &fmt::Arguments, file_line_col: &(&'static str, u32, u32)) -> ! { + if cfg!(feature = "panic_immediate_abort") { + unsafe { intrinsics::abort() } + } + let (file, line, col) = *file_line_col; let info = PanicInfo::internal_constructor( Some(msg), @@ -421,8 +427,12 @@ fn continue_panic_fmt(info: &PanicInfo) -> ! { #[unstable(feature = "libstd_sys_internals", reason = "used by the panic! macro", issue = "0")] -#[inline(never)] #[cold] // avoid code bloat at the call sites as much as possible +#[cfg_attr(not(feature="panic_immediate_abort"),inline(never))] +#[cold] // avoid code bloat at the call sites as much as possible pub fn begin_panic(msg: M, file_line_col: &(&'static str, u32, u32)) -> ! { + if cfg!(feature = "panic_immediate_abort") { + unsafe { intrinsics::abort() } + } // Note that this should be the only allocation performed in this code path. // Currently this means that panic!() on OOM will invoke this code path, // but then again we're not really ready for panic on OOM anyway. If @@ -539,9 +549,9 @@ pub fn update_count_then_panic(msg: Box) -> ! { } /// A private no-mangle function on which to slap yer breakpoints. -#[no_mangle] -#[allow(private_no_mangle_fns)] // yes we get it, but we like breakpoints -pub fn rust_panic(mut msg: &mut dyn BoxMeUp) -> ! { +#[inline(never)] +#[cfg_attr(not(test), rustc_std_internal_symbol)] +fn rust_panic(mut msg: &mut dyn BoxMeUp) -> ! { let code = unsafe { let obj = &mut msg as *mut &mut dyn BoxMeUp; __rust_start_panic(obj as usize) diff --git a/ctr-std/src/path.rs b/ctr-std/src/path.rs index ae7b632..ff2ab1c 100644 --- a/ctr-std/src/path.rs +++ b/ctr-std/src/path.rs @@ -87,6 +87,8 @@ use io; use iter::{self, FusedIterator}; use ops::{self, Deref}; use rc::Rc; +use str::FromStr; +use string::ParseError; use sync::Arc; use ffi::{OsStr, OsString}; @@ -1446,6 +1448,15 @@ impl From for PathBuf { } } +#[stable(feature = "path_from_str", since = "1.26.0")] +impl FromStr for PathBuf { + type Err = ParseError; + + fn from_str(s: &str) -> Result { + Ok(PathBuf::from(s)) + } +} + #[stable(feature = "rust1", since = "1.0.0")] impl> iter::FromIterator

for PathBuf { fn from_iter>(iter: I) -> PathBuf { diff --git a/ctr-std/src/primitive_docs.rs b/ctr-std/src/primitive_docs.rs index 7074928..4c1fdc4 100644 --- a/ctr-std/src/primitive_docs.rs +++ b/ctr-std/src/primitive_docs.rs @@ -250,6 +250,7 @@ mod prim_bool { } /// [`Default`]: default/trait.Default.html /// [`default()`]: default/trait.Default.html#tymethod.default /// +#[unstable(feature = "never_type", issue = "35121")] mod prim_never { } #[doc(primitive = "char")] diff --git a/ctr-std/src/process.rs b/ctr-std/src/process.rs index 9dd0767..344a2f2 100644 --- a/ctr-std/src/process.rs +++ b/ctr-std/src/process.rs @@ -626,6 +626,14 @@ impl Command { /// Sets the working directory for the child process. /// + /// # Platform-specific behavior + /// + /// If the program path is relative (e.g. `"./script.sh"`), it's ambiguous + /// whether it should be interpreted relative to the parent's working + /// directory or relative to `current_dir`. The behavior in this case is + /// platform specific and unstable, and it's recommended to use + /// [`canonicalize`] to get an absolute program path instead. + /// /// # Examples /// /// Basic usage: @@ -638,6 +646,8 @@ impl Command { /// .spawn() /// .expect("ls command failed to start"); /// ``` + /// + /// [`canonicalize`]: ../fs/fn.canonicalize.html #[stable(feature = "process", since = "1.0.0")] pub fn current_dir>(&mut self, dir: P) -> &mut Command { self.inner.cwd(dir.as_ref().as_ref()); diff --git a/ctr-std/src/sync/mutex.rs b/ctr-std/src/sync/mutex.rs index e5a4106..54bfd81 100644 --- a/ctr-std/src/sync/mutex.rs +++ b/ctr-std/src/sync/mutex.rs @@ -386,8 +386,6 @@ unsafe impl<#[may_dangle] T: ?Sized> Drop for Mutex { impl From for Mutex { /// Creates a new mutex in an unlocked state ready for use. /// This is equivalent to [`Mutex::new`]. - /// - /// [`Mutex::new`]: #method.new fn from(t: T) -> Self { Mutex::new(t) } diff --git a/ctr-std/src/sync/once.rs b/ctr-std/src/sync/once.rs index f6cb8be..0cf47bd 100644 --- a/ctr-std/src/sync/once.rs +++ b/ctr-std/src/sync/once.rs @@ -176,7 +176,7 @@ impl Once { /// happens-before relation between the closure and code executing after the /// return). /// - /// If the given closure recusively invokes `call_once` on the same `Once` + /// If the given closure recursively invokes `call_once` on the same `Once` /// instance the exact behavior is not specified, allowed outcomes are /// a panic or a deadlock. /// @@ -221,13 +221,9 @@ impl Once { /// [poison]: struct.Mutex.html#poisoning #[stable(feature = "rust1", since = "1.0.0")] pub fn call_once(&self, f: F) where F: FnOnce() { - // Fast path, just see if we've completed initialization. - // An `Acquire` load is enough because that makes all the initialization - // operations visible to us. The cold path uses SeqCst consistently - // because the performance difference really does not matter there, - // and SeqCst minimizes the chances of something going wrong. - if self.state.load(Ordering::Acquire) == COMPLETE { - return + // Fast path check + if self.is_completed() { + return; } let mut f = Some(f); @@ -282,13 +278,9 @@ impl Once { /// ``` #[unstable(feature = "once_poison", issue = "33577")] pub fn call_once_force(&self, f: F) where F: FnOnce(&OnceState) { - // same as above, just with a different parameter to `call_inner`. - // An `Acquire` load is enough because that makes all the initialization - // operations visible to us. The cold path uses SeqCst consistently - // because the performance difference really does not matter there, - // and SeqCst minimizes the chances of something going wrong. - if self.state.load(Ordering::Acquire) == COMPLETE { - return + // Fast path check + if self.is_completed() { + return; } let mut f = Some(f); @@ -297,6 +289,57 @@ impl Once { }); } + /// Returns true if some `call_once` call has completed + /// successfuly. Specifically, `is_completed` will return false in + /// the following situtations: + /// * `call_once` was not called at all, + /// * `call_once` was called, but has not yet completed, + /// * the `Once` instance is poisoned + /// + /// It is also possible that immediately after `is_completed` + /// returns false, some other thread finishes executing + /// `call_once`. + /// + /// # Examples + /// + /// ``` + /// #![feature(once_is_completed)] + /// use std::sync::Once; + /// + /// static INIT: Once = Once::new(); + /// + /// assert_eq!(INIT.is_completed(), false); + /// INIT.call_once(|| { + /// assert_eq!(INIT.is_completed(), false); + /// }); + /// assert_eq!(INIT.is_completed(), true); + /// ``` + /// + /// ``` + /// #![feature(once_is_completed)] + /// use std::sync::Once; + /// use std::thread; + /// + /// static INIT: Once = Once::new(); + /// + /// assert_eq!(INIT.is_completed(), false); + /// let handle = thread::spawn(|| { + /// INIT.call_once(|| panic!()); + /// }); + /// assert!(handle.join().is_err()); + /// assert_eq!(INIT.is_completed(), false); + /// ``` + #[unstable(feature = "once_is_completed", issue = "54890")] + #[inline] + pub fn is_completed(&self) -> bool { + // An `Acquire` load is enough because that makes all the initialization + // operations visible to us, and, this being a fast path, weaker + // ordering helps with performance. This `Acquire` synchronizes with + // `SeqCst` operations on the slow path. + self.state.load(Ordering::Acquire) == COMPLETE + } + + // This is a non-generic function to reduce the monomorphization cost of // using `call_once` (this isn't exactly a trivial or small implementation). // @@ -312,6 +355,10 @@ impl Once { fn call_inner(&self, ignore_poisoning: bool, init: &mut dyn FnMut(bool)) { + + // This cold path uses SeqCst consistently because the + // performance difference really does not matter there, and + // SeqCst minimizes the chances of something going wrong. let mut state = self.state.load(Ordering::SeqCst); 'outer: loop { diff --git a/ctr-std/src/sync/rwlock.rs b/ctr-std/src/sync/rwlock.rs index e3db60c..10ff208 100644 --- a/ctr-std/src/sync/rwlock.rs +++ b/ctr-std/src/sync/rwlock.rs @@ -461,8 +461,6 @@ impl Default for RwLock { impl From for RwLock { /// Creates a new instance of an `RwLock` which is unlocked. /// This is equivalent to [`RwLock::new`]. - /// - /// [`RwLock::new`]: #method.new fn from(t: T) -> Self { RwLock::new(t) } @@ -597,7 +595,7 @@ mod tests { thread::spawn(move || { let mut rng = rand::thread_rng(); for _ in 0..M { - if rng.gen_weighted_bool(N) { + if rng.gen_bool(1.0 / (N / f64)) { drop(r.write().unwrap()); } else { drop(r.read().unwrap()); diff --git a/ctr-std/src/sys/horizon/alloc.rs b/ctr-std/src/sys/horizon/alloc.rs new file mode 100644 index 0000000..9f3b60d --- /dev/null +++ b/ctr-std/src/sys/horizon/alloc.rs @@ -0,0 +1,103 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use ptr; +use libc; +use sys_common::alloc::{MIN_ALIGN, realloc_fallback}; +use alloc::{GlobalAlloc, Layout, System}; + +#[stable(feature = "alloc_system_type", since = "1.28.0")] +unsafe impl GlobalAlloc for System { + #[inline] + unsafe fn alloc(&self, layout: Layout) -> *mut u8 { + if layout.align() <= MIN_ALIGN && layout.align() <= layout.size() { + libc::malloc(layout.size()) as *mut u8 + } else { + #[cfg(target_os = "macos")] + { + if layout.align() > (1 << 31) { + return ptr::null_mut() + } + } + aligned_malloc(&layout) + } + } + + #[inline] + unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8 { + if layout.align() <= MIN_ALIGN && layout.align() <= layout.size() { + libc::calloc(layout.size(), 1) as *mut u8 + } else { + let ptr = self.alloc(layout.clone()); + if !ptr.is_null() { + ptr::write_bytes(ptr, 0, layout.size()); + } + ptr + } + } + + #[inline] + unsafe fn dealloc(&self, ptr: *mut u8, _layout: Layout) { + libc::free(ptr as *mut libc::c_void) + } + + #[inline] + unsafe fn realloc(&self, ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8 { + if layout.align() <= MIN_ALIGN && layout.align() <= new_size { + libc::realloc(ptr as *mut libc::c_void, new_size) as *mut u8 + } else { + realloc_fallback(self, ptr, layout, new_size) + } + } +} + +#[cfg(any(target_os = "android", + target_os = "hermit", + target_os = "redox", + target_os = "solaris", + target_os = "horizon"))] +#[inline] +unsafe fn aligned_malloc(layout: &Layout) -> *mut u8 { + // On android we currently target API level 9 which unfortunately + // doesn't have the `posix_memalign` API used below. Instead we use + // `memalign`, but this unfortunately has the property on some systems + // where the memory returned cannot be deallocated by `free`! + // + // Upon closer inspection, however, this appears to work just fine with + // Android, so for this platform we should be fine to call `memalign` + // (which is present in API level 9). Some helpful references could + // possibly be chromium using memalign [1], attempts at documenting that + // memalign + free is ok [2] [3], or the current source of chromium + // which still uses memalign on android [4]. + // + // [1]: https://codereview.chromium.org/10796020/ + // [2]: https://code.google.com/p/android/issues/detail?id=35391 + // [3]: https://bugs.chromium.org/p/chromium/issues/detail?id=138579 + // [4]: https://chromium.googlesource.com/chromium/src/base/+/master/ + // /memory/aligned_memory.cc + libc::memalign(layout.align(), layout.size()) as *mut u8 +} + +#[cfg(not(any(target_os = "android", + target_os = "hermit", + target_os = "redox", + target_os = "solaris", + target_os = "horizon")))] +#[inline] +unsafe fn aligned_malloc(layout: &Layout) -> *mut u8 { + let mut out = ptr::null_mut(); + let ret = libc::posix_memalign(&mut out, layout.align(), layout.size()); + if ret != 0 { + ptr::null_mut() + } else { + out as *mut u8 + } +} + diff --git a/ctr-std/src/sys/horizon/backtrace/tracing/gcc_s.rs b/ctr-std/src/sys/horizon/backtrace/tracing/gcc_s.rs index 1b92fc0..f11969b 100644 --- a/ctr-std/src/sys/horizon/backtrace/tracing/gcc_s.rs +++ b/ctr-std/src/sys/horizon/backtrace/tracing/gcc_s.rs @@ -68,6 +68,9 @@ pub fn unwind_backtrace(frames: &mut [Frame]) extern fn trace_fn(ctx: *mut uw::_Unwind_Context, arg: *mut libc::c_void) -> uw::_Unwind_Reason_Code { let cx = unsafe { &mut *(arg as *mut Context) }; + if cx.idx >= cx.frames.len() { + return uw::_URC_NORMAL_STOP; + } let mut ip_before_insn = 0; let mut ip = unsafe { uw::_Unwind_GetIPInfo(ctx, &mut ip_before_insn) as *mut libc::c_void @@ -94,14 +97,12 @@ extern fn trace_fn(ctx: *mut uw::_Unwind_Context, unsafe { uw::_Unwind_FindEnclosingFunction(ip) } }; - if cx.idx < cx.frames.len() { - cx.frames[cx.idx] = Frame { - symbol_addr: symaddr as *mut u8, - exact_position: ip as *mut u8, - inline_context: 0, - }; - cx.idx += 1; + cx.frames[cx.idx] = Frame { + symbol_addr: symaddr as *mut u8, + exact_position: ip as *mut u8, + inline_context: 0, } + cx.idx += 1; uw::_URC_NO_REASON } diff --git a/ctr-std/src/sys/horizon/fd.rs b/ctr-std/src/sys/horizon/fd.rs index 8925e72..c810b5b 100644 --- a/ctr-std/src/sys/horizon/fd.rs +++ b/ctr-std/src/sys/horizon/fd.rs @@ -11,7 +11,7 @@ #![unstable(reason = "not public", issue = "0", feature = "fd")] use cmp; -use io::{self, Read}; +use io::{self, Read, Initializer}; use libc::{self, c_int, c_void, ssize_t}; use mem; use sync::atomic::{AtomicBool, Ordering}; @@ -247,6 +247,11 @@ impl<'a> Read for &'a FileDesc { fn read(&mut self, buf: &mut [u8]) -> io::Result { (**self).read(buf) } + + #[inline] + unsafe fn initializer(&self) -> Initializer { + Initializer::nop() + } } impl AsInner for FileDesc { @@ -259,7 +264,7 @@ impl Drop for FileDesc { // reason for this is that if an error occurs we don't actually know if // the file descriptor was closed or not, and if we retried (for // something like EINTR), we might close another valid file descriptor - // (opened after we closed ours. + // opened after we closed ours. let _ = unsafe { libc::close(self.fd) }; } } diff --git a/ctr-std/src/sys/horizon/fs.rs b/ctr-std/src/sys/horizon/fs.rs index f370d9c..b7e0fe4 100644 --- a/ctr-std/src/sys/horizon/fs.rs +++ b/ctr-std/src/sys/horizon/fs.rs @@ -840,7 +840,7 @@ pub fn copy(from: &Path, to: &Path) -> io::Result { use sync::atomic::{AtomicBool, Ordering}; // Kernel prior to 4.5 don't have copy_file_range - // We store the availability in a global to avoid unneccessary syscalls + // We store the availability in a global to avoid unnecessary syscalls static HAS_COPY_FILE_RANGE: AtomicBool = AtomicBool::new(true); unsafe fn copy_file_range( diff --git a/ctr-std/src/sys/horizon/mod.rs b/ctr-std/src/sys/horizon/mod.rs index efbe0bb..f5d5a9e 100644 --- a/ctr-std/src/sys/horizon/mod.rs +++ b/ctr-std/src/sys/horizon/mod.rs @@ -8,27 +8,27 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![allow(missing_docs, bad_style)] +#![allow(missing_docs, nonstandard_style)] use io::{self, ErrorKind}; use libc; -#[cfg(any(dox, target_os = "linux"))] pub use os::linux as platform; - -#[cfg(all(not(dox), target_os = "android"))] pub use os::android as platform; -#[cfg(all(not(dox), target_os = "bitrig"))] pub use os::bitrig as platform; -#[cfg(all(not(dox), target_os = "dragonfly"))] pub use os::dragonfly as platform; -#[cfg(all(not(dox), target_os = "freebsd"))] pub use os::freebsd as platform; -#[cfg(all(not(dox), target_os = "haiku"))] pub use os::haiku as platform; -#[cfg(all(not(dox), target_os = "ios"))] pub use os::ios as platform; -#[cfg(all(not(dox), target_os = "macos"))] pub use os::macos as platform; -#[cfg(all(not(dox), target_os = "netbsd"))] pub use os::netbsd as platform; -#[cfg(all(not(dox), target_os = "openbsd"))] pub use os::openbsd as platform; -#[cfg(all(not(dox), target_os = "solaris"))] pub use os::solaris as platform; -#[cfg(all(not(dox), target_os = "emscripten"))] pub use os::emscripten as platform; -#[cfg(all(not(dox), target_os = "fuchsia"))] pub use os::fuchsia as platform; -#[cfg(all(not(dox), target_os = "l4re"))] pub use os::linux as platform; -#[cfg(all(not(dox), target_os = "horizon"))] pub use os::horizon as platform; +#[cfg(any(rustdoc, target_os = "linux"))] pub use os::linux as platform; + +#[cfg(all(not(rustdoc), target_os = "android"))] pub use os::android as platform; +#[cfg(all(not(rustdoc), target_os = "bitrig"))] pub use os::bitrig as platform; +#[cfg(all(not(rustdoc), target_os = "dragonfly"))] pub use os::dragonfly as platform; +#[cfg(all(not(rustdoc), target_os = "freebsd"))] pub use os::freebsd as platform; +#[cfg(all(not(rustdoc), target_os = "haiku"))] pub use os::haiku as platform; +#[cfg(all(not(rustdoc), target_os = "ios"))] pub use os::ios as platform; +#[cfg(all(not(rustdoc), target_os = "macos"))] pub use os::macos as platform; +#[cfg(all(not(rustdoc), target_os = "netbsd"))] pub use os::netbsd as platform; +#[cfg(all(not(rustdoc), target_os = "openbsd"))] pub use os::openbsd as platform; +#[cfg(all(not(rustdoc), target_os = "solaris"))] pub use os::solaris as platform; +#[cfg(all(not(rustdoc), target_os = "emscripten"))] pub use os::emscripten as platform; +#[cfg(all(not(rustdoc), target_os = "fuchsia"))] pub use os::fuchsia as platform; +#[cfg(all(not(rustdoc), target_os = "l4re"))] pub use os::linux as platform; +#[cfg(all(not(rustdoc), target_os = "horizon"))] pub use os::horizon as platform; pub use self::rand::hashmap_random_keys; pub use libc::strlen; @@ -36,6 +36,7 @@ pub use libc::strlen; #[macro_use] pub mod weak; +pub mod alloc; pub mod args; pub mod android; #[cfg(feature = "backtrace")] diff --git a/ctr-std/src/sys/horizon/net.rs b/ctr-std/src/sys/horizon/net.rs index 14c58eb..524536f 100644 --- a/ctr-std/src/sys/horizon/net.rs +++ b/ctr-std/src/sys/horizon/net.rs @@ -37,7 +37,7 @@ use libc::SOCK_CLOEXEC; #[cfg(not(target_os = "linux"))] const SOCK_CLOEXEC: c_int = 0; -// Another conditional contant for name resolution: Macos et iOS use +// Another conditional constant for name resolution: Macos et iOS use // SO_NOSIGPIPE as a setsockopt flag to disable SIGPIPE emission on socket. // Other platforms do otherwise. #[cfg(target_vendor = "apple")] @@ -400,30 +400,3 @@ fn on_resolver_failure() { #[cfg(not(target_env = "gnu"))] fn on_resolver_failure() {} - -#[cfg(all(test, taget_env = "gnu"))] -mod test { - use super::*; - - #[test] - fn test_res_init() { - // This mostly just tests that the weak linkage doesn't panic wildly... - res_init_if_glibc_before_2_26().unwrap(); - } - - #[test] - fn test_parse_glibc_version() { - let cases = [ - ("0.0", Some((0, 0))), - ("01.+2", Some((1, 2))), - ("3.4.5.six", Some((3, 4))), - ("1", None), - ("1.-2", None), - ("1.foo", None), - ("foo.1", None), - ]; - for &(version_str, parsed) in cases.iter() { - assert_eq!(parsed, parse_glibc_version(version_str)); - } - } -} diff --git a/ctr-std/src/sys/horizon/process.rs b/ctr-std/src/sys/horizon/process.rs index 15b0e31..625122c 100644 --- a/ctr-std/src/sys/horizon/process.rs +++ b/ctr-std/src/sys/horizon/process.rs @@ -15,6 +15,7 @@ use sys::fs::File; use sys::pipe::AnonPipe; use sys::{unsupported, Void}; use sys_common::process::{CommandEnv, DefaultEnvKey}; +use sys; //////////////////////////////////////////////////////////////////////////////// // Command @@ -148,4 +149,4 @@ impl Process { pub fn try_wait(&mut self) -> io::Result> { match self.0 {} } -} \ No newline at end of file +} diff --git a/ctr-std/src/sys/horizon/time.rs b/ctr-std/src/sys/horizon/time.rs index aa66cf1..20ebba0 100644 --- a/ctr-std/src/sys/horizon/time.rs +++ b/ctr-std/src/sys/horizon/time.rs @@ -42,23 +42,25 @@ impl Timespec { } fn add_duration(&self, other: &Duration) -> Timespec { + self.checked_add_duration(other).expect("overflow when adding duration to time") + } + fn checked_add_duration(&self, other: &Duration) -> Option { let secs = (self.t.tv_sec as i64).checked_add(other.as_secs() as i64); - let mut secs = secs.expect("overflow when adding duration to time"); + let mut secs = secs?; // Nano calculations can't overflow because nanos are <1B which fit // in a u32. let mut nsec = other.subsec_nanos() + self.t.tv_nsec as u32; if nsec >= NSEC_PER_SEC as u32 { nsec -= NSEC_PER_SEC as u32; - secs = secs.checked_add(1).expect("overflow when adding \ - duration to time"); + secs = secs.checked_add(1)?; } - Timespec { + Some(Timespec { t: libc::timespec { tv_sec: secs as libc::time_t, tv_nsec: nsec as libc::c_long, }, - } + }) } fn sub_duration(&self, other: &Duration) -> Timespec { @@ -156,6 +158,17 @@ mod inner { Duration::new(nanos / NSEC_PER_SEC, (nanos % NSEC_PER_SEC) as u32) } +/* pub fn checked_add_duration(&self, other: &Duration) -> Option { + self.t.checked_add(dur2intervals(other)).map(|tv_sec| SystemTime { + t: Timespec { + t: libc::timespec { + tv_sec as i32, + tv_nsec: 0 + } + } + }) + }*/ + pub fn add_duration(&self, other: &Duration) -> Instant { Instant { t: self.t.checked_add(dur2intervals(other)) @@ -254,6 +267,10 @@ mod inner { SystemTime { t: self.t.add_duration(other) } } + pub fn checked_add_duration(&self, other: &Duration) -> Option { + self.t.checked_add_duration(other).map(|t| SystemTime { t }) + } + pub fn sub_duration(&self, other: &Duration) -> SystemTime { SystemTime { t: self.t.sub_duration(other) } } @@ -270,7 +287,7 @@ mod inner { impl From for SystemTime { fn from(t: libc::timespec) -> SystemTime { - SystemTime { t: Timespec { t: t } } + SystemTime { t: Timespec { t } } } } @@ -282,4 +299,4 @@ mod inner { .finish() } } -} \ No newline at end of file +} diff --git a/ctr-std/src/sys/mod.rs b/ctr-std/src/sys/mod.rs index 9aa6662..68b09ad 100644 --- a/ctr-std/src/sys/mod.rs +++ b/ctr-std/src/sys/mod.rs @@ -60,7 +60,7 @@ cfg_if! { // then later used in the `std::os` module when documenting, for example, // Windows when we're compiling for Linux. -#[cfg(dox)] +#[cfg(rustdoc)] cfg_if! { if #[cfg(any(unix, target_os = "redox"))] { // On unix we'll document what's already available @@ -80,7 +80,7 @@ cfg_if! { } } -#[cfg(dox)] +#[cfg(rustdoc)] cfg_if! { if #[cfg(windows)] { // On windows we'll just be documenting what's already available diff --git a/ctr-std/src/sys_common/alloc.rs b/ctr-std/src/sys_common/alloc.rs new file mode 100644 index 0000000..e8df716 --- /dev/null +++ b/ctr-std/src/sys_common/alloc.rs @@ -0,0 +1,50 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![allow(dead_code)] + +use alloc::{GlobalAlloc, Layout, System}; +use cmp; +use ptr; + +// The minimum alignment guaranteed by the architecture. This value is used to +// add fast paths for low alignment values. +#[cfg(all(any(target_arch = "x86", + target_arch = "arm", + target_arch = "mips", + target_arch = "powerpc", + target_arch = "powerpc64", + target_arch = "asmjs", + target_arch = "wasm32")))] +pub const MIN_ALIGN: usize = 8; +#[cfg(all(any(target_arch = "x86_64", + target_arch = "aarch64", + target_arch = "mips64", + target_arch = "s390x", + target_arch = "sparc64")))] +pub const MIN_ALIGN: usize = 16; + +pub unsafe fn realloc_fallback( + alloc: &System, + ptr: *mut u8, + old_layout: Layout, + new_size: usize, +) -> *mut u8 { + // Docs for GlobalAlloc::realloc require this to be valid: + let new_layout = Layout::from_size_align_unchecked(new_size, old_layout.align()); + + let new_ptr = GlobalAlloc::alloc(alloc, new_layout); + if !new_ptr.is_null() { + let size = cmp::min(old_layout.size(), new_size); + GlobalAlloc::dealloc(alloc, ptr, old_layout); + } + new_ptr +} + diff --git a/ctr-std/src/sys_common/mod.rs b/ctr-std/src/sys_common/mod.rs index d0c4d6a..4b8cde3 100644 --- a/ctr-std/src/sys_common/mod.rs +++ b/ctr-std/src/sys_common/mod.rs @@ -38,6 +38,7 @@ macro_rules! rtassert { }) } +pub mod alloc; pub mod at_exit_imp; #[cfg(feature = "backtrace")] pub mod backtrace; diff --git a/ctr-std/src/thread/local.rs b/ctr-std/src/thread/local.rs index a170abb..efa1712 100644 --- a/ctr-std/src/thread/local.rs +++ b/ctr-std/src/thread/local.rs @@ -14,6 +14,7 @@ use cell::UnsafeCell; use fmt; +use hint; use mem; /// A thread local storage key which owns its contents. @@ -145,13 +146,13 @@ macro_rules! thread_local { // process multiple declarations ($(#[$attr:meta])* $vis:vis static $name:ident: $t:ty = $init:expr; $($rest:tt)*) => ( - __thread_local_inner!($(#[$attr])* $vis $name, $t, $init); - thread_local!($($rest)*); + $crate::__thread_local_inner!($(#[$attr])* $vis $name, $t, $init); + $crate::thread_local!($($rest)*); ); // handle a single declaration ($(#[$attr:meta])* $vis:vis static $name:ident: $t:ty = $init:expr) => ( - __thread_local_inner!($(#[$attr])* $vis $name, $t, $init); + $crate::__thread_local_inner!($(#[$attr])* $vis $name, $t, $init); ); } @@ -195,7 +196,7 @@ macro_rules! __thread_local_inner { }; ($(#[$attr:meta])* $vis:vis $name:ident, $t:ty, $init:expr) => { $(#[$attr])* $vis const $name: $crate::thread::LocalKey<$t> = - __thread_local_inner!(@key $(#[$attr])* $vis $name, $t, $init); + $crate::__thread_local_inner!(@key $(#[$attr])* $vis $name, $t, $init); } } @@ -269,7 +270,10 @@ impl LocalKey { // operations a little differently and make this safe to call. mem::replace(&mut *ptr, Some(value)); - (*ptr).as_ref().unwrap() + match *ptr { + Some(ref x) => x, + None => hint::unreachable_unchecked(), + } } /// Acquires a reference to the value in this TLS key. diff --git a/ctr-std/src/thread/mod.rs b/ctr-std/src/thread/mod.rs index 61c6084..ba80c0c 100644 --- a/ctr-std/src/thread/mod.rs +++ b/ctr-std/src/thread/mod.rs @@ -386,6 +386,12 @@ impl Builder { #[stable(feature = "rust1", since = "1.0.0")] pub fn spawn(self, f: F) -> io::Result> where F: FnOnce() -> T, F: Send + 'static, T: Send + 'static + { + unsafe { self.spawn_unchecked(f) } + } + #[unstable(feature = "thread_spawn_unchecked", issue = "55132")] + pub unsafe fn spawn_unchecked(self, f: F) -> io::Result> where + F: FnOnce() -> T, F: Send, T: Send { let Builder { name, stack_size } = self; @@ -402,22 +408,18 @@ impl Builder { if let Some(name) = their_thread.cname() { imp::Thread::set_name(name); } - unsafe { - thread_info::set(imp::guard::current(), their_thread); - #[cfg(feature = "backtrace")] - let try_result = panic::catch_unwind(panic::AssertUnwindSafe(|| { - ::sys_common::backtrace::__rust_begin_short_backtrace(f) - })); - #[cfg(not(feature = "backtrace"))] - let try_result = panic::catch_unwind(panic::AssertUnwindSafe(f)); - *their_packet.get() = Some(try_result); - } + thread_info::set(imp::guard::current(), their_thread); + #[cfg(feature = "backtrace")] + let try_result = panic::catch_unwind(panic::AssertUnwindSafe(|| { + ::sys_common::backtrace::__rust_begin_short_backtrace(f) + })); + #[cfg(not(feature = "backtrace"))] + let try_result = panic::catch_unwind(panic::AssertUnwindSafe(f)); + *their_packet.get() = Some(try_result); }; Ok(JoinHandle(JoinInner { - native: unsafe { - Some(imp::Thread::new(stack_size, Box::new(main))?) - }, + native: Some(imp::Thread::new(stack_size, Box::new(main))?), thread: my_thread, packet: Packet(my_packet), })) @@ -800,7 +802,8 @@ pub fn park() { match thread.inner.state.compare_exchange(EMPTY, PARKED, SeqCst, SeqCst) { Ok(_) => {} Err(NOTIFIED) => { - thread.inner.state.store(EMPTY, SeqCst); + let old = thread.inner.state.swap(EMPTY, SeqCst); + assert_eq!(old, NOTIFIED, "park state changed unexpectedly"); return; } // should consume this notification, so prohibit spurious wakeups in next park. Err(_) => panic!("inconsistent park state"), @@ -889,7 +892,8 @@ pub fn park_timeout(dur: Duration) { match thread.inner.state.compare_exchange(EMPTY, PARKED, SeqCst, SeqCst) { Ok(_) => {} Err(NOTIFIED) => { - thread.inner.state.store(EMPTY, SeqCst); + let old = thread.inner.state.swap(EMPTY, SeqCst); + assert_eq!(old, NOTIFIED, "park state changed unexpectedly"); return; } // should consume this notification, so prohibit spurious wakeups in next park. Err(_) => panic!("inconsistent park_timeout state"), @@ -1058,23 +1062,22 @@ impl Thread { /// [park]: fn.park.html #[stable(feature = "rust1", since = "1.0.0")] pub fn unpark(&self) { - loop { - match self.inner.state.compare_exchange(EMPTY, NOTIFIED, SeqCst, SeqCst) { - Ok(_) => return, // no one was waiting - Err(NOTIFIED) => return, // already unparked - Err(PARKED) => {} // gotta go wake someone up - _ => panic!("inconsistent state in unpark"), - } - - // Coordinate wakeup through the mutex and a condvar notification - let _lock = self.inner.lock.lock().unwrap(); - match self.inner.state.compare_exchange(PARKED, NOTIFIED, SeqCst, SeqCst) { - Ok(_) => return self.inner.cvar.notify_one(), - Err(NOTIFIED) => return, // a different thread unparked - Err(EMPTY) => {} // parked thread went away, try again - _ => panic!("inconsistent state in unpark"), - } + // To ensure the unparked thread will observe any writes we made + // before this call, we must perform a release operation that `park` + // can synchronize with. To do that we must write `NOTIFIED` even if + // `state` is already `NOTIFIED`. That is why this must be a swap + // rather than a compare-and-swap that returns if it reads `NOTIFIED` + // on failure. + match self.inner.state.swap(NOTIFIED, SeqCst) { + EMPTY => return, // no one was waiting + NOTIFIED => return, // already unparked + PARKED => {} // gotta go wake someone up + _ => panic!("inconsistent state in unpark"), } + // Coordinate wakeup through the mutex and a condvar notification + drop(self.inner.lock.lock().unwrap()); + self.inner.cvar.notify_one() + } /// Gets the thread's unique identifier. diff --git a/ctr-std/src/time.rs b/ctr-std/src/time.rs index 90ab349..a003239 100644 --- a/ctr-std/src/time.rs +++ b/ctr-std/src/time.rs @@ -208,6 +208,11 @@ impl Instant { pub fn elapsed(&self) -> Duration { Instant::now() - *self } +/* #[unstable(feature = "time_checked_add", issue = "55940")] + pub fn checked_add(&self, duration: Duration) -> Option { + self.0.checked_add_duration(&duration).map(|t| SystemTime(t)) + } + */ } #[stable(feature = "time2", since = "1.8.0")] @@ -481,7 +486,8 @@ mod tests { let (a, b) = ($a, $b); if a != b { let (a, b) = if a > b {(a, b)} else {(b, a)}; - assert!(a - Duration::new(0, 100) <= b); + assert!(a - Duration::new(0, 1000) <= b, + "{:?} is not almost equal to {:?}", a, b); } }) } diff --git a/ctru-rs/Cargo.toml b/ctru-rs/Cargo.toml index 3ac66d1..e421bc7 100644 --- a/ctru-rs/Cargo.toml +++ b/ctru-rs/Cargo.toml @@ -14,7 +14,7 @@ path = "../ctru-sys" version = "0.4" [dependencies.libc] -version = "0.2" +version = "0.2.43" [dependencies.bitflags] version = "1.0.0" diff --git a/ctru-sys/Cargo.toml b/ctru-sys/Cargo.toml index 4d1d0cf..5890bba 100644 --- a/ctru-sys/Cargo.toml +++ b/ctru-sys/Cargo.toml @@ -4,8 +4,10 @@ version = "0.4.0" authors = ["Ronald Kinard "] license = "https://en.wikipedia.org/wiki/Zlib_License" +[dependencies] +compiler_builtins = { version = "0.1", optional = true } [dependencies.libc] -version = "0.2" +version = "0.2.43" default-features = false optional = true @@ -15,3 +17,4 @@ default = ["libc"] # This is a dummy feature that only exists to work around a Xargo issue. # User code should not enable it. stdbuild = [] +newnightly = ["compiler_builtins"]