From 025d60356daec5334a2871df012c5db8fa17c441 Mon Sep 17 00:00:00 2001 From: TechiePi Date: Tue, 4 Apr 2023 18:49:41 +0200 Subject: [PATCH 001/101] Add `bindgen-ctru-sys` package and update bindings - Added the `bindgen-ctru-sys` to be able to use `ParseCallbacks` when generating the bindings. - Updated `doxygen-rs` to 0.4, which has a faster engine and more extensible internal (even though there are some regressions). - Removes the `docstring-to-rustdoc` package because it is no longer needed. --- Cargo.toml | 2 +- .../Cargo.toml | 5 +- ctru-sys/bindgen-ctru-sys/src/main.rs | 61 + ctru-sys/bindgen.sh | 30 +- ctru-sys/docstring-to-rustdoc/src/main.rs | 31 - ctru-sys/src/bindings.rs | 11696 +++++----------- 6 files changed, 3486 insertions(+), 8339 deletions(-) rename ctru-sys/{docstring-to-rustdoc => bindgen-ctru-sys}/Cargo.toml (50%) create mode 100644 ctru-sys/bindgen-ctru-sys/src/main.rs delete mode 100644 ctru-sys/docstring-to-rustdoc/src/main.rs diff --git a/Cargo.toml b/Cargo.toml index 0d8eaac..63a1ace 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] -members = ["ctru-rs", "ctru-sys", "ctru-sys/docstring-to-rustdoc"] +members = ["ctru-rs", "ctru-sys", "ctru-sys/bindgen-ctru-sys"] [patch.'https://github.com/rust3ds/ctru-rs'] # Make sure all dependencies use the local ctru-sys package diff --git a/ctru-sys/docstring-to-rustdoc/Cargo.toml b/ctru-sys/bindgen-ctru-sys/Cargo.toml similarity index 50% rename from ctru-sys/docstring-to-rustdoc/Cargo.toml rename to ctru-sys/bindgen-ctru-sys/Cargo.toml index 745f39e..a8c3cd1 100644 --- a/ctru-sys/docstring-to-rustdoc/Cargo.toml +++ b/ctru-sys/bindgen-ctru-sys/Cargo.toml @@ -1,7 +1,8 @@ [package] -name = "docstring-to-rustdoc" +name = "bindgen-ctru-sys" version = "0.1.0" edition = "2021" [dependencies] -doxygen-rs = "0.3.1" +bindgen = "0.64" +doxygen-rs = "0.4" \ No newline at end of file diff --git a/ctru-sys/bindgen-ctru-sys/src/main.rs b/ctru-sys/bindgen-ctru-sys/src/main.rs new file mode 100644 index 0000000..08f2e9b --- /dev/null +++ b/ctru-sys/bindgen-ctru-sys/src/main.rs @@ -0,0 +1,61 @@ +use bindgen::callbacks::ParseCallbacks; +use bindgen::{Builder, RustTarget}; +use std::path::PathBuf; + +#[derive(Debug)] +struct CustomCallbacks; + +impl ParseCallbacks for CustomCallbacks { + fn process_comment(&self, comment: &str) -> Option { + Some(doxygen_rs::transform(comment)) + } +} + +fn main() { + let devkitpro = std::env::var("DEVKITPRO").expect("DEVKITPRO not set in environment"); + let devkitarm = std::env::var("DEVKITARM").expect("DEVKITARM not set in environment"); + + let include_path = PathBuf::from_iter([devkitpro.as_str(), "libctru", "include"]); + let header = include_path.join("3ds.h"); + + let sysroot = PathBuf::from(devkitarm).join("arm-none-eabi"); + let system_include = sysroot.join("include"); + + let bindings = Builder::default() + .header(header.to_str().unwrap()) + .rust_target(RustTarget::Nightly) + .use_core() + .trust_clang_mangling(false) + .must_use_type("Result") + .layout_tests(false) + .ctypes_prefix("::libc") + .prepend_enum_name(false) + .blocklist_type("u(8|16|32|64)") + .blocklist_type("__builtin_va_list") + .blocklist_type("__va_list") + .opaque_type("MiiData") + .derive_default(true) + .clang_args([ + "--target=arm-none-eabi", + "--sysroot", + sysroot.to_str().unwrap(), + "-isystem", + system_include.to_str().unwrap(), + "-I", + include_path.to_str().unwrap(), + "-mfloat-abi=hard", + "-march=armv6k", + "-mtune=mpcore", + "-mfpu=vfp", + "-DARM11 ", + "-D_3DS ", + "-D__3DS__ ", + ]) + .parse_callbacks(Box::new(CustomCallbacks)) + .generate() + .expect("unable to generate bindings"); + + bindings + .write(Box::new(std::io::stdout())) + .expect("failed to write bindings"); +} diff --git a/ctru-sys/bindgen.sh b/ctru-sys/bindgen.sh index 501459c..986ce56 100755 --- a/ctru-sys/bindgen.sh +++ b/ctru-sys/bindgen.sh @@ -21,35 +21,7 @@ CTRU_SYS_VERSION="$( )" echo "Generating bindings.rs..." -bindgen "$DEVKITPRO/libctru/include/3ds.h" \ - --rust-target nightly \ - --use-core \ - --distrust-clang-mangling \ - --must-use-type 'Result' \ - --no-layout-tests \ - --ctypes-prefix "::libc" \ - --no-prepend-enum-name \ - --generate "functions,types,vars" \ - --blocklist-type "u(8|16|32|64)" \ - --blocklist-type "__builtin_va_list" \ - --blocklist-type "__va_list" \ - --opaque-type "MiiData" \ - --with-derive-default \ - -- \ - --target=arm-none-eabi \ - --sysroot="$DEVKITARM/arm-none-eabi" \ - -isystem"$DEVKITARM/arm-none-eabi/include" \ - -I"$DEVKITPRO/libctru/include" \ - -mfloat-abi=hard \ - -march=armv6k \ - -mtune=mpcore \ - -mfpu=vfp \ - -DARM11 \ - -D__3DS__ \ -> src/bindings.rs - -echo "Updating docstrings in bindings.rs..." -cargo run --quiet --package docstring-to-rustdoc -- src/bindings.rs +cargo run --package bindgen-ctru-sys > src/bindings.rs echo "Formatting generated files..." cargo fmt --all diff --git a/ctru-sys/docstring-to-rustdoc/src/main.rs b/ctru-sys/docstring-to-rustdoc/src/main.rs deleted file mode 100644 index c86cc85..0000000 --- a/ctru-sys/docstring-to-rustdoc/src/main.rs +++ /dev/null @@ -1,31 +0,0 @@ -//! This script transforms _some_ Boxygen comments to Rustdoc format -//! -//! # Usage -//! -//! `cargo run --package docstring-to-rustdoc -- [location of the bindings.rs]` -//! Example: `cargo run --package docstring-to-rustdoc -- src/bindings.rs` -//! -//! # Transformations -//! -//! Check [doxygen-rs docs](https://techie-pi.github.io/doxygen-rs/doxygen_rs/) - -use std::path::Path; -use std::{env, fs, io}; - -fn main() -> io::Result<()> { - let args: Vec = env::args().collect(); - - let bindings_path = Path::new(args.get(1).expect("bindings.rs not provided in the args")); - let bindings = fs::read_to_string(bindings_path)?; - - let parsed = doxygen_rs::transform_bindgen(bindings.as_str()); - - let old_bindings_path = bindings_path.to_str().unwrap().to_owned() + ".old"; - - // If something fails, the original bindings are available at ``bindings.rs.old`` - fs::rename(bindings_path, &old_bindings_path)?; - fs::write(bindings_path, parsed)?; - fs::remove_file(&old_bindings_path)?; - - Ok(()) -} diff --git a/ctru-sys/src/bindings.rs b/ctru-sys/src/bindings.rs index c33ae96..a7f40f7 100644 --- a/ctru-sys/src/bindings.rs +++ b/ctru-sys/src/bindings.rs @@ -208,9 +208,9 @@ 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 __bool_true_false_are_defined: u32 = 1; 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; @@ -1289,53 +1289,42 @@ pub type Handle = u32_; pub type Result = s32; pub type ThreadFunc = ::core::option::Option; pub type voidfn = ::core::option::Option; -#[doc = "Structure representing CPU registers"] -#[doc = ""] +#[doc = " Structure representing CPU registers"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct CpuRegisters { - #[doc = "r0-r12."] - #[doc = ""] + #[doc = "< r0-r12."] pub r: [u32_; 13usize], - #[doc = "sp."] - #[doc = ""] + #[doc = "< sp."] pub sp: u32_, - #[doc = "lr."] - #[doc = ""] + #[doc = "< lr."] pub lr: u32_, - #[doc = "pc. May need to be adjusted."] - #[doc = ""] + #[doc = "< pc. May need to be adjusted."] pub pc: u32_, - #[doc = "cpsr."] - #[doc = ""] + #[doc = "< cpsr."] pub cpsr: u32_, } -#[doc = "Structure representing FPU registers"] -#[doc = ""] +#[doc = " Structure representing FPU registers"] #[repr(C)] #[derive(Copy, Clone)] pub struct FpuRegisters { pub __bindgen_anon_1: FpuRegisters__bindgen_ty_1, - #[doc = "fpscr."] - #[doc = ""] + #[doc = "< fpscr."] pub fpscr: u32_, - #[doc = "fpexc."] - #[doc = ""] + #[doc = "< fpexc."] 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, - #[doc = "s0-s31."] - #[doc = ""] + #[doc = "< s0-s31."] pub s: [f32; 32usize], } #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone)] pub struct FpuRegisters__bindgen_ty_1__bindgen_ty_1 { - #[doc = "d0-d15."] - #[doc = ""] + #[doc = "< d0-d15."] pub d: [f64; 16usize], } impl Default for FpuRegisters__bindgen_ty_1 { @@ -1365,9 +1354,7 @@ 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; -#[doc = "Result code level values."] -#[doc = ""] - +#[doc = " Result code level values."] pub type _bindgen_ty_1 = ::libc::c_uint; pub const RS_SUCCESS: _bindgen_ty_2 = 0; pub const RS_NOP: _bindgen_ty_2 = 1; @@ -1382,9 +1369,7 @@ 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; -#[doc = "Result code summary values."] -#[doc = ""] - +#[doc = " Result code summary values."] pub type _bindgen_ty_2 = ::libc::c_uint; pub const RM_COMMON: _bindgen_ty_3 = 0; pub const RM_KERNEL: _bindgen_ty_3 = 1; @@ -1484,9 +1469,7 @@ 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; -#[doc = "Result code module values."] -#[doc = ""] - +#[doc = " Result code module values."] pub type _bindgen_ty_3 = ::libc::c_uint; pub const RD_SUCCESS: _bindgen_ty_4 = 0; pub const RD_INVALID_RESULT_VALUE: _bindgen_ty_4 = 1023; @@ -1513,504 +1496,272 @@ 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; -#[doc = "Result code generic description values."] -#[doc = ""] - +#[doc = " Result code generic description values."] pub type _bindgen_ty_4 = ::libc::c_uint; -#[doc = "Readable"] -#[doc = ""] - +#[doc = "< Readable"] pub const IPC_BUFFER_R: IPC_BufferRights = 2; -#[doc = "Writable"] -#[doc = ""] - +#[doc = "< Writable"] pub const IPC_BUFFER_W: IPC_BufferRights = 4; -#[doc = "Readable and Writable"] -#[doc = ""] - +#[doc = "< Readable and Writable"] pub const IPC_BUFFER_RW: IPC_BufferRights = 6; -#[doc = "IPC buffer access rights."] -#[doc = ""] - +#[doc = " IPC buffer access rights."] pub type IPC_BufferRights = ::libc::c_uint; -#[doc = "Memory un-mapping"] -#[doc = ""] - +#[doc = "< Memory un-mapping"] pub const MEMOP_FREE: MemOp = 1; -#[doc = "Reserve memory"] -#[doc = ""] - +#[doc = "< Reserve memory"] pub const MEMOP_RESERVE: MemOp = 2; -#[doc = "Memory mapping"] -#[doc = ""] - +#[doc = "< Memory mapping"] pub const MEMOP_ALLOC: MemOp = 3; -#[doc = "Mirror mapping"] -#[doc = ""] - +#[doc = "< Mirror mapping"] pub const MEMOP_MAP: MemOp = 4; -#[doc = "Mirror unmapping"] -#[doc = ""] - +#[doc = "< Mirror unmapping"] pub const MEMOP_UNMAP: MemOp = 5; -#[doc = "Change protection"] -#[doc = ""] - +#[doc = "< Change protection"] pub const MEMOP_PROT: MemOp = 6; -#[doc = "APPLICATION memory region."] -#[doc = ""] - +#[doc = "< APPLICATION memory region."] pub const MEMOP_REGION_APP: MemOp = 256; -#[doc = "SYSTEM memory region."] -#[doc = ""] - +#[doc = "< SYSTEM memory region."] pub const MEMOP_REGION_SYSTEM: MemOp = 512; -#[doc = "BASE memory region."] -#[doc = ""] - +#[doc = "< BASE memory region."] pub const MEMOP_REGION_BASE: MemOp = 768; -#[doc = "Operation bitmask."] -#[doc = ""] - +#[doc = "< Operation bitmask."] pub const MEMOP_OP_MASK: MemOp = 255; -#[doc = "Region bitmask."] -#[doc = ""] - +#[doc = "< Region bitmask."] pub const MEMOP_REGION_MASK: MemOp = 3840; -#[doc = "Flag for linear memory operations"] -#[doc = ""] - +#[doc = "< Flag for linear memory operations"] pub const MEMOP_LINEAR_FLAG: MemOp = 65536; -#[doc = "Allocates linear memory."] -#[doc = ""] - +#[doc = "< Allocates linear memory."] pub const MEMOP_ALLOC_LINEAR: MemOp = 65539; -#[doc = "[`svcControlMemory`] operation flags\n\n The lowest 8 bits are the operation"] -#[doc = ""] - +#[doc = " svcControlMemory operation flags\n\n The lowest 8 bits are the operation"] pub type MemOp = ::libc::c_uint; -#[doc = "Free memory"] -#[doc = ""] - +#[doc = "< Free memory"] pub const MEMSTATE_FREE: MemState = 0; -#[doc = "Reserved memory"] -#[doc = ""] - +#[doc = "< Reserved memory"] pub const MEMSTATE_RESERVED: MemState = 1; -#[doc = "I/O memory"] -#[doc = ""] - +#[doc = "< I/O memory"] pub const MEMSTATE_IO: MemState = 2; -#[doc = "Static memory"] -#[doc = ""] - +#[doc = "< Static memory"] pub const MEMSTATE_STATIC: MemState = 3; -#[doc = "Code memory"] -#[doc = ""] - +#[doc = "< Code memory"] pub const MEMSTATE_CODE: MemState = 4; -#[doc = "Private memory"] -#[doc = ""] - +#[doc = "< Private memory"] pub const MEMSTATE_PRIVATE: MemState = 5; -#[doc = "Shared memory"] -#[doc = ""] - +#[doc = "< Shared memory"] pub const MEMSTATE_SHARED: MemState = 6; -#[doc = "Continuous memory"] -#[doc = ""] - +#[doc = "< Continuous memory"] pub const MEMSTATE_CONTINUOUS: MemState = 7; -#[doc = "Aliased memory"] -#[doc = ""] - +#[doc = "< Aliased memory"] pub const MEMSTATE_ALIASED: MemState = 8; -#[doc = "Alias memory"] -#[doc = ""] - +#[doc = "< Alias memory"] pub const MEMSTATE_ALIAS: MemState = 9; -#[doc = "Aliased code memory"] -#[doc = ""] - +#[doc = "< Aliased code memory"] pub const MEMSTATE_ALIASCODE: MemState = 10; -#[doc = "Locked memory"] -#[doc = ""] - +#[doc = "< Locked memory"] pub const MEMSTATE_LOCKED: MemState = 11; -#[doc = "The state of a memory block."] -#[doc = ""] - +#[doc = " The state of a memory block."] pub type MemState = ::libc::c_uint; -#[doc = "Readable"] -#[doc = ""] - +#[doc = "< Readable"] pub const MEMPERM_READ: MemPerm = 1; -#[doc = "Writable"] -#[doc = ""] - +#[doc = "< Writable"] pub const MEMPERM_WRITE: MemPerm = 2; -#[doc = "Executable"] -#[doc = ""] - +#[doc = "< Executable"] pub const MEMPERM_EXECUTE: MemPerm = 4; -#[doc = "Readable and writable"] -#[doc = ""] - +#[doc = "< Readable and writable"] pub const MEMPERM_READWRITE: MemPerm = 3; -#[doc = "Readable and executable"] -#[doc = ""] - +#[doc = "< Readable and executable"] pub const MEMPERM_READEXECUTE: MemPerm = 5; -#[doc = "Don't care"] -#[doc = ""] - +#[doc = "< Don't care"] pub const MEMPERM_DONTCARE: MemPerm = 268435456; -#[doc = "Memory permission flags"] -#[doc = ""] - +#[doc = " Memory permission flags"] pub type MemPerm = ::libc::c_uint; -#[doc = "All regions."] -#[doc = ""] - +#[doc = "< All regions."] pub const MEMREGION_ALL: MemRegion = 0; -#[doc = "APPLICATION memory."] -#[doc = ""] - +#[doc = "< APPLICATION memory."] pub const MEMREGION_APPLICATION: MemRegion = 1; -#[doc = "SYSTEM memory."] -#[doc = ""] - +#[doc = "< SYSTEM memory."] pub const MEMREGION_SYSTEM: MemRegion = 2; -#[doc = "BASE memory."] -#[doc = ""] - +#[doc = "< BASE memory."] pub const MEMREGION_BASE: MemRegion = 3; -#[doc = "Memory regions."] -#[doc = ""] - +#[doc = " Memory regions."] pub type MemRegion = ::libc::c_uint; -#[doc = "Memory information."] -#[doc = ""] +#[doc = " Memory information."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct MemInfo { - #[doc = "Base address."] - #[doc = ""] + #[doc = "< Base address."] pub base_addr: u32_, - #[doc = "Size."] - #[doc = ""] + #[doc = "< Size."] pub size: u32_, - #[doc = "Memory permissions. See [`MemPerm`]"] - #[doc = ""] + #[doc = "< Memory permissions. See MemPerm"] pub perm: u32_, - #[doc = "Memory state. See [`MemState`]"] - #[doc = ""] + #[doc = "< Memory state. See MemState"] pub state: u32_, } -#[doc = "Memory page information."] -#[doc = ""] +#[doc = " Memory page information."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct PageInfo { - #[doc = "Page flags."] - #[doc = ""] + #[doc = "< Page flags."] pub flags: u32_, } -#[doc = "Signal #value threads for wake-up."] -#[doc = ""] - +#[doc = "< Signal #value threads for wake-up."] pub const ARBITRATION_SIGNAL: ArbitrationType = 0; -#[doc = "If the memory at the address is strictly lower than #value, then wait for signal."] -#[doc = ""] - +#[doc = "< If the memory at the address is strictly lower than #value, then wait for signal."] pub const ARBITRATION_WAIT_IF_LESS_THAN: ArbitrationType = 1; -#[doc = "If the memory at the address is strictly lower than #value, then decrement it and wait for signal."] -#[doc = ""] - +#[doc = "< If the memory at the address is strictly lower than #value, then decrement it and wait for signal."] pub const ARBITRATION_DECREMENT_AND_WAIT_IF_LESS_THAN: ArbitrationType = 2; -#[doc = "If the memory at the address is strictly lower than #value, then wait for signal or timeout."] -#[doc = ""] - +#[doc = "< If the memory at the address is strictly lower than #value, then wait for signal or timeout."] pub const ARBITRATION_WAIT_IF_LESS_THAN_TIMEOUT: ArbitrationType = 3; -#[doc = "If the memory at the address is strictly lower than #value, then decrement it and wait for signal or timeout."] -#[doc = ""] - +#[doc = "< If the memory at the address is strictly lower than #value, then decrement it and wait for signal or timeout."] pub const ARBITRATION_DECREMENT_AND_WAIT_IF_LESS_THAN_TIMEOUT: ArbitrationType = 4; -#[doc = "Arbitration modes."] -#[doc = ""] - +#[doc = " Arbitration modes."] pub type ArbitrationType = ::libc::c_uint; -#[doc = "When the primitive is signaled, it will wake up exactly one thread and will clear itself automatically."] -#[doc = ""] - +#[doc = "< When the primitive is signaled, it will wake up exactly one thread and will clear itself automatically."] pub const RESET_ONESHOT: ResetType = 0; -#[doc = "When the primitive is signaled, it will wake up all threads and it won't clear itself automatically."] -#[doc = ""] - +#[doc = "< When the primitive is signaled, it will wake up all threads and it won't clear itself automatically."] pub const RESET_STICKY: ResetType = 1; -#[doc = "Only meaningful for timers: same as ONESHOT but it will periodically signal the timer instead of just once."] -#[doc = ""] - +#[doc = "< Only meaningful for timers: same as ONESHOT but it will periodically signal the timer instead of just once."] pub const RESET_PULSE: ResetType = 2; -#[doc = "Reset types (for use with events and timers)"] -#[doc = ""] - +#[doc = " Reset types (for use with events and timers)"] pub type ResetType = ::libc::c_uint; -#[doc = "Unknown."] -#[doc = ""] - +#[doc = "< Unknown."] pub const THREADINFO_TYPE_UNKNOWN: ThreadInfoType = 0; -#[doc = "Types of thread info."] -#[doc = ""] - +#[doc = " Types of thread info."] pub type ThreadInfoType = ::libc::c_uint; -#[doc = "Thread priority"] -#[doc = ""] - +#[doc = "< Thread priority"] pub const RESLIMIT_PRIORITY: ResourceLimitType = 0; -#[doc = "Quantity of allocatable memory"] -#[doc = ""] - +#[doc = "< Quantity of allocatable memory"] pub const RESLIMIT_COMMIT: ResourceLimitType = 1; -#[doc = "Number of threads"] -#[doc = ""] - +#[doc = "< Number of threads"] pub const RESLIMIT_THREAD: ResourceLimitType = 2; -#[doc = "Number of events"] -#[doc = ""] - +#[doc = "< Number of events"] pub const RESLIMIT_EVENT: ResourceLimitType = 3; -#[doc = "Number of mutexes"] -#[doc = ""] - +#[doc = "< Number of mutexes"] pub const RESLIMIT_MUTEX: ResourceLimitType = 4; -#[doc = "Number of semaphores"] -#[doc = ""] - +#[doc = "< Number of semaphores"] pub const RESLIMIT_SEMAPHORE: ResourceLimitType = 5; -#[doc = "Number of timers"] -#[doc = ""] - +#[doc = "< Number of timers"] pub const RESLIMIT_TIMER: ResourceLimitType = 6; -#[doc = "Number of shared memory objects, see [`svcCreateMemoryBlock`]"] -#[doc = ""] - +#[doc = "< Number of shared memory objects, see svcCreateMemoryBlock"] pub const RESLIMIT_SHAREDMEMORY: ResourceLimitType = 7; -#[doc = "Number of address arbiters"] -#[doc = ""] - +#[doc = "< Number of address arbiters"] pub const RESLIMIT_ADDRESSARBITER: ResourceLimitType = 8; -#[doc = "CPU time. Value expressed in percentage regular until it reaches 90."] -#[doc = ""] - +#[doc = "< CPU time. Value expressed in percentage regular until it reaches 90."] pub const RESLIMIT_CPUTIME: ResourceLimitType = 9; -#[doc = "Forces enum size to be 32 bits"] -#[doc = ""] - +#[doc = "< Forces enum size to be 32 bits"] pub const RESLIMIT_BIT: ResourceLimitType = 2147483648; -#[doc = "Types of resource limit"] -#[doc = ""] - +#[doc = " Types of resource limit"] pub type ResourceLimitType = ::libc::c_uint; -#[doc = "DMA transfer involving at least one device is starting and has not reached DMAWFP yet."] -#[doc = ""] - +#[doc = "< DMA transfer involving at least one device is starting and has not reached DMAWFP yet."] pub const DMASTATE_STARTING: DmaState = 0; -#[doc = "DMA channel is in WFP state for the destination device (2nd loop iteration onwards)."] -#[doc = ""] - +#[doc = "< DMA channel is in WFP state for the destination device (2nd loop iteration onwards)."] pub const DMASTATE_WFP_DST: DmaState = 1; -#[doc = "DMA channel is in WFP state for the source device (2nd loop iteration onwards)."] -#[doc = ""] - +#[doc = "< DMA channel is in WFP state for the source device (2nd loop iteration onwards)."] pub const DMASTATE_WFP_SRC: DmaState = 2; -#[doc = "DMA transfer is running."] -#[doc = ""] - +#[doc = "< DMA transfer is running."] pub const DMASTATE_RUNNING: DmaState = 3; -#[doc = "DMA transfer is done."] -#[doc = ""] - +#[doc = "< DMA transfer is done."] pub const DMASTATE_DONE: DmaState = 4; -#[doc = "DMA transfer state."] -#[doc = ""] - +#[doc = " DMA transfer state."] pub type DmaState = ::libc::c_uint; -#[doc = "DMA source is a device/peripheral. Address will not auto-increment."] -#[doc = ""] - +#[doc = "< DMA source is a device/peripheral. Address will not auto-increment."] pub const DMACFG_SRC_IS_DEVICE: _bindgen_ty_5 = 1; -#[doc = "DMA destination is a device/peripheral. Address will not auto-increment."] -#[doc = ""] - +#[doc = "< DMA destination is a device/peripheral. Address will not auto-increment."] pub const DMACFG_DST_IS_DEVICE: _bindgen_ty_5 = 2; -#[doc = "Make [`svcStartInterProcessDma`] wait for the channel to be unlocked."] -#[doc = ""] - +#[doc = "< Make svcStartInterProcessDma wait for the channel to be unlocked."] pub const DMACFG_WAIT_AVAILABLE: _bindgen_ty_5 = 4; -#[doc = "Keep the channel locked after the transfer. Required for [`svcRestartDma`]"] -#[doc = ""] - +#[doc = "< Keep the channel locked after the transfer. Required for svcRestartDma."] pub const DMACFG_KEEP_LOCKED: _bindgen_ty_5 = 8; -#[doc = "Use the provided source device configuration even if the DMA source is not a device."] -#[doc = ""] - +#[doc = "< Use the provided source device configuration even if the DMA source is not a device."] pub const DMACFG_USE_SRC_CONFIG: _bindgen_ty_5 = 64; -#[doc = "Use the provided destination device configuration even if the DMA destination is not a device."] -#[doc = ""] - +#[doc = "< Use the provided destination device configuration even if the DMA destination is not a device."] pub const DMACFG_USE_DST_CONFIG: _bindgen_ty_5 = 128; -#[doc = "Configuration flags for [`DmaConfig`]"] -#[doc = ""] - +#[doc = " Configuration flags for DmaConfig."] pub type _bindgen_ty_5 = ::libc::c_uint; -#[doc = "Unlock the channel after transfer."] -#[doc = ""] - +#[doc = "< Unlock the channel after transfer."] pub const DMARST_UNLOCK: _bindgen_ty_6 = 1; -#[doc = "Replace DMAFLUSHP instructions by NOP (they may not be regenerated even if this flag is not set)."] -#[doc = ""] - +#[doc = "< Replace DMAFLUSHP instructions by NOP (they may not be regenerated even if this flag is not set)."] pub const DMARST_RESUME_DEVICE: _bindgen_ty_6 = 2; -#[doc = "Configuration flags for [`svcRestartDma`]"] -#[doc = ""] - +#[doc = " Configuration flags for svcRestartDma."] pub type _bindgen_ty_6 = ::libc::c_uint; -#[doc = "Device configuration structure, part of [`DmaConfig.\n`] @note\n - if (and only if) src/dst is a device, then src/dst won't be auto-incremented.\n - the kernel uses DMAMOV instead of DMAADNH, when having to decrement (possibly working around an erratum);\n this forces all loops to be unrolled -- you need to keep that in mind when using negative increments, as the kernel\n uses a limit of 100 DMA instruction bytes per channel."] -#[doc = ""] +#[doc = " Device configuration structure, part of DmaConfig.\n > **Note:** - if (and only if) src/dst is a device, then src/dst won't be auto-incremented.\n - the kernel uses DMAMOV instead of DMAADNH, when having to decrement (possibly working around an erratum);\n this forces all loops to be unrolled -- you need to keep that in mind when using negative increments, as the kernel\n uses a limit of 100 DMA instruction bytes per channel."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct DmaDeviceConfig { - #[doc = "DMA device ID."] - #[doc = ""] + #[doc = "< DMA device ID."] pub deviceId: s8, - #[doc = "Mask of allowed access alignments (8, 4, 2, 1)."] - #[doc = ""] + #[doc = "< Mask of allowed access alignments (8, 4, 2, 1)."] pub allowedAlignments: s8, - #[doc = "Number of bytes transferred in a burst loop. Can be 0 (in which case the max allowed alignment is used as unit)."] - #[doc = ""] + #[doc = "< Number of bytes transferred in a burst loop. Can be 0 (in which case the max allowed alignment is used as unit)."] pub burstSize: s16, - #[doc = "Number of bytes transferred in a \"transfer\" loop (made of burst loops)."] - #[doc = ""] + #[doc = "< Number of bytes transferred in a \"transfer\" loop (made of burst loops)."] pub transferSize: s16, - #[doc = "Burst loop stride, can be <= 0."] - #[doc = ""] + #[doc = "< Burst loop stride, can be <= 0."] pub burstStride: s16, - #[doc = "\"Transfer\" loop stride, can be <= 0."] - #[doc = ""] + #[doc = "< \"Transfer\" loop stride, can be <= 0."] pub transferStride: s16, } -#[doc = "Configuration stucture for [`svcStartInterProcessDma`]"] -#[doc = ""] +#[doc = " Configuration stucture for svcStartInterProcessDma."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct DmaConfig { - #[doc = "Channel ID (Arm11: 0-7, Arm9: 0-1). Use -1 to auto-assign to a free channel (Arm11: 3-7, Arm9: 0-1)."] - #[doc = ""] + #[doc = "< Channel ID (Arm11: 0-7, Arm9: 0-1). Use -1 to auto-assign to a free channel (Arm11: 3-7, Arm9: 0-1)."] pub channelId: s8, - #[doc = "Endian swap size (can be 0)."] - #[doc = ""] + #[doc = "< Endian swap size (can be 0)."] pub endianSwapSize: s8, - #[doc = "DMACFG_* flags."] - #[doc = ""] + #[doc = "< DMACFG_* flags."] pub flags: u8_, pub _padding: u8_, - #[doc = "Source device configuration, read if [`DMACFG_SRC_IS_DEVICE`] and/or [`DMACFG_USE_SRC_CONFIG`] are set."] - #[doc = ""] + #[doc = "< Source device configuration, read if DMACFG_SRC_IS_DEVICE and/or DMACFG_USE_SRC_CONFIG are set."] pub srcCfg: DmaDeviceConfig, - #[doc = "Destination device configuration, read if [`DMACFG_SRC_IS_DEVICE`] and/or [`DMACFG_USE_SRC_CONFIG`] are set."] - #[doc = ""] + #[doc = "< Destination device configuration, read if DMACFG_SRC_IS_DEVICE and/or DMACFG_USE_SRC_CONFIG are set."] pub dstCfg: DmaDeviceConfig, } -#[doc = "Enable and lock perfmon. functionality."] -#[doc = ""] - +#[doc = "< Enable and lock perfmon. functionality."] pub const PERFCOUNTEROP_ENABLE: PerfCounterOperation = 0; -#[doc = "Disable and forcibly unlock perfmon. functionality."] -#[doc = ""] - +#[doc = "< Disable and forcibly unlock perfmon. functionality."] pub const PERFCOUNTEROP_DISABLE: PerfCounterOperation = 1; -#[doc = "Get the value of a counter register."] -#[doc = ""] - +#[doc = "< Get the value of a counter register."] pub const PERFCOUNTEROP_GET_VALUE: PerfCounterOperation = 2; -#[doc = "Set the value of a counter register."] -#[doc = ""] - +#[doc = "< Set the value of a counter register."] pub const PERFCOUNTEROP_SET_VALUE: PerfCounterOperation = 3; -#[doc = "Get the overflow flags for all CP15 and SCU counters."] -#[doc = ""] - +#[doc = "< Get the overflow flags for all CP15 and SCU counters."] pub const PERFCOUNTEROP_GET_OVERFLOW_FLAGS: PerfCounterOperation = 4; -#[doc = "Reset the value and/or overflow flags of selected counters."] -#[doc = ""] - +#[doc = "< Reset the value and/or overflow flags of selected counters."] pub const PERFCOUNTEROP_RESET: PerfCounterOperation = 5; -#[doc = "Get the event ID associated to a particular counter."] -#[doc = ""] - +#[doc = "< Get the event ID associated to a particular counter."] pub const PERFCOUNTEROP_GET_EVENT: PerfCounterOperation = 6; -#[doc = "Set the event ID associated to a paritcular counter."] -#[doc = ""] - +#[doc = "< Set the event ID associated to a paritcular counter."] pub const PERFCOUNTEROP_SET_EVENT: PerfCounterOperation = 7; -#[doc = "(Dis)allow the kernel to track counter overflows and to use 64-bit counter values."] -#[doc = ""] - +#[doc = "< (Dis)allow the kernel to track counter overflows and to use 64-bit counter values."] pub const PERFCOUNTEROP_SET_VIRTUAL_COUNTER_ENABLED: PerfCounterOperation = 8; -#[doc = "Operations for [`svcControlPerformanceCounter`]"] -#[doc = ""] - +#[doc = " Operations for svcControlPerformanceCounter"] pub type PerfCounterOperation = ::libc::c_uint; pub const PERFCOUNTERREG_CORE_BASE: PerfCounterRegister = 0; -#[doc = "CP15 PMN0."] -#[doc = ""] - +#[doc = "< CP15 PMN0."] pub const PERFCOUNTERREG_CORE_COUNT_REG_0: PerfCounterRegister = 0; -#[doc = "CP15 PMN1."] -#[doc = ""] - +#[doc = "< CP15 PMN1."] pub const PERFCOUNTERREG_CORE_COUNT_REG_1: PerfCounterRegister = 1; -#[doc = "CP15 CCNT."] -#[doc = ""] - +#[doc = "< CP15 CCNT."] pub const PERFCOUNTERREG_CORE_CYCLE_COUNTER: PerfCounterRegister = 2; pub const PERFCOUNTERREG_SCU_BASE: PerfCounterRegister = 16; -#[doc = "SCU MN0."] -#[doc = ""] - +#[doc = "< SCU MN0."] pub const PERFCOUNTERREG_SCU_0: PerfCounterRegister = 16; -#[doc = "SCU MN1."] -#[doc = ""] - +#[doc = "< SCU MN1."] pub const PERFCOUNTERREG_SCU_1: PerfCounterRegister = 17; -#[doc = "SCU MN2."] -#[doc = ""] - +#[doc = "< SCU MN2."] pub const PERFCOUNTERREG_SCU_2: PerfCounterRegister = 18; -#[doc = "SCU MN3."] -#[doc = ""] - +#[doc = "< SCU MN3."] pub const PERFCOUNTERREG_SCU_3: PerfCounterRegister = 19; -#[doc = "SCU MN4. Prod-N3DS only. IRQ line missing."] -#[doc = ""] - +#[doc = "< SCU MN4. Prod-N3DS only. IRQ line missing."] pub const PERFCOUNTERREG_SCU_4: PerfCounterRegister = 20; -#[doc = "SCU MN5. Prod-N3DS only. IRQ line missing."] -#[doc = ""] - +#[doc = "< SCU MN5. Prod-N3DS only. IRQ line missing."] pub const PERFCOUNTERREG_SCU_5: PerfCounterRegister = 21; -#[doc = "SCU MN6. Prod-N3DS only. IRQ line missing."] -#[doc = ""] - +#[doc = "< SCU MN6. Prod-N3DS only. IRQ line missing."] pub const PERFCOUNTERREG_SCU_6: PerfCounterRegister = 22; -#[doc = "SCU MN7. Prod-N3DS only. IRQ line missing."] -#[doc = ""] - +#[doc = "< SCU MN7. Prod-N3DS only. IRQ line missing."] pub const PERFCOUNTERREG_SCU_7: PerfCounterRegister = 23; -#[doc = "Performance counter register IDs (CP15 and SCU)."] -#[doc = ""] - +#[doc = " Performance counter register IDs (CP15 and SCU)."] pub type PerfCounterRegister = ::libc::c_uint; pub const PERFCOUNTEREVT_CORE_BASE: PerfCounterEvent = 0; pub const PERFCOUNTEREVT_CORE_INST_CACHE_MISS: PerfCounterEvent = 0; @@ -2034,13 +1785,9 @@ pub const PERFCOUNTEREVT_CORE_EXTERNAL_REQUEST: PerfCounterEvent = 17; pub const PERFCOUNTEREVT_CORE_STALL_BY_LSU_FULL: PerfCounterEvent = 18; pub const PERFCOUNTEREVT_CORE_STORE_BUFFER_DRAIN: PerfCounterEvent = 19; pub const PERFCOUNTEREVT_CORE_MERGE_IN_STORE_BUFFER: PerfCounterEvent = 20; -#[doc = "One cycle elapsed."] -#[doc = ""] - +#[doc = "< One cycle elapsed."] pub const PERFCOUNTEREVT_CORE_CYCLE_COUNT: PerfCounterEvent = 255; -#[doc = "64 cycles elapsed."] -#[doc = ""] - +#[doc = "< 64 cycles elapsed."] pub const PERFCOUNTEREVT_CORE_CYCLE_COUNT_64: PerfCounterEvent = 4095; pub const PERFCOUNTEREVT_SCU_BASE: PerfCounterEvent = 4096; pub const PERFCOUNTEREVT_SCU_DISABLED: PerfCounterEvent = 4096; @@ -2064,51 +1811,34 @@ pub const PERFCOUNTEREVT_SCU_WRITE_BUSY_PORT1: PerfCounterEvent = 4113; pub const PERFCOUNTEREVT_SCU_EXTERNAL_READ: PerfCounterEvent = 4114; pub const PERFCOUNTEREVT_SCU_EXTERNAL_WRITE: PerfCounterEvent = 4115; pub const PERFCOUNTEREVT_SCU_CYCLE_COUNT: PerfCounterEvent = 4127; -#[doc = "Performance counter event IDs (CP15 or SCU).\n\n @note Refer to:\n - CP15: - SCU: "] -#[doc = ""] - +#[doc = " Performance counter event IDs (CP15 or SCU).\n\n > **Note:** Refer to:\n - CP15: https://developer.arm.com/documentation/ddi0360/e/control-coprocessor-cp15/register-descriptions/c15--performance-monitor-control-register--pmnc-\n - SCU: https://developer.arm.com/documentation/ddi0360/e/mpcore-private-memory-region/about-the-mpcore-private-memory-region/performance-monitor-event-registers"] pub type PerfCounterEvent = ::libc::c_uint; -#[doc = "Event relating to the attachment of a process."] -#[doc = ""] +#[doc = " Event relating to the attachment of a process."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct AttachProcessEvent { - #[doc = "ID of the program."] - #[doc = ""] + #[doc = "< ID of the program."] pub program_id: u64_, - #[doc = "Name of the process."] - #[doc = ""] + #[doc = "< Name of the process."] pub process_name: [::libc::c_char; 8usize], - #[doc = "ID of the process."] - #[doc = ""] + #[doc = "< ID of the process."] pub process_id: u32_, - #[doc = "Always 0"] - #[doc = ""] + #[doc = "< Always 0"] pub other_flags: u32_, } -#[doc = "Process exited either normally or due to an uncaught exception."] -#[doc = ""] - +#[doc = "< Process exited either normally or due to an uncaught exception."] pub const EXITPROCESS_EVENT_EXIT: ExitProcessEventReason = 0; -#[doc = "Process has been terminated by [`svcTerminateProcess`]"] -#[doc = ""] - +#[doc = "< Process has been terminated by svcTerminateProcess."] pub const EXITPROCESS_EVENT_TERMINATE: ExitProcessEventReason = 1; -#[doc = "Process has been terminated by [`svcTerminateDebugProcess`]"] -#[doc = ""] - +#[doc = "< Process has been terminated by svcTerminateDebugProcess."] pub const EXITPROCESS_EVENT_DEBUG_TERMINATE: ExitProcessEventReason = 2; -#[doc = "Reasons for an exit process event."] -#[doc = ""] - +#[doc = " Reasons for an exit process event."] pub type ExitProcessEventReason = ::libc::c_uint; -#[doc = "Event relating to the exiting of a process."] -#[doc = ""] +#[doc = " Event relating to the exiting of a process."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ExitProcessEvent { - #[doc = "Reason for exiting. See [`ExitProcessEventReason`]"] - #[doc = ""] + #[doc = "< Reason for exiting. See ExitProcessEventReason"] pub reason: ExitProcessEventReason, } impl Default for ExitProcessEvent { @@ -2120,48 +1850,32 @@ impl Default for ExitProcessEvent { } } } -#[doc = "Event relating to the attachment of a thread."] -#[doc = ""] +#[doc = " Event relating to the attachment of a thread."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct AttachThreadEvent { - #[doc = "ID of the creating thread."] - #[doc = ""] + #[doc = "< ID of the creating thread."] pub creator_thread_id: u32_, - #[doc = "Thread local storage."] - #[doc = ""] + #[doc = "< Thread local storage."] pub thread_local_storage: u32_, - #[doc = "Entry point of the thread."] - #[doc = ""] + #[doc = "< Entry point of the thread."] pub entry_point: u32_, } -#[doc = "Thread exited."] -#[doc = ""] - +#[doc = "< Thread exited."] pub const EXITTHREAD_EVENT_EXIT: ExitThreadEventReason = 0; -#[doc = "Thread terminated."] -#[doc = ""] - +#[doc = "< Thread terminated."] pub const EXITTHREAD_EVENT_TERMINATE: ExitThreadEventReason = 1; -#[doc = "Process exited either normally or due to an uncaught exception."] -#[doc = ""] - +#[doc = "< Process exited either normally or due to an uncaught exception."] pub const EXITTHREAD_EVENT_EXIT_PROCESS: ExitThreadEventReason = 2; -#[doc = "Process has been terminated by [`svcTerminateProcess`]"] -#[doc = ""] - +#[doc = "< Process has been terminated by svcTerminateProcess."] pub const EXITTHREAD_EVENT_TERMINATE_PROCESS: ExitThreadEventReason = 3; -#[doc = "Reasons for an exit thread event."] -#[doc = ""] - +#[doc = " Reasons for an exit thread event."] pub type ExitThreadEventReason = ::libc::c_uint; -#[doc = "Event relating to the exiting of a thread."] -#[doc = ""] +#[doc = " Event relating to the exiting of a thread."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ExitThreadEvent { - #[doc = "Reason for exiting. See [`ExitThreadEventReason`]"] - #[doc = ""] + #[doc = "< Reason for exiting. See ExitThreadEventReason"] pub reason: ExitThreadEventReason, } impl Default for ExitThreadEvent { @@ -2173,105 +1887,60 @@ impl Default for ExitThreadEvent { } } } -#[doc = "Panic."] -#[doc = ""] - +#[doc = "< Panic."] pub const USERBREAK_PANIC: UserBreakType = 0; -#[doc = "Assertion failed."] -#[doc = ""] - +#[doc = "< Assertion failed."] pub const USERBREAK_ASSERT: UserBreakType = 1; -#[doc = "User related."] -#[doc = ""] - +#[doc = "< User related."] pub const USERBREAK_USER: UserBreakType = 2; -#[doc = "Load RO."] -#[doc = ""] - +#[doc = "< Load RO."] pub const USERBREAK_LOAD_RO: UserBreakType = 3; -#[doc = "Unload RO."] -#[doc = ""] - +#[doc = "< Unload RO."] pub const USERBREAK_UNLOAD_RO: UserBreakType = 4; -#[doc = "Reasons for a user break."] -#[doc = ""] - +#[doc = " Reasons for a user break."] pub type UserBreakType = ::libc::c_uint; -#[doc = "Undefined instruction."] -#[doc = ""] - +#[doc = "< Undefined instruction."] pub const EXCEVENT_UNDEFINED_INSTRUCTION: ExceptionEventType = 0; -#[doc = "Prefetch abort."] -#[doc = ""] - +#[doc = "< Prefetch abort."] pub const EXCEVENT_PREFETCH_ABORT: ExceptionEventType = 1; -#[doc = "Data abort (other than the below kind)."] -#[doc = ""] - +#[doc = "< Data abort (other than the below kind)."] pub const EXCEVENT_DATA_ABORT: ExceptionEventType = 2; -#[doc = "Unaligned data access."] -#[doc = ""] - +#[doc = "< Unaligned data access."] pub const EXCEVENT_UNALIGNED_DATA_ACCESS: ExceptionEventType = 3; -#[doc = "Attached break."] -#[doc = ""] - +#[doc = "< Attached break."] pub const EXCEVENT_ATTACH_BREAK: ExceptionEventType = 4; -#[doc = "Stop point reached."] -#[doc = ""] - +#[doc = "< Stop point reached."] pub const EXCEVENT_STOP_POINT: ExceptionEventType = 5; -#[doc = "User break occurred."] -#[doc = ""] - +#[doc = "< User break occurred."] pub const EXCEVENT_USER_BREAK: ExceptionEventType = 6; -#[doc = "Debugger break occurred."] -#[doc = ""] - +#[doc = "< Debugger break occurred."] pub const EXCEVENT_DEBUGGER_BREAK: ExceptionEventType = 7; -#[doc = "Undefined syscall."] -#[doc = ""] - +#[doc = "< Undefined syscall."] pub const EXCEVENT_UNDEFINED_SYSCALL: ExceptionEventType = 8; -#[doc = "Reasons for an exception event."] -#[doc = ""] - +#[doc = " Reasons for an exception event."] pub type ExceptionEventType = ::libc::c_uint; -#[doc = "Event relating to fault exceptions (CPU exceptions other than stop points and undefined syscalls)."] -#[doc = ""] +#[doc = " Event relating to fault exceptions (CPU exceptions other than stop points and undefined syscalls)."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct FaultExceptionEvent { - #[doc = "FAR (for DATA ABORT / UNALIGNED DATA ACCESS), attempted syscall or 0"] - #[doc = ""] + #[doc = "< FAR (for DATA ABORT / UNALIGNED DATA ACCESS), attempted syscall or 0"] pub fault_information: u32_, } -#[doc = "See [`SVC_STOP_POINT`]"] -#[doc = ""] - +#[doc = "< See SVC_STOP_POINT."] pub const STOPPOINT_SVC_FF: StopPointType = 0; -#[doc = "Breakpoint."] -#[doc = ""] - +#[doc = "< Breakpoint."] pub const STOPPOINT_BREAKPOINT: StopPointType = 1; -#[doc = "Watchpoint."] -#[doc = ""] - +#[doc = "< Watchpoint."] pub const STOPPOINT_WATCHPOINT: StopPointType = 2; -#[doc = "Stop point types"] -#[doc = ""] - +#[doc = " Stop point types"] pub type StopPointType = ::libc::c_uint; -#[doc = "Event relating to stop points"] -#[doc = ""] +#[doc = " Event relating to stop points"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct StopPointExceptionEvent { - #[doc = "Stop point type, see [`StopPointType`]"] - #[doc = ""] + #[doc = "< Stop point type, see StopPointType."] pub type_: StopPointType, - #[doc = "FAR for Watchpoints, otherwise 0."] - #[doc = ""] + #[doc = "< FAR for Watchpoints, otherwise 0."] pub fault_information: u32_, } impl Default for StopPointExceptionEvent { @@ -2283,19 +1952,15 @@ impl Default for StopPointExceptionEvent { } } } -#[doc = "Event relating to [`svcBreak`]"] -#[doc = ""] +#[doc = " Event relating to svcBreak"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct UserBreakExceptionEvent { - #[doc = "User break type, see [`UserBreakType`]"] - #[doc = ""] + #[doc = "< User break type, see UserBreakType."] pub type_: UserBreakType, - #[doc = "For LOAD_RO and UNLOAD_RO."] - #[doc = ""] + #[doc = "< For LOAD_RO and UNLOAD_RO."] pub croInfo: u32_, - #[doc = "For LOAD_RO and UNLOAD_RO."] - #[doc = ""] + #[doc = "< For LOAD_RO and UNLOAD_RO."] pub croInfoSize: u32_, } impl Default for UserBreakExceptionEvent { @@ -2307,42 +1972,33 @@ impl Default for UserBreakExceptionEvent { } } } -#[doc = "Event relating to [`svcBreakDebugProcess`]"] -#[doc = ""] +#[doc = " Event relating to svcBreakDebugProcess"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct DebuggerBreakExceptionEvent { - #[doc = "IDs of the attached process's threads that were running on each core at the time of the [`svcBreakDebugProcess`] call, or -1 (only the first 2 values are meaningful on O3DS)."] - #[doc = ""] + #[doc = "< IDs of the attached process's threads that were running on each core at the time of the svcBreakDebugProcess call, or -1 (only the first 2 values are meaningful on O3DS)."] pub thread_ids: [s32; 4usize], } -#[doc = "Event relating to exceptions."] -#[doc = ""] +#[doc = " Event relating to exceptions."] #[repr(C)] #[derive(Copy, Clone)] pub struct ExceptionEvent { - #[doc = "Type of event. See [`ExceptionEventType`]"] - #[doc = ""] + #[doc = "< Type of event. See ExceptionEventType."] pub type_: ExceptionEventType, - #[doc = "Address of the exception."] - #[doc = ""] + #[doc = "< Address of the exception."] pub address: u32_, pub __bindgen_anon_1: ExceptionEvent__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] pub union ExceptionEvent__bindgen_ty_1 { - #[doc = "Fault exception event data."] - #[doc = ""] + #[doc = "< Fault exception event data."] pub fault: FaultExceptionEvent, - #[doc = "Stop point exception event data."] - #[doc = ""] + #[doc = "< Stop point exception event data."] pub stop_point: StopPointExceptionEvent, - #[doc = "User break exception event data."] - #[doc = ""] + #[doc = "< User break exception event data."] pub user_break: UserBreakExceptionEvent, - #[doc = "Debugger break exception event data"] - #[doc = ""] + #[doc = "< Debugger break exception event data"] pub debugger_break: DebuggerBreakExceptionEvent, } impl Default for ExceptionEvent__bindgen_ty_1 { @@ -2363,55 +2019,42 @@ impl Default for ExceptionEvent { } } } -#[doc = "Event relating to the scheduler."] -#[doc = ""] +#[doc = " Event relating to the scheduler."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct ScheduleInOutEvent { - #[doc = "Clock tick that the event occurred."] - #[doc = ""] + #[doc = "< Clock tick that the event occurred."] pub clock_tick: u64_, } -#[doc = "Event relating to syscalls."] -#[doc = ""] +#[doc = " Event relating to syscalls."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct SyscallInOutEvent { - #[doc = "Clock tick that the event occurred."] - #[doc = ""] + #[doc = "< Clock tick that the event occurred."] pub clock_tick: u64_, - #[doc = "Syscall sent/received."] - #[doc = ""] + #[doc = "< Syscall sent/received."] pub syscall: u32_, } -#[doc = "Event relating to debug output."] -#[doc = ""] +#[doc = " Event relating to debug output."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct OutputStringEvent { - #[doc = "Address of the outputted string."] - #[doc = ""] + #[doc = "< Address of the outputted string."] pub string_addr: u32_, - #[doc = "Size of the outputted string."] - #[doc = ""] + #[doc = "< Size of the outputted string."] pub string_size: u32_, } -#[doc = "Event relating to the mapping of memory."] -#[doc = ""] +#[doc = " Event relating to the mapping of memory."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct MapEvent { - #[doc = "Mapped address."] - #[doc = ""] + #[doc = "< Mapped address."] pub mapped_addr: u32_, - #[doc = "Mapped size."] - #[doc = ""] + #[doc = "< Mapped size."] pub mapped_size: u32_, - #[doc = "Memory permissions. See [`MemPerm`]"] - #[doc = ""] + #[doc = "< Memory permissions. See MemPerm."] pub memperm: MemPerm, - #[doc = "Memory state. See [`MemState`]"] - #[doc = ""] + #[doc = "< Memory state. See MemState."] pub memstate: MemState, } impl Default for MapEvent { @@ -2423,110 +2066,68 @@ impl Default for MapEvent { } } } -#[doc = "Process attached event."] -#[doc = ""] - +#[doc = "< Process attached event."] pub const DBGEVENT_ATTACH_PROCESS: DebugEventType = 0; -#[doc = "Thread attached event."] -#[doc = ""] - +#[doc = "< Thread attached event."] pub const DBGEVENT_ATTACH_THREAD: DebugEventType = 1; -#[doc = "Thread exit event."] -#[doc = ""] - +#[doc = "< Thread exit event."] pub const DBGEVENT_EXIT_THREAD: DebugEventType = 2; -#[doc = "Process exit event."] -#[doc = ""] - +#[doc = "< Process exit event."] pub const DBGEVENT_EXIT_PROCESS: DebugEventType = 3; -#[doc = "Exception event."] -#[doc = ""] - +#[doc = "< Exception event."] pub const DBGEVENT_EXCEPTION: DebugEventType = 4; -#[doc = "DLL load event."] -#[doc = ""] - +#[doc = "< DLL load event."] pub const DBGEVENT_DLL_LOAD: DebugEventType = 5; -#[doc = "DLL unload event."] -#[doc = ""] - +#[doc = "< DLL unload event."] pub const DBGEVENT_DLL_UNLOAD: DebugEventType = 6; -#[doc = "Schedule in event."] -#[doc = ""] - +#[doc = "< Schedule in event."] pub const DBGEVENT_SCHEDULE_IN: DebugEventType = 7; -#[doc = "Schedule out event."] -#[doc = ""] - +#[doc = "< Schedule out event."] pub const DBGEVENT_SCHEDULE_OUT: DebugEventType = 8; -#[doc = "Syscall in event."] -#[doc = ""] - +#[doc = "< Syscall in event."] pub const DBGEVENT_SYSCALL_IN: DebugEventType = 9; -#[doc = "Syscall out event."] -#[doc = ""] - +#[doc = "< Syscall out event."] pub const DBGEVENT_SYSCALL_OUT: DebugEventType = 10; -#[doc = "Output string event."] -#[doc = ""] - +#[doc = "< Output string event."] pub const DBGEVENT_OUTPUT_STRING: DebugEventType = 11; -#[doc = "Map event."] -#[doc = ""] - +#[doc = "< Map event."] pub const DBGEVENT_MAP: DebugEventType = 12; -#[doc = "Debug event type."] -#[doc = ""] - +#[doc = " Debug event type."] pub type DebugEventType = ::libc::c_uint; -#[doc = "Information about a debug event."] -#[doc = ""] +#[doc = " Information about a debug event."] #[repr(C)] #[derive(Copy, Clone)] pub struct DebugEventInfo { - #[doc = "Type of event. See [`DebugEventType`]"] - #[doc = ""] + #[doc = "< Type of event. See DebugEventType"] pub type_: DebugEventType, - #[doc = "ID of the thread."] - #[doc = ""] + #[doc = "< ID of the thread."] pub thread_id: u32_, - #[doc = "Flags. Bit0 means that [`svcContinueDebugEvent`] needs to be called for this event (except for EXIT PROCESS events, where this flag is disregarded)."] - #[doc = ""] + #[doc = "< Flags. Bit0 means that svcContinueDebugEvent needs to be called for this event (except for EXIT PROCESS events, where this flag is disregarded)."] pub flags: u32_, - #[doc = "Always 0."] - #[doc = ""] + #[doc = "< Always 0."] pub remnants: [u8_; 4usize], pub __bindgen_anon_1: DebugEventInfo__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] pub union DebugEventInfo__bindgen_ty_1 { - #[doc = "Process attachment event data."] - #[doc = ""] + #[doc = "< Process attachment event data."] pub attach_process: AttachProcessEvent, - #[doc = "Thread attachment event data."] - #[doc = ""] + #[doc = "< Thread attachment event data."] pub attach_thread: AttachThreadEvent, - #[doc = "Thread exit event data."] - #[doc = ""] + #[doc = "< Thread exit event data."] pub exit_thread: ExitThreadEvent, - #[doc = "Process exit event data."] - #[doc = ""] + #[doc = "< Process exit event data."] pub exit_process: ExitProcessEvent, - #[doc = "Exception event data."] - #[doc = ""] + #[doc = "< Exception event data."] pub exception: ExceptionEvent, - #[doc = "Schedule in/out event data."] - #[doc = ""] + #[doc = "< Schedule in/out event data."] pub scheduler: ScheduleInOutEvent, - #[doc = "Syscall in/out event data."] - #[doc = ""] + #[doc = "< Syscall in/out event data."] pub syscall: SyscallInOutEvent, - #[doc = "Output string event data."] - #[doc = ""] + #[doc = "< Output string event data."] pub output_string: OutputStringEvent, - #[doc = "Map event data."] - #[doc = ""] + #[doc = "< Map event data."] pub map: MapEvent, } impl Default for DebugEventInfo__bindgen_ty_1 { @@ -2547,38 +2148,24 @@ impl Default for DebugEventInfo { } } } -#[doc = "Inhibit user-defined CPU exception handlers (including watchpoints and breakpoints, regardless of any [`svcKernelSetState`] call)."] -#[doc = ""] - +#[doc = "< Inhibit user-defined CPU exception handlers (including watchpoints and breakpoints, regardless of any svcKernelSetState call)."] pub const DBG_INHIBIT_USER_CPU_EXCEPTION_HANDLERS: DebugFlags = 1; -#[doc = "Signal fault exception events. See [`FaultExceptionEvent`]"] -#[doc = ""] - +#[doc = "< Signal fault exception events. See FaultExceptionEvent."] pub const DBG_SIGNAL_FAULT_EXCEPTION_EVENTS: DebugFlags = 2; -#[doc = "Signal schedule in/out events. See [`ScheduleInOutEvent`]"] -#[doc = ""] - +#[doc = "< Signal schedule in/out events. See ScheduleInOutEvent."] pub const DBG_SIGNAL_SCHEDULE_EVENTS: DebugFlags = 4; -#[doc = "Signal syscall in/out events. See [`SyscallInOutEvent`]"] -#[doc = ""] - +#[doc = "< Signal syscall in/out events. See SyscallInOutEvent."] pub const DBG_SIGNAL_SYSCALL_EVENTS: DebugFlags = 8; -#[doc = "Signal map events. See [`MapEvent`]"] -#[doc = ""] - +#[doc = "< Signal map events. See MapEvent."] pub const DBG_SIGNAL_MAP_EVENTS: DebugFlags = 16; -#[doc = "Debug flags for an attached process, set by [`svcContinueDebugEvent`]"] -#[doc = ""] - +#[doc = " Debug flags for an attached process, set by svcContinueDebugEvent"] pub type DebugFlags = ::libc::c_uint; #[repr(C)] #[derive(Copy, Clone)] pub struct ThreadContext { - #[doc = "CPU registers."] - #[doc = ""] + #[doc = "< CPU registers."] pub cpu_registers: CpuRegisters, - #[doc = "FPU registers."] - #[doc = ""] + #[doc = "< FPU registers."] pub fpu_registers: FpuRegisters, } impl Default for ThreadContext { @@ -2590,125 +2177,76 @@ impl Default for ThreadContext { } } } -#[doc = "Control r0-r12."] -#[doc = ""] - +#[doc = "< Control r0-r12."] pub const THREADCONTEXT_CONTROL_CPU_GPRS: ThreadContextControlFlags = 1; -#[doc = "Control sp, lr, pc, cpsr."] -#[doc = ""] - +#[doc = "< Control sp, lr, pc, cpsr."] pub const THREADCONTEXT_CONTROL_CPU_SPRS: ThreadContextControlFlags = 2; -#[doc = "Control d0-d15 (or s0-s31)."] -#[doc = ""] - +#[doc = "< Control d0-d15 (or s0-s31)."] pub const THREADCONTEXT_CONTROL_FPU_GPRS: ThreadContextControlFlags = 4; -#[doc = "Control fpscr, fpexc."] -#[doc = ""] - +#[doc = "< Control fpscr, fpexc."] pub const THREADCONTEXT_CONTROL_FPU_SPRS: ThreadContextControlFlags = 8; -#[doc = "Control r0-r12, sp, lr, pc, cpsr."] -#[doc = ""] - +#[doc = "< Control r0-r12, sp, lr, pc, cpsr."] pub const THREADCONTEXT_CONTROL_CPU_REGS: ThreadContextControlFlags = 3; -#[doc = "Control d0-d15, fpscr, fpexc."] -#[doc = ""] - +#[doc = "< Control d0-d15, fpscr, fpexc."] pub const THREADCONTEXT_CONTROL_FPU_REGS: ThreadContextControlFlags = 12; -#[doc = "Control all of the above."] -#[doc = ""] - +#[doc = "< Control all of the above."] pub const THREADCONTEXT_CONTROL_ALL: ThreadContextControlFlags = 15; -#[doc = "Control flags for [`svcGetDebugThreadContext`] and [`svcSetDebugThreadContext`]"] -#[doc = ""] - +#[doc = " Control flags for svcGetDebugThreadContext and svcSetDebugThreadContext"] pub type ThreadContextControlFlags = ::libc::c_uint; -#[doc = "Thread priority."] -#[doc = ""] - +#[doc = "< Thread priority."] pub const DBGTHREAD_PARAMETER_PRIORITY: DebugThreadParameter = 0; -#[doc = "Low scheduling mask."] -#[doc = ""] - +#[doc = "< Low scheduling mask."] pub const DBGTHREAD_PARAMETER_SCHEDULING_MASK_LOW: DebugThreadParameter = 1; -#[doc = "Ideal processor."] -#[doc = ""] - +#[doc = "< Ideal processor."] pub const DBGTHREAD_PARAMETER_CPU_IDEAL: DebugThreadParameter = 2; -#[doc = "Processor that created the threod."] -#[doc = ""] - +#[doc = "< Processor that created the threod."] pub const DBGTHREAD_PARAMETER_CPU_CREATOR: DebugThreadParameter = 3; -#[doc = "Thread parameter field for [`svcGetDebugThreadParameter`]"] -#[doc = ""] - +#[doc = " Thread parameter field for svcGetDebugThreadParameter"] pub type DebugThreadParameter = ::libc::c_uint; -#[doc = "Information on address space for process. All sizes are in pages (0x1000 bytes)"] -#[doc = ""] +#[doc = " Information on address space for process. All sizes are in pages (0x1000 bytes)"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct CodeSetHeader { - #[doc = "ASCII name of codeset"] - #[doc = ""] +pub struct CodeSetInfo { + #[doc = "< ASCII name of codeset"] pub name: [u8_; 8usize], - #[doc = "Version field of codeset (unused)"] - #[doc = ""] - pub version: u16_, - #[doc = "Padding"] - #[doc = ""] - pub padding: [u16_; 3usize], - #[doc = ".text start address"] - #[doc = ""] + pub unk1: u16_, + pub unk2: u16_, + pub unk3: u32_, + #[doc = "< .text start address"] pub text_addr: u32_, - #[doc = ".text number of pages"] - #[doc = ""] + #[doc = "< .text number of pages"] pub text_size: u32_, - #[doc = ".rodata start address"] - #[doc = ""] + #[doc = "< .rodata start address"] pub ro_addr: u32_, - #[doc = ".rodata number of pages"] - #[doc = ""] + #[doc = "< .rodata number of pages"] pub ro_size: u32_, - #[doc = ".data, .bss start address"] - #[doc = ""] + #[doc = "< .data, .bss start address"] pub rw_addr: u32_, - #[doc = ".data number of pages"] - #[doc = ""] + #[doc = "< .data number of pages"] pub rw_size: u32_, - #[doc = "total pages for .text (aligned)"] - #[doc = ""] + #[doc = "< total pages for .text (aligned)"] pub text_size_total: u32_, - #[doc = "total pages for .rodata (aligned)"] - #[doc = ""] + #[doc = "< total pages for .rodata (aligned)"] pub ro_size_total: u32_, - #[doc = "total pages for .data, .bss (aligned)"] - #[doc = ""] + #[doc = "< total pages for .data, .bss (aligned)"] pub rw_size_total: u32_, - #[doc = "Padding"] - #[doc = ""] - pub padding2: u32_, - #[doc = "Program ID"] - #[doc = ""] + pub unk4: u32_, + #[doc = "< Program ID"] pub program_id: u64_, } -#[doc = "Information for the main thread of a process."] -#[doc = ""] +#[doc = " Information for the main thread of a process."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct StartupInfo { - #[doc = "Priority of the main thread."] - #[doc = ""] + #[doc = "< Priority of the main thread."] pub priority: ::libc::c_int, - #[doc = "Size of the stack of the main thread."] - #[doc = ""] + #[doc = "< Size of the stack of the main thread."] pub stack_size: u32_, - #[doc = "Unused on retail kernel."] - #[doc = ""] + #[doc = "< Unused on retail kernel."] pub argc: ::libc::c_int, - #[doc = "Unused on retail kernel."] - #[doc = ""] + #[doc = "< Unused on retail kernel."] pub argv: *mut u16_, - #[doc = "Unused on retail kernel."] - #[doc = ""] + #[doc = "< Unused on retail kernel."] pub envp: *mut u16_, } impl Default for StartupInfo { @@ -2722,8 +2260,7 @@ impl Default for StartupInfo { } extern "C" { #[must_use] - #[doc = "# Memory management\n@{\n**\n* @brief Controls memory mapping\n* @param[out] addr_out The virtual address resulting from the operation. Usually the same as addr0.\n* @param addr0 The virtual address to be used for the operation.\n* @param addr1 The virtual address to be (un)mirrored by @p addr0 when using [`MEMOP_MAP`] or [`MEMOP_UNMAP.\n*`] It has to be pointing to a RW memory.\n* Use NULL if the operation is [`MEMOP_FREE`] or [`MEMOP_ALLOC.\n*`] @param size The requested size for [`MEMOP_ALLOC`] and [`MEMOP_ALLOC_LINEAR.\n*`] @param op Operation flags. See [`MemOp.\n*`] @param perm A combination of [`MEMPERM_READ`] and [`MEMPERM_WRITE`] Using MEMPERM_EXECUTE will return an error.\n* Value 0 is used when unmapping memory.\n*\n* If a memory is mapped for two or more addresses, you have to use MEMOP_UNMAP before being able to MEMOP_FREE it.\n* MEMOP_MAP will fail if @p addr1 was already mapped to another address.\n*\n* More information is available at [`svcControlProcessMemory\n*/`]"] - #[doc = ""] + #[doc = "Memory management\n# **\n* Controls memory mapping\n* # Arguments\n\n* `addr_out` (direction out) - The virtual address resulting from the operation. Usually the same as addr0.\n* * `addr0` - The virtual address to be used for the operation.\n* * `addr1` - The virtual address to be (un)mirrored by `addr0` when using MEMOP_MAP or MEMOP_UNMAP.\n* It has to be pointing to a RW memory.\n* Use NULL if the operation is MEMOP_FREE or MEMOP_ALLOC.\n* * `size` - The requested size for MEMOP_ALLOC and MEMOP_ALLOC_LINEAR.\n* * `op` - Operation flags. See MemOp.\n* * `perm` - A combination of MEMPERM_READ and MEMPERM_WRITE. Using MEMPERM_EXECUTE will return an error.\n* Value 0 is used when unmapping memory.\n*\n* If a memory is mapped for two or more addresses, you have to use MEMOP_UNMAP before being able to MEMOP_FREE it.\n* MEMOP_MAP will fail if `addr1` was already mapped to another address.\n*\n* More information is available at http://3dbrew.org/wiki/SVC#Memory_Mapping.\n*\n* [`svcControlProcessMemory`]\n*/"] pub fn svcControlMemory( addr_out: *mut u32_, addr0: u32_, @@ -2735,8 +2272,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Controls the memory mapping of a process\n @param addr0 The virtual address to map\n @param addr1 The virtual address to be mapped by @p addr0\n @param type Only operations [`MEMOP_MAP`] [`MEMOP_UNMAP`] and [`MEMOP_PROT`] are allowed.\n\n This is the only SVC which allows mapping executable memory.\n Using [`MEMOP_PROT`] will change the memory permissions of an already mapped memory.\n\n @note The pseudo handle for the current process is not supported by this service call.\n [`svcControlProcess`]"] - #[doc = ""] + #[doc = " Controls the memory mapping of a process\n # Arguments\n\n* `addr0` - The virtual address to map\n * `addr1` - The virtual address to be mapped by `addr0`\n * `type` - Only operations MEMOP_MAP, MEMOP_UNMAP and MEMOP_PROT are allowed.\n\n This is the only SVC which allows mapping executable memory.\n Using MEMOP_PROT will change the memory permissions of an already mapped memory.\n\n > **Note:** The pseudo handle for the current process is not supported by this service call.\n [`svcControlProcess`]"] pub fn svcControlProcessMemory( process: Handle, addr0: u32_, @@ -2748,8 +2284,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Creates a block of shared memory\n @param[out] memblock Pointer to store the handle of the block\n @param addr Address of the memory to map, page-aligned. So its alignment must be 0x1000.\n @param size Size of the memory to map, a multiple of 0x1000.\n @param my_perm Memory permissions for the current process\n @param other_perm Memory permissions for the other processes\n\n @note The shared memory block, and its rights, are destroyed when the handle is closed."] - #[doc = ""] + #[doc = " Creates a block of shared memory\n # Arguments\n\n* `memblock` (direction out) - Pointer to store the handle of the block\n * `addr` - Address of the memory to map, page-aligned. So its alignment must be 0x1000.\n * `size` - Size of the memory to map, a multiple of 0x1000.\n * `my_perm` - Memory permissions for the current process\n * `other_perm` - Memory permissions for the other processes\n\n > **Note:** The shared memory block, and its rights, are destroyed when the handle is closed."] pub fn svcCreateMemoryBlock( memblock: *mut Handle, addr: u32_, @@ -2760,8 +2295,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Maps a block of shared memory\n @param memblock Handle of the block\n @param addr Address of the memory to map, page-aligned. So its alignment must be 0x1000.\n @param my_perm Memory permissions for the current process\n @param other_perm Memory permissions for the other processes\n\n @note The shared memory block, and its rights, are destroyed when the handle is closed."] - #[doc = ""] + #[doc = " Maps a block of shared memory\n # Arguments\n\n* `memblock` - Handle of the block\n * `addr` - Address of the memory to map, page-aligned. So its alignment must be 0x1000.\n * `my_perm` - Memory permissions for the current process\n * `other_perm` - Memory permissions for the other processes\n\n > **Note:** The shared memory block, and its rights, are destroyed when the handle is closed."] pub fn svcMapMemoryBlock( memblock: Handle, addr: u32_, @@ -2771,32 +2305,27 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Maps a block of process memory, starting from address 0x00100000.\n @param process Handle of the process.\n @param destAddress Address of the block of memory to map, in the current (destination) process.\n @param size Size of the block of memory to map (truncated to a multiple of 0x1000 bytes)."] - #[doc = ""] + #[doc = " Maps a block of process memory, starting from address 0x00100000.\n # Arguments\n\n* `process` - Handle of the process.\n * `destAddress` - Address of the block of memory to map, in the current (destination) process.\n * `size` - Size of the block of memory to map (truncated to a multiple of 0x1000 bytes)."] pub fn svcMapProcessMemory(process: Handle, destAddress: u32_, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Unmaps a block of process memory, starting from address 0x00100000.\n @param process Handle of the process.\n @param destAddress Address of the block of memory to unmap, in the current (destination) process.\n @param size Size of the block of memory to unmap (truncated to a multiple of 0x1000 bytes)."] - #[doc = ""] + #[doc = " Unmaps a block of process memory, starting from address 0x00100000.\n # Arguments\n\n* `process` - Handle of the process.\n * `destAddress` - Address of the block of memory to unmap, in the current (destination) process.\n * `size` - Size of the block of memory to unmap (truncated to a multiple of 0x1000 bytes)."] pub fn svcUnmapProcessMemory(process: Handle, destAddress: u32_, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Unmaps a block of shared memory\n @param memblock Handle of the block\n @param addr Address of the memory to unmap, page-aligned. So its alignment must be 0x1000."] - #[doc = ""] + #[doc = " Unmaps a block of shared memory\n # Arguments\n\n* `memblock` - Handle of the block\n * `addr` - Address of the memory to unmap, page-aligned. So its alignment must be 0x1000."] pub fn svcUnmapMemoryBlock(memblock: Handle, addr: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Queries memory information.\n @param[out] info Pointer to output memory info to.\n @param out Pointer to output page info to.\n @param addr Virtual memory address to query."] - #[doc = ""] + #[doc = " Queries memory information.\n # Arguments\n\n* `info` (direction out) - Pointer to output memory info to.\n * `out` - Pointer to output page info to.\n * `addr` - Virtual memory address to query."] pub fn svcQueryMemory(info: *mut MemInfo, out: *mut PageInfo, addr: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Queries process memory information.\n @param[out] info Pointer to output memory info to.\n @param[out] out Pointer to output page info to.\n @param process Process to query memory from.\n @param addr Virtual memory address to query."] - #[doc = ""] + #[doc = " Queries process memory information.\n # Arguments\n\n* `info` (direction out) - Pointer to output memory info to.\n * `out` (direction out) - Pointer to output page info to.\n * `process` - Process to query memory from.\n * `addr` - Virtual memory address to query."] pub fn svcQueryProcessMemory( info: *mut MemInfo, out: *mut PageInfo, @@ -2806,37 +2335,31 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "# Process management\n@{\n**\n* @brief Gets the handle of a process.\n* @param[out] process The handle of the process\n* @param processId The ID of the process to open\n*/"] - #[doc = ""] + #[doc = "Process management\n# **\n* Gets the handle of a process.\n* # Arguments\n\n* `process` (direction out) - The handle of the process\n* processId The ID of the process to open\n*/"] pub fn svcOpenProcess(process: *mut Handle, processId: u32_) -> Result; } extern "C" { - #[doc = "Exits the current process."] - #[doc = ""] + #[doc = " Exits the current process."] pub fn svcExitProcess() -> !; } extern "C" { #[must_use] - #[doc = "Terminates a process.\n @param process Handle of the process to terminate."] - #[doc = ""] + #[doc = " Terminates a process.\n # Arguments\n\n* `process` - Handle of the process to terminate."] pub fn svcTerminateProcess(process: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Gets information about a process.\n @param[out] out Pointer to output process info to.\n @param process Handle of the process to get information about.\n @param type Type of information to retreieve."] - #[doc = ""] + #[doc = " Gets information about a process.\n # Arguments\n\n* `out` (direction out) - Pointer to output process info to.\n * `process` - Handle of the process to get information about.\n * `type` - Type of information to retreieve."] pub fn svcGetProcessInfo(out: *mut s64, process: Handle, type_: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the ID of a process.\n @param[out] out Pointer to output the process ID to.\n @param handle Handle of the process to get the ID of."] - #[doc = ""] + #[doc = " Gets the ID of a process.\n # Arguments\n\n* `out` (direction out) - Pointer to output the process ID to.\n * `handle` - Handle of the process to get the ID of."] pub fn svcGetProcessId(out: *mut u32_, handle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Gets a list of running processes.\n @param[out] processCount Pointer to output the process count to.\n @param[out] processIds Pointer to output the process IDs to.\n @param processIdMaxCount Maximum number of process IDs."] - #[doc = ""] + #[doc = " Gets a list of running processes.\n # Arguments\n\n* `processCount` (direction out) - Pointer to output the process count to.\n * `processIds` (direction out) - Pointer to output the process IDs to.\n * `processIdMaxCount` - Maximum number of process IDs."] pub fn svcGetProcessList( processCount: *mut s32, processIds: *mut u32_, @@ -2845,8 +2368,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets a list of the threads of a process.\n @param[out] threadCount Pointer to output the thread count to.\n @param[out] threadIds Pointer to output the thread IDs to.\n @param threadIdMaxCount Maximum number of thread IDs.\n @param process Process handle to list the threads of."] - #[doc = ""] + #[doc = " Gets a list of the threads of a process.\n # Arguments\n\n* `threadCount` (direction out) - Pointer to output the thread count to.\n * `threadIds` (direction out) - Pointer to output the thread IDs to.\n * `threadIdMaxCount` - Maximum number of thread IDs.\n * `process` - Process handle to list the threads of."] pub fn svcGetThreadList( threadCount: *mut s32, threadIds: *mut u32_, @@ -2856,8 +2378,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Creates a port.\n @param[out] portServer Pointer to output the port server handle to.\n @param[out] portClient Pointer to output the port client handle to.\n @param name Name of the port.\n @param maxSessions Maximum number of sessions that can connect to the port."] - #[doc = ""] + #[doc = " Creates a port.\n # Arguments\n\n* `portServer` (direction out) - Pointer to output the port server handle to.\n * `portClient` (direction out) - Pointer to output the port client handle to.\n * `name` - Name of the port.\n * `maxSessions` - Maximum number of sessions that can connect to the port."] pub fn svcCreatePort( portServer: *mut Handle, portClient: *mut Handle, @@ -2867,37 +2388,33 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Connects to a port.\n @param[out] out Pointer to output the port handle to.\n @param portName Name of the port."] - #[doc = ""] + #[doc = " Connects to a port.\n # Arguments\n\n* `out` (direction out) - Pointer to output the port handle to.\n * `portName` - Name of the port."] pub fn svcConnectToPort(out: *mut Handle, portName: *const ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = "Sets up virtual address space for a new process.\n @param[out] out Pointer to output the codeset handle to.\n @param info Codeset header, contains process name, titleId and segment info.\n @param textSegmentLma Address of executable segment in caller's address space.\n @param roSegmentLma Address of read-only segment in caller's address space.\n @param dataSegmentLma Address of read-write segment in caller's address space.\n @note On success, the provided segments are unmapped from the caller's address space."] - #[doc = ""] + #[doc = " Sets up virtual address space for a new process\n # Arguments\n\n* `out` (direction out) - Pointer to output the code set handle to.\n * `info` - Description for setting up the addresses\n * `code_ptr` - Pointer to .text in shared memory\n * `ro_ptr` - Pointer to .rodata in shared memory\n * `data_ptr` - Pointer to .data in shared memory"] pub fn svcCreateCodeSet( out: *mut Handle, - info: *const CodeSetHeader, - textSegmentLma: u32_, - roSegmentLma: u32_, - dataSegmentLma: u32_, + info: *const CodeSetInfo, + code_ptr: *mut ::libc::c_void, + ro_ptr: *mut ::libc::c_void, + data_ptr: *mut ::libc::c_void, ) -> Result; } extern "C" { #[must_use] - #[doc = "Create a new process.\n @param[out] out Pointer to output the process handle to.\n @param codeset Codeset created for this process.\n @param arm11KernelCaps Arm11 Kernel Capabilities from exheader.\n @param numArm11KernelCaps Number of kernel capabilities."] - #[doc = ""] + #[doc = " Sets up virtual address space for a new process\n # Arguments\n\n* `out` (direction out) - Pointer to output the process handle to.\n * `codeset` - Codeset created for this process\n * `arm11kernelcaps` - ARM11 Kernel Capabilities from exheader\n * `arm11kernelcaps_num` - Number of kernel capabilities"] pub fn svcCreateProcess( out: *mut Handle, codeset: Handle, - arm11KernelCaps: *const u32_, - numArm11KernelCaps: s32, + arm11kernelcaps: *const u32_, + arm11kernelcaps_num: u32_, ) -> Result; } extern "C" { #[must_use] - #[doc = "Gets a process's affinity mask.\n @param[out] affinitymask Pointer to store the affinity masks.\n @param process Handle of the process.\n @param processorcount Number of processors."] - #[doc = ""] + #[doc = " Gets a process's affinity mask.\n # Arguments\n\n* `affinitymask` (direction out) - Pointer to store the affinity masks.\n * `process` - Handle of the process.\n * `processorcount` - Number of processors."] pub fn svcGetProcessAffinityMask( affinitymask: *mut u8_, process: Handle, @@ -2906,8 +2423,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Sets a process's affinity mask.\n @param process Handle of the process.\n @param affinitymask Pointer to retrieve the affinity masks from.\n @param processorcount Number of processors."] - #[doc = ""] + #[doc = " Sets a process's affinity mask.\n # Arguments\n\n* `process` - Handle of the process.\n * `affinitymask` - Pointer to retrieve the affinity masks from.\n * `processorcount` - Number of processors."] pub fn svcSetProcessAffinityMask( process: Handle, affinitymask: *const u8_, @@ -2916,26 +2432,22 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets a process's ideal processor.\n @param[out] processorid Pointer to store the ID of the process's ideal processor.\n @param process Handle of the process."] - #[doc = ""] + #[doc = " Gets a process's ideal processor.\n # Arguments\n\n* `processorid` (direction out) - Pointer to store the ID of the process's ideal processor.\n * `process` - Handle of the process."] pub fn svcGetProcessIdealProcessor(processorid: *mut s32, process: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Sets a process's ideal processor.\n @param process Handle of the process.\n @param processorid ID of the process's ideal processor."] - #[doc = ""] + #[doc = " Sets a process's ideal processor.\n # Arguments\n\n* `process` - Handle of the process.\n * `processorid` - ID of the process's ideal processor."] pub fn svcSetProcessIdealProcessor(process: Handle, processorid: s32) -> Result; } extern "C" { #[must_use] - #[doc = "Launches the main thread of the process.\n @param process Handle of the process.\n @param info Pointer to a StartupInfo structure describing information for the main thread."] - #[doc = ""] + #[doc = " Launches the main thread of the process.\n # Arguments\n\n* `process` - Handle of the process.\n * `info` - Pointer to a StartupInfo structure describing information for the main thread."] pub fn svcRun(process: Handle, info: *const StartupInfo) -> Result; } extern "C" { #[must_use] - #[doc = "# Multithreading\n@{\n**\n* @brief Creates a new thread.\n* @param[out] thread The thread handle\n* @param entrypoint The function that will be called first upon thread creation\n* @param arg The argument passed to @p entrypoint\n* @param stack_top The top of the thread's stack. Must be 0x8 bytes mem-aligned.\n* @param thread_priority Low values gives the thread higher priority.\n* For userland apps, this has to be within the range [0x18;0x3F]\n* @param processor_id The id of the processor the thread should be ran on. Those are labelled starting from 0.\n* For old 3ds it has to be <2, and for new 3DS <4.\n* Value -1 means all CPUs and -2 read from the Exheader.\n*\n* The processor with ID 1 is the system processor.\n* To enable multi-threading on this core you need to call APT_SetAppCpuTimeLimit at least once with a non-zero value.\n*\n* Since a thread is considered as a waitable object, you can use [`svcWaitSynchronization\n*`] and [`svcWaitSynchronizationN`] to join with it.\n*\n* @note The kernel will clear the @p stack_top's address low 3 bits to make sure it is 0x8-bytes aligned.\n*/"] - #[doc = ""] + #[doc = "Multithreading\n# **\n* Creates a new thread.\n* # Arguments\n\n* `thread` (direction out) - The thread handle\n* * `entrypoint` - The function that will be called first upon thread creation\n* * `arg` - The argument passed to `entrypoint`\n* * `stack_top` - The top of the thread's stack. Must be 0x8 bytes mem-aligned.\n* * `thread_priority` - Low values gives the thread higher priority.\n* For userland apps, this has to be within the range [0x18;0x3F]\n* * `processor_id` - The id of the processor the thread should be ran on. Those are labelled starting from 0.\n* For old 3ds it has to be <2, and for new 3DS <4.\n* Value -1 means all CPUs and -2 read from the Exheader.\n*\n* The processor with ID 1 is the system processor.\n* To enable multi-threading on this core you need to call APT_SetAppCpuTimeLimit at least once with a non-zero value.\n*\n* Since a thread is considered as a waitable object, you can use svcWaitSynchronization\n* and svcWaitSynchronizationN to join with it.\n*\n* > **Note:** The kernel will clear the `stack_top's` address low 3 bits to make sure it is 0x8-bytes aligned.\n*/"] pub fn svcCreateThread( thread: *mut Handle, entrypoint: ThreadFunc, @@ -2947,36 +2459,30 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets the handle of a thread.\n @param[out] thread The handle of the thread\n @param process The ID of the process linked to the thread"] - #[doc = ""] + #[doc = " Gets the handle of a thread.\n # Arguments\n\n* `thread` (direction out) - The handle of the thread\n process The ID of the process linked to the thread"] pub fn svcOpenThread(thread: *mut Handle, process: Handle, threadId: u32_) -> Result; } extern "C" { - #[doc = "Exits the current thread.\n\n This will trigger a state change and hence release all [`svcWaitSynchronization`] operations.\n It means that you can join a thread by calling ``` svcWaitSynchronization(threadHandle,yourtimeout);"] - #[doc = ""] + #[doc = " Exits the current thread.\n\n This will trigger a state change and hence release all svcWaitSynchronization operations.\n It means that you can join a thread by calling svcWaitSynchronization(threadHandle,yourtimeout); "] pub fn svcExitThread() -> !; } extern "C" { - #[doc = "Puts the current thread to sleep.\n @param ns The minimum number of nanoseconds to sleep for."] - #[doc = ""] + #[doc = " Puts the current thread to sleep.\n # Arguments\n\n* `ns` - The minimum number of nanoseconds to sleep for."] pub fn svcSleepThread(ns: s64); } extern "C" { #[must_use] - #[doc = "Retrieves the priority of a thread."] - #[doc = ""] + #[doc = " Retrieves the priority of a thread."] pub fn svcGetThreadPriority(out: *mut s32, handle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Changes the priority of a thread\n @param prio For userland apps, this has to be within the range [0x18;0x3F]\n\n Low values gives the thread higher priority."] - #[doc = ""] + #[doc = " Changes the priority of a thread\n # Arguments\n\n* `prio` - For userland apps, this has to be within the range [0x18;0x3F]\n\n Low values gives the thread higher priority."] pub fn svcSetThreadPriority(thread: Handle, prio: s32) -> Result; } extern "C" { #[must_use] - #[doc = "Gets a thread's affinity mask.\n @param[out] affinitymask Pointer to output the affinity masks to.\n @param thread Handle of the thread.\n @param processorcount Number of processors."] - #[doc = ""] + #[doc = " Gets a thread's affinity mask.\n # Arguments\n\n* `affinitymask` (direction out) - Pointer to output the affinity masks to.\n * `thread` - Handle of the thread.\n * `processorcount` - Number of processors."] pub fn svcGetThreadAffinityMask( affinitymask: *mut u8_, thread: Handle, @@ -2985,8 +2491,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Sets a thread's affinity mask.\n @param thread Handle of the thread.\n @param affinitymask Pointer to retrieve the affinity masks from.\n @param processorcount Number of processors."] - #[doc = ""] + #[doc = " Sets a thread's affinity mask.\n # Arguments\n\n* `thread` - Handle of the thread.\n * `affinitymask` - Pointer to retrieve the affinity masks from.\n * `processorcount` - Number of processors."] pub fn svcSetThreadAffinityMask( thread: Handle, affinitymask: *const u8_, @@ -2995,37 +2500,31 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets a thread's ideal processor.\n @param[out] processorid Pointer to output the ID of the thread's ideal processor to.\n @param thread Handle of the thread."] - #[doc = ""] + #[doc = " Gets a thread's ideal processor.\n # Arguments\n\n* `processorid` (direction out) - Pointer to output the ID of the thread's ideal processor to.\n * `thread` - Handle of the thread."] pub fn svcGetThreadIdealProcessor(processorid: *mut s32, thread: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Sets a thread's ideal processor.\n @param thread Handle of the thread.\n @param processorid ID of the thread's ideal processor."] - #[doc = ""] + #[doc = " Sets a thread's ideal processor.\n # Arguments\n\n* `thread` - Handle of the thread.\n * `processorid` - ID of the thread's ideal processor."] pub fn svcSetThreadIdealProcessor(thread: Handle, processorid: s32) -> Result; } extern "C" { - #[doc = "Returns the ID of the processor the current thread is running on.\n [`svcCreateThread`]"] - #[doc = ""] + #[doc = " Returns the ID of the processor the current thread is running on.\n [`svcCreateThread`]"] pub fn svcGetProcessorID() -> s32; } extern "C" { #[must_use] - #[doc = "Gets the ID of a thread.\n @param[out] out Pointer to output the thread ID of the thread @p handle to.\n @param handle Handle of the thread."] - #[doc = ""] + #[doc = " Gets the ID of a thread.\n # Arguments\n\n* `out` (direction out) - Pointer to output the thread ID of the thread `handle` to.\n * `handle` - Handle of the thread."] pub fn svcGetThreadId(out: *mut u32_, handle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the resource limit set of a process.\n @param[out] resourceLimit Pointer to output the resource limit set handle to.\n @param process Process to get the resource limits of."] - #[doc = ""] + #[doc = " Gets the resource limit set of a process.\n # Arguments\n\n* `resourceLimit` (direction out) - Pointer to output the resource limit set handle to.\n * `process` - Process to get the resource limits of."] pub fn svcGetResourceLimit(resourceLimit: *mut Handle, process: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the value limits of a resource limit set.\n @param[out] values Pointer to output the value limits to.\n @param resourceLimit Resource limit set to use.\n @param names Resource limit names to get the limits of.\n @param nameCount Number of resource limit names."] - #[doc = ""] + #[doc = " Gets the value limits of a resource limit set.\n # Arguments\n\n* `values` (direction out) - Pointer to output the value limits to.\n * `resourceLimit` - Resource limit set to use.\n * `names` - Resource limit names to get the limits of.\n * `nameCount` - Number of resource limit names."] pub fn svcGetResourceLimitLimitValues( values: *mut s64, resourceLimit: Handle, @@ -3035,8 +2534,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets the values of a resource limit set.\n @param[out] values Pointer to output the values to.\n @param resourceLimit Resource limit set to use.\n @param names Resource limit names to get the values of.\n @param nameCount Number of resource limit names."] - #[doc = ""] + #[doc = " Gets the values of a resource limit set.\n # Arguments\n\n* `values` (direction out) - Pointer to output the values to.\n * `resourceLimit` - Resource limit set to use.\n * `names` - Resource limit names to get the values of.\n * `nameCount` - Number of resource limit names."] pub fn svcGetResourceLimitCurrentValues( values: *mut s64, resourceLimit: Handle, @@ -3046,20 +2544,17 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Sets the resource limit set of a process.\n @param process Process to set the resource limit set to.\n @param resourceLimit Resource limit set handle."] - #[doc = ""] + #[doc = " Sets the resource limit set of a process.\n # Arguments\n\n* `process` - Process to set the resource limit set to.\n * `resourceLimit` - Resource limit set handle."] pub fn svcSetProcessResourceLimits(process: Handle, resourceLimit: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Creates a resource limit set.\n @param[out] resourceLimit Pointer to output the resource limit set handle to."] - #[doc = ""] + #[doc = " Creates a resource limit set.\n # Arguments\n\n* `resourceLimit` (direction out) - Pointer to output the resource limit set handle to."] pub fn svcCreateResourceLimit(resourceLimit: *mut Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the value limits of a resource limit set.\n @param resourceLimit Resource limit set to use.\n @param names Resource limit names to set the limits of.\n @param values Value limits to set. The high 32 bits of RESLIMIT_COMMIT are used to\nset APPMEMALLOC in configuration memory, otherwise those bits are unused.\n @param nameCount Number of resource limit names."] - #[doc = ""] + #[doc = " Sets the value limits of a resource limit set.\n # Arguments\n\n* `resourceLimit` - Resource limit set to use.\n * `names` - Resource limit names to set the limits of.\n * `values` - Value limits to set. The high 32 bits of RESLIMIT_COMMIT are used to\nset APPMEMALLOC in configuration memory, otherwise those bits are unused.\n * `nameCount` - Number of resource limit names."] pub fn svcSetResourceLimitValues( resourceLimit: Handle, names: *const ResourceLimitType, @@ -3069,69 +2564,58 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets the process ID of a thread.\n @param[out] out Pointer to output the process ID of the thread @p handle to.\n @param handle Handle of the thread.\n [`svcOpenProcess`]"] - #[doc = ""] + #[doc = " Gets the process ID of a thread.\n # Arguments\n\n* `out` (direction out) - Pointer to output the process ID of the thread `handle` to.\n * `handle` - Handle of the thread.\n [`svcOpenProcess`]"] pub fn svcGetProcessIdOfThread(out: *mut u32_, handle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Checks if a thread handle is valid.\n This requests always return an error when called, it only checks if the handle is a thread or not.\n @return 0xD8E007ED (BAD_ENUM) if the Handle is a Thread Handle\n @return 0xD8E007F7 (BAD_HANDLE) if it isn't."] - #[doc = ""] + #[doc = " Checks if a thread handle is valid.\n This requests always return an error when called, it only checks if the handle is a thread or not.\n # Returns\n\n0xD8E007ED (BAD_ENUM) if the Handle is a Thread Handle\n 0xD8E007F7 (BAD_HANDLE) if it isn't."] pub fn svcGetThreadInfo(out: *mut s64, thread: Handle, type_: ThreadInfoType) -> Result; } extern "C" { #[must_use] - #[doc = "# Synchronization\n@{\n**\n* @brief Creates a mutex.\n* @param[out] mutex Pointer to output the handle of the created mutex to.\n* @param initially_locked Whether the mutex should be initially locked.\n*/"] - #[doc = ""] + #[doc = "Synchronization\n# **\n* Creates a mutex.\n* # Arguments\n\n* `mutex` (direction out) - Pointer to output the handle of the created mutex to.\n* * `initially_locked` - Whether the mutex should be initially locked.\n*/"] pub fn svcCreateMutex(mutex: *mut Handle, initially_locked: bool) -> Result; } extern "C" { #[must_use] - #[doc = "Releases a mutex.\n @param handle Handle of the mutex."] - #[doc = ""] + #[doc = " Releases a mutex.\n # Arguments\n\n* `handle` - Handle of the mutex."] pub fn svcReleaseMutex(handle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Creates a semaphore.\n @param[out] semaphore Pointer to output the handle of the created semaphore to.\n @param initial_count Initial count of the semaphore.\n @param max_count Maximum count of the semaphore."] - #[doc = ""] + #[doc = " Creates a semaphore.\n # Arguments\n\n* `semaphore` (direction out) - Pointer to output the handle of the created semaphore to.\n * `initial_count` - Initial count of the semaphore.\n * `max_count` - Maximum count of the semaphore."] pub fn svcCreateSemaphore(semaphore: *mut Handle, initial_count: s32, max_count: s32) -> Result; } extern "C" { #[must_use] - #[doc = "Releases a semaphore.\n @param[out] count Pointer to output the current count of the semaphore to.\n @param semaphore Handle of the semaphore.\n @param release_count Number to increase the semaphore count by."] - #[doc = ""] + #[doc = " Releases a semaphore.\n # Arguments\n\n* `count` (direction out) - Pointer to output the current count of the semaphore to.\n * `semaphore` - Handle of the semaphore.\n * `release_count` - Number to increase the semaphore count by."] pub fn svcReleaseSemaphore(count: *mut s32, semaphore: Handle, release_count: s32) -> Result; } extern "C" { #[must_use] - #[doc = "Creates an event handle.\n @param[out] event Pointer to output the created event handle to.\n @param reset_type Type of reset the event uses (RESET_ONESHOT/RESET_STICKY)."] - #[doc = ""] + #[doc = " Creates an event handle.\n # Arguments\n\n* `event` (direction out) - Pointer to output the created event handle to.\n * `reset_type` - Type of reset the event uses (RESET_ONESHOT/RESET_STICKY)."] pub fn svcCreateEvent(event: *mut Handle, reset_type: ResetType) -> Result; } extern "C" { #[must_use] - #[doc = "Signals an event.\n @param handle Handle of the event to signal."] - #[doc = ""] + #[doc = " Signals an event.\n # Arguments\n\n* `handle` - Handle of the event to signal."] pub fn svcSignalEvent(handle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Clears an event.\n @param handle Handle of the event to clear."] - #[doc = ""] + #[doc = " Clears an event.\n # Arguments\n\n* `handle` - Handle of the event to clear."] pub fn svcClearEvent(handle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Waits for synchronization on a handle.\n @param handle Handle to wait on.\n @param nanoseconds Maximum nanoseconds to wait for."] - #[doc = ""] + #[doc = " Waits for synchronization on a handle.\n # Arguments\n\n* `handle` - Handle to wait on.\n * `nanoseconds` - Maximum nanoseconds to wait for."] pub fn svcWaitSynchronization(handle: Handle, nanoseconds: s64) -> Result; } extern "C" { #[must_use] - #[doc = "Waits for synchronization on multiple handles.\n @param[out] out Pointer to output the index of the synchronized handle to.\n @param handles Handles to wait on.\n @param handles_num Number of handles.\n @param wait_all Whether to wait for synchronization on all handles.\n @param nanoseconds Maximum nanoseconds to wait for."] - #[doc = ""] + #[doc = " Waits for synchronization on multiple handles.\n # Arguments\n\n* `out` (direction out) - Pointer to output the index of the synchronized handle to.\n * `handles` - Handles to wait on.\n * `handles_num` - Number of handles.\n * `wait_all` - Whether to wait for synchronization on all handles.\n * `nanoseconds` - Maximum nanoseconds to wait for."] pub fn svcWaitSynchronizationN( out: *mut s32, handles: *const Handle, @@ -3142,14 +2626,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Creates an address arbiter\n @param[out] mutex Pointer to output the handle of the created address arbiter to.\n [`svcArbitrateAddress`]"] - #[doc = ""] + #[doc = " Creates an address arbiter\n # Arguments\n\n* `mutex` (direction out) - Pointer to output the handle of the created address arbiter to.\n [`svcArbitrateAddress`]"] pub fn svcCreateAddressArbiter(arbiter: *mut Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Arbitrate an address, can be used for synchronization\n @param arbiter Handle of the arbiter\n @param addr A pointer to a s32 value.\n @param type Type of action to be performed by the arbiter\n @param value Number of threads to signal if using [`ARBITRATION_SIGNAL`] or the value used for comparison.\n @param timeout_ns Optional timeout in nanoseconds when using TIMEOUT actions, ignored otherwise. If not needed, use [`svcArbitrateAddressNoTimeout`] instead.\n @note Usage of this syscall entails an implicit Data Memory Barrier (dmb).\n @warning Please use [`syncArbitrateAddressWithTimeout`] instead."] - #[doc = ""] + #[doc = " Arbitrate an address, can be used for synchronization\n # Arguments\n\n* `arbiter` - Handle of the arbiter\n * `addr` - A pointer to a s32 value.\n * `type` - Type of action to be performed by the arbiter\n * `value` - Number of threads to signal if using ARBITRATION_SIGNAL, or the value used for comparison.\n * `timeout_ns` - Optional timeout in nanoseconds when using TIMEOUT actions, ignored otherwise. If not needed, use svcArbitrateAddressNoTimeout instead.\n > **Note:** Usage of this syscall entails an implicit Data Memory Barrier (dmb).\n Please use syncArbitrateAddressWithTimeout instead."] pub fn svcArbitrateAddress( arbiter: Handle, addr: u32_, @@ -3160,8 +2642,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Same as [`svcArbitrateAddress`] but with the timeout_ns parameter undefined.\n @param arbiter Handle of the arbiter\n @param addr A pointer to a s32 value.\n @param type Type of action to be performed by the arbiter\n @param value Number of threads to signal if using [`ARBITRATION_SIGNAL`] or the value used for comparison.\n @note Usage of this syscall entails an implicit Data Memory Barrier (dmb).\n @warning Please use [`syncArbitrateAddress`] instead."] - #[doc = ""] + #[doc = " Same as svcArbitrateAddress but with the timeout_ns parameter undefined.\n # Arguments\n\n* `arbiter` - Handle of the arbiter\n * `addr` - A pointer to a s32 value.\n * `type` - Type of action to be performed by the arbiter\n * `value` - Number of threads to signal if using ARBITRATION_SIGNAL, or the value used for comparison.\n > **Note:** Usage of this syscall entails an implicit Data Memory Barrier (dmb).\n Please use syncArbitrateAddress instead."] pub fn svcArbitrateAddressNoTimeout( arbiter: Handle, addr: u32_, @@ -3171,32 +2652,27 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Sends a synchronized request to a session handle.\n @param session Handle of the session."] - #[doc = ""] + #[doc = " Sends a synchronized request to a session handle.\n # Arguments\n\n* `session` - Handle of the session."] pub fn svcSendSyncRequest(session: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Connects to a port via a handle.\n @param[out] clientSession Pointer to output the client session handle to.\n @param clientPort Port client endpoint to connect to."] - #[doc = ""] + #[doc = " Connects to a port via a handle.\n # Arguments\n\n* `clientSession` (direction out) - Pointer to output the client session handle to.\n * `clientPort` - Port client endpoint to connect to."] pub fn svcCreateSessionToPort(clientSession: *mut Handle, clientPort: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Creates a linked pair of session endpoints.\n @param[out] serverSession Pointer to output the created server endpoint handle to.\n @param[out] clientSession Pointer to output the created client endpoint handle to."] - #[doc = ""] + #[doc = " Creates a linked pair of session endpoints.\n # Arguments\n\n* `serverSession` (direction out) - Pointer to output the created server endpoint handle to.\n * `clientSession` (direction out) - Pointer to output the created client endpoint handle to."] pub fn svcCreateSession(serverSession: *mut Handle, clientSession: *mut Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Accepts a session.\n @param[out] session Pointer to output the created session handle to.\n @param port Handle of the port to accept a session from."] - #[doc = ""] + #[doc = " Accepts a session.\n # Arguments\n\n* `session` (direction out) - Pointer to output the created session handle to.\n * `port` - Handle of the port to accept a session from."] pub fn svcAcceptSession(session: *mut Handle, port: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Replies to and receives a new request.\n @param index Pointer to the index of the request.\n @param handles Session handles to receive requests from.\n @param handleCount Number of handles.\n @param replyTarget Handle of the session to reply to."] - #[doc = ""] + #[doc = " Replies to and receives a new request.\n # Arguments\n\n* `index` - Pointer to the index of the request.\n * `handles` - Session handles to receive requests from.\n * `handleCount` - Number of handles.\n * `replyTarget` - Handle of the session to reply to."] pub fn svcReplyAndReceive( index: *mut s32, handles: *const Handle, @@ -3206,67 +2682,56 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "# Time\n@{\n**\n* @brief Creates a timer.\n* @param[out] timer Pointer to output the handle of the created timer to.\n* @param reset_type Type of reset to perform on the timer.\n*/"] - #[doc = ""] + #[doc = "Time\n# **\n* Creates a timer.\n* # Arguments\n\n* `timer` (direction out) - Pointer to output the handle of the created timer to.\n* * `reset_type` - Type of reset to perform on the timer.\n*/"] pub fn svcCreateTimer(timer: *mut Handle, reset_type: ResetType) -> Result; } extern "C" { #[must_use] - #[doc = "Sets a timer.\n @param timer Handle of the timer to set.\n @param initial Initial value of the timer.\n @param interval Interval of the timer."] - #[doc = ""] + #[doc = " Sets a timer.\n # Arguments\n\n* `timer` - Handle of the timer to set.\n * `initial` - Initial value of the timer.\n * `interval` - Interval of the timer."] pub fn svcSetTimer(timer: Handle, initial: s64, interval: s64) -> Result; } extern "C" { #[must_use] - #[doc = "Cancels a timer.\n @param timer Handle of the timer to cancel."] - #[doc = ""] + #[doc = " Cancels a timer.\n # Arguments\n\n* `timer` - Handle of the timer to cancel."] pub fn svcCancelTimer(timer: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Clears a timer.\n @param timer Handle of the timer to clear."] - #[doc = ""] + #[doc = " Clears a timer.\n # Arguments\n\n* `timer` - Handle of the timer to clear."] pub fn svcClearTimer(timer: Handle) -> Result; } extern "C" { - #[doc = "Gets the current system tick.\n @return The current system tick."] - #[doc = ""] + #[doc = " Gets the current system tick.\n # Returns\n\nThe current system tick."] pub fn svcGetSystemTick() -> u64_; } extern "C" { #[must_use] - #[doc = "# System\n@{\n**\n* @brief Closes a handle.\n* @param handle Handle to close.\n*/"] - #[doc = ""] + #[doc = "System\n# **\n* Closes a handle.\n* # Arguments\n\n* `handle` - Handle to close.\n*/"] pub fn svcCloseHandle(handle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Duplicates a handle.\n @param[out] out Pointer to output the duplicated handle to.\n @param original Handle to duplicate."] - #[doc = ""] + #[doc = " Duplicates a handle.\n # Arguments\n\n* `out` (direction out) - Pointer to output the duplicated handle to.\n * `original` - Handle to duplicate."] pub fn svcDuplicateHandle(out: *mut Handle, original: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Gets a handle info.\n @param[out] out Pointer to output the handle info to.\n @param handle Handle to get the info for.\n @param param Parameter clarifying the handle info type."] - #[doc = ""] + #[doc = " Gets a handle info.\n # Arguments\n\n* `out` (direction out) - Pointer to output the handle info to.\n * `handle` - Handle to get the info for.\n * `param` - Parameter clarifying the handle info type."] pub fn svcGetHandleInfo(out: *mut s64, handle: Handle, param: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the system info.\n @param[out] out Pointer to output the system info to.\n @param type Type of system info to retrieve.\n @param param Parameter clarifying the system info type."] - #[doc = ""] + #[doc = " Gets the system info.\n # Arguments\n\n* `out` (direction out) - Pointer to output the system info to.\n * `type` - Type of system info to retrieve.\n * `param` - Parameter clarifying the system info type."] pub fn svcGetSystemInfo(out: *mut s64, type_: u32_, param: s32) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the current kernel state.\n @param type Type of state to set (the other parameters depend on it)."] - #[doc = ""] + #[doc = " Sets the current kernel state.\n # Arguments\n\n* `type` - Type of state to set (the other parameters depend on it)."] pub fn svcKernelSetState(type_: u32_, ...) -> Result; } extern "C" { #[must_use] - #[doc = "Binds an event or semaphore handle to an ARM11 interrupt.\n @param interruptId Interrupt identfier (see @param eventOrSemaphore Event or semaphore handle to bind to the given interrupt.\n @param priority Priority of the interrupt for the current process.\n @param isManualClear Indicates whether the interrupt has to be manually cleared or not (= level-high active)."] - #[doc = ""] + #[doc = " Binds an event or semaphore handle to an ARM11 interrupt.\n # Arguments\n\n* `interruptId` - Interrupt identfier (see https://www.3dbrew.org/wiki/ARM11_Interrupts).\n * `eventOrSemaphore` - Event or semaphore handle to bind to the given interrupt.\n * `priority` - Priority of the interrupt for the current process.\n * `isManualClear` - Indicates whether the interrupt has to be manually cleared or not (= level-high active)."] pub fn svcBindInterrupt( interruptId: u32_, eventOrSemaphore: Handle, @@ -3276,32 +2741,27 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Unbinds an event or semaphore handle from an ARM11 interrupt.\n @param interruptId Interrupt identfier, see (see @param eventOrSemaphore Event or semaphore handle to unbind from the given interrupt."] - #[doc = ""] + #[doc = " Unbinds an event or semaphore handle from an ARM11 interrupt.\n # Arguments\n\n* `interruptId` - Interrupt identfier, see (see https://www.3dbrew.org/wiki/ARM11_Interrupts).\n * `eventOrSemaphore` - Event or semaphore handle to unbind from the given interrupt."] pub fn svcUnbindInterrupt(interruptId: u32_, eventOrSemaphore: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Invalidates a process's data cache.\n @param process Handle of the process.\n @param addr Address to invalidate.\n @param size Size of the memory to invalidate."] - #[doc = ""] + #[doc = " Invalidates a process's data cache.\n # Arguments\n\n* `process` - Handle of the process.\n * `addr` - Address to invalidate.\n * `size` - Size of the memory to invalidate."] pub fn svcInvalidateProcessDataCache(process: Handle, addr: u32_, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Cleans a process's data cache.\n @param process Handle of the process.\n @param addr Address to clean.\n @param size Size of the memory to clean."] - #[doc = ""] + #[doc = " Cleans a process's data cache.\n # Arguments\n\n* `process` - Handle of the process.\n * `addr` - Address to clean.\n * `size` - Size of the memory to clean."] pub fn svcStoreProcessDataCache(process: Handle, addr: u32_, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Flushes (cleans and invalidates) a process's data cache.\n @param process Handle of the process.\n @param addr Address to flush.\n @param size Size of the memory to flush."] - #[doc = ""] + #[doc = " Flushes (cleans and invalidates) a process's data cache.\n # Arguments\n\n* `process` - Handle of the process.\n * `addr` - Address to flush.\n * `size` - Size of the memory to flush."] pub fn svcFlushProcessDataCache(process: Handle, addr: u32_, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Begins an inter-process DMA transfer.\n @param[out] dma Pointer to output the handle of the DMA channel object to.\n @param dstProcess Destination process handle.\n @param dstAddr Address in the destination process to write data to.\n @param srcProcess Source process handle.\n @param srcAddr Address in the source to read data from.\n @param size Size of the data to transfer.\n @param cfg Configuration structure.\n @note The handle is signaled when the transfer finishes."] - #[doc = ""] + #[doc = " Begins an inter-process DMA transfer.\n # Arguments\n\n* `dma` (direction out) - Pointer to output the handle of the DMA channel object to.\n * `dstProcess` - Destination process handle.\n * `dstAddr` - Address in the destination process to write data to.\n * `srcProcess` - Source process handle.\n * `srcAddr` - Address in the source to read data from.\n * `size` - Size of the data to transfer.\n * `cfg` - Configuration structure.\n > **Note:** The handle is signaled when the transfer finishes."] pub fn svcStartInterProcessDma( dma: *mut Handle, dstProcess: Handle, @@ -3314,20 +2774,17 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Stops an inter-process DMA transfer.\n @param dma Handle of the DMA channel object."] - #[doc = ""] + #[doc = " Stops an inter-process DMA transfer.\n # Arguments\n\n* `dma` - Handle of the DMA channel object."] pub fn svcStopDma(dma: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the state of an inter-process DMA transfer.\n @param[out] state Pointer to output the state of the DMA transfer to.\n @param dma Handle of the DMA channel object."] - #[doc = ""] + #[doc = " Gets the state of an inter-process DMA transfer.\n # Arguments\n\n* `state` (direction out) - Pointer to output the state of the DMA transfer to.\n * `dma` - Handle of the DMA channel object."] pub fn svcGetDmaState(state: *mut DmaState, dma: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Restarts a DMA transfer, using the same configuration as before.\n @param[out] state Pointer to output the state of the DMA transfer to.\n @param dma Handle of the DMA channel object.\n @param dstAddr Address in the destination process to write data to.\n @param srcAddr Address in the source to read data from.\n @param size Size of the data to transfer.\n @param flags Restart flags, [`DMARST_UNLOCK`] and/or [`DMARST_RESUME_DEVICE.\n`] @note The first transfer has to be configured with [`DMACFG_KEEP_LOCKED`]"] - #[doc = ""] + #[doc = " Restarts a DMA transfer, using the same configuration as before.\n # Arguments\n\n* `state` (direction out) - Pointer to output the state of the DMA transfer to.\n * `dma` - Handle of the DMA channel object.\n * `dstAddr` - Address in the destination process to write data to.\n * `srcAddr` - Address in the source to read data from.\n * `size` - Size of the data to transfer.\n * `flags` - Restart flags, DMARST_UNLOCK and/or DMARST_RESUME_DEVICE.\n > **Note:** The first transfer has to be configured with DMACFG_KEEP_LOCKED."] pub fn svcRestartDma( dma: Handle, dstAddr: u32_, @@ -3338,24 +2795,20 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Sets the GPU protection register to restrict the range of the GPU DMA. 11.3+ only.\n @param useApplicationRestriction Whether to use the register value used for APPLICATION titles."] - #[doc = ""] + #[doc = " Sets the GPU protection register to restrict the range of the GPU DMA. 11.3+ only.\n # Arguments\n\n* `useApplicationRestriction` - Whether to use the register value used for APPLICATION titles."] pub fn svcSetGpuProt(useApplicationRestriction: bool) -> Result; } extern "C" { #[must_use] - #[doc = "Enables or disables Wi-Fi. 11.4+ only.\n @param enabled Whether to enable or disable Wi-Fi."] - #[doc = ""] + #[doc = " Enables or disables Wi-Fi. 11.4+ only.\n # Arguments\n\n* `enabled` - Whether to enable or disable Wi-Fi."] pub fn svcSetWifiEnabled(enabled: bool) -> Result; } extern "C" { - #[doc = "# Debugging\n@{\n**\n* @brief Breaks execution.\n* @param breakReason Reason for breaking.\n*/"] - #[doc = ""] + #[doc = "Debugging\n# **\n* Breaks execution.\n* # Arguments\n\n* `breakReason` - Reason for breaking.\n*/"] pub fn svcBreak(breakReason: UserBreakType); } extern "C" { - #[doc = "Breaks execution (LOAD_RO and UNLOAD_RO).\n @param breakReason Debug reason for breaking.\n @param croInfo Library information.\n @param croInfoSize Size of the above structure."] - #[doc = ""] + #[doc = " Breaks execution (LOAD_RO and UNLOAD_RO).\n # Arguments\n\n* `breakReason` - Debug reason for breaking.\n * `croInfo` - Library information.\n * `croInfoSize` - Size of the above structure."] pub fn svcBreakRO( breakReason: UserBreakType, croInfo: *const ::libc::c_void, @@ -3364,14 +2817,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Outputs a debug string.\n @param str String to output.\n @param length Length of the string to output, needs to be positive."] - #[doc = ""] + #[doc = " Outputs a debug string.\n # Arguments\n\n* `str` - String to output.\n * `length` - Length of the string to output, needs to be positive."] pub fn svcOutputDebugString(str_: *const ::libc::c_char, length: s32) -> Result; } extern "C" { #[must_use] - #[doc = "Controls performance monitoring on the CP15 interface and the SCU.\n The meaning of the parameters depend on the operation.\n @param[out] out Output.\n @param op Operation, see details.\n @param param1 First parameter.\n @param param2 Second parameter.\n @details The operations are the following:\n - [`PERFCOUNTEROP_ENABLE`] (void) -> void, tries to enable and lock perfmon. functionality.\n - [`PERFCOUNTEROP_DISABLE`] (void) -> void, disable and forcibly unlocks perfmon. functionality.\n - [`PERFCOUNTEROP_GET_VALUE`] [`PerfCounterRegister`] reg) -> u64, gets the value of a particular counter register.\n - [`PERFCOUNTEROP_SET_VALUE`] [`PerfCounterRegister`] reg, u64 value) -> void, sets the value of a particular counter register.\n - [`PERFCOUNTEROP_GET_OVERFLOW_FLAGS`] (void) -> u32, gets the overflow flags of all CP15 and SCU registers.\n - Format is a bitfield of [`PerfCounterRegister.\n`] - [`PERFCOUNTEROP_RESET`] (u32 valueResetMask, u32 overflowFlagResetMask) -> void, resets the value and/or\n overflow flags of selected registers.\n - Format is two bitfields of [`PerfCounterRegister.\n`] - [`PERFCOUNTEROP_GET_EVENT`] [`PerfCounterRegister`] reg) -> [`PerfCounterEvent`] gets the event associated\n to a particular counter register.\n - [`PERFCOUNTEROP_SET_EVENT`] [`PerfCounterRegister`] reg, [`PerfCounterEvent)`] -> void, sets the event associated\n to a particular counter register.\n - [`PERFCOUNTEROP_SET_VIRTUAL_COUNTER_ENABLED`] (bool enabled) -> void, (dis)allows the kernel to track counter overflows\n and to use 64-bit counter values."] - #[doc = ""] + #[doc = " Controls performance monitoring on the CP15 interface and the SCU.\n The meaning of the parameters depend on the operation.\n # Arguments\n\n* `out` (direction out) - Output.\n * `op` - Operation, see details.\n * `param1` - First parameter.\n * `param2` - Second parameter.\n \n\nThe operations are the following:\n - PERFCOUNTEROP_ENABLE (void) -> void, tries to enable and lock perfmon. functionality.\n - PERFCOUNTEROP_DISABLE (void) -> void, disable and forcibly unlocks perfmon. functionality.\n - PERFCOUNTEROP_GET_VALUE (PerfCounterRegister reg) -> u64, gets the value of a particular counter register.\n - PERFCOUNTEROP_SET_VALUE (PerfCounterRegister reg, u64 value) -> void, sets the value of a particular counter register.\n - PERFCOUNTEROP_GET_OVERFLOW_FLAGS (void) -> u32, gets the overflow flags of all CP15 and SCU registers.\n - Format is a bitfield of PerfCounterRegister.\n - PERFCOUNTEROP_RESET (u32 valueResetMask, u32 overflowFlagResetMask) -> void, resets the value and/or\n overflow flags of selected registers.\n - Format is two bitfields of PerfCounterRegister.\n - PERFCOUNTEROP_GET_EVENT (PerfCounterRegister reg) -> PerfCounterEvent, gets the event associated\n to a particular counter register.\n - PERFCOUNTEROP_SET_EVENT (PerfCounterRegister reg, PerfCounterEvent) -> void, sets the event associated\n to a particular counter register.\n - PERFCOUNTEROP_SET_VIRTUAL_COUNTER_ENABLED (bool enabled) -> void, (dis)allows the kernel to track counter overflows\n and to use 64-bit counter values."] pub fn svcControlPerformanceCounter( out: *mut u64_, op: PerfCounterOperation, @@ -3381,38 +2832,32 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Creates a debug handle for an active process.\n @param[out] debug Pointer to output the created debug handle to.\n @param processId ID of the process to debug."] - #[doc = ""] + #[doc = " Creates a debug handle for an active process.\n # Arguments\n\n* `debug` (direction out) - Pointer to output the created debug handle to.\n * `processId` - ID of the process to debug."] pub fn svcDebugActiveProcess(debug: *mut Handle, processId: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Breaks a debugged process.\n @param debug Debug handle of the process."] - #[doc = ""] + #[doc = " Breaks a debugged process.\n # Arguments\n\n* `debug` - Debug handle of the process."] pub fn svcBreakDebugProcess(debug: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Terminates a debugged process.\n @param debug Debug handle of the process."] - #[doc = ""] + #[doc = " Terminates a debugged process.\n # Arguments\n\n* `debug` - Debug handle of the process."] pub fn svcTerminateDebugProcess(debug: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the current debug event of a debugged process.\n @param[out] info Pointer to output the debug event information to.\n @param debug Debug handle of the process."] - #[doc = ""] + #[doc = " Gets the current debug event of a debugged process.\n # Arguments\n\n* `info` (direction out) - Pointer to output the debug event information to.\n * `debug` - Debug handle of the process."] pub fn svcGetProcessDebugEvent(info: *mut DebugEventInfo, debug: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Continues the current debug event of a debugged process (not necessarily the same as [`svcGetProcessDebugEvent).\n`] @param debug Debug handle of the process.\n @param flags Flags to continue with, see [`DebugFlags`]"] - #[doc = ""] + #[doc = " Continues the current debug event of a debugged process (not necessarily the same as svcGetProcessDebugEvent).\n # Arguments\n\n* `debug` - Debug handle of the process.\n * `flags` - Flags to continue with, see DebugFlags."] pub fn svcContinueDebugEvent(debug: Handle, flags: DebugFlags) -> Result; } extern "C" { #[must_use] - #[doc = "Fetches the saved registers of a thread, either inactive or awaiting [`svcContinueDebugEvent`] belonging to a debugged process.\n @param[out] context Values of the registers to fetch, see [`ThreadContext.\n`] @param debug Debug handle of the parent process.\n @param threadId ID of the thread to fetch the saved registers of.\n @param controlFlags Which registers to fetch, see [`ThreadContextControlFlags`]"] - #[doc = ""] + #[doc = " Fetches the saved registers of a thread, either inactive or awaiting svcContinueDebugEvent, belonging to a debugged process.\n # Arguments\n\n* `context` (direction out) - Values of the registers to fetch, see ThreadContext.\n * `debug` - Debug handle of the parent process.\n * `threadId` - ID of the thread to fetch the saved registers of.\n * `controlFlags` - Which registers to fetch, see ThreadContextControlFlags."] pub fn svcGetDebugThreadContext( context: *mut ThreadContext, debug: Handle, @@ -3422,8 +2867,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Updates the saved registers of a thread, either inactive or awaiting [`svcContinueDebugEvent`] belonging to a debugged process.\n @param debug Debug handle of the parent process.\n @param threadId ID of the thread to update the saved registers of.\n @param context Values of the registers to update, see [`ThreadContext.\n`] @param controlFlags Which registers to update, see [`ThreadContextControlFlags`]"] - #[doc = ""] + #[doc = " Updates the saved registers of a thread, either inactive or awaiting svcContinueDebugEvent, belonging to a debugged process.\n # Arguments\n\n* `debug` - Debug handle of the parent process.\n * `threadId` - ID of the thread to update the saved registers of.\n * `context` - Values of the registers to update, see ThreadContext.\n * `controlFlags` - Which registers to update, see ThreadContextControlFlags."] pub fn svcSetDebugThreadContext( debug: Handle, threadId: u32_, @@ -3433,8 +2877,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Queries memory information of a debugged process.\n @param[out] info Pointer to output memory info to.\n @param[out] out Pointer to output page info to.\n @param debug Debug handle of the process to query memory from.\n @param addr Virtual memory address to query."] - #[doc = ""] + #[doc = " Queries memory information of a debugged process.\n # Arguments\n\n* `info` (direction out) - Pointer to output memory info to.\n * `out` (direction out) - Pointer to output page info to.\n * `debug` - Debug handle of the process to query memory from.\n * `addr` - Virtual memory address to query."] pub fn svcQueryDebugProcessMemory( info: *mut MemInfo, out: *mut PageInfo, @@ -3444,8 +2887,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Reads from a debugged process's memory.\n @param buffer Buffer to read data to.\n @param debug Debug handle of the process.\n @param addr Address to read from.\n @param size Size of the memory to read."] - #[doc = ""] + #[doc = " Reads from a debugged process's memory.\n # Arguments\n\n* `buffer` - Buffer to read data to.\n * `debug` - Debug handle of the process.\n * `addr` - Address to read from.\n * `size` - Size of the memory to read."] pub fn svcReadProcessMemory( buffer: *mut ::libc::c_void, debug: Handle, @@ -3455,8 +2897,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Writes to a debugged process's memory.\n @param debug Debug handle of the process.\n @param buffer Buffer to write data from.\n @param addr Address to write to.\n @param size Size of the memory to write."] - #[doc = ""] + #[doc = " Writes to a debugged process's memory.\n # Arguments\n\n* `debug` - Debug handle of the process.\n * `buffer` - Buffer to write data from.\n * `addr` - Address to write to.\n * `size` - Size of the memory to write."] pub fn svcWriteProcessMemory( debug: Handle, buffer: *const ::libc::c_void, @@ -3466,14 +2907,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Sets an hardware breakpoint or watchpoint. This is an interface to the BRP/WRP registers, see .\n @param registerId range 0..5 = breakpoints (BRP0-5), 0x100..0x101 = watchpoints (WRP0-1). The previous stop point for the register is disabled.\n @param control Value of the control regiser.\n @param value Value of the value register: either and address (if bit21 of control is clear) or the debug handle of a process to fetch the context ID of."] - #[doc = ""] + #[doc = " Sets an hardware breakpoint or watchpoint. This is an interface to the BRP/WRP registers, see http://infocenter.arm.com/help/topic/com.arm.doc.ddi0360f/CEGEBGFC.html .\n # Arguments\n\n* `registerId` - range 0..5 = breakpoints (BRP0-5), 0x100..0x101 = watchpoints (WRP0-1). The previous stop point for the register is disabled.\n * `control` - Value of the control regiser.\n * `value` - Value of the value register: either and address (if bit21 of control is clear) or the debug handle of a process to fetch the context ID of."] pub fn svcSetHardwareBreakPoint(registerId: s32, control: u32_, value: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets a debugged thread's parameter.\n @param[out] unused Unused.\n @param[out] out Output value.\n @param debug Debug handle of the process.\n @param threadId ID of the thread\n @param parameter Parameter to fetch, see [`DebugThreadParameter`]"] - #[doc = ""] + #[doc = " Gets a debugged thread's parameter.\n # Arguments\n\n* `unused` (direction out) - Unused.\n * `out` (direction out) - Output value.\n * `debug` - Debug handle of the process.\n * `threadId` - ID of the thread\n * `parameter` - Parameter to fetch, see DebugThreadParameter."] pub fn svcGetDebugThreadParam( unused: *mut s64, out: *mut u32_, @@ -3484,206 +2923,110 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Executes a function in supervisor mode.\n @param callback Function to execute."] - #[doc = ""] + #[doc = " Executes a function in supervisor mode.\n # Arguments\n\n* `callback` - Function to execute."] pub fn svcBackdoor(callback: ::core::option::Option s32>) -> Result; } -#[doc = "Mount \"nand:/\""] -#[doc = ""] - +#[doc = "< Mount \"nand:/\""] pub const ARM9DESC_MOUNT_NAND: _bindgen_ty_7 = 1; -#[doc = "Mount nand:/ro/ as read-write"] -#[doc = ""] - +#[doc = "< Mount nand:/ro/ as read-write"] pub const ARM9DESC_MOUNT_NANDRO_RW: _bindgen_ty_7 = 2; -#[doc = "Mount \"twln:/\""] -#[doc = ""] - +#[doc = "< Mount \"twln:/\""] pub const ARM9DESC_MOUNT_TWLN: _bindgen_ty_7 = 4; -#[doc = "Mount \"wnand:/\""] -#[doc = ""] - +#[doc = "< Mount \"wnand:/\""] pub const ARM9DESC_MOUNT_WNAND: _bindgen_ty_7 = 8; -#[doc = "Mount \"cardspi:/\""] -#[doc = ""] - +#[doc = "< Mount \"cardspi:/\""] pub const ARM9DESC_MOUNT_CARDSPI: _bindgen_ty_7 = 16; -#[doc = "Use SDIF3"] -#[doc = ""] - +#[doc = "< Use SDIF3"] pub const ARM9DESC_USE_SDIF3: _bindgen_ty_7 = 32; -#[doc = "Create seed (movable.sed)"] -#[doc = ""] - +#[doc = "< Create seed (movable.sed)"] pub const ARM9DESC_CREATE_SEED: _bindgen_ty_7 = 64; -#[doc = "Use card SPI, required by multiple pxi:dev commands"] -#[doc = ""] - +#[doc = "< Use card SPI, required by multiple pxi:dev commands"] pub const ARM9DESC_USE_CARD_SPI: _bindgen_ty_7 = 128; -#[doc = "SD application (not checked)"] -#[doc = ""] - +#[doc = "< SD application (not checked)"] pub const ARM9DESC_SD_APPLICATION: _bindgen_ty_7 = 256; -#[doc = "Mount \"sdmc:/\" as read-write"] -#[doc = ""] - +#[doc = "< Mount \"sdmc:/\" as read-write"] pub const ARM9DESC_MOUNT_SDMC_RW: _bindgen_ty_7 = 512; -#[doc = "ARM9 descriptor flags"] -#[doc = ""] - +#[doc = " ARM9 descriptor flags"] pub type _bindgen_ty_7 = ::libc::c_uint; -#[doc = "Category \"system application\""] -#[doc = ""] - +#[doc = "< Category \"system application\""] pub const FSACCESS_CATEGORY_SYSTEM_APPLICATION: _bindgen_ty_8 = 1; -#[doc = "Category \"hardware check\""] -#[doc = ""] - +#[doc = "< Category \"hardware check\""] pub const FSACCESS_CATEGORY_HARDWARE_CHECK: _bindgen_ty_8 = 2; -#[doc = "Category \"filesystem tool\""] -#[doc = ""] - +#[doc = "< Category \"filesystem tool\""] pub const FSACCESS_CATEGORY_FILESYSTEM_TOOL: _bindgen_ty_8 = 4; -#[doc = "Debug"] -#[doc = ""] - +#[doc = "< Debug"] pub const FSACCESS_DEBUG: _bindgen_ty_8 = 8; -#[doc = "TWLCARD backup"] -#[doc = ""] - +#[doc = "< TWLCARD backup"] pub const FSACCESS_TWLCARD_BACKUP: _bindgen_ty_8 = 16; -#[doc = "TWLNAND data"] -#[doc = ""] - +#[doc = "< TWLNAND data"] pub const FSACCESS_TWLNAND_DATA: _bindgen_ty_8 = 32; -#[doc = "BOSS (SpotPass)"] -#[doc = ""] - +#[doc = "< BOSS (SpotPass)"] pub const FSACCESS_BOSS: _bindgen_ty_8 = 64; -#[doc = "SDMC (read-write)"] -#[doc = ""] - +#[doc = "< SDMC (read-write)"] pub const FSACCESS_SDMC_RW: _bindgen_ty_8 = 128; -#[doc = "Core"] -#[doc = ""] - +#[doc = "< Core"] pub const FSACCESS_CORE: _bindgen_ty_8 = 256; -#[doc = "nand:/ro/ (read-only)"] -#[doc = ""] - +#[doc = "< nand:/ro/ (read-only)"] pub const FSACCESS_NANDRO_RO: _bindgen_ty_8 = 512; -#[doc = "nand:/rw/"] -#[doc = ""] - +#[doc = "< nand:/rw/"] pub const FSACCESS_NANDRW: _bindgen_ty_8 = 1024; -#[doc = "nand:/ro/ (read-write)"] -#[doc = ""] - +#[doc = "< nand:/ro/ (read-write)"] pub const FSACCESS_NANDRO_RW: _bindgen_ty_8 = 2048; -#[doc = "Category \"System Settings\""] -#[doc = ""] - +#[doc = "< Category \"System Settings\""] pub const FSACCESS_CATEGORY_SYSTEM_SETTINGS: _bindgen_ty_8 = 4096; -#[doc = "Cardboard (System Transfer)"] -#[doc = ""] - +#[doc = "< Cardboard (System Transfer)"] pub const FSACCESS_CARDBOARD: _bindgen_ty_8 = 8192; -#[doc = "Export/Import IVs (movable.sed)"] -#[doc = ""] - +#[doc = "< Export/Import IVs (movable.sed)"] pub const FSACCESS_EXPORT_IMPORT_IVS: _bindgen_ty_8 = 16384; -#[doc = "SDMC (write-only)"] -#[doc = ""] - +#[doc = "< SDMC (write-only)"] pub const FSACCESS_SDMC_WO: _bindgen_ty_8 = 32768; -#[doc = "\"Switch cleanup\" (3.0+)"] -#[doc = ""] - +#[doc = "< \"Switch cleanup\" (3.0+)"] pub const FSACCESS_SWITCH_CLEANUP: _bindgen_ty_8 = 65536; -#[doc = "Savedata move (5.0+)"] -#[doc = ""] - +#[doc = "< Savedata move (5.0+)"] pub const FSACCESS_SAVEDATA_MOVE: _bindgen_ty_8 = 131072; -#[doc = "Shop (5.0+)"] -#[doc = ""] - +#[doc = "< Shop (5.0+)"] pub const FSACCESS_SHOP: _bindgen_ty_8 = 262144; -#[doc = "Shop (5.0+)"] -#[doc = ""] - +#[doc = "< Shop (5.0+)"] pub const FSACCESS_SHELL: _bindgen_ty_8 = 524288; -#[doc = "Category \"Home Menu\" (6.0+)"] -#[doc = ""] - +#[doc = "< Category \"Home Menu\" (6.0+)"] pub const FSACCESS_CATEGORY_HOME_MENU: _bindgen_ty_8 = 1048576; -#[doc = "Seed DB (9.6+)"] -#[doc = ""] - +#[doc = "< Seed DB (9.6+)"] pub const FSACCESS_SEEDDB: _bindgen_ty_8 = 2097152; -#[doc = "Filesystem access flags"] -#[doc = ""] - +#[doc = " Filesystem access flags"] pub type _bindgen_ty_8 = ::libc::c_uint; -#[doc = "Regular application"] -#[doc = ""] - +#[doc = "< Regular application"] pub const RESLIMIT_CATEGORY_APPLICATION: ResourceLimitCategory = 0; -#[doc = "System applet"] -#[doc = ""] - +#[doc = "< System applet"] pub const RESLIMIT_CATEGORY_SYS_APPLET: ResourceLimitCategory = 1; -#[doc = "Library applet"] -#[doc = ""] - +#[doc = "< Library applet"] pub const RESLIMIT_CATEGORY_LIB_APPLET: ResourceLimitCategory = 2; -#[doc = "System modules running inside the BASE memregion"] -#[doc = ""] - +#[doc = "< System modules running inside the BASE memregion"] pub const RESLIMIT_CATEGORY_OTHER: ResourceLimitCategory = 3; -#[doc = "The resource limit category of a title"] -#[doc = ""] - +#[doc = " The resource limit category of a title"] pub type ResourceLimitCategory = ::libc::c_uint; -#[doc = "64MB of usable application memory"] -#[doc = ""] - +#[doc = "< 64MB of usable application memory"] pub const SYSMODE_O3DS_PROD: SystemMode = 0; -#[doc = "124MB of usable application memory. Unusable on O3DS"] -#[doc = ""] - +#[doc = "< 124MB of usable application memory. Unusable on O3DS"] pub const SYSMODE_N3DS_PROD: SystemMode = 1; -#[doc = "97MB/178MB of usable application memory"] -#[doc = ""] - +#[doc = "< 97MB/178MB of usable application memory"] pub const SYSMODE_DEV1: SystemMode = 2; -#[doc = "80MB/124MB of usable application memory"] -#[doc = ""] - +#[doc = "< 80MB/124MB of usable application memory"] pub const SYSMODE_DEV2: SystemMode = 3; -#[doc = "72MB of usable application memory. Same as \"Prod\" on N3DS"] -#[doc = ""] - +#[doc = "< 72MB of usable application memory. Same as \"Prod\" on N3DS"] pub const SYSMODE_DEV3: SystemMode = 4; -#[doc = "32MB of usable application memory. Same as \"Prod\" on N3DS"] -#[doc = ""] - +#[doc = "< 32MB of usable application memory. Same as \"Prod\" on N3DS"] pub const SYSMODE_DEV4: SystemMode = 5; -#[doc = "The system mode a title should be launched under"] -#[doc = ""] - +#[doc = " The system mode a title should be launched under"] pub type SystemMode = ::libc::c_uint; -#[doc = "The system info flags and remaster version of a title"] -#[doc = ""] +#[doc = " The system info flags and remaster version of a title"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct ExHeader_SystemInfoFlags { - #[doc = "Reserved"] - #[doc = ""] + #[doc = "< Reserved"] pub reserved: [u8_; 5usize], pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, - #[doc = "Remaster version"] - #[doc = ""] + #[doc = "< Remaster version"] pub remaster_version: u16_, } impl ExHeader_SystemInfoFlags { @@ -3726,64 +3069,47 @@ impl ExHeader_SystemInfoFlags { __bindgen_bitfield_unit } } -#[doc = "Information about a title's section"] -#[doc = ""] +#[doc = " Information about a title's section"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct ExHeader_CodeSectionInfo { - #[doc = "The address of the section"] - #[doc = ""] + #[doc = "< The address of the section"] pub address: u32_, - #[doc = "The number of pages the section occupies"] - #[doc = ""] + #[doc = "< The number of pages the section occupies"] pub num_pages: u32_, - #[doc = "The size of the section"] - #[doc = ""] + #[doc = "< The size of the section"] pub size: u32_, } -#[doc = "The name of a title and infomation about its section"] -#[doc = ""] +#[doc = " The name of a title and infomation about its section"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct ExHeader_CodeSetInfo { - #[doc = "Title name"] - #[doc = ""] + #[doc = "< Title name"] pub name: [::libc::c_char; 8usize], - #[doc = "System info flags, see [`ExHeader_SystemInfoFlags`]"] - #[doc = ""] + #[doc = "< System info flags, see ExHeader_SystemInfoFlags"] pub flags: ExHeader_SystemInfoFlags, - #[doc = ".text section info, see [`ExHeader_CodeSectionInfo`]"] - #[doc = ""] + #[doc = "< .text section info, see ExHeader_CodeSectionInfo"] pub text: ExHeader_CodeSectionInfo, - #[doc = "Stack size"] - #[doc = ""] + #[doc = "< Stack size"] pub stack_size: u32_, - #[doc = ".rodata section info, see [`ExHeader_CodeSectionInfo`]"] - #[doc = ""] + #[doc = "< .rodata section info, see ExHeader_CodeSectionInfo"] pub rodata: ExHeader_CodeSectionInfo, - #[doc = "Reserved"] - #[doc = ""] + #[doc = "< Reserved"] pub reserved: u32_, - #[doc = ".data section info, see [`ExHeader_CodeSectionInfo`]"] - #[doc = ""] + #[doc = "< .data section info, see ExHeader_CodeSectionInfo"] pub data: ExHeader_CodeSectionInfo, - #[doc = ".bss section size"] - #[doc = ""] + #[doc = "< .bss section size"] pub bss_size: u32_, } -#[doc = "The savedata size and jump ID of a title"] -#[doc = ""] +#[doc = " The savedata size and jump ID of a title"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ExHeader_SystemInfo { - #[doc = "Savedata size"] - #[doc = ""] + #[doc = "< Savedata size"] pub savedata_size: u64_, - #[doc = "Jump ID"] - #[doc = ""] + #[doc = "< Jump ID"] pub jump_id: u64_, - #[doc = "Reserved"] - #[doc = ""] + #[doc = "< Reserved"] pub reserved: [u8_; 48usize], } impl Default for ExHeader_SystemInfo { @@ -3795,19 +3121,15 @@ impl Default for ExHeader_SystemInfo { } } } -#[doc = "The code set info, dependencies and system info of a title (SCI)"] -#[doc = ""] +#[doc = " The code set info, dependencies and system info of a title (SCI)"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ExHeader_SystemControlInfo { - #[doc = "Code set info, see [`ExHeader_CodeSetInfo`]"] - #[doc = ""] + #[doc = "< Code set info, see ExHeader_CodeSetInfo"] pub codeset_info: ExHeader_CodeSetInfo, - #[doc = "Title IDs of the titles that this program depends on"] - #[doc = ""] + #[doc = "< Title IDs of the titles that this program depends on"] pub dependencies: [u64_; 48usize], - #[doc = "System info, see [`ExHeader_SystemInfo`]"] - #[doc = ""] + #[doc = "< System info, see ExHeader_SystemInfo"] pub system_info: ExHeader_SystemInfo, } impl Default for ExHeader_SystemControlInfo { @@ -3819,22 +3141,17 @@ impl Default for ExHeader_SystemControlInfo { } } } -#[doc = "The ARM11 filesystem info of a title"] -#[doc = ""] +#[doc = " The ARM11 filesystem info of a title"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct ExHeader_Arm11StorageInfo { - #[doc = "Extdata ID"] - #[doc = ""] + #[doc = "< Extdata ID"] pub extdata_id: u64_, - #[doc = "IDs of the system savedata accessible by the title"] - #[doc = ""] + #[doc = "< IDs of the system savedata accessible by the title"] pub system_savedata_ids: [u32_; 2usize], - #[doc = "IDs of the savedata accessible by the title, 20 bits each, followed by \"Use other variation savedata\""] - #[doc = ""] + #[doc = "< IDs of the savedata accessible by the title, 20 bits each, followed by \"Use other variation savedata\""] pub accessible_savedata_ids: u64_, - #[doc = "FS access flags"] - #[doc = ""] + #[doc = "< FS access flags"] pub fs_access_info: u32_, pub _bitfield_align_1: [u32; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, @@ -3896,18 +3213,15 @@ impl ExHeader_Arm11StorageInfo { __bindgen_bitfield_unit } } -#[doc = "The CPU-related and memory-layout-related info of a title"] -#[doc = ""] +#[doc = " The CPU-related and memory-layout-related info of a title"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ExHeader_Arm11CoreInfo { - #[doc = "The low title ID of the target firmware"] - #[doc = ""] + #[doc = "< The low title ID of the target firmware"] pub core_version: u32_, pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 3usize]>, - #[doc = "The priority of the title's main thread"] - #[doc = ""] + #[doc = "< The priority of the title's main thread"] pub priority: u8_, } impl Default for ExHeader_Arm11CoreInfo { @@ -4056,31 +3370,23 @@ impl ExHeader_Arm11CoreInfo { __bindgen_bitfield_unit } } -#[doc = "The ARM11 system-local capabilities of a title"] -#[doc = ""] +#[doc = " The ARM11 system-local capabilities of a title"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ExHeader_Arm11SystemLocalCapabilities { - #[doc = "Title ID"] - #[doc = ""] + #[doc = "< Title ID"] pub title_id: u64_, - #[doc = "Core info, see [`ExHeader_Arm11CoreInfo`]"] - #[doc = ""] + #[doc = "< Core info, see ExHeader_Arm11CoreInfo"] pub core_info: ExHeader_Arm11CoreInfo, - #[doc = "Resource limit descriptors, only \"CpuTime\" (first byte) sems to be used"] - #[doc = ""] + #[doc = "< Resource limit descriptors, only \"CpuTime\" (first byte) sems to be used"] pub reslimits: [u16_; 16usize], - #[doc = "Storage info, see [`ExHeader_Arm11StorageInfo`]"] - #[doc = ""] + #[doc = "< Storage info, see ExHeader_Arm11StorageInfo"] pub storage_info: ExHeader_Arm11StorageInfo, - #[doc = "List of the services the title has access to. Limited to 32 prior to system version 9.3"] - #[doc = ""] + #[doc = "< List of the services the title has access to. Limited to 32 prior to system version 9.3"] pub service_access: [[::libc::c_char; 8usize]; 34usize], - #[doc = "Reserved"] - #[doc = ""] + #[doc = "< Reserved"] pub reserved: [u8_; 15usize], - #[doc = "Resource limit category, see [`ExHeader_Arm11SystemLocalCapabilities`]"] - #[doc = ""] + #[doc = "< Resource limit category, see ExHeader_Arm11SystemLocalCapabilities"] pub reslimit_category: ResourceLimitCategory, } impl Default for ExHeader_Arm11SystemLocalCapabilities { @@ -4092,43 +3398,33 @@ impl Default for ExHeader_Arm11SystemLocalCapabilities { } } } -#[doc = "The ARM11 kernel capabilities of a title"] -#[doc = ""] +#[doc = " The ARM11 kernel capabilities of a title"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct ExHeader_Arm11KernelCapabilities { - #[doc = "ARM11 kernel descriptors, see 3dbrew"] - #[doc = ""] + #[doc = "< ARM11 kernel descriptors, see 3dbrew"] pub descriptors: [u32_; 28usize], - #[doc = "Reserved"] - #[doc = ""] + #[doc = "< Reserved"] pub reserved: [u8_; 16usize], } -#[doc = "The ARM9 access control of a title"] -#[doc = ""] +#[doc = " The ARM9 access control of a title"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct ExHeader_Arm9AccessControl { - #[doc = "Process9 FS descriptors, see 3dbrew"] - #[doc = ""] + #[doc = "< Process9 FS descriptors, see 3dbrew"] pub descriptors: [u8_; 15usize], - #[doc = "Descriptor version"] - #[doc = ""] + #[doc = "< Descriptor version"] pub descriptor_version: u8_, } -#[doc = "The access control information of a title"] -#[doc = ""] +#[doc = " The access control information of a title"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ExHeader_AccessControlInfo { - #[doc = "ARM11 system-local capabilities, see [`ExHeader_Arm11SystemLocalCapabilities`]"] - #[doc = ""] + #[doc = "< ARM11 system-local capabilities, see ExHeader_Arm11SystemLocalCapabilities"] pub local_caps: ExHeader_Arm11SystemLocalCapabilities, - #[doc = "ARM11 kernel capabilities, see [`ExHeader_Arm11SystemLocalCapabilities`]"] - #[doc = ""] + #[doc = "< ARM11 kernel capabilities, see ExHeader_Arm11SystemLocalCapabilities"] pub kernel_caps: ExHeader_Arm11KernelCapabilities, - #[doc = "ARM9 access control, see [`ExHeader_Arm9AccessControl`]"] - #[doc = ""] + #[doc = "< ARM9 access control, see ExHeader_Arm9AccessControl"] pub access_control: ExHeader_Arm9AccessControl, } impl Default for ExHeader_AccessControlInfo { @@ -4140,16 +3436,13 @@ impl Default for ExHeader_AccessControlInfo { } } } -#[doc = "Main extended header data, as returned by PXIPM, Loader and FSREG service commands"] -#[doc = ""] +#[doc = " Main extended header data, as returned by PXIPM, Loader and FSREG service commands"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ExHeader_Info { - #[doc = "System control info, see [`ExHeader_SystemControlInfo`]"] - #[doc = ""] + #[doc = "< System control info, see ExHeader_SystemControlInfo"] pub sci: ExHeader_SystemControlInfo, - #[doc = "Access control info, see [`ExHeader_AccessControlInfo`]"] - #[doc = ""] + #[doc = "< Access control info, see ExHeader_AccessControlInfo"] pub aci: ExHeader_AccessControlInfo, } impl Default for ExHeader_Info { @@ -4161,19 +3454,15 @@ impl Default for ExHeader_Info { } } } -#[doc = "Extended header access descriptor"] -#[doc = ""] +#[doc = " Extended header access descriptor"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ExHeader_AccessDescriptor { - #[doc = "The signature of the access descriptor (RSA-2048-SHA256)"] - #[doc = ""] + #[doc = "< The signature of the access descriptor (RSA-2048-SHA256)"] pub signature: [u8_; 256usize], - #[doc = "The modulus used for the above signature, with 65537 as public exponent"] - #[doc = ""] + #[doc = "< The modulus used for the above signature, with 65537 as public exponent"] pub ncchModulus: [u8_; 256usize], - #[doc = "This is compared for equality with the first ACI by Process9, see [`ExHeader_AccessControlInfo`]"] - #[doc = ""] + #[doc = "< This is compared for equality with the first ACI by Process9, see ExHeader_AccessControlInfo"] pub acli: ExHeader_AccessControlInfo, } impl Default for ExHeader_AccessDescriptor { @@ -4185,16 +3474,13 @@ impl Default for ExHeader_AccessDescriptor { } } } -#[doc = "The NCCH Extended Header of a title"] -#[doc = ""] +#[doc = " The NCCH Extended Header of a title"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ExHeader { - #[doc = "Main extended header data, see [`ExHeader_Info`]"] - #[doc = ""] + #[doc = "< Main extended header data, see ExHeader_Info"] pub info: ExHeader_Info, - #[doc = "Access descriptor, see [`ExHeader_AccessDescriptor`]"] - #[doc = ""] + #[doc = "< Access descriptor, see ExHeader_AccessDescriptor"] pub access_descriptor: ExHeader_AccessDescriptor, } impl Default for ExHeader { @@ -4208,47 +3494,39 @@ impl Default for ExHeader { } extern "C" { #[must_use] - #[doc = "Initializes the service API."] - #[doc = ""] + #[doc = " Initializes the service API."] pub fn srvInit() -> Result; } extern "C" { - #[doc = "Exits the service API."] - #[doc = ""] + #[doc = " Exits the service API."] pub fn srvExit(); } extern "C" { - #[doc = "Makes srvGetServiceHandle non-blocking for the current thread (or blocking, the default), in case of unavailable (full) requested services.\n @param blocking Whether srvGetServiceHandle should be non-blocking.\n srvGetServiceHandle will always block if the service hasn't been registered yet,\n use srvIsServiceRegistered to check whether that is the case or not."] - #[doc = ""] + #[doc = " Makes srvGetServiceHandle non-blocking for the current thread (or blocking, the default), in case of unavailable (full) requested services.\n # Arguments\n\n* `blocking` - Whether srvGetServiceHandle should be non-blocking.\n srvGetServiceHandle will always block if the service hasn't been registered yet,\n use srvIsServiceRegistered to check whether that is the case or not."] pub fn srvSetBlockingPolicy(nonBlocking: bool); } extern "C" { - #[doc = "Gets the current service API session handle.\n @return The current service API session handle."] - #[doc = ""] + #[doc = " Gets the current service API session handle.\n # Returns\n\nThe current service API session handle."] pub fn srvGetSessionHandle() -> *mut Handle; } extern "C" { #[must_use] - #[doc = "Retrieves a service handle, retrieving from the environment handle list if possible.\n @param out Pointer to write the handle to.\n @param name Name of the service.\n @return 0 if no error occured,\n 0xD8E06406 if the caller has no right to access the service,\n 0xD0401834 if the requested service port is full and srvGetServiceHandle is non-blocking (see [`srvSetBlockingPolicy)`]"] - #[doc = ""] + #[doc = " Retrieves a service handle, retrieving from the environment handle list if possible.\n # Arguments\n\n* `out` - Pointer to write the handle to.\n * `name` - Name of the service.\n # Returns\n\n0 if no error occured,\n 0xD8E06406 if the caller has no right to access the service,\n 0xD0401834 if the requested service port is full and srvGetServiceHandle is non-blocking (see srvSetBlockingPolicy)."] pub fn srvGetServiceHandle(out: *mut Handle, name: *const ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = "Registers the current process as a client to the service API."] - #[doc = ""] + #[doc = " Registers the current process as a client to the service API."] pub fn srvRegisterClient() -> Result; } extern "C" { #[must_use] - #[doc = "Enables service notificatios, returning a notification semaphore.\n @param semaphoreOut Pointer to output the notification semaphore to."] - #[doc = ""] + #[doc = " Enables service notificatios, returning a notification semaphore.\n # Arguments\n\n* `semaphoreOut` - Pointer to output the notification semaphore to."] pub fn srvEnableNotification(semaphoreOut: *mut Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Registers the current process as a service.\n @param out Pointer to write the service handle to.\n @param name Name of the service.\n @param maxSessions Maximum number of sessions the service can handle."] - #[doc = ""] + #[doc = " Registers the current process as a service.\n # Arguments\n\n* `out` - Pointer to write the service handle to.\n * `name` - Name of the service.\n * `maxSessions` - Maximum number of sessions the service can handle."] pub fn srvRegisterService( out: *mut Handle, name: *const ::libc::c_char, @@ -4257,68 +3535,57 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Unregisters the current process as a service.\n @param name Name of the service."] - #[doc = ""] + #[doc = " Unregisters the current process as a service.\n # Arguments\n\n* `name` - Name of the service."] pub fn srvUnregisterService(name: *const ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = "Retrieves a service handle.\n @param out Pointer to output the handle to.\n @param name Name of the service.\n * @return 0 if no error occured,\n 0xD8E06406 if the caller has no right to access the service,\n 0xD0401834 if the requested service port is full and srvGetServiceHandle is non-blocking (see [`srvSetBlockingPolicy)`]"] - #[doc = ""] + #[doc = " Retrieves a service handle.\n # Arguments\n\n* `out` - Pointer to output the handle to.\n * `name` - Name of the service.\n * # Returns\n\n0 if no error occured,\n 0xD8E06406 if the caller has no right to access the service,\n 0xD0401834 if the requested service port is full and srvGetServiceHandle is non-blocking (see srvSetBlockingPolicy)."] pub fn srvGetServiceHandleDirect(out: *mut Handle, name: *const ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = "Registers a port.\n @param name Name of the port.\n @param clientHandle Client handle of the port."] - #[doc = ""] + #[doc = " Registers a port.\n # Arguments\n\n* `name` - Name of the port.\n * `clientHandle` - Client handle of the port."] pub fn srvRegisterPort(name: *const ::libc::c_char, clientHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Unregisters a port.\n @param name Name of the port."] - #[doc = ""] + #[doc = " Unregisters a port.\n # Arguments\n\n* `name` - Name of the port."] pub fn srvUnregisterPort(name: *const ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = "Retrieves a port handle.\n @param out Pointer to output the handle to.\n @param name Name of the port."] - #[doc = ""] + #[doc = " Retrieves a port handle.\n # Arguments\n\n* `out` - Pointer to output the handle to.\n * `name` - Name of the port."] pub fn srvGetPort(out: *mut Handle, name: *const ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = "Waits for a port to be registered.\n @param name Name of the port to wait for registration."] - #[doc = ""] + #[doc = " Waits for a port to be registered.\n # Arguments\n\n* `name` - Name of the port to wait for registration."] pub fn srvWaitForPortRegistered(name: *const ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = "Subscribes to a notification.\n @param notificationId ID of the notification."] - #[doc = ""] + #[doc = " Subscribes to a notification.\n # Arguments\n\n* `notificationId` - ID of the notification."] pub fn srvSubscribe(notificationId: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Unsubscribes from a notification.\n @param notificationId ID of the notification."] - #[doc = ""] + #[doc = " Unsubscribes from a notification.\n # Arguments\n\n* `notificationId` - ID of the notification."] pub fn srvUnsubscribe(notificationId: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Receives a notification.\n @param notificationIdOut Pointer to output the ID of the received notification to."] - #[doc = ""] + #[doc = " Receives a notification.\n # Arguments\n\n* `notificationIdOut` - Pointer to output the ID of the received notification to."] pub fn srvReceiveNotification(notificationIdOut: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Publishes a notification to subscribers.\n @param notificationId ID of the notification.\n @param flags Flags to publish with. (bit 0 = only fire if not fired, bit 1 = do not report an error if there are more than 16 pending notifications)"] - #[doc = ""] + #[doc = " Publishes a notification to subscribers.\n # Arguments\n\n* `notificationId` - ID of the notification.\n * `flags` - Flags to publish with. (bit 0 = only fire if not fired, bit 1 = do not report an error if there are more than 16 pending notifications)"] pub fn srvPublishToSubscriber(notificationId: u32_, flags: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Publishes a notification to subscribers and retrieves a list of all processes that were notified.\n @param processIdCountOut Pointer to output the number of process IDs to.\n @param processIdsOut Pointer to output the process IDs to. Should have size \"60 * sizeof(u32)\".\n @param notificationId ID of the notification."] - #[doc = ""] + #[doc = " Publishes a notification to subscribers and retrieves a list of all processes that were notified.\n # Arguments\n\n* `processIdCountOut` - Pointer to output the number of process IDs to.\n * `processIdsOut` - Pointer to output the process IDs to. Should have size \"60 * sizeof(u32)\".\n * `notificationId` - ID of the notification."] pub fn srvPublishAndGetSubscriber( processIdCountOut: *mut u32_, processIdsOut: *mut u32_, @@ -4327,76 +3594,47 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Checks whether a service is registered.\n @param registeredOut Pointer to output the registration status to.\n @param name Name of the service to check."] - #[doc = ""] + #[doc = " Checks whether a service is registered.\n # Arguments\n\n* `registeredOut` - Pointer to output the registration status to.\n * `name` - Name of the service to check."] pub fn srvIsServiceRegistered(registeredOut: *mut bool, name: *const ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = "Checks whether a port is registered.\n @param registeredOut Pointer to output the registration status to.\n @param name Name of the port to check."] - #[doc = ""] + #[doc = " Checks whether a port is registered.\n # Arguments\n\n* `registeredOut` - Pointer to output the registration status to.\n * `name` - Name of the port to check."] pub fn srvIsPortRegistered(registeredOut: *mut bool, name: *const ::libc::c_char) -> Result; } -#[doc = "Generic fatal error. Shows miscellaneous info, including the address of the caller"] -#[doc = ""] - +#[doc = "< For generic errors. Shows miscellaneous info."] pub const ERRF_ERRTYPE_GENERIC: ERRF_ErrType = 0; -#[doc = "Damaged NAND (CC_ERROR after reading CSR)"] -#[doc = ""] - -pub const ERRF_ERRTYPE_NAND_DAMAGED: ERRF_ErrType = 1; -#[doc = "Game content storage medium (cartridge and/or SD card) ejected. Not logged"] -#[doc = ""] - +#[doc = "< Same output as generic, but informs the user that \"the System Memory has been damaged\"."] +pub const ERRF_ERRTYPE_MEM_CORRUPT: ERRF_ErrType = 1; +#[doc = "< Displays the \"The Game Card was removed.\" message."] pub const ERRF_ERRTYPE_CARD_REMOVED: ERRF_ErrType = 2; -#[doc = "CPU or VFP exception"] -#[doc = ""] - +#[doc = "< For exceptions, or more specifically 'crashes'. union data should be exception_data."] pub const ERRF_ERRTYPE_EXCEPTION: ERRF_ErrType = 3; -#[doc = "Fatal error with a message instead of the caller's address"] -#[doc = ""] - +#[doc = "< For general failure. Shows a message. union data should have a string set in failure_mesg"] pub const ERRF_ERRTYPE_FAILURE: ERRF_ErrType = 4; -#[doc = "Log-level failure. Does not display the exception and does not force the system to reboot"] -#[doc = ""] - -pub const ERRF_ERRTYPE_LOG_ONLY: ERRF_ErrType = 5; -#[doc = "Types of errors that can be thrown by err:f."] -#[doc = ""] - +#[doc = "< Outputs logs to NAND in some cases."] +pub const ERRF_ERRTYPE_LOGGED: ERRF_ErrType = 5; +#[doc = " Types of errors that can be thrown by err:f."] pub type ERRF_ErrType = ::libc::c_uint; -#[doc = "Prefetch Abort"] -#[doc = ""] - +#[doc = "< Prefetch Abort"] pub const ERRF_EXCEPTION_PREFETCH_ABORT: ERRF_ExceptionType = 0; -#[doc = "Data abort"] -#[doc = ""] - +#[doc = "< Data abort"] pub const ERRF_EXCEPTION_DATA_ABORT: ERRF_ExceptionType = 1; -#[doc = "Undefined instruction"] -#[doc = ""] - +#[doc = "< Undefined instruction"] pub const ERRF_EXCEPTION_UNDEFINED: ERRF_ExceptionType = 2; -#[doc = "VFP (floating point) exception."] -#[doc = ""] - +#[doc = "< VFP (floating point) exception."] pub const ERRF_EXCEPTION_VFP: ERRF_ExceptionType = 3; -#[doc = "Types of 'Exceptions' thrown for ERRF_ERRTYPE_EXCEPTION"] -#[doc = ""] - +#[doc = " Types of 'Exceptions' thrown for ERRF_ERRTYPE_EXCEPTION"] pub type ERRF_ExceptionType = ::libc::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ERRF_ExceptionInfo { - #[doc = "Type of the exception. One of the ERRF_EXCEPTION_* values."] - #[doc = ""] + #[doc = "< Type of the exception. One of the ERRF_EXCEPTION_* values."] pub type_: ERRF_ExceptionType, pub reserved: [u8_; 3usize], - #[doc = "ifsr (prefetch abort) / dfsr (data abort)"] - #[doc = ""] + #[doc = "< ifsr (prefetch abort) / dfsr (data abort)"] pub fsr: u32_, - #[doc = "pc = ifar (prefetch abort) / dfar (data abort)"] - #[doc = ""] + #[doc = "< pc = ifar (prefetch abort) / dfar (data abort)"] pub far: u32_, pub fpexc: u32_, pub fpinst: u32_, @@ -4414,11 +3652,9 @@ impl Default for ERRF_ExceptionInfo { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ERRF_ExceptionData { - #[doc = "Exception info struct"] - #[doc = ""] + #[doc = "< Exception info struct"] pub excep: ERRF_ExceptionInfo, - #[doc = "CPU register dump."] - #[doc = ""] + #[doc = "< CPU register dump."] pub regs: CpuRegisters, } impl Default for ERRF_ExceptionData { @@ -4433,42 +3669,31 @@ impl Default for ERRF_ExceptionData { #[repr(C)] #[derive(Copy, Clone)] pub struct ERRF_FatalErrInfo { - #[doc = "Type, one of the ERRF_ERRTYPE_* enum"] - #[doc = ""] + #[doc = "< Type, one of the ERRF_ERRTYPE_* enum"] pub type_: ERRF_ErrType, - #[doc = "High revison ID"] - #[doc = ""] + #[doc = "< High revison ID"] pub revHigh: u8_, - #[doc = "Low revision ID"] - #[doc = ""] + #[doc = "< Low revision ID"] pub revLow: u16_, - #[doc = "Result code"] - #[doc = ""] + #[doc = "< Result code"] pub resCode: u32_, - #[doc = "PC address at exception"] - #[doc = ""] + #[doc = "< PC address at exception"] pub pcAddr: u32_, - #[doc = "Process ID of the caller"] - #[doc = ""] + #[doc = "< Process ID."] pub procId: u32_, - #[doc = "Title ID of the caller"] - #[doc = ""] + #[doc = "< Title ID."] pub titleId: u64_, - #[doc = "Title ID of the running application"] - #[doc = ""] + #[doc = "< Application Title ID."] pub appTitleId: u64_, - #[doc = "The different types of data for errors."] - #[doc = ""] + #[doc = "< The different types of data for errors."] pub data: ERRF_FatalErrInfo__bindgen_ty_1, } #[repr(C)] #[derive(Copy, Clone)] pub union ERRF_FatalErrInfo__bindgen_ty_1 { - #[doc = "Data for when type is ERRF_ERRTYPE_EXCEPTION"] - #[doc = ""] + #[doc = "< Data for when type is ERRF_ERRTYPE_EXCEPTION"] pub exception_data: ERRF_ExceptionData, - #[doc = "String for when type is ERRF_ERRTYPE_FAILURE"] - #[doc = ""] + #[doc = "< String for when type is ERRF_ERRTYPE_FAILURE"] pub failure_mesg: [::libc::c_char; 96usize], } impl Default for ERRF_FatalErrInfo__bindgen_ty_1 { @@ -4491,57 +3716,37 @@ impl Default for ERRF_FatalErrInfo { } extern "C" { #[must_use] - #[doc = "Initializes ERR:f. Unless you plan to call ERRF_Throw yourself, do not use this."] - #[doc = ""] + #[doc = " Initializes ERR:f. Unless you plan to call ERRF_Throw yourself, do not use this."] pub fn errfInit() -> Result; } extern "C" { - #[doc = "Exits ERR:f. Unless you plan to call ERRF_Throw yourself, do not use this."] - #[doc = ""] + #[doc = " Exits ERR:f. Unless you plan to call ERRF_Throw yourself, do not use this."] pub fn errfExit(); } extern "C" { - #[doc = "Gets the current err:f API session handle.\n @return The current err:f API session handle."] - #[doc = ""] + #[doc = " Gets the current err:f API session handle.\n # Returns\n\nThe current err:f API session handle."] pub fn errfGetSessionHandle() -> *mut Handle; } extern "C" { #[must_use] - #[doc = "Throws a system error and possibly logs it.\n @param[in] error Error to throw.\n\n ErrDisp may convert the error info to [`ERRF_ERRTYPE_NAND_DAMAGED`] or [`ERRF_ERRTYPE_CARD_REMOVED\n`] depending on the error code.\n\n Except with [`ERRF_ERRTYPE_LOG_ONLY`] the system will panic and will need to be rebooted.\n Fatal error information will also be logged into a file, unless the type either [`ERRF_ERRTYPE_NAND_DAMAGED\n`] or [`ERRF_ERRTYPE_CARD_REMOVED.\n\n`] No error will be shown if the system is asleep.\n\n On retail units with vanilla firmware, no detailed information will be displayed on screen.\n\n You may wish to use ERRF_ThrowResult() or ERRF_ThrowResultWithMessage() instead of\n constructing the ERRF_FatalErrInfo struct yourself."] - #[doc = ""] + #[doc = " Throws a system error and possibly results in ErrDisp triggering.\n # Arguments\n\n* `error` (direction in) - Error to throw.\n\n After performing this, the system may panic and need to be rebooted. Extra information will be displayed on the\n top screen with a developer console or the proper patches in a CFW applied.\n\n The error may not be shown and execution aborted until errfExit(void) is called.\n\n You may wish to use ERRF_ThrowResult() or ERRF_ThrowResultWithMessage() instead of\n constructing the ERRF_FatalErrInfo struct yourself."] pub fn ERRF_Throw(error: *const ERRF_FatalErrInfo) -> Result; } extern "C" { #[must_use] - #[doc = "Throws (and logs) a system error with the given Result code.\n @param[in] failure Result code to throw.\n\n This calls [`ERRF_Throw`] with error type [`ERRF_ERRTYPE_GENERIC`] and fills in the required data.\n\n This function *does* fill in the address where this function was called from."] - #[doc = ""] + #[doc = " Throws a system error with the given Result code.\n # Arguments\n\n* `failure` (direction in) - Result code to throw.\n\n This calls ERRF_Throw() with error type ERRF_ERRTYPE_GENERIC and fills in the required data.\n\n This function _does_ fill in the address where this function was called from.\n\n See https://3dbrew.org/wiki/ERR:Throw#Generic for expected top screen output\n on development units/patched ErrDisp."] pub fn ERRF_ThrowResult(failure: Result) -> Result; } extern "C" { #[must_use] - #[doc = "Logs a system error with the given Result code.\n @param[in] failure Result code to log.\n\n Similar to [`ERRF_Throw`] except that it does not display anything on the screen,\n nor does it force the system to reboot.\n\n This function *does* fill in the address where this function was called from."] - #[doc = ""] - pub fn ERRF_LogResult(failure: Result) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Throws a system error with the given Result code and message.\n @param[in] failure Result code to throw.\n @param[in] message The message to display.\n\n This calls [`ERRF_Throw`] with error type [`ERRF_ERRTYPE_FAILURE`] and fills in the required data.\n\n This function does *not* fill in the address where this function was called from because it\n would not be displayed."] - #[doc = ""] + #[doc = " Throws a system error with the given Result code and message.\n # Arguments\n\n* `failure` (direction in) - Result code to throw.\n * `message` (direction in) - The message to display.\n\n This calls ERRF_Throw() with error type ERRF_ERRTYPE_FAILURE and fills in the required data.\n\n This function does _not_ fill in the address where this function was called from because it\n would not be displayed.\n\n The message is only displayed on development units/patched ErrDisp.\n\n See https://3dbrew.org/wiki/ERR:Throw#Result_Failure for expected top screen output\n on development units/patched ErrDisp."] pub fn ERRF_ThrowResultWithMessage(failure: Result, message: *const ::libc::c_char) -> Result; } extern "C" { - #[must_use] - #[doc = "Specify an additional user string to use for error reporting.\n @param[in] user_string User string (up to 256 bytes, not including NUL byte)"] - #[doc = ""] - pub fn ERRF_SetUserString(user_string: *const ::libc::c_char) -> Result; -} -extern "C" { - #[doc = "Handles an exception using ErrDisp.\n @param excep Exception information\n @param regs CPU registers\n\n You might want to clear ENVINFO's bit0 to be able to see any debugging information.\n [`threadOnException`]"] - #[doc = ""] + #[doc = " Handles an exception using ErrDisp.\n # Arguments\n\n* `excep` - Exception information\n * `regs` - CPU registers\n\n You might want to clear ENVINFO's bit0 to be able to see any debugging information.\n [`threadOnException`]"] pub fn ERRF_ExceptionHandler(excep: *mut ERRF_ExceptionInfo, regs: *mut CpuRegisters) -> !; } -#[doc = "Kernel configuration page (read-only)."] -#[doc = ""] +#[doc = " Kernel configuration page (read-only)."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct osKernelConfig_s { @@ -4565,26 +3770,20 @@ pub struct osKernelConfig_s { pub firm_syscore_ver: u32_, pub firm_ctrsdk_ver: u32_, } -#[doc = "Time reference information struct (filled in by PTM)."] -#[doc = ""] +#[doc = " Time reference information struct (filled in by PTM)."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct osTimeRef_s { - #[doc = "Milliseconds elapsed since January 1900 when this structure was last updated"] - #[doc = ""] + #[doc = "< Milliseconds elapsed since January 1900 when this structure was last updated"] pub value_ms: u64_, - #[doc = "System ticks elapsed since boot when this structure was last updated"] - #[doc = ""] + #[doc = "< System ticks elapsed since boot when this structure was last updated"] pub value_tick: u64_, - #[doc = "System clock frequency in Hz adjusted using RTC measurements (usually around [`SYSCLOCK_ARM11)`]"] - #[doc = ""] + #[doc = "< System clock frequency in Hz adjusted using RTC measurements (usually around SYSCLOCK_ARM11)"] pub sysclock_hz: s64, - #[doc = "Measured time drift of the system clock (according to the RTC) in milliseconds since the last update"] - #[doc = ""] + #[doc = "< Measured time drift of the system clock (according to the RTC) in milliseconds since the last update"] pub drift_ms: s64, } -#[doc = "Shared system configuration page structure (read-only or read-write depending on exheader)."] -#[doc = ""] +#[doc = " Shared system configuration page structure (read-only or read-write depending on exheader)."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct osSharedConfig_s { @@ -4608,20 +3807,16 @@ pub struct osSharedConfig_s { pub unk_0xB0: [u8_; 16usize], pub headset_connected: vu8, } -#[doc = "Tick counter."] -#[doc = ""] +#[doc = " Tick counter."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct TickCounter { - #[doc = "Elapsed CPU ticks between measurements."] - #[doc = ""] + #[doc = "< Elapsed CPU ticks between measurements."] pub elapsed: u64_, - #[doc = "Point in time used as reference."] - #[doc = ""] + #[doc = "< Point in time used as reference."] pub reference: u64_, } -#[doc = "OS_VersionBin. Format of the system version: \"..-\""] -#[doc = ""] +#[doc = " OS_VersionBin. Format of the system version: \"..-\""] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct OS_VersionBin { @@ -4633,44 +3828,36 @@ pub struct OS_VersionBin { pub reserved_x5: [u8_; 3usize], } extern "C" { - #[doc = "Converts an address from virtual (process) memory to physical memory.\n @param vaddr Input virtual address.\n @return The corresponding physical address.\n It is sometimes required by services or when using the GPU command buffer."] - #[doc = ""] + #[doc = " Converts an address from virtual (process) memory to physical memory.\n # Arguments\n\n* `vaddr` - Input virtual address.\n # Returns\n\nThe corresponding physical address.\n It is sometimes required by services or when using the GPU command buffer."] pub fn osConvertVirtToPhys(vaddr: *const ::libc::c_void) -> u32_; } extern "C" { - #[doc = "Converts 0x14* vmem to 0x30*.\n @param vaddr Input virtual address.\n @return The corresponding address in the 0x30* range, the input address if it's already within the new vmem, or 0 if it's outside of both ranges."] - #[doc = ""] + #[doc = " Converts 0x14* vmem to 0x30*.\n # Arguments\n\n* `vaddr` - Input virtual address.\n # Returns\n\nThe corresponding address in the 0x30* range, the input address if it's already within the new vmem, or 0 if it's outside of both ranges."] pub fn osConvertOldLINEARMemToNew(vaddr: *const ::libc::c_void) -> *mut ::libc::c_void; } extern "C" { - #[doc = "Retrieves basic information about a service error.\n @param error Error to retrieve information about.\n @return A string containing a summary of an error.\n\n This can be used to get some details about an error returned by a service call."] - #[doc = ""] + #[doc = " Retrieves basic information about a service error.\n # Arguments\n\n* `error` - Error to retrieve information about.\n # Returns\n\nA string containing a summary of an error.\n\n This can be used to get some details about an error returned by a service call."] pub fn osStrError(error: Result) -> *const ::libc::c_char; } extern "C" { - #[doc = "Reads the latest reference timepoint published by PTM.\n @return Structure (see [`osTimeRef_s)`]"] - #[doc = ""] + #[doc = " Reads the latest reference timepoint published by PTM.\n # Returns\n\nStructure (see osTimeRef_s)."] pub fn osGetTimeRef() -> osTimeRef_s; } extern "C" { - #[doc = "Gets the current time.\n @return The number of milliseconds since 1st Jan 1900 00:00."] - #[doc = ""] + #[doc = " Gets the current time.\n # Returns\n\nThe number of milliseconds since 1st Jan 1900 00:00."] pub fn osGetTime() -> u64_; } extern "C" { - #[doc = "Reads the elapsed time in a tick counter.\n @param cnt The tick counter.\n @return The number of milliseconds elapsed."] - #[doc = ""] + #[doc = " Reads the elapsed time in a tick counter.\n # Arguments\n\n* `cnt` - The tick counter.\n # Returns\n\nThe number of milliseconds elapsed."] pub fn osTickCounterRead(cnt: *const TickCounter) -> f64; } extern "C" { - #[doc = "Configures the New 3DS speedup.\n @param enable Specifies whether to enable or disable the speedup."] - #[doc = ""] + #[doc = " Configures the New 3DS speedup.\n # Arguments\n\n* `enable` - Specifies whether to enable or disable the speedup."] pub fn osSetSpeedupEnable(enable: bool); } extern "C" { #[must_use] - #[doc = "Gets the NAND system-version stored in NVer/CVer.\n @param nver_versionbin Output OS_VersionBin structure for the data read from NVer.\n @param cver_versionbin Output OS_VersionBin structure for the data read from CVer.\n @return The result-code. This value can be positive if opening \"romfs:/version.bin\" fails with stdio, since errno would be returned in that case. In some cases the error can be special negative values as well."] - #[doc = ""] + #[doc = " Gets the NAND system-version stored in NVer/CVer.\n # Arguments\n\n* `nver_versionbin` - Output OS_VersionBin structure for the data read from NVer.\n * `cver_versionbin` - Output OS_VersionBin structure for the data read from CVer.\n # Returns\n\nThe result-code. This value can be positive if opening \"romfs:/version.bin\" fails with stdio, since errno would be returned in that case. In some cases the error can be special negative values as well."] pub fn osGetSystemVersionData( nver_versionbin: *mut OS_VersionBin, cver_versionbin: *mut OS_VersionBin, @@ -4678,8 +3865,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "This is a wrapper for osGetSystemVersionData.\n @param nver_versionbin Optional output OS_VersionBin structure for the data read from NVer, can be NULL.\n @param cver_versionbin Optional output OS_VersionBin structure for the data read from CVer, can be NULL.\n @param sysverstr Output string where the printed system-version will be written, in the same format displayed by the System Settings title.\n @param sysverstr_maxsize Max size of the above string buffer, *including* NULL-terminator.\n @return See osGetSystemVersionData."] - #[doc = ""] + #[doc = " This is a wrapper for osGetSystemVersionData.\n # Arguments\n\n* `nver_versionbin` - Optional output OS_VersionBin structure for the data read from NVer, can be NULL.\n * `cver_versionbin` - Optional output OS_VersionBin structure for the data read from CVer, can be NULL.\n * `sysverstr` - Output string where the printed system-version will be written, in the same format displayed by the System Settings title.\n * `sysverstr_maxsize` - Max size of the above string buffer, *including* NULL-terminator.\n # Returns\n\nSee osGetSystemVersionData."] pub fn osGetSystemVersionDataString( nver_versionbin: *mut OS_VersionBin, cver_versionbin: *mut OS_VersionBin, @@ -4726,55 +3912,40 @@ extern "C" { extern "C" { pub fn __libc_lock_try_acquire_recursive(lock: *mut _LOCK_RECURSIVE_T) -> ::libc::c_int; } -#[doc = "A light lock."] -#[doc = ""] - +#[doc = " A light lock."] pub type LightLock = _LOCK_T; -#[doc = "A recursive lock."] -#[doc = ""] - +#[doc = " A recursive lock."] pub type RecursiveLock = _LOCK_RECURSIVE_T; -#[doc = "A condition variable."] -#[doc = ""] - +#[doc = " A condition variable."] pub type CondVar = s32; -#[doc = "A light event."] -#[doc = ""] +#[doc = " A light event."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct LightEvent { - #[doc = "State of the event: -2=cleared sticky, -1=cleared oneshot, 0=signaled oneshot, 1=signaled sticky"] - #[doc = ""] + #[doc = "< State of the event: -2=cleared sticky, -1=cleared oneshot, 0=signaled oneshot, 1=signaled sticky"] pub state: s32, - #[doc = "Lock used for sticky timer operation"] - #[doc = ""] + #[doc = "< Lock used for sticky timer operation"] pub lock: LightLock, } -#[doc = "A light semaphore."] -#[doc = ""] +#[doc = " A light semaphore."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct LightSemaphore { - #[doc = "The current release count of the semaphore"] - #[doc = ""] + #[doc = "< The current release count of the semaphore"] pub current_count: s32, - #[doc = "Number of threads concurrently acquiring the semaphore"] - #[doc = ""] + #[doc = "< Number of threads concurrently acquiring the semaphore"] pub num_threads_acq: s16, - #[doc = "The maximum release count of the semaphore"] - #[doc = ""] + #[doc = "< The maximum release count of the semaphore"] pub max_count: s16, } extern "C" { #[must_use] - #[doc = "Function used to implement user-mode synchronization primitives.\n @param addr Pointer to a signed 32-bit value whose address will be used to identify waiting threads.\n @param type Type of action to be performed by the arbiter\n @param value Number of threads to signal if using [`ARBITRATION_SIGNAL`] or the value used for comparison.\n\n This will perform an arbitration based on #type. The comparisons are done between #value and the value at the address #addr.\n\n ``` s32 val=0;\n // Does *nothing* since val >= 0\n syncArbitrateAddress(&val,ARBITRATION_WAIT_IF_LESS_THAN,0);\n *@note* Usage of this function entails an implicit Data Memory Barrier (dmb)."] - #[doc = ""] + #[doc = " Function used to implement user-mode synchronization primitives.\n # Arguments\n\n* `addr` - Pointer to a signed 32-bit value whose address will be used to identify waiting threads.\n * `type` - Type of action to be performed by the arbiter\n * `value` - Number of threads to signal if using ARBITRATION_SIGNAL, or the value used for comparison.\n\n This will perform an arbitration based on #type. The comparisons are done between #value and the value at the address #addr.\n\n s32 val=0;\n // Does *nothing* since val >= 0\n syncArbitrateAddress(&val,ARBITRATION_WAIT_IF_LESS_THAN,0);\n > **Note:** Usage of this function entails an implicit Data Memory Barrier (dmb)."] pub fn syncArbitrateAddress(addr: *mut s32, type_: ArbitrationType, value: s32) -> Result; } extern "C" { #[must_use] - #[doc = "Function used to implement user-mode synchronization primitives (with timeout).\n @param addr Pointer to a signed 32-bit value whose address will be used to identify waiting threads.\n @param type Type of action to be performed by the arbiter (must use [`ARBITRATION_WAIT_IF_LESS_THAN_TIMEOUT`] or [`ARBITRATION_DECREMENT_AND_WAIT_IF_LESS_THAN_TIMEOUT)\n`] @param value Number of threads to signal if using [`ARBITRATION_SIGNAL`] or the value used for comparison.\n\n This will perform an arbitration based on #type. The comparisons are done between #value and the value at the address #addr.\n\n ``` s32 val=0;\n // Thread will wait for a signal or wake up after 10000000 nanoseconds because val < 1.\n syncArbitrateAddressWithTimeout(&val,ARBITRATION_WAIT_IF_LESS_THAN_TIMEOUT,1,10000000LL);\n *@note* Usage of this function entails an implicit Data Memory Barrier (dmb)."] - #[doc = ""] + #[doc = " Function used to implement user-mode synchronization primitives (with timeout).\n # Arguments\n\n* `addr` - Pointer to a signed 32-bit value whose address will be used to identify waiting threads.\n * `type` - Type of action to be performed by the arbiter (must use ARBITRATION_WAIT_IF_LESS_THAN_TIMEOUT or ARBITRATION_DECREMENT_AND_WAIT_IF_LESS_THAN_TIMEOUT)\n * `value` - Number of threads to signal if using ARBITRATION_SIGNAL, or the value used for comparison.\n\n This will perform an arbitration based on #type. The comparisons are done between #value and the value at the address #addr.\n\n s32 val=0;\n // Thread will wait for a signal or wake up after 10000000 nanoseconds because val < 1.\n syncArbitrateAddressWithTimeout(&val,ARBITRATION_WAIT_IF_LESS_THAN_TIMEOUT,1,10000000LL);\n > **Note:** Usage of this function entails an implicit Data Memory Barrier (dmb)."] pub fn syncArbitrateAddressWithTimeout( addr: *mut s32, type_: ArbitrationType, @@ -4783,58 +3954,47 @@ extern "C" { ) -> Result; } extern "C" { - #[doc = "Initializes a light lock.\n @param lock Pointer to the lock."] - #[doc = ""] + #[doc = " Initializes a light lock.\n # Arguments\n\n* `lock` - Pointer to the lock."] pub fn LightLock_Init(lock: *mut LightLock); } extern "C" { - #[doc = "Locks a light lock.\n @param lock Pointer to the lock."] - #[doc = ""] + #[doc = " Locks a light lock.\n # Arguments\n\n* `lock` - Pointer to the lock."] pub fn LightLock_Lock(lock: *mut LightLock); } extern "C" { - #[doc = "Attempts to lock a light lock.\n @param lock Pointer to the lock.\n @return Zero on success, non-zero on failure."] - #[doc = ""] + #[doc = " Attempts to lock a light lock.\n # Arguments\n\n* `lock` - Pointer to the lock.\n # Returns\n\nZero on success, non-zero on failure."] pub fn LightLock_TryLock(lock: *mut LightLock) -> ::libc::c_int; } extern "C" { - #[doc = "Unlocks a light lock.\n @param lock Pointer to the lock."] - #[doc = ""] + #[doc = " Unlocks a light lock.\n # Arguments\n\n* `lock` - Pointer to the lock."] pub fn LightLock_Unlock(lock: *mut LightLock); } extern "C" { - #[doc = "Initializes a recursive lock.\n @param lock Pointer to the lock."] - #[doc = ""] + #[doc = " Initializes a recursive lock.\n # Arguments\n\n* `lock` - Pointer to the lock."] pub fn RecursiveLock_Init(lock: *mut RecursiveLock); } extern "C" { - #[doc = "Locks a recursive lock.\n @param lock Pointer to the lock."] - #[doc = ""] + #[doc = " Locks a recursive lock.\n # Arguments\n\n* `lock` - Pointer to the lock."] pub fn RecursiveLock_Lock(lock: *mut RecursiveLock); } extern "C" { - #[doc = "Attempts to lock a recursive lock.\n @param lock Pointer to the lock.\n @return Zero on success, non-zero on failure."] - #[doc = ""] + #[doc = " Attempts to lock a recursive lock.\n # Arguments\n\n* `lock` - Pointer to the lock.\n # Returns\n\nZero on success, non-zero on failure."] pub fn RecursiveLock_TryLock(lock: *mut RecursiveLock) -> ::libc::c_int; } extern "C" { - #[doc = "Unlocks a recursive lock.\n @param lock Pointer to the lock."] - #[doc = ""] + #[doc = " Unlocks a recursive lock.\n # Arguments\n\n* `lock` - Pointer to the lock."] pub fn RecursiveLock_Unlock(lock: *mut RecursiveLock); } extern "C" { - #[doc = "Initializes a condition variable.\n @param cv Pointer to the condition variable."] - #[doc = ""] + #[doc = " Initializes a condition variable.\n # Arguments\n\n* `cv` - Pointer to the condition variable."] pub fn CondVar_Init(cv: *mut CondVar); } extern "C" { - #[doc = "Waits on a condition variable.\n @param cv Pointer to the condition variable.\n @param lock Pointer to the lock to atomically unlock/relock during the wait."] - #[doc = ""] + #[doc = " Waits on a condition variable.\n # Arguments\n\n* `cv` - Pointer to the condition variable.\n * `lock` - Pointer to the lock to atomically unlock/relock during the wait."] pub fn CondVar_Wait(cv: *mut CondVar, lock: *mut LightLock); } extern "C" { - #[doc = "Waits on a condition variable with a timeout.\n @param cv Pointer to the condition variable.\n @param lock Pointer to the lock to atomically unlock/relock during the wait.\n @param timeout_ns Timeout in nanoseconds.\n @return Zero on success, non-zero on failure."] - #[doc = ""] + #[doc = " Waits on a condition variable with a timeout.\n # Arguments\n\n* `cv` - Pointer to the condition variable.\n * `lock` - Pointer to the lock to atomically unlock/relock during the wait.\n * `timeout_ns` - Timeout in nanoseconds.\n # Returns\n\nZero on success, non-zero on failure."] pub fn CondVar_WaitTimeout( cv: *mut CondVar, lock: *mut LightLock, @@ -4842,63 +4002,51 @@ extern "C" { ) -> ::libc::c_int; } extern "C" { - #[doc = "Wakes up threads waiting on a condition variable.\n @param cv Pointer to the condition variable.\n @param num_threads Maximum number of threads to wake up (or [`ARBITRATION_SIGNAL_ALL`] to wake them all)."] - #[doc = ""] + #[doc = " Wakes up threads waiting on a condition variable.\n # Arguments\n\n* `cv` - Pointer to the condition variable.\n * `num_threads` - Maximum number of threads to wake up (or ARBITRATION_SIGNAL_ALL to wake them all)."] pub fn CondVar_WakeUp(cv: *mut CondVar, num_threads: s32); } extern "C" { - #[doc = "Initializes a light event.\n @param event Pointer to the event.\n @param reset_type Type of reset the event uses (RESET_ONESHOT/RESET_STICKY)."] - #[doc = ""] + #[doc = " Initializes a light event.\n # Arguments\n\n* `event` - Pointer to the event.\n * `reset_type` - Type of reset the event uses (RESET_ONESHOT/RESET_STICKY)."] pub fn LightEvent_Init(event: *mut LightEvent, reset_type: ResetType); } extern "C" { - #[doc = "Clears a light event.\n @param event Pointer to the event."] - #[doc = ""] + #[doc = " Clears a light event.\n # Arguments\n\n* `event` - Pointer to the event."] pub fn LightEvent_Clear(event: *mut LightEvent); } extern "C" { - #[doc = "Wakes up threads waiting on a sticky light event without signaling it. If the event had been signaled before, it is cleared instead.\n @param event Pointer to the event."] - #[doc = ""] + #[doc = " Wakes up threads waiting on a sticky light event without signaling it. If the event had been signaled before, it is cleared instead.\n # Arguments\n\n* `event` - Pointer to the event."] pub fn LightEvent_Pulse(event: *mut LightEvent); } extern "C" { - #[doc = "Signals a light event, waking up threads waiting on it.\n @param event Pointer to the event."] - #[doc = ""] + #[doc = " Signals a light event, waking up threads waiting on it.\n # Arguments\n\n* `event` - Pointer to the event."] pub fn LightEvent_Signal(event: *mut LightEvent); } extern "C" { - #[doc = "Attempts to wait on a light event.\n @param event Pointer to the event.\n @return Non-zero if the event was signaled, zero otherwise."] - #[doc = ""] + #[doc = " Attempts to wait on a light event.\n # Arguments\n\n* `event` - Pointer to the event.\n # Returns\n\nNon-zero if the event was signaled, zero otherwise."] pub fn LightEvent_TryWait(event: *mut LightEvent) -> ::libc::c_int; } extern "C" { - #[doc = "Waits on a light event.\n @param event Pointer to the event."] - #[doc = ""] + #[doc = " Waits on a light event.\n # Arguments\n\n* `event` - Pointer to the event."] pub fn LightEvent_Wait(event: *mut LightEvent); } extern "C" { - #[doc = "Waits on a light event until either the event is signaled or the timeout is reached.\n @param event Pointer to the event.\n @param timeout_ns Timeout in nanoseconds.\n @return Non-zero on timeout, zero otherwise."] - #[doc = ""] + #[doc = " Waits on a light event until either the event is signaled or the timeout is reached.\n # Arguments\n\n* `event` - Pointer to the event.\n * `timeout_ns` - Timeout in nanoseconds.\n # Returns\n\nNon-zero on timeout, zero otherwise."] pub fn LightEvent_WaitTimeout(event: *mut LightEvent, timeout_ns: s64) -> ::libc::c_int; } extern "C" { - #[doc = "Initializes a light semaphore.\n @param event Pointer to the semaphore.\n @param max_count Initial count of the semaphore.\n @param max_count Maximum count of the semaphore."] - #[doc = ""] + #[doc = " Initializes a light semaphore.\n # Arguments\n\n* `event` - Pointer to the semaphore.\n * `max_count` - Initial count of the semaphore.\n * `max_count` - Maximum count of the semaphore."] pub fn LightSemaphore_Init(semaphore: *mut LightSemaphore, initial_count: s16, max_count: s16); } extern "C" { - #[doc = "Acquires a light semaphore.\n @param semaphore Pointer to the semaphore.\n @param count Acquire count"] - #[doc = ""] + #[doc = " Acquires a light semaphore.\n # Arguments\n\n* `semaphore` - Pointer to the semaphore.\n * `count` - Acquire count"] pub fn LightSemaphore_Acquire(semaphore: *mut LightSemaphore, count: s32); } extern "C" { - #[doc = "Attempts to acquire a light semaphore.\n @param semaphore Pointer to the semaphore.\n @param count Acquire count\n @return Zero on success, non-zero on failure"] - #[doc = ""] + #[doc = " Attempts to acquire a light semaphore.\n # Arguments\n\n* `semaphore` - Pointer to the semaphore.\n * `count` - Acquire count\n # Returns\n\nZero on success, non-zero on failure"] pub fn LightSemaphore_TryAcquire(semaphore: *mut LightSemaphore, count: s32) -> ::libc::c_int; } extern "C" { - #[doc = "Releases a light semaphore.\n @param semaphore Pointer to the semaphore.\n @param count Release count"] - #[doc = ""] + #[doc = " Releases a light semaphore.\n # Arguments\n\n* `semaphore` - Pointer to the semaphore.\n * `count` - Release count"] pub fn LightSemaphore_Release(semaphore: *mut LightSemaphore, count: s32); } #[repr(C)] @@ -4906,19 +4054,14 @@ extern "C" { pub struct Thread_tag { _unused: [u8; 0], } -#[doc = "libctru thread handle type"] -#[doc = ""] - +#[doc = " libctru thread handle type"] pub type Thread = *mut Thread_tag; -#[doc = "Exception handler type, necessarily an ARM function that does not return."] -#[doc = ""] - +#[doc = " Exception handler type, necessarily an ARM function that does not return."] pub type ExceptionHandler = ::core::option::Option< unsafe extern "C" fn(excep: *mut ERRF_ExceptionInfo, regs: *mut CpuRegisters), >; extern "C" { - #[doc = "Creates a new libctru thread.\n @param entrypoint The function that will be called first upon thread creation\n @param arg The argument passed to @p entrypoint\n @param stack_size The size of the stack that will be allocated for the thread (will be rounded to a multiple of 8 bytes)\n @param prio Low values gives the thread higher priority.\n For userland apps, this has to be within the range [0x18;0x3F].\n The main thread usually has a priority of 0x30, but not always. Use svcGetThreadPriority() if you need\n to create a thread with a priority that is explicitly greater or smaller than that of the main thread.\n @param core_id The ID of the processor the thread should be ran on. Processor IDs are labeled starting from 0.\n On Old3DS it must be <2, and on New3DS it must be <4.\n Pass -1 to execute the thread on all CPUs and -2 to execute the thread on the default CPU (read from the Exheader).\n @param detached When set to true, the thread is automatically freed when it finishes.\n @return The libctru thread handle on success, NULL on failure.\n\n - Processor #0 is the application core. It is always possible to create a thread on this core.\n - Processor #1 is the system core. If APT_SetAppCpuTimeLimit is used, it is possible to create a single thread on this core.\n - Processor #2 is New3DS exclusive. Normal applications can create threads on this core if the exheader kernel flags bitmask has 0x2000 set.\n - Processor #3 is New3DS exclusive. Normal applications cannot create threads on this core.\n - Processes in the BASE memory region can always create threads on processors #2 and #3.\n\n @note Default exit code of a thread is 0.\n @warning [`svcExitThread`] should never be called from the thread, use [`threadExit`] instead."] - #[doc = ""] + #[doc = " Creates a new libctru thread.\n # Arguments\n\n* `entrypoint` - The function that will be called first upon thread creation\n * `arg` - The argument passed to `entrypoint`\n * `stack_size` - The size of the stack that will be allocated for the thread (will be rounded to a multiple of 8 bytes)\n * `prio` - Low values gives the thread higher priority.\n For userland apps, this has to be within the range [0x18;0x3F].\n The main thread usually has a priority of 0x30, but not always. Use svcGetThreadPriority() if you need\n to create a thread with a priority that is explicitly greater or smaller than that of the main thread.\n * `core_id` - The ID of the processor the thread should be ran on. Processor IDs are labeled starting from 0.\n On Old3DS it must be <2, and on New3DS it must be <4.\n Pass -1 to execute the thread on all CPUs and -2 to execute the thread on the default CPU (read from the Exheader).\n * `detached` - When set to true, the thread is automatically freed when it finishes.\n # Returns\n\nThe libctru thread handle on success, NULL on failure.\n\n - Processor #0 is the application core. It is always possible to create a thread on this core.\n - Processor #1 is the system core. If APT_SetAppCpuTimeLimit is used, it is possible to create a single thread on this core.\n - Processor #2 is New3DS exclusive. Normal applications can create threads on this core if the exheader kernel flags bitmask has 0x2000 set.\n - Processor #3 is New3DS exclusive. Normal applications cannot create threads on this core.\n - Processes in the BASE memory region can always create threads on processors #2 and #3.\n\n > **Note:** Default exit code of a thread is 0.\n svcExitThread should never be called from the thread, use threadExit instead."] pub fn threadCreate( entrypoint: ThreadFunc, arg: *mut ::libc::c_void, @@ -4929,66 +4072,51 @@ extern "C" { ) -> Thread; } extern "C" { - #[doc = "Retrieves the OS thread handle of a libctru thread.\n @param thread libctru thread handle\n @return OS thread handle"] - #[doc = ""] + #[doc = " Retrieves the OS thread handle of a libctru thread.\n # Arguments\n\n* `thread` - libctru thread handle\n # Returns\n\nOS thread handle"] pub fn threadGetHandle(thread: Thread) -> Handle; } extern "C" { - #[doc = "Retrieves the exit code of a finished libctru thread.\n @param thread libctru thread handle\n @return Exit code"] - #[doc = ""] + #[doc = " Retrieves the exit code of a finished libctru thread.\n # Arguments\n\n* `thread` - libctru thread handle\n # Returns\n\nExit code"] pub fn threadGetExitCode(thread: Thread) -> ::libc::c_int; } extern "C" { - #[doc = "Frees a finished libctru thread.\n @param thread libctru thread handle\n @remarks This function should not be called if the thread is detached, as it is freed automatically when it finishes."] - #[doc = ""] + #[doc = " Frees a finished libctru thread.\n # Arguments\n\n* `thread` - libctru thread handle\n > This function should not be called if the thread is detached, as it is freed automatically when it finishes."] pub fn threadFree(thread: Thread); } extern "C" { #[must_use] - #[doc = "Waits for a libctru thread to finish (or returns immediately if it is already finished).\n @param thread libctru thread handle\n @param timeout_ns Timeout in nanoseconds. Pass U64_MAX if a timeout isn't desired"] - #[doc = ""] + #[doc = " Waits for a libctru thread to finish (or returns immediately if it is already finished).\n # Arguments\n\n* `thread` - libctru thread handle\n * `timeout_ns` - Timeout in nanoseconds. Pass U64_MAX if a timeout isn't desired"] pub fn threadJoin(thread: Thread, timeout_ns: u64_) -> Result; } extern "C" { - #[doc = "Changes a thread's status from attached to detached.\n @param thread libctru thread handle"] - #[doc = ""] + #[doc = " Changes a thread's status from attached to detached.\n # Arguments\n\n* `thread` - libctru thread handle"] pub fn threadDetach(thread: Thread); } extern "C" { - #[doc = "Retrieves the libctru thread handle of the current thread.\n @return libctru thread handle of the current thread, or NULL for the main thread"] - #[doc = ""] + #[doc = " Retrieves the libctru thread handle of the current thread.\n # Returns\n\nlibctru thread handle of the current thread, or NULL for the main thread"] pub fn threadGetCurrent() -> Thread; } extern "C" { - #[doc = "Exits the current libctru thread with an exit code (not usable from the main thread).\n @param rc Exit code"] - #[doc = ""] + #[doc = " Exits the current libctru thread with an exit code (not usable from the main thread).\n # Arguments\n\n* `rc` - Exit code"] pub fn threadExit(rc: ::libc::c_int) -> !; } -#[doc = "Framebuffer information."] -#[doc = ""] +#[doc = " Framebuffer information."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct GSPGPU_FramebufferInfo { - #[doc = "Active framebuffer. (0 = first, 1 = second)"] - #[doc = ""] + #[doc = "< Active framebuffer. (0 = first, 1 = second)"] pub active_framebuf: u32_, - #[doc = "Framebuffer virtual address, for the main screen this is the 3D left framebuffer."] - #[doc = ""] + #[doc = "< Framebuffer virtual address, for the main screen this is the 3D left framebuffer."] pub framebuf0_vaddr: *mut u32_, - #[doc = "For the main screen: 3D right framebuffer address."] - #[doc = ""] + #[doc = "< For the main screen: 3D right framebuffer address."] pub framebuf1_vaddr: *mut u32_, - #[doc = "Value for 0x1EF00X90, controls framebuffer width."] - #[doc = ""] + #[doc = "< Value for 0x1EF00X90, controls framebuffer width."] pub framebuf_widthbytesize: u32_, - #[doc = "Framebuffer format, this u16 is written to the low u16 for LCD register 0x1EF00X70."] - #[doc = ""] + #[doc = "< Framebuffer format, this u16 is written to the low u16 for LCD register 0x1EF00X70."] pub format: u32_, - #[doc = "Value for 0x1EF00X78, controls which framebuffer is displayed."] - #[doc = ""] + #[doc = "< Value for 0x1EF00X78, controls which framebuffer is displayed."] pub framebuf_dispselect: u32_, - #[doc = "Unknown."] - #[doc = ""] + #[doc = "< Unknown."] pub unk: u32_, } impl Default for GSPGPU_FramebufferInfo { @@ -5000,46 +4128,29 @@ impl Default for GSPGPU_FramebufferInfo { } } } -#[doc = "RGBA8. (4 bytes)"] -#[doc = ""] - +#[doc = "< RGBA8. (4 bytes)"] pub const GSP_RGBA8_OES: GSPGPU_FramebufferFormat = 0; -#[doc = "BGR8. (3 bytes)"] -#[doc = ""] - +#[doc = "< BGR8. (3 bytes)"] pub const GSP_BGR8_OES: GSPGPU_FramebufferFormat = 1; -#[doc = "RGB565. (2 bytes)"] -#[doc = ""] - +#[doc = "< RGB565. (2 bytes)"] pub const GSP_RGB565_OES: GSPGPU_FramebufferFormat = 2; -#[doc = "RGB5A1. (2 bytes)"] -#[doc = ""] - +#[doc = "< RGB5A1. (2 bytes)"] pub const GSP_RGB5_A1_OES: GSPGPU_FramebufferFormat = 3; -#[doc = "RGBA4. (2 bytes)"] -#[doc = ""] - +#[doc = "< RGBA4. (2 bytes)"] pub const GSP_RGBA4_OES: GSPGPU_FramebufferFormat = 4; -#[doc = "Framebuffer format."] -#[doc = ""] - +#[doc = " Framebuffer format."] pub type GSPGPU_FramebufferFormat = ::libc::c_uint; -#[doc = "Capture info entry."] -#[doc = ""] +#[doc = " Capture info entry."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct GSPGPU_CaptureInfoEntry { - #[doc = "Left framebuffer."] - #[doc = ""] + #[doc = "< Left framebuffer."] pub framebuf0_vaddr: *mut u32_, - #[doc = "Right framebuffer."] - #[doc = ""] + #[doc = "< Right framebuffer."] pub framebuf1_vaddr: *mut u32_, - #[doc = "Framebuffer format."] - #[doc = ""] + #[doc = "< Framebuffer format."] pub format: u32_, - #[doc = "Framebuffer pitch."] - #[doc = ""] + #[doc = "< Framebuffer pitch."] pub framebuf_widthbytesize: u32_, } impl Default for GSPGPU_CaptureInfoEntry { @@ -5051,13 +4162,11 @@ impl Default for GSPGPU_CaptureInfoEntry { } } } -#[doc = "Capture info."] -#[doc = ""] +#[doc = " Capture info."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct GSPGPU_CaptureInfo { - #[doc = "Capture info entries, one for each screen."] - #[doc = ""] + #[doc = "< Capture info entries, one for each screen."] pub screencapture: [GSPGPU_CaptureInfoEntry; 2usize], } impl Default for GSPGPU_CaptureInfo { @@ -5069,66 +4178,43 @@ impl Default for GSPGPU_CaptureInfo { } } } -#[doc = "Memory fill completed."] -#[doc = ""] - +#[doc = "< Memory fill completed."] pub const GSPGPU_EVENT_PSC0: GSPGPU_Event = 0; -#[doc = "TODO"] -#[doc = ""] - +#[doc = "< TODO"] pub const GSPGPU_EVENT_PSC1: GSPGPU_Event = 1; -#[doc = "TODO"] -#[doc = ""] - +#[doc = "< TODO"] pub const GSPGPU_EVENT_VBlank0: GSPGPU_Event = 2; -#[doc = "TODO"] -#[doc = ""] - +#[doc = "< TODO"] pub const GSPGPU_EVENT_VBlank1: GSPGPU_Event = 3; -#[doc = "Display transfer finished."] -#[doc = ""] - +#[doc = "< Display transfer finished."] pub const GSPGPU_EVENT_PPF: GSPGPU_Event = 4; -#[doc = "Command list processing finished."] -#[doc = ""] - +#[doc = "< Command list processing finished."] pub const GSPGPU_EVENT_P3D: GSPGPU_Event = 5; -#[doc = "TODO"] -#[doc = ""] - +#[doc = "< TODO"] pub const GSPGPU_EVENT_DMA: GSPGPU_Event = 6; -#[doc = "Used to know how many events there are."] -#[doc = ""] - +#[doc = "< Used to know how many events there are."] pub const GSPGPU_EVENT_MAX: GSPGPU_Event = 7; -#[doc = "GSPGPU events."] -#[doc = ""] - +#[doc = " GSPGPU events."] pub type GSPGPU_Event = ::libc::c_uint; extern "C" { #[must_use] - #[doc = "Initializes GSPGPU."] - #[doc = ""] + #[doc = " Initializes GSPGPU."] pub fn gspInit() -> Result; } extern "C" { - #[doc = "Exits GSPGPU."] - #[doc = ""] + #[doc = " Exits GSPGPU."] pub fn gspExit(); } extern "C" { - #[doc = "Gets a pointer to the current gsp::Gpu session handle.\n @return A pointer to the current gsp::Gpu session handle."] - #[doc = ""] + #[doc = " Gets a pointer to the current gsp::Gpu session handle.\n # Returns\n\nA pointer to the current gsp::Gpu session handle."] pub fn gspGetSessionHandle() -> *mut Handle; } extern "C" { - #[doc = "Returns true if the application currently has GPU rights."] - #[doc = ""] + #[doc = " Returns true if the application currently has GPU rights."] pub fn gspHasGpuRight() -> bool; } extern "C" { - #[doc = "Presents a buffer to the specified screen.\n @param screen Screen ID (see [`GSP_SCREEN_TOP`] and [`GSP_SCREEN_BOTTOM)\n`] @param swap Specifies which set of framebuffer registers to configure and activate (0 or 1)\n @param fb_a Pointer to the framebuffer (in stereo mode: left eye)\n @param fb_b Pointer to the secondary framebuffer (only used in stereo mode for the right eye, otherwise pass the same as fb_a)\n @param stride Stride in bytes between scanlines\n @param mode Mode configuration to be written to LCD register\n @return true if a buffer had already been presented to the screen but not processed yet by GSP, false otherwise.\n @note The most recently presented buffer is processed and configured during the specified screen's next VBlank event."] - #[doc = ""] + #[doc = " Presents a buffer to the specified screen.\n # Arguments\n\n* `screen` - Screen ID (see GSP_SCREEN_TOP and GSP_SCREEN_BOTTOM)\n * `swap` - Specifies which set of framebuffer registers to configure and activate (0 or 1)\n * `fb_a` - Pointer to the framebuffer (in stereo mode: left eye)\n * `fb_b` - Pointer to the secondary framebuffer (only used in stereo mode for the right eye, otherwise pass the same as fb_a)\n * `stride` - Stride in bytes between scanlines\n * `mode` - Mode configuration to be written to LCD register\n # Returns\n\ntrue if a buffer had already been presented to the screen but not processed yet by GSP, false otherwise.\n > **Note:** The most recently presented buffer is processed and configured during the specified screen's next VBlank event."] pub fn gspPresentBuffer( screen: ::libc::c_uint, swap: ::libc::c_uint, @@ -5139,13 +4225,11 @@ extern "C" { ) -> bool; } extern "C" { - #[doc = "Returns true if a prior [`gspPresentBuffer`] command is still pending to be processed by GSP.\n @param screen Screen ID (see [`GSP_SCREEN_TOP`] and [`GSP_SCREEN_BOTTOM)`]"] - #[doc = ""] + #[doc = " Returns true if a prior gspPresentBuffer command is still pending to be processed by GSP.\n # Arguments\n\n* `screen` - Screen ID (see GSP_SCREEN_TOP and GSP_SCREEN_BOTTOM)"] pub fn gspIsPresentPending(screen: ::libc::c_uint) -> bool; } extern "C" { - #[doc = "Configures a callback to run when a GSPGPU event occurs.\n @param id ID of the event.\n @param cb Callback to run.\n @param data Data to be passed to the callback.\n @param oneShot When true, the callback is only executed once. When false, the callback is executed every time the event occurs."] - #[doc = ""] + #[doc = " Configures a callback to run when a GSPGPU event occurs.\n # Arguments\n\n* `id` - ID of the event.\n * `cb` - Callback to run.\n * `data` - Data to be passed to the callback.\n * `oneShot` - When true, the callback is only executed once. When false, the callback is executed every time the event occurs."] pub fn gspSetEventCallback( id: GSPGPU_Event, cb: ThreadFunc, @@ -5154,67 +4238,56 @@ extern "C" { ); } extern "C" { - #[doc = "Waits for a GSPGPU event to occur.\n @param id ID of the event.\n @param nextEvent Whether to discard the current event and wait for the next event."] - #[doc = ""] + #[doc = " Waits for a GSPGPU event to occur.\n # Arguments\n\n* `id` - ID of the event.\n * `nextEvent` - Whether to discard the current event and wait for the next event."] pub fn gspWaitForEvent(id: GSPGPU_Event, nextEvent: bool); } extern "C" { - #[doc = "Waits for any GSPGPU event to occur.\n @return The ID of the event that occurred.\n\n The function returns immediately if there are unprocessed events at the time of call."] - #[doc = ""] + #[doc = " Waits for any GSPGPU event to occur.\n # Returns\n\nThe ID of the event that occurred.\n\n The function returns immediately if there are unprocessed events at the time of call."] pub fn gspWaitForAnyEvent() -> GSPGPU_Event; } extern "C" { #[must_use] - #[doc = "Submits a GX command.\n @param gxCommand GX command to execute."] - #[doc = ""] + #[doc = " Submits a GX command.\n # Arguments\n\n* `gxCommand` - GX command to execute."] pub fn gspSubmitGxCommand(gxCommand: *const u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Acquires GPU rights.\n @param flags Flags to acquire with."] - #[doc = ""] + #[doc = " Acquires GPU rights.\n # Arguments\n\n* `flags` - Flags to acquire with."] pub fn GSPGPU_AcquireRight(flags: u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Releases GPU rights."] - #[doc = ""] + #[doc = " Releases GPU rights."] pub fn GSPGPU_ReleaseRight() -> Result; } extern "C" { #[must_use] - #[doc = "Retrieves display capture info.\n @param captureinfo Pointer to output capture info to."] - #[doc = ""] + #[doc = " Retrieves display capture info.\n # Arguments\n\n* `captureinfo` - Pointer to output capture info to."] pub fn GSPGPU_ImportDisplayCaptureInfo(captureinfo: *mut GSPGPU_CaptureInfo) -> Result; } extern "C" { #[must_use] - #[doc = "Saves the VRAM sys area."] - #[doc = ""] + #[doc = " Saves the VRAM sys area."] pub fn GSPGPU_SaveVramSysArea() -> Result; } extern "C" { #[must_use] - #[doc = "Resets the GPU"] - #[doc = ""] + #[doc = " Resets the GPU"] pub fn GSPGPU_ResetGpuCore() -> Result; } extern "C" { #[must_use] - #[doc = "Restores the VRAM sys area."] - #[doc = ""] + #[doc = " Restores the VRAM sys area."] pub fn GSPGPU_RestoreVramSysArea() -> Result; } extern "C" { #[must_use] - #[doc = "Sets whether to force the LCD to black.\n @param flags Whether to force the LCD to black. (0 = no, non-zero = yes)"] - #[doc = ""] + #[doc = " Sets whether to force the LCD to black.\n # Arguments\n\n* `flags` - Whether to force the LCD to black. (0 = no, non-zero = yes)"] pub fn GSPGPU_SetLcdForceBlack(flags: u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Updates a screen's framebuffer state.\n @param screenid ID of the screen to update.\n @param framebufinfo Framebuffer information to update with."] - #[doc = ""] + #[doc = " Updates a screen's framebuffer state.\n # Arguments\n\n* `screenid` - ID of the screen to update.\n * `framebufinfo` - Framebuffer information to update with."] pub fn GSPGPU_SetBufferSwap( screenid: u32_, framebufinfo: *const GSPGPU_FramebufferInfo, @@ -5222,26 +4295,22 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Flushes memory from the data cache.\n @param adr Address to flush.\n @param size Size of the memory to flush."] - #[doc = ""] + #[doc = " Flushes memory from the data cache.\n # Arguments\n\n* `adr` - Address to flush.\n * `size` - Size of the memory to flush."] pub fn GSPGPU_FlushDataCache(adr: *const ::libc::c_void, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Invalidates memory in the data cache.\n @param adr Address to invalidate.\n @param size Size of the memory to invalidate."] - #[doc = ""] + #[doc = " Invalidates memory in the data cache.\n # Arguments\n\n* `adr` - Address to invalidate.\n * `size` - Size of the memory to invalidate."] pub fn GSPGPU_InvalidateDataCache(adr: *const ::libc::c_void, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Writes to GPU hardware registers.\n @param regAddr Register address to write to.\n @param data Data to write.\n @param size Size of the data to write."] - #[doc = ""] + #[doc = " Writes to GPU hardware registers.\n # Arguments\n\n* `regAddr` - Register address to write to.\n * `data` - Data to write.\n * `size` - Size of the data to write."] pub fn GSPGPU_WriteHWRegs(regAddr: u32_, data: *const u32_, size: u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Writes to GPU hardware registers with a mask.\n @param regAddr Register address to write to.\n @param data Data to write.\n @param datasize Size of the data to write.\n @param maskdata Data of the mask.\n @param masksize Size of the mask."] - #[doc = ""] + #[doc = " Writes to GPU hardware registers with a mask.\n # Arguments\n\n* `regAddr` - Register address to write to.\n * `data` - Data to write.\n * `datasize` - Size of the data to write.\n * `maskdata` - Data of the mask.\n * `masksize` - Size of the mask."] pub fn GSPGPU_WriteHWRegsWithMask( regAddr: u32_, data: *const u32_, @@ -5252,14 +4321,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Reads from GPU hardware registers.\n @param regAddr Register address to read from.\n @param data Buffer to read data to.\n @param size Size of the buffer."] - #[doc = ""] + #[doc = " Reads from GPU hardware registers.\n # Arguments\n\n* `regAddr` - Register address to read from.\n * `data` - Buffer to read data to.\n * `size` - Size of the buffer."] pub fn GSPGPU_ReadHWRegs(regAddr: u32_, data: *mut u32_, size: u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Registers the interrupt relay queue.\n @param eventHandle Handle of the GX command event.\n @param flags Flags to register with.\n @param outMemHandle Pointer to output the shared memory handle to.\n @param threadID Pointer to output the GSP thread ID to."] - #[doc = ""] + #[doc = " Registers the interrupt relay queue.\n # Arguments\n\n* `eventHandle` - Handle of the GX command event.\n * `flags` - Flags to register with.\n * `outMemHandle` - Pointer to output the shared memory handle to.\n * `threadID` - Pointer to output the GSP thread ID to."] pub fn GSPGPU_RegisterInterruptRelayQueue( eventHandle: Handle, flags: u32_, @@ -5269,54 +4336,37 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Unregisters the interrupt relay queue."] - #[doc = ""] + #[doc = " Unregisters the interrupt relay queue."] pub fn GSPGPU_UnregisterInterruptRelayQueue() -> Result; } extern "C" { #[must_use] - #[doc = "Triggers a handling of commands written to shared memory."] - #[doc = ""] + #[doc = " Triggers a handling of commands written to shared memory."] pub fn GSPGPU_TriggerCmdReqQueue() -> Result; } extern "C" { #[must_use] - #[doc = "Sets 3D_LEDSTATE to the input state value.\n @param disable False = 3D LED enable, true = 3D LED disable."] - #[doc = ""] + #[doc = " Sets 3D_LEDSTATE to the input state value.\n # Arguments\n\n* `disable` - False = 3D LED enable, true = 3D LED disable."] pub fn GSPGPU_SetLedForceOff(disable: bool) -> Result; } -#[doc = "Top screen"] -#[doc = ""] - +#[doc = "< Top screen"] pub const GFX_TOP: gfxScreen_t = 0; -#[doc = "Bottom screen"] -#[doc = ""] - +#[doc = "< Bottom screen"] pub const GFX_BOTTOM: gfxScreen_t = 1; -#[doc = "Screen IDs."] -#[doc = ""] - +#[doc = " Screen IDs."] pub type gfxScreen_t = ::libc::c_uint; -#[doc = "Left eye framebuffer"] -#[doc = ""] - +#[doc = "< Left eye framebuffer"] pub const GFX_LEFT: gfx3dSide_t = 0; -#[doc = "Right eye framebuffer"] -#[doc = ""] - +#[doc = "< Right eye framebuffer"] pub const GFX_RIGHT: gfx3dSide_t = 1; -#[doc = "Top screen framebuffer side.\n\n This is only meaningful when stereoscopic 3D is enabled on the top screen.\n In any other case, use [`GFX_LEFT`]"] -#[doc = ""] - +#[doc = " Top screen framebuffer side.\n\n This is only meaningful when stereoscopic 3D is enabled on the top screen.\n In any other case, use GFX_LEFT."] pub type gfx3dSide_t = ::libc::c_uint; extern "C" { - #[doc = "Initializes the LCD framebuffers with default parameters\n This is equivalent to calling: ``` gfxInit(GSP_BGR8_OES,GSP_BGR8_OES,false);"] - #[doc = ""] + #[doc = " Initializes the LCD framebuffers with default parameters\n This is equivalent to calling: gfxInit(GSP_BGR8_OES,GSP_BGR8_OES,false); "] pub fn gfxInitDefault(); } extern "C" { - #[doc = "Initializes the LCD framebuffers.\n @param topFormat The format of the top screen framebuffers.\n @param bottomFormat The format of the bottom screen framebuffers.\n @param vramBuffers Whether to allocate the framebuffers in VRAM.\n\n This function allocates memory for the framebuffers in the specified memory region.\n Initially, stereoscopic 3D is disabled and double buffering is enabled.\n\n @note This function internally calls [`gspInit`]"] - #[doc = ""] + #[doc = " Initializes the LCD framebuffers.\n # Arguments\n\n* `topFormat` - The format of the top screen framebuffers.\n * `bottomFormat` - The format of the bottom screen framebuffers.\n * `vramBuffers` - Whether to allocate the framebuffers in VRAM.\n\n This function allocates memory for the framebuffers in the specified memory region.\n Initially, stereoscopic 3D is disabled and double buffering is enabled.\n\n > **Note:** This function internally calls gspInit."] pub fn gfxInit( topFormat: GSPGPU_FramebufferFormat, bottomFormat: GSPGPU_FramebufferFormat, @@ -5324,48 +4374,39 @@ extern "C" { ); } extern "C" { - #[doc = "Deinitializes and frees the LCD framebuffers.\n @note This function internally calls [`gspExit`]"] - #[doc = ""] + #[doc = " Deinitializes and frees the LCD framebuffers.\n > **Note:** This function internally calls gspExit."] pub fn gfxExit(); } extern "C" { - #[doc = "Enables or disables the 3D stereoscopic effect on the top screen.\n @param enable Pass true to enable, false to disable.\n @note Stereoscopic 3D is disabled by default."] - #[doc = ""] + #[doc = " Enables or disables the 3D stereoscopic effect on the top screen.\n # Arguments\n\n* `enable` - Pass true to enable, false to disable.\n > **Note:** Stereoscopic 3D is disabled by default."] pub fn gfxSet3D(enable: bool); } extern "C" { - #[doc = "Retrieves the status of the 3D stereoscopic effect on the top screen.\n @return true if 3D enabled, false otherwise."] - #[doc = ""] + #[doc = " Retrieves the status of the 3D stereoscopic effect on the top screen.\n # Returns\n\ntrue if 3D enabled, false otherwise."] pub fn gfxIs3D() -> bool; } extern "C" { - #[doc = "Retrieves the status of the 800px (double-height) high resolution display mode of the top screen.\n @return true if wide mode enabled, false otherwise."] - #[doc = ""] + #[doc = " Retrieves the status of the 800px (double-height) high resolution display mode of the top screen.\n # Returns\n\ntrue if wide mode enabled, false otherwise."] pub fn gfxIsWide() -> bool; } extern "C" { - #[doc = "Enables or disables the 800px (double-height) high resolution display mode of the top screen.\n @param enable Pass true to enable, false to disable.\n @note Wide mode is disabled by default.\n @note Wide and stereoscopic 3D modes are mutually exclusive.\n @note In wide mode pixels are not square, since scanlines are half as tall as they normally are.\n @warning Wide mode does not work on Old 2DS consoles (however it does work on New 2DS XL consoles)."] - #[doc = ""] + #[doc = " Enables or disables the 800px (double-height) high resolution display mode of the top screen.\n # Arguments\n\n* `enable` - Pass true to enable, false to disable.\n > **Note:** Wide mode is disabled by default.\n > **Note:** Wide and stereoscopic 3D modes are mutually exclusive.\n > **Note:** In wide mode pixels are not square, since scanlines are half as tall as they normally are.\n Wide mode does not work on Old 2DS consoles (however it does work on New 2DS XL consoles)."] pub fn gfxSetWide(enable: bool); } extern "C" { - #[doc = "Changes the pixel format of a screen.\n @param screen Screen ID (see [`gfxScreen_t)\n`] @param format Pixel format (see [`GSPGPU_FramebufferFormat)\n`] @note If the currently allocated framebuffers are too small for the specified format,\n they are freed and new ones are reallocated."] - #[doc = ""] + #[doc = " Changes the pixel format of a screen.\n # Arguments\n\n* `screen` - Screen ID (see gfxScreen_t)\n * `format` - Pixel format (see GSPGPU_FramebufferFormat)\n > **Note:** If the currently allocated framebuffers are too small for the specified format,\n they are freed and new ones are reallocated."] pub fn gfxSetScreenFormat(screen: gfxScreen_t, format: GSPGPU_FramebufferFormat); } extern "C" { - #[doc = "Retrieves the current pixel format of a screen.\n @param screen Screen ID (see [`gfxScreen_t)\n`] @return Pixel format (see [`GSPGPU_FramebufferFormat)`]"] - #[doc = ""] + #[doc = " Retrieves the current pixel format of a screen.\n # Arguments\n\n* `screen` - Screen ID (see gfxScreen_t)\n # Returns\n\nPixel format (see GSPGPU_FramebufferFormat)"] pub fn gfxGetScreenFormat(screen: gfxScreen_t) -> GSPGPU_FramebufferFormat; } extern "C" { - #[doc = "Enables or disables double buffering on a screen.\n @param screen Screen ID (see [`gfxScreen_t)\n`] @param enable Pass true to enable, false to disable.\n @note Double buffering is enabled by default."] - #[doc = ""] + #[doc = " Enables or disables double buffering on a screen.\n # Arguments\n\n* `screen` - Screen ID (see gfxScreen_t)\n * `enable` - Pass true to enable, false to disable.\n > **Note:** Double buffering is enabled by default."] pub fn gfxSetDoubleBuffering(screen: gfxScreen_t, enable: bool); } extern "C" { - #[doc = "Retrieves the framebuffer of the specified screen to which graphics should be rendered.\n @param screen Screen ID (see [`gfxScreen_t)\n`] @param side Framebuffer side (see [`gfx3dSide_t)`] (pass [`GFX_LEFT`] if not using stereoscopic 3D)\n @param width Pointer that will hold the width of the framebuffer in pixels.\n @param height Pointer that will hold the height of the framebuffer in pixels.\n @return A pointer to the current framebuffer of the chosen screen.\n\n Please remember that the returned pointer will change every frame if double buffering is enabled."] - #[doc = ""] + #[doc = " Retrieves the framebuffer of the specified screen to which graphics should be rendered.\n # Arguments\n\n* `screen` - Screen ID (see gfxScreen_t)\n * `side` - Framebuffer side (see gfx3dSide_t) (pass GFX_LEFT if not using stereoscopic 3D)\n * `width` - Pointer that will hold the width of the framebuffer in pixels.\n * `height` - Pointer that will hold the height of the framebuffer in pixels.\n # Returns\n\nA pointer to the current framebuffer of the chosen screen.\n\n Please remember that the returned pointer will change every frame if double buffering is enabled."] pub fn gfxGetFramebuffer( screen: gfxScreen_t, side: gfx3dSide_t, @@ -5374,49 +4415,38 @@ extern "C" { ) -> *mut u8_; } extern "C" { - #[doc = "Flushes the data cache for the current framebuffers.\n @warning This is **only used during software rendering**. Since this function has significant overhead,\n it is preferred to call this only once per frame, after all software rendering is completed."] - #[doc = ""] + #[doc = " Flushes the data cache for the current framebuffers.\n This is **only used during software rendering**. Since this function has significant overhead,\n it is preferred to call this only once per frame, after all software rendering is completed."] pub fn gfxFlushBuffers(); } extern "C" { - #[doc = "Updates the configuration of the specified screen, swapping the buffers if double buffering is enabled.\n @param scr Screen ID (see [`gfxScreen_t)\n`] @param hasStereo For the top screen in 3D mode: true if the framebuffer contains individual images\n for both eyes, or false if the left image should be duplicated to the right eye.\n @note Previously rendered content will be displayed on the screen after the next VBlank.\n @note This function is still useful even if double buffering is disabled, as it must be used to commit configuration changes.\n @warning Only call this once per screen per frame, otherwise graphical glitches will occur\n since this API does not implement triple buffering."] - #[doc = ""] + #[doc = " Updates the configuration of the specified screen, swapping the buffers if double buffering is enabled.\n # Arguments\n\n* `scr` - Screen ID (see gfxScreen_t)\n * `hasStereo` - For the top screen in 3D mode: true if the framebuffer contains individual images\n for both eyes, or false if the left image should be duplicated to the right eye.\n > **Note:** Previously rendered content will be displayed on the screen after the next VBlank.\n > **Note:** This function is still useful even if double buffering is disabled, as it must be used to commit configuration changes.\n Only call this once per screen per frame, otherwise graphical glitches will occur\n since this API does not implement triple buffering."] pub fn gfxScreenSwapBuffers(scr: gfxScreen_t, hasStereo: bool); } extern "C" { - #[doc = "Same as [`gfxScreenSwapBuffers`] but with hasStereo set to true.\n @param scr Screen ID (see [`gfxScreen_t)\n`] @param immediate This parameter no longer has any effect and is thus ignored.\n @deprecated This function has been superseded by [`gfxScreenSwapBuffers`] please use that instead."] - #[doc = ""] + #[doc = " Same as gfxScreenSwapBuffers, but with hasStereo set to true.\n # Arguments\n\n* `scr` - Screen ID (see gfxScreen_t)\n * `immediate` - This parameter no longer has any effect and is thus ignored.\n > **Deprecated** This function has been superseded by gfxScreenSwapBuffers, please use that instead."] pub fn gfxConfigScreen(scr: gfxScreen_t, immediate: bool); } extern "C" { - #[doc = "Updates the configuration of both screens.\n @note This function is equivalent to: ``` gfxScreenSwapBuffers(GFX_TOP,true); gfxScreenSwapBuffers(GFX_BOTTOM,true);"] - #[doc = ""] + #[doc = " Updates the configuration of both screens.\n > **Note:** This function is equivalent to: gfxScreenSwapBuffers(GFX_TOP,true); gfxScreenSwapBuffers(GFX_BOTTOM,true); "] pub fn gfxSwapBuffers(); } extern "C" { - #[doc = "Same as [`gfxSwapBuffers`] (formerly different)."] - #[doc = ""] + #[doc = " Same as gfxSwapBuffers (formerly different)."] pub fn gfxSwapBuffersGpu(); } -#[doc = "A callback for printing a character."] -#[doc = ""] - +#[doc = " A callback for printing a character."] pub type ConsolePrint = ::core::option::Option< unsafe extern "C" fn(con: *mut ::libc::c_void, c: ::libc::c_int) -> bool, >; -#[doc = "A font struct for the console."] -#[doc = ""] +#[doc = " A font struct for the console."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ConsoleFont { - #[doc = "A pointer to the font graphics"] - #[doc = ""] + #[doc = "< A pointer to the font graphics"] pub gfx: *mut u8_, - #[doc = "Offset to the first valid character in the font table"] - #[doc = ""] + #[doc = "< Offset to the first valid character in the font table"] pub asciiOffset: u16_, - #[doc = "Number of characters in the font graphics"] - #[doc = ""] + #[doc = "< Number of characters in the font graphics"] pub numChars: u16_, } impl Default for ConsoleFont { @@ -5428,64 +4458,45 @@ impl Default for ConsoleFont { } } } -#[doc = "Console structure used to store the state of a console render context.\n\n Default values from consoleGetDefault();\n ``` PrintConsole defaultConsole =\n {\n \t//Font:\n \t{\n \t\t(u8*)default_font_bin, //font gfx\n \t\t0, //first ascii character in the set\n \t\t128, //number of characters in the font set\n\t},\n\t0,0, //cursorX cursorY\n\t0,0, //prevcursorX prevcursorY\n\t40, //console width\n\t30, //console height\n\t0, //window x\n\t0, //window y\n\t32, //window width\n\t24, //window height\n\t3, //tab size\n\t0, //font character offset\n\t0, //print callback\n\tfalse //console initialized\n };\n"] -#[doc = ""] +#[doc = " Console structure used to store the state of a console render context.\n\n Default values from consoleGetDefault();\n PrintConsole defaultConsole =\n \n \t//Font:\n \t\n \t\t(u8*)default_font_bin, //font gfx\n \t\t0, //first ascii character in the set\n \t\t128, //number of characters in the font set\n\t,\n\t0,0, //cursorX cursorY\n\t0,0, //prevcursorX prevcursorY\n\t40, //console width\n\t30, //console height\n\t0, //window x\n\t0, //window y\n\t32, //window width\n\t24, //window height\n\t3, //tab size\n\t0, //font character offset\n\t0, //print callback\n\tfalse //console initialized\n ;\n "] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct PrintConsole { - #[doc = "Font of the console"] - #[doc = ""] + #[doc = "< Font of the console"] pub font: ConsoleFont, - #[doc = "Framebuffer address"] - #[doc = ""] + #[doc = "< Framebuffer address"] pub frameBuffer: *mut u16_, - #[doc = "Current X location of the cursor (as a tile offset by default)"] - #[doc = ""] + #[doc = "< Current X location of the cursor (as a tile offset by default)"] pub cursorX: ::libc::c_int, - #[doc = "Current Y location of the cursor (as a tile offset by default)"] - #[doc = ""] + #[doc = "< Current Y location of the cursor (as a tile offset by default)"] pub cursorY: ::libc::c_int, - #[doc = "Internal state"] - #[doc = ""] + #[doc = "< Internal state"] pub prevCursorX: ::libc::c_int, - #[doc = "Internal state"] - #[doc = ""] + #[doc = "< Internal state"] pub prevCursorY: ::libc::c_int, - #[doc = "Width of the console hardware layer in characters"] - #[doc = ""] + #[doc = "< Width of the console hardware layer in characters"] pub consoleWidth: ::libc::c_int, - #[doc = "Height of the console hardware layer in characters"] - #[doc = ""] + #[doc = "< Height of the console hardware layer in characters"] pub consoleHeight: ::libc::c_int, - #[doc = "Window X location in characters (not implemented)"] - #[doc = ""] + #[doc = "< Window X location in characters (not implemented)"] pub windowX: ::libc::c_int, - #[doc = "Window Y location in characters (not implemented)"] - #[doc = ""] + #[doc = "< Window Y location in characters (not implemented)"] pub windowY: ::libc::c_int, - #[doc = "Window width in characters (not implemented)"] - #[doc = ""] + #[doc = "< Window width in characters (not implemented)"] pub windowWidth: ::libc::c_int, - #[doc = "Window height in characters (not implemented)"] - #[doc = ""] + #[doc = "< Window height in characters (not implemented)"] pub windowHeight: ::libc::c_int, - #[doc = "Size of a tab"] - #[doc = ""] + #[doc = "< Size of a tab"] pub tabSize: ::libc::c_int, - #[doc = "Foreground color"] - #[doc = ""] + #[doc = "< Foreground color"] pub fg: u16_, - #[doc = "Background color"] - #[doc = ""] + #[doc = "< Background color"] pub bg: u16_, - #[doc = "Reverse/bright flags"] - #[doc = ""] + #[doc = "< Reverse/bright flags"] pub flags: ::libc::c_int, - #[doc = "Callback for printing a character. Should return true if it has handled rendering the graphics (else the print engine will attempt to render via tiles)."] - #[doc = ""] + #[doc = "< Callback for printing a character. Should return true if it has handled rendering the graphics (else the print engine will attempt to render via tiles)."] pub PrintChar: ConsolePrint, - #[doc = "True if the console is initialized"] - #[doc = ""] + #[doc = "< True if the console is initialized"] pub consoleInitialised: bool, } impl Default for PrintConsole { @@ -5497,31 +4508,21 @@ impl Default for PrintConsole { } } } -#[doc = "Swallows prints to stderr"] -#[doc = ""] - +#[doc = "< Swallows prints to stderr"] pub const debugDevice_NULL: debugDevice = 0; -#[doc = "Outputs stderr debug statements using svcOutputDebugString, which can then be captured by interactive debuggers"] -#[doc = ""] - +#[doc = "< Outputs stderr debug statements using svcOutputDebugString, which can then be captured by interactive debuggers"] pub const debugDevice_SVC: debugDevice = 1; -#[doc = "Directs stderr debug statements to 3DS console window"] -#[doc = ""] - +#[doc = "< Directs stderr debug statements to 3DS console window"] pub const debugDevice_CONSOLE: debugDevice = 2; pub const debugDevice_3DMOO: debugDevice = 1; -#[doc = "Console debug devices supported by libnds."] -#[doc = ""] - +#[doc = " Console debug devices supported by libnds."] pub type debugDevice = ::libc::c_uint; extern "C" { - #[doc = "Loads the font into the console.\n @param console Pointer to the console to update, if NULL it will update the current console.\n @param font The font to load."] - #[doc = ""] + #[doc = " Loads the font into the console.\n # Arguments\n\n* `console` - Pointer to the console to update, if NULL it will update the current console.\n * `font` - The font to load."] pub fn consoleSetFont(console: *mut PrintConsole, font: *mut ConsoleFont); } extern "C" { - #[doc = "Sets the print window.\n @param console Console to set, if NULL it will set the current console window.\n @param x X location of the window.\n @param y Y location of the window.\n @param width Width of the window.\n @param height Height of the window."] - #[doc = ""] + #[doc = " Sets the print window.\n # Arguments\n\n* `console` - Console to set, if NULL it will set the current console window.\n * `x` - X location of the window.\n * `y` - Y location of the window.\n * `width` - Width of the window.\n * `height` - Height of the window."] pub fn consoleSetWindow( console: *mut PrintConsole, x: ::libc::c_int, @@ -5531,49 +4532,35 @@ extern "C" { ); } extern "C" { - #[doc = "Gets a pointer to the console with the default values.\n This should only be used when using a single console or without changing the console that is returned, otherwise use consoleInit().\n @return A pointer to the console with the default values."] - #[doc = ""] + #[doc = " Gets a pointer to the console with the default values.\n This should only be used when using a single console or without changing the console that is returned, otherwise use consoleInit().\n # Returns\n\nA pointer to the console with the default values."] pub fn consoleGetDefault() -> *mut PrintConsole; } extern "C" { - #[doc = "Make the specified console the render target.\n @param console A pointer to the console struct (must have been initialized with consoleInit(PrintConsole* console)).\n @return A pointer to the previous console."] - #[doc = ""] + #[doc = " Make the specified console the render target.\n # Arguments\n\n* `console` - A pointer to the console struct (must have been initialized with consoleInit(PrintConsole* console)).\n # Returns\n\nA pointer to the previous console."] pub fn consoleSelect(console: *mut PrintConsole) -> *mut PrintConsole; } extern "C" { - #[doc = "Initialise the console.\n @param screen The screen to use for the console.\n @param console A pointer to the console data to initialize (if it's NULL, the default console will be used).\n @return A pointer to the current console."] - #[doc = ""] + #[doc = " Initialise the console.\n # Arguments\n\n* `screen` - The screen to use for the console.\n * `console` - A pointer to the console data to initialize (if it's NULL, the default console will be used).\n # Returns\n\nA pointer to the current console."] pub fn consoleInit(screen: gfxScreen_t, console: *mut PrintConsole) -> *mut PrintConsole; } extern "C" { - #[doc = "Initializes debug console output on stderr to the specified device.\n @param device The debug device (or devices) to output debug print statements to."] - #[doc = ""] + #[doc = " Initializes debug console output on stderr to the specified device.\n # Arguments\n\n* `device` - The debug device (or devices) to output debug print statements to."] pub fn consoleDebugInit(device: debugDevice); } extern "C" { - #[doc = "Clears the screen by using iprintf(\"\\x1b[2J\");"] - #[doc = ""] + #[doc = " Clears the screen by using iprintf(\""] pub fn consoleClear(); } -#[doc = "Use APT workaround."] -#[doc = ""] - +#[doc = "< Use APT workaround."] pub const RUNFLAG_APTWORKAROUND: _bindgen_ty_9 = 1; -#[doc = "Reinitialize APT."] -#[doc = ""] - +#[doc = "< Reinitialize APT."] pub const RUNFLAG_APTREINIT: _bindgen_ty_9 = 2; -#[doc = "Chainload APT on return."] -#[doc = ""] - +#[doc = "< Chainload APT on return."] pub const RUNFLAG_APTCHAINLOAD: _bindgen_ty_9 = 4; -#[doc = "System run-flags."] -#[doc = ""] - +#[doc = " System run-flags."] pub type _bindgen_ty_9 = ::libc::c_uint; extern "C" { - #[doc = "Retrieves a handle from the environment handle list.\n @param name Name of the handle.\n @return The retrieved handle."] - #[doc = ""] + #[doc = " Retrieves a handle from the environment handle list.\n # Arguments\n\n* `name` - Name of the handle.\n # Returns\n\nThe retrieved handle."] pub fn envGetHandle(name: *const ::libc::c_char) -> Handle; } pub type _off_t = __int64_t; @@ -5770,76 +4757,43 @@ pub struct pthread_once_t { pub is_initialized: ::libc::c_int, pub init_executed: ::libc::c_int, } -#[doc = "Dummy compression"] -#[doc = ""] - +#[doc = "< Dummy compression"] pub const DECOMPRESS_DUMMY: decompressType = 0; -#[doc = "LZSS/LZ10 compression"] -#[doc = ""] - +#[doc = "< LZSS/LZ10 compression"] pub const DECOMPRESS_LZSS: decompressType = 16; -#[doc = "LZSS/LZ10 compression"] -#[doc = ""] - +#[doc = "< LZSS/LZ10 compression"] pub const DECOMPRESS_LZ10: decompressType = 16; -#[doc = "LZ11 compression"] -#[doc = ""] - +#[doc = "< LZ11 compression"] pub const DECOMPRESS_LZ11: decompressType = 17; -#[doc = "Huffman compression with 1-bit data"] -#[doc = ""] - +#[doc = "< Huffman compression with 1-bit data"] pub const DECOMPRESS_HUFF1: decompressType = 33; -#[doc = "Huffman compression with 2-bit data"] -#[doc = ""] - +#[doc = "< Huffman compression with 2-bit data"] pub const DECOMPRESS_HUFF2: decompressType = 34; -#[doc = "Huffman compression with 3-bit data"] -#[doc = ""] - +#[doc = "< Huffman compression with 3-bit data"] pub const DECOMPRESS_HUFF3: decompressType = 35; -#[doc = "Huffman compression with 4-bit data"] -#[doc = ""] - +#[doc = "< Huffman compression with 4-bit data"] pub const DECOMPRESS_HUFF4: decompressType = 36; -#[doc = "Huffman compression with 5-bit data"] -#[doc = ""] - +#[doc = "< Huffman compression with 5-bit data"] pub const DECOMPRESS_HUFF5: decompressType = 37; -#[doc = "Huffman compression with 6-bit data"] -#[doc = ""] - +#[doc = "< Huffman compression with 6-bit data"] pub const DECOMPRESS_HUFF6: decompressType = 38; -#[doc = "Huffman compression with 7-bit data"] -#[doc = ""] - +#[doc = "< Huffman compression with 7-bit data"] pub const DECOMPRESS_HUFF7: decompressType = 39; -#[doc = "Huffman compression with 8-bit data"] -#[doc = ""] - +#[doc = "< Huffman compression with 8-bit data"] pub const DECOMPRESS_HUFF8: decompressType = 40; -#[doc = "Huffman compression with 8-bit data"] -#[doc = ""] - +#[doc = "< Huffman compression with 8-bit data"] pub const DECOMPRESS_HUFF: decompressType = 40; -#[doc = "Run-length encoding compression"] -#[doc = ""] - +#[doc = "< Run-length encoding compression"] pub const DECOMPRESS_RLE: decompressType = 48; -#[doc = "Compression types"] -#[doc = ""] - +#[doc = " Compression types"] pub type decompressType = ::libc::c_uint; -#[doc = "I/O vector"] -#[doc = ""] +#[doc = " I/O vector"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct decompressIOVec { - #[doc = "I/O buffer"] - #[doc = ""] + #[doc = "< I/O buffer"] pub data: *mut ::libc::c_void, - #[doc = "Buffer size"] - #[doc = ""] + #[doc = "< Buffer size"] pub size: usize, } impl Default for decompressIOVec { @@ -5851,9 +4805,7 @@ impl Default for decompressIOVec { } } } -#[doc = "Data callback"] -#[doc = ""] - +#[doc = " Data callback"] pub type decompressCallback = ::core::option::Option< unsafe extern "C" fn( userdata: *mut ::libc::c_void, @@ -5862,8 +4814,7 @@ pub type decompressCallback = ::core::option::Option< ) -> isize, >; extern "C" { - #[doc = "Decompression callback for file descriptors\n @param[in] userdata Address of file descriptor\n @param[in] buffer Buffer to write into\n @param[in] size Size to read from file descriptor\n @returns Number of bytes read"] - #[doc = ""] + #[doc = " Decompression callback for file descriptors\n # Arguments\n\n* `userdata` (direction in) - Address of file descriptor\n * `buffer` (direction in) - Buffer to write into\n * `size` (direction in) - Size to read from file descriptor\n # Returns\n\nNumber of bytes read"] pub fn decompressCallback_FD( userdata: *mut ::libc::c_void, buffer: *mut ::libc::c_void, @@ -5871,8 +4822,7 @@ extern "C" { ) -> isize; } extern "C" { - #[doc = "Decompression callback for stdio FILE*\n @param[in] userdata FILE*\n @param[in] buffer Buffer to write into\n @param[in] size Size to read from file descriptor\n @returns Number of bytes read"] - #[doc = ""] + #[doc = " Decompression callback for stdio FILE*\n # Arguments\n\n* `userdata` (direction in) - FILE*\n * `buffer` (direction in) - Buffer to write into\n * `size` (direction in) - Size to read from file descriptor\n # Returns\n\nNumber of bytes read"] pub fn decompressCallback_Stdio( userdata: *mut ::libc::c_void, buffer: *mut ::libc::c_void, @@ -5880,8 +4830,7 @@ extern "C" { ) -> isize; } extern "C" { - #[doc = "Decode decompression header\n @param[out] type Decompression type\n @param[out] size Decompressed size\n @param[in] callback Data callback (see decompressV())\n @param[in] userdata User data passed to callback (see decompressV())\n @param[in] insize Size of userdata (see decompressV())\n @returns Bytes consumed\n @retval -1 error"] - #[doc = ""] + #[doc = " Decode decompression header\n # Arguments\n\n* `type` (direction out) - Decompression type\n * `size` (direction out) - Decompressed size\n callback Data callback (see decompressV())\n userdata User data passed to callback (see decompressV())\n insize Size of userdata (see decompressV())\n # Returns\n\nBytes consumed\n * `-1` - error"] pub fn decompressHeader( type_: *mut decompressType, size: *mut usize, @@ -5891,8 +4840,7 @@ extern "C" { ) -> isize; } extern "C" { - #[doc = "Decompress data\n @param[in] iov Output vector\n @param[in] iovcnt Number of buffers\n @param[in] callback Data callback (see note)\n @param[in] userdata User data passed to callback (see note)\n @param[in] insize Size of userdata (see note)\n @returns Whether succeeded\n\n @note If callback is null, userdata is a pointer to memory to read from,\n and insize is the size of that data. If callback is not null,\n userdata is passed to callback to fetch more data, and insize is\n unused."] - #[doc = ""] + #[doc = " Decompress data\n # Arguments\n\n* `iov` (direction in) - Output vector\n * `iovcnt` (direction in) - Number of buffers\n * `callback` (direction in) - Data callback (see note)\n * `userdata` (direction in) - User data passed to callback (see note)\n * `insize` (direction in) - Size of userdata (see note)\n # Returns\n\nWhether succeeded\n\n > **Note:** If callback is null, userdata is a pointer to memory to read from,\n and insize is the size of that data. If callback is not null,\n userdata is passed to callback to fetch more data, and insize is\n unused."] pub fn decompressV( iov: *const decompressIOVec, iovcnt: usize, @@ -5902,8 +4850,7 @@ extern "C" { ) -> bool; } extern "C" { - #[doc = "Decompress LZSS/LZ10\n @param[in] iov Output vector\n @param[in] iovcnt Number of buffers\n @param[in] callback Data callback (see decompressV())\n @param[in] userdata User data passed to callback (see decompressV())\n @param[in] insize Size of userdata (see decompressV())\n @returns Whether succeeded"] - #[doc = ""] + #[doc = " Decompress LZSS/LZ10\n # Arguments\n\n* `iov` (direction in) - Output vector\n * `iovcnt` (direction in) - Number of buffers\n * `callback` (direction in) - Data callback (see decompressV())\n * `userdata` (direction in) - User data passed to callback (see decompressV())\n * `insize` (direction in) - Size of userdata (see decompressV())\n # Returns\n\nWhether succeeded"] pub fn decompressV_LZSS( iov: *const decompressIOVec, iovcnt: usize, @@ -5913,8 +4860,7 @@ extern "C" { ) -> bool; } extern "C" { - #[doc = "Decompress LZ11\n @param[in] iov Output vector\n @param[in] iovcnt Number of buffers\n @param[in] callback Data callback (see decompressV())\n @param[in] userdata User data passed to callback (see decompressV())\n @param[in] insize Size of userdata (see decompressV())\n @returns Whether succeeded"] - #[doc = ""] + #[doc = " Decompress LZ11\n # Arguments\n\n* `iov` (direction in) - Output vector\n * `iovcnt` (direction in) - Number of buffers\n * `callback` (direction in) - Data callback (see decompressV())\n * `userdata` (direction in) - User data passed to callback (see decompressV())\n * `insize` (direction in) - Size of userdata (see decompressV())\n # Returns\n\nWhether succeeded"] pub fn decompressV_LZ11( iov: *const decompressIOVec, iovcnt: usize, @@ -5924,8 +4870,7 @@ extern "C" { ) -> bool; } extern "C" { - #[doc = "Decompress Huffman\n @param[in] bits Data size in bits (usually 4 or 8)\n @param[in] iov Output vector\n @param[in] iovcnt Number of buffers\n @param[in] callback Data callback (see decompressV())\n @param[in] userdata User data passed to callback (see decompressV())\n @param[in] insize Size of userdata (see decompressV())\n @returns Whether succeeded"] - #[doc = ""] + #[doc = " Decompress Huffman\n # Arguments\n\n* `bits` (direction in) - Data size in bits (usually 4 or 8)\n * `iov` (direction in) - Output vector\n * `iovcnt` (direction in) - Number of buffers\n * `callback` (direction in) - Data callback (see decompressV())\n * `userdata` (direction in) - User data passed to callback (see decompressV())\n * `insize` (direction in) - Size of userdata (see decompressV())\n # Returns\n\nWhether succeeded"] pub fn decompressV_Huff( bits: usize, iov: *const decompressIOVec, @@ -5936,8 +4881,7 @@ extern "C" { ) -> bool; } extern "C" { - #[doc = "Decompress run-length encoding\n @param[in] iov Output vector\n @param[in] iovcnt Number of buffers\n @param[in] callback Data callback (see decompressV())\n @param[in] userdata User data passed to callback (see decompressV())\n @param[in] insize Size of userdata (see decompressV())\n @returns Whether succeeded"] - #[doc = ""] + #[doc = " Decompress run-length encoding\n # Arguments\n\n* `iov` (direction in) - Output vector\n * `iovcnt` (direction in) - Number of buffers\n * `callback` (direction in) - Data callback (see decompressV())\n * `userdata` (direction in) - User data passed to callback (see decompressV())\n * `insize` (direction in) - Size of userdata (see decompressV())\n # Returns\n\nWhether succeeded"] pub fn decompressV_RLE( iov: *const decompressIOVec, iovcnt: usize, @@ -5947,98 +4891,79 @@ extern "C" { ) -> bool; } extern "C" { - #[doc = "Convert a UTF-8 sequence into a UTF-32 codepoint\n\n @param[out] out Output codepoint\n @param[in] in Input sequence\n\n @returns number of input code units consumed\n @returns -1 for error"] - #[doc = ""] + #[doc = " Convert a UTF-8 sequence into a UTF-32 codepoint\n\n # Arguments\n\n* `out` (direction out) - Output codepoint\n in Input sequence\n\n # Returns\n\nnumber of input code units consumed\n -1 for error"] pub fn decode_utf8(out: *mut u32, in_: *const u8) -> isize; } extern "C" { - #[doc = "Convert a UTF-16 sequence into a UTF-32 codepoint\n\n @param[out] out Output codepoint\n @param[in] in Input sequence\n\n @returns number of input code units consumed\n @returns -1 for error"] - #[doc = ""] + #[doc = " Convert a UTF-16 sequence into a UTF-32 codepoint\n\n # Arguments\n\n* `out` (direction out) - Output codepoint\n in Input sequence\n\n # Returns\n\nnumber of input code units consumed\n -1 for error"] pub fn decode_utf16(out: *mut u32, in_: *const u16) -> isize; } extern "C" { - #[doc = "Convert a UTF-32 codepoint into a UTF-8 sequence\n\n @param[out] out Output sequence\n @param[in] in Input codepoint\n\n @returns number of output code units produced\n @returns -1 for error\n\n @note *out* must be able to store 4 code units"] - #[doc = ""] + #[doc = " Convert a UTF-32 codepoint into a UTF-8 sequence\n\n # Arguments\n\n* `out` (direction out) - Output sequence\n in Input codepoint\n\n # Returns\n\nnumber of output code units produced\n -1 for error\n\n > **Note:** _out_ must be able to store 4 code units"] pub fn encode_utf8(out: *mut u8, in_: u32) -> isize; } extern "C" { - #[doc = "Convert a UTF-32 codepoint into a UTF-16 sequence\n\n @param[out] out Output sequence\n @param[in] in Input codepoint\n\n @returns number of output code units produced\n @returns -1 for error\n\n @note *out* must be able to store 2 code units"] - #[doc = ""] + #[doc = " Convert a UTF-32 codepoint into a UTF-16 sequence\n\n # Arguments\n\n* `out` (direction out) - Output sequence\n in Input codepoint\n\n # Returns\n\nnumber of output code units produced\n -1 for error\n\n > **Note:** _out_ must be able to store 2 code units"] pub fn encode_utf16(out: *mut u16, in_: u32) -> isize; } extern "C" { - #[doc = "Convert a UTF-8 sequence into a UTF-16 sequence\n\n Fills the output buffer up to *len* code units.\n Returns the number of code units that the input would produce;\n if it returns greater than *len,* the output has been\n truncated.\n\n @param[out] out Output sequence\n @param[in] in Input sequence (null-terminated)\n @param[in] len Output length\n\n @returns number of output code units produced\n @returns -1 for error\n\n @note *out* is not null-terminated"] - #[doc = ""] + #[doc = " Convert a UTF-8 sequence into a UTF-16 sequence\n\n Fills the output buffer up to _len_ code units.\n Returns the number of code units that the input would produce;\n if it returns greater than _len,_ the output has been\n truncated.\n\n # Arguments\n\n* `out` (direction out) - Output sequence\n in Input sequence (null-terminated)\n len Output length\n\n # Returns\n\nnumber of output code units produced\n -1 for error\n\n > **Note:** _out_ is not null-terminated"] pub fn utf8_to_utf16(out: *mut u16, in_: *const u8, len: usize) -> isize; } extern "C" { - #[doc = "Convert a UTF-8 sequence into a UTF-32 sequence\n\n Fills the output buffer up to *len* code units.\n Returns the number of code units that the input would produce;\n if it returns greater than *len,* the output has been\n truncated.\n\n @param[out] out Output sequence\n @param[in] in Input sequence (null-terminated)\n @param[in] len Output length\n\n @returns number of output code units produced\n @returns -1 for error\n\n @note *out* is not null-terminated"] - #[doc = ""] + #[doc = " Convert a UTF-8 sequence into a UTF-32 sequence\n\n Fills the output buffer up to _len_ code units.\n Returns the number of code units that the input would produce;\n if it returns greater than _len,_ the output has been\n truncated.\n\n # Arguments\n\n* `out` (direction out) - Output sequence\n in Input sequence (null-terminated)\n len Output length\n\n # Returns\n\nnumber of output code units produced\n -1 for error\n\n > **Note:** _out_ is not null-terminated"] pub fn utf8_to_utf32(out: *mut u32, in_: *const u8, len: usize) -> isize; } extern "C" { - #[doc = "Convert a UTF-16 sequence into a UTF-8 sequence\n\n Fills the output buffer up to *len* code units.\n Returns the number of code units that the input would produce;\n if it returns greater than *len,* the output has been\n truncated.\n\n @param[out] out Output sequence\n @param[in] in Input sequence (null-terminated)\n @param[in] len Output length\n\n @returns number of output code units produced\n @returns -1 for error\n\n @note *out* is not null-terminated"] - #[doc = ""] + #[doc = " Convert a UTF-16 sequence into a UTF-8 sequence\n\n Fills the output buffer up to _len_ code units.\n Returns the number of code units that the input would produce;\n if it returns greater than _len,_ the output has been\n truncated.\n\n # Arguments\n\n* `out` (direction out) - Output sequence\n in Input sequence (null-terminated)\n len Output length\n\n # Returns\n\nnumber of output code units produced\n -1 for error\n\n > **Note:** _out_ is not null-terminated"] pub fn utf16_to_utf8(out: *mut u8, in_: *const u16, len: usize) -> isize; } extern "C" { - #[doc = "Convert a UTF-16 sequence into a UTF-32 sequence\n\n Fills the output buffer up to *len* code units.\n Returns the number of code units that the input would produce;\n if it returns greater than *len,* the output has been\n truncated.\n\n @param[out] out Output sequence\n @param[in] in Input sequence (null-terminated)\n @param[in] len Output length\n\n @returns number of output code units produced\n @returns -1 for error\n\n @note *out* is not null-terminated"] - #[doc = ""] + #[doc = " Convert a UTF-16 sequence into a UTF-32 sequence\n\n Fills the output buffer up to _len_ code units.\n Returns the number of code units that the input would produce;\n if it returns greater than _len,_ the output has been\n truncated.\n\n # Arguments\n\n* `out` (direction out) - Output sequence\n in Input sequence (null-terminated)\n len Output length\n\n # Returns\n\nnumber of output code units produced\n -1 for error\n\n > **Note:** _out_ is not null-terminated"] pub fn utf16_to_utf32(out: *mut u32, in_: *const u16, len: usize) -> isize; } extern "C" { - #[doc = "Convert a UTF-32 sequence into a UTF-8 sequence\n\n Fills the output buffer up to *len* code units.\n Returns the number of code units that the input would produce;\n if it returns greater than *len,* the output has been\n truncated.\n\n @param[out] out Output sequence\n @param[in] in Input sequence (null-terminated)\n @param[in] len Output length\n\n @returns number of output code units produced\n @returns -1 for error\n\n @note *out* is not null-terminated"] - #[doc = ""] + #[doc = " Convert a UTF-32 sequence into a UTF-8 sequence\n\n Fills the output buffer up to _len_ code units.\n Returns the number of code units that the input would produce;\n if it returns greater than _len,_ the output has been\n truncated.\n\n # Arguments\n\n* `out` (direction out) - Output sequence\n in Input sequence (null-terminated)\n len Output length\n\n # Returns\n\nnumber of output code units produced\n -1 for error\n\n > **Note:** _out_ is not null-terminated"] pub fn utf32_to_utf8(out: *mut u8, in_: *const u32, len: usize) -> isize; } extern "C" { - #[doc = "Convert a UTF-32 sequence into a UTF-16 sequence\n\n @param[out] out Output sequence\n @param[in] in Input sequence (null-terminated)\n @param[in] len Output length\n\n @returns number of output code units produced\n @returns -1 for error\n\n @note *out* is not null-terminated"] - #[doc = ""] + #[doc = " Convert a UTF-32 sequence into a UTF-16 sequence\n\n # Arguments\n\n* `out` (direction out) - Output sequence\n in Input sequence (null-terminated)\n len Output length\n\n # Returns\n\nnumber of output code units produced\n -1 for error\n\n > **Note:** _out_ is not null-terminated"] pub fn utf32_to_utf16(out: *mut u16, in_: *const u32, len: usize) -> isize; } extern "C" { - #[doc = "Allocates a 0x80-byte aligned buffer.\n @param size Size of the buffer to allocate.\n @return The allocated buffer."] - #[doc = ""] + #[doc = " Allocates a 0x80-byte aligned buffer.\n # Arguments\n\n* `size` - Size of the buffer to allocate.\n # Returns\n\nThe allocated buffer."] pub fn linearAlloc(size: usize) -> *mut ::libc::c_void; } extern "C" { - #[doc = "Allocates a buffer aligned to the given size.\n @param size Size of the buffer to allocate.\n @param alignment Alignment to use.\n @return The allocated buffer."] - #[doc = ""] + #[doc = " Allocates a buffer aligned to the given size.\n # Arguments\n\n* `size` - Size of the buffer to allocate.\n * `alignment` - Alignment to use.\n # Returns\n\nThe allocated buffer."] pub fn linearMemAlign(size: usize, alignment: usize) -> *mut ::libc::c_void; } extern "C" { - #[doc = "Reallocates a buffer.\n Note: Not implemented yet.\n @param mem Buffer to reallocate.\n @param size Size of the buffer to allocate.\n @return The reallocated buffer."] - #[doc = ""] + #[doc = " Reallocates a buffer.\n Note: Not implemented yet.\n # Arguments\n\n* `mem` - Buffer to reallocate.\n * `size` - Size of the buffer to allocate.\n # Returns\n\nThe reallocated buffer."] pub fn linearRealloc(mem: *mut ::libc::c_void, size: usize) -> *mut ::libc::c_void; } extern "C" { - #[doc = "Retrieves the allocated size of a buffer.\n @return The size of the buffer."] - #[doc = ""] + #[doc = " Retrieves the allocated size of a buffer.\n # Returns\n\nThe size of the buffer."] pub fn linearGetSize(mem: *mut ::libc::c_void) -> usize; } extern "C" { - #[doc = "Frees a buffer.\n @param mem Buffer to free."] - #[doc = ""] + #[doc = " Frees a buffer.\n # Arguments\n\n* `mem` - Buffer to free."] pub fn linearFree(mem: *mut ::libc::c_void); } extern "C" { - #[doc = "Gets the current linear free space.\n @return The current linear free space."] - #[doc = ""] + #[doc = " Gets the current linear free space.\n # Returns\n\nThe current linear free space."] pub fn linearSpaceFree() -> u32_; } extern "C" { - #[doc = "Initializes the mappable allocator.\n @param addrMin Minimum address.\n @param addrMax Maxium address."] - #[doc = ""] + #[doc = " Initializes the mappable allocator.\n # Arguments\n\n* `addrMin` - Minimum address.\n * `addrMax` - Maxium address."] pub fn mappableInit(addrMin: u32_, addrMax: u32_); } extern "C" { - #[doc = "Finds a mappable memory area.\n @param size Size of the area to find.\n @return The mappable area."] - #[doc = ""] + #[doc = " Finds a mappable memory area.\n # Arguments\n\n* `size` - Size of the area to find.\n # Returns\n\nThe mappable area."] pub fn mappableAlloc(size: usize) -> *mut ::libc::c_void; } extern "C" { - #[doc = "Frees a mappable area (stubbed).\n @param mem Mappable area to free."] - #[doc = ""] + #[doc = " Frees a mappable area (stubbed).\n # Arguments\n\n* `mem` - Mappable area to free."] pub fn mappableFree(mem: *mut ::libc::c_void); } pub const VRAM_ALLOC_A: vramAllocPos = 1; @@ -6046,83 +4971,56 @@ pub const VRAM_ALLOC_B: vramAllocPos = 2; pub const VRAM_ALLOC_ANY: vramAllocPos = 3; pub type vramAllocPos = ::libc::c_uint; extern "C" { - #[doc = "Allocates a 0x80-byte aligned buffer.\n @param size Size of the buffer to allocate.\n @return The allocated buffer."] - #[doc = ""] + #[doc = " Allocates a 0x80-byte aligned buffer.\n # Arguments\n\n* `size` - Size of the buffer to allocate.\n # Returns\n\nThe allocated buffer."] pub fn vramAlloc(size: usize) -> *mut ::libc::c_void; } extern "C" { - #[doc = "Allocates a 0x80-byte aligned buffer in the given VRAM bank.\n @param size Size of the buffer to allocate.\n @param pos VRAM bank to use (see [`vramAllocPos).\n`] @return The allocated buffer."] - #[doc = ""] + #[doc = " Allocates a 0x80-byte aligned buffer in the given VRAM bank.\n # Arguments\n\n* `size` - Size of the buffer to allocate.\n * `pos` - VRAM bank to use (see vramAllocPos).\n # Returns\n\nThe allocated buffer."] pub fn vramAllocAt(size: usize, pos: vramAllocPos) -> *mut ::libc::c_void; } extern "C" { - #[doc = "Allocates a buffer aligned to the given size.\n @param size Size of the buffer to allocate.\n @param alignment Alignment to use.\n @return The allocated buffer."] - #[doc = ""] + #[doc = " Allocates a buffer aligned to the given size.\n # Arguments\n\n* `size` - Size of the buffer to allocate.\n * `alignment` - Alignment to use.\n # Returns\n\nThe allocated buffer."] pub fn vramMemAlign(size: usize, alignment: usize) -> *mut ::libc::c_void; } extern "C" { - #[doc = "Allocates a buffer aligned to the given size in the given VRAM bank.\n @param size Size of the buffer to allocate.\n @param alignment Alignment to use.\n @param pos VRAM bank to use (see [`vramAllocPos).\n`] @return The allocated buffer."] - #[doc = ""] + #[doc = " Allocates a buffer aligned to the given size in the given VRAM bank.\n # Arguments\n\n* `size` - Size of the buffer to allocate.\n * `alignment` - Alignment to use.\n * `pos` - VRAM bank to use (see vramAllocPos).\n # Returns\n\nThe allocated buffer."] pub fn vramMemAlignAt(size: usize, alignment: usize, pos: vramAllocPos) -> *mut ::libc::c_void; } extern "C" { - #[doc = "Reallocates a buffer.\n Note: Not implemented yet.\n @param mem Buffer to reallocate.\n @param size Size of the buffer to allocate.\n @return The reallocated buffer."] - #[doc = ""] + #[doc = " Reallocates a buffer.\n Note: Not implemented yet.\n # Arguments\n\n* `mem` - Buffer to reallocate.\n * `size` - Size of the buffer to allocate.\n # Returns\n\nThe reallocated buffer."] pub fn vramRealloc(mem: *mut ::libc::c_void, size: usize) -> *mut ::libc::c_void; } extern "C" { - #[doc = "Retrieves the allocated size of a buffer.\n @return The size of the buffer."] - #[doc = ""] + #[doc = " Retrieves the allocated size of a buffer.\n # Returns\n\nThe size of the buffer."] pub fn vramGetSize(mem: *mut ::libc::c_void) -> usize; } extern "C" { - #[doc = "Frees a buffer.\n @param mem Buffer to free."] - #[doc = ""] + #[doc = " Frees a buffer.\n # Arguments\n\n* `mem` - Buffer to free."] pub fn vramFree(mem: *mut ::libc::c_void); } extern "C" { - #[doc = "Gets the current VRAM free space.\n @return The current VRAM free space."] - #[doc = ""] + #[doc = " Gets the current VRAM free space.\n # Returns\n\nThe current VRAM free space."] pub fn vramSpaceFree() -> u32_; } -#[doc = "Open authentication."] -#[doc = ""] - +#[doc = "< Open authentication."] pub const AC_OPEN: acSecurityMode = 0; -#[doc = "WEP 40-bit authentication."] -#[doc = ""] - +#[doc = "< WEP 40-bit authentication."] pub const AC_WEP_40BIT: acSecurityMode = 1; -#[doc = "WEP 104-bit authentication."] -#[doc = ""] - +#[doc = "< WEP 104-bit authentication."] pub const AC_WEP_104BIT: acSecurityMode = 2; -#[doc = "WEP 128-bit authentication."] -#[doc = ""] - +#[doc = "< WEP 128-bit authentication."] pub const AC_WEP_128BIT: acSecurityMode = 3; -#[doc = "WPA TKIP authentication."] -#[doc = ""] - +#[doc = "< WPA TKIP authentication."] pub const AC_WPA_TKIP: acSecurityMode = 4; -#[doc = "WPA2 TKIP authentication."] -#[doc = ""] - +#[doc = "< WPA2 TKIP authentication."] pub const AC_WPA2_TKIP: acSecurityMode = 5; -#[doc = "WPA AES authentication."] -#[doc = ""] - +#[doc = "< WPA AES authentication."] pub const AC_WPA_AES: acSecurityMode = 6; -#[doc = "WPA2 AES authentication."] -#[doc = ""] - +#[doc = "< WPA2 AES authentication."] pub const AC_WPA2_AES: acSecurityMode = 7; -#[doc = "Wifi security modes."] -#[doc = ""] - +#[doc = " Wifi security modes."] pub type acSecurityMode = ::libc::c_uint; -#[doc = "Struct to contain the data for connecting to a Wifi network from a stored slot."] -#[doc = ""] +#[doc = " Struct to contain the data for connecting to a Wifi network from a stored slot."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct acuConfig { @@ -6139,463 +5037,278 @@ impl Default for acuConfig { } extern "C" { #[must_use] - #[doc = "Initializes AC."] - #[doc = ""] + #[doc = " Initializes AC."] pub fn acInit() -> Result; } extern "C" { - #[doc = "Exits AC."] - #[doc = ""] + #[doc = " Exits AC."] pub fn acExit(); } extern "C" { #[must_use] - #[doc = "Waits for the system to connect to the internet."] - #[doc = ""] + #[doc = " Waits for the system to connect to the internet."] pub fn acWaitInternetConnection() -> Result; } extern "C" { #[must_use] - #[doc = "Gets the connected Wifi status.\n @param out Pointer to output the connected Wifi status to. (0 = not connected, 1 = O3DS Internet, 2 = N3DS Internet)"] - #[doc = ""] + #[doc = " Gets the connected Wifi status.\n # Arguments\n\n* `out` - Pointer to output the connected Wifi status to. (0 = not connected, 1 = O3DS Internet, 2 = N3DS Internet)"] pub fn ACU_GetWifiStatus(out: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the connected Wifi status.\n @param out Pointer to output the connected Wifi status to. (1 = not connected, 3 = connected)"] - #[doc = ""] + #[doc = " Gets the connected Wifi status.\n # Arguments\n\n* `out` - Pointer to output the connected Wifi status to. (1 = not connected, 3 = connected)"] pub fn ACU_GetStatus(out: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the connected Wifi security mode.\n @param mode Pointer to output the connected Wifi security mode to. (0 = Open Authentication, 1 = WEP 40-bit, 2 = WEP 104-bit, 3 = WEP 128-bit, 4 = WPA TKIP, 5 = WPA2 TKIP, 6 = WPA AES, 7 = WPA2 AES)"] - #[doc = ""] + #[doc = " Gets the connected Wifi security mode.\n # Arguments\n\n* `mode` - Pointer to output the connected Wifi security mode to. (0 = Open Authentication, 1 = WEP 40-bit, 2 = WEP 104-bit, 3 = WEP 128-bit, 4 = WPA TKIP, 5 = WPA2 TKIP, 6 = WPA AES, 7 = WPA2 AES)"] pub fn ACU_GetSecurityMode(mode: *mut acSecurityMode) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the connected Wifi SSID.\n @param SSID Pointer to output the connected Wifi SSID to."] - #[doc = ""] + #[doc = " Gets the connected Wifi SSID.\n # Arguments\n\n* `SSID` - Pointer to output the connected Wifi SSID to."] pub fn ACU_GetSSID(SSID: *mut ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the connected Wifi SSID length.\n @param out Pointer to output the connected Wifi SSID length to."] - #[doc = ""] + #[doc = " Gets the connected Wifi SSID length.\n # Arguments\n\n* `out` - Pointer to output the connected Wifi SSID length to."] pub fn ACU_GetSSIDLength(out: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Determines whether proxy is enabled for the connected network.\n @param enable Pointer to output the proxy status to."] - #[doc = ""] + #[doc = " Determines whether proxy is enabled for the connected network.\n # Arguments\n\n* `enable` - Pointer to output the proxy status to."] pub fn ACU_GetProxyEnable(enable: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the connected network's proxy port.\n @param out Pointer to output the proxy port to."] - #[doc = ""] + #[doc = " Gets the connected network's proxy port.\n # Arguments\n\n* `out` - Pointer to output the proxy port to."] pub fn ACU_GetProxyPort(out: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the connected network's proxy username.\n @param username Pointer to output the proxy username to. (The size must be at least 0x20-bytes)"] - #[doc = ""] + #[doc = " Gets the connected network's proxy username.\n # Arguments\n\n* `username` - Pointer to output the proxy username to. (The size must be at least 0x20-bytes)"] pub fn ACU_GetProxyUserName(username: *mut ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the connected network's proxy password.\n @param password Pointer to output the proxy password to. (The size must be at least 0x20-bytes)"] - #[doc = ""] + #[doc = " Gets the connected network's proxy password.\n # Arguments\n\n* `password` - Pointer to output the proxy password to. (The size must be at least 0x20-bytes)"] pub fn ACU_GetProxyPassword(password: *mut ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the last error to occur during a connection.\n @param errorCode Pointer to output the error code to."] - #[doc = ""] + #[doc = " Gets the last error to occur during a connection.\n # Arguments\n\n* `errorCode` - Pointer to output the error code to."] pub fn ACU_GetLastErrorCode(errorCode: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the last detailed error to occur during a connection.\n @param errorCode Pointer to output the error code to."] - #[doc = ""] + #[doc = " Gets the last detailed error to occur during a connection.\n # Arguments\n\n* `errorCode` - Pointer to output the error code to."] pub fn ACU_GetLastDetailErrorCode(errorCode: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Prepares a buffer to hold the configuration data to start a connection.\n @param config Pointer to an acuConfig struct to contain the data."] - #[doc = ""] + #[doc = " Prepares a buffer to hold the configuration data to start a connection.\n # Arguments\n\n* `config` - Pointer to an acuConfig struct to contain the data."] pub fn ACU_CreateDefaultConfig(config: *mut acuConfig) -> Result; } extern "C" { #[must_use] - #[doc = "Sets something that makes the connection reliable.\n @param config Pointer to an acuConfig struct used with ACU_CreateDefaultConfig previously.\n @param area Always 2 ?"] - #[doc = ""] + #[doc = " Sets something that makes the connection reliable.\n # Arguments\n\n* `config` - Pointer to an acuConfig struct used with ACU_CreateDefaultConfig previously.\n * `area` - Always 2 ?"] pub fn ACU_SetNetworkArea(config: *mut acuConfig, area: u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the slot to use when connecting.\n @param config Pointer to an acuConfig struct used with ACU_CreateDefaultConfig previously.\n @param type Allowed slots flag. BIT(0) for slot 1, BIT(1) for slot 2, BIT(2) for slot 3."] - #[doc = ""] + #[doc = " Sets the slot to use when connecting.\n # Arguments\n\n* `config` - Pointer to an acuConfig struct used with ACU_CreateDefaultConfig previously.\n * `type` - Allowed slots flag. BIT(0) for slot 1, BIT(1) for slot 2, BIT(2) for slot 3."] pub fn ACU_SetAllowApType(config: *mut acuConfig, type_: u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Sets something that makes the connection reliable.\n @param config Pointer to an acuConfig struct used with ACU_CreateDefaultConfig previously."] - #[doc = ""] + #[doc = " Sets something that makes the connection reliable.\n # Arguments\n\n* `config` - Pointer to an acuConfig struct used with ACU_CreateDefaultConfig previously."] pub fn ACU_SetRequestEulaVersion(config: *mut acuConfig) -> Result; } extern "C" { #[must_use] - #[doc = "Starts the connection procedure.\n @param config Pointer to an acuConfig struct used with ACU_CreateDefaultConfig previously.\n @param connectionHandle Handle created with svcCreateEvent to wait on until the connection succeeds or fails."] - #[doc = ""] + #[doc = " Starts the connection procedure.\n # Arguments\n\n* `config` - Pointer to an acuConfig struct used with ACU_CreateDefaultConfig previously.\n * `connectionHandle` - Handle created with svcCreateEvent to wait on until the connection succeeds or fails."] pub fn ACU_ConnectAsync(config: *const acuConfig, connectionHandle: Handle) -> Result; } -#[doc = "Open for reading."] -#[doc = ""] - +#[doc = "< Open for reading."] pub const FS_OPEN_READ: _bindgen_ty_10 = 1; -#[doc = "Open for writing."] -#[doc = ""] - +#[doc = "< Open for writing."] pub const FS_OPEN_WRITE: _bindgen_ty_10 = 2; -#[doc = "Create file."] -#[doc = ""] - +#[doc = "< Create file."] pub const FS_OPEN_CREATE: _bindgen_ty_10 = 4; -#[doc = "Open flags."] -#[doc = ""] - +#[doc = " Open flags."] pub type _bindgen_ty_10 = ::libc::c_uint; -#[doc = "Flush."] -#[doc = ""] - +#[doc = "< Flush."] pub const FS_WRITE_FLUSH: _bindgen_ty_11 = 1; -#[doc = "Update file timestamp."] -#[doc = ""] - +#[doc = "< Update file timestamp."] pub const FS_WRITE_UPDATE_TIME: _bindgen_ty_11 = 256; -#[doc = "Write flags."] -#[doc = ""] - +#[doc = " Write flags."] pub type _bindgen_ty_11 = ::libc::c_uint; -#[doc = "Directory."] -#[doc = ""] - +#[doc = "< Directory."] pub const FS_ATTRIBUTE_DIRECTORY: _bindgen_ty_12 = 1; -#[doc = "Hidden."] -#[doc = ""] - +#[doc = "< Hidden."] pub const FS_ATTRIBUTE_HIDDEN: _bindgen_ty_12 = 256; -#[doc = "Archive."] -#[doc = ""] - +#[doc = "< Archive."] pub const FS_ATTRIBUTE_ARCHIVE: _bindgen_ty_12 = 65536; -#[doc = "Read-only."] -#[doc = ""] - +#[doc = "< Read-only."] pub const FS_ATTRIBUTE_READ_ONLY: _bindgen_ty_12 = 16777216; -#[doc = "Attribute flags."] -#[doc = ""] - +#[doc = " Attribute flags."] pub type _bindgen_ty_12 = ::libc::c_uint; -#[doc = "NAND."] -#[doc = ""] - +#[doc = "< NAND."] pub const MEDIATYPE_NAND: FS_MediaType = 0; -#[doc = "SD card."] -#[doc = ""] - +#[doc = "< SD card."] pub const MEDIATYPE_SD: FS_MediaType = 1; -#[doc = "Game card."] -#[doc = ""] - +#[doc = "< Game card."] pub const MEDIATYPE_GAME_CARD: FS_MediaType = 2; -#[doc = "Media types."] -#[doc = ""] - +#[doc = " Media types."] pub type FS_MediaType = ::libc::c_uint; -#[doc = "CTR NAND."] -#[doc = ""] - +#[doc = "< CTR NAND."] pub const SYSTEM_MEDIATYPE_CTR_NAND: FS_SystemMediaType = 0; -#[doc = "TWL NAND."] -#[doc = ""] - +#[doc = "< TWL NAND."] pub const SYSTEM_MEDIATYPE_TWL_NAND: FS_SystemMediaType = 1; -#[doc = "SD card."] -#[doc = ""] - +#[doc = "< SD card."] pub const SYSTEM_MEDIATYPE_SD: FS_SystemMediaType = 2; -#[doc = "TWL Photo."] -#[doc = ""] - +#[doc = "< TWL Photo."] pub const SYSTEM_MEDIATYPE_TWL_PHOTO: FS_SystemMediaType = 3; -#[doc = "System media types."] -#[doc = ""] - +#[doc = " System media types."] pub type FS_SystemMediaType = ::libc::c_uint; -#[doc = "RomFS archive."] -#[doc = ""] - +#[doc = "< RomFS archive."] pub const ARCHIVE_ROMFS: FS_ArchiveID = 3; -#[doc = "Save data archive."] -#[doc = ""] - +#[doc = "< Save data archive."] pub const ARCHIVE_SAVEDATA: FS_ArchiveID = 4; -#[doc = "Ext data archive."] -#[doc = ""] - +#[doc = "< Ext data archive."] pub const ARCHIVE_EXTDATA: FS_ArchiveID = 6; -#[doc = "Shared ext data archive."] -#[doc = ""] - +#[doc = "< Shared ext data archive."] pub const ARCHIVE_SHARED_EXTDATA: FS_ArchiveID = 7; -#[doc = "System save data archive."] -#[doc = ""] - +#[doc = "< System save data archive."] pub const ARCHIVE_SYSTEM_SAVEDATA: FS_ArchiveID = 8; -#[doc = "SDMC archive."] -#[doc = ""] - +#[doc = "< SDMC archive."] pub const ARCHIVE_SDMC: FS_ArchiveID = 9; -#[doc = "Write-only SDMC archive."] -#[doc = ""] - +#[doc = "< Write-only SDMC archive."] pub const ARCHIVE_SDMC_WRITE_ONLY: FS_ArchiveID = 10; -#[doc = "BOSS ext data archive."] -#[doc = ""] - +#[doc = "< BOSS ext data archive."] pub const ARCHIVE_BOSS_EXTDATA: FS_ArchiveID = 305419896; -#[doc = "Card SPI FS archive."] -#[doc = ""] - +#[doc = "< Card SPI FS archive."] pub const ARCHIVE_CARD_SPIFS: FS_ArchiveID = 305419897; -#[doc = "Ext data and BOSS ext data archive."] -#[doc = ""] - +#[doc = "< Ext data and BOSS ext data archive."] pub const ARCHIVE_EXTDATA_AND_BOSS_EXTDATA: FS_ArchiveID = 305419899; -#[doc = "System save data archive."] -#[doc = ""] - +#[doc = "< System save data archive."] pub const ARCHIVE_SYSTEM_SAVEDATA2: FS_ArchiveID = 305419900; -#[doc = "Read-write NAND archive."] -#[doc = ""] - +#[doc = "< Read-write NAND archive."] pub const ARCHIVE_NAND_RW: FS_ArchiveID = 305419901; -#[doc = "Read-only NAND archive."] -#[doc = ""] - +#[doc = "< Read-only NAND archive."] pub const ARCHIVE_NAND_RO: FS_ArchiveID = 305419902; -#[doc = "Read-only write access NAND archive."] -#[doc = ""] - +#[doc = "< Read-only write access NAND archive."] pub const ARCHIVE_NAND_RO_WRITE_ACCESS: FS_ArchiveID = 305419903; -#[doc = "User save data and ExeFS/RomFS archive."] -#[doc = ""] - +#[doc = "< User save data and ExeFS/RomFS archive."] pub const ARCHIVE_SAVEDATA_AND_CONTENT: FS_ArchiveID = 591751050; -#[doc = "User save data and ExeFS/RomFS archive (only ExeFS for fs:LDR)."] -#[doc = ""] - +#[doc = "< User save data and ExeFS/RomFS archive (only ExeFS for fs:LDR)."] pub const ARCHIVE_SAVEDATA_AND_CONTENT2: FS_ArchiveID = 591751054; -#[doc = "NAND CTR FS archive."] -#[doc = ""] - +#[doc = "< NAND CTR FS archive."] pub const ARCHIVE_NAND_CTR_FS: FS_ArchiveID = 1450741931; -#[doc = "TWL PHOTO archive."] -#[doc = ""] - +#[doc = "< TWL PHOTO archive."] pub const ARCHIVE_TWL_PHOTO: FS_ArchiveID = 1450741932; -#[doc = "TWL SOUND archive."] -#[doc = ""] - +#[doc = "< TWL SOUND archive."] pub const ARCHIVE_TWL_SOUND: FS_ArchiveID = 1450741933; -#[doc = "NAND TWL FS archive."] -#[doc = ""] - +#[doc = "< NAND TWL FS archive."] pub const ARCHIVE_NAND_TWL_FS: FS_ArchiveID = 1450741934; -#[doc = "NAND W FS archive."] -#[doc = ""] - +#[doc = "< NAND W FS archive."] pub const ARCHIVE_NAND_W_FS: FS_ArchiveID = 1450741935; -#[doc = "Game card save data archive."] -#[doc = ""] - +#[doc = "< Game card save data archive."] pub const ARCHIVE_GAMECARD_SAVEDATA: FS_ArchiveID = 1450741937; -#[doc = "User save data archive."] -#[doc = ""] - +#[doc = "< User save data archive."] pub const ARCHIVE_USER_SAVEDATA: FS_ArchiveID = 1450741938; -#[doc = "Demo save data archive."] -#[doc = ""] - +#[doc = "< Demo save data archive."] pub const ARCHIVE_DEMO_SAVEDATA: FS_ArchiveID = 1450741940; -#[doc = "Archive IDs."] -#[doc = ""] - +#[doc = " Archive IDs."] pub type FS_ArchiveID = ::libc::c_uint; -#[doc = "Invalid path."] -#[doc = ""] - +#[doc = "< Invalid path."] pub const PATH_INVALID: FS_PathType = 0; -#[doc = "Empty path."] -#[doc = ""] - +#[doc = "< Empty path."] pub const PATH_EMPTY: FS_PathType = 1; -#[doc = "Binary path. Meaning is per-archive."] -#[doc = ""] - +#[doc = "< Binary path. Meaning is per-archive."] pub const PATH_BINARY: FS_PathType = 2; -#[doc = "ASCII text path."] -#[doc = ""] - +#[doc = "< ASCII text path."] pub const PATH_ASCII: FS_PathType = 3; -#[doc = "UTF-16 text path."] -#[doc = ""] - +#[doc = "< UTF-16 text path."] pub const PATH_UTF16: FS_PathType = 4; -#[doc = "Path types."] -#[doc = ""] - +#[doc = " Path types."] pub type FS_PathType = ::libc::c_uint; -#[doc = "SD application."] -#[doc = ""] - +#[doc = "< SD application."] pub const SECUREVALUE_SLOT_SD: FS_SecureValueSlot = 4096; -#[doc = "Secure value slot."] -#[doc = ""] - +#[doc = " Secure value slot."] pub type FS_SecureValueSlot = ::libc::c_uint; -#[doc = "512KHz."] -#[doc = ""] - +#[doc = "< 512KHz."] pub const BAUDRATE_512KHZ: FS_CardSpiBaudRate = 0; -#[doc = "1MHz."] -#[doc = ""] - +#[doc = "< 1MHz."] pub const BAUDRATE_1MHZ: FS_CardSpiBaudRate = 1; -#[doc = "2MHz."] -#[doc = ""] - +#[doc = "< 2MHz."] pub const BAUDRATE_2MHZ: FS_CardSpiBaudRate = 2; -#[doc = "4MHz."] -#[doc = ""] - +#[doc = "< 4MHz."] pub const BAUDRATE_4MHZ: FS_CardSpiBaudRate = 3; -#[doc = "8MHz."] -#[doc = ""] - +#[doc = "< 8MHz."] pub const BAUDRATE_8MHZ: FS_CardSpiBaudRate = 4; -#[doc = "16MHz."] -#[doc = ""] - +#[doc = "< 16MHz."] pub const BAUDRATE_16MHZ: FS_CardSpiBaudRate = 5; -#[doc = "Card SPI baud rate."] -#[doc = ""] - +#[doc = " Card SPI baud rate."] pub type FS_CardSpiBaudRate = ::libc::c_uint; -#[doc = "1-bit."] -#[doc = ""] - +#[doc = "< 1-bit."] pub const BUSMODE_1BIT: FS_CardSpiBusMode = 0; -#[doc = "4-bit."] -#[doc = ""] - +#[doc = "< 4-bit."] pub const BUSMODE_4BIT: FS_CardSpiBusMode = 1; -#[doc = "Card SPI bus mode."] -#[doc = ""] - +#[doc = " Card SPI bus mode."] pub type FS_CardSpiBusMode = ::libc::c_uint; -#[doc = "Update."] -#[doc = ""] - +#[doc = "< Update."] pub const SPECIALCONTENT_UPDATE: FS_SpecialContentType = 1; -#[doc = "Manual."] -#[doc = ""] - +#[doc = "< Manual."] pub const SPECIALCONTENT_MANUAL: FS_SpecialContentType = 2; -#[doc = "DLP child."] -#[doc = ""] - +#[doc = "< DLP child."] pub const SPECIALCONTENT_DLP_CHILD: FS_SpecialContentType = 3; -#[doc = "Card SPI bus mode."] -#[doc = ""] - +#[doc = " Card SPI bus mode."] pub type FS_SpecialContentType = ::libc::c_uint; -#[doc = "CTR card."] -#[doc = ""] - +#[doc = "< CTR card."] pub const CARD_CTR: FS_CardType = 0; -#[doc = "TWL card."] -#[doc = ""] - +#[doc = "< TWL card."] pub const CARD_TWL: FS_CardType = 1; pub type FS_CardType = ::libc::c_uint; pub const FS_ACTION_UNKNOWN: FS_Action = 0; -#[doc = "FS control actions."] -#[doc = ""] - +#[doc = " FS control actions."] pub type FS_Action = ::libc::c_uint; -#[doc = "Commits save data changes. No inputs/outputs."] -#[doc = ""] - +#[doc = "< Commits save data changes. No inputs/outputs."] pub const ARCHIVE_ACTION_COMMIT_SAVE_DATA: FS_ArchiveAction = 0; -#[doc = "Retrieves a file's last-modified timestamp. In: \"u16*, UTF-16 Path\", Out: \"u64, Time Stamp\"."] -#[doc = ""] - +#[doc = "< Retrieves a file's last-modified timestamp. In: \"u16*, UTF-16 Path\", Out: \"u64, Time Stamp\"."] pub const ARCHIVE_ACTION_GET_TIMESTAMP: FS_ArchiveAction = 1; pub const ARCHIVE_ACTION_UNKNOWN: FS_ArchiveAction = 30877; -#[doc = "Archive control actions."] -#[doc = ""] - +#[doc = " Archive control actions."] pub type FS_ArchiveAction = ::libc::c_uint; -#[doc = "Deletes a save's secure value. In: \"u64, ((SecureValueSlot <32) | (TitleUniqueId <8) | TitleVariation)\", Out: \"u8, Value Existed\""] -#[doc = ""] - +#[doc = "< Deletes a save's secure value. In: \"u64, ((SecureValueSlot << 32) | (TitleUniqueId << 8) | TitleVariation)\", Out: \"u8, Value Existed\""] pub const SECURESAVE_ACTION_DELETE: FS_SecureSaveAction = 0; -#[doc = "Formats a save. No inputs/outputs."] -#[doc = ""] - +#[doc = "< Formats a save. No inputs/outputs."] pub const SECURESAVE_ACTION_FORMAT: FS_SecureSaveAction = 1; -#[doc = "Secure save control actions."] -#[doc = ""] - +#[doc = " Secure save control actions."] pub type FS_SecureSaveAction = ::libc::c_uint; pub const FILE_ACTION_UNKNOWN: FS_FileAction = 0; -#[doc = "File control actions."] -#[doc = ""] - +#[doc = " File control actions."] pub type FS_FileAction = ::libc::c_uint; pub const DIRECTORY_ACTION_UNKNOWN: FS_DirectoryAction = 0; -#[doc = "Directory control actions."] -#[doc = ""] - +#[doc = " Directory control actions."] pub type FS_DirectoryAction = ::libc::c_uint; -#[doc = "Directory entry."] -#[doc = ""] +#[doc = " Directory entry."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct FS_DirectoryEntry { - #[doc = "UTF-16 directory name."] - #[doc = ""] + #[doc = "< UTF-16 directory name."] pub name: [u16_; 262usize], - #[doc = "File name."] - #[doc = ""] + #[doc = "< File name."] pub shortName: [::libc::c_char; 10usize], - #[doc = "File extension."] - #[doc = ""] + #[doc = "< File extension."] pub shortExt: [::libc::c_char; 4usize], - #[doc = "Valid flag. (Always 1)"] - #[doc = ""] + #[doc = "< Valid flag. (Always 1)"] pub valid: u8_, - #[doc = "Reserved."] - #[doc = ""] + #[doc = "< Reserved."] pub reserved: u8_, - #[doc = "Attributes."] - #[doc = ""] + #[doc = "< Attributes."] pub attributes: u32_, - #[doc = "File size."] - #[doc = ""] + #[doc = "< File size."] pub fileSize: u64_, } impl Default for FS_DirectoryEntry { @@ -6607,36 +5320,28 @@ impl Default for FS_DirectoryEntry { } } } -#[doc = "Archive resource information."] -#[doc = ""] +#[doc = " Archive resource information."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct FS_ArchiveResource { - #[doc = "Size of each sector, in bytes."] - #[doc = ""] + #[doc = "< Size of each sector, in bytes."] pub sectorSize: u32_, - #[doc = "Size of each cluster, in bytes."] - #[doc = ""] + #[doc = "< Size of each cluster, in bytes."] pub clusterSize: u32_, - #[doc = "Total number of clusters."] - #[doc = ""] + #[doc = "< Total number of clusters."] pub totalClusters: u32_, - #[doc = "Number of free clusters."] - #[doc = ""] + #[doc = "< Number of free clusters."] pub freeClusters: u32_, } -#[doc = "Program information."] -#[doc = ""] +#[doc = " Program information."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct FS_ProgramInfo { - #[doc = "Program ID."] - #[doc = ""] + #[doc = "< Program ID."] pub programId: u64_, pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, - #[doc = "Padding."] - #[doc = ""] + #[doc = "< Padding."] pub padding: [u8_; 7usize], } impl Default for FS_ProgramInfo { @@ -6670,31 +5375,24 @@ impl FS_ProgramInfo { __bindgen_bitfield_unit } } -#[doc = "Product information."] -#[doc = ""] +#[doc = " Product information."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct FS_ProductInfo { - #[doc = "Product code."] - #[doc = ""] + #[doc = "< Product code."] pub productCode: [::libc::c_char; 16usize], - #[doc = "Company code."] - #[doc = ""] + #[doc = "< Company code."] pub companyCode: [::libc::c_char; 2usize], - #[doc = "Remaster version."] - #[doc = ""] + #[doc = "< Remaster version."] pub remasterVersion: u16_, } -#[doc = "Integrity verification seed."] -#[doc = ""] +#[doc = " Integrity verification seed."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct FS_IntegrityVerificationSeed { - #[doc = "AES-CBC MAC over a SHA256 hash, which hashes the first 0x110-bytes of the cleartext SEED."] - #[doc = ""] + #[doc = "< AES-CBC MAC over a SHA256 hash, which hashes the first 0x110-bytes of the cleartext SEED."] pub aesCbcMac: [u8_; 16usize], - #[doc = "The \"nand/private/movable.sed\", encrypted with AES-CTR using the above MAC for the counter."] - #[doc = ""] + #[doc = "< The \"nand/private/movable.sed\", encrypted with AES-CTR using the above MAC for the counter."] pub movableSed: [u8_; 288usize], } impl Default for FS_IntegrityVerificationSeed { @@ -6706,24 +5404,19 @@ impl Default for FS_IntegrityVerificationSeed { } } } -#[doc = "Ext save data information."] -#[doc = ""] +#[doc = " Ext save data information."] #[repr(C, packed)] #[derive(Debug, Copy, Clone)] pub struct FS_ExtSaveDataInfo { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, - #[doc = "Unknown."] - #[doc = ""] + #[doc = "< Unknown."] pub unknown: u8_, - #[doc = "Reserved."] - #[doc = ""] + #[doc = "< Reserved."] pub reserved1: u16_, - #[doc = "Save ID."] - #[doc = ""] + #[doc = "< Save ID."] pub saveId: u64_, - #[doc = "Reserved."] - #[doc = ""] + #[doc = "< Reserved."] pub reserved2: u32_, } impl Default for FS_ExtSaveDataInfo { @@ -6757,21 +5450,17 @@ impl FS_ExtSaveDataInfo { __bindgen_bitfield_unit } } -#[doc = "System save data information."] -#[doc = ""] +#[doc = " System save data information."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct FS_SystemSaveDataInfo { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, - #[doc = "Unknown."] - #[doc = ""] + #[doc = "< Unknown."] pub unknown: u8_, - #[doc = "Reserved."] - #[doc = ""] + #[doc = "< Reserved."] pub reserved: u16_, - #[doc = "Save ID."] - #[doc = ""] + #[doc = "< Save ID."] pub saveId: u32_, } impl Default for FS_SystemSaveDataInfo { @@ -6805,31 +5494,24 @@ impl FS_SystemSaveDataInfo { __bindgen_bitfield_unit } } -#[doc = "Device move context."] -#[doc = ""] +#[doc = " Device move context."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct FS_DeviceMoveContext { - #[doc = "IVs."] - #[doc = ""] + #[doc = "< IVs."] pub ivs: [u8_; 16usize], - #[doc = "Encrypt parameter."] - #[doc = ""] + #[doc = "< Encrypt parameter."] pub encryptParameter: [u8_; 16usize], } -#[doc = "Filesystem path data, detailing the specific target of an operation."] -#[doc = ""] +#[doc = " Filesystem path data, detailing the specific target of an operation."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct FS_Path { - #[doc = "FS path type."] - #[doc = ""] + #[doc = "< FS path type."] pub type_: FS_PathType, - #[doc = "FS path size."] - #[doc = ""] + #[doc = "< FS path size."] pub size: u32_, - #[doc = "Pointer to FS path data."] - #[doc = ""] + #[doc = "< Pointer to FS path data."] pub data: *const ::libc::c_void, } impl Default for FS_Path { @@ -6841,70 +5523,55 @@ impl Default for FS_Path { } } } -#[doc = "SDMC/NAND speed information"] -#[doc = ""] +#[doc = " SDMC/NAND speed information"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct FS_SdMmcSpeedInfo { - #[doc = "Whether or not High Speed Mode is enabled."] - #[doc = ""] + #[doc = "< Whether or not High Speed Mode is enabled."] pub highSpeedModeEnabled: bool, - #[doc = "Whether or not a clock divider of 2 is being used."] - #[doc = ""] + #[doc = "< Whether or not a clock divider of 2 is being used."] pub usesHighestClockRate: bool, - #[doc = "The value of the SD_CLK_CTRL register."] - #[doc = ""] + #[doc = "< The value of the SD_CLK_CTRL register."] pub sdClkCtrl: u16_, } -#[doc = "Filesystem archive handle, providing access to a filesystem's contents."] -#[doc = ""] - +#[doc = " Filesystem archive handle, providing access to a filesystem's contents."] pub type FS_Archive = u64_; extern "C" { #[must_use] - #[doc = "Initializes FS."] - #[doc = ""] + #[doc = " Initializes FS."] pub fn fsInit() -> Result; } extern "C" { - #[doc = "Exits FS."] - #[doc = ""] + #[doc = " Exits FS."] pub fn fsExit(); } extern "C" { - #[doc = "Sets the FSUSER session to use in the current thread.\n @param session The handle of the FSUSER session to use."] - #[doc = ""] + #[doc = " Sets the FSUSER session to use in the current thread.\n # Arguments\n\n* `session` - The handle of the FSUSER session to use."] pub fn fsUseSession(session: Handle); } extern "C" { - #[doc = "Disables the FSUSER session override in the current thread."] - #[doc = ""] + #[doc = " Disables the FSUSER session override in the current thread."] pub fn fsEndUseSession(); } extern "C" { - #[doc = "Exempts an archive from using alternate FS session handles provided with [`fsUseSession\n`] Instead, the archive will use the default FS session handle, opened with [`srvGetSessionHandle\n`] @param archive Archive to exempt."] - #[doc = ""] + #[doc = " Exempts an archive from using alternate FS session handles provided with fsUseSession\n Instead, the archive will use the default FS session handle, opened with srvGetSessionHandle\n # Arguments\n\n* `archive` - Archive to exempt."] pub fn fsExemptFromSession(archive: FS_Archive); } extern "C" { - #[doc = "Unexempts an archive from using alternate FS session handles provided with [`fsUseSession\n`] @param archive Archive to remove from the exemption list."] - #[doc = ""] + #[doc = " Unexempts an archive from using alternate FS session handles provided with fsUseSession\n # Arguments\n\n* `archive` - Archive to remove from the exemption list."] pub fn fsUnexemptFromSession(archive: FS_Archive); } extern "C" { - #[doc = "Creates an FS_Path instance.\n @param type Type of path.\n @param path Path to use.\n @return The created FS_Path instance."] - #[doc = ""] + #[doc = " Creates an FS_Path instance.\n # Arguments\n\n* `type` - Type of path.\n * `path` - Path to use.\n # Returns\n\nThe created FS_Path instance."] pub fn fsMakePath(type_: FS_PathType, path: *const ::libc::c_void) -> FS_Path; } extern "C" { - #[doc = "Gets the current FS session handle.\n @return The current FS session handle."] - #[doc = ""] + #[doc = " Gets the current FS session handle.\n # Returns\n\nThe current FS session handle."] pub fn fsGetSessionHandle() -> *mut Handle; } extern "C" { #[must_use] - #[doc = "Performs a control operation on the filesystem.\n @param action Action to perform.\n @param input Buffer to read input from.\n @param inputSize Size of the input.\n @param output Buffer to write output to.\n @param outputSize Size of the output."] - #[doc = ""] + #[doc = " Performs a control operation on the filesystem.\n # Arguments\n\n* `action` - Action to perform.\n * `input` - Buffer to read input from.\n * `inputSize` - Size of the input.\n * `output` - Buffer to write output to.\n * `outputSize` - Size of the output."] pub fn FSUSER_Control( action: FS_Action, input: *mut ::libc::c_void, @@ -6915,14 +5582,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Initializes a FSUSER session.\n @param session The handle of the FSUSER session to initialize."] - #[doc = ""] + #[doc = " Initializes a FSUSER session.\n # Arguments\n\n* `session` - The handle of the FSUSER session to initialize."] pub fn FSUSER_Initialize(session: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Opens a file.\n @param out Pointer to output the file handle to.\n @param archive Archive containing the file.\n @param path Path of the file.\n @param openFlags Flags to open the file with.\n @param attributes Attributes of the file."] - #[doc = ""] + #[doc = " Opens a file.\n # Arguments\n\n* `out` - Pointer to output the file handle to.\n * `archive` - Archive containing the file.\n * `path` - Path of the file.\n * `openFlags` - Flags to open the file with.\n * `attributes` - Attributes of the file."] pub fn FSUSER_OpenFile( out: *mut Handle, archive: FS_Archive, @@ -6933,8 +5598,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Opens a file directly, bypassing the requirement of an opened archive handle.\n @param out Pointer to output the file handle to.\n @param archiveId ID of the archive containing the file.\n @param archivePath Path of the archive containing the file.\n @param filePath Path of the file.\n @param openFlags Flags to open the file with.\n @param attributes Attributes of the file."] - #[doc = ""] + #[doc = " Opens a file directly, bypassing the requirement of an opened archive handle.\n # Arguments\n\n* `out` - Pointer to output the file handle to.\n * `archiveId` - ID of the archive containing the file.\n * `archivePath` - Path of the archive containing the file.\n * `filePath` - Path of the file.\n * `openFlags` - Flags to open the file with.\n * `attributes` - Attributes of the file."] pub fn FSUSER_OpenFileDirectly( out: *mut Handle, archiveId: FS_ArchiveID, @@ -6946,14 +5610,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Deletes a file.\n @param archive Archive containing the file.\n @param path Path of the file."] - #[doc = ""] + #[doc = " Deletes a file.\n # Arguments\n\n* `archive` - Archive containing the file.\n * `path` - Path of the file."] pub fn FSUSER_DeleteFile(archive: FS_Archive, path: FS_Path) -> Result; } extern "C" { #[must_use] - #[doc = "Renames a file.\n @param srcArchive Archive containing the source file.\n @param srcPath Path of the source file.\n @param dstArchive Archive containing the destination file.\n @param dstPath Path of the destination file."] - #[doc = ""] + #[doc = " Renames a file.\n # Arguments\n\n* `srcArchive` - Archive containing the source file.\n * `srcPath` - Path of the source file.\n * `dstArchive` - Archive containing the destination file.\n * `dstPath` - Path of the destination file."] pub fn FSUSER_RenameFile( srcArchive: FS_Archive, srcPath: FS_Path, @@ -6963,20 +5625,17 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Deletes a directory, failing if it is not empty.\n @param archive Archive containing the directory.\n @param path Path of the directory."] - #[doc = ""] + #[doc = " Deletes a directory, failing if it is not empty.\n # Arguments\n\n* `archive` - Archive containing the directory.\n * `path` - Path of the directory."] pub fn FSUSER_DeleteDirectory(archive: FS_Archive, path: FS_Path) -> Result; } extern "C" { #[must_use] - #[doc = "Deletes a directory, also deleting its contents.\n @param archive Archive containing the directory.\n @param path Path of the directory."] - #[doc = ""] + #[doc = " Deletes a directory, also deleting its contents.\n # Arguments\n\n* `archive` - Archive containing the directory.\n * `path` - Path of the directory."] pub fn FSUSER_DeleteDirectoryRecursively(archive: FS_Archive, path: FS_Path) -> Result; } extern "C" { #[must_use] - #[doc = "Creates a file.\n @param archive Archive to create the file in.\n @param path Path of the file.\n @param attributes Attributes of the file.\n @param fileSize Size of the file."] - #[doc = ""] + #[doc = " Creates a file.\n # Arguments\n\n* `archive` - Archive to create the file in.\n * `path` - Path of the file.\n * `attributes` - Attributes of the file.\n * `fileSize` - Size of the file."] pub fn FSUSER_CreateFile( archive: FS_Archive, path: FS_Path, @@ -6986,14 +5645,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Creates a directory\n @param archive Archive to create the directory in.\n @param path Path of the directory.\n @param attributes Attributes of the directory."] - #[doc = ""] + #[doc = " Creates a directory\n # Arguments\n\n* `archive` - Archive to create the directory in.\n * `path` - Path of the directory.\n * `attributes` - Attributes of the directory."] pub fn FSUSER_CreateDirectory(archive: FS_Archive, path: FS_Path, attributes: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Renames a directory.\n @param srcArchive Archive containing the source directory.\n @param srcPath Path of the source directory.\n @param dstArchive Archive containing the destination directory.\n @param dstPath Path of the destination directory."] - #[doc = ""] + #[doc = " Renames a directory.\n # Arguments\n\n* `srcArchive` - Archive containing the source directory.\n * `srcPath` - Path of the source directory.\n * `dstArchive` - Archive containing the destination directory.\n * `dstPath` - Path of the destination directory."] pub fn FSUSER_RenameDirectory( srcArchive: FS_Archive, srcPath: FS_Path, @@ -7003,20 +5660,17 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Opens a directory.\n @param out Pointer to output the directory handle to.\n @param archive Archive containing the directory.\n @param path Path of the directory."] - #[doc = ""] + #[doc = " Opens a directory.\n # Arguments\n\n* `out` - Pointer to output the directory handle to.\n * `archive` - Archive containing the directory.\n * `path` - Path of the directory."] pub fn FSUSER_OpenDirectory(out: *mut Handle, archive: FS_Archive, path: FS_Path) -> Result; } extern "C" { #[must_use] - #[doc = "Opens an archive.\n @param archive Pointer to output the opened archive to.\n @param id ID of the archive.\n @param path Path of the archive."] - #[doc = ""] + #[doc = " Opens an archive.\n # Arguments\n\n* `archive` - Pointer to output the opened archive to.\n * `id` - ID of the archive.\n * `path` - Path of the archive."] pub fn FSUSER_OpenArchive(archive: *mut FS_Archive, id: FS_ArchiveID, path: FS_Path) -> Result; } extern "C" { #[must_use] - #[doc = "Performs a control operation on an archive.\n @param archive Archive to control.\n @param action Action to perform.\n @param input Buffer to read input from.\n @param inputSize Size of the input.\n @param output Buffer to write output to.\n @param outputSize Size of the output."] - #[doc = ""] + #[doc = " Performs a control operation on an archive.\n # Arguments\n\n* `archive` - Archive to control.\n * `action` - Action to perform.\n * `input` - Buffer to read input from.\n * `inputSize` - Size of the input.\n * `output` - Buffer to write output to.\n * `outputSize` - Size of the output."] pub fn FSUSER_ControlArchive( archive: FS_Archive, action: FS_ArchiveAction, @@ -7028,140 +5682,117 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Closes an archive.\n @param archive Archive to close."] - #[doc = ""] + #[doc = " Closes an archive.\n # Arguments\n\n* `archive` - Archive to close."] pub fn FSUSER_CloseArchive(archive: FS_Archive) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the number of free bytes within an archive.\n @param freeBytes Pointer to output the free bytes to.\n @param archive Archive to check."] - #[doc = ""] + #[doc = " Gets the number of free bytes within an archive.\n # Arguments\n\n* `freeBytes` - Pointer to output the free bytes to.\n * `archive` - Archive to check."] pub fn FSUSER_GetFreeBytes(freeBytes: *mut u64_, archive: FS_Archive) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the inserted card type.\n @param type Pointer to output the card type to."] - #[doc = ""] + #[doc = " Gets the inserted card type.\n # Arguments\n\n* `type` - Pointer to output the card type to."] pub fn FSUSER_GetCardType(type_: *mut FS_CardType) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the SDMC archive resource information.\n @param archiveResource Pointer to output the archive resource information to."] - #[doc = ""] + #[doc = " Gets the SDMC archive resource information.\n # Arguments\n\n* `archiveResource` - Pointer to output the archive resource information to."] pub fn FSUSER_GetSdmcArchiveResource(archiveResource: *mut FS_ArchiveResource) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the NAND archive resource information.\n @param archiveResource Pointer to output the archive resource information to."] - #[doc = ""] + #[doc = " Gets the NAND archive resource information.\n # Arguments\n\n* `archiveResource` - Pointer to output the archive resource information to."] pub fn FSUSER_GetNandArchiveResource(archiveResource: *mut FS_ArchiveResource) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the last SDMC fatfs error.\n @param error Pointer to output the error to."] - #[doc = ""] + #[doc = " Gets the last SDMC fatfs error.\n # Arguments\n\n* `error` - Pointer to output the error to."] pub fn FSUSER_GetSdmcFatfsError(error: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets whether an SD card is detected.\n @param detected Pointer to output the detection status to."] - #[doc = ""] + #[doc = " Gets whether an SD card is detected.\n # Arguments\n\n* `detected` - Pointer to output the detection status to."] pub fn FSUSER_IsSdmcDetected(detected: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Gets whether the SD card is writable.\n @param writable Pointer to output the writable status to."] - #[doc = ""] + #[doc = " Gets whether the SD card is writable.\n # Arguments\n\n* `writable` - Pointer to output the writable status to."] pub fn FSUSER_IsSdmcWritable(writable: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the SDMC CID.\n @param out Pointer to output the CID to.\n @param length Length of the CID buffer. (should be 0x10)"] - #[doc = ""] + #[doc = " Gets the SDMC CID.\n # Arguments\n\n* `out` - Pointer to output the CID to.\n * `length` - Length of the CID buffer. (should be 0x10)"] pub fn FSUSER_GetSdmcCid(out: *mut u8_, length: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the NAND CID.\n @param out Pointer to output the CID to.\n @param length Length of the CID buffer. (should be 0x10)"] - #[doc = ""] + #[doc = " Gets the NAND CID.\n # Arguments\n\n* `out` - Pointer to output the CID to.\n * `length` - Length of the CID buffer. (should be 0x10)"] pub fn FSUSER_GetNandCid(out: *mut u8_, length: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the SDMC speed info.\n @param speedInfo Pointer to output the speed info to."] - #[doc = ""] + #[doc = " Gets the SDMC speed info.\n # Arguments\n\n* `speedInfo` - Pointer to output the speed info to."] pub fn FSUSER_GetSdmcSpeedInfo(speedInfo: *mut FS_SdMmcSpeedInfo) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the NAND speed info.\n @param speedInfo Pointer to output the speed info to."] - #[doc = ""] + #[doc = " Gets the NAND speed info.\n # Arguments\n\n* `speedInfo` - Pointer to output the speed info to."] pub fn FSUSER_GetNandSpeedInfo(speedInfo: *mut FS_SdMmcSpeedInfo) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the SDMC log.\n @param out Pointer to output the log to.\n @param length Length of the log buffer."] - #[doc = ""] + #[doc = " Gets the SDMC log.\n # Arguments\n\n* `out` - Pointer to output the log to.\n * `length` - Length of the log buffer."] pub fn FSUSER_GetSdmcLog(out: *mut u8_, length: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the NAND log.\n @param out Pointer to output the log to.\n @param length Length of the log buffer."] - #[doc = ""] + #[doc = " Gets the NAND log.\n # Arguments\n\n* `out` - Pointer to output the log to.\n * `length` - Length of the log buffer."] pub fn FSUSER_GetNandLog(out: *mut u8_, length: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Clears the SDMC log."] - #[doc = ""] + #[doc = " Clears the SDMC log."] pub fn FSUSER_ClearSdmcLog() -> Result; } extern "C" { #[must_use] - #[doc = "Clears the NAND log."] - #[doc = ""] + #[doc = " Clears the NAND log."] pub fn FSUSER_ClearNandLog() -> Result; } extern "C" { #[must_use] - #[doc = "Gets whether a card is inserted.\n @param inserted Pointer to output the insertion status to."] - #[doc = ""] + #[doc = " Gets whether a card is inserted.\n # Arguments\n\n* `inserted` - Pointer to output the insertion status to."] pub fn FSUSER_CardSlotIsInserted(inserted: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Powers on the card slot.\n @param status Pointer to output the power status to."] - #[doc = ""] + #[doc = " Powers on the card slot.\n # Arguments\n\n* `status` - Pointer to output the power status to."] pub fn FSUSER_CardSlotPowerOn(status: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Powers off the card slot.\n @param status Pointer to output the power status to."] - #[doc = ""] + #[doc = " Powers off the card slot.\n # Arguments\n\n* `status` - Pointer to output the power status to."] pub fn FSUSER_CardSlotPowerOff(status: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the card's power status.\n @param status Pointer to output the power status to."] - #[doc = ""] + #[doc = " Gets the card's power status.\n # Arguments\n\n* `status` - Pointer to output the power status to."] pub fn FSUSER_CardSlotGetCardIFPowerStatus(status: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Executes a CARDNOR direct command.\n @param commandId ID of the command."] - #[doc = ""] + #[doc = " Executes a CARDNOR direct command.\n # Arguments\n\n* `commandId` - ID of the command."] pub fn FSUSER_CardNorDirectCommand(commandId: u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Executes a CARDNOR direct command with an address.\n @param commandId ID of the command.\n @param address Address to provide."] - #[doc = ""] + #[doc = " Executes a CARDNOR direct command with an address.\n # Arguments\n\n* `commandId` - ID of the command.\n * `address` - Address to provide."] pub fn FSUSER_CardNorDirectCommandWithAddress(commandId: u8_, address: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Executes a CARDNOR direct read.\n @param commandId ID of the command.\n @param size Size of the output buffer.\n @param output Output buffer."] - #[doc = ""] + #[doc = " Executes a CARDNOR direct read.\n # Arguments\n\n* `commandId` - ID of the command.\n * `size` - Size of the output buffer.\n * `output` - Output buffer."] pub fn FSUSER_CardNorDirectRead( commandId: u8_, size: u32_, @@ -7170,8 +5801,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Executes a CARDNOR direct read with an address.\n @param commandId ID of the command.\n @param address Address to provide.\n @param size Size of the output buffer.\n @param output Output buffer."] - #[doc = ""] + #[doc = " Executes a CARDNOR direct read with an address.\n # Arguments\n\n* `commandId` - ID of the command.\n * `address` - Address to provide.\n * `size` - Size of the output buffer.\n * `output` - Output buffer."] pub fn FSUSER_CardNorDirectReadWithAddress( commandId: u8_, address: u32_, @@ -7181,8 +5811,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Executes a CARDNOR direct write.\n @param commandId ID of the command.\n @param size Size of the input buffer.\n @param output Input buffer."] - #[doc = ""] + #[doc = " Executes a CARDNOR direct write.\n # Arguments\n\n* `commandId` - ID of the command.\n * `size` - Size of the input buffer.\n * `output` - Input buffer."] pub fn FSUSER_CardNorDirectWrite( commandId: u8_, size: u32_, @@ -7191,8 +5820,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Executes a CARDNOR direct write with an address.\n @param commandId ID of the command.\n @param address Address to provide.\n @param size Size of the input buffer.\n @param input Input buffer."] - #[doc = ""] + #[doc = " Executes a CARDNOR direct write with an address.\n # Arguments\n\n* `commandId` - ID of the command.\n * `address` - Address to provide.\n * `size` - Size of the input buffer.\n * `input` - Input buffer."] pub fn FSUSER_CardNorDirectWriteWithAddress( commandId: u8_, address: u32_, @@ -7202,8 +5830,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Executes a CARDNOR 4xIO direct read.\n @param commandId ID of the command.\n @param address Address to provide.\n @param size Size of the output buffer.\n @param output Output buffer."] - #[doc = ""] + #[doc = " Executes a CARDNOR 4xIO direct read.\n # Arguments\n\n* `commandId` - ID of the command.\n * `address` - Address to provide.\n * `size` - Size of the output buffer.\n * `output` - Output buffer."] pub fn FSUSER_CardNorDirectRead_4xIO( commandId: u8_, address: u32_, @@ -7213,8 +5840,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Executes a CARDNOR direct CPU write without verify.\n @param address Address to provide.\n @param size Size of the input buffer.\n @param output Input buffer."] - #[doc = ""] + #[doc = " Executes a CARDNOR direct CPU write without verify.\n # Arguments\n\n* `address` - Address to provide.\n * `size` - Size of the input buffer.\n * `output` - Input buffer."] pub fn FSUSER_CardNorDirectCpuWriteWithoutVerify( address: u32_, size: u32_, @@ -7223,44 +5849,37 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Executes a CARDNOR direct sector erase without verify.\n @param address Address to provide."] - #[doc = ""] + #[doc = " Executes a CARDNOR direct sector erase without verify.\n # Arguments\n\n* `address` - Address to provide."] pub fn FSUSER_CardNorDirectSectorEraseWithoutVerify(address: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets a process's product info.\n @param info Pointer to output the product info to.\n @param processId ID of the process."] - #[doc = ""] + #[doc = " Gets a process's product info.\n # Arguments\n\n* `info` - Pointer to output the product info to.\n * `processId` - ID of the process."] pub fn FSUSER_GetProductInfo(info: *mut FS_ProductInfo, processId: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets a process's program launch info.\n @param info Pointer to output the program launch info to.\n @param processId ID of the process."] - #[doc = ""] + #[doc = " Gets a process's program launch info.\n # Arguments\n\n* `info` - Pointer to output the program launch info to.\n * `processId` - ID of the process."] pub fn FSUSER_GetProgramLaunchInfo(info: *mut FS_ProgramInfo, processId: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the CARDSPI baud rate.\n @param baudRate Baud rate to set."] - #[doc = ""] + #[doc = " Sets the CARDSPI baud rate.\n # Arguments\n\n* `baudRate` - Baud rate to set."] pub fn FSUSER_SetCardSpiBaudRate(baudRate: FS_CardSpiBaudRate) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the CARDSPI bus mode.\n @param busMode Bus mode to set."] - #[doc = ""] + #[doc = " Sets the CARDSPI bus mode.\n # Arguments\n\n* `busMode` - Bus mode to set."] pub fn FSUSER_SetCardSpiBusMode(busMode: FS_CardSpiBusMode) -> Result; } extern "C" { #[must_use] - #[doc = "Sends initialization info to ARM9."] - #[doc = ""] + #[doc = " Sends initialization info to ARM9."] pub fn FSUSER_SendInitializeInfoTo9() -> Result; } extern "C" { #[must_use] - #[doc = "Gets a special content's index.\n @param index Pointer to output the index to.\n @param mediaType Media type of the special content.\n @param programId Program ID owning the special content.\n @param type Type of special content."] - #[doc = ""] + #[doc = " Gets a special content's index.\n # Arguments\n\n* `index` - Pointer to output the index to.\n * `mediaType` - Media type of the special content.\n * `programId` - Program ID owning the special content.\n * `type` - Type of special content."] pub fn FSUSER_GetSpecialContentIndex( index: *mut u16_, mediaType: FS_MediaType, @@ -7270,8 +5889,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets the legacy ROM header of a program.\n @param mediaType Media type of the program.\n @param programId ID of the program.\n @param header Pointer to output the legacy ROM header to. (size = 0x3B4)"] - #[doc = ""] + #[doc = " Gets the legacy ROM header of a program.\n # Arguments\n\n* `mediaType` - Media type of the program.\n * `programId` - ID of the program.\n * `header` - Pointer to output the legacy ROM header to. (size = 0x3B4)"] pub fn FSUSER_GetLegacyRomHeader( mediaType: FS_MediaType, programId: u64_, @@ -7280,8 +5898,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets the legacy banner data of a program.\n @param mediaType Media type of the program.\n @param programId ID of the program.\n @param header Pointer to output the legacy banner data to. (size = 0x23C0)"] - #[doc = ""] + #[doc = " Gets the legacy banner data of a program.\n # Arguments\n\n* `mediaType` - Media type of the program.\n * `programId` - ID of the program.\n * `header` - Pointer to output the legacy banner data to. (size = 0x23C0)"] pub fn FSUSER_GetLegacyBannerData( mediaType: FS_MediaType, programId: u64_, @@ -7290,8 +5907,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Checks a process's authority to access a save data archive.\n @param access Pointer to output the access status to.\n @param mediaType Media type of the save data.\n @param saveId ID of the save data.\n @param processId ID of the process to check."] - #[doc = ""] + #[doc = " Checks a process's authority to access a save data archive.\n # Arguments\n\n* `access` - Pointer to output the access status to.\n * `mediaType` - Media type of the save data.\n * `saveId` - ID of the save data.\n * `processId` - ID of the process to check."] pub fn FSUSER_CheckAuthorityToAccessExtSaveData( access: *mut bool, mediaType: FS_MediaType, @@ -7301,8 +5917,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Queries the total quota size of a save data archive.\n @param quotaSize Pointer to output the quota size to.\n @param directories Number of directories.\n @param files Number of files.\n @param fileSizeCount Number of file sizes to provide.\n @param fileSizes File sizes to provide."] - #[doc = ""] + #[doc = " Queries the total quota size of a save data archive.\n # Arguments\n\n* `quotaSize` - Pointer to output the quota size to.\n * `directories` - Number of directories.\n * `files` - Number of files.\n * `fileSizeCount` - Number of file sizes to provide.\n * `fileSizes` - File sizes to provide."] pub fn FSUSER_QueryTotalQuotaSize( quotaSize: *mut u64_, directories: u32_, @@ -7313,38 +5928,32 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Abnegates an access right.\n @param accessRight Access right to abnegate."] - #[doc = ""] + #[doc = " Abnegates an access right.\n # Arguments\n\n* `accessRight` - Access right to abnegate."] pub fn FSUSER_AbnegateAccessRight(accessRight: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Deletes the 3DS SDMC root."] - #[doc = ""] + #[doc = " Deletes the 3DS SDMC root."] pub fn FSUSER_DeleteSdmcRoot() -> Result; } extern "C" { #[must_use] - #[doc = "Deletes all ext save data on the NAND."] - #[doc = ""] + #[doc = " Deletes all ext save data on the NAND."] pub fn FSUSER_DeleteAllExtSaveDataOnNand() -> Result; } extern "C" { #[must_use] - #[doc = "Initializes the CTR file system."] - #[doc = ""] + #[doc = " Initializes the CTR file system."] pub fn FSUSER_InitializeCtrFileSystem() -> Result; } extern "C" { #[must_use] - #[doc = "Creates the FS seed."] - #[doc = ""] + #[doc = " Creates the FS seed."] pub fn FSUSER_CreateSeed() -> Result; } extern "C" { #[must_use] - #[doc = "Retrieves archive format info.\n @param totalSize Pointer to output the total size to.\n @param directories Pointer to output the number of directories to.\n @param files Pointer to output the number of files to.\n @param duplicateData Pointer to output whether to duplicate data to.\n @param archiveId ID of the archive.\n @param path Path of the archive."] - #[doc = ""] + #[doc = " Retrieves archive format info.\n # Arguments\n\n* `totalSize` - Pointer to output the total size to.\n * `directories` - Pointer to output the number of directories to.\n * `files` - Pointer to output the number of files to.\n * `duplicateData` - Pointer to output whether to duplicate data to.\n * `archiveId` - ID of the archive.\n * `path` - Path of the archive."] pub fn FSUSER_GetFormatInfo( totalSize: *mut u32_, directories: *mut u32_, @@ -7356,8 +5965,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets the legacy ROM header of a program.\n @param headerSize Size of the ROM header.\n @param mediaType Media type of the program.\n @param programId ID of the program.\n @param header Pointer to output the legacy ROM header to."] - #[doc = ""] + #[doc = " Gets the legacy ROM header of a program.\n # Arguments\n\n* `headerSize` - Size of the ROM header.\n * `mediaType` - Media type of the program.\n * `programId` - ID of the program.\n * `header` - Pointer to output the legacy ROM header to."] pub fn FSUSER_GetLegacyRomHeader2( headerSize: u32_, mediaType: FS_MediaType, @@ -7367,14 +5975,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets the CTR SDMC root path.\n @param out Pointer to output the root path to.\n @param length Length of the output buffer."] - #[doc = ""] + #[doc = " Gets the CTR SDMC root path.\n # Arguments\n\n* `out` - Pointer to output the root path to.\n * `length` - Length of the output buffer."] pub fn FSUSER_GetSdmcCtrRootPath(out: *mut u8_, length: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets an archive's resource information.\n @param archiveResource Pointer to output the archive resource information to.\n @param mediaType System media type to check."] - #[doc = ""] + #[doc = " Gets an archive's resource information.\n # Arguments\n\n* `archiveResource` - Pointer to output the archive resource information to.\n * `mediaType` - System media type to check."] pub fn FSUSER_GetArchiveResource( archiveResource: *mut FS_ArchiveResource, mediaType: FS_SystemMediaType, @@ -7382,24 +5988,21 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Exports the integrity verification seed.\n @param seed Pointer to output the seed to."] - #[doc = ""] + #[doc = " Exports the integrity verification seed.\n # Arguments\n\n* `seed` - Pointer to output the seed to."] pub fn FSUSER_ExportIntegrityVerificationSeed( seed: *mut FS_IntegrityVerificationSeed, ) -> Result; } extern "C" { #[must_use] - #[doc = "Imports an integrity verification seed.\n @param seed Seed to import."] - #[doc = ""] + #[doc = " Imports an integrity verification seed.\n # Arguments\n\n* `seed` - Seed to import."] pub fn FSUSER_ImportIntegrityVerificationSeed( seed: *mut FS_IntegrityVerificationSeed, ) -> Result; } extern "C" { #[must_use] - #[doc = "Formats save data.\n @param archiveId ID of the save data archive.\n @param path Path of the save data.\n @param blocks Size of the save data in blocks. (512 bytes)\n @param directories Number of directories.\n @param files Number of files.\n @param directoryBuckets Directory hash tree bucket count.\n @param fileBuckets File hash tree bucket count.\n @param duplicateData Whether to store an internal duplicate of the data."] - #[doc = ""] + #[doc = " Formats save data.\n # Arguments\n\n* `archiveId` - ID of the save data archive.\n * `path` - Path of the save data.\n * `blocks` - Size of the save data in blocks. (512 bytes)\n * `directories` - Number of directories.\n * `files` - Number of files.\n * `directoryBuckets` - Directory hash tree bucket count.\n * `fileBuckets` - File hash tree bucket count.\n * `duplicateData` - Whether to store an internal duplicate of the data."] pub fn FSUSER_FormatSaveData( archiveId: FS_ArchiveID, path: FS_Path, @@ -7413,8 +6016,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets the legacy sub banner data of a program.\n @param bannerSize Size of the banner.\n @param mediaType Media type of the program.\n @param programId ID of the program.\n @param header Pointer to output the legacy sub banner data to."] - #[doc = ""] + #[doc = " Gets the legacy sub banner data of a program.\n # Arguments\n\n* `bannerSize` - Size of the banner.\n * `mediaType` - Media type of the program.\n * `programId` - ID of the program.\n * `header` - Pointer to output the legacy sub banner data to."] pub fn FSUSER_GetLegacySubBannerData( bannerSize: u32_, mediaType: FS_MediaType, @@ -7424,8 +6026,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Hashes the given data and outputs a SHA256 hash.\n @param data Pointer to the data to be hashed.\n @param inputSize The size of the data.\n @param hash Hash output pointer."] - #[doc = ""] + #[doc = " Hashes the given data and outputs a SHA256 hash.\n # Arguments\n\n* `data` - Pointer to the data to be hashed.\n * `inputSize` - The size of the data.\n * `hash` - Hash output pointer."] pub fn FSUSER_UpdateSha256Context( data: *const ::libc::c_void, inputSize: u32_, @@ -7434,8 +6035,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Reads from a special file.\n @param bytesRead Pointer to output the number of bytes read to.\n @param fileOffset Offset of the file.\n @param size Size of the buffer.\n @param data Buffer to read to."] - #[doc = ""] + #[doc = " Reads from a special file.\n # Arguments\n\n* `bytesRead` - Pointer to output the number of bytes read to.\n * `fileOffset` - Offset of the file.\n * `size` - Size of the buffer.\n * `data` - Buffer to read to."] pub fn FSUSER_ReadSpecialFile( bytesRead: *mut u32_, fileOffset: u64_, @@ -7445,14 +6045,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets the size of a special file.\n @param fileSize Pointer to output the size to."] - #[doc = ""] + #[doc = " Gets the size of a special file.\n # Arguments\n\n* `fileSize` - Pointer to output the size to."] pub fn FSUSER_GetSpecialFileSize(fileSize: *mut u64_) -> Result; } extern "C" { #[must_use] - #[doc = "Creates ext save data.\n @param info Info of the save data.\n @param directories Number of directories.\n @param files Number of files.\n @param sizeLimit Size limit of the save data.\n @param smdhSize Size of the save data's SMDH data.\n @param smdh SMDH data."] - #[doc = ""] + #[doc = " Creates ext save data.\n # Arguments\n\n* `info` - Info of the save data.\n * `directories` - Number of directories.\n * `files` - Number of files.\n * `sizeLimit` - Size limit of the save data.\n * `smdhSize` - Size of the save data's SMDH data.\n * `smdh` - SMDH data."] pub fn FSUSER_CreateExtSaveData( info: FS_ExtSaveDataInfo, directories: u32_, @@ -7464,14 +6062,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Deletes ext save data.\n @param info Info of the save data."] - #[doc = ""] + #[doc = " Deletes ext save data.\n # Arguments\n\n* `info` - Info of the save data."] pub fn FSUSER_DeleteExtSaveData(info: FS_ExtSaveDataInfo) -> Result; } extern "C" { #[must_use] - #[doc = "Reads the SMDH icon of ext save data.\n @param bytesRead Pointer to output the number of bytes read to.\n @param info Info of the save data.\n @param smdhSize Size of the save data SMDH.\n @param smdh Pointer to output SMDH data to."] - #[doc = ""] + #[doc = " Reads the SMDH icon of ext save data.\n # Arguments\n\n* `bytesRead` - Pointer to output the number of bytes read to.\n * `info` - Info of the save data.\n * `smdhSize` - Size of the save data SMDH.\n * `smdh` - Pointer to output SMDH data to."] pub fn FSUSER_ReadExtSaveDataIcon( bytesRead: *mut u32_, info: FS_ExtSaveDataInfo, @@ -7481,8 +6077,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets an ext data archive's block information.\n @param totalBlocks Pointer to output the total blocks to.\n @param freeBlocks Pointer to output the free blocks to.\n @param blockSize Pointer to output the block size to.\n @param info Info of the save data."] - #[doc = ""] + #[doc = " Gets an ext data archive's block information.\n # Arguments\n\n* `totalBlocks` - Pointer to output the total blocks to.\n * `freeBlocks` - Pointer to output the free blocks to.\n * `blockSize` - Pointer to output the block size to.\n * `info` - Info of the save data."] pub fn FSUSER_GetExtDataBlockSize( totalBlocks: *mut u64_, freeBlocks: *mut u64_, @@ -7492,8 +6087,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Enumerates ext save data.\n @param idsWritten Pointer to output the number of IDs written to.\n @param idsSize Size of the IDs buffer.\n @param mediaType Media type to enumerate over.\n @param idSize Size of each ID element.\n @param shared Whether to enumerate shared ext save data.\n @param ids Pointer to output IDs to."] - #[doc = ""] + #[doc = " Enumerates ext save data.\n # Arguments\n\n* `idsWritten` - Pointer to output the number of IDs written to.\n * `idsSize` - Size of the IDs buffer.\n * `mediaType` - Media type to enumerate over.\n * `idSize` - Size of each ID element.\n * `shared` - Whether to enumerate shared ext save data.\n * `ids` - Pointer to output IDs to."] pub fn FSUSER_EnumerateExtSaveData( idsWritten: *mut u32_, idsSize: u32_, @@ -7505,8 +6099,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Creates system save data.\n @param info Info of the save data.\n @param totalSize Total size of the save data.\n @param blockSize Block size of the save data. (usually 0x1000)\n @param directories Number of directories.\n @param files Number of files.\n @param directoryBuckets Directory hash tree bucket count.\n @param fileBuckets File hash tree bucket count.\n @param duplicateData Whether to store an internal duplicate of the data."] - #[doc = ""] + #[doc = " Creates system save data.\n # Arguments\n\n* `info` - Info of the save data.\n * `totalSize` - Total size of the save data.\n * `blockSize` - Block size of the save data. (usually 0x1000)\n * `directories` - Number of directories.\n * `files` - Number of files.\n * `directoryBuckets` - Directory hash tree bucket count.\n * `fileBuckets` - File hash tree bucket count.\n * `duplicateData` - Whether to store an internal duplicate of the data."] pub fn FSUSER_CreateSystemSaveData( info: FS_SystemSaveDataInfo, totalSize: u32_, @@ -7520,20 +6113,17 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Deletes system save data.\n @param info Info of the save data."] - #[doc = ""] + #[doc = " Deletes system save data.\n # Arguments\n\n* `info` - Info of the save data."] pub fn FSUSER_DeleteSystemSaveData(info: FS_SystemSaveDataInfo) -> Result; } extern "C" { #[must_use] - #[doc = "Initiates a device move as the source device.\n @param context Pointer to output the context to."] - #[doc = ""] + #[doc = " Initiates a device move as the source device.\n # Arguments\n\n* `context` - Pointer to output the context to."] pub fn FSUSER_StartDeviceMoveAsSource(context: *mut FS_DeviceMoveContext) -> Result; } extern "C" { #[must_use] - #[doc = "Initiates a device move as the destination device.\n @param context Context to use.\n @param clear Whether to clear the device's data first."] - #[doc = ""] + #[doc = " Initiates a device move as the destination device.\n # Arguments\n\n* `context` - Context to use.\n * `clear` - Whether to clear the device's data first."] pub fn FSUSER_StartDeviceMoveAsDestination( context: FS_DeviceMoveContext, clear: bool, @@ -7541,32 +6131,27 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Sets an archive's priority.\n @param archive Archive to use.\n @param priority Priority to set."] - #[doc = ""] + #[doc = " Sets an archive's priority.\n # Arguments\n\n* `archive` - Archive to use.\n * `priority` - Priority to set."] pub fn FSUSER_SetArchivePriority(archive: FS_Archive, priority: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets an archive's priority.\n @param priority Pointer to output the priority to.\n @param archive Archive to use."] - #[doc = ""] + #[doc = " Gets an archive's priority.\n # Arguments\n\n* `priority` - Pointer to output the priority to.\n * `archive` - Archive to use."] pub fn FSUSER_GetArchivePriority(priority: *mut u32_, archive: FS_Archive) -> Result; } extern "C" { #[must_use] - #[doc = "Configures CTRCARD latency emulation.\n @param latency Latency to apply, in milliseconds.\n @param emulateEndurance Whether to emulate card endurance."] - #[doc = ""] + #[doc = " Configures CTRCARD latency emulation.\n # Arguments\n\n* `latency` - Latency to apply, in milliseconds.\n * `emulateEndurance` - Whether to emulate card endurance."] pub fn FSUSER_SetCtrCardLatencyParameter(latency: u64_, emulateEndurance: bool) -> Result; } extern "C" { #[must_use] - #[doc = "Toggles cleaning up invalid save data.\n @param enable Whether to enable cleaning up invalid save data."] - #[doc = ""] + #[doc = " Toggles cleaning up invalid save data.\n # Arguments\n\n* `enable` - Whether to enable cleaning up invalid save data."] pub fn FSUSER_SwitchCleanupInvalidSaveData(enable: bool) -> Result; } extern "C" { #[must_use] - #[doc = "Enumerates system save data.\n @param idsWritten Pointer to output the number of IDs written to.\n @param idsSize Size of the IDs buffer.\n @param ids Pointer to output IDs to."] - #[doc = ""] + #[doc = " Enumerates system save data.\n # Arguments\n\n* `idsWritten` - Pointer to output the number of IDs written to.\n * `idsSize` - Size of the IDs buffer.\n * `ids` - Pointer to output IDs to."] pub fn FSUSER_EnumerateSystemSaveData( idsWritten: *mut u32_, idsSize: u32_, @@ -7575,26 +6160,22 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Initializes a FSUSER session with an SDK version.\n @param session The handle of the FSUSER session to initialize.\n @param version SDK version to initialize with."] - #[doc = ""] + #[doc = " Initializes a FSUSER session with an SDK version.\n # Arguments\n\n* `session` - The handle of the FSUSER session to initialize.\n * `version` - SDK version to initialize with."] pub fn FSUSER_InitializeWithSdkVersion(session: Handle, version: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the file system priority.\n @param priority Priority to set."] - #[doc = ""] + #[doc = " Sets the file system priority.\n # Arguments\n\n* `priority` - Priority to set."] pub fn FSUSER_SetPriority(priority: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the file system priority.\n @param priority Pointer to output the priority to."] - #[doc = ""] + #[doc = " Gets the file system priority.\n # Arguments\n\n* `priority` - Pointer to output the priority to."] pub fn FSUSER_GetPriority(priority: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the save data secure value.\n @param value Secure value to set.\n @param slot Slot of the secure value.\n @param titleUniqueId Unique ID of the title. (default = 0)\n @param titleVariation Variation of the title. (default = 0)"] - #[doc = ""] + #[doc = " Sets the save data secure value.\n # Arguments\n\n* `value` - Secure value to set.\n * `slot` - Slot of the secure value.\n * `titleUniqueId` - Unique ID of the title. (default = 0)\n * `titleVariation` - Variation of the title. (default = 0)"] pub fn FSUSER_SetSaveDataSecureValue( value: u64_, slot: FS_SecureValueSlot, @@ -7604,8 +6185,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets the save data secure value.\n @param exists Pointer to output whether the secure value exists to.\n @param value Pointer to output the secure value to.\n @param slot Slot of the secure value.\n @param titleUniqueId Unique ID of the title. (default = 0)\n @param titleVariation Variation of the title. (default = 0)"] - #[doc = ""] + #[doc = " Gets the save data secure value.\n # Arguments\n\n* `exists` - Pointer to output whether the secure value exists to.\n * `value` - Pointer to output the secure value to.\n * `slot` - Slot of the secure value.\n * `titleUniqueId` - Unique ID of the title. (default = 0)\n * `titleVariation` - Variation of the title. (default = 0)"] pub fn FSUSER_GetSaveDataSecureValue( exists: *mut bool, value: *mut u64_, @@ -7616,8 +6196,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Performs a control operation on a secure save.\n @param action Action to perform.\n @param input Buffer to read input from.\n @param inputSize Size of the input.\n @param output Buffer to write output to.\n @param outputSize Size of the output."] - #[doc = ""] + #[doc = " Performs a control operation on a secure save.\n # Arguments\n\n* `action` - Action to perform.\n * `input` - Buffer to read input from.\n * `inputSize` - Size of the input.\n * `output` - Buffer to write output to.\n * `outputSize` - Size of the output."] pub fn FSUSER_ControlSecureSave( action: FS_SecureSaveAction, input: *mut ::libc::c_void, @@ -7628,14 +6207,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets the media type of the current application.\n @param mediaType Pointer to output the media type to."] - #[doc = ""] + #[doc = " Gets the media type of the current application.\n # Arguments\n\n* `mediaType` - Pointer to output the media type to."] pub fn FSUSER_GetMediaType(mediaType: *mut FS_MediaType) -> Result; } extern "C" { #[must_use] - #[doc = "Performs a control operation on a file.\n @param handle Handle of the file.\n @param action Action to perform.\n @param input Buffer to read input from.\n @param inputSize Size of the input.\n @param output Buffer to write output to.\n @param outputSize Size of the output."] - #[doc = ""] + #[doc = " Performs a control operation on a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `action` - Action to perform.\n * `input` - Buffer to read input from.\n * `inputSize` - Size of the input.\n * `output` - Buffer to write output to.\n * `outputSize` - Size of the output."] pub fn FSFILE_Control( handle: Handle, action: FS_FileAction, @@ -7647,8 +6224,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Opens a handle to a sub-section of a file.\n @param handle Handle of the file.\n @param subFile Pointer to output the sub-file to.\n @param offset Offset of the sub-section.\n @param size Size of the sub-section."] - #[doc = ""] + #[doc = " Opens a handle to a sub-section of a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `subFile` - Pointer to output the sub-file to.\n * `offset` - Offset of the sub-section.\n * `size` - Size of the sub-section."] pub fn FSFILE_OpenSubFile( handle: Handle, subFile: *mut Handle, @@ -7658,8 +6234,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Reads from a file.\n @param handle Handle of the file.\n @param bytesRead Pointer to output the number of bytes read to.\n @param offset Offset to read from.\n @param buffer Buffer to read to.\n @param size Size of the buffer."] - #[doc = ""] + #[doc = " Reads from a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `bytesRead` - Pointer to output the number of bytes read to.\n * `offset` - Offset to read from.\n * `buffer` - Buffer to read to.\n * `size` - Size of the buffer."] pub fn FSFILE_Read( handle: Handle, bytesRead: *mut u32_, @@ -7670,8 +6245,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Writes to a file.\n @param handle Handle of the file.\n @param bytesWritten Pointer to output the number of bytes written to.\n @param offset Offset to write to.\n @param buffer Buffer to write from.\n @param size Size of the buffer.\n @param flags Flags to use when writing."] - #[doc = ""] + #[doc = " Writes to a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `bytesWritten` - Pointer to output the number of bytes written to.\n * `offset` - Offset to write to.\n * `buffer` - Buffer to write from.\n * `size` - Size of the buffer.\n * `flags` - Flags to use when writing."] pub fn FSFILE_Write( handle: Handle, bytesWritten: *mut u32_, @@ -7683,62 +6257,52 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets the size of a file.\n @param handle Handle of the file.\n @param size Pointer to output the size to."] - #[doc = ""] + #[doc = " Gets the size of a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `size` - Pointer to output the size to."] pub fn FSFILE_GetSize(handle: Handle, size: *mut u64_) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the size of a file.\n @param handle Handle of the file.\n @param size Size to set."] - #[doc = ""] + #[doc = " Sets the size of a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `size` - Size to set."] pub fn FSFILE_SetSize(handle: Handle, size: u64_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the attributes of a file.\n @param handle Handle of the file.\n @param attributes Pointer to output the attributes to."] - #[doc = ""] + #[doc = " Gets the attributes of a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `attributes` - Pointer to output the attributes to."] pub fn FSFILE_GetAttributes(handle: Handle, attributes: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the attributes of a file.\n @param handle Handle of the file.\n @param attributes Attributes to set."] - #[doc = ""] + #[doc = " Sets the attributes of a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `attributes` - Attributes to set."] pub fn FSFILE_SetAttributes(handle: Handle, attributes: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Closes a file.\n @param handle Handle of the file."] - #[doc = ""] + #[doc = " Closes a file.\n # Arguments\n\n* `handle` - Handle of the file."] pub fn FSFILE_Close(handle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Flushes a file's contents.\n @param handle Handle of the file."] - #[doc = ""] + #[doc = " Flushes a file's contents.\n # Arguments\n\n* `handle` - Handle of the file."] pub fn FSFILE_Flush(handle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Sets a file's priority.\n @param handle Handle of the file.\n @param priority Priority to set."] - #[doc = ""] + #[doc = " Sets a file's priority.\n # Arguments\n\n* `handle` - Handle of the file.\n * `priority` - Priority to set."] pub fn FSFILE_SetPriority(handle: Handle, priority: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets a file's priority.\n @param handle Handle of the file.\n @param priority Pointer to output the priority to."] - #[doc = ""] + #[doc = " Gets a file's priority.\n # Arguments\n\n* `handle` - Handle of the file.\n * `priority` - Pointer to output the priority to."] pub fn FSFILE_GetPriority(handle: Handle, priority: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Opens a duplicate handle to a file.\n @param handle Handle of the file.\n @param linkFile Pointer to output the link handle to."] - #[doc = ""] + #[doc = " Opens a duplicate handle to a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `linkFile` - Pointer to output the link handle to."] pub fn FSFILE_OpenLinkFile(handle: Handle, linkFile: *mut Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Performs a control operation on a directory.\n @param handle Handle of the directory.\n @param action Action to perform.\n @param input Buffer to read input from.\n @param inputSize Size of the input.\n @param output Buffer to write output to.\n @param outputSize Size of the output."] - #[doc = ""] + #[doc = " Performs a control operation on a directory.\n # Arguments\n\n* `handle` - Handle of the directory.\n * `action` - Action to perform.\n * `input` - Buffer to read input from.\n * `inputSize` - Size of the input.\n * `output` - Buffer to write output to.\n * `outputSize` - Size of the output."] pub fn FSDIR_Control( handle: Handle, action: FS_DirectoryAction, @@ -7750,8 +6314,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Reads one or more directory entries.\n @param handle Handle of the directory.\n @param entriesRead Pointer to output the number of entries read to.\n @param entryCount Number of entries to read.\n @param entryOut Pointer to output directory entries to."] - #[doc = ""] + #[doc = " Reads one or more directory entries.\n # Arguments\n\n* `handle` - Handle of the directory.\n * `entriesRead` - Pointer to output the number of entries read to.\n * `entryCount` - Number of entries to read.\n * `entryOut` - Pointer to output directory entries to."] pub fn FSDIR_Read( handle: Handle, entriesRead: *mut u32_, @@ -7761,189 +6324,130 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Closes a directory.\n @param handle Handle of the directory."] - #[doc = ""] + #[doc = " Closes a directory.\n # Arguments\n\n* `handle` - Handle of the directory."] pub fn FSDIR_Close(handle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Sets a directory's priority.\n @param handle Handle of the directory.\n @param priority Priority to set."] - #[doc = ""] + #[doc = " Sets a directory's priority.\n # Arguments\n\n* `handle` - Handle of the directory.\n * `priority` - Priority to set."] pub fn FSDIR_SetPriority(handle: Handle, priority: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets a directory's priority.\n @param handle Handle of the directory.\n @param priority Pointer to output the priority to."] - #[doc = ""] + #[doc = " Gets a directory's priority.\n # Arguments\n\n* `handle` - Handle of the directory.\n * `priority` - Pointer to output the priority to."] pub fn FSDIR_GetPriority(handle: Handle, priority: *mut u32_) -> Result; } -#[doc = "Contains basic information about a title."] -#[doc = ""] +#[doc = " Contains basic information about a title."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct AM_TitleEntry { - #[doc = "The title's ID."] - #[doc = ""] + #[doc = "< The title's ID."] pub titleID: u64_, - #[doc = "The title's installed size."] - #[doc = ""] + #[doc = "< The title's installed size."] pub size: u64_, - #[doc = "The title's version."] - #[doc = ""] + #[doc = "< The title's version."] pub version: u16_, - #[doc = "Unknown title data."] - #[doc = ""] + #[doc = "< Unknown title data."] pub unk: [u8_; 6usize], } -#[doc = "Titles currently installing."] -#[doc = ""] - +#[doc = "< Titles currently installing."] pub const AM_STATUS_MASK_INSTALLING: _bindgen_ty_13 = 1; -#[doc = "Titles awaiting finalization."] -#[doc = ""] - +#[doc = "< Titles awaiting finalization."] pub const AM_STATUS_MASK_AWAITING_FINALIZATION: _bindgen_ty_13 = 2; -#[doc = "Pending title status mask values."] -#[doc = ""] - +#[doc = " Pending title status mask values."] pub type _bindgen_ty_13 = ::libc::c_uint; -#[doc = "Install aborted."] -#[doc = ""] - +#[doc = "< Install aborted."] pub const AM_STATUS_ABORTED: AM_InstallStatus = 2; -#[doc = "Title saved, but not installed."] -#[doc = ""] - +#[doc = "< Title saved, but not installed."] pub const AM_STATUS_SAVED: AM_InstallStatus = 3; -#[doc = "Install in progress."] -#[doc = ""] - +#[doc = "< Install in progress."] pub const AM_STATUS_INSTALL_IN_PROGRESS: AM_InstallStatus = 2050; -#[doc = "Awaiting finalization."] -#[doc = ""] - +#[doc = "< Awaiting finalization."] pub const AM_STATUS_AWAITING_FINALIZATION: AM_InstallStatus = 2051; -#[doc = "Pending title status values."] -#[doc = ""] - +#[doc = " Pending title status values."] pub type AM_InstallStatus = ::libc::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct AM_PendingTitleEntry { - #[doc = "Title ID"] - #[doc = ""] + #[doc = "< Title ID"] pub titleId: u64_, - #[doc = "Version"] - #[doc = ""] + #[doc = "< Version"] pub version: u16_, - #[doc = "[`AM_InstallStatus`]"] - #[doc = ""] + #[doc = "< AM_InstallStatus"] pub status: u16_, - #[doc = "Title Type"] - #[doc = ""] + #[doc = "< Title Type"] pub titleType: u32_, - #[doc = "Unknown"] - #[doc = ""] + #[doc = "< Unknown"] pub unk: [u8_; 8usize], } -#[doc = "Non-system titles."] -#[doc = ""] - +#[doc = "< Non-system titles."] pub const AM_DELETE_PENDING_NON_SYSTEM: _bindgen_ty_14 = 1; -#[doc = "System titles."] -#[doc = ""] - +#[doc = "< System titles."] pub const AM_DELETE_PENDING_SYSTEM: _bindgen_ty_14 = 2; -#[doc = "Pending title deletion flags."] -#[doc = ""] - +#[doc = " Pending title deletion flags."] pub type _bindgen_ty_14 = ::libc::c_uint; -#[doc = "Information about the TWL NAND partition."] -#[doc = ""] +#[doc = " Information about the TWL NAND partition."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct AM_TWLPartitionInfo { - #[doc = "Total capacity."] - #[doc = ""] + #[doc = "< Total capacity."] pub capacity: u64_, - #[doc = "Total free space."] - #[doc = ""] + #[doc = "< Total free space."] pub freeSpace: u64_, - #[doc = "Capacity for titles."] - #[doc = ""] + #[doc = "< Capacity for titles."] pub titlesCapacity: u64_, - #[doc = "Free space for titles."] - #[doc = ""] + #[doc = "< Free space for titles."] pub titlesFreeSpace: u64_, } -#[doc = "Contains information about a title's content."] -#[doc = ""] +#[doc = " Contains information about a title's content."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct AM_ContentInfo { - #[doc = "Index of the content in the title."] - #[doc = ""] + #[doc = "< Index of the content in the title."] pub index: u16_, - #[doc = "?"] - #[doc = ""] + #[doc = "< ?"] pub type_: u16_, - #[doc = "ID of the content in the title."] - #[doc = ""] + #[doc = "< ID of the content in the title."] pub contentId: u32_, - #[doc = "Size of the content in the title."] - #[doc = ""] + #[doc = "< Size of the content in the title."] pub size: u64_, - #[doc = "[`AM_ContentInfoFlags`]"] - #[doc = ""] + #[doc = "< AM_ContentInfoFlags"] pub flags: u8_, - #[doc = "Padding"] - #[doc = ""] + #[doc = "< Padding"] pub padding: [u8_; 7usize], } -#[doc = "?"] -#[doc = ""] - +#[doc = "< ?"] pub const AM_CONTENT_DOWNLOADED: AM_ContentInfoFlags = 1; -#[doc = "?"] -#[doc = ""] - +#[doc = "< ?"] pub const AM_CONTENT_OWNED: AM_ContentInfoFlags = 2; -#[doc = "Title ContentInfo flags."] -#[doc = ""] - +#[doc = " Title ContentInfo flags."] pub type AM_ContentInfoFlags = ::libc::c_uint; extern "C" { #[must_use] - #[doc = "Initializes AM. This doesn't initialize with \"am:app\", see amAppInit()."] - #[doc = ""] + #[doc = " Initializes AM. This doesn't initialize with \"am:app\", see amAppInit()."] pub fn amInit() -> Result; } extern "C" { #[must_use] - #[doc = "Initializes AM with a service which has access to the amapp-commands. This should only be used when using the amapp commands, not non-amapp AM commands."] - #[doc = ""] + #[doc = " Initializes AM with a service which has access to the amapp-commands. This should only be used when using the amapp commands, not non-amapp AM commands."] pub fn amAppInit() -> Result; } extern "C" { - #[doc = "Exits AM."] - #[doc = ""] + #[doc = " Exits AM."] pub fn amExit(); } extern "C" { - #[doc = "Gets the current AM session handle."] - #[doc = ""] + #[doc = " Gets the current AM session handle."] pub fn amGetSessionHandle() -> *mut Handle; } extern "C" { #[must_use] - #[doc = "Gets the number of titles for a given media type.\n @param mediatype Media type to get titles from.\n @param[out] count Pointer to write the title count to."] - #[doc = ""] + #[doc = " Gets the number of titles for a given media type.\n # Arguments\n\n* `mediatype` - Media type to get titles from.\n * `count` (direction out) - Pointer to write the title count to."] pub fn AM_GetTitleCount(mediatype: FS_MediaType, count: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets a list of title IDs present in a mediatype.\n @param[out] titlesRead Pointer to output the number of read titles to.\n @param mediatype Media type to get titles from.\n @param titleCount Number of title IDs to get.\n @param titleIds Buffer to output the retrieved title IDs to."] - #[doc = ""] + #[doc = " Gets a list of title IDs present in a mediatype.\n # Arguments\n\n* `titlesRead` (direction out) - Pointer to output the number of read titles to.\n * `mediatype` - Media type to get titles from.\n * `titleCount` - Number of title IDs to get.\n * `titleIds` - Buffer to output the retrieved title IDs to."] pub fn AM_GetTitleList( titlesRead: *mut u32_, mediatype: FS_MediaType, @@ -7953,8 +6457,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets a list of details about installed titles.\n @param mediatype Media type to get titles from.\n @param titleCount Number of titles to list.\n @param titleIds List of title IDs to retrieve details for.\n @param titleInfo Buffer to write AM_TitleEntry's to."] - #[doc = ""] + #[doc = " Gets a list of details about installed titles.\n # Arguments\n\n* `mediatype` - Media type to get titles from.\n * `titleCount` - Number of titles to list.\n * `titleIds` - List of title IDs to retrieve details for.\n * `titleInfo` - Buffer to write AM_TitleEntry's to."] pub fn AM_GetTitleInfo( mediatype: FS_MediaType, titleCount: u32_, @@ -7964,14 +6467,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets the number of tickets installed on the system.\n @param[out] count Pointer to output the ticket count to."] - #[doc = ""] + #[doc = " Gets the number of tickets installed on the system.\n # Arguments\n\n* `count` (direction out) - Pointer to output the ticket count to."] pub fn AM_GetTicketCount(count: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets a list of tickets installed on the system.\n @param[out] ticketsRead Pointer to output the number of read tickets to.\n @param ticketCount Number of tickets to read.\n @param skip Number of tickets to skip.\n @param ticketIds Buffer to output the retrieved ticket IDs to."] - #[doc = ""] + #[doc = " Gets a list of tickets installed on the system.\n # Arguments\n\n* `ticketsRead` (direction out) - Pointer to output the number of read tickets to.\n * `ticketCount` - Number of tickets to read.\n * `skip` - Number of tickets to skip.\n * `ticketIds` - Buffer to output the retrieved ticket IDs to."] pub fn AM_GetTicketList( ticketsRead: *mut u32_, ticketCount: u32_, @@ -7981,8 +6482,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets the number of pending titles on this system.\n @param[out] count Pointer to output the pending title count to.\n @param mediatype Media type of pending titles to count.\n @param statusMask Bit mask of status values to include."] - #[doc = ""] + #[doc = " Gets the number of pending titles on this system.\n # Arguments\n\n* `count` (direction out) - Pointer to output the pending title count to.\n * `mediatype` - Media type of pending titles to count.\n * `statusMask` - Bit mask of status values to include."] pub fn AM_GetPendingTitleCount( count: *mut u32_, mediatype: FS_MediaType, @@ -7991,8 +6491,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets a list of pending titles on this system.\n @param[out] titlesRead Pointer to output the number of read pending titles to.\n @param titleCount Number of pending titles to read.\n @param mediatype Media type of pending titles to list.\n @param statusMask Bit mask of status values to include.\n @param titleIds Buffer to output the retrieved pending title IDs to."] - #[doc = ""] + #[doc = " Gets a list of pending titles on this system.\n # Arguments\n\n* `titlesRead` (direction out) - Pointer to output the number of read pending titles to.\n * `titleCount` - Number of pending titles to read.\n * `mediatype` - Media type of pending titles to list.\n * `statusMask` - Bit mask of status values to include.\n * `titleIds` - Buffer to output the retrieved pending title IDs to."] pub fn AM_GetPendingTitleList( titlesRead: *mut u32_, titleCount: u32_, @@ -8003,8 +6502,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets information about pending titles on this system.\n @param titleCount Number of pending titles to read.\n @param mediatype Media type of pending titles to get information on.\n @param titleIds IDs of the titles to get information about.\n @param titleInfo Buffer to output the retrieved pending title info to."] - #[doc = ""] + #[doc = " Gets information about pending titles on this system.\n # Arguments\n\n* `titleCount` - Number of pending titles to read.\n * `mediatype` - Media type of pending titles to get information on.\n * `titleIds` - IDs of the titles to get information about.\n * `titleInfo` - Buffer to output the retrieved pending title info to."] pub fn AM_GetPendingTitleInfo( titleCount: u32_, mediatype: FS_MediaType, @@ -8014,14 +6512,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets a 32-bit device-specific ID.\n @param deviceID Pointer to write the device ID to."] - #[doc = ""] + #[doc = " Gets a 32-bit device-specific ID.\n # Arguments\n\n* `deviceID` - Pointer to write the device ID to."] pub fn AM_GetDeviceId(deviceID: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Exports DSiWare to the specified filepath.\n @param titleID TWL titleID.\n @param operation DSiWare operation type.\n @param workbuf Work buffer.\n @param workbuf_size Work buffer size, must be >=0x20000.\n @param filepath UTF-8 filepath(converted to UTF-16 internally)."] - #[doc = ""] + #[doc = " Exports DSiWare to the specified filepath.\n # Arguments\n\n* `titleID` - TWL titleID.\n * `operation` - DSiWare operation type.\n * `workbuf` - Work buffer.\n * `workbuf_size` - Work buffer size, must be >=0x20000.\n * `filepath` - UTF-8 filepath(converted to UTF-16 internally)."] pub fn AM_ExportTwlBackup( titleID: u64_, operation: u8_, @@ -8032,8 +6528,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Imports DSiWare from the specified file.\n @param filehandle FSUSER file handle.\n @param operation DSiWare operation type.\n @param buffer Work buffer.\n @param size Buffer size, must be >=0x20000."] - #[doc = ""] + #[doc = " Imports DSiWare from the specified file.\n # Arguments\n\n* `filehandle` - FSUSER file handle.\n * `operation` - DSiWare operation type.\n * `buffer` - Work buffer.\n * `size` - Buffer size, must be >=0x20000."] pub fn AM_ImportTwlBackup( filehandle: Handle, operation: u8_, @@ -8043,8 +6538,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Reads info from the specified DSiWare export file. This can only be used with DSiWare exported with certain operation value(s).\n @param filehandle FSUSER file handle.\n @param outinfo Output info buffer.\n @param outinfo_size Output info buffer size.\n @param workbuf Work buffer.\n @param workbuf_size Work buffer size.\n @param banner Output banner buffer.\n @param banner_size Output banner buffer size."] - #[doc = ""] + #[doc = " Reads info from the specified DSiWare export file. This can only be used with DSiWare exported with certain operation value(s).\n # Arguments\n\n* `filehandle` - FSUSER file handle.\n * `outinfo` - Output info buffer.\n * `outinfo_size` - Output info buffer size.\n * `workbuf` - Work buffer.\n * `workbuf_size` - Work buffer size.\n * `banner` - Output banner buffer.\n * `banner_size` - Output banner buffer size."] pub fn AM_ReadTwlBackupInfo( filehandle: Handle, outinfo: *mut ::libc::c_void, @@ -8057,44 +6551,37 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Retrieves information about the NAND TWL partition.\n @param[out] info Pointer to output the TWL partition info to."] - #[doc = ""] + #[doc = " Retrieves information about the NAND TWL partition.\n # Arguments\n\n* `info` (direction out) - Pointer to output the TWL partition info to."] pub fn AM_GetTWLPartitionInfo(info: *mut AM_TWLPartitionInfo) -> Result; } extern "C" { #[must_use] - #[doc = "Initializes the CIA install process, returning a handle to write CIA data to.\n @param mediatype Media type to install the CIA to.\n @param[out] ciaHandle Pointer to write the CIA handle to."] - #[doc = ""] + #[doc = " Initializes the CIA install process, returning a handle to write CIA data to.\n # Arguments\n\n* `mediatype` - Media type to install the CIA to.\n * `ciaHandle` (direction out) - Pointer to write the CIA handle to."] pub fn AM_StartCiaInstall(mediatype: FS_MediaType, ciaHandle: *mut Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Initializes the CIA install process for Download Play CIAs, returning a handle to write CIA data to.\n @param[out] ciaHandle Pointer to write the CIA handle to."] - #[doc = ""] + #[doc = " Initializes the CIA install process for Download Play CIAs, returning a handle to write CIA data to.\n # Arguments\n\n* `ciaHandle` (direction out) - Pointer to write the CIA handle to."] pub fn AM_StartDlpChildCiaInstall(ciaHandle: *mut Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Aborts the CIA install process.\n @param ciaHandle CIA handle to cancel."] - #[doc = ""] + #[doc = " Aborts the CIA install process.\n # Arguments\n\n* `ciaHandle` - CIA handle to cancel."] pub fn AM_CancelCIAInstall(ciaHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Finalizes the CIA install process.\n @param ciaHandle CIA handle to finalize."] - #[doc = ""] + #[doc = " Finalizes the CIA install process.\n # Arguments\n\n* `ciaHandle` - CIA handle to finalize."] pub fn AM_FinishCiaInstall(ciaHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Finalizes the CIA install process without committing the title to title.db or tmp*.db.\n @param ciaHandle CIA handle to finalize."] - #[doc = ""] + #[doc = " Finalizes the CIA install process without committing the title to title.db or tmp*.db.\n # Arguments\n\n* `ciaHandle` - CIA handle to finalize."] pub fn AM_FinishCiaInstallWithoutCommit(ciaHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Commits installed CIAs.\n @param mediaType Location of the titles to finalize.\n @param titleCount Number of titles to finalize.\n @param temp Whether the titles being finalized are in the temporary database.\n @param titleIds Title IDs to finalize."] - #[doc = ""] + #[doc = " Commits installed CIAs.\n # Arguments\n\n* `mediaType` - Location of the titles to finalize.\n * `titleCount` - Number of titles to finalize.\n * `temp` - Whether the titles being finalized are in the temporary database.\n * `titleIds` - Title IDs to finalize."] pub fn AM_CommitImportPrograms( mediaType: FS_MediaType, titleCount: u32_, @@ -8104,56 +6591,47 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Deletes a title.\n @param mediatype Media type to delete from.\n @param titleID ID of the title to delete."] - #[doc = ""] + #[doc = " Deletes a title.\n # Arguments\n\n* `mediatype` - Media type to delete from.\n * `titleID` - ID of the title to delete."] pub fn AM_DeleteTitle(mediatype: FS_MediaType, titleID: u64_) -> Result; } extern "C" { #[must_use] - #[doc = "Deletes a title, provided that it is not a system title.\n @param mediatype Media type to delete from.\n @param titleID ID of the title to delete."] - #[doc = ""] + #[doc = " Deletes a title, provided that it is not a system title.\n # Arguments\n\n* `mediatype` - Media type to delete from.\n * `titleID` - ID of the title to delete."] pub fn AM_DeleteAppTitle(mediatype: FS_MediaType, titleID: u64_) -> Result; } extern "C" { #[must_use] - #[doc = "Deletes a ticket.\n @param titleID ID of the ticket to delete."] - #[doc = ""] + #[doc = " Deletes a ticket.\n # Arguments\n\n* `titleID` - ID of the ticket to delete."] pub fn AM_DeleteTicket(ticketId: u64_) -> Result; } extern "C" { #[must_use] - #[doc = "Deletes a pending title.\n @param mediatype Media type to delete from.\n @param titleId ID of the pending title to delete."] - #[doc = ""] + #[doc = " Deletes a pending title.\n # Arguments\n\n* `mediatype` - Media type to delete from.\n * `titleId` - ID of the pending title to delete."] pub fn AM_DeletePendingTitle(mediatype: FS_MediaType, titleId: u64_) -> Result; } extern "C" { #[must_use] - #[doc = "Deletes pending titles.\n @param mediatype Media type to delete from.\n @param flags Flags used to select pending titles."] - #[doc = ""] + #[doc = " Deletes pending titles.\n # Arguments\n\n* `mediatype` - Media type to delete from.\n * `flags` - Flags used to select pending titles."] pub fn AM_DeletePendingTitles(mediatype: FS_MediaType, flags: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Deletes all pending titles.\n @param mediatype Media type to delete from."] - #[doc = ""] + #[doc = " Deletes all pending titles.\n # Arguments\n\n* `mediatype` - Media type to delete from."] pub fn AM_DeleteAllPendingTitles(mediatype: FS_MediaType) -> Result; } extern "C" { #[must_use] - #[doc = "Installs the current NATIVE_FIRM title to NAND (firm0:/ & firm1:/)"] - #[doc = ""] + #[doc = " Installs the current NATIVE_FIRM title to NAND (firm0:/ & firm1:/)"] pub fn AM_InstallNativeFirm() -> Result; } extern "C" { #[must_use] - #[doc = "Installs a NATIVE_FIRM title to NAND. Accepts 0004013800000002 or 0004013820000002 (N3DS).\n @param titleID Title ID of the NATIVE_FIRM to install."] - #[doc = ""] + #[doc = " Installs a NATIVE_FIRM title to NAND. Accepts 0004013800000002 or 0004013820000002 (N3DS).\n # Arguments\n\n* `titleID` - Title ID of the NATIVE_FIRM to install."] pub fn AM_InstallFirm(titleID: u64_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the product code of a title.\n @param mediatype Media type of the title.\n @param titleID ID of the title.\n @param[out] productCode Pointer to output the product code to. (length = 16)"] - #[doc = ""] + #[doc = " Gets the product code of a title.\n # Arguments\n\n* `mediatype` - Media type of the title.\n * `titleID` - ID of the title.\n * `productCode` (direction out) - Pointer to output the product code to. (length = 16)"] pub fn AM_GetTitleProductCode( mediatype: FS_MediaType, titleId: u64_, @@ -8162,8 +6640,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets the ext data ID of a title.\n @param[out] extDataId Pointer to output the ext data ID to.\n @param mediatype Media type of the title.\n @param titleID ID of the title."] - #[doc = ""] + #[doc = " Gets the ext data ID of a title.\n # Arguments\n\n* `extDataId` (direction out) - Pointer to output the ext data ID to.\n * `mediatype` - Media type of the title.\n * `titleID` - ID of the title."] pub fn AM_GetTitleExtDataId( extDataId: *mut u64_, mediatype: FS_MediaType, @@ -8172,8 +6649,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets an AM_TitleEntry instance for a CIA file.\n @param mediatype Media type that this CIA would be installed to.\n @param[out] titleEntry Pointer to write the AM_TitleEntry instance to.\n @param fileHandle Handle of the CIA file."] - #[doc = ""] + #[doc = " Gets an AM_TitleEntry instance for a CIA file.\n # Arguments\n\n* `mediatype` - Media type that this CIA would be installed to.\n * `titleEntry` (direction out) - Pointer to write the AM_TitleEntry instance to.\n * `fileHandle` - Handle of the CIA file."] pub fn AM_GetCiaFileInfo( mediatype: FS_MediaType, titleEntry: *mut AM_TitleEntry, @@ -8182,32 +6658,27 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets the SMDH icon data of a CIA file.\n @param icon Buffer to store the icon data in. Must be of size 0x36C0 bytes.\n @param fileHandle Handle of the CIA file."] - #[doc = ""] + #[doc = " Gets the SMDH icon data of a CIA file.\n # Arguments\n\n* `icon` - Buffer to store the icon data in. Must be of size 0x36C0 bytes.\n * `fileHandle` - Handle of the CIA file."] pub fn AM_GetCiaIcon(icon: *mut ::libc::c_void, fileHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the title ID dependency list of a CIA file.\n @param dependencies Buffer to store dependency title IDs in. Must be of size 0x300 bytes.\n @param fileHandle Handle of the CIA file."] - #[doc = ""] + #[doc = " Gets the title ID dependency list of a CIA file.\n # Arguments\n\n* `dependencies` - Buffer to store dependency title IDs in. Must be of size 0x300 bytes.\n * `fileHandle` - Handle of the CIA file."] pub fn AM_GetCiaDependencies(dependencies: *mut u64_, fileHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the meta section offset of a CIA file.\n @param[out] metaOffset Pointer to output the meta section offset to.\n @param fileHandle Handle of the CIA file."] - #[doc = ""] + #[doc = " Gets the meta section offset of a CIA file.\n # Arguments\n\n* `metaOffset` (direction out) - Pointer to output the meta section offset to.\n * `fileHandle` - Handle of the CIA file."] pub fn AM_GetCiaMetaOffset(metaOffset: *mut u64_, fileHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the core version of a CIA file.\n @param[out] coreVersion Pointer to output the core version to.\n @param fileHandle Handle of the CIA file."] - #[doc = ""] + #[doc = " Gets the core version of a CIA file.\n # Arguments\n\n* `coreVersion` (direction out) - Pointer to output the core version to.\n * `fileHandle` - Handle of the CIA file."] pub fn AM_GetCiaCoreVersion(coreVersion: *mut u32_, fileHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the free space, in bytes, required to install a CIA file.\n @param[out] requiredSpace Pointer to output the required free space to.\n @param mediaType Media type to check free space needed to install to.\n @param fileHandle Handle of the CIA file."] - #[doc = ""] + #[doc = " Gets the free space, in bytes, required to install a CIA file.\n # Arguments\n\n* `requiredSpace` (direction out) - Pointer to output the required free space to.\n * `mediaType` - Media type to check free space needed to install to.\n * `fileHandle` - Handle of the CIA file."] pub fn AM_GetCiaRequiredSpace( requiredSpace: *mut u64_, mediaType: FS_MediaType, @@ -8216,8 +6687,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets the full meta section of a CIA file.\n @param meta Buffer to store the meta section in.\n @param size Size of the buffer. Must be greater than or equal to the actual section data's size.\n @param fileHandle Handle of the CIA file."] - #[doc = ""] + #[doc = " Gets the full meta section of a CIA file.\n # Arguments\n\n* `meta` - Buffer to store the meta section in.\n * `size` - Size of the buffer. Must be greater than or equal to the actual section data's size.\n * `fileHandle` - Handle of the CIA file."] pub fn AM_GetCiaMetaSection( meta: *mut ::libc::c_void, size: u32_, @@ -8226,68 +6696,57 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Initializes the external (SD) title database.\n @param overwrite Overwrites the database if it already exists."] - #[doc = ""] + #[doc = " Initializes the external (SD) title database.\n # Arguments\n\n* `overwrite` - Overwrites the database if it already exists."] pub fn AM_InitializeExternalTitleDatabase(overwrite: bool) -> Result; } extern "C" { #[must_use] - #[doc = "Queries whether the external title database is available.\n @param[out] available Pointer to output the availability status to."] - #[doc = ""] + #[doc = " Queries whether the external title database is available.\n # Arguments\n\n* `available` (direction out) - Pointer to output the availability status to."] pub fn AM_QueryAvailableExternalTitleDatabase(available: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Begins installing a ticket.\n @param[out] ticketHandle Pointer to output a handle to write ticket data to."] - #[doc = ""] + #[doc = " Begins installing a ticket.\n # Arguments\n\n* `ticketHandle` (direction out) - Pointer to output a handle to write ticket data to."] pub fn AM_InstallTicketBegin(ticketHandle: *mut Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Aborts installing a ticket.\n @param ticketHandle Handle of the installation to abort."] - #[doc = ""] + #[doc = " Aborts installing a ticket.\n # Arguments\n\n* `ticketHandle` - Handle of the installation to abort."] pub fn AM_InstallTicketAbort(ticketHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Finishes installing a ticket.\n @param ticketHandle Handle of the installation to finalize."] - #[doc = ""] + #[doc = " Finishes installing a ticket.\n # Arguments\n\n* `ticketHandle` - Handle of the installation to finalize."] pub fn AM_InstallTicketFinish(ticketHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Begins installing a title.\n @param mediaType Destination to install to.\n @param titleId ID of the title to install.\n @param unk Unknown. (usually false)"] - #[doc = ""] + #[doc = " Begins installing a title.\n # Arguments\n\n* `mediaType` - Destination to install to.\n * `titleId` - ID of the title to install.\n * `unk` - Unknown. (usually false)"] pub fn AM_InstallTitleBegin(mediaType: FS_MediaType, titleId: u64_, unk: bool) -> Result; } extern "C" { #[must_use] - #[doc = "Stops installing a title, generally to be resumed later."] - #[doc = ""] + #[doc = " Stops installing a title, generally to be resumed later."] pub fn AM_InstallTitleStop() -> Result; } extern "C" { #[must_use] - #[doc = "Resumes installing a title.\n @param mediaType Destination to install to.\n @param titleId ID of the title to install."] - #[doc = ""] + #[doc = " Resumes installing a title.\n # Arguments\n\n* `mediaType` - Destination to install to.\n * `titleId` - ID of the title to install."] pub fn AM_InstallTitleResume(mediaType: FS_MediaType, titleId: u64_) -> Result; } extern "C" { #[must_use] - #[doc = "Aborts installing a title."] - #[doc = ""] + #[doc = " Aborts installing a title."] pub fn AM_InstallTitleAbort() -> Result; } extern "C" { #[must_use] - #[doc = "Finishes installing a title."] - #[doc = ""] + #[doc = " Finishes installing a title."] pub fn AM_InstallTitleFinish() -> Result; } extern "C" { #[must_use] - #[doc = "Commits installed titles.\n @param mediaType Location of the titles to finalize.\n @param titleCount Number of titles to finalize.\n @param temp Whether the titles being finalized are in the temporary database.\n @param titleIds Title IDs to finalize."] - #[doc = ""] + #[doc = " Commits installed titles.\n # Arguments\n\n* `mediaType` - Location of the titles to finalize.\n * `titleCount` - Number of titles to finalize.\n * `temp` - Whether the titles being finalized are in the temporary database.\n * `titleIds` - Title IDs to finalize."] pub fn AM_CommitImportTitles( mediaType: FS_MediaType, titleCount: u32_, @@ -8297,44 +6756,37 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Begins installing a TMD.\n @param[out] tmdHandle Pointer to output a handle to write TMD data to."] - #[doc = ""] + #[doc = " Begins installing a TMD.\n # Arguments\n\n* `tmdHandle` (direction out) - Pointer to output a handle to write TMD data to."] pub fn AM_InstallTmdBegin(tmdHandle: *mut Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Aborts installing a TMD.\n @param tmdHandle Handle of the installation to abort."] - #[doc = ""] + #[doc = " Aborts installing a TMD.\n # Arguments\n\n* `tmdHandle` - Handle of the installation to abort."] pub fn AM_InstallTmdAbort(tmdHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Finishes installing a TMD.\n @param tmdHandle Handle of the installation to finalize.\n @param unk Unknown. (usually true)"] - #[doc = ""] + #[doc = " Finishes installing a TMD.\n # Arguments\n\n* `tmdHandle` - Handle of the installation to finalize.\n * `unk` - Unknown. (usually true)"] pub fn AM_InstallTmdFinish(tmdHandle: Handle, unk: bool) -> Result; } extern "C" { #[must_use] - #[doc = "Prepares to import title contents.\n @param contentCount Number of contents to be imported.\n @param contentIndices Indices of the contents to be imported."] - #[doc = ""] + #[doc = " Prepares to import title contents.\n # Arguments\n\n* `contentCount` - Number of contents to be imported.\n * `contentIndices` - Indices of the contents to be imported."] pub fn AM_CreateImportContentContexts(contentCount: u32_, contentIndices: *mut u16_) -> Result; } extern "C" { #[must_use] - #[doc = "Begins installing title content.\n @param[out] contentHandle Pointer to output a handle to write content data to.\n @param index Index of the content to install."] - #[doc = ""] + #[doc = " Begins installing title content.\n # Arguments\n\n* `contentHandle` (direction out) - Pointer to output a handle to write content data to.\n * `index` - Index of the content to install."] pub fn AM_InstallContentBegin(contentHandle: *mut Handle, index: u16_) -> Result; } extern "C" { #[must_use] - #[doc = "Stops installing title content, generally to be resumed later.\n @param contentHandle Handle of the installation to abort."] - #[doc = ""] + #[doc = " Stops installing title content, generally to be resumed later.\n # Arguments\n\n* `contentHandle` - Handle of the installation to abort."] pub fn AM_InstallContentStop(contentHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Resumes installing title content.\n @param[out] contentHandle Pointer to output a handle to write content data to.\n @param[out] resumeOffset Pointer to write the offset to resume content installation at to.\n @param index Index of the content to install."] - #[doc = ""] + #[doc = " Resumes installing title content.\n # Arguments\n\n* `contentHandle` (direction out) - Pointer to output a handle to write content data to.\n * `resumeOffset` (direction out) - Pointer to write the offset to resume content installation at to.\n * `index` - Index of the content to install."] pub fn AM_InstallContentResume( contentHandle: *mut Handle, resumeOffset: *mut u64_, @@ -8343,20 +6795,17 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Cancels installing title content.\n @param contentHandle Handle of the installation to finalize."] - #[doc = ""] + #[doc = " Cancels installing title content.\n # Arguments\n\n* `contentHandle` - Handle of the installation to finalize."] pub fn AM_InstallContentCancel(contentHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Finishes installing title content.\n @param contentHandle Handle of the installation to finalize."] - #[doc = ""] + #[doc = " Finishes installing title content.\n # Arguments\n\n* `contentHandle` - Handle of the installation to finalize."] pub fn AM_InstallContentFinish(contentHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Imports up to four certificates into the ticket certificate chain.\n @param cert1Size Size of the first certificate.\n @param cert1 Data of the first certificate.\n @param cert2Size Size of the second certificate.\n @param cert2 Data of the second certificate.\n @param cert3Size Size of the third certificate.\n @param cert3 Data of the third certificate.\n @param cert4Size Size of the fourth certificate.\n @param cert4 Data of the fourth certificate."] - #[doc = ""] + #[doc = " Imports up to four certificates into the ticket certificate chain.\n # Arguments\n\n* `cert1Size` - Size of the first certificate.\n * `cert1` - Data of the first certificate.\n * `cert2Size` - Size of the second certificate.\n * `cert2` - Data of the second certificate.\n * `cert3Size` - Size of the third certificate.\n * `cert3` - Data of the third certificate.\n * `cert4Size` - Size of the fourth certificate.\n * `cert4` - Data of the fourth certificate."] pub fn AM_ImportCertificates( cert1Size: u32_, cert1: *mut ::libc::c_void, @@ -8370,14 +6819,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Imports a certificate into the ticket certificate chain.\n @param certSize Size of the certificate.\n @param cert Data of the certificate."] - #[doc = ""] + #[doc = " Imports a certificate into the ticket certificate chain.\n # Arguments\n\n* `certSize` - Size of the certificate.\n * `cert` - Data of the certificate."] pub fn AM_ImportCertificate(certSize: u32_, cert: *mut ::libc::c_void) -> Result; } extern "C" { #[must_use] - #[doc = "Commits installed titles, and updates FIRM if necessary.\n @param mediaType Location of the titles to finalize.\n @param titleCount Number of titles to finalize.\n @param temp Whether the titles being finalized are in the temporary database.\n @param titleIds Title IDs to finalize."] - #[doc = ""] + #[doc = " Commits installed titles, and updates FIRM if necessary.\n # Arguments\n\n* `mediaType` - Location of the titles to finalize.\n * `titleCount` - Number of titles to finalize.\n * `temp` - Whether the titles being finalized are in the temporary database.\n * `titleIds` - Title IDs to finalize."] pub fn AM_CommitImportTitlesAndUpdateFirmwareAuto( mediaType: FS_MediaType, titleCount: u32_, @@ -8387,32 +6834,27 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Resets play count of all installed demos by deleting their launch info."] - #[doc = ""] + #[doc = " Resets play count of all installed demos by deleting their launch info."] pub fn AM_DeleteAllDemoLaunchInfos() -> Result; } extern "C" { #[must_use] - #[doc = "Deletes temporary titles."] - #[doc = ""] + #[doc = " Deletes temporary titles."] pub fn AM_DeleteAllTemporaryTitles() -> Result; } extern "C" { #[must_use] - #[doc = "Deletes all expired titles.\n @param mediatype Media type to delete from."] - #[doc = ""] + #[doc = " Deletes all expired titles.\n # Arguments\n\n* `mediatype` - Media type to delete from."] pub fn AM_DeleteAllExpiredTitles(mediatype: FS_MediaType) -> Result; } extern "C" { #[must_use] - #[doc = "Deletes all TWL titles."] - #[doc = ""] + #[doc = " Deletes all TWL titles."] pub fn AM_DeleteAllTwlTitles() -> Result; } extern "C" { #[must_use] - #[doc = "Gets the number of content index installed under the specified DLC title.\n @param[out] count Pointer to output the number of content indices to.\n @param mediatype Media type of the title.\n @param titleID Title ID to retrieve the count for (high-id is 0x0004008C)."] - #[doc = ""] + #[doc = " Gets the number of content index installed under the specified DLC title.\n # Arguments\n\n* `count` (direction out) - Pointer to output the number of content indices to.\n * `mediatype` - Media type of the title.\n * `titleID` - Title ID to retrieve the count for (high-id is 0x0004008C)."] pub fn AMAPP_GetDLCContentInfoCount( count: *mut u32_, mediatype: FS_MediaType, @@ -8421,8 +6863,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets content infos installed under the specified DLC title.\n @param[out] contentInfoRead Pointer to output the number of content infos read to.\n @param mediatype Media type of the title.\n @param titleID Title ID to retrieve the content infos for (high-id is 0x0004008C).\n @param contentInfoCount Number of content infos to retrieve.\n @param offset Offset from the first content index the count starts at.\n @param[out] contentInfos Pointer to output the content infos read to."] - #[doc = ""] + #[doc = " Gets content infos installed under the specified DLC title.\n # Arguments\n\n* `contentInfoRead` (direction out) - Pointer to output the number of content infos read to.\n * `mediatype` - Media type of the title.\n * `titleID` - Title ID to retrieve the content infos for (high-id is 0x0004008C).\n * `contentInfoCount` - Number of content infos to retrieve.\n * `offset` - Offset from the first content index the count starts at.\n * `contentInfos` (direction out) - Pointer to output the content infos read to."] pub fn AMAPP_ListDLCContentInfos( contentInfoRead: *mut u32_, mediatype: FS_MediaType, @@ -8434,19 +6875,16 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Initializes AMPXI.\n @param servhandle Optional service session handle to use for AMPXI, if zero srvGetServiceHandle() will be used."] - #[doc = ""] + #[doc = " Initializes AMPXI.\n # Arguments\n\n* `servhandle` - Optional service session handle to use for AMPXI, if zero srvGetServiceHandle() will be used."] pub fn ampxiInit(servhandle: Handle) -> Result; } extern "C" { - #[doc = "Exits AMPXI."] - #[doc = ""] + #[doc = " Exits AMPXI."] pub fn ampxiExit(); } extern "C" { #[must_use] - #[doc = "Writes a TWL save-file to NAND. @param titleid ID of the TWL title.\n @param buffer Savedata buffer ptr.\n @param size Size of the savedata buffer.\n @param image_filepos Filepos to use for writing the data to the NAND savedata file.\n @param section_type @param operation "] - #[doc = ""] + #[doc = " Writes a TWL save-file to NAND. https://www.3dbrew.org/wiki/AMPXI:WriteTWLSavedata\n # Arguments\n\n* `titleid` - ID of the TWL title.\n * `buffer` - Savedata buffer ptr.\n * `size` - Size of the savedata buffer.\n * `image_filepos` - Filepos to use for writing the data to the NAND savedata file.\n * `section_type` - https://www.3dbrew.org/wiki/AMPXI:WriteTWLSavedata\n * `operation` - https://3dbrew.org/wiki/AM:ImportDSiWare"] pub fn AMPXI_WriteTWLSavedata( titleid: u64_, buffer: *mut u8_, @@ -8458,8 +6896,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Finalizes title installation. @param mediaType Mediatype of the titles to finalize.\n @param db Which title database to use.\n @param size Size of the savedata buffer.\n @param titlecount Total titles.\n @param tidlist List of titleIDs."] - #[doc = ""] + #[doc = " Finalizes title installation. https://3dbrew.org/wiki/AMPXI:InstallTitlesFinish\n # Arguments\n\n* `mediaType` - Mediatype of the titles to finalize.\n * `db` - Which title database to use.\n * `size` - Size of the savedata buffer.\n * `titlecount` - Total titles.\n * `tidlist` - List of titleIDs."] pub fn AMPXI_InstallTitlesFinish( mediaType: FS_MediaType, db: u8_, @@ -8468,256 +6905,133 @@ extern "C" { ) -> Result; } pub const APPID_NONE: NS_APPID = 0; -#[doc = "Home Menu"] -#[doc = ""] - +#[doc = "< Home Menu"] pub const APPID_HOMEMENU: NS_APPID = 257; -#[doc = "Camera applet"] -#[doc = ""] - +#[doc = "< Camera applet"] pub const APPID_CAMERA: NS_APPID = 272; -#[doc = "Friends List applet"] -#[doc = ""] - +#[doc = "< Friends List applet"] pub const APPID_FRIENDS_LIST: NS_APPID = 274; -#[doc = "Game Notes applet"] -#[doc = ""] - +#[doc = "< Game Notes applet"] pub const APPID_GAME_NOTES: NS_APPID = 275; -#[doc = "Internet Browser"] -#[doc = ""] - +#[doc = "< Internet Browser"] pub const APPID_WEB: NS_APPID = 276; -#[doc = "Instruction Manual applet"] -#[doc = ""] - +#[doc = "< Instruction Manual applet"] pub const APPID_INSTRUCTION_MANUAL: NS_APPID = 277; -#[doc = "Notifications applet"] -#[doc = ""] - +#[doc = "< Notifications applet"] pub const APPID_NOTIFICATIONS: NS_APPID = 278; -#[doc = "Miiverse applet (olv)"] -#[doc = ""] - +#[doc = "< Miiverse applet (olv)"] pub const APPID_MIIVERSE: NS_APPID = 279; -#[doc = "Miiverse posting applet (solv3)"] -#[doc = ""] - +#[doc = "< Miiverse posting applet (solv3)"] pub const APPID_MIIVERSE_POSTING: NS_APPID = 280; -#[doc = "Amiibo settings applet (cabinet)"] -#[doc = ""] - +#[doc = "< Amiibo settings applet (cabinet)"] pub const APPID_AMIIBO_SETTINGS: NS_APPID = 281; -#[doc = "Application"] -#[doc = ""] - +#[doc = "< Application"] pub const APPID_APPLICATION: NS_APPID = 768; -#[doc = "eShop (tiger)"] -#[doc = ""] - +#[doc = "< eShop (tiger)"] pub const APPID_ESHOP: NS_APPID = 769; -#[doc = "Software Keyboard"] -#[doc = ""] - +#[doc = "< Software Keyboard"] pub const APPID_SOFTWARE_KEYBOARD: NS_APPID = 1025; -#[doc = "appletEd"] -#[doc = ""] - +#[doc = "< appletEd"] pub const APPID_APPLETED: NS_APPID = 1026; -#[doc = "PNOTE_AP"] -#[doc = ""] - +#[doc = "< PNOTE_AP"] pub const APPID_PNOTE_AP: NS_APPID = 1028; -#[doc = "SNOTE_AP"] -#[doc = ""] - +#[doc = "< SNOTE_AP"] pub const APPID_SNOTE_AP: NS_APPID = 1029; -#[doc = "error"] -#[doc = ""] - +#[doc = "< error"] pub const APPID_ERROR: NS_APPID = 1030; -#[doc = "mint"] -#[doc = ""] - +#[doc = "< mint"] pub const APPID_MINT: NS_APPID = 1031; -#[doc = "extrapad"] -#[doc = ""] - +#[doc = "< extrapad"] pub const APPID_EXTRAPAD: NS_APPID = 1032; -#[doc = "memolib"] -#[doc = ""] - +#[doc = "< memolib"] pub const APPID_MEMOLIB: NS_APPID = 1033; -#[doc = "NS Application IDs.\n\n Retrieved from "] -#[doc = ""] - +#[doc = " NS Application IDs.\n\n Retrieved from http://3dbrew.org/wiki/NS_and_APT_Services#AppIDs"] pub type NS_APPID = ::libc::c_uint; -#[doc = "No position specified."] -#[doc = ""] - +#[doc = "< No position specified."] pub const APTPOS_NONE: APT_AppletPos = -1; -#[doc = "Application."] -#[doc = ""] - +#[doc = "< Application."] pub const APTPOS_APP: APT_AppletPos = 0; -#[doc = "Application library (?)."] -#[doc = ""] - +#[doc = "< Application library (?)."] pub const APTPOS_APPLIB: APT_AppletPos = 1; -#[doc = "System applet."] -#[doc = ""] - +#[doc = "< System applet."] pub const APTPOS_SYS: APT_AppletPos = 2; -#[doc = "System library (?)."] -#[doc = ""] - +#[doc = "< System library (?)."] pub const APTPOS_SYSLIB: APT_AppletPos = 3; -#[doc = "Resident applet."] -#[doc = ""] - +#[doc = "< Resident applet."] pub const APTPOS_RESIDENT: APT_AppletPos = 4; -#[doc = "APT applet position."] -#[doc = ""] - +#[doc = " APT applet position."] pub type APT_AppletPos = ::libc::c_int; 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; -#[doc = "APT query reply."] -#[doc = ""] - +#[doc = " APT query reply."] pub type APT_QueryReply = ::libc::c_uint; -#[doc = "No signal received."] -#[doc = ""] - +#[doc = "< No signal received."] pub const APTSIGNAL_NONE: APT_Signal = 0; -#[doc = "HOME button pressed."] -#[doc = ""] - +#[doc = "< HOME button pressed."] pub const APTSIGNAL_HOMEBUTTON: APT_Signal = 1; -#[doc = "HOME button pressed (again?)."] -#[doc = ""] - +#[doc = "< HOME button pressed (again?)."] pub const APTSIGNAL_HOMEBUTTON2: APT_Signal = 2; -#[doc = "Prepare to enter sleep mode."] -#[doc = ""] - +#[doc = "< Prepare to enter sleep mode."] pub const APTSIGNAL_SLEEP_QUERY: APT_Signal = 3; -#[doc = "Triggered when ptm:s GetShellStatus() returns 5."] -#[doc = ""] - +#[doc = "< Triggered when ptm:s GetShellStatus() returns 5."] pub const APTSIGNAL_SLEEP_CANCEL: APT_Signal = 4; -#[doc = "Enter sleep mode."] -#[doc = ""] - +#[doc = "< Enter sleep mode."] pub const APTSIGNAL_SLEEP_ENTER: APT_Signal = 5; -#[doc = "Wake from sleep mode."] -#[doc = ""] - +#[doc = "< Wake from sleep mode."] pub const APTSIGNAL_SLEEP_WAKEUP: APT_Signal = 6; -#[doc = "Shutdown."] -#[doc = ""] - +#[doc = "< Shutdown."] pub const APTSIGNAL_SHUTDOWN: APT_Signal = 7; -#[doc = "POWER button pressed."] -#[doc = ""] - +#[doc = "< POWER button pressed."] pub const APTSIGNAL_POWERBUTTON: APT_Signal = 8; -#[doc = "POWER button cleared (?)."] -#[doc = ""] - +#[doc = "< POWER button cleared (?)."] pub const APTSIGNAL_POWERBUTTON2: APT_Signal = 9; -#[doc = "System sleeping (?)."] -#[doc = ""] - +#[doc = "< System sleeping (?)."] pub const APTSIGNAL_TRY_SLEEP: APT_Signal = 10; -#[doc = "Order to close (such as when an error happens?)."] -#[doc = ""] - +#[doc = "< Order to close (such as when an error happens?)."] pub const APTSIGNAL_ORDERTOCLOSE: APT_Signal = 11; -#[doc = "APT signals."] -#[doc = ""] - +#[doc = " APT signals."] pub type APT_Signal = ::libc::c_uint; -#[doc = "No command received."] -#[doc = ""] - +#[doc = "< No command received."] pub const APTCMD_NONE: APT_Command = 0; -#[doc = "Applet should wake up."] -#[doc = ""] - +#[doc = "< Applet should wake up."] pub const APTCMD_WAKEUP: APT_Command = 1; -#[doc = "Source applet sent us a parameter."] -#[doc = ""] - +#[doc = "< Source applet sent us a parameter."] pub const APTCMD_REQUEST: APT_Command = 2; -#[doc = "Target applet replied to our parameter."] -#[doc = ""] - +#[doc = "< Target applet replied to our parameter."] pub const APTCMD_RESPONSE: APT_Command = 3; -#[doc = "Exit (??)"] -#[doc = ""] - +#[doc = "< Exit (??)"] pub const APTCMD_EXIT: APT_Command = 4; -#[doc = "Message (??)"] -#[doc = ""] - +#[doc = "< Message (??)"] pub const APTCMD_MESSAGE: APT_Command = 5; -#[doc = "HOME button pressed once."] -#[doc = ""] - +#[doc = "< HOME button pressed once."] pub const APTCMD_HOMEBUTTON_ONCE: APT_Command = 6; -#[doc = "HOME button pressed twice (double-pressed)."] -#[doc = ""] - +#[doc = "< HOME button pressed twice (double-pressed)."] pub const APTCMD_HOMEBUTTON_TWICE: APT_Command = 7; -#[doc = "DSP should sleep (manual DSP rights related?)."] -#[doc = ""] - +#[doc = "< DSP should sleep (manual DSP rights related?)."] pub const APTCMD_DSP_SLEEP: APT_Command = 8; -#[doc = "DSP should wake up (manual DSP rights related?)."] -#[doc = ""] - +#[doc = "< DSP should wake up (manual DSP rights related?)."] pub const APTCMD_DSP_WAKEUP: APT_Command = 9; -#[doc = "Applet wakes up due to a different applet exiting."] -#[doc = ""] - +#[doc = "< Applet wakes up due to a different applet exiting."] pub const APTCMD_WAKEUP_EXIT: APT_Command = 10; -#[doc = "Applet wakes up after being paused through HOME menu."] -#[doc = ""] - +#[doc = "< Applet wakes up after being paused through HOME menu."] pub const APTCMD_WAKEUP_PAUSE: APT_Command = 11; -#[doc = "Applet wakes up due to being cancelled."] -#[doc = ""] - +#[doc = "< Applet wakes up due to being cancelled."] pub const APTCMD_WAKEUP_CANCEL: APT_Command = 12; -#[doc = "Applet wakes up due to all applets being cancelled."] -#[doc = ""] - +#[doc = "< Applet wakes up due to all applets being cancelled."] pub const APTCMD_WAKEUP_CANCELALL: APT_Command = 13; -#[doc = "Applet wakes up due to POWER button being pressed (?)."] -#[doc = ""] - +#[doc = "< Applet wakes up due to POWER button being pressed (?)."] pub const APTCMD_WAKEUP_POWERBUTTON: APT_Command = 14; -#[doc = "Applet wakes up and is instructed to jump to HOME menu (?)."] -#[doc = ""] - +#[doc = "< Applet wakes up and is instructed to jump to HOME menu (?)."] pub const APTCMD_WAKEUP_JUMPTOHOME: APT_Command = 15; -#[doc = "Request for sysapplet (?)."] -#[doc = ""] - +#[doc = "< Request for sysapplet (?)."] pub const APTCMD_SYSAPPLET_REQUEST: APT_Command = 16; -#[doc = "Applet wakes up and is instructed to launch another applet (?)."] -#[doc = ""] - +#[doc = "< Applet wakes up and is instructed to launch another applet (?)."] pub const APTCMD_WAKEUP_LAUNCHAPP: APT_Command = 17; -#[doc = "APT commands."] -#[doc = ""] - +#[doc = " APT commands."] pub type APT_Command = ::libc::c_uint; -#[doc = "APT capture buffer information."] -#[doc = ""] +#[doc = " APT capture buffer information."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct aptCaptureBufInfo { @@ -8733,52 +7047,32 @@ pub struct aptCaptureBufInfo__bindgen_ty_1 { pub rightOffset: u32_, pub format: u32_, } -#[doc = "App suspended."] -#[doc = ""] - +#[doc = "< App suspended."] pub const APTHOOK_ONSUSPEND: APT_HookType = 0; -#[doc = "App restored."] -#[doc = ""] - +#[doc = "< App restored."] pub const APTHOOK_ONRESTORE: APT_HookType = 1; -#[doc = "App sleeping."] -#[doc = ""] - +#[doc = "< App sleeping."] pub const APTHOOK_ONSLEEP: APT_HookType = 2; -#[doc = "App waking up."] -#[doc = ""] - +#[doc = "< App waking up."] pub const APTHOOK_ONWAKEUP: APT_HookType = 3; -#[doc = "App exiting."] -#[doc = ""] - +#[doc = "< App exiting."] pub const APTHOOK_ONEXIT: APT_HookType = 4; -#[doc = "Number of APT hook types."] -#[doc = ""] - +#[doc = "< Number of APT hook types."] pub const APTHOOK_COUNT: APT_HookType = 5; -#[doc = "APT hook types."] -#[doc = ""] - +#[doc = " APT hook types."] pub type APT_HookType = ::libc::c_uint; -#[doc = "APT hook function."] -#[doc = ""] - +#[doc = " APT hook function."] pub type aptHookFn = ::core::option::Option; -#[doc = "APT hook cookie."] -#[doc = ""] +#[doc = " APT hook cookie."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct tag_aptHookCookie { - #[doc = "Next cookie."] - #[doc = ""] + #[doc = "< Next cookie."] pub next: *mut tag_aptHookCookie, - #[doc = "Hook callback."] - #[doc = ""] + #[doc = "< Hook callback."] pub callback: aptHookFn, - #[doc = "Callback parameter."] - #[doc = ""] + #[doc = "< Callback parameter."] pub param: *mut ::libc::c_void, } impl Default for tag_aptHookCookie { @@ -8790,13 +7084,9 @@ impl Default for tag_aptHookCookie { } } } -#[doc = "APT hook cookie."] -#[doc = ""] - +#[doc = " APT hook cookie."] pub type aptHookCookie = tag_aptHookCookie; -#[doc = "APT message callback."] -#[doc = ""] - +#[doc = " APT message callback."] pub type aptMessageCb = ::core::option::Option< unsafe extern "C" fn( user: *mut ::libc::c_void, @@ -8807,94 +7097,76 @@ pub type aptMessageCb = ::core::option::Option< >; extern "C" { #[must_use] - #[doc = "Initializes APT."] - #[doc = ""] + #[doc = " Initializes APT."] pub fn aptInit() -> Result; } extern "C" { - #[doc = "Exits APT."] - #[doc = ""] + #[doc = " Exits APT."] pub fn aptExit(); } extern "C" { #[must_use] - #[doc = "Sends an APT command through IPC, taking care of locking, opening and closing an APT session.\n @param aptcmdbuf Pointer to command buffer (should have capacity for at least 16 words)."] - #[doc = ""] + #[doc = " Sends an APT command through IPC, taking care of locking, opening and closing an APT session.\n # Arguments\n\n* `aptcmdbuf` - Pointer to command buffer (should have capacity for at least 16 words)."] pub fn aptSendCommand(aptcmdbuf: *mut u32_) -> Result; } extern "C" { - #[doc = "Returns true if the application is currently in the foreground."] - #[doc = ""] + #[doc = " Returns true if the application is currently in the foreground."] pub fn aptIsActive() -> bool; } extern "C" { - #[doc = "Returns true if the system has told the application to close."] - #[doc = ""] + #[doc = " Returns true if the system has told the application to close."] pub fn aptShouldClose() -> bool; } extern "C" { - #[doc = "Returns true if the system can enter sleep mode while the application is active."] - #[doc = ""] + #[doc = " Returns true if the system can enter sleep mode while the application is active."] pub fn aptIsSleepAllowed() -> bool; } extern "C" { - #[doc = "Configures whether the system can enter sleep mode while the application is active."] - #[doc = ""] + #[doc = " Configures whether the system can enter sleep mode while the application is active."] pub fn aptSetSleepAllowed(allowed: bool); } extern "C" { - #[doc = "Handles incoming sleep mode requests."] - #[doc = ""] + #[doc = " Handles incoming sleep mode requests."] pub fn aptHandleSleep(); } extern "C" { - #[doc = "Returns true if the user can press the HOME button to jump back to the HOME menu while the application is active."] - #[doc = ""] + #[doc = " Returns true if the user can press the HOME button to jump back to the HOME menu while the application is active."] pub fn aptIsHomeAllowed() -> bool; } extern "C" { - #[doc = "Configures whether the user can press the HOME button to jump back to the HOME menu while the application is active."] - #[doc = ""] + #[doc = " Configures whether the user can press the HOME button to jump back to the HOME menu while the application is active."] pub fn aptSetHomeAllowed(allowed: bool); } extern "C" { - #[doc = "Returns true if the system requires the application to jump back to the HOME menu."] - #[doc = ""] + #[doc = " Returns true if the system requires the application to jump back to the HOME menu."] pub fn aptShouldJumpToHome() -> bool; } extern "C" { - #[doc = "Returns true if there is an incoming HOME button press rejected by the policy set by [`aptSetHomeAllowed`] (use this to show a \"no HOME allowed\" icon)."] - #[doc = ""] + #[doc = " Returns true if there is an incoming HOME button press rejected by the policy set by aptSetHomeAllowed (use this to show a \"no HOME allowed\" icon)."] pub fn aptCheckHomePressRejected() -> bool; } extern "C" { - #[doc = "Jumps back to the HOME menu."] - #[doc = ""] + #[doc = " Jumps back to the HOME menu."] pub fn aptJumpToHomeMenu(); } extern "C" { - #[doc = "Main function which handles sleep mode and HOME/power buttons - call this at the beginning of every frame.\n @return true if the application should keep running, false otherwise (see [`aptShouldClose)`]"] - #[doc = ""] + #[doc = " Main function which handles sleep mode and HOME/power buttons - call this at the beginning of every frame.\n # Returns\n\ntrue if the application should keep running, false otherwise (see aptShouldClose)."] pub fn aptMainLoop() -> bool; } extern "C" { - #[doc = "Sets up an APT status hook.\n @param cookie Hook cookie to use.\n @param callback Function to call when APT's status changes.\n @param param User-defined parameter to pass to the callback."] - #[doc = ""] + #[doc = " Sets up an APT status hook.\n # Arguments\n\n* `cookie` - Hook cookie to use.\n * `callback` - Function to call when APT's status changes.\n * `param` - User-defined parameter to pass to the callback."] pub fn aptHook(cookie: *mut aptHookCookie, callback: aptHookFn, param: *mut ::libc::c_void); } extern "C" { - #[doc = "Removes an APT status hook.\n @param cookie Hook cookie to remove."] - #[doc = ""] + #[doc = " Removes an APT status hook.\n # Arguments\n\n* `cookie` - Hook cookie to remove."] pub fn aptUnhook(cookie: *mut aptHookCookie); } extern "C" { - #[doc = "Sets the function to be called when an APT message from another applet is received.\n @param callback Callback function.\n @param user User-defined data to be passed to the callback."] - #[doc = ""] + #[doc = " Sets the function to be called when an APT message from another applet is received.\n # Arguments\n\n* `callback` - Callback function.\n * `user` - User-defined data to be passed to the callback."] pub fn aptSetMessageCallback(callback: aptMessageCb, user: *mut ::libc::c_void); } extern "C" { - #[doc = "Launches a library applet.\n @param appId ID of the applet to launch.\n @param buf Input/output buffer that contains launch parameters on entry and result data on exit.\n @param bufsize Size of the buffer.\n @param handle Handle to pass to the library applet."] - #[doc = ""] + #[doc = " Launches a library applet.\n # Arguments\n\n* `appId` - ID of the applet to launch.\n * `buf` - Input/output buffer that contains launch parameters on entry and result data on exit.\n * `bufsize` - Size of the buffer.\n * `handle` - Handle to pass to the library applet."] pub fn aptLaunchLibraryApplet( appId: NS_APPID, buf: *mut ::libc::c_void, @@ -8903,30 +7175,25 @@ extern "C" { ); } extern "C" { - #[doc = "Clears the chainloader state."] - #[doc = ""] + #[doc = " Clears the chainloader state."] pub fn aptClearChainloader(); } extern "C" { - #[doc = "Configures the chainloader to launch a specific application.\n @param programID ID of the program to chainload to.\n @param mediatype Media type of the program to chainload to."] - #[doc = ""] + #[doc = " Configures the chainloader to launch a specific application.\n # Arguments\n\n* `programID` - ID of the program to chainload to.\n * `mediatype` - Media type of the program to chainload to."] pub fn aptSetChainloader(programID: u64_, mediatype: u8_); } extern "C" { - #[doc = "Configures the chainloader to relaunch the current application (i.e. soft-reset)"] - #[doc = ""] + #[doc = " Configures the chainloader to relaunch the current application (i.e. soft-reset)"] pub fn aptSetChainloaderToSelf(); } extern "C" { #[must_use] - #[doc = "Gets an APT lock handle.\n @param flags Flags to use.\n @param lockHandle Pointer to output the lock handle to."] - #[doc = ""] + #[doc = " Gets an APT lock handle.\n # Arguments\n\n* `flags` - Flags to use.\n * `lockHandle` - Pointer to output the lock handle to."] pub fn APT_GetLockHandle(flags: u16_, lockHandle: *mut Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Initializes an application's registration with APT.\n @param appId ID of the application.\n @param attr Attributes of the application.\n @param signalEvent Pointer to output the signal event handle to.\n @param resumeEvent Pointer to output the resume event handle to."] - #[doc = ""] + #[doc = " Initializes an application's registration with APT.\n # Arguments\n\n* `appId` - ID of the application.\n * `attr` - Attributes of the application.\n * `signalEvent` - Pointer to output the signal event handle to.\n * `resumeEvent` - Pointer to output the resume event handle to."] pub fn APT_Initialize( appId: NS_APPID, attr: APT_AppletAttr, @@ -8936,26 +7203,22 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Terminates an application's registration with APT.\n @param appID ID of the application."] - #[doc = ""] + #[doc = " Terminates an application's registration with APT.\n # Arguments\n\n* `appID` - ID of the application."] pub fn APT_Finalize(appId: NS_APPID) -> Result; } extern "C" { #[must_use] - #[doc = "Asynchronously resets the hardware."] - #[doc = ""] + #[doc = " Asynchronously resets the hardware."] pub fn APT_HardwareResetAsync() -> Result; } extern "C" { #[must_use] - #[doc = "Enables APT.\n @param attr Attributes of the application."] - #[doc = ""] + #[doc = " Enables APT.\n # Arguments\n\n* `attr` - Attributes of the application."] pub fn APT_Enable(attr: APT_AppletAttr) -> Result; } extern "C" { #[must_use] - #[doc = "Gets applet management info.\n @param inpos Requested applet position.\n @param outpos Pointer to output the position of the current applet to.\n @param req_appid Pointer to output the AppID of the applet at the requested position to.\n @param menu_appid Pointer to output the HOME menu AppID to.\n @param active_appid Pointer to output the AppID of the currently active applet to."] - #[doc = ""] + #[doc = " Gets applet management info.\n # Arguments\n\n* `inpos` - Requested applet position.\n * `outpos` - Pointer to output the position of the current applet to.\n * `req_appid` - Pointer to output the AppID of the applet at the requested position to.\n * `menu_appid` - Pointer to output the HOME menu AppID to.\n * `active_appid` - Pointer to output the AppID of the currently active applet to."] pub fn APT_GetAppletManInfo( inpos: APT_AppletPos, outpos: *mut APT_AppletPos, @@ -8966,8 +7229,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets an applet's information.\n @param appID AppID of the applet.\n @param pProgramID Pointer to output the program ID to.\n @param pMediaType Pointer to output the media type to.\n @param pRegistered Pointer to output the registration status to.\n @param pLoadState Pointer to output the load state to.\n @param pAttributes Pointer to output the applet atrributes to."] - #[doc = ""] + #[doc = " Gets an applet's information.\n # Arguments\n\n* `appID` - AppID of the applet.\n * `pProgramID` - Pointer to output the program ID to.\n * `pMediaType` - Pointer to output the media type to.\n * `pRegistered` - Pointer to output the registration status to.\n * `pLoadState` - Pointer to output the load state to.\n * `pAttributes` - Pointer to output the applet atrributes to."] pub fn APT_GetAppletInfo( appID: NS_APPID, pProgramID: *mut u64_, @@ -8979,26 +7241,22 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets an applet's program information.\n @param id ID of the applet.\n @param flags Flags to use when retreiving the information.\n @param titleversion Pointer to output the applet's title version to.\n\n Flags:\n - 0x01: Use AM_ListTitles with NAND media type.\n - 0x02: Use AM_ListTitles with SDMC media type.\n - 0x04: Use AM_ListTitles with GAMECARD media type.\n - 0x10: Input ID is an app ID. Must be set if 0x20 is not.\n - 0x20: Input ID is a program ID. Must be set if 0x10 is not.\n - 0x100: Sets program ID high to 0x00040000, else it is 0x00040010. Only used when 0x20 is set."] - #[doc = ""] + #[doc = " Gets an applet's program information.\n # Arguments\n\n* `id` - ID of the applet.\n * `flags` - Flags to use when retreiving the information.\n * `titleversion` - Pointer to output the applet's title version to.\n\n Flags:\n - 0x01: Use AM_ListTitles with NAND media type.\n - 0x02: Use AM_ListTitles with SDMC media type.\n - 0x04: Use AM_ListTitles with GAMECARD media type.\n - 0x10: Input ID is an app ID. Must be set if 0x20 is not.\n - 0x20: Input ID is a program ID. Must be set if 0x10 is not.\n - 0x100: Sets program ID high to 0x00040000, else it is 0x00040010. Only used when 0x20 is set."] pub fn APT_GetAppletProgramInfo(id: u32_, flags: u32_, titleversion: *mut u16_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the current application's program ID.\n @param pProgramID Pointer to output the program ID to."] - #[doc = ""] + #[doc = " Gets the current application's program ID.\n # Arguments\n\n* `pProgramID` - Pointer to output the program ID to."] pub fn APT_GetProgramID(pProgramID: *mut u64_) -> Result; } extern "C" { #[must_use] - #[doc = "Prepares to jump to the home menu."] - #[doc = ""] + #[doc = " Prepares to jump to the home menu."] pub fn APT_PrepareToJumpToHomeMenu() -> Result; } extern "C" { #[must_use] - #[doc = "Jumps to the home menu.\n @param param Parameters to jump with.\n @param Size of the parameter buffer.\n @param handle Handle to pass."] - #[doc = ""] + #[doc = " Jumps to the home menu.\n # Arguments\n\n* `param` - Parameters to jump with.\n * `Size` - of the parameter buffer.\n * `handle` - Handle to pass."] pub fn APT_JumpToHomeMenu( param: *const ::libc::c_void, paramSize: usize, @@ -9007,14 +7265,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Prepares to jump to an application.\n @param exiting Specifies whether the applet is exiting."] - #[doc = ""] + #[doc = " Prepares to jump to an application.\n # Arguments\n\n* `exiting` - Specifies whether the applet is exiting."] pub fn APT_PrepareToJumpToApplication(exiting: bool) -> Result; } extern "C" { #[must_use] - #[doc = "Jumps to an application.\n @param param Parameters to jump with.\n @param Size of the parameter buffer.\n @param handle Handle to pass."] - #[doc = ""] + #[doc = " Jumps to an application.\n # Arguments\n\n* `param` - Parameters to jump with.\n * `Size` - of the parameter buffer.\n * `handle` - Handle to pass."] pub fn APT_JumpToApplication( param: *const ::libc::c_void, paramSize: usize, @@ -9023,32 +7279,27 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets whether an application is registered.\n @param appID ID of the application.\n @param out Pointer to output the registration state to."] - #[doc = ""] + #[doc = " Gets whether an application is registered.\n # Arguments\n\n* `appID` - ID of the application.\n * `out` - Pointer to output the registration state to."] pub fn APT_IsRegistered(appID: NS_APPID, out: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Inquires as to whether a signal has been received.\n @param appID ID of the application.\n @param signalType Pointer to output the signal type to."] - #[doc = ""] + #[doc = " Inquires as to whether a signal has been received.\n # Arguments\n\n* `appID` - ID of the application.\n * `signalType` - Pointer to output the signal type to."] pub fn APT_InquireNotification(appID: u32_, signalType: *mut APT_Signal) -> Result; } extern "C" { #[must_use] - #[doc = "Requests to enter sleep mode, and later sets wake events if allowed to.\n @param wakeEvents The wake events. Limited to \"shell\" (bit 1) for the PDN wake events part\n and \"shell opened\", \"shell closed\" and \"HOME button pressed\" for the MCU interrupts part."] - #[doc = ""] + #[doc = " Requests to enter sleep mode, and later sets wake events if allowed to.\n # Arguments\n\n* `wakeEvents` - The wake events. Limited to \"shell\" (bit 1) for the PDN wake events part\n and \"shell opened\", \"shell closed\" and \"HOME button pressed\" for the MCU interrupts part."] pub fn APT_SleepSystem(wakeEvents: *const PtmWakeEvents) -> Result; } extern "C" { #[must_use] - #[doc = "Notifies an application to wait.\n @param appID ID of the application."] - #[doc = ""] + #[doc = " Notifies an application to wait.\n # Arguments\n\n* `appID` - ID of the application."] pub fn APT_NotifyToWait(appID: NS_APPID) -> Result; } extern "C" { #[must_use] - #[doc = "Calls an applet utility function.\n @param id Utility function to call.\n @param out Pointer to write output data to.\n @param outSize Size of the output buffer.\n @param in Pointer to the input data.\n @param inSize Size of the input buffer."] - #[doc = ""] + #[doc = " Calls an applet utility function.\n # Arguments\n\n* `id` - Utility function to call.\n * `out` - Pointer to write output data to.\n * `outSize` - Size of the output buffer.\n * `in` - Pointer to the input data.\n * `inSize` - Size of the input buffer."] pub fn APT_AppletUtility( id: ::libc::c_int, out: *mut ::libc::c_void, @@ -9059,32 +7310,27 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Sleeps if shell is closed (?)."] - #[doc = ""] + #[doc = " Sleeps if shell is closed (?)."] pub fn APT_SleepIfShellClosed() -> Result; } extern "C" { #[must_use] - #[doc = "Locks a transition (?).\n @param transition Transition ID.\n @param flag Flag (?)"] - #[doc = ""] + #[doc = " Locks a transition (?).\n # Arguments\n\n* `transition` - Transition ID.\n * `flag` - Flag (?)"] pub fn APT_LockTransition(transition: u32_, flag: bool) -> Result; } extern "C" { #[must_use] - #[doc = "Tries to lock a transition (?).\n @param transition Transition ID.\n @param succeeded Pointer to output whether the lock was successfully applied."] - #[doc = ""] + #[doc = " Tries to lock a transition (?).\n # Arguments\n\n* `transition` - Transition ID.\n * `succeeded` - Pointer to output whether the lock was successfully applied."] pub fn APT_TryLockTransition(transition: u32_, succeeded: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Unlocks a transition (?).\n @param transition Transition ID."] - #[doc = ""] + #[doc = " Unlocks a transition (?).\n # Arguments\n\n* `transition` - Transition ID."] pub fn APT_UnlockTransition(transition: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Glances at a receieved parameter without removing it from the queue.\n @param appID AppID of the application.\n @param buffer Buffer to receive to.\n @param bufferSize Size of the buffer.\n @param sender Pointer to output the sender's AppID to.\n @param command Pointer to output the command ID to.\n @param actualSize Pointer to output the actual received data size to.\n @param parameter Pointer to output the parameter handle to."] - #[doc = ""] + #[doc = " Glances at a receieved parameter without removing it from the queue.\n # Arguments\n\n* `appID` - AppID of the application.\n * `buffer` - Buffer to receive to.\n * `bufferSize` - Size of the buffer.\n * `sender` - Pointer to output the sender's AppID to.\n * `command` - Pointer to output the command ID to.\n * `actualSize` - Pointer to output the actual received data size to.\n * `parameter` - Pointer to output the parameter handle to."] pub fn APT_GlanceParameter( appID: NS_APPID, buffer: *mut ::libc::c_void, @@ -9097,8 +7343,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Receives a parameter.\n @param appID AppID of the application.\n @param buffer Buffer to receive to.\n @param bufferSize Size of the buffer.\n @param sender Pointer to output the sender's AppID to.\n @param command Pointer to output the command ID to.\n @param actualSize Pointer to output the actual received data size to.\n @param parameter Pointer to output the parameter handle to."] - #[doc = ""] + #[doc = " Receives a parameter.\n # Arguments\n\n* `appID` - AppID of the application.\n * `buffer` - Buffer to receive to.\n * `bufferSize` - Size of the buffer.\n * `sender` - Pointer to output the sender's AppID to.\n * `command` - Pointer to output the command ID to.\n * `actualSize` - Pointer to output the actual received data size to.\n * `parameter` - Pointer to output the parameter handle to."] pub fn APT_ReceiveParameter( appID: NS_APPID, buffer: *mut ::libc::c_void, @@ -9111,8 +7356,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Sends a parameter.\n @param source AppID of the source application.\n @param dest AppID of the destination application.\n @param command Command to send.\n @param buffer Buffer to send.\n @param bufferSize Size of the buffer.\n @param parameter Parameter handle to pass."] - #[doc = ""] + #[doc = " Sends a parameter.\n # Arguments\n\n* `source` - AppID of the source application.\n * `dest` - AppID of the destination application.\n * `command` - Command to send.\n * `buffer` - Buffer to send.\n * `bufferSize` - Size of the buffer.\n * `parameter` - Parameter handle to pass."] pub fn APT_SendParameter( source: NS_APPID, dest: NS_APPID, @@ -9124,38 +7368,32 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Cancels a parameter which matches the specified source and dest AppIDs.\n @param source AppID of the source application (use APPID_NONE to disable the check).\n @param dest AppID of the destination application (use APPID_NONE to disable the check).\n @param success Pointer to output true if a parameter was cancelled, or false otherwise."] - #[doc = ""] + #[doc = " Cancels a parameter which matches the specified source and dest AppIDs.\n # Arguments\n\n* `source` - AppID of the source application (use APPID_NONE to disable the check).\n * `dest` - AppID of the destination application (use APPID_NONE to disable the check).\n * `success` - Pointer to output true if a parameter was cancelled, or false otherwise."] pub fn APT_CancelParameter(source: NS_APPID, dest: NS_APPID, success: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Sends capture buffer information.\n @param captureBuf Capture buffer information to send."] - #[doc = ""] + #[doc = " Sends capture buffer information.\n # Arguments\n\n* `captureBuf` - Capture buffer information to send."] pub fn APT_SendCaptureBufferInfo(captureBuf: *const aptCaptureBufInfo) -> Result; } extern "C" { #[must_use] - #[doc = "Replies to a sleep query.\n @param appID ID of the application.\n @param reply Query reply value."] - #[doc = ""] + #[doc = " Replies to a sleep query.\n # Arguments\n\n* `appID` - ID of the application.\n * `reply` - Query reply value."] pub fn APT_ReplySleepQuery(appID: NS_APPID, reply: APT_QueryReply) -> Result; } extern "C" { #[must_use] - #[doc = "Replies that a sleep notification has been completed.\n @param appID ID of the application."] - #[doc = ""] + #[doc = " Replies that a sleep notification has been completed.\n # Arguments\n\n* `appID` - ID of the application."] pub fn APT_ReplySleepNotificationComplete(appID: NS_APPID) -> Result; } extern "C" { #[must_use] - #[doc = "Prepares to close the application.\n @param cancelPreload Whether applet preloads should be cancelled."] - #[doc = ""] + #[doc = " Prepares to close the application.\n # Arguments\n\n* `cancelPreload` - Whether applet preloads should be cancelled."] pub fn APT_PrepareToCloseApplication(cancelPreload: bool) -> Result; } extern "C" { #[must_use] - #[doc = "Closes the application.\n @param param Parameters to close with.\n @param paramSize Size of param.\n @param handle Handle to pass."] - #[doc = ""] + #[doc = " Closes the application.\n # Arguments\n\n* `param` - Parameters to close with.\n * `paramSize` - Size of param.\n * `handle` - Handle to pass."] pub fn APT_CloseApplication( param: *const ::libc::c_void, paramSize: usize, @@ -9164,32 +7402,27 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Sets the application's CPU time limit.\n @param percent CPU time limit percentage to set."] - #[doc = ""] + #[doc = " Sets the application's CPU time limit.\n # Arguments\n\n* `percent` - CPU time limit percentage to set."] pub fn APT_SetAppCpuTimeLimit(percent: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the application's CPU time limit.\n @param percent Pointer to output the CPU time limit percentage to."] - #[doc = ""] + #[doc = " Gets the application's CPU time limit.\n # Arguments\n\n* `percent` - Pointer to output the CPU time limit percentage to."] pub fn APT_GetAppCpuTimeLimit(percent: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Checks whether the system is a New 3DS.\n @param out Pointer to write the New 3DS flag to."] - #[doc = ""] + #[doc = " Checks whether the system is a New 3DS.\n # Arguments\n\n* `out` - Pointer to write the New 3DS flag to."] pub fn APT_CheckNew3DS(out: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Prepares for an applicaton jump.\n @param flags Flags to use.\n @param programID ID of the program to jump to.\n @param mediatype Media type of the program to jump to."] - #[doc = ""] + #[doc = " Prepares for an applicaton jump.\n # Arguments\n\n* `flags` - Flags to use.\n * `programID` - ID of the program to jump to.\n * `mediatype` - Media type of the program to jump to."] pub fn APT_PrepareToDoApplicationJump(flags: u8_, programID: u64_, mediatype: u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Performs an application jump.\n @param param Parameter buffer.\n @param paramSize Size of parameter buffer.\n @param hmac HMAC buffer (should be 0x20 bytes long)."] - #[doc = ""] + #[doc = " Performs an application jump.\n # Arguments\n\n* `param` - Parameter buffer.\n * `paramSize` - Size of parameter buffer.\n * `hmac` - HMAC buffer (should be 0x20 bytes long)."] pub fn APT_DoApplicationJump( param: *const ::libc::c_void, paramSize: usize, @@ -9198,14 +7431,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Prepares to start a library applet.\n @param appID AppID of the applet to start."] - #[doc = ""] + #[doc = " Prepares to start a library applet.\n # Arguments\n\n* `appID` - AppID of the applet to start."] pub fn APT_PrepareToStartLibraryApplet(appID: NS_APPID) -> Result; } extern "C" { #[must_use] - #[doc = "Starts a library applet.\n @param appID AppID of the applet to launch.\n @param param Buffer containing applet parameters.\n @param paramsize Size of the buffer.\n @param handle Handle to pass to the applet."] - #[doc = ""] + #[doc = " Starts a library applet.\n # Arguments\n\n* `appID` - AppID of the applet to launch.\n * `param` - Buffer containing applet parameters.\n * `paramsize` - Size of the buffer.\n * `handle` - Handle to pass to the applet."] pub fn APT_StartLibraryApplet( appID: NS_APPID, param: *const ::libc::c_void, @@ -9215,14 +7446,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Prepares to start a system applet.\n @param appID AppID of the applet to start."] - #[doc = ""] + #[doc = " Prepares to start a system applet.\n # Arguments\n\n* `appID` - AppID of the applet to start."] pub fn APT_PrepareToStartSystemApplet(appID: NS_APPID) -> Result; } extern "C" { #[must_use] - #[doc = "Starts a system applet.\n @param appID AppID of the applet to launch.\n @param param Buffer containing applet parameters.\n @param paramSize Size of the parameter buffer.\n @param handle Handle to pass to the applet."] - #[doc = ""] + #[doc = " Starts a system applet.\n # Arguments\n\n* `appID` - AppID of the applet to launch.\n * `param` - Buffer containing applet parameters.\n * `paramSize` - Size of the parameter buffer.\n * `handle` - Handle to pass to the applet."] pub fn APT_StartSystemApplet( appID: NS_APPID, param: *const ::libc::c_void, @@ -9232,14 +7461,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Retrieves the shared system font.\n @brief fontHandle Pointer to write the handle of the system font memory block to.\n @brief mapAddr Pointer to write the mapping address of the system font memory block to."] - #[doc = ""] + #[doc = " Retrieves the shared system font.\n fontHandle Pointer to write the handle of the system font memory block to.\n mapAddr Pointer to write the mapping address of the system font memory block to."] pub fn APT_GetSharedFont(fontHandle: *mut Handle, mapAddr: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Receives the deliver (launch) argument\n @param param Parameter buffer.\n @param paramSize Size of parameter buffer.\n @param hmac HMAC buffer (should be 0x20 bytes long).\n @param sender Pointer to output the sender's AppID to.\n @param received Pointer to output whether an argument was received to."] - #[doc = ""] + #[doc = " Receives the deliver (launch) argument\n # Arguments\n\n* `param` - Parameter buffer.\n * `paramSize` - Size of parameter buffer.\n * `hmac` - HMAC buffer (should be 0x20 bytes long).\n * `sender` - Pointer to output the sender's AppID to.\n * `received` - Pointer to output whether an argument was received to."] pub fn APT_ReceiveDeliverArg( param: *const ::libc::c_void, paramSize: usize, @@ -9248,8 +7475,7 @@ extern "C" { received: *mut bool, ) -> Result; } -#[doc = "BOSS context."] -#[doc = ""] +#[doc = " BOSS context."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct bossContext { @@ -9283,76 +7509,60 @@ impl Default for bossContext { } pub const BOSSTASKSTATUS_STARTED: bossTaskStatus = 2; pub const BOSSTASKSTATUS_ERROR: bossTaskStatus = 7; -#[doc = "BOSS task status."] -#[doc = ""] - +#[doc = " BOSS task status."] pub type bossTaskStatus = ::libc::c_uint; pub const bossNsDataHeaderInfoType_ContentSize: bossNsDataHeaderInfoTypes = 3; -#[doc = "Type values for bossGetNsDataHeaderInfo()."] -#[doc = ""] - +#[doc = " Type values for bossGetNsDataHeaderInfo()."] pub type bossNsDataHeaderInfoTypes = ::libc::c_uint; pub const bossNsDataHeaderInfoTypeSize_ContentSize: bossNsDataHeaderInfoTypeSizes = 4; -#[doc = "Size of the output data for bossGetNsDataHeaderInfo()."] -#[doc = ""] - +#[doc = " Size of the output data for bossGetNsDataHeaderInfo()."] pub type bossNsDataHeaderInfoTypeSizes = ::libc::c_uint; extern "C" { #[must_use] - #[doc = "Initializes BOSS.\n @param programID programID to use, 0 for the current process. Only used when BOSSP is available without *hax payload.\n @param force_user When true, just use bossU instead of trying to initialize with bossP first."] - #[doc = ""] + #[doc = " Initializes BOSS.\n # Arguments\n\n* `programID` - programID to use, 0 for the current process. Only used when BOSSP is available without *hax payload.\n * `force_user` - When true, just use bossU instead of trying to initialize with bossP first."] pub fn bossInit(programID: u64_, force_user: bool) -> Result; } extern "C" { #[must_use] - #[doc = "Run the InitializeSession service cmd. This is mainly for changing the programID associated with the current BOSS session.\n @param programID programID to use, 0 for the current process."] - #[doc = ""] + #[doc = " Run the InitializeSession service cmd. This is mainly for changing the programID associated with the current BOSS session.\n # Arguments\n\n* `programID` - programID to use, 0 for the current process."] pub fn bossReinit(programID: u64_) -> Result; } extern "C" { - #[doc = "Exits BOSS."] - #[doc = ""] + #[doc = " Exits BOSS."] pub fn bossExit(); } extern "C" { - #[doc = "Returns the BOSS session handle."] - #[doc = ""] + #[doc = " Returns the BOSS session handle."] pub fn bossGetSessionHandle() -> Handle; } extern "C" { #[must_use] - #[doc = "Set the content data storage location.\n @param extdataID u64 extdataID, must have the high word set to the shared-extdata value when it's for NAND.\n @param boss_size Probably the max size in the extdata which BOSS can use.\n @param mediaType Roughly the same as FS mediatype."] - #[doc = ""] + #[doc = " Set the content data storage location.\n # Arguments\n\n* `extdataID` - u64 extdataID, must have the high word set to the shared-extdata value when it's for NAND.\n * `boss_size` - Probably the max size in the extdata which BOSS can use.\n * `mediaType` - Roughly the same as FS mediatype."] pub fn bossSetStorageInfo(extdataID: u64_, boss_size: u32_, mediaType: u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Unregister the content data storage location, which includes unregistering the BOSS-session programID with BOSS."] - #[doc = ""] + #[doc = " Unregister the content data storage location, which includes unregistering the BOSS-session programID with BOSS."] pub fn bossUnregisterStorage() -> Result; } extern "C" { #[must_use] - #[doc = "Register a task.\n @param taskID BOSS taskID.\n @param unk0 Unknown, usually zero.\n @param unk1 Unknown, usually zero."] - #[doc = ""] + #[doc = " Register a task.\n # Arguments\n\n* `taskID` - BOSS taskID.\n * `unk0` - Unknown, usually zero.\n * `unk1` - Unknown, usually zero."] pub fn bossRegisterTask(taskID: *const ::libc::c_char, unk0: u8_, unk1: u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Send a property.\n @param PropertyID PropertyID\n @param buf Input buffer data.\n @param size Buffer size."] - #[doc = ""] + #[doc = " Send a property.\n # Arguments\n\n* `PropertyID` - PropertyID\n * `buf` - Input buffer data.\n * `size` - Buffer size."] pub fn bossSendProperty(PropertyID: u16_, buf: *const ::libc::c_void, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Deletes the content file for the specified NsDataId.\n @param NsDataId NsDataId"] - #[doc = ""] + #[doc = " Deletes the content file for the specified NsDataId.\n # Arguments\n\n* `NsDataId` - NsDataId"] pub fn bossDeleteNsData(NsDataId: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets header info for the specified NsDataId.\n @param NsDataId NsDataId\n @param type Type of data to load.\n @param buffer Output buffer.\n @param size Output buffer size."] - #[doc = ""] + #[doc = " Gets header info for the specified NsDataId.\n # Arguments\n\n* `NsDataId` - NsDataId\n * `type` - Type of data to load.\n * `buffer` - Output buffer.\n * `size` - Output buffer size."] pub fn bossGetNsDataHeaderInfo( NsDataId: u32_, type_: u8_, @@ -9362,8 +7572,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Reads data from the content for the specified NsDataId.\n @param NsDataId NsDataId\n @param offset Offset in the content.\n @param buffer Output buffer.\n @param size Output buffer size.\n @param transfer_total Optional output actual read size, can be NULL.\n @param unk_out Optional unknown output, can be NULL."] - #[doc = ""] + #[doc = " Reads data from the content for the specified NsDataId.\n # Arguments\n\n* `NsDataId` - NsDataId\n * `offset` - Offset in the content.\n * `buffer` - Output buffer.\n * `size` - Output buffer size.\n * `transfer_total` - Optional output actual read size, can be NULL.\n * `unk_out` - Optional unknown output, can be NULL."] pub fn bossReadNsData( NsDataId: u32_, offset: u64_, @@ -9375,26 +7584,22 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Starts a task soon after running this command.\n @param taskID BOSS taskID."] - #[doc = ""] + #[doc = " Starts a task soon after running this command.\n # Arguments\n\n* `taskID` - BOSS taskID."] pub fn bossStartTaskImmediate(taskID: *const ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = "Similar to bossStartTaskImmediate?\n @param taskID BOSS taskID."] - #[doc = ""] + #[doc = " Similar to bossStartTaskImmediate?\n # Arguments\n\n* `taskID` - BOSS taskID."] pub fn bossStartBgImmediate(taskID: *const ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = "Deletes a task by using CancelTask and UnregisterTask internally.\n @param taskID BOSS taskID.\n @param unk Unknown, usually zero?"] - #[doc = ""] + #[doc = " Deletes a task by using CancelTask and UnregisterTask internally.\n # Arguments\n\n* `taskID` - BOSS taskID.\n * `unk` - Unknown, usually zero?"] pub fn bossDeleteTask(taskID: *const ::libc::c_char, unk: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Returns task state.\n @param taskID BOSS taskID.\n @param inval Unknown, normally 0?\n @param status Output status, see bossTaskStatus.\n @param out1 Output field.\n @param out2 Output field."] - #[doc = ""] + #[doc = " Returns task state.\n # Arguments\n\n* `taskID` - BOSS taskID.\n * `inval` - Unknown, normally 0?\n * `status` - Output status, see bossTaskStatus.\n * `out1` - Output field.\n * `out2` - Output field."] pub fn bossGetTaskState( taskID: *const ::libc::c_char, inval: s8, @@ -9405,13 +7610,11 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "This loads the current state of PropertyID 0x0 for the specified task.\n @param taskID BOSS taskID."] - #[doc = ""] + #[doc = " This loads the current state of PropertyID 0x0 for the specified task.\n # Arguments\n\n* `taskID` - BOSS taskID."] pub fn bossGetTaskProperty0(taskID: *const ::libc::c_char, out: *mut u8_) -> Result; } extern "C" { - #[doc = "Setup a BOSS context with the default config.\n @param bossContext BOSS context.\n @param seconds_interval Interval in seconds for running the task automatically.\n @param url Task URL."] - #[doc = ""] + #[doc = " Setup a BOSS context with the default config.\n # Arguments\n\n* `bossContext` - BOSS context.\n * `seconds_interval` - Interval in seconds for running the task automatically.\n * `url` - Task URL."] pub fn bossSetupContextDefault( ctx: *mut bossContext, seconds_interval: u32_, @@ -9420,157 +7623,94 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Sends the config stored in the context. Used before registering a task.\n @param bossContext BOSS context."] - #[doc = ""] + #[doc = " Sends the config stored in the context. Used before registering a task.\n # Arguments\n\n* `bossContext` - BOSS context."] pub fn bossSendContextConfig(ctx: *mut bossContext) -> Result; } -#[doc = "8-bit per component, planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples).\\n Usually named YUV422P."] -#[doc = ""] - +#[doc = "< 8-bit per component, planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples).Usually named YUV422P."] pub const INPUT_YUV422_INDIV_8: Y2RU_InputFormat = 0; -#[doc = "8-bit per component, planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples).\\n Usually named YUV420P."] -#[doc = ""] - +#[doc = "< 8-bit per component, planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples).Usually named YUV420P."] pub const INPUT_YUV420_INDIV_8: Y2RU_InputFormat = 1; -#[doc = "16-bit per component, planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples).\\n Usually named YUV422P16."] -#[doc = ""] - +#[doc = "< 16-bit per component, planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples).Usually named YUV422P16."] pub const INPUT_YUV422_INDIV_16: Y2RU_InputFormat = 2; -#[doc = "16-bit per component, planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples).\\n Usually named YUV420P16."] -#[doc = ""] - +#[doc = "< 16-bit per component, planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples).Usually named YUV420P16."] pub const INPUT_YUV420_INDIV_16: Y2RU_InputFormat = 3; -#[doc = "8-bit per component, packed YUV 4:2:2, 16bpp, (Y0 Cb Y1 Cr).\\n Usually named YUYV422."] -#[doc = ""] - +#[doc = "< 8-bit per component, packed YUV 4:2:2, 16bpp, (Y0 Cb Y1 Cr).Usually named YUYV422."] pub const INPUT_YUV422_BATCH: Y2RU_InputFormat = 4; -#[doc = "Input color formats\n\n For the 16-bit per component formats, bits 15-8 are padding and 7-0 contains the value."] -#[doc = ""] - +#[doc = " Input color formats\n\n For the 16-bit per component formats, bits 15-8 are padding and 7-0 contains the value."] pub type Y2RU_InputFormat = ::libc::c_uint; -#[doc = "32-bit RGBA8888. The alpha component is the 8-bit value set by [`Y2RU_SetAlpha`]"] -#[doc = ""] - +#[doc = "< 32-bit RGBA8888. The alpha component is the 8-bit value set by Y2RU_SetAlpha"] pub const OUTPUT_RGB_32: Y2RU_OutputFormat = 0; -#[doc = "24-bit RGB888."] -#[doc = ""] - +#[doc = "< 24-bit RGB888."] pub const OUTPUT_RGB_24: Y2RU_OutputFormat = 1; -#[doc = "16-bit RGBA5551. The alpha bit is the 7th bit of the alpha value set by [`Y2RU_SetAlpha`]"] -#[doc = ""] - +#[doc = "< 16-bit RGBA5551. The alpha bit is the 7th bit of the alpha value set by Y2RU_SetAlpha"] pub const OUTPUT_RGB_16_555: Y2RU_OutputFormat = 2; -#[doc = "16-bit RGB565."] -#[doc = ""] - +#[doc = "< 16-bit RGB565."] pub const OUTPUT_RGB_16_565: Y2RU_OutputFormat = 3; -#[doc = "Output color formats\n\n Those are the same as the framebuffer and GPU texture formats."] -#[doc = ""] - +#[doc = " Output color formats\n\n Those are the same as the framebuffer and GPU texture formats."] pub type Y2RU_OutputFormat = ::libc::c_uint; -#[doc = "No rotation."] -#[doc = ""] - +#[doc = "< No rotation."] pub const ROTATION_NONE: Y2RU_Rotation = 0; -#[doc = "Clockwise 90 degrees."] -#[doc = ""] - +#[doc = "< Clockwise 90 degrees."] pub const ROTATION_CLOCKWISE_90: Y2RU_Rotation = 1; -#[doc = "Clockwise 180 degrees."] -#[doc = ""] - +#[doc = "< Clockwise 180 degrees."] pub const ROTATION_CLOCKWISE_180: Y2RU_Rotation = 2; -#[doc = "Clockwise 270 degrees."] -#[doc = ""] - +#[doc = "< Clockwise 270 degrees."] pub const ROTATION_CLOCKWISE_270: Y2RU_Rotation = 3; -#[doc = "Rotation to be applied to the output."] -#[doc = ""] - +#[doc = " Rotation to be applied to the output."] pub type Y2RU_Rotation = ::libc::c_uint; -#[doc = "The result buffer will be laid out in linear format, the usual way."] -#[doc = ""] - +#[doc = "< The result buffer will be laid out in linear format, the usual way."] pub const BLOCK_LINE: Y2RU_BlockAlignment = 0; -#[doc = "The result will be stored as 8x8 blocks in Z-order.\\n Useful for textures since it is the format used by the PICA200."] -#[doc = ""] - +#[doc = "< The result will be stored as 8x8 blocks in Z-order.Useful for textures since it is the format used by the PICA200."] pub const BLOCK_8_BY_8: Y2RU_BlockAlignment = 1; -#[doc = "Block alignment of output\n\n Defines the way the output will be laid out in memory."] -#[doc = ""] - +#[doc = " Block alignment of output\n\n Defines the way the output will be laid out in memory."] pub type Y2RU_BlockAlignment = ::libc::c_uint; -#[doc = "Coefficients of the YUV->RGB conversion formula.\n\n A set of coefficients configuring the RGB to YUV conversion. Coefficients 0-4 are unsigned 2.8\n fixed pointer numbers representing entries on the conversion matrix, while coefficient 5-7 are\n signed 11.5 fixed point numbers added as offsets to the RGB result.\n\n The overall conversion process formula is:\n ``` R = trunc((rgb_Y * Y + r_V * V) + 0.75 + r_offset)\n G = trunc((rgb_Y * Y - g_U * U - g_V * V) + 0.75 + g_offset)\n B = trunc((rgb_Y * Y + b_U * U ) + 0.75 + b_offset)\n"] -#[doc = ""] +#[doc = " Coefficients of the YUV->RGB conversion formula.\n\n A set of coefficients configuring the RGB to YUV conversion. Coefficients 0-4 are unsigned 2.8\n fixed pointer numbers representing entries on the conversion matrix, while coefficient 5-7 are\n signed 11.5 fixed point numbers added as offsets to the RGB result.\n\n The overall conversion process formula is:\n R = trunc((rgb_Y * Y + r_V * V) + 0.75 + r_offset)\n G = trunc((rgb_Y * Y - g_U * U - g_V * V) + 0.75 + g_offset)\n B = trunc((rgb_Y * Y + b_U * U ) + 0.75 + b_offset)\n "] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct Y2RU_ColorCoefficients { - #[doc = "RGB per unit Y."] - #[doc = ""] + #[doc = "< RGB per unit Y."] pub rgb_Y: u16_, - #[doc = "Red per unit V."] - #[doc = ""] + #[doc = "< Red per unit V."] pub r_V: u16_, - #[doc = "Green per unit V."] - #[doc = ""] + #[doc = "< Green per unit V."] pub g_V: u16_, - #[doc = "Green per unit U."] - #[doc = ""] + #[doc = "< Green per unit U."] pub g_U: u16_, - #[doc = "Blue per unit U."] - #[doc = ""] + #[doc = "< Blue per unit U."] pub b_U: u16_, - #[doc = "Red offset."] - #[doc = ""] + #[doc = "< Red offset."] pub r_offset: u16_, - #[doc = "Green offset."] - #[doc = ""] + #[doc = "< Green offset."] pub g_offset: u16_, - #[doc = "Blue offset."] - #[doc = ""] + #[doc = "< Blue offset."] pub b_offset: u16_, } -#[doc = "Coefficients from the ITU-R BT.601 standard with PC ranges."] -#[doc = ""] - +#[doc = "< Coefficients from the ITU-R BT.601 standard with PC ranges."] pub const COEFFICIENT_ITU_R_BT_601: Y2RU_StandardCoefficient = 0; -#[doc = "Coefficients from the ITU-R BT.709 standard with PC ranges."] -#[doc = ""] - +#[doc = "< Coefficients from the ITU-R BT.709 standard with PC ranges."] pub const COEFFICIENT_ITU_R_BT_709: Y2RU_StandardCoefficient = 1; -#[doc = "Coefficients from the ITU-R BT.601 standard with TV ranges."] -#[doc = ""] - +#[doc = "< Coefficients from the ITU-R BT.601 standard with TV ranges."] pub const COEFFICIENT_ITU_R_BT_601_SCALING: Y2RU_StandardCoefficient = 2; -#[doc = "Coefficients from the ITU-R BT.709 standard with TV ranges."] -#[doc = ""] - +#[doc = "< Coefficients from the ITU-R BT.709 standard with TV ranges."] pub const COEFFICIENT_ITU_R_BT_709_SCALING: Y2RU_StandardCoefficient = 3; -#[doc = "Preset conversion coefficients based on ITU standards for the YUV->RGB formula.\n\n For more details refer to [`Y2RU_ColorCoefficients`]"] -#[doc = ""] - +#[doc = " Preset conversion coefficients based on ITU standards for the YUV->RGB formula.\n\n For more details refer to Y2RU_ColorCoefficients"] pub type Y2RU_StandardCoefficient = ::libc::c_uint; -#[doc = "Structure used to configure all parameters at once.\n\n You can send a batch of configuration parameters using this structure and [`Y2RU_SetConversionParams`]"] -#[doc = ""] +#[doc = " Structure used to configure all parameters at once.\n\n You can send a batch of configuration parameters using this structure and Y2RU_SetConversionParams."] #[repr(C)] #[repr(align(4))] #[derive(Debug, Copy, Clone)] pub struct Y2RU_ConversionParams { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, - #[doc = "Value passed to [`Y2RU_SetInputLineWidth`]"] - #[doc = ""] + #[doc = "< Value passed to Y2RU_SetInputLineWidth"] pub input_line_width: s16, - #[doc = "Value passed to [`Y2RU_SetInputLines`]"] - #[doc = ""] + #[doc = "< Value passed to Y2RU_SetInputLines"] pub input_lines: s16, pub _bitfield_align_2: [u8; 0], pub _bitfield_2: __BindgenBitfieldUnit<[u8; 1usize]>, - #[doc = "Unused."] - #[doc = ""] + #[doc = "< Unused."] pub unused: u8_, - #[doc = "Value passed to [`Y2RU_SetAlpha`]"] - #[doc = ""] + #[doc = "< Value passed to Y2RU_SetAlpha"] pub alpha: u16_, } impl Default for Y2RU_ConversionParams { @@ -9676,189 +7816,150 @@ impl Y2RU_ConversionParams { __bindgen_bitfield_unit } } -#[doc = "Dithering weights."] -#[doc = ""] +#[doc = " Dithering weights."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct Y2RU_DitheringWeightParams { - #[doc = "Weight 0 for even X, even Y."] - #[doc = ""] + #[doc = "< Weight 0 for even X, even Y."] pub w0_xEven_yEven: u16_, - #[doc = "Weight 0 for odd X, even Y."] - #[doc = ""] + #[doc = "< Weight 0 for odd X, even Y."] pub w0_xOdd_yEven: u16_, - #[doc = "Weight 0 for even X, odd Y."] - #[doc = ""] + #[doc = "< Weight 0 for even X, odd Y."] pub w0_xEven_yOdd: u16_, - #[doc = "Weight 0 for odd X, odd Y."] - #[doc = ""] + #[doc = "< Weight 0 for odd X, odd Y."] pub w0_xOdd_yOdd: u16_, - #[doc = "Weight 1 for even X, even Y."] - #[doc = ""] + #[doc = "< Weight 1 for even X, even Y."] pub w1_xEven_yEven: u16_, - #[doc = "Weight 1 for odd X, even Y."] - #[doc = ""] + #[doc = "< Weight 1 for odd X, even Y."] pub w1_xOdd_yEven: u16_, - #[doc = "Weight 1 for even X, odd Y."] - #[doc = ""] + #[doc = "< Weight 1 for even X, odd Y."] pub w1_xEven_yOdd: u16_, - #[doc = "Weight 1 for odd X, odd Y."] - #[doc = ""] + #[doc = "< Weight 1 for odd X, odd Y."] pub w1_xOdd_yOdd: u16_, - #[doc = "Weight 2 for even X, even Y."] - #[doc = ""] + #[doc = "< Weight 2 for even X, even Y."] pub w2_xEven_yEven: u16_, - #[doc = "Weight 2 for odd X, even Y."] - #[doc = ""] + #[doc = "< Weight 2 for odd X, even Y."] pub w2_xOdd_yEven: u16_, - #[doc = "Weight 2 for even X, odd Y."] - #[doc = ""] + #[doc = "< Weight 2 for even X, odd Y."] pub w2_xEven_yOdd: u16_, - #[doc = "Weight 2 for odd X, odd Y."] - #[doc = ""] + #[doc = "< Weight 2 for odd X, odd Y."] pub w2_xOdd_yOdd: u16_, - #[doc = "Weight 3 for even X, even Y."] - #[doc = ""] + #[doc = "< Weight 3 for even X, even Y."] pub w3_xEven_yEven: u16_, - #[doc = "Weight 3 for odd X, even Y."] - #[doc = ""] + #[doc = "< Weight 3 for odd X, even Y."] pub w3_xOdd_yEven: u16_, - #[doc = "Weight 3 for even X, odd Y."] - #[doc = ""] + #[doc = "< Weight 3 for even X, odd Y."] pub w3_xEven_yOdd: u16_, - #[doc = "Weight 3 for odd X, odd Y."] - #[doc = ""] + #[doc = "< Weight 3 for odd X, odd Y."] pub w3_xOdd_yOdd: u16_, } extern "C" { #[must_use] - #[doc = "Initializes the y2r service.\n\n This will internally get the handle of the service, and on success call Y2RU_DriverInitialize."] - #[doc = ""] + #[doc = " Initializes the y2r service.\n\n This will internally get the handle of the service, and on success call Y2RU_DriverInitialize."] pub fn y2rInit() -> Result; } extern "C" { - #[doc = "Closes the y2r service.\n\n This will internally call Y2RU_DriverFinalize and close the handle of the service."] - #[doc = ""] + #[doc = " Closes the y2r service.\n\n This will internally call Y2RU_DriverFinalize and close the handle of the service."] pub fn y2rExit(); } extern "C" { #[must_use] - #[doc = "Used to configure the input format.\n @param format Input format to use.\n\n @note Prefer using [`Y2RU_SetConversionParams`] if you have to set multiple parameters."] - #[doc = ""] + #[doc = " Used to configure the input format.\n # Arguments\n\n* `format` - Input format to use.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] pub fn Y2RU_SetInputFormat(format: Y2RU_InputFormat) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the configured input format.\n @param format Pointer to output the input format to."] - #[doc = ""] + #[doc = " Gets the configured input format.\n # Arguments\n\n* `format` - Pointer to output the input format to."] pub fn Y2RU_GetInputFormat(format: *mut Y2RU_InputFormat) -> Result; } extern "C" { #[must_use] - #[doc = "Used to configure the output format.\n @param format Output format to use.\n\n @note Prefer using [`Y2RU_SetConversionParams`] if you have to set multiple parameters."] - #[doc = ""] + #[doc = " Used to configure the output format.\n # Arguments\n\n* `format` - Output format to use.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] pub fn Y2RU_SetOutputFormat(format: Y2RU_OutputFormat) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the configured output format.\n @param format Pointer to output the output format to."] - #[doc = ""] + #[doc = " Gets the configured output format.\n # Arguments\n\n* `format` - Pointer to output the output format to."] pub fn Y2RU_GetOutputFormat(format: *mut Y2RU_OutputFormat) -> Result; } extern "C" { #[must_use] - #[doc = "Used to configure the rotation of the output.\n @param rotation Rotation to use.\n\n It seems to apply the rotation per batch of 8 lines, so the output will be (height/8) images of size 8 x width.\n\n @note Prefer using [`Y2RU_SetConversionParams`] if you have to set multiple parameters."] - #[doc = ""] + #[doc = " Used to configure the rotation of the output.\n # Arguments\n\n* `rotation` - Rotation to use.\n\n It seems to apply the rotation per batch of 8 lines, so the output will be (height/8) images of size 8 x width.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] pub fn Y2RU_SetRotation(rotation: Y2RU_Rotation) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the configured rotation.\n @param rotation Pointer to output the rotation to."] - #[doc = ""] + #[doc = " Gets the configured rotation.\n # Arguments\n\n* `rotation` - Pointer to output the rotation to."] pub fn Y2RU_GetRotation(rotation: *mut Y2RU_Rotation) -> Result; } extern "C" { #[must_use] - #[doc = "Used to configure the alignment of the output buffer.\n @param alignment Alignment to use.\n\n @note Prefer using [`Y2RU_SetConversionParams`] if you have to set multiple parameters."] - #[doc = ""] + #[doc = " Used to configure the alignment of the output buffer.\n # Arguments\n\n* `alignment` - Alignment to use.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] pub fn Y2RU_SetBlockAlignment(alignment: Y2RU_BlockAlignment) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the configured alignment.\n @param alignment Pointer to output the alignment to."] - #[doc = ""] + #[doc = " Gets the configured alignment.\n # Arguments\n\n* `alignment` - Pointer to output the alignment to."] pub fn Y2RU_GetBlockAlignment(alignment: *mut Y2RU_BlockAlignment) -> Result; } extern "C" { #[must_use] - #[doc = "Sets whether to use spacial dithering.\n @param enable Whether to use spacial dithering."] - #[doc = ""] + #[doc = " Sets whether to use spacial dithering.\n # Arguments\n\n* `enable` - Whether to use spacial dithering."] pub fn Y2RU_SetSpacialDithering(enable: bool) -> Result; } extern "C" { #[must_use] - #[doc = "Gets whether to use spacial dithering.\n @param enable Pointer to output the spacial dithering state to."] - #[doc = ""] + #[doc = " Gets whether to use spacial dithering.\n # Arguments\n\n* `enable` - Pointer to output the spacial dithering state to."] pub fn Y2RU_GetSpacialDithering(enabled: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Sets whether to use temporal dithering.\n @param enable Whether to use temporal dithering."] - #[doc = ""] + #[doc = " Sets whether to use temporal dithering.\n # Arguments\n\n* `enable` - Whether to use temporal dithering."] pub fn Y2RU_SetTemporalDithering(enable: bool) -> Result; } extern "C" { #[must_use] - #[doc = "Gets whether to use temporal dithering.\n @param enable Pointer to output the temporal dithering state to."] - #[doc = ""] + #[doc = " Gets whether to use temporal dithering.\n # Arguments\n\n* `enable` - Pointer to output the temporal dithering state to."] pub fn Y2RU_GetTemporalDithering(enabled: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Used to configure the width of the image.\n @param line_width Width of the image in pixels. Must be a multiple of 8, up to 1024.\n\n @note Prefer using [`Y2RU_SetConversionParams`] if you have to set multiple parameters."] - #[doc = ""] + #[doc = " Used to configure the width of the image.\n # Arguments\n\n* `line_width` - Width of the image in pixels. Must be a multiple of 8, up to 1024.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] pub fn Y2RU_SetInputLineWidth(line_width: u16_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the configured input line width.\n @param line_width Pointer to output the line width to."] - #[doc = ""] + #[doc = " Gets the configured input line width.\n # Arguments\n\n* `line_width` - Pointer to output the line width to."] pub fn Y2RU_GetInputLineWidth(line_width: *mut u16_) -> Result; } extern "C" { #[must_use] - #[doc = "Used to configure the height of the image.\n @param num_lines Number of lines to be converted.\n\n A multiple of 8 seems to be preferred.\n If using the [`BLOCK_8_BY_8`] mode, it must be a multiple of 8.\n\n @note Prefer using [`Y2RU_SetConversionParams`] if you have to set multiple parameters."] - #[doc = ""] + #[doc = " Used to configure the height of the image.\n # Arguments\n\n* `num_lines` - Number of lines to be converted.\n\n A multiple of 8 seems to be preferred.\n If using the BLOCK_8_BY_8 mode, it must be a multiple of 8.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] pub fn Y2RU_SetInputLines(num_lines: u16_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the configured number of input lines.\n @param num_lines Pointer to output the input lines to."] - #[doc = ""] + #[doc = " Gets the configured number of input lines.\n # Arguments\n\n* `num_lines` - Pointer to output the input lines to."] pub fn Y2RU_GetInputLines(num_lines: *mut u16_) -> Result; } extern "C" { #[must_use] - #[doc = "Used to configure the color conversion formula.\n @param coefficients Coefficients to use.\n\n See [`Y2RU_ColorCoefficients`] for more information about the coefficients.\n\n @note Prefer using [`Y2RU_SetConversionParams`] if you have to set multiple parameters."] - #[doc = ""] + #[doc = " Used to configure the color conversion formula.\n # Arguments\n\n* `coefficients` - Coefficients to use.\n\n See Y2RU_ColorCoefficients for more information about the coefficients.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] pub fn Y2RU_SetCoefficients(coefficients: *const Y2RU_ColorCoefficients) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the configured color coefficients.\n @param num_lines Pointer to output the coefficients to."] - #[doc = ""] + #[doc = " Gets the configured color coefficients.\n # Arguments\n\n* `num_lines` - Pointer to output the coefficients to."] pub fn Y2RU_GetCoefficients(coefficients: *mut Y2RU_ColorCoefficients) -> Result; } extern "C" { #[must_use] - #[doc = "Used to configure the color conversion formula with ITU stantards coefficients.\n @param coefficient Standard coefficient to use.\n\n See [`Y2RU_ColorCoefficients`] for more information about the coefficients.\n\n @note Prefer using [`Y2RU_SetConversionParams`] if you have to set multiple parameters."] - #[doc = ""] + #[doc = " Used to configure the color conversion formula with ITU stantards coefficients.\n # Arguments\n\n* `coefficient` - Standard coefficient to use.\n\n See Y2RU_ColorCoefficients for more information about the coefficients.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] pub fn Y2RU_SetStandardCoefficient(coefficient: Y2RU_StandardCoefficient) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the color coefficient parameters of a standard coefficient.\n @param coefficients Pointer to output the coefficients to.\n @param standardCoeff Standard coefficient to check."] - #[doc = ""] + #[doc = " Gets the color coefficient parameters of a standard coefficient.\n # Arguments\n\n* `coefficients` - Pointer to output the coefficients to.\n * `standardCoeff` - Standard coefficient to check."] pub fn Y2RU_GetStandardCoefficient( coefficients: *mut Y2RU_ColorCoefficients, standardCoeff: Y2RU_StandardCoefficient, @@ -9866,38 +7967,32 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Used to configure the alpha value of the output.\n @param alpha 8-bit value to be used for the output when the format requires it.\n\n @note Prefer using [`Y2RU_SetConversionParams`] if you have to set multiple parameters."] - #[doc = ""] + #[doc = " Used to configure the alpha value of the output.\n # Arguments\n\n* `alpha` - 8-bit value to be used for the output when the format requires it.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] pub fn Y2RU_SetAlpha(alpha: u16_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the configured output alpha value.\n @param alpha Pointer to output the alpha value to."] - #[doc = ""] + #[doc = " Gets the configured output alpha value.\n # Arguments\n\n* `alpha` - Pointer to output the alpha value to."] pub fn Y2RU_GetAlpha(alpha: *mut u16_) -> Result; } extern "C" { #[must_use] - #[doc = "Used to enable the end of conversion interrupt.\n @param should_interrupt Enables the interrupt if true, disable it if false.\n\n It is possible to fire an interrupt when the conversion is finished, and that the DMA is done copying the data.\n This interrupt will then be used to fire an event. See [`Y2RU_GetTransferEndEvent.\n`] By default the interrupt is enabled.\n\n @note It seems that the event can be fired too soon in some cases, depending the transfer_unit size.\\n Please see the note at [`Y2RU_SetReceiving`]"] - #[doc = ""] + #[doc = " Used to enable the end of conversion interrupt.\n # Arguments\n\n* `should_interrupt` - Enables the interrupt if true, disable it if false.\n\n It is possible to fire an interrupt when the conversion is finished, and that the DMA is done copying the data.\n This interrupt will then be used to fire an event. See Y2RU_GetTransferEndEvent.\n By default the interrupt is enabled.\n\n > **Note:** It seems that the event can be fired too soon in some cases, depending the transfer_unit size.Please see the note at Y2RU_SetReceiving"] pub fn Y2RU_SetTransferEndInterrupt(should_interrupt: bool) -> Result; } extern "C" { #[must_use] - #[doc = "Gets whether the transfer end interrupt is enabled.\n @param should_interrupt Pointer to output the interrupt state to."] - #[doc = ""] + #[doc = " Gets whether the transfer end interrupt is enabled.\n # Arguments\n\n* `should_interrupt` - Pointer to output the interrupt state to."] pub fn Y2RU_GetTransferEndInterrupt(should_interrupt: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Gets an handle to the end of conversion event.\n @param end_event Pointer to the event handle to be set to the end of conversion event. It isn't necessary to create or close this handle.\n\n To enable this event you have to use ``` *The* event will be triggered when the corresponding interrupt is fired.\n\n @note It is recommended to use a timeout when waiting on this event, as it sometimes (but rarely) isn't triggered."] - #[doc = ""] + #[doc = " Gets an handle to the end of conversion event.\n # Arguments\n\n* `end_event` - Pointer to the event handle to be set to the end of conversion event. It isn't necessary to create or close this handle.\n\n To enable this event you have to use C Y2RU_SetTransferEndInterrupt(true);The event will be triggered when the corresponding interrupt is fired.\n\n > **Note:** It is recommended to use a timeout when waiting on this event, as it sometimes (but rarely) isn't triggered."] pub fn Y2RU_GetTransferEndEvent(end_event: *mut Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Configures the Y plane buffer.\n @param src_buf A pointer to the beginning of your Y data buffer.\n @param image_size The total size of the data buffer.\n @param transfer_unit Specifies the size of 1 DMA transfer. Usually set to 1 line. This has to be a divisor of image_size.\n @param transfer_gap Specifies the gap (offset) to be added after each transfer. Can be used to convert images with stride or only a part of it.\n\n @warning transfer_unit+transfer_gap must be less than 32768 (0x8000)\n\n This specifies the Y data buffer for the planar input formats (INPUT_YUV42*_INDIV_*).\n The actual transfer will only happen after calling [`Y2RU_StartConversion`]"] - #[doc = ""] + #[doc = " Configures the Y plane buffer.\n # Arguments\n\n* `src_buf` - A pointer to the beginning of your Y data buffer.\n * `image_size` - The total size of the data buffer.\n * `transfer_unit` - Specifies the size of 1 DMA transfer. Usually set to 1 line. This has to be a divisor of image_size.\n * `transfer_gap` - Specifies the gap (offset) to be added after each transfer. Can be used to convert images with stride or only a part of it.\n\n transfer_unit+transfer_gap must be less than 32768 (0x8000)\n\n This specifies the Y data buffer for the planar input formats (INPUT_YUV42*_INDIV_*).\n The actual transfer will only happen after calling Y2RU_StartConversion."] pub fn Y2RU_SetSendingY( src_buf: *const ::libc::c_void, image_size: u32_, @@ -9907,8 +8002,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Configures the U plane buffer.\n @param src_buf A pointer to the beginning of your Y data buffer.\n @param image_size The total size of the data buffer.\n @param transfer_unit Specifies the size of 1 DMA transfer. Usually set to 1 line. This has to be a divisor of image_size.\n @param transfer_gap Specifies the gap (offset) to be added after each transfer. Can be used to convert images with stride or only a part of it.\n\n @warning transfer_unit+transfer_gap must be less than 32768 (0x8000)\n\n This specifies the U data buffer for the planar input formats (INPUT_YUV42*_INDIV_*).\n The actual transfer will only happen after calling [`Y2RU_StartConversion`]"] - #[doc = ""] + #[doc = " Configures the U plane buffer.\n # Arguments\n\n* `src_buf` - A pointer to the beginning of your Y data buffer.\n * `image_size` - The total size of the data buffer.\n * `transfer_unit` - Specifies the size of 1 DMA transfer. Usually set to 1 line. This has to be a divisor of image_size.\n * `transfer_gap` - Specifies the gap (offset) to be added after each transfer. Can be used to convert images with stride or only a part of it.\n\n transfer_unit+transfer_gap must be less than 32768 (0x8000)\n\n This specifies the U data buffer for the planar input formats (INPUT_YUV42*_INDIV_*).\n The actual transfer will only happen after calling Y2RU_StartConversion."] pub fn Y2RU_SetSendingU( src_buf: *const ::libc::c_void, image_size: u32_, @@ -9918,8 +8012,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Configures the V plane buffer.\n @param src_buf A pointer to the beginning of your Y data buffer.\n @param image_size The total size of the data buffer.\n @param transfer_unit Specifies the size of 1 DMA transfer. Usually set to 1 line. This has to be a divisor of image_size.\n @param transfer_gap Specifies the gap (offset) to be added after each transfer. Can be used to convert images with stride or only a part of it.\n\n @warning transfer_unit+transfer_gap must be less than 32768 (0x8000)\n\n This specifies the V data buffer for the planar input formats (INPUT_YUV42*_INDIV_*).\n The actual transfer will only happen after calling [`Y2RU_StartConversion`]"] - #[doc = ""] + #[doc = " Configures the V plane buffer.\n # Arguments\n\n* `src_buf` - A pointer to the beginning of your Y data buffer.\n * `image_size` - The total size of the data buffer.\n * `transfer_unit` - Specifies the size of 1 DMA transfer. Usually set to 1 line. This has to be a divisor of image_size.\n * `transfer_gap` - Specifies the gap (offset) to be added after each transfer. Can be used to convert images with stride or only a part of it.\n\n transfer_unit+transfer_gap must be less than 32768 (0x8000)\n\n This specifies the V data buffer for the planar input formats (INPUT_YUV42*_INDIV_*).\n The actual transfer will only happen after calling Y2RU_StartConversion."] pub fn Y2RU_SetSendingV( src_buf: *const ::libc::c_void, image_size: u32_, @@ -9929,8 +8022,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Configures the YUYV source buffer.\n @param src_buf A pointer to the beginning of your Y data buffer.\n @param image_size The total size of the data buffer.\n @param transfer_unit Specifies the size of 1 DMA transfer. Usually set to 1 line. This has to be a divisor of image_size.\n @param transfer_gap Specifies the gap (offset) to be added after each transfer. Can be used to convert images with stride or only a part of it.\n\n @warning transfer_unit+transfer_gap must be less than 32768 (0x8000)\n\n This specifies the YUYV data buffer for the packed input format [`INPUT_YUV422_BATCH.\n`] The actual transfer will only happen after calling [`Y2RU_StartConversion`]"] - #[doc = ""] + #[doc = " Configures the YUYV source buffer.\n # Arguments\n\n* `src_buf` - A pointer to the beginning of your Y data buffer.\n * `image_size` - The total size of the data buffer.\n * `transfer_unit` - Specifies the size of 1 DMA transfer. Usually set to 1 line. This has to be a divisor of image_size.\n * `transfer_gap` - Specifies the gap (offset) to be added after each transfer. Can be used to convert images with stride or only a part of it.\n\n transfer_unit+transfer_gap must be less than 32768 (0x8000)\n\n This specifies the YUYV data buffer for the packed input format INPUT_YUV422_BATCH.\n The actual transfer will only happen after calling Y2RU_StartConversion."] pub fn Y2RU_SetSendingYUYV( src_buf: *const ::libc::c_void, image_size: u32_, @@ -9940,8 +8032,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Configures the destination buffer.\n @param src_buf A pointer to the beginning of your destination buffer in FCRAM\n @param image_size The total size of the data buffer.\n @param transfer_unit Specifies the size of 1 DMA transfer. Usually set to 1 line. This has to be a divisor of image_size.\n @param transfer_gap Specifies the gap (offset) to be added after each transfer. Can be used to convert images with stride or only a part of it.\n\n This specifies the destination buffer of the conversion.\n The actual transfer will only happen after calling [`Y2RU_StartConversion.\n`] The buffer does NOT need to be allocated in the linear heap.\n\n @warning transfer_unit+transfer_gap must be less than 32768 (0x8000)\n\n @note\n It seems that depending on the size of the image and of the transfer unit,\\n\n it is possible for the end of conversion interrupt to be triggered right after the conversion began.\\n\n One line as transfer_unit seems to trigger this issue for 400x240, setting to 2/4/8 lines fixes it.\n\n @note Setting a transfer_unit of 4 or 8 lines seems to bring the best results in terms of speed for a 400x240 image."] - #[doc = ""] + #[doc = " Configures the destination buffer.\n # Arguments\n\n* `src_buf` - A pointer to the beginning of your destination buffer in FCRAM\n * `image_size` - The total size of the data buffer.\n * `transfer_unit` - Specifies the size of 1 DMA transfer. Usually set to 1 line. This has to be a divisor of image_size.\n * `transfer_gap` - Specifies the gap (offset) to be added after each transfer. Can be used to convert images with stride or only a part of it.\n\n This specifies the destination buffer of the conversion.\n The actual transfer will only happen after calling Y2RU_StartConversion.\n The buffer does NOT need to be allocated in the linear heap.\n\n transfer_unit+transfer_gap must be less than 32768 (0x8000)\n\n > **Note:** It seems that depending on the size of the image and of the transfer unit, it is possible for the end of conversion interrupt to be triggered right after the conversion began. One line as transfer_unit seems to trigger this issue for 400x240, setting to 2/4/8 lines fixes it.\n\n > **Note:** Setting a transfer_unit of 4 or 8 lines seems to bring the best results in terms of speed for a 400x240 image."] pub fn Y2RU_SetReceiving( dst_buf: *mut ::libc::c_void, image_size: u32_, @@ -9951,303 +8042,181 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Checks if the DMA has finished sending the Y buffer.\n @param is_done Pointer to the boolean that will hold the result.\n\n True if the DMA has finished transferring the Y plane, false otherwise. To be used with [`Y2RU_SetSendingY`]"] - #[doc = ""] + #[doc = " Checks if the DMA has finished sending the Y buffer.\n # Arguments\n\n* `is_done` - Pointer to the boolean that will hold the result.\n\n True if the DMA has finished transferring the Y plane, false otherwise. To be used with Y2RU_SetSendingY."] pub fn Y2RU_IsDoneSendingY(is_done: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Checks if the DMA has finished sending the U buffer.\n @param is_done Pointer to the boolean that will hold the result.\n\n True if the DMA has finished transferring the U plane, false otherwise. To be used with [`Y2RU_SetSendingU`]"] - #[doc = ""] + #[doc = " Checks if the DMA has finished sending the U buffer.\n # Arguments\n\n* `is_done` - Pointer to the boolean that will hold the result.\n\n True if the DMA has finished transferring the U plane, false otherwise. To be used with Y2RU_SetSendingU."] pub fn Y2RU_IsDoneSendingU(is_done: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Checks if the DMA has finished sending the V buffer.\n @param is_done Pointer to the boolean that will hold the result.\n\n True if the DMA has finished transferring the V plane, false otherwise. To be used with [`Y2RU_SetSendingV`]"] - #[doc = ""] + #[doc = " Checks if the DMA has finished sending the V buffer.\n # Arguments\n\n* `is_done` - Pointer to the boolean that will hold the result.\n\n True if the DMA has finished transferring the V plane, false otherwise. To be used with Y2RU_SetSendingV."] pub fn Y2RU_IsDoneSendingV(is_done: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Checks if the DMA has finished sending the YUYV buffer.\n @param is_done Pointer to the boolean that will hold the result.\n\n True if the DMA has finished transferring the YUYV buffer, false otherwise. To be used with [`Y2RU_SetSendingYUYV`]"] - #[doc = ""] + #[doc = " Checks if the DMA has finished sending the YUYV buffer.\n # Arguments\n\n* `is_done` - Pointer to the boolean that will hold the result.\n\n True if the DMA has finished transferring the YUYV buffer, false otherwise. To be used with Y2RU_SetSendingYUYV."] pub fn Y2RU_IsDoneSendingYUYV(is_done: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Checks if the DMA has finished sending the converted result.\n @param is_done Pointer to the boolean that will hold the result.\n\n True if the DMA has finished transferring data to your destination buffer, false otherwise."] - #[doc = ""] + #[doc = " Checks if the DMA has finished sending the converted result.\n # Arguments\n\n* `is_done` - Pointer to the boolean that will hold the result.\n\n True if the DMA has finished transferring data to your destination buffer, false otherwise."] pub fn Y2RU_IsDoneReceiving(is_done: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Configures the dithering weight parameters.\n @param params Dithering weight parameters to use."] - #[doc = ""] + #[doc = " Configures the dithering weight parameters.\n # Arguments\n\n* `params` - Dithering weight parameters to use."] pub fn Y2RU_SetDitheringWeightParams(params: *const Y2RU_DitheringWeightParams) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the configured dithering weight parameters.\n @param params Pointer to output the dithering weight parameters to."] - #[doc = ""] + #[doc = " Gets the configured dithering weight parameters.\n # Arguments\n\n* `params` - Pointer to output the dithering weight parameters to."] pub fn Y2RU_GetDitheringWeightParams(params: *mut Y2RU_DitheringWeightParams) -> Result; } extern "C" { #[must_use] - #[doc = "Sets all of the parameters of Y2RU_ConversionParams at once.\n @param params Conversion parameters to set.\n\n Faster than calling the individual value through Y2R_Set* because only one system call is made."] - #[doc = ""] + #[doc = " Sets all of the parameters of Y2RU_ConversionParams at once.\n # Arguments\n\n* `params` - Conversion parameters to set.\n\n Faster than calling the individual value through Y2R_Set* because only one system call is made."] pub fn Y2RU_SetConversionParams(params: *const Y2RU_ConversionParams) -> Result; } extern "C" { #[must_use] - #[doc = "Starts the conversion process"] - #[doc = ""] + #[doc = " Starts the conversion process"] pub fn Y2RU_StartConversion() -> Result; } extern "C" { #[must_use] - #[doc = "Cancels the conversion"] - #[doc = ""] + #[doc = " Cancels the conversion"] pub fn Y2RU_StopConversion() -> Result; } extern "C" { #[must_use] - #[doc = "Checks if the conversion and DMA transfer are finished.\n @param is_busy Pointer to output the busy state to.\n\n This can have the same problems as the event and interrupt. See [`Y2RU_SetTransferEndInterrupt`]"] - #[doc = ""] + #[doc = " Checks if the conversion and DMA transfer are finished.\n # Arguments\n\n* `is_busy` - Pointer to output the busy state to.\n\n This can have the same problems as the event and interrupt. See Y2RU_SetTransferEndInterrupt."] pub fn Y2RU_IsBusyConversion(is_busy: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Checks whether Y2R is ready to be used.\n @param ping Pointer to output the ready status to."] - #[doc = ""] + #[doc = " Checks whether Y2R is ready to be used.\n # Arguments\n\n* `ping` - Pointer to output the ready status to."] pub fn Y2RU_PingProcess(ping: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Initializes the Y2R driver."] - #[doc = ""] + #[doc = " Initializes the Y2R driver."] pub fn Y2RU_DriverInitialize() -> Result; } extern "C" { #[must_use] - #[doc = "Terminates the Y2R driver."] - #[doc = ""] + #[doc = " Terminates the Y2R driver."] pub fn Y2RU_DriverFinalize() -> Result; } -#[doc = "No port."] -#[doc = ""] - +#[doc = "< No port."] pub const PORT_NONE: _bindgen_ty_15 = 0; -#[doc = "CAM1 port."] -#[doc = ""] - +#[doc = "< CAM1 port."] pub const PORT_CAM1: _bindgen_ty_15 = 1; -#[doc = "CAM2 port."] -#[doc = ""] - +#[doc = "< CAM2 port."] pub const PORT_CAM2: _bindgen_ty_15 = 2; -#[doc = "Both ports."] -#[doc = ""] - +#[doc = "< Both ports."] pub const PORT_BOTH: _bindgen_ty_15 = 3; -#[doc = "Camera connection target ports."] -#[doc = ""] - +#[doc = " Camera connection target ports."] pub type _bindgen_ty_15 = ::libc::c_uint; -#[doc = "No camera."] -#[doc = ""] - +#[doc = "< No camera."] pub const SELECT_NONE: _bindgen_ty_16 = 0; -#[doc = "Outer camera 1."] -#[doc = ""] - +#[doc = "< Outer camera 1."] pub const SELECT_OUT1: _bindgen_ty_16 = 1; -#[doc = "Inner camera 1."] -#[doc = ""] - +#[doc = "< Inner camera 1."] pub const SELECT_IN1: _bindgen_ty_16 = 2; -#[doc = "Outer camera 2."] -#[doc = ""] - +#[doc = "< Outer camera 2."] pub const SELECT_OUT2: _bindgen_ty_16 = 4; -#[doc = "Outer camera 1 and inner camera 1."] -#[doc = ""] - +#[doc = "< Outer camera 1 and inner camera 1."] pub const SELECT_IN1_OUT1: _bindgen_ty_16 = 3; -#[doc = "Both outer cameras."] -#[doc = ""] - +#[doc = "< Both outer cameras."] pub const SELECT_OUT1_OUT2: _bindgen_ty_16 = 5; -#[doc = "Inner camera 1 and outer camera 2."] -#[doc = ""] - +#[doc = "< Inner camera 1 and outer camera 2."] pub const SELECT_IN1_OUT2: _bindgen_ty_16 = 6; -#[doc = "All cameras."] -#[doc = ""] - +#[doc = "< All cameras."] pub const SELECT_ALL: _bindgen_ty_16 = 7; -#[doc = "Camera combinations."] -#[doc = ""] - +#[doc = " Camera combinations."] pub type _bindgen_ty_16 = ::libc::c_uint; -#[doc = "No context."] -#[doc = ""] - +#[doc = "< No context."] pub const CONTEXT_NONE: CAMU_Context = 0; -#[doc = "Context A."] -#[doc = ""] - +#[doc = "< Context A."] pub const CONTEXT_A: CAMU_Context = 1; -#[doc = "Context B."] -#[doc = ""] - +#[doc = "< Context B."] pub const CONTEXT_B: CAMU_Context = 2; -#[doc = "Both contexts."] -#[doc = ""] - +#[doc = "< Both contexts."] pub const CONTEXT_BOTH: CAMU_Context = 3; -#[doc = "Camera contexts."] -#[doc = ""] - +#[doc = " Camera contexts."] pub type CAMU_Context = ::libc::c_uint; -#[doc = "No flip."] -#[doc = ""] - +#[doc = "< No flip."] pub const FLIP_NONE: CAMU_Flip = 0; -#[doc = "Horizontal flip."] -#[doc = ""] - +#[doc = "< Horizontal flip."] pub const FLIP_HORIZONTAL: CAMU_Flip = 1; -#[doc = "Vertical flip."] -#[doc = ""] - +#[doc = "< Vertical flip."] pub const FLIP_VERTICAL: CAMU_Flip = 2; -#[doc = "Reverse flip."] -#[doc = ""] - +#[doc = "< Reverse flip."] pub const FLIP_REVERSE: CAMU_Flip = 3; -#[doc = "Ways to flip the camera image."] -#[doc = ""] - +#[doc = " Ways to flip the camera image."] pub type CAMU_Flip = ::libc::c_uint; -#[doc = "VGA size. (640x480)"] -#[doc = ""] - +#[doc = "< VGA size. (640x480)"] pub const SIZE_VGA: CAMU_Size = 0; -#[doc = "QVGA size. (320x240)"] -#[doc = ""] - +#[doc = "< QVGA size. (320x240)"] pub const SIZE_QVGA: CAMU_Size = 1; -#[doc = "QQVGA size. (160x120)"] -#[doc = ""] - +#[doc = "< QQVGA size. (160x120)"] pub const SIZE_QQVGA: CAMU_Size = 2; -#[doc = "CIF size. (352x288)"] -#[doc = ""] - +#[doc = "< CIF size. (352x288)"] pub const SIZE_CIF: CAMU_Size = 3; -#[doc = "QCIF size. (176x144)"] -#[doc = ""] - +#[doc = "< QCIF size. (176x144)"] pub const SIZE_QCIF: CAMU_Size = 4; -#[doc = "DS LCD size. (256x192)"] -#[doc = ""] - +#[doc = "< DS LCD size. (256x192)"] pub const SIZE_DS_LCD: CAMU_Size = 5; -#[doc = "DS LCD x4 size. (512x384)"] -#[doc = ""] - +#[doc = "< DS LCD x4 size. (512x384)"] pub const SIZE_DS_LCDx4: CAMU_Size = 6; -#[doc = "CTR Top LCD size. (400x240)"] -#[doc = ""] - +#[doc = "< CTR Top LCD size. (400x240)"] pub const SIZE_CTR_TOP_LCD: CAMU_Size = 7; -#[doc = "CTR Bottom LCD size. (320x240)"] -#[doc = ""] - +#[doc = "< CTR Bottom LCD size. (320x240)"] pub const SIZE_CTR_BOTTOM_LCD: CAMU_Size = 1; -#[doc = "Camera image resolutions."] -#[doc = ""] - +#[doc = " Camera image resolutions."] pub type CAMU_Size = ::libc::c_uint; -#[doc = "15 FPS."] -#[doc = ""] - +#[doc = "< 15 FPS."] pub const FRAME_RATE_15: CAMU_FrameRate = 0; -#[doc = "15-5 FPS."] -#[doc = ""] - +#[doc = "< 15-5 FPS."] pub const FRAME_RATE_15_TO_5: CAMU_FrameRate = 1; -#[doc = "15-2 FPS."] -#[doc = ""] - +#[doc = "< 15-2 FPS."] pub const FRAME_RATE_15_TO_2: CAMU_FrameRate = 2; -#[doc = "10 FPS."] -#[doc = ""] - +#[doc = "< 10 FPS."] pub const FRAME_RATE_10: CAMU_FrameRate = 3; -#[doc = "8.5 FPS."] -#[doc = ""] - +#[doc = "< 8.5 FPS."] pub const FRAME_RATE_8_5: CAMU_FrameRate = 4; -#[doc = "5 FPS."] -#[doc = ""] - +#[doc = "< 5 FPS."] pub const FRAME_RATE_5: CAMU_FrameRate = 5; -#[doc = "20 FPS."] -#[doc = ""] - +#[doc = "< 20 FPS."] pub const FRAME_RATE_20: CAMU_FrameRate = 6; -#[doc = "20-5 FPS."] -#[doc = ""] - +#[doc = "< 20-5 FPS."] pub const FRAME_RATE_20_TO_5: CAMU_FrameRate = 7; -#[doc = "30 FPS."] -#[doc = ""] - +#[doc = "< 30 FPS."] pub const FRAME_RATE_30: CAMU_FrameRate = 8; -#[doc = "30-5 FPS."] -#[doc = ""] - +#[doc = "< 30-5 FPS."] pub const FRAME_RATE_30_TO_5: CAMU_FrameRate = 9; -#[doc = "15-10 FPS."] -#[doc = ""] - +#[doc = "< 15-10 FPS."] pub const FRAME_RATE_15_TO_10: CAMU_FrameRate = 10; -#[doc = "20-10 FPS."] -#[doc = ""] - +#[doc = "< 20-10 FPS."] pub const FRAME_RATE_20_TO_10: CAMU_FrameRate = 11; -#[doc = "30-10 FPS."] -#[doc = ""] - +#[doc = "< 30-10 FPS."] pub const FRAME_RATE_30_TO_10: CAMU_FrameRate = 12; -#[doc = "Camera capture frame rates."] -#[doc = ""] - +#[doc = " Camera capture frame rates."] pub type CAMU_FrameRate = ::libc::c_uint; -#[doc = "Auto white balance."] -#[doc = ""] - +#[doc = "< Auto white balance."] pub const WHITE_BALANCE_AUTO: CAMU_WhiteBalance = 0; -#[doc = "3200K white balance."] -#[doc = ""] - +#[doc = "< 3200K white balance."] pub const WHITE_BALANCE_3200K: CAMU_WhiteBalance = 1; -#[doc = "4150K white balance."] -#[doc = ""] - +#[doc = "< 4150K white balance."] pub const WHITE_BALANCE_4150K: CAMU_WhiteBalance = 2; -#[doc = "5200K white balance."] -#[doc = ""] - +#[doc = "< 5200K white balance."] pub const WHITE_BALANCE_5200K: CAMU_WhiteBalance = 3; -#[doc = "6000K white balance."] -#[doc = ""] - +#[doc = "< 6000K white balance."] pub const WHITE_BALANCE_6000K: CAMU_WhiteBalance = 4; -#[doc = "7000K white balance."] -#[doc = ""] - +#[doc = "< 7000K white balance."] pub const WHITE_BALANCE_7000K: CAMU_WhiteBalance = 5; pub const WHITE_BALANCE_NORMAL: CAMU_WhiteBalance = 0; pub const WHITE_BALANCE_TUNGSTEN: CAMU_WhiteBalance = 1; @@ -10256,442 +8225,281 @@ 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; -#[doc = "Camera white balance modes."] -#[doc = ""] - +#[doc = " Camera white balance modes."] pub type CAMU_WhiteBalance = ::libc::c_uint; -#[doc = "Normal mode."] -#[doc = ""] - +#[doc = "< Normal mode."] pub const PHOTO_MODE_NORMAL: CAMU_PhotoMode = 0; -#[doc = "Portrait mode."] -#[doc = ""] - +#[doc = "< Portrait mode."] pub const PHOTO_MODE_PORTRAIT: CAMU_PhotoMode = 1; -#[doc = "Landscape mode."] -#[doc = ""] - +#[doc = "< Landscape mode."] pub const PHOTO_MODE_LANDSCAPE: CAMU_PhotoMode = 2; -#[doc = "Night mode."] -#[doc = ""] - +#[doc = "< Night mode."] pub const PHOTO_MODE_NIGHTVIEW: CAMU_PhotoMode = 3; -#[doc = "Letter mode."] -#[doc = ""] - +#[doc = "< Letter mode."] pub const PHOTO_MODE_LETTER: CAMU_PhotoMode = 4; -#[doc = "Camera photo modes."] -#[doc = ""] - +#[doc = " Camera photo modes."] pub type CAMU_PhotoMode = ::libc::c_uint; -#[doc = "No effects."] -#[doc = ""] - +#[doc = "< No effects."] pub const EFFECT_NONE: CAMU_Effect = 0; -#[doc = "Mono effect."] -#[doc = ""] - +#[doc = "< Mono effect."] pub const EFFECT_MONO: CAMU_Effect = 1; -#[doc = "Sepia effect."] -#[doc = ""] - +#[doc = "< Sepia effect."] pub const EFFECT_SEPIA: CAMU_Effect = 2; -#[doc = "Negative effect."] -#[doc = ""] - +#[doc = "< Negative effect."] pub const EFFECT_NEGATIVE: CAMU_Effect = 3; -#[doc = "Negative film effect."] -#[doc = ""] - +#[doc = "< Negative film effect."] pub const EFFECT_NEGAFILM: CAMU_Effect = 4; -#[doc = "Sepia effect."] -#[doc = ""] - +#[doc = "< Sepia effect."] pub const EFFECT_SEPIA01: CAMU_Effect = 5; -#[doc = "Camera special effects."] -#[doc = ""] - +#[doc = " Camera special effects."] pub type CAMU_Effect = ::libc::c_uint; -#[doc = "Pattern 1."] -#[doc = ""] - +#[doc = "< Pattern 1."] pub const CONTRAST_PATTERN_01: CAMU_Contrast = 0; -#[doc = "Pattern 2."] -#[doc = ""] - +#[doc = "< Pattern 2."] pub const CONTRAST_PATTERN_02: CAMU_Contrast = 1; -#[doc = "Pattern 3."] -#[doc = ""] - +#[doc = "< Pattern 3."] pub const CONTRAST_PATTERN_03: CAMU_Contrast = 2; -#[doc = "Pattern 4."] -#[doc = ""] - +#[doc = "< Pattern 4."] pub const CONTRAST_PATTERN_04: CAMU_Contrast = 3; -#[doc = "Pattern 5."] -#[doc = ""] - +#[doc = "< Pattern 5."] pub const CONTRAST_PATTERN_05: CAMU_Contrast = 4; -#[doc = "Pattern 6."] -#[doc = ""] - +#[doc = "< Pattern 6."] pub const CONTRAST_PATTERN_06: CAMU_Contrast = 5; -#[doc = "Pattern 7."] -#[doc = ""] - +#[doc = "< Pattern 7."] pub const CONTRAST_PATTERN_07: CAMU_Contrast = 6; -#[doc = "Pattern 8."] -#[doc = ""] - +#[doc = "< Pattern 8."] pub const CONTRAST_PATTERN_08: CAMU_Contrast = 7; -#[doc = "Pattern 9."] -#[doc = ""] - +#[doc = "< Pattern 9."] pub const CONTRAST_PATTERN_09: CAMU_Contrast = 8; -#[doc = "Pattern 10."] -#[doc = ""] - +#[doc = "< Pattern 10."] pub const CONTRAST_PATTERN_10: CAMU_Contrast = 9; -#[doc = "Pattern 11."] -#[doc = ""] - +#[doc = "< Pattern 11."] pub const CONTRAST_PATTERN_11: CAMU_Contrast = 10; -#[doc = "Low contrast. (5)"] -#[doc = ""] - +#[doc = "< Low contrast. (5)"] pub const CONTRAST_LOW: CAMU_Contrast = 4; -#[doc = "Normal contrast. (6)"] -#[doc = ""] - +#[doc = "< Normal contrast. (6)"] pub const CONTRAST_NORMAL: CAMU_Contrast = 5; -#[doc = "High contrast. (7)"] -#[doc = ""] - +#[doc = "< High contrast. (7)"] pub const CONTRAST_HIGH: CAMU_Contrast = 6; -#[doc = "Camera contrast patterns."] -#[doc = ""] - +#[doc = " Camera contrast patterns."] pub type CAMU_Contrast = ::libc::c_uint; -#[doc = "No lens correction."] -#[doc = ""] - +#[doc = "< No lens correction."] pub const LENS_CORRECTION_OFF: CAMU_LensCorrection = 0; -#[doc = "Edge-to-center brightness ratio of 70."] -#[doc = ""] - +#[doc = "< Edge-to-center brightness ratio of 70."] pub const LENS_CORRECTION_ON_70: CAMU_LensCorrection = 1; -#[doc = "Edge-to-center brightness ratio of 90."] -#[doc = ""] - +#[doc = "< Edge-to-center brightness ratio of 90."] pub const LENS_CORRECTION_ON_90: CAMU_LensCorrection = 2; -#[doc = "Dark lens correction. (OFF)"] -#[doc = ""] - +#[doc = "< Dark lens correction. (OFF)"] pub const LENS_CORRECTION_DARK: CAMU_LensCorrection = 0; -#[doc = "Normal lens correction. (70)"] -#[doc = ""] - +#[doc = "< Normal lens correction. (70)"] pub const LENS_CORRECTION_NORMAL: CAMU_LensCorrection = 1; -#[doc = "Bright lens correction. (90)"] -#[doc = ""] - +#[doc = "< Bright lens correction. (90)"] pub const LENS_CORRECTION_BRIGHT: CAMU_LensCorrection = 2; -#[doc = "Camera lens correction modes."] -#[doc = ""] - +#[doc = " Camera lens correction modes."] pub type CAMU_LensCorrection = ::libc::c_uint; -#[doc = "YUV422"] -#[doc = ""] - +#[doc = "< YUV422"] pub const OUTPUT_YUV_422: CAMU_OutputFormat = 0; -#[doc = "RGB565"] -#[doc = ""] - +#[doc = "< RGB565"] pub const OUTPUT_RGB_565: CAMU_OutputFormat = 1; -#[doc = "Camera image output formats."] -#[doc = ""] - +#[doc = " Camera image output formats."] pub type CAMU_OutputFormat = ::libc::c_uint; -#[doc = "Normal shutter sound."] -#[doc = ""] - +#[doc = "< Normal shutter sound."] pub const SHUTTER_SOUND_TYPE_NORMAL: CAMU_ShutterSoundType = 0; -#[doc = "Shutter sound to begin a movie."] -#[doc = ""] - +#[doc = "< Shutter sound to begin a movie."] pub const SHUTTER_SOUND_TYPE_MOVIE: CAMU_ShutterSoundType = 1; -#[doc = "Shutter sound to end a movie."] -#[doc = ""] - +#[doc = "< Shutter sound to end a movie."] pub const SHUTTER_SOUND_TYPE_MOVIE_END: CAMU_ShutterSoundType = 2; -#[doc = "Camera shutter sounds."] -#[doc = ""] - +#[doc = " Camera shutter sounds."] pub type CAMU_ShutterSoundType = ::libc::c_uint; -#[doc = "Image quality calibration data."] -#[doc = ""] +#[doc = " Image quality calibration data."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct CAMU_ImageQualityCalibrationData { - #[doc = "Auto exposure base target brightness."] - #[doc = ""] + #[doc = "< Auto exposure base target brightness."] pub aeBaseTarget: s16, - #[doc = "Left color correction matrix red normalization coefficient."] - #[doc = ""] + #[doc = "< Left color correction matrix red normalization coefficient."] pub kRL: s16, - #[doc = "Left color correction matrix green normalization coefficient."] - #[doc = ""] + #[doc = "< Left color correction matrix green normalization coefficient."] pub kGL: s16, - #[doc = "Left color correction matrix blue normalization coefficient."] - #[doc = ""] + #[doc = "< Left color correction matrix blue normalization coefficient."] pub kBL: s16, - #[doc = "Color correction matrix position."] - #[doc = ""] + #[doc = "< Color correction matrix position."] pub ccmPosition: s16, - #[doc = "Right camera, left color correction matrix red/green gain."] - #[doc = ""] + #[doc = "< Right camera, left color correction matrix red/green gain."] pub awbCcmL9Right: u16_, - #[doc = "Left camera, left color correction matrix red/green gain."] - #[doc = ""] + #[doc = "< Left camera, left color correction matrix red/green gain."] pub awbCcmL9Left: u16_, - #[doc = "Right camera, left color correction matrix blue/green gain."] - #[doc = ""] + #[doc = "< Right camera, left color correction matrix blue/green gain."] pub awbCcmL10Right: u16_, - #[doc = "Left camera, left color correction matrix blue/green gain."] - #[doc = ""] + #[doc = "< Left camera, left color correction matrix blue/green gain."] pub awbCcmL10Left: u16_, - #[doc = "Right camera, color correction matrix position threshold."] - #[doc = ""] + #[doc = "< Right camera, color correction matrix position threshold."] pub awbX0Right: u16_, - #[doc = "Left camera, color correction matrix position threshold."] - #[doc = ""] + #[doc = "< Left camera, color correction matrix position threshold."] pub awbX0Left: u16_, } -#[doc = "Stereo camera calibration data."] -#[doc = ""] +#[doc = " Stereo camera calibration data."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct CAMU_StereoCameraCalibrationData { - #[doc = "#bool Whether the X and Y rotation data is valid."] - #[doc = ""] + #[doc = "< #bool Whether the X and Y rotation data is valid."] pub isValidRotationXY: u8_, - #[doc = "Padding. (Aligns isValidRotationXY to 4 bytes)"] - #[doc = ""] + #[doc = "< Padding. (Aligns isValidRotationXY to 4 bytes)"] pub padding: [u8_; 3usize], - #[doc = "Scale to match the left camera image with the right."] - #[doc = ""] + #[doc = "< Scale to match the left camera image with the right."] pub scale: f32, - #[doc = "Z axis rotation to match the left camera image with the right."] - #[doc = ""] + #[doc = "< Z axis rotation to match the left camera image with the right."] pub rotationZ: f32, - #[doc = "X axis translation to match the left camera image with the right."] - #[doc = ""] + #[doc = "< X axis translation to match the left camera image with the right."] pub translationX: f32, - #[doc = "Y axis translation to match the left camera image with the right."] - #[doc = ""] + #[doc = "< Y axis translation to match the left camera image with the right."] pub translationY: f32, - #[doc = "X axis rotation to match the left camera image with the right."] - #[doc = ""] + #[doc = "< X axis rotation to match the left camera image with the right."] pub rotationX: f32, - #[doc = "Y axis rotation to match the left camera image with the right."] - #[doc = ""] + #[doc = "< Y axis rotation to match the left camera image with the right."] pub rotationY: f32, - #[doc = "Right camera angle of view."] - #[doc = ""] + #[doc = "< Right camera angle of view."] pub angleOfViewRight: f32, - #[doc = "Left camera angle of view."] - #[doc = ""] + #[doc = "< Left camera angle of view."] pub angleOfViewLeft: f32, - #[doc = "Distance between cameras and measurement chart."] - #[doc = ""] + #[doc = "< Distance between cameras and measurement chart."] pub distanceToChart: f32, - #[doc = "Distance between left and right cameras."] - #[doc = ""] + #[doc = "< Distance between left and right cameras."] pub distanceCameras: f32, - #[doc = "Image width."] - #[doc = ""] + #[doc = "< Image width."] pub imageWidth: s16, - #[doc = "Image height."] - #[doc = ""] + #[doc = "< Image height."] pub imageHeight: s16, - #[doc = "Reserved for future use. (unused)"] - #[doc = ""] + #[doc = "< Reserved for future use. (unused)"] pub reserved: [u8_; 16usize], } -#[doc = "Batch camera configuration for use without a context."] -#[doc = ""] +#[doc = " Batch camera configuration for use without a context."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct CAMU_PackageParameterCameraSelect { - #[doc = "Selected camera."] - #[doc = ""] + #[doc = "< Selected camera."] pub camera: u8_, - #[doc = "Camera exposure."] - #[doc = ""] + #[doc = "< Camera exposure."] pub exposure: s8, - #[doc = "#CAMU_WhiteBalance Camera white balance."] - #[doc = ""] + #[doc = "< #CAMU_WhiteBalance Camera white balance."] pub whiteBalance: u8_, - #[doc = "Camera sharpness."] - #[doc = ""] + #[doc = "< Camera sharpness."] pub sharpness: s8, - #[doc = "#bool Whether to automatically determine the proper exposure."] - #[doc = ""] + #[doc = "< #bool Whether to automatically determine the proper exposure."] pub autoExposureOn: u8_, - #[doc = "#bool Whether to automatically determine the white balance mode."] - #[doc = ""] + #[doc = "< #bool Whether to automatically determine the white balance mode."] pub autoWhiteBalanceOn: u8_, - #[doc = "#CAMU_FrameRate Camera frame rate."] - #[doc = ""] + #[doc = "< #CAMU_FrameRate Camera frame rate."] pub frameRate: u8_, - #[doc = "#CAMU_PhotoMode Camera photo mode."] - #[doc = ""] + #[doc = "< #CAMU_PhotoMode Camera photo mode."] pub photoMode: u8_, - #[doc = "#CAMU_Contrast Camera contrast."] - #[doc = ""] + #[doc = "< #CAMU_Contrast Camera contrast."] pub contrast: u8_, - #[doc = "#CAMU_LensCorrection Camera lens correction."] - #[doc = ""] + #[doc = "< #CAMU_LensCorrection Camera lens correction."] pub lensCorrection: u8_, - #[doc = "#bool Whether to enable the camera's noise filter."] - #[doc = ""] + #[doc = "< #bool Whether to enable the camera's noise filter."] pub noiseFilterOn: u8_, - #[doc = "Padding. (Aligns last 3 fields to 4 bytes)"] - #[doc = ""] + #[doc = "< Padding. (Aligns last 3 fields to 4 bytes)"] pub padding: u8_, - #[doc = "X of the region to use for auto exposure."] - #[doc = ""] + #[doc = "< X of the region to use for auto exposure."] pub autoExposureWindowX: s16, - #[doc = "Y of the region to use for auto exposure."] - #[doc = ""] + #[doc = "< Y of the region to use for auto exposure."] pub autoExposureWindowY: s16, - #[doc = "Width of the region to use for auto exposure."] - #[doc = ""] + #[doc = "< Width of the region to use for auto exposure."] pub autoExposureWindowWidth: s16, - #[doc = "Height of the region to use for auto exposure."] - #[doc = ""] + #[doc = "< Height of the region to use for auto exposure."] pub autoExposureWindowHeight: s16, - #[doc = "X of the region to use for auto white balance."] - #[doc = ""] + #[doc = "< X of the region to use for auto white balance."] pub autoWhiteBalanceWindowX: s16, - #[doc = "Y of the region to use for auto white balance."] - #[doc = ""] + #[doc = "< Y of the region to use for auto white balance."] pub autoWhiteBalanceWindowY: s16, - #[doc = "Width of the region to use for auto white balance."] - #[doc = ""] + #[doc = "< Width of the region to use for auto white balance."] pub autoWhiteBalanceWindowWidth: s16, - #[doc = "Height of the region to use for auto white balance."] - #[doc = ""] + #[doc = "< Height of the region to use for auto white balance."] pub autoWhiteBalanceWindowHeight: s16, } -#[doc = "Batch camera configuration for use with a context."] -#[doc = ""] +#[doc = " Batch camera configuration for use with a context."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct CAMU_PackageParameterContext { - #[doc = "Selected camera."] - #[doc = ""] + #[doc = "< Selected camera."] pub camera: u8_, - #[doc = "#CAMU_Context Selected context."] - #[doc = ""] + #[doc = "< #CAMU_Context Selected context."] pub context: u8_, - #[doc = "#CAMU_Flip Camera image flip mode."] - #[doc = ""] + #[doc = "< #CAMU_Flip Camera image flip mode."] pub flip: u8_, - #[doc = "#CAMU_Effect Camera image special effects."] - #[doc = ""] + #[doc = "< #CAMU_Effect Camera image special effects."] pub effect: u8_, - #[doc = "#CAMU_Size Camera image resolution."] - #[doc = ""] + #[doc = "< #CAMU_Size Camera image resolution."] pub size: u8_, } -#[doc = "Batch camera configuration for use with a context and with detailed size information."] -#[doc = ""] +#[doc = " Batch camera configuration for use with a context and with detailed size information."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct CAMU_PackageParameterContextDetail { - #[doc = "Selected camera."] - #[doc = ""] + #[doc = "< Selected camera."] pub camera: u8_, - #[doc = "#CAMU_Context Selected context."] - #[doc = ""] + #[doc = "< #CAMU_Context Selected context."] pub context: u8_, - #[doc = "#CAMU_Flip Camera image flip mode."] - #[doc = ""] + #[doc = "< #CAMU_Flip Camera image flip mode."] pub flip: u8_, - #[doc = "#CAMU_Effect Camera image special effects."] - #[doc = ""] + #[doc = "< #CAMU_Effect Camera image special effects."] pub effect: u8_, - #[doc = "Image width."] - #[doc = ""] + #[doc = "< Image width."] pub width: s16, - #[doc = "Image height."] - #[doc = ""] + #[doc = "< Image height."] pub height: s16, - #[doc = "First crop point X."] - #[doc = ""] + #[doc = "< First crop point X."] pub cropX0: s16, - #[doc = "First crop point Y."] - #[doc = ""] + #[doc = "< First crop point Y."] pub cropY0: s16, - #[doc = "Second crop point X."] - #[doc = ""] + #[doc = "< Second crop point X."] pub cropX1: s16, - #[doc = "Second crop point Y."] - #[doc = ""] + #[doc = "< Second crop point Y."] pub cropY1: s16, } extern "C" { #[must_use] - #[doc = "Initializes the cam service.\n\n This will internally get the handle of the service, and on success call CAMU_DriverInitialize."] - #[doc = ""] + #[doc = " Initializes the cam service.\n\n This will internally get the handle of the service, and on success call CAMU_DriverInitialize."] pub fn camInit() -> Result; } extern "C" { - #[doc = "Closes the cam service.\n\n This will internally call CAMU_DriverFinalize and close the handle of the service."] - #[doc = ""] + #[doc = " Closes the cam service.\n\n This will internally call CAMU_DriverFinalize and close the handle of the service."] pub fn camExit(); } extern "C" { #[must_use] - #[doc = "Begins capture on the specified camera port.\n @param port Port to begin capture on."] - #[doc = ""] + #[doc = " Begins capture on the specified camera port.\n # Arguments\n\n* `port` - Port to begin capture on."] pub fn CAMU_StartCapture(port: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Terminates capture on the specified camera port.\n @param port Port to terminate capture on."] - #[doc = ""] + #[doc = " Terminates capture on the specified camera port.\n # Arguments\n\n* `port` - Port to terminate capture on."] pub fn CAMU_StopCapture(port: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets whether the specified camera port is busy.\n @param busy Pointer to output the busy state to.\n @param port Port to check."] - #[doc = ""] + #[doc = " Gets whether the specified camera port is busy.\n # Arguments\n\n* `busy` - Pointer to output the busy state to.\n * `port` - Port to check."] pub fn CAMU_IsBusy(busy: *mut bool, port: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Clears the buffer and error flags of the specified camera port.\n @param port Port to clear."] - #[doc = ""] + #[doc = " Clears the buffer and error flags of the specified camera port.\n # Arguments\n\n* `port` - Port to clear."] pub fn CAMU_ClearBuffer(port: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets a handle to the event signaled on vsync interrupts.\n @param event Pointer to output the event handle to.\n @param port Port to use."] - #[doc = ""] + #[doc = " Gets a handle to the event signaled on vsync interrupts.\n # Arguments\n\n* `event` - Pointer to output the event handle to.\n * `port` - Port to use."] pub fn CAMU_GetVsyncInterruptEvent(event: *mut Handle, port: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets a handle to the event signaled on camera buffer errors.\n @param event Pointer to output the event handle to.\n @param port Port to use."] - #[doc = ""] + #[doc = " Gets a handle to the event signaled on camera buffer errors.\n # Arguments\n\n* `event` - Pointer to output the event handle to.\n * `port` - Port to use."] pub fn CAMU_GetBufferErrorInterruptEvent(event: *mut Handle, port: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Initiates the process of receiving a camera frame.\n @param event Pointer to output the completion event handle to.\n @param dst Buffer to write data to.\n @param port Port to receive from.\n @param imageSize Size of the image to receive.\n @param transferUnit Transfer unit to use when receiving."] - #[doc = ""] + #[doc = " Initiates the process of receiving a camera frame.\n # Arguments\n\n* `event` - Pointer to output the completion event handle to.\n * `dst` - Buffer to write data to.\n * `port` - Port to receive from.\n * `imageSize` - Size of the image to receive.\n * `transferUnit` - Transfer unit to use when receiving."] pub fn CAMU_SetReceiving( event: *mut Handle, dst: *mut ::libc::c_void, @@ -10702,56 +8510,47 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets whether the specified camera port has finished receiving image data.\n @param finishedReceiving Pointer to output the receiving status to.\n @param port Port to check."] - #[doc = ""] + #[doc = " Gets whether the specified camera port has finished receiving image data.\n # Arguments\n\n* `finishedReceiving` - Pointer to output the receiving status to.\n * `port` - Port to check."] pub fn CAMU_IsFinishedReceiving(finishedReceiving: *mut bool, port: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the number of lines to transfer into an image buffer.\n @param port Port to use.\n @param lines Lines to transfer.\n @param width Width of the image.\n @param height Height of the image."] - #[doc = ""] + #[doc = " Sets the number of lines to transfer into an image buffer.\n # Arguments\n\n* `port` - Port to use.\n * `lines` - Lines to transfer.\n * `width` - Width of the image.\n * `height` - Height of the image."] pub fn CAMU_SetTransferLines(port: u32_, lines: s16, width: s16, height: s16) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the maximum number of lines that can be saved to an image buffer.\n @param maxLines Pointer to write the maximum number of lines to.\n @param width Width of the image.\n @param height Height of the image."] - #[doc = ""] + #[doc = " Gets the maximum number of lines that can be saved to an image buffer.\n # Arguments\n\n* `maxLines` - Pointer to write the maximum number of lines to.\n * `width` - Width of the image.\n * `height` - Height of the image."] pub fn CAMU_GetMaxLines(maxLines: *mut s16, width: s16, height: s16) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the number of bytes to transfer into an image buffer.\n @param port Port to use.\n @param bytes Bytes to transfer.\n @param width Width of the image.\n @param height Height of the image."] - #[doc = ""] + #[doc = " Sets the number of bytes to transfer into an image buffer.\n # Arguments\n\n* `port` - Port to use.\n * `bytes` - Bytes to transfer.\n * `width` - Width of the image.\n * `height` - Height of the image."] pub fn CAMU_SetTransferBytes(port: u32_, bytes: u32_, width: s16, height: s16) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the number of bytes to transfer into an image buffer.\n @param transferBytes Pointer to write the number of bytes to.\n @param port Port to use."] - #[doc = ""] + #[doc = " Gets the number of bytes to transfer into an image buffer.\n # Arguments\n\n* `transferBytes` - Pointer to write the number of bytes to.\n * `port` - Port to use."] pub fn CAMU_GetTransferBytes(transferBytes: *mut u32_, port: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the maximum number of bytes that can be saved to an image buffer.\n @param maxBytes Pointer to write the maximum number of bytes to.\n @param width Width of the image.\n @param height Height of the image."] - #[doc = ""] + #[doc = " Gets the maximum number of bytes that can be saved to an image buffer.\n # Arguments\n\n* `maxBytes` - Pointer to write the maximum number of bytes to.\n * `width` - Width of the image.\n * `height` - Height of the image."] pub fn CAMU_GetMaxBytes(maxBytes: *mut u32_, width: s16, height: s16) -> Result; } extern "C" { #[must_use] - #[doc = "Sets whether image trimming is enabled.\n @param port Port to use.\n @param trimming Whether image trimming is enabled."] - #[doc = ""] + #[doc = " Sets whether image trimming is enabled.\n # Arguments\n\n* `port` - Port to use.\n * `trimming` - Whether image trimming is enabled."] pub fn CAMU_SetTrimming(port: u32_, trimming: bool) -> Result; } extern "C" { #[must_use] - #[doc = "Gets whether image trimming is enabled.\n @param trimming Pointer to output the trim state to.\n @param port Port to use."] - #[doc = ""] + #[doc = " Gets whether image trimming is enabled.\n # Arguments\n\n* `trimming` - Pointer to output the trim state to.\n * `port` - Port to use."] pub fn CAMU_IsTrimming(trimming: *mut bool, port: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the parameters used for trimming images.\n @param port Port to use.\n @param xStart Start X coordinate.\n @param yStart Start Y coordinate.\n @param xEnd End X coordinate.\n @param yEnd End Y coordinate."] - #[doc = ""] + #[doc = " Sets the parameters used for trimming images.\n # Arguments\n\n* `port` - Port to use.\n * `xStart` - Start X coordinate.\n * `yStart` - Start Y coordinate.\n * `xEnd` - End X coordinate.\n * `yEnd` - End Y coordinate."] pub fn CAMU_SetTrimmingParams( port: u32_, xStart: s16, @@ -10762,8 +8561,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets the parameters used for trimming images.\n @param xStart Pointer to write the start X coordinate to.\n @param yStart Pointer to write the start Y coordinate to.\n @param xEnd Pointer to write the end X coordinate to.\n @param yEnd Pointer to write the end Y coordinate to.\n @param port Port to use."] - #[doc = ""] + #[doc = " Gets the parameters used for trimming images.\n # Arguments\n\n* `xStart` - Pointer to write the start X coordinate to.\n * `yStart` - Pointer to write the start Y coordinate to.\n * `xEnd` - Pointer to write the end X coordinate to.\n * `yEnd` - Pointer to write the end Y coordinate to.\n * `port` - Port to use."] pub fn CAMU_GetTrimmingParams( xStart: *mut s16, yStart: *mut s16, @@ -10774,8 +8572,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Sets the parameters used for trimming images, relative to the center of the image.\n @param port Port to use.\n @param trimWidth Trim width.\n @param trimHeight Trim height.\n @param camWidth Camera width.\n @param camHeight Camera height."] - #[doc = ""] + #[doc = " Sets the parameters used for trimming images, relative to the center of the image.\n # Arguments\n\n* `port` - Port to use.\n * `trimWidth` - Trim width.\n * `trimHeight` - Trim height.\n * `camWidth` - Camera width.\n * `camHeight` - Camera height."] pub fn CAMU_SetTrimmingParamsCenter( port: u32_, trimWidth: s16, @@ -10786,32 +8583,27 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Activates the specified camera.\n @param select Camera to use."] - #[doc = ""] + #[doc = " Activates the specified camera.\n # Arguments\n\n* `select` - Camera to use."] pub fn CAMU_Activate(select: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Switches the specified camera's active context.\n @param select Camera to use.\n @param context Context to use."] - #[doc = ""] + #[doc = " Switches the specified camera's active context.\n # Arguments\n\n* `select` - Camera to use.\n * `context` - Context to use."] pub fn CAMU_SwitchContext(select: u32_, context: CAMU_Context) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the exposure value of the specified camera.\n @param select Camera to use.\n @param exposure Exposure value to use."] - #[doc = ""] + #[doc = " Sets the exposure value of the specified camera.\n # Arguments\n\n* `select` - Camera to use.\n * `exposure` - Exposure value to use."] pub fn CAMU_SetExposure(select: u32_, exposure: s8) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the white balance mode of the specified camera.\n @param select Camera to use.\n @param whiteBalance White balance mode to use."] - #[doc = ""] + #[doc = " Sets the white balance mode of the specified camera.\n # Arguments\n\n* `select` - Camera to use.\n * `whiteBalance` - White balance mode to use."] pub fn CAMU_SetWhiteBalance(select: u32_, whiteBalance: CAMU_WhiteBalance) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the white balance mode of the specified camera.\n TODO: Explain \"without base up\"?\n @param select Camera to use.\n @param whiteBalance White balance mode to use."] - #[doc = ""] + #[doc = " Sets the white balance mode of the specified camera.\n TODO: Explain \"without base up\"?\n # Arguments\n\n* `select` - Camera to use.\n * `whiteBalance` - White balance mode to use."] pub fn CAMU_SetWhiteBalanceWithoutBaseUp( select: u32_, whiteBalance: CAMU_WhiteBalance, @@ -10819,44 +8611,37 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Sets the sharpness of the specified camera.\n @param select Camera to use.\n @param sharpness Sharpness to use."] - #[doc = ""] + #[doc = " Sets the sharpness of the specified camera.\n # Arguments\n\n* `select` - Camera to use.\n * `sharpness` - Sharpness to use."] pub fn CAMU_SetSharpness(select: u32_, sharpness: s8) -> Result; } extern "C" { #[must_use] - #[doc = "Sets whether auto exposure is enabled on the specified camera.\n @param select Camera to use.\n @param autoWhiteBalance Whether auto exposure is enabled."] - #[doc = ""] + #[doc = " Sets whether auto exposure is enabled on the specified camera.\n # Arguments\n\n* `select` - Camera to use.\n * `autoWhiteBalance` - Whether auto exposure is enabled."] pub fn CAMU_SetAutoExposure(select: u32_, autoExposure: bool) -> Result; } extern "C" { #[must_use] - #[doc = "Gets whether auto exposure is enabled on the specified camera.\n @param autoExposure Pointer to output the auto exposure state to.\n @param select Camera to use."] - #[doc = ""] + #[doc = " Gets whether auto exposure is enabled on the specified camera.\n # Arguments\n\n* `autoExposure` - Pointer to output the auto exposure state to.\n * `select` - Camera to use."] pub fn CAMU_IsAutoExposure(autoExposure: *mut bool, select: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Sets whether auto white balance is enabled on the specified camera.\n @param select Camera to use.\n @param autoWhiteBalance Whether auto white balance is enabled."] - #[doc = ""] + #[doc = " Sets whether auto white balance is enabled on the specified camera.\n # Arguments\n\n* `select` - Camera to use.\n * `autoWhiteBalance` - Whether auto white balance is enabled."] pub fn CAMU_SetAutoWhiteBalance(select: u32_, autoWhiteBalance: bool) -> Result; } extern "C" { #[must_use] - #[doc = "Gets whether auto white balance is enabled on the specified camera.\n @param autoWhiteBalance Pointer to output the auto white balance state to.\n @param select Camera to use."] - #[doc = ""] + #[doc = " Gets whether auto white balance is enabled on the specified camera.\n # Arguments\n\n* `autoWhiteBalance` - Pointer to output the auto white balance state to.\n * `select` - Camera to use."] pub fn CAMU_IsAutoWhiteBalance(autoWhiteBalance: *mut bool, select: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Flips the image of the specified camera in the specified context.\n @param select Camera to use.\n @param flip Flip mode to use.\n @param context Context to use."] - #[doc = ""] + #[doc = " Flips the image of the specified camera in the specified context.\n # Arguments\n\n* `select` - Camera to use.\n * `flip` - Flip mode to use.\n * `context` - Context to use."] pub fn CAMU_FlipImage(select: u32_, flip: CAMU_Flip, context: CAMU_Context) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the image resolution of the given camera in the given context, in detail.\n @param select Camera to use.\n @param width Width to use.\n @param height Height to use.\n @param cropX0 First crop point X.\n @param cropY0 First crop point Y.\n @param cropX1 Second crop point X.\n @param cropY1 Second crop point Y.\n @param context Context to use."] - #[doc = ""] + #[doc = " Sets the image resolution of the given camera in the given context, in detail.\n # Arguments\n\n* `select` - Camera to use.\n * `width` - Width to use.\n * `height` - Height to use.\n * `cropX0` - First crop point X.\n * `cropY0` - First crop point Y.\n * `cropX1` - Second crop point X.\n * `cropY1` - Second crop point Y.\n * `context` - Context to use."] pub fn CAMU_SetDetailSize( select: u32_, width: s16, @@ -10870,44 +8655,37 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Sets the image resolution of the given camera in the given context.\n @param select Camera to use.\n @param size Size to use.\n @param context Context to use."] - #[doc = ""] + #[doc = " Sets the image resolution of the given camera in the given context.\n # Arguments\n\n* `select` - Camera to use.\n * `size` - Size to use.\n * `context` - Context to use."] pub fn CAMU_SetSize(select: u32_, size: CAMU_Size, context: CAMU_Context) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the frame rate of the given camera.\n @param select Camera to use.\n @param frameRate Frame rate to use."] - #[doc = ""] + #[doc = " Sets the frame rate of the given camera.\n # Arguments\n\n* `select` - Camera to use.\n * `frameRate` - Frame rate to use."] pub fn CAMU_SetFrameRate(select: u32_, frameRate: CAMU_FrameRate) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the photo mode of the given camera.\n @param select Camera to use.\n @param photoMode Photo mode to use."] - #[doc = ""] + #[doc = " Sets the photo mode of the given camera.\n # Arguments\n\n* `select` - Camera to use.\n * `photoMode` - Photo mode to use."] pub fn CAMU_SetPhotoMode(select: u32_, photoMode: CAMU_PhotoMode) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the special effects of the given camera in the given context.\n @param select Camera to use.\n @param effect Effect to use.\n @param context Context to use."] - #[doc = ""] + #[doc = " Sets the special effects of the given camera in the given context.\n # Arguments\n\n* `select` - Camera to use.\n * `effect` - Effect to use.\n * `context` - Context to use."] pub fn CAMU_SetEffect(select: u32_, effect: CAMU_Effect, context: CAMU_Context) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the contrast mode of the given camera.\n @param select Camera to use.\n @param contrast Contrast mode to use."] - #[doc = ""] + #[doc = " Sets the contrast mode of the given camera.\n # Arguments\n\n* `select` - Camera to use.\n * `contrast` - Contrast mode to use."] pub fn CAMU_SetContrast(select: u32_, contrast: CAMU_Contrast) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the lens correction mode of the given camera.\n @param select Camera to use.\n @param lensCorrection Lens correction mode to use."] - #[doc = ""] + #[doc = " Sets the lens correction mode of the given camera.\n # Arguments\n\n* `select` - Camera to use.\n * `lensCorrection` - Lens correction mode to use."] pub fn CAMU_SetLensCorrection(select: u32_, lensCorrection: CAMU_LensCorrection) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the output format of the given camera in the given context.\n @param select Camera to use.\n @param format Format to output.\n @param context Context to use."] - #[doc = ""] + #[doc = " Sets the output format of the given camera in the given context.\n # Arguments\n\n* `select` - Camera to use.\n * `format` - Format to output.\n * `context` - Context to use."] pub fn CAMU_SetOutputFormat( select: u32_, format: CAMU_OutputFormat, @@ -10916,8 +8694,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Sets the region to base auto exposure off of for the specified camera.\n @param select Camera to use.\n @param x X of the region.\n @param y Y of the region.\n @param width Width of the region.\n @param height Height of the region."] - #[doc = ""] + #[doc = " Sets the region to base auto exposure off of for the specified camera.\n # Arguments\n\n* `select` - Camera to use.\n * `x` - X of the region.\n * `y` - Y of the region.\n * `width` - Width of the region.\n * `height` - Height of the region."] pub fn CAMU_SetAutoExposureWindow( select: u32_, x: s16, @@ -10928,8 +8705,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Sets the region to base auto white balance off of for the specified camera.\n @param select Camera to use.\n @param x X of the region.\n @param y Y of the region.\n @param width Width of the region.\n @param height Height of the region."] - #[doc = ""] + #[doc = " Sets the region to base auto white balance off of for the specified camera.\n # Arguments\n\n* `select` - Camera to use.\n * `x` - X of the region.\n * `y` - Y of the region.\n * `width` - Width of the region.\n * `height` - Height of the region."] pub fn CAMU_SetAutoWhiteBalanceWindow( select: u32_, x: s16, @@ -10940,644 +8716,454 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Sets whether the specified camera's noise filter is enabled.\n @param select Camera to use.\n @param noiseFilter Whether the noise filter is enabled."] - #[doc = ""] + #[doc = " Sets whether the specified camera's noise filter is enabled.\n # Arguments\n\n* `select` - Camera to use.\n * `noiseFilter` - Whether the noise filter is enabled."] pub fn CAMU_SetNoiseFilter(select: u32_, noiseFilter: bool) -> Result; } extern "C" { #[must_use] - #[doc = "Synchronizes the specified cameras' vsync timing.\n @param select1 First camera.\n @param select2 Second camera."] - #[doc = ""] + #[doc = " Synchronizes the specified cameras' vsync timing.\n # Arguments\n\n* `select1` - First camera.\n * `select2` - Second camera."] pub fn CAMU_SynchronizeVsyncTiming(select1: u32_, select2: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the vsync timing record of the specified camera for the specified number of signals.\n @param timing Pointer to write timing data to. (size \"past * sizeof(s64)\")\n @param port Port to use.\n @param past Number of past timings to retrieve."] - #[doc = ""] + #[doc = " Gets the vsync timing record of the specified camera for the specified number of signals.\n # Arguments\n\n* `timing` - Pointer to write timing data to. (size \"past * sizeof(s64)\")\n * `port` - Port to use.\n * `past` - Number of past timings to retrieve."] pub fn CAMU_GetLatestVsyncTiming(timing: *mut s64, port: u32_, past: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the specified camera's stereo camera calibration data.\n @param data Pointer to output the stereo camera data to."] - #[doc = ""] + #[doc = " Gets the specified camera's stereo camera calibration data.\n # Arguments\n\n* `data` - Pointer to output the stereo camera data to."] pub fn CAMU_GetStereoCameraCalibrationData( data: *mut CAMU_StereoCameraCalibrationData, ) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the specified camera's stereo camera calibration data.\n @param data Data to set."] - #[doc = ""] + #[doc = " Sets the specified camera's stereo camera calibration data.\n # Arguments\n\n* `data` - Data to set."] pub fn CAMU_SetStereoCameraCalibrationData(data: CAMU_StereoCameraCalibrationData) -> Result; } extern "C" { #[must_use] - #[doc = "Writes to the specified I2C register of the specified camera.\n @param select Camera to write to.\n @param addr Address to write to.\n @param data Data to write."] - #[doc = ""] + #[doc = " Writes to the specified I2C register of the specified camera.\n # Arguments\n\n* `select` - Camera to write to.\n * `addr` - Address to write to.\n * `data` - Data to write."] pub fn CAMU_WriteRegisterI2c(select: u32_, addr: u16_, data: u16_) -> Result; } extern "C" { #[must_use] - #[doc = "Writes to the specified MCU variable of the specified camera.\n @param select Camera to write to.\n @param addr Address to write to.\n @param data Data to write."] - #[doc = ""] + #[doc = " Writes to the specified MCU variable of the specified camera.\n # Arguments\n\n* `select` - Camera to write to.\n * `addr` - Address to write to.\n * `data` - Data to write."] pub fn CAMU_WriteMcuVariableI2c(select: u32_, addr: u16_, data: u16_) -> Result; } extern "C" { #[must_use] - #[doc = "Reads the specified I2C register of the specified camera.\n @param data Pointer to read data to.\n @param select Camera to read from.\n @param addr Address to read."] - #[doc = ""] + #[doc = " Reads the specified I2C register of the specified camera.\n # Arguments\n\n* `data` - Pointer to read data to.\n * `select` - Camera to read from.\n * `addr` - Address to read."] pub fn CAMU_ReadRegisterI2cExclusive(data: *mut u16_, select: u32_, addr: u16_) -> Result; } extern "C" { #[must_use] - #[doc = "Reads the specified MCU variable of the specified camera.\n @param data Pointer to read data to.\n @param select Camera to read from.\n @param addr Address to read."] - #[doc = ""] + #[doc = " Reads the specified MCU variable of the specified camera.\n # Arguments\n\n* `data` - Pointer to read data to.\n * `select` - Camera to read from.\n * `addr` - Address to read."] pub fn CAMU_ReadMcuVariableI2cExclusive(data: *mut u16_, select: u32_, addr: u16_) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the specified camera's image quality calibration data.\n @param data Data to set."] - #[doc = ""] + #[doc = " Sets the specified camera's image quality calibration data.\n # Arguments\n\n* `data` - Data to set."] pub fn CAMU_SetImageQualityCalibrationData(data: CAMU_ImageQualityCalibrationData) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the specified camera's image quality calibration data.\n @param data Pointer to write the quality data to."] - #[doc = ""] + #[doc = " Gets the specified camera's image quality calibration data.\n # Arguments\n\n* `data` - Pointer to write the quality data to."] pub fn CAMU_GetImageQualityCalibrationData( data: *mut CAMU_ImageQualityCalibrationData, ) -> Result; } extern "C" { #[must_use] - #[doc = "Configures a camera with pre-packaged configuration data without a context.\n @param Parameter to use."] - #[doc = ""] + #[doc = " Configures a camera with pre-packaged configuration data without a context.\n # Arguments\n\n* `Parameter` - to use."] pub fn CAMU_SetPackageParameterWithoutContext( param: CAMU_PackageParameterCameraSelect, ) -> Result; } extern "C" { #[must_use] - #[doc = "Configures a camera with pre-packaged configuration data with a context.\n @param Parameter to use."] - #[doc = ""] + #[doc = " Configures a camera with pre-packaged configuration data with a context.\n # Arguments\n\n* `Parameter` - to use."] pub fn CAMU_SetPackageParameterWithContext(param: CAMU_PackageParameterContext) -> Result; } extern "C" { #[must_use] - #[doc = "Configures a camera with pre-packaged configuration data without a context and extra resolution details.\n @param Parameter to use."] - #[doc = ""] + #[doc = " Configures a camera with pre-packaged configuration data without a context and extra resolution details.\n # Arguments\n\n* `Parameter` - to use."] pub fn CAMU_SetPackageParameterWithContextDetail( param: CAMU_PackageParameterContextDetail, ) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the Y2R coefficient applied to image data by the camera.\n @param coefficient Pointer to output the Y2R coefficient to."] - #[doc = ""] + #[doc = " Gets the Y2R coefficient applied to image data by the camera.\n # Arguments\n\n* `coefficient` - Pointer to output the Y2R coefficient to."] pub fn CAMU_GetSuitableY2rStandardCoefficient( coefficient: *mut Y2RU_StandardCoefficient, ) -> Result; } extern "C" { #[must_use] - #[doc = "Plays the specified shutter sound.\n @param sound Shutter sound to play."] - #[doc = ""] + #[doc = " Plays the specified shutter sound.\n # Arguments\n\n* `sound` - Shutter sound to play."] pub fn CAMU_PlayShutterSound(sound: CAMU_ShutterSoundType) -> Result; } extern "C" { #[must_use] - #[doc = "Initializes the camera driver."] - #[doc = ""] + #[doc = " Initializes the camera driver."] pub fn CAMU_DriverInitialize() -> Result; } extern "C" { #[must_use] - #[doc = "Finalizes the camera driver."] - #[doc = ""] + #[doc = " Finalizes the camera driver."] pub fn CAMU_DriverFinalize() -> Result; } extern "C" { #[must_use] - #[doc = "Gets the current activated camera.\n @param select Pointer to output the current activated camera to."] - #[doc = ""] + #[doc = " Gets the current activated camera.\n # Arguments\n\n* `select` - Pointer to output the current activated camera to."] pub fn CAMU_GetActivatedCamera(select: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the current sleep camera.\n @param select Pointer to output the current sleep camera to."] - #[doc = ""] + #[doc = " Gets the current sleep camera.\n # Arguments\n\n* `select` - Pointer to output the current sleep camera to."] pub fn CAMU_GetSleepCamera(select: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the current sleep camera.\n @param select Camera to set."] - #[doc = ""] + #[doc = " Sets the current sleep camera.\n # Arguments\n\n* `select` - Camera to set."] pub fn CAMU_SetSleepCamera(select: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Sets whether to enable synchronization of left and right camera brightnesses.\n @param brightnessSynchronization Whether to enable brightness synchronization."] - #[doc = ""] + #[doc = " Sets whether to enable synchronization of left and right camera brightnesses.\n # Arguments\n\n* `brightnessSynchronization` - Whether to enable brightness synchronization."] pub fn CAMU_SetBrightnessSynchronization(brightnessSynchronization: bool) -> Result; } extern "C" { #[must_use] - #[doc = "Initializes CFGNOR.\n @param value Unknown, usually 1."] - #[doc = ""] + #[doc = " Initializes CFGNOR.\n # Arguments\n\n* `value` - Unknown, usually 1."] pub fn cfgnorInit(value: u8_) -> Result; } extern "C" { - #[doc = "Exits CFGNOR"] - #[doc = ""] + #[doc = " Exits CFGNOR"] pub fn cfgnorExit(); } extern "C" { #[must_use] - #[doc = "Dumps the NOR flash.\n @param buf Buffer to dump to.\n @param size Size of the buffer."] - #[doc = ""] + #[doc = " Dumps the NOR flash.\n # Arguments\n\n* `buf` - Buffer to dump to.\n * `size` - Size of the buffer."] pub fn cfgnorDumpFlash(buf: *mut u32_, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Writes the NOR flash.\n @param buf Buffer to write from.\n @param size Size of the buffer."] - #[doc = ""] + #[doc = " Writes the NOR flash.\n # Arguments\n\n* `buf` - Buffer to write from.\n * `size` - Size of the buffer."] pub fn cfgnorWriteFlash(buf: *mut u32_, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Initializes the CFGNOR session.\n @param value Unknown, usually 1."] - #[doc = ""] + #[doc = " Initializes the CFGNOR session.\n # Arguments\n\n* `value` - Unknown, usually 1."] pub fn CFGNOR_Initialize(value: u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Shuts down the CFGNOR session."] - #[doc = ""] + #[doc = " Shuts down the CFGNOR session."] pub fn CFGNOR_Shutdown() -> Result; } extern "C" { #[must_use] - #[doc = "Reads data from NOR.\n @param offset Offset to read from.\n @param buf Buffer to read data to.\n @param size Size of the buffer."] - #[doc = ""] + #[doc = " Reads data from NOR.\n # Arguments\n\n* `offset` - Offset to read from.\n * `buf` - Buffer to read data to.\n * `size` - Size of the buffer."] pub fn CFGNOR_ReadData(offset: u32_, buf: *mut u32_, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Writes data to NOR.\n @param offset Offset to write to.\n @param buf Buffer to write data from.\n @param size Size of the buffer."] - #[doc = ""] + #[doc = " Writes data to NOR.\n # Arguments\n\n* `offset` - Offset to write to.\n * `buf` - Buffer to write data from.\n * `size` - Size of the buffer."] pub fn CFGNOR_WriteData(offset: u32_, buf: *mut u32_, size: u32_) -> Result; } -#[doc = "Japan"] -#[doc = ""] - +#[doc = "< Japan"] pub const CFG_REGION_JPN: CFG_Region = 0; -#[doc = "USA"] -#[doc = ""] - +#[doc = "< USA"] pub const CFG_REGION_USA: CFG_Region = 1; -#[doc = "Europe"] -#[doc = ""] - +#[doc = "< Europe"] pub const CFG_REGION_EUR: CFG_Region = 2; -#[doc = "Australia"] -#[doc = ""] - +#[doc = "< Australia"] pub const CFG_REGION_AUS: CFG_Region = 3; -#[doc = "China"] -#[doc = ""] - +#[doc = "< China"] pub const CFG_REGION_CHN: CFG_Region = 4; -#[doc = "Korea"] -#[doc = ""] - +#[doc = "< Korea"] pub const CFG_REGION_KOR: CFG_Region = 5; -#[doc = "Taiwan"] -#[doc = ""] - +#[doc = "< Taiwan"] pub const CFG_REGION_TWN: CFG_Region = 6; -#[doc = "Configuration region values."] -#[doc = ""] - +#[doc = " Configuration region values."] pub type CFG_Region = ::libc::c_uint; -#[doc = "Japanese"] -#[doc = ""] - +#[doc = "< Japanese"] pub const CFG_LANGUAGE_JP: CFG_Language = 0; -#[doc = "English"] -#[doc = ""] - +#[doc = "< English"] pub const CFG_LANGUAGE_EN: CFG_Language = 1; -#[doc = "French"] -#[doc = ""] - +#[doc = "< French"] pub const CFG_LANGUAGE_FR: CFG_Language = 2; -#[doc = "German"] -#[doc = ""] - +#[doc = "< German"] pub const CFG_LANGUAGE_DE: CFG_Language = 3; -#[doc = "Italian"] -#[doc = ""] - +#[doc = "< Italian"] pub const CFG_LANGUAGE_IT: CFG_Language = 4; -#[doc = "Spanish"] -#[doc = ""] - +#[doc = "< Spanish"] pub const CFG_LANGUAGE_ES: CFG_Language = 5; -#[doc = "Simplified Chinese"] -#[doc = ""] - +#[doc = "< Simplified Chinese"] pub const CFG_LANGUAGE_ZH: CFG_Language = 6; -#[doc = "Korean"] -#[doc = ""] - +#[doc = "< Korean"] pub const CFG_LANGUAGE_KO: CFG_Language = 7; -#[doc = "Dutch"] -#[doc = ""] - +#[doc = "< Dutch"] pub const CFG_LANGUAGE_NL: CFG_Language = 8; -#[doc = "Portugese"] -#[doc = ""] - +#[doc = "< Portugese"] pub const CFG_LANGUAGE_PT: CFG_Language = 9; -#[doc = "Russian"] -#[doc = ""] - +#[doc = "< Russian"] pub const CFG_LANGUAGE_RU: CFG_Language = 10; -#[doc = "Traditional Chinese"] -#[doc = ""] - +#[doc = "< Traditional Chinese"] pub const CFG_LANGUAGE_TW: CFG_Language = 11; -#[doc = "Configuration language values."] -#[doc = ""] - +#[doc = " Configuration language values."] pub type CFG_Language = ::libc::c_uint; -#[doc = "Old 3DS (CTR)"] -#[doc = ""] - +#[doc = "< Old 3DS (CTR)"] pub const CFG_MODEL_3DS: CFG_SystemModel = 0; -#[doc = "Old 3DS XL (SPR)"] -#[doc = ""] - +#[doc = "< Old 3DS XL (SPR)"] pub const CFG_MODEL_3DSXL: CFG_SystemModel = 1; -#[doc = "New 3DS (KTR)"] -#[doc = ""] - +#[doc = "< New 3DS (KTR)"] pub const CFG_MODEL_N3DS: CFG_SystemModel = 2; -#[doc = "Old 2DS (FTR)"] -#[doc = ""] - +#[doc = "< Old 2DS (FTR)"] pub const CFG_MODEL_2DS: CFG_SystemModel = 3; -#[doc = "New 3DS XL (RED)"] -#[doc = ""] - +#[doc = "< New 3DS XL (RED)"] pub const CFG_MODEL_N3DSXL: CFG_SystemModel = 4; -#[doc = "New 2DS XL (JAN)"] -#[doc = ""] - +#[doc = "< New 2DS XL (JAN)"] pub const CFG_MODEL_N2DSXL: CFG_SystemModel = 5; pub type CFG_SystemModel = ::libc::c_uint; extern "C" { #[must_use] - #[doc = "Initializes CFGU."] - #[doc = ""] + #[doc = " Initializes CFGU."] pub fn cfguInit() -> Result; } extern "C" { - #[doc = "Exits CFGU."] - #[doc = ""] + #[doc = " Exits CFGU."] pub fn cfguExit(); } extern "C" { #[must_use] - #[doc = "Gets the system's region from secure info.\n @param region Pointer to output the region to. (see [`CFG_Region)`]"] - #[doc = ""] + #[doc = " Gets the system's region from secure info.\n # Arguments\n\n* `region` - Pointer to output the region to. (see CFG_Region)"] pub fn CFGU_SecureInfoGetRegion(region: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Generates a console-unique hash.\n @param appIDSalt Salt to use.\n @param hash Pointer to output the hash to."] - #[doc = ""] + #[doc = " Generates a console-unique hash.\n # Arguments\n\n* `appIDSalt` - Salt to use.\n * `hash` - Pointer to output the hash to."] pub fn CFGU_GenHashConsoleUnique(appIDSalt: u32_, hash: *mut u64_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets whether the system's region is Canada or USA.\n @param value Pointer to output the result to. (0 = no, 1 = yes)"] - #[doc = ""] + #[doc = " Gets whether the system's region is Canada or USA.\n # Arguments\n\n* `value` - Pointer to output the result to. (0 = no, 1 = yes)"] pub fn CFGU_GetRegionCanadaUSA(value: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the system's model.\n @param model Pointer to output the model to. (see [`CFG_SystemModel)`]"] - #[doc = ""] + #[doc = " Gets the system's model.\n # Arguments\n\n* `model` - Pointer to output the model to. (see CFG_SystemModel)"] pub fn CFGU_GetSystemModel(model: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets whether the system is a 2DS.\n @param value Pointer to output the result to. (0 = yes, 1 = no)"] - #[doc = ""] + #[doc = " Gets whether the system is a 2DS.\n # Arguments\n\n* `value` - Pointer to output the result to. (0 = yes, 1 = no)"] pub fn CFGU_GetModelNintendo2DS(value: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets a string representing a country code.\n @param code Country code to use.\n @param string Pointer to output the string to."] - #[doc = ""] + #[doc = " Gets a string representing a country code.\n # Arguments\n\n* `code` - Country code to use.\n * `string` - Pointer to output the string to."] pub fn CFGU_GetCountryCodeString(code: u16_, string: *mut u16_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets a country code ID from its string.\n @param string String to use.\n @param code Pointer to output the country code to."] - #[doc = ""] + #[doc = " Gets a country code ID from its string.\n # Arguments\n\n* `string` - String to use.\n * `code` - Pointer to output the country code to."] pub fn CFGU_GetCountryCodeID(string: u16_, code: *mut u16_) -> Result; } extern "C" { #[must_use] - #[doc = "Checks if NFC (code name: fangate) is supported.\n @param isSupported pointer to the output the result to."] - #[doc = ""] + #[doc = " Checks if NFC (code name: fangate) is supported.\n # Arguments\n\n* `isSupported` - pointer to the output the result to."] pub fn CFGU_IsNFCSupported(isSupported: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Gets a config info block with flags = 2.\n @param size Size of the data to retrieve.\n @param blkID ID of the block to retrieve.\n @param outData Pointer to write the block data to."] - #[doc = ""] + #[doc = " Gets a config info block with flags = 2.\n # Arguments\n\n* `size` - Size of the data to retrieve.\n * `blkID` - ID of the block to retrieve.\n * `outData` - Pointer to write the block data to."] pub fn CFGU_GetConfigInfoBlk2(size: u32_, blkID: u32_, outData: *mut ::libc::c_void) -> Result; } extern "C" { #[must_use] - #[doc = "Gets a config info block with flags = 4.\n @param size Size of the data to retrieve.\n @param blkID ID of the block to retrieve.\n @param outData Pointer to write the block data to."] - #[doc = ""] + #[doc = " Gets a config info block with flags = 4.\n # Arguments\n\n* `size` - Size of the data to retrieve.\n * `blkID` - ID of the block to retrieve.\n * `outData` - Pointer to write the block data to."] pub fn CFG_GetConfigInfoBlk4(size: u32_, blkID: u32_, outData: *mut ::libc::c_void) -> Result; } extern "C" { #[must_use] - #[doc = "Gets a config info block with flags = 8.\n @param size Size of the data to retrieve.\n @param blkID ID of the block to retrieve.\n @param outData Pointer to write the block data to."] - #[doc = ""] + #[doc = " Gets a config info block with flags = 8.\n # Arguments\n\n* `size` - Size of the data to retrieve.\n * `blkID` - ID of the block to retrieve.\n * `outData` - Pointer to write the block data to."] pub fn CFG_GetConfigInfoBlk8(size: u32_, blkID: u32_, outData: *mut ::libc::c_void) -> Result; } extern "C" { #[must_use] - #[doc = "Sets a config info block with flags = 4.\n @param size Size of the data to retrieve.\n @param blkID ID of the block to retrieve.\n @param inData Pointer to block data to write."] - #[doc = ""] + #[doc = " Sets a config info block with flags = 4.\n # Arguments\n\n* `size` - Size of the data to retrieve.\n * `blkID` - ID of the block to retrieve.\n * `inData` - Pointer to block data to write."] pub fn CFG_SetConfigInfoBlk4(size: u32_, blkID: u32_, inData: *const ::libc::c_void) -> Result; } extern "C" { #[must_use] - #[doc = "Sets a config info block with flags = 8.\n @param size Size of the data to retrieve.\n @param blkID ID of the block to retrieve.\n @param inData Pointer to block data to write."] - #[doc = ""] + #[doc = " Sets a config info block with flags = 8.\n # Arguments\n\n* `size` - Size of the data to retrieve.\n * `blkID` - ID of the block to retrieve.\n * `inData` - Pointer to block data to write."] pub fn CFG_SetConfigInfoBlk8(size: u32_, blkID: u32_, inData: *const ::libc::c_void) -> Result; } extern "C" { #[must_use] - #[doc = "Writes the CFG buffer in memory to the savegame in NAND."] - #[doc = ""] + #[doc = " Writes the CFG buffer in memory to the savegame in NAND."] pub fn CFG_UpdateConfigSavegame() -> Result; } extern "C" { #[must_use] - #[doc = "Gets the system's language.\n @param language Pointer to write the language to. (see [`CFG_Language)`]"] - #[doc = ""] + #[doc = " Gets the system's language.\n # Arguments\n\n* `language` - Pointer to write the language to. (see CFG_Language)"] pub fn CFGU_GetSystemLanguage(language: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Deletes the NAND LocalFriendCodeSeed file, then recreates it using the LocalFriendCodeSeed data stored in memory."] - #[doc = ""] + #[doc = " Deletes the NAND LocalFriendCodeSeed file, then recreates it using the LocalFriendCodeSeed data stored in memory."] pub fn CFGI_RestoreLocalFriendCodeSeed() -> Result; } extern "C" { #[must_use] - #[doc = "Deletes the NAND SecureInfo file, then recreates it using the SecureInfo data stored in memory."] - #[doc = ""] + #[doc = " Deletes the NAND SecureInfo file, then recreates it using the SecureInfo data stored in memory."] pub fn CFGI_RestoreSecureInfo() -> Result; } extern "C" { #[must_use] - #[doc = "Deletes the \"config\" file stored in the NAND Config_Savegame."] - #[doc = ""] + #[doc = " Deletes the \"config\" file stored in the NAND Config_Savegame."] pub fn CFGI_DeleteConfigSavefile() -> Result; } extern "C" { #[must_use] - #[doc = "Formats Config_Savegame."] - #[doc = ""] + #[doc = " Formats Config_Savegame."] pub fn CFGI_FormatConfig() -> Result; } extern "C" { #[must_use] - #[doc = "Clears parental controls"] - #[doc = ""] + #[doc = " Clears parental controls"] pub fn CFGI_ClearParentalControls() -> Result; } extern "C" { #[must_use] - #[doc = "Verifies the RSA signature for the LocalFriendCodeSeed data already stored in memory."] - #[doc = ""] + #[doc = " Verifies the RSA signature for the LocalFriendCodeSeed data already stored in memory."] pub fn CFGI_VerifySigLocalFriendCodeSeed() -> Result; } extern "C" { #[must_use] - #[doc = "Verifies the RSA signature for the SecureInfo data already stored in memory."] - #[doc = ""] + #[doc = " Verifies the RSA signature for the SecureInfo data already stored in memory."] pub fn CFGI_VerifySigSecureInfo() -> Result; } extern "C" { #[must_use] - #[doc = "Gets the system's serial number.\n @param serial Pointer to output the serial to. (This is normally 0xF)"] - #[doc = ""] + #[doc = " Gets the system's serial number.\n # Arguments\n\n* `serial` - Pointer to output the serial to. (This is normally 0xF)"] pub fn CFGI_SecureInfoGetSerialNumber(serial: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the 0x110-byte buffer containing the data for the LocalFriendCodeSeed.\n @param data Pointer to output the buffer. (The size must be at least 0x110-bytes)"] - #[doc = ""] + #[doc = " Gets the 0x110-byte buffer containing the data for the LocalFriendCodeSeed.\n # Arguments\n\n* `data` - Pointer to output the buffer. (The size must be at least 0x110-bytes)"] pub fn CFGI_GetLocalFriendCodeSeedData(data: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the 64-bit local friend code seed.\n @param seed Pointer to write the friend code seed to."] - #[doc = ""] + #[doc = " Gets the 64-bit local friend code seed.\n # Arguments\n\n* `seed` - Pointer to write the friend code seed to."] pub fn CFGI_GetLocalFriendCodeSeed(seed: *mut u64_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the 0x11-byte data following the SecureInfo signature.\n @param data Pointer to output the buffer. (The size must be at least 0x11-bytes)"] - #[doc = ""] + #[doc = " Gets the 0x11-byte data following the SecureInfo signature.\n # Arguments\n\n* `data` - Pointer to output the buffer. (The size must be at least 0x11-bytes)"] pub fn CFGI_GetSecureInfoData(data: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the 0x100-byte RSA-2048 SecureInfo signature.\n @param data Pointer to output the buffer. (The size must be at least 0x100-bytes)"] - #[doc = ""] + #[doc = " Gets the 0x100-byte RSA-2048 SecureInfo signature.\n # Arguments\n\n* `data` - Pointer to output the buffer. (The size must be at least 0x100-bytes)"] pub fn CFGI_GetSecureInfoSignature(data: *mut u8_) -> Result; } -#[doc = "PCM8"] -#[doc = ""] - +#[doc = "< PCM8"] pub const CSND_ENCODING_PCM8: _bindgen_ty_17 = 0; -#[doc = "PCM16"] -#[doc = ""] - +#[doc = "< PCM16"] pub const CSND_ENCODING_PCM16: _bindgen_ty_17 = 1; -#[doc = "IMA-ADPCM"] -#[doc = ""] - +#[doc = "< IMA-ADPCM"] pub const CSND_ENCODING_ADPCM: _bindgen_ty_17 = 2; -#[doc = "PSG (Similar to DS?)"] -#[doc = ""] - +#[doc = "< PSG (Similar to DS?)"] pub const CSND_ENCODING_PSG: _bindgen_ty_17 = 3; -#[doc = "CSND encodings."] -#[doc = ""] - +#[doc = " CSND encodings."] pub type _bindgen_ty_17 = ::libc::c_uint; -#[doc = "Manual loop."] -#[doc = ""] - +#[doc = "< Manual loop."] pub const CSND_LOOPMODE_MANUAL: _bindgen_ty_18 = 0; -#[doc = "Normal loop."] -#[doc = ""] - +#[doc = "< Normal loop."] pub const CSND_LOOPMODE_NORMAL: _bindgen_ty_18 = 1; -#[doc = "Do not loop."] -#[doc = ""] - +#[doc = "< Do not loop."] pub const CSND_LOOPMODE_ONESHOT: _bindgen_ty_18 = 2; -#[doc = "Don't reload."] -#[doc = ""] - +#[doc = "< Don't reload."] pub const CSND_LOOPMODE_NORELOAD: _bindgen_ty_18 = 3; -#[doc = "CSND loop modes."] -#[doc = ""] - +#[doc = " CSND loop modes."] pub type _bindgen_ty_18 = ::libc::c_uint; -#[doc = "Linear interpolation."] -#[doc = ""] - +#[doc = "< Linear interpolation."] pub const SOUND_LINEAR_INTERP: _bindgen_ty_19 = 64; -#[doc = "Repeat the sound."] -#[doc = ""] - +#[doc = "< Repeat the sound."] pub const SOUND_REPEAT: _bindgen_ty_19 = 1024; -#[doc = "Play the sound once."] -#[doc = ""] - +#[doc = "< Play the sound once."] pub const SOUND_ONE_SHOT: _bindgen_ty_19 = 2048; -#[doc = "PCM8"] -#[doc = ""] - +#[doc = "< PCM8"] pub const SOUND_FORMAT_8BIT: _bindgen_ty_19 = 0; -#[doc = "PCM16"] -#[doc = ""] - +#[doc = "< PCM16"] pub const SOUND_FORMAT_16BIT: _bindgen_ty_19 = 4096; -#[doc = "ADPCM"] -#[doc = ""] - +#[doc = "< ADPCM"] pub const SOUND_FORMAT_ADPCM: _bindgen_ty_19 = 8192; -#[doc = "PSG"] -#[doc = ""] - +#[doc = "< PSG"] pub const SOUND_FORMAT_PSG: _bindgen_ty_19 = 12288; -#[doc = "Enable sound."] -#[doc = ""] - +#[doc = "< Enable sound."] pub const SOUND_ENABLE: _bindgen_ty_19 = 16384; -#[doc = "Sound flags."] -#[doc = ""] - +#[doc = " Sound flags."] pub type _bindgen_ty_19 = ::libc::c_uint; -#[doc = "Repeat capture."] -#[doc = ""] - +#[doc = "< Repeat capture."] pub const CAPTURE_REPEAT: _bindgen_ty_20 = 0; -#[doc = "Capture once."] -#[doc = ""] - +#[doc = "< Capture once."] pub const CAPTURE_ONE_SHOT: _bindgen_ty_20 = 1; -#[doc = "PCM16"] -#[doc = ""] - +#[doc = "< PCM16"] pub const CAPTURE_FORMAT_16BIT: _bindgen_ty_20 = 0; -#[doc = "PCM8"] -#[doc = ""] - +#[doc = "< PCM8"] pub const CAPTURE_FORMAT_8BIT: _bindgen_ty_20 = 2; -#[doc = "Enable capture."] -#[doc = ""] - +#[doc = "< Enable capture."] pub const CAPTURE_ENABLE: _bindgen_ty_20 = 32768; -#[doc = "Capture modes."] -#[doc = ""] - +#[doc = " Capture modes."] pub type _bindgen_ty_20 = ::libc::c_uint; -#[doc = "0.0% duty cycle"] -#[doc = ""] - +#[doc = "< 0.0% duty cycle"] pub const DutyCycle_0: CSND_DutyCycle = 7; -#[doc = "12.5% duty cycle"] -#[doc = ""] - +#[doc = "< 12.5% duty cycle"] pub const DutyCycle_12: CSND_DutyCycle = 0; -#[doc = "25.0% duty cycle"] -#[doc = ""] - +#[doc = "< 25.0% duty cycle"] pub const DutyCycle_25: CSND_DutyCycle = 1; -#[doc = "37.5% duty cycle"] -#[doc = ""] - +#[doc = "< 37.5% duty cycle"] pub const DutyCycle_37: CSND_DutyCycle = 2; -#[doc = "50.0% duty cycle"] -#[doc = ""] - +#[doc = "< 50.0% duty cycle"] pub const DutyCycle_50: CSND_DutyCycle = 3; -#[doc = "62.5% duty cycle"] -#[doc = ""] - +#[doc = "< 62.5% duty cycle"] pub const DutyCycle_62: CSND_DutyCycle = 4; -#[doc = "75.0% duty cycle"] -#[doc = ""] - +#[doc = "< 75.0% duty cycle"] pub const DutyCycle_75: CSND_DutyCycle = 5; -#[doc = "87.5% duty cycle"] -#[doc = ""] - +#[doc = "< 87.5% duty cycle"] pub const DutyCycle_87: CSND_DutyCycle = 6; -#[doc = "Duty cycles for a PSG channel."] -#[doc = ""] - +#[doc = " Duty cycles for a PSG channel."] pub type CSND_DutyCycle = ::libc::c_uint; -#[doc = "Channel info."] -#[doc = ""] +#[doc = " Channel info."] #[repr(C)] #[derive(Copy, Clone)] pub union CSND_ChnInfo { - #[doc = "Raw values."] - #[doc = ""] + #[doc = "< Raw values."] pub value: [u32_; 3usize], pub __bindgen_anon_1: CSND_ChnInfo__bindgen_ty_1, } #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct CSND_ChnInfo__bindgen_ty_1 { - #[doc = "Channel active."] - #[doc = ""] + #[doc = "< Channel active."] pub active: u8_, - #[doc = "Padding."] - #[doc = ""] + #[doc = "< Padding."] pub _pad1: u8_, - #[doc = "Padding."] - #[doc = ""] + #[doc = "< Padding."] pub _pad2: u16_, - #[doc = "Current ADPCM sample."] - #[doc = ""] + #[doc = "< Current ADPCM sample."] pub adpcmSample: s16, - #[doc = "Current ADPCM index."] - #[doc = ""] + #[doc = "< Current ADPCM index."] pub adpcmIndex: u8_, - #[doc = "Padding."] - #[doc = ""] + #[doc = "< Padding."] pub _pad3: u8_, - #[doc = "Unknown."] - #[doc = ""] + #[doc = "< Unknown."] pub unknownZero: u32_, } impl Default for CSND_ChnInfo { @@ -11589,30 +9175,24 @@ impl Default for CSND_ChnInfo { } } } -#[doc = "Capture info."] -#[doc = ""] +#[doc = " Capture info."] #[repr(C)] #[derive(Copy, Clone)] pub union CSND_CapInfo { - #[doc = "Raw values."] - #[doc = ""] + #[doc = "< Raw values."] pub value: [u32_; 2usize], pub __bindgen_anon_1: CSND_CapInfo__bindgen_ty_1, } #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct CSND_CapInfo__bindgen_ty_1 { - #[doc = "Capture active."] - #[doc = ""] + #[doc = "< Capture active."] pub active: u8_, - #[doc = "Padding."] - #[doc = ""] + #[doc = "< Padding."] pub _pad1: u8_, - #[doc = "Padding."] - #[doc = ""] + #[doc = "< Padding."] pub _pad2: u16_, - #[doc = "Unknown."] - #[doc = ""] + #[doc = "< Unknown."] pub unknownZero: u32_, } impl Default for CSND_CapInfo { @@ -11625,136 +9205,111 @@ impl Default for CSND_CapInfo { } } extern "C" { - #[doc = "CSND shared memory."] - #[doc = ""] + #[doc = "< CSND shared memory."] pub static mut csndSharedMem: *mut vu32; } extern "C" { - #[doc = "CSND shared memory size."] - #[doc = ""] + #[doc = "< CSND shared memory size."] pub static mut csndSharedMemSize: u32_; } extern "C" { - #[doc = "Bitmask of channels that are allowed for usage."] - #[doc = ""] + #[doc = "< Bitmask of channels that are allowed for usage."] pub static mut csndChannels: u32_; } extern "C" { #[must_use] - #[doc = "Acquires a capture unit.\n @param capUnit Pointer to output the capture unit to."] - #[doc = ""] + #[doc = " Acquires a capture unit.\n # Arguments\n\n* `capUnit` - Pointer to output the capture unit to."] pub fn CSND_AcquireCapUnit(capUnit: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Releases a capture unit.\n @param capUnit Capture unit to release."] - #[doc = ""] + #[doc = " Releases a capture unit.\n # Arguments\n\n* `capUnit` - Capture unit to release."] pub fn CSND_ReleaseCapUnit(capUnit: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Flushes the data cache of a memory region.\n @param adr Address of the memory region.\n @param size Size of the memory region."] - #[doc = ""] + #[doc = " Flushes the data cache of a memory region.\n # Arguments\n\n* `adr` - Address of the memory region.\n * `size` - Size of the memory region."] pub fn CSND_FlushDataCache(adr: *const ::libc::c_void, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Stores the data cache of a memory region.\n @param adr Address of the memory region.\n @param size Size of the memory region."] - #[doc = ""] + #[doc = " Stores the data cache of a memory region.\n # Arguments\n\n* `adr` - Address of the memory region.\n * `size` - Size of the memory region."] pub fn CSND_StoreDataCache(adr: *const ::libc::c_void, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Invalidates the data cache of a memory region.\n @param adr Address of the memory region.\n @param size Size of the memory region."] - #[doc = ""] + #[doc = " Invalidates the data cache of a memory region.\n # Arguments\n\n* `adr` - Address of the memory region.\n * `size` - Size of the memory region."] pub fn CSND_InvalidateDataCache(adr: *const ::libc::c_void, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Resets CSND.\n Note: Currently breaks sound, don't use for now!"] - #[doc = ""] + #[doc = " Resets CSND.\n Note: Currently breaks sound, don't use for now!"] pub fn CSND_Reset() -> Result; } extern "C" { #[must_use] - #[doc = "Initializes CSND."] - #[doc = ""] + #[doc = " Initializes CSND."] pub fn csndInit() -> Result; } extern "C" { - #[doc = "Exits CSND."] - #[doc = ""] + #[doc = " Exits CSND."] pub fn csndExit(); } extern "C" { - #[doc = "Adds a command to the list, returning a buffer to write arguments to.\n @param cmdid ID of the command to add.\n @return A buffer to write command arguments to."] - #[doc = ""] + #[doc = " Adds a command to the list, returning a buffer to write arguments to.\n # Arguments\n\n* `cmdid` - ID of the command to add.\n # Returns\n\nA buffer to write command arguments to."] pub fn csndAddCmd(cmdid: ::libc::c_int) -> *mut u32_; } extern "C" { - #[doc = "Adds a command to the list, copying its arguments from a buffer.\n @param cmdid ID of the command to add.\n @param cmdparams Buffer containing the command's parameters."] - #[doc = ""] + #[doc = " Adds a command to the list, copying its arguments from a buffer.\n # Arguments\n\n* `cmdid` - ID of the command to add.\n * `cmdparams` - Buffer containing the command's parameters."] pub fn csndWriteCmd(cmdid: ::libc::c_int, cmdparams: *mut u8_); } extern "C" { #[must_use] - #[doc = "Executes pending CSND commands.\n @param waitDone Whether to wait until the commands have finished executing."] - #[doc = ""] + #[doc = " Executes pending CSND commands.\n # Arguments\n\n* `waitDone` - Whether to wait until the commands have finished executing."] pub fn csndExecCmds(waitDone: bool) -> Result; } extern "C" { - #[doc = "Sets a channel's play state, resetting registers on stop.\n @param channel Channel to use.\n @param value Play state to set."] - #[doc = ""] + #[doc = " Sets a channel's play state, resetting registers on stop.\n # Arguments\n\n* `channel` - Channel to use.\n * `value` - Play state to set."] pub fn CSND_SetPlayStateR(channel: u32_, value: u32_); } extern "C" { - #[doc = "Sets a channel's play state.\n @param channel Channel to use.\n @param value Play state to set."] - #[doc = ""] + #[doc = " Sets a channel's play state.\n # Arguments\n\n* `channel` - Channel to use.\n * `value` - Play state to set."] pub fn CSND_SetPlayState(channel: u32_, value: u32_); } extern "C" { - #[doc = "Sets a channel's encoding.\n @param channel Channel to use.\n @param value Encoding to set."] - #[doc = ""] + #[doc = " Sets a channel's encoding.\n # Arguments\n\n* `channel` - Channel to use.\n * `value` - Encoding to set."] pub fn CSND_SetEncoding(channel: u32_, value: u32_); } extern "C" { - #[doc = "Sets the data of a channel's block.\n @param channel Channel to use.\n @param block Block to set.\n @param physaddr Physical address to set the block to.\n @param size Size of the block."] - #[doc = ""] + #[doc = " Sets the data of a channel's block.\n # Arguments\n\n* `channel` - Channel to use.\n * `block` - Block to set.\n * `physaddr` - Physical address to set the block to.\n * `size` - Size of the block."] pub fn CSND_SetBlock(channel: u32_, block: ::libc::c_int, physaddr: u32_, size: u32_); } extern "C" { - #[doc = "Sets whether to loop a channel.\n @param channel Channel to use.\n @param value Whether to loop the channel."] - #[doc = ""] + #[doc = " Sets whether to loop a channel.\n # Arguments\n\n* `channel` - Channel to use.\n * `value` - Whether to loop the channel."] pub fn CSND_SetLooping(channel: u32_, value: u32_); } extern "C" { - #[doc = "Sets bit 7 of a channel.\n @param channel Channel to use.\n @param set Value to set."] - #[doc = ""] + #[doc = " Sets bit 7 of a channel.\n # Arguments\n\n* `channel` - Channel to use.\n * `set` - Value to set."] pub fn CSND_SetBit7(channel: u32_, set: bool); } extern "C" { - #[doc = "Sets whether a channel should use interpolation.\n @param channel Channel to use.\n @param interp Whether to use interpolation."] - #[doc = ""] + #[doc = " Sets whether a channel should use interpolation.\n # Arguments\n\n* `channel` - Channel to use.\n * `interp` - Whether to use interpolation."] pub fn CSND_SetInterp(channel: u32_, interp: bool); } extern "C" { - #[doc = "Sets a channel's duty.\n @param channel Channel to use.\n @param duty Duty to set."] - #[doc = ""] + #[doc = " Sets a channel's duty.\n # Arguments\n\n* `channel` - Channel to use.\n * `duty` - Duty to set."] pub fn CSND_SetDuty(channel: u32_, duty: CSND_DutyCycle); } extern "C" { - #[doc = "Sets a channel's timer.\n @param channel Channel to use.\n @param timer Timer to set."] - #[doc = ""] + #[doc = " Sets a channel's timer.\n # Arguments\n\n* `channel` - Channel to use.\n * `timer` - Timer to set."] pub fn CSND_SetTimer(channel: u32_, timer: u32_); } extern "C" { - #[doc = "Sets a channel's volume.\n @param channel Channel to use.\n @param chnVolumes Channel volume data to set.\n @param capVolumes Capture volume data to set."] - #[doc = ""] + #[doc = " Sets a channel's volume.\n # Arguments\n\n* `channel` - Channel to use.\n * `chnVolumes` - Channel volume data to set.\n * `capVolumes` - Capture volume data to set."] pub fn CSND_SetVol(channel: u32_, chnVolumes: u32_, capVolumes: u32_); } extern "C" { - #[doc = "Sets a channel's ADPCM state.\n @param channel Channel to use.\n @param block Current block.\n @param sample Current sample.\n @param index Current index."] - #[doc = ""] + #[doc = " Sets a channel's ADPCM state.\n # Arguments\n\n* `channel` - Channel to use.\n * `block` - Current block.\n * `sample` - Current sample.\n * `index` - Current index."] pub fn CSND_SetAdpcmState( channel: u32_, block: ::libc::c_int, @@ -11763,13 +9318,11 @@ extern "C" { ); } extern "C" { - #[doc = "Sets a whether channel's ADPCM data should be reloaded when the second block is played.\n @param channel Channel to use.\n @param reload Whether to reload ADPCM data."] - #[doc = ""] + #[doc = " Sets a whether channel's ADPCM data should be reloaded when the second block is played.\n # Arguments\n\n* `channel` - Channel to use.\n * `reload` - Whether to reload ADPCM data."] pub fn CSND_SetAdpcmReload(channel: u32_, reload: bool); } extern "C" { - #[doc = "Sets CSND's channel registers.\n @param flags Flags to set.\n @param physaddr0 Physical address of the first buffer to play.\n @param physaddr1 Physical address of the second buffer to play.\n @param totalbytesize Total size of the data to play.\n @param chnVolumes Channel volume data.\n @param capVolumes Capture volume data."] - #[doc = ""] + #[doc = " Sets CSND's channel registers.\n # Arguments\n\n* `flags` - Flags to set.\n * `physaddr0` - Physical address of the first buffer to play.\n * `physaddr1` - Physical address of the second buffer to play.\n * `totalbytesize` - Total size of the data to play.\n * `chnVolumes` - Channel volume data.\n * `capVolumes` - Capture volume data."] pub fn CSND_SetChnRegs( flags: u32_, physaddr0: u32_, @@ -11780,8 +9333,7 @@ extern "C" { ); } extern "C" { - #[doc = "Sets CSND's PSG channel registers.\n @param flags Flags to set.\n @param chnVolumes Channel volume data.\n @param capVolumes Capture volume data.\n @param duty Duty value to set."] - #[doc = ""] + #[doc = " Sets CSND's PSG channel registers.\n # Arguments\n\n* `flags` - Flags to set.\n * `chnVolumes` - Channel volume data.\n * `capVolumes` - Capture volume data.\n * `duty` - Duty value to set."] pub fn CSND_SetChnRegsPSG( flags: u32_, chnVolumes: u32_, @@ -11790,61 +9342,50 @@ extern "C" { ); } extern "C" { - #[doc = "Sets CSND's noise channel registers.\n @param flags Flags to set.\n @param chnVolumes Channel volume data.\n @param capVolumes Capture volume data."] - #[doc = ""] + #[doc = " Sets CSND's noise channel registers.\n # Arguments\n\n* `flags` - Flags to set.\n * `chnVolumes` - Channel volume data.\n * `capVolumes` - Capture volume data."] pub fn CSND_SetChnRegsNoise(flags: u32_, chnVolumes: u32_, capVolumes: u32_); } extern "C" { - #[doc = "Sets whether a capture unit is enabled.\n @param capUnit Capture unit to use.\n @param enable Whether to enable the capture unit."] - #[doc = ""] + #[doc = " Sets whether a capture unit is enabled.\n # Arguments\n\n* `capUnit` - Capture unit to use.\n * `enable` - Whether to enable the capture unit."] pub fn CSND_CapEnable(capUnit: u32_, enable: bool); } extern "C" { - #[doc = "Sets whether a capture unit should repeat.\n @param capUnit Capture unit to use.\n @param repeat Whether the capture unit should repeat."] - #[doc = ""] + #[doc = " Sets whether a capture unit should repeat.\n # Arguments\n\n* `capUnit` - Capture unit to use.\n * `repeat` - Whether the capture unit should repeat."] pub fn CSND_CapSetRepeat(capUnit: u32_, repeat: bool); } extern "C" { - #[doc = "Sets a capture unit's format.\n @param capUnit Capture unit to use.\n @param eightbit Format to use."] - #[doc = ""] + #[doc = " Sets a capture unit's format.\n # Arguments\n\n* `capUnit` - Capture unit to use.\n * `eightbit` - Format to use."] pub fn CSND_CapSetFormat(capUnit: u32_, eightbit: bool); } extern "C" { - #[doc = "Sets a capture unit's second bit.\n @param capUnit Capture unit to use.\n @param set Value to set."] - #[doc = ""] + #[doc = " Sets a capture unit's second bit.\n # Arguments\n\n* `capUnit` - Capture unit to use.\n * `set` - Value to set."] pub fn CSND_CapSetBit2(capUnit: u32_, set: bool); } extern "C" { - #[doc = "Sets a capture unit's timer.\n @param capUnit Capture unit to use.\n @param timer Timer to set."] - #[doc = ""] + #[doc = " Sets a capture unit's timer.\n # Arguments\n\n* `capUnit` - Capture unit to use.\n * `timer` - Timer to set."] pub fn CSND_CapSetTimer(capUnit: u32_, timer: u32_); } extern "C" { - #[doc = "Sets a capture unit's buffer.\n @param capUnit Capture unit to use.\n @param addr Buffer address to use.\n @param size Size of the buffer."] - #[doc = ""] + #[doc = " Sets a capture unit's buffer.\n # Arguments\n\n* `capUnit` - Capture unit to use.\n * `addr` - Buffer address to use.\n * `size` - Size of the buffer."] pub fn CSND_CapSetBuffer(capUnit: u32_, addr: u32_, size: u32_); } extern "C" { - #[doc = "Sets a capture unit's capture registers.\n @param capUnit Capture unit to use.\n @param flags Capture unit flags.\n @param addr Capture unit buffer address.\n @param size Buffer size."] - #[doc = ""] + #[doc = " Sets a capture unit's capture registers.\n # Arguments\n\n* `capUnit` - Capture unit to use.\n * `flags` - Capture unit flags.\n * `addr` - Capture unit buffer address.\n * `size` - Buffer size."] pub fn CSND_SetCapRegs(capUnit: u32_, flags: u32_, addr: u32_, size: u32_); } extern "C" { #[must_use] - #[doc = "Sets up DSP flags.\n @param waitDone Whether to wait for completion."] - #[doc = ""] + #[doc = " Sets up DSP flags.\n # Arguments\n\n* `waitDone` - Whether to wait for completion."] pub fn CSND_SetDspFlags(waitDone: bool) -> Result; } extern "C" { #[must_use] - #[doc = "Updates CSND information.\n @param waitDone Whether to wait for completion."] - #[doc = ""] + #[doc = " Updates CSND information.\n # Arguments\n\n* `waitDone` - Whether to wait for completion."] pub fn CSND_UpdateInfo(waitDone: bool) -> Result; } extern "C" { #[must_use] - #[doc = "Plays a sound.\n @param chn Channel to play the sound on.\n @param flags Flags containing information about the sound.\n @param sampleRate Sample rate of the sound.\n @param vol The volume, ranges from 0.0 to 1.0 included.\n @param pan The pan, ranges from -1.0 to 1.0 included.\n @param data0 First block of sound data.\n @param data1 Second block of sound data. This is the block that will be looped over.\n @param size Size of the sound data.\n\n In this implementation if the loop mode is used, data1 must be in the range [data0 ; data0 + size]. Sound will be played once from data0 to data0 + size and then loop between data1 and data0+size."] - #[doc = ""] + #[doc = " Plays a sound.\n # Arguments\n\n* `chn` - Channel to play the sound on.\n * `flags` - Flags containing information about the sound.\n * `sampleRate` - Sample rate of the sound.\n * `vol` - The volume, ranges from 0.0 to 1.0 included.\n * `pan` - The pan, ranges from -1.0 to 1.0 included.\n * `data0` - First block of sound data.\n * `data1` - Second block of sound data. This is the block that will be looped over.\n * `size` - Size of the sound data.\n\n In this implementation if the loop mode is used, data1 must be in the range [data0 ; data0 + size]. Sound will be played once from data0 to data0 + size and then loop between data1 and data0+size."] pub fn csndPlaySound( chn: ::libc::c_int, flags: u32_, @@ -11857,70 +9398,48 @@ extern "C" { ) -> Result; } extern "C" { - #[doc = "Gets CSND's DSP flags.\n Note: Requires previous CSND_UpdateInfo()\n @param outSemFlags Pointer to write semaphore flags to.\n @param outIrqFlags Pointer to write interrupt flags to."] - #[doc = ""] + #[doc = " Gets CSND's DSP flags.\n Note: Requires previous CSND_UpdateInfo()\n # Arguments\n\n* `outSemFlags` - Pointer to write semaphore flags to.\n * `outIrqFlags` - Pointer to write interrupt flags to."] pub fn csndGetDspFlags(outSemFlags: *mut u32_, outIrqFlags: *mut u32_); } extern "C" { - #[doc = "Gets a channel's information.\n Note: Requires previous CSND_UpdateInfo()\n @param channel Channel to get information for.\n @return The channel's information."] - #[doc = ""] + #[doc = " Gets a channel's information.\n Note: Requires previous CSND_UpdateInfo()\n # Arguments\n\n* `channel` - Channel to get information for.\n # Returns\n\nThe channel's information."] pub fn csndGetChnInfo(channel: u32_) -> *mut CSND_ChnInfo; } extern "C" { - #[doc = "Gets a capture unit's information.\n Note: Requires previous CSND_UpdateInfo()\n @param capUnit Capture unit to get information for.\n @return The capture unit's information."] - #[doc = ""] + #[doc = " Gets a capture unit's information.\n Note: Requires previous CSND_UpdateInfo()\n # Arguments\n\n* `capUnit` - Capture unit to get information for.\n # Returns\n\nThe capture unit's information."] pub fn csndGetCapInfo(capUnit: u32_) -> *mut CSND_CapInfo; } extern "C" { #[must_use] - #[doc = "Gets a channel's state.\n @param channel Channel to get the state of.\n @param out Pointer to output channel information to."] - #[doc = ""] + #[doc = " Gets a channel's state.\n # Arguments\n\n* `channel` - Channel to get the state of.\n * `out` - Pointer to output channel information to."] pub fn csndGetState(channel: u32_, out: *mut CSND_ChnInfo) -> Result; } extern "C" { #[must_use] - #[doc = "Gets whether a channel is playing.\n @param channel Channel to check.\n @param status Pointer to output the channel status to."] - #[doc = ""] + #[doc = " Gets whether a channel is playing.\n # Arguments\n\n* `channel` - Channel to check.\n * `status` - Pointer to output the channel status to."] pub fn csndIsPlaying(channel: u32_, status: *mut u8_) -> Result; } -#[doc = "Pipe interrupt."] -#[doc = ""] - +#[doc = "< Pipe interrupt."] pub const DSP_INTERRUPT_PIPE: DSP_InterruptType = 2; -#[doc = "DSP interrupt types."] -#[doc = ""] - +#[doc = " DSP interrupt types."] pub type DSP_InterruptType = ::libc::c_uint; -#[doc = "DSP is going to sleep."] -#[doc = ""] - +#[doc = "< DSP is going to sleep."] pub const DSPHOOK_ONSLEEP: DSP_HookType = 0; -#[doc = "DSP is waking up."] -#[doc = ""] - +#[doc = "< DSP is waking up."] pub const DSPHOOK_ONWAKEUP: DSP_HookType = 1; -#[doc = "DSP was sleeping and the app was cancelled."] -#[doc = ""] - +#[doc = "< DSP was sleeping and the app was cancelled."] pub const DSPHOOK_ONCANCEL: DSP_HookType = 2; -#[doc = "DSP hook types."] -#[doc = ""] - +#[doc = " DSP hook types."] pub type DSP_HookType = ::libc::c_uint; -#[doc = "DSP hook function."] -#[doc = ""] - +#[doc = " DSP hook function."] pub type dspHookFn = ::core::option::Option; -#[doc = "DSP hook cookie."] -#[doc = ""] +#[doc = " DSP hook cookie."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct tag_dspHookCookie { - #[doc = "Next cookie."] - #[doc = ""] + #[doc = "< Next cookie."] pub next: *mut tag_dspHookCookie, - #[doc = "Hook callback."] - #[doc = ""] + #[doc = "< Hook callback."] pub callback: dspHookFn, } impl Default for tag_dspHookCookie { @@ -11932,76 +9451,62 @@ impl Default for tag_dspHookCookie { } } } -#[doc = "DSP hook cookie."] -#[doc = ""] - +#[doc = " DSP hook cookie."] pub type dspHookCookie = tag_dspHookCookie; extern "C" { #[must_use] - #[doc = "Initializes the dsp service.\n\n Call this before calling any DSP_* function.\n @note This will also unload any previously loaded DSP binary.\n It is done this way since you have to provide your binary when the 3DS leaves sleep mode anyway."] - #[doc = ""] + #[doc = " Initializes the dsp service.\n\n Call this before calling any DSP_* function.\n > **Note:** This will also unload any previously loaded DSP binary.\n It is done this way since you have to provide your binary when the 3DS leaves sleep mode anyway."] pub fn dspInit() -> Result; } extern "C" { - #[doc = "Closes the dsp service.\n @note This will also unload the DSP binary."] - #[doc = ""] + #[doc = " Closes the dsp service.\n > **Note:** This will also unload the DSP binary."] pub fn dspExit(); } extern "C" { - #[doc = "Returns true if a component is loaded, false otherwise."] - #[doc = ""] + #[doc = " Returns true if a component is loaded, false otherwise."] pub fn dspIsComponentLoaded() -> bool; } extern "C" { - #[doc = "Sets up a DSP status hook.\n @param cookie Hook cookie to use.\n @param callback Function to call when DSP's status changes."] - #[doc = ""] + #[doc = " Sets up a DSP status hook.\n # Arguments\n\n* `cookie` - Hook cookie to use.\n * `callback` - Function to call when DSP's status changes."] pub fn dspHook(cookie: *mut dspHookCookie, callback: dspHookFn); } extern "C" { - #[doc = "Removes a DSP status hook.\n @param cookie Hook cookie to remove."] - #[doc = ""] + #[doc = " Removes a DSP status hook.\n # Arguments\n\n* `cookie` - Hook cookie to remove."] pub fn dspUnhook(cookie: *mut dspHookCookie); } extern "C" { #[must_use] - #[doc = "Checks if a headphone is inserted.\n @param is_inserted Pointer to output the insertion status to."] - #[doc = ""] + #[doc = " Checks if a headphone is inserted.\n # Arguments\n\n* `is_inserted` - Pointer to output the insertion status to."] pub fn DSP_GetHeadphoneStatus(is_inserted: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Flushes the cache\n @param address Beginning of the memory range to flush, inside the Linear or DSP memory regions\n @param size Size of the memory range to flush\n\n Flushes the cache for the specified memory range and invalidates the cache"] - #[doc = ""] + #[doc = " Flushes the cache\n # Arguments\n\n* `address` - Beginning of the memory range to flush, inside the Linear or DSP memory regions\n * `size` - Size of the memory range to flush\n\n Flushes the cache for the specified memory range and invalidates the cache"] pub fn DSP_FlushDataCache(address: *const ::libc::c_void, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Invalidates the cache\n @param address Beginning of the memory range to invalidate, inside the Linear or DSP memory regions\n @param size Size of the memory range to flush\n\n Invalidates the cache for the specified memory range"] - #[doc = ""] + #[doc = " Invalidates the cache\n # Arguments\n\n* `address` - Beginning of the memory range to invalidate, inside the Linear or DSP memory regions\n * `size` - Size of the memory range to flush\n\n Invalidates the cache for the specified memory range"] pub fn DSP_InvalidateDataCache(address: *const ::libc::c_void, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Retrieves the handle of the DSP semaphore.\n @param semaphore Pointer to output the semaphore to."] - #[doc = ""] + #[doc = " Retrieves the handle of the DSP semaphore.\n # Arguments\n\n* `semaphore` - Pointer to output the semaphore to."] pub fn DSP_GetSemaphoreHandle(semaphore: *mut Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the DSP hardware semaphore value.\n @param value Value to set."] - #[doc = ""] + #[doc = " Sets the DSP hardware semaphore value.\n # Arguments\n\n* `value` - Value to set."] pub fn DSP_SetSemaphore(value: u16_) -> Result; } extern "C" { #[must_use] - #[doc = "Masks the DSP hardware semaphore value.\n @param mask Mask to apply."] - #[doc = ""] + #[doc = " Masks the DSP hardware semaphore value.\n # Arguments\n\n* `mask` - Mask to apply."] pub fn DSP_SetSemaphoreMask(mask: u16_) -> Result; } extern "C" { #[must_use] - #[doc = "Loads a DSP binary and starts the DSP\n @param component The program file address in memory\n @param size The size of the program\n @param prog_mask DSP memory block related ? Default is 0xff.\n @param data_mask DSP memory block related ? Default is 0xff.\n @param is_loaded Indicates if the DSP was succesfully loaded.\n\n @note The binary must be signed (http://3dbrew.org/wiki/DSP_Binary)\n @note Seems to be called when the 3ds leaves the Sleep mode"] - #[doc = ""] + #[doc = " Loads a DSP binary and starts the DSP\n # Arguments\n\n* `component` - The program file address in memory\n * `size` - The size of the program\n * `prog_mask` - DSP memory block related ? Default is 0xff.\n * `data_mask` - DSP memory block related ? Default is 0xff.\n * `is_loaded` - Indicates if the DSP was succesfully loaded.\n\n > **Note:** The binary must be signed (http://3dbrew.org/wiki/DSP_Binary)\n > **Note:** Seems to be called when the 3ds leaves the Sleep mode"] pub fn DSP_LoadComponent( component: *const ::libc::c_void, size: u32_, @@ -12013,19 +9518,16 @@ extern "C" { extern "C" { #[must_use] #[doc = "Stops the DSP by unloading the binary."] - #[doc = ""] pub fn DSP_UnloadComponent() -> Result; } extern "C" { #[must_use] - #[doc = "Registers an event handle with the DSP through IPC\n @param handle Event handle to register.\n @param interrupt The type of interrupt that will trigger the event. Usual value is DSP_INTERRUPT_PIPE.\n @param channel The pipe channel. Usual value is 2\n\n @note It is possible that interrupt are inverted"] - #[doc = ""] + #[doc = " Registers an event handle with the DSP through IPC\n # Arguments\n\n* `handle` - Event handle to register.\n * `interrupt` - The type of interrupt that will trigger the event. Usual value is DSP_INTERRUPT_PIPE.\n * `channel` - The pipe channel. Usual value is 2\n\n > **Note:** It is possible that interrupt are inverted"] pub fn DSP_RegisterInterruptEvents(handle: Handle, interrupt: u32_, channel: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Reads a pipe if possible.\n @param channel unknown. Usually 2\n @param peer unknown. Usually 0\n @param buffer The buffer that will store the values read from the pipe\n @param length Length of the buffer\n @param length_read Number of bytes read by the command"] - #[doc = ""] + #[doc = " Reads a pipe if possible.\n # Arguments\n\n* `channel` - unknown. Usually 2\n * `peer` - unknown. Usually 0\n * `buffer` - The buffer that will store the values read from the pipe\n * `length` - Length of the buffer\n * `length_read` - Number of bytes read by the command"] pub fn DSP_ReadPipeIfPossible( channel: u32_, peer: u32_, @@ -12036,8 +9538,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Writes to a pipe.\n @param channel unknown. Usually 2\n @param buffer The message to send to the DSP process\n @param length Length of the message"] - #[doc = ""] + #[doc = " Writes to a pipe.\n # Arguments\n\n* `channel` - unknown. Usually 2\n * `buffer` - The message to send to the DSP process\n * `length` - Length of the message"] pub fn DSP_WriteProcessPipe( channel: u32_, buffer: *const ::libc::c_void, @@ -12046,8 +9547,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Converts a DSP memory address to a virtual address usable by the process.\n @param dsp_address Address to convert.\n @param arm_address Pointer to output the converted address to."] - #[doc = ""] + #[doc = " Converts a DSP memory address to a virtual address usable by the process.\n # Arguments\n\n* `dsp_address` - Address to convert.\n * `arm_address` - Pointer to output the converted address to."] pub fn DSP_ConvertProcessAddressFromDspDram( dsp_address: u32_, arm_address: *mut u32_, @@ -12055,26 +9555,22 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Reads a DSP register\n @param regNo Offset of the hardware register, base address is 0x1EC40000\n @param value Pointer to read the register value to."] - #[doc = ""] + #[doc = " Reads a DSP register\n # Arguments\n\n* `regNo` - Offset of the hardware register, base address is 0x1EC40000\n * `value` - Pointer to read the register value to."] pub fn DSP_RecvData(regNo: u16_, value: *mut u16_) -> Result; } extern "C" { #[must_use] - #[doc = "Checks if you can read a DSP register\n @param regNo Offset of the hardware register, base address is 0x1EC40000\n @param is_ready Pointer to write the ready status to.\n\n @warning This call might hang if the data is not ready. See [`DSP_SendDataIsEmpty`]"] - #[doc = ""] + #[doc = " Checks if you can read a DSP register\n # Arguments\n\n* `regNo` - Offset of the hardware register, base address is 0x1EC40000\n * `is_ready` - Pointer to write the ready status to.\n\n This call might hang if the data is not ready. See DSP_SendDataIsEmpty."] pub fn DSP_RecvDataIsReady(regNo: u16_, is_ready: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Writes to a DSP register\n @param regNo Offset of the hardware register, base address is 0x1EC40000\n @param value Value to write.\n\n @warning This call might hang if the SendData is not empty. See [`DSP_SendDataIsEmpty`]"] - #[doc = ""] + #[doc = " Writes to a DSP register\n # Arguments\n\n* `regNo` - Offset of the hardware register, base address is 0x1EC40000\n * `value` - Value to write.\n\n This call might hang if the SendData is not empty. See DSP_SendDataIsEmpty."] pub fn DSP_SendData(regNo: u16_, value: u16_) -> Result; } extern "C" { #[must_use] - #[doc = "Checks if you can write to a DSP register ?\n @param regNo Offset of the hardware register, base address is 0x1EC40000\n @param is_empty Pointer to write the empty status to."] - #[doc = ""] + #[doc = " Checks if you can write to a DSP register ?\n # Arguments\n\n* `regNo` - Offset of the hardware register, base address is 0x1EC40000\n * `is_empty` - Pointer to write the empty status to."] pub fn DSP_SendDataIsEmpty(regNo: u16_, is_empty: *mut bool) -> Result; } pub type FSPXI_Archive = u64_; @@ -12082,8 +9578,7 @@ pub type FSPXI_File = u64_; pub type FSPXI_Directory = u64_; extern "C" { #[must_use] - #[doc = "Opens a file.\n @param out Pointer to output the file handle to.\n @param archive Archive containing the file.\n @param path Path of the file.\n @param flags Flags to open the file with.\n @param attributes Attributes of the file."] - #[doc = ""] + #[doc = " Opens a file.\n # Arguments\n\n* `out` - Pointer to output the file handle to.\n * `archive` - Archive containing the file.\n * `path` - Path of the file.\n * `flags` - Flags to open the file with.\n * `attributes` - Attributes of the file."] pub fn FSPXI_OpenFile( serviceHandle: Handle, out: *mut FSPXI_File, @@ -12095,15 +9590,13 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Deletes a file.\n @param archive Archive containing the file.\n @param path Path of the file."] - #[doc = ""] + #[doc = " Deletes a file.\n # Arguments\n\n* `archive` - Archive containing the file.\n * `path` - Path of the file."] pub fn FSPXI_DeleteFile(serviceHandle: Handle, archive: FSPXI_Archive, path: FS_Path) -> Result; } extern "C" { #[must_use] - #[doc = "Renames a file.\n @param srcArchive Archive containing the source file.\n @param srcPath Path of the source file.\n @param dstArchive Archive containing the destination file.\n @param dstPath Path of the destination file."] - #[doc = ""] + #[doc = " Renames a file.\n # Arguments\n\n* `srcArchive` - Archive containing the source file.\n * `srcPath` - Path of the source file.\n * `dstArchive` - Archive containing the destination file.\n * `dstPath` - Path of the destination file."] pub fn FSPXI_RenameFile( serviceHandle: Handle, srcArchive: FSPXI_Archive, @@ -12114,8 +9607,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Deletes a directory.\n @param archive Archive containing the directory.\n @param path Path of the directory."] - #[doc = ""] + #[doc = " Deletes a directory.\n # Arguments\n\n* `archive` - Archive containing the directory.\n * `path` - Path of the directory."] pub fn FSPXI_DeleteDirectory( serviceHandle: Handle, archive: FSPXI_Archive, @@ -12124,8 +9616,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Creates a file.\n @param archive Archive to create the file in.\n @param path Path of the file.\n @param attributes Attributes of the file.\n @param size Size of the file."] - #[doc = ""] + #[doc = " Creates a file.\n # Arguments\n\n* `archive` - Archive to create the file in.\n * `path` - Path of the file.\n * `attributes` - Attributes of the file.\n * `size` - Size of the file."] pub fn FSPXI_CreateFile( serviceHandle: Handle, archive: FSPXI_Archive, @@ -12136,8 +9627,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Creates a directory.\n @param archive Archive to create the directory in.\n @param path Path of the directory.\n @param attributes Attributes of the directory."] - #[doc = ""] + #[doc = " Creates a directory.\n # Arguments\n\n* `archive` - Archive to create the directory in.\n * `path` - Path of the directory.\n * `attributes` - Attributes of the directory."] pub fn FSPXI_CreateDirectory( serviceHandle: Handle, archive: FSPXI_Archive, @@ -12147,8 +9637,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Renames a directory.\n @param srcArchive Archive containing the source directory.\n @param srcPath Path of the source directory.\n @param dstArchive Archive containing the destination directory.\n @param dstPath Path of the destination directory."] - #[doc = ""] + #[doc = " Renames a directory.\n # Arguments\n\n* `srcArchive` - Archive containing the source directory.\n * `srcPath` - Path of the source directory.\n * `dstArchive` - Archive containing the destination directory.\n * `dstPath` - Path of the destination directory."] pub fn FSPXI_RenameDirectory( serviceHandle: Handle, srcArchive: FSPXI_Archive, @@ -12159,8 +9648,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Opens a directory.\n @param out Pointer to output the directory handle to.\n @param archive Archive containing the directory.\n @param path Path of the directory."] - #[doc = ""] + #[doc = " Opens a directory.\n # Arguments\n\n* `out` - Pointer to output the directory handle to.\n * `archive` - Archive containing the directory.\n * `path` - Path of the directory."] pub fn FSPXI_OpenDirectory( serviceHandle: Handle, out: *mut FSPXI_Directory, @@ -12170,8 +9658,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Reads from a file.\n @param file File to read from.\n @param bytesRead Pointer to output the number of read bytes to.\n @param offset Offset to read from.\n @param buffer Buffer to read to.\n @param size Size of the buffer."] - #[doc = ""] + #[doc = " Reads from a file.\n # Arguments\n\n* `file` - File to read from.\n * `bytesRead` - Pointer to output the number of read bytes to.\n * `offset` - Offset to read from.\n * `buffer` - Buffer to read to.\n * `size` - Size of the buffer."] pub fn FSPXI_ReadFile( serviceHandle: Handle, file: FSPXI_File, @@ -12183,8 +9670,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Calculate SHA256 of a file.\n @param file File to calculate the hash of.\n @param buffer Buffer to output the hash to.\n @param size Size of the buffer."] - #[doc = ""] + #[doc = " Calculate SHA256 of a file.\n # Arguments\n\n* `file` - File to calculate the hash of.\n * `buffer` - Buffer to output the hash to.\n * `size` - Size of the buffer."] pub fn FSPXI_CalculateFileHashSHA256( serviceHandle: Handle, file: FSPXI_File, @@ -12194,8 +9680,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Writes to a file.\n @param file File to write to.\n @param bytesWritten Pointer to output the number of bytes written to.\n @param offset Offset to write to.\n @param buffer Buffer to write from.\n @param size Size of the buffer.\n @param flags Flags to use when writing."] - #[doc = ""] + #[doc = " Writes to a file.\n # Arguments\n\n* `file` - File to write to.\n * `bytesWritten` - Pointer to output the number of bytes written to.\n * `offset` - Offset to write to.\n * `buffer` - Buffer to write from.\n * `size` - Size of the buffer.\n * `flags` - Flags to use when writing."] pub fn FSPXI_WriteFile( serviceHandle: Handle, file: FSPXI_File, @@ -12208,8 +9693,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Calculates the MAC used in a DISA/DIFF header?\n @param file Unsure\n @param inBuffer 0x100-byte DISA/DIFF input buffer.\n @param inSize Size of inBuffer.\n @param outBuffer Buffer to write MAC to.\n @param outSize Size of outBuffer."] - #[doc = ""] + #[doc = " Calculates the MAC used in a DISA/DIFF header?\n # Arguments\n\n* `file` - Unsure\n * `inBuffer` - 0x100-byte DISA/DIFF input buffer.\n * `inSize` - Size of inBuffer.\n * `outBuffer` - Buffer to write MAC to.\n * `outSize` - Size of outBuffer."] pub fn FSPXI_CalcSavegameMAC( serviceHandle: Handle, file: FSPXI_File, @@ -12221,26 +9705,22 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Get size of a file\n @param file File to get the size of.\n @param size Pointer to output size to."] - #[doc = ""] + #[doc = " Get size of a file\n # Arguments\n\n* `file` - File to get the size of.\n * `size` - Pointer to output size to."] pub fn FSPXI_GetFileSize(serviceHandle: Handle, file: FSPXI_File, size: *mut u64_) -> Result; } extern "C" { #[must_use] - #[doc = "Set size of a file\n @param file File to set the size of\n @param size Size to set the file to"] - #[doc = ""] + #[doc = " Set size of a file\n # Arguments\n\n* `file` - File to set the size of\n * `size` - Size to set the file to"] pub fn FSPXI_SetFileSize(serviceHandle: Handle, file: FSPXI_File, size: u64_) -> Result; } extern "C" { #[must_use] - #[doc = "Close a file\n @param file File to close"] - #[doc = ""] + #[doc = " Close a file\n # Arguments\n\n* `file` - File to close"] pub fn FSPXI_CloseFile(serviceHandle: Handle, file: FSPXI_File) -> Result; } extern "C" { #[must_use] - #[doc = "Reads one or more directory entries.\n @param directory Directory to read from.\n @param entriesRead Pointer to output the number of entries read to.\n @param entryCount Number of entries to read.\n @param entryOut Pointer to output directory entries to."] - #[doc = ""] + #[doc = " Reads one or more directory entries.\n # Arguments\n\n* `directory` - Directory to read from.\n * `entriesRead` - Pointer to output the number of entries read to.\n * `entryCount` - Number of entries to read.\n * `entryOut` - Pointer to output directory entries to."] pub fn FSPXI_ReadDirectory( serviceHandle: Handle, directory: FSPXI_Directory, @@ -12251,14 +9731,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Close a directory\n @param directory Directory to close."] - #[doc = ""] + #[doc = " Close a directory\n # Arguments\n\n* `directory` - Directory to close."] pub fn FSPXI_CloseDirectory(serviceHandle: Handle, directory: FSPXI_Directory) -> Result; } extern "C" { #[must_use] - #[doc = "Opens an archive.\n @param archive Pointer to output the opened archive to.\n @param id ID of the archive.\n @param path Path of the archive."] - #[doc = ""] + #[doc = " Opens an archive.\n # Arguments\n\n* `archive` - Pointer to output the opened archive to.\n * `id` - ID of the archive.\n * `path` - Path of the archive."] pub fn FSPXI_OpenArchive( serviceHandle: Handle, archive: *mut FSPXI_Archive, @@ -12268,8 +9746,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Checks if the archive contains a file at path.\n @param archive Archive to check.\n @param out Pointer to output existence to.\n @param path Path to check for file"] - #[doc = ""] + #[doc = " Checks if the archive contains a file at path.\n # Arguments\n\n* `archive` - Archive to check.\n * `out` - Pointer to output existence to.\n * `path` - Path to check for file"] pub fn FSPXI_HasFile( serviceHandle: Handle, archive: FSPXI_Archive, @@ -12279,8 +9756,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Checks if the archive contains a directory at path.\n @param archive Archive to check.\n @param out Pointer to output existence to.\n @param path Path to check for directory"] - #[doc = ""] + #[doc = " Checks if the archive contains a directory at path.\n # Arguments\n\n* `archive` - Archive to check.\n * `out` - Pointer to output existence to.\n * `path` - Path to check for directory"] pub fn FSPXI_HasDirectory( serviceHandle: Handle, archive: FSPXI_Archive, @@ -12290,20 +9766,17 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Commits an archive's save data.\n @param archive Archive to commit.\n @param id Archive action sent by FSUSER_ControlArchive. Must not be 0 or 0x789D\n @remark Unsure why id is sent. This appears to be the default action for FSUSER_ControlArchive, with every action other than 0 and 0x789D being sent to this command."] - #[doc = ""] + #[doc = " Commits an archive's save data.\n # Arguments\n\n* `archive` - Archive to commit.\n * `id` - Archive action sent by FSUSER_ControlArchive. Must not be 0 or 0x789D\n > Unsure why id is sent. This appears to be the default action for FSUSER_ControlArchive, with every action other than 0 and 0x789D being sent to this command."] pub fn FSPXI_CommitSaveData(serviceHandle: Handle, archive: FSPXI_Archive, id: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Close an archive\n @param archive Archive to close."] - #[doc = ""] + #[doc = " Close an archive\n # Arguments\n\n* `archive` - Archive to close."] pub fn FSPXI_CloseArchive(serviceHandle: Handle, archive: FSPXI_Archive) -> Result; } extern "C" { #[must_use] - #[doc = "Unknown 0x17. Appears to be an \"is archive handle valid\" command?\n @param archive Archive handle to check validity of.\n @param out Pointer to output validity to."] - #[doc = ""] + #[doc = " Unknown 0x17. Appears to be an \"is archive handle valid\" command?\n # Arguments\n\n* `archive` - Archive handle to check validity of.\n * `out` - Pointer to output validity to."] pub fn FSPXI_Unknown0x17( serviceHandle: Handle, archive: FSPXI_Archive, @@ -12312,14 +9785,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets the inserted card type.\n @param out Pointer to output the card type to."] - #[doc = ""] + #[doc = " Gets the inserted card type.\n # Arguments\n\n* `out` - Pointer to output the card type to."] pub fn FSPXI_GetCardType(serviceHandle: Handle, out: *mut FS_CardType) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the SDMC archive resource information.\n @param out Pointer to output the archive resource information to."] - #[doc = ""] + #[doc = " Gets the SDMC archive resource information.\n # Arguments\n\n* `out` - Pointer to output the archive resource information to."] pub fn FSPXI_GetSdmcArchiveResource( serviceHandle: Handle, out: *mut FS_ArchiveResource, @@ -12327,8 +9798,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets the NAND archive resource information.\n @param out Pointer to output the archive resource information to."] - #[doc = ""] + #[doc = " Gets the NAND archive resource information.\n # Arguments\n\n* `out` - Pointer to output the archive resource information to."] pub fn FSPXI_GetNandArchiveResource( serviceHandle: Handle, out: *mut FS_ArchiveResource, @@ -12336,104 +9806,87 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets the error code from the SDMC FatFS driver\n @param out Pointer to output the error code to"] - #[doc = ""] + #[doc = " Gets the error code from the SDMC FatFS driver\n # Arguments\n\n* `out` - Pointer to output the error code to"] pub fn FSPXI_GetSdmcFatFsError(serviceHandle: Handle, out: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets whether PXIFS0 detects the SD\n @param out Pointer to output the detection status to"] - #[doc = ""] + #[doc = " Gets whether PXIFS0 detects the SD\n # Arguments\n\n* `out` - Pointer to output the detection status to"] pub fn FSPXI_IsSdmcDetected(serviceHandle: Handle, out: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Gets whether PXIFS0 can write to the SD\n @param out Pointer to output the writable status to"] - #[doc = ""] + #[doc = " Gets whether PXIFS0 can write to the SD\n # Arguments\n\n* `out` - Pointer to output the writable status to"] pub fn FSPXI_IsSdmcWritable(serviceHandle: Handle, out: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the SDMC CID\n @param out Buffer to output the CID to.\n @param size Size of buffer."] - #[doc = ""] + #[doc = " Gets the SDMC CID\n # Arguments\n\n* `out` - Buffer to output the CID to.\n * `size` - Size of buffer."] pub fn FSPXI_GetSdmcCid(serviceHandle: Handle, out: *mut ::libc::c_void, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the NAND CID\n @param out Buffer to output the CID to.\n @param size Size of buffer."] - #[doc = ""] + #[doc = " Gets the NAND CID\n # Arguments\n\n* `out` - Buffer to output the CID to.\n * `size` - Size of buffer."] pub fn FSPXI_GetNandCid(serviceHandle: Handle, out: *mut ::libc::c_void, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the SDMC speed info\n @param out Buffer to output the speed info to."] - #[doc = ""] + #[doc = " Gets the SDMC speed info\n # Arguments\n\n* `out` - Buffer to output the speed info to."] pub fn FSPXI_GetSdmcSpeedInfo(serviceHandle: Handle, out: *mut FS_SdMmcSpeedInfo) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the NAND speed info\n @param out Buffer to output the speed info to."] - #[doc = ""] + #[doc = " Gets the NAND speed info\n # Arguments\n\n* `out` - Buffer to output the speed info to."] pub fn FSPXI_GetNandSpeedInfo(serviceHandle: Handle, out: *mut FS_SdMmcSpeedInfo) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the SDMC log\n @param out Buffer to output the log to.\n @param size Size of buffer."] - #[doc = ""] + #[doc = " Gets the SDMC log\n # Arguments\n\n* `out` - Buffer to output the log to.\n * `size` - Size of buffer."] pub fn FSPXI_GetSdmcLog(serviceHandle: Handle, out: *mut ::libc::c_void, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the NAND log\n @param out Buffer to output the log to.\n @param size Size of buffer."] - #[doc = ""] + #[doc = " Gets the NAND log\n # Arguments\n\n* `out` - Buffer to output the log to.\n * `size` - Size of buffer."] pub fn FSPXI_GetNandLog(serviceHandle: Handle, out: *mut ::libc::c_void, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Clears the SDMC log"] - #[doc = ""] + #[doc = " Clears the SDMC log"] pub fn FSPXI_ClearSdmcLog(serviceHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Clears the NAND log"] - #[doc = ""] + #[doc = " Clears the NAND log"] pub fn FSPXI_ClearNandLog(serviceHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Gets whether a card is inserted.\n @param inserted Pointer to output the insertion status to."] - #[doc = ""] + #[doc = " Gets whether a card is inserted.\n # Arguments\n\n* `inserted` - Pointer to output the insertion status to."] pub fn FSPXI_CardSlotIsInserted(serviceHandle: Handle, inserted: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Powers on the card slot.\n @param status Pointer to output the power status to."] - #[doc = ""] + #[doc = " Powers on the card slot.\n # Arguments\n\n* `status` - Pointer to output the power status to."] pub fn FSPXI_CardSlotPowerOn(serviceHandle: Handle, status: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Powers off the card slot.\n @param status Pointer to output the power status to."] - #[doc = ""] + #[doc = " Powers off the card slot.\n # Arguments\n\n* `status` - Pointer to output the power status to."] pub fn FSPXI_CardSlotPowerOff(serviceHandle: Handle, status: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the card's power status.\n @param status Pointer to output the power status to."] - #[doc = ""] + #[doc = " Gets the card's power status.\n # Arguments\n\n* `status` - Pointer to output the power status to."] pub fn FSPXI_CardSlotGetCardIFPowerStatus(serviceHandle: Handle, status: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Executes a CARDNOR direct command.\n @param commandId ID of the command."] - #[doc = ""] + #[doc = " Executes a CARDNOR direct command.\n # Arguments\n\n* `commandId` - ID of the command."] pub fn FSPXI_CardNorDirectCommand(serviceHandle: Handle, commandId: u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Executes a CARDNOR direct command with an address.\n @param commandId ID of the command.\n @param address Address to provide."] - #[doc = ""] + #[doc = " Executes a CARDNOR direct command with an address.\n # Arguments\n\n* `commandId` - ID of the command.\n * `address` - Address to provide."] pub fn FSPXI_CardNorDirectCommandWithAddress( serviceHandle: Handle, commandId: u8_, @@ -12442,8 +9895,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Executes a CARDNOR direct read.\n @param commandId ID of the command.\n @param size Size of the output buffer.\n @param output Output buffer."] - #[doc = ""] + #[doc = " Executes a CARDNOR direct read.\n # Arguments\n\n* `commandId` - ID of the command.\n * `size` - Size of the output buffer.\n * `output` - Output buffer."] pub fn FSPXI_CardNorDirectRead( serviceHandle: Handle, commandId: u8_, @@ -12453,8 +9905,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Executes a CARDNOR direct read with an address.\n @param commandId ID of the command.\n @param address Address to provide.\n @param size Size of the output buffer.\n @param output Output buffer."] - #[doc = ""] + #[doc = " Executes a CARDNOR direct read with an address.\n # Arguments\n\n* `commandId` - ID of the command.\n * `address` - Address to provide.\n * `size` - Size of the output buffer.\n * `output` - Output buffer."] pub fn FSPXI_CardNorDirectReadWithAddress( serviceHandle: Handle, commandId: u8_, @@ -12465,8 +9916,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Executes a CARDNOR direct write.\n @param commandId ID of the command.\n @param size Size of the input buffer.\n @param output Input buffer.\n @remark Stubbed in latest firmware, since ?.?.?"] - #[doc = ""] + #[doc = " Executes a CARDNOR direct write.\n # Arguments\n\n* `commandId` - ID of the command.\n * `size` - Size of the input buffer.\n * `output` - Input buffer.\n > Stubbed in latest firmware, since ?.?.?"] pub fn FSPXI_CardNorDirectWrite( serviceHandle: Handle, commandId: u8_, @@ -12476,8 +9926,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Executes a CARDNOR direct write with an address.\n @param commandId ID of the command.\n @param address Address to provide.\n @param size Size of the input buffer.\n @param input Input buffer."] - #[doc = ""] + #[doc = " Executes a CARDNOR direct write with an address.\n # Arguments\n\n* `commandId` - ID of the command.\n * `address` - Address to provide.\n * `size` - Size of the input buffer.\n * `input` - Input buffer."] pub fn FSPXI_CardNorDirectWriteWithAddress( serviceHandle: Handle, commandId: u8_, @@ -12488,8 +9937,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Executes a CARDNOR 4xIO direct read.\n @param commandId ID of the command.\n @param address Address to provide.\n @param size Size of the output buffer.\n @param output Output buffer."] - #[doc = ""] + #[doc = " Executes a CARDNOR 4xIO direct read.\n # Arguments\n\n* `commandId` - ID of the command.\n * `address` - Address to provide.\n * `size` - Size of the output buffer.\n * `output` - Output buffer."] pub fn FSPXI_CardNorDirectRead_4xIO( serviceHandle: Handle, commandId: u8_, @@ -12500,8 +9948,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Executes a CARDNOR direct CPU write without verify.\n @param address Address to provide.\n @param size Size of the input buffer.\n @param output Input buffer."] - #[doc = ""] + #[doc = " Executes a CARDNOR direct CPU write without verify.\n # Arguments\n\n* `address` - Address to provide.\n * `size` - Size of the input buffer.\n * `output` - Input buffer."] pub fn FSPXI_CardNorDirectCpuWriteWithoutVerify( serviceHandle: Handle, address: u32_, @@ -12511,8 +9958,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Executes a CARDNOR direct sector erase without verify.\n @param address Address to provide."] - #[doc = ""] + #[doc = " Executes a CARDNOR direct sector erase without verify.\n # Arguments\n\n* `address` - Address to provide."] pub fn FSPXI_CardNorDirectSectorEraseWithoutVerify( serviceHandle: Handle, address: u32_, @@ -12520,8 +9966,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets an NCCH's product info\n @param info Pointer to output the product info to.\n @param archive Open NCCH content archive"] - #[doc = ""] + #[doc = " Gets an NCCH's product info\n # Arguments\n\n* `info` - Pointer to output the product info to.\n * `archive` - Open NCCH content archive"] pub fn FSPXI_GetProductInfo( serviceHandle: Handle, info: *mut FS_ProductInfo, @@ -12530,38 +9975,32 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Sets the CARDSPI baud rate.\n @param baudRate Baud rate to set."] - #[doc = ""] + #[doc = " Sets the CARDSPI baud rate.\n # Arguments\n\n* `baudRate` - Baud rate to set."] pub fn FSPXI_SetCardSpiBaudrate(serviceHandle: Handle, baudRate: FS_CardSpiBaudRate) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the CARDSPI bus mode.\n @param busMode Bus mode to set."] - #[doc = ""] + #[doc = " Sets the CARDSPI bus mode.\n # Arguments\n\n* `busMode` - Bus mode to set."] pub fn FSPXI_SetCardSpiBusMode(serviceHandle: Handle, busMode: FS_CardSpiBusMode) -> Result; } extern "C" { #[must_use] - #[doc = "Sends initialization info to ARM9\n @param unk FS sends *(0x1FF81086)"] - #[doc = ""] + #[doc = " Sends initialization info to ARM9\n # Arguments\n\n* `unk` - FS sends *(0x1FF81086)"] pub fn FSPXI_SendInitializeInfoTo9(serviceHandle: Handle, unk: u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Creates ext save data.\n @param info Info of the save data."] - #[doc = ""] + #[doc = " Creates ext save data.\n # Arguments\n\n* `info` - Info of the save data."] pub fn FSPXI_CreateExtSaveData(serviceHandle: Handle, info: FS_ExtSaveDataInfo) -> Result; } extern "C" { #[must_use] - #[doc = "Deletes ext save data.\n @param info Info of the save data."] - #[doc = ""] + #[doc = " Deletes ext save data.\n # Arguments\n\n* `info` - Info of the save data."] pub fn FSPXI_DeleteExtSaveData(serviceHandle: Handle, info: FS_ExtSaveDataInfo) -> Result; } extern "C" { #[must_use] - #[doc = "Enumerates ext save data.\n @param idsWritten Pointer to output the number of IDs written to.\n @param idsSize Size of the IDs buffer.\n @param mediaType Media type to enumerate over.\n @param idSize Size of each ID element.\n @param shared Whether to enumerate shared ext save data.\n @param ids Pointer to output IDs to."] - #[doc = ""] + #[doc = " Enumerates ext save data.\n # Arguments\n\n* `idsWritten` - Pointer to output the number of IDs written to.\n * `idsSize` - Size of the IDs buffer.\n * `mediaType` - Media type to enumerate over.\n * `idSize` - Size of each ID element.\n * `shared` - Whether to enumerate shared ext save data.\n * `ids` - Pointer to output IDs to."] pub fn FSPXI_EnumerateExtSaveData( serviceHandle: Handle, idsWritten: *mut u32_, @@ -12574,8 +10013,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets a special content's index.\n @param index Pointer to output the index to.\n @param mediaType Media type of the special content.\n @param programId Program ID owning the special content.\n @param type Type of special content."] - #[doc = ""] + #[doc = " Gets a special content's index.\n # Arguments\n\n* `index` - Pointer to output the index to.\n * `mediaType` - Media type of the special content.\n * `programId` - Program ID owning the special content.\n * `type` - Type of special content."] pub fn FSPXI_GetSpecialContentIndex( serviceHandle: Handle, index: *mut u16_, @@ -12586,8 +10024,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets the legacy ROM header of a program.\n @param mediaType Media type of the program.\n @param programId ID of the program.\n @param header Pointer to output the legacy ROM header to. (size = 0x3B4)"] - #[doc = ""] + #[doc = " Gets the legacy ROM header of a program.\n # Arguments\n\n* `mediaType` - Media type of the program.\n * `programId` - ID of the program.\n * `header` - Pointer to output the legacy ROM header to. (size = 0x3B4)"] pub fn FSPXI_GetLegacyRomHeader( serviceHandle: Handle, mediaType: FS_MediaType, @@ -12597,8 +10034,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets the legacy banner data of a program.\n @param mediaType Media type of the program.\n @param programId ID of the program.\n @param banner Pointer to output the legacy banner data to. (size = 0x23C0)\n @param unk Unknown. Always 1?"] - #[doc = ""] + #[doc = " Gets the legacy banner data of a program.\n # Arguments\n\n* `mediaType` - Media type of the program.\n * `programId` - ID of the program.\n * `banner` - Pointer to output the legacy banner data to. (size = 0x23C0)\n * `unk` - Unknown. Always 1?"] pub fn FSPXI_GetLegacyBannerData( serviceHandle: Handle, mediaType: FS_MediaType, @@ -12609,44 +10045,37 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Formats the CARDNOR device.\n @param unk Unknown. Transaction?"] - #[doc = ""] + #[doc = " Formats the CARDNOR device.\n # Arguments\n\n* `unk` - Unknown. Transaction?"] pub fn FSPXI_FormatCardNorDevice(serviceHandle: Handle, unk: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Deletes the 3DS SDMC root."] - #[doc = ""] + #[doc = " Deletes the 3DS SDMC root."] pub fn FSPXI_DeleteSdmcRoot(serviceHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Deletes all ext save data on the NAND."] - #[doc = ""] + #[doc = " Deletes all ext save data on the NAND."] pub fn FSPXI_DeleteAllExtSaveDataOnNand(serviceHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Initializes the CTR file system."] - #[doc = ""] + #[doc = " Initializes the CTR file system."] pub fn FSPXI_InitializeCtrFilesystem(serviceHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Creates the FS seed."] - #[doc = ""] + #[doc = " Creates the FS seed."] pub fn FSPXI_CreateSeed(serviceHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the CTR SDMC root path.\n @param out Pointer to output the root path to.\n @param length Length of the output buffer in bytes."] - #[doc = ""] + #[doc = " Gets the CTR SDMC root path.\n # Arguments\n\n* `out` - Pointer to output the root path to.\n * `length` - Length of the output buffer in bytes."] pub fn FSPXI_GetSdmcCtrRootPath(serviceHandle: Handle, out: *mut u16_, length: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets an archive's resource information.\n @param archiveResource Pointer to output the archive resource information to.\n @param mediaType System media type to check."] - #[doc = ""] + #[doc = " Gets an archive's resource information.\n # Arguments\n\n* `archiveResource` - Pointer to output the archive resource information to.\n * `mediaType` - System media type to check."] pub fn FSPXI_GetArchiveResource( serviceHandle: Handle, archiveResource: *mut FS_ArchiveResource, @@ -12655,8 +10084,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Exports the integrity verification seed.\n @param seed Pointer to output the seed to."] - #[doc = ""] + #[doc = " Exports the integrity verification seed.\n # Arguments\n\n* `seed` - Pointer to output the seed to."] pub fn FSPXI_ExportIntegrityVerificationSeed( serviceHandle: Handle, seed: *mut FS_IntegrityVerificationSeed, @@ -12664,8 +10092,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Imports an integrity verification seed.\n @param seed Seed to import."] - #[doc = ""] + #[doc = " Imports an integrity verification seed.\n # Arguments\n\n* `seed` - Seed to import."] pub fn FSPXI_ImportIntegrityVerificationSeed( serviceHandle: Handle, seed: *const FS_IntegrityVerificationSeed, @@ -12673,8 +10100,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets the legacy sub banner data of a program.\n @param bannerSize Size of the banner.\n @param mediaType Media type of the program.\n @param programId ID of the program.\n @param header Pointer to output the legacy sub banner data to."] - #[doc = ""] + #[doc = " Gets the legacy sub banner data of a program.\n # Arguments\n\n* `bannerSize` - Size of the banner.\n * `mediaType` - Media type of the program.\n * `programId` - ID of the program.\n * `header` - Pointer to output the legacy sub banner data to."] pub fn FSPXI_GetLegacySubBannerData( serviceHandle: Handle, bannerSize: u32_, @@ -12685,8 +10111,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Generates random bytes. Uses same code as PSPXI_GenerateRandomBytes\n @param buf Buffer to output random bytes to.\n @param size Size of buffer."] - #[doc = ""] + #[doc = " Generates random bytes. Uses same code as PSPXI_GenerateRandomBytes\n # Arguments\n\n* `buf` - Buffer to output random bytes to.\n * `size` - Size of buffer."] pub fn FSPXI_GenerateRandomBytes( serviceHandle: Handle, buffer: *mut ::libc::c_void, @@ -12695,8 +10120,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets the last modified time of a file in an archive.\n @param archive The archive that contains the file.\n @param out The pointer to write the timestamp to.\n @param path The UTF-16 path of the file.\n @param size The size of the path."] - #[doc = ""] + #[doc = " Gets the last modified time of a file in an archive.\n # Arguments\n\n* `archive` - The archive that contains the file.\n * `out` - The pointer to write the timestamp to.\n * `path` - The UTF-16 path of the file.\n * `size` - The size of the path."] pub fn FSPXI_GetFileLastModified( serviceHandle: Handle, archive: FSPXI_Archive, @@ -12707,8 +10131,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Reads from a special file.\n @param bytesRead Pointer to output the number of bytes read to.\n @param fileOffset Offset of the file.\n @param size Size of the buffer.\n @param data Buffer to read to."] - #[doc = ""] + #[doc = " Reads from a special file.\n # Arguments\n\n* `bytesRead` - Pointer to output the number of bytes read to.\n * `fileOffset` - Offset of the file.\n * `size` - Size of the buffer.\n * `data` - Buffer to read to."] pub fn FSPXI_ReadSpecialFile( serviceHandle: Handle, bytesRead: *mut u32_, @@ -12719,14 +10142,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets the size of a special file.\n @param fileSize Pointer to output the size to."] - #[doc = ""] + #[doc = " Gets the size of a special file.\n # Arguments\n\n* `fileSize` - Pointer to output the size to."] pub fn FSPXI_GetSpecialFileSize(serviceHandle: Handle, fileSize: *mut u64_) -> Result; } extern "C" { #[must_use] - #[doc = "Initiates a device move as the source device.\n @param context Pointer to output the context to."] - #[doc = ""] + #[doc = " Initiates a device move as the source device.\n # Arguments\n\n* `context` - Pointer to output the context to."] pub fn FSPXI_StartDeviceMoveAsSource( serviceHandle: Handle, context: *mut FS_DeviceMoveContext, @@ -12734,8 +10155,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Initiates a device move as the destination device.\n @param context Context to use.\n @param clear Whether to clear the device's data first."] - #[doc = ""] + #[doc = " Initiates a device move as the destination device.\n # Arguments\n\n* `context` - Context to use.\n * `clear` - Whether to clear the device's data first."] pub fn FSPXI_StartDeviceMoveAsDestination( serviceHandle: Handle, context: FS_DeviceMoveContext, @@ -12744,8 +10164,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Reads data and stores SHA256 hashes of blocks\n @param file File to read from.\n @param bytesRead Pointer to output the number of read bytes to.\n @param offset Offset to read from.\n @param readBuffer Pointer to store read data in.\n @param readBufferSize Size of readBuffer.\n @param hashtable Pointer to store SHA256 hashes in.\n @param hashtableSize Size of hashtable.\n @param unk Unknown. Always 0x00001000? Possibly block size?"] - #[doc = ""] + #[doc = " Reads data and stores SHA256 hashes of blocks\n # Arguments\n\n* `file` - File to read from.\n * `bytesRead` - Pointer to output the number of read bytes to.\n * `offset` - Offset to read from.\n * `readBuffer` - Pointer to store read data in.\n * `readBufferSize` - Size of readBuffer.\n * `hashtable` - Pointer to store SHA256 hashes in.\n * `hashtableSize` - Size of hashtable.\n * `unk` - Unknown. Always 0x00001000? Possibly block size?"] pub fn FSPXI_ReadFileSHA256( serviceHandle: Handle, file: FSPXI_File, @@ -12760,8 +10179,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Assumedly writes data and stores SHA256 hashes of blocks\n @param file File to write to.\n @param bytesWritten Pointer to output the number of written bytes to.\n @param offset Offset to write to.\n @param writeBuffer Buffer to write from.\n @param writeBufferSize Size of writeBuffer.\n @param hashtable Pointer to store SHA256 hashes in.\n @param hashtableSize Size of hashtable\n @param unk1 Unknown. Might match with ReadFileSHA256's unknown?\n @param unk2 Unknown. Might match with ReadFileSHA256's unknown?"] - #[doc = ""] + #[doc = " Assumedly writes data and stores SHA256 hashes of blocks\n # Arguments\n\n* `file` - File to write to.\n * `bytesWritten` - Pointer to output the number of written bytes to.\n * `offset` - Offset to write to.\n * `writeBuffer` - Buffer to write from.\n * `writeBufferSize` - Size of writeBuffer.\n * `hashtable` - Pointer to store SHA256 hashes in.\n * `hashtableSize` - Size of hashtable\n * `unk1` - Unknown. Might match with ReadFileSHA256's unknown?\n * `unk2` - Unknown. Might match with ReadFileSHA256's unknown?"] pub fn FSPXI_WriteFileSHA256( serviceHandle: Handle, file: FSPXI_File, @@ -12777,26 +10195,22 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Configures CTRCARD latency emulation.\n @param latency Latency to apply."] - #[doc = ""] + #[doc = " Configures CTRCARD latency emulation.\n # Arguments\n\n* `latency` - Latency to apply."] pub fn FSPXI_SetCtrCardLatencyParameter(serviceHandle: Handle, latency: u64_) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the file system priority.\n @param priority Priority to set."] - #[doc = ""] + #[doc = " Sets the file system priority.\n # Arguments\n\n* `priority` - Priority to set."] pub fn FSPXI_SetPriority(serviceHandle: Handle, priority: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Toggles cleaning up invalid save data.\n @param enable Whether to enable cleaning up invalid save data."] - #[doc = ""] + #[doc = " Toggles cleaning up invalid save data.\n # Arguments\n\n* `enable` - Whether to enable cleaning up invalid save data."] pub fn FSPXI_SwitchCleanupInvalidSaveData(serviceHandle: Handle, enable: bool) -> Result; } extern "C" { #[must_use] - #[doc = "Enumerates system save data.\n @param idsWritten Pointer to output the number of IDs written to.\n @param idsSize Size of the IDs buffer.\n @param ids Pointer to output IDs to."] - #[doc = ""] + #[doc = " Enumerates system save data.\n # Arguments\n\n* `idsWritten` - Pointer to output the number of IDs written to.\n * `idsSize` - Size of the IDs buffer.\n * `ids` - Pointer to output IDs to."] pub fn FSPXI_EnumerateSystemSaveData( serviceHandle: Handle, idsWritten: *mut u32_, @@ -12806,8 +10220,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Reads the NAND report.\n @param unk Unknown\n @param buffer Buffer to write the report to.\n @param size Size of buffer"] - #[doc = ""] + #[doc = " Reads the NAND report.\n # Arguments\n\n* `unk` - Unknown\n * `buffer` - Buffer to write the report to.\n * `size` - Size of buffer"] pub fn FSPXI_ReadNandReport( serviceHandle: Handle, buffer: *mut ::libc::c_void, @@ -12817,8 +10230,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Unknown command 0x56\n @remark Called by FSUSER_ControlArchive with ArchiveAction 0x789D"] - #[doc = ""] + #[doc = " Unknown command 0x56\n > Called by FSUSER_ControlArchive with ArchiveAction 0x789D"] pub fn FSPXI_Unknown0x56( serviceHandle: Handle, out: *mut u32_, @@ -12828,24 +10240,20 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Initializes fs:REG."] - #[doc = ""] + #[doc = " Initializes fs:REG."] pub fn fsRegInit() -> Result; } extern "C" { - #[doc = "Exits fs:REG."] - #[doc = ""] + #[doc = " Exits fs:REG."] pub fn fsRegExit(); } extern "C" { - #[doc = "Gets the current fs:REG session handle.\n @return The current fs:REG session handle."] - #[doc = ""] + #[doc = " Gets the current fs:REG session handle.\n # Returns\n\nThe current fs:REG session handle."] pub fn fsRegGetSessionHandle() -> *mut Handle; } extern "C" { #[must_use] - #[doc = "Registers a program's storage information.\n @param pid The Process ID of the program.\n @param programHandle The program handle.\n @param programInfo Information about the program.\n @param storageInfo Storage information to register."] - #[doc = ""] + #[doc = " Registers a program's storage information.\n # Arguments\n\n* `pid` - The Process ID of the program.\n * `programHandle` - The program handle.\n * `programInfo` - Information about the program.\n * `storageInfo` - Storage information to register."] pub fn FSREG_Register( pid: u32_, programHandle: u64_, @@ -12855,14 +10263,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Unregisters a program's storage information.\n @param pid The Process ID of the program."] - #[doc = ""] + #[doc = " Unregisters a program's storage information.\n # Arguments\n\n* `pid` - The Process ID of the program."] pub fn FSREG_Unregister(pid: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Retrives the exheader information set(s) (SCI+ACI) about a program.\n @param exheaderInfos[out] Pointer to the output exheader information set(s).\n @param maxNumEntries The maximum number of entries.\n @param programHandle The program handle."] - #[doc = ""] + #[doc = " Retrives the exheader information set(s) (SCI+ACI) about a program.\n # Arguments\n\n* `exheaderInfos[out]` - Pointer to the output exheader information set(s).\n * `maxNumEntries` - The maximum number of entries.\n * `programHandle` - The program handle."] pub fn FSREG_GetProgramInfo( exheaderInfos: *mut ExHeader_Info, maxNumEntries: u32_, @@ -12871,8 +10277,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Loads a program.\n @param programHandle[out] Pointer to the output the program handle to.\n @param programInfo Information about the program to load."] - #[doc = ""] + #[doc = " Loads a program.\n # Arguments\n\n* `programHandle[out]` - Pointer to the output the program handle to.\n * `programInfo` - Information about the program to load."] pub fn FSREG_LoadProgram( programHandle: *mut u64_, programInfo: *const FS_ProgramInfo, @@ -12880,25 +10285,21 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Unloads a program.\n @param programHandle The program handle."] - #[doc = ""] + #[doc = " Unloads a program.\n # Arguments\n\n* `programHandle` - The program handle."] pub fn FSREG_UnloadProgram(programHandle: u64_) -> Result; } extern "C" { #[must_use] - #[doc = "Checks if a program has been loaded by fs:REG.\n @param programHandle The program handle."] - #[doc = ""] + #[doc = " Checks if a program has been loaded by fs:REG.\n # Arguments\n\n* `programHandle` - The program handle."] pub fn FSREG_CheckHostLoadId(programHandle: u64_) -> Result; } -#[doc = "Shared Mii struct"] -#[doc = ""] +#[doc = " Shared Mii struct"] #[repr(C)] #[repr(align(1))] pub struct MiiData { pub _bindgen_opaque_blob: [u8; 92usize], } -#[doc = "Mii options"] -#[doc = ""] +#[doc = " Mii options"] #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone)] pub struct MiiData__bindgen_ty_1 { @@ -12977,8 +10378,7 @@ impl MiiData__bindgen_ty_1 { __bindgen_bitfield_unit } } -#[doc = "Mii position in Mii selector or Mii maker"] -#[doc = ""] +#[doc = " Mii position in Mii selector or Mii maker"] #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone)] pub struct MiiData__bindgen_ty_2 { @@ -13022,8 +10422,7 @@ impl MiiData__bindgen_ty_2 { __bindgen_bitfield_unit } } -#[doc = "Console Identity"] -#[doc = ""] +#[doc = " Console Identity"] #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone)] pub struct MiiData__bindgen_ty_3 { @@ -13070,8 +10469,7 @@ impl MiiData__bindgen_ty_3 { __bindgen_bitfield_unit } } -#[doc = "Mii details"] -#[doc = ""] +#[doc = " Mii details"] #[repr(C)] #[repr(align(2))] #[derive(Debug, Default, Copy, Clone)] @@ -13167,8 +10565,7 @@ impl MiiData__bindgen_ty_4 { __bindgen_bitfield_unit } } -#[doc = "Face style"] -#[doc = ""] +#[doc = " Face style"] #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone)] pub struct MiiData__bindgen_ty_5 { @@ -13231,8 +10628,7 @@ impl MiiData__bindgen_ty_5 { __bindgen_bitfield_unit } } -#[doc = "Face details"] -#[doc = ""] +#[doc = " Face details"] #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone)] pub struct MiiData__bindgen_ty_6 { @@ -13276,8 +10672,7 @@ impl MiiData__bindgen_ty_6 { __bindgen_bitfield_unit } } -#[doc = "Hair details"] -#[doc = ""] +#[doc = " Hair details"] #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone)] pub struct MiiData__bindgen_ty_7 { @@ -13321,8 +10716,7 @@ impl MiiData__bindgen_ty_7 { __bindgen_bitfield_unit } } -#[doc = "Eye details"] -#[doc = ""] +#[doc = " Eye details"] #[repr(C)] #[repr(align(4))] #[derive(Debug, Default, Copy, Clone)] @@ -13450,8 +10844,7 @@ impl MiiData__bindgen_ty_8 { __bindgen_bitfield_unit } } -#[doc = "Eyebrow details"] -#[doc = ""] +#[doc = " Eyebrow details"] #[repr(C)] #[repr(align(4))] #[derive(Debug, Default, Copy, Clone)] @@ -13595,8 +10988,7 @@ impl MiiData__bindgen_ty_9 { __bindgen_bitfield_unit } } -#[doc = "Nose details"] -#[doc = ""] +#[doc = " Nose details"] #[repr(C)] #[repr(align(2))] #[derive(Debug, Default, Copy, Clone)] @@ -13660,8 +11052,7 @@ impl MiiData__bindgen_ty_10 { __bindgen_bitfield_unit } } -#[doc = "Mouth details"] -#[doc = ""] +#[doc = " Mouth details"] #[repr(C)] #[repr(align(2))] #[derive(Debug, Default, Copy, Clone)] @@ -13741,8 +11132,7 @@ impl MiiData__bindgen_ty_11 { __bindgen_bitfield_unit } } -#[doc = "Mustache details"] -#[doc = ""] +#[doc = " Mustache details"] #[repr(C)] #[repr(align(2))] #[derive(Debug, Default, Copy, Clone)] @@ -13806,8 +11196,7 @@ impl MiiData__bindgen_ty_12 { __bindgen_bitfield_unit } } -#[doc = "Beard details"] -#[doc = ""] +#[doc = " Beard details"] #[repr(C)] #[repr(align(2))] #[derive(Debug, Default, Copy, Clone)] @@ -13887,8 +11276,7 @@ impl MiiData__bindgen_ty_13 { __bindgen_bitfield_unit } } -#[doc = "Glasses details"] -#[doc = ""] +#[doc = " Glasses details"] #[repr(C)] #[repr(align(2))] #[derive(Debug, Default, Copy, Clone)] @@ -13968,8 +11356,7 @@ impl MiiData__bindgen_ty_14 { __bindgen_bitfield_unit } } -#[doc = "Mole details"] -#[doc = ""] +#[doc = " Mole details"] #[repr(C)] #[repr(align(2))] #[derive(Debug, Default, Copy, Clone)] @@ -14058,8 +11445,7 @@ impl Default for MiiData { } } } -#[doc = "Friend key data"] -#[doc = ""] +#[doc = " Friend key data"] #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone)] pub struct FriendKey { @@ -14067,8 +11453,7 @@ pub struct FriendKey { pub padding: u32_, pub localFriendCode: u64_, } -#[doc = "Friend Title data"] -#[doc = ""] +#[doc = " Friend Title data"] #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone)] pub struct TitleData { @@ -14076,30 +11461,23 @@ pub struct TitleData { pub version: u32_, pub unk: u32_, } -#[doc = "Friend profile data"] -#[doc = ""] +#[doc = " Friend profile data"] #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone)] pub struct FriendProfile { - #[doc = "The region code for the hardware."] - #[doc = ""] + #[doc = "< The region code for the hardware."] pub region: u8_, - #[doc = "Country code."] - #[doc = ""] + #[doc = "< Country code."] pub country: u8_, - #[doc = "Area code."] - #[doc = ""] + #[doc = "< Area code."] pub area: u8_, - #[doc = "Language code."] - #[doc = ""] + #[doc = "< Language code."] pub language: u8_, - #[doc = "Platform code."] - #[doc = ""] + #[doc = "< Platform code."] pub platform: u8_, pub padding: u32_, } -#[doc = "Game Description structure"] -#[doc = ""] +#[doc = " Game Description structure"] #[repr(C, packed)] #[derive(Debug, Copy, Clone)] pub struct GameDescription { @@ -14115,8 +11493,7 @@ impl Default for GameDescription { } } } -#[doc = "Friend Notification Event structure"] -#[doc = ""] +#[doc = " Friend Notification Event structure"] #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone)] pub struct NotificationEvent { @@ -14125,96 +11502,67 @@ pub struct NotificationEvent { pub padding: u32_, pub key: FriendKey, } -#[doc = "Self went online"] -#[doc = ""] - +#[doc = "< Self went online"] pub const USER_WENT_ONLINE: NotificationTypes = 1; -#[doc = "Self went offline"] -#[doc = ""] - +#[doc = "< Self went offline"] pub const USER_WENT_OFFLINE: NotificationTypes = 2; -#[doc = "Friend Went Online"] -#[doc = ""] - +#[doc = "< Friend Went Online"] pub const FRIEND_WENT_ONLINE: NotificationTypes = 3; -#[doc = "Friend Presence changed"] -#[doc = ""] - +#[doc = "< Friend Presence changed"] pub const FRIEND_UPDATED_PRESENCE: NotificationTypes = 4; -#[doc = "Friend Mii changed"] -#[doc = ""] - +#[doc = "< Friend Mii changed"] pub const FRIEND_UPDATED_MII: NotificationTypes = 5; -#[doc = "Friend Profile changed"] -#[doc = ""] - +#[doc = "< Friend Profile changed"] pub const FRIEND_UPDATED_PROFILE: NotificationTypes = 6; -#[doc = "Friend went offline"] -#[doc = ""] - +#[doc = "< Friend went offline"] pub const FRIEND_WENT_OFFLINE: NotificationTypes = 7; -#[doc = "Friend registered self as friend"] -#[doc = ""] - +#[doc = "< Friend registered self as friend"] pub const FRIEND_REGISTERED_USER: NotificationTypes = 8; -#[doc = "Friend Sent invitation"] -#[doc = ""] - +#[doc = "< Friend Sent invitation"] pub const FRIEND_SENT_INVITATION: NotificationTypes = 9; -#[doc = "Enum to use with FRD_GetNotificationEvent"] -#[doc = ""] - +#[doc = " Enum to use with FRD_GetNotificationEvent"] pub type NotificationTypes = ::libc::c_uint; extern "C" { #[must_use] - #[doc = "Initializes FRD service."] - #[doc = ""] + #[doc = " Initializes FRD service."] pub fn frdInit() -> Result; } extern "C" { - #[doc = "Exists FRD."] - #[doc = ""] + #[doc = " Exists FRD."] pub fn frdExit(); } extern "C" { - #[doc = "Get FRD handle."] - #[doc = ""] + #[doc = " Get FRD handle."] pub fn frdGetSessionHandle() -> *mut Handle; } extern "C" { #[must_use] - #[doc = "Gets the login status of the current user.\n @param state Pointer to write the current user's login status to."] - #[doc = ""] + #[doc = " Gets the login status of the current user.\n # Arguments\n\n* `state` - Pointer to write the current user's login status to."] pub fn FRDU_HasLoggedIn(state: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the online status of the current user.\n @param state Pointer to write the current user's online status to."] - #[doc = ""] + #[doc = " Gets the online status of the current user.\n # Arguments\n\n* `state` - Pointer to write the current user's online status to."] pub fn FRDU_IsOnline(state: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Logs out of Nintendo's friend server."] - #[doc = ""] + #[doc = " Logs out of Nintendo's friend server."] pub fn FRD_Logout() -> Result; } extern "C" { #[must_use] - #[doc = "Log in to Nintendo's friend server.\n @param event Event to signal when Login is done."] - #[doc = ""] + #[doc = " Log in to Nintendo's friend server.\n # Arguments\n\n* `event` - Event to signal when Login is done."] pub fn FRD_Login(event: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the current user's friend key.\n @param key Pointer to write the current user's friend key to."] - #[doc = ""] + #[doc = " Gets the current user's friend key.\n # Arguments\n\n* `key` - Pointer to write the current user's friend key to."] pub fn FRD_GetMyFriendKey(key: *mut FriendKey) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the current user's privacy information.\n @param isPublicMode Determines whether friends are notified of the current user's online status.\n @param isShowGameName Determines whether friends are notified of the application that the current user is running.\n @param isShowPlayedGame Determiens whether to display the current user's game history."] - #[doc = ""] + #[doc = " Gets the current user's privacy information.\n # Arguments\n\n* `isPublicMode` - Determines whether friends are notified of the current user's online status.\n * `isShowGameName` - Determines whether friends are notified of the application that the current user is running.\n * `isShowPlayedGame` - Determiens whether to display the current user's game history."] pub fn FRD_GetMyPreference( isPublicMode: *mut bool, isShowGameName: *mut bool, @@ -14223,44 +11571,37 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets the current user's profile information.\n @param profile Pointer to write the current user's profile information to."] - #[doc = ""] + #[doc = " Gets the current user's profile information.\n # Arguments\n\n* `profile` - Pointer to write the current user's profile information to."] pub fn FRD_GetMyProfile(profile: *mut FriendProfile) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the current user's screen name.\n @param name Pointer to write the current user's screen name to.\n @param max_size Max size of the screen name."] - #[doc = ""] + #[doc = " Gets the current user's screen name.\n # Arguments\n\n* `name` - Pointer to write the current user's screen name to.\n * `max_size` - Max size of the screen name."] pub fn FRD_GetMyScreenName(name: *mut ::libc::c_char, max_size: usize) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the current user's Mii data.\n @param mii Pointer to write the current user's mii data to."] - #[doc = ""] + #[doc = " Gets the current user's Mii data.\n # Arguments\n\n* `mii` - Pointer to write the current user's mii data to."] pub fn FRD_GetMyMii(mii: *mut MiiData) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the current user's playing game.\n @param titleId Pointer to write the current user's playing game to."] - #[doc = ""] + #[doc = " Gets the current user's playing game.\n # Arguments\n\n* `titleId` - Pointer to write the current user's playing game to."] pub fn FRD_GetMyPlayingGame(titleId: *mut u64_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the current user's favourite game.\n @param titleId Pointer to write the title ID of current user's favourite game to."] - #[doc = ""] + #[doc = " Gets the current user's favourite game.\n # Arguments\n\n* `titleId` - Pointer to write the title ID of current user's favourite game to."] pub fn FRD_GetMyFavoriteGame(titleId: *mut u64_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the current user's comment on their friend profile.\n @param comment Pointer to write the current user's comment to.\n @param max_size Max size of the comment."] - #[doc = ""] + #[doc = " Gets the current user's comment on their friend profile.\n # Arguments\n\n* `comment` - Pointer to write the current user's comment to.\n * `max_size` - Max size of the comment."] pub fn FRD_GetMyComment(comment: *mut ::libc::c_char, max_size: usize) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the current user's friend key list.\n @param friendKeyList Pointer to write the friend key list to.\n @param num Stores the number of friend keys obtained.\n @param offset The index of the friend key to start with.\n @param size Size of the friend key list. (FRIEND_LIST_SIZE)"] - #[doc = ""] + #[doc = " Gets the current user's friend key list.\n # Arguments\n\n* `friendKeyList` - Pointer to write the friend key list to.\n * `num` - Stores the number of friend keys obtained.\n * `offset` - The index of the friend key to start with.\n * `size` - Size of the friend key list. (FRIEND_LIST_SIZE)"] pub fn FRD_GetFriendKeyList( friendKeyList: *mut FriendKey, num: *mut u32_, @@ -14270,8 +11611,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets the current user's friends' Mii data.\n @param miiDataList Pointer to write Mii data to.\n @param friendKeyList Pointer to FriendKeys.\n @param size Number of Friendkeys."] - #[doc = ""] + #[doc = " Gets the current user's friends' Mii data.\n # Arguments\n\n* `miiDataList` - Pointer to write Mii data to.\n * `friendKeyList` - Pointer to FriendKeys.\n * `size` - Number of Friendkeys."] pub fn FRD_GetFriendMii( miiDataList: *mut MiiData, friendKeyList: *const FriendKey, @@ -14280,8 +11620,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Get the current user's friends' profile data.\n @param profile Pointer to write profile data to.\n @param friendKeyList Pointer to FriendKeys.\n @param size Number of FriendKeys."] - #[doc = ""] + #[doc = " Get the current user's friends' profile data.\n # Arguments\n\n* `profile` - Pointer to write profile data to.\n * `friendKeyList` - Pointer to FriendKeys.\n * `size` - Number of FriendKeys."] pub fn FRD_GetFriendProfile( profile: *mut FriendProfile, friendKeyList: *const FriendKey, @@ -14290,8 +11629,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Get the current user's friends' playing game.\n @param desc Pointer to write Game Description data to.\n @param friendKeyList Pointer to FriendKeys,\n @param size Number Of FriendKeys."] - #[doc = ""] + #[doc = " Get the current user's friends' playing game.\n # Arguments\n\n* `desc` - Pointer to write Game Description data to.\n * `friendKeyList` - Pointer to FriendKeys,\n * `size` - Number Of FriendKeys."] pub fn FRD_GetFriendPlayingGame( desc: *mut GameDescription, friendKeyList: *const FriendKey, @@ -14300,8 +11638,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Get the current user's friends' favourite game.\n @param desc Pointer to write Game Description data to.\n @param friendKeyList Pointer to FriendKeys,\n @param count Number Of FriendKeys."] - #[doc = ""] + #[doc = " Get the current user's friends' favourite game.\n # Arguments\n\n* `desc` - Pointer to write Game Description data to.\n * `friendKeyList` - Pointer to FriendKeys,\n * `count` - Number Of FriendKeys."] pub fn FRD_GetFriendFavouriteGame( desc: *mut GameDescription, friendKeyList: *const FriendKey, @@ -14310,26 +11647,22 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets whether a friend key is included in the current user's friend list.\n @param friendKeyList Pointer to a list of friend keys.\n @param isFromList Pointer to a write the friendship status to."] - #[doc = ""] + #[doc = " Gets whether a friend key is included in the current user's friend list.\n # Arguments\n\n* `friendKeyList` - Pointer to a list of friend keys.\n * `isFromList` - Pointer to a write the friendship status to."] pub fn FRD_IsInFriendList(friendKeyList: *mut FriendKey, isFromList: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Updates the game mode description string.\n @param desc Pointer to write the game mode description to."] - #[doc = ""] + #[doc = " Updates the game mode description string.\n # Arguments\n\n* `desc` - Pointer to write the game mode description to."] pub fn FRD_UpdateGameModeDescription(desc: *const ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = "Event which is signaled when friend login states change.\n @param event event which will be signaled."] - #[doc = ""] + #[doc = " Event which is signaled when friend login states change.\n # Arguments\n\n* `event` - event which will be signaled."] pub fn FRD_AttachToEventNotification(event: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Get Latest Event Notification\n @param event Pointer to write recieved notification event struct to.\n @param count Number of events\n @param recievedNotifCount Number of notification reccieved."] - #[doc = ""] + #[doc = " Get Latest Event Notification\n # Arguments\n\n* `event` - Pointer to write recieved notification event struct to.\n * `count` - Number of events\n * `recievedNotifCount` - Number of notification reccieved."] pub fn FRD_GetEventNotification( event: *mut NotificationEvent, count: u32_, @@ -14338,406 +11671,279 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Returns the friend code using the given principal ID.\n @param principalId The principal ID being used.\n @param friendCode Pointer to write the friend code to."] - #[doc = ""] + #[doc = " Returns the friend code using the given principal ID.\n # Arguments\n\n* `principalId` - The principal ID being used.\n * `friendCode` - Pointer to write the friend code to."] pub fn FRD_PrincipalIdToFriendCode(principalId: u32_, friendCode: *mut u64_) -> Result; } extern "C" { #[must_use] - #[doc = "Returns the principal ID using the given friend code.\n @param friendCode The friend code being used.\n @param principalId Pointer to write the principal ID to."] - #[doc = ""] + #[doc = " Returns the principal ID using the given friend code.\n # Arguments\n\n* `friendCode` - The friend code being used.\n * `principalId` - Pointer to write the principal ID to."] pub fn FRD_FriendCodeToPrincipalId(friendCode: u64_, principalId: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Checks if the friend code is valid.\n @param friendCode The friend code being used.\n @param isValid Pointer to write the validity of the friend code to."] - #[doc = ""] + #[doc = " Checks if the friend code is valid.\n # Arguments\n\n* `friendCode` - The friend code being used.\n * `isValid` - Pointer to write the validity of the friend code to."] pub fn FRD_IsValidFriendCode(friendCode: u64_, isValid: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the Friend API to use a specific SDK version.\n @param sdkVer The SDK version needed to be used."] - #[doc = ""] + #[doc = " Sets the Friend API to use a specific SDK version.\n # Arguments\n\n* `sdkVer` - The SDK version needed to be used."] pub fn FRD_SetClientSdkVersion(sdkVer: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Add a Friend online.\n @param event Event signaled when friend is registered.\n @param principalId PrincipalId of the friend to add."] - #[doc = ""] + #[doc = " Add a Friend online.\n # Arguments\n\n* `event` - Event signaled when friend is registered.\n * `principalId` - PrincipalId of the friend to add."] pub fn FRD_AddFriendOnline(event: Handle, principalId: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Remove a Friend.\n @param principalId PrinipalId of the friend code to remove.\n @param localFriendCode LocalFriendCode of the friend code to remove."] - #[doc = ""] + #[doc = " Remove a Friend.\n # Arguments\n\n* `principalId` - PrinipalId of the friend code to remove.\n * `localFriendCode` - LocalFriendCode of the friend code to remove."] pub fn FRD_RemoveFriend(principalId: u32_, localFriendCode: u64_) -> Result; } -#[doc = "Top screen."] -#[doc = ""] - +#[doc = "< Top screen."] pub const GSPLCD_SCREEN_TOP: _bindgen_ty_21 = 1; -#[doc = "Bottom screen."] -#[doc = ""] - +#[doc = "< Bottom screen."] pub const GSPLCD_SCREEN_BOTTOM: _bindgen_ty_21 = 2; -#[doc = "Both screens."] -#[doc = ""] - +#[doc = "< Both screens."] pub const GSPLCD_SCREEN_BOTH: _bindgen_ty_21 = 3; -#[doc = "LCD screens."] -#[doc = ""] - +#[doc = " LCD screens."] pub type _bindgen_ty_21 = ::libc::c_uint; extern "C" { #[must_use] - #[doc = "Initializes GSPLCD."] - #[doc = ""] + #[doc = " Initializes GSPLCD."] pub fn gspLcdInit() -> Result; } extern "C" { - #[doc = "Exits GSPLCD."] - #[doc = ""] + #[doc = " Exits GSPLCD."] pub fn gspLcdExit(); } extern "C" { - #[doc = "Gets a pointer to the current gsp::Lcd session handle.\n @return A pointer to the current gsp::Lcd session handle."] - #[doc = ""] + #[doc = " Gets a pointer to the current gsp::Lcd session handle.\n # Returns\n\nA pointer to the current gsp::Lcd session handle."] pub fn gspLcdGetSessionHandle() -> *mut Handle; } extern "C" { #[must_use] - #[doc = "Powers on both backlights."] - #[doc = ""] + #[doc = " Powers on both backlights."] pub fn GSPLCD_PowerOnAllBacklights() -> Result; } extern "C" { #[must_use] - #[doc = "Powers off both backlights."] - #[doc = ""] + #[doc = " Powers off both backlights."] pub fn GSPLCD_PowerOffAllBacklights() -> Result; } extern "C" { #[must_use] - #[doc = "Powers on the backlight.\n @param screen Screen to power on."] - #[doc = ""] + #[doc = " Powers on the backlight.\n # Arguments\n\n* `screen` - Screen to power on."] pub fn GSPLCD_PowerOnBacklight(screen: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Powers off the backlight.\n @param screen Screen to power off."] - #[doc = ""] + #[doc = " Powers off the backlight.\n # Arguments\n\n* `screen` - Screen to power off."] pub fn GSPLCD_PowerOffBacklight(screen: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Sets 3D_LEDSTATE to the input state value.\n @param disable False = 3D LED enable, true = 3D LED disable."] - #[doc = ""] + #[doc = " Sets 3D_LEDSTATE to the input state value.\n # Arguments\n\n* `disable` - False = 3D LED enable, true = 3D LED disable."] pub fn GSPLCD_SetLedForceOff(disable: bool) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the LCD screens' vendors. Stubbed on old 3ds.\n @param vendor Pointer to output the screen vendors to."] - #[doc = ""] + #[doc = " Gets the LCD screens' vendors. Stubbed on old 3ds.\n # Arguments\n\n* `vendor` - Pointer to output the screen vendors to."] pub fn GSPLCD_GetVendors(vendors: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the LCD screens' brightness. Stubbed on old 3ds.\n @param screen Screen to get the brightness value of.\n @param brightness Brightness value returned."] - #[doc = ""] + #[doc = " Gets the LCD screens' brightness. Stubbed on old 3ds.\n # Arguments\n\n* `screen` - Screen to get the brightness value of.\n * `brightness` - Brightness value returned."] pub fn GSPLCD_GetBrightness(screen: u32_, brightness: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the LCD screens' brightness.\n @param screen Screen to set the brightness value of.\n @param brightness Brightness value set."] - #[doc = ""] + #[doc = " Sets the LCD screens' brightness.\n # Arguments\n\n* `screen` - Screen to set the brightness value of.\n * `brightness` - Brightness value set."] pub fn GSPLCD_SetBrightness(screen: u32_, brightness: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the LCD screens' raw brightness.\n @param screen Screen to set the brightness value of.\n @param brightness Brightness value set."] - #[doc = ""] + #[doc = " Sets the LCD screens' raw brightness.\n # Arguments\n\n* `screen` - Screen to set the brightness value of.\n * `brightness` - Brightness value set."] pub fn GSPLCD_SetBrightnessRaw(screen: u32_, brightness: u32_) -> Result; } -#[doc = "A"] -#[doc = ""] - +#[doc = "< A"] pub const KEY_A: _bindgen_ty_22 = 1; -#[doc = "B"] -#[doc = ""] - +#[doc = "< B"] pub const KEY_B: _bindgen_ty_22 = 2; -#[doc = "Select"] -#[doc = ""] - +#[doc = "< Select"] pub const KEY_SELECT: _bindgen_ty_22 = 4; -#[doc = "Start"] -#[doc = ""] - +#[doc = "< Start"] pub const KEY_START: _bindgen_ty_22 = 8; -#[doc = "D-Pad Right"] -#[doc = ""] - +#[doc = "< D-Pad Right"] pub const KEY_DRIGHT: _bindgen_ty_22 = 16; -#[doc = "D-Pad Left"] -#[doc = ""] - +#[doc = "< D-Pad Left"] pub const KEY_DLEFT: _bindgen_ty_22 = 32; -#[doc = "D-Pad Up"] -#[doc = ""] - +#[doc = "< D-Pad Up"] pub const KEY_DUP: _bindgen_ty_22 = 64; -#[doc = "D-Pad Down"] -#[doc = ""] - +#[doc = "< D-Pad Down"] pub const KEY_DDOWN: _bindgen_ty_22 = 128; -#[doc = "R"] -#[doc = ""] - +#[doc = "< R"] pub const KEY_R: _bindgen_ty_22 = 256; -#[doc = "L"] -#[doc = ""] - +#[doc = "< L"] pub const KEY_L: _bindgen_ty_22 = 512; -#[doc = "X"] -#[doc = ""] - +#[doc = "< X"] pub const KEY_X: _bindgen_ty_22 = 1024; -#[doc = "Y"] -#[doc = ""] - +#[doc = "< Y"] pub const KEY_Y: _bindgen_ty_22 = 2048; -#[doc = "ZL (New 3DS only)"] -#[doc = ""] - +#[doc = "< ZL (New 3DS only)"] pub const KEY_ZL: _bindgen_ty_22 = 16384; -#[doc = "ZR (New 3DS only)"] -#[doc = ""] - +#[doc = "< ZR (New 3DS only)"] pub const KEY_ZR: _bindgen_ty_22 = 32768; -#[doc = "Touch (Not actually provided by HID)"] -#[doc = ""] - +#[doc = "< Touch (Not actually provided by HID)"] pub const KEY_TOUCH: _bindgen_ty_22 = 1048576; -#[doc = "C-Stick Right (New 3DS only)"] -#[doc = ""] - +#[doc = "< C-Stick Right (New 3DS only)"] pub const KEY_CSTICK_RIGHT: _bindgen_ty_22 = 16777216; -#[doc = "C-Stick Left (New 3DS only)"] -#[doc = ""] - +#[doc = "< C-Stick Left (New 3DS only)"] pub const KEY_CSTICK_LEFT: _bindgen_ty_22 = 33554432; -#[doc = "C-Stick Up (New 3DS only)"] -#[doc = ""] - +#[doc = "< C-Stick Up (New 3DS only)"] pub const KEY_CSTICK_UP: _bindgen_ty_22 = 67108864; -#[doc = "C-Stick Down (New 3DS only)"] -#[doc = ""] - +#[doc = "< C-Stick Down (New 3DS only)"] pub const KEY_CSTICK_DOWN: _bindgen_ty_22 = 134217728; -#[doc = "Circle Pad Right"] -#[doc = ""] - +#[doc = "< Circle Pad Right"] pub const KEY_CPAD_RIGHT: _bindgen_ty_22 = 268435456; -#[doc = "Circle Pad Left"] -#[doc = ""] - +#[doc = "< Circle Pad Left"] pub const KEY_CPAD_LEFT: _bindgen_ty_22 = 536870912; -#[doc = "Circle Pad Up"] -#[doc = ""] - +#[doc = "< Circle Pad Up"] pub const KEY_CPAD_UP: _bindgen_ty_22 = 1073741824; -#[doc = "Circle Pad Down"] -#[doc = ""] - +#[doc = "< Circle Pad Down"] pub const KEY_CPAD_DOWN: _bindgen_ty_22 = 2147483648; -#[doc = "D-Pad Up or Circle Pad Up"] -#[doc = ""] - +#[doc = "< D-Pad Up or Circle Pad Up"] pub const KEY_UP: _bindgen_ty_22 = 1073741888; -#[doc = "D-Pad Down or Circle Pad Down"] -#[doc = ""] - +#[doc = "< D-Pad Down or Circle Pad Down"] pub const KEY_DOWN: _bindgen_ty_22 = 2147483776; -#[doc = "D-Pad Left or Circle Pad Left"] -#[doc = ""] - +#[doc = "< D-Pad Left or Circle Pad Left"] pub const KEY_LEFT: _bindgen_ty_22 = 536870944; -#[doc = "D-Pad Right or Circle Pad Right"] -#[doc = ""] - +#[doc = "< D-Pad Right or Circle Pad Right"] pub const KEY_RIGHT: _bindgen_ty_22 = 268435472; -#[doc = "Key values."] -#[doc = ""] - +#[doc = " Key values."] pub type _bindgen_ty_22 = ::libc::c_uint; -#[doc = "Touch position."] -#[doc = ""] +#[doc = " Touch position."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct touchPosition { - #[doc = "Touch X"] - #[doc = ""] + #[doc = "< Touch X"] pub px: u16_, - #[doc = "Touch Y"] - #[doc = ""] + #[doc = "< Touch Y"] pub py: u16_, } -#[doc = "Circle Pad position."] -#[doc = ""] +#[doc = " Circle Pad position."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct circlePosition { - #[doc = "Pad X"] - #[doc = ""] + #[doc = "< Pad X"] pub dx: s16, - #[doc = "Pad Y"] - #[doc = ""] + #[doc = "< Pad Y"] pub dy: s16, } -#[doc = "Accelerometer vector."] -#[doc = ""] +#[doc = " Accelerometer vector."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct accelVector { - #[doc = "Accelerometer X"] - #[doc = ""] + #[doc = "< Accelerometer X"] pub x: s16, - #[doc = "Accelerometer Y"] - #[doc = ""] + #[doc = "< Accelerometer Y"] pub y: s16, - #[doc = "Accelerometer Z"] - #[doc = ""] + #[doc = "< Accelerometer Z"] pub z: s16, } -#[doc = "Gyroscope angular rate."] -#[doc = ""] +#[doc = " Gyroscope angular rate."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct angularRate { - #[doc = "Roll"] - #[doc = ""] + #[doc = "< Roll"] pub x: s16, - #[doc = "Yaw"] - #[doc = ""] + #[doc = "< Yaw"] pub z: s16, - #[doc = "Pitch"] - #[doc = ""] + #[doc = "< Pitch"] pub y: s16, } -#[doc = "Event signaled by HID-module, when the sharedmem+0(PAD/circle-pad)/+0xA8(touch-screen) region was updated."] -#[doc = ""] - +#[doc = "< Event signaled by HID-module, when the sharedmem+0(PAD/circle-pad)/+0xA8(touch-screen) region was updated."] pub const HIDEVENT_PAD0: HID_Event = 0; -#[doc = "Event signaled by HID-module, when the sharedmem+0(PAD/circle-pad)/+0xA8(touch-screen) region was updated."] -#[doc = ""] - +#[doc = "< Event signaled by HID-module, when the sharedmem+0(PAD/circle-pad)/+0xA8(touch-screen) region was updated."] pub const HIDEVENT_PAD1: HID_Event = 1; -#[doc = "Event signaled by HID-module, when the sharedmem accelerometer state was updated."] -#[doc = ""] - +#[doc = "< Event signaled by HID-module, when the sharedmem accelerometer state was updated."] pub const HIDEVENT_Accel: HID_Event = 2; -#[doc = "Event signaled by HID-module, when the sharedmem gyroscope state was updated."] -#[doc = ""] - +#[doc = "< Event signaled by HID-module, when the sharedmem gyroscope state was updated."] pub const HIDEVENT_Gyro: HID_Event = 3; -#[doc = "Event signaled by HID-module, when the sharedmem DebugPad state was updated."] -#[doc = ""] - +#[doc = "< Event signaled by HID-module, when the sharedmem DebugPad state was updated."] pub const HIDEVENT_DebugPad: HID_Event = 4; -#[doc = "Used to know how many events there are."] -#[doc = ""] - +#[doc = "< Used to know how many events there are."] pub const HIDEVENT_MAX: HID_Event = 5; -#[doc = "HID events."] -#[doc = ""] - +#[doc = " HID events."] pub type HID_Event = ::libc::c_uint; extern "C" { - #[doc = "HID shared memory handle."] - #[doc = ""] + #[doc = "< HID shared memory handle."] pub static mut hidMemHandle: Handle; } extern "C" { - #[doc = "HID shared memory."] - #[doc = ""] + #[doc = "< HID shared memory."] pub static mut hidSharedMem: *mut vu32; } extern "C" { #[must_use] - #[doc = "Initializes HID."] - #[doc = ""] + #[doc = " Initializes HID."] pub fn hidInit() -> Result; } extern "C" { - #[doc = "Exits HID."] - #[doc = ""] + #[doc = " Exits HID."] pub fn hidExit(); } extern "C" { - #[doc = "Sets the key repeat parameters for [`hidKeysRepeat.\n`] @param delay Initial delay.\n @param interval Repeat interval."] - #[doc = ""] + #[doc = " Sets the key repeat parameters for hidKeysRepeat.\n # Arguments\n\n* `delay` - Initial delay.\n * `interval` - Repeat interval."] pub fn hidSetRepeatParameters(delay: u32_, interval: u32_); } extern "C" { - #[doc = "Scans HID for input data."] - #[doc = ""] + #[doc = " Scans HID for input data."] pub fn hidScanInput(); } extern "C" { - #[doc = "Returns a bitmask of held buttons.\n Individual buttons can be extracted using binary AND.\n @return 32-bit bitmask of held buttons (1+ frames)."] - #[doc = ""] + #[doc = " Returns a bitmask of held buttons.\n Individual buttons can be extracted using binary AND.\n # Returns\n\n32-bit bitmask of held buttons (1+ frames)."] pub fn hidKeysHeld() -> u32_; } extern "C" { - #[doc = "Returns a bitmask of newly pressed buttons, this frame.\n Individual buttons can be extracted using binary AND.\n @return 32-bit bitmask of newly pressed buttons."] - #[doc = ""] + #[doc = " Returns a bitmask of newly pressed buttons, this frame.\n Individual buttons can be extracted using binary AND.\n # Returns\n\n32-bit bitmask of newly pressed buttons."] pub fn hidKeysDown() -> u32_; } extern "C" { - #[doc = "Returns a bitmask of newly pressed or repeated buttons, this frame.\n Individual buttons can be extracted using binary AND.\n @return 32-bit bitmask of newly pressed or repeated buttons."] - #[doc = ""] + #[doc = " Returns a bitmask of newly pressed or repeated buttons, this frame.\n Individual buttons can be extracted using binary AND.\n # Returns\n\n32-bit bitmask of newly pressed or repeated buttons."] pub fn hidKeysDownRepeat() -> u32_; } extern "C" { - #[doc = "Returns a bitmask of newly released buttons, this frame.\n Individual buttons can be extracted using binary AND.\n @return 32-bit bitmask of newly released buttons."] - #[doc = ""] + #[doc = " Returns a bitmask of newly released buttons, this frame.\n Individual buttons can be extracted using binary AND.\n # Returns\n\n32-bit bitmask of newly released buttons."] pub fn hidKeysUp() -> u32_; } extern "C" { - #[doc = "Reads the current touch position.\n @param pos Pointer to output the touch position to."] - #[doc = ""] + #[doc = " Reads the current touch position.\n # Arguments\n\n* `pos` - Pointer to output the touch position to."] pub fn hidTouchRead(pos: *mut touchPosition); } extern "C" { - #[doc = "Reads the current circle pad position.\n @param pos Pointer to output the circle pad position to."] - #[doc = ""] + #[doc = " Reads the current circle pad position.\n # Arguments\n\n* `pos` - Pointer to output the circle pad position to."] pub fn hidCircleRead(pos: *mut circlePosition); } extern "C" { - #[doc = "Reads the current accelerometer data.\n @param vector Pointer to output the accelerometer data to."] - #[doc = ""] + #[doc = " Reads the current accelerometer data.\n # Arguments\n\n* `vector` - Pointer to output the accelerometer data to."] pub fn hidAccelRead(vector: *mut accelVector); } extern "C" { - #[doc = "Reads the current gyroscope data.\n @param rate Pointer to output the gyroscope data to."] - #[doc = ""] + #[doc = " Reads the current gyroscope data.\n # Arguments\n\n* `rate` - Pointer to output the gyroscope data to."] pub fn hidGyroRead(rate: *mut angularRate); } extern "C" { - #[doc = "Waits for an HID event.\n @param id ID of the event.\n @param nextEvent Whether to discard the current event and wait for the next event."] - #[doc = ""] + #[doc = " Waits for an HID event.\n # Arguments\n\n* `id` - ID of the event.\n * `nextEvent` - Whether to discard the current event and wait for the next event."] pub fn hidWaitForEvent(id: HID_Event, nextEvent: bool); } extern "C" { #[must_use] - #[doc = "Waits for any HID or IRRST event.\n @param nextEvents Whether to discard the current events and wait for the next events.\n @param cancelEvent Optional additional handle to wait on, otherwise 0.\n @param timeout Timeout."] - #[doc = ""] + #[doc = " Waits for any HID or IRRST event.\n # Arguments\n\n* `nextEvents` - Whether to discard the current events and wait for the next events.\n * `cancelEvent` - Optional additional handle to wait on, otherwise 0.\n * `timeout` - Timeout."] pub fn hidWaitForAnyEvent(nextEvents: bool, cancelEvent: Handle, timeout: s64) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the handles for HID operation.\n @param outMemHandle Pointer to output the shared memory handle to.\n @param eventpad0 Pointer to output the pad 0 event handle to.\n @param eventpad1 Pointer to output the pad 1 event handle to.\n @param eventaccel Pointer to output the accelerometer event handle to.\n @param eventgyro Pointer to output the gyroscope event handle to.\n @param eventdebugpad Pointer to output the debug pad event handle to."] - #[doc = ""] + #[doc = " Gets the handles for HID operation.\n # Arguments\n\n* `outMemHandle` - Pointer to output the shared memory handle to.\n * `eventpad0` - Pointer to output the pad 0 event handle to.\n * `eventpad1` - Pointer to output the pad 1 event handle to.\n * `eventaccel` - Pointer to output the accelerometer event handle to.\n * `eventgyro` - Pointer to output the gyroscope event handle to.\n * `eventdebugpad` - Pointer to output the debug pad event handle to."] pub fn HIDUSER_GetHandles( outMemHandle: *mut Handle, eventpad0: *mut Handle, @@ -14749,114 +11955,93 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Enables the accelerometer."] - #[doc = ""] + #[doc = " Enables the accelerometer."] pub fn HIDUSER_EnableAccelerometer() -> Result; } extern "C" { #[must_use] - #[doc = "Disables the accelerometer."] - #[doc = ""] + #[doc = " Disables the accelerometer."] pub fn HIDUSER_DisableAccelerometer() -> Result; } extern "C" { #[must_use] - #[doc = "Enables the gyroscope."] - #[doc = ""] + #[doc = " Enables the gyroscope."] pub fn HIDUSER_EnableGyroscope() -> Result; } extern "C" { #[must_use] - #[doc = "Disables the gyroscope."] - #[doc = ""] + #[doc = " Disables the gyroscope."] pub fn HIDUSER_DisableGyroscope() -> Result; } extern "C" { #[must_use] - #[doc = "Gets the gyroscope raw to dps coefficient.\n @param coeff Pointer to output the coefficient to."] - #[doc = ""] + #[doc = " Gets the gyroscope raw to dps coefficient.\n # Arguments\n\n* `coeff` - Pointer to output the coefficient to."] pub fn HIDUSER_GetGyroscopeRawToDpsCoefficient(coeff: *mut f32) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the current volume slider value. (0-63)\n @param volume Pointer to write the volume slider value to."] - #[doc = ""] + #[doc = " Gets the current volume slider value. (0-63)\n # Arguments\n\n* `volume` - Pointer to write the volume slider value to."] pub fn HIDUSER_GetSoundVolume(volume: *mut u8_) -> Result; } extern "C" { - #[doc = "IRRST's shared memory handle."] - #[doc = ""] + #[doc = " IRRST's shared memory handle."] pub static mut irrstMemHandle: Handle; } extern "C" { - #[doc = "IRRST's shared memory."] - #[doc = ""] + #[doc = " IRRST's shared memory."] pub static mut irrstSharedMem: *mut vu32; } extern "C" { - #[doc = "IRRST's state update event"] - #[doc = ""] + #[doc = " IRRST's state update event"] pub static mut irrstEvent: Handle; } extern "C" { #[must_use] - #[doc = "Initializes IRRST."] - #[doc = ""] + #[doc = " Initializes IRRST."] pub fn irrstInit() -> Result; } extern "C" { - #[doc = "Exits IRRST."] - #[doc = ""] + #[doc = " Exits IRRST."] pub fn irrstExit(); } extern "C" { - #[doc = "Scans IRRST for input."] - #[doc = ""] + #[doc = " Scans IRRST for input."] pub fn irrstScanInput(); } extern "C" { - #[doc = "Gets IRRST's held keys.\n @return IRRST's held keys."] - #[doc = ""] + #[doc = " Gets IRRST's held keys.\n # Returns\n\nIRRST's held keys."] pub fn irrstKeysHeld() -> u32_; } extern "C" { - #[doc = "Reads the current c-stick position.\n @param pos Pointer to output the current c-stick position to."] - #[doc = ""] + #[doc = " Reads the current c-stick position.\n # Arguments\n\n* `pos` - Pointer to output the current c-stick position to."] pub fn irrstCstickRead(pos: *mut circlePosition); } extern "C" { - #[doc = "Waits for the IRRST input event to trigger.\n @param nextEvent Whether to discard the current event and wait until the next event."] - #[doc = ""] + #[doc = " Waits for the IRRST input event to trigger.\n # Arguments\n\n* `nextEvent` - Whether to discard the current event and wait until the next event."] pub fn irrstWaitForEvent(nextEvent: bool); } extern "C" { #[must_use] - #[doc = "Gets the shared memory and event handles for IRRST.\n @param outMemHandle Pointer to write the shared memory handle to.\n @param outEventHandle Pointer to write the event handle to."] - #[doc = ""] + #[doc = " Gets the shared memory and event handles for IRRST.\n # Arguments\n\n* `outMemHandle` - Pointer to write the shared memory handle to.\n * `outEventHandle` - Pointer to write the event handle to."] pub fn IRRST_GetHandles(outMemHandle: *mut Handle, outEventHandle: *mut Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Initializes IRRST.\n @param unk1 Unknown.\n @param unk2 Unknown."] - #[doc = ""] + #[doc = " Initializes IRRST.\n # Arguments\n\n* `unk1` - Unknown.\n * `unk2` - Unknown."] pub fn IRRST_Initialize(unk1: u32_, unk2: u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Shuts down IRRST."] - #[doc = ""] + #[doc = " Shuts down IRRST."] pub fn IRRST_Shutdown() -> Result; } -#[doc = "sslc context."] -#[doc = ""] +#[doc = " sslc context."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct sslcContext { - #[doc = "Service handle."] - #[doc = ""] + #[doc = "< Service handle."] pub servhandle: Handle, - #[doc = "SSLC handle."] - #[doc = ""] + #[doc = "< SSLC handle."] pub sslchandle: u32_, pub sharedmem_handle: Handle, } @@ -14877,37 +12062,30 @@ pub type SSLC_DefaultClientCert = ::libc::c_uint; pub const SSLCOPT_Default: _bindgen_ty_23 = 0; pub const SSLCOPT_DisableVerify: _bindgen_ty_23 = 512; pub const SSLCOPT_TLSv10: _bindgen_ty_23 = 2048; -#[doc = "sslc options. "] -#[doc = ""] - +#[doc = " sslc options. https://www.3dbrew.org/wiki/SSL_Services#SSLOpt"] pub type _bindgen_ty_23 = ::libc::c_uint; extern "C" { #[must_use] - #[doc = "Initializes SSLC. Normally session_handle should be 0. When non-zero this will use the specified handle for the main-service-session without using the Initialize command, instead of using srvGetServiceHandle."] - #[doc = ""] + #[doc = " Initializes SSLC. Normally session_handle should be 0. When non-zero this will use the specified handle for the main-service-session without using the Initialize command, instead of using srvGetServiceHandle."] pub fn sslcInit(session_handle: Handle) -> Result; } extern "C" { - #[doc = "Exits SSLC."] - #[doc = ""] + #[doc = " Exits SSLC."] pub fn sslcExit(); } extern "C" { #[must_use] - #[doc = "Creates a RootCertChain.\n @param RootCertChain_contexthandle Output contexthandle."] - #[doc = ""] + #[doc = " Creates a RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - Output contexthandle."] pub fn sslcCreateRootCertChain(RootCertChain_contexthandle: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Destroys a RootCertChain.\n @param RootCertChain_contexthandle RootCertChain contexthandle."] - #[doc = ""] + #[doc = " Destroys a RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - RootCertChain contexthandle."] pub fn sslcDestroyRootCertChain(RootCertChain_contexthandle: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Adds a trusted RootCA cert to a RootCertChain.\n @param RootCertChain_contexthandle RootCertChain to use.\n @param cert Pointer to the DER cert.\n @param certsize Size of the DER cert."] - #[doc = ""] + #[doc = " Adds a trusted RootCA cert to a RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - RootCertChain to use.\n * `cert` - Pointer to the DER cert.\n * `certsize` - Size of the DER cert."] pub fn sslcAddTrustedRootCA( RootCertChain_contexthandle: u32_, cert: *const u8_, @@ -14917,8 +12095,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Adds a default RootCA cert to a RootCertChain.\n @param RootCertChain_contexthandle RootCertChain to use.\n @param certID ID of the cert to add.\n @param cert_contexthandle Optional, the cert contexthandle can be written here."] - #[doc = ""] + #[doc = " Adds a default RootCA cert to a RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - RootCertChain to use.\n * `certID` - ID of the cert to add.\n * `cert_contexthandle` - Optional, the cert contexthandle can be written here."] pub fn sslcRootCertChainAddDefaultCert( RootCertChain_contexthandle: u32_, certID: SSLC_DefaultRootCert, @@ -14927,8 +12104,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Removes the specified cert from the RootCertChain.\n @param RootCertChain_contexthandle RootCertChain to use.\n @param cert_contexthandle Cert contexthandle to remove from the RootCertChain."] - #[doc = ""] + #[doc = " Removes the specified cert from the RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - RootCertChain to use.\n * `cert_contexthandle` - Cert contexthandle to remove from the RootCertChain."] pub fn sslcRootCertChainRemoveCert( RootCertChain_contexthandle: u32_, cert_contexthandle: u32_, @@ -14936,20 +12112,17 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Creates an unknown CertChain.\n @param CertChain_contexthandle Output contexthandle."] - #[doc = ""] + #[doc = " Creates an unknown CertChain.\n # Arguments\n\n* `CertChain_contexthandle` - Output contexthandle."] pub fn sslcCreate8CertChain(CertChain_contexthandle: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Destroys a CertChain from sslcCreate8CertChain().\n @param CertChain_contexthandle CertChain contexthandle."] - #[doc = ""] + #[doc = " Destroys a CertChain from sslcCreate8CertChain().\n # Arguments\n\n* `CertChain_contexthandle` - CertChain contexthandle."] pub fn sslcDestroy8CertChain(CertChain_contexthandle: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Adds a cert to a CertChain from sslcCreate8CertChain().\n @param CertChain_contexthandle CertChain to use.\n @param cert Pointer to the cert.\n @param certsize Size of the cert."] - #[doc = ""] + #[doc = " Adds a cert to a CertChain from sslcCreate8CertChain().\n # Arguments\n\n* `CertChain_contexthandle` - CertChain to use.\n * `cert` - Pointer to the cert.\n * `certsize` - Size of the cert."] pub fn sslc8CertChainAddCert( CertChain_contexthandle: u32_, cert: *const u8_, @@ -14959,8 +12132,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Adds a default cert to a CertChain from sslcCreate8CertChain(). Not actually usable since no certIDs are implemented in SSL-module for this.\n @param CertChain_contexthandle CertChain to use.\n @param certID ID of the cert to add.\n @param cert_contexthandle Optional, the cert contexthandle can be written here."] - #[doc = ""] + #[doc = " Adds a default cert to a CertChain from sslcCreate8CertChain(). Not actually usable since no certIDs are implemented in SSL-module for this.\n # Arguments\n\n* `CertChain_contexthandle` - CertChain to use.\n * `certID` - ID of the cert to add.\n * `cert_contexthandle` - Optional, the cert contexthandle can be written here."] pub fn sslc8CertChainAddDefaultCert( CertChain_contexthandle: u32_, certID: u8_, @@ -14969,8 +12141,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Removes the specified cert from the CertChain from sslcCreate8CertChain().\n @param CertChain_contexthandle CertChain to use.\n @param cert_contexthandle Cert contexthandle to remove from the CertChain."] - #[doc = ""] + #[doc = " Removes the specified cert from the CertChain from sslcCreate8CertChain().\n # Arguments\n\n* `CertChain_contexthandle` - CertChain to use.\n * `cert_contexthandle` - Cert contexthandle to remove from the CertChain."] pub fn sslc8CertChainRemoveCert( CertChain_contexthandle: u32_, cert_contexthandle: u32_, @@ -14978,8 +12149,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Opens a new ClientCert-context.\n @param cert Pointer to the DER cert.\n @param certsize Size of the DER cert.\n @param key Pointer to the DER key.\n @param keysize Size of the DER key.\n @param ClientCert_contexthandle Output contexthandle."] - #[doc = ""] + #[doc = " Opens a new ClientCert-context.\n # Arguments\n\n* `cert` - Pointer to the DER cert.\n * `certsize` - Size of the DER cert.\n * `key` - Pointer to the DER key.\n * `keysize` - Size of the DER key.\n * `ClientCert_contexthandle` - Output contexthandle."] pub fn sslcOpenClientCertContext( cert: *const u8_, certsize: u32_, @@ -14990,8 +12160,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Opens a ClientCert-context with a default certID.\n @param certID ID of the ClientCert to use.\n @param ClientCert_contexthandle Output contexthandle."] - #[doc = ""] + #[doc = " Opens a ClientCert-context with a default certID.\n # Arguments\n\n* `certID` - ID of the ClientCert to use.\n * `ClientCert_contexthandle` - Output contexthandle."] pub fn sslcOpenDefaultClientCertContext( certID: SSLC_DefaultClientCert, ClientCert_contexthandle: *mut u32_, @@ -14999,26 +12168,22 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Closes the specified ClientCert-context.\n @param ClientCert_contexthandle ClientCert-context to use."] - #[doc = ""] + #[doc = " Closes the specified ClientCert-context.\n # Arguments\n\n* `ClientCert_contexthandle` - ClientCert-context to use."] pub fn sslcCloseClientCertContext(ClientCert_contexthandle: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "This uses ps:ps SeedRNG internally."] - #[doc = ""] + #[doc = " This uses ps:ps SeedRNG internally."] pub fn sslcSeedRNG() -> Result; } extern "C" { #[must_use] - #[doc = "This uses ps:ps GenerateRandomData internally.\n @param buf Output buffer.\n @param size Output size."] - #[doc = ""] + #[doc = " This uses ps:ps GenerateRandomData internally.\n # Arguments\n\n* `buf` - Output buffer.\n * `size` - Output size."] pub fn sslcGenerateRandomData(buf: *mut u8_, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Creates a sslc context.\n @param context sslc context.\n @param sockfd Socket fd, this code automatically uses the required SOC command before using the actual sslc command.\n @param input_opt Input sslc options bitmask.\n @param hostname Server hostname."] - #[doc = ""] + #[doc = " Creates a sslc context.\n # Arguments\n\n* `context` - sslc context.\n * `sockfd` - Socket fd, this code automatically uses the required SOC command before using the actual sslc command.\n * `input_opt` - Input sslc options bitmask.\n * `hostname` - Server hostname."] pub fn sslcCreateContext( context: *mut sslcContext, sockfd: ::libc::c_int, @@ -15090,16 +12255,13 @@ extern "C" { #[must_use] pub fn sslcAddCert(context: *mut sslcContext, buf: *const u8_, size: u32_) -> Result; } -#[doc = "HTTP context."] -#[doc = ""] +#[doc = " HTTP context."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct httpcContext { - #[doc = "Service handle."] - #[doc = ""] + #[doc = "< Service handle."] pub servhandle: Handle, - #[doc = "HTTP handle."] - #[doc = ""] + #[doc = "< HTTP handle."] pub httphandle: u32_, } pub const HTTPC_METHOD_GET: HTTPC_RequestMethod = 1; @@ -15107,43 +12269,30 @@ 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; -#[doc = "HTTP request method."] -#[doc = ""] - +#[doc = " HTTP request method."] pub type HTTPC_RequestMethod = ::libc::c_uint; -#[doc = "Request in progress."] -#[doc = ""] - +#[doc = "< Request in progress."] pub const HTTPC_STATUS_REQUEST_IN_PROGRESS: HTTPC_RequestStatus = 5; -#[doc = "Download ready."] -#[doc = ""] - +#[doc = "< Download ready."] pub const HTTPC_STATUS_DOWNLOAD_READY: HTTPC_RequestStatus = 7; -#[doc = "HTTP request status."] -#[doc = ""] - +#[doc = " HTTP request status."] pub type HTTPC_RequestStatus = ::libc::c_uint; pub const HTTPC_KEEPALIVE_DISABLED: HTTPC_KeepAlive = 0; pub const HTTPC_KEEPALIVE_ENABLED: HTTPC_KeepAlive = 1; -#[doc = "HTTP KeepAlive option."] -#[doc = ""] - +#[doc = " HTTP KeepAlive option."] pub type HTTPC_KeepAlive = ::libc::c_uint; extern "C" { #[must_use] - #[doc = "Initializes HTTPC. For HTTP GET the sharedmem_size can be zero. The sharedmem contains data which will be later uploaded for HTTP POST. sharedmem_size should be aligned to 0x1000-bytes."] - #[doc = ""] + #[doc = " Initializes HTTPC. For HTTP GET the sharedmem_size can be zero. The sharedmem contains data which will be later uploaded for HTTP POST. sharedmem_size should be aligned to 0x1000-bytes."] pub fn httpcInit(sharedmem_size: u32_) -> Result; } extern "C" { - #[doc = "Exits HTTPC."] - #[doc = ""] + #[doc = " Exits HTTPC."] pub fn httpcExit(); } extern "C" { #[must_use] - #[doc = "Opens a HTTP context.\n @param context Context to open.\n @param url URL to connect to.\n @param use_defaultproxy Whether the default proxy should be used (0 for default)"] - #[doc = ""] + #[doc = " Opens a HTTP context.\n # Arguments\n\n* `context` - Context to open.\n * `url` - URL to connect to.\n * `use_defaultproxy` - Whether the default proxy should be used (0 for default)"] pub fn httpcOpenContext( context: *mut httpcContext, method: HTTPC_RequestMethod, @@ -15153,20 +12302,17 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Closes a HTTP context.\n @param context Context to close."] - #[doc = ""] + #[doc = " Closes a HTTP context.\n # Arguments\n\n* `context` - Context to close."] pub fn httpcCloseContext(context: *mut httpcContext) -> Result; } extern "C" { #[must_use] - #[doc = "Cancels a HTTP connection.\n @param context Context to close."] - #[doc = ""] + #[doc = " Cancels a HTTP connection.\n # Arguments\n\n* `context` - Context to close."] pub fn httpcCancelConnection(context: *mut httpcContext) -> Result; } extern "C" { #[must_use] - #[doc = "Adds a request header field to a HTTP context.\n @param context Context to use.\n @param name Name of the field.\n @param value Value of the field."] - #[doc = ""] + #[doc = " Adds a request header field to a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `name` - Name of the field.\n * `value` - Value of the field."] pub fn httpcAddRequestHeaderField( context: *mut httpcContext, name: *const ::libc::c_char, @@ -15175,8 +12321,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Adds a POST form field to a HTTP context.\n @param context Context to use.\n @param name Name of the field.\n @param value Value of the field."] - #[doc = ""] + #[doc = " Adds a POST form field to a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `name` - Name of the field.\n * `value` - Value of the field."] pub fn httpcAddPostDataAscii( context: *mut httpcContext, name: *const ::libc::c_char, @@ -15185,8 +12330,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Adds a POST form field with binary data to a HTTP context.\n @param context Context to use.\n @param name Name of the field.\n @param value The binary data to pass as a value.\n @param len Length of the binary data which has been passed."] - #[doc = ""] + #[doc = " Adds a POST form field with binary data to a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `name` - Name of the field.\n * `value` - The binary data to pass as a value.\n * `len` - Length of the binary data which has been passed."] pub fn httpcAddPostDataBinary( context: *mut httpcContext, name: *const ::libc::c_char, @@ -15196,26 +12340,22 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Adds a POST body to a HTTP context.\n @param context Context to use.\n @param data The data to be passed as raw into the body of the post request.\n @param len Length of data passed by data param."] - #[doc = ""] + #[doc = " Adds a POST body to a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `data` - The data to be passed as raw into the body of the post request.\n * `len` - Length of data passed by data param."] pub fn httpcAddPostDataRaw(context: *mut httpcContext, data: *const u32_, len: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Begins a HTTP request.\n @param context Context to use."] - #[doc = ""] + #[doc = " Begins a HTTP request.\n # Arguments\n\n* `context` - Context to use."] pub fn httpcBeginRequest(context: *mut httpcContext) -> Result; } extern "C" { #[must_use] - #[doc = "Receives data from a HTTP context.\n @param context Context to use.\n @param buffer Buffer to receive data to.\n @param size Size of the buffer."] - #[doc = ""] + #[doc = " Receives data from a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `buffer` - Buffer to receive data to.\n * `size` - Size of the buffer."] pub fn httpcReceiveData(context: *mut httpcContext, buffer: *mut u8_, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Receives data from a HTTP context with a timeout value.\n @param context Context to use.\n @param buffer Buffer to receive data to.\n @param size Size of the buffer.\n @param timeout Maximum time in nanoseconds to wait for a reply."] - #[doc = ""] + #[doc = " Receives data from a HTTP context with a timeout value.\n # Arguments\n\n* `context` - Context to use.\n * `buffer` - Buffer to receive data to.\n * `size` - Size of the buffer.\n * `timeout` - Maximum time in nanoseconds to wait for a reply."] pub fn httpcReceiveDataTimeout( context: *mut httpcContext, buffer: *mut u8_, @@ -15225,8 +12365,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets the request state of a HTTP context.\n @param context Context to use.\n @param out Pointer to output the HTTP request state to."] - #[doc = ""] + #[doc = " Gets the request state of a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `out` - Pointer to output the HTTP request state to."] pub fn httpcGetRequestState( context: *mut httpcContext, out: *mut HTTPC_RequestStatus, @@ -15234,8 +12373,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets the download size state of a HTTP context.\n @param context Context to use.\n @param downloadedsize Pointer to output the downloaded size to.\n @param contentsize Pointer to output the total content size to."] - #[doc = ""] + #[doc = " Gets the download size state of a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `downloadedsize` - Pointer to output the downloaded size to.\n * `contentsize` - Pointer to output the total content size to."] pub fn httpcGetDownloadSizeState( context: *mut httpcContext, downloadedsize: *mut u32_, @@ -15244,14 +12382,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets the response code of the HTTP context.\n @param context Context to get the response code of.\n @param out Pointer to write the response code to."] - #[doc = ""] + #[doc = " Gets the response code of the HTTP context.\n # Arguments\n\n* `context` - Context to get the response code of.\n * `out` - Pointer to write the response code to."] pub fn httpcGetResponseStatusCode(context: *mut httpcContext, out: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the response code of the HTTP context with a timeout value.\n @param context Context to get the response code of.\n @param out Pointer to write the response code to.\n @param timeout Maximum time in nanoseconds to wait for a reply."] - #[doc = ""] + #[doc = " Gets the response code of the HTTP context with a timeout value.\n # Arguments\n\n* `context` - Context to get the response code of.\n * `out` - Pointer to write the response code to.\n * `timeout` - Maximum time in nanoseconds to wait for a reply."] pub fn httpcGetResponseStatusCodeTimeout( context: *mut httpcContext, out: *mut u32_, @@ -15260,8 +12396,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets a response header field from a HTTP context.\n @param context Context to use.\n @param name Name of the field.\n @param value Pointer to output the value of the field to.\n @param valuebuf_maxsize Maximum size of the value buffer."] - #[doc = ""] + #[doc = " Gets a response header field from a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `name` - Name of the field.\n * `value` - Pointer to output the value of the field to.\n * `valuebuf_maxsize` - Maximum size of the value buffer."] pub fn httpcGetResponseHeader( context: *mut httpcContext, name: *const ::libc::c_char, @@ -15271,8 +12406,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Adds a trusted RootCA cert to a HTTP context.\n @param context Context to use.\n @param cert Pointer to DER cert.\n @param certsize Size of the DER cert."] - #[doc = ""] + #[doc = " Adds a trusted RootCA cert to a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `cert` - Pointer to DER cert.\n * `certsize` - Size of the DER cert."] pub fn httpcAddTrustedRootCA( context: *mut httpcContext, cert: *const u8_, @@ -15281,14 +12415,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Adds a default RootCA cert to a HTTP context.\n @param context Context to use.\n @param certID ID of the cert to add, see sslc.h."] - #[doc = ""] + #[doc = " Adds a default RootCA cert to a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `certID` - ID of the cert to add, see sslc.h."] pub fn httpcAddDefaultCert(context: *mut httpcContext, certID: SSLC_DefaultRootCert) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the RootCertChain for a HTTP context.\n @param context Context to use.\n @param RootCertChain_contexthandle Contexthandle for the RootCertChain."] - #[doc = ""] + #[doc = " Sets the RootCertChain for a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `RootCertChain_contexthandle` - Contexthandle for the RootCertChain."] pub fn httpcSelectRootCertChain( context: *mut httpcContext, RootCertChain_contexthandle: u32_, @@ -15296,8 +12428,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Sets the ClientCert for a HTTP context.\n @param context Context to use.\n @param cert Pointer to DER cert.\n @param certsize Size of the DER cert.\n @param privk Pointer to the DER private key.\n @param privk_size Size of the privk."] - #[doc = ""] + #[doc = " Sets the ClientCert for a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `cert` - Pointer to DER cert.\n * `certsize` - Size of the DER cert.\n * `privk` - Pointer to the DER private key.\n * `privk_size` - Size of the privk."] pub fn httpcSetClientCert( context: *mut httpcContext, cert: *const u8_, @@ -15308,8 +12439,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Sets the default clientcert for a HTTP context.\n @param context Context to use.\n @param certID ID of the cert to add, see sslc.h."] - #[doc = ""] + #[doc = " Sets the default clientcert for a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `certID` - ID of the cert to add, see sslc.h."] pub fn httpcSetClientCertDefault( context: *mut httpcContext, certID: SSLC_DefaultClientCert, @@ -15317,8 +12447,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Sets the ClientCert contexthandle for a HTTP context.\n @param context Context to use.\n @param ClientCert_contexthandle Contexthandle for the ClientCert."] - #[doc = ""] + #[doc = " Sets the ClientCert contexthandle for a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `ClientCert_contexthandle` - Contexthandle for the ClientCert."] pub fn httpcSetClientCertContext( context: *mut httpcContext, ClientCert_contexthandle: u32_, @@ -15326,32 +12455,27 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Sets SSL options for the context.\n The HTTPC SSL option bits are the same as those defined in sslc.h\n @param context Context to set flags on.\n @param options SSL option flags."] - #[doc = ""] + #[doc = " Sets SSL options for the context.\n The HTTPC SSL option bits are the same as those defined in sslc.h\n # Arguments\n\n* `context` - Context to set flags on.\n * `options` - SSL option flags."] pub fn httpcSetSSLOpt(context: *mut httpcContext, options: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the SSL options which will be cleared for the context.\n The HTTPC SSL option bits are the same as those defined in sslc.h\n @param context Context to clear flags on.\n @param options SSL option flags."] - #[doc = ""] + #[doc = " Sets the SSL options which will be cleared for the context.\n The HTTPC SSL option bits are the same as those defined in sslc.h\n # Arguments\n\n* `context` - Context to clear flags on.\n * `options` - SSL option flags."] pub fn httpcSetSSLClearOpt(context: *mut httpcContext, options: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Creates a RootCertChain. Up to 2 RootCertChains can be created under this user-process.\n @param RootCertChain_contexthandle Output RootCertChain contexthandle."] - #[doc = ""] + #[doc = " Creates a RootCertChain. Up to 2 RootCertChains can be created under this user-process.\n # Arguments\n\n* `RootCertChain_contexthandle` - Output RootCertChain contexthandle."] pub fn httpcCreateRootCertChain(RootCertChain_contexthandle: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Destroy a RootCertChain.\n @param RootCertChain_contexthandle RootCertChain to use."] - #[doc = ""] + #[doc = " Destroy a RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - RootCertChain to use."] pub fn httpcDestroyRootCertChain(RootCertChain_contexthandle: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Adds a RootCA cert to a RootCertChain.\n @param RootCertChain_contexthandle RootCertChain to use.\n @param cert Pointer to DER cert.\n @param certsize Size of the DER cert.\n @param cert_contexthandle Optional output ptr for the cert contexthandle(this can be NULL)."] - #[doc = ""] + #[doc = " Adds a RootCA cert to a RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - RootCertChain to use.\n * `cert` - Pointer to DER cert.\n * `certsize` - Size of the DER cert.\n * `cert_contexthandle` - Optional output ptr for the cert contexthandle(this can be NULL)."] pub fn httpcRootCertChainAddCert( RootCertChain_contexthandle: u32_, cert: *const u8_, @@ -15361,8 +12485,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Adds a default RootCA cert to a RootCertChain.\n @param RootCertChain_contexthandle RootCertChain to use.\n @param certID ID of the cert to add, see sslc.h.\n @param cert_contexthandle Optional output ptr for the cert contexthandle(this can be NULL)."] - #[doc = ""] + #[doc = " Adds a default RootCA cert to a RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - RootCertChain to use.\n * `certID` - ID of the cert to add, see sslc.h.\n * `cert_contexthandle` - Optional output ptr for the cert contexthandle(this can be NULL)."] pub fn httpcRootCertChainAddDefaultCert( RootCertChain_contexthandle: u32_, certID: SSLC_DefaultRootCert, @@ -15371,8 +12494,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Removes a cert from a RootCertChain.\n @param RootCertChain_contexthandle RootCertChain to use.\n @param cert_contexthandle Contexthandle of the cert to remove."] - #[doc = ""] + #[doc = " Removes a cert from a RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - RootCertChain to use.\n * `cert_contexthandle` - Contexthandle of the cert to remove."] pub fn httpcRootCertChainRemoveCert( RootCertChain_contexthandle: u32_, cert_contexthandle: u32_, @@ -15380,8 +12502,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Opens a ClientCert-context. Up to 2 ClientCert-contexts can be open under this user-process.\n @param cert Pointer to DER cert.\n @param certsize Size of the DER cert.\n @param privk Pointer to the DER private key.\n @param privk_size Size of the privk.\n @param ClientCert_contexthandle Output ClientCert context handle."] - #[doc = ""] + #[doc = " Opens a ClientCert-context. Up to 2 ClientCert-contexts can be open under this user-process.\n # Arguments\n\n* `cert` - Pointer to DER cert.\n * `certsize` - Size of the DER cert.\n * `privk` - Pointer to the DER private key.\n * `privk_size` - Size of the privk.\n * `ClientCert_contexthandle` - Output ClientCert context handle."] pub fn httpcOpenClientCertContext( cert: *const u8_, certsize: u32_, @@ -15392,8 +12513,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Opens a ClientCert-context with a default clientclient. Up to 2 ClientCert-contexts can be open under this user-process.\n @param certID ID of the cert to add, see sslc.h.\n @param ClientCert_contexthandle Output ClientCert context handle."] - #[doc = ""] + #[doc = " Opens a ClientCert-context with a default clientclient. Up to 2 ClientCert-contexts can be open under this user-process.\n # Arguments\n\n* `certID` - ID of the cert to add, see sslc.h.\n * `ClientCert_contexthandle` - Output ClientCert context handle."] pub fn httpcOpenDefaultClientCertContext( certID: SSLC_DefaultClientCert, ClientCert_contexthandle: *mut u32_, @@ -15401,14 +12521,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Closes a ClientCert context.\n @param ClientCert_contexthandle ClientCert context to use."] - #[doc = ""] + #[doc = " Closes a ClientCert context.\n # Arguments\n\n* `ClientCert_contexthandle` - ClientCert context to use."] pub fn httpcCloseClientCertContext(ClientCert_contexthandle: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Downloads data from the HTTP context into a buffer.\n The *entire* content must be downloaded before using httpcCloseContext(), otherwise httpcCloseContext() will hang.\n @param context Context to download data from.\n @param buffer Buffer to write data to.\n @param size Size of the buffer.\n @param downloadedsize Pointer to write the size of the downloaded data to."] - #[doc = ""] + #[doc = " Downloads data from the HTTP context into a buffer.\n The *entire* content must be downloaded before using httpcCloseContext(), otherwise httpcCloseContext() will hang.\n # Arguments\n\n* `context` - Context to download data from.\n * `buffer` - Buffer to write data to.\n * `size` - Size of the buffer.\n * `downloadedsize` - Pointer to write the size of the downloaded data to."] pub fn httpcDownloadData( context: *mut httpcContext, buffer: *mut u8_, @@ -15418,12 +12536,10 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Sets Keep-Alive for the context.\n @param context Context to set the KeepAlive flag on.\n @param option HTTPC_KeepAlive option."] - #[doc = ""] + #[doc = " Sets Keep-Alive for the context.\n # Arguments\n\n* `context` - Context to set the KeepAlive flag on.\n * `option` - HTTPC_KeepAlive option."] pub fn httpcSetKeepAlive(context: *mut httpcContext, option: HTTPC_KeepAlive) -> Result; } -#[doc = "Node info struct."] -#[doc = ""] +#[doc = " Node info struct."] #[repr(C)] #[derive(Copy, Clone)] pub struct udsNodeInfo { @@ -15465,8 +12581,7 @@ impl Default for udsNodeInfo { } } } -#[doc = "Connection status struct."] -#[doc = ""] +#[doc = " Connection status struct."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct udsConnectionStatus { @@ -15479,8 +12594,7 @@ pub struct udsConnectionStatus { pub max_nodes: u8_, pub node_bitmask: u16_, } -#[doc = "Network struct stored as big-endian."] -#[doc = ""] +#[doc = " Network struct stored as big-endian."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct udsNetworkStruct { @@ -15520,8 +12634,7 @@ pub struct udsBindContext { pub event: Handle, pub spectator: bool, } -#[doc = "General NWM input structure used for AP scanning."] -#[doc = ""] +#[doc = " General NWM input structure used for AP scanning."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct nwmScanInputStruct { @@ -15541,8 +12654,7 @@ impl Default for nwmScanInputStruct { } } } -#[doc = "General NWM output structure from AP scanning."] -#[doc = ""] +#[doc = " General NWM output structure from AP scanning."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct nwmBeaconDataReplyHeader { @@ -15550,8 +12662,7 @@ pub struct nwmBeaconDataReplyHeader { pub size: u32_, pub total_entries: u32_, } -#[doc = "General NWM output structure from AP scanning, for each entry."] -#[doc = ""] +#[doc = " General NWM output structure from AP scanning, for each entry."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct nwmBeaconDataReplyEntry { @@ -15565,8 +12676,7 @@ pub struct nwmBeaconDataReplyEntry { pub unk_x14: u32_, pub val_x1c: u32_, } -#[doc = "Output structure generated from host scanning output."] -#[doc = ""] +#[doc = " Output structure generated from host scanning output."] #[repr(C)] #[derive(Copy, Clone)] pub struct udsNetworkScanInfo { @@ -15596,19 +12706,16 @@ pub const UDSCONTYPE_Spectator: udsConnectionType = 2; pub type udsConnectionType = ::libc::c_uint; extern "C" { #[must_use] - #[doc = "Initializes UDS.\n @param sharedmem_size This must be 0x1000-byte aligned.\n @param username Optional custom UTF-8 username(converted to UTF-16 internally) that other nodes on the UDS network can use. If not set the username from system-config is used. Max len is 10 characters without NUL-terminator."] - #[doc = ""] + #[doc = " Initializes UDS.\n # Arguments\n\n* `sharedmem_size` - This must be 0x1000-byte aligned.\n * `username` - Optional custom UTF-8 username(converted to UTF-16 internally) that other nodes on the UDS network can use. If not set the username from system-config is used. Max len is 10 characters without NUL-terminator."] pub fn udsInit(sharedmem_size: usize, username: *const ::libc::c_char) -> Result; } extern "C" { - #[doc = "Exits UDS."] - #[doc = ""] + #[doc = " Exits UDS."] pub fn udsExit(); } extern "C" { #[must_use] - #[doc = "Generates a NodeInfo struct with data loaded from system-config.\n @param nodeinfo Output NodeInfo struct.\n @param username If set, this is the UTF-8 string to convert for use in the struct. Max len is 10 characters without NUL-terminator."] - #[doc = ""] + #[doc = " Generates a NodeInfo struct with data loaded from system-config.\n # Arguments\n\n* `nodeinfo` - Output NodeInfo struct.\n * `username` - If set, this is the UTF-8 string to convert for use in the struct. Max len is 10 characters without NUL-terminator."] pub fn udsGenerateNodeInfo( nodeinfo: *mut udsNodeInfo, username: *const ::libc::c_char, @@ -15616,21 +12723,18 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Loads the UTF-16 username stored in the input NodeInfo struct, converted to UTF-8.\n @param nodeinfo Input NodeInfo struct.\n @param username This is the output UTF-8 string. Max len is 10 characters without NUL-terminator."] - #[doc = ""] + #[doc = " Loads the UTF-16 username stored in the input NodeInfo struct, converted to UTF-8.\n # Arguments\n\n* `nodeinfo` - Input NodeInfo struct.\n * `username` - This is the output UTF-8 string. Max len is 10 characters without NUL-terminator."] pub fn udsGetNodeInfoUsername( nodeinfo: *const udsNodeInfo, username: *mut ::libc::c_char, ) -> Result; } extern "C" { - #[doc = "Checks whether a NodeInfo struct was initialized by NWM-module(not any output from udsGenerateNodeInfo()).\n @param nodeinfo Input NodeInfo struct."] - #[doc = ""] + #[doc = " Checks whether a NodeInfo struct was initialized by NWM-module(not any output from udsGenerateNodeInfo()).\n # Arguments\n\n* `nodeinfo` - Input NodeInfo struct."] pub fn udsCheckNodeInfoInitialized(nodeinfo: *const udsNodeInfo) -> bool; } extern "C" { - #[doc = "Generates a default NetworkStruct for creating networks.\n @param network The output struct.\n @param wlancommID Unique local-WLAN communications ID for each application.\n @param id8 Additional ID that can be used by the application for different types of networks.\n @param max_nodes Maximum number of nodes(devices) that can be connected to the network, including the host."] - #[doc = ""] + #[doc = " Generates a default NetworkStruct for creating networks.\n # Arguments\n\n* `network` - The output struct.\n * `wlancommID` - Unique local-WLAN communications ID for each application.\n * `id8` - Additional ID that can be used by the application for different types of networks.\n * `max_nodes` - Maximum number of nodes(devices) that can be connected to the network, including the host."] pub fn udsGenerateDefaultNetworkStruct( network: *mut udsNetworkStruct, wlancommID: u32_, @@ -15640,8 +12744,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Scans for networks via beacon-scanning.\n @param outbuf Buffer which will be used by the beacon-scanning command and for the data parsing afterwards. Normally there's no need to use the contents of this buffer once this function returns.\n @param maxsize Max size of the buffer.\n @Param networks Ptr where the allocated udsNetworkScanInfo array buffer is written. The allocsize is sizeof(udsNetworkScanInfo)*total_networks.\n @Param total_networks Total number of networks stored under the networks buffer.\n @param wlancommID Unique local-WLAN communications ID for each application.\n @param id8 Additional ID that can be used by the application for different types of networks.\n @param host_macaddress When set, this code will only return network info from the specified host MAC address.\n @connected When not connected to a network this *must* be false. When connected to a network this *must* be true."] - #[doc = ""] + #[doc = " Scans for networks via beacon-scanning.\n # Arguments\n\n* `outbuf` - Buffer which will be used by the beacon-scanning command and for the data parsing afterwards. Normally there's no need to use the contents of this buffer once this function returns.\n * `maxsize` - Max size of the buffer.\n networks Ptr where the allocated udsNetworkScanInfo array buffer is written. The allocsize is sizeof(udsNetworkScanInfo)*total_networks.\n total_networks Total number of networks stored under the networks buffer.\n * `wlancommID` - Unique local-WLAN communications ID for each application.\n * `id8` - Additional ID that can be used by the application for different types of networks.\n * `host_macaddress` - When set, this code will only return network info from the specified host MAC address.\n When not connected to a network this *must* be false. When connected to a network this *must* be true."] pub fn udsScanBeacons( outbuf: *mut ::libc::c_void, maxsize: usize, @@ -15655,14 +12758,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "This can be used by the host to set the appdata contained in the broadcasted beacons.\n @param buf Appdata buffer.\n @param size Size of the input appdata."] - #[doc = ""] + #[doc = " This can be used by the host to set the appdata contained in the broadcasted beacons.\n # Arguments\n\n* `buf` - Appdata buffer.\n * `size` - Size of the input appdata."] pub fn udsSetApplicationData(buf: *const ::libc::c_void, size: usize) -> Result; } extern "C" { #[must_use] - #[doc = "This can be used while on a network(host/client) to get the appdata from the current beacon.\n @param buf Appdata buffer.\n @param size Max size of the output buffer.\n @param actual_size If set, the actual size of the appdata written into the buffer is stored here."] - #[doc = ""] + #[doc = " This can be used while on a network(host/client) to get the appdata from the current beacon.\n # Arguments\n\n* `buf` - Appdata buffer.\n * `size` - Max size of the output buffer.\n * `actual_size` - If set, the actual size of the appdata written into the buffer is stored here."] pub fn udsGetApplicationData( buf: *mut ::libc::c_void, size: usize, @@ -15671,8 +12772,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "This can be used with a NetworkStruct, from udsScanBeacons() mainly, for getting the appdata.\n @param buf Appdata buffer.\n @param size Max size of the output buffer.\n @param actual_size If set, the actual size of the appdata written into the buffer is stored here."] - #[doc = ""] + #[doc = " This can be used with a NetworkStruct, from udsScanBeacons() mainly, for getting the appdata.\n # Arguments\n\n* `buf` - Appdata buffer.\n * `size` - Max size of the output buffer.\n * `actual_size` - If set, the actual size of the appdata written into the buffer is stored here."] pub fn udsGetNetworkStructApplicationData( network: *const udsNetworkStruct, buf: *mut ::libc::c_void, @@ -15682,8 +12782,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Create a bind.\n @param bindcontext The output bind context.\n @param NetworkNodeID This is the NetworkNodeID which this bind can receive data from.\n @param spectator False for a regular bind, true for a spectator.\n @param data_channel This is an arbitrary value to use for data-frame filtering. This bind will only receive data frames which contain a matching data_channel value, which was specified by udsSendTo(). The data_channel must be non-zero.\n @param recv_buffer_size Size of the buffer under sharedmem used for temporarily storing received data-frames which are then loaded by udsPullPacket(). The system requires this to be >=0x5F4. UDS_DEFAULT_RECVBUFSIZE can be used for this."] - #[doc = ""] + #[doc = " Create a bind.\n # Arguments\n\n* `bindcontext` - The output bind context.\n * `NetworkNodeID` - This is the NetworkNodeID which this bind can receive data from.\n * `spectator` - False for a regular bind, true for a spectator.\n * `data_channel` - This is an arbitrary value to use for data-frame filtering. This bind will only receive data frames which contain a matching data_channel value, which was specified by udsSendTo(). The data_channel must be non-zero.\n * `recv_buffer_size` - Size of the buffer under sharedmem used for temporarily storing received data-frames which are then loaded by udsPullPacket(). The system requires this to be >=0x5F4. UDS_DEFAULT_RECVBUFSIZE can be used for this."] pub fn udsBind( bindcontext: *mut udsBindContext, NetworkNodeID: u16_, @@ -15694,13 +12793,11 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Remove a bind.\n @param bindcontext The bind context."] - #[doc = ""] + #[doc = " Remove a bind.\n # Arguments\n\n* `bindcontext` - The bind context."] pub fn udsUnbind(bindcontext: *mut udsBindContext) -> Result; } extern "C" { - #[doc = "Waits for the bind event to occur, or checks if the event was signaled. This event is signaled every time new data is available via udsPullPacket().\n @return Always true. However if wait=false, this will return false if the event wasn't signaled.\n @param bindcontext The bind context.\n @param nextEvent Whether to discard the current event and wait for the next event.\n @param wait When true this will not return until the event is signaled. When false this checks if the event was signaled without waiting for it."] - #[doc = ""] + #[doc = " Waits for the bind event to occur, or checks if the event was signaled. This event is signaled every time new data is available via udsPullPacket().\n # Returns\n\nAlways true. However if wait=false, this will return false if the event wasn't signaled.\n # Arguments\n\n* `bindcontext` - The bind context.\n * `nextEvent` - Whether to discard the current event and wait for the next event.\n * `wait` - When true this will not return until the event is signaled. When false this checks if the event was signaled without waiting for it."] pub fn udsWaitDataAvailable( bindcontext: *const udsBindContext, nextEvent: bool, @@ -15709,8 +12806,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Receives data over the network. This data is loaded from the recv_buffer setup by udsBind(). When a node disconnects, this will still return data from that node until there's no more frames from that node in the recv_buffer.\n @param bindcontext Bind context.\n @param buf Output receive buffer.\n @param size Size of the buffer.\n @param actual_size If set, the actual size written into the output buffer is stored here. This is zero when no data was received.\n @param src_NetworkNodeID If set, the source NetworkNodeID is written here. This is zero when no data was received."] - #[doc = ""] + #[doc = " Receives data over the network. This data is loaded from the recv_buffer setup by udsBind(). When a node disconnects, this will still return data from that node until there's no more frames from that node in the recv_buffer.\n # Arguments\n\n* `bindcontext` - Bind context.\n * `buf` - Output receive buffer.\n * `size` - Size of the buffer.\n * `actual_size` - If set, the actual size written into the output buffer is stored here. This is zero when no data was received.\n * `src_NetworkNodeID` - If set, the source NetworkNodeID is written here. This is zero when no data was received."] pub fn udsPullPacket( bindcontext: *const udsBindContext, buf: *mut ::libc::c_void, @@ -15721,8 +12817,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Sends data over the network.\n @param dst_NetworkNodeID Destination NetworkNodeID.\n @param data_channel See udsBind().\n @param flags Send flags, see the UDS_SENDFLAG enum values.\n @param buf Input send buffer.\n @param size Size of the buffer."] - #[doc = ""] + #[doc = " Sends data over the network.\n # Arguments\n\n* `dst_NetworkNodeID` - Destination NetworkNodeID.\n * `data_channel` - See udsBind().\n * `flags` - Send flags, see the UDS_SENDFLAG enum values.\n * `buf` - Input send buffer.\n * `size` - Size of the buffer."] pub fn udsSendTo( dst_NetworkNodeID: u16_, data_channel: u8_, @@ -15733,14 +12828,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets the wifi channel currently being used.\n @param channel Output channel."] - #[doc = ""] + #[doc = " Gets the wifi channel currently being used.\n # Arguments\n\n* `channel` - Output channel."] pub fn udsGetChannel(channel: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Starts hosting a new network.\n @param network The NetworkStruct, you can use udsGenerateDefaultNetworkStruct() for generating this.\n @param passphrase Raw input passphrase buffer.\n @param passphrase_size Size of the passphrase buffer.\n @param context Optional output bind context which will be created for this host, with NetworkNodeID=UDS_BROADCAST_NETWORKNODEID.\n @param data_channel This is the data_channel value which will be passed to udsBind() internally.\n @param recv_buffer_size This is the recv_buffer_size value which will be passed to udsBind() internally."] - #[doc = ""] + #[doc = " Starts hosting a new network.\n # Arguments\n\n* `network` - The NetworkStruct, you can use udsGenerateDefaultNetworkStruct() for generating this.\n * `passphrase` - Raw input passphrase buffer.\n * `passphrase_size` - Size of the passphrase buffer.\n * `context` - Optional output bind context which will be created for this host, with NetworkNodeID=UDS_BROADCAST_NETWORKNODEID.\n * `data_channel` - This is the data_channel value which will be passed to udsBind() internally.\n * `recv_buffer_size` - This is the recv_buffer_size value which will be passed to udsBind() internally."] pub fn udsCreateNetwork( network: *const udsNetworkStruct, passphrase: *const ::libc::c_void, @@ -15752,8 +12845,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Connect to a network.\n @param network The NetworkStruct, you can use udsScanBeacons() for this.\n @param passphrase Raw input passphrase buffer.\n @param passphrase_size Size of the passphrase buffer.\n @param context Optional output bind context which will be created for this host.\n @param recv_NetworkNodeID This is the NetworkNodeID passed to udsBind() internally.\n @param connection_type Type of connection, see the udsConnectionType enum values.\n @param data_channel This is the data_channel value which will be passed to udsBind() internally.\n @param recv_buffer_size This is the recv_buffer_size value which will be passed to udsBind() internally."] - #[doc = ""] + #[doc = " Connect to a network.\n # Arguments\n\n* `network` - The NetworkStruct, you can use udsScanBeacons() for this.\n * `passphrase` - Raw input passphrase buffer.\n * `passphrase_size` - Size of the passphrase buffer.\n * `context` - Optional output bind context which will be created for this host.\n * `recv_NetworkNodeID` - This is the NetworkNodeID passed to udsBind() internally.\n * `connection_type` - Type of connection, see the udsConnectionType enum values.\n * `data_channel` - This is the data_channel value which will be passed to udsBind() internally.\n * `recv_buffer_size` - This is the recv_buffer_size value which will be passed to udsBind() internally."] pub fn udsConnectNetwork( network: *const udsNetworkStruct, passphrase: *const ::libc::c_void, @@ -15767,61 +12859,51 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Stop hosting the network."] - #[doc = ""] + #[doc = " Stop hosting the network."] pub fn udsDestroyNetwork() -> Result; } extern "C" { #[must_use] - #[doc = "Disconnect this client device from the network."] - #[doc = ""] + #[doc = " Disconnect this client device from the network."] pub fn udsDisconnectNetwork() -> Result; } extern "C" { #[must_use] - #[doc = "This can be used by the host to force-disconnect client(s).\n @param NetworkNodeID Target NetworkNodeID. UDS_BROADCAST_NETWORKNODEID can be used to disconnect all clients."] - #[doc = ""] + #[doc = " This can be used by the host to force-disconnect client(s).\n # Arguments\n\n* `NetworkNodeID` - Target NetworkNodeID. UDS_BROADCAST_NETWORKNODEID can be used to disconnect all clients."] pub fn udsEjectClient(NetworkNodeID: u16_) -> Result; } extern "C" { #[must_use] - #[doc = "This can be used by the host to force-disconnect the spectators. Afterwards new spectators will not be allowed to connect until udsAllowSpectators() is used."] - #[doc = ""] + #[doc = " This can be used by the host to force-disconnect the spectators. Afterwards new spectators will not be allowed to connect until udsAllowSpectators() is used."] pub fn udsEjectSpectator() -> Result; } extern "C" { #[must_use] - #[doc = "This can be used by the host to update the network attributes. If bitmask 0x4 is clear in the input bitmask, this clears that bit in the value before actually writing the value into state. Normally you should use the below wrapper functions.\n @param bitmask Bitmask to clear/set in the attributes. See the UDSNETATTR enum values.\n @param flag When false, bit-clear, otherwise bit-set."] - #[doc = ""] + #[doc = " This can be used by the host to update the network attributes. If bitmask 0x4 is clear in the input bitmask, this clears that bit in the value before actually writing the value into state. Normally you should use the below wrapper functions.\n # Arguments\n\n* `bitmask` - Bitmask to clear/set in the attributes. See the UDSNETATTR enum values.\n * `flag` - When false, bit-clear, otherwise bit-set."] pub fn udsUpdateNetworkAttribute(bitmask: u16_, flag: bool) -> Result; } extern "C" { #[must_use] - #[doc = "This uses udsUpdateNetworkAttribute() for (un)blocking new connections to this host.\n @param block When true, block the specified connection types(bitmask set). Otherwise allow them(bitmask clear).\n @param clients When true, (un)block regular clients.\n @param flag When true, update UDSNETATTR_x4. Normally this should be false."] - #[doc = ""] + #[doc = " This uses udsUpdateNetworkAttribute() for (un)blocking new connections to this host.\n # Arguments\n\n* `block` - When true, block the specified connection types(bitmask set). Otherwise allow them(bitmask clear).\n * `clients` - When true, (un)block regular clients.\n * `flag` - When true, update UDSNETATTR_x4. Normally this should be false."] pub fn udsSetNewConnectionsBlocked(block: bool, clients: bool, flag: bool) -> Result; } extern "C" { #[must_use] - #[doc = "This uses udsUpdateNetworkAttribute() for unblocking new spectator connections to this host. See udsEjectSpectator() for blocking new spectators."] - #[doc = ""] + #[doc = " This uses udsUpdateNetworkAttribute() for unblocking new spectator connections to this host. See udsEjectSpectator() for blocking new spectators."] pub fn udsAllowSpectators() -> Result; } extern "C" { #[must_use] - #[doc = "This loads the current ConnectionStatus struct.\n @param output Output ConnectionStatus struct."] - #[doc = ""] + #[doc = " This loads the current ConnectionStatus struct.\n # Arguments\n\n* `output` - Output ConnectionStatus struct."] pub fn udsGetConnectionStatus(output: *mut udsConnectionStatus) -> Result; } extern "C" { - #[doc = "Waits for the ConnectionStatus event to occur, or checks if the event was signaled. This event is signaled when the data from udsGetConnectionStatus() was updated internally.\n @return Always true. However if wait=false, this will return false if the event wasn't signaled.\n @param nextEvent Whether to discard the current event and wait for the next event.\n @param wait When true this will not return until the event is signaled. When false this checks if the event was signaled without waiting for it."] - #[doc = ""] + #[doc = " Waits for the ConnectionStatus event to occur, or checks if the event was signaled. This event is signaled when the data from udsGetConnectionStatus() was updated internally.\n # Returns\n\nAlways true. However if wait=false, this will return false if the event wasn't signaled.\n # Arguments\n\n* `nextEvent` - Whether to discard the current event and wait for the next event.\n * `wait` - When true this will not return until the event is signaled. When false this checks if the event was signaled without waiting for it."] pub fn udsWaitConnectionStatusEvent(nextEvent: bool, wait: bool) -> bool; } extern "C" { #[must_use] - #[doc = "This loads a NodeInfo struct for the specified NetworkNodeID. The broadcast alias can't be used with this.\n @param NetworkNodeID Target NetworkNodeID.\n @param output Output NodeInfo struct."] - #[doc = ""] + #[doc = " This loads a NodeInfo struct for the specified NetworkNodeID. The broadcast alias can't be used with this.\n # Arguments\n\n* `NetworkNodeID` - Target NetworkNodeID.\n * `output` - Output NodeInfo struct."] pub fn udsGetNodeInformation(NetworkNodeID: u16_, output: *mut udsNodeInfo) -> Result; } pub const NDM_EXCLUSIVE_STATE_NONE: ndmExclusiveState = 0; @@ -15829,9 +12911,7 @@ pub const NDM_EXCLUSIVE_STATE_INFRASTRUCTURE: ndmExclusiveState = 1; pub const NDM_EXCLUSIVE_STATE_LOCAL_COMMUNICATIONS: ndmExclusiveState = 2; pub const NDM_EXCLUSIVE_STATE_STREETPASS: ndmExclusiveState = 3; pub const NDM_EXCLUSIVE_STATE_STREETPASS_DATA: ndmExclusiveState = 4; -#[doc = "Exclusive states."] -#[doc = ""] - +#[doc = " Exclusive states."] pub type ndmExclusiveState = ::libc::c_uint; pub const NDM_STATE_INITIAL: ndmState = 0; pub const NDM_STATE_SUSPENDED: ndmState = 1; @@ -15845,9 +12925,7 @@ pub const NDM_STATE_INFRASTRUCTURE_FORCE_DISCONNECTING: ndmState = 8; pub const NDM_STATE_CEC_WORKING: ndmState = 9; pub const NDM_STATE_CEC_FORCE_SUSPENDING: ndmState = 10; pub const NDM_STATE_CEC_SUSPENDING: ndmState = 11; -#[doc = "Current states."] -#[doc = ""] - +#[doc = " Current states."] pub type ndmState = ::libc::c_uint; pub const NDM_DAEMON_CEC: ndmDaemon = 0; pub const NDM_DAEMON_BOSS: ndmDaemon = 1; @@ -15861,9 +12939,7 @@ pub const NDM_DAEMON_MASK_FRIENDS: ndmDaemonMask = 8; pub const NDM_DAEMON_MASK_BACKGROUOND: ndmDaemonMask = 7; pub const NDM_DAEMON_MASK_ALL: ndmDaemonMask = 15; pub const NDM_DAEMON_MASK_DEFAULT: ndmDaemonMask = 9; -#[doc = "Used to specify multiple daemons."] -#[doc = ""] - +#[doc = " Used to specify multiple daemons."] pub type ndmDaemonMask = ::libc::c_uint; pub const NDM_DAEMON_STATUS_BUSY: ndmDaemonStatus = 0; pub const NDM_DAEMON_STATUS_IDLE: ndmDaemonStatus = 1; @@ -15872,244 +12948,174 @@ pub const NDM_DAEMON_STATUS_SUSPENDED: ndmDaemonStatus = 3; pub type ndmDaemonStatus = ::libc::c_uint; extern "C" { #[must_use] - #[doc = "Initializes ndmu."] - #[doc = ""] + #[doc = " Initializes ndmu."] pub fn ndmuInit() -> Result; } extern "C" { - #[doc = "Exits ndmu."] - #[doc = ""] + #[doc = " Exits ndmu."] pub fn ndmuExit(); } extern "C" { #[must_use] - #[doc = "Sets the network daemon to an exclusive state.\n @param state State specified in the ndmExclusiveState enumerator."] - #[doc = ""] + #[doc = " Sets the network daemon to an exclusive state.\n # Arguments\n\n* `state` - State specified in the ndmExclusiveState enumerator."] pub fn NDMU_EnterExclusiveState(state: ndmExclusiveState) -> Result; } extern "C" { #[must_use] - #[doc = "Cancels an exclusive state for the network daemon."] - #[doc = ""] + #[doc = " Cancels an exclusive state for the network daemon."] pub fn NDMU_LeaveExclusiveState() -> Result; } extern "C" { #[must_use] - #[doc = "Returns the exclusive state for the network daemon.\n @param state Pointer to write the exclsuive state to."] - #[doc = ""] + #[doc = " Returns the exclusive state for the network daemon.\n # Arguments\n\n* `state` - Pointer to write the exclsuive state to."] pub fn NDMU_GetExclusiveState(state: *mut ndmExclusiveState) -> Result; } extern "C" { #[must_use] - #[doc = "Locks the exclusive state."] - #[doc = ""] + #[doc = " Locks the exclusive state."] pub fn NDMU_LockState() -> Result; } extern "C" { #[must_use] - #[doc = "Unlocks the exclusive state."] - #[doc = ""] + #[doc = " Unlocks the exclusive state."] pub fn NDMU_UnlockState() -> Result; } extern "C" { #[must_use] - #[doc = "Suspends network daemon.\n @param mask The specified daemon."] - #[doc = ""] + #[doc = " Suspends network daemon.\n # Arguments\n\n* `mask` - The specified daemon."] pub fn NDMU_SuspendDaemons(mask: ndmDaemonMask) -> Result; } extern "C" { #[must_use] - #[doc = "Resumes network daemon.\n @param mask The specified daemon."] - #[doc = ""] + #[doc = " Resumes network daemon.\n # Arguments\n\n* `mask` - The specified daemon."] pub fn NDMU_ResumeDaemons(mask: ndmDaemonMask) -> Result; } extern "C" { #[must_use] - #[doc = "Suspends scheduling for all network daemons.\n @param flag 0 = Wait for completion, 1 = Perform in background."] - #[doc = ""] + #[doc = " Suspends scheduling for all network daemons.\n # Arguments\n\n* `flag` - 0 = Wait for completion, 1 = Perform in background."] pub fn NDMU_SuspendScheduler(flag: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Resumes daemon scheduling."] - #[doc = ""] + #[doc = " Resumes daemon scheduling."] pub fn NDMU_ResumeScheduler() -> Result; } extern "C" { #[must_use] - #[doc = "Returns the current state for the network daemon.\n @param state Pointer to write the current state to."] - #[doc = ""] + #[doc = " Returns the current state for the network daemon.\n # Arguments\n\n* `state` - Pointer to write the current state to."] pub fn NDMU_GetCurrentState(state: *mut ndmState) -> Result; } extern "C" { #[must_use] - #[doc = "Returns the daemon state.\n @param state Pointer to write the daemons state to."] - #[doc = ""] + #[doc = " Returns the daemon state.\n # Arguments\n\n* `state` - Pointer to write the daemons state to."] pub fn NDMU_QueryStatus(status: *mut ndmDaemonStatus) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the scan interval.\n @param interval Value to set the scan interval to."] - #[doc = ""] + #[doc = " Sets the scan interval.\n # Arguments\n\n* `interval` - Value to set the scan interval to."] pub fn NDMU_SetScanInterval(interval: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Returns the scan interval.\n @param interval Pointer to write the interval value to."] - #[doc = ""] + #[doc = " Returns the scan interval.\n # Arguments\n\n* `interval` - Pointer to write the interval value to."] pub fn NDMU_GetScanInterval(interval: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Returns the retry interval.\n @param interval Pointer to write the interval value to."] - #[doc = ""] + #[doc = " Returns the retry interval.\n # Arguments\n\n* `interval` - Pointer to write the interval value to."] pub fn NDMU_GetRetryInterval(interval: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Reverts network daemon to defaults."] - #[doc = ""] + #[doc = " Reverts network daemon to defaults."] pub fn NDMU_ResetDaemons() -> Result; } extern "C" { #[must_use] - #[doc = "Gets the current default daemon bit mask.\n @param interval Pointer to write the default daemon mask value to. The default value is (DAEMONMASK_CEC | DAEMONMASK_FRIENDS)"] - #[doc = ""] + #[doc = " Gets the current default daemon bit mask.\n # Arguments\n\n* `interval` - Pointer to write the default daemon mask value to. The default value is (DAEMONMASK_CEC | DAEMONMASK_FRIENDS)"] pub fn NDMU_GetDefaultDaemons(mask: *mut ndmDaemonMask) -> Result; } extern "C" { #[must_use] - #[doc = "Clears half awake mac filter."] - #[doc = ""] + #[doc = " Clears half awake mac filter."] pub fn NDMU_ClearMacFilter() -> Result; } -#[doc = "Initial installation"] -#[doc = ""] - +#[doc = "< Initial installation"] pub const IM_DEFAULT: NIM_InstallationMode = 0; -#[doc = "Unknown"] -#[doc = ""] - +#[doc = "< Unknown"] pub const IM_UNKNOWN1: NIM_InstallationMode = 1; -#[doc = "Unknown"] -#[doc = ""] - +#[doc = "< Unknown"] pub const IM_UNKNOWN2: NIM_InstallationMode = 2; -#[doc = "Reinstall currently installed title; use this if the title is already installed (including updates)"] -#[doc = ""] - +#[doc = "< Reinstall currently installed title; use this if the title is already installed (including updates)"] pub const IM_REINSTALL: NIM_InstallationMode = 3; -#[doc = "Mode that NIM downloads/installs a title with."] -#[doc = ""] - +#[doc = " Mode that NIM downloads/installs a title with."] pub type NIM_InstallationMode = ::libc::c_uint; -#[doc = "Download not yet initialized"] -#[doc = ""] - +#[doc = "< Download not yet initialized"] pub const DS_NOT_INITIALIZED: NIM_DownloadState = 0; -#[doc = "Download initialized"] -#[doc = ""] - +#[doc = "< Download initialized"] pub const DS_INITIALIZED: NIM_DownloadState = 1; -#[doc = "Downloading and installing TMD"] -#[doc = ""] - +#[doc = "< Downloading and installing TMD"] pub const DS_DOWNLOAD_TMD: NIM_DownloadState = 2; -#[doc = "Initializing save data"] -#[doc = ""] - +#[doc = "< Initializing save data"] pub const DS_PREPARE_SAVE_DATA: NIM_DownloadState = 3; -#[doc = "Downloading and installing contents"] -#[doc = ""] - +#[doc = "< Downloading and installing contents"] pub const DS_DOWNLOAD_CONTENTS: NIM_DownloadState = 4; -#[doc = "Waiting before calling AM_CommitImportTitles"] -#[doc = ""] - +#[doc = "< Waiting before calling AM_CommitImportTitles"] pub const DS_WAIT_COMMIT: NIM_DownloadState = 5; -#[doc = "Running AM_CommitImportTitles"] -#[doc = ""] - +#[doc = "< Running AM_CommitImportTitles"] pub const DS_COMMITTING: NIM_DownloadState = 6; -#[doc = "Title installation finished"] -#[doc = ""] - +#[doc = "< Title installation finished"] pub const DS_FINISHED: NIM_DownloadState = 7; -#[doc = "(unknown error regarding title version)"] -#[doc = ""] - +#[doc = "< (unknown error regarding title version)"] pub const DS_VERSION_ERROR: NIM_DownloadState = 8; -#[doc = "Creating the .ctx file?"] -#[doc = ""] - +#[doc = "< Creating the .ctx file?"] pub const DS_CREATE_CONTEXT: NIM_DownloadState = 9; -#[doc = "Irrecoverable error encountered (e.g. out of space)"] -#[doc = ""] - +#[doc = "< Irrecoverable error encountered (e.g. out of space)"] pub const DS_CANNOT_RECOVER: NIM_DownloadState = 10; -#[doc = "Invalid state"] -#[doc = ""] - +#[doc = "< Invalid state"] pub const DS_INVALID: NIM_DownloadState = 11; -#[doc = "Current state of a NIM download/installation."] -#[doc = ""] - +#[doc = " Current state of a NIM download/installation."] pub type NIM_DownloadState = ::libc::c_uint; -#[doc = "Input configuration for NIM download/installation tasks."] -#[doc = ""] +#[doc = " Input configuration for NIM download/installation tasks."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct NIM_TitleConfig { - #[doc = "Title ID"] - #[doc = ""] + #[doc = "< Title ID"] pub titleId: u64_, - #[doc = "Title version"] - #[doc = ""] + #[doc = "< Title version"] pub version: u32_, - #[doc = "Always 0"] - #[doc = ""] + #[doc = "< Always 0"] pub unknown_0: u32_, - #[doc = "Age for the HOME Menu parental controls"] - #[doc = ""] + #[doc = "< Age for the HOME Menu parental controls"] pub ratingAge: u8_, - #[doc = "Media type, see [`FS_MediaType`] enum"] - #[doc = ""] + #[doc = "< Media type, see FS_MediaType enum"] pub mediaType: u8_, - #[doc = "Padding"] - #[doc = ""] + #[doc = "< Padding"] pub padding: [u8_; 2usize], - #[doc = "Unknown input, seems to be always 0"] - #[doc = ""] + #[doc = "< Unknown input, seems to be always 0"] pub unknown_1: u32_, } -#[doc = "Output struct for NIM downloads/installations in progress."] -#[doc = ""] +#[doc = " Output struct for NIM downloads/installations in progress."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct NIM_TitleProgress { - #[doc = "State, see NIM_DownloadState enum"] - #[doc = ""] + #[doc = "< State, see NIM_DownloadState enum"] pub state: u32_, - #[doc = "Last result code in NIM"] - #[doc = ""] + #[doc = "< Last result code in NIM"] pub lastResult: Result, - #[doc = "Amount of bytes that have been downloaded"] - #[doc = ""] + #[doc = "< Amount of bytes that have been downloaded"] pub downloadedSize: u64_, - #[doc = "Amount of bytes that need to be downloaded in total"] - #[doc = ""] + #[doc = "< Amount of bytes that need to be downloaded in total"] pub totalSize: u64_, } extern "C" { #[must_use] - #[doc = "Initializes nim:s. This uses networking and is blocking.\n @param buffer A buffer for internal use. It must be at least 0x20000 bytes long.\n @param buffer_len Length of the passed buffer."] - #[doc = ""] + #[doc = " Initializes nim:s. This uses networking and is blocking.\n # Arguments\n\n* `buffer` - A buffer for internal use. It must be at least 0x20000 bytes long.\n * `buffer_len` - Length of the passed buffer."] pub fn nimsInit(buffer: *mut ::libc::c_void, buffer_len: usize) -> Result; } extern "C" { #[must_use] - #[doc = "Initializes nim:s with the given TIN. This uses networking and is blocking.\n @param buffer A buffer for internal use. It must be at least 0x20000 bytes long.\n @param buffer_len Length of the passed buffer.\n @param TIN The TIN to initialize nim:s with. If you do not know what a TIN is or why you would want to change it, use [`nimsInit`] instead."] - #[doc = ""] + #[doc = " Initializes nim:s with the given TIN. This uses networking and is blocking.\n # Arguments\n\n* `buffer` - A buffer for internal use. It must be at least 0x20000 bytes long.\n * `buffer_len` - Length of the passed buffer.\n * `TIN` - The TIN to initialize nim:s with. If you do not know what a TIN is or why you would want to change it, use nimsInit instead."] pub fn nimsInitWithTIN( buffer: *mut ::libc::c_void, buffer_len: usize, @@ -16117,30 +13123,25 @@ extern "C" { ) -> Result; } extern "C" { - #[doc = "Exits nim:s."] - #[doc = ""] + #[doc = " Exits nim:s."] pub fn nimsExit(); } extern "C" { - #[doc = "Gets the current nim:s session handle."] - #[doc = ""] + #[doc = " Gets the current nim:s session handle."] pub fn nimsGetSessionHandle() -> *mut Handle; } extern "C" { #[must_use] - #[doc = "Sets an attribute.\n @param attr Name of the attribute.\n @param val Value of the attribute."] - #[doc = ""] + #[doc = " Sets an attribute.\n # Arguments\n\n* `attr` - Name of the attribute.\n * `val` - Value of the attribute."] pub fn NIMS_SetAttribute(attr: *const ::libc::c_char, val: *const ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = "Checks if nim wants a system update.\n @param want_update Set to true if a system update is required. Can be NULL."] - #[doc = ""] + #[doc = " Checks if nim wants a system update.\n # Arguments\n\n* `want_update` - Set to true if a system update is required. Can be NULL."] pub fn NIMS_WantUpdate(want_update: *mut bool) -> Result; } extern "C" { - #[doc = "Makes a TitleConfig struct for use with [`NIMS_RegisterTask`] [`NIMS_StartDownload`] or [`NIMS_StartDownloadSimple.\n`] @param cfg Struct to initialize.\n @param titleId Title ID to download and install.\n @param version Version of the title to download and install.\n @param ratingAge Age for which the title is aged; used by parental controls in HOME Menu.\n @param mediaType Media type of the title to download and install."] - #[doc = ""] + #[doc = " Makes a TitleConfig struct for use with NIMS_RegisterTask, NIMS_StartDownload or NIMS_StartDownloadSimple.\n # Arguments\n\n* `cfg` - Struct to initialize.\n * `titleId` - Title ID to download and install.\n * `version` - Version of the title to download and install.\n * `ratingAge` - Age for which the title is aged; used by parental controls in HOME Menu.\n * `mediaType` - Media type of the title to download and install."] pub fn NIMS_MakeTitleConfig( cfg: *mut NIM_TitleConfig, titleId: u64_, @@ -16151,8 +13152,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Registers a background download task with NIM. These are processed in sleep mode only.\n @param cfg Title config to use. See [`NIMS_MakeTitleConfig.\n`] @param name Name of the title in UTF-8. Will be displayed on the HOME Menu. Maximum 73 characters.\n @param maker Name of the maker/publisher in UTF-8. Will be displayed on the HOME Menu. Maximum 37 characters."] - #[doc = ""] + #[doc = " Registers a background download task with NIM. These are processed in sleep mode only.\n # Arguments\n\n* `cfg` - Title config to use. See NIMS_MakeTitleConfig.\n * `name` - Name of the title in UTF-8. Will be displayed on the HOME Menu. Maximum 73 characters.\n * `maker` - Name of the maker/publisher in UTF-8. Will be displayed on the HOME Menu. Maximum 37 characters."] pub fn NIMS_RegisterTask( cfg: *const NIM_TitleConfig, name: *const ::libc::c_char, @@ -16161,38 +13161,32 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Checks whether a background download task for the given title is registered with NIM.\n @param titleId Title ID to check for.\n @param registered Whether there is a background download task registered."] - #[doc = ""] + #[doc = " Checks whether a background download task for the given title is registered with NIM.\n # Arguments\n\n* `titleId` - Title ID to check for.\n * `registered` - Whether there is a background download task registered."] pub fn NIMS_IsTaskRegistered(titleId: u64_, registered: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Unregisters a background download task.\n @param titleId Title ID whose background download task to cancel."] - #[doc = ""] + #[doc = " Unregisters a background download task.\n # Arguments\n\n* `titleId` - Title ID whose background download task to cancel."] pub fn NIMS_UnregisterTask(titleId: u64_) -> Result; } extern "C" { #[must_use] - #[doc = "Starts an active download with NIM. Progress can be checked with [`NIMS_GetProcess`] Do not exit the process while a download is in progress without calling [`NIMS_CancelDownload.\n`] @param cfg Title config to use. See [`NIMS_MakeTitleConfig.\n`] @param mode The installation mode to use. See [`NIM_InstallationMode`]"] - #[doc = ""] + #[doc = " Starts an active download with NIM. Progress can be checked with NIMS_GetProcess. Do not exit the process while a download is in progress without calling NIMS_CancelDownload.\n # Arguments\n\n* `cfg` - Title config to use. See NIMS_MakeTitleConfig.\n * `mode` - The installation mode to use. See NIM_InstallationMode."] pub fn NIMS_StartDownload(cfg: *const NIM_TitleConfig, mode: NIM_InstallationMode) -> Result; } extern "C" { #[must_use] - #[doc = "Starts an active download with NIM with default installation mode; cannot reinstall titles. Progress can be checked with [`NIMS_GetProcess`] Do not exit the process while a download is in progress without calling [`NIMS_CancelDownload.\n`] @param cfg Title config to use. See [`NIMS_MakeTitleConfig`]"] - #[doc = ""] + #[doc = " Starts an active download with NIM with default installation mode; cannot reinstall titles. Progress can be checked with NIMS_GetProcess. Do not exit the process while a download is in progress without calling NIMS_CancelDownload.\n # Arguments\n\n* `cfg` - Title config to use. See NIMS_MakeTitleConfig."] pub fn NIMS_StartDownloadSimple(cfg: *const NIM_TitleConfig) -> Result; } extern "C" { #[must_use] - #[doc = "Checks the status of the current active download.\n @param tp Title progress struct to write to. See [`NIM_TitleProgress`]"] - #[doc = ""] + #[doc = " Checks the status of the current active download.\n # Arguments\n\n* `tp` - Title progress struct to write to. See NIM_TitleProgress."] pub fn NIMS_GetProgress(tp: *mut NIM_TitleProgress) -> Result; } extern "C" { #[must_use] - #[doc = "Cancels the current active download with NIM."] - #[doc = ""] + #[doc = " Cancels the current active download with NIM."] pub fn NIMS_CancelDownload() -> Result; } extern "C" { @@ -16204,36 +13198,30 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Turns wireless on or off.\n @param enableWifi True enables it, false disables it."] - #[doc = ""] + #[doc = " Turns wireless on or off.\n # Arguments\n\n* `enableWifi` - True enables it, false disables it."] pub fn NWMEXT_ControlWirelessEnabled(enableWifi: bool) -> Result; } extern "C" { #[must_use] - #[doc = "Initializes IRU.\n The permissions for the specified memory is set to RO. This memory must be already mapped.\n @param sharedmem_addr Address of the shared memory block to use.\n @param sharedmem_size Size of the shared memory block."] - #[doc = ""] + #[doc = " Initializes IRU.\n The permissions for the specified memory is set to RO. This memory must be already mapped.\n # Arguments\n\n* `sharedmem_addr` - Address of the shared memory block to use.\n * `sharedmem_size` - Size of the shared memory block."] pub fn iruInit(sharedmem_addr: *mut u32_, sharedmem_size: u32_) -> Result; } extern "C" { - #[doc = "Shuts down IRU."] - #[doc = ""] + #[doc = " Shuts down IRU."] pub fn iruExit(); } extern "C" { - #[doc = "Gets the IRU service handle.\n @return The IRU service handle."] - #[doc = ""] + #[doc = " Gets the IRU service handle.\n # Returns\n\nThe IRU service handle."] pub fn iruGetServHandle() -> Handle; } extern "C" { #[must_use] - #[doc = "Sends IR data.\n @param buf Buffer to send data from.\n @param size Size of the buffer.\n @param wait Whether to wait for the data to be sent."] - #[doc = ""] + #[doc = " Sends IR data.\n # Arguments\n\n* `buf` - Buffer to send data from.\n * `size` - Size of the buffer.\n * `wait` - Whether to wait for the data to be sent."] pub fn iruSendData(buf: *mut u8_, size: u32_, wait: bool) -> Result; } extern "C" { #[must_use] - #[doc = "Receives IR data.\n @param buf Buffer to receive data to.\n @param size Size of the buffer.\n @param flag Flags to receive data with.\n @param transfercount Pointer to output the number of bytes read to.\n @param wait Whether to wait for the data to be received."] - #[doc = ""] + #[doc = " Receives IR data.\n # Arguments\n\n* `buf` - Buffer to receive data to.\n * `size` - Size of the buffer.\n * `flag` - Flags to receive data with.\n * `transfercount` - Pointer to output the number of bytes read to.\n * `wait` - Whether to wait for the data to be received."] pub fn iruRecvData( buf: *mut u8_, size: u32_, @@ -16244,127 +13232,96 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Initializes the IR session."] - #[doc = ""] + #[doc = " Initializes the IR session."] pub fn IRU_Initialize() -> Result; } extern "C" { #[must_use] - #[doc = "Shuts down the IR session."] - #[doc = ""] + #[doc = " Shuts down the IR session."] pub fn IRU_Shutdown() -> Result; } extern "C" { #[must_use] - #[doc = "Begins sending data.\n @param buf Buffer to send.\n @param size Size of the buffer."] - #[doc = ""] + #[doc = " Begins sending data.\n # Arguments\n\n* `buf` - Buffer to send.\n * `size` - Size of the buffer."] pub fn IRU_StartSendTransfer(buf: *mut u8_, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Waits for a send operation to complete."] - #[doc = ""] + #[doc = " Waits for a send operation to complete."] pub fn IRU_WaitSendTransfer() -> Result; } extern "C" { #[must_use] - #[doc = "Begins receiving data.\n @param size Size of the data to receive.\n @param flag Flags to use when receiving."] - #[doc = ""] + #[doc = " Begins receiving data.\n # Arguments\n\n* `size` - Size of the data to receive.\n * `flag` - Flags to use when receiving."] pub fn IRU_StartRecvTransfer(size: u32_, flag: u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Waits for a receive operation to complete.\n @param transfercount Pointer to output the number of bytes read to."] - #[doc = ""] + #[doc = " Waits for a receive operation to complete.\n # Arguments\n\n* `transfercount` - Pointer to output the number of bytes read to."] pub fn IRU_WaitRecvTransfer(transfercount: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the IR bit rate.\n @param value Bit rate to set."] - #[doc = ""] + #[doc = " Sets the IR bit rate.\n # Arguments\n\n* `value` - Bit rate to set."] pub fn IRU_SetBitRate(value: u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the IR bit rate.\n @param out Pointer to write the bit rate to."] - #[doc = ""] + #[doc = " Gets the IR bit rate.\n # Arguments\n\n* `out` - Pointer to write the bit rate to."] pub fn IRU_GetBitRate(out: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the IR LED state.\n @param value IR LED state to set."] - #[doc = ""] + #[doc = " Sets the IR LED state.\n # Arguments\n\n* `value` - IR LED state to set."] pub fn IRU_SetIRLEDState(value: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the IR LED state.\n @param out Pointer to write the IR LED state to."] - #[doc = ""] + #[doc = " Gets the IR LED state.\n # Arguments\n\n* `out` - Pointer to write the IR LED state to."] pub fn IRU_GetIRLEDRecvState(out: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets an event which is signaled once a send finishes.\n @param out Pointer to write the event handle to."] - #[doc = ""] - pub fn IRU_GetSendFinishedEvent(out: *mut Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets an event which is signaled once a receive finishes.\n @param out Pointer to write the event handle to."] - #[doc = ""] - pub fn IRU_GetRecvFinishedEvent(out: *mut Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initializes NS."] - #[doc = ""] + #[doc = " Initializes NS."] pub fn nsInit() -> Result; } extern "C" { - #[doc = "Exits NS."] - #[doc = ""] + #[doc = " Exits NS."] pub fn nsExit(); } extern "C" { #[must_use] - #[doc = "Launches a title and the required firmware (only if necessary).\n @param titleid ID of the title to launch, 0 for gamecard, JPN System Settings' titleID for System Settings."] - #[doc = ""] + #[doc = " Launches a title and the required firmware (only if necessary).\n # Arguments\n\n* `titleid` - ID of the title to launch, 0 for gamecard, JPN System Settings' titleID for System Settings."] pub fn NS_LaunchFIRM(titleid: u64_) -> Result; } extern "C" { #[must_use] - #[doc = "Launches a title.\n @param titleid ID of the title to launch, or 0 for gamecard.\n @param launch_flags Flags used when launching the title.\n @param procid Pointer to write the process ID of the launched title to."] - #[doc = ""] + #[doc = " Launches a title.\n # Arguments\n\n* `titleid` - ID of the title to launch, or 0 for gamecard.\n * `launch_flags` - Flags used when launching the title.\n * `procid` - Pointer to write the process ID of the launched title to."] pub fn NS_LaunchTitle(titleid: u64_, launch_flags: u32_, procid: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Terminates the application from which this function is called"] - #[doc = ""] + #[doc = " Terminates the application from which this function is called"] pub fn NS_TerminateTitle() -> Result; } extern "C" { #[must_use] - #[doc = "Launches a title and the required firmware.\n @param titleid ID of the title to launch, 0 for gamecard.\n @param flags Flags for firm-launch. bit0: require an application title-info structure in FIRM paramters to be specified via FIRM parameters. bit1: if clear, NS will check certain Configuration Memory fields."] - #[doc = ""] + #[doc = " Launches a title and the required firmware.\n # Arguments\n\n* `titleid` - ID of the title to launch, 0 for gamecard.\n * `flags` - Flags for firm-launch. bit0: require an application title-info structure in FIRM paramters to be specified via FIRM parameters. bit1: if clear, NS will check certain Configuration Memory fields."] pub fn NS_LaunchApplicationFIRM(titleid: u64_, flags: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Reboots to a title.\n @param mediatype Mediatype of the title.\n @param titleid ID of the title to launch."] - #[doc = ""] + #[doc = " Reboots to a title.\n # Arguments\n\n* `mediatype` - Mediatype of the title.\n * `titleid` - ID of the title to launch."] pub fn NS_RebootToTitle(mediatype: u8_, titleid: u64_) -> Result; } extern "C" { #[must_use] - #[doc = "Terminates the process with the specified titleid.\n @param titleid ID of the title to terminate.\n @param timeout Timeout in nanoseconds. Pass 0 if not required."] - #[doc = ""] + #[doc = " Terminates the process with the specified titleid.\n # Arguments\n\n* `titleid` - ID of the title to terminate.\n * `timeout` - Timeout in nanoseconds. Pass 0 if not required."] pub fn NS_TerminateProcessTID(titleid: u64_, timeout: u64_) -> Result; } extern "C" { #[must_use] - #[doc = "Reboots the system"] - #[doc = ""] + #[doc = " Reboots the system"] pub fn NS_RebootSystem() -> Result; } pub const PMLAUNCHFLAG_NORMAL_APPLICATION: _bindgen_ty_26 = 1; @@ -16372,45 +13329,34 @@ pub const PMLAUNCHFLAG_LOAD_DEPENDENCIES: _bindgen_ty_26 = 2; pub const PMLAUNCHFLAG_NOTIFY_TERMINATION: _bindgen_ty_26 = 4; pub const PMLAUNCHFLAG_QUEUE_DEBUG_APPLICATION: _bindgen_ty_26 = 8; pub const PMLAUNCHFLAG_TERMINATION_NOTIFICATION_MASK: _bindgen_ty_26 = 240; -#[doc = "Forces the usage of the O3DS system mode app memory setting even if N3DS system mode is not \"Legacy\". Dev4 and Dev5 not supported. N3DS only."] -#[doc = ""] - +#[doc = "< Forces the usage of the O3DS system mode app memory setting even if N3DS system mode is not \"Legacy\". Dev4 and Dev5 not supported. N3DS only."] pub const PMLAUNCHFLAG_FORCE_USE_O3DS_APP_MEM: _bindgen_ty_26 = 256; -#[doc = "In conjunction with the above, forces the 96MB app memory setting. N3DS only."] -#[doc = ""] - +#[doc = "< In conjunction with the above, forces the 96MB app memory setting. N3DS only."] pub const PMLAUNCHFLAG_FORCE_USE_O3DS_MAX_APP_MEM: _bindgen_ty_26 = 512; pub const PMLAUNCHFLAG_USE_UPDATE_TITLE: _bindgen_ty_26 = 65536; -#[doc = "Launch flags for PM launch commands."] -#[doc = ""] - +#[doc = " Launch flags for PM launch commands."] pub type _bindgen_ty_26 = ::libc::c_uint; extern "C" { #[must_use] - #[doc = "Initializes pm:app."] - #[doc = ""] + #[doc = " Initializes pm:app."] pub fn pmAppInit() -> Result; } extern "C" { - #[doc = "Exits pm:app."] - #[doc = ""] + #[doc = " Exits pm:app."] pub fn pmAppExit(); } extern "C" { - #[doc = "Gets the current pm:app session handle.\n @return The current pm:app session handle."] - #[doc = ""] + #[doc = " Gets the current pm:app session handle.\n # Returns\n\nThe current pm:app session handle."] pub fn pmAppGetSessionHandle() -> *mut Handle; } extern "C" { #[must_use] - #[doc = "Launches a title.\n @param programInfo Program information of the title.\n @param launchFlags Flags to launch the title with."] - #[doc = ""] + #[doc = " Launches a title.\n # Arguments\n\n* `programInfo` - Program information of the title.\n * `launchFlags` - Flags to launch the title with."] pub fn PMAPP_LaunchTitle(programInfo: *const FS_ProgramInfo, launchFlags: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Launches a title, applying patches.\n @param programInfo Program information of the title.\n @param programInfoUpdate Program information of the update title.\n @param launchFlags Flags to launch the title with."] - #[doc = ""] + #[doc = " Launches a title, applying patches.\n # Arguments\n\n* `programInfo` - Program information of the title.\n * `programInfoUpdate` - Program information of the update title.\n * `launchFlags` - Flags to launch the title with."] pub fn PMAPP_LaunchTitleUpdate( programInfo: *const FS_ProgramInfo, programInfoUpdate: *const FS_ProgramInfo, @@ -16419,8 +13365,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets a title's ExHeader Arm11CoreInfo and SystemInfo flags.\n @param[out] outCoreInfo Pointer to write the ExHeader Arm11CoreInfo to.\n @param[out] outSiFlags Pointer to write the ExHeader SystemInfo flags to.\n @param programInfo Program information of the title."] - #[doc = ""] + #[doc = " Gets a title's ExHeader Arm11CoreInfo and SystemInfo flags.\n # Arguments\n\n* `outCoreInfo` (direction out) - Pointer to write the ExHeader Arm11CoreInfo to.\n * `outSiFlags` (direction out) - Pointer to write the ExHeader SystemInfo flags to.\n * `programInfo` - Program information of the title."] pub fn PMAPP_GetTitleExheaderFlags( outCoreInfo: *mut ExHeader_Arm11CoreInfo, outSiFlags: *mut ExHeader_SystemInfoFlags, @@ -16429,20 +13374,17 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Sets the current FIRM launch parameters.\n @param size Size of the FIRM launch parameter buffer.\n @param in Buffer to retrieve the launch parameters from."] - #[doc = ""] + #[doc = " Sets the current FIRM launch parameters.\n # Arguments\n\n* `size` - Size of the FIRM launch parameter buffer.\n * `in` - Buffer to retrieve the launch parameters from."] pub fn PMAPP_SetFIRMLaunchParams(size: u32_, in_: *const ::libc::c_void) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the current FIRM launch parameters.\n @param size Size of the FIRM launch parameter buffer.\n @param[out] out Buffer to write the launch parameters to."] - #[doc = ""] + #[doc = " Gets the current FIRM launch parameters.\n # Arguments\n\n* `size` - Size of the FIRM launch parameter buffer.\n * `out` (direction out) - Buffer to write the launch parameters to."] pub fn PMAPP_GetFIRMLaunchParams(out: *mut ::libc::c_void, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the current FIRM launch parameters.\n @param firmTidLow Low Title ID of the FIRM title to launch.\n @param size Size of the FIRM launch parameter buffer.\n @param in Buffer to retrieve the launch parameters from."] - #[doc = ""] + #[doc = " Sets the current FIRM launch parameters.\n # Arguments\n\n* `firmTidLow` - Low Title ID of the FIRM title to launch.\n * `size` - Size of the FIRM launch parameter buffer.\n * `in` - Buffer to retrieve the launch parameters from."] pub fn PMAPP_LaunchFIRMSetParams( firmTidLow: u32_, size: u32_, @@ -16451,66 +13393,55 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Terminate most processes, to prepare for a reboot or a shutdown.\n @param timeout Time limit in ns for process termination, after which the remaining processes are killed."] - #[doc = ""] + #[doc = " Terminate most processes, to prepare for a reboot or a shutdown.\n # Arguments\n\n* `timeout` - Time limit in ns for process termination, after which the remaining processes are killed."] pub fn PMAPP_PrepareForReboot(timeout: s64) -> Result; } extern "C" { #[must_use] - #[doc = "Terminates the current Application\n @param timeout Timeout in nanoseconds"] - #[doc = ""] + #[doc = " Terminates the current Application\n # Arguments\n\n* `timeout` - Timeout in nanoseconds"] pub fn PMAPP_TerminateCurrentApplication(timeout: s64) -> Result; } extern "C" { #[must_use] - #[doc = "Terminates the processes having the specified titleId.\n @param titleId Title ID of the processes to terminate\n @param timeout Timeout in nanoseconds"] - #[doc = ""] + #[doc = " Terminates the processes having the specified titleId.\n # Arguments\n\n* `titleId` - Title ID of the processes to terminate\n * `timeout` - Timeout in nanoseconds"] pub fn PMAPP_TerminateTitle(titleId: u64_, timeout: s64) -> Result; } extern "C" { #[must_use] - #[doc = "Terminates the specified process\n @param pid Process-ID of the process to terminate\n @param timeout Timeout in nanoseconds"] - #[doc = ""] + #[doc = " Terminates the specified process\n # Arguments\n\n* `pid` - Process-ID of the process to terminate\n * `timeout` - Timeout in nanoseconds"] pub fn PMAPP_TerminateProcess(pid: u32_, timeout: s64) -> Result; } extern "C" { #[must_use] - #[doc = "Unregisters a process\n @param tid TitleID of the process to unregister"] - #[doc = ""] + #[doc = " Unregisters a process\n # Arguments\n\n* `tid` - TitleID of the process to unregister"] pub fn PMAPP_UnregisterProcess(tid: u64_) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the APPLICATION cputime reslimit.\n @param cpuTime Reslimit value.\n @note cpuTime can be no higher than reslimitdesc[0] & 0x7F in exheader (or 80 if the latter is 0)."] - #[doc = ""] + #[doc = " Sets the APPLICATION cputime reslimit.\n # Arguments\n\n* `cpuTime` - Reslimit value.\n > **Note:** cpuTime can be no higher than reslimitdesc[0] & 0x7F in exheader (or 80 if the latter is 0)."] pub fn PMAPP_SetAppResourceLimit(cpuTime: s64) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the APPLICATION cputime reslimit.\n @param[out] cpuTime Pointer to write the reslimit value to."] - #[doc = ""] + #[doc = " Gets the APPLICATION cputime reslimit.\n # Arguments\n\n* `cpuTime` (direction out) - Pointer to write the reslimit value to."] pub fn PMAPP_GetAppResourceLimit(outCpuTime: *mut s64) -> Result; } extern "C" { #[must_use] - #[doc = "Initializes pm:dbg."] - #[doc = ""] + #[doc = " Initializes pm:dbg."] pub fn pmDbgInit() -> Result; } extern "C" { - #[doc = "Exits pm:dbg."] - #[doc = ""] + #[doc = " Exits pm:dbg."] pub fn pmDbgExit(); } extern "C" { - #[doc = "Gets the current pm:dbg session handle.\n @return The current pm:dbg session handle."] - #[doc = ""] + #[doc = " Gets the current pm:dbg session handle.\n # Returns\n\nThe current pm:dbg session handle."] pub fn pmDbgGetSessionHandle() -> *mut Handle; } extern "C" { #[must_use] - #[doc = "Enqueues an application for debug after setting cpuTime to 0, and returns a debug handle to it.\n If another process was enqueued, this just calls [`RunQueuedProcess`] instead.\n @param[out] Pointer to output the debug handle to.\n @param programInfo Program information of the title.\n @param launchFlags Flags to launch the title with."] - #[doc = ""] + #[doc = " Enqueues an application for debug after setting cpuTime to 0, and returns a debug handle to it.\n If another process was enqueued, this just calls RunQueuedProcess instead.\n # Arguments\n\n* `Pointer` (direction out) - to output the debug handle to.\n * `programInfo` - Program information of the title.\n * `launchFlags` - Flags to launch the title with."] pub fn PMDBG_LaunchAppDebug( outDebug: *mut Handle, programInfo: *const FS_ProgramInfo, @@ -16519,90 +13450,51 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Launches an application for debug after setting cpuTime to 0.\n @param programInfo Program information of the title.\n @param launchFlags Flags to launch the title with."] - #[doc = ""] + #[doc = " Launches an application for debug after setting cpuTime to 0.\n # Arguments\n\n* `programInfo` - Program information of the title.\n * `launchFlags` - Flags to launch the title with."] pub fn PMDBG_LaunchApp(programInfo: *const FS_ProgramInfo, launchFlags: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Runs the queued process and returns a debug handle to it.\n @param[out] Pointer to output the debug handle to."] - #[doc = ""] + #[doc = " Runs the queued process and returns a debug handle to it.\n # Arguments\n\n* `Pointer` (direction out) - to output the debug handle to."] pub fn PMDBG_RunQueuedProcess(outDebug: *mut Handle) -> Result; } -#[doc = "CBC encryption."] -#[doc = ""] - +#[doc = "< CBC encryption."] pub const PS_ALGORITHM_CBC_ENC: PS_AESAlgorithm = 0; -#[doc = "CBC decryption."] -#[doc = ""] - +#[doc = "< CBC decryption."] pub const PS_ALGORITHM_CBC_DEC: PS_AESAlgorithm = 1; -#[doc = "CTR encryption."] -#[doc = ""] - +#[doc = "< CTR encryption."] pub const PS_ALGORITHM_CTR_ENC: PS_AESAlgorithm = 2; -#[doc = "CTR decryption(same as PS_ALGORITHM_CTR_ENC)."] -#[doc = ""] - +#[doc = "< CTR decryption(same as PS_ALGORITHM_CTR_ENC)."] pub const PS_ALGORITHM_CTR_DEC: PS_AESAlgorithm = 3; -#[doc = "CCM encryption."] -#[doc = ""] - +#[doc = "< CCM encryption."] pub const PS_ALGORITHM_CCM_ENC: PS_AESAlgorithm = 4; -#[doc = "CCM decryption."] -#[doc = ""] - +#[doc = "< CCM decryption."] pub const PS_ALGORITHM_CCM_DEC: PS_AESAlgorithm = 5; -#[doc = "PS AES algorithms."] -#[doc = ""] - +#[doc = " PS AES algorithms."] pub type PS_AESAlgorithm = ::libc::c_uint; -#[doc = "Key slot 0x0D."] -#[doc = ""] - +#[doc = "< Key slot 0x0D."] pub const PS_KEYSLOT_0D: PS_AESKeyType = 0; -#[doc = "Key slot 0x2D."] -#[doc = ""] - +#[doc = "< Key slot 0x2D."] pub const PS_KEYSLOT_2D: PS_AESKeyType = 1; -#[doc = "Key slot 0x31."] -#[doc = ""] - +#[doc = "< Key slot 0x31."] pub const PS_KEYSLOT_31: PS_AESKeyType = 2; -#[doc = "Key slot 0x38."] -#[doc = ""] - +#[doc = "< Key slot 0x38."] pub const PS_KEYSLOT_38: PS_AESKeyType = 3; -#[doc = "Key slot 0x32."] -#[doc = ""] - +#[doc = "< Key slot 0x32."] pub const PS_KEYSLOT_32: PS_AESKeyType = 4; -#[doc = "Key slot 0x39. (DLP)"] -#[doc = ""] - +#[doc = "< Key slot 0x39. (DLP)"] pub const PS_KEYSLOT_39_DLP: PS_AESKeyType = 5; -#[doc = "Key slot 0x2E."] -#[doc = ""] - +#[doc = "< Key slot 0x2E."] pub const PS_KEYSLOT_2E: PS_AESKeyType = 6; -#[doc = "Invalid key slot."] -#[doc = ""] - +#[doc = "< Invalid key slot."] pub const PS_KEYSLOT_INVALID: PS_AESKeyType = 7; -#[doc = "Key slot 0x36."] -#[doc = ""] - +#[doc = "< Key slot 0x36."] pub const PS_KEYSLOT_36: PS_AESKeyType = 8; -#[doc = "Key slot 0x39. (NFC)"] -#[doc = ""] - +#[doc = "< Key slot 0x39. (NFC)"] pub const PS_KEYSLOT_39_NFC: PS_AESKeyType = 9; -#[doc = "PS key slots."] -#[doc = ""] - +#[doc = " PS key slots."] pub type PS_AESKeyType = ::libc::c_uint; -#[doc = "RSA context."] -#[doc = ""] +#[doc = " RSA context."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct psRSAContext { @@ -16622,36 +13514,30 @@ impl Default for psRSAContext { } extern "C" { #[must_use] - #[doc = "Initializes PS."] - #[doc = ""] + #[doc = " Initializes PS."] pub fn psInit() -> Result; } extern "C" { #[must_use] - #[doc = "Initializes PS with the specified session handle.\n @param handle Session handle."] - #[doc = ""] + #[doc = " Initializes PS with the specified session handle.\n # Arguments\n\n* `handle` - Session handle."] pub fn psInitHandle(handle: Handle) -> Result; } extern "C" { - #[doc = "Exits PS."] - #[doc = ""] + #[doc = " Exits PS."] pub fn psExit(); } extern "C" { - #[doc = "Returns the PS session handle."] - #[doc = ""] + #[doc = " Returns the PS session handle."] pub fn psGetSessionHandle() -> Handle; } extern "C" { #[must_use] - #[doc = "Signs a RSA signature.\n @param hash SHA256 hash to sign.\n @param ctx RSA context.\n @param signature RSA signature."] - #[doc = ""] + #[doc = " Signs a RSA signature.\n # Arguments\n\n* `hash` - SHA256 hash to sign.\n * `ctx` - RSA context.\n * `signature` - RSA signature."] pub fn PS_SignRsaSha256(hash: *mut u8_, ctx: *mut psRSAContext, signature: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Verifies a RSA signature.\n @param hash SHA256 hash to compare with.\n @param ctx RSA context.\n @param signature RSA signature."] - #[doc = ""] + #[doc = " Verifies a RSA signature.\n # Arguments\n\n* `hash` - SHA256 hash to compare with.\n * `ctx` - RSA context.\n * `signature` - RSA signature."] pub fn PS_VerifyRsaSha256( hash: *mut u8_, ctx: *mut psRSAContext, @@ -16660,8 +13546,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Encrypts/Decrypts AES data. Does not support AES CCM.\n @param size Size of the data.\n @param in Input buffer.\n @param out Output buffer.\n @param aes_algo AES algorithm to use.\n @param key_type Key type to use.\n @param iv Pointer to the CTR/IV. The output CTR/IV is also written here."] - #[doc = ""] + #[doc = " Encrypts/Decrypts AES data. Does not support AES CCM.\n # Arguments\n\n* `size` - Size of the data.\n * `in` - Input buffer.\n * `out` - Output buffer.\n * `aes_algo` - AES algorithm to use.\n * `key_type` - Key type to use.\n * `iv` - Pointer to the CTR/IV. The output CTR/IV is also written here."] pub fn PS_EncryptDecryptAes( size: u32_, in_: *mut u8_, @@ -16673,8 +13558,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Encrypts/Decrypts signed AES CCM data.\n When decrypting, if the MAC is invalid, 0xC9010401 is returned. After encrypting the MAC is located at inputbufptr.\n @param in Input buffer.\n @param in_size Size of the input buffer. Must include MAC size when decrypting.\n @param out Output buffer.\n @param out_size Size of the output buffer. Must include MAC size when encrypting.\n @param data_len Length of the data to be encrypted/decrypted.\n @param mac_data_len Length of the MAC data.\n @param mac_len Length of the MAC.\n @param aes_algo AES algorithm to use.\n @param key_type Key type to use.\n @param nonce Pointer to the nonce."] - #[doc = ""] + #[doc = " Encrypts/Decrypts signed AES CCM data.\n When decrypting, if the MAC is invalid, 0xC9010401 is returned. After encrypting the MAC is located at inputbufptr.\n # Arguments\n\n* `in` - Input buffer.\n * `in_size` - Size of the input buffer. Must include MAC size when decrypting.\n * `out` - Output buffer.\n * `out_size` - Size of the output buffer. Must include MAC size when encrypting.\n * `data_len` - Length of the data to be encrypted/decrypted.\n * `mac_data_len` - Length of the MAC data.\n * `mac_len` - Length of the MAC.\n * `aes_algo` - AES algorithm to use.\n * `key_type` - Key type to use.\n * `nonce` - Pointer to the nonce."] pub fn PS_EncryptSignDecryptVerifyAesCcm( in_: *mut u8_, in_size: u32_, @@ -16690,333 +13574,248 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets the 64-bit console friend code seed.\n @param seed Pointer to write the friend code seed to."] - #[doc = ""] + #[doc = " Gets the 64-bit console friend code seed.\n # Arguments\n\n* `seed` - Pointer to write the friend code seed to."] pub fn PS_GetLocalFriendCodeSeed(seed: *mut u64_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the 32-bit device ID.\n @param device_id Pointer to write the device ID to."] - #[doc = ""] + #[doc = " Gets the 32-bit device ID.\n # Arguments\n\n* `device_id` - Pointer to write the device ID to."] pub fn PS_GetDeviceId(device_id: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Generates cryptographically secure random bytes.\n @param out Pointer to the buffer to write the bytes to.\n @param len Number of bytes to write."] - #[doc = ""] + #[doc = " Generates cryptographically secure random bytes.\n # Arguments\n\n* `out` - Pointer to the buffer to write the bytes to.\n * `len` - Number of bytes to write."] pub fn PS_GenerateRandomBytes(out: *mut ::libc::c_void, len: usize) -> Result; } extern "C" { #[must_use] - #[doc = "Initializes PTMU."] - #[doc = ""] + #[doc = " Initializes PTMU."] pub fn ptmuInit() -> Result; } extern "C" { - #[doc = "Exits PTMU."] - #[doc = ""] + #[doc = " Exits PTMU."] pub fn ptmuExit(); } extern "C" { - #[doc = "Gets a pointer to the current ptm:u session handle.\n @return A pointer to the current ptm:u session handle."] - #[doc = ""] + #[doc = " Gets a pointer to the current ptm:u session handle.\n # Returns\n\nA pointer to the current ptm:u session handle."] pub fn ptmuGetSessionHandle() -> *mut Handle; } extern "C" { #[must_use] - #[doc = "Gets the system's current shell state.\n @param out Pointer to write the current shell state to. (0 = closed, 1 = open)"] - #[doc = ""] + #[doc = " Gets the system's current shell state.\n # Arguments\n\n* `out` - Pointer to write the current shell state to. (0 = closed, 1 = open)"] pub fn PTMU_GetShellState(out: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the system's current battery level.\n @param out Pointer to write the current battery level to. (0-5)"] - #[doc = ""] + #[doc = " Gets the system's current battery level.\n # Arguments\n\n* `out` - Pointer to write the current battery level to. (0-5)"] pub fn PTMU_GetBatteryLevel(out: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the system's current battery charge state.\n @param out Pointer to write the current battery charge state to. (0 = not charging, 1 = charging)"] - #[doc = ""] + #[doc = " Gets the system's current battery charge state.\n # Arguments\n\n* `out` - Pointer to write the current battery charge state to. (0 = not charging, 1 = charging)"] pub fn PTMU_GetBatteryChargeState(out: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the system's current pedometer state.\n @param out Pointer to write the current pedometer state to. (0 = not counting, 1 = counting)"] - #[doc = ""] + #[doc = " Gets the system's current pedometer state.\n # Arguments\n\n* `out` - Pointer to write the current pedometer state to. (0 = not counting, 1 = counting)"] pub fn PTMU_GetPedometerState(out: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the pedometer's total step count.\n @param steps Pointer to write the total step count to."] - #[doc = ""] + #[doc = " Gets the pedometer's total step count.\n # Arguments\n\n* `steps` - Pointer to write the total step count to."] pub fn PTMU_GetTotalStepCount(steps: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets whether the adapter is plugged in or not\n @param out Pointer to write the adapter state to."] - #[doc = ""] + #[doc = " Gets whether the adapter is plugged in or not\n # Arguments\n\n* `out` - Pointer to write the adapter state to."] pub fn PTMU_GetAdapterState(out: *mut bool) -> Result; } -#[doc = "PDN wake events and MCU interrupts to select, combined with those of other processes"] -#[doc = ""] +#[doc = " PDN wake events and MCU interrupts to select, combined with those of other processes"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct PtmWakeEvents { - #[doc = "Written to PDN_WAKE_EVENTS. Don't select bit26 (MCU), PTM will do it automatically."] - #[doc = ""] + #[doc = "< Written to PDN_WAKE_EVENTS. Don't select bit26 (MCU), PTM will do it automatically."] pub pdn_wake_events: u32_, - #[doc = "MCU interrupts to check when a MCU wake event happens."] - #[doc = ""] + #[doc = "< MCU interrupts to check when a MCU wake event happens."] pub mcu_interupt_mask: u32_, } #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct PtmSleepConfig { - #[doc = "Wake events for which the system should fully wake up."] - #[doc = ""] + #[doc = "< Wake events for which the system should fully wake up."] pub exit_sleep_events: PtmWakeEvents, - #[doc = "Wake events for which the system should return to sleep."] - #[doc = ""] + #[doc = "< Wake events for which the system should return to sleep."] pub continue_sleep_events: PtmWakeEvents, } -#[doc = "[`PTMSYSM_RequestSleep`] has been called (ack = 3)"] -#[doc = ""] - +#[doc = "< PTMSYSM_RequestSleep has been called (ack = 3)"] pub const PTMNOTIFID_SLEEP_REQUESTED: _bindgen_ty_27 = 257; -#[doc = "The sleep request has been denied by [`PTMSYSM_ReplyToSleepQuery(true)`] (no ack required)."] -#[doc = ""] - +#[doc = "< The sleep request has been denied by PTMSYSM_ReplyToSleepQuery(true) (no ack required)."] pub const PTMNOTIFID_SLEEP_DENIED: _bindgen_ty_27 = 258; -#[doc = "The sleep request has been allowed by [`PTMSYSM_ReplyToSleepQuery(false)`] (ack = 1)."] -#[doc = ""] - +#[doc = "< The sleep request has been allowed by PTMSYSM_ReplyToSleepQuery(false) (ack = 1)."] pub const PTMNOTIFID_SLEEP_ALLOWED: _bindgen_ty_27 = 259; -#[doc = "All processes not having \"RunnableOnSleep\" have been paused & the system is about to go to sleep (ack = 0)."] -#[doc = ""] - +#[doc = "< All processes not having \"RunnableOnSleep\" have been paused & the system is about to go to sleep (ack = 0)."] pub const PTMNOTIFID_GOING_TO_SLEEP: _bindgen_ty_27 = 260; -#[doc = "The system has been woken up, and the paused processes are about to be unpaused (ack = 1)."] -#[doc = ""] - +#[doc = "< The system has been woken up, and the paused processes are about to be unpaused (ack = 1)."] pub const PTMNOTIFID_FULLY_WAKING_UP: _bindgen_ty_27 = 261; -#[doc = "The system is fully awake (no ack required)."] -#[doc = ""] - +#[doc = "< The system is fully awake (no ack required)."] pub const PTMNOTIFID_FULLY_AWAKE: _bindgen_ty_27 = 262; -#[doc = "The system has been woken up but is about to go to sleep again (ack = 2)."] -#[doc = ""] - +#[doc = "< The system has been woken up but is about to go to sleep again (ack = 2)."] pub const PTMNOTIFID_HALF_AWAKE: _bindgen_ty_27 = 263; -#[doc = "The system is about to power off or reboot."] -#[doc = ""] - +#[doc = "< The system is about to power off or reboot."] pub const PTMNOTIFID_SHUTDOWN: _bindgen_ty_27 = 264; -#[doc = "The battery level has reached 5% or below."] -#[doc = ""] - +#[doc = "< The battery level has reached 5% or below."] pub const PTMNOTIFID_BATTERY_VERY_LOW: _bindgen_ty_27 = 529; -#[doc = "The battery level has reached 10% or below."] -#[doc = ""] - +#[doc = "< The battery level has reached 10% or below."] pub const PTMNOTIFID_BATTERY_LOW: _bindgen_ty_27 = 530; pub type _bindgen_ty_27 = ::libc::c_uint; extern "C" { #[must_use] - #[doc = "Initializes ptm:sysm."] - #[doc = ""] + #[doc = " Initializes ptm:sysm."] pub fn ptmSysmInit() -> Result; } extern "C" { - #[doc = "Exits ptm:sysm."] - #[doc = ""] + #[doc = " Exits ptm:sysm."] pub fn ptmSysmExit(); } extern "C" { - #[doc = "Gets a pointer to the current ptm:sysm session handle.\n @return A pointer to the current ptm:sysm session handle."] - #[doc = ""] + #[doc = " Gets a pointer to the current ptm:sysm session handle.\n # Returns\n\nA pointer to the current ptm:sysm session handle."] pub fn ptmSysmGetSessionHandle() -> *mut Handle; } extern "C" { #[must_use] - #[doc = "Requests to enter sleep mode."] - #[doc = ""] + #[doc = " Requests to enter sleep mode."] pub fn PTMSYSM_RequestSleep() -> Result; } extern "C" { #[must_use] - #[doc = "Accepts or denies the incoming sleep mode request.\n @param deny Whether or not to deny the sleep request.\n @note If deny = false, this is equivalent to calling [`PTMSYSM_NotifySleepPreparationComplete(3)`]"] - #[doc = ""] + #[doc = " Accepts or denies the incoming sleep mode request.\n # Arguments\n\n* `deny` - Whether or not to deny the sleep request.\n > **Note:** If deny = false, this is equivalent to calling PTMSYSM_NotifySleepPreparationComplete(3)"] pub fn PTMSYSM_ReplyToSleepQuery(deny: bool) -> Result; } extern "C" { #[must_use] - #[doc = "Acknowledges the current sleep notification and advance the internal sleep mode FSM. All subscribers must reply.\n @param ackValue Use [`ptmSysmGetNotificationAckValue\n`] @note [`PTMNOTIFID_SLEEP_DENIED`] and [`PTMNOTIFID_FULLY_AWAKE`] don't require this."] - #[doc = ""] + #[doc = " Acknowledges the current sleep notification and advance the internal sleep mode FSM. All subscribers must reply.\n # Arguments\n\n* `ackValue` - Use ptmSysmGetNotificationAckValue\n > **Note:** PTMNOTIFID_SLEEP_DENIED and PTMNOTIFID_FULLY_AWAKE don't require this."] pub fn PTMSYSM_NotifySleepPreparationComplete(ackValue: s32) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the wake events (two sets: when to fully wake up and when to return to sleep).\n @param sleepConfig Pointer to the two sets of wake events.\n @note Can only be called just before acknowledging [`PTMNOTIFID_GOING_TO_SLEEP`] or [`PTMNOTIFID_HALF_AWAKE`]"] - #[doc = ""] + #[doc = " Sets the wake events (two sets: when to fully wake up and when to return to sleep).\n # Arguments\n\n* `sleepConfig` - Pointer to the two sets of wake events.\n > **Note:** Can only be called just before acknowledging PTMNOTIFID_GOING_TO_SLEEP or PTMNOTIFID_HALF_AWAKE."] pub fn PTMSYSM_SetWakeEvents(sleepConfig: *const PtmSleepConfig) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the wake reason (only the first applicable wake event is taken into account).\n @param sleepConfig Pointer to the two sets of wake events. Only the relevant set will be filled."] - #[doc = ""] + #[doc = " Gets the wake reason (only the first applicable wake event is taken into account).\n # Arguments\n\n* `sleepConfig` - Pointer to the two sets of wake events. Only the relevant set will be filled."] pub fn PTMSYSM_GetWakeReason(outSleepConfig: *mut PtmSleepConfig) -> Result; } extern "C" { #[must_use] - #[doc = "Cancels the \"half-awake\" state and fully wakes up the 3DS after some delay."] - #[doc = ""] + #[doc = " Cancels the \"half-awake\" state and fully wakes up the 3DS after some delay."] pub fn PTMSYSM_Awaken() -> Result; } extern "C" { #[must_use] - #[doc = "Sets the user time by updating the user time offset.\n @param msY2k The number of milliseconds since 01/01/2000."] - #[doc = ""] + #[doc = " Sets the user time by updating the user time offset.\n # Arguments\n\n* `msY2k` - The number of milliseconds since 01/01/2000."] pub fn PTMSYSM_SetUserTime(msY2k: s64) -> Result; } extern "C" { #[must_use] - #[doc = "Invalidates the \"system time\" (cfg block 0x30002)"] - #[doc = ""] + #[doc = " Invalidates the \"system time\" (cfg block 0x30002)"] pub fn PTMSYSM_InvalidateSystemTime() -> Result; } extern "C" { #[must_use] - #[doc = "Reads the time and date coming from the RTC and converts the result.\n @param[out] outMsY2k The pointer to write the number of milliseconds since 01/01/2000 to."] - #[doc = ""] + #[doc = " Reads the time and date coming from the RTC and converts the result.\n # Arguments\n\n* `outMsY2k` (direction out) - The pointer to write the number of milliseconds since 01/01/2000 to."] pub fn PTMSYSM_GetRtcTime(outMsY2k: *mut s64) -> Result; } extern "C" { #[must_use] - #[doc = "Writes the time and date coming to the RTC, after conversion.\n @param msY2k The number of milliseconds since 01/01/2000."] - #[doc = ""] + #[doc = " Writes the time and date coming to the RTC, after conversion.\n # Arguments\n\n* `msY2k` - The number of milliseconds since 01/01/2000."] pub fn PTMSYSM_SetRtcTime(msY2k: s64) -> Result; } extern "C" { #[must_use] - #[doc = "Returns 1 if it's a New 3DS, otherwise 0."] - #[doc = ""] + #[doc = " Returns 1 if it's a New 3DS, otherwise 0."] pub fn PTMSYSM_CheckNew3DS() -> Result; } extern "C" { #[must_use] - #[doc = "Configures the New 3DS' CPU clock speed and L2 cache.\n @param value Bit0: enable higher clock, Bit1: enable L2 cache."] - #[doc = ""] + #[doc = " Configures the New 3DS' CPU clock speed and L2 cache.\n # Arguments\n\n* `value` - Bit0: enable higher clock, Bit1: enable L2 cache."] pub fn PTMSYSM_ConfigureNew3DSCPU(value: u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Trigger a hardware system shutdown via the MCU.\n @param timeout: timeout passed to PMApp:ShutdownAsync (PrepareForReboot)."] - #[doc = ""] + #[doc = " Trigger a hardware system shutdown via the MCU.\n # Arguments\n\n* `timeout:` - timeout passed to PMApp:ShutdownAsync (PrepareForReboot)."] pub fn PTMSYSM_ShutdownAsync(timeout: u64_) -> Result; } extern "C" { #[must_use] - #[doc = "Trigger a hardware system reboot via the MCU.\n @param timeout: timeout passed to PMApp:ShutdownAsync (PrepareForReboot)."] - #[doc = ""] + #[doc = " Trigger a hardware system reboot via the MCU.\n # Arguments\n\n* `timeout:` - timeout passed to PMApp:ShutdownAsync (PrepareForReboot)."] pub fn PTMSYSM_RebootAsync(timeout: u64_) -> Result; } extern "C" { #[must_use] - #[doc = "Initializes PTMGETS."] - #[doc = ""] + #[doc = " Initializes PTMGETS."] pub fn ptmGetsInit() -> Result; } extern "C" { - #[doc = "Exits PTMGETS."] - #[doc = ""] + #[doc = " Exits PTMGETS."] pub fn ptmGetsExit(); } extern "C" { - #[doc = "Gets a pointer to the current ptm:gets session handle.\n @return A pointer to the current ptm:gets session handle."] - #[doc = ""] + #[doc = " Gets a pointer to the current ptm:gets session handle.\n # Returns\n\nA pointer to the current ptm:gets session handle."] pub fn ptmGetsGetSessionHandle() -> *mut Handle; } extern "C" { #[must_use] - #[doc = "Gets the system time.\n @param[out] outMsY2k The pointer to write the number of milliseconds since 01/01/2000 to."] - #[doc = ""] + #[doc = " Gets the system time.\n # Arguments\n\n* `outMsY2k` (direction out) - The pointer to write the number of milliseconds since 01/01/2000 to."] pub fn PTMGETS_GetSystemTime(outMsY2k: *mut s64) -> Result; } extern "C" { #[must_use] - #[doc = "Initializes PTMSETS."] - #[doc = ""] + #[doc = " Initializes PTMSETS."] pub fn ptmSetsInit() -> Result; } extern "C" { - #[doc = "Exits PTMSETS."] - #[doc = ""] + #[doc = " Exits PTMSETS."] pub fn ptmSetsExit(); } extern "C" { - #[doc = "Gets a pointer to the current ptm:sets session handle.\n @return A pointer to the current ptm:sets session handle."] - #[doc = ""] + #[doc = " Gets a pointer to the current ptm:sets session handle.\n # Returns\n\nA pointer to the current ptm:sets session handle."] pub fn ptmSetsGetSessionHandle() -> *mut Handle; } extern "C" { #[must_use] - #[doc = "Sets the system time.\n @param msY2k The number of milliseconds since 01/01/2000."] - #[doc = ""] + #[doc = " Sets the system time.\n # Arguments\n\n* `msY2k` - The number of milliseconds since 01/01/2000."] pub fn PTMSETS_SetSystemTime(msY2k: s64) -> Result; } -#[doc = "Do not wait."] -#[doc = ""] - +#[doc = "< Do not wait."] pub const WAIT_NONE: PXIDEV_WaitType = 0; -#[doc = "Sleep for the specified number of nanoseconds."] -#[doc = ""] - +#[doc = "< Sleep for the specified number of nanoseconds."] pub const WAIT_SLEEP: PXIDEV_WaitType = 1; -#[doc = "Wait for IREQ, return if timeout."] -#[doc = ""] - +#[doc = "< Wait for IREQ, return if timeout."] pub const WAIT_IREQ_RETURN: PXIDEV_WaitType = 2; -#[doc = "Wait for IREQ, continue if timeout."] -#[doc = ""] - +#[doc = "< Wait for IREQ, continue if timeout."] pub const WAIT_IREQ_CONTINUE: PXIDEV_WaitType = 3; -#[doc = "Card SPI wait operation type."] -#[doc = ""] - +#[doc = " Card SPI wait operation type."] pub type PXIDEV_WaitType = ::libc::c_uint; -#[doc = "Do not deassert."] -#[doc = ""] - +#[doc = "< Do not deassert."] pub const DEASSERT_NONE: PXIDEV_DeassertType = 0; -#[doc = "Deassert before waiting."] -#[doc = ""] - +#[doc = "< Deassert before waiting."] pub const DEASSERT_BEFORE_WAIT: PXIDEV_DeassertType = 1; -#[doc = "Deassert after waiting."] -#[doc = ""] - +#[doc = "< Deassert after waiting."] pub const DEASSERT_AFTER_WAIT: PXIDEV_DeassertType = 2; -#[doc = "Card SPI register deassertion type."] -#[doc = ""] - +#[doc = " Card SPI register deassertion type."] pub type PXIDEV_DeassertType = ::libc::c_uint; -#[doc = "Card SPI transfer buffer."] -#[doc = ""] +#[doc = " Card SPI transfer buffer."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct PXIDEV_SPIBuffer { - #[doc = "Data pointer."] - #[doc = ""] + #[doc = "< Data pointer."] pub ptr: *mut ::libc::c_void, - #[doc = "Data size."] - #[doc = ""] + #[doc = "< Data size."] pub size: u32_, - #[doc = "Transfer options. See [`pxiDevMakeTransferOption`]"] - #[doc = ""] + #[doc = "< Transfer options. See pxiDevMakeTransferOption"] pub transferOption: u8_, - #[doc = "Wait operation. See [`pxiDevMakeWaitOperation`]"] - #[doc = ""] + #[doc = "< Wait operation. See pxiDevMakeWaitOperation"] pub waitOperation: u64_, } impl Default for PXIDEV_SPIBuffer { @@ -17030,19 +13829,16 @@ impl Default for PXIDEV_SPIBuffer { } extern "C" { #[must_use] - #[doc = "Initializes pxi:dev."] - #[doc = ""] + #[doc = " Initializes pxi:dev."] pub fn pxiDevInit() -> Result; } extern "C" { - #[doc = "Shuts down pxi:dev."] - #[doc = ""] + #[doc = " Shuts down pxi:dev."] pub fn pxiDevExit(); } extern "C" { #[must_use] - #[doc = "Performs multiple card SPI writes and reads.\n @param header Header to lead the transfers with. Must be, at most, 8 bytes in size.\n @param writeBuffer1 Buffer to make first transfer from.\n @param readBuffer1 Buffer to receive first response to.\n @param writeBuffer2 Buffer to make second transfer from.\n @param readBuffer2 Buffer to receive second response to.\n @param footer Footer to follow the transfers with. Must be, at most, 8 bytes in size. Wait operation is unused."] - #[doc = ""] + #[doc = " Performs multiple card SPI writes and reads.\n # Arguments\n\n* `header` - Header to lead the transfers with. Must be, at most, 8 bytes in size.\n * `writeBuffer1` - Buffer to make first transfer from.\n * `readBuffer1` - Buffer to receive first response to.\n * `writeBuffer2` - Buffer to make second transfer from.\n * `readBuffer2` - Buffer to receive second response to.\n * `footer` - Footer to follow the transfers with. Must be, at most, 8 bytes in size. Wait operation is unused."] pub fn PXIDEV_SPIMultiWriteRead( header: *mut PXIDEV_SPIBuffer, writeBuffer1: *mut PXIDEV_SPIBuffer, @@ -17054,8 +13850,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Performs a single card SPI write and read.\n @param bytesRead Pointer to output the number of bytes received to.\n @param initialWaitOperation Wait operation to perform before transferring data.\n @param writeBuffer Buffer to transfer data from.\n @param readBuffer Buffer to receive data to."] - #[doc = ""] + #[doc = " Performs a single card SPI write and read.\n # Arguments\n\n* `bytesRead` - Pointer to output the number of bytes received to.\n * `initialWaitOperation` - Wait operation to perform before transferring data.\n * `writeBuffer` - Buffer to transfer data from.\n * `readBuffer` - Buffer to receive data to."] pub fn PXIDEV_SPIWriteRead( bytesRead: *mut u32_, initialWaitOperation: u64_, @@ -17065,30 +13860,25 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Initializes PxiPM."] - #[doc = ""] + #[doc = " Initializes PxiPM."] pub fn pxiPmInit() -> Result; } extern "C" { - #[doc = "Exits PxiPM."] - #[doc = ""] + #[doc = " Exits PxiPM."] pub fn pxiPmExit(); } extern "C" { - #[doc = "Gets the current PxiPM session handle.\n @return The current PxiPM session handle."] - #[doc = ""] + #[doc = " Gets the current PxiPM session handle.\n # Returns\n\nThe current PxiPM session handle."] pub fn pxiPmGetSessionHandle() -> *mut Handle; } extern "C" { #[must_use] - #[doc = "Retrives the exheader information set(s) (SCI+ACI) about a program.\n @param exheaderInfos[out] Pointer to the output exheader information set.\n @param programHandle The program handle."] - #[doc = ""] + #[doc = " Retrives the exheader information set(s) (SCI+ACI) about a program.\n # Arguments\n\n* `exheaderInfos[out]` - Pointer to the output exheader information set.\n * `programHandle` - The program handle."] pub fn PXIPM_GetProgramInfo(exheaderInfo: *mut ExHeader_Info, programHandle: u64_) -> Result; } extern "C" { #[must_use] - #[doc = "Loads a program and registers it to Process9.\n @param programHandle[out] Pointer to the output the program handle to.\n @param programInfo Information about the program to load.\n @param updateInfo Information about the program update to load."] - #[doc = ""] + #[doc = " Loads a program and registers it to Process9.\n # Arguments\n\n* `programHandle[out]` - Pointer to the output the program handle to.\n * `programInfo` - Information about the program to load.\n * `updateInfo` - Information about the program update to load."] pub fn PXIPM_RegisterProgram( programHandle: *mut u64_, programInfo: *const FS_ProgramInfo, @@ -17097,8 +13887,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Unloads a program and unregisters it from Process9.\n @param programHandle The program handle."] - #[doc = ""] + #[doc = " Unloads a program and unregisters it from Process9.\n # Arguments\n\n* `programHandle` - The program handle."] pub fn PXIPM_UnregisterProgram(programHandle: u64_) -> Result; } #[repr(C)] @@ -17858,159 +14647,109 @@ pub struct ip_mreq { pub imr_multiaddr: in_addr, pub imr_interface: in_addr, } -#[doc = "The mac address of the interface (u32 mac[6])"] -#[doc = ""] - +#[doc = "< The mac address of the interface (u32 mac[6])"] pub const NETOPT_MAC_ADDRESS: NetworkOpt = 4100; -#[doc = "The ARP table [`SOCU_ARPTableEntry`]"] -#[doc = ""] - +#[doc = "< The ARP table [`SOCU_ARPTableEntry`]"] pub const NETOPT_ARP_TABLE: NetworkOpt = 12290; -#[doc = "The current IP setup [`SOCU_IPInfo`]"] -#[doc = ""] - +#[doc = "< The current IP setup [`SOCU_IPInfo`]"] pub const NETOPT_IP_INFO: NetworkOpt = 16387; -#[doc = "The value of the IP MTU (u32)"] -#[doc = ""] - +#[doc = "< The value of the IP MTU (u32)"] pub const NETOPT_IP_MTU: NetworkOpt = 16388; -#[doc = "The routing table [`SOCU_RoutingTableEntry`]"] -#[doc = ""] - +#[doc = "< The routing table [`SOCU_RoutingTableEntry`]"] pub const NETOPT_ROUTING_TABLE: NetworkOpt = 16390; -#[doc = "The number of sockets in the UDP table (u32)"] -#[doc = ""] - +#[doc = "< The number of sockets in the UDP table (u32)"] pub const NETOPT_UDP_NUMBER: NetworkOpt = 32770; -#[doc = "The table of opened UDP sockets [`SOCU_UDPTableEntry`]"] -#[doc = ""] - +#[doc = "< The table of opened UDP sockets [`SOCU_UDPTableEntry`]"] pub const NETOPT_UDP_TABLE: NetworkOpt = 32771; -#[doc = "The number of sockets in the TCP table (u32)"] -#[doc = ""] - +#[doc = "< The number of sockets in the TCP table (u32)"] pub const NETOPT_TCP_NUMBER: NetworkOpt = 36866; -#[doc = "The table of opened TCP sockets [`SOCU_TCPTableEntry`]"] -#[doc = ""] - +#[doc = "< The table of opened TCP sockets [`SOCU_TCPTableEntry`]"] pub const NETOPT_TCP_TABLE: NetworkOpt = 36867; -#[doc = "The table of the DNS servers [`SOCU_DNSTableEntry`] -- Returns a buffer of size 336 but only 2 entries are set ?"] -#[doc = ""] - +#[doc = "< The table of the DNS servers [`SOCU_DNSTableEntry`] -- Returns a buffer of size 336 but only 2 entries are set ?"] pub const NETOPT_DNS_TABLE: NetworkOpt = 45059; -#[doc = "The DHCP lease time remaining, in seconds"] -#[doc = ""] - +#[doc = "< The DHCP lease time remaining, in seconds"] pub const NETOPT_DHCP_LEASE_TIME: NetworkOpt = 49153; -#[doc = "Options to be used with [`SOCU_GetNetworkOpt`]"] -#[doc = ""] - +#[doc = " Options to be used with SOCU_GetNetworkOpt"] pub type NetworkOpt = ::libc::c_uint; -#[doc = "One entry of the ARP table retrieved by using [`SOCU_GetNetworkOpt`] and [`NETOPT_ARP_TABLE`]"] -#[doc = ""] +#[doc = " One entry of the ARP table retrieved by using SOCU_GetNetworkOpt and NETOPT_ARP_TABLE"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct SOCU_ARPTableEntry { pub unk0: u32_, - #[doc = "The IPv4 address associated to the entry"] - #[doc = ""] + #[doc = "< The IPv4 address associated to the entry"] pub ip: in_addr, - #[doc = "The MAC address of associated to the entry"] - #[doc = ""] + #[doc = "< The MAC address of associated to the entry"] pub mac: [u8_; 6usize], pub padding: [u8_; 2usize], } -#[doc = "Structure returned by [`SOCU_GetNetworkOpt`] when using [`NETOPT_IP_INFO`]"] -#[doc = ""] +#[doc = " Structure returned by SOCU_GetNetworkOpt when using NETOPT_IP_INFO"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct SOCU_IPInfo { - #[doc = "Current IPv4 address"] - #[doc = ""] + #[doc = "< Current IPv4 address"] pub ip: in_addr, - #[doc = "Current network mask"] - #[doc = ""] + #[doc = "< Current network mask"] pub netmask: in_addr, - #[doc = "Current network broadcast address"] - #[doc = ""] + #[doc = "< Current network broadcast address"] pub broadcast: in_addr, } -#[doc = "One entry of the routing table retrieved by using [`SOCU_GetNetworkOpt`] and [`NETOPT_ROUTING_TABLE`]"] -#[doc = ""] +#[doc = " One entry of the routing table retrieved by using SOCU_GetNetworkOpt and NETOPT_ROUTING_TABLE"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct SOCU_RoutingTableEntry { - #[doc = "Destination IP address of the route"] - #[doc = ""] + #[doc = "< Destination IP address of the route"] pub dest_ip: in_addr, - #[doc = "Mask used for this route"] - #[doc = ""] + #[doc = "< Mask used for this route"] pub netmask: in_addr, - #[doc = "Gateway address to reach the network"] - #[doc = ""] + #[doc = "< Gateway address to reach the network"] pub gateway: in_addr, - #[doc = "Linux netstat flags [`ROUTING_FLAG_G`]"] - #[doc = ""] + #[doc = "< Linux netstat flags [`ROUTING_FLAG_G`]"] pub flags: u32_, - #[doc = "number of milliseconds since 1st Jan 1900 00:00."] - #[doc = ""] + #[doc = "< number of milliseconds since 1st Jan 1900 00:00."] pub time: u64_, } -#[doc = "One entry of the UDP sockets table retrieved by using [`SOCU_GetNetworkOpt`] and [`NETOPT_UDP_TABLE`]"] -#[doc = ""] +#[doc = " One entry of the UDP sockets table retrieved by using SOCU_GetNetworkOpt and NETOPT_UDP_TABLE"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct SOCU_UDPTableEntry { - #[doc = "Local address information"] - #[doc = ""] + #[doc = "< Local address information"] pub local: sockaddr_storage, - #[doc = "Remote address information"] - #[doc = ""] + #[doc = "< Remote address information"] pub remote: sockaddr_storage, } -#[doc = "One entry of the TCP sockets table retrieved by using [`SOCU_GetNetworkOpt`] and [`NETOPT_TCP_TABLE`]"] -#[doc = ""] +#[doc = " One entry of the TCP sockets table retrieved by using SOCU_GetNetworkOpt and NETOPT_TCP_TABLE"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct SOCU_TCPTableEntry { - #[doc = "[`TCP`] states defines"] - #[doc = ""] + #[doc = "< [`TCP`] states defines"] pub state: u32_, - #[doc = "Local address information"] - #[doc = ""] + #[doc = "< Local address information"] pub local: sockaddr_storage, - #[doc = "Remote address information"] - #[doc = ""] + #[doc = "< Remote address information"] pub remote: sockaddr_storage, } -#[doc = "One entry of the DNS servers table retrieved by using [`SOCU_GetNetworkOpt`] and [`NETOPT_DNS_TABLE`]"] -#[doc = ""] +#[doc = " One entry of the DNS servers table retrieved by using SOCU_GetNetworkOpt and NETOPT_DNS_TABLE"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct SOCU_DNSTableEntry { pub family: u32_, - #[doc = "Family of the address of the DNS server"] - #[doc = ""] + #[doc = " Family of the address of the DNS server"] pub ip: in_addr, - #[doc = "IP of the DNS server"] - #[doc = ""] + #[doc = " IP of the DNS server"] pub padding: [u8_; 12usize], } extern "C" { #[must_use] - #[doc = "Initializes the SOC service.\n @param context_addr Address of a page-aligned (0x1000) buffer to be used.\n @param context_size Size of the buffer, a multiple of 0x1000.\n @note The specified context buffer can no longer be accessed by the process which called this function, since the userland permissions for this block are set to no-access."] - #[doc = ""] + #[doc = " Initializes the SOC service.\n # Arguments\n\n* `context_addr` - Address of a page-aligned (0x1000) buffer to be used.\n * `context_size` - Size of the buffer, a multiple of 0x1000.\n > **Note:** The specified context buffer can no longer be accessed by the process which called this function, since the userland permissions for this block are set to no-access."] pub fn socInit(context_addr: *mut u32_, context_size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Closes the soc service.\n @note You need to call this in order to be able to use the buffer again."] - #[doc = ""] + #[doc = " Closes the soc service.\n > **Note:** You need to call this in order to be able to use the buffer again."] pub fn socExit() -> Result; } extern "C" { - #[doc = "Gets the system's host ID.\n @return The system's host ID."] - #[doc = ""] + #[doc = " Gets the system's host ID.\n # Returns\n\nThe system's host ID."] pub fn gethostid() -> ::libc::c_long; } extern "C" { @@ -18023,8 +14762,7 @@ extern "C" { pub fn SOCU_CloseSockets() -> ::libc::c_int; } extern "C" { - #[doc = "Retrieves information from the network configuration. Similar to getsockopt().\n @param level Only value allowed seems to be [`SOL_CONFIG\n`] @param optname The option to be retrieved\n @param optval Will contain the output of the command\n @param optlen Size of the optval buffer, will be updated to hold the size of the output\n @return 0 if successful. -1 if failed, and errno will be set accordingly. Can also return a system error code."] - #[doc = ""] + #[doc = " Retrieves information from the network configuration. Similar to getsockopt().\n # Arguments\n\n* `level` - Only value allowed seems to be SOL_CONFIG\n * `optname` - The option to be retrieved\n * `optval` - Will contain the output of the command\n * `optlen` - Size of the optval buffer, will be updated to hold the size of the output\n # Returns\n\n0 if successful. -1 if failed, and errno will be set accordingly. Can also return a system error code."] pub fn SOCU_GetNetworkOpt( level: ::libc::c_int, optname: NetworkOpt, @@ -18033,8 +14771,7 @@ extern "C" { ) -> ::libc::c_int; } extern "C" { - #[doc = "Gets the system's IP address, netmask, and subnet broadcast\n @return error"] - #[doc = ""] + #[doc = " Gets the system's IP address, netmask, and subnet broadcast\n # Returns\n\nerror"] pub fn SOCU_GetIPInfo( ip: *mut in_addr, netmask: *mut in_addr, @@ -18042,87 +14779,59 @@ extern "C" { ) -> ::libc::c_int; } extern "C" { - #[doc = "Adds a global socket.\n @param sockfd The socket fd.\n @return error"] - #[doc = ""] + #[doc = " Adds a global socket.\n # Arguments\n\n* `sockfd` - The socket fd.\n # Returns\n\nerror"] pub fn SOCU_AddGlobalSocket(sockfd: ::libc::c_int) -> ::libc::c_int; } -#[doc = "Unsigned 8-bit PCM."] -#[doc = ""] - +#[doc = "< Unsigned 8-bit PCM."] pub const MICU_ENCODING_PCM8: MICU_Encoding = 0; -#[doc = "Unsigned 16-bit PCM."] -#[doc = ""] - +#[doc = "< Unsigned 16-bit PCM."] pub const MICU_ENCODING_PCM16: MICU_Encoding = 1; -#[doc = "Signed 8-bit PCM."] -#[doc = ""] - +#[doc = "< Signed 8-bit PCM."] pub const MICU_ENCODING_PCM8_SIGNED: MICU_Encoding = 2; -#[doc = "Signed 16-bit PCM."] -#[doc = ""] - +#[doc = "< Signed 16-bit PCM."] pub const MICU_ENCODING_PCM16_SIGNED: MICU_Encoding = 3; -#[doc = "Microphone audio encodings."] -#[doc = ""] - +#[doc = " Microphone audio encodings."] pub type MICU_Encoding = ::libc::c_uint; -#[doc = "32728.498 Hz"] -#[doc = ""] - +#[doc = "< 32728.498 Hz"] pub const MICU_SAMPLE_RATE_32730: MICU_SampleRate = 0; -#[doc = "16364.479 Hz"] -#[doc = ""] - +#[doc = "< 16364.479 Hz"] pub const MICU_SAMPLE_RATE_16360: MICU_SampleRate = 1; -#[doc = "10909.499 Hz"] -#[doc = ""] - +#[doc = "< 10909.499 Hz"] pub const MICU_SAMPLE_RATE_10910: MICU_SampleRate = 2; -#[doc = "8182.1245 Hz"] -#[doc = ""] - +#[doc = "< 8182.1245 Hz"] pub const MICU_SAMPLE_RATE_8180: MICU_SampleRate = 3; -#[doc = "Microphone audio sampling rates."] -#[doc = ""] - +#[doc = " Microphone audio sampling rates."] pub type MICU_SampleRate = ::libc::c_uint; extern "C" { #[must_use] - #[doc = "Initializes MIC.\n @param size Shared memory buffer to write audio data to. Must be aligned to 0x1000 bytes.\n @param handle Size of the shared memory buffer."] - #[doc = ""] + #[doc = " Initializes MIC.\n # Arguments\n\n* `size` - Shared memory buffer to write audio data to. Must be aligned to 0x1000 bytes.\n * `handle` - Size of the shared memory buffer."] pub fn micInit(buffer: *mut u8_, bufferSize: u32_) -> Result; } extern "C" { - #[doc = "Exits MIC."] - #[doc = ""] + #[doc = " Exits MIC."] pub fn micExit(); } extern "C" { - #[doc = "Gets the size of the sample data area within the shared memory buffer.\n @return The sample data's size."] - #[doc = ""] + #[doc = " Gets the size of the sample data area within the shared memory buffer.\n # Returns\n\nThe sample data's size."] pub fn micGetSampleDataSize() -> u32_; } extern "C" { - #[doc = "Gets the offset within the shared memory buffer of the last sample written.\n @return The last sample's offset."] - #[doc = ""] + #[doc = " Gets the offset within the shared memory buffer of the last sample written.\n # Returns\n\nThe last sample's offset."] pub fn micGetLastSampleOffset() -> u32_; } extern "C" { #[must_use] - #[doc = "Maps MIC shared memory.\n @param size Size of the shared memory.\n @param handle Handle of the shared memory."] - #[doc = ""] + #[doc = " Maps MIC shared memory.\n # Arguments\n\n* `size` - Size of the shared memory.\n * `handle` - Handle of the shared memory."] pub fn MICU_MapSharedMem(size: u32_, handle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Unmaps MIC shared memory."] - #[doc = ""] + #[doc = " Unmaps MIC shared memory."] pub fn MICU_UnmapSharedMem() -> Result; } extern "C" { #[must_use] - #[doc = "Begins sampling microphone input.\n @param encoding Encoding of outputted audio.\n @param sampleRate Sample rate of outputted audio.\n @param sharedMemAudioOffset Offset to write audio data to in the shared memory buffer.\n @param sharedMemAudioSize Size of audio data to write to the shared memory buffer. This should be at most \"bufferSize - 4\".\n @param loop Whether to loop back to the beginning of the buffer when the end is reached."] - #[doc = ""] + #[doc = " Begins sampling microphone input.\n # Arguments\n\n* `encoding` - Encoding of outputted audio.\n * `sampleRate` - Sample rate of outputted audio.\n * `sharedMemAudioOffset` - Offset to write audio data to in the shared memory buffer.\n * `sharedMemAudioSize` - Size of audio data to write to the shared memory buffer. This should be at most \"bufferSize - 4\".\n * `loop` - Whether to loop back to the beginning of the buffer when the end is reached."] pub fn MICU_StartSampling( encoding: MICU_Encoding, sampleRate: MICU_SampleRate, @@ -18133,190 +14842,134 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Adjusts the configuration of the current sampling session.\n @param sampleRate Sample rate of outputted audio."] - #[doc = ""] + #[doc = " Adjusts the configuration of the current sampling session.\n # Arguments\n\n* `sampleRate` - Sample rate of outputted audio."] pub fn MICU_AdjustSampling(sampleRate: MICU_SampleRate) -> Result; } extern "C" { #[must_use] - #[doc = "Stops sampling microphone input."] - #[doc = ""] + #[doc = " Stops sampling microphone input."] pub fn MICU_StopSampling() -> Result; } extern "C" { #[must_use] - #[doc = "Gets whether microphone input is currently being sampled.\n @param sampling Pointer to output the sampling state to."] - #[doc = ""] + #[doc = " Gets whether microphone input is currently being sampled.\n # Arguments\n\n* `sampling` - Pointer to output the sampling state to."] pub fn MICU_IsSampling(sampling: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Gets an event handle triggered when the shared memory buffer is full.\n @param handle Pointer to output the event handle to."] - #[doc = ""] + #[doc = " Gets an event handle triggered when the shared memory buffer is full.\n # Arguments\n\n* `handle` - Pointer to output the event handle to."] pub fn MICU_GetEventHandle(handle: *mut Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the microphone's gain.\n @param gain Gain to set."] - #[doc = ""] + #[doc = " Sets the microphone's gain.\n # Arguments\n\n* `gain` - Gain to set."] pub fn MICU_SetGain(gain: u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the microphone's gain.\n @param gain Pointer to output the current gain to."] - #[doc = ""] + #[doc = " Gets the microphone's gain.\n # Arguments\n\n* `gain` - Pointer to output the current gain to."] pub fn MICU_GetGain(gain: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Sets whether the microphone is powered on.\n @param power Whether the microphone is powered on."] - #[doc = ""] + #[doc = " Sets whether the microphone is powered on.\n # Arguments\n\n* `power` - Whether the microphone is powered on."] pub fn MICU_SetPower(power: bool) -> Result; } extern "C" { #[must_use] - #[doc = "Gets whether the microphone is powered on.\n @param power Pointer to output the power state to."] - #[doc = ""] + #[doc = " Gets whether the microphone is powered on.\n # Arguments\n\n* `power` - Pointer to output the power state to."] pub fn MICU_GetPower(power: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Sets whether to clamp microphone input.\n @param clamp Whether to clamp microphone input."] - #[doc = ""] + #[doc = " Sets whether to clamp microphone input.\n # Arguments\n\n* `clamp` - Whether to clamp microphone input."] pub fn MICU_SetClamp(clamp: bool) -> Result; } extern "C" { #[must_use] - #[doc = "Gets whether to clamp microphone input.\n @param clamp Pointer to output the clamp state to."] - #[doc = ""] + #[doc = " Gets whether to clamp microphone input.\n # Arguments\n\n* `clamp` - Pointer to output the clamp state to."] pub fn MICU_GetClamp(clamp: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = "Sets whether to allow sampling when the shell is closed.\n @param allowShellClosed Whether to allow sampling when the shell is closed."] - #[doc = ""] + #[doc = " Sets whether to allow sampling when the shell is closed.\n # Arguments\n\n* `allowShellClosed` - Whether to allow sampling when the shell is closed."] pub fn MICU_SetAllowShellClosed(allowShellClosed: bool) -> Result; } -#[doc = "Converting color formats."] -#[doc = ""] - +#[doc = "< Converting color formats."] pub const MVDMODE_COLORFORMATCONV: MVDSTD_Mode = 0; -#[doc = "Processing video."] -#[doc = ""] - +#[doc = "< Processing video."] pub const MVDMODE_VIDEOPROCESSING: MVDSTD_Mode = 1; -#[doc = "Processing mode."] -#[doc = ""] - +#[doc = " Processing mode."] pub type MVDSTD_Mode = ::libc::c_uint; -#[doc = "YUYV422"] -#[doc = ""] - +#[doc = "< YUYV422"] pub const MVD_INPUT_YUYV422: MVDSTD_InputFormat = 65537; -#[doc = "H264"] -#[doc = ""] - +#[doc = "< H264"] pub const MVD_INPUT_H264: MVDSTD_InputFormat = 131073; -#[doc = "Input format."] -#[doc = ""] - +#[doc = " Input format."] pub type MVDSTD_InputFormat = ::libc::c_uint; -#[doc = "YUYV422"] -#[doc = ""] - +#[doc = "< YUYV422"] pub const MVD_OUTPUT_YUYV422: MVDSTD_OutputFormat = 65537; -#[doc = "BGR565"] -#[doc = ""] - +#[doc = "< BGR565"] pub const MVD_OUTPUT_BGR565: MVDSTD_OutputFormat = 262146; -#[doc = "RGB565"] -#[doc = ""] - +#[doc = "< RGB565"] pub const MVD_OUTPUT_RGB565: MVDSTD_OutputFormat = 262148; -#[doc = "Output format."] -#[doc = ""] - +#[doc = " Output format."] pub type MVDSTD_OutputFormat = ::libc::c_uint; -#[doc = "Processing configuration."] -#[doc = ""] +#[doc = " Processing configuration."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct MVDSTD_Config { - #[doc = "Input type."] - #[doc = ""] + #[doc = "< Input type."] pub input_type: MVDSTD_InputFormat, - #[doc = "Unknown."] - #[doc = ""] + #[doc = "< Unknown."] pub unk_x04: u32_, - #[doc = "Unknown. Referred to as \"H264 range\" in SKATER."] - #[doc = ""] + #[doc = "< Unknown. Referred to as \"H264 range\" in SKATER."] pub unk_x08: u32_, - #[doc = "Input width."] - #[doc = ""] + #[doc = "< Input width."] pub inwidth: u32_, - #[doc = "Input height."] - #[doc = ""] + #[doc = "< Input height."] pub inheight: u32_, - #[doc = "Physical address of color conversion input data."] - #[doc = ""] + #[doc = "< Physical address of color conversion input data."] pub physaddr_colorconv_indata: u32_, - #[doc = "Physical address used with color conversion."] - #[doc = ""] + #[doc = "< Physical address used with color conversion."] pub physaddr_colorconv_unk0: u32_, - #[doc = "Physical address used with color conversion."] - #[doc = ""] + #[doc = "< Physical address used with color conversion."] pub physaddr_colorconv_unk1: u32_, - #[doc = "Physical address used with color conversion."] - #[doc = ""] + #[doc = "< Physical address used with color conversion."] pub physaddr_colorconv_unk2: u32_, - #[doc = "Physical address used with color conversion."] - #[doc = ""] + #[doc = "< Physical address used with color conversion."] pub physaddr_colorconv_unk3: u32_, - #[doc = "Unknown."] - #[doc = ""] + #[doc = "< Unknown."] pub unk_x28: [u32_; 6usize], - #[doc = "Enables cropping with the input image when non-zero via the following 4 words."] - #[doc = ""] + #[doc = "< Enables cropping with the input image when non-zero via the following 4 words."] 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_, - #[doc = "Unknown."] - #[doc = ""] + #[doc = "< Unknown."] pub unk_x54: u32_, - #[doc = "Output type."] - #[doc = ""] + #[doc = "< Output type."] pub output_type: MVDSTD_OutputFormat, - #[doc = "Output width."] - #[doc = ""] + #[doc = "< Output width."] pub outwidth: u32_, - #[doc = "Output height."] - #[doc = ""] + #[doc = "< Output height."] pub outheight: u32_, - #[doc = "Physical address of output data."] - #[doc = ""] + #[doc = "< Physical address of output data."] pub physaddr_outdata0: u32_, - #[doc = "Additional physical address for output data, only used when the output format type is value 0x00020001."] - #[doc = ""] + #[doc = "< Additional physical address for output data, only used when the output format type is value 0x00020001."] pub physaddr_outdata1: u32_, - #[doc = "Unknown."] - #[doc = ""] + #[doc = "< Unknown."] pub unk_x6c: [u32_; 38usize], - #[doc = "This enables using the following 4 words when non-zero."] - #[doc = ""] + #[doc = "< This enables using the following 4 words when non-zero."] pub flag_x104: u32_, - #[doc = "Output X position in the output buffer."] - #[doc = ""] + #[doc = "< Output X position in the output buffer."] pub output_x_pos: u32_, - #[doc = "Same as above except for the Y pos."] - #[doc = ""] + #[doc = "< Same as above except for the Y pos."] pub output_y_pos: u32_, - #[doc = "Used for aligning the output width when larger than the output width. Overrides the output width when smaller than the output width."] - #[doc = ""] + #[doc = "< Used for aligning the output width when larger than the output width. Overrides the output width when smaller than the output width."] pub output_width_override: u32_, - #[doc = "Same as output_width_override except for the output height."] - #[doc = ""] + #[doc = "< Same as output_width_override except for the output height."] pub output_height_override: u32_, pub unk_x118: u32_, } @@ -18366,8 +15019,7 @@ impl Default for MVDSTD_OutputBuffersEntryList { } } } -#[doc = "This can be used to override the default input values for MVDSTD commands during initialization with video-processing. The default for these fields are all-zero, except for cmd1b_inval which is 1. See also here: "] -#[doc = ""] +#[doc = " This can be used to override the default input values for MVDSTD commands during initialization with video-processing. The default for these fields are all-zero, except for cmd1b_inval which is 1. See also here: https://www.3dbrew.org/wiki/MVD_Services"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct MVDSTD_InitStruct { @@ -18379,8 +15031,7 @@ pub struct MVDSTD_InitStruct { } extern "C" { #[must_use] - #[doc = "Initializes MVDSTD.\n @param mode Mode to initialize MVDSTD to.\n @param input_type Type of input to process.\n @param output_type Type of output to produce.\n @param size Size of the work buffer, MVD_DEFAULT_WORKBUF_SIZE can be used for this. Only used when type == MVDMODE_VIDEOPROCESSING.\n @param initstruct Optional MVDSTD_InitStruct, this should be NULL normally."] - #[doc = ""] + #[doc = " Initializes MVDSTD.\n # Arguments\n\n* `mode` - Mode to initialize MVDSTD to.\n * `input_type` - Type of input to process.\n * `output_type` - Type of output to produce.\n * `size` - Size of the work buffer, MVD_DEFAULT_WORKBUF_SIZE can be used for this. Only used when type == MVDMODE_VIDEOPROCESSING.\n * `initstruct` - Optional MVDSTD_InitStruct, this should be NULL normally."] pub fn mvdstdInit( mode: MVDSTD_Mode, input_type: MVDSTD_InputFormat, @@ -18390,13 +15041,11 @@ extern "C" { ) -> Result; } extern "C" { - #[doc = "Shuts down MVDSTD."] - #[doc = ""] + #[doc = " Shuts down MVDSTD."] pub fn mvdstdExit(); } extern "C" { - #[doc = "Generates a default MVDSTD configuration.\n @param config Pointer to output the generated config to.\n @param input_width Input width.\n @param input_height Input height.\n @param output_width Output width.\n @param output_height Output height.\n @param vaddr_colorconv_indata Virtual address of the color conversion input data.\n @param vaddr_outdata0 Virtual address of the output data.\n @param vaddr_outdata1 Additional virtual address for output data, only used when the output format type is value 0x00020001."] - #[doc = ""] + #[doc = " Generates a default MVDSTD configuration.\n # Arguments\n\n* `config` - Pointer to output the generated config to.\n * `input_width` - Input width.\n * `input_height` - Input height.\n * `output_width` - Output width.\n * `output_height` - Output height.\n * `vaddr_colorconv_indata` - Virtual address of the color conversion input data.\n * `vaddr_outdata0` - Virtual address of the output data.\n * `vaddr_outdata1` - Additional virtual address for output data, only used when the output format type is value 0x00020001."] pub fn mvdstdGenerateDefaultConfig( config: *mut MVDSTD_Config, input_width: u32_, @@ -18410,14 +15059,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Run color-format-conversion.\n @param config Pointer to the configuration to use."] - #[doc = ""] + #[doc = " Run color-format-conversion.\n # Arguments\n\n* `config` - Pointer to the configuration to use."] pub fn mvdstdConvertImage(config: *mut MVDSTD_Config) -> Result; } extern "C" { #[must_use] - #[doc = "Processes a video frame(specifically a NAL-unit).\n @param inbuf_vaddr Input NAL-unit starting with the 3-byte \"00 00 01\" prefix. Must be located in linearmem.\n @param size Size of the input buffer.\n @param flag See here regarding this input flag: @param out Optional output MVDSTD_ProcessNALUnitOut structure."] - #[doc = ""] + #[doc = " Processes a video frame(specifically a NAL-unit).\n # Arguments\n\n* `inbuf_vaddr` - Input NAL-unit starting with the 3-byte \"00 00 01\" prefix. Must be located in linearmem.\n * `size` - Size of the input buffer.\n * `flag` - See here regarding this input flag: https://www.3dbrew.org/wiki/MVDSTD:ProcessNALUnit\n * `out` - Optional output MVDSTD_ProcessNALUnitOut structure."] pub fn mvdstdProcessVideoFrame( inbuf_vaddr: *mut ::libc::c_void, size: usize, @@ -18427,20 +15074,17 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Renders the video frame.\n @param config Optional pointer to the configuration to use. When NULL, MVDSTD_SetConfig() should have been used previously for this video.\n @param wait When true, wait for rendering to finish. When false, you can manually call this function repeatedly until it stops returning MVD_STATUS_BUSY."] - #[doc = ""] + #[doc = " Renders the video frame.\n # Arguments\n\n* `config` - Optional pointer to the configuration to use. When NULL, MVDSTD_SetConfig() should have been used previously for this video.\n * `wait` - When true, wait for rendering to finish. When false, you can manually call this function repeatedly until it stops returning MVD_STATUS_BUSY."] pub fn mvdstdRenderVideoFrame(config: *mut MVDSTD_Config, wait: bool) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the current configuration of MVDSTD.\n @param config Pointer to the configuration to set."] - #[doc = ""] + #[doc = " Sets the current configuration of MVDSTD.\n # Arguments\n\n* `config` - Pointer to the configuration to set."] pub fn MVDSTD_SetConfig(config: *mut MVDSTD_Config) -> Result; } extern "C" { #[must_use] - #[doc = "New3DS Internet Browser doesn't use this. Once done, rendered frames will be written to the output buffers specified by the entrylist instead of the output specified by configuration. See here: @param entrylist Input entrylist.\n @param bufsize Size of each buffer from the entrylist."] - #[doc = ""] + #[doc = " New3DS Internet Browser doesn't use this. Once done, rendered frames will be written to the output buffers specified by the entrylist instead of the output specified by configuration. See here: https://www.3dbrew.org/wiki/MVDSTD:SetupOutputBuffers\n # Arguments\n\n* `entrylist` - Input entrylist.\n * `bufsize` - Size of each buffer from the entrylist."] pub fn mvdstdSetupOutputBuffers( entrylist: *mut MVDSTD_OutputBuffersEntryList, bufsize: u32_, @@ -18448,8 +15092,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "New3DS Internet Browser doesn't use this. This overrides the entry0 output buffers originally setup by mvdstdSetupOutputBuffers(). See also here: @param cur_outdata0 Linearmem vaddr. The current outdata0 for this entry must match this value.\n @param cur_outdata1 Linearmem vaddr. The current outdata1 for this entry must match this value.\n @param new_outdata0 Linearmem vaddr. This is the new address to use for outaddr0.\n @param new_outdata1 Linearmem vaddr. This is the new address to use for outaddr1."] - #[doc = ""] + #[doc = " New3DS Internet Browser doesn't use this. This overrides the entry0 output buffers originally setup by mvdstdSetupOutputBuffers(). See also here: https://www.3dbrew.org/wiki/MVDSTD:OverrideOutputBuffers\n # Arguments\n\n* `cur_outdata0` - Linearmem vaddr. The current outdata0 for this entry must match this value.\n * `cur_outdata1` - Linearmem vaddr. The current outdata1 for this entry must match this value.\n * `new_outdata0` - Linearmem vaddr. This is the new address to use for outaddr0.\n * `new_outdata1` - Linearmem vaddr. This is the new address to use for outaddr1."] pub fn mvdstdOverrideOutputBuffers( cur_outdata0: *mut ::libc::c_void, cur_outdata1: *mut ::libc::c_void, @@ -18458,54 +15101,34 @@ extern "C" { ) -> Result; } pub const NFC_OpType_1: NFC_OpType = 1; -#[doc = "Unknown."] -#[doc = ""] - +#[doc = " Unknown."] pub const NFC_OpType_NFCTag: NFC_OpType = 2; -#[doc = "This is the default."] -#[doc = ""] - +#[doc = " This is the default."] pub const NFC_OpType_RawNFC: NFC_OpType = 3; -#[doc = "NFC operation type."] -#[doc = ""] - +#[doc = " NFC operation type."] pub type NFC_OpType = ::libc::c_uint; pub const NFC_TagState_Uninitialized: NFC_TagState = 0; -#[doc = "nfcInit() was not used yet."] -#[doc = ""] - +#[doc = " nfcInit() was not used yet."] pub const NFC_TagState_ScanningStopped: NFC_TagState = 1; -#[doc = "Not currently scanning for NFC tags. Set by nfcStopScanning() and nfcInit(), when successful."] -#[doc = ""] - +#[doc = " Not currently scanning for NFC tags. Set by nfcStopScanning() and nfcInit(), when successful."] pub const NFC_TagState_Scanning: NFC_TagState = 2; -#[doc = "Currently scanning for NFC tags. Set by nfcStartScanning() when successful."] -#[doc = ""] - +#[doc = " Currently scanning for NFC tags. Set by nfcStartScanning() when successful."] pub const NFC_TagState_InRange: NFC_TagState = 3; -#[doc = "NFC tag is in range. The state automatically changes to this when the state was previously value 2, without using any NFC service commands."] -#[doc = ""] - +#[doc = " NFC tag is in range. The state automatically changes to this when the state was previously value 2, without using any NFC service commands."] pub const NFC_TagState_OutOfRange: NFC_TagState = 4; -#[doc = "NFC tag is now out of range, where the NFC tag was previously in range. This occurs automatically without using any NFC service commands. Once this state is entered, it won't automatically change to anything else when the tag is moved in range again. Hence, if you want to keep doing tag scanning after this, you must stop+start scanning."] -#[doc = ""] - +#[doc = " NFC tag is now out of range, where the NFC tag was previously in range. This occurs automatically without using any NFC service commands. Once this state is entered, it won't automatically change to anything else when the tag is moved in range again. Hence, if you want to keep doing tag scanning after this, you must stop+start scanning."] pub const NFC_TagState_DataReady: NFC_TagState = 5; pub type NFC_TagState = ::libc::c_uint; pub const NFC_amiiboFlag_Setup: _bindgen_ty_28 = 16; -#[doc = "This indicates that the amiibo was setup with amiibo Settings. nfcGetAmiiboSettings() will return an all-zero struct when this is not set."] -#[doc = ""] - +#[doc = " This indicates that the amiibo was setup with amiibo Settings. nfcGetAmiiboSettings() will return an all-zero struct when this is not set."] pub const NFC_amiiboFlag_AppDataSetup: _bindgen_ty_28 = 32; -#[doc = "Bit4-7 are always clear with nfcGetAmiiboSettings() due to \"& 0xF\"."] -#[doc = ""] - +#[doc = " Bit4-7 are always clear with nfcGetAmiiboSettings() due to \"& 0xF\"."] pub type _bindgen_ty_28 = ::libc::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct NFC_TagInfo { pub id_offset_size: u16_, - + #[doc = " \"u16 size/offset of the below ID data. Normally this is 0x7. When this is <=10, this field is the size of the below ID data. When this is >10, this is the offset of the 10-byte ID data, relative to structstart+4+. It's unknown in what cases this 10-byte ID data is used.\""] pub unk_x2: u8_, pub unk_x3: u8_, pub id: [u8_; 40usize], @@ -18519,19 +15142,18 @@ impl Default for NFC_TagInfo { } } } -#[doc = "AmiiboSettings structure, see also here: "] -#[doc = ""] +#[doc = " AmiiboSettings structure, see also here: https://3dbrew.org/wiki/NFC:GetAmiiboSettings"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct NFC_AmiiboSettings { pub mii: [u8_; 96usize], - + #[doc = " \"Owner Mii.\""] pub nickname: [u16_; 11usize], - + #[doc = " \"UTF-16BE Amiibo nickname.\""] pub flags: u8_, - + #[doc = " \"This is plaintext_amiibosettingsdata[0] & 0xF.\" See also the NFC_amiiboFlag enums."] pub countrycodeid: u8_, - + #[doc = " \"This is plaintext_amiibosettingsdata[1].\" \"Country Code ID, from the system which setup this amiibo.\""] pub setupdate_year: u16_, pub setupdate_month: u8_, pub setupdate_day: u8_, @@ -18546,8 +15168,7 @@ impl Default for NFC_AmiiboSettings { } } } -#[doc = "AmiiboConfig structure, see also here: "] -#[doc = ""] +#[doc = " AmiiboConfig structure, see also here: https://3dbrew.org/wiki/NFC:GetAmiiboConfig"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct NFC_AmiiboConfig { @@ -18556,20 +15177,16 @@ pub struct NFC_AmiiboConfig { pub lastwritedate_day: u8_, pub write_counter: u16_, pub characterID: [u8_; 3usize], - #[doc = "the first element is the collection ID, the second the character in this collection, the third the variant"] - #[doc = ""] + #[doc = " the first element is the collection ID, the second the character in this collection, the third the variant"] pub series: u8_, - #[doc = "ID of the series"] - #[doc = ""] + #[doc = " ID of the series"] pub amiiboID: u16_, - #[doc = "ID shared by all exact same amiibo. Some amiibo are only distinguished by this one like regular SMB Series Mario and the gold one"] - #[doc = ""] + #[doc = " ID shared by all exact same amiibo. Some amiibo are only distinguished by this one like regular SMB Series Mario and the gold one"] pub type_: u8_, - #[doc = "Type of amiibo 0 = figure, 1 = card, 2 = plush"] - #[doc = ""] + #[doc = " Type of amiibo 0 = figure, 1 = card, 2 = plush"] pub pagex4_byte3: u8_, pub appdata_size: u16_, - + #[doc = " \"NFC module writes hard-coded u8 value 0xD8 here. This is the size of the Amiibo AppData, apps can use this with the AppData R/W commands. ...\""] pub zeros: [u8_; 48usize], } impl Default for NFC_AmiiboConfig { @@ -18581,8 +15198,7 @@ impl Default for NFC_AmiiboConfig { } } } -#[doc = "Used by nfcInitializeWriteAppData() internally, see also here: "] -#[doc = ""] +#[doc = " Used by nfcInitializeWriteAppData() internally, see also here: https://3dbrew.org/wiki/NFC:GetAppDataInitStruct"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct NFC_AppDataInitStruct { @@ -18598,8 +15214,7 @@ impl Default for NFC_AppDataInitStruct { } } } -#[doc = "Used by nfcWriteAppData() internally, see also: "] -#[doc = ""] +#[doc = " Used by nfcWriteAppData() internally, see also: https://3dbrew.org/wiki/NFC:WriteAppData"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct NFC_AppDataWriteStruct { @@ -18609,71 +15224,59 @@ pub struct NFC_AppDataWriteStruct { } extern "C" { #[must_use] - #[doc = "Initializes NFC.\n @param type See the NFC_OpType enum."] - #[doc = ""] + #[doc = " Initializes NFC.\n # Arguments\n\n* `type` - See the NFC_OpType enum."] pub fn nfcInit(type_: NFC_OpType) -> Result; } extern "C" { - #[doc = "Shuts down NFC."] - #[doc = ""] + #[doc = " Shuts down NFC."] pub fn nfcExit(); } extern "C" { - #[doc = "Gets the NFC service handle.\n @return The NFC service handle."] - #[doc = ""] + #[doc = " Gets the NFC service handle.\n # Returns\n\nThe NFC service handle."] pub fn nfcGetSessionHandle() -> Handle; } extern "C" { #[must_use] - #[doc = "Starts scanning for NFC tags.\n @param inval Unknown. See NFC_STARTSCAN_DEFAULTINPUT."] - #[doc = ""] + #[doc = " Starts scanning for NFC tags.\n # Arguments\n\n* `inval` - Unknown. See NFC_STARTSCAN_DEFAULTINPUT."] pub fn nfcStartScanning(inval: u16_) -> Result; } extern "C" { - #[doc = "Stops scanning for NFC tags."] - #[doc = ""] + #[doc = " Stops scanning for NFC tags."] pub fn nfcStopScanning(); } extern "C" { #[must_use] - #[doc = "Read amiibo NFC data and load in memory."] - #[doc = ""] + #[doc = " Read amiibo NFC data and load in memory."] pub fn nfcLoadAmiiboData() -> Result; } extern "C" { #[must_use] - #[doc = "If the tagstate is valid(NFC_TagState_DataReady or 6), it then sets the current tagstate to NFC_TagState_InRange."] - #[doc = ""] + #[doc = " If the tagstate is valid(NFC_TagState_DataReady or 6), it then sets the current tagstate to NFC_TagState_InRange."] pub fn nfcResetTagScanState() -> Result; } extern "C" { #[must_use] - #[doc = "This writes the amiibo data stored in memory to the actual amiibo data storage(which is normally the NFC data pages). This can only be used if NFC_LoadAmiiboData() was used previously."] - #[doc = ""] + #[doc = " This writes the amiibo data stored in memory to the actual amiibo data storage(which is normally the NFC data pages). This can only be used if NFC_LoadAmiiboData() was used previously."] pub fn nfcUpdateStoredAmiiboData() -> Result; } extern "C" { #[must_use] - #[doc = "Returns the current NFC tag state.\n @param state Pointer to write NFC tag state."] - #[doc = ""] + #[doc = " Returns the current NFC tag state.\n # Arguments\n\n* `state` - Pointer to write NFC tag state."] pub fn nfcGetTagState(state: *mut NFC_TagState) -> Result; } extern "C" { #[must_use] - #[doc = "Returns the current TagInfo.\n @param out Pointer to write the output TagInfo."] - #[doc = ""] + #[doc = " Returns the current TagInfo.\n # Arguments\n\n* `out` - Pointer to write the output TagInfo."] pub fn nfcGetTagInfo(out: *mut NFC_TagInfo) -> Result; } extern "C" { #[must_use] - #[doc = "Opens the appdata, when the amiibo appdata was previously initialized. This must be used before reading/writing the appdata. See also: @param amiibo_appid Amiibo AppID. See here: "] - #[doc = ""] + #[doc = " Opens the appdata, when the amiibo appdata was previously initialized. This must be used before reading/writing the appdata. See also: https://3dbrew.org/wiki/NFC:OpenAppData\n # Arguments\n\n* `amiibo_appid` - Amiibo AppID. See here: https://www.3dbrew.org/wiki/Amiibo"] pub fn nfcOpenAppData(amiibo_appid: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "This initializes the appdata using the specified input, when the appdata previously wasn't initialized. If the appdata is already initialized, you must first use the amiibo Settings applet menu option labeled \"Delete amiibo Game Data\". This automatically writes the amiibo data into the actual data storage(normally NFC data pages). See also nfcWriteAppData().\n @param amiibo_appid amiibo AppID. See also nfcOpenAppData().\n @param buf Input buffer.\n @param size Buffer size."] - #[doc = ""] + #[doc = " This initializes the appdata using the specified input, when the appdata previously wasn't initialized. If the appdata is already initialized, you must first use the amiibo Settings applet menu option labeled \"Delete amiibo Game Data\". This automatically writes the amiibo data into the actual data storage(normally NFC data pages). See also nfcWriteAppData().\n # Arguments\n\n* `amiibo_appid` - amiibo AppID. See also nfcOpenAppData().\n * `buf` - Input buffer.\n * `size` - Buffer size."] pub fn nfcInitializeWriteAppData( amiibo_appid: u32_, buf: *const ::libc::c_void, @@ -18682,14 +15285,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Reads the appdata. The size must be >=0xD8-bytes, but the actual used size is hard-coded to 0xD8. Note that areas of appdata which were never written to by applications are uninitialized in this output buffer.\n @param buf Output buffer.\n @param size Buffer size."] - #[doc = ""] + #[doc = " Reads the appdata. The size must be >=0xD8-bytes, but the actual used size is hard-coded to 0xD8. Note that areas of appdata which were never written to by applications are uninitialized in this output buffer.\n # Arguments\n\n* `buf` - Output buffer.\n * `size` - Buffer size."] pub fn nfcReadAppData(buf: *mut ::libc::c_void, size: usize) -> Result; } extern "C" { #[must_use] - #[doc = "Writes the appdata, after nfcOpenAppData() was used successfully. The size should be <=0xD8-bytes. See also: @param buf Input buffer.\n @param size Buffer size.\n @param taginfo TagInfo from nfcGetTagInfo()."] - #[doc = ""] + #[doc = " Writes the appdata, after nfcOpenAppData() was used successfully. The size should be <=0xD8-bytes. See also: https://3dbrew.org/wiki/NFC:WriteAppData\n # Arguments\n\n* `buf` - Input buffer.\n * `size` - Buffer size.\n * `taginfo` - TagInfo from nfcGetTagInfo()."] pub fn nfcWriteAppData( buf: *const ::libc::c_void, size: usize, @@ -18698,26 +15299,22 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Returns the current AmiiboSettings.\n @param out Pointer to write the output AmiiboSettings."] - #[doc = ""] + #[doc = " Returns the current AmiiboSettings.\n # Arguments\n\n* `out` - Pointer to write the output AmiiboSettings."] pub fn nfcGetAmiiboSettings(out: *mut NFC_AmiiboSettings) -> Result; } extern "C" { #[must_use] - #[doc = "Returns the current AmiiboConfig.\n @param out Pointer to write the output AmiiboConfig."] - #[doc = ""] + #[doc = " Returns the current AmiiboConfig.\n # Arguments\n\n* `out` - Pointer to write the output AmiiboConfig."] pub fn nfcGetAmiiboConfig(out: *mut NFC_AmiiboConfig) -> Result; } extern "C" { #[must_use] - #[doc = "Starts scanning for NFC tags when initialized with NFC_OpType_RawNFC. See also: @param unk0 Same as nfcStartScanning() input.\n @param unk1 Unknown."] - #[doc = ""] + #[doc = " Starts scanning for NFC tags when initialized with NFC_OpType_RawNFC. See also: https://www.3dbrew.org/wiki/NFC:StartOtherTagScanning\n # Arguments\n\n* `unk0` - Same as nfcStartScanning() input.\n * `unk1` - Unknown."] pub fn nfcStartOtherTagScanning(unk0: u16_, unk1: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "This sends a raw NFC command to the tag. This can only be used when initialized with NFC_OpType_RawNFC, and when the TagState is NFC_TagState_InRange. See also: @param inbuf Input buffer.\n @param insize Size of the input buffer.\n @param outbuf Output buffer.\n @param outsize Size of the output buffer.\n @param actual_transfer_size Optional output ptr to write the actual output-size to, can be NULL.\n @param microseconds Timing-related field in microseconds."] - #[doc = ""] + #[doc = " This sends a raw NFC command to the tag. This can only be used when initialized with NFC_OpType_RawNFC, and when the TagState is NFC_TagState_InRange. See also: https://www.3dbrew.org/wiki/NFC:SendTagCommand\n # Arguments\n\n* `inbuf` - Input buffer.\n * `insize` - Size of the input buffer.\n * `outbuf` - Output buffer.\n * `outsize` - Size of the output buffer.\n * `actual_transfer_size` - Optional output ptr to write the actual output-size to, can be NULL.\n * `microseconds` - Timing-related field in microseconds."] pub fn nfcSendTagCommand( inbuf: *const ::libc::c_void, insize: usize, @@ -18729,18 +15326,15 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Unknown. This can only be used when initialized with NFC_OpType_RawNFC, and when the TagState is NFC_TagState_InRange."] - #[doc = ""] + #[doc = " Unknown. This can only be used when initialized with NFC_OpType_RawNFC, and when the TagState is NFC_TagState_InRange."] pub fn nfcCmd21() -> Result; } extern "C" { #[must_use] - #[doc = "Unknown. This can only be used when initialized with NFC_OpType_RawNFC, and when the TagState is NFC_TagState_InRange."] - #[doc = ""] + #[doc = " Unknown. This can only be used when initialized with NFC_OpType_RawNFC, and when the TagState is NFC_TagState_InRange."] pub fn nfcCmd22() -> Result; } -#[doc = "Notification header data."] -#[doc = ""] +#[doc = " Notification header data."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct NotificationHeader { @@ -18759,19 +15353,16 @@ pub struct NotificationHeader { } extern "C" { #[must_use] - #[doc = "Initializes NEWS."] - #[doc = ""] + #[doc = " Initializes NEWS."] pub fn newsInit() -> Result; } extern "C" { - #[doc = "Exits NEWS."] - #[doc = ""] + #[doc = " Exits NEWS."] pub fn newsExit(); } extern "C" { #[must_use] - #[doc = "Adds a notification to the home menu Notifications applet.\n @param title UTF-16 title of the notification.\n @param titleLength Number of characters in the title, not including the null-terminator.\n @param message UTF-16 message of the notification, or NULL for no message.\n @param messageLength Number of characters in the message, not including the null-terminator.\n @param image Data of the image to show in the notification, or NULL for no image.\n @param imageSize Size of the image data in bytes.\n @param jpeg Whether the image is a JPEG or not."] - #[doc = ""] + #[doc = " Adds a notification to the home menu Notifications applet.\n # Arguments\n\n* `title` - UTF-16 title of the notification.\n * `titleLength` - Number of characters in the title, not including the null-terminator.\n * `message` - UTF-16 message of the notification, or NULL for no message.\n * `messageLength` - Number of characters in the message, not including the null-terminator.\n * `image` - Data of the image to show in the notification, or NULL for no image.\n * `imageSize` - Size of the image data in bytes.\n * `jpeg` - Whether the image is a JPEG or not."] pub fn NEWS_AddNotification( title: *const u16_, titleLength: u32_, @@ -18784,32 +15375,27 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets current total notifications number.\n @param num Pointer where total number will be saved."] - #[doc = ""] + #[doc = " Gets current total notifications number.\n # Arguments\n\n* `num` - Pointer where total number will be saved."] pub fn NEWS_GetTotalNotifications(num: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Sets a custom header for a specific notification.\n @param news_id Identification number of the notification.\n @param header Pointer to notification header to set."] - #[doc = ""] + #[doc = " Sets a custom header for a specific notification.\n # Arguments\n\n* `news_id` - Identification number of the notification.\n * `header` - Pointer to notification header to set."] pub fn NEWS_SetNotificationHeader(news_id: u32_, header: *const NotificationHeader) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the header of a specific notification.\n @param news_id Identification number of the notification.\n @param header Pointer where header of the notification will be saved."] - #[doc = ""] + #[doc = " Gets the header of a specific notification.\n # Arguments\n\n* `news_id` - Identification number of the notification.\n * `header` - Pointer where header of the notification will be saved."] pub fn NEWS_GetNotificationHeader(news_id: u32_, header: *mut NotificationHeader) -> Result; } extern "C" { #[must_use] - #[doc = "Sets a custom message for a specific notification.\n @param news_id Identification number of the notification.\n @param message Pointer to UTF-16 message to set.\n @param size Size of message to set."] - #[doc = ""] + #[doc = " Sets a custom message for a specific notification.\n # Arguments\n\n* `news_id` - Identification number of the notification.\n * `message` - Pointer to UTF-16 message to set.\n * `size` - Size of message to set."] pub fn NEWS_SetNotificationMessage(news_id: u32_, message: *const u16_, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the message of a specific notification.\n @param news_id Identification number of the notification.\n @param message Pointer where UTF-16 message of the notification will be saved.\n @param size Pointer where size of the message data will be saved in bytes."] - #[doc = ""] + #[doc = " Gets the message of a specific notification.\n # Arguments\n\n* `news_id` - Identification number of the notification.\n * `message` - Pointer where UTF-16 message of the notification will be saved.\n * `size` - Pointer where size of the message data will be saved in bytes."] pub fn NEWS_GetNotificationMessage( news_id: u32_, message: *mut u16_, @@ -18818,8 +15404,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Sets a custom image for a specific notification.\n @param news_id Identification number of the notification.\n @param buffer Pointer to MPO image to set.\n @param size Size of the MPO image to set."] - #[doc = ""] + #[doc = " Sets a custom image for a specific notification.\n # Arguments\n\n* `news_id` - Identification number of the notification.\n * `buffer` - Pointer to MPO image to set.\n * `size` - Size of the MPO image to set."] pub fn NEWS_SetNotificationImage( news_id: u32_, buffer: *const ::libc::c_void, @@ -18828,72 +15413,57 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets the image of a specific notification.\n @param news_id Identification number of the notification.\n @param buffer Pointer where MPO image of the notification will be saved.\n @param size Pointer where size of the image data will be saved in bytes."] - #[doc = ""] + #[doc = " Gets the image of a specific notification.\n # Arguments\n\n* `news_id` - Identification number of the notification.\n * `buffer` - Pointer where MPO image of the notification will be saved.\n * `size` - Pointer where size of the image data will be saved in bytes."] pub fn NEWS_GetNotificationImage( news_id: u32_, buffer: *mut ::libc::c_void, size: *mut u32_, ) -> Result; } -#[doc = "Head tracking coordinate pair."] -#[doc = ""] +#[doc = " Head tracking coordinate pair."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct QTM_HeadTrackingInfoCoord { - #[doc = "X coordinate."] - #[doc = ""] + #[doc = "< X coordinate."] pub x: f32, - #[doc = "Y coordinate."] - #[doc = ""] + #[doc = "< Y coordinate."] pub y: f32, } -#[doc = "Head tracking info."] -#[doc = ""] +#[doc = " Head tracking info."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct QTM_HeadTrackingInfo { - #[doc = "Flags."] - #[doc = ""] + #[doc = "< Flags."] pub flags: [u8_; 5usize], - #[doc = "Padding."] - #[doc = ""] + #[doc = "< Padding."] pub padding: [u8_; 3usize], - #[doc = "Unknown. Not used by System_Settings."] - #[doc = ""] + #[doc = "< Unknown. Not used by System_Settings."] pub floatdata_x08: f32, - #[doc = "Head coordinates."] - #[doc = ""] + #[doc = "< Head coordinates."] pub coords0: [QTM_HeadTrackingInfoCoord; 4usize], - #[doc = "Unknown. Not used by System_Settings."] - #[doc = ""] + #[doc = "< Unknown. Not used by System_Settings."] pub unk_x2c: [u32_; 5usize], } extern "C" { #[must_use] - #[doc = "Initializes QTM."] - #[doc = ""] + #[doc = " Initializes QTM."] pub fn qtmInit() -> Result; } extern "C" { - #[doc = "Exits QTM."] - #[doc = ""] + #[doc = " Exits QTM."] pub fn qtmExit(); } extern "C" { - #[doc = "Checks whether QTM is initialized.\n @return Whether QTM is initialized."] - #[doc = ""] + #[doc = " Checks whether QTM is initialized.\n # Returns\n\nWhether QTM is initialized."] pub fn qtmCheckInitialized() -> bool; } extern "C" { - #[doc = "Checks whether a head is fully detected.\n @param info Tracking info to check."] - #[doc = ""] + #[doc = " Checks whether a head is fully detected.\n # Arguments\n\n* `info` - Tracking info to check."] pub fn qtmCheckHeadFullyDetected(info: *mut QTM_HeadTrackingInfo) -> bool; } extern "C" { #[must_use] - #[doc = "Converts QTM coordinates to screen coordinates.\n @param coord Coordinates to convert.\n @param screen_width Width of the screen. Can be NULL to use the default value for the top screen.\n @param screen_height Height of the screen. Can be NULL to use the default value for the top screen.\n @param x Pointer to output the screen X coordinate to.\n @param y Pointer to output the screen Y coordinate to."] - #[doc = ""] + #[doc = " Converts QTM coordinates to screen coordinates.\n # Arguments\n\n* `coord` - Coordinates to convert.\n * `screen_width` - Width of the screen. Can be NULL to use the default value for the top screen.\n * `screen_height` - Height of the screen. Can be NULL to use the default value for the top screen.\n * `x` - Pointer to output the screen X coordinate to.\n * `y` - Pointer to output the screen Y coordinate to."] pub fn qtmConvertCoordToScreen( coord: *mut QTM_HeadTrackingInfoCoord, screen_width: *mut f32, @@ -18904,42 +15474,35 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets the current head tracking info.\n @param val Normally 0.\n @param out Pointer to write head tracking info to."] - #[doc = ""] + #[doc = " Gets the current head tracking info.\n # Arguments\n\n* `val` - Normally 0.\n * `out` - Pointer to write head tracking info to."] pub fn QTM_GetHeadTrackingInfo(val: u64_, out: *mut QTM_HeadTrackingInfo) -> Result; } extern "C" { #[must_use] - #[doc = "Initializes srv:pm and the service API."] - #[doc = ""] + #[doc = " Initializes srv:pm and the service API."] pub fn srvPmInit() -> Result; } extern "C" { - #[doc = "Exits srv:pm and the service API."] - #[doc = ""] + #[doc = " Exits srv:pm and the service API."] pub fn srvPmExit(); } extern "C" { - #[doc = "Gets the current srv:pm session handle.\n @return The current srv:pm session handle."] - #[doc = ""] + #[doc = " Gets the current srv:pm session handle.\n # Returns\n\nThe current srv:pm session handle."] pub fn srvPmGetSessionHandle() -> *mut Handle; } extern "C" { #[must_use] - #[doc = "Publishes a notification to a process.\n @param notificationId ID of the notification.\n @param process Process to publish to."] - #[doc = ""] + #[doc = " Publishes a notification to a process.\n # Arguments\n\n* `notificationId` - ID of the notification.\n * `process` - Process to publish to."] pub fn SRVPM_PublishToProcess(notificationId: u32_, process: Handle) -> Result; } extern "C" { #[must_use] - #[doc = "Publishes a notification to all processes.\n @param notificationId ID of the notification."] - #[doc = ""] + #[doc = " Publishes a notification to all processes.\n # Arguments\n\n* `notificationId` - ID of the notification."] pub fn SRVPM_PublishToAll(notificationId: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Registers a process with SRV.\n @param pid ID of the process.\n @param count Number of services within the service access control data.\n @param serviceAccessControlList Service Access Control list."] - #[doc = ""] + #[doc = " Registers a process with SRV.\n # Arguments\n\n* `pid` - ID of the process.\n * `count` - Number of services within the service access control data.\n * `serviceAccessControlList` - Service Access Control list."] pub fn SRVPM_RegisterProcess( pid: u32_, count: u32_, @@ -18948,31 +15511,26 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Unregisters a process with SRV.\n @param pid ID of the process."] - #[doc = ""] + #[doc = " Unregisters a process with SRV.\n # Arguments\n\n* `pid` - ID of the process."] pub fn SRVPM_UnregisterProcess(pid: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Initializes LOADER."] - #[doc = ""] + #[doc = " Initializes LOADER."] pub fn loaderInit() -> Result; } extern "C" { - #[doc = "Exits LOADER."] - #[doc = ""] + #[doc = " Exits LOADER."] pub fn loaderExit(); } extern "C" { #[must_use] - #[doc = "Loads a program and returns a process handle to the newly created process.\n @param[out] process Pointer to output the process handle to.\n @param programHandle The handle of the program to load."] - #[doc = ""] + #[doc = " Loads a program and returns a process handle to the newly created process.\n # Arguments\n\n* `process` (direction out) - Pointer to output the process handle to.\n * `programHandle` - The handle of the program to load."] pub fn LOADER_LoadProcess(process: *mut Handle, programHandle: u64_) -> Result; } extern "C" { #[must_use] - #[doc = "Registers a program (along with its update).\n @param[out] programHandle Pointer to output the program handle to.\n @param programInfo The program info.\n @param programInfo The program update info."] - #[doc = ""] + #[doc = " Registers a program (along with its update).\n # Arguments\n\n* `programHandle` (direction out) - Pointer to output the program handle to.\n * `programInfo` - The program info.\n * `programInfo` - The program update info."] pub fn LOADER_RegisterProgram( programHandle: *mut u64_, programInfo: *const FS_ProgramInfo, @@ -18981,292 +15539,135 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Unregisters a program (along with its update).\n @param programHandle The handle of the program to unregister."] - #[doc = ""] + #[doc = " Unregisters a program (along with its update).\n # Arguments\n\n* `programHandle` - The handle of the program to unregister."] pub fn LOADER_UnregisterProgram(programHandle: u64_) -> Result; } extern "C" { #[must_use] - #[doc = "Retrives a program's main NCCH extended header info (SCI + ACI, see [`ExHeader_Info).\n`] @param[out] exheaderInfo Pointer to output the main NCCH extended header info.\n @param programHandle The handle of the program to unregister"] - #[doc = ""] + #[doc = " Retrives a program's main NCCH extended header info (SCI + ACI, see ExHeader_Info).\n # Arguments\n\n* `exheaderInfo` (direction out) - Pointer to output the main NCCH extended header info.\n * `programHandle` - The handle of the program to unregister"] pub fn LOADER_GetProgramInfo(exheaderInfo: *mut ExHeader_Info, programHandle: u64_) -> Result; } -#[doc = "The normal mode of the led"] -#[doc = ""] - +#[doc = "< The normal mode of the led"] pub const LED_NORMAL: powerLedState = 1; -#[doc = "The led pulses slowly as it does in the sleep mode"] -#[doc = ""] - +#[doc = "< The led pulses slowly as it does in the sleep mode"] pub const LED_SLEEP_MODE: powerLedState = 2; -#[doc = "Switch off power led"] -#[doc = ""] - +#[doc = "< Switch off power led"] pub const LED_OFF: powerLedState = 3; -#[doc = "Red state of the led"] -#[doc = ""] - +#[doc = "< Red state of the led"] pub const LED_RED: powerLedState = 4; -#[doc = "Blue state of the led"] -#[doc = ""] - +#[doc = "< Blue state of the led"] pub const LED_BLUE: powerLedState = 5; -#[doc = "Blinking red state of power led and notification led"] -#[doc = ""] - +#[doc = "< Blinking red state of power led and notification led"] pub const LED_BLINK_RED: powerLedState = 6; pub type powerLedState = ::libc::c_uint; extern "C" { #[must_use] - #[doc = "Initializes mcuHwc."] - #[doc = ""] + #[doc = " Initializes mcuHwc."] pub fn mcuHwcInit() -> Result; } extern "C" { - #[doc = "Exits mcuHwc."] - #[doc = ""] + #[doc = " Exits mcuHwc."] pub fn mcuHwcExit(); } -extern "C" { - #[doc = "Gets the current mcuHwc session handle.\n @return A pointer to the current mcuHwc session handle."] - #[doc = ""] - pub fn mcuHwcGetSessionHandle() -> *mut Handle; -} extern "C" { #[must_use] - #[doc = "Reads data from an i2c device3 register\n @param reg Register number. See for more info\n @param data Pointer to write the data to.\n @param size Size of data to be read"] - #[doc = ""] + #[doc = " Reads data from an i2c device3 register\n # Arguments\n\n* `reg` - Register number. See https://www.3dbrew.org/wiki/I2C_Registers#Device_3 for more info\n * `data` - Pointer to write the data to.\n * `size` - Size of data to be read"] pub fn MCUHWC_ReadRegister(reg: u8_, data: *mut ::libc::c_void, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Writes data to a i2c device3 register\n @param reg Register number. See for more info\n @param data Pointer to write the data to.\n @param size Size of data to be written"] - #[doc = ""] + #[doc = " Writes data to a i2c device3 register\n # Arguments\n\n* `reg` - Register number. See https://www.3dbrew.org/wiki/I2C_Registers#Device_3 for more info\n * `data` - Pointer to write the data to.\n * `size` - Size of data to be written"] pub fn MCUHWC_WriteRegister(reg: u8_, data: *const ::libc::c_void, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the battery voltage\n @param voltage Pointer to write the battery voltage to."] - #[doc = ""] + #[doc = " Gets the battery voltage\n # Arguments\n\n* `voltage` - Pointer to write the battery voltage to."] pub fn MCUHWC_GetBatteryVoltage(voltage: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the battery level\n @param level Pointer to write the current battery level to."] - #[doc = ""] + #[doc = " Gets the battery level\n # Arguments\n\n* `level` - Pointer to write the current battery level to."] pub fn MCUHWC_GetBatteryLevel(level: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the sound slider level\n @param level Pointer to write the slider level to."] - #[doc = ""] + #[doc = " Gets the sound slider level\n # Arguments\n\n* `level` - Pointer to write the slider level to."] pub fn MCUHWC_GetSoundSliderLevel(level: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Sets Wifi LED state\n @param state State of Wifi LED. (True/False)"] - #[doc = ""] + #[doc = " Sets Wifi LED state\n # Arguments\n\n* `state` - State of Wifi LED. (True/False)"] pub fn MCUHWC_SetWifiLedState(state: bool) -> Result; } extern "C" { #[must_use] - #[doc = "Sets Power LED state\n @param state powerLedState State of power LED."] - #[doc = ""] + #[doc = " Sets Power LED state\n # Arguments\n\n* `state` - powerLedState State of power LED."] pub fn MCUHWC_SetPowerLedState(state: powerLedState) -> Result; } extern "C" { #[must_use] - #[doc = "Gets 3d slider level\n @param level Pointer to write 3D slider level to."] - #[doc = ""] + #[doc = " Gets 3d slider level\n # Arguments\n\n* `level` - Pointer to write 3D slider level to."] pub fn MCUHWC_Get3dSliderLevel(level: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the major MCU firmware version\n @param out Pointer to write the major firmware version to."] - #[doc = ""] + #[doc = " Gets the major MCU firmware version\n # Arguments\n\n* `out` - Pointer to write the major firmware version to."] pub fn MCUHWC_GetFwVerHigh(out: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Gets the minor MCU firmware version\n @param out Pointer to write the minor firmware version to."] - #[doc = ""] + #[doc = " Gets the minor MCU firmware version\n # Arguments\n\n* `out` - Pointer to write the minor firmware version to."] pub fn MCUHWC_GetFwVerLow(out: *mut u8_) -> Result; } -#[doc = "Primary I2S line, used by DSP/Mic (configurable)/GBA sound controller."] -#[doc = ""] - -pub const CODEC_I2S_LINE_1: CodecI2sLine = 0; -#[doc = "Secondary I2S line, used by CSND hardware."] -#[doc = ""] - -pub const CODEC_I2S_LINE_2: CodecI2sLine = 1; -#[doc = "I2S line enumeration"] -#[doc = ""] - -pub type CodecI2sLine = ::libc::c_uint; -extern "C" { - #[must_use] - #[doc = "Initializes CDCCHK."] - #[doc = ""] - pub fn cdcChkInit() -> Result; -} -extern "C" { - #[doc = "Exits CDCCHK."] - #[doc = ""] - pub fn cdcChkExit(); -} -extern "C" { - #[doc = "Gets a pointer to the current cdc:CHK session handle.\n @return A pointer to the current cdc:CHK session handle."] - #[doc = ""] - pub fn cdcChkGetSessionHandle() -> *mut Handle; -} -extern "C" { - #[must_use] - #[doc = "Reads multiple registers from the CODEC, using the old\n SPI hardware interface and a 4MHz baudrate.\n @param pageId CODEC Page ID.\n @param initialRegAddr Address of the CODEC register to start with.\n @param[out] outData Where to write the read data to.\n @param size Number of registers to read (bytes to read, max. 64)."] - #[doc = ""] - pub fn CDCCHK_ReadRegisters1( - pageId: u8_, - initialRegAddr: u8_, - outData: *mut ::libc::c_void, - size: usize, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Reads multiple registers from the CODEC, using the new\n SPI hardware interface and a 16MHz baudrate.\n @param pageId CODEC Page ID.\n @param initialRegAddr Address of the CODEC register to start with.\n @param[out] outData Where to read the data to.\n @param size Number of registers to read (bytes to read, max. 64)."] - #[doc = ""] - pub fn CDCCHK_ReadRegisters2( - pageId: u8_, - initialRegAddr: u8_, - outData: *mut ::libc::c_void, - size: usize, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Writes multiple registers to the CODEC, using the old\n SPI hardware interface and a 4MHz baudrate.\n @param pageId CODEC Page ID.\n @param initialRegAddr Address of the CODEC register to start with.\n @param data Where to read the data to write from.\n @param size Number of registers to write (bytes to read, max. 64)."] - #[doc = ""] - pub fn CDCCHK_WriteRegisters1( - pageId: u8_, - initialRegAddr: u8_, - data: *const ::libc::c_void, - size: usize, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Writes multiple registers to the CODEC, using the new\n SPI hardware interface and a 16MHz baudrate.\n @param pageId CODEC Page ID.\n @param initialRegAddr Address of the CODEC register to start with.\n @param data Where to read the data to write from.\n @param size Number of registers to write (bytes to read, max. 64)."] - #[doc = ""] - pub fn CDCCHK_WriteRegisters2( - pageId: u8_, - initialRegAddr: u8_, - data: *const ::libc::c_void, - size: usize, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Reads a single register from the NTR PMIC.\n @param[out] outData Where to read the data to (1 byte).\n @param regAddr Register address.\n @note The NTR PMIC is emulated by the CODEC hardware and sends\n IRQs to the MCU when relevant."] - #[doc = ""] - pub fn CDCCHK_ReadNtrPmicRegister(outData: *mut u8_, regAddr: u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Writes a single register from the NTR PMIC.\n @param regAddr Register address.\n @param data Data to write (1 byte).\n @note The NTR PMIC is emulated by the CODEC hardware and sends\n IRQs to the MCU when relevant."] - #[doc = ""] - pub fn CDCCHK_WriteNtrPmicRegister(regAddr: u8_, data: u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the DAC volume level for the specified I2S line.\n @param i2sLine I2S line to set the volume for.\n @param volume Volume level (-128 to 0)."] - #[doc = ""] - pub fn CDCCHK_SetI2sVolume(i2sLine: CodecI2sLine, volume: s8) -> Result; -} -#[doc = "8-bit Red + 8-bit Green + 8-bit Blue + 8-bit Alpha"] -#[doc = ""] - +#[doc = "< 8-bit Red + 8-bit Green + 8-bit Blue + 8-bit Alpha"] pub const GX_TRANSFER_FMT_RGBA8: GX_TRANSFER_FORMAT = 0; -#[doc = "8-bit Red + 8-bit Green + 8-bit Blue"] -#[doc = ""] - +#[doc = "< 8-bit Red + 8-bit Green + 8-bit Blue"] pub const GX_TRANSFER_FMT_RGB8: GX_TRANSFER_FORMAT = 1; -#[doc = "5-bit Red + 6-bit Green + 5-bit Blue"] -#[doc = ""] - +#[doc = "< 5-bit Red + 6-bit Green + 5-bit Blue"] pub const GX_TRANSFER_FMT_RGB565: GX_TRANSFER_FORMAT = 2; -#[doc = "5-bit Red + 5-bit Green + 5-bit Blue + 1-bit Alpha"] -#[doc = ""] - +#[doc = "< 5-bit Red + 5-bit Green + 5-bit Blue + 1-bit Alpha"] pub const GX_TRANSFER_FMT_RGB5A1: GX_TRANSFER_FORMAT = 3; -#[doc = "4-bit Red + 4-bit Green + 4-bit Blue + 4-bit Alpha"] -#[doc = ""] - +#[doc = "< 4-bit Red + 4-bit Green + 4-bit Blue + 4-bit Alpha"] pub const GX_TRANSFER_FMT_RGBA4: GX_TRANSFER_FORMAT = 4; -#[doc = "Supported transfer pixel formats.\n [`GSPGPU_FramebufferFormat`]"] -#[doc = ""] - +#[doc = " Supported transfer pixel formats.\n [`GSPGPU_FramebufferFormat`]"] pub type GX_TRANSFER_FORMAT = ::libc::c_uint; -#[doc = "No anti-aliasing"] -#[doc = ""] - +#[doc = "< No anti-aliasing"] pub const GX_TRANSFER_SCALE_NO: GX_TRANSFER_SCALE = 0; -#[doc = "2x1 anti-aliasing"] -#[doc = ""] - +#[doc = "< 2x1 anti-aliasing"] pub const GX_TRANSFER_SCALE_X: GX_TRANSFER_SCALE = 1; -#[doc = "2x2 anti-aliasing"] -#[doc = ""] - +#[doc = "< 2x2 anti-aliasing"] pub const GX_TRANSFER_SCALE_XY: GX_TRANSFER_SCALE = 2; -#[doc = "Anti-aliasing modes\n\n Please remember that the framebuffer is sideways.\n Hence if you activate 2x1 anti-aliasing the destination dimensions are w = 240*2 and h = 400"] -#[doc = ""] - +#[doc = " Anti-aliasing modes\n\n Please remember that the framebuffer is sideways.\n Hence if you activate 2x1 anti-aliasing the destination dimensions are w = 240*2 and h = 400"] pub type GX_TRANSFER_SCALE = ::libc::c_uint; -#[doc = "Trigger the PPF event"] -#[doc = ""] - +#[doc = "< Trigger the PPF event"] pub const GX_FILL_TRIGGER: GX_FILL_CONTROL = 1; -#[doc = "Indicates if the memory fill is complete. You should not use it when requesting a transfer."] -#[doc = ""] - +#[doc = "< Indicates if the memory fill is complete. You should not use it when requesting a transfer."] pub const GX_FILL_FINISHED: GX_FILL_CONTROL = 2; -#[doc = "The buffer has a 16 bit per pixel depth"] -#[doc = ""] - +#[doc = "< The buffer has a 16 bit per pixel depth"] pub const GX_FILL_16BIT_DEPTH: GX_FILL_CONTROL = 0; -#[doc = "The buffer has a 24 bit per pixel depth"] -#[doc = ""] - +#[doc = "< The buffer has a 24 bit per pixel depth"] pub const GX_FILL_24BIT_DEPTH: GX_FILL_CONTROL = 256; -#[doc = "The buffer has a 32 bit per pixel depth"] -#[doc = ""] - +#[doc = "< The buffer has a 32 bit per pixel depth"] pub const GX_FILL_32BIT_DEPTH: GX_FILL_CONTROL = 512; -#[doc = "GX transfer control flags"] -#[doc = ""] - +#[doc = " GX transfer control flags"] pub type GX_FILL_CONTROL = ::libc::c_uint; -#[doc = "GX command entry"] -#[doc = ""] +#[doc = " GX command entry"] #[repr(C)] #[derive(Copy, Clone)] pub union gxCmdEntry_s { - #[doc = "Raw command data"] - #[doc = ""] + #[doc = "< Raw command data"] pub data: [u32_; 8usize], pub __bindgen_anon_1: gxCmdEntry_s__bindgen_ty_1, } #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct gxCmdEntry_s__bindgen_ty_1 { - #[doc = "Command type"] - #[doc = ""] + #[doc = "< Command type"] pub type_: u8_, pub unk1: u8_, pub unk2: u8_, pub unk3: u8_, - #[doc = "Command arguments"] - #[doc = ""] + #[doc = "< Command arguments"] pub args: [u32_; 7usize], } impl Default for gxCmdEntry_s { @@ -19278,31 +15679,23 @@ impl Default for gxCmdEntry_s { } } } -#[doc = "GX command queue structure"] -#[doc = ""] +#[doc = " GX command queue structure"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct tag_gxCmdQueue_s { - #[doc = "Pointer to array of GX command entries"] - #[doc = ""] + #[doc = "< Pointer to array of GX command entries"] pub entries: *mut gxCmdEntry_s, - #[doc = "Capacity of the command array"] - #[doc = ""] + #[doc = "< Capacity of the command array"] pub maxEntries: u16_, - #[doc = "Number of commands in the queue"] - #[doc = ""] + #[doc = "< Number of commands in the queue"] pub numEntries: u16_, - #[doc = "Index of the first pending command to be submitted to GX"] - #[doc = ""] + #[doc = "< Index of the first pending command to be submitted to GX"] pub curEntry: u16_, - #[doc = "Number of commands completed by GX"] - #[doc = ""] + #[doc = "< Number of commands completed by GX"] pub lastEntry: u16_, - #[doc = "User callback"] - #[doc = ""] + #[doc = "< User callback"] pub callback: ::core::option::Option, - #[doc = "Data for user callback"] - #[doc = ""] + #[doc = "< Data for user callback"] pub user: *mut ::libc::c_void, } impl Default for tag_gxCmdQueue_s { @@ -19314,56 +15707,45 @@ impl Default for tag_gxCmdQueue_s { } } } -#[doc = "GX command queue structure"] -#[doc = ""] - +#[doc = " GX command queue structure"] pub type gxCmdQueue_s = tag_gxCmdQueue_s; extern "C" { - #[doc = "Clears a GX command queue.\n @param queue The GX command queue."] - #[doc = ""] + #[doc = " Clears a GX command queue.\n # Arguments\n\n* `queue` - The GX command queue."] pub fn gxCmdQueueClear(queue: *mut gxCmdQueue_s); } extern "C" { - #[doc = "Adds a command to a GX command queue.\n @param queue The GX command queue.\n @param entry The GX command to add."] - #[doc = ""] + #[doc = " Adds a command to a GX command queue.\n # Arguments\n\n* `queue` - The GX command queue.\n * `entry` - The GX command to add."] pub fn gxCmdQueueAdd(queue: *mut gxCmdQueue_s, entry: *const gxCmdEntry_s); } extern "C" { - #[doc = "Runs a GX command queue, causing it to begin processing incoming commands as they arrive.\n @param queue The GX command queue."] - #[doc = ""] + #[doc = " Runs a GX command queue, causing it to begin processing incoming commands as they arrive.\n # Arguments\n\n* `queue` - The GX command queue."] pub fn gxCmdQueueRun(queue: *mut gxCmdQueue_s); } extern "C" { - #[doc = "Stops a GX command queue from processing incoming commands.\n @param queue The GX command queue."] - #[doc = ""] + #[doc = " Stops a GX command queue from processing incoming commands.\n # Arguments\n\n* `queue` - The GX command queue."] pub fn gxCmdQueueStop(queue: *mut gxCmdQueue_s); } extern "C" { - #[doc = "Waits for a GX command queue to finish executing pending commands.\n @param queue The GX command queue.\n @param timeout Optional timeout (in nanoseconds) to wait (specify -1 for no timeout).\n @return false if timeout expired, true otherwise."] - #[doc = ""] + #[doc = " Waits for a GX command queue to finish executing pending commands.\n # Arguments\n\n* `queue` - The GX command queue.\n * `timeout` - Optional timeout (in nanoseconds) to wait (specify -1 for no timeout).\n # Returns\n\nfalse if timeout expired, true otherwise."] pub fn gxCmdQueueWait(queue: *mut gxCmdQueue_s, timeout: s64) -> bool; } extern "C" { - #[doc = "Selects a command queue to which GX_* functions will add commands instead of immediately submitting them to GX.\n @param queue The GX command queue. (Pass NULL to remove the bound command queue)"] - #[doc = ""] + #[doc = " Selects a command queue to which GX_* functions will add commands instead of immediately submitting them to GX.\n # Arguments\n\n* `queue` - The GX command queue. (Pass NULL to remove the bound command queue)"] pub fn GX_BindQueue(queue: *mut gxCmdQueue_s); } extern "C" { #[must_use] - #[doc = "Requests a DMA.\n @param src Source to DMA from.\n @param dst Destination to DMA to.\n @param length Length of data to transfer."] - #[doc = ""] + #[doc = " Requests a DMA.\n # Arguments\n\n* `src` - Source to DMA from.\n * `dst` - Destination to DMA to.\n * `length` - Length of data to transfer."] pub fn GX_RequestDma(src: *mut u32_, dst: *mut u32_, length: u32_) -> Result; } extern "C" { #[must_use] - #[doc = "Processes a GPU command list.\n @param buf0a Command list address.\n @param buf0s Command list size.\n @param flags Flags to process with."] - #[doc = ""] + #[doc = " Processes a GPU command list.\n # Arguments\n\n* `buf0a` - Command list address.\n * `buf0s` - Command list size.\n * `flags` - Flags to process with."] pub fn GX_ProcessCommandList(buf0a: *mut u32_, buf0s: u32_, flags: u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Fills the memory of two buffers with the given values.\n @param buf0a Start address of the first buffer.\n @param buf0v Dimensions of the first buffer.\n @param buf0e End address of the first buffer.\n @param control0 Value to fill the first buffer with.\n @param buf1a Start address of the second buffer.\n @param buf1v Dimensions of the second buffer.\n @param buf1e End address of the second buffer.\n @param control1 Value to fill the second buffer with."] - #[doc = ""] + #[doc = " Fills the memory of two buffers with the given values.\n # Arguments\n\n* `buf0a` - Start address of the first buffer.\n * `buf0v` - Dimensions of the first buffer.\n * `buf0e` - End address of the first buffer.\n * `control0` - Value to fill the first buffer with.\n * `buf1a` - Start address of the second buffer.\n * `buf1v` - Dimensions of the second buffer.\n * `buf1e` - End address of the second buffer.\n * `control1` - Value to fill the second buffer with."] pub fn GX_MemoryFill( buf0a: *mut u32_, buf0v: u32_, @@ -19377,8 +15759,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Initiates a display transfer.\n @note The PPF event will be signaled on completion.\n @param inadr Address of the input.\n @param indim Dimensions of the input.\n @param outadr Address of the output.\n @param outdim Dimensions of the output.\n @param flags Flags to transfer with."] - #[doc = ""] + #[doc = " Initiates a display transfer.\n > **Note:** The PPF event will be signaled on completion.\n # Arguments\n\n* `inadr` - Address of the input.\n * `indim` - Dimensions of the input.\n * `outadr` - Address of the output.\n * `outdim` - Dimensions of the output.\n * `flags` - Flags to transfer with."] pub fn GX_DisplayTransfer( inadr: *mut u32_, indim: u32_, @@ -19389,8 +15770,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Initiates a texture copy.\n @note The PPF event will be signaled on completion.\n @param inadr Address of the input.\n @param indim Dimensions of the input.\n @param outadr Address of the output.\n @param outdim Dimensions of the output.\n @param size Size of the data to transfer.\n @param flags Flags to transfer with."] - #[doc = ""] + #[doc = " Initiates a texture copy.\n > **Note:** The PPF event will be signaled on completion.\n # Arguments\n\n* `inadr` - Address of the input.\n * `indim` - Dimensions of the input.\n * `outadr` - Address of the output.\n * `outdim` - Dimensions of the output.\n * `size` - Size of the data to transfer.\n * `flags` - Flags to transfer with."] pub fn GX_TextureCopy( inadr: *mut u32_, indim: u32_, @@ -19402,8 +15782,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Flushes the cache regions of three buffers. (This command cannot be queued in a GX command queue)\n @param buf0a Address of the first buffer.\n @param buf0s Size of the first buffer.\n @param buf1a Address of the second buffer.\n @param buf1s Size of the second buffer.\n @param buf2a Address of the third buffer.\n @param buf2s Size of the third buffer."] - #[doc = ""] + #[doc = " Flushes the cache regions of three buffers. (This command cannot be queued in a GX command queue)\n # Arguments\n\n* `buf0a` - Address of the first buffer.\n * `buf0s` - Size of the first buffer.\n * `buf1a` - Address of the second buffer.\n * `buf1s` - Size of the second buffer.\n * `buf2a` - Address of the third buffer.\n * `buf2s` - Size of the third buffer."] pub fn GX_FlushCacheRegions( buf0a: *mut u32_, buf0s: u32_, @@ -19413,1288 +15792,665 @@ extern "C" { buf2s: u32_, ) -> Result; } -#[doc = "Nearest-neighbor interpolation."] -#[doc = ""] - +#[doc = "< Nearest-neighbor interpolation."] pub const GPU_NEAREST: GPU_TEXTURE_FILTER_PARAM = 0; -#[doc = "Linear interpolation."] -#[doc = ""] - +#[doc = "< Linear interpolation."] pub const GPU_LINEAR: GPU_TEXTURE_FILTER_PARAM = 1; -#[doc = "Texture filters."] -#[doc = ""] - +#[doc = " Texture filters."] pub type GPU_TEXTURE_FILTER_PARAM = ::libc::c_uint; -#[doc = "Clamps to edge."] -#[doc = ""] - +#[doc = "< Clamps to edge."] pub const GPU_CLAMP_TO_EDGE: GPU_TEXTURE_WRAP_PARAM = 0; -#[doc = "Clamps to border."] -#[doc = ""] - +#[doc = "< Clamps to border."] pub const GPU_CLAMP_TO_BORDER: GPU_TEXTURE_WRAP_PARAM = 1; -#[doc = "Repeats texture."] -#[doc = ""] - +#[doc = "< Repeats texture."] pub const GPU_REPEAT: GPU_TEXTURE_WRAP_PARAM = 2; -#[doc = "Repeats with mirrored texture."] -#[doc = ""] - +#[doc = "< Repeats with mirrored texture."] pub const GPU_MIRRORED_REPEAT: GPU_TEXTURE_WRAP_PARAM = 3; -#[doc = "Texture wrap modes."] -#[doc = ""] - +#[doc = " Texture wrap modes."] pub type GPU_TEXTURE_WRAP_PARAM = ::libc::c_uint; -#[doc = "2D texture"] -#[doc = ""] - +#[doc = "< 2D texture"] pub const GPU_TEX_2D: GPU_TEXTURE_MODE_PARAM = 0; -#[doc = "Cube map"] -#[doc = ""] - +#[doc = "< Cube map"] pub const GPU_TEX_CUBE_MAP: GPU_TEXTURE_MODE_PARAM = 1; -#[doc = "2D Shadow texture"] -#[doc = ""] - +#[doc = "< 2D Shadow texture"] pub const GPU_TEX_SHADOW_2D: GPU_TEXTURE_MODE_PARAM = 2; -#[doc = "Projection texture"] -#[doc = ""] - +#[doc = "< Projection texture"] pub const GPU_TEX_PROJECTION: GPU_TEXTURE_MODE_PARAM = 3; -#[doc = "Shadow cube map"] -#[doc = ""] - +#[doc = "< Shadow cube map"] pub const GPU_TEX_SHADOW_CUBE: GPU_TEXTURE_MODE_PARAM = 4; -#[doc = "Disabled"] -#[doc = ""] - +#[doc = "< Disabled"] pub const GPU_TEX_DISABLED: GPU_TEXTURE_MODE_PARAM = 5; -#[doc = "Texture modes."] -#[doc = ""] - +#[doc = " Texture modes."] pub type GPU_TEXTURE_MODE_PARAM = ::libc::c_uint; -#[doc = "Texture unit 0."] -#[doc = ""] - +#[doc = "< Texture unit 0."] pub const GPU_TEXUNIT0: GPU_TEXUNIT = 1; -#[doc = "Texture unit 1."] -#[doc = ""] - +#[doc = "< Texture unit 1."] pub const GPU_TEXUNIT1: GPU_TEXUNIT = 2; -#[doc = "Texture unit 2."] -#[doc = ""] - +#[doc = "< Texture unit 2."] pub const GPU_TEXUNIT2: GPU_TEXUNIT = 4; -#[doc = "Supported texture units."] -#[doc = ""] - +#[doc = " Supported texture units."] pub type GPU_TEXUNIT = ::libc::c_uint; -#[doc = "8-bit Red + 8-bit Green + 8-bit Blue + 8-bit Alpha"] -#[doc = ""] - +#[doc = "< 8-bit Red + 8-bit Green + 8-bit Blue + 8-bit Alpha"] pub const GPU_RGBA8: GPU_TEXCOLOR = 0; -#[doc = "8-bit Red + 8-bit Green + 8-bit Blue"] -#[doc = ""] - +#[doc = "< 8-bit Red + 8-bit Green + 8-bit Blue"] pub const GPU_RGB8: GPU_TEXCOLOR = 1; -#[doc = "5-bit Red + 5-bit Green + 5-bit Blue + 1-bit Alpha"] -#[doc = ""] - +#[doc = "< 5-bit Red + 5-bit Green + 5-bit Blue + 1-bit Alpha"] pub const GPU_RGBA5551: GPU_TEXCOLOR = 2; -#[doc = "5-bit Red + 6-bit Green + 5-bit Blue"] -#[doc = ""] - +#[doc = "< 5-bit Red + 6-bit Green + 5-bit Blue"] pub const GPU_RGB565: GPU_TEXCOLOR = 3; -#[doc = "4-bit Red + 4-bit Green + 4-bit Blue + 4-bit Alpha"] -#[doc = ""] - +#[doc = "< 4-bit Red + 4-bit Green + 4-bit Blue + 4-bit Alpha"] pub const GPU_RGBA4: GPU_TEXCOLOR = 4; -#[doc = "8-bit Luminance + 8-bit Alpha"] -#[doc = ""] - +#[doc = "< 8-bit Luminance + 8-bit Alpha"] pub const GPU_LA8: GPU_TEXCOLOR = 5; -#[doc = "8-bit Hi + 8-bit Lo"] -#[doc = ""] - +#[doc = "< 8-bit Hi + 8-bit Lo"] pub const GPU_HILO8: GPU_TEXCOLOR = 6; -#[doc = "8-bit Luminance"] -#[doc = ""] - +#[doc = "< 8-bit Luminance"] pub const GPU_L8: GPU_TEXCOLOR = 7; -#[doc = "8-bit Alpha"] -#[doc = ""] - +#[doc = "< 8-bit Alpha"] pub const GPU_A8: GPU_TEXCOLOR = 8; -#[doc = "4-bit Luminance + 4-bit Alpha"] -#[doc = ""] - +#[doc = "< 4-bit Luminance + 4-bit Alpha"] pub const GPU_LA4: GPU_TEXCOLOR = 9; -#[doc = "4-bit Luminance"] -#[doc = ""] - +#[doc = "< 4-bit Luminance"] pub const GPU_L4: GPU_TEXCOLOR = 10; -#[doc = "4-bit Alpha"] -#[doc = ""] - +#[doc = "< 4-bit Alpha"] pub const GPU_A4: GPU_TEXCOLOR = 11; -#[doc = "ETC1 texture compression"] -#[doc = ""] - +#[doc = "< ETC1 texture compression"] pub const GPU_ETC1: GPU_TEXCOLOR = 12; -#[doc = "ETC1 texture compression + 4-bit Alpha"] -#[doc = ""] - +#[doc = "< ETC1 texture compression + 4-bit Alpha"] pub const GPU_ETC1A4: GPU_TEXCOLOR = 13; -#[doc = "Supported texture formats."] -#[doc = ""] - +#[doc = " Supported texture formats."] pub type GPU_TEXCOLOR = ::libc::c_uint; -#[doc = "2D face"] -#[doc = ""] - +#[doc = "< 2D face"] pub const GPU_TEXFACE_2D: GPU_TEXFACE = 0; -#[doc = "+X face"] -#[doc = ""] - +#[doc = "< +X face"] pub const GPU_POSITIVE_X: GPU_TEXFACE = 0; -#[doc = "-X face"] -#[doc = ""] - +#[doc = "< -X face"] pub const GPU_NEGATIVE_X: GPU_TEXFACE = 1; -#[doc = "+Y face"] -#[doc = ""] - +#[doc = "< +Y face"] pub const GPU_POSITIVE_Y: GPU_TEXFACE = 2; -#[doc = "-Y face"] -#[doc = ""] - +#[doc = "< -Y face"] pub const GPU_NEGATIVE_Y: GPU_TEXFACE = 3; -#[doc = "+Z face"] -#[doc = ""] - +#[doc = "< +Z face"] pub const GPU_POSITIVE_Z: GPU_TEXFACE = 4; -#[doc = "-Z face"] -#[doc = ""] - +#[doc = "< -Z face"] pub const GPU_NEGATIVE_Z: GPU_TEXFACE = 5; -#[doc = "Texture faces."] -#[doc = ""] - +#[doc = " Texture faces."] pub type GPU_TEXFACE = ::libc::c_uint; -#[doc = "Clamp to zero."] -#[doc = ""] - +#[doc = "< Clamp to zero."] pub const GPU_PT_CLAMP_TO_ZERO: GPU_PROCTEX_CLAMP = 0; -#[doc = "Clamp to edge."] -#[doc = ""] - +#[doc = "< Clamp to edge."] pub const GPU_PT_CLAMP_TO_EDGE: GPU_PROCTEX_CLAMP = 1; -#[doc = "Symmetrical repeat."] -#[doc = ""] - +#[doc = "< Symmetrical repeat."] pub const GPU_PT_REPEAT: GPU_PROCTEX_CLAMP = 2; -#[doc = "Mirrored repeat."] -#[doc = ""] - +#[doc = "< Mirrored repeat."] pub const GPU_PT_MIRRORED_REPEAT: GPU_PROCTEX_CLAMP = 3; -#[doc = "Pulse."] -#[doc = ""] - +#[doc = "< Pulse."] pub const GPU_PT_PULSE: GPU_PROCTEX_CLAMP = 4; -#[doc = "Procedural texture clamp modes."] -#[doc = ""] - +#[doc = " Procedural texture clamp modes."] pub type GPU_PROCTEX_CLAMP = ::libc::c_uint; -#[doc = "U"] -#[doc = ""] - +#[doc = "< U"] pub const GPU_PT_U: GPU_PROCTEX_MAPFUNC = 0; -#[doc = "U2"] -#[doc = ""] - +#[doc = "< U2"] pub const GPU_PT_U2: GPU_PROCTEX_MAPFUNC = 1; -#[doc = "V"] -#[doc = ""] - +#[doc = "< V"] pub const GPU_PT_V: GPU_PROCTEX_MAPFUNC = 2; -#[doc = "V2"] -#[doc = ""] - +#[doc = "< V2"] pub const GPU_PT_V2: GPU_PROCTEX_MAPFUNC = 3; -#[doc = "U+V"] -#[doc = ""] - +#[doc = "< U+V"] pub const GPU_PT_ADD: GPU_PROCTEX_MAPFUNC = 4; -#[doc = "U2+V2"] -#[doc = ""] - +#[doc = "< U2+V2"] pub const GPU_PT_ADD2: GPU_PROCTEX_MAPFUNC = 5; -#[doc = "sqrt(U2+V2)"] -#[doc = ""] - +#[doc = "< sqrt(U2+V2)"] pub const GPU_PT_SQRT2: GPU_PROCTEX_MAPFUNC = 6; -#[doc = "min"] -#[doc = ""] - +#[doc = "< min"] pub const GPU_PT_MIN: GPU_PROCTEX_MAPFUNC = 7; -#[doc = "max"] -#[doc = ""] - +#[doc = "< max"] pub const GPU_PT_MAX: GPU_PROCTEX_MAPFUNC = 8; -#[doc = "rmax"] -#[doc = ""] - +#[doc = "< rmax"] pub const GPU_PT_RMAX: GPU_PROCTEX_MAPFUNC = 9; -#[doc = "Procedural texture mapping functions."] -#[doc = ""] - +#[doc = " Procedural texture mapping functions."] pub type GPU_PROCTEX_MAPFUNC = ::libc::c_uint; -#[doc = "No shift."] -#[doc = ""] - +#[doc = "< No shift."] pub const GPU_PT_NONE: GPU_PROCTEX_SHIFT = 0; -#[doc = "Odd shift."] -#[doc = ""] - +#[doc = "< Odd shift."] pub const GPU_PT_ODD: GPU_PROCTEX_SHIFT = 1; -#[doc = "Even shift."] -#[doc = ""] - +#[doc = "< Even shift."] pub const GPU_PT_EVEN: GPU_PROCTEX_SHIFT = 2; -#[doc = "Procedural texture shift values."] -#[doc = ""] - +#[doc = " Procedural texture shift values."] pub type GPU_PROCTEX_SHIFT = ::libc::c_uint; -#[doc = "Nearest-neighbor"] -#[doc = ""] - +#[doc = "< Nearest-neighbor"] pub const GPU_PT_NEAREST: GPU_PROCTEX_FILTER = 0; -#[doc = "Linear interpolation"] -#[doc = ""] - +#[doc = "< Linear interpolation"] pub const GPU_PT_LINEAR: GPU_PROCTEX_FILTER = 1; -#[doc = "Nearest-neighbor with mipmap using nearest-neighbor"] -#[doc = ""] - +#[doc = "< Nearest-neighbor with mipmap using nearest-neighbor"] pub const GPU_PT_NEAREST_MIP_NEAREST: GPU_PROCTEX_FILTER = 2; -#[doc = "Linear interpolation with mipmap using nearest-neighbor"] -#[doc = ""] - +#[doc = "< Linear interpolation with mipmap using nearest-neighbor"] pub const GPU_PT_LINEAR_MIP_NEAREST: GPU_PROCTEX_FILTER = 3; -#[doc = "Nearest-neighbor with mipmap using linear interpolation"] -#[doc = ""] - +#[doc = "< Nearest-neighbor with mipmap using linear interpolation"] pub const GPU_PT_NEAREST_MIP_LINEAR: GPU_PROCTEX_FILTER = 4; -#[doc = "Linear interpolation with mipmap using linear interpolation"] -#[doc = ""] - +#[doc = "< Linear interpolation with mipmap using linear interpolation"] pub const GPU_PT_LINEAR_MIP_LINEAR: GPU_PROCTEX_FILTER = 5; -#[doc = "Procedural texture filter values."] -#[doc = ""] - +#[doc = " Procedural texture filter values."] pub type GPU_PROCTEX_FILTER = ::libc::c_uint; -#[doc = "Noise table"] -#[doc = ""] - +#[doc = "< Noise table"] pub const GPU_LUT_NOISE: GPU_PROCTEX_LUTID = 0; -#[doc = "RGB mapping function table"] -#[doc = ""] - +#[doc = "< RGB mapping function table"] pub const GPU_LUT_RGBMAP: GPU_PROCTEX_LUTID = 2; -#[doc = "Alpha mapping function table"] -#[doc = ""] - +#[doc = "< Alpha mapping function table"] pub const GPU_LUT_ALPHAMAP: GPU_PROCTEX_LUTID = 3; -#[doc = "Color table"] -#[doc = ""] - +#[doc = "< Color table"] pub const GPU_LUT_COLOR: GPU_PROCTEX_LUTID = 4; -#[doc = "Color difference table"] -#[doc = ""] - +#[doc = "< Color difference table"] pub const GPU_LUT_COLORDIF: GPU_PROCTEX_LUTID = 5; -#[doc = "Procedural texture LUT IDs."] -#[doc = ""] - +#[doc = " Procedural texture LUT IDs."] pub type GPU_PROCTEX_LUTID = ::libc::c_uint; -#[doc = "8-bit Red + 8-bit Green + 8-bit Blue + 8-bit Alpha"] -#[doc = ""] - +#[doc = "< 8-bit Red + 8-bit Green + 8-bit Blue + 8-bit Alpha"] pub const GPU_RB_RGBA8: GPU_COLORBUF = 0; -#[doc = "8-bit Red + 8-bit Green + 8-bit Blue"] -#[doc = ""] - +#[doc = "< 8-bit Red + 8-bit Green + 8-bit Blue"] pub const GPU_RB_RGB8: GPU_COLORBUF = 1; -#[doc = "5-bit Red + 5-bit Green + 5-bit Blue + 1-bit Alpha"] -#[doc = ""] - +#[doc = "< 5-bit Red + 5-bit Green + 5-bit Blue + 1-bit Alpha"] pub const GPU_RB_RGBA5551: GPU_COLORBUF = 2; -#[doc = "5-bit Red + 6-bit Green + 5-bit Blue"] -#[doc = ""] - +#[doc = "< 5-bit Red + 6-bit Green + 5-bit Blue"] pub const GPU_RB_RGB565: GPU_COLORBUF = 3; -#[doc = "4-bit Red + 4-bit Green + 4-bit Blue + 4-bit Alpha"] -#[doc = ""] - +#[doc = "< 4-bit Red + 4-bit Green + 4-bit Blue + 4-bit Alpha"] pub const GPU_RB_RGBA4: GPU_COLORBUF = 4; -#[doc = "Supported color buffer formats."] -#[doc = ""] - +#[doc = " Supported color buffer formats."] pub type GPU_COLORBUF = ::libc::c_uint; -#[doc = "16-bit Depth"] -#[doc = ""] - +#[doc = "< 16-bit Depth"] pub const GPU_RB_DEPTH16: GPU_DEPTHBUF = 0; -#[doc = "24-bit Depth"] -#[doc = ""] - +#[doc = "< 24-bit Depth"] pub const GPU_RB_DEPTH24: GPU_DEPTHBUF = 2; -#[doc = "24-bit Depth + 8-bit Stencil"] -#[doc = ""] - +#[doc = "< 24-bit Depth + 8-bit Stencil"] pub const GPU_RB_DEPTH24_STENCIL8: GPU_DEPTHBUF = 3; -#[doc = "Supported depth buffer formats."] -#[doc = ""] - +#[doc = " Supported depth buffer formats."] pub type GPU_DEPTHBUF = ::libc::c_uint; -#[doc = "Never pass."] -#[doc = ""] - +#[doc = "< Never pass."] pub const GPU_NEVER: GPU_TESTFUNC = 0; -#[doc = "Always pass."] -#[doc = ""] - +#[doc = "< Always pass."] pub const GPU_ALWAYS: GPU_TESTFUNC = 1; -#[doc = "Pass if equal."] -#[doc = ""] - +#[doc = "< Pass if equal."] pub const GPU_EQUAL: GPU_TESTFUNC = 2; -#[doc = "Pass if not equal."] -#[doc = ""] - +#[doc = "< Pass if not equal."] pub const GPU_NOTEQUAL: GPU_TESTFUNC = 3; -#[doc = "Pass if less than."] -#[doc = ""] - +#[doc = "< Pass if less than."] pub const GPU_LESS: GPU_TESTFUNC = 4; -#[doc = "Pass if less than or equal."] -#[doc = ""] - +#[doc = "< Pass if less than or equal."] pub const GPU_LEQUAL: GPU_TESTFUNC = 5; -#[doc = "Pass if greater than."] -#[doc = ""] - +#[doc = "< Pass if greater than."] pub const GPU_GREATER: GPU_TESTFUNC = 6; -#[doc = "Pass if greater than or equal."] -#[doc = ""] - +#[doc = "< Pass if greater than or equal."] pub const GPU_GEQUAL: GPU_TESTFUNC = 7; -#[doc = "Test functions."] -#[doc = ""] - +#[doc = " Test functions."] pub type GPU_TESTFUNC = ::libc::c_uint; -#[doc = "Pass if greater than or equal."] -#[doc = ""] - +#[doc = "< Pass if greater than or equal."] pub const GPU_EARLYDEPTH_GEQUAL: GPU_EARLYDEPTHFUNC = 0; -#[doc = "Pass if greater than."] -#[doc = ""] - +#[doc = "< Pass if greater than."] pub const GPU_EARLYDEPTH_GREATER: GPU_EARLYDEPTHFUNC = 1; -#[doc = "Pass if less than or equal."] -#[doc = ""] - +#[doc = "< Pass if less than or equal."] pub const GPU_EARLYDEPTH_LEQUAL: GPU_EARLYDEPTHFUNC = 2; -#[doc = "Pass if less than."] -#[doc = ""] - +#[doc = "< Pass if less than."] pub const GPU_EARLYDEPTH_LESS: GPU_EARLYDEPTHFUNC = 3; -#[doc = "Early depth test functions."] -#[doc = ""] - +#[doc = " Early depth test functions."] pub type GPU_EARLYDEPTHFUNC = ::libc::c_uint; -#[doc = "Never pass (0)."] -#[doc = ""] - +#[doc = "< Never pass (0)."] pub const GPU_GAS_NEVER: GPU_GASDEPTHFUNC = 0; -#[doc = "Always pass (1)."] -#[doc = ""] - +#[doc = "< Always pass (1)."] pub const GPU_GAS_ALWAYS: GPU_GASDEPTHFUNC = 1; -#[doc = "Pass if greater than (1-X)."] -#[doc = ""] - +#[doc = "< Pass if greater than (1-X)."] pub const GPU_GAS_GREATER: GPU_GASDEPTHFUNC = 2; -#[doc = "Pass if less than (X)."] -#[doc = ""] - +#[doc = "< Pass if less than (X)."] pub const GPU_GAS_LESS: GPU_GASDEPTHFUNC = 3; -#[doc = "Gas depth functions."] -#[doc = ""] - +#[doc = " Gas depth functions."] pub type GPU_GASDEPTHFUNC = ::libc::c_uint; -#[doc = "Disable."] -#[doc = ""] - +#[doc = "< Disable."] pub const GPU_SCISSOR_DISABLE: GPU_SCISSORMODE = 0; -#[doc = "Exclude pixels inside the scissor box."] -#[doc = ""] - +#[doc = "< Exclude pixels inside the scissor box."] pub const GPU_SCISSOR_INVERT: GPU_SCISSORMODE = 1; -#[doc = "Exclude pixels outside of the scissor box."] -#[doc = ""] - +#[doc = "< Exclude pixels outside of the scissor box."] pub const GPU_SCISSOR_NORMAL: GPU_SCISSORMODE = 3; -#[doc = "Scissor test modes."] -#[doc = ""] - +#[doc = " Scissor test modes."] pub type GPU_SCISSORMODE = ::libc::c_uint; -#[doc = "Keep old value. (old_stencil)"] -#[doc = ""] - +#[doc = "< Keep old value. (old_stencil)"] pub const GPU_STENCIL_KEEP: GPU_STENCILOP = 0; -#[doc = "Zero. (0)"] -#[doc = ""] - +#[doc = "< Zero. (0)"] pub const GPU_STENCIL_ZERO: GPU_STENCILOP = 1; -#[doc = "Replace value. (ref)"] -#[doc = ""] - +#[doc = "< Replace value. (ref)"] pub const GPU_STENCIL_REPLACE: GPU_STENCILOP = 2; -#[doc = "Increment value. (old_stencil + 1 saturated to [0, 255])"] -#[doc = ""] - +#[doc = "< Increment value. (old_stencil + 1 saturated to [0, 255])"] pub const GPU_STENCIL_INCR: GPU_STENCILOP = 3; -#[doc = "Decrement value. (old_stencil - 1 saturated to [0, 255])"] -#[doc = ""] - +#[doc = "< Decrement value. (old_stencil - 1 saturated to [0, 255])"] pub const GPU_STENCIL_DECR: GPU_STENCILOP = 4; -#[doc = "Invert value. (~old_stencil)"] -#[doc = ""] - +#[doc = "< Invert value. (~old_stencil)"] pub const GPU_STENCIL_INVERT: GPU_STENCILOP = 5; -#[doc = "Increment value. (old_stencil + 1)"] -#[doc = ""] - +#[doc = "< Increment value. (old_stencil + 1)"] pub const GPU_STENCIL_INCR_WRAP: GPU_STENCILOP = 6; -#[doc = "Decrement value. (old_stencil - 1)"] -#[doc = ""] - +#[doc = "< Decrement value. (old_stencil - 1)"] pub const GPU_STENCIL_DECR_WRAP: GPU_STENCILOP = 7; -#[doc = "Stencil operations."] -#[doc = ""] - +#[doc = " Stencil operations."] pub type GPU_STENCILOP = ::libc::c_uint; -#[doc = "Write red."] -#[doc = ""] - +#[doc = "< Write red."] pub const GPU_WRITE_RED: GPU_WRITEMASK = 1; -#[doc = "Write green."] -#[doc = ""] - +#[doc = "< Write green."] pub const GPU_WRITE_GREEN: GPU_WRITEMASK = 2; -#[doc = "Write blue."] -#[doc = ""] - +#[doc = "< Write blue."] pub const GPU_WRITE_BLUE: GPU_WRITEMASK = 4; -#[doc = "Write alpha."] -#[doc = ""] - +#[doc = "< Write alpha."] pub const GPU_WRITE_ALPHA: GPU_WRITEMASK = 8; -#[doc = "Write depth."] -#[doc = ""] - +#[doc = "< Write depth."] pub const GPU_WRITE_DEPTH: GPU_WRITEMASK = 16; -#[doc = "Write all color components."] -#[doc = ""] - +#[doc = "< Write all color components."] pub const GPU_WRITE_COLOR: GPU_WRITEMASK = 15; -#[doc = "Write all components."] -#[doc = ""] - +#[doc = "< Write all components."] pub const GPU_WRITE_ALL: GPU_WRITEMASK = 31; -#[doc = "Pixel write mask."] -#[doc = ""] - +#[doc = " Pixel write mask."] pub type GPU_WRITEMASK = ::libc::c_uint; -#[doc = "Add colors."] -#[doc = ""] - +#[doc = "< Add colors."] pub const GPU_BLEND_ADD: GPU_BLENDEQUATION = 0; -#[doc = "Subtract colors."] -#[doc = ""] - +#[doc = "< Subtract colors."] pub const GPU_BLEND_SUBTRACT: GPU_BLENDEQUATION = 1; -#[doc = "Reverse-subtract colors."] -#[doc = ""] - +#[doc = "< Reverse-subtract colors."] pub const GPU_BLEND_REVERSE_SUBTRACT: GPU_BLENDEQUATION = 2; -#[doc = "Use the minimum color."] -#[doc = ""] - +#[doc = "< Use the minimum color."] pub const GPU_BLEND_MIN: GPU_BLENDEQUATION = 3; -#[doc = "Use the maximum color."] -#[doc = ""] - +#[doc = "< Use the maximum color."] pub const GPU_BLEND_MAX: GPU_BLENDEQUATION = 4; -#[doc = "Blend modes."] -#[doc = ""] - +#[doc = " Blend modes."] pub type GPU_BLENDEQUATION = ::libc::c_uint; -#[doc = "Zero."] -#[doc = ""] - +#[doc = "< Zero."] pub const GPU_ZERO: GPU_BLENDFACTOR = 0; -#[doc = "One."] -#[doc = ""] - +#[doc = "< One."] pub const GPU_ONE: GPU_BLENDFACTOR = 1; -#[doc = "Source color."] -#[doc = ""] - +#[doc = "< Source color."] pub const GPU_SRC_COLOR: GPU_BLENDFACTOR = 2; -#[doc = "Source color - 1."] -#[doc = ""] - +#[doc = "< Source color - 1."] pub const GPU_ONE_MINUS_SRC_COLOR: GPU_BLENDFACTOR = 3; -#[doc = "Destination color."] -#[doc = ""] - +#[doc = "< Destination color."] pub const GPU_DST_COLOR: GPU_BLENDFACTOR = 4; -#[doc = "Destination color - 1."] -#[doc = ""] - +#[doc = "< Destination color - 1."] pub const GPU_ONE_MINUS_DST_COLOR: GPU_BLENDFACTOR = 5; -#[doc = "Source alpha."] -#[doc = ""] - +#[doc = "< Source alpha."] pub const GPU_SRC_ALPHA: GPU_BLENDFACTOR = 6; -#[doc = "Source alpha - 1."] -#[doc = ""] - +#[doc = "< Source alpha - 1."] pub const GPU_ONE_MINUS_SRC_ALPHA: GPU_BLENDFACTOR = 7; -#[doc = "Destination alpha."] -#[doc = ""] - +#[doc = "< Destination alpha."] pub const GPU_DST_ALPHA: GPU_BLENDFACTOR = 8; -#[doc = "Destination alpha - 1."] -#[doc = ""] - +#[doc = "< Destination alpha - 1."] pub const GPU_ONE_MINUS_DST_ALPHA: GPU_BLENDFACTOR = 9; -#[doc = "Constant color."] -#[doc = ""] - +#[doc = "< Constant color."] pub const GPU_CONSTANT_COLOR: GPU_BLENDFACTOR = 10; -#[doc = "Constant color - 1."] -#[doc = ""] - +#[doc = "< Constant color - 1."] pub const GPU_ONE_MINUS_CONSTANT_COLOR: GPU_BLENDFACTOR = 11; -#[doc = "Constant alpha."] -#[doc = ""] - +#[doc = "< Constant alpha."] pub const GPU_CONSTANT_ALPHA: GPU_BLENDFACTOR = 12; -#[doc = "Constant alpha - 1."] -#[doc = ""] - +#[doc = "< Constant alpha - 1."] pub const GPU_ONE_MINUS_CONSTANT_ALPHA: GPU_BLENDFACTOR = 13; -#[doc = "Saturated alpha."] -#[doc = ""] - +#[doc = "< Saturated alpha."] pub const GPU_SRC_ALPHA_SATURATE: GPU_BLENDFACTOR = 14; -#[doc = "Blend factors."] -#[doc = ""] - +#[doc = " Blend factors."] pub type GPU_BLENDFACTOR = ::libc::c_uint; -#[doc = "Clear."] -#[doc = ""] - +#[doc = "< Clear."] pub const GPU_LOGICOP_CLEAR: GPU_LOGICOP = 0; -#[doc = "Bitwise AND."] -#[doc = ""] - +#[doc = "< Bitwise AND."] pub const GPU_LOGICOP_AND: GPU_LOGICOP = 1; -#[doc = "Reverse bitwise AND."] -#[doc = ""] - +#[doc = "< Reverse bitwise AND."] pub const GPU_LOGICOP_AND_REVERSE: GPU_LOGICOP = 2; -#[doc = "Copy."] -#[doc = ""] - +#[doc = "< Copy."] pub const GPU_LOGICOP_COPY: GPU_LOGICOP = 3; -#[doc = "Set."] -#[doc = ""] - +#[doc = "< Set."] pub const GPU_LOGICOP_SET: GPU_LOGICOP = 4; -#[doc = "Inverted copy."] -#[doc = ""] - +#[doc = "< Inverted copy."] pub const GPU_LOGICOP_COPY_INVERTED: GPU_LOGICOP = 5; -#[doc = "No operation."] -#[doc = ""] - +#[doc = "< No operation."] pub const GPU_LOGICOP_NOOP: GPU_LOGICOP = 6; -#[doc = "Invert."] -#[doc = ""] - +#[doc = "< Invert."] pub const GPU_LOGICOP_INVERT: GPU_LOGICOP = 7; -#[doc = "Bitwise NAND."] -#[doc = ""] - +#[doc = "< Bitwise NAND."] pub const GPU_LOGICOP_NAND: GPU_LOGICOP = 8; -#[doc = "Bitwise OR."] -#[doc = ""] - +#[doc = "< Bitwise OR."] pub const GPU_LOGICOP_OR: GPU_LOGICOP = 9; -#[doc = "Bitwise NOR."] -#[doc = ""] - +#[doc = "< Bitwise NOR."] pub const GPU_LOGICOP_NOR: GPU_LOGICOP = 10; -#[doc = "Bitwise XOR."] -#[doc = ""] - +#[doc = "< Bitwise XOR."] pub const GPU_LOGICOP_XOR: GPU_LOGICOP = 11; -#[doc = "Equivalent."] -#[doc = ""] - +#[doc = "< Equivalent."] pub const GPU_LOGICOP_EQUIV: GPU_LOGICOP = 12; -#[doc = "Inverted bitwise AND."] -#[doc = ""] - +#[doc = "< Inverted bitwise AND."] pub const GPU_LOGICOP_AND_INVERTED: GPU_LOGICOP = 13; -#[doc = "Reverse bitwise OR."] -#[doc = ""] - +#[doc = "< Reverse bitwise OR."] pub const GPU_LOGICOP_OR_REVERSE: GPU_LOGICOP = 14; -#[doc = "Inverted bitwize OR."] -#[doc = ""] - +#[doc = "< Inverted bitwize OR."] pub const GPU_LOGICOP_OR_INVERTED: GPU_LOGICOP = 15; -#[doc = "Logical operations."] -#[doc = ""] - +#[doc = " Logical operations."] pub type GPU_LOGICOP = ::libc::c_uint; -#[doc = "OpenGL mode."] -#[doc = ""] - +#[doc = "< OpenGL mode."] pub const GPU_FRAGOPMODE_GL: GPU_FRAGOPMODE = 0; -#[doc = "Gas mode (?)."] -#[doc = ""] - +#[doc = "< Gas mode (?)."] pub const GPU_FRAGOPMODE_GAS_ACC: GPU_FRAGOPMODE = 1; -#[doc = "Shadow mode (?)."] -#[doc = ""] - +#[doc = "< Shadow mode (?)."] pub const GPU_FRAGOPMODE_SHADOW: GPU_FRAGOPMODE = 3; -#[doc = "Fragment operation modes."] -#[doc = ""] - +#[doc = " Fragment operation modes."] pub type GPU_FRAGOPMODE = ::libc::c_uint; -#[doc = "8-bit byte."] -#[doc = ""] - +#[doc = "< 8-bit byte."] pub const GPU_BYTE: GPU_FORMATS = 0; -#[doc = "8-bit unsigned byte."] -#[doc = ""] - +#[doc = "< 8-bit unsigned byte."] pub const GPU_UNSIGNED_BYTE: GPU_FORMATS = 1; -#[doc = "16-bit short."] -#[doc = ""] - +#[doc = "< 16-bit short."] pub const GPU_SHORT: GPU_FORMATS = 2; -#[doc = "32-bit float."] -#[doc = ""] - +#[doc = "< 32-bit float."] pub const GPU_FLOAT: GPU_FORMATS = 3; -#[doc = "Supported component formats."] -#[doc = ""] - +#[doc = " Supported component formats."] pub type GPU_FORMATS = ::libc::c_uint; -#[doc = "Disabled."] -#[doc = ""] - +#[doc = "< Disabled."] pub const GPU_CULL_NONE: GPU_CULLMODE = 0; -#[doc = "Front, counter-clockwise."] -#[doc = ""] - +#[doc = "< Front, counter-clockwise."] pub const GPU_CULL_FRONT_CCW: GPU_CULLMODE = 1; -#[doc = "Back, counter-clockwise."] -#[doc = ""] - +#[doc = "< Back, counter-clockwise."] pub const GPU_CULL_BACK_CCW: GPU_CULLMODE = 2; -#[doc = "Cull modes."] -#[doc = ""] - +#[doc = " Cull modes."] pub type GPU_CULLMODE = ::libc::c_uint; -#[doc = "Primary color."] -#[doc = ""] - +#[doc = "< Primary color."] pub const GPU_PRIMARY_COLOR: GPU_TEVSRC = 0; -#[doc = "Primary fragment color."] -#[doc = ""] - +#[doc = "< Primary fragment color."] pub const GPU_FRAGMENT_PRIMARY_COLOR: GPU_TEVSRC = 1; -#[doc = "Secondary fragment color."] -#[doc = ""] - +#[doc = "< Secondary fragment color."] pub const GPU_FRAGMENT_SECONDARY_COLOR: GPU_TEVSRC = 2; -#[doc = "Texture unit 0."] -#[doc = ""] - +#[doc = "< Texture unit 0."] pub const GPU_TEXTURE0: GPU_TEVSRC = 3; -#[doc = "Texture unit 1."] -#[doc = ""] - +#[doc = "< Texture unit 1."] pub const GPU_TEXTURE1: GPU_TEVSRC = 4; -#[doc = "Texture unit 2."] -#[doc = ""] - +#[doc = "< Texture unit 2."] pub const GPU_TEXTURE2: GPU_TEVSRC = 5; -#[doc = "Texture unit 3."] -#[doc = ""] - +#[doc = "< Texture unit 3."] pub const GPU_TEXTURE3: GPU_TEVSRC = 6; -#[doc = "Previous buffer."] -#[doc = ""] - +#[doc = "< Previous buffer."] pub const GPU_PREVIOUS_BUFFER: GPU_TEVSRC = 13; -#[doc = "Constant value."] -#[doc = ""] - +#[doc = "< Constant value."] pub const GPU_CONSTANT: GPU_TEVSRC = 14; -#[doc = "Previous value."] -#[doc = ""] - +#[doc = "< Previous value."] pub const GPU_PREVIOUS: GPU_TEVSRC = 15; -#[doc = "Texture combiner sources."] -#[doc = ""] - +#[doc = " Texture combiner sources."] pub type GPU_TEVSRC = ::libc::c_uint; -#[doc = "Source color."] -#[doc = ""] - +#[doc = "< Source color."] pub const GPU_TEVOP_RGB_SRC_COLOR: GPU_TEVOP_RGB = 0; -#[doc = "Source color - 1."] -#[doc = ""] - +#[doc = "< Source color - 1."] pub const GPU_TEVOP_RGB_ONE_MINUS_SRC_COLOR: GPU_TEVOP_RGB = 1; -#[doc = "Source alpha."] -#[doc = ""] - +#[doc = "< Source alpha."] pub const GPU_TEVOP_RGB_SRC_ALPHA: GPU_TEVOP_RGB = 2; -#[doc = "Source alpha - 1."] -#[doc = ""] - +#[doc = "< Source alpha - 1."] pub const GPU_TEVOP_RGB_ONE_MINUS_SRC_ALPHA: GPU_TEVOP_RGB = 3; -#[doc = "Source red."] -#[doc = ""] - +#[doc = "< Source red."] pub const GPU_TEVOP_RGB_SRC_R: GPU_TEVOP_RGB = 4; -#[doc = "Source red - 1."] -#[doc = ""] - +#[doc = "< Source red - 1."] pub const GPU_TEVOP_RGB_ONE_MINUS_SRC_R: GPU_TEVOP_RGB = 5; -#[doc = "Unknown."] -#[doc = ""] - +#[doc = "< Unknown."] pub const GPU_TEVOP_RGB_0x06: GPU_TEVOP_RGB = 6; -#[doc = "Unknown."] -#[doc = ""] - +#[doc = "< Unknown."] pub const GPU_TEVOP_RGB_0x07: GPU_TEVOP_RGB = 7; -#[doc = "Source green."] -#[doc = ""] - +#[doc = "< Source green."] pub const GPU_TEVOP_RGB_SRC_G: GPU_TEVOP_RGB = 8; -#[doc = "Source green - 1."] -#[doc = ""] - +#[doc = "< Source green - 1."] pub const GPU_TEVOP_RGB_ONE_MINUS_SRC_G: GPU_TEVOP_RGB = 9; -#[doc = "Unknown."] -#[doc = ""] - +#[doc = "< Unknown."] pub const GPU_TEVOP_RGB_0x0A: GPU_TEVOP_RGB = 10; -#[doc = "Unknown."] -#[doc = ""] - +#[doc = "< Unknown."] pub const GPU_TEVOP_RGB_0x0B: GPU_TEVOP_RGB = 11; -#[doc = "Source blue."] -#[doc = ""] - +#[doc = "< Source blue."] pub const GPU_TEVOP_RGB_SRC_B: GPU_TEVOP_RGB = 12; -#[doc = "Source blue - 1."] -#[doc = ""] - +#[doc = "< Source blue - 1."] pub const GPU_TEVOP_RGB_ONE_MINUS_SRC_B: GPU_TEVOP_RGB = 13; -#[doc = "Unknown."] -#[doc = ""] - +#[doc = "< Unknown."] pub const GPU_TEVOP_RGB_0x0E: GPU_TEVOP_RGB = 14; -#[doc = "Unknown."] -#[doc = ""] - +#[doc = "< Unknown."] pub const GPU_TEVOP_RGB_0x0F: GPU_TEVOP_RGB = 15; -#[doc = "Texture RGB combiner operands."] -#[doc = ""] - +#[doc = " Texture RGB combiner operands."] pub type GPU_TEVOP_RGB = ::libc::c_uint; -#[doc = "Source alpha."] -#[doc = ""] - +#[doc = "< Source alpha."] pub const GPU_TEVOP_A_SRC_ALPHA: GPU_TEVOP_A = 0; -#[doc = "Source alpha - 1."] -#[doc = ""] - +#[doc = "< Source alpha - 1."] pub const GPU_TEVOP_A_ONE_MINUS_SRC_ALPHA: GPU_TEVOP_A = 1; -#[doc = "Source red."] -#[doc = ""] - +#[doc = "< Source red."] pub const GPU_TEVOP_A_SRC_R: GPU_TEVOP_A = 2; -#[doc = "Source red - 1."] -#[doc = ""] - +#[doc = "< Source red - 1."] pub const GPU_TEVOP_A_ONE_MINUS_SRC_R: GPU_TEVOP_A = 3; -#[doc = "Source green."] -#[doc = ""] - +#[doc = "< Source green."] pub const GPU_TEVOP_A_SRC_G: GPU_TEVOP_A = 4; -#[doc = "Source green - 1."] -#[doc = ""] - +#[doc = "< Source green - 1."] pub const GPU_TEVOP_A_ONE_MINUS_SRC_G: GPU_TEVOP_A = 5; -#[doc = "Source blue."] -#[doc = ""] - +#[doc = "< Source blue."] pub const GPU_TEVOP_A_SRC_B: GPU_TEVOP_A = 6; -#[doc = "Source blue - 1."] -#[doc = ""] - +#[doc = "< Source blue - 1."] pub const GPU_TEVOP_A_ONE_MINUS_SRC_B: GPU_TEVOP_A = 7; -#[doc = "Texture Alpha combiner operands."] -#[doc = ""] - +#[doc = " Texture Alpha combiner operands."] pub type GPU_TEVOP_A = ::libc::c_uint; -#[doc = "Replace."] -#[doc = ""] - +#[doc = "< Replace."] pub const GPU_REPLACE: GPU_COMBINEFUNC = 0; -#[doc = "Modulate."] -#[doc = ""] - +#[doc = "< Modulate."] pub const GPU_MODULATE: GPU_COMBINEFUNC = 1; -#[doc = "Add."] -#[doc = ""] - +#[doc = "< Add."] pub const GPU_ADD: GPU_COMBINEFUNC = 2; -#[doc = "Signed add."] -#[doc = ""] - +#[doc = "< Signed add."] pub const GPU_ADD_SIGNED: GPU_COMBINEFUNC = 3; -#[doc = "Interpolate."] -#[doc = ""] - +#[doc = "< Interpolate."] pub const GPU_INTERPOLATE: GPU_COMBINEFUNC = 4; -#[doc = "Subtract."] -#[doc = ""] - +#[doc = "< Subtract."] pub const GPU_SUBTRACT: GPU_COMBINEFUNC = 5; -#[doc = "Dot3. RGB only."] -#[doc = ""] - +#[doc = "< Dot3. RGB only."] pub const GPU_DOT3_RGB: GPU_COMBINEFUNC = 6; -#[doc = "Multiply then add."] -#[doc = ""] - +#[doc = "< Multiply then add."] pub const GPU_MULTIPLY_ADD: GPU_COMBINEFUNC = 8; -#[doc = "Add then multiply."] -#[doc = ""] - +#[doc = "< Add then multiply."] pub const GPU_ADD_MULTIPLY: GPU_COMBINEFUNC = 9; -#[doc = "Texture combiner functions."] -#[doc = ""] - +#[doc = " Texture combiner functions."] pub type GPU_COMBINEFUNC = ::libc::c_uint; -#[doc = "1x"] -#[doc = ""] - +#[doc = "< 1x"] pub const GPU_TEVSCALE_1: GPU_TEVSCALE = 0; -#[doc = "2x"] -#[doc = ""] - +#[doc = "< 2x"] pub const GPU_TEVSCALE_2: GPU_TEVSCALE = 1; -#[doc = "4x"] -#[doc = ""] - +#[doc = "< 4x"] pub const GPU_TEVSCALE_4: GPU_TEVSCALE = 2; -#[doc = "Texture scale factors."] -#[doc = ""] - +#[doc = " Texture scale factors."] pub type GPU_TEVSCALE = ::libc::c_uint; -#[doc = "None."] -#[doc = ""] - +#[doc = "< None."] pub const GPU_NO_FRESNEL: GPU_FRESNELSEL = 0; -#[doc = "Primary alpha."] -#[doc = ""] - +#[doc = "< Primary alpha."] pub const GPU_PRI_ALPHA_FRESNEL: GPU_FRESNELSEL = 1; -#[doc = "Secondary alpha."] -#[doc = ""] - +#[doc = "< Secondary alpha."] pub const GPU_SEC_ALPHA_FRESNEL: GPU_FRESNELSEL = 2; -#[doc = "Primary and secondary alpha."] -#[doc = ""] - +#[doc = "< Primary and secondary alpha."] pub const GPU_PRI_SEC_ALPHA_FRESNEL: GPU_FRESNELSEL = 3; -#[doc = "Fresnel options."] -#[doc = ""] - +#[doc = " Fresnel options."] pub type GPU_FRESNELSEL = ::libc::c_uint; -#[doc = "Disabled."] -#[doc = ""] - +#[doc = "< Disabled."] pub const GPU_BUMP_NOT_USED: GPU_BUMPMODE = 0; -#[doc = "Bump as bump mapping."] -#[doc = ""] - +#[doc = "< Bump as bump mapping."] pub const GPU_BUMP_AS_BUMP: GPU_BUMPMODE = 1; -#[doc = "Bump as tangent/normal mapping."] -#[doc = ""] - +#[doc = "< Bump as tangent/normal mapping."] pub const GPU_BUMP_AS_TANG: GPU_BUMPMODE = 2; -#[doc = "Bump map modes."] -#[doc = ""] - +#[doc = " Bump map modes."] pub type GPU_BUMPMODE = ::libc::c_uint; -#[doc = "D0 LUT."] -#[doc = ""] - +#[doc = "< D0 LUT."] pub const GPU_LUT_D0: GPU_LIGHTLUTID = 0; -#[doc = "D1 LUT."] -#[doc = ""] - +#[doc = "< D1 LUT."] pub const GPU_LUT_D1: GPU_LIGHTLUTID = 1; -#[doc = "Spotlight LUT."] -#[doc = ""] - +#[doc = "< Spotlight LUT."] pub const GPU_LUT_SP: GPU_LIGHTLUTID = 2; -#[doc = "Fresnel LUT."] -#[doc = ""] - +#[doc = "< Fresnel LUT."] pub const GPU_LUT_FR: GPU_LIGHTLUTID = 3; -#[doc = "Reflection-Blue LUT."] -#[doc = ""] - +#[doc = "< Reflection-Blue LUT."] pub const GPU_LUT_RB: GPU_LIGHTLUTID = 4; -#[doc = "Reflection-Green LUT."] -#[doc = ""] - +#[doc = "< Reflection-Green LUT."] pub const GPU_LUT_RG: GPU_LIGHTLUTID = 5; -#[doc = "Reflection-Red LUT."] -#[doc = ""] - +#[doc = "< Reflection-Red LUT."] pub const GPU_LUT_RR: GPU_LIGHTLUTID = 6; -#[doc = "Distance attenuation LUT."] -#[doc = ""] - +#[doc = "< Distance attenuation LUT."] pub const GPU_LUT_DA: GPU_LIGHTLUTID = 7; -#[doc = "LUT IDs."] -#[doc = ""] - +#[doc = " LUT IDs."] pub type GPU_LIGHTLUTID = ::libc::c_uint; -#[doc = "Normal*HalfVector"] -#[doc = ""] - +#[doc = "< Normal*HalfVector"] pub const GPU_LUTINPUT_NH: GPU_LIGHTLUTINPUT = 0; -#[doc = "View*HalfVector"] -#[doc = ""] - +#[doc = "< View*HalfVector"] pub const GPU_LUTINPUT_VH: GPU_LIGHTLUTINPUT = 1; -#[doc = "Normal*View"] -#[doc = ""] - +#[doc = "< Normal*View"] pub const GPU_LUTINPUT_NV: GPU_LIGHTLUTINPUT = 2; -#[doc = "LightVector*Normal"] -#[doc = ""] - +#[doc = "< LightVector*Normal"] pub const GPU_LUTINPUT_LN: GPU_LIGHTLUTINPUT = 3; -#[doc = "-LightVector*SpotlightVector"] -#[doc = ""] - +#[doc = "< -LightVector*SpotlightVector"] pub const GPU_LUTINPUT_SP: GPU_LIGHTLUTINPUT = 4; -#[doc = "cosine of phi"] -#[doc = ""] - +#[doc = "< cosine of phi"] pub const GPU_LUTINPUT_CP: GPU_LIGHTLUTINPUT = 5; -#[doc = "LUT inputs."] -#[doc = ""] - +#[doc = " LUT inputs."] pub type GPU_LIGHTLUTINPUT = ::libc::c_uint; -#[doc = "1x scale."] -#[doc = ""] - +#[doc = "< 1x scale."] pub const GPU_LUTSCALER_1x: GPU_LIGHTLUTSCALER = 0; -#[doc = "2x scale."] -#[doc = ""] - +#[doc = "< 2x scale."] pub const GPU_LUTSCALER_2x: GPU_LIGHTLUTSCALER = 1; -#[doc = "4x scale."] -#[doc = ""] - +#[doc = "< 4x scale."] pub const GPU_LUTSCALER_4x: GPU_LIGHTLUTSCALER = 2; -#[doc = "8x scale."] -#[doc = ""] - +#[doc = "< 8x scale."] pub const GPU_LUTSCALER_8x: GPU_LIGHTLUTSCALER = 3; -#[doc = "0.25x scale."] -#[doc = ""] - +#[doc = "< 0.25x scale."] pub const GPU_LUTSCALER_0_25x: GPU_LIGHTLUTSCALER = 6; -#[doc = "0.5x scale."] -#[doc = ""] - +#[doc = "< 0.5x scale."] pub const GPU_LUTSCALER_0_5x: GPU_LIGHTLUTSCALER = 7; -#[doc = "LUT scalers."] -#[doc = ""] - +#[doc = " LUT scalers."] pub type GPU_LIGHTLUTSCALER = ::libc::c_uint; -#[doc = "LUTs that are common to all lights."] -#[doc = ""] - +#[doc = "< LUTs that are common to all lights."] pub const GPU_LUTSELECT_COMMON: GPU_LIGHTLUTSELECT = 0; -#[doc = "Spotlight LUT."] -#[doc = ""] - +#[doc = "< Spotlight LUT."] pub const GPU_LUTSELECT_SP: GPU_LIGHTLUTSELECT = 1; -#[doc = "Distance attenuation LUT."] -#[doc = ""] - +#[doc = "< Distance attenuation LUT."] pub const GPU_LUTSELECT_DA: GPU_LIGHTLUTSELECT = 2; -#[doc = "LUT selection."] -#[doc = ""] - +#[doc = " LUT selection."] pub type GPU_LIGHTLUTSELECT = ::libc::c_uint; -#[doc = "Fog/Gas unit disabled."] -#[doc = ""] - +#[doc = "< Fog/Gas unit disabled."] pub const GPU_NO_FOG: GPU_FOGMODE = 0; -#[doc = "Fog/Gas unit configured in Fog mode."] -#[doc = ""] - +#[doc = "< Fog/Gas unit configured in Fog mode."] pub const GPU_FOG: GPU_FOGMODE = 5; -#[doc = "Fog/Gas unit configured in Gas mode."] -#[doc = ""] - +#[doc = "< Fog/Gas unit configured in Gas mode."] pub const GPU_GAS: GPU_FOGMODE = 7; -#[doc = "Fog modes."] -#[doc = ""] - +#[doc = " Fog modes."] pub type GPU_FOGMODE = ::libc::c_uint; -#[doc = "Plain density."] -#[doc = ""] - +#[doc = "< Plain density."] pub const GPU_PLAIN_DENSITY: GPU_GASMODE = 0; -#[doc = "Depth density."] -#[doc = ""] - +#[doc = "< Depth density."] pub const GPU_DEPTH_DENSITY: GPU_GASMODE = 1; -#[doc = "Gas shading density source values."] -#[doc = ""] - +#[doc = " Gas shading density source values."] pub type GPU_GASMODE = ::libc::c_uint; -#[doc = "Gas density used as input."] -#[doc = ""] - +#[doc = "< Gas density used as input."] pub const GPU_GAS_DENSITY: GPU_GASLUTINPUT = 0; -#[doc = "Light factor used as input."] -#[doc = ""] - +#[doc = "< Light factor used as input."] pub const GPU_GAS_LIGHT_FACTOR: GPU_GASLUTINPUT = 1; -#[doc = "Gas color LUT inputs."] -#[doc = ""] - +#[doc = " Gas color LUT inputs."] pub type GPU_GASLUTINPUT = ::libc::c_uint; -#[doc = "Triangles."] -#[doc = ""] - +#[doc = "< Triangles."] pub const GPU_TRIANGLES: GPU_Primitive_t = 0; -#[doc = "Triangle strip."] -#[doc = ""] - +#[doc = "< Triangle strip."] pub const GPU_TRIANGLE_STRIP: GPU_Primitive_t = 256; -#[doc = "Triangle fan."] -#[doc = ""] - +#[doc = "< Triangle fan."] pub const GPU_TRIANGLE_FAN: GPU_Primitive_t = 512; -#[doc = "Geometry shader primitive."] -#[doc = ""] - +#[doc = "< Geometry shader primitive."] pub const GPU_GEOMETRY_PRIM: GPU_Primitive_t = 768; -#[doc = "Supported primitives."] -#[doc = ""] - +#[doc = " Supported primitives."] pub type GPU_Primitive_t = ::libc::c_uint; -#[doc = "Vertex shader."] -#[doc = ""] - +#[doc = "< Vertex shader."] pub const GPU_VERTEX_SHADER: GPU_SHADER_TYPE = 0; -#[doc = "Geometry shader."] -#[doc = ""] - +#[doc = "< Geometry shader."] pub const GPU_GEOMETRY_SHADER: GPU_SHADER_TYPE = 1; -#[doc = "Shader types."] -#[doc = ""] - +#[doc = " Shader types."] pub type GPU_SHADER_TYPE = ::libc::c_uint; extern "C" { - #[doc = "GPU command buffer."] - #[doc = ""] + #[doc = "< GPU command buffer."] pub static mut gpuCmdBuf: *mut u32_; } extern "C" { - #[doc = "GPU command buffer size."] - #[doc = ""] + #[doc = "< GPU command buffer size."] pub static mut gpuCmdBufSize: u32_; } extern "C" { - #[doc = "GPU command buffer offset."] - #[doc = ""] + #[doc = "< GPU command buffer offset."] pub static mut gpuCmdBufOffset: u32_; } extern "C" { - #[doc = "Adds raw GPU commands to the current command buffer.\n @param cmd Buffer containing commands to add.\n @param size Size of the buffer."] - #[doc = ""] + #[doc = " Adds raw GPU commands to the current command buffer.\n # Arguments\n\n* `cmd` - Buffer containing commands to add.\n * `size` - Size of the buffer."] pub fn GPUCMD_AddRawCommands(cmd: *const u32_, size: u32_); } extern "C" { - #[doc = "Adds a GPU command to the current command buffer.\n @param header Header of the command.\n @param param Parameters of the command.\n @param paramlength Size of the parameter buffer."] - #[doc = ""] + #[doc = " Adds a GPU command to the current command buffer.\n # Arguments\n\n* `header` - Header of the command.\n * `param` - Parameters of the command.\n * `paramlength` - Size of the parameter buffer."] pub fn GPUCMD_Add(header: u32_, param: *const u32_, paramlength: u32_); } extern "C" { - #[doc = "Splits the current GPU command buffer.\n @param addr Pointer to output the command buffer to.\n @param size Pointer to output the size (in words) of the command buffer to."] - #[doc = ""] + #[doc = " Splits the current GPU command buffer.\n # Arguments\n\n* `addr` - Pointer to output the command buffer to.\n * `size` - Pointer to output the size (in words) of the command buffer to."] pub fn GPUCMD_Split(addr: *mut *mut u32_, size: *mut u32_); } extern "C" { - #[doc = "Converts a 32-bit float to a 16-bit float.\n @param f Float to convert.\n @return The converted float."] - #[doc = ""] + #[doc = " Converts a 32-bit float to a 16-bit float.\n # Arguments\n\n* `f` - Float to convert.\n # Returns\n\nThe converted float."] pub fn f32tof16(f: f32) -> u32_; } extern "C" { - #[doc = "Converts a 32-bit float to a 20-bit float.\n @param f Float to convert.\n @return The converted float."] - #[doc = ""] + #[doc = " Converts a 32-bit float to a 20-bit float.\n # Arguments\n\n* `f` - Float to convert.\n # Returns\n\nThe converted float."] pub fn f32tof20(f: f32) -> u32_; } extern "C" { - #[doc = "Converts a 32-bit float to a 24-bit float.\n @param f Float to convert.\n @return The converted float."] - #[doc = ""] + #[doc = " Converts a 32-bit float to a 24-bit float.\n # Arguments\n\n* `f` - Float to convert.\n # Returns\n\nThe converted float."] pub fn f32tof24(f: f32) -> u32_; } extern "C" { - #[doc = "Converts a 32-bit float to a 31-bit float.\n @param f Float to convert.\n @return The converted float."] - #[doc = ""] + #[doc = " Converts a 32-bit float to a 31-bit float.\n # Arguments\n\n* `f` - Float to convert.\n # Returns\n\nThe converted float."] pub fn f32tof31(f: f32) -> u32_; } -#[doc = "Vertex shader."] -#[doc = ""] - +#[doc = "< Vertex shader."] pub const VERTEX_SHDR: DVLE_type = 0; -#[doc = "Geometry shader."] -#[doc = ""] - +#[doc = "< Geometry shader."] pub const GEOMETRY_SHDR: DVLE_type = 1; -#[doc = "DVLE type."] -#[doc = ""] - +#[doc = " DVLE type."] pub type DVLE_type = ::libc::c_uint; -#[doc = "Bool."] -#[doc = ""] - +#[doc = "< Bool."] pub const DVLE_CONST_BOOL: DVLE_constantType = 0; -#[doc = "Unsigned 8-bit integer."] -#[doc = ""] - +#[doc = "< Unsigned 8-bit integer."] pub const DVLE_CONST_u8: DVLE_constantType = 1; -#[doc = "24-bit float."] -#[doc = ""] - +#[doc = "< 24-bit float."] pub const DVLE_CONST_FLOAT24: DVLE_constantType = 2; -#[doc = "Constant type."] -#[doc = ""] - +#[doc = " Constant type."] pub type DVLE_constantType = ::libc::c_uint; -#[doc = "Position."] -#[doc = ""] - +#[doc = "< Position."] pub const RESULT_POSITION: DVLE_outputAttribute_t = 0; -#[doc = "Normal Quaternion."] -#[doc = ""] - +#[doc = "< Normal Quaternion."] pub const RESULT_NORMALQUAT: DVLE_outputAttribute_t = 1; -#[doc = "Color."] -#[doc = ""] - +#[doc = "< Color."] pub const RESULT_COLOR: DVLE_outputAttribute_t = 2; -#[doc = "Texture coordinate 0."] -#[doc = ""] - +#[doc = "< Texture coordinate 0."] pub const RESULT_TEXCOORD0: DVLE_outputAttribute_t = 3; -#[doc = "Texture coordinate 0 W."] -#[doc = ""] - +#[doc = "< Texture coordinate 0 W."] pub const RESULT_TEXCOORD0W: DVLE_outputAttribute_t = 4; -#[doc = "Texture coordinate 1."] -#[doc = ""] - +#[doc = "< Texture coordinate 1."] pub const RESULT_TEXCOORD1: DVLE_outputAttribute_t = 5; -#[doc = "Texture coordinate 2."] -#[doc = ""] - +#[doc = "< Texture coordinate 2."] pub const RESULT_TEXCOORD2: DVLE_outputAttribute_t = 6; -#[doc = "View."] -#[doc = ""] - +#[doc = "< View."] pub const RESULT_VIEW: DVLE_outputAttribute_t = 8; -#[doc = "Dummy attribute (used as passthrough for geometry shader input)."] -#[doc = ""] - +#[doc = "< Dummy attribute (used as passthrough for geometry shader input)."] pub const RESULT_DUMMY: DVLE_outputAttribute_t = 9; -#[doc = "Output attribute."] -#[doc = ""] - +#[doc = " Output attribute."] pub type DVLE_outputAttribute_t = ::libc::c_uint; -#[doc = "Point processing mode."] -#[doc = ""] - +#[doc = "< Point processing mode."] pub const GSH_POINT: DVLE_geoShaderMode = 0; -#[doc = "Variable-size primitive processing mode."] -#[doc = ""] - +#[doc = "< Variable-size primitive processing mode."] pub const GSH_VARIABLE_PRIM: DVLE_geoShaderMode = 1; -#[doc = "Fixed-size primitive processing mode."] -#[doc = ""] - +#[doc = "< Fixed-size primitive processing mode."] pub const GSH_FIXED_PRIM: DVLE_geoShaderMode = 2; -#[doc = "Geometry shader operation modes."] -#[doc = ""] - +#[doc = " Geometry shader operation modes."] pub type DVLE_geoShaderMode = ::libc::c_uint; -#[doc = "DVLP data."] -#[doc = ""] +#[doc = " DVLP data."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct DVLP_s { - #[doc = "Code size."] - #[doc = ""] + #[doc = "< Code size."] pub codeSize: u32_, - #[doc = "Code data."] - #[doc = ""] + #[doc = "< Code data."] pub codeData: *mut u32_, - #[doc = "Operand description size."] - #[doc = ""] + #[doc = "< Operand description size."] pub opdescSize: u32_, - #[doc = "Operand description data."] - #[doc = ""] + #[doc = "< Operand description data."] pub opcdescData: *mut u32_, } impl Default for DVLP_s { @@ -20706,118 +16462,84 @@ impl Default for DVLP_s { } } } -#[doc = "DVLE constant entry data."] -#[doc = ""] +#[doc = " DVLE constant entry data."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct DVLE_constEntry_s { - #[doc = "Constant type. See [`DVLE_constantType`]"] - #[doc = ""] + #[doc = "< Constant type. See DVLE_constantType"] pub type_: u16_, - #[doc = "Constant ID."] - #[doc = ""] + #[doc = "< Constant ID."] pub id: u16_, - #[doc = "Constant data."] - #[doc = ""] + #[doc = "< Constant data."] pub data: [u32_; 4usize], } -#[doc = "DVLE output entry data."] -#[doc = ""] +#[doc = " DVLE output entry data."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct DVLE_outEntry_s { - #[doc = "Output type. See [`DVLE_outputAttribute_t`]"] - #[doc = ""] + #[doc = "< Output type. See DVLE_outputAttribute_t"] pub type_: u16_, - #[doc = "Output register ID."] - #[doc = ""] + #[doc = "< Output register ID."] pub regID: u16_, - #[doc = "Output mask."] - #[doc = ""] + #[doc = "< Output mask."] pub mask: u8_, - #[doc = "Unknown."] - #[doc = ""] + #[doc = "< Unknown."] pub unk: [u8_; 3usize], } -#[doc = "DVLE uniform entry data."] -#[doc = ""] +#[doc = " DVLE uniform entry data."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct DVLE_uniformEntry_s { - #[doc = "Symbol offset."] - #[doc = ""] + #[doc = "< Symbol offset."] pub symbolOffset: u32_, - #[doc = "Start register."] - #[doc = ""] + #[doc = "< Start register."] pub startReg: u16_, - #[doc = "End register."] - #[doc = ""] + #[doc = "< End register."] pub endReg: u16_, } -#[doc = "DVLE data."] -#[doc = ""] +#[doc = " DVLE data."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct DVLE_s { - #[doc = "DVLE type."] - #[doc = ""] + #[doc = "< DVLE type."] pub type_: DVLE_type, - #[doc = "true = merge vertex/geometry shader outmaps ('dummy' output attribute is present)."] - #[doc = ""] + #[doc = "< true = merge vertex/geometry shader outmaps ('dummy' output attribute is present)."] pub mergeOutmaps: bool, - #[doc = "Geometry shader operation mode."] - #[doc = ""] + #[doc = "< Geometry shader operation mode."] pub gshMode: DVLE_geoShaderMode, - #[doc = "Starting float uniform register number for storing the fixed-size primitive vertex array."] - #[doc = ""] + #[doc = "< Starting float uniform register number for storing the fixed-size primitive vertex array."] pub gshFixedVtxStart: u8_, - #[doc = "Number of fully-defined vertices in the variable-size primitive vertex array."] - #[doc = ""] + #[doc = "< Number of fully-defined vertices in the variable-size primitive vertex array."] pub gshVariableVtxNum: u8_, - #[doc = "Number of vertices in the fixed-size primitive vertex array."] - #[doc = ""] + #[doc = "< Number of vertices in the fixed-size primitive vertex array."] pub gshFixedVtxNum: u8_, - #[doc = "Contained DVLPs."] - #[doc = ""] + #[doc = "< Contained DVLPs."] pub dvlp: *mut DVLP_s, - #[doc = "Offset of the start of the main function."] - #[doc = ""] + #[doc = "< Offset of the start of the main function."] pub mainOffset: u32_, - #[doc = "Offset of the end of the main function."] - #[doc = ""] + #[doc = "< Offset of the end of the main function."] pub endmainOffset: u32_, - #[doc = "Constant table size."] - #[doc = ""] + #[doc = "< Constant table size."] pub constTableSize: u32_, - #[doc = "Constant table data."] - #[doc = ""] + #[doc = "< Constant table data."] pub constTableData: *mut DVLE_constEntry_s, - #[doc = "Output table size."] - #[doc = ""] + #[doc = "< Output table size."] pub outTableSize: u32_, - #[doc = "Output table data."] - #[doc = ""] + #[doc = "< Output table data."] pub outTableData: *mut DVLE_outEntry_s, - #[doc = "Uniform table size."] - #[doc = ""] + #[doc = "< Uniform table size."] pub uniformTableSize: u32_, - #[doc = "Uniform table data."] - #[doc = ""] + #[doc = "< Uniform table data."] pub uniformTableData: *mut DVLE_uniformEntry_s, - #[doc = "Symbol table data."] - #[doc = ""] + #[doc = "< Symbol table data."] pub symbolTableData: *mut ::libc::c_char, - #[doc = "Output map mask."] - #[doc = ""] + #[doc = "< Output map mask."] pub outmapMask: u8_, - #[doc = "Output map data."] - #[doc = ""] + #[doc = "< Output map data."] pub outmapData: [u32_; 8usize], - #[doc = "Output map mode."] - #[doc = ""] + #[doc = "< Output map mode."] pub outmapMode: u32_, - #[doc = "Output map attribute clock."] - #[doc = ""] + #[doc = "< Output map attribute clock."] pub outmapClock: u32_, } impl Default for DVLE_s { @@ -20829,19 +16551,15 @@ impl Default for DVLE_s { } } } -#[doc = "DVLB data."] -#[doc = ""] +#[doc = " DVLB data."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct DVLB_s { - #[doc = "DVLE count."] - #[doc = ""] + #[doc = "< DVLE count."] pub numDVLE: u32_, - #[doc = "Primary DVLP."] - #[doc = ""] + #[doc = "< Primary DVLP."] pub DVLP: DVLP_s, - #[doc = "Contained DVLE."] - #[doc = ""] + #[doc = "< Contained DVLE."] pub DVLE: *mut DVLE_s, } impl Default for DVLB_s { @@ -20854,62 +16572,47 @@ impl Default for DVLB_s { } } extern "C" { - #[doc = "Parses a shader binary.\n @param shbinData Shader binary data.\n @param shbinSize Shader binary size.\n @return The parsed shader binary."] - #[doc = ""] + #[doc = " Parses a shader binary.\n # Arguments\n\n* `shbinData` - Shader binary data.\n * `shbinSize` - Shader binary size.\n # Returns\n\nThe parsed shader binary."] pub fn DVLB_ParseFile(shbinData: *mut u32_, shbinSize: u32_) -> *mut DVLB_s; } extern "C" { - #[doc = "Frees shader binary data.\n @param dvlb DVLB to free."] - #[doc = ""] + #[doc = " Frees shader binary data.\n # Arguments\n\n* `dvlb` - DVLB to free."] pub fn DVLB_Free(dvlb: *mut DVLB_s); } extern "C" { - #[doc = "Gets a uniform register index from a shader.\n @param dvle Shader to get the register from.\n @param name Name of the register.\n @return The uniform register index."] - #[doc = ""] + #[doc = " Gets a uniform register index from a shader.\n # Arguments\n\n* `dvle` - Shader to get the register from.\n * `name` - Name of the register.\n # Returns\n\nThe uniform register index."] pub fn DVLE_GetUniformRegister(dvle: *mut DVLE_s, name: *const ::libc::c_char) -> s8; } extern "C" { - #[doc = "Generates a shader output map.\n @param dvle Shader to generate an output map for."] - #[doc = ""] + #[doc = " Generates a shader output map.\n # Arguments\n\n* `dvle` - Shader to generate an output map for."] pub fn DVLE_GenerateOutmap(dvle: *mut DVLE_s); } -#[doc = "24-bit float uniforms."] -#[doc = ""] +#[doc = " 24-bit float uniforms."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct float24Uniform_s { - #[doc = "Uniform ID."] - #[doc = ""] + #[doc = "< Uniform ID."] pub id: u32_, - #[doc = "Uniform data."] - #[doc = ""] + #[doc = "< Uniform data."] pub data: [u32_; 3usize], } -#[doc = "Describes an instance of either a vertex or geometry shader."] -#[doc = ""] +#[doc = " Describes an instance of either a vertex or geometry shader."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct shaderInstance_s { - #[doc = "Shader DVLE."] - #[doc = ""] + #[doc = "< Shader DVLE."] pub dvle: *mut DVLE_s, - #[doc = "Boolean uniforms."] - #[doc = ""] + #[doc = "< Boolean uniforms."] pub boolUniforms: u16_, - #[doc = "Used boolean uniform mask."] - #[doc = ""] + #[doc = "< Used boolean uniform mask."] pub boolUniformMask: u16_, - #[doc = "Integer uniforms."] - #[doc = ""] + #[doc = "< Integer uniforms."] pub intUniforms: [u32_; 4usize], - #[doc = "24-bit float uniforms."] - #[doc = ""] + #[doc = "< 24-bit float uniforms."] pub float24Uniforms: *mut float24Uniform_s, - #[doc = "Used integer uniform mask."] - #[doc = ""] + #[doc = "< Used integer uniform mask."] pub intUniformMask: u8_, - #[doc = "Float uniform count."] - #[doc = ""] + #[doc = "< Float uniform count."] pub numFloat24Uniforms: u8_, } impl Default for shaderInstance_s { @@ -20921,22 +16624,17 @@ impl Default for shaderInstance_s { } } } -#[doc = "Describes an instance of a full shader program."] -#[doc = ""] +#[doc = " Describes an instance of a full shader program."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct shaderProgram_s { - #[doc = "Vertex shader."] - #[doc = ""] + #[doc = "< Vertex shader."] pub vertexShader: *mut shaderInstance_s, - #[doc = "Geometry shader."] - #[doc = ""] + #[doc = "< Geometry shader."] pub geometryShader: *mut shaderInstance_s, - #[doc = "Geometry shader input permutation."] - #[doc = ""] + #[doc = "< Geometry shader input permutation."] pub geoShaderInputPermutation: [u32_; 2usize], - #[doc = "Geometry shader input stride."] - #[doc = ""] + #[doc = "< Geometry shader input stride."] pub geoShaderInputStride: u8_, } impl Default for shaderProgram_s { @@ -20950,20 +16648,17 @@ impl Default for shaderProgram_s { } extern "C" { #[must_use] - #[doc = "Initializes a shader instance.\n @param si Shader instance to initialize.\n @param dvle DVLE to initialize the shader instance with."] - #[doc = ""] + #[doc = " Initializes a shader instance.\n # Arguments\n\n* `si` - Shader instance to initialize.\n * `dvle` - DVLE to initialize the shader instance with."] pub fn shaderInstanceInit(si: *mut shaderInstance_s, dvle: *mut DVLE_s) -> Result; } extern "C" { #[must_use] - #[doc = "Frees a shader instance.\n @param si Shader instance to free."] - #[doc = ""] + #[doc = " Frees a shader instance.\n # Arguments\n\n* `si` - Shader instance to free."] pub fn shaderInstanceFree(si: *mut shaderInstance_s) -> Result; } extern "C" { #[must_use] - #[doc = "Sets a bool uniform of a shader.\n @param si Shader instance to use.\n @param id ID of the bool uniform.\n @param value Value to set."] - #[doc = ""] + #[doc = " Sets a bool uniform of a shader.\n # Arguments\n\n* `si` - Shader instance to use.\n * `id` - ID of the bool uniform.\n * `value` - Value to set."] pub fn shaderInstanceSetBool( si: *mut shaderInstance_s, id: ::libc::c_int, @@ -20972,8 +16667,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Gets a bool uniform of a shader.\n @param si Shader instance to use.\n @param id ID of the bool uniform.\n @param value Pointer to output the value to."] - #[doc = ""] + #[doc = " Gets a bool uniform of a shader.\n # Arguments\n\n* `si` - Shader instance to use.\n * `id` - ID of the bool uniform.\n * `value` - Pointer to output the value to."] pub fn shaderInstanceGetBool( si: *mut shaderInstance_s, id: ::libc::c_int, @@ -20981,8 +16675,7 @@ extern "C" { ) -> Result; } extern "C" { - #[doc = "Gets the location of a shader's uniform.\n @param si Shader instance to use.\n @param name Name of the uniform."] - #[doc = ""] + #[doc = " Gets the location of a shader's uniform.\n # Arguments\n\n* `si` - Shader instance to use.\n * `name` - Name of the uniform."] pub fn shaderInstanceGetUniformLocation( si: *mut shaderInstance_s, name: *const ::libc::c_char, @@ -20990,32 +16683,27 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Initializes a shader program.\n @param sp Shader program to initialize."] - #[doc = ""] + #[doc = " Initializes a shader program.\n # Arguments\n\n* `sp` - Shader program to initialize."] pub fn shaderProgramInit(sp: *mut shaderProgram_s) -> Result; } extern "C" { #[must_use] - #[doc = "Frees a shader program.\n @param sp Shader program to free."] - #[doc = ""] + #[doc = " Frees a shader program.\n # Arguments\n\n* `sp` - Shader program to free."] pub fn shaderProgramFree(sp: *mut shaderProgram_s) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the vertex shader of a shader program.\n @param sp Shader program to use.\n @param dvle Vertex shader to set."] - #[doc = ""] + #[doc = " Sets the vertex shader of a shader program.\n # Arguments\n\n* `sp` - Shader program to use.\n * `dvle` - Vertex shader to set."] pub fn shaderProgramSetVsh(sp: *mut shaderProgram_s, dvle: *mut DVLE_s) -> Result; } extern "C" { #[must_use] - #[doc = "Sets the geometry shader of a shader program.\n @param sp Shader program to use.\n @param dvle Geometry shader to set.\n @param stride Input stride of the shader (pass 0 to match the number of outputs of the vertex shader)."] - #[doc = ""] + #[doc = " Sets the geometry shader of a shader program.\n # Arguments\n\n* `sp` - Shader program to use.\n * `dvle` - Geometry shader to set.\n * `stride` - Input stride of the shader (pass 0 to match the number of outputs of the vertex shader)."] pub fn shaderProgramSetGsh(sp: *mut shaderProgram_s, dvle: *mut DVLE_s, stride: u8_) -> Result; } extern "C" { #[must_use] - #[doc = "Configures the permutation of the input attributes of the geometry shader of a shader program.\n @param sp Shader program to use.\n @param permutation Attribute permutation to use."] - #[doc = ""] + #[doc = " Configures the permutation of the input attributes of the geometry shader of a shader program.\n # Arguments\n\n* `sp` - Shader program to use.\n * `permutation` - Attribute permutation to use."] pub fn shaderProgramSetGshInputPermutation( sp: *mut shaderProgram_s, permutation: u64_, @@ -21023,8 +16711,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Configures the shader units to use the specified shader program.\n @param sp Shader program to use.\n @param sendVshCode When true, the vertex shader's code and operand descriptors are uploaded.\n @param sendGshCode When true, the geometry shader's code and operand descriptors are uploaded."] - #[doc = ""] + #[doc = " Configures the shader units to use the specified shader program.\n # Arguments\n\n* `sp` - Shader program to use.\n * `sendVshCode` - When true, the vertex shader's code and operand descriptors are uploaded.\n * `sendGshCode` - When true, the geometry shader's code and operand descriptors are uploaded."] pub fn shaderProgramConfigure( sp: *mut shaderProgram_s, sendVshCode: bool, @@ -21033,129 +16720,82 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Same as shaderProgramConfigure, but always loading code/operand descriptors and uploading DVLE constants afterwards.\n @param sp Shader program to use."] - #[doc = ""] + #[doc = " Same as shaderProgramConfigure, but always loading code/operand descriptors and uploading DVLE constants afterwards.\n # Arguments\n\n* `sp` - Shader program to use."] pub fn shaderProgramUse(sp: *mut shaderProgram_s) -> Result; } -#[doc = "Mono sound"] -#[doc = ""] - +#[doc = "< Mono sound"] pub const NDSP_OUTPUT_MONO: ndspOutputMode = 0; -#[doc = "Stereo sound"] -#[doc = ""] - +#[doc = "< Stereo sound"] pub const NDSP_OUTPUT_STEREO: ndspOutputMode = 1; -#[doc = "3D Surround sound"] -#[doc = ""] - +#[doc = "< 3D Surround sound"] pub const NDSP_OUTPUT_SURROUND: ndspOutputMode = 2; -#[doc = "# Data types\n@{\n Sound output modes."] -#[doc = ""] - +#[doc = "Data types\n# Sound output modes."] pub type ndspOutputMode = ::libc::c_uint; -#[doc = "\"Normal\" clipping mode (?)"] -#[doc = ""] - +#[doc = "< \"Normal\" clipping mode (?)"] pub const NDSP_CLIP_NORMAL: ndspClippingMode = 0; -#[doc = "\"Soft\" clipping mode (?)"] -#[doc = ""] - +#[doc = "< \"Soft\" clipping mode (?)"] pub const NDSP_CLIP_SOFT: ndspClippingMode = 1; pub type ndspClippingMode = ::libc::c_uint; #[doc = "; -#[doc = "Auxiliary output callback function. (data = User provided data, nsamples = Number of samples, samples = Sample data)"] -#[doc = ""] - +#[doc = " Auxiliary output callback function. (data = User provided data, nsamples = Number of samples, samples = Sample data)"] pub type ndspAuxCallback = ::core::option::Option< unsafe extern "C" fn( data: *mut ::libc::c_void, @@ -21191,8 +16827,7 @@ pub type ndspAuxCallback = ::core::option::Option< ), >; extern "C" { - #[doc = "# Initialization and basic operations\n@{\n**\n* @brief Sets up the DSP component.\n* @param binary DSP binary to load.\n* @param size Size of the DSP binary.\n* @param progMask Program RAM block mask to load the binary to.\n* @param dataMask Data RAM block mask to load the binary to.\n*/"] - #[doc = ""] + #[doc = "Initialization and basic operations\n# **\n* Sets up the DSP component.\n* # Arguments\n\n* `binary` - DSP binary to load.\n* * `size` - Size of the DSP binary.\n* * `progMask` - Program RAM block mask to load the binary to.\n* * `dataMask` - Data RAM block mask to load the binary to.\n*/"] pub fn ndspUseComponent( binary: *const ::libc::c_void, size: u32_, @@ -21202,318 +16837,177 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Initializes NDSP."] - #[doc = ""] + #[doc = " Initializes NDSP."] pub fn ndspInit() -> Result; } extern "C" { - #[doc = "Exits NDSP."] - #[doc = ""] + #[doc = " Exits NDSP."] pub fn ndspExit(); } extern "C" { - #[doc = "Gets the number of dropped sound frames.\n @return The number of dropped sound frames."] - #[doc = ""] + #[doc = " Gets the number of dropped sound frames.\n # Returns\n\nThe number of dropped sound frames."] pub fn ndspGetDroppedFrames() -> u32_; } extern "C" { - #[doc = "Gets the total sound frame count.\n @return The total sound frame count."] - #[doc = ""] + #[doc = " Gets the total sound frame count.\n # Returns\n\nThe total sound frame count."] pub fn ndspGetFrameCount() -> u32_; } extern "C" { - #[doc = "# General parameters\n@{\n**\n* @brief Sets the master volume.\n* @param volume Volume to set. Defaults to 1.0f.\n*/"] - #[doc = ""] + #[doc = "General parameters\n# **\n* Sets the master volume.\n* # Arguments\n\n* `volume` - Volume to set. Defaults to 1.0f.\n*/"] pub fn ndspSetMasterVol(volume: f32); } extern "C" { - #[doc = "Gets the master volume.\n @return The master volume."] - #[doc = ""] - pub fn ndspGetMasterVol() -> f32; -} -extern "C" { - #[doc = "Sets the output mode.\n @param mode Output mode to set. Defaults to NDSP_OUTPUT_STEREO."] - #[doc = ""] + #[doc = " Sets the output mode.\n # Arguments\n\n* `mode` - Output mode to set. Defaults to NDSP_OUTPUT_STEREO."] pub fn ndspSetOutputMode(mode: ndspOutputMode); } extern "C" { - #[doc = "Gets the output mode.\n @return The output mode."] - #[doc = ""] - pub fn ndspGetOutputMode() -> ndspOutputMode; -} -extern "C" { - #[doc = "Sets the clipping mode.\n @param mode Clipping mode to set. Defaults to NDSP_CLIP_SOFT."] - #[doc = ""] + #[doc = " Sets the clipping mode.\n # Arguments\n\n* `mode` - Clipping mode to set. Defaults to NDSP_CLIP_SOFT."] pub fn ndspSetClippingMode(mode: ndspClippingMode); } extern "C" { - #[doc = "Gets the clipping mode.\n @return The clipping mode."] - #[doc = ""] - pub fn ndspGetClippingMode() -> ndspClippingMode; -} -extern "C" { - #[doc = "Sets the output count.\n @param count Output count to set. Defaults to 2."] - #[doc = ""] + #[doc = " Sets the output count.\n # Arguments\n\n* `count` - Output count to set. Defaults to 2."] pub fn ndspSetOutputCount(count: ::libc::c_int); } extern "C" { - #[doc = "Gets the output count.\n @return The output count."] - #[doc = ""] - pub fn ndspGetOutputCount() -> ::libc::c_int; -} -extern "C" { - #[doc = "Sets the wave buffer to capture audio to.\n @param capture Wave buffer to capture to."] - #[doc = ""] + #[doc = " Sets the wave buffer to capture audio to.\n # Arguments\n\n* `capture` - Wave buffer to capture to."] pub fn ndspSetCapture(capture: *mut ndspWaveBuf); } extern "C" { - #[doc = "Sets the sound frame callback.\n @param callback Callback to set.\n @param data User-defined data to pass to the callback."] - #[doc = ""] + #[doc = " Sets the sound frame callback.\n # Arguments\n\n* `callback` - Callback to set.\n * `data` - User-defined data to pass to the callback."] pub fn ndspSetCallback(callback: ndspCallback, data: *mut ::libc::c_void); } extern "C" { - #[doc = "# Surround\n@{\n**\n* @brief Sets the surround sound depth.\n* @param depth Depth to set. Defaults to 0x7FFF.\n*/"] - #[doc = ""] + #[doc = "Surround\n# **\n* Sets the surround sound depth.\n* # Arguments\n\n* `depth` - Depth to set. Defaults to 0x7FFF.\n*/"] pub fn ndspSurroundSetDepth(depth: u16_); } extern "C" { - #[doc = "Gets the surround sound depth.\n @return The surround sound depth."] - #[doc = ""] - pub fn ndspSurroundGetDepth() -> u16_; -} -extern "C" { - #[doc = "Sets the surround sound position.\n @param pos Position to set. Defaults to NDSP_SPKPOS_SQUARE."] - #[doc = ""] + #[doc = " Sets the surround sound position.\n # Arguments\n\n* `pos` - Position to set. Defaults to NDSP_SPKPOS_SQUARE."] pub fn ndspSurroundSetPos(pos: ndspSpeakerPos); } extern "C" { - #[doc = "Gets the surround sound position.\n @return The surround sound speaker position."] - #[doc = ""] - pub fn ndspSurroundGetPos() -> ndspSpeakerPos; -} -extern "C" { - #[doc = "Sets the surround sound rear ratio.\n @param ratio Rear ratio to set. Defaults to 0x8000."] - #[doc = ""] + #[doc = " Sets the surround sound rear ratio.\n # Arguments\n\n* `ratio` - Rear ratio to set. Defaults to 0x8000."] pub fn ndspSurroundSetRearRatio(ratio: u16_); } extern "C" { - #[doc = "Gets the surround sound rear ratio.\n @return The rear ratio."] - #[doc = ""] - pub fn ndspSurroundGetRearRatio() -> u16_; -} -extern "C" { - #[doc = "# Auxiliary output\n@{\n**\n* @brief Configures whether an auxiliary output is enabled.\n* @param id ID of the auxiliary output.\n* @param enable Whether to enable the auxiliary output.\n*/"] - #[doc = ""] + #[doc = "Auxiliary output\n# **\n* Configures whether an auxiliary output is enabled.\n* # Arguments\n\n* `id` - ID of the auxiliary output.\n* * `enable` - Whether to enable the auxiliary output.\n*/"] pub fn ndspAuxSetEnable(id: ::libc::c_int, enable: bool); } extern "C" { - #[doc = "Gets whether auxiliary output is enabled.\n @param id ID of the auxiliary output.\n @return Whether auxiliary output is enabled."] - #[doc = ""] - pub fn ndspAuxIsEnabled(id: ::libc::c_int) -> bool; -} -extern "C" { - #[doc = "Configures whether an auxiliary output should use front bypass.\n @param id ID of the auxiliary output.\n @param bypass Whether to use front bypass."] - #[doc = ""] + #[doc = " Configures whether an auxiliary output should use front bypass.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n * `bypass` - Whether to use front bypass."] pub fn ndspAuxSetFrontBypass(id: ::libc::c_int, bypass: bool); } extern "C" { - #[doc = "Gets whether auxiliary output front bypass is enabled.\n @param id ID of the auxiliary output.\n @return Whether auxiliary output front bypass is enabled."] - #[doc = ""] - pub fn ndspAuxGetFrontBypass(id: ::libc::c_int) -> bool; -} -extern "C" { - #[doc = "Sets the volume of an auxiliary output.\n @param id ID of the auxiliary output.\n @param volume Volume to set."] - #[doc = ""] + #[doc = " Sets the volume of an auxiliary output.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n * `volume` - Volume to set."] pub fn ndspAuxSetVolume(id: ::libc::c_int, volume: f32); } extern "C" { - #[doc = "Gets the volume of an auxiliary output.\n @param id ID of the auxiliary output.\n @return Volume of the auxiliary output."] - #[doc = ""] - pub fn ndspAuxGetVolume(id: ::libc::c_int) -> f32; -} -extern "C" { - #[doc = "Sets the callback of an auxiliary output.\n @param id ID of the auxiliary output.\n @param callback Callback to set.\n @param data User-defined data to pass to the callback."] - #[doc = ""] + #[doc = " Sets the callback of an auxiliary output.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n * `callback` - Callback to set.\n * `data` - User-defined data to pass to the callback."] pub fn ndspAuxSetCallback( id: ::libc::c_int, callback: ndspAuxCallback, data: *mut ::libc::c_void, ); } -#[doc = "PCM8"] -#[doc = ""] - +#[doc = "< PCM8"] pub const NDSP_ENCODING_PCM8: _bindgen_ty_30 = 0; -#[doc = "PCM16"] -#[doc = ""] - +#[doc = "< PCM16"] pub const NDSP_ENCODING_PCM16: _bindgen_ty_30 = 1; -#[doc = "DSPADPCM (GameCube format)"] -#[doc = ""] - +#[doc = "< DSPADPCM (GameCube format)"] pub const NDSP_ENCODING_ADPCM: _bindgen_ty_30 = 2; -#[doc = "# Data types\n@{\n Supported sample encodings."] -#[doc = ""] - +#[doc = "Data types\n# Supported sample encodings."] pub type _bindgen_ty_30 = ::libc::c_uint; -#[doc = "Buffer contains Mono PCM8."] -#[doc = ""] - +#[doc = "< Buffer contains Mono PCM8."] pub const NDSP_FORMAT_MONO_PCM8: _bindgen_ty_31 = 1; -#[doc = "Buffer contains Mono PCM16."] -#[doc = ""] - +#[doc = "< Buffer contains Mono PCM16."] pub const NDSP_FORMAT_MONO_PCM16: _bindgen_ty_31 = 5; -#[doc = "Buffer contains Mono ADPCM."] -#[doc = ""] - +#[doc = "< Buffer contains Mono ADPCM."] pub const NDSP_FORMAT_MONO_ADPCM: _bindgen_ty_31 = 9; -#[doc = "Buffer contains Stereo PCM8."] -#[doc = ""] - +#[doc = "< Buffer contains Stereo PCM8."] pub const NDSP_FORMAT_STEREO_PCM8: _bindgen_ty_31 = 2; -#[doc = "Buffer contains Stereo PCM16."] -#[doc = ""] - +#[doc = "< Buffer contains Stereo PCM16."] pub const NDSP_FORMAT_STEREO_PCM16: _bindgen_ty_31 = 6; -#[doc = "(Alias) Buffer contains Mono PCM8."] -#[doc = ""] - +#[doc = "< (Alias) Buffer contains Mono PCM8."] pub const NDSP_FORMAT_PCM8: _bindgen_ty_31 = 1; -#[doc = "(Alias) Buffer contains Mono PCM16."] -#[doc = ""] - +#[doc = "< (Alias) Buffer contains Mono PCM16."] pub const NDSP_FORMAT_PCM16: _bindgen_ty_31 = 5; -#[doc = "(Alias) Buffer contains Mono ADPCM."] -#[doc = ""] - +#[doc = "< (Alias) Buffer contains Mono ADPCM."] pub const NDSP_FORMAT_ADPCM: _bindgen_ty_31 = 9; -#[doc = "Front bypass."] -#[doc = ""] - +#[doc = "< Front bypass."] pub const NDSP_FRONT_BYPASS: _bindgen_ty_31 = 16; -#[doc = "(?) Unknown, under research"] -#[doc = ""] - +#[doc = "< (?) Unknown, under research"] pub const NDSP_3D_SURROUND_PREPROCESSED: _bindgen_ty_31 = 64; -#[doc = "Channel format flags for use with ndspChnSetFormat."] -#[doc = ""] - +#[doc = " Channel format flags for use with ndspChnSetFormat."] pub type _bindgen_ty_31 = ::libc::c_uint; -#[doc = "Polyphase interpolation"] -#[doc = ""] - +#[doc = "< Polyphase interpolation"] pub const NDSP_INTERP_POLYPHASE: ndspInterpType = 0; -#[doc = "Linear interpolation"] -#[doc = ""] - +#[doc = "< Linear interpolation"] pub const NDSP_INTERP_LINEAR: ndspInterpType = 1; -#[doc = "No interpolation"] -#[doc = ""] - +#[doc = "< No interpolation"] pub const NDSP_INTERP_NONE: ndspInterpType = 2; -#[doc = "Interpolation types."] -#[doc = ""] - +#[doc = " Interpolation types."] pub type ndspInterpType = ::libc::c_uint; extern "C" { - #[doc = "# Basic channel operation\n@{\n**\n* @brief Resets a channel.\n* @param id ID of the channel (0..23).\n*/"] - #[doc = ""] + #[doc = "Basic channel operation\n# **\n* Resets a channel.\n* # Arguments\n\n* `id` - ID of the channel (0..23).\n*/"] pub fn ndspChnReset(id: ::libc::c_int); } extern "C" { - #[doc = "Initializes the parameters of a channel.\n @param id ID of the channel (0..23)."] - #[doc = ""] + #[doc = " Initializes the parameters of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23)."] pub fn ndspChnInitParams(id: ::libc::c_int); } extern "C" { - #[doc = "Checks whether a channel is currently playing.\n @param id ID of the channel (0..23).\n @return Whether the channel is currently playing."] - #[doc = ""] + #[doc = " Checks whether a channel is currently playing.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n # Returns\n\nWhether the channel is currently playing."] pub fn ndspChnIsPlaying(id: ::libc::c_int) -> bool; } extern "C" { - #[doc = "Gets the current sample position of a channel.\n @param id ID of the channel (0..23).\n @return The channel's sample position."] - #[doc = ""] + #[doc = " Gets the current sample position of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n # Returns\n\nThe channel's sample position."] pub fn ndspChnGetSamplePos(id: ::libc::c_int) -> u32_; } extern "C" { - #[doc = "Gets the sequence ID of the wave buffer that is currently playing in a channel.\n @param id ID of the channel (0..23).\n @return The sequence ID of the wave buffer."] - #[doc = ""] + #[doc = " Gets the sequence ID of the wave buffer that is currently playing in a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n # Returns\n\nThe sequence ID of the wave buffer."] pub fn ndspChnGetWaveBufSeq(id: ::libc::c_int) -> u16_; } extern "C" { - #[doc = "Checks whether a channel is currently paused.\n @param id ID of the channel (0..23).\n @return Whether the channel is currently paused."] - #[doc = ""] + #[doc = " Checks whether a channel is currently paused.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n # Returns\n\nWhether the channel is currently paused."] pub fn ndspChnIsPaused(id: ::libc::c_int) -> bool; } extern "C" { - #[doc = "Sets the pause status of a channel.\n @param id ID of the channel (0..23).\n @param paused Whether the channel is to be paused (true) or unpaused (false)."] - #[doc = ""] + #[doc = " Sets the pause status of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `paused` - Whether the channel is to be paused (true) or unpaused (false)."] pub fn ndspChnSetPaused(id: ::libc::c_int, paused: bool); } extern "C" { - #[doc = "# Configuration\n@{\n**\n* @brief Sets the format of a channel.\n* @param id ID of the channel (0..23).\n* @param format Format to use.\n*/"] - #[doc = ""] + #[doc = "Configuration\n# **\n* Sets the format of a channel.\n* # Arguments\n\n* `id` - ID of the channel (0..23).\n* * `format` - Format to use.\n*/"] pub fn ndspChnSetFormat(id: ::libc::c_int, format: u16_); } extern "C" { - #[doc = "Gets the format of a channel.\n @param id ID of the channel (0..23).\n @return The format of the channel."] - #[doc = ""] - pub fn ndspChnGetFormat(id: ::libc::c_int) -> u16_; -} -extern "C" { - #[doc = "Sets the interpolation type of a channel.\n @param id ID of the channel (0..23).\n @param type Interpolation type to use."] - #[doc = ""] + #[doc = " Sets the interpolation type of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `type` - Interpolation type to use."] pub fn ndspChnSetInterp(id: ::libc::c_int, type_: ndspInterpType); } extern "C" { - #[doc = "Gets the interpolation type of a channel.\n @param id ID of the channel (0..23).\n @return The interpolation type of the channel."] - #[doc = ""] - pub fn ndspChnGetInterp(id: ::libc::c_int) -> ndspInterpType; -} -extern "C" { - #[doc = "Sets the sample rate of a channel.\n @param id ID of the channel (0..23).\n @param rate Sample rate to use."] - #[doc = ""] + #[doc = " Sets the sample rate of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `rate` - Sample rate to use."] pub fn ndspChnSetRate(id: ::libc::c_int, rate: f32); } extern "C" { - #[doc = "Gets the sample rate of a channel.\n @param id ID of the channel (0..23).\n @return The sample rate of the channel."] - #[doc = ""] - pub fn ndspChnGetRate(id: ::libc::c_int) -> f32; -} -extern "C" { - #[doc = "Sets the mix parameters (volumes) of a channel.\n @param id ID of the channel (0..23).\n @param mix Mix parameters to use. Working hypothesis:\n - 0: Front left volume.\n - 1: Front right volume.\n - 2: Back left volume:\n - 3: Back right volume:\n - 4..7: Same as 0..3, but for auxiliary output 0.\n - 8..11: Same as 0..3, but for auxiliary output 1."] - #[doc = ""] + #[doc = " Sets the mix parameters (volumes) of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `mix` - Mix parameters to use. Working hypothesis:\n - 0: Front left volume.\n - 1: Front right volume.\n - 2: Back left volume:\n - 3: Back right volume:\n - 4..7: Same as 0..3, but for auxiliary output 0.\n - 8..11: Same as 0..3, but for auxiliary output 1."] pub fn ndspChnSetMix(id: ::libc::c_int, mix: *mut f32); } extern "C" { - #[doc = "Gets the mix parameters (volumes) of a channel.\n @param id ID of the channel (0..23)\n @param mix Mix parameters to write out to. See [`ndspChnSetMix`]"] - #[doc = ""] - pub fn ndspChnGetMix(id: ::libc::c_int, mix: *mut f32); -} -extern "C" { - #[doc = "Sets the DSPADPCM coefficients of a channel.\n @param id ID of the channel (0..23).\n @param coefs DSPADPCM coefficients to use."] - #[doc = ""] + #[doc = " Sets the DSPADPCM coefficients of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `coefs` - DSPADPCM coefficients to use."] pub fn ndspChnSetAdpcmCoefs(id: ::libc::c_int, coefs: *mut u16_); } extern "C" { - #[doc = "# Wave buffers\n@{\n**\n* @brief Clears the wave buffer queue of a channel and stops playback.\n* @param id ID of the channel (0..23).\n*/"] - #[doc = ""] + #[doc = "Wave buffers\n# **\n* Clears the wave buffer queue of a channel and stops playback.\n* # Arguments\n\n* `id` - ID of the channel (0..23).\n*/"] pub fn ndspChnWaveBufClear(id: ::libc::c_int); } extern "C" { - #[doc = "Adds a wave buffer to the wave buffer queue of a channel.\n @remark If the channel's wave buffer queue was empty before the use of this function, playback is started.\n @param id ID of the channel (0..23).\n @param buf Wave buffer to add."] - #[doc = ""] + #[doc = " Adds a wave buffer to the wave buffer queue of a channel.\n > If the channel's wave buffer queue was empty before the use of this function, playback is started.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `buf` - Wave buffer to add."] pub fn ndspChnWaveBufAdd(id: ::libc::c_int, buf: *mut ndspWaveBuf); } extern "C" { - #[doc = "# IIR filters\n@{\n**\n* @brief Configures whether the IIR monopole filter of a channel is enabled.\n* @param id ID of the channel (0..23).\n* @param enable Whether to enable the IIR monopole filter.\n*/"] - #[doc = ""] + #[doc = "IIR filters\n# **\n* Configures whether the IIR monopole filter of a channel is enabled.\n* # Arguments\n\n* `id` - ID of the channel (0..23).\n* * `enable` - Whether to enable the IIR monopole filter.\n*/"] pub fn ndspChnIirMonoSetEnable(id: ::libc::c_int, enable: bool); } extern "C" { - #[doc = "Manually sets up the parameters on monopole filter\n @param id ID of the channel (0..23).\n @param enable Whether to enable the IIR monopole filter."] - #[doc = ""] + #[doc = " Manually sets up the parameters on monopole filter\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `enable` - Whether to enable the IIR monopole filter."] pub fn ndspChnIirMonoSetParamsCustomFilter( id: ::libc::c_int, a0: f32, @@ -21522,23 +17016,19 @@ extern "C" { ) -> bool; } extern "C" { - #[doc = "Sets the monopole to be a low pass filter. (Note: This is a lower-quality filter than the biquad one.)\n @param id ID of the channel (0..23).\n @param f0 Low pass cut-off frequency."] - #[doc = ""] + #[doc = " Sets the monopole to be a low pass filter. (Note: This is a lower-quality filter than the biquad one.)\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `f0` - Low pass cut-off frequency."] pub fn ndspChnIirMonoSetParamsLowPassFilter(id: ::libc::c_int, f0: f32) -> bool; } extern "C" { - #[doc = "Sets the monopole to be a high pass filter. (Note: This is a lower-quality filter than the biquad one.)\n @param id ID of the channel (0..23).\n @param f0 High pass cut-off frequency."] - #[doc = ""] + #[doc = " Sets the monopole to be a high pass filter. (Note: This is a lower-quality filter than the biquad one.)\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `f0` - High pass cut-off frequency."] pub fn ndspChnIirMonoSetParamsHighPassFilter(id: ::libc::c_int, f0: f32) -> bool; } extern "C" { - #[doc = "Configures whether the IIR biquad filter of a channel is enabled.\n @param id ID of the channel (0..23).\n @param enable Whether to enable the IIR biquad filter."] - #[doc = ""] + #[doc = " Configures whether the IIR biquad filter of a channel is enabled.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `enable` - Whether to enable the IIR biquad filter."] pub fn ndspChnIirBiquadSetEnable(id: ::libc::c_int, enable: bool); } extern "C" { - #[doc = "Manually sets up the parameters of the biquad filter\n @param id ID of the channel (0..23)."] - #[doc = ""] + #[doc = " Manually sets up the parameters of the biquad filter\n # Arguments\n\n* `id` - ID of the channel (0..23)."] pub fn ndspChnIirBiquadSetParamsCustomFilter( id: ::libc::c_int, a0: f32, @@ -21550,28 +17040,23 @@ extern "C" { ) -> bool; } extern "C" { - #[doc = "Sets the biquad to be a low pass filter.\n @param id ID of the channel (0..23).\n @param f0 Low pass cut-off frequency.\n @param Q \"Quality factor\", typically should be sqrt(2)/2 (i.e. 0.7071)."] - #[doc = ""] + #[doc = " Sets the biquad to be a low pass filter.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `f0` - Low pass cut-off frequency.\n * `Q` - \"Quality factor\", typically should be sqrt(2)/2 (i.e. 0.7071)."] pub fn ndspChnIirBiquadSetParamsLowPassFilter(id: ::libc::c_int, f0: f32, Q: f32) -> bool; } extern "C" { - #[doc = "Sets the biquad to be a high pass filter.\n @param id ID of the channel (0..23).\n @param f0 High pass cut-off frequency.\n @param Q \"Quality factor\", typically should be sqrt(2)/2 (i.e. 0.7071)."] - #[doc = ""] + #[doc = " Sets the biquad to be a high pass filter.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `f0` - High pass cut-off frequency.\n * `Q` - \"Quality factor\", typically should be sqrt(2)/2 (i.e. 0.7071)."] pub fn ndspChnIirBiquadSetParamsHighPassFilter(id: ::libc::c_int, f0: f32, Q: f32) -> bool; } extern "C" { - #[doc = "Sets the biquad to be a band pass filter.\n @param id ID of the channel (0..23).\n @param f0 Mid-frequency.\n @param Q \"Quality factor\", typically should be sqrt(2)/2 (i.e. 0.7071)."] - #[doc = ""] + #[doc = " Sets the biquad to be a band pass filter.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `f0` - Mid-frequency.\n * `Q` - \"Quality factor\", typically should be sqrt(2)/2 (i.e. 0.7071)."] pub fn ndspChnIirBiquadSetParamsBandPassFilter(id: ::libc::c_int, f0: f32, Q: f32) -> bool; } extern "C" { - #[doc = "Sets the biquad to be a notch filter.\n @param id ID of the channel (0..23).\n @param f0 Notch frequency.\n @param Q \"Quality factor\", typically should be sqrt(2)/2 (i.e. 0.7071)."] - #[doc = ""] + #[doc = " Sets the biquad to be a notch filter.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `f0` - Notch frequency.\n * `Q` - \"Quality factor\", typically should be sqrt(2)/2 (i.e. 0.7071)."] pub fn ndspChnIirBiquadSetParamsNotchFilter(id: ::libc::c_int, f0: f32, Q: f32) -> bool; } extern "C" { - #[doc = "Sets the biquad to be a peaking equalizer.\n @param id ID of the channel (0..23).\n @param f0 Central frequency.\n @param Q \"Quality factor\", typically should be sqrt(2)/2 (i.e. 0.7071).\n @param gain Amount of gain (raw value = 10 ^ dB/40)"] - #[doc = ""] + #[doc = " Sets the biquad to be a peaking equalizer.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `f0` - Central frequency.\n * `Q` - \"Quality factor\", typically should be sqrt(2)/2 (i.e. 0.7071).\n * `gain` - Amount of gain (raw value = 10 ^ dB/40)"] pub fn ndspChnIirBiquadSetParamsPeakingEqualizer( id: ::libc::c_int, f0: f32, @@ -21579,252 +17064,133 @@ extern "C" { gain: f32, ) -> bool; } -#[doc = "Normal keyboard with several pages (QWERTY/accents/symbol/mobile)"] -#[doc = ""] - +#[doc = "< Normal keyboard with several pages (QWERTY/accents/symbol/mobile)"] pub const SWKBD_TYPE_NORMAL: SwkbdType = 0; -#[doc = "QWERTY keyboard only."] -#[doc = ""] - +#[doc = "< QWERTY keyboard only."] pub const SWKBD_TYPE_QWERTY: SwkbdType = 1; -#[doc = "Number pad."] -#[doc = ""] - +#[doc = "< Number pad."] pub const SWKBD_TYPE_NUMPAD: SwkbdType = 2; -#[doc = "On JPN systems, a text keyboard without Japanese input capabilities, otherwise same as SWKBD_TYPE_NORMAL."] -#[doc = ""] - +#[doc = "< On JPN systems, a text keyboard without Japanese input capabilities, otherwise same as SWKBD_TYPE_NORMAL."] pub const SWKBD_TYPE_WESTERN: SwkbdType = 3; -#[doc = "Keyboard types."] -#[doc = ""] - +#[doc = " Keyboard types."] pub type SwkbdType = ::libc::c_uint; -#[doc = "All inputs are accepted."] -#[doc = ""] - +#[doc = "< All inputs are accepted."] pub const SWKBD_ANYTHING: SwkbdValidInput = 0; -#[doc = "Empty inputs are not accepted."] -#[doc = ""] - +#[doc = "< Empty inputs are not accepted."] pub const SWKBD_NOTEMPTY: SwkbdValidInput = 1; -#[doc = "Empty or blank inputs (consisting solely of whitespace) are not accepted."] -#[doc = ""] - +#[doc = "< Empty or blank inputs (consisting solely of whitespace) are not accepted."] pub const SWKBD_NOTEMPTY_NOTBLANK: SwkbdValidInput = 2; pub const SWKBD_NOTBLANK_NOTEMPTY: SwkbdValidInput = 2; -#[doc = "Blank inputs (consisting solely of whitespace) are not accepted, but empty inputs are."] -#[doc = ""] - +#[doc = "< Blank inputs (consisting solely of whitespace) are not accepted, but empty inputs are."] pub const SWKBD_NOTBLANK: SwkbdValidInput = 3; -#[doc = "The input must have a fixed length (specified by maxTextLength in swkbdInit)."] -#[doc = ""] - +#[doc = "< The input must have a fixed length (specified by maxTextLength in swkbdInit)."] pub const SWKBD_FIXEDLEN: SwkbdValidInput = 4; -#[doc = "Accepted input types."] -#[doc = ""] - +#[doc = " Accepted input types."] pub type SwkbdValidInput = ::libc::c_uint; -#[doc = "Left button (usually Cancel)"] -#[doc = ""] - +#[doc = "< Left button (usually Cancel)"] pub const SWKBD_BUTTON_LEFT: SwkbdButton = 0; -#[doc = "Middle button (usually I Forgot)"] -#[doc = ""] - +#[doc = "< Middle button (usually I Forgot)"] pub const SWKBD_BUTTON_MIDDLE: SwkbdButton = 1; -#[doc = "Right button (usually OK)"] -#[doc = ""] - +#[doc = "< Right button (usually OK)"] pub const SWKBD_BUTTON_RIGHT: SwkbdButton = 2; pub const SWKBD_BUTTON_CONFIRM: SwkbdButton = 2; -#[doc = "No button (returned by swkbdInputText in special cases)"] -#[doc = ""] - +#[doc = "< No button (returned by swkbdInputText in special cases)"] pub const SWKBD_BUTTON_NONE: SwkbdButton = 3; -#[doc = "Keyboard dialog buttons."] -#[doc = ""] - +#[doc = " Keyboard dialog buttons."] pub type SwkbdButton = ::libc::c_uint; -#[doc = "Characters are not concealed."] -#[doc = ""] - +#[doc = "< Characters are not concealed."] pub const SWKBD_PASSWORD_NONE: SwkbdPasswordMode = 0; -#[doc = "Characters are concealed immediately."] -#[doc = ""] - +#[doc = "< Characters are concealed immediately."] pub const SWKBD_PASSWORD_HIDE: SwkbdPasswordMode = 1; -#[doc = "Characters are concealed a second after they've been typed."] -#[doc = ""] - +#[doc = "< Characters are concealed a second after they've been typed."] pub const SWKBD_PASSWORD_HIDE_DELAY: SwkbdPasswordMode = 2; -#[doc = "Keyboard password modes."] -#[doc = ""] - +#[doc = " Keyboard password modes."] pub type SwkbdPasswordMode = ::libc::c_uint; -#[doc = "Disallow the use of more than a certain number of digits (0 or more)"] -#[doc = ""] - +#[doc = "< Disallow the use of more than a certain number of digits (0 or more)"] pub const SWKBD_FILTER_DIGITS: _bindgen_ty_32 = 1; -#[doc = "Disallow the use of the @ sign."] -#[doc = ""] - +#[doc = "< Disallow the use of the sign."] pub const SWKBD_FILTER_AT: _bindgen_ty_32 = 2; -#[doc = "Disallow the use of the % sign."] -#[doc = ""] - +#[doc = "< Disallow the use of the % sign."] pub const SWKBD_FILTER_PERCENT: _bindgen_ty_32 = 4; -#[doc = "Disallow the use of the \\ sign."] -#[doc = ""] - +#[doc = "< Disallow the use of the sign."] pub const SWKBD_FILTER_BACKSLASH: _bindgen_ty_32 = 8; -#[doc = "Disallow profanity using Nintendo's profanity filter."] -#[doc = ""] - +#[doc = "< Disallow profanity using Nintendo's profanity filter."] pub const SWKBD_FILTER_PROFANITY: _bindgen_ty_32 = 16; -#[doc = "Use a callback in order to check the input."] -#[doc = ""] - +#[doc = "< Use a callback in order to check the input."] pub const SWKBD_FILTER_CALLBACK: _bindgen_ty_32 = 32; -#[doc = "Keyboard input filtering flags."] -#[doc = ""] - +#[doc = " Keyboard input filtering flags."] pub type _bindgen_ty_32 = ::libc::c_uint; -#[doc = "Parental PIN mode."] -#[doc = ""] - +#[doc = "< Parental PIN mode."] pub const SWKBD_PARENTAL: _bindgen_ty_33 = 1; -#[doc = "Darken the top screen when the keyboard is shown."] -#[doc = ""] - +#[doc = "< Darken the top screen when the keyboard is shown."] pub const SWKBD_DARKEN_TOP_SCREEN: _bindgen_ty_33 = 2; -#[doc = "Enable predictive input (necessary for Kanji input in JPN systems)."] -#[doc = ""] - +#[doc = "< Enable predictive input (necessary for Kanji input in JPN systems)."] pub const SWKBD_PREDICTIVE_INPUT: _bindgen_ty_33 = 4; -#[doc = "Enable multiline input."] -#[doc = ""] - +#[doc = "< Enable multiline input."] pub const SWKBD_MULTILINE: _bindgen_ty_33 = 8; -#[doc = "Enable fixed-width mode."] -#[doc = ""] - +#[doc = "< Enable fixed-width mode."] pub const SWKBD_FIXED_WIDTH: _bindgen_ty_33 = 16; -#[doc = "Allow the usage of the HOME button."] -#[doc = ""] - +#[doc = "< Allow the usage of the HOME button."] pub const SWKBD_ALLOW_HOME: _bindgen_ty_33 = 32; -#[doc = "Allow the usage of a software-reset combination."] -#[doc = ""] - +#[doc = "< Allow the usage of a software-reset combination."] pub const SWKBD_ALLOW_RESET: _bindgen_ty_33 = 64; -#[doc = "Allow the usage of the POWER button."] -#[doc = ""] - +#[doc = "< Allow the usage of the POWER button."] pub const SWKBD_ALLOW_POWER: _bindgen_ty_33 = 128; -#[doc = "Default to the QWERTY page when the keyboard is shown."] -#[doc = ""] - +#[doc = "< Default to the QWERTY page when the keyboard is shown."] pub const SWKBD_DEFAULT_QWERTY: _bindgen_ty_33 = 512; -#[doc = "Keyboard features."] -#[doc = ""] - +#[doc = " Keyboard features."] pub type _bindgen_ty_33 = ::libc::c_uint; -#[doc = "Specifies that the input is valid."] -#[doc = ""] - +#[doc = "< Specifies that the input is valid."] pub const SWKBD_CALLBACK_OK: SwkbdCallbackResult = 0; -#[doc = "Displays an error message, then closes the keyboard."] -#[doc = ""] - +#[doc = "< Displays an error message, then closes the keyboard."] pub const SWKBD_CALLBACK_CLOSE: SwkbdCallbackResult = 1; -#[doc = "Displays an error message and continues displaying the keyboard."] -#[doc = ""] - +#[doc = "< Displays an error message and continues displaying the keyboard."] pub const SWKBD_CALLBACK_CONTINUE: SwkbdCallbackResult = 2; -#[doc = "Keyboard filter callback return values."] -#[doc = ""] - +#[doc = " Keyboard filter callback return values."] pub type SwkbdCallbackResult = ::libc::c_uint; -#[doc = "Dummy/unused."] -#[doc = ""] - +#[doc = "< Dummy/unused."] pub const SWKBD_NONE: SwkbdResult = -1; -#[doc = "Invalid parameters to swkbd."] -#[doc = ""] - +#[doc = "< Invalid parameters to swkbd."] pub const SWKBD_INVALID_INPUT: SwkbdResult = -2; -#[doc = "Out of memory."] -#[doc = ""] - +#[doc = "< Out of memory."] pub const SWKBD_OUTOFMEM: SwkbdResult = -3; -#[doc = "The button was clicked in 1-button dialogs."] -#[doc = ""] - +#[doc = "< The button was clicked in 1-button dialogs."] pub const SWKBD_D0_CLICK: SwkbdResult = 0; -#[doc = "The left button was clicked in 2-button dialogs."] -#[doc = ""] - +#[doc = "< The left button was clicked in 2-button dialogs."] pub const SWKBD_D1_CLICK0: SwkbdResult = 1; -#[doc = "The right button was clicked in 2-button dialogs."] -#[doc = ""] - +#[doc = "< The right button was clicked in 2-button dialogs."] pub const SWKBD_D1_CLICK1: SwkbdResult = 2; -#[doc = "The left button was clicked in 3-button dialogs."] -#[doc = ""] - +#[doc = "< The left button was clicked in 3-button dialogs."] pub const SWKBD_D2_CLICK0: SwkbdResult = 3; -#[doc = "The middle button was clicked in 3-button dialogs."] -#[doc = ""] - +#[doc = "< The middle button was clicked in 3-button dialogs."] pub const SWKBD_D2_CLICK1: SwkbdResult = 4; -#[doc = "The right button was clicked in 3-button dialogs."] -#[doc = ""] - +#[doc = "< The right button was clicked in 3-button dialogs."] pub const SWKBD_D2_CLICK2: SwkbdResult = 5; -#[doc = "The HOME button was pressed."] -#[doc = ""] - +#[doc = "< The HOME button was pressed."] pub const SWKBD_HOMEPRESSED: SwkbdResult = 10; -#[doc = "The soft-reset key combination was pressed."] -#[doc = ""] - +#[doc = "< The soft-reset key combination was pressed."] pub const SWKBD_RESETPRESSED: SwkbdResult = 11; -#[doc = "The POWER button was pressed."] -#[doc = ""] - +#[doc = "< The POWER button was pressed."] pub const SWKBD_POWERPRESSED: SwkbdResult = 12; -#[doc = "The parental PIN was verified successfully."] -#[doc = ""] - +#[doc = "< The parental PIN was verified successfully."] pub const SWKBD_PARENTAL_OK: SwkbdResult = 20; -#[doc = "The parental PIN was incorrect."] -#[doc = ""] - +#[doc = "< The parental PIN was incorrect."] pub const SWKBD_PARENTAL_FAIL: SwkbdResult = 21; -#[doc = "The filter callback returned SWKBD_CALLBACK_CLOSE."] -#[doc = ""] - +#[doc = "< The filter callback returned SWKBD_CALLBACK_CLOSE."] pub const SWKBD_BANNED_INPUT: SwkbdResult = 30; -#[doc = "Keyboard return values."] -#[doc = ""] - +#[doc = " Keyboard return values."] pub type SwkbdResult = ::libc::c_int; -#[doc = "Keyboard dictionary word for predictive input."] -#[doc = ""] +#[doc = " Keyboard dictionary word for predictive input."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct SwkbdDictWord { - #[doc = "Reading of the word (that is, the string that needs to be typed)."] - #[doc = ""] + #[doc = "< Reading of the word (that is, the string that needs to be typed)."] pub reading: [u16_; 41usize], - #[doc = "Spelling of the word."] - #[doc = ""] + #[doc = "< Spelling of the word."] pub word: [u16_; 41usize], - #[doc = "Language the word applies to."] - #[doc = ""] + #[doc = "< Language the word applies to."] pub language: u8_, - #[doc = "Specifies if the word applies to all languages."] - #[doc = ""] + #[doc = "< Specifies if the word applies to all languages."] pub all_languages: bool, } impl Default for SwkbdDictWord { @@ -21836,9 +17202,7 @@ impl Default for SwkbdDictWord { } } } -#[doc = "Keyboard filter callback function."] -#[doc = ""] - +#[doc = " Keyboard filter callback function."] pub type SwkbdCallbackFn = ::core::option::Option< unsafe extern "C" fn( user: *mut ::libc::c_void, @@ -21847,15 +17211,13 @@ pub type SwkbdCallbackFn = ::core::option::Option< textlen: usize, ) -> SwkbdCallbackResult, >; -#[doc = "Keyboard status data."] -#[doc = ""] +#[doc = " Keyboard status data."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct SwkbdStatusData { pub data: [u32_; 17usize], } -#[doc = "Keyboard predictive input learning data."] -#[doc = ""] +#[doc = " Keyboard predictive input learning data."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct SwkbdLearningData { @@ -21870,8 +17232,7 @@ impl Default for SwkbdLearningData { } } } -#[doc = "Internal libctru book-keeping structure for software keyboards."] -#[doc = ""] +#[doc = " Internal libctru book-keeping structure for software keyboards."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct SwkbdExtra { @@ -21891,8 +17252,7 @@ impl Default for SwkbdExtra { } } } -#[doc = "Software keyboard parameter structure, it shouldn't be modified directly."] -#[doc = ""] +#[doc = " Software keyboard parameter structure, it shouldn't be modified directly."] #[repr(C)] #[derive(Copy, Clone)] pub struct SwkbdState { @@ -21961,8 +17321,7 @@ impl Default for SwkbdState { } } extern "C" { - #[doc = "Initializes software keyboard status.\n @param swkbd Pointer to swkbd state.\n @param type Keyboard type.\n @param numButtons Number of dialog buttons to display (1, 2 or 3).\n @param maxTextLength Maximum number of UTF-16 code units that input text can have (or -1 to let libctru use a big default)."] - #[doc = ""] + #[doc = " Initializes software keyboard status.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `type` - Keyboard type.\n * `numButtons` - Number of dialog buttons to display (1, 2 or 3).\n * `maxTextLength` - Maximum number of UTF-16 code units that input text can have (or -1 to let libctru use a big default)."] pub fn swkbdInit( swkbd: *mut SwkbdState, type_: SwkbdType, @@ -21971,18 +17330,15 @@ extern "C" { ); } extern "C" { - #[doc = "Specifies which special features are enabled in a software keyboard.\n @param swkbd Pointer to swkbd state.\n @param features Feature bitmask."] - #[doc = ""] + #[doc = " Specifies which special features are enabled in a software keyboard.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `features` - Feature bitmask."] pub fn swkbdSetFeatures(swkbd: *mut SwkbdState, features: u32_); } extern "C" { - #[doc = "Sets the hint text of a software keyboard (that is, the help text that is displayed when the textbox is empty).\n @param swkbd Pointer to swkbd state.\n @param text Hint text."] - #[doc = ""] + #[doc = " Sets the hint text of a software keyboard (that is, the help text that is displayed when the textbox is empty).\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `text` - Hint text."] pub fn swkbdSetHintText(swkbd: *mut SwkbdState, text: *const ::libc::c_char); } extern "C" { - #[doc = "Configures a dialog button in a software keyboard.\n @param swkbd Pointer to swkbd state.\n @param button Specifies which button to configure.\n @param text Button text.\n @param submit Specifies whether pushing the button will submit the text or discard it."] - #[doc = ""] + #[doc = " Configures a dialog button in a software keyboard.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `button` - Specifies which button to configure.\n * `text` - Button text.\n * `submit` - Specifies whether pushing the button will submit the text or discard it."] pub fn swkbdSetButton( swkbd: *mut SwkbdState, button: SwkbdButton, @@ -21991,13 +17347,11 @@ extern "C" { ); } extern "C" { - #[doc = "Sets the initial text that a software keyboard will display on launch.\n @param swkbd Pointer to swkbd state.\n @param text Initial text."] - #[doc = ""] + #[doc = " Sets the initial text that a software keyboard will display on launch.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `text` - Initial text."] pub fn swkbdSetInitialText(swkbd: *mut SwkbdState, text: *const ::libc::c_char); } extern "C" { - #[doc = "Configures a word in a predictive dictionary for use with a software keyboard.\n @param word Pointer to dictionary word structure.\n @param reading Reading of the word, that is, the sequence of characters that need to be typed to trigger the word in the predictive input system.\n @param text Spelling of the word, that is, the actual characters that will be produced when the user decides to select the word."] - #[doc = ""] + #[doc = " Configures a word in a predictive dictionary for use with a software keyboard.\n # Arguments\n\n* `word` - Pointer to dictionary word structure.\n * `reading` - Reading of the word, that is, the sequence of characters that need to be typed to trigger the word in the predictive input system.\n * `text` - Spelling of the word, that is, the actual characters that will be produced when the user decides to select the word."] pub fn swkbdSetDictWord( word: *mut SwkbdDictWord, reading: *const ::libc::c_char, @@ -22005,8 +17359,7 @@ extern "C" { ); } extern "C" { - #[doc = "Sets the custom word dictionary to be used with the predictive input system of a software keyboard.\n @param swkbd Pointer to swkbd state.\n @param dict Pointer to dictionary words.\n @param wordCount Number of words in the dictionary."] - #[doc = ""] + #[doc = " Sets the custom word dictionary to be used with the predictive input system of a software keyboard.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `dict` - Pointer to dictionary words.\n * `wordCount` - Number of words in the dictionary."] pub fn swkbdSetDictionary( swkbd: *mut SwkbdState, dict: *const SwkbdDictWord, @@ -22014,8 +17367,7 @@ extern "C" { ); } extern "C" { - #[doc = "Configures software keyboard internal status management.\n @param swkbd Pointer to swkbd state.\n @param data Pointer to internal status structure (can be in, out or both depending on the other parameters).\n @param in Specifies whether the data should be read from the structure when the keyboard is launched.\n @param out Specifies whether the data should be written to the structure when the keyboard is closed."] - #[doc = ""] + #[doc = " Configures software keyboard internal status management.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `data` - Pointer to internal status structure (can be in, out or both depending on the other parameters).\n * `in` - Specifies whether the data should be read from the structure when the keyboard is launched.\n * `out` - Specifies whether the data should be written to the structure when the keyboard is closed."] pub fn swkbdSetStatusData( swkbd: *mut SwkbdState, data: *mut SwkbdStatusData, @@ -22024,8 +17376,7 @@ extern "C" { ); } extern "C" { - #[doc = "Configures software keyboard predictive input learning data management.\n @param swkbd Pointer to swkbd state.\n @param data Pointer to learning data structure (can be in, out or both depending on the other parameters).\n @param in Specifies whether the data should be read from the structure when the keyboard is launched.\n @param out Specifies whether the data should be written to the structure when the keyboard is closed."] - #[doc = ""] + #[doc = " Configures software keyboard predictive input learning data management.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `data` - Pointer to learning data structure (can be in, out or both depending on the other parameters).\n * `in` - Specifies whether the data should be read from the structure when the keyboard is launched.\n * `out` - Specifies whether the data should be written to the structure when the keyboard is closed."] pub fn swkbdSetLearningData( swkbd: *mut SwkbdState, data: *mut SwkbdLearningData, @@ -22034,8 +17385,7 @@ extern "C" { ); } extern "C" { - #[doc = "Configures a custom function to be used to check the validity of input when it is submitted in a software keyboard.\n @param swkbd Pointer to swkbd state.\n @param callback Filter callback function.\n @param user Custom data to be passed to the callback function."] - #[doc = ""] + #[doc = " Configures a custom function to be used to check the validity of input when it is submitted in a software keyboard.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `callback` - Filter callback function.\n * `user` - Custom data to be passed to the callback function."] pub fn swkbdSetFilterCallback( swkbd: *mut SwkbdState, callback: SwkbdCallbackFn, @@ -22043,8 +17393,7 @@ extern "C" { ); } extern "C" { - #[doc = "Launches a software keyboard in order to input text.\n @param swkbd Pointer to swkbd state.\n @param buf Pointer to output buffer which will hold the inputted text.\n @param bufsize Maximum number of UTF-8 code units that the buffer can hold (including null terminator).\n @return The identifier of the dialog button that was pressed, or SWKBD_BUTTON_NONE if a different condition was triggered - in that case use swkbdGetResult to check the condition."] - #[doc = ""] + #[doc = " Launches a software keyboard in order to input text.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `buf` - Pointer to output buffer which will hold the inputted text.\n * `bufsize` - Maximum number of UTF-8 code units that the buffer can hold (including null terminator).\n # Returns\n\nThe identifier of the dialog button that was pressed, or SWKBD_BUTTON_NONE if a different condition was triggered - in that case use swkbdGetResult to check the condition."] pub fn swkbdInputText( swkbd: *mut SwkbdState, buf: *mut ::libc::c_char, @@ -22052,57 +17401,31 @@ extern "C" { ) -> SwkbdButton; } #[doc = "checksum` is the same as the one computed from `returnbuf`"] - #[doc = ""] + #[doc = " Verifies that the Mii data returned from the applet matches its\n checksum\n\n # Arguments\n\n* `returnbuf` - Buffer filled by Mii selector applet\n # Returns\n\n`true` if `returnbuf->checksum` is the same as the one computed from `returnbuf`"] pub fn miiSelectorChecksumIsValid(returnbuf: *const MiiSelectorReturn) -> bool; } -#[doc = "Open directory struct"] -#[doc = ""] +#[doc = " Open directory struct"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct archive_dir_t { pub magic: u32_, - + #[doc = " \"arch\""] pub fd: Handle, - #[doc = "CTRU handle"] - #[doc = ""] + #[doc = " CTRU handle"] pub index: isize, - #[doc = "Current entry index"] - #[doc = ""] + #[doc = " Current entry index"] pub size: usize, - #[doc = "Current batch size"] - #[doc = ""] + #[doc = " Current batch size"] pub entry_data: [FS_DirectoryEntry; 32usize], } impl Default for archive_dir_t { @@ -22360,14 +17632,12 @@ impl Default for archive_dir_t { } extern "C" { #[must_use] - #[doc = "Mounts the SD"] - #[doc = ""] + #[doc = " Mounts the SD"] pub fn archiveMountSdmc() -> Result; } extern "C" { #[must_use] - #[doc = "Mounts and opens an archive as deviceName\n Returns either an archive open error code, or -1 for generic failure"] - #[doc = ""] + #[doc = " Mounts and opens an archive as deviceName\n Returns either an archive open error code, or -1 for generic failure"] pub fn archiveMount( archiveID: FS_ArchiveID, archivePath: FS_Path, @@ -22376,140 +17646,105 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Uses FSUSER_ControlArchive with control action ARCHIVE_ACTION_COMMIT_SAVE_DATA on the opened archive. Not done automatically at unmount.\n Returns -1 if the specified device is not found"] - #[doc = ""] + #[doc = " Uses FSUSER_ControlArchive with control action ARCHIVE_ACTION_COMMIT_SAVE_DATA on the opened archive. Not done automatically at unmount.\n Returns -1 if the specified device is not found"] pub fn archiveCommitSaveData(deviceName: *const ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = "Unmounts the specified device, closing its archive in the process\n Returns -1 if the specified device was not found"] - #[doc = ""] + #[doc = " Unmounts the specified device, closing its archive in the process\n Returns -1 if the specified device was not found"] pub fn archiveUnmount(deviceName: *const ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = "Unmounts all devices and cleans up any resources used by the driver"] - #[doc = ""] + #[doc = " Unmounts all devices and cleans up any resources used by the driver"] pub fn archiveUnmountAll() -> Result; } extern "C" { #[must_use] - #[doc = "Get a file's mtime"] - #[doc = ""] + #[doc = " Get a file's mtime"] pub fn archive_getmtime(name: *const ::libc::c_char, mtime: *mut u64_) -> Result; } -#[doc = "RomFS header."] -#[doc = ""] +#[doc = " RomFS header."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct romfs_header { - #[doc = "Size of the header."] - #[doc = ""] + #[doc = "< Size of the header."] pub headerSize: u32_, - #[doc = "Offset of the directory hash table."] - #[doc = ""] + #[doc = "< Offset of the directory hash table."] pub dirHashTableOff: u32_, - #[doc = "Size of the directory hash table."] - #[doc = ""] + #[doc = "< Size of the directory hash table."] pub dirHashTableSize: u32_, - #[doc = "Offset of the directory table."] - #[doc = ""] + #[doc = "< Offset of the directory table."] pub dirTableOff: u32_, - #[doc = "Size of the directory table."] - #[doc = ""] + #[doc = "< Size of the directory table."] pub dirTableSize: u32_, - #[doc = "Offset of the file hash table."] - #[doc = ""] + #[doc = "< Offset of the file hash table."] pub fileHashTableOff: u32_, - #[doc = "Size of the file hash table."] - #[doc = ""] + #[doc = "< Size of the file hash table."] pub fileHashTableSize: u32_, - #[doc = "Offset of the file table."] - #[doc = ""] + #[doc = "< Offset of the file table."] pub fileTableOff: u32_, - #[doc = "Size of the file table."] - #[doc = ""] + #[doc = "< Size of the file table."] pub fileTableSize: u32_, - #[doc = "Offset of the file data."] - #[doc = ""] + #[doc = "< Offset of the file data."] pub fileDataOff: u32_, } -#[doc = "RomFS directory."] -#[doc = ""] +#[doc = " RomFS directory."] #[repr(C)] #[derive(Debug, Default)] pub struct romfs_dir { - #[doc = "Offset of the parent directory."] - #[doc = ""] + #[doc = "< Offset of the parent directory."] pub parent: u32_, - #[doc = "Offset of the next sibling directory."] - #[doc = ""] + #[doc = "< Offset of the next sibling directory."] pub sibling: u32_, - #[doc = "Offset of the first child directory."] - #[doc = ""] + #[doc = "< Offset of the first child directory."] pub childDir: u32_, - #[doc = "Offset of the first file."] - #[doc = ""] + #[doc = "< Offset of the first file."] pub childFile: u32_, - #[doc = "Directory hash table pointer."] - #[doc = ""] + #[doc = "< Directory hash table pointer."] pub nextHash: u32_, - #[doc = "Name length."] - #[doc = ""] + #[doc = "< Name length."] pub nameLen: u32_, - #[doc = "Name. (UTF-16)"] - #[doc = ""] + #[doc = "< Name. (UTF-16)"] pub name: __IncompleteArrayField, } -#[doc = "RomFS file."] -#[doc = ""] +#[doc = " RomFS file."] #[repr(C)] #[derive(Debug, Default)] pub struct romfs_file { - #[doc = "Offset of the parent directory."] - #[doc = ""] + #[doc = "< Offset of the parent directory."] pub parent: u32_, - #[doc = "Offset of the next sibling file."] - #[doc = ""] + #[doc = "< Offset of the next sibling file."] pub sibling: u32_, - #[doc = "Offset of the file's data."] - #[doc = ""] + #[doc = "< Offset of the file's data."] pub dataOff: u64_, - #[doc = "Length of the file's data."] - #[doc = ""] + #[doc = "< Length of the file's data."] pub dataSize: u64_, - #[doc = "File hash table pointer."] - #[doc = ""] + #[doc = "< File hash table pointer."] pub nextHash: u32_, - #[doc = "Name length."] - #[doc = ""] + #[doc = "< Name length."] pub nameLen: u32_, - #[doc = "Name. (UTF-16)"] - #[doc = ""] + #[doc = "< Name. (UTF-16)"] pub name: __IncompleteArrayField, } extern "C" { #[must_use] - #[doc = "Mounts the Application's RomFS.\n @param name Device mount name.\n @remark This function is intended to be used to access one's own RomFS.\n If the application is running as 3DSX, it mounts the embedded RomFS section inside the 3DSX.\n If on the other hand it's an NCCH, it behaves identically to [`romfsMountFromCurrentProcess`]"] - #[doc = ""] + #[doc = " Mounts the Application's RomFS.\n # Arguments\n\n* `name` - Device mount name.\n > This function is intended to be used to access one's own RomFS.\n If the application is running as 3DSX, it mounts the embedded RomFS section inside the 3DSX.\n If on the other hand it's an NCCH, it behaves identically to romfsMountFromCurrentProcess."] pub fn romfsMountSelf(name: *const ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = "Mounts RomFS from an open file.\n @param fd FSFILE handle of the RomFS image.\n @param offset Offset of the RomFS within the file.\n @param name Device mount name."] - #[doc = ""] + #[doc = " Mounts RomFS from an open file.\n # Arguments\n\n* `fd` - FSFILE handle of the RomFS image.\n * `offset` - Offset of the RomFS within the file.\n * `name` - Device mount name."] pub fn romfsMountFromFile(fd: Handle, offset: u32_, name: *const ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = "Mounts RomFS using the current process host program RomFS.\n @param name Device mount name."] - #[doc = ""] + #[doc = " Mounts RomFS using the current process host program RomFS.\n # Arguments\n\n* `name` - Device mount name."] pub fn romfsMountFromCurrentProcess(name: *const ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = "Mounts RomFS from the specified title.\n @param tid Title ID\n @param mediatype Mediatype\n @param name Device mount name."] - #[doc = ""] + #[doc = " Mounts RomFS from the specified title.\n # Arguments\n\n* `tid` - Title ID\n * `mediatype` - Mediatype\n * `name` - Device mount name."] pub fn romfsMountFromTitle( tid: u64_, mediatype: FS_MediaType, @@ -22518,65 +17753,47 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Unmounts the RomFS device."] - #[doc = ""] + #[doc = " Unmounts the RomFS device."] pub fn romfsUnmount(name: *const ::libc::c_char) -> Result; } -#[doc = "Character width information structure."] -#[doc = ""] +#[doc = " Character width information structure."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct charWidthInfo_s { - #[doc = "Horizontal offset to draw the glyph with."] - #[doc = ""] + #[doc = "< Horizontal offset to draw the glyph with."] pub left: s8, - #[doc = "Width of the glyph."] - #[doc = ""] + #[doc = "< Width of the glyph."] pub glyphWidth: u8_, - #[doc = "Width of the character, that is, horizontal distance to advance."] - #[doc = ""] + #[doc = "< Width of the character, that is, horizontal distance to advance."] pub charWidth: u8_, } -#[doc = "Font texture sheet information."] -#[doc = ""] +#[doc = " Font texture sheet information."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct TGLP_s { - #[doc = "Width of a glyph cell."] - #[doc = ""] + #[doc = "< Width of a glyph cell."] pub cellWidth: u8_, - #[doc = "Height of a glyph cell."] - #[doc = ""] + #[doc = "< Height of a glyph cell."] pub cellHeight: u8_, - #[doc = "Vertical position of the baseline."] - #[doc = ""] + #[doc = "< Vertical position of the baseline."] pub baselinePos: u8_, - #[doc = "Maximum character width."] - #[doc = ""] + #[doc = "< Maximum character width."] pub maxCharWidth: u8_, - #[doc = "Size in bytes of a texture sheet."] - #[doc = ""] + #[doc = "< Size in bytes of a texture sheet."] pub sheetSize: u32_, - #[doc = "Number of texture sheets."] - #[doc = ""] + #[doc = "< Number of texture sheets."] pub nSheets: u16_, - #[doc = "GPU texture format (GPU_TEXCOLOR)."] - #[doc = ""] + #[doc = "< GPU texture format (GPU_TEXCOLOR)."] pub sheetFmt: u16_, - #[doc = "Number of glyphs per row per sheet."] - #[doc = ""] + #[doc = "< Number of glyphs per row per sheet."] pub nRows: u16_, - #[doc = "Number of glyph rows per sheet."] - #[doc = ""] + #[doc = "< Number of glyph rows per sheet."] pub nLines: u16_, - #[doc = "Texture sheet width."] - #[doc = ""] + #[doc = "< Texture sheet width."] pub sheetWidth: u16_, - #[doc = "Texture sheet height."] - #[doc = ""] + #[doc = "< Texture sheet height."] pub sheetHeight: u16_, - #[doc = "Pointer to texture sheet data."] - #[doc = ""] + #[doc = "< Pointer to texture sheet data."] pub sheetData: *mut u8_, } impl Default for TGLP_s { @@ -22588,26 +17805,19 @@ impl Default for TGLP_s { } } } -#[doc = "Font character width information block structure."] -#[doc = ""] - +#[doc = " Font character width information block structure."] pub type CWDH_s = tag_CWDH_s; -#[doc = "Font character width information block structure."] -#[doc = ""] +#[doc = " Font character width information block structure."] #[repr(C)] #[derive(Debug)] pub struct tag_CWDH_s { - #[doc = "First Unicode codepoint the block applies to."] - #[doc = ""] + #[doc = "< First Unicode codepoint the block applies to."] pub startIndex: u16_, - #[doc = "Last Unicode codepoint the block applies to."] - #[doc = ""] + #[doc = "< Last Unicode codepoint the block applies to."] pub endIndex: u16_, - #[doc = "Pointer to the next block."] - #[doc = ""] + #[doc = "< Pointer to the next block."] pub next: *mut CWDH_s, - #[doc = "Table of character width information structures."] - #[doc = ""] + #[doc = "< Table of character width information structures."] pub widths: __IncompleteArrayField, } impl Default for tag_CWDH_s { @@ -22619,76 +17829,54 @@ impl Default for tag_CWDH_s { } } } -#[doc = "Identity mapping."] -#[doc = ""] - +#[doc = "< Identity mapping."] pub const CMAP_TYPE_DIRECT: _bindgen_ty_36 = 0; -#[doc = "Mapping using a table."] -#[doc = ""] - +#[doc = "< Mapping using a table."] pub const CMAP_TYPE_TABLE: _bindgen_ty_36 = 1; -#[doc = "Mapping using a list of mapped characters."] -#[doc = ""] - +#[doc = "< Mapping using a list of mapped characters."] pub const CMAP_TYPE_SCAN: _bindgen_ty_36 = 2; -#[doc = "Font character map methods."] -#[doc = ""] - +#[doc = " Font character map methods."] pub type _bindgen_ty_36 = ::libc::c_uint; -#[doc = "Font character map structure."] -#[doc = ""] - +#[doc = " Font character map structure."] pub type CMAP_s = tag_CMAP_s; -#[doc = "Font character map structure."] -#[doc = ""] +#[doc = " Font character map structure."] #[repr(C)] pub struct tag_CMAP_s { - #[doc = "First Unicode codepoint the block applies to."] - #[doc = ""] + #[doc = "< First Unicode codepoint the block applies to."] pub codeBegin: u16_, - #[doc = "Last Unicode codepoint the block applies to."] - #[doc = ""] + #[doc = "< Last Unicode codepoint the block applies to."] pub codeEnd: u16_, - #[doc = "Mapping method."] - #[doc = ""] + #[doc = "< Mapping method."] pub mappingMethod: u16_, pub reserved: u16_, - #[doc = "Pointer to the next map."] - #[doc = ""] + #[doc = "< Pointer to the next map."] 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 { - #[doc = "For CMAP_TYPE_DIRECT: index of the first glyph."] - #[doc = ""] + #[doc = "< For CMAP_TYPE_DIRECT: index of the first glyph."] pub indexOffset: __BindgenUnionField, - #[doc = "For CMAP_TYPE_TABLE: table of glyph indices."] - #[doc = ""] + #[doc = "< For CMAP_TYPE_TABLE: table of glyph indices."] pub indexTable: __BindgenUnionField<[u16_; 0usize]>, pub __bindgen_anon_1: __BindgenUnionField, pub bindgen_union_field: u16, } -#[doc = "For CMAP_TYPE_SCAN: Mapping data."] -#[doc = ""] +#[doc = " For CMAP_TYPE_SCAN: Mapping data."] #[repr(C)] #[derive(Debug, Default)] pub struct tag_CMAP_s__bindgen_ty_1__bindgen_ty_1 { - #[doc = "Number of pairs."] - #[doc = ""] + #[doc = "< Number of pairs."] pub nScanEntries: u16_, pub scanEntries: __IncompleteArrayField, } -#[doc = "Mapping pairs."] -#[doc = ""] +#[doc = " Mapping pairs."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct tag_CMAP_s__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 { - #[doc = "Unicode codepoint."] - #[doc = ""] + #[doc = "< Unicode codepoint."] pub code: u16_, - #[doc = "Mapped glyph index."] - #[doc = ""] + #[doc = "< Mapped glyph index."] pub glyphIndex: u16_, } impl Default for tag_CMAP_s__bindgen_ty_1 { @@ -22709,49 +17897,35 @@ impl Default for tag_CMAP_s { } } } -#[doc = "Font information structure."] -#[doc = ""] +#[doc = " Font information structure."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct FINF_s { - #[doc = "Signature (FINF)."] - #[doc = ""] + #[doc = "< Signature (FINF)."] pub signature: u32_, - #[doc = "Section size."] - #[doc = ""] + #[doc = "< Section size."] pub sectionSize: u32_, - #[doc = "Font type"] - #[doc = ""] + #[doc = "< Font type"] pub fontType: u8_, - #[doc = "Line feed vertical distance."] - #[doc = ""] + #[doc = "< Line feed vertical distance."] pub lineFeed: u8_, - #[doc = "Glyph index of the replacement character."] - #[doc = ""] + #[doc = "< Glyph index of the replacement character."] pub alterCharIndex: u16_, - #[doc = "Default character width information."] - #[doc = ""] + #[doc = "< Default character width information."] pub defaultWidth: charWidthInfo_s, - #[doc = "Font encoding (?)"] - #[doc = ""] + #[doc = "< Font encoding (?)"] pub encoding: u8_, - #[doc = "Pointer to texture sheet information."] - #[doc = ""] + #[doc = "< Pointer to texture sheet information."] pub tglp: *mut TGLP_s, - #[doc = "Pointer to the first character width information block."] - #[doc = ""] + #[doc = "< Pointer to the first character width information block."] pub cwdh: *mut CWDH_s, - #[doc = "Pointer to the first character map."] - #[doc = ""] + #[doc = "< Pointer to the first character map."] pub cmap: *mut CMAP_s, - #[doc = "Font height."] - #[doc = ""] + #[doc = "< Font height."] pub height: u8_, - #[doc = "Font width."] - #[doc = ""] + #[doc = "< Font width."] pub width: u8_, - #[doc = "Font ascent."] - #[doc = ""] + #[doc = "< Font ascent."] pub ascent: u8_, pub padding: u8_, } @@ -22764,31 +17938,23 @@ impl Default for FINF_s { } } } -#[doc = "Font structure."] -#[doc = ""] +#[doc = " Font structure."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct CFNT_s { - #[doc = "Signature (CFNU)."] - #[doc = ""] + #[doc = "< Signature (CFNU)."] pub signature: u32_, - #[doc = "Endianness constant (0xFEFF)."] - #[doc = ""] + #[doc = "< Endianness constant (0xFEFF)."] pub endianness: u16_, - #[doc = "Header size."] - #[doc = ""] + #[doc = "< Header size."] pub headerSize: u16_, - #[doc = "Format version."] - #[doc = ""] + #[doc = "< Format version."] pub version: u32_, - #[doc = "File size."] - #[doc = ""] + #[doc = "< File size."] pub fileSize: u32_, - #[doc = "Number of blocks."] - #[doc = ""] + #[doc = "< Number of blocks."] pub nBlocks: u32_, - #[doc = "Font information."] - #[doc = ""] + #[doc = "< Font information."] pub finf: FINF_s, } impl Default for CFNT_s { @@ -22800,28 +17966,22 @@ impl Default for CFNT_s { } } } -#[doc = "Font glyph position structure."] -#[doc = ""] +#[doc = " Font glyph position structure."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct fontGlyphPos_s { - #[doc = "Texture sheet index to use to render the glyph."] - #[doc = ""] + #[doc = "< Texture sheet index to use to render the glyph."] pub sheetIndex: ::libc::c_int, - #[doc = "Horizontal offset to draw the glyph width."] - #[doc = ""] + #[doc = "< Horizontal offset to draw the glyph width."] pub xOffset: f32, - #[doc = "Horizontal distance to advance after drawing the glyph."] - #[doc = ""] + #[doc = "< Horizontal distance to advance after drawing the glyph."] pub xAdvance: f32, - #[doc = "Glyph width."] - #[doc = ""] + #[doc = "< Glyph width."] pub width: f32, pub texcoord: fontGlyphPos_s__bindgen_ty_1, pub vtxcoord: fontGlyphPos_s__bindgen_ty_2, } -#[doc = "Texture coordinates to use to render the glyph."] -#[doc = ""] +#[doc = " Texture coordinates to use to render the glyph."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct fontGlyphPos_s__bindgen_ty_1 { @@ -22830,8 +17990,7 @@ pub struct fontGlyphPos_s__bindgen_ty_1 { pub right: f32, pub bottom: f32, } -#[doc = "Vertex coordinates to use to render the glyph."] -#[doc = ""] +#[doc = " Vertex coordinates to use to render the glyph."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct fontGlyphPos_s__bindgen_ty_2 { @@ -22840,49 +17999,36 @@ pub struct fontGlyphPos_s__bindgen_ty_2 { pub right: f32, pub bottom: f32, } -#[doc = "Calculates vertex coordinates in addition to texture coordinates."] -#[doc = ""] - +#[doc = "< Calculates vertex coordinates in addition to texture coordinates."] pub const GLYPH_POS_CALC_VTXCOORD: _bindgen_ty_37 = 1; -#[doc = "Position the glyph at the baseline instead of at the top-left corner."] -#[doc = ""] - +#[doc = "< Position the glyph at the baseline instead of at the top-left corner."] pub const GLYPH_POS_AT_BASELINE: _bindgen_ty_37 = 2; -#[doc = "Indicates that the Y axis points up instead of down."] -#[doc = ""] - +#[doc = "< Indicates that the Y axis points up instead of down."] pub const GLYPH_POS_Y_POINTS_UP: _bindgen_ty_37 = 4; -#[doc = "Flags for use with fontCalcGlyphPos."] -#[doc = ""] - +#[doc = " Flags for use with fontCalcGlyphPos."] pub type _bindgen_ty_37 = ::libc::c_uint; extern "C" { #[must_use] - #[doc = "Ensures the shared system font is mapped."] - #[doc = ""] + #[doc = " Ensures the shared system font is mapped."] pub fn fontEnsureMapped() -> Result; } extern "C" { - #[doc = "Fixes the pointers internal to a just-loaded font\n @param font Font to fix\n @remark Should never be run on the system font, and only once on any other font."] - #[doc = ""] + #[doc = " Fixes the pointers internal to a just-loaded font\n # Arguments\n\n* `font` - Font to fix\n > Should never be run on the system font, and only once on any other font."] pub fn fontFixPointers(font: *mut CFNT_s); } extern "C" { - #[doc = "Retrieves the glyph index of the specified Unicode codepoint.\n @param font Pointer to font structure. If NULL, the shared system font is used.\n @param codePoint Unicode codepoint."] - #[doc = ""] + #[doc = " Retrieves the glyph index of the specified Unicode codepoint.\n # Arguments\n\n* `font` - Pointer to font structure. If NULL, the shared system font is used.\n * `codePoint` - Unicode codepoint."] pub fn fontGlyphIndexFromCodePoint(font: *mut CFNT_s, codePoint: u32_) -> ::libc::c_int; } extern "C" { - #[doc = "Retrieves character width information of the specified glyph.\n @param font Pointer to font structure. If NULL, the shared system font is used.\n @param glyphIndex Index of the glyph."] - #[doc = ""] + #[doc = " Retrieves character width information of the specified glyph.\n # Arguments\n\n* `font` - Pointer to font structure. If NULL, the shared system font is used.\n * `glyphIndex` - Index of the glyph."] pub fn fontGetCharWidthInfo( font: *mut CFNT_s, glyphIndex: ::libc::c_int, ) -> *mut charWidthInfo_s; } extern "C" { - #[doc = "Calculates position information for the specified glyph.\n @param out Output structure in which to write the information.\n @param font Pointer to font structure. If NULL, the shared system font is used.\n @param glyphIndex Index of the glyph.\n @param flags Calculation flags (see GLYPH_POS_* flags).\n @param scaleX Scale factor to apply horizontally.\n @param scaleY Scale factor to apply vertically."] - #[doc = ""] + #[doc = " Calculates position information for the specified glyph.\n # Arguments\n\n* `out` - Output structure in which to write the information.\n * `font` - Pointer to font structure. If NULL, the shared system font is used.\n * `glyphIndex` - Index of the glyph.\n * `flags` - Calculation flags (see GLYPH_POS_* flags).\n * `scaleX` - Scale factor to apply horizontally.\n * `scaleY` - Scale factor to apply vertically."] pub fn fontCalcGlyphPos( out: *mut fontGlyphPos_s, font: *mut CFNT_s, @@ -22920,12 +18066,10 @@ extern "C" { pub fn gdbHioDevSystem(command: *const ::libc::c_char) -> ::libc::c_int; } extern "C" { - #[doc = "Address of the host connected through 3dslink"] - #[doc = ""] + #[doc = " Address of the host connected through 3dslink"] pub static mut __3dslink_host: in_addr; } extern "C" { - #[doc = "Connects to the 3dslink host, setting up an output stream.\n @param[in] redirStdout Whether to redirect stdout to nxlink output.\n @param[in] redirStderr Whether to redirect stderr to nxlink output.\n @return Socket fd on success, negative number on failure.\n @note The socket should be closed with close() during application cleanup."] - #[doc = ""] + #[doc = " Connects to the 3dslink host, setting up an output stream.\n # Arguments\n\n* `redirStdout` (direction in) - Whether to redirect stdout to nxlink output.\n * `redirStderr` (direction in) - Whether to redirect stderr to nxlink output.\n # Returns\n\nSocket fd on success, negative number on failure.\n > **Note:** The socket should be closed with close() during application cleanup."] pub fn link3dsConnectToHost(redirStdout: bool, redirStderr: bool) -> ::libc::c_int; } From 16e40d0a16b24ed5ad27e81fe47514849f6572c9 Mon Sep 17 00:00:00 2001 From: TechiePi Date: Wed, 5 Apr 2023 00:08:46 +0200 Subject: [PATCH 002/101] Add `default-members` to Cargo.toml --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index 63a1ace..af22c84 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,6 @@ [workspace] members = ["ctru-rs", "ctru-sys", "ctru-sys/bindgen-ctru-sys"] +default-members = ["ctru-rs", "ctru-sys"] [patch.'https://github.com/rust3ds/ctru-rs'] # Make sure all dependencies use the local ctru-sys package From 27e636ed607f13e6ce1c5d9b10395c5b29f4f786 Mon Sep 17 00:00:00 2001 From: TechiePi Date: Sat, 8 Apr 2023 15:47:55 +0200 Subject: [PATCH 003/101] Update libctru to the latest version --- ctru-sys/src/bindings.rs | 468 +++++++++++++++++++++++++++++++-------- 1 file changed, 376 insertions(+), 92 deletions(-) diff --git a/ctru-sys/src/bindings.rs b/ctru-sys/src/bindings.rs index a7f40f7..cb05bfe 100644 --- a/ctru-sys/src/bindings.rs +++ b/ctru-sys/src/bindings.rs @@ -154,9 +154,9 @@ impl ::core::cmp::PartialEq for __BindgenUnionField { } impl ::core::cmp::Eq for __BindgenUnionField {} pub const _NEWLIB_VERSION_H__: u32 = 1; -pub const _NEWLIB_VERSION: &[u8; 6usize] = b"4.2.0\0"; +pub const _NEWLIB_VERSION: &[u8; 6usize] = b"4.3.0\0"; pub const __NEWLIB__: u32 = 4; -pub const __NEWLIB_MINOR__: u32 = 2; +pub const __NEWLIB_MINOR__: u32 = 3; pub const __NEWLIB_PATCHLEVEL__: u32 = 0; pub const _DEFAULT_SOURCE: u32 = 1; pub const _POSIX_SOURCE: u32 = 1; @@ -174,6 +174,11 @@ 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 _POSIX_THREADS: u32 = 1; +pub const _POSIX_SEMAPHORES: u32 = 1; +pub const _POSIX_BARRIERS: u32 = 200112; +pub const _POSIX_READER_WRITER_LOCKS: u32 = 200112; +pub const _UNIX98_THREAD_MUTEX_ATTRIBUTES: u32 = 1; pub const __have_longlong64: u32 = 1; pub const __have_long32: u32 = 1; pub const ___int8_t_defined: u32 = 1; @@ -249,20 +254,20 @@ pub const OS_FCRAM_VADDR: u32 = 805306368; pub const OS_FCRAM_PADDR: u32 = 536870912; pub const OS_FCRAM_SIZE: u32 = 268435456; 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 _REENT_CHECK_VERIFY: 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 _FSEEK_OPTIMIZATION: u32 = 1; +pub const _FVWRITE_IN_STREAMIO: u32 = 1; pub const _HAVE_CC_INHIBIT_LOOP_TO_LIBCALL: u32 = 1; +pub const _HAVE_INITFINI_ARRAY: u32 = 1; +pub const _HAVE_LONG_DOUBLE: u32 = 1; pub const _LDBL_EQ_DBL: u32 = 1; -pub const _FVWRITE_IN_STREAMIO: u32 = 1; -pub const _FSEEK_OPTIMIZATION: u32 = 1; +pub const _MB_CAPABLE: u32 = 1; +pub const _MB_LEN_MAX: u32 = 8; +pub const _REENT_CHECK_VERIFY: u32 = 1; pub const _UNBUF_STREAM_OPT: 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 _WANT_USE_GDTOA: u32 = 1; pub const __OBSOLETE_MATH_DEFAULT: u32 = 0; pub const __OBSOLETE_MATH: u32 = 0; @@ -286,7 +291,6 @@ pub const CONSOLE_FG_CUSTOM: u32 = 512; pub const CONSOLE_BG_CUSTOM: u32 = 1024; 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; @@ -324,6 +328,10 @@ 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 PTHREAD_MUTEX_NORMAL: u32 = 0; +pub const PTHREAD_MUTEX_RECURSIVE: u32 = 1; +pub const PTHREAD_MUTEX_ERRORCHECK: u32 = 2; +pub const PTHREAD_MUTEX_DEFAULT: u32 = 3; pub const CSND_NUM_CHANNELS: u32 = 32; pub const FRIEND_SCREEN_NAME_SIZE: u32 = 11; pub const FRIEND_COMMENT_SIZE: u32 = 33; @@ -359,7 +367,6 @@ 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; @@ -2206,12 +2213,13 @@ pub type DebugThreadParameter = ::libc::c_uint; #[doc = " Information on address space for process. All sizes are in pages (0x1000 bytes)"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] -pub struct CodeSetInfo { +pub struct CodeSetHeader { #[doc = "< ASCII name of codeset"] pub name: [u8_; 8usize], - pub unk1: u16_, - pub unk2: u16_, - pub unk3: u32_, + #[doc = "< Version field of codeset (unused)"] + pub version: u16_, + #[doc = "< Padding"] + pub padding: [u16_; 3usize], #[doc = "< .text start address"] pub text_addr: u32_, #[doc = "< .text number of pages"] @@ -2230,7 +2238,8 @@ pub struct CodeSetInfo { pub ro_size_total: u32_, #[doc = "< total pages for .data, .bss (aligned)"] pub rw_size_total: u32_, - pub unk4: u32_, + #[doc = "< Padding"] + pub padding2: u32_, #[doc = "< Program ID"] pub program_id: u64_, } @@ -2393,23 +2402,23 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Sets up virtual address space for a new process\n # Arguments\n\n* `out` (direction out) - Pointer to output the code set handle to.\n * `info` - Description for setting up the addresses\n * `code_ptr` - Pointer to .text in shared memory\n * `ro_ptr` - Pointer to .rodata in shared memory\n * `data_ptr` - Pointer to .data in shared memory"] + #[doc = " Sets up virtual address space for a new process.\n # Arguments\n\n* `out` (direction out) - Pointer to output the codeset handle to.\n * `info` - Codeset header, contains process name, titleId and segment info.\n * `textSegmentLma` - Address of executable segment in caller's address space.\n * `roSegmentLma` - Address of read-only segment in caller's address space.\n * `dataSegmentLma` - Address of read-write segment in caller's address space.\n > **Note:** On success, the provided segments are unmapped from the caller's address space."] 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, + info: *const CodeSetHeader, + textSegmentLma: u32_, + roSegmentLma: u32_, + dataSegmentLma: u32_, ) -> Result; } extern "C" { #[must_use] - #[doc = " Sets up virtual address space for a new process\n # Arguments\n\n* `out` (direction out) - Pointer to output the process handle to.\n * `codeset` - Codeset created for this process\n * `arm11kernelcaps` - ARM11 Kernel Capabilities from exheader\n * `arm11kernelcaps_num` - Number of kernel capabilities"] + #[doc = " Create a new process.\n # Arguments\n\n* `out` (direction out) - Pointer to output the process handle to.\n * `codeset` - Codeset created for this process.\n * `arm11KernelCaps` - Arm11 Kernel Capabilities from exheader.\n * `numArm11KernelCaps` - Number of kernel capabilities."] pub fn svcCreateProcess( out: *mut Handle, codeset: Handle, - arm11kernelcaps: *const u32_, - arm11kernelcaps_num: u32_, + arm11KernelCaps: *const u32_, + numArm11KernelCaps: s32, ) -> Result; } extern "C" { @@ -3602,18 +3611,18 @@ extern "C" { #[doc = " Checks whether a port is registered.\n # Arguments\n\n* `registeredOut` - Pointer to output the registration status to.\n * `name` - Name of the port to check."] pub fn srvIsPortRegistered(registeredOut: *mut bool, name: *const ::libc::c_char) -> Result; } -#[doc = "< For generic errors. Shows miscellaneous info."] +#[doc = "< Generic fatal error. Shows miscellaneous info, including the address of the caller"] pub const ERRF_ERRTYPE_GENERIC: ERRF_ErrType = 0; -#[doc = "< Same output as generic, but informs the user that \"the System Memory has been damaged\"."] -pub const ERRF_ERRTYPE_MEM_CORRUPT: ERRF_ErrType = 1; -#[doc = "< Displays the \"The Game Card was removed.\" message."] +#[doc = "< Damaged NAND (CC_ERROR after reading CSR)"] +pub const ERRF_ERRTYPE_NAND_DAMAGED: ERRF_ErrType = 1; +#[doc = "< Game content storage medium (cartridge and/or SD card) ejected. Not logged"] pub const ERRF_ERRTYPE_CARD_REMOVED: ERRF_ErrType = 2; -#[doc = "< For exceptions, or more specifically 'crashes'. union data should be exception_data."] +#[doc = "< CPU or VFP exception"] pub const ERRF_ERRTYPE_EXCEPTION: ERRF_ErrType = 3; -#[doc = "< For general failure. Shows a message. union data should have a string set in failure_mesg"] +#[doc = "< Fatal error with a message instead of the caller's address"] pub const ERRF_ERRTYPE_FAILURE: ERRF_ErrType = 4; -#[doc = "< Outputs logs to NAND in some cases."] -pub const ERRF_ERRTYPE_LOGGED: ERRF_ErrType = 5; +#[doc = "< Log-level failure. Does not display the exception and does not force the system to reboot"] +pub const ERRF_ERRTYPE_LOG_ONLY: ERRF_ErrType = 5; #[doc = " Types of errors that can be thrown by err:f."] pub type ERRF_ErrType = ::libc::c_uint; #[doc = "< Prefetch Abort"] @@ -3679,11 +3688,11 @@ pub struct ERRF_FatalErrInfo { pub resCode: u32_, #[doc = "< PC address at exception"] pub pcAddr: u32_, - #[doc = "< Process ID."] + #[doc = "< Process ID of the caller"] pub procId: u32_, - #[doc = "< Title ID."] + #[doc = "< Title ID of the caller"] pub titleId: u64_, - #[doc = "< Application Title ID."] + #[doc = "< Title ID of the running application"] pub appTitleId: u64_, #[doc = "< The different types of data for errors."] pub data: ERRF_FatalErrInfo__bindgen_ty_1, @@ -3729,19 +3738,29 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Throws a system error and possibly results in ErrDisp triggering.\n # Arguments\n\n* `error` (direction in) - Error to throw.\n\n After performing this, the system may panic and need to be rebooted. Extra information will be displayed on the\n top screen with a developer console or the proper patches in a CFW applied.\n\n The error may not be shown and execution aborted until errfExit(void) is called.\n\n You may wish to use ERRF_ThrowResult() or ERRF_ThrowResultWithMessage() instead of\n constructing the ERRF_FatalErrInfo struct yourself."] + #[doc = " Throws a system error and possibly logs it.\n # Arguments\n\n* `error` (direction in) - Error to throw.\n\n ErrDisp may convert the error info to ERRF_ERRTYPE_NAND_DAMAGED or ERRF_ERRTYPE_CARD_REMOVED\n depending on the error code.\n\n Except with ERRF_ERRTYPE_LOG_ONLY, the system will panic and will need to be rebooted.\n Fatal error information will also be logged into a file, unless the type either ERRF_ERRTYPE_NAND_DAMAGED\n or ERRF_ERRTYPE_CARD_REMOVED.\n\n No error will be shown if the system is asleep.\n\n On retail units with vanilla firmware, no detailed information will be displayed on screen.\n\n You may wish to use ERRF_ThrowResult() or ERRF_ThrowResultWithMessage() instead of\n constructing the ERRF_FatalErrInfo struct yourself."] pub fn ERRF_Throw(error: *const ERRF_FatalErrInfo) -> Result; } extern "C" { #[must_use] - #[doc = " Throws a system error with the given Result code.\n # Arguments\n\n* `failure` (direction in) - Result code to throw.\n\n This calls ERRF_Throw() with error type ERRF_ERRTYPE_GENERIC and fills in the required data.\n\n This function _does_ fill in the address where this function was called from.\n\n See https://3dbrew.org/wiki/ERR:Throw#Generic for expected top screen output\n on development units/patched ErrDisp."] + #[doc = " Throws (and logs) a system error with the given Result code.\n # Arguments\n\n* `failure` (direction in) - Result code to throw.\n\n This calls ERRF_Throw with error type ERRF_ERRTYPE_GENERIC and fills in the required data.\n\n This function _does_ fill in the address where this function was called from."] pub fn ERRF_ThrowResult(failure: Result) -> Result; } extern "C" { #[must_use] - #[doc = " Throws a system error with the given Result code and message.\n # Arguments\n\n* `failure` (direction in) - Result code to throw.\n * `message` (direction in) - The message to display.\n\n This calls ERRF_Throw() with error type ERRF_ERRTYPE_FAILURE and fills in the required data.\n\n This function does _not_ fill in the address where this function was called from because it\n would not be displayed.\n\n The message is only displayed on development units/patched ErrDisp.\n\n See https://3dbrew.org/wiki/ERR:Throw#Result_Failure for expected top screen output\n on development units/patched ErrDisp."] + #[doc = " Logs a system error with the given Result code.\n # Arguments\n\n* `failure` (direction in) - Result code to log.\n\n Similar to ERRF_Throw, except that it does not display anything on the screen,\n nor does it force the system to reboot.\n\n This function _does_ fill in the address where this function was called from."] + pub fn ERRF_LogResult(failure: Result) -> Result; +} +extern "C" { + #[must_use] + #[doc = " Throws a system error with the given Result code and message.\n # Arguments\n\n* `failure` (direction in) - Result code to throw.\n * `message` (direction in) - The message to display.\n\n This calls ERRF_Throw with error type ERRF_ERRTYPE_FAILURE and fills in the required data.\n\n This function does _not_ fill in the address where this function was called from because it\n would not be displayed."] pub fn ERRF_ThrowResultWithMessage(failure: Result, message: *const ::libc::c_char) -> Result; } +extern "C" { + #[must_use] + #[doc = " Specify an additional user string to use for error reporting.\n # Arguments\n\n* `user_string` (direction in) - User string (up to 256 bytes, not including NUL byte)"] + pub fn ERRF_SetUserString(user_string: *const ::libc::c_char) -> Result; +} extern "C" { #[doc = " Handles an exception using ErrDisp.\n # Arguments\n\n* `excep` - Exception information\n * `regs` - CPU registers\n\n You might want to clear ENVINFO's bit0 to be able to see any debugging information.\n [`threadOnException`]"] pub fn ERRF_ExceptionHandler(excep: *mut ERRF_ExceptionInfo, regs: *mut CpuRegisters) -> !; @@ -3882,35 +3901,44 @@ pub struct __lock_t { pub counter: u32, } pub type _LOCK_RECURSIVE_T = __lock_t; +pub type _COND_T = u32; extern "C" { - pub fn __libc_lock_init(lock: *mut _LOCK_T); + pub fn __libc_lock_acquire(lock: *mut _LOCK_T); } extern "C" { - pub fn __libc_lock_init_recursive(lock: *mut _LOCK_RECURSIVE_T); + pub fn __libc_lock_acquire_recursive(lock: *mut _LOCK_RECURSIVE_T); } extern "C" { - pub fn __libc_lock_close(lock: *mut _LOCK_T); + pub fn __libc_lock_release(lock: *mut _LOCK_T); } extern "C" { - pub fn __libc_lock_close_recursive(lock: *mut _LOCK_RECURSIVE_T); + pub fn __libc_lock_release_recursive(lock: *mut _LOCK_RECURSIVE_T); } extern "C" { - pub fn __libc_lock_acquire(lock: *mut _LOCK_T); + pub fn __libc_lock_try_acquire(lock: *mut _LOCK_T) -> ::libc::c_int; } extern "C" { - pub fn __libc_lock_acquire_recursive(lock: *mut _LOCK_RECURSIVE_T); + pub fn __libc_lock_try_acquire_recursive(lock: *mut _LOCK_RECURSIVE_T) -> ::libc::c_int; } extern "C" { - pub fn __libc_lock_release(lock: *mut _LOCK_T); + pub fn __libc_cond_signal(cond: *mut _COND_T) -> ::libc::c_int; } extern "C" { - pub fn __libc_lock_release_recursive(lock: *mut _LOCK_RECURSIVE_T); + pub fn __libc_cond_broadcast(cond: *mut _COND_T) -> ::libc::c_int; } extern "C" { - pub fn __libc_lock_try_acquire(lock: *mut _LOCK_T) -> ::libc::c_int; + pub fn __libc_cond_wait( + cond: *mut _COND_T, + lock: *mut _LOCK_T, + timeout_ns: u64, + ) -> ::libc::c_int; } extern "C" { - pub fn __libc_lock_try_acquire_recursive(lock: *mut _LOCK_RECURSIVE_T) -> ::libc::c_int; + pub fn __libc_cond_wait_recursive( + cond: *mut _COND_T, + lock: *mut _LOCK_RECURSIVE_T, + timeout_ns: u64, + ) -> ::libc::c_int; } #[doc = " A light lock."] pub type LightLock = _LOCK_T; @@ -4623,6 +4651,7 @@ 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 __daddr_t = ::libc::c_long; pub type __timer_t = ::libc::c_ulong; pub type __sa_family_t = __uint8_t; pub type __socklen_t = __uint32_t; @@ -4645,6 +4674,12 @@ pub struct timespec { pub tv_sec: time_t, pub tv_nsec: ::libc::c_long, } +extern "C" { + pub fn timespec2nsec(ts: *const timespec) -> __uint64_t; +} +extern "C" { + pub fn abstimespec2nsec(clock_id: __clockid_t, ts: *const timespec) -> __uint64_t; +} #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct itimerspec { @@ -4691,7 +4726,7 @@ 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 daddr_t = __daddr_t; pub type caddr_t = *mut ::libc::c_char; pub type fsblkcnt_t = __fsblkcnt_t; pub type fsfilcnt_t = __fsfilcnt_t; @@ -4714,16 +4749,17 @@ pub type sbintime_t = __int64_t; 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_t { + _unused: [u8; 0], +} +pub type pthread_t = *mut __pthread_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, } @@ -4736,27 +4772,119 @@ impl Default for pthread_attr_t { } } } -pub type pthread_mutex_t = __uint32_t; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct pthread_mutex_t { + pub type_: ::libc::c_int, + pub __bindgen_anon_1: pthread_mutex_t__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pthread_mutex_t__bindgen_ty_1 { + pub normal: _LOCK_T, + pub recursive: _LOCK_RECURSIVE_T, +} +impl Default for pthread_mutex_t__bindgen_ty_1 { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl Default for pthread_mutex_t { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct pthread_mutexattr_t { - pub is_initialized: ::libc::c_int, - pub recursive: ::libc::c_int, + pub type_: ::libc::c_int, +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct pthread_cond_t { + pub clock_id: clockid_t, + pub cond: _COND_T, } -pub type pthread_cond_t = __uint32_t; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct pthread_condattr_t { - pub is_initialized: ::libc::c_int, - pub clock: clock_t, + pub clock_id: clockid_t, } pub type pthread_key_t = __uint32_t; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct pthread_once_t { - pub is_initialized: ::libc::c_int, - pub init_executed: ::libc::c_int, + pub status: ::libc::c_int, +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct pthread_barrier_t { + pub lock: _LOCK_T, + pub cond: _COND_T, + pub reload: ::libc::c_uint, + pub counter: ::libc::c_uint, + pub cycle: ::libc::c_uint, +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct pthread_barrierattr_t {} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct pthread_rwlock_t { + pub lock: _LOCK_T, + pub cond_r: _COND_T, + pub cond_w: _COND_T, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, } +impl pthread_rwlock_t { + #[inline] + pub fn cnt_r(&self) -> u32 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 30u8) as u32) } + } + #[inline] + pub fn set_cnt_r(&mut self, val: u32) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(0usize, 30u8, val as u64) + } + } + #[inline] + pub fn cnt_w(&self) -> u32 { + unsafe { ::core::mem::transmute(self._bitfield_1.get(30usize, 2u8) as u32) } + } + #[inline] + pub fn set_cnt_w(&mut self, val: u32) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(30usize, 2u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1(cnt_r: u32, cnt_w: u32) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 30u8, { + let cnt_r: u32 = unsafe { ::core::mem::transmute(cnt_r) }; + cnt_r as u64 + }); + __bindgen_bitfield_unit.set(30usize, 2u8, { + let cnt_w: u32 = unsafe { ::core::mem::transmute(cnt_w) }; + cnt_w as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct pthread_rwlockattr_t {} #[doc = "< Dummy compression"] pub const DECOMPRESS_DUMMY: decompressType = 0; #[doc = "< LZSS/LZ10 compression"] @@ -7182,10 +7310,22 @@ extern "C" { #[doc = " Configures the chainloader to launch a specific application.\n # Arguments\n\n* `programID` - ID of the program to chainload to.\n * `mediatype` - Media type of the program to chainload to."] pub fn aptSetChainloader(programID: u64_, mediatype: u8_); } +extern "C" { + #[doc = " Configures the chainloader to launch the previous application."] + pub fn aptSetChainloaderToCaller(); +} extern "C" { #[doc = " Configures the chainloader to relaunch the current application (i.e. soft-reset)"] pub fn aptSetChainloaderToSelf(); } +extern "C" { + #[doc = " Sets the \"deliver arg\" and HMAC for the chainloader, which will\n be passed to the target 3DS/DS(i) application. The meaning of each\n parameter varies on a per-application basis.\n # Arguments\n\n* `deliverArg` - Deliver arg to pass to the target application.\n * `deliverArgSize` - Size of the deliver arg, maximum 0x300 bytes.\n * `hmac` - HMAC buffer, 32 bytes. Use NULL to pass an all-zero dummy HMAC."] + pub fn aptSetChainloaderArgs( + deliverArg: *const ::libc::c_void, + deliverArgSize: usize, + hmac: *const ::libc::c_void, + ); +} extern "C" { #[must_use] #[doc = " Gets an APT lock handle.\n # Arguments\n\n* `flags` - Flags to use.\n * `lockHandle` - Pointer to output the lock handle to."] @@ -7468,9 +7608,9 @@ extern "C" { #[must_use] #[doc = " Receives the deliver (launch) argument\n # Arguments\n\n* `param` - Parameter buffer.\n * `paramSize` - Size of parameter buffer.\n * `hmac` - HMAC buffer (should be 0x20 bytes long).\n * `sender` - Pointer to output the sender's AppID to.\n * `received` - Pointer to output whether an argument was received to."] pub fn APT_ReceiveDeliverArg( - param: *const ::libc::c_void, + param: *mut ::libc::c_void, paramSize: usize, - hmac: *const ::libc::c_void, + hmac: *mut ::libc::c_void, sender: *mut u64_, received: *mut bool, ) -> Result; @@ -13280,6 +13420,16 @@ extern "C" { #[doc = " Gets the IR LED state.\n # Arguments\n\n* `out` - Pointer to write the IR LED state to."] pub fn IRU_GetIRLEDRecvState(out: *mut u32_) -> Result; } +extern "C" { + #[must_use] + #[doc = " Gets an event which is signaled once a send finishes.\n # Arguments\n\n* `out` - Pointer to write the event handle to."] + pub fn IRU_GetSendFinishedEvent(out: *mut Handle) -> Result; +} +extern "C" { + #[must_use] + #[doc = " Gets an event which is signaled once a receive finishes.\n # Arguments\n\n* `out` - Pointer to write the event handle to."] + pub fn IRU_GetRecvFinishedEvent(out: *mut Handle) -> Result; +} extern "C" { #[must_use] #[doc = " Initializes NS."] @@ -14057,6 +14207,9 @@ impl Default for __sFILE { } } pub type __FILE = __sFILE; +extern "C" { + pub static mut __sf: [__FILE; 3usize]; +} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _glue { @@ -14073,6 +14226,9 @@ impl Default for _glue { } } } +extern "C" { + pub static mut __sglue: _glue; +} #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct _rand48 { @@ -14089,9 +14245,7 @@ pub struct _reent { 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, @@ -14100,23 +14254,17 @@ pub struct _reent { 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 __sf: [__FILE; 3usize], pub deviceData: *mut ::libc::c_void, } #[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, } #[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, @@ -14145,21 +14293,6 @@ impl Default for _reent__bindgen_ty_1__bindgen_ty_1 { } } } -#[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], -} -impl Default for _reent__bindgen_ty_1__bindgen_ty_2 { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} impl Default for _reent__bindgen_ty_1 { fn default() -> Self { let mut s = ::core::mem::MaybeUninit::::uninit(); @@ -14182,13 +14315,28 @@ extern "C" { pub static mut _impure_ptr: *mut _reent; } extern "C" { - pub static _global_impure_ptr: *mut _reent; + pub static mut _impure_data: _reent; +} +extern "C" { + pub static mut __atexit: *mut _atexit; +} +extern "C" { + pub static mut __atexit0: _atexit; +} +extern "C" { + pub static mut __stdio_exit_handler: ::core::option::Option; } extern "C" { pub fn _reclaim_reent(arg1: *mut _reent); } extern "C" { - pub fn __getreent() -> *mut _reent; + pub fn _fwalk_sglue( + arg1: *mut _reent, + arg2: ::core::option::Option< + unsafe extern "C" fn(arg1: *mut _reent, arg2: *mut __FILE) -> ::libc::c_int, + >, + arg3: *mut _glue, + ) -> ::libc::c_int; } pub type locale_t = *mut __locale_t; #[repr(C)] @@ -14293,6 +14441,8 @@ pub struct sigevent { pub sigev_notify: ::libc::c_int, pub sigev_signo: ::libc::c_int, pub sigev_value: sigval, + pub sigev_notify_function: ::core::option::Option, + pub sigev_notify_attributes: *mut pthread_attr_t, } impl Default for sigevent { fn default() -> Self { @@ -15569,6 +15719,10 @@ extern "C" { #[doc = " Exits mcuHwc."] pub fn mcuHwcExit(); } +extern "C" { + #[doc = " Gets the current mcuHwc session handle.\n # Returns\n\nA pointer to the current mcuHwc session handle."] + pub fn mcuHwcGetSessionHandle() -> *mut Handle; +} extern "C" { #[must_use] #[doc = " Reads data from an i2c device3 register\n # Arguments\n\n* `reg` - Register number. See https://www.3dbrew.org/wiki/I2C_Registers#Device_3 for more info\n * `data` - Pointer to write the data to.\n * `size` - Size of data to be read"] @@ -15619,6 +15773,80 @@ extern "C" { #[doc = " Gets the minor MCU firmware version\n # Arguments\n\n* `out` - Pointer to write the minor firmware version to."] pub fn MCUHWC_GetFwVerLow(out: *mut u8_) -> Result; } +#[doc = "< Primary I2S line, used by DSP/Mic (configurable)/GBA sound controller."] +pub const CODEC_I2S_LINE_1: CodecI2sLine = 0; +#[doc = "< Secondary I2S line, used by CSND hardware."] +pub const CODEC_I2S_LINE_2: CodecI2sLine = 1; +#[doc = " I2S line enumeration"] +pub type CodecI2sLine = ::libc::c_uint; +extern "C" { + #[must_use] + #[doc = " Initializes CDCCHK."] + pub fn cdcChkInit() -> Result; +} +extern "C" { + #[doc = " Exits CDCCHK."] + pub fn cdcChkExit(); +} +extern "C" { + #[doc = " Gets a pointer to the current cdc:CHK session handle.\n # Returns\n\nA pointer to the current cdc:CHK session handle."] + pub fn cdcChkGetSessionHandle() -> *mut Handle; +} +extern "C" { + #[must_use] + #[doc = " Reads multiple registers from the CODEC, using the old\n SPI hardware interface and a 4MHz baudrate.\n # Arguments\n\n* `pageId` - CODEC Page ID.\n * `initialRegAddr` - Address of the CODEC register to start with.\n * `outData` (direction out) - Where to write the read data to.\n * `size` - Number of registers to read (bytes to read, max. 64)."] + pub fn CDCCHK_ReadRegisters1( + pageId: u8_, + initialRegAddr: u8_, + outData: *mut ::libc::c_void, + size: usize, + ) -> Result; +} +extern "C" { + #[must_use] + #[doc = " Reads multiple registers from the CODEC, using the new\n SPI hardware interface and a 16MHz baudrate.\n # Arguments\n\n* `pageId` - CODEC Page ID.\n * `initialRegAddr` - Address of the CODEC register to start with.\n * `outData` (direction out) - Where to read the data to.\n * `size` - Number of registers to read (bytes to read, max. 64)."] + pub fn CDCCHK_ReadRegisters2( + pageId: u8_, + initialRegAddr: u8_, + outData: *mut ::libc::c_void, + size: usize, + ) -> Result; +} +extern "C" { + #[must_use] + #[doc = " Writes multiple registers to the CODEC, using the old\n SPI hardware interface and a 4MHz baudrate.\n # Arguments\n\n* `pageId` - CODEC Page ID.\n * `initialRegAddr` - Address of the CODEC register to start with.\n * `data` - Where to read the data to write from.\n * `size` - Number of registers to write (bytes to read, max. 64)."] + pub fn CDCCHK_WriteRegisters1( + pageId: u8_, + initialRegAddr: u8_, + data: *const ::libc::c_void, + size: usize, + ) -> Result; +} +extern "C" { + #[must_use] + #[doc = " Writes multiple registers to the CODEC, using the new\n SPI hardware interface and a 16MHz baudrate.\n # Arguments\n\n* `pageId` - CODEC Page ID.\n * `initialRegAddr` - Address of the CODEC register to start with.\n * `data` - Where to read the data to write from.\n * `size` - Number of registers to write (bytes to read, max. 64)."] + pub fn CDCCHK_WriteRegisters2( + pageId: u8_, + initialRegAddr: u8_, + data: *const ::libc::c_void, + size: usize, + ) -> Result; +} +extern "C" { + #[must_use] + #[doc = " Reads a single register from the NTR PMIC.\n # Arguments\n\n* `outData` (direction out) - Where to read the data to (1 byte).\n * `regAddr` - Register address.\n > **Note:** The NTR PMIC is emulated by the CODEC hardware and sends\n IRQs to the MCU when relevant."] + pub fn CDCCHK_ReadNtrPmicRegister(outData: *mut u8_, regAddr: u8_) -> Result; +} +extern "C" { + #[must_use] + #[doc = " Writes a single register from the NTR PMIC.\n # Arguments\n\n* `regAddr` - Register address.\n * `data` - Data to write (1 byte).\n > **Note:** The NTR PMIC is emulated by the CODEC hardware and sends\n IRQs to the MCU when relevant."] + pub fn CDCCHK_WriteNtrPmicRegister(regAddr: u8_, data: u8_) -> Result; +} +extern "C" { + #[must_use] + #[doc = " Sets the DAC volume level for the specified I2S line.\n # Arguments\n\n* `i2sLine` - I2S line to set the volume for.\n * `volume` - Volume level (-128 to 0)."] + pub fn CDCCHK_SetI2sVolume(i2sLine: CodecI2sLine, volume: s8) -> Result; +} #[doc = "< 8-bit Red + 8-bit Green + 8-bit Blue + 8-bit Alpha"] pub const GX_TRANSFER_FMT_RGBA8: GX_TRANSFER_FORMAT = 0; #[doc = "< 8-bit Red + 8-bit Green + 8-bit Blue"] @@ -16856,18 +17084,34 @@ extern "C" { #[doc = "General parameters\n# **\n* Sets the master volume.\n* # Arguments\n\n* `volume` - Volume to set. Defaults to 1.0f.\n*/"] pub fn ndspSetMasterVol(volume: f32); } +extern "C" { + #[doc = " Gets the master volume.\n # Returns\n\nThe master volume."] + pub fn ndspGetMasterVol() -> f32; +} extern "C" { #[doc = " Sets the output mode.\n # Arguments\n\n* `mode` - Output mode to set. Defaults to NDSP_OUTPUT_STEREO."] pub fn ndspSetOutputMode(mode: ndspOutputMode); } +extern "C" { + #[doc = " Gets the output mode.\n # Returns\n\nThe output mode."] + pub fn ndspGetOutputMode() -> ndspOutputMode; +} extern "C" { #[doc = " Sets the clipping mode.\n # Arguments\n\n* `mode` - Clipping mode to set. Defaults to NDSP_CLIP_SOFT."] pub fn ndspSetClippingMode(mode: ndspClippingMode); } +extern "C" { + #[doc = " Gets the clipping mode.\n # Returns\n\nThe clipping mode."] + pub fn ndspGetClippingMode() -> ndspClippingMode; +} extern "C" { #[doc = " Sets the output count.\n # Arguments\n\n* `count` - Output count to set. Defaults to 2."] pub fn ndspSetOutputCount(count: ::libc::c_int); } +extern "C" { + #[doc = " Gets the output count.\n # Returns\n\nThe output count."] + pub fn ndspGetOutputCount() -> ::libc::c_int; +} extern "C" { #[doc = " Sets the wave buffer to capture audio to.\n # Arguments\n\n* `capture` - Wave buffer to capture to."] pub fn ndspSetCapture(capture: *mut ndspWaveBuf); @@ -16880,26 +17124,50 @@ extern "C" { #[doc = "Surround\n# **\n* Sets the surround sound depth.\n* # Arguments\n\n* `depth` - Depth to set. Defaults to 0x7FFF.\n*/"] pub fn ndspSurroundSetDepth(depth: u16_); } +extern "C" { + #[doc = " Gets the surround sound depth.\n # Returns\n\nThe surround sound depth."] + pub fn ndspSurroundGetDepth() -> u16_; +} extern "C" { #[doc = " Sets the surround sound position.\n # Arguments\n\n* `pos` - Position to set. Defaults to NDSP_SPKPOS_SQUARE."] pub fn ndspSurroundSetPos(pos: ndspSpeakerPos); } +extern "C" { + #[doc = " Gets the surround sound position.\n # Returns\n\nThe surround sound speaker position."] + pub fn ndspSurroundGetPos() -> ndspSpeakerPos; +} extern "C" { #[doc = " Sets the surround sound rear ratio.\n # Arguments\n\n* `ratio` - Rear ratio to set. Defaults to 0x8000."] pub fn ndspSurroundSetRearRatio(ratio: u16_); } +extern "C" { + #[doc = " Gets the surround sound rear ratio.\n # Returns\n\nThe rear ratio."] + pub fn ndspSurroundGetRearRatio() -> u16_; +} extern "C" { #[doc = "Auxiliary output\n# **\n* Configures whether an auxiliary output is enabled.\n* # Arguments\n\n* `id` - ID of the auxiliary output.\n* * `enable` - Whether to enable the auxiliary output.\n*/"] pub fn ndspAuxSetEnable(id: ::libc::c_int, enable: bool); } +extern "C" { + #[doc = " Gets whether auxiliary output is enabled.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n # Returns\n\nWhether auxiliary output is enabled."] + pub fn ndspAuxIsEnabled(id: ::libc::c_int) -> bool; +} extern "C" { #[doc = " Configures whether an auxiliary output should use front bypass.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n * `bypass` - Whether to use front bypass."] pub fn ndspAuxSetFrontBypass(id: ::libc::c_int, bypass: bool); } +extern "C" { + #[doc = " Gets whether auxiliary output front bypass is enabled.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n # Returns\n\nWhether auxiliary output front bypass is enabled."] + pub fn ndspAuxGetFrontBypass(id: ::libc::c_int) -> bool; +} extern "C" { #[doc = " Sets the volume of an auxiliary output.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n * `volume` - Volume to set."] pub fn ndspAuxSetVolume(id: ::libc::c_int, volume: f32); } +extern "C" { + #[doc = " Gets the volume of an auxiliary output.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n # Returns\n\nVolume of the auxiliary output."] + pub fn ndspAuxGetVolume(id: ::libc::c_int) -> f32; +} extern "C" { #[doc = " Sets the callback of an auxiliary output.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n * `callback` - Callback to set.\n * `data` - User-defined data to pass to the callback."] pub fn ndspAuxSetCallback( @@ -16978,18 +17246,34 @@ extern "C" { #[doc = "Configuration\n# **\n* Sets the format of a channel.\n* # Arguments\n\n* `id` - ID of the channel (0..23).\n* * `format` - Format to use.\n*/"] pub fn ndspChnSetFormat(id: ::libc::c_int, format: u16_); } +extern "C" { + #[doc = " Gets the format of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n # Returns\n\nThe format of the channel."] + pub fn ndspChnGetFormat(id: ::libc::c_int) -> u16_; +} extern "C" { #[doc = " Sets the interpolation type of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `type` - Interpolation type to use."] pub fn ndspChnSetInterp(id: ::libc::c_int, type_: ndspInterpType); } +extern "C" { + #[doc = " Gets the interpolation type of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n # Returns\n\nThe interpolation type of the channel."] + pub fn ndspChnGetInterp(id: ::libc::c_int) -> ndspInterpType; +} extern "C" { #[doc = " Sets the sample rate of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `rate` - Sample rate to use."] pub fn ndspChnSetRate(id: ::libc::c_int, rate: f32); } +extern "C" { + #[doc = " Gets the sample rate of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n # Returns\n\nThe sample rate of the channel."] + pub fn ndspChnGetRate(id: ::libc::c_int) -> f32; +} extern "C" { #[doc = " Sets the mix parameters (volumes) of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `mix` - Mix parameters to use. Working hypothesis:\n - 0: Front left volume.\n - 1: Front right volume.\n - 2: Back left volume:\n - 3: Back right volume:\n - 4..7: Same as 0..3, but for auxiliary output 0.\n - 8..11: Same as 0..3, but for auxiliary output 1."] pub fn ndspChnSetMix(id: ::libc::c_int, mix: *mut f32); } +extern "C" { + #[doc = " Gets the mix parameters (volumes) of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23)\n * `mix` - Mix parameters to write out to. See ndspChnSetMix."] + pub fn ndspChnGetMix(id: ::libc::c_int, mix: *mut f32); +} extern "C" { #[doc = " Sets the DSPADPCM coefficients of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `coefs` - DSPADPCM coefficients to use."] pub fn ndspChnSetAdpcmCoefs(id: ::libc::c_int, coefs: *mut u16_); From 8eb3b1592d732b2b01debf9c76c314affa55402f Mon Sep 17 00:00:00 2001 From: TechiePi Date: Sat, 8 Apr 2023 17:40:09 +0200 Subject: [PATCH 004/101] Update ctru-sys version --- ctru-sys/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctru-sys/Cargo.toml b/ctru-sys/Cargo.toml index 4e062bd..7cdbcef 100644 --- a/ctru-sys/Cargo.toml +++ b/ctru-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ctru-sys" -version = "21.2.0+2.1.2-1" +version = "22.0.0+2.2.0" authors = [ "Rust3DS Org", "Ronald Kinard " ] license = "Zlib" links = "ctru" From 34c896e78e1eab7b9ec43efc1e9e2f598c7ca9c8 Mon Sep 17 00:00:00 2001 From: TechiePi Date: Sat, 8 Apr 2023 17:40:56 +0200 Subject: [PATCH 005/101] Improve clang_args of bindgen-ctru-sys --- ctru-sys/bindgen-ctru-sys/src/main.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ctru-sys/bindgen-ctru-sys/src/main.rs b/ctru-sys/bindgen-ctru-sys/src/main.rs index 08f2e9b..1a0f7eb 100644 --- a/ctru-sys/bindgen-ctru-sys/src/main.rs +++ b/ctru-sys/bindgen-ctru-sys/src/main.rs @@ -47,9 +47,8 @@ fn main() { "-march=armv6k", "-mtune=mpcore", "-mfpu=vfp", - "-DARM11 ", - "-D_3DS ", - "-D__3DS__ ", + "-DARM11", + "-D__3DS__", ]) .parse_callbacks(Box::new(CustomCallbacks)) .generate() From 696072adf6abd4b87d7a17b2e23c3be2c238fb74 Mon Sep 17 00:00:00 2001 From: TechiePi Date: Sat, 8 Apr 2023 17:43:34 +0200 Subject: [PATCH 006/101] Update ctru-sys version used at ctru-rs --- ctru-rs/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctru-rs/Cargo.toml b/ctru-rs/Cargo.toml index a7a160c..adb6a42 100644 --- a/ctru-rs/Cargo.toml +++ b/ctru-rs/Cargo.toml @@ -13,7 +13,7 @@ name = "ctru" [dependencies] cfg-if = "1.0" -ctru-sys = { path = "../ctru-sys", version = "21.2" } +ctru-sys = { path = "../ctru-sys", version = "22.0" } const-zero = "0.1.0" shim-3ds = { git = "https://github.com/rust3ds/shim-3ds.git" } pthread-3ds = { git = "https://github.com/rust3ds/pthread-3ds.git" } From 070de964be66870d955b2bf1f7a68c1c6ac97e9d Mon Sep 17 00:00:00 2001 From: DeltaF1 Date: Mon, 8 May 2023 11:29:01 -0400 Subject: [PATCH 007/101] Add an error code for when Mii selection is cancelled --- ctru-rs/examples/mii-selector.rs | 26 +++++++++++++++----------- ctru-rs/src/applets/mii_selector.rs | 7 +++++++ 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/ctru-rs/examples/mii-selector.rs b/ctru-rs/examples/mii-selector.rs index d489e07..363a034 100644 --- a/ctru-rs/examples/mii-selector.rs +++ b/ctru-rs/examples/mii-selector.rs @@ -1,4 +1,4 @@ -use ctru::applets::mii_selector::MiiSelector; +use ctru::applets::mii_selector::{LaunchError, MiiSelector}; use ctru::prelude::*; fn main() { @@ -14,16 +14,20 @@ fn main() { mii_selector.blacklist_user_mii(0.into()); mii_selector.set_title("Great Mii Selector!"); - let result = mii_selector.launch().unwrap(); - - println!("Is Mii selected?: {:?}", result.is_mii_selected); - println!("Mii type: {:?}", result.mii_type); - println!("Name: {:?}", result.mii_data.name); - println!("Author: {:?}", result.mii_data.author_name); - println!( - "Does the Mii have moles?: {:?}", - result.mii_data.mole_details.is_enabled - ); + match mii_selector.launch() { + Ok(result) => { + println!("Is Mii selected?: {:?}", result.is_mii_selected); + println!("Mii type: {:?}", result.mii_type); + println!("Name: {:?}", result.mii_data.name); + println!("Author: {:?}", result.mii_data.author_name); + println!( + "Does the Mii have moles?: {:?}", + result.mii_data.mole_details.is_enabled + ); + } + Err(LaunchError::InvalidChecksum) => println!("Corrupt Mii selected"), + Err(LaunchError::NoMiiSelected) => println!("No Mii selected"), + } // Main loop while apt.main_loop() { diff --git a/ctru-rs/src/applets/mii_selector.rs b/ctru-rs/src/applets/mii_selector.rs index a6acd61..4d89288 100644 --- a/ctru-rs/src/applets/mii_selector.rs +++ b/ctru-rs/src/applets/mii_selector.rs @@ -56,6 +56,8 @@ pub struct MiiSelector { #[derive(Clone, Debug)] pub struct SelectionResult { pub mii_data: MiiData, + + #[deprecated] pub is_mii_selected: bool, pub mii_type: MiiType, } @@ -64,6 +66,7 @@ pub struct SelectionResult { #[derive(Copy, Clone, Debug, Eq, PartialEq)] pub enum LaunchError { InvalidChecksum, + NoMiiSelected, } impl MiiSelector { @@ -147,6 +150,10 @@ impl MiiSelector { let mut return_val = Box::::default(); unsafe { ctru_sys::miiSelectorLaunch(self.config.as_mut(), return_val.as_mut()) } + if return_val.no_mii_selected != 0 { + return Err(LaunchError::NoMiiSelected); + } + if unsafe { ctru_sys::miiSelectorChecksumIsValid(return_val.as_mut()) } { Ok((*return_val).into()) } else { From 1e158191ff2d74e7f9440cd15d8488366b74a182 Mon Sep 17 00:00:00 2001 From: DeltaF1 Date: Mon, 8 May 2023 12:23:44 -0400 Subject: [PATCH 008/101] Add documentation to LaunchError. Update mii-selector example. --- ctru-rs/examples/mii-selector.rs | 2 +- ctru-rs/src/applets/mii_selector.rs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ctru-rs/examples/mii-selector.rs b/ctru-rs/examples/mii-selector.rs index 363a034..2fc3d4f 100644 --- a/ctru-rs/examples/mii-selector.rs +++ b/ctru-rs/examples/mii-selector.rs @@ -10,13 +10,13 @@ fn main() { let _console = Console::new(gfx.top_screen.borrow_mut()); let mut mii_selector = MiiSelector::new(); + mii_selector.set_options(Options::MII_SELECTOR_CANCEL); mii_selector.set_initial_index(3); mii_selector.blacklist_user_mii(0.into()); mii_selector.set_title("Great Mii Selector!"); match mii_selector.launch() { Ok(result) => { - println!("Is Mii selected?: {:?}", result.is_mii_selected); println!("Mii type: {:?}", result.mii_type); println!("Name: {:?}", result.mii_data.name); println!("Author: {:?}", result.mii_data.author_name); diff --git a/ctru-rs/src/applets/mii_selector.rs b/ctru-rs/src/applets/mii_selector.rs index 4d89288..ca6f597 100644 --- a/ctru-rs/src/applets/mii_selector.rs +++ b/ctru-rs/src/applets/mii_selector.rs @@ -65,7 +65,10 @@ pub struct SelectionResult { /// Error type for the Mii selector #[derive(Copy, Clone, Debug, Eq, PartialEq)] pub enum LaunchError { + /// The selected Mii's data is corrupt in some way InvalidChecksum, + + /// Either the user cancelled the selection (see [Options::MII_SELECTOR_CANCEL]), or no valid Miis were available to select NoMiiSelected, } From 827f00314df88c1673c8dd1dfe1e06770d496168 Mon Sep 17 00:00:00 2001 From: DeltaF1 Date: Mon, 8 May 2023 12:50:33 -0400 Subject: [PATCH 009/101] Fix missing use --- ctru-rs/examples/mii-selector.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctru-rs/examples/mii-selector.rs b/ctru-rs/examples/mii-selector.rs index 2fc3d4f..4602e9b 100644 --- a/ctru-rs/examples/mii-selector.rs +++ b/ctru-rs/examples/mii-selector.rs @@ -1,4 +1,4 @@ -use ctru::applets::mii_selector::{LaunchError, MiiSelector}; +use ctru::applets::mii_selector::{LaunchError, MiiSelector, Options}; use ctru::prelude::*; fn main() { From b50bacff4c7e7ca33515e8876580ee93d9076034 Mon Sep 17 00:00:00 2001 From: DeltaF1 Date: Mon, 8 May 2023 15:16:27 -0400 Subject: [PATCH 010/101] Remove is_mii_selected entirely, formatting --- ctru-rs/src/applets/mii_selector.rs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ctru-rs/src/applets/mii_selector.rs b/ctru-rs/src/applets/mii_selector.rs index ca6f597..bd0eac2 100644 --- a/ctru-rs/src/applets/mii_selector.rs +++ b/ctru-rs/src/applets/mii_selector.rs @@ -56,9 +56,6 @@ pub struct MiiSelector { #[derive(Clone, Debug)] pub struct SelectionResult { pub mii_data: MiiData, - - #[deprecated] - pub is_mii_selected: bool, pub mii_type: MiiType, } @@ -67,7 +64,6 @@ pub struct SelectionResult { pub enum LaunchError { /// The selected Mii's data is corrupt in some way InvalidChecksum, - /// Either the user cancelled the selection (see [Options::MII_SELECTOR_CANCEL]), or no valid Miis were available to select NoMiiSelected, } @@ -178,7 +174,6 @@ impl From for SelectionResult { SelectionResult { mii_data: raw_mii_data.into(), - is_mii_selected: ret.no_mii_selected == 0, mii_type: if ret.guest_mii_index != 0xFFFFFFFF { MiiType::Guest { index: ret.guest_mii_index, From fbfe34605c584b420eeb606ed50e6acbf4b6f1b9 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Tue, 23 May 2023 21:33:11 +0200 Subject: [PATCH 011/101] Update bindings to latest libctru --- ctru-rs/Cargo.toml | 2 +- ctru-sys/Cargo.toml | 2 +- ctru-sys/src/bindings.rs | 4 ++-- ctru-sys/src/lib.rs | 9 ++++++--- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ctru-rs/Cargo.toml b/ctru-rs/Cargo.toml index 0141c39..2811900 100644 --- a/ctru-rs/Cargo.toml +++ b/ctru-rs/Cargo.toml @@ -13,7 +13,7 @@ name = "ctru" [dependencies] cfg-if = "1.0" -ctru-sys = { path = "../ctru-sys", version = "22.0" } +ctru-sys = { path = "../ctru-sys", version = "22.2" } const-zero = "0.1.0" shim-3ds = { git = "https://github.com/rust3ds/shim-3ds.git" } pthread-3ds = { git = "https://github.com/rust3ds/pthread-3ds.git" } diff --git a/ctru-sys/Cargo.toml b/ctru-sys/Cargo.toml index 7cdbcef..d4cb24b 100644 --- a/ctru-sys/Cargo.toml +++ b/ctru-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ctru-sys" -version = "22.0.0+2.2.0" +version = "22.2.0+2.2.2-1" authors = [ "Rust3DS Org", "Ronald Kinard " ] license = "Zlib" links = "ctru" diff --git a/ctru-sys/src/bindings.rs b/ctru-sys/src/bindings.rs index cb05bfe..fc480d8 100644 --- a/ctru-sys/src/bindings.rs +++ b/ctru-sys/src/bindings.rs @@ -4486,7 +4486,7 @@ impl Default for ConsoleFont { } } } -#[doc = " Console structure used to store the state of a console render context.\n\n Default values from consoleGetDefault();\n PrintConsole defaultConsole =\n \n \t//Font:\n \t\n \t\t(u8*)default_font_bin, //font gfx\n \t\t0, //first ascii character in the set\n \t\t128, //number of characters in the font set\n\t,\n\t0,0, //cursorX cursorY\n\t0,0, //prevcursorX prevcursorY\n\t40, //console width\n\t30, //console height\n\t0, //window x\n\t0, //window y\n\t32, //window width\n\t24, //window height\n\t3, //tab size\n\t0, //font character offset\n\t0, //print callback\n\tfalse //console initialized\n ;\n "] +#[doc = " Console structure used to store the state of a console render context.\n\n Default values from consoleGetDefault();\n PrintConsole defaultConsole =\n {\n \t//Font:\n \t{\n \t\t(u8*)default_font_bin, //font gfx\n \t\t0, //first ascii character in the set\n \t\t128, //number of characters in the font set\n\t},\n\t0,0, //cursorX cursorY\n\t0,0, //prevcursorX prevcursorY\n\t40, //console width\n\t30, //console height\n\t0, //window x\n\t0, //window y\n\t32, //window width\n\t24, //window height\n\t3, //tab size\n\t0, //font character offset\n\t0, //print callback\n\tfalse //console initialized\n };\n "] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct PrintConsole { @@ -8127,7 +8127,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets an handle to the end of conversion event.\n # Arguments\n\n* `end_event` - Pointer to the event handle to be set to the end of conversion event. It isn't necessary to create or close this handle.\n\n To enable this event you have to use C Y2RU_SetTransferEndInterrupt(true);The event will be triggered when the corresponding interrupt is fired.\n\n > **Note:** It is recommended to use a timeout when waiting on this event, as it sometimes (but rarely) isn't triggered."] + #[doc = " Gets an handle to the end of conversion event.\n # Arguments\n\n* `end_event` - Pointer to the event handle to be set to the end of conversion event. It isn't necessary to create or close this handle.\n\n To enable this event you have to use C} Y2RU_SetTransferEndInterrupt(true);The event will be triggered when the corresponding interrupt is fired.\n\n > **Note:** It is recommended to use a timeout when waiting on this event, as it sometimes (but rarely) isn't triggered."] pub fn Y2RU_GetTransferEndEvent(end_event: *mut Handle) -> Result; } extern "C" { diff --git a/ctru-sys/src/lib.rs b/ctru-sys/src/lib.rs index 595cbd3..7c8aa18 100644 --- a/ctru-sys/src/lib.rs +++ b/ctru-sys/src/lib.rs @@ -12,8 +12,11 @@ pub use bindings::*; pub use result::*; /// In lieu of a proper errno function exposed by libc -/// (), this will retrieve the -/// last error set in the global reentrancy struct. +/// (). pub unsafe fn errno() -> s32 { - (*__getreent())._errno + *__errno() +} + +extern "C" { + fn __errno() -> *mut libc::c_int; } From 4eeb09b631cf27813ad6dc932ea9066c1593b476 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Tue, 23 May 2023 21:34:11 +0200 Subject: [PATCH 012/101] fmt --- ctru-sys/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctru-sys/src/lib.rs b/ctru-sys/src/lib.rs index 7c8aa18..3ec110d 100644 --- a/ctru-sys/src/lib.rs +++ b/ctru-sys/src/lib.rs @@ -18,5 +18,5 @@ pub unsafe fn errno() -> s32 { } extern "C" { - fn __errno() -> *mut libc::c_int; + fn __errno() -> *mut libc::c_int; } From 7ec095eca0942c5965c0282c4e0aa22b910e2be6 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Thu, 25 May 2023 17:30:18 +0200 Subject: [PATCH 013/101] Add errno.h to the bindings --- ctru-sys/bindgen-ctru-sys/src/main.rs | 6 +- ctru-sys/src/bindings.rs | 97 +++++++++++++++++++++++++++ ctru-sys/src/lib.rs | 4 -- 3 files changed, 101 insertions(+), 6 deletions(-) diff --git a/ctru-sys/bindgen-ctru-sys/src/main.rs b/ctru-sys/bindgen-ctru-sys/src/main.rs index 1a0f7eb..222eb66 100644 --- a/ctru-sys/bindgen-ctru-sys/src/main.rs +++ b/ctru-sys/bindgen-ctru-sys/src/main.rs @@ -16,13 +16,15 @@ fn main() { let devkitarm = std::env::var("DEVKITARM").expect("DEVKITARM not set in environment"); let include_path = PathBuf::from_iter([devkitpro.as_str(), "libctru", "include"]); - let header = include_path.join("3ds.h"); + let ctru_header = include_path.join("3ds.h"); let sysroot = PathBuf::from(devkitarm).join("arm-none-eabi"); let system_include = sysroot.join("include"); + let errno_header = system_include.join("errno.h"); let bindings = Builder::default() - .header(header.to_str().unwrap()) + .header(ctru_header.to_str().unwrap()) + .header(errno_header.to_str().unwrap()) .rust_target(RustTarget::Nightly) .use_core() .trust_clang_mangling(false) diff --git a/ctru-sys/src/bindings.rs b/ctru-sys/src/bindings.rs index fc480d8..3b092c3 100644 --- a/ctru-sys/src/bindings.rs +++ b/ctru-sys/src/bindings.rs @@ -1231,6 +1231,93 @@ pub const MIISELECTOR_USERMII_SLOTS: u32 = 100; pub const MIISELECTOR_GUESTMII_NAME_LEN: u32 = 12; pub const ARCHIVE_DIRITER_MAGIC: u32 = 1751347809; pub const LINK3DS_COMM_PORT: u32 = 17491; +pub const __error_t_defined: u32 = 1; +pub const EPERM: u32 = 1; +pub const ENOENT: u32 = 2; +pub const ESRCH: u32 = 3; +pub const EINTR: u32 = 4; +pub const EIO: u32 = 5; +pub const ENXIO: u32 = 6; +pub const E2BIG: u32 = 7; +pub const ENOEXEC: u32 = 8; +pub const EBADF: u32 = 9; +pub const ECHILD: u32 = 10; +pub const EAGAIN: u32 = 11; +pub const ENOMEM: u32 = 12; +pub const EACCES: u32 = 13; +pub const EFAULT: u32 = 14; +pub const EBUSY: u32 = 16; +pub const EEXIST: u32 = 17; +pub const EXDEV: u32 = 18; +pub const ENODEV: u32 = 19; +pub const ENOTDIR: u32 = 20; +pub const EISDIR: u32 = 21; +pub const EINVAL: u32 = 22; +pub const ENFILE: u32 = 23; +pub const EMFILE: u32 = 24; +pub const ENOTTY: u32 = 25; +pub const ETXTBSY: u32 = 26; +pub const EFBIG: u32 = 27; +pub const ENOSPC: u32 = 28; +pub const ESPIPE: u32 = 29; +pub const EROFS: u32 = 30; +pub const EMLINK: u32 = 31; +pub const EPIPE: u32 = 32; +pub const EDOM: u32 = 33; +pub const ERANGE: u32 = 34; +pub const ENOMSG: u32 = 35; +pub const EIDRM: u32 = 36; +pub const EDEADLK: u32 = 45; +pub const ENOLCK: u32 = 46; +pub const ENOSTR: u32 = 60; +pub const ENODATA: u32 = 61; +pub const ETIME: u32 = 62; +pub const ENOSR: u32 = 63; +pub const ENOLINK: u32 = 67; +pub const EPROTO: u32 = 71; +pub const EMULTIHOP: u32 = 74; +pub const EBADMSG: u32 = 77; +pub const EFTYPE: u32 = 79; +pub const ENOSYS: u32 = 88; +pub const ENOTEMPTY: u32 = 90; +pub const ENAMETOOLONG: u32 = 91; +pub const ELOOP: u32 = 92; +pub const EOPNOTSUPP: u32 = 95; +pub const EPFNOSUPPORT: u32 = 96; +pub const ECONNRESET: u32 = 104; +pub const ENOBUFS: u32 = 105; +pub const EAFNOSUPPORT: u32 = 106; +pub const EPROTOTYPE: u32 = 107; +pub const ENOTSOCK: u32 = 108; +pub const ENOPROTOOPT: u32 = 109; +pub const ECONNREFUSED: u32 = 111; +pub const EADDRINUSE: u32 = 112; +pub const ECONNABORTED: u32 = 113; +pub const ENETUNREACH: u32 = 114; +pub const ENETDOWN: u32 = 115; +pub const ETIMEDOUT: u32 = 116; +pub const EHOSTDOWN: u32 = 117; +pub const EHOSTUNREACH: u32 = 118; +pub const EINPROGRESS: u32 = 119; +pub const EALREADY: u32 = 120; +pub const EDESTADDRREQ: u32 = 121; +pub const EMSGSIZE: u32 = 122; +pub const EPROTONOSUPPORT: u32 = 123; +pub const EADDRNOTAVAIL: u32 = 125; +pub const ENETRESET: u32 = 126; +pub const EISCONN: u32 = 127; +pub const ENOTCONN: u32 = 128; +pub const ETOOMANYREFS: u32 = 129; +pub const EDQUOT: u32 = 132; +pub const ESTALE: u32 = 133; +pub const ENOTSUP: u32 = 134; +pub const EILSEQ: u32 = 138; +pub const EOVERFLOW: u32 = 139; +pub const ECANCELED: u32 = 140; +pub const ENOTRECOVERABLE: u32 = 141; +pub const EOWNERDEAD: u32 = 142; +pub const EWOULDBLOCK: u32 = 11; +pub const __ELASTERROR: u32 = 2000; pub type __int8_t = ::libc::c_schar; pub type __uint8_t = ::libc::c_uchar; pub type __int16_t = ::libc::c_short; @@ -18357,3 +18444,13 @@ extern "C" { #[doc = " Connects to the 3dslink host, setting up an output stream.\n # Arguments\n\n* `redirStdout` (direction in) - Whether to redirect stdout to nxlink output.\n * `redirStderr` (direction in) - Whether to redirect stderr to nxlink output.\n # Returns\n\nSocket fd on success, negative number on failure.\n > **Note:** The socket should be closed with close() during application cleanup."] pub fn link3dsConnectToHost(redirStdout: bool, redirStderr: bool) -> ::libc::c_int; } +pub type error_t = ::libc::c_int; +extern "C" { + pub fn __errno() -> *mut ::libc::c_int; +} +extern "C" { + pub static _sys_errlist: [*const ::libc::c_char; 0usize]; +} +extern "C" { + pub static mut _sys_nerr: ::libc::c_int; +} diff --git a/ctru-sys/src/lib.rs b/ctru-sys/src/lib.rs index 3ec110d..474e1d2 100644 --- a/ctru-sys/src/lib.rs +++ b/ctru-sys/src/lib.rs @@ -16,7 +16,3 @@ pub use result::*; pub unsafe fn errno() -> s32 { *__errno() } - -extern "C" { - fn __errno() -> *mut libc::c_int; -} From 38d92d63cc72806d62af11cfaecd2bdf23e81f2f Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Tue, 30 May 2023 19:16:23 +0200 Subject: [PATCH 014/101] Update bindings dependencies --- ctru-sys/bindgen-ctru-sys/Cargo.toml | 4 +- ctru-sys/src/bindings.rs | 3594 +++++++++++++------------- 2 files changed, 1799 insertions(+), 1799 deletions(-) diff --git a/ctru-sys/bindgen-ctru-sys/Cargo.toml b/ctru-sys/bindgen-ctru-sys/Cargo.toml index a8c3cd1..219af3e 100644 --- a/ctru-sys/bindgen-ctru-sys/Cargo.toml +++ b/ctru-sys/bindgen-ctru-sys/Cargo.toml @@ -4,5 +4,5 @@ version = "0.1.0" edition = "2021" [dependencies] -bindgen = "0.64" -doxygen-rs = "0.4" \ No newline at end of file +bindgen = "0.65.1" +doxygen-rs = "0.4.2" diff --git a/ctru-sys/src/bindings.rs b/ctru-sys/src/bindings.rs index 3b092c3..e8e8a9f 100644 --- a/ctru-sys/src/bindings.rs +++ b/ctru-sys/src/bindings.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.64.0 */ +/* automatically generated by rust-bindgen 0.65.1 */ #[repr(C)] #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] @@ -1383,7 +1383,7 @@ pub type Handle = u32_; pub type Result = s32; pub type ThreadFunc = ::core::option::Option; pub type voidfn = ::core::option::Option; -#[doc = " Structure representing CPU registers"] +#[doc = "Structure representing CPU registers"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct CpuRegisters { @@ -1398,7 +1398,7 @@ pub struct CpuRegisters { #[doc = "< cpsr."] pub cpsr: u32_, } -#[doc = " Structure representing FPU registers"] +#[doc = "Structure representing FPU registers"] #[repr(C)] #[derive(Copy, Clone)] pub struct FpuRegisters { @@ -1448,7 +1448,7 @@ 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; -#[doc = " Result code level values."] +#[doc = "Result code level values."] pub type _bindgen_ty_1 = ::libc::c_uint; pub const RS_SUCCESS: _bindgen_ty_2 = 0; pub const RS_NOP: _bindgen_ty_2 = 1; @@ -1463,7 +1463,7 @@ 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; -#[doc = " Result code summary values."] +#[doc = "Result code summary values."] pub type _bindgen_ty_2 = ::libc::c_uint; pub const RM_COMMON: _bindgen_ty_3 = 0; pub const RM_KERNEL: _bindgen_ty_3 = 1; @@ -1563,7 +1563,7 @@ 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; -#[doc = " Result code module values."] +#[doc = "Result code module values."] pub type _bindgen_ty_3 = ::libc::c_uint; pub const RD_SUCCESS: _bindgen_ty_4 = 0; pub const RD_INVALID_RESULT_VALUE: _bindgen_ty_4 = 1023; @@ -1590,7 +1590,7 @@ 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; -#[doc = " Result code generic description values."] +#[doc = "Result code generic description values."] pub type _bindgen_ty_4 = ::libc::c_uint; #[doc = "< Readable"] pub const IPC_BUFFER_R: IPC_BufferRights = 2; @@ -1598,7 +1598,7 @@ pub const IPC_BUFFER_R: IPC_BufferRights = 2; pub const IPC_BUFFER_W: IPC_BufferRights = 4; #[doc = "< Readable and Writable"] pub const IPC_BUFFER_RW: IPC_BufferRights = 6; -#[doc = " IPC buffer access rights."] +#[doc = "IPC buffer access rights."] pub type IPC_BufferRights = ::libc::c_uint; #[doc = "< Memory un-mapping"] pub const MEMOP_FREE: MemOp = 1; @@ -1626,7 +1626,7 @@ pub const MEMOP_REGION_MASK: MemOp = 3840; pub const MEMOP_LINEAR_FLAG: MemOp = 65536; #[doc = "< Allocates linear memory."] pub const MEMOP_ALLOC_LINEAR: MemOp = 65539; -#[doc = " svcControlMemory operation flags\n\n The lowest 8 bits are the operation"] +#[doc = "svcControlMemory operation flags\n\n The lowest 8 bits are the operation"] pub type MemOp = ::libc::c_uint; #[doc = "< Free memory"] pub const MEMSTATE_FREE: MemState = 0; @@ -1652,7 +1652,7 @@ pub const MEMSTATE_ALIAS: MemState = 9; pub const MEMSTATE_ALIASCODE: MemState = 10; #[doc = "< Locked memory"] pub const MEMSTATE_LOCKED: MemState = 11; -#[doc = " The state of a memory block."] +#[doc = "The state of a memory block."] pub type MemState = ::libc::c_uint; #[doc = "< Readable"] pub const MEMPERM_READ: MemPerm = 1; @@ -1666,7 +1666,7 @@ pub const MEMPERM_READWRITE: MemPerm = 3; pub const MEMPERM_READEXECUTE: MemPerm = 5; #[doc = "< Don't care"] pub const MEMPERM_DONTCARE: MemPerm = 268435456; -#[doc = " Memory permission flags"] +#[doc = "Memory permission flags"] pub type MemPerm = ::libc::c_uint; #[doc = "< All regions."] pub const MEMREGION_ALL: MemRegion = 0; @@ -1676,9 +1676,9 @@ pub const MEMREGION_APPLICATION: MemRegion = 1; pub const MEMREGION_SYSTEM: MemRegion = 2; #[doc = "< BASE memory."] pub const MEMREGION_BASE: MemRegion = 3; -#[doc = " Memory regions."] +#[doc = "Memory regions."] pub type MemRegion = ::libc::c_uint; -#[doc = " Memory information."] +#[doc = "Memory information."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct MemInfo { @@ -1691,7 +1691,7 @@ pub struct MemInfo { #[doc = "< Memory state. See MemState"] pub state: u32_, } -#[doc = " Memory page information."] +#[doc = "Memory page information."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct PageInfo { @@ -1708,7 +1708,7 @@ pub const ARBITRATION_DECREMENT_AND_WAIT_IF_LESS_THAN: ArbitrationType = 2; pub const ARBITRATION_WAIT_IF_LESS_THAN_TIMEOUT: ArbitrationType = 3; #[doc = "< If the memory at the address is strictly lower than #value, then decrement it and wait for signal or timeout."] pub const ARBITRATION_DECREMENT_AND_WAIT_IF_LESS_THAN_TIMEOUT: ArbitrationType = 4; -#[doc = " Arbitration modes."] +#[doc = "Arbitration modes."] pub type ArbitrationType = ::libc::c_uint; #[doc = "< When the primitive is signaled, it will wake up exactly one thread and will clear itself automatically."] pub const RESET_ONESHOT: ResetType = 0; @@ -1716,11 +1716,11 @@ pub const RESET_ONESHOT: ResetType = 0; pub const RESET_STICKY: ResetType = 1; #[doc = "< Only meaningful for timers: same as ONESHOT but it will periodically signal the timer instead of just once."] pub const RESET_PULSE: ResetType = 2; -#[doc = " Reset types (for use with events and timers)"] +#[doc = "Reset types (for use with events and timers)"] pub type ResetType = ::libc::c_uint; #[doc = "< Unknown."] pub const THREADINFO_TYPE_UNKNOWN: ThreadInfoType = 0; -#[doc = " Types of thread info."] +#[doc = "Types of thread info."] pub type ThreadInfoType = ::libc::c_uint; #[doc = "< Thread priority"] pub const RESLIMIT_PRIORITY: ResourceLimitType = 0; @@ -1744,7 +1744,7 @@ pub const RESLIMIT_ADDRESSARBITER: ResourceLimitType = 8; pub const RESLIMIT_CPUTIME: ResourceLimitType = 9; #[doc = "< Forces enum size to be 32 bits"] pub const RESLIMIT_BIT: ResourceLimitType = 2147483648; -#[doc = " Types of resource limit"] +#[doc = "Types of resource limit"] pub type ResourceLimitType = ::libc::c_uint; #[doc = "< DMA transfer involving at least one device is starting and has not reached DMAWFP yet."] pub const DMASTATE_STARTING: DmaState = 0; @@ -1756,7 +1756,7 @@ pub const DMASTATE_WFP_SRC: DmaState = 2; pub const DMASTATE_RUNNING: DmaState = 3; #[doc = "< DMA transfer is done."] pub const DMASTATE_DONE: DmaState = 4; -#[doc = " DMA transfer state."] +#[doc = "DMA transfer state."] pub type DmaState = ::libc::c_uint; #[doc = "< DMA source is a device/peripheral. Address will not auto-increment."] pub const DMACFG_SRC_IS_DEVICE: _bindgen_ty_5 = 1; @@ -1770,15 +1770,15 @@ pub const DMACFG_KEEP_LOCKED: _bindgen_ty_5 = 8; pub const DMACFG_USE_SRC_CONFIG: _bindgen_ty_5 = 64; #[doc = "< Use the provided destination device configuration even if the DMA destination is not a device."] pub const DMACFG_USE_DST_CONFIG: _bindgen_ty_5 = 128; -#[doc = " Configuration flags for DmaConfig."] +#[doc = "Configuration flags for DmaConfig."] pub type _bindgen_ty_5 = ::libc::c_uint; #[doc = "< Unlock the channel after transfer."] pub const DMARST_UNLOCK: _bindgen_ty_6 = 1; #[doc = "< Replace DMAFLUSHP instructions by NOP (they may not be regenerated even if this flag is not set)."] pub const DMARST_RESUME_DEVICE: _bindgen_ty_6 = 2; -#[doc = " Configuration flags for svcRestartDma."] +#[doc = "Configuration flags for svcRestartDma."] pub type _bindgen_ty_6 = ::libc::c_uint; -#[doc = " Device configuration structure, part of DmaConfig.\n > **Note:** - if (and only if) src/dst is a device, then src/dst won't be auto-incremented.\n - the kernel uses DMAMOV instead of DMAADNH, when having to decrement (possibly working around an erratum);\n this forces all loops to be unrolled -- you need to keep that in mind when using negative increments, as the kernel\n uses a limit of 100 DMA instruction bytes per channel."] +#[doc = "Device configuration structure, part of DmaConfig.\n > **Note:** - if (and only if) src/dst is a device, then src/dst won't be auto-incremented.\n - the kernel uses DMAMOV instead of DMAADNH, when having to decrement (possibly working around an erratum);\n this forces all loops to be unrolled -- you need to keep that in mind when using negative increments, as the kernel\n uses a limit of 100 DMA instruction bytes per channel."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct DmaDeviceConfig { @@ -1795,7 +1795,7 @@ pub struct DmaDeviceConfig { #[doc = "< \"Transfer\" loop stride, can be <= 0."] pub transferStride: s16, } -#[doc = " Configuration stucture for svcStartInterProcessDma."] +#[doc = "Configuration stucture for svcStartInterProcessDma."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct DmaConfig { @@ -1829,7 +1829,7 @@ pub const PERFCOUNTEROP_GET_EVENT: PerfCounterOperation = 6; pub const PERFCOUNTEROP_SET_EVENT: PerfCounterOperation = 7; #[doc = "< (Dis)allow the kernel to track counter overflows and to use 64-bit counter values."] pub const PERFCOUNTEROP_SET_VIRTUAL_COUNTER_ENABLED: PerfCounterOperation = 8; -#[doc = " Operations for svcControlPerformanceCounter"] +#[doc = "Operations for svcControlPerformanceCounter"] pub type PerfCounterOperation = ::libc::c_uint; pub const PERFCOUNTERREG_CORE_BASE: PerfCounterRegister = 0; #[doc = "< CP15 PMN0."] @@ -1855,7 +1855,7 @@ pub const PERFCOUNTERREG_SCU_5: PerfCounterRegister = 21; pub const PERFCOUNTERREG_SCU_6: PerfCounterRegister = 22; #[doc = "< SCU MN7. Prod-N3DS only. IRQ line missing."] pub const PERFCOUNTERREG_SCU_7: PerfCounterRegister = 23; -#[doc = " Performance counter register IDs (CP15 and SCU)."] +#[doc = "Performance counter register IDs (CP15 and SCU)."] pub type PerfCounterRegister = ::libc::c_uint; pub const PERFCOUNTEREVT_CORE_BASE: PerfCounterEvent = 0; pub const PERFCOUNTEREVT_CORE_INST_CACHE_MISS: PerfCounterEvent = 0; @@ -1905,9 +1905,9 @@ pub const PERFCOUNTEREVT_SCU_WRITE_BUSY_PORT1: PerfCounterEvent = 4113; pub const PERFCOUNTEREVT_SCU_EXTERNAL_READ: PerfCounterEvent = 4114; pub const PERFCOUNTEREVT_SCU_EXTERNAL_WRITE: PerfCounterEvent = 4115; pub const PERFCOUNTEREVT_SCU_CYCLE_COUNT: PerfCounterEvent = 4127; -#[doc = " Performance counter event IDs (CP15 or SCU).\n\n > **Note:** Refer to:\n - CP15: https://developer.arm.com/documentation/ddi0360/e/control-coprocessor-cp15/register-descriptions/c15--performance-monitor-control-register--pmnc-\n - SCU: https://developer.arm.com/documentation/ddi0360/e/mpcore-private-memory-region/about-the-mpcore-private-memory-region/performance-monitor-event-registers"] +#[doc = "Performance counter event IDs (CP15 or SCU).\n\n > **Note:** Refer to:\n - CP15: https://developer.arm.com/documentation/ddi0360/e/control-coprocessor-cp15/register-descriptions/c15--performance-monitor-control-register--pmnc-\n - SCU: https://developer.arm.com/documentation/ddi0360/e/mpcore-private-memory-region/about-the-mpcore-private-memory-region/performance-monitor-event-registers"] pub type PerfCounterEvent = ::libc::c_uint; -#[doc = " Event relating to the attachment of a process."] +#[doc = "Event relating to the attachment of a process."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct AttachProcessEvent { @@ -1926,9 +1926,9 @@ pub const EXITPROCESS_EVENT_EXIT: ExitProcessEventReason = 0; pub const EXITPROCESS_EVENT_TERMINATE: ExitProcessEventReason = 1; #[doc = "< Process has been terminated by svcTerminateDebugProcess."] pub const EXITPROCESS_EVENT_DEBUG_TERMINATE: ExitProcessEventReason = 2; -#[doc = " Reasons for an exit process event."] +#[doc = "Reasons for an exit process event."] pub type ExitProcessEventReason = ::libc::c_uint; -#[doc = " Event relating to the exiting of a process."] +#[doc = "Event relating to the exiting of a process."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ExitProcessEvent { @@ -1944,7 +1944,7 @@ impl Default for ExitProcessEvent { } } } -#[doc = " Event relating to the attachment of a thread."] +#[doc = "Event relating to the attachment of a thread."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct AttachThreadEvent { @@ -1963,9 +1963,9 @@ pub const EXITTHREAD_EVENT_TERMINATE: ExitThreadEventReason = 1; pub const EXITTHREAD_EVENT_EXIT_PROCESS: ExitThreadEventReason = 2; #[doc = "< Process has been terminated by svcTerminateProcess."] pub const EXITTHREAD_EVENT_TERMINATE_PROCESS: ExitThreadEventReason = 3; -#[doc = " Reasons for an exit thread event."] +#[doc = "Reasons for an exit thread event."] pub type ExitThreadEventReason = ::libc::c_uint; -#[doc = " Event relating to the exiting of a thread."] +#[doc = "Event relating to the exiting of a thread."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ExitThreadEvent { @@ -1991,7 +1991,7 @@ pub const USERBREAK_USER: UserBreakType = 2; pub const USERBREAK_LOAD_RO: UserBreakType = 3; #[doc = "< Unload RO."] pub const USERBREAK_UNLOAD_RO: UserBreakType = 4; -#[doc = " Reasons for a user break."] +#[doc = "Reasons for a user break."] pub type UserBreakType = ::libc::c_uint; #[doc = "< Undefined instruction."] pub const EXCEVENT_UNDEFINED_INSTRUCTION: ExceptionEventType = 0; @@ -2011,9 +2011,9 @@ pub const EXCEVENT_USER_BREAK: ExceptionEventType = 6; pub const EXCEVENT_DEBUGGER_BREAK: ExceptionEventType = 7; #[doc = "< Undefined syscall."] pub const EXCEVENT_UNDEFINED_SYSCALL: ExceptionEventType = 8; -#[doc = " Reasons for an exception event."] +#[doc = "Reasons for an exception event."] pub type ExceptionEventType = ::libc::c_uint; -#[doc = " Event relating to fault exceptions (CPU exceptions other than stop points and undefined syscalls)."] +#[doc = "Event relating to fault exceptions (CPU exceptions other than stop points and undefined syscalls)."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct FaultExceptionEvent { @@ -2026,9 +2026,9 @@ pub const STOPPOINT_SVC_FF: StopPointType = 0; pub const STOPPOINT_BREAKPOINT: StopPointType = 1; #[doc = "< Watchpoint."] pub const STOPPOINT_WATCHPOINT: StopPointType = 2; -#[doc = " Stop point types"] +#[doc = "Stop point types"] pub type StopPointType = ::libc::c_uint; -#[doc = " Event relating to stop points"] +#[doc = "Event relating to stop points"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct StopPointExceptionEvent { @@ -2046,7 +2046,7 @@ impl Default for StopPointExceptionEvent { } } } -#[doc = " Event relating to svcBreak"] +#[doc = "Event relating to svcBreak"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct UserBreakExceptionEvent { @@ -2066,14 +2066,14 @@ impl Default for UserBreakExceptionEvent { } } } -#[doc = " Event relating to svcBreakDebugProcess"] +#[doc = "Event relating to svcBreakDebugProcess"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct DebuggerBreakExceptionEvent { #[doc = "< IDs of the attached process's threads that were running on each core at the time of the svcBreakDebugProcess call, or -1 (only the first 2 values are meaningful on O3DS)."] pub thread_ids: [s32; 4usize], } -#[doc = " Event relating to exceptions."] +#[doc = "Event relating to exceptions."] #[repr(C)] #[derive(Copy, Clone)] pub struct ExceptionEvent { @@ -2113,14 +2113,14 @@ impl Default for ExceptionEvent { } } } -#[doc = " Event relating to the scheduler."] +#[doc = "Event relating to the scheduler."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct ScheduleInOutEvent { #[doc = "< Clock tick that the event occurred."] pub clock_tick: u64_, } -#[doc = " Event relating to syscalls."] +#[doc = "Event relating to syscalls."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct SyscallInOutEvent { @@ -2129,7 +2129,7 @@ pub struct SyscallInOutEvent { #[doc = "< Syscall sent/received."] pub syscall: u32_, } -#[doc = " Event relating to debug output."] +#[doc = "Event relating to debug output."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct OutputStringEvent { @@ -2138,7 +2138,7 @@ pub struct OutputStringEvent { #[doc = "< Size of the outputted string."] pub string_size: u32_, } -#[doc = " Event relating to the mapping of memory."] +#[doc = "Event relating to the mapping of memory."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct MapEvent { @@ -2186,9 +2186,9 @@ pub const DBGEVENT_SYSCALL_OUT: DebugEventType = 10; pub const DBGEVENT_OUTPUT_STRING: DebugEventType = 11; #[doc = "< Map event."] pub const DBGEVENT_MAP: DebugEventType = 12; -#[doc = " Debug event type."] +#[doc = "Debug event type."] pub type DebugEventType = ::libc::c_uint; -#[doc = " Information about a debug event."] +#[doc = "Information about a debug event."] #[repr(C)] #[derive(Copy, Clone)] pub struct DebugEventInfo { @@ -2252,7 +2252,7 @@ pub const DBG_SIGNAL_SCHEDULE_EVENTS: DebugFlags = 4; pub const DBG_SIGNAL_SYSCALL_EVENTS: DebugFlags = 8; #[doc = "< Signal map events. See MapEvent."] pub const DBG_SIGNAL_MAP_EVENTS: DebugFlags = 16; -#[doc = " Debug flags for an attached process, set by svcContinueDebugEvent"] +#[doc = "Debug flags for an attached process, set by svcContinueDebugEvent"] pub type DebugFlags = ::libc::c_uint; #[repr(C)] #[derive(Copy, Clone)] @@ -2285,7 +2285,7 @@ pub const THREADCONTEXT_CONTROL_CPU_REGS: ThreadContextControlFlags = 3; pub const THREADCONTEXT_CONTROL_FPU_REGS: ThreadContextControlFlags = 12; #[doc = "< Control all of the above."] pub const THREADCONTEXT_CONTROL_ALL: ThreadContextControlFlags = 15; -#[doc = " Control flags for svcGetDebugThreadContext and svcSetDebugThreadContext"] +#[doc = "Control flags for svcGetDebugThreadContext and svcSetDebugThreadContext"] pub type ThreadContextControlFlags = ::libc::c_uint; #[doc = "< Thread priority."] pub const DBGTHREAD_PARAMETER_PRIORITY: DebugThreadParameter = 0; @@ -2295,9 +2295,9 @@ pub const DBGTHREAD_PARAMETER_SCHEDULING_MASK_LOW: DebugThreadParameter = 1; pub const DBGTHREAD_PARAMETER_CPU_IDEAL: DebugThreadParameter = 2; #[doc = "< Processor that created the threod."] pub const DBGTHREAD_PARAMETER_CPU_CREATOR: DebugThreadParameter = 3; -#[doc = " Thread parameter field for svcGetDebugThreadParameter"] +#[doc = "Thread parameter field for svcGetDebugThreadParameter"] pub type DebugThreadParameter = ::libc::c_uint; -#[doc = " Information on address space for process. All sizes are in pages (0x1000 bytes)"] +#[doc = "Information on address space for process. All sizes are in pages (0x1000 bytes)"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct CodeSetHeader { @@ -2330,7 +2330,7 @@ pub struct CodeSetHeader { #[doc = "< Program ID"] pub program_id: u64_, } -#[doc = " Information for the main thread of a process."] +#[doc = "Information for the main thread of a process."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct StartupInfo { @@ -2356,7 +2356,7 @@ impl Default for StartupInfo { } extern "C" { #[must_use] - #[doc = "Memory management\n# **\n* Controls memory mapping\n* # Arguments\n\n* `addr_out` (direction out) - The virtual address resulting from the operation. Usually the same as addr0.\n* * `addr0` - The virtual address to be used for the operation.\n* * `addr1` - The virtual address to be (un)mirrored by `addr0` when using MEMOP_MAP or MEMOP_UNMAP.\n* It has to be pointing to a RW memory.\n* Use NULL if the operation is MEMOP_FREE or MEMOP_ALLOC.\n* * `size` - The requested size for MEMOP_ALLOC and MEMOP_ALLOC_LINEAR.\n* * `op` - Operation flags. See MemOp.\n* * `perm` - A combination of MEMPERM_READ and MEMPERM_WRITE. Using MEMPERM_EXECUTE will return an error.\n* Value 0 is used when unmapping memory.\n*\n* If a memory is mapped for two or more addresses, you have to use MEMOP_UNMAP before being able to MEMOP_FREE it.\n* MEMOP_MAP will fail if `addr1` was already mapped to another address.\n*\n* More information is available at http://3dbrew.org/wiki/SVC#Memory_Mapping.\n*\n* [`svcControlProcessMemory`]\n*/"] + #[doc = "Memory management\n# *\n* Controls memory mapping\n # Arguments\n\n* `addr_out` (direction out) - The virtual address resulting from the operation. Usually the same as addr0.\n * `addr0` - The virtual address to be used for the operation.\n * `addr1` - The virtual address to be (un)mirrored by `addr0` when using MEMOP_MAP or MEMOP_UNMAP.\n It has to be pointing to a RW memory.\n* Use NULL if the operation is MEMOP_FREE or MEMOP_ALLOC.\n * `size` - The requested size for MEMOP_ALLOC and MEMOP_ALLOC_LINEAR.\n * `op` - Operation flags. See MemOp.\n * `perm` - A combination of MEMPERM_READ and MEMPERM_WRITE. Using MEMPERM_EXECUTE will return an error.\n Value 0 is used when unmapping memory.\n*\n* If a memory is mapped for two or more addresses, you have to use MEMOP_UNMAP before being able to MEMOP_FREE it.\n* MEMOP_MAP will fail if `addr1` was already mapped to another address.\n\n* More information is available at http://3dbrew.org/wiki/SVC#Memory_Mapping.\n*\n* [`svcControlProcessMemory`]\n/"] pub fn svcControlMemory( addr_out: *mut u32_, addr0: u32_, @@ -2368,7 +2368,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Controls the memory mapping of a process\n # Arguments\n\n* `addr0` - The virtual address to map\n * `addr1` - The virtual address to be mapped by `addr0`\n * `type` - Only operations MEMOP_MAP, MEMOP_UNMAP and MEMOP_PROT are allowed.\n\n This is the only SVC which allows mapping executable memory.\n Using MEMOP_PROT will change the memory permissions of an already mapped memory.\n\n > **Note:** The pseudo handle for the current process is not supported by this service call.\n [`svcControlProcess`]"] + #[doc = "Controls the memory mapping of a process\n # Arguments\n\n* `addr0` - The virtual address to map\n * `addr1` - The virtual address to be mapped by `addr0`\n * `type` - Only operations MEMOP_MAP, MEMOP_UNMAP and MEMOP_PROT are allowed.\n\n This is the only SVC which allows mapping executable memory.\n Using MEMOP_PROT will change the memory permissions of an already mapped memory.\n\n > **Note:** The pseudo handle for the current process is not supported by this service call.\n [`svcControlProcess`]"] pub fn svcControlProcessMemory( process: Handle, addr0: u32_, @@ -2380,7 +2380,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Creates a block of shared memory\n # Arguments\n\n* `memblock` (direction out) - Pointer to store the handle of the block\n * `addr` - Address of the memory to map, page-aligned. So its alignment must be 0x1000.\n * `size` - Size of the memory to map, a multiple of 0x1000.\n * `my_perm` - Memory permissions for the current process\n * `other_perm` - Memory permissions for the other processes\n\n > **Note:** The shared memory block, and its rights, are destroyed when the handle is closed."] + #[doc = "Creates a block of shared memory\n # Arguments\n\n* `memblock` (direction out) - Pointer to store the handle of the block\n * `addr` - Address of the memory to map, page-aligned. So its alignment must be 0x1000.\n * `size` - Size of the memory to map, a multiple of 0x1000.\n * `my_perm` - Memory permissions for the current process\n * `other_perm` - Memory permissions for the other processes\n\n > **Note:** The shared memory block, and its rights, are destroyed when the handle is closed."] pub fn svcCreateMemoryBlock( memblock: *mut Handle, addr: u32_, @@ -2391,7 +2391,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Maps a block of shared memory\n # Arguments\n\n* `memblock` - Handle of the block\n * `addr` - Address of the memory to map, page-aligned. So its alignment must be 0x1000.\n * `my_perm` - Memory permissions for the current process\n * `other_perm` - Memory permissions for the other processes\n\n > **Note:** The shared memory block, and its rights, are destroyed when the handle is closed."] + #[doc = "Maps a block of shared memory\n # Arguments\n\n* `memblock` - Handle of the block\n * `addr` - Address of the memory to map, page-aligned. So its alignment must be 0x1000.\n * `my_perm` - Memory permissions for the current process\n * `other_perm` - Memory permissions for the other processes\n\n > **Note:** The shared memory block, and its rights, are destroyed when the handle is closed."] pub fn svcMapMemoryBlock( memblock: Handle, addr: u32_, @@ -2401,27 +2401,27 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Maps a block of process memory, starting from address 0x00100000.\n # Arguments\n\n* `process` - Handle of the process.\n * `destAddress` - Address of the block of memory to map, in the current (destination) process.\n * `size` - Size of the block of memory to map (truncated to a multiple of 0x1000 bytes)."] + #[doc = "Maps a block of process memory, starting from address 0x00100000.\n # Arguments\n\n* `process` - Handle of the process.\n * `destAddress` - Address of the block of memory to map, in the current (destination) process.\n * `size` - Size of the block of memory to map (truncated to a multiple of 0x1000 bytes)."] pub fn svcMapProcessMemory(process: Handle, destAddress: u32_, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Unmaps a block of process memory, starting from address 0x00100000.\n # Arguments\n\n* `process` - Handle of the process.\n * `destAddress` - Address of the block of memory to unmap, in the current (destination) process.\n * `size` - Size of the block of memory to unmap (truncated to a multiple of 0x1000 bytes)."] + #[doc = "Unmaps a block of process memory, starting from address 0x00100000.\n # Arguments\n\n* `process` - Handle of the process.\n * `destAddress` - Address of the block of memory to unmap, in the current (destination) process.\n * `size` - Size of the block of memory to unmap (truncated to a multiple of 0x1000 bytes)."] pub fn svcUnmapProcessMemory(process: Handle, destAddress: u32_, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Unmaps a block of shared memory\n # Arguments\n\n* `memblock` - Handle of the block\n * `addr` - Address of the memory to unmap, page-aligned. So its alignment must be 0x1000."] + #[doc = "Unmaps a block of shared memory\n # Arguments\n\n* `memblock` - Handle of the block\n * `addr` - Address of the memory to unmap, page-aligned. So its alignment must be 0x1000."] pub fn svcUnmapMemoryBlock(memblock: Handle, addr: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Queries memory information.\n # Arguments\n\n* `info` (direction out) - Pointer to output memory info to.\n * `out` - Pointer to output page info to.\n * `addr` - Virtual memory address to query."] + #[doc = "Queries memory information.\n # Arguments\n\n* `info` (direction out) - Pointer to output memory info to.\n * `out` - Pointer to output page info to.\n * `addr` - Virtual memory address to query."] pub fn svcQueryMemory(info: *mut MemInfo, out: *mut PageInfo, addr: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Queries process memory information.\n # Arguments\n\n* `info` (direction out) - Pointer to output memory info to.\n * `out` (direction out) - Pointer to output page info to.\n * `process` - Process to query memory from.\n * `addr` - Virtual memory address to query."] + #[doc = "Queries process memory information.\n # Arguments\n\n* `info` (direction out) - Pointer to output memory info to.\n * `out` (direction out) - Pointer to output page info to.\n * `process` - Process to query memory from.\n * `addr` - Virtual memory address to query."] pub fn svcQueryProcessMemory( info: *mut MemInfo, out: *mut PageInfo, @@ -2431,31 +2431,31 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Process management\n# **\n* Gets the handle of a process.\n* # Arguments\n\n* `process` (direction out) - The handle of the process\n* processId The ID of the process to open\n*/"] + #[doc = "Process management\n# *\n* Gets the handle of a process.\n # Arguments\n\n* `process` (direction out) - The handle of the process\n * `processId` - The ID of the process to open\n/"] pub fn svcOpenProcess(process: *mut Handle, processId: u32_) -> Result; } extern "C" { - #[doc = " Exits the current process."] + #[doc = "Exits the current process."] pub fn svcExitProcess() -> !; } extern "C" { #[must_use] - #[doc = " Terminates a process.\n # Arguments\n\n* `process` - Handle of the process to terminate."] + #[doc = "Terminates a process.\n # Arguments\n\n* `process` - Handle of the process to terminate."] pub fn svcTerminateProcess(process: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Gets information about a process.\n # Arguments\n\n* `out` (direction out) - Pointer to output process info to.\n * `process` - Handle of the process to get information about.\n * `type` - Type of information to retreieve."] + #[doc = "Gets information about a process.\n # Arguments\n\n* `out` (direction out) - Pointer to output process info to.\n * `process` - Handle of the process to get information about.\n * `type` - Type of information to retreieve."] pub fn svcGetProcessInfo(out: *mut s64, process: Handle, type_: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the ID of a process.\n # Arguments\n\n* `out` (direction out) - Pointer to output the process ID to.\n * `handle` - Handle of the process to get the ID of."] + #[doc = "Gets the ID of a process.\n # Arguments\n\n* `out` (direction out) - Pointer to output the process ID to.\n * `handle` - Handle of the process to get the ID of."] pub fn svcGetProcessId(out: *mut u32_, handle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Gets a list of running processes.\n # Arguments\n\n* `processCount` (direction out) - Pointer to output the process count to.\n * `processIds` (direction out) - Pointer to output the process IDs to.\n * `processIdMaxCount` - Maximum number of process IDs."] + #[doc = "Gets a list of running processes.\n # Arguments\n\n* `processCount` (direction out) - Pointer to output the process count to.\n * `processIds` (direction out) - Pointer to output the process IDs to.\n * `processIdMaxCount` - Maximum number of process IDs."] pub fn svcGetProcessList( processCount: *mut s32, processIds: *mut u32_, @@ -2464,7 +2464,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets a list of the threads of a process.\n # Arguments\n\n* `threadCount` (direction out) - Pointer to output the thread count to.\n * `threadIds` (direction out) - Pointer to output the thread IDs to.\n * `threadIdMaxCount` - Maximum number of thread IDs.\n * `process` - Process handle to list the threads of."] + #[doc = "Gets a list of the threads of a process.\n # Arguments\n\n* `threadCount` (direction out) - Pointer to output the thread count to.\n * `threadIds` (direction out) - Pointer to output the thread IDs to.\n * `threadIdMaxCount` - Maximum number of thread IDs.\n * `process` - Process handle to list the threads of."] pub fn svcGetThreadList( threadCount: *mut s32, threadIds: *mut u32_, @@ -2474,7 +2474,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Creates a port.\n # Arguments\n\n* `portServer` (direction out) - Pointer to output the port server handle to.\n * `portClient` (direction out) - Pointer to output the port client handle to.\n * `name` - Name of the port.\n * `maxSessions` - Maximum number of sessions that can connect to the port."] + #[doc = "Creates a port.\n # Arguments\n\n* `portServer` (direction out) - Pointer to output the port server handle to.\n * `portClient` (direction out) - Pointer to output the port client handle to.\n * `name` - Name of the port.\n * `maxSessions` - Maximum number of sessions that can connect to the port."] pub fn svcCreatePort( portServer: *mut Handle, portClient: *mut Handle, @@ -2484,12 +2484,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Connects to a port.\n # Arguments\n\n* `out` (direction out) - Pointer to output the port handle to.\n * `portName` - Name of the port."] + #[doc = "Connects to a port.\n # Arguments\n\n* `out` (direction out) - Pointer to output the port handle to.\n * `portName` - Name of the port."] pub fn svcConnectToPort(out: *mut Handle, portName: *const ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = " Sets up virtual address space for a new process.\n # Arguments\n\n* `out` (direction out) - Pointer to output the codeset handle to.\n * `info` - Codeset header, contains process name, titleId and segment info.\n * `textSegmentLma` - Address of executable segment in caller's address space.\n * `roSegmentLma` - Address of read-only segment in caller's address space.\n * `dataSegmentLma` - Address of read-write segment in caller's address space.\n > **Note:** On success, the provided segments are unmapped from the caller's address space."] + #[doc = "Sets up virtual address space for a new process.\n # Arguments\n\n* `out` (direction out) - Pointer to output the codeset handle to.\n * `info` - Codeset header, contains process name, titleId and segment info.\n * `textSegmentLma` - Address of executable segment in caller's address space.\n * `roSegmentLma` - Address of read-only segment in caller's address space.\n * `dataSegmentLma` - Address of read-write segment in caller's address space.\n > **Note:** On success, the provided segments are unmapped from the caller's address space."] pub fn svcCreateCodeSet( out: *mut Handle, info: *const CodeSetHeader, @@ -2500,7 +2500,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Create a new process.\n # Arguments\n\n* `out` (direction out) - Pointer to output the process handle to.\n * `codeset` - Codeset created for this process.\n * `arm11KernelCaps` - Arm11 Kernel Capabilities from exheader.\n * `numArm11KernelCaps` - Number of kernel capabilities."] + #[doc = "Create a new process.\n # Arguments\n\n* `out` (direction out) - Pointer to output the process handle to.\n * `codeset` - Codeset created for this process.\n * `arm11KernelCaps` - Arm11 Kernel Capabilities from exheader.\n * `numArm11KernelCaps` - Number of kernel capabilities."] pub fn svcCreateProcess( out: *mut Handle, codeset: Handle, @@ -2510,7 +2510,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets a process's affinity mask.\n # Arguments\n\n* `affinitymask` (direction out) - Pointer to store the affinity masks.\n * `process` - Handle of the process.\n * `processorcount` - Number of processors."] + #[doc = "Gets a process's affinity mask.\n # Arguments\n\n* `affinitymask` (direction out) - Pointer to store the affinity masks.\n * `process` - Handle of the process.\n * `processorcount` - Number of processors."] pub fn svcGetProcessAffinityMask( affinitymask: *mut u8_, process: Handle, @@ -2519,7 +2519,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Sets a process's affinity mask.\n # Arguments\n\n* `process` - Handle of the process.\n * `affinitymask` - Pointer to retrieve the affinity masks from.\n * `processorcount` - Number of processors."] + #[doc = "Sets a process's affinity mask.\n # Arguments\n\n* `process` - Handle of the process.\n * `affinitymask` - Pointer to retrieve the affinity masks from.\n * `processorcount` - Number of processors."] pub fn svcSetProcessAffinityMask( process: Handle, affinitymask: *const u8_, @@ -2528,22 +2528,22 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets a process's ideal processor.\n # Arguments\n\n* `processorid` (direction out) - Pointer to store the ID of the process's ideal processor.\n * `process` - Handle of the process."] + #[doc = "Gets a process's ideal processor.\n # Arguments\n\n* `processorid` (direction out) - Pointer to store the ID of the process's ideal processor.\n * `process` - Handle of the process."] pub fn svcGetProcessIdealProcessor(processorid: *mut s32, process: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Sets a process's ideal processor.\n # Arguments\n\n* `process` - Handle of the process.\n * `processorid` - ID of the process's ideal processor."] + #[doc = "Sets a process's ideal processor.\n # Arguments\n\n* `process` - Handle of the process.\n * `processorid` - ID of the process's ideal processor."] pub fn svcSetProcessIdealProcessor(process: Handle, processorid: s32) -> Result; } extern "C" { #[must_use] - #[doc = " Launches the main thread of the process.\n # Arguments\n\n* `process` - Handle of the process.\n * `info` - Pointer to a StartupInfo structure describing information for the main thread."] + #[doc = "Launches the main thread of the process.\n # Arguments\n\n* `process` - Handle of the process.\n * `info` - Pointer to a StartupInfo structure describing information for the main thread."] pub fn svcRun(process: Handle, info: *const StartupInfo) -> Result; } extern "C" { #[must_use] - #[doc = "Multithreading\n# **\n* Creates a new thread.\n* # Arguments\n\n* `thread` (direction out) - The thread handle\n* * `entrypoint` - The function that will be called first upon thread creation\n* * `arg` - The argument passed to `entrypoint`\n* * `stack_top` - The top of the thread's stack. Must be 0x8 bytes mem-aligned.\n* * `thread_priority` - Low values gives the thread higher priority.\n* For userland apps, this has to be within the range [0x18;0x3F]\n* * `processor_id` - The id of the processor the thread should be ran on. Those are labelled starting from 0.\n* For old 3ds it has to be <2, and for new 3DS <4.\n* Value -1 means all CPUs and -2 read from the Exheader.\n*\n* The processor with ID 1 is the system processor.\n* To enable multi-threading on this core you need to call APT_SetAppCpuTimeLimit at least once with a non-zero value.\n*\n* Since a thread is considered as a waitable object, you can use svcWaitSynchronization\n* and svcWaitSynchronizationN to join with it.\n*\n* > **Note:** The kernel will clear the `stack_top's` address low 3 bits to make sure it is 0x8-bytes aligned.\n*/"] + #[doc = "Multithreading\n# *\n* Creates a new thread.\n # Arguments\n\n* `thread` (direction out) - The thread handle\n * `entrypoint` - The function that will be called first upon thread creation\n * `arg` - The argument passed to `entrypoint`\n * `stack_top` - The top of the thread's stack. Must be 0x8 bytes mem-aligned.\n * `thread_priority` - Low values gives the thread higher priority.\n For userland apps, this has to be within the range [0x18;0x3F]\n* * `processor_id` - The id of the processor the thread should be ran on. Those are labelled starting from 0.\n For old 3ds it has to be <2, and for new 3DS <4.\n* Value -1 means all CPUs and -2 read from the Exheader.\n*\n* The processor with ID 1 is the system processor.\n* To enable multi-threading on this core you need to call APT_SetAppCpuTimeLimit at least once with a non-zero value.\n*\n* Since a thread is considered as a waitable object, you can use svcWaitSynchronization\n and svcWaitSynchronizationN to join with it.\n\n* > **Note:** The kernel will clear the `stack_top's` address low 3 bits to make sure it is 0x8-bytes aligned.\n/"] pub fn svcCreateThread( thread: *mut Handle, entrypoint: ThreadFunc, @@ -2555,30 +2555,30 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets the handle of a thread.\n # Arguments\n\n* `thread` (direction out) - The handle of the thread\n process The ID of the process linked to the thread"] + #[doc = "Gets the handle of a thread.\n # Arguments\n\n* `thread` (direction out) - The handle of the thread\n * `process` - The ID of the process linked to the thread"] pub fn svcOpenThread(thread: *mut Handle, process: Handle, threadId: u32_) -> Result; } extern "C" { - #[doc = " Exits the current thread.\n\n This will trigger a state change and hence release all svcWaitSynchronization operations.\n It means that you can join a thread by calling svcWaitSynchronization(threadHandle,yourtimeout); "] + #[doc = "Exits the current thread.\n\n This will trigger a state change and hence release all svcWaitSynchronization operations.\n It means that you can join a thread by calling svcWaitSynchronization(threadHandle,yourtimeout); "] pub fn svcExitThread() -> !; } extern "C" { - #[doc = " Puts the current thread to sleep.\n # Arguments\n\n* `ns` - The minimum number of nanoseconds to sleep for."] + #[doc = "Puts the current thread to sleep.\n # Arguments\n\n* `ns` - The minimum number of nanoseconds to sleep for."] pub fn svcSleepThread(ns: s64); } extern "C" { #[must_use] - #[doc = " Retrieves the priority of a thread."] + #[doc = "Retrieves the priority of a thread."] pub fn svcGetThreadPriority(out: *mut s32, handle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Changes the priority of a thread\n # Arguments\n\n* `prio` - For userland apps, this has to be within the range [0x18;0x3F]\n\n Low values gives the thread higher priority."] + #[doc = "Changes the priority of a thread\n # Arguments\n\n* `prio` - For userland apps, this has to be within the range [0x18;0x3F]\n\n Low values gives the thread higher priority."] pub fn svcSetThreadPriority(thread: Handle, prio: s32) -> Result; } extern "C" { #[must_use] - #[doc = " Gets a thread's affinity mask.\n # Arguments\n\n* `affinitymask` (direction out) - Pointer to output the affinity masks to.\n * `thread` - Handle of the thread.\n * `processorcount` - Number of processors."] + #[doc = "Gets a thread's affinity mask.\n # Arguments\n\n* `affinitymask` (direction out) - Pointer to output the affinity masks to.\n * `thread` - Handle of the thread.\n * `processorcount` - Number of processors."] pub fn svcGetThreadAffinityMask( affinitymask: *mut u8_, thread: Handle, @@ -2587,7 +2587,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Sets a thread's affinity mask.\n # Arguments\n\n* `thread` - Handle of the thread.\n * `affinitymask` - Pointer to retrieve the affinity masks from.\n * `processorcount` - Number of processors."] + #[doc = "Sets a thread's affinity mask.\n # Arguments\n\n* `thread` - Handle of the thread.\n * `affinitymask` - Pointer to retrieve the affinity masks from.\n * `processorcount` - Number of processors."] pub fn svcSetThreadAffinityMask( thread: Handle, affinitymask: *const u8_, @@ -2596,31 +2596,31 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets a thread's ideal processor.\n # Arguments\n\n* `processorid` (direction out) - Pointer to output the ID of the thread's ideal processor to.\n * `thread` - Handle of the thread."] + #[doc = "Gets a thread's ideal processor.\n # Arguments\n\n* `processorid` (direction out) - Pointer to output the ID of the thread's ideal processor to.\n * `thread` - Handle of the thread."] pub fn svcGetThreadIdealProcessor(processorid: *mut s32, thread: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Sets a thread's ideal processor.\n # Arguments\n\n* `thread` - Handle of the thread.\n * `processorid` - ID of the thread's ideal processor."] + #[doc = "Sets a thread's ideal processor.\n # Arguments\n\n* `thread` - Handle of the thread.\n * `processorid` - ID of the thread's ideal processor."] pub fn svcSetThreadIdealProcessor(thread: Handle, processorid: s32) -> Result; } extern "C" { - #[doc = " Returns the ID of the processor the current thread is running on.\n [`svcCreateThread`]"] + #[doc = "Returns the ID of the processor the current thread is running on.\n [`svcCreateThread`]"] pub fn svcGetProcessorID() -> s32; } extern "C" { #[must_use] - #[doc = " Gets the ID of a thread.\n # Arguments\n\n* `out` (direction out) - Pointer to output the thread ID of the thread `handle` to.\n * `handle` - Handle of the thread."] + #[doc = "Gets the ID of a thread.\n # Arguments\n\n* `out` (direction out) - Pointer to output the thread ID of the thread `handle` to.\n * `handle` - Handle of the thread."] pub fn svcGetThreadId(out: *mut u32_, handle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the resource limit set of a process.\n # Arguments\n\n* `resourceLimit` (direction out) - Pointer to output the resource limit set handle to.\n * `process` - Process to get the resource limits of."] + #[doc = "Gets the resource limit set of a process.\n # Arguments\n\n* `resourceLimit` (direction out) - Pointer to output the resource limit set handle to.\n * `process` - Process to get the resource limits of."] pub fn svcGetResourceLimit(resourceLimit: *mut Handle, process: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the value limits of a resource limit set.\n # Arguments\n\n* `values` (direction out) - Pointer to output the value limits to.\n * `resourceLimit` - Resource limit set to use.\n * `names` - Resource limit names to get the limits of.\n * `nameCount` - Number of resource limit names."] + #[doc = "Gets the value limits of a resource limit set.\n # Arguments\n\n* `values` (direction out) - Pointer to output the value limits to.\n * `resourceLimit` - Resource limit set to use.\n * `names` - Resource limit names to get the limits of.\n * `nameCount` - Number of resource limit names."] pub fn svcGetResourceLimitLimitValues( values: *mut s64, resourceLimit: Handle, @@ -2630,7 +2630,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets the values of a resource limit set.\n # Arguments\n\n* `values` (direction out) - Pointer to output the values to.\n * `resourceLimit` - Resource limit set to use.\n * `names` - Resource limit names to get the values of.\n * `nameCount` - Number of resource limit names."] + #[doc = "Gets the values of a resource limit set.\n # Arguments\n\n* `values` (direction out) - Pointer to output the values to.\n * `resourceLimit` - Resource limit set to use.\n * `names` - Resource limit names to get the values of.\n * `nameCount` - Number of resource limit names."] pub fn svcGetResourceLimitCurrentValues( values: *mut s64, resourceLimit: Handle, @@ -2640,17 +2640,17 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Sets the resource limit set of a process.\n # Arguments\n\n* `process` - Process to set the resource limit set to.\n * `resourceLimit` - Resource limit set handle."] + #[doc = "Sets the resource limit set of a process.\n # Arguments\n\n* `process` - Process to set the resource limit set to.\n * `resourceLimit` - Resource limit set handle."] pub fn svcSetProcessResourceLimits(process: Handle, resourceLimit: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Creates a resource limit set.\n # Arguments\n\n* `resourceLimit` (direction out) - Pointer to output the resource limit set handle to."] + #[doc = "Creates a resource limit set.\n # Arguments\n\n* `resourceLimit` (direction out) - Pointer to output the resource limit set handle to."] pub fn svcCreateResourceLimit(resourceLimit: *mut Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the value limits of a resource limit set.\n # Arguments\n\n* `resourceLimit` - Resource limit set to use.\n * `names` - Resource limit names to set the limits of.\n * `values` - Value limits to set. The high 32 bits of RESLIMIT_COMMIT are used to\nset APPMEMALLOC in configuration memory, otherwise those bits are unused.\n * `nameCount` - Number of resource limit names."] + #[doc = "Sets the value limits of a resource limit set.\n # Arguments\n\n* `resourceLimit` - Resource limit set to use.\n * `names` - Resource limit names to set the limits of.\n * `values` - Value limits to set. The high 32 bits of RESLIMIT_COMMIT are used to\nset APPMEMALLOC in configuration memory, otherwise those bits are unused.\n * `nameCount` - Number of resource limit names."] pub fn svcSetResourceLimitValues( resourceLimit: Handle, names: *const ResourceLimitType, @@ -2660,58 +2660,58 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets the process ID of a thread.\n # Arguments\n\n* `out` (direction out) - Pointer to output the process ID of the thread `handle` to.\n * `handle` - Handle of the thread.\n [`svcOpenProcess`]"] + #[doc = "Gets the process ID of a thread.\n # Arguments\n\n* `out` (direction out) - Pointer to output the process ID of the thread `handle` to.\n * `handle` - Handle of the thread.\n [`svcOpenProcess`]"] pub fn svcGetProcessIdOfThread(out: *mut u32_, handle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Checks if a thread handle is valid.\n This requests always return an error when called, it only checks if the handle is a thread or not.\n # Returns\n\n0xD8E007ED (BAD_ENUM) if the Handle is a Thread Handle\n 0xD8E007F7 (BAD_HANDLE) if it isn't."] + #[doc = "Checks if a thread handle is valid.\n This requests always return an error when called, it only checks if the handle is a thread or not.\n # Returns\n\n0xD8E007ED (BAD_ENUM) if the Handle is a Thread Handle\n 0xD8E007F7 (BAD_HANDLE) if it isn't."] pub fn svcGetThreadInfo(out: *mut s64, thread: Handle, type_: ThreadInfoType) -> Result; } extern "C" { #[must_use] - #[doc = "Synchronization\n# **\n* Creates a mutex.\n* # Arguments\n\n* `mutex` (direction out) - Pointer to output the handle of the created mutex to.\n* * `initially_locked` - Whether the mutex should be initially locked.\n*/"] + #[doc = "Synchronization\n# *\n* Creates a mutex.\n # Arguments\n\n* `mutex` (direction out) - Pointer to output the handle of the created mutex to.\n * `initially_locked` - Whether the mutex should be initially locked.\n/"] pub fn svcCreateMutex(mutex: *mut Handle, initially_locked: bool) -> Result; } extern "C" { #[must_use] - #[doc = " Releases a mutex.\n # Arguments\n\n* `handle` - Handle of the mutex."] + #[doc = "Releases a mutex.\n # Arguments\n\n* `handle` - Handle of the mutex."] pub fn svcReleaseMutex(handle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Creates a semaphore.\n # Arguments\n\n* `semaphore` (direction out) - Pointer to output the handle of the created semaphore to.\n * `initial_count` - Initial count of the semaphore.\n * `max_count` - Maximum count of the semaphore."] + #[doc = "Creates a semaphore.\n # Arguments\n\n* `semaphore` (direction out) - Pointer to output the handle of the created semaphore to.\n * `initial_count` - Initial count of the semaphore.\n * `max_count` - Maximum count of the semaphore."] pub fn svcCreateSemaphore(semaphore: *mut Handle, initial_count: s32, max_count: s32) -> Result; } extern "C" { #[must_use] - #[doc = " Releases a semaphore.\n # Arguments\n\n* `count` (direction out) - Pointer to output the current count of the semaphore to.\n * `semaphore` - Handle of the semaphore.\n * `release_count` - Number to increase the semaphore count by."] + #[doc = "Releases a semaphore.\n # Arguments\n\n* `count` (direction out) - Pointer to output the current count of the semaphore to.\n * `semaphore` - Handle of the semaphore.\n * `release_count` - Number to increase the semaphore count by."] pub fn svcReleaseSemaphore(count: *mut s32, semaphore: Handle, release_count: s32) -> Result; } extern "C" { #[must_use] - #[doc = " Creates an event handle.\n # Arguments\n\n* `event` (direction out) - Pointer to output the created event handle to.\n * `reset_type` - Type of reset the event uses (RESET_ONESHOT/RESET_STICKY)."] + #[doc = "Creates an event handle.\n # Arguments\n\n* `event` (direction out) - Pointer to output the created event handle to.\n * `reset_type` - Type of reset the event uses (RESET_ONESHOT/RESET_STICKY)."] pub fn svcCreateEvent(event: *mut Handle, reset_type: ResetType) -> Result; } extern "C" { #[must_use] - #[doc = " Signals an event.\n # Arguments\n\n* `handle` - Handle of the event to signal."] + #[doc = "Signals an event.\n # Arguments\n\n* `handle` - Handle of the event to signal."] pub fn svcSignalEvent(handle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Clears an event.\n # Arguments\n\n* `handle` - Handle of the event to clear."] + #[doc = "Clears an event.\n # Arguments\n\n* `handle` - Handle of the event to clear."] pub fn svcClearEvent(handle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Waits for synchronization on a handle.\n # Arguments\n\n* `handle` - Handle to wait on.\n * `nanoseconds` - Maximum nanoseconds to wait for."] + #[doc = "Waits for synchronization on a handle.\n # Arguments\n\n* `handle` - Handle to wait on.\n * `nanoseconds` - Maximum nanoseconds to wait for."] pub fn svcWaitSynchronization(handle: Handle, nanoseconds: s64) -> Result; } extern "C" { #[must_use] - #[doc = " Waits for synchronization on multiple handles.\n # Arguments\n\n* `out` (direction out) - Pointer to output the index of the synchronized handle to.\n * `handles` - Handles to wait on.\n * `handles_num` - Number of handles.\n * `wait_all` - Whether to wait for synchronization on all handles.\n * `nanoseconds` - Maximum nanoseconds to wait for."] + #[doc = "Waits for synchronization on multiple handles.\n # Arguments\n\n* `out` (direction out) - Pointer to output the index of the synchronized handle to.\n * `handles` - Handles to wait on.\n * `handles_num` - Number of handles.\n * `wait_all` - Whether to wait for synchronization on all handles.\n * `nanoseconds` - Maximum nanoseconds to wait for."] pub fn svcWaitSynchronizationN( out: *mut s32, handles: *const Handle, @@ -2722,12 +2722,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Creates an address arbiter\n # Arguments\n\n* `mutex` (direction out) - Pointer to output the handle of the created address arbiter to.\n [`svcArbitrateAddress`]"] + #[doc = "Creates an address arbiter\n # Arguments\n\n* `mutex` (direction out) - Pointer to output the handle of the created address arbiter to.\n [`svcArbitrateAddress`]"] pub fn svcCreateAddressArbiter(arbiter: *mut Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Arbitrate an address, can be used for synchronization\n # Arguments\n\n* `arbiter` - Handle of the arbiter\n * `addr` - A pointer to a s32 value.\n * `type` - Type of action to be performed by the arbiter\n * `value` - Number of threads to signal if using ARBITRATION_SIGNAL, or the value used for comparison.\n * `timeout_ns` - Optional timeout in nanoseconds when using TIMEOUT actions, ignored otherwise. If not needed, use svcArbitrateAddressNoTimeout instead.\n > **Note:** Usage of this syscall entails an implicit Data Memory Barrier (dmb).\n Please use syncArbitrateAddressWithTimeout instead."] + #[doc = "Arbitrate an address, can be used for synchronization\n # Arguments\n\n* `arbiter` - Handle of the arbiter\n * `addr` - A pointer to a s32 value.\n * `type` - Type of action to be performed by the arbiter\n * `value` - Number of threads to signal if using ARBITRATION_SIGNAL, or the value used for comparison.\n * `timeout_ns` - Optional timeout in nanoseconds when using TIMEOUT actions, ignored otherwise. If not needed, use svcArbitrateAddressNoTimeout instead.\n > **Note:** Usage of this syscall entails an implicit Data Memory Barrier (dmb).\n Please use syncArbitrateAddressWithTimeout instead."] pub fn svcArbitrateAddress( arbiter: Handle, addr: u32_, @@ -2738,7 +2738,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Same as svcArbitrateAddress but with the timeout_ns parameter undefined.\n # Arguments\n\n* `arbiter` - Handle of the arbiter\n * `addr` - A pointer to a s32 value.\n * `type` - Type of action to be performed by the arbiter\n * `value` - Number of threads to signal if using ARBITRATION_SIGNAL, or the value used for comparison.\n > **Note:** Usage of this syscall entails an implicit Data Memory Barrier (dmb).\n Please use syncArbitrateAddress instead."] + #[doc = "Same as svcArbitrateAddress but with the timeout_ns parameter undefined.\n # Arguments\n\n* `arbiter` - Handle of the arbiter\n * `addr` - A pointer to a s32 value.\n * `type` - Type of action to be performed by the arbiter\n * `value` - Number of threads to signal if using ARBITRATION_SIGNAL, or the value used for comparison.\n > **Note:** Usage of this syscall entails an implicit Data Memory Barrier (dmb).\n Please use syncArbitrateAddress instead."] pub fn svcArbitrateAddressNoTimeout( arbiter: Handle, addr: u32_, @@ -2748,27 +2748,27 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Sends a synchronized request to a session handle.\n # Arguments\n\n* `session` - Handle of the session."] + #[doc = "Sends a synchronized request to a session handle.\n # Arguments\n\n* `session` - Handle of the session."] pub fn svcSendSyncRequest(session: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Connects to a port via a handle.\n # Arguments\n\n* `clientSession` (direction out) - Pointer to output the client session handle to.\n * `clientPort` - Port client endpoint to connect to."] + #[doc = "Connects to a port via a handle.\n # Arguments\n\n* `clientSession` (direction out) - Pointer to output the client session handle to.\n * `clientPort` - Port client endpoint to connect to."] pub fn svcCreateSessionToPort(clientSession: *mut Handle, clientPort: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Creates a linked pair of session endpoints.\n # Arguments\n\n* `serverSession` (direction out) - Pointer to output the created server endpoint handle to.\n * `clientSession` (direction out) - Pointer to output the created client endpoint handle to."] + #[doc = "Creates a linked pair of session endpoints.\n # Arguments\n\n* `serverSession` (direction out) - Pointer to output the created server endpoint handle to.\n * `clientSession` (direction out) - Pointer to output the created client endpoint handle to."] pub fn svcCreateSession(serverSession: *mut Handle, clientSession: *mut Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Accepts a session.\n # Arguments\n\n* `session` (direction out) - Pointer to output the created session handle to.\n * `port` - Handle of the port to accept a session from."] + #[doc = "Accepts a session.\n # Arguments\n\n* `session` (direction out) - Pointer to output the created session handle to.\n * `port` - Handle of the port to accept a session from."] pub fn svcAcceptSession(session: *mut Handle, port: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Replies to and receives a new request.\n # Arguments\n\n* `index` - Pointer to the index of the request.\n * `handles` - Session handles to receive requests from.\n * `handleCount` - Number of handles.\n * `replyTarget` - Handle of the session to reply to."] + #[doc = "Replies to and receives a new request.\n # Arguments\n\n* `index` - Pointer to the index of the request.\n * `handles` - Session handles to receive requests from.\n * `handleCount` - Number of handles.\n * `replyTarget` - Handle of the session to reply to."] pub fn svcReplyAndReceive( index: *mut s32, handles: *const Handle, @@ -2778,56 +2778,56 @@ extern "C" { } extern "C" { #[must_use] - #[doc = "Time\n# **\n* Creates a timer.\n* # Arguments\n\n* `timer` (direction out) - Pointer to output the handle of the created timer to.\n* * `reset_type` - Type of reset to perform on the timer.\n*/"] + #[doc = "Time\n# *\n* Creates a timer.\n # Arguments\n\n* `timer` (direction out) - Pointer to output the handle of the created timer to.\n * `reset_type` - Type of reset to perform on the timer.\n/"] pub fn svcCreateTimer(timer: *mut Handle, reset_type: ResetType) -> Result; } extern "C" { #[must_use] - #[doc = " Sets a timer.\n # Arguments\n\n* `timer` - Handle of the timer to set.\n * `initial` - Initial value of the timer.\n * `interval` - Interval of the timer."] + #[doc = "Sets a timer.\n # Arguments\n\n* `timer` - Handle of the timer to set.\n * `initial` - Initial value of the timer.\n * `interval` - Interval of the timer."] pub fn svcSetTimer(timer: Handle, initial: s64, interval: s64) -> Result; } extern "C" { #[must_use] - #[doc = " Cancels a timer.\n # Arguments\n\n* `timer` - Handle of the timer to cancel."] + #[doc = "Cancels a timer.\n # Arguments\n\n* `timer` - Handle of the timer to cancel."] pub fn svcCancelTimer(timer: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Clears a timer.\n # Arguments\n\n* `timer` - Handle of the timer to clear."] + #[doc = "Clears a timer.\n # Arguments\n\n* `timer` - Handle of the timer to clear."] pub fn svcClearTimer(timer: Handle) -> Result; } extern "C" { - #[doc = " Gets the current system tick.\n # Returns\n\nThe current system tick."] + #[doc = "Gets the current system tick.\n # Returns\n\nThe current system tick."] pub fn svcGetSystemTick() -> u64_; } extern "C" { #[must_use] - #[doc = "System\n# **\n* Closes a handle.\n* # Arguments\n\n* `handle` - Handle to close.\n*/"] + #[doc = "System\n# *\n* Closes a handle.\n # Arguments\n\n* `handle` - Handle to close.\n/"] pub fn svcCloseHandle(handle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Duplicates a handle.\n # Arguments\n\n* `out` (direction out) - Pointer to output the duplicated handle to.\n * `original` - Handle to duplicate."] + #[doc = "Duplicates a handle.\n # Arguments\n\n* `out` (direction out) - Pointer to output the duplicated handle to.\n * `original` - Handle to duplicate."] pub fn svcDuplicateHandle(out: *mut Handle, original: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Gets a handle info.\n # Arguments\n\n* `out` (direction out) - Pointer to output the handle info to.\n * `handle` - Handle to get the info for.\n * `param` - Parameter clarifying the handle info type."] + #[doc = "Gets a handle info.\n # Arguments\n\n* `out` (direction out) - Pointer to output the handle info to.\n * `handle` - Handle to get the info for.\n * `param` - Parameter clarifying the handle info type."] pub fn svcGetHandleInfo(out: *mut s64, handle: Handle, param: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the system info.\n # Arguments\n\n* `out` (direction out) - Pointer to output the system info to.\n * `type` - Type of system info to retrieve.\n * `param` - Parameter clarifying the system info type."] + #[doc = "Gets the system info.\n # Arguments\n\n* `out` (direction out) - Pointer to output the system info to.\n * `type` - Type of system info to retrieve.\n * `param` - Parameter clarifying the system info type."] pub fn svcGetSystemInfo(out: *mut s64, type_: u32_, param: s32) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the current kernel state.\n # Arguments\n\n* `type` - Type of state to set (the other parameters depend on it)."] + #[doc = "Sets the current kernel state.\n # Arguments\n\n* `type` - Type of state to set (the other parameters depend on it)."] pub fn svcKernelSetState(type_: u32_, ...) -> Result; } extern "C" { #[must_use] - #[doc = " Binds an event or semaphore handle to an ARM11 interrupt.\n # Arguments\n\n* `interruptId` - Interrupt identfier (see https://www.3dbrew.org/wiki/ARM11_Interrupts).\n * `eventOrSemaphore` - Event or semaphore handle to bind to the given interrupt.\n * `priority` - Priority of the interrupt for the current process.\n * `isManualClear` - Indicates whether the interrupt has to be manually cleared or not (= level-high active)."] + #[doc = "Binds an event or semaphore handle to an ARM11 interrupt.\n # Arguments\n\n* `interruptId` - Interrupt identfier (see https://www.3dbrew.org/wiki/ARM11_Interrupts).\n * `eventOrSemaphore` - Event or semaphore handle to bind to the given interrupt.\n * `priority` - Priority of the interrupt for the current process.\n * `isManualClear` - Indicates whether the interrupt has to be manually cleared or not (= level-high active)."] pub fn svcBindInterrupt( interruptId: u32_, eventOrSemaphore: Handle, @@ -2837,27 +2837,27 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Unbinds an event or semaphore handle from an ARM11 interrupt.\n # Arguments\n\n* `interruptId` - Interrupt identfier, see (see https://www.3dbrew.org/wiki/ARM11_Interrupts).\n * `eventOrSemaphore` - Event or semaphore handle to unbind from the given interrupt."] + #[doc = "Unbinds an event or semaphore handle from an ARM11 interrupt.\n # Arguments\n\n* `interruptId` - Interrupt identfier, see (see https://www.3dbrew.org/wiki/ARM11_Interrupts).\n * `eventOrSemaphore` - Event or semaphore handle to unbind from the given interrupt."] pub fn svcUnbindInterrupt(interruptId: u32_, eventOrSemaphore: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Invalidates a process's data cache.\n # Arguments\n\n* `process` - Handle of the process.\n * `addr` - Address to invalidate.\n * `size` - Size of the memory to invalidate."] + #[doc = "Invalidates a process's data cache.\n # Arguments\n\n* `process` - Handle of the process.\n * `addr` - Address to invalidate.\n * `size` - Size of the memory to invalidate."] pub fn svcInvalidateProcessDataCache(process: Handle, addr: u32_, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Cleans a process's data cache.\n # Arguments\n\n* `process` - Handle of the process.\n * `addr` - Address to clean.\n * `size` - Size of the memory to clean."] + #[doc = "Cleans a process's data cache.\n # Arguments\n\n* `process` - Handle of the process.\n * `addr` - Address to clean.\n * `size` - Size of the memory to clean."] pub fn svcStoreProcessDataCache(process: Handle, addr: u32_, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Flushes (cleans and invalidates) a process's data cache.\n # Arguments\n\n* `process` - Handle of the process.\n * `addr` - Address to flush.\n * `size` - Size of the memory to flush."] + #[doc = "Flushes (cleans and invalidates) a process's data cache.\n # Arguments\n\n* `process` - Handle of the process.\n * `addr` - Address to flush.\n * `size` - Size of the memory to flush."] pub fn svcFlushProcessDataCache(process: Handle, addr: u32_, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Begins an inter-process DMA transfer.\n # Arguments\n\n* `dma` (direction out) - Pointer to output the handle of the DMA channel object to.\n * `dstProcess` - Destination process handle.\n * `dstAddr` - Address in the destination process to write data to.\n * `srcProcess` - Source process handle.\n * `srcAddr` - Address in the source to read data from.\n * `size` - Size of the data to transfer.\n * `cfg` - Configuration structure.\n > **Note:** The handle is signaled when the transfer finishes."] + #[doc = "Begins an inter-process DMA transfer.\n # Arguments\n\n* `dma` (direction out) - Pointer to output the handle of the DMA channel object to.\n * `dstProcess` - Destination process handle.\n * `dstAddr` - Address in the destination process to write data to.\n * `srcProcess` - Source process handle.\n * `srcAddr` - Address in the source to read data from.\n * `size` - Size of the data to transfer.\n * `cfg` - Configuration structure.\n > **Note:** The handle is signaled when the transfer finishes."] pub fn svcStartInterProcessDma( dma: *mut Handle, dstProcess: Handle, @@ -2870,17 +2870,17 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Stops an inter-process DMA transfer.\n # Arguments\n\n* `dma` - Handle of the DMA channel object."] + #[doc = "Stops an inter-process DMA transfer.\n # Arguments\n\n* `dma` - Handle of the DMA channel object."] pub fn svcStopDma(dma: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the state of an inter-process DMA transfer.\n # Arguments\n\n* `state` (direction out) - Pointer to output the state of the DMA transfer to.\n * `dma` - Handle of the DMA channel object."] + #[doc = "Gets the state of an inter-process DMA transfer.\n # Arguments\n\n* `state` (direction out) - Pointer to output the state of the DMA transfer to.\n * `dma` - Handle of the DMA channel object."] pub fn svcGetDmaState(state: *mut DmaState, dma: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Restarts a DMA transfer, using the same configuration as before.\n # Arguments\n\n* `state` (direction out) - Pointer to output the state of the DMA transfer to.\n * `dma` - Handle of the DMA channel object.\n * `dstAddr` - Address in the destination process to write data to.\n * `srcAddr` - Address in the source to read data from.\n * `size` - Size of the data to transfer.\n * `flags` - Restart flags, DMARST_UNLOCK and/or DMARST_RESUME_DEVICE.\n > **Note:** The first transfer has to be configured with DMACFG_KEEP_LOCKED."] + #[doc = "Restarts a DMA transfer, using the same configuration as before.\n # Arguments\n\n* `state` (direction out) - Pointer to output the state of the DMA transfer to.\n * `dma` - Handle of the DMA channel object.\n * `dstAddr` - Address in the destination process to write data to.\n * `srcAddr` - Address in the source to read data from.\n * `size` - Size of the data to transfer.\n * `flags` - Restart flags, DMARST_UNLOCK and/or DMARST_RESUME_DEVICE.\n > **Note:** The first transfer has to be configured with DMACFG_KEEP_LOCKED."] pub fn svcRestartDma( dma: Handle, dstAddr: u32_, @@ -2891,20 +2891,20 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Sets the GPU protection register to restrict the range of the GPU DMA. 11.3+ only.\n # Arguments\n\n* `useApplicationRestriction` - Whether to use the register value used for APPLICATION titles."] + #[doc = "Sets the GPU protection register to restrict the range of the GPU DMA. 11.3+ only.\n # Arguments\n\n* `useApplicationRestriction` - Whether to use the register value used for APPLICATION titles."] pub fn svcSetGpuProt(useApplicationRestriction: bool) -> Result; } extern "C" { #[must_use] - #[doc = " Enables or disables Wi-Fi. 11.4+ only.\n # Arguments\n\n* `enabled` - Whether to enable or disable Wi-Fi."] + #[doc = "Enables or disables Wi-Fi. 11.4+ only.\n # Arguments\n\n* `enabled` - Whether to enable or disable Wi-Fi."] pub fn svcSetWifiEnabled(enabled: bool) -> Result; } extern "C" { - #[doc = "Debugging\n# **\n* Breaks execution.\n* # Arguments\n\n* `breakReason` - Reason for breaking.\n*/"] + #[doc = "Debugging\n# *\n* Breaks execution.\n # Arguments\n\n* `breakReason` - Reason for breaking.\n/"] pub fn svcBreak(breakReason: UserBreakType); } extern "C" { - #[doc = " Breaks execution (LOAD_RO and UNLOAD_RO).\n # Arguments\n\n* `breakReason` - Debug reason for breaking.\n * `croInfo` - Library information.\n * `croInfoSize` - Size of the above structure."] + #[doc = "Breaks execution (LOAD_RO and UNLOAD_RO).\n # Arguments\n\n* `breakReason` - Debug reason for breaking.\n * `croInfo` - Library information.\n * `croInfoSize` - Size of the above structure."] pub fn svcBreakRO( breakReason: UserBreakType, croInfo: *const ::libc::c_void, @@ -2913,12 +2913,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Outputs a debug string.\n # Arguments\n\n* `str` - String to output.\n * `length` - Length of the string to output, needs to be positive."] + #[doc = "Outputs a debug string.\n # Arguments\n\n* `str` - String to output.\n * `length` - Length of the string to output, needs to be positive."] pub fn svcOutputDebugString(str_: *const ::libc::c_char, length: s32) -> Result; } extern "C" { #[must_use] - #[doc = " Controls performance monitoring on the CP15 interface and the SCU.\n The meaning of the parameters depend on the operation.\n # Arguments\n\n* `out` (direction out) - Output.\n * `op` - Operation, see details.\n * `param1` - First parameter.\n * `param2` - Second parameter.\n \n\nThe operations are the following:\n - PERFCOUNTEROP_ENABLE (void) -> void, tries to enable and lock perfmon. functionality.\n - PERFCOUNTEROP_DISABLE (void) -> void, disable and forcibly unlocks perfmon. functionality.\n - PERFCOUNTEROP_GET_VALUE (PerfCounterRegister reg) -> u64, gets the value of a particular counter register.\n - PERFCOUNTEROP_SET_VALUE (PerfCounterRegister reg, u64 value) -> void, sets the value of a particular counter register.\n - PERFCOUNTEROP_GET_OVERFLOW_FLAGS (void) -> u32, gets the overflow flags of all CP15 and SCU registers.\n - Format is a bitfield of PerfCounterRegister.\n - PERFCOUNTEROP_RESET (u32 valueResetMask, u32 overflowFlagResetMask) -> void, resets the value and/or\n overflow flags of selected registers.\n - Format is two bitfields of PerfCounterRegister.\n - PERFCOUNTEROP_GET_EVENT (PerfCounterRegister reg) -> PerfCounterEvent, gets the event associated\n to a particular counter register.\n - PERFCOUNTEROP_SET_EVENT (PerfCounterRegister reg, PerfCounterEvent) -> void, sets the event associated\n to a particular counter register.\n - PERFCOUNTEROP_SET_VIRTUAL_COUNTER_ENABLED (bool enabled) -> void, (dis)allows the kernel to track counter overflows\n and to use 64-bit counter values."] + #[doc = "Controls performance monitoring on the CP15 interface and the SCU.\n The meaning of the parameters depend on the operation.\n # Arguments\n\n* `out` (direction out) - Output.\n * `op` - Operation, see details.\n * `param1` - First parameter.\n * `param2` - Second parameter.\n \n\nThe operations are the following:\n - PERFCOUNTEROP_ENABLE (void) -> void, tries to enable and lock perfmon. functionality.\n - PERFCOUNTEROP_DISABLE (void) -> void, disable and forcibly unlocks perfmon. functionality.\n - PERFCOUNTEROP_GET_VALUE (PerfCounterRegister reg) -> u64, gets the value of a particular counter register.\n - PERFCOUNTEROP_SET_VALUE (PerfCounterRegister reg, u64 value) -> void, sets the value of a particular counter register.\n - PERFCOUNTEROP_GET_OVERFLOW_FLAGS (void) -> u32, gets the overflow flags of all CP15 and SCU registers.\n - Format is a bitfield of PerfCounterRegister.\n - PERFCOUNTEROP_RESET (u32 valueResetMask, u32 overflowFlagResetMask) -> void, resets the value and/or\n overflow flags of selected registers.\n - Format is two bitfields of PerfCounterRegister.\n - PERFCOUNTEROP_GET_EVENT (PerfCounterRegister reg) -> PerfCounterEvent, gets the event associated\n to a particular counter register.\n - PERFCOUNTEROP_SET_EVENT (PerfCounterRegister reg, PerfCounterEvent) -> void, sets the event associated\n to a particular counter register.\n - PERFCOUNTEROP_SET_VIRTUAL_COUNTER_ENABLED (bool enabled) -> void, (dis)allows the kernel to track counter overflows\n and to use 64-bit counter values."] pub fn svcControlPerformanceCounter( out: *mut u64_, op: PerfCounterOperation, @@ -2928,32 +2928,32 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Creates a debug handle for an active process.\n # Arguments\n\n* `debug` (direction out) - Pointer to output the created debug handle to.\n * `processId` - ID of the process to debug."] + #[doc = "Creates a debug handle for an active process.\n # Arguments\n\n* `debug` (direction out) - Pointer to output the created debug handle to.\n * `processId` - ID of the process to debug."] pub fn svcDebugActiveProcess(debug: *mut Handle, processId: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Breaks a debugged process.\n # Arguments\n\n* `debug` - Debug handle of the process."] + #[doc = "Breaks a debugged process.\n # Arguments\n\n* `debug` - Debug handle of the process."] pub fn svcBreakDebugProcess(debug: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Terminates a debugged process.\n # Arguments\n\n* `debug` - Debug handle of the process."] + #[doc = "Terminates a debugged process.\n # Arguments\n\n* `debug` - Debug handle of the process."] pub fn svcTerminateDebugProcess(debug: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the current debug event of a debugged process.\n # Arguments\n\n* `info` (direction out) - Pointer to output the debug event information to.\n * `debug` - Debug handle of the process."] + #[doc = "Gets the current debug event of a debugged process.\n # Arguments\n\n* `info` (direction out) - Pointer to output the debug event information to.\n * `debug` - Debug handle of the process."] pub fn svcGetProcessDebugEvent(info: *mut DebugEventInfo, debug: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Continues the current debug event of a debugged process (not necessarily the same as svcGetProcessDebugEvent).\n # Arguments\n\n* `debug` - Debug handle of the process.\n * `flags` - Flags to continue with, see DebugFlags."] + #[doc = "Continues the current debug event of a debugged process (not necessarily the same as svcGetProcessDebugEvent).\n # Arguments\n\n* `debug` - Debug handle of the process.\n * `flags` - Flags to continue with, see DebugFlags."] pub fn svcContinueDebugEvent(debug: Handle, flags: DebugFlags) -> Result; } extern "C" { #[must_use] - #[doc = " Fetches the saved registers of a thread, either inactive or awaiting svcContinueDebugEvent, belonging to a debugged process.\n # Arguments\n\n* `context` (direction out) - Values of the registers to fetch, see ThreadContext.\n * `debug` - Debug handle of the parent process.\n * `threadId` - ID of the thread to fetch the saved registers of.\n * `controlFlags` - Which registers to fetch, see ThreadContextControlFlags."] + #[doc = "Fetches the saved registers of a thread, either inactive or awaiting svcContinueDebugEvent, belonging to a debugged process.\n # Arguments\n\n* `context` (direction out) - Values of the registers to fetch, see ThreadContext.\n * `debug` - Debug handle of the parent process.\n * `threadId` - ID of the thread to fetch the saved registers of.\n * `controlFlags` - Which registers to fetch, see ThreadContextControlFlags."] pub fn svcGetDebugThreadContext( context: *mut ThreadContext, debug: Handle, @@ -2963,7 +2963,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Updates the saved registers of a thread, either inactive or awaiting svcContinueDebugEvent, belonging to a debugged process.\n # Arguments\n\n* `debug` - Debug handle of the parent process.\n * `threadId` - ID of the thread to update the saved registers of.\n * `context` - Values of the registers to update, see ThreadContext.\n * `controlFlags` - Which registers to update, see ThreadContextControlFlags."] + #[doc = "Updates the saved registers of a thread, either inactive or awaiting svcContinueDebugEvent, belonging to a debugged process.\n # Arguments\n\n* `debug` - Debug handle of the parent process.\n * `threadId` - ID of the thread to update the saved registers of.\n * `context` - Values of the registers to update, see ThreadContext.\n * `controlFlags` - Which registers to update, see ThreadContextControlFlags."] pub fn svcSetDebugThreadContext( debug: Handle, threadId: u32_, @@ -2973,7 +2973,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Queries memory information of a debugged process.\n # Arguments\n\n* `info` (direction out) - Pointer to output memory info to.\n * `out` (direction out) - Pointer to output page info to.\n * `debug` - Debug handle of the process to query memory from.\n * `addr` - Virtual memory address to query."] + #[doc = "Queries memory information of a debugged process.\n # Arguments\n\n* `info` (direction out) - Pointer to output memory info to.\n * `out` (direction out) - Pointer to output page info to.\n * `debug` - Debug handle of the process to query memory from.\n * `addr` - Virtual memory address to query."] pub fn svcQueryDebugProcessMemory( info: *mut MemInfo, out: *mut PageInfo, @@ -2983,7 +2983,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Reads from a debugged process's memory.\n # Arguments\n\n* `buffer` - Buffer to read data to.\n * `debug` - Debug handle of the process.\n * `addr` - Address to read from.\n * `size` - Size of the memory to read."] + #[doc = "Reads from a debugged process's memory.\n # Arguments\n\n* `buffer` - Buffer to read data to.\n * `debug` - Debug handle of the process.\n * `addr` - Address to read from.\n * `size` - Size of the memory to read."] pub fn svcReadProcessMemory( buffer: *mut ::libc::c_void, debug: Handle, @@ -2993,7 +2993,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Writes to a debugged process's memory.\n # Arguments\n\n* `debug` - Debug handle of the process.\n * `buffer` - Buffer to write data from.\n * `addr` - Address to write to.\n * `size` - Size of the memory to write."] + #[doc = "Writes to a debugged process's memory.\n # Arguments\n\n* `debug` - Debug handle of the process.\n * `buffer` - Buffer to write data from.\n * `addr` - Address to write to.\n * `size` - Size of the memory to write."] pub fn svcWriteProcessMemory( debug: Handle, buffer: *const ::libc::c_void, @@ -3003,12 +3003,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Sets an hardware breakpoint or watchpoint. This is an interface to the BRP/WRP registers, see http://infocenter.arm.com/help/topic/com.arm.doc.ddi0360f/CEGEBGFC.html .\n # Arguments\n\n* `registerId` - range 0..5 = breakpoints (BRP0-5), 0x100..0x101 = watchpoints (WRP0-1). The previous stop point for the register is disabled.\n * `control` - Value of the control regiser.\n * `value` - Value of the value register: either and address (if bit21 of control is clear) or the debug handle of a process to fetch the context ID of."] + #[doc = "Sets an hardware breakpoint or watchpoint. This is an interface to the BRP/WRP registers, see http://infocenter.arm.com/help/topic/com.arm.doc.ddi0360f/CEGEBGFC.html .\n # Arguments\n\n* `registerId` - range 0..5 = breakpoints (BRP0-5), 0x100..0x101 = watchpoints (WRP0-1). The previous stop point for the register is disabled.\n * `control` - Value of the control regiser.\n * `value` - Value of the value register: either and address (if bit21 of control is clear) or the debug handle of a process to fetch the context ID of."] pub fn svcSetHardwareBreakPoint(registerId: s32, control: u32_, value: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets a debugged thread's parameter.\n # Arguments\n\n* `unused` (direction out) - Unused.\n * `out` (direction out) - Output value.\n * `debug` - Debug handle of the process.\n * `threadId` - ID of the thread\n * `parameter` - Parameter to fetch, see DebugThreadParameter."] + #[doc = "Gets a debugged thread's parameter.\n # Arguments\n\n* `unused` (direction out) - Unused.\n * `out` (direction out) - Output value.\n * `debug` - Debug handle of the process.\n * `threadId` - ID of the thread\n * `parameter` - Parameter to fetch, see DebugThreadParameter."] pub fn svcGetDebugThreadParam( unused: *mut s64, out: *mut u32_, @@ -3019,7 +3019,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Executes a function in supervisor mode.\n # Arguments\n\n* `callback` - Function to execute."] + #[doc = "Executes a function in supervisor mode.\n # Arguments\n\n* `callback` - Function to execute."] pub fn svcBackdoor(callback: ::core::option::Option s32>) -> Result; } #[doc = "< Mount \"nand:/\""] @@ -3042,7 +3042,7 @@ pub const ARM9DESC_USE_CARD_SPI: _bindgen_ty_7 = 128; pub const ARM9DESC_SD_APPLICATION: _bindgen_ty_7 = 256; #[doc = "< Mount \"sdmc:/\" as read-write"] pub const ARM9DESC_MOUNT_SDMC_RW: _bindgen_ty_7 = 512; -#[doc = " ARM9 descriptor flags"] +#[doc = "ARM9 descriptor flags"] pub type _bindgen_ty_7 = ::libc::c_uint; #[doc = "< Category \"system application\""] pub const FSACCESS_CATEGORY_SYSTEM_APPLICATION: _bindgen_ty_8 = 1; @@ -3088,7 +3088,7 @@ pub const FSACCESS_SHELL: _bindgen_ty_8 = 524288; pub const FSACCESS_CATEGORY_HOME_MENU: _bindgen_ty_8 = 1048576; #[doc = "< Seed DB (9.6+)"] pub const FSACCESS_SEEDDB: _bindgen_ty_8 = 2097152; -#[doc = " Filesystem access flags"] +#[doc = "Filesystem access flags"] pub type _bindgen_ty_8 = ::libc::c_uint; #[doc = "< Regular application"] pub const RESLIMIT_CATEGORY_APPLICATION: ResourceLimitCategory = 0; @@ -3098,7 +3098,7 @@ pub const RESLIMIT_CATEGORY_SYS_APPLET: ResourceLimitCategory = 1; pub const RESLIMIT_CATEGORY_LIB_APPLET: ResourceLimitCategory = 2; #[doc = "< System modules running inside the BASE memregion"] pub const RESLIMIT_CATEGORY_OTHER: ResourceLimitCategory = 3; -#[doc = " The resource limit category of a title"] +#[doc = "The resource limit category of a title"] pub type ResourceLimitCategory = ::libc::c_uint; #[doc = "< 64MB of usable application memory"] pub const SYSMODE_O3DS_PROD: SystemMode = 0; @@ -3112,9 +3112,9 @@ pub const SYSMODE_DEV2: SystemMode = 3; pub const SYSMODE_DEV3: SystemMode = 4; #[doc = "< 32MB of usable application memory. Same as \"Prod\" on N3DS"] pub const SYSMODE_DEV4: SystemMode = 5; -#[doc = " The system mode a title should be launched under"] +#[doc = "The system mode a title should be launched under"] pub type SystemMode = ::libc::c_uint; -#[doc = " The system info flags and remaster version of a title"] +#[doc = "The system info flags and remaster version of a title"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct ExHeader_SystemInfoFlags { @@ -3165,7 +3165,7 @@ impl ExHeader_SystemInfoFlags { __bindgen_bitfield_unit } } -#[doc = " Information about a title's section"] +#[doc = "Information about a title's section"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct ExHeader_CodeSectionInfo { @@ -3176,7 +3176,7 @@ pub struct ExHeader_CodeSectionInfo { #[doc = "< The size of the section"] pub size: u32_, } -#[doc = " The name of a title and infomation about its section"] +#[doc = "The name of a title and infomation about its section"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct ExHeader_CodeSetInfo { @@ -3197,7 +3197,7 @@ pub struct ExHeader_CodeSetInfo { #[doc = "< .bss section size"] pub bss_size: u32_, } -#[doc = " The savedata size and jump ID of a title"] +#[doc = "The savedata size and jump ID of a title"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ExHeader_SystemInfo { @@ -3217,7 +3217,7 @@ impl Default for ExHeader_SystemInfo { } } } -#[doc = " The code set info, dependencies and system info of a title (SCI)"] +#[doc = "The code set info, dependencies and system info of a title (SCI)"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ExHeader_SystemControlInfo { @@ -3237,7 +3237,7 @@ impl Default for ExHeader_SystemControlInfo { } } } -#[doc = " The ARM11 filesystem info of a title"] +#[doc = "The ARM11 filesystem info of a title"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct ExHeader_Arm11StorageInfo { @@ -3309,7 +3309,7 @@ impl ExHeader_Arm11StorageInfo { __bindgen_bitfield_unit } } -#[doc = " The CPU-related and memory-layout-related info of a title"] +#[doc = "The CPU-related and memory-layout-related info of a title"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ExHeader_Arm11CoreInfo { @@ -3466,7 +3466,7 @@ impl ExHeader_Arm11CoreInfo { __bindgen_bitfield_unit } } -#[doc = " The ARM11 system-local capabilities of a title"] +#[doc = "The ARM11 system-local capabilities of a title"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ExHeader_Arm11SystemLocalCapabilities { @@ -3494,7 +3494,7 @@ impl Default for ExHeader_Arm11SystemLocalCapabilities { } } } -#[doc = " The ARM11 kernel capabilities of a title"] +#[doc = "The ARM11 kernel capabilities of a title"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct ExHeader_Arm11KernelCapabilities { @@ -3503,7 +3503,7 @@ pub struct ExHeader_Arm11KernelCapabilities { #[doc = "< Reserved"] pub reserved: [u8_; 16usize], } -#[doc = " The ARM9 access control of a title"] +#[doc = "The ARM9 access control of a title"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct ExHeader_Arm9AccessControl { @@ -3512,7 +3512,7 @@ pub struct ExHeader_Arm9AccessControl { #[doc = "< Descriptor version"] pub descriptor_version: u8_, } -#[doc = " The access control information of a title"] +#[doc = "The access control information of a title"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ExHeader_AccessControlInfo { @@ -3532,7 +3532,7 @@ impl Default for ExHeader_AccessControlInfo { } } } -#[doc = " Main extended header data, as returned by PXIPM, Loader and FSREG service commands"] +#[doc = "Main extended header data, as returned by PXIPM, Loader and FSREG service commands"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ExHeader_Info { @@ -3550,7 +3550,7 @@ impl Default for ExHeader_Info { } } } -#[doc = " Extended header access descriptor"] +#[doc = "Extended header access descriptor"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ExHeader_AccessDescriptor { @@ -3570,7 +3570,7 @@ impl Default for ExHeader_AccessDescriptor { } } } -#[doc = " The NCCH Extended Header of a title"] +#[doc = "The NCCH Extended Header of a title"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ExHeader { @@ -3590,39 +3590,39 @@ impl Default for ExHeader { } extern "C" { #[must_use] - #[doc = " Initializes the service API."] + #[doc = "Initializes the service API."] pub fn srvInit() -> Result; } extern "C" { - #[doc = " Exits the service API."] + #[doc = "Exits the service API."] pub fn srvExit(); } extern "C" { - #[doc = " Makes srvGetServiceHandle non-blocking for the current thread (or blocking, the default), in case of unavailable (full) requested services.\n # Arguments\n\n* `blocking` - Whether srvGetServiceHandle should be non-blocking.\n srvGetServiceHandle will always block if the service hasn't been registered yet,\n use srvIsServiceRegistered to check whether that is the case or not."] + #[doc = "Makes srvGetServiceHandle non-blocking for the current thread (or blocking, the default), in case of unavailable (full) requested services.\n # Arguments\n\n* `blocking` - Whether srvGetServiceHandle should be non-blocking.\n srvGetServiceHandle will always block if the service hasn't been registered yet,\n use srvIsServiceRegistered to check whether that is the case or not."] pub fn srvSetBlockingPolicy(nonBlocking: bool); } extern "C" { - #[doc = " Gets the current service API session handle.\n # Returns\n\nThe current service API session handle."] + #[doc = "Gets the current service API session handle.\n # Returns\n\nThe current service API session handle."] pub fn srvGetSessionHandle() -> *mut Handle; } extern "C" { #[must_use] - #[doc = " Retrieves a service handle, retrieving from the environment handle list if possible.\n # Arguments\n\n* `out` - Pointer to write the handle to.\n * `name` - Name of the service.\n # Returns\n\n0 if no error occured,\n 0xD8E06406 if the caller has no right to access the service,\n 0xD0401834 if the requested service port is full and srvGetServiceHandle is non-blocking (see srvSetBlockingPolicy)."] + #[doc = "Retrieves a service handle, retrieving from the environment handle list if possible.\n # Arguments\n\n* `out` - Pointer to write the handle to.\n * `name` - Name of the service.\n # Returns\n\n0 if no error occured,\n 0xD8E06406 if the caller has no right to access the service,\n 0xD0401834 if the requested service port is full and srvGetServiceHandle is non-blocking (see srvSetBlockingPolicy)."] pub fn srvGetServiceHandle(out: *mut Handle, name: *const ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = " Registers the current process as a client to the service API."] + #[doc = "Registers the current process as a client to the service API."] pub fn srvRegisterClient() -> Result; } extern "C" { #[must_use] - #[doc = " Enables service notificatios, returning a notification semaphore.\n # Arguments\n\n* `semaphoreOut` - Pointer to output the notification semaphore to."] + #[doc = "Enables service notificatios, returning a notification semaphore.\n # Arguments\n\n* `semaphoreOut` - Pointer to output the notification semaphore to."] pub fn srvEnableNotification(semaphoreOut: *mut Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Registers the current process as a service.\n # Arguments\n\n* `out` - Pointer to write the service handle to.\n * `name` - Name of the service.\n * `maxSessions` - Maximum number of sessions the service can handle."] + #[doc = "Registers the current process as a service.\n # Arguments\n\n* `out` - Pointer to write the service handle to.\n * `name` - Name of the service.\n * `maxSessions` - Maximum number of sessions the service can handle."] pub fn srvRegisterService( out: *mut Handle, name: *const ::libc::c_char, @@ -3631,57 +3631,57 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Unregisters the current process as a service.\n # Arguments\n\n* `name` - Name of the service."] + #[doc = "Unregisters the current process as a service.\n # Arguments\n\n* `name` - Name of the service."] pub fn srvUnregisterService(name: *const ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = " Retrieves a service handle.\n # Arguments\n\n* `out` - Pointer to output the handle to.\n * `name` - Name of the service.\n * # Returns\n\n0 if no error occured,\n 0xD8E06406 if the caller has no right to access the service,\n 0xD0401834 if the requested service port is full and srvGetServiceHandle is non-blocking (see srvSetBlockingPolicy)."] + #[doc = "Retrieves a service handle.\n # Arguments\n\n* `out` - Pointer to output the handle to.\n * `name` - Name of the service.\n * # Returns\n\n0 if no error occured,\n 0xD8E06406 if the caller has no right to access the service,\n 0xD0401834 if the requested service port is full and srvGetServiceHandle is non-blocking (see srvSetBlockingPolicy)."] pub fn srvGetServiceHandleDirect(out: *mut Handle, name: *const ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = " Registers a port.\n # Arguments\n\n* `name` - Name of the port.\n * `clientHandle` - Client handle of the port."] + #[doc = "Registers a port.\n # Arguments\n\n* `name` - Name of the port.\n * `clientHandle` - Client handle of the port."] pub fn srvRegisterPort(name: *const ::libc::c_char, clientHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Unregisters a port.\n # Arguments\n\n* `name` - Name of the port."] + #[doc = "Unregisters a port.\n # Arguments\n\n* `name` - Name of the port."] pub fn srvUnregisterPort(name: *const ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = " Retrieves a port handle.\n # Arguments\n\n* `out` - Pointer to output the handle to.\n * `name` - Name of the port."] + #[doc = "Retrieves a port handle.\n # Arguments\n\n* `out` - Pointer to output the handle to.\n * `name` - Name of the port."] pub fn srvGetPort(out: *mut Handle, name: *const ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = " Waits for a port to be registered.\n # Arguments\n\n* `name` - Name of the port to wait for registration."] + #[doc = "Waits for a port to be registered.\n # Arguments\n\n* `name` - Name of the port to wait for registration."] pub fn srvWaitForPortRegistered(name: *const ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = " Subscribes to a notification.\n # Arguments\n\n* `notificationId` - ID of the notification."] + #[doc = "Subscribes to a notification.\n # Arguments\n\n* `notificationId` - ID of the notification."] pub fn srvSubscribe(notificationId: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Unsubscribes from a notification.\n # Arguments\n\n* `notificationId` - ID of the notification."] + #[doc = "Unsubscribes from a notification.\n # Arguments\n\n* `notificationId` - ID of the notification."] pub fn srvUnsubscribe(notificationId: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Receives a notification.\n # Arguments\n\n* `notificationIdOut` - Pointer to output the ID of the received notification to."] + #[doc = "Receives a notification.\n # Arguments\n\n* `notificationIdOut` - Pointer to output the ID of the received notification to."] pub fn srvReceiveNotification(notificationIdOut: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Publishes a notification to subscribers.\n # Arguments\n\n* `notificationId` - ID of the notification.\n * `flags` - Flags to publish with. (bit 0 = only fire if not fired, bit 1 = do not report an error if there are more than 16 pending notifications)"] + #[doc = "Publishes a notification to subscribers.\n # Arguments\n\n* `notificationId` - ID of the notification.\n * `flags` - Flags to publish with. (bit 0 = only fire if not fired, bit 1 = do not report an error if there are more than 16 pending notifications)"] pub fn srvPublishToSubscriber(notificationId: u32_, flags: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Publishes a notification to subscribers and retrieves a list of all processes that were notified.\n # Arguments\n\n* `processIdCountOut` - Pointer to output the number of process IDs to.\n * `processIdsOut` - Pointer to output the process IDs to. Should have size \"60 * sizeof(u32)\".\n * `notificationId` - ID of the notification."] + #[doc = "Publishes a notification to subscribers and retrieves a list of all processes that were notified.\n # Arguments\n\n* `processIdCountOut` - Pointer to output the number of process IDs to.\n * `processIdsOut` - Pointer to output the process IDs to. Should have size \"60 * sizeof(u32)\".\n * `notificationId` - ID of the notification."] pub fn srvPublishAndGetSubscriber( processIdCountOut: *mut u32_, processIdsOut: *mut u32_, @@ -3690,12 +3690,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Checks whether a service is registered.\n # Arguments\n\n* `registeredOut` - Pointer to output the registration status to.\n * `name` - Name of the service to check."] + #[doc = "Checks whether a service is registered.\n # Arguments\n\n* `registeredOut` - Pointer to output the registration status to.\n * `name` - Name of the service to check."] pub fn srvIsServiceRegistered(registeredOut: *mut bool, name: *const ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = " Checks whether a port is registered.\n # Arguments\n\n* `registeredOut` - Pointer to output the registration status to.\n * `name` - Name of the port to check."] + #[doc = "Checks whether a port is registered.\n # Arguments\n\n* `registeredOut` - Pointer to output the registration status to.\n * `name` - Name of the port to check."] pub fn srvIsPortRegistered(registeredOut: *mut bool, name: *const ::libc::c_char) -> Result; } #[doc = "< Generic fatal error. Shows miscellaneous info, including the address of the caller"] @@ -3710,7 +3710,7 @@ pub const ERRF_ERRTYPE_EXCEPTION: ERRF_ErrType = 3; pub const ERRF_ERRTYPE_FAILURE: ERRF_ErrType = 4; #[doc = "< Log-level failure. Does not display the exception and does not force the system to reboot"] pub const ERRF_ERRTYPE_LOG_ONLY: ERRF_ErrType = 5; -#[doc = " Types of errors that can be thrown by err:f."] +#[doc = "Types of errors that can be thrown by err:f."] pub type ERRF_ErrType = ::libc::c_uint; #[doc = "< Prefetch Abort"] pub const ERRF_EXCEPTION_PREFETCH_ABORT: ERRF_ExceptionType = 0; @@ -3720,7 +3720,7 @@ pub const ERRF_EXCEPTION_DATA_ABORT: ERRF_ExceptionType = 1; pub const ERRF_EXCEPTION_UNDEFINED: ERRF_ExceptionType = 2; #[doc = "< VFP (floating point) exception."] pub const ERRF_EXCEPTION_VFP: ERRF_ExceptionType = 3; -#[doc = " Types of 'Exceptions' thrown for ERRF_ERRTYPE_EXCEPTION"] +#[doc = "Types of 'Exceptions' thrown for ERRF_ERRTYPE_EXCEPTION"] pub type ERRF_ExceptionType = ::libc::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -3812,47 +3812,47 @@ impl Default for ERRF_FatalErrInfo { } extern "C" { #[must_use] - #[doc = " Initializes ERR:f. Unless you plan to call ERRF_Throw yourself, do not use this."] + #[doc = "Initializes ERR:f. Unless you plan to call ERRF_Throw yourself, do not use this."] pub fn errfInit() -> Result; } extern "C" { - #[doc = " Exits ERR:f. Unless you plan to call ERRF_Throw yourself, do not use this."] + #[doc = "Exits ERR:f. Unless you plan to call ERRF_Throw yourself, do not use this."] pub fn errfExit(); } extern "C" { - #[doc = " Gets the current err:f API session handle.\n # Returns\n\nThe current err:f API session handle."] + #[doc = "Gets the current err:f API session handle.\n # Returns\n\nThe current err:f API session handle."] pub fn errfGetSessionHandle() -> *mut Handle; } extern "C" { #[must_use] - #[doc = " Throws a system error and possibly logs it.\n # Arguments\n\n* `error` (direction in) - Error to throw.\n\n ErrDisp may convert the error info to ERRF_ERRTYPE_NAND_DAMAGED or ERRF_ERRTYPE_CARD_REMOVED\n depending on the error code.\n\n Except with ERRF_ERRTYPE_LOG_ONLY, the system will panic and will need to be rebooted.\n Fatal error information will also be logged into a file, unless the type either ERRF_ERRTYPE_NAND_DAMAGED\n or ERRF_ERRTYPE_CARD_REMOVED.\n\n No error will be shown if the system is asleep.\n\n On retail units with vanilla firmware, no detailed information will be displayed on screen.\n\n You may wish to use ERRF_ThrowResult() or ERRF_ThrowResultWithMessage() instead of\n constructing the ERRF_FatalErrInfo struct yourself."] + #[doc = "Throws a system error and possibly logs it.\n # Arguments\n\n* `error` (direction in) - Error to throw.\n\n ErrDisp may convert the error info to ERRF_ERRTYPE_NAND_DAMAGED or ERRF_ERRTYPE_CARD_REMOVED\n depending on the error code.\n\n Except with ERRF_ERRTYPE_LOG_ONLY, the system will panic and will need to be rebooted.\n Fatal error information will also be logged into a file, unless the type either ERRF_ERRTYPE_NAND_DAMAGED\n or ERRF_ERRTYPE_CARD_REMOVED.\n\n No error will be shown if the system is asleep.\n\n On retail units with vanilla firmware, no detailed information will be displayed on screen.\n\n You may wish to use ERRF_ThrowResult() or ERRF_ThrowResultWithMessage() instead of\n constructing the ERRF_FatalErrInfo struct yourself."] pub fn ERRF_Throw(error: *const ERRF_FatalErrInfo) -> Result; } extern "C" { #[must_use] - #[doc = " Throws (and logs) a system error with the given Result code.\n # Arguments\n\n* `failure` (direction in) - Result code to throw.\n\n This calls ERRF_Throw with error type ERRF_ERRTYPE_GENERIC and fills in the required data.\n\n This function _does_ fill in the address where this function was called from."] + #[doc = "Throws (and logs) a system error with the given Result code.\n # Arguments\n\n* `failure` (direction in) - Result code to throw.\n\n This calls ERRF_Throw with error type ERRF_ERRTYPE_GENERIC and fills in the required data.\n\n This function _does_ fill in the address where this function was called from."] pub fn ERRF_ThrowResult(failure: Result) -> Result; } extern "C" { #[must_use] - #[doc = " Logs a system error with the given Result code.\n # Arguments\n\n* `failure` (direction in) - Result code to log.\n\n Similar to ERRF_Throw, except that it does not display anything on the screen,\n nor does it force the system to reboot.\n\n This function _does_ fill in the address where this function was called from."] + #[doc = "Logs a system error with the given Result code.\n # Arguments\n\n* `failure` (direction in) - Result code to log.\n\n Similar to ERRF_Throw, except that it does not display anything on the screen,\n nor does it force the system to reboot.\n\n This function _does_ fill in the address where this function was called from."] pub fn ERRF_LogResult(failure: Result) -> Result; } extern "C" { #[must_use] - #[doc = " Throws a system error with the given Result code and message.\n # Arguments\n\n* `failure` (direction in) - Result code to throw.\n * `message` (direction in) - The message to display.\n\n This calls ERRF_Throw with error type ERRF_ERRTYPE_FAILURE and fills in the required data.\n\n This function does _not_ fill in the address where this function was called from because it\n would not be displayed."] + #[doc = "Throws a system error with the given Result code and message.\n # Arguments\n\n* `failure` (direction in) - Result code to throw.\n * `message` (direction in) - The message to display.\n\n This calls ERRF_Throw with error type ERRF_ERRTYPE_FAILURE and fills in the required data.\n\n This function does _not_ fill in the address where this function was called from because it\n would not be displayed."] pub fn ERRF_ThrowResultWithMessage(failure: Result, message: *const ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = " Specify an additional user string to use for error reporting.\n # Arguments\n\n* `user_string` (direction in) - User string (up to 256 bytes, not including NUL byte)"] + #[doc = "Specify an additional user string to use for error reporting.\n # Arguments\n\n* `user_string` (direction in) - User string (up to 256 bytes, not including NUL byte)"] pub fn ERRF_SetUserString(user_string: *const ::libc::c_char) -> Result; } extern "C" { - #[doc = " Handles an exception using ErrDisp.\n # Arguments\n\n* `excep` - Exception information\n * `regs` - CPU registers\n\n You might want to clear ENVINFO's bit0 to be able to see any debugging information.\n [`threadOnException`]"] + #[doc = "Handles an exception using ErrDisp.\n # Arguments\n\n* `excep` - Exception information\n * `regs` - CPU registers\n\n You might want to clear ENVINFO's bit0 to be able to see any debugging information.\n [`threadOnException`]"] pub fn ERRF_ExceptionHandler(excep: *mut ERRF_ExceptionInfo, regs: *mut CpuRegisters) -> !; } -#[doc = " Kernel configuration page (read-only)."] +#[doc = "Kernel configuration page (read-only)."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct osKernelConfig_s { @@ -3876,7 +3876,7 @@ pub struct osKernelConfig_s { pub firm_syscore_ver: u32_, pub firm_ctrsdk_ver: u32_, } -#[doc = " Time reference information struct (filled in by PTM)."] +#[doc = "Time reference information struct (filled in by PTM)."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct osTimeRef_s { @@ -3889,7 +3889,7 @@ pub struct osTimeRef_s { #[doc = "< Measured time drift of the system clock (according to the RTC) in milliseconds since the last update"] pub drift_ms: s64, } -#[doc = " Shared system configuration page structure (read-only or read-write depending on exheader)."] +#[doc = "Shared system configuration page structure (read-only or read-write depending on exheader)."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct osSharedConfig_s { @@ -3913,7 +3913,7 @@ pub struct osSharedConfig_s { pub unk_0xB0: [u8_; 16usize], pub headset_connected: vu8, } -#[doc = " Tick counter."] +#[doc = "Tick counter."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct TickCounter { @@ -3922,7 +3922,7 @@ pub struct TickCounter { #[doc = "< Point in time used as reference."] pub reference: u64_, } -#[doc = " OS_VersionBin. Format of the system version: \"..-\""] +#[doc = "OS_VersionBin. Format of the system version: \"..-\""] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct OS_VersionBin { @@ -3934,36 +3934,36 @@ pub struct OS_VersionBin { pub reserved_x5: [u8_; 3usize], } extern "C" { - #[doc = " Converts an address from virtual (process) memory to physical memory.\n # Arguments\n\n* `vaddr` - Input virtual address.\n # Returns\n\nThe corresponding physical address.\n It is sometimes required by services or when using the GPU command buffer."] + #[doc = "Converts an address from virtual (process) memory to physical memory.\n # Arguments\n\n* `vaddr` - Input virtual address.\n # Returns\n\nThe corresponding physical address.\n It is sometimes required by services or when using the GPU command buffer."] pub fn osConvertVirtToPhys(vaddr: *const ::libc::c_void) -> u32_; } extern "C" { - #[doc = " Converts 0x14* vmem to 0x30*.\n # Arguments\n\n* `vaddr` - Input virtual address.\n # Returns\n\nThe corresponding address in the 0x30* range, the input address if it's already within the new vmem, or 0 if it's outside of both ranges."] + #[doc = "Converts 0x14* vmem to 0x30*.\n # Arguments\n\n* `vaddr` - Input virtual address.\n # Returns\n\nThe corresponding address in the 0x30* range, the input address if it's already within the new vmem, or 0 if it's outside of both ranges."] pub fn osConvertOldLINEARMemToNew(vaddr: *const ::libc::c_void) -> *mut ::libc::c_void; } extern "C" { - #[doc = " Retrieves basic information about a service error.\n # Arguments\n\n* `error` - Error to retrieve information about.\n # Returns\n\nA string containing a summary of an error.\n\n This can be used to get some details about an error returned by a service call."] + #[doc = "Retrieves basic information about a service error.\n # Arguments\n\n* `error` - Error to retrieve information about.\n # Returns\n\nA string containing a summary of an error.\n\n This can be used to get some details about an error returned by a service call."] pub fn osStrError(error: Result) -> *const ::libc::c_char; } extern "C" { - #[doc = " Reads the latest reference timepoint published by PTM.\n # Returns\n\nStructure (see osTimeRef_s)."] + #[doc = "Reads the latest reference timepoint published by PTM.\n # Returns\n\nStructure (see osTimeRef_s)."] pub fn osGetTimeRef() -> osTimeRef_s; } extern "C" { - #[doc = " Gets the current time.\n # Returns\n\nThe number of milliseconds since 1st Jan 1900 00:00."] + #[doc = "Gets the current time.\n # Returns\n\nThe number of milliseconds since 1st Jan 1900 00:00."] pub fn osGetTime() -> u64_; } extern "C" { - #[doc = " Reads the elapsed time in a tick counter.\n # Arguments\n\n* `cnt` - The tick counter.\n # Returns\n\nThe number of milliseconds elapsed."] + #[doc = "Reads the elapsed time in a tick counter.\n # Arguments\n\n* `cnt` - The tick counter.\n # Returns\n\nThe number of milliseconds elapsed."] pub fn osTickCounterRead(cnt: *const TickCounter) -> f64; } extern "C" { - #[doc = " Configures the New 3DS speedup.\n # Arguments\n\n* `enable` - Specifies whether to enable or disable the speedup."] + #[doc = "Configures the New 3DS speedup.\n # Arguments\n\n* `enable` - Specifies whether to enable or disable the speedup."] pub fn osSetSpeedupEnable(enable: bool); } extern "C" { #[must_use] - #[doc = " Gets the NAND system-version stored in NVer/CVer.\n # Arguments\n\n* `nver_versionbin` - Output OS_VersionBin structure for the data read from NVer.\n * `cver_versionbin` - Output OS_VersionBin structure for the data read from CVer.\n # Returns\n\nThe result-code. This value can be positive if opening \"romfs:/version.bin\" fails with stdio, since errno would be returned in that case. In some cases the error can be special negative values as well."] + #[doc = "Gets the NAND system-version stored in NVer/CVer.\n # Arguments\n\n* `nver_versionbin` - Output OS_VersionBin structure for the data read from NVer.\n * `cver_versionbin` - Output OS_VersionBin structure for the data read from CVer.\n # Returns\n\nThe result-code. This value can be positive if opening \"romfs:/version.bin\" fails with stdio, since errno would be returned in that case. In some cases the error can be special negative values as well."] pub fn osGetSystemVersionData( nver_versionbin: *mut OS_VersionBin, cver_versionbin: *mut OS_VersionBin, @@ -3971,7 +3971,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " This is a wrapper for osGetSystemVersionData.\n # Arguments\n\n* `nver_versionbin` - Optional output OS_VersionBin structure for the data read from NVer, can be NULL.\n * `cver_versionbin` - Optional output OS_VersionBin structure for the data read from CVer, can be NULL.\n * `sysverstr` - Output string where the printed system-version will be written, in the same format displayed by the System Settings title.\n * `sysverstr_maxsize` - Max size of the above string buffer, *including* NULL-terminator.\n # Returns\n\nSee osGetSystemVersionData."] + #[doc = "This is a wrapper for osGetSystemVersionData.\n # Arguments\n\n* `nver_versionbin` - Optional output OS_VersionBin structure for the data read from NVer, can be NULL.\n * `cver_versionbin` - Optional output OS_VersionBin structure for the data read from CVer, can be NULL.\n * `sysverstr` - Output string where the printed system-version will be written, in the same format displayed by the System Settings title.\n * `sysverstr_maxsize` - Max size of the above string buffer, *including* NULL-terminator.\n # Returns\n\nSee osGetSystemVersionData."] pub fn osGetSystemVersionDataString( nver_versionbin: *mut OS_VersionBin, cver_versionbin: *mut OS_VersionBin, @@ -4027,13 +4027,13 @@ extern "C" { timeout_ns: u64, ) -> ::libc::c_int; } -#[doc = " A light lock."] +#[doc = "A light lock."] pub type LightLock = _LOCK_T; -#[doc = " A recursive lock."] +#[doc = "A recursive lock."] pub type RecursiveLock = _LOCK_RECURSIVE_T; -#[doc = " A condition variable."] +#[doc = "A condition variable."] pub type CondVar = s32; -#[doc = " A light event."] +#[doc = "A light event."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct LightEvent { @@ -4042,7 +4042,7 @@ pub struct LightEvent { #[doc = "< Lock used for sticky timer operation"] pub lock: LightLock, } -#[doc = " A light semaphore."] +#[doc = "A light semaphore."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct LightSemaphore { @@ -4055,12 +4055,12 @@ pub struct LightSemaphore { } extern "C" { #[must_use] - #[doc = " Function used to implement user-mode synchronization primitives.\n # Arguments\n\n* `addr` - Pointer to a signed 32-bit value whose address will be used to identify waiting threads.\n * `type` - Type of action to be performed by the arbiter\n * `value` - Number of threads to signal if using ARBITRATION_SIGNAL, or the value used for comparison.\n\n This will perform an arbitration based on #type. The comparisons are done between #value and the value at the address #addr.\n\n s32 val=0;\n // Does *nothing* since val >= 0\n syncArbitrateAddress(&val,ARBITRATION_WAIT_IF_LESS_THAN,0);\n > **Note:** Usage of this function entails an implicit Data Memory Barrier (dmb)."] + #[doc = "Function used to implement user-mode synchronization primitives.\n # Arguments\n\n* `addr` - Pointer to a signed 32-bit value whose address will be used to identify waiting threads.\n * `type` - Type of action to be performed by the arbiter\n * `value` - Number of threads to signal if using ARBITRATION_SIGNAL, or the value used for comparison.\n\n This will perform an arbitration based on #type. The comparisons are done between #value and the value at the address #addr.\n\n s32 val=0;\n // Does *nothing* since val >= 0\n syncArbitrateAddress(&val,ARBITRATION_WAIT_IF_LESS_THAN,0);\n > **Note:** Usage of this function entails an implicit Data Memory Barrier (dmb)."] pub fn syncArbitrateAddress(addr: *mut s32, type_: ArbitrationType, value: s32) -> Result; } extern "C" { #[must_use] - #[doc = " Function used to implement user-mode synchronization primitives (with timeout).\n # Arguments\n\n* `addr` - Pointer to a signed 32-bit value whose address will be used to identify waiting threads.\n * `type` - Type of action to be performed by the arbiter (must use ARBITRATION_WAIT_IF_LESS_THAN_TIMEOUT or ARBITRATION_DECREMENT_AND_WAIT_IF_LESS_THAN_TIMEOUT)\n * `value` - Number of threads to signal if using ARBITRATION_SIGNAL, or the value used for comparison.\n\n This will perform an arbitration based on #type. The comparisons are done between #value and the value at the address #addr.\n\n s32 val=0;\n // Thread will wait for a signal or wake up after 10000000 nanoseconds because val < 1.\n syncArbitrateAddressWithTimeout(&val,ARBITRATION_WAIT_IF_LESS_THAN_TIMEOUT,1,10000000LL);\n > **Note:** Usage of this function entails an implicit Data Memory Barrier (dmb)."] + #[doc = "Function used to implement user-mode synchronization primitives (with timeout).\n # Arguments\n\n* `addr` - Pointer to a signed 32-bit value whose address will be used to identify waiting threads.\n * `type` - Type of action to be performed by the arbiter (must use ARBITRATION_WAIT_IF_LESS_THAN_TIMEOUT or ARBITRATION_DECREMENT_AND_WAIT_IF_LESS_THAN_TIMEOUT)\n * `value` - Number of threads to signal if using ARBITRATION_SIGNAL, or the value used for comparison.\n\n This will perform an arbitration based on #type. The comparisons are done between #value and the value at the address #addr.\n\n s32 val=0;\n // Thread will wait for a signal or wake up after 10000000 nanoseconds because val < 1.\n syncArbitrateAddressWithTimeout(&val,ARBITRATION_WAIT_IF_LESS_THAN_TIMEOUT,1,10000000LL);\n > **Note:** Usage of this function entails an implicit Data Memory Barrier (dmb)."] pub fn syncArbitrateAddressWithTimeout( addr: *mut s32, type_: ArbitrationType, @@ -4069,47 +4069,47 @@ extern "C" { ) -> Result; } extern "C" { - #[doc = " Initializes a light lock.\n # Arguments\n\n* `lock` - Pointer to the lock."] + #[doc = "Initializes a light lock.\n # Arguments\n\n* `lock` - Pointer to the lock."] pub fn LightLock_Init(lock: *mut LightLock); } extern "C" { - #[doc = " Locks a light lock.\n # Arguments\n\n* `lock` - Pointer to the lock."] + #[doc = "Locks a light lock.\n # Arguments\n\n* `lock` - Pointer to the lock."] pub fn LightLock_Lock(lock: *mut LightLock); } extern "C" { - #[doc = " Attempts to lock a light lock.\n # Arguments\n\n* `lock` - Pointer to the lock.\n # Returns\n\nZero on success, non-zero on failure."] + #[doc = "Attempts to lock a light lock.\n # Arguments\n\n* `lock` - Pointer to the lock.\n # Returns\n\nZero on success, non-zero on failure."] pub fn LightLock_TryLock(lock: *mut LightLock) -> ::libc::c_int; } extern "C" { - #[doc = " Unlocks a light lock.\n # Arguments\n\n* `lock` - Pointer to the lock."] + #[doc = "Unlocks a light lock.\n # Arguments\n\n* `lock` - Pointer to the lock."] pub fn LightLock_Unlock(lock: *mut LightLock); } extern "C" { - #[doc = " Initializes a recursive lock.\n # Arguments\n\n* `lock` - Pointer to the lock."] + #[doc = "Initializes a recursive lock.\n # Arguments\n\n* `lock` - Pointer to the lock."] pub fn RecursiveLock_Init(lock: *mut RecursiveLock); } extern "C" { - #[doc = " Locks a recursive lock.\n # Arguments\n\n* `lock` - Pointer to the lock."] + #[doc = "Locks a recursive lock.\n # Arguments\n\n* `lock` - Pointer to the lock."] pub fn RecursiveLock_Lock(lock: *mut RecursiveLock); } extern "C" { - #[doc = " Attempts to lock a recursive lock.\n # Arguments\n\n* `lock` - Pointer to the lock.\n # Returns\n\nZero on success, non-zero on failure."] + #[doc = "Attempts to lock a recursive lock.\n # Arguments\n\n* `lock` - Pointer to the lock.\n # Returns\n\nZero on success, non-zero on failure."] pub fn RecursiveLock_TryLock(lock: *mut RecursiveLock) -> ::libc::c_int; } extern "C" { - #[doc = " Unlocks a recursive lock.\n # Arguments\n\n* `lock` - Pointer to the lock."] + #[doc = "Unlocks a recursive lock.\n # Arguments\n\n* `lock` - Pointer to the lock."] pub fn RecursiveLock_Unlock(lock: *mut RecursiveLock); } extern "C" { - #[doc = " Initializes a condition variable.\n # Arguments\n\n* `cv` - Pointer to the condition variable."] + #[doc = "Initializes a condition variable.\n # Arguments\n\n* `cv` - Pointer to the condition variable."] pub fn CondVar_Init(cv: *mut CondVar); } extern "C" { - #[doc = " Waits on a condition variable.\n # Arguments\n\n* `cv` - Pointer to the condition variable.\n * `lock` - Pointer to the lock to atomically unlock/relock during the wait."] + #[doc = "Waits on a condition variable.\n # Arguments\n\n* `cv` - Pointer to the condition variable.\n * `lock` - Pointer to the lock to atomically unlock/relock during the wait."] pub fn CondVar_Wait(cv: *mut CondVar, lock: *mut LightLock); } extern "C" { - #[doc = " Waits on a condition variable with a timeout.\n # Arguments\n\n* `cv` - Pointer to the condition variable.\n * `lock` - Pointer to the lock to atomically unlock/relock during the wait.\n * `timeout_ns` - Timeout in nanoseconds.\n # Returns\n\nZero on success, non-zero on failure."] + #[doc = "Waits on a condition variable with a timeout.\n # Arguments\n\n* `cv` - Pointer to the condition variable.\n * `lock` - Pointer to the lock to atomically unlock/relock during the wait.\n * `timeout_ns` - Timeout in nanoseconds.\n # Returns\n\nZero on success, non-zero on failure."] pub fn CondVar_WaitTimeout( cv: *mut CondVar, lock: *mut LightLock, @@ -4117,51 +4117,51 @@ extern "C" { ) -> ::libc::c_int; } extern "C" { - #[doc = " Wakes up threads waiting on a condition variable.\n # Arguments\n\n* `cv` - Pointer to the condition variable.\n * `num_threads` - Maximum number of threads to wake up (or ARBITRATION_SIGNAL_ALL to wake them all)."] + #[doc = "Wakes up threads waiting on a condition variable.\n # Arguments\n\n* `cv` - Pointer to the condition variable.\n * `num_threads` - Maximum number of threads to wake up (or ARBITRATION_SIGNAL_ALL to wake them all)."] pub fn CondVar_WakeUp(cv: *mut CondVar, num_threads: s32); } extern "C" { - #[doc = " Initializes a light event.\n # Arguments\n\n* `event` - Pointer to the event.\n * `reset_type` - Type of reset the event uses (RESET_ONESHOT/RESET_STICKY)."] + #[doc = "Initializes a light event.\n # Arguments\n\n* `event` - Pointer to the event.\n * `reset_type` - Type of reset the event uses (RESET_ONESHOT/RESET_STICKY)."] pub fn LightEvent_Init(event: *mut LightEvent, reset_type: ResetType); } extern "C" { - #[doc = " Clears a light event.\n # Arguments\n\n* `event` - Pointer to the event."] + #[doc = "Clears a light event.\n # Arguments\n\n* `event` - Pointer to the event."] pub fn LightEvent_Clear(event: *mut LightEvent); } extern "C" { - #[doc = " Wakes up threads waiting on a sticky light event without signaling it. If the event had been signaled before, it is cleared instead.\n # Arguments\n\n* `event` - Pointer to the event."] + #[doc = "Wakes up threads waiting on a sticky light event without signaling it. If the event had been signaled before, it is cleared instead.\n # Arguments\n\n* `event` - Pointer to the event."] pub fn LightEvent_Pulse(event: *mut LightEvent); } extern "C" { - #[doc = " Signals a light event, waking up threads waiting on it.\n # Arguments\n\n* `event` - Pointer to the event."] + #[doc = "Signals a light event, waking up threads waiting on it.\n # Arguments\n\n* `event` - Pointer to the event."] pub fn LightEvent_Signal(event: *mut LightEvent); } extern "C" { - #[doc = " Attempts to wait on a light event.\n # Arguments\n\n* `event` - Pointer to the event.\n # Returns\n\nNon-zero if the event was signaled, zero otherwise."] + #[doc = "Attempts to wait on a light event.\n # Arguments\n\n* `event` - Pointer to the event.\n # Returns\n\nNon-zero if the event was signaled, zero otherwise."] pub fn LightEvent_TryWait(event: *mut LightEvent) -> ::libc::c_int; } extern "C" { - #[doc = " Waits on a light event.\n # Arguments\n\n* `event` - Pointer to the event."] + #[doc = "Waits on a light event.\n # Arguments\n\n* `event` - Pointer to the event."] pub fn LightEvent_Wait(event: *mut LightEvent); } extern "C" { - #[doc = " Waits on a light event until either the event is signaled or the timeout is reached.\n # Arguments\n\n* `event` - Pointer to the event.\n * `timeout_ns` - Timeout in nanoseconds.\n # Returns\n\nNon-zero on timeout, zero otherwise."] + #[doc = "Waits on a light event until either the event is signaled or the timeout is reached.\n # Arguments\n\n* `event` - Pointer to the event.\n * `timeout_ns` - Timeout in nanoseconds.\n # Returns\n\nNon-zero on timeout, zero otherwise."] pub fn LightEvent_WaitTimeout(event: *mut LightEvent, timeout_ns: s64) -> ::libc::c_int; } extern "C" { - #[doc = " Initializes a light semaphore.\n # Arguments\n\n* `event` - Pointer to the semaphore.\n * `max_count` - Initial count of the semaphore.\n * `max_count` - Maximum count of the semaphore."] + #[doc = "Initializes a light semaphore.\n # Arguments\n\n* `event` - Pointer to the semaphore.\n * `max_count` - Initial count of the semaphore.\n * `max_count` - Maximum count of the semaphore."] pub fn LightSemaphore_Init(semaphore: *mut LightSemaphore, initial_count: s16, max_count: s16); } extern "C" { - #[doc = " Acquires a light semaphore.\n # Arguments\n\n* `semaphore` - Pointer to the semaphore.\n * `count` - Acquire count"] + #[doc = "Acquires a light semaphore.\n # Arguments\n\n* `semaphore` - Pointer to the semaphore.\n * `count` - Acquire count"] pub fn LightSemaphore_Acquire(semaphore: *mut LightSemaphore, count: s32); } extern "C" { - #[doc = " Attempts to acquire a light semaphore.\n # Arguments\n\n* `semaphore` - Pointer to the semaphore.\n * `count` - Acquire count\n # Returns\n\nZero on success, non-zero on failure"] + #[doc = "Attempts to acquire a light semaphore.\n # Arguments\n\n* `semaphore` - Pointer to the semaphore.\n * `count` - Acquire count\n # Returns\n\nZero on success, non-zero on failure"] pub fn LightSemaphore_TryAcquire(semaphore: *mut LightSemaphore, count: s32) -> ::libc::c_int; } extern "C" { - #[doc = " Releases a light semaphore.\n # Arguments\n\n* `semaphore` - Pointer to the semaphore.\n * `count` - Release count"] + #[doc = "Releases a light semaphore.\n # Arguments\n\n* `semaphore` - Pointer to the semaphore.\n * `count` - Release count"] pub fn LightSemaphore_Release(semaphore: *mut LightSemaphore, count: s32); } #[repr(C)] @@ -4169,14 +4169,14 @@ extern "C" { pub struct Thread_tag { _unused: [u8; 0], } -#[doc = " libctru thread handle type"] +#[doc = "libctru thread handle type"] pub type Thread = *mut Thread_tag; -#[doc = " Exception handler type, necessarily an ARM function that does not return."] +#[doc = "Exception handler type, necessarily an ARM function that does not return."] pub type ExceptionHandler = ::core::option::Option< unsafe extern "C" fn(excep: *mut ERRF_ExceptionInfo, regs: *mut CpuRegisters), >; extern "C" { - #[doc = " Creates a new libctru thread.\n # Arguments\n\n* `entrypoint` - The function that will be called first upon thread creation\n * `arg` - The argument passed to `entrypoint`\n * `stack_size` - The size of the stack that will be allocated for the thread (will be rounded to a multiple of 8 bytes)\n * `prio` - Low values gives the thread higher priority.\n For userland apps, this has to be within the range [0x18;0x3F].\n The main thread usually has a priority of 0x30, but not always. Use svcGetThreadPriority() if you need\n to create a thread with a priority that is explicitly greater or smaller than that of the main thread.\n * `core_id` - The ID of the processor the thread should be ran on. Processor IDs are labeled starting from 0.\n On Old3DS it must be <2, and on New3DS it must be <4.\n Pass -1 to execute the thread on all CPUs and -2 to execute the thread on the default CPU (read from the Exheader).\n * `detached` - When set to true, the thread is automatically freed when it finishes.\n # Returns\n\nThe libctru thread handle on success, NULL on failure.\n\n - Processor #0 is the application core. It is always possible to create a thread on this core.\n - Processor #1 is the system core. If APT_SetAppCpuTimeLimit is used, it is possible to create a single thread on this core.\n - Processor #2 is New3DS exclusive. Normal applications can create threads on this core if the exheader kernel flags bitmask has 0x2000 set.\n - Processor #3 is New3DS exclusive. Normal applications cannot create threads on this core.\n - Processes in the BASE memory region can always create threads on processors #2 and #3.\n\n > **Note:** Default exit code of a thread is 0.\n svcExitThread should never be called from the thread, use threadExit instead."] + #[doc = "Creates a new libctru thread.\n # Arguments\n\n* `entrypoint` - The function that will be called first upon thread creation\n * `arg` - The argument passed to `entrypoint`\n * `stack_size` - The size of the stack that will be allocated for the thread (will be rounded to a multiple of 8 bytes)\n * `prio` - Low values gives the thread higher priority.\n For userland apps, this has to be within the range [0x18;0x3F].\n The main thread usually has a priority of 0x30, but not always. Use svcGetThreadPriority() if you need\n to create a thread with a priority that is explicitly greater or smaller than that of the main thread.\n * `core_id` - The ID of the processor the thread should be ran on. Processor IDs are labeled starting from 0.\n On Old3DS it must be <2, and on New3DS it must be <4.\n Pass -1 to execute the thread on all CPUs and -2 to execute the thread on the default CPU (read from the Exheader).\n * `detached` - When set to true, the thread is automatically freed when it finishes.\n # Returns\n\nThe libctru thread handle on success, NULL on failure.\n\n - Processor #0 is the application core. It is always possible to create a thread on this core.\n - Processor #1 is the system core. If APT_SetAppCpuTimeLimit is used, it is possible to create a single thread on this core.\n - Processor #2 is New3DS exclusive. Normal applications can create threads on this core if the exheader kernel flags bitmask has 0x2000 set.\n - Processor #3 is New3DS exclusive. Normal applications cannot create threads on this core.\n - Processes in the BASE memory region can always create threads on processors #2 and #3.\n\n > **Note:** Default exit code of a thread is 0.\n svcExitThread should never be called from the thread, use threadExit instead."] pub fn threadCreate( entrypoint: ThreadFunc, arg: *mut ::libc::c_void, @@ -4187,35 +4187,35 @@ extern "C" { ) -> Thread; } extern "C" { - #[doc = " Retrieves the OS thread handle of a libctru thread.\n # Arguments\n\n* `thread` - libctru thread handle\n # Returns\n\nOS thread handle"] + #[doc = "Retrieves the OS thread handle of a libctru thread.\n # Arguments\n\n* `thread` - libctru thread handle\n # Returns\n\nOS thread handle"] pub fn threadGetHandle(thread: Thread) -> Handle; } extern "C" { - #[doc = " Retrieves the exit code of a finished libctru thread.\n # Arguments\n\n* `thread` - libctru thread handle\n # Returns\n\nExit code"] + #[doc = "Retrieves the exit code of a finished libctru thread.\n # Arguments\n\n* `thread` - libctru thread handle\n # Returns\n\nExit code"] pub fn threadGetExitCode(thread: Thread) -> ::libc::c_int; } extern "C" { - #[doc = " Frees a finished libctru thread.\n # Arguments\n\n* `thread` - libctru thread handle\n > This function should not be called if the thread is detached, as it is freed automatically when it finishes."] + #[doc = "Frees a finished libctru thread.\n # Arguments\n\n* `thread` - libctru thread handle\n > This function should not be called if the thread is detached, as it is freed automatically when it finishes."] pub fn threadFree(thread: Thread); } extern "C" { #[must_use] - #[doc = " Waits for a libctru thread to finish (or returns immediately if it is already finished).\n # Arguments\n\n* `thread` - libctru thread handle\n * `timeout_ns` - Timeout in nanoseconds. Pass U64_MAX if a timeout isn't desired"] + #[doc = "Waits for a libctru thread to finish (or returns immediately if it is already finished).\n # Arguments\n\n* `thread` - libctru thread handle\n * `timeout_ns` - Timeout in nanoseconds. Pass U64_MAX if a timeout isn't desired"] pub fn threadJoin(thread: Thread, timeout_ns: u64_) -> Result; } extern "C" { - #[doc = " Changes a thread's status from attached to detached.\n # Arguments\n\n* `thread` - libctru thread handle"] + #[doc = "Changes a thread's status from attached to detached.\n # Arguments\n\n* `thread` - libctru thread handle"] pub fn threadDetach(thread: Thread); } extern "C" { - #[doc = " Retrieves the libctru thread handle of the current thread.\n # Returns\n\nlibctru thread handle of the current thread, or NULL for the main thread"] + #[doc = "Retrieves the libctru thread handle of the current thread.\n # Returns\n\nlibctru thread handle of the current thread, or NULL for the main thread"] pub fn threadGetCurrent() -> Thread; } extern "C" { - #[doc = " Exits the current libctru thread with an exit code (not usable from the main thread).\n # Arguments\n\n* `rc` - Exit code"] + #[doc = "Exits the current libctru thread with an exit code (not usable from the main thread).\n # Arguments\n\n* `rc` - Exit code"] pub fn threadExit(rc: ::libc::c_int) -> !; } -#[doc = " Framebuffer information."] +#[doc = "Framebuffer information."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct GSPGPU_FramebufferInfo { @@ -4253,9 +4253,9 @@ pub const GSP_RGB565_OES: GSPGPU_FramebufferFormat = 2; pub const GSP_RGB5_A1_OES: GSPGPU_FramebufferFormat = 3; #[doc = "< RGBA4. (2 bytes)"] pub const GSP_RGBA4_OES: GSPGPU_FramebufferFormat = 4; -#[doc = " Framebuffer format."] +#[doc = "Framebuffer format."] pub type GSPGPU_FramebufferFormat = ::libc::c_uint; -#[doc = " Capture info entry."] +#[doc = "Capture info entry."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct GSPGPU_CaptureInfoEntry { @@ -4277,7 +4277,7 @@ impl Default for GSPGPU_CaptureInfoEntry { } } } -#[doc = " Capture info."] +#[doc = "Capture info."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct GSPGPU_CaptureInfo { @@ -4309,27 +4309,27 @@ pub const GSPGPU_EVENT_P3D: GSPGPU_Event = 5; pub const GSPGPU_EVENT_DMA: GSPGPU_Event = 6; #[doc = "< Used to know how many events there are."] pub const GSPGPU_EVENT_MAX: GSPGPU_Event = 7; -#[doc = " GSPGPU events."] +#[doc = "GSPGPU events."] pub type GSPGPU_Event = ::libc::c_uint; extern "C" { #[must_use] - #[doc = " Initializes GSPGPU."] + #[doc = "Initializes GSPGPU."] pub fn gspInit() -> Result; } extern "C" { - #[doc = " Exits GSPGPU."] + #[doc = "Exits GSPGPU."] pub fn gspExit(); } extern "C" { - #[doc = " Gets a pointer to the current gsp::Gpu session handle.\n # Returns\n\nA pointer to the current gsp::Gpu session handle."] + #[doc = "Gets a pointer to the current gsp::Gpu session handle.\n # Returns\n\nA pointer to the current gsp::Gpu session handle."] pub fn gspGetSessionHandle() -> *mut Handle; } extern "C" { - #[doc = " Returns true if the application currently has GPU rights."] + #[doc = "Returns true if the application currently has GPU rights."] pub fn gspHasGpuRight() -> bool; } extern "C" { - #[doc = " Presents a buffer to the specified screen.\n # Arguments\n\n* `screen` - Screen ID (see GSP_SCREEN_TOP and GSP_SCREEN_BOTTOM)\n * `swap` - Specifies which set of framebuffer registers to configure and activate (0 or 1)\n * `fb_a` - Pointer to the framebuffer (in stereo mode: left eye)\n * `fb_b` - Pointer to the secondary framebuffer (only used in stereo mode for the right eye, otherwise pass the same as fb_a)\n * `stride` - Stride in bytes between scanlines\n * `mode` - Mode configuration to be written to LCD register\n # Returns\n\ntrue if a buffer had already been presented to the screen but not processed yet by GSP, false otherwise.\n > **Note:** The most recently presented buffer is processed and configured during the specified screen's next VBlank event."] + #[doc = "Presents a buffer to the specified screen.\n # Arguments\n\n* `screen` - Screen ID (see GSP_SCREEN_TOP and GSP_SCREEN_BOTTOM)\n * `swap` - Specifies which set of framebuffer registers to configure and activate (0 or 1)\n * `fb_a` - Pointer to the framebuffer (in stereo mode: left eye)\n * `fb_b` - Pointer to the secondary framebuffer (only used in stereo mode for the right eye, otherwise pass the same as fb_a)\n * `stride` - Stride in bytes between scanlines\n * `mode` - Mode configuration to be written to LCD register\n # Returns\n\ntrue if a buffer had already been presented to the screen but not processed yet by GSP, false otherwise.\n > **Note:** The most recently presented buffer is processed and configured during the specified screen's next VBlank event."] pub fn gspPresentBuffer( screen: ::libc::c_uint, swap: ::libc::c_uint, @@ -4340,11 +4340,11 @@ extern "C" { ) -> bool; } extern "C" { - #[doc = " Returns true if a prior gspPresentBuffer command is still pending to be processed by GSP.\n # Arguments\n\n* `screen` - Screen ID (see GSP_SCREEN_TOP and GSP_SCREEN_BOTTOM)"] + #[doc = "Returns true if a prior gspPresentBuffer command is still pending to be processed by GSP.\n # Arguments\n\n* `screen` - Screen ID (see GSP_SCREEN_TOP and GSP_SCREEN_BOTTOM)"] pub fn gspIsPresentPending(screen: ::libc::c_uint) -> bool; } extern "C" { - #[doc = " Configures a callback to run when a GSPGPU event occurs.\n # Arguments\n\n* `id` - ID of the event.\n * `cb` - Callback to run.\n * `data` - Data to be passed to the callback.\n * `oneShot` - When true, the callback is only executed once. When false, the callback is executed every time the event occurs."] + #[doc = "Configures a callback to run when a GSPGPU event occurs.\n # Arguments\n\n* `id` - ID of the event.\n * `cb` - Callback to run.\n * `data` - Data to be passed to the callback.\n * `oneShot` - When true, the callback is only executed once. When false, the callback is executed every time the event occurs."] pub fn gspSetEventCallback( id: GSPGPU_Event, cb: ThreadFunc, @@ -4353,56 +4353,56 @@ extern "C" { ); } extern "C" { - #[doc = " Waits for a GSPGPU event to occur.\n # Arguments\n\n* `id` - ID of the event.\n * `nextEvent` - Whether to discard the current event and wait for the next event."] + #[doc = "Waits for a GSPGPU event to occur.\n # Arguments\n\n* `id` - ID of the event.\n * `nextEvent` - Whether to discard the current event and wait for the next event."] pub fn gspWaitForEvent(id: GSPGPU_Event, nextEvent: bool); } extern "C" { - #[doc = " Waits for any GSPGPU event to occur.\n # Returns\n\nThe ID of the event that occurred.\n\n The function returns immediately if there are unprocessed events at the time of call."] + #[doc = "Waits for any GSPGPU event to occur.\n # Returns\n\nThe ID of the event that occurred.\n\n The function returns immediately if there are unprocessed events at the time of call."] pub fn gspWaitForAnyEvent() -> GSPGPU_Event; } extern "C" { #[must_use] - #[doc = " Submits a GX command.\n # Arguments\n\n* `gxCommand` - GX command to execute."] + #[doc = "Submits a GX command.\n # Arguments\n\n* `gxCommand` - GX command to execute."] pub fn gspSubmitGxCommand(gxCommand: *const u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Acquires GPU rights.\n # Arguments\n\n* `flags` - Flags to acquire with."] + #[doc = "Acquires GPU rights.\n # Arguments\n\n* `flags` - Flags to acquire with."] pub fn GSPGPU_AcquireRight(flags: u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Releases GPU rights."] + #[doc = "Releases GPU rights."] pub fn GSPGPU_ReleaseRight() -> Result; } extern "C" { #[must_use] - #[doc = " Retrieves display capture info.\n # Arguments\n\n* `captureinfo` - Pointer to output capture info to."] + #[doc = "Retrieves display capture info.\n # Arguments\n\n* `captureinfo` - Pointer to output capture info to."] pub fn GSPGPU_ImportDisplayCaptureInfo(captureinfo: *mut GSPGPU_CaptureInfo) -> Result; } extern "C" { #[must_use] - #[doc = " Saves the VRAM sys area."] + #[doc = "Saves the VRAM sys area."] pub fn GSPGPU_SaveVramSysArea() -> Result; } extern "C" { #[must_use] - #[doc = " Resets the GPU"] + #[doc = "Resets the GPU"] pub fn GSPGPU_ResetGpuCore() -> Result; } extern "C" { #[must_use] - #[doc = " Restores the VRAM sys area."] + #[doc = "Restores the VRAM sys area."] pub fn GSPGPU_RestoreVramSysArea() -> Result; } extern "C" { #[must_use] - #[doc = " Sets whether to force the LCD to black.\n # Arguments\n\n* `flags` - Whether to force the LCD to black. (0 = no, non-zero = yes)"] + #[doc = "Sets whether to force the LCD to black.\n # Arguments\n\n* `flags` - Whether to force the LCD to black. (0 = no, non-zero = yes)"] pub fn GSPGPU_SetLcdForceBlack(flags: u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Updates a screen's framebuffer state.\n # Arguments\n\n* `screenid` - ID of the screen to update.\n * `framebufinfo` - Framebuffer information to update with."] + #[doc = "Updates a screen's framebuffer state.\n # Arguments\n\n* `screenid` - ID of the screen to update.\n * `framebufinfo` - Framebuffer information to update with."] pub fn GSPGPU_SetBufferSwap( screenid: u32_, framebufinfo: *const GSPGPU_FramebufferInfo, @@ -4410,22 +4410,22 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Flushes memory from the data cache.\n # Arguments\n\n* `adr` - Address to flush.\n * `size` - Size of the memory to flush."] + #[doc = "Flushes memory from the data cache.\n # Arguments\n\n* `adr` - Address to flush.\n * `size` - Size of the memory to flush."] pub fn GSPGPU_FlushDataCache(adr: *const ::libc::c_void, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Invalidates memory in the data cache.\n # Arguments\n\n* `adr` - Address to invalidate.\n * `size` - Size of the memory to invalidate."] + #[doc = "Invalidates memory in the data cache.\n # Arguments\n\n* `adr` - Address to invalidate.\n * `size` - Size of the memory to invalidate."] pub fn GSPGPU_InvalidateDataCache(adr: *const ::libc::c_void, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Writes to GPU hardware registers.\n # Arguments\n\n* `regAddr` - Register address to write to.\n * `data` - Data to write.\n * `size` - Size of the data to write."] + #[doc = "Writes to GPU hardware registers.\n # Arguments\n\n* `regAddr` - Register address to write to.\n * `data` - Data to write.\n * `size` - Size of the data to write."] pub fn GSPGPU_WriteHWRegs(regAddr: u32_, data: *const u32_, size: u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Writes to GPU hardware registers with a mask.\n # Arguments\n\n* `regAddr` - Register address to write to.\n * `data` - Data to write.\n * `datasize` - Size of the data to write.\n * `maskdata` - Data of the mask.\n * `masksize` - Size of the mask."] + #[doc = "Writes to GPU hardware registers with a mask.\n # Arguments\n\n* `regAddr` - Register address to write to.\n * `data` - Data to write.\n * `datasize` - Size of the data to write.\n * `maskdata` - Data of the mask.\n * `masksize` - Size of the mask."] pub fn GSPGPU_WriteHWRegsWithMask( regAddr: u32_, data: *const u32_, @@ -4436,12 +4436,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Reads from GPU hardware registers.\n # Arguments\n\n* `regAddr` - Register address to read from.\n * `data` - Buffer to read data to.\n * `size` - Size of the buffer."] + #[doc = "Reads from GPU hardware registers.\n # Arguments\n\n* `regAddr` - Register address to read from.\n * `data` - Buffer to read data to.\n * `size` - Size of the buffer."] pub fn GSPGPU_ReadHWRegs(regAddr: u32_, data: *mut u32_, size: u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Registers the interrupt relay queue.\n # Arguments\n\n* `eventHandle` - Handle of the GX command event.\n * `flags` - Flags to register with.\n * `outMemHandle` - Pointer to output the shared memory handle to.\n * `threadID` - Pointer to output the GSP thread ID to."] + #[doc = "Registers the interrupt relay queue.\n # Arguments\n\n* `eventHandle` - Handle of the GX command event.\n * `flags` - Flags to register with.\n * `outMemHandle` - Pointer to output the shared memory handle to.\n * `threadID` - Pointer to output the GSP thread ID to."] pub fn GSPGPU_RegisterInterruptRelayQueue( eventHandle: Handle, flags: u32_, @@ -4451,37 +4451,37 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Unregisters the interrupt relay queue."] + #[doc = "Unregisters the interrupt relay queue."] pub fn GSPGPU_UnregisterInterruptRelayQueue() -> Result; } extern "C" { #[must_use] - #[doc = " Triggers a handling of commands written to shared memory."] + #[doc = "Triggers a handling of commands written to shared memory."] pub fn GSPGPU_TriggerCmdReqQueue() -> Result; } extern "C" { #[must_use] - #[doc = " Sets 3D_LEDSTATE to the input state value.\n # Arguments\n\n* `disable` - False = 3D LED enable, true = 3D LED disable."] + #[doc = "Sets 3D_LEDSTATE to the input state value.\n # Arguments\n\n* `disable` - False = 3D LED enable, true = 3D LED disable."] pub fn GSPGPU_SetLedForceOff(disable: bool) -> Result; } #[doc = "< Top screen"] pub const GFX_TOP: gfxScreen_t = 0; #[doc = "< Bottom screen"] pub const GFX_BOTTOM: gfxScreen_t = 1; -#[doc = " Screen IDs."] +#[doc = "Screen IDs."] pub type gfxScreen_t = ::libc::c_uint; #[doc = "< Left eye framebuffer"] pub const GFX_LEFT: gfx3dSide_t = 0; #[doc = "< Right eye framebuffer"] pub const GFX_RIGHT: gfx3dSide_t = 1; -#[doc = " Top screen framebuffer side.\n\n This is only meaningful when stereoscopic 3D is enabled on the top screen.\n In any other case, use GFX_LEFT."] +#[doc = "Top screen framebuffer side.\n\n This is only meaningful when stereoscopic 3D is enabled on the top screen.\n In any other case, use GFX_LEFT."] pub type gfx3dSide_t = ::libc::c_uint; extern "C" { - #[doc = " Initializes the LCD framebuffers with default parameters\n This is equivalent to calling: gfxInit(GSP_BGR8_OES,GSP_BGR8_OES,false); "] + #[doc = "Initializes the LCD framebuffers with default parameters\n This is equivalent to calling: gfxInit(GSP_BGR8_OES,GSP_BGR8_OES,false); "] pub fn gfxInitDefault(); } extern "C" { - #[doc = " Initializes the LCD framebuffers.\n # Arguments\n\n* `topFormat` - The format of the top screen framebuffers.\n * `bottomFormat` - The format of the bottom screen framebuffers.\n * `vramBuffers` - Whether to allocate the framebuffers in VRAM.\n\n This function allocates memory for the framebuffers in the specified memory region.\n Initially, stereoscopic 3D is disabled and double buffering is enabled.\n\n > **Note:** This function internally calls gspInit."] + #[doc = "Initializes the LCD framebuffers.\n # Arguments\n\n* `topFormat` - The format of the top screen framebuffers.\n * `bottomFormat` - The format of the bottom screen framebuffers.\n * `vramBuffers` - Whether to allocate the framebuffers in VRAM.\n\n This function allocates memory for the framebuffers in the specified memory region.\n Initially, stereoscopic 3D is disabled and double buffering is enabled.\n\n > **Note:** This function internally calls gspInit."] pub fn gfxInit( topFormat: GSPGPU_FramebufferFormat, bottomFormat: GSPGPU_FramebufferFormat, @@ -4489,39 +4489,39 @@ extern "C" { ); } extern "C" { - #[doc = " Deinitializes and frees the LCD framebuffers.\n > **Note:** This function internally calls gspExit."] + #[doc = "Deinitializes and frees the LCD framebuffers.\n > **Note:** This function internally calls gspExit."] pub fn gfxExit(); } extern "C" { - #[doc = " Enables or disables the 3D stereoscopic effect on the top screen.\n # Arguments\n\n* `enable` - Pass true to enable, false to disable.\n > **Note:** Stereoscopic 3D is disabled by default."] + #[doc = "Enables or disables the 3D stereoscopic effect on the top screen.\n # Arguments\n\n* `enable` - Pass true to enable, false to disable.\n > **Note:** Stereoscopic 3D is disabled by default."] pub fn gfxSet3D(enable: bool); } extern "C" { - #[doc = " Retrieves the status of the 3D stereoscopic effect on the top screen.\n # Returns\n\ntrue if 3D enabled, false otherwise."] + #[doc = "Retrieves the status of the 3D stereoscopic effect on the top screen.\n # Returns\n\ntrue if 3D enabled, false otherwise."] pub fn gfxIs3D() -> bool; } extern "C" { - #[doc = " Retrieves the status of the 800px (double-height) high resolution display mode of the top screen.\n # Returns\n\ntrue if wide mode enabled, false otherwise."] + #[doc = "Retrieves the status of the 800px (double-height) high resolution display mode of the top screen.\n # Returns\n\ntrue if wide mode enabled, false otherwise."] pub fn gfxIsWide() -> bool; } extern "C" { - #[doc = " Enables or disables the 800px (double-height) high resolution display mode of the top screen.\n # Arguments\n\n* `enable` - Pass true to enable, false to disable.\n > **Note:** Wide mode is disabled by default.\n > **Note:** Wide and stereoscopic 3D modes are mutually exclusive.\n > **Note:** In wide mode pixels are not square, since scanlines are half as tall as they normally are.\n Wide mode does not work on Old 2DS consoles (however it does work on New 2DS XL consoles)."] + #[doc = "Enables or disables the 800px (double-height) high resolution display mode of the top screen.\n # Arguments\n\n* `enable` - Pass true to enable, false to disable.\n > **Note:** Wide mode is disabled by default.\n > **Note:** Wide and stereoscopic 3D modes are mutually exclusive.\n > **Note:** In wide mode pixels are not square, since scanlines are half as tall as they normally are.\n Wide mode does not work on Old 2DS consoles (however it does work on New 2DS XL consoles)."] pub fn gfxSetWide(enable: bool); } extern "C" { - #[doc = " Changes the pixel format of a screen.\n # Arguments\n\n* `screen` - Screen ID (see gfxScreen_t)\n * `format` - Pixel format (see GSPGPU_FramebufferFormat)\n > **Note:** If the currently allocated framebuffers are too small for the specified format,\n they are freed and new ones are reallocated."] + #[doc = "Changes the pixel format of a screen.\n # Arguments\n\n* `screen` - Screen ID (see gfxScreen_t)\n * `format` - Pixel format (see GSPGPU_FramebufferFormat)\n > **Note:** If the currently allocated framebuffers are too small for the specified format,\n they are freed and new ones are reallocated."] pub fn gfxSetScreenFormat(screen: gfxScreen_t, format: GSPGPU_FramebufferFormat); } extern "C" { - #[doc = " Retrieves the current pixel format of a screen.\n # Arguments\n\n* `screen` - Screen ID (see gfxScreen_t)\n # Returns\n\nPixel format (see GSPGPU_FramebufferFormat)"] + #[doc = "Retrieves the current pixel format of a screen.\n # Arguments\n\n* `screen` - Screen ID (see gfxScreen_t)\n # Returns\n\nPixel format (see GSPGPU_FramebufferFormat)"] pub fn gfxGetScreenFormat(screen: gfxScreen_t) -> GSPGPU_FramebufferFormat; } extern "C" { - #[doc = " Enables or disables double buffering on a screen.\n # Arguments\n\n* `screen` - Screen ID (see gfxScreen_t)\n * `enable` - Pass true to enable, false to disable.\n > **Note:** Double buffering is enabled by default."] + #[doc = "Enables or disables double buffering on a screen.\n # Arguments\n\n* `screen` - Screen ID (see gfxScreen_t)\n * `enable` - Pass true to enable, false to disable.\n > **Note:** Double buffering is enabled by default."] pub fn gfxSetDoubleBuffering(screen: gfxScreen_t, enable: bool); } extern "C" { - #[doc = " Retrieves the framebuffer of the specified screen to which graphics should be rendered.\n # Arguments\n\n* `screen` - Screen ID (see gfxScreen_t)\n * `side` - Framebuffer side (see gfx3dSide_t) (pass GFX_LEFT if not using stereoscopic 3D)\n * `width` - Pointer that will hold the width of the framebuffer in pixels.\n * `height` - Pointer that will hold the height of the framebuffer in pixels.\n # Returns\n\nA pointer to the current framebuffer of the chosen screen.\n\n Please remember that the returned pointer will change every frame if double buffering is enabled."] + #[doc = "Retrieves the framebuffer of the specified screen to which graphics should be rendered.\n # Arguments\n\n* `screen` - Screen ID (see gfxScreen_t)\n * `side` - Framebuffer side (see gfx3dSide_t) (pass GFX_LEFT if not using stereoscopic 3D)\n * `width` - Pointer that will hold the width of the framebuffer in pixels.\n * `height` - Pointer that will hold the height of the framebuffer in pixels.\n # Returns\n\nA pointer to the current framebuffer of the chosen screen.\n\n Please remember that the returned pointer will change every frame if double buffering is enabled."] pub fn gfxGetFramebuffer( screen: gfxScreen_t, side: gfx3dSide_t, @@ -4530,30 +4530,30 @@ extern "C" { ) -> *mut u8_; } extern "C" { - #[doc = " Flushes the data cache for the current framebuffers.\n This is **only used during software rendering**. Since this function has significant overhead,\n it is preferred to call this only once per frame, after all software rendering is completed."] + #[doc = "Flushes the data cache for the current framebuffers.\n This is **only used during software rendering**. Since this function has significant overhead,\n it is preferred to call this only once per frame, after all software rendering is completed."] pub fn gfxFlushBuffers(); } extern "C" { - #[doc = " Updates the configuration of the specified screen, swapping the buffers if double buffering is enabled.\n # Arguments\n\n* `scr` - Screen ID (see gfxScreen_t)\n * `hasStereo` - For the top screen in 3D mode: true if the framebuffer contains individual images\n for both eyes, or false if the left image should be duplicated to the right eye.\n > **Note:** Previously rendered content will be displayed on the screen after the next VBlank.\n > **Note:** This function is still useful even if double buffering is disabled, as it must be used to commit configuration changes.\n Only call this once per screen per frame, otherwise graphical glitches will occur\n since this API does not implement triple buffering."] + #[doc = "Updates the configuration of the specified screen, swapping the buffers if double buffering is enabled.\n # Arguments\n\n* `scr` - Screen ID (see gfxScreen_t)\n * `hasStereo` - For the top screen in 3D mode: true if the framebuffer contains individual images\n for both eyes, or false if the left image should be duplicated to the right eye.\n > **Note:** Previously rendered content will be displayed on the screen after the next VBlank.\n > **Note:** This function is still useful even if double buffering is disabled, as it must be used to commit configuration changes.\n Only call this once per screen per frame, otherwise graphical glitches will occur\n since this API does not implement triple buffering."] pub fn gfxScreenSwapBuffers(scr: gfxScreen_t, hasStereo: bool); } extern "C" { - #[doc = " Same as gfxScreenSwapBuffers, but with hasStereo set to true.\n # Arguments\n\n* `scr` - Screen ID (see gfxScreen_t)\n * `immediate` - This parameter no longer has any effect and is thus ignored.\n > **Deprecated** This function has been superseded by gfxScreenSwapBuffers, please use that instead."] + #[doc = "Same as gfxScreenSwapBuffers, but with hasStereo set to true.\n # Arguments\n\n* `scr` - Screen ID (see gfxScreen_t)\n * `immediate` - This parameter no longer has any effect and is thus ignored.\n > **Deprecated** This function has been superseded by gfxScreenSwapBuffers, please use that instead."] pub fn gfxConfigScreen(scr: gfxScreen_t, immediate: bool); } extern "C" { - #[doc = " Updates the configuration of both screens.\n > **Note:** This function is equivalent to: gfxScreenSwapBuffers(GFX_TOP,true); gfxScreenSwapBuffers(GFX_BOTTOM,true); "] + #[doc = "Updates the configuration of both screens.\n > **Note:** This function is equivalent to: gfxScreenSwapBuffers(GFX_TOP,true); gfxScreenSwapBuffers(GFX_BOTTOM,true); "] pub fn gfxSwapBuffers(); } extern "C" { - #[doc = " Same as gfxSwapBuffers (formerly different)."] + #[doc = "Same as gfxSwapBuffers (formerly different)."] pub fn gfxSwapBuffersGpu(); } -#[doc = " A callback for printing a character."] +#[doc = "A callback for printing a character."] pub type ConsolePrint = ::core::option::Option< unsafe extern "C" fn(con: *mut ::libc::c_void, c: ::libc::c_int) -> bool, >; -#[doc = " A font struct for the console."] +#[doc = "A font struct for the console."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ConsoleFont { @@ -4573,7 +4573,7 @@ impl Default for ConsoleFont { } } } -#[doc = " Console structure used to store the state of a console render context.\n\n Default values from consoleGetDefault();\n PrintConsole defaultConsole =\n {\n \t//Font:\n \t{\n \t\t(u8*)default_font_bin, //font gfx\n \t\t0, //first ascii character in the set\n \t\t128, //number of characters in the font set\n\t},\n\t0,0, //cursorX cursorY\n\t0,0, //prevcursorX prevcursorY\n\t40, //console width\n\t30, //console height\n\t0, //window x\n\t0, //window y\n\t32, //window width\n\t24, //window height\n\t3, //tab size\n\t0, //font character offset\n\t0, //print callback\n\tfalse //console initialized\n };\n "] +#[doc = "Console structure used to store the state of a console render context.\n\n Default values from consoleGetDefault();\n PrintConsole defaultConsole =\n {\n \t//Font:\n \t{\n \t\t(u8*)default_font_bin, //font gfx\n \t\t0, //first ascii character in the set\n \t\t128, //number of characters in the font set\n\t},\n\t0,0, //cursorX cursorY\n\t0,0, //prevcursorX prevcursorY\n\t40, //console width\n\t30, //console height\n\t0, //window x\n\t0, //window y\n\t32, //window width\n\t24, //window height\n\t3, //tab size\n\t0, //font character offset\n\t0, //print callback\n\tfalse //console initialized\n };\n "] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct PrintConsole { @@ -4630,14 +4630,14 @@ pub const debugDevice_SVC: debugDevice = 1; #[doc = "< Directs stderr debug statements to 3DS console window"] pub const debugDevice_CONSOLE: debugDevice = 2; pub const debugDevice_3DMOO: debugDevice = 1; -#[doc = " Console debug devices supported by libnds."] +#[doc = "Console debug devices supported by libnds."] pub type debugDevice = ::libc::c_uint; extern "C" { - #[doc = " Loads the font into the console.\n # Arguments\n\n* `console` - Pointer to the console to update, if NULL it will update the current console.\n * `font` - The font to load."] + #[doc = "Loads the font into the console.\n # Arguments\n\n* `console` - Pointer to the console to update, if NULL it will update the current console.\n * `font` - The font to load."] pub fn consoleSetFont(console: *mut PrintConsole, font: *mut ConsoleFont); } extern "C" { - #[doc = " Sets the print window.\n # Arguments\n\n* `console` - Console to set, if NULL it will set the current console window.\n * `x` - X location of the window.\n * `y` - Y location of the window.\n * `width` - Width of the window.\n * `height` - Height of the window."] + #[doc = "Sets the print window.\n # Arguments\n\n* `console` - Console to set, if NULL it will set the current console window.\n * `x` - X location of the window.\n * `y` - Y location of the window.\n * `width` - Width of the window.\n * `height` - Height of the window."] pub fn consoleSetWindow( console: *mut PrintConsole, x: ::libc::c_int, @@ -4647,23 +4647,23 @@ extern "C" { ); } extern "C" { - #[doc = " Gets a pointer to the console with the default values.\n This should only be used when using a single console or without changing the console that is returned, otherwise use consoleInit().\n # Returns\n\nA pointer to the console with the default values."] + #[doc = "Gets a pointer to the console with the default values.\n This should only be used when using a single console or without changing the console that is returned, otherwise use consoleInit().\n # Returns\n\nA pointer to the console with the default values."] pub fn consoleGetDefault() -> *mut PrintConsole; } extern "C" { - #[doc = " Make the specified console the render target.\n # Arguments\n\n* `console` - A pointer to the console struct (must have been initialized with consoleInit(PrintConsole* console)).\n # Returns\n\nA pointer to the previous console."] + #[doc = "Make the specified console the render target.\n # Arguments\n\n* `console` - A pointer to the console struct (must have been initialized with consoleInit(PrintConsole* console)).\n # Returns\n\nA pointer to the previous console."] pub fn consoleSelect(console: *mut PrintConsole) -> *mut PrintConsole; } extern "C" { - #[doc = " Initialise the console.\n # Arguments\n\n* `screen` - The screen to use for the console.\n * `console` - A pointer to the console data to initialize (if it's NULL, the default console will be used).\n # Returns\n\nA pointer to the current console."] + #[doc = "Initialise the console.\n # Arguments\n\n* `screen` - The screen to use for the console.\n * `console` - A pointer to the console data to initialize (if it's NULL, the default console will be used).\n # Returns\n\nA pointer to the current console."] pub fn consoleInit(screen: gfxScreen_t, console: *mut PrintConsole) -> *mut PrintConsole; } extern "C" { - #[doc = " Initializes debug console output on stderr to the specified device.\n # Arguments\n\n* `device` - The debug device (or devices) to output debug print statements to."] + #[doc = "Initializes debug console output on stderr to the specified device.\n # Arguments\n\n* `device` - The debug device (or devices) to output debug print statements to."] pub fn consoleDebugInit(device: debugDevice); } extern "C" { - #[doc = " Clears the screen by using iprintf(\""] + #[doc = "Clears the screen by using iprintf(\""] pub fn consoleClear(); } #[doc = "< Use APT workaround."] @@ -4672,10 +4672,10 @@ pub const RUNFLAG_APTWORKAROUND: _bindgen_ty_9 = 1; pub const RUNFLAG_APTREINIT: _bindgen_ty_9 = 2; #[doc = "< Chainload APT on return."] pub const RUNFLAG_APTCHAINLOAD: _bindgen_ty_9 = 4; -#[doc = " System run-flags."] +#[doc = "System run-flags."] pub type _bindgen_ty_9 = ::libc::c_uint; extern "C" { - #[doc = " Retrieves a handle from the environment handle list.\n # Arguments\n\n* `name` - Name of the handle.\n # Returns\n\nThe retrieved handle."] + #[doc = "Retrieves a handle from the environment handle list.\n # Arguments\n\n* `name` - Name of the handle.\n # Returns\n\nThe retrieved handle."] pub fn envGetHandle(name: *const ::libc::c_char) -> Handle; } pub type _off_t = __int64_t; @@ -5000,9 +5000,9 @@ pub const DECOMPRESS_HUFF8: decompressType = 40; pub const DECOMPRESS_HUFF: decompressType = 40; #[doc = "< Run-length encoding compression"] pub const DECOMPRESS_RLE: decompressType = 48; -#[doc = " Compression types"] +#[doc = "Compression types"] pub type decompressType = ::libc::c_uint; -#[doc = " I/O vector"] +#[doc = "I/O vector"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct decompressIOVec { @@ -5020,7 +5020,7 @@ impl Default for decompressIOVec { } } } -#[doc = " Data callback"] +#[doc = "Data callback"] pub type decompressCallback = ::core::option::Option< unsafe extern "C" fn( userdata: *mut ::libc::c_void, @@ -5029,7 +5029,7 @@ pub type decompressCallback = ::core::option::Option< ) -> isize, >; extern "C" { - #[doc = " Decompression callback for file descriptors\n # Arguments\n\n* `userdata` (direction in) - Address of file descriptor\n * `buffer` (direction in) - Buffer to write into\n * `size` (direction in) - Size to read from file descriptor\n # Returns\n\nNumber of bytes read"] + #[doc = "Decompression callback for file descriptors\n # Arguments\n\n* `userdata` (direction in) - Address of file descriptor\n * `buffer` (direction in) - Buffer to write into\n * `size` (direction in) - Size to read from file descriptor\n # Returns\n\nNumber of bytes read"] pub fn decompressCallback_FD( userdata: *mut ::libc::c_void, buffer: *mut ::libc::c_void, @@ -5037,7 +5037,7 @@ extern "C" { ) -> isize; } extern "C" { - #[doc = " Decompression callback for stdio FILE*\n # Arguments\n\n* `userdata` (direction in) - FILE*\n * `buffer` (direction in) - Buffer to write into\n * `size` (direction in) - Size to read from file descriptor\n # Returns\n\nNumber of bytes read"] + #[doc = "Decompression callback for stdio FILE*\n # Arguments\n\n* `userdata` (direction in) - FILE*\n * `buffer` (direction in) - Buffer to write into\n * `size` (direction in) - Size to read from file descriptor\n # Returns\n\nNumber of bytes read"] pub fn decompressCallback_Stdio( userdata: *mut ::libc::c_void, buffer: *mut ::libc::c_void, @@ -5045,7 +5045,7 @@ extern "C" { ) -> isize; } extern "C" { - #[doc = " Decode decompression header\n # Arguments\n\n* `type` (direction out) - Decompression type\n * `size` (direction out) - Decompressed size\n callback Data callback (see decompressV())\n userdata User data passed to callback (see decompressV())\n insize Size of userdata (see decompressV())\n # Returns\n\nBytes consumed\n * `-1` - error"] + #[doc = "Decode decompression header\n # Arguments\n\n* `type` (direction out) - Decompression type\n * `size` (direction out) - Decompressed size\n * `callback` (direction in) - Data callback (see decompressV())\n * `userdata` (direction in) - User data passed to callback (see decompressV())\n * `insize` (direction in) - Size of userdata (see decompressV())\n # Returns\n\nBytes consumed\n * `-1` - error"] pub fn decompressHeader( type_: *mut decompressType, size: *mut usize, @@ -5055,7 +5055,7 @@ extern "C" { ) -> isize; } extern "C" { - #[doc = " Decompress data\n # Arguments\n\n* `iov` (direction in) - Output vector\n * `iovcnt` (direction in) - Number of buffers\n * `callback` (direction in) - Data callback (see note)\n * `userdata` (direction in) - User data passed to callback (see note)\n * `insize` (direction in) - Size of userdata (see note)\n # Returns\n\nWhether succeeded\n\n > **Note:** If callback is null, userdata is a pointer to memory to read from,\n and insize is the size of that data. If callback is not null,\n userdata is passed to callback to fetch more data, and insize is\n unused."] + #[doc = "Decompress data\n # Arguments\n\n* `iov` (direction in) - Output vector\n * `iovcnt` (direction in) - Number of buffers\n * `callback` (direction in) - Data callback (see note)\n * `userdata` (direction in) - User data passed to callback (see note)\n * `insize` (direction in) - Size of userdata (see note)\n # Returns\n\nWhether succeeded\n\n > **Note:** If callback is null, userdata is a pointer to memory to read from,\n and insize is the size of that data. If callback is not null,\n userdata is passed to callback to fetch more data, and insize is\n unused."] pub fn decompressV( iov: *const decompressIOVec, iovcnt: usize, @@ -5065,7 +5065,7 @@ extern "C" { ) -> bool; } extern "C" { - #[doc = " Decompress LZSS/LZ10\n # Arguments\n\n* `iov` (direction in) - Output vector\n * `iovcnt` (direction in) - Number of buffers\n * `callback` (direction in) - Data callback (see decompressV())\n * `userdata` (direction in) - User data passed to callback (see decompressV())\n * `insize` (direction in) - Size of userdata (see decompressV())\n # Returns\n\nWhether succeeded"] + #[doc = "Decompress LZSS/LZ10\n # Arguments\n\n* `iov` (direction in) - Output vector\n * `iovcnt` (direction in) - Number of buffers\n * `callback` (direction in) - Data callback (see decompressV())\n * `userdata` (direction in) - User data passed to callback (see decompressV())\n * `insize` (direction in) - Size of userdata (see decompressV())\n # Returns\n\nWhether succeeded"] pub fn decompressV_LZSS( iov: *const decompressIOVec, iovcnt: usize, @@ -5075,7 +5075,7 @@ extern "C" { ) -> bool; } extern "C" { - #[doc = " Decompress LZ11\n # Arguments\n\n* `iov` (direction in) - Output vector\n * `iovcnt` (direction in) - Number of buffers\n * `callback` (direction in) - Data callback (see decompressV())\n * `userdata` (direction in) - User data passed to callback (see decompressV())\n * `insize` (direction in) - Size of userdata (see decompressV())\n # Returns\n\nWhether succeeded"] + #[doc = "Decompress LZ11\n # Arguments\n\n* `iov` (direction in) - Output vector\n * `iovcnt` (direction in) - Number of buffers\n * `callback` (direction in) - Data callback (see decompressV())\n * `userdata` (direction in) - User data passed to callback (see decompressV())\n * `insize` (direction in) - Size of userdata (see decompressV())\n # Returns\n\nWhether succeeded"] pub fn decompressV_LZ11( iov: *const decompressIOVec, iovcnt: usize, @@ -5085,7 +5085,7 @@ extern "C" { ) -> bool; } extern "C" { - #[doc = " Decompress Huffman\n # Arguments\n\n* `bits` (direction in) - Data size in bits (usually 4 or 8)\n * `iov` (direction in) - Output vector\n * `iovcnt` (direction in) - Number of buffers\n * `callback` (direction in) - Data callback (see decompressV())\n * `userdata` (direction in) - User data passed to callback (see decompressV())\n * `insize` (direction in) - Size of userdata (see decompressV())\n # Returns\n\nWhether succeeded"] + #[doc = "Decompress Huffman\n # Arguments\n\n* `bits` (direction in) - Data size in bits (usually 4 or 8)\n * `iov` (direction in) - Output vector\n * `iovcnt` (direction in) - Number of buffers\n * `callback` (direction in) - Data callback (see decompressV())\n * `userdata` (direction in) - User data passed to callback (see decompressV())\n * `insize` (direction in) - Size of userdata (see decompressV())\n # Returns\n\nWhether succeeded"] pub fn decompressV_Huff( bits: usize, iov: *const decompressIOVec, @@ -5096,7 +5096,7 @@ extern "C" { ) -> bool; } extern "C" { - #[doc = " Decompress run-length encoding\n # Arguments\n\n* `iov` (direction in) - Output vector\n * `iovcnt` (direction in) - Number of buffers\n * `callback` (direction in) - Data callback (see decompressV())\n * `userdata` (direction in) - User data passed to callback (see decompressV())\n * `insize` (direction in) - Size of userdata (see decompressV())\n # Returns\n\nWhether succeeded"] + #[doc = "Decompress run-length encoding\n # Arguments\n\n* `iov` (direction in) - Output vector\n * `iovcnt` (direction in) - Number of buffers\n * `callback` (direction in) - Data callback (see decompressV())\n * `userdata` (direction in) - User data passed to callback (see decompressV())\n * `insize` (direction in) - Size of userdata (see decompressV())\n # Returns\n\nWhether succeeded"] pub fn decompressV_RLE( iov: *const decompressIOVec, iovcnt: usize, @@ -5106,79 +5106,79 @@ extern "C" { ) -> bool; } extern "C" { - #[doc = " Convert a UTF-8 sequence into a UTF-32 codepoint\n\n # Arguments\n\n* `out` (direction out) - Output codepoint\n in Input sequence\n\n # Returns\n\nnumber of input code units consumed\n -1 for error"] + #[doc = "Convert a UTF-8 sequence into a UTF-32 codepoint\n\n # Arguments\n\n* `out` (direction out) - Output codepoint\n * `in` (direction in) - Input sequence\n\n # Returns\n\nnumber of input code units consumed\n -1 for error"] pub fn decode_utf8(out: *mut u32, in_: *const u8) -> isize; } extern "C" { - #[doc = " Convert a UTF-16 sequence into a UTF-32 codepoint\n\n # Arguments\n\n* `out` (direction out) - Output codepoint\n in Input sequence\n\n # Returns\n\nnumber of input code units consumed\n -1 for error"] + #[doc = "Convert a UTF-16 sequence into a UTF-32 codepoint\n\n # Arguments\n\n* `out` (direction out) - Output codepoint\n * `in` (direction in) - Input sequence\n\n # Returns\n\nnumber of input code units consumed\n -1 for error"] pub fn decode_utf16(out: *mut u32, in_: *const u16) -> isize; } extern "C" { - #[doc = " Convert a UTF-32 codepoint into a UTF-8 sequence\n\n # Arguments\n\n* `out` (direction out) - Output sequence\n in Input codepoint\n\n # Returns\n\nnumber of output code units produced\n -1 for error\n\n > **Note:** _out_ must be able to store 4 code units"] + #[doc = "Convert a UTF-32 codepoint into a UTF-8 sequence\n\n # Arguments\n\n* `out` (direction out) - Output sequence\n * `in` (direction in) - Input codepoint\n\n # Returns\n\nnumber of output code units produced\n -1 for error\n\n > **Note:** _out_ must be able to store 4 code units"] pub fn encode_utf8(out: *mut u8, in_: u32) -> isize; } extern "C" { - #[doc = " Convert a UTF-32 codepoint into a UTF-16 sequence\n\n # Arguments\n\n* `out` (direction out) - Output sequence\n in Input codepoint\n\n # Returns\n\nnumber of output code units produced\n -1 for error\n\n > **Note:** _out_ must be able to store 2 code units"] + #[doc = "Convert a UTF-32 codepoint into a UTF-16 sequence\n\n # Arguments\n\n* `out` (direction out) - Output sequence\n * `in` (direction in) - Input codepoint\n\n # Returns\n\nnumber of output code units produced\n -1 for error\n\n > **Note:** _out_ must be able to store 2 code units"] pub fn encode_utf16(out: *mut u16, in_: u32) -> isize; } extern "C" { - #[doc = " Convert a UTF-8 sequence into a UTF-16 sequence\n\n Fills the output buffer up to _len_ code units.\n Returns the number of code units that the input would produce;\n if it returns greater than _len,_ the output has been\n truncated.\n\n # Arguments\n\n* `out` (direction out) - Output sequence\n in Input sequence (null-terminated)\n len Output length\n\n # Returns\n\nnumber of output code units produced\n -1 for error\n\n > **Note:** _out_ is not null-terminated"] + #[doc = "Convert a UTF-8 sequence into a UTF-16 sequence\n\n Fills the output buffer up to _len_ code units.\n Returns the number of code units that the input would produce;\n if it returns greater than _len,_ the output has been\n truncated.\n\n # Arguments\n\n* `out` (direction out) - Output sequence\n * `in` (direction in) - Input sequence (null-terminated)\n * `len` (direction in) - Output length\n\n # Returns\n\nnumber of output code units produced\n -1 for error\n\n > **Note:** _out_ is not null-terminated"] pub fn utf8_to_utf16(out: *mut u16, in_: *const u8, len: usize) -> isize; } extern "C" { - #[doc = " Convert a UTF-8 sequence into a UTF-32 sequence\n\n Fills the output buffer up to _len_ code units.\n Returns the number of code units that the input would produce;\n if it returns greater than _len,_ the output has been\n truncated.\n\n # Arguments\n\n* `out` (direction out) - Output sequence\n in Input sequence (null-terminated)\n len Output length\n\n # Returns\n\nnumber of output code units produced\n -1 for error\n\n > **Note:** _out_ is not null-terminated"] + #[doc = "Convert a UTF-8 sequence into a UTF-32 sequence\n\n Fills the output buffer up to _len_ code units.\n Returns the number of code units that the input would produce;\n if it returns greater than _len,_ the output has been\n truncated.\n\n # Arguments\n\n* `out` (direction out) - Output sequence\n * `in` (direction in) - Input sequence (null-terminated)\n * `len` (direction in) - Output length\n\n # Returns\n\nnumber of output code units produced\n -1 for error\n\n > **Note:** _out_ is not null-terminated"] pub fn utf8_to_utf32(out: *mut u32, in_: *const u8, len: usize) -> isize; } extern "C" { - #[doc = " Convert a UTF-16 sequence into a UTF-8 sequence\n\n Fills the output buffer up to _len_ code units.\n Returns the number of code units that the input would produce;\n if it returns greater than _len,_ the output has been\n truncated.\n\n # Arguments\n\n* `out` (direction out) - Output sequence\n in Input sequence (null-terminated)\n len Output length\n\n # Returns\n\nnumber of output code units produced\n -1 for error\n\n > **Note:** _out_ is not null-terminated"] + #[doc = "Convert a UTF-16 sequence into a UTF-8 sequence\n\n Fills the output buffer up to _len_ code units.\n Returns the number of code units that the input would produce;\n if it returns greater than _len,_ the output has been\n truncated.\n\n # Arguments\n\n* `out` (direction out) - Output sequence\n * `in` (direction in) - Input sequence (null-terminated)\n * `len` (direction in) - Output length\n\n # Returns\n\nnumber of output code units produced\n -1 for error\n\n > **Note:** _out_ is not null-terminated"] pub fn utf16_to_utf8(out: *mut u8, in_: *const u16, len: usize) -> isize; } extern "C" { - #[doc = " Convert a UTF-16 sequence into a UTF-32 sequence\n\n Fills the output buffer up to _len_ code units.\n Returns the number of code units that the input would produce;\n if it returns greater than _len,_ the output has been\n truncated.\n\n # Arguments\n\n* `out` (direction out) - Output sequence\n in Input sequence (null-terminated)\n len Output length\n\n # Returns\n\nnumber of output code units produced\n -1 for error\n\n > **Note:** _out_ is not null-terminated"] + #[doc = "Convert a UTF-16 sequence into a UTF-32 sequence\n\n Fills the output buffer up to _len_ code units.\n Returns the number of code units that the input would produce;\n if it returns greater than _len,_ the output has been\n truncated.\n\n # Arguments\n\n* `out` (direction out) - Output sequence\n * `in` (direction in) - Input sequence (null-terminated)\n * `len` (direction in) - Output length\n\n # Returns\n\nnumber of output code units produced\n -1 for error\n\n > **Note:** _out_ is not null-terminated"] pub fn utf16_to_utf32(out: *mut u32, in_: *const u16, len: usize) -> isize; } extern "C" { - #[doc = " Convert a UTF-32 sequence into a UTF-8 sequence\n\n Fills the output buffer up to _len_ code units.\n Returns the number of code units that the input would produce;\n if it returns greater than _len,_ the output has been\n truncated.\n\n # Arguments\n\n* `out` (direction out) - Output sequence\n in Input sequence (null-terminated)\n len Output length\n\n # Returns\n\nnumber of output code units produced\n -1 for error\n\n > **Note:** _out_ is not null-terminated"] + #[doc = "Convert a UTF-32 sequence into a UTF-8 sequence\n\n Fills the output buffer up to _len_ code units.\n Returns the number of code units that the input would produce;\n if it returns greater than _len,_ the output has been\n truncated.\n\n # Arguments\n\n* `out` (direction out) - Output sequence\n * `in` (direction in) - Input sequence (null-terminated)\n * `len` (direction in) - Output length\n\n # Returns\n\nnumber of output code units produced\n -1 for error\n\n > **Note:** _out_ is not null-terminated"] pub fn utf32_to_utf8(out: *mut u8, in_: *const u32, len: usize) -> isize; } extern "C" { - #[doc = " Convert a UTF-32 sequence into a UTF-16 sequence\n\n # Arguments\n\n* `out` (direction out) - Output sequence\n in Input sequence (null-terminated)\n len Output length\n\n # Returns\n\nnumber of output code units produced\n -1 for error\n\n > **Note:** _out_ is not null-terminated"] + #[doc = "Convert a UTF-32 sequence into a UTF-16 sequence\n\n # Arguments\n\n* `out` (direction out) - Output sequence\n * `in` (direction in) - Input sequence (null-terminated)\n * `len` (direction in) - Output length\n\n # Returns\n\nnumber of output code units produced\n -1 for error\n\n > **Note:** _out_ is not null-terminated"] pub fn utf32_to_utf16(out: *mut u16, in_: *const u32, len: usize) -> isize; } extern "C" { - #[doc = " Allocates a 0x80-byte aligned buffer.\n # Arguments\n\n* `size` - Size of the buffer to allocate.\n # Returns\n\nThe allocated buffer."] + #[doc = "Allocates a 0x80-byte aligned buffer.\n # Arguments\n\n* `size` - Size of the buffer to allocate.\n # Returns\n\nThe allocated buffer."] pub fn linearAlloc(size: usize) -> *mut ::libc::c_void; } extern "C" { - #[doc = " Allocates a buffer aligned to the given size.\n # Arguments\n\n* `size` - Size of the buffer to allocate.\n * `alignment` - Alignment to use.\n # Returns\n\nThe allocated buffer."] + #[doc = "Allocates a buffer aligned to the given size.\n # Arguments\n\n* `size` - Size of the buffer to allocate.\n * `alignment` - Alignment to use.\n # Returns\n\nThe allocated buffer."] pub fn linearMemAlign(size: usize, alignment: usize) -> *mut ::libc::c_void; } extern "C" { - #[doc = " Reallocates a buffer.\n Note: Not implemented yet.\n # Arguments\n\n* `mem` - Buffer to reallocate.\n * `size` - Size of the buffer to allocate.\n # Returns\n\nThe reallocated buffer."] + #[doc = "Reallocates a buffer.\n Note: Not implemented yet.\n # Arguments\n\n* `mem` - Buffer to reallocate.\n * `size` - Size of the buffer to allocate.\n # Returns\n\nThe reallocated buffer."] pub fn linearRealloc(mem: *mut ::libc::c_void, size: usize) -> *mut ::libc::c_void; } extern "C" { - #[doc = " Retrieves the allocated size of a buffer.\n # Returns\n\nThe size of the buffer."] + #[doc = "Retrieves the allocated size of a buffer.\n # Returns\n\nThe size of the buffer."] pub fn linearGetSize(mem: *mut ::libc::c_void) -> usize; } extern "C" { - #[doc = " Frees a buffer.\n # Arguments\n\n* `mem` - Buffer to free."] + #[doc = "Frees a buffer.\n # Arguments\n\n* `mem` - Buffer to free."] pub fn linearFree(mem: *mut ::libc::c_void); } extern "C" { - #[doc = " Gets the current linear free space.\n # Returns\n\nThe current linear free space."] + #[doc = "Gets the current linear free space.\n # Returns\n\nThe current linear free space."] pub fn linearSpaceFree() -> u32_; } extern "C" { - #[doc = " Initializes the mappable allocator.\n # Arguments\n\n* `addrMin` - Minimum address.\n * `addrMax` - Maxium address."] + #[doc = "Initializes the mappable allocator.\n # Arguments\n\n* `addrMin` - Minimum address.\n * `addrMax` - Maxium address."] pub fn mappableInit(addrMin: u32_, addrMax: u32_); } extern "C" { - #[doc = " Finds a mappable memory area.\n # Arguments\n\n* `size` - Size of the area to find.\n # Returns\n\nThe mappable area."] + #[doc = "Finds a mappable memory area.\n # Arguments\n\n* `size` - Size of the area to find.\n # Returns\n\nThe mappable area."] pub fn mappableAlloc(size: usize) -> *mut ::libc::c_void; } extern "C" { - #[doc = " Frees a mappable area (stubbed).\n # Arguments\n\n* `mem` - Mappable area to free."] + #[doc = "Frees a mappable area (stubbed).\n # Arguments\n\n* `mem` - Mappable area to free."] pub fn mappableFree(mem: *mut ::libc::c_void); } pub const VRAM_ALLOC_A: vramAllocPos = 1; @@ -5186,35 +5186,35 @@ pub const VRAM_ALLOC_B: vramAllocPos = 2; pub const VRAM_ALLOC_ANY: vramAllocPos = 3; pub type vramAllocPos = ::libc::c_uint; extern "C" { - #[doc = " Allocates a 0x80-byte aligned buffer.\n # Arguments\n\n* `size` - Size of the buffer to allocate.\n # Returns\n\nThe allocated buffer."] + #[doc = "Allocates a 0x80-byte aligned buffer.\n # Arguments\n\n* `size` - Size of the buffer to allocate.\n # Returns\n\nThe allocated buffer."] pub fn vramAlloc(size: usize) -> *mut ::libc::c_void; } extern "C" { - #[doc = " Allocates a 0x80-byte aligned buffer in the given VRAM bank.\n # Arguments\n\n* `size` - Size of the buffer to allocate.\n * `pos` - VRAM bank to use (see vramAllocPos).\n # Returns\n\nThe allocated buffer."] + #[doc = "Allocates a 0x80-byte aligned buffer in the given VRAM bank.\n # Arguments\n\n* `size` - Size of the buffer to allocate.\n * `pos` - VRAM bank to use (see vramAllocPos).\n # Returns\n\nThe allocated buffer."] pub fn vramAllocAt(size: usize, pos: vramAllocPos) -> *mut ::libc::c_void; } extern "C" { - #[doc = " Allocates a buffer aligned to the given size.\n # Arguments\n\n* `size` - Size of the buffer to allocate.\n * `alignment` - Alignment to use.\n # Returns\n\nThe allocated buffer."] + #[doc = "Allocates a buffer aligned to the given size.\n # Arguments\n\n* `size` - Size of the buffer to allocate.\n * `alignment` - Alignment to use.\n # Returns\n\nThe allocated buffer."] pub fn vramMemAlign(size: usize, alignment: usize) -> *mut ::libc::c_void; } extern "C" { - #[doc = " Allocates a buffer aligned to the given size in the given VRAM bank.\n # Arguments\n\n* `size` - Size of the buffer to allocate.\n * `alignment` - Alignment to use.\n * `pos` - VRAM bank to use (see vramAllocPos).\n # Returns\n\nThe allocated buffer."] + #[doc = "Allocates a buffer aligned to the given size in the given VRAM bank.\n # Arguments\n\n* `size` - Size of the buffer to allocate.\n * `alignment` - Alignment to use.\n * `pos` - VRAM bank to use (see vramAllocPos).\n # Returns\n\nThe allocated buffer."] pub fn vramMemAlignAt(size: usize, alignment: usize, pos: vramAllocPos) -> *mut ::libc::c_void; } extern "C" { - #[doc = " Reallocates a buffer.\n Note: Not implemented yet.\n # Arguments\n\n* `mem` - Buffer to reallocate.\n * `size` - Size of the buffer to allocate.\n # Returns\n\nThe reallocated buffer."] + #[doc = "Reallocates a buffer.\n Note: Not implemented yet.\n # Arguments\n\n* `mem` - Buffer to reallocate.\n * `size` - Size of the buffer to allocate.\n # Returns\n\nThe reallocated buffer."] pub fn vramRealloc(mem: *mut ::libc::c_void, size: usize) -> *mut ::libc::c_void; } extern "C" { - #[doc = " Retrieves the allocated size of a buffer.\n # Returns\n\nThe size of the buffer."] + #[doc = "Retrieves the allocated size of a buffer.\n # Returns\n\nThe size of the buffer."] pub fn vramGetSize(mem: *mut ::libc::c_void) -> usize; } extern "C" { - #[doc = " Frees a buffer.\n # Arguments\n\n* `mem` - Buffer to free."] + #[doc = "Frees a buffer.\n # Arguments\n\n* `mem` - Buffer to free."] pub fn vramFree(mem: *mut ::libc::c_void); } extern "C" { - #[doc = " Gets the current VRAM free space.\n # Returns\n\nThe current VRAM free space."] + #[doc = "Gets the current VRAM free space.\n # Returns\n\nThe current VRAM free space."] pub fn vramSpaceFree() -> u32_; } #[doc = "< Open authentication."] @@ -5233,9 +5233,9 @@ pub const AC_WPA2_TKIP: acSecurityMode = 5; pub const AC_WPA_AES: acSecurityMode = 6; #[doc = "< WPA2 AES authentication."] pub const AC_WPA2_AES: acSecurityMode = 7; -#[doc = " Wifi security modes."] +#[doc = "Wifi security modes."] pub type acSecurityMode = ::libc::c_uint; -#[doc = " Struct to contain the data for connecting to a Wifi network from a stored slot."] +#[doc = "Struct to contain the data for connecting to a Wifi network from a stored slot."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct acuConfig { @@ -5252,96 +5252,96 @@ impl Default for acuConfig { } extern "C" { #[must_use] - #[doc = " Initializes AC."] + #[doc = "Initializes AC."] pub fn acInit() -> Result; } extern "C" { - #[doc = " Exits AC."] + #[doc = "Exits AC."] pub fn acExit(); } extern "C" { #[must_use] - #[doc = " Waits for the system to connect to the internet."] + #[doc = "Waits for the system to connect to the internet."] pub fn acWaitInternetConnection() -> Result; } extern "C" { #[must_use] - #[doc = " Gets the connected Wifi status.\n # Arguments\n\n* `out` - Pointer to output the connected Wifi status to. (0 = not connected, 1 = O3DS Internet, 2 = N3DS Internet)"] + #[doc = "Gets the connected Wifi status.\n # Arguments\n\n* `out` - Pointer to output the connected Wifi status to. (0 = not connected, 1 = O3DS Internet, 2 = N3DS Internet)"] pub fn ACU_GetWifiStatus(out: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the connected Wifi status.\n # Arguments\n\n* `out` - Pointer to output the connected Wifi status to. (1 = not connected, 3 = connected)"] + #[doc = "Gets the connected Wifi status.\n # Arguments\n\n* `out` - Pointer to output the connected Wifi status to. (1 = not connected, 3 = connected)"] pub fn ACU_GetStatus(out: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the connected Wifi security mode.\n # Arguments\n\n* `mode` - Pointer to output the connected Wifi security mode to. (0 = Open Authentication, 1 = WEP 40-bit, 2 = WEP 104-bit, 3 = WEP 128-bit, 4 = WPA TKIP, 5 = WPA2 TKIP, 6 = WPA AES, 7 = WPA2 AES)"] + #[doc = "Gets the connected Wifi security mode.\n # Arguments\n\n* `mode` - Pointer to output the connected Wifi security mode to. (0 = Open Authentication, 1 = WEP 40-bit, 2 = WEP 104-bit, 3 = WEP 128-bit, 4 = WPA TKIP, 5 = WPA2 TKIP, 6 = WPA AES, 7 = WPA2 AES)"] pub fn ACU_GetSecurityMode(mode: *mut acSecurityMode) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the connected Wifi SSID.\n # Arguments\n\n* `SSID` - Pointer to output the connected Wifi SSID to."] + #[doc = "Gets the connected Wifi SSID.\n # Arguments\n\n* `SSID` - Pointer to output the connected Wifi SSID to."] pub fn ACU_GetSSID(SSID: *mut ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the connected Wifi SSID length.\n # Arguments\n\n* `out` - Pointer to output the connected Wifi SSID length to."] + #[doc = "Gets the connected Wifi SSID length.\n # Arguments\n\n* `out` - Pointer to output the connected Wifi SSID length to."] pub fn ACU_GetSSIDLength(out: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Determines whether proxy is enabled for the connected network.\n # Arguments\n\n* `enable` - Pointer to output the proxy status to."] + #[doc = "Determines whether proxy is enabled for the connected network.\n # Arguments\n\n* `enable` - Pointer to output the proxy status to."] pub fn ACU_GetProxyEnable(enable: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the connected network's proxy port.\n # Arguments\n\n* `out` - Pointer to output the proxy port to."] + #[doc = "Gets the connected network's proxy port.\n # Arguments\n\n* `out` - Pointer to output the proxy port to."] pub fn ACU_GetProxyPort(out: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the connected network's proxy username.\n # Arguments\n\n* `username` - Pointer to output the proxy username to. (The size must be at least 0x20-bytes)"] + #[doc = "Gets the connected network's proxy username.\n # Arguments\n\n* `username` - Pointer to output the proxy username to. (The size must be at least 0x20-bytes)"] pub fn ACU_GetProxyUserName(username: *mut ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the connected network's proxy password.\n # Arguments\n\n* `password` - Pointer to output the proxy password to. (The size must be at least 0x20-bytes)"] + #[doc = "Gets the connected network's proxy password.\n # Arguments\n\n* `password` - Pointer to output the proxy password to. (The size must be at least 0x20-bytes)"] pub fn ACU_GetProxyPassword(password: *mut ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the last error to occur during a connection.\n # Arguments\n\n* `errorCode` - Pointer to output the error code to."] + #[doc = "Gets the last error to occur during a connection.\n # Arguments\n\n* `errorCode` - Pointer to output the error code to."] pub fn ACU_GetLastErrorCode(errorCode: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the last detailed error to occur during a connection.\n # Arguments\n\n* `errorCode` - Pointer to output the error code to."] + #[doc = "Gets the last detailed error to occur during a connection.\n # Arguments\n\n* `errorCode` - Pointer to output the error code to."] pub fn ACU_GetLastDetailErrorCode(errorCode: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Prepares a buffer to hold the configuration data to start a connection.\n # Arguments\n\n* `config` - Pointer to an acuConfig struct to contain the data."] + #[doc = "Prepares a buffer to hold the configuration data to start a connection.\n # Arguments\n\n* `config` - Pointer to an acuConfig struct to contain the data."] pub fn ACU_CreateDefaultConfig(config: *mut acuConfig) -> Result; } extern "C" { #[must_use] - #[doc = " Sets something that makes the connection reliable.\n # Arguments\n\n* `config` - Pointer to an acuConfig struct used with ACU_CreateDefaultConfig previously.\n * `area` - Always 2 ?"] + #[doc = "Sets something that makes the connection reliable.\n # Arguments\n\n* `config` - Pointer to an acuConfig struct used with ACU_CreateDefaultConfig previously.\n * `area` - Always 2 ?"] pub fn ACU_SetNetworkArea(config: *mut acuConfig, area: u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the slot to use when connecting.\n # Arguments\n\n* `config` - Pointer to an acuConfig struct used with ACU_CreateDefaultConfig previously.\n * `type` - Allowed slots flag. BIT(0) for slot 1, BIT(1) for slot 2, BIT(2) for slot 3."] + #[doc = "Sets the slot to use when connecting.\n # Arguments\n\n* `config` - Pointer to an acuConfig struct used with ACU_CreateDefaultConfig previously.\n * `type` - Allowed slots flag. BIT(0) for slot 1, BIT(1) for slot 2, BIT(2) for slot 3."] pub fn ACU_SetAllowApType(config: *mut acuConfig, type_: u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Sets something that makes the connection reliable.\n # Arguments\n\n* `config` - Pointer to an acuConfig struct used with ACU_CreateDefaultConfig previously."] + #[doc = "Sets something that makes the connection reliable.\n # Arguments\n\n* `config` - Pointer to an acuConfig struct used with ACU_CreateDefaultConfig previously."] pub fn ACU_SetRequestEulaVersion(config: *mut acuConfig) -> Result; } extern "C" { #[must_use] - #[doc = " Starts the connection procedure.\n # Arguments\n\n* `config` - Pointer to an acuConfig struct used with ACU_CreateDefaultConfig previously.\n * `connectionHandle` - Handle created with svcCreateEvent to wait on until the connection succeeds or fails."] + #[doc = "Starts the connection procedure.\n # Arguments\n\n* `config` - Pointer to an acuConfig struct used with ACU_CreateDefaultConfig previously.\n * `connectionHandle` - Handle created with svcCreateEvent to wait on until the connection succeeds or fails."] pub fn ACU_ConnectAsync(config: *const acuConfig, connectionHandle: Handle) -> Result; } #[doc = "< Open for reading."] @@ -5350,13 +5350,13 @@ pub const FS_OPEN_READ: _bindgen_ty_10 = 1; pub const FS_OPEN_WRITE: _bindgen_ty_10 = 2; #[doc = "< Create file."] pub const FS_OPEN_CREATE: _bindgen_ty_10 = 4; -#[doc = " Open flags."] +#[doc = "Open flags."] pub type _bindgen_ty_10 = ::libc::c_uint; #[doc = "< Flush."] pub const FS_WRITE_FLUSH: _bindgen_ty_11 = 1; #[doc = "< Update file timestamp."] pub const FS_WRITE_UPDATE_TIME: _bindgen_ty_11 = 256; -#[doc = " Write flags."] +#[doc = "Write flags."] pub type _bindgen_ty_11 = ::libc::c_uint; #[doc = "< Directory."] pub const FS_ATTRIBUTE_DIRECTORY: _bindgen_ty_12 = 1; @@ -5366,7 +5366,7 @@ pub const FS_ATTRIBUTE_HIDDEN: _bindgen_ty_12 = 256; pub const FS_ATTRIBUTE_ARCHIVE: _bindgen_ty_12 = 65536; #[doc = "< Read-only."] pub const FS_ATTRIBUTE_READ_ONLY: _bindgen_ty_12 = 16777216; -#[doc = " Attribute flags."] +#[doc = "Attribute flags."] pub type _bindgen_ty_12 = ::libc::c_uint; #[doc = "< NAND."] pub const MEDIATYPE_NAND: FS_MediaType = 0; @@ -5374,7 +5374,7 @@ pub const MEDIATYPE_NAND: FS_MediaType = 0; pub const MEDIATYPE_SD: FS_MediaType = 1; #[doc = "< Game card."] pub const MEDIATYPE_GAME_CARD: FS_MediaType = 2; -#[doc = " Media types."] +#[doc = "Media types."] pub type FS_MediaType = ::libc::c_uint; #[doc = "< CTR NAND."] pub const SYSTEM_MEDIATYPE_CTR_NAND: FS_SystemMediaType = 0; @@ -5384,7 +5384,7 @@ pub const SYSTEM_MEDIATYPE_TWL_NAND: FS_SystemMediaType = 1; pub const SYSTEM_MEDIATYPE_SD: FS_SystemMediaType = 2; #[doc = "< TWL Photo."] pub const SYSTEM_MEDIATYPE_TWL_PHOTO: FS_SystemMediaType = 3; -#[doc = " System media types."] +#[doc = "System media types."] pub type FS_SystemMediaType = ::libc::c_uint; #[doc = "< RomFS archive."] pub const ARCHIVE_ROMFS: FS_ArchiveID = 3; @@ -5434,7 +5434,7 @@ pub const ARCHIVE_GAMECARD_SAVEDATA: FS_ArchiveID = 1450741937; pub const ARCHIVE_USER_SAVEDATA: FS_ArchiveID = 1450741938; #[doc = "< Demo save data archive."] pub const ARCHIVE_DEMO_SAVEDATA: FS_ArchiveID = 1450741940; -#[doc = " Archive IDs."] +#[doc = "Archive IDs."] pub type FS_ArchiveID = ::libc::c_uint; #[doc = "< Invalid path."] pub const PATH_INVALID: FS_PathType = 0; @@ -5446,11 +5446,11 @@ pub const PATH_BINARY: FS_PathType = 2; pub const PATH_ASCII: FS_PathType = 3; #[doc = "< UTF-16 text path."] pub const PATH_UTF16: FS_PathType = 4; -#[doc = " Path types."] +#[doc = "Path types."] pub type FS_PathType = ::libc::c_uint; #[doc = "< SD application."] pub const SECUREVALUE_SLOT_SD: FS_SecureValueSlot = 4096; -#[doc = " Secure value slot."] +#[doc = "Secure value slot."] pub type FS_SecureValueSlot = ::libc::c_uint; #[doc = "< 512KHz."] pub const BAUDRATE_512KHZ: FS_CardSpiBaudRate = 0; @@ -5464,13 +5464,13 @@ pub const BAUDRATE_4MHZ: FS_CardSpiBaudRate = 3; pub const BAUDRATE_8MHZ: FS_CardSpiBaudRate = 4; #[doc = "< 16MHz."] pub const BAUDRATE_16MHZ: FS_CardSpiBaudRate = 5; -#[doc = " Card SPI baud rate."] +#[doc = "Card SPI baud rate."] pub type FS_CardSpiBaudRate = ::libc::c_uint; #[doc = "< 1-bit."] pub const BUSMODE_1BIT: FS_CardSpiBusMode = 0; #[doc = "< 4-bit."] pub const BUSMODE_4BIT: FS_CardSpiBusMode = 1; -#[doc = " Card SPI bus mode."] +#[doc = "Card SPI bus mode."] pub type FS_CardSpiBusMode = ::libc::c_uint; #[doc = "< Update."] pub const SPECIALCONTENT_UPDATE: FS_SpecialContentType = 1; @@ -5478,7 +5478,7 @@ pub const SPECIALCONTENT_UPDATE: FS_SpecialContentType = 1; pub const SPECIALCONTENT_MANUAL: FS_SpecialContentType = 2; #[doc = "< DLP child."] pub const SPECIALCONTENT_DLP_CHILD: FS_SpecialContentType = 3; -#[doc = " Card SPI bus mode."] +#[doc = "Card SPI bus mode."] pub type FS_SpecialContentType = ::libc::c_uint; #[doc = "< CTR card."] pub const CARD_CTR: FS_CardType = 0; @@ -5486,28 +5486,28 @@ pub const CARD_CTR: FS_CardType = 0; pub const CARD_TWL: FS_CardType = 1; pub type FS_CardType = ::libc::c_uint; pub const FS_ACTION_UNKNOWN: FS_Action = 0; -#[doc = " FS control actions."] +#[doc = "FS control actions."] pub type FS_Action = ::libc::c_uint; #[doc = "< Commits save data changes. No inputs/outputs."] pub const ARCHIVE_ACTION_COMMIT_SAVE_DATA: FS_ArchiveAction = 0; #[doc = "< Retrieves a file's last-modified timestamp. In: \"u16*, UTF-16 Path\", Out: \"u64, Time Stamp\"."] pub const ARCHIVE_ACTION_GET_TIMESTAMP: FS_ArchiveAction = 1; pub const ARCHIVE_ACTION_UNKNOWN: FS_ArchiveAction = 30877; -#[doc = " Archive control actions."] +#[doc = "Archive control actions."] pub type FS_ArchiveAction = ::libc::c_uint; #[doc = "< Deletes a save's secure value. In: \"u64, ((SecureValueSlot << 32) | (TitleUniqueId << 8) | TitleVariation)\", Out: \"u8, Value Existed\""] pub const SECURESAVE_ACTION_DELETE: FS_SecureSaveAction = 0; #[doc = "< Formats a save. No inputs/outputs."] pub const SECURESAVE_ACTION_FORMAT: FS_SecureSaveAction = 1; -#[doc = " Secure save control actions."] +#[doc = "Secure save control actions."] pub type FS_SecureSaveAction = ::libc::c_uint; pub const FILE_ACTION_UNKNOWN: FS_FileAction = 0; -#[doc = " File control actions."] +#[doc = "File control actions."] pub type FS_FileAction = ::libc::c_uint; pub const DIRECTORY_ACTION_UNKNOWN: FS_DirectoryAction = 0; -#[doc = " Directory control actions."] +#[doc = "Directory control actions."] pub type FS_DirectoryAction = ::libc::c_uint; -#[doc = " Directory entry."] +#[doc = "Directory entry."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct FS_DirectoryEntry { @@ -5535,7 +5535,7 @@ impl Default for FS_DirectoryEntry { } } } -#[doc = " Archive resource information."] +#[doc = "Archive resource information."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct FS_ArchiveResource { @@ -5548,7 +5548,7 @@ pub struct FS_ArchiveResource { #[doc = "< Number of free clusters."] pub freeClusters: u32_, } -#[doc = " Program information."] +#[doc = "Program information."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct FS_ProgramInfo { @@ -5590,7 +5590,7 @@ impl FS_ProgramInfo { __bindgen_bitfield_unit } } -#[doc = " Product information."] +#[doc = "Product information."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct FS_ProductInfo { @@ -5601,7 +5601,7 @@ pub struct FS_ProductInfo { #[doc = "< Remaster version."] pub remasterVersion: u16_, } -#[doc = " Integrity verification seed."] +#[doc = "Integrity verification seed."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct FS_IntegrityVerificationSeed { @@ -5619,7 +5619,7 @@ impl Default for FS_IntegrityVerificationSeed { } } } -#[doc = " Ext save data information."] +#[doc = "Ext save data information."] #[repr(C, packed)] #[derive(Debug, Copy, Clone)] pub struct FS_ExtSaveDataInfo { @@ -5665,7 +5665,7 @@ impl FS_ExtSaveDataInfo { __bindgen_bitfield_unit } } -#[doc = " System save data information."] +#[doc = "System save data information."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct FS_SystemSaveDataInfo { @@ -5709,7 +5709,7 @@ impl FS_SystemSaveDataInfo { __bindgen_bitfield_unit } } -#[doc = " Device move context."] +#[doc = "Device move context."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct FS_DeviceMoveContext { @@ -5718,7 +5718,7 @@ pub struct FS_DeviceMoveContext { #[doc = "< Encrypt parameter."] pub encryptParameter: [u8_; 16usize], } -#[doc = " Filesystem path data, detailing the specific target of an operation."] +#[doc = "Filesystem path data, detailing the specific target of an operation."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct FS_Path { @@ -5738,7 +5738,7 @@ impl Default for FS_Path { } } } -#[doc = " SDMC/NAND speed information"] +#[doc = "SDMC/NAND speed information"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct FS_SdMmcSpeedInfo { @@ -5749,44 +5749,44 @@ pub struct FS_SdMmcSpeedInfo { #[doc = "< The value of the SD_CLK_CTRL register."] pub sdClkCtrl: u16_, } -#[doc = " Filesystem archive handle, providing access to a filesystem's contents."] +#[doc = "Filesystem archive handle, providing access to a filesystem's contents."] pub type FS_Archive = u64_; extern "C" { #[must_use] - #[doc = " Initializes FS."] + #[doc = "Initializes FS."] pub fn fsInit() -> Result; } extern "C" { - #[doc = " Exits FS."] + #[doc = "Exits FS."] pub fn fsExit(); } extern "C" { - #[doc = " Sets the FSUSER session to use in the current thread.\n # Arguments\n\n* `session` - The handle of the FSUSER session to use."] + #[doc = "Sets the FSUSER session to use in the current thread.\n # Arguments\n\n* `session` - The handle of the FSUSER session to use."] pub fn fsUseSession(session: Handle); } extern "C" { - #[doc = " Disables the FSUSER session override in the current thread."] + #[doc = "Disables the FSUSER session override in the current thread."] pub fn fsEndUseSession(); } extern "C" { - #[doc = " Exempts an archive from using alternate FS session handles provided with fsUseSession\n Instead, the archive will use the default FS session handle, opened with srvGetSessionHandle\n # Arguments\n\n* `archive` - Archive to exempt."] + #[doc = "Exempts an archive from using alternate FS session handles provided with fsUseSession\n Instead, the archive will use the default FS session handle, opened with srvGetSessionHandle\n # Arguments\n\n* `archive` - Archive to exempt."] pub fn fsExemptFromSession(archive: FS_Archive); } extern "C" { - #[doc = " Unexempts an archive from using alternate FS session handles provided with fsUseSession\n # Arguments\n\n* `archive` - Archive to remove from the exemption list."] + #[doc = "Unexempts an archive from using alternate FS session handles provided with fsUseSession\n # Arguments\n\n* `archive` - Archive to remove from the exemption list."] pub fn fsUnexemptFromSession(archive: FS_Archive); } extern "C" { - #[doc = " Creates an FS_Path instance.\n # Arguments\n\n* `type` - Type of path.\n * `path` - Path to use.\n # Returns\n\nThe created FS_Path instance."] + #[doc = "Creates an FS_Path instance.\n # Arguments\n\n* `type` - Type of path.\n * `path` - Path to use.\n # Returns\n\nThe created FS_Path instance."] pub fn fsMakePath(type_: FS_PathType, path: *const ::libc::c_void) -> FS_Path; } extern "C" { - #[doc = " Gets the current FS session handle.\n # Returns\n\nThe current FS session handle."] + #[doc = "Gets the current FS session handle.\n # Returns\n\nThe current FS session handle."] pub fn fsGetSessionHandle() -> *mut Handle; } extern "C" { #[must_use] - #[doc = " Performs a control operation on the filesystem.\n # Arguments\n\n* `action` - Action to perform.\n * `input` - Buffer to read input from.\n * `inputSize` - Size of the input.\n * `output` - Buffer to write output to.\n * `outputSize` - Size of the output."] + #[doc = "Performs a control operation on the filesystem.\n # Arguments\n\n* `action` - Action to perform.\n * `input` - Buffer to read input from.\n * `inputSize` - Size of the input.\n * `output` - Buffer to write output to.\n * `outputSize` - Size of the output."] pub fn FSUSER_Control( action: FS_Action, input: *mut ::libc::c_void, @@ -5797,12 +5797,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Initializes a FSUSER session.\n # Arguments\n\n* `session` - The handle of the FSUSER session to initialize."] + #[doc = "Initializes a FSUSER session.\n # Arguments\n\n* `session` - The handle of the FSUSER session to initialize."] pub fn FSUSER_Initialize(session: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Opens a file.\n # Arguments\n\n* `out` - Pointer to output the file handle to.\n * `archive` - Archive containing the file.\n * `path` - Path of the file.\n * `openFlags` - Flags to open the file with.\n * `attributes` - Attributes of the file."] + #[doc = "Opens a file.\n # Arguments\n\n* `out` - Pointer to output the file handle to.\n * `archive` - Archive containing the file.\n * `path` - Path of the file.\n * `openFlags` - Flags to open the file with.\n * `attributes` - Attributes of the file."] pub fn FSUSER_OpenFile( out: *mut Handle, archive: FS_Archive, @@ -5813,7 +5813,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Opens a file directly, bypassing the requirement of an opened archive handle.\n # Arguments\n\n* `out` - Pointer to output the file handle to.\n * `archiveId` - ID of the archive containing the file.\n * `archivePath` - Path of the archive containing the file.\n * `filePath` - Path of the file.\n * `openFlags` - Flags to open the file with.\n * `attributes` - Attributes of the file."] + #[doc = "Opens a file directly, bypassing the requirement of an opened archive handle.\n # Arguments\n\n* `out` - Pointer to output the file handle to.\n * `archiveId` - ID of the archive containing the file.\n * `archivePath` - Path of the archive containing the file.\n * `filePath` - Path of the file.\n * `openFlags` - Flags to open the file with.\n * `attributes` - Attributes of the file."] pub fn FSUSER_OpenFileDirectly( out: *mut Handle, archiveId: FS_ArchiveID, @@ -5825,12 +5825,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Deletes a file.\n # Arguments\n\n* `archive` - Archive containing the file.\n * `path` - Path of the file."] + #[doc = "Deletes a file.\n # Arguments\n\n* `archive` - Archive containing the file.\n * `path` - Path of the file."] pub fn FSUSER_DeleteFile(archive: FS_Archive, path: FS_Path) -> Result; } extern "C" { #[must_use] - #[doc = " Renames a file.\n # Arguments\n\n* `srcArchive` - Archive containing the source file.\n * `srcPath` - Path of the source file.\n * `dstArchive` - Archive containing the destination file.\n * `dstPath` - Path of the destination file."] + #[doc = "Renames a file.\n # Arguments\n\n* `srcArchive` - Archive containing the source file.\n * `srcPath` - Path of the source file.\n * `dstArchive` - Archive containing the destination file.\n * `dstPath` - Path of the destination file."] pub fn FSUSER_RenameFile( srcArchive: FS_Archive, srcPath: FS_Path, @@ -5840,17 +5840,17 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Deletes a directory, failing if it is not empty.\n # Arguments\n\n* `archive` - Archive containing the directory.\n * `path` - Path of the directory."] + #[doc = "Deletes a directory, failing if it is not empty.\n # Arguments\n\n* `archive` - Archive containing the directory.\n * `path` - Path of the directory."] pub fn FSUSER_DeleteDirectory(archive: FS_Archive, path: FS_Path) -> Result; } extern "C" { #[must_use] - #[doc = " Deletes a directory, also deleting its contents.\n # Arguments\n\n* `archive` - Archive containing the directory.\n * `path` - Path of the directory."] + #[doc = "Deletes a directory, also deleting its contents.\n # Arguments\n\n* `archive` - Archive containing the directory.\n * `path` - Path of the directory."] pub fn FSUSER_DeleteDirectoryRecursively(archive: FS_Archive, path: FS_Path) -> Result; } extern "C" { #[must_use] - #[doc = " Creates a file.\n # Arguments\n\n* `archive` - Archive to create the file in.\n * `path` - Path of the file.\n * `attributes` - Attributes of the file.\n * `fileSize` - Size of the file."] + #[doc = "Creates a file.\n # Arguments\n\n* `archive` - Archive to create the file in.\n * `path` - Path of the file.\n * `attributes` - Attributes of the file.\n * `fileSize` - Size of the file."] pub fn FSUSER_CreateFile( archive: FS_Archive, path: FS_Path, @@ -5860,12 +5860,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Creates a directory\n # Arguments\n\n* `archive` - Archive to create the directory in.\n * `path` - Path of the directory.\n * `attributes` - Attributes of the directory."] + #[doc = "Creates a directory\n # Arguments\n\n* `archive` - Archive to create the directory in.\n * `path` - Path of the directory.\n * `attributes` - Attributes of the directory."] pub fn FSUSER_CreateDirectory(archive: FS_Archive, path: FS_Path, attributes: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Renames a directory.\n # Arguments\n\n* `srcArchive` - Archive containing the source directory.\n * `srcPath` - Path of the source directory.\n * `dstArchive` - Archive containing the destination directory.\n * `dstPath` - Path of the destination directory."] + #[doc = "Renames a directory.\n # Arguments\n\n* `srcArchive` - Archive containing the source directory.\n * `srcPath` - Path of the source directory.\n * `dstArchive` - Archive containing the destination directory.\n * `dstPath` - Path of the destination directory."] pub fn FSUSER_RenameDirectory( srcArchive: FS_Archive, srcPath: FS_Path, @@ -5875,17 +5875,17 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Opens a directory.\n # Arguments\n\n* `out` - Pointer to output the directory handle to.\n * `archive` - Archive containing the directory.\n * `path` - Path of the directory."] + #[doc = "Opens a directory.\n # Arguments\n\n* `out` - Pointer to output the directory handle to.\n * `archive` - Archive containing the directory.\n * `path` - Path of the directory."] pub fn FSUSER_OpenDirectory(out: *mut Handle, archive: FS_Archive, path: FS_Path) -> Result; } extern "C" { #[must_use] - #[doc = " Opens an archive.\n # Arguments\n\n* `archive` - Pointer to output the opened archive to.\n * `id` - ID of the archive.\n * `path` - Path of the archive."] + #[doc = "Opens an archive.\n # Arguments\n\n* `archive` - Pointer to output the opened archive to.\n * `id` - ID of the archive.\n * `path` - Path of the archive."] pub fn FSUSER_OpenArchive(archive: *mut FS_Archive, id: FS_ArchiveID, path: FS_Path) -> Result; } extern "C" { #[must_use] - #[doc = " Performs a control operation on an archive.\n # Arguments\n\n* `archive` - Archive to control.\n * `action` - Action to perform.\n * `input` - Buffer to read input from.\n * `inputSize` - Size of the input.\n * `output` - Buffer to write output to.\n * `outputSize` - Size of the output."] + #[doc = "Performs a control operation on an archive.\n # Arguments\n\n* `archive` - Archive to control.\n * `action` - Action to perform.\n * `input` - Buffer to read input from.\n * `inputSize` - Size of the input.\n * `output` - Buffer to write output to.\n * `outputSize` - Size of the output."] pub fn FSUSER_ControlArchive( archive: FS_Archive, action: FS_ArchiveAction, @@ -5897,117 +5897,117 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Closes an archive.\n # Arguments\n\n* `archive` - Archive to close."] + #[doc = "Closes an archive.\n # Arguments\n\n* `archive` - Archive to close."] pub fn FSUSER_CloseArchive(archive: FS_Archive) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the number of free bytes within an archive.\n # Arguments\n\n* `freeBytes` - Pointer to output the free bytes to.\n * `archive` - Archive to check."] + #[doc = "Gets the number of free bytes within an archive.\n # Arguments\n\n* `freeBytes` - Pointer to output the free bytes to.\n * `archive` - Archive to check."] pub fn FSUSER_GetFreeBytes(freeBytes: *mut u64_, archive: FS_Archive) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the inserted card type.\n # Arguments\n\n* `type` - Pointer to output the card type to."] + #[doc = "Gets the inserted card type.\n # Arguments\n\n* `type` - Pointer to output the card type to."] pub fn FSUSER_GetCardType(type_: *mut FS_CardType) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the SDMC archive resource information.\n # Arguments\n\n* `archiveResource` - Pointer to output the archive resource information to."] + #[doc = "Gets the SDMC archive resource information.\n # Arguments\n\n* `archiveResource` - Pointer to output the archive resource information to."] pub fn FSUSER_GetSdmcArchiveResource(archiveResource: *mut FS_ArchiveResource) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the NAND archive resource information.\n # Arguments\n\n* `archiveResource` - Pointer to output the archive resource information to."] + #[doc = "Gets the NAND archive resource information.\n # Arguments\n\n* `archiveResource` - Pointer to output the archive resource information to."] pub fn FSUSER_GetNandArchiveResource(archiveResource: *mut FS_ArchiveResource) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the last SDMC fatfs error.\n # Arguments\n\n* `error` - Pointer to output the error to."] + #[doc = "Gets the last SDMC fatfs error.\n # Arguments\n\n* `error` - Pointer to output the error to."] pub fn FSUSER_GetSdmcFatfsError(error: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets whether an SD card is detected.\n # Arguments\n\n* `detected` - Pointer to output the detection status to."] + #[doc = "Gets whether an SD card is detected.\n # Arguments\n\n* `detected` - Pointer to output the detection status to."] pub fn FSUSER_IsSdmcDetected(detected: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Gets whether the SD card is writable.\n # Arguments\n\n* `writable` - Pointer to output the writable status to."] + #[doc = "Gets whether the SD card is writable.\n # Arguments\n\n* `writable` - Pointer to output the writable status to."] pub fn FSUSER_IsSdmcWritable(writable: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the SDMC CID.\n # Arguments\n\n* `out` - Pointer to output the CID to.\n * `length` - Length of the CID buffer. (should be 0x10)"] + #[doc = "Gets the SDMC CID.\n # Arguments\n\n* `out` - Pointer to output the CID to.\n * `length` - Length of the CID buffer. (should be 0x10)"] pub fn FSUSER_GetSdmcCid(out: *mut u8_, length: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the NAND CID.\n # Arguments\n\n* `out` - Pointer to output the CID to.\n * `length` - Length of the CID buffer. (should be 0x10)"] + #[doc = "Gets the NAND CID.\n # Arguments\n\n* `out` - Pointer to output the CID to.\n * `length` - Length of the CID buffer. (should be 0x10)"] pub fn FSUSER_GetNandCid(out: *mut u8_, length: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the SDMC speed info.\n # Arguments\n\n* `speedInfo` - Pointer to output the speed info to."] + #[doc = "Gets the SDMC speed info.\n # Arguments\n\n* `speedInfo` - Pointer to output the speed info to."] pub fn FSUSER_GetSdmcSpeedInfo(speedInfo: *mut FS_SdMmcSpeedInfo) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the NAND speed info.\n # Arguments\n\n* `speedInfo` - Pointer to output the speed info to."] + #[doc = "Gets the NAND speed info.\n # Arguments\n\n* `speedInfo` - Pointer to output the speed info to."] pub fn FSUSER_GetNandSpeedInfo(speedInfo: *mut FS_SdMmcSpeedInfo) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the SDMC log.\n # Arguments\n\n* `out` - Pointer to output the log to.\n * `length` - Length of the log buffer."] + #[doc = "Gets the SDMC log.\n # Arguments\n\n* `out` - Pointer to output the log to.\n * `length` - Length of the log buffer."] pub fn FSUSER_GetSdmcLog(out: *mut u8_, length: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the NAND log.\n # Arguments\n\n* `out` - Pointer to output the log to.\n * `length` - Length of the log buffer."] + #[doc = "Gets the NAND log.\n # Arguments\n\n* `out` - Pointer to output the log to.\n * `length` - Length of the log buffer."] pub fn FSUSER_GetNandLog(out: *mut u8_, length: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Clears the SDMC log."] + #[doc = "Clears the SDMC log."] pub fn FSUSER_ClearSdmcLog() -> Result; } extern "C" { #[must_use] - #[doc = " Clears the NAND log."] + #[doc = "Clears the NAND log."] pub fn FSUSER_ClearNandLog() -> Result; } extern "C" { #[must_use] - #[doc = " Gets whether a card is inserted.\n # Arguments\n\n* `inserted` - Pointer to output the insertion status to."] + #[doc = "Gets whether a card is inserted.\n # Arguments\n\n* `inserted` - Pointer to output the insertion status to."] pub fn FSUSER_CardSlotIsInserted(inserted: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Powers on the card slot.\n # Arguments\n\n* `status` - Pointer to output the power status to."] + #[doc = "Powers on the card slot.\n # Arguments\n\n* `status` - Pointer to output the power status to."] pub fn FSUSER_CardSlotPowerOn(status: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Powers off the card slot.\n # Arguments\n\n* `status` - Pointer to output the power status to."] + #[doc = "Powers off the card slot.\n # Arguments\n\n* `status` - Pointer to output the power status to."] pub fn FSUSER_CardSlotPowerOff(status: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the card's power status.\n # Arguments\n\n* `status` - Pointer to output the power status to."] + #[doc = "Gets the card's power status.\n # Arguments\n\n* `status` - Pointer to output the power status to."] pub fn FSUSER_CardSlotGetCardIFPowerStatus(status: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Executes a CARDNOR direct command.\n # Arguments\n\n* `commandId` - ID of the command."] + #[doc = "Executes a CARDNOR direct command.\n # Arguments\n\n* `commandId` - ID of the command."] pub fn FSUSER_CardNorDirectCommand(commandId: u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Executes a CARDNOR direct command with an address.\n # Arguments\n\n* `commandId` - ID of the command.\n * `address` - Address to provide."] + #[doc = "Executes a CARDNOR direct command with an address.\n # Arguments\n\n* `commandId` - ID of the command.\n * `address` - Address to provide."] pub fn FSUSER_CardNorDirectCommandWithAddress(commandId: u8_, address: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Executes a CARDNOR direct read.\n # Arguments\n\n* `commandId` - ID of the command.\n * `size` - Size of the output buffer.\n * `output` - Output buffer."] + #[doc = "Executes a CARDNOR direct read.\n # Arguments\n\n* `commandId` - ID of the command.\n * `size` - Size of the output buffer.\n * `output` - Output buffer."] pub fn FSUSER_CardNorDirectRead( commandId: u8_, size: u32_, @@ -6016,7 +6016,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Executes a CARDNOR direct read with an address.\n # Arguments\n\n* `commandId` - ID of the command.\n * `address` - Address to provide.\n * `size` - Size of the output buffer.\n * `output` - Output buffer."] + #[doc = "Executes a CARDNOR direct read with an address.\n # Arguments\n\n* `commandId` - ID of the command.\n * `address` - Address to provide.\n * `size` - Size of the output buffer.\n * `output` - Output buffer."] pub fn FSUSER_CardNorDirectReadWithAddress( commandId: u8_, address: u32_, @@ -6026,7 +6026,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Executes a CARDNOR direct write.\n # Arguments\n\n* `commandId` - ID of the command.\n * `size` - Size of the input buffer.\n * `output` - Input buffer."] + #[doc = "Executes a CARDNOR direct write.\n # Arguments\n\n* `commandId` - ID of the command.\n * `size` - Size of the input buffer.\n * `output` - Input buffer."] pub fn FSUSER_CardNorDirectWrite( commandId: u8_, size: u32_, @@ -6035,7 +6035,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Executes a CARDNOR direct write with an address.\n # Arguments\n\n* `commandId` - ID of the command.\n * `address` - Address to provide.\n * `size` - Size of the input buffer.\n * `input` - Input buffer."] + #[doc = "Executes a CARDNOR direct write with an address.\n # Arguments\n\n* `commandId` - ID of the command.\n * `address` - Address to provide.\n * `size` - Size of the input buffer.\n * `input` - Input buffer."] pub fn FSUSER_CardNorDirectWriteWithAddress( commandId: u8_, address: u32_, @@ -6045,7 +6045,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Executes a CARDNOR 4xIO direct read.\n # Arguments\n\n* `commandId` - ID of the command.\n * `address` - Address to provide.\n * `size` - Size of the output buffer.\n * `output` - Output buffer."] + #[doc = "Executes a CARDNOR 4xIO direct read.\n # Arguments\n\n* `commandId` - ID of the command.\n * `address` - Address to provide.\n * `size` - Size of the output buffer.\n * `output` - Output buffer."] pub fn FSUSER_CardNorDirectRead_4xIO( commandId: u8_, address: u32_, @@ -6055,7 +6055,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Executes a CARDNOR direct CPU write without verify.\n # Arguments\n\n* `address` - Address to provide.\n * `size` - Size of the input buffer.\n * `output` - Input buffer."] + #[doc = "Executes a CARDNOR direct CPU write without verify.\n # Arguments\n\n* `address` - Address to provide.\n * `size` - Size of the input buffer.\n * `output` - Input buffer."] pub fn FSUSER_CardNorDirectCpuWriteWithoutVerify( address: u32_, size: u32_, @@ -6064,37 +6064,37 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Executes a CARDNOR direct sector erase without verify.\n # Arguments\n\n* `address` - Address to provide."] + #[doc = "Executes a CARDNOR direct sector erase without verify.\n # Arguments\n\n* `address` - Address to provide."] pub fn FSUSER_CardNorDirectSectorEraseWithoutVerify(address: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets a process's product info.\n # Arguments\n\n* `info` - Pointer to output the product info to.\n * `processId` - ID of the process."] + #[doc = "Gets a process's product info.\n # Arguments\n\n* `info` - Pointer to output the product info to.\n * `processId` - ID of the process."] pub fn FSUSER_GetProductInfo(info: *mut FS_ProductInfo, processId: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets a process's program launch info.\n # Arguments\n\n* `info` - Pointer to output the program launch info to.\n * `processId` - ID of the process."] + #[doc = "Gets a process's program launch info.\n # Arguments\n\n* `info` - Pointer to output the program launch info to.\n * `processId` - ID of the process."] pub fn FSUSER_GetProgramLaunchInfo(info: *mut FS_ProgramInfo, processId: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the CARDSPI baud rate.\n # Arguments\n\n* `baudRate` - Baud rate to set."] + #[doc = "Sets the CARDSPI baud rate.\n # Arguments\n\n* `baudRate` - Baud rate to set."] pub fn FSUSER_SetCardSpiBaudRate(baudRate: FS_CardSpiBaudRate) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the CARDSPI bus mode.\n # Arguments\n\n* `busMode` - Bus mode to set."] + #[doc = "Sets the CARDSPI bus mode.\n # Arguments\n\n* `busMode` - Bus mode to set."] pub fn FSUSER_SetCardSpiBusMode(busMode: FS_CardSpiBusMode) -> Result; } extern "C" { #[must_use] - #[doc = " Sends initialization info to ARM9."] + #[doc = "Sends initialization info to ARM9."] pub fn FSUSER_SendInitializeInfoTo9() -> Result; } extern "C" { #[must_use] - #[doc = " Gets a special content's index.\n # Arguments\n\n* `index` - Pointer to output the index to.\n * `mediaType` - Media type of the special content.\n * `programId` - Program ID owning the special content.\n * `type` - Type of special content."] + #[doc = "Gets a special content's index.\n # Arguments\n\n* `index` - Pointer to output the index to.\n * `mediaType` - Media type of the special content.\n * `programId` - Program ID owning the special content.\n * `type` - Type of special content."] pub fn FSUSER_GetSpecialContentIndex( index: *mut u16_, mediaType: FS_MediaType, @@ -6104,7 +6104,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets the legacy ROM header of a program.\n # Arguments\n\n* `mediaType` - Media type of the program.\n * `programId` - ID of the program.\n * `header` - Pointer to output the legacy ROM header to. (size = 0x3B4)"] + #[doc = "Gets the legacy ROM header of a program.\n # Arguments\n\n* `mediaType` - Media type of the program.\n * `programId` - ID of the program.\n * `header` - Pointer to output the legacy ROM header to. (size = 0x3B4)"] pub fn FSUSER_GetLegacyRomHeader( mediaType: FS_MediaType, programId: u64_, @@ -6113,7 +6113,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets the legacy banner data of a program.\n # Arguments\n\n* `mediaType` - Media type of the program.\n * `programId` - ID of the program.\n * `header` - Pointer to output the legacy banner data to. (size = 0x23C0)"] + #[doc = "Gets the legacy banner data of a program.\n # Arguments\n\n* `mediaType` - Media type of the program.\n * `programId` - ID of the program.\n * `header` - Pointer to output the legacy banner data to. (size = 0x23C0)"] pub fn FSUSER_GetLegacyBannerData( mediaType: FS_MediaType, programId: u64_, @@ -6122,7 +6122,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Checks a process's authority to access a save data archive.\n # Arguments\n\n* `access` - Pointer to output the access status to.\n * `mediaType` - Media type of the save data.\n * `saveId` - ID of the save data.\n * `processId` - ID of the process to check."] + #[doc = "Checks a process's authority to access a save data archive.\n # Arguments\n\n* `access` - Pointer to output the access status to.\n * `mediaType` - Media type of the save data.\n * `saveId` - ID of the save data.\n * `processId` - ID of the process to check."] pub fn FSUSER_CheckAuthorityToAccessExtSaveData( access: *mut bool, mediaType: FS_MediaType, @@ -6132,7 +6132,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Queries the total quota size of a save data archive.\n # Arguments\n\n* `quotaSize` - Pointer to output the quota size to.\n * `directories` - Number of directories.\n * `files` - Number of files.\n * `fileSizeCount` - Number of file sizes to provide.\n * `fileSizes` - File sizes to provide."] + #[doc = "Queries the total quota size of a save data archive.\n # Arguments\n\n* `quotaSize` - Pointer to output the quota size to.\n * `directories` - Number of directories.\n * `files` - Number of files.\n * `fileSizeCount` - Number of file sizes to provide.\n * `fileSizes` - File sizes to provide."] pub fn FSUSER_QueryTotalQuotaSize( quotaSize: *mut u64_, directories: u32_, @@ -6143,32 +6143,32 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Abnegates an access right.\n # Arguments\n\n* `accessRight` - Access right to abnegate."] + #[doc = "Abnegates an access right.\n # Arguments\n\n* `accessRight` - Access right to abnegate."] pub fn FSUSER_AbnegateAccessRight(accessRight: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Deletes the 3DS SDMC root."] + #[doc = "Deletes the 3DS SDMC root."] pub fn FSUSER_DeleteSdmcRoot() -> Result; } extern "C" { #[must_use] - #[doc = " Deletes all ext save data on the NAND."] + #[doc = "Deletes all ext save data on the NAND."] pub fn FSUSER_DeleteAllExtSaveDataOnNand() -> Result; } extern "C" { #[must_use] - #[doc = " Initializes the CTR file system."] + #[doc = "Initializes the CTR file system."] pub fn FSUSER_InitializeCtrFileSystem() -> Result; } extern "C" { #[must_use] - #[doc = " Creates the FS seed."] + #[doc = "Creates the FS seed."] pub fn FSUSER_CreateSeed() -> Result; } extern "C" { #[must_use] - #[doc = " Retrieves archive format info.\n # Arguments\n\n* `totalSize` - Pointer to output the total size to.\n * `directories` - Pointer to output the number of directories to.\n * `files` - Pointer to output the number of files to.\n * `duplicateData` - Pointer to output whether to duplicate data to.\n * `archiveId` - ID of the archive.\n * `path` - Path of the archive."] + #[doc = "Retrieves archive format info.\n # Arguments\n\n* `totalSize` - Pointer to output the total size to.\n * `directories` - Pointer to output the number of directories to.\n * `files` - Pointer to output the number of files to.\n * `duplicateData` - Pointer to output whether to duplicate data to.\n * `archiveId` - ID of the archive.\n * `path` - Path of the archive."] pub fn FSUSER_GetFormatInfo( totalSize: *mut u32_, directories: *mut u32_, @@ -6180,7 +6180,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets the legacy ROM header of a program.\n # Arguments\n\n* `headerSize` - Size of the ROM header.\n * `mediaType` - Media type of the program.\n * `programId` - ID of the program.\n * `header` - Pointer to output the legacy ROM header to."] + #[doc = "Gets the legacy ROM header of a program.\n # Arguments\n\n* `headerSize` - Size of the ROM header.\n * `mediaType` - Media type of the program.\n * `programId` - ID of the program.\n * `header` - Pointer to output the legacy ROM header to."] pub fn FSUSER_GetLegacyRomHeader2( headerSize: u32_, mediaType: FS_MediaType, @@ -6190,12 +6190,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets the CTR SDMC root path.\n # Arguments\n\n* `out` - Pointer to output the root path to.\n * `length` - Length of the output buffer."] + #[doc = "Gets the CTR SDMC root path.\n # Arguments\n\n* `out` - Pointer to output the root path to.\n * `length` - Length of the output buffer."] pub fn FSUSER_GetSdmcCtrRootPath(out: *mut u8_, length: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets an archive's resource information.\n # Arguments\n\n* `archiveResource` - Pointer to output the archive resource information to.\n * `mediaType` - System media type to check."] + #[doc = "Gets an archive's resource information.\n # Arguments\n\n* `archiveResource` - Pointer to output the archive resource information to.\n * `mediaType` - System media type to check."] pub fn FSUSER_GetArchiveResource( archiveResource: *mut FS_ArchiveResource, mediaType: FS_SystemMediaType, @@ -6203,21 +6203,21 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Exports the integrity verification seed.\n # Arguments\n\n* `seed` - Pointer to output the seed to."] + #[doc = "Exports the integrity verification seed.\n # Arguments\n\n* `seed` - Pointer to output the seed to."] pub fn FSUSER_ExportIntegrityVerificationSeed( seed: *mut FS_IntegrityVerificationSeed, ) -> Result; } extern "C" { #[must_use] - #[doc = " Imports an integrity verification seed.\n # Arguments\n\n* `seed` - Seed to import."] + #[doc = "Imports an integrity verification seed.\n # Arguments\n\n* `seed` - Seed to import."] pub fn FSUSER_ImportIntegrityVerificationSeed( seed: *mut FS_IntegrityVerificationSeed, ) -> Result; } extern "C" { #[must_use] - #[doc = " Formats save data.\n # Arguments\n\n* `archiveId` - ID of the save data archive.\n * `path` - Path of the save data.\n * `blocks` - Size of the save data in blocks. (512 bytes)\n * `directories` - Number of directories.\n * `files` - Number of files.\n * `directoryBuckets` - Directory hash tree bucket count.\n * `fileBuckets` - File hash tree bucket count.\n * `duplicateData` - Whether to store an internal duplicate of the data."] + #[doc = "Formats save data.\n # Arguments\n\n* `archiveId` - ID of the save data archive.\n * `path` - Path of the save data.\n * `blocks` - Size of the save data in blocks. (512 bytes)\n * `directories` - Number of directories.\n * `files` - Number of files.\n * `directoryBuckets` - Directory hash tree bucket count.\n * `fileBuckets` - File hash tree bucket count.\n * `duplicateData` - Whether to store an internal duplicate of the data."] pub fn FSUSER_FormatSaveData( archiveId: FS_ArchiveID, path: FS_Path, @@ -6231,7 +6231,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets the legacy sub banner data of a program.\n # Arguments\n\n* `bannerSize` - Size of the banner.\n * `mediaType` - Media type of the program.\n * `programId` - ID of the program.\n * `header` - Pointer to output the legacy sub banner data to."] + #[doc = "Gets the legacy sub banner data of a program.\n # Arguments\n\n* `bannerSize` - Size of the banner.\n * `mediaType` - Media type of the program.\n * `programId` - ID of the program.\n * `header` - Pointer to output the legacy sub banner data to."] pub fn FSUSER_GetLegacySubBannerData( bannerSize: u32_, mediaType: FS_MediaType, @@ -6241,7 +6241,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Hashes the given data and outputs a SHA256 hash.\n # Arguments\n\n* `data` - Pointer to the data to be hashed.\n * `inputSize` - The size of the data.\n * `hash` - Hash output pointer."] + #[doc = "Hashes the given data and outputs a SHA256 hash.\n # Arguments\n\n* `data` - Pointer to the data to be hashed.\n * `inputSize` - The size of the data.\n * `hash` - Hash output pointer."] pub fn FSUSER_UpdateSha256Context( data: *const ::libc::c_void, inputSize: u32_, @@ -6250,7 +6250,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Reads from a special file.\n # Arguments\n\n* `bytesRead` - Pointer to output the number of bytes read to.\n * `fileOffset` - Offset of the file.\n * `size` - Size of the buffer.\n * `data` - Buffer to read to."] + #[doc = "Reads from a special file.\n # Arguments\n\n* `bytesRead` - Pointer to output the number of bytes read to.\n * `fileOffset` - Offset of the file.\n * `size` - Size of the buffer.\n * `data` - Buffer to read to."] pub fn FSUSER_ReadSpecialFile( bytesRead: *mut u32_, fileOffset: u64_, @@ -6260,12 +6260,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets the size of a special file.\n # Arguments\n\n* `fileSize` - Pointer to output the size to."] + #[doc = "Gets the size of a special file.\n # Arguments\n\n* `fileSize` - Pointer to output the size to."] pub fn FSUSER_GetSpecialFileSize(fileSize: *mut u64_) -> Result; } extern "C" { #[must_use] - #[doc = " Creates ext save data.\n # Arguments\n\n* `info` - Info of the save data.\n * `directories` - Number of directories.\n * `files` - Number of files.\n * `sizeLimit` - Size limit of the save data.\n * `smdhSize` - Size of the save data's SMDH data.\n * `smdh` - SMDH data."] + #[doc = "Creates ext save data.\n # Arguments\n\n* `info` - Info of the save data.\n * `directories` - Number of directories.\n * `files` - Number of files.\n * `sizeLimit` - Size limit of the save data.\n * `smdhSize` - Size of the save data's SMDH data.\n * `smdh` - SMDH data."] pub fn FSUSER_CreateExtSaveData( info: FS_ExtSaveDataInfo, directories: u32_, @@ -6277,12 +6277,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Deletes ext save data.\n # Arguments\n\n* `info` - Info of the save data."] + #[doc = "Deletes ext save data.\n # Arguments\n\n* `info` - Info of the save data."] pub fn FSUSER_DeleteExtSaveData(info: FS_ExtSaveDataInfo) -> Result; } extern "C" { #[must_use] - #[doc = " Reads the SMDH icon of ext save data.\n # Arguments\n\n* `bytesRead` - Pointer to output the number of bytes read to.\n * `info` - Info of the save data.\n * `smdhSize` - Size of the save data SMDH.\n * `smdh` - Pointer to output SMDH data to."] + #[doc = "Reads the SMDH icon of ext save data.\n # Arguments\n\n* `bytesRead` - Pointer to output the number of bytes read to.\n * `info` - Info of the save data.\n * `smdhSize` - Size of the save data SMDH.\n * `smdh` - Pointer to output SMDH data to."] pub fn FSUSER_ReadExtSaveDataIcon( bytesRead: *mut u32_, info: FS_ExtSaveDataInfo, @@ -6292,7 +6292,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets an ext data archive's block information.\n # Arguments\n\n* `totalBlocks` - Pointer to output the total blocks to.\n * `freeBlocks` - Pointer to output the free blocks to.\n * `blockSize` - Pointer to output the block size to.\n * `info` - Info of the save data."] + #[doc = "Gets an ext data archive's block information.\n # Arguments\n\n* `totalBlocks` - Pointer to output the total blocks to.\n * `freeBlocks` - Pointer to output the free blocks to.\n * `blockSize` - Pointer to output the block size to.\n * `info` - Info of the save data."] pub fn FSUSER_GetExtDataBlockSize( totalBlocks: *mut u64_, freeBlocks: *mut u64_, @@ -6302,7 +6302,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Enumerates ext save data.\n # Arguments\n\n* `idsWritten` - Pointer to output the number of IDs written to.\n * `idsSize` - Size of the IDs buffer.\n * `mediaType` - Media type to enumerate over.\n * `idSize` - Size of each ID element.\n * `shared` - Whether to enumerate shared ext save data.\n * `ids` - Pointer to output IDs to."] + #[doc = "Enumerates ext save data.\n # Arguments\n\n* `idsWritten` - Pointer to output the number of IDs written to.\n * `idsSize` - Size of the IDs buffer.\n * `mediaType` - Media type to enumerate over.\n * `idSize` - Size of each ID element.\n * `shared` - Whether to enumerate shared ext save data.\n * `ids` - Pointer to output IDs to."] pub fn FSUSER_EnumerateExtSaveData( idsWritten: *mut u32_, idsSize: u32_, @@ -6314,7 +6314,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Creates system save data.\n # Arguments\n\n* `info` - Info of the save data.\n * `totalSize` - Total size of the save data.\n * `blockSize` - Block size of the save data. (usually 0x1000)\n * `directories` - Number of directories.\n * `files` - Number of files.\n * `directoryBuckets` - Directory hash tree bucket count.\n * `fileBuckets` - File hash tree bucket count.\n * `duplicateData` - Whether to store an internal duplicate of the data."] + #[doc = "Creates system save data.\n # Arguments\n\n* `info` - Info of the save data.\n * `totalSize` - Total size of the save data.\n * `blockSize` - Block size of the save data. (usually 0x1000)\n * `directories` - Number of directories.\n * `files` - Number of files.\n * `directoryBuckets` - Directory hash tree bucket count.\n * `fileBuckets` - File hash tree bucket count.\n * `duplicateData` - Whether to store an internal duplicate of the data."] pub fn FSUSER_CreateSystemSaveData( info: FS_SystemSaveDataInfo, totalSize: u32_, @@ -6328,17 +6328,17 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Deletes system save data.\n # Arguments\n\n* `info` - Info of the save data."] + #[doc = "Deletes system save data.\n # Arguments\n\n* `info` - Info of the save data."] pub fn FSUSER_DeleteSystemSaveData(info: FS_SystemSaveDataInfo) -> Result; } extern "C" { #[must_use] - #[doc = " Initiates a device move as the source device.\n # Arguments\n\n* `context` - Pointer to output the context to."] + #[doc = "Initiates a device move as the source device.\n # Arguments\n\n* `context` - Pointer to output the context to."] pub fn FSUSER_StartDeviceMoveAsSource(context: *mut FS_DeviceMoveContext) -> Result; } extern "C" { #[must_use] - #[doc = " Initiates a device move as the destination device.\n # Arguments\n\n* `context` - Context to use.\n * `clear` - Whether to clear the device's data first."] + #[doc = "Initiates a device move as the destination device.\n # Arguments\n\n* `context` - Context to use.\n * `clear` - Whether to clear the device's data first."] pub fn FSUSER_StartDeviceMoveAsDestination( context: FS_DeviceMoveContext, clear: bool, @@ -6346,27 +6346,27 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Sets an archive's priority.\n # Arguments\n\n* `archive` - Archive to use.\n * `priority` - Priority to set."] + #[doc = "Sets an archive's priority.\n # Arguments\n\n* `archive` - Archive to use.\n * `priority` - Priority to set."] pub fn FSUSER_SetArchivePriority(archive: FS_Archive, priority: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets an archive's priority.\n # Arguments\n\n* `priority` - Pointer to output the priority to.\n * `archive` - Archive to use."] + #[doc = "Gets an archive's priority.\n # Arguments\n\n* `priority` - Pointer to output the priority to.\n * `archive` - Archive to use."] pub fn FSUSER_GetArchivePriority(priority: *mut u32_, archive: FS_Archive) -> Result; } extern "C" { #[must_use] - #[doc = " Configures CTRCARD latency emulation.\n # Arguments\n\n* `latency` - Latency to apply, in milliseconds.\n * `emulateEndurance` - Whether to emulate card endurance."] + #[doc = "Configures CTRCARD latency emulation.\n # Arguments\n\n* `latency` - Latency to apply, in milliseconds.\n * `emulateEndurance` - Whether to emulate card endurance."] pub fn FSUSER_SetCtrCardLatencyParameter(latency: u64_, emulateEndurance: bool) -> Result; } extern "C" { #[must_use] - #[doc = " Toggles cleaning up invalid save data.\n # Arguments\n\n* `enable` - Whether to enable cleaning up invalid save data."] + #[doc = "Toggles cleaning up invalid save data.\n # Arguments\n\n* `enable` - Whether to enable cleaning up invalid save data."] pub fn FSUSER_SwitchCleanupInvalidSaveData(enable: bool) -> Result; } extern "C" { #[must_use] - #[doc = " Enumerates system save data.\n # Arguments\n\n* `idsWritten` - Pointer to output the number of IDs written to.\n * `idsSize` - Size of the IDs buffer.\n * `ids` - Pointer to output IDs to."] + #[doc = "Enumerates system save data.\n # Arguments\n\n* `idsWritten` - Pointer to output the number of IDs written to.\n * `idsSize` - Size of the IDs buffer.\n * `ids` - Pointer to output IDs to."] pub fn FSUSER_EnumerateSystemSaveData( idsWritten: *mut u32_, idsSize: u32_, @@ -6375,22 +6375,22 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Initializes a FSUSER session with an SDK version.\n # Arguments\n\n* `session` - The handle of the FSUSER session to initialize.\n * `version` - SDK version to initialize with."] + #[doc = "Initializes a FSUSER session with an SDK version.\n # Arguments\n\n* `session` - The handle of the FSUSER session to initialize.\n * `version` - SDK version to initialize with."] pub fn FSUSER_InitializeWithSdkVersion(session: Handle, version: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the file system priority.\n # Arguments\n\n* `priority` - Priority to set."] + #[doc = "Sets the file system priority.\n # Arguments\n\n* `priority` - Priority to set."] pub fn FSUSER_SetPriority(priority: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the file system priority.\n # Arguments\n\n* `priority` - Pointer to output the priority to."] + #[doc = "Gets the file system priority.\n # Arguments\n\n* `priority` - Pointer to output the priority to."] pub fn FSUSER_GetPriority(priority: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the save data secure value.\n # Arguments\n\n* `value` - Secure value to set.\n * `slot` - Slot of the secure value.\n * `titleUniqueId` - Unique ID of the title. (default = 0)\n * `titleVariation` - Variation of the title. (default = 0)"] + #[doc = "Sets the save data secure value.\n # Arguments\n\n* `value` - Secure value to set.\n * `slot` - Slot of the secure value.\n * `titleUniqueId` - Unique ID of the title. (default = 0)\n * `titleVariation` - Variation of the title. (default = 0)"] pub fn FSUSER_SetSaveDataSecureValue( value: u64_, slot: FS_SecureValueSlot, @@ -6400,7 +6400,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets the save data secure value.\n # Arguments\n\n* `exists` - Pointer to output whether the secure value exists to.\n * `value` - Pointer to output the secure value to.\n * `slot` - Slot of the secure value.\n * `titleUniqueId` - Unique ID of the title. (default = 0)\n * `titleVariation` - Variation of the title. (default = 0)"] + #[doc = "Gets the save data secure value.\n # Arguments\n\n* `exists` - Pointer to output whether the secure value exists to.\n * `value` - Pointer to output the secure value to.\n * `slot` - Slot of the secure value.\n * `titleUniqueId` - Unique ID of the title. (default = 0)\n * `titleVariation` - Variation of the title. (default = 0)"] pub fn FSUSER_GetSaveDataSecureValue( exists: *mut bool, value: *mut u64_, @@ -6411,7 +6411,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Performs a control operation on a secure save.\n # Arguments\n\n* `action` - Action to perform.\n * `input` - Buffer to read input from.\n * `inputSize` - Size of the input.\n * `output` - Buffer to write output to.\n * `outputSize` - Size of the output."] + #[doc = "Performs a control operation on a secure save.\n # Arguments\n\n* `action` - Action to perform.\n * `input` - Buffer to read input from.\n * `inputSize` - Size of the input.\n * `output` - Buffer to write output to.\n * `outputSize` - Size of the output."] pub fn FSUSER_ControlSecureSave( action: FS_SecureSaveAction, input: *mut ::libc::c_void, @@ -6422,12 +6422,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets the media type of the current application.\n # Arguments\n\n* `mediaType` - Pointer to output the media type to."] + #[doc = "Gets the media type of the current application.\n # Arguments\n\n* `mediaType` - Pointer to output the media type to."] pub fn FSUSER_GetMediaType(mediaType: *mut FS_MediaType) -> Result; } extern "C" { #[must_use] - #[doc = " Performs a control operation on a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `action` - Action to perform.\n * `input` - Buffer to read input from.\n * `inputSize` - Size of the input.\n * `output` - Buffer to write output to.\n * `outputSize` - Size of the output."] + #[doc = "Performs a control operation on a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `action` - Action to perform.\n * `input` - Buffer to read input from.\n * `inputSize` - Size of the input.\n * `output` - Buffer to write output to.\n * `outputSize` - Size of the output."] pub fn FSFILE_Control( handle: Handle, action: FS_FileAction, @@ -6439,7 +6439,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Opens a handle to a sub-section of a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `subFile` - Pointer to output the sub-file to.\n * `offset` - Offset of the sub-section.\n * `size` - Size of the sub-section."] + #[doc = "Opens a handle to a sub-section of a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `subFile` - Pointer to output the sub-file to.\n * `offset` - Offset of the sub-section.\n * `size` - Size of the sub-section."] pub fn FSFILE_OpenSubFile( handle: Handle, subFile: *mut Handle, @@ -6449,7 +6449,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Reads from a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `bytesRead` - Pointer to output the number of bytes read to.\n * `offset` - Offset to read from.\n * `buffer` - Buffer to read to.\n * `size` - Size of the buffer."] + #[doc = "Reads from a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `bytesRead` - Pointer to output the number of bytes read to.\n * `offset` - Offset to read from.\n * `buffer` - Buffer to read to.\n * `size` - Size of the buffer."] pub fn FSFILE_Read( handle: Handle, bytesRead: *mut u32_, @@ -6460,7 +6460,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Writes to a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `bytesWritten` - Pointer to output the number of bytes written to.\n * `offset` - Offset to write to.\n * `buffer` - Buffer to write from.\n * `size` - Size of the buffer.\n * `flags` - Flags to use when writing."] + #[doc = "Writes to a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `bytesWritten` - Pointer to output the number of bytes written to.\n * `offset` - Offset to write to.\n * `buffer` - Buffer to write from.\n * `size` - Size of the buffer.\n * `flags` - Flags to use when writing."] pub fn FSFILE_Write( handle: Handle, bytesWritten: *mut u32_, @@ -6472,52 +6472,52 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets the size of a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `size` - Pointer to output the size to."] + #[doc = "Gets the size of a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `size` - Pointer to output the size to."] pub fn FSFILE_GetSize(handle: Handle, size: *mut u64_) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the size of a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `size` - Size to set."] + #[doc = "Sets the size of a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `size` - Size to set."] pub fn FSFILE_SetSize(handle: Handle, size: u64_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the attributes of a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `attributes` - Pointer to output the attributes to."] + #[doc = "Gets the attributes of a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `attributes` - Pointer to output the attributes to."] pub fn FSFILE_GetAttributes(handle: Handle, attributes: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the attributes of a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `attributes` - Attributes to set."] + #[doc = "Sets the attributes of a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `attributes` - Attributes to set."] pub fn FSFILE_SetAttributes(handle: Handle, attributes: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Closes a file.\n # Arguments\n\n* `handle` - Handle of the file."] + #[doc = "Closes a file.\n # Arguments\n\n* `handle` - Handle of the file."] pub fn FSFILE_Close(handle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Flushes a file's contents.\n # Arguments\n\n* `handle` - Handle of the file."] + #[doc = "Flushes a file's contents.\n # Arguments\n\n* `handle` - Handle of the file."] pub fn FSFILE_Flush(handle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Sets a file's priority.\n # Arguments\n\n* `handle` - Handle of the file.\n * `priority` - Priority to set."] + #[doc = "Sets a file's priority.\n # Arguments\n\n* `handle` - Handle of the file.\n * `priority` - Priority to set."] pub fn FSFILE_SetPriority(handle: Handle, priority: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets a file's priority.\n # Arguments\n\n* `handle` - Handle of the file.\n * `priority` - Pointer to output the priority to."] + #[doc = "Gets a file's priority.\n # Arguments\n\n* `handle` - Handle of the file.\n * `priority` - Pointer to output the priority to."] pub fn FSFILE_GetPriority(handle: Handle, priority: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Opens a duplicate handle to a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `linkFile` - Pointer to output the link handle to."] + #[doc = "Opens a duplicate handle to a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `linkFile` - Pointer to output the link handle to."] pub fn FSFILE_OpenLinkFile(handle: Handle, linkFile: *mut Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Performs a control operation on a directory.\n # Arguments\n\n* `handle` - Handle of the directory.\n * `action` - Action to perform.\n * `input` - Buffer to read input from.\n * `inputSize` - Size of the input.\n * `output` - Buffer to write output to.\n * `outputSize` - Size of the output."] + #[doc = "Performs a control operation on a directory.\n # Arguments\n\n* `handle` - Handle of the directory.\n * `action` - Action to perform.\n * `input` - Buffer to read input from.\n * `inputSize` - Size of the input.\n * `output` - Buffer to write output to.\n * `outputSize` - Size of the output."] pub fn FSDIR_Control( handle: Handle, action: FS_DirectoryAction, @@ -6529,7 +6529,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Reads one or more directory entries.\n # Arguments\n\n* `handle` - Handle of the directory.\n * `entriesRead` - Pointer to output the number of entries read to.\n * `entryCount` - Number of entries to read.\n * `entryOut` - Pointer to output directory entries to."] + #[doc = "Reads one or more directory entries.\n # Arguments\n\n* `handle` - Handle of the directory.\n * `entriesRead` - Pointer to output the number of entries read to.\n * `entryCount` - Number of entries to read.\n * `entryOut` - Pointer to output directory entries to."] pub fn FSDIR_Read( handle: Handle, entriesRead: *mut u32_, @@ -6539,20 +6539,20 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Closes a directory.\n # Arguments\n\n* `handle` - Handle of the directory."] + #[doc = "Closes a directory.\n # Arguments\n\n* `handle` - Handle of the directory."] pub fn FSDIR_Close(handle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Sets a directory's priority.\n # Arguments\n\n* `handle` - Handle of the directory.\n * `priority` - Priority to set."] + #[doc = "Sets a directory's priority.\n # Arguments\n\n* `handle` - Handle of the directory.\n * `priority` - Priority to set."] pub fn FSDIR_SetPriority(handle: Handle, priority: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets a directory's priority.\n # Arguments\n\n* `handle` - Handle of the directory.\n * `priority` - Pointer to output the priority to."] + #[doc = "Gets a directory's priority.\n # Arguments\n\n* `handle` - Handle of the directory.\n * `priority` - Pointer to output the priority to."] pub fn FSDIR_GetPriority(handle: Handle, priority: *mut u32_) -> Result; } -#[doc = " Contains basic information about a title."] +#[doc = "Contains basic information about a title."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct AM_TitleEntry { @@ -6569,7 +6569,7 @@ pub struct AM_TitleEntry { pub const AM_STATUS_MASK_INSTALLING: _bindgen_ty_13 = 1; #[doc = "< Titles awaiting finalization."] pub const AM_STATUS_MASK_AWAITING_FINALIZATION: _bindgen_ty_13 = 2; -#[doc = " Pending title status mask values."] +#[doc = "Pending title status mask values."] pub type _bindgen_ty_13 = ::libc::c_uint; #[doc = "< Install aborted."] pub const AM_STATUS_ABORTED: AM_InstallStatus = 2; @@ -6579,7 +6579,7 @@ pub const AM_STATUS_SAVED: AM_InstallStatus = 3; pub const AM_STATUS_INSTALL_IN_PROGRESS: AM_InstallStatus = 2050; #[doc = "< Awaiting finalization."] pub const AM_STATUS_AWAITING_FINALIZATION: AM_InstallStatus = 2051; -#[doc = " Pending title status values."] +#[doc = "Pending title status values."] pub type AM_InstallStatus = ::libc::c_uint; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] @@ -6599,9 +6599,9 @@ pub struct AM_PendingTitleEntry { pub const AM_DELETE_PENDING_NON_SYSTEM: _bindgen_ty_14 = 1; #[doc = "< System titles."] pub const AM_DELETE_PENDING_SYSTEM: _bindgen_ty_14 = 2; -#[doc = " Pending title deletion flags."] +#[doc = "Pending title deletion flags."] pub type _bindgen_ty_14 = ::libc::c_uint; -#[doc = " Information about the TWL NAND partition."] +#[doc = "Information about the TWL NAND partition."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct AM_TWLPartitionInfo { @@ -6614,7 +6614,7 @@ pub struct AM_TWLPartitionInfo { #[doc = "< Free space for titles."] pub titlesFreeSpace: u64_, } -#[doc = " Contains information about a title's content."] +#[doc = "Contains information about a title's content."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct AM_ContentInfo { @@ -6635,34 +6635,34 @@ pub struct AM_ContentInfo { pub const AM_CONTENT_DOWNLOADED: AM_ContentInfoFlags = 1; #[doc = "< ?"] pub const AM_CONTENT_OWNED: AM_ContentInfoFlags = 2; -#[doc = " Title ContentInfo flags."] +#[doc = "Title ContentInfo flags."] pub type AM_ContentInfoFlags = ::libc::c_uint; extern "C" { #[must_use] - #[doc = " Initializes AM. This doesn't initialize with \"am:app\", see amAppInit()."] + #[doc = "Initializes AM. This doesn't initialize with \"am:app\", see amAppInit()."] pub fn amInit() -> Result; } extern "C" { #[must_use] - #[doc = " Initializes AM with a service which has access to the amapp-commands. This should only be used when using the amapp commands, not non-amapp AM commands."] + #[doc = "Initializes AM with a service which has access to the amapp-commands. This should only be used when using the amapp commands, not non-amapp AM commands."] pub fn amAppInit() -> Result; } extern "C" { - #[doc = " Exits AM."] + #[doc = "Exits AM."] pub fn amExit(); } extern "C" { - #[doc = " Gets the current AM session handle."] + #[doc = "Gets the current AM session handle."] pub fn amGetSessionHandle() -> *mut Handle; } extern "C" { #[must_use] - #[doc = " Gets the number of titles for a given media type.\n # Arguments\n\n* `mediatype` - Media type to get titles from.\n * `count` (direction out) - Pointer to write the title count to."] + #[doc = "Gets the number of titles for a given media type.\n # Arguments\n\n* `mediatype` - Media type to get titles from.\n * `count` (direction out) - Pointer to write the title count to."] pub fn AM_GetTitleCount(mediatype: FS_MediaType, count: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets a list of title IDs present in a mediatype.\n # Arguments\n\n* `titlesRead` (direction out) - Pointer to output the number of read titles to.\n * `mediatype` - Media type to get titles from.\n * `titleCount` - Number of title IDs to get.\n * `titleIds` - Buffer to output the retrieved title IDs to."] + #[doc = "Gets a list of title IDs present in a mediatype.\n # Arguments\n\n* `titlesRead` (direction out) - Pointer to output the number of read titles to.\n * `mediatype` - Media type to get titles from.\n * `titleCount` - Number of title IDs to get.\n * `titleIds` - Buffer to output the retrieved title IDs to."] pub fn AM_GetTitleList( titlesRead: *mut u32_, mediatype: FS_MediaType, @@ -6672,7 +6672,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets a list of details about installed titles.\n # Arguments\n\n* `mediatype` - Media type to get titles from.\n * `titleCount` - Number of titles to list.\n * `titleIds` - List of title IDs to retrieve details for.\n * `titleInfo` - Buffer to write AM_TitleEntry's to."] + #[doc = "Gets a list of details about installed titles.\n # Arguments\n\n* `mediatype` - Media type to get titles from.\n * `titleCount` - Number of titles to list.\n * `titleIds` - List of title IDs to retrieve details for.\n * `titleInfo` - Buffer to write AM_TitleEntry's to."] pub fn AM_GetTitleInfo( mediatype: FS_MediaType, titleCount: u32_, @@ -6682,12 +6682,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets the number of tickets installed on the system.\n # Arguments\n\n* `count` (direction out) - Pointer to output the ticket count to."] + #[doc = "Gets the number of tickets installed on the system.\n # Arguments\n\n* `count` (direction out) - Pointer to output the ticket count to."] pub fn AM_GetTicketCount(count: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets a list of tickets installed on the system.\n # Arguments\n\n* `ticketsRead` (direction out) - Pointer to output the number of read tickets to.\n * `ticketCount` - Number of tickets to read.\n * `skip` - Number of tickets to skip.\n * `ticketIds` - Buffer to output the retrieved ticket IDs to."] + #[doc = "Gets a list of tickets installed on the system.\n # Arguments\n\n* `ticketsRead` (direction out) - Pointer to output the number of read tickets to.\n * `ticketCount` - Number of tickets to read.\n * `skip` - Number of tickets to skip.\n * `ticketIds` - Buffer to output the retrieved ticket IDs to."] pub fn AM_GetTicketList( ticketsRead: *mut u32_, ticketCount: u32_, @@ -6697,7 +6697,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets the number of pending titles on this system.\n # Arguments\n\n* `count` (direction out) - Pointer to output the pending title count to.\n * `mediatype` - Media type of pending titles to count.\n * `statusMask` - Bit mask of status values to include."] + #[doc = "Gets the number of pending titles on this system.\n # Arguments\n\n* `count` (direction out) - Pointer to output the pending title count to.\n * `mediatype` - Media type of pending titles to count.\n * `statusMask` - Bit mask of status values to include."] pub fn AM_GetPendingTitleCount( count: *mut u32_, mediatype: FS_MediaType, @@ -6706,7 +6706,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets a list of pending titles on this system.\n # Arguments\n\n* `titlesRead` (direction out) - Pointer to output the number of read pending titles to.\n * `titleCount` - Number of pending titles to read.\n * `mediatype` - Media type of pending titles to list.\n * `statusMask` - Bit mask of status values to include.\n * `titleIds` - Buffer to output the retrieved pending title IDs to."] + #[doc = "Gets a list of pending titles on this system.\n # Arguments\n\n* `titlesRead` (direction out) - Pointer to output the number of read pending titles to.\n * `titleCount` - Number of pending titles to read.\n * `mediatype` - Media type of pending titles to list.\n * `statusMask` - Bit mask of status values to include.\n * `titleIds` - Buffer to output the retrieved pending title IDs to."] pub fn AM_GetPendingTitleList( titlesRead: *mut u32_, titleCount: u32_, @@ -6717,7 +6717,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets information about pending titles on this system.\n # Arguments\n\n* `titleCount` - Number of pending titles to read.\n * `mediatype` - Media type of pending titles to get information on.\n * `titleIds` - IDs of the titles to get information about.\n * `titleInfo` - Buffer to output the retrieved pending title info to."] + #[doc = "Gets information about pending titles on this system.\n # Arguments\n\n* `titleCount` - Number of pending titles to read.\n * `mediatype` - Media type of pending titles to get information on.\n * `titleIds` - IDs of the titles to get information about.\n * `titleInfo` - Buffer to output the retrieved pending title info to."] pub fn AM_GetPendingTitleInfo( titleCount: u32_, mediatype: FS_MediaType, @@ -6727,12 +6727,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets a 32-bit device-specific ID.\n # Arguments\n\n* `deviceID` - Pointer to write the device ID to."] + #[doc = "Gets a 32-bit device-specific ID.\n # Arguments\n\n* `deviceID` - Pointer to write the device ID to."] pub fn AM_GetDeviceId(deviceID: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Exports DSiWare to the specified filepath.\n # Arguments\n\n* `titleID` - TWL titleID.\n * `operation` - DSiWare operation type.\n * `workbuf` - Work buffer.\n * `workbuf_size` - Work buffer size, must be >=0x20000.\n * `filepath` - UTF-8 filepath(converted to UTF-16 internally)."] + #[doc = "Exports DSiWare to the specified filepath.\n # Arguments\n\n* `titleID` - TWL titleID.\n * `operation` - DSiWare operation type.\n * `workbuf` - Work buffer.\n * `workbuf_size` - Work buffer size, must be >=0x20000.\n * `filepath` - UTF-8 filepath(converted to UTF-16 internally)."] pub fn AM_ExportTwlBackup( titleID: u64_, operation: u8_, @@ -6743,7 +6743,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Imports DSiWare from the specified file.\n # Arguments\n\n* `filehandle` - FSUSER file handle.\n * `operation` - DSiWare operation type.\n * `buffer` - Work buffer.\n * `size` - Buffer size, must be >=0x20000."] + #[doc = "Imports DSiWare from the specified file.\n # Arguments\n\n* `filehandle` - FSUSER file handle.\n * `operation` - DSiWare operation type.\n * `buffer` - Work buffer.\n * `size` - Buffer size, must be >=0x20000."] pub fn AM_ImportTwlBackup( filehandle: Handle, operation: u8_, @@ -6753,7 +6753,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Reads info from the specified DSiWare export file. This can only be used with DSiWare exported with certain operation value(s).\n # Arguments\n\n* `filehandle` - FSUSER file handle.\n * `outinfo` - Output info buffer.\n * `outinfo_size` - Output info buffer size.\n * `workbuf` - Work buffer.\n * `workbuf_size` - Work buffer size.\n * `banner` - Output banner buffer.\n * `banner_size` - Output banner buffer size."] + #[doc = "Reads info from the specified DSiWare export file. This can only be used with DSiWare exported with certain operation value(s).\n # Arguments\n\n* `filehandle` - FSUSER file handle.\n * `outinfo` - Output info buffer.\n * `outinfo_size` - Output info buffer size.\n * `workbuf` - Work buffer.\n * `workbuf_size` - Work buffer size.\n * `banner` - Output banner buffer.\n * `banner_size` - Output banner buffer size."] pub fn AM_ReadTwlBackupInfo( filehandle: Handle, outinfo: *mut ::libc::c_void, @@ -6766,37 +6766,37 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Retrieves information about the NAND TWL partition.\n # Arguments\n\n* `info` (direction out) - Pointer to output the TWL partition info to."] + #[doc = "Retrieves information about the NAND TWL partition.\n # Arguments\n\n* `info` (direction out) - Pointer to output the TWL partition info to."] pub fn AM_GetTWLPartitionInfo(info: *mut AM_TWLPartitionInfo) -> Result; } extern "C" { #[must_use] - #[doc = " Initializes the CIA install process, returning a handle to write CIA data to.\n # Arguments\n\n* `mediatype` - Media type to install the CIA to.\n * `ciaHandle` (direction out) - Pointer to write the CIA handle to."] + #[doc = "Initializes the CIA install process, returning a handle to write CIA data to.\n # Arguments\n\n* `mediatype` - Media type to install the CIA to.\n * `ciaHandle` (direction out) - Pointer to write the CIA handle to."] pub fn AM_StartCiaInstall(mediatype: FS_MediaType, ciaHandle: *mut Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Initializes the CIA install process for Download Play CIAs, returning a handle to write CIA data to.\n # Arguments\n\n* `ciaHandle` (direction out) - Pointer to write the CIA handle to."] + #[doc = "Initializes the CIA install process for Download Play CIAs, returning a handle to write CIA data to.\n # Arguments\n\n* `ciaHandle` (direction out) - Pointer to write the CIA handle to."] pub fn AM_StartDlpChildCiaInstall(ciaHandle: *mut Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Aborts the CIA install process.\n # Arguments\n\n* `ciaHandle` - CIA handle to cancel."] + #[doc = "Aborts the CIA install process.\n # Arguments\n\n* `ciaHandle` - CIA handle to cancel."] pub fn AM_CancelCIAInstall(ciaHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Finalizes the CIA install process.\n # Arguments\n\n* `ciaHandle` - CIA handle to finalize."] + #[doc = "Finalizes the CIA install process.\n # Arguments\n\n* `ciaHandle` - CIA handle to finalize."] pub fn AM_FinishCiaInstall(ciaHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Finalizes the CIA install process without committing the title to title.db or tmp*.db.\n # Arguments\n\n* `ciaHandle` - CIA handle to finalize."] + #[doc = "Finalizes the CIA install process without committing the title to title.db or tmp*.db.\n # Arguments\n\n* `ciaHandle` - CIA handle to finalize."] pub fn AM_FinishCiaInstallWithoutCommit(ciaHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Commits installed CIAs.\n # Arguments\n\n* `mediaType` - Location of the titles to finalize.\n * `titleCount` - Number of titles to finalize.\n * `temp` - Whether the titles being finalized are in the temporary database.\n * `titleIds` - Title IDs to finalize."] + #[doc = "Commits installed CIAs.\n # Arguments\n\n* `mediaType` - Location of the titles to finalize.\n * `titleCount` - Number of titles to finalize.\n * `temp` - Whether the titles being finalized are in the temporary database.\n * `titleIds` - Title IDs to finalize."] pub fn AM_CommitImportPrograms( mediaType: FS_MediaType, titleCount: u32_, @@ -6806,47 +6806,47 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Deletes a title.\n # Arguments\n\n* `mediatype` - Media type to delete from.\n * `titleID` - ID of the title to delete."] + #[doc = "Deletes a title.\n # Arguments\n\n* `mediatype` - Media type to delete from.\n * `titleID` - ID of the title to delete."] pub fn AM_DeleteTitle(mediatype: FS_MediaType, titleID: u64_) -> Result; } extern "C" { #[must_use] - #[doc = " Deletes a title, provided that it is not a system title.\n # Arguments\n\n* `mediatype` - Media type to delete from.\n * `titleID` - ID of the title to delete."] + #[doc = "Deletes a title, provided that it is not a system title.\n # Arguments\n\n* `mediatype` - Media type to delete from.\n * `titleID` - ID of the title to delete."] pub fn AM_DeleteAppTitle(mediatype: FS_MediaType, titleID: u64_) -> Result; } extern "C" { #[must_use] - #[doc = " Deletes a ticket.\n # Arguments\n\n* `titleID` - ID of the ticket to delete."] + #[doc = "Deletes a ticket.\n # Arguments\n\n* `titleID` - ID of the ticket to delete."] pub fn AM_DeleteTicket(ticketId: u64_) -> Result; } extern "C" { #[must_use] - #[doc = " Deletes a pending title.\n # Arguments\n\n* `mediatype` - Media type to delete from.\n * `titleId` - ID of the pending title to delete."] + #[doc = "Deletes a pending title.\n # Arguments\n\n* `mediatype` - Media type to delete from.\n * `titleId` - ID of the pending title to delete."] pub fn AM_DeletePendingTitle(mediatype: FS_MediaType, titleId: u64_) -> Result; } extern "C" { #[must_use] - #[doc = " Deletes pending titles.\n # Arguments\n\n* `mediatype` - Media type to delete from.\n * `flags` - Flags used to select pending titles."] + #[doc = "Deletes pending titles.\n # Arguments\n\n* `mediatype` - Media type to delete from.\n * `flags` - Flags used to select pending titles."] pub fn AM_DeletePendingTitles(mediatype: FS_MediaType, flags: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Deletes all pending titles.\n # Arguments\n\n* `mediatype` - Media type to delete from."] + #[doc = "Deletes all pending titles.\n # Arguments\n\n* `mediatype` - Media type to delete from."] pub fn AM_DeleteAllPendingTitles(mediatype: FS_MediaType) -> Result; } extern "C" { #[must_use] - #[doc = " Installs the current NATIVE_FIRM title to NAND (firm0:/ & firm1:/)"] + #[doc = "Installs the current NATIVE_FIRM title to NAND (firm0:/ & firm1:/)"] pub fn AM_InstallNativeFirm() -> Result; } extern "C" { #[must_use] - #[doc = " Installs a NATIVE_FIRM title to NAND. Accepts 0004013800000002 or 0004013820000002 (N3DS).\n # Arguments\n\n* `titleID` - Title ID of the NATIVE_FIRM to install."] + #[doc = "Installs a NATIVE_FIRM title to NAND. Accepts 0004013800000002 or 0004013820000002 (N3DS).\n # Arguments\n\n* `titleID` - Title ID of the NATIVE_FIRM to install."] pub fn AM_InstallFirm(titleID: u64_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the product code of a title.\n # Arguments\n\n* `mediatype` - Media type of the title.\n * `titleID` - ID of the title.\n * `productCode` (direction out) - Pointer to output the product code to. (length = 16)"] + #[doc = "Gets the product code of a title.\n # Arguments\n\n* `mediatype` - Media type of the title.\n * `titleID` - ID of the title.\n * `productCode` (direction out) - Pointer to output the product code to. (length = 16)"] pub fn AM_GetTitleProductCode( mediatype: FS_MediaType, titleId: u64_, @@ -6855,7 +6855,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets the ext data ID of a title.\n # Arguments\n\n* `extDataId` (direction out) - Pointer to output the ext data ID to.\n * `mediatype` - Media type of the title.\n * `titleID` - ID of the title."] + #[doc = "Gets the ext data ID of a title.\n # Arguments\n\n* `extDataId` (direction out) - Pointer to output the ext data ID to.\n * `mediatype` - Media type of the title.\n * `titleID` - ID of the title."] pub fn AM_GetTitleExtDataId( extDataId: *mut u64_, mediatype: FS_MediaType, @@ -6864,7 +6864,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets an AM_TitleEntry instance for a CIA file.\n # Arguments\n\n* `mediatype` - Media type that this CIA would be installed to.\n * `titleEntry` (direction out) - Pointer to write the AM_TitleEntry instance to.\n * `fileHandle` - Handle of the CIA file."] + #[doc = "Gets an AM_TitleEntry instance for a CIA file.\n # Arguments\n\n* `mediatype` - Media type that this CIA would be installed to.\n * `titleEntry` (direction out) - Pointer to write the AM_TitleEntry instance to.\n * `fileHandle` - Handle of the CIA file."] pub fn AM_GetCiaFileInfo( mediatype: FS_MediaType, titleEntry: *mut AM_TitleEntry, @@ -6873,27 +6873,27 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets the SMDH icon data of a CIA file.\n # Arguments\n\n* `icon` - Buffer to store the icon data in. Must be of size 0x36C0 bytes.\n * `fileHandle` - Handle of the CIA file."] + #[doc = "Gets the SMDH icon data of a CIA file.\n # Arguments\n\n* `icon` - Buffer to store the icon data in. Must be of size 0x36C0 bytes.\n * `fileHandle` - Handle of the CIA file."] pub fn AM_GetCiaIcon(icon: *mut ::libc::c_void, fileHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the title ID dependency list of a CIA file.\n # Arguments\n\n* `dependencies` - Buffer to store dependency title IDs in. Must be of size 0x300 bytes.\n * `fileHandle` - Handle of the CIA file."] + #[doc = "Gets the title ID dependency list of a CIA file.\n # Arguments\n\n* `dependencies` - Buffer to store dependency title IDs in. Must be of size 0x300 bytes.\n * `fileHandle` - Handle of the CIA file."] pub fn AM_GetCiaDependencies(dependencies: *mut u64_, fileHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the meta section offset of a CIA file.\n # Arguments\n\n* `metaOffset` (direction out) - Pointer to output the meta section offset to.\n * `fileHandle` - Handle of the CIA file."] + #[doc = "Gets the meta section offset of a CIA file.\n # Arguments\n\n* `metaOffset` (direction out) - Pointer to output the meta section offset to.\n * `fileHandle` - Handle of the CIA file."] pub fn AM_GetCiaMetaOffset(metaOffset: *mut u64_, fileHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the core version of a CIA file.\n # Arguments\n\n* `coreVersion` (direction out) - Pointer to output the core version to.\n * `fileHandle` - Handle of the CIA file."] + #[doc = "Gets the core version of a CIA file.\n # Arguments\n\n* `coreVersion` (direction out) - Pointer to output the core version to.\n * `fileHandle` - Handle of the CIA file."] pub fn AM_GetCiaCoreVersion(coreVersion: *mut u32_, fileHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the free space, in bytes, required to install a CIA file.\n # Arguments\n\n* `requiredSpace` (direction out) - Pointer to output the required free space to.\n * `mediaType` - Media type to check free space needed to install to.\n * `fileHandle` - Handle of the CIA file."] + #[doc = "Gets the free space, in bytes, required to install a CIA file.\n # Arguments\n\n* `requiredSpace` (direction out) - Pointer to output the required free space to.\n * `mediaType` - Media type to check free space needed to install to.\n * `fileHandle` - Handle of the CIA file."] pub fn AM_GetCiaRequiredSpace( requiredSpace: *mut u64_, mediaType: FS_MediaType, @@ -6902,7 +6902,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets the full meta section of a CIA file.\n # Arguments\n\n* `meta` - Buffer to store the meta section in.\n * `size` - Size of the buffer. Must be greater than or equal to the actual section data's size.\n * `fileHandle` - Handle of the CIA file."] + #[doc = "Gets the full meta section of a CIA file.\n # Arguments\n\n* `meta` - Buffer to store the meta section in.\n * `size` - Size of the buffer. Must be greater than or equal to the actual section data's size.\n * `fileHandle` - Handle of the CIA file."] pub fn AM_GetCiaMetaSection( meta: *mut ::libc::c_void, size: u32_, @@ -6911,57 +6911,57 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Initializes the external (SD) title database.\n # Arguments\n\n* `overwrite` - Overwrites the database if it already exists."] + #[doc = "Initializes the external (SD) title database.\n # Arguments\n\n* `overwrite` - Overwrites the database if it already exists."] pub fn AM_InitializeExternalTitleDatabase(overwrite: bool) -> Result; } extern "C" { #[must_use] - #[doc = " Queries whether the external title database is available.\n # Arguments\n\n* `available` (direction out) - Pointer to output the availability status to."] + #[doc = "Queries whether the external title database is available.\n # Arguments\n\n* `available` (direction out) - Pointer to output the availability status to."] pub fn AM_QueryAvailableExternalTitleDatabase(available: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Begins installing a ticket.\n # Arguments\n\n* `ticketHandle` (direction out) - Pointer to output a handle to write ticket data to."] + #[doc = "Begins installing a ticket.\n # Arguments\n\n* `ticketHandle` (direction out) - Pointer to output a handle to write ticket data to."] pub fn AM_InstallTicketBegin(ticketHandle: *mut Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Aborts installing a ticket.\n # Arguments\n\n* `ticketHandle` - Handle of the installation to abort."] + #[doc = "Aborts installing a ticket.\n # Arguments\n\n* `ticketHandle` - Handle of the installation to abort."] pub fn AM_InstallTicketAbort(ticketHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Finishes installing a ticket.\n # Arguments\n\n* `ticketHandle` - Handle of the installation to finalize."] + #[doc = "Finishes installing a ticket.\n # Arguments\n\n* `ticketHandle` - Handle of the installation to finalize."] pub fn AM_InstallTicketFinish(ticketHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Begins installing a title.\n # Arguments\n\n* `mediaType` - Destination to install to.\n * `titleId` - ID of the title to install.\n * `unk` - Unknown. (usually false)"] + #[doc = "Begins installing a title.\n # Arguments\n\n* `mediaType` - Destination to install to.\n * `titleId` - ID of the title to install.\n * `unk` - Unknown. (usually false)"] pub fn AM_InstallTitleBegin(mediaType: FS_MediaType, titleId: u64_, unk: bool) -> Result; } extern "C" { #[must_use] - #[doc = " Stops installing a title, generally to be resumed later."] + #[doc = "Stops installing a title, generally to be resumed later."] pub fn AM_InstallTitleStop() -> Result; } extern "C" { #[must_use] - #[doc = " Resumes installing a title.\n # Arguments\n\n* `mediaType` - Destination to install to.\n * `titleId` - ID of the title to install."] + #[doc = "Resumes installing a title.\n # Arguments\n\n* `mediaType` - Destination to install to.\n * `titleId` - ID of the title to install."] pub fn AM_InstallTitleResume(mediaType: FS_MediaType, titleId: u64_) -> Result; } extern "C" { #[must_use] - #[doc = " Aborts installing a title."] + #[doc = "Aborts installing a title."] pub fn AM_InstallTitleAbort() -> Result; } extern "C" { #[must_use] - #[doc = " Finishes installing a title."] + #[doc = "Finishes installing a title."] pub fn AM_InstallTitleFinish() -> Result; } extern "C" { #[must_use] - #[doc = " Commits installed titles.\n # Arguments\n\n* `mediaType` - Location of the titles to finalize.\n * `titleCount` - Number of titles to finalize.\n * `temp` - Whether the titles being finalized are in the temporary database.\n * `titleIds` - Title IDs to finalize."] + #[doc = "Commits installed titles.\n # Arguments\n\n* `mediaType` - Location of the titles to finalize.\n * `titleCount` - Number of titles to finalize.\n * `temp` - Whether the titles being finalized are in the temporary database.\n * `titleIds` - Title IDs to finalize."] pub fn AM_CommitImportTitles( mediaType: FS_MediaType, titleCount: u32_, @@ -6971,37 +6971,37 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Begins installing a TMD.\n # Arguments\n\n* `tmdHandle` (direction out) - Pointer to output a handle to write TMD data to."] + #[doc = "Begins installing a TMD.\n # Arguments\n\n* `tmdHandle` (direction out) - Pointer to output a handle to write TMD data to."] pub fn AM_InstallTmdBegin(tmdHandle: *mut Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Aborts installing a TMD.\n # Arguments\n\n* `tmdHandle` - Handle of the installation to abort."] + #[doc = "Aborts installing a TMD.\n # Arguments\n\n* `tmdHandle` - Handle of the installation to abort."] pub fn AM_InstallTmdAbort(tmdHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Finishes installing a TMD.\n # Arguments\n\n* `tmdHandle` - Handle of the installation to finalize.\n * `unk` - Unknown. (usually true)"] + #[doc = "Finishes installing a TMD.\n # Arguments\n\n* `tmdHandle` - Handle of the installation to finalize.\n * `unk` - Unknown. (usually true)"] pub fn AM_InstallTmdFinish(tmdHandle: Handle, unk: bool) -> Result; } extern "C" { #[must_use] - #[doc = " Prepares to import title contents.\n # Arguments\n\n* `contentCount` - Number of contents to be imported.\n * `contentIndices` - Indices of the contents to be imported."] + #[doc = "Prepares to import title contents.\n # Arguments\n\n* `contentCount` - Number of contents to be imported.\n * `contentIndices` - Indices of the contents to be imported."] pub fn AM_CreateImportContentContexts(contentCount: u32_, contentIndices: *mut u16_) -> Result; } extern "C" { #[must_use] - #[doc = " Begins installing title content.\n # Arguments\n\n* `contentHandle` (direction out) - Pointer to output a handle to write content data to.\n * `index` - Index of the content to install."] + #[doc = "Begins installing title content.\n # Arguments\n\n* `contentHandle` (direction out) - Pointer to output a handle to write content data to.\n * `index` - Index of the content to install."] pub fn AM_InstallContentBegin(contentHandle: *mut Handle, index: u16_) -> Result; } extern "C" { #[must_use] - #[doc = " Stops installing title content, generally to be resumed later.\n # Arguments\n\n* `contentHandle` - Handle of the installation to abort."] + #[doc = "Stops installing title content, generally to be resumed later.\n # Arguments\n\n* `contentHandle` - Handle of the installation to abort."] pub fn AM_InstallContentStop(contentHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Resumes installing title content.\n # Arguments\n\n* `contentHandle` (direction out) - Pointer to output a handle to write content data to.\n * `resumeOffset` (direction out) - Pointer to write the offset to resume content installation at to.\n * `index` - Index of the content to install."] + #[doc = "Resumes installing title content.\n # Arguments\n\n* `contentHandle` (direction out) - Pointer to output a handle to write content data to.\n * `resumeOffset` (direction out) - Pointer to write the offset to resume content installation at to.\n * `index` - Index of the content to install."] pub fn AM_InstallContentResume( contentHandle: *mut Handle, resumeOffset: *mut u64_, @@ -7010,17 +7010,17 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Cancels installing title content.\n # Arguments\n\n* `contentHandle` - Handle of the installation to finalize."] + #[doc = "Cancels installing title content.\n # Arguments\n\n* `contentHandle` - Handle of the installation to finalize."] pub fn AM_InstallContentCancel(contentHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Finishes installing title content.\n # Arguments\n\n* `contentHandle` - Handle of the installation to finalize."] + #[doc = "Finishes installing title content.\n # Arguments\n\n* `contentHandle` - Handle of the installation to finalize."] pub fn AM_InstallContentFinish(contentHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Imports up to four certificates into the ticket certificate chain.\n # Arguments\n\n* `cert1Size` - Size of the first certificate.\n * `cert1` - Data of the first certificate.\n * `cert2Size` - Size of the second certificate.\n * `cert2` - Data of the second certificate.\n * `cert3Size` - Size of the third certificate.\n * `cert3` - Data of the third certificate.\n * `cert4Size` - Size of the fourth certificate.\n * `cert4` - Data of the fourth certificate."] + #[doc = "Imports up to four certificates into the ticket certificate chain.\n # Arguments\n\n* `cert1Size` - Size of the first certificate.\n * `cert1` - Data of the first certificate.\n * `cert2Size` - Size of the second certificate.\n * `cert2` - Data of the second certificate.\n * `cert3Size` - Size of the third certificate.\n * `cert3` - Data of the third certificate.\n * `cert4Size` - Size of the fourth certificate.\n * `cert4` - Data of the fourth certificate."] pub fn AM_ImportCertificates( cert1Size: u32_, cert1: *mut ::libc::c_void, @@ -7034,12 +7034,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Imports a certificate into the ticket certificate chain.\n # Arguments\n\n* `certSize` - Size of the certificate.\n * `cert` - Data of the certificate."] + #[doc = "Imports a certificate into the ticket certificate chain.\n # Arguments\n\n* `certSize` - Size of the certificate.\n * `cert` - Data of the certificate."] pub fn AM_ImportCertificate(certSize: u32_, cert: *mut ::libc::c_void) -> Result; } extern "C" { #[must_use] - #[doc = " Commits installed titles, and updates FIRM if necessary.\n # Arguments\n\n* `mediaType` - Location of the titles to finalize.\n * `titleCount` - Number of titles to finalize.\n * `temp` - Whether the titles being finalized are in the temporary database.\n * `titleIds` - Title IDs to finalize."] + #[doc = "Commits installed titles, and updates FIRM if necessary.\n # Arguments\n\n* `mediaType` - Location of the titles to finalize.\n * `titleCount` - Number of titles to finalize.\n * `temp` - Whether the titles being finalized are in the temporary database.\n * `titleIds` - Title IDs to finalize."] pub fn AM_CommitImportTitlesAndUpdateFirmwareAuto( mediaType: FS_MediaType, titleCount: u32_, @@ -7049,27 +7049,27 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Resets play count of all installed demos by deleting their launch info."] + #[doc = "Resets play count of all installed demos by deleting their launch info."] pub fn AM_DeleteAllDemoLaunchInfos() -> Result; } extern "C" { #[must_use] - #[doc = " Deletes temporary titles."] + #[doc = "Deletes temporary titles."] pub fn AM_DeleteAllTemporaryTitles() -> Result; } extern "C" { #[must_use] - #[doc = " Deletes all expired titles.\n # Arguments\n\n* `mediatype` - Media type to delete from."] + #[doc = "Deletes all expired titles.\n # Arguments\n\n* `mediatype` - Media type to delete from."] pub fn AM_DeleteAllExpiredTitles(mediatype: FS_MediaType) -> Result; } extern "C" { #[must_use] - #[doc = " Deletes all TWL titles."] + #[doc = "Deletes all TWL titles."] pub fn AM_DeleteAllTwlTitles() -> Result; } extern "C" { #[must_use] - #[doc = " Gets the number of content index installed under the specified DLC title.\n # Arguments\n\n* `count` (direction out) - Pointer to output the number of content indices to.\n * `mediatype` - Media type of the title.\n * `titleID` - Title ID to retrieve the count for (high-id is 0x0004008C)."] + #[doc = "Gets the number of content index installed under the specified DLC title.\n # Arguments\n\n* `count` (direction out) - Pointer to output the number of content indices to.\n * `mediatype` - Media type of the title.\n * `titleID` - Title ID to retrieve the count for (high-id is 0x0004008C)."] pub fn AMAPP_GetDLCContentInfoCount( count: *mut u32_, mediatype: FS_MediaType, @@ -7078,7 +7078,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets content infos installed under the specified DLC title.\n # Arguments\n\n* `contentInfoRead` (direction out) - Pointer to output the number of content infos read to.\n * `mediatype` - Media type of the title.\n * `titleID` - Title ID to retrieve the content infos for (high-id is 0x0004008C).\n * `contentInfoCount` - Number of content infos to retrieve.\n * `offset` - Offset from the first content index the count starts at.\n * `contentInfos` (direction out) - Pointer to output the content infos read to."] + #[doc = "Gets content infos installed under the specified DLC title.\n # Arguments\n\n* `contentInfoRead` (direction out) - Pointer to output the number of content infos read to.\n * `mediatype` - Media type of the title.\n * `titleID` - Title ID to retrieve the content infos for (high-id is 0x0004008C).\n * `contentInfoCount` - Number of content infos to retrieve.\n * `offset` - Offset from the first content index the count starts at.\n * `contentInfos` (direction out) - Pointer to output the content infos read to."] pub fn AMAPP_ListDLCContentInfos( contentInfoRead: *mut u32_, mediatype: FS_MediaType, @@ -7090,16 +7090,16 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Initializes AMPXI.\n # Arguments\n\n* `servhandle` - Optional service session handle to use for AMPXI, if zero srvGetServiceHandle() will be used."] + #[doc = "Initializes AMPXI.\n # Arguments\n\n* `servhandle` - Optional service session handle to use for AMPXI, if zero srvGetServiceHandle() will be used."] pub fn ampxiInit(servhandle: Handle) -> Result; } extern "C" { - #[doc = " Exits AMPXI."] + #[doc = "Exits AMPXI."] pub fn ampxiExit(); } extern "C" { #[must_use] - #[doc = " Writes a TWL save-file to NAND. https://www.3dbrew.org/wiki/AMPXI:WriteTWLSavedata\n # Arguments\n\n* `titleid` - ID of the TWL title.\n * `buffer` - Savedata buffer ptr.\n * `size` - Size of the savedata buffer.\n * `image_filepos` - Filepos to use for writing the data to the NAND savedata file.\n * `section_type` - https://www.3dbrew.org/wiki/AMPXI:WriteTWLSavedata\n * `operation` - https://3dbrew.org/wiki/AM:ImportDSiWare"] + #[doc = "Writes a TWL save-file to NAND. https://www.3dbrew.org/wiki/AMPXI:WriteTWLSavedata\n # Arguments\n\n* `titleid` - ID of the TWL title.\n * `buffer` - Savedata buffer ptr.\n * `size` - Size of the savedata buffer.\n * `image_filepos` - Filepos to use for writing the data to the NAND savedata file.\n * `section_type` - https://www.3dbrew.org/wiki/AMPXI:WriteTWLSavedata\n * `operation` - https://3dbrew.org/wiki/AM:ImportDSiWare"] pub fn AMPXI_WriteTWLSavedata( titleid: u64_, buffer: *mut u8_, @@ -7111,7 +7111,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Finalizes title installation. https://3dbrew.org/wiki/AMPXI:InstallTitlesFinish\n # Arguments\n\n* `mediaType` - Mediatype of the titles to finalize.\n * `db` - Which title database to use.\n * `size` - Size of the savedata buffer.\n * `titlecount` - Total titles.\n * `tidlist` - List of titleIDs."] + #[doc = "Finalizes title installation. https://3dbrew.org/wiki/AMPXI:InstallTitlesFinish\n # Arguments\n\n* `mediaType` - Mediatype of the titles to finalize.\n * `db` - Which title database to use.\n * `size` - Size of the savedata buffer.\n * `titlecount` - Total titles.\n * `tidlist` - List of titleIDs."] pub fn AMPXI_InstallTitlesFinish( mediaType: FS_MediaType, db: u8_, @@ -7160,7 +7160,7 @@ pub const APPID_MINT: NS_APPID = 1031; pub const APPID_EXTRAPAD: NS_APPID = 1032; #[doc = "< memolib"] pub const APPID_MEMOLIB: NS_APPID = 1033; -#[doc = " NS Application IDs.\n\n Retrieved from http://3dbrew.org/wiki/NS_and_APT_Services#AppIDs"] +#[doc = "NS Application IDs.\n\n Retrieved from http://3dbrew.org/wiki/NS_and_APT_Services#AppIDs"] pub type NS_APPID = ::libc::c_uint; #[doc = "< No position specified."] pub const APTPOS_NONE: APT_AppletPos = -1; @@ -7174,13 +7174,13 @@ pub const APTPOS_SYS: APT_AppletPos = 2; pub const APTPOS_SYSLIB: APT_AppletPos = 3; #[doc = "< Resident applet."] pub const APTPOS_RESIDENT: APT_AppletPos = 4; -#[doc = " APT applet position."] +#[doc = "APT applet position."] pub type APT_AppletPos = ::libc::c_int; 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; -#[doc = " APT query reply."] +#[doc = "APT query reply."] pub type APT_QueryReply = ::libc::c_uint; #[doc = "< No signal received."] pub const APTSIGNAL_NONE: APT_Signal = 0; @@ -7206,7 +7206,7 @@ pub const APTSIGNAL_POWERBUTTON2: APT_Signal = 9; pub const APTSIGNAL_TRY_SLEEP: APT_Signal = 10; #[doc = "< Order to close (such as when an error happens?)."] pub const APTSIGNAL_ORDERTOCLOSE: APT_Signal = 11; -#[doc = " APT signals."] +#[doc = "APT signals."] pub type APT_Signal = ::libc::c_uint; #[doc = "< No command received."] pub const APTCMD_NONE: APT_Command = 0; @@ -7244,9 +7244,9 @@ pub const APTCMD_WAKEUP_JUMPTOHOME: APT_Command = 15; pub const APTCMD_SYSAPPLET_REQUEST: APT_Command = 16; #[doc = "< Applet wakes up and is instructed to launch another applet (?)."] pub const APTCMD_WAKEUP_LAUNCHAPP: APT_Command = 17; -#[doc = " APT commands."] +#[doc = "APT commands."] pub type APT_Command = ::libc::c_uint; -#[doc = " APT capture buffer information."] +#[doc = "APT capture buffer information."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct aptCaptureBufInfo { @@ -7274,12 +7274,12 @@ pub const APTHOOK_ONWAKEUP: APT_HookType = 3; pub const APTHOOK_ONEXIT: APT_HookType = 4; #[doc = "< Number of APT hook types."] pub const APTHOOK_COUNT: APT_HookType = 5; -#[doc = " APT hook types."] +#[doc = "APT hook types."] pub type APT_HookType = ::libc::c_uint; -#[doc = " APT hook function."] +#[doc = "APT hook function."] pub type aptHookFn = ::core::option::Option; -#[doc = " APT hook cookie."] +#[doc = "APT hook cookie."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct tag_aptHookCookie { @@ -7299,9 +7299,9 @@ impl Default for tag_aptHookCookie { } } } -#[doc = " APT hook cookie."] +#[doc = "APT hook cookie."] pub type aptHookCookie = tag_aptHookCookie; -#[doc = " APT message callback."] +#[doc = "APT message callback."] pub type aptMessageCb = ::core::option::Option< unsafe extern "C" fn( user: *mut ::libc::c_void, @@ -7312,76 +7312,76 @@ pub type aptMessageCb = ::core::option::Option< >; extern "C" { #[must_use] - #[doc = " Initializes APT."] + #[doc = "Initializes APT."] pub fn aptInit() -> Result; } extern "C" { - #[doc = " Exits APT."] + #[doc = "Exits APT."] pub fn aptExit(); } extern "C" { #[must_use] - #[doc = " Sends an APT command through IPC, taking care of locking, opening and closing an APT session.\n # Arguments\n\n* `aptcmdbuf` - Pointer to command buffer (should have capacity for at least 16 words)."] + #[doc = "Sends an APT command through IPC, taking care of locking, opening and closing an APT session.\n # Arguments\n\n* `aptcmdbuf` - Pointer to command buffer (should have capacity for at least 16 words)."] pub fn aptSendCommand(aptcmdbuf: *mut u32_) -> Result; } extern "C" { - #[doc = " Returns true if the application is currently in the foreground."] + #[doc = "Returns true if the application is currently in the foreground."] pub fn aptIsActive() -> bool; } extern "C" { - #[doc = " Returns true if the system has told the application to close."] + #[doc = "Returns true if the system has told the application to close."] pub fn aptShouldClose() -> bool; } extern "C" { - #[doc = " Returns true if the system can enter sleep mode while the application is active."] + #[doc = "Returns true if the system can enter sleep mode while the application is active."] pub fn aptIsSleepAllowed() -> bool; } extern "C" { - #[doc = " Configures whether the system can enter sleep mode while the application is active."] + #[doc = "Configures whether the system can enter sleep mode while the application is active."] pub fn aptSetSleepAllowed(allowed: bool); } extern "C" { - #[doc = " Handles incoming sleep mode requests."] + #[doc = "Handles incoming sleep mode requests."] pub fn aptHandleSleep(); } extern "C" { - #[doc = " Returns true if the user can press the HOME button to jump back to the HOME menu while the application is active."] + #[doc = "Returns true if the user can press the HOME button to jump back to the HOME menu while the application is active."] pub fn aptIsHomeAllowed() -> bool; } extern "C" { - #[doc = " Configures whether the user can press the HOME button to jump back to the HOME menu while the application is active."] + #[doc = "Configures whether the user can press the HOME button to jump back to the HOME menu while the application is active."] pub fn aptSetHomeAllowed(allowed: bool); } extern "C" { - #[doc = " Returns true if the system requires the application to jump back to the HOME menu."] + #[doc = "Returns true if the system requires the application to jump back to the HOME menu."] pub fn aptShouldJumpToHome() -> bool; } extern "C" { - #[doc = " Returns true if there is an incoming HOME button press rejected by the policy set by aptSetHomeAllowed (use this to show a \"no HOME allowed\" icon)."] + #[doc = "Returns true if there is an incoming HOME button press rejected by the policy set by aptSetHomeAllowed (use this to show a \"no HOME allowed\" icon)."] pub fn aptCheckHomePressRejected() -> bool; } extern "C" { - #[doc = " Jumps back to the HOME menu."] + #[doc = "Jumps back to the HOME menu."] pub fn aptJumpToHomeMenu(); } extern "C" { - #[doc = " Main function which handles sleep mode and HOME/power buttons - call this at the beginning of every frame.\n # Returns\n\ntrue if the application should keep running, false otherwise (see aptShouldClose)."] + #[doc = "Main function which handles sleep mode and HOME/power buttons - call this at the beginning of every frame.\n # Returns\n\ntrue if the application should keep running, false otherwise (see aptShouldClose)."] pub fn aptMainLoop() -> bool; } extern "C" { - #[doc = " Sets up an APT status hook.\n # Arguments\n\n* `cookie` - Hook cookie to use.\n * `callback` - Function to call when APT's status changes.\n * `param` - User-defined parameter to pass to the callback."] + #[doc = "Sets up an APT status hook.\n # Arguments\n\n* `cookie` - Hook cookie to use.\n * `callback` - Function to call when APT's status changes.\n * `param` - User-defined parameter to pass to the callback."] pub fn aptHook(cookie: *mut aptHookCookie, callback: aptHookFn, param: *mut ::libc::c_void); } extern "C" { - #[doc = " Removes an APT status hook.\n # Arguments\n\n* `cookie` - Hook cookie to remove."] + #[doc = "Removes an APT status hook.\n # Arguments\n\n* `cookie` - Hook cookie to remove."] pub fn aptUnhook(cookie: *mut aptHookCookie); } extern "C" { - #[doc = " Sets the function to be called when an APT message from another applet is received.\n # Arguments\n\n* `callback` - Callback function.\n * `user` - User-defined data to be passed to the callback."] + #[doc = "Sets the function to be called when an APT message from another applet is received.\n # Arguments\n\n* `callback` - Callback function.\n * `user` - User-defined data to be passed to the callback."] pub fn aptSetMessageCallback(callback: aptMessageCb, user: *mut ::libc::c_void); } extern "C" { - #[doc = " Launches a library applet.\n # Arguments\n\n* `appId` - ID of the applet to launch.\n * `buf` - Input/output buffer that contains launch parameters on entry and result data on exit.\n * `bufsize` - Size of the buffer.\n * `handle` - Handle to pass to the library applet."] + #[doc = "Launches a library applet.\n # Arguments\n\n* `appId` - ID of the applet to launch.\n * `buf` - Input/output buffer that contains launch parameters on entry and result data on exit.\n * `bufsize` - Size of the buffer.\n * `handle` - Handle to pass to the library applet."] pub fn aptLaunchLibraryApplet( appId: NS_APPID, buf: *mut ::libc::c_void, @@ -7390,23 +7390,23 @@ extern "C" { ); } extern "C" { - #[doc = " Clears the chainloader state."] + #[doc = "Clears the chainloader state."] pub fn aptClearChainloader(); } extern "C" { - #[doc = " Configures the chainloader to launch a specific application.\n # Arguments\n\n* `programID` - ID of the program to chainload to.\n * `mediatype` - Media type of the program to chainload to."] + #[doc = "Configures the chainloader to launch a specific application.\n # Arguments\n\n* `programID` - ID of the program to chainload to.\n * `mediatype` - Media type of the program to chainload to."] pub fn aptSetChainloader(programID: u64_, mediatype: u8_); } extern "C" { - #[doc = " Configures the chainloader to launch the previous application."] + #[doc = "Configures the chainloader to launch the previous application."] pub fn aptSetChainloaderToCaller(); } extern "C" { - #[doc = " Configures the chainloader to relaunch the current application (i.e. soft-reset)"] + #[doc = "Configures the chainloader to relaunch the current application (i.e. soft-reset)"] pub fn aptSetChainloaderToSelf(); } extern "C" { - #[doc = " Sets the \"deliver arg\" and HMAC for the chainloader, which will\n be passed to the target 3DS/DS(i) application. The meaning of each\n parameter varies on a per-application basis.\n # Arguments\n\n* `deliverArg` - Deliver arg to pass to the target application.\n * `deliverArgSize` - Size of the deliver arg, maximum 0x300 bytes.\n * `hmac` - HMAC buffer, 32 bytes. Use NULL to pass an all-zero dummy HMAC."] + #[doc = "Sets the \"deliver arg\" and HMAC for the chainloader, which will\n be passed to the target 3DS/DS(i) application. The meaning of each\n parameter varies on a per-application basis.\n # Arguments\n\n* `deliverArg` - Deliver arg to pass to the target application.\n * `deliverArgSize` - Size of the deliver arg, maximum 0x300 bytes.\n * `hmac` - HMAC buffer, 32 bytes. Use NULL to pass an all-zero dummy HMAC."] pub fn aptSetChainloaderArgs( deliverArg: *const ::libc::c_void, deliverArgSize: usize, @@ -7415,12 +7415,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets an APT lock handle.\n # Arguments\n\n* `flags` - Flags to use.\n * `lockHandle` - Pointer to output the lock handle to."] + #[doc = "Gets an APT lock handle.\n # Arguments\n\n* `flags` - Flags to use.\n * `lockHandle` - Pointer to output the lock handle to."] pub fn APT_GetLockHandle(flags: u16_, lockHandle: *mut Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Initializes an application's registration with APT.\n # Arguments\n\n* `appId` - ID of the application.\n * `attr` - Attributes of the application.\n * `signalEvent` - Pointer to output the signal event handle to.\n * `resumeEvent` - Pointer to output the resume event handle to."] + #[doc = "Initializes an application's registration with APT.\n # Arguments\n\n* `appId` - ID of the application.\n * `attr` - Attributes of the application.\n * `signalEvent` - Pointer to output the signal event handle to.\n * `resumeEvent` - Pointer to output the resume event handle to."] pub fn APT_Initialize( appId: NS_APPID, attr: APT_AppletAttr, @@ -7430,22 +7430,22 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Terminates an application's registration with APT.\n # Arguments\n\n* `appID` - ID of the application."] + #[doc = "Terminates an application's registration with APT.\n # Arguments\n\n* `appID` - ID of the application."] pub fn APT_Finalize(appId: NS_APPID) -> Result; } extern "C" { #[must_use] - #[doc = " Asynchronously resets the hardware."] + #[doc = "Asynchronously resets the hardware."] pub fn APT_HardwareResetAsync() -> Result; } extern "C" { #[must_use] - #[doc = " Enables APT.\n # Arguments\n\n* `attr` - Attributes of the application."] + #[doc = "Enables APT.\n # Arguments\n\n* `attr` - Attributes of the application."] pub fn APT_Enable(attr: APT_AppletAttr) -> Result; } extern "C" { #[must_use] - #[doc = " Gets applet management info.\n # Arguments\n\n* `inpos` - Requested applet position.\n * `outpos` - Pointer to output the position of the current applet to.\n * `req_appid` - Pointer to output the AppID of the applet at the requested position to.\n * `menu_appid` - Pointer to output the HOME menu AppID to.\n * `active_appid` - Pointer to output the AppID of the currently active applet to."] + #[doc = "Gets applet management info.\n # Arguments\n\n* `inpos` - Requested applet position.\n * `outpos` - Pointer to output the position of the current applet to.\n * `req_appid` - Pointer to output the AppID of the applet at the requested position to.\n * `menu_appid` - Pointer to output the HOME menu AppID to.\n * `active_appid` - Pointer to output the AppID of the currently active applet to."] pub fn APT_GetAppletManInfo( inpos: APT_AppletPos, outpos: *mut APT_AppletPos, @@ -7456,7 +7456,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets an applet's information.\n # Arguments\n\n* `appID` - AppID of the applet.\n * `pProgramID` - Pointer to output the program ID to.\n * `pMediaType` - Pointer to output the media type to.\n * `pRegistered` - Pointer to output the registration status to.\n * `pLoadState` - Pointer to output the load state to.\n * `pAttributes` - Pointer to output the applet atrributes to."] + #[doc = "Gets an applet's information.\n # Arguments\n\n* `appID` - AppID of the applet.\n * `pProgramID` - Pointer to output the program ID to.\n * `pMediaType` - Pointer to output the media type to.\n * `pRegistered` - Pointer to output the registration status to.\n * `pLoadState` - Pointer to output the load state to.\n * `pAttributes` - Pointer to output the applet atrributes to."] pub fn APT_GetAppletInfo( appID: NS_APPID, pProgramID: *mut u64_, @@ -7468,22 +7468,22 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets an applet's program information.\n # Arguments\n\n* `id` - ID of the applet.\n * `flags` - Flags to use when retreiving the information.\n * `titleversion` - Pointer to output the applet's title version to.\n\n Flags:\n - 0x01: Use AM_ListTitles with NAND media type.\n - 0x02: Use AM_ListTitles with SDMC media type.\n - 0x04: Use AM_ListTitles with GAMECARD media type.\n - 0x10: Input ID is an app ID. Must be set if 0x20 is not.\n - 0x20: Input ID is a program ID. Must be set if 0x10 is not.\n - 0x100: Sets program ID high to 0x00040000, else it is 0x00040010. Only used when 0x20 is set."] + #[doc = "Gets an applet's program information.\n # Arguments\n\n* `id` - ID of the applet.\n * `flags` - Flags to use when retreiving the information.\n * `titleversion` - Pointer to output the applet's title version to.\n\n Flags:\n - 0x01: Use AM_ListTitles with NAND media type.\n - 0x02: Use AM_ListTitles with SDMC media type.\n - 0x04: Use AM_ListTitles with GAMECARD media type.\n - 0x10: Input ID is an app ID. Must be set if 0x20 is not.\n - 0x20: Input ID is a program ID. Must be set if 0x10 is not.\n - 0x100: Sets program ID high to 0x00040000, else it is 0x00040010. Only used when 0x20 is set."] pub fn APT_GetAppletProgramInfo(id: u32_, flags: u32_, titleversion: *mut u16_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the current application's program ID.\n # Arguments\n\n* `pProgramID` - Pointer to output the program ID to."] + #[doc = "Gets the current application's program ID.\n # Arguments\n\n* `pProgramID` - Pointer to output the program ID to."] pub fn APT_GetProgramID(pProgramID: *mut u64_) -> Result; } extern "C" { #[must_use] - #[doc = " Prepares to jump to the home menu."] + #[doc = "Prepares to jump to the home menu."] pub fn APT_PrepareToJumpToHomeMenu() -> Result; } extern "C" { #[must_use] - #[doc = " Jumps to the home menu.\n # Arguments\n\n* `param` - Parameters to jump with.\n * `Size` - of the parameter buffer.\n * `handle` - Handle to pass."] + #[doc = "Jumps to the home menu.\n # Arguments\n\n* `param` - Parameters to jump with.\n * `Size` - of the parameter buffer.\n * `handle` - Handle to pass."] pub fn APT_JumpToHomeMenu( param: *const ::libc::c_void, paramSize: usize, @@ -7492,12 +7492,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Prepares to jump to an application.\n # Arguments\n\n* `exiting` - Specifies whether the applet is exiting."] + #[doc = "Prepares to jump to an application.\n # Arguments\n\n* `exiting` - Specifies whether the applet is exiting."] pub fn APT_PrepareToJumpToApplication(exiting: bool) -> Result; } extern "C" { #[must_use] - #[doc = " Jumps to an application.\n # Arguments\n\n* `param` - Parameters to jump with.\n * `Size` - of the parameter buffer.\n * `handle` - Handle to pass."] + #[doc = "Jumps to an application.\n # Arguments\n\n* `param` - Parameters to jump with.\n * `Size` - of the parameter buffer.\n * `handle` - Handle to pass."] pub fn APT_JumpToApplication( param: *const ::libc::c_void, paramSize: usize, @@ -7506,27 +7506,27 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets whether an application is registered.\n # Arguments\n\n* `appID` - ID of the application.\n * `out` - Pointer to output the registration state to."] + #[doc = "Gets whether an application is registered.\n # Arguments\n\n* `appID` - ID of the application.\n * `out` - Pointer to output the registration state to."] pub fn APT_IsRegistered(appID: NS_APPID, out: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Inquires as to whether a signal has been received.\n # Arguments\n\n* `appID` - ID of the application.\n * `signalType` - Pointer to output the signal type to."] + #[doc = "Inquires as to whether a signal has been received.\n # Arguments\n\n* `appID` - ID of the application.\n * `signalType` - Pointer to output the signal type to."] pub fn APT_InquireNotification(appID: u32_, signalType: *mut APT_Signal) -> Result; } extern "C" { #[must_use] - #[doc = " Requests to enter sleep mode, and later sets wake events if allowed to.\n # Arguments\n\n* `wakeEvents` - The wake events. Limited to \"shell\" (bit 1) for the PDN wake events part\n and \"shell opened\", \"shell closed\" and \"HOME button pressed\" for the MCU interrupts part."] + #[doc = "Requests to enter sleep mode, and later sets wake events if allowed to.\n # Arguments\n\n* `wakeEvents` - The wake events. Limited to \"shell\" (bit 1) for the PDN wake events part\n and \"shell opened\", \"shell closed\" and \"HOME button pressed\" for the MCU interrupts part."] pub fn APT_SleepSystem(wakeEvents: *const PtmWakeEvents) -> Result; } extern "C" { #[must_use] - #[doc = " Notifies an application to wait.\n # Arguments\n\n* `appID` - ID of the application."] + #[doc = "Notifies an application to wait.\n # Arguments\n\n* `appID` - ID of the application."] pub fn APT_NotifyToWait(appID: NS_APPID) -> Result; } extern "C" { #[must_use] - #[doc = " Calls an applet utility function.\n # Arguments\n\n* `id` - Utility function to call.\n * `out` - Pointer to write output data to.\n * `outSize` - Size of the output buffer.\n * `in` - Pointer to the input data.\n * `inSize` - Size of the input buffer."] + #[doc = "Calls an applet utility function.\n # Arguments\n\n* `id` - Utility function to call.\n * `out` - Pointer to write output data to.\n * `outSize` - Size of the output buffer.\n * `in` - Pointer to the input data.\n * `inSize` - Size of the input buffer."] pub fn APT_AppletUtility( id: ::libc::c_int, out: *mut ::libc::c_void, @@ -7537,27 +7537,27 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Sleeps if shell is closed (?)."] + #[doc = "Sleeps if shell is closed (?)."] pub fn APT_SleepIfShellClosed() -> Result; } extern "C" { #[must_use] - #[doc = " Locks a transition (?).\n # Arguments\n\n* `transition` - Transition ID.\n * `flag` - Flag (?)"] + #[doc = "Locks a transition (?).\n # Arguments\n\n* `transition` - Transition ID.\n * `flag` - Flag (?)"] pub fn APT_LockTransition(transition: u32_, flag: bool) -> Result; } extern "C" { #[must_use] - #[doc = " Tries to lock a transition (?).\n # Arguments\n\n* `transition` - Transition ID.\n * `succeeded` - Pointer to output whether the lock was successfully applied."] + #[doc = "Tries to lock a transition (?).\n # Arguments\n\n* `transition` - Transition ID.\n * `succeeded` - Pointer to output whether the lock was successfully applied."] pub fn APT_TryLockTransition(transition: u32_, succeeded: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Unlocks a transition (?).\n # Arguments\n\n* `transition` - Transition ID."] + #[doc = "Unlocks a transition (?).\n # Arguments\n\n* `transition` - Transition ID."] pub fn APT_UnlockTransition(transition: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Glances at a receieved parameter without removing it from the queue.\n # Arguments\n\n* `appID` - AppID of the application.\n * `buffer` - Buffer to receive to.\n * `bufferSize` - Size of the buffer.\n * `sender` - Pointer to output the sender's AppID to.\n * `command` - Pointer to output the command ID to.\n * `actualSize` - Pointer to output the actual received data size to.\n * `parameter` - Pointer to output the parameter handle to."] + #[doc = "Glances at a receieved parameter without removing it from the queue.\n # Arguments\n\n* `appID` - AppID of the application.\n * `buffer` - Buffer to receive to.\n * `bufferSize` - Size of the buffer.\n * `sender` - Pointer to output the sender's AppID to.\n * `command` - Pointer to output the command ID to.\n * `actualSize` - Pointer to output the actual received data size to.\n * `parameter` - Pointer to output the parameter handle to."] pub fn APT_GlanceParameter( appID: NS_APPID, buffer: *mut ::libc::c_void, @@ -7570,7 +7570,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Receives a parameter.\n # Arguments\n\n* `appID` - AppID of the application.\n * `buffer` - Buffer to receive to.\n * `bufferSize` - Size of the buffer.\n * `sender` - Pointer to output the sender's AppID to.\n * `command` - Pointer to output the command ID to.\n * `actualSize` - Pointer to output the actual received data size to.\n * `parameter` - Pointer to output the parameter handle to."] + #[doc = "Receives a parameter.\n # Arguments\n\n* `appID` - AppID of the application.\n * `buffer` - Buffer to receive to.\n * `bufferSize` - Size of the buffer.\n * `sender` - Pointer to output the sender's AppID to.\n * `command` - Pointer to output the command ID to.\n * `actualSize` - Pointer to output the actual received data size to.\n * `parameter` - Pointer to output the parameter handle to."] pub fn APT_ReceiveParameter( appID: NS_APPID, buffer: *mut ::libc::c_void, @@ -7583,7 +7583,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Sends a parameter.\n # Arguments\n\n* `source` - AppID of the source application.\n * `dest` - AppID of the destination application.\n * `command` - Command to send.\n * `buffer` - Buffer to send.\n * `bufferSize` - Size of the buffer.\n * `parameter` - Parameter handle to pass."] + #[doc = "Sends a parameter.\n # Arguments\n\n* `source` - AppID of the source application.\n * `dest` - AppID of the destination application.\n * `command` - Command to send.\n * `buffer` - Buffer to send.\n * `bufferSize` - Size of the buffer.\n * `parameter` - Parameter handle to pass."] pub fn APT_SendParameter( source: NS_APPID, dest: NS_APPID, @@ -7595,32 +7595,32 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Cancels a parameter which matches the specified source and dest AppIDs.\n # Arguments\n\n* `source` - AppID of the source application (use APPID_NONE to disable the check).\n * `dest` - AppID of the destination application (use APPID_NONE to disable the check).\n * `success` - Pointer to output true if a parameter was cancelled, or false otherwise."] + #[doc = "Cancels a parameter which matches the specified source and dest AppIDs.\n # Arguments\n\n* `source` - AppID of the source application (use APPID_NONE to disable the check).\n * `dest` - AppID of the destination application (use APPID_NONE to disable the check).\n * `success` - Pointer to output true if a parameter was cancelled, or false otherwise."] pub fn APT_CancelParameter(source: NS_APPID, dest: NS_APPID, success: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Sends capture buffer information.\n # Arguments\n\n* `captureBuf` - Capture buffer information to send."] + #[doc = "Sends capture buffer information.\n # Arguments\n\n* `captureBuf` - Capture buffer information to send."] pub fn APT_SendCaptureBufferInfo(captureBuf: *const aptCaptureBufInfo) -> Result; } extern "C" { #[must_use] - #[doc = " Replies to a sleep query.\n # Arguments\n\n* `appID` - ID of the application.\n * `reply` - Query reply value."] + #[doc = "Replies to a sleep query.\n # Arguments\n\n* `appID` - ID of the application.\n * `reply` - Query reply value."] pub fn APT_ReplySleepQuery(appID: NS_APPID, reply: APT_QueryReply) -> Result; } extern "C" { #[must_use] - #[doc = " Replies that a sleep notification has been completed.\n # Arguments\n\n* `appID` - ID of the application."] + #[doc = "Replies that a sleep notification has been completed.\n # Arguments\n\n* `appID` - ID of the application."] pub fn APT_ReplySleepNotificationComplete(appID: NS_APPID) -> Result; } extern "C" { #[must_use] - #[doc = " Prepares to close the application.\n # Arguments\n\n* `cancelPreload` - Whether applet preloads should be cancelled."] + #[doc = "Prepares to close the application.\n # Arguments\n\n* `cancelPreload` - Whether applet preloads should be cancelled."] pub fn APT_PrepareToCloseApplication(cancelPreload: bool) -> Result; } extern "C" { #[must_use] - #[doc = " Closes the application.\n # Arguments\n\n* `param` - Parameters to close with.\n * `paramSize` - Size of param.\n * `handle` - Handle to pass."] + #[doc = "Closes the application.\n # Arguments\n\n* `param` - Parameters to close with.\n * `paramSize` - Size of param.\n * `handle` - Handle to pass."] pub fn APT_CloseApplication( param: *const ::libc::c_void, paramSize: usize, @@ -7629,27 +7629,27 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Sets the application's CPU time limit.\n # Arguments\n\n* `percent` - CPU time limit percentage to set."] + #[doc = "Sets the application's CPU time limit.\n # Arguments\n\n* `percent` - CPU time limit percentage to set."] pub fn APT_SetAppCpuTimeLimit(percent: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the application's CPU time limit.\n # Arguments\n\n* `percent` - Pointer to output the CPU time limit percentage to."] + #[doc = "Gets the application's CPU time limit.\n # Arguments\n\n* `percent` - Pointer to output the CPU time limit percentage to."] pub fn APT_GetAppCpuTimeLimit(percent: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Checks whether the system is a New 3DS.\n # Arguments\n\n* `out` - Pointer to write the New 3DS flag to."] + #[doc = "Checks whether the system is a New 3DS.\n # Arguments\n\n* `out` - Pointer to write the New 3DS flag to."] pub fn APT_CheckNew3DS(out: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Prepares for an applicaton jump.\n # Arguments\n\n* `flags` - Flags to use.\n * `programID` - ID of the program to jump to.\n * `mediatype` - Media type of the program to jump to."] + #[doc = "Prepares for an applicaton jump.\n # Arguments\n\n* `flags` - Flags to use.\n * `programID` - ID of the program to jump to.\n * `mediatype` - Media type of the program to jump to."] pub fn APT_PrepareToDoApplicationJump(flags: u8_, programID: u64_, mediatype: u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Performs an application jump.\n # Arguments\n\n* `param` - Parameter buffer.\n * `paramSize` - Size of parameter buffer.\n * `hmac` - HMAC buffer (should be 0x20 bytes long)."] + #[doc = "Performs an application jump.\n # Arguments\n\n* `param` - Parameter buffer.\n * `paramSize` - Size of parameter buffer.\n * `hmac` - HMAC buffer (should be 0x20 bytes long)."] pub fn APT_DoApplicationJump( param: *const ::libc::c_void, paramSize: usize, @@ -7658,12 +7658,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Prepares to start a library applet.\n # Arguments\n\n* `appID` - AppID of the applet to start."] + #[doc = "Prepares to start a library applet.\n # Arguments\n\n* `appID` - AppID of the applet to start."] pub fn APT_PrepareToStartLibraryApplet(appID: NS_APPID) -> Result; } extern "C" { #[must_use] - #[doc = " Starts a library applet.\n # Arguments\n\n* `appID` - AppID of the applet to launch.\n * `param` - Buffer containing applet parameters.\n * `paramsize` - Size of the buffer.\n * `handle` - Handle to pass to the applet."] + #[doc = "Starts a library applet.\n # Arguments\n\n* `appID` - AppID of the applet to launch.\n * `param` - Buffer containing applet parameters.\n * `paramsize` - Size of the buffer.\n * `handle` - Handle to pass to the applet."] pub fn APT_StartLibraryApplet( appID: NS_APPID, param: *const ::libc::c_void, @@ -7673,12 +7673,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Prepares to start a system applet.\n # Arguments\n\n* `appID` - AppID of the applet to start."] + #[doc = "Prepares to start a system applet.\n # Arguments\n\n* `appID` - AppID of the applet to start."] pub fn APT_PrepareToStartSystemApplet(appID: NS_APPID) -> Result; } extern "C" { #[must_use] - #[doc = " Starts a system applet.\n # Arguments\n\n* `appID` - AppID of the applet to launch.\n * `param` - Buffer containing applet parameters.\n * `paramSize` - Size of the parameter buffer.\n * `handle` - Handle to pass to the applet."] + #[doc = "Starts a system applet.\n # Arguments\n\n* `appID` - AppID of the applet to launch.\n * `param` - Buffer containing applet parameters.\n * `paramSize` - Size of the parameter buffer.\n * `handle` - Handle to pass to the applet."] pub fn APT_StartSystemApplet( appID: NS_APPID, param: *const ::libc::c_void, @@ -7688,12 +7688,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Retrieves the shared system font.\n fontHandle Pointer to write the handle of the system font memory block to.\n mapAddr Pointer to write the mapping address of the system font memory block to."] + #[doc = "Retrieves the shared system font.\n fontHandle Pointer to write the handle of the system font memory block to.\n mapAddr Pointer to write the mapping address of the system font memory block to."] pub fn APT_GetSharedFont(fontHandle: *mut Handle, mapAddr: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Receives the deliver (launch) argument\n # Arguments\n\n* `param` - Parameter buffer.\n * `paramSize` - Size of parameter buffer.\n * `hmac` - HMAC buffer (should be 0x20 bytes long).\n * `sender` - Pointer to output the sender's AppID to.\n * `received` - Pointer to output whether an argument was received to."] + #[doc = "Receives the deliver (launch) argument\n # Arguments\n\n* `param` - Parameter buffer.\n * `paramSize` - Size of parameter buffer.\n * `hmac` - HMAC buffer (should be 0x20 bytes long).\n * `sender` - Pointer to output the sender's AppID to.\n * `received` - Pointer to output whether an argument was received to."] pub fn APT_ReceiveDeliverArg( param: *mut ::libc::c_void, paramSize: usize, @@ -7702,7 +7702,7 @@ extern "C" { received: *mut bool, ) -> Result; } -#[doc = " BOSS context."] +#[doc = "BOSS context."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct bossContext { @@ -7736,60 +7736,60 @@ impl Default for bossContext { } pub const BOSSTASKSTATUS_STARTED: bossTaskStatus = 2; pub const BOSSTASKSTATUS_ERROR: bossTaskStatus = 7; -#[doc = " BOSS task status."] +#[doc = "BOSS task status."] pub type bossTaskStatus = ::libc::c_uint; pub const bossNsDataHeaderInfoType_ContentSize: bossNsDataHeaderInfoTypes = 3; -#[doc = " Type values for bossGetNsDataHeaderInfo()."] +#[doc = "Type values for bossGetNsDataHeaderInfo()."] pub type bossNsDataHeaderInfoTypes = ::libc::c_uint; pub const bossNsDataHeaderInfoTypeSize_ContentSize: bossNsDataHeaderInfoTypeSizes = 4; -#[doc = " Size of the output data for bossGetNsDataHeaderInfo()."] +#[doc = "Size of the output data for bossGetNsDataHeaderInfo()."] pub type bossNsDataHeaderInfoTypeSizes = ::libc::c_uint; extern "C" { #[must_use] - #[doc = " Initializes BOSS.\n # Arguments\n\n* `programID` - programID to use, 0 for the current process. Only used when BOSSP is available without *hax payload.\n * `force_user` - When true, just use bossU instead of trying to initialize with bossP first."] + #[doc = "Initializes BOSS.\n # Arguments\n\n* `programID` - programID to use, 0 for the current process. Only used when BOSSP is available without *hax payload.\n * `force_user` - When true, just use bossU instead of trying to initialize with bossP first."] pub fn bossInit(programID: u64_, force_user: bool) -> Result; } extern "C" { #[must_use] - #[doc = " Run the InitializeSession service cmd. This is mainly for changing the programID associated with the current BOSS session.\n # Arguments\n\n* `programID` - programID to use, 0 for the current process."] + #[doc = "Run the InitializeSession service cmd. This is mainly for changing the programID associated with the current BOSS session.\n # Arguments\n\n* `programID` - programID to use, 0 for the current process."] pub fn bossReinit(programID: u64_) -> Result; } extern "C" { - #[doc = " Exits BOSS."] + #[doc = "Exits BOSS."] pub fn bossExit(); } extern "C" { - #[doc = " Returns the BOSS session handle."] + #[doc = "Returns the BOSS session handle."] pub fn bossGetSessionHandle() -> Handle; } extern "C" { #[must_use] - #[doc = " Set the content data storage location.\n # Arguments\n\n* `extdataID` - u64 extdataID, must have the high word set to the shared-extdata value when it's for NAND.\n * `boss_size` - Probably the max size in the extdata which BOSS can use.\n * `mediaType` - Roughly the same as FS mediatype."] + #[doc = "Set the content data storage location.\n # Arguments\n\n* `extdataID` - u64 extdataID, must have the high word set to the shared-extdata value when it's for NAND.\n * `boss_size` - Probably the max size in the extdata which BOSS can use.\n * `mediaType` - Roughly the same as FS mediatype."] pub fn bossSetStorageInfo(extdataID: u64_, boss_size: u32_, mediaType: u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Unregister the content data storage location, which includes unregistering the BOSS-session programID with BOSS."] + #[doc = "Unregister the content data storage location, which includes unregistering the BOSS-session programID with BOSS."] pub fn bossUnregisterStorage() -> Result; } extern "C" { #[must_use] - #[doc = " Register a task.\n # Arguments\n\n* `taskID` - BOSS taskID.\n * `unk0` - Unknown, usually zero.\n * `unk1` - Unknown, usually zero."] + #[doc = "Register a task.\n # Arguments\n\n* `taskID` - BOSS taskID.\n * `unk0` - Unknown, usually zero.\n * `unk1` - Unknown, usually zero."] pub fn bossRegisterTask(taskID: *const ::libc::c_char, unk0: u8_, unk1: u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Send a property.\n # Arguments\n\n* `PropertyID` - PropertyID\n * `buf` - Input buffer data.\n * `size` - Buffer size."] + #[doc = "Send a property.\n # Arguments\n\n* `PropertyID` - PropertyID\n * `buf` - Input buffer data.\n * `size` - Buffer size."] pub fn bossSendProperty(PropertyID: u16_, buf: *const ::libc::c_void, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Deletes the content file for the specified NsDataId.\n # Arguments\n\n* `NsDataId` - NsDataId"] + #[doc = "Deletes the content file for the specified NsDataId.\n # Arguments\n\n* `NsDataId` - NsDataId"] pub fn bossDeleteNsData(NsDataId: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets header info for the specified NsDataId.\n # Arguments\n\n* `NsDataId` - NsDataId\n * `type` - Type of data to load.\n * `buffer` - Output buffer.\n * `size` - Output buffer size."] + #[doc = "Gets header info for the specified NsDataId.\n # Arguments\n\n* `NsDataId` - NsDataId\n * `type` - Type of data to load.\n * `buffer` - Output buffer.\n * `size` - Output buffer size."] pub fn bossGetNsDataHeaderInfo( NsDataId: u32_, type_: u8_, @@ -7799,7 +7799,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Reads data from the content for the specified NsDataId.\n # Arguments\n\n* `NsDataId` - NsDataId\n * `offset` - Offset in the content.\n * `buffer` - Output buffer.\n * `size` - Output buffer size.\n * `transfer_total` - Optional output actual read size, can be NULL.\n * `unk_out` - Optional unknown output, can be NULL."] + #[doc = "Reads data from the content for the specified NsDataId.\n # Arguments\n\n* `NsDataId` - NsDataId\n * `offset` - Offset in the content.\n * `buffer` - Output buffer.\n * `size` - Output buffer size.\n * `transfer_total` - Optional output actual read size, can be NULL.\n * `unk_out` - Optional unknown output, can be NULL."] pub fn bossReadNsData( NsDataId: u32_, offset: u64_, @@ -7811,22 +7811,22 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Starts a task soon after running this command.\n # Arguments\n\n* `taskID` - BOSS taskID."] + #[doc = "Starts a task soon after running this command.\n # Arguments\n\n* `taskID` - BOSS taskID."] pub fn bossStartTaskImmediate(taskID: *const ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = " Similar to bossStartTaskImmediate?\n # Arguments\n\n* `taskID` - BOSS taskID."] + #[doc = "Similar to bossStartTaskImmediate?\n # Arguments\n\n* `taskID` - BOSS taskID."] pub fn bossStartBgImmediate(taskID: *const ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = " Deletes a task by using CancelTask and UnregisterTask internally.\n # Arguments\n\n* `taskID` - BOSS taskID.\n * `unk` - Unknown, usually zero?"] + #[doc = "Deletes a task by using CancelTask and UnregisterTask internally.\n # Arguments\n\n* `taskID` - BOSS taskID.\n * `unk` - Unknown, usually zero?"] pub fn bossDeleteTask(taskID: *const ::libc::c_char, unk: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Returns task state.\n # Arguments\n\n* `taskID` - BOSS taskID.\n * `inval` - Unknown, normally 0?\n * `status` - Output status, see bossTaskStatus.\n * `out1` - Output field.\n * `out2` - Output field."] + #[doc = "Returns task state.\n # Arguments\n\n* `taskID` - BOSS taskID.\n * `inval` - Unknown, normally 0?\n * `status` - Output status, see bossTaskStatus.\n * `out1` - Output field.\n * `out2` - Output field."] pub fn bossGetTaskState( taskID: *const ::libc::c_char, inval: s8, @@ -7837,11 +7837,11 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " This loads the current state of PropertyID 0x0 for the specified task.\n # Arguments\n\n* `taskID` - BOSS taskID."] + #[doc = "This loads the current state of PropertyID 0x0 for the specified task.\n # Arguments\n\n* `taskID` - BOSS taskID."] pub fn bossGetTaskProperty0(taskID: *const ::libc::c_char, out: *mut u8_) -> Result; } extern "C" { - #[doc = " Setup a BOSS context with the default config.\n # Arguments\n\n* `bossContext` - BOSS context.\n * `seconds_interval` - Interval in seconds for running the task automatically.\n * `url` - Task URL."] + #[doc = "Setup a BOSS context with the default config.\n # Arguments\n\n* `bossContext` - BOSS context.\n * `seconds_interval` - Interval in seconds for running the task automatically.\n * `url` - Task URL."] pub fn bossSetupContextDefault( ctx: *mut bossContext, seconds_interval: u32_, @@ -7850,20 +7850,20 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Sends the config stored in the context. Used before registering a task.\n # Arguments\n\n* `bossContext` - BOSS context."] + #[doc = "Sends the config stored in the context. Used before registering a task.\n # Arguments\n\n* `bossContext` - BOSS context."] pub fn bossSendContextConfig(ctx: *mut bossContext) -> Result; } -#[doc = "< 8-bit per component, planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples).Usually named YUV422P."] +#[doc = "< 8-bit per component, planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples).Usually named YUV422P."] pub const INPUT_YUV422_INDIV_8: Y2RU_InputFormat = 0; -#[doc = "< 8-bit per component, planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples).Usually named YUV420P."] +#[doc = "< 8-bit per component, planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples).Usually named YUV420P."] pub const INPUT_YUV420_INDIV_8: Y2RU_InputFormat = 1; #[doc = "< 16-bit per component, planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples).Usually named YUV422P16."] pub const INPUT_YUV422_INDIV_16: Y2RU_InputFormat = 2; #[doc = "< 16-bit per component, planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples).Usually named YUV420P16."] pub const INPUT_YUV420_INDIV_16: Y2RU_InputFormat = 3; -#[doc = "< 8-bit per component, packed YUV 4:2:2, 16bpp, (Y0 Cb Y1 Cr).Usually named YUYV422."] +#[doc = "< 8-bit per component, packed YUV 4:2:2, 16bpp, (Y0 Cb Y1 Cr).Usually named YUYV422."] pub const INPUT_YUV422_BATCH: Y2RU_InputFormat = 4; -#[doc = " Input color formats\n\n For the 16-bit per component formats, bits 15-8 are padding and 7-0 contains the value."] +#[doc = "Input color formats\n\n For the 16-bit per component formats, bits 15-8 are padding and 7-0 contains the value."] pub type Y2RU_InputFormat = ::libc::c_uint; #[doc = "< 32-bit RGBA8888. The alpha component is the 8-bit value set by Y2RU_SetAlpha"] pub const OUTPUT_RGB_32: Y2RU_OutputFormat = 0; @@ -7873,7 +7873,7 @@ pub const OUTPUT_RGB_24: Y2RU_OutputFormat = 1; pub const OUTPUT_RGB_16_555: Y2RU_OutputFormat = 2; #[doc = "< 16-bit RGB565."] pub const OUTPUT_RGB_16_565: Y2RU_OutputFormat = 3; -#[doc = " Output color formats\n\n Those are the same as the framebuffer and GPU texture formats."] +#[doc = "Output color formats\n\n Those are the same as the framebuffer and GPU texture formats."] pub type Y2RU_OutputFormat = ::libc::c_uint; #[doc = "< No rotation."] pub const ROTATION_NONE: Y2RU_Rotation = 0; @@ -7883,15 +7883,15 @@ pub const ROTATION_CLOCKWISE_90: Y2RU_Rotation = 1; pub const ROTATION_CLOCKWISE_180: Y2RU_Rotation = 2; #[doc = "< Clockwise 270 degrees."] pub const ROTATION_CLOCKWISE_270: Y2RU_Rotation = 3; -#[doc = " Rotation to be applied to the output."] +#[doc = "Rotation to be applied to the output."] pub type Y2RU_Rotation = ::libc::c_uint; #[doc = "< The result buffer will be laid out in linear format, the usual way."] pub const BLOCK_LINE: Y2RU_BlockAlignment = 0; #[doc = "< The result will be stored as 8x8 blocks in Z-order.Useful for textures since it is the format used by the PICA200."] pub const BLOCK_8_BY_8: Y2RU_BlockAlignment = 1; -#[doc = " Block alignment of output\n\n Defines the way the output will be laid out in memory."] +#[doc = "Block alignment of output\n\n Defines the way the output will be laid out in memory."] pub type Y2RU_BlockAlignment = ::libc::c_uint; -#[doc = " Coefficients of the YUV->RGB conversion formula.\n\n A set of coefficients configuring the RGB to YUV conversion. Coefficients 0-4 are unsigned 2.8\n fixed pointer numbers representing entries on the conversion matrix, while coefficient 5-7 are\n signed 11.5 fixed point numbers added as offsets to the RGB result.\n\n The overall conversion process formula is:\n R = trunc((rgb_Y * Y + r_V * V) + 0.75 + r_offset)\n G = trunc((rgb_Y * Y - g_U * U - g_V * V) + 0.75 + g_offset)\n B = trunc((rgb_Y * Y + b_U * U ) + 0.75 + b_offset)\n "] +#[doc = "Coefficients of the YUV->RGB conversion formula.\n\n A set of coefficients configuring the RGB to YUV conversion. Coefficients 0-4 are unsigned 2.8\n fixed pointer numbers representing entries on the conversion matrix, while coefficient 5-7 are\n signed 11.5 fixed point numbers added as offsets to the RGB result.\n\n The overall conversion process formula is:\n R = trunc((rgb_Y * Y + r_V * V) + 0.75 + r_offset)\n G = trunc((rgb_Y * Y - g_U * U - g_V * V) + 0.75 + g_offset)\n B = trunc((rgb_Y * Y + b_U * U ) + 0.75 + b_offset)\n "] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct Y2RU_ColorCoefficients { @@ -7920,9 +7920,9 @@ pub const COEFFICIENT_ITU_R_BT_709: Y2RU_StandardCoefficient = 1; pub const COEFFICIENT_ITU_R_BT_601_SCALING: Y2RU_StandardCoefficient = 2; #[doc = "< Coefficients from the ITU-R BT.709 standard with TV ranges."] pub const COEFFICIENT_ITU_R_BT_709_SCALING: Y2RU_StandardCoefficient = 3; -#[doc = " Preset conversion coefficients based on ITU standards for the YUV->RGB formula.\n\n For more details refer to Y2RU_ColorCoefficients"] +#[doc = "Preset conversion coefficients based on ITU standards for the YUV->RGB formula.\n\n For more details refer to Y2RU_ColorCoefficients"] pub type Y2RU_StandardCoefficient = ::libc::c_uint; -#[doc = " Structure used to configure all parameters at once.\n\n You can send a batch of configuration parameters using this structure and Y2RU_SetConversionParams."] +#[doc = "Structure used to configure all parameters at once.\n\n You can send a batch of configuration parameters using this structure and Y2RU_SetConversionParams."] #[repr(C)] #[repr(align(4))] #[derive(Debug, Copy, Clone)] @@ -8043,7 +8043,7 @@ impl Y2RU_ConversionParams { __bindgen_bitfield_unit } } -#[doc = " Dithering weights."] +#[doc = "Dithering weights."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct Y2RU_DitheringWeightParams { @@ -8082,111 +8082,111 @@ pub struct Y2RU_DitheringWeightParams { } extern "C" { #[must_use] - #[doc = " Initializes the y2r service.\n\n This will internally get the handle of the service, and on success call Y2RU_DriverInitialize."] + #[doc = "Initializes the y2r service.\n\n This will internally get the handle of the service, and on success call Y2RU_DriverInitialize."] pub fn y2rInit() -> Result; } extern "C" { - #[doc = " Closes the y2r service.\n\n This will internally call Y2RU_DriverFinalize and close the handle of the service."] + #[doc = "Closes the y2r service.\n\n This will internally call Y2RU_DriverFinalize and close the handle of the service."] pub fn y2rExit(); } extern "C" { #[must_use] - #[doc = " Used to configure the input format.\n # Arguments\n\n* `format` - Input format to use.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] + #[doc = "Used to configure the input format.\n # Arguments\n\n* `format` - Input format to use.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] pub fn Y2RU_SetInputFormat(format: Y2RU_InputFormat) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the configured input format.\n # Arguments\n\n* `format` - Pointer to output the input format to."] + #[doc = "Gets the configured input format.\n # Arguments\n\n* `format` - Pointer to output the input format to."] pub fn Y2RU_GetInputFormat(format: *mut Y2RU_InputFormat) -> Result; } extern "C" { #[must_use] - #[doc = " Used to configure the output format.\n # Arguments\n\n* `format` - Output format to use.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] + #[doc = "Used to configure the output format.\n # Arguments\n\n* `format` - Output format to use.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] pub fn Y2RU_SetOutputFormat(format: Y2RU_OutputFormat) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the configured output format.\n # Arguments\n\n* `format` - Pointer to output the output format to."] + #[doc = "Gets the configured output format.\n # Arguments\n\n* `format` - Pointer to output the output format to."] pub fn Y2RU_GetOutputFormat(format: *mut Y2RU_OutputFormat) -> Result; } extern "C" { #[must_use] - #[doc = " Used to configure the rotation of the output.\n # Arguments\n\n* `rotation` - Rotation to use.\n\n It seems to apply the rotation per batch of 8 lines, so the output will be (height/8) images of size 8 x width.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] + #[doc = "Used to configure the rotation of the output.\n # Arguments\n\n* `rotation` - Rotation to use.\n\n It seems to apply the rotation per batch of 8 lines, so the output will be (height/8) images of size 8 x width.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] pub fn Y2RU_SetRotation(rotation: Y2RU_Rotation) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the configured rotation.\n # Arguments\n\n* `rotation` - Pointer to output the rotation to."] + #[doc = "Gets the configured rotation.\n # Arguments\n\n* `rotation` - Pointer to output the rotation to."] pub fn Y2RU_GetRotation(rotation: *mut Y2RU_Rotation) -> Result; } extern "C" { #[must_use] - #[doc = " Used to configure the alignment of the output buffer.\n # Arguments\n\n* `alignment` - Alignment to use.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] + #[doc = "Used to configure the alignment of the output buffer.\n # Arguments\n\n* `alignment` - Alignment to use.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] pub fn Y2RU_SetBlockAlignment(alignment: Y2RU_BlockAlignment) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the configured alignment.\n # Arguments\n\n* `alignment` - Pointer to output the alignment to."] + #[doc = "Gets the configured alignment.\n # Arguments\n\n* `alignment` - Pointer to output the alignment to."] pub fn Y2RU_GetBlockAlignment(alignment: *mut Y2RU_BlockAlignment) -> Result; } extern "C" { #[must_use] - #[doc = " Sets whether to use spacial dithering.\n # Arguments\n\n* `enable` - Whether to use spacial dithering."] + #[doc = "Sets whether to use spacial dithering.\n # Arguments\n\n* `enable` - Whether to use spacial dithering."] pub fn Y2RU_SetSpacialDithering(enable: bool) -> Result; } extern "C" { #[must_use] - #[doc = " Gets whether to use spacial dithering.\n # Arguments\n\n* `enable` - Pointer to output the spacial dithering state to."] + #[doc = "Gets whether to use spacial dithering.\n # Arguments\n\n* `enable` - Pointer to output the spacial dithering state to."] pub fn Y2RU_GetSpacialDithering(enabled: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Sets whether to use temporal dithering.\n # Arguments\n\n* `enable` - Whether to use temporal dithering."] + #[doc = "Sets whether to use temporal dithering.\n # Arguments\n\n* `enable` - Whether to use temporal dithering."] pub fn Y2RU_SetTemporalDithering(enable: bool) -> Result; } extern "C" { #[must_use] - #[doc = " Gets whether to use temporal dithering.\n # Arguments\n\n* `enable` - Pointer to output the temporal dithering state to."] + #[doc = "Gets whether to use temporal dithering.\n # Arguments\n\n* `enable` - Pointer to output the temporal dithering state to."] pub fn Y2RU_GetTemporalDithering(enabled: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Used to configure the width of the image.\n # Arguments\n\n* `line_width` - Width of the image in pixels. Must be a multiple of 8, up to 1024.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] + #[doc = "Used to configure the width of the image.\n # Arguments\n\n* `line_width` - Width of the image in pixels. Must be a multiple of 8, up to 1024.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] pub fn Y2RU_SetInputLineWidth(line_width: u16_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the configured input line width.\n # Arguments\n\n* `line_width` - Pointer to output the line width to."] + #[doc = "Gets the configured input line width.\n # Arguments\n\n* `line_width` - Pointer to output the line width to."] pub fn Y2RU_GetInputLineWidth(line_width: *mut u16_) -> Result; } extern "C" { #[must_use] - #[doc = " Used to configure the height of the image.\n # Arguments\n\n* `num_lines` - Number of lines to be converted.\n\n A multiple of 8 seems to be preferred.\n If using the BLOCK_8_BY_8 mode, it must be a multiple of 8.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] + #[doc = "Used to configure the height of the image.\n # Arguments\n\n* `num_lines` - Number of lines to be converted.\n\n A multiple of 8 seems to be preferred.\n If using the BLOCK_8_BY_8 mode, it must be a multiple of 8.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] pub fn Y2RU_SetInputLines(num_lines: u16_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the configured number of input lines.\n # Arguments\n\n* `num_lines` - Pointer to output the input lines to."] + #[doc = "Gets the configured number of input lines.\n # Arguments\n\n* `num_lines` - Pointer to output the input lines to."] pub fn Y2RU_GetInputLines(num_lines: *mut u16_) -> Result; } extern "C" { #[must_use] - #[doc = " Used to configure the color conversion formula.\n # Arguments\n\n* `coefficients` - Coefficients to use.\n\n See Y2RU_ColorCoefficients for more information about the coefficients.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] + #[doc = "Used to configure the color conversion formula.\n # Arguments\n\n* `coefficients` - Coefficients to use.\n\n See Y2RU_ColorCoefficients for more information about the coefficients.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] pub fn Y2RU_SetCoefficients(coefficients: *const Y2RU_ColorCoefficients) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the configured color coefficients.\n # Arguments\n\n* `num_lines` - Pointer to output the coefficients to."] + #[doc = "Gets the configured color coefficients.\n # Arguments\n\n* `num_lines` - Pointer to output the coefficients to."] pub fn Y2RU_GetCoefficients(coefficients: *mut Y2RU_ColorCoefficients) -> Result; } extern "C" { #[must_use] - #[doc = " Used to configure the color conversion formula with ITU stantards coefficients.\n # Arguments\n\n* `coefficient` - Standard coefficient to use.\n\n See Y2RU_ColorCoefficients for more information about the coefficients.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] + #[doc = "Used to configure the color conversion formula with ITU stantards coefficients.\n # Arguments\n\n* `coefficient` - Standard coefficient to use.\n\n See Y2RU_ColorCoefficients for more information about the coefficients.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] pub fn Y2RU_SetStandardCoefficient(coefficient: Y2RU_StandardCoefficient) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the color coefficient parameters of a standard coefficient.\n # Arguments\n\n* `coefficients` - Pointer to output the coefficients to.\n * `standardCoeff` - Standard coefficient to check."] + #[doc = "Gets the color coefficient parameters of a standard coefficient.\n # Arguments\n\n* `coefficients` - Pointer to output the coefficients to.\n * `standardCoeff` - Standard coefficient to check."] pub fn Y2RU_GetStandardCoefficient( coefficients: *mut Y2RU_ColorCoefficients, standardCoeff: Y2RU_StandardCoefficient, @@ -8194,32 +8194,32 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Used to configure the alpha value of the output.\n # Arguments\n\n* `alpha` - 8-bit value to be used for the output when the format requires it.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] + #[doc = "Used to configure the alpha value of the output.\n # Arguments\n\n* `alpha` - 8-bit value to be used for the output when the format requires it.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] pub fn Y2RU_SetAlpha(alpha: u16_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the configured output alpha value.\n # Arguments\n\n* `alpha` - Pointer to output the alpha value to."] + #[doc = "Gets the configured output alpha value.\n # Arguments\n\n* `alpha` - Pointer to output the alpha value to."] pub fn Y2RU_GetAlpha(alpha: *mut u16_) -> Result; } extern "C" { #[must_use] - #[doc = " Used to enable the end of conversion interrupt.\n # Arguments\n\n* `should_interrupt` - Enables the interrupt if true, disable it if false.\n\n It is possible to fire an interrupt when the conversion is finished, and that the DMA is done copying the data.\n This interrupt will then be used to fire an event. See Y2RU_GetTransferEndEvent.\n By default the interrupt is enabled.\n\n > **Note:** It seems that the event can be fired too soon in some cases, depending the transfer_unit size.Please see the note at Y2RU_SetReceiving"] + #[doc = "Used to enable the end of conversion interrupt.\n # Arguments\n\n* `should_interrupt` - Enables the interrupt if true, disable it if false.\n\n It is possible to fire an interrupt when the conversion is finished, and that the DMA is done copying the data.\n This interrupt will then be used to fire an event. See Y2RU_GetTransferEndEvent.\n By default the interrupt is enabled.\n\n > **Note:** It seems that the event can be fired too soon in some cases, depending the transfer_unit size.Please see the note at Y2RU_SetReceiving"] pub fn Y2RU_SetTransferEndInterrupt(should_interrupt: bool) -> Result; } extern "C" { #[must_use] - #[doc = " Gets whether the transfer end interrupt is enabled.\n # Arguments\n\n* `should_interrupt` - Pointer to output the interrupt state to."] + #[doc = "Gets whether the transfer end interrupt is enabled.\n # Arguments\n\n* `should_interrupt` - Pointer to output the interrupt state to."] pub fn Y2RU_GetTransferEndInterrupt(should_interrupt: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Gets an handle to the end of conversion event.\n # Arguments\n\n* `end_event` - Pointer to the event handle to be set to the end of conversion event. It isn't necessary to create or close this handle.\n\n To enable this event you have to use C} Y2RU_SetTransferEndInterrupt(true);The event will be triggered when the corresponding interrupt is fired.\n\n > **Note:** It is recommended to use a timeout when waiting on this event, as it sometimes (but rarely) isn't triggered."] + #[doc = "Gets an handle to the end of conversion event.\n # Arguments\n\n* `end_event` - Pointer to the event handle to be set to the end of conversion event. It isn't necessary to create or close this handle.\n\n To enable this event you have to use C} Y2RU_SetTransferEndInterrupt(true);The event will be triggered when the corresponding interrupt is fired.\n\n > **Note:** It is recommended to use a timeout when waiting on this event, as it sometimes (but rarely) isn't triggered."] pub fn Y2RU_GetTransferEndEvent(end_event: *mut Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Configures the Y plane buffer.\n # Arguments\n\n* `src_buf` - A pointer to the beginning of your Y data buffer.\n * `image_size` - The total size of the data buffer.\n * `transfer_unit` - Specifies the size of 1 DMA transfer. Usually set to 1 line. This has to be a divisor of image_size.\n * `transfer_gap` - Specifies the gap (offset) to be added after each transfer. Can be used to convert images with stride or only a part of it.\n\n transfer_unit+transfer_gap must be less than 32768 (0x8000)\n\n This specifies the Y data buffer for the planar input formats (INPUT_YUV42*_INDIV_*).\n The actual transfer will only happen after calling Y2RU_StartConversion."] + #[doc = "Configures the Y plane buffer.\n # Arguments\n\n* `src_buf` - A pointer to the beginning of your Y data buffer.\n * `image_size` - The total size of the data buffer.\n * `transfer_unit` - Specifies the size of 1 DMA transfer. Usually set to 1 line. This has to be a divisor of image_size.\n * `transfer_gap` - Specifies the gap (offset) to be added after each transfer. Can be used to convert images with stride or only a part of it.\n\n transfer_unit+transfer_gap must be less than 32768 (0x8000)\n\n This specifies the Y data buffer for the planar input formats (INPUT_YUV42*_INDIV_*).\n The actual transfer will only happen after calling Y2RU_StartConversion."] pub fn Y2RU_SetSendingY( src_buf: *const ::libc::c_void, image_size: u32_, @@ -8229,7 +8229,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Configures the U plane buffer.\n # Arguments\n\n* `src_buf` - A pointer to the beginning of your Y data buffer.\n * `image_size` - The total size of the data buffer.\n * `transfer_unit` - Specifies the size of 1 DMA transfer. Usually set to 1 line. This has to be a divisor of image_size.\n * `transfer_gap` - Specifies the gap (offset) to be added after each transfer. Can be used to convert images with stride or only a part of it.\n\n transfer_unit+transfer_gap must be less than 32768 (0x8000)\n\n This specifies the U data buffer for the planar input formats (INPUT_YUV42*_INDIV_*).\n The actual transfer will only happen after calling Y2RU_StartConversion."] + #[doc = "Configures the U plane buffer.\n # Arguments\n\n* `src_buf` - A pointer to the beginning of your Y data buffer.\n * `image_size` - The total size of the data buffer.\n * `transfer_unit` - Specifies the size of 1 DMA transfer. Usually set to 1 line. This has to be a divisor of image_size.\n * `transfer_gap` - Specifies the gap (offset) to be added after each transfer. Can be used to convert images with stride or only a part of it.\n\n transfer_unit+transfer_gap must be less than 32768 (0x8000)\n\n This specifies the U data buffer for the planar input formats (INPUT_YUV42*_INDIV_*).\n The actual transfer will only happen after calling Y2RU_StartConversion."] pub fn Y2RU_SetSendingU( src_buf: *const ::libc::c_void, image_size: u32_, @@ -8239,7 +8239,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Configures the V plane buffer.\n # Arguments\n\n* `src_buf` - A pointer to the beginning of your Y data buffer.\n * `image_size` - The total size of the data buffer.\n * `transfer_unit` - Specifies the size of 1 DMA transfer. Usually set to 1 line. This has to be a divisor of image_size.\n * `transfer_gap` - Specifies the gap (offset) to be added after each transfer. Can be used to convert images with stride or only a part of it.\n\n transfer_unit+transfer_gap must be less than 32768 (0x8000)\n\n This specifies the V data buffer for the planar input formats (INPUT_YUV42*_INDIV_*).\n The actual transfer will only happen after calling Y2RU_StartConversion."] + #[doc = "Configures the V plane buffer.\n # Arguments\n\n* `src_buf` - A pointer to the beginning of your Y data buffer.\n * `image_size` - The total size of the data buffer.\n * `transfer_unit` - Specifies the size of 1 DMA transfer. Usually set to 1 line. This has to be a divisor of image_size.\n * `transfer_gap` - Specifies the gap (offset) to be added after each transfer. Can be used to convert images with stride or only a part of it.\n\n transfer_unit+transfer_gap must be less than 32768 (0x8000)\n\n This specifies the V data buffer for the planar input formats (INPUT_YUV42*_INDIV_*).\n The actual transfer will only happen after calling Y2RU_StartConversion."] pub fn Y2RU_SetSendingV( src_buf: *const ::libc::c_void, image_size: u32_, @@ -8249,7 +8249,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Configures the YUYV source buffer.\n # Arguments\n\n* `src_buf` - A pointer to the beginning of your Y data buffer.\n * `image_size` - The total size of the data buffer.\n * `transfer_unit` - Specifies the size of 1 DMA transfer. Usually set to 1 line. This has to be a divisor of image_size.\n * `transfer_gap` - Specifies the gap (offset) to be added after each transfer. Can be used to convert images with stride or only a part of it.\n\n transfer_unit+transfer_gap must be less than 32768 (0x8000)\n\n This specifies the YUYV data buffer for the packed input format INPUT_YUV422_BATCH.\n The actual transfer will only happen after calling Y2RU_StartConversion."] + #[doc = "Configures the YUYV source buffer.\n # Arguments\n\n* `src_buf` - A pointer to the beginning of your Y data buffer.\n * `image_size` - The total size of the data buffer.\n * `transfer_unit` - Specifies the size of 1 DMA transfer. Usually set to 1 line. This has to be a divisor of image_size.\n * `transfer_gap` - Specifies the gap (offset) to be added after each transfer. Can be used to convert images with stride or only a part of it.\n\n transfer_unit+transfer_gap must be less than 32768 (0x8000)\n\n This specifies the YUYV data buffer for the packed input format INPUT_YUV422_BATCH.\n The actual transfer will only happen after calling Y2RU_StartConversion."] pub fn Y2RU_SetSendingYUYV( src_buf: *const ::libc::c_void, image_size: u32_, @@ -8259,7 +8259,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Configures the destination buffer.\n # Arguments\n\n* `src_buf` - A pointer to the beginning of your destination buffer in FCRAM\n * `image_size` - The total size of the data buffer.\n * `transfer_unit` - Specifies the size of 1 DMA transfer. Usually set to 1 line. This has to be a divisor of image_size.\n * `transfer_gap` - Specifies the gap (offset) to be added after each transfer. Can be used to convert images with stride or only a part of it.\n\n This specifies the destination buffer of the conversion.\n The actual transfer will only happen after calling Y2RU_StartConversion.\n The buffer does NOT need to be allocated in the linear heap.\n\n transfer_unit+transfer_gap must be less than 32768 (0x8000)\n\n > **Note:** It seems that depending on the size of the image and of the transfer unit, it is possible for the end of conversion interrupt to be triggered right after the conversion began. One line as transfer_unit seems to trigger this issue for 400x240, setting to 2/4/8 lines fixes it.\n\n > **Note:** Setting a transfer_unit of 4 or 8 lines seems to bring the best results in terms of speed for a 400x240 image."] + #[doc = "Configures the destination buffer.\n # Arguments\n\n* `src_buf` - A pointer to the beginning of your destination buffer in FCRAM\n * `image_size` - The total size of the data buffer.\n * `transfer_unit` - Specifies the size of 1 DMA transfer. Usually set to 1 line. This has to be a divisor of image_size.\n * `transfer_gap` - Specifies the gap (offset) to be added after each transfer. Can be used to convert images with stride or only a part of it.\n\n This specifies the destination buffer of the conversion.\n The actual transfer will only happen after calling Y2RU_StartConversion.\n The buffer does NOT need to be allocated in the linear heap.\n\n transfer_unit+transfer_gap must be less than 32768 (0x8000)\n\n > **Note:** It seems that depending on the size of the image and of the transfer unit,it is possible for the end of conversion interrupt to be triggered right after the conversion began.One line as transfer_unit seems to trigger this issue for 400x240, setting to 2/4/8 lines fixes it.\n\n > **Note:** Setting a transfer_unit of 4 or 8 lines seems to bring the best results in terms of speed for a 400x240 image."] pub fn Y2RU_SetReceiving( dst_buf: *mut ::libc::c_void, image_size: u32_, @@ -8269,72 +8269,72 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Checks if the DMA has finished sending the Y buffer.\n # Arguments\n\n* `is_done` - Pointer to the boolean that will hold the result.\n\n True if the DMA has finished transferring the Y plane, false otherwise. To be used with Y2RU_SetSendingY."] + #[doc = "Checks if the DMA has finished sending the Y buffer.\n # Arguments\n\n* `is_done` - Pointer to the boolean that will hold the result.\n\n True if the DMA has finished transferring the Y plane, false otherwise. To be used with Y2RU_SetSendingY."] pub fn Y2RU_IsDoneSendingY(is_done: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Checks if the DMA has finished sending the U buffer.\n # Arguments\n\n* `is_done` - Pointer to the boolean that will hold the result.\n\n True if the DMA has finished transferring the U plane, false otherwise. To be used with Y2RU_SetSendingU."] + #[doc = "Checks if the DMA has finished sending the U buffer.\n # Arguments\n\n* `is_done` - Pointer to the boolean that will hold the result.\n\n True if the DMA has finished transferring the U plane, false otherwise. To be used with Y2RU_SetSendingU."] pub fn Y2RU_IsDoneSendingU(is_done: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Checks if the DMA has finished sending the V buffer.\n # Arguments\n\n* `is_done` - Pointer to the boolean that will hold the result.\n\n True if the DMA has finished transferring the V plane, false otherwise. To be used with Y2RU_SetSendingV."] + #[doc = "Checks if the DMA has finished sending the V buffer.\n # Arguments\n\n* `is_done` - Pointer to the boolean that will hold the result.\n\n True if the DMA has finished transferring the V plane, false otherwise. To be used with Y2RU_SetSendingV."] pub fn Y2RU_IsDoneSendingV(is_done: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Checks if the DMA has finished sending the YUYV buffer.\n # Arguments\n\n* `is_done` - Pointer to the boolean that will hold the result.\n\n True if the DMA has finished transferring the YUYV buffer, false otherwise. To be used with Y2RU_SetSendingYUYV."] + #[doc = "Checks if the DMA has finished sending the YUYV buffer.\n # Arguments\n\n* `is_done` - Pointer to the boolean that will hold the result.\n\n True if the DMA has finished transferring the YUYV buffer, false otherwise. To be used with Y2RU_SetSendingYUYV."] pub fn Y2RU_IsDoneSendingYUYV(is_done: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Checks if the DMA has finished sending the converted result.\n # Arguments\n\n* `is_done` - Pointer to the boolean that will hold the result.\n\n True if the DMA has finished transferring data to your destination buffer, false otherwise."] + #[doc = "Checks if the DMA has finished sending the converted result.\n # Arguments\n\n* `is_done` - Pointer to the boolean that will hold the result.\n\n True if the DMA has finished transferring data to your destination buffer, false otherwise."] pub fn Y2RU_IsDoneReceiving(is_done: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Configures the dithering weight parameters.\n # Arguments\n\n* `params` - Dithering weight parameters to use."] + #[doc = "Configures the dithering weight parameters.\n # Arguments\n\n* `params` - Dithering weight parameters to use."] pub fn Y2RU_SetDitheringWeightParams(params: *const Y2RU_DitheringWeightParams) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the configured dithering weight parameters.\n # Arguments\n\n* `params` - Pointer to output the dithering weight parameters to."] + #[doc = "Gets the configured dithering weight parameters.\n # Arguments\n\n* `params` - Pointer to output the dithering weight parameters to."] pub fn Y2RU_GetDitheringWeightParams(params: *mut Y2RU_DitheringWeightParams) -> Result; } extern "C" { #[must_use] - #[doc = " Sets all of the parameters of Y2RU_ConversionParams at once.\n # Arguments\n\n* `params` - Conversion parameters to set.\n\n Faster than calling the individual value through Y2R_Set* because only one system call is made."] + #[doc = "Sets all of the parameters of Y2RU_ConversionParams at once.\n # Arguments\n\n* `params` - Conversion parameters to set.\n\n Faster than calling the individual value through Y2R_Set* because only one system call is made."] pub fn Y2RU_SetConversionParams(params: *const Y2RU_ConversionParams) -> Result; } extern "C" { #[must_use] - #[doc = " Starts the conversion process"] + #[doc = "Starts the conversion process"] pub fn Y2RU_StartConversion() -> Result; } extern "C" { #[must_use] - #[doc = " Cancels the conversion"] + #[doc = "Cancels the conversion"] pub fn Y2RU_StopConversion() -> Result; } extern "C" { #[must_use] - #[doc = " Checks if the conversion and DMA transfer are finished.\n # Arguments\n\n* `is_busy` - Pointer to output the busy state to.\n\n This can have the same problems as the event and interrupt. See Y2RU_SetTransferEndInterrupt."] + #[doc = "Checks if the conversion and DMA transfer are finished.\n # Arguments\n\n* `is_busy` - Pointer to output the busy state to.\n\n This can have the same problems as the event and interrupt. See Y2RU_SetTransferEndInterrupt."] pub fn Y2RU_IsBusyConversion(is_busy: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Checks whether Y2R is ready to be used.\n # Arguments\n\n* `ping` - Pointer to output the ready status to."] + #[doc = "Checks whether Y2R is ready to be used.\n # Arguments\n\n* `ping` - Pointer to output the ready status to."] pub fn Y2RU_PingProcess(ping: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Initializes the Y2R driver."] + #[doc = "Initializes the Y2R driver."] pub fn Y2RU_DriverInitialize() -> Result; } extern "C" { #[must_use] - #[doc = " Terminates the Y2R driver."] + #[doc = "Terminates the Y2R driver."] pub fn Y2RU_DriverFinalize() -> Result; } #[doc = "< No port."] @@ -8345,7 +8345,7 @@ pub const PORT_CAM1: _bindgen_ty_15 = 1; pub const PORT_CAM2: _bindgen_ty_15 = 2; #[doc = "< Both ports."] pub const PORT_BOTH: _bindgen_ty_15 = 3; -#[doc = " Camera connection target ports."] +#[doc = "Camera connection target ports."] pub type _bindgen_ty_15 = ::libc::c_uint; #[doc = "< No camera."] pub const SELECT_NONE: _bindgen_ty_16 = 0; @@ -8363,7 +8363,7 @@ pub const SELECT_OUT1_OUT2: _bindgen_ty_16 = 5; pub const SELECT_IN1_OUT2: _bindgen_ty_16 = 6; #[doc = "< All cameras."] pub const SELECT_ALL: _bindgen_ty_16 = 7; -#[doc = " Camera combinations."] +#[doc = "Camera combinations."] pub type _bindgen_ty_16 = ::libc::c_uint; #[doc = "< No context."] pub const CONTEXT_NONE: CAMU_Context = 0; @@ -8373,7 +8373,7 @@ pub const CONTEXT_A: CAMU_Context = 1; pub const CONTEXT_B: CAMU_Context = 2; #[doc = "< Both contexts."] pub const CONTEXT_BOTH: CAMU_Context = 3; -#[doc = " Camera contexts."] +#[doc = "Camera contexts."] pub type CAMU_Context = ::libc::c_uint; #[doc = "< No flip."] pub const FLIP_NONE: CAMU_Flip = 0; @@ -8383,27 +8383,27 @@ pub const FLIP_HORIZONTAL: CAMU_Flip = 1; pub const FLIP_VERTICAL: CAMU_Flip = 2; #[doc = "< Reverse flip."] pub const FLIP_REVERSE: CAMU_Flip = 3; -#[doc = " Ways to flip the camera image."] +#[doc = "Ways to flip the camera image."] pub type CAMU_Flip = ::libc::c_uint; -#[doc = "< VGA size. (640x480)"] +#[doc = "< VGA size. (640x480)"] pub const SIZE_VGA: CAMU_Size = 0; -#[doc = "< QVGA size. (320x240)"] +#[doc = "< QVGA size. (320x240)"] pub const SIZE_QVGA: CAMU_Size = 1; -#[doc = "< QQVGA size. (160x120)"] +#[doc = "< QQVGA size. (160x120)"] pub const SIZE_QQVGA: CAMU_Size = 2; -#[doc = "< CIF size. (352x288)"] +#[doc = "< CIF size. (352x288)"] pub const SIZE_CIF: CAMU_Size = 3; -#[doc = "< QCIF size. (176x144)"] +#[doc = "< QCIF size. (176x144)"] pub const SIZE_QCIF: CAMU_Size = 4; -#[doc = "< DS LCD size. (256x192)"] +#[doc = "< DS LCD size. (256x192)"] pub const SIZE_DS_LCD: CAMU_Size = 5; -#[doc = "< DS LCD x4 size. (512x384)"] +#[doc = "< DS LCD x4 size. (512x384)"] pub const SIZE_DS_LCDx4: CAMU_Size = 6; #[doc = "< CTR Top LCD size. (400x240)"] pub const SIZE_CTR_TOP_LCD: CAMU_Size = 7; #[doc = "< CTR Bottom LCD size. (320x240)"] pub const SIZE_CTR_BOTTOM_LCD: CAMU_Size = 1; -#[doc = " Camera image resolutions."] +#[doc = "Camera image resolutions."] pub type CAMU_Size = ::libc::c_uint; #[doc = "< 15 FPS."] pub const FRAME_RATE_15: CAMU_FrameRate = 0; @@ -8431,7 +8431,7 @@ pub const FRAME_RATE_15_TO_10: CAMU_FrameRate = 10; pub const FRAME_RATE_20_TO_10: CAMU_FrameRate = 11; #[doc = "< 30-10 FPS."] pub const FRAME_RATE_30_TO_10: CAMU_FrameRate = 12; -#[doc = " Camera capture frame rates."] +#[doc = "Camera capture frame rates."] pub type CAMU_FrameRate = ::libc::c_uint; #[doc = "< Auto white balance."] pub const WHITE_BALANCE_AUTO: CAMU_WhiteBalance = 0; @@ -8452,7 +8452,7 @@ 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; -#[doc = " Camera white balance modes."] +#[doc = "Camera white balance modes."] pub type CAMU_WhiteBalance = ::libc::c_uint; #[doc = "< Normal mode."] pub const PHOTO_MODE_NORMAL: CAMU_PhotoMode = 0; @@ -8464,7 +8464,7 @@ pub const PHOTO_MODE_LANDSCAPE: CAMU_PhotoMode = 2; pub const PHOTO_MODE_NIGHTVIEW: CAMU_PhotoMode = 3; #[doc = "< Letter mode."] pub const PHOTO_MODE_LETTER: CAMU_PhotoMode = 4; -#[doc = " Camera photo modes."] +#[doc = "Camera photo modes."] pub type CAMU_PhotoMode = ::libc::c_uint; #[doc = "< No effects."] pub const EFFECT_NONE: CAMU_Effect = 0; @@ -8478,7 +8478,7 @@ pub const EFFECT_NEGATIVE: CAMU_Effect = 3; pub const EFFECT_NEGAFILM: CAMU_Effect = 4; #[doc = "< Sepia effect."] pub const EFFECT_SEPIA01: CAMU_Effect = 5; -#[doc = " Camera special effects."] +#[doc = "Camera special effects."] pub type CAMU_Effect = ::libc::c_uint; #[doc = "< Pattern 1."] pub const CONTRAST_PATTERN_01: CAMU_Contrast = 0; @@ -8502,13 +8502,13 @@ pub const CONTRAST_PATTERN_09: CAMU_Contrast = 8; pub const CONTRAST_PATTERN_10: CAMU_Contrast = 9; #[doc = "< Pattern 11."] pub const CONTRAST_PATTERN_11: CAMU_Contrast = 10; -#[doc = "< Low contrast. (5)"] +#[doc = "< Low contrast. (5)"] pub const CONTRAST_LOW: CAMU_Contrast = 4; #[doc = "< Normal contrast. (6)"] pub const CONTRAST_NORMAL: CAMU_Contrast = 5; -#[doc = "< High contrast. (7)"] +#[doc = "< High contrast. (7)"] pub const CONTRAST_HIGH: CAMU_Contrast = 6; -#[doc = " Camera contrast patterns."] +#[doc = "Camera contrast patterns."] pub type CAMU_Contrast = ::libc::c_uint; #[doc = "< No lens correction."] pub const LENS_CORRECTION_OFF: CAMU_LensCorrection = 0; @@ -8516,19 +8516,19 @@ pub const LENS_CORRECTION_OFF: CAMU_LensCorrection = 0; pub const LENS_CORRECTION_ON_70: CAMU_LensCorrection = 1; #[doc = "< Edge-to-center brightness ratio of 90."] pub const LENS_CORRECTION_ON_90: CAMU_LensCorrection = 2; -#[doc = "< Dark lens correction. (OFF)"] +#[doc = "< Dark lens correction. (OFF)"] pub const LENS_CORRECTION_DARK: CAMU_LensCorrection = 0; #[doc = "< Normal lens correction. (70)"] pub const LENS_CORRECTION_NORMAL: CAMU_LensCorrection = 1; #[doc = "< Bright lens correction. (90)"] pub const LENS_CORRECTION_BRIGHT: CAMU_LensCorrection = 2; -#[doc = " Camera lens correction modes."] +#[doc = "Camera lens correction modes."] pub type CAMU_LensCorrection = ::libc::c_uint; #[doc = "< YUV422"] pub const OUTPUT_YUV_422: CAMU_OutputFormat = 0; #[doc = "< RGB565"] pub const OUTPUT_RGB_565: CAMU_OutputFormat = 1; -#[doc = " Camera image output formats."] +#[doc = "Camera image output formats."] pub type CAMU_OutputFormat = ::libc::c_uint; #[doc = "< Normal shutter sound."] pub const SHUTTER_SOUND_TYPE_NORMAL: CAMU_ShutterSoundType = 0; @@ -8536,9 +8536,9 @@ pub const SHUTTER_SOUND_TYPE_NORMAL: CAMU_ShutterSoundType = 0; pub const SHUTTER_SOUND_TYPE_MOVIE: CAMU_ShutterSoundType = 1; #[doc = "< Shutter sound to end a movie."] pub const SHUTTER_SOUND_TYPE_MOVIE_END: CAMU_ShutterSoundType = 2; -#[doc = " Camera shutter sounds."] +#[doc = "Camera shutter sounds."] pub type CAMU_ShutterSoundType = ::libc::c_uint; -#[doc = " Image quality calibration data."] +#[doc = "Image quality calibration data."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct CAMU_ImageQualityCalibrationData { @@ -8565,7 +8565,7 @@ pub struct CAMU_ImageQualityCalibrationData { #[doc = "< Left camera, color correction matrix position threshold."] pub awbX0Left: u16_, } -#[doc = " Stereo camera calibration data."] +#[doc = "Stereo camera calibration data."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct CAMU_StereoCameraCalibrationData { @@ -8600,7 +8600,7 @@ pub struct CAMU_StereoCameraCalibrationData { #[doc = "< Reserved for future use. (unused)"] pub reserved: [u8_; 16usize], } -#[doc = " Batch camera configuration for use without a context."] +#[doc = "Batch camera configuration for use without a context."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct CAMU_PackageParameterCameraSelect { @@ -8645,7 +8645,7 @@ pub struct CAMU_PackageParameterCameraSelect { #[doc = "< Height of the region to use for auto white balance."] pub autoWhiteBalanceWindowHeight: s16, } -#[doc = " Batch camera configuration for use with a context."] +#[doc = "Batch camera configuration for use with a context."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct CAMU_PackageParameterContext { @@ -8660,7 +8660,7 @@ pub struct CAMU_PackageParameterContext { #[doc = "< #CAMU_Size Camera image resolution."] pub size: u8_, } -#[doc = " Batch camera configuration for use with a context and with detailed size information."] +#[doc = "Batch camera configuration for use with a context and with detailed size information."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct CAMU_PackageParameterContextDetail { @@ -8687,46 +8687,46 @@ pub struct CAMU_PackageParameterContextDetail { } extern "C" { #[must_use] - #[doc = " Initializes the cam service.\n\n This will internally get the handle of the service, and on success call CAMU_DriverInitialize."] + #[doc = "Initializes the cam service.\n\n This will internally get the handle of the service, and on success call CAMU_DriverInitialize."] pub fn camInit() -> Result; } extern "C" { - #[doc = " Closes the cam service.\n\n This will internally call CAMU_DriverFinalize and close the handle of the service."] + #[doc = "Closes the cam service.\n\n This will internally call CAMU_DriverFinalize and close the handle of the service."] pub fn camExit(); } extern "C" { #[must_use] - #[doc = " Begins capture on the specified camera port.\n # Arguments\n\n* `port` - Port to begin capture on."] + #[doc = "Begins capture on the specified camera port.\n # Arguments\n\n* `port` - Port to begin capture on."] pub fn CAMU_StartCapture(port: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Terminates capture on the specified camera port.\n # Arguments\n\n* `port` - Port to terminate capture on."] + #[doc = "Terminates capture on the specified camera port.\n # Arguments\n\n* `port` - Port to terminate capture on."] pub fn CAMU_StopCapture(port: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets whether the specified camera port is busy.\n # Arguments\n\n* `busy` - Pointer to output the busy state to.\n * `port` - Port to check."] + #[doc = "Gets whether the specified camera port is busy.\n # Arguments\n\n* `busy` - Pointer to output the busy state to.\n * `port` - Port to check."] pub fn CAMU_IsBusy(busy: *mut bool, port: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Clears the buffer and error flags of the specified camera port.\n # Arguments\n\n* `port` - Port to clear."] + #[doc = "Clears the buffer and error flags of the specified camera port.\n # Arguments\n\n* `port` - Port to clear."] pub fn CAMU_ClearBuffer(port: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets a handle to the event signaled on vsync interrupts.\n # Arguments\n\n* `event` - Pointer to output the event handle to.\n * `port` - Port to use."] + #[doc = "Gets a handle to the event signaled on vsync interrupts.\n # Arguments\n\n* `event` - Pointer to output the event handle to.\n * `port` - Port to use."] pub fn CAMU_GetVsyncInterruptEvent(event: *mut Handle, port: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets a handle to the event signaled on camera buffer errors.\n # Arguments\n\n* `event` - Pointer to output the event handle to.\n * `port` - Port to use."] + #[doc = "Gets a handle to the event signaled on camera buffer errors.\n # Arguments\n\n* `event` - Pointer to output the event handle to.\n * `port` - Port to use."] pub fn CAMU_GetBufferErrorInterruptEvent(event: *mut Handle, port: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Initiates the process of receiving a camera frame.\n # Arguments\n\n* `event` - Pointer to output the completion event handle to.\n * `dst` - Buffer to write data to.\n * `port` - Port to receive from.\n * `imageSize` - Size of the image to receive.\n * `transferUnit` - Transfer unit to use when receiving."] + #[doc = "Initiates the process of receiving a camera frame.\n # Arguments\n\n* `event` - Pointer to output the completion event handle to.\n * `dst` - Buffer to write data to.\n * `port` - Port to receive from.\n * `imageSize` - Size of the image to receive.\n * `transferUnit` - Transfer unit to use when receiving."] pub fn CAMU_SetReceiving( event: *mut Handle, dst: *mut ::libc::c_void, @@ -8737,47 +8737,47 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets whether the specified camera port has finished receiving image data.\n # Arguments\n\n* `finishedReceiving` - Pointer to output the receiving status to.\n * `port` - Port to check."] + #[doc = "Gets whether the specified camera port has finished receiving image data.\n # Arguments\n\n* `finishedReceiving` - Pointer to output the receiving status to.\n * `port` - Port to check."] pub fn CAMU_IsFinishedReceiving(finishedReceiving: *mut bool, port: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the number of lines to transfer into an image buffer.\n # Arguments\n\n* `port` - Port to use.\n * `lines` - Lines to transfer.\n * `width` - Width of the image.\n * `height` - Height of the image."] + #[doc = "Sets the number of lines to transfer into an image buffer.\n # Arguments\n\n* `port` - Port to use.\n * `lines` - Lines to transfer.\n * `width` - Width of the image.\n * `height` - Height of the image."] pub fn CAMU_SetTransferLines(port: u32_, lines: s16, width: s16, height: s16) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the maximum number of lines that can be saved to an image buffer.\n # Arguments\n\n* `maxLines` - Pointer to write the maximum number of lines to.\n * `width` - Width of the image.\n * `height` - Height of the image."] + #[doc = "Gets the maximum number of lines that can be saved to an image buffer.\n # Arguments\n\n* `maxLines` - Pointer to write the maximum number of lines to.\n * `width` - Width of the image.\n * `height` - Height of the image."] pub fn CAMU_GetMaxLines(maxLines: *mut s16, width: s16, height: s16) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the number of bytes to transfer into an image buffer.\n # Arguments\n\n* `port` - Port to use.\n * `bytes` - Bytes to transfer.\n * `width` - Width of the image.\n * `height` - Height of the image."] + #[doc = "Sets the number of bytes to transfer into an image buffer.\n # Arguments\n\n* `port` - Port to use.\n * `bytes` - Bytes to transfer.\n * `width` - Width of the image.\n * `height` - Height of the image."] pub fn CAMU_SetTransferBytes(port: u32_, bytes: u32_, width: s16, height: s16) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the number of bytes to transfer into an image buffer.\n # Arguments\n\n* `transferBytes` - Pointer to write the number of bytes to.\n * `port` - Port to use."] + #[doc = "Gets the number of bytes to transfer into an image buffer.\n # Arguments\n\n* `transferBytes` - Pointer to write the number of bytes to.\n * `port` - Port to use."] pub fn CAMU_GetTransferBytes(transferBytes: *mut u32_, port: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the maximum number of bytes that can be saved to an image buffer.\n # Arguments\n\n* `maxBytes` - Pointer to write the maximum number of bytes to.\n * `width` - Width of the image.\n * `height` - Height of the image."] + #[doc = "Gets the maximum number of bytes that can be saved to an image buffer.\n # Arguments\n\n* `maxBytes` - Pointer to write the maximum number of bytes to.\n * `width` - Width of the image.\n * `height` - Height of the image."] pub fn CAMU_GetMaxBytes(maxBytes: *mut u32_, width: s16, height: s16) -> Result; } extern "C" { #[must_use] - #[doc = " Sets whether image trimming is enabled.\n # Arguments\n\n* `port` - Port to use.\n * `trimming` - Whether image trimming is enabled."] + #[doc = "Sets whether image trimming is enabled.\n # Arguments\n\n* `port` - Port to use.\n * `trimming` - Whether image trimming is enabled."] pub fn CAMU_SetTrimming(port: u32_, trimming: bool) -> Result; } extern "C" { #[must_use] - #[doc = " Gets whether image trimming is enabled.\n # Arguments\n\n* `trimming` - Pointer to output the trim state to.\n * `port` - Port to use."] + #[doc = "Gets whether image trimming is enabled.\n # Arguments\n\n* `trimming` - Pointer to output the trim state to.\n * `port` - Port to use."] pub fn CAMU_IsTrimming(trimming: *mut bool, port: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the parameters used for trimming images.\n # Arguments\n\n* `port` - Port to use.\n * `xStart` - Start X coordinate.\n * `yStart` - Start Y coordinate.\n * `xEnd` - End X coordinate.\n * `yEnd` - End Y coordinate."] + #[doc = "Sets the parameters used for trimming images.\n # Arguments\n\n* `port` - Port to use.\n * `xStart` - Start X coordinate.\n * `yStart` - Start Y coordinate.\n * `xEnd` - End X coordinate.\n * `yEnd` - End Y coordinate."] pub fn CAMU_SetTrimmingParams( port: u32_, xStart: s16, @@ -8788,7 +8788,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets the parameters used for trimming images.\n # Arguments\n\n* `xStart` - Pointer to write the start X coordinate to.\n * `yStart` - Pointer to write the start Y coordinate to.\n * `xEnd` - Pointer to write the end X coordinate to.\n * `yEnd` - Pointer to write the end Y coordinate to.\n * `port` - Port to use."] + #[doc = "Gets the parameters used for trimming images.\n # Arguments\n\n* `xStart` - Pointer to write the start X coordinate to.\n * `yStart` - Pointer to write the start Y coordinate to.\n * `xEnd` - Pointer to write the end X coordinate to.\n * `yEnd` - Pointer to write the end Y coordinate to.\n * `port` - Port to use."] pub fn CAMU_GetTrimmingParams( xStart: *mut s16, yStart: *mut s16, @@ -8799,7 +8799,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Sets the parameters used for trimming images, relative to the center of the image.\n # Arguments\n\n* `port` - Port to use.\n * `trimWidth` - Trim width.\n * `trimHeight` - Trim height.\n * `camWidth` - Camera width.\n * `camHeight` - Camera height."] + #[doc = "Sets the parameters used for trimming images, relative to the center of the image.\n # Arguments\n\n* `port` - Port to use.\n * `trimWidth` - Trim width.\n * `trimHeight` - Trim height.\n * `camWidth` - Camera width.\n * `camHeight` - Camera height."] pub fn CAMU_SetTrimmingParamsCenter( port: u32_, trimWidth: s16, @@ -8810,27 +8810,27 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Activates the specified camera.\n # Arguments\n\n* `select` - Camera to use."] + #[doc = "Activates the specified camera.\n # Arguments\n\n* `select` - Camera to use."] pub fn CAMU_Activate(select: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Switches the specified camera's active context.\n # Arguments\n\n* `select` - Camera to use.\n * `context` - Context to use."] + #[doc = "Switches the specified camera's active context.\n # Arguments\n\n* `select` - Camera to use.\n * `context` - Context to use."] pub fn CAMU_SwitchContext(select: u32_, context: CAMU_Context) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the exposure value of the specified camera.\n # Arguments\n\n* `select` - Camera to use.\n * `exposure` - Exposure value to use."] + #[doc = "Sets the exposure value of the specified camera.\n # Arguments\n\n* `select` - Camera to use.\n * `exposure` - Exposure value to use."] pub fn CAMU_SetExposure(select: u32_, exposure: s8) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the white balance mode of the specified camera.\n # Arguments\n\n* `select` - Camera to use.\n * `whiteBalance` - White balance mode to use."] + #[doc = "Sets the white balance mode of the specified camera.\n # Arguments\n\n* `select` - Camera to use.\n * `whiteBalance` - White balance mode to use."] pub fn CAMU_SetWhiteBalance(select: u32_, whiteBalance: CAMU_WhiteBalance) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the white balance mode of the specified camera.\n TODO: Explain \"without base up\"?\n # Arguments\n\n* `select` - Camera to use.\n * `whiteBalance` - White balance mode to use."] + #[doc = "Sets the white balance mode of the specified camera.\n TODO: Explain \"without base up\"?\n # Arguments\n\n* `select` - Camera to use.\n * `whiteBalance` - White balance mode to use."] pub fn CAMU_SetWhiteBalanceWithoutBaseUp( select: u32_, whiteBalance: CAMU_WhiteBalance, @@ -8838,37 +8838,37 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Sets the sharpness of the specified camera.\n # Arguments\n\n* `select` - Camera to use.\n * `sharpness` - Sharpness to use."] + #[doc = "Sets the sharpness of the specified camera.\n # Arguments\n\n* `select` - Camera to use.\n * `sharpness` - Sharpness to use."] pub fn CAMU_SetSharpness(select: u32_, sharpness: s8) -> Result; } extern "C" { #[must_use] - #[doc = " Sets whether auto exposure is enabled on the specified camera.\n # Arguments\n\n* `select` - Camera to use.\n * `autoWhiteBalance` - Whether auto exposure is enabled."] + #[doc = "Sets whether auto exposure is enabled on the specified camera.\n # Arguments\n\n* `select` - Camera to use.\n * `autoWhiteBalance` - Whether auto exposure is enabled."] pub fn CAMU_SetAutoExposure(select: u32_, autoExposure: bool) -> Result; } extern "C" { #[must_use] - #[doc = " Gets whether auto exposure is enabled on the specified camera.\n # Arguments\n\n* `autoExposure` - Pointer to output the auto exposure state to.\n * `select` - Camera to use."] + #[doc = "Gets whether auto exposure is enabled on the specified camera.\n # Arguments\n\n* `autoExposure` - Pointer to output the auto exposure state to.\n * `select` - Camera to use."] pub fn CAMU_IsAutoExposure(autoExposure: *mut bool, select: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Sets whether auto white balance is enabled on the specified camera.\n # Arguments\n\n* `select` - Camera to use.\n * `autoWhiteBalance` - Whether auto white balance is enabled."] + #[doc = "Sets whether auto white balance is enabled on the specified camera.\n # Arguments\n\n* `select` - Camera to use.\n * `autoWhiteBalance` - Whether auto white balance is enabled."] pub fn CAMU_SetAutoWhiteBalance(select: u32_, autoWhiteBalance: bool) -> Result; } extern "C" { #[must_use] - #[doc = " Gets whether auto white balance is enabled on the specified camera.\n # Arguments\n\n* `autoWhiteBalance` - Pointer to output the auto white balance state to.\n * `select` - Camera to use."] + #[doc = "Gets whether auto white balance is enabled on the specified camera.\n # Arguments\n\n* `autoWhiteBalance` - Pointer to output the auto white balance state to.\n * `select` - Camera to use."] pub fn CAMU_IsAutoWhiteBalance(autoWhiteBalance: *mut bool, select: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Flips the image of the specified camera in the specified context.\n # Arguments\n\n* `select` - Camera to use.\n * `flip` - Flip mode to use.\n * `context` - Context to use."] + #[doc = "Flips the image of the specified camera in the specified context.\n # Arguments\n\n* `select` - Camera to use.\n * `flip` - Flip mode to use.\n * `context` - Context to use."] pub fn CAMU_FlipImage(select: u32_, flip: CAMU_Flip, context: CAMU_Context) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the image resolution of the given camera in the given context, in detail.\n # Arguments\n\n* `select` - Camera to use.\n * `width` - Width to use.\n * `height` - Height to use.\n * `cropX0` - First crop point X.\n * `cropY0` - First crop point Y.\n * `cropX1` - Second crop point X.\n * `cropY1` - Second crop point Y.\n * `context` - Context to use."] + #[doc = "Sets the image resolution of the given camera in the given context, in detail.\n # Arguments\n\n* `select` - Camera to use.\n * `width` - Width to use.\n * `height` - Height to use.\n * `cropX0` - First crop point X.\n * `cropY0` - First crop point Y.\n * `cropX1` - Second crop point X.\n * `cropY1` - Second crop point Y.\n * `context` - Context to use."] pub fn CAMU_SetDetailSize( select: u32_, width: s16, @@ -8882,37 +8882,37 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Sets the image resolution of the given camera in the given context.\n # Arguments\n\n* `select` - Camera to use.\n * `size` - Size to use.\n * `context` - Context to use."] + #[doc = "Sets the image resolution of the given camera in the given context.\n # Arguments\n\n* `select` - Camera to use.\n * `size` - Size to use.\n * `context` - Context to use."] pub fn CAMU_SetSize(select: u32_, size: CAMU_Size, context: CAMU_Context) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the frame rate of the given camera.\n # Arguments\n\n* `select` - Camera to use.\n * `frameRate` - Frame rate to use."] + #[doc = "Sets the frame rate of the given camera.\n # Arguments\n\n* `select` - Camera to use.\n * `frameRate` - Frame rate to use."] pub fn CAMU_SetFrameRate(select: u32_, frameRate: CAMU_FrameRate) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the photo mode of the given camera.\n # Arguments\n\n* `select` - Camera to use.\n * `photoMode` - Photo mode to use."] + #[doc = "Sets the photo mode of the given camera.\n # Arguments\n\n* `select` - Camera to use.\n * `photoMode` - Photo mode to use."] pub fn CAMU_SetPhotoMode(select: u32_, photoMode: CAMU_PhotoMode) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the special effects of the given camera in the given context.\n # Arguments\n\n* `select` - Camera to use.\n * `effect` - Effect to use.\n * `context` - Context to use."] + #[doc = "Sets the special effects of the given camera in the given context.\n # Arguments\n\n* `select` - Camera to use.\n * `effect` - Effect to use.\n * `context` - Context to use."] pub fn CAMU_SetEffect(select: u32_, effect: CAMU_Effect, context: CAMU_Context) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the contrast mode of the given camera.\n # Arguments\n\n* `select` - Camera to use.\n * `contrast` - Contrast mode to use."] + #[doc = "Sets the contrast mode of the given camera.\n # Arguments\n\n* `select` - Camera to use.\n * `contrast` - Contrast mode to use."] pub fn CAMU_SetContrast(select: u32_, contrast: CAMU_Contrast) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the lens correction mode of the given camera.\n # Arguments\n\n* `select` - Camera to use.\n * `lensCorrection` - Lens correction mode to use."] + #[doc = "Sets the lens correction mode of the given camera.\n # Arguments\n\n* `select` - Camera to use.\n * `lensCorrection` - Lens correction mode to use."] pub fn CAMU_SetLensCorrection(select: u32_, lensCorrection: CAMU_LensCorrection) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the output format of the given camera in the given context.\n # Arguments\n\n* `select` - Camera to use.\n * `format` - Format to output.\n * `context` - Context to use."] + #[doc = "Sets the output format of the given camera in the given context.\n # Arguments\n\n* `select` - Camera to use.\n * `format` - Format to output.\n * `context` - Context to use."] pub fn CAMU_SetOutputFormat( select: u32_, format: CAMU_OutputFormat, @@ -8921,7 +8921,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Sets the region to base auto exposure off of for the specified camera.\n # Arguments\n\n* `select` - Camera to use.\n * `x` - X of the region.\n * `y` - Y of the region.\n * `width` - Width of the region.\n * `height` - Height of the region."] + #[doc = "Sets the region to base auto exposure off of for the specified camera.\n # Arguments\n\n* `select` - Camera to use.\n * `x` - X of the region.\n * `y` - Y of the region.\n * `width` - Width of the region.\n * `height` - Height of the region."] pub fn CAMU_SetAutoExposureWindow( select: u32_, x: s16, @@ -8932,7 +8932,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Sets the region to base auto white balance off of for the specified camera.\n # Arguments\n\n* `select` - Camera to use.\n * `x` - X of the region.\n * `y` - Y of the region.\n * `width` - Width of the region.\n * `height` - Height of the region."] + #[doc = "Sets the region to base auto white balance off of for the specified camera.\n # Arguments\n\n* `select` - Camera to use.\n * `x` - X of the region.\n * `y` - Y of the region.\n * `width` - Width of the region.\n * `height` - Height of the region."] pub fn CAMU_SetAutoWhiteBalanceWindow( select: u32_, x: s16, @@ -8943,161 +8943,161 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Sets whether the specified camera's noise filter is enabled.\n # Arguments\n\n* `select` - Camera to use.\n * `noiseFilter` - Whether the noise filter is enabled."] + #[doc = "Sets whether the specified camera's noise filter is enabled.\n # Arguments\n\n* `select` - Camera to use.\n * `noiseFilter` - Whether the noise filter is enabled."] pub fn CAMU_SetNoiseFilter(select: u32_, noiseFilter: bool) -> Result; } extern "C" { #[must_use] - #[doc = " Synchronizes the specified cameras' vsync timing.\n # Arguments\n\n* `select1` - First camera.\n * `select2` - Second camera."] + #[doc = "Synchronizes the specified cameras' vsync timing.\n # Arguments\n\n* `select1` - First camera.\n * `select2` - Second camera."] pub fn CAMU_SynchronizeVsyncTiming(select1: u32_, select2: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the vsync timing record of the specified camera for the specified number of signals.\n # Arguments\n\n* `timing` - Pointer to write timing data to. (size \"past * sizeof(s64)\")\n * `port` - Port to use.\n * `past` - Number of past timings to retrieve."] + #[doc = "Gets the vsync timing record of the specified camera for the specified number of signals.\n # Arguments\n\n* `timing` - Pointer to write timing data to. (size \"past * sizeof(s64)\")\n * `port` - Port to use.\n * `past` - Number of past timings to retrieve."] pub fn CAMU_GetLatestVsyncTiming(timing: *mut s64, port: u32_, past: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the specified camera's stereo camera calibration data.\n # Arguments\n\n* `data` - Pointer to output the stereo camera data to."] + #[doc = "Gets the specified camera's stereo camera calibration data.\n # Arguments\n\n* `data` - Pointer to output the stereo camera data to."] pub fn CAMU_GetStereoCameraCalibrationData( data: *mut CAMU_StereoCameraCalibrationData, ) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the specified camera's stereo camera calibration data.\n # Arguments\n\n* `data` - Data to set."] + #[doc = "Sets the specified camera's stereo camera calibration data.\n # Arguments\n\n* `data` - Data to set."] pub fn CAMU_SetStereoCameraCalibrationData(data: CAMU_StereoCameraCalibrationData) -> Result; } extern "C" { #[must_use] - #[doc = " Writes to the specified I2C register of the specified camera.\n # Arguments\n\n* `select` - Camera to write to.\n * `addr` - Address to write to.\n * `data` - Data to write."] + #[doc = "Writes to the specified I2C register of the specified camera.\n # Arguments\n\n* `select` - Camera to write to.\n * `addr` - Address to write to.\n * `data` - Data to write."] pub fn CAMU_WriteRegisterI2c(select: u32_, addr: u16_, data: u16_) -> Result; } extern "C" { #[must_use] - #[doc = " Writes to the specified MCU variable of the specified camera.\n # Arguments\n\n* `select` - Camera to write to.\n * `addr` - Address to write to.\n * `data` - Data to write."] + #[doc = "Writes to the specified MCU variable of the specified camera.\n # Arguments\n\n* `select` - Camera to write to.\n * `addr` - Address to write to.\n * `data` - Data to write."] pub fn CAMU_WriteMcuVariableI2c(select: u32_, addr: u16_, data: u16_) -> Result; } extern "C" { #[must_use] - #[doc = " Reads the specified I2C register of the specified camera.\n # Arguments\n\n* `data` - Pointer to read data to.\n * `select` - Camera to read from.\n * `addr` - Address to read."] + #[doc = "Reads the specified I2C register of the specified camera.\n # Arguments\n\n* `data` - Pointer to read data to.\n * `select` - Camera to read from.\n * `addr` - Address to read."] pub fn CAMU_ReadRegisterI2cExclusive(data: *mut u16_, select: u32_, addr: u16_) -> Result; } extern "C" { #[must_use] - #[doc = " Reads the specified MCU variable of the specified camera.\n # Arguments\n\n* `data` - Pointer to read data to.\n * `select` - Camera to read from.\n * `addr` - Address to read."] + #[doc = "Reads the specified MCU variable of the specified camera.\n # Arguments\n\n* `data` - Pointer to read data to.\n * `select` - Camera to read from.\n * `addr` - Address to read."] pub fn CAMU_ReadMcuVariableI2cExclusive(data: *mut u16_, select: u32_, addr: u16_) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the specified camera's image quality calibration data.\n # Arguments\n\n* `data` - Data to set."] + #[doc = "Sets the specified camera's image quality calibration data.\n # Arguments\n\n* `data` - Data to set."] pub fn CAMU_SetImageQualityCalibrationData(data: CAMU_ImageQualityCalibrationData) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the specified camera's image quality calibration data.\n # Arguments\n\n* `data` - Pointer to write the quality data to."] + #[doc = "Gets the specified camera's image quality calibration data.\n # Arguments\n\n* `data` - Pointer to write the quality data to."] pub fn CAMU_GetImageQualityCalibrationData( data: *mut CAMU_ImageQualityCalibrationData, ) -> Result; } extern "C" { #[must_use] - #[doc = " Configures a camera with pre-packaged configuration data without a context.\n # Arguments\n\n* `Parameter` - to use."] + #[doc = "Configures a camera with pre-packaged configuration data without a context.\n # Arguments\n\n* `Parameter` - to use."] pub fn CAMU_SetPackageParameterWithoutContext( param: CAMU_PackageParameterCameraSelect, ) -> Result; } extern "C" { #[must_use] - #[doc = " Configures a camera with pre-packaged configuration data with a context.\n # Arguments\n\n* `Parameter` - to use."] + #[doc = "Configures a camera with pre-packaged configuration data with a context.\n # Arguments\n\n* `Parameter` - to use."] pub fn CAMU_SetPackageParameterWithContext(param: CAMU_PackageParameterContext) -> Result; } extern "C" { #[must_use] - #[doc = " Configures a camera with pre-packaged configuration data without a context and extra resolution details.\n # Arguments\n\n* `Parameter` - to use."] + #[doc = "Configures a camera with pre-packaged configuration data without a context and extra resolution details.\n # Arguments\n\n* `Parameter` - to use."] pub fn CAMU_SetPackageParameterWithContextDetail( param: CAMU_PackageParameterContextDetail, ) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the Y2R coefficient applied to image data by the camera.\n # Arguments\n\n* `coefficient` - Pointer to output the Y2R coefficient to."] + #[doc = "Gets the Y2R coefficient applied to image data by the camera.\n # Arguments\n\n* `coefficient` - Pointer to output the Y2R coefficient to."] pub fn CAMU_GetSuitableY2rStandardCoefficient( coefficient: *mut Y2RU_StandardCoefficient, ) -> Result; } extern "C" { #[must_use] - #[doc = " Plays the specified shutter sound.\n # Arguments\n\n* `sound` - Shutter sound to play."] + #[doc = "Plays the specified shutter sound.\n # Arguments\n\n* `sound` - Shutter sound to play."] pub fn CAMU_PlayShutterSound(sound: CAMU_ShutterSoundType) -> Result; } extern "C" { #[must_use] - #[doc = " Initializes the camera driver."] + #[doc = "Initializes the camera driver."] pub fn CAMU_DriverInitialize() -> Result; } extern "C" { #[must_use] - #[doc = " Finalizes the camera driver."] + #[doc = "Finalizes the camera driver."] pub fn CAMU_DriverFinalize() -> Result; } extern "C" { #[must_use] - #[doc = " Gets the current activated camera.\n # Arguments\n\n* `select` - Pointer to output the current activated camera to."] + #[doc = "Gets the current activated camera.\n # Arguments\n\n* `select` - Pointer to output the current activated camera to."] pub fn CAMU_GetActivatedCamera(select: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the current sleep camera.\n # Arguments\n\n* `select` - Pointer to output the current sleep camera to."] + #[doc = "Gets the current sleep camera.\n # Arguments\n\n* `select` - Pointer to output the current sleep camera to."] pub fn CAMU_GetSleepCamera(select: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the current sleep camera.\n # Arguments\n\n* `select` - Camera to set."] + #[doc = "Sets the current sleep camera.\n # Arguments\n\n* `select` - Camera to set."] pub fn CAMU_SetSleepCamera(select: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Sets whether to enable synchronization of left and right camera brightnesses.\n # Arguments\n\n* `brightnessSynchronization` - Whether to enable brightness synchronization."] + #[doc = "Sets whether to enable synchronization of left and right camera brightnesses.\n # Arguments\n\n* `brightnessSynchronization` - Whether to enable brightness synchronization."] pub fn CAMU_SetBrightnessSynchronization(brightnessSynchronization: bool) -> Result; } extern "C" { #[must_use] - #[doc = " Initializes CFGNOR.\n # Arguments\n\n* `value` - Unknown, usually 1."] + #[doc = "Initializes CFGNOR.\n # Arguments\n\n* `value` - Unknown, usually 1."] pub fn cfgnorInit(value: u8_) -> Result; } extern "C" { - #[doc = " Exits CFGNOR"] + #[doc = "Exits CFGNOR"] pub fn cfgnorExit(); } extern "C" { #[must_use] - #[doc = " Dumps the NOR flash.\n # Arguments\n\n* `buf` - Buffer to dump to.\n * `size` - Size of the buffer."] + #[doc = "Dumps the NOR flash.\n # Arguments\n\n* `buf` - Buffer to dump to.\n * `size` - Size of the buffer."] pub fn cfgnorDumpFlash(buf: *mut u32_, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Writes the NOR flash.\n # Arguments\n\n* `buf` - Buffer to write from.\n * `size` - Size of the buffer."] + #[doc = "Writes the NOR flash.\n # Arguments\n\n* `buf` - Buffer to write from.\n * `size` - Size of the buffer."] pub fn cfgnorWriteFlash(buf: *mut u32_, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Initializes the CFGNOR session.\n # Arguments\n\n* `value` - Unknown, usually 1."] + #[doc = "Initializes the CFGNOR session.\n # Arguments\n\n* `value` - Unknown, usually 1."] pub fn CFGNOR_Initialize(value: u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Shuts down the CFGNOR session."] + #[doc = "Shuts down the CFGNOR session."] pub fn CFGNOR_Shutdown() -> Result; } extern "C" { #[must_use] - #[doc = " Reads data from NOR.\n # Arguments\n\n* `offset` - Offset to read from.\n * `buf` - Buffer to read data to.\n * `size` - Size of the buffer."] + #[doc = "Reads data from NOR.\n # Arguments\n\n* `offset` - Offset to read from.\n * `buf` - Buffer to read data to.\n * `size` - Size of the buffer."] pub fn CFGNOR_ReadData(offset: u32_, buf: *mut u32_, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Writes data to NOR.\n # Arguments\n\n* `offset` - Offset to write to.\n * `buf` - Buffer to write data from.\n * `size` - Size of the buffer."] + #[doc = "Writes data to NOR.\n # Arguments\n\n* `offset` - Offset to write to.\n * `buf` - Buffer to write data from.\n * `size` - Size of the buffer."] pub fn CFGNOR_WriteData(offset: u32_, buf: *mut u32_, size: u32_) -> Result; } #[doc = "< Japan"] @@ -9114,7 +9114,7 @@ pub const CFG_REGION_CHN: CFG_Region = 4; pub const CFG_REGION_KOR: CFG_Region = 5; #[doc = "< Taiwan"] pub const CFG_REGION_TWN: CFG_Region = 6; -#[doc = " Configuration region values."] +#[doc = "Configuration region values."] pub type CFG_Region = ::libc::c_uint; #[doc = "< Japanese"] pub const CFG_LANGUAGE_JP: CFG_Language = 0; @@ -9140,7 +9140,7 @@ pub const CFG_LANGUAGE_PT: CFG_Language = 9; pub const CFG_LANGUAGE_RU: CFG_Language = 10; #[doc = "< Traditional Chinese"] pub const CFG_LANGUAGE_TW: CFG_Language = 11; -#[doc = " Configuration language values."] +#[doc = "Configuration language values."] pub type CFG_Language = ::libc::c_uint; #[doc = "< Old 3DS (CTR)"] pub const CFG_MODEL_3DS: CFG_SystemModel = 0; @@ -9157,146 +9157,146 @@ pub const CFG_MODEL_N2DSXL: CFG_SystemModel = 5; pub type CFG_SystemModel = ::libc::c_uint; extern "C" { #[must_use] - #[doc = " Initializes CFGU."] + #[doc = "Initializes CFGU."] pub fn cfguInit() -> Result; } extern "C" { - #[doc = " Exits CFGU."] + #[doc = "Exits CFGU."] pub fn cfguExit(); } extern "C" { #[must_use] - #[doc = " Gets the system's region from secure info.\n # Arguments\n\n* `region` - Pointer to output the region to. (see CFG_Region)"] + #[doc = "Gets the system's region from secure info.\n # Arguments\n\n* `region` - Pointer to output the region to. (see CFG_Region)"] pub fn CFGU_SecureInfoGetRegion(region: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Generates a console-unique hash.\n # Arguments\n\n* `appIDSalt` - Salt to use.\n * `hash` - Pointer to output the hash to."] + #[doc = "Generates a console-unique hash.\n # Arguments\n\n* `appIDSalt` - Salt to use.\n * `hash` - Pointer to output the hash to."] pub fn CFGU_GenHashConsoleUnique(appIDSalt: u32_, hash: *mut u64_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets whether the system's region is Canada or USA.\n # Arguments\n\n* `value` - Pointer to output the result to. (0 = no, 1 = yes)"] + #[doc = "Gets whether the system's region is Canada or USA.\n # Arguments\n\n* `value` - Pointer to output the result to. (0 = no, 1 = yes)"] pub fn CFGU_GetRegionCanadaUSA(value: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the system's model.\n # Arguments\n\n* `model` - Pointer to output the model to. (see CFG_SystemModel)"] + #[doc = "Gets the system's model.\n # Arguments\n\n* `model` - Pointer to output the model to. (see CFG_SystemModel)"] pub fn CFGU_GetSystemModel(model: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets whether the system is a 2DS.\n # Arguments\n\n* `value` - Pointer to output the result to. (0 = yes, 1 = no)"] + #[doc = "Gets whether the system is a 2DS.\n # Arguments\n\n* `value` - Pointer to output the result to. (0 = yes, 1 = no)"] pub fn CFGU_GetModelNintendo2DS(value: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets a string representing a country code.\n # Arguments\n\n* `code` - Country code to use.\n * `string` - Pointer to output the string to."] + #[doc = "Gets a string representing a country code.\n # Arguments\n\n* `code` - Country code to use.\n * `string` - Pointer to output the string to."] pub fn CFGU_GetCountryCodeString(code: u16_, string: *mut u16_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets a country code ID from its string.\n # Arguments\n\n* `string` - String to use.\n * `code` - Pointer to output the country code to."] + #[doc = "Gets a country code ID from its string.\n # Arguments\n\n* `string` - String to use.\n * `code` - Pointer to output the country code to."] pub fn CFGU_GetCountryCodeID(string: u16_, code: *mut u16_) -> Result; } extern "C" { #[must_use] - #[doc = " Checks if NFC (code name: fangate) is supported.\n # Arguments\n\n* `isSupported` - pointer to the output the result to."] + #[doc = "Checks if NFC (code name: fangate) is supported.\n # Arguments\n\n* `isSupported` - pointer to the output the result to."] pub fn CFGU_IsNFCSupported(isSupported: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Gets a config info block with flags = 2.\n # Arguments\n\n* `size` - Size of the data to retrieve.\n * `blkID` - ID of the block to retrieve.\n * `outData` - Pointer to write the block data to."] + #[doc = "Gets a config info block with flags = 2.\n # Arguments\n\n* `size` - Size of the data to retrieve.\n * `blkID` - ID of the block to retrieve.\n * `outData` - Pointer to write the block data to."] pub fn CFGU_GetConfigInfoBlk2(size: u32_, blkID: u32_, outData: *mut ::libc::c_void) -> Result; } extern "C" { #[must_use] - #[doc = " Gets a config info block with flags = 4.\n # Arguments\n\n* `size` - Size of the data to retrieve.\n * `blkID` - ID of the block to retrieve.\n * `outData` - Pointer to write the block data to."] + #[doc = "Gets a config info block with flags = 4.\n # Arguments\n\n* `size` - Size of the data to retrieve.\n * `blkID` - ID of the block to retrieve.\n * `outData` - Pointer to write the block data to."] pub fn CFG_GetConfigInfoBlk4(size: u32_, blkID: u32_, outData: *mut ::libc::c_void) -> Result; } extern "C" { #[must_use] - #[doc = " Gets a config info block with flags = 8.\n # Arguments\n\n* `size` - Size of the data to retrieve.\n * `blkID` - ID of the block to retrieve.\n * `outData` - Pointer to write the block data to."] + #[doc = "Gets a config info block with flags = 8.\n # Arguments\n\n* `size` - Size of the data to retrieve.\n * `blkID` - ID of the block to retrieve.\n * `outData` - Pointer to write the block data to."] pub fn CFG_GetConfigInfoBlk8(size: u32_, blkID: u32_, outData: *mut ::libc::c_void) -> Result; } extern "C" { #[must_use] - #[doc = " Sets a config info block with flags = 4.\n # Arguments\n\n* `size` - Size of the data to retrieve.\n * `blkID` - ID of the block to retrieve.\n * `inData` - Pointer to block data to write."] + #[doc = "Sets a config info block with flags = 4.\n # Arguments\n\n* `size` - Size of the data to retrieve.\n * `blkID` - ID of the block to retrieve.\n * `inData` - Pointer to block data to write."] pub fn CFG_SetConfigInfoBlk4(size: u32_, blkID: u32_, inData: *const ::libc::c_void) -> Result; } extern "C" { #[must_use] - #[doc = " Sets a config info block with flags = 8.\n # Arguments\n\n* `size` - Size of the data to retrieve.\n * `blkID` - ID of the block to retrieve.\n * `inData` - Pointer to block data to write."] + #[doc = "Sets a config info block with flags = 8.\n # Arguments\n\n* `size` - Size of the data to retrieve.\n * `blkID` - ID of the block to retrieve.\n * `inData` - Pointer to block data to write."] pub fn CFG_SetConfigInfoBlk8(size: u32_, blkID: u32_, inData: *const ::libc::c_void) -> Result; } extern "C" { #[must_use] - #[doc = " Writes the CFG buffer in memory to the savegame in NAND."] + #[doc = "Writes the CFG buffer in memory to the savegame in NAND."] pub fn CFG_UpdateConfigSavegame() -> Result; } extern "C" { #[must_use] - #[doc = " Gets the system's language.\n # Arguments\n\n* `language` - Pointer to write the language to. (see CFG_Language)"] + #[doc = "Gets the system's language.\n # Arguments\n\n* `language` - Pointer to write the language to. (see CFG_Language)"] pub fn CFGU_GetSystemLanguage(language: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Deletes the NAND LocalFriendCodeSeed file, then recreates it using the LocalFriendCodeSeed data stored in memory."] + #[doc = "Deletes the NAND LocalFriendCodeSeed file, then recreates it using the LocalFriendCodeSeed data stored in memory."] pub fn CFGI_RestoreLocalFriendCodeSeed() -> Result; } extern "C" { #[must_use] - #[doc = " Deletes the NAND SecureInfo file, then recreates it using the SecureInfo data stored in memory."] + #[doc = "Deletes the NAND SecureInfo file, then recreates it using the SecureInfo data stored in memory."] pub fn CFGI_RestoreSecureInfo() -> Result; } extern "C" { #[must_use] - #[doc = " Deletes the \"config\" file stored in the NAND Config_Savegame."] + #[doc = "Deletes the \"config\" file stored in the NAND Config_Savegame."] pub fn CFGI_DeleteConfigSavefile() -> Result; } extern "C" { #[must_use] - #[doc = " Formats Config_Savegame."] + #[doc = "Formats Config_Savegame."] pub fn CFGI_FormatConfig() -> Result; } extern "C" { #[must_use] - #[doc = " Clears parental controls"] + #[doc = "Clears parental controls"] pub fn CFGI_ClearParentalControls() -> Result; } extern "C" { #[must_use] - #[doc = " Verifies the RSA signature for the LocalFriendCodeSeed data already stored in memory."] + #[doc = "Verifies the RSA signature for the LocalFriendCodeSeed data already stored in memory."] pub fn CFGI_VerifySigLocalFriendCodeSeed() -> Result; } extern "C" { #[must_use] - #[doc = " Verifies the RSA signature for the SecureInfo data already stored in memory."] + #[doc = "Verifies the RSA signature for the SecureInfo data already stored in memory."] pub fn CFGI_VerifySigSecureInfo() -> Result; } extern "C" { #[must_use] - #[doc = " Gets the system's serial number.\n # Arguments\n\n* `serial` - Pointer to output the serial to. (This is normally 0xF)"] + #[doc = "Gets the system's serial number.\n # Arguments\n\n* `serial` - Pointer to output the serial to. (This is normally 0xF)"] pub fn CFGI_SecureInfoGetSerialNumber(serial: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the 0x110-byte buffer containing the data for the LocalFriendCodeSeed.\n # Arguments\n\n* `data` - Pointer to output the buffer. (The size must be at least 0x110-bytes)"] + #[doc = "Gets the 0x110-byte buffer containing the data for the LocalFriendCodeSeed.\n # Arguments\n\n* `data` - Pointer to output the buffer. (The size must be at least 0x110-bytes)"] pub fn CFGI_GetLocalFriendCodeSeedData(data: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the 64-bit local friend code seed.\n # Arguments\n\n* `seed` - Pointer to write the friend code seed to."] + #[doc = "Gets the 64-bit local friend code seed.\n # Arguments\n\n* `seed` - Pointer to write the friend code seed to."] pub fn CFGI_GetLocalFriendCodeSeed(seed: *mut u64_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the 0x11-byte data following the SecureInfo signature.\n # Arguments\n\n* `data` - Pointer to output the buffer. (The size must be at least 0x11-bytes)"] + #[doc = "Gets the 0x11-byte data following the SecureInfo signature.\n # Arguments\n\n* `data` - Pointer to output the buffer. (The size must be at least 0x11-bytes)"] pub fn CFGI_GetSecureInfoData(data: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the 0x100-byte RSA-2048 SecureInfo signature.\n # Arguments\n\n* `data` - Pointer to output the buffer. (The size must be at least 0x100-bytes)"] + #[doc = "Gets the 0x100-byte RSA-2048 SecureInfo signature.\n # Arguments\n\n* `data` - Pointer to output the buffer. (The size must be at least 0x100-bytes)"] pub fn CFGI_GetSecureInfoSignature(data: *mut u8_) -> Result; } #[doc = "< PCM8"] @@ -9307,7 +9307,7 @@ pub const CSND_ENCODING_PCM16: _bindgen_ty_17 = 1; pub const CSND_ENCODING_ADPCM: _bindgen_ty_17 = 2; #[doc = "< PSG (Similar to DS?)"] pub const CSND_ENCODING_PSG: _bindgen_ty_17 = 3; -#[doc = " CSND encodings."] +#[doc = "CSND encodings."] pub type _bindgen_ty_17 = ::libc::c_uint; #[doc = "< Manual loop."] pub const CSND_LOOPMODE_MANUAL: _bindgen_ty_18 = 0; @@ -9317,7 +9317,7 @@ pub const CSND_LOOPMODE_NORMAL: _bindgen_ty_18 = 1; pub const CSND_LOOPMODE_ONESHOT: _bindgen_ty_18 = 2; #[doc = "< Don't reload."] pub const CSND_LOOPMODE_NORELOAD: _bindgen_ty_18 = 3; -#[doc = " CSND loop modes."] +#[doc = "CSND loop modes."] pub type _bindgen_ty_18 = ::libc::c_uint; #[doc = "< Linear interpolation."] pub const SOUND_LINEAR_INTERP: _bindgen_ty_19 = 64; @@ -9335,7 +9335,7 @@ pub const SOUND_FORMAT_ADPCM: _bindgen_ty_19 = 8192; pub const SOUND_FORMAT_PSG: _bindgen_ty_19 = 12288; #[doc = "< Enable sound."] pub const SOUND_ENABLE: _bindgen_ty_19 = 16384; -#[doc = " Sound flags."] +#[doc = "Sound flags."] pub type _bindgen_ty_19 = ::libc::c_uint; #[doc = "< Repeat capture."] pub const CAPTURE_REPEAT: _bindgen_ty_20 = 0; @@ -9347,7 +9347,7 @@ pub const CAPTURE_FORMAT_16BIT: _bindgen_ty_20 = 0; pub const CAPTURE_FORMAT_8BIT: _bindgen_ty_20 = 2; #[doc = "< Enable capture."] pub const CAPTURE_ENABLE: _bindgen_ty_20 = 32768; -#[doc = " Capture modes."] +#[doc = "Capture modes."] pub type _bindgen_ty_20 = ::libc::c_uint; #[doc = "< 0.0% duty cycle"] pub const DutyCycle_0: CSND_DutyCycle = 7; @@ -9365,9 +9365,9 @@ pub const DutyCycle_62: CSND_DutyCycle = 4; pub const DutyCycle_75: CSND_DutyCycle = 5; #[doc = "< 87.5% duty cycle"] pub const DutyCycle_87: CSND_DutyCycle = 6; -#[doc = " Duty cycles for a PSG channel."] +#[doc = "Duty cycles for a PSG channel."] pub type CSND_DutyCycle = ::libc::c_uint; -#[doc = " Channel info."] +#[doc = "Channel info."] #[repr(C)] #[derive(Copy, Clone)] pub union CSND_ChnInfo { @@ -9402,7 +9402,7 @@ impl Default for CSND_ChnInfo { } } } -#[doc = " Capture info."] +#[doc = "Capture info."] #[repr(C)] #[derive(Copy, Clone)] pub union CSND_CapInfo { @@ -9445,98 +9445,98 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Acquires a capture unit.\n # Arguments\n\n* `capUnit` - Pointer to output the capture unit to."] + #[doc = "Acquires a capture unit.\n # Arguments\n\n* `capUnit` - Pointer to output the capture unit to."] pub fn CSND_AcquireCapUnit(capUnit: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Releases a capture unit.\n # Arguments\n\n* `capUnit` - Capture unit to release."] + #[doc = "Releases a capture unit.\n # Arguments\n\n* `capUnit` - Capture unit to release."] pub fn CSND_ReleaseCapUnit(capUnit: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Flushes the data cache of a memory region.\n # Arguments\n\n* `adr` - Address of the memory region.\n * `size` - Size of the memory region."] + #[doc = "Flushes the data cache of a memory region.\n # Arguments\n\n* `adr` - Address of the memory region.\n * `size` - Size of the memory region."] pub fn CSND_FlushDataCache(adr: *const ::libc::c_void, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Stores the data cache of a memory region.\n # Arguments\n\n* `adr` - Address of the memory region.\n * `size` - Size of the memory region."] + #[doc = "Stores the data cache of a memory region.\n # Arguments\n\n* `adr` - Address of the memory region.\n * `size` - Size of the memory region."] pub fn CSND_StoreDataCache(adr: *const ::libc::c_void, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Invalidates the data cache of a memory region.\n # Arguments\n\n* `adr` - Address of the memory region.\n * `size` - Size of the memory region."] + #[doc = "Invalidates the data cache of a memory region.\n # Arguments\n\n* `adr` - Address of the memory region.\n * `size` - Size of the memory region."] pub fn CSND_InvalidateDataCache(adr: *const ::libc::c_void, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Resets CSND.\n Note: Currently breaks sound, don't use for now!"] + #[doc = "Resets CSND.\n Note: Currently breaks sound, don't use for now!"] pub fn CSND_Reset() -> Result; } extern "C" { #[must_use] - #[doc = " Initializes CSND."] + #[doc = "Initializes CSND."] pub fn csndInit() -> Result; } extern "C" { - #[doc = " Exits CSND."] + #[doc = "Exits CSND."] pub fn csndExit(); } extern "C" { - #[doc = " Adds a command to the list, returning a buffer to write arguments to.\n # Arguments\n\n* `cmdid` - ID of the command to add.\n # Returns\n\nA buffer to write command arguments to."] + #[doc = "Adds a command to the list, returning a buffer to write arguments to.\n # Arguments\n\n* `cmdid` - ID of the command to add.\n # Returns\n\nA buffer to write command arguments to."] pub fn csndAddCmd(cmdid: ::libc::c_int) -> *mut u32_; } extern "C" { - #[doc = " Adds a command to the list, copying its arguments from a buffer.\n # Arguments\n\n* `cmdid` - ID of the command to add.\n * `cmdparams` - Buffer containing the command's parameters."] + #[doc = "Adds a command to the list, copying its arguments from a buffer.\n # Arguments\n\n* `cmdid` - ID of the command to add.\n * `cmdparams` - Buffer containing the command's parameters."] pub fn csndWriteCmd(cmdid: ::libc::c_int, cmdparams: *mut u8_); } extern "C" { #[must_use] - #[doc = " Executes pending CSND commands.\n # Arguments\n\n* `waitDone` - Whether to wait until the commands have finished executing."] + #[doc = "Executes pending CSND commands.\n # Arguments\n\n* `waitDone` - Whether to wait until the commands have finished executing."] pub fn csndExecCmds(waitDone: bool) -> Result; } extern "C" { - #[doc = " Sets a channel's play state, resetting registers on stop.\n # Arguments\n\n* `channel` - Channel to use.\n * `value` - Play state to set."] + #[doc = "Sets a channel's play state, resetting registers on stop.\n # Arguments\n\n* `channel` - Channel to use.\n * `value` - Play state to set."] pub fn CSND_SetPlayStateR(channel: u32_, value: u32_); } extern "C" { - #[doc = " Sets a channel's play state.\n # Arguments\n\n* `channel` - Channel to use.\n * `value` - Play state to set."] + #[doc = "Sets a channel's play state.\n # Arguments\n\n* `channel` - Channel to use.\n * `value` - Play state to set."] pub fn CSND_SetPlayState(channel: u32_, value: u32_); } extern "C" { - #[doc = " Sets a channel's encoding.\n # Arguments\n\n* `channel` - Channel to use.\n * `value` - Encoding to set."] + #[doc = "Sets a channel's encoding.\n # Arguments\n\n* `channel` - Channel to use.\n * `value` - Encoding to set."] pub fn CSND_SetEncoding(channel: u32_, value: u32_); } extern "C" { - #[doc = " Sets the data of a channel's block.\n # Arguments\n\n* `channel` - Channel to use.\n * `block` - Block to set.\n * `physaddr` - Physical address to set the block to.\n * `size` - Size of the block."] + #[doc = "Sets the data of a channel's block.\n # Arguments\n\n* `channel` - Channel to use.\n * `block` - Block to set.\n * `physaddr` - Physical address to set the block to.\n * `size` - Size of the block."] pub fn CSND_SetBlock(channel: u32_, block: ::libc::c_int, physaddr: u32_, size: u32_); } extern "C" { - #[doc = " Sets whether to loop a channel.\n # Arguments\n\n* `channel` - Channel to use.\n * `value` - Whether to loop the channel."] + #[doc = "Sets whether to loop a channel.\n # Arguments\n\n* `channel` - Channel to use.\n * `value` - Whether to loop the channel."] pub fn CSND_SetLooping(channel: u32_, value: u32_); } extern "C" { - #[doc = " Sets bit 7 of a channel.\n # Arguments\n\n* `channel` - Channel to use.\n * `set` - Value to set."] + #[doc = "Sets bit 7 of a channel.\n # Arguments\n\n* `channel` - Channel to use.\n * `set` - Value to set."] pub fn CSND_SetBit7(channel: u32_, set: bool); } extern "C" { - #[doc = " Sets whether a channel should use interpolation.\n # Arguments\n\n* `channel` - Channel to use.\n * `interp` - Whether to use interpolation."] + #[doc = "Sets whether a channel should use interpolation.\n # Arguments\n\n* `channel` - Channel to use.\n * `interp` - Whether to use interpolation."] pub fn CSND_SetInterp(channel: u32_, interp: bool); } extern "C" { - #[doc = " Sets a channel's duty.\n # Arguments\n\n* `channel` - Channel to use.\n * `duty` - Duty to set."] + #[doc = "Sets a channel's duty.\n # Arguments\n\n* `channel` - Channel to use.\n * `duty` - Duty to set."] pub fn CSND_SetDuty(channel: u32_, duty: CSND_DutyCycle); } extern "C" { - #[doc = " Sets a channel's timer.\n # Arguments\n\n* `channel` - Channel to use.\n * `timer` - Timer to set."] + #[doc = "Sets a channel's timer.\n # Arguments\n\n* `channel` - Channel to use.\n * `timer` - Timer to set."] pub fn CSND_SetTimer(channel: u32_, timer: u32_); } extern "C" { - #[doc = " Sets a channel's volume.\n # Arguments\n\n* `channel` - Channel to use.\n * `chnVolumes` - Channel volume data to set.\n * `capVolumes` - Capture volume data to set."] + #[doc = "Sets a channel's volume.\n # Arguments\n\n* `channel` - Channel to use.\n * `chnVolumes` - Channel volume data to set.\n * `capVolumes` - Capture volume data to set."] pub fn CSND_SetVol(channel: u32_, chnVolumes: u32_, capVolumes: u32_); } extern "C" { - #[doc = " Sets a channel's ADPCM state.\n # Arguments\n\n* `channel` - Channel to use.\n * `block` - Current block.\n * `sample` - Current sample.\n * `index` - Current index."] + #[doc = "Sets a channel's ADPCM state.\n # Arguments\n\n* `channel` - Channel to use.\n * `block` - Current block.\n * `sample` - Current sample.\n * `index` - Current index."] pub fn CSND_SetAdpcmState( channel: u32_, block: ::libc::c_int, @@ -9545,11 +9545,11 @@ extern "C" { ); } extern "C" { - #[doc = " Sets a whether channel's ADPCM data should be reloaded when the second block is played.\n # Arguments\n\n* `channel` - Channel to use.\n * `reload` - Whether to reload ADPCM data."] + #[doc = "Sets a whether channel's ADPCM data should be reloaded when the second block is played.\n # Arguments\n\n* `channel` - Channel to use.\n * `reload` - Whether to reload ADPCM data."] pub fn CSND_SetAdpcmReload(channel: u32_, reload: bool); } extern "C" { - #[doc = " Sets CSND's channel registers.\n # Arguments\n\n* `flags` - Flags to set.\n * `physaddr0` - Physical address of the first buffer to play.\n * `physaddr1` - Physical address of the second buffer to play.\n * `totalbytesize` - Total size of the data to play.\n * `chnVolumes` - Channel volume data.\n * `capVolumes` - Capture volume data."] + #[doc = "Sets CSND's channel registers.\n # Arguments\n\n* `flags` - Flags to set.\n * `physaddr0` - Physical address of the first buffer to play.\n * `physaddr1` - Physical address of the second buffer to play.\n * `totalbytesize` - Total size of the data to play.\n * `chnVolumes` - Channel volume data.\n * `capVolumes` - Capture volume data."] pub fn CSND_SetChnRegs( flags: u32_, physaddr0: u32_, @@ -9560,7 +9560,7 @@ extern "C" { ); } extern "C" { - #[doc = " Sets CSND's PSG channel registers.\n # Arguments\n\n* `flags` - Flags to set.\n * `chnVolumes` - Channel volume data.\n * `capVolumes` - Capture volume data.\n * `duty` - Duty value to set."] + #[doc = "Sets CSND's PSG channel registers.\n # Arguments\n\n* `flags` - Flags to set.\n * `chnVolumes` - Channel volume data.\n * `capVolumes` - Capture volume data.\n * `duty` - Duty value to set."] pub fn CSND_SetChnRegsPSG( flags: u32_, chnVolumes: u32_, @@ -9569,50 +9569,50 @@ extern "C" { ); } extern "C" { - #[doc = " Sets CSND's noise channel registers.\n # Arguments\n\n* `flags` - Flags to set.\n * `chnVolumes` - Channel volume data.\n * `capVolumes` - Capture volume data."] + #[doc = "Sets CSND's noise channel registers.\n # Arguments\n\n* `flags` - Flags to set.\n * `chnVolumes` - Channel volume data.\n * `capVolumes` - Capture volume data."] pub fn CSND_SetChnRegsNoise(flags: u32_, chnVolumes: u32_, capVolumes: u32_); } extern "C" { - #[doc = " Sets whether a capture unit is enabled.\n # Arguments\n\n* `capUnit` - Capture unit to use.\n * `enable` - Whether to enable the capture unit."] + #[doc = "Sets whether a capture unit is enabled.\n # Arguments\n\n* `capUnit` - Capture unit to use.\n * `enable` - Whether to enable the capture unit."] pub fn CSND_CapEnable(capUnit: u32_, enable: bool); } extern "C" { - #[doc = " Sets whether a capture unit should repeat.\n # Arguments\n\n* `capUnit` - Capture unit to use.\n * `repeat` - Whether the capture unit should repeat."] + #[doc = "Sets whether a capture unit should repeat.\n # Arguments\n\n* `capUnit` - Capture unit to use.\n * `repeat` - Whether the capture unit should repeat."] pub fn CSND_CapSetRepeat(capUnit: u32_, repeat: bool); } extern "C" { - #[doc = " Sets a capture unit's format.\n # Arguments\n\n* `capUnit` - Capture unit to use.\n * `eightbit` - Format to use."] + #[doc = "Sets a capture unit's format.\n # Arguments\n\n* `capUnit` - Capture unit to use.\n * `eightbit` - Format to use."] pub fn CSND_CapSetFormat(capUnit: u32_, eightbit: bool); } extern "C" { - #[doc = " Sets a capture unit's second bit.\n # Arguments\n\n* `capUnit` - Capture unit to use.\n * `set` - Value to set."] + #[doc = "Sets a capture unit's second bit.\n # Arguments\n\n* `capUnit` - Capture unit to use.\n * `set` - Value to set."] pub fn CSND_CapSetBit2(capUnit: u32_, set: bool); } extern "C" { - #[doc = " Sets a capture unit's timer.\n # Arguments\n\n* `capUnit` - Capture unit to use.\n * `timer` - Timer to set."] + #[doc = "Sets a capture unit's timer.\n # Arguments\n\n* `capUnit` - Capture unit to use.\n * `timer` - Timer to set."] pub fn CSND_CapSetTimer(capUnit: u32_, timer: u32_); } extern "C" { - #[doc = " Sets a capture unit's buffer.\n # Arguments\n\n* `capUnit` - Capture unit to use.\n * `addr` - Buffer address to use.\n * `size` - Size of the buffer."] + #[doc = "Sets a capture unit's buffer.\n # Arguments\n\n* `capUnit` - Capture unit to use.\n * `addr` - Buffer address to use.\n * `size` - Size of the buffer."] pub fn CSND_CapSetBuffer(capUnit: u32_, addr: u32_, size: u32_); } extern "C" { - #[doc = " Sets a capture unit's capture registers.\n # Arguments\n\n* `capUnit` - Capture unit to use.\n * `flags` - Capture unit flags.\n * `addr` - Capture unit buffer address.\n * `size` - Buffer size."] + #[doc = "Sets a capture unit's capture registers.\n # Arguments\n\n* `capUnit` - Capture unit to use.\n * `flags` - Capture unit flags.\n * `addr` - Capture unit buffer address.\n * `size` - Buffer size."] pub fn CSND_SetCapRegs(capUnit: u32_, flags: u32_, addr: u32_, size: u32_); } extern "C" { #[must_use] - #[doc = " Sets up DSP flags.\n # Arguments\n\n* `waitDone` - Whether to wait for completion."] + #[doc = "Sets up DSP flags.\n # Arguments\n\n* `waitDone` - Whether to wait for completion."] pub fn CSND_SetDspFlags(waitDone: bool) -> Result; } extern "C" { #[must_use] - #[doc = " Updates CSND information.\n # Arguments\n\n* `waitDone` - Whether to wait for completion."] + #[doc = "Updates CSND information.\n # Arguments\n\n* `waitDone` - Whether to wait for completion."] pub fn CSND_UpdateInfo(waitDone: bool) -> Result; } extern "C" { #[must_use] - #[doc = " Plays a sound.\n # Arguments\n\n* `chn` - Channel to play the sound on.\n * `flags` - Flags containing information about the sound.\n * `sampleRate` - Sample rate of the sound.\n * `vol` - The volume, ranges from 0.0 to 1.0 included.\n * `pan` - The pan, ranges from -1.0 to 1.0 included.\n * `data0` - First block of sound data.\n * `data1` - Second block of sound data. This is the block that will be looped over.\n * `size` - Size of the sound data.\n\n In this implementation if the loop mode is used, data1 must be in the range [data0 ; data0 + size]. Sound will be played once from data0 to data0 + size and then loop between data1 and data0+size."] + #[doc = "Plays a sound.\n # Arguments\n\n* `chn` - Channel to play the sound on.\n * `flags` - Flags containing information about the sound.\n * `sampleRate` - Sample rate of the sound.\n * `vol` - The volume, ranges from 0.0 to 1.0 included.\n * `pan` - The pan, ranges from -1.0 to 1.0 included.\n * `data0` - First block of sound data.\n * `data1` - Second block of sound data. This is the block that will be looped over.\n * `size` - Size of the sound data.\n\n In this implementation if the loop mode is used, data1 must be in the range [data0 ; data0 + size]. Sound will be played once from data0 to data0 + size and then loop between data1 and data0+size."] pub fn csndPlaySound( chn: ::libc::c_int, flags: u32_, @@ -9625,30 +9625,30 @@ extern "C" { ) -> Result; } extern "C" { - #[doc = " Gets CSND's DSP flags.\n Note: Requires previous CSND_UpdateInfo()\n # Arguments\n\n* `outSemFlags` - Pointer to write semaphore flags to.\n * `outIrqFlags` - Pointer to write interrupt flags to."] + #[doc = "Gets CSND's DSP flags.\n Note: Requires previous CSND_UpdateInfo()\n # Arguments\n\n* `outSemFlags` - Pointer to write semaphore flags to.\n * `outIrqFlags` - Pointer to write interrupt flags to."] pub fn csndGetDspFlags(outSemFlags: *mut u32_, outIrqFlags: *mut u32_); } extern "C" { - #[doc = " Gets a channel's information.\n Note: Requires previous CSND_UpdateInfo()\n # Arguments\n\n* `channel` - Channel to get information for.\n # Returns\n\nThe channel's information."] + #[doc = "Gets a channel's information.\n Note: Requires previous CSND_UpdateInfo()\n # Arguments\n\n* `channel` - Channel to get information for.\n # Returns\n\nThe channel's information."] pub fn csndGetChnInfo(channel: u32_) -> *mut CSND_ChnInfo; } extern "C" { - #[doc = " Gets a capture unit's information.\n Note: Requires previous CSND_UpdateInfo()\n # Arguments\n\n* `capUnit` - Capture unit to get information for.\n # Returns\n\nThe capture unit's information."] + #[doc = "Gets a capture unit's information.\n Note: Requires previous CSND_UpdateInfo()\n # Arguments\n\n* `capUnit` - Capture unit to get information for.\n # Returns\n\nThe capture unit's information."] pub fn csndGetCapInfo(capUnit: u32_) -> *mut CSND_CapInfo; } extern "C" { #[must_use] - #[doc = " Gets a channel's state.\n # Arguments\n\n* `channel` - Channel to get the state of.\n * `out` - Pointer to output channel information to."] + #[doc = "Gets a channel's state.\n # Arguments\n\n* `channel` - Channel to get the state of.\n * `out` - Pointer to output channel information to."] pub fn csndGetState(channel: u32_, out: *mut CSND_ChnInfo) -> Result; } extern "C" { #[must_use] - #[doc = " Gets whether a channel is playing.\n # Arguments\n\n* `channel` - Channel to check.\n * `status` - Pointer to output the channel status to."] + #[doc = "Gets whether a channel is playing.\n # Arguments\n\n* `channel` - Channel to check.\n * `status` - Pointer to output the channel status to."] pub fn csndIsPlaying(channel: u32_, status: *mut u8_) -> Result; } #[doc = "< Pipe interrupt."] pub const DSP_INTERRUPT_PIPE: DSP_InterruptType = 2; -#[doc = " DSP interrupt types."] +#[doc = "DSP interrupt types."] pub type DSP_InterruptType = ::libc::c_uint; #[doc = "< DSP is going to sleep."] pub const DSPHOOK_ONSLEEP: DSP_HookType = 0; @@ -9656,11 +9656,11 @@ pub const DSPHOOK_ONSLEEP: DSP_HookType = 0; pub const DSPHOOK_ONWAKEUP: DSP_HookType = 1; #[doc = "< DSP was sleeping and the app was cancelled."] pub const DSPHOOK_ONCANCEL: DSP_HookType = 2; -#[doc = " DSP hook types."] +#[doc = "DSP hook types."] pub type DSP_HookType = ::libc::c_uint; -#[doc = " DSP hook function."] +#[doc = "DSP hook function."] pub type dspHookFn = ::core::option::Option; -#[doc = " DSP hook cookie."] +#[doc = "DSP hook cookie."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct tag_dspHookCookie { @@ -9678,62 +9678,62 @@ impl Default for tag_dspHookCookie { } } } -#[doc = " DSP hook cookie."] +#[doc = "DSP hook cookie."] pub type dspHookCookie = tag_dspHookCookie; extern "C" { #[must_use] - #[doc = " Initializes the dsp service.\n\n Call this before calling any DSP_* function.\n > **Note:** This will also unload any previously loaded DSP binary.\n It is done this way since you have to provide your binary when the 3DS leaves sleep mode anyway."] + #[doc = "Initializes the dsp service.\n\n Call this before calling any DSP_* function.\n > **Note:** This will also unload any previously loaded DSP binary.\n It is done this way since you have to provide your binary when the 3DS leaves sleep mode anyway."] pub fn dspInit() -> Result; } extern "C" { - #[doc = " Closes the dsp service.\n > **Note:** This will also unload the DSP binary."] + #[doc = "Closes the dsp service.\n > **Note:** This will also unload the DSP binary."] pub fn dspExit(); } extern "C" { - #[doc = " Returns true if a component is loaded, false otherwise."] + #[doc = "Returns true if a component is loaded, false otherwise."] pub fn dspIsComponentLoaded() -> bool; } extern "C" { - #[doc = " Sets up a DSP status hook.\n # Arguments\n\n* `cookie` - Hook cookie to use.\n * `callback` - Function to call when DSP's status changes."] + #[doc = "Sets up a DSP status hook.\n # Arguments\n\n* `cookie` - Hook cookie to use.\n * `callback` - Function to call when DSP's status changes."] pub fn dspHook(cookie: *mut dspHookCookie, callback: dspHookFn); } extern "C" { - #[doc = " Removes a DSP status hook.\n # Arguments\n\n* `cookie` - Hook cookie to remove."] + #[doc = "Removes a DSP status hook.\n # Arguments\n\n* `cookie` - Hook cookie to remove."] pub fn dspUnhook(cookie: *mut dspHookCookie); } extern "C" { #[must_use] - #[doc = " Checks if a headphone is inserted.\n # Arguments\n\n* `is_inserted` - Pointer to output the insertion status to."] + #[doc = "Checks if a headphone is inserted.\n # Arguments\n\n* `is_inserted` - Pointer to output the insertion status to."] pub fn DSP_GetHeadphoneStatus(is_inserted: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Flushes the cache\n # Arguments\n\n* `address` - Beginning of the memory range to flush, inside the Linear or DSP memory regions\n * `size` - Size of the memory range to flush\n\n Flushes the cache for the specified memory range and invalidates the cache"] + #[doc = "Flushes the cache\n # Arguments\n\n* `address` - Beginning of the memory range to flush, inside the Linear or DSP memory regions\n * `size` - Size of the memory range to flush\n\n Flushes the cache for the specified memory range and invalidates the cache"] pub fn DSP_FlushDataCache(address: *const ::libc::c_void, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Invalidates the cache\n # Arguments\n\n* `address` - Beginning of the memory range to invalidate, inside the Linear or DSP memory regions\n * `size` - Size of the memory range to flush\n\n Invalidates the cache for the specified memory range"] + #[doc = "Invalidates the cache\n # Arguments\n\n* `address` - Beginning of the memory range to invalidate, inside the Linear or DSP memory regions\n * `size` - Size of the memory range to flush\n\n Invalidates the cache for the specified memory range"] pub fn DSP_InvalidateDataCache(address: *const ::libc::c_void, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Retrieves the handle of the DSP semaphore.\n # Arguments\n\n* `semaphore` - Pointer to output the semaphore to."] + #[doc = "Retrieves the handle of the DSP semaphore.\n # Arguments\n\n* `semaphore` - Pointer to output the semaphore to."] pub fn DSP_GetSemaphoreHandle(semaphore: *mut Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the DSP hardware semaphore value.\n # Arguments\n\n* `value` - Value to set."] + #[doc = "Sets the DSP hardware semaphore value.\n # Arguments\n\n* `value` - Value to set."] pub fn DSP_SetSemaphore(value: u16_) -> Result; } extern "C" { #[must_use] - #[doc = " Masks the DSP hardware semaphore value.\n # Arguments\n\n* `mask` - Mask to apply."] + #[doc = "Masks the DSP hardware semaphore value.\n # Arguments\n\n* `mask` - Mask to apply."] pub fn DSP_SetSemaphoreMask(mask: u16_) -> Result; } extern "C" { #[must_use] - #[doc = " Loads a DSP binary and starts the DSP\n # Arguments\n\n* `component` - The program file address in memory\n * `size` - The size of the program\n * `prog_mask` - DSP memory block related ? Default is 0xff.\n * `data_mask` - DSP memory block related ? Default is 0xff.\n * `is_loaded` - Indicates if the DSP was succesfully loaded.\n\n > **Note:** The binary must be signed (http://3dbrew.org/wiki/DSP_Binary)\n > **Note:** Seems to be called when the 3ds leaves the Sleep mode"] + #[doc = "Loads a DSP binary and starts the DSP\n # Arguments\n\n* `component` - The program file address in memory\n * `size` - The size of the program\n * `prog_mask` - DSP memory block related ? Default is 0xff.\n * `data_mask` - DSP memory block related ? Default is 0xff.\n * `is_loaded` - Indicates if the DSP was succesfully loaded.\n\n > **Note:** The binary must be signed (http://3dbrew.org/wiki/DSP_Binary)\n > **Note:** Seems to be called when the 3ds leaves the Sleep mode"] pub fn DSP_LoadComponent( component: *const ::libc::c_void, size: u32_, @@ -9749,12 +9749,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Registers an event handle with the DSP through IPC\n # Arguments\n\n* `handle` - Event handle to register.\n * `interrupt` - The type of interrupt that will trigger the event. Usual value is DSP_INTERRUPT_PIPE.\n * `channel` - The pipe channel. Usual value is 2\n\n > **Note:** It is possible that interrupt are inverted"] + #[doc = "Registers an event handle with the DSP through IPC\n # Arguments\n\n* `handle` - Event handle to register.\n * `interrupt` - The type of interrupt that will trigger the event. Usual value is DSP_INTERRUPT_PIPE.\n * `channel` - The pipe channel. Usual value is 2\n\n > **Note:** It is possible that interrupt are inverted"] pub fn DSP_RegisterInterruptEvents(handle: Handle, interrupt: u32_, channel: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Reads a pipe if possible.\n # Arguments\n\n* `channel` - unknown. Usually 2\n * `peer` - unknown. Usually 0\n * `buffer` - The buffer that will store the values read from the pipe\n * `length` - Length of the buffer\n * `length_read` - Number of bytes read by the command"] + #[doc = "Reads a pipe if possible.\n # Arguments\n\n* `channel` - unknown. Usually 2\n * `peer` - unknown. Usually 0\n * `buffer` - The buffer that will store the values read from the pipe\n * `length` - Length of the buffer\n * `length_read` - Number of bytes read by the command"] pub fn DSP_ReadPipeIfPossible( channel: u32_, peer: u32_, @@ -9765,7 +9765,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Writes to a pipe.\n # Arguments\n\n* `channel` - unknown. Usually 2\n * `buffer` - The message to send to the DSP process\n * `length` - Length of the message"] + #[doc = "Writes to a pipe.\n # Arguments\n\n* `channel` - unknown. Usually 2\n * `buffer` - The message to send to the DSP process\n * `length` - Length of the message"] pub fn DSP_WriteProcessPipe( channel: u32_, buffer: *const ::libc::c_void, @@ -9774,7 +9774,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Converts a DSP memory address to a virtual address usable by the process.\n # Arguments\n\n* `dsp_address` - Address to convert.\n * `arm_address` - Pointer to output the converted address to."] + #[doc = "Converts a DSP memory address to a virtual address usable by the process.\n # Arguments\n\n* `dsp_address` - Address to convert.\n * `arm_address` - Pointer to output the converted address to."] pub fn DSP_ConvertProcessAddressFromDspDram( dsp_address: u32_, arm_address: *mut u32_, @@ -9782,22 +9782,22 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Reads a DSP register\n # Arguments\n\n* `regNo` - Offset of the hardware register, base address is 0x1EC40000\n * `value` - Pointer to read the register value to."] + #[doc = "Reads a DSP register\n # Arguments\n\n* `regNo` - Offset of the hardware register, base address is 0x1EC40000\n * `value` - Pointer to read the register value to."] pub fn DSP_RecvData(regNo: u16_, value: *mut u16_) -> Result; } extern "C" { #[must_use] - #[doc = " Checks if you can read a DSP register\n # Arguments\n\n* `regNo` - Offset of the hardware register, base address is 0x1EC40000\n * `is_ready` - Pointer to write the ready status to.\n\n This call might hang if the data is not ready. See DSP_SendDataIsEmpty."] + #[doc = "Checks if you can read a DSP register\n # Arguments\n\n* `regNo` - Offset of the hardware register, base address is 0x1EC40000\n * `is_ready` - Pointer to write the ready status to.\n\n This call might hang if the data is not ready. See DSP_SendDataIsEmpty."] pub fn DSP_RecvDataIsReady(regNo: u16_, is_ready: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Writes to a DSP register\n # Arguments\n\n* `regNo` - Offset of the hardware register, base address is 0x1EC40000\n * `value` - Value to write.\n\n This call might hang if the SendData is not empty. See DSP_SendDataIsEmpty."] + #[doc = "Writes to a DSP register\n # Arguments\n\n* `regNo` - Offset of the hardware register, base address is 0x1EC40000\n * `value` - Value to write.\n\n This call might hang if the SendData is not empty. See DSP_SendDataIsEmpty."] pub fn DSP_SendData(regNo: u16_, value: u16_) -> Result; } extern "C" { #[must_use] - #[doc = " Checks if you can write to a DSP register ?\n # Arguments\n\n* `regNo` - Offset of the hardware register, base address is 0x1EC40000\n * `is_empty` - Pointer to write the empty status to."] + #[doc = "Checks if you can write to a DSP register ?\n # Arguments\n\n* `regNo` - Offset of the hardware register, base address is 0x1EC40000\n * `is_empty` - Pointer to write the empty status to."] pub fn DSP_SendDataIsEmpty(regNo: u16_, is_empty: *mut bool) -> Result; } pub type FSPXI_Archive = u64_; @@ -9805,7 +9805,7 @@ pub type FSPXI_File = u64_; pub type FSPXI_Directory = u64_; extern "C" { #[must_use] - #[doc = " Opens a file.\n # Arguments\n\n* `out` - Pointer to output the file handle to.\n * `archive` - Archive containing the file.\n * `path` - Path of the file.\n * `flags` - Flags to open the file with.\n * `attributes` - Attributes of the file."] + #[doc = "Opens a file.\n # Arguments\n\n* `out` - Pointer to output the file handle to.\n * `archive` - Archive containing the file.\n * `path` - Path of the file.\n * `flags` - Flags to open the file with.\n * `attributes` - Attributes of the file."] pub fn FSPXI_OpenFile( serviceHandle: Handle, out: *mut FSPXI_File, @@ -9817,13 +9817,13 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Deletes a file.\n # Arguments\n\n* `archive` - Archive containing the file.\n * `path` - Path of the file."] + #[doc = "Deletes a file.\n # Arguments\n\n* `archive` - Archive containing the file.\n * `path` - Path of the file."] pub fn FSPXI_DeleteFile(serviceHandle: Handle, archive: FSPXI_Archive, path: FS_Path) -> Result; } extern "C" { #[must_use] - #[doc = " Renames a file.\n # Arguments\n\n* `srcArchive` - Archive containing the source file.\n * `srcPath` - Path of the source file.\n * `dstArchive` - Archive containing the destination file.\n * `dstPath` - Path of the destination file."] + #[doc = "Renames a file.\n # Arguments\n\n* `srcArchive` - Archive containing the source file.\n * `srcPath` - Path of the source file.\n * `dstArchive` - Archive containing the destination file.\n * `dstPath` - Path of the destination file."] pub fn FSPXI_RenameFile( serviceHandle: Handle, srcArchive: FSPXI_Archive, @@ -9834,7 +9834,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Deletes a directory.\n # Arguments\n\n* `archive` - Archive containing the directory.\n * `path` - Path of the directory."] + #[doc = "Deletes a directory.\n # Arguments\n\n* `archive` - Archive containing the directory.\n * `path` - Path of the directory."] pub fn FSPXI_DeleteDirectory( serviceHandle: Handle, archive: FSPXI_Archive, @@ -9843,7 +9843,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Creates a file.\n # Arguments\n\n* `archive` - Archive to create the file in.\n * `path` - Path of the file.\n * `attributes` - Attributes of the file.\n * `size` - Size of the file."] + #[doc = "Creates a file.\n # Arguments\n\n* `archive` - Archive to create the file in.\n * `path` - Path of the file.\n * `attributes` - Attributes of the file.\n * `size` - Size of the file."] pub fn FSPXI_CreateFile( serviceHandle: Handle, archive: FSPXI_Archive, @@ -9854,7 +9854,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Creates a directory.\n # Arguments\n\n* `archive` - Archive to create the directory in.\n * `path` - Path of the directory.\n * `attributes` - Attributes of the directory."] + #[doc = "Creates a directory.\n # Arguments\n\n* `archive` - Archive to create the directory in.\n * `path` - Path of the directory.\n * `attributes` - Attributes of the directory."] pub fn FSPXI_CreateDirectory( serviceHandle: Handle, archive: FSPXI_Archive, @@ -9864,7 +9864,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Renames a directory.\n # Arguments\n\n* `srcArchive` - Archive containing the source directory.\n * `srcPath` - Path of the source directory.\n * `dstArchive` - Archive containing the destination directory.\n * `dstPath` - Path of the destination directory."] + #[doc = "Renames a directory.\n # Arguments\n\n* `srcArchive` - Archive containing the source directory.\n * `srcPath` - Path of the source directory.\n * `dstArchive` - Archive containing the destination directory.\n * `dstPath` - Path of the destination directory."] pub fn FSPXI_RenameDirectory( serviceHandle: Handle, srcArchive: FSPXI_Archive, @@ -9875,7 +9875,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Opens a directory.\n # Arguments\n\n* `out` - Pointer to output the directory handle to.\n * `archive` - Archive containing the directory.\n * `path` - Path of the directory."] + #[doc = "Opens a directory.\n # Arguments\n\n* `out` - Pointer to output the directory handle to.\n * `archive` - Archive containing the directory.\n * `path` - Path of the directory."] pub fn FSPXI_OpenDirectory( serviceHandle: Handle, out: *mut FSPXI_Directory, @@ -9885,7 +9885,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Reads from a file.\n # Arguments\n\n* `file` - File to read from.\n * `bytesRead` - Pointer to output the number of read bytes to.\n * `offset` - Offset to read from.\n * `buffer` - Buffer to read to.\n * `size` - Size of the buffer."] + #[doc = "Reads from a file.\n # Arguments\n\n* `file` - File to read from.\n * `bytesRead` - Pointer to output the number of read bytes to.\n * `offset` - Offset to read from.\n * `buffer` - Buffer to read to.\n * `size` - Size of the buffer."] pub fn FSPXI_ReadFile( serviceHandle: Handle, file: FSPXI_File, @@ -9897,7 +9897,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Calculate SHA256 of a file.\n # Arguments\n\n* `file` - File to calculate the hash of.\n * `buffer` - Buffer to output the hash to.\n * `size` - Size of the buffer."] + #[doc = "Calculate SHA256 of a file.\n # Arguments\n\n* `file` - File to calculate the hash of.\n * `buffer` - Buffer to output the hash to.\n * `size` - Size of the buffer."] pub fn FSPXI_CalculateFileHashSHA256( serviceHandle: Handle, file: FSPXI_File, @@ -9907,7 +9907,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Writes to a file.\n # Arguments\n\n* `file` - File to write to.\n * `bytesWritten` - Pointer to output the number of bytes written to.\n * `offset` - Offset to write to.\n * `buffer` - Buffer to write from.\n * `size` - Size of the buffer.\n * `flags` - Flags to use when writing."] + #[doc = "Writes to a file.\n # Arguments\n\n* `file` - File to write to.\n * `bytesWritten` - Pointer to output the number of bytes written to.\n * `offset` - Offset to write to.\n * `buffer` - Buffer to write from.\n * `size` - Size of the buffer.\n * `flags` - Flags to use when writing."] pub fn FSPXI_WriteFile( serviceHandle: Handle, file: FSPXI_File, @@ -9920,7 +9920,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Calculates the MAC used in a DISA/DIFF header?\n # Arguments\n\n* `file` - Unsure\n * `inBuffer` - 0x100-byte DISA/DIFF input buffer.\n * `inSize` - Size of inBuffer.\n * `outBuffer` - Buffer to write MAC to.\n * `outSize` - Size of outBuffer."] + #[doc = "Calculates the MAC used in a DISA/DIFF header?\n # Arguments\n\n* `file` - Unsure\n * `inBuffer` - 0x100-byte DISA/DIFF input buffer.\n * `inSize` - Size of inBuffer.\n * `outBuffer` - Buffer to write MAC to.\n * `outSize` - Size of outBuffer."] pub fn FSPXI_CalcSavegameMAC( serviceHandle: Handle, file: FSPXI_File, @@ -9932,22 +9932,22 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Get size of a file\n # Arguments\n\n* `file` - File to get the size of.\n * `size` - Pointer to output size to."] + #[doc = "Get size of a file\n # Arguments\n\n* `file` - File to get the size of.\n * `size` - Pointer to output size to."] pub fn FSPXI_GetFileSize(serviceHandle: Handle, file: FSPXI_File, size: *mut u64_) -> Result; } extern "C" { #[must_use] - #[doc = " Set size of a file\n # Arguments\n\n* `file` - File to set the size of\n * `size` - Size to set the file to"] + #[doc = "Set size of a file\n # Arguments\n\n* `file` - File to set the size of\n * `size` - Size to set the file to"] pub fn FSPXI_SetFileSize(serviceHandle: Handle, file: FSPXI_File, size: u64_) -> Result; } extern "C" { #[must_use] - #[doc = " Close a file\n # Arguments\n\n* `file` - File to close"] + #[doc = "Close a file\n # Arguments\n\n* `file` - File to close"] pub fn FSPXI_CloseFile(serviceHandle: Handle, file: FSPXI_File) -> Result; } extern "C" { #[must_use] - #[doc = " Reads one or more directory entries.\n # Arguments\n\n* `directory` - Directory to read from.\n * `entriesRead` - Pointer to output the number of entries read to.\n * `entryCount` - Number of entries to read.\n * `entryOut` - Pointer to output directory entries to."] + #[doc = "Reads one or more directory entries.\n # Arguments\n\n* `directory` - Directory to read from.\n * `entriesRead` - Pointer to output the number of entries read to.\n * `entryCount` - Number of entries to read.\n * `entryOut` - Pointer to output directory entries to."] pub fn FSPXI_ReadDirectory( serviceHandle: Handle, directory: FSPXI_Directory, @@ -9958,12 +9958,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Close a directory\n # Arguments\n\n* `directory` - Directory to close."] + #[doc = "Close a directory\n # Arguments\n\n* `directory` - Directory to close."] pub fn FSPXI_CloseDirectory(serviceHandle: Handle, directory: FSPXI_Directory) -> Result; } extern "C" { #[must_use] - #[doc = " Opens an archive.\n # Arguments\n\n* `archive` - Pointer to output the opened archive to.\n * `id` - ID of the archive.\n * `path` - Path of the archive."] + #[doc = "Opens an archive.\n # Arguments\n\n* `archive` - Pointer to output the opened archive to.\n * `id` - ID of the archive.\n * `path` - Path of the archive."] pub fn FSPXI_OpenArchive( serviceHandle: Handle, archive: *mut FSPXI_Archive, @@ -9973,7 +9973,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Checks if the archive contains a file at path.\n # Arguments\n\n* `archive` - Archive to check.\n * `out` - Pointer to output existence to.\n * `path` - Path to check for file"] + #[doc = "Checks if the archive contains a file at path.\n # Arguments\n\n* `archive` - Archive to check.\n * `out` - Pointer to output existence to.\n * `path` - Path to check for file"] pub fn FSPXI_HasFile( serviceHandle: Handle, archive: FSPXI_Archive, @@ -9983,7 +9983,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Checks if the archive contains a directory at path.\n # Arguments\n\n* `archive` - Archive to check.\n * `out` - Pointer to output existence to.\n * `path` - Path to check for directory"] + #[doc = "Checks if the archive contains a directory at path.\n # Arguments\n\n* `archive` - Archive to check.\n * `out` - Pointer to output existence to.\n * `path` - Path to check for directory"] pub fn FSPXI_HasDirectory( serviceHandle: Handle, archive: FSPXI_Archive, @@ -9993,17 +9993,17 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Commits an archive's save data.\n # Arguments\n\n* `archive` - Archive to commit.\n * `id` - Archive action sent by FSUSER_ControlArchive. Must not be 0 or 0x789D\n > Unsure why id is sent. This appears to be the default action for FSUSER_ControlArchive, with every action other than 0 and 0x789D being sent to this command."] + #[doc = "Commits an archive's save data.\n # Arguments\n\n* `archive` - Archive to commit.\n * `id` - Archive action sent by FSUSER_ControlArchive. Must not be 0 or 0x789D\n > Unsure why id is sent. This appears to be the default action for FSUSER_ControlArchive, with every action other than 0 and 0x789D being sent to this command."] pub fn FSPXI_CommitSaveData(serviceHandle: Handle, archive: FSPXI_Archive, id: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Close an archive\n # Arguments\n\n* `archive` - Archive to close."] + #[doc = "Close an archive\n # Arguments\n\n* `archive` - Archive to close."] pub fn FSPXI_CloseArchive(serviceHandle: Handle, archive: FSPXI_Archive) -> Result; } extern "C" { #[must_use] - #[doc = " Unknown 0x17. Appears to be an \"is archive handle valid\" command?\n # Arguments\n\n* `archive` - Archive handle to check validity of.\n * `out` - Pointer to output validity to."] + #[doc = "Unknown 0x17. Appears to be an \"is archive handle valid\" command?\n # Arguments\n\n* `archive` - Archive handle to check validity of.\n * `out` - Pointer to output validity to."] pub fn FSPXI_Unknown0x17( serviceHandle: Handle, archive: FSPXI_Archive, @@ -10012,12 +10012,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets the inserted card type.\n # Arguments\n\n* `out` - Pointer to output the card type to."] + #[doc = "Gets the inserted card type.\n # Arguments\n\n* `out` - Pointer to output the card type to."] pub fn FSPXI_GetCardType(serviceHandle: Handle, out: *mut FS_CardType) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the SDMC archive resource information.\n # Arguments\n\n* `out` - Pointer to output the archive resource information to."] + #[doc = "Gets the SDMC archive resource information.\n # Arguments\n\n* `out` - Pointer to output the archive resource information to."] pub fn FSPXI_GetSdmcArchiveResource( serviceHandle: Handle, out: *mut FS_ArchiveResource, @@ -10025,7 +10025,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets the NAND archive resource information.\n # Arguments\n\n* `out` - Pointer to output the archive resource information to."] + #[doc = "Gets the NAND archive resource information.\n # Arguments\n\n* `out` - Pointer to output the archive resource information to."] pub fn FSPXI_GetNandArchiveResource( serviceHandle: Handle, out: *mut FS_ArchiveResource, @@ -10033,87 +10033,87 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets the error code from the SDMC FatFS driver\n # Arguments\n\n* `out` - Pointer to output the error code to"] + #[doc = "Gets the error code from the SDMC FatFS driver\n # Arguments\n\n* `out` - Pointer to output the error code to"] pub fn FSPXI_GetSdmcFatFsError(serviceHandle: Handle, out: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets whether PXIFS0 detects the SD\n # Arguments\n\n* `out` - Pointer to output the detection status to"] + #[doc = "Gets whether PXIFS0 detects the SD\n # Arguments\n\n* `out` - Pointer to output the detection status to"] pub fn FSPXI_IsSdmcDetected(serviceHandle: Handle, out: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Gets whether PXIFS0 can write to the SD\n # Arguments\n\n* `out` - Pointer to output the writable status to"] + #[doc = "Gets whether PXIFS0 can write to the SD\n # Arguments\n\n* `out` - Pointer to output the writable status to"] pub fn FSPXI_IsSdmcWritable(serviceHandle: Handle, out: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the SDMC CID\n # Arguments\n\n* `out` - Buffer to output the CID to.\n * `size` - Size of buffer."] + #[doc = "Gets the SDMC CID\n # Arguments\n\n* `out` - Buffer to output the CID to.\n * `size` - Size of buffer."] pub fn FSPXI_GetSdmcCid(serviceHandle: Handle, out: *mut ::libc::c_void, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the NAND CID\n # Arguments\n\n* `out` - Buffer to output the CID to.\n * `size` - Size of buffer."] + #[doc = "Gets the NAND CID\n # Arguments\n\n* `out` - Buffer to output the CID to.\n * `size` - Size of buffer."] pub fn FSPXI_GetNandCid(serviceHandle: Handle, out: *mut ::libc::c_void, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the SDMC speed info\n # Arguments\n\n* `out` - Buffer to output the speed info to."] + #[doc = "Gets the SDMC speed info\n # Arguments\n\n* `out` - Buffer to output the speed info to."] pub fn FSPXI_GetSdmcSpeedInfo(serviceHandle: Handle, out: *mut FS_SdMmcSpeedInfo) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the NAND speed info\n # Arguments\n\n* `out` - Buffer to output the speed info to."] + #[doc = "Gets the NAND speed info\n # Arguments\n\n* `out` - Buffer to output the speed info to."] pub fn FSPXI_GetNandSpeedInfo(serviceHandle: Handle, out: *mut FS_SdMmcSpeedInfo) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the SDMC log\n # Arguments\n\n* `out` - Buffer to output the log to.\n * `size` - Size of buffer."] + #[doc = "Gets the SDMC log\n # Arguments\n\n* `out` - Buffer to output the log to.\n * `size` - Size of buffer."] pub fn FSPXI_GetSdmcLog(serviceHandle: Handle, out: *mut ::libc::c_void, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the NAND log\n # Arguments\n\n* `out` - Buffer to output the log to.\n * `size` - Size of buffer."] + #[doc = "Gets the NAND log\n # Arguments\n\n* `out` - Buffer to output the log to.\n * `size` - Size of buffer."] pub fn FSPXI_GetNandLog(serviceHandle: Handle, out: *mut ::libc::c_void, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Clears the SDMC log"] + #[doc = "Clears the SDMC log"] pub fn FSPXI_ClearSdmcLog(serviceHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Clears the NAND log"] + #[doc = "Clears the NAND log"] pub fn FSPXI_ClearNandLog(serviceHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Gets whether a card is inserted.\n # Arguments\n\n* `inserted` - Pointer to output the insertion status to."] + #[doc = "Gets whether a card is inserted.\n # Arguments\n\n* `inserted` - Pointer to output the insertion status to."] pub fn FSPXI_CardSlotIsInserted(serviceHandle: Handle, inserted: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Powers on the card slot.\n # Arguments\n\n* `status` - Pointer to output the power status to."] + #[doc = "Powers on the card slot.\n # Arguments\n\n* `status` - Pointer to output the power status to."] pub fn FSPXI_CardSlotPowerOn(serviceHandle: Handle, status: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Powers off the card slot.\n # Arguments\n\n* `status` - Pointer to output the power status to."] + #[doc = "Powers off the card slot.\n # Arguments\n\n* `status` - Pointer to output the power status to."] pub fn FSPXI_CardSlotPowerOff(serviceHandle: Handle, status: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the card's power status.\n # Arguments\n\n* `status` - Pointer to output the power status to."] + #[doc = "Gets the card's power status.\n # Arguments\n\n* `status` - Pointer to output the power status to."] pub fn FSPXI_CardSlotGetCardIFPowerStatus(serviceHandle: Handle, status: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Executes a CARDNOR direct command.\n # Arguments\n\n* `commandId` - ID of the command."] + #[doc = "Executes a CARDNOR direct command.\n # Arguments\n\n* `commandId` - ID of the command."] pub fn FSPXI_CardNorDirectCommand(serviceHandle: Handle, commandId: u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Executes a CARDNOR direct command with an address.\n # Arguments\n\n* `commandId` - ID of the command.\n * `address` - Address to provide."] + #[doc = "Executes a CARDNOR direct command with an address.\n # Arguments\n\n* `commandId` - ID of the command.\n * `address` - Address to provide."] pub fn FSPXI_CardNorDirectCommandWithAddress( serviceHandle: Handle, commandId: u8_, @@ -10122,7 +10122,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Executes a CARDNOR direct read.\n # Arguments\n\n* `commandId` - ID of the command.\n * `size` - Size of the output buffer.\n * `output` - Output buffer."] + #[doc = "Executes a CARDNOR direct read.\n # Arguments\n\n* `commandId` - ID of the command.\n * `size` - Size of the output buffer.\n * `output` - Output buffer."] pub fn FSPXI_CardNorDirectRead( serviceHandle: Handle, commandId: u8_, @@ -10132,7 +10132,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Executes a CARDNOR direct read with an address.\n # Arguments\n\n* `commandId` - ID of the command.\n * `address` - Address to provide.\n * `size` - Size of the output buffer.\n * `output` - Output buffer."] + #[doc = "Executes a CARDNOR direct read with an address.\n # Arguments\n\n* `commandId` - ID of the command.\n * `address` - Address to provide.\n * `size` - Size of the output buffer.\n * `output` - Output buffer."] pub fn FSPXI_CardNorDirectReadWithAddress( serviceHandle: Handle, commandId: u8_, @@ -10143,7 +10143,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Executes a CARDNOR direct write.\n # Arguments\n\n* `commandId` - ID of the command.\n * `size` - Size of the input buffer.\n * `output` - Input buffer.\n > Stubbed in latest firmware, since ?.?.?"] + #[doc = "Executes a CARDNOR direct write.\n # Arguments\n\n* `commandId` - ID of the command.\n * `size` - Size of the input buffer.\n * `output` - Input buffer.\n > Stubbed in latest firmware, since ?.?.?"] pub fn FSPXI_CardNorDirectWrite( serviceHandle: Handle, commandId: u8_, @@ -10153,7 +10153,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Executes a CARDNOR direct write with an address.\n # Arguments\n\n* `commandId` - ID of the command.\n * `address` - Address to provide.\n * `size` - Size of the input buffer.\n * `input` - Input buffer."] + #[doc = "Executes a CARDNOR direct write with an address.\n # Arguments\n\n* `commandId` - ID of the command.\n * `address` - Address to provide.\n * `size` - Size of the input buffer.\n * `input` - Input buffer."] pub fn FSPXI_CardNorDirectWriteWithAddress( serviceHandle: Handle, commandId: u8_, @@ -10164,7 +10164,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Executes a CARDNOR 4xIO direct read.\n # Arguments\n\n* `commandId` - ID of the command.\n * `address` - Address to provide.\n * `size` - Size of the output buffer.\n * `output` - Output buffer."] + #[doc = "Executes a CARDNOR 4xIO direct read.\n # Arguments\n\n* `commandId` - ID of the command.\n * `address` - Address to provide.\n * `size` - Size of the output buffer.\n * `output` - Output buffer."] pub fn FSPXI_CardNorDirectRead_4xIO( serviceHandle: Handle, commandId: u8_, @@ -10175,7 +10175,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Executes a CARDNOR direct CPU write without verify.\n # Arguments\n\n* `address` - Address to provide.\n * `size` - Size of the input buffer.\n * `output` - Input buffer."] + #[doc = "Executes a CARDNOR direct CPU write without verify.\n # Arguments\n\n* `address` - Address to provide.\n * `size` - Size of the input buffer.\n * `output` - Input buffer."] pub fn FSPXI_CardNorDirectCpuWriteWithoutVerify( serviceHandle: Handle, address: u32_, @@ -10185,7 +10185,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Executes a CARDNOR direct sector erase without verify.\n # Arguments\n\n* `address` - Address to provide."] + #[doc = "Executes a CARDNOR direct sector erase without verify.\n # Arguments\n\n* `address` - Address to provide."] pub fn FSPXI_CardNorDirectSectorEraseWithoutVerify( serviceHandle: Handle, address: u32_, @@ -10193,7 +10193,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets an NCCH's product info\n # Arguments\n\n* `info` - Pointer to output the product info to.\n * `archive` - Open NCCH content archive"] + #[doc = "Gets an NCCH's product info\n # Arguments\n\n* `info` - Pointer to output the product info to.\n * `archive` - Open NCCH content archive"] pub fn FSPXI_GetProductInfo( serviceHandle: Handle, info: *mut FS_ProductInfo, @@ -10202,32 +10202,32 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Sets the CARDSPI baud rate.\n # Arguments\n\n* `baudRate` - Baud rate to set."] + #[doc = "Sets the CARDSPI baud rate.\n # Arguments\n\n* `baudRate` - Baud rate to set."] pub fn FSPXI_SetCardSpiBaudrate(serviceHandle: Handle, baudRate: FS_CardSpiBaudRate) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the CARDSPI bus mode.\n # Arguments\n\n* `busMode` - Bus mode to set."] + #[doc = "Sets the CARDSPI bus mode.\n # Arguments\n\n* `busMode` - Bus mode to set."] pub fn FSPXI_SetCardSpiBusMode(serviceHandle: Handle, busMode: FS_CardSpiBusMode) -> Result; } extern "C" { #[must_use] - #[doc = " Sends initialization info to ARM9\n # Arguments\n\n* `unk` - FS sends *(0x1FF81086)"] + #[doc = "Sends initialization info to ARM9\n # Arguments\n\n* `unk` - FS sends *(0x1FF81086)"] pub fn FSPXI_SendInitializeInfoTo9(serviceHandle: Handle, unk: u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Creates ext save data.\n # Arguments\n\n* `info` - Info of the save data."] + #[doc = "Creates ext save data.\n # Arguments\n\n* `info` - Info of the save data."] pub fn FSPXI_CreateExtSaveData(serviceHandle: Handle, info: FS_ExtSaveDataInfo) -> Result; } extern "C" { #[must_use] - #[doc = " Deletes ext save data.\n # Arguments\n\n* `info` - Info of the save data."] + #[doc = "Deletes ext save data.\n # Arguments\n\n* `info` - Info of the save data."] pub fn FSPXI_DeleteExtSaveData(serviceHandle: Handle, info: FS_ExtSaveDataInfo) -> Result; } extern "C" { #[must_use] - #[doc = " Enumerates ext save data.\n # Arguments\n\n* `idsWritten` - Pointer to output the number of IDs written to.\n * `idsSize` - Size of the IDs buffer.\n * `mediaType` - Media type to enumerate over.\n * `idSize` - Size of each ID element.\n * `shared` - Whether to enumerate shared ext save data.\n * `ids` - Pointer to output IDs to."] + #[doc = "Enumerates ext save data.\n # Arguments\n\n* `idsWritten` - Pointer to output the number of IDs written to.\n * `idsSize` - Size of the IDs buffer.\n * `mediaType` - Media type to enumerate over.\n * `idSize` - Size of each ID element.\n * `shared` - Whether to enumerate shared ext save data.\n * `ids` - Pointer to output IDs to."] pub fn FSPXI_EnumerateExtSaveData( serviceHandle: Handle, idsWritten: *mut u32_, @@ -10240,7 +10240,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets a special content's index.\n # Arguments\n\n* `index` - Pointer to output the index to.\n * `mediaType` - Media type of the special content.\n * `programId` - Program ID owning the special content.\n * `type` - Type of special content."] + #[doc = "Gets a special content's index.\n # Arguments\n\n* `index` - Pointer to output the index to.\n * `mediaType` - Media type of the special content.\n * `programId` - Program ID owning the special content.\n * `type` - Type of special content."] pub fn FSPXI_GetSpecialContentIndex( serviceHandle: Handle, index: *mut u16_, @@ -10251,7 +10251,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets the legacy ROM header of a program.\n # Arguments\n\n* `mediaType` - Media type of the program.\n * `programId` - ID of the program.\n * `header` - Pointer to output the legacy ROM header to. (size = 0x3B4)"] + #[doc = "Gets the legacy ROM header of a program.\n # Arguments\n\n* `mediaType` - Media type of the program.\n * `programId` - ID of the program.\n * `header` - Pointer to output the legacy ROM header to. (size = 0x3B4)"] pub fn FSPXI_GetLegacyRomHeader( serviceHandle: Handle, mediaType: FS_MediaType, @@ -10261,7 +10261,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets the legacy banner data of a program.\n # Arguments\n\n* `mediaType` - Media type of the program.\n * `programId` - ID of the program.\n * `banner` - Pointer to output the legacy banner data to. (size = 0x23C0)\n * `unk` - Unknown. Always 1?"] + #[doc = "Gets the legacy banner data of a program.\n # Arguments\n\n* `mediaType` - Media type of the program.\n * `programId` - ID of the program.\n * `banner` - Pointer to output the legacy banner data to. (size = 0x23C0)\n * `unk` - Unknown. Always 1?"] pub fn FSPXI_GetLegacyBannerData( serviceHandle: Handle, mediaType: FS_MediaType, @@ -10272,37 +10272,37 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Formats the CARDNOR device.\n # Arguments\n\n* `unk` - Unknown. Transaction?"] + #[doc = "Formats the CARDNOR device.\n # Arguments\n\n* `unk` - Unknown. Transaction?"] pub fn FSPXI_FormatCardNorDevice(serviceHandle: Handle, unk: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Deletes the 3DS SDMC root."] + #[doc = "Deletes the 3DS SDMC root."] pub fn FSPXI_DeleteSdmcRoot(serviceHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Deletes all ext save data on the NAND."] + #[doc = "Deletes all ext save data on the NAND."] pub fn FSPXI_DeleteAllExtSaveDataOnNand(serviceHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Initializes the CTR file system."] + #[doc = "Initializes the CTR file system."] pub fn FSPXI_InitializeCtrFilesystem(serviceHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Creates the FS seed."] + #[doc = "Creates the FS seed."] pub fn FSPXI_CreateSeed(serviceHandle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the CTR SDMC root path.\n # Arguments\n\n* `out` - Pointer to output the root path to.\n * `length` - Length of the output buffer in bytes."] + #[doc = "Gets the CTR SDMC root path.\n # Arguments\n\n* `out` - Pointer to output the root path to.\n * `length` - Length of the output buffer in bytes."] pub fn FSPXI_GetSdmcCtrRootPath(serviceHandle: Handle, out: *mut u16_, length: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets an archive's resource information.\n # Arguments\n\n* `archiveResource` - Pointer to output the archive resource information to.\n * `mediaType` - System media type to check."] + #[doc = "Gets an archive's resource information.\n # Arguments\n\n* `archiveResource` - Pointer to output the archive resource information to.\n * `mediaType` - System media type to check."] pub fn FSPXI_GetArchiveResource( serviceHandle: Handle, archiveResource: *mut FS_ArchiveResource, @@ -10311,7 +10311,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Exports the integrity verification seed.\n # Arguments\n\n* `seed` - Pointer to output the seed to."] + #[doc = "Exports the integrity verification seed.\n # Arguments\n\n* `seed` - Pointer to output the seed to."] pub fn FSPXI_ExportIntegrityVerificationSeed( serviceHandle: Handle, seed: *mut FS_IntegrityVerificationSeed, @@ -10319,7 +10319,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Imports an integrity verification seed.\n # Arguments\n\n* `seed` - Seed to import."] + #[doc = "Imports an integrity verification seed.\n # Arguments\n\n* `seed` - Seed to import."] pub fn FSPXI_ImportIntegrityVerificationSeed( serviceHandle: Handle, seed: *const FS_IntegrityVerificationSeed, @@ -10327,7 +10327,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets the legacy sub banner data of a program.\n # Arguments\n\n* `bannerSize` - Size of the banner.\n * `mediaType` - Media type of the program.\n * `programId` - ID of the program.\n * `header` - Pointer to output the legacy sub banner data to."] + #[doc = "Gets the legacy sub banner data of a program.\n # Arguments\n\n* `bannerSize` - Size of the banner.\n * `mediaType` - Media type of the program.\n * `programId` - ID of the program.\n * `header` - Pointer to output the legacy sub banner data to."] pub fn FSPXI_GetLegacySubBannerData( serviceHandle: Handle, bannerSize: u32_, @@ -10338,7 +10338,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Generates random bytes. Uses same code as PSPXI_GenerateRandomBytes\n # Arguments\n\n* `buf` - Buffer to output random bytes to.\n * `size` - Size of buffer."] + #[doc = "Generates random bytes. Uses same code as PSPXI_GenerateRandomBytes\n # Arguments\n\n* `buf` - Buffer to output random bytes to.\n * `size` - Size of buffer."] pub fn FSPXI_GenerateRandomBytes( serviceHandle: Handle, buffer: *mut ::libc::c_void, @@ -10347,7 +10347,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets the last modified time of a file in an archive.\n # Arguments\n\n* `archive` - The archive that contains the file.\n * `out` - The pointer to write the timestamp to.\n * `path` - The UTF-16 path of the file.\n * `size` - The size of the path."] + #[doc = "Gets the last modified time of a file in an archive.\n # Arguments\n\n* `archive` - The archive that contains the file.\n * `out` - The pointer to write the timestamp to.\n * `path` - The UTF-16 path of the file.\n * `size` - The size of the path."] pub fn FSPXI_GetFileLastModified( serviceHandle: Handle, archive: FSPXI_Archive, @@ -10358,7 +10358,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Reads from a special file.\n # Arguments\n\n* `bytesRead` - Pointer to output the number of bytes read to.\n * `fileOffset` - Offset of the file.\n * `size` - Size of the buffer.\n * `data` - Buffer to read to."] + #[doc = "Reads from a special file.\n # Arguments\n\n* `bytesRead` - Pointer to output the number of bytes read to.\n * `fileOffset` - Offset of the file.\n * `size` - Size of the buffer.\n * `data` - Buffer to read to."] pub fn FSPXI_ReadSpecialFile( serviceHandle: Handle, bytesRead: *mut u32_, @@ -10369,12 +10369,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets the size of a special file.\n # Arguments\n\n* `fileSize` - Pointer to output the size to."] + #[doc = "Gets the size of a special file.\n # Arguments\n\n* `fileSize` - Pointer to output the size to."] pub fn FSPXI_GetSpecialFileSize(serviceHandle: Handle, fileSize: *mut u64_) -> Result; } extern "C" { #[must_use] - #[doc = " Initiates a device move as the source device.\n # Arguments\n\n* `context` - Pointer to output the context to."] + #[doc = "Initiates a device move as the source device.\n # Arguments\n\n* `context` - Pointer to output the context to."] pub fn FSPXI_StartDeviceMoveAsSource( serviceHandle: Handle, context: *mut FS_DeviceMoveContext, @@ -10382,7 +10382,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Initiates a device move as the destination device.\n # Arguments\n\n* `context` - Context to use.\n * `clear` - Whether to clear the device's data first."] + #[doc = "Initiates a device move as the destination device.\n # Arguments\n\n* `context` - Context to use.\n * `clear` - Whether to clear the device's data first."] pub fn FSPXI_StartDeviceMoveAsDestination( serviceHandle: Handle, context: FS_DeviceMoveContext, @@ -10391,7 +10391,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Reads data and stores SHA256 hashes of blocks\n # Arguments\n\n* `file` - File to read from.\n * `bytesRead` - Pointer to output the number of read bytes to.\n * `offset` - Offset to read from.\n * `readBuffer` - Pointer to store read data in.\n * `readBufferSize` - Size of readBuffer.\n * `hashtable` - Pointer to store SHA256 hashes in.\n * `hashtableSize` - Size of hashtable.\n * `unk` - Unknown. Always 0x00001000? Possibly block size?"] + #[doc = "Reads data and stores SHA256 hashes of blocks\n # Arguments\n\n* `file` - File to read from.\n * `bytesRead` - Pointer to output the number of read bytes to.\n * `offset` - Offset to read from.\n * `readBuffer` - Pointer to store read data in.\n * `readBufferSize` - Size of readBuffer.\n * `hashtable` - Pointer to store SHA256 hashes in.\n * `hashtableSize` - Size of hashtable.\n * `unk` - Unknown. Always 0x00001000? Possibly block size?"] pub fn FSPXI_ReadFileSHA256( serviceHandle: Handle, file: FSPXI_File, @@ -10406,7 +10406,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Assumedly writes data and stores SHA256 hashes of blocks\n # Arguments\n\n* `file` - File to write to.\n * `bytesWritten` - Pointer to output the number of written bytes to.\n * `offset` - Offset to write to.\n * `writeBuffer` - Buffer to write from.\n * `writeBufferSize` - Size of writeBuffer.\n * `hashtable` - Pointer to store SHA256 hashes in.\n * `hashtableSize` - Size of hashtable\n * `unk1` - Unknown. Might match with ReadFileSHA256's unknown?\n * `unk2` - Unknown. Might match with ReadFileSHA256's unknown?"] + #[doc = "Assumedly writes data and stores SHA256 hashes of blocks\n # Arguments\n\n* `file` - File to write to.\n * `bytesWritten` - Pointer to output the number of written bytes to.\n * `offset` - Offset to write to.\n * `writeBuffer` - Buffer to write from.\n * `writeBufferSize` - Size of writeBuffer.\n * `hashtable` - Pointer to store SHA256 hashes in.\n * `hashtableSize` - Size of hashtable\n * `unk1` - Unknown. Might match with ReadFileSHA256's unknown?\n * `unk2` - Unknown. Might match with ReadFileSHA256's unknown?"] pub fn FSPXI_WriteFileSHA256( serviceHandle: Handle, file: FSPXI_File, @@ -10422,22 +10422,22 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Configures CTRCARD latency emulation.\n # Arguments\n\n* `latency` - Latency to apply."] + #[doc = "Configures CTRCARD latency emulation.\n # Arguments\n\n* `latency` - Latency to apply."] pub fn FSPXI_SetCtrCardLatencyParameter(serviceHandle: Handle, latency: u64_) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the file system priority.\n # Arguments\n\n* `priority` - Priority to set."] + #[doc = "Sets the file system priority.\n # Arguments\n\n* `priority` - Priority to set."] pub fn FSPXI_SetPriority(serviceHandle: Handle, priority: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Toggles cleaning up invalid save data.\n # Arguments\n\n* `enable` - Whether to enable cleaning up invalid save data."] + #[doc = "Toggles cleaning up invalid save data.\n # Arguments\n\n* `enable` - Whether to enable cleaning up invalid save data."] pub fn FSPXI_SwitchCleanupInvalidSaveData(serviceHandle: Handle, enable: bool) -> Result; } extern "C" { #[must_use] - #[doc = " Enumerates system save data.\n # Arguments\n\n* `idsWritten` - Pointer to output the number of IDs written to.\n * `idsSize` - Size of the IDs buffer.\n * `ids` - Pointer to output IDs to."] + #[doc = "Enumerates system save data.\n # Arguments\n\n* `idsWritten` - Pointer to output the number of IDs written to.\n * `idsSize` - Size of the IDs buffer.\n * `ids` - Pointer to output IDs to."] pub fn FSPXI_EnumerateSystemSaveData( serviceHandle: Handle, idsWritten: *mut u32_, @@ -10447,7 +10447,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Reads the NAND report.\n # Arguments\n\n* `unk` - Unknown\n * `buffer` - Buffer to write the report to.\n * `size` - Size of buffer"] + #[doc = "Reads the NAND report.\n # Arguments\n\n* `unk` - Unknown\n * `buffer` - Buffer to write the report to.\n * `size` - Size of buffer"] pub fn FSPXI_ReadNandReport( serviceHandle: Handle, buffer: *mut ::libc::c_void, @@ -10457,7 +10457,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Unknown command 0x56\n > Called by FSUSER_ControlArchive with ArchiveAction 0x789D"] + #[doc = "Unknown command 0x56\n > Called by FSUSER_ControlArchive with ArchiveAction 0x789D"] pub fn FSPXI_Unknown0x56( serviceHandle: Handle, out: *mut u32_, @@ -10467,20 +10467,20 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Initializes fs:REG."] + #[doc = "Initializes fs:REG."] pub fn fsRegInit() -> Result; } extern "C" { - #[doc = " Exits fs:REG."] + #[doc = "Exits fs:REG."] pub fn fsRegExit(); } extern "C" { - #[doc = " Gets the current fs:REG session handle.\n # Returns\n\nThe current fs:REG session handle."] + #[doc = "Gets the current fs:REG session handle.\n # Returns\n\nThe current fs:REG session handle."] pub fn fsRegGetSessionHandle() -> *mut Handle; } extern "C" { #[must_use] - #[doc = " Registers a program's storage information.\n # Arguments\n\n* `pid` - The Process ID of the program.\n * `programHandle` - The program handle.\n * `programInfo` - Information about the program.\n * `storageInfo` - Storage information to register."] + #[doc = "Registers a program's storage information.\n # Arguments\n\n* `pid` - The Process ID of the program.\n * `programHandle` - The program handle.\n * `programInfo` - Information about the program.\n * `storageInfo` - Storage information to register."] pub fn FSREG_Register( pid: u32_, programHandle: u64_, @@ -10490,12 +10490,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Unregisters a program's storage information.\n # Arguments\n\n* `pid` - The Process ID of the program."] + #[doc = "Unregisters a program's storage information.\n # Arguments\n\n* `pid` - The Process ID of the program."] pub fn FSREG_Unregister(pid: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Retrives the exheader information set(s) (SCI+ACI) about a program.\n # Arguments\n\n* `exheaderInfos[out]` - Pointer to the output exheader information set(s).\n * `maxNumEntries` - The maximum number of entries.\n * `programHandle` - The program handle."] + #[doc = "Retrives the exheader information set(s) (SCI+ACI) about a program.\n # Arguments\n\n* `exheaderInfos[out]` - Pointer to the output exheader information set(s).\n * `maxNumEntries` - The maximum number of entries.\n * `programHandle` - The program handle."] pub fn FSREG_GetProgramInfo( exheaderInfos: *mut ExHeader_Info, maxNumEntries: u32_, @@ -10504,7 +10504,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Loads a program.\n # Arguments\n\n* `programHandle[out]` - Pointer to the output the program handle to.\n * `programInfo` - Information about the program to load."] + #[doc = "Loads a program.\n # Arguments\n\n* `programHandle[out]` - Pointer to the output the program handle to.\n * `programInfo` - Information about the program to load."] pub fn FSREG_LoadProgram( programHandle: *mut u64_, programInfo: *const FS_ProgramInfo, @@ -10512,21 +10512,21 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Unloads a program.\n # Arguments\n\n* `programHandle` - The program handle."] + #[doc = "Unloads a program.\n # Arguments\n\n* `programHandle` - The program handle."] pub fn FSREG_UnloadProgram(programHandle: u64_) -> Result; } extern "C" { #[must_use] - #[doc = " Checks if a program has been loaded by fs:REG.\n # Arguments\n\n* `programHandle` - The program handle."] + #[doc = "Checks if a program has been loaded by fs:REG.\n # Arguments\n\n* `programHandle` - The program handle."] pub fn FSREG_CheckHostLoadId(programHandle: u64_) -> Result; } -#[doc = " Shared Mii struct"] +#[doc = "Shared Mii struct"] #[repr(C)] #[repr(align(1))] pub struct MiiData { pub _bindgen_opaque_blob: [u8; 92usize], } -#[doc = " Mii options"] +#[doc = "Mii options"] #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone)] pub struct MiiData__bindgen_ty_1 { @@ -10605,7 +10605,7 @@ impl MiiData__bindgen_ty_1 { __bindgen_bitfield_unit } } -#[doc = " Mii position in Mii selector or Mii maker"] +#[doc = "Mii position in Mii selector or Mii maker"] #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone)] pub struct MiiData__bindgen_ty_2 { @@ -10649,7 +10649,7 @@ impl MiiData__bindgen_ty_2 { __bindgen_bitfield_unit } } -#[doc = " Console Identity"] +#[doc = "Console Identity"] #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone)] pub struct MiiData__bindgen_ty_3 { @@ -10696,7 +10696,7 @@ impl MiiData__bindgen_ty_3 { __bindgen_bitfield_unit } } -#[doc = " Mii details"] +#[doc = "Mii details"] #[repr(C)] #[repr(align(2))] #[derive(Debug, Default, Copy, Clone)] @@ -10792,7 +10792,7 @@ impl MiiData__bindgen_ty_4 { __bindgen_bitfield_unit } } -#[doc = " Face style"] +#[doc = "Face style"] #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone)] pub struct MiiData__bindgen_ty_5 { @@ -10855,7 +10855,7 @@ impl MiiData__bindgen_ty_5 { __bindgen_bitfield_unit } } -#[doc = " Face details"] +#[doc = "Face details"] #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone)] pub struct MiiData__bindgen_ty_6 { @@ -10899,7 +10899,7 @@ impl MiiData__bindgen_ty_6 { __bindgen_bitfield_unit } } -#[doc = " Hair details"] +#[doc = "Hair details"] #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone)] pub struct MiiData__bindgen_ty_7 { @@ -10943,7 +10943,7 @@ impl MiiData__bindgen_ty_7 { __bindgen_bitfield_unit } } -#[doc = " Eye details"] +#[doc = "Eye details"] #[repr(C)] #[repr(align(4))] #[derive(Debug, Default, Copy, Clone)] @@ -11071,7 +11071,7 @@ impl MiiData__bindgen_ty_8 { __bindgen_bitfield_unit } } -#[doc = " Eyebrow details"] +#[doc = "Eyebrow details"] #[repr(C)] #[repr(align(4))] #[derive(Debug, Default, Copy, Clone)] @@ -11215,7 +11215,7 @@ impl MiiData__bindgen_ty_9 { __bindgen_bitfield_unit } } -#[doc = " Nose details"] +#[doc = "Nose details"] #[repr(C)] #[repr(align(2))] #[derive(Debug, Default, Copy, Clone)] @@ -11279,7 +11279,7 @@ impl MiiData__bindgen_ty_10 { __bindgen_bitfield_unit } } -#[doc = " Mouth details"] +#[doc = "Mouth details"] #[repr(C)] #[repr(align(2))] #[derive(Debug, Default, Copy, Clone)] @@ -11359,7 +11359,7 @@ impl MiiData__bindgen_ty_11 { __bindgen_bitfield_unit } } -#[doc = " Mustache details"] +#[doc = "Mustache details"] #[repr(C)] #[repr(align(2))] #[derive(Debug, Default, Copy, Clone)] @@ -11423,7 +11423,7 @@ impl MiiData__bindgen_ty_12 { __bindgen_bitfield_unit } } -#[doc = " Beard details"] +#[doc = "Beard details"] #[repr(C)] #[repr(align(2))] #[derive(Debug, Default, Copy, Clone)] @@ -11503,7 +11503,7 @@ impl MiiData__bindgen_ty_13 { __bindgen_bitfield_unit } } -#[doc = " Glasses details"] +#[doc = "Glasses details"] #[repr(C)] #[repr(align(2))] #[derive(Debug, Default, Copy, Clone)] @@ -11583,7 +11583,7 @@ impl MiiData__bindgen_ty_14 { __bindgen_bitfield_unit } } -#[doc = " Mole details"] +#[doc = "Mole details"] #[repr(C)] #[repr(align(2))] #[derive(Debug, Default, Copy, Clone)] @@ -11672,7 +11672,7 @@ impl Default for MiiData { } } } -#[doc = " Friend key data"] +#[doc = "Friend key data"] #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone)] pub struct FriendKey { @@ -11680,7 +11680,7 @@ pub struct FriendKey { pub padding: u32_, pub localFriendCode: u64_, } -#[doc = " Friend Title data"] +#[doc = "Friend Title data"] #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone)] pub struct TitleData { @@ -11688,7 +11688,7 @@ pub struct TitleData { pub version: u32_, pub unk: u32_, } -#[doc = " Friend profile data"] +#[doc = "Friend profile data"] #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone)] pub struct FriendProfile { @@ -11704,7 +11704,7 @@ pub struct FriendProfile { pub platform: u8_, pub padding: u32_, } -#[doc = " Game Description structure"] +#[doc = "Game Description structure"] #[repr(C, packed)] #[derive(Debug, Copy, Clone)] pub struct GameDescription { @@ -11720,7 +11720,7 @@ impl Default for GameDescription { } } } -#[doc = " Friend Notification Event structure"] +#[doc = "Friend Notification Event structure"] #[repr(C, packed)] #[derive(Debug, Default, Copy, Clone)] pub struct NotificationEvent { @@ -11747,49 +11747,49 @@ pub const FRIEND_WENT_OFFLINE: NotificationTypes = 7; pub const FRIEND_REGISTERED_USER: NotificationTypes = 8; #[doc = "< Friend Sent invitation"] pub const FRIEND_SENT_INVITATION: NotificationTypes = 9; -#[doc = " Enum to use with FRD_GetNotificationEvent"] +#[doc = "Enum to use with FRD_GetNotificationEvent"] pub type NotificationTypes = ::libc::c_uint; extern "C" { #[must_use] - #[doc = " Initializes FRD service."] + #[doc = "Initializes FRD service."] pub fn frdInit() -> Result; } extern "C" { - #[doc = " Exists FRD."] + #[doc = "Exists FRD."] pub fn frdExit(); } extern "C" { - #[doc = " Get FRD handle."] + #[doc = "Get FRD handle."] pub fn frdGetSessionHandle() -> *mut Handle; } extern "C" { #[must_use] - #[doc = " Gets the login status of the current user.\n # Arguments\n\n* `state` - Pointer to write the current user's login status to."] + #[doc = "Gets the login status of the current user.\n # Arguments\n\n* `state` - Pointer to write the current user's login status to."] pub fn FRDU_HasLoggedIn(state: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the online status of the current user.\n # Arguments\n\n* `state` - Pointer to write the current user's online status to."] + #[doc = "Gets the online status of the current user.\n # Arguments\n\n* `state` - Pointer to write the current user's online status to."] pub fn FRDU_IsOnline(state: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Logs out of Nintendo's friend server."] + #[doc = "Logs out of Nintendo's friend server."] pub fn FRD_Logout() -> Result; } extern "C" { #[must_use] - #[doc = " Log in to Nintendo's friend server.\n # Arguments\n\n* `event` - Event to signal when Login is done."] + #[doc = "Log in to Nintendo's friend server.\n # Arguments\n\n* `event` - Event to signal when Login is done."] pub fn FRD_Login(event: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the current user's friend key.\n # Arguments\n\n* `key` - Pointer to write the current user's friend key to."] + #[doc = "Gets the current user's friend key.\n # Arguments\n\n* `key` - Pointer to write the current user's friend key to."] pub fn FRD_GetMyFriendKey(key: *mut FriendKey) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the current user's privacy information.\n # Arguments\n\n* `isPublicMode` - Determines whether friends are notified of the current user's online status.\n * `isShowGameName` - Determines whether friends are notified of the application that the current user is running.\n * `isShowPlayedGame` - Determiens whether to display the current user's game history."] + #[doc = "Gets the current user's privacy information.\n # Arguments\n\n* `isPublicMode` - Determines whether friends are notified of the current user's online status.\n * `isShowGameName` - Determines whether friends are notified of the application that the current user is running.\n * `isShowPlayedGame` - Determiens whether to display the current user's game history."] pub fn FRD_GetMyPreference( isPublicMode: *mut bool, isShowGameName: *mut bool, @@ -11798,37 +11798,37 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets the current user's profile information.\n # Arguments\n\n* `profile` - Pointer to write the current user's profile information to."] + #[doc = "Gets the current user's profile information.\n # Arguments\n\n* `profile` - Pointer to write the current user's profile information to."] pub fn FRD_GetMyProfile(profile: *mut FriendProfile) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the current user's screen name.\n # Arguments\n\n* `name` - Pointer to write the current user's screen name to.\n * `max_size` - Max size of the screen name."] + #[doc = "Gets the current user's screen name.\n # Arguments\n\n* `name` - Pointer to write the current user's screen name to.\n * `max_size` - Max size of the screen name."] pub fn FRD_GetMyScreenName(name: *mut ::libc::c_char, max_size: usize) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the current user's Mii data.\n # Arguments\n\n* `mii` - Pointer to write the current user's mii data to."] + #[doc = "Gets the current user's Mii data.\n # Arguments\n\n* `mii` - Pointer to write the current user's mii data to."] pub fn FRD_GetMyMii(mii: *mut MiiData) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the current user's playing game.\n # Arguments\n\n* `titleId` - Pointer to write the current user's playing game to."] + #[doc = "Gets the current user's playing game.\n # Arguments\n\n* `titleId` - Pointer to write the current user's playing game to."] pub fn FRD_GetMyPlayingGame(titleId: *mut u64_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the current user's favourite game.\n # Arguments\n\n* `titleId` - Pointer to write the title ID of current user's favourite game to."] + #[doc = "Gets the current user's favourite game.\n # Arguments\n\n* `titleId` - Pointer to write the title ID of current user's favourite game to."] pub fn FRD_GetMyFavoriteGame(titleId: *mut u64_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the current user's comment on their friend profile.\n # Arguments\n\n* `comment` - Pointer to write the current user's comment to.\n * `max_size` - Max size of the comment."] + #[doc = "Gets the current user's comment on their friend profile.\n # Arguments\n\n* `comment` - Pointer to write the current user's comment to.\n * `max_size` - Max size of the comment."] pub fn FRD_GetMyComment(comment: *mut ::libc::c_char, max_size: usize) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the current user's friend key list.\n # Arguments\n\n* `friendKeyList` - Pointer to write the friend key list to.\n * `num` - Stores the number of friend keys obtained.\n * `offset` - The index of the friend key to start with.\n * `size` - Size of the friend key list. (FRIEND_LIST_SIZE)"] + #[doc = "Gets the current user's friend key list.\n # Arguments\n\n* `friendKeyList` - Pointer to write the friend key list to.\n * `num` - Stores the number of friend keys obtained.\n * `offset` - The index of the friend key to start with.\n * `size` - Size of the friend key list. (FRIEND_LIST_SIZE)"] pub fn FRD_GetFriendKeyList( friendKeyList: *mut FriendKey, num: *mut u32_, @@ -11838,7 +11838,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets the current user's friends' Mii data.\n # Arguments\n\n* `miiDataList` - Pointer to write Mii data to.\n * `friendKeyList` - Pointer to FriendKeys.\n * `size` - Number of Friendkeys."] + #[doc = "Gets the current user's friends' Mii data.\n # Arguments\n\n* `miiDataList` - Pointer to write Mii data to.\n * `friendKeyList` - Pointer to FriendKeys.\n * `size` - Number of Friendkeys."] pub fn FRD_GetFriendMii( miiDataList: *mut MiiData, friendKeyList: *const FriendKey, @@ -11847,7 +11847,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Get the current user's friends' profile data.\n # Arguments\n\n* `profile` - Pointer to write profile data to.\n * `friendKeyList` - Pointer to FriendKeys.\n * `size` - Number of FriendKeys."] + #[doc = "Get the current user's friends' profile data.\n # Arguments\n\n* `profile` - Pointer to write profile data to.\n * `friendKeyList` - Pointer to FriendKeys.\n * `size` - Number of FriendKeys."] pub fn FRD_GetFriendProfile( profile: *mut FriendProfile, friendKeyList: *const FriendKey, @@ -11856,7 +11856,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Get the current user's friends' playing game.\n # Arguments\n\n* `desc` - Pointer to write Game Description data to.\n * `friendKeyList` - Pointer to FriendKeys,\n * `size` - Number Of FriendKeys."] + #[doc = "Get the current user's friends' playing game.\n # Arguments\n\n* `desc` - Pointer to write Game Description data to.\n * `friendKeyList` - Pointer to FriendKeys,\n * `size` - Number Of FriendKeys."] pub fn FRD_GetFriendPlayingGame( desc: *mut GameDescription, friendKeyList: *const FriendKey, @@ -11865,7 +11865,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Get the current user's friends' favourite game.\n # Arguments\n\n* `desc` - Pointer to write Game Description data to.\n * `friendKeyList` - Pointer to FriendKeys,\n * `count` - Number Of FriendKeys."] + #[doc = "Get the current user's friends' favourite game.\n # Arguments\n\n* `desc` - Pointer to write Game Description data to.\n * `friendKeyList` - Pointer to FriendKeys,\n * `count` - Number Of FriendKeys."] pub fn FRD_GetFriendFavouriteGame( desc: *mut GameDescription, friendKeyList: *const FriendKey, @@ -11874,22 +11874,22 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets whether a friend key is included in the current user's friend list.\n # Arguments\n\n* `friendKeyList` - Pointer to a list of friend keys.\n * `isFromList` - Pointer to a write the friendship status to."] + #[doc = "Gets whether a friend key is included in the current user's friend list.\n # Arguments\n\n* `friendKeyList` - Pointer to a list of friend keys.\n * `isFromList` - Pointer to a write the friendship status to."] pub fn FRD_IsInFriendList(friendKeyList: *mut FriendKey, isFromList: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Updates the game mode description string.\n # Arguments\n\n* `desc` - Pointer to write the game mode description to."] + #[doc = "Updates the game mode description string.\n # Arguments\n\n* `desc` - Pointer to write the game mode description to."] pub fn FRD_UpdateGameModeDescription(desc: *const ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = " Event which is signaled when friend login states change.\n # Arguments\n\n* `event` - event which will be signaled."] + #[doc = "Event which is signaled when friend login states change.\n # Arguments\n\n* `event` - event which will be signaled."] pub fn FRD_AttachToEventNotification(event: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Get Latest Event Notification\n # Arguments\n\n* `event` - Pointer to write recieved notification event struct to.\n * `count` - Number of events\n * `recievedNotifCount` - Number of notification reccieved."] + #[doc = "Get Latest Event Notification\n # Arguments\n\n* `event` - Pointer to write recieved notification event struct to.\n * `count` - Number of events\n * `recievedNotifCount` - Number of notification reccieved."] pub fn FRD_GetEventNotification( event: *mut NotificationEvent, count: u32_, @@ -11898,32 +11898,32 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Returns the friend code using the given principal ID.\n # Arguments\n\n* `principalId` - The principal ID being used.\n * `friendCode` - Pointer to write the friend code to."] + #[doc = "Returns the friend code using the given principal ID.\n # Arguments\n\n* `principalId` - The principal ID being used.\n * `friendCode` - Pointer to write the friend code to."] pub fn FRD_PrincipalIdToFriendCode(principalId: u32_, friendCode: *mut u64_) -> Result; } extern "C" { #[must_use] - #[doc = " Returns the principal ID using the given friend code.\n # Arguments\n\n* `friendCode` - The friend code being used.\n * `principalId` - Pointer to write the principal ID to."] + #[doc = "Returns the principal ID using the given friend code.\n # Arguments\n\n* `friendCode` - The friend code being used.\n * `principalId` - Pointer to write the principal ID to."] pub fn FRD_FriendCodeToPrincipalId(friendCode: u64_, principalId: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Checks if the friend code is valid.\n # Arguments\n\n* `friendCode` - The friend code being used.\n * `isValid` - Pointer to write the validity of the friend code to."] + #[doc = "Checks if the friend code is valid.\n # Arguments\n\n* `friendCode` - The friend code being used.\n * `isValid` - Pointer to write the validity of the friend code to."] pub fn FRD_IsValidFriendCode(friendCode: u64_, isValid: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the Friend API to use a specific SDK version.\n # Arguments\n\n* `sdkVer` - The SDK version needed to be used."] + #[doc = "Sets the Friend API to use a specific SDK version.\n # Arguments\n\n* `sdkVer` - The SDK version needed to be used."] pub fn FRD_SetClientSdkVersion(sdkVer: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Add a Friend online.\n # Arguments\n\n* `event` - Event signaled when friend is registered.\n * `principalId` - PrincipalId of the friend to add."] + #[doc = "Add a Friend online.\n # Arguments\n\n* `event` - Event signaled when friend is registered.\n * `principalId` - PrincipalId of the friend to add."] pub fn FRD_AddFriendOnline(event: Handle, principalId: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Remove a Friend.\n # Arguments\n\n* `principalId` - PrinipalId of the friend code to remove.\n * `localFriendCode` - LocalFriendCode of the friend code to remove."] + #[doc = "Remove a Friend.\n # Arguments\n\n* `principalId` - PrinipalId of the friend code to remove.\n * `localFriendCode` - LocalFriendCode of the friend code to remove."] pub fn FRD_RemoveFriend(principalId: u32_, localFriendCode: u64_) -> Result; } #[doc = "< Top screen."] @@ -11932,64 +11932,64 @@ pub const GSPLCD_SCREEN_TOP: _bindgen_ty_21 = 1; pub const GSPLCD_SCREEN_BOTTOM: _bindgen_ty_21 = 2; #[doc = "< Both screens."] pub const GSPLCD_SCREEN_BOTH: _bindgen_ty_21 = 3; -#[doc = " LCD screens."] +#[doc = "LCD screens."] pub type _bindgen_ty_21 = ::libc::c_uint; extern "C" { #[must_use] - #[doc = " Initializes GSPLCD."] + #[doc = "Initializes GSPLCD."] pub fn gspLcdInit() -> Result; } extern "C" { - #[doc = " Exits GSPLCD."] + #[doc = "Exits GSPLCD."] pub fn gspLcdExit(); } extern "C" { - #[doc = " Gets a pointer to the current gsp::Lcd session handle.\n # Returns\n\nA pointer to the current gsp::Lcd session handle."] + #[doc = "Gets a pointer to the current gsp::Lcd session handle.\n # Returns\n\nA pointer to the current gsp::Lcd session handle."] pub fn gspLcdGetSessionHandle() -> *mut Handle; } extern "C" { #[must_use] - #[doc = " Powers on both backlights."] + #[doc = "Powers on both backlights."] pub fn GSPLCD_PowerOnAllBacklights() -> Result; } extern "C" { #[must_use] - #[doc = " Powers off both backlights."] + #[doc = "Powers off both backlights."] pub fn GSPLCD_PowerOffAllBacklights() -> Result; } extern "C" { #[must_use] - #[doc = " Powers on the backlight.\n # Arguments\n\n* `screen` - Screen to power on."] + #[doc = "Powers on the backlight.\n # Arguments\n\n* `screen` - Screen to power on."] pub fn GSPLCD_PowerOnBacklight(screen: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Powers off the backlight.\n # Arguments\n\n* `screen` - Screen to power off."] + #[doc = "Powers off the backlight.\n # Arguments\n\n* `screen` - Screen to power off."] pub fn GSPLCD_PowerOffBacklight(screen: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Sets 3D_LEDSTATE to the input state value.\n # Arguments\n\n* `disable` - False = 3D LED enable, true = 3D LED disable."] + #[doc = "Sets 3D_LEDSTATE to the input state value.\n # Arguments\n\n* `disable` - False = 3D LED enable, true = 3D LED disable."] pub fn GSPLCD_SetLedForceOff(disable: bool) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the LCD screens' vendors. Stubbed on old 3ds.\n # Arguments\n\n* `vendor` - Pointer to output the screen vendors to."] + #[doc = "Gets the LCD screens' vendors. Stubbed on old 3ds.\n # Arguments\n\n* `vendor` - Pointer to output the screen vendors to."] pub fn GSPLCD_GetVendors(vendors: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the LCD screens' brightness. Stubbed on old 3ds.\n # Arguments\n\n* `screen` - Screen to get the brightness value of.\n * `brightness` - Brightness value returned."] + #[doc = "Gets the LCD screens' brightness. Stubbed on old 3ds.\n # Arguments\n\n* `screen` - Screen to get the brightness value of.\n * `brightness` - Brightness value returned."] pub fn GSPLCD_GetBrightness(screen: u32_, brightness: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the LCD screens' brightness.\n # Arguments\n\n* `screen` - Screen to set the brightness value of.\n * `brightness` - Brightness value set."] + #[doc = "Sets the LCD screens' brightness.\n # Arguments\n\n* `screen` - Screen to set the brightness value of.\n * `brightness` - Brightness value set."] pub fn GSPLCD_SetBrightness(screen: u32_, brightness: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the LCD screens' raw brightness.\n # Arguments\n\n* `screen` - Screen to set the brightness value of.\n * `brightness` - Brightness value set."] + #[doc = "Sets the LCD screens' raw brightness.\n # Arguments\n\n* `screen` - Screen to set the brightness value of.\n * `brightness` - Brightness value set."] pub fn GSPLCD_SetBrightnessRaw(screen: u32_, brightness: u32_) -> Result; } #[doc = "< A"] @@ -12046,9 +12046,9 @@ pub const KEY_DOWN: _bindgen_ty_22 = 2147483776; pub const KEY_LEFT: _bindgen_ty_22 = 536870944; #[doc = "< D-Pad Right or Circle Pad Right"] pub const KEY_RIGHT: _bindgen_ty_22 = 268435472; -#[doc = " Key values."] +#[doc = "Key values."] pub type _bindgen_ty_22 = ::libc::c_uint; -#[doc = " Touch position."] +#[doc = "Touch position."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct touchPosition { @@ -12057,7 +12057,7 @@ pub struct touchPosition { #[doc = "< Touch Y"] pub py: u16_, } -#[doc = " Circle Pad position."] +#[doc = "Circle Pad position."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct circlePosition { @@ -12066,7 +12066,7 @@ pub struct circlePosition { #[doc = "< Pad Y"] pub dy: s16, } -#[doc = " Accelerometer vector."] +#[doc = "Accelerometer vector."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct accelVector { @@ -12077,7 +12077,7 @@ pub struct accelVector { #[doc = "< Accelerometer Z"] pub z: s16, } -#[doc = " Gyroscope angular rate."] +#[doc = "Gyroscope angular rate."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct angularRate { @@ -12100,7 +12100,7 @@ pub const HIDEVENT_Gyro: HID_Event = 3; pub const HIDEVENT_DebugPad: HID_Event = 4; #[doc = "< Used to know how many events there are."] pub const HIDEVENT_MAX: HID_Event = 5; -#[doc = " HID events."] +#[doc = "HID events."] pub type HID_Event = ::libc::c_uint; extern "C" { #[doc = "< HID shared memory handle."] @@ -12112,65 +12112,65 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Initializes HID."] + #[doc = "Initializes HID."] pub fn hidInit() -> Result; } extern "C" { - #[doc = " Exits HID."] + #[doc = "Exits HID."] pub fn hidExit(); } extern "C" { - #[doc = " Sets the key repeat parameters for hidKeysRepeat.\n # Arguments\n\n* `delay` - Initial delay.\n * `interval` - Repeat interval."] + #[doc = "Sets the key repeat parameters for hidKeysRepeat.\n # Arguments\n\n* `delay` - Initial delay.\n * `interval` - Repeat interval."] pub fn hidSetRepeatParameters(delay: u32_, interval: u32_); } extern "C" { - #[doc = " Scans HID for input data."] + #[doc = "Scans HID for input data."] pub fn hidScanInput(); } extern "C" { - #[doc = " Returns a bitmask of held buttons.\n Individual buttons can be extracted using binary AND.\n # Returns\n\n32-bit bitmask of held buttons (1+ frames)."] + #[doc = "Returns a bitmask of held buttons.\n Individual buttons can be extracted using binary AND.\n # Returns\n\n32-bit bitmask of held buttons (1+ frames)."] pub fn hidKeysHeld() -> u32_; } extern "C" { - #[doc = " Returns a bitmask of newly pressed buttons, this frame.\n Individual buttons can be extracted using binary AND.\n # Returns\n\n32-bit bitmask of newly pressed buttons."] + #[doc = "Returns a bitmask of newly pressed buttons, this frame.\n Individual buttons can be extracted using binary AND.\n # Returns\n\n32-bit bitmask of newly pressed buttons."] pub fn hidKeysDown() -> u32_; } extern "C" { - #[doc = " Returns a bitmask of newly pressed or repeated buttons, this frame.\n Individual buttons can be extracted using binary AND.\n # Returns\n\n32-bit bitmask of newly pressed or repeated buttons."] + #[doc = "Returns a bitmask of newly pressed or repeated buttons, this frame.\n Individual buttons can be extracted using binary AND.\n # Returns\n\n32-bit bitmask of newly pressed or repeated buttons."] pub fn hidKeysDownRepeat() -> u32_; } extern "C" { - #[doc = " Returns a bitmask of newly released buttons, this frame.\n Individual buttons can be extracted using binary AND.\n # Returns\n\n32-bit bitmask of newly released buttons."] + #[doc = "Returns a bitmask of newly released buttons, this frame.\n Individual buttons can be extracted using binary AND.\n # Returns\n\n32-bit bitmask of newly released buttons."] pub fn hidKeysUp() -> u32_; } extern "C" { - #[doc = " Reads the current touch position.\n # Arguments\n\n* `pos` - Pointer to output the touch position to."] + #[doc = "Reads the current touch position.\n # Arguments\n\n* `pos` - Pointer to output the touch position to."] pub fn hidTouchRead(pos: *mut touchPosition); } extern "C" { - #[doc = " Reads the current circle pad position.\n # Arguments\n\n* `pos` - Pointer to output the circle pad position to."] + #[doc = "Reads the current circle pad position.\n # Arguments\n\n* `pos` - Pointer to output the circle pad position to."] pub fn hidCircleRead(pos: *mut circlePosition); } extern "C" { - #[doc = " Reads the current accelerometer data.\n # Arguments\n\n* `vector` - Pointer to output the accelerometer data to."] + #[doc = "Reads the current accelerometer data.\n # Arguments\n\n* `vector` - Pointer to output the accelerometer data to."] pub fn hidAccelRead(vector: *mut accelVector); } extern "C" { - #[doc = " Reads the current gyroscope data.\n # Arguments\n\n* `rate` - Pointer to output the gyroscope data to."] + #[doc = "Reads the current gyroscope data.\n # Arguments\n\n* `rate` - Pointer to output the gyroscope data to."] pub fn hidGyroRead(rate: *mut angularRate); } extern "C" { - #[doc = " Waits for an HID event.\n # Arguments\n\n* `id` - ID of the event.\n * `nextEvent` - Whether to discard the current event and wait for the next event."] + #[doc = "Waits for an HID event.\n # Arguments\n\n* `id` - ID of the event.\n * `nextEvent` - Whether to discard the current event and wait for the next event."] pub fn hidWaitForEvent(id: HID_Event, nextEvent: bool); } extern "C" { #[must_use] - #[doc = " Waits for any HID or IRRST event.\n # Arguments\n\n* `nextEvents` - Whether to discard the current events and wait for the next events.\n * `cancelEvent` - Optional additional handle to wait on, otherwise 0.\n * `timeout` - Timeout."] + #[doc = "Waits for any HID or IRRST event.\n # Arguments\n\n* `nextEvents` - Whether to discard the current events and wait for the next events.\n * `cancelEvent` - Optional additional handle to wait on, otherwise 0.\n * `timeout` - Timeout."] pub fn hidWaitForAnyEvent(nextEvents: bool, cancelEvent: Handle, timeout: s64) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the handles for HID operation.\n # Arguments\n\n* `outMemHandle` - Pointer to output the shared memory handle to.\n * `eventpad0` - Pointer to output the pad 0 event handle to.\n * `eventpad1` - Pointer to output the pad 1 event handle to.\n * `eventaccel` - Pointer to output the accelerometer event handle to.\n * `eventgyro` - Pointer to output the gyroscope event handle to.\n * `eventdebugpad` - Pointer to output the debug pad event handle to."] + #[doc = "Gets the handles for HID operation.\n # Arguments\n\n* `outMemHandle` - Pointer to output the shared memory handle to.\n * `eventpad0` - Pointer to output the pad 0 event handle to.\n * `eventpad1` - Pointer to output the pad 1 event handle to.\n * `eventaccel` - Pointer to output the accelerometer event handle to.\n * `eventgyro` - Pointer to output the gyroscope event handle to.\n * `eventdebugpad` - Pointer to output the debug pad event handle to."] pub fn HIDUSER_GetHandles( outMemHandle: *mut Handle, eventpad0: *mut Handle, @@ -12182,87 +12182,87 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Enables the accelerometer."] + #[doc = "Enables the accelerometer."] pub fn HIDUSER_EnableAccelerometer() -> Result; } extern "C" { #[must_use] - #[doc = " Disables the accelerometer."] + #[doc = "Disables the accelerometer."] pub fn HIDUSER_DisableAccelerometer() -> Result; } extern "C" { #[must_use] - #[doc = " Enables the gyroscope."] + #[doc = "Enables the gyroscope."] pub fn HIDUSER_EnableGyroscope() -> Result; } extern "C" { #[must_use] - #[doc = " Disables the gyroscope."] + #[doc = "Disables the gyroscope."] pub fn HIDUSER_DisableGyroscope() -> Result; } extern "C" { #[must_use] - #[doc = " Gets the gyroscope raw to dps coefficient.\n # Arguments\n\n* `coeff` - Pointer to output the coefficient to."] + #[doc = "Gets the gyroscope raw to dps coefficient.\n # Arguments\n\n* `coeff` - Pointer to output the coefficient to."] pub fn HIDUSER_GetGyroscopeRawToDpsCoefficient(coeff: *mut f32) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the current volume slider value. (0-63)\n # Arguments\n\n* `volume` - Pointer to write the volume slider value to."] + #[doc = "Gets the current volume slider value. (0-63)\n # Arguments\n\n* `volume` - Pointer to write the volume slider value to."] pub fn HIDUSER_GetSoundVolume(volume: *mut u8_) -> Result; } extern "C" { - #[doc = " IRRST's shared memory handle."] + #[doc = "IRRST's shared memory handle."] pub static mut irrstMemHandle: Handle; } extern "C" { - #[doc = " IRRST's shared memory."] + #[doc = "IRRST's shared memory."] pub static mut irrstSharedMem: *mut vu32; } extern "C" { - #[doc = " IRRST's state update event"] + #[doc = "IRRST's state update event"] pub static mut irrstEvent: Handle; } extern "C" { #[must_use] - #[doc = " Initializes IRRST."] + #[doc = "Initializes IRRST."] pub fn irrstInit() -> Result; } extern "C" { - #[doc = " Exits IRRST."] + #[doc = "Exits IRRST."] pub fn irrstExit(); } extern "C" { - #[doc = " Scans IRRST for input."] + #[doc = "Scans IRRST for input."] pub fn irrstScanInput(); } extern "C" { - #[doc = " Gets IRRST's held keys.\n # Returns\n\nIRRST's held keys."] + #[doc = "Gets IRRST's held keys.\n # Returns\n\nIRRST's held keys."] pub fn irrstKeysHeld() -> u32_; } extern "C" { - #[doc = " Reads the current c-stick position.\n # Arguments\n\n* `pos` - Pointer to output the current c-stick position to."] + #[doc = "Reads the current c-stick position.\n # Arguments\n\n* `pos` - Pointer to output the current c-stick position to."] pub fn irrstCstickRead(pos: *mut circlePosition); } extern "C" { - #[doc = " Waits for the IRRST input event to trigger.\n # Arguments\n\n* `nextEvent` - Whether to discard the current event and wait until the next event."] + #[doc = "Waits for the IRRST input event to trigger.\n # Arguments\n\n* `nextEvent` - Whether to discard the current event and wait until the next event."] pub fn irrstWaitForEvent(nextEvent: bool); } extern "C" { #[must_use] - #[doc = " Gets the shared memory and event handles for IRRST.\n # Arguments\n\n* `outMemHandle` - Pointer to write the shared memory handle to.\n * `outEventHandle` - Pointer to write the event handle to."] + #[doc = "Gets the shared memory and event handles for IRRST.\n # Arguments\n\n* `outMemHandle` - Pointer to write the shared memory handle to.\n * `outEventHandle` - Pointer to write the event handle to."] pub fn IRRST_GetHandles(outMemHandle: *mut Handle, outEventHandle: *mut Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Initializes IRRST.\n # Arguments\n\n* `unk1` - Unknown.\n * `unk2` - Unknown."] + #[doc = "Initializes IRRST.\n # Arguments\n\n* `unk1` - Unknown.\n * `unk2` - Unknown."] pub fn IRRST_Initialize(unk1: u32_, unk2: u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Shuts down IRRST."] + #[doc = "Shuts down IRRST."] pub fn IRRST_Shutdown() -> Result; } -#[doc = " sslc context."] +#[doc = "sslc context."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct sslcContext { @@ -12289,30 +12289,30 @@ pub type SSLC_DefaultClientCert = ::libc::c_uint; pub const SSLCOPT_Default: _bindgen_ty_23 = 0; pub const SSLCOPT_DisableVerify: _bindgen_ty_23 = 512; pub const SSLCOPT_TLSv10: _bindgen_ty_23 = 2048; -#[doc = " sslc options. https://www.3dbrew.org/wiki/SSL_Services#SSLOpt"] +#[doc = "sslc options. https://www.3dbrew.org/wiki/SSL_Services#SSLOpt"] pub type _bindgen_ty_23 = ::libc::c_uint; extern "C" { #[must_use] - #[doc = " Initializes SSLC. Normally session_handle should be 0. When non-zero this will use the specified handle for the main-service-session without using the Initialize command, instead of using srvGetServiceHandle."] + #[doc = "Initializes SSLC. Normally session_handle should be 0. When non-zero this will use the specified handle for the main-service-session without using the Initialize command, instead of using srvGetServiceHandle."] pub fn sslcInit(session_handle: Handle) -> Result; } extern "C" { - #[doc = " Exits SSLC."] + #[doc = "Exits SSLC."] pub fn sslcExit(); } extern "C" { #[must_use] - #[doc = " Creates a RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - Output contexthandle."] + #[doc = "Creates a RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - Output contexthandle."] pub fn sslcCreateRootCertChain(RootCertChain_contexthandle: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Destroys a RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - RootCertChain contexthandle."] + #[doc = "Destroys a RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - RootCertChain contexthandle."] pub fn sslcDestroyRootCertChain(RootCertChain_contexthandle: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Adds a trusted RootCA cert to a RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - RootCertChain to use.\n * `cert` - Pointer to the DER cert.\n * `certsize` - Size of the DER cert."] + #[doc = "Adds a trusted RootCA cert to a RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - RootCertChain to use.\n * `cert` - Pointer to the DER cert.\n * `certsize` - Size of the DER cert."] pub fn sslcAddTrustedRootCA( RootCertChain_contexthandle: u32_, cert: *const u8_, @@ -12322,7 +12322,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Adds a default RootCA cert to a RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - RootCertChain to use.\n * `certID` - ID of the cert to add.\n * `cert_contexthandle` - Optional, the cert contexthandle can be written here."] + #[doc = "Adds a default RootCA cert to a RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - RootCertChain to use.\n * `certID` - ID of the cert to add.\n * `cert_contexthandle` - Optional, the cert contexthandle can be written here."] pub fn sslcRootCertChainAddDefaultCert( RootCertChain_contexthandle: u32_, certID: SSLC_DefaultRootCert, @@ -12331,7 +12331,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Removes the specified cert from the RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - RootCertChain to use.\n * `cert_contexthandle` - Cert contexthandle to remove from the RootCertChain."] + #[doc = "Removes the specified cert from the RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - RootCertChain to use.\n * `cert_contexthandle` - Cert contexthandle to remove from the RootCertChain."] pub fn sslcRootCertChainRemoveCert( RootCertChain_contexthandle: u32_, cert_contexthandle: u32_, @@ -12339,17 +12339,17 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Creates an unknown CertChain.\n # Arguments\n\n* `CertChain_contexthandle` - Output contexthandle."] + #[doc = "Creates an unknown CertChain.\n # Arguments\n\n* `CertChain_contexthandle` - Output contexthandle."] pub fn sslcCreate8CertChain(CertChain_contexthandle: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Destroys a CertChain from sslcCreate8CertChain().\n # Arguments\n\n* `CertChain_contexthandle` - CertChain contexthandle."] + #[doc = "Destroys a CertChain from sslcCreate8CertChain().\n # Arguments\n\n* `CertChain_contexthandle` - CertChain contexthandle."] pub fn sslcDestroy8CertChain(CertChain_contexthandle: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Adds a cert to a CertChain from sslcCreate8CertChain().\n # Arguments\n\n* `CertChain_contexthandle` - CertChain to use.\n * `cert` - Pointer to the cert.\n * `certsize` - Size of the cert."] + #[doc = "Adds a cert to a CertChain from sslcCreate8CertChain().\n # Arguments\n\n* `CertChain_contexthandle` - CertChain to use.\n * `cert` - Pointer to the cert.\n * `certsize` - Size of the cert."] pub fn sslc8CertChainAddCert( CertChain_contexthandle: u32_, cert: *const u8_, @@ -12359,7 +12359,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Adds a default cert to a CertChain from sslcCreate8CertChain(). Not actually usable since no certIDs are implemented in SSL-module for this.\n # Arguments\n\n* `CertChain_contexthandle` - CertChain to use.\n * `certID` - ID of the cert to add.\n * `cert_contexthandle` - Optional, the cert contexthandle can be written here."] + #[doc = "Adds a default cert to a CertChain from sslcCreate8CertChain(). Not actually usable since no certIDs are implemented in SSL-module for this.\n # Arguments\n\n* `CertChain_contexthandle` - CertChain to use.\n * `certID` - ID of the cert to add.\n * `cert_contexthandle` - Optional, the cert contexthandle can be written here."] pub fn sslc8CertChainAddDefaultCert( CertChain_contexthandle: u32_, certID: u8_, @@ -12368,7 +12368,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Removes the specified cert from the CertChain from sslcCreate8CertChain().\n # Arguments\n\n* `CertChain_contexthandle` - CertChain to use.\n * `cert_contexthandle` - Cert contexthandle to remove from the CertChain."] + #[doc = "Removes the specified cert from the CertChain from sslcCreate8CertChain().\n # Arguments\n\n* `CertChain_contexthandle` - CertChain to use.\n * `cert_contexthandle` - Cert contexthandle to remove from the CertChain."] pub fn sslc8CertChainRemoveCert( CertChain_contexthandle: u32_, cert_contexthandle: u32_, @@ -12376,7 +12376,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Opens a new ClientCert-context.\n # Arguments\n\n* `cert` - Pointer to the DER cert.\n * `certsize` - Size of the DER cert.\n * `key` - Pointer to the DER key.\n * `keysize` - Size of the DER key.\n * `ClientCert_contexthandle` - Output contexthandle."] + #[doc = "Opens a new ClientCert-context.\n # Arguments\n\n* `cert` - Pointer to the DER cert.\n * `certsize` - Size of the DER cert.\n * `key` - Pointer to the DER key.\n * `keysize` - Size of the DER key.\n * `ClientCert_contexthandle` - Output contexthandle."] pub fn sslcOpenClientCertContext( cert: *const u8_, certsize: u32_, @@ -12387,7 +12387,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Opens a ClientCert-context with a default certID.\n # Arguments\n\n* `certID` - ID of the ClientCert to use.\n * `ClientCert_contexthandle` - Output contexthandle."] + #[doc = "Opens a ClientCert-context with a default certID.\n # Arguments\n\n* `certID` - ID of the ClientCert to use.\n * `ClientCert_contexthandle` - Output contexthandle."] pub fn sslcOpenDefaultClientCertContext( certID: SSLC_DefaultClientCert, ClientCert_contexthandle: *mut u32_, @@ -12395,22 +12395,22 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Closes the specified ClientCert-context.\n # Arguments\n\n* `ClientCert_contexthandle` - ClientCert-context to use."] + #[doc = "Closes the specified ClientCert-context.\n # Arguments\n\n* `ClientCert_contexthandle` - ClientCert-context to use."] pub fn sslcCloseClientCertContext(ClientCert_contexthandle: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " This uses ps:ps SeedRNG internally."] + #[doc = "This uses ps:ps SeedRNG internally."] pub fn sslcSeedRNG() -> Result; } extern "C" { #[must_use] - #[doc = " This uses ps:ps GenerateRandomData internally.\n # Arguments\n\n* `buf` - Output buffer.\n * `size` - Output size."] + #[doc = "This uses ps:ps GenerateRandomData internally.\n # Arguments\n\n* `buf` - Output buffer.\n * `size` - Output size."] pub fn sslcGenerateRandomData(buf: *mut u8_, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Creates a sslc context.\n # Arguments\n\n* `context` - sslc context.\n * `sockfd` - Socket fd, this code automatically uses the required SOC command before using the actual sslc command.\n * `input_opt` - Input sslc options bitmask.\n * `hostname` - Server hostname."] + #[doc = "Creates a sslc context.\n # Arguments\n\n* `context` - sslc context.\n * `sockfd` - Socket fd, this code automatically uses the required SOC command before using the actual sslc command.\n * `input_opt` - Input sslc options bitmask.\n * `hostname` - Server hostname."] pub fn sslcCreateContext( context: *mut sslcContext, sockfd: ::libc::c_int, @@ -12482,7 +12482,7 @@ extern "C" { #[must_use] pub fn sslcAddCert(context: *mut sslcContext, buf: *const u8_, size: u32_) -> Result; } -#[doc = " HTTP context."] +#[doc = "HTTP context."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct httpcContext { @@ -12496,30 +12496,30 @@ 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; -#[doc = " HTTP request method."] +#[doc = "HTTP request method."] pub type HTTPC_RequestMethod = ::libc::c_uint; #[doc = "< Request in progress."] pub const HTTPC_STATUS_REQUEST_IN_PROGRESS: HTTPC_RequestStatus = 5; #[doc = "< Download ready."] pub const HTTPC_STATUS_DOWNLOAD_READY: HTTPC_RequestStatus = 7; -#[doc = " HTTP request status."] +#[doc = "HTTP request status."] pub type HTTPC_RequestStatus = ::libc::c_uint; pub const HTTPC_KEEPALIVE_DISABLED: HTTPC_KeepAlive = 0; pub const HTTPC_KEEPALIVE_ENABLED: HTTPC_KeepAlive = 1; -#[doc = " HTTP KeepAlive option."] +#[doc = "HTTP KeepAlive option."] pub type HTTPC_KeepAlive = ::libc::c_uint; extern "C" { #[must_use] - #[doc = " Initializes HTTPC. For HTTP GET the sharedmem_size can be zero. The sharedmem contains data which will be later uploaded for HTTP POST. sharedmem_size should be aligned to 0x1000-bytes."] + #[doc = "Initializes HTTPC. For HTTP GET the sharedmem_size can be zero. The sharedmem contains data which will be later uploaded for HTTP POST. sharedmem_size should be aligned to 0x1000-bytes."] pub fn httpcInit(sharedmem_size: u32_) -> Result; } extern "C" { - #[doc = " Exits HTTPC."] + #[doc = "Exits HTTPC."] pub fn httpcExit(); } extern "C" { #[must_use] - #[doc = " Opens a HTTP context.\n # Arguments\n\n* `context` - Context to open.\n * `url` - URL to connect to.\n * `use_defaultproxy` - Whether the default proxy should be used (0 for default)"] + #[doc = "Opens a HTTP context.\n # Arguments\n\n* `context` - Context to open.\n * `url` - URL to connect to.\n * `use_defaultproxy` - Whether the default proxy should be used (0 for default)"] pub fn httpcOpenContext( context: *mut httpcContext, method: HTTPC_RequestMethod, @@ -12529,17 +12529,17 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Closes a HTTP context.\n # Arguments\n\n* `context` - Context to close."] + #[doc = "Closes a HTTP context.\n # Arguments\n\n* `context` - Context to close."] pub fn httpcCloseContext(context: *mut httpcContext) -> Result; } extern "C" { #[must_use] - #[doc = " Cancels a HTTP connection.\n # Arguments\n\n* `context` - Context to close."] + #[doc = "Cancels a HTTP connection.\n # Arguments\n\n* `context` - Context to close."] pub fn httpcCancelConnection(context: *mut httpcContext) -> Result; } extern "C" { #[must_use] - #[doc = " Adds a request header field to a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `name` - Name of the field.\n * `value` - Value of the field."] + #[doc = "Adds a request header field to a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `name` - Name of the field.\n * `value` - Value of the field."] pub fn httpcAddRequestHeaderField( context: *mut httpcContext, name: *const ::libc::c_char, @@ -12548,7 +12548,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Adds a POST form field to a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `name` - Name of the field.\n * `value` - Value of the field."] + #[doc = "Adds a POST form field to a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `name` - Name of the field.\n * `value` - Value of the field."] pub fn httpcAddPostDataAscii( context: *mut httpcContext, name: *const ::libc::c_char, @@ -12557,7 +12557,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Adds a POST form field with binary data to a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `name` - Name of the field.\n * `value` - The binary data to pass as a value.\n * `len` - Length of the binary data which has been passed."] + #[doc = "Adds a POST form field with binary data to a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `name` - Name of the field.\n * `value` - The binary data to pass as a value.\n * `len` - Length of the binary data which has been passed."] pub fn httpcAddPostDataBinary( context: *mut httpcContext, name: *const ::libc::c_char, @@ -12567,22 +12567,22 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Adds a POST body to a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `data` - The data to be passed as raw into the body of the post request.\n * `len` - Length of data passed by data param."] + #[doc = "Adds a POST body to a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `data` - The data to be passed as raw into the body of the post request.\n * `len` - Length of data passed by data param."] pub fn httpcAddPostDataRaw(context: *mut httpcContext, data: *const u32_, len: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Begins a HTTP request.\n # Arguments\n\n* `context` - Context to use."] + #[doc = "Begins a HTTP request.\n # Arguments\n\n* `context` - Context to use."] pub fn httpcBeginRequest(context: *mut httpcContext) -> Result; } extern "C" { #[must_use] - #[doc = " Receives data from a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `buffer` - Buffer to receive data to.\n * `size` - Size of the buffer."] + #[doc = "Receives data from a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `buffer` - Buffer to receive data to.\n * `size` - Size of the buffer."] pub fn httpcReceiveData(context: *mut httpcContext, buffer: *mut u8_, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Receives data from a HTTP context with a timeout value.\n # Arguments\n\n* `context` - Context to use.\n * `buffer` - Buffer to receive data to.\n * `size` - Size of the buffer.\n * `timeout` - Maximum time in nanoseconds to wait for a reply."] + #[doc = "Receives data from a HTTP context with a timeout value.\n # Arguments\n\n* `context` - Context to use.\n * `buffer` - Buffer to receive data to.\n * `size` - Size of the buffer.\n * `timeout` - Maximum time in nanoseconds to wait for a reply."] pub fn httpcReceiveDataTimeout( context: *mut httpcContext, buffer: *mut u8_, @@ -12592,7 +12592,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets the request state of a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `out` - Pointer to output the HTTP request state to."] + #[doc = "Gets the request state of a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `out` - Pointer to output the HTTP request state to."] pub fn httpcGetRequestState( context: *mut httpcContext, out: *mut HTTPC_RequestStatus, @@ -12600,7 +12600,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets the download size state of a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `downloadedsize` - Pointer to output the downloaded size to.\n * `contentsize` - Pointer to output the total content size to."] + #[doc = "Gets the download size state of a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `downloadedsize` - Pointer to output the downloaded size to.\n * `contentsize` - Pointer to output the total content size to."] pub fn httpcGetDownloadSizeState( context: *mut httpcContext, downloadedsize: *mut u32_, @@ -12609,12 +12609,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets the response code of the HTTP context.\n # Arguments\n\n* `context` - Context to get the response code of.\n * `out` - Pointer to write the response code to."] + #[doc = "Gets the response code of the HTTP context.\n # Arguments\n\n* `context` - Context to get the response code of.\n * `out` - Pointer to write the response code to."] pub fn httpcGetResponseStatusCode(context: *mut httpcContext, out: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the response code of the HTTP context with a timeout value.\n # Arguments\n\n* `context` - Context to get the response code of.\n * `out` - Pointer to write the response code to.\n * `timeout` - Maximum time in nanoseconds to wait for a reply."] + #[doc = "Gets the response code of the HTTP context with a timeout value.\n # Arguments\n\n* `context` - Context to get the response code of.\n * `out` - Pointer to write the response code to.\n * `timeout` - Maximum time in nanoseconds to wait for a reply."] pub fn httpcGetResponseStatusCodeTimeout( context: *mut httpcContext, out: *mut u32_, @@ -12623,7 +12623,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets a response header field from a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `name` - Name of the field.\n * `value` - Pointer to output the value of the field to.\n * `valuebuf_maxsize` - Maximum size of the value buffer."] + #[doc = "Gets a response header field from a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `name` - Name of the field.\n * `value` - Pointer to output the value of the field to.\n * `valuebuf_maxsize` - Maximum size of the value buffer."] pub fn httpcGetResponseHeader( context: *mut httpcContext, name: *const ::libc::c_char, @@ -12633,7 +12633,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Adds a trusted RootCA cert to a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `cert` - Pointer to DER cert.\n * `certsize` - Size of the DER cert."] + #[doc = "Adds a trusted RootCA cert to a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `cert` - Pointer to DER cert.\n * `certsize` - Size of the DER cert."] pub fn httpcAddTrustedRootCA( context: *mut httpcContext, cert: *const u8_, @@ -12642,12 +12642,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Adds a default RootCA cert to a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `certID` - ID of the cert to add, see sslc.h."] + #[doc = "Adds a default RootCA cert to a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `certID` - ID of the cert to add, see sslc.h."] pub fn httpcAddDefaultCert(context: *mut httpcContext, certID: SSLC_DefaultRootCert) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the RootCertChain for a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `RootCertChain_contexthandle` - Contexthandle for the RootCertChain."] + #[doc = "Sets the RootCertChain for a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `RootCertChain_contexthandle` - Contexthandle for the RootCertChain."] pub fn httpcSelectRootCertChain( context: *mut httpcContext, RootCertChain_contexthandle: u32_, @@ -12655,7 +12655,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Sets the ClientCert for a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `cert` - Pointer to DER cert.\n * `certsize` - Size of the DER cert.\n * `privk` - Pointer to the DER private key.\n * `privk_size` - Size of the privk."] + #[doc = "Sets the ClientCert for a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `cert` - Pointer to DER cert.\n * `certsize` - Size of the DER cert.\n * `privk` - Pointer to the DER private key.\n * `privk_size` - Size of the privk."] pub fn httpcSetClientCert( context: *mut httpcContext, cert: *const u8_, @@ -12666,7 +12666,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Sets the default clientcert for a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `certID` - ID of the cert to add, see sslc.h."] + #[doc = "Sets the default clientcert for a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `certID` - ID of the cert to add, see sslc.h."] pub fn httpcSetClientCertDefault( context: *mut httpcContext, certID: SSLC_DefaultClientCert, @@ -12674,7 +12674,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Sets the ClientCert contexthandle for a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `ClientCert_contexthandle` - Contexthandle for the ClientCert."] + #[doc = "Sets the ClientCert contexthandle for a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `ClientCert_contexthandle` - Contexthandle for the ClientCert."] pub fn httpcSetClientCertContext( context: *mut httpcContext, ClientCert_contexthandle: u32_, @@ -12682,27 +12682,27 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Sets SSL options for the context.\n The HTTPC SSL option bits are the same as those defined in sslc.h\n # Arguments\n\n* `context` - Context to set flags on.\n * `options` - SSL option flags."] + #[doc = "Sets SSL options for the context.\n The HTTPC SSL option bits are the same as those defined in sslc.h\n # Arguments\n\n* `context` - Context to set flags on.\n * `options` - SSL option flags."] pub fn httpcSetSSLOpt(context: *mut httpcContext, options: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the SSL options which will be cleared for the context.\n The HTTPC SSL option bits are the same as those defined in sslc.h\n # Arguments\n\n* `context` - Context to clear flags on.\n * `options` - SSL option flags."] + #[doc = "Sets the SSL options which will be cleared for the context.\n The HTTPC SSL option bits are the same as those defined in sslc.h\n # Arguments\n\n* `context` - Context to clear flags on.\n * `options` - SSL option flags."] pub fn httpcSetSSLClearOpt(context: *mut httpcContext, options: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Creates a RootCertChain. Up to 2 RootCertChains can be created under this user-process.\n # Arguments\n\n* `RootCertChain_contexthandle` - Output RootCertChain contexthandle."] + #[doc = "Creates a RootCertChain. Up to 2 RootCertChains can be created under this user-process.\n # Arguments\n\n* `RootCertChain_contexthandle` - Output RootCertChain contexthandle."] pub fn httpcCreateRootCertChain(RootCertChain_contexthandle: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Destroy a RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - RootCertChain to use."] + #[doc = "Destroy a RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - RootCertChain to use."] pub fn httpcDestroyRootCertChain(RootCertChain_contexthandle: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Adds a RootCA cert to a RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - RootCertChain to use.\n * `cert` - Pointer to DER cert.\n * `certsize` - Size of the DER cert.\n * `cert_contexthandle` - Optional output ptr for the cert contexthandle(this can be NULL)."] + #[doc = "Adds a RootCA cert to a RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - RootCertChain to use.\n * `cert` - Pointer to DER cert.\n * `certsize` - Size of the DER cert.\n * `cert_contexthandle` - Optional output ptr for the cert contexthandle(this can be NULL)."] pub fn httpcRootCertChainAddCert( RootCertChain_contexthandle: u32_, cert: *const u8_, @@ -12712,7 +12712,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Adds a default RootCA cert to a RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - RootCertChain to use.\n * `certID` - ID of the cert to add, see sslc.h.\n * `cert_contexthandle` - Optional output ptr for the cert contexthandle(this can be NULL)."] + #[doc = "Adds a default RootCA cert to a RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - RootCertChain to use.\n * `certID` - ID of the cert to add, see sslc.h.\n * `cert_contexthandle` - Optional output ptr for the cert contexthandle(this can be NULL)."] pub fn httpcRootCertChainAddDefaultCert( RootCertChain_contexthandle: u32_, certID: SSLC_DefaultRootCert, @@ -12721,7 +12721,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Removes a cert from a RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - RootCertChain to use.\n * `cert_contexthandle` - Contexthandle of the cert to remove."] + #[doc = "Removes a cert from a RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - RootCertChain to use.\n * `cert_contexthandle` - Contexthandle of the cert to remove."] pub fn httpcRootCertChainRemoveCert( RootCertChain_contexthandle: u32_, cert_contexthandle: u32_, @@ -12729,7 +12729,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Opens a ClientCert-context. Up to 2 ClientCert-contexts can be open under this user-process.\n # Arguments\n\n* `cert` - Pointer to DER cert.\n * `certsize` - Size of the DER cert.\n * `privk` - Pointer to the DER private key.\n * `privk_size` - Size of the privk.\n * `ClientCert_contexthandle` - Output ClientCert context handle."] + #[doc = "Opens a ClientCert-context. Up to 2 ClientCert-contexts can be open under this user-process.\n # Arguments\n\n* `cert` - Pointer to DER cert.\n * `certsize` - Size of the DER cert.\n * `privk` - Pointer to the DER private key.\n * `privk_size` - Size of the privk.\n * `ClientCert_contexthandle` - Output ClientCert context handle."] pub fn httpcOpenClientCertContext( cert: *const u8_, certsize: u32_, @@ -12740,7 +12740,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Opens a ClientCert-context with a default clientclient. Up to 2 ClientCert-contexts can be open under this user-process.\n # Arguments\n\n* `certID` - ID of the cert to add, see sslc.h.\n * `ClientCert_contexthandle` - Output ClientCert context handle."] + #[doc = "Opens a ClientCert-context with a default clientclient. Up to 2 ClientCert-contexts can be open under this user-process.\n # Arguments\n\n* `certID` - ID of the cert to add, see sslc.h.\n * `ClientCert_contexthandle` - Output ClientCert context handle."] pub fn httpcOpenDefaultClientCertContext( certID: SSLC_DefaultClientCert, ClientCert_contexthandle: *mut u32_, @@ -12748,12 +12748,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Closes a ClientCert context.\n # Arguments\n\n* `ClientCert_contexthandle` - ClientCert context to use."] + #[doc = "Closes a ClientCert context.\n # Arguments\n\n* `ClientCert_contexthandle` - ClientCert context to use."] pub fn httpcCloseClientCertContext(ClientCert_contexthandle: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Downloads data from the HTTP context into a buffer.\n The *entire* content must be downloaded before using httpcCloseContext(), otherwise httpcCloseContext() will hang.\n # Arguments\n\n* `context` - Context to download data from.\n * `buffer` - Buffer to write data to.\n * `size` - Size of the buffer.\n * `downloadedsize` - Pointer to write the size of the downloaded data to."] + #[doc = "Downloads data from the HTTP context into a buffer.\n The *entire* content must be downloaded before using httpcCloseContext(), otherwise httpcCloseContext() will hang.\n # Arguments\n\n* `context` - Context to download data from.\n * `buffer` - Buffer to write data to.\n * `size` - Size of the buffer.\n * `downloadedsize` - Pointer to write the size of the downloaded data to."] pub fn httpcDownloadData( context: *mut httpcContext, buffer: *mut u8_, @@ -12763,10 +12763,10 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Sets Keep-Alive for the context.\n # Arguments\n\n* `context` - Context to set the KeepAlive flag on.\n * `option` - HTTPC_KeepAlive option."] + #[doc = "Sets Keep-Alive for the context.\n # Arguments\n\n* `context` - Context to set the KeepAlive flag on.\n * `option` - HTTPC_KeepAlive option."] pub fn httpcSetKeepAlive(context: *mut httpcContext, option: HTTPC_KeepAlive) -> Result; } -#[doc = " Node info struct."] +#[doc = "Node info struct."] #[repr(C)] #[derive(Copy, Clone)] pub struct udsNodeInfo { @@ -12808,7 +12808,7 @@ impl Default for udsNodeInfo { } } } -#[doc = " Connection status struct."] +#[doc = "Connection status struct."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct udsConnectionStatus { @@ -12821,7 +12821,7 @@ pub struct udsConnectionStatus { pub max_nodes: u8_, pub node_bitmask: u16_, } -#[doc = " Network struct stored as big-endian."] +#[doc = "Network struct stored as big-endian."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct udsNetworkStruct { @@ -12861,7 +12861,7 @@ pub struct udsBindContext { pub event: Handle, pub spectator: bool, } -#[doc = " General NWM input structure used for AP scanning."] +#[doc = "General NWM input structure used for AP scanning."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct nwmScanInputStruct { @@ -12881,7 +12881,7 @@ impl Default for nwmScanInputStruct { } } } -#[doc = " General NWM output structure from AP scanning."] +#[doc = "General NWM output structure from AP scanning."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct nwmBeaconDataReplyHeader { @@ -12889,7 +12889,7 @@ pub struct nwmBeaconDataReplyHeader { pub size: u32_, pub total_entries: u32_, } -#[doc = " General NWM output structure from AP scanning, for each entry."] +#[doc = "General NWM output structure from AP scanning, for each entry."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct nwmBeaconDataReplyEntry { @@ -12903,7 +12903,7 @@ pub struct nwmBeaconDataReplyEntry { pub unk_x14: u32_, pub val_x1c: u32_, } -#[doc = " Output structure generated from host scanning output."] +#[doc = "Output structure generated from host scanning output."] #[repr(C)] #[derive(Copy, Clone)] pub struct udsNetworkScanInfo { @@ -12933,16 +12933,16 @@ pub const UDSCONTYPE_Spectator: udsConnectionType = 2; pub type udsConnectionType = ::libc::c_uint; extern "C" { #[must_use] - #[doc = " Initializes UDS.\n # Arguments\n\n* `sharedmem_size` - This must be 0x1000-byte aligned.\n * `username` - Optional custom UTF-8 username(converted to UTF-16 internally) that other nodes on the UDS network can use. If not set the username from system-config is used. Max len is 10 characters without NUL-terminator."] + #[doc = "Initializes UDS.\n # Arguments\n\n* `sharedmem_size` - This must be 0x1000-byte aligned.\n * `username` - Optional custom UTF-8 username(converted to UTF-16 internally) that other nodes on the UDS network can use. If not set the username from system-config is used. Max len is 10 characters without NUL-terminator."] pub fn udsInit(sharedmem_size: usize, username: *const ::libc::c_char) -> Result; } extern "C" { - #[doc = " Exits UDS."] + #[doc = "Exits UDS."] pub fn udsExit(); } extern "C" { #[must_use] - #[doc = " Generates a NodeInfo struct with data loaded from system-config.\n # Arguments\n\n* `nodeinfo` - Output NodeInfo struct.\n * `username` - If set, this is the UTF-8 string to convert for use in the struct. Max len is 10 characters without NUL-terminator."] + #[doc = "Generates a NodeInfo struct with data loaded from system-config.\n # Arguments\n\n* `nodeinfo` - Output NodeInfo struct.\n * `username` - If set, this is the UTF-8 string to convert for use in the struct. Max len is 10 characters without NUL-terminator."] pub fn udsGenerateNodeInfo( nodeinfo: *mut udsNodeInfo, username: *const ::libc::c_char, @@ -12950,18 +12950,18 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Loads the UTF-16 username stored in the input NodeInfo struct, converted to UTF-8.\n # Arguments\n\n* `nodeinfo` - Input NodeInfo struct.\n * `username` - This is the output UTF-8 string. Max len is 10 characters without NUL-terminator."] + #[doc = "Loads the UTF-16 username stored in the input NodeInfo struct, converted to UTF-8.\n # Arguments\n\n* `nodeinfo` - Input NodeInfo struct.\n * `username` - This is the output UTF-8 string. Max len is 10 characters without NUL-terminator."] pub fn udsGetNodeInfoUsername( nodeinfo: *const udsNodeInfo, username: *mut ::libc::c_char, ) -> Result; } extern "C" { - #[doc = " Checks whether a NodeInfo struct was initialized by NWM-module(not any output from udsGenerateNodeInfo()).\n # Arguments\n\n* `nodeinfo` - Input NodeInfo struct."] + #[doc = "Checks whether a NodeInfo struct was initialized by NWM-module(not any output from udsGenerateNodeInfo()).\n # Arguments\n\n* `nodeinfo` - Input NodeInfo struct."] pub fn udsCheckNodeInfoInitialized(nodeinfo: *const udsNodeInfo) -> bool; } extern "C" { - #[doc = " Generates a default NetworkStruct for creating networks.\n # Arguments\n\n* `network` - The output struct.\n * `wlancommID` - Unique local-WLAN communications ID for each application.\n * `id8` - Additional ID that can be used by the application for different types of networks.\n * `max_nodes` - Maximum number of nodes(devices) that can be connected to the network, including the host."] + #[doc = "Generates a default NetworkStruct for creating networks.\n # Arguments\n\n* `network` - The output struct.\n * `wlancommID` - Unique local-WLAN communications ID for each application.\n * `id8` - Additional ID that can be used by the application for different types of networks.\n * `max_nodes` - Maximum number of nodes(devices) that can be connected to the network, including the host."] pub fn udsGenerateDefaultNetworkStruct( network: *mut udsNetworkStruct, wlancommID: u32_, @@ -12971,7 +12971,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Scans for networks via beacon-scanning.\n # Arguments\n\n* `outbuf` - Buffer which will be used by the beacon-scanning command and for the data parsing afterwards. Normally there's no need to use the contents of this buffer once this function returns.\n * `maxsize` - Max size of the buffer.\n networks Ptr where the allocated udsNetworkScanInfo array buffer is written. The allocsize is sizeof(udsNetworkScanInfo)*total_networks.\n total_networks Total number of networks stored under the networks buffer.\n * `wlancommID` - Unique local-WLAN communications ID for each application.\n * `id8` - Additional ID that can be used by the application for different types of networks.\n * `host_macaddress` - When set, this code will only return network info from the specified host MAC address.\n When not connected to a network this *must* be false. When connected to a network this *must* be true."] + #[doc = "Scans for networks via beacon-scanning.\n # Arguments\n\n* `outbuf` - Buffer which will be used by the beacon-scanning command and for the data parsing afterwards. Normally there's no need to use the contents of this buffer once this function returns.\n * `maxsize` - Max size of the buffer.\n networks Ptr where the allocated udsNetworkScanInfo array buffer is written. The allocsize is sizeof(udsNetworkScanInfo)*total_networks.\n total_networks Total number of networks stored under the networks buffer.\n * `wlancommID` - Unique local-WLAN communications ID for each application.\n * `id8` - Additional ID that can be used by the application for different types of networks.\n * `host_macaddress` - When set, this code will only return network info from the specified host MAC address.\n When not connected to a network this *must* be false. When connected to a network this *must* be true."] pub fn udsScanBeacons( outbuf: *mut ::libc::c_void, maxsize: usize, @@ -12985,12 +12985,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " This can be used by the host to set the appdata contained in the broadcasted beacons.\n # Arguments\n\n* `buf` - Appdata buffer.\n * `size` - Size of the input appdata."] + #[doc = "This can be used by the host to set the appdata contained in the broadcasted beacons.\n # Arguments\n\n* `buf` - Appdata buffer.\n * `size` - Size of the input appdata."] pub fn udsSetApplicationData(buf: *const ::libc::c_void, size: usize) -> Result; } extern "C" { #[must_use] - #[doc = " This can be used while on a network(host/client) to get the appdata from the current beacon.\n # Arguments\n\n* `buf` - Appdata buffer.\n * `size` - Max size of the output buffer.\n * `actual_size` - If set, the actual size of the appdata written into the buffer is stored here."] + #[doc = "This can be used while on a network(host/client) to get the appdata from the current beacon.\n # Arguments\n\n* `buf` - Appdata buffer.\n * `size` - Max size of the output buffer.\n * `actual_size` - If set, the actual size of the appdata written into the buffer is stored here."] pub fn udsGetApplicationData( buf: *mut ::libc::c_void, size: usize, @@ -12999,7 +12999,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " This can be used with a NetworkStruct, from udsScanBeacons() mainly, for getting the appdata.\n # Arguments\n\n* `buf` - Appdata buffer.\n * `size` - Max size of the output buffer.\n * `actual_size` - If set, the actual size of the appdata written into the buffer is stored here."] + #[doc = "This can be used with a NetworkStruct, from udsScanBeacons() mainly, for getting the appdata.\n # Arguments\n\n* `buf` - Appdata buffer.\n * `size` - Max size of the output buffer.\n * `actual_size` - If set, the actual size of the appdata written into the buffer is stored here."] pub fn udsGetNetworkStructApplicationData( network: *const udsNetworkStruct, buf: *mut ::libc::c_void, @@ -13009,7 +13009,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Create a bind.\n # Arguments\n\n* `bindcontext` - The output bind context.\n * `NetworkNodeID` - This is the NetworkNodeID which this bind can receive data from.\n * `spectator` - False for a regular bind, true for a spectator.\n * `data_channel` - This is an arbitrary value to use for data-frame filtering. This bind will only receive data frames which contain a matching data_channel value, which was specified by udsSendTo(). The data_channel must be non-zero.\n * `recv_buffer_size` - Size of the buffer under sharedmem used for temporarily storing received data-frames which are then loaded by udsPullPacket(). The system requires this to be >=0x5F4. UDS_DEFAULT_RECVBUFSIZE can be used for this."] + #[doc = "Create a bind.\n # Arguments\n\n* `bindcontext` - The output bind context.\n * `NetworkNodeID` - This is the NetworkNodeID which this bind can receive data from.\n * `spectator` - False for a regular bind, true for a spectator.\n * `data_channel` - This is an arbitrary value to use for data-frame filtering. This bind will only receive data frames which contain a matching data_channel value, which was specified by udsSendTo(). The data_channel must be non-zero.\n * `recv_buffer_size` - Size of the buffer under sharedmem used for temporarily storing received data-frames which are then loaded by udsPullPacket(). The system requires this to be >=0x5F4. UDS_DEFAULT_RECVBUFSIZE can be used for this."] pub fn udsBind( bindcontext: *mut udsBindContext, NetworkNodeID: u16_, @@ -13020,11 +13020,11 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Remove a bind.\n # Arguments\n\n* `bindcontext` - The bind context."] + #[doc = "Remove a bind.\n # Arguments\n\n* `bindcontext` - The bind context."] pub fn udsUnbind(bindcontext: *mut udsBindContext) -> Result; } extern "C" { - #[doc = " Waits for the bind event to occur, or checks if the event was signaled. This event is signaled every time new data is available via udsPullPacket().\n # Returns\n\nAlways true. However if wait=false, this will return false if the event wasn't signaled.\n # Arguments\n\n* `bindcontext` - The bind context.\n * `nextEvent` - Whether to discard the current event and wait for the next event.\n * `wait` - When true this will not return until the event is signaled. When false this checks if the event was signaled without waiting for it."] + #[doc = "Waits for the bind event to occur, or checks if the event was signaled. This event is signaled every time new data is available via udsPullPacket().\n # Returns\n\nAlways true. However if wait=false, this will return false if the event wasn't signaled.\n # Arguments\n\n* `bindcontext` - The bind context.\n * `nextEvent` - Whether to discard the current event and wait for the next event.\n * `wait` - When true this will not return until the event is signaled. When false this checks if the event was signaled without waiting for it."] pub fn udsWaitDataAvailable( bindcontext: *const udsBindContext, nextEvent: bool, @@ -13033,7 +13033,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Receives data over the network. This data is loaded from the recv_buffer setup by udsBind(). When a node disconnects, this will still return data from that node until there's no more frames from that node in the recv_buffer.\n # Arguments\n\n* `bindcontext` - Bind context.\n * `buf` - Output receive buffer.\n * `size` - Size of the buffer.\n * `actual_size` - If set, the actual size written into the output buffer is stored here. This is zero when no data was received.\n * `src_NetworkNodeID` - If set, the source NetworkNodeID is written here. This is zero when no data was received."] + #[doc = "Receives data over the network. This data is loaded from the recv_buffer setup by udsBind(). When a node disconnects, this will still return data from that node until there's no more frames from that node in the recv_buffer.\n # Arguments\n\n* `bindcontext` - Bind context.\n * `buf` - Output receive buffer.\n * `size` - Size of the buffer.\n * `actual_size` - If set, the actual size written into the output buffer is stored here. This is zero when no data was received.\n * `src_NetworkNodeID` - If set, the source NetworkNodeID is written here. This is zero when no data was received."] pub fn udsPullPacket( bindcontext: *const udsBindContext, buf: *mut ::libc::c_void, @@ -13044,7 +13044,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Sends data over the network.\n # Arguments\n\n* `dst_NetworkNodeID` - Destination NetworkNodeID.\n * `data_channel` - See udsBind().\n * `flags` - Send flags, see the UDS_SENDFLAG enum values.\n * `buf` - Input send buffer.\n * `size` - Size of the buffer."] + #[doc = "Sends data over the network.\n # Arguments\n\n* `dst_NetworkNodeID` - Destination NetworkNodeID.\n * `data_channel` - See udsBind().\n * `flags` - Send flags, see the UDS_SENDFLAG enum values.\n * `buf` - Input send buffer.\n * `size` - Size of the buffer."] pub fn udsSendTo( dst_NetworkNodeID: u16_, data_channel: u8_, @@ -13055,12 +13055,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets the wifi channel currently being used.\n # Arguments\n\n* `channel` - Output channel."] + #[doc = "Gets the wifi channel currently being used.\n # Arguments\n\n* `channel` - Output channel."] pub fn udsGetChannel(channel: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Starts hosting a new network.\n # Arguments\n\n* `network` - The NetworkStruct, you can use udsGenerateDefaultNetworkStruct() for generating this.\n * `passphrase` - Raw input passphrase buffer.\n * `passphrase_size` - Size of the passphrase buffer.\n * `context` - Optional output bind context which will be created for this host, with NetworkNodeID=UDS_BROADCAST_NETWORKNODEID.\n * `data_channel` - This is the data_channel value which will be passed to udsBind() internally.\n * `recv_buffer_size` - This is the recv_buffer_size value which will be passed to udsBind() internally."] + #[doc = "Starts hosting a new network.\n # Arguments\n\n* `network` - The NetworkStruct, you can use udsGenerateDefaultNetworkStruct() for generating this.\n * `passphrase` - Raw input passphrase buffer.\n * `passphrase_size` - Size of the passphrase buffer.\n * `context` - Optional output bind context which will be created for this host, with NetworkNodeID=UDS_BROADCAST_NETWORKNODEID.\n * `data_channel` - This is the data_channel value which will be passed to udsBind() internally.\n * `recv_buffer_size` - This is the recv_buffer_size value which will be passed to udsBind() internally."] pub fn udsCreateNetwork( network: *const udsNetworkStruct, passphrase: *const ::libc::c_void, @@ -13072,7 +13072,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Connect to a network.\n # Arguments\n\n* `network` - The NetworkStruct, you can use udsScanBeacons() for this.\n * `passphrase` - Raw input passphrase buffer.\n * `passphrase_size` - Size of the passphrase buffer.\n * `context` - Optional output bind context which will be created for this host.\n * `recv_NetworkNodeID` - This is the NetworkNodeID passed to udsBind() internally.\n * `connection_type` - Type of connection, see the udsConnectionType enum values.\n * `data_channel` - This is the data_channel value which will be passed to udsBind() internally.\n * `recv_buffer_size` - This is the recv_buffer_size value which will be passed to udsBind() internally."] + #[doc = "Connect to a network.\n # Arguments\n\n* `network` - The NetworkStruct, you can use udsScanBeacons() for this.\n * `passphrase` - Raw input passphrase buffer.\n * `passphrase_size` - Size of the passphrase buffer.\n * `context` - Optional output bind context which will be created for this host.\n * `recv_NetworkNodeID` - This is the NetworkNodeID passed to udsBind() internally.\n * `connection_type` - Type of connection, see the udsConnectionType enum values.\n * `data_channel` - This is the data_channel value which will be passed to udsBind() internally.\n * `recv_buffer_size` - This is the recv_buffer_size value which will be passed to udsBind() internally."] pub fn udsConnectNetwork( network: *const udsNetworkStruct, passphrase: *const ::libc::c_void, @@ -13086,51 +13086,51 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Stop hosting the network."] + #[doc = "Stop hosting the network."] pub fn udsDestroyNetwork() -> Result; } extern "C" { #[must_use] - #[doc = " Disconnect this client device from the network."] + #[doc = "Disconnect this client device from the network."] pub fn udsDisconnectNetwork() -> Result; } extern "C" { #[must_use] - #[doc = " This can be used by the host to force-disconnect client(s).\n # Arguments\n\n* `NetworkNodeID` - Target NetworkNodeID. UDS_BROADCAST_NETWORKNODEID can be used to disconnect all clients."] + #[doc = "This can be used by the host to force-disconnect client(s).\n # Arguments\n\n* `NetworkNodeID` - Target NetworkNodeID. UDS_BROADCAST_NETWORKNODEID can be used to disconnect all clients."] pub fn udsEjectClient(NetworkNodeID: u16_) -> Result; } extern "C" { #[must_use] - #[doc = " This can be used by the host to force-disconnect the spectators. Afterwards new spectators will not be allowed to connect until udsAllowSpectators() is used."] + #[doc = "This can be used by the host to force-disconnect the spectators. Afterwards new spectators will not be allowed to connect until udsAllowSpectators() is used."] pub fn udsEjectSpectator() -> Result; } extern "C" { #[must_use] - #[doc = " This can be used by the host to update the network attributes. If bitmask 0x4 is clear in the input bitmask, this clears that bit in the value before actually writing the value into state. Normally you should use the below wrapper functions.\n # Arguments\n\n* `bitmask` - Bitmask to clear/set in the attributes. See the UDSNETATTR enum values.\n * `flag` - When false, bit-clear, otherwise bit-set."] + #[doc = "This can be used by the host to update the network attributes. If bitmask 0x4 is clear in the input bitmask, this clears that bit in the value before actually writing the value into state. Normally you should use the below wrapper functions.\n # Arguments\n\n* `bitmask` - Bitmask to clear/set in the attributes. See the UDSNETATTR enum values.\n * `flag` - When false, bit-clear, otherwise bit-set."] pub fn udsUpdateNetworkAttribute(bitmask: u16_, flag: bool) -> Result; } extern "C" { #[must_use] - #[doc = " This uses udsUpdateNetworkAttribute() for (un)blocking new connections to this host.\n # Arguments\n\n* `block` - When true, block the specified connection types(bitmask set). Otherwise allow them(bitmask clear).\n * `clients` - When true, (un)block regular clients.\n * `flag` - When true, update UDSNETATTR_x4. Normally this should be false."] + #[doc = "This uses udsUpdateNetworkAttribute() for (un)blocking new connections to this host.\n # Arguments\n\n* `block` - When true, block the specified connection types(bitmask set). Otherwise allow them(bitmask clear).\n * `clients` - When true, (un)block regular clients.\n * `flag` - When true, update UDSNETATTR_x4. Normally this should be false."] pub fn udsSetNewConnectionsBlocked(block: bool, clients: bool, flag: bool) -> Result; } extern "C" { #[must_use] - #[doc = " This uses udsUpdateNetworkAttribute() for unblocking new spectator connections to this host. See udsEjectSpectator() for blocking new spectators."] + #[doc = "This uses udsUpdateNetworkAttribute() for unblocking new spectator connections to this host. See udsEjectSpectator() for blocking new spectators."] pub fn udsAllowSpectators() -> Result; } extern "C" { #[must_use] - #[doc = " This loads the current ConnectionStatus struct.\n # Arguments\n\n* `output` - Output ConnectionStatus struct."] + #[doc = "This loads the current ConnectionStatus struct.\n # Arguments\n\n* `output` - Output ConnectionStatus struct."] pub fn udsGetConnectionStatus(output: *mut udsConnectionStatus) -> Result; } extern "C" { - #[doc = " Waits for the ConnectionStatus event to occur, or checks if the event was signaled. This event is signaled when the data from udsGetConnectionStatus() was updated internally.\n # Returns\n\nAlways true. However if wait=false, this will return false if the event wasn't signaled.\n # Arguments\n\n* `nextEvent` - Whether to discard the current event and wait for the next event.\n * `wait` - When true this will not return until the event is signaled. When false this checks if the event was signaled without waiting for it."] + #[doc = "Waits for the ConnectionStatus event to occur, or checks if the event was signaled. This event is signaled when the data from udsGetConnectionStatus() was updated internally.\n # Returns\n\nAlways true. However if wait=false, this will return false if the event wasn't signaled.\n # Arguments\n\n* `nextEvent` - Whether to discard the current event and wait for the next event.\n * `wait` - When true this will not return until the event is signaled. When false this checks if the event was signaled without waiting for it."] pub fn udsWaitConnectionStatusEvent(nextEvent: bool, wait: bool) -> bool; } extern "C" { #[must_use] - #[doc = " This loads a NodeInfo struct for the specified NetworkNodeID. The broadcast alias can't be used with this.\n # Arguments\n\n* `NetworkNodeID` - Target NetworkNodeID.\n * `output` - Output NodeInfo struct."] + #[doc = "This loads a NodeInfo struct for the specified NetworkNodeID. The broadcast alias can't be used with this.\n # Arguments\n\n* `NetworkNodeID` - Target NetworkNodeID.\n * `output` - Output NodeInfo struct."] pub fn udsGetNodeInformation(NetworkNodeID: u16_, output: *mut udsNodeInfo) -> Result; } pub const NDM_EXCLUSIVE_STATE_NONE: ndmExclusiveState = 0; @@ -13138,7 +13138,7 @@ pub const NDM_EXCLUSIVE_STATE_INFRASTRUCTURE: ndmExclusiveState = 1; pub const NDM_EXCLUSIVE_STATE_LOCAL_COMMUNICATIONS: ndmExclusiveState = 2; pub const NDM_EXCLUSIVE_STATE_STREETPASS: ndmExclusiveState = 3; pub const NDM_EXCLUSIVE_STATE_STREETPASS_DATA: ndmExclusiveState = 4; -#[doc = " Exclusive states."] +#[doc = "Exclusive states."] pub type ndmExclusiveState = ::libc::c_uint; pub const NDM_STATE_INITIAL: ndmState = 0; pub const NDM_STATE_SUSPENDED: ndmState = 1; @@ -13152,7 +13152,7 @@ pub const NDM_STATE_INFRASTRUCTURE_FORCE_DISCONNECTING: ndmState = 8; pub const NDM_STATE_CEC_WORKING: ndmState = 9; pub const NDM_STATE_CEC_FORCE_SUSPENDING: ndmState = 10; pub const NDM_STATE_CEC_SUSPENDING: ndmState = 11; -#[doc = " Current states."] +#[doc = "Current states."] pub type ndmState = ::libc::c_uint; pub const NDM_DAEMON_CEC: ndmDaemon = 0; pub const NDM_DAEMON_BOSS: ndmDaemon = 1; @@ -13166,7 +13166,7 @@ pub const NDM_DAEMON_MASK_FRIENDS: ndmDaemonMask = 8; pub const NDM_DAEMON_MASK_BACKGROUOND: ndmDaemonMask = 7; pub const NDM_DAEMON_MASK_ALL: ndmDaemonMask = 15; pub const NDM_DAEMON_MASK_DEFAULT: ndmDaemonMask = 9; -#[doc = " Used to specify multiple daemons."] +#[doc = "Used to specify multiple daemons."] pub type ndmDaemonMask = ::libc::c_uint; pub const NDM_DAEMON_STATUS_BUSY: ndmDaemonStatus = 0; pub const NDM_DAEMON_STATUS_IDLE: ndmDaemonStatus = 1; @@ -13175,96 +13175,96 @@ pub const NDM_DAEMON_STATUS_SUSPENDED: ndmDaemonStatus = 3; pub type ndmDaemonStatus = ::libc::c_uint; extern "C" { #[must_use] - #[doc = " Initializes ndmu."] + #[doc = "Initializes ndmu."] pub fn ndmuInit() -> Result; } extern "C" { - #[doc = " Exits ndmu."] + #[doc = "Exits ndmu."] pub fn ndmuExit(); } extern "C" { #[must_use] - #[doc = " Sets the network daemon to an exclusive state.\n # Arguments\n\n* `state` - State specified in the ndmExclusiveState enumerator."] + #[doc = "Sets the network daemon to an exclusive state.\n # Arguments\n\n* `state` - State specified in the ndmExclusiveState enumerator."] pub fn NDMU_EnterExclusiveState(state: ndmExclusiveState) -> Result; } extern "C" { #[must_use] - #[doc = " Cancels an exclusive state for the network daemon."] + #[doc = "Cancels an exclusive state for the network daemon."] pub fn NDMU_LeaveExclusiveState() -> Result; } extern "C" { #[must_use] - #[doc = " Returns the exclusive state for the network daemon.\n # Arguments\n\n* `state` - Pointer to write the exclsuive state to."] + #[doc = "Returns the exclusive state for the network daemon.\n # Arguments\n\n* `state` - Pointer to write the exclsuive state to."] pub fn NDMU_GetExclusiveState(state: *mut ndmExclusiveState) -> Result; } extern "C" { #[must_use] - #[doc = " Locks the exclusive state."] + #[doc = "Locks the exclusive state."] pub fn NDMU_LockState() -> Result; } extern "C" { #[must_use] - #[doc = " Unlocks the exclusive state."] + #[doc = "Unlocks the exclusive state."] pub fn NDMU_UnlockState() -> Result; } extern "C" { #[must_use] - #[doc = " Suspends network daemon.\n # Arguments\n\n* `mask` - The specified daemon."] + #[doc = "Suspends network daemon.\n # Arguments\n\n* `mask` - The specified daemon."] pub fn NDMU_SuspendDaemons(mask: ndmDaemonMask) -> Result; } extern "C" { #[must_use] - #[doc = " Resumes network daemon.\n # Arguments\n\n* `mask` - The specified daemon."] + #[doc = "Resumes network daemon.\n # Arguments\n\n* `mask` - The specified daemon."] pub fn NDMU_ResumeDaemons(mask: ndmDaemonMask) -> Result; } extern "C" { #[must_use] - #[doc = " Suspends scheduling for all network daemons.\n # Arguments\n\n* `flag` - 0 = Wait for completion, 1 = Perform in background."] + #[doc = "Suspends scheduling for all network daemons.\n # Arguments\n\n* `flag` - 0 = Wait for completion, 1 = Perform in background."] pub fn NDMU_SuspendScheduler(flag: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Resumes daemon scheduling."] + #[doc = "Resumes daemon scheduling."] pub fn NDMU_ResumeScheduler() -> Result; } extern "C" { #[must_use] - #[doc = " Returns the current state for the network daemon.\n # Arguments\n\n* `state` - Pointer to write the current state to."] + #[doc = "Returns the current state for the network daemon.\n # Arguments\n\n* `state` - Pointer to write the current state to."] pub fn NDMU_GetCurrentState(state: *mut ndmState) -> Result; } extern "C" { #[must_use] - #[doc = " Returns the daemon state.\n # Arguments\n\n* `state` - Pointer to write the daemons state to."] + #[doc = "Returns the daemon state.\n # Arguments\n\n* `state` - Pointer to write the daemons state to."] pub fn NDMU_QueryStatus(status: *mut ndmDaemonStatus) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the scan interval.\n # Arguments\n\n* `interval` - Value to set the scan interval to."] + #[doc = "Sets the scan interval.\n # Arguments\n\n* `interval` - Value to set the scan interval to."] pub fn NDMU_SetScanInterval(interval: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Returns the scan interval.\n # Arguments\n\n* `interval` - Pointer to write the interval value to."] + #[doc = "Returns the scan interval.\n # Arguments\n\n* `interval` - Pointer to write the interval value to."] pub fn NDMU_GetScanInterval(interval: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Returns the retry interval.\n # Arguments\n\n* `interval` - Pointer to write the interval value to."] + #[doc = "Returns the retry interval.\n # Arguments\n\n* `interval` - Pointer to write the interval value to."] pub fn NDMU_GetRetryInterval(interval: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Reverts network daemon to defaults."] + #[doc = "Reverts network daemon to defaults."] pub fn NDMU_ResetDaemons() -> Result; } extern "C" { #[must_use] - #[doc = " Gets the current default daemon bit mask.\n # Arguments\n\n* `interval` - Pointer to write the default daemon mask value to. The default value is (DAEMONMASK_CEC | DAEMONMASK_FRIENDS)"] + #[doc = "Gets the current default daemon bit mask.\n # Arguments\n\n* `interval` - Pointer to write the default daemon mask value to. The default value is (DAEMONMASK_CEC | DAEMONMASK_FRIENDS)"] pub fn NDMU_GetDefaultDaemons(mask: *mut ndmDaemonMask) -> Result; } extern "C" { #[must_use] - #[doc = " Clears half awake mac filter."] + #[doc = "Clears half awake mac filter."] pub fn NDMU_ClearMacFilter() -> Result; } #[doc = "< Initial installation"] @@ -13275,7 +13275,7 @@ pub const IM_UNKNOWN1: NIM_InstallationMode = 1; pub const IM_UNKNOWN2: NIM_InstallationMode = 2; #[doc = "< Reinstall currently installed title; use this if the title is already installed (including updates)"] pub const IM_REINSTALL: NIM_InstallationMode = 3; -#[doc = " Mode that NIM downloads/installs a title with."] +#[doc = "Mode that NIM downloads/installs a title with."] pub type NIM_InstallationMode = ::libc::c_uint; #[doc = "< Download not yet initialized"] pub const DS_NOT_INITIALIZED: NIM_DownloadState = 0; @@ -13301,9 +13301,9 @@ pub const DS_CREATE_CONTEXT: NIM_DownloadState = 9; pub const DS_CANNOT_RECOVER: NIM_DownloadState = 10; #[doc = "< Invalid state"] pub const DS_INVALID: NIM_DownloadState = 11; -#[doc = " Current state of a NIM download/installation."] +#[doc = "Current state of a NIM download/installation."] pub type NIM_DownloadState = ::libc::c_uint; -#[doc = " Input configuration for NIM download/installation tasks."] +#[doc = "Input configuration for NIM download/installation tasks."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct NIM_TitleConfig { @@ -13322,7 +13322,7 @@ pub struct NIM_TitleConfig { #[doc = "< Unknown input, seems to be always 0"] pub unknown_1: u32_, } -#[doc = " Output struct for NIM downloads/installations in progress."] +#[doc = "Output struct for NIM downloads/installations in progress."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct NIM_TitleProgress { @@ -13337,12 +13337,12 @@ pub struct NIM_TitleProgress { } extern "C" { #[must_use] - #[doc = " Initializes nim:s. This uses networking and is blocking.\n # Arguments\n\n* `buffer` - A buffer for internal use. It must be at least 0x20000 bytes long.\n * `buffer_len` - Length of the passed buffer."] + #[doc = "Initializes nim:s. This uses networking and is blocking.\n # Arguments\n\n* `buffer` - A buffer for internal use. It must be at least 0x20000 bytes long.\n * `buffer_len` - Length of the passed buffer."] pub fn nimsInit(buffer: *mut ::libc::c_void, buffer_len: usize) -> Result; } extern "C" { #[must_use] - #[doc = " Initializes nim:s with the given TIN. This uses networking and is blocking.\n # Arguments\n\n* `buffer` - A buffer for internal use. It must be at least 0x20000 bytes long.\n * `buffer_len` - Length of the passed buffer.\n * `TIN` - The TIN to initialize nim:s with. If you do not know what a TIN is or why you would want to change it, use nimsInit instead."] + #[doc = "Initializes nim:s with the given TIN. This uses networking and is blocking.\n # Arguments\n\n* `buffer` - A buffer for internal use. It must be at least 0x20000 bytes long.\n * `buffer_len` - Length of the passed buffer.\n * `TIN` - The TIN to initialize nim:s with. If you do not know what a TIN is or why you would want to change it, use nimsInit instead."] pub fn nimsInitWithTIN( buffer: *mut ::libc::c_void, buffer_len: usize, @@ -13350,25 +13350,25 @@ extern "C" { ) -> Result; } extern "C" { - #[doc = " Exits nim:s."] + #[doc = "Exits nim:s."] pub fn nimsExit(); } extern "C" { - #[doc = " Gets the current nim:s session handle."] + #[doc = "Gets the current nim:s session handle."] pub fn nimsGetSessionHandle() -> *mut Handle; } extern "C" { #[must_use] - #[doc = " Sets an attribute.\n # Arguments\n\n* `attr` - Name of the attribute.\n * `val` - Value of the attribute."] + #[doc = "Sets an attribute.\n # Arguments\n\n* `attr` - Name of the attribute.\n * `val` - Value of the attribute."] pub fn NIMS_SetAttribute(attr: *const ::libc::c_char, val: *const ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = " Checks if nim wants a system update.\n # Arguments\n\n* `want_update` - Set to true if a system update is required. Can be NULL."] + #[doc = "Checks if nim wants a system update.\n # Arguments\n\n* `want_update` - Set to true if a system update is required. Can be NULL."] pub fn NIMS_WantUpdate(want_update: *mut bool) -> Result; } extern "C" { - #[doc = " Makes a TitleConfig struct for use with NIMS_RegisterTask, NIMS_StartDownload or NIMS_StartDownloadSimple.\n # Arguments\n\n* `cfg` - Struct to initialize.\n * `titleId` - Title ID to download and install.\n * `version` - Version of the title to download and install.\n * `ratingAge` - Age for which the title is aged; used by parental controls in HOME Menu.\n * `mediaType` - Media type of the title to download and install."] + #[doc = "Makes a TitleConfig struct for use with NIMS_RegisterTask, NIMS_StartDownload or NIMS_StartDownloadSimple.\n # Arguments\n\n* `cfg` - Struct to initialize.\n * `titleId` - Title ID to download and install.\n * `version` - Version of the title to download and install.\n * `ratingAge` - Age for which the title is aged; used by parental controls in HOME Menu.\n * `mediaType` - Media type of the title to download and install."] pub fn NIMS_MakeTitleConfig( cfg: *mut NIM_TitleConfig, titleId: u64_, @@ -13379,7 +13379,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Registers a background download task with NIM. These are processed in sleep mode only.\n # Arguments\n\n* `cfg` - Title config to use. See NIMS_MakeTitleConfig.\n * `name` - Name of the title in UTF-8. Will be displayed on the HOME Menu. Maximum 73 characters.\n * `maker` - Name of the maker/publisher in UTF-8. Will be displayed on the HOME Menu. Maximum 37 characters."] + #[doc = "Registers a background download task with NIM. These are processed in sleep mode only.\n # Arguments\n\n* `cfg` - Title config to use. See NIMS_MakeTitleConfig.\n * `name` - Name of the title in UTF-8. Will be displayed on the HOME Menu. Maximum 73 characters.\n * `maker` - Name of the maker/publisher in UTF-8. Will be displayed on the HOME Menu. Maximum 37 characters."] pub fn NIMS_RegisterTask( cfg: *const NIM_TitleConfig, name: *const ::libc::c_char, @@ -13388,32 +13388,32 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Checks whether a background download task for the given title is registered with NIM.\n # Arguments\n\n* `titleId` - Title ID to check for.\n * `registered` - Whether there is a background download task registered."] + #[doc = "Checks whether a background download task for the given title is registered with NIM.\n # Arguments\n\n* `titleId` - Title ID to check for.\n * `registered` - Whether there is a background download task registered."] pub fn NIMS_IsTaskRegistered(titleId: u64_, registered: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Unregisters a background download task.\n # Arguments\n\n* `titleId` - Title ID whose background download task to cancel."] + #[doc = "Unregisters a background download task.\n # Arguments\n\n* `titleId` - Title ID whose background download task to cancel."] pub fn NIMS_UnregisterTask(titleId: u64_) -> Result; } extern "C" { #[must_use] - #[doc = " Starts an active download with NIM. Progress can be checked with NIMS_GetProcess. Do not exit the process while a download is in progress without calling NIMS_CancelDownload.\n # Arguments\n\n* `cfg` - Title config to use. See NIMS_MakeTitleConfig.\n * `mode` - The installation mode to use. See NIM_InstallationMode."] + #[doc = "Starts an active download with NIM. Progress can be checked with NIMS_GetProcess. Do not exit the process while a download is in progress without calling NIMS_CancelDownload.\n # Arguments\n\n* `cfg` - Title config to use. See NIMS_MakeTitleConfig.\n * `mode` - The installation mode to use. See NIM_InstallationMode."] pub fn NIMS_StartDownload(cfg: *const NIM_TitleConfig, mode: NIM_InstallationMode) -> Result; } extern "C" { #[must_use] - #[doc = " Starts an active download with NIM with default installation mode; cannot reinstall titles. Progress can be checked with NIMS_GetProcess. Do not exit the process while a download is in progress without calling NIMS_CancelDownload.\n # Arguments\n\n* `cfg` - Title config to use. See NIMS_MakeTitleConfig."] + #[doc = "Starts an active download with NIM with default installation mode; cannot reinstall titles. Progress can be checked with NIMS_GetProcess. Do not exit the process while a download is in progress without calling NIMS_CancelDownload.\n # Arguments\n\n* `cfg` - Title config to use. See NIMS_MakeTitleConfig."] pub fn NIMS_StartDownloadSimple(cfg: *const NIM_TitleConfig) -> Result; } extern "C" { #[must_use] - #[doc = " Checks the status of the current active download.\n # Arguments\n\n* `tp` - Title progress struct to write to. See NIM_TitleProgress."] + #[doc = "Checks the status of the current active download.\n # Arguments\n\n* `tp` - Title progress struct to write to. See NIM_TitleProgress."] pub fn NIMS_GetProgress(tp: *mut NIM_TitleProgress) -> Result; } extern "C" { #[must_use] - #[doc = " Cancels the current active download with NIM."] + #[doc = "Cancels the current active download with NIM."] pub fn NIMS_CancelDownload() -> Result; } extern "C" { @@ -13425,30 +13425,30 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Turns wireless on or off.\n # Arguments\n\n* `enableWifi` - True enables it, false disables it."] + #[doc = "Turns wireless on or off.\n # Arguments\n\n* `enableWifi` - True enables it, false disables it."] pub fn NWMEXT_ControlWirelessEnabled(enableWifi: bool) -> Result; } extern "C" { #[must_use] - #[doc = " Initializes IRU.\n The permissions for the specified memory is set to RO. This memory must be already mapped.\n # Arguments\n\n* `sharedmem_addr` - Address of the shared memory block to use.\n * `sharedmem_size` - Size of the shared memory block."] + #[doc = "Initializes IRU.\n The permissions for the specified memory is set to RO. This memory must be already mapped.\n # Arguments\n\n* `sharedmem_addr` - Address of the shared memory block to use.\n * `sharedmem_size` - Size of the shared memory block."] pub fn iruInit(sharedmem_addr: *mut u32_, sharedmem_size: u32_) -> Result; } extern "C" { - #[doc = " Shuts down IRU."] + #[doc = "Shuts down IRU."] pub fn iruExit(); } extern "C" { - #[doc = " Gets the IRU service handle.\n # Returns\n\nThe IRU service handle."] + #[doc = "Gets the IRU service handle.\n # Returns\n\nThe IRU service handle."] pub fn iruGetServHandle() -> Handle; } extern "C" { #[must_use] - #[doc = " Sends IR data.\n # Arguments\n\n* `buf` - Buffer to send data from.\n * `size` - Size of the buffer.\n * `wait` - Whether to wait for the data to be sent."] + #[doc = "Sends IR data.\n # Arguments\n\n* `buf` - Buffer to send data from.\n * `size` - Size of the buffer.\n * `wait` - Whether to wait for the data to be sent."] pub fn iruSendData(buf: *mut u8_, size: u32_, wait: bool) -> Result; } extern "C" { #[must_use] - #[doc = " Receives IR data.\n # Arguments\n\n* `buf` - Buffer to receive data to.\n * `size` - Size of the buffer.\n * `flag` - Flags to receive data with.\n * `transfercount` - Pointer to output the number of bytes read to.\n * `wait` - Whether to wait for the data to be received."] + #[doc = "Receives IR data.\n # Arguments\n\n* `buf` - Buffer to receive data to.\n * `size` - Size of the buffer.\n * `flag` - Flags to receive data with.\n * `transfercount` - Pointer to output the number of bytes read to.\n * `wait` - Whether to wait for the data to be received."] pub fn iruRecvData( buf: *mut u8_, size: u32_, @@ -13459,106 +13459,106 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Initializes the IR session."] + #[doc = "Initializes the IR session."] pub fn IRU_Initialize() -> Result; } extern "C" { #[must_use] - #[doc = " Shuts down the IR session."] + #[doc = "Shuts down the IR session."] pub fn IRU_Shutdown() -> Result; } extern "C" { #[must_use] - #[doc = " Begins sending data.\n # Arguments\n\n* `buf` - Buffer to send.\n * `size` - Size of the buffer."] + #[doc = "Begins sending data.\n # Arguments\n\n* `buf` - Buffer to send.\n * `size` - Size of the buffer."] pub fn IRU_StartSendTransfer(buf: *mut u8_, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Waits for a send operation to complete."] + #[doc = "Waits for a send operation to complete."] pub fn IRU_WaitSendTransfer() -> Result; } extern "C" { #[must_use] - #[doc = " Begins receiving data.\n # Arguments\n\n* `size` - Size of the data to receive.\n * `flag` - Flags to use when receiving."] + #[doc = "Begins receiving data.\n # Arguments\n\n* `size` - Size of the data to receive.\n * `flag` - Flags to use when receiving."] pub fn IRU_StartRecvTransfer(size: u32_, flag: u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Waits for a receive operation to complete.\n # Arguments\n\n* `transfercount` - Pointer to output the number of bytes read to."] + #[doc = "Waits for a receive operation to complete.\n # Arguments\n\n* `transfercount` - Pointer to output the number of bytes read to."] pub fn IRU_WaitRecvTransfer(transfercount: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the IR bit rate.\n # Arguments\n\n* `value` - Bit rate to set."] + #[doc = "Sets the IR bit rate.\n # Arguments\n\n* `value` - Bit rate to set."] pub fn IRU_SetBitRate(value: u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the IR bit rate.\n # Arguments\n\n* `out` - Pointer to write the bit rate to."] + #[doc = "Gets the IR bit rate.\n # Arguments\n\n* `out` - Pointer to write the bit rate to."] pub fn IRU_GetBitRate(out: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the IR LED state.\n # Arguments\n\n* `value` - IR LED state to set."] + #[doc = "Sets the IR LED state.\n # Arguments\n\n* `value` - IR LED state to set."] pub fn IRU_SetIRLEDState(value: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the IR LED state.\n # Arguments\n\n* `out` - Pointer to write the IR LED state to."] + #[doc = "Gets the IR LED state.\n # Arguments\n\n* `out` - Pointer to write the IR LED state to."] pub fn IRU_GetIRLEDRecvState(out: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets an event which is signaled once a send finishes.\n # Arguments\n\n* `out` - Pointer to write the event handle to."] + #[doc = "Gets an event which is signaled once a send finishes.\n # Arguments\n\n* `out` - Pointer to write the event handle to."] pub fn IRU_GetSendFinishedEvent(out: *mut Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Gets an event which is signaled once a receive finishes.\n # Arguments\n\n* `out` - Pointer to write the event handle to."] + #[doc = "Gets an event which is signaled once a receive finishes.\n # Arguments\n\n* `out` - Pointer to write the event handle to."] pub fn IRU_GetRecvFinishedEvent(out: *mut Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Initializes NS."] + #[doc = "Initializes NS."] pub fn nsInit() -> Result; } extern "C" { - #[doc = " Exits NS."] + #[doc = "Exits NS."] pub fn nsExit(); } extern "C" { #[must_use] - #[doc = " Launches a title and the required firmware (only if necessary).\n # Arguments\n\n* `titleid` - ID of the title to launch, 0 for gamecard, JPN System Settings' titleID for System Settings."] + #[doc = "Launches a title and the required firmware (only if necessary).\n # Arguments\n\n* `titleid` - ID of the title to launch, 0 for gamecard, JPN System Settings' titleID for System Settings."] pub fn NS_LaunchFIRM(titleid: u64_) -> Result; } extern "C" { #[must_use] - #[doc = " Launches a title.\n # Arguments\n\n* `titleid` - ID of the title to launch, or 0 for gamecard.\n * `launch_flags` - Flags used when launching the title.\n * `procid` - Pointer to write the process ID of the launched title to."] + #[doc = "Launches a title.\n # Arguments\n\n* `titleid` - ID of the title to launch, or 0 for gamecard.\n * `launch_flags` - Flags used when launching the title.\n * `procid` - Pointer to write the process ID of the launched title to."] pub fn NS_LaunchTitle(titleid: u64_, launch_flags: u32_, procid: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Terminates the application from which this function is called"] + #[doc = "Terminates the application from which this function is called"] pub fn NS_TerminateTitle() -> Result; } extern "C" { #[must_use] - #[doc = " Launches a title and the required firmware.\n # Arguments\n\n* `titleid` - ID of the title to launch, 0 for gamecard.\n * `flags` - Flags for firm-launch. bit0: require an application title-info structure in FIRM paramters to be specified via FIRM parameters. bit1: if clear, NS will check certain Configuration Memory fields."] + #[doc = "Launches a title and the required firmware.\n # Arguments\n\n* `titleid` - ID of the title to launch, 0 for gamecard.\n * `flags` - Flags for firm-launch. bit0: require an application title-info structure in FIRM paramters to be specified via FIRM parameters. bit1: if clear, NS will check certain Configuration Memory fields."] pub fn NS_LaunchApplicationFIRM(titleid: u64_, flags: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Reboots to a title.\n # Arguments\n\n* `mediatype` - Mediatype of the title.\n * `titleid` - ID of the title to launch."] + #[doc = "Reboots to a title.\n # Arguments\n\n* `mediatype` - Mediatype of the title.\n * `titleid` - ID of the title to launch."] pub fn NS_RebootToTitle(mediatype: u8_, titleid: u64_) -> Result; } extern "C" { #[must_use] - #[doc = " Terminates the process with the specified titleid.\n # Arguments\n\n* `titleid` - ID of the title to terminate.\n * `timeout` - Timeout in nanoseconds. Pass 0 if not required."] + #[doc = "Terminates the process with the specified titleid.\n # Arguments\n\n* `titleid` - ID of the title to terminate.\n * `timeout` - Timeout in nanoseconds. Pass 0 if not required."] pub fn NS_TerminateProcessTID(titleid: u64_, timeout: u64_) -> Result; } extern "C" { #[must_use] - #[doc = " Reboots the system"] + #[doc = "Reboots the system"] pub fn NS_RebootSystem() -> Result; } pub const PMLAUNCHFLAG_NORMAL_APPLICATION: _bindgen_ty_26 = 1; @@ -13571,29 +13571,29 @@ pub const PMLAUNCHFLAG_FORCE_USE_O3DS_APP_MEM: _bindgen_ty_26 = 256; #[doc = "< In conjunction with the above, forces the 96MB app memory setting. N3DS only."] pub const PMLAUNCHFLAG_FORCE_USE_O3DS_MAX_APP_MEM: _bindgen_ty_26 = 512; pub const PMLAUNCHFLAG_USE_UPDATE_TITLE: _bindgen_ty_26 = 65536; -#[doc = " Launch flags for PM launch commands."] +#[doc = "Launch flags for PM launch commands."] pub type _bindgen_ty_26 = ::libc::c_uint; extern "C" { #[must_use] - #[doc = " Initializes pm:app."] + #[doc = "Initializes pm:app."] pub fn pmAppInit() -> Result; } extern "C" { - #[doc = " Exits pm:app."] + #[doc = "Exits pm:app."] pub fn pmAppExit(); } extern "C" { - #[doc = " Gets the current pm:app session handle.\n # Returns\n\nThe current pm:app session handle."] + #[doc = "Gets the current pm:app session handle.\n # Returns\n\nThe current pm:app session handle."] pub fn pmAppGetSessionHandle() -> *mut Handle; } extern "C" { #[must_use] - #[doc = " Launches a title.\n # Arguments\n\n* `programInfo` - Program information of the title.\n * `launchFlags` - Flags to launch the title with."] + #[doc = "Launches a title.\n # Arguments\n\n* `programInfo` - Program information of the title.\n * `launchFlags` - Flags to launch the title with."] pub fn PMAPP_LaunchTitle(programInfo: *const FS_ProgramInfo, launchFlags: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Launches a title, applying patches.\n # Arguments\n\n* `programInfo` - Program information of the title.\n * `programInfoUpdate` - Program information of the update title.\n * `launchFlags` - Flags to launch the title with."] + #[doc = "Launches a title, applying patches.\n # Arguments\n\n* `programInfo` - Program information of the title.\n * `programInfoUpdate` - Program information of the update title.\n * `launchFlags` - Flags to launch the title with."] pub fn PMAPP_LaunchTitleUpdate( programInfo: *const FS_ProgramInfo, programInfoUpdate: *const FS_ProgramInfo, @@ -13602,7 +13602,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets a title's ExHeader Arm11CoreInfo and SystemInfo flags.\n # Arguments\n\n* `outCoreInfo` (direction out) - Pointer to write the ExHeader Arm11CoreInfo to.\n * `outSiFlags` (direction out) - Pointer to write the ExHeader SystemInfo flags to.\n * `programInfo` - Program information of the title."] + #[doc = "Gets a title's ExHeader Arm11CoreInfo and SystemInfo flags.\n # Arguments\n\n* `outCoreInfo` (direction out) - Pointer to write the ExHeader Arm11CoreInfo to.\n * `outSiFlags` (direction out) - Pointer to write the ExHeader SystemInfo flags to.\n * `programInfo` - Program information of the title."] pub fn PMAPP_GetTitleExheaderFlags( outCoreInfo: *mut ExHeader_Arm11CoreInfo, outSiFlags: *mut ExHeader_SystemInfoFlags, @@ -13611,17 +13611,17 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Sets the current FIRM launch parameters.\n # Arguments\n\n* `size` - Size of the FIRM launch parameter buffer.\n * `in` - Buffer to retrieve the launch parameters from."] + #[doc = "Sets the current FIRM launch parameters.\n # Arguments\n\n* `size` - Size of the FIRM launch parameter buffer.\n * `in` - Buffer to retrieve the launch parameters from."] pub fn PMAPP_SetFIRMLaunchParams(size: u32_, in_: *const ::libc::c_void) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the current FIRM launch parameters.\n # Arguments\n\n* `size` - Size of the FIRM launch parameter buffer.\n * `out` (direction out) - Buffer to write the launch parameters to."] + #[doc = "Gets the current FIRM launch parameters.\n # Arguments\n\n* `size` - Size of the FIRM launch parameter buffer.\n * `out` (direction out) - Buffer to write the launch parameters to."] pub fn PMAPP_GetFIRMLaunchParams(out: *mut ::libc::c_void, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the current FIRM launch parameters.\n # Arguments\n\n* `firmTidLow` - Low Title ID of the FIRM title to launch.\n * `size` - Size of the FIRM launch parameter buffer.\n * `in` - Buffer to retrieve the launch parameters from."] + #[doc = "Sets the current FIRM launch parameters.\n # Arguments\n\n* `firmTidLow` - Low Title ID of the FIRM title to launch.\n * `size` - Size of the FIRM launch parameter buffer.\n * `in` - Buffer to retrieve the launch parameters from."] pub fn PMAPP_LaunchFIRMSetParams( firmTidLow: u32_, size: u32_, @@ -13630,55 +13630,55 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Terminate most processes, to prepare for a reboot or a shutdown.\n # Arguments\n\n* `timeout` - Time limit in ns for process termination, after which the remaining processes are killed."] + #[doc = "Terminate most processes, to prepare for a reboot or a shutdown.\n # Arguments\n\n* `timeout` - Time limit in ns for process termination, after which the remaining processes are killed."] pub fn PMAPP_PrepareForReboot(timeout: s64) -> Result; } extern "C" { #[must_use] - #[doc = " Terminates the current Application\n # Arguments\n\n* `timeout` - Timeout in nanoseconds"] + #[doc = "Terminates the current Application\n # Arguments\n\n* `timeout` - Timeout in nanoseconds"] pub fn PMAPP_TerminateCurrentApplication(timeout: s64) -> Result; } extern "C" { #[must_use] - #[doc = " Terminates the processes having the specified titleId.\n # Arguments\n\n* `titleId` - Title ID of the processes to terminate\n * `timeout` - Timeout in nanoseconds"] + #[doc = "Terminates the processes having the specified titleId.\n # Arguments\n\n* `titleId` - Title ID of the processes to terminate\n * `timeout` - Timeout in nanoseconds"] pub fn PMAPP_TerminateTitle(titleId: u64_, timeout: s64) -> Result; } extern "C" { #[must_use] - #[doc = " Terminates the specified process\n # Arguments\n\n* `pid` - Process-ID of the process to terminate\n * `timeout` - Timeout in nanoseconds"] + #[doc = "Terminates the specified process\n # Arguments\n\n* `pid` - Process-ID of the process to terminate\n * `timeout` - Timeout in nanoseconds"] pub fn PMAPP_TerminateProcess(pid: u32_, timeout: s64) -> Result; } extern "C" { #[must_use] - #[doc = " Unregisters a process\n # Arguments\n\n* `tid` - TitleID of the process to unregister"] + #[doc = "Unregisters a process\n # Arguments\n\n* `tid` - TitleID of the process to unregister"] pub fn PMAPP_UnregisterProcess(tid: u64_) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the APPLICATION cputime reslimit.\n # Arguments\n\n* `cpuTime` - Reslimit value.\n > **Note:** cpuTime can be no higher than reslimitdesc[0] & 0x7F in exheader (or 80 if the latter is 0)."] + #[doc = "Sets the APPLICATION cputime reslimit.\n # Arguments\n\n* `cpuTime` - Reslimit value.\n > **Note:** cpuTime can be no higher than reslimitdesc[0] & 0x7F in exheader (or 80 if the latter is 0)."] pub fn PMAPP_SetAppResourceLimit(cpuTime: s64) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the APPLICATION cputime reslimit.\n # Arguments\n\n* `cpuTime` (direction out) - Pointer to write the reslimit value to."] + #[doc = "Gets the APPLICATION cputime reslimit.\n # Arguments\n\n* `cpuTime` (direction out) - Pointer to write the reslimit value to."] pub fn PMAPP_GetAppResourceLimit(outCpuTime: *mut s64) -> Result; } extern "C" { #[must_use] - #[doc = " Initializes pm:dbg."] + #[doc = "Initializes pm:dbg."] pub fn pmDbgInit() -> Result; } extern "C" { - #[doc = " Exits pm:dbg."] + #[doc = "Exits pm:dbg."] pub fn pmDbgExit(); } extern "C" { - #[doc = " Gets the current pm:dbg session handle.\n # Returns\n\nThe current pm:dbg session handle."] + #[doc = "Gets the current pm:dbg session handle.\n # Returns\n\nThe current pm:dbg session handle."] pub fn pmDbgGetSessionHandle() -> *mut Handle; } extern "C" { #[must_use] - #[doc = " Enqueues an application for debug after setting cpuTime to 0, and returns a debug handle to it.\n If another process was enqueued, this just calls RunQueuedProcess instead.\n # Arguments\n\n* `Pointer` (direction out) - to output the debug handle to.\n * `programInfo` - Program information of the title.\n * `launchFlags` - Flags to launch the title with."] + #[doc = "Enqueues an application for debug after setting cpuTime to 0, and returns a debug handle to it.\n If another process was enqueued, this just calls RunQueuedProcess instead.\n # Arguments\n\n* `Pointer` (direction out) - to output the debug handle to.\n * `programInfo` - Program information of the title.\n * `launchFlags` - Flags to launch the title with."] pub fn PMDBG_LaunchAppDebug( outDebug: *mut Handle, programInfo: *const FS_ProgramInfo, @@ -13687,12 +13687,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Launches an application for debug after setting cpuTime to 0.\n # Arguments\n\n* `programInfo` - Program information of the title.\n * `launchFlags` - Flags to launch the title with."] + #[doc = "Launches an application for debug after setting cpuTime to 0.\n # Arguments\n\n* `programInfo` - Program information of the title.\n * `launchFlags` - Flags to launch the title with."] pub fn PMDBG_LaunchApp(programInfo: *const FS_ProgramInfo, launchFlags: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Runs the queued process and returns a debug handle to it.\n # Arguments\n\n* `Pointer` (direction out) - to output the debug handle to."] + #[doc = "Runs the queued process and returns a debug handle to it.\n # Arguments\n\n* `Pointer` (direction out) - to output the debug handle to."] pub fn PMDBG_RunQueuedProcess(outDebug: *mut Handle) -> Result; } #[doc = "< CBC encryption."] @@ -13707,7 +13707,7 @@ pub const PS_ALGORITHM_CTR_DEC: PS_AESAlgorithm = 3; pub const PS_ALGORITHM_CCM_ENC: PS_AESAlgorithm = 4; #[doc = "< CCM decryption."] pub const PS_ALGORITHM_CCM_DEC: PS_AESAlgorithm = 5; -#[doc = " PS AES algorithms."] +#[doc = "PS AES algorithms."] pub type PS_AESAlgorithm = ::libc::c_uint; #[doc = "< Key slot 0x0D."] pub const PS_KEYSLOT_0D: PS_AESKeyType = 0; @@ -13729,9 +13729,9 @@ pub const PS_KEYSLOT_INVALID: PS_AESKeyType = 7; pub const PS_KEYSLOT_36: PS_AESKeyType = 8; #[doc = "< Key slot 0x39. (NFC)"] pub const PS_KEYSLOT_39_NFC: PS_AESKeyType = 9; -#[doc = " PS key slots."] +#[doc = "PS key slots."] pub type PS_AESKeyType = ::libc::c_uint; -#[doc = " RSA context."] +#[doc = "RSA context."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct psRSAContext { @@ -13751,30 +13751,30 @@ impl Default for psRSAContext { } extern "C" { #[must_use] - #[doc = " Initializes PS."] + #[doc = "Initializes PS."] pub fn psInit() -> Result; } extern "C" { #[must_use] - #[doc = " Initializes PS with the specified session handle.\n # Arguments\n\n* `handle` - Session handle."] + #[doc = "Initializes PS with the specified session handle.\n # Arguments\n\n* `handle` - Session handle."] pub fn psInitHandle(handle: Handle) -> Result; } extern "C" { - #[doc = " Exits PS."] + #[doc = "Exits PS."] pub fn psExit(); } extern "C" { - #[doc = " Returns the PS session handle."] + #[doc = "Returns the PS session handle."] pub fn psGetSessionHandle() -> Handle; } extern "C" { #[must_use] - #[doc = " Signs a RSA signature.\n # Arguments\n\n* `hash` - SHA256 hash to sign.\n * `ctx` - RSA context.\n * `signature` - RSA signature."] + #[doc = "Signs a RSA signature.\n # Arguments\n\n* `hash` - SHA256 hash to sign.\n * `ctx` - RSA context.\n * `signature` - RSA signature."] pub fn PS_SignRsaSha256(hash: *mut u8_, ctx: *mut psRSAContext, signature: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Verifies a RSA signature.\n # Arguments\n\n* `hash` - SHA256 hash to compare with.\n * `ctx` - RSA context.\n * `signature` - RSA signature."] + #[doc = "Verifies a RSA signature.\n # Arguments\n\n* `hash` - SHA256 hash to compare with.\n * `ctx` - RSA context.\n * `signature` - RSA signature."] pub fn PS_VerifyRsaSha256( hash: *mut u8_, ctx: *mut psRSAContext, @@ -13783,7 +13783,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Encrypts/Decrypts AES data. Does not support AES CCM.\n # Arguments\n\n* `size` - Size of the data.\n * `in` - Input buffer.\n * `out` - Output buffer.\n * `aes_algo` - AES algorithm to use.\n * `key_type` - Key type to use.\n * `iv` - Pointer to the CTR/IV. The output CTR/IV is also written here."] + #[doc = "Encrypts/Decrypts AES data. Does not support AES CCM.\n # Arguments\n\n* `size` - Size of the data.\n * `in` - Input buffer.\n * `out` - Output buffer.\n * `aes_algo` - AES algorithm to use.\n * `key_type` - Key type to use.\n * `iv` - Pointer to the CTR/IV. The output CTR/IV is also written here."] pub fn PS_EncryptDecryptAes( size: u32_, in_: *mut u8_, @@ -13795,7 +13795,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Encrypts/Decrypts signed AES CCM data.\n When decrypting, if the MAC is invalid, 0xC9010401 is returned. After encrypting the MAC is located at inputbufptr.\n # Arguments\n\n* `in` - Input buffer.\n * `in_size` - Size of the input buffer. Must include MAC size when decrypting.\n * `out` - Output buffer.\n * `out_size` - Size of the output buffer. Must include MAC size when encrypting.\n * `data_len` - Length of the data to be encrypted/decrypted.\n * `mac_data_len` - Length of the MAC data.\n * `mac_len` - Length of the MAC.\n * `aes_algo` - AES algorithm to use.\n * `key_type` - Key type to use.\n * `nonce` - Pointer to the nonce."] + #[doc = "Encrypts/Decrypts signed AES CCM data.\n When decrypting, if the MAC is invalid, 0xC9010401 is returned. After encrypting the MAC is located at inputbufptr.\n # Arguments\n\n* `in` - Input buffer.\n * `in_size` - Size of the input buffer. Must include MAC size when decrypting.\n * `out` - Output buffer.\n * `out_size` - Size of the output buffer. Must include MAC size when encrypting.\n * `data_len` - Length of the data to be encrypted/decrypted.\n * `mac_data_len` - Length of the MAC data.\n * `mac_len` - Length of the MAC.\n * `aes_algo` - AES algorithm to use.\n * `key_type` - Key type to use.\n * `nonce` - Pointer to the nonce."] pub fn PS_EncryptSignDecryptVerifyAesCcm( in_: *mut u8_, in_size: u32_, @@ -13811,63 +13811,63 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets the 64-bit console friend code seed.\n # Arguments\n\n* `seed` - Pointer to write the friend code seed to."] + #[doc = "Gets the 64-bit console friend code seed.\n # Arguments\n\n* `seed` - Pointer to write the friend code seed to."] pub fn PS_GetLocalFriendCodeSeed(seed: *mut u64_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the 32-bit device ID.\n # Arguments\n\n* `device_id` - Pointer to write the device ID to."] + #[doc = "Gets the 32-bit device ID.\n # Arguments\n\n* `device_id` - Pointer to write the device ID to."] pub fn PS_GetDeviceId(device_id: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Generates cryptographically secure random bytes.\n # Arguments\n\n* `out` - Pointer to the buffer to write the bytes to.\n * `len` - Number of bytes to write."] + #[doc = "Generates cryptographically secure random bytes.\n # Arguments\n\n* `out` - Pointer to the buffer to write the bytes to.\n * `len` - Number of bytes to write."] pub fn PS_GenerateRandomBytes(out: *mut ::libc::c_void, len: usize) -> Result; } extern "C" { #[must_use] - #[doc = " Initializes PTMU."] + #[doc = "Initializes PTMU."] pub fn ptmuInit() -> Result; } extern "C" { - #[doc = " Exits PTMU."] + #[doc = "Exits PTMU."] pub fn ptmuExit(); } extern "C" { - #[doc = " Gets a pointer to the current ptm:u session handle.\n # Returns\n\nA pointer to the current ptm:u session handle."] + #[doc = "Gets a pointer to the current ptm:u session handle.\n # Returns\n\nA pointer to the current ptm:u session handle."] pub fn ptmuGetSessionHandle() -> *mut Handle; } extern "C" { #[must_use] - #[doc = " Gets the system's current shell state.\n # Arguments\n\n* `out` - Pointer to write the current shell state to. (0 = closed, 1 = open)"] + #[doc = "Gets the system's current shell state.\n # Arguments\n\n* `out` - Pointer to write the current shell state to. (0 = closed, 1 = open)"] pub fn PTMU_GetShellState(out: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the system's current battery level.\n # Arguments\n\n* `out` - Pointer to write the current battery level to. (0-5)"] + #[doc = "Gets the system's current battery level.\n # Arguments\n\n* `out` - Pointer to write the current battery level to. (0-5)"] pub fn PTMU_GetBatteryLevel(out: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the system's current battery charge state.\n # Arguments\n\n* `out` - Pointer to write the current battery charge state to. (0 = not charging, 1 = charging)"] + #[doc = "Gets the system's current battery charge state.\n # Arguments\n\n* `out` - Pointer to write the current battery charge state to. (0 = not charging, 1 = charging)"] pub fn PTMU_GetBatteryChargeState(out: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the system's current pedometer state.\n # Arguments\n\n* `out` - Pointer to write the current pedometer state to. (0 = not counting, 1 = counting)"] + #[doc = "Gets the system's current pedometer state.\n # Arguments\n\n* `out` - Pointer to write the current pedometer state to. (0 = not counting, 1 = counting)"] pub fn PTMU_GetPedometerState(out: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the pedometer's total step count.\n # Arguments\n\n* `steps` - Pointer to write the total step count to."] + #[doc = "Gets the pedometer's total step count.\n # Arguments\n\n* `steps` - Pointer to write the total step count to."] pub fn PTMU_GetTotalStepCount(steps: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets whether the adapter is plugged in or not\n # Arguments\n\n* `out` - Pointer to write the adapter state to."] + #[doc = "Gets whether the adapter is plugged in or not\n # Arguments\n\n* `out` - Pointer to write the adapter state to."] pub fn PTMU_GetAdapterState(out: *mut bool) -> Result; } -#[doc = " PDN wake events and MCU interrupts to select, combined with those of other processes"] +#[doc = "PDN wake events and MCU interrupts to select, combined with those of other processes"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct PtmWakeEvents { @@ -13907,121 +13907,121 @@ pub const PTMNOTIFID_BATTERY_LOW: _bindgen_ty_27 = 530; pub type _bindgen_ty_27 = ::libc::c_uint; extern "C" { #[must_use] - #[doc = " Initializes ptm:sysm."] + #[doc = "Initializes ptm:sysm."] pub fn ptmSysmInit() -> Result; } extern "C" { - #[doc = " Exits ptm:sysm."] + #[doc = "Exits ptm:sysm."] pub fn ptmSysmExit(); } extern "C" { - #[doc = " Gets a pointer to the current ptm:sysm session handle.\n # Returns\n\nA pointer to the current ptm:sysm session handle."] + #[doc = "Gets a pointer to the current ptm:sysm session handle.\n # Returns\n\nA pointer to the current ptm:sysm session handle."] pub fn ptmSysmGetSessionHandle() -> *mut Handle; } extern "C" { #[must_use] - #[doc = " Requests to enter sleep mode."] + #[doc = "Requests to enter sleep mode."] pub fn PTMSYSM_RequestSleep() -> Result; } extern "C" { #[must_use] - #[doc = " Accepts or denies the incoming sleep mode request.\n # Arguments\n\n* `deny` - Whether or not to deny the sleep request.\n > **Note:** If deny = false, this is equivalent to calling PTMSYSM_NotifySleepPreparationComplete(3)"] + #[doc = "Accepts or denies the incoming sleep mode request.\n # Arguments\n\n* `deny` - Whether or not to deny the sleep request.\n > **Note:** If deny = false, this is equivalent to calling PTMSYSM_NotifySleepPreparationComplete(3)"] pub fn PTMSYSM_ReplyToSleepQuery(deny: bool) -> Result; } extern "C" { #[must_use] - #[doc = " Acknowledges the current sleep notification and advance the internal sleep mode FSM. All subscribers must reply.\n # Arguments\n\n* `ackValue` - Use ptmSysmGetNotificationAckValue\n > **Note:** PTMNOTIFID_SLEEP_DENIED and PTMNOTIFID_FULLY_AWAKE don't require this."] + #[doc = "Acknowledges the current sleep notification and advance the internal sleep mode FSM. All subscribers must reply.\n # Arguments\n\n* `ackValue` - Use ptmSysmGetNotificationAckValue\n > **Note:** PTMNOTIFID_SLEEP_DENIED and PTMNOTIFID_FULLY_AWAKE don't require this."] pub fn PTMSYSM_NotifySleepPreparationComplete(ackValue: s32) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the wake events (two sets: when to fully wake up and when to return to sleep).\n # Arguments\n\n* `sleepConfig` - Pointer to the two sets of wake events.\n > **Note:** Can only be called just before acknowledging PTMNOTIFID_GOING_TO_SLEEP or PTMNOTIFID_HALF_AWAKE."] + #[doc = "Sets the wake events (two sets: when to fully wake up and when to return to sleep).\n # Arguments\n\n* `sleepConfig` - Pointer to the two sets of wake events.\n > **Note:** Can only be called just before acknowledging PTMNOTIFID_GOING_TO_SLEEP or PTMNOTIFID_HALF_AWAKE."] pub fn PTMSYSM_SetWakeEvents(sleepConfig: *const PtmSleepConfig) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the wake reason (only the first applicable wake event is taken into account).\n # Arguments\n\n* `sleepConfig` - Pointer to the two sets of wake events. Only the relevant set will be filled."] + #[doc = "Gets the wake reason (only the first applicable wake event is taken into account).\n # Arguments\n\n* `sleepConfig` - Pointer to the two sets of wake events. Only the relevant set will be filled."] pub fn PTMSYSM_GetWakeReason(outSleepConfig: *mut PtmSleepConfig) -> Result; } extern "C" { #[must_use] - #[doc = " Cancels the \"half-awake\" state and fully wakes up the 3DS after some delay."] + #[doc = "Cancels the \"half-awake\" state and fully wakes up the 3DS after some delay."] pub fn PTMSYSM_Awaken() -> Result; } extern "C" { #[must_use] - #[doc = " Sets the user time by updating the user time offset.\n # Arguments\n\n* `msY2k` - The number of milliseconds since 01/01/2000."] + #[doc = "Sets the user time by updating the user time offset.\n # Arguments\n\n* `msY2k` - The number of milliseconds since 01/01/2000."] pub fn PTMSYSM_SetUserTime(msY2k: s64) -> Result; } extern "C" { #[must_use] - #[doc = " Invalidates the \"system time\" (cfg block 0x30002)"] + #[doc = "Invalidates the \"system time\" (cfg block 0x30002)"] pub fn PTMSYSM_InvalidateSystemTime() -> Result; } extern "C" { #[must_use] - #[doc = " Reads the time and date coming from the RTC and converts the result.\n # Arguments\n\n* `outMsY2k` (direction out) - The pointer to write the number of milliseconds since 01/01/2000 to."] + #[doc = "Reads the time and date coming from the RTC and converts the result.\n # Arguments\n\n* `outMsY2k` (direction out) - The pointer to write the number of milliseconds since 01/01/2000 to."] pub fn PTMSYSM_GetRtcTime(outMsY2k: *mut s64) -> Result; } extern "C" { #[must_use] - #[doc = " Writes the time and date coming to the RTC, after conversion.\n # Arguments\n\n* `msY2k` - The number of milliseconds since 01/01/2000."] + #[doc = "Writes the time and date coming to the RTC, after conversion.\n # Arguments\n\n* `msY2k` - The number of milliseconds since 01/01/2000."] pub fn PTMSYSM_SetRtcTime(msY2k: s64) -> Result; } extern "C" { #[must_use] - #[doc = " Returns 1 if it's a New 3DS, otherwise 0."] + #[doc = "Returns 1 if it's a New 3DS, otherwise 0."] pub fn PTMSYSM_CheckNew3DS() -> Result; } extern "C" { #[must_use] - #[doc = " Configures the New 3DS' CPU clock speed and L2 cache.\n # Arguments\n\n* `value` - Bit0: enable higher clock, Bit1: enable L2 cache."] + #[doc = "Configures the New 3DS' CPU clock speed and L2 cache.\n # Arguments\n\n* `value` - Bit0: enable higher clock, Bit1: enable L2 cache."] pub fn PTMSYSM_ConfigureNew3DSCPU(value: u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Trigger a hardware system shutdown via the MCU.\n # Arguments\n\n* `timeout:` - timeout passed to PMApp:ShutdownAsync (PrepareForReboot)."] + #[doc = "Trigger a hardware system shutdown via the MCU.\n # Arguments\n\n* `timeout:` - timeout passed to PMApp:ShutdownAsync (PrepareForReboot)."] pub fn PTMSYSM_ShutdownAsync(timeout: u64_) -> Result; } extern "C" { #[must_use] - #[doc = " Trigger a hardware system reboot via the MCU.\n # Arguments\n\n* `timeout:` - timeout passed to PMApp:ShutdownAsync (PrepareForReboot)."] + #[doc = "Trigger a hardware system reboot via the MCU.\n # Arguments\n\n* `timeout:` - timeout passed to PMApp:ShutdownAsync (PrepareForReboot)."] pub fn PTMSYSM_RebootAsync(timeout: u64_) -> Result; } extern "C" { #[must_use] - #[doc = " Initializes PTMGETS."] + #[doc = "Initializes PTMGETS."] pub fn ptmGetsInit() -> Result; } extern "C" { - #[doc = " Exits PTMGETS."] + #[doc = "Exits PTMGETS."] pub fn ptmGetsExit(); } extern "C" { - #[doc = " Gets a pointer to the current ptm:gets session handle.\n # Returns\n\nA pointer to the current ptm:gets session handle."] + #[doc = "Gets a pointer to the current ptm:gets session handle.\n # Returns\n\nA pointer to the current ptm:gets session handle."] pub fn ptmGetsGetSessionHandle() -> *mut Handle; } extern "C" { #[must_use] - #[doc = " Gets the system time.\n # Arguments\n\n* `outMsY2k` (direction out) - The pointer to write the number of milliseconds since 01/01/2000 to."] + #[doc = "Gets the system time.\n # Arguments\n\n* `outMsY2k` (direction out) - The pointer to write the number of milliseconds since 01/01/2000 to."] pub fn PTMGETS_GetSystemTime(outMsY2k: *mut s64) -> Result; } extern "C" { #[must_use] - #[doc = " Initializes PTMSETS."] + #[doc = "Initializes PTMSETS."] pub fn ptmSetsInit() -> Result; } extern "C" { - #[doc = " Exits PTMSETS."] + #[doc = "Exits PTMSETS."] pub fn ptmSetsExit(); } extern "C" { - #[doc = " Gets a pointer to the current ptm:sets session handle.\n # Returns\n\nA pointer to the current ptm:sets session handle."] + #[doc = "Gets a pointer to the current ptm:sets session handle.\n # Returns\n\nA pointer to the current ptm:sets session handle."] pub fn ptmSetsGetSessionHandle() -> *mut Handle; } extern "C" { #[must_use] - #[doc = " Sets the system time.\n # Arguments\n\n* `msY2k` - The number of milliseconds since 01/01/2000."] + #[doc = "Sets the system time.\n # Arguments\n\n* `msY2k` - The number of milliseconds since 01/01/2000."] pub fn PTMSETS_SetSystemTime(msY2k: s64) -> Result; } #[doc = "< Do not wait."] @@ -14032,7 +14032,7 @@ pub const WAIT_SLEEP: PXIDEV_WaitType = 1; pub const WAIT_IREQ_RETURN: PXIDEV_WaitType = 2; #[doc = "< Wait for IREQ, continue if timeout."] pub const WAIT_IREQ_CONTINUE: PXIDEV_WaitType = 3; -#[doc = " Card SPI wait operation type."] +#[doc = "Card SPI wait operation type."] pub type PXIDEV_WaitType = ::libc::c_uint; #[doc = "< Do not deassert."] pub const DEASSERT_NONE: PXIDEV_DeassertType = 0; @@ -14040,9 +14040,9 @@ pub const DEASSERT_NONE: PXIDEV_DeassertType = 0; pub const DEASSERT_BEFORE_WAIT: PXIDEV_DeassertType = 1; #[doc = "< Deassert after waiting."] pub const DEASSERT_AFTER_WAIT: PXIDEV_DeassertType = 2; -#[doc = " Card SPI register deassertion type."] +#[doc = "Card SPI register deassertion type."] pub type PXIDEV_DeassertType = ::libc::c_uint; -#[doc = " Card SPI transfer buffer."] +#[doc = "Card SPI transfer buffer."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct PXIDEV_SPIBuffer { @@ -14066,16 +14066,16 @@ impl Default for PXIDEV_SPIBuffer { } extern "C" { #[must_use] - #[doc = " Initializes pxi:dev."] + #[doc = "Initializes pxi:dev."] pub fn pxiDevInit() -> Result; } extern "C" { - #[doc = " Shuts down pxi:dev."] + #[doc = "Shuts down pxi:dev."] pub fn pxiDevExit(); } extern "C" { #[must_use] - #[doc = " Performs multiple card SPI writes and reads.\n # Arguments\n\n* `header` - Header to lead the transfers with. Must be, at most, 8 bytes in size.\n * `writeBuffer1` - Buffer to make first transfer from.\n * `readBuffer1` - Buffer to receive first response to.\n * `writeBuffer2` - Buffer to make second transfer from.\n * `readBuffer2` - Buffer to receive second response to.\n * `footer` - Footer to follow the transfers with. Must be, at most, 8 bytes in size. Wait operation is unused."] + #[doc = "Performs multiple card SPI writes and reads.\n # Arguments\n\n* `header` - Header to lead the transfers with. Must be, at most, 8 bytes in size.\n * `writeBuffer1` - Buffer to make first transfer from.\n * `readBuffer1` - Buffer to receive first response to.\n * `writeBuffer2` - Buffer to make second transfer from.\n * `readBuffer2` - Buffer to receive second response to.\n * `footer` - Footer to follow the transfers with. Must be, at most, 8 bytes in size. Wait operation is unused."] pub fn PXIDEV_SPIMultiWriteRead( header: *mut PXIDEV_SPIBuffer, writeBuffer1: *mut PXIDEV_SPIBuffer, @@ -14087,7 +14087,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Performs a single card SPI write and read.\n # Arguments\n\n* `bytesRead` - Pointer to output the number of bytes received to.\n * `initialWaitOperation` - Wait operation to perform before transferring data.\n * `writeBuffer` - Buffer to transfer data from.\n * `readBuffer` - Buffer to receive data to."] + #[doc = "Performs a single card SPI write and read.\n # Arguments\n\n* `bytesRead` - Pointer to output the number of bytes received to.\n * `initialWaitOperation` - Wait operation to perform before transferring data.\n * `writeBuffer` - Buffer to transfer data from.\n * `readBuffer` - Buffer to receive data to."] pub fn PXIDEV_SPIWriteRead( bytesRead: *mut u32_, initialWaitOperation: u64_, @@ -14097,25 +14097,25 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Initializes PxiPM."] + #[doc = "Initializes PxiPM."] pub fn pxiPmInit() -> Result; } extern "C" { - #[doc = " Exits PxiPM."] + #[doc = "Exits PxiPM."] pub fn pxiPmExit(); } extern "C" { - #[doc = " Gets the current PxiPM session handle.\n # Returns\n\nThe current PxiPM session handle."] + #[doc = "Gets the current PxiPM session handle.\n # Returns\n\nThe current PxiPM session handle."] pub fn pxiPmGetSessionHandle() -> *mut Handle; } extern "C" { #[must_use] - #[doc = " Retrives the exheader information set(s) (SCI+ACI) about a program.\n # Arguments\n\n* `exheaderInfos[out]` - Pointer to the output exheader information set.\n * `programHandle` - The program handle."] + #[doc = "Retrives the exheader information set(s) (SCI+ACI) about a program.\n # Arguments\n\n* `exheaderInfos[out]` - Pointer to the output exheader information set.\n * `programHandle` - The program handle."] pub fn PXIPM_GetProgramInfo(exheaderInfo: *mut ExHeader_Info, programHandle: u64_) -> Result; } extern "C" { #[must_use] - #[doc = " Loads a program and registers it to Process9.\n # Arguments\n\n* `programHandle[out]` - Pointer to the output the program handle to.\n * `programInfo` - Information about the program to load.\n * `updateInfo` - Information about the program update to load."] + #[doc = "Loads a program and registers it to Process9.\n # Arguments\n\n* `programHandle[out]` - Pointer to the output the program handle to.\n * `programInfo` - Information about the program to load.\n * `updateInfo` - Information about the program update to load."] pub fn PXIPM_RegisterProgram( programHandle: *mut u64_, programInfo: *const FS_ProgramInfo, @@ -14124,7 +14124,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Unloads a program and unregisters it from Process9.\n # Arguments\n\n* `programHandle` - The program handle."] + #[doc = "Unloads a program and unregisters it from Process9.\n # Arguments\n\n* `programHandle` - The program handle."] pub fn PXIPM_UnregisterProgram(programHandle: u64_) -> Result; } #[repr(C)] @@ -14906,9 +14906,9 @@ pub const NETOPT_TCP_TABLE: NetworkOpt = 36867; pub const NETOPT_DNS_TABLE: NetworkOpt = 45059; #[doc = "< The DHCP lease time remaining, in seconds"] pub const NETOPT_DHCP_LEASE_TIME: NetworkOpt = 49153; -#[doc = " Options to be used with SOCU_GetNetworkOpt"] +#[doc = "Options to be used with SOCU_GetNetworkOpt"] pub type NetworkOpt = ::libc::c_uint; -#[doc = " One entry of the ARP table retrieved by using SOCU_GetNetworkOpt and NETOPT_ARP_TABLE"] +#[doc = "One entry of the ARP table retrieved by using SOCU_GetNetworkOpt and NETOPT_ARP_TABLE"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct SOCU_ARPTableEntry { @@ -14919,7 +14919,7 @@ pub struct SOCU_ARPTableEntry { pub mac: [u8_; 6usize], pub padding: [u8_; 2usize], } -#[doc = " Structure returned by SOCU_GetNetworkOpt when using NETOPT_IP_INFO"] +#[doc = "Structure returned by SOCU_GetNetworkOpt when using NETOPT_IP_INFO"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct SOCU_IPInfo { @@ -14930,7 +14930,7 @@ pub struct SOCU_IPInfo { #[doc = "< Current network broadcast address"] pub broadcast: in_addr, } -#[doc = " One entry of the routing table retrieved by using SOCU_GetNetworkOpt and NETOPT_ROUTING_TABLE"] +#[doc = "One entry of the routing table retrieved by using SOCU_GetNetworkOpt and NETOPT_ROUTING_TABLE"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct SOCU_RoutingTableEntry { @@ -14945,7 +14945,7 @@ pub struct SOCU_RoutingTableEntry { #[doc = "< number of milliseconds since 1st Jan 1900 00:00."] pub time: u64_, } -#[doc = " One entry of the UDP sockets table retrieved by using SOCU_GetNetworkOpt and NETOPT_UDP_TABLE"] +#[doc = "One entry of the UDP sockets table retrieved by using SOCU_GetNetworkOpt and NETOPT_UDP_TABLE"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct SOCU_UDPTableEntry { @@ -14954,7 +14954,7 @@ pub struct SOCU_UDPTableEntry { #[doc = "< Remote address information"] pub remote: sockaddr_storage, } -#[doc = " One entry of the TCP sockets table retrieved by using SOCU_GetNetworkOpt and NETOPT_TCP_TABLE"] +#[doc = "One entry of the TCP sockets table retrieved by using SOCU_GetNetworkOpt and NETOPT_TCP_TABLE"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct SOCU_TCPTableEntry { @@ -14965,28 +14965,28 @@ pub struct SOCU_TCPTableEntry { #[doc = "< Remote address information"] pub remote: sockaddr_storage, } -#[doc = " One entry of the DNS servers table retrieved by using SOCU_GetNetworkOpt and NETOPT_DNS_TABLE"] +#[doc = "One entry of the DNS servers table retrieved by using SOCU_GetNetworkOpt and NETOPT_DNS_TABLE"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct SOCU_DNSTableEntry { pub family: u32_, - #[doc = " Family of the address of the DNS server"] + #[doc = "Family of the address of the DNS server"] pub ip: in_addr, - #[doc = " IP of the DNS server"] + #[doc = "IP of the DNS server"] pub padding: [u8_; 12usize], } extern "C" { #[must_use] - #[doc = " Initializes the SOC service.\n # Arguments\n\n* `context_addr` - Address of a page-aligned (0x1000) buffer to be used.\n * `context_size` - Size of the buffer, a multiple of 0x1000.\n > **Note:** The specified context buffer can no longer be accessed by the process which called this function, since the userland permissions for this block are set to no-access."] + #[doc = "Initializes the SOC service.\n # Arguments\n\n* `context_addr` - Address of a page-aligned (0x1000) buffer to be used.\n * `context_size` - Size of the buffer, a multiple of 0x1000.\n > **Note:** The specified context buffer can no longer be accessed by the process which called this function, since the userland permissions for this block are set to no-access."] pub fn socInit(context_addr: *mut u32_, context_size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Closes the soc service.\n > **Note:** You need to call this in order to be able to use the buffer again."] + #[doc = "Closes the soc service.\n > **Note:** You need to call this in order to be able to use the buffer again."] pub fn socExit() -> Result; } extern "C" { - #[doc = " Gets the system's host ID.\n # Returns\n\nThe system's host ID."] + #[doc = "Gets the system's host ID.\n # Returns\n\nThe system's host ID."] pub fn gethostid() -> ::libc::c_long; } extern "C" { @@ -14999,7 +14999,7 @@ extern "C" { pub fn SOCU_CloseSockets() -> ::libc::c_int; } extern "C" { - #[doc = " Retrieves information from the network configuration. Similar to getsockopt().\n # Arguments\n\n* `level` - Only value allowed seems to be SOL_CONFIG\n * `optname` - The option to be retrieved\n * `optval` - Will contain the output of the command\n * `optlen` - Size of the optval buffer, will be updated to hold the size of the output\n # Returns\n\n0 if successful. -1 if failed, and errno will be set accordingly. Can also return a system error code."] + #[doc = "Retrieves information from the network configuration. Similar to getsockopt().\n # Arguments\n\n* `level` - Only value allowed seems to be SOL_CONFIG\n * `optname` - The option to be retrieved\n * `optval` - Will contain the output of the command\n * `optlen` - Size of the optval buffer, will be updated to hold the size of the output\n # Returns\n\n0 if successful. -1 if failed, and errno will be set accordingly. Can also return a system error code."] pub fn SOCU_GetNetworkOpt( level: ::libc::c_int, optname: NetworkOpt, @@ -15008,7 +15008,7 @@ extern "C" { ) -> ::libc::c_int; } extern "C" { - #[doc = " Gets the system's IP address, netmask, and subnet broadcast\n # Returns\n\nerror"] + #[doc = "Gets the system's IP address, netmask, and subnet broadcast\n # Returns\n\nerror"] pub fn SOCU_GetIPInfo( ip: *mut in_addr, netmask: *mut in_addr, @@ -15016,7 +15016,7 @@ extern "C" { ) -> ::libc::c_int; } extern "C" { - #[doc = " Adds a global socket.\n # Arguments\n\n* `sockfd` - The socket fd.\n # Returns\n\nerror"] + #[doc = "Adds a global socket.\n # Arguments\n\n* `sockfd` - The socket fd.\n # Returns\n\nerror"] pub fn SOCU_AddGlobalSocket(sockfd: ::libc::c_int) -> ::libc::c_int; } #[doc = "< Unsigned 8-bit PCM."] @@ -15027,7 +15027,7 @@ pub const MICU_ENCODING_PCM16: MICU_Encoding = 1; pub const MICU_ENCODING_PCM8_SIGNED: MICU_Encoding = 2; #[doc = "< Signed 16-bit PCM."] pub const MICU_ENCODING_PCM16_SIGNED: MICU_Encoding = 3; -#[doc = " Microphone audio encodings."] +#[doc = "Microphone audio encodings."] pub type MICU_Encoding = ::libc::c_uint; #[doc = "< 32728.498 Hz"] pub const MICU_SAMPLE_RATE_32730: MICU_SampleRate = 0; @@ -15037,38 +15037,38 @@ pub const MICU_SAMPLE_RATE_16360: MICU_SampleRate = 1; pub const MICU_SAMPLE_RATE_10910: MICU_SampleRate = 2; #[doc = "< 8182.1245 Hz"] pub const MICU_SAMPLE_RATE_8180: MICU_SampleRate = 3; -#[doc = " Microphone audio sampling rates."] +#[doc = "Microphone audio sampling rates."] pub type MICU_SampleRate = ::libc::c_uint; extern "C" { #[must_use] - #[doc = " Initializes MIC.\n # Arguments\n\n* `size` - Shared memory buffer to write audio data to. Must be aligned to 0x1000 bytes.\n * `handle` - Size of the shared memory buffer."] + #[doc = "Initializes MIC.\n # Arguments\n\n* `size` - Shared memory buffer to write audio data to. Must be aligned to 0x1000 bytes.\n * `handle` - Size of the shared memory buffer."] pub fn micInit(buffer: *mut u8_, bufferSize: u32_) -> Result; } extern "C" { - #[doc = " Exits MIC."] + #[doc = "Exits MIC."] pub fn micExit(); } extern "C" { - #[doc = " Gets the size of the sample data area within the shared memory buffer.\n # Returns\n\nThe sample data's size."] + #[doc = "Gets the size of the sample data area within the shared memory buffer.\n # Returns\n\nThe sample data's size."] pub fn micGetSampleDataSize() -> u32_; } extern "C" { - #[doc = " Gets the offset within the shared memory buffer of the last sample written.\n # Returns\n\nThe last sample's offset."] + #[doc = "Gets the offset within the shared memory buffer of the last sample written.\n # Returns\n\nThe last sample's offset."] pub fn micGetLastSampleOffset() -> u32_; } extern "C" { #[must_use] - #[doc = " Maps MIC shared memory.\n # Arguments\n\n* `size` - Size of the shared memory.\n * `handle` - Handle of the shared memory."] + #[doc = "Maps MIC shared memory.\n # Arguments\n\n* `size` - Size of the shared memory.\n * `handle` - Handle of the shared memory."] pub fn MICU_MapSharedMem(size: u32_, handle: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Unmaps MIC shared memory."] + #[doc = "Unmaps MIC shared memory."] pub fn MICU_UnmapSharedMem() -> Result; } extern "C" { #[must_use] - #[doc = " Begins sampling microphone input.\n # Arguments\n\n* `encoding` - Encoding of outputted audio.\n * `sampleRate` - Sample rate of outputted audio.\n * `sharedMemAudioOffset` - Offset to write audio data to in the shared memory buffer.\n * `sharedMemAudioSize` - Size of audio data to write to the shared memory buffer. This should be at most \"bufferSize - 4\".\n * `loop` - Whether to loop back to the beginning of the buffer when the end is reached."] + #[doc = "Begins sampling microphone input.\n # Arguments\n\n* `encoding` - Encoding of outputted audio.\n * `sampleRate` - Sample rate of outputted audio.\n * `sharedMemAudioOffset` - Offset to write audio data to in the shared memory buffer.\n * `sharedMemAudioSize` - Size of audio data to write to the shared memory buffer. This should be at most \"bufferSize - 4\".\n * `loop` - Whether to loop back to the beginning of the buffer when the end is reached."] pub fn MICU_StartSampling( encoding: MICU_Encoding, sampleRate: MICU_SampleRate, @@ -15079,70 +15079,70 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Adjusts the configuration of the current sampling session.\n # Arguments\n\n* `sampleRate` - Sample rate of outputted audio."] + #[doc = "Adjusts the configuration of the current sampling session.\n # Arguments\n\n* `sampleRate` - Sample rate of outputted audio."] pub fn MICU_AdjustSampling(sampleRate: MICU_SampleRate) -> Result; } extern "C" { #[must_use] - #[doc = " Stops sampling microphone input."] + #[doc = "Stops sampling microphone input."] pub fn MICU_StopSampling() -> Result; } extern "C" { #[must_use] - #[doc = " Gets whether microphone input is currently being sampled.\n # Arguments\n\n* `sampling` - Pointer to output the sampling state to."] + #[doc = "Gets whether microphone input is currently being sampled.\n # Arguments\n\n* `sampling` - Pointer to output the sampling state to."] pub fn MICU_IsSampling(sampling: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Gets an event handle triggered when the shared memory buffer is full.\n # Arguments\n\n* `handle` - Pointer to output the event handle to."] + #[doc = "Gets an event handle triggered when the shared memory buffer is full.\n # Arguments\n\n* `handle` - Pointer to output the event handle to."] pub fn MICU_GetEventHandle(handle: *mut Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the microphone's gain.\n # Arguments\n\n* `gain` - Gain to set."] + #[doc = "Sets the microphone's gain.\n # Arguments\n\n* `gain` - Gain to set."] pub fn MICU_SetGain(gain: u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the microphone's gain.\n # Arguments\n\n* `gain` - Pointer to output the current gain to."] + #[doc = "Gets the microphone's gain.\n # Arguments\n\n* `gain` - Pointer to output the current gain to."] pub fn MICU_GetGain(gain: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Sets whether the microphone is powered on.\n # Arguments\n\n* `power` - Whether the microphone is powered on."] + #[doc = "Sets whether the microphone is powered on.\n # Arguments\n\n* `power` - Whether the microphone is powered on."] pub fn MICU_SetPower(power: bool) -> Result; } extern "C" { #[must_use] - #[doc = " Gets whether the microphone is powered on.\n # Arguments\n\n* `power` - Pointer to output the power state to."] + #[doc = "Gets whether the microphone is powered on.\n # Arguments\n\n* `power` - Pointer to output the power state to."] pub fn MICU_GetPower(power: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Sets whether to clamp microphone input.\n # Arguments\n\n* `clamp` - Whether to clamp microphone input."] + #[doc = "Sets whether to clamp microphone input.\n # Arguments\n\n* `clamp` - Whether to clamp microphone input."] pub fn MICU_SetClamp(clamp: bool) -> Result; } extern "C" { #[must_use] - #[doc = " Gets whether to clamp microphone input.\n # Arguments\n\n* `clamp` - Pointer to output the clamp state to."] + #[doc = "Gets whether to clamp microphone input.\n # Arguments\n\n* `clamp` - Pointer to output the clamp state to."] pub fn MICU_GetClamp(clamp: *mut bool) -> Result; } extern "C" { #[must_use] - #[doc = " Sets whether to allow sampling when the shell is closed.\n # Arguments\n\n* `allowShellClosed` - Whether to allow sampling when the shell is closed."] + #[doc = "Sets whether to allow sampling when the shell is closed.\n # Arguments\n\n* `allowShellClosed` - Whether to allow sampling when the shell is closed."] pub fn MICU_SetAllowShellClosed(allowShellClosed: bool) -> Result; } #[doc = "< Converting color formats."] pub const MVDMODE_COLORFORMATCONV: MVDSTD_Mode = 0; #[doc = "< Processing video."] pub const MVDMODE_VIDEOPROCESSING: MVDSTD_Mode = 1; -#[doc = " Processing mode."] +#[doc = "Processing mode."] pub type MVDSTD_Mode = ::libc::c_uint; #[doc = "< YUYV422"] pub const MVD_INPUT_YUYV422: MVDSTD_InputFormat = 65537; #[doc = "< H264"] pub const MVD_INPUT_H264: MVDSTD_InputFormat = 131073; -#[doc = " Input format."] +#[doc = "Input format."] pub type MVDSTD_InputFormat = ::libc::c_uint; #[doc = "< YUYV422"] pub const MVD_OUTPUT_YUYV422: MVDSTD_OutputFormat = 65537; @@ -15150,9 +15150,9 @@ pub const MVD_OUTPUT_YUYV422: MVDSTD_OutputFormat = 65537; pub const MVD_OUTPUT_BGR565: MVDSTD_OutputFormat = 262146; #[doc = "< RGB565"] pub const MVD_OUTPUT_RGB565: MVDSTD_OutputFormat = 262148; -#[doc = " Output format."] +#[doc = "Output format."] pub type MVDSTD_OutputFormat = ::libc::c_uint; -#[doc = " Processing configuration."] +#[doc = "Processing configuration."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct MVDSTD_Config { @@ -15256,7 +15256,7 @@ impl Default for MVDSTD_OutputBuffersEntryList { } } } -#[doc = " This can be used to override the default input values for MVDSTD commands during initialization with video-processing. The default for these fields are all-zero, except for cmd1b_inval which is 1. See also here: https://www.3dbrew.org/wiki/MVD_Services"] +#[doc = "This can be used to override the default input values for MVDSTD commands during initialization with video-processing. The default for these fields are all-zero, except for cmd1b_inval which is 1. See also here: https://www.3dbrew.org/wiki/MVD_Services"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct MVDSTD_InitStruct { @@ -15268,7 +15268,7 @@ pub struct MVDSTD_InitStruct { } extern "C" { #[must_use] - #[doc = " Initializes MVDSTD.\n # Arguments\n\n* `mode` - Mode to initialize MVDSTD to.\n * `input_type` - Type of input to process.\n * `output_type` - Type of output to produce.\n * `size` - Size of the work buffer, MVD_DEFAULT_WORKBUF_SIZE can be used for this. Only used when type == MVDMODE_VIDEOPROCESSING.\n * `initstruct` - Optional MVDSTD_InitStruct, this should be NULL normally."] + #[doc = "Initializes MVDSTD.\n # Arguments\n\n* `mode` - Mode to initialize MVDSTD to.\n * `input_type` - Type of input to process.\n * `output_type` - Type of output to produce.\n * `size` - Size of the work buffer, MVD_DEFAULT_WORKBUF_SIZE can be used for this. Only used when type == MVDMODE_VIDEOPROCESSING.\n * `initstruct` - Optional MVDSTD_InitStruct, this should be NULL normally."] pub fn mvdstdInit( mode: MVDSTD_Mode, input_type: MVDSTD_InputFormat, @@ -15278,11 +15278,11 @@ extern "C" { ) -> Result; } extern "C" { - #[doc = " Shuts down MVDSTD."] + #[doc = "Shuts down MVDSTD."] pub fn mvdstdExit(); } extern "C" { - #[doc = " Generates a default MVDSTD configuration.\n # Arguments\n\n* `config` - Pointer to output the generated config to.\n * `input_width` - Input width.\n * `input_height` - Input height.\n * `output_width` - Output width.\n * `output_height` - Output height.\n * `vaddr_colorconv_indata` - Virtual address of the color conversion input data.\n * `vaddr_outdata0` - Virtual address of the output data.\n * `vaddr_outdata1` - Additional virtual address for output data, only used when the output format type is value 0x00020001."] + #[doc = "Generates a default MVDSTD configuration.\n # Arguments\n\n* `config` - Pointer to output the generated config to.\n * `input_width` - Input width.\n * `input_height` - Input height.\n * `output_width` - Output width.\n * `output_height` - Output height.\n * `vaddr_colorconv_indata` - Virtual address of the color conversion input data.\n * `vaddr_outdata0` - Virtual address of the output data.\n * `vaddr_outdata1` - Additional virtual address for output data, only used when the output format type is value 0x00020001."] pub fn mvdstdGenerateDefaultConfig( config: *mut MVDSTD_Config, input_width: u32_, @@ -15296,12 +15296,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Run color-format-conversion.\n # Arguments\n\n* `config` - Pointer to the configuration to use."] + #[doc = "Run color-format-conversion.\n # Arguments\n\n* `config` - Pointer to the configuration to use."] pub fn mvdstdConvertImage(config: *mut MVDSTD_Config) -> Result; } extern "C" { #[must_use] - #[doc = " Processes a video frame(specifically a NAL-unit).\n # Arguments\n\n* `inbuf_vaddr` - Input NAL-unit starting with the 3-byte \"00 00 01\" prefix. Must be located in linearmem.\n * `size` - Size of the input buffer.\n * `flag` - See here regarding this input flag: https://www.3dbrew.org/wiki/MVDSTD:ProcessNALUnit\n * `out` - Optional output MVDSTD_ProcessNALUnitOut structure."] + #[doc = "Processes a video frame(specifically a NAL-unit).\n # Arguments\n\n* `inbuf_vaddr` - Input NAL-unit starting with the 3-byte \"00 00 01\" prefix. Must be located in linearmem.\n * `size` - Size of the input buffer.\n * `flag` - See here regarding this input flag: https://www.3dbrew.org/wiki/MVDSTD:ProcessNALUnit\n * `out` - Optional output MVDSTD_ProcessNALUnitOut structure."] pub fn mvdstdProcessVideoFrame( inbuf_vaddr: *mut ::libc::c_void, size: usize, @@ -15311,17 +15311,17 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Renders the video frame.\n # Arguments\n\n* `config` - Optional pointer to the configuration to use. When NULL, MVDSTD_SetConfig() should have been used previously for this video.\n * `wait` - When true, wait for rendering to finish. When false, you can manually call this function repeatedly until it stops returning MVD_STATUS_BUSY."] + #[doc = "Renders the video frame.\n # Arguments\n\n* `config` - Optional pointer to the configuration to use. When NULL, MVDSTD_SetConfig() should have been used previously for this video.\n * `wait` - When true, wait for rendering to finish. When false, you can manually call this function repeatedly until it stops returning MVD_STATUS_BUSY."] pub fn mvdstdRenderVideoFrame(config: *mut MVDSTD_Config, wait: bool) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the current configuration of MVDSTD.\n # Arguments\n\n* `config` - Pointer to the configuration to set."] + #[doc = "Sets the current configuration of MVDSTD.\n # Arguments\n\n* `config` - Pointer to the configuration to set."] pub fn MVDSTD_SetConfig(config: *mut MVDSTD_Config) -> Result; } extern "C" { #[must_use] - #[doc = " New3DS Internet Browser doesn't use this. Once done, rendered frames will be written to the output buffers specified by the entrylist instead of the output specified by configuration. See here: https://www.3dbrew.org/wiki/MVDSTD:SetupOutputBuffers\n # Arguments\n\n* `entrylist` - Input entrylist.\n * `bufsize` - Size of each buffer from the entrylist."] + #[doc = "New3DS Internet Browser doesn't use this. Once done, rendered frames will be written to the output buffers specified by the entrylist instead of the output specified by configuration. See here: https://www.3dbrew.org/wiki/MVDSTD:SetupOutputBuffers\n # Arguments\n\n* `entrylist` - Input entrylist.\n * `bufsize` - Size of each buffer from the entrylist."] pub fn mvdstdSetupOutputBuffers( entrylist: *mut MVDSTD_OutputBuffersEntryList, bufsize: u32_, @@ -15329,7 +15329,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " New3DS Internet Browser doesn't use this. This overrides the entry0 output buffers originally setup by mvdstdSetupOutputBuffers(). See also here: https://www.3dbrew.org/wiki/MVDSTD:OverrideOutputBuffers\n # Arguments\n\n* `cur_outdata0` - Linearmem vaddr. The current outdata0 for this entry must match this value.\n * `cur_outdata1` - Linearmem vaddr. The current outdata1 for this entry must match this value.\n * `new_outdata0` - Linearmem vaddr. This is the new address to use for outaddr0.\n * `new_outdata1` - Linearmem vaddr. This is the new address to use for outaddr1."] + #[doc = "New3DS Internet Browser doesn't use this. This overrides the entry0 output buffers originally setup by mvdstdSetupOutputBuffers(). See also here: https://www.3dbrew.org/wiki/MVDSTD:OverrideOutputBuffers\n # Arguments\n\n* `cur_outdata0` - Linearmem vaddr. The current outdata0 for this entry must match this value.\n * `cur_outdata1` - Linearmem vaddr. The current outdata1 for this entry must match this value.\n * `new_outdata0` - Linearmem vaddr. This is the new address to use for outaddr0.\n * `new_outdata1` - Linearmem vaddr. This is the new address to use for outaddr1."] pub fn mvdstdOverrideOutputBuffers( cur_outdata0: *mut ::libc::c_void, cur_outdata1: *mut ::libc::c_void, @@ -15338,34 +15338,34 @@ extern "C" { ) -> Result; } pub const NFC_OpType_1: NFC_OpType = 1; -#[doc = " Unknown."] +#[doc = "Unknown."] pub const NFC_OpType_NFCTag: NFC_OpType = 2; -#[doc = " This is the default."] +#[doc = "This is the default."] pub const NFC_OpType_RawNFC: NFC_OpType = 3; -#[doc = " NFC operation type."] +#[doc = "NFC operation type."] pub type NFC_OpType = ::libc::c_uint; pub const NFC_TagState_Uninitialized: NFC_TagState = 0; -#[doc = " nfcInit() was not used yet."] +#[doc = "nfcInit() was not used yet."] pub const NFC_TagState_ScanningStopped: NFC_TagState = 1; -#[doc = " Not currently scanning for NFC tags. Set by nfcStopScanning() and nfcInit(), when successful."] +#[doc = "Not currently scanning for NFC tags. Set by nfcStopScanning() and nfcInit(), when successful."] pub const NFC_TagState_Scanning: NFC_TagState = 2; -#[doc = " Currently scanning for NFC tags. Set by nfcStartScanning() when successful."] +#[doc = "Currently scanning for NFC tags. Set by nfcStartScanning() when successful."] pub const NFC_TagState_InRange: NFC_TagState = 3; -#[doc = " NFC tag is in range. The state automatically changes to this when the state was previously value 2, without using any NFC service commands."] +#[doc = "NFC tag is in range. The state automatically changes to this when the state was previously value 2, without using any NFC service commands."] pub const NFC_TagState_OutOfRange: NFC_TagState = 4; -#[doc = " NFC tag is now out of range, where the NFC tag was previously in range. This occurs automatically without using any NFC service commands. Once this state is entered, it won't automatically change to anything else when the tag is moved in range again. Hence, if you want to keep doing tag scanning after this, you must stop+start scanning."] +#[doc = "NFC tag is now out of range, where the NFC tag was previously in range. This occurs automatically without using any NFC service commands. Once this state is entered, it won't automatically change to anything else when the tag is moved in range again. Hence, if you want to keep doing tag scanning after this, you must stop+start scanning."] pub const NFC_TagState_DataReady: NFC_TagState = 5; pub type NFC_TagState = ::libc::c_uint; pub const NFC_amiiboFlag_Setup: _bindgen_ty_28 = 16; -#[doc = " This indicates that the amiibo was setup with amiibo Settings. nfcGetAmiiboSettings() will return an all-zero struct when this is not set."] +#[doc = "This indicates that the amiibo was setup with amiibo Settings. nfcGetAmiiboSettings() will return an all-zero struct when this is not set."] pub const NFC_amiiboFlag_AppDataSetup: _bindgen_ty_28 = 32; -#[doc = " Bit4-7 are always clear with nfcGetAmiiboSettings() due to \"& 0xF\"."] +#[doc = "Bit4-7 are always clear with nfcGetAmiiboSettings() due to \"& 0xF\"."] pub type _bindgen_ty_28 = ::libc::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct NFC_TagInfo { pub id_offset_size: u16_, - #[doc = " \"u16 size/offset of the below ID data. Normally this is 0x7. When this is <=10, this field is the size of the below ID data. When this is >10, this is the offset of the 10-byte ID data, relative to structstart+4+. It's unknown in what cases this 10-byte ID data is used.\""] + #[doc = "\"u16 size/offset of the below ID data. Normally this is 0x7. When this is <=10, this field is the size of the below ID data. When this is >10, this is the offset of the 10-byte ID data, relative to structstart+4+. It's unknown in what cases this 10-byte ID data is used.\""] pub unk_x2: u8_, pub unk_x3: u8_, pub id: [u8_; 40usize], @@ -15379,18 +15379,18 @@ impl Default for NFC_TagInfo { } } } -#[doc = " AmiiboSettings structure, see also here: https://3dbrew.org/wiki/NFC:GetAmiiboSettings"] +#[doc = "AmiiboSettings structure, see also here: https://3dbrew.org/wiki/NFC:GetAmiiboSettings"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct NFC_AmiiboSettings { pub mii: [u8_; 96usize], - #[doc = " \"Owner Mii.\""] + #[doc = "\"Owner Mii.\""] pub nickname: [u16_; 11usize], - #[doc = " \"UTF-16BE Amiibo nickname.\""] + #[doc = "\"UTF-16BE Amiibo nickname.\""] pub flags: u8_, - #[doc = " \"This is plaintext_amiibosettingsdata[0] & 0xF.\" See also the NFC_amiiboFlag enums."] + #[doc = "\"This is plaintext_amiibosettingsdata[0] & 0xF.\" See also the NFC_amiiboFlag enums."] pub countrycodeid: u8_, - #[doc = " \"This is plaintext_amiibosettingsdata[1].\" \"Country Code ID, from the system which setup this amiibo.\""] + #[doc = "\"This is plaintext_amiibosettingsdata[1].\" \"Country Code ID, from the system which setup this amiibo.\""] pub setupdate_year: u16_, pub setupdate_month: u8_, pub setupdate_day: u8_, @@ -15405,7 +15405,7 @@ impl Default for NFC_AmiiboSettings { } } } -#[doc = " AmiiboConfig structure, see also here: https://3dbrew.org/wiki/NFC:GetAmiiboConfig"] +#[doc = "AmiiboConfig structure, see also here: https://3dbrew.org/wiki/NFC:GetAmiiboConfig"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct NFC_AmiiboConfig { @@ -15414,16 +15414,16 @@ pub struct NFC_AmiiboConfig { pub lastwritedate_day: u8_, pub write_counter: u16_, pub characterID: [u8_; 3usize], - #[doc = " the first element is the collection ID, the second the character in this collection, the third the variant"] + #[doc = "the first element is the collection ID, the second the character in this collection, the third the variant"] pub series: u8_, - #[doc = " ID of the series"] + #[doc = "ID of the series"] pub amiiboID: u16_, - #[doc = " ID shared by all exact same amiibo. Some amiibo are only distinguished by this one like regular SMB Series Mario and the gold one"] + #[doc = "ID shared by all exact same amiibo. Some amiibo are only distinguished by this one like regular SMB Series Mario and the gold one"] pub type_: u8_, - #[doc = " Type of amiibo 0 = figure, 1 = card, 2 = plush"] + #[doc = "Type of amiibo 0 = figure, 1 = card, 2 = plush"] pub pagex4_byte3: u8_, pub appdata_size: u16_, - #[doc = " \"NFC module writes hard-coded u8 value 0xD8 here. This is the size of the Amiibo AppData, apps can use this with the AppData R/W commands. ...\""] + #[doc = "\"NFC module writes hard-coded u8 value 0xD8 here. This is the size of the Amiibo AppData, apps can use this with the AppData R/W commands. ...\""] pub zeros: [u8_; 48usize], } impl Default for NFC_AmiiboConfig { @@ -15435,7 +15435,7 @@ impl Default for NFC_AmiiboConfig { } } } -#[doc = " Used by nfcInitializeWriteAppData() internally, see also here: https://3dbrew.org/wiki/NFC:GetAppDataInitStruct"] +#[doc = "Used by nfcInitializeWriteAppData() internally, see also here: https://3dbrew.org/wiki/NFC:GetAppDataInitStruct"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct NFC_AppDataInitStruct { @@ -15451,7 +15451,7 @@ impl Default for NFC_AppDataInitStruct { } } } -#[doc = " Used by nfcWriteAppData() internally, see also: https://3dbrew.org/wiki/NFC:WriteAppData"] +#[doc = "Used by nfcWriteAppData() internally, see also: https://3dbrew.org/wiki/NFC:WriteAppData"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct NFC_AppDataWriteStruct { @@ -15461,59 +15461,59 @@ pub struct NFC_AppDataWriteStruct { } extern "C" { #[must_use] - #[doc = " Initializes NFC.\n # Arguments\n\n* `type` - See the NFC_OpType enum."] + #[doc = "Initializes NFC.\n # Arguments\n\n* `type` - See the NFC_OpType enum."] pub fn nfcInit(type_: NFC_OpType) -> Result; } extern "C" { - #[doc = " Shuts down NFC."] + #[doc = "Shuts down NFC."] pub fn nfcExit(); } extern "C" { - #[doc = " Gets the NFC service handle.\n # Returns\n\nThe NFC service handle."] + #[doc = "Gets the NFC service handle.\n # Returns\n\nThe NFC service handle."] pub fn nfcGetSessionHandle() -> Handle; } extern "C" { #[must_use] - #[doc = " Starts scanning for NFC tags.\n # Arguments\n\n* `inval` - Unknown. See NFC_STARTSCAN_DEFAULTINPUT."] + #[doc = "Starts scanning for NFC tags.\n # Arguments\n\n* `inval` - Unknown. See NFC_STARTSCAN_DEFAULTINPUT."] pub fn nfcStartScanning(inval: u16_) -> Result; } extern "C" { - #[doc = " Stops scanning for NFC tags."] + #[doc = "Stops scanning for NFC tags."] pub fn nfcStopScanning(); } extern "C" { #[must_use] - #[doc = " Read amiibo NFC data and load in memory."] + #[doc = "Read amiibo NFC data and load in memory."] pub fn nfcLoadAmiiboData() -> Result; } extern "C" { #[must_use] - #[doc = " If the tagstate is valid(NFC_TagState_DataReady or 6), it then sets the current tagstate to NFC_TagState_InRange."] + #[doc = "If the tagstate is valid(NFC_TagState_DataReady or 6), it then sets the current tagstate to NFC_TagState_InRange."] pub fn nfcResetTagScanState() -> Result; } extern "C" { #[must_use] - #[doc = " This writes the amiibo data stored in memory to the actual amiibo data storage(which is normally the NFC data pages). This can only be used if NFC_LoadAmiiboData() was used previously."] + #[doc = "This writes the amiibo data stored in memory to the actual amiibo data storage(which is normally the NFC data pages). This can only be used if NFC_LoadAmiiboData() was used previously."] pub fn nfcUpdateStoredAmiiboData() -> Result; } extern "C" { #[must_use] - #[doc = " Returns the current NFC tag state.\n # Arguments\n\n* `state` - Pointer to write NFC tag state."] + #[doc = "Returns the current NFC tag state.\n # Arguments\n\n* `state` - Pointer to write NFC tag state."] pub fn nfcGetTagState(state: *mut NFC_TagState) -> Result; } extern "C" { #[must_use] - #[doc = " Returns the current TagInfo.\n # Arguments\n\n* `out` - Pointer to write the output TagInfo."] + #[doc = "Returns the current TagInfo.\n # Arguments\n\n* `out` - Pointer to write the output TagInfo."] pub fn nfcGetTagInfo(out: *mut NFC_TagInfo) -> Result; } extern "C" { #[must_use] - #[doc = " Opens the appdata, when the amiibo appdata was previously initialized. This must be used before reading/writing the appdata. See also: https://3dbrew.org/wiki/NFC:OpenAppData\n # Arguments\n\n* `amiibo_appid` - Amiibo AppID. See here: https://www.3dbrew.org/wiki/Amiibo"] + #[doc = "Opens the appdata, when the amiibo appdata was previously initialized. This must be used before reading/writing the appdata. See also: https://3dbrew.org/wiki/NFC:OpenAppData\n # Arguments\n\n* `amiibo_appid` - Amiibo AppID. See here: https://www.3dbrew.org/wiki/Amiibo"] pub fn nfcOpenAppData(amiibo_appid: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " This initializes the appdata using the specified input, when the appdata previously wasn't initialized. If the appdata is already initialized, you must first use the amiibo Settings applet menu option labeled \"Delete amiibo Game Data\". This automatically writes the amiibo data into the actual data storage(normally NFC data pages). See also nfcWriteAppData().\n # Arguments\n\n* `amiibo_appid` - amiibo AppID. See also nfcOpenAppData().\n * `buf` - Input buffer.\n * `size` - Buffer size."] + #[doc = "This initializes the appdata using the specified input, when the appdata previously wasn't initialized. If the appdata is already initialized, you must first use the amiibo Settings applet menu option labeled \"Delete amiibo Game Data\". This automatically writes the amiibo data into the actual data storage(normally NFC data pages). See also nfcWriteAppData().\n # Arguments\n\n* `amiibo_appid` - amiibo AppID. See also nfcOpenAppData().\n * `buf` - Input buffer.\n * `size` - Buffer size."] pub fn nfcInitializeWriteAppData( amiibo_appid: u32_, buf: *const ::libc::c_void, @@ -15522,12 +15522,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Reads the appdata. The size must be >=0xD8-bytes, but the actual used size is hard-coded to 0xD8. Note that areas of appdata which were never written to by applications are uninitialized in this output buffer.\n # Arguments\n\n* `buf` - Output buffer.\n * `size` - Buffer size."] + #[doc = "Reads the appdata. The size must be >=0xD8-bytes, but the actual used size is hard-coded to 0xD8. Note that areas of appdata which were never written to by applications are uninitialized in this output buffer.\n # Arguments\n\n* `buf` - Output buffer.\n * `size` - Buffer size."] pub fn nfcReadAppData(buf: *mut ::libc::c_void, size: usize) -> Result; } extern "C" { #[must_use] - #[doc = " Writes the appdata, after nfcOpenAppData() was used successfully. The size should be <=0xD8-bytes. See also: https://3dbrew.org/wiki/NFC:WriteAppData\n # Arguments\n\n* `buf` - Input buffer.\n * `size` - Buffer size.\n * `taginfo` - TagInfo from nfcGetTagInfo()."] + #[doc = "Writes the appdata, after nfcOpenAppData() was used successfully. The size should be <=0xD8-bytes. See also: https://3dbrew.org/wiki/NFC:WriteAppData\n # Arguments\n\n* `buf` - Input buffer.\n * `size` - Buffer size.\n * `taginfo` - TagInfo from nfcGetTagInfo()."] pub fn nfcWriteAppData( buf: *const ::libc::c_void, size: usize, @@ -15536,22 +15536,22 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Returns the current AmiiboSettings.\n # Arguments\n\n* `out` - Pointer to write the output AmiiboSettings."] + #[doc = "Returns the current AmiiboSettings.\n # Arguments\n\n* `out` - Pointer to write the output AmiiboSettings."] pub fn nfcGetAmiiboSettings(out: *mut NFC_AmiiboSettings) -> Result; } extern "C" { #[must_use] - #[doc = " Returns the current AmiiboConfig.\n # Arguments\n\n* `out` - Pointer to write the output AmiiboConfig."] + #[doc = "Returns the current AmiiboConfig.\n # Arguments\n\n* `out` - Pointer to write the output AmiiboConfig."] pub fn nfcGetAmiiboConfig(out: *mut NFC_AmiiboConfig) -> Result; } extern "C" { #[must_use] - #[doc = " Starts scanning for NFC tags when initialized with NFC_OpType_RawNFC. See also: https://www.3dbrew.org/wiki/NFC:StartOtherTagScanning\n # Arguments\n\n* `unk0` - Same as nfcStartScanning() input.\n * `unk1` - Unknown."] + #[doc = "Starts scanning for NFC tags when initialized with NFC_OpType_RawNFC. See also: https://www.3dbrew.org/wiki/NFC:StartOtherTagScanning\n # Arguments\n\n* `unk0` - Same as nfcStartScanning() input.\n * `unk1` - Unknown."] pub fn nfcStartOtherTagScanning(unk0: u16_, unk1: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " This sends a raw NFC command to the tag. This can only be used when initialized with NFC_OpType_RawNFC, and when the TagState is NFC_TagState_InRange. See also: https://www.3dbrew.org/wiki/NFC:SendTagCommand\n # Arguments\n\n* `inbuf` - Input buffer.\n * `insize` - Size of the input buffer.\n * `outbuf` - Output buffer.\n * `outsize` - Size of the output buffer.\n * `actual_transfer_size` - Optional output ptr to write the actual output-size to, can be NULL.\n * `microseconds` - Timing-related field in microseconds."] + #[doc = "This sends a raw NFC command to the tag. This can only be used when initialized with NFC_OpType_RawNFC, and when the TagState is NFC_TagState_InRange. See also: https://www.3dbrew.org/wiki/NFC:SendTagCommand\n # Arguments\n\n* `inbuf` - Input buffer.\n * `insize` - Size of the input buffer.\n * `outbuf` - Output buffer.\n * `outsize` - Size of the output buffer.\n * `actual_transfer_size` - Optional output ptr to write the actual output-size to, can be NULL.\n * `microseconds` - Timing-related field in microseconds."] pub fn nfcSendTagCommand( inbuf: *const ::libc::c_void, insize: usize, @@ -15563,15 +15563,15 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Unknown. This can only be used when initialized with NFC_OpType_RawNFC, and when the TagState is NFC_TagState_InRange."] + #[doc = "Unknown. This can only be used when initialized with NFC_OpType_RawNFC, and when the TagState is NFC_TagState_InRange."] pub fn nfcCmd21() -> Result; } extern "C" { #[must_use] - #[doc = " Unknown. This can only be used when initialized with NFC_OpType_RawNFC, and when the TagState is NFC_TagState_InRange."] + #[doc = "Unknown. This can only be used when initialized with NFC_OpType_RawNFC, and when the TagState is NFC_TagState_InRange."] pub fn nfcCmd22() -> Result; } -#[doc = " Notification header data."] +#[doc = "Notification header data."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct NotificationHeader { @@ -15590,16 +15590,16 @@ pub struct NotificationHeader { } extern "C" { #[must_use] - #[doc = " Initializes NEWS."] + #[doc = "Initializes NEWS."] pub fn newsInit() -> Result; } extern "C" { - #[doc = " Exits NEWS."] + #[doc = "Exits NEWS."] pub fn newsExit(); } extern "C" { #[must_use] - #[doc = " Adds a notification to the home menu Notifications applet.\n # Arguments\n\n* `title` - UTF-16 title of the notification.\n * `titleLength` - Number of characters in the title, not including the null-terminator.\n * `message` - UTF-16 message of the notification, or NULL for no message.\n * `messageLength` - Number of characters in the message, not including the null-terminator.\n * `image` - Data of the image to show in the notification, or NULL for no image.\n * `imageSize` - Size of the image data in bytes.\n * `jpeg` - Whether the image is a JPEG or not."] + #[doc = "Adds a notification to the home menu Notifications applet.\n # Arguments\n\n* `title` - UTF-16 title of the notification.\n * `titleLength` - Number of characters in the title, not including the null-terminator.\n * `message` - UTF-16 message of the notification, or NULL for no message.\n * `messageLength` - Number of characters in the message, not including the null-terminator.\n * `image` - Data of the image to show in the notification, or NULL for no image.\n * `imageSize` - Size of the image data in bytes.\n * `jpeg` - Whether the image is a JPEG or not."] pub fn NEWS_AddNotification( title: *const u16_, titleLength: u32_, @@ -15612,27 +15612,27 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets current total notifications number.\n # Arguments\n\n* `num` - Pointer where total number will be saved."] + #[doc = "Gets current total notifications number.\n # Arguments\n\n* `num` - Pointer where total number will be saved."] pub fn NEWS_GetTotalNotifications(num: *mut u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Sets a custom header for a specific notification.\n # Arguments\n\n* `news_id` - Identification number of the notification.\n * `header` - Pointer to notification header to set."] + #[doc = "Sets a custom header for a specific notification.\n # Arguments\n\n* `news_id` - Identification number of the notification.\n * `header` - Pointer to notification header to set."] pub fn NEWS_SetNotificationHeader(news_id: u32_, header: *const NotificationHeader) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the header of a specific notification.\n # Arguments\n\n* `news_id` - Identification number of the notification.\n * `header` - Pointer where header of the notification will be saved."] + #[doc = "Gets the header of a specific notification.\n # Arguments\n\n* `news_id` - Identification number of the notification.\n * `header` - Pointer where header of the notification will be saved."] pub fn NEWS_GetNotificationHeader(news_id: u32_, header: *mut NotificationHeader) -> Result; } extern "C" { #[must_use] - #[doc = " Sets a custom message for a specific notification.\n # Arguments\n\n* `news_id` - Identification number of the notification.\n * `message` - Pointer to UTF-16 message to set.\n * `size` - Size of message to set."] + #[doc = "Sets a custom message for a specific notification.\n # Arguments\n\n* `news_id` - Identification number of the notification.\n * `message` - Pointer to UTF-16 message to set.\n * `size` - Size of message to set."] pub fn NEWS_SetNotificationMessage(news_id: u32_, message: *const u16_, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the message of a specific notification.\n # Arguments\n\n* `news_id` - Identification number of the notification.\n * `message` - Pointer where UTF-16 message of the notification will be saved.\n * `size` - Pointer where size of the message data will be saved in bytes."] + #[doc = "Gets the message of a specific notification.\n # Arguments\n\n* `news_id` - Identification number of the notification.\n * `message` - Pointer where UTF-16 message of the notification will be saved.\n * `size` - Pointer where size of the message data will be saved in bytes."] pub fn NEWS_GetNotificationMessage( news_id: u32_, message: *mut u16_, @@ -15641,7 +15641,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Sets a custom image for a specific notification.\n # Arguments\n\n* `news_id` - Identification number of the notification.\n * `buffer` - Pointer to MPO image to set.\n * `size` - Size of the MPO image to set."] + #[doc = "Sets a custom image for a specific notification.\n # Arguments\n\n* `news_id` - Identification number of the notification.\n * `buffer` - Pointer to MPO image to set.\n * `size` - Size of the MPO image to set."] pub fn NEWS_SetNotificationImage( news_id: u32_, buffer: *const ::libc::c_void, @@ -15650,14 +15650,14 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets the image of a specific notification.\n # Arguments\n\n* `news_id` - Identification number of the notification.\n * `buffer` - Pointer where MPO image of the notification will be saved.\n * `size` - Pointer where size of the image data will be saved in bytes."] + #[doc = "Gets the image of a specific notification.\n # Arguments\n\n* `news_id` - Identification number of the notification.\n * `buffer` - Pointer where MPO image of the notification will be saved.\n * `size` - Pointer where size of the image data will be saved in bytes."] pub fn NEWS_GetNotificationImage( news_id: u32_, buffer: *mut ::libc::c_void, size: *mut u32_, ) -> Result; } -#[doc = " Head tracking coordinate pair."] +#[doc = "Head tracking coordinate pair."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct QTM_HeadTrackingInfoCoord { @@ -15666,7 +15666,7 @@ pub struct QTM_HeadTrackingInfoCoord { #[doc = "< Y coordinate."] pub y: f32, } -#[doc = " Head tracking info."] +#[doc = "Head tracking info."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct QTM_HeadTrackingInfo { @@ -15683,24 +15683,24 @@ pub struct QTM_HeadTrackingInfo { } extern "C" { #[must_use] - #[doc = " Initializes QTM."] + #[doc = "Initializes QTM."] pub fn qtmInit() -> Result; } extern "C" { - #[doc = " Exits QTM."] + #[doc = "Exits QTM."] pub fn qtmExit(); } extern "C" { - #[doc = " Checks whether QTM is initialized.\n # Returns\n\nWhether QTM is initialized."] + #[doc = "Checks whether QTM is initialized.\n # Returns\n\nWhether QTM is initialized."] pub fn qtmCheckInitialized() -> bool; } extern "C" { - #[doc = " Checks whether a head is fully detected.\n # Arguments\n\n* `info` - Tracking info to check."] + #[doc = "Checks whether a head is fully detected.\n # Arguments\n\n* `info` - Tracking info to check."] pub fn qtmCheckHeadFullyDetected(info: *mut QTM_HeadTrackingInfo) -> bool; } extern "C" { #[must_use] - #[doc = " Converts QTM coordinates to screen coordinates.\n # Arguments\n\n* `coord` - Coordinates to convert.\n * `screen_width` - Width of the screen. Can be NULL to use the default value for the top screen.\n * `screen_height` - Height of the screen. Can be NULL to use the default value for the top screen.\n * `x` - Pointer to output the screen X coordinate to.\n * `y` - Pointer to output the screen Y coordinate to."] + #[doc = "Converts QTM coordinates to screen coordinates.\n # Arguments\n\n* `coord` - Coordinates to convert.\n * `screen_width` - Width of the screen. Can be NULL to use the default value for the top screen.\n * `screen_height` - Height of the screen. Can be NULL to use the default value for the top screen.\n * `x` - Pointer to output the screen X coordinate to.\n * `y` - Pointer to output the screen Y coordinate to."] pub fn qtmConvertCoordToScreen( coord: *mut QTM_HeadTrackingInfoCoord, screen_width: *mut f32, @@ -15711,35 +15711,35 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets the current head tracking info.\n # Arguments\n\n* `val` - Normally 0.\n * `out` - Pointer to write head tracking info to."] + #[doc = "Gets the current head tracking info.\n # Arguments\n\n* `val` - Normally 0.\n * `out` - Pointer to write head tracking info to."] pub fn QTM_GetHeadTrackingInfo(val: u64_, out: *mut QTM_HeadTrackingInfo) -> Result; } extern "C" { #[must_use] - #[doc = " Initializes srv:pm and the service API."] + #[doc = "Initializes srv:pm and the service API."] pub fn srvPmInit() -> Result; } extern "C" { - #[doc = " Exits srv:pm and the service API."] + #[doc = "Exits srv:pm and the service API."] pub fn srvPmExit(); } extern "C" { - #[doc = " Gets the current srv:pm session handle.\n # Returns\n\nThe current srv:pm session handle."] + #[doc = "Gets the current srv:pm session handle.\n # Returns\n\nThe current srv:pm session handle."] pub fn srvPmGetSessionHandle() -> *mut Handle; } extern "C" { #[must_use] - #[doc = " Publishes a notification to a process.\n # Arguments\n\n* `notificationId` - ID of the notification.\n * `process` - Process to publish to."] + #[doc = "Publishes a notification to a process.\n # Arguments\n\n* `notificationId` - ID of the notification.\n * `process` - Process to publish to."] pub fn SRVPM_PublishToProcess(notificationId: u32_, process: Handle) -> Result; } extern "C" { #[must_use] - #[doc = " Publishes a notification to all processes.\n # Arguments\n\n* `notificationId` - ID of the notification."] + #[doc = "Publishes a notification to all processes.\n # Arguments\n\n* `notificationId` - ID of the notification."] pub fn SRVPM_PublishToAll(notificationId: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Registers a process with SRV.\n # Arguments\n\n* `pid` - ID of the process.\n * `count` - Number of services within the service access control data.\n * `serviceAccessControlList` - Service Access Control list."] + #[doc = "Registers a process with SRV.\n # Arguments\n\n* `pid` - ID of the process.\n * `count` - Number of services within the service access control data.\n * `serviceAccessControlList` - Service Access Control list."] pub fn SRVPM_RegisterProcess( pid: u32_, count: u32_, @@ -15748,26 +15748,26 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Unregisters a process with SRV.\n # Arguments\n\n* `pid` - ID of the process."] + #[doc = "Unregisters a process with SRV.\n # Arguments\n\n* `pid` - ID of the process."] pub fn SRVPM_UnregisterProcess(pid: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Initializes LOADER."] + #[doc = "Initializes LOADER."] pub fn loaderInit() -> Result; } extern "C" { - #[doc = " Exits LOADER."] + #[doc = "Exits LOADER."] pub fn loaderExit(); } extern "C" { #[must_use] - #[doc = " Loads a program and returns a process handle to the newly created process.\n # Arguments\n\n* `process` (direction out) - Pointer to output the process handle to.\n * `programHandle` - The handle of the program to load."] + #[doc = "Loads a program and returns a process handle to the newly created process.\n # Arguments\n\n* `process` (direction out) - Pointer to output the process handle to.\n * `programHandle` - The handle of the program to load."] pub fn LOADER_LoadProcess(process: *mut Handle, programHandle: u64_) -> Result; } extern "C" { #[must_use] - #[doc = " Registers a program (along with its update).\n # Arguments\n\n* `programHandle` (direction out) - Pointer to output the program handle to.\n * `programInfo` - The program info.\n * `programInfo` - The program update info."] + #[doc = "Registers a program (along with its update).\n # Arguments\n\n* `programHandle` (direction out) - Pointer to output the program handle to.\n * `programInfo` - The program info.\n * `programInfo` - The program update info."] pub fn LOADER_RegisterProgram( programHandle: *mut u64_, programInfo: *const FS_ProgramInfo, @@ -15776,12 +15776,12 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Unregisters a program (along with its update).\n # Arguments\n\n* `programHandle` - The handle of the program to unregister."] + #[doc = "Unregisters a program (along with its update).\n # Arguments\n\n* `programHandle` - The handle of the program to unregister."] pub fn LOADER_UnregisterProgram(programHandle: u64_) -> Result; } extern "C" { #[must_use] - #[doc = " Retrives a program's main NCCH extended header info (SCI + ACI, see ExHeader_Info).\n # Arguments\n\n* `exheaderInfo` (direction out) - Pointer to output the main NCCH extended header info.\n * `programHandle` - The handle of the program to unregister"] + #[doc = "Retrives a program's main NCCH extended header info (SCI + ACI, see ExHeader_Info).\n # Arguments\n\n* `exheaderInfo` (direction out) - Pointer to output the main NCCH extended header info.\n * `programHandle` - The handle of the program to unregister"] pub fn LOADER_GetProgramInfo(exheaderInfo: *mut ExHeader_Info, programHandle: u64_) -> Result; } #[doc = "< The normal mode of the led"] @@ -15799,89 +15799,89 @@ pub const LED_BLINK_RED: powerLedState = 6; pub type powerLedState = ::libc::c_uint; extern "C" { #[must_use] - #[doc = " Initializes mcuHwc."] + #[doc = "Initializes mcuHwc."] pub fn mcuHwcInit() -> Result; } extern "C" { - #[doc = " Exits mcuHwc."] + #[doc = "Exits mcuHwc."] pub fn mcuHwcExit(); } extern "C" { - #[doc = " Gets the current mcuHwc session handle.\n # Returns\n\nA pointer to the current mcuHwc session handle."] + #[doc = "Gets the current mcuHwc session handle.\n # Returns\n\nA pointer to the current mcuHwc session handle."] pub fn mcuHwcGetSessionHandle() -> *mut Handle; } extern "C" { #[must_use] - #[doc = " Reads data from an i2c device3 register\n # Arguments\n\n* `reg` - Register number. See https://www.3dbrew.org/wiki/I2C_Registers#Device_3 for more info\n * `data` - Pointer to write the data to.\n * `size` - Size of data to be read"] + #[doc = "Reads data from an i2c device3 register\n # Arguments\n\n* `reg` - Register number. See https://www.3dbrew.org/wiki/I2C_Registers#Device_3 for more info\n * `data` - Pointer to write the data to.\n * `size` - Size of data to be read"] pub fn MCUHWC_ReadRegister(reg: u8_, data: *mut ::libc::c_void, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Writes data to a i2c device3 register\n # Arguments\n\n* `reg` - Register number. See https://www.3dbrew.org/wiki/I2C_Registers#Device_3 for more info\n * `data` - Pointer to write the data to.\n * `size` - Size of data to be written"] + #[doc = "Writes data to a i2c device3 register\n # Arguments\n\n* `reg` - Register number. See https://www.3dbrew.org/wiki/I2C_Registers#Device_3 for more info\n * `data` - Pointer to write the data to.\n * `size` - Size of data to be written"] pub fn MCUHWC_WriteRegister(reg: u8_, data: *const ::libc::c_void, size: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the battery voltage\n # Arguments\n\n* `voltage` - Pointer to write the battery voltage to."] + #[doc = "Gets the battery voltage\n # Arguments\n\n* `voltage` - Pointer to write the battery voltage to."] pub fn MCUHWC_GetBatteryVoltage(voltage: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the battery level\n # Arguments\n\n* `level` - Pointer to write the current battery level to."] + #[doc = "Gets the battery level\n # Arguments\n\n* `level` - Pointer to write the current battery level to."] pub fn MCUHWC_GetBatteryLevel(level: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the sound slider level\n # Arguments\n\n* `level` - Pointer to write the slider level to."] + #[doc = "Gets the sound slider level\n # Arguments\n\n* `level` - Pointer to write the slider level to."] pub fn MCUHWC_GetSoundSliderLevel(level: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Sets Wifi LED state\n # Arguments\n\n* `state` - State of Wifi LED. (True/False)"] + #[doc = "Sets Wifi LED state\n # Arguments\n\n* `state` - State of Wifi LED. (True/False)"] pub fn MCUHWC_SetWifiLedState(state: bool) -> Result; } extern "C" { #[must_use] - #[doc = " Sets Power LED state\n # Arguments\n\n* `state` - powerLedState State of power LED."] + #[doc = "Sets Power LED state\n # Arguments\n\n* `state` - powerLedState State of power LED."] pub fn MCUHWC_SetPowerLedState(state: powerLedState) -> Result; } extern "C" { #[must_use] - #[doc = " Gets 3d slider level\n # Arguments\n\n* `level` - Pointer to write 3D slider level to."] + #[doc = "Gets 3d slider level\n # Arguments\n\n* `level` - Pointer to write 3D slider level to."] pub fn MCUHWC_Get3dSliderLevel(level: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the major MCU firmware version\n # Arguments\n\n* `out` - Pointer to write the major firmware version to."] + #[doc = "Gets the major MCU firmware version\n # Arguments\n\n* `out` - Pointer to write the major firmware version to."] pub fn MCUHWC_GetFwVerHigh(out: *mut u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Gets the minor MCU firmware version\n # Arguments\n\n* `out` - Pointer to write the minor firmware version to."] + #[doc = "Gets the minor MCU firmware version\n # Arguments\n\n* `out` - Pointer to write the minor firmware version to."] pub fn MCUHWC_GetFwVerLow(out: *mut u8_) -> Result; } #[doc = "< Primary I2S line, used by DSP/Mic (configurable)/GBA sound controller."] pub const CODEC_I2S_LINE_1: CodecI2sLine = 0; #[doc = "< Secondary I2S line, used by CSND hardware."] pub const CODEC_I2S_LINE_2: CodecI2sLine = 1; -#[doc = " I2S line enumeration"] +#[doc = "I2S line enumeration"] pub type CodecI2sLine = ::libc::c_uint; extern "C" { #[must_use] - #[doc = " Initializes CDCCHK."] + #[doc = "Initializes CDCCHK."] pub fn cdcChkInit() -> Result; } extern "C" { - #[doc = " Exits CDCCHK."] + #[doc = "Exits CDCCHK."] pub fn cdcChkExit(); } extern "C" { - #[doc = " Gets a pointer to the current cdc:CHK session handle.\n # Returns\n\nA pointer to the current cdc:CHK session handle."] + #[doc = "Gets a pointer to the current cdc:CHK session handle.\n # Returns\n\nA pointer to the current cdc:CHK session handle."] pub fn cdcChkGetSessionHandle() -> *mut Handle; } extern "C" { #[must_use] - #[doc = " Reads multiple registers from the CODEC, using the old\n SPI hardware interface and a 4MHz baudrate.\n # Arguments\n\n* `pageId` - CODEC Page ID.\n * `initialRegAddr` - Address of the CODEC register to start with.\n * `outData` (direction out) - Where to write the read data to.\n * `size` - Number of registers to read (bytes to read, max. 64)."] + #[doc = "Reads multiple registers from the CODEC, using the old\n SPI hardware interface and a 4MHz baudrate.\n # Arguments\n\n* `pageId` - CODEC Page ID.\n * `initialRegAddr` - Address of the CODEC register to start with.\n * `outData` (direction out) - Where to write the read data to.\n * `size` - Number of registers to read (bytes to read, max. 64)."] pub fn CDCCHK_ReadRegisters1( pageId: u8_, initialRegAddr: u8_, @@ -15891,7 +15891,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Reads multiple registers from the CODEC, using the new\n SPI hardware interface and a 16MHz baudrate.\n # Arguments\n\n* `pageId` - CODEC Page ID.\n * `initialRegAddr` - Address of the CODEC register to start with.\n * `outData` (direction out) - Where to read the data to.\n * `size` - Number of registers to read (bytes to read, max. 64)."] + #[doc = "Reads multiple registers from the CODEC, using the new\n SPI hardware interface and a 16MHz baudrate.\n # Arguments\n\n* `pageId` - CODEC Page ID.\n * `initialRegAddr` - Address of the CODEC register to start with.\n * `outData` (direction out) - Where to read the data to.\n * `size` - Number of registers to read (bytes to read, max. 64)."] pub fn CDCCHK_ReadRegisters2( pageId: u8_, initialRegAddr: u8_, @@ -15901,7 +15901,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Writes multiple registers to the CODEC, using the old\n SPI hardware interface and a 4MHz baudrate.\n # Arguments\n\n* `pageId` - CODEC Page ID.\n * `initialRegAddr` - Address of the CODEC register to start with.\n * `data` - Where to read the data to write from.\n * `size` - Number of registers to write (bytes to read, max. 64)."] + #[doc = "Writes multiple registers to the CODEC, using the old\n SPI hardware interface and a 4MHz baudrate.\n # Arguments\n\n* `pageId` - CODEC Page ID.\n * `initialRegAddr` - Address of the CODEC register to start with.\n * `data` - Where to read the data to write from.\n * `size` - Number of registers to write (bytes to read, max. 64)."] pub fn CDCCHK_WriteRegisters1( pageId: u8_, initialRegAddr: u8_, @@ -15911,7 +15911,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Writes multiple registers to the CODEC, using the new\n SPI hardware interface and a 16MHz baudrate.\n # Arguments\n\n* `pageId` - CODEC Page ID.\n * `initialRegAddr` - Address of the CODEC register to start with.\n * `data` - Where to read the data to write from.\n * `size` - Number of registers to write (bytes to read, max. 64)."] + #[doc = "Writes multiple registers to the CODEC, using the new\n SPI hardware interface and a 16MHz baudrate.\n # Arguments\n\n* `pageId` - CODEC Page ID.\n * `initialRegAddr` - Address of the CODEC register to start with.\n * `data` - Where to read the data to write from.\n * `size` - Number of registers to write (bytes to read, max. 64)."] pub fn CDCCHK_WriteRegisters2( pageId: u8_, initialRegAddr: u8_, @@ -15921,17 +15921,17 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Reads a single register from the NTR PMIC.\n # Arguments\n\n* `outData` (direction out) - Where to read the data to (1 byte).\n * `regAddr` - Register address.\n > **Note:** The NTR PMIC is emulated by the CODEC hardware and sends\n IRQs to the MCU when relevant."] + #[doc = "Reads a single register from the NTR PMIC.\n # Arguments\n\n* `outData` (direction out) - Where to read the data to (1 byte).\n * `regAddr` - Register address.\n > **Note:** The NTR PMIC is emulated by the CODEC hardware and sends\n IRQs to the MCU when relevant."] pub fn CDCCHK_ReadNtrPmicRegister(outData: *mut u8_, regAddr: u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Writes a single register from the NTR PMIC.\n # Arguments\n\n* `regAddr` - Register address.\n * `data` - Data to write (1 byte).\n > **Note:** The NTR PMIC is emulated by the CODEC hardware and sends\n IRQs to the MCU when relevant."] + #[doc = "Writes a single register from the NTR PMIC.\n # Arguments\n\n* `regAddr` - Register address.\n * `data` - Data to write (1 byte).\n > **Note:** The NTR PMIC is emulated by the CODEC hardware and sends\n IRQs to the MCU when relevant."] pub fn CDCCHK_WriteNtrPmicRegister(regAddr: u8_, data: u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the DAC volume level for the specified I2S line.\n # Arguments\n\n* `i2sLine` - I2S line to set the volume for.\n * `volume` - Volume level (-128 to 0)."] + #[doc = "Sets the DAC volume level for the specified I2S line.\n # Arguments\n\n* `i2sLine` - I2S line to set the volume for.\n * `volume` - Volume level (-128 to 0)."] pub fn CDCCHK_SetI2sVolume(i2sLine: CodecI2sLine, volume: s8) -> Result; } #[doc = "< 8-bit Red + 8-bit Green + 8-bit Blue + 8-bit Alpha"] @@ -15944,7 +15944,7 @@ pub const GX_TRANSFER_FMT_RGB565: GX_TRANSFER_FORMAT = 2; pub const GX_TRANSFER_FMT_RGB5A1: GX_TRANSFER_FORMAT = 3; #[doc = "< 4-bit Red + 4-bit Green + 4-bit Blue + 4-bit Alpha"] pub const GX_TRANSFER_FMT_RGBA4: GX_TRANSFER_FORMAT = 4; -#[doc = " Supported transfer pixel formats.\n [`GSPGPU_FramebufferFormat`]"] +#[doc = "Supported transfer pixel formats.\n [`GSPGPU_FramebufferFormat`]"] pub type GX_TRANSFER_FORMAT = ::libc::c_uint; #[doc = "< No anti-aliasing"] pub const GX_TRANSFER_SCALE_NO: GX_TRANSFER_SCALE = 0; @@ -15952,7 +15952,7 @@ pub const GX_TRANSFER_SCALE_NO: GX_TRANSFER_SCALE = 0; pub const GX_TRANSFER_SCALE_X: GX_TRANSFER_SCALE = 1; #[doc = "< 2x2 anti-aliasing"] pub const GX_TRANSFER_SCALE_XY: GX_TRANSFER_SCALE = 2; -#[doc = " Anti-aliasing modes\n\n Please remember that the framebuffer is sideways.\n Hence if you activate 2x1 anti-aliasing the destination dimensions are w = 240*2 and h = 400"] +#[doc = "Anti-aliasing modes\n\n Please remember that the framebuffer is sideways.\n Hence if you activate 2x1 anti-aliasing the destination dimensions are w = 240*2 and h = 400"] pub type GX_TRANSFER_SCALE = ::libc::c_uint; #[doc = "< Trigger the PPF event"] pub const GX_FILL_TRIGGER: GX_FILL_CONTROL = 1; @@ -15964,9 +15964,9 @@ pub const GX_FILL_16BIT_DEPTH: GX_FILL_CONTROL = 0; pub const GX_FILL_24BIT_DEPTH: GX_FILL_CONTROL = 256; #[doc = "< The buffer has a 32 bit per pixel depth"] pub const GX_FILL_32BIT_DEPTH: GX_FILL_CONTROL = 512; -#[doc = " GX transfer control flags"] +#[doc = "GX transfer control flags"] pub type GX_FILL_CONTROL = ::libc::c_uint; -#[doc = " GX command entry"] +#[doc = "GX command entry"] #[repr(C)] #[derive(Copy, Clone)] pub union gxCmdEntry_s { @@ -15994,7 +15994,7 @@ impl Default for gxCmdEntry_s { } } } -#[doc = " GX command queue structure"] +#[doc = "GX command queue structure"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct tag_gxCmdQueue_s { @@ -16022,45 +16022,45 @@ impl Default for tag_gxCmdQueue_s { } } } -#[doc = " GX command queue structure"] +#[doc = "GX command queue structure"] pub type gxCmdQueue_s = tag_gxCmdQueue_s; extern "C" { - #[doc = " Clears a GX command queue.\n # Arguments\n\n* `queue` - The GX command queue."] + #[doc = "Clears a GX command queue.\n # Arguments\n\n* `queue` - The GX command queue."] pub fn gxCmdQueueClear(queue: *mut gxCmdQueue_s); } extern "C" { - #[doc = " Adds a command to a GX command queue.\n # Arguments\n\n* `queue` - The GX command queue.\n * `entry` - The GX command to add."] + #[doc = "Adds a command to a GX command queue.\n # Arguments\n\n* `queue` - The GX command queue.\n * `entry` - The GX command to add."] pub fn gxCmdQueueAdd(queue: *mut gxCmdQueue_s, entry: *const gxCmdEntry_s); } extern "C" { - #[doc = " Runs a GX command queue, causing it to begin processing incoming commands as they arrive.\n # Arguments\n\n* `queue` - The GX command queue."] + #[doc = "Runs a GX command queue, causing it to begin processing incoming commands as they arrive.\n # Arguments\n\n* `queue` - The GX command queue."] pub fn gxCmdQueueRun(queue: *mut gxCmdQueue_s); } extern "C" { - #[doc = " Stops a GX command queue from processing incoming commands.\n # Arguments\n\n* `queue` - The GX command queue."] + #[doc = "Stops a GX command queue from processing incoming commands.\n # Arguments\n\n* `queue` - The GX command queue."] pub fn gxCmdQueueStop(queue: *mut gxCmdQueue_s); } extern "C" { - #[doc = " Waits for a GX command queue to finish executing pending commands.\n # Arguments\n\n* `queue` - The GX command queue.\n * `timeout` - Optional timeout (in nanoseconds) to wait (specify -1 for no timeout).\n # Returns\n\nfalse if timeout expired, true otherwise."] + #[doc = "Waits for a GX command queue to finish executing pending commands.\n # Arguments\n\n* `queue` - The GX command queue.\n * `timeout` - Optional timeout (in nanoseconds) to wait (specify -1 for no timeout).\n # Returns\n\nfalse if timeout expired, true otherwise."] pub fn gxCmdQueueWait(queue: *mut gxCmdQueue_s, timeout: s64) -> bool; } extern "C" { - #[doc = " Selects a command queue to which GX_* functions will add commands instead of immediately submitting them to GX.\n # Arguments\n\n* `queue` - The GX command queue. (Pass NULL to remove the bound command queue)"] + #[doc = "Selects a command queue to which GX_* functions will add commands instead of immediately submitting them to GX.\n # Arguments\n\n* `queue` - The GX command queue. (Pass NULL to remove the bound command queue)"] pub fn GX_BindQueue(queue: *mut gxCmdQueue_s); } extern "C" { #[must_use] - #[doc = " Requests a DMA.\n # Arguments\n\n* `src` - Source to DMA from.\n * `dst` - Destination to DMA to.\n * `length` - Length of data to transfer."] + #[doc = "Requests a DMA.\n # Arguments\n\n* `src` - Source to DMA from.\n * `dst` - Destination to DMA to.\n * `length` - Length of data to transfer."] pub fn GX_RequestDma(src: *mut u32_, dst: *mut u32_, length: u32_) -> Result; } extern "C" { #[must_use] - #[doc = " Processes a GPU command list.\n # Arguments\n\n* `buf0a` - Command list address.\n * `buf0s` - Command list size.\n * `flags` - Flags to process with."] + #[doc = "Processes a GPU command list.\n # Arguments\n\n* `buf0a` - Command list address.\n * `buf0s` - Command list size.\n * `flags` - Flags to process with."] pub fn GX_ProcessCommandList(buf0a: *mut u32_, buf0s: u32_, flags: u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Fills the memory of two buffers with the given values.\n # Arguments\n\n* `buf0a` - Start address of the first buffer.\n * `buf0v` - Dimensions of the first buffer.\n * `buf0e` - End address of the first buffer.\n * `control0` - Value to fill the first buffer with.\n * `buf1a` - Start address of the second buffer.\n * `buf1v` - Dimensions of the second buffer.\n * `buf1e` - End address of the second buffer.\n * `control1` - Value to fill the second buffer with."] + #[doc = "Fills the memory of two buffers with the given values.\n # Arguments\n\n* `buf0a` - Start address of the first buffer.\n * `buf0v` - Dimensions of the first buffer.\n * `buf0e` - End address of the first buffer.\n * `control0` - Value to fill the first buffer with.\n * `buf1a` - Start address of the second buffer.\n * `buf1v` - Dimensions of the second buffer.\n * `buf1e` - End address of the second buffer.\n * `control1` - Value to fill the second buffer with."] pub fn GX_MemoryFill( buf0a: *mut u32_, buf0v: u32_, @@ -16074,7 +16074,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Initiates a display transfer.\n > **Note:** The PPF event will be signaled on completion.\n # Arguments\n\n* `inadr` - Address of the input.\n * `indim` - Dimensions of the input.\n * `outadr` - Address of the output.\n * `outdim` - Dimensions of the output.\n * `flags` - Flags to transfer with."] + #[doc = "Initiates a display transfer.\n > **Note:** The PPF event will be signaled on completion.\n # Arguments\n\n* `inadr` - Address of the input.\n * `indim` - Dimensions of the input.\n * `outadr` - Address of the output.\n * `outdim` - Dimensions of the output.\n * `flags` - Flags to transfer with."] pub fn GX_DisplayTransfer( inadr: *mut u32_, indim: u32_, @@ -16085,7 +16085,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Initiates a texture copy.\n > **Note:** The PPF event will be signaled on completion.\n # Arguments\n\n* `inadr` - Address of the input.\n * `indim` - Dimensions of the input.\n * `outadr` - Address of the output.\n * `outdim` - Dimensions of the output.\n * `size` - Size of the data to transfer.\n * `flags` - Flags to transfer with."] + #[doc = "Initiates a texture copy.\n > **Note:** The PPF event will be signaled on completion.\n # Arguments\n\n* `inadr` - Address of the input.\n * `indim` - Dimensions of the input.\n * `outadr` - Address of the output.\n * `outdim` - Dimensions of the output.\n * `size` - Size of the data to transfer.\n * `flags` - Flags to transfer with."] pub fn GX_TextureCopy( inadr: *mut u32_, indim: u32_, @@ -16097,7 +16097,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Flushes the cache regions of three buffers. (This command cannot be queued in a GX command queue)\n # Arguments\n\n* `buf0a` - Address of the first buffer.\n * `buf0s` - Size of the first buffer.\n * `buf1a` - Address of the second buffer.\n * `buf1s` - Size of the second buffer.\n * `buf2a` - Address of the third buffer.\n * `buf2s` - Size of the third buffer."] + #[doc = "Flushes the cache regions of three buffers. (This command cannot be queued in a GX command queue)\n # Arguments\n\n* `buf0a` - Address of the first buffer.\n * `buf0s` - Size of the first buffer.\n * `buf1a` - Address of the second buffer.\n * `buf1s` - Size of the second buffer.\n * `buf2a` - Address of the third buffer.\n * `buf2s` - Size of the third buffer."] pub fn GX_FlushCacheRegions( buf0a: *mut u32_, buf0s: u32_, @@ -16111,7 +16111,7 @@ extern "C" { pub const GPU_NEAREST: GPU_TEXTURE_FILTER_PARAM = 0; #[doc = "< Linear interpolation."] pub const GPU_LINEAR: GPU_TEXTURE_FILTER_PARAM = 1; -#[doc = " Texture filters."] +#[doc = "Texture filters."] pub type GPU_TEXTURE_FILTER_PARAM = ::libc::c_uint; #[doc = "< Clamps to edge."] pub const GPU_CLAMP_TO_EDGE: GPU_TEXTURE_WRAP_PARAM = 0; @@ -16121,7 +16121,7 @@ pub const GPU_CLAMP_TO_BORDER: GPU_TEXTURE_WRAP_PARAM = 1; pub const GPU_REPEAT: GPU_TEXTURE_WRAP_PARAM = 2; #[doc = "< Repeats with mirrored texture."] pub const GPU_MIRRORED_REPEAT: GPU_TEXTURE_WRAP_PARAM = 3; -#[doc = " Texture wrap modes."] +#[doc = "Texture wrap modes."] pub type GPU_TEXTURE_WRAP_PARAM = ::libc::c_uint; #[doc = "< 2D texture"] pub const GPU_TEX_2D: GPU_TEXTURE_MODE_PARAM = 0; @@ -16135,7 +16135,7 @@ pub const GPU_TEX_PROJECTION: GPU_TEXTURE_MODE_PARAM = 3; pub const GPU_TEX_SHADOW_CUBE: GPU_TEXTURE_MODE_PARAM = 4; #[doc = "< Disabled"] pub const GPU_TEX_DISABLED: GPU_TEXTURE_MODE_PARAM = 5; -#[doc = " Texture modes."] +#[doc = "Texture modes."] pub type GPU_TEXTURE_MODE_PARAM = ::libc::c_uint; #[doc = "< Texture unit 0."] pub const GPU_TEXUNIT0: GPU_TEXUNIT = 1; @@ -16143,7 +16143,7 @@ pub const GPU_TEXUNIT0: GPU_TEXUNIT = 1; pub const GPU_TEXUNIT1: GPU_TEXUNIT = 2; #[doc = "< Texture unit 2."] pub const GPU_TEXUNIT2: GPU_TEXUNIT = 4; -#[doc = " Supported texture units."] +#[doc = "Supported texture units."] pub type GPU_TEXUNIT = ::libc::c_uint; #[doc = "< 8-bit Red + 8-bit Green + 8-bit Blue + 8-bit Alpha"] pub const GPU_RGBA8: GPU_TEXCOLOR = 0; @@ -16173,7 +16173,7 @@ pub const GPU_A4: GPU_TEXCOLOR = 11; pub const GPU_ETC1: GPU_TEXCOLOR = 12; #[doc = "< ETC1 texture compression + 4-bit Alpha"] pub const GPU_ETC1A4: GPU_TEXCOLOR = 13; -#[doc = " Supported texture formats."] +#[doc = "Supported texture formats."] pub type GPU_TEXCOLOR = ::libc::c_uint; #[doc = "< 2D face"] pub const GPU_TEXFACE_2D: GPU_TEXFACE = 0; @@ -16189,7 +16189,7 @@ pub const GPU_NEGATIVE_Y: GPU_TEXFACE = 3; pub const GPU_POSITIVE_Z: GPU_TEXFACE = 4; #[doc = "< -Z face"] pub const GPU_NEGATIVE_Z: GPU_TEXFACE = 5; -#[doc = " Texture faces."] +#[doc = "Texture faces."] pub type GPU_TEXFACE = ::libc::c_uint; #[doc = "< Clamp to zero."] pub const GPU_PT_CLAMP_TO_ZERO: GPU_PROCTEX_CLAMP = 0; @@ -16201,7 +16201,7 @@ pub const GPU_PT_REPEAT: GPU_PROCTEX_CLAMP = 2; pub const GPU_PT_MIRRORED_REPEAT: GPU_PROCTEX_CLAMP = 3; #[doc = "< Pulse."] pub const GPU_PT_PULSE: GPU_PROCTEX_CLAMP = 4; -#[doc = " Procedural texture clamp modes."] +#[doc = "Procedural texture clamp modes."] pub type GPU_PROCTEX_CLAMP = ::libc::c_uint; #[doc = "< U"] pub const GPU_PT_U: GPU_PROCTEX_MAPFUNC = 0; @@ -16223,7 +16223,7 @@ pub const GPU_PT_MIN: GPU_PROCTEX_MAPFUNC = 7; pub const GPU_PT_MAX: GPU_PROCTEX_MAPFUNC = 8; #[doc = "< rmax"] pub const GPU_PT_RMAX: GPU_PROCTEX_MAPFUNC = 9; -#[doc = " Procedural texture mapping functions."] +#[doc = "Procedural texture mapping functions."] pub type GPU_PROCTEX_MAPFUNC = ::libc::c_uint; #[doc = "< No shift."] pub const GPU_PT_NONE: GPU_PROCTEX_SHIFT = 0; @@ -16231,7 +16231,7 @@ pub const GPU_PT_NONE: GPU_PROCTEX_SHIFT = 0; pub const GPU_PT_ODD: GPU_PROCTEX_SHIFT = 1; #[doc = "< Even shift."] pub const GPU_PT_EVEN: GPU_PROCTEX_SHIFT = 2; -#[doc = " Procedural texture shift values."] +#[doc = "Procedural texture shift values."] pub type GPU_PROCTEX_SHIFT = ::libc::c_uint; #[doc = "< Nearest-neighbor"] pub const GPU_PT_NEAREST: GPU_PROCTEX_FILTER = 0; @@ -16245,7 +16245,7 @@ pub const GPU_PT_LINEAR_MIP_NEAREST: GPU_PROCTEX_FILTER = 3; pub const GPU_PT_NEAREST_MIP_LINEAR: GPU_PROCTEX_FILTER = 4; #[doc = "< Linear interpolation with mipmap using linear interpolation"] pub const GPU_PT_LINEAR_MIP_LINEAR: GPU_PROCTEX_FILTER = 5; -#[doc = " Procedural texture filter values."] +#[doc = "Procedural texture filter values."] pub type GPU_PROCTEX_FILTER = ::libc::c_uint; #[doc = "< Noise table"] pub const GPU_LUT_NOISE: GPU_PROCTEX_LUTID = 0; @@ -16257,7 +16257,7 @@ pub const GPU_LUT_ALPHAMAP: GPU_PROCTEX_LUTID = 3; pub const GPU_LUT_COLOR: GPU_PROCTEX_LUTID = 4; #[doc = "< Color difference table"] pub const GPU_LUT_COLORDIF: GPU_PROCTEX_LUTID = 5; -#[doc = " Procedural texture LUT IDs."] +#[doc = "Procedural texture LUT IDs."] pub type GPU_PROCTEX_LUTID = ::libc::c_uint; #[doc = "< 8-bit Red + 8-bit Green + 8-bit Blue + 8-bit Alpha"] pub const GPU_RB_RGBA8: GPU_COLORBUF = 0; @@ -16269,7 +16269,7 @@ pub const GPU_RB_RGBA5551: GPU_COLORBUF = 2; pub const GPU_RB_RGB565: GPU_COLORBUF = 3; #[doc = "< 4-bit Red + 4-bit Green + 4-bit Blue + 4-bit Alpha"] pub const GPU_RB_RGBA4: GPU_COLORBUF = 4; -#[doc = " Supported color buffer formats."] +#[doc = "Supported color buffer formats."] pub type GPU_COLORBUF = ::libc::c_uint; #[doc = "< 16-bit Depth"] pub const GPU_RB_DEPTH16: GPU_DEPTHBUF = 0; @@ -16277,7 +16277,7 @@ pub const GPU_RB_DEPTH16: GPU_DEPTHBUF = 0; pub const GPU_RB_DEPTH24: GPU_DEPTHBUF = 2; #[doc = "< 24-bit Depth + 8-bit Stencil"] pub const GPU_RB_DEPTH24_STENCIL8: GPU_DEPTHBUF = 3; -#[doc = " Supported depth buffer formats."] +#[doc = "Supported depth buffer formats."] pub type GPU_DEPTHBUF = ::libc::c_uint; #[doc = "< Never pass."] pub const GPU_NEVER: GPU_TESTFUNC = 0; @@ -16295,7 +16295,7 @@ pub const GPU_LEQUAL: GPU_TESTFUNC = 5; pub const GPU_GREATER: GPU_TESTFUNC = 6; #[doc = "< Pass if greater than or equal."] pub const GPU_GEQUAL: GPU_TESTFUNC = 7; -#[doc = " Test functions."] +#[doc = "Test functions."] pub type GPU_TESTFUNC = ::libc::c_uint; #[doc = "< Pass if greater than or equal."] pub const GPU_EARLYDEPTH_GEQUAL: GPU_EARLYDEPTHFUNC = 0; @@ -16305,7 +16305,7 @@ pub const GPU_EARLYDEPTH_GREATER: GPU_EARLYDEPTHFUNC = 1; pub const GPU_EARLYDEPTH_LEQUAL: GPU_EARLYDEPTHFUNC = 2; #[doc = "< Pass if less than."] pub const GPU_EARLYDEPTH_LESS: GPU_EARLYDEPTHFUNC = 3; -#[doc = " Early depth test functions."] +#[doc = "Early depth test functions."] pub type GPU_EARLYDEPTHFUNC = ::libc::c_uint; #[doc = "< Never pass (0)."] pub const GPU_GAS_NEVER: GPU_GASDEPTHFUNC = 0; @@ -16315,7 +16315,7 @@ pub const GPU_GAS_ALWAYS: GPU_GASDEPTHFUNC = 1; pub const GPU_GAS_GREATER: GPU_GASDEPTHFUNC = 2; #[doc = "< Pass if less than (X)."] pub const GPU_GAS_LESS: GPU_GASDEPTHFUNC = 3; -#[doc = " Gas depth functions."] +#[doc = "Gas depth functions."] pub type GPU_GASDEPTHFUNC = ::libc::c_uint; #[doc = "< Disable."] pub const GPU_SCISSOR_DISABLE: GPU_SCISSORMODE = 0; @@ -16323,7 +16323,7 @@ pub const GPU_SCISSOR_DISABLE: GPU_SCISSORMODE = 0; pub const GPU_SCISSOR_INVERT: GPU_SCISSORMODE = 1; #[doc = "< Exclude pixels outside of the scissor box."] pub const GPU_SCISSOR_NORMAL: GPU_SCISSORMODE = 3; -#[doc = " Scissor test modes."] +#[doc = "Scissor test modes."] pub type GPU_SCISSORMODE = ::libc::c_uint; #[doc = "< Keep old value. (old_stencil)"] pub const GPU_STENCIL_KEEP: GPU_STENCILOP = 0; @@ -16341,7 +16341,7 @@ pub const GPU_STENCIL_INVERT: GPU_STENCILOP = 5; pub const GPU_STENCIL_INCR_WRAP: GPU_STENCILOP = 6; #[doc = "< Decrement value. (old_stencil - 1)"] pub const GPU_STENCIL_DECR_WRAP: GPU_STENCILOP = 7; -#[doc = " Stencil operations."] +#[doc = "Stencil operations."] pub type GPU_STENCILOP = ::libc::c_uint; #[doc = "< Write red."] pub const GPU_WRITE_RED: GPU_WRITEMASK = 1; @@ -16357,7 +16357,7 @@ pub const GPU_WRITE_DEPTH: GPU_WRITEMASK = 16; pub const GPU_WRITE_COLOR: GPU_WRITEMASK = 15; #[doc = "< Write all components."] pub const GPU_WRITE_ALL: GPU_WRITEMASK = 31; -#[doc = " Pixel write mask."] +#[doc = "Pixel write mask."] pub type GPU_WRITEMASK = ::libc::c_uint; #[doc = "< Add colors."] pub const GPU_BLEND_ADD: GPU_BLENDEQUATION = 0; @@ -16369,7 +16369,7 @@ pub const GPU_BLEND_REVERSE_SUBTRACT: GPU_BLENDEQUATION = 2; pub const GPU_BLEND_MIN: GPU_BLENDEQUATION = 3; #[doc = "< Use the maximum color."] pub const GPU_BLEND_MAX: GPU_BLENDEQUATION = 4; -#[doc = " Blend modes."] +#[doc = "Blend modes."] pub type GPU_BLENDEQUATION = ::libc::c_uint; #[doc = "< Zero."] pub const GPU_ZERO: GPU_BLENDFACTOR = 0; @@ -16401,7 +16401,7 @@ pub const GPU_CONSTANT_ALPHA: GPU_BLENDFACTOR = 12; pub const GPU_ONE_MINUS_CONSTANT_ALPHA: GPU_BLENDFACTOR = 13; #[doc = "< Saturated alpha."] pub const GPU_SRC_ALPHA_SATURATE: GPU_BLENDFACTOR = 14; -#[doc = " Blend factors."] +#[doc = "Blend factors."] pub type GPU_BLENDFACTOR = ::libc::c_uint; #[doc = "< Clear."] pub const GPU_LOGICOP_CLEAR: GPU_LOGICOP = 0; @@ -16435,7 +16435,7 @@ pub const GPU_LOGICOP_AND_INVERTED: GPU_LOGICOP = 13; pub const GPU_LOGICOP_OR_REVERSE: GPU_LOGICOP = 14; #[doc = "< Inverted bitwize OR."] pub const GPU_LOGICOP_OR_INVERTED: GPU_LOGICOP = 15; -#[doc = " Logical operations."] +#[doc = "Logical operations."] pub type GPU_LOGICOP = ::libc::c_uint; #[doc = "< OpenGL mode."] pub const GPU_FRAGOPMODE_GL: GPU_FRAGOPMODE = 0; @@ -16443,7 +16443,7 @@ pub const GPU_FRAGOPMODE_GL: GPU_FRAGOPMODE = 0; pub const GPU_FRAGOPMODE_GAS_ACC: GPU_FRAGOPMODE = 1; #[doc = "< Shadow mode (?)."] pub const GPU_FRAGOPMODE_SHADOW: GPU_FRAGOPMODE = 3; -#[doc = " Fragment operation modes."] +#[doc = "Fragment operation modes."] pub type GPU_FRAGOPMODE = ::libc::c_uint; #[doc = "< 8-bit byte."] pub const GPU_BYTE: GPU_FORMATS = 0; @@ -16453,7 +16453,7 @@ pub const GPU_UNSIGNED_BYTE: GPU_FORMATS = 1; pub const GPU_SHORT: GPU_FORMATS = 2; #[doc = "< 32-bit float."] pub const GPU_FLOAT: GPU_FORMATS = 3; -#[doc = " Supported component formats."] +#[doc = "Supported component formats."] pub type GPU_FORMATS = ::libc::c_uint; #[doc = "< Disabled."] pub const GPU_CULL_NONE: GPU_CULLMODE = 0; @@ -16461,7 +16461,7 @@ pub const GPU_CULL_NONE: GPU_CULLMODE = 0; pub const GPU_CULL_FRONT_CCW: GPU_CULLMODE = 1; #[doc = "< Back, counter-clockwise."] pub const GPU_CULL_BACK_CCW: GPU_CULLMODE = 2; -#[doc = " Cull modes."] +#[doc = "Cull modes."] pub type GPU_CULLMODE = ::libc::c_uint; #[doc = "< Primary color."] pub const GPU_PRIMARY_COLOR: GPU_TEVSRC = 0; @@ -16483,7 +16483,7 @@ pub const GPU_PREVIOUS_BUFFER: GPU_TEVSRC = 13; pub const GPU_CONSTANT: GPU_TEVSRC = 14; #[doc = "< Previous value."] pub const GPU_PREVIOUS: GPU_TEVSRC = 15; -#[doc = " Texture combiner sources."] +#[doc = "Texture combiner sources."] pub type GPU_TEVSRC = ::libc::c_uint; #[doc = "< Source color."] pub const GPU_TEVOP_RGB_SRC_COLOR: GPU_TEVOP_RGB = 0; @@ -16517,7 +16517,7 @@ pub const GPU_TEVOP_RGB_ONE_MINUS_SRC_B: GPU_TEVOP_RGB = 13; pub const GPU_TEVOP_RGB_0x0E: GPU_TEVOP_RGB = 14; #[doc = "< Unknown."] pub const GPU_TEVOP_RGB_0x0F: GPU_TEVOP_RGB = 15; -#[doc = " Texture RGB combiner operands."] +#[doc = "Texture RGB combiner operands."] pub type GPU_TEVOP_RGB = ::libc::c_uint; #[doc = "< Source alpha."] pub const GPU_TEVOP_A_SRC_ALPHA: GPU_TEVOP_A = 0; @@ -16535,7 +16535,7 @@ pub const GPU_TEVOP_A_ONE_MINUS_SRC_G: GPU_TEVOP_A = 5; pub const GPU_TEVOP_A_SRC_B: GPU_TEVOP_A = 6; #[doc = "< Source blue - 1."] pub const GPU_TEVOP_A_ONE_MINUS_SRC_B: GPU_TEVOP_A = 7; -#[doc = " Texture Alpha combiner operands."] +#[doc = "Texture Alpha combiner operands."] pub type GPU_TEVOP_A = ::libc::c_uint; #[doc = "< Replace."] pub const GPU_REPLACE: GPU_COMBINEFUNC = 0; @@ -16555,7 +16555,7 @@ pub const GPU_DOT3_RGB: GPU_COMBINEFUNC = 6; pub const GPU_MULTIPLY_ADD: GPU_COMBINEFUNC = 8; #[doc = "< Add then multiply."] pub const GPU_ADD_MULTIPLY: GPU_COMBINEFUNC = 9; -#[doc = " Texture combiner functions."] +#[doc = "Texture combiner functions."] pub type GPU_COMBINEFUNC = ::libc::c_uint; #[doc = "< 1x"] pub const GPU_TEVSCALE_1: GPU_TEVSCALE = 0; @@ -16563,7 +16563,7 @@ pub const GPU_TEVSCALE_1: GPU_TEVSCALE = 0; pub const GPU_TEVSCALE_2: GPU_TEVSCALE = 1; #[doc = "< 4x"] pub const GPU_TEVSCALE_4: GPU_TEVSCALE = 2; -#[doc = " Texture scale factors."] +#[doc = "Texture scale factors."] pub type GPU_TEVSCALE = ::libc::c_uint; #[doc = "< None."] pub const GPU_NO_FRESNEL: GPU_FRESNELSEL = 0; @@ -16573,7 +16573,7 @@ pub const GPU_PRI_ALPHA_FRESNEL: GPU_FRESNELSEL = 1; pub const GPU_SEC_ALPHA_FRESNEL: GPU_FRESNELSEL = 2; #[doc = "< Primary and secondary alpha."] pub const GPU_PRI_SEC_ALPHA_FRESNEL: GPU_FRESNELSEL = 3; -#[doc = " Fresnel options."] +#[doc = "Fresnel options."] pub type GPU_FRESNELSEL = ::libc::c_uint; #[doc = "< Disabled."] pub const GPU_BUMP_NOT_USED: GPU_BUMPMODE = 0; @@ -16581,7 +16581,7 @@ pub const GPU_BUMP_NOT_USED: GPU_BUMPMODE = 0; pub const GPU_BUMP_AS_BUMP: GPU_BUMPMODE = 1; #[doc = "< Bump as tangent/normal mapping."] pub const GPU_BUMP_AS_TANG: GPU_BUMPMODE = 2; -#[doc = " Bump map modes."] +#[doc = "Bump map modes."] pub type GPU_BUMPMODE = ::libc::c_uint; #[doc = "< D0 LUT."] pub const GPU_LUT_D0: GPU_LIGHTLUTID = 0; @@ -16599,7 +16599,7 @@ pub const GPU_LUT_RG: GPU_LIGHTLUTID = 5; pub const GPU_LUT_RR: GPU_LIGHTLUTID = 6; #[doc = "< Distance attenuation LUT."] pub const GPU_LUT_DA: GPU_LIGHTLUTID = 7; -#[doc = " LUT IDs."] +#[doc = "LUT IDs."] pub type GPU_LIGHTLUTID = ::libc::c_uint; #[doc = "< Normal*HalfVector"] pub const GPU_LUTINPUT_NH: GPU_LIGHTLUTINPUT = 0; @@ -16613,7 +16613,7 @@ pub const GPU_LUTINPUT_LN: GPU_LIGHTLUTINPUT = 3; pub const GPU_LUTINPUT_SP: GPU_LIGHTLUTINPUT = 4; #[doc = "< cosine of phi"] pub const GPU_LUTINPUT_CP: GPU_LIGHTLUTINPUT = 5; -#[doc = " LUT inputs."] +#[doc = "LUT inputs."] pub type GPU_LIGHTLUTINPUT = ::libc::c_uint; #[doc = "< 1x scale."] pub const GPU_LUTSCALER_1x: GPU_LIGHTLUTSCALER = 0; @@ -16627,7 +16627,7 @@ pub const GPU_LUTSCALER_8x: GPU_LIGHTLUTSCALER = 3; pub const GPU_LUTSCALER_0_25x: GPU_LIGHTLUTSCALER = 6; #[doc = "< 0.5x scale."] pub const GPU_LUTSCALER_0_5x: GPU_LIGHTLUTSCALER = 7; -#[doc = " LUT scalers."] +#[doc = "LUT scalers."] pub type GPU_LIGHTLUTSCALER = ::libc::c_uint; #[doc = "< LUTs that are common to all lights."] pub const GPU_LUTSELECT_COMMON: GPU_LIGHTLUTSELECT = 0; @@ -16635,7 +16635,7 @@ pub const GPU_LUTSELECT_COMMON: GPU_LIGHTLUTSELECT = 0; pub const GPU_LUTSELECT_SP: GPU_LIGHTLUTSELECT = 1; #[doc = "< Distance attenuation LUT."] pub const GPU_LUTSELECT_DA: GPU_LIGHTLUTSELECT = 2; -#[doc = " LUT selection."] +#[doc = "LUT selection."] pub type GPU_LIGHTLUTSELECT = ::libc::c_uint; #[doc = "< Fog/Gas unit disabled."] pub const GPU_NO_FOG: GPU_FOGMODE = 0; @@ -16643,19 +16643,19 @@ pub const GPU_NO_FOG: GPU_FOGMODE = 0; pub const GPU_FOG: GPU_FOGMODE = 5; #[doc = "< Fog/Gas unit configured in Gas mode."] pub const GPU_GAS: GPU_FOGMODE = 7; -#[doc = " Fog modes."] +#[doc = "Fog modes."] pub type GPU_FOGMODE = ::libc::c_uint; #[doc = "< Plain density."] pub const GPU_PLAIN_DENSITY: GPU_GASMODE = 0; #[doc = "< Depth density."] pub const GPU_DEPTH_DENSITY: GPU_GASMODE = 1; -#[doc = " Gas shading density source values."] +#[doc = "Gas shading density source values."] pub type GPU_GASMODE = ::libc::c_uint; #[doc = "< Gas density used as input."] pub const GPU_GAS_DENSITY: GPU_GASLUTINPUT = 0; #[doc = "< Light factor used as input."] pub const GPU_GAS_LIGHT_FACTOR: GPU_GASLUTINPUT = 1; -#[doc = " Gas color LUT inputs."] +#[doc = "Gas color LUT inputs."] pub type GPU_GASLUTINPUT = ::libc::c_uint; #[doc = "< Triangles."] pub const GPU_TRIANGLES: GPU_Primitive_t = 0; @@ -16665,13 +16665,13 @@ pub const GPU_TRIANGLE_STRIP: GPU_Primitive_t = 256; pub const GPU_TRIANGLE_FAN: GPU_Primitive_t = 512; #[doc = "< Geometry shader primitive."] pub const GPU_GEOMETRY_PRIM: GPU_Primitive_t = 768; -#[doc = " Supported primitives."] +#[doc = "Supported primitives."] pub type GPU_Primitive_t = ::libc::c_uint; #[doc = "< Vertex shader."] pub const GPU_VERTEX_SHADER: GPU_SHADER_TYPE = 0; #[doc = "< Geometry shader."] pub const GPU_GEOMETRY_SHADER: GPU_SHADER_TYPE = 1; -#[doc = " Shader types."] +#[doc = "Shader types."] pub type GPU_SHADER_TYPE = ::libc::c_uint; extern "C" { #[doc = "< GPU command buffer."] @@ -16686,38 +16686,38 @@ extern "C" { pub static mut gpuCmdBufOffset: u32_; } extern "C" { - #[doc = " Adds raw GPU commands to the current command buffer.\n # Arguments\n\n* `cmd` - Buffer containing commands to add.\n * `size` - Size of the buffer."] + #[doc = "Adds raw GPU commands to the current command buffer.\n # Arguments\n\n* `cmd` - Buffer containing commands to add.\n * `size` - Size of the buffer."] pub fn GPUCMD_AddRawCommands(cmd: *const u32_, size: u32_); } extern "C" { - #[doc = " Adds a GPU command to the current command buffer.\n # Arguments\n\n* `header` - Header of the command.\n * `param` - Parameters of the command.\n * `paramlength` - Size of the parameter buffer."] + #[doc = "Adds a GPU command to the current command buffer.\n # Arguments\n\n* `header` - Header of the command.\n * `param` - Parameters of the command.\n * `paramlength` - Size of the parameter buffer."] pub fn GPUCMD_Add(header: u32_, param: *const u32_, paramlength: u32_); } extern "C" { - #[doc = " Splits the current GPU command buffer.\n # Arguments\n\n* `addr` - Pointer to output the command buffer to.\n * `size` - Pointer to output the size (in words) of the command buffer to."] + #[doc = "Splits the current GPU command buffer.\n # Arguments\n\n* `addr` - Pointer to output the command buffer to.\n * `size` - Pointer to output the size (in words) of the command buffer to."] pub fn GPUCMD_Split(addr: *mut *mut u32_, size: *mut u32_); } extern "C" { - #[doc = " Converts a 32-bit float to a 16-bit float.\n # Arguments\n\n* `f` - Float to convert.\n # Returns\n\nThe converted float."] + #[doc = "Converts a 32-bit float to a 16-bit float.\n # Arguments\n\n* `f` - Float to convert.\n # Returns\n\nThe converted float."] pub fn f32tof16(f: f32) -> u32_; } extern "C" { - #[doc = " Converts a 32-bit float to a 20-bit float.\n # Arguments\n\n* `f` - Float to convert.\n # Returns\n\nThe converted float."] + #[doc = "Converts a 32-bit float to a 20-bit float.\n # Arguments\n\n* `f` - Float to convert.\n # Returns\n\nThe converted float."] pub fn f32tof20(f: f32) -> u32_; } extern "C" { - #[doc = " Converts a 32-bit float to a 24-bit float.\n # Arguments\n\n* `f` - Float to convert.\n # Returns\n\nThe converted float."] + #[doc = "Converts a 32-bit float to a 24-bit float.\n # Arguments\n\n* `f` - Float to convert.\n # Returns\n\nThe converted float."] pub fn f32tof24(f: f32) -> u32_; } extern "C" { - #[doc = " Converts a 32-bit float to a 31-bit float.\n # Arguments\n\n* `f` - Float to convert.\n # Returns\n\nThe converted float."] + #[doc = "Converts a 32-bit float to a 31-bit float.\n # Arguments\n\n* `f` - Float to convert.\n # Returns\n\nThe converted float."] pub fn f32tof31(f: f32) -> u32_; } #[doc = "< Vertex shader."] pub const VERTEX_SHDR: DVLE_type = 0; #[doc = "< Geometry shader."] pub const GEOMETRY_SHDR: DVLE_type = 1; -#[doc = " DVLE type."] +#[doc = "DVLE type."] pub type DVLE_type = ::libc::c_uint; #[doc = "< Bool."] pub const DVLE_CONST_BOOL: DVLE_constantType = 0; @@ -16725,7 +16725,7 @@ pub const DVLE_CONST_BOOL: DVLE_constantType = 0; pub const DVLE_CONST_u8: DVLE_constantType = 1; #[doc = "< 24-bit float."] pub const DVLE_CONST_FLOAT24: DVLE_constantType = 2; -#[doc = " Constant type."] +#[doc = "Constant type."] pub type DVLE_constantType = ::libc::c_uint; #[doc = "< Position."] pub const RESULT_POSITION: DVLE_outputAttribute_t = 0; @@ -16745,7 +16745,7 @@ pub const RESULT_TEXCOORD2: DVLE_outputAttribute_t = 6; pub const RESULT_VIEW: DVLE_outputAttribute_t = 8; #[doc = "< Dummy attribute (used as passthrough for geometry shader input)."] pub const RESULT_DUMMY: DVLE_outputAttribute_t = 9; -#[doc = " Output attribute."] +#[doc = "Output attribute."] pub type DVLE_outputAttribute_t = ::libc::c_uint; #[doc = "< Point processing mode."] pub const GSH_POINT: DVLE_geoShaderMode = 0; @@ -16753,9 +16753,9 @@ pub const GSH_POINT: DVLE_geoShaderMode = 0; pub const GSH_VARIABLE_PRIM: DVLE_geoShaderMode = 1; #[doc = "< Fixed-size primitive processing mode."] pub const GSH_FIXED_PRIM: DVLE_geoShaderMode = 2; -#[doc = " Geometry shader operation modes."] +#[doc = "Geometry shader operation modes."] pub type DVLE_geoShaderMode = ::libc::c_uint; -#[doc = " DVLP data."] +#[doc = "DVLP data."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct DVLP_s { @@ -16777,7 +16777,7 @@ impl Default for DVLP_s { } } } -#[doc = " DVLE constant entry data."] +#[doc = "DVLE constant entry data."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct DVLE_constEntry_s { @@ -16788,7 +16788,7 @@ pub struct DVLE_constEntry_s { #[doc = "< Constant data."] pub data: [u32_; 4usize], } -#[doc = " DVLE output entry data."] +#[doc = "DVLE output entry data."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct DVLE_outEntry_s { @@ -16801,7 +16801,7 @@ pub struct DVLE_outEntry_s { #[doc = "< Unknown."] pub unk: [u8_; 3usize], } -#[doc = " DVLE uniform entry data."] +#[doc = "DVLE uniform entry data."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct DVLE_uniformEntry_s { @@ -16812,7 +16812,7 @@ pub struct DVLE_uniformEntry_s { #[doc = "< End register."] pub endReg: u16_, } -#[doc = " DVLE data."] +#[doc = "DVLE data."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct DVLE_s { @@ -16866,7 +16866,7 @@ impl Default for DVLE_s { } } } -#[doc = " DVLB data."] +#[doc = "DVLB data."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct DVLB_s { @@ -16887,22 +16887,22 @@ impl Default for DVLB_s { } } extern "C" { - #[doc = " Parses a shader binary.\n # Arguments\n\n* `shbinData` - Shader binary data.\n * `shbinSize` - Shader binary size.\n # Returns\n\nThe parsed shader binary."] + #[doc = "Parses a shader binary.\n # Arguments\n\n* `shbinData` - Shader binary data.\n * `shbinSize` - Shader binary size.\n # Returns\n\nThe parsed shader binary."] pub fn DVLB_ParseFile(shbinData: *mut u32_, shbinSize: u32_) -> *mut DVLB_s; } extern "C" { - #[doc = " Frees shader binary data.\n # Arguments\n\n* `dvlb` - DVLB to free."] + #[doc = "Frees shader binary data.\n # Arguments\n\n* `dvlb` - DVLB to free."] pub fn DVLB_Free(dvlb: *mut DVLB_s); } extern "C" { - #[doc = " Gets a uniform register index from a shader.\n # Arguments\n\n* `dvle` - Shader to get the register from.\n * `name` - Name of the register.\n # Returns\n\nThe uniform register index."] + #[doc = "Gets a uniform register index from a shader.\n # Arguments\n\n* `dvle` - Shader to get the register from.\n * `name` - Name of the register.\n # Returns\n\nThe uniform register index."] pub fn DVLE_GetUniformRegister(dvle: *mut DVLE_s, name: *const ::libc::c_char) -> s8; } extern "C" { - #[doc = " Generates a shader output map.\n # Arguments\n\n* `dvle` - Shader to generate an output map for."] + #[doc = "Generates a shader output map.\n # Arguments\n\n* `dvle` - Shader to generate an output map for."] pub fn DVLE_GenerateOutmap(dvle: *mut DVLE_s); } -#[doc = " 24-bit float uniforms."] +#[doc = "24-bit float uniforms."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct float24Uniform_s { @@ -16911,7 +16911,7 @@ pub struct float24Uniform_s { #[doc = "< Uniform data."] pub data: [u32_; 3usize], } -#[doc = " Describes an instance of either a vertex or geometry shader."] +#[doc = "Describes an instance of either a vertex or geometry shader."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct shaderInstance_s { @@ -16939,7 +16939,7 @@ impl Default for shaderInstance_s { } } } -#[doc = " Describes an instance of a full shader program."] +#[doc = "Describes an instance of a full shader program."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct shaderProgram_s { @@ -16963,17 +16963,17 @@ impl Default for shaderProgram_s { } extern "C" { #[must_use] - #[doc = " Initializes a shader instance.\n # Arguments\n\n* `si` - Shader instance to initialize.\n * `dvle` - DVLE to initialize the shader instance with."] + #[doc = "Initializes a shader instance.\n # Arguments\n\n* `si` - Shader instance to initialize.\n * `dvle` - DVLE to initialize the shader instance with."] pub fn shaderInstanceInit(si: *mut shaderInstance_s, dvle: *mut DVLE_s) -> Result; } extern "C" { #[must_use] - #[doc = " Frees a shader instance.\n # Arguments\n\n* `si` - Shader instance to free."] + #[doc = "Frees a shader instance.\n # Arguments\n\n* `si` - Shader instance to free."] pub fn shaderInstanceFree(si: *mut shaderInstance_s) -> Result; } extern "C" { #[must_use] - #[doc = " Sets a bool uniform of a shader.\n # Arguments\n\n* `si` - Shader instance to use.\n * `id` - ID of the bool uniform.\n * `value` - Value to set."] + #[doc = "Sets a bool uniform of a shader.\n # Arguments\n\n* `si` - Shader instance to use.\n * `id` - ID of the bool uniform.\n * `value` - Value to set."] pub fn shaderInstanceSetBool( si: *mut shaderInstance_s, id: ::libc::c_int, @@ -16982,7 +16982,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets a bool uniform of a shader.\n # Arguments\n\n* `si` - Shader instance to use.\n * `id` - ID of the bool uniform.\n * `value` - Pointer to output the value to."] + #[doc = "Gets a bool uniform of a shader.\n # Arguments\n\n* `si` - Shader instance to use.\n * `id` - ID of the bool uniform.\n * `value` - Pointer to output the value to."] pub fn shaderInstanceGetBool( si: *mut shaderInstance_s, id: ::libc::c_int, @@ -16990,7 +16990,7 @@ extern "C" { ) -> Result; } extern "C" { - #[doc = " Gets the location of a shader's uniform.\n # Arguments\n\n* `si` - Shader instance to use.\n * `name` - Name of the uniform."] + #[doc = "Gets the location of a shader's uniform.\n # Arguments\n\n* `si` - Shader instance to use.\n * `name` - Name of the uniform."] pub fn shaderInstanceGetUniformLocation( si: *mut shaderInstance_s, name: *const ::libc::c_char, @@ -16998,27 +16998,27 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Initializes a shader program.\n # Arguments\n\n* `sp` - Shader program to initialize."] + #[doc = "Initializes a shader program.\n # Arguments\n\n* `sp` - Shader program to initialize."] pub fn shaderProgramInit(sp: *mut shaderProgram_s) -> Result; } extern "C" { #[must_use] - #[doc = " Frees a shader program.\n # Arguments\n\n* `sp` - Shader program to free."] + #[doc = "Frees a shader program.\n # Arguments\n\n* `sp` - Shader program to free."] pub fn shaderProgramFree(sp: *mut shaderProgram_s) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the vertex shader of a shader program.\n # Arguments\n\n* `sp` - Shader program to use.\n * `dvle` - Vertex shader to set."] + #[doc = "Sets the vertex shader of a shader program.\n # Arguments\n\n* `sp` - Shader program to use.\n * `dvle` - Vertex shader to set."] pub fn shaderProgramSetVsh(sp: *mut shaderProgram_s, dvle: *mut DVLE_s) -> Result; } extern "C" { #[must_use] - #[doc = " Sets the geometry shader of a shader program.\n # Arguments\n\n* `sp` - Shader program to use.\n * `dvle` - Geometry shader to set.\n * `stride` - Input stride of the shader (pass 0 to match the number of outputs of the vertex shader)."] + #[doc = "Sets the geometry shader of a shader program.\n # Arguments\n\n* `sp` - Shader program to use.\n * `dvle` - Geometry shader to set.\n * `stride` - Input stride of the shader (pass 0 to match the number of outputs of the vertex shader)."] pub fn shaderProgramSetGsh(sp: *mut shaderProgram_s, dvle: *mut DVLE_s, stride: u8_) -> Result; } extern "C" { #[must_use] - #[doc = " Configures the permutation of the input attributes of the geometry shader of a shader program.\n # Arguments\n\n* `sp` - Shader program to use.\n * `permutation` - Attribute permutation to use."] + #[doc = "Configures the permutation of the input attributes of the geometry shader of a shader program.\n # Arguments\n\n* `sp` - Shader program to use.\n * `permutation` - Attribute permutation to use."] pub fn shaderProgramSetGshInputPermutation( sp: *mut shaderProgram_s, permutation: u64_, @@ -17026,7 +17026,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Configures the shader units to use the specified shader program.\n # Arguments\n\n* `sp` - Shader program to use.\n * `sendVshCode` - When true, the vertex shader's code and operand descriptors are uploaded.\n * `sendGshCode` - When true, the geometry shader's code and operand descriptors are uploaded."] + #[doc = "Configures the shader units to use the specified shader program.\n # Arguments\n\n* `sp` - Shader program to use.\n * `sendVshCode` - When true, the vertex shader's code and operand descriptors are uploaded.\n * `sendGshCode` - When true, the geometry shader's code and operand descriptors are uploaded."] pub fn shaderProgramConfigure( sp: *mut shaderProgram_s, sendVshCode: bool, @@ -17035,7 +17035,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Same as shaderProgramConfigure, but always loading code/operand descriptors and uploading DVLE constants afterwards.\n # Arguments\n\n* `sp` - Shader program to use."] + #[doc = "Same as shaderProgramConfigure, but always loading code/operand descriptors and uploading DVLE constants afterwards.\n # Arguments\n\n* `sp` - Shader program to use."] pub fn shaderProgramUse(sp: *mut shaderProgram_s) -> Result; } #[doc = "< Mono sound"] @@ -17058,7 +17058,7 @@ pub const NDSP_SPKPOS_WIDE: ndspSpeakerPos = 1; #[doc = "; -#[doc = " Auxiliary output callback function. (data = User provided data, nsamples = Number of samples, samples = Sample data)"] +#[doc = "Auxiliary output callback function. (data = User provided data, nsamples = Number of samples, samples = Sample data)"] pub type ndspAuxCallback = ::core::option::Option< unsafe extern "C" fn( data: *mut ::libc::c_void, @@ -17142,7 +17142,7 @@ pub type ndspAuxCallback = ::core::option::Option< ), >; extern "C" { - #[doc = "Initialization and basic operations\n# **\n* Sets up the DSP component.\n* # Arguments\n\n* `binary` - DSP binary to load.\n* * `size` - Size of the DSP binary.\n* * `progMask` - Program RAM block mask to load the binary to.\n* * `dataMask` - Data RAM block mask to load the binary to.\n*/"] + #[doc = "Initialization and basic operations\n# *\n* Sets up the DSP component.\n # Arguments\n\n* `binary` - DSP binary to load.\n * `size` - Size of the DSP binary.\n * `progMask` - Program RAM block mask to load the binary to.\n * `dataMask` - Data RAM block mask to load the binary to.\n/"] pub fn ndspUseComponent( binary: *const ::libc::c_void, size: u32_, @@ -17152,111 +17152,111 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Initializes NDSP."] + #[doc = "Initializes NDSP."] pub fn ndspInit() -> Result; } extern "C" { - #[doc = " Exits NDSP."] + #[doc = "Exits NDSP."] pub fn ndspExit(); } extern "C" { - #[doc = " Gets the number of dropped sound frames.\n # Returns\n\nThe number of dropped sound frames."] + #[doc = "Gets the number of dropped sound frames.\n # Returns\n\nThe number of dropped sound frames."] pub fn ndspGetDroppedFrames() -> u32_; } extern "C" { - #[doc = " Gets the total sound frame count.\n # Returns\n\nThe total sound frame count."] + #[doc = "Gets the total sound frame count.\n # Returns\n\nThe total sound frame count."] pub fn ndspGetFrameCount() -> u32_; } extern "C" { - #[doc = "General parameters\n# **\n* Sets the master volume.\n* # Arguments\n\n* `volume` - Volume to set. Defaults to 1.0f.\n*/"] + #[doc = "General parameters\n# *\n* Sets the master volume.\n # Arguments\n\n* `volume` - Volume to set. Defaults to 1.0f.\n/"] pub fn ndspSetMasterVol(volume: f32); } extern "C" { - #[doc = " Gets the master volume.\n # Returns\n\nThe master volume."] + #[doc = "Gets the master volume.\n # Returns\n\nThe master volume."] pub fn ndspGetMasterVol() -> f32; } extern "C" { - #[doc = " Sets the output mode.\n # Arguments\n\n* `mode` - Output mode to set. Defaults to NDSP_OUTPUT_STEREO."] + #[doc = "Sets the output mode.\n # Arguments\n\n* `mode` - Output mode to set. Defaults to NDSP_OUTPUT_STEREO."] pub fn ndspSetOutputMode(mode: ndspOutputMode); } extern "C" { - #[doc = " Gets the output mode.\n # Returns\n\nThe output mode."] + #[doc = "Gets the output mode.\n # Returns\n\nThe output mode."] pub fn ndspGetOutputMode() -> ndspOutputMode; } extern "C" { - #[doc = " Sets the clipping mode.\n # Arguments\n\n* `mode` - Clipping mode to set. Defaults to NDSP_CLIP_SOFT."] + #[doc = "Sets the clipping mode.\n # Arguments\n\n* `mode` - Clipping mode to set. Defaults to NDSP_CLIP_SOFT."] pub fn ndspSetClippingMode(mode: ndspClippingMode); } extern "C" { - #[doc = " Gets the clipping mode.\n # Returns\n\nThe clipping mode."] + #[doc = "Gets the clipping mode.\n # Returns\n\nThe clipping mode."] pub fn ndspGetClippingMode() -> ndspClippingMode; } extern "C" { - #[doc = " Sets the output count.\n # Arguments\n\n* `count` - Output count to set. Defaults to 2."] + #[doc = "Sets the output count.\n # Arguments\n\n* `count` - Output count to set. Defaults to 2."] pub fn ndspSetOutputCount(count: ::libc::c_int); } extern "C" { - #[doc = " Gets the output count.\n # Returns\n\nThe output count."] + #[doc = "Gets the output count.\n # Returns\n\nThe output count."] pub fn ndspGetOutputCount() -> ::libc::c_int; } extern "C" { - #[doc = " Sets the wave buffer to capture audio to.\n # Arguments\n\n* `capture` - Wave buffer to capture to."] + #[doc = "Sets the wave buffer to capture audio to.\n # Arguments\n\n* `capture` - Wave buffer to capture to."] pub fn ndspSetCapture(capture: *mut ndspWaveBuf); } extern "C" { - #[doc = " Sets the sound frame callback.\n # Arguments\n\n* `callback` - Callback to set.\n * `data` - User-defined data to pass to the callback."] + #[doc = "Sets the sound frame callback.\n # Arguments\n\n* `callback` - Callback to set.\n * `data` - User-defined data to pass to the callback."] pub fn ndspSetCallback(callback: ndspCallback, data: *mut ::libc::c_void); } extern "C" { - #[doc = "Surround\n# **\n* Sets the surround sound depth.\n* # Arguments\n\n* `depth` - Depth to set. Defaults to 0x7FFF.\n*/"] + #[doc = "Surround\n# *\n* Sets the surround sound depth.\n # Arguments\n\n* `depth` - Depth to set. Defaults to 0x7FFF.\n/"] pub fn ndspSurroundSetDepth(depth: u16_); } extern "C" { - #[doc = " Gets the surround sound depth.\n # Returns\n\nThe surround sound depth."] + #[doc = "Gets the surround sound depth.\n # Returns\n\nThe surround sound depth."] pub fn ndspSurroundGetDepth() -> u16_; } extern "C" { - #[doc = " Sets the surround sound position.\n # Arguments\n\n* `pos` - Position to set. Defaults to NDSP_SPKPOS_SQUARE."] + #[doc = "Sets the surround sound position.\n # Arguments\n\n* `pos` - Position to set. Defaults to NDSP_SPKPOS_SQUARE."] pub fn ndspSurroundSetPos(pos: ndspSpeakerPos); } extern "C" { - #[doc = " Gets the surround sound position.\n # Returns\n\nThe surround sound speaker position."] + #[doc = "Gets the surround sound position.\n # Returns\n\nThe surround sound speaker position."] pub fn ndspSurroundGetPos() -> ndspSpeakerPos; } extern "C" { - #[doc = " Sets the surround sound rear ratio.\n # Arguments\n\n* `ratio` - Rear ratio to set. Defaults to 0x8000."] + #[doc = "Sets the surround sound rear ratio.\n # Arguments\n\n* `ratio` - Rear ratio to set. Defaults to 0x8000."] pub fn ndspSurroundSetRearRatio(ratio: u16_); } extern "C" { - #[doc = " Gets the surround sound rear ratio.\n # Returns\n\nThe rear ratio."] + #[doc = "Gets the surround sound rear ratio.\n # Returns\n\nThe rear ratio."] pub fn ndspSurroundGetRearRatio() -> u16_; } extern "C" { - #[doc = "Auxiliary output\n# **\n* Configures whether an auxiliary output is enabled.\n* # Arguments\n\n* `id` - ID of the auxiliary output.\n* * `enable` - Whether to enable the auxiliary output.\n*/"] + #[doc = "Auxiliary output\n# *\n* Configures whether an auxiliary output is enabled.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n * `enable` - Whether to enable the auxiliary output.\n/"] pub fn ndspAuxSetEnable(id: ::libc::c_int, enable: bool); } extern "C" { - #[doc = " Gets whether auxiliary output is enabled.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n # Returns\n\nWhether auxiliary output is enabled."] + #[doc = "Gets whether auxiliary output is enabled.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n # Returns\n\nWhether auxiliary output is enabled."] pub fn ndspAuxIsEnabled(id: ::libc::c_int) -> bool; } extern "C" { - #[doc = " Configures whether an auxiliary output should use front bypass.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n * `bypass` - Whether to use front bypass."] + #[doc = "Configures whether an auxiliary output should use front bypass.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n * `bypass` - Whether to use front bypass."] pub fn ndspAuxSetFrontBypass(id: ::libc::c_int, bypass: bool); } extern "C" { - #[doc = " Gets whether auxiliary output front bypass is enabled.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n # Returns\n\nWhether auxiliary output front bypass is enabled."] + #[doc = "Gets whether auxiliary output front bypass is enabled.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n # Returns\n\nWhether auxiliary output front bypass is enabled."] pub fn ndspAuxGetFrontBypass(id: ::libc::c_int) -> bool; } extern "C" { - #[doc = " Sets the volume of an auxiliary output.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n * `volume` - Volume to set."] + #[doc = "Sets the volume of an auxiliary output.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n * `volume` - Volume to set."] pub fn ndspAuxSetVolume(id: ::libc::c_int, volume: f32); } extern "C" { - #[doc = " Gets the volume of an auxiliary output.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n # Returns\n\nVolume of the auxiliary output."] + #[doc = "Gets the volume of an auxiliary output.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n # Returns\n\nVolume of the auxiliary output."] pub fn ndspAuxGetVolume(id: ::libc::c_int) -> f32; } extern "C" { - #[doc = " Sets the callback of an auxiliary output.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n * `callback` - Callback to set.\n * `data` - User-defined data to pass to the callback."] + #[doc = "Sets the callback of an auxiliary output.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n * `callback` - Callback to set.\n * `data` - User-defined data to pass to the callback."] pub fn ndspAuxSetCallback( id: ::libc::c_int, callback: ndspAuxCallback, @@ -17271,11 +17271,11 @@ pub const NDSP_ENCODING_PCM16: _bindgen_ty_30 = 1; pub const NDSP_ENCODING_ADPCM: _bindgen_ty_30 = 2; #[doc = "Data types\n# Supported sample encodings."] pub type _bindgen_ty_30 = ::libc::c_uint; -#[doc = "< Buffer contains Mono PCM8."] +#[doc = "< Buffer contains Mono PCM8."] pub const NDSP_FORMAT_MONO_PCM8: _bindgen_ty_31 = 1; -#[doc = "< Buffer contains Mono PCM16."] +#[doc = "< Buffer contains Mono PCM16."] pub const NDSP_FORMAT_MONO_PCM16: _bindgen_ty_31 = 5; -#[doc = "< Buffer contains Mono ADPCM."] +#[doc = "< Buffer contains Mono ADPCM."] pub const NDSP_FORMAT_MONO_ADPCM: _bindgen_ty_31 = 9; #[doc = "< Buffer contains Stereo PCM8."] pub const NDSP_FORMAT_STEREO_PCM8: _bindgen_ty_31 = 2; @@ -17291,7 +17291,7 @@ pub const NDSP_FORMAT_ADPCM: _bindgen_ty_31 = 9; pub const NDSP_FRONT_BYPASS: _bindgen_ty_31 = 16; #[doc = "< (?) Unknown, under research"] pub const NDSP_3D_SURROUND_PREPROCESSED: _bindgen_ty_31 = 64; -#[doc = " Channel format flags for use with ndspChnSetFormat."] +#[doc = "Channel format flags for use with ndspChnSetFormat."] pub type _bindgen_ty_31 = ::libc::c_uint; #[doc = "< Polyphase interpolation"] pub const NDSP_INTERP_POLYPHASE: ndspInterpType = 0; @@ -17299,86 +17299,86 @@ pub const NDSP_INTERP_POLYPHASE: ndspInterpType = 0; pub const NDSP_INTERP_LINEAR: ndspInterpType = 1; #[doc = "< No interpolation"] pub const NDSP_INTERP_NONE: ndspInterpType = 2; -#[doc = " Interpolation types."] +#[doc = "Interpolation types."] pub type ndspInterpType = ::libc::c_uint; extern "C" { - #[doc = "Basic channel operation\n# **\n* Resets a channel.\n* # Arguments\n\n* `id` - ID of the channel (0..23).\n*/"] + #[doc = "Basic channel operation\n# *\n* Resets a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n/"] pub fn ndspChnReset(id: ::libc::c_int); } extern "C" { - #[doc = " Initializes the parameters of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23)."] + #[doc = "Initializes the parameters of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23)."] pub fn ndspChnInitParams(id: ::libc::c_int); } extern "C" { - #[doc = " Checks whether a channel is currently playing.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n # Returns\n\nWhether the channel is currently playing."] + #[doc = "Checks whether a channel is currently playing.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n # Returns\n\nWhether the channel is currently playing."] pub fn ndspChnIsPlaying(id: ::libc::c_int) -> bool; } extern "C" { - #[doc = " Gets the current sample position of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n # Returns\n\nThe channel's sample position."] + #[doc = "Gets the current sample position of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n # Returns\n\nThe channel's sample position."] pub fn ndspChnGetSamplePos(id: ::libc::c_int) -> u32_; } extern "C" { - #[doc = " Gets the sequence ID of the wave buffer that is currently playing in a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n # Returns\n\nThe sequence ID of the wave buffer."] + #[doc = "Gets the sequence ID of the wave buffer that is currently playing in a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n # Returns\n\nThe sequence ID of the wave buffer."] pub fn ndspChnGetWaveBufSeq(id: ::libc::c_int) -> u16_; } extern "C" { - #[doc = " Checks whether a channel is currently paused.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n # Returns\n\nWhether the channel is currently paused."] + #[doc = "Checks whether a channel is currently paused.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n # Returns\n\nWhether the channel is currently paused."] pub fn ndspChnIsPaused(id: ::libc::c_int) -> bool; } extern "C" { - #[doc = " Sets the pause status of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `paused` - Whether the channel is to be paused (true) or unpaused (false)."] + #[doc = "Sets the pause status of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `paused` - Whether the channel is to be paused (true) or unpaused (false)."] pub fn ndspChnSetPaused(id: ::libc::c_int, paused: bool); } extern "C" { - #[doc = "Configuration\n# **\n* Sets the format of a channel.\n* # Arguments\n\n* `id` - ID of the channel (0..23).\n* * `format` - Format to use.\n*/"] + #[doc = "Configuration\n# *\n* Sets the format of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `format` - Format to use.\n/"] pub fn ndspChnSetFormat(id: ::libc::c_int, format: u16_); } extern "C" { - #[doc = " Gets the format of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n # Returns\n\nThe format of the channel."] + #[doc = "Gets the format of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n # Returns\n\nThe format of the channel."] pub fn ndspChnGetFormat(id: ::libc::c_int) -> u16_; } extern "C" { - #[doc = " Sets the interpolation type of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `type` - Interpolation type to use."] + #[doc = "Sets the interpolation type of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `type` - Interpolation type to use."] pub fn ndspChnSetInterp(id: ::libc::c_int, type_: ndspInterpType); } extern "C" { - #[doc = " Gets the interpolation type of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n # Returns\n\nThe interpolation type of the channel."] + #[doc = "Gets the interpolation type of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n # Returns\n\nThe interpolation type of the channel."] pub fn ndspChnGetInterp(id: ::libc::c_int) -> ndspInterpType; } extern "C" { - #[doc = " Sets the sample rate of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `rate` - Sample rate to use."] + #[doc = "Sets the sample rate of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `rate` - Sample rate to use."] pub fn ndspChnSetRate(id: ::libc::c_int, rate: f32); } extern "C" { - #[doc = " Gets the sample rate of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n # Returns\n\nThe sample rate of the channel."] + #[doc = "Gets the sample rate of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n # Returns\n\nThe sample rate of the channel."] pub fn ndspChnGetRate(id: ::libc::c_int) -> f32; } extern "C" { - #[doc = " Sets the mix parameters (volumes) of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `mix` - Mix parameters to use. Working hypothesis:\n - 0: Front left volume.\n - 1: Front right volume.\n - 2: Back left volume:\n - 3: Back right volume:\n - 4..7: Same as 0..3, but for auxiliary output 0.\n - 8..11: Same as 0..3, but for auxiliary output 1."] + #[doc = "Sets the mix parameters (volumes) of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `mix` - Mix parameters to use. Working hypothesis:\n - 0: Front left volume.\n - 1: Front right volume.\n - 2: Back left volume:\n - 3: Back right volume:\n - 4..7: Same as 0..3, but for auxiliary output 0.\n - 8..11: Same as 0..3, but for auxiliary output 1."] pub fn ndspChnSetMix(id: ::libc::c_int, mix: *mut f32); } extern "C" { - #[doc = " Gets the mix parameters (volumes) of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23)\n * `mix` - Mix parameters to write out to. See ndspChnSetMix."] + #[doc = "Gets the mix parameters (volumes) of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23)\n * `mix` - Mix parameters to write out to. See ndspChnSetMix."] pub fn ndspChnGetMix(id: ::libc::c_int, mix: *mut f32); } extern "C" { - #[doc = " Sets the DSPADPCM coefficients of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `coefs` - DSPADPCM coefficients to use."] + #[doc = "Sets the DSPADPCM coefficients of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `coefs` - DSPADPCM coefficients to use."] pub fn ndspChnSetAdpcmCoefs(id: ::libc::c_int, coefs: *mut u16_); } extern "C" { - #[doc = "Wave buffers\n# **\n* Clears the wave buffer queue of a channel and stops playback.\n* # Arguments\n\n* `id` - ID of the channel (0..23).\n*/"] + #[doc = "Wave buffers\n# *\n* Clears the wave buffer queue of a channel and stops playback.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n/"] pub fn ndspChnWaveBufClear(id: ::libc::c_int); } extern "C" { - #[doc = " Adds a wave buffer to the wave buffer queue of a channel.\n > If the channel's wave buffer queue was empty before the use of this function, playback is started.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `buf` - Wave buffer to add."] + #[doc = "Adds a wave buffer to the wave buffer queue of a channel.\n > If the channel's wave buffer queue was empty before the use of this function, playback is started.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `buf` - Wave buffer to add."] pub fn ndspChnWaveBufAdd(id: ::libc::c_int, buf: *mut ndspWaveBuf); } extern "C" { - #[doc = "IIR filters\n# **\n* Configures whether the IIR monopole filter of a channel is enabled.\n* # Arguments\n\n* `id` - ID of the channel (0..23).\n* * `enable` - Whether to enable the IIR monopole filter.\n*/"] + #[doc = "IIR filters\n# *\n* Configures whether the IIR monopole filter of a channel is enabled.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `enable` - Whether to enable the IIR monopole filter.\n/"] pub fn ndspChnIirMonoSetEnable(id: ::libc::c_int, enable: bool); } extern "C" { - #[doc = " Manually sets up the parameters on monopole filter\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `enable` - Whether to enable the IIR monopole filter."] + #[doc = "Manually sets up the parameters on monopole filter\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `enable` - Whether to enable the IIR monopole filter."] pub fn ndspChnIirMonoSetParamsCustomFilter( id: ::libc::c_int, a0: f32, @@ -17387,19 +17387,19 @@ extern "C" { ) -> bool; } extern "C" { - #[doc = " Sets the monopole to be a low pass filter. (Note: This is a lower-quality filter than the biquad one.)\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `f0` - Low pass cut-off frequency."] + #[doc = "Sets the monopole to be a low pass filter. (Note: This is a lower-quality filter than the biquad one.)\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `f0` - Low pass cut-off frequency."] pub fn ndspChnIirMonoSetParamsLowPassFilter(id: ::libc::c_int, f0: f32) -> bool; } extern "C" { - #[doc = " Sets the monopole to be a high pass filter. (Note: This is a lower-quality filter than the biquad one.)\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `f0` - High pass cut-off frequency."] + #[doc = "Sets the monopole to be a high pass filter. (Note: This is a lower-quality filter than the biquad one.)\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `f0` - High pass cut-off frequency."] pub fn ndspChnIirMonoSetParamsHighPassFilter(id: ::libc::c_int, f0: f32) -> bool; } extern "C" { - #[doc = " Configures whether the IIR biquad filter of a channel is enabled.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `enable` - Whether to enable the IIR biquad filter."] + #[doc = "Configures whether the IIR biquad filter of a channel is enabled.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `enable` - Whether to enable the IIR biquad filter."] pub fn ndspChnIirBiquadSetEnable(id: ::libc::c_int, enable: bool); } extern "C" { - #[doc = " Manually sets up the parameters of the biquad filter\n # Arguments\n\n* `id` - ID of the channel (0..23)."] + #[doc = "Manually sets up the parameters of the biquad filter\n # Arguments\n\n* `id` - ID of the channel (0..23)."] pub fn ndspChnIirBiquadSetParamsCustomFilter( id: ::libc::c_int, a0: f32, @@ -17411,23 +17411,23 @@ extern "C" { ) -> bool; } extern "C" { - #[doc = " Sets the biquad to be a low pass filter.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `f0` - Low pass cut-off frequency.\n * `Q` - \"Quality factor\", typically should be sqrt(2)/2 (i.e. 0.7071)."] + #[doc = "Sets the biquad to be a low pass filter.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `f0` - Low pass cut-off frequency.\n * `Q` - \"Quality factor\", typically should be sqrt(2)/2 (i.e. 0.7071)."] pub fn ndspChnIirBiquadSetParamsLowPassFilter(id: ::libc::c_int, f0: f32, Q: f32) -> bool; } extern "C" { - #[doc = " Sets the biquad to be a high pass filter.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `f0` - High pass cut-off frequency.\n * `Q` - \"Quality factor\", typically should be sqrt(2)/2 (i.e. 0.7071)."] + #[doc = "Sets the biquad to be a high pass filter.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `f0` - High pass cut-off frequency.\n * `Q` - \"Quality factor\", typically should be sqrt(2)/2 (i.e. 0.7071)."] pub fn ndspChnIirBiquadSetParamsHighPassFilter(id: ::libc::c_int, f0: f32, Q: f32) -> bool; } extern "C" { - #[doc = " Sets the biquad to be a band pass filter.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `f0` - Mid-frequency.\n * `Q` - \"Quality factor\", typically should be sqrt(2)/2 (i.e. 0.7071)."] + #[doc = "Sets the biquad to be a band pass filter.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `f0` - Mid-frequency.\n * `Q` - \"Quality factor\", typically should be sqrt(2)/2 (i.e. 0.7071)."] pub fn ndspChnIirBiquadSetParamsBandPassFilter(id: ::libc::c_int, f0: f32, Q: f32) -> bool; } extern "C" { - #[doc = " Sets the biquad to be a notch filter.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `f0` - Notch frequency.\n * `Q` - \"Quality factor\", typically should be sqrt(2)/2 (i.e. 0.7071)."] + #[doc = "Sets the biquad to be a notch filter.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `f0` - Notch frequency.\n * `Q` - \"Quality factor\", typically should be sqrt(2)/2 (i.e. 0.7071)."] pub fn ndspChnIirBiquadSetParamsNotchFilter(id: ::libc::c_int, f0: f32, Q: f32) -> bool; } extern "C" { - #[doc = " Sets the biquad to be a peaking equalizer.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `f0` - Central frequency.\n * `Q` - \"Quality factor\", typically should be sqrt(2)/2 (i.e. 0.7071).\n * `gain` - Amount of gain (raw value = 10 ^ dB/40)"] + #[doc = "Sets the biquad to be a peaking equalizer.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `f0` - Central frequency.\n * `Q` - \"Quality factor\", typically should be sqrt(2)/2 (i.e. 0.7071).\n * `gain` - Amount of gain (raw value = 10 ^ dB/40)"] pub fn ndspChnIirBiquadSetParamsPeakingEqualizer( id: ::libc::c_int, f0: f32, @@ -17443,7 +17443,7 @@ pub const SWKBD_TYPE_QWERTY: SwkbdType = 1; pub const SWKBD_TYPE_NUMPAD: SwkbdType = 2; #[doc = "< On JPN systems, a text keyboard without Japanese input capabilities, otherwise same as SWKBD_TYPE_NORMAL."] pub const SWKBD_TYPE_WESTERN: SwkbdType = 3; -#[doc = " Keyboard types."] +#[doc = "Keyboard types."] pub type SwkbdType = ::libc::c_uint; #[doc = "< All inputs are accepted."] pub const SWKBD_ANYTHING: SwkbdValidInput = 0; @@ -17456,7 +17456,7 @@ pub const SWKBD_NOTBLANK_NOTEMPTY: SwkbdValidInput = 2; pub const SWKBD_NOTBLANK: SwkbdValidInput = 3; #[doc = "< The input must have a fixed length (specified by maxTextLength in swkbdInit)."] pub const SWKBD_FIXEDLEN: SwkbdValidInput = 4; -#[doc = " Accepted input types."] +#[doc = "Accepted input types."] pub type SwkbdValidInput = ::libc::c_uint; #[doc = "< Left button (usually Cancel)"] pub const SWKBD_BUTTON_LEFT: SwkbdButton = 0; @@ -17467,7 +17467,7 @@ pub const SWKBD_BUTTON_RIGHT: SwkbdButton = 2; pub const SWKBD_BUTTON_CONFIRM: SwkbdButton = 2; #[doc = "< No button (returned by swkbdInputText in special cases)"] pub const SWKBD_BUTTON_NONE: SwkbdButton = 3; -#[doc = " Keyboard dialog buttons."] +#[doc = "Keyboard dialog buttons."] pub type SwkbdButton = ::libc::c_uint; #[doc = "< Characters are not concealed."] pub const SWKBD_PASSWORD_NONE: SwkbdPasswordMode = 0; @@ -17475,7 +17475,7 @@ pub const SWKBD_PASSWORD_NONE: SwkbdPasswordMode = 0; pub const SWKBD_PASSWORD_HIDE: SwkbdPasswordMode = 1; #[doc = "< Characters are concealed a second after they've been typed."] pub const SWKBD_PASSWORD_HIDE_DELAY: SwkbdPasswordMode = 2; -#[doc = " Keyboard password modes."] +#[doc = "Keyboard password modes."] pub type SwkbdPasswordMode = ::libc::c_uint; #[doc = "< Disallow the use of more than a certain number of digits (0 or more)"] pub const SWKBD_FILTER_DIGITS: _bindgen_ty_32 = 1; @@ -17489,7 +17489,7 @@ pub const SWKBD_FILTER_BACKSLASH: _bindgen_ty_32 = 8; pub const SWKBD_FILTER_PROFANITY: _bindgen_ty_32 = 16; #[doc = "< Use a callback in order to check the input."] pub const SWKBD_FILTER_CALLBACK: _bindgen_ty_32 = 32; -#[doc = " Keyboard input filtering flags."] +#[doc = "Keyboard input filtering flags."] pub type _bindgen_ty_32 = ::libc::c_uint; #[doc = "< Parental PIN mode."] pub const SWKBD_PARENTAL: _bindgen_ty_33 = 1; @@ -17509,7 +17509,7 @@ pub const SWKBD_ALLOW_RESET: _bindgen_ty_33 = 64; pub const SWKBD_ALLOW_POWER: _bindgen_ty_33 = 128; #[doc = "< Default to the QWERTY page when the keyboard is shown."] pub const SWKBD_DEFAULT_QWERTY: _bindgen_ty_33 = 512; -#[doc = " Keyboard features."] +#[doc = "Keyboard features."] pub type _bindgen_ty_33 = ::libc::c_uint; #[doc = "< Specifies that the input is valid."] pub const SWKBD_CALLBACK_OK: SwkbdCallbackResult = 0; @@ -17517,7 +17517,7 @@ pub const SWKBD_CALLBACK_OK: SwkbdCallbackResult = 0; pub const SWKBD_CALLBACK_CLOSE: SwkbdCallbackResult = 1; #[doc = "< Displays an error message and continues displaying the keyboard."] pub const SWKBD_CALLBACK_CONTINUE: SwkbdCallbackResult = 2; -#[doc = " Keyboard filter callback return values."] +#[doc = "Keyboard filter callback return values."] pub type SwkbdCallbackResult = ::libc::c_uint; #[doc = "< Dummy/unused."] pub const SWKBD_NONE: SwkbdResult = -1; @@ -17549,9 +17549,9 @@ pub const SWKBD_PARENTAL_OK: SwkbdResult = 20; pub const SWKBD_PARENTAL_FAIL: SwkbdResult = 21; #[doc = "< The filter callback returned SWKBD_CALLBACK_CLOSE."] pub const SWKBD_BANNED_INPUT: SwkbdResult = 30; -#[doc = " Keyboard return values."] +#[doc = "Keyboard return values."] pub type SwkbdResult = ::libc::c_int; -#[doc = " Keyboard dictionary word for predictive input."] +#[doc = "Keyboard dictionary word for predictive input."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct SwkbdDictWord { @@ -17573,7 +17573,7 @@ impl Default for SwkbdDictWord { } } } -#[doc = " Keyboard filter callback function."] +#[doc = "Keyboard filter callback function."] pub type SwkbdCallbackFn = ::core::option::Option< unsafe extern "C" fn( user: *mut ::libc::c_void, @@ -17582,13 +17582,13 @@ pub type SwkbdCallbackFn = ::core::option::Option< textlen: usize, ) -> SwkbdCallbackResult, >; -#[doc = " Keyboard status data."] +#[doc = "Keyboard status data."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct SwkbdStatusData { pub data: [u32_; 17usize], } -#[doc = " Keyboard predictive input learning data."] +#[doc = "Keyboard predictive input learning data."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct SwkbdLearningData { @@ -17603,7 +17603,7 @@ impl Default for SwkbdLearningData { } } } -#[doc = " Internal libctru book-keeping structure for software keyboards."] +#[doc = "Internal libctru book-keeping structure for software keyboards."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct SwkbdExtra { @@ -17623,7 +17623,7 @@ impl Default for SwkbdExtra { } } } -#[doc = " Software keyboard parameter structure, it shouldn't be modified directly."] +#[doc = "Software keyboard parameter structure, it shouldn't be modified directly."] #[repr(C)] #[derive(Copy, Clone)] pub struct SwkbdState { @@ -17692,7 +17692,7 @@ impl Default for SwkbdState { } } extern "C" { - #[doc = " Initializes software keyboard status.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `type` - Keyboard type.\n * `numButtons` - Number of dialog buttons to display (1, 2 or 3).\n * `maxTextLength` - Maximum number of UTF-16 code units that input text can have (or -1 to let libctru use a big default)."] + #[doc = "Initializes software keyboard status.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `type` - Keyboard type.\n * `numButtons` - Number of dialog buttons to display (1, 2 or 3).\n * `maxTextLength` - Maximum number of UTF-16 code units that input text can have (or -1 to let libctru use a big default)."] pub fn swkbdInit( swkbd: *mut SwkbdState, type_: SwkbdType, @@ -17701,15 +17701,15 @@ extern "C" { ); } extern "C" { - #[doc = " Specifies which special features are enabled in a software keyboard.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `features` - Feature bitmask."] + #[doc = "Specifies which special features are enabled in a software keyboard.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `features` - Feature bitmask."] pub fn swkbdSetFeatures(swkbd: *mut SwkbdState, features: u32_); } extern "C" { - #[doc = " Sets the hint text of a software keyboard (that is, the help text that is displayed when the textbox is empty).\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `text` - Hint text."] + #[doc = "Sets the hint text of a software keyboard (that is, the help text that is displayed when the textbox is empty).\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `text` - Hint text."] pub fn swkbdSetHintText(swkbd: *mut SwkbdState, text: *const ::libc::c_char); } extern "C" { - #[doc = " Configures a dialog button in a software keyboard.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `button` - Specifies which button to configure.\n * `text` - Button text.\n * `submit` - Specifies whether pushing the button will submit the text or discard it."] + #[doc = "Configures a dialog button in a software keyboard.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `button` - Specifies which button to configure.\n * `text` - Button text.\n * `submit` - Specifies whether pushing the button will submit the text or discard it."] pub fn swkbdSetButton( swkbd: *mut SwkbdState, button: SwkbdButton, @@ -17718,11 +17718,11 @@ extern "C" { ); } extern "C" { - #[doc = " Sets the initial text that a software keyboard will display on launch.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `text` - Initial text."] + #[doc = "Sets the initial text that a software keyboard will display on launch.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `text` - Initial text."] pub fn swkbdSetInitialText(swkbd: *mut SwkbdState, text: *const ::libc::c_char); } extern "C" { - #[doc = " Configures a word in a predictive dictionary for use with a software keyboard.\n # Arguments\n\n* `word` - Pointer to dictionary word structure.\n * `reading` - Reading of the word, that is, the sequence of characters that need to be typed to trigger the word in the predictive input system.\n * `text` - Spelling of the word, that is, the actual characters that will be produced when the user decides to select the word."] + #[doc = "Configures a word in a predictive dictionary for use with a software keyboard.\n # Arguments\n\n* `word` - Pointer to dictionary word structure.\n * `reading` - Reading of the word, that is, the sequence of characters that need to be typed to trigger the word in the predictive input system.\n * `text` - Spelling of the word, that is, the actual characters that will be produced when the user decides to select the word."] pub fn swkbdSetDictWord( word: *mut SwkbdDictWord, reading: *const ::libc::c_char, @@ -17730,7 +17730,7 @@ extern "C" { ); } extern "C" { - #[doc = " Sets the custom word dictionary to be used with the predictive input system of a software keyboard.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `dict` - Pointer to dictionary words.\n * `wordCount` - Number of words in the dictionary."] + #[doc = "Sets the custom word dictionary to be used with the predictive input system of a software keyboard.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `dict` - Pointer to dictionary words.\n * `wordCount` - Number of words in the dictionary."] pub fn swkbdSetDictionary( swkbd: *mut SwkbdState, dict: *const SwkbdDictWord, @@ -17738,7 +17738,7 @@ extern "C" { ); } extern "C" { - #[doc = " Configures software keyboard internal status management.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `data` - Pointer to internal status structure (can be in, out or both depending on the other parameters).\n * `in` - Specifies whether the data should be read from the structure when the keyboard is launched.\n * `out` - Specifies whether the data should be written to the structure when the keyboard is closed."] + #[doc = "Configures software keyboard internal status management.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `data` - Pointer to internal status structure (can be in, out or both depending on the other parameters).\n * `in` - Specifies whether the data should be read from the structure when the keyboard is launched.\n * `out` - Specifies whether the data should be written to the structure when the keyboard is closed."] pub fn swkbdSetStatusData( swkbd: *mut SwkbdState, data: *mut SwkbdStatusData, @@ -17747,7 +17747,7 @@ extern "C" { ); } extern "C" { - #[doc = " Configures software keyboard predictive input learning data management.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `data` - Pointer to learning data structure (can be in, out or both depending on the other parameters).\n * `in` - Specifies whether the data should be read from the structure when the keyboard is launched.\n * `out` - Specifies whether the data should be written to the structure when the keyboard is closed."] + #[doc = "Configures software keyboard predictive input learning data management.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `data` - Pointer to learning data structure (can be in, out or both depending on the other parameters).\n * `in` - Specifies whether the data should be read from the structure when the keyboard is launched.\n * `out` - Specifies whether the data should be written to the structure when the keyboard is closed."] pub fn swkbdSetLearningData( swkbd: *mut SwkbdState, data: *mut SwkbdLearningData, @@ -17756,7 +17756,7 @@ extern "C" { ); } extern "C" { - #[doc = " Configures a custom function to be used to check the validity of input when it is submitted in a software keyboard.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `callback` - Filter callback function.\n * `user` - Custom data to be passed to the callback function."] + #[doc = "Configures a custom function to be used to check the validity of input when it is submitted in a software keyboard.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `callback` - Filter callback function.\n * `user` - Custom data to be passed to the callback function."] pub fn swkbdSetFilterCallback( swkbd: *mut SwkbdState, callback: SwkbdCallbackFn, @@ -17764,7 +17764,7 @@ extern "C" { ); } extern "C" { - #[doc = " Launches a software keyboard in order to input text.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `buf` - Pointer to output buffer which will hold the inputted text.\n * `bufsize` - Maximum number of UTF-8 code units that the buffer can hold (including null terminator).\n # Returns\n\nThe identifier of the dialog button that was pressed, or SWKBD_BUTTON_NONE if a different condition was triggered - in that case use swkbdGetResult to check the condition."] + #[doc = "Launches a software keyboard in order to input text.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `buf` - Pointer to output buffer which will hold the inputted text.\n * `bufsize` - Maximum number of UTF-8 code units that the buffer can hold (including null terminator).\n # Returns\n\nThe identifier of the dialog button that was pressed, or SWKBD_BUTTON_NONE if a different condition was triggered - in that case use swkbdGetResult to check the condition."] pub fn swkbdInputText( swkbd: *mut SwkbdState, buf: *mut ::libc::c_char, @@ -17834,22 +17834,22 @@ impl Default for errorConf { } } extern "C" { - #[doc = " Init the error applet.\n # Arguments\n\n* `err` - Pointer to errorConf.\n * `type` - errorType Type of error.\n * `lang` - CFG_Language Lang of error."] + #[doc = "Init the error applet.\n # Arguments\n\n* `err` - Pointer to errorConf.\n * `type` - errorType Type of error.\n * `lang` - CFG_Language Lang of error."] pub fn errorInit(err: *mut errorConf, type_: errorType, lang: CFG_Language); } extern "C" { - #[doc = " Sets error code to display.\n # Arguments\n\n* `err` - Pointer to errorConf.\n * `error` - Error-code to display."] + #[doc = "Sets error code to display.\n # Arguments\n\n* `err` - Pointer to errorConf.\n * `error` - Error-code to display."] pub fn errorCode(err: *mut errorConf, error: ::libc::c_int); } extern "C" { - #[doc = " Sets error text to display.\n # Arguments\n\n* `err` - Pointer to errorConf.\n * `text` - Error-text to display."] + #[doc = "Sets error text to display.\n # Arguments\n\n* `err` - Pointer to errorConf.\n * `text` - Error-text to display."] pub fn errorText(err: *mut errorConf, text: *const ::libc::c_char); } extern "C" { - #[doc = " Displays the error applet.\n # Arguments\n\n* `err` - Pointer to errorConf."] + #[doc = "Displays the error applet.\n # Arguments\n\n* `err` - Pointer to errorConf."] pub fn errorDisp(err: *mut errorConf); } -#[doc = " Parameter structure passed to AppletEd"] +#[doc = "Parameter structure passed to AppletEd"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct MiiSelectorConf { @@ -17889,7 +17889,7 @@ impl Default for MiiSelectorConf { } } } -#[doc = " Structure written by AppletEd"] +#[doc = "Structure written by AppletEd"] #[repr(C)] pub struct MiiSelectorReturn { #[doc = "< 0 if a Mii was selected, 1 if the selection was\n< canceled."] @@ -17924,42 +17924,42 @@ pub const MIISELECTOR_GUESTS: _bindgen_ty_35 = 2; pub const MIISELECTOR_TOP: _bindgen_ty_35 = 4; #[doc = "< Start on guest page"] pub const MIISELECTOR_GUESTSTART: _bindgen_ty_35 = 8; -#[doc = " AppletEd options"] +#[doc = "AppletEd options"] pub type _bindgen_ty_35 = ::libc::c_uint; extern "C" { - #[doc = " Initialize Mii selector config\n # Arguments\n\n* `conf` - Pointer to Miiselector config."] + #[doc = "Initialize Mii selector config\n # Arguments\n\n* `conf` - Pointer to Miiselector config."] pub fn miiSelectorInit(conf: *mut MiiSelectorConf); } extern "C" { - #[doc = " Launch the Mii selector library applet\n\n # Arguments\n\n* `conf` - Configuration determining how the applet should behave"] + #[doc = "Launch the Mii selector library applet\n\n # Arguments\n\n* `conf` - Configuration determining how the applet should behave"] pub fn miiSelectorLaunch(conf: *const MiiSelectorConf, returnbuf: *mut MiiSelectorReturn); } extern "C" { - #[doc = " Sets title of the Mii selector library applet\n\n # Arguments\n\n* `conf` - Pointer to miiSelector configuration\n * `text` - Title text of Mii selector"] + #[doc = "Sets title of the Mii selector library applet\n\n # Arguments\n\n* `conf` - Pointer to miiSelector configuration\n * `text` - Title text of Mii selector"] pub fn miiSelectorSetTitle(conf: *mut MiiSelectorConf, text: *const ::libc::c_char); } extern "C" { - #[doc = " Specifies which special options are enabled in the Mii selector\n\n # Arguments\n\n* `conf` - Pointer to miiSelector configuration\n * `options` - Options bitmask"] + #[doc = "Specifies which special options are enabled in the Mii selector\n\n # Arguments\n\n* `conf` - Pointer to miiSelector configuration\n * `options` - Options bitmask"] pub fn miiSelectorSetOptions(conf: *mut MiiSelectorConf, options: u32_); } extern "C" { - #[doc = " Specifies which guest Miis will be selectable\n\n # Arguments\n\n* `conf` - Pointer to miiSelector configuration\n * `index` - Index of the guest Miis that will be whitelisted.\n MIISELECTOR_GUESTMII_SLOTS can be used to whitelist all the guest Miis."] + #[doc = "Specifies which guest Miis will be selectable\n\n # Arguments\n\n* `conf` - Pointer to miiSelector configuration\n * `index` - Index of the guest Miis that will be whitelisted.\n MIISELECTOR_GUESTMII_SLOTS can be used to whitelist all the guest Miis."] pub fn miiSelectorWhitelistGuestMii(conf: *mut MiiSelectorConf, index: u32_); } extern "C" { - #[doc = " Specifies which guest Miis will be unselectable\n\n # Arguments\n\n* `conf` - Pointer to miiSelector configuration\n * `index` - Index of the guest Miis that will be blacklisted.\n MIISELECTOR_GUESTMII_SLOTS can be used to blacklist all the guest Miis."] + #[doc = "Specifies which guest Miis will be unselectable\n\n # Arguments\n\n* `conf` - Pointer to miiSelector configuration\n * `index` - Index of the guest Miis that will be blacklisted.\n MIISELECTOR_GUESTMII_SLOTS can be used to blacklist all the guest Miis."] pub fn miiSelectorBlacklistGuestMii(conf: *mut MiiSelectorConf, index: u32_); } extern "C" { - #[doc = " Specifies which user Miis will be selectable\n\n # Arguments\n\n* `conf` - Pointer to miiSelector configuration\n * `index` - Index of the user Miis that will be whitelisted.\n MIISELECTOR_USERMII_SLOTS can be used to whitlist all the user Miis"] + #[doc = "Specifies which user Miis will be selectable\n\n # Arguments\n\n* `conf` - Pointer to miiSelector configuration\n * `index` - Index of the user Miis that will be whitelisted.\n MIISELECTOR_USERMII_SLOTS can be used to whitlist all the user Miis"] pub fn miiSelectorWhitelistUserMii(conf: *mut MiiSelectorConf, index: u32_); } extern "C" { - #[doc = " Specifies which user Miis will be selectable\n\n # Arguments\n\n* `conf` - Pointer to miiSelector configuration\n * `index` - Index of the user Miis that will be blacklisted.\n MIISELECTOR_USERMII_SLOTS can be used to blacklist all the user Miis"] + #[doc = "Specifies which user Miis will be selectable\n\n # Arguments\n\n* `conf` - Pointer to miiSelector configuration\n * `index` - Index of the user Miis that will be blacklisted.\n MIISELECTOR_USERMII_SLOTS can be used to blacklist all the user Miis"] pub fn miiSelectorBlacklistUserMii(conf: *mut MiiSelectorConf, index: u32_); } extern "C" { - #[doc = " Get Mii name\n\n # Arguments\n\n* `returnbuf` - Pointer to miiSelector return\n * `out` - String containing a Mii's name\n * `max_size` - Size of string. Since UTF8 characters range in size from 1-3 bytes\n (assuming that no non-BMP characters are used), this value should be 36 (or 30 if you are not\n dealing with guest miis)."] + #[doc = "Get Mii name\n\n # Arguments\n\n* `returnbuf` - Pointer to miiSelector return\n * `out` - String containing a Mii's name\n * `max_size` - Size of string. Since UTF8 characters range in size from 1-3 bytes\n (assuming that no non-BMP characters are used), this value should be 36 (or 30 if you are not\n dealing with guest miis)."] pub fn miiSelectorReturnGetName( returnbuf: *const MiiSelectorReturn, out: *mut ::libc::c_char, @@ -17967,7 +17967,7 @@ extern "C" { ); } extern "C" { - #[doc = " Get Mii Author\n\n # Arguments\n\n* `returnbuf` - Pointer to miiSelector return\n * `out` - String containing a Mii's author\n * `max_size` - Size of string. Since UTF8 characters range in size from 1-3 bytes\n (assuming that no non-BMP characters are used), this value should be 30."] + #[doc = "Get Mii Author\n\n # Arguments\n\n* `returnbuf` - Pointer to miiSelector return\n * `out` - String containing a Mii's author\n * `max_size` - Size of string. Since UTF8 characters range in size from 1-3 bytes\n (assuming that no non-BMP characters are used), this value should be 30."] pub fn miiSelectorReturnGetAuthor( returnbuf: *const MiiSelectorReturn, out: *mut ::libc::c_char, @@ -17975,21 +17975,21 @@ extern "C" { ); } extern "C" { - #[doc = " Verifies that the Mii data returned from the applet matches its\n checksum\n\n # Arguments\n\n* `returnbuf` - Buffer filled by Mii selector applet\n # Returns\n\n`true` if `returnbuf->checksum` is the same as the one computed from `returnbuf`"] + #[doc = "Verifies that the Mii data returned from the applet matches its\n checksum\n\n # Arguments\n\n* `returnbuf` - Buffer filled by Mii selector applet\n # Returns\n\n`true` if `returnbuf->checksum` is the same as the one computed from `returnbuf`"] pub fn miiSelectorChecksumIsValid(returnbuf: *const MiiSelectorReturn) -> bool; } -#[doc = " Open directory struct"] +#[doc = "Open directory struct"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct archive_dir_t { pub magic: u32_, - #[doc = " \"arch\""] + #[doc = "\"arch\""] pub fd: Handle, - #[doc = " CTRU handle"] + #[doc = "CTRU handle"] pub index: isize, - #[doc = " Current entry index"] + #[doc = "Current entry index"] pub size: usize, - #[doc = " Current batch size"] + #[doc = "Current batch size"] pub entry_data: [FS_DirectoryEntry; 32usize], } impl Default for archive_dir_t { @@ -18003,12 +18003,12 @@ impl Default for archive_dir_t { } extern "C" { #[must_use] - #[doc = " Mounts the SD"] + #[doc = "Mounts the SD"] pub fn archiveMountSdmc() -> Result; } extern "C" { #[must_use] - #[doc = " Mounts and opens an archive as deviceName\n Returns either an archive open error code, or -1 for generic failure"] + #[doc = "Mounts and opens an archive as deviceName\n Returns either an archive open error code, or -1 for generic failure"] pub fn archiveMount( archiveID: FS_ArchiveID, archivePath: FS_Path, @@ -18017,25 +18017,25 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Uses FSUSER_ControlArchive with control action ARCHIVE_ACTION_COMMIT_SAVE_DATA on the opened archive. Not done automatically at unmount.\n Returns -1 if the specified device is not found"] + #[doc = "Uses FSUSER_ControlArchive with control action ARCHIVE_ACTION_COMMIT_SAVE_DATA on the opened archive. Not done automatically at unmount.\n Returns -1 if the specified device is not found"] pub fn archiveCommitSaveData(deviceName: *const ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = " Unmounts the specified device, closing its archive in the process\n Returns -1 if the specified device was not found"] + #[doc = "Unmounts the specified device, closing its archive in the process\n Returns -1 if the specified device was not found"] pub fn archiveUnmount(deviceName: *const ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = " Unmounts all devices and cleans up any resources used by the driver"] + #[doc = "Unmounts all devices and cleans up any resources used by the driver"] pub fn archiveUnmountAll() -> Result; } extern "C" { #[must_use] - #[doc = " Get a file's mtime"] + #[doc = "Get a file's mtime"] pub fn archive_getmtime(name: *const ::libc::c_char, mtime: *mut u64_) -> Result; } -#[doc = " RomFS header."] +#[doc = "RomFS header."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct romfs_header { @@ -18060,7 +18060,7 @@ pub struct romfs_header { #[doc = "< Offset of the file data."] pub fileDataOff: u32_, } -#[doc = " RomFS directory."] +#[doc = "RomFS directory."] #[repr(C)] #[derive(Debug, Default)] pub struct romfs_dir { @@ -18079,7 +18079,7 @@ pub struct romfs_dir { #[doc = "< Name. (UTF-16)"] pub name: __IncompleteArrayField, } -#[doc = " RomFS file."] +#[doc = "RomFS file."] #[repr(C)] #[derive(Debug, Default)] pub struct romfs_file { @@ -18100,22 +18100,22 @@ pub struct romfs_file { } extern "C" { #[must_use] - #[doc = " Mounts the Application's RomFS.\n # Arguments\n\n* `name` - Device mount name.\n > This function is intended to be used to access one's own RomFS.\n If the application is running as 3DSX, it mounts the embedded RomFS section inside the 3DSX.\n If on the other hand it's an NCCH, it behaves identically to romfsMountFromCurrentProcess."] + #[doc = "Mounts the Application's RomFS.\n # Arguments\n\n* `name` - Device mount name.\n > This function is intended to be used to access one's own RomFS.\n If the application is running as 3DSX, it mounts the embedded RomFS section inside the 3DSX.\n If on the other hand it's an NCCH, it behaves identically to romfsMountFromCurrentProcess."] pub fn romfsMountSelf(name: *const ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = " Mounts RomFS from an open file.\n # Arguments\n\n* `fd` - FSFILE handle of the RomFS image.\n * `offset` - Offset of the RomFS within the file.\n * `name` - Device mount name."] + #[doc = "Mounts RomFS from an open file.\n # Arguments\n\n* `fd` - FSFILE handle of the RomFS image.\n * `offset` - Offset of the RomFS within the file.\n * `name` - Device mount name."] pub fn romfsMountFromFile(fd: Handle, offset: u32_, name: *const ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = " Mounts RomFS using the current process host program RomFS.\n # Arguments\n\n* `name` - Device mount name."] + #[doc = "Mounts RomFS using the current process host program RomFS.\n # Arguments\n\n* `name` - Device mount name."] pub fn romfsMountFromCurrentProcess(name: *const ::libc::c_char) -> Result; } extern "C" { #[must_use] - #[doc = " Mounts RomFS from the specified title.\n # Arguments\n\n* `tid` - Title ID\n * `mediatype` - Mediatype\n * `name` - Device mount name."] + #[doc = "Mounts RomFS from the specified title.\n # Arguments\n\n* `tid` - Title ID\n * `mediatype` - Mediatype\n * `name` - Device mount name."] pub fn romfsMountFromTitle( tid: u64_, mediatype: FS_MediaType, @@ -18124,10 +18124,10 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Unmounts the RomFS device."] + #[doc = "Unmounts the RomFS device."] pub fn romfsUnmount(name: *const ::libc::c_char) -> Result; } -#[doc = " Character width information structure."] +#[doc = "Character width information structure."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct charWidthInfo_s { @@ -18138,7 +18138,7 @@ pub struct charWidthInfo_s { #[doc = "< Width of the character, that is, horizontal distance to advance."] pub charWidth: u8_, } -#[doc = " Font texture sheet information."] +#[doc = "Font texture sheet information."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct TGLP_s { @@ -18176,9 +18176,9 @@ impl Default for TGLP_s { } } } -#[doc = " Font character width information block structure."] +#[doc = "Font character width information block type."] pub type CWDH_s = tag_CWDH_s; -#[doc = " Font character width information block structure."] +#[doc = "Font character width information block structure."] #[repr(C)] #[derive(Debug)] pub struct tag_CWDH_s { @@ -18206,11 +18206,11 @@ pub const CMAP_TYPE_DIRECT: _bindgen_ty_36 = 0; pub const CMAP_TYPE_TABLE: _bindgen_ty_36 = 1; #[doc = "< Mapping using a list of mapped characters."] pub const CMAP_TYPE_SCAN: _bindgen_ty_36 = 2; -#[doc = " Font character map methods."] +#[doc = "Font character map methods."] pub type _bindgen_ty_36 = ::libc::c_uint; -#[doc = " Font character map structure."] +#[doc = "Font character map type."] pub type CMAP_s = tag_CMAP_s; -#[doc = " Font character map structure."] +#[doc = "Font character map structure."] #[repr(C)] pub struct tag_CMAP_s { #[doc = "< First Unicode codepoint the block applies to."] @@ -18233,7 +18233,7 @@ pub struct tag_CMAP_s__bindgen_ty_1 { pub __bindgen_anon_1: __BindgenUnionField, pub bindgen_union_field: u16, } -#[doc = " For CMAP_TYPE_SCAN: Mapping data."] +#[doc = "For CMAP_TYPE_SCAN: Mapping data."] #[repr(C)] #[derive(Debug, Default)] pub struct tag_CMAP_s__bindgen_ty_1__bindgen_ty_1 { @@ -18241,7 +18241,7 @@ pub struct tag_CMAP_s__bindgen_ty_1__bindgen_ty_1 { pub nScanEntries: u16_, pub scanEntries: __IncompleteArrayField, } -#[doc = " Mapping pairs."] +#[doc = "Mapping pairs."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct tag_CMAP_s__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 { @@ -18268,7 +18268,7 @@ impl Default for tag_CMAP_s { } } } -#[doc = " Font information structure."] +#[doc = "Font information structure."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct FINF_s { @@ -18309,7 +18309,7 @@ impl Default for FINF_s { } } } -#[doc = " Font structure."] +#[doc = "Font structure."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct CFNT_s { @@ -18337,7 +18337,7 @@ impl Default for CFNT_s { } } } -#[doc = " Font glyph position structure."] +#[doc = "Font glyph position structure."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct fontGlyphPos_s { @@ -18352,7 +18352,7 @@ pub struct fontGlyphPos_s { pub texcoord: fontGlyphPos_s__bindgen_ty_1, pub vtxcoord: fontGlyphPos_s__bindgen_ty_2, } -#[doc = " Texture coordinates to use to render the glyph."] +#[doc = "Texture coordinates to use to render the glyph."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct fontGlyphPos_s__bindgen_ty_1 { @@ -18361,7 +18361,7 @@ pub struct fontGlyphPos_s__bindgen_ty_1 { pub right: f32, pub bottom: f32, } -#[doc = " Vertex coordinates to use to render the glyph."] +#[doc = "Vertex coordinates to use to render the glyph."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct fontGlyphPos_s__bindgen_ty_2 { @@ -18376,30 +18376,30 @@ pub const GLYPH_POS_CALC_VTXCOORD: _bindgen_ty_37 = 1; pub const GLYPH_POS_AT_BASELINE: _bindgen_ty_37 = 2; #[doc = "< Indicates that the Y axis points up instead of down."] pub const GLYPH_POS_Y_POINTS_UP: _bindgen_ty_37 = 4; -#[doc = " Flags for use with fontCalcGlyphPos."] +#[doc = "Flags for use with fontCalcGlyphPos."] pub type _bindgen_ty_37 = ::libc::c_uint; extern "C" { #[must_use] - #[doc = " Ensures the shared system font is mapped."] + #[doc = "Ensures the shared system font is mapped."] pub fn fontEnsureMapped() -> Result; } extern "C" { - #[doc = " Fixes the pointers internal to a just-loaded font\n # Arguments\n\n* `font` - Font to fix\n > Should never be run on the system font, and only once on any other font."] + #[doc = "Fixes the pointers internal to a just-loaded font\n # Arguments\n\n* `font` - Font to fix\n > Should never be run on the system font, and only once on any other font."] pub fn fontFixPointers(font: *mut CFNT_s); } extern "C" { - #[doc = " Retrieves the glyph index of the specified Unicode codepoint.\n # Arguments\n\n* `font` - Pointer to font structure. If NULL, the shared system font is used.\n * `codePoint` - Unicode codepoint."] + #[doc = "Retrieves the glyph index of the specified Unicode codepoint.\n # Arguments\n\n* `font` - Pointer to font structure. If NULL, the shared system font is used.\n * `codePoint` - Unicode codepoint."] pub fn fontGlyphIndexFromCodePoint(font: *mut CFNT_s, codePoint: u32_) -> ::libc::c_int; } extern "C" { - #[doc = " Retrieves character width information of the specified glyph.\n # Arguments\n\n* `font` - Pointer to font structure. If NULL, the shared system font is used.\n * `glyphIndex` - Index of the glyph."] + #[doc = "Retrieves character width information of the specified glyph.\n # Arguments\n\n* `font` - Pointer to font structure. If NULL, the shared system font is used.\n * `glyphIndex` - Index of the glyph."] pub fn fontGetCharWidthInfo( font: *mut CFNT_s, glyphIndex: ::libc::c_int, ) -> *mut charWidthInfo_s; } extern "C" { - #[doc = " Calculates position information for the specified glyph.\n # Arguments\n\n* `out` - Output structure in which to write the information.\n * `font` - Pointer to font structure. If NULL, the shared system font is used.\n * `glyphIndex` - Index of the glyph.\n * `flags` - Calculation flags (see GLYPH_POS_* flags).\n * `scaleX` - Scale factor to apply horizontally.\n * `scaleY` - Scale factor to apply vertically."] + #[doc = "Calculates position information for the specified glyph.\n # Arguments\n\n* `out` - Output structure in which to write the information.\n * `font` - Pointer to font structure. If NULL, the shared system font is used.\n * `glyphIndex` - Index of the glyph.\n * `flags` - Calculation flags (see GLYPH_POS_* flags).\n * `scaleX` - Scale factor to apply horizontally.\n * `scaleY` - Scale factor to apply vertically."] pub fn fontCalcGlyphPos( out: *mut fontGlyphPos_s, font: *mut CFNT_s, @@ -18437,11 +18437,11 @@ extern "C" { pub fn gdbHioDevSystem(command: *const ::libc::c_char) -> ::libc::c_int; } extern "C" { - #[doc = " Address of the host connected through 3dslink"] + #[doc = "Address of the host connected through 3dslink"] pub static mut __3dslink_host: in_addr; } extern "C" { - #[doc = " Connects to the 3dslink host, setting up an output stream.\n # Arguments\n\n* `redirStdout` (direction in) - Whether to redirect stdout to nxlink output.\n * `redirStderr` (direction in) - Whether to redirect stderr to nxlink output.\n # Returns\n\nSocket fd on success, negative number on failure.\n > **Note:** The socket should be closed with close() during application cleanup."] + #[doc = "Connects to the 3dslink host, setting up an output stream.\n # Arguments\n\n* `redirStdout` (direction in) - Whether to redirect stdout to nxlink output.\n * `redirStderr` (direction in) - Whether to redirect stderr to nxlink output.\n # Returns\n\nSocket fd on success, negative number on failure.\n > **Note:** The socket should be closed with close() during application cleanup."] pub fn link3dsConnectToHost(redirStdout: bool, redirStderr: bool) -> ::libc::c_int; } pub type error_t = ::libc::c_int; From bc9725e67ca8104396cdf601dfa7361fab826048 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Tue, 30 May 2023 19:16:51 +0200 Subject: [PATCH 015/101] Remove --workspace flag --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 20a22ed..de60e6b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,7 @@ jobs: run: cargo fmt --all --verbose -- --check - name: Cargo check - run: cargo 3ds clippy --color=always --workspace --verbose --all-targets + run: cargo 3ds clippy --color=always --verbose --all-targets # --deny=warnings would be nice, but can easily break CI for new clippy # lints getting added. I'd also like to use Github's "inline warnings" # feature, but https://github.com/actions/runner/issues/2341 means we From 243863cfb97eac5191e8d1e1c83423d2fa21c2bf Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sat, 6 May 2023 18:12:20 +0200 Subject: [PATCH 016/101] Fixed wrong type quotations --- ctru-rs/src/console.rs | 2 +- ctru-rs/src/lib.rs | 7 ++-- ctru-rs/src/linear.rs | 2 +- ctru-rs/src/mii.rs | 2 +- ctru-rs/src/services/cam.rs | 60 +++++++++++++++---------------- ctru-rs/src/services/fs.rs | 38 ++++---------------- ctru-rs/src/services/gfx.rs | 15 ++++---- ctru-rs/src/services/ndsp/mod.rs | 26 +++++++------- ctru-rs/src/services/ndsp/wave.rs | 10 +++--- 9 files changed, 69 insertions(+), 93 deletions(-) diff --git a/ctru-rs/src/console.rs b/ctru-rs/src/console.rs index e3ba62e..bad114e 100644 --- a/ctru-rs/src/console.rs +++ b/ctru-rs/src/console.rs @@ -19,7 +19,7 @@ impl<'screen> Console<'screen> { /// /// # Notes /// - /// [Console] automatically takes care of flushing and swapping buffers for its screen when printing. + /// [`Console`] automatically takes care of flushing and swapping buffers for its screen when printing. pub fn new(screen: RefMut<'screen, dyn Screen>) -> Self { let mut context = Box::::default(); diff --git a/ctru-rs/src/lib.rs b/ctru-rs/src/lib.rs index 210d37f..5b0ad40 100644 --- a/ctru-rs/src/lib.rs +++ b/ctru-rs/src/lib.rs @@ -1,3 +1,6 @@ +//! Safe Rust wrapper around `libctru`. +//! +//! This library behaves as the main tool to access system-specific features and feature fixes. #![crate_type = "rlib"] #![crate_name = "ctru"] #![feature(test)] @@ -27,8 +30,8 @@ macro_rules! from_impl { /// Activate the default panic handler. /// -/// With this implementation, the main thread will stop and try to print debug info to an available [console::Console]. -/// In case it fails to find an active [console::Console] the program will just exit. +/// With this implementation, the main thread will stop and try to print debug info to an available [`Console`](console::Console). +/// In case it fails to find an active [`Console`](console::Console) the program will just exit. /// /// # Notes /// diff --git a/ctru-rs/src/linear.rs b/ctru-rs/src/linear.rs index c07ce49..718e975 100644 --- a/ctru-rs/src/linear.rs +++ b/ctru-rs/src/linear.rs @@ -15,7 +15,7 @@ use std::ptr::NonNull; // Sadly the linear memory allocator included in `libctru` doesn't implement `linearRealloc` at the time of these additions, // but the default fallback of the `std` will take care of that for us. -/// [`std::alloc::Allocator`] struct for LINEAR memory +/// [`Allocator`](std::alloc::Allocator) struct for LINEAR memory /// To use this struct the main crate must activate the `allocator_api` unstable feature. #[derive(Copy, Clone, Default, Debug)] pub struct LinearAllocator; diff --git a/ctru-rs/src/mii.rs b/ctru-rs/src/mii.rs index 17cb9bf..a992a2a 100644 --- a/ctru-rs/src/mii.rs +++ b/ctru-rs/src/mii.rs @@ -176,7 +176,7 @@ pub struct MoleDetails { /// Some values are not ordered _like_ the Mii Editor UI. The mapped values can be seen here: /// /// -/// This struct is returned by the [``MiiSelector``](crate::applets::mii_selector::MiiSelector) +/// This struct is returned by the [`MiiSelector`](crate::applets::mii_selector::MiiSelector) #[derive(Clone, Debug)] pub struct MiiData { pub options: MiiDataOptions, diff --git a/ctru-rs/src/services/cam.rs b/ctru-rs/src/services/cam.rs index 4a06421..6ddb37f 100644 --- a/ctru-rs/src/services/cam.rs +++ b/ctru-rs/src/services/cam.rs @@ -20,7 +20,7 @@ pub struct Cam { pub both_outer_cams: BothOutwardCam, } -/// Flag to pass to [Camera::flip_image] +/// Flag to pass to [`Camera::flip_image`] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum FlipMode { @@ -30,7 +30,7 @@ pub enum FlipMode { Reverse = ctru_sys::FLIP_REVERSE, } -/// Flag to pass to [Camera::set_view_size] +/// Flag to pass to [`Camera::set_view_size`] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum ViewSize { @@ -47,7 +47,7 @@ pub enum ViewSize { DSX4 = ctru_sys::SIZE_DS_LCDx4, } -/// Flag to pass to [Camera::set_frame_rate] +/// Flag to pass to [`Camera::set_frame_rate`] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum FrameRate { @@ -66,8 +66,8 @@ pub enum FrameRate { Fps30To10 = ctru_sys::FRAME_RATE_30_TO_10, } -/// Flag to pass to [Camera::set_white_balance] or -/// [Camera::set_white_balance_without_base_up] +/// Flag to pass to [`Camera::set_white_balance`] or +/// [`Camera::set_white_balance_without_base_up`] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum WhiteBalance { @@ -85,7 +85,7 @@ pub enum WhiteBalance { Temp7000K = ctru_sys::WHITE_BALANCE_7000K, } -/// Flag to pass to [Camera::set_photo_mode] +/// Flag to pass to [`Camera::set_photo_mode`] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum PhotoMode { @@ -96,7 +96,7 @@ pub enum PhotoMode { Letter = ctru_sys::PHOTO_MODE_LETTER, } -/// Flag to pass to [Camera::set_effect] +/// Flag to pass to [`Camera::set_effect`] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum Effect { @@ -108,7 +108,7 @@ pub enum Effect { Sepia01 = ctru_sys::EFFECT_SEPIA01, } -/// Flag to pass to [Camera::set_contrast] +/// Flag to pass to [`Camera::set_contrast`] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum Contrast { @@ -120,7 +120,7 @@ pub enum Contrast { High = ctru_sys::CONTRAST_HIGH, } -/// Flag to pass to [Camera::set_lens_correction] +/// Flag to pass to [`Camera::set_lens_correction`] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum LensCorrection { @@ -129,7 +129,7 @@ pub enum LensCorrection { Bright = ctru_sys::LENS_CORRECTION_BRIGHT, } -/// Flag to pass to [Camera::set_output_format] +/// Flag to pass to [`Camera::set_output_format`] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum OutputFormat { @@ -137,7 +137,7 @@ pub enum OutputFormat { Rgb565 = ctru_sys::OUTPUT_RGB_565, } -/// Flag to pass to [Cam::play_shutter_sound] +/// Flag to pass to [`Cam::play_shutter_sound`] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum ShutterSound { @@ -168,7 +168,7 @@ impl TryFrom for FramebufferFormat { } } -/// Struct containing coordinates passed to [Camera::set_trimming_params]. +/// Struct containing coordinates passed to [`Camera::set_trimming_params`]. #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub struct TrimmingParams { x_start: i16, @@ -178,7 +178,7 @@ pub struct TrimmingParams { } impl TrimmingParams { - /// Creates a new [CamTrimmingParams] and guarantees the start coordinates are less than or + /// Creates a new [`TrimmingParams`] and guarantees the start coordinates are less than or /// equal to the end coordinates. /// /// `x_start <= x_end && y_start <= y_end` @@ -296,7 +296,7 @@ pub trait Camera { } /// Sets whether or not the camera should trim the image based on parameters set by - /// [Camera::set_trimming_params] + /// [`Camera::set_trimming_params`] fn set_trimming(&mut self, enabled: bool) -> crate::Result<()> { unsafe { ResultCode(ctru_sys::CAMU_SetTrimming(self.port_as_raw(), enabled))?; @@ -313,7 +313,7 @@ pub trait Camera { } } - /// Sets trimming parameters based on coordinates specified inside a [TrimmingParams] + /// Sets trimming parameters based on coordinates specified inside a [`TrimmingParams`] fn set_trimming_params(&mut self, params: TrimmingParams) -> crate::Result<()> { unsafe { ResultCode(ctru_sys::CAMU_SetTrimmingParams( @@ -327,7 +327,7 @@ pub trait Camera { } } - /// Returns the [TrimmingParams] set + /// Returns the [`TrimmingParams`] set fn trimming_params(&self) -> crate::Result { unsafe { let mut x_start = 0; @@ -381,7 +381,7 @@ pub trait Camera { } } - /// Sets the white balance mod of the camera based on the passed [WhiteBalance] argument + /// Sets the white balance mod of the camera based on the passed [`WhiteBalance`] argument fn set_white_balance(&mut self, white_balance: WhiteBalance) -> crate::Result<()> { unsafe { ResultCode(ctru_sys::CAMU_SetWhiteBalance( @@ -392,7 +392,7 @@ pub trait Camera { } } - /// Sets the white balance mode of the camera based on the passed [WhiteBalance] argument + /// Sets the white balance mode of the camera based on the passed [`WhiteBalance`] argument // TODO: Explain base up fn set_white_balance_without_base_up( &mut self, @@ -461,7 +461,7 @@ pub trait Camera { } } - /// Sets the flip direction of the camera's image based on the passed [FlipMode] argument + /// Sets the flip direction of the camera's image based on the passed [`FlipMode`] argument fn flip_image(&mut self, flip: FlipMode) -> crate::Result<()> { unsafe { ResultCode(ctru_sys::CAMU_FlipImage( @@ -507,7 +507,7 @@ pub trait Camera { } } - /// Sets the view size of the camera based on the passed [ViewSize] argument. + /// Sets the view size of the camera based on the passed [`ViewSize`] argument. fn set_view_size(&mut self, size: ViewSize) -> crate::Result<()> { unsafe { ResultCode(ctru_sys::CAMU_SetSize( @@ -519,7 +519,7 @@ pub trait Camera { } } - /// Sets the frame rate of the camera based on the passed [FrameRate] argument. + /// Sets the frame rate of the camera based on the passed [`FrameRate`] argument. fn set_frame_rate(&mut self, frame_rate: FrameRate) -> crate::Result<()> { unsafe { ResultCode(ctru_sys::CAMU_SetFrameRate( @@ -530,7 +530,7 @@ pub trait Camera { } } - /// Sets the photo mode of the camera based on the passed [PhotoMode] argument. + /// Sets the photo mode of the camera based on the passed [`PhotoMode`] argument. fn set_photo_mode(&mut self, photo_mode: PhotoMode) -> crate::Result<()> { unsafe { ResultCode(ctru_sys::CAMU_SetPhotoMode( @@ -541,9 +541,9 @@ pub trait Camera { } } - /// Sets the effect of the camera based on the passed [Effect] argument. + /// Sets the effect of the camera based on the passed [`Effect`] argument. /// - /// Multiple effects can be set at once by combining the bitflags of [CamEffect] + /// Multiple effects can be set at once by combining the bitflags of [`Effect`] fn set_effect(&mut self, effect: Effect) -> crate::Result<()> { unsafe { ResultCode(ctru_sys::CAMU_SetEffect( @@ -555,7 +555,7 @@ pub trait Camera { } } - /// Sets the contrast of the camera based on the passed [Contrast] argument. + /// Sets the contrast of the camera based on the passed [`Contrast`] argument. fn set_contrast(&mut self, contrast: Contrast) -> crate::Result<()> { unsafe { ResultCode(ctru_sys::CAMU_SetContrast( @@ -566,7 +566,7 @@ pub trait Camera { } } - /// Sets the lens correction of the camera based on the passed [LensCorrection] argument. + /// Sets the lens correction of the camera based on the passed [`LensCorrection`] argument. fn set_lens_correction(&mut self, lens_correction: LensCorrection) -> crate::Result<()> { unsafe { ResultCode(ctru_sys::CAMU_SetLensCorrection( @@ -577,7 +577,7 @@ pub trait Camera { } } - /// Sets the output format of the camera based on the passed [OutputFormat] argument. + /// Sets the output format of the camera based on the passed [`OutputFormat`] argument. fn set_output_format(&mut self, format: OutputFormat) -> crate::Result<()> { unsafe { ResultCode(ctru_sys::CAMU_SetOutputFormat( @@ -652,7 +652,7 @@ pub trait Camera { } /// Sets the image quality calibration data for the camera based on the passed in - /// [ImageQualityCalibrationData] argument + /// [`ImageQualityCalibrationData`] argument fn set_image_quality_calibration_data( &mut self, data: ImageQualityCalibrationData, @@ -663,7 +663,7 @@ pub trait Camera { } } - /// Returns the current [ImageQualityCalibrationData] for the camera + /// Returns the current [`ImageQualityCalibrationData`] for the camera fn image_quality_calibration_data(&self) -> crate::Result { unsafe { let mut data = ImageQualityCalibrationData::default(); @@ -783,7 +783,7 @@ impl Cam { } } - /// Plays the specified sound based on the [ShutterSound] argument + /// Plays the specified sound based on the [`ShutterSound`] argument pub fn play_shutter_sound(&self, sound: ShutterSound) -> crate::Result<()> { unsafe { ResultCode(ctru_sys::CAMU_PlayShutterSound(sound.into()))?; diff --git a/ctru-rs/src/services/fs.rs b/ctru-rs/src/services/fs.rs index 04e0c1e..faa03e3 100644 --- a/ctru-rs/src/services/fs.rs +++ b/ctru-rs/src/services/fs.rs @@ -183,36 +183,26 @@ pub struct File { /// Metadata information about a file. /// -/// This structure is returned from the [`metadata`] function and +/// This structure is returned from the [`File::metadata`] function and /// represents known metadata about a file. -/// -/// [`metadata`]: fn.metadata.html pub struct Metadata { attributes: u32, size: u64, } /// Options and flags which can be used to configure how a [`File`] is opened. -/// This builder exposes the ability to configure how a `File` is opened +/// This builder exposes the ability to configure how a [`File`] is opened /// and what operations are permitted on the open file. The [`File::open`] /// and [`File::create`] methods are aliases for commonly used options /// using this builder. /// -/// [`File`]: struct.File.html -/// [`File::open`]: struct.File.html#method.open -/// [`File::create`]: struct.File.html#method.create -/// -/// Generally speaking, when using `OpenOptions`, you'll first call [`new()`], -/// then chain calls to methods to set each option, then call [`open()`], +/// Generally speaking, when using [`OpenOptions`], you'll first call [`OpenOptions::new`], +/// then chain calls to methods to set each option, then call [`OpenOptions::open`], /// passing the path of the file you're trying to open. /// /// It is required to also pass a reference to the [`Archive`] that the /// file lives in. /// -/// [`new()`]: struct.OpenOptions.html#method.new -/// [`open()`]: struct.OpenOptions.html#method.open -/// [`Archive`]: struct.Archive.html -/// /// # Examples /// /// Opening a file to read: @@ -257,14 +247,11 @@ pub struct OpenOptions { /// Iterator over the entries in a directory. /// -/// This iterator is returned from the [`read_dir`] function of this module and +/// This iterator is returned from the [`File::read_dir`] function of this module and /// will yield instances of `Result`. Through a [`DirEntry`] /// information like the entry's path and possibly other metadata can be /// learned. /// -/// [`read_dir`]: fn.read_dir.html -/// [`DirEntry`]: struct.DirEntry.html -/// /// # Errors /// /// This Result will return Err if there's some sort of intermittent IO error @@ -277,8 +264,6 @@ pub struct ReadDir<'a> { /// Entries returned by the [`ReadDir`] iterator. /// -/// [`ReadDir`]: struct.ReadDir.html -/// /// An instance of `DirEntry` represents an entry inside of a directory on the /// filesystem. Each entry can be inspected via methods to learn about the full /// path or possibly other metadata. @@ -338,8 +323,6 @@ impl Fs { impl Archive { /// Retrieves an Archive's [`ArchiveID`] - /// - /// [`ArchiveID`]: enum.ArchiveID.html pub fn id(&self) -> ArchiveID { self.id } @@ -355,8 +338,6 @@ impl File { /// This function will return an error if `path` does not already exit. /// Other errors may also be returned accoridng to [`OpenOptions::open`] /// - /// [`OpenOptions::open`]: struct.OpenOptions.html#method.open - /// /// # Examples /// /// ```no_run @@ -382,9 +363,7 @@ impl File { /// # Errors /// /// This function will return an error if `path` does not already exit. - /// Other errors may also be returned accoridng to [`OpenOptions::create`] - /// - /// [`OpenOptions::create`]: struct.OpenOptions.html#method.create + /// Other errors may also be returned accoridng to [`OpenOptions::create`]. /// /// # Examples /// @@ -597,8 +576,6 @@ impl OpenOptions { /// to the `archive` method. /// * Filesystem-level errors (full disk, etc). /// * Invalid combinations of open options. - /// - /// [`Archive`]: struct.Archive.html pub fn open>(&mut self, path: P) -> IoResult { self._open(path.as_ref(), self.open_flags()) } @@ -901,7 +878,6 @@ fn to_utf16(path: &Path) -> WideCString { WideCString::from_str(path).unwrap() } -// Adapted from sys/windows/fs.rs in libstd fn truncate_utf16_at_nul(v: &[u16]) -> &[u16] { match v.iter().position(|c| *c == 0) { // don't include the 0 @@ -910,8 +886,6 @@ fn truncate_utf16_at_nul(v: &[u16]) -> &[u16] { } } -// Copied from sys/common/io.rs in libstd - // Provides read_to_end functionality over an uninitialized buffer. // This function is unsafe because it calls the underlying // read function with a slice into uninitialized memory. The default diff --git a/ctru-rs/src/services/gfx.rs b/ctru-rs/src/services/gfx.rs index 3a5ba37..8c60280 100644 --- a/ctru-rs/src/services/gfx.rs +++ b/ctru-rs/src/services/gfx.rs @@ -90,14 +90,10 @@ pub trait Swap: private::Sealed { /// Swaps the video buffers. /// /// If double buffering is disabled, "swapping" the buffers has the side effect - /// of committing any configuration changes to the buffers (e.g. [`set_wide_mode`], - /// [`set_framebuffer_format`], [`set_double_buffering`]). + /// of committing any configuration changes to the buffers (e.g. [`TopScreen::set_wide_mode`], + /// [`Screen::set_framebuffer_format`], [`Screen::set_double_buffering`]). /// /// This should be called once per frame at most. - /// - /// [`set_wide_mode`]: TopScreen::set_wide_mode - /// [`set_framebuffer_format`]: Screen::set_framebuffer_format - /// [`set_double_buffering`]: Screen::set_double_buffering fn swap_buffers(&mut self); } @@ -213,9 +209,12 @@ pub struct Gfx { static GFX_ACTIVE: Mutex = Mutex::new(0); impl Gfx { - /// Creates a new [Gfx] instance with default init values + /// Creates a new [`Gfx`] instance with default init values /// It's the same as calling: - /// `Gfx::with_formats(FramebufferFormat::Bgr8, FramebufferFormat::Bgr8, false)` + /// + /// ``` + /// Gfx::with_formats(FramebufferFormat::Bgr8, FramebufferFormat::Bgr8, false) + /// ``` pub fn new() -> Result { Gfx::with_formats(FramebufferFormat::Bgr8, FramebufferFormat::Bgr8, false) } diff --git a/ctru-rs/src/services/ndsp/mod.rs b/ctru-rs/src/services/ndsp/mod.rs index 8f67b1b..72e2413 100644 --- a/ctru-rs/src/services/ndsp/mod.rs +++ b/ctru-rs/src/services/ndsp/mod.rs @@ -204,8 +204,8 @@ impl Channel<'_> { /// /// # Warning /// - /// `libctru` expects the user to manually keep the info data (in this case [Wave]) alive during playback. - /// To ensure safety, checks within [Wave] will clear the whole channel queue if any queued [Wave] is dropped prematurely. + /// `libctru` expects the user to manually keep the info data (in this case [`Wave`]) alive during playback. + /// To ensure safety, checks within [`Wave`] will clear the whole channel queue if any queued [`Wave`] is dropped prematurely. pub fn queue_wave(&mut self, wave: &mut Wave) -> std::result::Result<(), NdspError> { match wave.status() { WaveStatus::Playing | WaveStatus::Queued => return Err(NdspError::WaveBusy(self.id)), @@ -222,7 +222,7 @@ impl Channel<'_> { /// Functions to handle audio filtering. /// -/// Refer to [libctru](https://libctru.devkitpro.org/channel_8h.html#a1da3b363c2edfd318c92276b527daae6) for more info. +/// Refer to [`libctru`](https://libctru.devkitpro.org/channel_8h.html#a1da3b363c2edfd318c92276b527daae6) for more info. impl Channel<'_> { /// Enables/disables monopole filters. pub fn iir_mono_set_enabled(&mut self, enable: bool) { @@ -314,7 +314,7 @@ impl AudioFormat { } impl AudioMix { - /// Creates a new [AudioMix] with all volumes set to 0. + /// Creates a new [`AudioMix`] with all volumes set to 0. pub fn zeroed() -> Self { Self { raw: [0.; 12] } } @@ -365,8 +365,8 @@ impl AudioMix { /// /// # Notes /// - /// [Channel] will normalize the mix values to be within 0 and 1. - /// However, an [AudioMix] instance with larger/smaller values is valid. + /// [`Channel`] will normalize the mix values to be within 0 and 1. + /// However, an [`AudioMix`] instance with larger/smaller values is valid. pub fn set_front(&mut self, left: f32, right: f32) { self.raw[0] = left; self.raw[1] = right; @@ -376,8 +376,8 @@ impl AudioMix { /// /// # Notes /// - /// [Channel] will normalize the mix values to be within 0 and 1. - /// However, an [AudioMix] instance with larger/smaller values is valid. + /// [`Channel`] will normalize the mix values to be within 0 and 1. + /// However, an [`AudioMix`] instance with larger/smaller values is valid. pub fn set_back(&mut self, left: f32, right: f32) { self.raw[2] = left; self.raw[3] = right; @@ -387,8 +387,8 @@ impl AudioMix { /// /// # Notes /// - /// [Channel] will normalize the mix values to be within 0 and 1. - /// However, an [AudioMix] instance with larger/smaller values is valid. + /// [`Channel`] will normalize the mix values to be within 0 and 1. + /// However, an [`AudioMix`] instance with larger/smaller values is valid. pub fn set_aux_front(&mut self, left: f32, right: f32, id: usize) { if id > 1 { panic!("invalid auxiliary output device index") @@ -404,8 +404,8 @@ impl AudioMix { /// /// # Notes /// - /// [Channel] will normalize the mix values to be within 0 and 1. - /// However, an [AudioMix] instance with larger/smaller values is valid. + /// [`Channel`] will normalize the mix values to be within 0 and 1. + /// However, an [`AudioMix`] instance with larger/smaller values is valid. pub fn set_aux_back(&mut self, left: f32, right: f32, id: usize) { if id > 1 { panic!("invalid auxiliary output device index") @@ -418,7 +418,7 @@ impl AudioMix { } } -/// Returns an [AudioMix] object with "front left" and "front right" volumes set to 100%, and all other volumes set to 0%. +/// Returns an [`AudioMix`] object with "front left" and "front right" volumes set to 100%, and all other volumes set to 0%. impl Default for AudioMix { fn default() -> Self { let mut mix = AudioMix::zeroed(); diff --git a/ctru-rs/src/services/ndsp/wave.rs b/ctru-rs/src/services/ndsp/wave.rs index feff4cd..6cc5847 100644 --- a/ctru-rs/src/services/ndsp/wave.rs +++ b/ctru-rs/src/services/ndsp/wave.rs @@ -1,7 +1,7 @@ use super::{AudioFormat, NdspError}; use crate::linear::LinearAllocator; -/// Informational struct holding the raw audio data and playback info. This corresponds to [ctru_sys::ndspWaveBuf]. +/// Informational struct holding the raw audio data and playback info. This corresponds to [`ctru_sys::ndspWaveBuf`]. pub struct Wave { /// Data block of the audio wave (and its format information). buffer: Box<[u8], LinearAllocator>, @@ -13,7 +13,7 @@ pub struct Wave { #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u8)] -/// Enum representing the playback status of a [Wave]. +/// Enum representing the playback status of a [`Wave`]. pub enum WaveStatus { Free = ctru_sys::NDSP_WBUF_FREE as u8, Queued = ctru_sys::NDSP_WBUF_QUEUED as u8, @@ -69,7 +69,7 @@ impl Wave { /// /// # Errors /// - /// This function will return an error if the [Wave] is currently busy, + /// This function will return an error if the [`Wave`] is currently busy, /// with the id to the channel in which it's queued. pub fn get_buffer_mut(&mut self) -> Result<&mut [u8], NdspError> { match self.status() { @@ -89,7 +89,7 @@ impl Wave { /// /// # Notes /// - /// This value varies depending on [Self::set_sample_count]. + /// This value varies depending on [`Wave::set_sample_count`]. pub fn sample_count(&self) -> usize { self.raw_data.nsamples as usize } @@ -117,7 +117,7 @@ impl Wave { /// # Errors /// /// This function will return an error if the sample size exceeds the buffer's capacity - /// or if the [Wave] is currently queued. + /// or if the [`Wave`] is currently queued. pub fn set_sample_count(&mut self, sample_count: usize) -> Result<(), NdspError> { match self.status() { WaveStatus::Playing | WaveStatus::Queued => { From f497a1fba437bbbc667010ec224ac1c1cec315ae Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Thu, 6 Jul 2023 20:56:15 +0200 Subject: [PATCH 017/101] General setup for the new documentation --- README.md | 4 ++-- ctru-rs/Cargo.toml | 6 +++++- ctru-rs/src/lib.rs | 31 ++++++++++++++++++++++++++++--- ctru-rs/src/prelude.rs | 7 ++++++- ctru-rs/src/services/gfx.rs | 2 +- ctru-rs/src/services/mod.rs | 3 --- 6 files changed, 42 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index abd23dd..ae3e6c7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # ctru-rs -A Rust wrapper library for smealum's [ctrulib](https://github.com/smealum/ctrulib). +A Rust wrapper around [libctru](https://github.com/devkitPro/libctru). ## Structure @@ -8,7 +8,7 @@ This repository is organized as follows: * `ctru-rs`: Safe, idiomatic wrapper around `ctru-sys` -* `ctru-sys`: Low-level, unsafe bindings to ctrulib. +* `ctru-sys`: Low-level, unsafe bindings to `libctru`. This crate's version changes according to the version of `libctru` used to generate the bindings, with the following convention: diff --git a/ctru-rs/Cargo.toml b/ctru-rs/Cargo.toml index 2811900..bf2ec15 100644 --- a/ctru-rs/Cargo.toml +++ b/ctru-rs/Cargo.toml @@ -1,6 +1,6 @@ [package] authors = ["Rust3DS Org", "Ronald Kinard "] -description = "A safe wrapper around smealum's ctrulib." +description = "A safe wrapper around libctru" license = "Zlib" name = "ctru-rs" version = "0.7.1" @@ -45,6 +45,10 @@ std-threads = [] [package.metadata.cargo-3ds] romfs_dir = "examples/romfs" +[package.metadata.docs.rs] +default-target = "armv6k-nintendo-3ds" +cargo-args = ["-Z", "build-std"] + [[example]] name = "thread-basic" required-features = ["std-threads"] diff --git a/ctru-rs/src/lib.rs b/ctru-rs/src/lib.rs index 5b0ad40..92645dd 100644 --- a/ctru-rs/src/lib.rs +++ b/ctru-rs/src/lib.rs @@ -1,14 +1,39 @@ -//! Safe Rust wrapper around `libctru`. -//! -//! This library behaves as the main tool to access system-specific features and feature fixes. +//! Safe wrapper around `libctru`. +//! +//! # About +//! +//! This crate behaves as the main tool to access system-specific functionality on the Nintendo 3DS when developing homebrew software in Rust. +//! Thanks to it, developers can access the underlying system services and the console's hardware to develop userland applications +//! (such as HID devices, network capabilities, graphics, built-in cameras, etc.). +//! +//! Among these features, `ctru` also automatically includes functionality to properly integrate the Rust `std` with the console, which the developer would otherwise need to implement manually. +//! +//! # Usage +//! +//! Read thoroughly the official [`ctru` wiki](https://github.com/rust3ds/ctru-rs/wiki) which guides you through the setup needed to install the required toolchain and helpful tools. +//! After following the guide and understanding the many quirks of the Nintendo 3DS homebrew development environment, you can create a new project by including this crate as a dependency +//! of your project in your `Cargo.toml` manifest and build your binaries either manually (for the `armv6k-nintendo-3ds` target) or via [`cargo-3ds`](https://github.com/rust3ds/cargo-3ds). +//! +//! # Examples +//! +//! You can check out the examples provided with this crate which dive into most of the implemented functionality. +//! + #![crate_type = "rlib"] #![crate_name = "ctru"] +#![warn(missing_docs)] #![feature(test)] #![feature(custom_test_frameworks)] #![feature(try_trait_v2)] #![feature(allocator_api)] #![feature(nonnull_slice_from_raw_parts)] #![test_runner(test_runner::run)] +#![doc( + html_favicon_url = "https://user-images.githubusercontent.com/11131775/225929072-2fa1741c-93ae-4b47-9bdf-af70f3d59910.png" +)] +#![doc( + html_logo_url = "https://user-images.githubusercontent.com/11131775/225929072-2fa1741c-93ae-4b47-9bdf-af70f3d59910.png" +)] // Nothing is imported from these crates but their inclusion here assures correct linking of the missing implementations. extern crate pthread_3ds; diff --git a/ctru-rs/src/prelude.rs b/ctru-rs/src/prelude.rs index 74faa41..49095fa 100644 --- a/ctru-rs/src/prelude.rs +++ b/ctru-rs/src/prelude.rs @@ -1,2 +1,7 @@ pub use crate::console::Console; -pub use crate::services::{gfx::Gfx, hid::KeyPad, soc::Soc, Apt, Hid}; +pub use crate::services::{ + apt::Apt, + gfx::Gfx, + hid::{Hid, KeyPad}, + soc::Soc, +}; diff --git a/ctru-rs/src/services/gfx.rs b/ctru-rs/src/services/gfx.rs index 8c60280..a7ba708 100644 --- a/ctru-rs/src/services/gfx.rs +++ b/ctru-rs/src/services/gfx.rs @@ -211,7 +211,7 @@ static GFX_ACTIVE: Mutex = Mutex::new(0); impl Gfx { /// Creates a new [`Gfx`] instance with default init values /// It's the same as calling: - /// + /// /// ``` /// Gfx::with_formats(FramebufferFormat::Bgr8, FramebufferFormat::Bgr8, false) /// ``` diff --git a/ctru-rs/src/services/mod.rs b/ctru-rs/src/services/mod.rs index 1d31dea..d825c46 100644 --- a/ctru-rs/src/services/mod.rs +++ b/ctru-rs/src/services/mod.rs @@ -42,7 +42,4 @@ cfg_if::cfg_if! { } } -pub use self::apt::Apt; -pub use self::hid::Hid; - pub(crate) use self::reference::ServiceReference; From cd7a041180018810606b7fd38c5f605dff844a64 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Fri, 7 Jul 2023 13:03:54 +0200 Subject: [PATCH 018/101] error module documentation --- ctru-rs/Cargo.toml | 1 + ctru-rs/src/error.rs | 36 +++++++++++++++++++++++++++++++++--- ctru-rs/src/lib.rs | 13 ++++++++++--- 3 files changed, 44 insertions(+), 6 deletions(-) diff --git a/ctru-rs/Cargo.toml b/ctru-rs/Cargo.toml index bf2ec15..8049fea 100644 --- a/ctru-rs/Cargo.toml +++ b/ctru-rs/Cargo.toml @@ -5,6 +5,7 @@ license = "Zlib" name = "ctru-rs" version = "0.7.1" edition = "2021" +repository = "https://github.com/rust3ds/ctru-rs" rust-version = "1.64" [lib] diff --git a/ctru-rs/src/error.rs b/ctru-rs/src/error.rs index 004b461..9e1f3c5 100644 --- a/ctru-rs/src/error.rs +++ b/ctru-rs/src/error.rs @@ -1,3 +1,6 @@ +//! Error handling interface. +//! +//! This module holds the generic error and result types to interface with [`ctru_sys`] and the safe wrapper. use std::borrow::Cow; use std::error; use std::ffi::CStr; @@ -6,8 +9,27 @@ use std::ops::{ControlFlow, FromResidual, Try}; use ctru_sys::result::{R_DESCRIPTION, R_LEVEL, R_MODULE, R_SUMMARY}; +/// Custom type alias for generic `ctru` operations. +/// +/// This type is compatible with `ctru-sys` result codes. pub type Result = ::std::result::Result; +/// Validity checker of raw [`ctru_sys::Result`] codes. +/// +/// This struct supports the "try" syntax (`?`) to convert to an [`Error::Os`]. +/// +/// # Example +/// +/// ```no_run +/// pub fn hid_init() -> crate::Result<()> { +/// // We run an unsafe function which returns a `ctru_sys::Result`. +/// let result: ctru_sys::Result = unsafe { ctru_sys::hidInit() }; +/// +/// // The result code is parsed and any possible error gets returned by the function. +/// ResultCode(result)?; +/// Ok(()) +/// } +/// ``` #[derive(Debug, Copy, Clone, PartialEq, PartialOrd, Eq, Ord)] #[repr(transparent)] pub struct ResultCode(pub ctru_sys::Result); @@ -48,13 +70,20 @@ impl FromResidual for Result { } } -/// The error type returned by all libctru functions. +/// The generic error enum returned by `ctru` functions. +/// +/// This error enum supports parsing and displaying [`ctru_sys::Result`] codes. #[non_exhaustive] pub enum Error { + /// Raw [`ctru_sys::Result`] codes. Os(ctru_sys::Result), + /// Generic `libc` error codes. Libc(String), + /// Requested service is already active and cannot be activated again. ServiceAlreadyActive, + /// `stdout` is already being redirected. OutputAlreadyRedirected, + /// The buffer provided by the user to store some data is shorter than required. BufferTooShort { /// Length of the buffer provided by the user. provided: usize, @@ -64,8 +93,9 @@ pub enum Error { } impl Error { - /// Create an [`Error`] out of the last set value in `errno`. This can be used - /// to get a human-readable error string from calls to `libc` functions. + /// Create an [`Error`] out of the last set value in `errno`. + /// + /// This can be used to get a human-readable error string from calls to `libc` functions. pub(crate) fn from_errno() -> Self { let error_str = unsafe { let errno = ctru_sys::errno(); diff --git a/ctru-rs/src/lib.rs b/ctru-rs/src/lib.rs index 92645dd..713705e 100644 --- a/ctru-rs/src/lib.rs +++ b/ctru-rs/src/lib.rs @@ -17,7 +17,6 @@ //! # Examples //! //! You can check out the examples provided with this crate which dive into most of the implemented functionality. -//! #![crate_type = "rlib"] #![crate_name = "ctru"] @@ -39,6 +38,9 @@ extern crate pthread_3ds; extern crate shim_3ds; +/// Expanded stack size used to spawn the main thread by `libctru`. +/// +/// This value was chosen to support crate dependencies which expected more stack than provided, without compromising performance. #[no_mangle] #[cfg(feature = "big-stack")] static __stacksize__: usize = 2 * 1024 * 1024; // 2MB @@ -53,19 +55,24 @@ macro_rules! from_impl { }; } -/// Activate the default panic handler. +/// Activate the custom `ctru` panic handler. /// /// With this implementation, the main thread will stop and try to print debug info to an available [`Console`](console::Console). /// In case it fails to find an active [`Console`](console::Console) the program will just exit. /// /// # Notes /// -/// When ´test´ is enabled, this function won't do anything, as it should be overridden by the ´test´ environment. +/// When ´test´ is enabled, this function will not do anything, as it should be overridden by the ´test´ environment. pub fn use_panic_handler() { #[cfg(not(test))] panic_hook_setup(); } +/// Internal protocol to activate the custom panic handler hook. +/// +/// # Notes +/// +/// When `test` is enabled, this function will be ignored. #[cfg(not(test))] fn panic_hook_setup() { use crate::services::hid::{Hid, KeyPad}; From 9b97e904846237869da325396e38ff934349b10a Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Fri, 7 Jul 2023 13:20:19 +0200 Subject: [PATCH 019/101] Renew manifests and fix warnings --- Cargo.toml | 1 + ctru-rs/Cargo.toml | 4 +++- ctru-rs/src/error.rs | 16 ++++++++-------- ctru-rs/src/lib.rs | 7 +++---- ctru-rs/src/services/gfx.rs | 2 +- ctru-rs/src/services/romfs.rs | 2 +- ctru-sys/Cargo.toml | 4 ++++ 7 files changed, 21 insertions(+), 15 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index af22c84..33abd1c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,7 @@ [workspace] members = ["ctru-rs", "ctru-sys", "ctru-sys/bindgen-ctru-sys"] default-members = ["ctru-rs", "ctru-sys"] +resolver = "2" [patch.'https://github.com/rust3ds/ctru-rs'] # Make sure all dependencies use the local ctru-sys package diff --git a/ctru-rs/Cargo.toml b/ctru-rs/Cargo.toml index 8049fea..69f88f4 100644 --- a/ctru-rs/Cargo.toml +++ b/ctru-rs/Cargo.toml @@ -1,12 +1,14 @@ [package] authors = ["Rust3DS Org", "Ronald Kinard "] description = "A safe wrapper around libctru" +keywords = ["3ds", "libctru"] +categories = ["os", "api-bindings"] license = "Zlib" name = "ctru-rs" version = "0.7.1" edition = "2021" repository = "https://github.com/rust3ds/ctru-rs" -rust-version = "1.64" +rust-version = "1.70" [lib] crate-type = ["rlib"] diff --git a/ctru-rs/src/error.rs b/ctru-rs/src/error.rs index 9e1f3c5..71c0f46 100644 --- a/ctru-rs/src/error.rs +++ b/ctru-rs/src/error.rs @@ -1,5 +1,5 @@ //! Error handling interface. -//! +//! //! This module holds the generic error and result types to interface with [`ctru_sys`] and the safe wrapper. use std::borrow::Cow; use std::error; @@ -10,16 +10,16 @@ use std::ops::{ControlFlow, FromResidual, Try}; use ctru_sys::result::{R_DESCRIPTION, R_LEVEL, R_MODULE, R_SUMMARY}; /// Custom type alias for generic `ctru` operations. -/// +/// /// This type is compatible with `ctru-sys` result codes. pub type Result = ::std::result::Result; /// Validity checker of raw [`ctru_sys::Result`] codes. -/// +/// /// This struct supports the "try" syntax (`?`) to convert to an [`Error::Os`]. -/// +/// /// # Example -/// +/// /// ```no_run /// pub fn hid_init() -> crate::Result<()> { /// // We run an unsafe function which returns a `ctru_sys::Result`. @@ -71,13 +71,13 @@ impl FromResidual for Result { } /// The generic error enum returned by `ctru` functions. -/// +/// /// This error enum supports parsing and displaying [`ctru_sys::Result`] codes. #[non_exhaustive] pub enum Error { /// Raw [`ctru_sys::Result`] codes. Os(ctru_sys::Result), - /// Generic `libc` error codes. + /// Generic `libc` error codes. Libc(String), /// Requested service is already active and cannot be activated again. ServiceAlreadyActive, @@ -94,7 +94,7 @@ pub enum Error { impl Error { /// Create an [`Error`] out of the last set value in `errno`. - /// + /// /// This can be used to get a human-readable error string from calls to `libc` functions. pub(crate) fn from_errno() -> Self { let error_str = unsafe { diff --git a/ctru-rs/src/lib.rs b/ctru-rs/src/lib.rs index 713705e..f2f3e7c 100644 --- a/ctru-rs/src/lib.rs +++ b/ctru-rs/src/lib.rs @@ -25,7 +25,6 @@ #![feature(custom_test_frameworks)] #![feature(try_trait_v2)] #![feature(allocator_api)] -#![feature(nonnull_slice_from_raw_parts)] #![test_runner(test_runner::run)] #![doc( html_favicon_url = "https://user-images.githubusercontent.com/11131775/225929072-2fa1741c-93ae-4b47-9bdf-af70f3d59910.png" @@ -39,7 +38,7 @@ extern crate pthread_3ds; extern crate shim_3ds; /// Expanded stack size used to spawn the main thread by `libctru`. -/// +/// /// This value was chosen to support crate dependencies which expected more stack than provided, without compromising performance. #[no_mangle] #[cfg(feature = "big-stack")] @@ -69,9 +68,9 @@ pub fn use_panic_handler() { } /// Internal protocol to activate the custom panic handler hook. -/// +/// /// # Notes -/// +/// /// When `test` is enabled, this function will be ignored. #[cfg(not(test))] fn panic_hook_setup() { diff --git a/ctru-rs/src/services/gfx.rs b/ctru-rs/src/services/gfx.rs index a7ba708..dd6fbff 100644 --- a/ctru-rs/src/services/gfx.rs +++ b/ctru-rs/src/services/gfx.rs @@ -134,7 +134,7 @@ impl Flush for S { let framebuffer = self.raw_framebuffer(); // Flush the data array. `self.raw_framebuffer` should get the correct parameters for all kinds of screens - unsafe { + let _ = unsafe { ctru_sys::GSPGPU_FlushDataCache( framebuffer.ptr.cast(), (framebuffer.height * framebuffer.width) as u32, diff --git a/ctru-rs/src/services/romfs.rs b/ctru-rs/src/services/romfs.rs index 49369a6..c87b884 100644 --- a/ctru-rs/src/services/romfs.rs +++ b/ctru-rs/src/services/romfs.rs @@ -36,7 +36,7 @@ impl RomFS { }, || { let mount_name = CStr::from_bytes_with_nul(b"romfs\0").unwrap(); - unsafe { ctru_sys::romfsUnmount(mount_name.as_ptr()) }; + let _ = unsafe { ctru_sys::romfsUnmount(mount_name.as_ptr()) }; }, )?; diff --git a/ctru-sys/Cargo.toml b/ctru-sys/Cargo.toml index d4cb24b..03435b6 100644 --- a/ctru-sys/Cargo.toml +++ b/ctru-sys/Cargo.toml @@ -2,9 +2,13 @@ name = "ctru-sys" version = "22.2.0+2.2.2-1" authors = [ "Rust3DS Org", "Ronald Kinard " ] +description = "Raw bindings to libctru" +keywords = ["3ds", "libctru"] +categories = ["os", "external-ffi-bindings", "no-std"] license = "Zlib" links = "ctru" edition = "2021" +repository = "https://github.com/rust3ds/ctru-rs" [dependencies] libc = { version = "0.2.121", default-features = false } From 39829e18206a76782b68fb778f17cd35a90665cd Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sat, 8 Jul 2023 12:52:44 +0200 Subject: [PATCH 020/101] Am, Apt and refactoring to streamline the API and docs --- ctru-rs/examples/title-info.rs | 13 +++---- ctru-rs/src/lib.rs | 5 ++- ctru-rs/src/services/am.rs | 64 +++++++++++++++++++++++++--------- ctru-rs/src/services/apt.rs | 24 +++++++++++++ ctru-rs/src/services/mod.rs | 12 +++++-- 5 files changed, 91 insertions(+), 27 deletions(-) diff --git a/ctru-rs/examples/title-info.rs b/ctru-rs/examples/title-info.rs index fee5cb6..a03c002 100644 --- a/ctru-rs/examples/title-info.rs +++ b/ctru-rs/examples/title-info.rs @@ -80,12 +80,13 @@ fn main() { // Move cursor to top left println!("\x1b[1;1"); - match selected_title.title_info() { - Ok(info) => { - println!("Size: {} KB", info.size_bytes() / 1024); - println!("Version: 0x{:x}", info.version()); - } - Err(e) => println!("Failed to get title info: {}", e), + match selected_title.size() { + Ok(size) => println!("Size: {} kB", size / 1024), + Err(e) => println!("Failed to get title size: {}", e), + } + match selected_title.version() { + Ok(version) => println!("Version: 0x{:x}", version), + Err(e) => println!("Failed to get title version: {}", e), } match selected_title.product_code() { Ok(code) => println!("Product code: \"{code}\""), diff --git a/ctru-rs/src/lib.rs b/ctru-rs/src/lib.rs index f2f3e7c..37428f8 100644 --- a/ctru-rs/src/lib.rs +++ b/ctru-rs/src/lib.rs @@ -24,6 +24,7 @@ #![feature(test)] #![feature(custom_test_frameworks)] #![feature(try_trait_v2)] +#![feature(once_cell_try)] #![feature(allocator_api)] #![test_runner(test_runner::run)] #![doc( @@ -39,7 +40,9 @@ extern crate shim_3ds; /// Expanded stack size used to spawn the main thread by `libctru`. /// -/// This value was chosen to support crate dependencies which expected more stack than provided, without compromising performance. +/// It takes effect only if the `big-stack` feature is active. Otherwise, the default stack size should be ~32kB. +/// +/// This value was chosen to support crate dependencies which expected more stack than provided. It's suggested to use less stack if possible. #[no_mangle] #[cfg(feature = "big-stack")] static __stacksize__: usize = 2 * 1024 * 1024; // 2MB diff --git a/ctru-rs/src/services/am.rs b/ctru-rs/src/services/am.rs index 70bd151..2af1152 100644 --- a/ctru-rs/src/services/am.rs +++ b/ctru-rs/src/services/am.rs @@ -1,35 +1,34 @@ +//! Application Manager service. +//! +//! As the name implies, the AM service manages installed applications. It can: +//! - Read the installed applications on the console and their information (depending on the install location). +//! - Install compatible applications to the console. +//! +//! `ctru` doesn't support installing titles (yet). + use crate::error::ResultCode; use crate::services::fs::FsMediaType; +use std::cell::OnceCell; use std::marker::PhantomData; use std::mem::MaybeUninit; -#[derive(Copy, Clone, Debug)] -#[repr(transparent)] -pub struct TitleInfo(ctru_sys::AM_TitleEntry); - -impl TitleInfo { - pub fn id(&self) -> u64 { - self.0.titleID - } - pub fn size_bytes(&self) -> u64 { - self.0.size - } - pub fn version(&self) -> u16 { - self.0.version - } -} - +/// Struct holding general information about a specific title. +#[doc(alias = "AM_TitleEntry")] pub struct Title<'a> { id: u64, mediatype: FsMediaType, + entry: OnceCell, _am: PhantomData<&'a Am>, } impl<'a> Title<'a> { + /// Returns this title's ID. pub fn id(&self) -> u64 { self.id } + /// Returns this title's unique product code. + #[doc(alias = "AM_GetTitleProductCode")] pub fn product_code(&self) -> crate::Result { let mut buf: [u8; 16] = [0; 16]; @@ -43,7 +42,9 @@ impl<'a> Title<'a> { Ok(String::from_utf8_lossy(&buf).to_string()) } - pub fn title_info(&self) -> crate::Result { + /// Retrieves additional information on the title. + #[doc(alias = "AM_GetTitleInfo")] + fn title_info(&self) -> crate::Result { let mut info = MaybeUninit::zeroed(); unsafe { @@ -57,11 +58,34 @@ impl<'a> Title<'a> { Ok(info.assume_init()) } } + + /// Returns the size of this title in bytes. + pub fn size(&self) -> crate::Result { + // Get the internal entry, or fill it if empty. + let entry = self.entry.get_or_try_init(|| -> crate::Result { + self.title_info() + })?; + + Ok(entry.size) + } + + /// Returns the installed version of this title. + pub fn version(&self) -> crate::Result { + // Get the internal entry, or fill it if empty. + let entry = self.entry.get_or_try_init(|| -> crate::Result { + self.title_info() + })?; + + Ok(entry.version) + } } +/// Handle to the Application Manager service. pub struct Am(()); impl Am { + /// Initialize a new handle. + #[doc(alias = "amInit")] pub fn new() -> crate::Result { unsafe { ResultCode(ctru_sys::amInit())?; @@ -69,6 +93,8 @@ impl Am { } } + /// Returns the amount of titles currently installed in a specific install location. + #[doc(alias = "AM_GetTitleCount")] pub fn title_count(&self, mediatype: FsMediaType) -> crate::Result { unsafe { let mut count = 0; @@ -77,6 +103,8 @@ impl Am { } } + /// Returns the list of titles installed in a specific install location. + #[doc(alias = "AM_GetTitleList")] pub fn title_list(&self, mediatype: FsMediaType) -> crate::Result> { let count = self.title_count(mediatype)?; let mut buf = vec![0; count as usize]; @@ -94,6 +122,7 @@ impl Am { .map(|id| Title { id, mediatype, + entry: OnceCell::new(), _am: PhantomData, }) .collect()) @@ -101,6 +130,7 @@ impl Am { } impl Drop for Am { + #[doc(alias = "amExit")] fn drop(&mut self) { unsafe { ctru_sys::amExit() }; } diff --git a/ctru-rs/src/services/apt.rs b/ctru-rs/src/services/apt.rs index f7731be..0f5eb25 100644 --- a/ctru-rs/src/services/apt.rs +++ b/ctru-rs/src/services/apt.rs @@ -1,8 +1,17 @@ +//! Applet service. +//! +//! The APT service handles integration with some higher level OS features such as Sleep mode, the Home Menu and application switching. +//! +//! It also handles running applets, small programs made available by the OS to streamline specific functionality. Those are implemented in the [`applets`](crate::applets) module. + use crate::error::ResultCode; +/// Handle to the Applet service. pub struct Apt(()); impl Apt { + /// Initialize a new handle. + #[doc(alias = "aptInit")] pub fn new() -> crate::Result { unsafe { ResultCode(ctru_sys::aptInit())?; @@ -10,10 +19,24 @@ impl Apt { } } + /// Returns `true` if the application is running in the foreground as normal. + /// + /// # Notes + /// + /// This function is called as such since it automatically handles all checks for Home Menu switching, Sleep mode and other events that could take away control from the application. + /// For this reason, its main use is as the condition of a while loop that controls the main logic for your program. + #[doc(alias = "aptMainLoop")] pub fn main_loop(&self) -> bool { unsafe { ctru_sys::aptMainLoop() } } + /// Sets (in percentage) the amount of time to lend to the application thread spawned on the syscore (core #1). + /// + /// # Notes + /// + /// It is necessary to set a time limit before spawning threads on the syscore. + /// The percentage value must be withing 5% and 89%, though it is suggested to use lower values (around 30-45%) to avoid slowing down the OS processes. + #[doc(alias = "APT_SetAppCpuTimeLimit")] pub fn set_app_cpu_time_limit(&mut self, percent: u32) -> crate::Result<()> { unsafe { ResultCode(ctru_sys::APT_SetAppCpuTimeLimit(percent))?; @@ -23,6 +46,7 @@ impl Apt { } impl Drop for Apt { + #[doc(alias = "aptExit")] fn drop(&mut self) { unsafe { ctru_sys::aptExit() }; } diff --git a/ctru-rs/src/services/mod.rs b/ctru-rs/src/services/mod.rs index d825c46..a387933 100644 --- a/ctru-rs/src/services/mod.rs +++ b/ctru-rs/src/services/mod.rs @@ -1,9 +1,15 @@ -//! System services used to handle system-specific functionalities. +//! OS services used to handle system-specific functionality. //! -//! Most of the 3DS console's functionalities (when writing homebrew) are locked behind services, +//! Most of the 3DS console's functionalities (when writing user-land homebrew) are accessible via services, //! which need to be initialized before accessing any particular feature. //! -//! Some include: button input, audio playback, graphics rendering, built-in cameras, etc. +//! To ensure safety measures when using the underlying services, `ctru` leverages Rust's lifetime model. +//! After initializing the handle for a specific service (e.g. [`Apt`](apt::Apt)) the service will be accessible as long as there is at least one handle "alive". +//! As such, handles should be dropped *after* the use of a specific service. This is particularly important for services which are necessary for functionality +//! "outside" their associated methods, such as [`RomFS`](romfs::RomFS), which creates an accessible virtual filesystem, or [`Soc`](soc::Soc), +//! which enables all network communications via sockets. +//! +//! In `ctru` some services only allow a single handle to be created at a time, to ensure a safe and controlled environment. pub mod am; pub mod apt; From d315ebd10cf90e28387f1b1c040c14ad7c924950 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sat, 8 Jul 2023 14:13:41 +0200 Subject: [PATCH 021/101] doc(alias) everywhere --- ctru-rs/src/applets/mii_selector.rs | 9 ++++++ ctru-rs/src/applets/swkbd.rs | 11 +++++++ ctru-rs/src/console.rs | 5 ++++ ctru-rs/src/linear.rs | 3 ++ ctru-rs/src/mii.rs | 1 + ctru-rs/src/services/cam.rs | 46 +++++++++++++++++++++++++++++ ctru-rs/src/services/cfgu.rs | 10 +++++++ ctru-rs/src/services/fs.rs | 18 +++++++++++ ctru-rs/src/services/gfx.rs | 17 +++++++++-- ctru-rs/src/services/gspgpu.rs | 3 ++ ctru-rs/src/services/hid.rs | 8 +++++ ctru-rs/src/services/ndsp/mod.rs | 27 +++++++++++++++++ ctru-rs/src/services/ps.rs | 7 +++++ ctru-rs/src/services/romfs.rs | 6 ++++ ctru-rs/src/services/soc.rs | 5 ++++ ctru-rs/src/services/sslc.rs | 2 ++ 16 files changed, 176 insertions(+), 2 deletions(-) diff --git a/ctru-rs/src/applets/mii_selector.rs b/ctru-rs/src/applets/mii_selector.rs index bd0eac2..eada7e3 100644 --- a/ctru-rs/src/applets/mii_selector.rs +++ b/ctru-rs/src/applets/mii_selector.rs @@ -46,6 +46,7 @@ bitflags! { /// /// let result = mii_selector.launch().unwrap(); /// ``` +#[doc(alias = "MiiSelectorConf")] #[derive(Clone, Debug)] pub struct MiiSelector { config: Box, @@ -70,6 +71,7 @@ pub enum LaunchError { impl MiiSelector { /// Initializes a Mii Selector + #[doc(alias = "miiSelectorInit")] pub fn new() -> Self { let mut config = Box::::default(); unsafe { @@ -81,6 +83,7 @@ impl MiiSelector { /// Set the title of the Mii Selector. /// /// This function would panic if the given ``&str`` contains NUL bytes. + #[doc(alias = "miiSelectorSetTitle")] pub fn set_title(&mut self, text: &str) { // This can only fail if the text contains NUL bytes in the string... which seems // unlikely and is documented @@ -91,11 +94,13 @@ impl MiiSelector { } /// Set the options of the Mii Selector + #[doc(alias = "miiSelectorSetOptions")] pub fn set_options(&mut self, options: Options) { unsafe { ctru_sys::miiSelectorSetOptions(self.config.as_mut(), options.bits) } } /// Whitelist a guest Mii + #[doc(alias = "miiSelectorWhitelistGuestMii")] pub fn whitelist_guest_mii(&mut self, mii_index: Index) { let index = match mii_index { Index::Index(i) => i, @@ -106,6 +111,7 @@ impl MiiSelector { } /// Blacklist a guest Mii + #[doc(alias = "miiSelectorBlacklistGuestMii")] pub fn blacklist_guest_mii(&mut self, mii_index: Index) { let index = match mii_index { Index::Index(i) => i, @@ -116,6 +122,7 @@ impl MiiSelector { } /// Whitelist a user Mii + #[doc(alias = "miiSelectorWhitelistUserMii")] pub fn whitelist_user_mii(&mut self, mii_index: Index) { let index = match mii_index { Index::Index(i) => i, @@ -126,6 +133,7 @@ impl MiiSelector { } /// Blacklist a user Mii + #[doc(alias = "miiSelectorBlacklistUserMii")] pub fn blacklist_user_mii(&mut self, mii_index: Index) { let index = match mii_index { Index::Index(i) => i, @@ -145,6 +153,7 @@ impl MiiSelector { /// Launch the Mii Selector. /// Returns an error when the checksum of the Mii is invalid. + #[doc(alias = "miiSelectorLaunch")] pub fn launch(&mut self) -> Result { let mut return_val = Box::::default(); unsafe { ctru_sys::miiSelectorLaunch(self.config.as_mut(), return_val.as_mut()) } diff --git a/ctru-rs/src/applets/swkbd.rs b/ctru-rs/src/applets/swkbd.rs index 8f4aab6..49a4103 100644 --- a/ctru-rs/src/applets/swkbd.rs +++ b/ctru-rs/src/applets/swkbd.rs @@ -7,6 +7,7 @@ use std::iter::once; use std::str; /// An instance of the software keyboard. +#[doc(alias = "SwkbdState")] #[derive(Clone)] pub struct Swkbd { state: Box, @@ -19,6 +20,7 @@ pub struct Swkbd { /// Numpad is a number pad. /// Western is a text keyboard without japanese symbols (only applies to JPN systems). For other /// systems it's the same as a Normal keyboard. +#[doc(alias = "SwkbdType")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum Kind { @@ -29,6 +31,7 @@ pub enum Kind { } /// Represents which button the user pressed to close the software keyboard. +#[doc(alias = "SwkbdButton")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum Button { @@ -38,6 +41,7 @@ pub enum Button { } /// Error type for the software keyboard. +#[doc(alias = "SwkbdResult")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(i32)] pub enum Error { @@ -52,6 +56,7 @@ pub enum Error { } /// Restrictions on keyboard input +#[doc(alias = "SwkbdValidInput")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum ValidInput { @@ -90,6 +95,7 @@ bitflags! { impl Swkbd { /// Initializes a software keyboard of the specified type and the chosen number of buttons /// (from 1-3). + #[doc(alias = "swkbdInit")] pub fn new(keyboard_type: Kind, num_buttons: i32) -> Self { unsafe { let mut state = Box::::default(); @@ -101,6 +107,7 @@ impl Swkbd { /// Gets input from this keyboard and appends it to the provided string. /// /// The text received from the keyboard will be truncated if it is longer than `max_bytes`. + #[doc(alias = "swkbdInputText")] pub fn get_string(&mut self, max_bytes: usize) -> Result<(String, Button), Error> { // Unfortunately the libctru API doesn't really provide a way to get the exact length // of the string that it receieves from the software keyboard. Instead it expects you @@ -125,6 +132,7 @@ impl Swkbd { /// /// If the buffer is too small to contain the entire sequence received from the keyboard, /// the output will be truncated but should still be well-formed UTF-8. + #[doc(alias = "swkbdInputText")] pub fn write_exact(&mut self, buf: &mut [u8]) -> Result { unsafe { match swkbdInputText(self.state.as_mut(), buf.as_mut_ptr(), buf.len()) { @@ -138,6 +146,7 @@ impl Swkbd { } /// Sets special features for this keyboard + #[doc(alias = "swkbdSetFeatures")] pub fn set_features(&mut self, features: Features) { unsafe { swkbdSetFeatures(self.state.as_mut(), features.bits) } } @@ -156,6 +165,7 @@ impl Swkbd { /// Sets the hint text for this software keyboard (that is, the help text that is displayed /// when the textbox is empty) + #[doc(alias = "swkbdSetHintText")] pub fn set_hint_text(&mut self, text: &str) { unsafe { let nul_terminated: String = text.chars().chain(once('\0')).collect(); @@ -169,6 +179,7 @@ impl Swkbd { /// `text` configures the display text for the button /// `submit` configures whether pressing the button will accept the keyboard's input or /// discard it. + #[doc(alias = "swkbdSetButton")] pub fn configure_button(&mut self, button: Button, text: &str, submit: bool) { unsafe { let nul_terminated: String = text.chars().chain(once('\0')).collect(); diff --git a/ctru-rs/src/console.rs b/ctru-rs/src/console.rs index bad114e..cd6b51f 100644 --- a/ctru-rs/src/console.rs +++ b/ctru-rs/src/console.rs @@ -7,6 +7,7 @@ use crate::services::gfx::Screen; static mut EMPTY_CONSOLE: PrintConsole = unsafe { const_zero::const_zero!(PrintConsole) }; +#[doc(alias = "PrintConsole")] pub struct Console<'screen> { context: Box, _screen: RefMut<'screen, dyn Screen>, @@ -20,6 +21,7 @@ impl<'screen> Console<'screen> { /// # Notes /// /// [`Console`] automatically takes care of flushing and swapping buffers for its screen when printing. + #[doc(alias = "consoleInit")] pub fn new(screen: RefMut<'screen, dyn Screen>) -> Self { let mut context = Box::::default(); @@ -45,6 +47,7 @@ impl<'screen> Console<'screen> { } /// Select this console as the current target for stdout + #[doc(alias = "consoleSelect")] pub fn select(&self) { unsafe { consoleSelect(self.context.as_ref() as *const _ as *mut _); @@ -52,6 +55,7 @@ impl<'screen> Console<'screen> { } /// Clears all text from the console + #[doc(alias = "consoleClear")] pub fn clear(&self) { unsafe { consoleClear() } } @@ -64,6 +68,7 @@ impl<'screen> Console<'screen> { /// # Safety /// This function is unsafe because it does not validate that the input will produce /// a console that actually fits on the screen + #[doc(alias = "consoleSetWindow")] pub unsafe fn set_window(&mut self, x: i32, y: i32, width: i32, height: i32) { consoleSetWindow(self.context.as_mut(), x, y, width, height); } diff --git a/ctru-rs/src/linear.rs b/ctru-rs/src/linear.rs index 718e975..d0164c0 100644 --- a/ctru-rs/src/linear.rs +++ b/ctru-rs/src/linear.rs @@ -22,12 +22,14 @@ pub struct LinearAllocator; impl LinearAllocator { /// Returns the amount of free space left in the LINEAR sector + #[doc(alias = "linearSpaceFree")] pub fn free_space() -> u32 { unsafe { ctru_sys::linearSpaceFree() } } } unsafe impl Allocator for LinearAllocator { + #[doc(alias = "linearAlloc", alias = "linearMemAlign")] fn allocate(&self, layout: Layout) -> Result, AllocError> { let pointer = unsafe { ctru_sys::linearMemAlign(layout.size(), layout.align()) }; @@ -36,6 +38,7 @@ unsafe impl Allocator for LinearAllocator { .ok_or(AllocError) } + #[doc(alias = "linearFree")] unsafe fn deallocate(&self, ptr: NonNull, _layout: Layout) { ctru_sys::linearFree(ptr.as_ptr().cast()); } diff --git a/ctru-rs/src/mii.rs b/ctru-rs/src/mii.rs index a992a2a..120eee1 100644 --- a/ctru-rs/src/mii.rs +++ b/ctru-rs/src/mii.rs @@ -177,6 +177,7 @@ pub struct MoleDetails { /// /// /// This struct is returned by the [`MiiSelector`](crate::applets::mii_selector::MiiSelector) +#[doc(alias = "MiiData")] #[derive(Clone, Debug)] pub struct MiiData { pub options: MiiDataOptions, diff --git a/ctru-rs/src/services/cam.rs b/ctru-rs/src/services/cam.rs index 6ddb37f..0d18d89 100644 --- a/ctru-rs/src/services/cam.rs +++ b/ctru-rs/src/services/cam.rs @@ -21,6 +21,7 @@ pub struct Cam { } /// Flag to pass to [`Camera::flip_image`] +#[doc(alias = "CAMU_Flip")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum FlipMode { @@ -31,6 +32,7 @@ pub enum FlipMode { } /// Flag to pass to [`Camera::set_view_size`] +#[doc(alias = "CAMU_Size")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum ViewSize { @@ -48,6 +50,7 @@ pub enum ViewSize { } /// Flag to pass to [`Camera::set_frame_rate`] +#[doc(alias = "CAMU_FramRate")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum FrameRate { @@ -68,6 +71,7 @@ pub enum FrameRate { /// Flag to pass to [`Camera::set_white_balance`] or /// [`Camera::set_white_balance_without_base_up`] +#[doc(alias = "CAMU_WhiteBalance")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum WhiteBalance { @@ -86,6 +90,7 @@ pub enum WhiteBalance { } /// Flag to pass to [`Camera::set_photo_mode`] +#[doc(alias = "CAMU_PhotoMode")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum PhotoMode { @@ -97,6 +102,7 @@ pub enum PhotoMode { } /// Flag to pass to [`Camera::set_effect`] +#[doc(alias = "CAMU_Effect")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum Effect { @@ -109,6 +115,7 @@ pub enum Effect { } /// Flag to pass to [`Camera::set_contrast`] +#[doc(alias = "CAMU_Contrast")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum Contrast { @@ -121,6 +128,7 @@ pub enum Contrast { } /// Flag to pass to [`Camera::set_lens_correction`] +#[doc(alias = "CAMU_LensCorrection")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum LensCorrection { @@ -130,6 +138,7 @@ pub enum LensCorrection { } /// Flag to pass to [`Camera::set_output_format`] +#[doc(alias = "CAMU_OutputFormat")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum OutputFormat { @@ -138,6 +147,7 @@ pub enum OutputFormat { } /// Flag to pass to [`Cam::play_shutter_sound`] +#[doc(alias = "CAMU_ShutterSoundType")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum ShutterSound { @@ -194,10 +204,12 @@ impl TrimmingParams { } /// Represents data used by the camera to calibrate image quality +#[doc(alias = "CAMU_ImageQualityCalibrationData")] #[derive(Default, Clone, Copy, Debug)] pub struct ImageQualityCalibrationData(pub ctru_sys::CAMU_ImageQualityCalibrationData); /// Represents data used by the camera to calibrate image quality when using both outward cameras +#[doc(alias = "CAMU_StereoCameraCalibrationData")] #[derive(Default, Clone, Copy, Debug)] pub struct StereoCameraCalibrationData(pub ctru_sys::CAMU_StereoCameraCalibrationData); @@ -240,6 +252,7 @@ pub struct BothOutwardCam; impl BothOutwardCam { /// Sets whether to enable or disable synchronization /// of brightness for both left and right cameras + #[doc(alias = "CAMU_SetBrightnessSynchronization")] pub fn set_brightness_synchronization( &mut self, brightness_synchronization: bool, @@ -274,6 +287,7 @@ pub trait Camera { } /// Returns true if the camera is busy (receiving data) + #[doc(alias = "CAMU_IsBusy")] fn is_busy(&self) -> crate::Result { unsafe { let mut is_busy = false; @@ -284,6 +298,7 @@ pub trait Camera { /// Returns the maximum amount of transfer bytes based on the view size, trimming, and other /// modifications set to the camera + #[doc(alias = "CAMU_GetTransferBytes")] fn transfer_byte_count(&self) -> crate::Result { unsafe { let mut transfer_bytes = 0; @@ -297,6 +312,7 @@ pub trait Camera { /// Sets whether or not the camera should trim the image based on parameters set by /// [`Camera::set_trimming_params`] + #[doc(alias = "CAMU_SetTrimming")] fn set_trimming(&mut self, enabled: bool) -> crate::Result<()> { unsafe { ResultCode(ctru_sys::CAMU_SetTrimming(self.port_as_raw(), enabled))?; @@ -305,6 +321,7 @@ pub trait Camera { } /// Returns whether or not trimming is currently enabled for the camera + #[doc(alias = "CAMU_IsTrimming")] fn is_trimming_enabled(&self) -> crate::Result { unsafe { let mut trimming = false; @@ -314,6 +331,7 @@ pub trait Camera { } /// Sets trimming parameters based on coordinates specified inside a [`TrimmingParams`] + #[doc(alias = "CAMU_SetTrimmingParams")] fn set_trimming_params(&mut self, params: TrimmingParams) -> crate::Result<()> { unsafe { ResultCode(ctru_sys::CAMU_SetTrimmingParams( @@ -328,6 +346,7 @@ pub trait Camera { } /// Returns the [`TrimmingParams`] set + #[doc(alias = "CAMU_GetTrimmingParams")] fn trimming_params(&self) -> crate::Result { unsafe { let mut x_start = 0; @@ -354,6 +373,7 @@ pub trait Camera { /// Sets the trimming parameters revolving around the center of the image. /// The new width will be `trim_width / 2` to the left and right of the center. /// The new height will be `trim_height / 2` above and below the center. + #[doc(alias = "CAMU_SetTrimmingParamsCenter")] fn set_trimming_params_center( &mut self, trim_width: i16, @@ -374,6 +394,7 @@ pub trait Camera { } /// Sets the exposure level of the camera + #[doc(alias = "CAMU_SetExposure")] fn set_exposure(&mut self, exposure: i8) -> crate::Result<()> { unsafe { ResultCode(ctru_sys::CAMU_SetExposure(self.camera_as_raw(), exposure))?; @@ -382,6 +403,7 @@ pub trait Camera { } /// Sets the white balance mod of the camera based on the passed [`WhiteBalance`] argument + #[doc(alias = "CAMU_SetWhiteBalance")] fn set_white_balance(&mut self, white_balance: WhiteBalance) -> crate::Result<()> { unsafe { ResultCode(ctru_sys::CAMU_SetWhiteBalance( @@ -394,6 +416,7 @@ pub trait Camera { /// Sets the white balance mode of the camera based on the passed [`WhiteBalance`] argument // TODO: Explain base up + #[doc(alias = "CAMU_SetWhiteBalanceWithoutBaseUp")] fn set_white_balance_without_base_up( &mut self, white_balance: WhiteBalance, @@ -408,6 +431,7 @@ pub trait Camera { } /// Sets the sharpness of the camera + #[doc(alias = "CAMU_SetSharpness")] fn set_sharpness(&mut self, sharpness: i8) -> crate::Result<()> { unsafe { ResultCode(ctru_sys::CAMU_SetSharpness(self.camera_as_raw(), sharpness))?; @@ -416,6 +440,7 @@ pub trait Camera { } /// Sets whether auto exposure is enabled or disabled for the camera + #[doc(alias = "CAMU_SetAutoExposure")] fn set_auto_exposure(&mut self, enabled: bool) -> crate::Result<()> { unsafe { ResultCode(ctru_sys::CAMU_SetAutoExposure( @@ -427,6 +452,7 @@ pub trait Camera { } /// Returns true if auto exposure is enabled for the camera + #[doc(alias = "CAMU_IsAutoExposure")] fn is_auto_exposure_enabled(&self) -> crate::Result { unsafe { let mut enabled = false; @@ -439,6 +465,7 @@ pub trait Camera { } /// Sets whether auto white balance is enabled or disabled for the camera + #[doc(alias = "CAMU_SetAutoWhiteBalance")] fn set_auto_white_balance(&mut self, enabled: bool) -> crate::Result<()> { unsafe { ResultCode(ctru_sys::CAMU_SetAutoWhiteBalance( @@ -450,6 +477,7 @@ pub trait Camera { } /// Returns true if auto white balance is enabled for the camera + #[doc(alias = "CAMU_IsAutoWhiteBalance")] fn is_auto_white_balance_enabled(&self) -> crate::Result { unsafe { let mut enabled = false; @@ -462,6 +490,7 @@ pub trait Camera { } /// Sets the flip direction of the camera's image based on the passed [`FlipMode`] argument + #[doc(alias = "CAMU_FlipImage")] fn flip_image(&mut self, flip: FlipMode) -> crate::Result<()> { unsafe { ResultCode(ctru_sys::CAMU_FlipImage( @@ -485,6 +514,7 @@ pub trait Camera { /// * `height` - height of the image /// * `crop_0` - The first crop point in which the image will be trimmed /// * `crop_0` - The second crop point in which the image will be trimmed + #[doc(alias = "CAMU_SetDetailSize")] fn set_detail_size( &mut self, width: i16, @@ -508,6 +538,7 @@ pub trait Camera { } /// Sets the view size of the camera based on the passed [`ViewSize`] argument. + #[doc(alias = "CAMU_SetSize")] fn set_view_size(&mut self, size: ViewSize) -> crate::Result<()> { unsafe { ResultCode(ctru_sys::CAMU_SetSize( @@ -520,6 +551,7 @@ pub trait Camera { } /// Sets the frame rate of the camera based on the passed [`FrameRate`] argument. + #[doc(alias = "CAMU_SetFrameRate")] fn set_frame_rate(&mut self, frame_rate: FrameRate) -> crate::Result<()> { unsafe { ResultCode(ctru_sys::CAMU_SetFrameRate( @@ -531,6 +563,7 @@ pub trait Camera { } /// Sets the photo mode of the camera based on the passed [`PhotoMode`] argument. + #[doc(alias = "CAMU_SetPhotoMode")] fn set_photo_mode(&mut self, photo_mode: PhotoMode) -> crate::Result<()> { unsafe { ResultCode(ctru_sys::CAMU_SetPhotoMode( @@ -544,6 +577,7 @@ pub trait Camera { /// Sets the effect of the camera based on the passed [`Effect`] argument. /// /// Multiple effects can be set at once by combining the bitflags of [`Effect`] + #[doc(alias = "CAMU_SetEffect")] fn set_effect(&mut self, effect: Effect) -> crate::Result<()> { unsafe { ResultCode(ctru_sys::CAMU_SetEffect( @@ -556,6 +590,7 @@ pub trait Camera { } /// Sets the contrast of the camera based on the passed [`Contrast`] argument. + #[doc(alias = "CAMU_SetContrast")] fn set_contrast(&mut self, contrast: Contrast) -> crate::Result<()> { unsafe { ResultCode(ctru_sys::CAMU_SetContrast( @@ -567,6 +602,7 @@ pub trait Camera { } /// Sets the lens correction of the camera based on the passed [`LensCorrection`] argument. + #[doc(alias = "CAMU_SetLensCorrection")] fn set_lens_correction(&mut self, lens_correction: LensCorrection) -> crate::Result<()> { unsafe { ResultCode(ctru_sys::CAMU_SetLensCorrection( @@ -578,6 +614,7 @@ pub trait Camera { } /// Sets the output format of the camera based on the passed [`OutputFormat`] argument. + #[doc(alias = "CAMU_SetOutputFormat")] fn set_output_format(&mut self, format: OutputFormat) -> crate::Result<()> { unsafe { ResultCode(ctru_sys::CAMU_SetOutputFormat( @@ -597,6 +634,7 @@ pub trait Camera { /// * `y` - Starting y coordinate of the window /// * `width` - Width of the window /// * `height` - Height of the window + #[doc(alias = "CAMU_SetAutoExposureWindow")] fn set_auto_exposure_window( &mut self, x: i16, @@ -624,6 +662,7 @@ pub trait Camera { /// * `y` - Starting y coordinate of the window /// * `width` - Width of the window /// * `height` - Height of the window + #[doc(alias = "CAMU_SetAutoWhiteBalanceWindow")] fn set_auto_white_balance_window( &mut self, x: i16, @@ -644,6 +683,7 @@ pub trait Camera { } /// Sets whether the noise filter should be enabled or disabled for the camera + #[doc(alias = "CAMU_SetNoiseFilter")] fn set_noise_filter(&mut self, enabled: bool) -> crate::Result<()> { unsafe { ResultCode(ctru_sys::CAMU_SetNoiseFilter(self.camera_as_raw(), enabled))?; @@ -653,6 +693,7 @@ pub trait Camera { /// Sets the image quality calibration data for the camera based on the passed in /// [`ImageQualityCalibrationData`] argument + #[doc(alias = "CAMU_SetImageQualityCalibrationData")] fn set_image_quality_calibration_data( &mut self, data: ImageQualityCalibrationData, @@ -664,6 +705,7 @@ pub trait Camera { } /// Returns the current [`ImageQualityCalibrationData`] for the camera + #[doc(alias = "CAMU_GetImageQualityCalibrationData")] fn image_quality_calibration_data(&self) -> crate::Result { unsafe { let mut data = ImageQualityCalibrationData::default(); @@ -674,6 +716,7 @@ pub trait Camera { /// Sets the camera as the current sleep camera // TODO: Explain sleep camera + #[doc(alias = "CAMU_SetSleepCamera")] fn set_sleep_camera(&mut self) -> crate::Result<()> { unsafe { ResultCode(ctru_sys::CAMU_SetSleepCamera(self.camera_as_raw()))?; @@ -771,6 +814,7 @@ impl Cam { /// This function will return an error if the service was unable to be initialized. /// Since this service requires no special or elevated permissions, errors are /// rare in practice. + #[doc(alias = "camInit")] pub fn new() -> crate::Result { unsafe { ResultCode(ctru_sys::camInit())?; @@ -784,6 +828,7 @@ impl Cam { } /// Plays the specified sound based on the [`ShutterSound`] argument + #[doc(alias = "CAMU_PlayShutterSound")] pub fn play_shutter_sound(&self, sound: ShutterSound) -> crate::Result<()> { unsafe { ResultCode(ctru_sys::CAMU_PlayShutterSound(sound.into()))?; @@ -793,6 +838,7 @@ impl Cam { } impl Drop for Cam { + #[doc(alias = "camExit")] fn drop(&mut self) { unsafe { ctru_sys::camExit() }; } diff --git a/ctru-rs/src/services/cfgu.rs b/ctru-rs/src/services/cfgu.rs index a9cc411..661fdf9 100644 --- a/ctru-rs/src/services/cfgu.rs +++ b/ctru-rs/src/services/cfgu.rs @@ -4,6 +4,7 @@ use crate::error::ResultCode; +#[doc(alias = "CFG_Region")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum Region { @@ -16,6 +17,7 @@ pub enum Region { Taiwan = ctru_sys::CFG_REGION_TWN, } +#[doc(alias = "CFG_Language")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum Language { @@ -33,6 +35,7 @@ pub enum Language { TraditionalChinese = ctru_sys::CFG_LANGUAGE_TW, } +#[doc(alias = "CFG_SystemModel")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum SystemModel { @@ -61,12 +64,14 @@ impl Cfgu { /// ctrulib services are reference counted, so this function may be called /// as many times as desired and the service will not exit until all /// instances of Cfgu drop out of scope. + #[doc(alias = "cfguInit")] pub fn new() -> crate::Result { ResultCode(unsafe { ctru_sys::cfguInit() })?; Ok(Cfgu(())) } /// Gets system region from secure info + #[doc(alias = "CFGU_SecureInfoGetRegion")] pub fn region(&self) -> crate::Result { let mut region: u8 = 0; @@ -75,6 +80,7 @@ impl Cfgu { } /// Gets system's model + #[doc(alias = "CFGU_GetSystemModel")] pub fn model(&self) -> crate::Result { let mut model: u8 = 0; @@ -83,6 +89,7 @@ impl Cfgu { } /// Gets system's language + #[doc(alias = "CFGU_GetSystemLanguage")] pub fn language(&self) -> crate::Result { let mut language: u8 = 0; @@ -91,6 +98,7 @@ impl Cfgu { } /// Checks if NFC is supported by the console + #[doc(alias = "CFGU_IsNFCSupported")] pub fn is_nfc_supported(&self) -> crate::Result { let mut supported: bool = false; @@ -99,6 +107,7 @@ impl Cfgu { } /// Check if the console is from the 2DS family (2DS, New2DS, New2DSXL) + #[doc(alias = "CFGU_GetModelNintendo2DS")] pub fn is_2ds_family(&self) -> crate::Result { let mut is_2ds_family: u8 = 0; @@ -108,6 +117,7 @@ impl Cfgu { } impl Drop for Cfgu { + #[doc(alias = "cfguExit")] fn drop(&mut self) { unsafe { ctru_sys::cfguExit(); diff --git a/ctru-rs/src/services/fs.rs b/ctru-rs/src/services/fs.rs index faa03e3..b498ee9 100644 --- a/ctru-rs/src/services/fs.rs +++ b/ctru-rs/src/services/fs.rs @@ -39,6 +39,7 @@ bitflags! { } } +#[doc(alias = "FS_MediaType")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum FsMediaType { @@ -47,6 +48,7 @@ pub enum FsMediaType { GameCard = ctru_sys::MEDIATYPE_GAME_CARD, } +#[doc(alias = "FS_PathType")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum PathType { @@ -57,6 +59,7 @@ pub enum PathType { UTF16 = ctru_sys::PATH_UTF16, } +#[doc(alias = "FS_ArchiveID")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum ArchiveID { @@ -391,6 +394,7 @@ impl File { /// # Errors /// /// This function will return an error if the file is not opened for writing. + #[doc(alias = "FSFILE_SetSize")] pub fn set_len(&mut self, size: u64) -> IoResult<()> { unsafe { let r = ctru_sys::FSFILE_SetSize(self.handle, size); @@ -426,6 +430,7 @@ impl File { } } + #[doc(alias = "FSFILE_Read")] fn read(&mut self, buf: &mut [u8]) -> IoResult { unsafe { let mut n_read = 0; @@ -449,6 +454,7 @@ impl File { unsafe { read_to_end_uninitialized(self, buf) } } + #[doc(alias = "FSFILE_Write")] fn write(&mut self, buf: &[u8]) -> IoResult { unsafe { let mut n_written = 0; @@ -576,6 +582,7 @@ impl OpenOptions { /// to the `archive` method. /// * Filesystem-level errors (full disk, etc). /// * Invalid combinations of open options. + #[doc(alias = "FSUSER_OpenFile")] pub fn open>(&mut self, path: P) -> IoResult { self._open(path.as_ref(), self.open_flags()) } @@ -694,6 +701,7 @@ impl<'a> DirEntry<'a> { /// but is not limited to just these cases: /// /// * User lacks permissions to create directory at `path` +#[doc(alias = "FSUSER_CreateDirectory")] pub fn create_dir>(arch: &mut Archive, path: P) -> IoResult<()> { unsafe { let path = to_utf16(path.as_ref()); @@ -720,6 +728,7 @@ pub fn create_dir>(arch: &mut Archive, path: P) -> IoResult<()> { /// /// * If any directory in the path specified by `path` does not already exist /// and it could not be created otherwise. +#[doc(alias = "FSUSER_CreateDirectory")] pub fn create_dir_all>(arch: &mut Archive, path: P) -> IoResult<()> { let path = path.as_ref(); let mut dir = PathBuf::new(); @@ -756,6 +765,7 @@ pub fn metadata>(arch: &Archive, path: P) -> IoResult { /// /// * The user lacks permissions to remove the directory at the provided path. /// * The directory isn't empty. +#[doc(alias = "FSUSER_DeleteDirectory")] pub fn remove_dir>(arch: &mut Archive, path: P) -> IoResult<()> { unsafe { let path = to_utf16(path.as_ref()); @@ -774,6 +784,7 @@ pub fn remove_dir>(arch: &mut Archive, path: P) -> IoResult<()> { /// # Errors /// /// see `file::remove_file` and `fs::remove_dir` +#[doc(alias = "FSUSER_DeleteDirectoryRecursively")] pub fn remove_dir_all>(arch: &mut Archive, path: P) -> IoResult<()> { unsafe { let path = to_utf16(path.as_ref()); @@ -798,6 +809,7 @@ pub fn remove_dir_all>(arch: &mut Archive, path: P) -> IoResult<( /// * The provided path doesn't exist. /// * The process lacks permissions to view the contents. /// * The path points at a non-directory file. +#[doc(alias = "FSUSER_OpenDirectory")] pub fn read_dir>(arch: &Archive, path: P) -> IoResult { unsafe { let mut handle = 0; @@ -826,6 +838,7 @@ pub fn read_dir>(arch: &Archive, path: P) -> IoResult { /// /// * path points to a directory. /// * The user lacks permissions to remove the file. +#[doc(alias = "FSUSER_DeleteFile")] pub fn remove_file>(arch: &mut Archive, path: P) -> IoResult<()> { unsafe { let path = to_utf16(path.as_ref()); @@ -849,6 +862,7 @@ pub fn remove_file>(arch: &mut Archive, path: P) -> IoResult<()> /// /// * from does not exist. /// * The user lacks permissions to view contents. +#[doc(alias = "FSUSER_RenameFile", alias = "FSUSER_RenameDirectory")] pub fn rename(arch: &mut Archive, from: P, to: Q) -> IoResult<()> where P: AsRef, @@ -972,6 +986,7 @@ impl Seek for File { } impl Drop for Fs { + #[doc(alias = "fsExit")] fn drop(&mut self) { unsafe { ctru_sys::fsExit(); @@ -980,6 +995,7 @@ impl Drop for Fs { } impl Drop for Archive { + #[doc(alias = "FSUSER_CloseArchive")] fn drop(&mut self) { unsafe { let _ = ctru_sys::FSUSER_CloseArchive(self.handle); @@ -988,6 +1004,7 @@ impl Drop for Archive { } impl Drop for File { + #[doc(alias = "FSFILE_Close")] fn drop(&mut self) { unsafe { let _ = ctru_sys::FSFILE_Close(self.handle); @@ -996,6 +1013,7 @@ impl Drop for File { } impl Drop for Dir { + #[doc(alias = "FSDIR_Close")] fn drop(&mut self) { unsafe { let _ = ctru_sys::FSDIR_Close(self.0); diff --git a/ctru-rs/src/services/gfx.rs b/ctru-rs/src/services/gfx.rs index dd6fbff..5629cf6 100644 --- a/ctru-rs/src/services/gfx.rs +++ b/ctru-rs/src/services/gfx.rs @@ -23,6 +23,7 @@ mod private { /// This trait is implemented by the screen structs for working with frame buffers and /// drawing to the screens. Graphics-related code can be made generic over this /// trait to work with any of the given screens. +#[doc(alias = "gfxScreen_t")] pub trait Screen: private::Sealed { /// Returns the `libctru` value for the Screen kind. fn as_raw(&self) -> ctru_sys::gfxScreen_t; @@ -34,6 +35,7 @@ pub trait Screen: private::Sealed { /// /// Note that the pointer of the framebuffer returned by this function can /// change after each call to this function if double buffering is enabled. + #[doc(alias = "gfxGetFramebuffer")] fn raw_framebuffer(&mut self) -> RawFrameBuffer { let mut width: u16 = 0; let mut height: u16 = 0; @@ -52,11 +54,13 @@ pub trait Screen: private::Sealed { /// /// [`Swap::swap_buffers`] must be called after this function for the configuration /// change to take effect. + #[doc(alias = "gfxSetDoubleBuffering")] fn set_double_buffering(&mut self, enabled: bool) { unsafe { ctru_sys::gfxSetDoubleBuffering(self.as_raw(), enabled) } } /// Gets the framebuffer format. + #[doc(alias = "gfxGetScreenFormat")] fn framebuffer_format(&self) -> FramebufferFormat { unsafe { ctru_sys::gfxGetScreenFormat(self.as_raw()) }.into() } @@ -65,6 +69,7 @@ pub trait Screen: private::Sealed { /// /// [`Swap::swap_buffers`] must be called after this method for the configuration /// change to take effect. + #[doc(alias = "gfxSetScreenFormat")] fn set_framebuffer_format(&mut self, fmt: FramebufferFormat) { unsafe { ctru_sys::gfxSetScreenFormat(self.as_raw(), fmt.into()) } } @@ -94,6 +99,7 @@ pub trait Swap: private::Sealed { /// [`Screen::set_framebuffer_format`], [`Screen::set_double_buffering`]). /// /// This should be called once per frame at most. + #[doc(alias = "gfxScreenSwapBuffers")] fn swap_buffers(&mut self); } @@ -126,6 +132,7 @@ impl Swap for BottomScreen { pub trait Flush: private::Sealed { /// Flushes the video buffer(s) for this screen. Note that you must still call /// [`Swap::swap_buffers`] after this method for the buffer contents to be displayed. + #[doc(alias = "gfxFlushBuffers")] fn flush_buffers(&mut self); } @@ -184,11 +191,12 @@ pub struct RawFrameBuffer<'screen> { screen: PhantomData<&'screen mut dyn Screen>, } -#[derive(Copy, Clone, Debug, PartialEq, Eq)] -#[repr(u32)] /// Side of top screen framebuffer /// /// The top screen of the 3DS can have two separate sets of framebuffers to support its 3D functionality +#[doc(alias = "gfx3dSide_t")] +#[derive(Copy, Clone, Debug, PartialEq, Eq)] +#[repr(u32)] pub enum Side { /// The left framebuffer. This framebuffer is also the one used when 3D is disabled Left = ctru_sys::GFX_LEFT, @@ -215,6 +223,7 @@ impl Gfx { /// ``` /// Gfx::with_formats(FramebufferFormat::Bgr8, FramebufferFormat::Bgr8, false) /// ``` + #[doc(alias = "gfxInit")] pub fn new() -> Result { Gfx::with_formats(FramebufferFormat::Bgr8, FramebufferFormat::Bgr8, false) } @@ -223,6 +232,7 @@ impl Gfx { /// screens /// /// Use `Gfx::new()` instead of this function to initialize the module with default parameters + #[doc(alias = "gfxInit")] pub fn with_formats( top_fb_fmt: FramebufferFormat, bottom_fb_fmt: FramebufferFormat, @@ -269,6 +279,7 @@ impl TopScreen3D<'_> { } impl<'screen> From<&'screen RefCell> for TopScreen3D<'screen> { + #[doc(alias = "gfxSet3D")] fn from(top_screen: &'screen RefCell) -> Self { unsafe { ctru_sys::gfxSet3D(true); @@ -298,6 +309,7 @@ impl TopScreen { /// /// [`Swap::swap_buffers`] must be called after this method for the configuration /// to take effect. + #[doc(alias = "gfxSetWide")] pub fn set_wide_mode(&mut self, enable: bool) { unsafe { ctru_sys::gfxSetWide(enable); @@ -305,6 +317,7 @@ impl TopScreen { } /// Returns whether or not wide mode is enabled on the top screen. + #[doc(alias = "gfxIsWide")] pub fn is_wide(&self) -> bool { unsafe { ctru_sys::gfxIsWide() } } diff --git a/ctru-rs/src/services/gspgpu.rs b/ctru-rs/src/services/gspgpu.rs index 9f9219c..1510b29 100644 --- a/ctru-rs/src/services/gspgpu.rs +++ b/ctru-rs/src/services/gspgpu.rs @@ -1,5 +1,6 @@ //! GSPGPU service +#[doc(alias = "GSPGPU_Event")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum Event { @@ -12,6 +13,7 @@ pub enum Event { DMA = ctru_sys::GSPGPU_EVENT_DMA, } +#[doc(alias = "GSPGPU_FramebufferFormat")] /// Framebuffer formats supported by the 3DS #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] @@ -45,6 +47,7 @@ impl FramebufferFormat { /// Waits for a GSPGPU event to occur. /// /// `discard_current` determines whether to discard the current event and wait for the next event +#[doc(alias = "gspWaitForEvent")] pub fn wait_for_event(ev: Event, discard_current: bool) { unsafe { ctru_sys::gspWaitForEvent(ev.into(), discard_current); diff --git a/ctru-rs/src/services/hid.rs b/ctru-rs/src/services/hid.rs index fa91657..8de66a1 100644 --- a/ctru-rs/src/services/hid.rs +++ b/ctru-rs/src/services/hid.rs @@ -54,6 +54,7 @@ pub struct Hid(()); /// Since this service requires no special or elevated permissions, errors are /// rare in practice. impl Hid { + #[doc(alias = "hidInit")] pub fn new() -> crate::Result { unsafe { ResultCode(ctru_sys::hidInit())?; @@ -64,12 +65,14 @@ impl Hid { /// Scans the HID service for all user input occurring on the current /// frame. This function should be called on every frame when polling /// for user input. + #[doc(alias = "hidScanInput")] pub fn scan_input(&mut self) { unsafe { ctru_sys::hidScanInput() }; } /// Returns a bitflag struct representing which buttons have just been pressed /// on the current frame (and were not pressed on the previous frame). + #[doc(alias = "hidKeysDown")] pub fn keys_down(&self) -> KeyPad { unsafe { let keys = ctru_sys::hidKeysDown(); @@ -79,6 +82,7 @@ impl Hid { /// Returns a bitflag struct representing which buttons have been held down /// during the current frame. + #[doc(alias = "hidKeysHeld")] pub fn keys_held(&self) -> KeyPad { unsafe { let keys = ctru_sys::hidKeysHeld(); @@ -88,6 +92,7 @@ impl Hid { /// Returns a bitflag struct representing which buttons have just been released on /// the current frame. + #[doc(alias = "hidKeysUp")] pub fn keys_up(&self) -> KeyPad { unsafe { let keys = ctru_sys::hidKeysUp(); @@ -100,6 +105,7 @@ impl Hid { /// # Notes /// /// (0, 0) represents the top left corner of the screen. + #[doc(alias = "hidTouchRead")] pub fn touch_position(&mut self) -> (u16, u16) { let mut res = ctru_sys::touchPosition { px: 0, py: 0 }; @@ -114,6 +120,7 @@ impl Hid { /// # Notes /// /// (0, 0) represents the center of the circle pad. + #[doc(alias = "hidCircleRead")] pub fn circlepad_position(&mut self) -> (i16, i16) { let mut res = ctru_sys::circlePosition { dx: 0, dy: 0 }; @@ -125,6 +132,7 @@ impl Hid { } impl Drop for Hid { + #[doc(alias = "hidExit")] fn drop(&mut self) { unsafe { ctru_sys::hidExit() }; } diff --git a/ctru-rs/src/services/ndsp/mod.rs b/ctru-rs/src/services/ndsp/mod.rs index 72e2413..7867048 100644 --- a/ctru-rs/src/services/ndsp/mod.rs +++ b/ctru-rs/src/services/ndsp/mod.rs @@ -14,6 +14,7 @@ use std::sync::Mutex; const NUMBER_OF_CHANNELS: u8 = 24; +#[doc(alias = "ndspOutputMode")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum OutputMode { @@ -37,6 +38,7 @@ pub struct AudioMix { raw: [f32; 12], } +#[doc(alias = "ndspInterpType")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum InterpolationType { @@ -80,6 +82,7 @@ impl Ndsp { /// /// This function will return an error if an instance of the `Ndsp` struct already exists /// or if there are any issues during initialization. + #[doc(alias = "ndspInit")] pub fn new() -> crate::Result { let _service_handler = ServiceReference::new( &NDSP_ACTIVE, @@ -121,6 +124,7 @@ impl Ndsp { } /// Set the audio output mode. Defaults to `OutputMode::Stereo`. + #[doc(alias = "ndspSetOutputMode")] pub fn set_output_mode(&mut self, mode: OutputMode) { unsafe { ctru_sys::ndspSetOutputMode(mode.into()) }; } @@ -128,21 +132,25 @@ impl Ndsp { impl Channel<'_> { /// Reset the channel + #[doc(alias = "ndspChnReset")] pub fn reset(&mut self) { unsafe { ctru_sys::ndspChnReset(self.id.into()) }; } /// Initialize the channel's parameters + #[doc(alias = "ndspChnInitParams")] pub fn init_parameters(&self) { unsafe { ctru_sys::ndspChnInitParams(self.id.into()) }; } /// Returns whether the channel is playing any audio. + #[doc(alias = "ndspChnIsPlaying")] pub fn is_playing(&self) -> bool { unsafe { ctru_sys::ndspChnIsPlaying(self.id.into()) } } /// Returns whether the channel's playback is currently paused. + #[doc(alias = "ndspChnIsPaused")] pub fn is_paused(&self) -> bool { unsafe { ctru_sys::ndspChnIsPaused(self.id.into()) } } @@ -155,37 +163,44 @@ impl Channel<'_> { /// Returns the index of the currently played sample. /// /// Because of how fast this value changes, it should only be used as a rough estimate of the current progress. + #[doc(alias = "ndspChnGetSamplePos")] pub fn sample_position(&self) -> usize { (unsafe { ctru_sys::ndspChnGetSamplePos(self.id.into()) }) as usize } /// Returns the channel's current wave sequence's id. + #[doc(alias = "ndspChnGetWaveBufSeq")] pub fn wave_sequence_id(&self) -> u16 { unsafe { ctru_sys::ndspChnGetWaveBufSeq(self.id.into()) } } /// Pause or un-pause the channel's playback. + #[doc(alias = "ndspChnSetPaused")] pub fn set_paused(&mut self, state: bool) { unsafe { ctru_sys::ndspChnSetPaused(self.id.into(), state) }; } /// Set the channel's output format. /// Change this setting based on the used sample's format. + #[doc(alias = "ndspChnSetFormat")] pub fn set_format(&mut self, format: AudioFormat) { unsafe { ctru_sys::ndspChnSetFormat(self.id.into(), format.into()) }; } /// Set the channel's interpolation mode. + #[doc(alias = "ndspChnSetInterp")] pub fn set_interpolation(&mut self, interp_type: InterpolationType) { unsafe { ctru_sys::ndspChnSetInterp(self.id.into(), interp_type.into()) }; } /// Set the channel's volume mix. + #[doc(alias = "ndspChnSetMix")] pub fn set_mix(&mut self, mix: &AudioMix) { unsafe { ctru_sys::ndspChnSetMix(self.id.into(), mix.as_raw().as_ptr().cast_mut()) } } /// Set the channel's rate of sampling. + #[doc(alias = "ndspChnSetRate")] pub fn set_sample_rate(&mut self, rate: f32) { unsafe { ctru_sys::ndspChnSetRate(self.id.into(), rate) }; } @@ -195,6 +210,7 @@ impl Channel<'_> { // We suggest using other wave formats when developing homebrew applications. /// Clear the wave buffer queue and stop playback. + #[doc(alias = "ndspChnWaveBufClear")] pub fn clear_queue(&mut self) { unsafe { ctru_sys::ndspChnWaveBufClear(self.id.into()) }; } @@ -206,6 +222,7 @@ impl Channel<'_> { /// /// `libctru` expects the user to manually keep the info data (in this case [`Wave`]) alive during playback. /// To ensure safety, checks within [`Wave`] will clear the whole channel queue if any queued [`Wave`] is dropped prematurely. + #[doc(alias = "ndspChnWaveBufAdd")] pub fn queue_wave(&mut self, wave: &mut Wave) -> std::result::Result<(), NdspError> { match wave.status() { WaveStatus::Playing | WaveStatus::Queued => return Err(NdspError::WaveBusy(self.id)), @@ -225,6 +242,7 @@ impl Channel<'_> { /// Refer to [`libctru`](https://libctru.devkitpro.org/channel_8h.html#a1da3b363c2edfd318c92276b527daae6) for more info. impl Channel<'_> { /// Enables/disables monopole filters. + #[doc(alias = "ndspChnIirMonoSetEnable")] pub fn iir_mono_set_enabled(&mut self, enable: bool) { unsafe { ctru_sys::ndspChnIirMonoSetEnable(self.id.into(), enable) }; } @@ -234,6 +252,7 @@ impl Channel<'_> { /// # Notes /// /// This is a lower quality filter than the Biquad alternative. + #[doc(alias = "ndspChnIirMonoSetParamsHighPassFilter")] pub fn iir_mono_set_params_high_pass_filter(&mut self, cut_off_freq: f32) { unsafe { ctru_sys::ndspChnIirMonoSetParamsHighPassFilter(self.id.into(), cut_off_freq) }; } @@ -243,16 +262,19 @@ impl Channel<'_> { /// # Notes /// /// This is a lower quality filter than the Biquad alternative. + #[doc(alias = "ndspChnIirMonoSetParamsLowPassFilter")] pub fn iir_mono_set_params_low_pass_filter(&mut self, cut_off_freq: f32) { unsafe { ctru_sys::ndspChnIirMonoSetParamsLowPassFilter(self.id.into(), cut_off_freq) }; } /// Enables/disables biquad filters. + #[doc(alias = "ndspChnIirBiquadSetEnable")] pub fn iir_biquad_set_enabled(&mut self, enable: bool) { unsafe { ctru_sys::ndspChnIirBiquadSetEnable(self.id.into(), enable) }; } /// Sets the biquad to be a high pass filter. + #[doc(alias = "ndspChnIirBiquadSetParamsHighPassFilter")] pub fn iir_biquad_set_params_high_pass_filter(&mut self, cut_off_freq: f32, quality: f32) { unsafe { ctru_sys::ndspChnIirBiquadSetParamsHighPassFilter(self.id.into(), cut_off_freq, quality) @@ -260,6 +282,7 @@ impl Channel<'_> { } /// Sets the biquad to be a low pass filter. + #[doc(alias = "ndspChnIirBiquadSetParamsLowPassFilter")] pub fn iir_biquad_set_params_low_pass_filter(&mut self, cut_off_freq: f32, quality: f32) { unsafe { ctru_sys::ndspChnIirBiquadSetParamsLowPassFilter(self.id.into(), cut_off_freq, quality) @@ -267,6 +290,7 @@ impl Channel<'_> { } /// Sets the biquad to be a notch filter. + #[doc(alias = "ndspChnIirBiquadSetParamsNotchFilter")] pub fn iir_biquad_set_params_notch_filter(&mut self, notch_freq: f32, quality: f32) { unsafe { ctru_sys::ndspChnIirBiquadSetParamsNotchFilter(self.id.into(), notch_freq, quality) @@ -274,6 +298,7 @@ impl Channel<'_> { } /// Sets the biquad to be a band pass filter. + #[doc(alias = "ndspChnIirBiquadSetParamsBandPassFilter")] pub fn iir_biquad_set_params_band_pass_filter(&mut self, mid_freq: f32, quality: f32) { unsafe { ctru_sys::ndspChnIirBiquadSetParamsBandPassFilter(self.id.into(), mid_freq, quality) @@ -281,6 +306,7 @@ impl Channel<'_> { } /// Sets the biquad to be a peaking equalizer. + #[doc(alias = "ndspChnIirBiquadSetParamsPeakingEqualizer")] pub fn iir_biquad_set_params_peaking_equalizer( &mut self, central_freq: f32, @@ -448,6 +474,7 @@ impl fmt::Display for NdspError { impl error::Error for NdspError {} impl Drop for Ndsp { + #[doc(alias = "ndspExit")] fn drop(&mut self) { for i in 0..NUMBER_OF_CHANNELS { self.channel(i).unwrap().reset(); diff --git a/ctru-rs/src/services/ps.rs b/ctru-rs/src/services/ps.rs index 1d5bd69..ee96216 100644 --- a/ctru-rs/src/services/ps.rs +++ b/ctru-rs/src/services/ps.rs @@ -6,6 +6,7 @@ use crate::error::ResultCode; use crate::Result; +#[doc(alias = "PS_AESAlgorithm")] #[derive(Debug, Clone, Copy, PartialEq, Eq)] #[repr(u32)] pub enum AESAlgorithm { @@ -17,6 +18,7 @@ pub enum AESAlgorithm { CcmDec = ctru_sys::PS_ALGORITHM_CCM_DEC, } +#[doc(alias = "PS_AESKeyType")] #[derive(Debug, Clone, Copy, PartialEq, Eq)] #[repr(u32)] pub enum AESKeyType { @@ -35,6 +37,7 @@ pub enum AESKeyType { pub struct Ps(()); impl Ps { + #[doc(alias = "psInit")] pub fn new() -> Result { unsafe { ResultCode(ctru_sys::psInit())?; @@ -42,6 +45,7 @@ impl Ps { } } + #[doc(alias = "PS_GetLocalFriendCodeSeed")] pub fn local_friend_code_seed(&self) -> crate::Result { let mut seed: u64 = 0; @@ -49,6 +53,7 @@ impl Ps { Ok(seed) } + #[doc(alias = "PS_GetDeviceId")] pub fn device_id(&self) -> crate::Result { let mut id: u32 = 0; @@ -56,6 +61,7 @@ impl Ps { Ok(id) } + #[doc(alias = "PS_GenerateRandomBytes")] pub fn generate_random_bytes(&self, out: &mut [u8]) -> crate::Result<()> { ResultCode(unsafe { ctru_sys::PS_GenerateRandomBytes(out.as_mut_ptr().cast(), out.len()) @@ -65,6 +71,7 @@ impl Ps { } impl Drop for Ps { + #[doc(alias = "psExit")] fn drop(&mut self) { unsafe { ctru_sys::psExit(); diff --git a/ctru-rs/src/services/romfs.rs b/ctru-rs/src/services/romfs.rs index c87b884..3c5afa8 100644 --- a/ctru-rs/src/services/romfs.rs +++ b/ctru-rs/src/services/romfs.rs @@ -25,6 +25,7 @@ pub struct RomFS { static ROMFS_ACTIVE: Mutex = Mutex::new(0); impl RomFS { + #[doc(alias = "romfsMountSelf")] pub fn new() -> crate::Result { let _service_handler = ServiceReference::new( &ROMFS_ACTIVE, @@ -44,6 +45,11 @@ impl RomFS { } } +impl Drop for RomFS { + #[doc(alias = "romfsUnmount")] + fn drop(&mut self) {} +} + #[cfg(test)] mod tests { use super::*; diff --git a/ctru-rs/src/services/soc.rs b/ctru-rs/src/services/soc.rs index 5b9c696..2bbfe50 100644 --- a/ctru-rs/src/services/soc.rs +++ b/ctru-rs/src/services/soc.rs @@ -25,6 +25,7 @@ impl Soc { /// # Errors /// /// This function will return an error if the `Soc` service is already initialized + #[doc(alias = "socInit")] pub fn new() -> crate::Result { Self::init_with_buffer_size(0x100000) } @@ -35,6 +36,7 @@ impl Soc { /// # Errors /// /// This function will return an error if the `Soc` service is already initialized + #[doc(alias = "socInit")] pub fn init_with_buffer_size(num_bytes: usize) -> crate::Result { let _service_handler = ServiceReference::new( &SOC_ACTIVE, @@ -61,6 +63,7 @@ impl Soc { } /// IP Address of the Nintendo 3DS system. + #[doc(alias = "gethostid")] pub fn host_address(&self) -> Ipv4Addr { let raw_id = unsafe { libc::gethostid() }; Ipv4Addr::from(raw_id.to_ne_bytes()) @@ -73,6 +76,7 @@ impl Soc { /// /// Returns an error if a connection cannot be established to the server, or /// output was already previously redirected. + #[doc(alias = "link3dsConnectToHost")] pub fn redirect_to_3dslink(&mut self, stdout: bool, stderr: bool) -> crate::Result<()> { if self.sock_3dslink >= 0 { return Err(Error::OutputAlreadyRedirected); @@ -92,6 +96,7 @@ impl Soc { } impl Drop for Soc { + #[doc(alias = "socExit")] fn drop(&mut self) { if self.sock_3dslink >= 0 { unsafe { diff --git a/ctru-rs/src/services/sslc.rs b/ctru-rs/src/services/sslc.rs index 341155f..d248f0e 100644 --- a/ctru-rs/src/services/sslc.rs +++ b/ctru-rs/src/services/sslc.rs @@ -8,6 +8,7 @@ pub struct SslC(()); impl SslC { /// Initialize the service + #[doc(alias = "sslcInit")] pub fn new() -> crate::Result { unsafe { ResultCode(ctru_sys::sslcInit(0))?; @@ -17,6 +18,7 @@ impl SslC { } impl Drop for SslC { + #[doc(alias = "sslcExit")] fn drop(&mut self) { unsafe { ctru_sys::sslcExit() }; } From 61e20fa2dce4ac8eae95f741683025aa6aecae1d Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sat, 8 Jul 2023 19:19:53 +0200 Subject: [PATCH 022/101] Enum variants documentation + ide files ignored --- .gitignore | 1 + ctru-rs/src/applets/mii_selector.rs | 16 +++- ctru-rs/src/applets/swkbd.rs | 49 ++++++++-- ctru-rs/src/mii.rs | 133 +++++++++++++++++++++++----- ctru-rs/src/services/am.rs | 12 +-- ctru-rs/src/services/cam.rs | 63 +++++++++++-- ctru-rs/src/services/cfgu.rs | 30 ++++++- ctru-rs/src/services/fs.rs | 35 ++++++++ ctru-rs/src/services/gspgpu.rs | 10 ++- ctru-rs/src/services/hid.rs | 31 ++++++- ctru-rs/src/services/ndsp/mod.rs | 14 +++ ctru-rs/src/services/ndsp/wave.rs | 4 + ctru-rs/src/services/ps.rs | 18 ++++ ctru-rs/src/services/sslc.rs | 1 + 14 files changed, 365 insertions(+), 52 deletions(-) diff --git a/.gitignore b/.gitignore index 54f1838..f4d733b 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ Cargo.lock # IDE files .idea +.vscode diff --git a/ctru-rs/src/applets/mii_selector.rs b/ctru-rs/src/applets/mii_selector.rs index eada7e3..577d0df 100644 --- a/ctru-rs/src/applets/mii_selector.rs +++ b/ctru-rs/src/applets/mii_selector.rs @@ -6,18 +6,26 @@ use crate::mii::MiiData; use bitflags::bitflags; use std::ffi::CString; -/// Index of a Mii used to configure some parameters of the Mii Selector -/// Can be either a single index, or _all_ Miis +/// Index of a Mii used to configure some parameters of the Mii Selector. #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub enum Index { + /// Specific Mii index. Index(u32), + /// All Miis. All, } /// The type of a Mii with their respective data #[derive(Debug, Clone, Eq, PartialEq)] pub enum MiiType { - Guest { index: u32, name: String }, + /// Guest Mii. + Guest { + /// Guest Mii index. + index: u32, + /// Guest Mii name. + name: String, + }, + /// User-made Mii. User, } @@ -56,7 +64,9 @@ pub struct MiiSelector { #[non_exhaustive] #[derive(Clone, Debug)] pub struct SelectionResult { + /// Data regarding the selected Mii. pub mii_data: MiiData, + /// Type of the selected Mii. pub mii_type: MiiType, } diff --git a/ctru-rs/src/applets/swkbd.rs b/ctru-rs/src/applets/swkbd.rs index 49a4103..e5e9c28 100644 --- a/ctru-rs/src/applets/swkbd.rs +++ b/ctru-rs/src/applets/swkbd.rs @@ -14,19 +14,19 @@ pub struct Swkbd { } /// The kind of keyboard to be initialized. -/// -/// Normal is the full keyboard with several pages (QWERTY/accents/symbol/mobile) -/// Qwerty is a QWERTY-only keyboard. -/// Numpad is a number pad. -/// Western is a text keyboard without japanese symbols (only applies to JPN systems). For other -/// systems it's the same as a Normal keyboard. #[doc(alias = "SwkbdType")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum Kind { + /// Normal keyboard composed of several pages (QWERTY, accents, symbols, mobile). Normal = ctru_sys::SWKBD_TYPE_NORMAL, + /// Only QWERTY keyboard. Qwerty = ctru_sys::SWKBD_TYPE_QWERTY, + /// Only number pad. Numpad = ctru_sys::SWKBD_TYPE_NUMPAD, + /// On JPN systems: a keyboard without japanese input capablities. + /// + /// On any other region: same as [`Normal`](Kind::Normal). Western = ctru_sys::SWKBD_TYPE_WESTERN, } @@ -35,8 +35,11 @@ pub enum Kind { #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum Button { + /// Left button. Usually corresponds to "Cancel". Left = ctru_sys::SWKBD_BUTTON_LEFT, + /// Middle button. Usually corresponds to "I Forgot". Middle = ctru_sys::SWKBD_BUTTON_MIDDLE, + /// Right button. Usually corresponds to "OK". Right = ctru_sys::SWKBD_BUTTON_RIGHT, } @@ -45,49 +48,77 @@ pub enum Button { #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(i32)] pub enum Error { + /// Invalid parameters inputted in the Software Keyboard. InvalidInput = ctru_sys::SWKBD_INVALID_INPUT, + /// Out of memory. OutOfMem = ctru_sys::SWKBD_OUTOFMEM, + /// Home button was pressed during execution. HomePressed = ctru_sys::SWKBD_HOMEPRESSED, + /// Reset button was pressed during execution. ResetPressed = ctru_sys::SWKBD_RESETPRESSED, + /// Power button was pressed during execution. PowerPressed = ctru_sys::SWKBD_POWERPRESSED, + /// The parental PIN was correct. ParentalOk = ctru_sys::SWKBD_PARENTAL_OK, + /// The parental PIN was incorrect. ParentalFail = ctru_sys::SWKBD_PARENTAL_FAIL, + /// Input triggered the filter. BannedInput = ctru_sys::SWKBD_BANNED_INPUT, } -/// Restrictions on keyboard input +/// Restrictions on keyboard input. #[doc(alias = "SwkbdValidInput")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum ValidInput { + /// All inputs are accepted. Anything = ctru_sys::SWKBD_ANYTHING, + /// Empty inputs are not accepted. NotEmpty = ctru_sys::SWKBD_NOTEMPTY, - NotEmptyNotBlank = ctru_sys::SWKBD_NOTEMPTY_NOTBLANK, + /// Blank (consisting only of whitespaces) inputs are not accepted. NotBlank = ctru_sys::SWKBD_NOTBLANK, + /// Neither empty inputs nor blank inputs are accepted. + NotEmptyNotBlank = ctru_sys::SWKBD_NOTEMPTY_NOTBLANK, + /// Input must have a fixed length. Maximum length can be specified with [`Swkbd::set_max_text_len`]; FixedLen = ctru_sys::SWKBD_FIXEDLEN, } bitflags! { - /// Keyboard feature flags + /// Keyboard feature flags. pub struct Features: u32 { + /// Parental PIN mode. const PARENTAL_PIN = ctru_sys::SWKBD_PARENTAL; + /// Darken top screen while the Software Keyboard is active. const DARKEN_TOP_SCREEN = ctru_sys::SWKBD_DARKEN_TOP_SCREEN; + /// Enable predictive input (necessary for Kanji on JPN consoles). const PREDICTIVE_INPUT = ctru_sys::SWKBD_PREDICTIVE_INPUT; + /// Enable multiline input. const MULTILINE = ctru_sys::SWKBD_MULTILINE; + /// Enable fixed-width mode. const FIXED_WIDTH = ctru_sys::SWKBD_FIXED_WIDTH; + /// Allow the usage of the Home Button while the Software Keyboard is active. const ALLOW_HOME = ctru_sys::SWKBD_ALLOW_HOME; + /// Allow the usage of the Reset Button while the Software Keyboard is active. const ALLOW_RESET = ctru_sys::SWKBD_ALLOW_RESET; + /// Allow the usage of the Power Button while the Software Keyboard is active. const ALLOW_POWER = ctru_sys::SWKBD_ALLOW_POWER; + /// Default to the QWERTY page when the Software Keyboard is shown. const DEFAULT_QWERTY = ctru_sys::SWKBD_DEFAULT_QWERTY; } /// Keyboard input filtering flags pub struct Filters: u32 { + /// Disallows the usage of numerical digits. const DIGITS = ctru_sys::SWKBD_FILTER_DIGITS; + /// Disallows the usage of the "at" (@) sign. const AT = ctru_sys::SWKBD_FILTER_AT; + /// Disallows the usage of the "percent" (%) sign. const PERCENT = ctru_sys::SWKBD_FILTER_PERCENT; + /// Disallows the usage of the "backslash" (\) sign. const BACKSLASH = ctru_sys::SWKBD_FILTER_BACKSLASH; + /// Disallows the use of profanity via Nintendo's profanity filter. const PROFANITY = ctru_sys::SWKBD_FILTER_PROFANITY; + /// Use a custom callback in order to filter the input. const CALLBACK = ctru_sys::SWKBD_FILTER_CALLBACK; } } diff --git a/ctru-rs/src/mii.rs b/ctru-rs/src/mii.rs index 120eee1..b5a2f03 100644 --- a/ctru-rs/src/mii.rs +++ b/ctru-rs/src/mii.rs @@ -3,171 +3,238 @@ //! This module contains the structs that represent all the data of a Mii. //! This data is given by the [``MiiSelector``](crate::applets::mii_selector::MiiSelector) -/// Represents the region lock of the console +/// Represents the region lock of the console. #[derive(Copy, Clone, Debug, Eq, PartialEq)] pub enum RegionLock { + /// No region-lock. None, + /// Japan region-lock. Japan, + /// USA region-lock. USA, + /// Europe region-lock. Europe, } -/// Represent the charset of the console +/// Represent the charset of the console. #[derive(Copy, Clone, Debug, Eq, PartialEq)] pub enum Charset { + /// Japan-USA-Europe unified charset. JapanUSAEurope, + /// China charset. China, + /// Korea charset. Korea, + /// Taiwan charset. Taiwan, } -/// Represents the options of the Mii +/// Represents the options of the Mii. #[derive(Copy, Clone, Debug)] pub struct MiiDataOptions { + /// Whether it is allowed to copy the Mii. pub is_copying_allowed: bool, + /// Whether the profanity flag is active. pub is_profanity_flag_enabled: bool, + /// The Mii's active region-lock. pub region_lock: RegionLock, + /// The Mii's used charset. pub charset: Charset, } -/// Represents the position that the Mii has on the selector +/// Represents the position that the Mii has on the selector. #[derive(Copy, Clone, Debug)] pub struct SelectorPosition { + /// Index of the page where the Mii is found. pub page_index: u8, + /// Index of the slot (relative to the page) where the Mii is found. pub slot_index: u8, } -/// Represents the kind of origin console +/// Represents the console where the Mii originated from. #[derive(Copy, Clone, Debug, Eq, PartialEq)] pub enum OriginConsole { + /// Nintendo Wii. Wii, + /// Nintendo DSi. DSi, - /// Both New 3DS and Old 3DS + /// Nintendo 3DS (both New 3DS and Old 3DS). N3DS, + /// Nintendo WiiU/Switch. WiiUSwitch, } -/// Represents the identity of the origin console +/// Represents the identity of the origin console. #[derive(Copy, Clone, Debug)] pub struct ConsoleIdentity { + /// From which console the Mii originated from. pub origin_console: OriginConsole, } -/// Represents the sex of the Mii +/// Represents the sex of the Mii. #[derive(Copy, Clone, Debug, Eq, PartialEq)] pub enum MiiSex { + /// Male sex. Male, + /// Female sex. Female, } -/// Represents the details of the Mii +/// Represents the details of the Mii. #[derive(Copy, Clone, Debug)] pub struct Details { + /// Sex of the Mii. pub sex: MiiSex, + /// Birthday month. pub birthday_month: u8, + /// Birthday day. pub birthday_day: u8, + /// Color of the Mii's shirt. pub shirt_color: u8, + /// Whether the Mii is a favorite. pub is_favorite: bool, + /// Whether the Mii can be shared. + pub is_sharing_enabled: bool, } -/// Represents the face style of the Mii +/// Represents the face style of the Mii. #[derive(Copy, Clone, Debug)] pub struct FaceStyle { - pub is_sharing_enabled: bool, + /// Face shape. pub shape: u8, + /// Skin color. pub skin_color: u8, } -/// Represents the face details of the Mii +/// Represents the face details of the Mii. #[derive(Copy, Clone, Debug)] pub struct FaceDetails { + /// Face style. pub style: FaceStyle, + /// Wrinkles. pub wrinkles: u8, + /// Makeup. pub makeup: u8, } -/// Represents the hair details of the Mii +/// Represents the hair details of the Mii. #[derive(Copy, Clone, Debug)] pub struct HairDetails { + /// Hair style. pub style: u8, + /// Hair color. pub color: u8, + /// Whether the Mii's hair is flipped. pub is_flipped: bool, } -/// Represents the eye details of the Mii +/// Represents the eye details of the Mii. #[derive(Copy, Clone, Debug)] pub struct EyeDetails { + /// Eye style. pub style: u8, + /// Eye color. pub color: u8, + /// Eye scale. pub scale: u8, + /// Eye scale (y-axis). pub y_scale: u8, + /// Eye rotation. pub rotation: u8, - /// Spacing between the eyes + /// Spacing between the eyes. pub x_spacing: u8, + /// Eye height. pub y_position: u8, } /// Represents the eyebrow details of the Mii #[derive(Copy, Clone, Debug)] pub struct EyebrowDetails { + /// Eyebrow style. pub style: u8, + /// Eyebrow color. pub color: u8, + /// Eyebrow scale. pub scale: u8, + /// Eyebrow scale (y-axis). pub y_scale: u8, + /// Eyebrow rotation. pub rotation: u8, /// Spacing between the eyebrows pub x_spacing: u8, + /// Eyebrow height. pub y_position: u8, } /// Represents the details of the nose #[derive(Copy, Clone, Debug)] pub struct NoseDetails { + /// Nose style. pub style: u8, + /// Nose scale. pub scale: u8, + /// Nose height. pub y_position: u8, } /// Represents the details of the mouth #[derive(Copy, Clone, Debug)] pub struct MouthDetails { + /// Mouth style. pub style: u8, + /// Mouth color. pub color: u8, + /// Mouth scale. pub scale: u8, + /// Mouth scale (y-axis). pub y_scale: u8, + /// Mouth height. + pub y_position: u8, } /// Represents the details of the mustache #[derive(Copy, Clone, Debug)] pub struct MustacheDetails { - pub mouth_y_position: u8, + /// Mustache style. pub mustache_style: u8, } /// Represents the details of the beard #[derive(Copy, Clone, Debug)] pub struct BeardDetails { + /// Beard style pub style: u8, + /// Beard color. pub color: u8, + /// Beard scale. pub scale: u8, + /// Beard height. pub y_position: u8, } -/// Represents the details of the glass +/// Represents the details of the glasses #[derive(Copy, Clone, Debug)] -pub struct GlassDetails { +pub struct GlassesDetails { + /// Glasses style. pub style: u8, + /// Glasses color. pub color: u8, + /// Glasses scale. pub scale: u8, + /// Glasses height. pub y_position: u8, } -/// Represents the details of the mole +/// Represents the details of the mole. #[derive(Copy, Clone, Debug)] pub struct MoleDetails { + /// Whether the Mii has a mole. pub is_enabled: bool, + /// Mole scale. pub scale: u8, + /// Mole position (x-axis). pub x_position: u8, + /// Mole position (y-axis). pub y_position: u8, } @@ -177,34 +244,52 @@ pub struct MoleDetails { /// /// /// This struct is returned by the [`MiiSelector`](crate::applets::mii_selector::MiiSelector) -#[doc(alias = "MiiData")] #[derive(Clone, Debug)] pub struct MiiData { + /// Mii options. pub options: MiiDataOptions, + /// Position taken by the Mii on the Mii Selector screen. pub selector_position: SelectorPosition, + /// Console the Mii was created on. pub console_identity: ConsoleIdentity, /// Unique system ID, not dependant on the MAC address pub system_id: [u8; 8], + /// Console's MAC address. pub mac_address: [u8; 6], + /// General information about the Mii. pub details: Details, + /// Mii name. pub name: String, + /// Mii height. pub height: u8, + /// Mii width. pub width: u8, + /// Face details. pub face_details: FaceDetails, + /// Hair details. pub hair_details: HairDetails, + /// Eyes details. pub eye_details: EyeDetails, + /// Eyebrow details. pub eyebrow_details: EyebrowDetails, + /// Nose details. pub nose_details: NoseDetails, + /// Mouth details. pub mouth_details: MouthDetails, + /// Mustache details. pub mustache_details: MustacheDetails, + /// Beard details. pub beard_details: BeardDetails, - pub glass_details: GlassDetails, + /// Glasses details. + pub glass_details: GlassesDetails, + /// Mole details. pub mole_details: MoleDetails, + /// Name of the Mii's original author. pub author_name: String, } @@ -321,11 +406,11 @@ impl From for MiiData { birthday_day: partial_u8_bits_to_u8(&raw_details[5..=9]), shirt_color: partial_u8_bits_to_u8(&raw_details[10..=13]), is_favorite: raw_details[14], + is_sharing_enabled: !raw_face_style[0], }; let face_details = FaceDetails { style: FaceStyle { - is_sharing_enabled: !raw_face_style[0], shape: partial_u8_bits_to_u8(&raw_face_style[1..=4]), skin_color: partial_u8_bits_to_u8(&raw_face_style[5..=7]), }, @@ -372,10 +457,10 @@ impl From for MiiData { color: partial_u8_bits_to_u8(&raw_mouth_details[6..=8]), scale: partial_u8_bits_to_u8(&raw_mouth_details[9..=12]), y_scale: partial_u8_bits_to_u8(&raw_mouth_details[13..=15]), + y_position: partial_u8_bits_to_u8(&raw_mustache_details[0..=4]), }; let mustache_details = MustacheDetails { - mouth_y_position: partial_u8_bits_to_u8(&raw_mustache_details[0..=4]), mustache_style: partial_u8_bits_to_u8(&raw_mustache_details[5..=7]), }; @@ -386,7 +471,7 @@ impl From for MiiData { y_position: partial_u8_bits_to_u8(&raw_beard_details[10..=14]), }; - let glass_details = GlassDetails { + let glass_details = GlassesDetails { style: partial_u8_bits_to_u8(&raw_glass_details[0..=3]), color: partial_u8_bits_to_u8(&raw_glass_details[4..=6]), scale: partial_u8_bits_to_u8(&raw_glass_details[7..=10]), diff --git a/ctru-rs/src/services/am.rs b/ctru-rs/src/services/am.rs index 2af1152..9892bd7 100644 --- a/ctru-rs/src/services/am.rs +++ b/ctru-rs/src/services/am.rs @@ -62,9 +62,9 @@ impl<'a> Title<'a> { /// Returns the size of this title in bytes. pub fn size(&self) -> crate::Result { // Get the internal entry, or fill it if empty. - let entry = self.entry.get_or_try_init(|| -> crate::Result { - self.title_info() - })?; + let entry = self + .entry + .get_or_try_init(|| -> crate::Result { self.title_info() })?; Ok(entry.size) } @@ -72,9 +72,9 @@ impl<'a> Title<'a> { /// Returns the installed version of this title. pub fn version(&self) -> crate::Result { // Get the internal entry, or fill it if empty. - let entry = self.entry.get_or_try_init(|| -> crate::Result { - self.title_info() - })?; + let entry = self + .entry + .get_or_try_init(|| -> crate::Result { self.title_info() })?; Ok(entry.version) } diff --git a/ctru-rs/src/services/cam.rs b/ctru-rs/src/services/cam.rs index 0d18d89..de9ecb5 100644 --- a/ctru-rs/src/services/cam.rs +++ b/ctru-rs/src/services/cam.rs @@ -14,9 +14,13 @@ use std::time::Duration; /// This service requires no special permissions to use. #[non_exhaustive] pub struct Cam { + /// Inside-facing camera. pub inner_cam: InwardCam, + /// Outside-facing right camera. pub outer_right_cam: OutwardRightCam, + /// Outside-facing left camera. pub outer_left_cam: OutwardLeftCam, + /// Both outside-facing cameras (mainly used for 3D photos). pub both_outer_cams: BothOutwardCam, } @@ -25,9 +29,13 @@ pub struct Cam { #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum FlipMode { + /// No flip applied. None = ctru_sys::FLIP_NONE, + /// Horizontal flip applied. Horizontal = ctru_sys::FLIP_HORIZONTAL, + /// Vertical flip applied. Vertical = ctru_sys::FLIP_VERTICAL, + /// Both vertical and horizontal flip applied. Reverse = ctru_sys::FLIP_REVERSE, } @@ -36,16 +44,25 @@ pub enum FlipMode { #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum ViewSize { + /// Size of the 3DS' top screen. (400 × 240) + /// + /// Useful if the image is meant to be displayed immediately. TopLCD = ctru_sys::SIZE_CTR_TOP_LCD, - /// Equivalent to QVga + /// Size of the 3DS' bottom screen. (320 × 240) + /// + /// Equivalent to QVga. BottomLCD = ctru_sys::SIZE_CTR_BOTTOM_LCD, + /// VGA display size. (640 × 480) Vga = ctru_sys::SIZE_VGA, + /// QQVGA display size. (160 × 120) QQVga = ctru_sys::SIZE_QQVGA, + /// CIF display size. (352 × 288) Cif = ctru_sys::SIZE_CIF, + /// QCIF display size. (176 × 144) QCif = ctru_sys::SIZE_QCIF, - /// Nintendo DS Screen + /// Nintendo DS Screen size. (256 × 192) DS = ctru_sys::SIZE_DS_LCD, - /// Nintendo DS Screen x4 + /// Nintendo DS Screen size x4. (512 × 384) DSX4 = ctru_sys::SIZE_DS_LCDx4, } @@ -54,18 +71,31 @@ pub enum ViewSize { #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum FrameRate { + /// 15 FPS. Fps15 = ctru_sys::FRAME_RATE_15, + /// 15 to 5 FPS. Fps15To5 = ctru_sys::FRAME_RATE_15_TO_5, + /// 15 to 2 FPS. Fps15To2 = ctru_sys::FRAME_RATE_15_TO_2, + /// 10 FPS. Fps10 = ctru_sys::FRAME_RATE_10, + /// 8.5 FPS. Fps8_5 = ctru_sys::FRAME_RATE_8_5, + /// 5 FPS. Fps5 = ctru_sys::FRAME_RATE_5, + /// 20 FPS. Fps20 = ctru_sys::FRAME_RATE_20, + /// 20 to 5 FPS. Fps20To5 = ctru_sys::FRAME_RATE_20_TO_5, + /// 30 FPS. Fps30 = ctru_sys::FRAME_RATE_30, + /// 30 to 5 FPS. Fps30To5 = ctru_sys::FRAME_RATE_30_TO_5, + /// 15 to 10 FPS. Fps15To10 = ctru_sys::FRAME_RATE_15_TO_10, + /// 20 to 10 FPS. Fps20To10 = ctru_sys::FRAME_RATE_20_TO_10, + /// 30 to 10 FPS. Fps30To10 = ctru_sys::FRAME_RATE_30_TO_10, } @@ -85,7 +115,7 @@ pub enum WhiteBalance { Temp5200K = ctru_sys::WHITE_BALANCE_5200K, /// Cloudy/Horizon Temp6000K = ctru_sys::WHITE_BALANCE_6000K, - ///Shade + /// Shade Temp7000K = ctru_sys::WHITE_BALANCE_7000K, } @@ -94,10 +124,15 @@ pub enum WhiteBalance { #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum PhotoMode { + /// Normal mode. Normal = ctru_sys::PHOTO_MODE_NORMAL, + /// Portrait mode. Portrait = ctru_sys::PHOTO_MODE_PORTRAIT, + /// Landscape mode. Landscape = ctru_sys::PHOTO_MODE_LANDSCAPE, + /// NightView mode. NightView = ctru_sys::PHOTO_MODE_NIGHTVIEW, + /// Letter mode. Letter = ctru_sys::PHOTO_MODE_LETTER, } @@ -106,11 +141,17 @@ pub enum PhotoMode { #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum Effect { + /// No effects. None = ctru_sys::EFFECT_NONE, + /// Mono effect. Mono = ctru_sys::EFFECT_MONO, + /// Sepia effect. Sepia = ctru_sys::EFFECT_SEPIA, + /// Negative effect. Negative = ctru_sys::EFFECT_NEGATIVE, + /// Negative film effect. Negafilm = ctru_sys::EFFECT_NEGAFILM, + /// Sepia effect. (unknown difference) Sepia01 = ctru_sys::EFFECT_SEPIA01, } @@ -119,11 +160,11 @@ pub enum Effect { #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum Contrast { - /// OFF + /// Low contrast. Low = ctru_sys::CONTRAST_LOW, - /// Brightness ratio: 70 + /// Brightness ratio: 70. Normal = ctru_sys::CONTRAST_NORMAL, - /// Brightness ratio: 90 + /// Brightness ratio: 90. High = ctru_sys::CONTRAST_HIGH, } @@ -132,8 +173,11 @@ pub enum Contrast { #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum LensCorrection { + /// No lens correction. Off = ctru_sys::LENS_CORRECTION_DARK, + /// Normal lens correction. Normal = ctru_sys::LENS_CORRECTION_NORMAL, + /// Bright lens correction. Bright = ctru_sys::LENS_CORRECTION_BRIGHT, } @@ -142,7 +186,9 @@ pub enum LensCorrection { #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum OutputFormat { + /// YUV422 output format. 16 bits per pixel. Yuv422 = ctru_sys::OUTPUT_YUV_422, + /// RGB565 output format. 16 bits per pixel. Rgb565 = ctru_sys::OUTPUT_RGB_565, } @@ -151,8 +197,11 @@ pub enum OutputFormat { #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum ShutterSound { + /// Normal shutter sound. Normal = ctru_sys::SHUTTER_SOUND_TYPE_NORMAL, + /// Shutter sound to begin a movie recording. Movie = ctru_sys::SHUTTER_SOUND_TYPE_MOVIE, + /// Shutter sound to finish a movie recording. MovieEnd = ctru_sys::SHUTTER_SOUND_TYPE_MOVIE_END, } diff --git a/ctru-rs/src/services/cfgu.rs b/ctru-rs/src/services/cfgu.rs index 661fdf9..99ef505 100644 --- a/ctru-rs/src/services/cfgu.rs +++ b/ctru-rs/src/services/cfgu.rs @@ -4,46 +4,74 @@ use crate::error::ResultCode; +/// Console's region. #[doc(alias = "CFG_Region")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum Region { + /// Japan. Japan = ctru_sys::CFG_REGION_JPN, + /// USA. USA = ctru_sys::CFG_REGION_USA, + /// Europe. Europe = ctru_sys::CFG_REGION_EUR, + /// Australia. Australia = ctru_sys::CFG_REGION_AUS, + /// China. China = ctru_sys::CFG_REGION_CHN, + /// Korea. Korea = ctru_sys::CFG_REGION_KOR, + /// Taiwan. Taiwan = ctru_sys::CFG_REGION_TWN, } +/// Language set for the console's OS. #[doc(alias = "CFG_Language")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum Language { + /// Japanese. Japanese = ctru_sys::CFG_LANGUAGE_JP, + /// English. English = ctru_sys::CFG_LANGUAGE_EN, + /// French. French = ctru_sys::CFG_LANGUAGE_FR, + /// German. German = ctru_sys::CFG_LANGUAGE_DE, + /// Italian. Italian = ctru_sys::CFG_LANGUAGE_IT, + /// Spanish. Spanish = ctru_sys::CFG_LANGUAGE_ES, - SimplifiedChinese = ctru_sys::CFG_LANGUAGE_ZH, + /// Korean. Korean = ctru_sys::CFG_LANGUAGE_KO, + /// Dutch. Dutch = ctru_sys::CFG_LANGUAGE_NL, + /// Portuguese. Portuguese = ctru_sys::CFG_LANGUAGE_PT, + /// Russian. Russian = ctru_sys::CFG_LANGUAGE_RU, + /// Simplified Chinese. + SimplifiedChinese = ctru_sys::CFG_LANGUAGE_ZH, + /// Traditional Chinese. TraditionalChinese = ctru_sys::CFG_LANGUAGE_TW, } +/// 3DS model. #[doc(alias = "CFG_SystemModel")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum SystemModel { + /// Old Nintendo 3DS. Old3DS = ctru_sys::CFG_MODEL_3DS, + /// Old Nintendo 3DS XL. Old3DSXL = ctru_sys::CFG_MODEL_3DSXL, + /// New Nintendo 3DS. New3DS = ctru_sys::CFG_MODEL_N3DS, + /// Old Nintendo 2DS. Old2DS = ctru_sys::CFG_MODEL_2DS, + /// New Nintendo 3DS XL. New3DSXL = ctru_sys::CFG_MODEL_N3DSXL, + /// New Nintendo 2DS XL. New2DSXL = ctru_sys::CFG_MODEL_N2DSXL, } diff --git a/ctru-rs/src/services/fs.rs b/ctru-rs/src/services/fs.rs index b498ee9..9b56ddd 100644 --- a/ctru-rs/src/services/fs.rs +++ b/ctru-rs/src/services/fs.rs @@ -39,51 +39,86 @@ bitflags! { } } +/// Media type used for storage. #[doc(alias = "FS_MediaType")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum FsMediaType { + /// Internal NAND memory. Nand = ctru_sys::MEDIATYPE_NAND, + /// External SD card. Sd = ctru_sys::MEDIATYPE_SD, + /// Game Cartridge. GameCard = ctru_sys::MEDIATYPE_GAME_CARD, } +/// Kind of file path. #[doc(alias = "FS_PathType")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum PathType { + /// Invalid path. Invalid = ctru_sys::PATH_INVALID, + /// Empty path. Empty = ctru_sys::PATH_EMPTY, + /// Binary path. + /// + /// Its meaning differs depending on the Archive it is used on. Binary = ctru_sys::PATH_BINARY, + /// ASCII path. ASCII = ctru_sys::PATH_ASCII, + /// UTF-16 path. UTF16 = ctru_sys::PATH_UTF16, } +/// Index of the various usable data archives. #[doc(alias = "FS_ArchiveID")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum ArchiveID { + /// Read-Only Memory File System. RomFS = ctru_sys::ARCHIVE_ROMFS, + /// Game save data. Savedata = ctru_sys::ARCHIVE_SAVEDATA, + /// Game ext data. Extdata = ctru_sys::ARCHIVE_EXTDATA, + /// Shared ext data. SharedExtdata = ctru_sys::ARCHIVE_SHARED_EXTDATA, + /// System save data. SystemSavedata = ctru_sys::ARCHIVE_SYSTEM_SAVEDATA, + /// SD card. Sdmc = ctru_sys::ARCHIVE_SDMC, + /// SD card (write-only). SdmcWriteOnly = ctru_sys::ARCHIVE_SDMC_WRITE_ONLY, + /// BOSS ext data. BossExtdata = ctru_sys::ARCHIVE_BOSS_EXTDATA, + /// Card SPI File System. CardSpiFS = ctru_sys::ARCHIVE_CARD_SPIFS, + /// Game ext data and BOSS data. ExtDataAndBossExtdata = ctru_sys::ARCHIVE_EXTDATA_AND_BOSS_EXTDATA, + /// System save data. SystemSaveData2 = ctru_sys::ARCHIVE_SYSTEM_SAVEDATA2, + /// Internal NAND (read-write). NandRW = ctru_sys::ARCHIVE_NAND_RW, + /// Internal NAND (read-only). NandRO = ctru_sys::ARCHIVE_NAND_RO, + /// Internal NAND (read-only write access). NandROWriteAccess = ctru_sys::ARCHIVE_NAND_RO_WRITE_ACCESS, + /// User save data and ExeFS/RomFS. SaveDataAndContent = ctru_sys::ARCHIVE_SAVEDATA_AND_CONTENT, + /// User save data and ExeFS/RomFS (only ExeFS for fs:LDR). SaveDataAndContent2 = ctru_sys::ARCHIVE_SAVEDATA_AND_CONTENT2, + /// NAND CTR File System. NandCtrFS = ctru_sys::ARCHIVE_NAND_CTR_FS, + /// TWL photo. TwlPhoto = ctru_sys::ARCHIVE_TWL_PHOTO, + /// NAND TWL File System. NandTwlFS = ctru_sys::ARCHIVE_NAND_TWL_FS, + /// Game card save data. GameCardSavedata = ctru_sys::ARCHIVE_GAMECARD_SAVEDATA, + /// User save data. UserSavedata = ctru_sys::ARCHIVE_USER_SAVEDATA, + /// Demo save data. DemoSavedata = ctru_sys::ARCHIVE_DEMO_SAVEDATA, } diff --git a/ctru-rs/src/services/gspgpu.rs b/ctru-rs/src/services/gspgpu.rs index 1510b29..cb3e67c 100644 --- a/ctru-rs/src/services/gspgpu.rs +++ b/ctru-rs/src/services/gspgpu.rs @@ -1,20 +1,28 @@ //! GSPGPU service +/// GSPGPU events that can be awaited. #[doc(alias = "GSPGPU_Event")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum Event { + /// Memory fill completed. Psc0 = ctru_sys::GSPGPU_EVENT_PSC0, + /// TODO: Unknown. Psc1 = ctru_sys::GSPGPU_EVENT_PSC1, + /// TODO: Unknown. VBlank0 = ctru_sys::GSPGPU_EVENT_VBlank0, + /// TODO: Unknown. VBlank1 = ctru_sys::GSPGPU_EVENT_VBlank1, + /// Display transfer finished. PPF = ctru_sys::GSPGPU_EVENT_PPF, + /// Command list processing finished. P3D = ctru_sys::GSPGPU_EVENT_P3D, + /// TODO: Unknown. DMA = ctru_sys::GSPGPU_EVENT_DMA, } #[doc(alias = "GSPGPU_FramebufferFormat")] -/// Framebuffer formats supported by the 3DS +/// Framebuffer formats supported by the 3DS. #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum FramebufferFormat { diff --git a/ctru-rs/src/services/hid.rs b/ctru-rs/src/services/hid.rs index 8de66a1..51bf63a 100644 --- a/ctru-rs/src/services/hid.rs +++ b/ctru-rs/src/services/hid.rs @@ -9,33 +9,62 @@ bitflags::bitflags! { /// A set of flags corresponding to the button and directional pad /// inputs on the 3DS pub struct KeyPad: u32 { + /// A button. const A = ctru_sys::KEY_A; + /// B button. const B = ctru_sys::KEY_B; + /// Select button. const SELECT = ctru_sys::KEY_SELECT; + /// Start button. const START = ctru_sys::KEY_START; + /// D-Pad Right. const DPAD_RIGHT = ctru_sys::KEY_DRIGHT; + /// D-Pad Left. const DPAD_LEFT = ctru_sys::KEY_DLEFT; + /// D-Pad Up. const DPAD_UP = ctru_sys::KEY_DUP; + /// D-Pad Down. const DPAD_DOWN = ctru_sys::KEY_DDOWN; + /// R button. const R = ctru_sys::KEY_R; + /// L button. const L = ctru_sys::KEY_L; + /// X button. const X = ctru_sys::KEY_X; + /// Y button. const Y = ctru_sys::KEY_Y; + /// ZL button. const ZL = ctru_sys::KEY_ZL; + /// ZR button. const ZR = ctru_sys::KEY_ZR; + /// Touchscreen. const TOUCH = ctru_sys::KEY_TOUCH; + /// C-Stick Right. const CSTICK_RIGHT = ctru_sys::KEY_CSTICK_RIGHT; + /// C-Stick Left. const CSTICK_LEFT = ctru_sys::KEY_CSTICK_LEFT; + /// C-Stick Up. const CSTICK_UP = ctru_sys::KEY_CSTICK_UP; + /// C-Stick Down. const CSTICK_DOWN = ctru_sys::KEY_CSTICK_DOWN; + /// CirclePad Right. const CPAD_RIGHT = ctru_sys::KEY_CPAD_RIGHT; + /// CirclePad Left. const CPAD_LEFT = ctru_sys::KEY_CPAD_LEFT; + /// CirclePad Up. const CPAD_UP = ctru_sys::KEY_CPAD_UP; + /// CirclePad Down. const CPAD_DOWN = ctru_sys::KEY_CPAD_DOWN; - // Convenience catch-all for the dpad and cpad + + // Convenience catch-all for the D-Pad and the C-Pad + + /// Direction Up (either D-Pad or C-Pad). const UP = KeyPad::DPAD_UP.bits() | KeyPad::CPAD_UP.bits(); + /// Direction Down (either D-Pad or C-Pad). const DOWN = KeyPad::DPAD_DOWN.bits() | KeyPad::CPAD_DOWN.bits(); + /// Direction Left (either D-Pad or C-Pad). const LEFT = KeyPad::DPAD_LEFT.bits() | KeyPad::CPAD_LEFT.bits(); + /// Direction Right (either D-Pad or C-Pad).. const RIGHT = KeyPad::DPAD_RIGHT.bits() | KeyPad::CPAD_RIGHT.bits(); } } diff --git a/ctru-rs/src/services/ndsp/mod.rs b/ctru-rs/src/services/ndsp/mod.rs index 7867048..2ff9d7b 100644 --- a/ctru-rs/src/services/ndsp/mod.rs +++ b/ctru-rs/src/services/ndsp/mod.rs @@ -14,21 +14,30 @@ use std::sync::Mutex; const NUMBER_OF_CHANNELS: u8 = 24; +/// Audio output mode. #[doc(alias = "ndspOutputMode")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum OutputMode { + /// Single-Channel. Mono = ctru_sys::NDSP_OUTPUT_MONO, + /// Dual-Channel. Stereo = ctru_sys::NDSP_OUTPUT_STEREO, + /// Surround. Surround = ctru_sys::NDSP_OUTPUT_SURROUND, } +/// Audio PCM format. #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum AudioFormat { + /// PCM 8bit single-channel. PCM8Mono = ctru_sys::NDSP_FORMAT_MONO_PCM8, + /// PCM 16bit single-channel. PCM16Mono = ctru_sys::NDSP_FORMAT_MONO_PCM16, + /// PCM 8bit dual-channel. PCM8Stereo = ctru_sys::NDSP_FORMAT_STEREO_PCM8, + /// PCM 16bit dual-channel. PCM16Stereo = ctru_sys::NDSP_FORMAT_STEREO_PCM16, } @@ -38,15 +47,20 @@ pub struct AudioMix { raw: [f32; 12], } +/// Interpolation used between audio frames. #[doc(alias = "ndspInterpType")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum InterpolationType { + /// Polyphase interpolation. Polyphase = ctru_sys::NDSP_INTERP_POLYPHASE, + /// Linear interpolation. Linear = ctru_sys::NDSP_INTERP_LINEAR, + /// No interpolation. None = ctru_sys::NDSP_INTERP_NONE, } +/// Error enum returned by NDSP methods. #[derive(Copy, Clone, Debug, PartialEq, Eq)] pub enum NdspError { /// Channel ID diff --git a/ctru-rs/src/services/ndsp/wave.rs b/ctru-rs/src/services/ndsp/wave.rs index 6cc5847..9194685 100644 --- a/ctru-rs/src/services/ndsp/wave.rs +++ b/ctru-rs/src/services/ndsp/wave.rs @@ -15,9 +15,13 @@ pub struct Wave { #[repr(u8)] /// Enum representing the playback status of a [`Wave`]. pub enum WaveStatus { + /// Wave has never been used. Free = ctru_sys::NDSP_WBUF_FREE as u8, + /// Wave is currently queued for usage. Queued = ctru_sys::NDSP_WBUF_QUEUED as u8, + /// Wave is currently playing. Playing = ctru_sys::NDSP_WBUF_PLAYING as u8, + /// Wave has finished playing. Done = ctru_sys::NDSP_WBUF_DONE as u8, } diff --git a/ctru-rs/src/services/ps.rs b/ctru-rs/src/services/ps.rs index ee96216..0673ce8 100644 --- a/ctru-rs/src/services/ps.rs +++ b/ctru-rs/src/services/ps.rs @@ -6,31 +6,49 @@ use crate::error::ResultCode; use crate::Result; +/// Kind of AES algorithm to use. #[doc(alias = "PS_AESAlgorithm")] #[derive(Debug, Clone, Copy, PartialEq, Eq)] #[repr(u32)] pub enum AESAlgorithm { + /// CBC encryption. CbcEnc = ctru_sys::PS_ALGORITHM_CBC_ENC, + /// CBC decryption. CbcDec = ctru_sys::PS_ALGORITHM_CBC_DEC, + /// CTR encryption. CtrEnc = ctru_sys::PS_ALGORITHM_CTR_ENC, + /// CTR decryption. CtrDec = ctru_sys::PS_ALGORITHM_CTR_DEC, + /// CCM encryption. CcmEnc = ctru_sys::PS_ALGORITHM_CCM_ENC, + /// CCM decryption. CcmDec = ctru_sys::PS_ALGORITHM_CCM_DEC, } +/// PS Key slot to use. #[doc(alias = "PS_AESKeyType")] #[derive(Debug, Clone, Copy, PartialEq, Eq)] #[repr(u32)] pub enum AESKeyType { + /// Keyslot 0x0D. Keyslot0D = ctru_sys::PS_KEYSLOT_0D, + /// Keyslot 0x2D. Keyslot2D = ctru_sys::PS_KEYSLOT_2D, + /// Keyslot 0x2E. Keyslot2E = ctru_sys::PS_KEYSLOT_2E, + /// Keyslot 0x31. Keyslot31 = ctru_sys::PS_KEYSLOT_31, + /// Keyslot 0x32. Keyslot32 = ctru_sys::PS_KEYSLOT_32, + /// Keyslot 0x36. Keyslot36 = ctru_sys::PS_KEYSLOT_36, + /// Keyslot 0x38. Keyslot38 = ctru_sys::PS_KEYSLOT_38, + /// Keyslot 0x39 (DLP). Keyslot39Dlp = ctru_sys::PS_KEYSLOT_39_DLP, + /// Keyslot 0x39 (NFC). Keyslot39Nfc = ctru_sys::PS_KEYSLOT_39_NFC, + /// Invalid keyslot. KeyslotInvalid = ctru_sys::PS_KEYSLOT_INVALID, } diff --git a/ctru-rs/src/services/sslc.rs b/ctru-rs/src/services/sslc.rs index d248f0e..9b311e3 100644 --- a/ctru-rs/src/services/sslc.rs +++ b/ctru-rs/src/services/sslc.rs @@ -4,6 +4,7 @@ use crate::error::ResultCode; +/// Handle to the SSLC service. pub struct SslC(()); impl SslC { From 4124df8612b8abcdb7ac481b0ace37ef541e644e Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sun, 9 Jul 2023 19:53:15 +0200 Subject: [PATCH 023/101] Fixed all compiler warnings for docs --- ctru-rs/src/applets/mii_selector.rs | 5 +++-- ctru-rs/src/applets/mod.rs | 5 +++++ ctru-rs/src/applets/swkbd.rs | 4 ++++ ctru-rs/src/console.rs | 16 ++++++++++++++++ ctru-rs/src/prelude.rs | 4 ++++ ctru-rs/src/services/gfx.rs | 2 ++ ctru-rs/src/services/hid.rs | 14 +++++++------- ctru-rs/src/services/ndsp/mod.rs | 19 ++++++++++++++++--- ctru-rs/src/services/ndsp/wave.rs | 2 ++ ctru-rs/src/services/ps.rs | 5 +++++ ctru-rs/src/services/romfs.rs | 7 +++++++ 11 files changed, 71 insertions(+), 12 deletions(-) diff --git a/ctru-rs/src/applets/mii_selector.rs b/ctru-rs/src/applets/mii_selector.rs index 577d0df..7cd0f81 100644 --- a/ctru-rs/src/applets/mii_selector.rs +++ b/ctru-rs/src/applets/mii_selector.rs @@ -1,6 +1,7 @@ -//! Mii Selector applet +//! Mii Selector applet. //! -//! This module contains the methods to launch the Mii Selector. +//! This applet opens a window on the console's bottom screen which lets the player/user choose a Mii from the ones present on their console. +//! The application can access the selected Mii's data via the use of the [`mii`](crate::mii) module. use crate::mii::MiiData; use bitflags::bitflags; diff --git a/ctru-rs/src/applets/mod.rs b/ctru-rs/src/applets/mod.rs index f5813ad..57c9471 100644 --- a/ctru-rs/src/applets/mod.rs +++ b/ctru-rs/src/applets/mod.rs @@ -1,2 +1,7 @@ +//! System Applets. +//! +//! Applets are small integrated programs that the OS makes available to the developer to streamline commonly needed functionality. +//! Thanks to these integrations the developer can avoid wasting time re-implementing common features and instead use a more reliable base for their application. + pub mod mii_selector; pub mod swkbd; diff --git a/ctru-rs/src/applets/swkbd.rs b/ctru-rs/src/applets/swkbd.rs index e5e9c28..d0f0fdf 100644 --- a/ctru-rs/src/applets/swkbd.rs +++ b/ctru-rs/src/applets/swkbd.rs @@ -1,3 +1,7 @@ +//! Software Keyboard applet. +//! +//! This applet opens a virtual keyboard on the console's bottom screen which lets the player/user write UTF-16 valid text. + use bitflags::bitflags; use ctru_sys::{ self, swkbdInit, swkbdInputText, swkbdSetButton, swkbdSetFeatures, swkbdSetHintText, SwkbdState, diff --git a/ctru-rs/src/console.rs b/ctru-rs/src/console.rs index cd6b51f..74b861e 100644 --- a/ctru-rs/src/console.rs +++ b/ctru-rs/src/console.rs @@ -1,3 +1,5 @@ +//! Virtual text console. + use std::cell::RefMut; use std::default::Default; @@ -7,6 +9,20 @@ use crate::services::gfx::Screen; static mut EMPTY_CONSOLE: PrintConsole = unsafe { const_zero::const_zero!(PrintConsole) }; +/// Virtual printable console. +/// +/// [`Console`] lets the application redirect `stdout` to a simple text displayer on the 3DS screen. +/// This means that any text written to `stdout` (e.g. using [`println!`] or [`dbg!`]) will become visible in the area taken by the console. +/// +/// # Notes +/// +/// The console will take full possession of the screen handed to it as long as it stays alive. It also supports ANSI codes. +/// +/// # Alternatives +/// +/// If you'd like to see live `stdout` output while running the application but can't/don't want to show the text on the 3DS itself, +/// you can try using [`Soc::redirect_to_3dslink`](crate::services::soc::Soc::redirect_to_3dslink) while activating the `--server` flag for `3dslink` (also supported by `cargo-3ds`). +/// More info in the `cargo-3ds` docs. #[doc(alias = "PrintConsole")] pub struct Console<'screen> { context: Box, diff --git a/ctru-rs/src/prelude.rs b/ctru-rs/src/prelude.rs index 49095fa..b765b65 100644 --- a/ctru-rs/src/prelude.rs +++ b/ctru-rs/src/prelude.rs @@ -1,3 +1,7 @@ +//! `use ctru::prelude::*;` to import common services, members and functions. +//! +//! Particularly useful when writing very small applications. + pub use crate::console::Console; pub use crate::services::{ apt::Apt, diff --git a/ctru-rs/src/services/gfx.rs b/ctru-rs/src/services/gfx.rs index 5629cf6..54ec061 100644 --- a/ctru-rs/src/services/gfx.rs +++ b/ctru-rs/src/services/gfx.rs @@ -209,7 +209,9 @@ pub enum Side { /// /// The service exits when this struct is dropped. pub struct Gfx { + /// Top screen representation. pub top_screen: RefCell, + /// Bottom screen representation. pub bottom_screen: RefCell, _service_handler: ServiceReference, } diff --git a/ctru-rs/src/services/hid.rs b/ctru-rs/src/services/hid.rs index 51bf63a..cb2550f 100644 --- a/ctru-rs/src/services/hid.rs +++ b/ctru-rs/src/services/hid.rs @@ -75,14 +75,14 @@ bitflags::bitflags! { /// This service requires no special permissions to use. pub struct Hid(()); -/// Initializes the HID service. -/// -/// # Errors -/// -/// This function will return an error if the service was unable to be initialized. -/// Since this service requires no special or elevated permissions, errors are -/// rare in practice. impl Hid { + /// Initializes the HID service. + /// + /// # Errors + /// + /// This function will return an error if the service was unable to be initialized. + /// Since this service requires no special or elevated permissions, errors are + /// rare in practice. #[doc(alias = "hidInit")] pub fn new() -> crate::Result { unsafe { diff --git a/ctru-rs/src/services/ndsp/mod.rs b/ctru-rs/src/services/ndsp/mod.rs index 2ff9d7b..e832551 100644 --- a/ctru-rs/src/services/ndsp/mod.rs +++ b/ctru-rs/src/services/ndsp/mod.rs @@ -1,4 +1,4 @@ -//! NDSP (Audio) service +//! NDSP (Audio) service. pub mod wave; use wave::{Wave, WaveStatus}; @@ -73,6 +73,19 @@ pub enum NdspError { SampleCountOutOfBounds(usize, usize), } +/// NDSP Channel representation. +/// +/// There are 24 individual channels in total and each can play a different audio [`Wave`] simultaneuosly. +/// +/// # Default +/// +/// NDSP initialises all channels with default values on creation, but the developer is supposed to change these values to correctly work with the service. +/// +/// In particular: +/// - Default audio format is set to [`AudioFormat::PCM16Mono`]. +/// - Default sample rate is set to 1 Hz. +/// - Default interpolation type is set to [`InterpolationType::Polyphase`]. +/// - Default mix is set to [`AudioMix::default()`] pub struct Channel<'ndsp> { id: u8, _rf: RefMut<'ndsp, ()>, // we don't need to hold any data @@ -169,7 +182,7 @@ impl Channel<'_> { unsafe { ctru_sys::ndspChnIsPaused(self.id.into()) } } - // Returns the channel's id + /// Returns the channel's index. pub fn id(&self) -> u8 { self.id } @@ -458,8 +471,8 @@ impl AudioMix { } } -/// Returns an [`AudioMix`] object with "front left" and "front right" volumes set to 100%, and all other volumes set to 0%. impl Default for AudioMix { + /// Returns an [`AudioMix`] object with "front left" and "front right" volumes set to 100%, and all other volumes set to 0%. fn default() -> Self { let mut mix = AudioMix::zeroed(); mix.set_front(1.0, 1.0); diff --git a/ctru-rs/src/services/ndsp/wave.rs b/ctru-rs/src/services/ndsp/wave.rs index 9194685..2819dbd 100644 --- a/ctru-rs/src/services/ndsp/wave.rs +++ b/ctru-rs/src/services/ndsp/wave.rs @@ -1,3 +1,5 @@ +//! Audio wave representation. + use super::{AudioFormat, NdspError}; use crate::linear::LinearAllocator; diff --git a/ctru-rs/src/services/ps.rs b/ctru-rs/src/services/ps.rs index 0673ce8..6f8c67c 100644 --- a/ctru-rs/src/services/ps.rs +++ b/ctru-rs/src/services/ps.rs @@ -52,9 +52,11 @@ pub enum AESKeyType { KeyslotInvalid = ctru_sys::PS_KEYSLOT_INVALID, } +/// Handle to the PS service. pub struct Ps(()); impl Ps { + /// Initialize a new service handle. #[doc(alias = "psInit")] pub fn new() -> Result { unsafe { @@ -63,6 +65,7 @@ impl Ps { } } + /// Returns the console's local friend code seed. #[doc(alias = "PS_GetLocalFriendCodeSeed")] pub fn local_friend_code_seed(&self) -> crate::Result { let mut seed: u64 = 0; @@ -71,6 +74,7 @@ impl Ps { Ok(seed) } + /// Returns the console's devide ID. #[doc(alias = "PS_GetDeviceId")] pub fn device_id(&self) -> crate::Result { let mut id: u32 = 0; @@ -79,6 +83,7 @@ impl Ps { Ok(id) } + /// Generates cryptografically secure random bytes and writes them into the `out` buffer. #[doc(alias = "PS_GenerateRandomBytes")] pub fn generate_random_bytes(&self, out: &mut [u8]) -> crate::Result<()> { ResultCode(unsafe { diff --git a/ctru-rs/src/services/romfs.rs b/ctru-rs/src/services/romfs.rs index 3c5afa8..dae4ed3 100644 --- a/ctru-rs/src/services/romfs.rs +++ b/ctru-rs/src/services/romfs.rs @@ -18,6 +18,12 @@ use std::sync::Mutex; use crate::services::ServiceReference; +/// Handle to the RomFS service. +/// +/// This service lets the application access a virtual mounted device created using a folder included within the application bundle. +/// `ctru` will include as RomFS the folder specified in the `Cargo.toml` manifest (or use `./romfs` by default). Look at the [`romfs`](self) module for more information. +/// +/// After mounting the RomFS file system, the included files and folders will be accessible exactly like any other file, just by using the drive prefix `romfs:/`. pub struct RomFS { _service_handler: ServiceReference, } @@ -25,6 +31,7 @@ pub struct RomFS { static ROMFS_ACTIVE: Mutex = Mutex::new(0); impl RomFS { + /// Mounts the specified RomFS folder as a virtual drive. #[doc(alias = "romfsMountSelf")] pub fn new() -> crate::Result { let _service_handler = ServiceReference::new( From 73d3f4064a7a36ebee322af323f05f9fb6050cec Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sun, 16 Jul 2023 17:19:21 +0200 Subject: [PATCH 024/101] Publish-ready Cargo manifests --- ctru-rs/Cargo.toml | 7 ++++--- ctru-sys/Cargo.toml | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ctru-rs/Cargo.toml b/ctru-rs/Cargo.toml index 69f88f4..16f4a3d 100644 --- a/ctru-rs/Cargo.toml +++ b/ctru-rs/Cargo.toml @@ -1,13 +1,14 @@ [package] +name = "ctru-rs" +version = "0.7.1" authors = ["Rust3DS Org", "Ronald Kinard "] description = "A safe wrapper around libctru" +repository = "https://github.com/rust3ds/ctru-rs" keywords = ["3ds", "libctru"] categories = ["os", "api-bindings"] +exclude = ["examples"] license = "Zlib" -name = "ctru-rs" -version = "0.7.1" edition = "2021" -repository = "https://github.com/rust3ds/ctru-rs" rust-version = "1.70" [lib] diff --git a/ctru-sys/Cargo.toml b/ctru-sys/Cargo.toml index 03435b6..1420ebe 100644 --- a/ctru-sys/Cargo.toml +++ b/ctru-sys/Cargo.toml @@ -3,12 +3,13 @@ name = "ctru-sys" version = "22.2.0+2.2.2-1" authors = [ "Rust3DS Org", "Ronald Kinard " ] description = "Raw bindings to libctru" +repository = "https://github.com/rust3ds/ctru-rs" keywords = ["3ds", "libctru"] categories = ["os", "external-ffi-bindings", "no-std"] +exclude = ["bindgen.sh", "src/.gitattributes"] license = "Zlib" links = "ctru" edition = "2021" -repository = "https://github.com/rust3ds/ctru-rs" [dependencies] libc = { version = "0.2.121", default-features = false } From 4a1c695dbe8f428a99db08978a4e7339b49133e0 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sun, 16 Jul 2023 17:42:48 +0200 Subject: [PATCH 025/101] Fixed only doc lint --- ctru-rs/src/services/fs.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ctru-rs/src/services/fs.rs b/ctru-rs/src/services/fs.rs index 9b56ddd..f008954 100644 --- a/ctru-rs/src/services/fs.rs +++ b/ctru-rs/src/services/fs.rs @@ -285,8 +285,8 @@ pub struct OpenOptions { /// Iterator over the entries in a directory. /// -/// This iterator is returned from the [`File::read_dir`] function of this module and -/// will yield instances of `Result`. Through a [`DirEntry`] +/// This iterator is returned from the [`read_dir`] function and +/// will yield instances of [`Result`]. Through a [`DirEntry`] /// information like the entry's path and possibly other metadata can be /// learned. /// From 10f70aa02687d6039cab95c5fb93e066614c5c7c Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Wed, 19 Jul 2023 10:27:11 +0200 Subject: [PATCH 026/101] New READMEs and fixed package labeling --- README.md | 32 +++++++++++++------------------- ctru-rs/README.md | 23 +++++++++++++++++++++++ ctru-rs/src/lib.rs | 9 +++++---- ctru-rs/src/services/am.rs | 2 +- ctru-rs/src/services/mod.rs | 4 ++-- ctru-rs/src/services/romfs.rs | 2 +- ctru-sys/README.md | 33 +++++++++++++++++++++++++++++++++ 7 files changed, 78 insertions(+), 27 deletions(-) create mode 100644 ctru-rs/README.md create mode 100644 ctru-sys/README.md diff --git a/README.md b/README.md index ae3e6c7..8a061b4 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,27 @@ # ctru-rs -A Rust wrapper around [libctru](https://github.com/devkitPro/libctru). +This repository is home of the `ctru-rs` project, which aims to bring full control of the Nintendo 3DS console to homebrew developers using Rust. ## Structure This repository is organized as follows: -* `ctru-rs`: Safe, idiomatic wrapper around `ctru-sys` + * [`ctru-rs`](./ctru-rs/) - Safe, idiomatic wrapper around [`ctru-sys`](./ctru-sys/). + * [`ctru-sys`](./ctru-sys/) - Low-level, unsafe bindings to [`libctru`](https://github.com/devkitPro/libctru). -* `ctru-sys`: Low-level, unsafe bindings to `libctru`. +## Getting Started - This crate's version changes according to the version of `libctru` - used to generate the bindings, with the following convention: - - * `libctru` version `X.Y.Z-W` - * `ctru-sys` version `XY.Z.P+X.Y.Z-W` - - where `P` is usually 0 but may be incremented for fixes in e.g. - binding generation, `libc` dependency bump, etc. - - It may be possible to build this crate against a different version of `libctru`, - but you may encounter linker errors or ABI issues. A build-time Cargo warning - (displayed when built with `-vv`) will be issued if the build script detects - a mismatch or is unable to check the installed `libctru` version. +Specific information about how to use the crates is present in the individual README for each package. +Have a look at `ctru-rs`' [README.md](./ctru-rs/README.md) for a broad overview. ## Original version -This project is based on the efforts the original authors: - * [Eidolon](https://github.com/HybridEidolon) - * [FenrirWolf](https://github.com/FenrirWolf) +This project is based on the efforts of the original authors: + * [Eidolon](https://github.com/HybridEidolon) + * [FenrirWolf](https://github.com/FenrirWolf) The old version is archived [here](https://github.com/rust3ds/ctru-rs-old). + +## License + +This project is distributed under the Zlib license. diff --git a/ctru-rs/README.md b/ctru-rs/README.md new file mode 100644 index 0000000..297c8cc --- /dev/null +++ b/ctru-rs/README.md @@ -0,0 +1,23 @@ +# ctru-rs + +Safe and idiomatic Rust wrapper around [`libctru`](https://github.com/devkitPro/libctru). +This crate uses the bindings provided by [`ctru-sys`](../ctru-sys/). + +## Getting Started + +Thoroughly read the [`ctru-rs` wiki](https://github.com/rust3ds/ctru-rs/wiki/Getting-Started) to meet the requirements +and to understand what it takes to develop homebrew software on the Nintendo 3DS family of consoles. +After that, you can simply add the crate as a dependency to your project and build your final binary by using [`cargo-3ds`](https://github.com/rust3ds/cargo-3ds) +or by manually compiling for the `armv6k-nintendo-3ds` target. + +## Examples + +Many examples to demonstrate the `ctru-rs` functionality are available in the [`examples`](./examples/) folder. Simply run them via + +```bash +cargo 3ds run --example +``` + +## License + +This project is distributed under the Zlib license. diff --git a/ctru-rs/src/lib.rs b/ctru-rs/src/lib.rs index 37428f8..7e29748 100644 --- a/ctru-rs/src/lib.rs +++ b/ctru-rs/src/lib.rs @@ -1,4 +1,4 @@ -//! Safe wrapper around `libctru`. +//! Safe and idiomatic Rust wrapper around [`libctru`](https://github.com/devkitPro/libctru). //! //! # About //! @@ -6,11 +6,12 @@ //! Thanks to it, developers can access the underlying system services and the console's hardware to develop userland applications //! (such as HID devices, network capabilities, graphics, built-in cameras, etc.). //! -//! Among these features, `ctru` also automatically includes functionality to properly integrate the Rust `std` with the console, which the developer would otherwise need to implement manually. +//! Among these features, `ctru-rs` also automatically includes functionality to properly integrate the Rust `std` with the console's operating system, +//! which the developer would otherwise need to implement manually. //! //! # Usage //! -//! Read thoroughly the official [`ctru` wiki](https://github.com/rust3ds/ctru-rs/wiki) which guides you through the setup needed to install the required toolchain and helpful tools. +//! Read thoroughly the official [`ctru-rs` wiki](https://github.com/rust3ds/ctru-rs/wiki) which guides you through the setup needed to install the required toolchain and helpful tools. //! After following the guide and understanding the many quirks of the Nintendo 3DS homebrew development environment, you can create a new project by including this crate as a dependency //! of your project in your `Cargo.toml` manifest and build your binaries either manually (for the `armv6k-nintendo-3ds` target) or via [`cargo-3ds`](https://github.com/rust3ds/cargo-3ds). //! @@ -57,7 +58,7 @@ macro_rules! from_impl { }; } -/// Activate the custom `ctru` panic handler. +/// Activate the custom `ctru-rs` panic handler. /// /// With this implementation, the main thread will stop and try to print debug info to an available [`Console`](console::Console). /// In case it fails to find an active [`Console`](console::Console) the program will just exit. diff --git a/ctru-rs/src/services/am.rs b/ctru-rs/src/services/am.rs index 9892bd7..31d46b5 100644 --- a/ctru-rs/src/services/am.rs +++ b/ctru-rs/src/services/am.rs @@ -4,7 +4,7 @@ //! - Read the installed applications on the console and their information (depending on the install location). //! - Install compatible applications to the console. //! -//! `ctru` doesn't support installing titles (yet). +//! `ctru-rs` doesn't support installing titles (yet). use crate::error::ResultCode; use crate::services::fs::FsMediaType; diff --git a/ctru-rs/src/services/mod.rs b/ctru-rs/src/services/mod.rs index a387933..ab948b3 100644 --- a/ctru-rs/src/services/mod.rs +++ b/ctru-rs/src/services/mod.rs @@ -3,13 +3,13 @@ //! Most of the 3DS console's functionalities (when writing user-land homebrew) are accessible via services, //! which need to be initialized before accessing any particular feature. //! -//! To ensure safety measures when using the underlying services, `ctru` leverages Rust's lifetime model. +//! To ensure safety measures when using the underlying services, `ctru-rs` leverages Rust's lifetime model. //! After initializing the handle for a specific service (e.g. [`Apt`](apt::Apt)) the service will be accessible as long as there is at least one handle "alive". //! As such, handles should be dropped *after* the use of a specific service. This is particularly important for services which are necessary for functionality //! "outside" their associated methods, such as [`RomFS`](romfs::RomFS), which creates an accessible virtual filesystem, or [`Soc`](soc::Soc), //! which enables all network communications via sockets. //! -//! In `ctru` some services only allow a single handle to be created at a time, to ensure a safe and controlled environment. +//! In `ctru-rs` some services only allow a single handle to be created at a time, to ensure a safe and controlled environment. pub mod am; pub mod apt; diff --git a/ctru-rs/src/services/romfs.rs b/ctru-rs/src/services/romfs.rs index dae4ed3..5d4a64b 100644 --- a/ctru-rs/src/services/romfs.rs +++ b/ctru-rs/src/services/romfs.rs @@ -21,7 +21,7 @@ use crate::services::ServiceReference; /// Handle to the RomFS service. /// /// This service lets the application access a virtual mounted device created using a folder included within the application bundle. -/// `ctru` will include as RomFS the folder specified in the `Cargo.toml` manifest (or use `./romfs` by default). Look at the [`romfs`](self) module for more information. +/// `ctru-rs` will include as RomFS the folder specified in the `Cargo.toml` manifest (or use `./romfs` by default). Look at the [`romfs`](self) module for more information. /// /// After mounting the RomFS file system, the included files and folders will be accessible exactly like any other file, just by using the drive prefix `romfs:/`. pub struct RomFS { diff --git a/ctru-sys/README.md b/ctru-sys/README.md new file mode 100644 index 0000000..280fd83 --- /dev/null +++ b/ctru-sys/README.md @@ -0,0 +1,33 @@ +# ctru-sys + +Raw Rust bindings over the [`libctru`](https://github.com/devkitPro/libctru) C library. + +## Requirements + +To use the bindings provided by this crate you will need to link against the [`libctru`](https://github.com/devkitPro/libctru) library. +Consult the [`ctru-rs` wiki](https://github.com/rust3ds/ctru-rs/wiki/Getting-Started) to learn how to obtain the required packages +to use this library. + +## Version + +This crate's version changes according to the version of `libctru` +used to generate the bindings, with the following convention: + + * [`libctru`](https://github.com/devkitPro/libctru) version `X.Y.Z-W` + * `ctru-sys` version `XY.Z.P+X.Y.Z-W` + + where `P` is usually 0 but may be incremented for fixes in e.g. + binding generation, `libc` dependency bump, etc. + +It may be possible to build this crate against a different version of [`libctru`](https://github.com/devkitPro/libctru), +but you may encounter linker errors or ABI issues. A build-time Cargo warning +(displayed when built with `-vv`) will be issued if the build script detects +a mismatch or is unable to check the installed [`libctru`](https://github.com/devkitPro/libctru) version. + +## Generating bindings + +Bindings of new versions of [`libctru`](https://github.com/devkitPro/libctru) can be built using the integrated [`bindgen.sh`](./bindgen.sh) script. + +## License + +This project is distributed under the Zlib license. From 9662b876bb7b974b25399c5fde8b2c97de306435 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Wed, 19 Jul 2023 10:33:55 +0200 Subject: [PATCH 027/101] Fmt --- ctru-rs/src/applets/mod.rs | 2 +- ctru-rs/src/applets/swkbd.rs | 2 +- ctru-rs/src/console.rs | 10 +++++----- ctru-rs/src/prelude.rs | 2 +- ctru-rs/src/services/ndsp/mod.rs | 8 ++++---- ctru-rs/src/services/romfs.rs | 4 ++-- ctru-sys/build.rs | 5 +++-- 7 files changed, 17 insertions(+), 16 deletions(-) diff --git a/ctru-rs/src/applets/mod.rs b/ctru-rs/src/applets/mod.rs index 57c9471..e8af7ca 100644 --- a/ctru-rs/src/applets/mod.rs +++ b/ctru-rs/src/applets/mod.rs @@ -1,5 +1,5 @@ //! System Applets. -//! +//! //! Applets are small integrated programs that the OS makes available to the developer to streamline commonly needed functionality. //! Thanks to these integrations the developer can avoid wasting time re-implementing common features and instead use a more reliable base for their application. diff --git a/ctru-rs/src/applets/swkbd.rs b/ctru-rs/src/applets/swkbd.rs index d0f0fdf..59c658d 100644 --- a/ctru-rs/src/applets/swkbd.rs +++ b/ctru-rs/src/applets/swkbd.rs @@ -1,5 +1,5 @@ //! Software Keyboard applet. -//! +//! //! This applet opens a virtual keyboard on the console's bottom screen which lets the player/user write UTF-16 valid text. use bitflags::bitflags; diff --git a/ctru-rs/src/console.rs b/ctru-rs/src/console.rs index 74b861e..a468c02 100644 --- a/ctru-rs/src/console.rs +++ b/ctru-rs/src/console.rs @@ -10,16 +10,16 @@ use crate::services::gfx::Screen; static mut EMPTY_CONSOLE: PrintConsole = unsafe { const_zero::const_zero!(PrintConsole) }; /// Virtual printable console. -/// +/// /// [`Console`] lets the application redirect `stdout` to a simple text displayer on the 3DS screen. /// This means that any text written to `stdout` (e.g. using [`println!`] or [`dbg!`]) will become visible in the area taken by the console. -/// +/// /// # Notes -/// +/// /// The console will take full possession of the screen handed to it as long as it stays alive. It also supports ANSI codes. -/// +/// /// # Alternatives -/// +/// /// If you'd like to see live `stdout` output while running the application but can't/don't want to show the text on the 3DS itself, /// you can try using [`Soc::redirect_to_3dslink`](crate::services::soc::Soc::redirect_to_3dslink) while activating the `--server` flag for `3dslink` (also supported by `cargo-3ds`). /// More info in the `cargo-3ds` docs. diff --git a/ctru-rs/src/prelude.rs b/ctru-rs/src/prelude.rs index b765b65..ee18eab 100644 --- a/ctru-rs/src/prelude.rs +++ b/ctru-rs/src/prelude.rs @@ -1,5 +1,5 @@ //! `use ctru::prelude::*;` to import common services, members and functions. -//! +//! //! Particularly useful when writing very small applications. pub use crate::console::Console; diff --git a/ctru-rs/src/services/ndsp/mod.rs b/ctru-rs/src/services/ndsp/mod.rs index e832551..f815fdb 100644 --- a/ctru-rs/src/services/ndsp/mod.rs +++ b/ctru-rs/src/services/ndsp/mod.rs @@ -74,13 +74,13 @@ pub enum NdspError { } /// NDSP Channel representation. -/// +/// /// There are 24 individual channels in total and each can play a different audio [`Wave`] simultaneuosly. -/// +/// /// # Default -/// +/// /// NDSP initialises all channels with default values on creation, but the developer is supposed to change these values to correctly work with the service. -/// +/// /// In particular: /// - Default audio format is set to [`AudioFormat::PCM16Mono`]. /// - Default sample rate is set to 1 Hz. diff --git a/ctru-rs/src/services/romfs.rs b/ctru-rs/src/services/romfs.rs index 5d4a64b..c8719a2 100644 --- a/ctru-rs/src/services/romfs.rs +++ b/ctru-rs/src/services/romfs.rs @@ -19,10 +19,10 @@ use std::sync::Mutex; use crate::services::ServiceReference; /// Handle to the RomFS service. -/// +/// /// This service lets the application access a virtual mounted device created using a folder included within the application bundle. /// `ctru-rs` will include as RomFS the folder specified in the `Cargo.toml` manifest (or use `./romfs` by default). Look at the [`romfs`](self) module for more information. -/// +/// /// After mounting the RomFS file system, the included files and folders will be accessible exactly like any other file, just by using the drive prefix `romfs:/`. pub struct RomFS { _service_handler: ServiceReference, diff --git a/ctru-sys/build.rs b/ctru-sys/build.rs index a695d47..7c55caa 100644 --- a/ctru-sys/build.rs +++ b/ctru-sys/build.rs @@ -77,8 +77,9 @@ fn check_libctru_version() -> Result<(String, String, String), Box> { .output()?; for line in String::from_utf8_lossy(&stdout).split('\n') { - let Some((_pkg, file)) = line.split_once(char::is_whitespace) - else { continue }; + let Some((_pkg, file)) = line.split_once(char::is_whitespace) else { + continue; + }; println!("cargo:rerun-if-changed={file}"); } From afc74fdf47fc66aeb91d03a08f2bf79c25a1abde Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Wed, 19 Jul 2023 12:53:02 +0200 Subject: [PATCH 028/101] New doc changes and bump bitflags dependency --- ctru-rs/Cargo.toml | 2 +- ctru-rs/src/applets/mii_selector.rs | 116 +++++++++++++++++++--------- ctru-rs/src/applets/mod.rs | 3 + ctru-rs/src/applets/swkbd.rs | 6 +- ctru-rs/src/error.rs | 4 +- ctru-rs/src/lib.rs | 4 - ctru-rs/src/services/fs.rs | 6 +- ctru-rs/src/services/gfx.rs | 13 +++- ctru-rs/src/services/hid.rs | 5 +- 9 files changed, 108 insertions(+), 51 deletions(-) diff --git a/ctru-rs/Cargo.toml b/ctru-rs/Cargo.toml index 16f4a3d..027a3cb 100644 --- a/ctru-rs/Cargo.toml +++ b/ctru-rs/Cargo.toml @@ -22,7 +22,7 @@ const-zero = "0.1.0" shim-3ds = { git = "https://github.com/rust3ds/shim-3ds.git" } pthread-3ds = { git = "https://github.com/rust3ds/pthread-3ds.git" } libc = "0.2.121" -bitflags = "1.0.0" +bitflags = "2.3.3" widestring = "0.2.2" [build-dependencies] diff --git a/ctru-rs/src/applets/mii_selector.rs b/ctru-rs/src/applets/mii_selector.rs index 7cd0f81..fa69034 100644 --- a/ctru-rs/src/applets/mii_selector.rs +++ b/ctru-rs/src/applets/mii_selector.rs @@ -1,11 +1,11 @@ //! Mii Selector applet. //! //! This applet opens a window on the console's bottom screen which lets the player/user choose a Mii from the ones present on their console. -//! The application can access the selected Mii's data via the use of the [`mii`](crate::mii) module. +//! The selected Mii is readable as a [`MiiData`](crate::mii::MiiData). use crate::mii::MiiData; use bitflags::bitflags; -use std::ffi::CString; +use std::{ffi::CString, error::Error, fmt}; /// Index of a Mii used to configure some parameters of the Mii Selector. #[derive(Debug, Clone, Copy, Eq, PartialEq)] @@ -16,7 +16,7 @@ pub enum Index { All, } -/// The type of a Mii with their respective data +/// The type of a Mii. #[derive(Debug, Clone, Eq, PartialEq)] pub enum MiiType { /// Guest Mii. @@ -31,29 +31,56 @@ pub enum MiiType { } bitflags! { - /// Options for the Mii Selector + /// Options to configure the [MiiSelector]. + /// + ///

Example

+ /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::applets::mii_selector::{MiiSelector, Options}; + /// + /// // Setup a `MiiSelector` that can be cancelled and that makes Guest Miis available to select. + /// let opts = Options::ENABLE_CANCEL & Options::ENABLE_GUESTS; + /// + /// let mut mii_selector = MiiSelector::new(); + /// mii_selector.set_options(opts); + /// + /// let result = mii_selector.launch()?; + /// # + /// # Ok(()) + /// # } + /// ``` + #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)] pub struct Options: u32 { - /// Show the cancel button - const MII_SELECTOR_CANCEL = ctru_sys::MIISELECTOR_CANCEL; - /// Make guest Miis selectable - const MII_SELECTOR_GUESTS = ctru_sys::MIISELECTOR_GUESTS; - /// Show on the top screen - const MII_SELECTOR_TOP = ctru_sys::MIISELECTOR_TOP; - /// Start on the guest's page - const MII_SELECTOR_GUEST_START = ctru_sys::MIISELECTOR_GUESTSTART; + /// Show the cancel button. + const ENABLE_CANCEL = ctru_sys::MIISELECTOR_CANCEL; + /// Make guest Miis available to select. + const ENABLE_GUESTS = ctru_sys::MIISELECTOR_GUESTS; + /// Show on the top screen. + const USE_TOP_SCREEN = ctru_sys::MIISELECTOR_TOP; + /// Start on the guests' page. Requires [Options::ENABLE_GUESTS]. + const START_WITH_GUESTS = ctru_sys::MIISELECTOR_GUESTSTART; } } -/// An instance of the Mii Selector +/// Configuration object to setup the Mii Selector applet. /// /// # Example -/// ``` +/// ```no_run +/// # use std::error::Error; +/// # fn main() -> Result<(), Box> { +/// # /// use ctru::applets::mii_selector::MiiSelector; /// /// let mut mii_selector = MiiSelector::new(); -/// mii_selector.set_title("Example Mii selector"); +/// mii_selector.set_title("Example Mii Selector"); /// -/// let result = mii_selector.launch().unwrap(); +/// let result = mii_selector.launch()?; +/// # +/// # Ok(()) +/// # } /// ``` #[doc(alias = "MiiSelectorConf")] #[derive(Clone, Debug)] @@ -61,27 +88,27 @@ pub struct MiiSelector { config: Box, } -/// Return value from a MiiSelector's launch +/// Return value of a successful [MiiSelector::launch()]. #[non_exhaustive] #[derive(Clone, Debug)] -pub struct SelectionResult { - /// Data regarding the selected Mii. +pub struct Selection { + /// Data of the selected Mii. pub mii_data: MiiData, /// Type of the selected Mii. pub mii_type: MiiType, } -/// Error type for the Mii selector +/// Error returned by an unsuccessful [MiiSelector::launch()]. #[derive(Copy, Clone, Debug, Eq, PartialEq)] pub enum LaunchError { - /// The selected Mii's data is corrupt in some way + /// The selected Mii's data is corrupt in some way. InvalidChecksum, - /// Either the user cancelled the selection (see [Options::MII_SELECTOR_CANCEL]), or no valid Miis were available to select + /// Either the user cancelled the selection (see [Options::ENABLE_CANCEL]), or no valid Miis were available to select. NoMiiSelected, } impl MiiSelector { - /// Initializes a Mii Selector + /// Initialize a new configuration for the Mii Selector applet. #[doc(alias = "miiSelectorInit")] pub fn new() -> Self { let mut config = Box::::default(); @@ -91,9 +118,9 @@ impl MiiSelector { Self { config } } - /// Set the title of the Mii Selector. + /// Set the title of the Mii Selector window. /// - /// This function would panic if the given ``&str`` contains NUL bytes. + /// This function will panic if the given `&str` contains NUL bytes. #[doc(alias = "miiSelectorSetTitle")] pub fn set_title(&mut self, text: &str) { // This can only fail if the text contains NUL bytes in the string... which seems @@ -104,13 +131,15 @@ impl MiiSelector { } } - /// Set the options of the Mii Selector + /// Set the options of the Mii Selector. + /// + /// This will overwrite any previously saved options. #[doc(alias = "miiSelectorSetOptions")] pub fn set_options(&mut self, options: Options) { - unsafe { ctru_sys::miiSelectorSetOptions(self.config.as_mut(), options.bits) } + unsafe { ctru_sys::miiSelectorSetOptions(self.config.as_mut(), options.bits()) } } - /// Whitelist a guest Mii + /// Whitelist a guest Mii based on its index. #[doc(alias = "miiSelectorWhitelistGuestMii")] pub fn whitelist_guest_mii(&mut self, mii_index: Index) { let index = match mii_index { @@ -121,7 +150,7 @@ impl MiiSelector { unsafe { ctru_sys::miiSelectorWhitelistGuestMii(self.config.as_mut(), index) } } - /// Blacklist a guest Mii + /// Blacklist a guest Mii based on its index. #[doc(alias = "miiSelectorBlacklistGuestMii")] pub fn blacklist_guest_mii(&mut self, mii_index: Index) { let index = match mii_index { @@ -132,7 +161,7 @@ impl MiiSelector { unsafe { ctru_sys::miiSelectorBlacklistGuestMii(self.config.as_mut(), index) } } - /// Whitelist a user Mii + /// Whitelist a user Mii based on its index. #[doc(alias = "miiSelectorWhitelistUserMii")] pub fn whitelist_user_mii(&mut self, mii_index: Index) { let index = match mii_index { @@ -143,7 +172,7 @@ impl MiiSelector { unsafe { ctru_sys::miiSelectorWhitelistUserMii(self.config.as_mut(), index) } } - /// Blacklist a user Mii + /// Blacklist a user Mii based on its index. #[doc(alias = "miiSelectorBlacklistUserMii")] pub fn blacklist_user_mii(&mut self, mii_index: Index) { let index = match mii_index { @@ -154,8 +183,9 @@ impl MiiSelector { unsafe { ctru_sys::miiSelectorBlacklistUserMii(self.config.as_mut(), index) } } - /// Set where the cursor will be. - /// If there's no Mii at that index, the cursor will start at the Mii with the index 0 + /// Set where the cursor will start at. + /// + /// If there's no Mii at that index, the cursor will start at the Mii with the index 0. pub fn set_initial_index(&mut self, index: usize) { // This function is static inline in libctru // https://github.com/devkitPro/libctru/blob/af5321c78ee5c72a55b526fd2ed0d95ca1c05af9/libctru/include/3ds/applets/miiselector.h#L155 @@ -163,9 +193,10 @@ impl MiiSelector { } /// Launch the Mii Selector. - /// Returns an error when the checksum of the Mii is invalid. + /// + /// Depending on the configuration, the Mii Selector window will appear either on the bottom screen (default behaviour) or the top screen (see [Options::USE_TOP_SCREEN]). #[doc(alias = "miiSelectorLaunch")] - pub fn launch(&mut self) -> Result { + pub fn launch(&mut self) -> Result { let mut return_val = Box::::default(); unsafe { ctru_sys::miiSelectorLaunch(self.config.as_mut(), return_val.as_mut()) } @@ -187,12 +218,23 @@ impl Default for MiiSelector { } } -impl From for SelectionResult { +impl fmt::Display for LaunchError { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::InvalidChecksum => write!(f, "selected mii has invalid checksum"), + Self::NoMiiSelected => write!(f, "no mii was selected"), + } + } +} + +impl Error for LaunchError {} + +impl From for Selection { fn from(ret: ctru_sys::MiiSelectorReturn) -> Self { let raw_mii_data = ret.mii; let mut guest_mii_name = ret.guest_mii_name; - SelectionResult { + Selection { mii_data: raw_mii_data.into(), mii_type: if ret.guest_mii_index != 0xFFFFFFFF { MiiType::Guest { diff --git a/ctru-rs/src/applets/mod.rs b/ctru-rs/src/applets/mod.rs index e8af7ca..15216fa 100644 --- a/ctru-rs/src/applets/mod.rs +++ b/ctru-rs/src/applets/mod.rs @@ -2,6 +2,9 @@ //! //! Applets are small integrated programs that the OS makes available to the developer to streamline commonly needed functionality. //! Thanks to these integrations the developer can avoid wasting time re-implementing common features and instead use a more reliable base for their application. +//! +//! Unlike [services](crate::services), applets aren't accessed via a system subprocess (which would require obtaining a special handle at runtime). +//! Instead, the user builds a configuration storing the various parameters which is then used to "launch" the applet. pub mod mii_selector; pub mod swkbd; diff --git a/ctru-rs/src/applets/swkbd.rs b/ctru-rs/src/applets/swkbd.rs index 59c658d..86f6357 100644 --- a/ctru-rs/src/applets/swkbd.rs +++ b/ctru-rs/src/applets/swkbd.rs @@ -89,6 +89,7 @@ pub enum ValidInput { bitflags! { /// Keyboard feature flags. + #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)] pub struct Features: u32 { /// Parental PIN mode. const PARENTAL_PIN = ctru_sys::SWKBD_PARENTAL; @@ -111,6 +112,7 @@ bitflags! { } /// Keyboard input filtering flags + #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)] pub struct Filters: u32 { /// Disallows the usage of numerical digits. const DIGITS = ctru_sys::SWKBD_FILTER_DIGITS; @@ -183,13 +185,13 @@ impl Swkbd { /// Sets special features for this keyboard #[doc(alias = "swkbdSetFeatures")] pub fn set_features(&mut self, features: Features) { - unsafe { swkbdSetFeatures(self.state.as_mut(), features.bits) } + unsafe { swkbdSetFeatures(self.state.as_mut(), features.bits()) } } /// Configures input validation for this keyboard pub fn set_validation(&mut self, validation: ValidInput, filters: Filters) { self.state.valid_input = validation.into(); - self.state.filter_flags = filters.bits; + self.state.filter_flags = filters.bits(); } /// Configures the maximum number of digits that can be entered in the keyboard when the diff --git a/ctru-rs/src/error.rs b/ctru-rs/src/error.rs index 71c0f46..895bed1 100644 --- a/ctru-rs/src/error.rs +++ b/ctru-rs/src/error.rs @@ -21,7 +21,9 @@ pub type Result = ::std::result::Result; /// # Example /// /// ```no_run -/// pub fn hid_init() -> crate::Result<()> { +/// use ctru::error::{Result, ResultCode}; +/// +/// pub fn hid_init() -> Result<()> { /// // We run an unsafe function which returns a `ctru_sys::Result`. /// let result: ctru_sys::Result = unsafe { ctru_sys::hidInit() }; /// diff --git a/ctru-rs/src/lib.rs b/ctru-rs/src/lib.rs index 7e29748..64ef0fa 100644 --- a/ctru-rs/src/lib.rs +++ b/ctru-rs/src/lib.rs @@ -14,10 +14,6 @@ //! Read thoroughly the official [`ctru-rs` wiki](https://github.com/rust3ds/ctru-rs/wiki) which guides you through the setup needed to install the required toolchain and helpful tools. //! After following the guide and understanding the many quirks of the Nintendo 3DS homebrew development environment, you can create a new project by including this crate as a dependency //! of your project in your `Cargo.toml` manifest and build your binaries either manually (for the `armv6k-nintendo-3ds` target) or via [`cargo-3ds`](https://github.com/rust3ds/cargo-3ds). -//! -//! # Examples -//! -//! You can check out the examples provided with this crate which dive into most of the implemented functionality. #![crate_type = "rlib"] #![crate_name = "ctru"] diff --git a/ctru-rs/src/services/fs.rs b/ctru-rs/src/services/fs.rs index f008954..1f0fed7 100644 --- a/ctru-rs/src/services/fs.rs +++ b/ctru-rs/src/services/fs.rs @@ -17,20 +17,20 @@ use std::sync::Arc; use widestring::{WideCStr, WideCString}; bitflags! { - #[derive(Default)] + #[derive(Default, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)] struct FsOpen: u32 { const FS_OPEN_READ = 1; const FS_OPEN_WRITE = 2; const FS_OPEN_CREATE = 4; } - #[derive(Default)] + #[derive(Default, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)] struct FsWrite: u32 { const FS_WRITE_FLUSH = 1; const FS_WRITE_UPDATE_TIME = 256; } - #[derive(Default)] + #[derive(Default, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)] struct FsAttribute: u32 { const FS_ATTRIBUTE_DIRECTORY = 1; const FS_ATTRIBUTE_HIDDEN = 256; diff --git a/ctru-rs/src/services/gfx.rs b/ctru-rs/src/services/gfx.rs index 54ec061..b1432f2 100644 --- a/ctru-rs/src/services/gfx.rs +++ b/ctru-rs/src/services/gfx.rs @@ -222,8 +222,17 @@ impl Gfx { /// Creates a new [`Gfx`] instance with default init values /// It's the same as calling: /// - /// ``` - /// Gfx::with_formats(FramebufferFormat::Bgr8, FramebufferFormat::Bgr8, false) + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// # use ctru::services::gfx::Gfx; + /// use ctru::services::gspgpu::FramebufferFormat; + /// + /// Gfx::with_formats(FramebufferFormat::Bgr8, FramebufferFormat::Bgr8, false); + /// # + /// # Ok(()) + /// # } /// ``` #[doc(alias = "gfxInit")] pub fn new() -> Result { diff --git a/ctru-rs/src/services/hid.rs b/ctru-rs/src/services/hid.rs index cb2550f..b592f6a 100644 --- a/ctru-rs/src/services/hid.rs +++ b/ctru-rs/src/services/hid.rs @@ -5,9 +5,12 @@ //! the accelerometer, and the gyroscope. use crate::error::ResultCode; -bitflags::bitflags! { +use bitflags::bitflags; + +bitflags! { /// A set of flags corresponding to the button and directional pad /// inputs on the 3DS + #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)] pub struct KeyPad: u32 { /// A button. const A = ctru_sys::KEY_A; From fafe3c3dbf771bcc95fb494c6f373922cb3c833d Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Wed, 19 Jul 2023 13:38:31 +0200 Subject: [PATCH 029/101] Finish MiiSelector applet documentation --- ctru-rs/examples/mii-selector.rs | 2 +- ctru-rs/src/applets/mii_selector.rs | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ctru-rs/examples/mii-selector.rs b/ctru-rs/examples/mii-selector.rs index 4602e9b..f6d3aa9 100644 --- a/ctru-rs/examples/mii-selector.rs +++ b/ctru-rs/examples/mii-selector.rs @@ -10,7 +10,7 @@ fn main() { let _console = Console::new(gfx.top_screen.borrow_mut()); let mut mii_selector = MiiSelector::new(); - mii_selector.set_options(Options::MII_SELECTOR_CANCEL); + mii_selector.set_options(Options::ENABLE_CANCEL); mii_selector.set_initial_index(3); mii_selector.blacklist_user_mii(0.into()); mii_selector.set_title("Great Mii Selector!"); diff --git a/ctru-rs/src/applets/mii_selector.rs b/ctru-rs/src/applets/mii_selector.rs index fa69034..2ccc42c 100644 --- a/ctru-rs/src/applets/mii_selector.rs +++ b/ctru-rs/src/applets/mii_selector.rs @@ -5,9 +5,9 @@ use crate::mii::MiiData; use bitflags::bitflags; -use std::{ffi::CString, error::Error, fmt}; +use std::{error::Error, ffi::CString, fmt}; -/// Index of a Mii used to configure some parameters of the Mii Selector. +/// Index of a Mii on the Mii Selector interface. #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub enum Index { /// Specific Mii index. @@ -32,21 +32,21 @@ pub enum MiiType { bitflags! { /// Options to configure the [MiiSelector]. - /// + /// ///

Example

- /// + /// /// ```no_run /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # /// use ctru::applets::mii_selector::{MiiSelector, Options}; - /// + /// /// // Setup a `MiiSelector` that can be cancelled and that makes Guest Miis available to select. /// let opts = Options::ENABLE_CANCEL & Options::ENABLE_GUESTS; - /// + /// /// let mut mii_selector = MiiSelector::new(); /// mii_selector.set_options(opts); - /// + /// /// let result = mii_selector.launch()?; /// # /// # Ok(()) @@ -58,14 +58,14 @@ bitflags! { const ENABLE_CANCEL = ctru_sys::MIISELECTOR_CANCEL; /// Make guest Miis available to select. const ENABLE_GUESTS = ctru_sys::MIISELECTOR_GUESTS; - /// Show on the top screen. + /// Show the Mii Selector window on the top screen. const USE_TOP_SCREEN = ctru_sys::MIISELECTOR_TOP; - /// Start on the guests' page. Requires [Options::ENABLE_GUESTS]. + /// Start the Mii Selector on the guests' page. Requires [Options::ENABLE_GUESTS]. const START_WITH_GUESTS = ctru_sys::MIISELECTOR_GUESTSTART; } } -/// Configuration object to setup the Mii Selector applet. +/// Configuration structure to setup the Mii Selector applet. /// /// # Example /// ```no_run @@ -132,7 +132,7 @@ impl MiiSelector { } /// Set the options of the Mii Selector. - /// + /// /// This will overwrite any previously saved options. #[doc(alias = "miiSelectorSetOptions")] pub fn set_options(&mut self, options: Options) { @@ -184,7 +184,7 @@ impl MiiSelector { } /// Set where the cursor will start at. - /// + /// /// If there's no Mii at that index, the cursor will start at the Mii with the index 0. pub fn set_initial_index(&mut self, index: usize) { // This function is static inline in libctru @@ -193,7 +193,7 @@ impl MiiSelector { } /// Launch the Mii Selector. - /// + /// /// Depending on the configuration, the Mii Selector window will appear either on the bottom screen (default behaviour) or the top screen (see [Options::USE_TOP_SCREEN]). #[doc(alias = "miiSelectorLaunch")] pub fn launch(&mut self) -> Result { From ab8a440e281b3891b9cfba54e790a40b0c47cf08 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Wed, 19 Jul 2023 23:41:11 +0200 Subject: [PATCH 030/101] Finalize applets --- ctru-rs/examples/file-explorer.rs | 4 +- ctru-rs/examples/mii-selector.rs | 6 +- ctru-rs/examples/software-keyboard.rs | 6 +- ctru-rs/src/applets/mii_selector.rs | 187 +++++++++++----- ctru-rs/src/applets/mod.rs | 4 +- ctru-rs/src/applets/swkbd.rs | 311 +++++++++++++++++++++----- 6 files changed, 397 insertions(+), 121 deletions(-) diff --git a/ctru-rs/examples/file-explorer.rs b/ctru-rs/examples/file-explorer.rs index 6d30590..748a937 100644 --- a/ctru-rs/examples/file-explorer.rs +++ b/ctru-rs/examples/file-explorer.rs @@ -1,7 +1,7 @@ //! A file explorer which shows off using standard library file system APIs to //! read the SD card. -use ctru::applets::swkbd::{Button, Swkbd}; +use ctru::applets::swkbd::{Button, SoftwareKeyboard}; use ctru::prelude::*; use std::fs::DirEntry; @@ -159,7 +159,7 @@ impl<'a> FileExplorer<'a> { } fn get_input_and_run(&mut self, action: impl FnOnce(&mut Self, String)) { - let mut keyboard = Swkbd::default(); + let mut keyboard = SoftwareKeyboard::default(); match keyboard.get_string(2048) { Ok((path, Button::Right)) => { diff --git a/ctru-rs/examples/mii-selector.rs b/ctru-rs/examples/mii-selector.rs index f6d3aa9..b12f217 100644 --- a/ctru-rs/examples/mii-selector.rs +++ b/ctru-rs/examples/mii-selector.rs @@ -1,4 +1,4 @@ -use ctru::applets::mii_selector::{LaunchError, MiiSelector, Options}; +use ctru::applets::mii_selector::{Error, MiiSelector, Options}; use ctru::prelude::*; fn main() { @@ -25,8 +25,8 @@ fn main() { result.mii_data.mole_details.is_enabled ); } - Err(LaunchError::InvalidChecksum) => println!("Corrupt Mii selected"), - Err(LaunchError::NoMiiSelected) => println!("No Mii selected"), + Err(Error::InvalidChecksum) => println!("Corrupt Mii selected"), + Err(Error::NoMiiSelected) => println!("No Mii selected"), } // Main loop diff --git a/ctru-rs/examples/software-keyboard.rs b/ctru-rs/examples/software-keyboard.rs index 39b5549..4d7c4f2 100644 --- a/ctru-rs/examples/software-keyboard.rs +++ b/ctru-rs/examples/software-keyboard.rs @@ -1,4 +1,4 @@ -use ctru::applets::swkbd::{Button, Swkbd}; +use ctru::applets::swkbd::{Button, SoftwareKeyboard}; use ctru::prelude::*; fn main() { @@ -18,9 +18,9 @@ fn main() { if hid.keys_down().contains(KeyPad::A) { // Prepares a software keyboard with two buttons: One to cancel input and one - // to accept it. You can also use `Swkbd::new()` to launch the keyboard in different + // to accept it. You can also use `SoftwareKeyboard::new()` to launch the keyboard in different // configurations. - let mut keyboard = Swkbd::default(); + let mut keyboard = SoftwareKeyboard::default(); // Raise the software keyboard. You can perform different actions depending on which // software button the user pressed diff --git a/ctru-rs/src/applets/mii_selector.rs b/ctru-rs/src/applets/mii_selector.rs index 2ccc42c..16e885c 100644 --- a/ctru-rs/src/applets/mii_selector.rs +++ b/ctru-rs/src/applets/mii_selector.rs @@ -1,16 +1,22 @@ //! Mii Selector applet. //! -//! This applet opens a window on the console's bottom screen which lets the player/user choose a Mii from the ones present on their console. +//! This applet opens a window which lets the player/user choose a Mii from the ones present on their console. //! The selected Mii is readable as a [`MiiData`](crate::mii::MiiData). use crate::mii::MiiData; use bitflags::bitflags; -use std::{error::Error, ffi::CString, fmt}; +use std::{ffi::CString, fmt}; -/// Index of a Mii on the Mii Selector interface. +/// Index of a Mii on the [`MiiSelector`] interface. +/// +/// See [`MiiSelector::whitelist_user_mii()`] and related functions for more information. #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub enum Index { /// Specific Mii index. + /// + /// # Notes + /// + /// Indexes start at 0. Index(u32), /// All Miis. All, @@ -31,64 +37,30 @@ pub enum MiiType { } bitflags! { - /// Options to configure the [MiiSelector]. - /// - ///

Example

- /// - /// ```no_run - /// # use std::error::Error; - /// # fn main() -> Result<(), Box> { - /// # - /// use ctru::applets::mii_selector::{MiiSelector, Options}; + /// Options to configure the [`MiiSelector`]. /// - /// // Setup a `MiiSelector` that can be cancelled and that makes Guest Miis available to select. - /// let opts = Options::ENABLE_CANCEL & Options::ENABLE_GUESTS; - /// - /// let mut mii_selector = MiiSelector::new(); - /// mii_selector.set_options(opts); - /// - /// let result = mii_selector.launch()?; - /// # - /// # Ok(()) - /// # } - /// ``` + /// See [`MiiSelector::set_options()`] to learn how to use them. #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)] pub struct Options: u32 { /// Show the cancel button. const ENABLE_CANCEL = ctru_sys::MIISELECTOR_CANCEL; /// Make guest Miis available to select. const ENABLE_GUESTS = ctru_sys::MIISELECTOR_GUESTS; - /// Show the Mii Selector window on the top screen. + /// Show the [`MiiSelector`] window on the top screen. const USE_TOP_SCREEN = ctru_sys::MIISELECTOR_TOP; - /// Start the Mii Selector on the guests' page. Requires [Options::ENABLE_GUESTS]. + /// Start the [`MiiSelector`] on the guests' page. Requires [`Options::ENABLE_GUESTS`]. const START_WITH_GUESTS = ctru_sys::MIISELECTOR_GUESTSTART; } } /// Configuration structure to setup the Mii Selector applet. -/// -/// # Example -/// ```no_run -/// # use std::error::Error; -/// # fn main() -> Result<(), Box> { -/// # -/// use ctru::applets::mii_selector::MiiSelector; -/// -/// let mut mii_selector = MiiSelector::new(); -/// mii_selector.set_title("Example Mii Selector"); -/// -/// let result = mii_selector.launch()?; -/// # -/// # Ok(()) -/// # } -/// ``` #[doc(alias = "MiiSelectorConf")] #[derive(Clone, Debug)] pub struct MiiSelector { config: Box, } -/// Return value of a successful [MiiSelector::launch()]. +/// Return value of a successful [`MiiSelector::launch()`]. #[non_exhaustive] #[derive(Clone, Debug)] pub struct Selection { @@ -98,12 +70,12 @@ pub struct Selection { pub mii_type: MiiType, } -/// Error returned by an unsuccessful [MiiSelector::launch()]. +/// Error returned by an unsuccessful [`MiiSelector::launch()`]. #[derive(Copy, Clone, Debug, Eq, PartialEq)] -pub enum LaunchError { - /// The selected Mii's data is corrupt in some way. +pub enum Error { + /// The selected Mii's data is corrupt. InvalidChecksum, - /// Either the user cancelled the selection (see [Options::ENABLE_CANCEL]), or no valid Miis were available to select. + /// Either the user cancelled the selection (see [`Options::ENABLE_CANCEL`]) or no valid Miis were available to select. NoMiiSelected, } @@ -120,7 +92,18 @@ impl MiiSelector { /// Set the title of the Mii Selector window. /// + /// # Panics /// This function will panic if the given `&str` contains NUL bytes. + /// + /// # Example + /// ```no_run + /// # fn main() { + /// use ctru::applets::mii_selector::MiiSelector; + /// + /// let mut mii_selector = MiiSelector::new(); + /// mii_selector.set_title("Select a Mii!"); + /// # } + /// ``` #[doc(alias = "miiSelectorSetTitle")] pub fn set_title(&mut self, text: &str) { // This can only fail if the text contains NUL bytes in the string... which seems @@ -133,13 +116,42 @@ impl MiiSelector { /// Set the options of the Mii Selector. /// - /// This will overwrite any previously saved options. + /// This will overwrite any previously saved options. Use bitwise operations to set all your wanted options at once. + /// + /// # Example + /// ```no_run + /// # fn main() { + /// use ctru::applets::mii_selector::{MiiSelector, Options}; + /// let mut mii_selector = MiiSelector::new(); + /// + /// // Setup a `MiiSelector` that can be cancelled and that makes Guest Miis available to select. + /// let opts = Options::ENABLE_CANCEL & Options::ENABLE_GUESTS; + /// mii_selector.set_options(opts); + /// # } + /// ``` #[doc(alias = "miiSelectorSetOptions")] pub fn set_options(&mut self, options: Options) { unsafe { ctru_sys::miiSelectorSetOptions(self.config.as_mut(), options.bits()) } } /// Whitelist a guest Mii based on its index. + /// + /// # Notes + /// + /// Guest Mii's won't be available regardless of their whitelist/blacklist state if the [`MiiSelector`] is run without setting [`Options::ENABLE_GUESTS`]. + /// Look into [`MiiSelector::set_options()`] to see how to work with options. + /// + /// # Example + /// ```no_run + /// # fn main() { + /// # + /// use ctru::applets::mii_selector::{Index, MiiSelector}; + /// let mut mii_selector = MiiSelector::new(); + /// + /// // Whitelist the guest Mii at index 2. + /// mii_selector.whitelist_guest_mii(Index::Index(2)); + /// # } + /// ``` #[doc(alias = "miiSelectorWhitelistGuestMii")] pub fn whitelist_guest_mii(&mut self, mii_index: Index) { let index = match mii_index { @@ -151,6 +163,23 @@ impl MiiSelector { } /// Blacklist a guest Mii based on its index. + /// + /// # Notes + /// + /// Guest Mii's won't be available regardless of their whitelist/blacklist state if the [`MiiSelector`] is run without setting [`Options::ENABLE_GUESTS`]. + /// Look into [`MiiSelector::set_options()`] to see how to work with options. + /// + /// # Example + /// ```no_run + /// # fn main() { + /// # + /// use ctru::applets::mii_selector::{Index, MiiSelector}; + /// let mut mii_selector = MiiSelector::new(); + /// + /// // Blacklist the guest Mii at index 1 so that it cannot be selected. + /// mii_selector.blacklist_guest_mii(Index::Index(1)); + /// # } + /// ``` #[doc(alias = "miiSelectorBlacklistGuestMii")] pub fn blacklist_guest_mii(&mut self, mii_index: Index) { let index = match mii_index { @@ -161,7 +190,19 @@ impl MiiSelector { unsafe { ctru_sys::miiSelectorBlacklistGuestMii(self.config.as_mut(), index) } } - /// Whitelist a user Mii based on its index. + /// Whitelist a user-created Mii based on its index. + /// + /// # Example + /// ```no_run + /// # fn main() { + /// # + /// use ctru::applets::mii_selector::{Index, MiiSelector}; + /// let mut mii_selector = MiiSelector::new(); + /// + /// // Whitelist the user-created Mii at index 0. + /// mii_selector.whitelist_user_mii(Index::Index(0)); + /// # } + /// ``` #[doc(alias = "miiSelectorWhitelistUserMii")] pub fn whitelist_user_mii(&mut self, mii_index: Index) { let index = match mii_index { @@ -172,7 +213,19 @@ impl MiiSelector { unsafe { ctru_sys::miiSelectorWhitelistUserMii(self.config.as_mut(), index) } } - /// Blacklist a user Mii based on its index. + /// Blacklist a user-created Mii based on its index. + /// + /// # Example + /// ```no_run + /// # fn main() { + /// # + /// use ctru::applets::mii_selector::{Index, MiiSelector}; + /// let mut mii_selector = MiiSelector::new(); + /// + /// // Blacklist all user-created Miis so that they cannot be selected. + /// mii_selector.blacklist_user_mii(Index::All); + /// # } + /// ``` #[doc(alias = "miiSelectorBlacklistUserMii")] pub fn blacklist_user_mii(&mut self, mii_index: Index) { let index = match mii_index { @@ -183,9 +236,10 @@ impl MiiSelector { unsafe { ctru_sys::miiSelectorBlacklistUserMii(self.config.as_mut(), index) } } - /// Set where the cursor will start at. + /// Set where the GUI cursor will start at. /// /// If there's no Mii at that index, the cursor will start at the Mii with the index 0. + #[doc(alias = "miiSelectorSetInitialIndex")] pub fn set_initial_index(&mut self, index: usize) { // This function is static inline in libctru // https://github.com/devkitPro/libctru/blob/af5321c78ee5c72a55b526fd2ed0d95ca1c05af9/libctru/include/3ds/applets/miiselector.h#L155 @@ -194,20 +248,41 @@ impl MiiSelector { /// Launch the Mii Selector. /// - /// Depending on the configuration, the Mii Selector window will appear either on the bottom screen (default behaviour) or the top screen (see [Options::USE_TOP_SCREEN]). + /// Depending on the configuration, the Mii Selector window will appear either on the bottom screen (default behaviour) or the top screen (see [`Options::USE_TOP_SCREEN`]). + /// + /// TODO: UNSAFE OPERATION, LAUNCHING APPLETS REQUIRES GRAPHICS, WITHOUT AN ACTIVE GFX THIS WILL CAUSE A SEGMENTATION FAULT. + /// + /// # Example + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::applets::mii_selector::{MiiSelector, Options}; + /// + /// let mut mii_selector = MiiSelector::new(); + /// mii_selector.set_title("Select a Mii!"); + /// + /// let opts = Options::ENABLE_CANCEL & Options::ENABLE_GUESTS; + /// mii_selector.set_options(opts); + /// + /// let result = mii_selector.launch()?; + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "miiSelectorLaunch")] - pub fn launch(&mut self) -> Result { + pub fn launch(&mut self) -> Result { let mut return_val = Box::::default(); unsafe { ctru_sys::miiSelectorLaunch(self.config.as_mut(), return_val.as_mut()) } if return_val.no_mii_selected != 0 { - return Err(LaunchError::NoMiiSelected); + return Err(Error::NoMiiSelected); } if unsafe { ctru_sys::miiSelectorChecksumIsValid(return_val.as_mut()) } { Ok((*return_val).into()) } else { - Err(LaunchError::InvalidChecksum) + Err(Error::InvalidChecksum) } } } @@ -218,7 +293,7 @@ impl Default for MiiSelector { } } -impl fmt::Display for LaunchError { +impl fmt::Display for Error { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { Self::InvalidChecksum => write!(f, "selected mii has invalid checksum"), @@ -227,7 +302,7 @@ impl fmt::Display for LaunchError { } } -impl Error for LaunchError {} +impl std::error::Error for Error {} impl From for Selection { fn from(ret: ctru_sys::MiiSelectorReturn) -> Self { diff --git a/ctru-rs/src/applets/mod.rs b/ctru-rs/src/applets/mod.rs index 15216fa..244fb74 100644 --- a/ctru-rs/src/applets/mod.rs +++ b/ctru-rs/src/applets/mod.rs @@ -4,7 +4,9 @@ //! Thanks to these integrations the developer can avoid wasting time re-implementing common features and instead use a more reliable base for their application. //! //! Unlike [services](crate::services), applets aren't accessed via a system subprocess (which would require obtaining a special handle at runtime). -//! Instead, the user builds a configuration storing the various parameters which is then used to "launch" the applet. +//! Instead, the application builds a configuration storing the various parameters which is then used to "launch" the applet. +//! +//! Applets block execution of the thread that launches them as long as the user doesn't close the applet. pub mod mii_selector; pub mod swkbd; diff --git a/ctru-rs/src/applets/swkbd.rs b/ctru-rs/src/applets/swkbd.rs index 86f6357..b399fb0 100644 --- a/ctru-rs/src/applets/swkbd.rs +++ b/ctru-rs/src/applets/swkbd.rs @@ -1,23 +1,28 @@ //! Software Keyboard applet. //! -//! This applet opens a virtual keyboard on the console's bottom screen which lets the player/user write UTF-16 valid text. +//! This applet opens a virtual keyboard on the console's bottom screen which lets the user write UTF-16 valid text. +// TODO: Implement remaining functionality (password mode, filter callbacks, etc.). Also improve "max text length" API. Improve `number of buttons` API when creating a new SoftwareKeyboard. +// TODO: Split the Parental PIN lock operations into a different type. use bitflags::bitflags; use ctru_sys::{ self, swkbdInit, swkbdInputText, swkbdSetButton, swkbdSetFeatures, swkbdSetHintText, SwkbdState, }; use libc; +use std::fmt::Display; use std::iter::once; use std::str; -/// An instance of the software keyboard. +/// Configuration structure to setup the Software Keyboard applet. #[doc(alias = "SwkbdState")] #[derive(Clone)] -pub struct Swkbd { +pub struct SoftwareKeyboard { state: Box, } -/// The kind of keyboard to be initialized. +/// The type of keyboard used by the [`SoftwareKeyboard`]. +/// +/// Can be set with [`SoftwareKeyboard::new()`] #[doc(alias = "SwkbdType")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] @@ -28,13 +33,15 @@ pub enum Kind { Qwerty = ctru_sys::SWKBD_TYPE_QWERTY, /// Only number pad. Numpad = ctru_sys::SWKBD_TYPE_NUMPAD, - /// On JPN systems: a keyboard without japanese input capablities. + /// On JPN systems: a keyboard without japanese input capabilities. /// /// On any other region: same as [`Normal`](Kind::Normal). Western = ctru_sys::SWKBD_TYPE_WESTERN, } -/// Represents which button the user pressed to close the software keyboard. +/// Represents which button the user pressed to close the [`SoftwareKeyboard`]. +/// +/// Button text and behaviour can be customized with [`SoftwareKeyboard::configure_button()`]. #[doc(alias = "SwkbdButton")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] @@ -47,30 +54,37 @@ pub enum Button { Right = ctru_sys::SWKBD_BUTTON_RIGHT, } -/// Error type for the software keyboard. +/// Error returned by an unsuccessful [`SoftwareKeyboard::get_string()`]. #[doc(alias = "SwkbdResult")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(i32)] pub enum Error { - /// Invalid parameters inputted in the Software Keyboard. - InvalidInput = ctru_sys::SWKBD_INVALID_INPUT, - /// Out of memory. + /// Invalid parameters given to the [`SoftwareKeyboard`] configuration. + InvalidParameters = ctru_sys::SWKBD_INVALID_INPUT, + /// [`SoftwareKeyboard`] ran out of memory. OutOfMem = ctru_sys::SWKBD_OUTOFMEM, - /// Home button was pressed during execution. + /// Home button was pressed while [`SoftwareKeyboard`] was running. HomePressed = ctru_sys::SWKBD_HOMEPRESSED, - /// Reset button was pressed during execution. + /// Reset button was pressed while [`SoftwareKeyboard`] was running. ResetPressed = ctru_sys::SWKBD_RESETPRESSED, - /// Power button was pressed during execution. + /// Power button was pressed while [`SoftwareKeyboard`] was running. PowerPressed = ctru_sys::SWKBD_POWERPRESSED, - /// The parental PIN was correct. + /// The parental lock PIN was correct. + /// + /// While this variant isn't *technically* considerable an error + /// the result of a Parental PIN operation won't return a string to the program, thus it's still exceptional behaviour. ParentalOk = ctru_sys::SWKBD_PARENTAL_OK, - /// The parental PIN was incorrect. + /// The parental lock PIN was incorrect. ParentalFail = ctru_sys::SWKBD_PARENTAL_FAIL, /// Input triggered the filter. + /// + /// You can have a look at [`Filters`] to activate custom filters. BannedInput = ctru_sys::SWKBD_BANNED_INPUT, } -/// Restrictions on keyboard input. +/// Restrictions to enforce rules on the keyboard input. +/// +/// See [`SoftwareKeyboard::set_validation()`] #[doc(alias = "SwkbdValidInput")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] @@ -79,71 +93,113 @@ pub enum ValidInput { Anything = ctru_sys::SWKBD_ANYTHING, /// Empty inputs are not accepted. NotEmpty = ctru_sys::SWKBD_NOTEMPTY, - /// Blank (consisting only of whitespaces) inputs are not accepted. + /// Blank inputs (consisting only of whitespaces) are not accepted. NotBlank = ctru_sys::SWKBD_NOTBLANK, /// Neither empty inputs nor blank inputs are accepted. NotEmptyNotBlank = ctru_sys::SWKBD_NOTEMPTY_NOTBLANK, - /// Input must have a fixed length. Maximum length can be specified with [`Swkbd::set_max_text_len`]; + /// Input must have a fixed length. Maximum length can be specified with [`SoftwareKeyboard::set_max_text_len()`]; FixedLen = ctru_sys::SWKBD_FIXEDLEN, } bitflags! { - /// Keyboard feature flags. + /// Special features that can be activated via [`SoftwareKeyboard::set_features()`]. #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)] pub struct Features: u32 { /// Parental PIN mode. + /// + /// # Notes + /// + /// Refer to [`Error::ParentalOk`] and [`Error::ParentalFail`] to check whether the Parental PIN lock was successfully opened. const PARENTAL_PIN = ctru_sys::SWKBD_PARENTAL; - /// Darken top screen while the Software Keyboard is active. - const DARKEN_TOP_SCREEN = ctru_sys::SWKBD_DARKEN_TOP_SCREEN; + /// Darken top screen while the [`SoftwareKeyboard`] is active. + const DARKEN_TOP_SCREEN = ctru_sys::SWKBD_DARKEN_TOP_SCREEN; /// Enable predictive input (necessary for Kanji on JPN consoles). const PREDICTIVE_INPUT = ctru_sys::SWKBD_PREDICTIVE_INPUT; /// Enable multiline input. - const MULTILINE = ctru_sys::SWKBD_MULTILINE; + const MULTILINE = ctru_sys::SWKBD_MULTILINE; /// Enable fixed-width mode. const FIXED_WIDTH = ctru_sys::SWKBD_FIXED_WIDTH; - /// Allow the usage of the Home Button while the Software Keyboard is active. + /// Allow the usage of the Home Button while the [`SoftwareKeyboard`] is running. const ALLOW_HOME = ctru_sys::SWKBD_ALLOW_HOME; - /// Allow the usage of the Reset Button while the Software Keyboard is active. + /// Allow the usage of the Reset Button while the [`SoftwareKeyboard`] is running. const ALLOW_RESET = ctru_sys::SWKBD_ALLOW_RESET; - /// Allow the usage of the Power Button while the Software Keyboard is active. + /// Allow the usage of the Power Button while the [`SoftwareKeyboard`] is running. const ALLOW_POWER = ctru_sys::SWKBD_ALLOW_POWER; - /// Default to the QWERTY page when the Software Keyboard is shown. + /// Default to the QWERTY page when the [`SoftwareKeyboard`] is shown. const DEFAULT_QWERTY = ctru_sys::SWKBD_DEFAULT_QWERTY; } - /// Keyboard input filtering flags + /// Availble filters to disallow some types of input for the [`SoftwareKeyboard`]. + /// + /// See [`SoftwareKeyboard::set_validation()`] #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)] pub struct Filters: u32 { - /// Disallows the usage of numerical digits. + /// Disallow the usage of numerical digits. + /// + /// The maximum number of digits that are allowed to be used while this filter is active + /// can be configured with [`SoftwareKeyboard::set_max_digits()`] (default is 0). const DIGITS = ctru_sys::SWKBD_FILTER_DIGITS; - /// Disallows the usage of the "at" (@) sign. + /// Disallow the usage of the "at" (@) sign. const AT = ctru_sys::SWKBD_FILTER_AT; - /// Disallows the usage of the "percent" (%) sign. + /// Disallow the usage of the "percent" (%) sign. const PERCENT = ctru_sys::SWKBD_FILTER_PERCENT; - /// Disallows the usage of the "backslash" (\) sign. + /// Disallow the usage of the "backslash" (\) sign. const BACKSLASH = ctru_sys::SWKBD_FILTER_BACKSLASH; - /// Disallows the use of profanity via Nintendo's profanity filter. + /// Disallow the use of profanity via Nintendo's profanity filter. const PROFANITY = ctru_sys::SWKBD_FILTER_PROFANITY; /// Use a custom callback in order to filter the input. + /// + /// TODO: It's currently impossible to setup a custom filter callback. const CALLBACK = ctru_sys::SWKBD_FILTER_CALLBACK; } } -impl Swkbd { - /// Initializes a software keyboard of the specified type and the chosen number of buttons - /// (from 1-3). +impl SoftwareKeyboard { + /// Initialize a new configuration for the Software Keyboard applet depending on how many "exit" buttons are available to the user (1, 2 or 3). + /// + /// # Example + /// ```no_run + /// # fn main() { + /// # + /// use ctru::applets::swkbd::{SoftwareKeyboard, Kind}; + /// + /// // Standard keyboard. + /// let keyboard = SoftwareKeyboard::new(Kind::Normal, 2); + /// + /// // Numpad (with only the "confirm" button). + /// let keyboard = SoftwareKeyboard::new(Kind::Numpad, 1); + /// # + /// # } #[doc(alias = "swkbdInit")] pub fn new(keyboard_type: Kind, num_buttons: i32) -> Self { unsafe { let mut state = Box::::default(); swkbdInit(state.as_mut(), keyboard_type.into(), num_buttons, -1); - Swkbd { state } + SoftwareKeyboard { state } } } - /// Gets input from this keyboard and appends it to the provided string. + /// Launches the applet based on the given configuration and returns a string containing the text input. + /// + /// # Notes /// /// The text received from the keyboard will be truncated if it is longer than `max_bytes`. + /// + /// TODO: UNSAFE OPERATION, LAUNCHING APPLETS REQUIRES GRAPHICS, WITHOUT AN ACTIVE GFX THIS WILL CAUSE A SEGMENTATION FAULT. + /// + /// # Example + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::applets::swkbd::SoftwareKeyboard; + /// let mut keyboard = SoftwareKeyboard::default(); + /// + /// let (text, button) = keyboard.get_string(2048)?; + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "swkbdInputText")] pub fn get_string(&mut self, max_bytes: usize) -> Result<(String, Button), Error> { // Unfortunately the libctru API doesn't really provide a way to get the exact length @@ -167,8 +223,28 @@ impl Swkbd { /// Fills the provided buffer with a UTF-8 encoded, NUL-terminated sequence of bytes from /// this software keyboard. /// + /// # Notes + /// /// If the buffer is too small to contain the entire sequence received from the keyboard, - /// the output will be truncated but should still be well-formed UTF-8. + /// the output will be truncated. + /// + /// TODO: UNSAFE OPERATION, LAUNCHING APPLETS REQUIRES GRAPHICS, WITHOUT AN ACTIVE GFX THIS WILL CAUSE A SEGMENTATION FAULT. + /// + /// # Example + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::applets::swkbd::SoftwareKeyboard; + /// let mut keyboard = SoftwareKeyboard::default(); + /// + /// let mut buffer = vec![0; 100]; + /// + /// let button = keyboard.write_exact(&mut buffer)?; + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "swkbdInputText")] pub fn write_exact(&mut self, buf: &mut [u8]) -> Result { unsafe { @@ -182,26 +258,85 @@ impl Swkbd { } } - /// Sets special features for this keyboard + /// Set special features for this keyboard. + /// + /// # Example + /// ```no_run + /// # fn main() { + /// # + /// use ctru::applets::swkbd::{SoftwareKeyboard, Features}; + /// + /// let mut keyboard = SoftwareKeyboard::default(); + /// + /// let features = Features::DARKEN_TOP_SCREEN & Features::MULTILINE; + /// keyboard.set_features(features); + /// # + /// # } #[doc(alias = "swkbdSetFeatures")] pub fn set_features(&mut self, features: Features) { unsafe { swkbdSetFeatures(self.state.as_mut(), features.bits()) } } - /// Configures input validation for this keyboard + /// Configure input validation for this keyboard. + /// + /// # Example + /// ```no_run + /// # fn main() { + /// # + /// use ctru::applets::swkbd::{SoftwareKeyboard, ValidInput, Filters}; + /// let mut keyboard = SoftwareKeyboard::default(); + /// + /// // Disallow empty or blank input. + /// let validation = ValidInput::NotEmptyNotBlank; + /// + /// // Disallow the use of numerical digits and profanity. + /// let filters = Filters::DIGITS & Filters::PROFANITY; + /// keyboard.set_validation(validation, filters); + /// # + /// # } pub fn set_validation(&mut self, validation: ValidInput, filters: Filters) { self.state.valid_input = validation.into(); self.state.filter_flags = filters.bits(); } - /// Configures the maximum number of digits that can be entered in the keyboard when the - /// `Filters::DIGITS` flag is enabled + /// Configure the maximum number of digits that can be entered in the keyboard when the [`Filters::DIGITS`] flag is enabled. + /// + /// # Example + /// ```no_run + /// # fn main() { + /// # + /// use ctru::applets::swkbd::{SoftwareKeyboard, ValidInput, Filters}; + /// let mut keyboard = SoftwareKeyboard::default(); + /// + /// // Disallow empty or blank input. + /// let validation = ValidInput::NotEmptyNotBlank; + /// + /// // Disallow the use of numerical digits. This filter is customizable thanks to `set_max_digits`. + /// let filters = Filters::DIGITS; + /// keyboard.set_validation(validation, filters); + /// + /// // No more than 3 numbers are accepted. + /// keyboard.set_max_digits(3); + /// # + /// # } pub fn set_max_digits(&mut self, digits: u16) { self.state.max_digits = digits; } - /// Sets the hint text for this software keyboard (that is, the help text that is displayed - /// when the textbox is empty) + /// Set the hint text for this software keyboard. + /// + /// The hint text is the text shown in gray before any text gets written in the input box. + /// + /// # Example + /// ```no_run + /// # fn main() { + /// # + /// use ctru::applets::swkbd::SoftwareKeyboard; + /// let mut keyboard = SoftwareKeyboard::default(); + /// + /// keyboard.set_hint_text("Write here what you like!"); + /// # + /// # } #[doc(alias = "swkbdSetHintText")] pub fn set_hint_text(&mut self, text: &str) { unsafe { @@ -210,12 +345,30 @@ impl Swkbd { } } - /// Configures the look and behavior of a button for this keyboard. + /// Configure the look and behavior of a button for this keyboard. + /// + /// # Arguments + /// + /// - `button` - the [`Button`] to be configured based on the position. + /// - `text` - the text displayed in the button. + /// - `submit` - whether pressing the button will accept the keyboard's input or discard it. + /// + /// # Example + /// ```no_run + /// # fn main() { + /// # + /// use ctru::applets::swkbd::{SoftwareKeyboard, Button, Kind}; + /// + /// // We create a `SoftwareKeyboard` with left and right buttons. + /// let mut keyboard = SoftwareKeyboard::new(Kind::Normal, 2); /// - /// `button` is the `Button` to be configured - /// `text` configures the display text for the button - /// `submit` configures whether pressing the button will accept the keyboard's input or - /// discard it. + /// // Set the left button text to "Cancel" and pressing it will NOT return the user's input. + /// keyboard.configure_button(Button::Left, "Cancel", false); + /// + /// // Set the right button text to "Ok" and pressing it will return the user's input. + /// keyboard.configure_button(Button::Right, "Ok", true); + /// # + /// # } #[doc(alias = "swkbdSetButton")] pub fn configure_button(&mut self, button: Button, text: &str, submit: bool) { unsafe { @@ -229,19 +382,33 @@ impl Swkbd { } } - /// Configures the maximum number of UTF-16 code units that can be entered into the software - /// keyboard. By default the limit is 0xFDE8 code units. + /// Configure the maximum number of UTF-16 code units that can be entered into the software + /// keyboard. By default the limit is `0xFDE8` code units. + /// + /// # Notes /// - /// Note that keyboard input is converted from UTF-16 to UTF-8 before being handed to Rust, + /// Keyboard input is converted from UTF-16 to UTF-8 before being handed to Rust, /// so this code point limit does not necessarily equal the max number of UTF-8 code points - /// receivable by the `get_utf8` and `get_bytes` functions. + /// receivable by [`SoftwareKeyboard::get_string()`] and [`SoftwareKeyboard::write_exact()`]. + /// + /// # Example + /// ```no_run + /// # fn main() { + /// # + /// use ctru::applets::swkbd::{SoftwareKeyboard, Button, Kind}; + /// let mut keyboard = SoftwareKeyboard::default(); + /// + /// // Set the maximum text length to 18 UTF-16 code units. + /// keyboard.set_max_text_len(18); + /// # + /// # } pub fn set_max_text_len(&mut self, len: u16) { self.state.max_text_len = len; } fn parse_swkbd_error(&self) -> Error { match self.state.result { - ctru_sys::SWKBD_INVALID_INPUT => Error::InvalidInput, + ctru_sys::SWKBD_INVALID_INPUT => Error::InvalidParameters, ctru_sys::SWKBD_OUTOFMEM => Error::OutOfMem, ctru_sys::SWKBD_HOMEPRESSED => Error::HomePressed, ctru_sys::SWKBD_RESETPRESSED => Error::ResetPressed, @@ -254,12 +421,44 @@ impl Swkbd { } } -impl Default for Swkbd { +/// Creates a new [`SoftwareKeyboard`] configuration set to using a [`Kind::Normal`] keyboard and 2 [`Button`]s. +impl Default for SoftwareKeyboard { fn default() -> Self { - Swkbd::new(Kind::Normal, 2) + SoftwareKeyboard::new(Kind::Normal, 2) + } +} + +impl Display for Error { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::InvalidParameters => write!( + f, + "software keyboard was configured with invalid parameters" + ), + Self::OutOfMem => write!(f, "software keyboard ran out of memory"), + Self::HomePressed => { + write!(f, "home button pressed while software keyboard was running") + } + Self::ResetPressed => write!( + f, + "reset button pressed while software keyboard was running" + ), + Self::PowerPressed => write!( + f, + "power button pressed while software keyboard was running" + ), + Self::ParentalOk => write!(f, "parental lock pin was correct"), + Self::ParentalFail => write!(f, "parental lock pin was incorrect"), + Self::BannedInput => write!( + f, + "input given to the software keyboard triggered the active filters" + ), + } } } +impl std::error::Error for Error {} + from_impl!(Kind, ctru_sys::SwkbdType); from_impl!(Button, ctru_sys::SwkbdButton); from_impl!(Error, ctru_sys::SwkbdResult); From 127eafdc4b067cbac47d71c73620f83cc30f17a8 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sat, 22 Jul 2023 13:31:14 +0200 Subject: [PATCH 031/101] Small changes and finalized AM service --- ctru-rs/examples/title-info.rs | 15 +--- ctru-rs/src/lib.rs | 5 +- ctru-rs/src/services/am.rs | 136 +++++++++++++++++++++------------ ctru-rs/src/services/mod.rs | 2 +- 4 files changed, 93 insertions(+), 65 deletions(-) diff --git a/ctru-rs/examples/title-info.rs b/ctru-rs/examples/title-info.rs index a03c002..25b5c75 100644 --- a/ctru-rs/examples/title-info.rs +++ b/ctru-rs/examples/title-info.rs @@ -80,18 +80,9 @@ fn main() { // Move cursor to top left println!("\x1b[1;1"); - match selected_title.size() { - Ok(size) => println!("Size: {} kB", size / 1024), - Err(e) => println!("Failed to get title size: {}", e), - } - match selected_title.version() { - Ok(version) => println!("Version: 0x{:x}", version), - Err(e) => println!("Failed to get title version: {}", e), - } - match selected_title.product_code() { - Ok(code) => println!("Product code: \"{code}\""), - Err(e) => println!("Failed to get product code: {}", e), - } + println!("Size: {} kB", selected_title.size() / 1024); + println!("Version: 0x{:x}", selected_title.version()); + println!("Product code: \"{}\"", selected_title.product_code()); println!("\x1b[26;0HPress START to exit"); if use_nand { diff --git a/ctru-rs/src/lib.rs b/ctru-rs/src/lib.rs index 64ef0fa..b2267f0 100644 --- a/ctru-rs/src/lib.rs +++ b/ctru-rs/src/lib.rs @@ -4,14 +4,14 @@ //! //! This crate behaves as the main tool to access system-specific functionality on the Nintendo 3DS when developing homebrew software in Rust. //! Thanks to it, developers can access the underlying system services and the console's hardware to develop userland applications -//! (such as HID devices, network capabilities, graphics, built-in cameras, etc.). +//! (such as [HID devices](crate::services::hid), [network capabilities](crate::services::soc), [graphics](crate::services::gfx), [built-in cameras](crate::services::cam), etc.). //! //! Among these features, `ctru-rs` also automatically includes functionality to properly integrate the Rust `std` with the console's operating system, //! which the developer would otherwise need to implement manually. //! //! # Usage //! -//! Read thoroughly the official [`ctru-rs` wiki](https://github.com/rust3ds/ctru-rs/wiki) which guides you through the setup needed to install the required toolchain and helpful tools. +//! Thoroughly read the official [`ctru-rs` wiki](https://github.com/rust3ds/ctru-rs/wiki) which guides you through the setup needed to install the required toolchain and helpful tools. //! After following the guide and understanding the many quirks of the Nintendo 3DS homebrew development environment, you can create a new project by including this crate as a dependency //! of your project in your `Cargo.toml` manifest and build your binaries either manually (for the `armv6k-nintendo-3ds` target) or via [`cargo-3ds`](https://github.com/rust3ds/cargo-3ds). @@ -21,7 +21,6 @@ #![feature(test)] #![feature(custom_test_frameworks)] #![feature(try_trait_v2)] -#![feature(once_cell_try)] #![feature(allocator_api)] #![test_runner(test_runner::run)] #![doc( diff --git a/ctru-rs/src/services/am.rs b/ctru-rs/src/services/am.rs index 31d46b5..d570529 100644 --- a/ctru-rs/src/services/am.rs +++ b/ctru-rs/src/services/am.rs @@ -4,20 +4,19 @@ //! - Read the installed applications on the console and their information (depending on the install location). //! - Install compatible applications to the console. //! -//! `ctru-rs` doesn't support installing titles (yet). +//! TODO: `ctru-rs` doesn't support installing or uninstalling titles yet. use crate::error::ResultCode; use crate::services::fs::FsMediaType; -use std::cell::OnceCell; use std::marker::PhantomData; -use std::mem::MaybeUninit; -/// Struct holding general information about a specific title. +/// General information about a specific title entry. #[doc(alias = "AM_TitleEntry")] pub struct Title<'a> { id: u64, mediatype: FsMediaType, - entry: OnceCell, + size: u64, + version: u16, _am: PhantomData<&'a Am>, } @@ -29,54 +28,26 @@ impl<'a> Title<'a> { /// Returns this title's unique product code. #[doc(alias = "AM_GetTitleProductCode")] - pub fn product_code(&self) -> crate::Result { + pub fn product_code(&self) -> String { let mut buf: [u8; 16] = [0; 16]; + // This operation is safe as long as the title was correctly obtained via [`Am::title_list()`]. unsafe { - ResultCode(ctru_sys::AM_GetTitleProductCode( - self.mediatype.into(), - self.id, - buf.as_mut_ptr(), - ))?; + let _ = + ctru_sys::AM_GetTitleProductCode(self.mediatype.into(), self.id, buf.as_mut_ptr()); } - Ok(String::from_utf8_lossy(&buf).to_string()) - } - - /// Retrieves additional information on the title. - #[doc(alias = "AM_GetTitleInfo")] - fn title_info(&self) -> crate::Result { - let mut info = MaybeUninit::zeroed(); - - unsafe { - ResultCode(ctru_sys::AM_GetTitleInfo( - self.mediatype.into(), - 1, - &mut self.id.clone(), - info.as_mut_ptr() as _, - ))?; - Ok(info.assume_init()) - } + String::from_utf8_lossy(&buf).to_string() } /// Returns the size of this title in bytes. - pub fn size(&self) -> crate::Result { - // Get the internal entry, or fill it if empty. - let entry = self - .entry - .get_or_try_init(|| -> crate::Result { self.title_info() })?; - - Ok(entry.size) + pub fn size(&self) -> u64 { + self.size } /// Returns the installed version of this title. - pub fn version(&self) -> crate::Result { - // Get the internal entry, or fill it if empty. - let entry = self - .entry - .get_or_try_init(|| -> crate::Result { self.title_info() })?; - - Ok(entry.version) + pub fn version(&self) -> u16 { + self.version } } @@ -84,7 +55,20 @@ impl<'a> Title<'a> { pub struct Am(()); impl Am { - /// Initialize a new handle. + /// Initialize a new service handle. + /// + /// # Example + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::am::Am; + /// + /// let app_manager = Am::new()?; + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "amInit")] pub fn new() -> crate::Result { unsafe { @@ -94,6 +78,24 @@ impl Am { } /// Returns the amount of titles currently installed in a specific install location. + /// + /// # Example + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::{fs::FsMediaType, am::Am}; + /// let app_manager = Am::new()?; + /// + /// // Number of titles installed on the Nand storage. + /// let nand_count = app_manager.title_count(FsMediaType::Nand); + /// + /// // Number of apps installed on the SD card storage + /// let sd_count = app_manager.title_count(FsMediaType::Sd); + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "AM_GetTitleCount")] pub fn title_count(&self, mediatype: FsMediaType) -> crate::Result { unsafe { @@ -104,11 +106,30 @@ impl Am { } /// Returns the list of titles installed in a specific install location. + /// + /// # Example + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::{fs::FsMediaType, am::Am}; + /// let app_manager = Am::new()?; + /// + /// // Number of apps installed on the SD card storage + /// let sd_titles = app_manager.title_list(FsMediaType::Sd)?; + /// + /// // Unique product code identifier of the 5th installed title. + /// let product_code = sd_titles[4].product_code(); + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "AM_GetTitleList")] pub fn title_list(&self, mediatype: FsMediaType) -> crate::Result> { let count = self.title_count(mediatype)?; let mut buf = vec![0; count as usize]; let mut read_amount = 0; + unsafe { ResultCode(ctru_sys::AM_GetTitleList( &mut read_amount, @@ -117,13 +138,30 @@ impl Am { buf.as_mut_ptr(), ))?; } - Ok(buf + + let mut info: Vec = Vec::with_capacity(count as _); + + unsafe { + ResultCode(ctru_sys::AM_GetTitleInfo( + mediatype.into(), + count, + buf.as_mut_ptr(), + info.as_mut_ptr() as _, + ))?; + + info.set_len(count as _); + }; + + Ok(info .into_iter() - .map(|id| Title { - id, - mediatype, - entry: OnceCell::new(), - _am: PhantomData, + .map(|title| { + Title { + id: title.titleID, + mediatype, + size: title.size, + version: title.version, + _am: PhantomData, + } }) .collect()) } diff --git a/ctru-rs/src/services/mod.rs b/ctru-rs/src/services/mod.rs index ab948b3..9ff975e 100644 --- a/ctru-rs/src/services/mod.rs +++ b/ctru-rs/src/services/mod.rs @@ -3,7 +3,7 @@ //! Most of the 3DS console's functionalities (when writing user-land homebrew) are accessible via services, //! which need to be initialized before accessing any particular feature. //! -//! To ensure safety measures when using the underlying services, `ctru-rs` leverages Rust's lifetime model. +//! To ensure safety while using the underlying services, `ctru-rs` leverages Rust's lifetime model. //! After initializing the handle for a specific service (e.g. [`Apt`](apt::Apt)) the service will be accessible as long as there is at least one handle "alive". //! As such, handles should be dropped *after* the use of a specific service. This is particularly important for services which are necessary for functionality //! "outside" their associated methods, such as [`RomFS`](romfs::RomFS), which creates an accessible virtual filesystem, or [`Soc`](soc::Soc), From 30c3fb058522fb9dc8544bfed9ceffd4bf83ee63 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sat, 22 Jul 2023 16:41:42 +0200 Subject: [PATCH 032/101] Small example fmt --- ctru-rs/src/applets/mii_selector.rs | 7 +++++ ctru-rs/src/applets/swkbd.rs | 9 ++++++ ctru-rs/src/services/am.rs | 3 ++ ctru-rs/src/services/apt.rs | 43 +++++++++++++++++++++++++++-- ctru-rs/src/services/cam.rs | 6 ++-- ctru-rs/src/services/cfgu.rs | 4 +-- ctru-rs/src/services/fs.rs | 4 +-- ctru-rs/src/services/gfx.rs | 10 +++---- ctru-rs/src/services/hid.rs | 4 +-- ctru-rs/src/services/ps.rs | 4 ++- ctru-rs/src/services/romfs.rs | 4 +-- ctru-rs/src/services/soc.rs | 8 +++--- ctru-rs/src/services/sslc.rs | 4 +-- 13 files changed, 84 insertions(+), 26 deletions(-) diff --git a/ctru-rs/src/applets/mii_selector.rs b/ctru-rs/src/applets/mii_selector.rs index 16e885c..0562777 100644 --- a/ctru-rs/src/applets/mii_selector.rs +++ b/ctru-rs/src/applets/mii_selector.rs @@ -96,6 +96,7 @@ impl MiiSelector { /// This function will panic if the given `&str` contains NUL bytes. /// /// # Example + /// /// ```no_run /// # fn main() { /// use ctru::applets::mii_selector::MiiSelector; @@ -119,6 +120,7 @@ impl MiiSelector { /// This will overwrite any previously saved options. Use bitwise operations to set all your wanted options at once. /// /// # Example + /// /// ```no_run /// # fn main() { /// use ctru::applets::mii_selector::{MiiSelector, Options}; @@ -142,6 +144,7 @@ impl MiiSelector { /// Look into [`MiiSelector::set_options()`] to see how to work with options. /// /// # Example + /// /// ```no_run /// # fn main() { /// # @@ -170,6 +173,7 @@ impl MiiSelector { /// Look into [`MiiSelector::set_options()`] to see how to work with options. /// /// # Example + /// /// ```no_run /// # fn main() { /// # @@ -193,6 +197,7 @@ impl MiiSelector { /// Whitelist a user-created Mii based on its index. /// /// # Example + /// /// ```no_run /// # fn main() { /// # @@ -216,6 +221,7 @@ impl MiiSelector { /// Blacklist a user-created Mii based on its index. /// /// # Example + /// /// ```no_run /// # fn main() { /// # @@ -253,6 +259,7 @@ impl MiiSelector { /// TODO: UNSAFE OPERATION, LAUNCHING APPLETS REQUIRES GRAPHICS, WITHOUT AN ACTIVE GFX THIS WILL CAUSE A SEGMENTATION FAULT. /// /// # Example + /// /// ```no_run /// # use std::error::Error; /// # fn main() -> Result<(), Box> { diff --git a/ctru-rs/src/applets/swkbd.rs b/ctru-rs/src/applets/swkbd.rs index b399fb0..879c434 100644 --- a/ctru-rs/src/applets/swkbd.rs +++ b/ctru-rs/src/applets/swkbd.rs @@ -158,6 +158,7 @@ impl SoftwareKeyboard { /// Initialize a new configuration for the Software Keyboard applet depending on how many "exit" buttons are available to the user (1, 2 or 3). /// /// # Example + /// /// ```no_run /// # fn main() { /// # @@ -188,6 +189,7 @@ impl SoftwareKeyboard { /// TODO: UNSAFE OPERATION, LAUNCHING APPLETS REQUIRES GRAPHICS, WITHOUT AN ACTIVE GFX THIS WILL CAUSE A SEGMENTATION FAULT. /// /// # Example + /// /// ```no_run /// # use std::error::Error; /// # fn main() -> Result<(), Box> { @@ -231,6 +233,7 @@ impl SoftwareKeyboard { /// TODO: UNSAFE OPERATION, LAUNCHING APPLETS REQUIRES GRAPHICS, WITHOUT AN ACTIVE GFX THIS WILL CAUSE A SEGMENTATION FAULT. /// /// # Example + /// /// ```no_run /// # use std::error::Error; /// # fn main() -> Result<(), Box> { @@ -261,6 +264,7 @@ impl SoftwareKeyboard { /// Set special features for this keyboard. /// /// # Example + /// /// ```no_run /// # fn main() { /// # @@ -280,6 +284,7 @@ impl SoftwareKeyboard { /// Configure input validation for this keyboard. /// /// # Example + /// /// ```no_run /// # fn main() { /// # @@ -302,6 +307,7 @@ impl SoftwareKeyboard { /// Configure the maximum number of digits that can be entered in the keyboard when the [`Filters::DIGITS`] flag is enabled. /// /// # Example + /// /// ```no_run /// # fn main() { /// # @@ -328,6 +334,7 @@ impl SoftwareKeyboard { /// The hint text is the text shown in gray before any text gets written in the input box. /// /// # Example + /// /// ```no_run /// # fn main() { /// # @@ -354,6 +361,7 @@ impl SoftwareKeyboard { /// - `submit` - whether pressing the button will accept the keyboard's input or discard it. /// /// # Example + /// /// ```no_run /// # fn main() { /// # @@ -392,6 +400,7 @@ impl SoftwareKeyboard { /// receivable by [`SoftwareKeyboard::get_string()`] and [`SoftwareKeyboard::write_exact()`]. /// /// # Example + /// /// ```no_run /// # fn main() { /// # diff --git a/ctru-rs/src/services/am.rs b/ctru-rs/src/services/am.rs index d570529..d302448 100644 --- a/ctru-rs/src/services/am.rs +++ b/ctru-rs/src/services/am.rs @@ -58,6 +58,7 @@ impl Am { /// Initialize a new service handle. /// /// # Example + /// /// ```no_run /// # use std::error::Error; /// # fn main() -> Result<(), Box> { @@ -80,6 +81,7 @@ impl Am { /// Returns the amount of titles currently installed in a specific install location. /// /// # Example + /// /// ```no_run /// # use std::error::Error; /// # fn main() -> Result<(), Box> { @@ -108,6 +110,7 @@ impl Am { /// Returns the list of titles installed in a specific install location. /// /// # Example + /// /// ```no_run /// # use std::error::Error; /// # fn main() -> Result<(), Box> { diff --git a/ctru-rs/src/services/apt.rs b/ctru-rs/src/services/apt.rs index 0f5eb25..e885adf 100644 --- a/ctru-rs/src/services/apt.rs +++ b/ctru-rs/src/services/apt.rs @@ -1,8 +1,10 @@ //! Applet service. //! -//! The APT service handles integration with some higher level OS features such as Sleep mode, the Home Menu and application switching. +//! The APT service handles integration with other applications, +//! including high-level OS features such as Sleep mode, the Home Menu and application switching. //! -//! It also handles running applets, small programs made available by the OS to streamline specific functionality. Those are implemented in the [`applets`](crate::applets) module. +//! It also handles running applets, small programs made available by the OS to streamline specific functionality. +//! Those are implemented in the [`applets`](crate::applets) module. use crate::error::ResultCode; @@ -10,7 +12,21 @@ use crate::error::ResultCode; pub struct Apt(()); impl Apt { - /// Initialize a new handle. + /// Initialize a new service handle. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::apt::Apt; + /// + /// let apt = Apt::new()?; + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "aptInit")] pub fn new() -> crate::Result { unsafe { @@ -25,6 +41,27 @@ impl Apt { /// /// This function is called as such since it automatically handles all checks for Home Menu switching, Sleep mode and other events that could take away control from the application. /// For this reason, its main use is as the condition of a while loop that controls the main logic for your program. + /// + /// # Example + /// + /// ```no_run + /// use std::error::Error; + /// use ctru::services::apt::Apt; + /// + /// // In a simple `main` function, the structure should be the following. + /// fn main() -> Result<(), Box> { + /// + /// let apt = Apt::new()?; + /// + /// while apt.main_loop() { + /// // Main program logic should be written here. + /// } + /// + /// // Optional clean-ups after running the application should be written after the main loop. + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "aptMainLoop")] pub fn main_loop(&self) -> bool { unsafe { ctru_sys::aptMainLoop() } diff --git a/ctru-rs/src/services/cam.rs b/ctru-rs/src/services/cam.rs index de9ecb5..717694e 100644 --- a/ctru-rs/src/services/cam.rs +++ b/ctru-rs/src/services/cam.rs @@ -1,6 +1,6 @@ -//! Camera service +//! Camera service. //! -//! The CAM service provides access to the cameras. Cameras can return images +//! The CAM service provides access to the built-in cameras. [`Camera`]s can return images //! in the form of byte vectors which can be displayed or used in other ways. use crate::error::{Error, ResultCode}; @@ -856,7 +856,7 @@ pub trait Camera { } impl Cam { - /// Initializes the CAM service. + /// Initialize a new service handle. /// /// # Errors /// diff --git a/ctru-rs/src/services/cfgu.rs b/ctru-rs/src/services/cfgu.rs index 99ef505..9afbe7b 100644 --- a/ctru-rs/src/services/cfgu.rs +++ b/ctru-rs/src/services/cfgu.rs @@ -1,4 +1,4 @@ -//! Configuration service +//! System Configuration service. //! //! This module contains basic methods to retrieve and change configuration from the console. @@ -82,7 +82,7 @@ pub enum SystemModel { pub struct Cfgu(()); impl Cfgu { - /// Initializes the CFGU service. + /// Initialize a new service handle. /// /// # Errors /// diff --git a/ctru-rs/src/services/fs.rs b/ctru-rs/src/services/fs.rs index 1f0fed7..446be7e 100644 --- a/ctru-rs/src/services/fs.rs +++ b/ctru-rs/src/services/fs.rs @@ -1,4 +1,4 @@ -//! Filesystem service +//! FileSystem service. //! //! This module contains basic methods to manipulate the contents of the 3DS's filesystem. //! Only the SD card is currently supported. You should prefer using `std::fs`. @@ -320,7 +320,7 @@ unsafe impl Send for Dir {} unsafe impl Sync for Dir {} impl Fs { - /// Initializes the FS service. + /// Initialize a new service handle. /// /// # Errors /// diff --git a/ctru-rs/src/services/gfx.rs b/ctru-rs/src/services/gfx.rs index b1432f2..e6465e4 100644 --- a/ctru-rs/src/services/gfx.rs +++ b/ctru-rs/src/services/gfx.rs @@ -1,4 +1,4 @@ -//! LCD screens manipulation helper +//! Graphics service. use std::cell::{Ref, RefCell, RefMut}; use std::marker::PhantomData; @@ -219,7 +219,8 @@ pub struct Gfx { static GFX_ACTIVE: Mutex = Mutex::new(0); impl Gfx { - /// Creates a new [`Gfx`] instance with default init values + /// Initialize a new default service handle. + /// /// It's the same as calling: /// /// ```no_run @@ -239,10 +240,9 @@ impl Gfx { Gfx::with_formats(FramebufferFormat::Bgr8, FramebufferFormat::Bgr8, false) } - /// Initialize the Gfx module with the chosen framebuffer formats for the top and bottom - /// screens + /// Initialize a new service handle with the chosen framebuffer formats for the top and bottom screens. /// - /// Use `Gfx::new()` instead of this function to initialize the module with default parameters + /// Use [`Gfx::new()`] instead of this function to initialize the module with default parameters #[doc(alias = "gfxInit")] pub fn with_formats( top_fb_fmt: FramebufferFormat, diff --git a/ctru-rs/src/services/hid.rs b/ctru-rs/src/services/hid.rs index b592f6a..79bb6df 100644 --- a/ctru-rs/src/services/hid.rs +++ b/ctru-rs/src/services/hid.rs @@ -1,4 +1,4 @@ -//! HID service +//! Human-Interface Device service. //! //! The HID service provides access to user input such as button presses, touch screen presses, //! and circle pad information. It also provides information from the sound volume slider, @@ -79,7 +79,7 @@ bitflags! { pub struct Hid(()); impl Hid { - /// Initializes the HID service. + /// Initialize a new service handle. /// /// # Errors /// diff --git a/ctru-rs/src/services/ps.rs b/ctru-rs/src/services/ps.rs index 6f8c67c..fc108fd 100644 --- a/ctru-rs/src/services/ps.rs +++ b/ctru-rs/src/services/ps.rs @@ -1,4 +1,6 @@ -//! Process Services (PS) module. This is used for miscellaneous utility tasks, but +//! Process Services. +//! +//! This is used for miscellaneous utility tasks, but //! is particularly important because it is used to generate random data, which //! is required for common things like [`HashMap`](std::collections::HashMap). //! See also diff --git a/ctru-rs/src/services/romfs.rs b/ctru-rs/src/services/romfs.rs index c8719a2..c1c2d9e 100644 --- a/ctru-rs/src/services/romfs.rs +++ b/ctru-rs/src/services/romfs.rs @@ -1,4 +1,4 @@ -//! Read-Only Memory FileSystem +//! Read-Only Memory FileSystem service. //! //! This module only gets compiled if the configured RomFS directory is found and the `romfs` //! feature is enabled. @@ -31,7 +31,7 @@ pub struct RomFS { static ROMFS_ACTIVE: Mutex = Mutex::new(0); impl RomFS { - /// Mounts the specified RomFS folder as a virtual drive. + /// Mount the specified RomFS folder as a virtual drive. #[doc(alias = "romfsMountSelf")] pub fn new() -> crate::Result { let _service_handler = ServiceReference::new( diff --git a/ctru-rs/src/services/soc.rs b/ctru-rs/src/services/soc.rs index 2bbfe50..aa450be 100644 --- a/ctru-rs/src/services/soc.rs +++ b/ctru-rs/src/services/soc.rs @@ -1,4 +1,4 @@ -//! Network Socket +//! Network Socket service. use libc::memalign; use std::net::Ipv4Addr; @@ -20,11 +20,11 @@ pub struct Soc { static SOC_ACTIVE: Mutex = Mutex::new(0); impl Soc { - /// Initialize the Soc service with a default buffer size of 0x100000 bytes + /// Initialize a new service handle using a socket buffer size of 0x100000 bytes. /// /// # Errors /// - /// This function will return an error if the `Soc` service is already initialized + /// This function will return an error if the [`Soc`] service is already initialized #[doc(alias = "socInit")] pub fn new() -> crate::Result { Self::init_with_buffer_size(0x100000) @@ -35,7 +35,7 @@ impl Soc { /// /// # Errors /// - /// This function will return an error if the `Soc` service is already initialized + /// This function will return an error if the [`Soc`] service is already initialized #[doc(alias = "socInit")] pub fn init_with_buffer_size(num_bytes: usize) -> crate::Result { let _service_handler = ServiceReference::new( diff --git a/ctru-rs/src/services/sslc.rs b/ctru-rs/src/services/sslc.rs index 9b311e3..b13fac0 100644 --- a/ctru-rs/src/services/sslc.rs +++ b/ctru-rs/src/services/sslc.rs @@ -1,4 +1,4 @@ -//! SSLC (TLS) service +//! SSLC (TLS) service. // TODO: Implement remaining functions @@ -8,7 +8,7 @@ use crate::error::ResultCode; pub struct SslC(()); impl SslC { - /// Initialize the service + /// Initialize a new service handle. #[doc(alias = "sslcInit")] pub fn new() -> crate::Result { unsafe { From fde168cb17147be26394bd4a8e8a8f443cc217c0 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sat, 22 Jul 2023 17:41:23 +0200 Subject: [PATCH 033/101] Finish up SSLC, SOC, ROMFS and PS --- ctru-rs/src/applets/mii_selector.rs | 14 ++--- ctru-rs/src/applets/swkbd.rs | 18 +++--- ctru-rs/src/services/am.rs | 20 +++---- ctru-rs/src/services/apt.rs | 12 ++-- ctru-rs/src/services/gfx.rs | 2 +- ctru-rs/src/services/ps.rs | 75 +++++++++++++++++++++-- ctru-rs/src/services/romfs.rs | 33 ++++++++--- ctru-rs/src/services/soc.rs | 92 ++++++++++++++++++++++++----- ctru-rs/src/services/sslc.rs | 14 +++++ 9 files changed, 219 insertions(+), 61 deletions(-) diff --git a/ctru-rs/src/applets/mii_selector.rs b/ctru-rs/src/applets/mii_selector.rs index 0562777..76a4d5e 100644 --- a/ctru-rs/src/applets/mii_selector.rs +++ b/ctru-rs/src/applets/mii_selector.rs @@ -96,7 +96,7 @@ impl MiiSelector { /// This function will panic if the given `&str` contains NUL bytes. /// /// # Example - /// + /// /// ```no_run /// # fn main() { /// use ctru::applets::mii_selector::MiiSelector; @@ -120,7 +120,7 @@ impl MiiSelector { /// This will overwrite any previously saved options. Use bitwise operations to set all your wanted options at once. /// /// # Example - /// + /// /// ```no_run /// # fn main() { /// use ctru::applets::mii_selector::{MiiSelector, Options}; @@ -144,7 +144,7 @@ impl MiiSelector { /// Look into [`MiiSelector::set_options()`] to see how to work with options. /// /// # Example - /// + /// /// ```no_run /// # fn main() { /// # @@ -173,7 +173,7 @@ impl MiiSelector { /// Look into [`MiiSelector::set_options()`] to see how to work with options. /// /// # Example - /// + /// /// ```no_run /// # fn main() { /// # @@ -197,7 +197,7 @@ impl MiiSelector { /// Whitelist a user-created Mii based on its index. /// /// # Example - /// + /// /// ```no_run /// # fn main() { /// # @@ -221,7 +221,7 @@ impl MiiSelector { /// Blacklist a user-created Mii based on its index. /// /// # Example - /// + /// /// ```no_run /// # fn main() { /// # @@ -259,7 +259,7 @@ impl MiiSelector { /// TODO: UNSAFE OPERATION, LAUNCHING APPLETS REQUIRES GRAPHICS, WITHOUT AN ACTIVE GFX THIS WILL CAUSE A SEGMENTATION FAULT. /// /// # Example - /// + /// /// ```no_run /// # use std::error::Error; /// # fn main() -> Result<(), Box> { diff --git a/ctru-rs/src/applets/swkbd.rs b/ctru-rs/src/applets/swkbd.rs index 879c434..f20819b 100644 --- a/ctru-rs/src/applets/swkbd.rs +++ b/ctru-rs/src/applets/swkbd.rs @@ -158,7 +158,7 @@ impl SoftwareKeyboard { /// Initialize a new configuration for the Software Keyboard applet depending on how many "exit" buttons are available to the user (1, 2 or 3). /// /// # Example - /// + /// /// ```no_run /// # fn main() { /// # @@ -189,7 +189,7 @@ impl SoftwareKeyboard { /// TODO: UNSAFE OPERATION, LAUNCHING APPLETS REQUIRES GRAPHICS, WITHOUT AN ACTIVE GFX THIS WILL CAUSE A SEGMENTATION FAULT. /// /// # Example - /// + /// /// ```no_run /// # use std::error::Error; /// # fn main() -> Result<(), Box> { @@ -233,7 +233,7 @@ impl SoftwareKeyboard { /// TODO: UNSAFE OPERATION, LAUNCHING APPLETS REQUIRES GRAPHICS, WITHOUT AN ACTIVE GFX THIS WILL CAUSE A SEGMENTATION FAULT. /// /// # Example - /// + /// /// ```no_run /// # use std::error::Error; /// # fn main() -> Result<(), Box> { @@ -264,7 +264,7 @@ impl SoftwareKeyboard { /// Set special features for this keyboard. /// /// # Example - /// + /// /// ```no_run /// # fn main() { /// # @@ -284,7 +284,7 @@ impl SoftwareKeyboard { /// Configure input validation for this keyboard. /// /// # Example - /// + /// /// ```no_run /// # fn main() { /// # @@ -307,7 +307,7 @@ impl SoftwareKeyboard { /// Configure the maximum number of digits that can be entered in the keyboard when the [`Filters::DIGITS`] flag is enabled. /// /// # Example - /// + /// /// ```no_run /// # fn main() { /// # @@ -334,7 +334,7 @@ impl SoftwareKeyboard { /// The hint text is the text shown in gray before any text gets written in the input box. /// /// # Example - /// + /// /// ```no_run /// # fn main() { /// # @@ -361,7 +361,7 @@ impl SoftwareKeyboard { /// - `submit` - whether pressing the button will accept the keyboard's input or discard it. /// /// # Example - /// + /// /// ```no_run /// # fn main() { /// # @@ -400,7 +400,7 @@ impl SoftwareKeyboard { /// receivable by [`SoftwareKeyboard::get_string()`] and [`SoftwareKeyboard::write_exact()`]. /// /// # Example - /// + /// /// ```no_run /// # fn main() { /// # diff --git a/ctru-rs/src/services/am.rs b/ctru-rs/src/services/am.rs index d302448..e67282e 100644 --- a/ctru-rs/src/services/am.rs +++ b/ctru-rs/src/services/am.rs @@ -58,7 +58,7 @@ impl Am { /// Initialize a new service handle. /// /// # Example - /// + /// /// ```no_run /// # use std::error::Error; /// # fn main() -> Result<(), Box> { @@ -81,7 +81,7 @@ impl Am { /// Returns the amount of titles currently installed in a specific install location. /// /// # Example - /// + /// /// ```no_run /// # use std::error::Error; /// # fn main() -> Result<(), Box> { @@ -110,7 +110,7 @@ impl Am { /// Returns the list of titles installed in a specific install location. /// /// # Example - /// + /// /// ```no_run /// # use std::error::Error; /// # fn main() -> Result<(), Box> { @@ -157,14 +157,12 @@ impl Am { Ok(info .into_iter() - .map(|title| { - Title { - id: title.titleID, - mediatype, - size: title.size, - version: title.version, - _am: PhantomData, - } + .map(|title| Title { + id: title.titleID, + mediatype, + size: title.size, + version: title.version, + _am: PhantomData, }) .collect()) } diff --git a/ctru-rs/src/services/apt.rs b/ctru-rs/src/services/apt.rs index e885adf..1fba0e5 100644 --- a/ctru-rs/src/services/apt.rs +++ b/ctru-rs/src/services/apt.rs @@ -13,9 +13,9 @@ pub struct Apt(()); impl Apt { /// Initialize a new service handle. - /// + /// /// # Example - /// + /// /// ```no_run /// # use std::error::Error; /// # fn main() -> Result<(), Box> { @@ -43,20 +43,20 @@ impl Apt { /// For this reason, its main use is as the condition of a while loop that controls the main logic for your program. /// /// # Example - /// + /// /// ```no_run /// use std::error::Error; /// use ctru::services::apt::Apt; - /// + /// /// // In a simple `main` function, the structure should be the following. /// fn main() -> Result<(), Box> { /// /// let apt = Apt::new()?; - /// + /// /// while apt.main_loop() { /// // Main program logic should be written here. /// } - /// + /// /// // Optional clean-ups after running the application should be written after the main loop. /// # /// # Ok(()) diff --git a/ctru-rs/src/services/gfx.rs b/ctru-rs/src/services/gfx.rs index e6465e4..1e9a048 100644 --- a/ctru-rs/src/services/gfx.rs +++ b/ctru-rs/src/services/gfx.rs @@ -220,7 +220,7 @@ static GFX_ACTIVE: Mutex = Mutex::new(0); impl Gfx { /// Initialize a new default service handle. - /// + /// /// It's the same as calling: /// /// ```no_run diff --git a/ctru-rs/src/services/ps.rs b/ctru-rs/src/services/ps.rs index fc108fd..fc20a78 100644 --- a/ctru-rs/src/services/ps.rs +++ b/ctru-rs/src/services/ps.rs @@ -1,14 +1,15 @@ -//! Process Services. -//! -//! This is used for miscellaneous utility tasks, but -//! is particularly important because it is used to generate random data, which -//! is required for common things like [`HashMap`](std::collections::HashMap). +//! Process Services. +//! +//! This service handles miscellaneous utility tasks used by the various processes. +//! However, it is particularly important because it is used to generate cryptographically secure random data, which +//! is required for commonly used functionality such as hashing (e.g. [`HashMap`](std::collections::HashMap) will not work without it). +//! //! See also use crate::error::ResultCode; use crate::Result; -/// Kind of AES algorithm to use. +/// Type of AES algorithm to use. #[doc(alias = "PS_AESAlgorithm")] #[derive(Debug, Clone, Copy, PartialEq, Eq)] #[repr(u32)] @@ -59,6 +60,20 @@ pub struct Ps(()); impl Ps { /// Initialize a new service handle. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::ps::Ps; + /// + /// let ps = Ps::new()?; + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "psInit")] pub fn new() -> Result { unsafe { @@ -68,6 +83,21 @@ impl Ps { } /// Returns the console's local friend code seed. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::ps::Ps; + /// let ps = Ps::new()?; + /// + /// let friend_code_seed = ps.local_friend_code_seed()?; + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "PS_GetLocalFriendCodeSeed")] pub fn local_friend_code_seed(&self) -> crate::Result { let mut seed: u64 = 0; @@ -77,6 +107,21 @@ impl Ps { } /// Returns the console's devide ID. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::ps::Ps; + /// let ps = Ps::new()?; + /// + /// let device_id = ps.device_id()?; + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "PS_GetDeviceId")] pub fn device_id(&self) -> crate::Result { let mut id: u32 = 0; @@ -86,6 +131,24 @@ impl Ps { } /// Generates cryptografically secure random bytes and writes them into the `out` buffer. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::ps::Ps; + /// let ps = Ps::new()?; + /// + /// let mut buffer = vec![0; 128]; + /// + /// // The buffer is now randomized! + /// ps.generate_random_bytes(&mut buffer)?; + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "PS_GenerateRandomBytes")] pub fn generate_random_bytes(&self, out: &mut [u8]) -> crate::Result<()> { ResultCode(unsafe { diff --git a/ctru-rs/src/services/romfs.rs b/ctru-rs/src/services/romfs.rs index c1c2d9e..ad5429f 100644 --- a/ctru-rs/src/services/romfs.rs +++ b/ctru-rs/src/services/romfs.rs @@ -1,9 +1,14 @@ //! Read-Only Memory FileSystem service. //! +//! This service lets the application access a virtual mounted device created using a folder included within the application bundle. +//! After mounting the RomFS file system, the included files and folders will be accessible exactly like any other file, just by using the drive prefix `romfs:/`. +//! +//! # Usage +//! //! This module only gets compiled if the configured RomFS directory is found and the `romfs` //! feature is enabled. //! -//! Configure the path in Cargo.toml (the default path is "romfs"). Paths are relative to the +//! Configure the path in your project's `Cargo.toml` manifest (the default path is "romfs"). Paths are relative to the //! `CARGO_MANIFEST_DIR` environment variable, which is the directory containing the manifest of //! your package. //! @@ -11,6 +16,8 @@ //! [package.metadata.cargo-3ds] //! romfs_dir = "romfs" //! ``` +//! +//! Alternatively, you can include the RomFS archive manually when building with `3dsxtool`. use crate::error::ResultCode; use std::ffi::CStr; @@ -19,11 +26,6 @@ use std::sync::Mutex; use crate::services::ServiceReference; /// Handle to the RomFS service. -/// -/// This service lets the application access a virtual mounted device created using a folder included within the application bundle. -/// `ctru-rs` will include as RomFS the folder specified in the `Cargo.toml` manifest (or use `./romfs` by default). Look at the [`romfs`](self) module for more information. -/// -/// After mounting the RomFS file system, the included files and folders will be accessible exactly like any other file, just by using the drive prefix `romfs:/`. pub struct RomFS { _service_handler: ServiceReference, } @@ -31,7 +33,24 @@ pub struct RomFS { static ROMFS_ACTIVE: Mutex = Mutex::new(0); impl RomFS { - /// Mount the specified RomFS folder as a virtual drive. + /// Mount the bundled RomFS archive as a virtual drive. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::romfs::RomFS; + /// + /// let romfs = RomFS::new()?; + /// + /// // Remember to include the RomFS archive and to use your actual files! + /// let contents = std::fs::read_to_string("romfs:/test-file.txt"); + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "romfsMountSelf")] pub fn new() -> crate::Result { let _service_handler = ServiceReference::new( diff --git a/ctru-rs/src/services/soc.rs b/ctru-rs/src/services/soc.rs index aa450be..f9cc258 100644 --- a/ctru-rs/src/services/soc.rs +++ b/ctru-rs/src/services/soc.rs @@ -1,4 +1,7 @@ //! Network Socket service. +//! +//! By using this service the program enables the use of network sockets and utilities such as those found in `std::net`, which are completely inaccessible by default. +//! As such, remember to hold a handle to this service handle while using any network functionality, or else the `std::net` methods will return generic OS errors. use libc::memalign; use std::net::Ipv4Addr; @@ -8,10 +11,7 @@ use crate::error::ResultCode; use crate::services::ServiceReference; use crate::Error; -/// Network socket service -/// -/// Initializing this service will enable the use of network sockets and utilities -/// such as those found in `std::net`. The service will close once this struct gets dropped. +/// Handle to the Network Socket service. pub struct Soc { _service_handler: ServiceReference, sock_3dslink: libc::c_int, @@ -20,22 +20,51 @@ pub struct Soc { static SOC_ACTIVE: Mutex = Mutex::new(0); impl Soc { - /// Initialize a new service handle using a socket buffer size of 0x100000 bytes. + /// Initialize a new service handle using a socket buffer size of `0x100000` bytes. /// /// # Errors /// - /// This function will return an error if the [`Soc`] service is already initialized + /// This function will return an error if the [`Soc`] service is already being used. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::soc::Soc; + /// + /// let soc = Soc::new()?; + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "socInit")] pub fn new() -> crate::Result { Self::init_with_buffer_size(0x100000) } - /// Initialize the Soc service with a custom buffer size in bytes. The size should be - /// 0x100000 bytes or greater. + /// Initialize a new service handle using a custom socket buffer size. + /// + /// The size should be `0x100000` bytes or greater. /// /// # Errors /// - /// This function will return an error if the [`Soc`] service is already initialized + /// This function will return an error if the [`Soc`] service is already being used. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::soc::Soc; + /// + /// let soc = Soc::init_with_buffer_size(0x100000)?; + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "socInit")] pub fn init_with_buffer_size(num_bytes: usize) -> crate::Result { let _service_handler = ServiceReference::new( @@ -62,20 +91,55 @@ impl Soc { }) } - /// IP Address of the Nintendo 3DS system. + /// Returns the local IP Address of the Nintendo 3DS system. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::soc::Soc; + /// let soc = Soc::new()?; + /// + /// let address = soc.host_address(); + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "gethostid")] pub fn host_address(&self) -> Ipv4Addr { let raw_id = unsafe { libc::gethostid() }; Ipv4Addr::from(raw_id.to_ne_bytes()) } - /// Redirect output streams (i.e. [`println`] and [`eprintln`]) to the `3dslink` server. - /// Requires `3dslink` >= 0.6.1 and `new-hbmenu` >= 2.3.0. + /// Redirect output streams (i.e. `println` and `eprintln`) to the `3dslink` server. + /// + /// Requires `3dslink` >= 0.6.1 and `new-hbmenu` >= 2.3.0 and the use of the `--server` flag. + /// The `--server` flag is also availble to use via `cargo-3ds` if the requirements are met. /// /// # Errors /// - /// Returns an error if a connection cannot be established to the server, or - /// output was already previously redirected. + /// Returns an error if a connection cannot be established to the server, + /// or if the output was already being redirected. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::soc::Soc; + /// let mut soc = Soc::new()?; + /// + /// // Redirect to the `3dslink` server that sent this program. + /// let address = soc.redirect_to_3dslink(true, true)?; + /// + /// println!("I'm visible from a PC!"); + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "link3dsConnectToHost")] pub fn redirect_to_3dslink(&mut self, stdout: bool, stderr: bool) -> crate::Result<()> { if self.sock_3dslink >= 0 { diff --git a/ctru-rs/src/services/sslc.rs b/ctru-rs/src/services/sslc.rs index b13fac0..af8b65d 100644 --- a/ctru-rs/src/services/sslc.rs +++ b/ctru-rs/src/services/sslc.rs @@ -9,6 +9,20 @@ pub struct SslC(()); impl SslC { /// Initialize a new service handle. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::sslc::SslC; + /// + /// let sslc = SslC::new()?; + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "sslcInit")] pub fn new() -> crate::Result { unsafe { From db2bb7c7658d394e1b627876980450f43768c883 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sat, 22 Jul 2023 18:07:45 +0200 Subject: [PATCH 034/101] Finished HID and CFGU --- ctru-rs/src/services/cfgu.rs | 117 +++++++++++++++++++++++---- ctru-rs/src/services/hid.rs | 150 +++++++++++++++++++++++++++++++---- 2 files changed, 234 insertions(+), 33 deletions(-) diff --git a/ctru-rs/src/services/cfgu.rs b/ctru-rs/src/services/cfgu.rs index 9afbe7b..252b11f 100644 --- a/ctru-rs/src/services/cfgu.rs +++ b/ctru-rs/src/services/cfgu.rs @@ -4,7 +4,7 @@ use crate::error::ResultCode; -/// Console's region. +/// Console region. #[doc(alias = "CFG_Region")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] @@ -56,7 +56,7 @@ pub enum Language { TraditionalChinese = ctru_sys::CFG_LANGUAGE_TW, } -/// 3DS model. +/// Specific model of the console. #[doc(alias = "CFG_SystemModel")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] @@ -75,30 +75,47 @@ pub enum SystemModel { New2DSXL = ctru_sys::CFG_MODEL_N2DSXL, } -/// Represents the configuration service. No actions can be performed -/// until an instance of this struct is created. -/// -/// The service exits when all instances of this struct go out of scope. +/// Handle to the System Configuration service. pub struct Cfgu(()); impl Cfgu { /// Initialize a new service handle. /// - /// # Errors + /// # Example /// - /// This function will return Err if there was an error initializing the - /// CFGU service. + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::cfgu::Cfgu; /// - /// ctrulib services are reference counted, so this function may be called - /// as many times as desired and the service will not exit until all - /// instances of Cfgu drop out of scope. + /// let cfgu = Cfgu::new()?; + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "cfguInit")] pub fn new() -> crate::Result { ResultCode(unsafe { ctru_sys::cfguInit() })?; Ok(Cfgu(())) } - /// Gets system region from secure info + /// Returns the console's region from the system's secure info. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::cfgu::Cfgu; + /// let cfgu = Cfgu::new()?; + /// + /// let region = cfgu.region()?; + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "CFGU_SecureInfoGetRegion")] pub fn region(&self) -> crate::Result { let mut region: u8 = 0; @@ -107,7 +124,22 @@ impl Cfgu { Ok(Region::try_from(region).unwrap()) } - /// Gets system's model + /// Returns the console's model. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::cfgu::Cfgu; + /// let cfgu = Cfgu::new()?; + /// + /// let model = cfgu.model()?; + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "CFGU_GetSystemModel")] pub fn model(&self) -> crate::Result { let mut model: u8 = 0; @@ -116,7 +148,22 @@ impl Cfgu { Ok(SystemModel::try_from(model).unwrap()) } - /// Gets system's language + /// Returns the system language set for the console. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::cfgu::Cfgu; + /// let cfgu = Cfgu::new()?; + /// + /// let language = cfgu.language()?; + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "CFGU_GetSystemLanguage")] pub fn language(&self) -> crate::Result { let mut language: u8 = 0; @@ -125,7 +172,24 @@ impl Cfgu { Ok(Language::try_from(language).unwrap()) } - /// Checks if NFC is supported by the console + /// Check if NFC is supported by the console. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::cfgu::Cfgu; + /// let cfgu = Cfgu::new()?; + /// + /// if cfgu.is_nfc_supported()? { + /// println!("NFC is available!"); + /// } + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "CFGU_IsNFCSupported")] pub fn is_nfc_supported(&self) -> crate::Result { let mut supported: bool = false; @@ -134,7 +198,26 @@ impl Cfgu { Ok(supported) } - /// Check if the console is from the 2DS family (2DS, New2DS, New2DSXL) + /// Check if the console is from the 2DS family ([`Old2DS`](SystemModel::Old2DS), [`New2DSXL`](SystemModel::New2DSXL)). + /// + /// Useful to avoid stereoscopic 3D rendering when working with 2DS consoles. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::cfgu::Cfgu; + /// let cfgu = Cfgu::new()?; + /// + /// if cfgu.is_2ds_family()? { + /// println!("Stereoscopic 3D is not supported."); + /// } + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "CFGU_GetModelNintendo2DS")] pub fn is_2ds_family(&self) -> crate::Result { let mut is_2ds_family: u8 = 0; diff --git a/ctru-rs/src/services/hid.rs b/ctru-rs/src/services/hid.rs index 79bb6df..fc73612 100644 --- a/ctru-rs/src/services/hid.rs +++ b/ctru-rs/src/services/hid.rs @@ -1,15 +1,14 @@ -//! Human-Interface Device service. +//! Human Interface Device service. //! -//! The HID service provides access to user input such as button presses, touch screen presses, -//! and circle pad information. It also provides information from the sound volume slider, -//! the accelerometer, and the gyroscope. +//! The HID service provides read access to user input such as [button presses](Hid::keys_down), [touch screen presses](Hid::touch_position), +//! and [circle pad information](Hid::circlepad_position). It also provides information from the sound volume slider, the accelerometer, and the gyroscope. +// TODO: Implement volume slider, accelerometer and gyroscope + any other missing functionality. use crate::error::ResultCode; use bitflags::bitflags; bitflags! { - /// A set of flags corresponding to the button and directional pad - /// inputs on the 3DS + /// A set of flags corresponding to the button and directional pad inputs present on the 3DS. #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)] pub struct KeyPad: u32 { /// A button. @@ -72,10 +71,7 @@ bitflags! { } } -/// A reference-counted handle to the HID service. The service is closed -/// when all instances of this struct fall out of scope. -/// -/// This service requires no special permissions to use. +/// Handle to the HID service. pub struct Hid(()); impl Hid { @@ -84,8 +80,21 @@ impl Hid { /// # Errors /// /// This function will return an error if the service was unable to be initialized. - /// Since this service requires no special or elevated permissions, errors are - /// rare in practice. + /// Since this service requires no special or elevated permissions, errors are rare in practice. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::hid::Hid; + /// + /// let hid = Hid::new()?; + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "hidInit")] pub fn new() -> crate::Result { unsafe { @@ -94,9 +103,25 @@ impl Hid { } } - /// Scans the HID service for all user input occurring on the current - /// frame. This function should be called on every frame when polling + /// Scan the HID service for all user input occurring on the current frame. + /// + /// This function should be called on every frame when polling /// for user input. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::hid::Hid; + /// let mut hid = Hid::new()?; + /// + /// hid.scan_input(); + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "hidScanInput")] pub fn scan_input(&mut self) { unsafe { ctru_sys::hidScanInput() }; @@ -104,6 +129,25 @@ impl Hid { /// Returns a bitflag struct representing which buttons have just been pressed /// on the current frame (and were not pressed on the previous frame). + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::hid::{Hid, KeyPad}; + /// let mut hid = Hid::new()?; + /// + /// hid.scan_input(); + /// + /// if hid.keys_down().contains(KeyPad::A) { + /// println!("You just pressed the A button!") + /// } + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "hidKeysDown")] pub fn keys_down(&self) -> KeyPad { unsafe { @@ -114,6 +158,25 @@ impl Hid { /// Returns a bitflag struct representing which buttons have been held down /// during the current frame. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::hid::{Hid, KeyPad}; + /// let mut hid = Hid::new()?; + /// + /// hid.scan_input(); + /// + /// if hid.keys_held().contains(KeyPad::START) { + /// println!("You are holding the START button!") + /// } + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "hidKeysHeld")] pub fn keys_held(&self) -> KeyPad { unsafe { @@ -124,6 +187,25 @@ impl Hid { /// Returns a bitflag struct representing which buttons have just been released on /// the current frame. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::hid::{Hid, KeyPad}; + /// let mut hid = Hid::new()?; + /// + /// hid.scan_input(); + /// + /// if hid.keys_held().contains(KeyPad::B) { + /// println!("You have released the B button!") + /// } + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "hidKeysUp")] pub fn keys_up(&self) -> KeyPad { unsafe { @@ -137,13 +219,31 @@ impl Hid { /// # Notes /// /// (0, 0) represents the top left corner of the screen. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::hid::Hid; + /// let mut hid = Hid::new()?; + /// + /// hid.scan_input(); + /// + /// let (touch_x, touch_y) = hid.touch_position(); + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "hidTouchRead")] - pub fn touch_position(&mut self) -> (u16, u16) { + pub fn touch_position(&self) -> (u16, u16) { let mut res = ctru_sys::touchPosition { px: 0, py: 0 }; unsafe { ctru_sys::hidTouchRead(&mut res); } + (res.px, res.py) } @@ -152,13 +252,31 @@ impl Hid { /// # Notes /// /// (0, 0) represents the center of the circle pad. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::hid::Hid; + /// let mut hid = Hid::new()?; + /// + /// hid.scan_input(); + /// + /// let (pad_x, pad_y) = hid.circlepad_position(); + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "hidCircleRead")] - pub fn circlepad_position(&mut self) -> (i16, i16) { + pub fn circlepad_position(&self) -> (i16, i16) { let mut res = ctru_sys::circlePosition { dx: 0, dy: 0 }; unsafe { ctru_sys::hidCircleRead(&mut res); } + (res.dx, res.dy) } } From 1245860abaedf6457e53f4396ba4975d44bb2f1b Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sat, 22 Jul 2023 20:03:01 +0200 Subject: [PATCH 035/101] Finish up GFX --- ctru-rs/src/services/fs.rs | 18 ++--- ctru-rs/src/services/gfx.rs | 138 ++++++++++++++++++++++++++++----- ctru-rs/src/services/gspgpu.rs | 2 +- 3 files changed, 127 insertions(+), 31 deletions(-) diff --git a/ctru-rs/src/services/fs.rs b/ctru-rs/src/services/fs.rs index 446be7e..464d980 100644 --- a/ctru-rs/src/services/fs.rs +++ b/ctru-rs/src/services/fs.rs @@ -19,23 +19,23 @@ use widestring::{WideCStr, WideCString}; bitflags! { #[derive(Default, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)] struct FsOpen: u32 { - const FS_OPEN_READ = 1; - const FS_OPEN_WRITE = 2; - const FS_OPEN_CREATE = 4; + const FS_OPEN_READ = ctru_sys::FS_OPEN_READ; + const FS_OPEN_WRITE = ctru_sys::FS_OPEN_WRITE; + const FS_OPEN_CREATE = ctru_sys::FS_OPEN_CREATE; } #[derive(Default, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)] struct FsWrite: u32 { - const FS_WRITE_FLUSH = 1; - const FS_WRITE_UPDATE_TIME = 256; + const FS_WRITE_FLUSH = ctru_sys::FS_WRITE_FLUSH; + const FS_WRITE_UPDATE_TIME = ctru_sys::FS_WRITE_UPDATE_TIME; } #[derive(Default, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)] struct FsAttribute: u32 { - const FS_ATTRIBUTE_DIRECTORY = 1; - const FS_ATTRIBUTE_HIDDEN = 256; - const FS_ATTRIBUTE_ARCHIVE = 65536; - const FS_ATTRIBUTE_READ_ONLY = 16777216; + const FS_ATTRIBUTE_DIRECTORY = ctru_sys::FS_ATTRIBUTE_DIRECTORY; + const FS_ATTRIBUTE_HIDDEN = ctru_sys::FS_ATTRIBUTE_HIDDEN; + const FS_ATTRIBUTE_ARCHIVE = ctru_sys::FS_ATTRIBUTE_ARCHIVE; + const FS_ATTRIBUTE_READ_ONLY = ctru_sys::FS_ATTRIBUTE_READ_ONLY; } } diff --git a/ctru-rs/src/services/gfx.rs b/ctru-rs/src/services/gfx.rs index 1e9a048..5a2fc62 100644 --- a/ctru-rs/src/services/gfx.rs +++ b/ctru-rs/src/services/gfx.rs @@ -1,4 +1,7 @@ //! Graphics service. +//! +//! The GFX service controls (in a somewhat high-level way) the console's LCD screens. +//! The screens are subordinate to the GFX service handle and can be used by only one borrower at a time. use std::cell::{Ref, RefCell, RefMut}; use std::marker::PhantomData; @@ -20,6 +23,8 @@ mod private { impl Sealed for BottomScreen {} } +/// Trait to handle common functionality for all screens. +/// /// This trait is implemented by the screen structs for working with frame buffers and /// drawing to the screens. Graphics-related code can be made generic over this /// trait to work with any of the given screens. @@ -75,28 +80,33 @@ pub trait Screen: private::Sealed { } } -/// The top screen. Mutable access to this struct is required to write to the top -/// screen's frame buffer. To enable 3D mode, it can be converted into a [`TopScreen3D`]. +/// The top LCD screen. +/// +/// Mutable access to this struct is required to write to the top screen's frame buffer. +/// +/// To enable 3D mode, it can be converted into a [`TopScreen3D`]. pub struct TopScreen { left: TopScreenLeft, right: TopScreenRight, } +/// The top LCD screen set in stereoscopic 3D mode. +/// /// A helper container for both sides of the top screen. Once the [`TopScreen`] is /// converted into this, 3D mode will be enabled until this struct is dropped. pub struct TopScreen3D<'screen> { screen: &'screen RefCell, } -/// A screen that can have its frame buffers swapped, if double buffering is enabled. +/// Trait for screens that can have its frame buffers swapped, when double buffering is enabled. /// /// This trait applies to all [`Screen`]s that have swappable frame buffers. pub trait Swap: private::Sealed { /// Swaps the video buffers. /// - /// If double buffering is disabled, "swapping" the buffers has the side effect - /// of committing any configuration changes to the buffers (e.g. [`TopScreen::set_wide_mode`], - /// [`Screen::set_framebuffer_format`], [`Screen::set_double_buffering`]). + /// Even if double buffering is disabled, "swapping" the buffers has the side effect + /// of committing any configuration changes to the buffers (e.g. [`TopScreen::set_wide_mode()`], + /// [`Screen::set_framebuffer_format()`], [`Screen::set_double_buffering()`]), so it should still be used. /// /// This should be called once per frame at most. #[doc(alias = "gfxScreenSwapBuffers")] @@ -127,11 +137,13 @@ impl Swap for BottomScreen { } } -/// A screen with buffers that can be flushed. This trait applies to any [`Screen`] -/// that has data written to its frame buffer. +/// A screen with buffers that can be flushed. +/// +/// This trait applies to any [`Screen`] that has data written to its frame buffer. pub trait Flush: private::Sealed { - /// Flushes the video buffer(s) for this screen. Note that you must still call - /// [`Swap::swap_buffers`] after this method for the buffer contents to be displayed. + /// Flushes the video buffer(s) for this screen. + /// + /// Note that you must still call [`Swap::swap_buffers`] after this method for the buffer contents to be displayed. #[doc(alias = "gfxFlushBuffers")] fn flush_buffers(&mut self); } @@ -170,14 +182,16 @@ pub struct TopScreenLeft; #[non_exhaustive] pub struct TopScreenRight; -/// The bottom screen. Mutable access to this struct is required to write to the -/// bottom screen's frame buffer. +/// The bottom LCD screen. +/// +/// Mutable access to this struct is required to write to the bottom screen's frame buffer. #[derive(Debug)] #[non_exhaustive] pub struct BottomScreen; -/// Representation of a framebuffer for one [`Side`] of the top screen, or the -/// entire bottom screen. The inner pointer is only valid for one frame if double +/// Representation of a framebuffer for one [`Side`] of the top screen, or the entire bottom screen. +/// +/// The inner pointer is only valid for one frame if double /// buffering is enabled. Data written to `ptr` will be rendered to the screen. #[derive(Debug)] pub struct RawFrameBuffer<'screen> { @@ -191,7 +205,7 @@ pub struct RawFrameBuffer<'screen> { screen: PhantomData<&'screen mut dyn Screen>, } -/// Side of top screen framebuffer +/// Side of the [`TopScreen`]'s framebuffer. /// /// The top screen of the 3DS can have two separate sets of framebuffers to support its 3D functionality #[doc(alias = "gfx3dSide_t")] @@ -204,10 +218,10 @@ pub enum Side { Right = ctru_sys::GFX_RIGHT, } -/// A handle to libctru's gfx module. This module is a wrapper around the GSPGPU service that -/// provides helper functions and utilities for software rendering. +/// Handle to the GFX service. /// -/// The service exits when this struct is dropped. +/// This service is a wrapper around the lower-level [GSPGPU](crate::services::gspgpu) service that +/// provides helper functions and utilities for software rendering. pub struct Gfx { /// Top screen representation. pub top_screen: RefCell, @@ -221,6 +235,8 @@ static GFX_ACTIVE: Mutex = Mutex::new(0); impl Gfx { /// Initialize a new default service handle. /// + /// # Notes + /// /// It's the same as calling: /// /// ```no_run @@ -228,9 +244,23 @@ impl Gfx { /// # fn main() -> Result<(), Box> { /// # /// # use ctru::services::gfx::Gfx; - /// use ctru::services::gspgpu::FramebufferFormat; + /// # use ctru::services::gspgpu::FramebufferFormat; + /// # + /// Gfx::with_formats(FramebufferFormat::Bgr8, FramebufferFormat::Bgr8, false)?; + /// # + /// # Ok(()) + /// # } + /// ``` + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::gfx::Gfx; /// - /// Gfx::with_formats(FramebufferFormat::Bgr8, FramebufferFormat::Bgr8, false); + /// let gfx = Gfx::new()?; /// # /// # Ok(()) /// # } @@ -243,6 +273,22 @@ impl Gfx { /// Initialize a new service handle with the chosen framebuffer formats for the top and bottom screens. /// /// Use [`Gfx::new()`] instead of this function to initialize the module with default parameters + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::{gfx::Gfx, gspgpu::FramebufferFormat}; + /// + /// // Top screen uses RGBA8, bottom screen uses RGB565. + /// // The screen buffers are allocated in the standard HEAP memory, and not in VRAM. + /// let gfx = Gfx::with_formats(FramebufferFormat::Rgba8, FramebufferFormat::Rgb565, false)?; + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "gfxInit")] pub fn with_formats( top_fb_fmt: FramebufferFormat, @@ -267,9 +313,32 @@ impl Gfx { }) } - /// Waits for the vertical blank interrupt + /// Waits for the vertical blank event. /// /// Use this to synchronize your application with the refresh rate of the LCD screens + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::{apt::Apt, gfx::Gfx}; + /// let apt = Apt::new()?; + /// let gfx = Gfx::new()?; + /// + /// // Simple main loop. + /// while apt.main_loop() { + /// // Main program logic + /// + /// // Wait for the screens to refresh. + /// // This blocks the current thread to make it run at 60Hz. + /// gfx.wait_for_vblank(); + /// } + /// # + /// # Ok(()) + /// # } + /// ``` pub fn wait_for_vblank(&self) { gspgpu::wait_for_event(gspgpu::Event::VBlank0, true); } @@ -289,6 +358,33 @@ impl TopScreen3D<'_> { } } +/// Convert the [`TopScreen`] into a [`TopScreen3D`] and activate stereoscopic 3D. +/// +/// # Example +/// +/// ```no_run +/// # use std::error::Error; +/// # fn main() -> Result<(), Box> { +/// # +/// use ctru::services::gfx::{Gfx, TopScreen, TopScreen3D}; +/// let gfx = Gfx::new()?; +/// +/// let mut top_screen = TopScreen3D::from(&gfx.top_screen); +/// +/// let (left, right) = top_screen.split_mut(); +/// +/// // Rendering must be done twice for each side +/// // (with a slight variation in perspective to simulate the eye-to-eye distance). +/// render(left); +/// render(right); +/// # +/// # Ok(()) +/// # } +/// # +/// # use ctru::services::gfx::Screen; +/// # use std::cell::RefMut; +/// # fn render(screen: RefMut<'_, dyn Screen>) {} +/// ``` impl<'screen> From<&'screen RefCell> for TopScreen3D<'screen> { #[doc(alias = "gfxSet3D")] fn from(top_screen: &'screen RefCell) -> Self { diff --git a/ctru-rs/src/services/gspgpu.rs b/ctru-rs/src/services/gspgpu.rs index cb3e67c..81872d0 100644 --- a/ctru-rs/src/services/gspgpu.rs +++ b/ctru-rs/src/services/gspgpu.rs @@ -22,7 +22,7 @@ pub enum Event { } #[doc(alias = "GSPGPU_FramebufferFormat")] -/// Framebuffer formats supported by the 3DS. +/// Framebuffer formats supported by the 3DS' screens. #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum FramebufferFormat { From 3085b3e1c2c40d78a555b43fa8544e4dfeaef6be Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Tue, 25 Jul 2023 12:34:38 +0200 Subject: [PATCH 036/101] Docs-rs rules for ctru-sys --- ctru-sys/Cargo.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ctru-sys/Cargo.toml b/ctru-sys/Cargo.toml index 1420ebe..c6bb12f 100644 --- a/ctru-sys/Cargo.toml +++ b/ctru-sys/Cargo.toml @@ -16,3 +16,7 @@ libc = { version = "0.2.121", default-features = false } [build-dependencies] which = "4.4.0" + +[package.metadata.docs.rs] +default-target = "armv6k-nintendo-3ds" +cargo-args = ["-Z", "build-std"] From ef4860cf69b93d1438da93cccce2631c180b23a7 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Tue, 25 Jul 2023 16:01:47 +0200 Subject: [PATCH 037/101] Finalize NDSP and Wave --- ctru-rs/examples/audio-filters.rs | 4 +- ctru-rs/src/services/ndsp/mod.rs | 323 +++++++++++++++++++++++++++--- ctru-rs/src/services/ndsp/wave.rs | 61 +++++- 3 files changed, 347 insertions(+), 41 deletions(-) diff --git a/ctru-rs/examples/audio-filters.rs b/ctru-rs/examples/audio-filters.rs index 3ef76a6..34fa470 100644 --- a/ctru-rs/examples/audio-filters.rs +++ b/ctru-rs/examples/audio-filters.rs @@ -5,7 +5,7 @@ use std::f32::consts::PI; use ctru::linear::LinearAllocator; use ctru::prelude::*; use ctru::services::ndsp::{ - wave::{Wave, WaveStatus}, + wave::{Status, Wave}, AudioFormat, AudioMix, InterpolationType, Ndsp, OutputMode, }; @@ -146,7 +146,7 @@ fn main() { }; let status = current.status(); - if let WaveStatus::Done = status { + if let Status::Done = status { fill_buffer(current.get_buffer_mut().unwrap(), NOTEFREQ[note]); channel_zero.queue_wave(current).unwrap(); diff --git a/ctru-rs/src/services/ndsp/mod.rs b/ctru-rs/src/services/ndsp/mod.rs index f815fdb..fc76584 100644 --- a/ctru-rs/src/services/ndsp/mod.rs +++ b/ctru-rs/src/services/ndsp/mod.rs @@ -1,7 +1,11 @@ //! NDSP (Audio) service. +//! +//! The NDSP service is used to handle communications to the DSP processor present on the console's motherboard. +//! Thanks to the DSP processor the program can play sound effects and music on the console's built-in speakers or to any audio device +//! connected via the audio jack. pub mod wave; -use wave::{Wave, WaveStatus}; +use wave::{Status, Wave}; use crate::error::ResultCode; use crate::services::ServiceReference; @@ -27,7 +31,7 @@ pub enum OutputMode { Surround = ctru_sys::NDSP_OUTPUT_SURROUND, } -/// Audio PCM format. +/// PCM formats supported by the audio engine. #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum AudioFormat { @@ -35,13 +39,13 @@ pub enum AudioFormat { PCM8Mono = ctru_sys::NDSP_FORMAT_MONO_PCM8, /// PCM 16bit single-channel. PCM16Mono = ctru_sys::NDSP_FORMAT_MONO_PCM16, - /// PCM 8bit dual-channel. + /// PCM 8bit interleaved dual-channel. PCM8Stereo = ctru_sys::NDSP_FORMAT_STEREO_PCM8, - /// PCM 16bit dual-channel. + /// PCM 16bit interleaved dual-channel. PCM16Stereo = ctru_sys::NDSP_FORMAT_STEREO_PCM16, } -/// Representation of volume mix for a channel. +/// Representation of the volume mix for a channel. #[derive(Copy, Clone, Debug, PartialEq)] pub struct AudioMix { raw: [f32; 12], @@ -60,16 +64,16 @@ pub enum InterpolationType { None = ctru_sys::NDSP_INTERP_NONE, } -/// Error enum returned by NDSP methods. +/// Errors returned by [`ndsp`](self) functions. #[derive(Copy, Clone, Debug, PartialEq, Eq)] pub enum NdspError { - /// Channel ID + /// Channel with the specified ID does not exist. InvalidChannel(u8), - /// Channel ID + /// Channel with the specified ID is already being used. ChannelAlreadyInUse(u8), - /// Channel ID + /// The wave is already busy playing in the channel with the specified ID. WaveBusy(u8), - /// Sample amount requested, Max sample amount + /// The sample amount requested was larger than the maximum. SampleCountOutOfBounds(usize, usize), } @@ -79,13 +83,15 @@ pub enum NdspError { /// /// # Default /// -/// NDSP initialises all channels with default values on creation, but the developer is supposed to change these values to correctly work with the service. +/// NDSP initialises all channels with default values on initialization, but the developer is supposed to change these values to correctly work with the service. /// /// In particular: /// - Default audio format is set to [`AudioFormat::PCM16Mono`]. /// - Default sample rate is set to 1 Hz. /// - Default interpolation type is set to [`InterpolationType::Polyphase`]. /// - Default mix is set to [`AudioMix::default()`] +/// +/// The handle to a channel can be retrieved with [`Ndsp::channel()`] pub struct Channel<'ndsp> { id: u8, _rf: RefMut<'ndsp, ()>, // we don't need to hold any data @@ -93,10 +99,9 @@ pub struct Channel<'ndsp> { static NDSP_ACTIVE: Mutex = Mutex::new(0); -/// Handler of the DSP service and DSP processor. +/// Handle to the DSP service. /// -/// This is the main struct to handle audio playback using the 3DS' speakers and headphone jack. -/// Only one "instance" of this struct can exist at a time. +/// Only one handle for this service can exist at a time. pub struct Ndsp { _service_handler: ServiceReference, channel_flags: [RefCell<()>; NUMBER_OF_CHANNELS as usize], @@ -107,8 +112,22 @@ impl Ndsp { /// /// # Errors /// - /// This function will return an error if an instance of the `Ndsp` struct already exists + /// This function will return an error if an instance of the [`Ndsp`] struct already exists /// or if there are any issues during initialization. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::ndsp::Ndsp; + /// + /// let ndsp = Ndsp::new()?; + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "ndspInit")] pub fn new() -> crate::Result { let _service_handler = ServiceReference::new( @@ -135,6 +154,21 @@ impl Ndsp { /// # Errors /// /// An error will be returned if the channel ID is not between 0 and 23 or if the specified channel is already being used. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::ndsp::Ndsp; + /// let ndsp = Ndsp::new()?; + /// + /// let channel_0 = ndsp.channel(0)?; + /// # + /// # Ok(()) + /// # } + /// ``` pub fn channel(&self, id: u8) -> std::result::Result { let in_bounds = self.channel_flags.get(id as usize); @@ -150,7 +184,23 @@ impl Ndsp { } } - /// Set the audio output mode. Defaults to `OutputMode::Stereo`. + /// Set the audio output mode. Defaults to [`OutputMode::Stereo`]. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::ndsp::{Ndsp, OutputMode}; + /// let mut ndsp = Ndsp::new()?; + /// + /// // Use dual-channel output. + /// ndsp.set_output_mode(OutputMode::Stereo); + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "ndspSetOutputMode")] pub fn set_output_mode(&mut self, mode: OutputMode) { unsafe { ctru_sys::ndspSetOutputMode(mode.into()) }; @@ -158,31 +208,114 @@ impl Ndsp { } impl Channel<'_> { - /// Reset the channel + /// Reset the channel (clear the queue and reset parameters). + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::ndsp::Ndsp; + /// let ndsp = Ndsp::new()?; + /// let mut channel_0 = ndsp.channel(0)?; + /// + /// channel_0.reset(); + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "ndspChnReset")] pub fn reset(&mut self) { unsafe { ctru_sys::ndspChnReset(self.id.into()) }; } - /// Initialize the channel's parameters + /// Initialize the channel's parameters with default values. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::ndsp::Ndsp; + /// let ndsp = Ndsp::new()?; + /// let mut channel_0 = ndsp.channel(0)?; + /// + /// channel_0.init_parameters(); + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "ndspChnInitParams")] - pub fn init_parameters(&self) { + pub fn init_parameters(&mut self) { unsafe { ctru_sys::ndspChnInitParams(self.id.into()) }; } /// Returns whether the channel is playing any audio. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::ndsp::Ndsp; + /// let ndsp = Ndsp::new()?; + /// let mut channel_0 = ndsp.channel(0)?; + /// + /// // The channel is not playing any audio. + /// assert!(!channel_0.is_playing()); + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "ndspChnIsPlaying")] pub fn is_playing(&self) -> bool { unsafe { ctru_sys::ndspChnIsPlaying(self.id.into()) } } /// Returns whether the channel's playback is currently paused. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::ndsp::Ndsp; + /// let ndsp = Ndsp::new()?; + /// let mut channel_0 = ndsp.channel(0)?; + /// + /// // The channel is not paused. + /// assert!(!channel_0.is_paused()); + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "ndspChnIsPaused")] pub fn is_paused(&self) -> bool { unsafe { ctru_sys::ndspChnIsPaused(self.id.into()) } } /// Returns the channel's index. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::ndsp::Ndsp; + /// let ndsp = Ndsp::new()?; + /// let mut channel_0 = ndsp.channel(0)?; + /// + /// // The channel's index is 0. + /// assert_eq!(channel_0.id(), 0); + /// # + /// # Ok(()) + /// # } + /// ``` pub fn id(&self) -> u8 { self.id } @@ -202,41 +335,148 @@ impl Channel<'_> { } /// Pause or un-pause the channel's playback. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::ndsp::Ndsp; + /// let ndsp = Ndsp::new()?; + /// let mut channel_0 = ndsp.channel(0)?; + /// + /// channel_0.set_paused(true); + /// + /// // The channel is paused. + /// assert!(channel_0.is_paused()); + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "ndspChnSetPaused")] pub fn set_paused(&mut self, state: bool) { unsafe { ctru_sys::ndspChnSetPaused(self.id.into(), state) }; } /// Set the channel's output format. - /// Change this setting based on the used sample's format. + /// + /// Change this setting based on the used wave's format. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::ndsp::{AudioFormat, Ndsp}; + /// let ndsp = Ndsp::new()?; + /// let mut channel_0 = ndsp.channel(0)?; + /// + /// // Use the PCM16 interleaved dual-channel audio format. + /// channel_0.set_format(AudioFormat::PCM16Stereo); + /// # + /// # Ok(()) + /// # } + /// ``` + // TODO: Channels treat all waves as equal and do not read their format when playing them. Another good reason to re-write the service. #[doc(alias = "ndspChnSetFormat")] pub fn set_format(&mut self, format: AudioFormat) { unsafe { ctru_sys::ndspChnSetFormat(self.id.into(), format.into()) }; } /// Set the channel's interpolation mode. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::ndsp::{InterpolationType, Ndsp}; + /// let ndsp = Ndsp::new()?; + /// let mut channel_0 = ndsp.channel(0)?; + /// + /// // Use linear interpolation within frames. + /// channel_0.set_interpolation(InterpolationType::Linear); + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "ndspChnSetInterp")] pub fn set_interpolation(&mut self, interp_type: InterpolationType) { unsafe { ctru_sys::ndspChnSetInterp(self.id.into(), interp_type.into()) }; } /// Set the channel's volume mix. + /// + /// Look at [`AudioMix`] for more information on the volume mix. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # use std::default::Default; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::ndsp::{AudioMix, Ndsp}; + /// let ndsp = Ndsp::new()?; + /// let mut channel_0 = ndsp.channel(0)?; + /// + /// // Front-left and front-right channel maxed. + /// channel_0.set_mix(&AudioMix::default()); + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "ndspChnSetMix")] pub fn set_mix(&mut self, mix: &AudioMix) { unsafe { ctru_sys::ndspChnSetMix(self.id.into(), mix.as_raw().as_ptr().cast_mut()) } } - /// Set the channel's rate of sampling. + /// Set the channel's rate of sampling in hertz. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::ndsp::Ndsp; + /// let ndsp = Ndsp::new()?; + /// let mut channel_0 = ndsp.channel(0)?; + /// + /// // Standard CD sample rate. (44100 Hz) + /// channel_0.set_sample_rate(44100.); + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "ndspChnSetRate")] pub fn set_sample_rate(&mut self, rate: f32) { unsafe { ctru_sys::ndspChnSetRate(self.id.into(), rate) }; } - // `ndspChnSetAdpcmCoefs` isn't wrapped on purpose. - // DSPADPCM is a proprietary format used by Nintendo, unavailable by "normal" means. - // We suggest using other wave formats when developing homebrew applications. + // TODO: wrap ADPCM format helpers. /// Clear the wave buffer queue and stop playback. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::ndsp::Ndsp; + /// let ndsp = Ndsp::new()?; + /// let mut channel_0 = ndsp.channel(0)?; + /// + /// // Clear the audio queue and stop playback. + /// channel_0.clear_queue(); + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "ndspChnWaveBufClear")] pub fn clear_queue(&mut self) { unsafe { ctru_sys::ndspChnWaveBufClear(self.id.into()) }; @@ -249,10 +489,36 @@ impl Channel<'_> { /// /// `libctru` expects the user to manually keep the info data (in this case [`Wave`]) alive during playback. /// To ensure safety, checks within [`Wave`] will clear the whole channel queue if any queued [`Wave`] is dropped prematurely. + /// + /// # Example + /// + /// ```no_run + /// # #![feature(allocator_api)] + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// # use ctru::linear::LinearAllocator; + /// use ctru::services::ndsp::{AudioFormat, Ndsp, wave::Wave}; + /// let ndsp = Ndsp::new()?; + /// let mut channel_0 = ndsp.channel(0)?; + /// + /// # let _audio_data = Box::new_in([0u8; 96], LinearAllocator); + /// + /// // Provide your own audio data. + /// let mut wave = Wave::new(_audio_data, AudioFormat::PCM16Stereo, false); + /// + /// // Clear the audio queue and stop playback. + /// channel_0.queue_wave(&mut wave); + /// # + /// # Ok(()) + /// # } + /// ``` + // TODO: Find a better way to handle the wave lifetime problem. + // These "alive wave" shenanigans are the most substantial reason why I'd like to fully re-write this service in Rust. #[doc(alias = "ndspChnWaveBufAdd")] pub fn queue_wave(&mut self, wave: &mut Wave) -> std::result::Result<(), NdspError> { match wave.status() { - WaveStatus::Playing | WaveStatus::Queued => return Err(NdspError::WaveBusy(self.id)), + Status::Playing | Status::Queued => return Err(NdspError::WaveBusy(self.id)), _ => (), } @@ -354,9 +620,10 @@ impl Channel<'_> { impl AudioFormat { /// Returns the amount of bytes needed to store one sample /// - /// Eg. - /// 8 bit mono formats return 1 (byte) - /// 16 bit stereo (dual-channel) formats return 4 (bytes) + /// # Example + /// + /// - 8 bit mono formats return 1 (byte) + /// - 16 bit stereo (dual-channel) formats return 4 (bytes) pub const fn size(self) -> usize { match self { Self::PCM8Mono => 1, diff --git a/ctru-rs/src/services/ndsp/wave.rs b/ctru-rs/src/services/ndsp/wave.rs index 2819dbd..72cee96 100644 --- a/ctru-rs/src/services/ndsp/wave.rs +++ b/ctru-rs/src/services/ndsp/wave.rs @@ -1,9 +1,13 @@ -//! Audio wave representation. +//! Audio wave. +//! +//! This modules has all methods and structs required to work with audio waves meant to be played via the [`ndsp`](crate::services::ndsp) service. use super::{AudioFormat, NdspError}; use crate::linear::LinearAllocator; -/// Informational struct holding the raw audio data and playback info. This corresponds to [`ctru_sys::ndspWaveBuf`]. +/// Informational struct holding the raw audio data and playback info. +/// +/// You can play audio [`Wave`]s by using [`Channel::queue_wave()`](super::Channel::queue_wave). pub struct Wave { /// Data block of the audio wave (and its format information). buffer: Box<[u8], LinearAllocator>, @@ -15,8 +19,8 @@ pub struct Wave { #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u8)] -/// Enum representing the playback status of a [`Wave`]. -pub enum WaveStatus { +/// Playback status of a [`Wave`]. +pub enum Status { /// Wave has never been used. Free = ctru_sys::NDSP_WBUF_FREE as u8, /// Wave is currently queued for usage. @@ -28,7 +32,23 @@ pub enum WaveStatus { } impl Wave { - /// Build a new playable wave object from a raw buffer on LINEAR memory and a some info. + /// Build a new playable wave object from a raw buffer on [LINEAR memory](`crate::linear`) and a some info. + /// + /// # Example + /// + /// ```no_run + /// # #![feature(allocator_api)] + /// # fn main() { + /// # + /// use ctru::linear::LinearAllocator; + /// use ctru::services::ndsp::{AudioFormat, wave::Wave}; + /// + /// // Zeroed box allocated in the LINEAR memory. + /// let audio_data = Box::new_in([0u8; 96], LinearAllocator); + /// + /// let wave = Wave::new(audio_data, AudioFormat::PCM16Stereo, false); + /// # } + /// ``` pub fn new( buffer: Box<[u8], LinearAllocator>, audio_format: AudioFormat, @@ -79,7 +99,7 @@ impl Wave { /// with the id to the channel in which it's queued. pub fn get_buffer_mut(&mut self) -> Result<&mut [u8], NdspError> { match self.status() { - WaveStatus::Playing | WaveStatus::Queued => { + Status::Playing | Status::Queued => { Err(NdspError::WaveBusy(self.played_on_channel.unwrap())) } _ => Ok(&mut self.buffer), @@ -87,7 +107,26 @@ impl Wave { } /// Return this wave's playback status. - pub fn status(&self) -> WaveStatus { + /// + /// # Example + /// + /// ```no_run + /// # #![feature(allocator_api)] + /// # fn main() { + /// # + /// # use ctru::linear::LinearAllocator; + /// # let _audio_data = Box::new_in([0u8; 96], LinearAllocator); + /// # + /// use ctru::services::ndsp::{AudioFormat, wave::{Wave, Status}}; + /// + /// // Provide your own audio data. + /// let wave = Wave::new(_audio_data, AudioFormat::PCM16Stereo, false); + /// + /// // The `Wave` is free if never played before. + /// assert!(matches!(wave.status(), Status::Free)); + /// # } + /// ``` + pub fn status(&self) -> Status { self.raw_data.status.try_into().unwrap() } @@ -118,7 +157,7 @@ impl Wave { /// # Note /// /// Operations of this kind are particularly useful to allocate memory pools - /// for VBR (Variable BitRate) Formats, like OGG Vorbis. + /// for VBR (Variable BitRate) formats, like OGG Vorbis. /// /// # Errors /// @@ -126,7 +165,7 @@ impl Wave { /// or if the [`Wave`] is currently queued. pub fn set_sample_count(&mut self, sample_count: usize) -> Result<(), NdspError> { match self.status() { - WaveStatus::Playing | WaveStatus::Queued => { + Status::Playing | Status::Queued => { return Err(NdspError::WaveBusy(self.played_on_channel.unwrap())); } _ => (), @@ -144,7 +183,7 @@ impl Wave { } } -impl TryFrom for WaveStatus { +impl TryFrom for Status { type Error = &'static str; fn try_from(value: u8) -> Result { @@ -163,7 +202,7 @@ impl Drop for Wave { // This was the only way I found I could check for improper drops of `Wave`. // A panic was considered, but it would cause issues with drop order against `Ndsp`. match self.status() { - WaveStatus::Free | WaveStatus::Done => (), + Status::Free | Status::Done => (), // If the status flag is "unfinished" _ => { // The unwrap is safe, since it must have a value in the case the status is "unfinished". From 3d3a59a084c9430d33aad12677ea6734e8c95ee9 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Wed, 26 Jul 2023 13:39:46 +0200 Subject: [PATCH 038/101] Finalize CAM service --- ctru-rs/src/services/cam.rs | 343 +++++++++++++++++++++++++----------- ctru-rs/src/services/fs.rs | 1 + 2 files changed, 244 insertions(+), 100 deletions(-) diff --git a/ctru-rs/src/services/cam.rs b/ctru-rs/src/services/cam.rs index 717694e..ff9bd5b 100644 --- a/ctru-rs/src/services/cam.rs +++ b/ctru-rs/src/services/cam.rs @@ -1,17 +1,14 @@ //! Camera service. //! //! The CAM service provides access to the built-in cameras. [`Camera`]s can return images -//! in the form of byte vectors which can be displayed or used in other ways. +//! in the form of byte vectors which can be displayed to the screen or used in other ways. use crate::error::{Error, ResultCode}; use crate::services::gspgpu::FramebufferFormat; use ctru_sys::Handle; use std::time::Duration; -/// A reference-counted handle to the CAM service and the usable cameras. -/// The service is closed when all instances of this struct fall out of scope. -/// -/// This service requires no special permissions to use. +/// Handle to the Camera service. #[non_exhaustive] pub struct Cam { /// Inside-facing camera. @@ -24,22 +21,26 @@ pub struct Cam { pub both_outer_cams: BothOutwardCam, } -/// Flag to pass to [`Camera::flip_image`] +/// Different kinds of flip modes. +/// +/// See [`Camera::flip_image()`] to learn how to use this. #[doc(alias = "CAMU_Flip")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum FlipMode { - /// No flip applied. + /// No flip. None = ctru_sys::FLIP_NONE, - /// Horizontal flip applied. + /// Horizontal flip. Horizontal = ctru_sys::FLIP_HORIZONTAL, - /// Vertical flip applied. + /// Vertical flip. Vertical = ctru_sys::FLIP_VERTICAL, - /// Both vertical and horizontal flip applied. + /// Both vertical and horizontal flip. Reverse = ctru_sys::FLIP_REVERSE, } -/// Flag to pass to [`Camera::set_view_size`] +/// Size of the camera view. +/// +/// See [`Camera::set_view_size()`] to learn how to use this. #[doc(alias = "CAMU_Size")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] @@ -66,7 +67,9 @@ pub enum ViewSize { DSX4 = ctru_sys::SIZE_DS_LCDx4, } -/// Flag to pass to [`Camera::set_frame_rate`] +/// Framerate settings. +/// +/// See [`Camera::set_frame_rate()`] to learn how to use this. #[doc(alias = "CAMU_FramRate")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] @@ -99,27 +102,30 @@ pub enum FrameRate { Fps30To10 = ctru_sys::FRAME_RATE_30_TO_10, } -/// Flag to pass to [`Camera::set_white_balance`] or -/// [`Camera::set_white_balance_without_base_up`] +/// White balance settings. +/// +/// See [`Camera::set_white_balance()`] and [`Camera::set_white_balance_without_base_up()`] to learn how to use this. #[doc(alias = "CAMU_WhiteBalance")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum WhiteBalance { - /// Normal + /// Automatic white balance. Auto = ctru_sys::WHITE_BALANCE_AUTO, - /// Tungsten + /// Tungsten. Temp3200K = ctru_sys::WHITE_BALANCE_3200K, - /// Fluorescent Light + /// Fluorescent Light. Temp4150K = ctru_sys::WHITE_BALANCE_4150K, - /// Daylight + /// Daylight. Temp5200K = ctru_sys::WHITE_BALANCE_5200K, - /// Cloudy/Horizon + /// Cloudy/Horizon. Temp6000K = ctru_sys::WHITE_BALANCE_6000K, - /// Shade + /// Shade. Temp7000K = ctru_sys::WHITE_BALANCE_7000K, } -/// Flag to pass to [`Camera::set_photo_mode`] +/// Photo mode settings. +/// +/// See [`Camera::set_photo_mode()`] to learn how to use this. #[doc(alias = "CAMU_PhotoMode")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] @@ -136,7 +142,9 @@ pub enum PhotoMode { Letter = ctru_sys::PHOTO_MODE_LETTER, } -/// Flag to pass to [`Camera::set_effect`] +/// Special camera effects. +/// +/// See [`Camera::set_effect()`] to learn how to use this. #[doc(alias = "CAMU_Effect")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] @@ -151,11 +159,15 @@ pub enum Effect { Negative = ctru_sys::EFFECT_NEGATIVE, /// Negative film effect. Negafilm = ctru_sys::EFFECT_NEGAFILM, - /// Sepia effect. (unknown difference) + /// Sepia effect. + /// + /// The difference between this and [`Sepia`](Effect::Sepia) is unknown. Sepia01 = ctru_sys::EFFECT_SEPIA01, } -/// Flag to pass to [`Camera::set_contrast`] +/// Contrast settings. +/// +/// See [`Camera::set_contrast()`] to learn how to use this. #[doc(alias = "CAMU_Contrast")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] @@ -168,7 +180,9 @@ pub enum Contrast { High = ctru_sys::CONTRAST_HIGH, } -/// Flag to pass to [`Camera::set_lens_correction`] +/// Lens correction settings. +/// +/// See [`Camera::set_lens_correction()`] to learn how to use this. #[doc(alias = "CAMU_LensCorrection")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] @@ -181,7 +195,9 @@ pub enum LensCorrection { Bright = ctru_sys::LENS_CORRECTION_BRIGHT, } -/// Flag to pass to [`Camera::set_output_format`] +/// Image output format. +/// +/// See [`Camera::set_output_format()`] to learn how to use this. #[doc(alias = "CAMU_OutputFormat")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] @@ -192,12 +208,14 @@ pub enum OutputFormat { Rgb565 = ctru_sys::OUTPUT_RGB_565, } -/// Flag to pass to [`Cam::play_shutter_sound`] +/// Playable shutter sounds. +/// +/// See [`Cam::play_shutter_sound()`] to learn how to use this. #[doc(alias = "CAMU_ShutterSoundType")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum ShutterSound { - /// Normal shutter sound. + /// Photo shutter sound. Normal = ctru_sys::SHUTTER_SOUND_TYPE_NORMAL, /// Shutter sound to begin a movie recording. Movie = ctru_sys::SHUTTER_SOUND_TYPE_MOVIE, @@ -205,29 +223,9 @@ pub enum ShutterSound { MovieEnd = ctru_sys::SHUTTER_SOUND_TYPE_MOVIE_END, } -impl TryFrom for OutputFormat { - type Error = (); - - fn try_from(value: FramebufferFormat) -> Result { - match value { - FramebufferFormat::Rgb565 => Ok(OutputFormat::Rgb565), - _ => Err(()), - } - } -} - -impl TryFrom for FramebufferFormat { - type Error = (); - - fn try_from(value: OutputFormat) -> Result { - match value { - OutputFormat::Rgb565 => Ok(FramebufferFormat::Rgb565), - _ => Err(()), - } - } -} - -/// Struct containing coordinates passed to [`Camera::set_trimming_params`]. +/// Parameters to handle image trimming. +/// +/// See [`Camera::set_trimming_params()`] to learn how to use this. #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub struct TrimmingParams { x_start: i16, @@ -239,8 +237,10 @@ pub struct TrimmingParams { impl TrimmingParams { /// Creates a new [`TrimmingParams`] and guarantees the start coordinates are less than or /// equal to the end coordinates. + /// + /// # Panics /// - /// `x_start <= x_end && y_start <= y_end` + /// This function panics if the start coordinates are larger than the end coordinates (for each axis). pub fn new(x_start: i16, y_start: i16, x_end: i16, y_end: i16) -> TrimmingParams { assert!(x_start <= x_end && y_start <= y_end); Self { @@ -252,17 +252,20 @@ impl TrimmingParams { } } -/// Represents data used by the camera to calibrate image quality +/// Data used by the camera to calibrate image quality for a single camera. #[doc(alias = "CAMU_ImageQualityCalibrationData")] #[derive(Default, Clone, Copy, Debug)] pub struct ImageQualityCalibrationData(pub ctru_sys::CAMU_ImageQualityCalibrationData); -/// Represents data used by the camera to calibrate image quality when using both outward cameras +/// Data used by the camera to calibrate image quality when using both outward cameras. +// TODO: Implement Stereo camera calibration. #[doc(alias = "CAMU_StereoCameraCalibrationData")] #[derive(Default, Clone, Copy, Debug)] pub struct StereoCameraCalibrationData(pub ctru_sys::CAMU_StereoCameraCalibrationData); -/// Represents the camera on the inside of the 3DS +/// Inward camera representation (facing the user of the 3DS). +/// +/// Usually used for selfies. #[non_exhaustive] pub struct InwardCam; @@ -272,8 +275,7 @@ impl Camera for InwardCam { } } -/// Represents the the outer right camera when the 3DS is open and the dual cameras are pointed -/// away from the user +/// Right-side outward camera representation. #[non_exhaustive] pub struct OutwardRightCam; @@ -283,8 +285,7 @@ impl Camera for OutwardRightCam { } } -/// Represents the the outer left camera when the 3DS is open and the dual cameras are pointed -/// away from the user +/// Left-side outward camera representation. #[non_exhaustive] pub struct OutwardLeftCam; @@ -294,7 +295,9 @@ impl Camera for OutwardLeftCam { } } -/// Represents the both outer cameras combined +/// Both outer cameras combined. +/// +/// Usually used for 3D photos. #[non_exhaustive] pub struct BothOutwardCam; @@ -325,17 +328,36 @@ impl Camera for BothOutwardCam { } } -/// Represents a camera and its functionality +/// Generic functionality common to all cameras. +// TODO: Change "set true/set parameters" scheme (classic of C code) into a single "set parameter" scheme using enums. This is valid for stuff such as [`TrimmingParams`] pub trait Camera { - /// Returns the raw value of the selected camera + /// Returns the raw value of the selected camera. fn camera_as_raw(&self) -> ctru_sys::u32_; - /// Returns the raw port of the selected camera + /// Returns the raw port of the selected camera. fn port_as_raw(&self) -> ctru_sys::u32_ { ctru_sys::PORT_CAM1 } - /// Returns true if the camera is busy (receiving data) + /// Returns `true` if the camera is busy (receiving data). + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::cam::{Cam, Camera}; + /// let cam = Cam::new()?; + /// + /// let inward = &cam.inner_cam; + /// + /// // Inward cam is not busy since it is not being used. + /// assert!(!inward.is_busy()?); + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "CAMU_IsBusy")] fn is_busy(&self) -> crate::Result { unsafe { @@ -346,7 +368,25 @@ pub trait Camera { } /// Returns the maximum amount of transfer bytes based on the view size, trimming, and other - /// modifications set to the camera + /// modifications set to the camera. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::cam::{Cam, Camera}; + /// let cam = Cam::new()?; + /// + /// let inward = &cam.inner_cam; + /// + /// // Inward cam is not busy since it is not being used. + /// let transfer_count = inward.transfer_byte_count(); + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "CAMU_GetTransferBytes")] fn transfer_byte_count(&self) -> crate::Result { unsafe { @@ -359,8 +399,9 @@ pub trait Camera { } } - /// Sets whether or not the camera should trim the image based on parameters set by - /// [`Camera::set_trimming_params`] + /// Set whether or not the camera should trim the image. + /// + /// [`TrimmingParams`] can be set via [`Camera::set_trimming_params`]. #[doc(alias = "CAMU_SetTrimming")] fn set_trimming(&mut self, enabled: bool) -> crate::Result<()> { unsafe { @@ -369,7 +410,7 @@ pub trait Camera { } } - /// Returns whether or not trimming is currently enabled for the camera + /// Returns whether or not trimming is currently enabled for the camera. #[doc(alias = "CAMU_IsTrimming")] fn is_trimming_enabled(&self) -> crate::Result { unsafe { @@ -379,7 +420,9 @@ pub trait Camera { } } - /// Sets trimming parameters based on coordinates specified inside a [`TrimmingParams`] + /// Set trimming bounds based on image coordinates. + /// + /// For trimming to take effect it is required to pass `true` into [`Camera::set_trimming()`]. #[doc(alias = "CAMU_SetTrimmingParams")] fn set_trimming_params(&mut self, params: TrimmingParams) -> crate::Result<()> { unsafe { @@ -394,7 +437,7 @@ pub trait Camera { } } - /// Returns the [`TrimmingParams`] set + /// Returns the [`TrimmingParams`] currently set. #[doc(alias = "CAMU_GetTrimmingParams")] fn trimming_params(&self) -> crate::Result { unsafe { @@ -419,9 +462,13 @@ pub trait Camera { } } - /// Sets the trimming parameters revolving around the center of the image. + /// Set the trimming bounds relatively to the center of the image. + /// + /// # Notes + /// /// The new width will be `trim_width / 2` to the left and right of the center. /// The new height will be `trim_height / 2` above and below the center. + // TODO: This function doesn't use `TrimmingParams`. It'd be better to merge it with `set_trimming_params()` and change the `TrimmingParams` representation. #[doc(alias = "CAMU_SetTrimmingParamsCenter")] fn set_trimming_params_center( &mut self, @@ -442,7 +489,7 @@ pub trait Camera { } } - /// Sets the exposure level of the camera + /// Set the exposure level of the camera.Ã¥ #[doc(alias = "CAMU_SetExposure")] fn set_exposure(&mut self, exposure: i8) -> crate::Result<()> { unsafe { @@ -451,7 +498,7 @@ pub trait Camera { } } - /// Sets the white balance mod of the camera based on the passed [`WhiteBalance`] argument + /// Set the white balance of the camera. #[doc(alias = "CAMU_SetWhiteBalance")] fn set_white_balance(&mut self, white_balance: WhiteBalance) -> crate::Result<()> { unsafe { @@ -463,8 +510,8 @@ pub trait Camera { } } - /// Sets the white balance mode of the camera based on the passed [`WhiteBalance`] argument - // TODO: Explain base up + /// Set the white balance of the camera. + // TODO: Explain what "without base up" means. #[doc(alias = "CAMU_SetWhiteBalanceWithoutBaseUp")] fn set_white_balance_without_base_up( &mut self, @@ -479,7 +526,7 @@ pub trait Camera { } } - /// Sets the sharpness of the camera + /// Set the sharpness of the camera. #[doc(alias = "CAMU_SetSharpness")] fn set_sharpness(&mut self, sharpness: i8) -> crate::Result<()> { unsafe { @@ -488,7 +535,7 @@ pub trait Camera { } } - /// Sets whether auto exposure is enabled or disabled for the camera + /// Set whether auto exposure is enabled or disabled for the camera. #[doc(alias = "CAMU_SetAutoExposure")] fn set_auto_exposure(&mut self, enabled: bool) -> crate::Result<()> { unsafe { @@ -500,7 +547,7 @@ pub trait Camera { } } - /// Returns true if auto exposure is enabled for the camera + /// Returns `true` if auto exposure is enabled for the camera. #[doc(alias = "CAMU_IsAutoExposure")] fn is_auto_exposure_enabled(&self) -> crate::Result { unsafe { @@ -525,7 +572,7 @@ pub trait Camera { } } - /// Returns true if auto white balance is enabled for the camera + /// Returns `true` if auto white balance is enabled for the camera. #[doc(alias = "CAMU_IsAutoWhiteBalance")] fn is_auto_white_balance_enabled(&self) -> crate::Result { unsafe { @@ -538,7 +585,7 @@ pub trait Camera { } } - /// Sets the flip direction of the camera's image based on the passed [`FlipMode`] argument + /// Set the flip mode of the camera's image. #[doc(alias = "CAMU_FlipImage")] fn flip_image(&mut self, flip: FlipMode) -> crate::Result<()> { unsafe { @@ -551,7 +598,7 @@ pub trait Camera { } } - /// Sets the image resolution of the camera in detail + /// Set the image resolution of the camera in detail. /// /// # Errors /// @@ -559,10 +606,11 @@ pub trait Camera { /// coordinates of the second crop point. /// /// # Arguments + /// /// * `width` - Width of the image /// * `height` - height of the image /// * `crop_0` - The first crop point in which the image will be trimmed - /// * `crop_0` - The second crop point in which the image will be trimmed + /// * `crop_1` - The second crop point in which the image will be trimmed #[doc(alias = "CAMU_SetDetailSize")] fn set_detail_size( &mut self, @@ -586,7 +634,7 @@ pub trait Camera { } } - /// Sets the view size of the camera based on the passed [`ViewSize`] argument. + /// Set the view size of the camera. #[doc(alias = "CAMU_SetSize")] fn set_view_size(&mut self, size: ViewSize) -> crate::Result<()> { unsafe { @@ -599,7 +647,7 @@ pub trait Camera { } } - /// Sets the frame rate of the camera based on the passed [`FrameRate`] argument. + /// Set the frame rate of the camera. #[doc(alias = "CAMU_SetFrameRate")] fn set_frame_rate(&mut self, frame_rate: FrameRate) -> crate::Result<()> { unsafe { @@ -611,7 +659,7 @@ pub trait Camera { } } - /// Sets the photo mode of the camera based on the passed [`PhotoMode`] argument. + /// Sets the photo mode of the camera. #[doc(alias = "CAMU_SetPhotoMode")] fn set_photo_mode(&mut self, photo_mode: PhotoMode) -> crate::Result<()> { unsafe { @@ -623,9 +671,12 @@ pub trait Camera { } } - /// Sets the effect of the camera based on the passed [`Effect`] argument. - /// - /// Multiple effects can be set at once by combining the bitflags of [`Effect`] + /// Sets the effect of the camera. + /// + /// # Notes + /// + /// This operation will override any previously set [`Effect`]s. + /// Multiple effects can be set at once by combining the bitflags of [`Effect`]. #[doc(alias = "CAMU_SetEffect")] fn set_effect(&mut self, effect: Effect) -> crate::Result<()> { unsafe { @@ -638,7 +689,7 @@ pub trait Camera { } } - /// Sets the contrast of the camera based on the passed [`Contrast`] argument. + /// Set the contrast of the camera. #[doc(alias = "CAMU_SetContrast")] fn set_contrast(&mut self, contrast: Contrast) -> crate::Result<()> { unsafe { @@ -650,7 +701,7 @@ pub trait Camera { } } - /// Sets the lens correction of the camera based on the passed [`LensCorrection`] argument. + /// Set the lens correction of the camera. #[doc(alias = "CAMU_SetLensCorrection")] fn set_lens_correction(&mut self, lens_correction: LensCorrection) -> crate::Result<()> { unsafe { @@ -662,7 +713,7 @@ pub trait Camera { } } - /// Sets the output format of the camera based on the passed [`OutputFormat`] argument. + /// Set the output format of the camera. #[doc(alias = "CAMU_SetOutputFormat")] fn set_output_format(&mut self, format: OutputFormat) -> crate::Result<()> { unsafe { @@ -675,7 +726,7 @@ pub trait Camera { } } - /// Sets the region in which auto exposure should be based on. + /// Set the region in which auto exposure should be based on. /// /// # Arguments /// @@ -703,7 +754,7 @@ pub trait Camera { } } - /// Sets the region in which auto white balance should be based on. + /// Set the region in which auto white balance should be based on. /// /// # Arguments /// @@ -711,6 +762,10 @@ pub trait Camera { /// * `y` - Starting y coordinate of the window /// * `width` - Width of the window /// * `height` - Height of the window + /// + /// # Notes + /// + /// To activate automatic white balance, you must pass [`WhiteBalance::Auto`] into [`Camera::set_white_balance()`]. #[doc(alias = "CAMU_SetAutoWhiteBalanceWindow")] fn set_auto_white_balance_window( &mut self, @@ -731,7 +786,7 @@ pub trait Camera { } } - /// Sets whether the noise filter should be enabled or disabled for the camera + /// Set whether the noise filter should be enabled or disabled for the camera. #[doc(alias = "CAMU_SetNoiseFilter")] fn set_noise_filter(&mut self, enabled: bool) -> crate::Result<()> { unsafe { @@ -740,8 +795,7 @@ pub trait Camera { } } - /// Sets the image quality calibration data for the camera based on the passed in - /// [`ImageQualityCalibrationData`] argument + /// Set the [`ImageQualityCalibrationData`] for the camera. #[doc(alias = "CAMU_SetImageQualityCalibrationData")] fn set_image_quality_calibration_data( &mut self, @@ -753,7 +807,7 @@ pub trait Camera { } } - /// Returns the current [`ImageQualityCalibrationData`] for the camera + /// Returns the current [`ImageQualityCalibrationData`] for the camera. #[doc(alias = "CAMU_GetImageQualityCalibrationData")] fn image_quality_calibration_data(&self) -> crate::Result { unsafe { @@ -763,7 +817,7 @@ pub trait Camera { } } - /// Sets the camera as the current sleep camera + /// Set the camera as the current sleep camera. // TODO: Explain sleep camera #[doc(alias = "CAMU_SetSleepCamera")] fn set_sleep_camera(&mut self) -> crate::Result<()> { @@ -773,17 +827,48 @@ pub trait Camera { } } - /// Requests the camera to take a picture and write it in a buffer. + /// Request the camera to take a picture and write it in a buffer. /// /// # Errors /// - /// This will error if the camera is busy or if the timeout duration is reached. + /// This function will return an error if the camera is busy or if the timeout duration gets reached. /// /// # Arguments /// /// * `width` - Width of the desired image /// * `height` - Height of the desired image /// * `timeout` - Duration to wait for the image + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # use std::time::Duration; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::cam::{Cam, Camera, ViewSize, OutputFormat}; + /// let mut cam = Cam::new()?; + /// + /// // We borrow the inward facing `Camera`. + /// let inward = &mut cam.inner_cam; + /// + /// inward.set_view_size(ViewSize::TopLCD)?; + /// inward.set_output_format(OutputFormat::Rgb565)?; + /// inward.set_noise_filter(true)?; + /// inward.set_auto_exposure(true)?; + /// inward.set_auto_white_balance(true)?; + /// + /// // Size of the top screen buffer at 2 bytes per pixel (RGB565). + /// let mut buffer = vec![0; 400*240*2]; + /// + /// // Take picture with 3 seconds of timeout. + /// inward.take_picture(&mut buffer, 400, 240, Duration::from_secs(3)); + /// # + /// # Ok(()) + /// # } + /// ``` + // TODO: This should use the value passed within `set_view_size` rather than arbitrary `width` and `height` values. + // Furthermore, it's pretty unclear what the "default" view size is. What happens if the user doesn't set it before taking the picture? fn take_picture( &mut self, buffer: &mut [u8], @@ -863,6 +948,20 @@ impl Cam { /// This function will return an error if the service was unable to be initialized. /// Since this service requires no special or elevated permissions, errors are /// rare in practice. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::cam::Cam; + /// + /// let cam = Cam::new()?; + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "camInit")] pub fn new() -> crate::Result { unsafe { @@ -877,6 +976,28 @@ impl Cam { } /// Plays the specified sound based on the [`ShutterSound`] argument + /// + /// # Notes + /// + /// Playing the shutter sound does not require a liviving handle to the [`Ndsp`](crate::services::ndsp::Ndsp) service. + /// Volume will always be maxed out to ensure everyone within photo range can hear the picture being taken (as by japanese law). + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::cam::{Cam, ShutterSound}; + /// let cam = Cam::new()?; + /// + /// // We play the shutter sound on the console's speakers! + /// // (even though we aren't taking a photo :P) + /// cam.play_shutter_sound(ShutterSound::Normal); + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "CAMU_PlayShutterSound")] pub fn play_shutter_sound(&self, sound: ShutterSound) -> crate::Result<()> { unsafe { @@ -893,6 +1014,28 @@ impl Drop for Cam { } } +impl TryFrom for OutputFormat { + type Error = (); + + fn try_from(value: FramebufferFormat) -> Result { + match value { + FramebufferFormat::Rgb565 => Ok(OutputFormat::Rgb565), + _ => Err(()), + } + } +} + +impl TryFrom for FramebufferFormat { + type Error = (); + + fn try_from(value: OutputFormat) -> Result { + match value { + OutputFormat::Rgb565 => Ok(FramebufferFormat::Rgb565), + _ => Err(()), + } + } +} + from_impl!(FlipMode, ctru_sys::CAMU_Flip); from_impl!(ViewSize, ctru_sys::CAMU_Size); from_impl!(FrameRate, ctru_sys::CAMU_FrameRate); diff --git a/ctru-rs/src/services/fs.rs b/ctru-rs/src/services/fs.rs index 464d980..d5d7916 100644 --- a/ctru-rs/src/services/fs.rs +++ b/ctru-rs/src/services/fs.rs @@ -2,6 +2,7 @@ //! //! This module contains basic methods to manipulate the contents of the 3DS's filesystem. //! Only the SD card is currently supported. You should prefer using `std::fs`. +// TODO: Refactor service to accomodate for various changes (such as SMDH support). Properly document the public API. use bitflags::bitflags; use std::ffi::OsString; From ccb0676f3c0e5aa9d2c96e9afa1e8ce2c0b477ca Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Wed, 26 Jul 2023 18:37:44 +0200 Subject: [PATCH 039/101] More generic doc changes --- ctru-rs/README.md | 1 - ctru-rs/src/error.rs | 11 ++++++----- ctru-rs/src/lib.rs | 4 ++-- ctru-rs/src/linear.rs | 18 ++++++++++-------- ctru-rs/src/services/am.rs | 2 +- ctru-rs/src/services/mod.rs | 4 ++-- 6 files changed, 21 insertions(+), 19 deletions(-) diff --git a/ctru-rs/README.md b/ctru-rs/README.md index 297c8cc..0cc8a79 100644 --- a/ctru-rs/README.md +++ b/ctru-rs/README.md @@ -1,7 +1,6 @@ # ctru-rs Safe and idiomatic Rust wrapper around [`libctru`](https://github.com/devkitPro/libctru). -This crate uses the bindings provided by [`ctru-sys`](../ctru-sys/). ## Getting Started diff --git a/ctru-rs/src/error.rs b/ctru-rs/src/error.rs index 895bed1..becfaef 100644 --- a/ctru-rs/src/error.rs +++ b/ctru-rs/src/error.rs @@ -1,6 +1,7 @@ //! Error handling interface. //! -//! This module holds the generic error and result types to interface with [`ctru_sys`] and the safe wrapper. +//! This module holds the generic error and result types to interface with `ctru_sys` and the [`ctru-rs`](crate) safe wrapper. + use std::borrow::Cow; use std::error; use std::ffi::CStr; @@ -9,12 +10,12 @@ use std::ops::{ControlFlow, FromResidual, Try}; use ctru_sys::result::{R_DESCRIPTION, R_LEVEL, R_MODULE, R_SUMMARY}; -/// Custom type alias for generic `ctru` operations. +/// Custom type alias for generic [`ctru-rs`](crate) operations. /// -/// This type is compatible with `ctru-sys` result codes. +/// This type is compatible with `ctru-sys::Result` codes. pub type Result = ::std::result::Result; -/// Validity checker of raw [`ctru_sys::Result`] codes. +/// Validity checker of raw `ctru_sys::Result` codes. /// /// This struct supports the "try" syntax (`?`) to convert to an [`Error::Os`]. /// @@ -72,7 +73,7 @@ impl FromResidual for Result { } } -/// The generic error enum returned by `ctru` functions. +/// The generic error enum returned by [`ctru-rs`](crate) functions. /// /// This error enum supports parsing and displaying [`ctru_sys::Result`] codes. #[non_exhaustive] diff --git a/ctru-rs/src/lib.rs b/ctru-rs/src/lib.rs index b2267f0..3686578 100644 --- a/ctru-rs/src/lib.rs +++ b/ctru-rs/src/lib.rs @@ -6,7 +6,7 @@ //! Thanks to it, developers can access the underlying system services and the console's hardware to develop userland applications //! (such as [HID devices](crate::services::hid), [network capabilities](crate::services::soc), [graphics](crate::services::gfx), [built-in cameras](crate::services::cam), etc.). //! -//! Among these features, `ctru-rs` also automatically includes functionality to properly integrate the Rust `std` with the console's operating system, +//! Among these features, [`ctru-rs`](crate) also automatically includes functionality to properly integrate the Rust `std` with the console's operating system, //! which the developer would otherwise need to implement manually. //! //! # Usage @@ -53,7 +53,7 @@ macro_rules! from_impl { }; } -/// Activate the custom `ctru-rs` panic handler. +/// Activate the custom [`ctru-rs`](crate) panic handler. /// /// With this implementation, the main thread will stop and try to print debug info to an available [`Console`](console::Console). /// In case it fails to find an active [`Console`](console::Console) the program will just exit. diff --git a/ctru-rs/src/linear.rs b/ctru-rs/src/linear.rs index d0164c0..fd776be 100644 --- a/ctru-rs/src/linear.rs +++ b/ctru-rs/src/linear.rs @@ -1,11 +1,12 @@ -//! Linear memory allocator +//! LINEAR memory allocator. //! -//! Linear memory is a sector of the 3DS' RAM that binds virtual addresses exactly to the physical address. -//! As such, it is used for fast and safe memory sharing between services (and is especially needed for GPU and DSP). +//! LINEAR memory is a sector of the 3DS' RAM that binds virtual addresses exactly to the physical address. +//! As such, it is used for fast and safe memory sharing between hardware processors (such as the GPU and the DSP). //! -//! Resources:
-//!
-//! +//! # Additional Resources +//! +//! -
+//! - use std::alloc::{AllocError, Allocator, Layout}; use std::ptr::NonNull; @@ -15,13 +16,14 @@ use std::ptr::NonNull; // Sadly the linear memory allocator included in `libctru` doesn't implement `linearRealloc` at the time of these additions, // but the default fallback of the `std` will take care of that for us. -/// [`Allocator`](std::alloc::Allocator) struct for LINEAR memory +/// [`Allocator`](std::alloc::Allocator) struct for LINEAR memory. +/// /// To use this struct the main crate must activate the `allocator_api` unstable feature. #[derive(Copy, Clone, Default, Debug)] pub struct LinearAllocator; impl LinearAllocator { - /// Returns the amount of free space left in the LINEAR sector + /// Returns the amount of free space left in the LINEAR memory sector. #[doc(alias = "linearSpaceFree")] pub fn free_space() -> u32 { unsafe { ctru_sys::linearSpaceFree() } diff --git a/ctru-rs/src/services/am.rs b/ctru-rs/src/services/am.rs index e67282e..ee5a480 100644 --- a/ctru-rs/src/services/am.rs +++ b/ctru-rs/src/services/am.rs @@ -4,7 +4,7 @@ //! - Read the installed applications on the console and their information (depending on the install location). //! - Install compatible applications to the console. //! -//! TODO: `ctru-rs` doesn't support installing or uninstalling titles yet. +//! TODO: [`ctru-rs`](crate) doesn't support installing or uninstalling titles yet. use crate::error::ResultCode; use crate::services::fs::FsMediaType; diff --git a/ctru-rs/src/services/mod.rs b/ctru-rs/src/services/mod.rs index 9ff975e..8aadf87 100644 --- a/ctru-rs/src/services/mod.rs +++ b/ctru-rs/src/services/mod.rs @@ -3,13 +3,13 @@ //! Most of the 3DS console's functionalities (when writing user-land homebrew) are accessible via services, //! which need to be initialized before accessing any particular feature. //! -//! To ensure safety while using the underlying services, `ctru-rs` leverages Rust's lifetime model. +//! To ensure safety while using the underlying services, [`ctru-rs`](crate) leverages Rust's lifetime model. //! After initializing the handle for a specific service (e.g. [`Apt`](apt::Apt)) the service will be accessible as long as there is at least one handle "alive". //! As such, handles should be dropped *after* the use of a specific service. This is particularly important for services which are necessary for functionality //! "outside" their associated methods, such as [`RomFS`](romfs::RomFS), which creates an accessible virtual filesystem, or [`Soc`](soc::Soc), //! which enables all network communications via sockets. //! -//! In `ctru-rs` some services only allow a single handle to be created at a time, to ensure a safe and controlled environment. +//! In [`ctru-rs`](crate) some services only allow a single handle to be created at a time, to ensure a safe and controlled environment. pub mod am; pub mod apt; From acb1d3fbb8a11842aea88349122140ecfb303a88 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Wed, 26 Jul 2023 18:47:41 +0200 Subject: [PATCH 040/101] Finalize Mii module --- ctru-rs/src/applets/mii_selector.rs | 6 +-- ctru-rs/src/linear.rs | 4 +- ctru-rs/src/mii.rs | 76 +++++++++++++------------- ctru-rs/src/services/cam.rs | 82 ++++++++++++++--------------- 4 files changed, 85 insertions(+), 83 deletions(-) diff --git a/ctru-rs/src/applets/mii_selector.rs b/ctru-rs/src/applets/mii_selector.rs index 76a4d5e..bd0e4b4 100644 --- a/ctru-rs/src/applets/mii_selector.rs +++ b/ctru-rs/src/applets/mii_selector.rs @@ -1,9 +1,9 @@ //! Mii Selector applet. //! //! This applet opens a window which lets the player/user choose a Mii from the ones present on their console. -//! The selected Mii is readable as a [`MiiData`](crate::mii::MiiData). +//! The selected Mii is readable as a [`Mii`](crate::mii::Mii). -use crate::mii::MiiData; +use crate::mii::Mii; use bitflags::bitflags; use std::{ffi::CString, fmt}; @@ -65,7 +65,7 @@ pub struct MiiSelector { #[derive(Clone, Debug)] pub struct Selection { /// Data of the selected Mii. - pub mii_data: MiiData, + pub mii_data: Mii, /// Type of the selected Mii. pub mii_type: MiiType, } diff --git a/ctru-rs/src/linear.rs b/ctru-rs/src/linear.rs index fd776be..8c0639a 100644 --- a/ctru-rs/src/linear.rs +++ b/ctru-rs/src/linear.rs @@ -4,7 +4,7 @@ //! As such, it is used for fast and safe memory sharing between hardware processors (such as the GPU and the DSP). //! //! # Additional Resources -//! +//! //! -
//! - @@ -17,7 +17,7 @@ use std::ptr::NonNull; // but the default fallback of the `std` will take care of that for us. /// [`Allocator`](std::alloc::Allocator) struct for LINEAR memory. -/// +/// /// To use this struct the main crate must activate the `allocator_api` unstable feature. #[derive(Copy, Clone, Default, Debug)] pub struct LinearAllocator; diff --git a/ctru-rs/src/mii.rs b/ctru-rs/src/mii.rs index b5a2f03..beccd4e 100644 --- a/ctru-rs/src/mii.rs +++ b/ctru-rs/src/mii.rs @@ -1,9 +1,10 @@ -//! Mii Data +//! Mii data. //! //! This module contains the structs that represent all the data of a Mii. -//! This data is given by the [``MiiSelector``](crate::applets::mii_selector::MiiSelector) +//! +//! Have a look at the [`MiiSelector`](crate::applets::mii_selector::MiiSelector) applet to learn how to ask the user for a specific Mii. -/// Represents the region lock of the console. +/// Region lock of the Mii. #[derive(Copy, Clone, Debug, Eq, PartialEq)] pub enum RegionLock { /// No region-lock. @@ -16,7 +17,7 @@ pub enum RegionLock { Europe, } -/// Represent the charset of the console. +/// Charset of the Mii. #[derive(Copy, Clone, Debug, Eq, PartialEq)] pub enum Charset { /// Japan-USA-Europe unified charset. @@ -29,9 +30,9 @@ pub enum Charset { Taiwan, } -/// Represents the options of the Mii. +/// Generic options of the Mii. #[derive(Copy, Clone, Debug)] -pub struct MiiDataOptions { +pub struct Options { /// Whether it is allowed to copy the Mii. pub is_copying_allowed: bool, /// Whether the profanity flag is active. @@ -42,7 +43,7 @@ pub struct MiiDataOptions { pub charset: Charset, } -/// Represents the position that the Mii has on the selector. +/// Positional Index that the Mii has on the [`MiiSelector`](crate::applets::mii_selector::MiiSelector) window. #[derive(Copy, Clone, Debug)] pub struct SelectorPosition { /// Index of the page where the Mii is found. @@ -51,40 +52,42 @@ pub struct SelectorPosition { pub slot_index: u8, } -/// Represents the console where the Mii originated from. +/// Console model from which the Mii originated. #[derive(Copy, Clone, Debug, Eq, PartialEq)] pub enum OriginConsole { /// Nintendo Wii. Wii, /// Nintendo DSi. DSi, - /// Nintendo 3DS (both New 3DS and Old 3DS). + /// Nintendo 3DS. + /// + /// This includes all consoles of the 3DS family (3DS, 2DS, and their respective "New" or "XL" variants). N3DS, - /// Nintendo WiiU/Switch. + /// Nintendo Wii U/Switch. WiiUSwitch, } -/// Represents the identity of the origin console. +/// Identity of the origin console. #[derive(Copy, Clone, Debug)] pub struct ConsoleIdentity { /// From which console the Mii originated from. pub origin_console: OriginConsole, } -/// Represents the sex of the Mii. +/// Sex of the Mii. #[derive(Copy, Clone, Debug, Eq, PartialEq)] -pub enum MiiSex { +pub enum Sex { /// Male sex. Male, /// Female sex. Female, } -/// Represents the details of the Mii. +/// Generic details of the Mii. #[derive(Copy, Clone, Debug)] pub struct Details { /// Sex of the Mii. - pub sex: MiiSex, + pub sex: Sex, /// Birthday month. pub birthday_month: u8, /// Birthday day. @@ -97,7 +100,7 @@ pub struct Details { pub is_sharing_enabled: bool, } -/// Represents the face style of the Mii. +/// Face style of the Mii. #[derive(Copy, Clone, Debug)] pub struct FaceStyle { /// Face shape. @@ -106,7 +109,7 @@ pub struct FaceStyle { pub skin_color: u8, } -/// Represents the face details of the Mii. +/// Face details of the Mii. #[derive(Copy, Clone, Debug)] pub struct FaceDetails { /// Face style. @@ -117,7 +120,7 @@ pub struct FaceDetails { pub makeup: u8, } -/// Represents the hair details of the Mii. +/// Hair details of the Mii. #[derive(Copy, Clone, Debug)] pub struct HairDetails { /// Hair style. @@ -128,7 +131,7 @@ pub struct HairDetails { pub is_flipped: bool, } -/// Represents the eye details of the Mii. +/// Eye details of the Mii. #[derive(Copy, Clone, Debug)] pub struct EyeDetails { /// Eye style. @@ -147,7 +150,7 @@ pub struct EyeDetails { pub y_position: u8, } -/// Represents the eyebrow details of the Mii +/// Eyebrow details of the Mii. #[derive(Copy, Clone, Debug)] pub struct EyebrowDetails { /// Eyebrow style. @@ -166,7 +169,7 @@ pub struct EyebrowDetails { pub y_position: u8, } -/// Represents the details of the nose +/// Nose details of the Mii. #[derive(Copy, Clone, Debug)] pub struct NoseDetails { /// Nose style. @@ -177,7 +180,7 @@ pub struct NoseDetails { pub y_position: u8, } -/// Represents the details of the mouth +/// Mouth details of the Mii. #[derive(Copy, Clone, Debug)] pub struct MouthDetails { /// Mouth style. @@ -192,14 +195,14 @@ pub struct MouthDetails { pub y_position: u8, } -/// Represents the details of the mustache +/// Mustache details of the Mii. #[derive(Copy, Clone, Debug)] pub struct MustacheDetails { /// Mustache style. pub mustache_style: u8, } -/// Represents the details of the beard +/// Beard details of the Mii. #[derive(Copy, Clone, Debug)] pub struct BeardDetails { /// Beard style @@ -212,7 +215,7 @@ pub struct BeardDetails { pub y_position: u8, } -/// Represents the details of the glasses +/// Glasses details of the Mii. #[derive(Copy, Clone, Debug)] pub struct GlassesDetails { /// Glasses style. @@ -225,7 +228,7 @@ pub struct GlassesDetails { pub y_position: u8, } -/// Represents the details of the mole. +/// Mole details of the Mii. #[derive(Copy, Clone, Debug)] pub struct MoleDetails { /// Whether the Mii has a mole. @@ -238,16 +241,15 @@ pub struct MoleDetails { pub y_position: u8, } -/// Represents all the data of a Mii +/// Full Mii data representation. /// -/// Some values are not ordered _like_ the Mii Editor UI. The mapped values can be seen here: -/// +/// Some values are not ordered *like* the Mii Editor UI. The mapped values can be seen [here](https://www.3dbrew.org/wiki/Mii#Mapped_Editor_.3C-.3E_Hex_values). /// -/// This struct is returned by the [`MiiSelector`](crate::applets::mii_selector::MiiSelector) +/// This struct can be retrieved by [`MiiSelector::lauch()`](crate::applets::mii_selector::MiiSelector::launch). #[derive(Clone, Debug)] -pub struct MiiData { +pub struct Mii { /// Mii options. - pub options: MiiDataOptions, + pub options: Options, /// Position taken by the Mii on the Mii Selector screen. pub selector_position: SelectorPosition, /// Console the Mii was created on. @@ -293,7 +295,7 @@ pub struct MiiData { pub author_name: String, } -impl From for MiiData { +impl From for Mii { fn from(mii_data: ctru_sys::MiiData) -> Self { let raw_mii_data = mii_data._bindgen_opaque_blob; // Source for the representation and what each thing means: https://www.3dbrew.org/wiki/Mii @@ -358,7 +360,7 @@ impl From for MiiData { let name = utf16_byte_pairs_to_string(raw_utf16_name); let author_name = utf16_byte_pairs_to_string(raw_utf16_author); - let options = MiiDataOptions { + let options = Options { is_copying_allowed: raw_options[0], is_profanity_flag_enabled: raw_options[1], region_lock: { @@ -398,8 +400,8 @@ impl From for MiiData { let details = Details { sex: { match raw_details[0] { - true => MiiSex::Female, - false => MiiSex::Male, + true => Sex::Female, + false => Sex::Male, } }, birthday_month: partial_u8_bits_to_u8(&raw_details[1..=4]), @@ -485,7 +487,7 @@ impl From for MiiData { y_position: partial_u8_bits_to_u8(&raw_mole_details[10..=14]), }; - MiiData { + Mii { options, selector_position, console_identity, diff --git a/ctru-rs/src/services/cam.rs b/ctru-rs/src/services/cam.rs index ff9bd5b..dd4437b 100644 --- a/ctru-rs/src/services/cam.rs +++ b/ctru-rs/src/services/cam.rs @@ -22,7 +22,7 @@ pub struct Cam { } /// Different kinds of flip modes. -/// +/// /// See [`Camera::flip_image()`] to learn how to use this. #[doc(alias = "CAMU_Flip")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] @@ -39,7 +39,7 @@ pub enum FlipMode { } /// Size of the camera view. -/// +/// /// See [`Camera::set_view_size()`] to learn how to use this. #[doc(alias = "CAMU_Size")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] @@ -68,7 +68,7 @@ pub enum ViewSize { } /// Framerate settings. -/// +/// /// See [`Camera::set_frame_rate()`] to learn how to use this. #[doc(alias = "CAMU_FramRate")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] @@ -103,7 +103,7 @@ pub enum FrameRate { } /// White balance settings. -/// +/// /// See [`Camera::set_white_balance()`] and [`Camera::set_white_balance_without_base_up()`] to learn how to use this. #[doc(alias = "CAMU_WhiteBalance")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] @@ -124,7 +124,7 @@ pub enum WhiteBalance { } /// Photo mode settings. -/// +/// /// See [`Camera::set_photo_mode()`] to learn how to use this. #[doc(alias = "CAMU_PhotoMode")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] @@ -143,7 +143,7 @@ pub enum PhotoMode { } /// Special camera effects. -/// +/// /// See [`Camera::set_effect()`] to learn how to use this. #[doc(alias = "CAMU_Effect")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] @@ -160,13 +160,13 @@ pub enum Effect { /// Negative film effect. Negafilm = ctru_sys::EFFECT_NEGAFILM, /// Sepia effect. - /// + /// /// The difference between this and [`Sepia`](Effect::Sepia) is unknown. Sepia01 = ctru_sys::EFFECT_SEPIA01, } /// Contrast settings. -/// +/// /// See [`Camera::set_contrast()`] to learn how to use this. #[doc(alias = "CAMU_Contrast")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] @@ -181,7 +181,7 @@ pub enum Contrast { } /// Lens correction settings. -/// +/// /// See [`Camera::set_lens_correction()`] to learn how to use this. #[doc(alias = "CAMU_LensCorrection")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] @@ -196,7 +196,7 @@ pub enum LensCorrection { } /// Image output format. -/// +/// /// See [`Camera::set_output_format()`] to learn how to use this. #[doc(alias = "CAMU_OutputFormat")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] @@ -209,7 +209,7 @@ pub enum OutputFormat { } /// Playable shutter sounds. -/// +/// /// See [`Cam::play_shutter_sound()`] to learn how to use this. #[doc(alias = "CAMU_ShutterSoundType")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] @@ -224,7 +224,7 @@ pub enum ShutterSound { } /// Parameters to handle image trimming. -/// +/// /// See [`Camera::set_trimming_params()`] to learn how to use this. #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub struct TrimmingParams { @@ -237,7 +237,7 @@ pub struct TrimmingParams { impl TrimmingParams { /// Creates a new [`TrimmingParams`] and guarantees the start coordinates are less than or /// equal to the end coordinates. - /// + /// /// # Panics /// /// This function panics if the start coordinates are larger than the end coordinates (for each axis). @@ -264,7 +264,7 @@ pub struct ImageQualityCalibrationData(pub ctru_sys::CAMU_ImageQualityCalibratio pub struct StereoCameraCalibrationData(pub ctru_sys::CAMU_StereoCameraCalibrationData); /// Inward camera representation (facing the user of the 3DS). -/// +/// /// Usually used for selfies. #[non_exhaustive] pub struct InwardCam; @@ -296,7 +296,7 @@ impl Camera for OutwardLeftCam { } /// Both outer cameras combined. -/// +/// /// Usually used for 3D photos. #[non_exhaustive] pub struct BothOutwardCam; @@ -340,7 +340,7 @@ pub trait Camera { } /// Returns `true` if the camera is busy (receiving data). - /// + /// /// # Example /// /// ```no_run @@ -349,9 +349,9 @@ pub trait Camera { /// # /// use ctru::services::cam::{Cam, Camera}; /// let cam = Cam::new()?; - /// + /// /// let inward = &cam.inner_cam; - /// + /// /// // Inward cam is not busy since it is not being used. /// assert!(!inward.is_busy()?); /// # @@ -369,7 +369,7 @@ pub trait Camera { /// Returns the maximum amount of transfer bytes based on the view size, trimming, and other /// modifications set to the camera. - /// + /// /// # Example /// /// ```no_run @@ -378,9 +378,9 @@ pub trait Camera { /// # /// use ctru::services::cam::{Cam, Camera}; /// let cam = Cam::new()?; - /// + /// /// let inward = &cam.inner_cam; - /// + /// /// // Inward cam is not busy since it is not being used. /// let transfer_count = inward.transfer_byte_count(); /// # @@ -400,7 +400,7 @@ pub trait Camera { } /// Set whether or not the camera should trim the image. - /// + /// /// [`TrimmingParams`] can be set via [`Camera::set_trimming_params`]. #[doc(alias = "CAMU_SetTrimming")] fn set_trimming(&mut self, enabled: bool) -> crate::Result<()> { @@ -421,7 +421,7 @@ pub trait Camera { } /// Set trimming bounds based on image coordinates. - /// + /// /// For trimming to take effect it is required to pass `true` into [`Camera::set_trimming()`]. #[doc(alias = "CAMU_SetTrimmingParams")] fn set_trimming_params(&mut self, params: TrimmingParams) -> crate::Result<()> { @@ -463,9 +463,9 @@ pub trait Camera { } /// Set the trimming bounds relatively to the center of the image. - /// + /// /// # Notes - /// + /// /// The new width will be `trim_width / 2` to the left and right of the center. /// The new height will be `trim_height / 2` above and below the center. // TODO: This function doesn't use `TrimmingParams`. It'd be better to merge it with `set_trimming_params()` and change the `TrimmingParams` representation. @@ -606,7 +606,7 @@ pub trait Camera { /// coordinates of the second crop point. /// /// # Arguments - /// + /// /// * `width` - Width of the image /// * `height` - height of the image /// * `crop_0` - The first crop point in which the image will be trimmed @@ -672,9 +672,9 @@ pub trait Camera { } /// Sets the effect of the camera. - /// + /// /// # Notes - /// + /// /// This operation will override any previously set [`Effect`]s. /// Multiple effects can be set at once by combining the bitflags of [`Effect`]. #[doc(alias = "CAMU_SetEffect")] @@ -762,9 +762,9 @@ pub trait Camera { /// * `y` - Starting y coordinate of the window /// * `width` - Width of the window /// * `height` - Height of the window - /// + /// /// # Notes - /// + /// /// To activate automatic white balance, you must pass [`WhiteBalance::Auto`] into [`Camera::set_white_balance()`]. #[doc(alias = "CAMU_SetAutoWhiteBalanceWindow")] fn set_auto_white_balance_window( @@ -838,9 +838,9 @@ pub trait Camera { /// * `width` - Width of the desired image /// * `height` - Height of the desired image /// * `timeout` - Duration to wait for the image - /// + /// /// # Example - /// + /// /// ```no_run /// # use std::error::Error; /// # use std::time::Duration; @@ -848,19 +848,19 @@ pub trait Camera { /// # /// use ctru::services::cam::{Cam, Camera, ViewSize, OutputFormat}; /// let mut cam = Cam::new()?; - /// + /// /// // We borrow the inward facing `Camera`. /// let inward = &mut cam.inner_cam; - /// + /// /// inward.set_view_size(ViewSize::TopLCD)?; /// inward.set_output_format(OutputFormat::Rgb565)?; /// inward.set_noise_filter(true)?; /// inward.set_auto_exposure(true)?; /// inward.set_auto_white_balance(true)?; - /// + /// /// // Size of the top screen buffer at 2 bytes per pixel (RGB565). /// let mut buffer = vec![0; 400*240*2]; - /// + /// /// // Take picture with 3 seconds of timeout. /// inward.take_picture(&mut buffer, 400, 240, Duration::from_secs(3)); /// # @@ -948,7 +948,7 @@ impl Cam { /// This function will return an error if the service was unable to be initialized. /// Since this service requires no special or elevated permissions, errors are /// rare in practice. - /// + /// /// # Example /// /// ```no_run @@ -976,12 +976,12 @@ impl Cam { } /// Plays the specified sound based on the [`ShutterSound`] argument - /// + /// /// # Notes - /// + /// /// Playing the shutter sound does not require a liviving handle to the [`Ndsp`](crate::services::ndsp::Ndsp) service. /// Volume will always be maxed out to ensure everyone within photo range can hear the picture being taken (as by japanese law). - /// + /// /// # Example /// /// ```no_run @@ -990,7 +990,7 @@ impl Cam { /// # /// use ctru::services::cam::{Cam, ShutterSound}; /// let cam = Cam::new()?; - /// + /// /// // We play the shutter sound on the console's speakers! /// // (even though we aren't taking a photo :P) /// cam.play_shutter_sound(ShutterSound::Normal); From 35d299f6bec2452b13b4f4caff87b65e4ad0c6b7 Mon Sep 17 00:00:00 2001 From: Fenrir Date: Wed, 26 Jul 2023 15:24:21 -0600 Subject: [PATCH 041/101] Support static inline functions in ctru-sys --- ctru-sys/bindgen-ctru-sys/Cargo.toml | 2 +- ctru-sys/bindgen-ctru-sys/src/main.rs | 1 + ctru-sys/bindgen.sh | 9 + ctru-sys/build.rs | 11 +- ctru-sys/libextern.a | Bin 0 -> 14632 bytes ctru-sys/src/bindings.rs | 548 +++++++++++++++++++++++++- 6 files changed, 567 insertions(+), 4 deletions(-) create mode 100644 ctru-sys/libextern.a diff --git a/ctru-sys/bindgen-ctru-sys/Cargo.toml b/ctru-sys/bindgen-ctru-sys/Cargo.toml index 219af3e..9e223b3 100644 --- a/ctru-sys/bindgen-ctru-sys/Cargo.toml +++ b/ctru-sys/bindgen-ctru-sys/Cargo.toml @@ -4,5 +4,5 @@ version = "0.1.0" edition = "2021" [dependencies] -bindgen = "0.65.1" +bindgen = { version = "0.65.1", features = ["experimental"] } doxygen-rs = "0.4.2" diff --git a/ctru-sys/bindgen-ctru-sys/src/main.rs b/ctru-sys/bindgen-ctru-sys/src/main.rs index 222eb66..adf7e89 100644 --- a/ctru-sys/bindgen-ctru-sys/src/main.rs +++ b/ctru-sys/bindgen-ctru-sys/src/main.rs @@ -37,6 +37,7 @@ fn main() { .blocklist_type("__va_list") .opaque_type("MiiData") .derive_default(true) + .wrap_static_fns(true) .clang_args([ "--target=arm-none-eabi", "--sysroot", diff --git a/ctru-sys/bindgen.sh b/ctru-sys/bindgen.sh index 986ce56..7d4717c 100755 --- a/ctru-sys/bindgen.sh +++ b/ctru-sys/bindgen.sh @@ -26,4 +26,13 @@ cargo run --package bindgen-ctru-sys > src/bindings.rs echo "Formatting generated files..." cargo fmt --all +echo "Compiling static inline wrappers..." +arm-none-eabi-gcc -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft \ + -I${DEVKITPRO}/libctru/include \ + -I${DEVKITPRO}/libctru/include/3ds \ + -O -c -o extern.o /tmp/bindgen/extern.c +arm-none-eabi-ar -rcs libextern.a extern.o +rm extern.o + + echo "Generated bindings for ctru-sys version \"${CTRU_SYS_VERSION}.x+${LIBCTRU_VERSION}\"" diff --git a/ctru-sys/build.rs b/ctru-sys/build.rs index a695d47..0a1edca 100644 --- a/ctru-sys/build.rs +++ b/ctru-sys/build.rs @@ -5,7 +5,9 @@ use std::process::{Command, Output, Stdio}; fn main() { let dkp_path = env::var("DEVKITPRO").unwrap(); let profile = env::var("PROFILE").unwrap(); + let pwd = env::var("CARGO_MANIFEST_DIR").unwrap(); + // Link to libctru println!("cargo:rerun-if-changed=build.rs"); println!("cargo:rerun-if-env-changed=DEVKITPRO"); println!("cargo:rustc-link-search=native={dkp_path}/libctru/lib"); @@ -17,6 +19,10 @@ fn main() { } ); + // Link to static inline fns wrapper + println!("cargo:rustc-link-search=native={}", pwd); + println!("cargo:rustc-link-lib=static=extern"); + match check_libctru_version() { Ok((maj, min, patch)) => { eprintln!("using libctru version {maj}.{min}.{patch}"); @@ -77,8 +83,9 @@ fn check_libctru_version() -> Result<(String, String, String), Box> { .output()?; for line in String::from_utf8_lossy(&stdout).split('\n') { - let Some((_pkg, file)) = line.split_once(char::is_whitespace) - else { continue }; + let Some((_pkg, file)) = line.split_once(char::is_whitespace) else { + continue; + }; println!("cargo:rerun-if-changed={file}"); } diff --git a/ctru-sys/libextern.a b/ctru-sys/libextern.a new file mode 100644 index 0000000000000000000000000000000000000000..f42c7976be68a412aea8958468b6e2c4f0c14877 GIT binary patch literal 14632 zcmeHO4QyQ1mA-Fg9477%PZMVeV8{yzty_XKPD~UaBIDQzNr}mjF@fzO#^af1dz$&% z`3X)oE5>%VrB#wTacEfzn-@Y$cNMi!MO(CD*-7{*>H^KStcq4$@!pt$&=O-LDk4Pd z{my;w&RmaemR8$USISl1-1nXD+;h+UJMX^dn`P_6naIE`^{dqBsdep*zBXUmjcaaD zRUfD1UsYXwqt6nkJ@t&SKE^)v(8cS|uMf5cIznCHUD_5c9Mv+RkT#gpGD$|_PAwY= z1qZ?zExIL~jK;O>Ou8$zTbq;Y$Y%nXR7A^Ww?=0ct+JMZnHs@dI2Vg-%=h)p=2_tG zt#eT|@_sGXJ&-{Ix1}QCcrcgBg!{EhbrrTFl}MnSa}}1osrE!P5$@D>$0AxsD%lt7 z-xVKAx*o0F}APRQ6Uaw>g$c?9?*ZSSnd5#fjT67Fv8(D!3<`(-Ix2j5aIX zo=(SO5%gaw*`+1A_oS;0=9VGcq4k3e#`exd-I>*@<2Jq2=8Ptn>W)Qrb)@o1%pG)7 zrrP#YR-*1qN5eU}7@B@ptS=VKWwc~}ZeV)b*K`KsG0aKoce&8kEX~!dmP4l|wMb6# zF%*i&dLyBDDzYmS!$?#N%0wid%2w^k3@?(=B6*C&?%7qW!gK0GQpsp-&CzVHCdJyfE)MZv}{1j1Y(0))t;8zjd4mPwBC$%U!?@3DAAtA zzqAw*EHOqkJ#8{t;%%{{7S7B;T8p4P)4weyxoj1*xE=ZA=6JYYTCiFql}Kk0lqzmT ztD$v6Y_F^bK`l;JM?0CFML%EV^Rw}ZDxav~ZMRlaA7s;# zV?wZ6I4&Npa*5s2BBTPqGxX8ATq;-fAXnpo#qX~4NN)G^7WNNzB%*iZwY(NY)C|Yt zyg??j~ZfpccmyB9%dX z^kj~O<6DzaDWYaliM}i`75BJg)1V~jOC@tKZiSQ002N)E*_!N2)yi&-?@15LNdyNp zY)K?P;<4neHPLJ^7mZa-$->R4OsCeH@2}Kj?bBLPVqY%r$6I~0_pbb|ZEFK+UF$=J z)Kh=|rfr)QMZvb*N(yUcRm52CIxeqk<5@HFuut(jWsz=fxJoH)P#q`y@`Se9DpYBu^>gHd2-+hz0 zhD;|baGT6AWV&tLbi-8>WS8;+E0o0jyi2Wn=F`na^;p@-esGSlk+RD>Qa+{r+KUi{2KKh2&fBoBTt`jJ&Binx1_Kwvl{{5D1bbz4Gf6JX+`gk_k9xH1^aTuudfH&V{biTB zzwBoF%O3CkGU-#h``9n6e(+lTpw^F_=j{UafG>haf0PuaFA{PwE`+(PW}Ir}PV|S+ zdw9bod|r@^f41+JPTv1p;*T|qa=pVF3TBqQ`=%wEG}CN~-yhy!Nb<9gTRMj~6f1J- z0|jG1{a@)5uTjD24OdP0G2c2d-?peD_8bU|*D+S_!1^GY4vas19&s>zjC^p}YlHfO z=F+tOz%-?PBsp*6{|3feCaK z^So!GSpQqjErjkOuKT{NJNZfju(9{PiNfCgi3NL)o&O5*xAuNCFn zJ&1OUi1`HNlHx2>`basWoBN9IzS+S0?ttlRL|?iJ<~2=LoOgRi%bwyW#^{LQ^qn-^ zsuepGw!`%Jeqq4wGUgk_ctXcFhPd@uiN{&!@%fH9lK0lW&A!o(Ii0@=)%uv+F5Q`AgQ5VHU8cR3oA%ESd$AkKuzIzd~UNU&h zhn|z&YdVU*s;Mgozt2?so>^BAb)A`3mycqwin`GDBkjY+SnDCf0iT%hJ=lV5*#W~9 z7%d-uewncVeaF1VA%~w{Jb(OFANmkCCp!>(*&XATGxnd{ci3Zot3TDA_L3S1mliI= z^X)UkX4|#Hrav7n%^TItx`J-r@)O-$^uhsi&GQG$#?#0@J8ZI|)gOym5hvGsy#y`)!0^Ay;3(9qs|*zs7}ZV{iVjY zP~V$}%r)l@nTt@@4euN>`FwzFRlTRQW<(SJ)beAf_Gyb(fnP)un$E$M^|2BjQI)%Q-`^}N43h#|8V#= z8h=sF!$!;c^?GF5b4W1bQyIeaG!y+JoeSb?wY6HA8-vA${U^L?eEo6n*=j}M54k6opk!&nCn ztOMpfT^hnO=){#nd>!zZirA@$_IFVGyA1{H=NxZ8_VTo6m12wVaV31Dc|69P#wYbt z%wZ3F^Qu-KG{OeGTX-qQeve`etL*t`Wn0PGzlpsd$pYh;dy6sOaTOL*?8TVacnEmM zIBeQ@crlMzwk^tNuF(5{i}q~TCn4v1Ht{Y%K2jMs@+I(9VGC(pIG6_B}Ma@ zX6t^Pa<-gi-{`(pZok zYCGOB>l^KNHrWR612(q!gQ=-2M0uKbwD%?bS{o~{PN<#hB|m)BZ#6b(zT5k1^79Jv zOV}kF!YGTnD}_5n=Sik2@}6h!c@K>Vd4)+nD|i%6aR>W ziPt4e{7DHDe@eo{KP_S6ixTGc>mcOG^8ciSiGNALRQ{}li7#TWVI`~la}p+g%lzql zw}gpbNk)0H$4A1%Uyv}r#YWLe*8FXfF!8E{seC}f#CJ=WctgU(pOY~0E)RZqvix&P znD}iHrt$#^6aT)1iT_B##IK+qo-F%53DfO*2~&B$gy}XXVd4uC2CO6}tK;jvBCzqK zq)+AFmoVMB7Kjpd`z1{LItf$x^%5q2pM<%85+?pt2^0UCgo)pV7h@|~^#>#@7|NY& zUQPSvF>I^w9ThPOmjYf+PKK`)QgSjk!#f~POYpl8C49)~o@@}_j(i0!vP(FQoW9r6 zlqdW(x&pWuM_$;sovCdC2+umn^DgKK3HdbPx zRVE006nwzePXbds7WI9#M*m^p3zGdG0XO3k^`FH(#cP3ogL{h4OKkgY#4?JHks4+vlHCF9fla~h0&W5p?fpAoA8<2tX+9hW zz8hHd-;aSsA{);G)ALK%`&A8p4!9ukQ#HI7&jxyaiSpN1o)wmC6RzOwTV- z{_8dTao{5OmGG6?^JEQQ1b#>2U#sEY23`W6MR`RE3A|3=PVjBE{m<9%HvzZ#gv;1Qc&1x(NL z6*k@pOwVu8zxM$fz^cuE6PUuJ-^M3_{lIY>7lBVo_*LK~xVG5*Io$W)I%nhG6Nklu ze|)_D0yhC%6pv~AK7;$XgxBK!0bCSAiQkNSk;vzrz_h;@#Xa$TxTpO@z{b0Q9|t~a z<1YiR!$W1AjlTh$1{USN15AHrQ*HiVfocCB#{V^7+ArK~^OL|QfrWo=)J6LRQGN+9 z?GLut`px7U@I5wO2YeD(_)B{u+7IBL)gCI3hhDRd?*|sii<__3;BVI8CxB`HK)TdF zF96ei!EfW&foXrB+W2=h<=yBT9Xy)J%U=upU0^Yv{lG z5s#h#7KwcP5ispH1pi_U{~y3^><7enyj#Q5*oj2;E~T-7ekbm!{mXz0z+(Jv0;c`N zpv~U}O#2B@e;imOvNr@Am3U_V0XV`|gxQKH!?}UHmc@(R#RGjfA7UN%yLh0FO+U3a z?Lc34ccgNxfleya=zh`@ezF-l>jyIzkNo|AI`VfHPJZ2)X8$)Q0C8eb%g}MzP&$`k zbDReZg>e22S2`B8Rc0Lj3xy)NOg=P#GlQWlPO#c~a~u}5wQ-;ZM+s*Xn*9(VJmn{B zL*Yz+9H$HI8Z6}*rwS|DnS8R3&Kol6P@yqruWtC`0h+XLMp5Z39+u5glvvWsUStz-QBWZ=h~g~UpuPr#vgG`2gDin5DmBR}EU z$o_O5XDV^~a-Zhb7sc<_x866(=m2I2QTme4Mh2{$~J=V)n6_rz^SS&SZjA z*vB8W+?34bGg=p(3tE)*hqC;CrqF>*QEtxjmU9w+&_PT*A?g1c&~a=$4nFpDruDZB z#}0hsQSgrWCA^#1Ieph^N?=2eZz+_!@Qt8p2>X6Jk0W<{+4@%Rc)5n7-u_K565k zozpj5k~iXAiOMzG`FcC2Z@9$YL-?0?2e)(9lHHTYg?o|bGFCny?(pZcmK@%`zOBjd!W4(F&2MKiaCreAAhABdyK6qM( z-$D2&61@*o!kIHhugrd2l%k)*_bL=58I^b8BHe3kjA_EtDajTINSD%exJdth((^%w z%B;pkiR=kq2~)kq<7^qvG0k~;3VO} u32_; +} +extern "C" { + #[doc = "Creates a header to share handles\n # Arguments\n\n* `number` - The number of handles following this header. Max 64.\n # Returns\n\nThe created shared handles header.\n\n The #number next values are handles that will be shared between the two processes.\n\n > **Note:** Zero values will have no effect."] + #[link_name = "IPC_Desc_SharedHandles__extern"] + pub fn IPC_Desc_SharedHandles(number: ::libc::c_uint) -> u32_; +} +extern "C" { + #[doc = "Creates the header to transfer handle ownership\n # Arguments\n\n* `number` - The number of handles following this header. Max 64.\n # Returns\n\nThe created handle transfer header.\n\n The #number next values are handles that will be duplicated and closed by the other process.\n\n > **Note:** Zero values will have no effect."] + #[link_name = "IPC_Desc_MoveHandles__extern"] + pub fn IPC_Desc_MoveHandles(number: ::libc::c_uint) -> u32_; +} +extern "C" { + #[doc = "Returns the code to ask the kernel to fill the handle with the current process ID.\n # Returns\n\nThe code to request the current process ID.\n\n The next value is a placeholder that will be replaced by the current process ID by the kernel."] + #[link_name = "IPC_Desc_CurProcessId__extern"] + pub fn IPC_Desc_CurProcessId() -> u32_; +} +extern "C" { + #[link_name = "IPC_Desc_CurProcessHandle__extern"] + pub fn IPC_Desc_CurProcessHandle() -> u32_; +} +extern "C" { + #[doc = "Creates a header describing a static buffer.\n # Arguments\n\n* `size` - Size of the buffer. Max ?0x03FFFF?.\n * `buffer_id` - The Id of the buffer. Max 0xF.\n # Returns\n\nThe created static buffer header.\n\n The next value is a pointer to the buffer. It will be copied to TLS offset 0x180 + static_buffer_id*8."] + #[link_name = "IPC_Desc_StaticBuffer__extern"] + pub fn IPC_Desc_StaticBuffer(size: usize, buffer_id: ::libc::c_uint) -> u32_; +} +extern "C" { + #[doc = "Creates a header describing a buffer to be sent over PXI.\n # Arguments\n\n* `size` - Size of the buffer. Max 0x00FFFFFF.\n * `buffer_id` - The Id of the buffer. Max 0xF.\n * `is_read_only` - true if the buffer is read-only. If false, the buffer is considered to have read-write access.\n # Returns\n\nThe created PXI buffer header.\n\n The next value is a phys-address of a table located in the BASE memregion."] + #[link_name = "IPC_Desc_PXIBuffer__extern"] + pub fn IPC_Desc_PXIBuffer(size: usize, buffer_id: ::libc::c_uint, is_read_only: bool) -> u32_; +} +extern "C" { + #[doc = "Creates a header describing a buffer from the main memory.\n # Arguments\n\n* `size` - Size of the buffer. Max 0x0FFFFFFF.\n * `rights` - The rights of the buffer for the destination process.\n # Returns\n\nThe created buffer header.\n\n The next value is a pointer to the buffer."] + #[link_name = "IPC_Desc_Buffer__extern"] + pub fn IPC_Desc_Buffer(size: usize, rights: IPC_BufferRights) -> u32_; +} #[doc = "< Memory un-mapping"] pub const MEMOP_FREE: MemOp = 1; #[doc = "< Reserve memory"] @@ -2354,6 +2397,31 @@ impl Default for StartupInfo { } } } +extern "C" { + #[doc = "Gets the thread local storage buffer.\n # Returns\n\nThe thread local storage bufger."] + #[link_name = "getThreadLocalStorage__extern"] + pub fn getThreadLocalStorage() -> *mut ::libc::c_void; +} +extern "C" { + #[doc = "Gets the thread command buffer.\n # Returns\n\nThe thread command bufger."] + #[link_name = "getThreadCommandBuffer__extern"] + pub fn getThreadCommandBuffer() -> *mut u32_; +} +extern "C" { + #[doc = "Gets the thread static buffer.\n # Returns\n\nThe thread static bufger."] + #[link_name = "getThreadStaticBuffers__extern"] + pub fn getThreadStaticBuffers() -> *mut u32_; +} +extern "C" { + #[doc = "Writes the default DMA device config that the kernel uses when DMACFG_*_IS_DEVICE and DMACFG_*_USE_CFG are not set"] + #[link_name = "dmaDeviceConfigInitDefault__extern"] + pub fn dmaDeviceConfigInitDefault(cfg: *mut DmaDeviceConfig); +} +extern "C" { + #[doc = "Initializes a DmaConfig instance with sane defaults for RAM<>RAM tranfers"] + #[link_name = "dmaConfigInitDefault__extern"] + pub fn dmaConfigInitDefault(cfg: *mut DmaConfig); +} extern "C" { #[must_use] #[doc = "Memory management\n# *\n* Controls memory mapping\n # Arguments\n\n* `addr_out` (direction out) - The virtual address resulting from the operation. Usually the same as addr0.\n * `addr0` - The virtual address to be used for the operation.\n * `addr1` - The virtual address to be (un)mirrored by `addr0` when using MEMOP_MAP or MEMOP_UNMAP.\n It has to be pointing to a RW memory.\n* Use NULL if the operation is MEMOP_FREE or MEMOP_ALLOC.\n * `size` - The requested size for MEMOP_ALLOC and MEMOP_ALLOC_LINEAR.\n * `op` - Operation flags. See MemOp.\n * `perm` - A combination of MEMPERM_READ and MEMPERM_WRITE. Using MEMPERM_EXECUTE will return an error.\n Value 0 is used when unmapping memory.\n*\n* If a memory is mapped for two or more addresses, you have to use MEMOP_UNMAP before being able to MEMOP_FREE it.\n* MEMOP_MAP will fail if `addr1` was already mapped to another address.\n\n* More information is available at http://3dbrew.org/wiki/SVC#Memory_Mapping.\n*\n* [`svcControlProcessMemory`]\n/"] @@ -3945,6 +4013,41 @@ extern "C" { #[doc = "Retrieves basic information about a service error.\n # Arguments\n\n* `error` - Error to retrieve information about.\n # Returns\n\nA string containing a summary of an error.\n\n This can be used to get some details about an error returned by a service call."] pub fn osStrError(error: Result) -> *const ::libc::c_char; } +extern "C" { + #[doc = "Gets the system's FIRM version.\n # Returns\n\nThe system's FIRM version.\n\n This can be used to compare system versions easily with SYSTEM_VERSION."] + #[link_name = "osGetFirmVersion__extern"] + pub fn osGetFirmVersion() -> u32_; +} +extern "C" { + #[doc = "Gets the system's kernel version.\n # Returns\n\nThe system's kernel version.\n\n This can be used to compare system versions easily with SYSTEM_VERSION.\n\n if(osGetKernelVersion() > SYSTEM_VERSION(2,46,0)) printf(\"You are running 9.0 or higher"] + #[link_name = "osGetKernelVersion__extern"] + pub fn osGetKernelVersion() -> u32_; +} +extern "C" { + #[doc = "Gets the system's \"core version\" (2 on NATIVE_FIRM, 3 on SAFE_FIRM, etc.)"] + #[link_name = "osGetSystemCoreVersion__extern"] + pub fn osGetSystemCoreVersion() -> u32_; +} +extern "C" { + #[doc = "Gets the system's memory layout ID (0-5 on Old 3DS, 6-8 on New 3DS)"] + #[link_name = "osGetApplicationMemType__extern"] + pub fn osGetApplicationMemType() -> u32_; +} +extern "C" { + #[doc = "Gets the size of the specified memory region.\n # Arguments\n\n* `region` - Memory region to check.\n # Returns\n\nThe size of the memory region, in bytes."] + #[link_name = "osGetMemRegionSize__extern"] + pub fn osGetMemRegionSize(region: MemRegion) -> u32_; +} +extern "C" { + #[doc = "Gets the number of used bytes within the specified memory region.\n # Arguments\n\n* `region` - Memory region to check.\n # Returns\n\nThe number of used bytes of memory."] + #[link_name = "osGetMemRegionUsed__extern"] + pub fn osGetMemRegionUsed(region: MemRegion) -> u32_; +} +extern "C" { + #[doc = "Gets the number of free bytes within the specified memory region.\n # Arguments\n\n* `region` - Memory region to check.\n # Returns\n\nThe number of free bytes of memory."] + #[link_name = "osGetMemRegionFree__extern"] + pub fn osGetMemRegionFree(region: MemRegion) -> u32_; +} extern "C" { #[doc = "Reads the latest reference timepoint published by PTM.\n # Returns\n\nStructure (see osTimeRef_s)."] pub fn osGetTimeRef() -> osTimeRef_s; @@ -3953,10 +4056,35 @@ extern "C" { #[doc = "Gets the current time.\n # Returns\n\nThe number of milliseconds since 1st Jan 1900 00:00."] pub fn osGetTime() -> u64_; } +extern "C" { + #[doc = "Starts a tick counter.\n # Arguments\n\n* `cnt` - The tick counter."] + #[link_name = "osTickCounterStart__extern"] + pub fn osTickCounterStart(cnt: *mut TickCounter); +} +extern "C" { + #[doc = "Updates the elapsed time in a tick counter.\n # Arguments\n\n* `cnt` - The tick counter."] + #[link_name = "osTickCounterUpdate__extern"] + pub fn osTickCounterUpdate(cnt: *mut TickCounter); +} extern "C" { #[doc = "Reads the elapsed time in a tick counter.\n # Arguments\n\n* `cnt` - The tick counter.\n # Returns\n\nThe number of milliseconds elapsed."] pub fn osTickCounterRead(cnt: *const TickCounter) -> f64; } +extern "C" { + #[doc = "Gets the current Wifi signal strength.\n # Returns\n\nThe current Wifi signal strength.\n\n Valid values are 0-3:\n - 0 means the signal strength is terrible or the 3DS is disconnected from\n all networks.\n - 1 means the signal strength is bad.\n - 2 means the signal strength is decent.\n - 3 means the signal strength is good.\n\n Values outside the range of 0-3 should never be returned.\n\n These values correspond with the number of wifi bars displayed by Home Menu."] + #[link_name = "osGetWifiStrength__extern"] + pub fn osGetWifiStrength() -> u8_; +} +extern "C" { + #[doc = "Gets the state of the 3D slider.\n # Returns\n\nThe state of the 3D slider (0.0~1.0)"] + #[link_name = "osGet3DSliderState__extern"] + pub fn osGet3DSliderState() -> f32; +} +extern "C" { + #[doc = "Checks whether a headset is connected.\n # Returns\n\ntrue or false."] + #[link_name = "osIsHeadsetConnected__extern"] + pub fn osIsHeadsetConnected() -> bool; +} extern "C" { #[doc = "Configures the New 3DS speedup.\n # Arguments\n\n* `enable` - Specifies whether to enable or disable the speedup."] pub fn osSetSpeedupEnable(enable: bool); @@ -3989,6 +4117,22 @@ pub struct __lock_t { } pub type _LOCK_RECURSIVE_T = __lock_t; pub type _COND_T = u32; +extern "C" { + #[link_name = "__libc_lock_init__extern"] + pub fn __libc_lock_init(lock: *mut _LOCK_T); +} +extern "C" { + #[link_name = "__libc_lock_close__extern"] + pub fn __libc_lock_close(lock: *mut _LOCK_T); +} +extern "C" { + #[link_name = "__libc_lock_init_recursive__extern"] + pub fn __libc_lock_init_recursive(lock: *mut _LOCK_RECURSIVE_T); +} +extern "C" { + #[link_name = "__libc_lock_close_recursive__extern"] + pub fn __libc_lock_close_recursive(lock: *mut _LOCK_RECURSIVE_T); +} extern "C" { pub fn __libc_lock_acquire(lock: *mut _LOCK_T); } @@ -4007,6 +4151,10 @@ extern "C" { extern "C" { pub fn __libc_lock_try_acquire_recursive(lock: *mut _LOCK_RECURSIVE_T) -> ::libc::c_int; } +extern "C" { + #[link_name = "__libc_cond_init__extern"] + pub fn __libc_cond_init(cond: *mut _COND_T) -> ::libc::c_int; +} extern "C" { pub fn __libc_cond_signal(cond: *mut _COND_T) -> ::libc::c_int; } @@ -4053,6 +4201,51 @@ pub struct LightSemaphore { #[doc = "< The maximum release count of the semaphore"] pub max_count: s16, } +extern "C" { + #[doc = "Performs a Data Synchronization Barrier operation."] + #[link_name = "__dsb__extern"] + pub fn __dsb(); +} +extern "C" { + #[doc = "Performs a Data Memory Barrier operation."] + #[link_name = "__dmb__extern"] + pub fn __dmb(); +} +extern "C" { + #[doc = "Performs a clrex operation."] + #[link_name = "__clrex__extern"] + pub fn __clrex(); +} +extern "C" { + #[doc = "Performs a ldrex operation.\n # Arguments\n\n* `addr` - Address to perform the operation on.\n # Returns\n\nThe resulting value."] + #[link_name = "__ldrex__extern"] + pub fn __ldrex(addr: *mut s32) -> s32; +} +extern "C" { + #[doc = "Performs a strex operation.\n # Arguments\n\n* `addr` - Address to perform the operation on.\n * `val` - Value to store.\n # Returns\n\nWhether the operation was successful."] + #[link_name = "__strex__extern"] + pub fn __strex(addr: *mut s32, val: s32) -> bool; +} +extern "C" { + #[doc = "Performs a ldrexh operation.\n # Arguments\n\n* `addr` - Address to perform the operation on.\n # Returns\n\nThe resulting value."] + #[link_name = "__ldrexh__extern"] + pub fn __ldrexh(addr: *mut u16_) -> u16_; +} +extern "C" { + #[doc = "Performs a strexh operation.\n # Arguments\n\n* `addr` - Address to perform the operation on.\n * `val` - Value to store.\n # Returns\n\nWhether the operation was successful."] + #[link_name = "__strexh__extern"] + pub fn __strexh(addr: *mut u16_, val: u16_) -> bool; +} +extern "C" { + #[doc = "Performs a ldrexb operation.\n # Arguments\n\n* `addr` - Address to perform the operation on.\n # Returns\n\nThe resulting value."] + #[link_name = "__ldrexb__extern"] + pub fn __ldrexb(addr: *mut u8_) -> u8_; +} +extern "C" { + #[doc = "Performs a strexb operation.\n # Arguments\n\n* `addr` - Address to perform the operation on.\n * `val` - Value to store.\n # Returns\n\nWhether the operation was successful."] + #[link_name = "__strexb__extern"] + pub fn __strexb(addr: *mut u8_, val: u8_) -> bool; +} extern "C" { #[must_use] #[doc = "Function used to implement user-mode synchronization primitives.\n # Arguments\n\n* `addr` - Pointer to a signed 32-bit value whose address will be used to identify waiting threads.\n * `type` - Type of action to be performed by the arbiter\n * `value` - Number of threads to signal if using ARBITRATION_SIGNAL, or the value used for comparison.\n\n This will perform an arbitration based on #type. The comparisons are done between #value and the value at the address #addr.\n\n s32 val=0;\n // Does *nothing* since val >= 0\n syncArbitrateAddress(&val,ARBITRATION_WAIT_IF_LESS_THAN,0);\n > **Note:** Usage of this function entails an implicit Data Memory Barrier (dmb)."] @@ -4120,6 +4313,16 @@ extern "C" { #[doc = "Wakes up threads waiting on a condition variable.\n # Arguments\n\n* `cv` - Pointer to the condition variable.\n * `num_threads` - Maximum number of threads to wake up (or ARBITRATION_SIGNAL_ALL to wake them all)."] pub fn CondVar_WakeUp(cv: *mut CondVar, num_threads: s32); } +extern "C" { + #[doc = "Wakes up a single thread waiting on a condition variable.\n # Arguments\n\n* `cv` - Pointer to the condition variable."] + #[link_name = "CondVar_Signal__extern"] + pub fn CondVar_Signal(cv: *mut CondVar); +} +extern "C" { + #[doc = "Wakes up all threads waiting on a condition variable.\n # Arguments\n\n* `cv` - Pointer to the condition variable."] + #[link_name = "CondVar_Broadcast__extern"] + pub fn CondVar_Broadcast(cv: *mut CondVar); +} extern "C" { #[doc = "Initializes a light event.\n # Arguments\n\n* `event` - Pointer to the event.\n * `reset_type` - Type of reset the event uses (RESET_ONESHOT/RESET_STICKY)."] pub fn LightEvent_Init(event: *mut LightEvent, reset_type: ResetType); @@ -4215,6 +4418,15 @@ extern "C" { #[doc = "Exits the current libctru thread with an exit code (not usable from the main thread).\n # Arguments\n\n* `rc` - Exit code"] pub fn threadExit(rc: ::libc::c_int) -> !; } +extern "C" { + #[doc = "Sets the exception handler for the current thread. Called from the main thread, this sets the default handler.\n # Arguments\n\n* `handler` - The exception handler, necessarily an ARM function that does not return\n * `stack_top` - A pointer to the top of the stack that will be used by the handler. See also RUN_HANDLER_ON_FAULTING_STACK\n * `exception_data` - A pointer to the buffer that will contain the exception data.\nSee also WRITE_DATA_TO_HANDLER_STACK and WRITE_DATA_TO_FAULTING_STACK\n\n To have CPU exceptions reported through this mechanism, it is normally necessary that UNITINFO is set to a non-zero value when Kernel11 starts,\n and this mechanism is also controlled by svcKernelSetState type 6, see 3dbrew.\n\n VFP exceptions are always reported this way even if the process is being debugged using the debug SVCs.\n\n The current thread need not be a libctru thread."] + #[link_name = "threadOnException__extern"] + pub fn threadOnException( + handler: ExceptionHandler, + stack_top: *mut ::libc::c_void, + exception_data: *mut ERRF_ExceptionData, + ); +} #[doc = "Framebuffer information."] #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -4311,6 +4523,11 @@ pub const GSPGPU_EVENT_DMA: GSPGPU_Event = 6; pub const GSPGPU_EVENT_MAX: GSPGPU_Event = 7; #[doc = "GSPGPU events."] pub type GSPGPU_Event = ::libc::c_uint; +extern "C" { + #[doc = "Gets the number of bytes per pixel for the specified format.\n # Arguments\n\n* `format` - See GSPGPU_FramebufferFormat.\n # Returns\n\nBytes per pixel."] + #[link_name = "gspGetBytesPerPixel__extern"] + pub fn gspGetBytesPerPixel(format: GSPGPU_FramebufferFormat) -> ::libc::c_uint; +} extern "C" { #[must_use] #[doc = "Initializes GSPGPU."] @@ -4674,10 +4891,40 @@ pub const RUNFLAG_APTREINIT: _bindgen_ty_9 = 2; pub const RUNFLAG_APTCHAINLOAD: _bindgen_ty_9 = 4; #[doc = "System run-flags."] pub type _bindgen_ty_9 = ::libc::c_uint; +extern "C" { + #[doc = "Gets whether the application was launched from a homebrew environment.\n # Returns\n\nWhether the application was launched from a homebrew environment."] + #[link_name = "envIsHomebrew__extern"] + pub fn envIsHomebrew() -> bool; +} extern "C" { #[doc = "Retrieves a handle from the environment handle list.\n # Arguments\n\n* `name` - Name of the handle.\n # Returns\n\nThe retrieved handle."] pub fn envGetHandle(name: *const ::libc::c_char) -> Handle; } +extern "C" { + #[doc = "Gets the environment-recommended app ID to use with APT.\n # Returns\n\nThe APT app ID."] + #[link_name = "envGetAptAppId__extern"] + pub fn envGetAptAppId() -> u32_; +} +extern "C" { + #[doc = "Gets the size of the application heap.\n # Returns\n\nThe application heap size."] + #[link_name = "envGetHeapSize__extern"] + pub fn envGetHeapSize() -> u32_; +} +extern "C" { + #[doc = "Gets the size of the linear heap.\n # Returns\n\nThe linear heap size."] + #[link_name = "envGetLinearHeapSize__extern"] + pub fn envGetLinearHeapSize() -> u32_; +} +extern "C" { + #[doc = "Gets the environment argument list.\n # Returns\n\nThe argument list."] + #[link_name = "envGetSystemArgList__extern"] + pub fn envGetSystemArgList() -> *const ::libc::c_char; +} +extern "C" { + #[doc = "Gets the environment run flags.\n # Returns\n\nThe run flags."] + #[link_name = "envGetSystemRunFlags__extern"] + pub fn envGetSystemRunFlags() -> u32_; +} pub type _off_t = __int64_t; pub type _fpos_t = __int64_t; pub type __ino_t = __uint32_t; @@ -5064,6 +5311,17 @@ extern "C" { insize: usize, ) -> bool; } +extern "C" { + #[doc = "Decompress data\n # Arguments\n\n* `output` (direction in) - Output buffer\n * `size` (direction in) - Output size limit\n * `callback` (direction in) - Data callback (see decompressV())\n * `userdata` (direction in) - User data passed to callback (see decompressV())\n * `insize` (direction in) - Size of userdata (see decompressV())\n # Returns\n\nWhether succeeded"] + #[link_name = "decompress__extern"] + pub fn decompress( + output: *mut ::libc::c_void, + size: usize, + callback: decompressCallback, + userdata: *mut ::libc::c_void, + insize: usize, + ) -> bool; +} extern "C" { #[doc = "Decompress LZSS/LZ10\n # Arguments\n\n* `iov` (direction in) - Output vector\n * `iovcnt` (direction in) - Number of buffers\n * `callback` (direction in) - Data callback (see decompressV())\n * `userdata` (direction in) - User data passed to callback (see decompressV())\n * `insize` (direction in) - Size of userdata (see decompressV())\n # Returns\n\nWhether succeeded"] pub fn decompressV_LZSS( @@ -5074,6 +5332,17 @@ extern "C" { insize: usize, ) -> bool; } +extern "C" { + #[doc = "Decompress LZSS/LZ10\n # Arguments\n\n* `output` (direction in) - Output buffer\n * `size` (direction in) - Output size limit\n * `callback` (direction in) - Data callback (see decompressV())\n * `userdata` (direction in) - User data passed to callback (see decompressV())\n * `insize` (direction in) - Size of userdata (see decompressV())\n # Returns\n\nWhether succeeded"] + #[link_name = "decompress_LZSS__extern"] + pub fn decompress_LZSS( + output: *mut ::libc::c_void, + size: usize, + callback: decompressCallback, + userdata: *mut ::libc::c_void, + insize: usize, + ) -> bool; +} extern "C" { #[doc = "Decompress LZ11\n # Arguments\n\n* `iov` (direction in) - Output vector\n * `iovcnt` (direction in) - Number of buffers\n * `callback` (direction in) - Data callback (see decompressV())\n * `userdata` (direction in) - User data passed to callback (see decompressV())\n * `insize` (direction in) - Size of userdata (see decompressV())\n # Returns\n\nWhether succeeded"] pub fn decompressV_LZ11( @@ -5084,6 +5353,17 @@ extern "C" { insize: usize, ) -> bool; } +extern "C" { + #[doc = "Decompress LZ11\n # Arguments\n\n* `output` (direction in) - Output buffer\n * `size` (direction in) - Output size limit\n * `callback` (direction in) - Data callback (see decompressV())\n * `userdata` (direction in) - User data passed to callback (see decompressV())\n * `insize` (direction in) - Size of userdata (see decompressV())\n # Returns\n\nWhether succeeded"] + #[link_name = "decompress_LZ11__extern"] + pub fn decompress_LZ11( + output: *mut ::libc::c_void, + size: usize, + callback: decompressCallback, + userdata: *mut ::libc::c_void, + insize: usize, + ) -> bool; +} extern "C" { #[doc = "Decompress Huffman\n # Arguments\n\n* `bits` (direction in) - Data size in bits (usually 4 or 8)\n * `iov` (direction in) - Output vector\n * `iovcnt` (direction in) - Number of buffers\n * `callback` (direction in) - Data callback (see decompressV())\n * `userdata` (direction in) - User data passed to callback (see decompressV())\n * `insize` (direction in) - Size of userdata (see decompressV())\n # Returns\n\nWhether succeeded"] pub fn decompressV_Huff( @@ -5095,6 +5375,18 @@ extern "C" { insize: usize, ) -> bool; } +extern "C" { + #[doc = "Decompress Huffman\n # Arguments\n\n* `bits` (direction in) - Data size in bits (usually 4 or 8)\n * `output` (direction in) - Output buffer\n * `size` (direction in) - Output size limit\n * `callback` (direction in) - Data callback (see decompressV())\n * `userdata` (direction in) - User data passed to callback (see decompressV())\n * `insize` (direction in) - Size of userdata (see decompressV())\n # Returns\n\nWhether succeeded"] + #[link_name = "decompress_Huff__extern"] + pub fn decompress_Huff( + bits: usize, + output: *mut ::libc::c_void, + size: usize, + callback: decompressCallback, + userdata: *mut ::libc::c_void, + insize: usize, + ) -> bool; +} extern "C" { #[doc = "Decompress run-length encoding\n # Arguments\n\n* `iov` (direction in) - Output vector\n * `iovcnt` (direction in) - Number of buffers\n * `callback` (direction in) - Data callback (see decompressV())\n * `userdata` (direction in) - User data passed to callback (see decompressV())\n * `insize` (direction in) - Size of userdata (see decompressV())\n # Returns\n\nWhether succeeded"] pub fn decompressV_RLE( @@ -5105,6 +5397,17 @@ extern "C" { insize: usize, ) -> bool; } +extern "C" { + #[doc = "Decompress run-length encoding\n # Arguments\n\n* `output` (direction in) - Output buffer\n * `size` (direction in) - Output size limit\n * `callback` (direction in) - Data callback (see decompressV())\n * `userdata` (direction in) - User data passed to callback (see decompressV())\n * `insize` (direction in) - Size of userdata (see decompressV())\n # Returns\n\nWhether succeeded"] + #[link_name = "decompress_RLE__extern"] + pub fn decompress_RLE( + output: *mut ::libc::c_void, + size: usize, + callback: decompressCallback, + userdata: *mut ::libc::c_void, + insize: usize, + ) -> bool; +} extern "C" { #[doc = "Convert a UTF-8 sequence into a UTF-32 codepoint\n\n # Arguments\n\n* `out` (direction out) - Output codepoint\n * `in` (direction in) - Input sequence\n\n # Returns\n\nnumber of input code units consumed\n -1 for error"] pub fn decode_utf8(out: *mut u32, in_: *const u8) -> isize; @@ -7177,6 +7480,15 @@ pub const APTPOS_RESIDENT: APT_AppletPos = 4; #[doc = "APT applet position."] pub type APT_AppletPos = ::libc::c_int; pub type APT_AppletAttr = u8_; +extern "C" { + #[doc = "Create an APT_AppletAttr bitfield from its components."] + #[link_name = "aptMakeAppletAttr__extern"] + pub fn aptMakeAppletAttr( + pos: APT_AppletPos, + manualGpuRights: bool, + manualDspRights: bool, + ) -> APT_AppletAttr; +} pub const APTREPLY_REJECT: APT_QueryReply = 0; pub const APTREPLY_ACCEPT: APT_QueryReply = 1; pub const APTREPLY_LATER: APT_QueryReply = 2; @@ -7360,10 +7672,20 @@ extern "C" { #[doc = "Returns true if there is an incoming HOME button press rejected by the policy set by aptSetHomeAllowed (use this to show a \"no HOME allowed\" icon)."] pub fn aptCheckHomePressRejected() -> bool; } +extern "C" { + #[doc = "> **Deprecated** Alias for aptCheckHomePressRejected."] + #[link_name = "aptIsHomePressed__extern"] + pub fn aptIsHomePressed() -> bool; +} extern "C" { #[doc = "Jumps back to the HOME menu."] pub fn aptJumpToHomeMenu(); } +extern "C" { + #[doc = "Handles incoming jump-to-HOME requests."] + #[link_name = "aptHandleJumpToHome__extern"] + pub fn aptHandleJumpToHome(); +} extern "C" { #[doc = "Main function which handles sleep mode and HOME/power buttons - call this at the beginning of every frame.\n # Returns\n\ntrue if the application should keep running, false otherwise (see aptShouldClose)."] pub fn aptMainLoop() -> bool; @@ -7454,6 +7776,11 @@ extern "C" { active_appid: *mut NS_APPID, ) -> Result; } +extern "C" { + #[doc = "Gets the menu's app ID.\n # Returns\n\nThe menu's app ID."] + #[link_name = "aptGetMenuAppID__extern"] + pub fn aptGetMenuAppID() -> NS_APPID; +} extern "C" { #[must_use] #[doc = "Gets an applet's information.\n # Arguments\n\n* `appID` - AppID of the applet.\n * `pProgramID` - Pointer to output the program ID to.\n * `pMediaType` - Pointer to output the media type to.\n * `pRegistered` - Pointer to output the registration status to.\n * `pLoadState` - Pointer to output the load state to.\n * `pAttributes` - Pointer to output the applet atrributes to."] @@ -9299,6 +9626,11 @@ extern "C" { #[doc = "Gets the 0x100-byte RSA-2048 SecureInfo signature.\n # Arguments\n\n* `data` - Pointer to output the buffer. (The size must be at least 0x100-bytes)"] pub fn CFGI_GetSecureInfoSignature(data: *mut u8_) -> Result; } +extern "C" { + #[doc = "Converts a vol-pan pair into a left/right volume pair used by the hardware.\n # Arguments\n\n* `vol` - Volume to use.\n * `pan` - Pan to use.\n # Returns\n\nA left/right volume pair for use by hardware."] + #[link_name = "CSND_VOL__extern"] + pub fn CSND_VOL(vol: f32, pan: f32) -> u32_; +} #[doc = "< PCM8"] pub const CSND_ENCODING_PCM8: _bindgen_ty_17 = 0; #[doc = "< PCM16"] @@ -13905,6 +14237,11 @@ pub const PTMNOTIFID_BATTERY_VERY_LOW: _bindgen_ty_27 = 529; #[doc = "< The battery level has reached 10% or below."] pub const PTMNOTIFID_BATTERY_LOW: _bindgen_ty_27 = 530; pub type _bindgen_ty_27 = ::libc::c_uint; +extern "C" { + #[doc = "See PTMSYSM_NotifySleepPreparationComplete. Corresponds to the number of potentially remaning notifs. until sleep/wakeup."] + #[link_name = "ptmSysmGetNotificationAckValue__extern"] + pub fn ptmSysmGetNotificationAckValue(id: u32_) -> s32; +} extern "C" { #[must_use] #[doc = "Initializes ptm:sysm."] @@ -14073,6 +14410,23 @@ extern "C" { #[doc = "Shuts down pxi:dev."] pub fn pxiDevExit(); } +extern "C" { + #[doc = "Creates a packed card SPI transfer option value.\n # Arguments\n\n* `baudRate` - Baud rate to use when transferring.\n * `busMode` - Bus mode to use when transferring.\n # Returns\n\nA packed card SPI transfer option value."] + #[link_name = "pxiDevMakeTransferOption__extern"] + pub fn pxiDevMakeTransferOption( + baudRate: FS_CardSpiBaudRate, + busMode: FS_CardSpiBusMode, + ) -> u8_; +} +extern "C" { + #[doc = "Creates a packed card SPI wait operation value.\n # Arguments\n\n* `waitType` - Type of wait to perform.\n * `deassertType` - Type of register deassertion to perform.\n * `timeout` - Timeout, in nanoseconds, to wait, if applicable.\n # Returns\n\nA packed card SPI wait operation value."] + #[link_name = "pxiDevMakeWaitOperation__extern"] + pub fn pxiDevMakeWaitOperation( + waitType: PXIDEV_WaitType, + deassertType: PXIDEV_DeassertType, + timeout: u64_, + ) -> u64_; +} extern "C" { #[must_use] #[doc = "Performs multiple card SPI writes and reads.\n # Arguments\n\n* `header` - Header to lead the transfers with. Must be, at most, 8 bytes in size.\n * `writeBuffer1` - Buffer to make first transfer from.\n * `readBuffer1` - Buffer to receive first response to.\n * `writeBuffer2` - Buffer to make second transfer from.\n * `readBuffer2` - Buffer to receive second response to.\n * `footer` - Footer to follow the transfers with. Must be, at most, 8 bytes in size. Wait operation is unused."] @@ -14139,6 +14493,94 @@ pub struct bintime { pub sec: time_t, pub frac: u64, } +extern "C" { + #[link_name = "bintime_addx__extern"] + pub fn bintime_addx(_bt: *mut bintime, _x: u64); +} +extern "C" { + #[link_name = "bintime_add__extern"] + pub fn bintime_add(_bt: *mut bintime, _bt2: *const bintime); +} +extern "C" { + #[link_name = "bintime_sub__extern"] + pub fn bintime_sub(_bt: *mut bintime, _bt2: *const bintime); +} +extern "C" { + #[link_name = "bintime_mul__extern"] + pub fn bintime_mul(_bt: *mut bintime, _x: u_int); +} +extern "C" { + #[link_name = "bintime_shift__extern"] + pub fn bintime_shift(_bt: *mut bintime, _exp: ::libc::c_int); +} +extern "C" { + #[link_name = "sbintime_getsec__extern"] + pub fn sbintime_getsec(_sbt: sbintime_t) -> ::libc::c_int; +} +extern "C" { + #[link_name = "bttosbt__extern"] + pub fn bttosbt(_bt: bintime) -> sbintime_t; +} +extern "C" { + #[link_name = "sbttobt__extern"] + pub fn sbttobt(_sbt: sbintime_t) -> bintime; +} +extern "C" { + #[link_name = "sbttons__extern"] + pub fn sbttons(_sbt: sbintime_t) -> i64; +} +extern "C" { + #[link_name = "nstosbt__extern"] + pub fn nstosbt(_ns: i64) -> sbintime_t; +} +extern "C" { + #[link_name = "sbttous__extern"] + pub fn sbttous(_sbt: sbintime_t) -> i64; +} +extern "C" { + #[link_name = "ustosbt__extern"] + pub fn ustosbt(_us: i64) -> sbintime_t; +} +extern "C" { + #[link_name = "sbttoms__extern"] + pub fn sbttoms(_sbt: sbintime_t) -> i64; +} +extern "C" { + #[link_name = "mstosbt__extern"] + pub fn mstosbt(_ms: i64) -> sbintime_t; +} +extern "C" { + #[link_name = "bintime2timespec__extern"] + pub fn bintime2timespec(_bt: *const bintime, _ts: *mut timespec); +} +extern "C" { + #[link_name = "timespec2bintime__extern"] + pub fn timespec2bintime(_ts: *const timespec, _bt: *mut bintime); +} +extern "C" { + #[link_name = "bintime2timeval__extern"] + pub fn bintime2timeval(_bt: *const bintime, _tv: *mut timeval); +} +extern "C" { + #[link_name = "timeval2bintime__extern"] + pub fn timeval2bintime(_tv: *const timeval, _bt: *mut bintime); +} +extern "C" { + #[link_name = "sbttots__extern"] + pub fn sbttots(_sbt: sbintime_t) -> timespec; +} +extern "C" { + #[link_name = "tstosbt__extern"] + pub fn tstosbt(_ts: timespec) -> sbintime_t; +} +extern "C" { + #[link_name = "sbttotv__extern"] + pub fn sbttotv(_sbt: sbintime_t) -> timeval; +} +extern "C" { + #[link_name = "tvtosbt__extern"] + pub fn tvtosbt(_tv: timeval) -> sbintime_t; +} #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct itimerval { @@ -16044,6 +16486,15 @@ extern "C" { #[doc = "Waits for a GX command queue to finish executing pending commands.\n # Arguments\n\n* `queue` - The GX command queue.\n * `timeout` - Optional timeout (in nanoseconds) to wait (specify -1 for no timeout).\n # Returns\n\nfalse if timeout expired, true otherwise."] pub fn gxCmdQueueWait(queue: *mut gxCmdQueue_s, timeout: s64) -> bool; } +extern "C" { + #[doc = "Sets the completion callback for a GX command queue.\n # Arguments\n\n* `queue` - The GX command queue.\n * `callback` - The completion callback.\n * `user` - User data."] + #[link_name = "gxCmdQueueSetCallback__extern"] + pub fn gxCmdQueueSetCallback( + queue: *mut gxCmdQueue_s, + callback: ::core::option::Option, + user: *mut ::libc::c_void, + ); +} extern "C" { #[doc = "Selects a command queue to which GX_* functions will add commands instead of immediately submitting them to GX.\n # Arguments\n\n* `queue` - The GX command queue. (Pass NULL to remove the bound command queue)"] pub fn GX_BindQueue(queue: *mut gxCmdQueue_s); @@ -16685,6 +17136,21 @@ extern "C" { #[doc = "< GPU command buffer offset."] pub static mut gpuCmdBufOffset: u32_; } +extern "C" { + #[doc = "Sets the GPU command buffer to use.\n # Arguments\n\n* `adr` - Pointer to the command buffer.\n * `size` - Size of the command buffer.\n * `offset` - Offset of the command buffer."] + #[link_name = "GPUCMD_SetBuffer__extern"] + pub fn GPUCMD_SetBuffer(adr: *mut u32_, size: u32_, offset: u32_); +} +extern "C" { + #[doc = "Sets the offset of the GPU command buffer.\n # Arguments\n\n* `offset` - Offset of the command buffer."] + #[link_name = "GPUCMD_SetBufferOffset__extern"] + pub fn GPUCMD_SetBufferOffset(offset: u32_); +} +extern "C" { + #[doc = "Gets the current GPU command buffer.\n # Arguments\n\n* `addr` - Pointer to output the command buffer to.\n * `size` - Pointer to output the size (in words) of the command buffer to.\n * `offset` - Pointer to output the offset of the command buffer to."] + #[link_name = "GPUCMD_GetBuffer__extern"] + pub fn GPUCMD_GetBuffer(addr: *mut *mut u32_, size: *mut u32_, offset: *mut u32_); +} extern "C" { #[doc = "Adds raw GPU commands to the current command buffer.\n # Arguments\n\n* `cmd` - Buffer containing commands to add.\n * `size` - Size of the buffer."] pub fn GPUCMD_AddRawCommands(cmd: *const u32_, size: u32_); @@ -16713,6 +17179,11 @@ extern "C" { #[doc = "Converts a 32-bit float to a 31-bit float.\n # Arguments\n\n* `f` - Float to convert.\n # Returns\n\nThe converted float."] pub fn f32tof31(f: f32) -> u32_; } +extern "C" { + #[doc = "Adds a command with a single parameter to the current command buffer."] + #[link_name = "GPUCMD_AddSingleParam__extern"] + pub fn GPUCMD_AddSingleParam(header: u32_, param: u32_); +} #[doc = "< Vertex shader."] pub const VERTEX_SHDR: DVLE_type = 0; #[doc = "< Geometry shader."] @@ -17700,6 +18171,26 @@ extern "C" { maxTextLength: ::libc::c_int, ); } +extern "C" { + #[doc = "Configures password mode in a software keyboard.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `mode` - Password mode."] + #[link_name = "swkbdSetPasswordMode__extern"] + pub fn swkbdSetPasswordMode(swkbd: *mut SwkbdState, mode: SwkbdPasswordMode); +} +extern "C" { + #[doc = "Configures input validation in a software keyboard.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `validInput` - Specifies which inputs are valid.\n * `filterFlags` - Bitmask specifying which characters are disallowed (filtered).\n * `maxDigits` - In case digits are disallowed, specifies how many digits are allowed at maximum in input strings (0 completely restricts digit input)."] + #[link_name = "swkbdSetValidation__extern"] + pub fn swkbdSetValidation( + swkbd: *mut SwkbdState, + validInput: SwkbdValidInput, + filterFlags: u32_, + maxDigits: ::libc::c_int, + ); +} +extern "C" { + #[doc = "Configures what characters will the two bottom keys in a numpad produce.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `left` - Unicode codepoint produced by the leftmost key in the bottom row (0 hides the key).\n * `left` - Unicode codepoint produced by the rightmost key in the bottom row (0 hides the key)."] + #[link_name = "swkbdSetNumpadKeys__extern"] + pub fn swkbdSetNumpadKeys(swkbd: *mut SwkbdState, left: ::libc::c_int, right: ::libc::c_int); +} extern "C" { #[doc = "Specifies which special features are enabled in a software keyboard.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `features` - Feature bitmask."] pub fn swkbdSetFeatures(swkbd: *mut SwkbdState, features: u32_); @@ -17771,6 +18262,11 @@ extern "C" { bufsize: usize, ) -> SwkbdButton; } +extern "C" { + #[doc = "Retrieves the result condition of a software keyboard after it has been used.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n # Returns\n\nThe result value."] + #[link_name = "swkbdGetResult__extern"] + pub fn swkbdGetResult(swkbd: *mut SwkbdState) -> SwkbdResult; +} #[doc = " Result; } +extern "C" { + #[must_use] + #[doc = "Wrapper for romfsMountSelf with the default \"romfs\" device name."] + #[link_name = "romfsInit__extern"] + pub fn romfsInit() -> Result; +} +extern "C" { + #[must_use] + #[doc = "Wrapper for romfsUnmount with the default \"romfs\" device name."] + #[link_name = "romfsExit__extern"] + pub fn romfsExit() -> Result; +} #[doc = "Character width information structure."] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] @@ -18387,6 +18900,29 @@ extern "C" { #[doc = "Fixes the pointers internal to a just-loaded font\n # Arguments\n\n* `font` - Font to fix\n > Should never be run on the system font, and only once on any other font."] pub fn fontFixPointers(font: *mut CFNT_s); } +extern "C" { + #[doc = "Gets the currently loaded system font"] + #[link_name = "fontGetSystemFont__extern"] + pub fn fontGetSystemFont() -> *mut CFNT_s; +} +extern "C" { + #[doc = "Retrieves the font information structure of a font.\n # Arguments\n\n* `font` - Pointer to font structure. If NULL, the shared system font is used."] + #[link_name = "fontGetInfo__extern"] + pub fn fontGetInfo(font: *mut CFNT_s) -> *mut FINF_s; +} +extern "C" { + #[doc = "Retrieves the texture sheet information of a font.\n # Arguments\n\n* `font` - Pointer to font structure. If NULL, the shared system font is used."] + #[link_name = "fontGetGlyphInfo__extern"] + pub fn fontGetGlyphInfo(font: *mut CFNT_s) -> *mut TGLP_s; +} +extern "C" { + #[doc = "Retrieves the pointer to texture data for the specified texture sheet.\n # Arguments\n\n* `font` - Pointer to font structure. If NULL, the shared system font is used.\n * `sheetIndex` - Index of the texture sheet."] + #[link_name = "fontGetGlyphSheetTex__extern"] + pub fn fontGetGlyphSheetTex( + font: *mut CFNT_s, + sheetIndex: ::libc::c_int, + ) -> *mut ::libc::c_void; +} extern "C" { #[doc = "Retrieves the glyph index of the specified Unicode codepoint.\n # Arguments\n\n* `font` - Pointer to font structure. If NULL, the shared system font is used.\n * `codePoint` - Unicode codepoint."] pub fn fontGlyphIndexFromCodePoint(font: *mut CFNT_s, codePoint: u32_) -> ::libc::c_int; @@ -18444,6 +18980,16 @@ extern "C" { #[doc = "Connects to the 3dslink host, setting up an output stream.\n # Arguments\n\n* `redirStdout` (direction in) - Whether to redirect stdout to nxlink output.\n * `redirStderr` (direction in) - Whether to redirect stderr to nxlink output.\n # Returns\n\nSocket fd on success, negative number on failure.\n > **Note:** The socket should be closed with close() during application cleanup."] pub fn link3dsConnectToHost(redirStdout: bool, redirStderr: bool) -> ::libc::c_int; } +extern "C" { + #[doc = "Same as link3dsConnectToHost but redirecting both stdout/stderr."] + #[link_name = "link3dsStdio__extern"] + pub fn link3dsStdio() -> ::libc::c_int; +} +extern "C" { + #[doc = "Same as link3dsConnectToHost but redirecting only stderr."] + #[link_name = "link3dsStdioForDebug__extern"] + pub fn link3dsStdioForDebug() -> ::libc::c_int; +} pub type error_t = ::libc::c_int; extern "C" { pub fn __errno() -> *mut ::libc::c_int; From a184e7a159c99f8021cb88fa4beee306c299a167 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Thu, 27 Jul 2023 13:38:59 +0200 Subject: [PATCH 042/101] Finalize Console docs --- ctru-rs/src/console.rs | 119 ++++++++++++++++++++++++++++++++---- ctru-rs/src/services/soc.rs | 5 +- 2 files changed, 110 insertions(+), 14 deletions(-) diff --git a/ctru-rs/src/console.rs b/ctru-rs/src/console.rs index a468c02..8eb3ebc 100644 --- a/ctru-rs/src/console.rs +++ b/ctru-rs/src/console.rs @@ -1,4 +1,9 @@ //! Virtual text console. +//! +//! The [`Console`] works as a virtual shell that renders on screen all output of `stdout`. As such, it is useful as a basic interface to show info to the user, +//! such as in simple "Hello World" applications or more complex software that does not need much user interaction. +//! +//! Have a look at [`Soc::redirect_to_3dslink()`](crate::services::soc::Soc::redirect_to_3dslink) for a better alternative when debugging applications. use std::cell::RefMut; use std::default::Default; @@ -9,10 +14,10 @@ use crate::services::gfx::Screen; static mut EMPTY_CONSOLE: PrintConsole = unsafe { const_zero::const_zero!(PrintConsole) }; -/// Virtual printable console. +/// Virtual text console. /// /// [`Console`] lets the application redirect `stdout` to a simple text displayer on the 3DS screen. -/// This means that any text written to `stdout` (e.g. using [`println!`] or [`dbg!`]) will become visible in the area taken by the console. +/// This means that any text written to `stdout` (e.g. using `println!` or `dbg!`) will become visible in the area taken by the console. /// /// # Notes /// @@ -20,7 +25,7 @@ static mut EMPTY_CONSOLE: PrintConsole = unsafe { const_zero::const_zero!(PrintC /// /// # Alternatives /// -/// If you'd like to see live `stdout` output while running the application but can't/don't want to show the text on the 3DS itself, +/// If you'd like to see live `stdout` output while running the application but cannnot/do not want to show the text on the 3DS itself, /// you can try using [`Soc::redirect_to_3dslink`](crate::services::soc::Soc::redirect_to_3dslink) while activating the `--server` flag for `3dslink` (also supported by `cargo-3ds`). /// More info in the `cargo-3ds` docs. #[doc(alias = "PrintConsole")] @@ -30,13 +35,37 @@ pub struct Console<'screen> { } impl<'screen> Console<'screen> { - /// Initialize a console on the chosen screen, overwriting whatever was on the screen - /// previously (including other consoles). The new console is automatically selected for - /// printing. + /// Initialize a console on the chosen screen. /// /// # Notes /// + /// This operation overwrites whatever was on the screen before the inizialization (including other [`Console`]s) + /// and changes the [`FramebufferFormat`](crate::services::gspgpu::FramebufferFormat) of the selected screen to better suit the [`Console`]. + /// + /// The new console is automatically selected for printing. + /// /// [`Console`] automatically takes care of flushing and swapping buffers for its screen when printing. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::gfx::Gfx; + /// use ctru::console::Console; + /// + /// // Initialize graphics. + /// let gfx = Gfx::new()?; + /// + /// // Create a `Console` that takes control of the upper LCD screen. + /// let top_console = Console::new(gfx.top_screen.borrow_mut()); + /// + /// println!("I'm on the top screen!"); + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "consoleInit")] pub fn new(screen: RefMut<'screen, dyn Screen>) -> Self { let mut context = Box::::default(); @@ -49,7 +78,35 @@ impl<'screen> Console<'screen> { } } - /// Returns true if a valid Console to print on is selected + /// Returns `true` if a valid [`Console`] to print on is currently selected. + /// + /// # Notes + /// + /// This function is used to check whether one of the two screens has an existing (and selected) [`Console`], + /// so that the program can be sure its output will be shown *somewhere*. + /// + /// The main use of this is within the [`ctru::use_panic_handler()`](crate::use_panic_handler()) hook, + /// since it will only stop the program's execution if the user is able to see the panic information output on screen. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// # use ctru::services::gfx::Gfx; + /// # // Initialize graphics. + /// # let gfx = Gfx::new()?; + /// # + /// use ctru::console::Console; + /// let top_console = Console::new(gfx.top_screen.borrow_mut()); + /// + /// // There is at least one selected `Console`. + /// assert!(Console::exists()); + /// # + /// # Ok(()) + /// # } + /// ``` pub fn exists() -> bool { unsafe { let current_console = ctru_sys::consoleSelect(&mut EMPTY_CONSOLE); @@ -62,7 +119,39 @@ impl<'screen> Console<'screen> { } } - /// Select this console as the current target for stdout + /// Select this console as the current target for `stdout`. + /// + /// # Notes + /// + /// Any previously selected console will be unhooked and will not show the `stdout` output. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// # use ctru::services::gfx::Gfx; + /// # let gfx = Gfx::new()?; + /// # + /// use ctru::console::Console; + /// + /// // Create a `Console` that takes control of the upper LCD screen. + /// let top_console = Console::new(gfx.top_screen.borrow_mut()); + /// + /// // Create a `Console` that takes control of the lower LCD screen. + /// let bottom_console = Console::new(gfx.bottom_screen.borrow_mut()); + /// + /// // Remember that `Console::new` automatically selects the new `Console` for ouput. + /// println!("I'm on the bottom screen!"); + /// + /// top_console.select(); + /// + /// println!("Being on the upper screen is much better!"); + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "consoleSelect")] pub fn select(&self) { unsafe { @@ -70,20 +159,24 @@ impl<'screen> Console<'screen> { } } - /// Clears all text from the console + /// Clear all text from the console. #[doc(alias = "consoleClear")] pub fn clear(&self) { unsafe { consoleClear() } } - /// Resizes the active console to fit in a smaller portion of the screen. + /// Resize the console to fit in a smaller portion of the screen. + /// + /// # Notes /// /// The first two arguments are the desired coordinates of the top-left corner - /// of the console, and the second pair is the new width and height + /// of the console, and the second pair is the new width and height. /// /// # Safety - /// This function is unsafe because it does not validate that the input will produce - /// a console that actually fits on the screen + /// + /// This function is unsafe because it does not validate whether the input will produce + /// a console that actually fits on the screen. + // TODO: Wrap this safely. #[doc(alias = "consoleSetWindow")] pub unsafe fn set_window(&mut self, x: i32, y: i32, width: i32, height: i32) { consoleSetWindow(self.context.as_mut(), x, y, width, height); diff --git a/ctru-rs/src/services/soc.rs b/ctru-rs/src/services/soc.rs index f9cc258..00a7a5c 100644 --- a/ctru-rs/src/services/soc.rs +++ b/ctru-rs/src/services/soc.rs @@ -113,7 +113,10 @@ impl Soc { Ipv4Addr::from(raw_id.to_ne_bytes()) } - /// Redirect output streams (i.e. `println` and `eprintln`) to the `3dslink` server. + /// Redirect output streams (i.e. `stdout` and `stderr`) to the `3dslink` server. + /// + /// With this redirection it is possible to send (and view in real time) the output of `stdout` operations, + /// such as `println!` or `dbg!`. /// /// Requires `3dslink` >= 0.6.1 and `new-hbmenu` >= 2.3.0 and the use of the `--server` flag. /// The `--server` flag is also availble to use via `cargo-3ds` if the requirements are met. From 9c955441dc6d5ce6b96b37dbe2520a4295e0abd3 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Thu, 27 Jul 2023 19:55:11 +0200 Subject: [PATCH 043/101] Finalize examples --- ctru-rs/examples/audio-filters.rs | 35 +++++++++++---- ctru-rs/examples/buttons.rs | 24 +++++----- ctru-rs/examples/camera-image.rs | 22 ++++++--- ctru-rs/examples/file-explorer.rs | 20 ++++++--- ctru-rs/examples/gfx-3d-mode.rs | 26 ++++++----- ctru-rs/examples/gfx-bitmap.rs | 29 ++++++------ ctru-rs/examples/gfx-wide-mode.rs | 12 +++++ ctru-rs/examples/graphics-bitmap.rs | 57 ------------------------ ctru-rs/examples/hashmaps.rs | 11 ++++- ctru-rs/examples/hello-both-screens.rs | 11 +++-- ctru-rs/examples/hello-world.rs | 20 +++++++-- ctru-rs/examples/linear-memory.rs | 15 ++++--- ctru-rs/examples/mii-selector.rs | 13 ++++-- ctru-rs/examples/network-sockets.rs | 21 ++++++--- ctru-rs/examples/output-3dslink.rs | 9 ++-- ctru-rs/examples/romfs.rs | 20 +++++---- ctru-rs/examples/software-keyboard.rs | 20 ++++++--- ctru-rs/examples/system-configuration.rs | 14 ++++-- ctru-rs/examples/thread-basic.rs | 2 + ctru-rs/examples/thread-info.rs | 2 +- ctru-rs/examples/thread-locals.rs | 2 +- ctru-rs/examples/time-rtc.rs | 25 ++++------- ctru-rs/examples/title-info.rs | 30 +++++++++---- ctru-rs/examples/touch-screen.rs | 14 +++--- ctru-rs/src/services/gfx.rs | 4 ++ 25 files changed, 267 insertions(+), 191 deletions(-) delete mode 100644 ctru-rs/examples/graphics-bitmap.rs diff --git a/ctru-rs/examples/audio-filters.rs b/ctru-rs/examples/audio-filters.rs index 34fa470..75941b7 100644 --- a/ctru-rs/examples/audio-filters.rs +++ b/ctru-rs/examples/audio-filters.rs @@ -1,3 +1,7 @@ +//! Audio Filters example. +//! +//! This example showcases basic audio functionality using [`Ndsp`]. + #![feature(allocator_api)] use std::f32::consts::PI; @@ -9,17 +13,18 @@ use ctru::services::ndsp::{ AudioFormat, AudioMix, InterpolationType, Ndsp, OutputMode, }; +// Configuration for the NDSP process and channels. const SAMPLE_RATE: usize = 22050; const SAMPLES_PER_BUF: usize = SAMPLE_RATE / 10; // 2205 const BYTES_PER_SAMPLE: usize = AudioFormat::PCM16Stereo.size(); const AUDIO_WAVE_LENGTH: usize = SAMPLES_PER_BUF * BYTES_PER_SAMPLE; -// Note Frequencies +// Note frequencies. const NOTEFREQ: [f32; 7] = [220., 440., 880., 1760., 3520., 7040., 14080.]; -// The audio format is Stereo PCM16 -// As such, a sample is made up of 2 "Mono" samples (2 * i16 = u32), one for each channel (left and right) fn fill_buffer(audio_data: &mut [u8], frequency: f32) { + // The audio format is Stereo PCM16. + // As such, a sample is made up of 2 "Mono" samples (2 * i16), one for each channel (left and right). let formatted_data = bytemuck::cast_slice_mut::<_, [i16; 2]>(audio_data); for (i, chunk) in formatted_data.iter_mut().enumerate() { @@ -44,8 +49,7 @@ fn main() { let mut note: usize = 4; - // Filters - + // Filter names to display. let filter_names = [ "None", "Low-Pass", @@ -60,19 +64,26 @@ fn main() { // We set up two wave buffers and alternate between the two, // effectively streaming an infinitely long sine wave. + // We create a buffer on the LINEAR memory that will hold our audio data. + // It's necessary for the buffer to live on the LINEAR memory sector since it needs to be accessed by the DSP processor. let mut audio_data1 = Box::new_in([0u8; AUDIO_WAVE_LENGTH], LinearAllocator); + + // Fill the buffer with the first set of data. This simply writes a sine wave into the buffer. fill_buffer(audio_data1.as_mut_slice(), NOTEFREQ[4]); + // Clone the original buffer to obtain an equal buffer on the LINEAR memory used for double buffering. let audio_data2 = audio_data1.clone(); + // Setup two wave info objects with the correct configuration and ownership of the audio data. let mut wave_info1 = Wave::new(audio_data1, AudioFormat::PCM16Stereo, false); let mut wave_info2 = Wave::new(audio_data2, AudioFormat::PCM16Stereo, false); - let mut ndsp = Ndsp::new().expect("Couldn't obtain NDSP controller"); + // Setup the NDSP service and its configuration. - // This line isn't needed since the default NDSP configuration already sets the output mode to `Stereo` + let mut ndsp = Ndsp::new().expect("Couldn't obtain NDSP controller"); ndsp.set_output_mode(OutputMode::Stereo); + // Channel configuration. We use channel zero but any channel would do just fine. let mut channel_zero = ndsp.channel(0).unwrap(); channel_zero.set_interpolation(InterpolationType::Linear); channel_zero.set_sample_rate(SAMPLE_RATE as f32); @@ -82,6 +93,7 @@ fn main() { let mix = AudioMix::default(); channel_zero.set_mix(&mix); + // First set of queueing for the two buffers. The second one will only play after the first one has ended. channel_zero.queue_wave(&mut wave_info1).unwrap(); channel_zero.queue_wave(&mut wave_info2).unwrap(); @@ -93,6 +105,8 @@ fn main() { filter_names[filter as usize] ); + println!("\x1b[29;16HPress Start to exit"); + let mut altern = true; // true is wave_info1, false is wave_info2 while apt.main_loop() { @@ -101,14 +115,16 @@ fn main() { if keys_down.contains(KeyPad::START) { break; - } // break in order to return to hbmenu + } + // Note frequency controller using the buttons. if keys_down.intersects(KeyPad::DOWN) { note = note.saturating_sub(1); } else if keys_down.intersects(KeyPad::UP) { note = std::cmp::min(note + 1, NOTEFREQ.len() - 1); } + // Filter controller using the buttons. let mut update_params = false; if keys_down.intersects(KeyPad::LEFT) { filter -= 1; @@ -139,12 +155,14 @@ fn main() { } } + // Double buffer alternation depending on the one used. let current: &mut Wave = if altern { &mut wave_info1 } else { &mut wave_info2 }; + // If the current buffer has finished playing, we can refill it with new data and re-queue it. let status = current.status(); if let Status::Done = status { fill_buffer(current.get_buffer_mut().unwrap(), NOTEFREQ[note]); @@ -154,7 +172,6 @@ fn main() { altern = !altern; } - //Wait for VBlank gfx.wait_for_vblank(); } } diff --git a/ctru-rs/examples/buttons.rs b/ctru-rs/examples/buttons.rs index 8bba6c7..0de9e7c 100644 --- a/ctru-rs/examples/buttons.rs +++ b/ctru-rs/examples/buttons.rs @@ -1,3 +1,7 @@ +//! Buttons example. +//! +//! This example showcases how to retrieve button inputs from the console's HID. + use ctru::prelude::*; fn main() { @@ -18,28 +22,28 @@ fn main() { // Scan for user input on the current frame. hid.scan_input(); - // Get information about which keys were held down on this frame + // Get information about which keys were held down on this frame. let keys = hid.keys_held(); // We only want to print when the keys we're holding now are different - // from what they were on the previous frame + // from what they were on the previous frame. if keys != old_keys { - // Clear the screen + // Clear the screen. console.clear(); - // We print these again because we just cleared the screen above + // We print these again because we just cleared the screen above. println!("Hi there! Try pressing a button"); println!("\x1b[29;16HPress Start to exit"); - // Move the cursor back to the top of the screen + // Move the cursor back to the top of the screen. println!("\x1b[3;0H"); // Print to the screen depending on which keys were held. // - // The .contains() method checks for all of the provided keys, - // and the .intersects() method checks for any of the provided keys. + // The `.contains()` method checks for all of the provided keys, + // and the `.intersects()` method checks for any of the provided keys. // - // You can also use the .bits() method to do direct comparisons on + // You can also use the `.bits()` method to do direct comparisons on // the underlying bits if keys.contains(KeyPad::A) { @@ -54,13 +58,13 @@ fn main() { if keys.intersects(KeyPad::L | KeyPad::R | KeyPad::ZL | KeyPad::ZR) { println!("You held a shoulder button!"); } - if keys.intersects(KeyPad::START) { + if keys.contains(KeyPad::START) { println!("See ya!"); break; } } - // Save our current key presses for the next frame + // Save our current key presses for the next frame. old_keys = keys; gfx.wait_for_vblank(); diff --git a/ctru-rs/examples/camera-image.rs b/ctru-rs/examples/camera-image.rs index 0042599..40c5f75 100644 --- a/ctru-rs/examples/camera-image.rs +++ b/ctru-rs/examples/camera-image.rs @@ -1,3 +1,7 @@ +//! Camera image example. +//! +//! This example demonstrates how to use the built-in cameras to take a picture and display it to the screen. + use ctru::prelude::*; use ctru::services::cam::{Cam, Camera, OutputFormat, ShutterSound, ViewSize}; use ctru::services::gfx::{Flush, Screen, Swap}; @@ -8,7 +12,7 @@ use std::time::Duration; const WIDTH: usize = 400; const HEIGHT: usize = 240; -// The screen size is the width and height multiplied by 2 (RGB565 store pixels in 2 bytes) +// The screen size is the width and height multiplied by 2 (RGB565 store pixels in 2 bytes). const BUF_SIZE: usize = WIDTH * HEIGHT * 2; const WAIT_TIMEOUT: Duration = Duration::from_millis(300); @@ -26,12 +30,11 @@ fn main() { let _console = Console::new(gfx.bottom_screen.borrow_mut()); - let mut keys_down; - println!("Initializing camera"); let mut cam = Cam::new().expect("Failed to initialize CAM service."); + // Camera setup. { let camera = &mut cam.outer_right_cam; @@ -58,21 +61,23 @@ fn main() { let mut buf = vec![0u8; BUF_SIZE]; println!("\nPress R to take a new picture"); - println!("Press Start to exit to Homebrew Launcher"); + println!("\x1b[29;16HPress Start to exit"); while apt.main_loop() { hid.scan_input(); - keys_down = hid.keys_down(); + let keys_down = hid.keys_down(); if keys_down.contains(KeyPad::START) { break; } + // If the user presses the R button. if keys_down.contains(KeyPad::R) { println!("Capturing new image"); let camera = &mut cam.outer_right_cam; + // Take a picture and write it to the buffer. camera .take_picture( &mut buf, @@ -82,12 +87,14 @@ fn main() { ) .expect("Failed to take picture"); + // Play the normal shutter sound. cam.play_shutter_sound(ShutterSound::Normal) .expect("Failed to play shutter sound"); + // Rotate the image and correctly display it on the screen. rotate_image_to_screen(&buf, top_screen.raw_framebuffer().ptr, WIDTH, HEIGHT); - // We will only flush the "camera" screen, since the other screen is handled by `Console` + // We will only flush and swap the "camera" screen, since the other screen is handled by the `Console`. top_screen.flush_buffers(); top_screen.swap_buffers(); @@ -99,6 +106,7 @@ fn main() { // The 3DS' screens are 2 vertical LCD panels rotated by 90 degrees. // As such, we'll need to write a "vertical" image to the framebuffer to have it displayed properly. // This functions rotates an horizontal image by 90 degrees to the right. +// This function is only supposed to be used in this example. In a real world application, the program should use the GPU to draw to the screen. fn rotate_image_to_screen(src: &[u8], framebuf: *mut u8, width: usize, height: usize) { for j in 0..height { for i in 0..width { @@ -115,7 +123,7 @@ fn rotate_image_to_screen(src: &[u8], framebuf: *mut u8, width: usize, height: u let draw_index = (draw_x * height + draw_y) * 2; // This 2 stands for the number of bytes per pixel (16 bits) unsafe { - // We'll work with pointers since the frambuffer is a raw pointer regardless. + // We'll work with pointers since the framebuffer is a raw pointer regardless. // The offsets are completely safe as long as the width and height are correct. let pixel_pointer = framebuf.offset(draw_index as isize); pixel_pointer.copy_from(src.as_ptr().offset(read_index as isize), 2); diff --git a/ctru-rs/examples/file-explorer.rs b/ctru-rs/examples/file-explorer.rs index 748a937..4a7fbda 100644 --- a/ctru-rs/examples/file-explorer.rs +++ b/ctru-rs/examples/file-explorer.rs @@ -1,5 +1,7 @@ -//! A file explorer which shows off using standard library file system APIs to -//! read the SD card. +//! File Explorer example. +//! +//! This (rather complex) example creates a working text-based file explorer which shows off using standard library file system APIs to +//! read the SD card and RomFS (if properly read via the `romfs:/` prefix). use ctru::applets::swkbd::{Button, SoftwareKeyboard}; use ctru::prelude::*; @@ -15,6 +17,7 @@ fn main() { let mut hid = Hid::new().unwrap(); let gfx = Gfx::new().unwrap(); + // Mount the RomFS if available. #[cfg(all(feature = "romfs", romfs_exists))] let _romfs = ctru::services::romfs::RomFS::new().unwrap(); @@ -50,6 +53,7 @@ impl<'a> FileExplorer<'a> { fn run(&mut self) { self.running = true; + // Print the file explorer commands. self.print_menu(); while self.running && self.apt.main_loop() { @@ -62,8 +66,10 @@ impl<'a> FileExplorer<'a> { self.path.pop(); self.console.clear(); self.print_menu(); + // Open a directory/file to read. } else if input.contains(KeyPad::A) { self.get_input_and_run(Self::set_next_path); + // Open a specific path using the `SoftwareKeyboard` applet. } else if input.contains(KeyPad::X) { self.get_input_and_run(Self::set_exact_path); } @@ -100,7 +106,7 @@ impl<'a> FileExplorer<'a> { } }; - println!("Start to exit, A to select an entry by number, B to go up a directory, X to set the path."); + println!("Press Start to exit, A to select an entry by number, B to go up a directory, X to set the path."); } fn print_dir_entries(&mut self) { @@ -137,7 +143,7 @@ impl<'a> FileExplorer<'a> { } } - /// Paginate output + /// Paginate output.' fn wait_for_page_down(&mut self) { println!("Press A to go to next page, or Start to exit"); @@ -163,14 +169,14 @@ impl<'a> FileExplorer<'a> { match keyboard.get_string(2048) { Ok((path, Button::Right)) => { - // Clicked "OK" + // Clicked "OK". action(self, path); } Ok((_, Button::Left)) => { - // Clicked "Cancel" + // Clicked "Cancel". } Ok((_, Button::Middle)) => { - // This button wasn't shown + // This button wasn't shown. unreachable!() } Err(e) => { diff --git a/ctru-rs/examples/gfx-3d-mode.rs b/ctru-rs/examples/gfx-3d-mode.rs index 582994e..c5b9de8 100644 --- a/ctru-rs/examples/gfx-3d-mode.rs +++ b/ctru-rs/examples/gfx-3d-mode.rs @@ -1,10 +1,15 @@ +//! 3D Graphics example. +//! +//! This example showcases 3D mode rendering (using the CPU). +//! In a normal application, all rendering should be hanlded via the GPU. + use ctru::prelude::*; use ctru::services::gfx::{Flush, Screen, Side, Swap, TopScreen3D}; -/// See `graphics-bitmap.rs` for details on how the image is generated. -/// -/// WARNING: this example uses 3D mode in a rather unnatural way, and should -/// probably not be viewed for too long or at all if you are photosensitive. +// See `graphics-bitmap.rs` for details on how the image is generated. +// +// WARNING: this example uses 3D mode in a rather unnatural way, and should +// probably not be viewed for too long or at all if you are photosensitive. const IMAGE: &[u8] = include_bytes!("assets/ferris.rgb"); static ZERO: &[u8] = &[0; IMAGE.len()]; @@ -17,7 +22,8 @@ fn main() { let apt = Apt::new().expect("Couldn't obtain APT controller"); let _console = Console::new(gfx.bottom_screen.borrow_mut()); - println!("Press Start to exit.\nPress A to switch sides (be sure to have 3D mode enabled)."); + println!("Press A to switch sides (be sure to have set the 3D slider correctly)."); + println!("\x1b[29;16HPress Start to exit"); gfx.top_screen.borrow_mut().set_double_buffering(true); @@ -25,39 +31,40 @@ fn main() { let mut current_side = Side::Left; - // Main loop while apt.main_loop() { - //Scan all the inputs. This should be done once for each frame hid.scan_input(); if hid.keys_down().contains(KeyPad::START) { break; } + // Split the TopScreen3D to get references to the two render surfaces. let (mut left, mut right) = top_screen.split_mut(); let left_buf = left.raw_framebuffer(); let right_buf = right.raw_framebuffer(); - // Clear both buffers every time, in case the user switches sides this loop + // Clear both buffers every time, in case the user switches sides this loop. unsafe { left_buf.ptr.copy_from(ZERO.as_ptr(), ZERO.len()); right_buf.ptr.copy_from(ZERO.as_ptr(), ZERO.len()); } if hid.keys_down().contains(KeyPad::A) { - // flip which buffer we're writing to + // Switch which buffer we're writing to. current_side = match current_side { Side::Left => Side::Right, Side::Right => Side::Left, }; } + // Obtain the framebuffer of the currently rendered side. let buf = match current_side { Side::Left => left_buf.ptr, Side::Right => right_buf.ptr, }; + // Render the image to the surface's buffer. unsafe { buf.copy_from(IMAGE.as_ptr(), IMAGE.len()); } @@ -67,7 +74,6 @@ fn main() { top_screen.flush_buffers(); top_screen.swap_buffers(); - //Wait for VBlank gfx.wait_for_vblank(); } } diff --git a/ctru-rs/examples/gfx-bitmap.rs b/ctru-rs/examples/gfx-bitmap.rs index f680ff2..39634c2 100644 --- a/ctru-rs/examples/gfx-bitmap.rs +++ b/ctru-rs/examples/gfx-bitmap.rs @@ -1,3 +1,6 @@ +/// Bitmap Graphics example. +/// +/// This example uses the CPU to render a simple bitmap image to the screen. use ctru::prelude::*; use ctru::services::gfx::{Flush, Screen, Swap}; @@ -22,7 +25,8 @@ fn main() { let apt = Apt::new().expect("Couldn't obtain APT controller"); let _console = Console::new(gfx.top_screen.borrow_mut()); - println!("\x1b[21;4HPress Start to exit, or A to flip the image."); + println!("\x1b[21;4HPress A to flip the image."); + println!("\x1b[29;16HPress Start to exit"); let mut bottom_screen = gfx.bottom_screen.borrow_mut(); @@ -37,18 +41,23 @@ fn main() { let mut image_bytes = IMAGE; - // Main loop + // We assume the image is the correct size already, so we drop width + height. + let frame_buffer = bottom_screen.raw_framebuffer(); + + // We copy the image to the framebuffer. + unsafe { + frame_buffer + .ptr + .copy_from(image_bytes.as_ptr(), image_bytes.len()); + } + while apt.main_loop() { - //Scan all the inputs. This should be done once for each frame hid.scan_input(); if hid.keys_down().contains(KeyPad::START) { break; } - // We assume the image is the correct size already, so we drop width + height. - let frame_buffer = bottom_screen.raw_framebuffer(); - if hid.keys_down().contains(KeyPad::A) { image_bytes = if std::ptr::eq(image_bytes, IMAGE) { &flipped_image[..] @@ -57,18 +66,10 @@ fn main() { }; } - // this copies more than necessary (once per frame) but it's fine... - unsafe { - frame_buffer - .ptr - .copy_from(image_bytes.as_ptr(), image_bytes.len()); - } - // Flush framebuffers. Since we're not using double buffering, // this will render the pixels immediately bottom_screen.flush_buffers(); - //Wait for VBlank gfx.wait_for_vblank(); } } diff --git a/ctru-rs/examples/gfx-wide-mode.rs b/ctru-rs/examples/gfx-wide-mode.rs index 8036538..109169d 100644 --- a/ctru-rs/examples/gfx-wide-mode.rs +++ b/ctru-rs/examples/gfx-wide-mode.rs @@ -1,3 +1,10 @@ +//! Wide-Mode Graphics example. +//! +//! This example demonstrates the wide-mode capability of the top screen +//! which doubles the horizontal resolution of the screen by merging the 2 stereoscopic 3D sides. +//! +//! Beware, wide-mode doesn't work on Old 2DS consoles. + use ctru::prelude::*; fn main() { @@ -9,6 +16,7 @@ fn main() { let mut console = Console::new(gfx.top_screen.borrow_mut()); println!("Press A to enable/disable wide screen mode."); + println!("\x1b[29;16HPress Start to exit"); while apt.main_loop() { hid.scan_input(); @@ -17,14 +25,18 @@ fn main() { break; } + // Since we can't set wide-mode while running the console (since that would break the currently displayed text), + // we need to rebuild the console each time we want to make the switch. if hid.keys_down().contains(KeyPad::A) { drop(console); + // Switch the state of the wide-mode. let wide_mode = gfx.top_screen.borrow().is_wide(); gfx.top_screen.borrow_mut().set_wide_mode(!wide_mode); console = Console::new(gfx.top_screen.borrow_mut()); println!("Press A to enable/disable wide screen mode."); + println!("\x1b[29;16HPress Start to exit"); } gfx.wait_for_vblank(); diff --git a/ctru-rs/examples/graphics-bitmap.rs b/ctru-rs/examples/graphics-bitmap.rs deleted file mode 100644 index df9ce11..0000000 --- a/ctru-rs/examples/graphics-bitmap.rs +++ /dev/null @@ -1,57 +0,0 @@ -use ctru::prelude::*; -use ctru::services::gfx::{Flush, Screen, Swap}; - -/// Ferris image taken from and scaled down to 320x240px. -/// To regenerate the data, you will need to install `imagemagick` and run this -/// command from the `examples` directory: -/// -/// ```sh -/// magick assets/ferris.png -channel-fx "red<=>blue" -rotate 90 assets/ferris.rgb -/// ``` -/// -/// This creates an image appropriate for the default frame buffer format of -/// [`Bgr8`](ctru::services::gspgpu::FramebufferFormat::Bgr8) -/// and rotates the image 90° to account for the portrait mode screen. -static IMAGE: &[u8] = include_bytes!("assets/ferris.rgb"); - -fn main() { - ctru::use_panic_handler(); - - let gfx = Gfx::new().expect("Couldn't obtain GFX controller"); - let mut hid = Hid::new().expect("Couldn't obtain HID controller"); - let apt = Apt::new().expect("Couldn't obtain APT controller"); - let _console = Console::new(gfx.top_screen.borrow_mut()); - - println!("\x1b[21;16HPress Start to exit."); - - let mut bottom_screen = gfx.bottom_screen.borrow_mut(); - - // We don't need double buffering in this example. - // In this way we can draw our image only once on screen. - bottom_screen.set_double_buffering(false); - - // We assume the image is the correct size already, so we drop width + height. - let frame_buffer = bottom_screen.raw_framebuffer(); - - // Copy the image into the frame buffer - unsafe { - frame_buffer.ptr.copy_from(IMAGE.as_ptr(), IMAGE.len()); - } - - // Main loop - while apt.main_loop() { - //Scan all the inputs. This should be done once for each frame - hid.scan_input(); - - if hid.keys_down().contains(KeyPad::START) { - break; - } - - // Flush and swap framebuffers - bottom_screen.flush_buffers(); - bottom_screen.swap_buffers(); - - //Wait for VBlank - gfx.wait_for_vblank(); - } -} diff --git a/ctru-rs/examples/hashmaps.rs b/ctru-rs/examples/hashmaps.rs index 7d4d8c4..e563068 100644 --- a/ctru-rs/examples/hashmaps.rs +++ b/ctru-rs/examples/hashmaps.rs @@ -1,10 +1,16 @@ +//! Hashmap example. +//! +//! This example showcases using Hashmaps on the 3DS console using the functionality implemented by the standard library. +//! While it may seem inappropriate for such a simple (and somewhat out-of-scope) example to be included here, it's important to note how +//! normally Hashmaps wouldn't work on the console, and are only capable to because of the internal implementations made by `ctru-rs`. +//! +//! As such, this example functions more closely to a test than a demonstration. + use ctru::prelude::*; fn main() { ctru::use_panic_handler(); - // Initialize services - // // HashMaps generate hashes thanks to the 3DS' cryptografically secure generator. // This generator is only active when activating the `PS` service. // This service is automatically initialized. @@ -19,6 +25,7 @@ fn main() { map.remove("A Key!"); println!("{map:#?}"); + println!("\x1b[29;16HPress Start to exit"); while apt.main_loop() { gfx.wait_for_vblank(); diff --git a/ctru-rs/examples/hello-both-screens.rs b/ctru-rs/examples/hello-both-screens.rs index f2007f1..1f2b383 100644 --- a/ctru-rs/examples/hello-both-screens.rs +++ b/ctru-rs/examples/hello-both-screens.rs @@ -1,3 +1,7 @@ +//! Hello World example using both screens. +//! +//! This is similar to the `hello-world` example, with the main difference of using 2 virtual `Console`s that can be alternated to print on both screens. + use ctru::prelude::*; fn main() { @@ -11,14 +15,15 @@ fn main() { let top_screen = Console::new(gfx.top_screen.borrow_mut()); // Start a console on the bottom screen. - // The most recently initialized console will be active by default + // The most recently initialized console will be active by default. let bottom_screen = Console::new(gfx.bottom_screen.borrow_mut()); - // Let's print on the top screen first + // Let's print on the top screen first. + // Since the bottom screen is currently selected (being created afterwards), it is required to select the top screen console first. top_screen.select(); println!("This is the top screen! We have a lot of space up here!"); - // Now let's print something on the bottom screen + // Now let's print something on the bottom screen. bottom_screen.select(); println!("\x1b[14;00HThis is the bottom screen."); println!("There's not as much space down here, but that's okay."); diff --git a/ctru-rs/examples/hello-world.rs b/ctru-rs/examples/hello-world.rs index a92cb90..9210484 100644 --- a/ctru-rs/examples/hello-world.rs +++ b/ctru-rs/examples/hello-world.rs @@ -1,15 +1,25 @@ -use ctru::prelude::*; +//! Hello World example. +//! +//! Simple "Hello World" application to showcase the basic setup needed for any user-oriented app to work. +use ctru::prelude::*; use std::io::BufWriter; fn main() { + // Setup the custom panic handler in case any errors arise. + // Thanks to it the user will get promptly notified of any panics. ctru::use_panic_handler(); + // Setup Graphics, Controller Inputs, Application runtime. + // These is standard setup any app would need. let gfx = Gfx::new().expect("Couldn't obtain GFX controller"); let mut hid = Hid::new().expect("Couldn't obtain HID controller"); let apt = Apt::new().expect("Couldn't obtain APT controller"); + + // Create a Console to print our "Hello, World!" to. let _console = Console::new(gfx.top_screen.borrow_mut()); + // Snazzy message created via `ferris_says`. let out = b"Hello fellow Rustaceans, I'm on the Nintendo 3DS!"; let width = 24; @@ -21,16 +31,18 @@ fn main() { String::from_utf8_lossy(&writer.into_inner().unwrap()) ); - // Main loop + println!("\x1b[29;16HPress Start to exit"); + + // Main application loop. This checks whether the app is normally running in the foreground. while apt.main_loop() { - //Scan all the inputs. This should be done once for each frame + // Scan all the controller inputs. hid.scan_input(); if hid.keys_down().contains(KeyPad::START) { break; } - //Wait for VBlank + // Use VSync to cap the framerate at the same speed as the LCD screen's refresh rate (60 fps). gfx.wait_for_vblank(); } } diff --git a/ctru-rs/examples/linear-memory.rs b/ctru-rs/examples/linear-memory.rs index e6c18dc..de653e6 100644 --- a/ctru-rs/examples/linear-memory.rs +++ b/ctru-rs/examples/linear-memory.rs @@ -1,3 +1,9 @@ +//! LINEAR memory example. +//! +//! This example showcases simple allocation on the LINEAR memory sector. +//! Using LINEAR memory is required when sending data to the GPU or DSP processor. + +// You will need to activate this unstable feature to use custom allocators. #![feature(allocator_api)] use ctru::linear::LinearAllocator; @@ -11,11 +17,13 @@ fn main() { let apt = Apt::new().expect("Couldn't obtain APT controller"); let _console = Console::new(gfx.top_screen.borrow_mut()); + // The `LinearAllocator` is always available for use. + // Luckily, we can always read how much memory is available to be allocated on it. let linear_space_before = LinearAllocator::free_space(); - // Normal `Box` on the heap + // Normal `Box` on the heap. let heap_box = Box::new(1492); - // `Box` living on the linear memory sector + // `Box` living on the LINEAR memory. let linear_box: Box = Box::new_in(2022, LinearAllocator); println!("This value is from the heap: {heap_box}"); @@ -29,16 +37,13 @@ fn main() { println!("\x1b[29;16HPress Start to exit"); - // Main loop while apt.main_loop() { - //Scan all the inputs. This should be done once for each frame hid.scan_input(); if hid.keys_down().contains(KeyPad::START) { break; } - //Wait for VBlank gfx.wait_for_vblank(); } } diff --git a/ctru-rs/examples/mii-selector.rs b/ctru-rs/examples/mii-selector.rs index b12f217..db3a9ea 100644 --- a/ctru-rs/examples/mii-selector.rs +++ b/ctru-rs/examples/mii-selector.rs @@ -1,3 +1,7 @@ +//! Mii Selector example. +//! +//! This example showcases the use of the MiiSelector applet to obtain Mii data from the user's input. + use ctru::applets::mii_selector::{Error, MiiSelector, Options}; use ctru::prelude::*; @@ -9,12 +13,16 @@ fn main() { let apt = Apt::new().expect("Couldn't obtain APT controller"); let _console = Console::new(gfx.top_screen.borrow_mut()); + // Setup the Mii Selector configuration. let mut mii_selector = MiiSelector::new(); + // The Mii Selector window can be closed without selecting a Mii. mii_selector.set_options(Options::ENABLE_CANCEL); mii_selector.set_initial_index(3); + // The first user-made Mii cannot be used. mii_selector.blacklist_user_mii(0.into()); mii_selector.set_title("Great Mii Selector!"); + // Launch the Mii Selector and use its result to print the selected Mii's information. match mii_selector.launch() { Ok(result) => { println!("Mii type: {:?}", result.mii_type); @@ -29,16 +37,15 @@ fn main() { Err(Error::NoMiiSelected) => println!("No Mii selected"), } - // Main loop + println!("\x1b[29;16HPress Start to exit"); + while apt.main_loop() { - //Scan all the inputs. This should be done once for each frame hid.scan_input(); if hid.keys_down().contains(KeyPad::START) { break; } - //Wait for VBlank gfx.wait_for_vblank(); } } diff --git a/ctru-rs/examples/network-sockets.rs b/ctru-rs/examples/network-sockets.rs index bbea510..0cc70ad 100644 --- a/ctru-rs/examples/network-sockets.rs +++ b/ctru-rs/examples/network-sockets.rs @@ -1,3 +1,7 @@ +//! Network Sockets example. +//! +//! This example showcases the use of network sockets via the `Soc` service and the standard library's implementations. + use ctru::prelude::*; use std::io::{self, Read, Write}; @@ -14,20 +18,27 @@ fn main() { println!("\nlibctru sockets demo\n"); + // Owning a living handle to the `Soc` service is required to use network functionalities. let soc = Soc::new().unwrap(); + // Listen on the standard HTTP port (80). let server = TcpListener::bind("0.0.0.0:80").unwrap(); server.set_nonblocking(true).unwrap(); println!("Point your browser to http://{}/\n", soc.host_address()); + println!("\x1b[29;16HPress Start to exit"); while apt.main_loop() { - gfx.wait_for_vblank(); + hid.scan_input(); + if hid.keys_down().contains(KeyPad::START) { + break; + }; match server.accept() { Ok((mut stream, socket_addr)) => { println!("Got connection from {socket_addr}"); + // Print the HTTP request sent by the client (most likely, a web browser). let mut buf = [0u8; 4096]; match stream.read(&mut buf) { Ok(_) => { @@ -43,15 +54,18 @@ fn main() { } } + // Return a HTML page with a simple "Hello World!". let response = b"HTTP/1.1 200 OK\r\nContent-Type: text/html; charset=UTF-8\r\n\r\nHello world\r\n"; if let Err(e) = stream.write(response) { println!("Error writing http response: {e}"); } + // Shutdown the stream (depending on the web browser used to view the page, this might cause some issues). stream.shutdown(Shutdown::Both).unwrap(); } Err(e) => match e.kind() { + // If the TCP socket would block execution, just try again. std::io::ErrorKind::WouldBlock => {} _ => { println!("Error accepting connection: {e}"); @@ -60,9 +74,6 @@ fn main() { }, } - hid.scan_input(); - if hid.keys_down().contains(KeyPad::START) { - break; - }; + gfx.wait_for_vblank(); } } diff --git a/ctru-rs/examples/output-3dslink.rs b/ctru-rs/examples/output-3dslink.rs index 8314efa..9df3f3d 100644 --- a/ctru-rs/examples/output-3dslink.rs +++ b/ctru-rs/examples/output-3dslink.rs @@ -1,4 +1,6 @@ -//! Use the `3dslink --server` option for redirecting output from the 3DS back +//! Output redirection example. +//! +//! This example uses the `3dslink --server` option for redirecting output from the 3DS back //! to the device that sent the executable. //! //! For now, `cargo 3ds run` does not support this flag, so to run this example @@ -17,24 +19,23 @@ fn main() { let mut hid = Hid::new().expect("Couldn't obtain HID controller"); let apt = Apt::new().expect("Couldn't obtain APT controller"); + // We need to use network sockets to send the data stream back. let mut soc = Soc::new().expect("Couldn't obtain SOC controller"); + // Set the output to be redirected to the `3dslink` server. soc.redirect_to_3dslink(true, true) .expect("unable to redirect stdout/err to 3dslink server"); println!("Hello 3dslink!"); eprintln!("Press Start on the device to disconnect and exit."); - // Main loop while apt.main_loop() { - //Scan all the inputs. This should be done once for each frame hid.scan_input(); if hid.keys_down().contains(KeyPad::START) { break; } - //Wait for VBlank gfx.wait_for_vblank(); } } diff --git a/ctru-rs/examples/romfs.rs b/ctru-rs/examples/romfs.rs index 1138203..490a785 100644 --- a/ctru-rs/examples/romfs.rs +++ b/ctru-rs/examples/romfs.rs @@ -1,3 +1,7 @@ +//! RomFS example. +//! +//! This example showcases the RomFS service and how to mount it to include a read-only filesystem within the application bundle. + use ctru::prelude::*; fn main() { @@ -9,35 +13,35 @@ fn main() { let _console = Console::new(gfx.top_screen.borrow_mut()); cfg_if::cfg_if! { - // Run this code if RomFS are wanted and available - // This never fails as `ctru-rs` examples inherit all of the `ctru` features, - // but it might if a normal user application wasn't setup correctly + // Run this code if RomFS are wanted and available. + // This never fails as `ctru-rs` examples inherit all of the `ctru-rs` features, + // but it might if a normal user application wasn't setup correctly. if #[cfg(all(feature = "romfs", romfs_exists))] { + // Mount the romfs volume. let _romfs = ctru::services::romfs::RomFS::new().unwrap(); + // Open a simple text file present in the RomFS volume. + // Remember to use the `romfs:/` prefix when working with `RomFS`. let f = std::fs::read_to_string("romfs:/test-file.txt").unwrap(); println!("Contents of test-file.txt: \n{f}\n"); let f = std::fs::read_to_string("romfs:/ファイル.txt").unwrap(); - // While RomFS supports UTF-16 file paths, `Console` doesn't... + // While `RomFS` supports UTF-16 file paths, `Console` does not, so we'll use a placeholder for the text. println!("Contents of [UTF-16 File]: \n{f}\n"); } else { println!("No RomFS was found, are you sure you included it?") } } - println!("\nPress START to exit"); + println!("\x1b[29;16HPress Start to exit"); - // Main loop while apt.main_loop() { - //Scan all the inputs. This should be done once for each frame hid.scan_input(); if hid.keys_down().contains(KeyPad::START) { break; } - //Wait for VBlank gfx.wait_for_vblank(); } } diff --git a/ctru-rs/examples/software-keyboard.rs b/ctru-rs/examples/software-keyboard.rs index 4d7c4f2..269ccf0 100644 --- a/ctru-rs/examples/software-keyboard.rs +++ b/ctru-rs/examples/software-keyboard.rs @@ -1,3 +1,7 @@ +//! Software Keyboard example. +//! +//! This example showcases the use of the Software Keyboard applet to receive text input from the user. + use ctru::applets::swkbd::{Button, SoftwareKeyboard}; use ctru::prelude::*; @@ -9,13 +13,17 @@ fn main() { let gfx = Gfx::new().unwrap(); let _console = Console::new(gfx.top_screen.borrow_mut()); - println!("Press A to enter some text or press Start to quit"); + println!("Press A to enter some text."); + println!("\x1b[29;16HPress Start to exit"); while apt.main_loop() { - gfx.wait_for_vblank(); - hid.scan_input(); + if hid.keys_down().contains(KeyPad::START) { + break; + } + + // If the user request to write some input. if hid.keys_down().contains(KeyPad::A) { // Prepares a software keyboard with two buttons: One to cancel input and one // to accept it. You can also use `SoftwareKeyboard::new()` to launch the keyboard in different @@ -23,7 +31,7 @@ fn main() { let mut keyboard = SoftwareKeyboard::default(); // Raise the software keyboard. You can perform different actions depending on which - // software button the user pressed + // software button the user pressed. match keyboard.get_string(2048) { Ok((text, Button::Right)) => println!("You entered: {text}"), Ok((_, Button::Left)) => println!("Cancelled"), @@ -32,8 +40,6 @@ fn main() { } } - if hid.keys_down().contains(KeyPad::START) { - break; - } + gfx.wait_for_vblank(); } } diff --git a/ctru-rs/examples/system-configuration.rs b/ctru-rs/examples/system-configuration.rs index 001233d..f1748f7 100644 --- a/ctru-rs/examples/system-configuration.rs +++ b/ctru-rs/examples/system-configuration.rs @@ -1,3 +1,8 @@ +//! System Configuration example. +//! +//! This example showcases the CFGU service to retrieve information about the console that the application is running on, +//! such as the model, region and used language. + use ctru::prelude::*; use ctru::services::cfgu::Cfgu; @@ -7,23 +12,24 @@ fn main() { let gfx = Gfx::new().expect("Couldn't obtain GFX controller"); let mut hid = Hid::new().expect("Couldn't obtain HID controller"); let apt = Apt::new().expect("Couldn't obtain APT controller"); - let cfgu = Cfgu::new().expect("Couldn't obtain CFGU controller"); let _console = Console::new(gfx.top_screen.borrow_mut()); + // Initialize the CFGU service to retrieve all wanted information. + let cfgu = Cfgu::new().expect("Couldn't obtain CFGU controller"); + println!("\x1b[0;0HRegion: {:?}", cfgu.region().unwrap()); println!("\x1b[10;0HLanguage: {:?}", cfgu.language().unwrap()); println!("\x1b[20;0HModel: {:?}", cfgu.model().unwrap()); - // Main loop + println!("\x1b[29;16HPress Start to exit"); + while apt.main_loop() { - //Scan all the inputs. This should be done once for each frame hid.scan_input(); if hid.keys_down().contains(KeyPad::START) { break; } - //Wait for VBlank gfx.wait_for_vblank(); } } diff --git a/ctru-rs/examples/thread-basic.rs b/ctru-rs/examples/thread-basic.rs index 33a8ea9..3e4604b 100644 --- a/ctru-rs/examples/thread-basic.rs +++ b/ctru-rs/examples/thread-basic.rs @@ -33,6 +33,8 @@ fn main() { println!("Created thread {ix}"); } + println!("\x1b[29;16HPress Start to exit"); + while apt.main_loop() { gfx.wait_for_vblank(); diff --git a/ctru-rs/examples/thread-info.rs b/ctru-rs/examples/thread-info.rs index 28297ac..46d34d3 100644 --- a/ctru-rs/examples/thread-info.rs +++ b/ctru-rs/examples/thread-info.rs @@ -36,7 +36,7 @@ fn main() { .unwrap(); println!("sys thread exited"); - println!("\nPress Start to exit"); + println!("\x1b[29;16HPress Start to exit"); while apt.main_loop() { hid.scan_input(); diff --git a/ctru-rs/examples/thread-locals.rs b/ctru-rs/examples/thread-locals.rs index 80d8508..72458c9 100644 --- a/ctru-rs/examples/thread-locals.rs +++ b/ctru-rs/examples/thread-locals.rs @@ -52,7 +52,7 @@ fn main() { ); }); - println!("Press Start to exit"); + println!("\x1b[29;16HPress Start to exit"); while apt.main_loop() { hid.scan_input(); diff --git a/ctru-rs/examples/time-rtc.rs b/ctru-rs/examples/time-rtc.rs index 377fd5c..e8c3a95 100644 --- a/ctru-rs/examples/time-rtc.rs +++ b/ctru-rs/examples/time-rtc.rs @@ -1,3 +1,8 @@ +//! Time Clock example. +//! +//! This example showcases how to retrieve the local time set in the console's configuration +//! using the implementations of the standard library. + use ctru::prelude::*; fn main() { @@ -9,11 +14,9 @@ fn main() { let _console = Console::new(gfx.top_screen.borrow_mut()); - print!("\x1b[30;16HPress Start to exit."); + println!("\x1b[29;16HPress Start to exit"); - // Main loop while apt.main_loop() { - // Scan all the inputs. This should be done once for each frame hid.scan_input(); if hid.keys_down().contains(KeyPad::START) { @@ -21,22 +24,12 @@ fn main() { } // Technically, this actually just gets local time and assumes it's UTC, - // since the 3DS doesn't seem to support timezones... + // since the 3DS doesn't seem to support timezones. let cur_time = time::OffsetDateTime::now_utc(); - let hours = cur_time.hour(); - let minutes = cur_time.minute(); - let seconds = cur_time.second(); - - let weekday = cur_time.weekday().to_string(); - let month = cur_time.month().to_string(); - let day = cur_time.day(); - let year = cur_time.year(); - - println!("\x1b[1;1H{hours:0>2}:{minutes:0>2}:{seconds:0>2}"); - println!("{weekday} {month} {day} {year}"); + // Display the retrieved information. + println!("\x1b[1;1H{cur_time}"); - //Wait for VBlank gfx.wait_for_vblank(); } } diff --git a/ctru-rs/examples/title-info.rs b/ctru-rs/examples/title-info.rs index 25b5c75..9cb4db8 100644 --- a/ctru-rs/examples/title-info.rs +++ b/ctru-rs/examples/title-info.rs @@ -1,3 +1,8 @@ +//! Title Info example. +//! +//! This example showcases how to retrieve information about the titles installed on the console running the application +//! via the Application Manager (Am) service. + use ctru::prelude::*; use ctru::services::am::Am; use ctru::services::fs::FsMediaType; @@ -8,20 +13,27 @@ fn main() { let gfx = Gfx::new().expect("Couldn't obtain GFX controller"); let mut hid = Hid::new().expect("Couldn't obtain HID controller"); let apt = Apt::new().expect("Couldn't obtain APT controller"); - let am = Am::new().expect("Couldn't obtain AM controller"); + let top_screen = Console::new(gfx.top_screen.borrow_mut()); let bottom_screen = Console::new(gfx.bottom_screen.borrow_mut()); + // Setup the AM service to retrieve the wanted information. + let am = Am::new().expect("Couldn't obtain AM controller"); + + // Amount of titles installed on the SD card. let sd_count = am .title_count(FsMediaType::Sd) .expect("Failed to get sd title count"); + // List of titles installed on the SD card. let sd_list = am .title_list(FsMediaType::Sd) .expect("Failed to get sd title list"); + // Amount of titles installed on the NAND storage. let nand_count = am .title_count(FsMediaType::Nand) .expect("Failed to get nand title count"); + // List of titles installed on the NAND storage. let nand_list = am .title_list(FsMediaType::Nand) .expect("Failed to get nand title list"); @@ -30,9 +42,7 @@ fn main() { let mut refresh = true; let mut use_nand = false; - // Main loop while apt.main_loop() { - //Scan all the inputs. This should be done once for each frame hid.scan_input(); if hid.keys_down().contains(KeyPad::START) { @@ -58,13 +68,15 @@ fn main() { } } + // Render the title list via a scrollable text UI. if refresh { let mut selected_title = cur_list.iter().skip(offset).next().unwrap(); - // Clear top screen and write title ids to it + + // Clear the top screen and write title IDs to it. top_screen.select(); print!("\x1b[2J"); - // Top screen seems to have only 30 rows + // Top screen has 30 rows. for (i, title) in cur_list.iter().skip(offset).take(29).enumerate() { if i == 0 { selected_title = title; @@ -74,17 +86,18 @@ fn main() { } } - // Clear bottom screen and write properties of selected title to it + // Clear the bottom screen and write the properties of selected title to it. bottom_screen.select(); println!("\x1b[2J"); - // Move cursor to top left + + // Move cursor to top left. println!("\x1b[1;1"); println!("Size: {} kB", selected_title.size() / 1024); println!("Version: 0x{:x}", selected_title.version()); println!("Product code: \"{}\"", selected_title.product_code()); - println!("\x1b[26;0HPress START to exit"); + println!("\x1b[29;16HPress Start to exit"); if use_nand { println!("Press SELECT to choose SD Card"); println!("Current medium: NAND"); @@ -98,7 +111,6 @@ fn main() { refresh = false; } - //Wait for VBlank gfx.wait_for_vblank(); } } diff --git a/ctru-rs/examples/touch-screen.rs b/ctru-rs/examples/touch-screen.rs index 204f324..a785055 100644 --- a/ctru-rs/examples/touch-screen.rs +++ b/ctru-rs/examples/touch-screen.rs @@ -1,3 +1,7 @@ +//! Touch Screen example. +//! +//! This example showcases how to retrieve the touch screen's touch information via the HID service. + use ctru::prelude::*; fn main() { @@ -9,7 +13,7 @@ fn main() { let console = Console::new(gfx.top_screen.borrow_mut()); - // We'll hold the previous touch position for comparison. + // We'll save the previous touch position for comparison. let mut old_touch: (u16, u16) = (0, 0); println!("\x1b[29;16HPress Start to exit"); @@ -26,22 +30,22 @@ fn main() { let touch: (u16, u16) = hid.touch_position(); // We only want to print the position when it's different - // from what it was on the previous frame + // from what it was on the previous frame. if touch != old_touch { // Special case for when the user lifts the stylus/finger from the screen. // This is done to avoid some screen tearing. if touch == (0, 0) { console.clear(); - // Print again because we just cleared the screen + // Print again because we just cleared the screen. println!("\x1b[29;16HPress Start to exit"); } - // Move the cursor back to the top of the screen and print the coordinates + // Move the cursor back to the top of the screen and print the coordinates. print!("\x1b[1;1HTouch Screen position: {:#?}", touch); } - // Save our current touch position for the next frame + // Save our current touch position for the next frame. old_touch = touch; gfx.wait_for_vblank(); diff --git a/ctru-rs/src/services/gfx.rs b/ctru-rs/src/services/gfx.rs index 5a2fc62..0769b81 100644 --- a/ctru-rs/src/services/gfx.rs +++ b/ctru-rs/src/services/gfx.rs @@ -414,8 +414,12 @@ impl TopScreen { /// Enable or disable wide mode on the top screen. /// + /// # Notes + /// /// [`Swap::swap_buffers`] must be called after this method for the configuration /// to take effect. + /// + /// Wide mode does NOT work on Old 2DS models (but still does on New 2DS XL models). #[doc(alias = "gfxSetWide")] pub fn set_wide_mode(&mut self, enable: bool) { unsafe { From 2af0268f8965a29a1fe92b55d0377fed403eeccf Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Fri, 28 Jul 2023 14:11:58 +0200 Subject: [PATCH 044/101] Fix examples after thorough testing --- ctru-rs/examples/camera-image.rs | 2 +- ctru-rs/examples/gfx-3d-mode.rs | 6 +++--- ctru-rs/examples/gfx-bitmap.rs | 9 +++++++++ ctru-rs/examples/network-sockets.rs | 12 +++++++----- ctru-rs/examples/software-keyboard.rs | 5 ++--- ctru-rs/examples/time-rtc.rs | 13 +++++++++++-- ctru-rs/examples/title-info.rs | 4 ++-- ctru-rs/examples/touch-screen.rs | 6 +++--- ctru-rs/src/console.rs | 4 +++- 9 files changed, 41 insertions(+), 20 deletions(-) diff --git a/ctru-rs/examples/camera-image.rs b/ctru-rs/examples/camera-image.rs index 40c5f75..851aa2a 100644 --- a/ctru-rs/examples/camera-image.rs +++ b/ctru-rs/examples/camera-image.rs @@ -61,7 +61,7 @@ fn main() { let mut buf = vec![0u8; BUF_SIZE]; println!("\nPress R to take a new picture"); - println!("\x1b[29;16HPress Start to exit"); + println!("Press Start to exit"); while apt.main_loop() { hid.scan_input(); diff --git a/ctru-rs/examples/gfx-3d-mode.rs b/ctru-rs/examples/gfx-3d-mode.rs index c5b9de8..32d7af1 100644 --- a/ctru-rs/examples/gfx-3d-mode.rs +++ b/ctru-rs/examples/gfx-3d-mode.rs @@ -10,7 +10,6 @@ use ctru::services::gfx::{Flush, Screen, Side, Swap, TopScreen3D}; // // WARNING: this example uses 3D mode in a rather unnatural way, and should // probably not be viewed for too long or at all if you are photosensitive. - const IMAGE: &[u8] = include_bytes!("assets/ferris.rgb"); static ZERO: &[u8] = &[0; IMAGE.len()]; @@ -22,8 +21,9 @@ fn main() { let apt = Apt::new().expect("Couldn't obtain APT controller"); let _console = Console::new(gfx.bottom_screen.borrow_mut()); - println!("Press A to switch sides (be sure to have set the 3D slider correctly)."); - println!("\x1b[29;16HPress Start to exit"); + println!("Press A to switch sides."); + println!("Make sure to have set the 3D slider correctly"); + println!("\x1b[29;12HPress Start to exit"); gfx.top_screen.borrow_mut().set_double_buffering(true); diff --git a/ctru-rs/examples/gfx-bitmap.rs b/ctru-rs/examples/gfx-bitmap.rs index 39634c2..8efb2be 100644 --- a/ctru-rs/examples/gfx-bitmap.rs +++ b/ctru-rs/examples/gfx-bitmap.rs @@ -64,6 +64,15 @@ fn main() { } else { IMAGE }; + + let frame_buffer = bottom_screen.raw_framebuffer(); + + // We render the newly switched image to the framebuffer. + unsafe { + frame_buffer + .ptr + .copy_from(image_bytes.as_ptr(), image_bytes.len()); + } } // Flush framebuffers. Since we're not using double buffering, diff --git a/ctru-rs/examples/network-sockets.rs b/ctru-rs/examples/network-sockets.rs index 0cc70ad..d55e29c 100644 --- a/ctru-rs/examples/network-sockets.rs +++ b/ctru-rs/examples/network-sockets.rs @@ -12,12 +12,9 @@ fn main() { ctru::use_panic_handler(); let gfx = Gfx::new().unwrap(); - let _console = Console::new(gfx.top_screen.borrow_mut()); let mut hid = Hid::new().unwrap(); let apt = Apt::new().unwrap(); - println!("\nlibctru sockets demo\n"); - // Owning a living handle to the `Soc` service is required to use network functionalities. let soc = Soc::new().unwrap(); @@ -25,8 +22,12 @@ fn main() { let server = TcpListener::bind("0.0.0.0:80").unwrap(); server.set_nonblocking(true).unwrap(); - println!("Point your browser to http://{}/\n", soc.host_address()); - println!("\x1b[29;16HPress Start to exit"); + let _bottom_console = Console::new(gfx.bottom_screen.borrow_mut()); + + println!("Point your browser at:\nhttp://{}/\n", soc.host_address()); + println!("\x1b[29;12HPress Start to exit"); + + let _top_console = Console::new(gfx.top_screen.borrow_mut()); while apt.main_loop() { hid.scan_input(); @@ -34,6 +35,7 @@ fn main() { break; }; + // Receive any incoming connections. match server.accept() { Ok((mut stream, socket_addr)) => { println!("Got connection from {socket_addr}"); diff --git a/ctru-rs/examples/software-keyboard.rs b/ctru-rs/examples/software-keyboard.rs index 269ccf0..e754781 100644 --- a/ctru-rs/examples/software-keyboard.rs +++ b/ctru-rs/examples/software-keyboard.rs @@ -13,8 +13,7 @@ fn main() { let gfx = Gfx::new().unwrap(); let _console = Console::new(gfx.top_screen.borrow_mut()); - println!("Press A to enter some text."); - println!("\x1b[29;16HPress Start to exit"); + println!("Press A to enter some text or press Start to exit."); while apt.main_loop() { hid.scan_input(); @@ -23,7 +22,7 @@ fn main() { break; } - // If the user request to write some input. + // Check if the user request to write some input. if hid.keys_down().contains(KeyPad::A) { // Prepares a software keyboard with two buttons: One to cancel input and one // to accept it. You can also use `SoftwareKeyboard::new()` to launch the keyboard in different diff --git a/ctru-rs/examples/time-rtc.rs b/ctru-rs/examples/time-rtc.rs index e8c3a95..ca4709a 100644 --- a/ctru-rs/examples/time-rtc.rs +++ b/ctru-rs/examples/time-rtc.rs @@ -27,8 +27,17 @@ fn main() { // since the 3DS doesn't seem to support timezones. let cur_time = time::OffsetDateTime::now_utc(); - // Display the retrieved information. - println!("\x1b[1;1H{cur_time}"); + let hours = cur_time.hour(); + let minutes = cur_time.minute(); + let seconds = cur_time.second(); + + let weekday = cur_time.weekday().to_string(); + let month = cur_time.month().to_string(); + let day = cur_time.day(); + let year = cur_time.year(); + + println!("\x1b[1;1H{hours:0>2}:{minutes:0>2}:{seconds:0>2}"); + println!("{weekday} {month} {day} {year}"); gfx.wait_for_vblank(); } diff --git a/ctru-rs/examples/title-info.rs b/ctru-rs/examples/title-info.rs index 9cb4db8..d2898ac 100644 --- a/ctru-rs/examples/title-info.rs +++ b/ctru-rs/examples/title-info.rs @@ -88,7 +88,8 @@ fn main() { // Clear the bottom screen and write the properties of selected title to it. bottom_screen.select(); - println!("\x1b[2J"); + bottom_screen.clear(); + println!("Press Start to exit"); // Move cursor to top left. println!("\x1b[1;1"); @@ -97,7 +98,6 @@ fn main() { println!("Version: 0x{:x}", selected_title.version()); println!("Product code: \"{}\"", selected_title.product_code()); - println!("\x1b[29;16HPress Start to exit"); if use_nand { println!("Press SELECT to choose SD Card"); println!("Current medium: NAND"); diff --git a/ctru-rs/examples/touch-screen.rs b/ctru-rs/examples/touch-screen.rs index a785055..135de2b 100644 --- a/ctru-rs/examples/touch-screen.rs +++ b/ctru-rs/examples/touch-screen.rs @@ -32,6 +32,9 @@ fn main() { // We only want to print the position when it's different // from what it was on the previous frame. if touch != old_touch { + // Move the cursor back to the top of the screen and print the coordinates. + print!("\x1b[1;1HTouch Screen position: {:#?}", touch); + // Special case for when the user lifts the stylus/finger from the screen. // This is done to avoid some screen tearing. if touch == (0, 0) { @@ -40,9 +43,6 @@ fn main() { // Print again because we just cleared the screen. println!("\x1b[29;16HPress Start to exit"); } - - // Move the cursor back to the top of the screen and print the coordinates. - print!("\x1b[1;1HTouch Screen position: {:#?}", touch); } // Save our current touch position for the next frame. diff --git a/ctru-rs/src/console.rs b/ctru-rs/src/console.rs index 8eb3ebc..32fbe10 100644 --- a/ctru-rs/src/console.rs +++ b/ctru-rs/src/console.rs @@ -21,7 +21,9 @@ static mut EMPTY_CONSOLE: PrintConsole = unsafe { const_zero::const_zero!(PrintC /// /// # Notes /// -/// The console will take full possession of the screen handed to it as long as it stays alive. It also supports ANSI codes. +/// The [`Console`] will take full possession of the screen handed to it as long as it stays alive. It also supports ANSI codes. +/// The [`Console`]'s window will have a size of 40x30 on the bottom screen, 50x30 on the normal top screen and +/// 100x30 on the top screen when wide mode is enabled. /// /// # Alternatives /// From 99d1b9128cafac79d5fc2d1b68b53e3390e45814 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Fri, 28 Jul 2023 16:56:40 +0200 Subject: [PATCH 045/101] Fixed clippy warnings --- ctru-rs/src/services/fs.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ctru-rs/src/services/fs.rs b/ctru-rs/src/services/fs.rs index d5d7916..b7636eb 100644 --- a/ctru-rs/src/services/fs.rs +++ b/ctru-rs/src/services/fs.rs @@ -413,7 +413,7 @@ impl File { /// let mut sdmc_archive = fs.sdmc().unwrap(); /// let mut f = File::create(&mut sdmc_archive, "/foo.txt").unwrap(); /// ``` - pub fn create>(arch: &mut Archive, path: P) -> IoResult { + pub fn create>(arch: &Archive, path: P) -> IoResult { OpenOptions::new() .write(true) .create(true) @@ -738,7 +738,7 @@ impl<'a> DirEntry<'a> { /// /// * User lacks permissions to create directory at `path` #[doc(alias = "FSUSER_CreateDirectory")] -pub fn create_dir>(arch: &mut Archive, path: P) -> IoResult<()> { +pub fn create_dir>(arch: &Archive, path: P) -> IoResult<()> { unsafe { let path = to_utf16(path.as_ref()); let fs_path = ctru_sys::fsMakePath(PathType::UTF16.into(), path.as_ptr() as _); @@ -765,7 +765,7 @@ pub fn create_dir>(arch: &mut Archive, path: P) -> IoResult<()> { /// * If any directory in the path specified by `path` does not already exist /// and it could not be created otherwise. #[doc(alias = "FSUSER_CreateDirectory")] -pub fn create_dir_all>(arch: &mut Archive, path: P) -> IoResult<()> { +pub fn create_dir_all>(arch: &Archive, path: P) -> IoResult<()> { let path = path.as_ref(); let mut dir = PathBuf::new(); let mut result = Ok(()); @@ -802,7 +802,7 @@ pub fn metadata>(arch: &Archive, path: P) -> IoResult { /// * The user lacks permissions to remove the directory at the provided path. /// * The directory isn't empty. #[doc(alias = "FSUSER_DeleteDirectory")] -pub fn remove_dir>(arch: &mut Archive, path: P) -> IoResult<()> { +pub fn remove_dir>(arch: &Archive, path: P) -> IoResult<()> { unsafe { let path = to_utf16(path.as_ref()); let fs_path = ctru_sys::fsMakePath(PathType::UTF16.into(), path.as_ptr() as _); @@ -821,7 +821,7 @@ pub fn remove_dir>(arch: &mut Archive, path: P) -> IoResult<()> { /// /// see `file::remove_file` and `fs::remove_dir` #[doc(alias = "FSUSER_DeleteDirectoryRecursively")] -pub fn remove_dir_all>(arch: &mut Archive, path: P) -> IoResult<()> { +pub fn remove_dir_all>(arch: &Archive, path: P) -> IoResult<()> { unsafe { let path = to_utf16(path.as_ref()); let fs_path = ctru_sys::fsMakePath(PathType::UTF16.into(), path.as_ptr() as _); @@ -875,7 +875,7 @@ pub fn read_dir>(arch: &Archive, path: P) -> IoResult { /// * path points to a directory. /// * The user lacks permissions to remove the file. #[doc(alias = "FSUSER_DeleteFile")] -pub fn remove_file>(arch: &mut Archive, path: P) -> IoResult<()> { +pub fn remove_file>(arch: &Archive, path: P) -> IoResult<()> { unsafe { let path = to_utf16(path.as_ref()); let fs_path = ctru_sys::fsMakePath(PathType::UTF16.into(), path.as_ptr() as _); @@ -899,7 +899,7 @@ pub fn remove_file>(arch: &mut Archive, path: P) -> IoResult<()> /// * from does not exist. /// * The user lacks permissions to view contents. #[doc(alias = "FSUSER_RenameFile", alias = "FSUSER_RenameDirectory")] -pub fn rename(arch: &mut Archive, from: P, to: Q) -> IoResult<()> +pub fn rename(arch: &Archive, from: P, to: Q) -> IoResult<()> where P: AsRef, Q: AsRef, From 1640e201e931021da56a6a5d21d722daf7c62b52 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Fri, 28 Jul 2023 18:02:17 +0200 Subject: [PATCH 046/101] Finishing touches after complete revision --- ctru-rs/src/console.rs | 2 +- ctru-rs/src/lib.rs | 6 +++--- ctru-rs/src/linear.rs | 4 ++-- ctru-rs/src/services/apt.rs | 2 +- ctru-rs/src/services/cam.rs | 11 +++++------ ctru-rs/src/services/cfgu.rs | 2 +- ctru-rs/src/services/fs.rs | 12 +++++------ ctru-rs/src/services/gfx.rs | 33 +++++++++++++++++++++---------- ctru-rs/src/services/hid.rs | 2 +- ctru-rs/src/services/ndsp/mod.rs | 22 ++++++++++----------- ctru-rs/src/services/ndsp/wave.rs | 16 +++++++-------- 11 files changed, 62 insertions(+), 50 deletions(-) diff --git a/ctru-rs/src/console.rs b/ctru-rs/src/console.rs index 32fbe10..ca3681d 100644 --- a/ctru-rs/src/console.rs +++ b/ctru-rs/src/console.rs @@ -127,7 +127,7 @@ impl<'screen> Console<'screen> { /// /// Any previously selected console will be unhooked and will not show the `stdout` output. /// - /// # Example + /// # Example /// /// ```no_run /// # use std::error::Error; diff --git a/ctru-rs/src/lib.rs b/ctru-rs/src/lib.rs index 3686578..ecc7dd9 100644 --- a/ctru-rs/src/lib.rs +++ b/ctru-rs/src/lib.rs @@ -3,7 +3,7 @@ //! # About //! //! This crate behaves as the main tool to access system-specific functionality on the Nintendo 3DS when developing homebrew software in Rust. -//! Thanks to it, developers can access the underlying system services and the console's hardware to develop userland applications +//! Thanks to it, developers can develop userland applications by accessing access the underlying system services and the console's hardware //! (such as [HID devices](crate::services::hid), [network capabilities](crate::services::soc), [graphics](crate::services::gfx), [built-in cameras](crate::services::cam), etc.). //! //! Among these features, [`ctru-rs`](crate) also automatically includes functionality to properly integrate the Rust `std` with the console's operating system, @@ -13,7 +13,7 @@ //! //! Thoroughly read the official [`ctru-rs` wiki](https://github.com/rust3ds/ctru-rs/wiki) which guides you through the setup needed to install the required toolchain and helpful tools. //! After following the guide and understanding the many quirks of the Nintendo 3DS homebrew development environment, you can create a new project by including this crate as a dependency -//! of your project in your `Cargo.toml` manifest and build your binaries either manually (for the `armv6k-nintendo-3ds` target) or via [`cargo-3ds`](https://github.com/rust3ds/cargo-3ds). +//! in your `Cargo.toml` manifest and build your binaries either manually (for the `armv6k-nintendo-3ds` target) or via [`cargo-3ds`](https://github.com/rust3ds/cargo-3ds). #![crate_type = "rlib"] #![crate_name = "ctru"] @@ -60,7 +60,7 @@ macro_rules! from_impl { /// /// # Notes /// -/// When ´test´ is enabled, this function will not do anything, as it should be overridden by the ´test´ environment. +/// When `test` is enabled, this function will not do anything, as its behaviour should be overridden by the `test` environment. pub fn use_panic_handler() { #[cfg(not(test))] panic_hook_setup(); diff --git a/ctru-rs/src/linear.rs b/ctru-rs/src/linear.rs index 8c0639a..269e5dd 100644 --- a/ctru-rs/src/linear.rs +++ b/ctru-rs/src/linear.rs @@ -1,11 +1,11 @@ //! LINEAR memory allocator. //! //! LINEAR memory is a sector of the 3DS' RAM that binds virtual addresses exactly to the physical address. -//! As such, it is used for fast and safe memory sharing between hardware processors (such as the GPU and the DSP). +//! As such, it is used for fast and safe memory sharing between different hardware components (such as the GPU and the DSP processor). //! //! # Additional Resources //! -//! -
+//! - //! - use std::alloc::{AllocError, Allocator, Layout}; diff --git a/ctru-rs/src/services/apt.rs b/ctru-rs/src/services/apt.rs index 1fba0e5..b30be85 100644 --- a/ctru-rs/src/services/apt.rs +++ b/ctru-rs/src/services/apt.rs @@ -67,7 +67,7 @@ impl Apt { unsafe { ctru_sys::aptMainLoop() } } - /// Sets (in percentage) the amount of time to lend to the application thread spawned on the syscore (core #1). + /// Set (in percentage) the amount of time to lend to the application thread spawned on the syscore (core #1). /// /// # Notes /// diff --git a/ctru-rs/src/services/cam.rs b/ctru-rs/src/services/cam.rs index dd4437b..23316c1 100644 --- a/ctru-rs/src/services/cam.rs +++ b/ctru-rs/src/services/cam.rs @@ -302,8 +302,7 @@ impl Camera for OutwardLeftCam { pub struct BothOutwardCam; impl BothOutwardCam { - /// Sets whether to enable or disable synchronization - /// of brightness for both left and right cameras + /// Set whether to enable or disable brightness synchronization between the two cameras. #[doc(alias = "CAMU_SetBrightnessSynchronization")] pub fn set_brightness_synchronization( &mut self, @@ -560,7 +559,7 @@ pub trait Camera { } } - /// Sets whether auto white balance is enabled or disabled for the camera + /// Set whether auto white balance is enabled or disabled for the camera. #[doc(alias = "CAMU_SetAutoWhiteBalance")] fn set_auto_white_balance(&mut self, enabled: bool) -> crate::Result<()> { unsafe { @@ -659,7 +658,7 @@ pub trait Camera { } } - /// Sets the photo mode of the camera. + /// Set the photo mode of the camera. #[doc(alias = "CAMU_SetPhotoMode")] fn set_photo_mode(&mut self, photo_mode: PhotoMode) -> crate::Result<()> { unsafe { @@ -671,7 +670,7 @@ pub trait Camera { } } - /// Sets the effect of the camera. + /// Set the effect of the camera. /// /// # Notes /// @@ -975,7 +974,7 @@ impl Cam { } } - /// Plays the specified sound based on the [`ShutterSound`] argument + /// Play the specified sound based on the [`ShutterSound`] argument /// /// # Notes /// diff --git a/ctru-rs/src/services/cfgu.rs b/ctru-rs/src/services/cfgu.rs index 252b11f..d63f227 100644 --- a/ctru-rs/src/services/cfgu.rs +++ b/ctru-rs/src/services/cfgu.rs @@ -1,6 +1,6 @@ //! System Configuration service. //! -//! This module contains basic methods to retrieve and change configuration from the console. +//! This module contains basic methods to retrieve the console's system configuration. use crate::error::ResultCode; diff --git a/ctru-rs/src/services/fs.rs b/ctru-rs/src/services/fs.rs index b7636eb..f168e32 100644 --- a/ctru-rs/src/services/fs.rs +++ b/ctru-rs/src/services/fs.rs @@ -542,7 +542,7 @@ impl OpenOptions { Self::default() } - /// Sets the option for read access. + /// Set the option for read access. /// /// This option, when true, will indicate that the file should be /// `read`-able if opened. @@ -551,7 +551,7 @@ impl OpenOptions { self } - /// Sets the option for write access. + /// Set the option for write access. /// /// This option, when true, will indicate that the file should be /// `write`-able if opened. @@ -563,7 +563,7 @@ impl OpenOptions { self } - /// Sets the option for the append mode. + /// Set the option for the append mode. /// /// This option, when true, means that writes will append to a file instead /// of overwriting previous contents. Note that setting .write(true).append(true) @@ -575,7 +575,7 @@ impl OpenOptions { self } - /// Sets the option for truncating a previous file. + /// Set the option for truncating a previous file. /// /// If a file is successfully opened with this option set it will truncate /// the file to 0 length if it already exists. @@ -586,7 +586,7 @@ impl OpenOptions { self } - /// Sets the option for creating a new file. + /// Set the option for creating a new file. /// /// This option indicates whether a new file will be created /// if the file does not yet already @@ -598,7 +598,7 @@ impl OpenOptions { self } - /// Sets which archive the file is to be opened in. + /// Set which archive the file is to be opened in. /// /// Failing to pass in an archive will result in the file failing to open. pub fn archive(&mut self, archive: &Archive) -> &mut OpenOptions { diff --git a/ctru-rs/src/services/gfx.rs b/ctru-rs/src/services/gfx.rs index 0769b81..e1b27c7 100644 --- a/ctru-rs/src/services/gfx.rs +++ b/ctru-rs/src/services/gfx.rs @@ -55,15 +55,6 @@ pub trait Screen: private::Sealed { } } - /// Sets whether to use double buffering. Enabled by default. - /// - /// [`Swap::swap_buffers`] must be called after this function for the configuration - /// change to take effect. - #[doc(alias = "gfxSetDoubleBuffering")] - fn set_double_buffering(&mut self, enabled: bool) { - unsafe { ctru_sys::gfxSetDoubleBuffering(self.as_raw(), enabled) } - } - /// Gets the framebuffer format. #[doc(alias = "gfxGetScreenFormat")] fn framebuffer_format(&self) -> FramebufferFormat { @@ -106,11 +97,21 @@ pub trait Swap: private::Sealed { /// /// Even if double buffering is disabled, "swapping" the buffers has the side effect /// of committing any configuration changes to the buffers (e.g. [`TopScreen::set_wide_mode()`], - /// [`Screen::set_framebuffer_format()`], [`Screen::set_double_buffering()`]), so it should still be used. + /// [`Screen::set_framebuffer_format()`], [`Swap::set_double_buffering()`]), so it should still be used. /// /// This should be called once per frame at most. #[doc(alias = "gfxScreenSwapBuffers")] fn swap_buffers(&mut self); + + /// Set whether to use double buffering. + /// + /// # Notes + /// + /// Double buffering is enabled by default. + /// [`Swap::swap_buffers`] must be called after this function for the configuration + /// change to take effect. + #[doc(alias = "gfxSetDoubleBuffering")] + fn set_double_buffering(&mut self, enabled: bool); } impl Swap for TopScreen3D<'_> { @@ -119,6 +120,10 @@ impl Swap for TopScreen3D<'_> { ctru_sys::gfxScreenSwapBuffers(ctru_sys::GFX_TOP, true); } } + + fn set_double_buffering(&mut self, enabled: bool) { + unsafe { ctru_sys::gfxSetDoubleBuffering(ctru_sys::GFX_TOP, enabled) } + } } impl Swap for TopScreen { @@ -127,6 +132,10 @@ impl Swap for TopScreen { ctru_sys::gfxScreenSwapBuffers(ctru_sys::GFX_TOP, false); } } + + fn set_double_buffering(&mut self, enabled: bool) { + unsafe { ctru_sys::gfxSetDoubleBuffering(ctru_sys::GFX_TOP, enabled) } + } } impl Swap for BottomScreen { @@ -135,6 +144,10 @@ impl Swap for BottomScreen { ctru_sys::gfxScreenSwapBuffers(ctru_sys::GFX_BOTTOM, false); } } + + fn set_double_buffering(&mut self, enabled: bool) { + unsafe { ctru_sys::gfxSetDoubleBuffering(ctru_sys::GFX_BOTTOM, enabled) } + } } /// A screen with buffers that can be flushed. diff --git a/ctru-rs/src/services/hid.rs b/ctru-rs/src/services/hid.rs index fc73612..c790131 100644 --- a/ctru-rs/src/services/hid.rs +++ b/ctru-rs/src/services/hid.rs @@ -142,7 +142,7 @@ impl Hid { /// hid.scan_input(); /// /// if hid.keys_down().contains(KeyPad::A) { - /// println!("You just pressed the A button!") + /// println!("You have pressed the A button!") /// } /// # /// # Ok(()) diff --git a/ctru-rs/src/services/ndsp/mod.rs b/ctru-rs/src/services/ndsp/mod.rs index fc76584..eb9328d 100644 --- a/ctru-rs/src/services/ndsp/mod.rs +++ b/ctru-rs/src/services/ndsp/mod.rs @@ -540,7 +540,7 @@ impl Channel<'_> { unsafe { ctru_sys::ndspChnIirMonoSetEnable(self.id.into(), enable) }; } - /// Sets the monopole to be a high pass filter. + /// Set the monopole to be a high pass filter. /// /// # Notes /// @@ -550,7 +550,7 @@ impl Channel<'_> { unsafe { ctru_sys::ndspChnIirMonoSetParamsHighPassFilter(self.id.into(), cut_off_freq) }; } - /// Sets the monopole to be a low pass filter. + /// Set the monopole to be a low pass filter. /// /// # Notes /// @@ -566,7 +566,7 @@ impl Channel<'_> { unsafe { ctru_sys::ndspChnIirBiquadSetEnable(self.id.into(), enable) }; } - /// Sets the biquad to be a high pass filter. + /// Set the biquad to be a high pass filter. #[doc(alias = "ndspChnIirBiquadSetParamsHighPassFilter")] pub fn iir_biquad_set_params_high_pass_filter(&mut self, cut_off_freq: f32, quality: f32) { unsafe { @@ -574,7 +574,7 @@ impl Channel<'_> { }; } - /// Sets the biquad to be a low pass filter. + /// Set the biquad to be a low pass filter. #[doc(alias = "ndspChnIirBiquadSetParamsLowPassFilter")] pub fn iir_biquad_set_params_low_pass_filter(&mut self, cut_off_freq: f32, quality: f32) { unsafe { @@ -582,7 +582,7 @@ impl Channel<'_> { }; } - /// Sets the biquad to be a notch filter. + /// Set the biquad to be a notch filter. #[doc(alias = "ndspChnIirBiquadSetParamsNotchFilter")] pub fn iir_biquad_set_params_notch_filter(&mut self, notch_freq: f32, quality: f32) { unsafe { @@ -590,7 +590,7 @@ impl Channel<'_> { }; } - /// Sets the biquad to be a band pass filter. + /// Set the biquad to be a band pass filter. #[doc(alias = "ndspChnIirBiquadSetParamsBandPassFilter")] pub fn iir_biquad_set_params_band_pass_filter(&mut self, mid_freq: f32, quality: f32) { unsafe { @@ -598,7 +598,7 @@ impl Channel<'_> { }; } - /// Sets the biquad to be a peaking equalizer. + /// Set the biquad to be a peaking equalizer. #[doc(alias = "ndspChnIirBiquadSetParamsPeakingEqualizer")] pub fn iir_biquad_set_params_peaking_equalizer( &mut self, @@ -681,7 +681,7 @@ impl AudioMix { (self.raw[index], self.raw[index + 1]) } - /// Sets the values for the "front" volume mix (left and right channel). + /// Set the values for the "front" volume mix (left and right channel). /// /// # Notes /// @@ -692,7 +692,7 @@ impl AudioMix { self.raw[1] = right; } - /// Sets the values for the "back" volume mix (left and right channel). + /// Set the values for the "back" volume mix (left and right channel). /// /// # Notes /// @@ -703,7 +703,7 @@ impl AudioMix { self.raw[3] = right; } - /// Sets the values for the "front" volume mix (left and right channel) for the specified auxiliary output device (either 0 or 1). + /// Set the values for the "front" volume mix (left and right channel) for the specified auxiliary output device (either 0 or 1). /// /// # Notes /// @@ -720,7 +720,7 @@ impl AudioMix { self.raw[index + 1] = right; } - /// Sets the values for the "back" volume mix (left and right channel) for the specified auxiliary output device (either 0 or 1). + /// Set the values for the "back" volume mix (left and right channel) for the specified auxiliary output device (either 0 or 1). /// /// # Notes /// diff --git a/ctru-rs/src/services/ndsp/wave.rs b/ctru-rs/src/services/ndsp/wave.rs index 72cee96..9171278 100644 --- a/ctru-rs/src/services/ndsp/wave.rs +++ b/ctru-rs/src/services/ndsp/wave.rs @@ -32,7 +32,7 @@ pub enum Status { } impl Wave { - /// Build a new playable wave object from a raw buffer on [LINEAR memory](`crate::linear`) and a some info. + /// Build a new playable wave object from a raw buffer on [LINEAR memory](`crate::linear`) and some info. /// /// # Example /// @@ -86,12 +86,12 @@ impl Wave { } } - /// Return a slice to the audio data (on the LINEAR memory). + /// Returns a slice to the audio data (on the LINEAR memory). pub fn get_buffer(&self) -> &[u8] { &self.buffer } - /// Return a mutable slice to the audio data (on the LINEAR memory). + /// Returns a mutable slice to the audio data (on the LINEAR memory). /// /// # Errors /// @@ -106,7 +106,7 @@ impl Wave { } } - /// Return this wave's playback status. + /// Returns this wave's playback status. /// /// # Example /// @@ -130,7 +130,7 @@ impl Wave { self.raw_data.status.try_into().unwrap() } - /// Get the amounts of samples *read* by the NDSP process. + /// Returns the amount of samples *read* by the NDSP process. /// /// # Notes /// @@ -139,7 +139,7 @@ impl Wave { self.raw_data.nsamples as usize } - /// Get the format of the audio data. + /// Returns the format of the audio data. pub fn format(&self) -> AudioFormat { self.audio_format } @@ -152,11 +152,11 @@ impl Wave { } /// Set the amount of samples to be read. - /// This function doesn't resize the internal buffer. /// /// # Note + /// /// - /// Operations of this kind are particularly useful to allocate memory pools + /// This function doesn't resize the internal buffer. Operations of this kind are particularly useful to allocate memory pools /// for VBR (Variable BitRate) formats, like OGG Vorbis. /// /// # Errors From 8328721b5b0a66ccf792000fb30bffe37dc54761 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Fri, 28 Jul 2023 18:17:22 +0200 Subject: [PATCH 047/101] Fmt --- ctru-rs/examples/touch-screen.rs | 2 +- ctru-rs/src/services/gfx.rs | 4 ++-- ctru-rs/src/services/ndsp/wave.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ctru-rs/examples/touch-screen.rs b/ctru-rs/examples/touch-screen.rs index 135de2b..fe2409d 100644 --- a/ctru-rs/examples/touch-screen.rs +++ b/ctru-rs/examples/touch-screen.rs @@ -34,7 +34,7 @@ fn main() { if touch != old_touch { // Move the cursor back to the top of the screen and print the coordinates. print!("\x1b[1;1HTouch Screen position: {:#?}", touch); - + // Special case for when the user lifts the stylus/finger from the screen. // This is done to avoid some screen tearing. if touch == (0, 0) { diff --git a/ctru-rs/src/services/gfx.rs b/ctru-rs/src/services/gfx.rs index e1b27c7..2769c85 100644 --- a/ctru-rs/src/services/gfx.rs +++ b/ctru-rs/src/services/gfx.rs @@ -104,9 +104,9 @@ pub trait Swap: private::Sealed { fn swap_buffers(&mut self); /// Set whether to use double buffering. - /// + /// /// # Notes - /// + /// /// Double buffering is enabled by default. /// [`Swap::swap_buffers`] must be called after this function for the configuration /// change to take effect. diff --git a/ctru-rs/src/services/ndsp/wave.rs b/ctru-rs/src/services/ndsp/wave.rs index 9171278..1a383ca 100644 --- a/ctru-rs/src/services/ndsp/wave.rs +++ b/ctru-rs/src/services/ndsp/wave.rs @@ -154,7 +154,7 @@ impl Wave { /// Set the amount of samples to be read. /// /// # Note - /// + /// /// /// This function doesn't resize the internal buffer. Operations of this kind are particularly useful to allocate memory pools /// for VBR (Variable BitRate) formats, like OGG Vorbis. From 354b9e3cdd180654fa325dde5882952f0a3fed8a Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Fri, 28 Jul 2023 19:13:24 +0200 Subject: [PATCH 048/101] Change Actions minimum nightly --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index de60e6b..ee97ccc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: matrix: toolchain: # Run against a "known good" nightly - - nightly-2023-01-13 + - nightly-2023-05-31 # Check for breakage on latest nightly - nightly @@ -57,7 +57,7 @@ jobs: strategy: matrix: toolchain: - - nightly-2023-01-13 + - nightly-2023-05-31 - nightly continue-on-error: ${{ matrix.toolchain == 'nightly' }} runs-on: ubuntu-latest From 073ebd767bfdad42edde2fd324a367b227a1ec95 Mon Sep 17 00:00:00 2001 From: Fenrir Date: Fri, 28 Jul 2023 14:47:54 -0600 Subject: [PATCH 049/101] Generate ctru-sys bindings at build-time --- Cargo.toml | 2 +- ctru-sys/Cargo.toml | 5 +- ctru-sys/bindgen-ctru-sys/Cargo.toml | 8 - ctru-sys/bindgen-ctru-sys/src/main.rs | 63 - ctru-sys/bindgen.sh | 38 - ctru-sys/build.rs | 117 +- ctru-sys/libextern.a | Bin 14632 -> 0 bytes ctru-sys/src/bindings.rs | 19002 ------------------------ ctru-sys/src/lib.rs | 6 +- 9 files changed, 114 insertions(+), 19127 deletions(-) delete mode 100644 ctru-sys/bindgen-ctru-sys/Cargo.toml delete mode 100644 ctru-sys/bindgen-ctru-sys/src/main.rs delete mode 100755 ctru-sys/bindgen.sh delete mode 100644 ctru-sys/libextern.a delete mode 100644 ctru-sys/src/bindings.rs diff --git a/Cargo.toml b/Cargo.toml index af22c84..2200c78 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] -members = ["ctru-rs", "ctru-sys", "ctru-sys/bindgen-ctru-sys"] +members = ["ctru-rs", "ctru-sys"] default-members = ["ctru-rs", "ctru-sys"] [patch.'https://github.com/rust3ds/ctru-rs'] diff --git a/ctru-sys/Cargo.toml b/ctru-sys/Cargo.toml index d4cb24b..e83bb03 100644 --- a/ctru-sys/Cargo.toml +++ b/ctru-sys/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "ctru-sys" version = "22.2.0+2.2.2-1" -authors = [ "Rust3DS Org", "Ronald Kinard " ] +authors = ["Rust3DS Org", "Ronald Kinard "] license = "Zlib" links = "ctru" edition = "2021" @@ -10,4 +10,7 @@ edition = "2021" libc = { version = "0.2.121", default-features = false } [build-dependencies] +bindgen = { version = "0.65.1", features = ["experimental"] } +cc = "1.0" +doxygen-rs = "0.4.2" which = "4.4.0" diff --git a/ctru-sys/bindgen-ctru-sys/Cargo.toml b/ctru-sys/bindgen-ctru-sys/Cargo.toml deleted file mode 100644 index 9e223b3..0000000 --- a/ctru-sys/bindgen-ctru-sys/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "bindgen-ctru-sys" -version = "0.1.0" -edition = "2021" - -[dependencies] -bindgen = { version = "0.65.1", features = ["experimental"] } -doxygen-rs = "0.4.2" diff --git a/ctru-sys/bindgen-ctru-sys/src/main.rs b/ctru-sys/bindgen-ctru-sys/src/main.rs deleted file mode 100644 index adf7e89..0000000 --- a/ctru-sys/bindgen-ctru-sys/src/main.rs +++ /dev/null @@ -1,63 +0,0 @@ -use bindgen::callbacks::ParseCallbacks; -use bindgen::{Builder, RustTarget}; -use std::path::PathBuf; - -#[derive(Debug)] -struct CustomCallbacks; - -impl ParseCallbacks for CustomCallbacks { - fn process_comment(&self, comment: &str) -> Option { - Some(doxygen_rs::transform(comment)) - } -} - -fn main() { - let devkitpro = std::env::var("DEVKITPRO").expect("DEVKITPRO not set in environment"); - let devkitarm = std::env::var("DEVKITARM").expect("DEVKITARM not set in environment"); - - let include_path = PathBuf::from_iter([devkitpro.as_str(), "libctru", "include"]); - let ctru_header = include_path.join("3ds.h"); - - let sysroot = PathBuf::from(devkitarm).join("arm-none-eabi"); - let system_include = sysroot.join("include"); - let errno_header = system_include.join("errno.h"); - - let bindings = Builder::default() - .header(ctru_header.to_str().unwrap()) - .header(errno_header.to_str().unwrap()) - .rust_target(RustTarget::Nightly) - .use_core() - .trust_clang_mangling(false) - .must_use_type("Result") - .layout_tests(false) - .ctypes_prefix("::libc") - .prepend_enum_name(false) - .blocklist_type("u(8|16|32|64)") - .blocklist_type("__builtin_va_list") - .blocklist_type("__va_list") - .opaque_type("MiiData") - .derive_default(true) - .wrap_static_fns(true) - .clang_args([ - "--target=arm-none-eabi", - "--sysroot", - sysroot.to_str().unwrap(), - "-isystem", - system_include.to_str().unwrap(), - "-I", - include_path.to_str().unwrap(), - "-mfloat-abi=hard", - "-march=armv6k", - "-mtune=mpcore", - "-mfpu=vfp", - "-DARM11", - "-D__3DS__", - ]) - .parse_callbacks(Box::new(CustomCallbacks)) - .generate() - .expect("unable to generate bindings"); - - bindings - .write(Box::new(std::io::stdout())) - .expect("failed to write bindings"); -} diff --git a/ctru-sys/bindgen.sh b/ctru-sys/bindgen.sh deleted file mode 100755 index 7d4717c..0000000 --- a/ctru-sys/bindgen.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -echo "Determining libctru version..." -pacman=dkp-pacman -if ! command -v $pacman &>/dev/null; then - pacman=pacman - if ! command -v $pacman &>/dev/null; then - echo >&2 "ERROR: Unable to automatically determine libctru version!" - exit 1 - fi -fi - -LIBCTRU_VERSION="$($pacman -Qi libctru | grep Version | cut -d: -f 2 | tr -d ' ')" - -CTRU_SYS_VERSION="$( - printf '%s' "$LIBCTRU_VERSION" | - cut -d- -f1 | - sed -E 's/^([0-9]+)\.([0-9.]+)$/\1\2/' -)" - -echo "Generating bindings.rs..." -cargo run --package bindgen-ctru-sys > src/bindings.rs - -echo "Formatting generated files..." -cargo fmt --all - -echo "Compiling static inline wrappers..." -arm-none-eabi-gcc -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft \ - -I${DEVKITPRO}/libctru/include \ - -I${DEVKITPRO}/libctru/include/3ds \ - -O -c -o extern.o /tmp/bindgen/extern.c -arm-none-eabi-ar -rcs libextern.a extern.o -rm extern.o - - -echo "Generated bindings for ctru-sys version \"${CTRU_SYS_VERSION}.x+${LIBCTRU_VERSION}\"" diff --git a/ctru-sys/build.rs b/ctru-sys/build.rs index 0a1edca..1643b8b 100644 --- a/ctru-sys/build.rs +++ b/ctru-sys/build.rs @@ -1,16 +1,29 @@ +use bindgen::callbacks::ParseCallbacks; +use bindgen::{Builder, RustTarget}; + use std::env; use std::error::Error; +use std::path::{Path, PathBuf}; use std::process::{Command, Output, Stdio}; +#[derive(Debug)] +struct CustomCallbacks; + +impl ParseCallbacks for CustomCallbacks { + fn process_comment(&self, comment: &str) -> Option { + Some(doxygen_rs::transform(comment)) + } +} + fn main() { - let dkp_path = env::var("DEVKITPRO").unwrap(); + let devkitpro = env::var("DEVKITPRO").unwrap(); + let devkitarm = env::var("DEVKITARM").unwrap(); let profile = env::var("PROFILE").unwrap(); - let pwd = env::var("CARGO_MANIFEST_DIR").unwrap(); + let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap()); - // Link to libctru println!("cargo:rerun-if-changed=build.rs"); println!("cargo:rerun-if-env-changed=DEVKITPRO"); - println!("cargo:rustc-link-search=native={dkp_path}/libctru/lib"); + println!("cargo:rustc-link-search=native={devkitpro}/libctru/lib"); println!( "cargo:rustc-link-lib=static={}", match profile.as_str() { @@ -19,10 +32,6 @@ fn main() { } ); - // Link to static inline fns wrapper - println!("cargo:rustc-link-search=native={}", pwd); - println!("cargo:rustc-link-lib=static=extern"); - match check_libctru_version() { Ok((maj, min, patch)) => { eprintln!("using libctru version {maj}.{min}.{patch}"); @@ -36,9 +45,97 @@ fn main() { } Err(err) => println!("cargo:warning=failed to check libctru version: {err}"), } + + let gcc_version = get_gcc_version(PathBuf::from(&devkitarm).join("bin/arm-none-eabi-gcc")); + + let include_path = PathBuf::from_iter([devkitpro.as_str(), "libctru", "include"]); + let ctru_header = include_path.join("3ds.h"); + + let sysroot = Path::new(&devkitarm).join("arm-none-eabi"); + let system_include = sysroot.join("include"); + let gcc_include = PathBuf::from(format!( + "{devkitarm}/lib/gcc/arm-none-eabi/{gcc_version}/include" + )); + let errno_header = system_include.join("errno.h"); + + // Build libctru bindings + let bindings = Builder::default() + .header(ctru_header.to_str().unwrap()) + .header(errno_header.to_str().unwrap()) + .rust_target(RustTarget::Nightly) + .use_core() + .trust_clang_mangling(false) + .must_use_type("Result") + .layout_tests(false) + .ctypes_prefix("::libc") + .prepend_enum_name(false) + .blocklist_type("u(8|16|32|64)") + .blocklist_type("__builtin_va_list") + .blocklist_type("__va_list") + .opaque_type("MiiData") + .derive_default(true) + .wrap_static_fns(true) + .wrap_static_fns_path(out_dir.join("libctru_statics_wrapper")) + .clang_args([ + "--target=arm-none-eabi", + "--sysroot", + sysroot.to_str().unwrap(), + "-isystem", + system_include.to_str().unwrap(), + "-isystem", + gcc_include.to_str().unwrap(), + "-I", + include_path.to_str().unwrap(), + "-mfloat-abi=hard", + "-march=armv6k", + "-mtune=mpcore", + "-mfpu=vfp", + "-DARM11", + "-D__3DS__", + ]) + .parse_callbacks(Box::new(CustomCallbacks)) + .generate() + .expect("unable to generate bindings"); + + bindings + .write_to_file(out_dir.join("bindings.rs")) + .expect("Couldn't write bindings!"); + + // Compile static inline fns wrapper + let cc = Path::new(devkitarm.as_str()).join("bin/arm-none-eabi-gcc"); + let ar = Path::new(devkitarm.as_str()).join("bin/arm-none-eabi-ar"); + + cc::Build::new() + .compiler(cc) + .archiver(ar) + .include(&include_path) + .file(out_dir.join("libctru_statics_wrapper.c")) + .flag("-march=armv6k") + .flag("-mtune=mpcore") + .flag("-mfloat-abi=hard") + .flag("-mfpu=vfp") + .flag("-mtp=soft") + .flag("-Wno-deprecated-declarations") + .compile("ctru_statics_wrapper"); +} + +fn get_gcc_version(path_to_gcc: PathBuf) -> String { + let Output { stdout, .. } = Command::new(path_to_gcc) + .arg("--version") + .stderr(Stdio::inherit()) + .output() + .unwrap(); + + let stdout_str = String::from_utf8_lossy(&stdout); + + stdout_str + .split(|c: char| c.is_whitespace()) + .nth(4) + .unwrap() + .to_string() } -fn parse_version(version: &str) -> Result<(String, String, String), &str> { +fn parse_libctru_version(version: &str) -> Result<(String, String, String), &str> { let versions: Vec<_> = version .split(|c| c == '.' || c == '-') .map(String::from) @@ -90,6 +187,6 @@ fn check_libctru_version() -> Result<(String, String, String), Box> { println!("cargo:rerun-if-changed={file}"); } - let (lib_major, lib_minor, lib_patch) = parse_version(lib_version)?; + let (lib_major, lib_minor, lib_patch) = parse_libctru_version(lib_version)?; Ok((lib_major, lib_minor, lib_patch)) } diff --git a/ctru-sys/libextern.a b/ctru-sys/libextern.a deleted file mode 100644 index f42c7976be68a412aea8958468b6e2c4f0c14877..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14632 zcmeHO4QyQ1mA-Fg9477%PZMVeV8{yzty_XKPD~UaBIDQzNr}mjF@fzO#^af1dz$&% z`3X)oE5>%VrB#wTacEfzn-@Y$cNMi!MO(CD*-7{*>H^KStcq4$@!pt$&=O-LDk4Pd z{my;w&RmaemR8$USISl1-1nXD+;h+UJMX^dn`P_6naIE`^{dqBsdep*zBXUmjcaaD zRUfD1UsYXwqt6nkJ@t&SKE^)v(8cS|uMf5cIznCHUD_5c9Mv+RkT#gpGD$|_PAwY= z1qZ?zExIL~jK;O>Ou8$zTbq;Y$Y%nXR7A^Ww?=0ct+JMZnHs@dI2Vg-%=h)p=2_tG zt#eT|@_sGXJ&-{Ix1}QCcrcgBg!{EhbrrTFl}MnSa}}1osrE!P5$@D>$0AxsD%lt7 z-xVKAx*o0F}APRQ6Uaw>g$c?9?*ZSSnd5#fjT67Fv8(D!3<`(-Ix2j5aIX zo=(SO5%gaw*`+1A_oS;0=9VGcq4k3e#`exd-I>*@<2Jq2=8Ptn>W)Qrb)@o1%pG)7 zrrP#YR-*1qN5eU}7@B@ptS=VKWwc~}ZeV)b*K`KsG0aKoce&8kEX~!dmP4l|wMb6# zF%*i&dLyBDDzYmS!$?#N%0wid%2w^k3@?(=B6*C&?%7qW!gK0GQpsp-&CzVHCdJyfE)MZv}{1j1Y(0))t;8zjd4mPwBC$%U!?@3DAAtA zzqAw*EHOqkJ#8{t;%%{{7S7B;T8p4P)4weyxoj1*xE=ZA=6JYYTCiFql}Kk0lqzmT ztD$v6Y_F^bK`l;JM?0CFML%EV^Rw}ZDxav~ZMRlaA7s;# zV?wZ6I4&Npa*5s2BBTPqGxX8ATq;-fAXnpo#qX~4NN)G^7WNNzB%*iZwY(NY)C|Yt zyg??j~ZfpccmyB9%dX z^kj~O<6DzaDWYaliM}i`75BJg)1V~jOC@tKZiSQ002N)E*_!N2)yi&-?@15LNdyNp zY)K?P;<4neHPLJ^7mZa-$->R4OsCeH@2}Kj?bBLPVqY%r$6I~0_pbb|ZEFK+UF$=J z)Kh=|rfr)QMZvb*N(yUcRm52CIxeqk<5@HFuut(jWsz=fxJoH)P#q`y@`Se9DpYBu^>gHd2-+hz0 zhD;|baGT6AWV&tLbi-8>WS8;+E0o0jyi2Wn=F`na^;p@-esGSlk+RD>Qa+{r+KUi{2KKh2&fBoBTt`jJ&Binx1_Kwvl{{5D1bbz4Gf6JX+`gk_k9xH1^aTuudfH&V{biTB zzwBoF%O3CkGU-#h``9n6e(+lTpw^F_=j{UafG>haf0PuaFA{PwE`+(PW}Ir}PV|S+ zdw9bod|r@^f41+JPTv1p;*T|qa=pVF3TBqQ`=%wEG}CN~-yhy!Nb<9gTRMj~6f1J- z0|jG1{a@)5uTjD24OdP0G2c2d-?peD_8bU|*D+S_!1^GY4vas19&s>zjC^p}YlHfO z=F+tOz%-?PBsp*6{|3feCaK z^So!GSpQqjErjkOuKT{NJNZfju(9{PiNfCgi3NL)o&O5*xAuNCFn zJ&1OUi1`HNlHx2>`basWoBN9IzS+S0?ttlRL|?iJ<~2=LoOgRi%bwyW#^{LQ^qn-^ zsuepGw!`%Jeqq4wGUgk_ctXcFhPd@uiN{&!@%fH9lK0lW&A!o(Ii0@=)%uv+F5Q`AgQ5VHU8cR3oA%ESd$AkKuzIzd~UNU&h zhn|z&YdVU*s;Mgozt2?so>^BAb)A`3mycqwin`GDBkjY+SnDCf0iT%hJ=lV5*#W~9 z7%d-uewncVeaF1VA%~w{Jb(OFANmkCCp!>(*&XATGxnd{ci3Zot3TDA_L3S1mliI= z^X)UkX4|#Hrav7n%^TItx`J-r@)O-$^uhsi&GQG$#?#0@J8ZI|)gOym5hvGsy#y`)!0^Ay;3(9qs|*zs7}ZV{iVjY zP~V$}%r)l@nTt@@4euN>`FwzFRlTRQW<(SJ)beAf_Gyb(fnP)un$E$M^|2BjQI)%Q-`^}N43h#|8V#= z8h=sF!$!;c^?GF5b4W1bQyIeaG!y+JoeSb?wY6HA8-vA${U^L?eEo6n*=j}M54k6opk!&nCn ztOMpfT^hnO=){#nd>!zZirA@$_IFVGyA1{H=NxZ8_VTo6m12wVaV31Dc|69P#wYbt z%wZ3F^Qu-KG{OeGTX-qQeve`etL*t`Wn0PGzlpsd$pYh;dy6sOaTOL*?8TVacnEmM zIBeQ@crlMzwk^tNuF(5{i}q~TCn4v1Ht{Y%K2jMs@+I(9VGC(pIG6_B}Ma@ zX6t^Pa<-gi-{`(pZok zYCGOB>l^KNHrWR612(q!gQ=-2M0uKbwD%?bS{o~{PN<#hB|m)BZ#6b(zT5k1^79Jv zOV}kF!YGTnD}_5n=Sik2@}6h!c@K>Vd4)+nD|i%6aR>W ziPt4e{7DHDe@eo{KP_S6ixTGc>mcOG^8ciSiGNALRQ{}li7#TWVI`~la}p+g%lzql zw}gpbNk)0H$4A1%Uyv}r#YWLe*8FXfF!8E{seC}f#CJ=WctgU(pOY~0E)RZqvix&P znD}iHrt$#^6aT)1iT_B##IK+qo-F%53DfO*2~&B$gy}XXVd4uC2CO6}tK;jvBCzqK zq)+AFmoVMB7Kjpd`z1{LItf$x^%5q2pM<%85+?pt2^0UCgo)pV7h@|~^#>#@7|NY& zUQPSvF>I^w9ThPOmjYf+PKK`)QgSjk!#f~POYpl8C49)~o@@}_j(i0!vP(FQoW9r6 zlqdW(x&pWuM_$;sovCdC2+umn^DgKK3HdbPx zRVE006nwzePXbds7WI9#M*m^p3zGdG0XO3k^`FH(#cP3ogL{h4OKkgY#4?JHks4+vlHCF9fla~h0&W5p?fpAoA8<2tX+9hW zz8hHd-;aSsA{);G)ALK%`&A8p4!9ukQ#HI7&jxyaiSpN1o)wmC6RzOwTV- z{_8dTao{5OmGG6?^JEQQ1b#>2U#sEY23`W6MR`RE3A|3=PVjBE{m<9%HvzZ#gv;1Qc&1x(NL z6*k@pOwVu8zxM$fz^cuE6PUuJ-^M3_{lIY>7lBVo_*LK~xVG5*Io$W)I%nhG6Nklu ze|)_D0yhC%6pv~AK7;$XgxBK!0bCSAiQkNSk;vzrz_h;@#Xa$TxTpO@z{b0Q9|t~a z<1YiR!$W1AjlTh$1{USN15AHrQ*HiVfocCB#{V^7+ArK~^OL|QfrWo=)J6LRQGN+9 z?GLut`px7U@I5wO2YeD(_)B{u+7IBL)gCI3hhDRd?*|sii<__3;BVI8CxB`HK)TdF zF96ei!EfW&foXrB+W2=h<=yBT9Xy)J%U=upU0^Yv{lG z5s#h#7KwcP5ispH1pi_U{~y3^><7enyj#Q5*oj2;E~T-7ekbm!{mXz0z+(Jv0;c`N zpv~U}O#2B@e;imOvNr@Am3U_V0XV`|gxQKH!?}UHmc@(R#RGjfA7UN%yLh0FO+U3a z?Lc34ccgNxfleya=zh`@ezF-l>jyIzkNo|AI`VfHPJZ2)X8$)Q0C8eb%g}MzP&$`k zbDReZg>e22S2`B8Rc0Lj3xy)NOg=P#GlQWlPO#c~a~u}5wQ-;ZM+s*Xn*9(VJmn{B zL*Yz+9H$HI8Z6}*rwS|DnS8R3&Kol6P@yqruWtC`0h+XLMp5Z39+u5glvvWsUStz-QBWZ=h~g~UpuPr#vgG`2gDin5DmBR}EU z$o_O5XDV^~a-Zhb7sc<_x866(=m2I2QTme4Mh2{$~J=V)n6_rz^SS&SZjA z*vB8W+?34bGg=p(3tE)*hqC;CrqF>*QEtxjmU9w+&_PT*A?g1c&~a=$4nFpDruDZB z#}0hsQSgrWCA^#1Ieph^N?=2eZz+_!@Qt8p2>X6Jk0W<{+4@%Rc)5n7-u_K565k zozpj5k~iXAiOMzG`FcC2Z@9$YL-?0?2e)(9lHHTYg?o|bGFCny?(pZcmK@%`zOBjd!W4(F&2MKiaCreAAhABdyK6qM( z-$D2&61@*o!kIHhugrd2l%k)*_bL=58I^b8BHe3kjA_EtDajTINSD%exJdth((^%w z%B;pkiR=kq2~)kq<7^qvG0k~;3VO} { - storage: Storage, -} -impl __BindgenBitfieldUnit { - #[inline] - pub const fn new(storage: Storage) -> Self { - Self { storage } - } -} -impl __BindgenBitfieldUnit -where - Storage: AsRef<[u8]> + AsMut<[u8]>, -{ - #[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 const fn new() -> Self { - __IncompleteArrayField(::core::marker::PhantomData, []) - } - #[inline] - pub fn as_ptr(&self) -> *const T { - self as *const _ as *const T - } - #[inline] - pub fn as_mut_ptr(&mut self) -> *mut T { - self as *mut _ as *mut T - } - #[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") - } -} -#[repr(C)] -pub struct __BindgenUnionField(::core::marker::PhantomData); -impl __BindgenUnionField { - #[inline] - pub const 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: &[u8; 6usize] = b"4.3.0\0"; -pub const __NEWLIB__: u32 = 4; -pub const __NEWLIB_MINOR__: u32 = 3; -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 _POSIX_THREADS: u32 = 1; -pub const _POSIX_SEMAPHORES: u32 = 1; -pub const _POSIX_BARRIERS: u32 = 200112; -pub const _POSIX_READER_WRITER_LOCKS: u32 = 200112; -pub const _UNIX98_THREAD_MUTEX_ATTRIBUTES: 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 __int20__: u32 = 2; -pub const __INT8: &[u8; 3usize] = b"hh\0"; -pub const __INT16: &[u8; 2usize] = b"h\0"; -pub const __INT64: &[u8; 3usize] = b"ll\0"; -pub const __FAST8: &[u8; 3usize] = b"hh\0"; -pub const __FAST16: &[u8; 2usize] = b"h\0"; -pub const __FAST64: &[u8; 3usize] = b"ll\0"; -pub const __LEAST8: &[u8; 3usize] = b"hh\0"; -pub const __LEAST16: &[u8; 2usize] = b"h\0"; -pub const __LEAST64: &[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_SYS: u32 = 33513982; -pub const SYSCLOCK_SDMMC: u32 = 67027964; -pub const SYSCLOCK_ARM9: u32 = 134055928; -pub const SYSCLOCK_ARM11: u32 = 268111856; -pub const SYSCLOCK_ARM11_LGR1: u32 = 536223712; -pub const SYSCLOCK_ARM11_LGR2: u32 = 804335568; -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 OS_HEAP_AREA_BEGIN: u32 = 134217728; -pub const OS_HEAP_AREA_END: u32 = 234881024; -pub const OS_MAP_AREA_BEGIN: u32 = 268435456; -pub const OS_MAP_AREA_END: u32 = 335544320; -pub const OS_OLD_FCRAM_VADDR: u32 = 335544320; -pub const OS_OLD_FCRAM_PADDR: u32 = 536870912; -pub const OS_OLD_FCRAM_SIZE: u32 = 134217728; -pub const OS_QTMRAM_VADDR: u32 = 511705088; -pub const OS_QTMRAM_PADDR: u32 = 520093696; -pub const OS_QTMRAM_SIZE: u32 = 4194304; -pub const OS_MMIO_VADDR: u32 = 515899392; -pub const OS_MMIO_PADDR: u32 = 269484032; -pub const OS_MMIO_SIZE: u32 = 4194304; -pub const OS_VRAM_VADDR: u32 = 520093696; -pub const OS_VRAM_PADDR: u32 = 402653184; -pub const OS_VRAM_SIZE: u32 = 6291456; -pub const OS_DSPRAM_VADDR: u32 = 535822336; -pub const OS_DSPRAM_PADDR: u32 = 535822336; -pub const OS_DSPRAM_SIZE: u32 = 524288; -pub const OS_KERNELCFG_VADDR: u32 = 536346624; -pub const OS_SHAREDCFG_VADDR: u32 = 536350720; -pub const OS_FCRAM_VADDR: u32 = 805306368; -pub const OS_FCRAM_PADDR: u32 = 536870912; -pub const OS_FCRAM_SIZE: u32 = 268435456; -pub const __NEWLIB_H__: u32 = 1; -pub const _ATEXIT_DYNAMIC_ALLOC: u32 = 1; -pub const _FSEEK_OPTIMIZATION: u32 = 1; -pub const _FVWRITE_IN_STREAMIO: u32 = 1; -pub const _HAVE_CC_INHIBIT_LOOP_TO_LIBCALL: u32 = 1; -pub const _HAVE_INITFINI_ARRAY: u32 = 1; -pub const _HAVE_LONG_DOUBLE: u32 = 1; -pub const _LDBL_EQ_DBL: u32 = 1; -pub const _MB_CAPABLE: u32 = 1; -pub const _MB_LEN_MAX: u32 = 8; -pub const _REENT_CHECK_VERIFY: u32 = 1; -pub const _UNBUF_STREAM_OPT: 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 _WANT_USE_GDTOA: u32 = 1; -pub const __OBSOLETE_MATH_DEFAULT: u32 = 0; -pub const __OBSOLETE_MATH: u32 = 0; -pub const __RAND_MAX: u32 = 2147483647; -pub const GSP_SCREEN_TOP: u32 = 0; -pub const GSP_SCREEN_BOTTOM: u32 = 1; -pub const GSP_SCREEN_WIDTH: u32 = 240; -pub const GSP_SCREEN_HEIGHT_TOP: u32 = 400; -pub const GSP_SCREEN_HEIGHT_TOP_2X: u32 = 800; -pub const GSP_SCREEN_HEIGHT_BOTTOM: u32 = 320; -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 CONSOLE_FG_CUSTOM: u32 = 512; -pub const CONSOLE_BG_CUSTOM: u32 = 1024; -pub const __GNUCLIKE_ASM: u32 = 3; -pub const __GNUCLIKE___TYPEOF: 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 PTHREAD_MUTEX_NORMAL: u32 = 0; -pub const PTHREAD_MUTEX_RECURSIVE: u32 = 1; -pub const PTHREAD_MUTEX_ERRORCHECK: u32 = 2; -pub const PTHREAD_MUTEX_DEFAULT: u32 = 3; -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 _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 SO_BROADCAST: u32 = 0; -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_GUESTMII_NAME_LEN: u32 = 12; -pub const ARCHIVE_DIRITER_MAGIC: u32 = 1751347809; -pub const LINK3DS_COMM_PORT: u32 = 17491; -pub const __error_t_defined: u32 = 1; -pub const EPERM: u32 = 1; -pub const ENOENT: u32 = 2; -pub const ESRCH: u32 = 3; -pub const EINTR: u32 = 4; -pub const EIO: u32 = 5; -pub const ENXIO: u32 = 6; -pub const E2BIG: u32 = 7; -pub const ENOEXEC: u32 = 8; -pub const EBADF: u32 = 9; -pub const ECHILD: u32 = 10; -pub const EAGAIN: u32 = 11; -pub const ENOMEM: u32 = 12; -pub const EACCES: u32 = 13; -pub const EFAULT: u32 = 14; -pub const EBUSY: u32 = 16; -pub const EEXIST: u32 = 17; -pub const EXDEV: u32 = 18; -pub const ENODEV: u32 = 19; -pub const ENOTDIR: u32 = 20; -pub const EISDIR: u32 = 21; -pub const EINVAL: u32 = 22; -pub const ENFILE: u32 = 23; -pub const EMFILE: u32 = 24; -pub const ENOTTY: u32 = 25; -pub const ETXTBSY: u32 = 26; -pub const EFBIG: u32 = 27; -pub const ENOSPC: u32 = 28; -pub const ESPIPE: u32 = 29; -pub const EROFS: u32 = 30; -pub const EMLINK: u32 = 31; -pub const EPIPE: u32 = 32; -pub const EDOM: u32 = 33; -pub const ERANGE: u32 = 34; -pub const ENOMSG: u32 = 35; -pub const EIDRM: u32 = 36; -pub const EDEADLK: u32 = 45; -pub const ENOLCK: u32 = 46; -pub const ENOSTR: u32 = 60; -pub const ENODATA: u32 = 61; -pub const ETIME: u32 = 62; -pub const ENOSR: u32 = 63; -pub const ENOLINK: u32 = 67; -pub const EPROTO: u32 = 71; -pub const EMULTIHOP: u32 = 74; -pub const EBADMSG: u32 = 77; -pub const EFTYPE: u32 = 79; -pub const ENOSYS: u32 = 88; -pub const ENOTEMPTY: u32 = 90; -pub const ENAMETOOLONG: u32 = 91; -pub const ELOOP: u32 = 92; -pub const EOPNOTSUPP: u32 = 95; -pub const EPFNOSUPPORT: u32 = 96; -pub const ECONNRESET: u32 = 104; -pub const ENOBUFS: u32 = 105; -pub const EAFNOSUPPORT: u32 = 106; -pub const EPROTOTYPE: u32 = 107; -pub const ENOTSOCK: u32 = 108; -pub const ENOPROTOOPT: u32 = 109; -pub const ECONNREFUSED: u32 = 111; -pub const EADDRINUSE: u32 = 112; -pub const ECONNABORTED: u32 = 113; -pub const ENETUNREACH: u32 = 114; -pub const ENETDOWN: u32 = 115; -pub const ETIMEDOUT: u32 = 116; -pub const EHOSTDOWN: u32 = 117; -pub const EHOSTUNREACH: u32 = 118; -pub const EINPROGRESS: u32 = 119; -pub const EALREADY: u32 = 120; -pub const EDESTADDRREQ: u32 = 121; -pub const EMSGSIZE: u32 = 122; -pub const EPROTONOSUPPORT: u32 = 123; -pub const EADDRNOTAVAIL: u32 = 125; -pub const ENETRESET: u32 = 126; -pub const EISCONN: u32 = 127; -pub const ENOTCONN: u32 = 128; -pub const ETOOMANYREFS: u32 = 129; -pub const EDQUOT: u32 = 132; -pub const ESTALE: u32 = 133; -pub const ENOTSUP: u32 = 134; -pub const EILSEQ: u32 = 138; -pub const EOVERFLOW: u32 = 139; -pub const ECANCELED: u32 = 140; -pub const ENOTRECOVERABLE: u32 = 141; -pub const EOWNERDEAD: u32 = 142; -pub const EWOULDBLOCK: u32 = 11; -pub const __ELASTERROR: u32 = 2000; -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, Default, Copy, Clone)] -pub struct max_align_t { - pub __clang_max_align_nonce1: ::libc::c_longlong, - pub __clang_max_align_nonce2: f64, -} -pub type u8_ = u8; -pub type u16_ = u16; -pub type u32_ = u32; -pub type u64_ = u64; -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; -#[doc = "Structure representing CPU registers"] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct CpuRegisters { - #[doc = "< r0-r12."] - pub r: [u32_; 13usize], - #[doc = "< sp."] - pub sp: u32_, - #[doc = "< lr."] - pub lr: u32_, - #[doc = "< pc. May need to be adjusted."] - pub pc: u32_, - #[doc = "< cpsr."] - pub cpsr: u32_, -} -#[doc = "Structure representing FPU registers"] -#[repr(C)] -#[derive(Copy, Clone)] -pub struct FpuRegisters { - pub __bindgen_anon_1: FpuRegisters__bindgen_ty_1, - #[doc = "< fpscr."] - pub fpscr: u32_, - #[doc = "< fpexc."] - 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, - #[doc = "< s0-s31."] - pub s: [f32; 32usize], -} -#[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone)] -pub struct FpuRegisters__bindgen_ty_1__bindgen_ty_1 { - #[doc = "< d0-d15."] - pub d: [f64; 16usize], -} -impl Default for FpuRegisters__bindgen_ty_1 { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl Default for FpuRegisters { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -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; -#[doc = "Result code level values."] -pub type _bindgen_ty_1 = ::libc::c_uint; -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; -#[doc = "Result code summary values."] -pub type _bindgen_ty_2 = ::libc::c_uint; -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; -#[doc = "Result code module values."] -pub type _bindgen_ty_3 = ::libc::c_uint; -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; -#[doc = "Result code generic description values."] -pub type _bindgen_ty_4 = ::libc::c_uint; -#[doc = "< Readable"] -pub const IPC_BUFFER_R: IPC_BufferRights = 2; -#[doc = "< Writable"] -pub const IPC_BUFFER_W: IPC_BufferRights = 4; -#[doc = "< Readable and Writable"] -pub const IPC_BUFFER_RW: IPC_BufferRights = 6; -#[doc = "IPC buffer access rights."] -pub type IPC_BufferRights = ::libc::c_uint; -extern "C" { - #[doc = "Creates a command header to be used for IPC\n # Arguments\n\n* `command_id` - ID of the command to create a header for.\n * `normal_params` - Size of the normal parameters in words. Up to 63.\n * `translate_params` - Size of the translate parameters in words. Up to 63.\n # Returns\n\nThe created IPC header.\n\n Normal parameters are sent directly to the process while the translate parameters might go through modifications and checks by the kernel.\n The translate parameters are described by headers generated with the IPC_Desc_* functions.\n\n > **Note:** While #normal_params is equivalent to the number of normal parameters, #translate_params includes the size occupied by the translate parameters headers."] - #[link_name = "IPC_MakeHeader__extern"] - pub fn IPC_MakeHeader( - command_id: u16_, - normal_params: ::libc::c_uint, - translate_params: ::libc::c_uint, - ) -> u32_; -} -extern "C" { - #[doc = "Creates a header to share handles\n # Arguments\n\n* `number` - The number of handles following this header. Max 64.\n # Returns\n\nThe created shared handles header.\n\n The #number next values are handles that will be shared between the two processes.\n\n > **Note:** Zero values will have no effect."] - #[link_name = "IPC_Desc_SharedHandles__extern"] - pub fn IPC_Desc_SharedHandles(number: ::libc::c_uint) -> u32_; -} -extern "C" { - #[doc = "Creates the header to transfer handle ownership\n # Arguments\n\n* `number` - The number of handles following this header. Max 64.\n # Returns\n\nThe created handle transfer header.\n\n The #number next values are handles that will be duplicated and closed by the other process.\n\n > **Note:** Zero values will have no effect."] - #[link_name = "IPC_Desc_MoveHandles__extern"] - pub fn IPC_Desc_MoveHandles(number: ::libc::c_uint) -> u32_; -} -extern "C" { - #[doc = "Returns the code to ask the kernel to fill the handle with the current process ID.\n # Returns\n\nThe code to request the current process ID.\n\n The next value is a placeholder that will be replaced by the current process ID by the kernel."] - #[link_name = "IPC_Desc_CurProcessId__extern"] - pub fn IPC_Desc_CurProcessId() -> u32_; -} -extern "C" { - #[link_name = "IPC_Desc_CurProcessHandle__extern"] - pub fn IPC_Desc_CurProcessHandle() -> u32_; -} -extern "C" { - #[doc = "Creates a header describing a static buffer.\n # Arguments\n\n* `size` - Size of the buffer. Max ?0x03FFFF?.\n * `buffer_id` - The Id of the buffer. Max 0xF.\n # Returns\n\nThe created static buffer header.\n\n The next value is a pointer to the buffer. It will be copied to TLS offset 0x180 + static_buffer_id*8."] - #[link_name = "IPC_Desc_StaticBuffer__extern"] - pub fn IPC_Desc_StaticBuffer(size: usize, buffer_id: ::libc::c_uint) -> u32_; -} -extern "C" { - #[doc = "Creates a header describing a buffer to be sent over PXI.\n # Arguments\n\n* `size` - Size of the buffer. Max 0x00FFFFFF.\n * `buffer_id` - The Id of the buffer. Max 0xF.\n * `is_read_only` - true if the buffer is read-only. If false, the buffer is considered to have read-write access.\n # Returns\n\nThe created PXI buffer header.\n\n The next value is a phys-address of a table located in the BASE memregion."] - #[link_name = "IPC_Desc_PXIBuffer__extern"] - pub fn IPC_Desc_PXIBuffer(size: usize, buffer_id: ::libc::c_uint, is_read_only: bool) -> u32_; -} -extern "C" { - #[doc = "Creates a header describing a buffer from the main memory.\n # Arguments\n\n* `size` - Size of the buffer. Max 0x0FFFFFFF.\n * `rights` - The rights of the buffer for the destination process.\n # Returns\n\nThe created buffer header.\n\n The next value is a pointer to the buffer."] - #[link_name = "IPC_Desc_Buffer__extern"] - pub fn IPC_Desc_Buffer(size: usize, rights: IPC_BufferRights) -> u32_; -} -#[doc = "< Memory un-mapping"] -pub const MEMOP_FREE: MemOp = 1; -#[doc = "< Reserve memory"] -pub const MEMOP_RESERVE: MemOp = 2; -#[doc = "< Memory mapping"] -pub const MEMOP_ALLOC: MemOp = 3; -#[doc = "< Mirror mapping"] -pub const MEMOP_MAP: MemOp = 4; -#[doc = "< Mirror unmapping"] -pub const MEMOP_UNMAP: MemOp = 5; -#[doc = "< Change protection"] -pub const MEMOP_PROT: MemOp = 6; -#[doc = "< APPLICATION memory region."] -pub const MEMOP_REGION_APP: MemOp = 256; -#[doc = "< SYSTEM memory region."] -pub const MEMOP_REGION_SYSTEM: MemOp = 512; -#[doc = "< BASE memory region."] -pub const MEMOP_REGION_BASE: MemOp = 768; -#[doc = "< Operation bitmask."] -pub const MEMOP_OP_MASK: MemOp = 255; -#[doc = "< Region bitmask."] -pub const MEMOP_REGION_MASK: MemOp = 3840; -#[doc = "< Flag for linear memory operations"] -pub const MEMOP_LINEAR_FLAG: MemOp = 65536; -#[doc = "< Allocates linear memory."] -pub const MEMOP_ALLOC_LINEAR: MemOp = 65539; -#[doc = "svcControlMemory operation flags\n\n The lowest 8 bits are the operation"] -pub type MemOp = ::libc::c_uint; -#[doc = "< Free memory"] -pub const MEMSTATE_FREE: MemState = 0; -#[doc = "< Reserved memory"] -pub const MEMSTATE_RESERVED: MemState = 1; -#[doc = "< I/O memory"] -pub const MEMSTATE_IO: MemState = 2; -#[doc = "< Static memory"] -pub const MEMSTATE_STATIC: MemState = 3; -#[doc = "< Code memory"] -pub const MEMSTATE_CODE: MemState = 4; -#[doc = "< Private memory"] -pub const MEMSTATE_PRIVATE: MemState = 5; -#[doc = "< Shared memory"] -pub const MEMSTATE_SHARED: MemState = 6; -#[doc = "< Continuous memory"] -pub const MEMSTATE_CONTINUOUS: MemState = 7; -#[doc = "< Aliased memory"] -pub const MEMSTATE_ALIASED: MemState = 8; -#[doc = "< Alias memory"] -pub const MEMSTATE_ALIAS: MemState = 9; -#[doc = "< Aliased code memory"] -pub const MEMSTATE_ALIASCODE: MemState = 10; -#[doc = "< Locked memory"] -pub const MEMSTATE_LOCKED: MemState = 11; -#[doc = "The state of a memory block."] -pub type MemState = ::libc::c_uint; -#[doc = "< Readable"] -pub const MEMPERM_READ: MemPerm = 1; -#[doc = "< Writable"] -pub const MEMPERM_WRITE: MemPerm = 2; -#[doc = "< Executable"] -pub const MEMPERM_EXECUTE: MemPerm = 4; -#[doc = "< Readable and writable"] -pub const MEMPERM_READWRITE: MemPerm = 3; -#[doc = "< Readable and executable"] -pub const MEMPERM_READEXECUTE: MemPerm = 5; -#[doc = "< Don't care"] -pub const MEMPERM_DONTCARE: MemPerm = 268435456; -#[doc = "Memory permission flags"] -pub type MemPerm = ::libc::c_uint; -#[doc = "< All regions."] -pub const MEMREGION_ALL: MemRegion = 0; -#[doc = "< APPLICATION memory."] -pub const MEMREGION_APPLICATION: MemRegion = 1; -#[doc = "< SYSTEM memory."] -pub const MEMREGION_SYSTEM: MemRegion = 2; -#[doc = "< BASE memory."] -pub const MEMREGION_BASE: MemRegion = 3; -#[doc = "Memory regions."] -pub type MemRegion = ::libc::c_uint; -#[doc = "Memory information."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct MemInfo { - #[doc = "< Base address."] - pub base_addr: u32_, - #[doc = "< Size."] - pub size: u32_, - #[doc = "< Memory permissions. See MemPerm"] - pub perm: u32_, - #[doc = "< Memory state. See MemState"] - pub state: u32_, -} -#[doc = "Memory page information."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct PageInfo { - #[doc = "< Page flags."] - pub flags: u32_, -} -#[doc = "< Signal #value threads for wake-up."] -pub const ARBITRATION_SIGNAL: ArbitrationType = 0; -#[doc = "< If the memory at the address is strictly lower than #value, then wait for signal."] -pub const ARBITRATION_WAIT_IF_LESS_THAN: ArbitrationType = 1; -#[doc = "< If the memory at the address is strictly lower than #value, then decrement it and wait for signal."] -pub const ARBITRATION_DECREMENT_AND_WAIT_IF_LESS_THAN: ArbitrationType = 2; -#[doc = "< If the memory at the address is strictly lower than #value, then wait for signal or timeout."] -pub const ARBITRATION_WAIT_IF_LESS_THAN_TIMEOUT: ArbitrationType = 3; -#[doc = "< If the memory at the address is strictly lower than #value, then decrement it and wait for signal or timeout."] -pub const ARBITRATION_DECREMENT_AND_WAIT_IF_LESS_THAN_TIMEOUT: ArbitrationType = 4; -#[doc = "Arbitration modes."] -pub type ArbitrationType = ::libc::c_uint; -#[doc = "< When the primitive is signaled, it will wake up exactly one thread and will clear itself automatically."] -pub const RESET_ONESHOT: ResetType = 0; -#[doc = "< When the primitive is signaled, it will wake up all threads and it won't clear itself automatically."] -pub const RESET_STICKY: ResetType = 1; -#[doc = "< Only meaningful for timers: same as ONESHOT but it will periodically signal the timer instead of just once."] -pub const RESET_PULSE: ResetType = 2; -#[doc = "Reset types (for use with events and timers)"] -pub type ResetType = ::libc::c_uint; -#[doc = "< Unknown."] -pub const THREADINFO_TYPE_UNKNOWN: ThreadInfoType = 0; -#[doc = "Types of thread info."] -pub type ThreadInfoType = ::libc::c_uint; -#[doc = "< Thread priority"] -pub const RESLIMIT_PRIORITY: ResourceLimitType = 0; -#[doc = "< Quantity of allocatable memory"] -pub const RESLIMIT_COMMIT: ResourceLimitType = 1; -#[doc = "< Number of threads"] -pub const RESLIMIT_THREAD: ResourceLimitType = 2; -#[doc = "< Number of events"] -pub const RESLIMIT_EVENT: ResourceLimitType = 3; -#[doc = "< Number of mutexes"] -pub const RESLIMIT_MUTEX: ResourceLimitType = 4; -#[doc = "< Number of semaphores"] -pub const RESLIMIT_SEMAPHORE: ResourceLimitType = 5; -#[doc = "< Number of timers"] -pub const RESLIMIT_TIMER: ResourceLimitType = 6; -#[doc = "< Number of shared memory objects, see svcCreateMemoryBlock"] -pub const RESLIMIT_SHAREDMEMORY: ResourceLimitType = 7; -#[doc = "< Number of address arbiters"] -pub const RESLIMIT_ADDRESSARBITER: ResourceLimitType = 8; -#[doc = "< CPU time. Value expressed in percentage regular until it reaches 90."] -pub const RESLIMIT_CPUTIME: ResourceLimitType = 9; -#[doc = "< Forces enum size to be 32 bits"] -pub const RESLIMIT_BIT: ResourceLimitType = 2147483648; -#[doc = "Types of resource limit"] -pub type ResourceLimitType = ::libc::c_uint; -#[doc = "< DMA transfer involving at least one device is starting and has not reached DMAWFP yet."] -pub const DMASTATE_STARTING: DmaState = 0; -#[doc = "< DMA channel is in WFP state for the destination device (2nd loop iteration onwards)."] -pub const DMASTATE_WFP_DST: DmaState = 1; -#[doc = "< DMA channel is in WFP state for the source device (2nd loop iteration onwards)."] -pub const DMASTATE_WFP_SRC: DmaState = 2; -#[doc = "< DMA transfer is running."] -pub const DMASTATE_RUNNING: DmaState = 3; -#[doc = "< DMA transfer is done."] -pub const DMASTATE_DONE: DmaState = 4; -#[doc = "DMA transfer state."] -pub type DmaState = ::libc::c_uint; -#[doc = "< DMA source is a device/peripheral. Address will not auto-increment."] -pub const DMACFG_SRC_IS_DEVICE: _bindgen_ty_5 = 1; -#[doc = "< DMA destination is a device/peripheral. Address will not auto-increment."] -pub const DMACFG_DST_IS_DEVICE: _bindgen_ty_5 = 2; -#[doc = "< Make svcStartInterProcessDma wait for the channel to be unlocked."] -pub const DMACFG_WAIT_AVAILABLE: _bindgen_ty_5 = 4; -#[doc = "< Keep the channel locked after the transfer. Required for svcRestartDma."] -pub const DMACFG_KEEP_LOCKED: _bindgen_ty_5 = 8; -#[doc = "< Use the provided source device configuration even if the DMA source is not a device."] -pub const DMACFG_USE_SRC_CONFIG: _bindgen_ty_5 = 64; -#[doc = "< Use the provided destination device configuration even if the DMA destination is not a device."] -pub const DMACFG_USE_DST_CONFIG: _bindgen_ty_5 = 128; -#[doc = "Configuration flags for DmaConfig."] -pub type _bindgen_ty_5 = ::libc::c_uint; -#[doc = "< Unlock the channel after transfer."] -pub const DMARST_UNLOCK: _bindgen_ty_6 = 1; -#[doc = "< Replace DMAFLUSHP instructions by NOP (they may not be regenerated even if this flag is not set)."] -pub const DMARST_RESUME_DEVICE: _bindgen_ty_6 = 2; -#[doc = "Configuration flags for svcRestartDma."] -pub type _bindgen_ty_6 = ::libc::c_uint; -#[doc = "Device configuration structure, part of DmaConfig.\n > **Note:** - if (and only if) src/dst is a device, then src/dst won't be auto-incremented.\n - the kernel uses DMAMOV instead of DMAADNH, when having to decrement (possibly working around an erratum);\n this forces all loops to be unrolled -- you need to keep that in mind when using negative increments, as the kernel\n uses a limit of 100 DMA instruction bytes per channel."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct DmaDeviceConfig { - #[doc = "< DMA device ID."] - pub deviceId: s8, - #[doc = "< Mask of allowed access alignments (8, 4, 2, 1)."] - pub allowedAlignments: s8, - #[doc = "< Number of bytes transferred in a burst loop. Can be 0 (in which case the max allowed alignment is used as unit)."] - pub burstSize: s16, - #[doc = "< Number of bytes transferred in a \"transfer\" loop (made of burst loops)."] - pub transferSize: s16, - #[doc = "< Burst loop stride, can be <= 0."] - pub burstStride: s16, - #[doc = "< \"Transfer\" loop stride, can be <= 0."] - pub transferStride: s16, -} -#[doc = "Configuration stucture for svcStartInterProcessDma."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct DmaConfig { - #[doc = "< Channel ID (Arm11: 0-7, Arm9: 0-1). Use -1 to auto-assign to a free channel (Arm11: 3-7, Arm9: 0-1)."] - pub channelId: s8, - #[doc = "< Endian swap size (can be 0)."] - pub endianSwapSize: s8, - #[doc = "< DMACFG_* flags."] - pub flags: u8_, - pub _padding: u8_, - #[doc = "< Source device configuration, read if DMACFG_SRC_IS_DEVICE and/or DMACFG_USE_SRC_CONFIG are set."] - pub srcCfg: DmaDeviceConfig, - #[doc = "< Destination device configuration, read if DMACFG_SRC_IS_DEVICE and/or DMACFG_USE_SRC_CONFIG are set."] - pub dstCfg: DmaDeviceConfig, -} -#[doc = "< Enable and lock perfmon. functionality."] -pub const PERFCOUNTEROP_ENABLE: PerfCounterOperation = 0; -#[doc = "< Disable and forcibly unlock perfmon. functionality."] -pub const PERFCOUNTEROP_DISABLE: PerfCounterOperation = 1; -#[doc = "< Get the value of a counter register."] -pub const PERFCOUNTEROP_GET_VALUE: PerfCounterOperation = 2; -#[doc = "< Set the value of a counter register."] -pub const PERFCOUNTEROP_SET_VALUE: PerfCounterOperation = 3; -#[doc = "< Get the overflow flags for all CP15 and SCU counters."] -pub const PERFCOUNTEROP_GET_OVERFLOW_FLAGS: PerfCounterOperation = 4; -#[doc = "< Reset the value and/or overflow flags of selected counters."] -pub const PERFCOUNTEROP_RESET: PerfCounterOperation = 5; -#[doc = "< Get the event ID associated to a particular counter."] -pub const PERFCOUNTEROP_GET_EVENT: PerfCounterOperation = 6; -#[doc = "< Set the event ID associated to a paritcular counter."] -pub const PERFCOUNTEROP_SET_EVENT: PerfCounterOperation = 7; -#[doc = "< (Dis)allow the kernel to track counter overflows and to use 64-bit counter values."] -pub const PERFCOUNTEROP_SET_VIRTUAL_COUNTER_ENABLED: PerfCounterOperation = 8; -#[doc = "Operations for svcControlPerformanceCounter"] -pub type PerfCounterOperation = ::libc::c_uint; -pub const PERFCOUNTERREG_CORE_BASE: PerfCounterRegister = 0; -#[doc = "< CP15 PMN0."] -pub const PERFCOUNTERREG_CORE_COUNT_REG_0: PerfCounterRegister = 0; -#[doc = "< CP15 PMN1."] -pub const PERFCOUNTERREG_CORE_COUNT_REG_1: PerfCounterRegister = 1; -#[doc = "< CP15 CCNT."] -pub const PERFCOUNTERREG_CORE_CYCLE_COUNTER: PerfCounterRegister = 2; -pub const PERFCOUNTERREG_SCU_BASE: PerfCounterRegister = 16; -#[doc = "< SCU MN0."] -pub const PERFCOUNTERREG_SCU_0: PerfCounterRegister = 16; -#[doc = "< SCU MN1."] -pub const PERFCOUNTERREG_SCU_1: PerfCounterRegister = 17; -#[doc = "< SCU MN2."] -pub const PERFCOUNTERREG_SCU_2: PerfCounterRegister = 18; -#[doc = "< SCU MN3."] -pub const PERFCOUNTERREG_SCU_3: PerfCounterRegister = 19; -#[doc = "< SCU MN4. Prod-N3DS only. IRQ line missing."] -pub const PERFCOUNTERREG_SCU_4: PerfCounterRegister = 20; -#[doc = "< SCU MN5. Prod-N3DS only. IRQ line missing."] -pub const PERFCOUNTERREG_SCU_5: PerfCounterRegister = 21; -#[doc = "< SCU MN6. Prod-N3DS only. IRQ line missing."] -pub const PERFCOUNTERREG_SCU_6: PerfCounterRegister = 22; -#[doc = "< SCU MN7. Prod-N3DS only. IRQ line missing."] -pub const PERFCOUNTERREG_SCU_7: PerfCounterRegister = 23; -#[doc = "Performance counter register IDs (CP15 and SCU)."] -pub type PerfCounterRegister = ::libc::c_uint; -pub const PERFCOUNTEREVT_CORE_BASE: PerfCounterEvent = 0; -pub const PERFCOUNTEREVT_CORE_INST_CACHE_MISS: PerfCounterEvent = 0; -pub const PERFCOUNTEREVT_CORE_STALL_BY_LACK_OF_INST: PerfCounterEvent = 1; -pub const PERFCOUNTEREVT_CORE_STALL_BY_DATA_HAZARD: PerfCounterEvent = 2; -pub const PERFCOUNTEREVT_CORE_INST_MICRO_TLB_MISS: PerfCounterEvent = 3; -pub const PERFCOUNTEREVT_CORE_DATA_MICRO_TLB_MISS: PerfCounterEvent = 4; -pub const PERFCOUNTEREVT_CORE_BRANCH_INST: PerfCounterEvent = 5; -pub const PERFCOUNTEREVT_CORE_BRANCH_NOT_PREDICTED: PerfCounterEvent = 6; -pub const PERFCOUNTEREVT_CORE_BRANCH_MISS_PREDICTED: PerfCounterEvent = 7; -pub const PERFCOUNTEREVT_CORE_INST_EXECUTED: PerfCounterEvent = 8; -pub const PERFCOUNTEREVT_CORE_FOLDED_INST_EXECUTED: PerfCounterEvent = 9; -pub const PERFCOUNTEREVT_CORE_DATA_CACHE_READ: PerfCounterEvent = 10; -pub const PERFCOUNTEREVT_CORE_DATA_CACHE_READ_MISS: PerfCounterEvent = 11; -pub const PERFCOUNTEREVT_CORE_DATA_CACHE_WRITE: PerfCounterEvent = 12; -pub const PERFCOUNTEREVT_CORE_DATA_CACHE_WRITE_MISS: PerfCounterEvent = 13; -pub const PERFCOUNTEREVT_CORE_DATA_CACHE_LINE_EVICTION: PerfCounterEvent = 14; -pub const PERFCOUNTEREVT_CORE_PC_CHANGED: PerfCounterEvent = 15; -pub const PERFCOUNTEREVT_CORE_MAIN_TLB_MISS: PerfCounterEvent = 16; -pub const PERFCOUNTEREVT_CORE_EXTERNAL_REQUEST: PerfCounterEvent = 17; -pub const PERFCOUNTEREVT_CORE_STALL_BY_LSU_FULL: PerfCounterEvent = 18; -pub const PERFCOUNTEREVT_CORE_STORE_BUFFER_DRAIN: PerfCounterEvent = 19; -pub const PERFCOUNTEREVT_CORE_MERGE_IN_STORE_BUFFER: PerfCounterEvent = 20; -#[doc = "< One cycle elapsed."] -pub const PERFCOUNTEREVT_CORE_CYCLE_COUNT: PerfCounterEvent = 255; -#[doc = "< 64 cycles elapsed."] -pub const PERFCOUNTEREVT_CORE_CYCLE_COUNT_64: PerfCounterEvent = 4095; -pub const PERFCOUNTEREVT_SCU_BASE: PerfCounterEvent = 4096; -pub const PERFCOUNTEREVT_SCU_DISABLED: PerfCounterEvent = 4096; -pub const PERFCOUNTEREVT_SCU_LINEFILL_MISS_FROM_CORE0: PerfCounterEvent = 4097; -pub const PERFCOUNTEREVT_SCU_LINEFILL_MISS_FROM_CORE1: PerfCounterEvent = 4098; -pub const PERFCOUNTEREVT_SCU_LINEFILL_MISS_FROM_CORE2: PerfCounterEvent = 4099; -pub const PERFCOUNTEREVT_SCU_LINEFILL_MISS_FROM_CORE3: PerfCounterEvent = 4100; -pub const PERFCOUNTEREVT_SCU_LINEFILL_HIT_FROM_CORE0: PerfCounterEvent = 4101; -pub const PERFCOUNTEREVT_SCU_LINEFILL_HIT_FROM_CORE1: PerfCounterEvent = 4102; -pub const PERFCOUNTEREVT_SCU_LINEFILL_HIT_FROM_CORE2: PerfCounterEvent = 4103; -pub const PERFCOUNTEREVT_SCU_LINEFILL_HIT_FROM_CORE3: PerfCounterEvent = 4104; -pub const PERFCOUNTEREVT_SCU_LINE_MISSING_FROM_CORE0: PerfCounterEvent = 4105; -pub const PERFCOUNTEREVT_SCU_LINE_MISSING_FROM_CORE1: PerfCounterEvent = 4106; -pub const PERFCOUNTEREVT_SCU_LINE_MISSING_FROM_CORE2: PerfCounterEvent = 4107; -pub const PERFCOUNTEREVT_SCU_LINE_MISSING_FROM_CORE3: PerfCounterEvent = 4108; -pub const PERFCOUNTEREVT_SCU_LINE_MIGRATION: PerfCounterEvent = 4109; -pub const PERFCOUNTEREVT_SCU_READ_BUSY_PORT0: PerfCounterEvent = 4110; -pub const PERFCOUNTEREVT_SCU_READ_BUSY_PORT1: PerfCounterEvent = 4111; -pub const PERFCOUNTEREVT_SCU_WRITE_BUSY_PORT0: PerfCounterEvent = 4112; -pub const PERFCOUNTEREVT_SCU_WRITE_BUSY_PORT1: PerfCounterEvent = 4113; -pub const PERFCOUNTEREVT_SCU_EXTERNAL_READ: PerfCounterEvent = 4114; -pub const PERFCOUNTEREVT_SCU_EXTERNAL_WRITE: PerfCounterEvent = 4115; -pub const PERFCOUNTEREVT_SCU_CYCLE_COUNT: PerfCounterEvent = 4127; -#[doc = "Performance counter event IDs (CP15 or SCU).\n\n > **Note:** Refer to:\n - CP15: https://developer.arm.com/documentation/ddi0360/e/control-coprocessor-cp15/register-descriptions/c15--performance-monitor-control-register--pmnc-\n - SCU: https://developer.arm.com/documentation/ddi0360/e/mpcore-private-memory-region/about-the-mpcore-private-memory-region/performance-monitor-event-registers"] -pub type PerfCounterEvent = ::libc::c_uint; -#[doc = "Event relating to the attachment of a process."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct AttachProcessEvent { - #[doc = "< ID of the program."] - pub program_id: u64_, - #[doc = "< Name of the process."] - pub process_name: [::libc::c_char; 8usize], - #[doc = "< ID of the process."] - pub process_id: u32_, - #[doc = "< Always 0"] - pub other_flags: u32_, -} -#[doc = "< Process exited either normally or due to an uncaught exception."] -pub const EXITPROCESS_EVENT_EXIT: ExitProcessEventReason = 0; -#[doc = "< Process has been terminated by svcTerminateProcess."] -pub const EXITPROCESS_EVENT_TERMINATE: ExitProcessEventReason = 1; -#[doc = "< Process has been terminated by svcTerminateDebugProcess."] -pub const EXITPROCESS_EVENT_DEBUG_TERMINATE: ExitProcessEventReason = 2; -#[doc = "Reasons for an exit process event."] -pub type ExitProcessEventReason = ::libc::c_uint; -#[doc = "Event relating to the exiting of a process."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ExitProcessEvent { - #[doc = "< Reason for exiting. See ExitProcessEventReason"] - pub reason: ExitProcessEventReason, -} -impl Default for ExitProcessEvent { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "Event relating to the attachment of a thread."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct AttachThreadEvent { - #[doc = "< ID of the creating thread."] - pub creator_thread_id: u32_, - #[doc = "< Thread local storage."] - pub thread_local_storage: u32_, - #[doc = "< Entry point of the thread."] - pub entry_point: u32_, -} -#[doc = "< Thread exited."] -pub const EXITTHREAD_EVENT_EXIT: ExitThreadEventReason = 0; -#[doc = "< Thread terminated."] -pub const EXITTHREAD_EVENT_TERMINATE: ExitThreadEventReason = 1; -#[doc = "< Process exited either normally or due to an uncaught exception."] -pub const EXITTHREAD_EVENT_EXIT_PROCESS: ExitThreadEventReason = 2; -#[doc = "< Process has been terminated by svcTerminateProcess."] -pub const EXITTHREAD_EVENT_TERMINATE_PROCESS: ExitThreadEventReason = 3; -#[doc = "Reasons for an exit thread event."] -pub type ExitThreadEventReason = ::libc::c_uint; -#[doc = "Event relating to the exiting of a thread."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ExitThreadEvent { - #[doc = "< Reason for exiting. See ExitThreadEventReason"] - pub reason: ExitThreadEventReason, -} -impl Default for ExitThreadEvent { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "< Panic."] -pub const USERBREAK_PANIC: UserBreakType = 0; -#[doc = "< Assertion failed."] -pub const USERBREAK_ASSERT: UserBreakType = 1; -#[doc = "< User related."] -pub const USERBREAK_USER: UserBreakType = 2; -#[doc = "< Load RO."] -pub const USERBREAK_LOAD_RO: UserBreakType = 3; -#[doc = "< Unload RO."] -pub const USERBREAK_UNLOAD_RO: UserBreakType = 4; -#[doc = "Reasons for a user break."] -pub type UserBreakType = ::libc::c_uint; -#[doc = "< Undefined instruction."] -pub const EXCEVENT_UNDEFINED_INSTRUCTION: ExceptionEventType = 0; -#[doc = "< Prefetch abort."] -pub const EXCEVENT_PREFETCH_ABORT: ExceptionEventType = 1; -#[doc = "< Data abort (other than the below kind)."] -pub const EXCEVENT_DATA_ABORT: ExceptionEventType = 2; -#[doc = "< Unaligned data access."] -pub const EXCEVENT_UNALIGNED_DATA_ACCESS: ExceptionEventType = 3; -#[doc = "< Attached break."] -pub const EXCEVENT_ATTACH_BREAK: ExceptionEventType = 4; -#[doc = "< Stop point reached."] -pub const EXCEVENT_STOP_POINT: ExceptionEventType = 5; -#[doc = "< User break occurred."] -pub const EXCEVENT_USER_BREAK: ExceptionEventType = 6; -#[doc = "< Debugger break occurred."] -pub const EXCEVENT_DEBUGGER_BREAK: ExceptionEventType = 7; -#[doc = "< Undefined syscall."] -pub const EXCEVENT_UNDEFINED_SYSCALL: ExceptionEventType = 8; -#[doc = "Reasons for an exception event."] -pub type ExceptionEventType = ::libc::c_uint; -#[doc = "Event relating to fault exceptions (CPU exceptions other than stop points and undefined syscalls)."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct FaultExceptionEvent { - #[doc = "< FAR (for DATA ABORT / UNALIGNED DATA ACCESS), attempted syscall or 0"] - pub fault_information: u32_, -} -#[doc = "< See SVC_STOP_POINT."] -pub const STOPPOINT_SVC_FF: StopPointType = 0; -#[doc = "< Breakpoint."] -pub const STOPPOINT_BREAKPOINT: StopPointType = 1; -#[doc = "< Watchpoint."] -pub const STOPPOINT_WATCHPOINT: StopPointType = 2; -#[doc = "Stop point types"] -pub type StopPointType = ::libc::c_uint; -#[doc = "Event relating to stop points"] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct StopPointExceptionEvent { - #[doc = "< Stop point type, see StopPointType."] - pub type_: StopPointType, - #[doc = "< FAR for Watchpoints, otherwise 0."] - pub fault_information: u32_, -} -impl Default for StopPointExceptionEvent { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "Event relating to svcBreak"] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct UserBreakExceptionEvent { - #[doc = "< User break type, see UserBreakType."] - pub type_: UserBreakType, - #[doc = "< For LOAD_RO and UNLOAD_RO."] - pub croInfo: u32_, - #[doc = "< For LOAD_RO and UNLOAD_RO."] - pub croInfoSize: u32_, -} -impl Default for UserBreakExceptionEvent { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "Event relating to svcBreakDebugProcess"] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct DebuggerBreakExceptionEvent { - #[doc = "< IDs of the attached process's threads that were running on each core at the time of the svcBreakDebugProcess call, or -1 (only the first 2 values are meaningful on O3DS)."] - pub thread_ids: [s32; 4usize], -} -#[doc = "Event relating to exceptions."] -#[repr(C)] -#[derive(Copy, Clone)] -pub struct ExceptionEvent { - #[doc = "< Type of event. See ExceptionEventType."] - pub type_: ExceptionEventType, - #[doc = "< Address of the exception."] - pub address: u32_, - pub __bindgen_anon_1: ExceptionEvent__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union ExceptionEvent__bindgen_ty_1 { - #[doc = "< Fault exception event data."] - pub fault: FaultExceptionEvent, - #[doc = "< Stop point exception event data."] - pub stop_point: StopPointExceptionEvent, - #[doc = "< User break exception event data."] - pub user_break: UserBreakExceptionEvent, - #[doc = "< Debugger break exception event data"] - pub debugger_break: DebuggerBreakExceptionEvent, -} -impl Default for ExceptionEvent__bindgen_ty_1 { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl Default for ExceptionEvent { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "Event relating to the scheduler."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct ScheduleInOutEvent { - #[doc = "< Clock tick that the event occurred."] - pub clock_tick: u64_, -} -#[doc = "Event relating to syscalls."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct SyscallInOutEvent { - #[doc = "< Clock tick that the event occurred."] - pub clock_tick: u64_, - #[doc = "< Syscall sent/received."] - pub syscall: u32_, -} -#[doc = "Event relating to debug output."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct OutputStringEvent { - #[doc = "< Address of the outputted string."] - pub string_addr: u32_, - #[doc = "< Size of the outputted string."] - pub string_size: u32_, -} -#[doc = "Event relating to the mapping of memory."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct MapEvent { - #[doc = "< Mapped address."] - pub mapped_addr: u32_, - #[doc = "< Mapped size."] - pub mapped_size: u32_, - #[doc = "< Memory permissions. See MemPerm."] - pub memperm: MemPerm, - #[doc = "< Memory state. See MemState."] - pub memstate: MemState, -} -impl Default for MapEvent { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "< Process attached event."] -pub const DBGEVENT_ATTACH_PROCESS: DebugEventType = 0; -#[doc = "< Thread attached event."] -pub const DBGEVENT_ATTACH_THREAD: DebugEventType = 1; -#[doc = "< Thread exit event."] -pub const DBGEVENT_EXIT_THREAD: DebugEventType = 2; -#[doc = "< Process exit event."] -pub const DBGEVENT_EXIT_PROCESS: DebugEventType = 3; -#[doc = "< Exception event."] -pub const DBGEVENT_EXCEPTION: DebugEventType = 4; -#[doc = "< DLL load event."] -pub const DBGEVENT_DLL_LOAD: DebugEventType = 5; -#[doc = "< DLL unload event."] -pub const DBGEVENT_DLL_UNLOAD: DebugEventType = 6; -#[doc = "< Schedule in event."] -pub const DBGEVENT_SCHEDULE_IN: DebugEventType = 7; -#[doc = "< Schedule out event."] -pub const DBGEVENT_SCHEDULE_OUT: DebugEventType = 8; -#[doc = "< Syscall in event."] -pub const DBGEVENT_SYSCALL_IN: DebugEventType = 9; -#[doc = "< Syscall out event."] -pub const DBGEVENT_SYSCALL_OUT: DebugEventType = 10; -#[doc = "< Output string event."] -pub const DBGEVENT_OUTPUT_STRING: DebugEventType = 11; -#[doc = "< Map event."] -pub const DBGEVENT_MAP: DebugEventType = 12; -#[doc = "Debug event type."] -pub type DebugEventType = ::libc::c_uint; -#[doc = "Information about a debug event."] -#[repr(C)] -#[derive(Copy, Clone)] -pub struct DebugEventInfo { - #[doc = "< Type of event. See DebugEventType"] - pub type_: DebugEventType, - #[doc = "< ID of the thread."] - pub thread_id: u32_, - #[doc = "< Flags. Bit0 means that svcContinueDebugEvent needs to be called for this event (except for EXIT PROCESS events, where this flag is disregarded)."] - pub flags: u32_, - #[doc = "< Always 0."] - pub remnants: [u8_; 4usize], - pub __bindgen_anon_1: DebugEventInfo__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union DebugEventInfo__bindgen_ty_1 { - #[doc = "< Process attachment event data."] - pub attach_process: AttachProcessEvent, - #[doc = "< Thread attachment event data."] - pub attach_thread: AttachThreadEvent, - #[doc = "< Thread exit event data."] - pub exit_thread: ExitThreadEvent, - #[doc = "< Process exit event data."] - pub exit_process: ExitProcessEvent, - #[doc = "< Exception event data."] - pub exception: ExceptionEvent, - #[doc = "< Schedule in/out event data."] - pub scheduler: ScheduleInOutEvent, - #[doc = "< Syscall in/out event data."] - pub syscall: SyscallInOutEvent, - #[doc = "< Output string event data."] - pub output_string: OutputStringEvent, - #[doc = "< Map event data."] - pub map: MapEvent, -} -impl Default for DebugEventInfo__bindgen_ty_1 { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl Default for DebugEventInfo { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "< Inhibit user-defined CPU exception handlers (including watchpoints and breakpoints, regardless of any svcKernelSetState call)."] -pub const DBG_INHIBIT_USER_CPU_EXCEPTION_HANDLERS: DebugFlags = 1; -#[doc = "< Signal fault exception events. See FaultExceptionEvent."] -pub const DBG_SIGNAL_FAULT_EXCEPTION_EVENTS: DebugFlags = 2; -#[doc = "< Signal schedule in/out events. See ScheduleInOutEvent."] -pub const DBG_SIGNAL_SCHEDULE_EVENTS: DebugFlags = 4; -#[doc = "< Signal syscall in/out events. See SyscallInOutEvent."] -pub const DBG_SIGNAL_SYSCALL_EVENTS: DebugFlags = 8; -#[doc = "< Signal map events. See MapEvent."] -pub const DBG_SIGNAL_MAP_EVENTS: DebugFlags = 16; -#[doc = "Debug flags for an attached process, set by svcContinueDebugEvent"] -pub type DebugFlags = ::libc::c_uint; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct ThreadContext { - #[doc = "< CPU registers."] - pub cpu_registers: CpuRegisters, - #[doc = "< FPU registers."] - pub fpu_registers: FpuRegisters, -} -impl Default for ThreadContext { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "< Control r0-r12."] -pub const THREADCONTEXT_CONTROL_CPU_GPRS: ThreadContextControlFlags = 1; -#[doc = "< Control sp, lr, pc, cpsr."] -pub const THREADCONTEXT_CONTROL_CPU_SPRS: ThreadContextControlFlags = 2; -#[doc = "< Control d0-d15 (or s0-s31)."] -pub const THREADCONTEXT_CONTROL_FPU_GPRS: ThreadContextControlFlags = 4; -#[doc = "< Control fpscr, fpexc."] -pub const THREADCONTEXT_CONTROL_FPU_SPRS: ThreadContextControlFlags = 8; -#[doc = "< Control r0-r12, sp, lr, pc, cpsr."] -pub const THREADCONTEXT_CONTROL_CPU_REGS: ThreadContextControlFlags = 3; -#[doc = "< Control d0-d15, fpscr, fpexc."] -pub const THREADCONTEXT_CONTROL_FPU_REGS: ThreadContextControlFlags = 12; -#[doc = "< Control all of the above."] -pub const THREADCONTEXT_CONTROL_ALL: ThreadContextControlFlags = 15; -#[doc = "Control flags for svcGetDebugThreadContext and svcSetDebugThreadContext"] -pub type ThreadContextControlFlags = ::libc::c_uint; -#[doc = "< Thread priority."] -pub const DBGTHREAD_PARAMETER_PRIORITY: DebugThreadParameter = 0; -#[doc = "< Low scheduling mask."] -pub const DBGTHREAD_PARAMETER_SCHEDULING_MASK_LOW: DebugThreadParameter = 1; -#[doc = "< Ideal processor."] -pub const DBGTHREAD_PARAMETER_CPU_IDEAL: DebugThreadParameter = 2; -#[doc = "< Processor that created the threod."] -pub const DBGTHREAD_PARAMETER_CPU_CREATOR: DebugThreadParameter = 3; -#[doc = "Thread parameter field for svcGetDebugThreadParameter"] -pub type DebugThreadParameter = ::libc::c_uint; -#[doc = "Information on address space for process. All sizes are in pages (0x1000 bytes)"] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct CodeSetHeader { - #[doc = "< ASCII name of codeset"] - pub name: [u8_; 8usize], - #[doc = "< Version field of codeset (unused)"] - pub version: u16_, - #[doc = "< Padding"] - pub padding: [u16_; 3usize], - #[doc = "< .text start address"] - pub text_addr: u32_, - #[doc = "< .text number of pages"] - pub text_size: u32_, - #[doc = "< .rodata start address"] - pub ro_addr: u32_, - #[doc = "< .rodata number of pages"] - pub ro_size: u32_, - #[doc = "< .data, .bss start address"] - pub rw_addr: u32_, - #[doc = "< .data number of pages"] - pub rw_size: u32_, - #[doc = "< total pages for .text (aligned)"] - pub text_size_total: u32_, - #[doc = "< total pages for .rodata (aligned)"] - pub ro_size_total: u32_, - #[doc = "< total pages for .data, .bss (aligned)"] - pub rw_size_total: u32_, - #[doc = "< Padding"] - pub padding2: u32_, - #[doc = "< Program ID"] - pub program_id: u64_, -} -#[doc = "Information for the main thread of a process."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct StartupInfo { - #[doc = "< Priority of the main thread."] - pub priority: ::libc::c_int, - #[doc = "< Size of the stack of the main thread."] - pub stack_size: u32_, - #[doc = "< Unused on retail kernel."] - pub argc: ::libc::c_int, - #[doc = "< Unused on retail kernel."] - pub argv: *mut u16_, - #[doc = "< Unused on retail kernel."] - pub envp: *mut u16_, -} -impl Default for StartupInfo { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -extern "C" { - #[doc = "Gets the thread local storage buffer.\n # Returns\n\nThe thread local storage bufger."] - #[link_name = "getThreadLocalStorage__extern"] - pub fn getThreadLocalStorage() -> *mut ::libc::c_void; -} -extern "C" { - #[doc = "Gets the thread command buffer.\n # Returns\n\nThe thread command bufger."] - #[link_name = "getThreadCommandBuffer__extern"] - pub fn getThreadCommandBuffer() -> *mut u32_; -} -extern "C" { - #[doc = "Gets the thread static buffer.\n # Returns\n\nThe thread static bufger."] - #[link_name = "getThreadStaticBuffers__extern"] - pub fn getThreadStaticBuffers() -> *mut u32_; -} -extern "C" { - #[doc = "Writes the default DMA device config that the kernel uses when DMACFG_*_IS_DEVICE and DMACFG_*_USE_CFG are not set"] - #[link_name = "dmaDeviceConfigInitDefault__extern"] - pub fn dmaDeviceConfigInitDefault(cfg: *mut DmaDeviceConfig); -} -extern "C" { - #[doc = "Initializes a DmaConfig instance with sane defaults for RAM<>RAM tranfers"] - #[link_name = "dmaConfigInitDefault__extern"] - pub fn dmaConfigInitDefault(cfg: *mut DmaConfig); -} -extern "C" { - #[must_use] - #[doc = "Memory management\n# *\n* Controls memory mapping\n # Arguments\n\n* `addr_out` (direction out) - The virtual address resulting from the operation. Usually the same as addr0.\n * `addr0` - The virtual address to be used for the operation.\n * `addr1` - The virtual address to be (un)mirrored by `addr0` when using MEMOP_MAP or MEMOP_UNMAP.\n It has to be pointing to a RW memory.\n* Use NULL if the operation is MEMOP_FREE or MEMOP_ALLOC.\n * `size` - The requested size for MEMOP_ALLOC and MEMOP_ALLOC_LINEAR.\n * `op` - Operation flags. See MemOp.\n * `perm` - A combination of MEMPERM_READ and MEMPERM_WRITE. Using MEMPERM_EXECUTE will return an error.\n Value 0 is used when unmapping memory.\n*\n* If a memory is mapped for two or more addresses, you have to use MEMOP_UNMAP before being able to MEMOP_FREE it.\n* MEMOP_MAP will fail if `addr1` was already mapped to another address.\n\n* More information is available at http://3dbrew.org/wiki/SVC#Memory_Mapping.\n*\n* [`svcControlProcessMemory`]\n/"] - pub fn svcControlMemory( - addr_out: *mut u32_, - addr0: u32_, - addr1: u32_, - size: u32_, - op: MemOp, - perm: MemPerm, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Controls the memory mapping of a process\n # Arguments\n\n* `addr0` - The virtual address to map\n * `addr1` - The virtual address to be mapped by `addr0`\n * `type` - Only operations MEMOP_MAP, MEMOP_UNMAP and MEMOP_PROT are allowed.\n\n This is the only SVC which allows mapping executable memory.\n Using MEMOP_PROT will change the memory permissions of an already mapped memory.\n\n > **Note:** The pseudo handle for the current process is not supported by this service call.\n [`svcControlProcess`]"] - pub fn svcControlProcessMemory( - process: Handle, - addr0: u32_, - addr1: u32_, - size: u32_, - type_: u32_, - perm: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Creates a block of shared memory\n # Arguments\n\n* `memblock` (direction out) - Pointer to store the handle of the block\n * `addr` - Address of the memory to map, page-aligned. So its alignment must be 0x1000.\n * `size` - Size of the memory to map, a multiple of 0x1000.\n * `my_perm` - Memory permissions for the current process\n * `other_perm` - Memory permissions for the other processes\n\n > **Note:** The shared memory block, and its rights, are destroyed when the handle is closed."] - pub fn svcCreateMemoryBlock( - memblock: *mut Handle, - addr: u32_, - size: u32_, - my_perm: MemPerm, - other_perm: MemPerm, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Maps a block of shared memory\n # Arguments\n\n* `memblock` - Handle of the block\n * `addr` - Address of the memory to map, page-aligned. So its alignment must be 0x1000.\n * `my_perm` - Memory permissions for the current process\n * `other_perm` - Memory permissions for the other processes\n\n > **Note:** The shared memory block, and its rights, are destroyed when the handle is closed."] - pub fn svcMapMemoryBlock( - memblock: Handle, - addr: u32_, - my_perm: MemPerm, - other_perm: MemPerm, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Maps a block of process memory, starting from address 0x00100000.\n # Arguments\n\n* `process` - Handle of the process.\n * `destAddress` - Address of the block of memory to map, in the current (destination) process.\n * `size` - Size of the block of memory to map (truncated to a multiple of 0x1000 bytes)."] - pub fn svcMapProcessMemory(process: Handle, destAddress: u32_, size: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Unmaps a block of process memory, starting from address 0x00100000.\n # Arguments\n\n* `process` - Handle of the process.\n * `destAddress` - Address of the block of memory to unmap, in the current (destination) process.\n * `size` - Size of the block of memory to unmap (truncated to a multiple of 0x1000 bytes)."] - pub fn svcUnmapProcessMemory(process: Handle, destAddress: u32_, size: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Unmaps a block of shared memory\n # Arguments\n\n* `memblock` - Handle of the block\n * `addr` - Address of the memory to unmap, page-aligned. So its alignment must be 0x1000."] - pub fn svcUnmapMemoryBlock(memblock: Handle, addr: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Queries memory information.\n # Arguments\n\n* `info` (direction out) - Pointer to output memory info to.\n * `out` - Pointer to output page info to.\n * `addr` - Virtual memory address to query."] - pub fn svcQueryMemory(info: *mut MemInfo, out: *mut PageInfo, addr: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Queries process memory information.\n # Arguments\n\n* `info` (direction out) - Pointer to output memory info to.\n * `out` (direction out) - Pointer to output page info to.\n * `process` - Process to query memory from.\n * `addr` - Virtual memory address to query."] - pub fn svcQueryProcessMemory( - info: *mut MemInfo, - out: *mut PageInfo, - process: Handle, - addr: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Process management\n# *\n* Gets the handle of a process.\n # Arguments\n\n* `process` (direction out) - The handle of the process\n * `processId` - The ID of the process to open\n/"] - pub fn svcOpenProcess(process: *mut Handle, processId: u32_) -> Result; -} -extern "C" { - #[doc = "Exits the current process."] - pub fn svcExitProcess() -> !; -} -extern "C" { - #[must_use] - #[doc = "Terminates a process.\n # Arguments\n\n* `process` - Handle of the process to terminate."] - pub fn svcTerminateProcess(process: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets information about a process.\n # Arguments\n\n* `out` (direction out) - Pointer to output process info to.\n * `process` - Handle of the process to get information about.\n * `type` - Type of information to retreieve."] - pub fn svcGetProcessInfo(out: *mut s64, process: Handle, type_: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the ID of a process.\n # Arguments\n\n* `out` (direction out) - Pointer to output the process ID to.\n * `handle` - Handle of the process to get the ID of."] - pub fn svcGetProcessId(out: *mut u32_, handle: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets a list of running processes.\n # Arguments\n\n* `processCount` (direction out) - Pointer to output the process count to.\n * `processIds` (direction out) - Pointer to output the process IDs to.\n * `processIdMaxCount` - Maximum number of process IDs."] - pub fn svcGetProcessList( - processCount: *mut s32, - processIds: *mut u32_, - processIdMaxCount: s32, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets a list of the threads of a process.\n # Arguments\n\n* `threadCount` (direction out) - Pointer to output the thread count to.\n * `threadIds` (direction out) - Pointer to output the thread IDs to.\n * `threadIdMaxCount` - Maximum number of thread IDs.\n * `process` - Process handle to list the threads of."] - pub fn svcGetThreadList( - threadCount: *mut s32, - threadIds: *mut u32_, - threadIdMaxCount: s32, - process: Handle, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Creates a port.\n # Arguments\n\n* `portServer` (direction out) - Pointer to output the port server handle to.\n * `portClient` (direction out) - Pointer to output the port client handle to.\n * `name` - Name of the port.\n * `maxSessions` - Maximum number of sessions that can connect to the port."] - pub fn svcCreatePort( - portServer: *mut Handle, - portClient: *mut Handle, - name: *const ::libc::c_char, - maxSessions: s32, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Connects to a port.\n # Arguments\n\n* `out` (direction out) - Pointer to output the port handle to.\n * `portName` - Name of the port."] - pub fn svcConnectToPort(out: *mut Handle, portName: *const ::libc::c_char) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets up virtual address space for a new process.\n # Arguments\n\n* `out` (direction out) - Pointer to output the codeset handle to.\n * `info` - Codeset header, contains process name, titleId and segment info.\n * `textSegmentLma` - Address of executable segment in caller's address space.\n * `roSegmentLma` - Address of read-only segment in caller's address space.\n * `dataSegmentLma` - Address of read-write segment in caller's address space.\n > **Note:** On success, the provided segments are unmapped from the caller's address space."] - pub fn svcCreateCodeSet( - out: *mut Handle, - info: *const CodeSetHeader, - textSegmentLma: u32_, - roSegmentLma: u32_, - dataSegmentLma: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Create a new process.\n # Arguments\n\n* `out` (direction out) - Pointer to output the process handle to.\n * `codeset` - Codeset created for this process.\n * `arm11KernelCaps` - Arm11 Kernel Capabilities from exheader.\n * `numArm11KernelCaps` - Number of kernel capabilities."] - pub fn svcCreateProcess( - out: *mut Handle, - codeset: Handle, - arm11KernelCaps: *const u32_, - numArm11KernelCaps: s32, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets a process's affinity mask.\n # Arguments\n\n* `affinitymask` (direction out) - Pointer to store the affinity masks.\n * `process` - Handle of the process.\n * `processorcount` - Number of processors."] - pub fn svcGetProcessAffinityMask( - affinitymask: *mut u8_, - process: Handle, - processorcount: s32, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets a process's affinity mask.\n # Arguments\n\n* `process` - Handle of the process.\n * `affinitymask` - Pointer to retrieve the affinity masks from.\n * `processorcount` - Number of processors."] - pub fn svcSetProcessAffinityMask( - process: Handle, - affinitymask: *const u8_, - processorcount: s32, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets a process's ideal processor.\n # Arguments\n\n* `processorid` (direction out) - Pointer to store the ID of the process's ideal processor.\n * `process` - Handle of the process."] - pub fn svcGetProcessIdealProcessor(processorid: *mut s32, process: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets a process's ideal processor.\n # Arguments\n\n* `process` - Handle of the process.\n * `processorid` - ID of the process's ideal processor."] - pub fn svcSetProcessIdealProcessor(process: Handle, processorid: s32) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Launches the main thread of the process.\n # Arguments\n\n* `process` - Handle of the process.\n * `info` - Pointer to a StartupInfo structure describing information for the main thread."] - pub fn svcRun(process: Handle, info: *const StartupInfo) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Multithreading\n# *\n* Creates a new thread.\n # Arguments\n\n* `thread` (direction out) - The thread handle\n * `entrypoint` - The function that will be called first upon thread creation\n * `arg` - The argument passed to `entrypoint`\n * `stack_top` - The top of the thread's stack. Must be 0x8 bytes mem-aligned.\n * `thread_priority` - Low values gives the thread higher priority.\n For userland apps, this has to be within the range [0x18;0x3F]\n* * `processor_id` - The id of the processor the thread should be ran on. Those are labelled starting from 0.\n For old 3ds it has to be <2, and for new 3DS <4.\n* Value -1 means all CPUs and -2 read from the Exheader.\n*\n* The processor with ID 1 is the system processor.\n* To enable multi-threading on this core you need to call APT_SetAppCpuTimeLimit at least once with a non-zero value.\n*\n* Since a thread is considered as a waitable object, you can use svcWaitSynchronization\n and svcWaitSynchronizationN to join with it.\n\n* > **Note:** The kernel will clear the `stack_top's` address low 3 bits to make sure it is 0x8-bytes aligned.\n/"] - pub fn svcCreateThread( - thread: *mut Handle, - entrypoint: ThreadFunc, - arg: u32_, - stack_top: *mut u32_, - thread_priority: s32, - processor_id: s32, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the handle of a thread.\n # Arguments\n\n* `thread` (direction out) - The handle of the thread\n * `process` - The ID of the process linked to the thread"] - pub fn svcOpenThread(thread: *mut Handle, process: Handle, threadId: u32_) -> Result; -} -extern "C" { - #[doc = "Exits the current thread.\n\n This will trigger a state change and hence release all svcWaitSynchronization operations.\n It means that you can join a thread by calling svcWaitSynchronization(threadHandle,yourtimeout); "] - pub fn svcExitThread() -> !; -} -extern "C" { - #[doc = "Puts the current thread to sleep.\n # Arguments\n\n* `ns` - The minimum number of nanoseconds to sleep for."] - pub fn svcSleepThread(ns: s64); -} -extern "C" { - #[must_use] - #[doc = "Retrieves the priority of a thread."] - pub fn svcGetThreadPriority(out: *mut s32, handle: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Changes the priority of a thread\n # Arguments\n\n* `prio` - For userland apps, this has to be within the range [0x18;0x3F]\n\n Low values gives the thread higher priority."] - pub fn svcSetThreadPriority(thread: Handle, prio: s32) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets a thread's affinity mask.\n # Arguments\n\n* `affinitymask` (direction out) - Pointer to output the affinity masks to.\n * `thread` - Handle of the thread.\n * `processorcount` - Number of processors."] - pub fn svcGetThreadAffinityMask( - affinitymask: *mut u8_, - thread: Handle, - processorcount: s32, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets a thread's affinity mask.\n # Arguments\n\n* `thread` - Handle of the thread.\n * `affinitymask` - Pointer to retrieve the affinity masks from.\n * `processorcount` - Number of processors."] - pub fn svcSetThreadAffinityMask( - thread: Handle, - affinitymask: *const u8_, - processorcount: s32, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets a thread's ideal processor.\n # Arguments\n\n* `processorid` (direction out) - Pointer to output the ID of the thread's ideal processor to.\n * `thread` - Handle of the thread."] - pub fn svcGetThreadIdealProcessor(processorid: *mut s32, thread: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets a thread's ideal processor.\n # Arguments\n\n* `thread` - Handle of the thread.\n * `processorid` - ID of the thread's ideal processor."] - pub fn svcSetThreadIdealProcessor(thread: Handle, processorid: s32) -> Result; -} -extern "C" { - #[doc = "Returns the ID of the processor the current thread is running on.\n [`svcCreateThread`]"] - pub fn svcGetProcessorID() -> s32; -} -extern "C" { - #[must_use] - #[doc = "Gets the ID of a thread.\n # Arguments\n\n* `out` (direction out) - Pointer to output the thread ID of the thread `handle` to.\n * `handle` - Handle of the thread."] - pub fn svcGetThreadId(out: *mut u32_, handle: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the resource limit set of a process.\n # Arguments\n\n* `resourceLimit` (direction out) - Pointer to output the resource limit set handle to.\n * `process` - Process to get the resource limits of."] - pub fn svcGetResourceLimit(resourceLimit: *mut Handle, process: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the value limits of a resource limit set.\n # Arguments\n\n* `values` (direction out) - Pointer to output the value limits to.\n * `resourceLimit` - Resource limit set to use.\n * `names` - Resource limit names to get the limits of.\n * `nameCount` - Number of resource limit names."] - pub fn svcGetResourceLimitLimitValues( - values: *mut s64, - resourceLimit: Handle, - names: *mut ResourceLimitType, - nameCount: s32, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the values of a resource limit set.\n # Arguments\n\n* `values` (direction out) - Pointer to output the values to.\n * `resourceLimit` - Resource limit set to use.\n * `names` - Resource limit names to get the values of.\n * `nameCount` - Number of resource limit names."] - pub fn svcGetResourceLimitCurrentValues( - values: *mut s64, - resourceLimit: Handle, - names: *mut ResourceLimitType, - nameCount: s32, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the resource limit set of a process.\n # Arguments\n\n* `process` - Process to set the resource limit set to.\n * `resourceLimit` - Resource limit set handle."] - pub fn svcSetProcessResourceLimits(process: Handle, resourceLimit: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Creates a resource limit set.\n # Arguments\n\n* `resourceLimit` (direction out) - Pointer to output the resource limit set handle to."] - pub fn svcCreateResourceLimit(resourceLimit: *mut Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the value limits of a resource limit set.\n # Arguments\n\n* `resourceLimit` - Resource limit set to use.\n * `names` - Resource limit names to set the limits of.\n * `values` - Value limits to set. The high 32 bits of RESLIMIT_COMMIT are used to\nset APPMEMALLOC in configuration memory, otherwise those bits are unused.\n * `nameCount` - Number of resource limit names."] - pub fn svcSetResourceLimitValues( - resourceLimit: Handle, - names: *const ResourceLimitType, - values: *const s64, - nameCount: s32, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the process ID of a thread.\n # Arguments\n\n* `out` (direction out) - Pointer to output the process ID of the thread `handle` to.\n * `handle` - Handle of the thread.\n [`svcOpenProcess`]"] - pub fn svcGetProcessIdOfThread(out: *mut u32_, handle: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Checks if a thread handle is valid.\n This requests always return an error when called, it only checks if the handle is a thread or not.\n # Returns\n\n0xD8E007ED (BAD_ENUM) if the Handle is a Thread Handle\n 0xD8E007F7 (BAD_HANDLE) if it isn't."] - pub fn svcGetThreadInfo(out: *mut s64, thread: Handle, type_: ThreadInfoType) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Synchronization\n# *\n* Creates a mutex.\n # Arguments\n\n* `mutex` (direction out) - Pointer to output the handle of the created mutex to.\n * `initially_locked` - Whether the mutex should be initially locked.\n/"] - pub fn svcCreateMutex(mutex: *mut Handle, initially_locked: bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Releases a mutex.\n # Arguments\n\n* `handle` - Handle of the mutex."] - pub fn svcReleaseMutex(handle: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Creates a semaphore.\n # Arguments\n\n* `semaphore` (direction out) - Pointer to output the handle of the created semaphore to.\n * `initial_count` - Initial count of the semaphore.\n * `max_count` - Maximum count of the semaphore."] - pub fn svcCreateSemaphore(semaphore: *mut Handle, initial_count: s32, max_count: s32) - -> Result; -} -extern "C" { - #[must_use] - #[doc = "Releases a semaphore.\n # Arguments\n\n* `count` (direction out) - Pointer to output the current count of the semaphore to.\n * `semaphore` - Handle of the semaphore.\n * `release_count` - Number to increase the semaphore count by."] - pub fn svcReleaseSemaphore(count: *mut s32, semaphore: Handle, release_count: s32) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Creates an event handle.\n # Arguments\n\n* `event` (direction out) - Pointer to output the created event handle to.\n * `reset_type` - Type of reset the event uses (RESET_ONESHOT/RESET_STICKY)."] - pub fn svcCreateEvent(event: *mut Handle, reset_type: ResetType) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Signals an event.\n # Arguments\n\n* `handle` - Handle of the event to signal."] - pub fn svcSignalEvent(handle: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Clears an event.\n # Arguments\n\n* `handle` - Handle of the event to clear."] - pub fn svcClearEvent(handle: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Waits for synchronization on a handle.\n # Arguments\n\n* `handle` - Handle to wait on.\n * `nanoseconds` - Maximum nanoseconds to wait for."] - pub fn svcWaitSynchronization(handle: Handle, nanoseconds: s64) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Waits for synchronization on multiple handles.\n # Arguments\n\n* `out` (direction out) - Pointer to output the index of the synchronized handle to.\n * `handles` - Handles to wait on.\n * `handles_num` - Number of handles.\n * `wait_all` - Whether to wait for synchronization on all handles.\n * `nanoseconds` - Maximum nanoseconds to wait for."] - pub fn svcWaitSynchronizationN( - out: *mut s32, - handles: *const Handle, - handles_num: s32, - wait_all: bool, - nanoseconds: s64, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Creates an address arbiter\n # Arguments\n\n* `mutex` (direction out) - Pointer to output the handle of the created address arbiter to.\n [`svcArbitrateAddress`]"] - pub fn svcCreateAddressArbiter(arbiter: *mut Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Arbitrate an address, can be used for synchronization\n # Arguments\n\n* `arbiter` - Handle of the arbiter\n * `addr` - A pointer to a s32 value.\n * `type` - Type of action to be performed by the arbiter\n * `value` - Number of threads to signal if using ARBITRATION_SIGNAL, or the value used for comparison.\n * `timeout_ns` - Optional timeout in nanoseconds when using TIMEOUT actions, ignored otherwise. If not needed, use svcArbitrateAddressNoTimeout instead.\n > **Note:** Usage of this syscall entails an implicit Data Memory Barrier (dmb).\n Please use syncArbitrateAddressWithTimeout instead."] - pub fn svcArbitrateAddress( - arbiter: Handle, - addr: u32_, - type_: ArbitrationType, - value: s32, - timeout_ns: s64, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Same as svcArbitrateAddress but with the timeout_ns parameter undefined.\n # Arguments\n\n* `arbiter` - Handle of the arbiter\n * `addr` - A pointer to a s32 value.\n * `type` - Type of action to be performed by the arbiter\n * `value` - Number of threads to signal if using ARBITRATION_SIGNAL, or the value used for comparison.\n > **Note:** Usage of this syscall entails an implicit Data Memory Barrier (dmb).\n Please use syncArbitrateAddress instead."] - pub fn svcArbitrateAddressNoTimeout( - arbiter: Handle, - addr: u32_, - type_: ArbitrationType, - value: s32, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sends a synchronized request to a session handle.\n # Arguments\n\n* `session` - Handle of the session."] - pub fn svcSendSyncRequest(session: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Connects to a port via a handle.\n # Arguments\n\n* `clientSession` (direction out) - Pointer to output the client session handle to.\n * `clientPort` - Port client endpoint to connect to."] - pub fn svcCreateSessionToPort(clientSession: *mut Handle, clientPort: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Creates a linked pair of session endpoints.\n # Arguments\n\n* `serverSession` (direction out) - Pointer to output the created server endpoint handle to.\n * `clientSession` (direction out) - Pointer to output the created client endpoint handle to."] - pub fn svcCreateSession(serverSession: *mut Handle, clientSession: *mut Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Accepts a session.\n # Arguments\n\n* `session` (direction out) - Pointer to output the created session handle to.\n * `port` - Handle of the port to accept a session from."] - pub fn svcAcceptSession(session: *mut Handle, port: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Replies to and receives a new request.\n # Arguments\n\n* `index` - Pointer to the index of the request.\n * `handles` - Session handles to receive requests from.\n * `handleCount` - Number of handles.\n * `replyTarget` - Handle of the session to reply to."] - pub fn svcReplyAndReceive( - index: *mut s32, - handles: *const Handle, - handleCount: s32, - replyTarget: Handle, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Time\n# *\n* Creates a timer.\n # Arguments\n\n* `timer` (direction out) - Pointer to output the handle of the created timer to.\n * `reset_type` - Type of reset to perform on the timer.\n/"] - pub fn svcCreateTimer(timer: *mut Handle, reset_type: ResetType) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets a timer.\n # Arguments\n\n* `timer` - Handle of the timer to set.\n * `initial` - Initial value of the timer.\n * `interval` - Interval of the timer."] - pub fn svcSetTimer(timer: Handle, initial: s64, interval: s64) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Cancels a timer.\n # Arguments\n\n* `timer` - Handle of the timer to cancel."] - pub fn svcCancelTimer(timer: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Clears a timer.\n # Arguments\n\n* `timer` - Handle of the timer to clear."] - pub fn svcClearTimer(timer: Handle) -> Result; -} -extern "C" { - #[doc = "Gets the current system tick.\n # Returns\n\nThe current system tick."] - pub fn svcGetSystemTick() -> u64_; -} -extern "C" { - #[must_use] - #[doc = "System\n# *\n* Closes a handle.\n # Arguments\n\n* `handle` - Handle to close.\n/"] - pub fn svcCloseHandle(handle: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Duplicates a handle.\n # Arguments\n\n* `out` (direction out) - Pointer to output the duplicated handle to.\n * `original` - Handle to duplicate."] - pub fn svcDuplicateHandle(out: *mut Handle, original: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets a handle info.\n # Arguments\n\n* `out` (direction out) - Pointer to output the handle info to.\n * `handle` - Handle to get the info for.\n * `param` - Parameter clarifying the handle info type."] - pub fn svcGetHandleInfo(out: *mut s64, handle: Handle, param: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the system info.\n # Arguments\n\n* `out` (direction out) - Pointer to output the system info to.\n * `type` - Type of system info to retrieve.\n * `param` - Parameter clarifying the system info type."] - pub fn svcGetSystemInfo(out: *mut s64, type_: u32_, param: s32) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the current kernel state.\n # Arguments\n\n* `type` - Type of state to set (the other parameters depend on it)."] - pub fn svcKernelSetState(type_: u32_, ...) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Binds an event or semaphore handle to an ARM11 interrupt.\n # Arguments\n\n* `interruptId` - Interrupt identfier (see https://www.3dbrew.org/wiki/ARM11_Interrupts).\n * `eventOrSemaphore` - Event or semaphore handle to bind to the given interrupt.\n * `priority` - Priority of the interrupt for the current process.\n * `isManualClear` - Indicates whether the interrupt has to be manually cleared or not (= level-high active)."] - pub fn svcBindInterrupt( - interruptId: u32_, - eventOrSemaphore: Handle, - priority: s32, - isManualClear: bool, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Unbinds an event or semaphore handle from an ARM11 interrupt.\n # Arguments\n\n* `interruptId` - Interrupt identfier, see (see https://www.3dbrew.org/wiki/ARM11_Interrupts).\n * `eventOrSemaphore` - Event or semaphore handle to unbind from the given interrupt."] - pub fn svcUnbindInterrupt(interruptId: u32_, eventOrSemaphore: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Invalidates a process's data cache.\n # Arguments\n\n* `process` - Handle of the process.\n * `addr` - Address to invalidate.\n * `size` - Size of the memory to invalidate."] - pub fn svcInvalidateProcessDataCache(process: Handle, addr: u32_, size: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Cleans a process's data cache.\n # Arguments\n\n* `process` - Handle of the process.\n * `addr` - Address to clean.\n * `size` - Size of the memory to clean."] - pub fn svcStoreProcessDataCache(process: Handle, addr: u32_, size: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Flushes (cleans and invalidates) a process's data cache.\n # Arguments\n\n* `process` - Handle of the process.\n * `addr` - Address to flush.\n * `size` - Size of the memory to flush."] - pub fn svcFlushProcessDataCache(process: Handle, addr: u32_, size: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Begins an inter-process DMA transfer.\n # Arguments\n\n* `dma` (direction out) - Pointer to output the handle of the DMA channel object to.\n * `dstProcess` - Destination process handle.\n * `dstAddr` - Address in the destination process to write data to.\n * `srcProcess` - Source process handle.\n * `srcAddr` - Address in the source to read data from.\n * `size` - Size of the data to transfer.\n * `cfg` - Configuration structure.\n > **Note:** The handle is signaled when the transfer finishes."] - pub fn svcStartInterProcessDma( - dma: *mut Handle, - dstProcess: Handle, - dstAddr: u32_, - srcProcess: Handle, - srcAddr: u32_, - size: u32_, - cfg: *const DmaConfig, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Stops an inter-process DMA transfer.\n # Arguments\n\n* `dma` - Handle of the DMA channel object."] - pub fn svcStopDma(dma: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the state of an inter-process DMA transfer.\n # Arguments\n\n* `state` (direction out) - Pointer to output the state of the DMA transfer to.\n * `dma` - Handle of the DMA channel object."] - pub fn svcGetDmaState(state: *mut DmaState, dma: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Restarts a DMA transfer, using the same configuration as before.\n # Arguments\n\n* `state` (direction out) - Pointer to output the state of the DMA transfer to.\n * `dma` - Handle of the DMA channel object.\n * `dstAddr` - Address in the destination process to write data to.\n * `srcAddr` - Address in the source to read data from.\n * `size` - Size of the data to transfer.\n * `flags` - Restart flags, DMARST_UNLOCK and/or DMARST_RESUME_DEVICE.\n > **Note:** The first transfer has to be configured with DMACFG_KEEP_LOCKED."] - pub fn svcRestartDma( - dma: Handle, - dstAddr: u32_, - srcAddr: u32_, - size: u32_, - flags: s8, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the GPU protection register to restrict the range of the GPU DMA. 11.3+ only.\n # Arguments\n\n* `useApplicationRestriction` - Whether to use the register value used for APPLICATION titles."] - pub fn svcSetGpuProt(useApplicationRestriction: bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Enables or disables Wi-Fi. 11.4+ only.\n # Arguments\n\n* `enabled` - Whether to enable or disable Wi-Fi."] - pub fn svcSetWifiEnabled(enabled: bool) -> Result; -} -extern "C" { - #[doc = "Debugging\n# *\n* Breaks execution.\n # Arguments\n\n* `breakReason` - Reason for breaking.\n/"] - pub fn svcBreak(breakReason: UserBreakType); -} -extern "C" { - #[doc = "Breaks execution (LOAD_RO and UNLOAD_RO).\n # Arguments\n\n* `breakReason` - Debug reason for breaking.\n * `croInfo` - Library information.\n * `croInfoSize` - Size of the above structure."] - pub fn svcBreakRO( - breakReason: UserBreakType, - croInfo: *const ::libc::c_void, - croInfoSize: u32_, - ); -} -extern "C" { - #[must_use] - #[doc = "Outputs a debug string.\n # Arguments\n\n* `str` - String to output.\n * `length` - Length of the string to output, needs to be positive."] - pub fn svcOutputDebugString(str_: *const ::libc::c_char, length: s32) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Controls performance monitoring on the CP15 interface and the SCU.\n The meaning of the parameters depend on the operation.\n # Arguments\n\n* `out` (direction out) - Output.\n * `op` - Operation, see details.\n * `param1` - First parameter.\n * `param2` - Second parameter.\n \n\nThe operations are the following:\n - PERFCOUNTEROP_ENABLE (void) -> void, tries to enable and lock perfmon. functionality.\n - PERFCOUNTEROP_DISABLE (void) -> void, disable and forcibly unlocks perfmon. functionality.\n - PERFCOUNTEROP_GET_VALUE (PerfCounterRegister reg) -> u64, gets the value of a particular counter register.\n - PERFCOUNTEROP_SET_VALUE (PerfCounterRegister reg, u64 value) -> void, sets the value of a particular counter register.\n - PERFCOUNTEROP_GET_OVERFLOW_FLAGS (void) -> u32, gets the overflow flags of all CP15 and SCU registers.\n - Format is a bitfield of PerfCounterRegister.\n - PERFCOUNTEROP_RESET (u32 valueResetMask, u32 overflowFlagResetMask) -> void, resets the value and/or\n overflow flags of selected registers.\n - Format is two bitfields of PerfCounterRegister.\n - PERFCOUNTEROP_GET_EVENT (PerfCounterRegister reg) -> PerfCounterEvent, gets the event associated\n to a particular counter register.\n - PERFCOUNTEROP_SET_EVENT (PerfCounterRegister reg, PerfCounterEvent) -> void, sets the event associated\n to a particular counter register.\n - PERFCOUNTEROP_SET_VIRTUAL_COUNTER_ENABLED (bool enabled) -> void, (dis)allows the kernel to track counter overflows\n and to use 64-bit counter values."] - pub fn svcControlPerformanceCounter( - out: *mut u64_, - op: PerfCounterOperation, - param1: u32_, - param2: u64_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Creates a debug handle for an active process.\n # Arguments\n\n* `debug` (direction out) - Pointer to output the created debug handle to.\n * `processId` - ID of the process to debug."] - pub fn svcDebugActiveProcess(debug: *mut Handle, processId: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Breaks a debugged process.\n # Arguments\n\n* `debug` - Debug handle of the process."] - pub fn svcBreakDebugProcess(debug: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Terminates a debugged process.\n # Arguments\n\n* `debug` - Debug handle of the process."] - pub fn svcTerminateDebugProcess(debug: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the current debug event of a debugged process.\n # Arguments\n\n* `info` (direction out) - Pointer to output the debug event information to.\n * `debug` - Debug handle of the process."] - pub fn svcGetProcessDebugEvent(info: *mut DebugEventInfo, debug: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Continues the current debug event of a debugged process (not necessarily the same as svcGetProcessDebugEvent).\n # Arguments\n\n* `debug` - Debug handle of the process.\n * `flags` - Flags to continue with, see DebugFlags."] - pub fn svcContinueDebugEvent(debug: Handle, flags: DebugFlags) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Fetches the saved registers of a thread, either inactive or awaiting svcContinueDebugEvent, belonging to a debugged process.\n # Arguments\n\n* `context` (direction out) - Values of the registers to fetch, see ThreadContext.\n * `debug` - Debug handle of the parent process.\n * `threadId` - ID of the thread to fetch the saved registers of.\n * `controlFlags` - Which registers to fetch, see ThreadContextControlFlags."] - pub fn svcGetDebugThreadContext( - context: *mut ThreadContext, - debug: Handle, - threadId: u32_, - controlFlags: ThreadContextControlFlags, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Updates the saved registers of a thread, either inactive or awaiting svcContinueDebugEvent, belonging to a debugged process.\n # Arguments\n\n* `debug` - Debug handle of the parent process.\n * `threadId` - ID of the thread to update the saved registers of.\n * `context` - Values of the registers to update, see ThreadContext.\n * `controlFlags` - Which registers to update, see ThreadContextControlFlags."] - pub fn svcSetDebugThreadContext( - debug: Handle, - threadId: u32_, - context: *mut ThreadContext, - controlFlags: ThreadContextControlFlags, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Queries memory information of a debugged process.\n # Arguments\n\n* `info` (direction out) - Pointer to output memory info to.\n * `out` (direction out) - Pointer to output page info to.\n * `debug` - Debug handle of the process to query memory from.\n * `addr` - Virtual memory address to query."] - pub fn svcQueryDebugProcessMemory( - info: *mut MemInfo, - out: *mut PageInfo, - debug: Handle, - addr: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Reads from a debugged process's memory.\n # Arguments\n\n* `buffer` - Buffer to read data to.\n * `debug` - Debug handle of the process.\n * `addr` - Address to read from.\n * `size` - Size of the memory to read."] - pub fn svcReadProcessMemory( - buffer: *mut ::libc::c_void, - debug: Handle, - addr: u32_, - size: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Writes to a debugged process's memory.\n # Arguments\n\n* `debug` - Debug handle of the process.\n * `buffer` - Buffer to write data from.\n * `addr` - Address to write to.\n * `size` - Size of the memory to write."] - pub fn svcWriteProcessMemory( - debug: Handle, - buffer: *const ::libc::c_void, - addr: u32_, - size: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets an hardware breakpoint or watchpoint. This is an interface to the BRP/WRP registers, see http://infocenter.arm.com/help/topic/com.arm.doc.ddi0360f/CEGEBGFC.html .\n # Arguments\n\n* `registerId` - range 0..5 = breakpoints (BRP0-5), 0x100..0x101 = watchpoints (WRP0-1). The previous stop point for the register is disabled.\n * `control` - Value of the control regiser.\n * `value` - Value of the value register: either and address (if bit21 of control is clear) or the debug handle of a process to fetch the context ID of."] - pub fn svcSetHardwareBreakPoint(registerId: s32, control: u32_, value: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets a debugged thread's parameter.\n # Arguments\n\n* `unused` (direction out) - Unused.\n * `out` (direction out) - Output value.\n * `debug` - Debug handle of the process.\n * `threadId` - ID of the thread\n * `parameter` - Parameter to fetch, see DebugThreadParameter."] - pub fn svcGetDebugThreadParam( - unused: *mut s64, - out: *mut u32_, - debug: Handle, - threadId: u32_, - parameter: DebugThreadParameter, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Executes a function in supervisor mode.\n # Arguments\n\n* `callback` - Function to execute."] - pub fn svcBackdoor(callback: ::core::option::Option s32>) -> Result; -} -#[doc = "< Mount \"nand:/\""] -pub const ARM9DESC_MOUNT_NAND: _bindgen_ty_7 = 1; -#[doc = "< Mount nand:/ro/ as read-write"] -pub const ARM9DESC_MOUNT_NANDRO_RW: _bindgen_ty_7 = 2; -#[doc = "< Mount \"twln:/\""] -pub const ARM9DESC_MOUNT_TWLN: _bindgen_ty_7 = 4; -#[doc = "< Mount \"wnand:/\""] -pub const ARM9DESC_MOUNT_WNAND: _bindgen_ty_7 = 8; -#[doc = "< Mount \"cardspi:/\""] -pub const ARM9DESC_MOUNT_CARDSPI: _bindgen_ty_7 = 16; -#[doc = "< Use SDIF3"] -pub const ARM9DESC_USE_SDIF3: _bindgen_ty_7 = 32; -#[doc = "< Create seed (movable.sed)"] -pub const ARM9DESC_CREATE_SEED: _bindgen_ty_7 = 64; -#[doc = "< Use card SPI, required by multiple pxi:dev commands"] -pub const ARM9DESC_USE_CARD_SPI: _bindgen_ty_7 = 128; -#[doc = "< SD application (not checked)"] -pub const ARM9DESC_SD_APPLICATION: _bindgen_ty_7 = 256; -#[doc = "< Mount \"sdmc:/\" as read-write"] -pub const ARM9DESC_MOUNT_SDMC_RW: _bindgen_ty_7 = 512; -#[doc = "ARM9 descriptor flags"] -pub type _bindgen_ty_7 = ::libc::c_uint; -#[doc = "< Category \"system application\""] -pub const FSACCESS_CATEGORY_SYSTEM_APPLICATION: _bindgen_ty_8 = 1; -#[doc = "< Category \"hardware check\""] -pub const FSACCESS_CATEGORY_HARDWARE_CHECK: _bindgen_ty_8 = 2; -#[doc = "< Category \"filesystem tool\""] -pub const FSACCESS_CATEGORY_FILESYSTEM_TOOL: _bindgen_ty_8 = 4; -#[doc = "< Debug"] -pub const FSACCESS_DEBUG: _bindgen_ty_8 = 8; -#[doc = "< TWLCARD backup"] -pub const FSACCESS_TWLCARD_BACKUP: _bindgen_ty_8 = 16; -#[doc = "< TWLNAND data"] -pub const FSACCESS_TWLNAND_DATA: _bindgen_ty_8 = 32; -#[doc = "< BOSS (SpotPass)"] -pub const FSACCESS_BOSS: _bindgen_ty_8 = 64; -#[doc = "< SDMC (read-write)"] -pub const FSACCESS_SDMC_RW: _bindgen_ty_8 = 128; -#[doc = "< Core"] -pub const FSACCESS_CORE: _bindgen_ty_8 = 256; -#[doc = "< nand:/ro/ (read-only)"] -pub const FSACCESS_NANDRO_RO: _bindgen_ty_8 = 512; -#[doc = "< nand:/rw/"] -pub const FSACCESS_NANDRW: _bindgen_ty_8 = 1024; -#[doc = "< nand:/ro/ (read-write)"] -pub const FSACCESS_NANDRO_RW: _bindgen_ty_8 = 2048; -#[doc = "< Category \"System Settings\""] -pub const FSACCESS_CATEGORY_SYSTEM_SETTINGS: _bindgen_ty_8 = 4096; -#[doc = "< Cardboard (System Transfer)"] -pub const FSACCESS_CARDBOARD: _bindgen_ty_8 = 8192; -#[doc = "< Export/Import IVs (movable.sed)"] -pub const FSACCESS_EXPORT_IMPORT_IVS: _bindgen_ty_8 = 16384; -#[doc = "< SDMC (write-only)"] -pub const FSACCESS_SDMC_WO: _bindgen_ty_8 = 32768; -#[doc = "< \"Switch cleanup\" (3.0+)"] -pub const FSACCESS_SWITCH_CLEANUP: _bindgen_ty_8 = 65536; -#[doc = "< Savedata move (5.0+)"] -pub const FSACCESS_SAVEDATA_MOVE: _bindgen_ty_8 = 131072; -#[doc = "< Shop (5.0+)"] -pub const FSACCESS_SHOP: _bindgen_ty_8 = 262144; -#[doc = "< Shop (5.0+)"] -pub const FSACCESS_SHELL: _bindgen_ty_8 = 524288; -#[doc = "< Category \"Home Menu\" (6.0+)"] -pub const FSACCESS_CATEGORY_HOME_MENU: _bindgen_ty_8 = 1048576; -#[doc = "< Seed DB (9.6+)"] -pub const FSACCESS_SEEDDB: _bindgen_ty_8 = 2097152; -#[doc = "Filesystem access flags"] -pub type _bindgen_ty_8 = ::libc::c_uint; -#[doc = "< Regular application"] -pub const RESLIMIT_CATEGORY_APPLICATION: ResourceLimitCategory = 0; -#[doc = "< System applet"] -pub const RESLIMIT_CATEGORY_SYS_APPLET: ResourceLimitCategory = 1; -#[doc = "< Library applet"] -pub const RESLIMIT_CATEGORY_LIB_APPLET: ResourceLimitCategory = 2; -#[doc = "< System modules running inside the BASE memregion"] -pub const RESLIMIT_CATEGORY_OTHER: ResourceLimitCategory = 3; -#[doc = "The resource limit category of a title"] -pub type ResourceLimitCategory = ::libc::c_uint; -#[doc = "< 64MB of usable application memory"] -pub const SYSMODE_O3DS_PROD: SystemMode = 0; -#[doc = "< 124MB of usable application memory. Unusable on O3DS"] -pub const SYSMODE_N3DS_PROD: SystemMode = 1; -#[doc = "< 97MB/178MB of usable application memory"] -pub const SYSMODE_DEV1: SystemMode = 2; -#[doc = "< 80MB/124MB of usable application memory"] -pub const SYSMODE_DEV2: SystemMode = 3; -#[doc = "< 72MB of usable application memory. Same as \"Prod\" on N3DS"] -pub const SYSMODE_DEV3: SystemMode = 4; -#[doc = "< 32MB of usable application memory. Same as \"Prod\" on N3DS"] -pub const SYSMODE_DEV4: SystemMode = 5; -#[doc = "The system mode a title should be launched under"] -pub type SystemMode = ::libc::c_uint; -#[doc = "The system info flags and remaster version of a title"] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct ExHeader_SystemInfoFlags { - #[doc = "< Reserved"] - pub reserved: [u8_; 5usize], - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, - #[doc = "< Remaster version"] - 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]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = 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 - } -} -#[doc = "Information about a title's section"] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct ExHeader_CodeSectionInfo { - #[doc = "< The address of the section"] - pub address: u32_, - #[doc = "< The number of pages the section occupies"] - pub num_pages: u32_, - #[doc = "< The size of the section"] - pub size: u32_, -} -#[doc = "The name of a title and infomation about its section"] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct ExHeader_CodeSetInfo { - #[doc = "< Title name"] - pub name: [::libc::c_char; 8usize], - #[doc = "< System info flags, see ExHeader_SystemInfoFlags"] - pub flags: ExHeader_SystemInfoFlags, - #[doc = "< .text section info, see ExHeader_CodeSectionInfo"] - pub text: ExHeader_CodeSectionInfo, - #[doc = "< Stack size"] - pub stack_size: u32_, - #[doc = "< .rodata section info, see ExHeader_CodeSectionInfo"] - pub rodata: ExHeader_CodeSectionInfo, - #[doc = "< Reserved"] - pub reserved: u32_, - #[doc = "< .data section info, see ExHeader_CodeSectionInfo"] - pub data: ExHeader_CodeSectionInfo, - #[doc = "< .bss section size"] - pub bss_size: u32_, -} -#[doc = "The savedata size and jump ID of a title"] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ExHeader_SystemInfo { - #[doc = "< Savedata size"] - pub savedata_size: u64_, - #[doc = "< Jump ID"] - pub jump_id: u64_, - #[doc = "< Reserved"] - pub reserved: [u8_; 48usize], -} -impl Default for ExHeader_SystemInfo { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "The code set info, dependencies and system info of a title (SCI)"] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ExHeader_SystemControlInfo { - #[doc = "< Code set info, see ExHeader_CodeSetInfo"] - pub codeset_info: ExHeader_CodeSetInfo, - #[doc = "< Title IDs of the titles that this program depends on"] - pub dependencies: [u64_; 48usize], - #[doc = "< System info, see ExHeader_SystemInfo"] - pub system_info: ExHeader_SystemInfo, -} -impl Default for ExHeader_SystemControlInfo { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "The ARM11 filesystem info of a title"] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct ExHeader_Arm11StorageInfo { - #[doc = "< Extdata ID"] - pub extdata_id: u64_, - #[doc = "< IDs of the system savedata accessible by the title"] - pub system_savedata_ids: [u32_; 2usize], - #[doc = "< IDs of the savedata accessible by the title, 20 bits each, followed by \"Use other variation savedata\""] - pub accessible_savedata_ids: u64_, - #[doc = "< FS access flags"] - pub fs_access_info: u32_, - pub _bitfield_align_1: [u32; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, -} -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]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = 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 - } -} -#[doc = "The CPU-related and memory-layout-related info of a title"] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ExHeader_Arm11CoreInfo { - #[doc = "< The low title ID of the target firmware"] - pub core_version: u32_, - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 3usize]>, - #[doc = "< The priority of the title's main thread"] - pub priority: u8_, -} -impl Default for ExHeader_Arm11CoreInfo { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -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]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 3usize]> = 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 - } -} -#[doc = "The ARM11 system-local capabilities of a title"] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ExHeader_Arm11SystemLocalCapabilities { - #[doc = "< Title ID"] - pub title_id: u64_, - #[doc = "< Core info, see ExHeader_Arm11CoreInfo"] - pub core_info: ExHeader_Arm11CoreInfo, - #[doc = "< Resource limit descriptors, only \"CpuTime\" (first byte) sems to be used"] - pub reslimits: [u16_; 16usize], - #[doc = "< Storage info, see ExHeader_Arm11StorageInfo"] - pub storage_info: ExHeader_Arm11StorageInfo, - #[doc = "< List of the services the title has access to. Limited to 32 prior to system version 9.3"] - pub service_access: [[::libc::c_char; 8usize]; 34usize], - #[doc = "< Reserved"] - pub reserved: [u8_; 15usize], - #[doc = "< Resource limit category, see ExHeader_Arm11SystemLocalCapabilities"] - pub reslimit_category: ResourceLimitCategory, -} -impl Default for ExHeader_Arm11SystemLocalCapabilities { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "The ARM11 kernel capabilities of a title"] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct ExHeader_Arm11KernelCapabilities { - #[doc = "< ARM11 kernel descriptors, see 3dbrew"] - pub descriptors: [u32_; 28usize], - #[doc = "< Reserved"] - pub reserved: [u8_; 16usize], -} -#[doc = "The ARM9 access control of a title"] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct ExHeader_Arm9AccessControl { - #[doc = "< Process9 FS descriptors, see 3dbrew"] - pub descriptors: [u8_; 15usize], - #[doc = "< Descriptor version"] - pub descriptor_version: u8_, -} -#[doc = "The access control information of a title"] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ExHeader_AccessControlInfo { - #[doc = "< ARM11 system-local capabilities, see ExHeader_Arm11SystemLocalCapabilities"] - pub local_caps: ExHeader_Arm11SystemLocalCapabilities, - #[doc = "< ARM11 kernel capabilities, see ExHeader_Arm11SystemLocalCapabilities"] - pub kernel_caps: ExHeader_Arm11KernelCapabilities, - #[doc = "< ARM9 access control, see ExHeader_Arm9AccessControl"] - pub access_control: ExHeader_Arm9AccessControl, -} -impl Default for ExHeader_AccessControlInfo { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "Main extended header data, as returned by PXIPM, Loader and FSREG service commands"] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ExHeader_Info { - #[doc = "< System control info, see ExHeader_SystemControlInfo"] - pub sci: ExHeader_SystemControlInfo, - #[doc = "< Access control info, see ExHeader_AccessControlInfo"] - pub aci: ExHeader_AccessControlInfo, -} -impl Default for ExHeader_Info { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "Extended header access descriptor"] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ExHeader_AccessDescriptor { - #[doc = "< The signature of the access descriptor (RSA-2048-SHA256)"] - pub signature: [u8_; 256usize], - #[doc = "< The modulus used for the above signature, with 65537 as public exponent"] - pub ncchModulus: [u8_; 256usize], - #[doc = "< This is compared for equality with the first ACI by Process9, see ExHeader_AccessControlInfo"] - pub acli: ExHeader_AccessControlInfo, -} -impl Default for ExHeader_AccessDescriptor { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "The NCCH Extended Header of a title"] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ExHeader { - #[doc = "< Main extended header data, see ExHeader_Info"] - pub info: ExHeader_Info, - #[doc = "< Access descriptor, see ExHeader_AccessDescriptor"] - pub access_descriptor: ExHeader_AccessDescriptor, -} -impl Default for ExHeader { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -extern "C" { - #[must_use] - #[doc = "Initializes the service API."] - pub fn srvInit() -> Result; -} -extern "C" { - #[doc = "Exits the service API."] - pub fn srvExit(); -} -extern "C" { - #[doc = "Makes srvGetServiceHandle non-blocking for the current thread (or blocking, the default), in case of unavailable (full) requested services.\n # Arguments\n\n* `blocking` - Whether srvGetServiceHandle should be non-blocking.\n srvGetServiceHandle will always block if the service hasn't been registered yet,\n use srvIsServiceRegistered to check whether that is the case or not."] - pub fn srvSetBlockingPolicy(nonBlocking: bool); -} -extern "C" { - #[doc = "Gets the current service API session handle.\n # Returns\n\nThe current service API session handle."] - pub fn srvGetSessionHandle() -> *mut Handle; -} -extern "C" { - #[must_use] - #[doc = "Retrieves a service handle, retrieving from the environment handle list if possible.\n # Arguments\n\n* `out` - Pointer to write the handle to.\n * `name` - Name of the service.\n # Returns\n\n0 if no error occured,\n 0xD8E06406 if the caller has no right to access the service,\n 0xD0401834 if the requested service port is full and srvGetServiceHandle is non-blocking (see srvSetBlockingPolicy)."] - pub fn srvGetServiceHandle(out: *mut Handle, name: *const ::libc::c_char) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Registers the current process as a client to the service API."] - pub fn srvRegisterClient() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Enables service notificatios, returning a notification semaphore.\n # Arguments\n\n* `semaphoreOut` - Pointer to output the notification semaphore to."] - pub fn srvEnableNotification(semaphoreOut: *mut Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Registers the current process as a service.\n # Arguments\n\n* `out` - Pointer to write the service handle to.\n * `name` - Name of the service.\n * `maxSessions` - Maximum number of sessions the service can handle."] - pub fn srvRegisterService( - out: *mut Handle, - name: *const ::libc::c_char, - maxSessions: ::libc::c_int, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Unregisters the current process as a service.\n # Arguments\n\n* `name` - Name of the service."] - pub fn srvUnregisterService(name: *const ::libc::c_char) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Retrieves a service handle.\n # Arguments\n\n* `out` - Pointer to output the handle to.\n * `name` - Name of the service.\n * # Returns\n\n0 if no error occured,\n 0xD8E06406 if the caller has no right to access the service,\n 0xD0401834 if the requested service port is full and srvGetServiceHandle is non-blocking (see srvSetBlockingPolicy)."] - pub fn srvGetServiceHandleDirect(out: *mut Handle, name: *const ::libc::c_char) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Registers a port.\n # Arguments\n\n* `name` - Name of the port.\n * `clientHandle` - Client handle of the port."] - pub fn srvRegisterPort(name: *const ::libc::c_char, clientHandle: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Unregisters a port.\n # Arguments\n\n* `name` - Name of the port."] - pub fn srvUnregisterPort(name: *const ::libc::c_char) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Retrieves a port handle.\n # Arguments\n\n* `out` - Pointer to output the handle to.\n * `name` - Name of the port."] - pub fn srvGetPort(out: *mut Handle, name: *const ::libc::c_char) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Waits for a port to be registered.\n # Arguments\n\n* `name` - Name of the port to wait for registration."] - pub fn srvWaitForPortRegistered(name: *const ::libc::c_char) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Subscribes to a notification.\n # Arguments\n\n* `notificationId` - ID of the notification."] - pub fn srvSubscribe(notificationId: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Unsubscribes from a notification.\n # Arguments\n\n* `notificationId` - ID of the notification."] - pub fn srvUnsubscribe(notificationId: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Receives a notification.\n # Arguments\n\n* `notificationIdOut` - Pointer to output the ID of the received notification to."] - pub fn srvReceiveNotification(notificationIdOut: *mut u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Publishes a notification to subscribers.\n # Arguments\n\n* `notificationId` - ID of the notification.\n * `flags` - Flags to publish with. (bit 0 = only fire if not fired, bit 1 = do not report an error if there are more than 16 pending notifications)"] - pub fn srvPublishToSubscriber(notificationId: u32_, flags: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Publishes a notification to subscribers and retrieves a list of all processes that were notified.\n # Arguments\n\n* `processIdCountOut` - Pointer to output the number of process IDs to.\n * `processIdsOut` - Pointer to output the process IDs to. Should have size \"60 * sizeof(u32)\".\n * `notificationId` - ID of the notification."] - pub fn srvPublishAndGetSubscriber( - processIdCountOut: *mut u32_, - processIdsOut: *mut u32_, - notificationId: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Checks whether a service is registered.\n # Arguments\n\n* `registeredOut` - Pointer to output the registration status to.\n * `name` - Name of the service to check."] - pub fn srvIsServiceRegistered(registeredOut: *mut bool, name: *const ::libc::c_char) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Checks whether a port is registered.\n # Arguments\n\n* `registeredOut` - Pointer to output the registration status to.\n * `name` - Name of the port to check."] - pub fn srvIsPortRegistered(registeredOut: *mut bool, name: *const ::libc::c_char) -> Result; -} -#[doc = "< Generic fatal error. Shows miscellaneous info, including the address of the caller"] -pub const ERRF_ERRTYPE_GENERIC: ERRF_ErrType = 0; -#[doc = "< Damaged NAND (CC_ERROR after reading CSR)"] -pub const ERRF_ERRTYPE_NAND_DAMAGED: ERRF_ErrType = 1; -#[doc = "< Game content storage medium (cartridge and/or SD card) ejected. Not logged"] -pub const ERRF_ERRTYPE_CARD_REMOVED: ERRF_ErrType = 2; -#[doc = "< CPU or VFP exception"] -pub const ERRF_ERRTYPE_EXCEPTION: ERRF_ErrType = 3; -#[doc = "< Fatal error with a message instead of the caller's address"] -pub const ERRF_ERRTYPE_FAILURE: ERRF_ErrType = 4; -#[doc = "< Log-level failure. Does not display the exception and does not force the system to reboot"] -pub const ERRF_ERRTYPE_LOG_ONLY: ERRF_ErrType = 5; -#[doc = "Types of errors that can be thrown by err:f."] -pub type ERRF_ErrType = ::libc::c_uint; -#[doc = "< Prefetch Abort"] -pub const ERRF_EXCEPTION_PREFETCH_ABORT: ERRF_ExceptionType = 0; -#[doc = "< Data abort"] -pub const ERRF_EXCEPTION_DATA_ABORT: ERRF_ExceptionType = 1; -#[doc = "< Undefined instruction"] -pub const ERRF_EXCEPTION_UNDEFINED: ERRF_ExceptionType = 2; -#[doc = "< VFP (floating point) exception."] -pub const ERRF_EXCEPTION_VFP: ERRF_ExceptionType = 3; -#[doc = "Types of 'Exceptions' thrown for ERRF_ERRTYPE_EXCEPTION"] -pub type ERRF_ExceptionType = ::libc::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ERRF_ExceptionInfo { - #[doc = "< Type of the exception. One of the ERRF_EXCEPTION_* values."] - pub type_: ERRF_ExceptionType, - pub reserved: [u8_; 3usize], - #[doc = "< ifsr (prefetch abort) / dfsr (data abort)"] - pub fsr: u32_, - #[doc = "< pc = ifar (prefetch abort) / dfar (data abort)"] - pub far: u32_, - pub fpexc: u32_, - pub fpinst: u32_, - pub fpinst2: u32_, -} -impl Default for ERRF_ExceptionInfo { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ERRF_ExceptionData { - #[doc = "< Exception info struct"] - pub excep: ERRF_ExceptionInfo, - #[doc = "< CPU register dump."] - pub regs: CpuRegisters, -} -impl Default for ERRF_ExceptionData { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct ERRF_FatalErrInfo { - #[doc = "< Type, one of the ERRF_ERRTYPE_* enum"] - pub type_: ERRF_ErrType, - #[doc = "< High revison ID"] - pub revHigh: u8_, - #[doc = "< Low revision ID"] - pub revLow: u16_, - #[doc = "< Result code"] - pub resCode: u32_, - #[doc = "< PC address at exception"] - pub pcAddr: u32_, - #[doc = "< Process ID of the caller"] - pub procId: u32_, - #[doc = "< Title ID of the caller"] - pub titleId: u64_, - #[doc = "< Title ID of the running application"] - pub appTitleId: u64_, - #[doc = "< The different types of data for errors."] - pub data: ERRF_FatalErrInfo__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union ERRF_FatalErrInfo__bindgen_ty_1 { - #[doc = "< Data for when type is ERRF_ERRTYPE_EXCEPTION"] - pub exception_data: ERRF_ExceptionData, - #[doc = "< String for when type is ERRF_ERRTYPE_FAILURE"] - pub failure_mesg: [::libc::c_char; 96usize], -} -impl Default for ERRF_FatalErrInfo__bindgen_ty_1 { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl Default for ERRF_FatalErrInfo { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -extern "C" { - #[must_use] - #[doc = "Initializes ERR:f. Unless you plan to call ERRF_Throw yourself, do not use this."] - pub fn errfInit() -> Result; -} -extern "C" { - #[doc = "Exits ERR:f. Unless you plan to call ERRF_Throw yourself, do not use this."] - pub fn errfExit(); -} -extern "C" { - #[doc = "Gets the current err:f API session handle.\n # Returns\n\nThe current err:f API session handle."] - pub fn errfGetSessionHandle() -> *mut Handle; -} -extern "C" { - #[must_use] - #[doc = "Throws a system error and possibly logs it.\n # Arguments\n\n* `error` (direction in) - Error to throw.\n\n ErrDisp may convert the error info to ERRF_ERRTYPE_NAND_DAMAGED or ERRF_ERRTYPE_CARD_REMOVED\n depending on the error code.\n\n Except with ERRF_ERRTYPE_LOG_ONLY, the system will panic and will need to be rebooted.\n Fatal error information will also be logged into a file, unless the type either ERRF_ERRTYPE_NAND_DAMAGED\n or ERRF_ERRTYPE_CARD_REMOVED.\n\n No error will be shown if the system is asleep.\n\n On retail units with vanilla firmware, no detailed information will be displayed on screen.\n\n You may wish to use ERRF_ThrowResult() or ERRF_ThrowResultWithMessage() instead of\n constructing the ERRF_FatalErrInfo struct yourself."] - pub fn ERRF_Throw(error: *const ERRF_FatalErrInfo) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Throws (and logs) a system error with the given Result code.\n # Arguments\n\n* `failure` (direction in) - Result code to throw.\n\n This calls ERRF_Throw with error type ERRF_ERRTYPE_GENERIC and fills in the required data.\n\n This function _does_ fill in the address where this function was called from."] - pub fn ERRF_ThrowResult(failure: Result) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Logs a system error with the given Result code.\n # Arguments\n\n* `failure` (direction in) - Result code to log.\n\n Similar to ERRF_Throw, except that it does not display anything on the screen,\n nor does it force the system to reboot.\n\n This function _does_ fill in the address where this function was called from."] - pub fn ERRF_LogResult(failure: Result) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Throws a system error with the given Result code and message.\n # Arguments\n\n* `failure` (direction in) - Result code to throw.\n * `message` (direction in) - The message to display.\n\n This calls ERRF_Throw with error type ERRF_ERRTYPE_FAILURE and fills in the required data.\n\n This function does _not_ fill in the address where this function was called from because it\n would not be displayed."] - pub fn ERRF_ThrowResultWithMessage(failure: Result, message: *const ::libc::c_char) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Specify an additional user string to use for error reporting.\n # Arguments\n\n* `user_string` (direction in) - User string (up to 256 bytes, not including NUL byte)"] - pub fn ERRF_SetUserString(user_string: *const ::libc::c_char) -> Result; -} -extern "C" { - #[doc = "Handles an exception using ErrDisp.\n # Arguments\n\n* `excep` - Exception information\n * `regs` - CPU registers\n\n You might want to clear ENVINFO's bit0 to be able to see any debugging information.\n [`threadOnException`]"] - pub fn ERRF_ExceptionHandler(excep: *mut ERRF_ExceptionInfo, regs: *mut CpuRegisters) -> !; -} -#[doc = "Kernel configuration page (read-only)."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct osKernelConfig_s { - pub kernel_ver: u32_, - pub update_flag: u32_, - pub ns_tid: u64_, - pub kernel_syscore_ver: u32_, - pub env_info: u8_, - pub unit_info: u8_, - pub boot_env: u8_, - pub unk_0x17: u8_, - pub kernel_ctrsdk_ver: u32_, - pub unk_0x1c: u32_, - pub firmlaunch_flags: u32_, - pub unk_0x24: [u8_; 12usize], - pub app_memtype: u32_, - pub unk_0x34: [u8_; 12usize], - pub memregion_sz: [u32_; 3usize], - pub unk_0x4c: [u8_; 20usize], - pub firm_ver: u32_, - pub firm_syscore_ver: u32_, - pub firm_ctrsdk_ver: u32_, -} -#[doc = "Time reference information struct (filled in by PTM)."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct osTimeRef_s { - #[doc = "< Milliseconds elapsed since January 1900 when this structure was last updated"] - pub value_ms: u64_, - #[doc = "< System ticks elapsed since boot when this structure was last updated"] - pub value_tick: u64_, - #[doc = "< System clock frequency in Hz adjusted using RTC measurements (usually around SYSCLOCK_ARM11)"] - pub sysclock_hz: s64, - #[doc = "< Measured time drift of the system clock (according to the RTC) in milliseconds since the last update"] - pub drift_ms: s64, -} -#[doc = "Shared system configuration page structure (read-only or read-write depending on exheader)."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct osSharedConfig_s { - pub timeref_cnt: vu32, - pub running_hw: u8_, - pub mcu_hwinfo: u8_, - pub unk_0x06: [u8_; 26usize], - pub timeref: [osTimeRef_s; 2usize], - pub wifi_macaddr: [u8_; 6usize], - pub wifi_strength: vu8, - pub network_state: vu8, - pub unk_0x68: [u8_; 24usize], - pub slider_3d: f32, - pub led_3d: vu8, - pub led_battery: vu8, - pub unk_flag: vu8, - pub unk_0x87: u8_, - pub unk_0x88: [u8_; 24usize], - pub menu_tid: vu64, - pub cur_menu_tid: vu64, - pub unk_0xB0: [u8_; 16usize], - pub headset_connected: vu8, -} -#[doc = "Tick counter."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct TickCounter { - #[doc = "< Elapsed CPU ticks between measurements."] - pub elapsed: u64_, - #[doc = "< Point in time used as reference."] - pub reference: u64_, -} -#[doc = "OS_VersionBin. Format of the system version: \"..-\""] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -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" { - #[doc = "Converts an address from virtual (process) memory to physical memory.\n # Arguments\n\n* `vaddr` - Input virtual address.\n # Returns\n\nThe corresponding physical address.\n It is sometimes required by services or when using the GPU command buffer."] - pub fn osConvertVirtToPhys(vaddr: *const ::libc::c_void) -> u32_; -} -extern "C" { - #[doc = "Converts 0x14* vmem to 0x30*.\n # Arguments\n\n* `vaddr` - Input virtual address.\n # Returns\n\nThe corresponding address in the 0x30* range, the input address if it's already within the new vmem, or 0 if it's outside of both ranges."] - pub fn osConvertOldLINEARMemToNew(vaddr: *const ::libc::c_void) -> *mut ::libc::c_void; -} -extern "C" { - #[doc = "Retrieves basic information about a service error.\n # Arguments\n\n* `error` - Error to retrieve information about.\n # Returns\n\nA string containing a summary of an error.\n\n This can be used to get some details about an error returned by a service call."] - pub fn osStrError(error: Result) -> *const ::libc::c_char; -} -extern "C" { - #[doc = "Gets the system's FIRM version.\n # Returns\n\nThe system's FIRM version.\n\n This can be used to compare system versions easily with SYSTEM_VERSION."] - #[link_name = "osGetFirmVersion__extern"] - pub fn osGetFirmVersion() -> u32_; -} -extern "C" { - #[doc = "Gets the system's kernel version.\n # Returns\n\nThe system's kernel version.\n\n This can be used to compare system versions easily with SYSTEM_VERSION.\n\n if(osGetKernelVersion() > SYSTEM_VERSION(2,46,0)) printf(\"You are running 9.0 or higher"] - #[link_name = "osGetKernelVersion__extern"] - pub fn osGetKernelVersion() -> u32_; -} -extern "C" { - #[doc = "Gets the system's \"core version\" (2 on NATIVE_FIRM, 3 on SAFE_FIRM, etc.)"] - #[link_name = "osGetSystemCoreVersion__extern"] - pub fn osGetSystemCoreVersion() -> u32_; -} -extern "C" { - #[doc = "Gets the system's memory layout ID (0-5 on Old 3DS, 6-8 on New 3DS)"] - #[link_name = "osGetApplicationMemType__extern"] - pub fn osGetApplicationMemType() -> u32_; -} -extern "C" { - #[doc = "Gets the size of the specified memory region.\n # Arguments\n\n* `region` - Memory region to check.\n # Returns\n\nThe size of the memory region, in bytes."] - #[link_name = "osGetMemRegionSize__extern"] - pub fn osGetMemRegionSize(region: MemRegion) -> u32_; -} -extern "C" { - #[doc = "Gets the number of used bytes within the specified memory region.\n # Arguments\n\n* `region` - Memory region to check.\n # Returns\n\nThe number of used bytes of memory."] - #[link_name = "osGetMemRegionUsed__extern"] - pub fn osGetMemRegionUsed(region: MemRegion) -> u32_; -} -extern "C" { - #[doc = "Gets the number of free bytes within the specified memory region.\n # Arguments\n\n* `region` - Memory region to check.\n # Returns\n\nThe number of free bytes of memory."] - #[link_name = "osGetMemRegionFree__extern"] - pub fn osGetMemRegionFree(region: MemRegion) -> u32_; -} -extern "C" { - #[doc = "Reads the latest reference timepoint published by PTM.\n # Returns\n\nStructure (see osTimeRef_s)."] - pub fn osGetTimeRef() -> osTimeRef_s; -} -extern "C" { - #[doc = "Gets the current time.\n # Returns\n\nThe number of milliseconds since 1st Jan 1900 00:00."] - pub fn osGetTime() -> u64_; -} -extern "C" { - #[doc = "Starts a tick counter.\n # Arguments\n\n* `cnt` - The tick counter."] - #[link_name = "osTickCounterStart__extern"] - pub fn osTickCounterStart(cnt: *mut TickCounter); -} -extern "C" { - #[doc = "Updates the elapsed time in a tick counter.\n # Arguments\n\n* `cnt` - The tick counter."] - #[link_name = "osTickCounterUpdate__extern"] - pub fn osTickCounterUpdate(cnt: *mut TickCounter); -} -extern "C" { - #[doc = "Reads the elapsed time in a tick counter.\n # Arguments\n\n* `cnt` - The tick counter.\n # Returns\n\nThe number of milliseconds elapsed."] - pub fn osTickCounterRead(cnt: *const TickCounter) -> f64; -} -extern "C" { - #[doc = "Gets the current Wifi signal strength.\n # Returns\n\nThe current Wifi signal strength.\n\n Valid values are 0-3:\n - 0 means the signal strength is terrible or the 3DS is disconnected from\n all networks.\n - 1 means the signal strength is bad.\n - 2 means the signal strength is decent.\n - 3 means the signal strength is good.\n\n Values outside the range of 0-3 should never be returned.\n\n These values correspond with the number of wifi bars displayed by Home Menu."] - #[link_name = "osGetWifiStrength__extern"] - pub fn osGetWifiStrength() -> u8_; -} -extern "C" { - #[doc = "Gets the state of the 3D slider.\n # Returns\n\nThe state of the 3D slider (0.0~1.0)"] - #[link_name = "osGet3DSliderState__extern"] - pub fn osGet3DSliderState() -> f32; -} -extern "C" { - #[doc = "Checks whether a headset is connected.\n # Returns\n\ntrue or false."] - #[link_name = "osIsHeadsetConnected__extern"] - pub fn osIsHeadsetConnected() -> bool; -} -extern "C" { - #[doc = "Configures the New 3DS speedup.\n # Arguments\n\n* `enable` - Specifies whether to enable or disable the speedup."] - pub fn osSetSpeedupEnable(enable: bool); -} -extern "C" { - #[must_use] - #[doc = "Gets the NAND system-version stored in NVer/CVer.\n # Arguments\n\n* `nver_versionbin` - Output OS_VersionBin structure for the data read from NVer.\n * `cver_versionbin` - Output OS_VersionBin structure for the data read from CVer.\n # Returns\n\nThe result-code. This value can be positive if opening \"romfs:/version.bin\" fails with stdio, since errno would be returned in that case. In some cases the error can be special negative values as well."] - pub fn osGetSystemVersionData( - nver_versionbin: *mut OS_VersionBin, - cver_versionbin: *mut OS_VersionBin, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "This is a wrapper for osGetSystemVersionData.\n # Arguments\n\n* `nver_versionbin` - Optional output OS_VersionBin structure for the data read from NVer, can be NULL.\n * `cver_versionbin` - Optional output OS_VersionBin structure for the data read from CVer, can be NULL.\n * `sysverstr` - Output string where the printed system-version will be written, in the same format displayed by the System Settings title.\n * `sysverstr_maxsize` - Max size of the above string buffer, *including* NULL-terminator.\n # Returns\n\nSee osGetSystemVersionData."] - 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, Default, Copy, Clone)] -pub struct __lock_t { - pub lock: _LOCK_T, - pub thread_tag: u32, - pub counter: u32, -} -pub type _LOCK_RECURSIVE_T = __lock_t; -pub type _COND_T = u32; -extern "C" { - #[link_name = "__libc_lock_init__extern"] - pub fn __libc_lock_init(lock: *mut _LOCK_T); -} -extern "C" { - #[link_name = "__libc_lock_close__extern"] - pub fn __libc_lock_close(lock: *mut _LOCK_T); -} -extern "C" { - #[link_name = "__libc_lock_init_recursive__extern"] - pub fn __libc_lock_init_recursive(lock: *mut _LOCK_RECURSIVE_T); -} -extern "C" { - #[link_name = "__libc_lock_close_recursive__extern"] - 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; -} -extern "C" { - #[link_name = "__libc_cond_init__extern"] - pub fn __libc_cond_init(cond: *mut _COND_T) -> ::libc::c_int; -} -extern "C" { - pub fn __libc_cond_signal(cond: *mut _COND_T) -> ::libc::c_int; -} -extern "C" { - pub fn __libc_cond_broadcast(cond: *mut _COND_T) -> ::libc::c_int; -} -extern "C" { - pub fn __libc_cond_wait( - cond: *mut _COND_T, - lock: *mut _LOCK_T, - timeout_ns: u64, - ) -> ::libc::c_int; -} -extern "C" { - pub fn __libc_cond_wait_recursive( - cond: *mut _COND_T, - lock: *mut _LOCK_RECURSIVE_T, - timeout_ns: u64, - ) -> ::libc::c_int; -} -#[doc = "A light lock."] -pub type LightLock = _LOCK_T; -#[doc = "A recursive lock."] -pub type RecursiveLock = _LOCK_RECURSIVE_T; -#[doc = "A condition variable."] -pub type CondVar = s32; -#[doc = "A light event."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct LightEvent { - #[doc = "< State of the event: -2=cleared sticky, -1=cleared oneshot, 0=signaled oneshot, 1=signaled sticky"] - pub state: s32, - #[doc = "< Lock used for sticky timer operation"] - pub lock: LightLock, -} -#[doc = "A light semaphore."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct LightSemaphore { - #[doc = "< The current release count of the semaphore"] - pub current_count: s32, - #[doc = "< Number of threads concurrently acquiring the semaphore"] - pub num_threads_acq: s16, - #[doc = "< The maximum release count of the semaphore"] - pub max_count: s16, -} -extern "C" { - #[doc = "Performs a Data Synchronization Barrier operation."] - #[link_name = "__dsb__extern"] - pub fn __dsb(); -} -extern "C" { - #[doc = "Performs a Data Memory Barrier operation."] - #[link_name = "__dmb__extern"] - pub fn __dmb(); -} -extern "C" { - #[doc = "Performs a clrex operation."] - #[link_name = "__clrex__extern"] - pub fn __clrex(); -} -extern "C" { - #[doc = "Performs a ldrex operation.\n # Arguments\n\n* `addr` - Address to perform the operation on.\n # Returns\n\nThe resulting value."] - #[link_name = "__ldrex__extern"] - pub fn __ldrex(addr: *mut s32) -> s32; -} -extern "C" { - #[doc = "Performs a strex operation.\n # Arguments\n\n* `addr` - Address to perform the operation on.\n * `val` - Value to store.\n # Returns\n\nWhether the operation was successful."] - #[link_name = "__strex__extern"] - pub fn __strex(addr: *mut s32, val: s32) -> bool; -} -extern "C" { - #[doc = "Performs a ldrexh operation.\n # Arguments\n\n* `addr` - Address to perform the operation on.\n # Returns\n\nThe resulting value."] - #[link_name = "__ldrexh__extern"] - pub fn __ldrexh(addr: *mut u16_) -> u16_; -} -extern "C" { - #[doc = "Performs a strexh operation.\n # Arguments\n\n* `addr` - Address to perform the operation on.\n * `val` - Value to store.\n # Returns\n\nWhether the operation was successful."] - #[link_name = "__strexh__extern"] - pub fn __strexh(addr: *mut u16_, val: u16_) -> bool; -} -extern "C" { - #[doc = "Performs a ldrexb operation.\n # Arguments\n\n* `addr` - Address to perform the operation on.\n # Returns\n\nThe resulting value."] - #[link_name = "__ldrexb__extern"] - pub fn __ldrexb(addr: *mut u8_) -> u8_; -} -extern "C" { - #[doc = "Performs a strexb operation.\n # Arguments\n\n* `addr` - Address to perform the operation on.\n * `val` - Value to store.\n # Returns\n\nWhether the operation was successful."] - #[link_name = "__strexb__extern"] - pub fn __strexb(addr: *mut u8_, val: u8_) -> bool; -} -extern "C" { - #[must_use] - #[doc = "Function used to implement user-mode synchronization primitives.\n # Arguments\n\n* `addr` - Pointer to a signed 32-bit value whose address will be used to identify waiting threads.\n * `type` - Type of action to be performed by the arbiter\n * `value` - Number of threads to signal if using ARBITRATION_SIGNAL, or the value used for comparison.\n\n This will perform an arbitration based on #type. The comparisons are done between #value and the value at the address #addr.\n\n s32 val=0;\n // Does *nothing* since val >= 0\n syncArbitrateAddress(&val,ARBITRATION_WAIT_IF_LESS_THAN,0);\n > **Note:** Usage of this function entails an implicit Data Memory Barrier (dmb)."] - pub fn syncArbitrateAddress(addr: *mut s32, type_: ArbitrationType, value: s32) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Function used to implement user-mode synchronization primitives (with timeout).\n # Arguments\n\n* `addr` - Pointer to a signed 32-bit value whose address will be used to identify waiting threads.\n * `type` - Type of action to be performed by the arbiter (must use ARBITRATION_WAIT_IF_LESS_THAN_TIMEOUT or ARBITRATION_DECREMENT_AND_WAIT_IF_LESS_THAN_TIMEOUT)\n * `value` - Number of threads to signal if using ARBITRATION_SIGNAL, or the value used for comparison.\n\n This will perform an arbitration based on #type. The comparisons are done between #value and the value at the address #addr.\n\n s32 val=0;\n // Thread will wait for a signal or wake up after 10000000 nanoseconds because val < 1.\n syncArbitrateAddressWithTimeout(&val,ARBITRATION_WAIT_IF_LESS_THAN_TIMEOUT,1,10000000LL);\n > **Note:** Usage of this function entails an implicit Data Memory Barrier (dmb)."] - pub fn syncArbitrateAddressWithTimeout( - addr: *mut s32, - type_: ArbitrationType, - value: s32, - timeout_ns: s64, - ) -> Result; -} -extern "C" { - #[doc = "Initializes a light lock.\n # Arguments\n\n* `lock` - Pointer to the lock."] - pub fn LightLock_Init(lock: *mut LightLock); -} -extern "C" { - #[doc = "Locks a light lock.\n # Arguments\n\n* `lock` - Pointer to the lock."] - pub fn LightLock_Lock(lock: *mut LightLock); -} -extern "C" { - #[doc = "Attempts to lock a light lock.\n # Arguments\n\n* `lock` - Pointer to the lock.\n # Returns\n\nZero on success, non-zero on failure."] - pub fn LightLock_TryLock(lock: *mut LightLock) -> ::libc::c_int; -} -extern "C" { - #[doc = "Unlocks a light lock.\n # Arguments\n\n* `lock` - Pointer to the lock."] - pub fn LightLock_Unlock(lock: *mut LightLock); -} -extern "C" { - #[doc = "Initializes a recursive lock.\n # Arguments\n\n* `lock` - Pointer to the lock."] - pub fn RecursiveLock_Init(lock: *mut RecursiveLock); -} -extern "C" { - #[doc = "Locks a recursive lock.\n # Arguments\n\n* `lock` - Pointer to the lock."] - pub fn RecursiveLock_Lock(lock: *mut RecursiveLock); -} -extern "C" { - #[doc = "Attempts to lock a recursive lock.\n # Arguments\n\n* `lock` - Pointer to the lock.\n # Returns\n\nZero on success, non-zero on failure."] - pub fn RecursiveLock_TryLock(lock: *mut RecursiveLock) -> ::libc::c_int; -} -extern "C" { - #[doc = "Unlocks a recursive lock.\n # Arguments\n\n* `lock` - Pointer to the lock."] - pub fn RecursiveLock_Unlock(lock: *mut RecursiveLock); -} -extern "C" { - #[doc = "Initializes a condition variable.\n # Arguments\n\n* `cv` - Pointer to the condition variable."] - pub fn CondVar_Init(cv: *mut CondVar); -} -extern "C" { - #[doc = "Waits on a condition variable.\n # Arguments\n\n* `cv` - Pointer to the condition variable.\n * `lock` - Pointer to the lock to atomically unlock/relock during the wait."] - pub fn CondVar_Wait(cv: *mut CondVar, lock: *mut LightLock); -} -extern "C" { - #[doc = "Waits on a condition variable with a timeout.\n # Arguments\n\n* `cv` - Pointer to the condition variable.\n * `lock` - Pointer to the lock to atomically unlock/relock during the wait.\n * `timeout_ns` - Timeout in nanoseconds.\n # Returns\n\nZero on success, non-zero on failure."] - pub fn CondVar_WaitTimeout( - cv: *mut CondVar, - lock: *mut LightLock, - timeout_ns: s64, - ) -> ::libc::c_int; -} -extern "C" { - #[doc = "Wakes up threads waiting on a condition variable.\n # Arguments\n\n* `cv` - Pointer to the condition variable.\n * `num_threads` - Maximum number of threads to wake up (or ARBITRATION_SIGNAL_ALL to wake them all)."] - pub fn CondVar_WakeUp(cv: *mut CondVar, num_threads: s32); -} -extern "C" { - #[doc = "Wakes up a single thread waiting on a condition variable.\n # Arguments\n\n* `cv` - Pointer to the condition variable."] - #[link_name = "CondVar_Signal__extern"] - pub fn CondVar_Signal(cv: *mut CondVar); -} -extern "C" { - #[doc = "Wakes up all threads waiting on a condition variable.\n # Arguments\n\n* `cv` - Pointer to the condition variable."] - #[link_name = "CondVar_Broadcast__extern"] - pub fn CondVar_Broadcast(cv: *mut CondVar); -} -extern "C" { - #[doc = "Initializes a light event.\n # Arguments\n\n* `event` - Pointer to the event.\n * `reset_type` - Type of reset the event uses (RESET_ONESHOT/RESET_STICKY)."] - pub fn LightEvent_Init(event: *mut LightEvent, reset_type: ResetType); -} -extern "C" { - #[doc = "Clears a light event.\n # Arguments\n\n* `event` - Pointer to the event."] - pub fn LightEvent_Clear(event: *mut LightEvent); -} -extern "C" { - #[doc = "Wakes up threads waiting on a sticky light event without signaling it. If the event had been signaled before, it is cleared instead.\n # Arguments\n\n* `event` - Pointer to the event."] - pub fn LightEvent_Pulse(event: *mut LightEvent); -} -extern "C" { - #[doc = "Signals a light event, waking up threads waiting on it.\n # Arguments\n\n* `event` - Pointer to the event."] - pub fn LightEvent_Signal(event: *mut LightEvent); -} -extern "C" { - #[doc = "Attempts to wait on a light event.\n # Arguments\n\n* `event` - Pointer to the event.\n # Returns\n\nNon-zero if the event was signaled, zero otherwise."] - pub fn LightEvent_TryWait(event: *mut LightEvent) -> ::libc::c_int; -} -extern "C" { - #[doc = "Waits on a light event.\n # Arguments\n\n* `event` - Pointer to the event."] - pub fn LightEvent_Wait(event: *mut LightEvent); -} -extern "C" { - #[doc = "Waits on a light event until either the event is signaled or the timeout is reached.\n # Arguments\n\n* `event` - Pointer to the event.\n * `timeout_ns` - Timeout in nanoseconds.\n # Returns\n\nNon-zero on timeout, zero otherwise."] - pub fn LightEvent_WaitTimeout(event: *mut LightEvent, timeout_ns: s64) -> ::libc::c_int; -} -extern "C" { - #[doc = "Initializes a light semaphore.\n # Arguments\n\n* `event` - Pointer to the semaphore.\n * `max_count` - Initial count of the semaphore.\n * `max_count` - Maximum count of the semaphore."] - pub fn LightSemaphore_Init(semaphore: *mut LightSemaphore, initial_count: s16, max_count: s16); -} -extern "C" { - #[doc = "Acquires a light semaphore.\n # Arguments\n\n* `semaphore` - Pointer to the semaphore.\n * `count` - Acquire count"] - pub fn LightSemaphore_Acquire(semaphore: *mut LightSemaphore, count: s32); -} -extern "C" { - #[doc = "Attempts to acquire a light semaphore.\n # Arguments\n\n* `semaphore` - Pointer to the semaphore.\n * `count` - Acquire count\n # Returns\n\nZero on success, non-zero on failure"] - pub fn LightSemaphore_TryAcquire(semaphore: *mut LightSemaphore, count: s32) -> ::libc::c_int; -} -extern "C" { - #[doc = "Releases a light semaphore.\n # Arguments\n\n* `semaphore` - Pointer to the semaphore.\n * `count` - Release count"] - pub fn LightSemaphore_Release(semaphore: *mut LightSemaphore, count: s32); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Thread_tag { - _unused: [u8; 0], -} -#[doc = "libctru thread handle type"] -pub type Thread = *mut Thread_tag; -#[doc = "Exception handler type, necessarily an ARM function that does not return."] -pub type ExceptionHandler = ::core::option::Option< - unsafe extern "C" fn(excep: *mut ERRF_ExceptionInfo, regs: *mut CpuRegisters), ->; -extern "C" { - #[doc = "Creates a new libctru thread.\n # Arguments\n\n* `entrypoint` - The function that will be called first upon thread creation\n * `arg` - The argument passed to `entrypoint`\n * `stack_size` - The size of the stack that will be allocated for the thread (will be rounded to a multiple of 8 bytes)\n * `prio` - Low values gives the thread higher priority.\n For userland apps, this has to be within the range [0x18;0x3F].\n The main thread usually has a priority of 0x30, but not always. Use svcGetThreadPriority() if you need\n to create a thread with a priority that is explicitly greater or smaller than that of the main thread.\n * `core_id` - The ID of the processor the thread should be ran on. Processor IDs are labeled starting from 0.\n On Old3DS it must be <2, and on New3DS it must be <4.\n Pass -1 to execute the thread on all CPUs and -2 to execute the thread on the default CPU (read from the Exheader).\n * `detached` - When set to true, the thread is automatically freed when it finishes.\n # Returns\n\nThe libctru thread handle on success, NULL on failure.\n\n - Processor #0 is the application core. It is always possible to create a thread on this core.\n - Processor #1 is the system core. If APT_SetAppCpuTimeLimit is used, it is possible to create a single thread on this core.\n - Processor #2 is New3DS exclusive. Normal applications can create threads on this core if the exheader kernel flags bitmask has 0x2000 set.\n - Processor #3 is New3DS exclusive. Normal applications cannot create threads on this core.\n - Processes in the BASE memory region can always create threads on processors #2 and #3.\n\n > **Note:** Default exit code of a thread is 0.\n svcExitThread should never be called from the thread, use threadExit instead."] - pub fn threadCreate( - entrypoint: ThreadFunc, - arg: *mut ::libc::c_void, - stack_size: usize, - prio: ::libc::c_int, - core_id: ::libc::c_int, - detached: bool, - ) -> Thread; -} -extern "C" { - #[doc = "Retrieves the OS thread handle of a libctru thread.\n # Arguments\n\n* `thread` - libctru thread handle\n # Returns\n\nOS thread handle"] - pub fn threadGetHandle(thread: Thread) -> Handle; -} -extern "C" { - #[doc = "Retrieves the exit code of a finished libctru thread.\n # Arguments\n\n* `thread` - libctru thread handle\n # Returns\n\nExit code"] - pub fn threadGetExitCode(thread: Thread) -> ::libc::c_int; -} -extern "C" { - #[doc = "Frees a finished libctru thread.\n # Arguments\n\n* `thread` - libctru thread handle\n > This function should not be called if the thread is detached, as it is freed automatically when it finishes."] - pub fn threadFree(thread: Thread); -} -extern "C" { - #[must_use] - #[doc = "Waits for a libctru thread to finish (or returns immediately if it is already finished).\n # Arguments\n\n* `thread` - libctru thread handle\n * `timeout_ns` - Timeout in nanoseconds. Pass U64_MAX if a timeout isn't desired"] - pub fn threadJoin(thread: Thread, timeout_ns: u64_) -> Result; -} -extern "C" { - #[doc = "Changes a thread's status from attached to detached.\n # Arguments\n\n* `thread` - libctru thread handle"] - pub fn threadDetach(thread: Thread); -} -extern "C" { - #[doc = "Retrieves the libctru thread handle of the current thread.\n # Returns\n\nlibctru thread handle of the current thread, or NULL for the main thread"] - pub fn threadGetCurrent() -> Thread; -} -extern "C" { - #[doc = "Exits the current libctru thread with an exit code (not usable from the main thread).\n # Arguments\n\n* `rc` - Exit code"] - pub fn threadExit(rc: ::libc::c_int) -> !; -} -extern "C" { - #[doc = "Sets the exception handler for the current thread. Called from the main thread, this sets the default handler.\n # Arguments\n\n* `handler` - The exception handler, necessarily an ARM function that does not return\n * `stack_top` - A pointer to the top of the stack that will be used by the handler. See also RUN_HANDLER_ON_FAULTING_STACK\n * `exception_data` - A pointer to the buffer that will contain the exception data.\nSee also WRITE_DATA_TO_HANDLER_STACK and WRITE_DATA_TO_FAULTING_STACK\n\n To have CPU exceptions reported through this mechanism, it is normally necessary that UNITINFO is set to a non-zero value when Kernel11 starts,\n and this mechanism is also controlled by svcKernelSetState type 6, see 3dbrew.\n\n VFP exceptions are always reported this way even if the process is being debugged using the debug SVCs.\n\n The current thread need not be a libctru thread."] - #[link_name = "threadOnException__extern"] - pub fn threadOnException( - handler: ExceptionHandler, - stack_top: *mut ::libc::c_void, - exception_data: *mut ERRF_ExceptionData, - ); -} -#[doc = "Framebuffer information."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GSPGPU_FramebufferInfo { - #[doc = "< Active framebuffer. (0 = first, 1 = second)"] - pub active_framebuf: u32_, - #[doc = "< Framebuffer virtual address, for the main screen this is the 3D left framebuffer."] - pub framebuf0_vaddr: *mut u32_, - #[doc = "< For the main screen: 3D right framebuffer address."] - pub framebuf1_vaddr: *mut u32_, - #[doc = "< Value for 0x1EF00X90, controls framebuffer width."] - pub framebuf_widthbytesize: u32_, - #[doc = "< Framebuffer format, this u16 is written to the low u16 for LCD register 0x1EF00X70."] - pub format: u32_, - #[doc = "< Value for 0x1EF00X78, controls which framebuffer is displayed."] - pub framebuf_dispselect: u32_, - #[doc = "< Unknown."] - pub unk: u32_, -} -impl Default for GSPGPU_FramebufferInfo { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "< RGBA8. (4 bytes)"] -pub const GSP_RGBA8_OES: GSPGPU_FramebufferFormat = 0; -#[doc = "< BGR8. (3 bytes)"] -pub const GSP_BGR8_OES: GSPGPU_FramebufferFormat = 1; -#[doc = "< RGB565. (2 bytes)"] -pub const GSP_RGB565_OES: GSPGPU_FramebufferFormat = 2; -#[doc = "< RGB5A1. (2 bytes)"] -pub const GSP_RGB5_A1_OES: GSPGPU_FramebufferFormat = 3; -#[doc = "< RGBA4. (2 bytes)"] -pub const GSP_RGBA4_OES: GSPGPU_FramebufferFormat = 4; -#[doc = "Framebuffer format."] -pub type GSPGPU_FramebufferFormat = ::libc::c_uint; -#[doc = "Capture info entry."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GSPGPU_CaptureInfoEntry { - #[doc = "< Left framebuffer."] - pub framebuf0_vaddr: *mut u32_, - #[doc = "< Right framebuffer."] - pub framebuf1_vaddr: *mut u32_, - #[doc = "< Framebuffer format."] - pub format: u32_, - #[doc = "< Framebuffer pitch."] - pub framebuf_widthbytesize: u32_, -} -impl Default for GSPGPU_CaptureInfoEntry { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "Capture info."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GSPGPU_CaptureInfo { - #[doc = "< Capture info entries, one for each screen."] - pub screencapture: [GSPGPU_CaptureInfoEntry; 2usize], -} -impl Default for GSPGPU_CaptureInfo { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "< Memory fill completed."] -pub const GSPGPU_EVENT_PSC0: GSPGPU_Event = 0; -#[doc = "< TODO"] -pub const GSPGPU_EVENT_PSC1: GSPGPU_Event = 1; -#[doc = "< TODO"] -pub const GSPGPU_EVENT_VBlank0: GSPGPU_Event = 2; -#[doc = "< TODO"] -pub const GSPGPU_EVENT_VBlank1: GSPGPU_Event = 3; -#[doc = "< Display transfer finished."] -pub const GSPGPU_EVENT_PPF: GSPGPU_Event = 4; -#[doc = "< Command list processing finished."] -pub const GSPGPU_EVENT_P3D: GSPGPU_Event = 5; -#[doc = "< TODO"] -pub const GSPGPU_EVENT_DMA: GSPGPU_Event = 6; -#[doc = "< Used to know how many events there are."] -pub const GSPGPU_EVENT_MAX: GSPGPU_Event = 7; -#[doc = "GSPGPU events."] -pub type GSPGPU_Event = ::libc::c_uint; -extern "C" { - #[doc = "Gets the number of bytes per pixel for the specified format.\n # Arguments\n\n* `format` - See GSPGPU_FramebufferFormat.\n # Returns\n\nBytes per pixel."] - #[link_name = "gspGetBytesPerPixel__extern"] - pub fn gspGetBytesPerPixel(format: GSPGPU_FramebufferFormat) -> ::libc::c_uint; -} -extern "C" { - #[must_use] - #[doc = "Initializes GSPGPU."] - pub fn gspInit() -> Result; -} -extern "C" { - #[doc = "Exits GSPGPU."] - pub fn gspExit(); -} -extern "C" { - #[doc = "Gets a pointer to the current gsp::Gpu session handle.\n # Returns\n\nA pointer to the current gsp::Gpu session handle."] - pub fn gspGetSessionHandle() -> *mut Handle; -} -extern "C" { - #[doc = "Returns true if the application currently has GPU rights."] - pub fn gspHasGpuRight() -> bool; -} -extern "C" { - #[doc = "Presents a buffer to the specified screen.\n # Arguments\n\n* `screen` - Screen ID (see GSP_SCREEN_TOP and GSP_SCREEN_BOTTOM)\n * `swap` - Specifies which set of framebuffer registers to configure and activate (0 or 1)\n * `fb_a` - Pointer to the framebuffer (in stereo mode: left eye)\n * `fb_b` - Pointer to the secondary framebuffer (only used in stereo mode for the right eye, otherwise pass the same as fb_a)\n * `stride` - Stride in bytes between scanlines\n * `mode` - Mode configuration to be written to LCD register\n # Returns\n\ntrue if a buffer had already been presented to the screen but not processed yet by GSP, false otherwise.\n > **Note:** The most recently presented buffer is processed and configured during the specified screen's next VBlank event."] - pub fn gspPresentBuffer( - screen: ::libc::c_uint, - swap: ::libc::c_uint, - fb_a: *const ::libc::c_void, - fb_b: *const ::libc::c_void, - stride: u32_, - mode: u32_, - ) -> bool; -} -extern "C" { - #[doc = "Returns true if a prior gspPresentBuffer command is still pending to be processed by GSP.\n # Arguments\n\n* `screen` - Screen ID (see GSP_SCREEN_TOP and GSP_SCREEN_BOTTOM)"] - pub fn gspIsPresentPending(screen: ::libc::c_uint) -> bool; -} -extern "C" { - #[doc = "Configures a callback to run when a GSPGPU event occurs.\n # Arguments\n\n* `id` - ID of the event.\n * `cb` - Callback to run.\n * `data` - Data to be passed to the callback.\n * `oneShot` - When true, the callback is only executed once. When false, the callback is executed every time the event occurs."] - pub fn gspSetEventCallback( - id: GSPGPU_Event, - cb: ThreadFunc, - data: *mut ::libc::c_void, - oneShot: bool, - ); -} -extern "C" { - #[doc = "Waits for a GSPGPU event to occur.\n # Arguments\n\n* `id` - ID of the event.\n * `nextEvent` - Whether to discard the current event and wait for the next event."] - pub fn gspWaitForEvent(id: GSPGPU_Event, nextEvent: bool); -} -extern "C" { - #[doc = "Waits for any GSPGPU event to occur.\n # Returns\n\nThe ID of the event that occurred.\n\n The function returns immediately if there are unprocessed events at the time of call."] - pub fn gspWaitForAnyEvent() -> GSPGPU_Event; -} -extern "C" { - #[must_use] - #[doc = "Submits a GX command.\n # Arguments\n\n* `gxCommand` - GX command to execute."] - pub fn gspSubmitGxCommand(gxCommand: *const u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Acquires GPU rights.\n # Arguments\n\n* `flags` - Flags to acquire with."] - pub fn GSPGPU_AcquireRight(flags: u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Releases GPU rights."] - pub fn GSPGPU_ReleaseRight() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Retrieves display capture info.\n # Arguments\n\n* `captureinfo` - Pointer to output capture info to."] - pub fn GSPGPU_ImportDisplayCaptureInfo(captureinfo: *mut GSPGPU_CaptureInfo) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Saves the VRAM sys area."] - pub fn GSPGPU_SaveVramSysArea() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Resets the GPU"] - pub fn GSPGPU_ResetGpuCore() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Restores the VRAM sys area."] - pub fn GSPGPU_RestoreVramSysArea() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets whether to force the LCD to black.\n # Arguments\n\n* `flags` - Whether to force the LCD to black. (0 = no, non-zero = yes)"] - pub fn GSPGPU_SetLcdForceBlack(flags: u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Updates a screen's framebuffer state.\n # Arguments\n\n* `screenid` - ID of the screen to update.\n * `framebufinfo` - Framebuffer information to update with."] - pub fn GSPGPU_SetBufferSwap( - screenid: u32_, - framebufinfo: *const GSPGPU_FramebufferInfo, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Flushes memory from the data cache.\n # Arguments\n\n* `adr` - Address to flush.\n * `size` - Size of the memory to flush."] - pub fn GSPGPU_FlushDataCache(adr: *const ::libc::c_void, size: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Invalidates memory in the data cache.\n # Arguments\n\n* `adr` - Address to invalidate.\n * `size` - Size of the memory to invalidate."] - pub fn GSPGPU_InvalidateDataCache(adr: *const ::libc::c_void, size: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Writes to GPU hardware registers.\n # Arguments\n\n* `regAddr` - Register address to write to.\n * `data` - Data to write.\n * `size` - Size of the data to write."] - pub fn GSPGPU_WriteHWRegs(regAddr: u32_, data: *const u32_, size: u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Writes to GPU hardware registers with a mask.\n # Arguments\n\n* `regAddr` - Register address to write to.\n * `data` - Data to write.\n * `datasize` - Size of the data to write.\n * `maskdata` - Data of the mask.\n * `masksize` - Size of the mask."] - pub fn GSPGPU_WriteHWRegsWithMask( - regAddr: u32_, - data: *const u32_, - datasize: u8_, - maskdata: *const u32_, - masksize: u8_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Reads from GPU hardware registers.\n # Arguments\n\n* `regAddr` - Register address to read from.\n * `data` - Buffer to read data to.\n * `size` - Size of the buffer."] - pub fn GSPGPU_ReadHWRegs(regAddr: u32_, data: *mut u32_, size: u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Registers the interrupt relay queue.\n # Arguments\n\n* `eventHandle` - Handle of the GX command event.\n * `flags` - Flags to register with.\n * `outMemHandle` - Pointer to output the shared memory handle to.\n * `threadID` - Pointer to output the GSP thread ID to."] - pub fn GSPGPU_RegisterInterruptRelayQueue( - eventHandle: Handle, - flags: u32_, - outMemHandle: *mut Handle, - threadID: *mut u8_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Unregisters the interrupt relay queue."] - pub fn GSPGPU_UnregisterInterruptRelayQueue() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Triggers a handling of commands written to shared memory."] - pub fn GSPGPU_TriggerCmdReqQueue() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets 3D_LEDSTATE to the input state value.\n # Arguments\n\n* `disable` - False = 3D LED enable, true = 3D LED disable."] - pub fn GSPGPU_SetLedForceOff(disable: bool) -> Result; -} -#[doc = "< Top screen"] -pub const GFX_TOP: gfxScreen_t = 0; -#[doc = "< Bottom screen"] -pub const GFX_BOTTOM: gfxScreen_t = 1; -#[doc = "Screen IDs."] -pub type gfxScreen_t = ::libc::c_uint; -#[doc = "< Left eye framebuffer"] -pub const GFX_LEFT: gfx3dSide_t = 0; -#[doc = "< Right eye framebuffer"] -pub const GFX_RIGHT: gfx3dSide_t = 1; -#[doc = "Top screen framebuffer side.\n\n This is only meaningful when stereoscopic 3D is enabled on the top screen.\n In any other case, use GFX_LEFT."] -pub type gfx3dSide_t = ::libc::c_uint; -extern "C" { - #[doc = "Initializes the LCD framebuffers with default parameters\n This is equivalent to calling: gfxInit(GSP_BGR8_OES,GSP_BGR8_OES,false); "] - pub fn gfxInitDefault(); -} -extern "C" { - #[doc = "Initializes the LCD framebuffers.\n # Arguments\n\n* `topFormat` - The format of the top screen framebuffers.\n * `bottomFormat` - The format of the bottom screen framebuffers.\n * `vramBuffers` - Whether to allocate the framebuffers in VRAM.\n\n This function allocates memory for the framebuffers in the specified memory region.\n Initially, stereoscopic 3D is disabled and double buffering is enabled.\n\n > **Note:** This function internally calls gspInit."] - pub fn gfxInit( - topFormat: GSPGPU_FramebufferFormat, - bottomFormat: GSPGPU_FramebufferFormat, - vrambuffers: bool, - ); -} -extern "C" { - #[doc = "Deinitializes and frees the LCD framebuffers.\n > **Note:** This function internally calls gspExit."] - pub fn gfxExit(); -} -extern "C" { - #[doc = "Enables or disables the 3D stereoscopic effect on the top screen.\n # Arguments\n\n* `enable` - Pass true to enable, false to disable.\n > **Note:** Stereoscopic 3D is disabled by default."] - pub fn gfxSet3D(enable: bool); -} -extern "C" { - #[doc = "Retrieves the status of the 3D stereoscopic effect on the top screen.\n # Returns\n\ntrue if 3D enabled, false otherwise."] - pub fn gfxIs3D() -> bool; -} -extern "C" { - #[doc = "Retrieves the status of the 800px (double-height) high resolution display mode of the top screen.\n # Returns\n\ntrue if wide mode enabled, false otherwise."] - pub fn gfxIsWide() -> bool; -} -extern "C" { - #[doc = "Enables or disables the 800px (double-height) high resolution display mode of the top screen.\n # Arguments\n\n* `enable` - Pass true to enable, false to disable.\n > **Note:** Wide mode is disabled by default.\n > **Note:** Wide and stereoscopic 3D modes are mutually exclusive.\n > **Note:** In wide mode pixels are not square, since scanlines are half as tall as they normally are.\n Wide mode does not work on Old 2DS consoles (however it does work on New 2DS XL consoles)."] - pub fn gfxSetWide(enable: bool); -} -extern "C" { - #[doc = "Changes the pixel format of a screen.\n # Arguments\n\n* `screen` - Screen ID (see gfxScreen_t)\n * `format` - Pixel format (see GSPGPU_FramebufferFormat)\n > **Note:** If the currently allocated framebuffers are too small for the specified format,\n they are freed and new ones are reallocated."] - pub fn gfxSetScreenFormat(screen: gfxScreen_t, format: GSPGPU_FramebufferFormat); -} -extern "C" { - #[doc = "Retrieves the current pixel format of a screen.\n # Arguments\n\n* `screen` - Screen ID (see gfxScreen_t)\n # Returns\n\nPixel format (see GSPGPU_FramebufferFormat)"] - pub fn gfxGetScreenFormat(screen: gfxScreen_t) -> GSPGPU_FramebufferFormat; -} -extern "C" { - #[doc = "Enables or disables double buffering on a screen.\n # Arguments\n\n* `screen` - Screen ID (see gfxScreen_t)\n * `enable` - Pass true to enable, false to disable.\n > **Note:** Double buffering is enabled by default."] - pub fn gfxSetDoubleBuffering(screen: gfxScreen_t, enable: bool); -} -extern "C" { - #[doc = "Retrieves the framebuffer of the specified screen to which graphics should be rendered.\n # Arguments\n\n* `screen` - Screen ID (see gfxScreen_t)\n * `side` - Framebuffer side (see gfx3dSide_t) (pass GFX_LEFT if not using stereoscopic 3D)\n * `width` - Pointer that will hold the width of the framebuffer in pixels.\n * `height` - Pointer that will hold the height of the framebuffer in pixels.\n # Returns\n\nA pointer to the current framebuffer of the chosen screen.\n\n Please remember that the returned pointer will change every frame if double buffering is enabled."] - pub fn gfxGetFramebuffer( - screen: gfxScreen_t, - side: gfx3dSide_t, - width: *mut u16_, - height: *mut u16_, - ) -> *mut u8_; -} -extern "C" { - #[doc = "Flushes the data cache for the current framebuffers.\n This is **only used during software rendering**. Since this function has significant overhead,\n it is preferred to call this only once per frame, after all software rendering is completed."] - pub fn gfxFlushBuffers(); -} -extern "C" { - #[doc = "Updates the configuration of the specified screen, swapping the buffers if double buffering is enabled.\n # Arguments\n\n* `scr` - Screen ID (see gfxScreen_t)\n * `hasStereo` - For the top screen in 3D mode: true if the framebuffer contains individual images\n for both eyes, or false if the left image should be duplicated to the right eye.\n > **Note:** Previously rendered content will be displayed on the screen after the next VBlank.\n > **Note:** This function is still useful even if double buffering is disabled, as it must be used to commit configuration changes.\n Only call this once per screen per frame, otherwise graphical glitches will occur\n since this API does not implement triple buffering."] - pub fn gfxScreenSwapBuffers(scr: gfxScreen_t, hasStereo: bool); -} -extern "C" { - #[doc = "Same as gfxScreenSwapBuffers, but with hasStereo set to true.\n # Arguments\n\n* `scr` - Screen ID (see gfxScreen_t)\n * `immediate` - This parameter no longer has any effect and is thus ignored.\n > **Deprecated** This function has been superseded by gfxScreenSwapBuffers, please use that instead."] - pub fn gfxConfigScreen(scr: gfxScreen_t, immediate: bool); -} -extern "C" { - #[doc = "Updates the configuration of both screens.\n > **Note:** This function is equivalent to: gfxScreenSwapBuffers(GFX_TOP,true); gfxScreenSwapBuffers(GFX_BOTTOM,true); "] - pub fn gfxSwapBuffers(); -} -extern "C" { - #[doc = "Same as gfxSwapBuffers (formerly different)."] - pub fn gfxSwapBuffersGpu(); -} -#[doc = "A callback for printing a character."] -pub type ConsolePrint = ::core::option::Option< - unsafe extern "C" fn(con: *mut ::libc::c_void, c: ::libc::c_int) -> bool, ->; -#[doc = "A font struct for the console."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ConsoleFont { - #[doc = "< A pointer to the font graphics"] - pub gfx: *mut u8_, - #[doc = "< Offset to the first valid character in the font table"] - pub asciiOffset: u16_, - #[doc = "< Number of characters in the font graphics"] - pub numChars: u16_, -} -impl Default for ConsoleFont { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "Console structure used to store the state of a console render context.\n\n Default values from consoleGetDefault();\n PrintConsole defaultConsole =\n {\n \t//Font:\n \t{\n \t\t(u8*)default_font_bin, //font gfx\n \t\t0, //first ascii character in the set\n \t\t128, //number of characters in the font set\n\t},\n\t0,0, //cursorX cursorY\n\t0,0, //prevcursorX prevcursorY\n\t40, //console width\n\t30, //console height\n\t0, //window x\n\t0, //window y\n\t32, //window width\n\t24, //window height\n\t3, //tab size\n\t0, //font character offset\n\t0, //print callback\n\tfalse //console initialized\n };\n "] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct PrintConsole { - #[doc = "< Font of the console"] - pub font: ConsoleFont, - #[doc = "< Framebuffer address"] - pub frameBuffer: *mut u16_, - #[doc = "< Current X location of the cursor (as a tile offset by default)"] - pub cursorX: ::libc::c_int, - #[doc = "< Current Y location of the cursor (as a tile offset by default)"] - pub cursorY: ::libc::c_int, - #[doc = "< Internal state"] - pub prevCursorX: ::libc::c_int, - #[doc = "< Internal state"] - pub prevCursorY: ::libc::c_int, - #[doc = "< Width of the console hardware layer in characters"] - pub consoleWidth: ::libc::c_int, - #[doc = "< Height of the console hardware layer in characters"] - pub consoleHeight: ::libc::c_int, - #[doc = "< Window X location in characters (not implemented)"] - pub windowX: ::libc::c_int, - #[doc = "< Window Y location in characters (not implemented)"] - pub windowY: ::libc::c_int, - #[doc = "< Window width in characters (not implemented)"] - pub windowWidth: ::libc::c_int, - #[doc = "< Window height in characters (not implemented)"] - pub windowHeight: ::libc::c_int, - #[doc = "< Size of a tab"] - pub tabSize: ::libc::c_int, - #[doc = "< Foreground color"] - pub fg: u16_, - #[doc = "< Background color"] - pub bg: u16_, - #[doc = "< Reverse/bright flags"] - pub flags: ::libc::c_int, - #[doc = "< Callback for printing a character. Should return true if it has handled rendering the graphics (else the print engine will attempt to render via tiles)."] - pub PrintChar: ConsolePrint, - #[doc = "< True if the console is initialized"] - pub consoleInitialised: bool, -} -impl Default for PrintConsole { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "< Swallows prints to stderr"] -pub const debugDevice_NULL: debugDevice = 0; -#[doc = "< Outputs stderr debug statements using svcOutputDebugString, which can then be captured by interactive debuggers"] -pub const debugDevice_SVC: debugDevice = 1; -#[doc = "< Directs stderr debug statements to 3DS console window"] -pub const debugDevice_CONSOLE: debugDevice = 2; -pub const debugDevice_3DMOO: debugDevice = 1; -#[doc = "Console debug devices supported by libnds."] -pub type debugDevice = ::libc::c_uint; -extern "C" { - #[doc = "Loads the font into the console.\n # Arguments\n\n* `console` - Pointer to the console to update, if NULL it will update the current console.\n * `font` - The font to load."] - pub fn consoleSetFont(console: *mut PrintConsole, font: *mut ConsoleFont); -} -extern "C" { - #[doc = "Sets the print window.\n # Arguments\n\n* `console` - Console to set, if NULL it will set the current console window.\n * `x` - X location of the window.\n * `y` - Y location of the window.\n * `width` - Width of the window.\n * `height` - Height of the window."] - pub fn consoleSetWindow( - console: *mut PrintConsole, - x: ::libc::c_int, - y: ::libc::c_int, - width: ::libc::c_int, - height: ::libc::c_int, - ); -} -extern "C" { - #[doc = "Gets a pointer to the console with the default values.\n This should only be used when using a single console or without changing the console that is returned, otherwise use consoleInit().\n # Returns\n\nA pointer to the console with the default values."] - pub fn consoleGetDefault() -> *mut PrintConsole; -} -extern "C" { - #[doc = "Make the specified console the render target.\n # Arguments\n\n* `console` - A pointer to the console struct (must have been initialized with consoleInit(PrintConsole* console)).\n # Returns\n\nA pointer to the previous console."] - pub fn consoleSelect(console: *mut PrintConsole) -> *mut PrintConsole; -} -extern "C" { - #[doc = "Initialise the console.\n # Arguments\n\n* `screen` - The screen to use for the console.\n * `console` - A pointer to the console data to initialize (if it's NULL, the default console will be used).\n # Returns\n\nA pointer to the current console."] - pub fn consoleInit(screen: gfxScreen_t, console: *mut PrintConsole) -> *mut PrintConsole; -} -extern "C" { - #[doc = "Initializes debug console output on stderr to the specified device.\n # Arguments\n\n* `device` - The debug device (or devices) to output debug print statements to."] - pub fn consoleDebugInit(device: debugDevice); -} -extern "C" { - #[doc = "Clears the screen by using iprintf(\""] - pub fn consoleClear(); -} -#[doc = "< Use APT workaround."] -pub const RUNFLAG_APTWORKAROUND: _bindgen_ty_9 = 1; -#[doc = "< Reinitialize APT."] -pub const RUNFLAG_APTREINIT: _bindgen_ty_9 = 2; -#[doc = "< Chainload APT on return."] -pub const RUNFLAG_APTCHAINLOAD: _bindgen_ty_9 = 4; -#[doc = "System run-flags."] -pub type _bindgen_ty_9 = ::libc::c_uint; -extern "C" { - #[doc = "Gets whether the application was launched from a homebrew environment.\n # Returns\n\nWhether the application was launched from a homebrew environment."] - #[link_name = "envIsHomebrew__extern"] - pub fn envIsHomebrew() -> bool; -} -extern "C" { - #[doc = "Retrieves a handle from the environment handle list.\n # Arguments\n\n* `name` - Name of the handle.\n # Returns\n\nThe retrieved handle."] - pub fn envGetHandle(name: *const ::libc::c_char) -> Handle; -} -extern "C" { - #[doc = "Gets the environment-recommended app ID to use with APT.\n # Returns\n\nThe APT app ID."] - #[link_name = "envGetAptAppId__extern"] - pub fn envGetAptAppId() -> u32_; -} -extern "C" { - #[doc = "Gets the size of the application heap.\n # Returns\n\nThe application heap size."] - #[link_name = "envGetHeapSize__extern"] - pub fn envGetHeapSize() -> u32_; -} -extern "C" { - #[doc = "Gets the size of the linear heap.\n # Returns\n\nThe linear heap size."] - #[link_name = "envGetLinearHeapSize__extern"] - pub fn envGetLinearHeapSize() -> u32_; -} -extern "C" { - #[doc = "Gets the environment argument list.\n # Returns\n\nThe argument list."] - #[link_name = "envGetSystemArgList__extern"] - pub fn envGetSystemArgList() -> *const ::libc::c_char; -} -extern "C" { - #[doc = "Gets the environment run flags.\n # Returns\n\nThe run flags."] - #[link_name = "envGetSystemRunFlags__extern"] - pub fn envGetSystemRunFlags() -> u32_; -} -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 = __intptr_t; -pub type wint_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; -#[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], -} -impl Default for _mbstate_t__bindgen_ty_1 { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl Default for _mbstate_t { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -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 __daddr_t = ::libc::c_long; -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, Default, Copy, Clone)] -pub struct timeval { - pub tv_sec: time_t, - pub tv_usec: suseconds_t, -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct timespec { - pub tv_sec: time_t, - pub tv_nsec: ::libc::c_long, -} -extern "C" { - pub fn timespec2nsec(ts: *const timespec) -> __uint64_t; -} -extern "C" { - pub fn abstimespec2nsec(clock_id: __clockid_t, ts: *const timespec) -> __uint64_t; -} -#[repr(C)] -#[derive(Debug, Default, 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; -pub type fd_mask = __fd_mask; -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct fd_set { - pub __fds_bits: [__fd_mask; 2usize], -} -extern "C" { - pub fn select( - __n: ::libc::c_int, - __readfds: *mut fd_set, - __writefds: *mut fd_set, - __exceptfds: *mut fd_set, - __timeout: *mut timeval, - ) -> ::libc::c_int; -} -extern "C" { - pub fn pselect( - __n: ::libc::c_int, - __readfds: *mut fd_set, - __writefds: *mut fd_set, - __exceptfds: *mut 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_register_t = __uintptr_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 = __daddr_t; -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, Default, Copy, Clone)] -pub struct sched_param { - pub sched_priority: ::libc::c_int, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __pthread_t { - _unused: [u8; 0], -} -pub type pthread_t = *mut __pthread_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct pthread_attr_t { - pub stackaddr: *mut ::libc::c_void, - pub stacksize: ::libc::c_int, - pub schedparam: sched_param, - pub detachstate: ::libc::c_int, -} -impl Default for pthread_attr_t { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct pthread_mutex_t { - pub type_: ::libc::c_int, - pub __bindgen_anon_1: pthread_mutex_t__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_mutex_t__bindgen_ty_1 { - pub normal: _LOCK_T, - pub recursive: _LOCK_RECURSIVE_T, -} -impl Default for pthread_mutex_t__bindgen_ty_1 { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl Default for pthread_mutex_t { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct pthread_mutexattr_t { - pub type_: ::libc::c_int, -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct pthread_cond_t { - pub clock_id: clockid_t, - pub cond: _COND_T, -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct pthread_condattr_t { - pub clock_id: clockid_t, -} -pub type pthread_key_t = __uint32_t; -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct pthread_once_t { - pub status: ::libc::c_int, -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct pthread_barrier_t { - pub lock: _LOCK_T, - pub cond: _COND_T, - pub reload: ::libc::c_uint, - pub counter: ::libc::c_uint, - pub cycle: ::libc::c_uint, -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct pthread_barrierattr_t {} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct pthread_rwlock_t { - pub lock: _LOCK_T, - pub cond_r: _COND_T, - pub cond_w: _COND_T, - pub _bitfield_align_1: [u32; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, -} -impl pthread_rwlock_t { - #[inline] - pub fn cnt_r(&self) -> u32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 30u8) as u32) } - } - #[inline] - pub fn set_cnt_r(&mut self, val: u32) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(0usize, 30u8, val as u64) - } - } - #[inline] - pub fn cnt_w(&self) -> u32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(30usize, 2u8) as u32) } - } - #[inline] - pub fn set_cnt_w(&mut self, val: u32) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(30usize, 2u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1(cnt_r: u32, cnt_w: u32) -> __BindgenBitfieldUnit<[u8; 4usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 30u8, { - let cnt_r: u32 = unsafe { ::core::mem::transmute(cnt_r) }; - cnt_r as u64 - }); - __bindgen_bitfield_unit.set(30usize, 2u8, { - let cnt_w: u32 = unsafe { ::core::mem::transmute(cnt_w) }; - cnt_w as u64 - }); - __bindgen_bitfield_unit - } -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct pthread_rwlockattr_t {} -#[doc = "< Dummy compression"] -pub const DECOMPRESS_DUMMY: decompressType = 0; -#[doc = "< LZSS/LZ10 compression"] -pub const DECOMPRESS_LZSS: decompressType = 16; -#[doc = "< LZSS/LZ10 compression"] -pub const DECOMPRESS_LZ10: decompressType = 16; -#[doc = "< LZ11 compression"] -pub const DECOMPRESS_LZ11: decompressType = 17; -#[doc = "< Huffman compression with 1-bit data"] -pub const DECOMPRESS_HUFF1: decompressType = 33; -#[doc = "< Huffman compression with 2-bit data"] -pub const DECOMPRESS_HUFF2: decompressType = 34; -#[doc = "< Huffman compression with 3-bit data"] -pub const DECOMPRESS_HUFF3: decompressType = 35; -#[doc = "< Huffman compression with 4-bit data"] -pub const DECOMPRESS_HUFF4: decompressType = 36; -#[doc = "< Huffman compression with 5-bit data"] -pub const DECOMPRESS_HUFF5: decompressType = 37; -#[doc = "< Huffman compression with 6-bit data"] -pub const DECOMPRESS_HUFF6: decompressType = 38; -#[doc = "< Huffman compression with 7-bit data"] -pub const DECOMPRESS_HUFF7: decompressType = 39; -#[doc = "< Huffman compression with 8-bit data"] -pub const DECOMPRESS_HUFF8: decompressType = 40; -#[doc = "< Huffman compression with 8-bit data"] -pub const DECOMPRESS_HUFF: decompressType = 40; -#[doc = "< Run-length encoding compression"] -pub const DECOMPRESS_RLE: decompressType = 48; -#[doc = "Compression types"] -pub type decompressType = ::libc::c_uint; -#[doc = "I/O vector"] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct decompressIOVec { - #[doc = "< I/O buffer"] - pub data: *mut ::libc::c_void, - #[doc = "< Buffer size"] - pub size: usize, -} -impl Default for decompressIOVec { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "Data callback"] -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" { - #[doc = "Decompression callback for file descriptors\n # Arguments\n\n* `userdata` (direction in) - Address of file descriptor\n * `buffer` (direction in) - Buffer to write into\n * `size` (direction in) - Size to read from file descriptor\n # Returns\n\nNumber of bytes read"] - pub fn decompressCallback_FD( - userdata: *mut ::libc::c_void, - buffer: *mut ::libc::c_void, - size: usize, - ) -> isize; -} -extern "C" { - #[doc = "Decompression callback for stdio FILE*\n # Arguments\n\n* `userdata` (direction in) - FILE*\n * `buffer` (direction in) - Buffer to write into\n * `size` (direction in) - Size to read from file descriptor\n # Returns\n\nNumber of bytes read"] - pub fn decompressCallback_Stdio( - userdata: *mut ::libc::c_void, - buffer: *mut ::libc::c_void, - size: usize, - ) -> isize; -} -extern "C" { - #[doc = "Decode decompression header\n # Arguments\n\n* `type` (direction out) - Decompression type\n * `size` (direction out) - Decompressed size\n * `callback` (direction in) - Data callback (see decompressV())\n * `userdata` (direction in) - User data passed to callback (see decompressV())\n * `insize` (direction in) - Size of userdata (see decompressV())\n # Returns\n\nBytes consumed\n * `-1` - error"] - pub fn decompressHeader( - type_: *mut decompressType, - size: *mut usize, - callback: decompressCallback, - userdata: *mut ::libc::c_void, - insize: usize, - ) -> isize; -} -extern "C" { - #[doc = "Decompress data\n # Arguments\n\n* `iov` (direction in) - Output vector\n * `iovcnt` (direction in) - Number of buffers\n * `callback` (direction in) - Data callback (see note)\n * `userdata` (direction in) - User data passed to callback (see note)\n * `insize` (direction in) - Size of userdata (see note)\n # Returns\n\nWhether succeeded\n\n > **Note:** If callback is null, userdata is a pointer to memory to read from,\n and insize is the size of that data. If callback is not null,\n userdata is passed to callback to fetch more data, and insize is\n unused."] - pub fn decompressV( - iov: *const decompressIOVec, - iovcnt: usize, - callback: decompressCallback, - userdata: *mut ::libc::c_void, - insize: usize, - ) -> bool; -} -extern "C" { - #[doc = "Decompress data\n # Arguments\n\n* `output` (direction in) - Output buffer\n * `size` (direction in) - Output size limit\n * `callback` (direction in) - Data callback (see decompressV())\n * `userdata` (direction in) - User data passed to callback (see decompressV())\n * `insize` (direction in) - Size of userdata (see decompressV())\n # Returns\n\nWhether succeeded"] - #[link_name = "decompress__extern"] - pub fn decompress( - output: *mut ::libc::c_void, - size: usize, - callback: decompressCallback, - userdata: *mut ::libc::c_void, - insize: usize, - ) -> bool; -} -extern "C" { - #[doc = "Decompress LZSS/LZ10\n # Arguments\n\n* `iov` (direction in) - Output vector\n * `iovcnt` (direction in) - Number of buffers\n * `callback` (direction in) - Data callback (see decompressV())\n * `userdata` (direction in) - User data passed to callback (see decompressV())\n * `insize` (direction in) - Size of userdata (see decompressV())\n # Returns\n\nWhether succeeded"] - pub fn decompressV_LZSS( - iov: *const decompressIOVec, - iovcnt: usize, - callback: decompressCallback, - userdata: *mut ::libc::c_void, - insize: usize, - ) -> bool; -} -extern "C" { - #[doc = "Decompress LZSS/LZ10\n # Arguments\n\n* `output` (direction in) - Output buffer\n * `size` (direction in) - Output size limit\n * `callback` (direction in) - Data callback (see decompressV())\n * `userdata` (direction in) - User data passed to callback (see decompressV())\n * `insize` (direction in) - Size of userdata (see decompressV())\n # Returns\n\nWhether succeeded"] - #[link_name = "decompress_LZSS__extern"] - pub fn decompress_LZSS( - output: *mut ::libc::c_void, - size: usize, - callback: decompressCallback, - userdata: *mut ::libc::c_void, - insize: usize, - ) -> bool; -} -extern "C" { - #[doc = "Decompress LZ11\n # Arguments\n\n* `iov` (direction in) - Output vector\n * `iovcnt` (direction in) - Number of buffers\n * `callback` (direction in) - Data callback (see decompressV())\n * `userdata` (direction in) - User data passed to callback (see decompressV())\n * `insize` (direction in) - Size of userdata (see decompressV())\n # Returns\n\nWhether succeeded"] - pub fn decompressV_LZ11( - iov: *const decompressIOVec, - iovcnt: usize, - callback: decompressCallback, - userdata: *mut ::libc::c_void, - insize: usize, - ) -> bool; -} -extern "C" { - #[doc = "Decompress LZ11\n # Arguments\n\n* `output` (direction in) - Output buffer\n * `size` (direction in) - Output size limit\n * `callback` (direction in) - Data callback (see decompressV())\n * `userdata` (direction in) - User data passed to callback (see decompressV())\n * `insize` (direction in) - Size of userdata (see decompressV())\n # Returns\n\nWhether succeeded"] - #[link_name = "decompress_LZ11__extern"] - pub fn decompress_LZ11( - output: *mut ::libc::c_void, - size: usize, - callback: decompressCallback, - userdata: *mut ::libc::c_void, - insize: usize, - ) -> bool; -} -extern "C" { - #[doc = "Decompress Huffman\n # Arguments\n\n* `bits` (direction in) - Data size in bits (usually 4 or 8)\n * `iov` (direction in) - Output vector\n * `iovcnt` (direction in) - Number of buffers\n * `callback` (direction in) - Data callback (see decompressV())\n * `userdata` (direction in) - User data passed to callback (see decompressV())\n * `insize` (direction in) - Size of userdata (see decompressV())\n # Returns\n\nWhether succeeded"] - pub fn decompressV_Huff( - bits: usize, - iov: *const decompressIOVec, - iovcnt: usize, - callback: decompressCallback, - userdata: *mut ::libc::c_void, - insize: usize, - ) -> bool; -} -extern "C" { - #[doc = "Decompress Huffman\n # Arguments\n\n* `bits` (direction in) - Data size in bits (usually 4 or 8)\n * `output` (direction in) - Output buffer\n * `size` (direction in) - Output size limit\n * `callback` (direction in) - Data callback (see decompressV())\n * `userdata` (direction in) - User data passed to callback (see decompressV())\n * `insize` (direction in) - Size of userdata (see decompressV())\n # Returns\n\nWhether succeeded"] - #[link_name = "decompress_Huff__extern"] - pub fn decompress_Huff( - bits: usize, - output: *mut ::libc::c_void, - size: usize, - callback: decompressCallback, - userdata: *mut ::libc::c_void, - insize: usize, - ) -> bool; -} -extern "C" { - #[doc = "Decompress run-length encoding\n # Arguments\n\n* `iov` (direction in) - Output vector\n * `iovcnt` (direction in) - Number of buffers\n * `callback` (direction in) - Data callback (see decompressV())\n * `userdata` (direction in) - User data passed to callback (see decompressV())\n * `insize` (direction in) - Size of userdata (see decompressV())\n # Returns\n\nWhether succeeded"] - pub fn decompressV_RLE( - iov: *const decompressIOVec, - iovcnt: usize, - callback: decompressCallback, - userdata: *mut ::libc::c_void, - insize: usize, - ) -> bool; -} -extern "C" { - #[doc = "Decompress run-length encoding\n # Arguments\n\n* `output` (direction in) - Output buffer\n * `size` (direction in) - Output size limit\n * `callback` (direction in) - Data callback (see decompressV())\n * `userdata` (direction in) - User data passed to callback (see decompressV())\n * `insize` (direction in) - Size of userdata (see decompressV())\n # Returns\n\nWhether succeeded"] - #[link_name = "decompress_RLE__extern"] - pub fn decompress_RLE( - output: *mut ::libc::c_void, - size: usize, - callback: decompressCallback, - userdata: *mut ::libc::c_void, - insize: usize, - ) -> bool; -} -extern "C" { - #[doc = "Convert a UTF-8 sequence into a UTF-32 codepoint\n\n # Arguments\n\n* `out` (direction out) - Output codepoint\n * `in` (direction in) - Input sequence\n\n # Returns\n\nnumber of input code units consumed\n -1 for error"] - pub fn decode_utf8(out: *mut u32, in_: *const u8) -> isize; -} -extern "C" { - #[doc = "Convert a UTF-16 sequence into a UTF-32 codepoint\n\n # Arguments\n\n* `out` (direction out) - Output codepoint\n * `in` (direction in) - Input sequence\n\n # Returns\n\nnumber of input code units consumed\n -1 for error"] - pub fn decode_utf16(out: *mut u32, in_: *const u16) -> isize; -} -extern "C" { - #[doc = "Convert a UTF-32 codepoint into a UTF-8 sequence\n\n # Arguments\n\n* `out` (direction out) - Output sequence\n * `in` (direction in) - Input codepoint\n\n # Returns\n\nnumber of output code units produced\n -1 for error\n\n > **Note:** _out_ must be able to store 4 code units"] - pub fn encode_utf8(out: *mut u8, in_: u32) -> isize; -} -extern "C" { - #[doc = "Convert a UTF-32 codepoint into a UTF-16 sequence\n\n # Arguments\n\n* `out` (direction out) - Output sequence\n * `in` (direction in) - Input codepoint\n\n # Returns\n\nnumber of output code units produced\n -1 for error\n\n > **Note:** _out_ must be able to store 2 code units"] - pub fn encode_utf16(out: *mut u16, in_: u32) -> isize; -} -extern "C" { - #[doc = "Convert a UTF-8 sequence into a UTF-16 sequence\n\n Fills the output buffer up to _len_ code units.\n Returns the number of code units that the input would produce;\n if it returns greater than _len,_ the output has been\n truncated.\n\n # Arguments\n\n* `out` (direction out) - Output sequence\n * `in` (direction in) - Input sequence (null-terminated)\n * `len` (direction in) - Output length\n\n # Returns\n\nnumber of output code units produced\n -1 for error\n\n > **Note:** _out_ is not null-terminated"] - pub fn utf8_to_utf16(out: *mut u16, in_: *const u8, len: usize) -> isize; -} -extern "C" { - #[doc = "Convert a UTF-8 sequence into a UTF-32 sequence\n\n Fills the output buffer up to _len_ code units.\n Returns the number of code units that the input would produce;\n if it returns greater than _len,_ the output has been\n truncated.\n\n # Arguments\n\n* `out` (direction out) - Output sequence\n * `in` (direction in) - Input sequence (null-terminated)\n * `len` (direction in) - Output length\n\n # Returns\n\nnumber of output code units produced\n -1 for error\n\n > **Note:** _out_ is not null-terminated"] - pub fn utf8_to_utf32(out: *mut u32, in_: *const u8, len: usize) -> isize; -} -extern "C" { - #[doc = "Convert a UTF-16 sequence into a UTF-8 sequence\n\n Fills the output buffer up to _len_ code units.\n Returns the number of code units that the input would produce;\n if it returns greater than _len,_ the output has been\n truncated.\n\n # Arguments\n\n* `out` (direction out) - Output sequence\n * `in` (direction in) - Input sequence (null-terminated)\n * `len` (direction in) - Output length\n\n # Returns\n\nnumber of output code units produced\n -1 for error\n\n > **Note:** _out_ is not null-terminated"] - pub fn utf16_to_utf8(out: *mut u8, in_: *const u16, len: usize) -> isize; -} -extern "C" { - #[doc = "Convert a UTF-16 sequence into a UTF-32 sequence\n\n Fills the output buffer up to _len_ code units.\n Returns the number of code units that the input would produce;\n if it returns greater than _len,_ the output has been\n truncated.\n\n # Arguments\n\n* `out` (direction out) - Output sequence\n * `in` (direction in) - Input sequence (null-terminated)\n * `len` (direction in) - Output length\n\n # Returns\n\nnumber of output code units produced\n -1 for error\n\n > **Note:** _out_ is not null-terminated"] - pub fn utf16_to_utf32(out: *mut u32, in_: *const u16, len: usize) -> isize; -} -extern "C" { - #[doc = "Convert a UTF-32 sequence into a UTF-8 sequence\n\n Fills the output buffer up to _len_ code units.\n Returns the number of code units that the input would produce;\n if it returns greater than _len,_ the output has been\n truncated.\n\n # Arguments\n\n* `out` (direction out) - Output sequence\n * `in` (direction in) - Input sequence (null-terminated)\n * `len` (direction in) - Output length\n\n # Returns\n\nnumber of output code units produced\n -1 for error\n\n > **Note:** _out_ is not null-terminated"] - pub fn utf32_to_utf8(out: *mut u8, in_: *const u32, len: usize) -> isize; -} -extern "C" { - #[doc = "Convert a UTF-32 sequence into a UTF-16 sequence\n\n # Arguments\n\n* `out` (direction out) - Output sequence\n * `in` (direction in) - Input sequence (null-terminated)\n * `len` (direction in) - Output length\n\n # Returns\n\nnumber of output code units produced\n -1 for error\n\n > **Note:** _out_ is not null-terminated"] - pub fn utf32_to_utf16(out: *mut u16, in_: *const u32, len: usize) -> isize; -} -extern "C" { - #[doc = "Allocates a 0x80-byte aligned buffer.\n # Arguments\n\n* `size` - Size of the buffer to allocate.\n # Returns\n\nThe allocated buffer."] - pub fn linearAlloc(size: usize) -> *mut ::libc::c_void; -} -extern "C" { - #[doc = "Allocates a buffer aligned to the given size.\n # Arguments\n\n* `size` - Size of the buffer to allocate.\n * `alignment` - Alignment to use.\n # Returns\n\nThe allocated buffer."] - pub fn linearMemAlign(size: usize, alignment: usize) -> *mut ::libc::c_void; -} -extern "C" { - #[doc = "Reallocates a buffer.\n Note: Not implemented yet.\n # Arguments\n\n* `mem` - Buffer to reallocate.\n * `size` - Size of the buffer to allocate.\n # Returns\n\nThe reallocated buffer."] - pub fn linearRealloc(mem: *mut ::libc::c_void, size: usize) -> *mut ::libc::c_void; -} -extern "C" { - #[doc = "Retrieves the allocated size of a buffer.\n # Returns\n\nThe size of the buffer."] - pub fn linearGetSize(mem: *mut ::libc::c_void) -> usize; -} -extern "C" { - #[doc = "Frees a buffer.\n # Arguments\n\n* `mem` - Buffer to free."] - pub fn linearFree(mem: *mut ::libc::c_void); -} -extern "C" { - #[doc = "Gets the current linear free space.\n # Returns\n\nThe current linear free space."] - pub fn linearSpaceFree() -> u32_; -} -extern "C" { - #[doc = "Initializes the mappable allocator.\n # Arguments\n\n* `addrMin` - Minimum address.\n * `addrMax` - Maxium address."] - pub fn mappableInit(addrMin: u32_, addrMax: u32_); -} -extern "C" { - #[doc = "Finds a mappable memory area.\n # Arguments\n\n* `size` - Size of the area to find.\n # Returns\n\nThe mappable area."] - pub fn mappableAlloc(size: usize) -> *mut ::libc::c_void; -} -extern "C" { - #[doc = "Frees a mappable area (stubbed).\n # Arguments\n\n* `mem` - Mappable area to free."] - pub fn mappableFree(mem: *mut ::libc::c_void); -} -pub const VRAM_ALLOC_A: vramAllocPos = 1; -pub const VRAM_ALLOC_B: vramAllocPos = 2; -pub const VRAM_ALLOC_ANY: vramAllocPos = 3; -pub type vramAllocPos = ::libc::c_uint; -extern "C" { - #[doc = "Allocates a 0x80-byte aligned buffer.\n # Arguments\n\n* `size` - Size of the buffer to allocate.\n # Returns\n\nThe allocated buffer."] - pub fn vramAlloc(size: usize) -> *mut ::libc::c_void; -} -extern "C" { - #[doc = "Allocates a 0x80-byte aligned buffer in the given VRAM bank.\n # Arguments\n\n* `size` - Size of the buffer to allocate.\n * `pos` - VRAM bank to use (see vramAllocPos).\n # Returns\n\nThe allocated buffer."] - pub fn vramAllocAt(size: usize, pos: vramAllocPos) -> *mut ::libc::c_void; -} -extern "C" { - #[doc = "Allocates a buffer aligned to the given size.\n # Arguments\n\n* `size` - Size of the buffer to allocate.\n * `alignment` - Alignment to use.\n # Returns\n\nThe allocated buffer."] - pub fn vramMemAlign(size: usize, alignment: usize) -> *mut ::libc::c_void; -} -extern "C" { - #[doc = "Allocates a buffer aligned to the given size in the given VRAM bank.\n # Arguments\n\n* `size` - Size of the buffer to allocate.\n * `alignment` - Alignment to use.\n * `pos` - VRAM bank to use (see vramAllocPos).\n # Returns\n\nThe allocated buffer."] - pub fn vramMemAlignAt(size: usize, alignment: usize, pos: vramAllocPos) -> *mut ::libc::c_void; -} -extern "C" { - #[doc = "Reallocates a buffer.\n Note: Not implemented yet.\n # Arguments\n\n* `mem` - Buffer to reallocate.\n * `size` - Size of the buffer to allocate.\n # Returns\n\nThe reallocated buffer."] - pub fn vramRealloc(mem: *mut ::libc::c_void, size: usize) -> *mut ::libc::c_void; -} -extern "C" { - #[doc = "Retrieves the allocated size of a buffer.\n # Returns\n\nThe size of the buffer."] - pub fn vramGetSize(mem: *mut ::libc::c_void) -> usize; -} -extern "C" { - #[doc = "Frees a buffer.\n # Arguments\n\n* `mem` - Buffer to free."] - pub fn vramFree(mem: *mut ::libc::c_void); -} -extern "C" { - #[doc = "Gets the current VRAM free space.\n # Returns\n\nThe current VRAM free space."] - pub fn vramSpaceFree() -> u32_; -} -#[doc = "< Open authentication."] -pub const AC_OPEN: acSecurityMode = 0; -#[doc = "< WEP 40-bit authentication."] -pub const AC_WEP_40BIT: acSecurityMode = 1; -#[doc = "< WEP 104-bit authentication."] -pub const AC_WEP_104BIT: acSecurityMode = 2; -#[doc = "< WEP 128-bit authentication."] -pub const AC_WEP_128BIT: acSecurityMode = 3; -#[doc = "< WPA TKIP authentication."] -pub const AC_WPA_TKIP: acSecurityMode = 4; -#[doc = "< WPA2 TKIP authentication."] -pub const AC_WPA2_TKIP: acSecurityMode = 5; -#[doc = "< WPA AES authentication."] -pub const AC_WPA_AES: acSecurityMode = 6; -#[doc = "< WPA2 AES authentication."] -pub const AC_WPA2_AES: acSecurityMode = 7; -#[doc = "Wifi security modes."] -pub type acSecurityMode = ::libc::c_uint; -#[doc = "Struct to contain the data for connecting to a Wifi network from a stored slot."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct acuConfig { - pub reserved: [u8_; 512usize], -} -impl Default for acuConfig { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -extern "C" { - #[must_use] - #[doc = "Initializes AC."] - pub fn acInit() -> Result; -} -extern "C" { - #[doc = "Exits AC."] - pub fn acExit(); -} -extern "C" { - #[must_use] - #[doc = "Waits for the system to connect to the internet."] - pub fn acWaitInternetConnection() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the connected Wifi status.\n # Arguments\n\n* `out` - Pointer to output the connected Wifi status to. (0 = not connected, 1 = O3DS Internet, 2 = N3DS Internet)"] - pub fn ACU_GetWifiStatus(out: *mut u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the connected Wifi status.\n # Arguments\n\n* `out` - Pointer to output the connected Wifi status to. (1 = not connected, 3 = connected)"] - pub fn ACU_GetStatus(out: *mut u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the connected Wifi security mode.\n # Arguments\n\n* `mode` - Pointer to output the connected Wifi security mode to. (0 = Open Authentication, 1 = WEP 40-bit, 2 = WEP 104-bit, 3 = WEP 128-bit, 4 = WPA TKIP, 5 = WPA2 TKIP, 6 = WPA AES, 7 = WPA2 AES)"] - pub fn ACU_GetSecurityMode(mode: *mut acSecurityMode) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the connected Wifi SSID.\n # Arguments\n\n* `SSID` - Pointer to output the connected Wifi SSID to."] - pub fn ACU_GetSSID(SSID: *mut ::libc::c_char) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the connected Wifi SSID length.\n # Arguments\n\n* `out` - Pointer to output the connected Wifi SSID length to."] - pub fn ACU_GetSSIDLength(out: *mut u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Determines whether proxy is enabled for the connected network.\n # Arguments\n\n* `enable` - Pointer to output the proxy status to."] - pub fn ACU_GetProxyEnable(enable: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the connected network's proxy port.\n # Arguments\n\n* `out` - Pointer to output the proxy port to."] - pub fn ACU_GetProxyPort(out: *mut u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the connected network's proxy username.\n # Arguments\n\n* `username` - Pointer to output the proxy username to. (The size must be at least 0x20-bytes)"] - pub fn ACU_GetProxyUserName(username: *mut ::libc::c_char) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the connected network's proxy password.\n # Arguments\n\n* `password` - Pointer to output the proxy password to. (The size must be at least 0x20-bytes)"] - pub fn ACU_GetProxyPassword(password: *mut ::libc::c_char) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the last error to occur during a connection.\n # Arguments\n\n* `errorCode` - Pointer to output the error code to."] - pub fn ACU_GetLastErrorCode(errorCode: *mut u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the last detailed error to occur during a connection.\n # Arguments\n\n* `errorCode` - Pointer to output the error code to."] - pub fn ACU_GetLastDetailErrorCode(errorCode: *mut u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Prepares a buffer to hold the configuration data to start a connection.\n # Arguments\n\n* `config` - Pointer to an acuConfig struct to contain the data."] - pub fn ACU_CreateDefaultConfig(config: *mut acuConfig) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets something that makes the connection reliable.\n # Arguments\n\n* `config` - Pointer to an acuConfig struct used with ACU_CreateDefaultConfig previously.\n * `area` - Always 2 ?"] - pub fn ACU_SetNetworkArea(config: *mut acuConfig, area: u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the slot to use when connecting.\n # Arguments\n\n* `config` - Pointer to an acuConfig struct used with ACU_CreateDefaultConfig previously.\n * `type` - Allowed slots flag. BIT(0) for slot 1, BIT(1) for slot 2, BIT(2) for slot 3."] - pub fn ACU_SetAllowApType(config: *mut acuConfig, type_: u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets something that makes the connection reliable.\n # Arguments\n\n* `config` - Pointer to an acuConfig struct used with ACU_CreateDefaultConfig previously."] - pub fn ACU_SetRequestEulaVersion(config: *mut acuConfig) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Starts the connection procedure.\n # Arguments\n\n* `config` - Pointer to an acuConfig struct used with ACU_CreateDefaultConfig previously.\n * `connectionHandle` - Handle created with svcCreateEvent to wait on until the connection succeeds or fails."] - pub fn ACU_ConnectAsync(config: *const acuConfig, connectionHandle: Handle) -> Result; -} -#[doc = "< Open for reading."] -pub const FS_OPEN_READ: _bindgen_ty_10 = 1; -#[doc = "< Open for writing."] -pub const FS_OPEN_WRITE: _bindgen_ty_10 = 2; -#[doc = "< Create file."] -pub const FS_OPEN_CREATE: _bindgen_ty_10 = 4; -#[doc = "Open flags."] -pub type _bindgen_ty_10 = ::libc::c_uint; -#[doc = "< Flush."] -pub const FS_WRITE_FLUSH: _bindgen_ty_11 = 1; -#[doc = "< Update file timestamp."] -pub const FS_WRITE_UPDATE_TIME: _bindgen_ty_11 = 256; -#[doc = "Write flags."] -pub type _bindgen_ty_11 = ::libc::c_uint; -#[doc = "< Directory."] -pub const FS_ATTRIBUTE_DIRECTORY: _bindgen_ty_12 = 1; -#[doc = "< Hidden."] -pub const FS_ATTRIBUTE_HIDDEN: _bindgen_ty_12 = 256; -#[doc = "< Archive."] -pub const FS_ATTRIBUTE_ARCHIVE: _bindgen_ty_12 = 65536; -#[doc = "< Read-only."] -pub const FS_ATTRIBUTE_READ_ONLY: _bindgen_ty_12 = 16777216; -#[doc = "Attribute flags."] -pub type _bindgen_ty_12 = ::libc::c_uint; -#[doc = "< NAND."] -pub const MEDIATYPE_NAND: FS_MediaType = 0; -#[doc = "< SD card."] -pub const MEDIATYPE_SD: FS_MediaType = 1; -#[doc = "< Game card."] -pub const MEDIATYPE_GAME_CARD: FS_MediaType = 2; -#[doc = "Media types."] -pub type FS_MediaType = ::libc::c_uint; -#[doc = "< CTR NAND."] -pub const SYSTEM_MEDIATYPE_CTR_NAND: FS_SystemMediaType = 0; -#[doc = "< TWL NAND."] -pub const SYSTEM_MEDIATYPE_TWL_NAND: FS_SystemMediaType = 1; -#[doc = "< SD card."] -pub const SYSTEM_MEDIATYPE_SD: FS_SystemMediaType = 2; -#[doc = "< TWL Photo."] -pub const SYSTEM_MEDIATYPE_TWL_PHOTO: FS_SystemMediaType = 3; -#[doc = "System media types."] -pub type FS_SystemMediaType = ::libc::c_uint; -#[doc = "< RomFS archive."] -pub const ARCHIVE_ROMFS: FS_ArchiveID = 3; -#[doc = "< Save data archive."] -pub const ARCHIVE_SAVEDATA: FS_ArchiveID = 4; -#[doc = "< Ext data archive."] -pub const ARCHIVE_EXTDATA: FS_ArchiveID = 6; -#[doc = "< Shared ext data archive."] -pub const ARCHIVE_SHARED_EXTDATA: FS_ArchiveID = 7; -#[doc = "< System save data archive."] -pub const ARCHIVE_SYSTEM_SAVEDATA: FS_ArchiveID = 8; -#[doc = "< SDMC archive."] -pub const ARCHIVE_SDMC: FS_ArchiveID = 9; -#[doc = "< Write-only SDMC archive."] -pub const ARCHIVE_SDMC_WRITE_ONLY: FS_ArchiveID = 10; -#[doc = "< BOSS ext data archive."] -pub const ARCHIVE_BOSS_EXTDATA: FS_ArchiveID = 305419896; -#[doc = "< Card SPI FS archive."] -pub const ARCHIVE_CARD_SPIFS: FS_ArchiveID = 305419897; -#[doc = "< Ext data and BOSS ext data archive."] -pub const ARCHIVE_EXTDATA_AND_BOSS_EXTDATA: FS_ArchiveID = 305419899; -#[doc = "< System save data archive."] -pub const ARCHIVE_SYSTEM_SAVEDATA2: FS_ArchiveID = 305419900; -#[doc = "< Read-write NAND archive."] -pub const ARCHIVE_NAND_RW: FS_ArchiveID = 305419901; -#[doc = "< Read-only NAND archive."] -pub const ARCHIVE_NAND_RO: FS_ArchiveID = 305419902; -#[doc = "< Read-only write access NAND archive."] -pub const ARCHIVE_NAND_RO_WRITE_ACCESS: FS_ArchiveID = 305419903; -#[doc = "< User save data and ExeFS/RomFS archive."] -pub const ARCHIVE_SAVEDATA_AND_CONTENT: FS_ArchiveID = 591751050; -#[doc = "< User save data and ExeFS/RomFS archive (only ExeFS for fs:LDR)."] -pub const ARCHIVE_SAVEDATA_AND_CONTENT2: FS_ArchiveID = 591751054; -#[doc = "< NAND CTR FS archive."] -pub const ARCHIVE_NAND_CTR_FS: FS_ArchiveID = 1450741931; -#[doc = "< TWL PHOTO archive."] -pub const ARCHIVE_TWL_PHOTO: FS_ArchiveID = 1450741932; -#[doc = "< TWL SOUND archive."] -pub const ARCHIVE_TWL_SOUND: FS_ArchiveID = 1450741933; -#[doc = "< NAND TWL FS archive."] -pub const ARCHIVE_NAND_TWL_FS: FS_ArchiveID = 1450741934; -#[doc = "< NAND W FS archive."] -pub const ARCHIVE_NAND_W_FS: FS_ArchiveID = 1450741935; -#[doc = "< Game card save data archive."] -pub const ARCHIVE_GAMECARD_SAVEDATA: FS_ArchiveID = 1450741937; -#[doc = "< User save data archive."] -pub const ARCHIVE_USER_SAVEDATA: FS_ArchiveID = 1450741938; -#[doc = "< Demo save data archive."] -pub const ARCHIVE_DEMO_SAVEDATA: FS_ArchiveID = 1450741940; -#[doc = "Archive IDs."] -pub type FS_ArchiveID = ::libc::c_uint; -#[doc = "< Invalid path."] -pub const PATH_INVALID: FS_PathType = 0; -#[doc = "< Empty path."] -pub const PATH_EMPTY: FS_PathType = 1; -#[doc = "< Binary path. Meaning is per-archive."] -pub const PATH_BINARY: FS_PathType = 2; -#[doc = "< ASCII text path."] -pub const PATH_ASCII: FS_PathType = 3; -#[doc = "< UTF-16 text path."] -pub const PATH_UTF16: FS_PathType = 4; -#[doc = "Path types."] -pub type FS_PathType = ::libc::c_uint; -#[doc = "< SD application."] -pub const SECUREVALUE_SLOT_SD: FS_SecureValueSlot = 4096; -#[doc = "Secure value slot."] -pub type FS_SecureValueSlot = ::libc::c_uint; -#[doc = "< 512KHz."] -pub const BAUDRATE_512KHZ: FS_CardSpiBaudRate = 0; -#[doc = "< 1MHz."] -pub const BAUDRATE_1MHZ: FS_CardSpiBaudRate = 1; -#[doc = "< 2MHz."] -pub const BAUDRATE_2MHZ: FS_CardSpiBaudRate = 2; -#[doc = "< 4MHz."] -pub const BAUDRATE_4MHZ: FS_CardSpiBaudRate = 3; -#[doc = "< 8MHz."] -pub const BAUDRATE_8MHZ: FS_CardSpiBaudRate = 4; -#[doc = "< 16MHz."] -pub const BAUDRATE_16MHZ: FS_CardSpiBaudRate = 5; -#[doc = "Card SPI baud rate."] -pub type FS_CardSpiBaudRate = ::libc::c_uint; -#[doc = "< 1-bit."] -pub const BUSMODE_1BIT: FS_CardSpiBusMode = 0; -#[doc = "< 4-bit."] -pub const BUSMODE_4BIT: FS_CardSpiBusMode = 1; -#[doc = "Card SPI bus mode."] -pub type FS_CardSpiBusMode = ::libc::c_uint; -#[doc = "< Update."] -pub const SPECIALCONTENT_UPDATE: FS_SpecialContentType = 1; -#[doc = "< Manual."] -pub const SPECIALCONTENT_MANUAL: FS_SpecialContentType = 2; -#[doc = "< DLP child."] -pub const SPECIALCONTENT_DLP_CHILD: FS_SpecialContentType = 3; -#[doc = "Card SPI bus mode."] -pub type FS_SpecialContentType = ::libc::c_uint; -#[doc = "< CTR card."] -pub const CARD_CTR: FS_CardType = 0; -#[doc = "< TWL card."] -pub const CARD_TWL: FS_CardType = 1; -pub type FS_CardType = ::libc::c_uint; -pub const FS_ACTION_UNKNOWN: FS_Action = 0; -#[doc = "FS control actions."] -pub type FS_Action = ::libc::c_uint; -#[doc = "< Commits save data changes. No inputs/outputs."] -pub const ARCHIVE_ACTION_COMMIT_SAVE_DATA: FS_ArchiveAction = 0; -#[doc = "< Retrieves a file's last-modified timestamp. In: \"u16*, UTF-16 Path\", Out: \"u64, Time Stamp\"."] -pub const ARCHIVE_ACTION_GET_TIMESTAMP: FS_ArchiveAction = 1; -pub const ARCHIVE_ACTION_UNKNOWN: FS_ArchiveAction = 30877; -#[doc = "Archive control actions."] -pub type FS_ArchiveAction = ::libc::c_uint; -#[doc = "< Deletes a save's secure value. In: \"u64, ((SecureValueSlot << 32) | (TitleUniqueId << 8) | TitleVariation)\", Out: \"u8, Value Existed\""] -pub const SECURESAVE_ACTION_DELETE: FS_SecureSaveAction = 0; -#[doc = "< Formats a save. No inputs/outputs."] -pub const SECURESAVE_ACTION_FORMAT: FS_SecureSaveAction = 1; -#[doc = "Secure save control actions."] -pub type FS_SecureSaveAction = ::libc::c_uint; -pub const FILE_ACTION_UNKNOWN: FS_FileAction = 0; -#[doc = "File control actions."] -pub type FS_FileAction = ::libc::c_uint; -pub const DIRECTORY_ACTION_UNKNOWN: FS_DirectoryAction = 0; -#[doc = "Directory control actions."] -pub type FS_DirectoryAction = ::libc::c_uint; -#[doc = "Directory entry."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct FS_DirectoryEntry { - #[doc = "< UTF-16 directory name."] - pub name: [u16_; 262usize], - #[doc = "< File name."] - pub shortName: [::libc::c_char; 10usize], - #[doc = "< File extension."] - pub shortExt: [::libc::c_char; 4usize], - #[doc = "< Valid flag. (Always 1)"] - pub valid: u8_, - #[doc = "< Reserved."] - pub reserved: u8_, - #[doc = "< Attributes."] - pub attributes: u32_, - #[doc = "< File size."] - pub fileSize: u64_, -} -impl Default for FS_DirectoryEntry { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "Archive resource information."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct FS_ArchiveResource { - #[doc = "< Size of each sector, in bytes."] - pub sectorSize: u32_, - #[doc = "< Size of each cluster, in bytes."] - pub clusterSize: u32_, - #[doc = "< Total number of clusters."] - pub totalClusters: u32_, - #[doc = "< Number of free clusters."] - pub freeClusters: u32_, -} -#[doc = "Program information."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct FS_ProgramInfo { - #[doc = "< Program ID."] - pub programId: u64_, - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, - #[doc = "< Padding."] - pub padding: [u8_; 7usize], -} -impl Default for FS_ProgramInfo { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -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]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 8u8, { - let mediaType: u32 = unsafe { ::core::mem::transmute(mediaType) }; - mediaType as u64 - }); - __bindgen_bitfield_unit - } -} -#[doc = "Product information."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct FS_ProductInfo { - #[doc = "< Product code."] - pub productCode: [::libc::c_char; 16usize], - #[doc = "< Company code."] - pub companyCode: [::libc::c_char; 2usize], - #[doc = "< Remaster version."] - pub remasterVersion: u16_, -} -#[doc = "Integrity verification seed."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct FS_IntegrityVerificationSeed { - #[doc = "< AES-CBC MAC over a SHA256 hash, which hashes the first 0x110-bytes of the cleartext SEED."] - pub aesCbcMac: [u8_; 16usize], - #[doc = "< The \"nand/private/movable.sed\", encrypted with AES-CTR using the above MAC for the counter."] - pub movableSed: [u8_; 288usize], -} -impl Default for FS_IntegrityVerificationSeed { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "Ext save data information."] -#[repr(C, packed)] -#[derive(Debug, Copy, Clone)] -pub struct FS_ExtSaveDataInfo { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, - #[doc = "< Unknown."] - pub unknown: u8_, - #[doc = "< Reserved."] - pub reserved1: u16_, - #[doc = "< Save ID."] - pub saveId: u64_, - #[doc = "< Reserved."] - pub reserved2: u32_, -} -impl Default for FS_ExtSaveDataInfo { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -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]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 8u8, { - let mediaType: u32 = unsafe { ::core::mem::transmute(mediaType) }; - mediaType as u64 - }); - __bindgen_bitfield_unit - } -} -#[doc = "System save data information."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct FS_SystemSaveDataInfo { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, - #[doc = "< Unknown."] - pub unknown: u8_, - #[doc = "< Reserved."] - pub reserved: u16_, - #[doc = "< Save ID."] - pub saveId: u32_, -} -impl Default for FS_SystemSaveDataInfo { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -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]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 8u8, { - let mediaType: u32 = unsafe { ::core::mem::transmute(mediaType) }; - mediaType as u64 - }); - __bindgen_bitfield_unit - } -} -#[doc = "Device move context."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct FS_DeviceMoveContext { - #[doc = "< IVs."] - pub ivs: [u8_; 16usize], - #[doc = "< Encrypt parameter."] - pub encryptParameter: [u8_; 16usize], -} -#[doc = "Filesystem path data, detailing the specific target of an operation."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct FS_Path { - #[doc = "< FS path type."] - pub type_: FS_PathType, - #[doc = "< FS path size."] - pub size: u32_, - #[doc = "< Pointer to FS path data."] - pub data: *const ::libc::c_void, -} -impl Default for FS_Path { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "SDMC/NAND speed information"] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct FS_SdMmcSpeedInfo { - #[doc = "< Whether or not High Speed Mode is enabled."] - pub highSpeedModeEnabled: bool, - #[doc = "< Whether or not a clock divider of 2 is being used."] - pub usesHighestClockRate: bool, - #[doc = "< The value of the SD_CLK_CTRL register."] - pub sdClkCtrl: u16_, -} -#[doc = "Filesystem archive handle, providing access to a filesystem's contents."] -pub type FS_Archive = u64_; -extern "C" { - #[must_use] - #[doc = "Initializes FS."] - pub fn fsInit() -> Result; -} -extern "C" { - #[doc = "Exits FS."] - pub fn fsExit(); -} -extern "C" { - #[doc = "Sets the FSUSER session to use in the current thread.\n # Arguments\n\n* `session` - The handle of the FSUSER session to use."] - pub fn fsUseSession(session: Handle); -} -extern "C" { - #[doc = "Disables the FSUSER session override in the current thread."] - pub fn fsEndUseSession(); -} -extern "C" { - #[doc = "Exempts an archive from using alternate FS session handles provided with fsUseSession\n Instead, the archive will use the default FS session handle, opened with srvGetSessionHandle\n # Arguments\n\n* `archive` - Archive to exempt."] - pub fn fsExemptFromSession(archive: FS_Archive); -} -extern "C" { - #[doc = "Unexempts an archive from using alternate FS session handles provided with fsUseSession\n # Arguments\n\n* `archive` - Archive to remove from the exemption list."] - pub fn fsUnexemptFromSession(archive: FS_Archive); -} -extern "C" { - #[doc = "Creates an FS_Path instance.\n # Arguments\n\n* `type` - Type of path.\n * `path` - Path to use.\n # Returns\n\nThe created FS_Path instance."] - pub fn fsMakePath(type_: FS_PathType, path: *const ::libc::c_void) -> FS_Path; -} -extern "C" { - #[doc = "Gets the current FS session handle.\n # Returns\n\nThe current FS session handle."] - pub fn fsGetSessionHandle() -> *mut Handle; -} -extern "C" { - #[must_use] - #[doc = "Performs a control operation on the filesystem.\n # Arguments\n\n* `action` - Action to perform.\n * `input` - Buffer to read input from.\n * `inputSize` - Size of the input.\n * `output` - Buffer to write output to.\n * `outputSize` - Size of the output."] - pub fn FSUSER_Control( - action: FS_Action, - input: *mut ::libc::c_void, - inputSize: u32_, - output: *mut ::libc::c_void, - outputSize: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initializes a FSUSER session.\n # Arguments\n\n* `session` - The handle of the FSUSER session to initialize."] - pub fn FSUSER_Initialize(session: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Opens a file.\n # Arguments\n\n* `out` - Pointer to output the file handle to.\n * `archive` - Archive containing the file.\n * `path` - Path of the file.\n * `openFlags` - Flags to open the file with.\n * `attributes` - Attributes of the file."] - pub fn FSUSER_OpenFile( - out: *mut Handle, - archive: FS_Archive, - path: FS_Path, - openFlags: u32_, - attributes: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Opens a file directly, bypassing the requirement of an opened archive handle.\n # Arguments\n\n* `out` - Pointer to output the file handle to.\n * `archiveId` - ID of the archive containing the file.\n * `archivePath` - Path of the archive containing the file.\n * `filePath` - Path of the file.\n * `openFlags` - Flags to open the file with.\n * `attributes` - Attributes of the file."] - pub fn FSUSER_OpenFileDirectly( - out: *mut Handle, - archiveId: FS_ArchiveID, - archivePath: FS_Path, - filePath: FS_Path, - openFlags: u32_, - attributes: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Deletes a file.\n # Arguments\n\n* `archive` - Archive containing the file.\n * `path` - Path of the file."] - pub fn FSUSER_DeleteFile(archive: FS_Archive, path: FS_Path) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Renames a file.\n # Arguments\n\n* `srcArchive` - Archive containing the source file.\n * `srcPath` - Path of the source file.\n * `dstArchive` - Archive containing the destination file.\n * `dstPath` - Path of the destination file."] - pub fn FSUSER_RenameFile( - srcArchive: FS_Archive, - srcPath: FS_Path, - dstArchive: FS_Archive, - dstPath: FS_Path, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Deletes a directory, failing if it is not empty.\n # Arguments\n\n* `archive` - Archive containing the directory.\n * `path` - Path of the directory."] - pub fn FSUSER_DeleteDirectory(archive: FS_Archive, path: FS_Path) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Deletes a directory, also deleting its contents.\n # Arguments\n\n* `archive` - Archive containing the directory.\n * `path` - Path of the directory."] - pub fn FSUSER_DeleteDirectoryRecursively(archive: FS_Archive, path: FS_Path) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Creates a file.\n # Arguments\n\n* `archive` - Archive to create the file in.\n * `path` - Path of the file.\n * `attributes` - Attributes of the file.\n * `fileSize` - Size of the file."] - pub fn FSUSER_CreateFile( - archive: FS_Archive, - path: FS_Path, - attributes: u32_, - fileSize: u64_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Creates a directory\n # Arguments\n\n* `archive` - Archive to create the directory in.\n * `path` - Path of the directory.\n * `attributes` - Attributes of the directory."] - pub fn FSUSER_CreateDirectory(archive: FS_Archive, path: FS_Path, attributes: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Renames a directory.\n # Arguments\n\n* `srcArchive` - Archive containing the source directory.\n * `srcPath` - Path of the source directory.\n * `dstArchive` - Archive containing the destination directory.\n * `dstPath` - Path of the destination directory."] - pub fn FSUSER_RenameDirectory( - srcArchive: FS_Archive, - srcPath: FS_Path, - dstArchive: FS_Archive, - dstPath: FS_Path, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Opens a directory.\n # Arguments\n\n* `out` - Pointer to output the directory handle to.\n * `archive` - Archive containing the directory.\n * `path` - Path of the directory."] - pub fn FSUSER_OpenDirectory(out: *mut Handle, archive: FS_Archive, path: FS_Path) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Opens an archive.\n # Arguments\n\n* `archive` - Pointer to output the opened archive to.\n * `id` - ID of the archive.\n * `path` - Path of the archive."] - pub fn FSUSER_OpenArchive(archive: *mut FS_Archive, id: FS_ArchiveID, path: FS_Path) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Performs a control operation on an archive.\n # Arguments\n\n* `archive` - Archive to control.\n * `action` - Action to perform.\n * `input` - Buffer to read input from.\n * `inputSize` - Size of the input.\n * `output` - Buffer to write output to.\n * `outputSize` - Size of the output."] - 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" { - #[must_use] - #[doc = "Closes an archive.\n # Arguments\n\n* `archive` - Archive to close."] - pub fn FSUSER_CloseArchive(archive: FS_Archive) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the number of free bytes within an archive.\n # Arguments\n\n* `freeBytes` - Pointer to output the free bytes to.\n * `archive` - Archive to check."] - pub fn FSUSER_GetFreeBytes(freeBytes: *mut u64_, archive: FS_Archive) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the inserted card type.\n # Arguments\n\n* `type` - Pointer to output the card type to."] - pub fn FSUSER_GetCardType(type_: *mut FS_CardType) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the SDMC archive resource information.\n # Arguments\n\n* `archiveResource` - Pointer to output the archive resource information to."] - pub fn FSUSER_GetSdmcArchiveResource(archiveResource: *mut FS_ArchiveResource) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the NAND archive resource information.\n # Arguments\n\n* `archiveResource` - Pointer to output the archive resource information to."] - pub fn FSUSER_GetNandArchiveResource(archiveResource: *mut FS_ArchiveResource) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the last SDMC fatfs error.\n # Arguments\n\n* `error` - Pointer to output the error to."] - pub fn FSUSER_GetSdmcFatfsError(error: *mut u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets whether an SD card is detected.\n # Arguments\n\n* `detected` - Pointer to output the detection status to."] - pub fn FSUSER_IsSdmcDetected(detected: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets whether the SD card is writable.\n # Arguments\n\n* `writable` - Pointer to output the writable status to."] - pub fn FSUSER_IsSdmcWritable(writable: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the SDMC CID.\n # Arguments\n\n* `out` - Pointer to output the CID to.\n * `length` - Length of the CID buffer. (should be 0x10)"] - pub fn FSUSER_GetSdmcCid(out: *mut u8_, length: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the NAND CID.\n # Arguments\n\n* `out` - Pointer to output the CID to.\n * `length` - Length of the CID buffer. (should be 0x10)"] - pub fn FSUSER_GetNandCid(out: *mut u8_, length: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the SDMC speed info.\n # Arguments\n\n* `speedInfo` - Pointer to output the speed info to."] - pub fn FSUSER_GetSdmcSpeedInfo(speedInfo: *mut FS_SdMmcSpeedInfo) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the NAND speed info.\n # Arguments\n\n* `speedInfo` - Pointer to output the speed info to."] - pub fn FSUSER_GetNandSpeedInfo(speedInfo: *mut FS_SdMmcSpeedInfo) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the SDMC log.\n # Arguments\n\n* `out` - Pointer to output the log to.\n * `length` - Length of the log buffer."] - pub fn FSUSER_GetSdmcLog(out: *mut u8_, length: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the NAND log.\n # Arguments\n\n* `out` - Pointer to output the log to.\n * `length` - Length of the log buffer."] - pub fn FSUSER_GetNandLog(out: *mut u8_, length: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Clears the SDMC log."] - pub fn FSUSER_ClearSdmcLog() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Clears the NAND log."] - pub fn FSUSER_ClearNandLog() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets whether a card is inserted.\n # Arguments\n\n* `inserted` - Pointer to output the insertion status to."] - pub fn FSUSER_CardSlotIsInserted(inserted: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Powers on the card slot.\n # Arguments\n\n* `status` - Pointer to output the power status to."] - pub fn FSUSER_CardSlotPowerOn(status: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Powers off the card slot.\n # Arguments\n\n* `status` - Pointer to output the power status to."] - pub fn FSUSER_CardSlotPowerOff(status: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the card's power status.\n # Arguments\n\n* `status` - Pointer to output the power status to."] - pub fn FSUSER_CardSlotGetCardIFPowerStatus(status: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Executes a CARDNOR direct command.\n # Arguments\n\n* `commandId` - ID of the command."] - pub fn FSUSER_CardNorDirectCommand(commandId: u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Executes a CARDNOR direct command with an address.\n # Arguments\n\n* `commandId` - ID of the command.\n * `address` - Address to provide."] - pub fn FSUSER_CardNorDirectCommandWithAddress(commandId: u8_, address: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Executes a CARDNOR direct read.\n # Arguments\n\n* `commandId` - ID of the command.\n * `size` - Size of the output buffer.\n * `output` - Output buffer."] - pub fn FSUSER_CardNorDirectRead( - commandId: u8_, - size: u32_, - output: *mut ::libc::c_void, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Executes a CARDNOR direct read with an address.\n # Arguments\n\n* `commandId` - ID of the command.\n * `address` - Address to provide.\n * `size` - Size of the output buffer.\n * `output` - Output buffer."] - pub fn FSUSER_CardNorDirectReadWithAddress( - commandId: u8_, - address: u32_, - size: u32_, - output: *mut ::libc::c_void, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Executes a CARDNOR direct write.\n # Arguments\n\n* `commandId` - ID of the command.\n * `size` - Size of the input buffer.\n * `output` - Input buffer."] - pub fn FSUSER_CardNorDirectWrite( - commandId: u8_, - size: u32_, - input: *const ::libc::c_void, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Executes a CARDNOR direct write with an address.\n # Arguments\n\n* `commandId` - ID of the command.\n * `address` - Address to provide.\n * `size` - Size of the input buffer.\n * `input` - Input buffer."] - pub fn FSUSER_CardNorDirectWriteWithAddress( - commandId: u8_, - address: u32_, - size: u32_, - input: *const ::libc::c_void, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Executes a CARDNOR 4xIO direct read.\n # Arguments\n\n* `commandId` - ID of the command.\n * `address` - Address to provide.\n * `size` - Size of the output buffer.\n * `output` - Output buffer."] - pub fn FSUSER_CardNorDirectRead_4xIO( - commandId: u8_, - address: u32_, - size: u32_, - output: *mut ::libc::c_void, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Executes a CARDNOR direct CPU write without verify.\n # Arguments\n\n* `address` - Address to provide.\n * `size` - Size of the input buffer.\n * `output` - Input buffer."] - pub fn FSUSER_CardNorDirectCpuWriteWithoutVerify( - address: u32_, - size: u32_, - input: *const ::libc::c_void, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Executes a CARDNOR direct sector erase without verify.\n # Arguments\n\n* `address` - Address to provide."] - pub fn FSUSER_CardNorDirectSectorEraseWithoutVerify(address: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets a process's product info.\n # Arguments\n\n* `info` - Pointer to output the product info to.\n * `processId` - ID of the process."] - pub fn FSUSER_GetProductInfo(info: *mut FS_ProductInfo, processId: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets a process's program launch info.\n # Arguments\n\n* `info` - Pointer to output the program launch info to.\n * `processId` - ID of the process."] - pub fn FSUSER_GetProgramLaunchInfo(info: *mut FS_ProgramInfo, processId: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the CARDSPI baud rate.\n # Arguments\n\n* `baudRate` - Baud rate to set."] - pub fn FSUSER_SetCardSpiBaudRate(baudRate: FS_CardSpiBaudRate) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the CARDSPI bus mode.\n # Arguments\n\n* `busMode` - Bus mode to set."] - pub fn FSUSER_SetCardSpiBusMode(busMode: FS_CardSpiBusMode) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sends initialization info to ARM9."] - pub fn FSUSER_SendInitializeInfoTo9() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets a special content's index.\n # Arguments\n\n* `index` - Pointer to output the index to.\n * `mediaType` - Media type of the special content.\n * `programId` - Program ID owning the special content.\n * `type` - Type of special content."] - pub fn FSUSER_GetSpecialContentIndex( - index: *mut u16_, - mediaType: FS_MediaType, - programId: u64_, - type_: FS_SpecialContentType, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the legacy ROM header of a program.\n # Arguments\n\n* `mediaType` - Media type of the program.\n * `programId` - ID of the program.\n * `header` - Pointer to output the legacy ROM header to. (size = 0x3B4)"] - pub fn FSUSER_GetLegacyRomHeader( - mediaType: FS_MediaType, - programId: u64_, - header: *mut ::libc::c_void, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the legacy banner data of a program.\n # Arguments\n\n* `mediaType` - Media type of the program.\n * `programId` - ID of the program.\n * `header` - Pointer to output the legacy banner data to. (size = 0x23C0)"] - pub fn FSUSER_GetLegacyBannerData( - mediaType: FS_MediaType, - programId: u64_, - banner: *mut ::libc::c_void, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Checks a process's authority to access a save data archive.\n # Arguments\n\n* `access` - Pointer to output the access status to.\n * `mediaType` - Media type of the save data.\n * `saveId` - ID of the save data.\n * `processId` - ID of the process to check."] - pub fn FSUSER_CheckAuthorityToAccessExtSaveData( - access: *mut bool, - mediaType: FS_MediaType, - saveId: u64_, - processId: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Queries the total quota size of a save data archive.\n # Arguments\n\n* `quotaSize` - Pointer to output the quota size to.\n * `directories` - Number of directories.\n * `files` - Number of files.\n * `fileSizeCount` - Number of file sizes to provide.\n * `fileSizes` - File sizes to provide."] - pub fn FSUSER_QueryTotalQuotaSize( - quotaSize: *mut u64_, - directories: u32_, - files: u32_, - fileSizeCount: u32_, - fileSizes: *mut u64_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Abnegates an access right.\n # Arguments\n\n* `accessRight` - Access right to abnegate."] - pub fn FSUSER_AbnegateAccessRight(accessRight: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Deletes the 3DS SDMC root."] - pub fn FSUSER_DeleteSdmcRoot() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Deletes all ext save data on the NAND."] - pub fn FSUSER_DeleteAllExtSaveDataOnNand() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initializes the CTR file system."] - pub fn FSUSER_InitializeCtrFileSystem() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Creates the FS seed."] - pub fn FSUSER_CreateSeed() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Retrieves archive format info.\n # Arguments\n\n* `totalSize` - Pointer to output the total size to.\n * `directories` - Pointer to output the number of directories to.\n * `files` - Pointer to output the number of files to.\n * `duplicateData` - Pointer to output whether to duplicate data to.\n * `archiveId` - ID of the archive.\n * `path` - Path of the archive."] - 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" { - #[must_use] - #[doc = "Gets the legacy ROM header of a program.\n # Arguments\n\n* `headerSize` - Size of the ROM header.\n * `mediaType` - Media type of the program.\n * `programId` - ID of the program.\n * `header` - Pointer to output the legacy ROM header to."] - pub fn FSUSER_GetLegacyRomHeader2( - headerSize: u32_, - mediaType: FS_MediaType, - programId: u64_, - header: *mut ::libc::c_void, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the CTR SDMC root path.\n # Arguments\n\n* `out` - Pointer to output the root path to.\n * `length` - Length of the output buffer."] - pub fn FSUSER_GetSdmcCtrRootPath(out: *mut u8_, length: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets an archive's resource information.\n # Arguments\n\n* `archiveResource` - Pointer to output the archive resource information to.\n * `mediaType` - System media type to check."] - pub fn FSUSER_GetArchiveResource( - archiveResource: *mut FS_ArchiveResource, - mediaType: FS_SystemMediaType, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Exports the integrity verification seed.\n # Arguments\n\n* `seed` - Pointer to output the seed to."] - pub fn FSUSER_ExportIntegrityVerificationSeed( - seed: *mut FS_IntegrityVerificationSeed, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Imports an integrity verification seed.\n # Arguments\n\n* `seed` - Seed to import."] - pub fn FSUSER_ImportIntegrityVerificationSeed( - seed: *mut FS_IntegrityVerificationSeed, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Formats save data.\n # Arguments\n\n* `archiveId` - ID of the save data archive.\n * `path` - Path of the save data.\n * `blocks` - Size of the save data in blocks. (512 bytes)\n * `directories` - Number of directories.\n * `files` - Number of files.\n * `directoryBuckets` - Directory hash tree bucket count.\n * `fileBuckets` - File hash tree bucket count.\n * `duplicateData` - Whether to store an internal duplicate of the data."] - 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" { - #[must_use] - #[doc = "Gets the legacy sub banner data of a program.\n # Arguments\n\n* `bannerSize` - Size of the banner.\n * `mediaType` - Media type of the program.\n * `programId` - ID of the program.\n * `header` - Pointer to output the legacy sub banner data to."] - pub fn FSUSER_GetLegacySubBannerData( - bannerSize: u32_, - mediaType: FS_MediaType, - programId: u64_, - banner: *mut ::libc::c_void, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Hashes the given data and outputs a SHA256 hash.\n # Arguments\n\n* `data` - Pointer to the data to be hashed.\n * `inputSize` - The size of the data.\n * `hash` - Hash output pointer."] - pub fn FSUSER_UpdateSha256Context( - data: *const ::libc::c_void, - inputSize: u32_, - hash: *mut u8_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Reads from a special file.\n # Arguments\n\n* `bytesRead` - Pointer to output the number of bytes read to.\n * `fileOffset` - Offset of the file.\n * `size` - Size of the buffer.\n * `data` - Buffer to read to."] - pub fn FSUSER_ReadSpecialFile( - bytesRead: *mut u32_, - fileOffset: u64_, - size: u32_, - data: *mut ::libc::c_void, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the size of a special file.\n # Arguments\n\n* `fileSize` - Pointer to output the size to."] - pub fn FSUSER_GetSpecialFileSize(fileSize: *mut u64_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Creates ext save data.\n # Arguments\n\n* `info` - Info of the save data.\n * `directories` - Number of directories.\n * `files` - Number of files.\n * `sizeLimit` - Size limit of the save data.\n * `smdhSize` - Size of the save data's SMDH data.\n * `smdh` - SMDH data."] - pub fn FSUSER_CreateExtSaveData( - info: FS_ExtSaveDataInfo, - directories: u32_, - files: u32_, - sizeLimit: u64_, - smdhSize: u32_, - smdh: *mut u8_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Deletes ext save data.\n # Arguments\n\n* `info` - Info of the save data."] - pub fn FSUSER_DeleteExtSaveData(info: FS_ExtSaveDataInfo) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Reads the SMDH icon of ext save data.\n # Arguments\n\n* `bytesRead` - Pointer to output the number of bytes read to.\n * `info` - Info of the save data.\n * `smdhSize` - Size of the save data SMDH.\n * `smdh` - Pointer to output SMDH data to."] - pub fn FSUSER_ReadExtSaveDataIcon( - bytesRead: *mut u32_, - info: FS_ExtSaveDataInfo, - smdhSize: u32_, - smdh: *mut u8_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets an ext data archive's block information.\n # Arguments\n\n* `totalBlocks` - Pointer to output the total blocks to.\n * `freeBlocks` - Pointer to output the free blocks to.\n * `blockSize` - Pointer to output the block size to.\n * `info` - Info of the save data."] - pub fn FSUSER_GetExtDataBlockSize( - totalBlocks: *mut u64_, - freeBlocks: *mut u64_, - blockSize: *mut u32_, - info: FS_ExtSaveDataInfo, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Enumerates ext save data.\n # Arguments\n\n* `idsWritten` - Pointer to output the number of IDs written to.\n * `idsSize` - Size of the IDs buffer.\n * `mediaType` - Media type to enumerate over.\n * `idSize` - Size of each ID element.\n * `shared` - Whether to enumerate shared ext save data.\n * `ids` - Pointer to output IDs to."] - pub fn FSUSER_EnumerateExtSaveData( - idsWritten: *mut u32_, - idsSize: u32_, - mediaType: FS_MediaType, - idSize: u32_, - shared: bool, - ids: *mut u8_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Creates system save data.\n # Arguments\n\n* `info` - Info of the save data.\n * `totalSize` - Total size of the save data.\n * `blockSize` - Block size of the save data. (usually 0x1000)\n * `directories` - Number of directories.\n * `files` - Number of files.\n * `directoryBuckets` - Directory hash tree bucket count.\n * `fileBuckets` - File hash tree bucket count.\n * `duplicateData` - Whether to store an internal duplicate of the data."] - pub fn FSUSER_CreateSystemSaveData( - info: FS_SystemSaveDataInfo, - totalSize: u32_, - blockSize: u32_, - directories: u32_, - files: u32_, - directoryBuckets: u32_, - fileBuckets: u32_, - duplicateData: bool, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Deletes system save data.\n # Arguments\n\n* `info` - Info of the save data."] - pub fn FSUSER_DeleteSystemSaveData(info: FS_SystemSaveDataInfo) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initiates a device move as the source device.\n # Arguments\n\n* `context` - Pointer to output the context to."] - pub fn FSUSER_StartDeviceMoveAsSource(context: *mut FS_DeviceMoveContext) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initiates a device move as the destination device.\n # Arguments\n\n* `context` - Context to use.\n * `clear` - Whether to clear the device's data first."] - pub fn FSUSER_StartDeviceMoveAsDestination( - context: FS_DeviceMoveContext, - clear: bool, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets an archive's priority.\n # Arguments\n\n* `archive` - Archive to use.\n * `priority` - Priority to set."] - pub fn FSUSER_SetArchivePriority(archive: FS_Archive, priority: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets an archive's priority.\n # Arguments\n\n* `priority` - Pointer to output the priority to.\n * `archive` - Archive to use."] - pub fn FSUSER_GetArchivePriority(priority: *mut u32_, archive: FS_Archive) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Configures CTRCARD latency emulation.\n # Arguments\n\n* `latency` - Latency to apply, in milliseconds.\n * `emulateEndurance` - Whether to emulate card endurance."] - pub fn FSUSER_SetCtrCardLatencyParameter(latency: u64_, emulateEndurance: bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Toggles cleaning up invalid save data.\n # Arguments\n\n* `enable` - Whether to enable cleaning up invalid save data."] - pub fn FSUSER_SwitchCleanupInvalidSaveData(enable: bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Enumerates system save data.\n # Arguments\n\n* `idsWritten` - Pointer to output the number of IDs written to.\n * `idsSize` - Size of the IDs buffer.\n * `ids` - Pointer to output IDs to."] - pub fn FSUSER_EnumerateSystemSaveData( - idsWritten: *mut u32_, - idsSize: u32_, - ids: *mut u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initializes a FSUSER session with an SDK version.\n # Arguments\n\n* `session` - The handle of the FSUSER session to initialize.\n * `version` - SDK version to initialize with."] - pub fn FSUSER_InitializeWithSdkVersion(session: Handle, version: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the file system priority.\n # Arguments\n\n* `priority` - Priority to set."] - pub fn FSUSER_SetPriority(priority: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the file system priority.\n # Arguments\n\n* `priority` - Pointer to output the priority to."] - pub fn FSUSER_GetPriority(priority: *mut u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the save data secure value.\n # Arguments\n\n* `value` - Secure value to set.\n * `slot` - Slot of the secure value.\n * `titleUniqueId` - Unique ID of the title. (default = 0)\n * `titleVariation` - Variation of the title. (default = 0)"] - pub fn FSUSER_SetSaveDataSecureValue( - value: u64_, - slot: FS_SecureValueSlot, - titleUniqueId: u32_, - titleVariation: u8_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the save data secure value.\n # Arguments\n\n* `exists` - Pointer to output whether the secure value exists to.\n * `value` - Pointer to output the secure value to.\n * `slot` - Slot of the secure value.\n * `titleUniqueId` - Unique ID of the title. (default = 0)\n * `titleVariation` - Variation of the title. (default = 0)"] - pub fn FSUSER_GetSaveDataSecureValue( - exists: *mut bool, - value: *mut u64_, - slot: FS_SecureValueSlot, - titleUniqueId: u32_, - titleVariation: u8_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Performs a control operation on a secure save.\n # Arguments\n\n* `action` - Action to perform.\n * `input` - Buffer to read input from.\n * `inputSize` - Size of the input.\n * `output` - Buffer to write output to.\n * `outputSize` - Size of the output."] - pub fn FSUSER_ControlSecureSave( - action: FS_SecureSaveAction, - input: *mut ::libc::c_void, - inputSize: u32_, - output: *mut ::libc::c_void, - outputSize: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the media type of the current application.\n # Arguments\n\n* `mediaType` - Pointer to output the media type to."] - pub fn FSUSER_GetMediaType(mediaType: *mut FS_MediaType) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Performs a control operation on a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `action` - Action to perform.\n * `input` - Buffer to read input from.\n * `inputSize` - Size of the input.\n * `output` - Buffer to write output to.\n * `outputSize` - Size of the output."] - 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" { - #[must_use] - #[doc = "Opens a handle to a sub-section of a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `subFile` - Pointer to output the sub-file to.\n * `offset` - Offset of the sub-section.\n * `size` - Size of the sub-section."] - pub fn FSFILE_OpenSubFile( - handle: Handle, - subFile: *mut Handle, - offset: u64_, - size: u64_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Reads from a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `bytesRead` - Pointer to output the number of bytes read to.\n * `offset` - Offset to read from.\n * `buffer` - Buffer to read to.\n * `size` - Size of the buffer."] - pub fn FSFILE_Read( - handle: Handle, - bytesRead: *mut u32_, - offset: u64_, - buffer: *mut ::libc::c_void, - size: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Writes to a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `bytesWritten` - Pointer to output the number of bytes written to.\n * `offset` - Offset to write to.\n * `buffer` - Buffer to write from.\n * `size` - Size of the buffer.\n * `flags` - Flags to use when writing."] - pub fn FSFILE_Write( - handle: Handle, - bytesWritten: *mut u32_, - offset: u64_, - buffer: *const ::libc::c_void, - size: u32_, - flags: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the size of a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `size` - Pointer to output the size to."] - pub fn FSFILE_GetSize(handle: Handle, size: *mut u64_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the size of a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `size` - Size to set."] - pub fn FSFILE_SetSize(handle: Handle, size: u64_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the attributes of a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `attributes` - Pointer to output the attributes to."] - pub fn FSFILE_GetAttributes(handle: Handle, attributes: *mut u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the attributes of a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `attributes` - Attributes to set."] - pub fn FSFILE_SetAttributes(handle: Handle, attributes: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Closes a file.\n # Arguments\n\n* `handle` - Handle of the file."] - pub fn FSFILE_Close(handle: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Flushes a file's contents.\n # Arguments\n\n* `handle` - Handle of the file."] - pub fn FSFILE_Flush(handle: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets a file's priority.\n # Arguments\n\n* `handle` - Handle of the file.\n * `priority` - Priority to set."] - pub fn FSFILE_SetPriority(handle: Handle, priority: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets a file's priority.\n # Arguments\n\n* `handle` - Handle of the file.\n * `priority` - Pointer to output the priority to."] - pub fn FSFILE_GetPriority(handle: Handle, priority: *mut u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Opens a duplicate handle to a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `linkFile` - Pointer to output the link handle to."] - pub fn FSFILE_OpenLinkFile(handle: Handle, linkFile: *mut Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Performs a control operation on a directory.\n # Arguments\n\n* `handle` - Handle of the directory.\n * `action` - Action to perform.\n * `input` - Buffer to read input from.\n * `inputSize` - Size of the input.\n * `output` - Buffer to write output to.\n * `outputSize` - Size of the output."] - 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" { - #[must_use] - #[doc = "Reads one or more directory entries.\n # Arguments\n\n* `handle` - Handle of the directory.\n * `entriesRead` - Pointer to output the number of entries read to.\n * `entryCount` - Number of entries to read.\n * `entryOut` - Pointer to output directory entries to."] - pub fn FSDIR_Read( - handle: Handle, - entriesRead: *mut u32_, - entryCount: u32_, - entries: *mut FS_DirectoryEntry, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Closes a directory.\n # Arguments\n\n* `handle` - Handle of the directory."] - pub fn FSDIR_Close(handle: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets a directory's priority.\n # Arguments\n\n* `handle` - Handle of the directory.\n * `priority` - Priority to set."] - pub fn FSDIR_SetPriority(handle: Handle, priority: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets a directory's priority.\n # Arguments\n\n* `handle` - Handle of the directory.\n * `priority` - Pointer to output the priority to."] - pub fn FSDIR_GetPriority(handle: Handle, priority: *mut u32_) -> Result; -} -#[doc = "Contains basic information about a title."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct AM_TitleEntry { - #[doc = "< The title's ID."] - pub titleID: u64_, - #[doc = "< The title's installed size."] - pub size: u64_, - #[doc = "< The title's version."] - pub version: u16_, - #[doc = "< Unknown title data."] - pub unk: [u8_; 6usize], -} -#[doc = "< Titles currently installing."] -pub const AM_STATUS_MASK_INSTALLING: _bindgen_ty_13 = 1; -#[doc = "< Titles awaiting finalization."] -pub const AM_STATUS_MASK_AWAITING_FINALIZATION: _bindgen_ty_13 = 2; -#[doc = "Pending title status mask values."] -pub type _bindgen_ty_13 = ::libc::c_uint; -#[doc = "< Install aborted."] -pub const AM_STATUS_ABORTED: AM_InstallStatus = 2; -#[doc = "< Title saved, but not installed."] -pub const AM_STATUS_SAVED: AM_InstallStatus = 3; -#[doc = "< Install in progress."] -pub const AM_STATUS_INSTALL_IN_PROGRESS: AM_InstallStatus = 2050; -#[doc = "< Awaiting finalization."] -pub const AM_STATUS_AWAITING_FINALIZATION: AM_InstallStatus = 2051; -#[doc = "Pending title status values."] -pub type AM_InstallStatus = ::libc::c_uint; -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct AM_PendingTitleEntry { - #[doc = "< Title ID"] - pub titleId: u64_, - #[doc = "< Version"] - pub version: u16_, - #[doc = "< AM_InstallStatus"] - pub status: u16_, - #[doc = "< Title Type"] - pub titleType: u32_, - #[doc = "< Unknown"] - pub unk: [u8_; 8usize], -} -#[doc = "< Non-system titles."] -pub const AM_DELETE_PENDING_NON_SYSTEM: _bindgen_ty_14 = 1; -#[doc = "< System titles."] -pub const AM_DELETE_PENDING_SYSTEM: _bindgen_ty_14 = 2; -#[doc = "Pending title deletion flags."] -pub type _bindgen_ty_14 = ::libc::c_uint; -#[doc = "Information about the TWL NAND partition."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct AM_TWLPartitionInfo { - #[doc = "< Total capacity."] - pub capacity: u64_, - #[doc = "< Total free space."] - pub freeSpace: u64_, - #[doc = "< Capacity for titles."] - pub titlesCapacity: u64_, - #[doc = "< Free space for titles."] - pub titlesFreeSpace: u64_, -} -#[doc = "Contains information about a title's content."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct AM_ContentInfo { - #[doc = "< Index of the content in the title."] - pub index: u16_, - #[doc = "< ?"] - pub type_: u16_, - #[doc = "< ID of the content in the title."] - pub contentId: u32_, - #[doc = "< Size of the content in the title."] - pub size: u64_, - #[doc = "< AM_ContentInfoFlags"] - pub flags: u8_, - #[doc = "< Padding"] - pub padding: [u8_; 7usize], -} -#[doc = "< ?"] -pub const AM_CONTENT_DOWNLOADED: AM_ContentInfoFlags = 1; -#[doc = "< ?"] -pub const AM_CONTENT_OWNED: AM_ContentInfoFlags = 2; -#[doc = "Title ContentInfo flags."] -pub type AM_ContentInfoFlags = ::libc::c_uint; -extern "C" { - #[must_use] - #[doc = "Initializes AM. This doesn't initialize with \"am:app\", see amAppInit()."] - pub fn amInit() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initializes AM with a service which has access to the amapp-commands. This should only be used when using the amapp commands, not non-amapp AM commands."] - pub fn amAppInit() -> Result; -} -extern "C" { - #[doc = "Exits AM."] - pub fn amExit(); -} -extern "C" { - #[doc = "Gets the current AM session handle."] - pub fn amGetSessionHandle() -> *mut Handle; -} -extern "C" { - #[must_use] - #[doc = "Gets the number of titles for a given media type.\n # Arguments\n\n* `mediatype` - Media type to get titles from.\n * `count` (direction out) - Pointer to write the title count to."] - pub fn AM_GetTitleCount(mediatype: FS_MediaType, count: *mut u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets a list of title IDs present in a mediatype.\n # Arguments\n\n* `titlesRead` (direction out) - Pointer to output the number of read titles to.\n * `mediatype` - Media type to get titles from.\n * `titleCount` - Number of title IDs to get.\n * `titleIds` - Buffer to output the retrieved title IDs to."] - pub fn AM_GetTitleList( - titlesRead: *mut u32_, - mediatype: FS_MediaType, - titleCount: u32_, - titleIds: *mut u64_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets a list of details about installed titles.\n # Arguments\n\n* `mediatype` - Media type to get titles from.\n * `titleCount` - Number of titles to list.\n * `titleIds` - List of title IDs to retrieve details for.\n * `titleInfo` - Buffer to write AM_TitleEntry's to."] - pub fn AM_GetTitleInfo( - mediatype: FS_MediaType, - titleCount: u32_, - titleIds: *mut u64_, - titleInfo: *mut AM_TitleEntry, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the number of tickets installed on the system.\n # Arguments\n\n* `count` (direction out) - Pointer to output the ticket count to."] - pub fn AM_GetTicketCount(count: *mut u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets a list of tickets installed on the system.\n # Arguments\n\n* `ticketsRead` (direction out) - Pointer to output the number of read tickets to.\n * `ticketCount` - Number of tickets to read.\n * `skip` - Number of tickets to skip.\n * `ticketIds` - Buffer to output the retrieved ticket IDs to."] - pub fn AM_GetTicketList( - ticketsRead: *mut u32_, - ticketCount: u32_, - skip: u32_, - ticketIds: *mut u64_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the number of pending titles on this system.\n # Arguments\n\n* `count` (direction out) - Pointer to output the pending title count to.\n * `mediatype` - Media type of pending titles to count.\n * `statusMask` - Bit mask of status values to include."] - pub fn AM_GetPendingTitleCount( - count: *mut u32_, - mediatype: FS_MediaType, - statusMask: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets a list of pending titles on this system.\n # Arguments\n\n* `titlesRead` (direction out) - Pointer to output the number of read pending titles to.\n * `titleCount` - Number of pending titles to read.\n * `mediatype` - Media type of pending titles to list.\n * `statusMask` - Bit mask of status values to include.\n * `titleIds` - Buffer to output the retrieved pending title IDs to."] - pub fn AM_GetPendingTitleList( - titlesRead: *mut u32_, - titleCount: u32_, - mediatype: FS_MediaType, - statusMask: u32_, - titleIds: *mut u64_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets information about pending titles on this system.\n # Arguments\n\n* `titleCount` - Number of pending titles to read.\n * `mediatype` - Media type of pending titles to get information on.\n * `titleIds` - IDs of the titles to get information about.\n * `titleInfo` - Buffer to output the retrieved pending title info to."] - pub fn AM_GetPendingTitleInfo( - titleCount: u32_, - mediatype: FS_MediaType, - titleIds: *mut u64_, - titleInfo: *mut AM_PendingTitleEntry, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets a 32-bit device-specific ID.\n # Arguments\n\n* `deviceID` - Pointer to write the device ID to."] - pub fn AM_GetDeviceId(deviceID: *mut u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Exports DSiWare to the specified filepath.\n # Arguments\n\n* `titleID` - TWL titleID.\n * `operation` - DSiWare operation type.\n * `workbuf` - Work buffer.\n * `workbuf_size` - Work buffer size, must be >=0x20000.\n * `filepath` - UTF-8 filepath(converted to UTF-16 internally)."] - pub fn AM_ExportTwlBackup( - titleID: u64_, - operation: u8_, - workbuf: *mut ::libc::c_void, - workbuf_size: u32_, - filepath: *const ::libc::c_char, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Imports DSiWare from the specified file.\n # Arguments\n\n* `filehandle` - FSUSER file handle.\n * `operation` - DSiWare operation type.\n * `buffer` - Work buffer.\n * `size` - Buffer size, must be >=0x20000."] - pub fn AM_ImportTwlBackup( - filehandle: Handle, - operation: u8_, - buffer: *mut ::libc::c_void, - size: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Reads info from the specified DSiWare export file. This can only be used with DSiWare exported with certain operation value(s).\n # Arguments\n\n* `filehandle` - FSUSER file handle.\n * `outinfo` - Output info buffer.\n * `outinfo_size` - Output info buffer size.\n * `workbuf` - Work buffer.\n * `workbuf_size` - Work buffer size.\n * `banner` - Output banner buffer.\n * `banner_size` - Output banner buffer size."] - 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" { - #[must_use] - #[doc = "Retrieves information about the NAND TWL partition.\n # Arguments\n\n* `info` (direction out) - Pointer to output the TWL partition info to."] - pub fn AM_GetTWLPartitionInfo(info: *mut AM_TWLPartitionInfo) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initializes the CIA install process, returning a handle to write CIA data to.\n # Arguments\n\n* `mediatype` - Media type to install the CIA to.\n * `ciaHandle` (direction out) - Pointer to write the CIA handle to."] - pub fn AM_StartCiaInstall(mediatype: FS_MediaType, ciaHandle: *mut Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initializes the CIA install process for Download Play CIAs, returning a handle to write CIA data to.\n # Arguments\n\n* `ciaHandle` (direction out) - Pointer to write the CIA handle to."] - pub fn AM_StartDlpChildCiaInstall(ciaHandle: *mut Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Aborts the CIA install process.\n # Arguments\n\n* `ciaHandle` - CIA handle to cancel."] - pub fn AM_CancelCIAInstall(ciaHandle: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Finalizes the CIA install process.\n # Arguments\n\n* `ciaHandle` - CIA handle to finalize."] - pub fn AM_FinishCiaInstall(ciaHandle: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Finalizes the CIA install process without committing the title to title.db or tmp*.db.\n # Arguments\n\n* `ciaHandle` - CIA handle to finalize."] - pub fn AM_FinishCiaInstallWithoutCommit(ciaHandle: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Commits installed CIAs.\n # Arguments\n\n* `mediaType` - Location of the titles to finalize.\n * `titleCount` - Number of titles to finalize.\n * `temp` - Whether the titles being finalized are in the temporary database.\n * `titleIds` - Title IDs to finalize."] - pub fn AM_CommitImportPrograms( - mediaType: FS_MediaType, - titleCount: u32_, - temp: bool, - titleIds: *const u64_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Deletes a title.\n # Arguments\n\n* `mediatype` - Media type to delete from.\n * `titleID` - ID of the title to delete."] - pub fn AM_DeleteTitle(mediatype: FS_MediaType, titleID: u64_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Deletes a title, provided that it is not a system title.\n # Arguments\n\n* `mediatype` - Media type to delete from.\n * `titleID` - ID of the title to delete."] - pub fn AM_DeleteAppTitle(mediatype: FS_MediaType, titleID: u64_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Deletes a ticket.\n # Arguments\n\n* `titleID` - ID of the ticket to delete."] - pub fn AM_DeleteTicket(ticketId: u64_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Deletes a pending title.\n # Arguments\n\n* `mediatype` - Media type to delete from.\n * `titleId` - ID of the pending title to delete."] - pub fn AM_DeletePendingTitle(mediatype: FS_MediaType, titleId: u64_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Deletes pending titles.\n # Arguments\n\n* `mediatype` - Media type to delete from.\n * `flags` - Flags used to select pending titles."] - pub fn AM_DeletePendingTitles(mediatype: FS_MediaType, flags: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Deletes all pending titles.\n # Arguments\n\n* `mediatype` - Media type to delete from."] - pub fn AM_DeleteAllPendingTitles(mediatype: FS_MediaType) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Installs the current NATIVE_FIRM title to NAND (firm0:/ & firm1:/)"] - pub fn AM_InstallNativeFirm() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Installs a NATIVE_FIRM title to NAND. Accepts 0004013800000002 or 0004013820000002 (N3DS).\n # Arguments\n\n* `titleID` - Title ID of the NATIVE_FIRM to install."] - pub fn AM_InstallFirm(titleID: u64_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the product code of a title.\n # Arguments\n\n* `mediatype` - Media type of the title.\n * `titleID` - ID of the title.\n * `productCode` (direction out) - Pointer to output the product code to. (length = 16)"] - pub fn AM_GetTitleProductCode( - mediatype: FS_MediaType, - titleId: u64_, - productCode: *mut ::libc::c_char, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the ext data ID of a title.\n # Arguments\n\n* `extDataId` (direction out) - Pointer to output the ext data ID to.\n * `mediatype` - Media type of the title.\n * `titleID` - ID of the title."] - pub fn AM_GetTitleExtDataId( - extDataId: *mut u64_, - mediatype: FS_MediaType, - titleId: u64_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets an AM_TitleEntry instance for a CIA file.\n # Arguments\n\n* `mediatype` - Media type that this CIA would be installed to.\n * `titleEntry` (direction out) - Pointer to write the AM_TitleEntry instance to.\n * `fileHandle` - Handle of the CIA file."] - pub fn AM_GetCiaFileInfo( - mediatype: FS_MediaType, - titleEntry: *mut AM_TitleEntry, - fileHandle: Handle, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the SMDH icon data of a CIA file.\n # Arguments\n\n* `icon` - Buffer to store the icon data in. Must be of size 0x36C0 bytes.\n * `fileHandle` - Handle of the CIA file."] - pub fn AM_GetCiaIcon(icon: *mut ::libc::c_void, fileHandle: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the title ID dependency list of a CIA file.\n # Arguments\n\n* `dependencies` - Buffer to store dependency title IDs in. Must be of size 0x300 bytes.\n * `fileHandle` - Handle of the CIA file."] - pub fn AM_GetCiaDependencies(dependencies: *mut u64_, fileHandle: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the meta section offset of a CIA file.\n # Arguments\n\n* `metaOffset` (direction out) - Pointer to output the meta section offset to.\n * `fileHandle` - Handle of the CIA file."] - pub fn AM_GetCiaMetaOffset(metaOffset: *mut u64_, fileHandle: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the core version of a CIA file.\n # Arguments\n\n* `coreVersion` (direction out) - Pointer to output the core version to.\n * `fileHandle` - Handle of the CIA file."] - pub fn AM_GetCiaCoreVersion(coreVersion: *mut u32_, fileHandle: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the free space, in bytes, required to install a CIA file.\n # Arguments\n\n* `requiredSpace` (direction out) - Pointer to output the required free space to.\n * `mediaType` - Media type to check free space needed to install to.\n * `fileHandle` - Handle of the CIA file."] - pub fn AM_GetCiaRequiredSpace( - requiredSpace: *mut u64_, - mediaType: FS_MediaType, - fileHandle: Handle, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the full meta section of a CIA file.\n # Arguments\n\n* `meta` - Buffer to store the meta section in.\n * `size` - Size of the buffer. Must be greater than or equal to the actual section data's size.\n * `fileHandle` - Handle of the CIA file."] - pub fn AM_GetCiaMetaSection( - meta: *mut ::libc::c_void, - size: u32_, - fileHandle: Handle, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initializes the external (SD) title database.\n # Arguments\n\n* `overwrite` - Overwrites the database if it already exists."] - pub fn AM_InitializeExternalTitleDatabase(overwrite: bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Queries whether the external title database is available.\n # Arguments\n\n* `available` (direction out) - Pointer to output the availability status to."] - pub fn AM_QueryAvailableExternalTitleDatabase(available: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Begins installing a ticket.\n # Arguments\n\n* `ticketHandle` (direction out) - Pointer to output a handle to write ticket data to."] - pub fn AM_InstallTicketBegin(ticketHandle: *mut Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Aborts installing a ticket.\n # Arguments\n\n* `ticketHandle` - Handle of the installation to abort."] - pub fn AM_InstallTicketAbort(ticketHandle: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Finishes installing a ticket.\n # Arguments\n\n* `ticketHandle` - Handle of the installation to finalize."] - pub fn AM_InstallTicketFinish(ticketHandle: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Begins installing a title.\n # Arguments\n\n* `mediaType` - Destination to install to.\n * `titleId` - ID of the title to install.\n * `unk` - Unknown. (usually false)"] - pub fn AM_InstallTitleBegin(mediaType: FS_MediaType, titleId: u64_, unk: bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Stops installing a title, generally to be resumed later."] - pub fn AM_InstallTitleStop() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Resumes installing a title.\n # Arguments\n\n* `mediaType` - Destination to install to.\n * `titleId` - ID of the title to install."] - pub fn AM_InstallTitleResume(mediaType: FS_MediaType, titleId: u64_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Aborts installing a title."] - pub fn AM_InstallTitleAbort() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Finishes installing a title."] - pub fn AM_InstallTitleFinish() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Commits installed titles.\n # Arguments\n\n* `mediaType` - Location of the titles to finalize.\n * `titleCount` - Number of titles to finalize.\n * `temp` - Whether the titles being finalized are in the temporary database.\n * `titleIds` - Title IDs to finalize."] - pub fn AM_CommitImportTitles( - mediaType: FS_MediaType, - titleCount: u32_, - temp: bool, - titleIds: *const u64_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Begins installing a TMD.\n # Arguments\n\n* `tmdHandle` (direction out) - Pointer to output a handle to write TMD data to."] - pub fn AM_InstallTmdBegin(tmdHandle: *mut Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Aborts installing a TMD.\n # Arguments\n\n* `tmdHandle` - Handle of the installation to abort."] - pub fn AM_InstallTmdAbort(tmdHandle: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Finishes installing a TMD.\n # Arguments\n\n* `tmdHandle` - Handle of the installation to finalize.\n * `unk` - Unknown. (usually true)"] - pub fn AM_InstallTmdFinish(tmdHandle: Handle, unk: bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Prepares to import title contents.\n # Arguments\n\n* `contentCount` - Number of contents to be imported.\n * `contentIndices` - Indices of the contents to be imported."] - pub fn AM_CreateImportContentContexts(contentCount: u32_, contentIndices: *mut u16_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Begins installing title content.\n # Arguments\n\n* `contentHandle` (direction out) - Pointer to output a handle to write content data to.\n * `index` - Index of the content to install."] - pub fn AM_InstallContentBegin(contentHandle: *mut Handle, index: u16_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Stops installing title content, generally to be resumed later.\n # Arguments\n\n* `contentHandle` - Handle of the installation to abort."] - pub fn AM_InstallContentStop(contentHandle: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Resumes installing title content.\n # Arguments\n\n* `contentHandle` (direction out) - Pointer to output a handle to write content data to.\n * `resumeOffset` (direction out) - Pointer to write the offset to resume content installation at to.\n * `index` - Index of the content to install."] - pub fn AM_InstallContentResume( - contentHandle: *mut Handle, - resumeOffset: *mut u64_, - index: u16_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Cancels installing title content.\n # Arguments\n\n* `contentHandle` - Handle of the installation to finalize."] - pub fn AM_InstallContentCancel(contentHandle: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Finishes installing title content.\n # Arguments\n\n* `contentHandle` - Handle of the installation to finalize."] - pub fn AM_InstallContentFinish(contentHandle: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Imports up to four certificates into the ticket certificate chain.\n # Arguments\n\n* `cert1Size` - Size of the first certificate.\n * `cert1` - Data of the first certificate.\n * `cert2Size` - Size of the second certificate.\n * `cert2` - Data of the second certificate.\n * `cert3Size` - Size of the third certificate.\n * `cert3` - Data of the third certificate.\n * `cert4Size` - Size of the fourth certificate.\n * `cert4` - Data of the fourth certificate."] - 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" { - #[must_use] - #[doc = "Imports a certificate into the ticket certificate chain.\n # Arguments\n\n* `certSize` - Size of the certificate.\n * `cert` - Data of the certificate."] - pub fn AM_ImportCertificate(certSize: u32_, cert: *mut ::libc::c_void) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Commits installed titles, and updates FIRM if necessary.\n # Arguments\n\n* `mediaType` - Location of the titles to finalize.\n * `titleCount` - Number of titles to finalize.\n * `temp` - Whether the titles being finalized are in the temporary database.\n * `titleIds` - Title IDs to finalize."] - pub fn AM_CommitImportTitlesAndUpdateFirmwareAuto( - mediaType: FS_MediaType, - titleCount: u32_, - temp: bool, - titleIds: *mut u64_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Resets play count of all installed demos by deleting their launch info."] - pub fn AM_DeleteAllDemoLaunchInfos() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Deletes temporary titles."] - pub fn AM_DeleteAllTemporaryTitles() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Deletes all expired titles.\n # Arguments\n\n* `mediatype` - Media type to delete from."] - pub fn AM_DeleteAllExpiredTitles(mediatype: FS_MediaType) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Deletes all TWL titles."] - pub fn AM_DeleteAllTwlTitles() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the number of content index installed under the specified DLC title.\n # Arguments\n\n* `count` (direction out) - Pointer to output the number of content indices to.\n * `mediatype` - Media type of the title.\n * `titleID` - Title ID to retrieve the count for (high-id is 0x0004008C)."] - pub fn AMAPP_GetDLCContentInfoCount( - count: *mut u32_, - mediatype: FS_MediaType, - titleID: u64_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets content infos installed under the specified DLC title.\n # Arguments\n\n* `contentInfoRead` (direction out) - Pointer to output the number of content infos read to.\n * `mediatype` - Media type of the title.\n * `titleID` - Title ID to retrieve the content infos for (high-id is 0x0004008C).\n * `contentInfoCount` - Number of content infos to retrieve.\n * `offset` - Offset from the first content index the count starts at.\n * `contentInfos` (direction out) - Pointer to output the content infos read to."] - pub fn AMAPP_ListDLCContentInfos( - contentInfoRead: *mut u32_, - mediatype: FS_MediaType, - titleID: u64_, - contentInfoCount: u32_, - offset: u32_, - contentInfos: *mut AM_ContentInfo, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initializes AMPXI.\n # Arguments\n\n* `servhandle` - Optional service session handle to use for AMPXI, if zero srvGetServiceHandle() will be used."] - pub fn ampxiInit(servhandle: Handle) -> Result; -} -extern "C" { - #[doc = "Exits AMPXI."] - pub fn ampxiExit(); -} -extern "C" { - #[must_use] - #[doc = "Writes a TWL save-file to NAND. https://www.3dbrew.org/wiki/AMPXI:WriteTWLSavedata\n # Arguments\n\n* `titleid` - ID of the TWL title.\n * `buffer` - Savedata buffer ptr.\n * `size` - Size of the savedata buffer.\n * `image_filepos` - Filepos to use for writing the data to the NAND savedata file.\n * `section_type` - https://www.3dbrew.org/wiki/AMPXI:WriteTWLSavedata\n * `operation` - https://3dbrew.org/wiki/AM:ImportDSiWare"] - pub fn AMPXI_WriteTWLSavedata( - titleid: u64_, - buffer: *mut u8_, - size: u32_, - image_filepos: u32_, - section_type: u8_, - operation: u8_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Finalizes title installation. https://3dbrew.org/wiki/AMPXI:InstallTitlesFinish\n # Arguments\n\n* `mediaType` - Mediatype of the titles to finalize.\n * `db` - Which title database to use.\n * `size` - Size of the savedata buffer.\n * `titlecount` - Total titles.\n * `tidlist` - List of titleIDs."] - pub fn AMPXI_InstallTitlesFinish( - mediaType: FS_MediaType, - db: u8_, - titlecount: u32_, - tidlist: *mut u64_, - ) -> Result; -} -pub const APPID_NONE: NS_APPID = 0; -#[doc = "< Home Menu"] -pub const APPID_HOMEMENU: NS_APPID = 257; -#[doc = "< Camera applet"] -pub const APPID_CAMERA: NS_APPID = 272; -#[doc = "< Friends List applet"] -pub const APPID_FRIENDS_LIST: NS_APPID = 274; -#[doc = "< Game Notes applet"] -pub const APPID_GAME_NOTES: NS_APPID = 275; -#[doc = "< Internet Browser"] -pub const APPID_WEB: NS_APPID = 276; -#[doc = "< Instruction Manual applet"] -pub const APPID_INSTRUCTION_MANUAL: NS_APPID = 277; -#[doc = "< Notifications applet"] -pub const APPID_NOTIFICATIONS: NS_APPID = 278; -#[doc = "< Miiverse applet (olv)"] -pub const APPID_MIIVERSE: NS_APPID = 279; -#[doc = "< Miiverse posting applet (solv3)"] -pub const APPID_MIIVERSE_POSTING: NS_APPID = 280; -#[doc = "< Amiibo settings applet (cabinet)"] -pub const APPID_AMIIBO_SETTINGS: NS_APPID = 281; -#[doc = "< Application"] -pub const APPID_APPLICATION: NS_APPID = 768; -#[doc = "< eShop (tiger)"] -pub const APPID_ESHOP: NS_APPID = 769; -#[doc = "< Software Keyboard"] -pub const APPID_SOFTWARE_KEYBOARD: NS_APPID = 1025; -#[doc = "< appletEd"] -pub const APPID_APPLETED: NS_APPID = 1026; -#[doc = "< PNOTE_AP"] -pub const APPID_PNOTE_AP: NS_APPID = 1028; -#[doc = "< SNOTE_AP"] -pub const APPID_SNOTE_AP: NS_APPID = 1029; -#[doc = "< error"] -pub const APPID_ERROR: NS_APPID = 1030; -#[doc = "< mint"] -pub const APPID_MINT: NS_APPID = 1031; -#[doc = "< extrapad"] -pub const APPID_EXTRAPAD: NS_APPID = 1032; -#[doc = "< memolib"] -pub const APPID_MEMOLIB: NS_APPID = 1033; -#[doc = "NS Application IDs.\n\n Retrieved from http://3dbrew.org/wiki/NS_and_APT_Services#AppIDs"] -pub type NS_APPID = ::libc::c_uint; -#[doc = "< No position specified."] -pub const APTPOS_NONE: APT_AppletPos = -1; -#[doc = "< Application."] -pub const APTPOS_APP: APT_AppletPos = 0; -#[doc = "< Application library (?)."] -pub const APTPOS_APPLIB: APT_AppletPos = 1; -#[doc = "< System applet."] -pub const APTPOS_SYS: APT_AppletPos = 2; -#[doc = "< System library (?)."] -pub const APTPOS_SYSLIB: APT_AppletPos = 3; -#[doc = "< Resident applet."] -pub const APTPOS_RESIDENT: APT_AppletPos = 4; -#[doc = "APT applet position."] -pub type APT_AppletPos = ::libc::c_int; -pub type APT_AppletAttr = u8_; -extern "C" { - #[doc = "Create an APT_AppletAttr bitfield from its components."] - #[link_name = "aptMakeAppletAttr__extern"] - pub fn aptMakeAppletAttr( - pos: APT_AppletPos, - manualGpuRights: bool, - manualDspRights: bool, - ) -> APT_AppletAttr; -} -pub const APTREPLY_REJECT: APT_QueryReply = 0; -pub const APTREPLY_ACCEPT: APT_QueryReply = 1; -pub const APTREPLY_LATER: APT_QueryReply = 2; -#[doc = "APT query reply."] -pub type APT_QueryReply = ::libc::c_uint; -#[doc = "< No signal received."] -pub const APTSIGNAL_NONE: APT_Signal = 0; -#[doc = "< HOME button pressed."] -pub const APTSIGNAL_HOMEBUTTON: APT_Signal = 1; -#[doc = "< HOME button pressed (again?)."] -pub const APTSIGNAL_HOMEBUTTON2: APT_Signal = 2; -#[doc = "< Prepare to enter sleep mode."] -pub const APTSIGNAL_SLEEP_QUERY: APT_Signal = 3; -#[doc = "< Triggered when ptm:s GetShellStatus() returns 5."] -pub const APTSIGNAL_SLEEP_CANCEL: APT_Signal = 4; -#[doc = "< Enter sleep mode."] -pub const APTSIGNAL_SLEEP_ENTER: APT_Signal = 5; -#[doc = "< Wake from sleep mode."] -pub const APTSIGNAL_SLEEP_WAKEUP: APT_Signal = 6; -#[doc = "< Shutdown."] -pub const APTSIGNAL_SHUTDOWN: APT_Signal = 7; -#[doc = "< POWER button pressed."] -pub const APTSIGNAL_POWERBUTTON: APT_Signal = 8; -#[doc = "< POWER button cleared (?)."] -pub const APTSIGNAL_POWERBUTTON2: APT_Signal = 9; -#[doc = "< System sleeping (?)."] -pub const APTSIGNAL_TRY_SLEEP: APT_Signal = 10; -#[doc = "< Order to close (such as when an error happens?)."] -pub const APTSIGNAL_ORDERTOCLOSE: APT_Signal = 11; -#[doc = "APT signals."] -pub type APT_Signal = ::libc::c_uint; -#[doc = "< No command received."] -pub const APTCMD_NONE: APT_Command = 0; -#[doc = "< Applet should wake up."] -pub const APTCMD_WAKEUP: APT_Command = 1; -#[doc = "< Source applet sent us a parameter."] -pub const APTCMD_REQUEST: APT_Command = 2; -#[doc = "< Target applet replied to our parameter."] -pub const APTCMD_RESPONSE: APT_Command = 3; -#[doc = "< Exit (??)"] -pub const APTCMD_EXIT: APT_Command = 4; -#[doc = "< Message (??)"] -pub const APTCMD_MESSAGE: APT_Command = 5; -#[doc = "< HOME button pressed once."] -pub const APTCMD_HOMEBUTTON_ONCE: APT_Command = 6; -#[doc = "< HOME button pressed twice (double-pressed)."] -pub const APTCMD_HOMEBUTTON_TWICE: APT_Command = 7; -#[doc = "< DSP should sleep (manual DSP rights related?)."] -pub const APTCMD_DSP_SLEEP: APT_Command = 8; -#[doc = "< DSP should wake up (manual DSP rights related?)."] -pub const APTCMD_DSP_WAKEUP: APT_Command = 9; -#[doc = "< Applet wakes up due to a different applet exiting."] -pub const APTCMD_WAKEUP_EXIT: APT_Command = 10; -#[doc = "< Applet wakes up after being paused through HOME menu."] -pub const APTCMD_WAKEUP_PAUSE: APT_Command = 11; -#[doc = "< Applet wakes up due to being cancelled."] -pub const APTCMD_WAKEUP_CANCEL: APT_Command = 12; -#[doc = "< Applet wakes up due to all applets being cancelled."] -pub const APTCMD_WAKEUP_CANCELALL: APT_Command = 13; -#[doc = "< Applet wakes up due to POWER button being pressed (?)."] -pub const APTCMD_WAKEUP_POWERBUTTON: APT_Command = 14; -#[doc = "< Applet wakes up and is instructed to jump to HOME menu (?)."] -pub const APTCMD_WAKEUP_JUMPTOHOME: APT_Command = 15; -#[doc = "< Request for sysapplet (?)."] -pub const APTCMD_SYSAPPLET_REQUEST: APT_Command = 16; -#[doc = "< Applet wakes up and is instructed to launch another applet (?)."] -pub const APTCMD_WAKEUP_LAUNCHAPP: APT_Command = 17; -#[doc = "APT commands."] -pub type APT_Command = ::libc::c_uint; -#[doc = "APT capture buffer information."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct aptCaptureBufInfo { - pub size: u32_, - pub is3D: u32_, - pub top: aptCaptureBufInfo__bindgen_ty_1, - pub bottom: aptCaptureBufInfo__bindgen_ty_1, -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct aptCaptureBufInfo__bindgen_ty_1 { - pub leftOffset: u32_, - pub rightOffset: u32_, - pub format: u32_, -} -#[doc = "< App suspended."] -pub const APTHOOK_ONSUSPEND: APT_HookType = 0; -#[doc = "< App restored."] -pub const APTHOOK_ONRESTORE: APT_HookType = 1; -#[doc = "< App sleeping."] -pub const APTHOOK_ONSLEEP: APT_HookType = 2; -#[doc = "< App waking up."] -pub const APTHOOK_ONWAKEUP: APT_HookType = 3; -#[doc = "< App exiting."] -pub const APTHOOK_ONEXIT: APT_HookType = 4; -#[doc = "< Number of APT hook types."] -pub const APTHOOK_COUNT: APT_HookType = 5; -#[doc = "APT hook types."] -pub type APT_HookType = ::libc::c_uint; -#[doc = "APT hook function."] -pub type aptHookFn = - ::core::option::Option; -#[doc = "APT hook cookie."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct tag_aptHookCookie { - #[doc = "< Next cookie."] - pub next: *mut tag_aptHookCookie, - #[doc = "< Hook callback."] - pub callback: aptHookFn, - #[doc = "< Callback parameter."] - pub param: *mut ::libc::c_void, -} -impl Default for tag_aptHookCookie { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "APT hook cookie."] -pub type aptHookCookie = tag_aptHookCookie; -#[doc = "APT message callback."] -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" { - #[must_use] - #[doc = "Initializes APT."] - pub fn aptInit() -> Result; -} -extern "C" { - #[doc = "Exits APT."] - pub fn aptExit(); -} -extern "C" { - #[must_use] - #[doc = "Sends an APT command through IPC, taking care of locking, opening and closing an APT session.\n # Arguments\n\n* `aptcmdbuf` - Pointer to command buffer (should have capacity for at least 16 words)."] - pub fn aptSendCommand(aptcmdbuf: *mut u32_) -> Result; -} -extern "C" { - #[doc = "Returns true if the application is currently in the foreground."] - pub fn aptIsActive() -> bool; -} -extern "C" { - #[doc = "Returns true if the system has told the application to close."] - pub fn aptShouldClose() -> bool; -} -extern "C" { - #[doc = "Returns true if the system can enter sleep mode while the application is active."] - pub fn aptIsSleepAllowed() -> bool; -} -extern "C" { - #[doc = "Configures whether the system can enter sleep mode while the application is active."] - pub fn aptSetSleepAllowed(allowed: bool); -} -extern "C" { - #[doc = "Handles incoming sleep mode requests."] - pub fn aptHandleSleep(); -} -extern "C" { - #[doc = "Returns true if the user can press the HOME button to jump back to the HOME menu while the application is active."] - pub fn aptIsHomeAllowed() -> bool; -} -extern "C" { - #[doc = "Configures whether the user can press the HOME button to jump back to the HOME menu while the application is active."] - pub fn aptSetHomeAllowed(allowed: bool); -} -extern "C" { - #[doc = "Returns true if the system requires the application to jump back to the HOME menu."] - pub fn aptShouldJumpToHome() -> bool; -} -extern "C" { - #[doc = "Returns true if there is an incoming HOME button press rejected by the policy set by aptSetHomeAllowed (use this to show a \"no HOME allowed\" icon)."] - pub fn aptCheckHomePressRejected() -> bool; -} -extern "C" { - #[doc = "> **Deprecated** Alias for aptCheckHomePressRejected."] - #[link_name = "aptIsHomePressed__extern"] - pub fn aptIsHomePressed() -> bool; -} -extern "C" { - #[doc = "Jumps back to the HOME menu."] - pub fn aptJumpToHomeMenu(); -} -extern "C" { - #[doc = "Handles incoming jump-to-HOME requests."] - #[link_name = "aptHandleJumpToHome__extern"] - pub fn aptHandleJumpToHome(); -} -extern "C" { - #[doc = "Main function which handles sleep mode and HOME/power buttons - call this at the beginning of every frame.\n # Returns\n\ntrue if the application should keep running, false otherwise (see aptShouldClose)."] - pub fn aptMainLoop() -> bool; -} -extern "C" { - #[doc = "Sets up an APT status hook.\n # Arguments\n\n* `cookie` - Hook cookie to use.\n * `callback` - Function to call when APT's status changes.\n * `param` - User-defined parameter to pass to the callback."] - pub fn aptHook(cookie: *mut aptHookCookie, callback: aptHookFn, param: *mut ::libc::c_void); -} -extern "C" { - #[doc = "Removes an APT status hook.\n # Arguments\n\n* `cookie` - Hook cookie to remove."] - pub fn aptUnhook(cookie: *mut aptHookCookie); -} -extern "C" { - #[doc = "Sets the function to be called when an APT message from another applet is received.\n # Arguments\n\n* `callback` - Callback function.\n * `user` - User-defined data to be passed to the callback."] - pub fn aptSetMessageCallback(callback: aptMessageCb, user: *mut ::libc::c_void); -} -extern "C" { - #[doc = "Launches a library applet.\n # Arguments\n\n* `appId` - ID of the applet to launch.\n * `buf` - Input/output buffer that contains launch parameters on entry and result data on exit.\n * `bufsize` - Size of the buffer.\n * `handle` - Handle to pass to the library applet."] - pub fn aptLaunchLibraryApplet( - appId: NS_APPID, - buf: *mut ::libc::c_void, - bufsize: usize, - handle: Handle, - ); -} -extern "C" { - #[doc = "Clears the chainloader state."] - pub fn aptClearChainloader(); -} -extern "C" { - #[doc = "Configures the chainloader to launch a specific application.\n # Arguments\n\n* `programID` - ID of the program to chainload to.\n * `mediatype` - Media type of the program to chainload to."] - pub fn aptSetChainloader(programID: u64_, mediatype: u8_); -} -extern "C" { - #[doc = "Configures the chainloader to launch the previous application."] - pub fn aptSetChainloaderToCaller(); -} -extern "C" { - #[doc = "Configures the chainloader to relaunch the current application (i.e. soft-reset)"] - pub fn aptSetChainloaderToSelf(); -} -extern "C" { - #[doc = "Sets the \"deliver arg\" and HMAC for the chainloader, which will\n be passed to the target 3DS/DS(i) application. The meaning of each\n parameter varies on a per-application basis.\n # Arguments\n\n* `deliverArg` - Deliver arg to pass to the target application.\n * `deliverArgSize` - Size of the deliver arg, maximum 0x300 bytes.\n * `hmac` - HMAC buffer, 32 bytes. Use NULL to pass an all-zero dummy HMAC."] - pub fn aptSetChainloaderArgs( - deliverArg: *const ::libc::c_void, - deliverArgSize: usize, - hmac: *const ::libc::c_void, - ); -} -extern "C" { - #[must_use] - #[doc = "Gets an APT lock handle.\n # Arguments\n\n* `flags` - Flags to use.\n * `lockHandle` - Pointer to output the lock handle to."] - pub fn APT_GetLockHandle(flags: u16_, lockHandle: *mut Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initializes an application's registration with APT.\n # Arguments\n\n* `appId` - ID of the application.\n * `attr` - Attributes of the application.\n * `signalEvent` - Pointer to output the signal event handle to.\n * `resumeEvent` - Pointer to output the resume event handle to."] - pub fn APT_Initialize( - appId: NS_APPID, - attr: APT_AppletAttr, - signalEvent: *mut Handle, - resumeEvent: *mut Handle, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Terminates an application's registration with APT.\n # Arguments\n\n* `appID` - ID of the application."] - pub fn APT_Finalize(appId: NS_APPID) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Asynchronously resets the hardware."] - pub fn APT_HardwareResetAsync() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Enables APT.\n # Arguments\n\n* `attr` - Attributes of the application."] - pub fn APT_Enable(attr: APT_AppletAttr) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets applet management info.\n # Arguments\n\n* `inpos` - Requested applet position.\n * `outpos` - Pointer to output the position of the current applet to.\n * `req_appid` - Pointer to output the AppID of the applet at the requested position to.\n * `menu_appid` - Pointer to output the HOME menu AppID to.\n * `active_appid` - Pointer to output the AppID of the currently active applet to."] - 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" { - #[doc = "Gets the menu's app ID.\n # Returns\n\nThe menu's app ID."] - #[link_name = "aptGetMenuAppID__extern"] - pub fn aptGetMenuAppID() -> NS_APPID; -} -extern "C" { - #[must_use] - #[doc = "Gets an applet's information.\n # Arguments\n\n* `appID` - AppID of the applet.\n * `pProgramID` - Pointer to output the program ID to.\n * `pMediaType` - Pointer to output the media type to.\n * `pRegistered` - Pointer to output the registration status to.\n * `pLoadState` - Pointer to output the load state to.\n * `pAttributes` - Pointer to output the applet atrributes to."] - 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" { - #[must_use] - #[doc = "Gets an applet's program information.\n # Arguments\n\n* `id` - ID of the applet.\n * `flags` - Flags to use when retreiving the information.\n * `titleversion` - Pointer to output the applet's title version to.\n\n Flags:\n - 0x01: Use AM_ListTitles with NAND media type.\n - 0x02: Use AM_ListTitles with SDMC media type.\n - 0x04: Use AM_ListTitles with GAMECARD media type.\n - 0x10: Input ID is an app ID. Must be set if 0x20 is not.\n - 0x20: Input ID is a program ID. Must be set if 0x10 is not.\n - 0x100: Sets program ID high to 0x00040000, else it is 0x00040010. Only used when 0x20 is set."] - pub fn APT_GetAppletProgramInfo(id: u32_, flags: u32_, titleversion: *mut u16_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the current application's program ID.\n # Arguments\n\n* `pProgramID` - Pointer to output the program ID to."] - pub fn APT_GetProgramID(pProgramID: *mut u64_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Prepares to jump to the home menu."] - pub fn APT_PrepareToJumpToHomeMenu() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Jumps to the home menu.\n # Arguments\n\n* `param` - Parameters to jump with.\n * `Size` - of the parameter buffer.\n * `handle` - Handle to pass."] - pub fn APT_JumpToHomeMenu( - param: *const ::libc::c_void, - paramSize: usize, - handle: Handle, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Prepares to jump to an application.\n # Arguments\n\n* `exiting` - Specifies whether the applet is exiting."] - pub fn APT_PrepareToJumpToApplication(exiting: bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Jumps to an application.\n # Arguments\n\n* `param` - Parameters to jump with.\n * `Size` - of the parameter buffer.\n * `handle` - Handle to pass."] - pub fn APT_JumpToApplication( - param: *const ::libc::c_void, - paramSize: usize, - handle: Handle, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets whether an application is registered.\n # Arguments\n\n* `appID` - ID of the application.\n * `out` - Pointer to output the registration state to."] - pub fn APT_IsRegistered(appID: NS_APPID, out: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Inquires as to whether a signal has been received.\n # Arguments\n\n* `appID` - ID of the application.\n * `signalType` - Pointer to output the signal type to."] - pub fn APT_InquireNotification(appID: u32_, signalType: *mut APT_Signal) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Requests to enter sleep mode, and later sets wake events if allowed to.\n # Arguments\n\n* `wakeEvents` - The wake events. Limited to \"shell\" (bit 1) for the PDN wake events part\n and \"shell opened\", \"shell closed\" and \"HOME button pressed\" for the MCU interrupts part."] - pub fn APT_SleepSystem(wakeEvents: *const PtmWakeEvents) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Notifies an application to wait.\n # Arguments\n\n* `appID` - ID of the application."] - pub fn APT_NotifyToWait(appID: NS_APPID) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Calls an applet utility function.\n # Arguments\n\n* `id` - Utility function to call.\n * `out` - Pointer to write output data to.\n * `outSize` - Size of the output buffer.\n * `in` - Pointer to the input data.\n * `inSize` - Size of the input buffer."] - 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" { - #[must_use] - #[doc = "Sleeps if shell is closed (?)."] - pub fn APT_SleepIfShellClosed() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Locks a transition (?).\n # Arguments\n\n* `transition` - Transition ID.\n * `flag` - Flag (?)"] - pub fn APT_LockTransition(transition: u32_, flag: bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Tries to lock a transition (?).\n # Arguments\n\n* `transition` - Transition ID.\n * `succeeded` - Pointer to output whether the lock was successfully applied."] - pub fn APT_TryLockTransition(transition: u32_, succeeded: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Unlocks a transition (?).\n # Arguments\n\n* `transition` - Transition ID."] - pub fn APT_UnlockTransition(transition: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Glances at a receieved parameter without removing it from the queue.\n # Arguments\n\n* `appID` - AppID of the application.\n * `buffer` - Buffer to receive to.\n * `bufferSize` - Size of the buffer.\n * `sender` - Pointer to output the sender's AppID to.\n * `command` - Pointer to output the command ID to.\n * `actualSize` - Pointer to output the actual received data size to.\n * `parameter` - Pointer to output the parameter handle to."] - 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" { - #[must_use] - #[doc = "Receives a parameter.\n # Arguments\n\n* `appID` - AppID of the application.\n * `buffer` - Buffer to receive to.\n * `bufferSize` - Size of the buffer.\n * `sender` - Pointer to output the sender's AppID to.\n * `command` - Pointer to output the command ID to.\n * `actualSize` - Pointer to output the actual received data size to.\n * `parameter` - Pointer to output the parameter handle to."] - 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" { - #[must_use] - #[doc = "Sends a parameter.\n # Arguments\n\n* `source` - AppID of the source application.\n * `dest` - AppID of the destination application.\n * `command` - Command to send.\n * `buffer` - Buffer to send.\n * `bufferSize` - Size of the buffer.\n * `parameter` - Parameter handle to pass."] - 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" { - #[must_use] - #[doc = "Cancels a parameter which matches the specified source and dest AppIDs.\n # Arguments\n\n* `source` - AppID of the source application (use APPID_NONE to disable the check).\n * `dest` - AppID of the destination application (use APPID_NONE to disable the check).\n * `success` - Pointer to output true if a parameter was cancelled, or false otherwise."] - pub fn APT_CancelParameter(source: NS_APPID, dest: NS_APPID, success: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sends capture buffer information.\n # Arguments\n\n* `captureBuf` - Capture buffer information to send."] - pub fn APT_SendCaptureBufferInfo(captureBuf: *const aptCaptureBufInfo) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Replies to a sleep query.\n # Arguments\n\n* `appID` - ID of the application.\n * `reply` - Query reply value."] - pub fn APT_ReplySleepQuery(appID: NS_APPID, reply: APT_QueryReply) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Replies that a sleep notification has been completed.\n # Arguments\n\n* `appID` - ID of the application."] - pub fn APT_ReplySleepNotificationComplete(appID: NS_APPID) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Prepares to close the application.\n # Arguments\n\n* `cancelPreload` - Whether applet preloads should be cancelled."] - pub fn APT_PrepareToCloseApplication(cancelPreload: bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Closes the application.\n # Arguments\n\n* `param` - Parameters to close with.\n * `paramSize` - Size of param.\n * `handle` - Handle to pass."] - pub fn APT_CloseApplication( - param: *const ::libc::c_void, - paramSize: usize, - handle: Handle, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the application's CPU time limit.\n # Arguments\n\n* `percent` - CPU time limit percentage to set."] - pub fn APT_SetAppCpuTimeLimit(percent: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the application's CPU time limit.\n # Arguments\n\n* `percent` - Pointer to output the CPU time limit percentage to."] - pub fn APT_GetAppCpuTimeLimit(percent: *mut u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Checks whether the system is a New 3DS.\n # Arguments\n\n* `out` - Pointer to write the New 3DS flag to."] - pub fn APT_CheckNew3DS(out: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Prepares for an applicaton jump.\n # Arguments\n\n* `flags` - Flags to use.\n * `programID` - ID of the program to jump to.\n * `mediatype` - Media type of the program to jump to."] - pub fn APT_PrepareToDoApplicationJump(flags: u8_, programID: u64_, mediatype: u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Performs an application jump.\n # Arguments\n\n* `param` - Parameter buffer.\n * `paramSize` - Size of parameter buffer.\n * `hmac` - HMAC buffer (should be 0x20 bytes long)."] - pub fn APT_DoApplicationJump( - param: *const ::libc::c_void, - paramSize: usize, - hmac: *const ::libc::c_void, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Prepares to start a library applet.\n # Arguments\n\n* `appID` - AppID of the applet to start."] - pub fn APT_PrepareToStartLibraryApplet(appID: NS_APPID) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Starts a library applet.\n # Arguments\n\n* `appID` - AppID of the applet to launch.\n * `param` - Buffer containing applet parameters.\n * `paramsize` - Size of the buffer.\n * `handle` - Handle to pass to the applet."] - pub fn APT_StartLibraryApplet( - appID: NS_APPID, - param: *const ::libc::c_void, - paramSize: usize, - handle: Handle, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Prepares to start a system applet.\n # Arguments\n\n* `appID` - AppID of the applet to start."] - pub fn APT_PrepareToStartSystemApplet(appID: NS_APPID) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Starts a system applet.\n # Arguments\n\n* `appID` - AppID of the applet to launch.\n * `param` - Buffer containing applet parameters.\n * `paramSize` - Size of the parameter buffer.\n * `handle` - Handle to pass to the applet."] - pub fn APT_StartSystemApplet( - appID: NS_APPID, - param: *const ::libc::c_void, - paramSize: usize, - handle: Handle, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Retrieves the shared system font.\n fontHandle Pointer to write the handle of the system font memory block to.\n mapAddr Pointer to write the mapping address of the system font memory block to."] - pub fn APT_GetSharedFont(fontHandle: *mut Handle, mapAddr: *mut u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Receives the deliver (launch) argument\n # Arguments\n\n* `param` - Parameter buffer.\n * `paramSize` - Size of parameter buffer.\n * `hmac` - HMAC buffer (should be 0x20 bytes long).\n * `sender` - Pointer to output the sender's AppID to.\n * `received` - Pointer to output whether an argument was received to."] - pub fn APT_ReceiveDeliverArg( - param: *mut ::libc::c_void, - paramSize: usize, - hmac: *mut ::libc::c_void, - sender: *mut u64_, - received: *mut bool, - ) -> Result; -} -#[doc = "BOSS context."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -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], -} -impl Default for bossContext { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -pub const BOSSTASKSTATUS_STARTED: bossTaskStatus = 2; -pub const BOSSTASKSTATUS_ERROR: bossTaskStatus = 7; -#[doc = "BOSS task status."] -pub type bossTaskStatus = ::libc::c_uint; -pub const bossNsDataHeaderInfoType_ContentSize: bossNsDataHeaderInfoTypes = 3; -#[doc = "Type values for bossGetNsDataHeaderInfo()."] -pub type bossNsDataHeaderInfoTypes = ::libc::c_uint; -pub const bossNsDataHeaderInfoTypeSize_ContentSize: bossNsDataHeaderInfoTypeSizes = 4; -#[doc = "Size of the output data for bossGetNsDataHeaderInfo()."] -pub type bossNsDataHeaderInfoTypeSizes = ::libc::c_uint; -extern "C" { - #[must_use] - #[doc = "Initializes BOSS.\n # Arguments\n\n* `programID` - programID to use, 0 for the current process. Only used when BOSSP is available without *hax payload.\n * `force_user` - When true, just use bossU instead of trying to initialize with bossP first."] - pub fn bossInit(programID: u64_, force_user: bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Run the InitializeSession service cmd. This is mainly for changing the programID associated with the current BOSS session.\n # Arguments\n\n* `programID` - programID to use, 0 for the current process."] - pub fn bossReinit(programID: u64_) -> Result; -} -extern "C" { - #[doc = "Exits BOSS."] - pub fn bossExit(); -} -extern "C" { - #[doc = "Returns the BOSS session handle."] - pub fn bossGetSessionHandle() -> Handle; -} -extern "C" { - #[must_use] - #[doc = "Set the content data storage location.\n # Arguments\n\n* `extdataID` - u64 extdataID, must have the high word set to the shared-extdata value when it's for NAND.\n * `boss_size` - Probably the max size in the extdata which BOSS can use.\n * `mediaType` - Roughly the same as FS mediatype."] - pub fn bossSetStorageInfo(extdataID: u64_, boss_size: u32_, mediaType: u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Unregister the content data storage location, which includes unregistering the BOSS-session programID with BOSS."] - pub fn bossUnregisterStorage() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Register a task.\n # Arguments\n\n* `taskID` - BOSS taskID.\n * `unk0` - Unknown, usually zero.\n * `unk1` - Unknown, usually zero."] - pub fn bossRegisterTask(taskID: *const ::libc::c_char, unk0: u8_, unk1: u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Send a property.\n # Arguments\n\n* `PropertyID` - PropertyID\n * `buf` - Input buffer data.\n * `size` - Buffer size."] - pub fn bossSendProperty(PropertyID: u16_, buf: *const ::libc::c_void, size: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Deletes the content file for the specified NsDataId.\n # Arguments\n\n* `NsDataId` - NsDataId"] - pub fn bossDeleteNsData(NsDataId: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets header info for the specified NsDataId.\n # Arguments\n\n* `NsDataId` - NsDataId\n * `type` - Type of data to load.\n * `buffer` - Output buffer.\n * `size` - Output buffer size."] - pub fn bossGetNsDataHeaderInfo( - NsDataId: u32_, - type_: u8_, - buffer: *mut ::libc::c_void, - size: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Reads data from the content for the specified NsDataId.\n # Arguments\n\n* `NsDataId` - NsDataId\n * `offset` - Offset in the content.\n * `buffer` - Output buffer.\n * `size` - Output buffer size.\n * `transfer_total` - Optional output actual read size, can be NULL.\n * `unk_out` - Optional unknown output, can be NULL."] - 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" { - #[must_use] - #[doc = "Starts a task soon after running this command.\n # Arguments\n\n* `taskID` - BOSS taskID."] - pub fn bossStartTaskImmediate(taskID: *const ::libc::c_char) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Similar to bossStartTaskImmediate?\n # Arguments\n\n* `taskID` - BOSS taskID."] - pub fn bossStartBgImmediate(taskID: *const ::libc::c_char) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Deletes a task by using CancelTask and UnregisterTask internally.\n # Arguments\n\n* `taskID` - BOSS taskID.\n * `unk` - Unknown, usually zero?"] - pub fn bossDeleteTask(taskID: *const ::libc::c_char, unk: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Returns task state.\n # Arguments\n\n* `taskID` - BOSS taskID.\n * `inval` - Unknown, normally 0?\n * `status` - Output status, see bossTaskStatus.\n * `out1` - Output field.\n * `out2` - Output field."] - pub fn bossGetTaskState( - taskID: *const ::libc::c_char, - inval: s8, - status: *mut u8_, - out1: *mut u32_, - out2: *mut u8_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "This loads the current state of PropertyID 0x0 for the specified task.\n # Arguments\n\n* `taskID` - BOSS taskID."] - pub fn bossGetTaskProperty0(taskID: *const ::libc::c_char, out: *mut u8_) -> Result; -} -extern "C" { - #[doc = "Setup a BOSS context with the default config.\n # Arguments\n\n* `bossContext` - BOSS context.\n * `seconds_interval` - Interval in seconds for running the task automatically.\n * `url` - Task URL."] - pub fn bossSetupContextDefault( - ctx: *mut bossContext, - seconds_interval: u32_, - url: *const ::libc::c_char, - ); -} -extern "C" { - #[must_use] - #[doc = "Sends the config stored in the context. Used before registering a task.\n # Arguments\n\n* `bossContext` - BOSS context."] - pub fn bossSendContextConfig(ctx: *mut bossContext) -> Result; -} -#[doc = "< 8-bit per component, planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples).Usually named YUV422P."] -pub const INPUT_YUV422_INDIV_8: Y2RU_InputFormat = 0; -#[doc = "< 8-bit per component, planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples).Usually named YUV420P."] -pub const INPUT_YUV420_INDIV_8: Y2RU_InputFormat = 1; -#[doc = "< 16-bit per component, planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples).Usually named YUV422P16."] -pub const INPUT_YUV422_INDIV_16: Y2RU_InputFormat = 2; -#[doc = "< 16-bit per component, planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples).Usually named YUV420P16."] -pub const INPUT_YUV420_INDIV_16: Y2RU_InputFormat = 3; -#[doc = "< 8-bit per component, packed YUV 4:2:2, 16bpp, (Y0 Cb Y1 Cr).Usually named YUYV422."] -pub const INPUT_YUV422_BATCH: Y2RU_InputFormat = 4; -#[doc = "Input color formats\n\n For the 16-bit per component formats, bits 15-8 are padding and 7-0 contains the value."] -pub type Y2RU_InputFormat = ::libc::c_uint; -#[doc = "< 32-bit RGBA8888. The alpha component is the 8-bit value set by Y2RU_SetAlpha"] -pub const OUTPUT_RGB_32: Y2RU_OutputFormat = 0; -#[doc = "< 24-bit RGB888."] -pub const OUTPUT_RGB_24: Y2RU_OutputFormat = 1; -#[doc = "< 16-bit RGBA5551. The alpha bit is the 7th bit of the alpha value set by Y2RU_SetAlpha"] -pub const OUTPUT_RGB_16_555: Y2RU_OutputFormat = 2; -#[doc = "< 16-bit RGB565."] -pub const OUTPUT_RGB_16_565: Y2RU_OutputFormat = 3; -#[doc = "Output color formats\n\n Those are the same as the framebuffer and GPU texture formats."] -pub type Y2RU_OutputFormat = ::libc::c_uint; -#[doc = "< No rotation."] -pub const ROTATION_NONE: Y2RU_Rotation = 0; -#[doc = "< Clockwise 90 degrees."] -pub const ROTATION_CLOCKWISE_90: Y2RU_Rotation = 1; -#[doc = "< Clockwise 180 degrees."] -pub const ROTATION_CLOCKWISE_180: Y2RU_Rotation = 2; -#[doc = "< Clockwise 270 degrees."] -pub const ROTATION_CLOCKWISE_270: Y2RU_Rotation = 3; -#[doc = "Rotation to be applied to the output."] -pub type Y2RU_Rotation = ::libc::c_uint; -#[doc = "< The result buffer will be laid out in linear format, the usual way."] -pub const BLOCK_LINE: Y2RU_BlockAlignment = 0; -#[doc = "< The result will be stored as 8x8 blocks in Z-order.Useful for textures since it is the format used by the PICA200."] -pub const BLOCK_8_BY_8: Y2RU_BlockAlignment = 1; -#[doc = "Block alignment of output\n\n Defines the way the output will be laid out in memory."] -pub type Y2RU_BlockAlignment = ::libc::c_uint; -#[doc = "Coefficients of the YUV->RGB conversion formula.\n\n A set of coefficients configuring the RGB to YUV conversion. Coefficients 0-4 are unsigned 2.8\n fixed pointer numbers representing entries on the conversion matrix, while coefficient 5-7 are\n signed 11.5 fixed point numbers added as offsets to the RGB result.\n\n The overall conversion process formula is:\n R = trunc((rgb_Y * Y + r_V * V) + 0.75 + r_offset)\n G = trunc((rgb_Y * Y - g_U * U - g_V * V) + 0.75 + g_offset)\n B = trunc((rgb_Y * Y + b_U * U ) + 0.75 + b_offset)\n "] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct Y2RU_ColorCoefficients { - #[doc = "< RGB per unit Y."] - pub rgb_Y: u16_, - #[doc = "< Red per unit V."] - pub r_V: u16_, - #[doc = "< Green per unit V."] - pub g_V: u16_, - #[doc = "< Green per unit U."] - pub g_U: u16_, - #[doc = "< Blue per unit U."] - pub b_U: u16_, - #[doc = "< Red offset."] - pub r_offset: u16_, - #[doc = "< Green offset."] - pub g_offset: u16_, - #[doc = "< Blue offset."] - pub b_offset: u16_, -} -#[doc = "< Coefficients from the ITU-R BT.601 standard with PC ranges."] -pub const COEFFICIENT_ITU_R_BT_601: Y2RU_StandardCoefficient = 0; -#[doc = "< Coefficients from the ITU-R BT.709 standard with PC ranges."] -pub const COEFFICIENT_ITU_R_BT_709: Y2RU_StandardCoefficient = 1; -#[doc = "< Coefficients from the ITU-R BT.601 standard with TV ranges."] -pub const COEFFICIENT_ITU_R_BT_601_SCALING: Y2RU_StandardCoefficient = 2; -#[doc = "< Coefficients from the ITU-R BT.709 standard with TV ranges."] -pub const COEFFICIENT_ITU_R_BT_709_SCALING: Y2RU_StandardCoefficient = 3; -#[doc = "Preset conversion coefficients based on ITU standards for the YUV->RGB formula.\n\n For more details refer to Y2RU_ColorCoefficients"] -pub type Y2RU_StandardCoefficient = ::libc::c_uint; -#[doc = "Structure used to configure all parameters at once.\n\n You can send a batch of configuration parameters using this structure and Y2RU_SetConversionParams."] -#[repr(C)] -#[repr(align(4))] -#[derive(Debug, Copy, Clone)] -pub struct Y2RU_ConversionParams { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, - #[doc = "< Value passed to Y2RU_SetInputLineWidth"] - pub input_line_width: s16, - #[doc = "< Value passed to Y2RU_SetInputLines"] - pub input_lines: s16, - pub _bitfield_align_2: [u8; 0], - pub _bitfield_2: __BindgenBitfieldUnit<[u8; 1usize]>, - #[doc = "< Unused."] - pub unused: u8_, - #[doc = "< Value passed to Y2RU_SetAlpha"] - pub alpha: u16_, -} -impl Default for Y2RU_ConversionParams { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -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]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = 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]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = 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 - } -} -#[doc = "Dithering weights."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct Y2RU_DitheringWeightParams { - #[doc = "< Weight 0 for even X, even Y."] - pub w0_xEven_yEven: u16_, - #[doc = "< Weight 0 for odd X, even Y."] - pub w0_xOdd_yEven: u16_, - #[doc = "< Weight 0 for even X, odd Y."] - pub w0_xEven_yOdd: u16_, - #[doc = "< Weight 0 for odd X, odd Y."] - pub w0_xOdd_yOdd: u16_, - #[doc = "< Weight 1 for even X, even Y."] - pub w1_xEven_yEven: u16_, - #[doc = "< Weight 1 for odd X, even Y."] - pub w1_xOdd_yEven: u16_, - #[doc = "< Weight 1 for even X, odd Y."] - pub w1_xEven_yOdd: u16_, - #[doc = "< Weight 1 for odd X, odd Y."] - pub w1_xOdd_yOdd: u16_, - #[doc = "< Weight 2 for even X, even Y."] - pub w2_xEven_yEven: u16_, - #[doc = "< Weight 2 for odd X, even Y."] - pub w2_xOdd_yEven: u16_, - #[doc = "< Weight 2 for even X, odd Y."] - pub w2_xEven_yOdd: u16_, - #[doc = "< Weight 2 for odd X, odd Y."] - pub w2_xOdd_yOdd: u16_, - #[doc = "< Weight 3 for even X, even Y."] - pub w3_xEven_yEven: u16_, - #[doc = "< Weight 3 for odd X, even Y."] - pub w3_xOdd_yEven: u16_, - #[doc = "< Weight 3 for even X, odd Y."] - pub w3_xEven_yOdd: u16_, - #[doc = "< Weight 3 for odd X, odd Y."] - pub w3_xOdd_yOdd: u16_, -} -extern "C" { - #[must_use] - #[doc = "Initializes the y2r service.\n\n This will internally get the handle of the service, and on success call Y2RU_DriverInitialize."] - pub fn y2rInit() -> Result; -} -extern "C" { - #[doc = "Closes the y2r service.\n\n This will internally call Y2RU_DriverFinalize and close the handle of the service."] - pub fn y2rExit(); -} -extern "C" { - #[must_use] - #[doc = "Used to configure the input format.\n # Arguments\n\n* `format` - Input format to use.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] - pub fn Y2RU_SetInputFormat(format: Y2RU_InputFormat) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the configured input format.\n # Arguments\n\n* `format` - Pointer to output the input format to."] - pub fn Y2RU_GetInputFormat(format: *mut Y2RU_InputFormat) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Used to configure the output format.\n # Arguments\n\n* `format` - Output format to use.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] - pub fn Y2RU_SetOutputFormat(format: Y2RU_OutputFormat) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the configured output format.\n # Arguments\n\n* `format` - Pointer to output the output format to."] - pub fn Y2RU_GetOutputFormat(format: *mut Y2RU_OutputFormat) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Used to configure the rotation of the output.\n # Arguments\n\n* `rotation` - Rotation to use.\n\n It seems to apply the rotation per batch of 8 lines, so the output will be (height/8) images of size 8 x width.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] - pub fn Y2RU_SetRotation(rotation: Y2RU_Rotation) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the configured rotation.\n # Arguments\n\n* `rotation` - Pointer to output the rotation to."] - pub fn Y2RU_GetRotation(rotation: *mut Y2RU_Rotation) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Used to configure the alignment of the output buffer.\n # Arguments\n\n* `alignment` - Alignment to use.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] - pub fn Y2RU_SetBlockAlignment(alignment: Y2RU_BlockAlignment) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the configured alignment.\n # Arguments\n\n* `alignment` - Pointer to output the alignment to."] - pub fn Y2RU_GetBlockAlignment(alignment: *mut Y2RU_BlockAlignment) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets whether to use spacial dithering.\n # Arguments\n\n* `enable` - Whether to use spacial dithering."] - pub fn Y2RU_SetSpacialDithering(enable: bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets whether to use spacial dithering.\n # Arguments\n\n* `enable` - Pointer to output the spacial dithering state to."] - pub fn Y2RU_GetSpacialDithering(enabled: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets whether to use temporal dithering.\n # Arguments\n\n* `enable` - Whether to use temporal dithering."] - pub fn Y2RU_SetTemporalDithering(enable: bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets whether to use temporal dithering.\n # Arguments\n\n* `enable` - Pointer to output the temporal dithering state to."] - pub fn Y2RU_GetTemporalDithering(enabled: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Used to configure the width of the image.\n # Arguments\n\n* `line_width` - Width of the image in pixels. Must be a multiple of 8, up to 1024.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] - pub fn Y2RU_SetInputLineWidth(line_width: u16_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the configured input line width.\n # Arguments\n\n* `line_width` - Pointer to output the line width to."] - pub fn Y2RU_GetInputLineWidth(line_width: *mut u16_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Used to configure the height of the image.\n # Arguments\n\n* `num_lines` - Number of lines to be converted.\n\n A multiple of 8 seems to be preferred.\n If using the BLOCK_8_BY_8 mode, it must be a multiple of 8.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] - pub fn Y2RU_SetInputLines(num_lines: u16_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the configured number of input lines.\n # Arguments\n\n* `num_lines` - Pointer to output the input lines to."] - pub fn Y2RU_GetInputLines(num_lines: *mut u16_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Used to configure the color conversion formula.\n # Arguments\n\n* `coefficients` - Coefficients to use.\n\n See Y2RU_ColorCoefficients for more information about the coefficients.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] - pub fn Y2RU_SetCoefficients(coefficients: *const Y2RU_ColorCoefficients) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the configured color coefficients.\n # Arguments\n\n* `num_lines` - Pointer to output the coefficients to."] - pub fn Y2RU_GetCoefficients(coefficients: *mut Y2RU_ColorCoefficients) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Used to configure the color conversion formula with ITU stantards coefficients.\n # Arguments\n\n* `coefficient` - Standard coefficient to use.\n\n See Y2RU_ColorCoefficients for more information about the coefficients.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] - pub fn Y2RU_SetStandardCoefficient(coefficient: Y2RU_StandardCoefficient) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the color coefficient parameters of a standard coefficient.\n # Arguments\n\n* `coefficients` - Pointer to output the coefficients to.\n * `standardCoeff` - Standard coefficient to check."] - pub fn Y2RU_GetStandardCoefficient( - coefficients: *mut Y2RU_ColorCoefficients, - standardCoeff: Y2RU_StandardCoefficient, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Used to configure the alpha value of the output.\n # Arguments\n\n* `alpha` - 8-bit value to be used for the output when the format requires it.\n\n > **Note:** Prefer using Y2RU_SetConversionParams if you have to set multiple parameters."] - pub fn Y2RU_SetAlpha(alpha: u16_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the configured output alpha value.\n # Arguments\n\n* `alpha` - Pointer to output the alpha value to."] - pub fn Y2RU_GetAlpha(alpha: *mut u16_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Used to enable the end of conversion interrupt.\n # Arguments\n\n* `should_interrupt` - Enables the interrupt if true, disable it if false.\n\n It is possible to fire an interrupt when the conversion is finished, and that the DMA is done copying the data.\n This interrupt will then be used to fire an event. See Y2RU_GetTransferEndEvent.\n By default the interrupt is enabled.\n\n > **Note:** It seems that the event can be fired too soon in some cases, depending the transfer_unit size.Please see the note at Y2RU_SetReceiving"] - pub fn Y2RU_SetTransferEndInterrupt(should_interrupt: bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets whether the transfer end interrupt is enabled.\n # Arguments\n\n* `should_interrupt` - Pointer to output the interrupt state to."] - pub fn Y2RU_GetTransferEndInterrupt(should_interrupt: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets an handle to the end of conversion event.\n # Arguments\n\n* `end_event` - Pointer to the event handle to be set to the end of conversion event. It isn't necessary to create or close this handle.\n\n To enable this event you have to use C} Y2RU_SetTransferEndInterrupt(true);The event will be triggered when the corresponding interrupt is fired.\n\n > **Note:** It is recommended to use a timeout when waiting on this event, as it sometimes (but rarely) isn't triggered."] - pub fn Y2RU_GetTransferEndEvent(end_event: *mut Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Configures the Y plane buffer.\n # Arguments\n\n* `src_buf` - A pointer to the beginning of your Y data buffer.\n * `image_size` - The total size of the data buffer.\n * `transfer_unit` - Specifies the size of 1 DMA transfer. Usually set to 1 line. This has to be a divisor of image_size.\n * `transfer_gap` - Specifies the gap (offset) to be added after each transfer. Can be used to convert images with stride or only a part of it.\n\n transfer_unit+transfer_gap must be less than 32768 (0x8000)\n\n This specifies the Y data buffer for the planar input formats (INPUT_YUV42*_INDIV_*).\n The actual transfer will only happen after calling Y2RU_StartConversion."] - pub fn Y2RU_SetSendingY( - src_buf: *const ::libc::c_void, - image_size: u32_, - transfer_unit: s16, - transfer_gap: s16, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Configures the U plane buffer.\n # Arguments\n\n* `src_buf` - A pointer to the beginning of your Y data buffer.\n * `image_size` - The total size of the data buffer.\n * `transfer_unit` - Specifies the size of 1 DMA transfer. Usually set to 1 line. This has to be a divisor of image_size.\n * `transfer_gap` - Specifies the gap (offset) to be added after each transfer. Can be used to convert images with stride or only a part of it.\n\n transfer_unit+transfer_gap must be less than 32768 (0x8000)\n\n This specifies the U data buffer for the planar input formats (INPUT_YUV42*_INDIV_*).\n The actual transfer will only happen after calling Y2RU_StartConversion."] - pub fn Y2RU_SetSendingU( - src_buf: *const ::libc::c_void, - image_size: u32_, - transfer_unit: s16, - transfer_gap: s16, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Configures the V plane buffer.\n # Arguments\n\n* `src_buf` - A pointer to the beginning of your Y data buffer.\n * `image_size` - The total size of the data buffer.\n * `transfer_unit` - Specifies the size of 1 DMA transfer. Usually set to 1 line. This has to be a divisor of image_size.\n * `transfer_gap` - Specifies the gap (offset) to be added after each transfer. Can be used to convert images with stride or only a part of it.\n\n transfer_unit+transfer_gap must be less than 32768 (0x8000)\n\n This specifies the V data buffer for the planar input formats (INPUT_YUV42*_INDIV_*).\n The actual transfer will only happen after calling Y2RU_StartConversion."] - pub fn Y2RU_SetSendingV( - src_buf: *const ::libc::c_void, - image_size: u32_, - transfer_unit: s16, - transfer_gap: s16, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Configures the YUYV source buffer.\n # Arguments\n\n* `src_buf` - A pointer to the beginning of your Y data buffer.\n * `image_size` - The total size of the data buffer.\n * `transfer_unit` - Specifies the size of 1 DMA transfer. Usually set to 1 line. This has to be a divisor of image_size.\n * `transfer_gap` - Specifies the gap (offset) to be added after each transfer. Can be used to convert images with stride or only a part of it.\n\n transfer_unit+transfer_gap must be less than 32768 (0x8000)\n\n This specifies the YUYV data buffer for the packed input format INPUT_YUV422_BATCH.\n The actual transfer will only happen after calling Y2RU_StartConversion."] - pub fn Y2RU_SetSendingYUYV( - src_buf: *const ::libc::c_void, - image_size: u32_, - transfer_unit: s16, - transfer_gap: s16, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Configures the destination buffer.\n # Arguments\n\n* `src_buf` - A pointer to the beginning of your destination buffer in FCRAM\n * `image_size` - The total size of the data buffer.\n * `transfer_unit` - Specifies the size of 1 DMA transfer. Usually set to 1 line. This has to be a divisor of image_size.\n * `transfer_gap` - Specifies the gap (offset) to be added after each transfer. Can be used to convert images with stride or only a part of it.\n\n This specifies the destination buffer of the conversion.\n The actual transfer will only happen after calling Y2RU_StartConversion.\n The buffer does NOT need to be allocated in the linear heap.\n\n transfer_unit+transfer_gap must be less than 32768 (0x8000)\n\n > **Note:** It seems that depending on the size of the image and of the transfer unit,it is possible for the end of conversion interrupt to be triggered right after the conversion began.One line as transfer_unit seems to trigger this issue for 400x240, setting to 2/4/8 lines fixes it.\n\n > **Note:** Setting a transfer_unit of 4 or 8 lines seems to bring the best results in terms of speed for a 400x240 image."] - pub fn Y2RU_SetReceiving( - dst_buf: *mut ::libc::c_void, - image_size: u32_, - transfer_unit: s16, - transfer_gap: s16, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Checks if the DMA has finished sending the Y buffer.\n # Arguments\n\n* `is_done` - Pointer to the boolean that will hold the result.\n\n True if the DMA has finished transferring the Y plane, false otherwise. To be used with Y2RU_SetSendingY."] - pub fn Y2RU_IsDoneSendingY(is_done: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Checks if the DMA has finished sending the U buffer.\n # Arguments\n\n* `is_done` - Pointer to the boolean that will hold the result.\n\n True if the DMA has finished transferring the U plane, false otherwise. To be used with Y2RU_SetSendingU."] - pub fn Y2RU_IsDoneSendingU(is_done: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Checks if the DMA has finished sending the V buffer.\n # Arguments\n\n* `is_done` - Pointer to the boolean that will hold the result.\n\n True if the DMA has finished transferring the V plane, false otherwise. To be used with Y2RU_SetSendingV."] - pub fn Y2RU_IsDoneSendingV(is_done: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Checks if the DMA has finished sending the YUYV buffer.\n # Arguments\n\n* `is_done` - Pointer to the boolean that will hold the result.\n\n True if the DMA has finished transferring the YUYV buffer, false otherwise. To be used with Y2RU_SetSendingYUYV."] - pub fn Y2RU_IsDoneSendingYUYV(is_done: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Checks if the DMA has finished sending the converted result.\n # Arguments\n\n* `is_done` - Pointer to the boolean that will hold the result.\n\n True if the DMA has finished transferring data to your destination buffer, false otherwise."] - pub fn Y2RU_IsDoneReceiving(is_done: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Configures the dithering weight parameters.\n # Arguments\n\n* `params` - Dithering weight parameters to use."] - pub fn Y2RU_SetDitheringWeightParams(params: *const Y2RU_DitheringWeightParams) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the configured dithering weight parameters.\n # Arguments\n\n* `params` - Pointer to output the dithering weight parameters to."] - pub fn Y2RU_GetDitheringWeightParams(params: *mut Y2RU_DitheringWeightParams) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets all of the parameters of Y2RU_ConversionParams at once.\n # Arguments\n\n* `params` - Conversion parameters to set.\n\n Faster than calling the individual value through Y2R_Set* because only one system call is made."] - pub fn Y2RU_SetConversionParams(params: *const Y2RU_ConversionParams) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Starts the conversion process"] - pub fn Y2RU_StartConversion() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Cancels the conversion"] - pub fn Y2RU_StopConversion() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Checks if the conversion and DMA transfer are finished.\n # Arguments\n\n* `is_busy` - Pointer to output the busy state to.\n\n This can have the same problems as the event and interrupt. See Y2RU_SetTransferEndInterrupt."] - pub fn Y2RU_IsBusyConversion(is_busy: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Checks whether Y2R is ready to be used.\n # Arguments\n\n* `ping` - Pointer to output the ready status to."] - pub fn Y2RU_PingProcess(ping: *mut u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initializes the Y2R driver."] - pub fn Y2RU_DriverInitialize() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Terminates the Y2R driver."] - pub fn Y2RU_DriverFinalize() -> Result; -} -#[doc = "< No port."] -pub const PORT_NONE: _bindgen_ty_15 = 0; -#[doc = "< CAM1 port."] -pub const PORT_CAM1: _bindgen_ty_15 = 1; -#[doc = "< CAM2 port."] -pub const PORT_CAM2: _bindgen_ty_15 = 2; -#[doc = "< Both ports."] -pub const PORT_BOTH: _bindgen_ty_15 = 3; -#[doc = "Camera connection target ports."] -pub type _bindgen_ty_15 = ::libc::c_uint; -#[doc = "< No camera."] -pub const SELECT_NONE: _bindgen_ty_16 = 0; -#[doc = "< Outer camera 1."] -pub const SELECT_OUT1: _bindgen_ty_16 = 1; -#[doc = "< Inner camera 1."] -pub const SELECT_IN1: _bindgen_ty_16 = 2; -#[doc = "< Outer camera 2."] -pub const SELECT_OUT2: _bindgen_ty_16 = 4; -#[doc = "< Outer camera 1 and inner camera 1."] -pub const SELECT_IN1_OUT1: _bindgen_ty_16 = 3; -#[doc = "< Both outer cameras."] -pub const SELECT_OUT1_OUT2: _bindgen_ty_16 = 5; -#[doc = "< Inner camera 1 and outer camera 2."] -pub const SELECT_IN1_OUT2: _bindgen_ty_16 = 6; -#[doc = "< All cameras."] -pub const SELECT_ALL: _bindgen_ty_16 = 7; -#[doc = "Camera combinations."] -pub type _bindgen_ty_16 = ::libc::c_uint; -#[doc = "< No context."] -pub const CONTEXT_NONE: CAMU_Context = 0; -#[doc = "< Context A."] -pub const CONTEXT_A: CAMU_Context = 1; -#[doc = "< Context B."] -pub const CONTEXT_B: CAMU_Context = 2; -#[doc = "< Both contexts."] -pub const CONTEXT_BOTH: CAMU_Context = 3; -#[doc = "Camera contexts."] -pub type CAMU_Context = ::libc::c_uint; -#[doc = "< No flip."] -pub const FLIP_NONE: CAMU_Flip = 0; -#[doc = "< Horizontal flip."] -pub const FLIP_HORIZONTAL: CAMU_Flip = 1; -#[doc = "< Vertical flip."] -pub const FLIP_VERTICAL: CAMU_Flip = 2; -#[doc = "< Reverse flip."] -pub const FLIP_REVERSE: CAMU_Flip = 3; -#[doc = "Ways to flip the camera image."] -pub type CAMU_Flip = ::libc::c_uint; -#[doc = "< VGA size. (640x480)"] -pub const SIZE_VGA: CAMU_Size = 0; -#[doc = "< QVGA size. (320x240)"] -pub const SIZE_QVGA: CAMU_Size = 1; -#[doc = "< QQVGA size. (160x120)"] -pub const SIZE_QQVGA: CAMU_Size = 2; -#[doc = "< CIF size. (352x288)"] -pub const SIZE_CIF: CAMU_Size = 3; -#[doc = "< QCIF size. (176x144)"] -pub const SIZE_QCIF: CAMU_Size = 4; -#[doc = "< DS LCD size. (256x192)"] -pub const SIZE_DS_LCD: CAMU_Size = 5; -#[doc = "< DS LCD x4 size. (512x384)"] -pub const SIZE_DS_LCDx4: CAMU_Size = 6; -#[doc = "< CTR Top LCD size. (400x240)"] -pub const SIZE_CTR_TOP_LCD: CAMU_Size = 7; -#[doc = "< CTR Bottom LCD size. (320x240)"] -pub const SIZE_CTR_BOTTOM_LCD: CAMU_Size = 1; -#[doc = "Camera image resolutions."] -pub type CAMU_Size = ::libc::c_uint; -#[doc = "< 15 FPS."] -pub const FRAME_RATE_15: CAMU_FrameRate = 0; -#[doc = "< 15-5 FPS."] -pub const FRAME_RATE_15_TO_5: CAMU_FrameRate = 1; -#[doc = "< 15-2 FPS."] -pub const FRAME_RATE_15_TO_2: CAMU_FrameRate = 2; -#[doc = "< 10 FPS."] -pub const FRAME_RATE_10: CAMU_FrameRate = 3; -#[doc = "< 8.5 FPS."] -pub const FRAME_RATE_8_5: CAMU_FrameRate = 4; -#[doc = "< 5 FPS."] -pub const FRAME_RATE_5: CAMU_FrameRate = 5; -#[doc = "< 20 FPS."] -pub const FRAME_RATE_20: CAMU_FrameRate = 6; -#[doc = "< 20-5 FPS."] -pub const FRAME_RATE_20_TO_5: CAMU_FrameRate = 7; -#[doc = "< 30 FPS."] -pub const FRAME_RATE_30: CAMU_FrameRate = 8; -#[doc = "< 30-5 FPS."] -pub const FRAME_RATE_30_TO_5: CAMU_FrameRate = 9; -#[doc = "< 15-10 FPS."] -pub const FRAME_RATE_15_TO_10: CAMU_FrameRate = 10; -#[doc = "< 20-10 FPS."] -pub const FRAME_RATE_20_TO_10: CAMU_FrameRate = 11; -#[doc = "< 30-10 FPS."] -pub const FRAME_RATE_30_TO_10: CAMU_FrameRate = 12; -#[doc = "Camera capture frame rates."] -pub type CAMU_FrameRate = ::libc::c_uint; -#[doc = "< Auto white balance."] -pub const WHITE_BALANCE_AUTO: CAMU_WhiteBalance = 0; -#[doc = "< 3200K white balance."] -pub const WHITE_BALANCE_3200K: CAMU_WhiteBalance = 1; -#[doc = "< 4150K white balance."] -pub const WHITE_BALANCE_4150K: CAMU_WhiteBalance = 2; -#[doc = "< 5200K white balance."] -pub const WHITE_BALANCE_5200K: CAMU_WhiteBalance = 3; -#[doc = "< 6000K white balance."] -pub const WHITE_BALANCE_6000K: CAMU_WhiteBalance = 4; -#[doc = "< 7000K white balance."] -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; -#[doc = "Camera white balance modes."] -pub type CAMU_WhiteBalance = ::libc::c_uint; -#[doc = "< Normal mode."] -pub const PHOTO_MODE_NORMAL: CAMU_PhotoMode = 0; -#[doc = "< Portrait mode."] -pub const PHOTO_MODE_PORTRAIT: CAMU_PhotoMode = 1; -#[doc = "< Landscape mode."] -pub const PHOTO_MODE_LANDSCAPE: CAMU_PhotoMode = 2; -#[doc = "< Night mode."] -pub const PHOTO_MODE_NIGHTVIEW: CAMU_PhotoMode = 3; -#[doc = "< Letter mode."] -pub const PHOTO_MODE_LETTER: CAMU_PhotoMode = 4; -#[doc = "Camera photo modes."] -pub type CAMU_PhotoMode = ::libc::c_uint; -#[doc = "< No effects."] -pub const EFFECT_NONE: CAMU_Effect = 0; -#[doc = "< Mono effect."] -pub const EFFECT_MONO: CAMU_Effect = 1; -#[doc = "< Sepia effect."] -pub const EFFECT_SEPIA: CAMU_Effect = 2; -#[doc = "< Negative effect."] -pub const EFFECT_NEGATIVE: CAMU_Effect = 3; -#[doc = "< Negative film effect."] -pub const EFFECT_NEGAFILM: CAMU_Effect = 4; -#[doc = "< Sepia effect."] -pub const EFFECT_SEPIA01: CAMU_Effect = 5; -#[doc = "Camera special effects."] -pub type CAMU_Effect = ::libc::c_uint; -#[doc = "< Pattern 1."] -pub const CONTRAST_PATTERN_01: CAMU_Contrast = 0; -#[doc = "< Pattern 2."] -pub const CONTRAST_PATTERN_02: CAMU_Contrast = 1; -#[doc = "< Pattern 3."] -pub const CONTRAST_PATTERN_03: CAMU_Contrast = 2; -#[doc = "< Pattern 4."] -pub const CONTRAST_PATTERN_04: CAMU_Contrast = 3; -#[doc = "< Pattern 5."] -pub const CONTRAST_PATTERN_05: CAMU_Contrast = 4; -#[doc = "< Pattern 6."] -pub const CONTRAST_PATTERN_06: CAMU_Contrast = 5; -#[doc = "< Pattern 7."] -pub const CONTRAST_PATTERN_07: CAMU_Contrast = 6; -#[doc = "< Pattern 8."] -pub const CONTRAST_PATTERN_08: CAMU_Contrast = 7; -#[doc = "< Pattern 9."] -pub const CONTRAST_PATTERN_09: CAMU_Contrast = 8; -#[doc = "< Pattern 10."] -pub const CONTRAST_PATTERN_10: CAMU_Contrast = 9; -#[doc = "< Pattern 11."] -pub const CONTRAST_PATTERN_11: CAMU_Contrast = 10; -#[doc = "< Low contrast. (5)"] -pub const CONTRAST_LOW: CAMU_Contrast = 4; -#[doc = "< Normal contrast. (6)"] -pub const CONTRAST_NORMAL: CAMU_Contrast = 5; -#[doc = "< High contrast. (7)"] -pub const CONTRAST_HIGH: CAMU_Contrast = 6; -#[doc = "Camera contrast patterns."] -pub type CAMU_Contrast = ::libc::c_uint; -#[doc = "< No lens correction."] -pub const LENS_CORRECTION_OFF: CAMU_LensCorrection = 0; -#[doc = "< Edge-to-center brightness ratio of 70."] -pub const LENS_CORRECTION_ON_70: CAMU_LensCorrection = 1; -#[doc = "< Edge-to-center brightness ratio of 90."] -pub const LENS_CORRECTION_ON_90: CAMU_LensCorrection = 2; -#[doc = "< Dark lens correction. (OFF)"] -pub const LENS_CORRECTION_DARK: CAMU_LensCorrection = 0; -#[doc = "< Normal lens correction. (70)"] -pub const LENS_CORRECTION_NORMAL: CAMU_LensCorrection = 1; -#[doc = "< Bright lens correction. (90)"] -pub const LENS_CORRECTION_BRIGHT: CAMU_LensCorrection = 2; -#[doc = "Camera lens correction modes."] -pub type CAMU_LensCorrection = ::libc::c_uint; -#[doc = "< YUV422"] -pub const OUTPUT_YUV_422: CAMU_OutputFormat = 0; -#[doc = "< RGB565"] -pub const OUTPUT_RGB_565: CAMU_OutputFormat = 1; -#[doc = "Camera image output formats."] -pub type CAMU_OutputFormat = ::libc::c_uint; -#[doc = "< Normal shutter sound."] -pub const SHUTTER_SOUND_TYPE_NORMAL: CAMU_ShutterSoundType = 0; -#[doc = "< Shutter sound to begin a movie."] -pub const SHUTTER_SOUND_TYPE_MOVIE: CAMU_ShutterSoundType = 1; -#[doc = "< Shutter sound to end a movie."] -pub const SHUTTER_SOUND_TYPE_MOVIE_END: CAMU_ShutterSoundType = 2; -#[doc = "Camera shutter sounds."] -pub type CAMU_ShutterSoundType = ::libc::c_uint; -#[doc = "Image quality calibration data."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct CAMU_ImageQualityCalibrationData { - #[doc = "< Auto exposure base target brightness."] - pub aeBaseTarget: s16, - #[doc = "< Left color correction matrix red normalization coefficient."] - pub kRL: s16, - #[doc = "< Left color correction matrix green normalization coefficient."] - pub kGL: s16, - #[doc = "< Left color correction matrix blue normalization coefficient."] - pub kBL: s16, - #[doc = "< Color correction matrix position."] - pub ccmPosition: s16, - #[doc = "< Right camera, left color correction matrix red/green gain."] - pub awbCcmL9Right: u16_, - #[doc = "< Left camera, left color correction matrix red/green gain."] - pub awbCcmL9Left: u16_, - #[doc = "< Right camera, left color correction matrix blue/green gain."] - pub awbCcmL10Right: u16_, - #[doc = "< Left camera, left color correction matrix blue/green gain."] - pub awbCcmL10Left: u16_, - #[doc = "< Right camera, color correction matrix position threshold."] - pub awbX0Right: u16_, - #[doc = "< Left camera, color correction matrix position threshold."] - pub awbX0Left: u16_, -} -#[doc = "Stereo camera calibration data."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct CAMU_StereoCameraCalibrationData { - #[doc = "< #bool Whether the X and Y rotation data is valid."] - pub isValidRotationXY: u8_, - #[doc = "< Padding. (Aligns isValidRotationXY to 4 bytes)"] - pub padding: [u8_; 3usize], - #[doc = "< Scale to match the left camera image with the right."] - pub scale: f32, - #[doc = "< Z axis rotation to match the left camera image with the right."] - pub rotationZ: f32, - #[doc = "< X axis translation to match the left camera image with the right."] - pub translationX: f32, - #[doc = "< Y axis translation to match the left camera image with the right."] - pub translationY: f32, - #[doc = "< X axis rotation to match the left camera image with the right."] - pub rotationX: f32, - #[doc = "< Y axis rotation to match the left camera image with the right."] - pub rotationY: f32, - #[doc = "< Right camera angle of view."] - pub angleOfViewRight: f32, - #[doc = "< Left camera angle of view."] - pub angleOfViewLeft: f32, - #[doc = "< Distance between cameras and measurement chart."] - pub distanceToChart: f32, - #[doc = "< Distance between left and right cameras."] - pub distanceCameras: f32, - #[doc = "< Image width."] - pub imageWidth: s16, - #[doc = "< Image height."] - pub imageHeight: s16, - #[doc = "< Reserved for future use. (unused)"] - pub reserved: [u8_; 16usize], -} -#[doc = "Batch camera configuration for use without a context."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct CAMU_PackageParameterCameraSelect { - #[doc = "< Selected camera."] - pub camera: u8_, - #[doc = "< Camera exposure."] - pub exposure: s8, - #[doc = "< #CAMU_WhiteBalance Camera white balance."] - pub whiteBalance: u8_, - #[doc = "< Camera sharpness."] - pub sharpness: s8, - #[doc = "< #bool Whether to automatically determine the proper exposure."] - pub autoExposureOn: u8_, - #[doc = "< #bool Whether to automatically determine the white balance mode."] - pub autoWhiteBalanceOn: u8_, - #[doc = "< #CAMU_FrameRate Camera frame rate."] - pub frameRate: u8_, - #[doc = "< #CAMU_PhotoMode Camera photo mode."] - pub photoMode: u8_, - #[doc = "< #CAMU_Contrast Camera contrast."] - pub contrast: u8_, - #[doc = "< #CAMU_LensCorrection Camera lens correction."] - pub lensCorrection: u8_, - #[doc = "< #bool Whether to enable the camera's noise filter."] - pub noiseFilterOn: u8_, - #[doc = "< Padding. (Aligns last 3 fields to 4 bytes)"] - pub padding: u8_, - #[doc = "< X of the region to use for auto exposure."] - pub autoExposureWindowX: s16, - #[doc = "< Y of the region to use for auto exposure."] - pub autoExposureWindowY: s16, - #[doc = "< Width of the region to use for auto exposure."] - pub autoExposureWindowWidth: s16, - #[doc = "< Height of the region to use for auto exposure."] - pub autoExposureWindowHeight: s16, - #[doc = "< X of the region to use for auto white balance."] - pub autoWhiteBalanceWindowX: s16, - #[doc = "< Y of the region to use for auto white balance."] - pub autoWhiteBalanceWindowY: s16, - #[doc = "< Width of the region to use for auto white balance."] - pub autoWhiteBalanceWindowWidth: s16, - #[doc = "< Height of the region to use for auto white balance."] - pub autoWhiteBalanceWindowHeight: s16, -} -#[doc = "Batch camera configuration for use with a context."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct CAMU_PackageParameterContext { - #[doc = "< Selected camera."] - pub camera: u8_, - #[doc = "< #CAMU_Context Selected context."] - pub context: u8_, - #[doc = "< #CAMU_Flip Camera image flip mode."] - pub flip: u8_, - #[doc = "< #CAMU_Effect Camera image special effects."] - pub effect: u8_, - #[doc = "< #CAMU_Size Camera image resolution."] - pub size: u8_, -} -#[doc = "Batch camera configuration for use with a context and with detailed size information."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct CAMU_PackageParameterContextDetail { - #[doc = "< Selected camera."] - pub camera: u8_, - #[doc = "< #CAMU_Context Selected context."] - pub context: u8_, - #[doc = "< #CAMU_Flip Camera image flip mode."] - pub flip: u8_, - #[doc = "< #CAMU_Effect Camera image special effects."] - pub effect: u8_, - #[doc = "< Image width."] - pub width: s16, - #[doc = "< Image height."] - pub height: s16, - #[doc = "< First crop point X."] - pub cropX0: s16, - #[doc = "< First crop point Y."] - pub cropY0: s16, - #[doc = "< Second crop point X."] - pub cropX1: s16, - #[doc = "< Second crop point Y."] - pub cropY1: s16, -} -extern "C" { - #[must_use] - #[doc = "Initializes the cam service.\n\n This will internally get the handle of the service, and on success call CAMU_DriverInitialize."] - pub fn camInit() -> Result; -} -extern "C" { - #[doc = "Closes the cam service.\n\n This will internally call CAMU_DriverFinalize and close the handle of the service."] - pub fn camExit(); -} -extern "C" { - #[must_use] - #[doc = "Begins capture on the specified camera port.\n # Arguments\n\n* `port` - Port to begin capture on."] - pub fn CAMU_StartCapture(port: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Terminates capture on the specified camera port.\n # Arguments\n\n* `port` - Port to terminate capture on."] - pub fn CAMU_StopCapture(port: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets whether the specified camera port is busy.\n # Arguments\n\n* `busy` - Pointer to output the busy state to.\n * `port` - Port to check."] - pub fn CAMU_IsBusy(busy: *mut bool, port: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Clears the buffer and error flags of the specified camera port.\n # Arguments\n\n* `port` - Port to clear."] - pub fn CAMU_ClearBuffer(port: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets a handle to the event signaled on vsync interrupts.\n # Arguments\n\n* `event` - Pointer to output the event handle to.\n * `port` - Port to use."] - pub fn CAMU_GetVsyncInterruptEvent(event: *mut Handle, port: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets a handle to the event signaled on camera buffer errors.\n # Arguments\n\n* `event` - Pointer to output the event handle to.\n * `port` - Port to use."] - pub fn CAMU_GetBufferErrorInterruptEvent(event: *mut Handle, port: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initiates the process of receiving a camera frame.\n # Arguments\n\n* `event` - Pointer to output the completion event handle to.\n * `dst` - Buffer to write data to.\n * `port` - Port to receive from.\n * `imageSize` - Size of the image to receive.\n * `transferUnit` - Transfer unit to use when receiving."] - pub fn CAMU_SetReceiving( - event: *mut Handle, - dst: *mut ::libc::c_void, - port: u32_, - imageSize: u32_, - transferUnit: s16, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets whether the specified camera port has finished receiving image data.\n # Arguments\n\n* `finishedReceiving` - Pointer to output the receiving status to.\n * `port` - Port to check."] - pub fn CAMU_IsFinishedReceiving(finishedReceiving: *mut bool, port: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the number of lines to transfer into an image buffer.\n # Arguments\n\n* `port` - Port to use.\n * `lines` - Lines to transfer.\n * `width` - Width of the image.\n * `height` - Height of the image."] - pub fn CAMU_SetTransferLines(port: u32_, lines: s16, width: s16, height: s16) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the maximum number of lines that can be saved to an image buffer.\n # Arguments\n\n* `maxLines` - Pointer to write the maximum number of lines to.\n * `width` - Width of the image.\n * `height` - Height of the image."] - pub fn CAMU_GetMaxLines(maxLines: *mut s16, width: s16, height: s16) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the number of bytes to transfer into an image buffer.\n # Arguments\n\n* `port` - Port to use.\n * `bytes` - Bytes to transfer.\n * `width` - Width of the image.\n * `height` - Height of the image."] - pub fn CAMU_SetTransferBytes(port: u32_, bytes: u32_, width: s16, height: s16) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the number of bytes to transfer into an image buffer.\n # Arguments\n\n* `transferBytes` - Pointer to write the number of bytes to.\n * `port` - Port to use."] - pub fn CAMU_GetTransferBytes(transferBytes: *mut u32_, port: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the maximum number of bytes that can be saved to an image buffer.\n # Arguments\n\n* `maxBytes` - Pointer to write the maximum number of bytes to.\n * `width` - Width of the image.\n * `height` - Height of the image."] - pub fn CAMU_GetMaxBytes(maxBytes: *mut u32_, width: s16, height: s16) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets whether image trimming is enabled.\n # Arguments\n\n* `port` - Port to use.\n * `trimming` - Whether image trimming is enabled."] - pub fn CAMU_SetTrimming(port: u32_, trimming: bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets whether image trimming is enabled.\n # Arguments\n\n* `trimming` - Pointer to output the trim state to.\n * `port` - Port to use."] - pub fn CAMU_IsTrimming(trimming: *mut bool, port: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the parameters used for trimming images.\n # Arguments\n\n* `port` - Port to use.\n * `xStart` - Start X coordinate.\n * `yStart` - Start Y coordinate.\n * `xEnd` - End X coordinate.\n * `yEnd` - End Y coordinate."] - pub fn CAMU_SetTrimmingParams( - port: u32_, - xStart: s16, - yStart: s16, - xEnd: s16, - yEnd: s16, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the parameters used for trimming images.\n # Arguments\n\n* `xStart` - Pointer to write the start X coordinate to.\n * `yStart` - Pointer to write the start Y coordinate to.\n * `xEnd` - Pointer to write the end X coordinate to.\n * `yEnd` - Pointer to write the end Y coordinate to.\n * `port` - Port to use."] - pub fn CAMU_GetTrimmingParams( - xStart: *mut s16, - yStart: *mut s16, - xEnd: *mut s16, - yEnd: *mut s16, - port: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the parameters used for trimming images, relative to the center of the image.\n # Arguments\n\n* `port` - Port to use.\n * `trimWidth` - Trim width.\n * `trimHeight` - Trim height.\n * `camWidth` - Camera width.\n * `camHeight` - Camera height."] - pub fn CAMU_SetTrimmingParamsCenter( - port: u32_, - trimWidth: s16, - trimHeight: s16, - camWidth: s16, - camHeight: s16, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Activates the specified camera.\n # Arguments\n\n* `select` - Camera to use."] - pub fn CAMU_Activate(select: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Switches the specified camera's active context.\n # Arguments\n\n* `select` - Camera to use.\n * `context` - Context to use."] - pub fn CAMU_SwitchContext(select: u32_, context: CAMU_Context) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the exposure value of the specified camera.\n # Arguments\n\n* `select` - Camera to use.\n * `exposure` - Exposure value to use."] - pub fn CAMU_SetExposure(select: u32_, exposure: s8) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the white balance mode of the specified camera.\n # Arguments\n\n* `select` - Camera to use.\n * `whiteBalance` - White balance mode to use."] - pub fn CAMU_SetWhiteBalance(select: u32_, whiteBalance: CAMU_WhiteBalance) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the white balance mode of the specified camera.\n TODO: Explain \"without base up\"?\n # Arguments\n\n* `select` - Camera to use.\n * `whiteBalance` - White balance mode to use."] - pub fn CAMU_SetWhiteBalanceWithoutBaseUp( - select: u32_, - whiteBalance: CAMU_WhiteBalance, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the sharpness of the specified camera.\n # Arguments\n\n* `select` - Camera to use.\n * `sharpness` - Sharpness to use."] - pub fn CAMU_SetSharpness(select: u32_, sharpness: s8) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets whether auto exposure is enabled on the specified camera.\n # Arguments\n\n* `select` - Camera to use.\n * `autoWhiteBalance` - Whether auto exposure is enabled."] - pub fn CAMU_SetAutoExposure(select: u32_, autoExposure: bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets whether auto exposure is enabled on the specified camera.\n # Arguments\n\n* `autoExposure` - Pointer to output the auto exposure state to.\n * `select` - Camera to use."] - pub fn CAMU_IsAutoExposure(autoExposure: *mut bool, select: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets whether auto white balance is enabled on the specified camera.\n # Arguments\n\n* `select` - Camera to use.\n * `autoWhiteBalance` - Whether auto white balance is enabled."] - pub fn CAMU_SetAutoWhiteBalance(select: u32_, autoWhiteBalance: bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets whether auto white balance is enabled on the specified camera.\n # Arguments\n\n* `autoWhiteBalance` - Pointer to output the auto white balance state to.\n * `select` - Camera to use."] - pub fn CAMU_IsAutoWhiteBalance(autoWhiteBalance: *mut bool, select: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Flips the image of the specified camera in the specified context.\n # Arguments\n\n* `select` - Camera to use.\n * `flip` - Flip mode to use.\n * `context` - Context to use."] - pub fn CAMU_FlipImage(select: u32_, flip: CAMU_Flip, context: CAMU_Context) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the image resolution of the given camera in the given context, in detail.\n # Arguments\n\n* `select` - Camera to use.\n * `width` - Width to use.\n * `height` - Height to use.\n * `cropX0` - First crop point X.\n * `cropY0` - First crop point Y.\n * `cropX1` - Second crop point X.\n * `cropY1` - Second crop point Y.\n * `context` - Context to use."] - pub fn CAMU_SetDetailSize( - select: u32_, - width: s16, - height: s16, - cropX0: s16, - cropY0: s16, - cropX1: s16, - cropY1: s16, - context: CAMU_Context, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the image resolution of the given camera in the given context.\n # Arguments\n\n* `select` - Camera to use.\n * `size` - Size to use.\n * `context` - Context to use."] - pub fn CAMU_SetSize(select: u32_, size: CAMU_Size, context: CAMU_Context) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the frame rate of the given camera.\n # Arguments\n\n* `select` - Camera to use.\n * `frameRate` - Frame rate to use."] - pub fn CAMU_SetFrameRate(select: u32_, frameRate: CAMU_FrameRate) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the photo mode of the given camera.\n # Arguments\n\n* `select` - Camera to use.\n * `photoMode` - Photo mode to use."] - pub fn CAMU_SetPhotoMode(select: u32_, photoMode: CAMU_PhotoMode) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the special effects of the given camera in the given context.\n # Arguments\n\n* `select` - Camera to use.\n * `effect` - Effect to use.\n * `context` - Context to use."] - pub fn CAMU_SetEffect(select: u32_, effect: CAMU_Effect, context: CAMU_Context) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the contrast mode of the given camera.\n # Arguments\n\n* `select` - Camera to use.\n * `contrast` - Contrast mode to use."] - pub fn CAMU_SetContrast(select: u32_, contrast: CAMU_Contrast) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the lens correction mode of the given camera.\n # Arguments\n\n* `select` - Camera to use.\n * `lensCorrection` - Lens correction mode to use."] - pub fn CAMU_SetLensCorrection(select: u32_, lensCorrection: CAMU_LensCorrection) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the output format of the given camera in the given context.\n # Arguments\n\n* `select` - Camera to use.\n * `format` - Format to output.\n * `context` - Context to use."] - pub fn CAMU_SetOutputFormat( - select: u32_, - format: CAMU_OutputFormat, - context: CAMU_Context, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the region to base auto exposure off of for the specified camera.\n # Arguments\n\n* `select` - Camera to use.\n * `x` - X of the region.\n * `y` - Y of the region.\n * `width` - Width of the region.\n * `height` - Height of the region."] - pub fn CAMU_SetAutoExposureWindow( - select: u32_, - x: s16, - y: s16, - width: s16, - height: s16, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the region to base auto white balance off of for the specified camera.\n # Arguments\n\n* `select` - Camera to use.\n * `x` - X of the region.\n * `y` - Y of the region.\n * `width` - Width of the region.\n * `height` - Height of the region."] - pub fn CAMU_SetAutoWhiteBalanceWindow( - select: u32_, - x: s16, - y: s16, - width: s16, - height: s16, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets whether the specified camera's noise filter is enabled.\n # Arguments\n\n* `select` - Camera to use.\n * `noiseFilter` - Whether the noise filter is enabled."] - pub fn CAMU_SetNoiseFilter(select: u32_, noiseFilter: bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Synchronizes the specified cameras' vsync timing.\n # Arguments\n\n* `select1` - First camera.\n * `select2` - Second camera."] - pub fn CAMU_SynchronizeVsyncTiming(select1: u32_, select2: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the vsync timing record of the specified camera for the specified number of signals.\n # Arguments\n\n* `timing` - Pointer to write timing data to. (size \"past * sizeof(s64)\")\n * `port` - Port to use.\n * `past` - Number of past timings to retrieve."] - pub fn CAMU_GetLatestVsyncTiming(timing: *mut s64, port: u32_, past: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the specified camera's stereo camera calibration data.\n # Arguments\n\n* `data` - Pointer to output the stereo camera data to."] - pub fn CAMU_GetStereoCameraCalibrationData( - data: *mut CAMU_StereoCameraCalibrationData, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the specified camera's stereo camera calibration data.\n # Arguments\n\n* `data` - Data to set."] - pub fn CAMU_SetStereoCameraCalibrationData(data: CAMU_StereoCameraCalibrationData) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Writes to the specified I2C register of the specified camera.\n # Arguments\n\n* `select` - Camera to write to.\n * `addr` - Address to write to.\n * `data` - Data to write."] - pub fn CAMU_WriteRegisterI2c(select: u32_, addr: u16_, data: u16_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Writes to the specified MCU variable of the specified camera.\n # Arguments\n\n* `select` - Camera to write to.\n * `addr` - Address to write to.\n * `data` - Data to write."] - pub fn CAMU_WriteMcuVariableI2c(select: u32_, addr: u16_, data: u16_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Reads the specified I2C register of the specified camera.\n # Arguments\n\n* `data` - Pointer to read data to.\n * `select` - Camera to read from.\n * `addr` - Address to read."] - pub fn CAMU_ReadRegisterI2cExclusive(data: *mut u16_, select: u32_, addr: u16_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Reads the specified MCU variable of the specified camera.\n # Arguments\n\n* `data` - Pointer to read data to.\n * `select` - Camera to read from.\n * `addr` - Address to read."] - pub fn CAMU_ReadMcuVariableI2cExclusive(data: *mut u16_, select: u32_, addr: u16_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the specified camera's image quality calibration data.\n # Arguments\n\n* `data` - Data to set."] - pub fn CAMU_SetImageQualityCalibrationData(data: CAMU_ImageQualityCalibrationData) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the specified camera's image quality calibration data.\n # Arguments\n\n* `data` - Pointer to write the quality data to."] - pub fn CAMU_GetImageQualityCalibrationData( - data: *mut CAMU_ImageQualityCalibrationData, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Configures a camera with pre-packaged configuration data without a context.\n # Arguments\n\n* `Parameter` - to use."] - pub fn CAMU_SetPackageParameterWithoutContext( - param: CAMU_PackageParameterCameraSelect, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Configures a camera with pre-packaged configuration data with a context.\n # Arguments\n\n* `Parameter` - to use."] - pub fn CAMU_SetPackageParameterWithContext(param: CAMU_PackageParameterContext) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Configures a camera with pre-packaged configuration data without a context and extra resolution details.\n # Arguments\n\n* `Parameter` - to use."] - pub fn CAMU_SetPackageParameterWithContextDetail( - param: CAMU_PackageParameterContextDetail, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the Y2R coefficient applied to image data by the camera.\n # Arguments\n\n* `coefficient` - Pointer to output the Y2R coefficient to."] - pub fn CAMU_GetSuitableY2rStandardCoefficient( - coefficient: *mut Y2RU_StandardCoefficient, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Plays the specified shutter sound.\n # Arguments\n\n* `sound` - Shutter sound to play."] - pub fn CAMU_PlayShutterSound(sound: CAMU_ShutterSoundType) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initializes the camera driver."] - pub fn CAMU_DriverInitialize() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Finalizes the camera driver."] - pub fn CAMU_DriverFinalize() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the current activated camera.\n # Arguments\n\n* `select` - Pointer to output the current activated camera to."] - pub fn CAMU_GetActivatedCamera(select: *mut u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the current sleep camera.\n # Arguments\n\n* `select` - Pointer to output the current sleep camera to."] - pub fn CAMU_GetSleepCamera(select: *mut u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the current sleep camera.\n # Arguments\n\n* `select` - Camera to set."] - pub fn CAMU_SetSleepCamera(select: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets whether to enable synchronization of left and right camera brightnesses.\n # Arguments\n\n* `brightnessSynchronization` - Whether to enable brightness synchronization."] - pub fn CAMU_SetBrightnessSynchronization(brightnessSynchronization: bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initializes CFGNOR.\n # Arguments\n\n* `value` - Unknown, usually 1."] - pub fn cfgnorInit(value: u8_) -> Result; -} -extern "C" { - #[doc = "Exits CFGNOR"] - pub fn cfgnorExit(); -} -extern "C" { - #[must_use] - #[doc = "Dumps the NOR flash.\n # Arguments\n\n* `buf` - Buffer to dump to.\n * `size` - Size of the buffer."] - pub fn cfgnorDumpFlash(buf: *mut u32_, size: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Writes the NOR flash.\n # Arguments\n\n* `buf` - Buffer to write from.\n * `size` - Size of the buffer."] - pub fn cfgnorWriteFlash(buf: *mut u32_, size: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initializes the CFGNOR session.\n # Arguments\n\n* `value` - Unknown, usually 1."] - pub fn CFGNOR_Initialize(value: u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Shuts down the CFGNOR session."] - pub fn CFGNOR_Shutdown() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Reads data from NOR.\n # Arguments\n\n* `offset` - Offset to read from.\n * `buf` - Buffer to read data to.\n * `size` - Size of the buffer."] - pub fn CFGNOR_ReadData(offset: u32_, buf: *mut u32_, size: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Writes data to NOR.\n # Arguments\n\n* `offset` - Offset to write to.\n * `buf` - Buffer to write data from.\n * `size` - Size of the buffer."] - pub fn CFGNOR_WriteData(offset: u32_, buf: *mut u32_, size: u32_) -> Result; -} -#[doc = "< Japan"] -pub const CFG_REGION_JPN: CFG_Region = 0; -#[doc = "< USA"] -pub const CFG_REGION_USA: CFG_Region = 1; -#[doc = "< Europe"] -pub const CFG_REGION_EUR: CFG_Region = 2; -#[doc = "< Australia"] -pub const CFG_REGION_AUS: CFG_Region = 3; -#[doc = "< China"] -pub const CFG_REGION_CHN: CFG_Region = 4; -#[doc = "< Korea"] -pub const CFG_REGION_KOR: CFG_Region = 5; -#[doc = "< Taiwan"] -pub const CFG_REGION_TWN: CFG_Region = 6; -#[doc = "Configuration region values."] -pub type CFG_Region = ::libc::c_uint; -#[doc = "< Japanese"] -pub const CFG_LANGUAGE_JP: CFG_Language = 0; -#[doc = "< English"] -pub const CFG_LANGUAGE_EN: CFG_Language = 1; -#[doc = "< French"] -pub const CFG_LANGUAGE_FR: CFG_Language = 2; -#[doc = "< German"] -pub const CFG_LANGUAGE_DE: CFG_Language = 3; -#[doc = "< Italian"] -pub const CFG_LANGUAGE_IT: CFG_Language = 4; -#[doc = "< Spanish"] -pub const CFG_LANGUAGE_ES: CFG_Language = 5; -#[doc = "< Simplified Chinese"] -pub const CFG_LANGUAGE_ZH: CFG_Language = 6; -#[doc = "< Korean"] -pub const CFG_LANGUAGE_KO: CFG_Language = 7; -#[doc = "< Dutch"] -pub const CFG_LANGUAGE_NL: CFG_Language = 8; -#[doc = "< Portugese"] -pub const CFG_LANGUAGE_PT: CFG_Language = 9; -#[doc = "< Russian"] -pub const CFG_LANGUAGE_RU: CFG_Language = 10; -#[doc = "< Traditional Chinese"] -pub const CFG_LANGUAGE_TW: CFG_Language = 11; -#[doc = "Configuration language values."] -pub type CFG_Language = ::libc::c_uint; -#[doc = "< Old 3DS (CTR)"] -pub const CFG_MODEL_3DS: CFG_SystemModel = 0; -#[doc = "< Old 3DS XL (SPR)"] -pub const CFG_MODEL_3DSXL: CFG_SystemModel = 1; -#[doc = "< New 3DS (KTR)"] -pub const CFG_MODEL_N3DS: CFG_SystemModel = 2; -#[doc = "< Old 2DS (FTR)"] -pub const CFG_MODEL_2DS: CFG_SystemModel = 3; -#[doc = "< New 3DS XL (RED)"] -pub const CFG_MODEL_N3DSXL: CFG_SystemModel = 4; -#[doc = "< New 2DS XL (JAN)"] -pub const CFG_MODEL_N2DSXL: CFG_SystemModel = 5; -pub type CFG_SystemModel = ::libc::c_uint; -extern "C" { - #[must_use] - #[doc = "Initializes CFGU."] - pub fn cfguInit() -> Result; -} -extern "C" { - #[doc = "Exits CFGU."] - pub fn cfguExit(); -} -extern "C" { - #[must_use] - #[doc = "Gets the system's region from secure info.\n # Arguments\n\n* `region` - Pointer to output the region to. (see CFG_Region)"] - pub fn CFGU_SecureInfoGetRegion(region: *mut u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Generates a console-unique hash.\n # Arguments\n\n* `appIDSalt` - Salt to use.\n * `hash` - Pointer to output the hash to."] - pub fn CFGU_GenHashConsoleUnique(appIDSalt: u32_, hash: *mut u64_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets whether the system's region is Canada or USA.\n # Arguments\n\n* `value` - Pointer to output the result to. (0 = no, 1 = yes)"] - pub fn CFGU_GetRegionCanadaUSA(value: *mut u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the system's model.\n # Arguments\n\n* `model` - Pointer to output the model to. (see CFG_SystemModel)"] - pub fn CFGU_GetSystemModel(model: *mut u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets whether the system is a 2DS.\n # Arguments\n\n* `value` - Pointer to output the result to. (0 = yes, 1 = no)"] - pub fn CFGU_GetModelNintendo2DS(value: *mut u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets a string representing a country code.\n # Arguments\n\n* `code` - Country code to use.\n * `string` - Pointer to output the string to."] - pub fn CFGU_GetCountryCodeString(code: u16_, string: *mut u16_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets a country code ID from its string.\n # Arguments\n\n* `string` - String to use.\n * `code` - Pointer to output the country code to."] - pub fn CFGU_GetCountryCodeID(string: u16_, code: *mut u16_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Checks if NFC (code name: fangate) is supported.\n # Arguments\n\n* `isSupported` - pointer to the output the result to."] - pub fn CFGU_IsNFCSupported(isSupported: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets a config info block with flags = 2.\n # Arguments\n\n* `size` - Size of the data to retrieve.\n * `blkID` - ID of the block to retrieve.\n * `outData` - Pointer to write the block data to."] - pub fn CFGU_GetConfigInfoBlk2(size: u32_, blkID: u32_, outData: *mut ::libc::c_void) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets a config info block with flags = 4.\n # Arguments\n\n* `size` - Size of the data to retrieve.\n * `blkID` - ID of the block to retrieve.\n * `outData` - Pointer to write the block data to."] - pub fn CFG_GetConfigInfoBlk4(size: u32_, blkID: u32_, outData: *mut ::libc::c_void) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets a config info block with flags = 8.\n # Arguments\n\n* `size` - Size of the data to retrieve.\n * `blkID` - ID of the block to retrieve.\n * `outData` - Pointer to write the block data to."] - pub fn CFG_GetConfigInfoBlk8(size: u32_, blkID: u32_, outData: *mut ::libc::c_void) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets a config info block with flags = 4.\n # Arguments\n\n* `size` - Size of the data to retrieve.\n * `blkID` - ID of the block to retrieve.\n * `inData` - Pointer to block data to write."] - pub fn CFG_SetConfigInfoBlk4(size: u32_, blkID: u32_, inData: *const ::libc::c_void) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets a config info block with flags = 8.\n # Arguments\n\n* `size` - Size of the data to retrieve.\n * `blkID` - ID of the block to retrieve.\n * `inData` - Pointer to block data to write."] - pub fn CFG_SetConfigInfoBlk8(size: u32_, blkID: u32_, inData: *const ::libc::c_void) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Writes the CFG buffer in memory to the savegame in NAND."] - pub fn CFG_UpdateConfigSavegame() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the system's language.\n # Arguments\n\n* `language` - Pointer to write the language to. (see CFG_Language)"] - pub fn CFGU_GetSystemLanguage(language: *mut u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Deletes the NAND LocalFriendCodeSeed file, then recreates it using the LocalFriendCodeSeed data stored in memory."] - pub fn CFGI_RestoreLocalFriendCodeSeed() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Deletes the NAND SecureInfo file, then recreates it using the SecureInfo data stored in memory."] - pub fn CFGI_RestoreSecureInfo() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Deletes the \"config\" file stored in the NAND Config_Savegame."] - pub fn CFGI_DeleteConfigSavefile() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Formats Config_Savegame."] - pub fn CFGI_FormatConfig() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Clears parental controls"] - pub fn CFGI_ClearParentalControls() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Verifies the RSA signature for the LocalFriendCodeSeed data already stored in memory."] - pub fn CFGI_VerifySigLocalFriendCodeSeed() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Verifies the RSA signature for the SecureInfo data already stored in memory."] - pub fn CFGI_VerifySigSecureInfo() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the system's serial number.\n # Arguments\n\n* `serial` - Pointer to output the serial to. (This is normally 0xF)"] - pub fn CFGI_SecureInfoGetSerialNumber(serial: *mut u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the 0x110-byte buffer containing the data for the LocalFriendCodeSeed.\n # Arguments\n\n* `data` - Pointer to output the buffer. (The size must be at least 0x110-bytes)"] - pub fn CFGI_GetLocalFriendCodeSeedData(data: *mut u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the 64-bit local friend code seed.\n # Arguments\n\n* `seed` - Pointer to write the friend code seed to."] - pub fn CFGI_GetLocalFriendCodeSeed(seed: *mut u64_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the 0x11-byte data following the SecureInfo signature.\n # Arguments\n\n* `data` - Pointer to output the buffer. (The size must be at least 0x11-bytes)"] - pub fn CFGI_GetSecureInfoData(data: *mut u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the 0x100-byte RSA-2048 SecureInfo signature.\n # Arguments\n\n* `data` - Pointer to output the buffer. (The size must be at least 0x100-bytes)"] - pub fn CFGI_GetSecureInfoSignature(data: *mut u8_) -> Result; -} -extern "C" { - #[doc = "Converts a vol-pan pair into a left/right volume pair used by the hardware.\n # Arguments\n\n* `vol` - Volume to use.\n * `pan` - Pan to use.\n # Returns\n\nA left/right volume pair for use by hardware."] - #[link_name = "CSND_VOL__extern"] - pub fn CSND_VOL(vol: f32, pan: f32) -> u32_; -} -#[doc = "< PCM8"] -pub const CSND_ENCODING_PCM8: _bindgen_ty_17 = 0; -#[doc = "< PCM16"] -pub const CSND_ENCODING_PCM16: _bindgen_ty_17 = 1; -#[doc = "< IMA-ADPCM"] -pub const CSND_ENCODING_ADPCM: _bindgen_ty_17 = 2; -#[doc = "< PSG (Similar to DS?)"] -pub const CSND_ENCODING_PSG: _bindgen_ty_17 = 3; -#[doc = "CSND encodings."] -pub type _bindgen_ty_17 = ::libc::c_uint; -#[doc = "< Manual loop."] -pub const CSND_LOOPMODE_MANUAL: _bindgen_ty_18 = 0; -#[doc = "< Normal loop."] -pub const CSND_LOOPMODE_NORMAL: _bindgen_ty_18 = 1; -#[doc = "< Do not loop."] -pub const CSND_LOOPMODE_ONESHOT: _bindgen_ty_18 = 2; -#[doc = "< Don't reload."] -pub const CSND_LOOPMODE_NORELOAD: _bindgen_ty_18 = 3; -#[doc = "CSND loop modes."] -pub type _bindgen_ty_18 = ::libc::c_uint; -#[doc = "< Linear interpolation."] -pub const SOUND_LINEAR_INTERP: _bindgen_ty_19 = 64; -#[doc = "< Repeat the sound."] -pub const SOUND_REPEAT: _bindgen_ty_19 = 1024; -#[doc = "< Play the sound once."] -pub const SOUND_ONE_SHOT: _bindgen_ty_19 = 2048; -#[doc = "< PCM8"] -pub const SOUND_FORMAT_8BIT: _bindgen_ty_19 = 0; -#[doc = "< PCM16"] -pub const SOUND_FORMAT_16BIT: _bindgen_ty_19 = 4096; -#[doc = "< ADPCM"] -pub const SOUND_FORMAT_ADPCM: _bindgen_ty_19 = 8192; -#[doc = "< PSG"] -pub const SOUND_FORMAT_PSG: _bindgen_ty_19 = 12288; -#[doc = "< Enable sound."] -pub const SOUND_ENABLE: _bindgen_ty_19 = 16384; -#[doc = "Sound flags."] -pub type _bindgen_ty_19 = ::libc::c_uint; -#[doc = "< Repeat capture."] -pub const CAPTURE_REPEAT: _bindgen_ty_20 = 0; -#[doc = "< Capture once."] -pub const CAPTURE_ONE_SHOT: _bindgen_ty_20 = 1; -#[doc = "< PCM16"] -pub const CAPTURE_FORMAT_16BIT: _bindgen_ty_20 = 0; -#[doc = "< PCM8"] -pub const CAPTURE_FORMAT_8BIT: _bindgen_ty_20 = 2; -#[doc = "< Enable capture."] -pub const CAPTURE_ENABLE: _bindgen_ty_20 = 32768; -#[doc = "Capture modes."] -pub type _bindgen_ty_20 = ::libc::c_uint; -#[doc = "< 0.0% duty cycle"] -pub const DutyCycle_0: CSND_DutyCycle = 7; -#[doc = "< 12.5% duty cycle"] -pub const DutyCycle_12: CSND_DutyCycle = 0; -#[doc = "< 25.0% duty cycle"] -pub const DutyCycle_25: CSND_DutyCycle = 1; -#[doc = "< 37.5% duty cycle"] -pub const DutyCycle_37: CSND_DutyCycle = 2; -#[doc = "< 50.0% duty cycle"] -pub const DutyCycle_50: CSND_DutyCycle = 3; -#[doc = "< 62.5% duty cycle"] -pub const DutyCycle_62: CSND_DutyCycle = 4; -#[doc = "< 75.0% duty cycle"] -pub const DutyCycle_75: CSND_DutyCycle = 5; -#[doc = "< 87.5% duty cycle"] -pub const DutyCycle_87: CSND_DutyCycle = 6; -#[doc = "Duty cycles for a PSG channel."] -pub type CSND_DutyCycle = ::libc::c_uint; -#[doc = "Channel info."] -#[repr(C)] -#[derive(Copy, Clone)] -pub union CSND_ChnInfo { - #[doc = "< Raw values."] - pub value: [u32_; 3usize], - pub __bindgen_anon_1: CSND_ChnInfo__bindgen_ty_1, -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct CSND_ChnInfo__bindgen_ty_1 { - #[doc = "< Channel active."] - pub active: u8_, - #[doc = "< Padding."] - pub _pad1: u8_, - #[doc = "< Padding."] - pub _pad2: u16_, - #[doc = "< Current ADPCM sample."] - pub adpcmSample: s16, - #[doc = "< Current ADPCM index."] - pub adpcmIndex: u8_, - #[doc = "< Padding."] - pub _pad3: u8_, - #[doc = "< Unknown."] - pub unknownZero: u32_, -} -impl Default for CSND_ChnInfo { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "Capture info."] -#[repr(C)] -#[derive(Copy, Clone)] -pub union CSND_CapInfo { - #[doc = "< Raw values."] - pub value: [u32_; 2usize], - pub __bindgen_anon_1: CSND_CapInfo__bindgen_ty_1, -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct CSND_CapInfo__bindgen_ty_1 { - #[doc = "< Capture active."] - pub active: u8_, - #[doc = "< Padding."] - pub _pad1: u8_, - #[doc = "< Padding."] - pub _pad2: u16_, - #[doc = "< Unknown."] - pub unknownZero: u32_, -} -impl Default for CSND_CapInfo { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -extern "C" { - #[doc = "< CSND shared memory."] - pub static mut csndSharedMem: *mut vu32; -} -extern "C" { - #[doc = "< CSND shared memory size."] - pub static mut csndSharedMemSize: u32_; -} -extern "C" { - #[doc = "< Bitmask of channels that are allowed for usage."] - pub static mut csndChannels: u32_; -} -extern "C" { - #[must_use] - #[doc = "Acquires a capture unit.\n # Arguments\n\n* `capUnit` - Pointer to output the capture unit to."] - pub fn CSND_AcquireCapUnit(capUnit: *mut u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Releases a capture unit.\n # Arguments\n\n* `capUnit` - Capture unit to release."] - pub fn CSND_ReleaseCapUnit(capUnit: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Flushes the data cache of a memory region.\n # Arguments\n\n* `adr` - Address of the memory region.\n * `size` - Size of the memory region."] - pub fn CSND_FlushDataCache(adr: *const ::libc::c_void, size: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Stores the data cache of a memory region.\n # Arguments\n\n* `adr` - Address of the memory region.\n * `size` - Size of the memory region."] - pub fn CSND_StoreDataCache(adr: *const ::libc::c_void, size: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Invalidates the data cache of a memory region.\n # Arguments\n\n* `adr` - Address of the memory region.\n * `size` - Size of the memory region."] - pub fn CSND_InvalidateDataCache(adr: *const ::libc::c_void, size: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Resets CSND.\n Note: Currently breaks sound, don't use for now!"] - pub fn CSND_Reset() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initializes CSND."] - pub fn csndInit() -> Result; -} -extern "C" { - #[doc = "Exits CSND."] - pub fn csndExit(); -} -extern "C" { - #[doc = "Adds a command to the list, returning a buffer to write arguments to.\n # Arguments\n\n* `cmdid` - ID of the command to add.\n # Returns\n\nA buffer to write command arguments to."] - pub fn csndAddCmd(cmdid: ::libc::c_int) -> *mut u32_; -} -extern "C" { - #[doc = "Adds a command to the list, copying its arguments from a buffer.\n # Arguments\n\n* `cmdid` - ID of the command to add.\n * `cmdparams` - Buffer containing the command's parameters."] - pub fn csndWriteCmd(cmdid: ::libc::c_int, cmdparams: *mut u8_); -} -extern "C" { - #[must_use] - #[doc = "Executes pending CSND commands.\n # Arguments\n\n* `waitDone` - Whether to wait until the commands have finished executing."] - pub fn csndExecCmds(waitDone: bool) -> Result; -} -extern "C" { - #[doc = "Sets a channel's play state, resetting registers on stop.\n # Arguments\n\n* `channel` - Channel to use.\n * `value` - Play state to set."] - pub fn CSND_SetPlayStateR(channel: u32_, value: u32_); -} -extern "C" { - #[doc = "Sets a channel's play state.\n # Arguments\n\n* `channel` - Channel to use.\n * `value` - Play state to set."] - pub fn CSND_SetPlayState(channel: u32_, value: u32_); -} -extern "C" { - #[doc = "Sets a channel's encoding.\n # Arguments\n\n* `channel` - Channel to use.\n * `value` - Encoding to set."] - pub fn CSND_SetEncoding(channel: u32_, value: u32_); -} -extern "C" { - #[doc = "Sets the data of a channel's block.\n # Arguments\n\n* `channel` - Channel to use.\n * `block` - Block to set.\n * `physaddr` - Physical address to set the block to.\n * `size` - Size of the block."] - pub fn CSND_SetBlock(channel: u32_, block: ::libc::c_int, physaddr: u32_, size: u32_); -} -extern "C" { - #[doc = "Sets whether to loop a channel.\n # Arguments\n\n* `channel` - Channel to use.\n * `value` - Whether to loop the channel."] - pub fn CSND_SetLooping(channel: u32_, value: u32_); -} -extern "C" { - #[doc = "Sets bit 7 of a channel.\n # Arguments\n\n* `channel` - Channel to use.\n * `set` - Value to set."] - pub fn CSND_SetBit7(channel: u32_, set: bool); -} -extern "C" { - #[doc = "Sets whether a channel should use interpolation.\n # Arguments\n\n* `channel` - Channel to use.\n * `interp` - Whether to use interpolation."] - pub fn CSND_SetInterp(channel: u32_, interp: bool); -} -extern "C" { - #[doc = "Sets a channel's duty.\n # Arguments\n\n* `channel` - Channel to use.\n * `duty` - Duty to set."] - pub fn CSND_SetDuty(channel: u32_, duty: CSND_DutyCycle); -} -extern "C" { - #[doc = "Sets a channel's timer.\n # Arguments\n\n* `channel` - Channel to use.\n * `timer` - Timer to set."] - pub fn CSND_SetTimer(channel: u32_, timer: u32_); -} -extern "C" { - #[doc = "Sets a channel's volume.\n # Arguments\n\n* `channel` - Channel to use.\n * `chnVolumes` - Channel volume data to set.\n * `capVolumes` - Capture volume data to set."] - pub fn CSND_SetVol(channel: u32_, chnVolumes: u32_, capVolumes: u32_); -} -extern "C" { - #[doc = "Sets a channel's ADPCM state.\n # Arguments\n\n* `channel` - Channel to use.\n * `block` - Current block.\n * `sample` - Current sample.\n * `index` - Current index."] - pub fn CSND_SetAdpcmState( - channel: u32_, - block: ::libc::c_int, - sample: ::libc::c_int, - index: ::libc::c_int, - ); -} -extern "C" { - #[doc = "Sets a whether channel's ADPCM data should be reloaded when the second block is played.\n # Arguments\n\n* `channel` - Channel to use.\n * `reload` - Whether to reload ADPCM data."] - pub fn CSND_SetAdpcmReload(channel: u32_, reload: bool); -} -extern "C" { - #[doc = "Sets CSND's channel registers.\n # Arguments\n\n* `flags` - Flags to set.\n * `physaddr0` - Physical address of the first buffer to play.\n * `physaddr1` - Physical address of the second buffer to play.\n * `totalbytesize` - Total size of the data to play.\n * `chnVolumes` - Channel volume data.\n * `capVolumes` - Capture volume data."] - pub fn CSND_SetChnRegs( - flags: u32_, - physaddr0: u32_, - physaddr1: u32_, - totalbytesize: u32_, - chnVolumes: u32_, - capVolumes: u32_, - ); -} -extern "C" { - #[doc = "Sets CSND's PSG channel registers.\n # Arguments\n\n* `flags` - Flags to set.\n * `chnVolumes` - Channel volume data.\n * `capVolumes` - Capture volume data.\n * `duty` - Duty value to set."] - pub fn CSND_SetChnRegsPSG( - flags: u32_, - chnVolumes: u32_, - capVolumes: u32_, - duty: CSND_DutyCycle, - ); -} -extern "C" { - #[doc = "Sets CSND's noise channel registers.\n # Arguments\n\n* `flags` - Flags to set.\n * `chnVolumes` - Channel volume data.\n * `capVolumes` - Capture volume data."] - pub fn CSND_SetChnRegsNoise(flags: u32_, chnVolumes: u32_, capVolumes: u32_); -} -extern "C" { - #[doc = "Sets whether a capture unit is enabled.\n # Arguments\n\n* `capUnit` - Capture unit to use.\n * `enable` - Whether to enable the capture unit."] - pub fn CSND_CapEnable(capUnit: u32_, enable: bool); -} -extern "C" { - #[doc = "Sets whether a capture unit should repeat.\n # Arguments\n\n* `capUnit` - Capture unit to use.\n * `repeat` - Whether the capture unit should repeat."] - pub fn CSND_CapSetRepeat(capUnit: u32_, repeat: bool); -} -extern "C" { - #[doc = "Sets a capture unit's format.\n # Arguments\n\n* `capUnit` - Capture unit to use.\n * `eightbit` - Format to use."] - pub fn CSND_CapSetFormat(capUnit: u32_, eightbit: bool); -} -extern "C" { - #[doc = "Sets a capture unit's second bit.\n # Arguments\n\n* `capUnit` - Capture unit to use.\n * `set` - Value to set."] - pub fn CSND_CapSetBit2(capUnit: u32_, set: bool); -} -extern "C" { - #[doc = "Sets a capture unit's timer.\n # Arguments\n\n* `capUnit` - Capture unit to use.\n * `timer` - Timer to set."] - pub fn CSND_CapSetTimer(capUnit: u32_, timer: u32_); -} -extern "C" { - #[doc = "Sets a capture unit's buffer.\n # Arguments\n\n* `capUnit` - Capture unit to use.\n * `addr` - Buffer address to use.\n * `size` - Size of the buffer."] - pub fn CSND_CapSetBuffer(capUnit: u32_, addr: u32_, size: u32_); -} -extern "C" { - #[doc = "Sets a capture unit's capture registers.\n # Arguments\n\n* `capUnit` - Capture unit to use.\n * `flags` - Capture unit flags.\n * `addr` - Capture unit buffer address.\n * `size` - Buffer size."] - pub fn CSND_SetCapRegs(capUnit: u32_, flags: u32_, addr: u32_, size: u32_); -} -extern "C" { - #[must_use] - #[doc = "Sets up DSP flags.\n # Arguments\n\n* `waitDone` - Whether to wait for completion."] - pub fn CSND_SetDspFlags(waitDone: bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Updates CSND information.\n # Arguments\n\n* `waitDone` - Whether to wait for completion."] - pub fn CSND_UpdateInfo(waitDone: bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Plays a sound.\n # Arguments\n\n* `chn` - Channel to play the sound on.\n * `flags` - Flags containing information about the sound.\n * `sampleRate` - Sample rate of the sound.\n * `vol` - The volume, ranges from 0.0 to 1.0 included.\n * `pan` - The pan, ranges from -1.0 to 1.0 included.\n * `data0` - First block of sound data.\n * `data1` - Second block of sound data. This is the block that will be looped over.\n * `size` - Size of the sound data.\n\n In this implementation if the loop mode is used, data1 must be in the range [data0 ; data0 + size]. Sound will be played once from data0 to data0 + size and then loop between data1 and data0+size."] - 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" { - #[doc = "Gets CSND's DSP flags.\n Note: Requires previous CSND_UpdateInfo()\n # Arguments\n\n* `outSemFlags` - Pointer to write semaphore flags to.\n * `outIrqFlags` - Pointer to write interrupt flags to."] - pub fn csndGetDspFlags(outSemFlags: *mut u32_, outIrqFlags: *mut u32_); -} -extern "C" { - #[doc = "Gets a channel's information.\n Note: Requires previous CSND_UpdateInfo()\n # Arguments\n\n* `channel` - Channel to get information for.\n # Returns\n\nThe channel's information."] - pub fn csndGetChnInfo(channel: u32_) -> *mut CSND_ChnInfo; -} -extern "C" { - #[doc = "Gets a capture unit's information.\n Note: Requires previous CSND_UpdateInfo()\n # Arguments\n\n* `capUnit` - Capture unit to get information for.\n # Returns\n\nThe capture unit's information."] - pub fn csndGetCapInfo(capUnit: u32_) -> *mut CSND_CapInfo; -} -extern "C" { - #[must_use] - #[doc = "Gets a channel's state.\n # Arguments\n\n* `channel` - Channel to get the state of.\n * `out` - Pointer to output channel information to."] - pub fn csndGetState(channel: u32_, out: *mut CSND_ChnInfo) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets whether a channel is playing.\n # Arguments\n\n* `channel` - Channel to check.\n * `status` - Pointer to output the channel status to."] - pub fn csndIsPlaying(channel: u32_, status: *mut u8_) -> Result; -} -#[doc = "< Pipe interrupt."] -pub const DSP_INTERRUPT_PIPE: DSP_InterruptType = 2; -#[doc = "DSP interrupt types."] -pub type DSP_InterruptType = ::libc::c_uint; -#[doc = "< DSP is going to sleep."] -pub const DSPHOOK_ONSLEEP: DSP_HookType = 0; -#[doc = "< DSP is waking up."] -pub const DSPHOOK_ONWAKEUP: DSP_HookType = 1; -#[doc = "< DSP was sleeping and the app was cancelled."] -pub const DSPHOOK_ONCANCEL: DSP_HookType = 2; -#[doc = "DSP hook types."] -pub type DSP_HookType = ::libc::c_uint; -#[doc = "DSP hook function."] -pub type dspHookFn = ::core::option::Option; -#[doc = "DSP hook cookie."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct tag_dspHookCookie { - #[doc = "< Next cookie."] - pub next: *mut tag_dspHookCookie, - #[doc = "< Hook callback."] - pub callback: dspHookFn, -} -impl Default for tag_dspHookCookie { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "DSP hook cookie."] -pub type dspHookCookie = tag_dspHookCookie; -extern "C" { - #[must_use] - #[doc = "Initializes the dsp service.\n\n Call this before calling any DSP_* function.\n > **Note:** This will also unload any previously loaded DSP binary.\n It is done this way since you have to provide your binary when the 3DS leaves sleep mode anyway."] - pub fn dspInit() -> Result; -} -extern "C" { - #[doc = "Closes the dsp service.\n > **Note:** This will also unload the DSP binary."] - pub fn dspExit(); -} -extern "C" { - #[doc = "Returns true if a component is loaded, false otherwise."] - pub fn dspIsComponentLoaded() -> bool; -} -extern "C" { - #[doc = "Sets up a DSP status hook.\n # Arguments\n\n* `cookie` - Hook cookie to use.\n * `callback` - Function to call when DSP's status changes."] - pub fn dspHook(cookie: *mut dspHookCookie, callback: dspHookFn); -} -extern "C" { - #[doc = "Removes a DSP status hook.\n # Arguments\n\n* `cookie` - Hook cookie to remove."] - pub fn dspUnhook(cookie: *mut dspHookCookie); -} -extern "C" { - #[must_use] - #[doc = "Checks if a headphone is inserted.\n # Arguments\n\n* `is_inserted` - Pointer to output the insertion status to."] - pub fn DSP_GetHeadphoneStatus(is_inserted: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Flushes the cache\n # Arguments\n\n* `address` - Beginning of the memory range to flush, inside the Linear or DSP memory regions\n * `size` - Size of the memory range to flush\n\n Flushes the cache for the specified memory range and invalidates the cache"] - pub fn DSP_FlushDataCache(address: *const ::libc::c_void, size: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Invalidates the cache\n # Arguments\n\n* `address` - Beginning of the memory range to invalidate, inside the Linear or DSP memory regions\n * `size` - Size of the memory range to flush\n\n Invalidates the cache for the specified memory range"] - pub fn DSP_InvalidateDataCache(address: *const ::libc::c_void, size: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Retrieves the handle of the DSP semaphore.\n # Arguments\n\n* `semaphore` - Pointer to output the semaphore to."] - pub fn DSP_GetSemaphoreHandle(semaphore: *mut Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the DSP hardware semaphore value.\n # Arguments\n\n* `value` - Value to set."] - pub fn DSP_SetSemaphore(value: u16_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Masks the DSP hardware semaphore value.\n # Arguments\n\n* `mask` - Mask to apply."] - pub fn DSP_SetSemaphoreMask(mask: u16_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Loads a DSP binary and starts the DSP\n # Arguments\n\n* `component` - The program file address in memory\n * `size` - The size of the program\n * `prog_mask` - DSP memory block related ? Default is 0xff.\n * `data_mask` - DSP memory block related ? Default is 0xff.\n * `is_loaded` - Indicates if the DSP was succesfully loaded.\n\n > **Note:** The binary must be signed (http://3dbrew.org/wiki/DSP_Binary)\n > **Note:** Seems to be called when the 3ds leaves the Sleep mode"] - pub fn DSP_LoadComponent( - component: *const ::libc::c_void, - size: u32_, - prog_mask: u16_, - data_mask: u16_, - is_loaded: *mut bool, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Stops the DSP by unloading the binary."] - pub fn DSP_UnloadComponent() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Registers an event handle with the DSP through IPC\n # Arguments\n\n* `handle` - Event handle to register.\n * `interrupt` - The type of interrupt that will trigger the event. Usual value is DSP_INTERRUPT_PIPE.\n * `channel` - The pipe channel. Usual value is 2\n\n > **Note:** It is possible that interrupt are inverted"] - pub fn DSP_RegisterInterruptEvents(handle: Handle, interrupt: u32_, channel: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Reads a pipe if possible.\n # Arguments\n\n* `channel` - unknown. Usually 2\n * `peer` - unknown. Usually 0\n * `buffer` - The buffer that will store the values read from the pipe\n * `length` - Length of the buffer\n * `length_read` - Number of bytes read by the command"] - pub fn DSP_ReadPipeIfPossible( - channel: u32_, - peer: u32_, - buffer: *mut ::libc::c_void, - length: u16_, - length_read: *mut u16_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Writes to a pipe.\n # Arguments\n\n* `channel` - unknown. Usually 2\n * `buffer` - The message to send to the DSP process\n * `length` - Length of the message"] - pub fn DSP_WriteProcessPipe( - channel: u32_, - buffer: *const ::libc::c_void, - length: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Converts a DSP memory address to a virtual address usable by the process.\n # Arguments\n\n* `dsp_address` - Address to convert.\n * `arm_address` - Pointer to output the converted address to."] - pub fn DSP_ConvertProcessAddressFromDspDram( - dsp_address: u32_, - arm_address: *mut u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Reads a DSP register\n # Arguments\n\n* `regNo` - Offset of the hardware register, base address is 0x1EC40000\n * `value` - Pointer to read the register value to."] - pub fn DSP_RecvData(regNo: u16_, value: *mut u16_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Checks if you can read a DSP register\n # Arguments\n\n* `regNo` - Offset of the hardware register, base address is 0x1EC40000\n * `is_ready` - Pointer to write the ready status to.\n\n This call might hang if the data is not ready. See DSP_SendDataIsEmpty."] - pub fn DSP_RecvDataIsReady(regNo: u16_, is_ready: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Writes to a DSP register\n # Arguments\n\n* `regNo` - Offset of the hardware register, base address is 0x1EC40000\n * `value` - Value to write.\n\n This call might hang if the SendData is not empty. See DSP_SendDataIsEmpty."] - pub fn DSP_SendData(regNo: u16_, value: u16_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Checks if you can write to a DSP register ?\n # Arguments\n\n* `regNo` - Offset of the hardware register, base address is 0x1EC40000\n * `is_empty` - Pointer to write the empty status to."] - pub fn DSP_SendDataIsEmpty(regNo: u16_, is_empty: *mut bool) -> Result; -} -pub type FSPXI_Archive = u64_; -pub type FSPXI_File = u64_; -pub type FSPXI_Directory = u64_; -extern "C" { - #[must_use] - #[doc = "Opens a file.\n # Arguments\n\n* `out` - Pointer to output the file handle to.\n * `archive` - Archive containing the file.\n * `path` - Path of the file.\n * `flags` - Flags to open the file with.\n * `attributes` - Attributes of the file."] - pub fn FSPXI_OpenFile( - serviceHandle: Handle, - out: *mut FSPXI_File, - archive: FSPXI_Archive, - path: FS_Path, - flags: u32_, - attributes: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Deletes a file.\n # Arguments\n\n* `archive` - Archive containing the file.\n * `path` - Path of the file."] - pub fn FSPXI_DeleteFile(serviceHandle: Handle, archive: FSPXI_Archive, path: FS_Path) - -> Result; -} -extern "C" { - #[must_use] - #[doc = "Renames a file.\n # Arguments\n\n* `srcArchive` - Archive containing the source file.\n * `srcPath` - Path of the source file.\n * `dstArchive` - Archive containing the destination file.\n * `dstPath` - Path of the destination file."] - pub fn FSPXI_RenameFile( - serviceHandle: Handle, - srcArchive: FSPXI_Archive, - srcPath: FS_Path, - dstArchive: FSPXI_Archive, - dstPath: FS_Path, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Deletes a directory.\n # Arguments\n\n* `archive` - Archive containing the directory.\n * `path` - Path of the directory."] - pub fn FSPXI_DeleteDirectory( - serviceHandle: Handle, - archive: FSPXI_Archive, - path: FS_Path, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Creates a file.\n # Arguments\n\n* `archive` - Archive to create the file in.\n * `path` - Path of the file.\n * `attributes` - Attributes of the file.\n * `size` - Size of the file."] - pub fn FSPXI_CreateFile( - serviceHandle: Handle, - archive: FSPXI_Archive, - path: FS_Path, - attributes: u32_, - fileSize: u64_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Creates a directory.\n # Arguments\n\n* `archive` - Archive to create the directory in.\n * `path` - Path of the directory.\n * `attributes` - Attributes of the directory."] - pub fn FSPXI_CreateDirectory( - serviceHandle: Handle, - archive: FSPXI_Archive, - path: FS_Path, - attributes: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Renames a directory.\n # Arguments\n\n* `srcArchive` - Archive containing the source directory.\n * `srcPath` - Path of the source directory.\n * `dstArchive` - Archive containing the destination directory.\n * `dstPath` - Path of the destination directory."] - pub fn FSPXI_RenameDirectory( - serviceHandle: Handle, - srcArchive: FSPXI_Archive, - srcPath: FS_Path, - dstArchive: FSPXI_Archive, - dstPath: FS_Path, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Opens a directory.\n # Arguments\n\n* `out` - Pointer to output the directory handle to.\n * `archive` - Archive containing the directory.\n * `path` - Path of the directory."] - pub fn FSPXI_OpenDirectory( - serviceHandle: Handle, - out: *mut FSPXI_Directory, - archive: FSPXI_Archive, - path: FS_Path, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Reads from a file.\n # Arguments\n\n* `file` - File to read from.\n * `bytesRead` - Pointer to output the number of read bytes to.\n * `offset` - Offset to read from.\n * `buffer` - Buffer to read to.\n * `size` - Size of the buffer."] - pub fn FSPXI_ReadFile( - serviceHandle: Handle, - file: FSPXI_File, - bytesRead: *mut u32_, - offset: u64_, - buffer: *mut ::libc::c_void, - size: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Calculate SHA256 of a file.\n # Arguments\n\n* `file` - File to calculate the hash of.\n * `buffer` - Buffer to output the hash to.\n * `size` - Size of the buffer."] - pub fn FSPXI_CalculateFileHashSHA256( - serviceHandle: Handle, - file: FSPXI_File, - buffer: *mut ::libc::c_void, - size: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Writes to a file.\n # Arguments\n\n* `file` - File to write to.\n * `bytesWritten` - Pointer to output the number of bytes written to.\n * `offset` - Offset to write to.\n * `buffer` - Buffer to write from.\n * `size` - Size of the buffer.\n * `flags` - Flags to use when writing."] - pub fn FSPXI_WriteFile( - serviceHandle: Handle, - file: FSPXI_File, - bytesWritten: *mut u32_, - offset: u64_, - buffer: *const ::libc::c_void, - size: u32_, - flags: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Calculates the MAC used in a DISA/DIFF header?\n # Arguments\n\n* `file` - Unsure\n * `inBuffer` - 0x100-byte DISA/DIFF input buffer.\n * `inSize` - Size of inBuffer.\n * `outBuffer` - Buffer to write MAC to.\n * `outSize` - Size of outBuffer."] - pub fn FSPXI_CalcSavegameMAC( - serviceHandle: Handle, - file: FSPXI_File, - inBuffer: *const ::libc::c_void, - inSize: u32_, - outBuffer: *mut ::libc::c_void, - outSize: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Get size of a file\n # Arguments\n\n* `file` - File to get the size of.\n * `size` - Pointer to output size to."] - pub fn FSPXI_GetFileSize(serviceHandle: Handle, file: FSPXI_File, size: *mut u64_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Set size of a file\n # Arguments\n\n* `file` - File to set the size of\n * `size` - Size to set the file to"] - pub fn FSPXI_SetFileSize(serviceHandle: Handle, file: FSPXI_File, size: u64_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Close a file\n # Arguments\n\n* `file` - File to close"] - pub fn FSPXI_CloseFile(serviceHandle: Handle, file: FSPXI_File) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Reads one or more directory entries.\n # Arguments\n\n* `directory` - Directory to read from.\n * `entriesRead` - Pointer to output the number of entries read to.\n * `entryCount` - Number of entries to read.\n * `entryOut` - Pointer to output directory entries to."] - pub fn FSPXI_ReadDirectory( - serviceHandle: Handle, - directory: FSPXI_Directory, - entriesRead: *mut u32_, - entryCount: u32_, - entries: *mut FS_DirectoryEntry, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Close a directory\n # Arguments\n\n* `directory` - Directory to close."] - pub fn FSPXI_CloseDirectory(serviceHandle: Handle, directory: FSPXI_Directory) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Opens an archive.\n # Arguments\n\n* `archive` - Pointer to output the opened archive to.\n * `id` - ID of the archive.\n * `path` - Path of the archive."] - pub fn FSPXI_OpenArchive( - serviceHandle: Handle, - archive: *mut FSPXI_Archive, - archiveID: FS_ArchiveID, - path: FS_Path, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Checks if the archive contains a file at path.\n # Arguments\n\n* `archive` - Archive to check.\n * `out` - Pointer to output existence to.\n * `path` - Path to check for file"] - pub fn FSPXI_HasFile( - serviceHandle: Handle, - archive: FSPXI_Archive, - out: *mut bool, - path: FS_Path, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Checks if the archive contains a directory at path.\n # Arguments\n\n* `archive` - Archive to check.\n * `out` - Pointer to output existence to.\n * `path` - Path to check for directory"] - pub fn FSPXI_HasDirectory( - serviceHandle: Handle, - archive: FSPXI_Archive, - out: *mut bool, - path: FS_Path, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Commits an archive's save data.\n # Arguments\n\n* `archive` - Archive to commit.\n * `id` - Archive action sent by FSUSER_ControlArchive. Must not be 0 or 0x789D\n > Unsure why id is sent. This appears to be the default action for FSUSER_ControlArchive, with every action other than 0 and 0x789D being sent to this command."] - pub fn FSPXI_CommitSaveData(serviceHandle: Handle, archive: FSPXI_Archive, id: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Close an archive\n # Arguments\n\n* `archive` - Archive to close."] - pub fn FSPXI_CloseArchive(serviceHandle: Handle, archive: FSPXI_Archive) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Unknown 0x17. Appears to be an \"is archive handle valid\" command?\n # Arguments\n\n* `archive` - Archive handle to check validity of.\n * `out` - Pointer to output validity to."] - pub fn FSPXI_Unknown0x17( - serviceHandle: Handle, - archive: FSPXI_Archive, - out: *mut bool, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the inserted card type.\n # Arguments\n\n* `out` - Pointer to output the card type to."] - pub fn FSPXI_GetCardType(serviceHandle: Handle, out: *mut FS_CardType) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the SDMC archive resource information.\n # Arguments\n\n* `out` - Pointer to output the archive resource information to."] - pub fn FSPXI_GetSdmcArchiveResource( - serviceHandle: Handle, - out: *mut FS_ArchiveResource, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the NAND archive resource information.\n # Arguments\n\n* `out` - Pointer to output the archive resource information to."] - pub fn FSPXI_GetNandArchiveResource( - serviceHandle: Handle, - out: *mut FS_ArchiveResource, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the error code from the SDMC FatFS driver\n # Arguments\n\n* `out` - Pointer to output the error code to"] - pub fn FSPXI_GetSdmcFatFsError(serviceHandle: Handle, out: *mut u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets whether PXIFS0 detects the SD\n # Arguments\n\n* `out` - Pointer to output the detection status to"] - pub fn FSPXI_IsSdmcDetected(serviceHandle: Handle, out: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets whether PXIFS0 can write to the SD\n # Arguments\n\n* `out` - Pointer to output the writable status to"] - pub fn FSPXI_IsSdmcWritable(serviceHandle: Handle, out: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the SDMC CID\n # Arguments\n\n* `out` - Buffer to output the CID to.\n * `size` - Size of buffer."] - pub fn FSPXI_GetSdmcCid(serviceHandle: Handle, out: *mut ::libc::c_void, size: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the NAND CID\n # Arguments\n\n* `out` - Buffer to output the CID to.\n * `size` - Size of buffer."] - pub fn FSPXI_GetNandCid(serviceHandle: Handle, out: *mut ::libc::c_void, size: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the SDMC speed info\n # Arguments\n\n* `out` - Buffer to output the speed info to."] - pub fn FSPXI_GetSdmcSpeedInfo(serviceHandle: Handle, out: *mut FS_SdMmcSpeedInfo) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the NAND speed info\n # Arguments\n\n* `out` - Buffer to output the speed info to."] - pub fn FSPXI_GetNandSpeedInfo(serviceHandle: Handle, out: *mut FS_SdMmcSpeedInfo) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the SDMC log\n # Arguments\n\n* `out` - Buffer to output the log to.\n * `size` - Size of buffer."] - pub fn FSPXI_GetSdmcLog(serviceHandle: Handle, out: *mut ::libc::c_void, size: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the NAND log\n # Arguments\n\n* `out` - Buffer to output the log to.\n * `size` - Size of buffer."] - pub fn FSPXI_GetNandLog(serviceHandle: Handle, out: *mut ::libc::c_void, size: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Clears the SDMC log"] - pub fn FSPXI_ClearSdmcLog(serviceHandle: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Clears the NAND log"] - pub fn FSPXI_ClearNandLog(serviceHandle: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets whether a card is inserted.\n # Arguments\n\n* `inserted` - Pointer to output the insertion status to."] - pub fn FSPXI_CardSlotIsInserted(serviceHandle: Handle, inserted: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Powers on the card slot.\n # Arguments\n\n* `status` - Pointer to output the power status to."] - pub fn FSPXI_CardSlotPowerOn(serviceHandle: Handle, status: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Powers off the card slot.\n # Arguments\n\n* `status` - Pointer to output the power status to."] - pub fn FSPXI_CardSlotPowerOff(serviceHandle: Handle, status: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the card's power status.\n # Arguments\n\n* `status` - Pointer to output the power status to."] - pub fn FSPXI_CardSlotGetCardIFPowerStatus(serviceHandle: Handle, status: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Executes a CARDNOR direct command.\n # Arguments\n\n* `commandId` - ID of the command."] - pub fn FSPXI_CardNorDirectCommand(serviceHandle: Handle, commandId: u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Executes a CARDNOR direct command with an address.\n # Arguments\n\n* `commandId` - ID of the command.\n * `address` - Address to provide."] - pub fn FSPXI_CardNorDirectCommandWithAddress( - serviceHandle: Handle, - commandId: u8_, - address: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Executes a CARDNOR direct read.\n # Arguments\n\n* `commandId` - ID of the command.\n * `size` - Size of the output buffer.\n * `output` - Output buffer."] - pub fn FSPXI_CardNorDirectRead( - serviceHandle: Handle, - commandId: u8_, - size: u32_, - output: *mut ::libc::c_void, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Executes a CARDNOR direct read with an address.\n # Arguments\n\n* `commandId` - ID of the command.\n * `address` - Address to provide.\n * `size` - Size of the output buffer.\n * `output` - Output buffer."] - pub fn FSPXI_CardNorDirectReadWithAddress( - serviceHandle: Handle, - commandId: u8_, - address: u32_, - size: u32_, - output: *mut ::libc::c_void, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Executes a CARDNOR direct write.\n # Arguments\n\n* `commandId` - ID of the command.\n * `size` - Size of the input buffer.\n * `output` - Input buffer.\n > Stubbed in latest firmware, since ?.?.?"] - pub fn FSPXI_CardNorDirectWrite( - serviceHandle: Handle, - commandId: u8_, - size: u32_, - input: *const ::libc::c_void, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Executes a CARDNOR direct write with an address.\n # Arguments\n\n* `commandId` - ID of the command.\n * `address` - Address to provide.\n * `size` - Size of the input buffer.\n * `input` - Input buffer."] - pub fn FSPXI_CardNorDirectWriteWithAddress( - serviceHandle: Handle, - commandId: u8_, - address: u32_, - size: u32_, - input: *const ::libc::c_void, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Executes a CARDNOR 4xIO direct read.\n # Arguments\n\n* `commandId` - ID of the command.\n * `address` - Address to provide.\n * `size` - Size of the output buffer.\n * `output` - Output buffer."] - pub fn FSPXI_CardNorDirectRead_4xIO( - serviceHandle: Handle, - commandId: u8_, - address: u32_, - size: u32_, - output: *mut ::libc::c_void, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Executes a CARDNOR direct CPU write without verify.\n # Arguments\n\n* `address` - Address to provide.\n * `size` - Size of the input buffer.\n * `output` - Input buffer."] - pub fn FSPXI_CardNorDirectCpuWriteWithoutVerify( - serviceHandle: Handle, - address: u32_, - size: u32_, - input: *const ::libc::c_void, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Executes a CARDNOR direct sector erase without verify.\n # Arguments\n\n* `address` - Address to provide."] - pub fn FSPXI_CardNorDirectSectorEraseWithoutVerify( - serviceHandle: Handle, - address: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets an NCCH's product info\n # Arguments\n\n* `info` - Pointer to output the product info to.\n * `archive` - Open NCCH content archive"] - pub fn FSPXI_GetProductInfo( - serviceHandle: Handle, - info: *mut FS_ProductInfo, - archive: FSPXI_Archive, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the CARDSPI baud rate.\n # Arguments\n\n* `baudRate` - Baud rate to set."] - pub fn FSPXI_SetCardSpiBaudrate(serviceHandle: Handle, baudRate: FS_CardSpiBaudRate) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the CARDSPI bus mode.\n # Arguments\n\n* `busMode` - Bus mode to set."] - pub fn FSPXI_SetCardSpiBusMode(serviceHandle: Handle, busMode: FS_CardSpiBusMode) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sends initialization info to ARM9\n # Arguments\n\n* `unk` - FS sends *(0x1FF81086)"] - pub fn FSPXI_SendInitializeInfoTo9(serviceHandle: Handle, unk: u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Creates ext save data.\n # Arguments\n\n* `info` - Info of the save data."] - pub fn FSPXI_CreateExtSaveData(serviceHandle: Handle, info: FS_ExtSaveDataInfo) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Deletes ext save data.\n # Arguments\n\n* `info` - Info of the save data."] - pub fn FSPXI_DeleteExtSaveData(serviceHandle: Handle, info: FS_ExtSaveDataInfo) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Enumerates ext save data.\n # Arguments\n\n* `idsWritten` - Pointer to output the number of IDs written to.\n * `idsSize` - Size of the IDs buffer.\n * `mediaType` - Media type to enumerate over.\n * `idSize` - Size of each ID element.\n * `shared` - Whether to enumerate shared ext save data.\n * `ids` - Pointer to output IDs to."] - pub fn FSPXI_EnumerateExtSaveData( - serviceHandle: Handle, - idsWritten: *mut u32_, - idsSize: u32_, - mediaType: FS_MediaType, - idSize: u32_, - shared: bool, - ids: *mut u8_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets a special content's index.\n # Arguments\n\n* `index` - Pointer to output the index to.\n * `mediaType` - Media type of the special content.\n * `programId` - Program ID owning the special content.\n * `type` - Type of special content."] - pub fn FSPXI_GetSpecialContentIndex( - serviceHandle: Handle, - index: *mut u16_, - mediaType: FS_MediaType, - programId: u64_, - type_: FS_SpecialContentType, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the legacy ROM header of a program.\n # Arguments\n\n* `mediaType` - Media type of the program.\n * `programId` - ID of the program.\n * `header` - Pointer to output the legacy ROM header to. (size = 0x3B4)"] - pub fn FSPXI_GetLegacyRomHeader( - serviceHandle: Handle, - mediaType: FS_MediaType, - programId: u64_, - header: *mut ::libc::c_void, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the legacy banner data of a program.\n # Arguments\n\n* `mediaType` - Media type of the program.\n * `programId` - ID of the program.\n * `banner` - Pointer to output the legacy banner data to. (size = 0x23C0)\n * `unk` - Unknown. Always 1?"] - pub fn FSPXI_GetLegacyBannerData( - serviceHandle: Handle, - mediaType: FS_MediaType, - programId: u64_, - banner: *mut ::libc::c_void, - unk: u8_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Formats the CARDNOR device.\n # Arguments\n\n* `unk` - Unknown. Transaction?"] - pub fn FSPXI_FormatCardNorDevice(serviceHandle: Handle, unk: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Deletes the 3DS SDMC root."] - pub fn FSPXI_DeleteSdmcRoot(serviceHandle: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Deletes all ext save data on the NAND."] - pub fn FSPXI_DeleteAllExtSaveDataOnNand(serviceHandle: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initializes the CTR file system."] - pub fn FSPXI_InitializeCtrFilesystem(serviceHandle: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Creates the FS seed."] - pub fn FSPXI_CreateSeed(serviceHandle: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the CTR SDMC root path.\n # Arguments\n\n* `out` - Pointer to output the root path to.\n * `length` - Length of the output buffer in bytes."] - pub fn FSPXI_GetSdmcCtrRootPath(serviceHandle: Handle, out: *mut u16_, length: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets an archive's resource information.\n # Arguments\n\n* `archiveResource` - Pointer to output the archive resource information to.\n * `mediaType` - System media type to check."] - pub fn FSPXI_GetArchiveResource( - serviceHandle: Handle, - archiveResource: *mut FS_ArchiveResource, - mediaType: FS_SystemMediaType, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Exports the integrity verification seed.\n # Arguments\n\n* `seed` - Pointer to output the seed to."] - pub fn FSPXI_ExportIntegrityVerificationSeed( - serviceHandle: Handle, - seed: *mut FS_IntegrityVerificationSeed, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Imports an integrity verification seed.\n # Arguments\n\n* `seed` - Seed to import."] - pub fn FSPXI_ImportIntegrityVerificationSeed( - serviceHandle: Handle, - seed: *const FS_IntegrityVerificationSeed, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the legacy sub banner data of a program.\n # Arguments\n\n* `bannerSize` - Size of the banner.\n * `mediaType` - Media type of the program.\n * `programId` - ID of the program.\n * `header` - Pointer to output the legacy sub banner data to."] - pub fn FSPXI_GetLegacySubBannerData( - serviceHandle: Handle, - bannerSize: u32_, - mediaType: FS_MediaType, - programId: u64_, - banner: *mut ::libc::c_void, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Generates random bytes. Uses same code as PSPXI_GenerateRandomBytes\n # Arguments\n\n* `buf` - Buffer to output random bytes to.\n * `size` - Size of buffer."] - pub fn FSPXI_GenerateRandomBytes( - serviceHandle: Handle, - buffer: *mut ::libc::c_void, - size: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the last modified time of a file in an archive.\n # Arguments\n\n* `archive` - The archive that contains the file.\n * `out` - The pointer to write the timestamp to.\n * `path` - The UTF-16 path of the file.\n * `size` - The size of the path."] - pub fn FSPXI_GetFileLastModified( - serviceHandle: Handle, - archive: FSPXI_Archive, - out: *mut u64_, - path: *const u16_, - size: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Reads from a special file.\n # Arguments\n\n* `bytesRead` - Pointer to output the number of bytes read to.\n * `fileOffset` - Offset of the file.\n * `size` - Size of the buffer.\n * `data` - Buffer to read to."] - pub fn FSPXI_ReadSpecialFile( - serviceHandle: Handle, - bytesRead: *mut u32_, - fileOffset: u64_, - size: u32_, - data: *mut ::libc::c_void, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the size of a special file.\n # Arguments\n\n* `fileSize` - Pointer to output the size to."] - pub fn FSPXI_GetSpecialFileSize(serviceHandle: Handle, fileSize: *mut u64_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initiates a device move as the source device.\n # Arguments\n\n* `context` - Pointer to output the context to."] - pub fn FSPXI_StartDeviceMoveAsSource( - serviceHandle: Handle, - context: *mut FS_DeviceMoveContext, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initiates a device move as the destination device.\n # Arguments\n\n* `context` - Context to use.\n * `clear` - Whether to clear the device's data first."] - pub fn FSPXI_StartDeviceMoveAsDestination( - serviceHandle: Handle, - context: FS_DeviceMoveContext, - clear: bool, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Reads data and stores SHA256 hashes of blocks\n # Arguments\n\n* `file` - File to read from.\n * `bytesRead` - Pointer to output the number of read bytes to.\n * `offset` - Offset to read from.\n * `readBuffer` - Pointer to store read data in.\n * `readBufferSize` - Size of readBuffer.\n * `hashtable` - Pointer to store SHA256 hashes in.\n * `hashtableSize` - Size of hashtable.\n * `unk` - Unknown. Always 0x00001000? Possibly block size?"] - pub fn FSPXI_ReadFileSHA256( - serviceHandle: Handle, - file: FSPXI_File, - bytesRead: *mut u32_, - offset: u64_, - readBuffer: *mut ::libc::c_void, - readBufferSize: u32_, - hashtable: *mut ::libc::c_void, - hashtableSize: u32_, - unk: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Assumedly writes data and stores SHA256 hashes of blocks\n # Arguments\n\n* `file` - File to write to.\n * `bytesWritten` - Pointer to output the number of written bytes to.\n * `offset` - Offset to write to.\n * `writeBuffer` - Buffer to write from.\n * `writeBufferSize` - Size of writeBuffer.\n * `hashtable` - Pointer to store SHA256 hashes in.\n * `hashtableSize` - Size of hashtable\n * `unk1` - Unknown. Might match with ReadFileSHA256's unknown?\n * `unk2` - Unknown. Might match with ReadFileSHA256's unknown?"] - pub fn FSPXI_WriteFileSHA256( - serviceHandle: Handle, - file: FSPXI_File, - bytesWritten: *mut u32_, - offset: u64_, - writeBuffer: *const ::libc::c_void, - writeBufferSize: u32_, - hashtable: *mut ::libc::c_void, - hashtableSize: u32_, - unk1: u32_, - unk2: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Configures CTRCARD latency emulation.\n # Arguments\n\n* `latency` - Latency to apply."] - pub fn FSPXI_SetCtrCardLatencyParameter(serviceHandle: Handle, latency: u64_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the file system priority.\n # Arguments\n\n* `priority` - Priority to set."] - pub fn FSPXI_SetPriority(serviceHandle: Handle, priority: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Toggles cleaning up invalid save data.\n # Arguments\n\n* `enable` - Whether to enable cleaning up invalid save data."] - pub fn FSPXI_SwitchCleanupInvalidSaveData(serviceHandle: Handle, enable: bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Enumerates system save data.\n # Arguments\n\n* `idsWritten` - Pointer to output the number of IDs written to.\n * `idsSize` - Size of the IDs buffer.\n * `ids` - Pointer to output IDs to."] - pub fn FSPXI_EnumerateSystemSaveData( - serviceHandle: Handle, - idsWritten: *mut u32_, - idsSize: u32_, - ids: *mut u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Reads the NAND report.\n # Arguments\n\n* `unk` - Unknown\n * `buffer` - Buffer to write the report to.\n * `size` - Size of buffer"] - pub fn FSPXI_ReadNandReport( - serviceHandle: Handle, - buffer: *mut ::libc::c_void, - size: u32_, - unk: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Unknown command 0x56\n > Called by FSUSER_ControlArchive with ArchiveAction 0x789D"] - pub fn FSPXI_Unknown0x56( - serviceHandle: Handle, - out: *mut u32_, - archive: FS_Archive, - path: FS_Path, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initializes fs:REG."] - pub fn fsRegInit() -> Result; -} -extern "C" { - #[doc = "Exits fs:REG."] - pub fn fsRegExit(); -} -extern "C" { - #[doc = "Gets the current fs:REG session handle.\n # Returns\n\nThe current fs:REG session handle."] - pub fn fsRegGetSessionHandle() -> *mut Handle; -} -extern "C" { - #[must_use] - #[doc = "Registers a program's storage information.\n # Arguments\n\n* `pid` - The Process ID of the program.\n * `programHandle` - The program handle.\n * `programInfo` - Information about the program.\n * `storageInfo` - Storage information to register."] - pub fn FSREG_Register( - pid: u32_, - programHandle: u64_, - programInfo: *const FS_ProgramInfo, - storageInfo: *const ExHeader_Arm11StorageInfo, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Unregisters a program's storage information.\n # Arguments\n\n* `pid` - The Process ID of the program."] - pub fn FSREG_Unregister(pid: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Retrives the exheader information set(s) (SCI+ACI) about a program.\n # Arguments\n\n* `exheaderInfos[out]` - Pointer to the output exheader information set(s).\n * `maxNumEntries` - The maximum number of entries.\n * `programHandle` - The program handle."] - pub fn FSREG_GetProgramInfo( - exheaderInfos: *mut ExHeader_Info, - maxNumEntries: u32_, - programHandle: u64_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Loads a program.\n # Arguments\n\n* `programHandle[out]` - Pointer to the output the program handle to.\n * `programInfo` - Information about the program to load."] - pub fn FSREG_LoadProgram( - programHandle: *mut u64_, - programInfo: *const FS_ProgramInfo, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Unloads a program.\n # Arguments\n\n* `programHandle` - The program handle."] - pub fn FSREG_UnloadProgram(programHandle: u64_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Checks if a program has been loaded by fs:REG.\n # Arguments\n\n* `programHandle` - The program handle."] - pub fn FSREG_CheckHostLoadId(programHandle: u64_) -> Result; -} -#[doc = "Shared Mii struct"] -#[repr(C)] -#[repr(align(1))] -pub struct MiiData { - pub _bindgen_opaque_blob: [u8; 92usize], -} -#[doc = "Mii options"] -#[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone)] -pub struct MiiData__bindgen_ty_1 { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, -} -impl MiiData__bindgen_ty_1 { - #[inline] - pub fn allow_copying(&self) -> bool { - unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } - } - #[inline] - pub fn set_allow_copying(&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_private_name(&self) -> bool { - unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) } - } - #[inline] - pub fn set_is_private_name(&mut self, val: bool) { - unsafe { - let val: u8 = ::core::mem::transmute(val); - self._bitfield_1.set(1usize, 1u8, val as u64) - } - } - #[inline] - pub fn region_lock(&self) -> u8_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 2u8) as u8) } - } - #[inline] - pub fn set_region_lock(&mut self, val: u8_) { - unsafe { - let val: u8 = ::core::mem::transmute(val); - self._bitfield_1.set(2usize, 2u8, val as u64) - } - } - #[inline] - pub fn char_set(&self) -> u8_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 2u8) as u8) } - } - #[inline] - pub fn set_char_set(&mut self, val: u8_) { - unsafe { - let val: u8 = ::core::mem::transmute(val); - self._bitfield_1.set(4usize, 2u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - allow_copying: bool, - is_private_name: bool, - region_lock: u8_, - char_set: u8_, - ) -> __BindgenBitfieldUnit<[u8; 1usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let allow_copying: u8 = unsafe { ::core::mem::transmute(allow_copying) }; - allow_copying as u64 - }); - __bindgen_bitfield_unit.set(1usize, 1u8, { - let is_private_name: u8 = unsafe { ::core::mem::transmute(is_private_name) }; - is_private_name as u64 - }); - __bindgen_bitfield_unit.set(2usize, 2u8, { - let region_lock: u8 = unsafe { ::core::mem::transmute(region_lock) }; - region_lock as u64 - }); - __bindgen_bitfield_unit.set(4usize, 2u8, { - let char_set: u8 = unsafe { ::core::mem::transmute(char_set) }; - char_set as u64 - }); - __bindgen_bitfield_unit - } -} -#[doc = "Mii position in Mii selector or Mii maker"] -#[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone)] -pub struct MiiData__bindgen_ty_2 { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, -} -impl MiiData__bindgen_ty_2 { - #[inline] - pub fn page_index(&self) -> u8_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) } - } - #[inline] - pub fn set_page_index(&mut self, val: u8_) { - unsafe { - let val: u8 = ::core::mem::transmute(val); - self._bitfield_1.set(0usize, 4u8, val as u64) - } - } - #[inline] - pub fn slot_index(&self) -> u8_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) } - } - #[inline] - pub fn set_slot_index(&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(page_index: u8_, slot_index: u8_) -> __BindgenBitfieldUnit<[u8; 1usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 4u8, { - let page_index: u8 = unsafe { ::core::mem::transmute(page_index) }; - page_index as u64 - }); - __bindgen_bitfield_unit.set(4usize, 4u8, { - let slot_index: u8 = unsafe { ::core::mem::transmute(slot_index) }; - slot_index as u64 - }); - __bindgen_bitfield_unit - } -} -#[doc = "Console Identity"] -#[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone)] -pub struct MiiData__bindgen_ty_3 { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, -} -impl MiiData__bindgen_ty_3 { - #[inline] - pub fn unknown0(&self) -> u8_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) } - } - #[inline] - pub fn set_unknown0(&mut self, val: u8_) { - unsafe { - let val: u8 = ::core::mem::transmute(val); - self._bitfield_1.set(0usize, 4u8, val as u64) - } - } - #[inline] - pub fn origin_console(&self) -> u8_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 3u8) as u8) } - } - #[inline] - pub fn set_origin_console(&mut self, val: u8_) { - unsafe { - let val: u8 = ::core::mem::transmute(val); - self._bitfield_1.set(4usize, 3u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - unknown0: u8_, - origin_console: u8_, - ) -> __BindgenBitfieldUnit<[u8; 1usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 4u8, { - let unknown0: u8 = unsafe { ::core::mem::transmute(unknown0) }; - unknown0 as u64 - }); - __bindgen_bitfield_unit.set(4usize, 3u8, { - let origin_console: u8 = unsafe { ::core::mem::transmute(origin_console) }; - origin_console as u64 - }); - __bindgen_bitfield_unit - } -} -#[doc = "Mii details"] -#[repr(C)] -#[repr(align(2))] -#[derive(Debug, Default, Copy, Clone)] -pub struct MiiData__bindgen_ty_4 { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>, -} -impl MiiData__bindgen_ty_4 { - #[inline] - pub fn sex(&self) -> bool { - unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } - } - #[inline] - pub fn set_sex(&mut self, val: bool) { - unsafe { - let val: u8 = ::core::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn bday_month(&self) -> u16_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 4u8) as u16) } - } - #[inline] - pub fn set_bday_month(&mut self, val: u16_) { - unsafe { - let val: u16 = ::core::mem::transmute(val); - self._bitfield_1.set(1usize, 4u8, val as u64) - } - } - #[inline] - pub fn bday_day(&self) -> u16_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(5usize, 5u8) as u16) } - } - #[inline] - pub fn set_bday_day(&mut self, val: u16_) { - unsafe { - let val: u16 = ::core::mem::transmute(val); - self._bitfield_1.set(5usize, 5u8, val as u64) - } - } - #[inline] - pub fn shirt_color(&self) -> u16_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 4u8) as u16) } - } - #[inline] - pub fn set_shirt_color(&mut self, val: u16_) { - unsafe { - let val: u16 = ::core::mem::transmute(val); - self._bitfield_1.set(10usize, 4u8, val as u64) - } - } - #[inline] - pub fn favorite(&self) -> bool { - unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u8) } - } - #[inline] - pub fn set_favorite(&mut self, val: bool) { - unsafe { - let val: u8 = ::core::mem::transmute(val); - self._bitfield_1.set(14usize, 1u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - sex: bool, - bday_month: u16_, - bday_day: u16_, - shirt_color: u16_, - favorite: bool, - ) -> __BindgenBitfieldUnit<[u8; 2usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let sex: u8 = unsafe { ::core::mem::transmute(sex) }; - sex as u64 - }); - __bindgen_bitfield_unit.set(1usize, 4u8, { - let bday_month: u16 = unsafe { ::core::mem::transmute(bday_month) }; - bday_month as u64 - }); - __bindgen_bitfield_unit.set(5usize, 5u8, { - let bday_day: u16 = unsafe { ::core::mem::transmute(bday_day) }; - bday_day as u64 - }); - __bindgen_bitfield_unit.set(10usize, 4u8, { - let shirt_color: u16 = unsafe { ::core::mem::transmute(shirt_color) }; - shirt_color as u64 - }); - __bindgen_bitfield_unit.set(14usize, 1u8, { - let favorite: u8 = unsafe { ::core::mem::transmute(favorite) }; - favorite as u64 - }); - __bindgen_bitfield_unit - } -} -#[doc = "Face style"] -#[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone)] -pub struct MiiData__bindgen_ty_5 { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, -} -impl MiiData__bindgen_ty_5 { - #[inline] - pub fn disable_sharing(&self) -> bool { - unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } - } - #[inline] - pub fn set_disable_sharing(&mut self, val: bool) { - unsafe { - let val: u8 = ::core::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn shape(&self) -> u8_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 4u8) as u8) } - } - #[inline] - pub fn set_shape(&mut self, val: u8_) { - unsafe { - let val: u8 = ::core::mem::transmute(val); - self._bitfield_1.set(1usize, 4u8, val as u64) - } - } - #[inline] - pub fn skinColor(&self) -> u8_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(5usize, 3u8) as u8) } - } - #[inline] - pub fn set_skinColor(&mut self, val: u8_) { - unsafe { - let val: u8 = ::core::mem::transmute(val); - self._bitfield_1.set(5usize, 3u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - disable_sharing: bool, - shape: u8_, - skinColor: u8_, - ) -> __BindgenBitfieldUnit<[u8; 1usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let disable_sharing: u8 = unsafe { ::core::mem::transmute(disable_sharing) }; - disable_sharing as u64 - }); - __bindgen_bitfield_unit.set(1usize, 4u8, { - let shape: u8 = unsafe { ::core::mem::transmute(shape) }; - shape as u64 - }); - __bindgen_bitfield_unit.set(5usize, 3u8, { - let skinColor: u8 = unsafe { ::core::mem::transmute(skinColor) }; - skinColor as u64 - }); - __bindgen_bitfield_unit - } -} -#[doc = "Face details"] -#[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone)] -pub struct MiiData__bindgen_ty_6 { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, -} -impl MiiData__bindgen_ty_6 { - #[inline] - pub fn wrinkles(&self) -> u8_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) } - } - #[inline] - pub fn set_wrinkles(&mut self, val: u8_) { - unsafe { - let val: u8 = ::core::mem::transmute(val); - self._bitfield_1.set(0usize, 4u8, val as u64) - } - } - #[inline] - pub fn makeup(&self) -> u8_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) } - } - #[inline] - pub fn set_makeup(&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(wrinkles: u8_, makeup: u8_) -> __BindgenBitfieldUnit<[u8; 1usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 4u8, { - let wrinkles: u8 = unsafe { ::core::mem::transmute(wrinkles) }; - wrinkles as u64 - }); - __bindgen_bitfield_unit.set(4usize, 4u8, { - let makeup: u8 = unsafe { ::core::mem::transmute(makeup) }; - makeup as u64 - }); - __bindgen_bitfield_unit - } -} -#[doc = "Hair details"] -#[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone)] -pub struct MiiData__bindgen_ty_7 { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>, -} -impl MiiData__bindgen_ty_7 { - #[inline] - pub fn color(&self) -> u8_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 3u8) as u8) } - } - #[inline] - pub fn set_color(&mut self, val: u8_) { - unsafe { - let val: u8 = ::core::mem::transmute(val); - self._bitfield_1.set(0usize, 3u8, val as u64) - } - } - #[inline] - pub fn flip(&self) -> bool { - unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u8) } - } - #[inline] - pub fn set_flip(&mut self, val: bool) { - unsafe { - let val: u8 = ::core::mem::transmute(val); - self._bitfield_1.set(3usize, 1u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1(color: u8_, flip: bool) -> __BindgenBitfieldUnit<[u8; 1usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 3u8, { - let color: u8 = unsafe { ::core::mem::transmute(color) }; - color as u64 - }); - __bindgen_bitfield_unit.set(3usize, 1u8, { - let flip: u8 = unsafe { ::core::mem::transmute(flip) }; - flip as u64 - }); - __bindgen_bitfield_unit - } -} -#[doc = "Eye details"] -#[repr(C)] -#[repr(align(4))] -#[derive(Debug, Default, Copy, Clone)] -pub struct MiiData__bindgen_ty_8 { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, -} -impl MiiData__bindgen_ty_8 { - #[inline] - pub fn style(&self) -> u32_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 6u8) as u32) } - } - #[inline] - pub fn set_style(&mut self, val: u32_) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(0usize, 6u8, val as u64) - } - } - #[inline] - pub fn color(&self) -> u32_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(6usize, 3u8) as u32) } - } - #[inline] - pub fn set_color(&mut self, val: u32_) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(6usize, 3u8, val as u64) - } - } - #[inline] - pub fn scale(&self) -> u32_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 4u8) as u32) } - } - #[inline] - pub fn set_scale(&mut self, val: u32_) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(9usize, 4u8, val as u64) - } - } - #[inline] - pub fn yscale(&self) -> u32_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 3u8) as u32) } - } - #[inline] - pub fn set_yscale(&mut self, val: u32_) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(13usize, 3u8, val as u64) - } - } - #[inline] - pub fn rotation(&self) -> u32_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(16usize, 5u8) as u32) } - } - #[inline] - pub fn set_rotation(&mut self, val: u32_) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(16usize, 5u8, val as u64) - } - } - #[inline] - pub fn xspacing(&self) -> u32_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(21usize, 4u8) as u32) } - } - #[inline] - pub fn set_xspacing(&mut self, val: u32_) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(21usize, 4u8, val as u64) - } - } - #[inline] - pub fn yposition(&self) -> u32_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(25usize, 5u8) as u32) } - } - #[inline] - pub fn set_yposition(&mut self, val: u32_) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(25usize, 5u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - style: u32_, - color: u32_, - scale: u32_, - yscale: u32_, - rotation: u32_, - xspacing: u32_, - yposition: u32_, - ) -> __BindgenBitfieldUnit<[u8; 4usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 6u8, { - let style: u32 = unsafe { ::core::mem::transmute(style) }; - style as u64 - }); - __bindgen_bitfield_unit.set(6usize, 3u8, { - let color: u32 = unsafe { ::core::mem::transmute(color) }; - color as u64 - }); - __bindgen_bitfield_unit.set(9usize, 4u8, { - let scale: u32 = unsafe { ::core::mem::transmute(scale) }; - scale as u64 - }); - __bindgen_bitfield_unit.set(13usize, 3u8, { - let yscale: u32 = unsafe { ::core::mem::transmute(yscale) }; - yscale as u64 - }); - __bindgen_bitfield_unit.set(16usize, 5u8, { - let rotation: u32 = unsafe { ::core::mem::transmute(rotation) }; - rotation as u64 - }); - __bindgen_bitfield_unit.set(21usize, 4u8, { - let xspacing: u32 = unsafe { ::core::mem::transmute(xspacing) }; - xspacing as u64 - }); - __bindgen_bitfield_unit.set(25usize, 5u8, { - let yposition: u32 = unsafe { ::core::mem::transmute(yposition) }; - yposition as u64 - }); - __bindgen_bitfield_unit - } -} -#[doc = "Eyebrow details"] -#[repr(C)] -#[repr(align(4))] -#[derive(Debug, Default, Copy, Clone)] -pub struct MiiData__bindgen_ty_9 { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, -} -impl MiiData__bindgen_ty_9 { - #[inline] - pub fn style(&self) -> u32_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 5u8) as u32) } - } - #[inline] - pub fn set_style(&mut self, val: u32_) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(0usize, 5u8, val as u64) - } - } - #[inline] - pub fn color(&self) -> u32_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(5usize, 3u8) as u32) } - } - #[inline] - pub fn set_color(&mut self, val: u32_) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(5usize, 3u8, val as u64) - } - } - #[inline] - pub fn scale(&self) -> u32_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 4u8) as u32) } - } - #[inline] - pub fn set_scale(&mut self, val: u32_) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(8usize, 4u8, val as u64) - } - } - #[inline] - pub fn yscale(&self) -> u32_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 3u8) as u32) } - } - #[inline] - pub fn set_yscale(&mut self, val: u32_) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(12usize, 3u8, val as u64) - } - } - #[inline] - pub fn pad(&self) -> u32_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u32) } - } - #[inline] - pub fn set_pad(&mut self, val: u32_) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(15usize, 1u8, val as u64) - } - } - #[inline] - pub fn rotation(&self) -> u32_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(16usize, 5u8) as u32) } - } - #[inline] - pub fn set_rotation(&mut self, val: u32_) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(16usize, 5u8, val as u64) - } - } - #[inline] - pub fn xspacing(&self) -> u32_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(21usize, 4u8) as u32) } - } - #[inline] - pub fn set_xspacing(&mut self, val: u32_) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(21usize, 4u8, val as u64) - } - } - #[inline] - pub fn yposition(&self) -> u32_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(25usize, 5u8) as u32) } - } - #[inline] - pub fn set_yposition(&mut self, val: u32_) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(25usize, 5u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - style: u32_, - color: u32_, - scale: u32_, - yscale: u32_, - pad: u32_, - rotation: u32_, - xspacing: u32_, - yposition: u32_, - ) -> __BindgenBitfieldUnit<[u8; 4usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 5u8, { - let style: u32 = unsafe { ::core::mem::transmute(style) }; - style as u64 - }); - __bindgen_bitfield_unit.set(5usize, 3u8, { - let color: u32 = unsafe { ::core::mem::transmute(color) }; - color as u64 - }); - __bindgen_bitfield_unit.set(8usize, 4u8, { - let scale: u32 = unsafe { ::core::mem::transmute(scale) }; - scale as u64 - }); - __bindgen_bitfield_unit.set(12usize, 3u8, { - let yscale: u32 = unsafe { ::core::mem::transmute(yscale) }; - yscale as u64 - }); - __bindgen_bitfield_unit.set(15usize, 1u8, { - let pad: u32 = unsafe { ::core::mem::transmute(pad) }; - pad as u64 - }); - __bindgen_bitfield_unit.set(16usize, 5u8, { - let rotation: u32 = unsafe { ::core::mem::transmute(rotation) }; - rotation as u64 - }); - __bindgen_bitfield_unit.set(21usize, 4u8, { - let xspacing: u32 = unsafe { ::core::mem::transmute(xspacing) }; - xspacing as u64 - }); - __bindgen_bitfield_unit.set(25usize, 5u8, { - let yposition: u32 = unsafe { ::core::mem::transmute(yposition) }; - yposition as u64 - }); - __bindgen_bitfield_unit - } -} -#[doc = "Nose details"] -#[repr(C)] -#[repr(align(2))] -#[derive(Debug, Default, Copy, Clone)] -pub struct MiiData__bindgen_ty_10 { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>, -} -impl MiiData__bindgen_ty_10 { - #[inline] - pub fn style(&self) -> u16_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 5u8) as u16) } - } - #[inline] - pub fn set_style(&mut self, val: u16_) { - unsafe { - let val: u16 = ::core::mem::transmute(val); - self._bitfield_1.set(0usize, 5u8, val as u64) - } - } - #[inline] - pub fn scale(&self) -> u16_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(5usize, 4u8) as u16) } - } - #[inline] - pub fn set_scale(&mut self, val: u16_) { - unsafe { - let val: u16 = ::core::mem::transmute(val); - self._bitfield_1.set(5usize, 4u8, val as u64) - } - } - #[inline] - pub fn yposition(&self) -> u16_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 5u8) as u16) } - } - #[inline] - pub fn set_yposition(&mut self, val: u16_) { - unsafe { - let val: u16 = ::core::mem::transmute(val); - self._bitfield_1.set(9usize, 5u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - style: u16_, - scale: u16_, - yposition: u16_, - ) -> __BindgenBitfieldUnit<[u8; 2usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 5u8, { - let style: u16 = unsafe { ::core::mem::transmute(style) }; - style as u64 - }); - __bindgen_bitfield_unit.set(5usize, 4u8, { - let scale: u16 = unsafe { ::core::mem::transmute(scale) }; - scale as u64 - }); - __bindgen_bitfield_unit.set(9usize, 5u8, { - let yposition: u16 = unsafe { ::core::mem::transmute(yposition) }; - yposition as u64 - }); - __bindgen_bitfield_unit - } -} -#[doc = "Mouth details"] -#[repr(C)] -#[repr(align(2))] -#[derive(Debug, Default, Copy, Clone)] -pub struct MiiData__bindgen_ty_11 { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>, -} -impl MiiData__bindgen_ty_11 { - #[inline] - pub fn style(&self) -> u16_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 6u8) as u16) } - } - #[inline] - pub fn set_style(&mut self, val: u16_) { - unsafe { - let val: u16 = ::core::mem::transmute(val); - self._bitfield_1.set(0usize, 6u8, val as u64) - } - } - #[inline] - pub fn color(&self) -> u16_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(6usize, 3u8) as u16) } - } - #[inline] - pub fn set_color(&mut self, val: u16_) { - unsafe { - let val: u16 = ::core::mem::transmute(val); - self._bitfield_1.set(6usize, 3u8, val as u64) - } - } - #[inline] - pub fn scale(&self) -> u16_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 4u8) as u16) } - } - #[inline] - pub fn set_scale(&mut self, val: u16_) { - unsafe { - let val: u16 = ::core::mem::transmute(val); - self._bitfield_1.set(9usize, 4u8, val as u64) - } - } - #[inline] - pub fn yscale(&self) -> u16_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 3u8) as u16) } - } - #[inline] - pub fn set_yscale(&mut self, val: u16_) { - unsafe { - let val: u16 = ::core::mem::transmute(val); - self._bitfield_1.set(13usize, 3u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - style: u16_, - color: u16_, - scale: u16_, - yscale: u16_, - ) -> __BindgenBitfieldUnit<[u8; 2usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 6u8, { - let style: u16 = unsafe { ::core::mem::transmute(style) }; - style as u64 - }); - __bindgen_bitfield_unit.set(6usize, 3u8, { - let color: u16 = unsafe { ::core::mem::transmute(color) }; - color as u64 - }); - __bindgen_bitfield_unit.set(9usize, 4u8, { - let scale: u16 = unsafe { ::core::mem::transmute(scale) }; - scale as u64 - }); - __bindgen_bitfield_unit.set(13usize, 3u8, { - let yscale: u16 = unsafe { ::core::mem::transmute(yscale) }; - yscale as u64 - }); - __bindgen_bitfield_unit - } -} -#[doc = "Mustache details"] -#[repr(C)] -#[repr(align(2))] -#[derive(Debug, Default, Copy, Clone)] -pub struct MiiData__bindgen_ty_12 { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>, -} -impl MiiData__bindgen_ty_12 { - #[inline] - pub fn mouth_yposition(&self) -> u16_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 5u8) as u16) } - } - #[inline] - pub fn set_mouth_yposition(&mut self, val: u16_) { - unsafe { - let val: u16 = ::core::mem::transmute(val); - self._bitfield_1.set(0usize, 5u8, val as u64) - } - } - #[inline] - pub fn mustach_style(&self) -> u16_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(5usize, 3u8) as u16) } - } - #[inline] - pub fn set_mustach_style(&mut self, val: u16_) { - unsafe { - let val: u16 = ::core::mem::transmute(val); - self._bitfield_1.set(5usize, 3u8, val as u64) - } - } - #[inline] - pub fn pad(&self) -> u16_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 2u8) as u16) } - } - #[inline] - pub fn set_pad(&mut self, val: u16_) { - unsafe { - let val: u16 = ::core::mem::transmute(val); - self._bitfield_1.set(8usize, 2u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - mouth_yposition: u16_, - mustach_style: u16_, - pad: u16_, - ) -> __BindgenBitfieldUnit<[u8; 2usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 5u8, { - let mouth_yposition: u16 = unsafe { ::core::mem::transmute(mouth_yposition) }; - mouth_yposition as u64 - }); - __bindgen_bitfield_unit.set(5usize, 3u8, { - let mustach_style: u16 = unsafe { ::core::mem::transmute(mustach_style) }; - mustach_style as u64 - }); - __bindgen_bitfield_unit.set(8usize, 2u8, { - let pad: u16 = unsafe { ::core::mem::transmute(pad) }; - pad as u64 - }); - __bindgen_bitfield_unit - } -} -#[doc = "Beard details"] -#[repr(C)] -#[repr(align(2))] -#[derive(Debug, Default, Copy, Clone)] -pub struct MiiData__bindgen_ty_13 { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>, -} -impl MiiData__bindgen_ty_13 { - #[inline] - pub fn style(&self) -> u16_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 3u8) as u16) } - } - #[inline] - pub fn set_style(&mut self, val: u16_) { - unsafe { - let val: u16 = ::core::mem::transmute(val); - self._bitfield_1.set(0usize, 3u8, val as u64) - } - } - #[inline] - pub fn color(&self) -> u16_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 3u8) as u16) } - } - #[inline] - pub fn set_color(&mut self, val: u16_) { - unsafe { - let val: u16 = ::core::mem::transmute(val); - self._bitfield_1.set(3usize, 3u8, val as u64) - } - } - #[inline] - pub fn scale(&self) -> u16_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(6usize, 4u8) as u16) } - } - #[inline] - pub fn set_scale(&mut self, val: u16_) { - unsafe { - let val: u16 = ::core::mem::transmute(val); - self._bitfield_1.set(6usize, 4u8, val as u64) - } - } - #[inline] - pub fn ypos(&self) -> u16_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 5u8) as u16) } - } - #[inline] - pub fn set_ypos(&mut self, val: u16_) { - unsafe { - let val: u16 = ::core::mem::transmute(val); - self._bitfield_1.set(10usize, 5u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - style: u16_, - color: u16_, - scale: u16_, - ypos: u16_, - ) -> __BindgenBitfieldUnit<[u8; 2usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 3u8, { - let style: u16 = unsafe { ::core::mem::transmute(style) }; - style as u64 - }); - __bindgen_bitfield_unit.set(3usize, 3u8, { - let color: u16 = unsafe { ::core::mem::transmute(color) }; - color as u64 - }); - __bindgen_bitfield_unit.set(6usize, 4u8, { - let scale: u16 = unsafe { ::core::mem::transmute(scale) }; - scale as u64 - }); - __bindgen_bitfield_unit.set(10usize, 5u8, { - let ypos: u16 = unsafe { ::core::mem::transmute(ypos) }; - ypos as u64 - }); - __bindgen_bitfield_unit - } -} -#[doc = "Glasses details"] -#[repr(C)] -#[repr(align(2))] -#[derive(Debug, Default, Copy, Clone)] -pub struct MiiData__bindgen_ty_14 { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>, -} -impl MiiData__bindgen_ty_14 { - #[inline] - pub fn style(&self) -> u16_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) } - } - #[inline] - pub fn set_style(&mut self, val: u16_) { - unsafe { - let val: u16 = ::core::mem::transmute(val); - self._bitfield_1.set(0usize, 4u8, val as u64) - } - } - #[inline] - pub fn color(&self) -> u16_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 3u8) as u16) } - } - #[inline] - pub fn set_color(&mut self, val: u16_) { - unsafe { - let val: u16 = ::core::mem::transmute(val); - self._bitfield_1.set(4usize, 3u8, val as u64) - } - } - #[inline] - pub fn scale(&self) -> u16_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(7usize, 4u8) as u16) } - } - #[inline] - pub fn set_scale(&mut self, val: u16_) { - unsafe { - let val: u16 = ::core::mem::transmute(val); - self._bitfield_1.set(7usize, 4u8, val as u64) - } - } - #[inline] - pub fn ypos(&self) -> u16_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 5u8) as u16) } - } - #[inline] - pub fn set_ypos(&mut self, val: u16_) { - unsafe { - let val: u16 = ::core::mem::transmute(val); - self._bitfield_1.set(11usize, 5u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - style: u16_, - color: u16_, - scale: u16_, - ypos: u16_, - ) -> __BindgenBitfieldUnit<[u8; 2usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 4u8, { - let style: u16 = unsafe { ::core::mem::transmute(style) }; - style as u64 - }); - __bindgen_bitfield_unit.set(4usize, 3u8, { - let color: u16 = unsafe { ::core::mem::transmute(color) }; - color as u64 - }); - __bindgen_bitfield_unit.set(7usize, 4u8, { - let scale: u16 = unsafe { ::core::mem::transmute(scale) }; - scale as u64 - }); - __bindgen_bitfield_unit.set(11usize, 5u8, { - let ypos: u16 = unsafe { ::core::mem::transmute(ypos) }; - ypos as u64 - }); - __bindgen_bitfield_unit - } -} -#[doc = "Mole details"] -#[repr(C)] -#[repr(align(2))] -#[derive(Debug, Default, Copy, Clone)] -pub struct MiiData__bindgen_ty_15 { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>, -} -impl MiiData__bindgen_ty_15 { - #[inline] - pub fn enable(&self) -> bool { - unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) } - } - #[inline] - pub fn set_enable(&mut self, val: bool) { - unsafe { - let val: u8 = ::core::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn scale(&self) -> u16_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 5u8) as u16) } - } - #[inline] - pub fn set_scale(&mut self, val: u16_) { - unsafe { - let val: u16 = ::core::mem::transmute(val); - self._bitfield_1.set(1usize, 5u8, val as u64) - } - } - #[inline] - pub fn xpos(&self) -> u16_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(6usize, 5u8) as u16) } - } - #[inline] - pub fn set_xpos(&mut self, val: u16_) { - unsafe { - let val: u16 = ::core::mem::transmute(val); - self._bitfield_1.set(6usize, 5u8, val as u64) - } - } - #[inline] - pub fn ypos(&self) -> u16_ { - unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 5u8) as u16) } - } - #[inline] - pub fn set_ypos(&mut self, val: u16_) { - unsafe { - let val: u16 = ::core::mem::transmute(val); - self._bitfield_1.set(11usize, 5u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - enable: bool, - scale: u16_, - xpos: u16_, - ypos: u16_, - ) -> __BindgenBitfieldUnit<[u8; 2usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let enable: u8 = unsafe { ::core::mem::transmute(enable) }; - enable as u64 - }); - __bindgen_bitfield_unit.set(1usize, 5u8, { - let scale: u16 = unsafe { ::core::mem::transmute(scale) }; - scale as u64 - }); - __bindgen_bitfield_unit.set(6usize, 5u8, { - let xpos: u16 = unsafe { ::core::mem::transmute(xpos) }; - xpos as u64 - }); - __bindgen_bitfield_unit.set(11usize, 5u8, { - let ypos: u16 = unsafe { ::core::mem::transmute(ypos) }; - ypos as u64 - }); - __bindgen_bitfield_unit - } -} -impl Default for MiiData { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "Friend key data"] -#[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone)] -pub struct FriendKey { - pub principalId: u32_, - pub padding: u32_, - pub localFriendCode: u64_, -} -#[doc = "Friend Title data"] -#[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone)] -pub struct TitleData { - pub tid: u64_, - pub version: u32_, - pub unk: u32_, -} -#[doc = "Friend profile data"] -#[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone)] -pub struct FriendProfile { - #[doc = "< The region code for the hardware."] - pub region: u8_, - #[doc = "< Country code."] - pub country: u8_, - #[doc = "< Area code."] - pub area: u8_, - #[doc = "< Language code."] - pub language: u8_, - #[doc = "< Platform code."] - pub platform: u8_, - pub padding: u32_, -} -#[doc = "Game Description structure"] -#[repr(C, packed)] -#[derive(Debug, Copy, Clone)] -pub struct GameDescription { - pub data: TitleData, - pub desc: [u16_; 128usize], -} -impl Default for GameDescription { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "Friend Notification Event structure"] -#[repr(C, packed)] -#[derive(Debug, Default, Copy, Clone)] -pub struct NotificationEvent { - pub type_: u8_, - pub padding3: [u8_; 3usize], - pub padding: u32_, - pub key: FriendKey, -} -#[doc = "< Self went online"] -pub const USER_WENT_ONLINE: NotificationTypes = 1; -#[doc = "< Self went offline"] -pub const USER_WENT_OFFLINE: NotificationTypes = 2; -#[doc = "< Friend Went Online"] -pub const FRIEND_WENT_ONLINE: NotificationTypes = 3; -#[doc = "< Friend Presence changed"] -pub const FRIEND_UPDATED_PRESENCE: NotificationTypes = 4; -#[doc = "< Friend Mii changed"] -pub const FRIEND_UPDATED_MII: NotificationTypes = 5; -#[doc = "< Friend Profile changed"] -pub const FRIEND_UPDATED_PROFILE: NotificationTypes = 6; -#[doc = "< Friend went offline"] -pub const FRIEND_WENT_OFFLINE: NotificationTypes = 7; -#[doc = "< Friend registered self as friend"] -pub const FRIEND_REGISTERED_USER: NotificationTypes = 8; -#[doc = "< Friend Sent invitation"] -pub const FRIEND_SENT_INVITATION: NotificationTypes = 9; -#[doc = "Enum to use with FRD_GetNotificationEvent"] -pub type NotificationTypes = ::libc::c_uint; -extern "C" { - #[must_use] - #[doc = "Initializes FRD service."] - pub fn frdInit() -> Result; -} -extern "C" { - #[doc = "Exists FRD."] - pub fn frdExit(); -} -extern "C" { - #[doc = "Get FRD handle."] - pub fn frdGetSessionHandle() -> *mut Handle; -} -extern "C" { - #[must_use] - #[doc = "Gets the login status of the current user.\n # Arguments\n\n* `state` - Pointer to write the current user's login status to."] - pub fn FRDU_HasLoggedIn(state: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the online status of the current user.\n # Arguments\n\n* `state` - Pointer to write the current user's online status to."] - pub fn FRDU_IsOnline(state: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Logs out of Nintendo's friend server."] - pub fn FRD_Logout() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Log in to Nintendo's friend server.\n # Arguments\n\n* `event` - Event to signal when Login is done."] - pub fn FRD_Login(event: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the current user's friend key.\n # Arguments\n\n* `key` - Pointer to write the current user's friend key to."] - pub fn FRD_GetMyFriendKey(key: *mut FriendKey) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the current user's privacy information.\n # Arguments\n\n* `isPublicMode` - Determines whether friends are notified of the current user's online status.\n * `isShowGameName` - Determines whether friends are notified of the application that the current user is running.\n * `isShowPlayedGame` - Determiens whether to display the current user's game history."] - pub fn FRD_GetMyPreference( - isPublicMode: *mut bool, - isShowGameName: *mut bool, - isShowPlayedGame: *mut bool, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the current user's profile information.\n # Arguments\n\n* `profile` - Pointer to write the current user's profile information to."] - pub fn FRD_GetMyProfile(profile: *mut FriendProfile) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the current user's screen name.\n # Arguments\n\n* `name` - Pointer to write the current user's screen name to.\n * `max_size` - Max size of the screen name."] - pub fn FRD_GetMyScreenName(name: *mut ::libc::c_char, max_size: usize) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the current user's Mii data.\n # Arguments\n\n* `mii` - Pointer to write the current user's mii data to."] - pub fn FRD_GetMyMii(mii: *mut MiiData) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the current user's playing game.\n # Arguments\n\n* `titleId` - Pointer to write the current user's playing game to."] - pub fn FRD_GetMyPlayingGame(titleId: *mut u64_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the current user's favourite game.\n # Arguments\n\n* `titleId` - Pointer to write the title ID of current user's favourite game to."] - pub fn FRD_GetMyFavoriteGame(titleId: *mut u64_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the current user's comment on their friend profile.\n # Arguments\n\n* `comment` - Pointer to write the current user's comment to.\n * `max_size` - Max size of the comment."] - pub fn FRD_GetMyComment(comment: *mut ::libc::c_char, max_size: usize) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the current user's friend key list.\n # Arguments\n\n* `friendKeyList` - Pointer to write the friend key list to.\n * `num` - Stores the number of friend keys obtained.\n * `offset` - The index of the friend key to start with.\n * `size` - Size of the friend key list. (FRIEND_LIST_SIZE)"] - pub fn FRD_GetFriendKeyList( - friendKeyList: *mut FriendKey, - num: *mut u32_, - offset: u32_, - size: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the current user's friends' Mii data.\n # Arguments\n\n* `miiDataList` - Pointer to write Mii data to.\n * `friendKeyList` - Pointer to FriendKeys.\n * `size` - Number of Friendkeys."] - pub fn FRD_GetFriendMii( - miiDataList: *mut MiiData, - friendKeyList: *const FriendKey, - size: usize, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Get the current user's friends' profile data.\n # Arguments\n\n* `profile` - Pointer to write profile data to.\n * `friendKeyList` - Pointer to FriendKeys.\n * `size` - Number of FriendKeys."] - pub fn FRD_GetFriendProfile( - profile: *mut FriendProfile, - friendKeyList: *const FriendKey, - size: usize, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Get the current user's friends' playing game.\n # Arguments\n\n* `desc` - Pointer to write Game Description data to.\n * `friendKeyList` - Pointer to FriendKeys,\n * `size` - Number Of FriendKeys."] - pub fn FRD_GetFriendPlayingGame( - desc: *mut GameDescription, - friendKeyList: *const FriendKey, - size: usize, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Get the current user's friends' favourite game.\n # Arguments\n\n* `desc` - Pointer to write Game Description data to.\n * `friendKeyList` - Pointer to FriendKeys,\n * `count` - Number Of FriendKeys."] - pub fn FRD_GetFriendFavouriteGame( - desc: *mut GameDescription, - friendKeyList: *const FriendKey, - count: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets whether a friend key is included in the current user's friend list.\n # Arguments\n\n* `friendKeyList` - Pointer to a list of friend keys.\n * `isFromList` - Pointer to a write the friendship status to."] - pub fn FRD_IsInFriendList(friendKeyList: *mut FriendKey, isFromList: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Updates the game mode description string.\n # Arguments\n\n* `desc` - Pointer to write the game mode description to."] - pub fn FRD_UpdateGameModeDescription(desc: *const ::libc::c_char) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Event which is signaled when friend login states change.\n # Arguments\n\n* `event` - event which will be signaled."] - pub fn FRD_AttachToEventNotification(event: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Get Latest Event Notification\n # Arguments\n\n* `event` - Pointer to write recieved notification event struct to.\n * `count` - Number of events\n * `recievedNotifCount` - Number of notification reccieved."] - pub fn FRD_GetEventNotification( - event: *mut NotificationEvent, - count: u32_, - recievedNotifCount: *mut u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Returns the friend code using the given principal ID.\n # Arguments\n\n* `principalId` - The principal ID being used.\n * `friendCode` - Pointer to write the friend code to."] - pub fn FRD_PrincipalIdToFriendCode(principalId: u32_, friendCode: *mut u64_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Returns the principal ID using the given friend code.\n # Arguments\n\n* `friendCode` - The friend code being used.\n * `principalId` - Pointer to write the principal ID to."] - pub fn FRD_FriendCodeToPrincipalId(friendCode: u64_, principalId: *mut u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Checks if the friend code is valid.\n # Arguments\n\n* `friendCode` - The friend code being used.\n * `isValid` - Pointer to write the validity of the friend code to."] - pub fn FRD_IsValidFriendCode(friendCode: u64_, isValid: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the Friend API to use a specific SDK version.\n # Arguments\n\n* `sdkVer` - The SDK version needed to be used."] - pub fn FRD_SetClientSdkVersion(sdkVer: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Add a Friend online.\n # Arguments\n\n* `event` - Event signaled when friend is registered.\n * `principalId` - PrincipalId of the friend to add."] - pub fn FRD_AddFriendOnline(event: Handle, principalId: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Remove a Friend.\n # Arguments\n\n* `principalId` - PrinipalId of the friend code to remove.\n * `localFriendCode` - LocalFriendCode of the friend code to remove."] - pub fn FRD_RemoveFriend(principalId: u32_, localFriendCode: u64_) -> Result; -} -#[doc = "< Top screen."] -pub const GSPLCD_SCREEN_TOP: _bindgen_ty_21 = 1; -#[doc = "< Bottom screen."] -pub const GSPLCD_SCREEN_BOTTOM: _bindgen_ty_21 = 2; -#[doc = "< Both screens."] -pub const GSPLCD_SCREEN_BOTH: _bindgen_ty_21 = 3; -#[doc = "LCD screens."] -pub type _bindgen_ty_21 = ::libc::c_uint; -extern "C" { - #[must_use] - #[doc = "Initializes GSPLCD."] - pub fn gspLcdInit() -> Result; -} -extern "C" { - #[doc = "Exits GSPLCD."] - pub fn gspLcdExit(); -} -extern "C" { - #[doc = "Gets a pointer to the current gsp::Lcd session handle.\n # Returns\n\nA pointer to the current gsp::Lcd session handle."] - pub fn gspLcdGetSessionHandle() -> *mut Handle; -} -extern "C" { - #[must_use] - #[doc = "Powers on both backlights."] - pub fn GSPLCD_PowerOnAllBacklights() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Powers off both backlights."] - pub fn GSPLCD_PowerOffAllBacklights() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Powers on the backlight.\n # Arguments\n\n* `screen` - Screen to power on."] - pub fn GSPLCD_PowerOnBacklight(screen: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Powers off the backlight.\n # Arguments\n\n* `screen` - Screen to power off."] - pub fn GSPLCD_PowerOffBacklight(screen: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets 3D_LEDSTATE to the input state value.\n # Arguments\n\n* `disable` - False = 3D LED enable, true = 3D LED disable."] - pub fn GSPLCD_SetLedForceOff(disable: bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the LCD screens' vendors. Stubbed on old 3ds.\n # Arguments\n\n* `vendor` - Pointer to output the screen vendors to."] - pub fn GSPLCD_GetVendors(vendors: *mut u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the LCD screens' brightness. Stubbed on old 3ds.\n # Arguments\n\n* `screen` - Screen to get the brightness value of.\n * `brightness` - Brightness value returned."] - pub fn GSPLCD_GetBrightness(screen: u32_, brightness: *mut u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the LCD screens' brightness.\n # Arguments\n\n* `screen` - Screen to set the brightness value of.\n * `brightness` - Brightness value set."] - pub fn GSPLCD_SetBrightness(screen: u32_, brightness: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the LCD screens' raw brightness.\n # Arguments\n\n* `screen` - Screen to set the brightness value of.\n * `brightness` - Brightness value set."] - pub fn GSPLCD_SetBrightnessRaw(screen: u32_, brightness: u32_) -> Result; -} -#[doc = "< A"] -pub const KEY_A: _bindgen_ty_22 = 1; -#[doc = "< B"] -pub const KEY_B: _bindgen_ty_22 = 2; -#[doc = "< Select"] -pub const KEY_SELECT: _bindgen_ty_22 = 4; -#[doc = "< Start"] -pub const KEY_START: _bindgen_ty_22 = 8; -#[doc = "< D-Pad Right"] -pub const KEY_DRIGHT: _bindgen_ty_22 = 16; -#[doc = "< D-Pad Left"] -pub const KEY_DLEFT: _bindgen_ty_22 = 32; -#[doc = "< D-Pad Up"] -pub const KEY_DUP: _bindgen_ty_22 = 64; -#[doc = "< D-Pad Down"] -pub const KEY_DDOWN: _bindgen_ty_22 = 128; -#[doc = "< R"] -pub const KEY_R: _bindgen_ty_22 = 256; -#[doc = "< L"] -pub const KEY_L: _bindgen_ty_22 = 512; -#[doc = "< X"] -pub const KEY_X: _bindgen_ty_22 = 1024; -#[doc = "< Y"] -pub const KEY_Y: _bindgen_ty_22 = 2048; -#[doc = "< ZL (New 3DS only)"] -pub const KEY_ZL: _bindgen_ty_22 = 16384; -#[doc = "< ZR (New 3DS only)"] -pub const KEY_ZR: _bindgen_ty_22 = 32768; -#[doc = "< Touch (Not actually provided by HID)"] -pub const KEY_TOUCH: _bindgen_ty_22 = 1048576; -#[doc = "< C-Stick Right (New 3DS only)"] -pub const KEY_CSTICK_RIGHT: _bindgen_ty_22 = 16777216; -#[doc = "< C-Stick Left (New 3DS only)"] -pub const KEY_CSTICK_LEFT: _bindgen_ty_22 = 33554432; -#[doc = "< C-Stick Up (New 3DS only)"] -pub const KEY_CSTICK_UP: _bindgen_ty_22 = 67108864; -#[doc = "< C-Stick Down (New 3DS only)"] -pub const KEY_CSTICK_DOWN: _bindgen_ty_22 = 134217728; -#[doc = "< Circle Pad Right"] -pub const KEY_CPAD_RIGHT: _bindgen_ty_22 = 268435456; -#[doc = "< Circle Pad Left"] -pub const KEY_CPAD_LEFT: _bindgen_ty_22 = 536870912; -#[doc = "< Circle Pad Up"] -pub const KEY_CPAD_UP: _bindgen_ty_22 = 1073741824; -#[doc = "< Circle Pad Down"] -pub const KEY_CPAD_DOWN: _bindgen_ty_22 = 2147483648; -#[doc = "< D-Pad Up or Circle Pad Up"] -pub const KEY_UP: _bindgen_ty_22 = 1073741888; -#[doc = "< D-Pad Down or Circle Pad Down"] -pub const KEY_DOWN: _bindgen_ty_22 = 2147483776; -#[doc = "< D-Pad Left or Circle Pad Left"] -pub const KEY_LEFT: _bindgen_ty_22 = 536870944; -#[doc = "< D-Pad Right or Circle Pad Right"] -pub const KEY_RIGHT: _bindgen_ty_22 = 268435472; -#[doc = "Key values."] -pub type _bindgen_ty_22 = ::libc::c_uint; -#[doc = "Touch position."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct touchPosition { - #[doc = "< Touch X"] - pub px: u16_, - #[doc = "< Touch Y"] - pub py: u16_, -} -#[doc = "Circle Pad position."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct circlePosition { - #[doc = "< Pad X"] - pub dx: s16, - #[doc = "< Pad Y"] - pub dy: s16, -} -#[doc = "Accelerometer vector."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct accelVector { - #[doc = "< Accelerometer X"] - pub x: s16, - #[doc = "< Accelerometer Y"] - pub y: s16, - #[doc = "< Accelerometer Z"] - pub z: s16, -} -#[doc = "Gyroscope angular rate."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct angularRate { - #[doc = "< Roll"] - pub x: s16, - #[doc = "< Yaw"] - pub z: s16, - #[doc = "< Pitch"] - pub y: s16, -} -#[doc = "< Event signaled by HID-module, when the sharedmem+0(PAD/circle-pad)/+0xA8(touch-screen) region was updated."] -pub const HIDEVENT_PAD0: HID_Event = 0; -#[doc = "< Event signaled by HID-module, when the sharedmem+0(PAD/circle-pad)/+0xA8(touch-screen) region was updated."] -pub const HIDEVENT_PAD1: HID_Event = 1; -#[doc = "< Event signaled by HID-module, when the sharedmem accelerometer state was updated."] -pub const HIDEVENT_Accel: HID_Event = 2; -#[doc = "< Event signaled by HID-module, when the sharedmem gyroscope state was updated."] -pub const HIDEVENT_Gyro: HID_Event = 3; -#[doc = "< Event signaled by HID-module, when the sharedmem DebugPad state was updated."] -pub const HIDEVENT_DebugPad: HID_Event = 4; -#[doc = "< Used to know how many events there are."] -pub const HIDEVENT_MAX: HID_Event = 5; -#[doc = "HID events."] -pub type HID_Event = ::libc::c_uint; -extern "C" { - #[doc = "< HID shared memory handle."] - pub static mut hidMemHandle: Handle; -} -extern "C" { - #[doc = "< HID shared memory."] - pub static mut hidSharedMem: *mut vu32; -} -extern "C" { - #[must_use] - #[doc = "Initializes HID."] - pub fn hidInit() -> Result; -} -extern "C" { - #[doc = "Exits HID."] - pub fn hidExit(); -} -extern "C" { - #[doc = "Sets the key repeat parameters for hidKeysRepeat.\n # Arguments\n\n* `delay` - Initial delay.\n * `interval` - Repeat interval."] - pub fn hidSetRepeatParameters(delay: u32_, interval: u32_); -} -extern "C" { - #[doc = "Scans HID for input data."] - pub fn hidScanInput(); -} -extern "C" { - #[doc = "Returns a bitmask of held buttons.\n Individual buttons can be extracted using binary AND.\n # Returns\n\n32-bit bitmask of held buttons (1+ frames)."] - pub fn hidKeysHeld() -> u32_; -} -extern "C" { - #[doc = "Returns a bitmask of newly pressed buttons, this frame.\n Individual buttons can be extracted using binary AND.\n # Returns\n\n32-bit bitmask of newly pressed buttons."] - pub fn hidKeysDown() -> u32_; -} -extern "C" { - #[doc = "Returns a bitmask of newly pressed or repeated buttons, this frame.\n Individual buttons can be extracted using binary AND.\n # Returns\n\n32-bit bitmask of newly pressed or repeated buttons."] - pub fn hidKeysDownRepeat() -> u32_; -} -extern "C" { - #[doc = "Returns a bitmask of newly released buttons, this frame.\n Individual buttons can be extracted using binary AND.\n # Returns\n\n32-bit bitmask of newly released buttons."] - pub fn hidKeysUp() -> u32_; -} -extern "C" { - #[doc = "Reads the current touch position.\n # Arguments\n\n* `pos` - Pointer to output the touch position to."] - pub fn hidTouchRead(pos: *mut touchPosition); -} -extern "C" { - #[doc = "Reads the current circle pad position.\n # Arguments\n\n* `pos` - Pointer to output the circle pad position to."] - pub fn hidCircleRead(pos: *mut circlePosition); -} -extern "C" { - #[doc = "Reads the current accelerometer data.\n # Arguments\n\n* `vector` - Pointer to output the accelerometer data to."] - pub fn hidAccelRead(vector: *mut accelVector); -} -extern "C" { - #[doc = "Reads the current gyroscope data.\n # Arguments\n\n* `rate` - Pointer to output the gyroscope data to."] - pub fn hidGyroRead(rate: *mut angularRate); -} -extern "C" { - #[doc = "Waits for an HID event.\n # Arguments\n\n* `id` - ID of the event.\n * `nextEvent` - Whether to discard the current event and wait for the next event."] - pub fn hidWaitForEvent(id: HID_Event, nextEvent: bool); -} -extern "C" { - #[must_use] - #[doc = "Waits for any HID or IRRST event.\n # Arguments\n\n* `nextEvents` - Whether to discard the current events and wait for the next events.\n * `cancelEvent` - Optional additional handle to wait on, otherwise 0.\n * `timeout` - Timeout."] - pub fn hidWaitForAnyEvent(nextEvents: bool, cancelEvent: Handle, timeout: s64) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the handles for HID operation.\n # Arguments\n\n* `outMemHandle` - Pointer to output the shared memory handle to.\n * `eventpad0` - Pointer to output the pad 0 event handle to.\n * `eventpad1` - Pointer to output the pad 1 event handle to.\n * `eventaccel` - Pointer to output the accelerometer event handle to.\n * `eventgyro` - Pointer to output the gyroscope event handle to.\n * `eventdebugpad` - Pointer to output the debug pad event handle to."] - 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" { - #[must_use] - #[doc = "Enables the accelerometer."] - pub fn HIDUSER_EnableAccelerometer() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Disables the accelerometer."] - pub fn HIDUSER_DisableAccelerometer() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Enables the gyroscope."] - pub fn HIDUSER_EnableGyroscope() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Disables the gyroscope."] - pub fn HIDUSER_DisableGyroscope() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the gyroscope raw to dps coefficient.\n # Arguments\n\n* `coeff` - Pointer to output the coefficient to."] - pub fn HIDUSER_GetGyroscopeRawToDpsCoefficient(coeff: *mut f32) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the current volume slider value. (0-63)\n # Arguments\n\n* `volume` - Pointer to write the volume slider value to."] - pub fn HIDUSER_GetSoundVolume(volume: *mut u8_) -> Result; -} -extern "C" { - #[doc = "IRRST's shared memory handle."] - pub static mut irrstMemHandle: Handle; -} -extern "C" { - #[doc = "IRRST's shared memory."] - pub static mut irrstSharedMem: *mut vu32; -} -extern "C" { - #[doc = "IRRST's state update event"] - pub static mut irrstEvent: Handle; -} -extern "C" { - #[must_use] - #[doc = "Initializes IRRST."] - pub fn irrstInit() -> Result; -} -extern "C" { - #[doc = "Exits IRRST."] - pub fn irrstExit(); -} -extern "C" { - #[doc = "Scans IRRST for input."] - pub fn irrstScanInput(); -} -extern "C" { - #[doc = "Gets IRRST's held keys.\n # Returns\n\nIRRST's held keys."] - pub fn irrstKeysHeld() -> u32_; -} -extern "C" { - #[doc = "Reads the current c-stick position.\n # Arguments\n\n* `pos` - Pointer to output the current c-stick position to."] - pub fn irrstCstickRead(pos: *mut circlePosition); -} -extern "C" { - #[doc = "Waits for the IRRST input event to trigger.\n # Arguments\n\n* `nextEvent` - Whether to discard the current event and wait until the next event."] - pub fn irrstWaitForEvent(nextEvent: bool); -} -extern "C" { - #[must_use] - #[doc = "Gets the shared memory and event handles for IRRST.\n # Arguments\n\n* `outMemHandle` - Pointer to write the shared memory handle to.\n * `outEventHandle` - Pointer to write the event handle to."] - pub fn IRRST_GetHandles(outMemHandle: *mut Handle, outEventHandle: *mut Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initializes IRRST.\n # Arguments\n\n* `unk1` - Unknown.\n * `unk2` - Unknown."] - pub fn IRRST_Initialize(unk1: u32_, unk2: u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Shuts down IRRST."] - pub fn IRRST_Shutdown() -> Result; -} -#[doc = "sslc context."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct sslcContext { - #[doc = "< Service handle."] - pub servhandle: Handle, - #[doc = "< SSLC 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 = ::libc::c_uint; -pub const SSLC_DefaultClientCert_ClCertA: SSLC_DefaultClientCert = 64; -pub type SSLC_DefaultClientCert = ::libc::c_uint; -pub const SSLCOPT_Default: _bindgen_ty_23 = 0; -pub const SSLCOPT_DisableVerify: _bindgen_ty_23 = 512; -pub const SSLCOPT_TLSv10: _bindgen_ty_23 = 2048; -#[doc = "sslc options. https://www.3dbrew.org/wiki/SSL_Services#SSLOpt"] -pub type _bindgen_ty_23 = ::libc::c_uint; -extern "C" { - #[must_use] - #[doc = "Initializes SSLC. Normally session_handle should be 0. When non-zero this will use the specified handle for the main-service-session without using the Initialize command, instead of using srvGetServiceHandle."] - pub fn sslcInit(session_handle: Handle) -> Result; -} -extern "C" { - #[doc = "Exits SSLC."] - pub fn sslcExit(); -} -extern "C" { - #[must_use] - #[doc = "Creates a RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - Output contexthandle."] - pub fn sslcCreateRootCertChain(RootCertChain_contexthandle: *mut u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Destroys a RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - RootCertChain contexthandle."] - pub fn sslcDestroyRootCertChain(RootCertChain_contexthandle: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Adds a trusted RootCA cert to a RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - RootCertChain to use.\n * `cert` - Pointer to the DER cert.\n * `certsize` - Size of the DER cert."] - pub fn sslcAddTrustedRootCA( - RootCertChain_contexthandle: u32_, - cert: *const u8_, - certsize: u32_, - cert_contexthandle: *mut u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Adds a default RootCA cert to a RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - RootCertChain to use.\n * `certID` - ID of the cert to add.\n * `cert_contexthandle` - Optional, the cert contexthandle can be written here."] - pub fn sslcRootCertChainAddDefaultCert( - RootCertChain_contexthandle: u32_, - certID: SSLC_DefaultRootCert, - cert_contexthandle: *mut u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Removes the specified cert from the RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - RootCertChain to use.\n * `cert_contexthandle` - Cert contexthandle to remove from the RootCertChain."] - pub fn sslcRootCertChainRemoveCert( - RootCertChain_contexthandle: u32_, - cert_contexthandle: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Creates an unknown CertChain.\n # Arguments\n\n* `CertChain_contexthandle` - Output contexthandle."] - pub fn sslcCreate8CertChain(CertChain_contexthandle: *mut u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Destroys a CertChain from sslcCreate8CertChain().\n # Arguments\n\n* `CertChain_contexthandle` - CertChain contexthandle."] - pub fn sslcDestroy8CertChain(CertChain_contexthandle: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Adds a cert to a CertChain from sslcCreate8CertChain().\n # Arguments\n\n* `CertChain_contexthandle` - CertChain to use.\n * `cert` - Pointer to the cert.\n * `certsize` - Size of the cert."] - pub fn sslc8CertChainAddCert( - CertChain_contexthandle: u32_, - cert: *const u8_, - certsize: u32_, - cert_contexthandle: *mut u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Adds a default cert to a CertChain from sslcCreate8CertChain(). Not actually usable since no certIDs are implemented in SSL-module for this.\n # Arguments\n\n* `CertChain_contexthandle` - CertChain to use.\n * `certID` - ID of the cert to add.\n * `cert_contexthandle` - Optional, the cert contexthandle can be written here."] - pub fn sslc8CertChainAddDefaultCert( - CertChain_contexthandle: u32_, - certID: u8_, - cert_contexthandle: *mut u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Removes the specified cert from the CertChain from sslcCreate8CertChain().\n # Arguments\n\n* `CertChain_contexthandle` - CertChain to use.\n * `cert_contexthandle` - Cert contexthandle to remove from the CertChain."] - pub fn sslc8CertChainRemoveCert( - CertChain_contexthandle: u32_, - cert_contexthandle: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Opens a new ClientCert-context.\n # Arguments\n\n* `cert` - Pointer to the DER cert.\n * `certsize` - Size of the DER cert.\n * `key` - Pointer to the DER key.\n * `keysize` - Size of the DER key.\n * `ClientCert_contexthandle` - Output contexthandle."] - pub fn sslcOpenClientCertContext( - cert: *const u8_, - certsize: u32_, - key: *const u8_, - keysize: u32_, - ClientCert_contexthandle: *mut u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Opens a ClientCert-context with a default certID.\n # Arguments\n\n* `certID` - ID of the ClientCert to use.\n * `ClientCert_contexthandle` - Output contexthandle."] - pub fn sslcOpenDefaultClientCertContext( - certID: SSLC_DefaultClientCert, - ClientCert_contexthandle: *mut u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Closes the specified ClientCert-context.\n # Arguments\n\n* `ClientCert_contexthandle` - ClientCert-context to use."] - pub fn sslcCloseClientCertContext(ClientCert_contexthandle: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "This uses ps:ps SeedRNG internally."] - pub fn sslcSeedRNG() -> Result; -} -extern "C" { - #[must_use] - #[doc = "This uses ps:ps GenerateRandomData internally.\n # Arguments\n\n* `buf` - Output buffer.\n * `size` - Output size."] - pub fn sslcGenerateRandomData(buf: *mut u8_, size: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Creates a sslc context.\n # Arguments\n\n* `context` - sslc context.\n * `sockfd` - Socket fd, this code automatically uses the required SOC command before using the actual sslc command.\n * `input_opt` - Input sslc options bitmask.\n * `hostname` - Server hostname."] - pub fn sslcCreateContext( - context: *mut sslcContext, - sockfd: ::libc::c_int, - input_opt: u32_, - hostname: *const ::libc::c_char, - ) -> Result; -} -extern "C" { - #[must_use] - pub fn sslcDestroyContext(context: *mut sslcContext) -> Result; -} -extern "C" { - #[must_use] - pub fn sslcStartConnection( - context: *mut sslcContext, - internal_retval: *mut ::libc::c_int, - out: *mut u32_, - ) -> Result; -} -extern "C" { - #[must_use] - pub fn sslcRead( - context: *mut sslcContext, - buf: *mut ::libc::c_void, - len: usize, - peek: bool, - ) -> Result; -} -extern "C" { - #[must_use] - pub fn sslcWrite(context: *mut sslcContext, buf: *const ::libc::c_void, len: usize) -> Result; -} -extern "C" { - #[must_use] - pub fn sslcContextSetRootCertChain(context: *mut sslcContext, handle: u32_) -> Result; -} -extern "C" { - #[must_use] - pub fn sslcContextSetClientCert(context: *mut sslcContext, handle: u32_) -> Result; -} -extern "C" { - #[must_use] - pub fn sslcContextSetHandle8(context: *mut sslcContext, handle: u32_) -> Result; -} -extern "C" { - #[must_use] - pub fn sslcContextClearOpt(context: *mut sslcContext, bitmask: u32_) -> Result; -} -extern "C" { - #[must_use] - 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" { - #[must_use] - pub fn sslcContextGetState(context: *mut sslcContext, out: *mut u32_) -> Result; -} -extern "C" { - #[must_use] - pub fn sslcContextInitSharedmem(context: *mut sslcContext, buf: *mut u8_, size: u32_) - -> Result; -} -extern "C" { - #[must_use] - pub fn sslcAddCert(context: *mut sslcContext, buf: *const u8_, size: u32_) -> Result; -} -#[doc = "HTTP context."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct httpcContext { - #[doc = "< Service handle."] - pub servhandle: Handle, - #[doc = "< HTTP 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; -#[doc = "HTTP request method."] -pub type HTTPC_RequestMethod = ::libc::c_uint; -#[doc = "< Request in progress."] -pub const HTTPC_STATUS_REQUEST_IN_PROGRESS: HTTPC_RequestStatus = 5; -#[doc = "< Download ready."] -pub const HTTPC_STATUS_DOWNLOAD_READY: HTTPC_RequestStatus = 7; -#[doc = "HTTP request status."] -pub type HTTPC_RequestStatus = ::libc::c_uint; -pub const HTTPC_KEEPALIVE_DISABLED: HTTPC_KeepAlive = 0; -pub const HTTPC_KEEPALIVE_ENABLED: HTTPC_KeepAlive = 1; -#[doc = "HTTP KeepAlive option."] -pub type HTTPC_KeepAlive = ::libc::c_uint; -extern "C" { - #[must_use] - #[doc = "Initializes HTTPC. For HTTP GET the sharedmem_size can be zero. The sharedmem contains data which will be later uploaded for HTTP POST. sharedmem_size should be aligned to 0x1000-bytes."] - pub fn httpcInit(sharedmem_size: u32_) -> Result; -} -extern "C" { - #[doc = "Exits HTTPC."] - pub fn httpcExit(); -} -extern "C" { - #[must_use] - #[doc = "Opens a HTTP context.\n # Arguments\n\n* `context` - Context to open.\n * `url` - URL to connect to.\n * `use_defaultproxy` - Whether the default proxy should be used (0 for default)"] - pub fn httpcOpenContext( - context: *mut httpcContext, - method: HTTPC_RequestMethod, - url: *const ::libc::c_char, - use_defaultproxy: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Closes a HTTP context.\n # Arguments\n\n* `context` - Context to close."] - pub fn httpcCloseContext(context: *mut httpcContext) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Cancels a HTTP connection.\n # Arguments\n\n* `context` - Context to close."] - pub fn httpcCancelConnection(context: *mut httpcContext) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Adds a request header field to a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `name` - Name of the field.\n * `value` - Value of the field."] - pub fn httpcAddRequestHeaderField( - context: *mut httpcContext, - name: *const ::libc::c_char, - value: *const ::libc::c_char, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Adds a POST form field to a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `name` - Name of the field.\n * `value` - Value of the field."] - pub fn httpcAddPostDataAscii( - context: *mut httpcContext, - name: *const ::libc::c_char, - value: *const ::libc::c_char, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Adds a POST form field with binary data to a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `name` - Name of the field.\n * `value` - The binary data to pass as a value.\n * `len` - Length of the binary data which has been passed."] - pub fn httpcAddPostDataBinary( - context: *mut httpcContext, - name: *const ::libc::c_char, - value: *const u8_, - len: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Adds a POST body to a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `data` - The data to be passed as raw into the body of the post request.\n * `len` - Length of data passed by data param."] - pub fn httpcAddPostDataRaw(context: *mut httpcContext, data: *const u32_, len: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Begins a HTTP request.\n # Arguments\n\n* `context` - Context to use."] - pub fn httpcBeginRequest(context: *mut httpcContext) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Receives data from a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `buffer` - Buffer to receive data to.\n * `size` - Size of the buffer."] - pub fn httpcReceiveData(context: *mut httpcContext, buffer: *mut u8_, size: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Receives data from a HTTP context with a timeout value.\n # Arguments\n\n* `context` - Context to use.\n * `buffer` - Buffer to receive data to.\n * `size` - Size of the buffer.\n * `timeout` - Maximum time in nanoseconds to wait for a reply."] - pub fn httpcReceiveDataTimeout( - context: *mut httpcContext, - buffer: *mut u8_, - size: u32_, - timeout: u64_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the request state of a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `out` - Pointer to output the HTTP request state to."] - pub fn httpcGetRequestState( - context: *mut httpcContext, - out: *mut HTTPC_RequestStatus, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the download size state of a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `downloadedsize` - Pointer to output the downloaded size to.\n * `contentsize` - Pointer to output the total content size to."] - pub fn httpcGetDownloadSizeState( - context: *mut httpcContext, - downloadedsize: *mut u32_, - contentsize: *mut u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the response code of the HTTP context.\n # Arguments\n\n* `context` - Context to get the response code of.\n * `out` - Pointer to write the response code to."] - pub fn httpcGetResponseStatusCode(context: *mut httpcContext, out: *mut u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the response code of the HTTP context with a timeout value.\n # Arguments\n\n* `context` - Context to get the response code of.\n * `out` - Pointer to write the response code to.\n * `timeout` - Maximum time in nanoseconds to wait for a reply."] - pub fn httpcGetResponseStatusCodeTimeout( - context: *mut httpcContext, - out: *mut u32_, - timeout: u64_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets a response header field from a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `name` - Name of the field.\n * `value` - Pointer to output the value of the field to.\n * `valuebuf_maxsize` - Maximum size of the value buffer."] - pub fn httpcGetResponseHeader( - context: *mut httpcContext, - name: *const ::libc::c_char, - value: *mut ::libc::c_char, - valuebuf_maxsize: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Adds a trusted RootCA cert to a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `cert` - Pointer to DER cert.\n * `certsize` - Size of the DER cert."] - pub fn httpcAddTrustedRootCA( - context: *mut httpcContext, - cert: *const u8_, - certsize: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Adds a default RootCA cert to a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `certID` - ID of the cert to add, see sslc.h."] - pub fn httpcAddDefaultCert(context: *mut httpcContext, certID: SSLC_DefaultRootCert) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the RootCertChain for a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `RootCertChain_contexthandle` - Contexthandle for the RootCertChain."] - pub fn httpcSelectRootCertChain( - context: *mut httpcContext, - RootCertChain_contexthandle: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the ClientCert for a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `cert` - Pointer to DER cert.\n * `certsize` - Size of the DER cert.\n * `privk` - Pointer to the DER private key.\n * `privk_size` - Size of the privk."] - pub fn httpcSetClientCert( - context: *mut httpcContext, - cert: *const u8_, - certsize: u32_, - privk: *const u8_, - privk_size: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the default clientcert for a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `certID` - ID of the cert to add, see sslc.h."] - pub fn httpcSetClientCertDefault( - context: *mut httpcContext, - certID: SSLC_DefaultClientCert, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the ClientCert contexthandle for a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `ClientCert_contexthandle` - Contexthandle for the ClientCert."] - pub fn httpcSetClientCertContext( - context: *mut httpcContext, - ClientCert_contexthandle: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets SSL options for the context.\n The HTTPC SSL option bits are the same as those defined in sslc.h\n # Arguments\n\n* `context` - Context to set flags on.\n * `options` - SSL option flags."] - pub fn httpcSetSSLOpt(context: *mut httpcContext, options: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the SSL options which will be cleared for the context.\n The HTTPC SSL option bits are the same as those defined in sslc.h\n # Arguments\n\n* `context` - Context to clear flags on.\n * `options` - SSL option flags."] - pub fn httpcSetSSLClearOpt(context: *mut httpcContext, options: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Creates a RootCertChain. Up to 2 RootCertChains can be created under this user-process.\n # Arguments\n\n* `RootCertChain_contexthandle` - Output RootCertChain contexthandle."] - pub fn httpcCreateRootCertChain(RootCertChain_contexthandle: *mut u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Destroy a RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - RootCertChain to use."] - pub fn httpcDestroyRootCertChain(RootCertChain_contexthandle: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Adds a RootCA cert to a RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - RootCertChain to use.\n * `cert` - Pointer to DER cert.\n * `certsize` - Size of the DER cert.\n * `cert_contexthandle` - Optional output ptr for the cert contexthandle(this can be NULL)."] - pub fn httpcRootCertChainAddCert( - RootCertChain_contexthandle: u32_, - cert: *const u8_, - certsize: u32_, - cert_contexthandle: *mut u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Adds a default RootCA cert to a RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - RootCertChain to use.\n * `certID` - ID of the cert to add, see sslc.h.\n * `cert_contexthandle` - Optional output ptr for the cert contexthandle(this can be NULL)."] - pub fn httpcRootCertChainAddDefaultCert( - RootCertChain_contexthandle: u32_, - certID: SSLC_DefaultRootCert, - cert_contexthandle: *mut u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Removes a cert from a RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - RootCertChain to use.\n * `cert_contexthandle` - Contexthandle of the cert to remove."] - pub fn httpcRootCertChainRemoveCert( - RootCertChain_contexthandle: u32_, - cert_contexthandle: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Opens a ClientCert-context. Up to 2 ClientCert-contexts can be open under this user-process.\n # Arguments\n\n* `cert` - Pointer to DER cert.\n * `certsize` - Size of the DER cert.\n * `privk` - Pointer to the DER private key.\n * `privk_size` - Size of the privk.\n * `ClientCert_contexthandle` - Output ClientCert context handle."] - pub fn httpcOpenClientCertContext( - cert: *const u8_, - certsize: u32_, - privk: *const u8_, - privk_size: u32_, - ClientCert_contexthandle: *mut u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Opens a ClientCert-context with a default clientclient. Up to 2 ClientCert-contexts can be open under this user-process.\n # Arguments\n\n* `certID` - ID of the cert to add, see sslc.h.\n * `ClientCert_contexthandle` - Output ClientCert context handle."] - pub fn httpcOpenDefaultClientCertContext( - certID: SSLC_DefaultClientCert, - ClientCert_contexthandle: *mut u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Closes a ClientCert context.\n # Arguments\n\n* `ClientCert_contexthandle` - ClientCert context to use."] - pub fn httpcCloseClientCertContext(ClientCert_contexthandle: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Downloads data from the HTTP context into a buffer.\n The *entire* content must be downloaded before using httpcCloseContext(), otherwise httpcCloseContext() will hang.\n # Arguments\n\n* `context` - Context to download data from.\n * `buffer` - Buffer to write data to.\n * `size` - Size of the buffer.\n * `downloadedsize` - Pointer to write the size of the downloaded data to."] - pub fn httpcDownloadData( - context: *mut httpcContext, - buffer: *mut u8_, - size: u32_, - downloadedsize: *mut u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets Keep-Alive for the context.\n # Arguments\n\n* `context` - Context to set the KeepAlive flag on.\n * `option` - HTTPC_KeepAlive option."] - pub fn httpcSetKeepAlive(context: *mut httpcContext, option: HTTPC_KeepAlive) -> Result; -} -#[doc = "Node info struct."] -#[repr(C)] -#[derive(Copy, Clone)] -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)] -#[derive(Copy, Clone)] -pub union udsNodeInfo__bindgen_ty_1 { - pub usercfg: [u8_; 24usize], - pub __bindgen_anon_1: udsNodeInfo__bindgen_ty_1__bindgen_ty_1, -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct udsNodeInfo__bindgen_ty_1__bindgen_ty_1 { - pub username: [u16_; 10usize], - pub unk_x1c: u16_, - pub flag: u8_, - pub pad_x1f: u8_, -} -impl Default for udsNodeInfo__bindgen_ty_1 { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl Default for udsNodeInfo { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "Connection status struct."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -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_, -} -#[doc = "Network struct stored as big-endian."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -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], -} -impl Default for udsNetworkStruct { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct udsBindContext { - pub BindNodeID: u32_, - pub event: Handle, - pub spectator: bool, -} -#[doc = "General NWM input structure used for AP scanning."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -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], -} -impl Default for nwmScanInputStruct { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "General NWM output structure from AP scanning."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct nwmBeaconDataReplyHeader { - pub maxsize: u32_, - pub size: u32_, - pub total_entries: u32_, -} -#[doc = "General NWM output structure from AP scanning, for each entry."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -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_, -} -#[doc = "Output structure generated from host scanning output."] -#[repr(C)] -#[derive(Copy, Clone)] -pub struct udsNetworkScanInfo { - pub datareply_entry: nwmBeaconDataReplyEntry, - pub network: udsNetworkStruct, - pub nodes: [udsNodeInfo; 16usize], -} -impl Default for udsNetworkScanInfo { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -pub const UDSNETATTR_DisableConnectSpectators: _bindgen_ty_24 = 1; -pub const UDSNETATTR_DisableConnectClients: _bindgen_ty_24 = 2; -pub const UDSNETATTR_x4: _bindgen_ty_24 = 4; -pub const UDSNETATTR_Default: _bindgen_ty_24 = 32768; -pub type _bindgen_ty_24 = ::libc::c_uint; -pub const UDS_SENDFLAG_Default: _bindgen_ty_25 = 1; -pub const UDS_SENDFLAG_Broadcast: _bindgen_ty_25 = 2; -pub type _bindgen_ty_25 = ::libc::c_uint; -pub const UDSCONTYPE_Client: udsConnectionType = 1; -pub const UDSCONTYPE_Spectator: udsConnectionType = 2; -pub type udsConnectionType = ::libc::c_uint; -extern "C" { - #[must_use] - #[doc = "Initializes UDS.\n # Arguments\n\n* `sharedmem_size` - This must be 0x1000-byte aligned.\n * `username` - Optional custom UTF-8 username(converted to UTF-16 internally) that other nodes on the UDS network can use. If not set the username from system-config is used. Max len is 10 characters without NUL-terminator."] - pub fn udsInit(sharedmem_size: usize, username: *const ::libc::c_char) -> Result; -} -extern "C" { - #[doc = "Exits UDS."] - pub fn udsExit(); -} -extern "C" { - #[must_use] - #[doc = "Generates a NodeInfo struct with data loaded from system-config.\n # Arguments\n\n* `nodeinfo` - Output NodeInfo struct.\n * `username` - If set, this is the UTF-8 string to convert for use in the struct. Max len is 10 characters without NUL-terminator."] - pub fn udsGenerateNodeInfo( - nodeinfo: *mut udsNodeInfo, - username: *const ::libc::c_char, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Loads the UTF-16 username stored in the input NodeInfo struct, converted to UTF-8.\n # Arguments\n\n* `nodeinfo` - Input NodeInfo struct.\n * `username` - This is the output UTF-8 string. Max len is 10 characters without NUL-terminator."] - pub fn udsGetNodeInfoUsername( - nodeinfo: *const udsNodeInfo, - username: *mut ::libc::c_char, - ) -> Result; -} -extern "C" { - #[doc = "Checks whether a NodeInfo struct was initialized by NWM-module(not any output from udsGenerateNodeInfo()).\n # Arguments\n\n* `nodeinfo` - Input NodeInfo struct."] - pub fn udsCheckNodeInfoInitialized(nodeinfo: *const udsNodeInfo) -> bool; -} -extern "C" { - #[doc = "Generates a default NetworkStruct for creating networks.\n # Arguments\n\n* `network` - The output struct.\n * `wlancommID` - Unique local-WLAN communications ID for each application.\n * `id8` - Additional ID that can be used by the application for different types of networks.\n * `max_nodes` - Maximum number of nodes(devices) that can be connected to the network, including the host."] - pub fn udsGenerateDefaultNetworkStruct( - network: *mut udsNetworkStruct, - wlancommID: u32_, - id8: u8_, - max_nodes: u8_, - ); -} -extern "C" { - #[must_use] - #[doc = "Scans for networks via beacon-scanning.\n # Arguments\n\n* `outbuf` - Buffer which will be used by the beacon-scanning command and for the data parsing afterwards. Normally there's no need to use the contents of this buffer once this function returns.\n * `maxsize` - Max size of the buffer.\n networks Ptr where the allocated udsNetworkScanInfo array buffer is written. The allocsize is sizeof(udsNetworkScanInfo)*total_networks.\n total_networks Total number of networks stored under the networks buffer.\n * `wlancommID` - Unique local-WLAN communications ID for each application.\n * `id8` - Additional ID that can be used by the application for different types of networks.\n * `host_macaddress` - When set, this code will only return network info from the specified host MAC address.\n When not connected to a network this *must* be false. When connected to a network this *must* be true."] - 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" { - #[must_use] - #[doc = "This can be used by the host to set the appdata contained in the broadcasted beacons.\n # Arguments\n\n* `buf` - Appdata buffer.\n * `size` - Size of the input appdata."] - pub fn udsSetApplicationData(buf: *const ::libc::c_void, size: usize) -> Result; -} -extern "C" { - #[must_use] - #[doc = "This can be used while on a network(host/client) to get the appdata from the current beacon.\n # Arguments\n\n* `buf` - Appdata buffer.\n * `size` - Max size of the output buffer.\n * `actual_size` - If set, the actual size of the appdata written into the buffer is stored here."] - pub fn udsGetApplicationData( - buf: *mut ::libc::c_void, - size: usize, - actual_size: *mut usize, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "This can be used with a NetworkStruct, from udsScanBeacons() mainly, for getting the appdata.\n # Arguments\n\n* `buf` - Appdata buffer.\n * `size` - Max size of the output buffer.\n * `actual_size` - If set, the actual size of the appdata written into the buffer is stored here."] - pub fn udsGetNetworkStructApplicationData( - network: *const udsNetworkStruct, - buf: *mut ::libc::c_void, - size: usize, - actual_size: *mut usize, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Create a bind.\n # Arguments\n\n* `bindcontext` - The output bind context.\n * `NetworkNodeID` - This is the NetworkNodeID which this bind can receive data from.\n * `spectator` - False for a regular bind, true for a spectator.\n * `data_channel` - This is an arbitrary value to use for data-frame filtering. This bind will only receive data frames which contain a matching data_channel value, which was specified by udsSendTo(). The data_channel must be non-zero.\n * `recv_buffer_size` - Size of the buffer under sharedmem used for temporarily storing received data-frames which are then loaded by udsPullPacket(). The system requires this to be >=0x5F4. UDS_DEFAULT_RECVBUFSIZE can be used for this."] - pub fn udsBind( - bindcontext: *mut udsBindContext, - NetworkNodeID: u16_, - spectator: bool, - data_channel: u8_, - recv_buffer_size: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Remove a bind.\n # Arguments\n\n* `bindcontext` - The bind context."] - pub fn udsUnbind(bindcontext: *mut udsBindContext) -> Result; -} -extern "C" { - #[doc = "Waits for the bind event to occur, or checks if the event was signaled. This event is signaled every time new data is available via udsPullPacket().\n # Returns\n\nAlways true. However if wait=false, this will return false if the event wasn't signaled.\n # Arguments\n\n* `bindcontext` - The bind context.\n * `nextEvent` - Whether to discard the current event and wait for the next event.\n * `wait` - When true this will not return until the event is signaled. When false this checks if the event was signaled without waiting for it."] - pub fn udsWaitDataAvailable( - bindcontext: *const udsBindContext, - nextEvent: bool, - wait: bool, - ) -> bool; -} -extern "C" { - #[must_use] - #[doc = "Receives data over the network. This data is loaded from the recv_buffer setup by udsBind(). When a node disconnects, this will still return data from that node until there's no more frames from that node in the recv_buffer.\n # Arguments\n\n* `bindcontext` - Bind context.\n * `buf` - Output receive buffer.\n * `size` - Size of the buffer.\n * `actual_size` - If set, the actual size written into the output buffer is stored here. This is zero when no data was received.\n * `src_NetworkNodeID` - If set, the source NetworkNodeID is written here. This is zero when no data was received."] - pub fn udsPullPacket( - bindcontext: *const udsBindContext, - buf: *mut ::libc::c_void, - size: usize, - actual_size: *mut usize, - src_NetworkNodeID: *mut u16_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sends data over the network.\n # Arguments\n\n* `dst_NetworkNodeID` - Destination NetworkNodeID.\n * `data_channel` - See udsBind().\n * `flags` - Send flags, see the UDS_SENDFLAG enum values.\n * `buf` - Input send buffer.\n * `size` - Size of the buffer."] - pub fn udsSendTo( - dst_NetworkNodeID: u16_, - data_channel: u8_, - flags: u8_, - buf: *const ::libc::c_void, - size: usize, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the wifi channel currently being used.\n # Arguments\n\n* `channel` - Output channel."] - pub fn udsGetChannel(channel: *mut u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Starts hosting a new network.\n # Arguments\n\n* `network` - The NetworkStruct, you can use udsGenerateDefaultNetworkStruct() for generating this.\n * `passphrase` - Raw input passphrase buffer.\n * `passphrase_size` - Size of the passphrase buffer.\n * `context` - Optional output bind context which will be created for this host, with NetworkNodeID=UDS_BROADCAST_NETWORKNODEID.\n * `data_channel` - This is the data_channel value which will be passed to udsBind() internally.\n * `recv_buffer_size` - This is the recv_buffer_size value which will be passed to udsBind() internally."] - 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" { - #[must_use] - #[doc = "Connect to a network.\n # Arguments\n\n* `network` - The NetworkStruct, you can use udsScanBeacons() for this.\n * `passphrase` - Raw input passphrase buffer.\n * `passphrase_size` - Size of the passphrase buffer.\n * `context` - Optional output bind context which will be created for this host.\n * `recv_NetworkNodeID` - This is the NetworkNodeID passed to udsBind() internally.\n * `connection_type` - Type of connection, see the udsConnectionType enum values.\n * `data_channel` - This is the data_channel value which will be passed to udsBind() internally.\n * `recv_buffer_size` - This is the recv_buffer_size value which will be passed to udsBind() internally."] - 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" { - #[must_use] - #[doc = "Stop hosting the network."] - pub fn udsDestroyNetwork() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Disconnect this client device from the network."] - pub fn udsDisconnectNetwork() -> Result; -} -extern "C" { - #[must_use] - #[doc = "This can be used by the host to force-disconnect client(s).\n # Arguments\n\n* `NetworkNodeID` - Target NetworkNodeID. UDS_BROADCAST_NETWORKNODEID can be used to disconnect all clients."] - pub fn udsEjectClient(NetworkNodeID: u16_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "This can be used by the host to force-disconnect the spectators. Afterwards new spectators will not be allowed to connect until udsAllowSpectators() is used."] - pub fn udsEjectSpectator() -> Result; -} -extern "C" { - #[must_use] - #[doc = "This can be used by the host to update the network attributes. If bitmask 0x4 is clear in the input bitmask, this clears that bit in the value before actually writing the value into state. Normally you should use the below wrapper functions.\n # Arguments\n\n* `bitmask` - Bitmask to clear/set in the attributes. See the UDSNETATTR enum values.\n * `flag` - When false, bit-clear, otherwise bit-set."] - pub fn udsUpdateNetworkAttribute(bitmask: u16_, flag: bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "This uses udsUpdateNetworkAttribute() for (un)blocking new connections to this host.\n # Arguments\n\n* `block` - When true, block the specified connection types(bitmask set). Otherwise allow them(bitmask clear).\n * `clients` - When true, (un)block regular clients.\n * `flag` - When true, update UDSNETATTR_x4. Normally this should be false."] - pub fn udsSetNewConnectionsBlocked(block: bool, clients: bool, flag: bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "This uses udsUpdateNetworkAttribute() for unblocking new spectator connections to this host. See udsEjectSpectator() for blocking new spectators."] - pub fn udsAllowSpectators() -> Result; -} -extern "C" { - #[must_use] - #[doc = "This loads the current ConnectionStatus struct.\n # Arguments\n\n* `output` - Output ConnectionStatus struct."] - pub fn udsGetConnectionStatus(output: *mut udsConnectionStatus) -> Result; -} -extern "C" { - #[doc = "Waits for the ConnectionStatus event to occur, or checks if the event was signaled. This event is signaled when the data from udsGetConnectionStatus() was updated internally.\n # Returns\n\nAlways true. However if wait=false, this will return false if the event wasn't signaled.\n # Arguments\n\n* `nextEvent` - Whether to discard the current event and wait for the next event.\n * `wait` - When true this will not return until the event is signaled. When false this checks if the event was signaled without waiting for it."] - pub fn udsWaitConnectionStatusEvent(nextEvent: bool, wait: bool) -> bool; -} -extern "C" { - #[must_use] - #[doc = "This loads a NodeInfo struct for the specified NetworkNodeID. The broadcast alias can't be used with this.\n # Arguments\n\n* `NetworkNodeID` - Target NetworkNodeID.\n * `output` - Output NodeInfo struct."] - pub fn udsGetNodeInformation(NetworkNodeID: u16_, output: *mut udsNodeInfo) -> Result; -} -pub const NDM_EXCLUSIVE_STATE_NONE: ndmExclusiveState = 0; -pub const NDM_EXCLUSIVE_STATE_INFRASTRUCTURE: ndmExclusiveState = 1; -pub const NDM_EXCLUSIVE_STATE_LOCAL_COMMUNICATIONS: ndmExclusiveState = 2; -pub const NDM_EXCLUSIVE_STATE_STREETPASS: ndmExclusiveState = 3; -pub const NDM_EXCLUSIVE_STATE_STREETPASS_DATA: ndmExclusiveState = 4; -#[doc = "Exclusive states."] -pub type ndmExclusiveState = ::libc::c_uint; -pub const NDM_STATE_INITIAL: ndmState = 0; -pub const NDM_STATE_SUSPENDED: ndmState = 1; -pub const NDM_STATE_INFRASTRUCTURE_CONNECTING: ndmState = 2; -pub const NDM_STATE_INFRASTRUCTURE_CONNECTED: ndmState = 3; -pub const NDM_STATE_INFRASTRUCTURE_WORKING: ndmState = 4; -pub const NDM_STATE_INFRASTRUCTURE_SUSPENDING: ndmState = 5; -pub const NDM_STATE_INFRASTRUCTURE_FORCE_SUSPENDING: ndmState = 6; -pub const NDM_STATE_INFRASTRUCTURE_DISCONNECTING: ndmState = 7; -pub const NDM_STATE_INFRASTRUCTURE_FORCE_DISCONNECTING: ndmState = 8; -pub const NDM_STATE_CEC_WORKING: ndmState = 9; -pub const NDM_STATE_CEC_FORCE_SUSPENDING: ndmState = 10; -pub const NDM_STATE_CEC_SUSPENDING: ndmState = 11; -#[doc = "Current states."] -pub type ndmState = ::libc::c_uint; -pub const NDM_DAEMON_CEC: ndmDaemon = 0; -pub const NDM_DAEMON_BOSS: ndmDaemon = 1; -pub const NDM_DAEMON_NIM: ndmDaemon = 2; -pub const NDM_DAEMON_FRIENDS: ndmDaemon = 3; -pub type ndmDaemon = ::libc::c_uint; -pub const NDM_DAEMON_MASK_CEC: ndmDaemonMask = 1; -pub const NDM_DAEMON_MASK_BOSS: ndmDaemonMask = 2; -pub const NDM_DAEMON_MASK_NIM: ndmDaemonMask = 4; -pub const NDM_DAEMON_MASK_FRIENDS: ndmDaemonMask = 8; -pub const NDM_DAEMON_MASK_BACKGROUOND: ndmDaemonMask = 7; -pub const NDM_DAEMON_MASK_ALL: ndmDaemonMask = 15; -pub const NDM_DAEMON_MASK_DEFAULT: ndmDaemonMask = 9; -#[doc = "Used to specify multiple daemons."] -pub type ndmDaemonMask = ::libc::c_uint; -pub const NDM_DAEMON_STATUS_BUSY: ndmDaemonStatus = 0; -pub const NDM_DAEMON_STATUS_IDLE: ndmDaemonStatus = 1; -pub const NDM_DAEMON_STATUS_SUSPENDING: ndmDaemonStatus = 2; -pub const NDM_DAEMON_STATUS_SUSPENDED: ndmDaemonStatus = 3; -pub type ndmDaemonStatus = ::libc::c_uint; -extern "C" { - #[must_use] - #[doc = "Initializes ndmu."] - pub fn ndmuInit() -> Result; -} -extern "C" { - #[doc = "Exits ndmu."] - pub fn ndmuExit(); -} -extern "C" { - #[must_use] - #[doc = "Sets the network daemon to an exclusive state.\n # Arguments\n\n* `state` - State specified in the ndmExclusiveState enumerator."] - pub fn NDMU_EnterExclusiveState(state: ndmExclusiveState) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Cancels an exclusive state for the network daemon."] - pub fn NDMU_LeaveExclusiveState() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Returns the exclusive state for the network daemon.\n # Arguments\n\n* `state` - Pointer to write the exclsuive state to."] - pub fn NDMU_GetExclusiveState(state: *mut ndmExclusiveState) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Locks the exclusive state."] - pub fn NDMU_LockState() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Unlocks the exclusive state."] - pub fn NDMU_UnlockState() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Suspends network daemon.\n # Arguments\n\n* `mask` - The specified daemon."] - pub fn NDMU_SuspendDaemons(mask: ndmDaemonMask) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Resumes network daemon.\n # Arguments\n\n* `mask` - The specified daemon."] - pub fn NDMU_ResumeDaemons(mask: ndmDaemonMask) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Suspends scheduling for all network daemons.\n # Arguments\n\n* `flag` - 0 = Wait for completion, 1 = Perform in background."] - pub fn NDMU_SuspendScheduler(flag: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Resumes daemon scheduling."] - pub fn NDMU_ResumeScheduler() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Returns the current state for the network daemon.\n # Arguments\n\n* `state` - Pointer to write the current state to."] - pub fn NDMU_GetCurrentState(state: *mut ndmState) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Returns the daemon state.\n # Arguments\n\n* `state` - Pointer to write the daemons state to."] - pub fn NDMU_QueryStatus(status: *mut ndmDaemonStatus) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the scan interval.\n # Arguments\n\n* `interval` - Value to set the scan interval to."] - pub fn NDMU_SetScanInterval(interval: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Returns the scan interval.\n # Arguments\n\n* `interval` - Pointer to write the interval value to."] - pub fn NDMU_GetScanInterval(interval: *mut u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Returns the retry interval.\n # Arguments\n\n* `interval` - Pointer to write the interval value to."] - pub fn NDMU_GetRetryInterval(interval: *mut u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Reverts network daemon to defaults."] - pub fn NDMU_ResetDaemons() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the current default daemon bit mask.\n # Arguments\n\n* `interval` - Pointer to write the default daemon mask value to. The default value is (DAEMONMASK_CEC | DAEMONMASK_FRIENDS)"] - pub fn NDMU_GetDefaultDaemons(mask: *mut ndmDaemonMask) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Clears half awake mac filter."] - pub fn NDMU_ClearMacFilter() -> Result; -} -#[doc = "< Initial installation"] -pub const IM_DEFAULT: NIM_InstallationMode = 0; -#[doc = "< Unknown"] -pub const IM_UNKNOWN1: NIM_InstallationMode = 1; -#[doc = "< Unknown"] -pub const IM_UNKNOWN2: NIM_InstallationMode = 2; -#[doc = "< Reinstall currently installed title; use this if the title is already installed (including updates)"] -pub const IM_REINSTALL: NIM_InstallationMode = 3; -#[doc = "Mode that NIM downloads/installs a title with."] -pub type NIM_InstallationMode = ::libc::c_uint; -#[doc = "< Download not yet initialized"] -pub const DS_NOT_INITIALIZED: NIM_DownloadState = 0; -#[doc = "< Download initialized"] -pub const DS_INITIALIZED: NIM_DownloadState = 1; -#[doc = "< Downloading and installing TMD"] -pub const DS_DOWNLOAD_TMD: NIM_DownloadState = 2; -#[doc = "< Initializing save data"] -pub const DS_PREPARE_SAVE_DATA: NIM_DownloadState = 3; -#[doc = "< Downloading and installing contents"] -pub const DS_DOWNLOAD_CONTENTS: NIM_DownloadState = 4; -#[doc = "< Waiting before calling AM_CommitImportTitles"] -pub const DS_WAIT_COMMIT: NIM_DownloadState = 5; -#[doc = "< Running AM_CommitImportTitles"] -pub const DS_COMMITTING: NIM_DownloadState = 6; -#[doc = "< Title installation finished"] -pub const DS_FINISHED: NIM_DownloadState = 7; -#[doc = "< (unknown error regarding title version)"] -pub const DS_VERSION_ERROR: NIM_DownloadState = 8; -#[doc = "< Creating the .ctx file?"] -pub const DS_CREATE_CONTEXT: NIM_DownloadState = 9; -#[doc = "< Irrecoverable error encountered (e.g. out of space)"] -pub const DS_CANNOT_RECOVER: NIM_DownloadState = 10; -#[doc = "< Invalid state"] -pub const DS_INVALID: NIM_DownloadState = 11; -#[doc = "Current state of a NIM download/installation."] -pub type NIM_DownloadState = ::libc::c_uint; -#[doc = "Input configuration for NIM download/installation tasks."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct NIM_TitleConfig { - #[doc = "< Title ID"] - pub titleId: u64_, - #[doc = "< Title version"] - pub version: u32_, - #[doc = "< Always 0"] - pub unknown_0: u32_, - #[doc = "< Age for the HOME Menu parental controls"] - pub ratingAge: u8_, - #[doc = "< Media type, see FS_MediaType enum"] - pub mediaType: u8_, - #[doc = "< Padding"] - pub padding: [u8_; 2usize], - #[doc = "< Unknown input, seems to be always 0"] - pub unknown_1: u32_, -} -#[doc = "Output struct for NIM downloads/installations in progress."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct NIM_TitleProgress { - #[doc = "< State, see NIM_DownloadState enum"] - pub state: u32_, - #[doc = "< Last result code in NIM"] - pub lastResult: Result, - #[doc = "< Amount of bytes that have been downloaded"] - pub downloadedSize: u64_, - #[doc = "< Amount of bytes that need to be downloaded in total"] - pub totalSize: u64_, -} -extern "C" { - #[must_use] - #[doc = "Initializes nim:s. This uses networking and is blocking.\n # Arguments\n\n* `buffer` - A buffer for internal use. It must be at least 0x20000 bytes long.\n * `buffer_len` - Length of the passed buffer."] - pub fn nimsInit(buffer: *mut ::libc::c_void, buffer_len: usize) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initializes nim:s with the given TIN. This uses networking and is blocking.\n # Arguments\n\n* `buffer` - A buffer for internal use. It must be at least 0x20000 bytes long.\n * `buffer_len` - Length of the passed buffer.\n * `TIN` - The TIN to initialize nim:s with. If you do not know what a TIN is or why you would want to change it, use nimsInit instead."] - pub fn nimsInitWithTIN( - buffer: *mut ::libc::c_void, - buffer_len: usize, - TIN: *const ::libc::c_char, - ) -> Result; -} -extern "C" { - #[doc = "Exits nim:s."] - pub fn nimsExit(); -} -extern "C" { - #[doc = "Gets the current nim:s session handle."] - pub fn nimsGetSessionHandle() -> *mut Handle; -} -extern "C" { - #[must_use] - #[doc = "Sets an attribute.\n # Arguments\n\n* `attr` - Name of the attribute.\n * `val` - Value of the attribute."] - pub fn NIMS_SetAttribute(attr: *const ::libc::c_char, val: *const ::libc::c_char) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Checks if nim wants a system update.\n # Arguments\n\n* `want_update` - Set to true if a system update is required. Can be NULL."] - pub fn NIMS_WantUpdate(want_update: *mut bool) -> Result; -} -extern "C" { - #[doc = "Makes a TitleConfig struct for use with NIMS_RegisterTask, NIMS_StartDownload or NIMS_StartDownloadSimple.\n # Arguments\n\n* `cfg` - Struct to initialize.\n * `titleId` - Title ID to download and install.\n * `version` - Version of the title to download and install.\n * `ratingAge` - Age for which the title is aged; used by parental controls in HOME Menu.\n * `mediaType` - Media type of the title to download and install."] - pub fn NIMS_MakeTitleConfig( - cfg: *mut NIM_TitleConfig, - titleId: u64_, - version: u32_, - ratingAge: u8_, - mediaType: FS_MediaType, - ); -} -extern "C" { - #[must_use] - #[doc = "Registers a background download task with NIM. These are processed in sleep mode only.\n # Arguments\n\n* `cfg` - Title config to use. See NIMS_MakeTitleConfig.\n * `name` - Name of the title in UTF-8. Will be displayed on the HOME Menu. Maximum 73 characters.\n * `maker` - Name of the maker/publisher in UTF-8. Will be displayed on the HOME Menu. Maximum 37 characters."] - pub fn NIMS_RegisterTask( - cfg: *const NIM_TitleConfig, - name: *const ::libc::c_char, - maker: *const ::libc::c_char, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Checks whether a background download task for the given title is registered with NIM.\n # Arguments\n\n* `titleId` - Title ID to check for.\n * `registered` - Whether there is a background download task registered."] - pub fn NIMS_IsTaskRegistered(titleId: u64_, registered: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Unregisters a background download task.\n # Arguments\n\n* `titleId` - Title ID whose background download task to cancel."] - pub fn NIMS_UnregisterTask(titleId: u64_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Starts an active download with NIM. Progress can be checked with NIMS_GetProcess. Do not exit the process while a download is in progress without calling NIMS_CancelDownload.\n # Arguments\n\n* `cfg` - Title config to use. See NIMS_MakeTitleConfig.\n * `mode` - The installation mode to use. See NIM_InstallationMode."] - pub fn NIMS_StartDownload(cfg: *const NIM_TitleConfig, mode: NIM_InstallationMode) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Starts an active download with NIM with default installation mode; cannot reinstall titles. Progress can be checked with NIMS_GetProcess. Do not exit the process while a download is in progress without calling NIMS_CancelDownload.\n # Arguments\n\n* `cfg` - Title config to use. See NIMS_MakeTitleConfig."] - pub fn NIMS_StartDownloadSimple(cfg: *const NIM_TitleConfig) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Checks the status of the current active download.\n # Arguments\n\n* `tp` - Title progress struct to write to. See NIM_TitleProgress."] - pub fn NIMS_GetProgress(tp: *mut NIM_TitleProgress) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Cancels the current active download with NIM."] - pub fn NIMS_CancelDownload() -> Result; -} -extern "C" { - #[must_use] - pub fn nwmExtInit() -> Result; -} -extern "C" { - pub fn nwmExtExit(); -} -extern "C" { - #[must_use] - #[doc = "Turns wireless on or off.\n # Arguments\n\n* `enableWifi` - True enables it, false disables it."] - pub fn NWMEXT_ControlWirelessEnabled(enableWifi: bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initializes IRU.\n The permissions for the specified memory is set to RO. This memory must be already mapped.\n # Arguments\n\n* `sharedmem_addr` - Address of the shared memory block to use.\n * `sharedmem_size` - Size of the shared memory block."] - pub fn iruInit(sharedmem_addr: *mut u32_, sharedmem_size: u32_) -> Result; -} -extern "C" { - #[doc = "Shuts down IRU."] - pub fn iruExit(); -} -extern "C" { - #[doc = "Gets the IRU service handle.\n # Returns\n\nThe IRU service handle."] - pub fn iruGetServHandle() -> Handle; -} -extern "C" { - #[must_use] - #[doc = "Sends IR data.\n # Arguments\n\n* `buf` - Buffer to send data from.\n * `size` - Size of the buffer.\n * `wait` - Whether to wait for the data to be sent."] - pub fn iruSendData(buf: *mut u8_, size: u32_, wait: bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Receives IR data.\n # Arguments\n\n* `buf` - Buffer to receive data to.\n * `size` - Size of the buffer.\n * `flag` - Flags to receive data with.\n * `transfercount` - Pointer to output the number of bytes read to.\n * `wait` - Whether to wait for the data to be received."] - pub fn iruRecvData( - buf: *mut u8_, - size: u32_, - flag: u8_, - transfercount: *mut u32_, - wait: bool, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initializes the IR session."] - pub fn IRU_Initialize() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Shuts down the IR session."] - pub fn IRU_Shutdown() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Begins sending data.\n # Arguments\n\n* `buf` - Buffer to send.\n * `size` - Size of the buffer."] - pub fn IRU_StartSendTransfer(buf: *mut u8_, size: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Waits for a send operation to complete."] - pub fn IRU_WaitSendTransfer() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Begins receiving data.\n # Arguments\n\n* `size` - Size of the data to receive.\n * `flag` - Flags to use when receiving."] - pub fn IRU_StartRecvTransfer(size: u32_, flag: u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Waits for a receive operation to complete.\n # Arguments\n\n* `transfercount` - Pointer to output the number of bytes read to."] - pub fn IRU_WaitRecvTransfer(transfercount: *mut u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the IR bit rate.\n # Arguments\n\n* `value` - Bit rate to set."] - pub fn IRU_SetBitRate(value: u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the IR bit rate.\n # Arguments\n\n* `out` - Pointer to write the bit rate to."] - pub fn IRU_GetBitRate(out: *mut u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the IR LED state.\n # Arguments\n\n* `value` - IR LED state to set."] - pub fn IRU_SetIRLEDState(value: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the IR LED state.\n # Arguments\n\n* `out` - Pointer to write the IR LED state to."] - pub fn IRU_GetIRLEDRecvState(out: *mut u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets an event which is signaled once a send finishes.\n # Arguments\n\n* `out` - Pointer to write the event handle to."] - pub fn IRU_GetSendFinishedEvent(out: *mut Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets an event which is signaled once a receive finishes.\n # Arguments\n\n* `out` - Pointer to write the event handle to."] - pub fn IRU_GetRecvFinishedEvent(out: *mut Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initializes NS."] - pub fn nsInit() -> Result; -} -extern "C" { - #[doc = "Exits NS."] - pub fn nsExit(); -} -extern "C" { - #[must_use] - #[doc = "Launches a title and the required firmware (only if necessary).\n # Arguments\n\n* `titleid` - ID of the title to launch, 0 for gamecard, JPN System Settings' titleID for System Settings."] - pub fn NS_LaunchFIRM(titleid: u64_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Launches a title.\n # Arguments\n\n* `titleid` - ID of the title to launch, or 0 for gamecard.\n * `launch_flags` - Flags used when launching the title.\n * `procid` - Pointer to write the process ID of the launched title to."] - pub fn NS_LaunchTitle(titleid: u64_, launch_flags: u32_, procid: *mut u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Terminates the application from which this function is called"] - pub fn NS_TerminateTitle() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Launches a title and the required firmware.\n # Arguments\n\n* `titleid` - ID of the title to launch, 0 for gamecard.\n * `flags` - Flags for firm-launch. bit0: require an application title-info structure in FIRM paramters to be specified via FIRM parameters. bit1: if clear, NS will check certain Configuration Memory fields."] - pub fn NS_LaunchApplicationFIRM(titleid: u64_, flags: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Reboots to a title.\n # Arguments\n\n* `mediatype` - Mediatype of the title.\n * `titleid` - ID of the title to launch."] - pub fn NS_RebootToTitle(mediatype: u8_, titleid: u64_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Terminates the process with the specified titleid.\n # Arguments\n\n* `titleid` - ID of the title to terminate.\n * `timeout` - Timeout in nanoseconds. Pass 0 if not required."] - pub fn NS_TerminateProcessTID(titleid: u64_, timeout: u64_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Reboots the system"] - pub fn NS_RebootSystem() -> Result; -} -pub const PMLAUNCHFLAG_NORMAL_APPLICATION: _bindgen_ty_26 = 1; -pub const PMLAUNCHFLAG_LOAD_DEPENDENCIES: _bindgen_ty_26 = 2; -pub const PMLAUNCHFLAG_NOTIFY_TERMINATION: _bindgen_ty_26 = 4; -pub const PMLAUNCHFLAG_QUEUE_DEBUG_APPLICATION: _bindgen_ty_26 = 8; -pub const PMLAUNCHFLAG_TERMINATION_NOTIFICATION_MASK: _bindgen_ty_26 = 240; -#[doc = "< Forces the usage of the O3DS system mode app memory setting even if N3DS system mode is not \"Legacy\". Dev4 and Dev5 not supported. N3DS only."] -pub const PMLAUNCHFLAG_FORCE_USE_O3DS_APP_MEM: _bindgen_ty_26 = 256; -#[doc = "< In conjunction with the above, forces the 96MB app memory setting. N3DS only."] -pub const PMLAUNCHFLAG_FORCE_USE_O3DS_MAX_APP_MEM: _bindgen_ty_26 = 512; -pub const PMLAUNCHFLAG_USE_UPDATE_TITLE: _bindgen_ty_26 = 65536; -#[doc = "Launch flags for PM launch commands."] -pub type _bindgen_ty_26 = ::libc::c_uint; -extern "C" { - #[must_use] - #[doc = "Initializes pm:app."] - pub fn pmAppInit() -> Result; -} -extern "C" { - #[doc = "Exits pm:app."] - pub fn pmAppExit(); -} -extern "C" { - #[doc = "Gets the current pm:app session handle.\n # Returns\n\nThe current pm:app session handle."] - pub fn pmAppGetSessionHandle() -> *mut Handle; -} -extern "C" { - #[must_use] - #[doc = "Launches a title.\n # Arguments\n\n* `programInfo` - Program information of the title.\n * `launchFlags` - Flags to launch the title with."] - pub fn PMAPP_LaunchTitle(programInfo: *const FS_ProgramInfo, launchFlags: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Launches a title, applying patches.\n # Arguments\n\n* `programInfo` - Program information of the title.\n * `programInfoUpdate` - Program information of the update title.\n * `launchFlags` - Flags to launch the title with."] - pub fn PMAPP_LaunchTitleUpdate( - programInfo: *const FS_ProgramInfo, - programInfoUpdate: *const FS_ProgramInfo, - launchFlags: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets a title's ExHeader Arm11CoreInfo and SystemInfo flags.\n # Arguments\n\n* `outCoreInfo` (direction out) - Pointer to write the ExHeader Arm11CoreInfo to.\n * `outSiFlags` (direction out) - Pointer to write the ExHeader SystemInfo flags to.\n * `programInfo` - Program information of the title."] - pub fn PMAPP_GetTitleExheaderFlags( - outCoreInfo: *mut ExHeader_Arm11CoreInfo, - outSiFlags: *mut ExHeader_SystemInfoFlags, - programInfo: *const FS_ProgramInfo, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the current FIRM launch parameters.\n # Arguments\n\n* `size` - Size of the FIRM launch parameter buffer.\n * `in` - Buffer to retrieve the launch parameters from."] - pub fn PMAPP_SetFIRMLaunchParams(size: u32_, in_: *const ::libc::c_void) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the current FIRM launch parameters.\n # Arguments\n\n* `size` - Size of the FIRM launch parameter buffer.\n * `out` (direction out) - Buffer to write the launch parameters to."] - pub fn PMAPP_GetFIRMLaunchParams(out: *mut ::libc::c_void, size: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the current FIRM launch parameters.\n # Arguments\n\n* `firmTidLow` - Low Title ID of the FIRM title to launch.\n * `size` - Size of the FIRM launch parameter buffer.\n * `in` - Buffer to retrieve the launch parameters from."] - pub fn PMAPP_LaunchFIRMSetParams( - firmTidLow: u32_, - size: u32_, - in_: *const ::libc::c_void, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Terminate most processes, to prepare for a reboot or a shutdown.\n # Arguments\n\n* `timeout` - Time limit in ns for process termination, after which the remaining processes are killed."] - pub fn PMAPP_PrepareForReboot(timeout: s64) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Terminates the current Application\n # Arguments\n\n* `timeout` - Timeout in nanoseconds"] - pub fn PMAPP_TerminateCurrentApplication(timeout: s64) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Terminates the processes having the specified titleId.\n # Arguments\n\n* `titleId` - Title ID of the processes to terminate\n * `timeout` - Timeout in nanoseconds"] - pub fn PMAPP_TerminateTitle(titleId: u64_, timeout: s64) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Terminates the specified process\n # Arguments\n\n* `pid` - Process-ID of the process to terminate\n * `timeout` - Timeout in nanoseconds"] - pub fn PMAPP_TerminateProcess(pid: u32_, timeout: s64) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Unregisters a process\n # Arguments\n\n* `tid` - TitleID of the process to unregister"] - pub fn PMAPP_UnregisterProcess(tid: u64_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the APPLICATION cputime reslimit.\n # Arguments\n\n* `cpuTime` - Reslimit value.\n > **Note:** cpuTime can be no higher than reslimitdesc[0] & 0x7F in exheader (or 80 if the latter is 0)."] - pub fn PMAPP_SetAppResourceLimit(cpuTime: s64) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the APPLICATION cputime reslimit.\n # Arguments\n\n* `cpuTime` (direction out) - Pointer to write the reslimit value to."] - pub fn PMAPP_GetAppResourceLimit(outCpuTime: *mut s64) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initializes pm:dbg."] - pub fn pmDbgInit() -> Result; -} -extern "C" { - #[doc = "Exits pm:dbg."] - pub fn pmDbgExit(); -} -extern "C" { - #[doc = "Gets the current pm:dbg session handle.\n # Returns\n\nThe current pm:dbg session handle."] - pub fn pmDbgGetSessionHandle() -> *mut Handle; -} -extern "C" { - #[must_use] - #[doc = "Enqueues an application for debug after setting cpuTime to 0, and returns a debug handle to it.\n If another process was enqueued, this just calls RunQueuedProcess instead.\n # Arguments\n\n* `Pointer` (direction out) - to output the debug handle to.\n * `programInfo` - Program information of the title.\n * `launchFlags` - Flags to launch the title with."] - pub fn PMDBG_LaunchAppDebug( - outDebug: *mut Handle, - programInfo: *const FS_ProgramInfo, - launchFlags: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Launches an application for debug after setting cpuTime to 0.\n # Arguments\n\n* `programInfo` - Program information of the title.\n * `launchFlags` - Flags to launch the title with."] - pub fn PMDBG_LaunchApp(programInfo: *const FS_ProgramInfo, launchFlags: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Runs the queued process and returns a debug handle to it.\n # Arguments\n\n* `Pointer` (direction out) - to output the debug handle to."] - pub fn PMDBG_RunQueuedProcess(outDebug: *mut Handle) -> Result; -} -#[doc = "< CBC encryption."] -pub const PS_ALGORITHM_CBC_ENC: PS_AESAlgorithm = 0; -#[doc = "< CBC decryption."] -pub const PS_ALGORITHM_CBC_DEC: PS_AESAlgorithm = 1; -#[doc = "< CTR encryption."] -pub const PS_ALGORITHM_CTR_ENC: PS_AESAlgorithm = 2; -#[doc = "< CTR decryption(same as PS_ALGORITHM_CTR_ENC)."] -pub const PS_ALGORITHM_CTR_DEC: PS_AESAlgorithm = 3; -#[doc = "< CCM encryption."] -pub const PS_ALGORITHM_CCM_ENC: PS_AESAlgorithm = 4; -#[doc = "< CCM decryption."] -pub const PS_ALGORITHM_CCM_DEC: PS_AESAlgorithm = 5; -#[doc = "PS AES algorithms."] -pub type PS_AESAlgorithm = ::libc::c_uint; -#[doc = "< Key slot 0x0D."] -pub const PS_KEYSLOT_0D: PS_AESKeyType = 0; -#[doc = "< Key slot 0x2D."] -pub const PS_KEYSLOT_2D: PS_AESKeyType = 1; -#[doc = "< Key slot 0x31."] -pub const PS_KEYSLOT_31: PS_AESKeyType = 2; -#[doc = "< Key slot 0x38."] -pub const PS_KEYSLOT_38: PS_AESKeyType = 3; -#[doc = "< Key slot 0x32."] -pub const PS_KEYSLOT_32: PS_AESKeyType = 4; -#[doc = "< Key slot 0x39. (DLP)"] -pub const PS_KEYSLOT_39_DLP: PS_AESKeyType = 5; -#[doc = "< Key slot 0x2E."] -pub const PS_KEYSLOT_2E: PS_AESKeyType = 6; -#[doc = "< Invalid key slot."] -pub const PS_KEYSLOT_INVALID: PS_AESKeyType = 7; -#[doc = "< Key slot 0x36."] -pub const PS_KEYSLOT_36: PS_AESKeyType = 8; -#[doc = "< Key slot 0x39. (NFC)"] -pub const PS_KEYSLOT_39_NFC: PS_AESKeyType = 9; -#[doc = "PS key slots."] -pub type PS_AESKeyType = ::libc::c_uint; -#[doc = "RSA context."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct psRSAContext { - pub modulo: [u8_; 256usize], - pub exponent: [u8_; 256usize], - pub rsa_bitsize: u32_, - pub unk: u32_, -} -impl Default for psRSAContext { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -extern "C" { - #[must_use] - #[doc = "Initializes PS."] - pub fn psInit() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initializes PS with the specified session handle.\n # Arguments\n\n* `handle` - Session handle."] - pub fn psInitHandle(handle: Handle) -> Result; -} -extern "C" { - #[doc = "Exits PS."] - pub fn psExit(); -} -extern "C" { - #[doc = "Returns the PS session handle."] - pub fn psGetSessionHandle() -> Handle; -} -extern "C" { - #[must_use] - #[doc = "Signs a RSA signature.\n # Arguments\n\n* `hash` - SHA256 hash to sign.\n * `ctx` - RSA context.\n * `signature` - RSA signature."] - pub fn PS_SignRsaSha256(hash: *mut u8_, ctx: *mut psRSAContext, signature: *mut u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Verifies a RSA signature.\n # Arguments\n\n* `hash` - SHA256 hash to compare with.\n * `ctx` - RSA context.\n * `signature` - RSA signature."] - pub fn PS_VerifyRsaSha256( - hash: *mut u8_, - ctx: *mut psRSAContext, - signature: *mut u8_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Encrypts/Decrypts AES data. Does not support AES CCM.\n # Arguments\n\n* `size` - Size of the data.\n * `in` - Input buffer.\n * `out` - Output buffer.\n * `aes_algo` - AES algorithm to use.\n * `key_type` - Key type to use.\n * `iv` - Pointer to the CTR/IV. The output CTR/IV is also written here."] - 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" { - #[must_use] - #[doc = "Encrypts/Decrypts signed AES CCM data.\n When decrypting, if the MAC is invalid, 0xC9010401 is returned. After encrypting the MAC is located at inputbufptr.\n # Arguments\n\n* `in` - Input buffer.\n * `in_size` - Size of the input buffer. Must include MAC size when decrypting.\n * `out` - Output buffer.\n * `out_size` - Size of the output buffer. Must include MAC size when encrypting.\n * `data_len` - Length of the data to be encrypted/decrypted.\n * `mac_data_len` - Length of the MAC data.\n * `mac_len` - Length of the MAC.\n * `aes_algo` - AES algorithm to use.\n * `key_type` - Key type to use.\n * `nonce` - Pointer to the nonce."] - 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" { - #[must_use] - #[doc = "Gets the 64-bit console friend code seed.\n # Arguments\n\n* `seed` - Pointer to write the friend code seed to."] - pub fn PS_GetLocalFriendCodeSeed(seed: *mut u64_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the 32-bit device ID.\n # Arguments\n\n* `device_id` - Pointer to write the device ID to."] - pub fn PS_GetDeviceId(device_id: *mut u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Generates cryptographically secure random bytes.\n # Arguments\n\n* `out` - Pointer to the buffer to write the bytes to.\n * `len` - Number of bytes to write."] - pub fn PS_GenerateRandomBytes(out: *mut ::libc::c_void, len: usize) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initializes PTMU."] - pub fn ptmuInit() -> Result; -} -extern "C" { - #[doc = "Exits PTMU."] - pub fn ptmuExit(); -} -extern "C" { - #[doc = "Gets a pointer to the current ptm:u session handle.\n # Returns\n\nA pointer to the current ptm:u session handle."] - pub fn ptmuGetSessionHandle() -> *mut Handle; -} -extern "C" { - #[must_use] - #[doc = "Gets the system's current shell state.\n # Arguments\n\n* `out` - Pointer to write the current shell state to. (0 = closed, 1 = open)"] - pub fn PTMU_GetShellState(out: *mut u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the system's current battery level.\n # Arguments\n\n* `out` - Pointer to write the current battery level to. (0-5)"] - pub fn PTMU_GetBatteryLevel(out: *mut u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the system's current battery charge state.\n # Arguments\n\n* `out` - Pointer to write the current battery charge state to. (0 = not charging, 1 = charging)"] - pub fn PTMU_GetBatteryChargeState(out: *mut u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the system's current pedometer state.\n # Arguments\n\n* `out` - Pointer to write the current pedometer state to. (0 = not counting, 1 = counting)"] - pub fn PTMU_GetPedometerState(out: *mut u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the pedometer's total step count.\n # Arguments\n\n* `steps` - Pointer to write the total step count to."] - pub fn PTMU_GetTotalStepCount(steps: *mut u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets whether the adapter is plugged in or not\n # Arguments\n\n* `out` - Pointer to write the adapter state to."] - pub fn PTMU_GetAdapterState(out: *mut bool) -> Result; -} -#[doc = "PDN wake events and MCU interrupts to select, combined with those of other processes"] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct PtmWakeEvents { - #[doc = "< Written to PDN_WAKE_EVENTS. Don't select bit26 (MCU), PTM will do it automatically."] - pub pdn_wake_events: u32_, - #[doc = "< MCU interrupts to check when a MCU wake event happens."] - pub mcu_interupt_mask: u32_, -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct PtmSleepConfig { - #[doc = "< Wake events for which the system should fully wake up."] - pub exit_sleep_events: PtmWakeEvents, - #[doc = "< Wake events for which the system should return to sleep."] - pub continue_sleep_events: PtmWakeEvents, -} -#[doc = "< PTMSYSM_RequestSleep has been called (ack = 3)"] -pub const PTMNOTIFID_SLEEP_REQUESTED: _bindgen_ty_27 = 257; -#[doc = "< The sleep request has been denied by PTMSYSM_ReplyToSleepQuery(true) (no ack required)."] -pub const PTMNOTIFID_SLEEP_DENIED: _bindgen_ty_27 = 258; -#[doc = "< The sleep request has been allowed by PTMSYSM_ReplyToSleepQuery(false) (ack = 1)."] -pub const PTMNOTIFID_SLEEP_ALLOWED: _bindgen_ty_27 = 259; -#[doc = "< All processes not having \"RunnableOnSleep\" have been paused & the system is about to go to sleep (ack = 0)."] -pub const PTMNOTIFID_GOING_TO_SLEEP: _bindgen_ty_27 = 260; -#[doc = "< The system has been woken up, and the paused processes are about to be unpaused (ack = 1)."] -pub const PTMNOTIFID_FULLY_WAKING_UP: _bindgen_ty_27 = 261; -#[doc = "< The system is fully awake (no ack required)."] -pub const PTMNOTIFID_FULLY_AWAKE: _bindgen_ty_27 = 262; -#[doc = "< The system has been woken up but is about to go to sleep again (ack = 2)."] -pub const PTMNOTIFID_HALF_AWAKE: _bindgen_ty_27 = 263; -#[doc = "< The system is about to power off or reboot."] -pub const PTMNOTIFID_SHUTDOWN: _bindgen_ty_27 = 264; -#[doc = "< The battery level has reached 5% or below."] -pub const PTMNOTIFID_BATTERY_VERY_LOW: _bindgen_ty_27 = 529; -#[doc = "< The battery level has reached 10% or below."] -pub const PTMNOTIFID_BATTERY_LOW: _bindgen_ty_27 = 530; -pub type _bindgen_ty_27 = ::libc::c_uint; -extern "C" { - #[doc = "See PTMSYSM_NotifySleepPreparationComplete. Corresponds to the number of potentially remaning notifs. until sleep/wakeup."] - #[link_name = "ptmSysmGetNotificationAckValue__extern"] - pub fn ptmSysmGetNotificationAckValue(id: u32_) -> s32; -} -extern "C" { - #[must_use] - #[doc = "Initializes ptm:sysm."] - pub fn ptmSysmInit() -> Result; -} -extern "C" { - #[doc = "Exits ptm:sysm."] - pub fn ptmSysmExit(); -} -extern "C" { - #[doc = "Gets a pointer to the current ptm:sysm session handle.\n # Returns\n\nA pointer to the current ptm:sysm session handle."] - pub fn ptmSysmGetSessionHandle() -> *mut Handle; -} -extern "C" { - #[must_use] - #[doc = "Requests to enter sleep mode."] - pub fn PTMSYSM_RequestSleep() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Accepts or denies the incoming sleep mode request.\n # Arguments\n\n* `deny` - Whether or not to deny the sleep request.\n > **Note:** If deny = false, this is equivalent to calling PTMSYSM_NotifySleepPreparationComplete(3)"] - pub fn PTMSYSM_ReplyToSleepQuery(deny: bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Acknowledges the current sleep notification and advance the internal sleep mode FSM. All subscribers must reply.\n # Arguments\n\n* `ackValue` - Use ptmSysmGetNotificationAckValue\n > **Note:** PTMNOTIFID_SLEEP_DENIED and PTMNOTIFID_FULLY_AWAKE don't require this."] - pub fn PTMSYSM_NotifySleepPreparationComplete(ackValue: s32) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the wake events (two sets: when to fully wake up and when to return to sleep).\n # Arguments\n\n* `sleepConfig` - Pointer to the two sets of wake events.\n > **Note:** Can only be called just before acknowledging PTMNOTIFID_GOING_TO_SLEEP or PTMNOTIFID_HALF_AWAKE."] - pub fn PTMSYSM_SetWakeEvents(sleepConfig: *const PtmSleepConfig) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the wake reason (only the first applicable wake event is taken into account).\n # Arguments\n\n* `sleepConfig` - Pointer to the two sets of wake events. Only the relevant set will be filled."] - pub fn PTMSYSM_GetWakeReason(outSleepConfig: *mut PtmSleepConfig) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Cancels the \"half-awake\" state and fully wakes up the 3DS after some delay."] - pub fn PTMSYSM_Awaken() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the user time by updating the user time offset.\n # Arguments\n\n* `msY2k` - The number of milliseconds since 01/01/2000."] - pub fn PTMSYSM_SetUserTime(msY2k: s64) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Invalidates the \"system time\" (cfg block 0x30002)"] - pub fn PTMSYSM_InvalidateSystemTime() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Reads the time and date coming from the RTC and converts the result.\n # Arguments\n\n* `outMsY2k` (direction out) - The pointer to write the number of milliseconds since 01/01/2000 to."] - pub fn PTMSYSM_GetRtcTime(outMsY2k: *mut s64) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Writes the time and date coming to the RTC, after conversion.\n # Arguments\n\n* `msY2k` - The number of milliseconds since 01/01/2000."] - pub fn PTMSYSM_SetRtcTime(msY2k: s64) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Returns 1 if it's a New 3DS, otherwise 0."] - pub fn PTMSYSM_CheckNew3DS() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Configures the New 3DS' CPU clock speed and L2 cache.\n # Arguments\n\n* `value` - Bit0: enable higher clock, Bit1: enable L2 cache."] - pub fn PTMSYSM_ConfigureNew3DSCPU(value: u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Trigger a hardware system shutdown via the MCU.\n # Arguments\n\n* `timeout:` - timeout passed to PMApp:ShutdownAsync (PrepareForReboot)."] - pub fn PTMSYSM_ShutdownAsync(timeout: u64_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Trigger a hardware system reboot via the MCU.\n # Arguments\n\n* `timeout:` - timeout passed to PMApp:ShutdownAsync (PrepareForReboot)."] - pub fn PTMSYSM_RebootAsync(timeout: u64_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initializes PTMGETS."] - pub fn ptmGetsInit() -> Result; -} -extern "C" { - #[doc = "Exits PTMGETS."] - pub fn ptmGetsExit(); -} -extern "C" { - #[doc = "Gets a pointer to the current ptm:gets session handle.\n # Returns\n\nA pointer to the current ptm:gets session handle."] - pub fn ptmGetsGetSessionHandle() -> *mut Handle; -} -extern "C" { - #[must_use] - #[doc = "Gets the system time.\n # Arguments\n\n* `outMsY2k` (direction out) - The pointer to write the number of milliseconds since 01/01/2000 to."] - pub fn PTMGETS_GetSystemTime(outMsY2k: *mut s64) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initializes PTMSETS."] - pub fn ptmSetsInit() -> Result; -} -extern "C" { - #[doc = "Exits PTMSETS."] - pub fn ptmSetsExit(); -} -extern "C" { - #[doc = "Gets a pointer to the current ptm:sets session handle.\n # Returns\n\nA pointer to the current ptm:sets session handle."] - pub fn ptmSetsGetSessionHandle() -> *mut Handle; -} -extern "C" { - #[must_use] - #[doc = "Sets the system time.\n # Arguments\n\n* `msY2k` - The number of milliseconds since 01/01/2000."] - pub fn PTMSETS_SetSystemTime(msY2k: s64) -> Result; -} -#[doc = "< Do not wait."] -pub const WAIT_NONE: PXIDEV_WaitType = 0; -#[doc = "< Sleep for the specified number of nanoseconds."] -pub const WAIT_SLEEP: PXIDEV_WaitType = 1; -#[doc = "< Wait for IREQ, return if timeout."] -pub const WAIT_IREQ_RETURN: PXIDEV_WaitType = 2; -#[doc = "< Wait for IREQ, continue if timeout."] -pub const WAIT_IREQ_CONTINUE: PXIDEV_WaitType = 3; -#[doc = "Card SPI wait operation type."] -pub type PXIDEV_WaitType = ::libc::c_uint; -#[doc = "< Do not deassert."] -pub const DEASSERT_NONE: PXIDEV_DeassertType = 0; -#[doc = "< Deassert before waiting."] -pub const DEASSERT_BEFORE_WAIT: PXIDEV_DeassertType = 1; -#[doc = "< Deassert after waiting."] -pub const DEASSERT_AFTER_WAIT: PXIDEV_DeassertType = 2; -#[doc = "Card SPI register deassertion type."] -pub type PXIDEV_DeassertType = ::libc::c_uint; -#[doc = "Card SPI transfer buffer."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct PXIDEV_SPIBuffer { - #[doc = "< Data pointer."] - pub ptr: *mut ::libc::c_void, - #[doc = "< Data size."] - pub size: u32_, - #[doc = "< Transfer options. See pxiDevMakeTransferOption"] - pub transferOption: u8_, - #[doc = "< Wait operation. See pxiDevMakeWaitOperation"] - pub waitOperation: u64_, -} -impl Default for PXIDEV_SPIBuffer { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -extern "C" { - #[must_use] - #[doc = "Initializes pxi:dev."] - pub fn pxiDevInit() -> Result; -} -extern "C" { - #[doc = "Shuts down pxi:dev."] - pub fn pxiDevExit(); -} -extern "C" { - #[doc = "Creates a packed card SPI transfer option value.\n # Arguments\n\n* `baudRate` - Baud rate to use when transferring.\n * `busMode` - Bus mode to use when transferring.\n # Returns\n\nA packed card SPI transfer option value."] - #[link_name = "pxiDevMakeTransferOption__extern"] - pub fn pxiDevMakeTransferOption( - baudRate: FS_CardSpiBaudRate, - busMode: FS_CardSpiBusMode, - ) -> u8_; -} -extern "C" { - #[doc = "Creates a packed card SPI wait operation value.\n # Arguments\n\n* `waitType` - Type of wait to perform.\n * `deassertType` - Type of register deassertion to perform.\n * `timeout` - Timeout, in nanoseconds, to wait, if applicable.\n # Returns\n\nA packed card SPI wait operation value."] - #[link_name = "pxiDevMakeWaitOperation__extern"] - pub fn pxiDevMakeWaitOperation( - waitType: PXIDEV_WaitType, - deassertType: PXIDEV_DeassertType, - timeout: u64_, - ) -> u64_; -} -extern "C" { - #[must_use] - #[doc = "Performs multiple card SPI writes and reads.\n # Arguments\n\n* `header` - Header to lead the transfers with. Must be, at most, 8 bytes in size.\n * `writeBuffer1` - Buffer to make first transfer from.\n * `readBuffer1` - Buffer to receive first response to.\n * `writeBuffer2` - Buffer to make second transfer from.\n * `readBuffer2` - Buffer to receive second response to.\n * `footer` - Footer to follow the transfers with. Must be, at most, 8 bytes in size. Wait operation is unused."] - 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" { - #[must_use] - #[doc = "Performs a single card SPI write and read.\n # Arguments\n\n* `bytesRead` - Pointer to output the number of bytes received to.\n * `initialWaitOperation` - Wait operation to perform before transferring data.\n * `writeBuffer` - Buffer to transfer data from.\n * `readBuffer` - Buffer to receive data to."] - pub fn PXIDEV_SPIWriteRead( - bytesRead: *mut u32_, - initialWaitOperation: u64_, - writeBuffer: *mut PXIDEV_SPIBuffer, - readBuffer: *mut PXIDEV_SPIBuffer, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initializes PxiPM."] - pub fn pxiPmInit() -> Result; -} -extern "C" { - #[doc = "Exits PxiPM."] - pub fn pxiPmExit(); -} -extern "C" { - #[doc = "Gets the current PxiPM session handle.\n # Returns\n\nThe current PxiPM session handle."] - pub fn pxiPmGetSessionHandle() -> *mut Handle; -} -extern "C" { - #[must_use] - #[doc = "Retrives the exheader information set(s) (SCI+ACI) about a program.\n # Arguments\n\n* `exheaderInfos[out]` - Pointer to the output exheader information set.\n * `programHandle` - The program handle."] - pub fn PXIPM_GetProgramInfo(exheaderInfo: *mut ExHeader_Info, programHandle: u64_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Loads a program and registers it to Process9.\n # Arguments\n\n* `programHandle[out]` - Pointer to the output the program handle to.\n * `programInfo` - Information about the program to load.\n * `updateInfo` - Information about the program update to load."] - pub fn PXIPM_RegisterProgram( - programHandle: *mut u64_, - programInfo: *const FS_ProgramInfo, - updateInfo: *const FS_ProgramInfo, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Unloads a program and unregisters it from Process9.\n # Arguments\n\n* `programHandle` - The program handle."] - pub fn PXIPM_UnregisterProgram(programHandle: u64_) -> Result; -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct timezone { - pub tz_minuteswest: ::libc::c_int, - pub tz_dsttime: ::libc::c_int, -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct bintime { - pub sec: time_t, - pub frac: u64, -} -extern "C" { - #[link_name = "bintime_addx__extern"] - pub fn bintime_addx(_bt: *mut bintime, _x: u64); -} -extern "C" { - #[link_name = "bintime_add__extern"] - pub fn bintime_add(_bt: *mut bintime, _bt2: *const bintime); -} -extern "C" { - #[link_name = "bintime_sub__extern"] - pub fn bintime_sub(_bt: *mut bintime, _bt2: *const bintime); -} -extern "C" { - #[link_name = "bintime_mul__extern"] - pub fn bintime_mul(_bt: *mut bintime, _x: u_int); -} -extern "C" { - #[link_name = "bintime_shift__extern"] - pub fn bintime_shift(_bt: *mut bintime, _exp: ::libc::c_int); -} -extern "C" { - #[link_name = "sbintime_getsec__extern"] - pub fn sbintime_getsec(_sbt: sbintime_t) -> ::libc::c_int; -} -extern "C" { - #[link_name = "bttosbt__extern"] - pub fn bttosbt(_bt: bintime) -> sbintime_t; -} -extern "C" { - #[link_name = "sbttobt__extern"] - pub fn sbttobt(_sbt: sbintime_t) -> bintime; -} -extern "C" { - #[link_name = "sbttons__extern"] - pub fn sbttons(_sbt: sbintime_t) -> i64; -} -extern "C" { - #[link_name = "nstosbt__extern"] - pub fn nstosbt(_ns: i64) -> sbintime_t; -} -extern "C" { - #[link_name = "sbttous__extern"] - pub fn sbttous(_sbt: sbintime_t) -> i64; -} -extern "C" { - #[link_name = "ustosbt__extern"] - pub fn ustosbt(_us: i64) -> sbintime_t; -} -extern "C" { - #[link_name = "sbttoms__extern"] - pub fn sbttoms(_sbt: sbintime_t) -> i64; -} -extern "C" { - #[link_name = "mstosbt__extern"] - pub fn mstosbt(_ms: i64) -> sbintime_t; -} -extern "C" { - #[link_name = "bintime2timespec__extern"] - pub fn bintime2timespec(_bt: *const bintime, _ts: *mut timespec); -} -extern "C" { - #[link_name = "timespec2bintime__extern"] - pub fn timespec2bintime(_ts: *const timespec, _bt: *mut bintime); -} -extern "C" { - #[link_name = "bintime2timeval__extern"] - pub fn bintime2timeval(_bt: *const bintime, _tv: *mut timeval); -} -extern "C" { - #[link_name = "timeval2bintime__extern"] - pub fn timeval2bintime(_tv: *const timeval, _bt: *mut bintime); -} -extern "C" { - #[link_name = "sbttots__extern"] - pub fn sbttots(_sbt: sbintime_t) -> timespec; -} -extern "C" { - #[link_name = "tstosbt__extern"] - pub fn tstosbt(_ts: timespec) -> sbintime_t; -} -extern "C" { - #[link_name = "sbttotv__extern"] - pub fn sbttotv(_sbt: sbintime_t) -> timeval; -} -extern "C" { - #[link_name = "tvtosbt__extern"] - pub fn tvtosbt(_tv: timeval) -> sbintime_t; -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct itimerval { - pub it_interval: timeval, - pub it_value: timeval, -} -pub type __ULong = ::libc::c_ulong; -pub type _flock_t = _LOCK_RECURSIVE_T; -#[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], -} -impl Default for _Bigint { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Debug, Default, 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, -} -impl Default for _on_exit_args { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[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, -} -impl Default for _atexit { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __sbuf { - pub _base: *mut ::libc::c_uchar, - pub _size: ::libc::c_int, -} -impl Default for __sbuf { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[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, -} -impl Default for __sFILE { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -pub type __FILE = __sFILE; -extern "C" { - pub static mut __sf: [__FILE; 3usize]; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _glue { - pub _next: *mut _glue, - pub _niobs: ::libc::c_int, - pub _iobs: *mut __FILE, -} -impl Default for _glue { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -extern "C" { - pub static mut __sglue: _glue; -} -#[repr(C)] -#[derive(Debug, Default, 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 _locale: *mut __locale_t, - 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 _sig_func: *mut ::core::option::Option, - pub deviceData: *mut ::libc::c_void, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union _reent__bindgen_ty_1 { - pub _reent: _reent__bindgen_ty_1__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct _reent__bindgen_ty_1__bindgen_ty_1 { - 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 _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, -} -impl Default for _reent__bindgen_ty_1__bindgen_ty_1 { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl Default for _reent__bindgen_ty_1 { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl Default for _reent { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -extern "C" { - pub static mut _impure_ptr: *mut _reent; -} -extern "C" { - pub static mut _impure_data: _reent; -} -extern "C" { - pub static mut __atexit: *mut _atexit; -} -extern "C" { - pub static mut __atexit0: _atexit; -} -extern "C" { - pub static mut __stdio_exit_handler: ::core::option::Option; -} -extern "C" { - pub fn _reclaim_reent(arg1: *mut _reent); -} -extern "C" { - pub fn _fwalk_sglue( - arg1: *mut _reent, - arg2: ::core::option::Option< - unsafe extern "C" fn(arg1: *mut _reent, arg2: *mut __FILE) -> ::libc::c_int, - >, - arg3: *mut _glue, - ) -> ::libc::c_int; -} -pub type locale_t = *mut __locale_t; -#[repr(C)] -#[derive(Debug, Default, 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); -} -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, -} -impl Default for sigval { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct sigevent { - pub sigev_notify: ::libc::c_int, - pub sigev_signo: ::libc::c_int, - pub sigev_value: sigval, - pub sigev_notify_function: ::core::option::Option, - pub sigev_notify_attributes: *mut pthread_attr_t, -} -impl Default for sigevent { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[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, -} -impl Default for siginfo_t { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -pub type _sig_func_ptr = ::core::option::Option; -#[repr(C)] -#[derive(Debug, Default, 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, -} -impl Default for sigaltstack { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -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; -} -extern "C" { - pub fn sig2str(arg1: ::libc::c_int, arg2: *mut ::libc::c_char) -> ::libc::c_int; -} -extern "C" { - pub fn str2sig(arg1: *const ::libc::c_char, arg2: *mut ::libc::c_int) -> ::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(arg1: *const ::libc::c_char, arg2: *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, Default)] -pub struct sockaddr { - pub sa_family: sa_family_t, - pub sa_data: __IncompleteArrayField<::libc::c_char>, -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct sockaddr_storage { - pub ss_family: sa_family_t, - pub __ss_padding: [::libc::c_char; 26usize], -} -#[repr(C)] -#[derive(Debug, Default, 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, Default, Copy, Clone)] -pub struct in_addr { - pub s_addr: in_addr_t, -} -#[repr(C)] -#[derive(Debug, Default, 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, Default, Copy, Clone)] -pub struct ip_mreq { - pub imr_multiaddr: in_addr, - pub imr_interface: in_addr, -} -#[doc = "< The mac address of the interface (u32 mac[6])"] -pub const NETOPT_MAC_ADDRESS: NetworkOpt = 4100; -#[doc = "< The ARP table [`SOCU_ARPTableEntry`]"] -pub const NETOPT_ARP_TABLE: NetworkOpt = 12290; -#[doc = "< The current IP setup [`SOCU_IPInfo`]"] -pub const NETOPT_IP_INFO: NetworkOpt = 16387; -#[doc = "< The value of the IP MTU (u32)"] -pub const NETOPT_IP_MTU: NetworkOpt = 16388; -#[doc = "< The routing table [`SOCU_RoutingTableEntry`]"] -pub const NETOPT_ROUTING_TABLE: NetworkOpt = 16390; -#[doc = "< The number of sockets in the UDP table (u32)"] -pub const NETOPT_UDP_NUMBER: NetworkOpt = 32770; -#[doc = "< The table of opened UDP sockets [`SOCU_UDPTableEntry`]"] -pub const NETOPT_UDP_TABLE: NetworkOpt = 32771; -#[doc = "< The number of sockets in the TCP table (u32)"] -pub const NETOPT_TCP_NUMBER: NetworkOpt = 36866; -#[doc = "< The table of opened TCP sockets [`SOCU_TCPTableEntry`]"] -pub const NETOPT_TCP_TABLE: NetworkOpt = 36867; -#[doc = "< The table of the DNS servers [`SOCU_DNSTableEntry`] -- Returns a buffer of size 336 but only 2 entries are set ?"] -pub const NETOPT_DNS_TABLE: NetworkOpt = 45059; -#[doc = "< The DHCP lease time remaining, in seconds"] -pub const NETOPT_DHCP_LEASE_TIME: NetworkOpt = 49153; -#[doc = "Options to be used with SOCU_GetNetworkOpt"] -pub type NetworkOpt = ::libc::c_uint; -#[doc = "One entry of the ARP table retrieved by using SOCU_GetNetworkOpt and NETOPT_ARP_TABLE"] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct SOCU_ARPTableEntry { - pub unk0: u32_, - #[doc = "< The IPv4 address associated to the entry"] - pub ip: in_addr, - #[doc = "< The MAC address of associated to the entry"] - pub mac: [u8_; 6usize], - pub padding: [u8_; 2usize], -} -#[doc = "Structure returned by SOCU_GetNetworkOpt when using NETOPT_IP_INFO"] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct SOCU_IPInfo { - #[doc = "< Current IPv4 address"] - pub ip: in_addr, - #[doc = "< Current network mask"] - pub netmask: in_addr, - #[doc = "< Current network broadcast address"] - pub broadcast: in_addr, -} -#[doc = "One entry of the routing table retrieved by using SOCU_GetNetworkOpt and NETOPT_ROUTING_TABLE"] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct SOCU_RoutingTableEntry { - #[doc = "< Destination IP address of the route"] - pub dest_ip: in_addr, - #[doc = "< Mask used for this route"] - pub netmask: in_addr, - #[doc = "< Gateway address to reach the network"] - pub gateway: in_addr, - #[doc = "< Linux netstat flags [`ROUTING_FLAG_G`]"] - pub flags: u32_, - #[doc = "< number of milliseconds since 1st Jan 1900 00:00."] - pub time: u64_, -} -#[doc = "One entry of the UDP sockets table retrieved by using SOCU_GetNetworkOpt and NETOPT_UDP_TABLE"] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct SOCU_UDPTableEntry { - #[doc = "< Local address information"] - pub local: sockaddr_storage, - #[doc = "< Remote address information"] - pub remote: sockaddr_storage, -} -#[doc = "One entry of the TCP sockets table retrieved by using SOCU_GetNetworkOpt and NETOPT_TCP_TABLE"] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct SOCU_TCPTableEntry { - #[doc = "< [`TCP`] states defines"] - pub state: u32_, - #[doc = "< Local address information"] - pub local: sockaddr_storage, - #[doc = "< Remote address information"] - pub remote: sockaddr_storage, -} -#[doc = "One entry of the DNS servers table retrieved by using SOCU_GetNetworkOpt and NETOPT_DNS_TABLE"] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct SOCU_DNSTableEntry { - pub family: u32_, - #[doc = "Family of the address of the DNS server"] - pub ip: in_addr, - #[doc = "IP of the DNS server"] - pub padding: [u8_; 12usize], -} -extern "C" { - #[must_use] - #[doc = "Initializes the SOC service.\n # Arguments\n\n* `context_addr` - Address of a page-aligned (0x1000) buffer to be used.\n * `context_size` - Size of the buffer, a multiple of 0x1000.\n > **Note:** The specified context buffer can no longer be accessed by the process which called this function, since the userland permissions for this block are set to no-access."] - pub fn socInit(context_addr: *mut u32_, context_size: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Closes the soc service.\n > **Note:** You need to call this in order to be able to use the buffer again."] - pub fn socExit() -> Result; -} -extern "C" { - #[doc = "Gets the system's host ID.\n # Returns\n\nThe system's host ID."] - 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" { - #[doc = "Retrieves information from the network configuration. Similar to getsockopt().\n # Arguments\n\n* `level` - Only value allowed seems to be SOL_CONFIG\n * `optname` - The option to be retrieved\n * `optval` - Will contain the output of the command\n * `optlen` - Size of the optval buffer, will be updated to hold the size of the output\n # Returns\n\n0 if successful. -1 if failed, and errno will be set accordingly. Can also return a system error code."] - pub fn SOCU_GetNetworkOpt( - level: ::libc::c_int, - optname: NetworkOpt, - optval: *mut ::libc::c_void, - optlen: *mut socklen_t, - ) -> ::libc::c_int; -} -extern "C" { - #[doc = "Gets the system's IP address, netmask, and subnet broadcast\n # Returns\n\nerror"] - pub fn SOCU_GetIPInfo( - ip: *mut in_addr, - netmask: *mut in_addr, - broadcast: *mut in_addr, - ) -> ::libc::c_int; -} -extern "C" { - #[doc = "Adds a global socket.\n # Arguments\n\n* `sockfd` - The socket fd.\n # Returns\n\nerror"] - pub fn SOCU_AddGlobalSocket(sockfd: ::libc::c_int) -> ::libc::c_int; -} -#[doc = "< Unsigned 8-bit PCM."] -pub const MICU_ENCODING_PCM8: MICU_Encoding = 0; -#[doc = "< Unsigned 16-bit PCM."] -pub const MICU_ENCODING_PCM16: MICU_Encoding = 1; -#[doc = "< Signed 8-bit PCM."] -pub const MICU_ENCODING_PCM8_SIGNED: MICU_Encoding = 2; -#[doc = "< Signed 16-bit PCM."] -pub const MICU_ENCODING_PCM16_SIGNED: MICU_Encoding = 3; -#[doc = "Microphone audio encodings."] -pub type MICU_Encoding = ::libc::c_uint; -#[doc = "< 32728.498 Hz"] -pub const MICU_SAMPLE_RATE_32730: MICU_SampleRate = 0; -#[doc = "< 16364.479 Hz"] -pub const MICU_SAMPLE_RATE_16360: MICU_SampleRate = 1; -#[doc = "< 10909.499 Hz"] -pub const MICU_SAMPLE_RATE_10910: MICU_SampleRate = 2; -#[doc = "< 8182.1245 Hz"] -pub const MICU_SAMPLE_RATE_8180: MICU_SampleRate = 3; -#[doc = "Microphone audio sampling rates."] -pub type MICU_SampleRate = ::libc::c_uint; -extern "C" { - #[must_use] - #[doc = "Initializes MIC.\n # Arguments\n\n* `size` - Shared memory buffer to write audio data to. Must be aligned to 0x1000 bytes.\n * `handle` - Size of the shared memory buffer."] - pub fn micInit(buffer: *mut u8_, bufferSize: u32_) -> Result; -} -extern "C" { - #[doc = "Exits MIC."] - pub fn micExit(); -} -extern "C" { - #[doc = "Gets the size of the sample data area within the shared memory buffer.\n # Returns\n\nThe sample data's size."] - pub fn micGetSampleDataSize() -> u32_; -} -extern "C" { - #[doc = "Gets the offset within the shared memory buffer of the last sample written.\n # Returns\n\nThe last sample's offset."] - pub fn micGetLastSampleOffset() -> u32_; -} -extern "C" { - #[must_use] - #[doc = "Maps MIC shared memory.\n # Arguments\n\n* `size` - Size of the shared memory.\n * `handle` - Handle of the shared memory."] - pub fn MICU_MapSharedMem(size: u32_, handle: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Unmaps MIC shared memory."] - pub fn MICU_UnmapSharedMem() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Begins sampling microphone input.\n # Arguments\n\n* `encoding` - Encoding of outputted audio.\n * `sampleRate` - Sample rate of outputted audio.\n * `sharedMemAudioOffset` - Offset to write audio data to in the shared memory buffer.\n * `sharedMemAudioSize` - Size of audio data to write to the shared memory buffer. This should be at most \"bufferSize - 4\".\n * `loop` - Whether to loop back to the beginning of the buffer when the end is reached."] - pub fn MICU_StartSampling( - encoding: MICU_Encoding, - sampleRate: MICU_SampleRate, - offset: u32_, - size: u32_, - loop_: bool, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Adjusts the configuration of the current sampling session.\n # Arguments\n\n* `sampleRate` - Sample rate of outputted audio."] - pub fn MICU_AdjustSampling(sampleRate: MICU_SampleRate) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Stops sampling microphone input."] - pub fn MICU_StopSampling() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets whether microphone input is currently being sampled.\n # Arguments\n\n* `sampling` - Pointer to output the sampling state to."] - pub fn MICU_IsSampling(sampling: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets an event handle triggered when the shared memory buffer is full.\n # Arguments\n\n* `handle` - Pointer to output the event handle to."] - pub fn MICU_GetEventHandle(handle: *mut Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the microphone's gain.\n # Arguments\n\n* `gain` - Gain to set."] - pub fn MICU_SetGain(gain: u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the microphone's gain.\n # Arguments\n\n* `gain` - Pointer to output the current gain to."] - pub fn MICU_GetGain(gain: *mut u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets whether the microphone is powered on.\n # Arguments\n\n* `power` - Whether the microphone is powered on."] - pub fn MICU_SetPower(power: bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets whether the microphone is powered on.\n # Arguments\n\n* `power` - Pointer to output the power state to."] - pub fn MICU_GetPower(power: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets whether to clamp microphone input.\n # Arguments\n\n* `clamp` - Whether to clamp microphone input."] - pub fn MICU_SetClamp(clamp: bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets whether to clamp microphone input.\n # Arguments\n\n* `clamp` - Pointer to output the clamp state to."] - pub fn MICU_GetClamp(clamp: *mut bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets whether to allow sampling when the shell is closed.\n # Arguments\n\n* `allowShellClosed` - Whether to allow sampling when the shell is closed."] - pub fn MICU_SetAllowShellClosed(allowShellClosed: bool) -> Result; -} -#[doc = "< Converting color formats."] -pub const MVDMODE_COLORFORMATCONV: MVDSTD_Mode = 0; -#[doc = "< Processing video."] -pub const MVDMODE_VIDEOPROCESSING: MVDSTD_Mode = 1; -#[doc = "Processing mode."] -pub type MVDSTD_Mode = ::libc::c_uint; -#[doc = "< YUYV422"] -pub const MVD_INPUT_YUYV422: MVDSTD_InputFormat = 65537; -#[doc = "< H264"] -pub const MVD_INPUT_H264: MVDSTD_InputFormat = 131073; -#[doc = "Input format."] -pub type MVDSTD_InputFormat = ::libc::c_uint; -#[doc = "< YUYV422"] -pub const MVD_OUTPUT_YUYV422: MVDSTD_OutputFormat = 65537; -#[doc = "< BGR565"] -pub const MVD_OUTPUT_BGR565: MVDSTD_OutputFormat = 262146; -#[doc = "< RGB565"] -pub const MVD_OUTPUT_RGB565: MVDSTD_OutputFormat = 262148; -#[doc = "Output format."] -pub type MVDSTD_OutputFormat = ::libc::c_uint; -#[doc = "Processing configuration."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct MVDSTD_Config { - #[doc = "< Input type."] - pub input_type: MVDSTD_InputFormat, - #[doc = "< Unknown."] - pub unk_x04: u32_, - #[doc = "< Unknown. Referred to as \"H264 range\" in SKATER."] - pub unk_x08: u32_, - #[doc = "< Input width."] - pub inwidth: u32_, - #[doc = "< Input height."] - pub inheight: u32_, - #[doc = "< Physical address of color conversion input data."] - pub physaddr_colorconv_indata: u32_, - #[doc = "< Physical address used with color conversion."] - pub physaddr_colorconv_unk0: u32_, - #[doc = "< Physical address used with color conversion."] - pub physaddr_colorconv_unk1: u32_, - #[doc = "< Physical address used with color conversion."] - pub physaddr_colorconv_unk2: u32_, - #[doc = "< Physical address used with color conversion."] - pub physaddr_colorconv_unk3: u32_, - #[doc = "< Unknown."] - pub unk_x28: [u32_; 6usize], - #[doc = "< Enables cropping with the input image when non-zero via the following 4 words."] - 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_, - #[doc = "< Unknown."] - pub unk_x54: u32_, - #[doc = "< Output type."] - pub output_type: MVDSTD_OutputFormat, - #[doc = "< Output width."] - pub outwidth: u32_, - #[doc = "< Output height."] - pub outheight: u32_, - #[doc = "< Physical address of output data."] - pub physaddr_outdata0: u32_, - #[doc = "< Additional physical address for output data, only used when the output format type is value 0x00020001."] - pub physaddr_outdata1: u32_, - #[doc = "< Unknown."] - pub unk_x6c: [u32_; 38usize], - #[doc = "< This enables using the following 4 words when non-zero."] - pub flag_x104: u32_, - #[doc = "< Output X position in the output buffer."] - pub output_x_pos: u32_, - #[doc = "< Same as above except for the Y pos."] - pub output_y_pos: u32_, - #[doc = "< Used for aligning the output width when larger than the output width. Overrides the output width when smaller than the output width."] - pub output_width_override: u32_, - #[doc = "< Same as output_width_override except for the output height."] - pub output_height_override: u32_, - pub unk_x118: u32_, -} -impl Default for MVDSTD_Config { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -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, -} -impl Default for MVDSTD_OutputBuffersEntry { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct MVDSTD_OutputBuffersEntryList { - pub total_entries: u32_, - pub entries: [MVDSTD_OutputBuffersEntry; 17usize], -} -impl Default for MVDSTD_OutputBuffersEntryList { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "This can be used to override the default input values for MVDSTD commands during initialization with video-processing. The default for these fields are all-zero, except for cmd1b_inval which is 1. See also here: https://www.3dbrew.org/wiki/MVD_Services"] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -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" { - #[must_use] - #[doc = "Initializes MVDSTD.\n # Arguments\n\n* `mode` - Mode to initialize MVDSTD to.\n * `input_type` - Type of input to process.\n * `output_type` - Type of output to produce.\n * `size` - Size of the work buffer, MVD_DEFAULT_WORKBUF_SIZE can be used for this. Only used when type == MVDMODE_VIDEOPROCESSING.\n * `initstruct` - Optional MVDSTD_InitStruct, this should be NULL normally."] - pub fn mvdstdInit( - mode: MVDSTD_Mode, - input_type: MVDSTD_InputFormat, - output_type: MVDSTD_OutputFormat, - size: u32_, - initstruct: *mut MVDSTD_InitStruct, - ) -> Result; -} -extern "C" { - #[doc = "Shuts down MVDSTD."] - pub fn mvdstdExit(); -} -extern "C" { - #[doc = "Generates a default MVDSTD configuration.\n # Arguments\n\n* `config` - Pointer to output the generated config to.\n * `input_width` - Input width.\n * `input_height` - Input height.\n * `output_width` - Output width.\n * `output_height` - Output height.\n * `vaddr_colorconv_indata` - Virtual address of the color conversion input data.\n * `vaddr_outdata0` - Virtual address of the output data.\n * `vaddr_outdata1` - Additional virtual address for output data, only used when the output format type is value 0x00020001."] - 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" { - #[must_use] - #[doc = "Run color-format-conversion.\n # Arguments\n\n* `config` - Pointer to the configuration to use."] - pub fn mvdstdConvertImage(config: *mut MVDSTD_Config) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Processes a video frame(specifically a NAL-unit).\n # Arguments\n\n* `inbuf_vaddr` - Input NAL-unit starting with the 3-byte \"00 00 01\" prefix. Must be located in linearmem.\n * `size` - Size of the input buffer.\n * `flag` - See here regarding this input flag: https://www.3dbrew.org/wiki/MVDSTD:ProcessNALUnit\n * `out` - Optional output MVDSTD_ProcessNALUnitOut structure."] - pub fn mvdstdProcessVideoFrame( - inbuf_vaddr: *mut ::libc::c_void, - size: usize, - flag: u32_, - out: *mut MVDSTD_ProcessNALUnitOut, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Renders the video frame.\n # Arguments\n\n* `config` - Optional pointer to the configuration to use. When NULL, MVDSTD_SetConfig() should have been used previously for this video.\n * `wait` - When true, wait for rendering to finish. When false, you can manually call this function repeatedly until it stops returning MVD_STATUS_BUSY."] - pub fn mvdstdRenderVideoFrame(config: *mut MVDSTD_Config, wait: bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the current configuration of MVDSTD.\n # Arguments\n\n* `config` - Pointer to the configuration to set."] - pub fn MVDSTD_SetConfig(config: *mut MVDSTD_Config) -> Result; -} -extern "C" { - #[must_use] - #[doc = "New3DS Internet Browser doesn't use this. Once done, rendered frames will be written to the output buffers specified by the entrylist instead of the output specified by configuration. See here: https://www.3dbrew.org/wiki/MVDSTD:SetupOutputBuffers\n # Arguments\n\n* `entrylist` - Input entrylist.\n * `bufsize` - Size of each buffer from the entrylist."] - pub fn mvdstdSetupOutputBuffers( - entrylist: *mut MVDSTD_OutputBuffersEntryList, - bufsize: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "New3DS Internet Browser doesn't use this. This overrides the entry0 output buffers originally setup by mvdstdSetupOutputBuffers(). See also here: https://www.3dbrew.org/wiki/MVDSTD:OverrideOutputBuffers\n # Arguments\n\n* `cur_outdata0` - Linearmem vaddr. The current outdata0 for this entry must match this value.\n * `cur_outdata1` - Linearmem vaddr. The current outdata1 for this entry must match this value.\n * `new_outdata0` - Linearmem vaddr. This is the new address to use for outaddr0.\n * `new_outdata1` - Linearmem vaddr. This is the new address to use for outaddr1."] - 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; -#[doc = "Unknown."] -pub const NFC_OpType_NFCTag: NFC_OpType = 2; -#[doc = "This is the default."] -pub const NFC_OpType_RawNFC: NFC_OpType = 3; -#[doc = "NFC operation type."] -pub type NFC_OpType = ::libc::c_uint; -pub const NFC_TagState_Uninitialized: NFC_TagState = 0; -#[doc = "nfcInit() was not used yet."] -pub const NFC_TagState_ScanningStopped: NFC_TagState = 1; -#[doc = "Not currently scanning for NFC tags. Set by nfcStopScanning() and nfcInit(), when successful."] -pub const NFC_TagState_Scanning: NFC_TagState = 2; -#[doc = "Currently scanning for NFC tags. Set by nfcStartScanning() when successful."] -pub const NFC_TagState_InRange: NFC_TagState = 3; -#[doc = "NFC tag is in range. The state automatically changes to this when the state was previously value 2, without using any NFC service commands."] -pub const NFC_TagState_OutOfRange: NFC_TagState = 4; -#[doc = "NFC tag is now out of range, where the NFC tag was previously in range. This occurs automatically without using any NFC service commands. Once this state is entered, it won't automatically change to anything else when the tag is moved in range again. Hence, if you want to keep doing tag scanning after this, you must stop+start scanning."] -pub const NFC_TagState_DataReady: NFC_TagState = 5; -pub type NFC_TagState = ::libc::c_uint; -pub const NFC_amiiboFlag_Setup: _bindgen_ty_28 = 16; -#[doc = "This indicates that the amiibo was setup with amiibo Settings. nfcGetAmiiboSettings() will return an all-zero struct when this is not set."] -pub const NFC_amiiboFlag_AppDataSetup: _bindgen_ty_28 = 32; -#[doc = "Bit4-7 are always clear with nfcGetAmiiboSettings() due to \"& 0xF\"."] -pub type _bindgen_ty_28 = ::libc::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct NFC_TagInfo { - pub id_offset_size: u16_, - #[doc = "\"u16 size/offset of the below ID data. Normally this is 0x7. When this is <=10, this field is the size of the below ID data. When this is >10, this is the offset of the 10-byte ID data, relative to structstart+4+. It's unknown in what cases this 10-byte ID data is used.\""] - pub unk_x2: u8_, - pub unk_x3: u8_, - pub id: [u8_; 40usize], -} -impl Default for NFC_TagInfo { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "AmiiboSettings structure, see also here: https://3dbrew.org/wiki/NFC:GetAmiiboSettings"] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct NFC_AmiiboSettings { - pub mii: [u8_; 96usize], - #[doc = "\"Owner Mii.\""] - pub nickname: [u16_; 11usize], - #[doc = "\"UTF-16BE Amiibo nickname.\""] - pub flags: u8_, - #[doc = "\"This is plaintext_amiibosettingsdata[0] & 0xF.\" See also the NFC_amiiboFlag enums."] - pub countrycodeid: u8_, - #[doc = "\"This is plaintext_amiibosettingsdata[1].\" \"Country Code ID, from the system which setup this amiibo.\""] - pub setupdate_year: u16_, - pub setupdate_month: u8_, - pub setupdate_day: u8_, - pub unk_x7c: [u8_; 44usize], -} -impl Default for NFC_AmiiboSettings { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "AmiiboConfig structure, see also here: https://3dbrew.org/wiki/NFC:GetAmiiboConfig"] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct NFC_AmiiboConfig { - pub lastwritedate_year: u16_, - pub lastwritedate_month: u8_, - pub lastwritedate_day: u8_, - pub write_counter: u16_, - pub characterID: [u8_; 3usize], - #[doc = "the first element is the collection ID, the second the character in this collection, the third the variant"] - pub series: u8_, - #[doc = "ID of the series"] - pub amiiboID: u16_, - #[doc = "ID shared by all exact same amiibo. Some amiibo are only distinguished by this one like regular SMB Series Mario and the gold one"] - pub type_: u8_, - #[doc = "Type of amiibo 0 = figure, 1 = card, 2 = plush"] - pub pagex4_byte3: u8_, - pub appdata_size: u16_, - #[doc = "\"NFC module writes hard-coded u8 value 0xD8 here. This is the size of the Amiibo AppData, apps can use this with the AppData R/W commands. ...\""] - pub zeros: [u8_; 48usize], -} -impl Default for NFC_AmiiboConfig { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "Used by nfcInitializeWriteAppData() internally, see also here: https://3dbrew.org/wiki/NFC:GetAppDataInitStruct"] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct NFC_AppDataInitStruct { - pub data_x0: [u8_; 12usize], - pub data_xc: [u8_; 48usize], -} -impl Default for NFC_AppDataInitStruct { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "Used by nfcWriteAppData() internally, see also: https://3dbrew.org/wiki/NFC:WriteAppData"] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct NFC_AppDataWriteStruct { - pub id: [u8_; 10usize], - pub id_size: u8_, - pub unused_xb: [u8_; 21usize], -} -extern "C" { - #[must_use] - #[doc = "Initializes NFC.\n # Arguments\n\n* `type` - See the NFC_OpType enum."] - pub fn nfcInit(type_: NFC_OpType) -> Result; -} -extern "C" { - #[doc = "Shuts down NFC."] - pub fn nfcExit(); -} -extern "C" { - #[doc = "Gets the NFC service handle.\n # Returns\n\nThe NFC service handle."] - pub fn nfcGetSessionHandle() -> Handle; -} -extern "C" { - #[must_use] - #[doc = "Starts scanning for NFC tags.\n # Arguments\n\n* `inval` - Unknown. See NFC_STARTSCAN_DEFAULTINPUT."] - pub fn nfcStartScanning(inval: u16_) -> Result; -} -extern "C" { - #[doc = "Stops scanning for NFC tags."] - pub fn nfcStopScanning(); -} -extern "C" { - #[must_use] - #[doc = "Read amiibo NFC data and load in memory."] - pub fn nfcLoadAmiiboData() -> Result; -} -extern "C" { - #[must_use] - #[doc = "If the tagstate is valid(NFC_TagState_DataReady or 6), it then sets the current tagstate to NFC_TagState_InRange."] - pub fn nfcResetTagScanState() -> Result; -} -extern "C" { - #[must_use] - #[doc = "This writes the amiibo data stored in memory to the actual amiibo data storage(which is normally the NFC data pages). This can only be used if NFC_LoadAmiiboData() was used previously."] - pub fn nfcUpdateStoredAmiiboData() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Returns the current NFC tag state.\n # Arguments\n\n* `state` - Pointer to write NFC tag state."] - pub fn nfcGetTagState(state: *mut NFC_TagState) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Returns the current TagInfo.\n # Arguments\n\n* `out` - Pointer to write the output TagInfo."] - pub fn nfcGetTagInfo(out: *mut NFC_TagInfo) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Opens the appdata, when the amiibo appdata was previously initialized. This must be used before reading/writing the appdata. See also: https://3dbrew.org/wiki/NFC:OpenAppData\n # Arguments\n\n* `amiibo_appid` - Amiibo AppID. See here: https://www.3dbrew.org/wiki/Amiibo"] - pub fn nfcOpenAppData(amiibo_appid: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "This initializes the appdata using the specified input, when the appdata previously wasn't initialized. If the appdata is already initialized, you must first use the amiibo Settings applet menu option labeled \"Delete amiibo Game Data\". This automatically writes the amiibo data into the actual data storage(normally NFC data pages). See also nfcWriteAppData().\n # Arguments\n\n* `amiibo_appid` - amiibo AppID. See also nfcOpenAppData().\n * `buf` - Input buffer.\n * `size` - Buffer size."] - pub fn nfcInitializeWriteAppData( - amiibo_appid: u32_, - buf: *const ::libc::c_void, - size: usize, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Reads the appdata. The size must be >=0xD8-bytes, but the actual used size is hard-coded to 0xD8. Note that areas of appdata which were never written to by applications are uninitialized in this output buffer.\n # Arguments\n\n* `buf` - Output buffer.\n * `size` - Buffer size."] - pub fn nfcReadAppData(buf: *mut ::libc::c_void, size: usize) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Writes the appdata, after nfcOpenAppData() was used successfully. The size should be <=0xD8-bytes. See also: https://3dbrew.org/wiki/NFC:WriteAppData\n # Arguments\n\n* `buf` - Input buffer.\n * `size` - Buffer size.\n * `taginfo` - TagInfo from nfcGetTagInfo()."] - pub fn nfcWriteAppData( - buf: *const ::libc::c_void, - size: usize, - taginfo: *mut NFC_TagInfo, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Returns the current AmiiboSettings.\n # Arguments\n\n* `out` - Pointer to write the output AmiiboSettings."] - pub fn nfcGetAmiiboSettings(out: *mut NFC_AmiiboSettings) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Returns the current AmiiboConfig.\n # Arguments\n\n* `out` - Pointer to write the output AmiiboConfig."] - pub fn nfcGetAmiiboConfig(out: *mut NFC_AmiiboConfig) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Starts scanning for NFC tags when initialized with NFC_OpType_RawNFC. See also: https://www.3dbrew.org/wiki/NFC:StartOtherTagScanning\n # Arguments\n\n* `unk0` - Same as nfcStartScanning() input.\n * `unk1` - Unknown."] - pub fn nfcStartOtherTagScanning(unk0: u16_, unk1: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "This sends a raw NFC command to the tag. This can only be used when initialized with NFC_OpType_RawNFC, and when the TagState is NFC_TagState_InRange. See also: https://www.3dbrew.org/wiki/NFC:SendTagCommand\n # Arguments\n\n* `inbuf` - Input buffer.\n * `insize` - Size of the input buffer.\n * `outbuf` - Output buffer.\n * `outsize` - Size of the output buffer.\n * `actual_transfer_size` - Optional output ptr to write the actual output-size to, can be NULL.\n * `microseconds` - Timing-related field in microseconds."] - 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" { - #[must_use] - #[doc = "Unknown. This can only be used when initialized with NFC_OpType_RawNFC, and when the TagState is NFC_TagState_InRange."] - pub fn nfcCmd21() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Unknown. This can only be used when initialized with NFC_OpType_RawNFC, and when the TagState is NFC_TagState_InRange."] - pub fn nfcCmd22() -> Result; -} -#[doc = "Notification header data."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -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" { - #[must_use] - #[doc = "Initializes NEWS."] - pub fn newsInit() -> Result; -} -extern "C" { - #[doc = "Exits NEWS."] - pub fn newsExit(); -} -extern "C" { - #[must_use] - #[doc = "Adds a notification to the home menu Notifications applet.\n # Arguments\n\n* `title` - UTF-16 title of the notification.\n * `titleLength` - Number of characters in the title, not including the null-terminator.\n * `message` - UTF-16 message of the notification, or NULL for no message.\n * `messageLength` - Number of characters in the message, not including the null-terminator.\n * `image` - Data of the image to show in the notification, or NULL for no image.\n * `imageSize` - Size of the image data in bytes.\n * `jpeg` - Whether the image is a JPEG or not."] - 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" { - #[must_use] - #[doc = "Gets current total notifications number.\n # Arguments\n\n* `num` - Pointer where total number will be saved."] - pub fn NEWS_GetTotalNotifications(num: *mut u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets a custom header for a specific notification.\n # Arguments\n\n* `news_id` - Identification number of the notification.\n * `header` - Pointer to notification header to set."] - pub fn NEWS_SetNotificationHeader(news_id: u32_, header: *const NotificationHeader) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the header of a specific notification.\n # Arguments\n\n* `news_id` - Identification number of the notification.\n * `header` - Pointer where header of the notification will be saved."] - pub fn NEWS_GetNotificationHeader(news_id: u32_, header: *mut NotificationHeader) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets a custom message for a specific notification.\n # Arguments\n\n* `news_id` - Identification number of the notification.\n * `message` - Pointer to UTF-16 message to set.\n * `size` - Size of message to set."] - pub fn NEWS_SetNotificationMessage(news_id: u32_, message: *const u16_, size: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the message of a specific notification.\n # Arguments\n\n* `news_id` - Identification number of the notification.\n * `message` - Pointer where UTF-16 message of the notification will be saved.\n * `size` - Pointer where size of the message data will be saved in bytes."] - pub fn NEWS_GetNotificationMessage( - news_id: u32_, - message: *mut u16_, - size: *mut u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets a custom image for a specific notification.\n # Arguments\n\n* `news_id` - Identification number of the notification.\n * `buffer` - Pointer to MPO image to set.\n * `size` - Size of the MPO image to set."] - pub fn NEWS_SetNotificationImage( - news_id: u32_, - buffer: *const ::libc::c_void, - size: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the image of a specific notification.\n # Arguments\n\n* `news_id` - Identification number of the notification.\n * `buffer` - Pointer where MPO image of the notification will be saved.\n * `size` - Pointer where size of the image data will be saved in bytes."] - pub fn NEWS_GetNotificationImage( - news_id: u32_, - buffer: *mut ::libc::c_void, - size: *mut u32_, - ) -> Result; -} -#[doc = "Head tracking coordinate pair."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct QTM_HeadTrackingInfoCoord { - #[doc = "< X coordinate."] - pub x: f32, - #[doc = "< Y coordinate."] - pub y: f32, -} -#[doc = "Head tracking info."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct QTM_HeadTrackingInfo { - #[doc = "< Flags."] - pub flags: [u8_; 5usize], - #[doc = "< Padding."] - pub padding: [u8_; 3usize], - #[doc = "< Unknown. Not used by System_Settings."] - pub floatdata_x08: f32, - #[doc = "< Head coordinates."] - pub coords0: [QTM_HeadTrackingInfoCoord; 4usize], - #[doc = "< Unknown. Not used by System_Settings."] - pub unk_x2c: [u32_; 5usize], -} -extern "C" { - #[must_use] - #[doc = "Initializes QTM."] - pub fn qtmInit() -> Result; -} -extern "C" { - #[doc = "Exits QTM."] - pub fn qtmExit(); -} -extern "C" { - #[doc = "Checks whether QTM is initialized.\n # Returns\n\nWhether QTM is initialized."] - pub fn qtmCheckInitialized() -> bool; -} -extern "C" { - #[doc = "Checks whether a head is fully detected.\n # Arguments\n\n* `info` - Tracking info to check."] - pub fn qtmCheckHeadFullyDetected(info: *mut QTM_HeadTrackingInfo) -> bool; -} -extern "C" { - #[must_use] - #[doc = "Converts QTM coordinates to screen coordinates.\n # Arguments\n\n* `coord` - Coordinates to convert.\n * `screen_width` - Width of the screen. Can be NULL to use the default value for the top screen.\n * `screen_height` - Height of the screen. Can be NULL to use the default value for the top screen.\n * `x` - Pointer to output the screen X coordinate to.\n * `y` - Pointer to output the screen Y coordinate to."] - pub fn qtmConvertCoordToScreen( - coord: *mut QTM_HeadTrackingInfoCoord, - screen_width: *mut f32, - screen_height: *mut f32, - x: *mut u32_, - y: *mut u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the current head tracking info.\n # Arguments\n\n* `val` - Normally 0.\n * `out` - Pointer to write head tracking info to."] - pub fn QTM_GetHeadTrackingInfo(val: u64_, out: *mut QTM_HeadTrackingInfo) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initializes srv:pm and the service API."] - pub fn srvPmInit() -> Result; -} -extern "C" { - #[doc = "Exits srv:pm and the service API."] - pub fn srvPmExit(); -} -extern "C" { - #[doc = "Gets the current srv:pm session handle.\n # Returns\n\nThe current srv:pm session handle."] - pub fn srvPmGetSessionHandle() -> *mut Handle; -} -extern "C" { - #[must_use] - #[doc = "Publishes a notification to a process.\n # Arguments\n\n* `notificationId` - ID of the notification.\n * `process` - Process to publish to."] - pub fn SRVPM_PublishToProcess(notificationId: u32_, process: Handle) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Publishes a notification to all processes.\n # Arguments\n\n* `notificationId` - ID of the notification."] - pub fn SRVPM_PublishToAll(notificationId: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Registers a process with SRV.\n # Arguments\n\n* `pid` - ID of the process.\n * `count` - Number of services within the service access control data.\n * `serviceAccessControlList` - Service Access Control list."] - pub fn SRVPM_RegisterProcess( - pid: u32_, - count: u32_, - serviceAccessControlList: *const [::libc::c_char; 8usize], - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Unregisters a process with SRV.\n # Arguments\n\n* `pid` - ID of the process."] - pub fn SRVPM_UnregisterProcess(pid: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initializes LOADER."] - pub fn loaderInit() -> Result; -} -extern "C" { - #[doc = "Exits LOADER."] - pub fn loaderExit(); -} -extern "C" { - #[must_use] - #[doc = "Loads a program and returns a process handle to the newly created process.\n # Arguments\n\n* `process` (direction out) - Pointer to output the process handle to.\n * `programHandle` - The handle of the program to load."] - pub fn LOADER_LoadProcess(process: *mut Handle, programHandle: u64_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Registers a program (along with its update).\n # Arguments\n\n* `programHandle` (direction out) - Pointer to output the program handle to.\n * `programInfo` - The program info.\n * `programInfo` - The program update info."] - pub fn LOADER_RegisterProgram( - programHandle: *mut u64_, - programInfo: *const FS_ProgramInfo, - programInfoUpdate: *const FS_ProgramInfo, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Unregisters a program (along with its update).\n # Arguments\n\n* `programHandle` - The handle of the program to unregister."] - pub fn LOADER_UnregisterProgram(programHandle: u64_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Retrives a program's main NCCH extended header info (SCI + ACI, see ExHeader_Info).\n # Arguments\n\n* `exheaderInfo` (direction out) - Pointer to output the main NCCH extended header info.\n * `programHandle` - The handle of the program to unregister"] - pub fn LOADER_GetProgramInfo(exheaderInfo: *mut ExHeader_Info, programHandle: u64_) -> Result; -} -#[doc = "< The normal mode of the led"] -pub const LED_NORMAL: powerLedState = 1; -#[doc = "< The led pulses slowly as it does in the sleep mode"] -pub const LED_SLEEP_MODE: powerLedState = 2; -#[doc = "< Switch off power led"] -pub const LED_OFF: powerLedState = 3; -#[doc = "< Red state of the led"] -pub const LED_RED: powerLedState = 4; -#[doc = "< Blue state of the led"] -pub const LED_BLUE: powerLedState = 5; -#[doc = "< Blinking red state of power led and notification led"] -pub const LED_BLINK_RED: powerLedState = 6; -pub type powerLedState = ::libc::c_uint; -extern "C" { - #[must_use] - #[doc = "Initializes mcuHwc."] - pub fn mcuHwcInit() -> Result; -} -extern "C" { - #[doc = "Exits mcuHwc."] - pub fn mcuHwcExit(); -} -extern "C" { - #[doc = "Gets the current mcuHwc session handle.\n # Returns\n\nA pointer to the current mcuHwc session handle."] - pub fn mcuHwcGetSessionHandle() -> *mut Handle; -} -extern "C" { - #[must_use] - #[doc = "Reads data from an i2c device3 register\n # Arguments\n\n* `reg` - Register number. See https://www.3dbrew.org/wiki/I2C_Registers#Device_3 for more info\n * `data` - Pointer to write the data to.\n * `size` - Size of data to be read"] - pub fn MCUHWC_ReadRegister(reg: u8_, data: *mut ::libc::c_void, size: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Writes data to a i2c device3 register\n # Arguments\n\n* `reg` - Register number. See https://www.3dbrew.org/wiki/I2C_Registers#Device_3 for more info\n * `data` - Pointer to write the data to.\n * `size` - Size of data to be written"] - pub fn MCUHWC_WriteRegister(reg: u8_, data: *const ::libc::c_void, size: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the battery voltage\n # Arguments\n\n* `voltage` - Pointer to write the battery voltage to."] - pub fn MCUHWC_GetBatteryVoltage(voltage: *mut u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the battery level\n # Arguments\n\n* `level` - Pointer to write the current battery level to."] - pub fn MCUHWC_GetBatteryLevel(level: *mut u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the sound slider level\n # Arguments\n\n* `level` - Pointer to write the slider level to."] - pub fn MCUHWC_GetSoundSliderLevel(level: *mut u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets Wifi LED state\n # Arguments\n\n* `state` - State of Wifi LED. (True/False)"] - pub fn MCUHWC_SetWifiLedState(state: bool) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets Power LED state\n # Arguments\n\n* `state` - powerLedState State of power LED."] - pub fn MCUHWC_SetPowerLedState(state: powerLedState) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets 3d slider level\n # Arguments\n\n* `level` - Pointer to write 3D slider level to."] - pub fn MCUHWC_Get3dSliderLevel(level: *mut u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the major MCU firmware version\n # Arguments\n\n* `out` - Pointer to write the major firmware version to."] - pub fn MCUHWC_GetFwVerHigh(out: *mut u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets the minor MCU firmware version\n # Arguments\n\n* `out` - Pointer to write the minor firmware version to."] - pub fn MCUHWC_GetFwVerLow(out: *mut u8_) -> Result; -} -#[doc = "< Primary I2S line, used by DSP/Mic (configurable)/GBA sound controller."] -pub const CODEC_I2S_LINE_1: CodecI2sLine = 0; -#[doc = "< Secondary I2S line, used by CSND hardware."] -pub const CODEC_I2S_LINE_2: CodecI2sLine = 1; -#[doc = "I2S line enumeration"] -pub type CodecI2sLine = ::libc::c_uint; -extern "C" { - #[must_use] - #[doc = "Initializes CDCCHK."] - pub fn cdcChkInit() -> Result; -} -extern "C" { - #[doc = "Exits CDCCHK."] - pub fn cdcChkExit(); -} -extern "C" { - #[doc = "Gets a pointer to the current cdc:CHK session handle.\n # Returns\n\nA pointer to the current cdc:CHK session handle."] - pub fn cdcChkGetSessionHandle() -> *mut Handle; -} -extern "C" { - #[must_use] - #[doc = "Reads multiple registers from the CODEC, using the old\n SPI hardware interface and a 4MHz baudrate.\n # Arguments\n\n* `pageId` - CODEC Page ID.\n * `initialRegAddr` - Address of the CODEC register to start with.\n * `outData` (direction out) - Where to write the read data to.\n * `size` - Number of registers to read (bytes to read, max. 64)."] - pub fn CDCCHK_ReadRegisters1( - pageId: u8_, - initialRegAddr: u8_, - outData: *mut ::libc::c_void, - size: usize, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Reads multiple registers from the CODEC, using the new\n SPI hardware interface and a 16MHz baudrate.\n # Arguments\n\n* `pageId` - CODEC Page ID.\n * `initialRegAddr` - Address of the CODEC register to start with.\n * `outData` (direction out) - Where to read the data to.\n * `size` - Number of registers to read (bytes to read, max. 64)."] - pub fn CDCCHK_ReadRegisters2( - pageId: u8_, - initialRegAddr: u8_, - outData: *mut ::libc::c_void, - size: usize, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Writes multiple registers to the CODEC, using the old\n SPI hardware interface and a 4MHz baudrate.\n # Arguments\n\n* `pageId` - CODEC Page ID.\n * `initialRegAddr` - Address of the CODEC register to start with.\n * `data` - Where to read the data to write from.\n * `size` - Number of registers to write (bytes to read, max. 64)."] - pub fn CDCCHK_WriteRegisters1( - pageId: u8_, - initialRegAddr: u8_, - data: *const ::libc::c_void, - size: usize, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Writes multiple registers to the CODEC, using the new\n SPI hardware interface and a 16MHz baudrate.\n # Arguments\n\n* `pageId` - CODEC Page ID.\n * `initialRegAddr` - Address of the CODEC register to start with.\n * `data` - Where to read the data to write from.\n * `size` - Number of registers to write (bytes to read, max. 64)."] - pub fn CDCCHK_WriteRegisters2( - pageId: u8_, - initialRegAddr: u8_, - data: *const ::libc::c_void, - size: usize, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Reads a single register from the NTR PMIC.\n # Arguments\n\n* `outData` (direction out) - Where to read the data to (1 byte).\n * `regAddr` - Register address.\n > **Note:** The NTR PMIC is emulated by the CODEC hardware and sends\n IRQs to the MCU when relevant."] - pub fn CDCCHK_ReadNtrPmicRegister(outData: *mut u8_, regAddr: u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Writes a single register from the NTR PMIC.\n # Arguments\n\n* `regAddr` - Register address.\n * `data` - Data to write (1 byte).\n > **Note:** The NTR PMIC is emulated by the CODEC hardware and sends\n IRQs to the MCU when relevant."] - pub fn CDCCHK_WriteNtrPmicRegister(regAddr: u8_, data: u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the DAC volume level for the specified I2S line.\n # Arguments\n\n* `i2sLine` - I2S line to set the volume for.\n * `volume` - Volume level (-128 to 0)."] - pub fn CDCCHK_SetI2sVolume(i2sLine: CodecI2sLine, volume: s8) -> Result; -} -#[doc = "< 8-bit Red + 8-bit Green + 8-bit Blue + 8-bit Alpha"] -pub const GX_TRANSFER_FMT_RGBA8: GX_TRANSFER_FORMAT = 0; -#[doc = "< 8-bit Red + 8-bit Green + 8-bit Blue"] -pub const GX_TRANSFER_FMT_RGB8: GX_TRANSFER_FORMAT = 1; -#[doc = "< 5-bit Red + 6-bit Green + 5-bit Blue"] -pub const GX_TRANSFER_FMT_RGB565: GX_TRANSFER_FORMAT = 2; -#[doc = "< 5-bit Red + 5-bit Green + 5-bit Blue + 1-bit Alpha"] -pub const GX_TRANSFER_FMT_RGB5A1: GX_TRANSFER_FORMAT = 3; -#[doc = "< 4-bit Red + 4-bit Green + 4-bit Blue + 4-bit Alpha"] -pub const GX_TRANSFER_FMT_RGBA4: GX_TRANSFER_FORMAT = 4; -#[doc = "Supported transfer pixel formats.\n [`GSPGPU_FramebufferFormat`]"] -pub type GX_TRANSFER_FORMAT = ::libc::c_uint; -#[doc = "< No anti-aliasing"] -pub const GX_TRANSFER_SCALE_NO: GX_TRANSFER_SCALE = 0; -#[doc = "< 2x1 anti-aliasing"] -pub const GX_TRANSFER_SCALE_X: GX_TRANSFER_SCALE = 1; -#[doc = "< 2x2 anti-aliasing"] -pub const GX_TRANSFER_SCALE_XY: GX_TRANSFER_SCALE = 2; -#[doc = "Anti-aliasing modes\n\n Please remember that the framebuffer is sideways.\n Hence if you activate 2x1 anti-aliasing the destination dimensions are w = 240*2 and h = 400"] -pub type GX_TRANSFER_SCALE = ::libc::c_uint; -#[doc = "< Trigger the PPF event"] -pub const GX_FILL_TRIGGER: GX_FILL_CONTROL = 1; -#[doc = "< Indicates if the memory fill is complete. You should not use it when requesting a transfer."] -pub const GX_FILL_FINISHED: GX_FILL_CONTROL = 2; -#[doc = "< The buffer has a 16 bit per pixel depth"] -pub const GX_FILL_16BIT_DEPTH: GX_FILL_CONTROL = 0; -#[doc = "< The buffer has a 24 bit per pixel depth"] -pub const GX_FILL_24BIT_DEPTH: GX_FILL_CONTROL = 256; -#[doc = "< The buffer has a 32 bit per pixel depth"] -pub const GX_FILL_32BIT_DEPTH: GX_FILL_CONTROL = 512; -#[doc = "GX transfer control flags"] -pub type GX_FILL_CONTROL = ::libc::c_uint; -#[doc = "GX command entry"] -#[repr(C)] -#[derive(Copy, Clone)] -pub union gxCmdEntry_s { - #[doc = "< Raw command data"] - pub data: [u32_; 8usize], - pub __bindgen_anon_1: gxCmdEntry_s__bindgen_ty_1, -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct gxCmdEntry_s__bindgen_ty_1 { - #[doc = "< Command type"] - pub type_: u8_, - pub unk1: u8_, - pub unk2: u8_, - pub unk3: u8_, - #[doc = "< Command arguments"] - pub args: [u32_; 7usize], -} -impl Default for gxCmdEntry_s { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "GX command queue structure"] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct tag_gxCmdQueue_s { - #[doc = "< Pointer to array of GX command entries"] - pub entries: *mut gxCmdEntry_s, - #[doc = "< Capacity of the command array"] - pub maxEntries: u16_, - #[doc = "< Number of commands in the queue"] - pub numEntries: u16_, - #[doc = "< Index of the first pending command to be submitted to GX"] - pub curEntry: u16_, - #[doc = "< Number of commands completed by GX"] - pub lastEntry: u16_, - #[doc = "< User callback"] - pub callback: ::core::option::Option, - #[doc = "< Data for user callback"] - pub user: *mut ::libc::c_void, -} -impl Default for tag_gxCmdQueue_s { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "GX command queue structure"] -pub type gxCmdQueue_s = tag_gxCmdQueue_s; -extern "C" { - #[doc = "Clears a GX command queue.\n # Arguments\n\n* `queue` - The GX command queue."] - pub fn gxCmdQueueClear(queue: *mut gxCmdQueue_s); -} -extern "C" { - #[doc = "Adds a command to a GX command queue.\n # Arguments\n\n* `queue` - The GX command queue.\n * `entry` - The GX command to add."] - pub fn gxCmdQueueAdd(queue: *mut gxCmdQueue_s, entry: *const gxCmdEntry_s); -} -extern "C" { - #[doc = "Runs a GX command queue, causing it to begin processing incoming commands as they arrive.\n # Arguments\n\n* `queue` - The GX command queue."] - pub fn gxCmdQueueRun(queue: *mut gxCmdQueue_s); -} -extern "C" { - #[doc = "Stops a GX command queue from processing incoming commands.\n # Arguments\n\n* `queue` - The GX command queue."] - pub fn gxCmdQueueStop(queue: *mut gxCmdQueue_s); -} -extern "C" { - #[doc = "Waits for a GX command queue to finish executing pending commands.\n # Arguments\n\n* `queue` - The GX command queue.\n * `timeout` - Optional timeout (in nanoseconds) to wait (specify -1 for no timeout).\n # Returns\n\nfalse if timeout expired, true otherwise."] - pub fn gxCmdQueueWait(queue: *mut gxCmdQueue_s, timeout: s64) -> bool; -} -extern "C" { - #[doc = "Sets the completion callback for a GX command queue.\n # Arguments\n\n* `queue` - The GX command queue.\n * `callback` - The completion callback.\n * `user` - User data."] - #[link_name = "gxCmdQueueSetCallback__extern"] - pub fn gxCmdQueueSetCallback( - queue: *mut gxCmdQueue_s, - callback: ::core::option::Option, - user: *mut ::libc::c_void, - ); -} -extern "C" { - #[doc = "Selects a command queue to which GX_* functions will add commands instead of immediately submitting them to GX.\n # Arguments\n\n* `queue` - The GX command queue. (Pass NULL to remove the bound command queue)"] - pub fn GX_BindQueue(queue: *mut gxCmdQueue_s); -} -extern "C" { - #[must_use] - #[doc = "Requests a DMA.\n # Arguments\n\n* `src` - Source to DMA from.\n * `dst` - Destination to DMA to.\n * `length` - Length of data to transfer."] - pub fn GX_RequestDma(src: *mut u32_, dst: *mut u32_, length: u32_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Processes a GPU command list.\n # Arguments\n\n* `buf0a` - Command list address.\n * `buf0s` - Command list size.\n * `flags` - Flags to process with."] - pub fn GX_ProcessCommandList(buf0a: *mut u32_, buf0s: u32_, flags: u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Fills the memory of two buffers with the given values.\n # Arguments\n\n* `buf0a` - Start address of the first buffer.\n * `buf0v` - Dimensions of the first buffer.\n * `buf0e` - End address of the first buffer.\n * `control0` - Value to fill the first buffer with.\n * `buf1a` - Start address of the second buffer.\n * `buf1v` - Dimensions of the second buffer.\n * `buf1e` - End address of the second buffer.\n * `control1` - Value to fill the second buffer with."] - 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" { - #[must_use] - #[doc = "Initiates a display transfer.\n > **Note:** The PPF event will be signaled on completion.\n # Arguments\n\n* `inadr` - Address of the input.\n * `indim` - Dimensions of the input.\n * `outadr` - Address of the output.\n * `outdim` - Dimensions of the output.\n * `flags` - Flags to transfer with."] - pub fn GX_DisplayTransfer( - inadr: *mut u32_, - indim: u32_, - outadr: *mut u32_, - outdim: u32_, - flags: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Initiates a texture copy.\n > **Note:** The PPF event will be signaled on completion.\n # Arguments\n\n* `inadr` - Address of the input.\n * `indim` - Dimensions of the input.\n * `outadr` - Address of the output.\n * `outdim` - Dimensions of the output.\n * `size` - Size of the data to transfer.\n * `flags` - Flags to transfer with."] - pub fn GX_TextureCopy( - inadr: *mut u32_, - indim: u32_, - outadr: *mut u32_, - outdim: u32_, - size: u32_, - flags: u32_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Flushes the cache regions of three buffers. (This command cannot be queued in a GX command queue)\n # Arguments\n\n* `buf0a` - Address of the first buffer.\n * `buf0s` - Size of the first buffer.\n * `buf1a` - Address of the second buffer.\n * `buf1s` - Size of the second buffer.\n * `buf2a` - Address of the third buffer.\n * `buf2s` - Size of the third buffer."] - pub fn GX_FlushCacheRegions( - buf0a: *mut u32_, - buf0s: u32_, - buf1a: *mut u32_, - buf1s: u32_, - buf2a: *mut u32_, - buf2s: u32_, - ) -> Result; -} -#[doc = "< Nearest-neighbor interpolation."] -pub const GPU_NEAREST: GPU_TEXTURE_FILTER_PARAM = 0; -#[doc = "< Linear interpolation."] -pub const GPU_LINEAR: GPU_TEXTURE_FILTER_PARAM = 1; -#[doc = "Texture filters."] -pub type GPU_TEXTURE_FILTER_PARAM = ::libc::c_uint; -#[doc = "< Clamps to edge."] -pub const GPU_CLAMP_TO_EDGE: GPU_TEXTURE_WRAP_PARAM = 0; -#[doc = "< Clamps to border."] -pub const GPU_CLAMP_TO_BORDER: GPU_TEXTURE_WRAP_PARAM = 1; -#[doc = "< Repeats texture."] -pub const GPU_REPEAT: GPU_TEXTURE_WRAP_PARAM = 2; -#[doc = "< Repeats with mirrored texture."] -pub const GPU_MIRRORED_REPEAT: GPU_TEXTURE_WRAP_PARAM = 3; -#[doc = "Texture wrap modes."] -pub type GPU_TEXTURE_WRAP_PARAM = ::libc::c_uint; -#[doc = "< 2D texture"] -pub const GPU_TEX_2D: GPU_TEXTURE_MODE_PARAM = 0; -#[doc = "< Cube map"] -pub const GPU_TEX_CUBE_MAP: GPU_TEXTURE_MODE_PARAM = 1; -#[doc = "< 2D Shadow texture"] -pub const GPU_TEX_SHADOW_2D: GPU_TEXTURE_MODE_PARAM = 2; -#[doc = "< Projection texture"] -pub const GPU_TEX_PROJECTION: GPU_TEXTURE_MODE_PARAM = 3; -#[doc = "< Shadow cube map"] -pub const GPU_TEX_SHADOW_CUBE: GPU_TEXTURE_MODE_PARAM = 4; -#[doc = "< Disabled"] -pub const GPU_TEX_DISABLED: GPU_TEXTURE_MODE_PARAM = 5; -#[doc = "Texture modes."] -pub type GPU_TEXTURE_MODE_PARAM = ::libc::c_uint; -#[doc = "< Texture unit 0."] -pub const GPU_TEXUNIT0: GPU_TEXUNIT = 1; -#[doc = "< Texture unit 1."] -pub const GPU_TEXUNIT1: GPU_TEXUNIT = 2; -#[doc = "< Texture unit 2."] -pub const GPU_TEXUNIT2: GPU_TEXUNIT = 4; -#[doc = "Supported texture units."] -pub type GPU_TEXUNIT = ::libc::c_uint; -#[doc = "< 8-bit Red + 8-bit Green + 8-bit Blue + 8-bit Alpha"] -pub const GPU_RGBA8: GPU_TEXCOLOR = 0; -#[doc = "< 8-bit Red + 8-bit Green + 8-bit Blue"] -pub const GPU_RGB8: GPU_TEXCOLOR = 1; -#[doc = "< 5-bit Red + 5-bit Green + 5-bit Blue + 1-bit Alpha"] -pub const GPU_RGBA5551: GPU_TEXCOLOR = 2; -#[doc = "< 5-bit Red + 6-bit Green + 5-bit Blue"] -pub const GPU_RGB565: GPU_TEXCOLOR = 3; -#[doc = "< 4-bit Red + 4-bit Green + 4-bit Blue + 4-bit Alpha"] -pub const GPU_RGBA4: GPU_TEXCOLOR = 4; -#[doc = "< 8-bit Luminance + 8-bit Alpha"] -pub const GPU_LA8: GPU_TEXCOLOR = 5; -#[doc = "< 8-bit Hi + 8-bit Lo"] -pub const GPU_HILO8: GPU_TEXCOLOR = 6; -#[doc = "< 8-bit Luminance"] -pub const GPU_L8: GPU_TEXCOLOR = 7; -#[doc = "< 8-bit Alpha"] -pub const GPU_A8: GPU_TEXCOLOR = 8; -#[doc = "< 4-bit Luminance + 4-bit Alpha"] -pub const GPU_LA4: GPU_TEXCOLOR = 9; -#[doc = "< 4-bit Luminance"] -pub const GPU_L4: GPU_TEXCOLOR = 10; -#[doc = "< 4-bit Alpha"] -pub const GPU_A4: GPU_TEXCOLOR = 11; -#[doc = "< ETC1 texture compression"] -pub const GPU_ETC1: GPU_TEXCOLOR = 12; -#[doc = "< ETC1 texture compression + 4-bit Alpha"] -pub const GPU_ETC1A4: GPU_TEXCOLOR = 13; -#[doc = "Supported texture formats."] -pub type GPU_TEXCOLOR = ::libc::c_uint; -#[doc = "< 2D face"] -pub const GPU_TEXFACE_2D: GPU_TEXFACE = 0; -#[doc = "< +X face"] -pub const GPU_POSITIVE_X: GPU_TEXFACE = 0; -#[doc = "< -X face"] -pub const GPU_NEGATIVE_X: GPU_TEXFACE = 1; -#[doc = "< +Y face"] -pub const GPU_POSITIVE_Y: GPU_TEXFACE = 2; -#[doc = "< -Y face"] -pub const GPU_NEGATIVE_Y: GPU_TEXFACE = 3; -#[doc = "< +Z face"] -pub const GPU_POSITIVE_Z: GPU_TEXFACE = 4; -#[doc = "< -Z face"] -pub const GPU_NEGATIVE_Z: GPU_TEXFACE = 5; -#[doc = "Texture faces."] -pub type GPU_TEXFACE = ::libc::c_uint; -#[doc = "< Clamp to zero."] -pub const GPU_PT_CLAMP_TO_ZERO: GPU_PROCTEX_CLAMP = 0; -#[doc = "< Clamp to edge."] -pub const GPU_PT_CLAMP_TO_EDGE: GPU_PROCTEX_CLAMP = 1; -#[doc = "< Symmetrical repeat."] -pub const GPU_PT_REPEAT: GPU_PROCTEX_CLAMP = 2; -#[doc = "< Mirrored repeat."] -pub const GPU_PT_MIRRORED_REPEAT: GPU_PROCTEX_CLAMP = 3; -#[doc = "< Pulse."] -pub const GPU_PT_PULSE: GPU_PROCTEX_CLAMP = 4; -#[doc = "Procedural texture clamp modes."] -pub type GPU_PROCTEX_CLAMP = ::libc::c_uint; -#[doc = "< U"] -pub const GPU_PT_U: GPU_PROCTEX_MAPFUNC = 0; -#[doc = "< U2"] -pub const GPU_PT_U2: GPU_PROCTEX_MAPFUNC = 1; -#[doc = "< V"] -pub const GPU_PT_V: GPU_PROCTEX_MAPFUNC = 2; -#[doc = "< V2"] -pub const GPU_PT_V2: GPU_PROCTEX_MAPFUNC = 3; -#[doc = "< U+V"] -pub const GPU_PT_ADD: GPU_PROCTEX_MAPFUNC = 4; -#[doc = "< U2+V2"] -pub const GPU_PT_ADD2: GPU_PROCTEX_MAPFUNC = 5; -#[doc = "< sqrt(U2+V2)"] -pub const GPU_PT_SQRT2: GPU_PROCTEX_MAPFUNC = 6; -#[doc = "< min"] -pub const GPU_PT_MIN: GPU_PROCTEX_MAPFUNC = 7; -#[doc = "< max"] -pub const GPU_PT_MAX: GPU_PROCTEX_MAPFUNC = 8; -#[doc = "< rmax"] -pub const GPU_PT_RMAX: GPU_PROCTEX_MAPFUNC = 9; -#[doc = "Procedural texture mapping functions."] -pub type GPU_PROCTEX_MAPFUNC = ::libc::c_uint; -#[doc = "< No shift."] -pub const GPU_PT_NONE: GPU_PROCTEX_SHIFT = 0; -#[doc = "< Odd shift."] -pub const GPU_PT_ODD: GPU_PROCTEX_SHIFT = 1; -#[doc = "< Even shift."] -pub const GPU_PT_EVEN: GPU_PROCTEX_SHIFT = 2; -#[doc = "Procedural texture shift values."] -pub type GPU_PROCTEX_SHIFT = ::libc::c_uint; -#[doc = "< Nearest-neighbor"] -pub const GPU_PT_NEAREST: GPU_PROCTEX_FILTER = 0; -#[doc = "< Linear interpolation"] -pub const GPU_PT_LINEAR: GPU_PROCTEX_FILTER = 1; -#[doc = "< Nearest-neighbor with mipmap using nearest-neighbor"] -pub const GPU_PT_NEAREST_MIP_NEAREST: GPU_PROCTEX_FILTER = 2; -#[doc = "< Linear interpolation with mipmap using nearest-neighbor"] -pub const GPU_PT_LINEAR_MIP_NEAREST: GPU_PROCTEX_FILTER = 3; -#[doc = "< Nearest-neighbor with mipmap using linear interpolation"] -pub const GPU_PT_NEAREST_MIP_LINEAR: GPU_PROCTEX_FILTER = 4; -#[doc = "< Linear interpolation with mipmap using linear interpolation"] -pub const GPU_PT_LINEAR_MIP_LINEAR: GPU_PROCTEX_FILTER = 5; -#[doc = "Procedural texture filter values."] -pub type GPU_PROCTEX_FILTER = ::libc::c_uint; -#[doc = "< Noise table"] -pub const GPU_LUT_NOISE: GPU_PROCTEX_LUTID = 0; -#[doc = "< RGB mapping function table"] -pub const GPU_LUT_RGBMAP: GPU_PROCTEX_LUTID = 2; -#[doc = "< Alpha mapping function table"] -pub const GPU_LUT_ALPHAMAP: GPU_PROCTEX_LUTID = 3; -#[doc = "< Color table"] -pub const GPU_LUT_COLOR: GPU_PROCTEX_LUTID = 4; -#[doc = "< Color difference table"] -pub const GPU_LUT_COLORDIF: GPU_PROCTEX_LUTID = 5; -#[doc = "Procedural texture LUT IDs."] -pub type GPU_PROCTEX_LUTID = ::libc::c_uint; -#[doc = "< 8-bit Red + 8-bit Green + 8-bit Blue + 8-bit Alpha"] -pub const GPU_RB_RGBA8: GPU_COLORBUF = 0; -#[doc = "< 8-bit Red + 8-bit Green + 8-bit Blue"] -pub const GPU_RB_RGB8: GPU_COLORBUF = 1; -#[doc = "< 5-bit Red + 5-bit Green + 5-bit Blue + 1-bit Alpha"] -pub const GPU_RB_RGBA5551: GPU_COLORBUF = 2; -#[doc = "< 5-bit Red + 6-bit Green + 5-bit Blue"] -pub const GPU_RB_RGB565: GPU_COLORBUF = 3; -#[doc = "< 4-bit Red + 4-bit Green + 4-bit Blue + 4-bit Alpha"] -pub const GPU_RB_RGBA4: GPU_COLORBUF = 4; -#[doc = "Supported color buffer formats."] -pub type GPU_COLORBUF = ::libc::c_uint; -#[doc = "< 16-bit Depth"] -pub const GPU_RB_DEPTH16: GPU_DEPTHBUF = 0; -#[doc = "< 24-bit Depth"] -pub const GPU_RB_DEPTH24: GPU_DEPTHBUF = 2; -#[doc = "< 24-bit Depth + 8-bit Stencil"] -pub const GPU_RB_DEPTH24_STENCIL8: GPU_DEPTHBUF = 3; -#[doc = "Supported depth buffer formats."] -pub type GPU_DEPTHBUF = ::libc::c_uint; -#[doc = "< Never pass."] -pub const GPU_NEVER: GPU_TESTFUNC = 0; -#[doc = "< Always pass."] -pub const GPU_ALWAYS: GPU_TESTFUNC = 1; -#[doc = "< Pass if equal."] -pub const GPU_EQUAL: GPU_TESTFUNC = 2; -#[doc = "< Pass if not equal."] -pub const GPU_NOTEQUAL: GPU_TESTFUNC = 3; -#[doc = "< Pass if less than."] -pub const GPU_LESS: GPU_TESTFUNC = 4; -#[doc = "< Pass if less than or equal."] -pub const GPU_LEQUAL: GPU_TESTFUNC = 5; -#[doc = "< Pass if greater than."] -pub const GPU_GREATER: GPU_TESTFUNC = 6; -#[doc = "< Pass if greater than or equal."] -pub const GPU_GEQUAL: GPU_TESTFUNC = 7; -#[doc = "Test functions."] -pub type GPU_TESTFUNC = ::libc::c_uint; -#[doc = "< Pass if greater than or equal."] -pub const GPU_EARLYDEPTH_GEQUAL: GPU_EARLYDEPTHFUNC = 0; -#[doc = "< Pass if greater than."] -pub const GPU_EARLYDEPTH_GREATER: GPU_EARLYDEPTHFUNC = 1; -#[doc = "< Pass if less than or equal."] -pub const GPU_EARLYDEPTH_LEQUAL: GPU_EARLYDEPTHFUNC = 2; -#[doc = "< Pass if less than."] -pub const GPU_EARLYDEPTH_LESS: GPU_EARLYDEPTHFUNC = 3; -#[doc = "Early depth test functions."] -pub type GPU_EARLYDEPTHFUNC = ::libc::c_uint; -#[doc = "< Never pass (0)."] -pub const GPU_GAS_NEVER: GPU_GASDEPTHFUNC = 0; -#[doc = "< Always pass (1)."] -pub const GPU_GAS_ALWAYS: GPU_GASDEPTHFUNC = 1; -#[doc = "< Pass if greater than (1-X)."] -pub const GPU_GAS_GREATER: GPU_GASDEPTHFUNC = 2; -#[doc = "< Pass if less than (X)."] -pub const GPU_GAS_LESS: GPU_GASDEPTHFUNC = 3; -#[doc = "Gas depth functions."] -pub type GPU_GASDEPTHFUNC = ::libc::c_uint; -#[doc = "< Disable."] -pub const GPU_SCISSOR_DISABLE: GPU_SCISSORMODE = 0; -#[doc = "< Exclude pixels inside the scissor box."] -pub const GPU_SCISSOR_INVERT: GPU_SCISSORMODE = 1; -#[doc = "< Exclude pixels outside of the scissor box."] -pub const GPU_SCISSOR_NORMAL: GPU_SCISSORMODE = 3; -#[doc = "Scissor test modes."] -pub type GPU_SCISSORMODE = ::libc::c_uint; -#[doc = "< Keep old value. (old_stencil)"] -pub const GPU_STENCIL_KEEP: GPU_STENCILOP = 0; -#[doc = "< Zero. (0)"] -pub const GPU_STENCIL_ZERO: GPU_STENCILOP = 1; -#[doc = "< Replace value. (ref)"] -pub const GPU_STENCIL_REPLACE: GPU_STENCILOP = 2; -#[doc = "< Increment value. (old_stencil + 1 saturated to [0, 255])"] -pub const GPU_STENCIL_INCR: GPU_STENCILOP = 3; -#[doc = "< Decrement value. (old_stencil - 1 saturated to [0, 255])"] -pub const GPU_STENCIL_DECR: GPU_STENCILOP = 4; -#[doc = "< Invert value. (~old_stencil)"] -pub const GPU_STENCIL_INVERT: GPU_STENCILOP = 5; -#[doc = "< Increment value. (old_stencil + 1)"] -pub const GPU_STENCIL_INCR_WRAP: GPU_STENCILOP = 6; -#[doc = "< Decrement value. (old_stencil - 1)"] -pub const GPU_STENCIL_DECR_WRAP: GPU_STENCILOP = 7; -#[doc = "Stencil operations."] -pub type GPU_STENCILOP = ::libc::c_uint; -#[doc = "< Write red."] -pub const GPU_WRITE_RED: GPU_WRITEMASK = 1; -#[doc = "< Write green."] -pub const GPU_WRITE_GREEN: GPU_WRITEMASK = 2; -#[doc = "< Write blue."] -pub const GPU_WRITE_BLUE: GPU_WRITEMASK = 4; -#[doc = "< Write alpha."] -pub const GPU_WRITE_ALPHA: GPU_WRITEMASK = 8; -#[doc = "< Write depth."] -pub const GPU_WRITE_DEPTH: GPU_WRITEMASK = 16; -#[doc = "< Write all color components."] -pub const GPU_WRITE_COLOR: GPU_WRITEMASK = 15; -#[doc = "< Write all components."] -pub const GPU_WRITE_ALL: GPU_WRITEMASK = 31; -#[doc = "Pixel write mask."] -pub type GPU_WRITEMASK = ::libc::c_uint; -#[doc = "< Add colors."] -pub const GPU_BLEND_ADD: GPU_BLENDEQUATION = 0; -#[doc = "< Subtract colors."] -pub const GPU_BLEND_SUBTRACT: GPU_BLENDEQUATION = 1; -#[doc = "< Reverse-subtract colors."] -pub const GPU_BLEND_REVERSE_SUBTRACT: GPU_BLENDEQUATION = 2; -#[doc = "< Use the minimum color."] -pub const GPU_BLEND_MIN: GPU_BLENDEQUATION = 3; -#[doc = "< Use the maximum color."] -pub const GPU_BLEND_MAX: GPU_BLENDEQUATION = 4; -#[doc = "Blend modes."] -pub type GPU_BLENDEQUATION = ::libc::c_uint; -#[doc = "< Zero."] -pub const GPU_ZERO: GPU_BLENDFACTOR = 0; -#[doc = "< One."] -pub const GPU_ONE: GPU_BLENDFACTOR = 1; -#[doc = "< Source color."] -pub const GPU_SRC_COLOR: GPU_BLENDFACTOR = 2; -#[doc = "< Source color - 1."] -pub const GPU_ONE_MINUS_SRC_COLOR: GPU_BLENDFACTOR = 3; -#[doc = "< Destination color."] -pub const GPU_DST_COLOR: GPU_BLENDFACTOR = 4; -#[doc = "< Destination color - 1."] -pub const GPU_ONE_MINUS_DST_COLOR: GPU_BLENDFACTOR = 5; -#[doc = "< Source alpha."] -pub const GPU_SRC_ALPHA: GPU_BLENDFACTOR = 6; -#[doc = "< Source alpha - 1."] -pub const GPU_ONE_MINUS_SRC_ALPHA: GPU_BLENDFACTOR = 7; -#[doc = "< Destination alpha."] -pub const GPU_DST_ALPHA: GPU_BLENDFACTOR = 8; -#[doc = "< Destination alpha - 1."] -pub const GPU_ONE_MINUS_DST_ALPHA: GPU_BLENDFACTOR = 9; -#[doc = "< Constant color."] -pub const GPU_CONSTANT_COLOR: GPU_BLENDFACTOR = 10; -#[doc = "< Constant color - 1."] -pub const GPU_ONE_MINUS_CONSTANT_COLOR: GPU_BLENDFACTOR = 11; -#[doc = "< Constant alpha."] -pub const GPU_CONSTANT_ALPHA: GPU_BLENDFACTOR = 12; -#[doc = "< Constant alpha - 1."] -pub const GPU_ONE_MINUS_CONSTANT_ALPHA: GPU_BLENDFACTOR = 13; -#[doc = "< Saturated alpha."] -pub const GPU_SRC_ALPHA_SATURATE: GPU_BLENDFACTOR = 14; -#[doc = "Blend factors."] -pub type GPU_BLENDFACTOR = ::libc::c_uint; -#[doc = "< Clear."] -pub const GPU_LOGICOP_CLEAR: GPU_LOGICOP = 0; -#[doc = "< Bitwise AND."] -pub const GPU_LOGICOP_AND: GPU_LOGICOP = 1; -#[doc = "< Reverse bitwise AND."] -pub const GPU_LOGICOP_AND_REVERSE: GPU_LOGICOP = 2; -#[doc = "< Copy."] -pub const GPU_LOGICOP_COPY: GPU_LOGICOP = 3; -#[doc = "< Set."] -pub const GPU_LOGICOP_SET: GPU_LOGICOP = 4; -#[doc = "< Inverted copy."] -pub const GPU_LOGICOP_COPY_INVERTED: GPU_LOGICOP = 5; -#[doc = "< No operation."] -pub const GPU_LOGICOP_NOOP: GPU_LOGICOP = 6; -#[doc = "< Invert."] -pub const GPU_LOGICOP_INVERT: GPU_LOGICOP = 7; -#[doc = "< Bitwise NAND."] -pub const GPU_LOGICOP_NAND: GPU_LOGICOP = 8; -#[doc = "< Bitwise OR."] -pub const GPU_LOGICOP_OR: GPU_LOGICOP = 9; -#[doc = "< Bitwise NOR."] -pub const GPU_LOGICOP_NOR: GPU_LOGICOP = 10; -#[doc = "< Bitwise XOR."] -pub const GPU_LOGICOP_XOR: GPU_LOGICOP = 11; -#[doc = "< Equivalent."] -pub const GPU_LOGICOP_EQUIV: GPU_LOGICOP = 12; -#[doc = "< Inverted bitwise AND."] -pub const GPU_LOGICOP_AND_INVERTED: GPU_LOGICOP = 13; -#[doc = "< Reverse bitwise OR."] -pub const GPU_LOGICOP_OR_REVERSE: GPU_LOGICOP = 14; -#[doc = "< Inverted bitwize OR."] -pub const GPU_LOGICOP_OR_INVERTED: GPU_LOGICOP = 15; -#[doc = "Logical operations."] -pub type GPU_LOGICOP = ::libc::c_uint; -#[doc = "< OpenGL mode."] -pub const GPU_FRAGOPMODE_GL: GPU_FRAGOPMODE = 0; -#[doc = "< Gas mode (?)."] -pub const GPU_FRAGOPMODE_GAS_ACC: GPU_FRAGOPMODE = 1; -#[doc = "< Shadow mode (?)."] -pub const GPU_FRAGOPMODE_SHADOW: GPU_FRAGOPMODE = 3; -#[doc = "Fragment operation modes."] -pub type GPU_FRAGOPMODE = ::libc::c_uint; -#[doc = "< 8-bit byte."] -pub const GPU_BYTE: GPU_FORMATS = 0; -#[doc = "< 8-bit unsigned byte."] -pub const GPU_UNSIGNED_BYTE: GPU_FORMATS = 1; -#[doc = "< 16-bit short."] -pub const GPU_SHORT: GPU_FORMATS = 2; -#[doc = "< 32-bit float."] -pub const GPU_FLOAT: GPU_FORMATS = 3; -#[doc = "Supported component formats."] -pub type GPU_FORMATS = ::libc::c_uint; -#[doc = "< Disabled."] -pub const GPU_CULL_NONE: GPU_CULLMODE = 0; -#[doc = "< Front, counter-clockwise."] -pub const GPU_CULL_FRONT_CCW: GPU_CULLMODE = 1; -#[doc = "< Back, counter-clockwise."] -pub const GPU_CULL_BACK_CCW: GPU_CULLMODE = 2; -#[doc = "Cull modes."] -pub type GPU_CULLMODE = ::libc::c_uint; -#[doc = "< Primary color."] -pub const GPU_PRIMARY_COLOR: GPU_TEVSRC = 0; -#[doc = "< Primary fragment color."] -pub const GPU_FRAGMENT_PRIMARY_COLOR: GPU_TEVSRC = 1; -#[doc = "< Secondary fragment color."] -pub const GPU_FRAGMENT_SECONDARY_COLOR: GPU_TEVSRC = 2; -#[doc = "< Texture unit 0."] -pub const GPU_TEXTURE0: GPU_TEVSRC = 3; -#[doc = "< Texture unit 1."] -pub const GPU_TEXTURE1: GPU_TEVSRC = 4; -#[doc = "< Texture unit 2."] -pub const GPU_TEXTURE2: GPU_TEVSRC = 5; -#[doc = "< Texture unit 3."] -pub const GPU_TEXTURE3: GPU_TEVSRC = 6; -#[doc = "< Previous buffer."] -pub const GPU_PREVIOUS_BUFFER: GPU_TEVSRC = 13; -#[doc = "< Constant value."] -pub const GPU_CONSTANT: GPU_TEVSRC = 14; -#[doc = "< Previous value."] -pub const GPU_PREVIOUS: GPU_TEVSRC = 15; -#[doc = "Texture combiner sources."] -pub type GPU_TEVSRC = ::libc::c_uint; -#[doc = "< Source color."] -pub const GPU_TEVOP_RGB_SRC_COLOR: GPU_TEVOP_RGB = 0; -#[doc = "< Source color - 1."] -pub const GPU_TEVOP_RGB_ONE_MINUS_SRC_COLOR: GPU_TEVOP_RGB = 1; -#[doc = "< Source alpha."] -pub const GPU_TEVOP_RGB_SRC_ALPHA: GPU_TEVOP_RGB = 2; -#[doc = "< Source alpha - 1."] -pub const GPU_TEVOP_RGB_ONE_MINUS_SRC_ALPHA: GPU_TEVOP_RGB = 3; -#[doc = "< Source red."] -pub const GPU_TEVOP_RGB_SRC_R: GPU_TEVOP_RGB = 4; -#[doc = "< Source red - 1."] -pub const GPU_TEVOP_RGB_ONE_MINUS_SRC_R: GPU_TEVOP_RGB = 5; -#[doc = "< Unknown."] -pub const GPU_TEVOP_RGB_0x06: GPU_TEVOP_RGB = 6; -#[doc = "< Unknown."] -pub const GPU_TEVOP_RGB_0x07: GPU_TEVOP_RGB = 7; -#[doc = "< Source green."] -pub const GPU_TEVOP_RGB_SRC_G: GPU_TEVOP_RGB = 8; -#[doc = "< Source green - 1."] -pub const GPU_TEVOP_RGB_ONE_MINUS_SRC_G: GPU_TEVOP_RGB = 9; -#[doc = "< Unknown."] -pub const GPU_TEVOP_RGB_0x0A: GPU_TEVOP_RGB = 10; -#[doc = "< Unknown."] -pub const GPU_TEVOP_RGB_0x0B: GPU_TEVOP_RGB = 11; -#[doc = "< Source blue."] -pub const GPU_TEVOP_RGB_SRC_B: GPU_TEVOP_RGB = 12; -#[doc = "< Source blue - 1."] -pub const GPU_TEVOP_RGB_ONE_MINUS_SRC_B: GPU_TEVOP_RGB = 13; -#[doc = "< Unknown."] -pub const GPU_TEVOP_RGB_0x0E: GPU_TEVOP_RGB = 14; -#[doc = "< Unknown."] -pub const GPU_TEVOP_RGB_0x0F: GPU_TEVOP_RGB = 15; -#[doc = "Texture RGB combiner operands."] -pub type GPU_TEVOP_RGB = ::libc::c_uint; -#[doc = "< Source alpha."] -pub const GPU_TEVOP_A_SRC_ALPHA: GPU_TEVOP_A = 0; -#[doc = "< Source alpha - 1."] -pub const GPU_TEVOP_A_ONE_MINUS_SRC_ALPHA: GPU_TEVOP_A = 1; -#[doc = "< Source red."] -pub const GPU_TEVOP_A_SRC_R: GPU_TEVOP_A = 2; -#[doc = "< Source red - 1."] -pub const GPU_TEVOP_A_ONE_MINUS_SRC_R: GPU_TEVOP_A = 3; -#[doc = "< Source green."] -pub const GPU_TEVOP_A_SRC_G: GPU_TEVOP_A = 4; -#[doc = "< Source green - 1."] -pub const GPU_TEVOP_A_ONE_MINUS_SRC_G: GPU_TEVOP_A = 5; -#[doc = "< Source blue."] -pub const GPU_TEVOP_A_SRC_B: GPU_TEVOP_A = 6; -#[doc = "< Source blue - 1."] -pub const GPU_TEVOP_A_ONE_MINUS_SRC_B: GPU_TEVOP_A = 7; -#[doc = "Texture Alpha combiner operands."] -pub type GPU_TEVOP_A = ::libc::c_uint; -#[doc = "< Replace."] -pub const GPU_REPLACE: GPU_COMBINEFUNC = 0; -#[doc = "< Modulate."] -pub const GPU_MODULATE: GPU_COMBINEFUNC = 1; -#[doc = "< Add."] -pub const GPU_ADD: GPU_COMBINEFUNC = 2; -#[doc = "< Signed add."] -pub const GPU_ADD_SIGNED: GPU_COMBINEFUNC = 3; -#[doc = "< Interpolate."] -pub const GPU_INTERPOLATE: GPU_COMBINEFUNC = 4; -#[doc = "< Subtract."] -pub const GPU_SUBTRACT: GPU_COMBINEFUNC = 5; -#[doc = "< Dot3. RGB only."] -pub const GPU_DOT3_RGB: GPU_COMBINEFUNC = 6; -#[doc = "< Multiply then add."] -pub const GPU_MULTIPLY_ADD: GPU_COMBINEFUNC = 8; -#[doc = "< Add then multiply."] -pub const GPU_ADD_MULTIPLY: GPU_COMBINEFUNC = 9; -#[doc = "Texture combiner functions."] -pub type GPU_COMBINEFUNC = ::libc::c_uint; -#[doc = "< 1x"] -pub const GPU_TEVSCALE_1: GPU_TEVSCALE = 0; -#[doc = "< 2x"] -pub const GPU_TEVSCALE_2: GPU_TEVSCALE = 1; -#[doc = "< 4x"] -pub const GPU_TEVSCALE_4: GPU_TEVSCALE = 2; -#[doc = "Texture scale factors."] -pub type GPU_TEVSCALE = ::libc::c_uint; -#[doc = "< None."] -pub const GPU_NO_FRESNEL: GPU_FRESNELSEL = 0; -#[doc = "< Primary alpha."] -pub const GPU_PRI_ALPHA_FRESNEL: GPU_FRESNELSEL = 1; -#[doc = "< Secondary alpha."] -pub const GPU_SEC_ALPHA_FRESNEL: GPU_FRESNELSEL = 2; -#[doc = "< Primary and secondary alpha."] -pub const GPU_PRI_SEC_ALPHA_FRESNEL: GPU_FRESNELSEL = 3; -#[doc = "Fresnel options."] -pub type GPU_FRESNELSEL = ::libc::c_uint; -#[doc = "< Disabled."] -pub const GPU_BUMP_NOT_USED: GPU_BUMPMODE = 0; -#[doc = "< Bump as bump mapping."] -pub const GPU_BUMP_AS_BUMP: GPU_BUMPMODE = 1; -#[doc = "< Bump as tangent/normal mapping."] -pub const GPU_BUMP_AS_TANG: GPU_BUMPMODE = 2; -#[doc = "Bump map modes."] -pub type GPU_BUMPMODE = ::libc::c_uint; -#[doc = "< D0 LUT."] -pub const GPU_LUT_D0: GPU_LIGHTLUTID = 0; -#[doc = "< D1 LUT."] -pub const GPU_LUT_D1: GPU_LIGHTLUTID = 1; -#[doc = "< Spotlight LUT."] -pub const GPU_LUT_SP: GPU_LIGHTLUTID = 2; -#[doc = "< Fresnel LUT."] -pub const GPU_LUT_FR: GPU_LIGHTLUTID = 3; -#[doc = "< Reflection-Blue LUT."] -pub const GPU_LUT_RB: GPU_LIGHTLUTID = 4; -#[doc = "< Reflection-Green LUT."] -pub const GPU_LUT_RG: GPU_LIGHTLUTID = 5; -#[doc = "< Reflection-Red LUT."] -pub const GPU_LUT_RR: GPU_LIGHTLUTID = 6; -#[doc = "< Distance attenuation LUT."] -pub const GPU_LUT_DA: GPU_LIGHTLUTID = 7; -#[doc = "LUT IDs."] -pub type GPU_LIGHTLUTID = ::libc::c_uint; -#[doc = "< Normal*HalfVector"] -pub const GPU_LUTINPUT_NH: GPU_LIGHTLUTINPUT = 0; -#[doc = "< View*HalfVector"] -pub const GPU_LUTINPUT_VH: GPU_LIGHTLUTINPUT = 1; -#[doc = "< Normal*View"] -pub const GPU_LUTINPUT_NV: GPU_LIGHTLUTINPUT = 2; -#[doc = "< LightVector*Normal"] -pub const GPU_LUTINPUT_LN: GPU_LIGHTLUTINPUT = 3; -#[doc = "< -LightVector*SpotlightVector"] -pub const GPU_LUTINPUT_SP: GPU_LIGHTLUTINPUT = 4; -#[doc = "< cosine of phi"] -pub const GPU_LUTINPUT_CP: GPU_LIGHTLUTINPUT = 5; -#[doc = "LUT inputs."] -pub type GPU_LIGHTLUTINPUT = ::libc::c_uint; -#[doc = "< 1x scale."] -pub const GPU_LUTSCALER_1x: GPU_LIGHTLUTSCALER = 0; -#[doc = "< 2x scale."] -pub const GPU_LUTSCALER_2x: GPU_LIGHTLUTSCALER = 1; -#[doc = "< 4x scale."] -pub const GPU_LUTSCALER_4x: GPU_LIGHTLUTSCALER = 2; -#[doc = "< 8x scale."] -pub const GPU_LUTSCALER_8x: GPU_LIGHTLUTSCALER = 3; -#[doc = "< 0.25x scale."] -pub const GPU_LUTSCALER_0_25x: GPU_LIGHTLUTSCALER = 6; -#[doc = "< 0.5x scale."] -pub const GPU_LUTSCALER_0_5x: GPU_LIGHTLUTSCALER = 7; -#[doc = "LUT scalers."] -pub type GPU_LIGHTLUTSCALER = ::libc::c_uint; -#[doc = "< LUTs that are common to all lights."] -pub const GPU_LUTSELECT_COMMON: GPU_LIGHTLUTSELECT = 0; -#[doc = "< Spotlight LUT."] -pub const GPU_LUTSELECT_SP: GPU_LIGHTLUTSELECT = 1; -#[doc = "< Distance attenuation LUT."] -pub const GPU_LUTSELECT_DA: GPU_LIGHTLUTSELECT = 2; -#[doc = "LUT selection."] -pub type GPU_LIGHTLUTSELECT = ::libc::c_uint; -#[doc = "< Fog/Gas unit disabled."] -pub const GPU_NO_FOG: GPU_FOGMODE = 0; -#[doc = "< Fog/Gas unit configured in Fog mode."] -pub const GPU_FOG: GPU_FOGMODE = 5; -#[doc = "< Fog/Gas unit configured in Gas mode."] -pub const GPU_GAS: GPU_FOGMODE = 7; -#[doc = "Fog modes."] -pub type GPU_FOGMODE = ::libc::c_uint; -#[doc = "< Plain density."] -pub const GPU_PLAIN_DENSITY: GPU_GASMODE = 0; -#[doc = "< Depth density."] -pub const GPU_DEPTH_DENSITY: GPU_GASMODE = 1; -#[doc = "Gas shading density source values."] -pub type GPU_GASMODE = ::libc::c_uint; -#[doc = "< Gas density used as input."] -pub const GPU_GAS_DENSITY: GPU_GASLUTINPUT = 0; -#[doc = "< Light factor used as input."] -pub const GPU_GAS_LIGHT_FACTOR: GPU_GASLUTINPUT = 1; -#[doc = "Gas color LUT inputs."] -pub type GPU_GASLUTINPUT = ::libc::c_uint; -#[doc = "< Triangles."] -pub const GPU_TRIANGLES: GPU_Primitive_t = 0; -#[doc = "< Triangle strip."] -pub const GPU_TRIANGLE_STRIP: GPU_Primitive_t = 256; -#[doc = "< Triangle fan."] -pub const GPU_TRIANGLE_FAN: GPU_Primitive_t = 512; -#[doc = "< Geometry shader primitive."] -pub const GPU_GEOMETRY_PRIM: GPU_Primitive_t = 768; -#[doc = "Supported primitives."] -pub type GPU_Primitive_t = ::libc::c_uint; -#[doc = "< Vertex shader."] -pub const GPU_VERTEX_SHADER: GPU_SHADER_TYPE = 0; -#[doc = "< Geometry shader."] -pub const GPU_GEOMETRY_SHADER: GPU_SHADER_TYPE = 1; -#[doc = "Shader types."] -pub type GPU_SHADER_TYPE = ::libc::c_uint; -extern "C" { - #[doc = "< GPU command buffer."] - pub static mut gpuCmdBuf: *mut u32_; -} -extern "C" { - #[doc = "< GPU command buffer size."] - pub static mut gpuCmdBufSize: u32_; -} -extern "C" { - #[doc = "< GPU command buffer offset."] - pub static mut gpuCmdBufOffset: u32_; -} -extern "C" { - #[doc = "Sets the GPU command buffer to use.\n # Arguments\n\n* `adr` - Pointer to the command buffer.\n * `size` - Size of the command buffer.\n * `offset` - Offset of the command buffer."] - #[link_name = "GPUCMD_SetBuffer__extern"] - pub fn GPUCMD_SetBuffer(adr: *mut u32_, size: u32_, offset: u32_); -} -extern "C" { - #[doc = "Sets the offset of the GPU command buffer.\n # Arguments\n\n* `offset` - Offset of the command buffer."] - #[link_name = "GPUCMD_SetBufferOffset__extern"] - pub fn GPUCMD_SetBufferOffset(offset: u32_); -} -extern "C" { - #[doc = "Gets the current GPU command buffer.\n # Arguments\n\n* `addr` - Pointer to output the command buffer to.\n * `size` - Pointer to output the size (in words) of the command buffer to.\n * `offset` - Pointer to output the offset of the command buffer to."] - #[link_name = "GPUCMD_GetBuffer__extern"] - pub fn GPUCMD_GetBuffer(addr: *mut *mut u32_, size: *mut u32_, offset: *mut u32_); -} -extern "C" { - #[doc = "Adds raw GPU commands to the current command buffer.\n # Arguments\n\n* `cmd` - Buffer containing commands to add.\n * `size` - Size of the buffer."] - pub fn GPUCMD_AddRawCommands(cmd: *const u32_, size: u32_); -} -extern "C" { - #[doc = "Adds a GPU command to the current command buffer.\n # Arguments\n\n* `header` - Header of the command.\n * `param` - Parameters of the command.\n * `paramlength` - Size of the parameter buffer."] - pub fn GPUCMD_Add(header: u32_, param: *const u32_, paramlength: u32_); -} -extern "C" { - #[doc = "Splits the current GPU command buffer.\n # Arguments\n\n* `addr` - Pointer to output the command buffer to.\n * `size` - Pointer to output the size (in words) of the command buffer to."] - pub fn GPUCMD_Split(addr: *mut *mut u32_, size: *mut u32_); -} -extern "C" { - #[doc = "Converts a 32-bit float to a 16-bit float.\n # Arguments\n\n* `f` - Float to convert.\n # Returns\n\nThe converted float."] - pub fn f32tof16(f: f32) -> u32_; -} -extern "C" { - #[doc = "Converts a 32-bit float to a 20-bit float.\n # Arguments\n\n* `f` - Float to convert.\n # Returns\n\nThe converted float."] - pub fn f32tof20(f: f32) -> u32_; -} -extern "C" { - #[doc = "Converts a 32-bit float to a 24-bit float.\n # Arguments\n\n* `f` - Float to convert.\n # Returns\n\nThe converted float."] - pub fn f32tof24(f: f32) -> u32_; -} -extern "C" { - #[doc = "Converts a 32-bit float to a 31-bit float.\n # Arguments\n\n* `f` - Float to convert.\n # Returns\n\nThe converted float."] - pub fn f32tof31(f: f32) -> u32_; -} -extern "C" { - #[doc = "Adds a command with a single parameter to the current command buffer."] - #[link_name = "GPUCMD_AddSingleParam__extern"] - pub fn GPUCMD_AddSingleParam(header: u32_, param: u32_); -} -#[doc = "< Vertex shader."] -pub const VERTEX_SHDR: DVLE_type = 0; -#[doc = "< Geometry shader."] -pub const GEOMETRY_SHDR: DVLE_type = 1; -#[doc = "DVLE type."] -pub type DVLE_type = ::libc::c_uint; -#[doc = "< Bool."] -pub const DVLE_CONST_BOOL: DVLE_constantType = 0; -#[doc = "< Unsigned 8-bit integer."] -pub const DVLE_CONST_u8: DVLE_constantType = 1; -#[doc = "< 24-bit float."] -pub const DVLE_CONST_FLOAT24: DVLE_constantType = 2; -#[doc = "Constant type."] -pub type DVLE_constantType = ::libc::c_uint; -#[doc = "< Position."] -pub const RESULT_POSITION: DVLE_outputAttribute_t = 0; -#[doc = "< Normal Quaternion."] -pub const RESULT_NORMALQUAT: DVLE_outputAttribute_t = 1; -#[doc = "< Color."] -pub const RESULT_COLOR: DVLE_outputAttribute_t = 2; -#[doc = "< Texture coordinate 0."] -pub const RESULT_TEXCOORD0: DVLE_outputAttribute_t = 3; -#[doc = "< Texture coordinate 0 W."] -pub const RESULT_TEXCOORD0W: DVLE_outputAttribute_t = 4; -#[doc = "< Texture coordinate 1."] -pub const RESULT_TEXCOORD1: DVLE_outputAttribute_t = 5; -#[doc = "< Texture coordinate 2."] -pub const RESULT_TEXCOORD2: DVLE_outputAttribute_t = 6; -#[doc = "< View."] -pub const RESULT_VIEW: DVLE_outputAttribute_t = 8; -#[doc = "< Dummy attribute (used as passthrough for geometry shader input)."] -pub const RESULT_DUMMY: DVLE_outputAttribute_t = 9; -#[doc = "Output attribute."] -pub type DVLE_outputAttribute_t = ::libc::c_uint; -#[doc = "< Point processing mode."] -pub const GSH_POINT: DVLE_geoShaderMode = 0; -#[doc = "< Variable-size primitive processing mode."] -pub const GSH_VARIABLE_PRIM: DVLE_geoShaderMode = 1; -#[doc = "< Fixed-size primitive processing mode."] -pub const GSH_FIXED_PRIM: DVLE_geoShaderMode = 2; -#[doc = "Geometry shader operation modes."] -pub type DVLE_geoShaderMode = ::libc::c_uint; -#[doc = "DVLP data."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct DVLP_s { - #[doc = "< Code size."] - pub codeSize: u32_, - #[doc = "< Code data."] - pub codeData: *mut u32_, - #[doc = "< Operand description size."] - pub opdescSize: u32_, - #[doc = "< Operand description data."] - pub opcdescData: *mut u32_, -} -impl Default for DVLP_s { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "DVLE constant entry data."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct DVLE_constEntry_s { - #[doc = "< Constant type. See DVLE_constantType"] - pub type_: u16_, - #[doc = "< Constant ID."] - pub id: u16_, - #[doc = "< Constant data."] - pub data: [u32_; 4usize], -} -#[doc = "DVLE output entry data."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct DVLE_outEntry_s { - #[doc = "< Output type. See DVLE_outputAttribute_t"] - pub type_: u16_, - #[doc = "< Output register ID."] - pub regID: u16_, - #[doc = "< Output mask."] - pub mask: u8_, - #[doc = "< Unknown."] - pub unk: [u8_; 3usize], -} -#[doc = "DVLE uniform entry data."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct DVLE_uniformEntry_s { - #[doc = "< Symbol offset."] - pub symbolOffset: u32_, - #[doc = "< Start register."] - pub startReg: u16_, - #[doc = "< End register."] - pub endReg: u16_, -} -#[doc = "DVLE data."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct DVLE_s { - #[doc = "< DVLE type."] - pub type_: DVLE_type, - #[doc = "< true = merge vertex/geometry shader outmaps ('dummy' output attribute is present)."] - pub mergeOutmaps: bool, - #[doc = "< Geometry shader operation mode."] - pub gshMode: DVLE_geoShaderMode, - #[doc = "< Starting float uniform register number for storing the fixed-size primitive vertex array."] - pub gshFixedVtxStart: u8_, - #[doc = "< Number of fully-defined vertices in the variable-size primitive vertex array."] - pub gshVariableVtxNum: u8_, - #[doc = "< Number of vertices in the fixed-size primitive vertex array."] - pub gshFixedVtxNum: u8_, - #[doc = "< Contained DVLPs."] - pub dvlp: *mut DVLP_s, - #[doc = "< Offset of the start of the main function."] - pub mainOffset: u32_, - #[doc = "< Offset of the end of the main function."] - pub endmainOffset: u32_, - #[doc = "< Constant table size."] - pub constTableSize: u32_, - #[doc = "< Constant table data."] - pub constTableData: *mut DVLE_constEntry_s, - #[doc = "< Output table size."] - pub outTableSize: u32_, - #[doc = "< Output table data."] - pub outTableData: *mut DVLE_outEntry_s, - #[doc = "< Uniform table size."] - pub uniformTableSize: u32_, - #[doc = "< Uniform table data."] - pub uniformTableData: *mut DVLE_uniformEntry_s, - #[doc = "< Symbol table data."] - pub symbolTableData: *mut ::libc::c_char, - #[doc = "< Output map mask."] - pub outmapMask: u8_, - #[doc = "< Output map data."] - pub outmapData: [u32_; 8usize], - #[doc = "< Output map mode."] - pub outmapMode: u32_, - #[doc = "< Output map attribute clock."] - pub outmapClock: u32_, -} -impl Default for DVLE_s { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "DVLB data."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct DVLB_s { - #[doc = "< DVLE count."] - pub numDVLE: u32_, - #[doc = "< Primary DVLP."] - pub DVLP: DVLP_s, - #[doc = "< Contained DVLE."] - pub DVLE: *mut DVLE_s, -} -impl Default for DVLB_s { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -extern "C" { - #[doc = "Parses a shader binary.\n # Arguments\n\n* `shbinData` - Shader binary data.\n * `shbinSize` - Shader binary size.\n # Returns\n\nThe parsed shader binary."] - pub fn DVLB_ParseFile(shbinData: *mut u32_, shbinSize: u32_) -> *mut DVLB_s; -} -extern "C" { - #[doc = "Frees shader binary data.\n # Arguments\n\n* `dvlb` - DVLB to free."] - pub fn DVLB_Free(dvlb: *mut DVLB_s); -} -extern "C" { - #[doc = "Gets a uniform register index from a shader.\n # Arguments\n\n* `dvle` - Shader to get the register from.\n * `name` - Name of the register.\n # Returns\n\nThe uniform register index."] - pub fn DVLE_GetUniformRegister(dvle: *mut DVLE_s, name: *const ::libc::c_char) -> s8; -} -extern "C" { - #[doc = "Generates a shader output map.\n # Arguments\n\n* `dvle` - Shader to generate an output map for."] - pub fn DVLE_GenerateOutmap(dvle: *mut DVLE_s); -} -#[doc = "24-bit float uniforms."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct float24Uniform_s { - #[doc = "< Uniform ID."] - pub id: u32_, - #[doc = "< Uniform data."] - pub data: [u32_; 3usize], -} -#[doc = "Describes an instance of either a vertex or geometry shader."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct shaderInstance_s { - #[doc = "< Shader DVLE."] - pub dvle: *mut DVLE_s, - #[doc = "< Boolean uniforms."] - pub boolUniforms: u16_, - #[doc = "< Used boolean uniform mask."] - pub boolUniformMask: u16_, - #[doc = "< Integer uniforms."] - pub intUniforms: [u32_; 4usize], - #[doc = "< 24-bit float uniforms."] - pub float24Uniforms: *mut float24Uniform_s, - #[doc = "< Used integer uniform mask."] - pub intUniformMask: u8_, - #[doc = "< Float uniform count."] - pub numFloat24Uniforms: u8_, -} -impl Default for shaderInstance_s { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "Describes an instance of a full shader program."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct shaderProgram_s { - #[doc = "< Vertex shader."] - pub vertexShader: *mut shaderInstance_s, - #[doc = "< Geometry shader."] - pub geometryShader: *mut shaderInstance_s, - #[doc = "< Geometry shader input permutation."] - pub geoShaderInputPermutation: [u32_; 2usize], - #[doc = "< Geometry shader input stride."] - pub geoShaderInputStride: u8_, -} -impl Default for shaderProgram_s { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -extern "C" { - #[must_use] - #[doc = "Initializes a shader instance.\n # Arguments\n\n* `si` - Shader instance to initialize.\n * `dvle` - DVLE to initialize the shader instance with."] - pub fn shaderInstanceInit(si: *mut shaderInstance_s, dvle: *mut DVLE_s) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Frees a shader instance.\n # Arguments\n\n* `si` - Shader instance to free."] - pub fn shaderInstanceFree(si: *mut shaderInstance_s) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets a bool uniform of a shader.\n # Arguments\n\n* `si` - Shader instance to use.\n * `id` - ID of the bool uniform.\n * `value` - Value to set."] - pub fn shaderInstanceSetBool( - si: *mut shaderInstance_s, - id: ::libc::c_int, - value: bool, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Gets a bool uniform of a shader.\n # Arguments\n\n* `si` - Shader instance to use.\n * `id` - ID of the bool uniform.\n * `value` - Pointer to output the value to."] - pub fn shaderInstanceGetBool( - si: *mut shaderInstance_s, - id: ::libc::c_int, - value: *mut bool, - ) -> Result; -} -extern "C" { - #[doc = "Gets the location of a shader's uniform.\n # Arguments\n\n* `si` - Shader instance to use.\n * `name` - Name of the uniform."] - pub fn shaderInstanceGetUniformLocation( - si: *mut shaderInstance_s, - name: *const ::libc::c_char, - ) -> s8; -} -extern "C" { - #[must_use] - #[doc = "Initializes a shader program.\n # Arguments\n\n* `sp` - Shader program to initialize."] - pub fn shaderProgramInit(sp: *mut shaderProgram_s) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Frees a shader program.\n # Arguments\n\n* `sp` - Shader program to free."] - pub fn shaderProgramFree(sp: *mut shaderProgram_s) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the vertex shader of a shader program.\n # Arguments\n\n* `sp` - Shader program to use.\n * `dvle` - Vertex shader to set."] - pub fn shaderProgramSetVsh(sp: *mut shaderProgram_s, dvle: *mut DVLE_s) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Sets the geometry shader of a shader program.\n # Arguments\n\n* `sp` - Shader program to use.\n * `dvle` - Geometry shader to set.\n * `stride` - Input stride of the shader (pass 0 to match the number of outputs of the vertex shader)."] - pub fn shaderProgramSetGsh(sp: *mut shaderProgram_s, dvle: *mut DVLE_s, stride: u8_) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Configures the permutation of the input attributes of the geometry shader of a shader program.\n # Arguments\n\n* `sp` - Shader program to use.\n * `permutation` - Attribute permutation to use."] - pub fn shaderProgramSetGshInputPermutation( - sp: *mut shaderProgram_s, - permutation: u64_, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Configures the shader units to use the specified shader program.\n # Arguments\n\n* `sp` - Shader program to use.\n * `sendVshCode` - When true, the vertex shader's code and operand descriptors are uploaded.\n * `sendGshCode` - When true, the geometry shader's code and operand descriptors are uploaded."] - pub fn shaderProgramConfigure( - sp: *mut shaderProgram_s, - sendVshCode: bool, - sendGshCode: bool, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Same as shaderProgramConfigure, but always loading code/operand descriptors and uploading DVLE constants afterwards.\n # Arguments\n\n* `sp` - Shader program to use."] - pub fn shaderProgramUse(sp: *mut shaderProgram_s) -> Result; -} -#[doc = "< Mono sound"] -pub const NDSP_OUTPUT_MONO: ndspOutputMode = 0; -#[doc = "< Stereo sound"] -pub const NDSP_OUTPUT_STEREO: ndspOutputMode = 1; -#[doc = "< 3D Surround sound"] -pub const NDSP_OUTPUT_SURROUND: ndspOutputMode = 2; -#[doc = "Data types\n# Sound output modes."] -pub type ndspOutputMode = ::libc::c_uint; -#[doc = "< \"Normal\" clipping mode (?)"] -pub const NDSP_CLIP_NORMAL: ndspClippingMode = 0; -#[doc = "< \"Soft\" clipping mode (?)"] -pub const NDSP_CLIP_SOFT: ndspClippingMode = 1; -pub type ndspClippingMode = ::libc::c_uint; -#[doc = " Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl Default for tag_ndspWaveBuf { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "Sound frame callback function. (data = User provided data)"] -pub type ndspCallback = ::core::option::Option; -#[doc = "Auxiliary output callback function. (data = User provided data, nsamples = Number of samples, samples = Sample data)"] -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" { - #[doc = "Initialization and basic operations\n# *\n* Sets up the DSP component.\n # Arguments\n\n* `binary` - DSP binary to load.\n * `size` - Size of the DSP binary.\n * `progMask` - Program RAM block mask to load the binary to.\n * `dataMask` - Data RAM block mask to load the binary to.\n/"] - pub fn ndspUseComponent( - binary: *const ::libc::c_void, - size: u32_, - progMask: u16_, - dataMask: u16_, - ); -} -extern "C" { - #[must_use] - #[doc = "Initializes NDSP."] - pub fn ndspInit() -> Result; -} -extern "C" { - #[doc = "Exits NDSP."] - pub fn ndspExit(); -} -extern "C" { - #[doc = "Gets the number of dropped sound frames.\n # Returns\n\nThe number of dropped sound frames."] - pub fn ndspGetDroppedFrames() -> u32_; -} -extern "C" { - #[doc = "Gets the total sound frame count.\n # Returns\n\nThe total sound frame count."] - pub fn ndspGetFrameCount() -> u32_; -} -extern "C" { - #[doc = "General parameters\n# *\n* Sets the master volume.\n # Arguments\n\n* `volume` - Volume to set. Defaults to 1.0f.\n/"] - pub fn ndspSetMasterVol(volume: f32); -} -extern "C" { - #[doc = "Gets the master volume.\n # Returns\n\nThe master volume."] - pub fn ndspGetMasterVol() -> f32; -} -extern "C" { - #[doc = "Sets the output mode.\n # Arguments\n\n* `mode` - Output mode to set. Defaults to NDSP_OUTPUT_STEREO."] - pub fn ndspSetOutputMode(mode: ndspOutputMode); -} -extern "C" { - #[doc = "Gets the output mode.\n # Returns\n\nThe output mode."] - pub fn ndspGetOutputMode() -> ndspOutputMode; -} -extern "C" { - #[doc = "Sets the clipping mode.\n # Arguments\n\n* `mode` - Clipping mode to set. Defaults to NDSP_CLIP_SOFT."] - pub fn ndspSetClippingMode(mode: ndspClippingMode); -} -extern "C" { - #[doc = "Gets the clipping mode.\n # Returns\n\nThe clipping mode."] - pub fn ndspGetClippingMode() -> ndspClippingMode; -} -extern "C" { - #[doc = "Sets the output count.\n # Arguments\n\n* `count` - Output count to set. Defaults to 2."] - pub fn ndspSetOutputCount(count: ::libc::c_int); -} -extern "C" { - #[doc = "Gets the output count.\n # Returns\n\nThe output count."] - pub fn ndspGetOutputCount() -> ::libc::c_int; -} -extern "C" { - #[doc = "Sets the wave buffer to capture audio to.\n # Arguments\n\n* `capture` - Wave buffer to capture to."] - pub fn ndspSetCapture(capture: *mut ndspWaveBuf); -} -extern "C" { - #[doc = "Sets the sound frame callback.\n # Arguments\n\n* `callback` - Callback to set.\n * `data` - User-defined data to pass to the callback."] - pub fn ndspSetCallback(callback: ndspCallback, data: *mut ::libc::c_void); -} -extern "C" { - #[doc = "Surround\n# *\n* Sets the surround sound depth.\n # Arguments\n\n* `depth` - Depth to set. Defaults to 0x7FFF.\n/"] - pub fn ndspSurroundSetDepth(depth: u16_); -} -extern "C" { - #[doc = "Gets the surround sound depth.\n # Returns\n\nThe surround sound depth."] - pub fn ndspSurroundGetDepth() -> u16_; -} -extern "C" { - #[doc = "Sets the surround sound position.\n # Arguments\n\n* `pos` - Position to set. Defaults to NDSP_SPKPOS_SQUARE."] - pub fn ndspSurroundSetPos(pos: ndspSpeakerPos); -} -extern "C" { - #[doc = "Gets the surround sound position.\n # Returns\n\nThe surround sound speaker position."] - pub fn ndspSurroundGetPos() -> ndspSpeakerPos; -} -extern "C" { - #[doc = "Sets the surround sound rear ratio.\n # Arguments\n\n* `ratio` - Rear ratio to set. Defaults to 0x8000."] - pub fn ndspSurroundSetRearRatio(ratio: u16_); -} -extern "C" { - #[doc = "Gets the surround sound rear ratio.\n # Returns\n\nThe rear ratio."] - pub fn ndspSurroundGetRearRatio() -> u16_; -} -extern "C" { - #[doc = "Auxiliary output\n# *\n* Configures whether an auxiliary output is enabled.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n * `enable` - Whether to enable the auxiliary output.\n/"] - pub fn ndspAuxSetEnable(id: ::libc::c_int, enable: bool); -} -extern "C" { - #[doc = "Gets whether auxiliary output is enabled.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n # Returns\n\nWhether auxiliary output is enabled."] - pub fn ndspAuxIsEnabled(id: ::libc::c_int) -> bool; -} -extern "C" { - #[doc = "Configures whether an auxiliary output should use front bypass.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n * `bypass` - Whether to use front bypass."] - pub fn ndspAuxSetFrontBypass(id: ::libc::c_int, bypass: bool); -} -extern "C" { - #[doc = "Gets whether auxiliary output front bypass is enabled.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n # Returns\n\nWhether auxiliary output front bypass is enabled."] - pub fn ndspAuxGetFrontBypass(id: ::libc::c_int) -> bool; -} -extern "C" { - #[doc = "Sets the volume of an auxiliary output.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n * `volume` - Volume to set."] - pub fn ndspAuxSetVolume(id: ::libc::c_int, volume: f32); -} -extern "C" { - #[doc = "Gets the volume of an auxiliary output.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n # Returns\n\nVolume of the auxiliary output."] - pub fn ndspAuxGetVolume(id: ::libc::c_int) -> f32; -} -extern "C" { - #[doc = "Sets the callback of an auxiliary output.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n * `callback` - Callback to set.\n * `data` - User-defined data to pass to the callback."] - pub fn ndspAuxSetCallback( - id: ::libc::c_int, - callback: ndspAuxCallback, - data: *mut ::libc::c_void, - ); -} -#[doc = "< PCM8"] -pub const NDSP_ENCODING_PCM8: _bindgen_ty_30 = 0; -#[doc = "< PCM16"] -pub const NDSP_ENCODING_PCM16: _bindgen_ty_30 = 1; -#[doc = "< DSPADPCM (GameCube format)"] -pub const NDSP_ENCODING_ADPCM: _bindgen_ty_30 = 2; -#[doc = "Data types\n# Supported sample encodings."] -pub type _bindgen_ty_30 = ::libc::c_uint; -#[doc = "< Buffer contains Mono PCM8."] -pub const NDSP_FORMAT_MONO_PCM8: _bindgen_ty_31 = 1; -#[doc = "< Buffer contains Mono PCM16."] -pub const NDSP_FORMAT_MONO_PCM16: _bindgen_ty_31 = 5; -#[doc = "< Buffer contains Mono ADPCM."] -pub const NDSP_FORMAT_MONO_ADPCM: _bindgen_ty_31 = 9; -#[doc = "< Buffer contains Stereo PCM8."] -pub const NDSP_FORMAT_STEREO_PCM8: _bindgen_ty_31 = 2; -#[doc = "< Buffer contains Stereo PCM16."] -pub const NDSP_FORMAT_STEREO_PCM16: _bindgen_ty_31 = 6; -#[doc = "< (Alias) Buffer contains Mono PCM8."] -pub const NDSP_FORMAT_PCM8: _bindgen_ty_31 = 1; -#[doc = "< (Alias) Buffer contains Mono PCM16."] -pub const NDSP_FORMAT_PCM16: _bindgen_ty_31 = 5; -#[doc = "< (Alias) Buffer contains Mono ADPCM."] -pub const NDSP_FORMAT_ADPCM: _bindgen_ty_31 = 9; -#[doc = "< Front bypass."] -pub const NDSP_FRONT_BYPASS: _bindgen_ty_31 = 16; -#[doc = "< (?) Unknown, under research"] -pub const NDSP_3D_SURROUND_PREPROCESSED: _bindgen_ty_31 = 64; -#[doc = "Channel format flags for use with ndspChnSetFormat."] -pub type _bindgen_ty_31 = ::libc::c_uint; -#[doc = "< Polyphase interpolation"] -pub const NDSP_INTERP_POLYPHASE: ndspInterpType = 0; -#[doc = "< Linear interpolation"] -pub const NDSP_INTERP_LINEAR: ndspInterpType = 1; -#[doc = "< No interpolation"] -pub const NDSP_INTERP_NONE: ndspInterpType = 2; -#[doc = "Interpolation types."] -pub type ndspInterpType = ::libc::c_uint; -extern "C" { - #[doc = "Basic channel operation\n# *\n* Resets a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n/"] - pub fn ndspChnReset(id: ::libc::c_int); -} -extern "C" { - #[doc = "Initializes the parameters of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23)."] - pub fn ndspChnInitParams(id: ::libc::c_int); -} -extern "C" { - #[doc = "Checks whether a channel is currently playing.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n # Returns\n\nWhether the channel is currently playing."] - pub fn ndspChnIsPlaying(id: ::libc::c_int) -> bool; -} -extern "C" { - #[doc = "Gets the current sample position of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n # Returns\n\nThe channel's sample position."] - pub fn ndspChnGetSamplePos(id: ::libc::c_int) -> u32_; -} -extern "C" { - #[doc = "Gets the sequence ID of the wave buffer that is currently playing in a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n # Returns\n\nThe sequence ID of the wave buffer."] - pub fn ndspChnGetWaveBufSeq(id: ::libc::c_int) -> u16_; -} -extern "C" { - #[doc = "Checks whether a channel is currently paused.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n # Returns\n\nWhether the channel is currently paused."] - pub fn ndspChnIsPaused(id: ::libc::c_int) -> bool; -} -extern "C" { - #[doc = "Sets the pause status of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `paused` - Whether the channel is to be paused (true) or unpaused (false)."] - pub fn ndspChnSetPaused(id: ::libc::c_int, paused: bool); -} -extern "C" { - #[doc = "Configuration\n# *\n* Sets the format of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `format` - Format to use.\n/"] - pub fn ndspChnSetFormat(id: ::libc::c_int, format: u16_); -} -extern "C" { - #[doc = "Gets the format of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n # Returns\n\nThe format of the channel."] - pub fn ndspChnGetFormat(id: ::libc::c_int) -> u16_; -} -extern "C" { - #[doc = "Sets the interpolation type of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `type` - Interpolation type to use."] - pub fn ndspChnSetInterp(id: ::libc::c_int, type_: ndspInterpType); -} -extern "C" { - #[doc = "Gets the interpolation type of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n # Returns\n\nThe interpolation type of the channel."] - pub fn ndspChnGetInterp(id: ::libc::c_int) -> ndspInterpType; -} -extern "C" { - #[doc = "Sets the sample rate of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `rate` - Sample rate to use."] - pub fn ndspChnSetRate(id: ::libc::c_int, rate: f32); -} -extern "C" { - #[doc = "Gets the sample rate of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n # Returns\n\nThe sample rate of the channel."] - pub fn ndspChnGetRate(id: ::libc::c_int) -> f32; -} -extern "C" { - #[doc = "Sets the mix parameters (volumes) of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `mix` - Mix parameters to use. Working hypothesis:\n - 0: Front left volume.\n - 1: Front right volume.\n - 2: Back left volume:\n - 3: Back right volume:\n - 4..7: Same as 0..3, but for auxiliary output 0.\n - 8..11: Same as 0..3, but for auxiliary output 1."] - pub fn ndspChnSetMix(id: ::libc::c_int, mix: *mut f32); -} -extern "C" { - #[doc = "Gets the mix parameters (volumes) of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23)\n * `mix` - Mix parameters to write out to. See ndspChnSetMix."] - pub fn ndspChnGetMix(id: ::libc::c_int, mix: *mut f32); -} -extern "C" { - #[doc = "Sets the DSPADPCM coefficients of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `coefs` - DSPADPCM coefficients to use."] - pub fn ndspChnSetAdpcmCoefs(id: ::libc::c_int, coefs: *mut u16_); -} -extern "C" { - #[doc = "Wave buffers\n# *\n* Clears the wave buffer queue of a channel and stops playback.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n/"] - pub fn ndspChnWaveBufClear(id: ::libc::c_int); -} -extern "C" { - #[doc = "Adds a wave buffer to the wave buffer queue of a channel.\n > If the channel's wave buffer queue was empty before the use of this function, playback is started.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `buf` - Wave buffer to add."] - pub fn ndspChnWaveBufAdd(id: ::libc::c_int, buf: *mut ndspWaveBuf); -} -extern "C" { - #[doc = "IIR filters\n# *\n* Configures whether the IIR monopole filter of a channel is enabled.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `enable` - Whether to enable the IIR monopole filter.\n/"] - pub fn ndspChnIirMonoSetEnable(id: ::libc::c_int, enable: bool); -} -extern "C" { - #[doc = "Manually sets up the parameters on monopole filter\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `enable` - Whether to enable the IIR monopole filter."] - pub fn ndspChnIirMonoSetParamsCustomFilter( - id: ::libc::c_int, - a0: f32, - a1: f32, - b0: f32, - ) -> bool; -} -extern "C" { - #[doc = "Sets the monopole to be a low pass filter. (Note: This is a lower-quality filter than the biquad one.)\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `f0` - Low pass cut-off frequency."] - pub fn ndspChnIirMonoSetParamsLowPassFilter(id: ::libc::c_int, f0: f32) -> bool; -} -extern "C" { - #[doc = "Sets the monopole to be a high pass filter. (Note: This is a lower-quality filter than the biquad one.)\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `f0` - High pass cut-off frequency."] - pub fn ndspChnIirMonoSetParamsHighPassFilter(id: ::libc::c_int, f0: f32) -> bool; -} -extern "C" { - #[doc = "Configures whether the IIR biquad filter of a channel is enabled.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `enable` - Whether to enable the IIR biquad filter."] - pub fn ndspChnIirBiquadSetEnable(id: ::libc::c_int, enable: bool); -} -extern "C" { - #[doc = "Manually sets up the parameters of the biquad filter\n # Arguments\n\n* `id` - ID of the channel (0..23)."] - pub fn ndspChnIirBiquadSetParamsCustomFilter( - id: ::libc::c_int, - a0: f32, - a1: f32, - a2: f32, - b0: f32, - b1: f32, - b2: f32, - ) -> bool; -} -extern "C" { - #[doc = "Sets the biquad to be a low pass filter.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `f0` - Low pass cut-off frequency.\n * `Q` - \"Quality factor\", typically should be sqrt(2)/2 (i.e. 0.7071)."] - pub fn ndspChnIirBiquadSetParamsLowPassFilter(id: ::libc::c_int, f0: f32, Q: f32) -> bool; -} -extern "C" { - #[doc = "Sets the biquad to be a high pass filter.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `f0` - High pass cut-off frequency.\n * `Q` - \"Quality factor\", typically should be sqrt(2)/2 (i.e. 0.7071)."] - pub fn ndspChnIirBiquadSetParamsHighPassFilter(id: ::libc::c_int, f0: f32, Q: f32) -> bool; -} -extern "C" { - #[doc = "Sets the biquad to be a band pass filter.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `f0` - Mid-frequency.\n * `Q` - \"Quality factor\", typically should be sqrt(2)/2 (i.e. 0.7071)."] - pub fn ndspChnIirBiquadSetParamsBandPassFilter(id: ::libc::c_int, f0: f32, Q: f32) -> bool; -} -extern "C" { - #[doc = "Sets the biquad to be a notch filter.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `f0` - Notch frequency.\n * `Q` - \"Quality factor\", typically should be sqrt(2)/2 (i.e. 0.7071)."] - pub fn ndspChnIirBiquadSetParamsNotchFilter(id: ::libc::c_int, f0: f32, Q: f32) -> bool; -} -extern "C" { - #[doc = "Sets the biquad to be a peaking equalizer.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n * `f0` - Central frequency.\n * `Q` - \"Quality factor\", typically should be sqrt(2)/2 (i.e. 0.7071).\n * `gain` - Amount of gain (raw value = 10 ^ dB/40)"] - pub fn ndspChnIirBiquadSetParamsPeakingEqualizer( - id: ::libc::c_int, - f0: f32, - Q: f32, - gain: f32, - ) -> bool; -} -#[doc = "< Normal keyboard with several pages (QWERTY/accents/symbol/mobile)"] -pub const SWKBD_TYPE_NORMAL: SwkbdType = 0; -#[doc = "< QWERTY keyboard only."] -pub const SWKBD_TYPE_QWERTY: SwkbdType = 1; -#[doc = "< Number pad."] -pub const SWKBD_TYPE_NUMPAD: SwkbdType = 2; -#[doc = "< On JPN systems, a text keyboard without Japanese input capabilities, otherwise same as SWKBD_TYPE_NORMAL."] -pub const SWKBD_TYPE_WESTERN: SwkbdType = 3; -#[doc = "Keyboard types."] -pub type SwkbdType = ::libc::c_uint; -#[doc = "< All inputs are accepted."] -pub const SWKBD_ANYTHING: SwkbdValidInput = 0; -#[doc = "< Empty inputs are not accepted."] -pub const SWKBD_NOTEMPTY: SwkbdValidInput = 1; -#[doc = "< Empty or blank inputs (consisting solely of whitespace) are not accepted."] -pub const SWKBD_NOTEMPTY_NOTBLANK: SwkbdValidInput = 2; -pub const SWKBD_NOTBLANK_NOTEMPTY: SwkbdValidInput = 2; -#[doc = "< Blank inputs (consisting solely of whitespace) are not accepted, but empty inputs are."] -pub const SWKBD_NOTBLANK: SwkbdValidInput = 3; -#[doc = "< The input must have a fixed length (specified by maxTextLength in swkbdInit)."] -pub const SWKBD_FIXEDLEN: SwkbdValidInput = 4; -#[doc = "Accepted input types."] -pub type SwkbdValidInput = ::libc::c_uint; -#[doc = "< Left button (usually Cancel)"] -pub const SWKBD_BUTTON_LEFT: SwkbdButton = 0; -#[doc = "< Middle button (usually I Forgot)"] -pub const SWKBD_BUTTON_MIDDLE: SwkbdButton = 1; -#[doc = "< Right button (usually OK)"] -pub const SWKBD_BUTTON_RIGHT: SwkbdButton = 2; -pub const SWKBD_BUTTON_CONFIRM: SwkbdButton = 2; -#[doc = "< No button (returned by swkbdInputText in special cases)"] -pub const SWKBD_BUTTON_NONE: SwkbdButton = 3; -#[doc = "Keyboard dialog buttons."] -pub type SwkbdButton = ::libc::c_uint; -#[doc = "< Characters are not concealed."] -pub const SWKBD_PASSWORD_NONE: SwkbdPasswordMode = 0; -#[doc = "< Characters are concealed immediately."] -pub const SWKBD_PASSWORD_HIDE: SwkbdPasswordMode = 1; -#[doc = "< Characters are concealed a second after they've been typed."] -pub const SWKBD_PASSWORD_HIDE_DELAY: SwkbdPasswordMode = 2; -#[doc = "Keyboard password modes."] -pub type SwkbdPasswordMode = ::libc::c_uint; -#[doc = "< Disallow the use of more than a certain number of digits (0 or more)"] -pub const SWKBD_FILTER_DIGITS: _bindgen_ty_32 = 1; -#[doc = "< Disallow the use of the sign."] -pub const SWKBD_FILTER_AT: _bindgen_ty_32 = 2; -#[doc = "< Disallow the use of the % sign."] -pub const SWKBD_FILTER_PERCENT: _bindgen_ty_32 = 4; -#[doc = "< Disallow the use of the sign."] -pub const SWKBD_FILTER_BACKSLASH: _bindgen_ty_32 = 8; -#[doc = "< Disallow profanity using Nintendo's profanity filter."] -pub const SWKBD_FILTER_PROFANITY: _bindgen_ty_32 = 16; -#[doc = "< Use a callback in order to check the input."] -pub const SWKBD_FILTER_CALLBACK: _bindgen_ty_32 = 32; -#[doc = "Keyboard input filtering flags."] -pub type _bindgen_ty_32 = ::libc::c_uint; -#[doc = "< Parental PIN mode."] -pub const SWKBD_PARENTAL: _bindgen_ty_33 = 1; -#[doc = "< Darken the top screen when the keyboard is shown."] -pub const SWKBD_DARKEN_TOP_SCREEN: _bindgen_ty_33 = 2; -#[doc = "< Enable predictive input (necessary for Kanji input in JPN systems)."] -pub const SWKBD_PREDICTIVE_INPUT: _bindgen_ty_33 = 4; -#[doc = "< Enable multiline input."] -pub const SWKBD_MULTILINE: _bindgen_ty_33 = 8; -#[doc = "< Enable fixed-width mode."] -pub const SWKBD_FIXED_WIDTH: _bindgen_ty_33 = 16; -#[doc = "< Allow the usage of the HOME button."] -pub const SWKBD_ALLOW_HOME: _bindgen_ty_33 = 32; -#[doc = "< Allow the usage of a software-reset combination."] -pub const SWKBD_ALLOW_RESET: _bindgen_ty_33 = 64; -#[doc = "< Allow the usage of the POWER button."] -pub const SWKBD_ALLOW_POWER: _bindgen_ty_33 = 128; -#[doc = "< Default to the QWERTY page when the keyboard is shown."] -pub const SWKBD_DEFAULT_QWERTY: _bindgen_ty_33 = 512; -#[doc = "Keyboard features."] -pub type _bindgen_ty_33 = ::libc::c_uint; -#[doc = "< Specifies that the input is valid."] -pub const SWKBD_CALLBACK_OK: SwkbdCallbackResult = 0; -#[doc = "< Displays an error message, then closes the keyboard."] -pub const SWKBD_CALLBACK_CLOSE: SwkbdCallbackResult = 1; -#[doc = "< Displays an error message and continues displaying the keyboard."] -pub const SWKBD_CALLBACK_CONTINUE: SwkbdCallbackResult = 2; -#[doc = "Keyboard filter callback return values."] -pub type SwkbdCallbackResult = ::libc::c_uint; -#[doc = "< Dummy/unused."] -pub const SWKBD_NONE: SwkbdResult = -1; -#[doc = "< Invalid parameters to swkbd."] -pub const SWKBD_INVALID_INPUT: SwkbdResult = -2; -#[doc = "< Out of memory."] -pub const SWKBD_OUTOFMEM: SwkbdResult = -3; -#[doc = "< The button was clicked in 1-button dialogs."] -pub const SWKBD_D0_CLICK: SwkbdResult = 0; -#[doc = "< The left button was clicked in 2-button dialogs."] -pub const SWKBD_D1_CLICK0: SwkbdResult = 1; -#[doc = "< The right button was clicked in 2-button dialogs."] -pub const SWKBD_D1_CLICK1: SwkbdResult = 2; -#[doc = "< The left button was clicked in 3-button dialogs."] -pub const SWKBD_D2_CLICK0: SwkbdResult = 3; -#[doc = "< The middle button was clicked in 3-button dialogs."] -pub const SWKBD_D2_CLICK1: SwkbdResult = 4; -#[doc = "< The right button was clicked in 3-button dialogs."] -pub const SWKBD_D2_CLICK2: SwkbdResult = 5; -#[doc = "< The HOME button was pressed."] -pub const SWKBD_HOMEPRESSED: SwkbdResult = 10; -#[doc = "< The soft-reset key combination was pressed."] -pub const SWKBD_RESETPRESSED: SwkbdResult = 11; -#[doc = "< The POWER button was pressed."] -pub const SWKBD_POWERPRESSED: SwkbdResult = 12; -#[doc = "< The parental PIN was verified successfully."] -pub const SWKBD_PARENTAL_OK: SwkbdResult = 20; -#[doc = "< The parental PIN was incorrect."] -pub const SWKBD_PARENTAL_FAIL: SwkbdResult = 21; -#[doc = "< The filter callback returned SWKBD_CALLBACK_CLOSE."] -pub const SWKBD_BANNED_INPUT: SwkbdResult = 30; -#[doc = "Keyboard return values."] -pub type SwkbdResult = ::libc::c_int; -#[doc = "Keyboard dictionary word for predictive input."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct SwkbdDictWord { - #[doc = "< Reading of the word (that is, the string that needs to be typed)."] - pub reading: [u16_; 41usize], - #[doc = "< Spelling of the word."] - pub word: [u16_; 41usize], - #[doc = "< Language the word applies to."] - pub language: u8_, - #[doc = "< Specifies if the word applies to all languages."] - pub all_languages: bool, -} -impl Default for SwkbdDictWord { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "Keyboard filter callback function."] -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, ->; -#[doc = "Keyboard status data."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct SwkbdStatusData { - pub data: [u32_; 17usize], -} -#[doc = "Keyboard predictive input learning data."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct SwkbdLearningData { - pub data: [u32_; 10523usize], -} -impl Default for SwkbdLearningData { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "Internal libctru book-keeping structure for software keyboards."] -#[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, -} -impl Default for SwkbdExtra { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "Software keyboard parameter structure, it shouldn't be modified directly."] -#[repr(C)] -#[derive(Copy, Clone)] -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)] -#[derive(Copy, Clone)] -pub union SwkbdState__bindgen_ty_1 { - pub reserved: [u8_; 171usize], - pub extra: SwkbdExtra, -} -impl Default for SwkbdState__bindgen_ty_1 { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl Default for SwkbdState { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -extern "C" { - #[doc = "Initializes software keyboard status.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `type` - Keyboard type.\n * `numButtons` - Number of dialog buttons to display (1, 2 or 3).\n * `maxTextLength` - Maximum number of UTF-16 code units that input text can have (or -1 to let libctru use a big default)."] - pub fn swkbdInit( - swkbd: *mut SwkbdState, - type_: SwkbdType, - numButtons: ::libc::c_int, - maxTextLength: ::libc::c_int, - ); -} -extern "C" { - #[doc = "Configures password mode in a software keyboard.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `mode` - Password mode."] - #[link_name = "swkbdSetPasswordMode__extern"] - pub fn swkbdSetPasswordMode(swkbd: *mut SwkbdState, mode: SwkbdPasswordMode); -} -extern "C" { - #[doc = "Configures input validation in a software keyboard.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `validInput` - Specifies which inputs are valid.\n * `filterFlags` - Bitmask specifying which characters are disallowed (filtered).\n * `maxDigits` - In case digits are disallowed, specifies how many digits are allowed at maximum in input strings (0 completely restricts digit input)."] - #[link_name = "swkbdSetValidation__extern"] - pub fn swkbdSetValidation( - swkbd: *mut SwkbdState, - validInput: SwkbdValidInput, - filterFlags: u32_, - maxDigits: ::libc::c_int, - ); -} -extern "C" { - #[doc = "Configures what characters will the two bottom keys in a numpad produce.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `left` - Unicode codepoint produced by the leftmost key in the bottom row (0 hides the key).\n * `left` - Unicode codepoint produced by the rightmost key in the bottom row (0 hides the key)."] - #[link_name = "swkbdSetNumpadKeys__extern"] - pub fn swkbdSetNumpadKeys(swkbd: *mut SwkbdState, left: ::libc::c_int, right: ::libc::c_int); -} -extern "C" { - #[doc = "Specifies which special features are enabled in a software keyboard.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `features` - Feature bitmask."] - pub fn swkbdSetFeatures(swkbd: *mut SwkbdState, features: u32_); -} -extern "C" { - #[doc = "Sets the hint text of a software keyboard (that is, the help text that is displayed when the textbox is empty).\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `text` - Hint text."] - pub fn swkbdSetHintText(swkbd: *mut SwkbdState, text: *const ::libc::c_char); -} -extern "C" { - #[doc = "Configures a dialog button in a software keyboard.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `button` - Specifies which button to configure.\n * `text` - Button text.\n * `submit` - Specifies whether pushing the button will submit the text or discard it."] - pub fn swkbdSetButton( - swkbd: *mut SwkbdState, - button: SwkbdButton, - text: *const ::libc::c_char, - submit: bool, - ); -} -extern "C" { - #[doc = "Sets the initial text that a software keyboard will display on launch.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `text` - Initial text."] - pub fn swkbdSetInitialText(swkbd: *mut SwkbdState, text: *const ::libc::c_char); -} -extern "C" { - #[doc = "Configures a word in a predictive dictionary for use with a software keyboard.\n # Arguments\n\n* `word` - Pointer to dictionary word structure.\n * `reading` - Reading of the word, that is, the sequence of characters that need to be typed to trigger the word in the predictive input system.\n * `text` - Spelling of the word, that is, the actual characters that will be produced when the user decides to select the word."] - pub fn swkbdSetDictWord( - word: *mut SwkbdDictWord, - reading: *const ::libc::c_char, - text: *const ::libc::c_char, - ); -} -extern "C" { - #[doc = "Sets the custom word dictionary to be used with the predictive input system of a software keyboard.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `dict` - Pointer to dictionary words.\n * `wordCount` - Number of words in the dictionary."] - pub fn swkbdSetDictionary( - swkbd: *mut SwkbdState, - dict: *const SwkbdDictWord, - wordCount: ::libc::c_int, - ); -} -extern "C" { - #[doc = "Configures software keyboard internal status management.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `data` - Pointer to internal status structure (can be in, out or both depending on the other parameters).\n * `in` - Specifies whether the data should be read from the structure when the keyboard is launched.\n * `out` - Specifies whether the data should be written to the structure when the keyboard is closed."] - pub fn swkbdSetStatusData( - swkbd: *mut SwkbdState, - data: *mut SwkbdStatusData, - in_: bool, - out: bool, - ); -} -extern "C" { - #[doc = "Configures software keyboard predictive input learning data management.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `data` - Pointer to learning data structure (can be in, out or both depending on the other parameters).\n * `in` - Specifies whether the data should be read from the structure when the keyboard is launched.\n * `out` - Specifies whether the data should be written to the structure when the keyboard is closed."] - pub fn swkbdSetLearningData( - swkbd: *mut SwkbdState, - data: *mut SwkbdLearningData, - in_: bool, - out: bool, - ); -} -extern "C" { - #[doc = "Configures a custom function to be used to check the validity of input when it is submitted in a software keyboard.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `callback` - Filter callback function.\n * `user` - Custom data to be passed to the callback function."] - pub fn swkbdSetFilterCallback( - swkbd: *mut SwkbdState, - callback: SwkbdCallbackFn, - user: *mut ::libc::c_void, - ); -} -extern "C" { - #[doc = "Launches a software keyboard in order to input text.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `buf` - Pointer to output buffer which will hold the inputted text.\n * `bufsize` - Maximum number of UTF-8 code units that the buffer can hold (including null terminator).\n # Returns\n\nThe identifier of the dialog button that was pressed, or SWKBD_BUTTON_NONE if a different condition was triggered - in that case use swkbdGetResult to check the condition."] - pub fn swkbdInputText( - swkbd: *mut SwkbdState, - buf: *mut ::libc::c_char, - bufsize: usize, - ) -> SwkbdButton; -} -extern "C" { - #[doc = "Retrieves the result condition of a software keyboard after it has been used.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n # Returns\n\nThe result value."] - #[link_name = "swkbdGetResult__extern"] - pub fn swkbdGetResult(swkbd: *mut SwkbdState) -> SwkbdResult; -} -#[doc = " Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -extern "C" { - #[doc = "Init the error applet.\n # Arguments\n\n* `err` - Pointer to errorConf.\n * `type` - errorType Type of error.\n * `lang` - CFG_Language Lang of error."] - pub fn errorInit(err: *mut errorConf, type_: errorType, lang: CFG_Language); -} -extern "C" { - #[doc = "Sets error code to display.\n # Arguments\n\n* `err` - Pointer to errorConf.\n * `error` - Error-code to display."] - pub fn errorCode(err: *mut errorConf, error: ::libc::c_int); -} -extern "C" { - #[doc = "Sets error text to display.\n # Arguments\n\n* `err` - Pointer to errorConf.\n * `text` - Error-text to display."] - pub fn errorText(err: *mut errorConf, text: *const ::libc::c_char); -} -extern "C" { - #[doc = "Displays the error applet.\n # Arguments\n\n* `err` - Pointer to errorConf."] - pub fn errorDisp(err: *mut errorConf); -} -#[doc = "Parameter structure passed to AppletEd"] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct MiiSelectorConf { - #[doc = "< Enables canceling of selection if nonzero."] - pub enable_cancel_button: u8_, - #[doc = "< Makes Guets Miis selectable if nonzero."] - pub enable_selecting_guests: u8_, - #[doc = "< Shows applet on top screen if nonzero,\n< otherwise show it on the bottom screen."] - pub show_on_top_screen: u8_, - #[doc = "< "] - pub _unk0x3: [u8_; 5usize], - #[doc = "< UTF16-LE string displayed at the top of the applet. If\n< set to the empty string, a default title is displayed."] - pub title: [u16_; 64usize], - #[doc = "< "] - pub _unk0x88: [u8_; 4usize], - #[doc = "< If nonzero, the applet shows a page with Guest\n< Miis on launch."] - pub show_guest_page: u8_, - #[doc = "< "] - pub _unk0x8D: [u8_; 3usize], - #[doc = "< Index of the initially selected Mii. If\n< MiiSelectorConf.show_guest_page is\n< set, this is the index of a Guest Mii,\n< otherwise that of a user Mii."] - pub initial_index: u32_, - #[doc = "< Each byte set to a nonzero value\n< enables its corresponding Guest\n< Mii to be enabled for selection."] - pub mii_guest_whitelist: [u8_; 6usize], - #[doc = "< Each byte set to a nonzero value enables\n< its corresponding user Mii to be enabled\n< for selection."] - pub mii_whitelist: [u8_; 100usize], - #[doc = "< "] - pub _unk0xFE: u16_, - #[doc = "< Will be set to MIISELECTOR_MAGIC before launching the\n< applet."] - pub magic: u32_, -} -impl Default for MiiSelectorConf { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "Structure written by AppletEd"] -#[repr(C)] -pub struct MiiSelectorReturn { - #[doc = "< 0 if a Mii was selected, 1 if the selection was\n< canceled."] - pub no_mii_selected: u32_, - #[doc = "< 1 if a Guest Mii was selected, 0 otherwise."] - pub guest_mii_was_selected: u32_, - #[doc = "< Index of the selected Guest Mii,\n< 0xFFFFFFFF if no guest was selected."] - pub guest_mii_index: u32_, - #[doc = "< Data of selected Mii."] - pub mii: MiiData, - #[doc = "< "] - pub _pad0x68: u16_, - #[doc = "< Checksum of the returned Mii data.\n< Stored as a big-endian value; use\n< miiSelectorChecksumIsValid to\n< verify."] - pub checksum: u16_, - #[doc = "< Localized name of a Guest Mii,\n< if one was selected (UTF16-LE\n< string). Zeroed otherwise."] - pub guest_mii_name: [u16_; 12usize], -} -impl Default for MiiSelectorReturn { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "< Show the cancel button"] -pub const MIISELECTOR_CANCEL: _bindgen_ty_35 = 1; -#[doc = "< Make Guets Miis selectable"] -pub const MIISELECTOR_GUESTS: _bindgen_ty_35 = 2; -#[doc = "< Show AppletEd on top screen"] -pub const MIISELECTOR_TOP: _bindgen_ty_35 = 4; -#[doc = "< Start on guest page"] -pub const MIISELECTOR_GUESTSTART: _bindgen_ty_35 = 8; -#[doc = "AppletEd options"] -pub type _bindgen_ty_35 = ::libc::c_uint; -extern "C" { - #[doc = "Initialize Mii selector config\n # Arguments\n\n* `conf` - Pointer to Miiselector config."] - pub fn miiSelectorInit(conf: *mut MiiSelectorConf); -} -extern "C" { - #[doc = "Launch the Mii selector library applet\n\n # Arguments\n\n* `conf` - Configuration determining how the applet should behave"] - pub fn miiSelectorLaunch(conf: *const MiiSelectorConf, returnbuf: *mut MiiSelectorReturn); -} -extern "C" { - #[doc = "Sets title of the Mii selector library applet\n\n # Arguments\n\n* `conf` - Pointer to miiSelector configuration\n * `text` - Title text of Mii selector"] - pub fn miiSelectorSetTitle(conf: *mut MiiSelectorConf, text: *const ::libc::c_char); -} -extern "C" { - #[doc = "Specifies which special options are enabled in the Mii selector\n\n # Arguments\n\n* `conf` - Pointer to miiSelector configuration\n * `options` - Options bitmask"] - pub fn miiSelectorSetOptions(conf: *mut MiiSelectorConf, options: u32_); -} -extern "C" { - #[doc = "Specifies which guest Miis will be selectable\n\n # Arguments\n\n* `conf` - Pointer to miiSelector configuration\n * `index` - Index of the guest Miis that will be whitelisted.\n MIISELECTOR_GUESTMII_SLOTS can be used to whitelist all the guest Miis."] - pub fn miiSelectorWhitelistGuestMii(conf: *mut MiiSelectorConf, index: u32_); -} -extern "C" { - #[doc = "Specifies which guest Miis will be unselectable\n\n # Arguments\n\n* `conf` - Pointer to miiSelector configuration\n * `index` - Index of the guest Miis that will be blacklisted.\n MIISELECTOR_GUESTMII_SLOTS can be used to blacklist all the guest Miis."] - pub fn miiSelectorBlacklistGuestMii(conf: *mut MiiSelectorConf, index: u32_); -} -extern "C" { - #[doc = "Specifies which user Miis will be selectable\n\n # Arguments\n\n* `conf` - Pointer to miiSelector configuration\n * `index` - Index of the user Miis that will be whitelisted.\n MIISELECTOR_USERMII_SLOTS can be used to whitlist all the user Miis"] - pub fn miiSelectorWhitelistUserMii(conf: *mut MiiSelectorConf, index: u32_); -} -extern "C" { - #[doc = "Specifies which user Miis will be selectable\n\n # Arguments\n\n* `conf` - Pointer to miiSelector configuration\n * `index` - Index of the user Miis that will be blacklisted.\n MIISELECTOR_USERMII_SLOTS can be used to blacklist all the user Miis"] - pub fn miiSelectorBlacklistUserMii(conf: *mut MiiSelectorConf, index: u32_); -} -extern "C" { - #[doc = "Specifies which Mii the cursor should start from\n\n # Arguments\n\n* `conf` - Pointer to miiSelector configuration\n * `index` - Indexed number of the Mii that the cursor will start on.\n If there is no mii with that index, the the cursor will start at the Mii\n with the index 0 (the personal Mii)."] - #[link_name = "miiSelectorSetInitialIndex__extern"] - pub fn miiSelectorSetInitialIndex(conf: *mut MiiSelectorConf, index: u32_); -} -extern "C" { - #[doc = "Get Mii name\n\n # Arguments\n\n* `returnbuf` - Pointer to miiSelector return\n * `out` - String containing a Mii's name\n * `max_size` - Size of string. Since UTF8 characters range in size from 1-3 bytes\n (assuming that no non-BMP characters are used), this value should be 36 (or 30 if you are not\n dealing with guest miis)."] - pub fn miiSelectorReturnGetName( - returnbuf: *const MiiSelectorReturn, - out: *mut ::libc::c_char, - max_size: usize, - ); -} -extern "C" { - #[doc = "Get Mii Author\n\n # Arguments\n\n* `returnbuf` - Pointer to miiSelector return\n * `out` - String containing a Mii's author\n * `max_size` - Size of string. Since UTF8 characters range in size from 1-3 bytes\n (assuming that no non-BMP characters are used), this value should be 30."] - pub fn miiSelectorReturnGetAuthor( - returnbuf: *const MiiSelectorReturn, - out: *mut ::libc::c_char, - max_size: usize, - ); -} -extern "C" { - #[doc = "Verifies that the Mii data returned from the applet matches its\n checksum\n\n # Arguments\n\n* `returnbuf` - Buffer filled by Mii selector applet\n # Returns\n\n`true` if `returnbuf->checksum` is the same as the one computed from `returnbuf`"] - pub fn miiSelectorChecksumIsValid(returnbuf: *const MiiSelectorReturn) -> bool; -} -#[doc = "Open directory struct"] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct archive_dir_t { - pub magic: u32_, - #[doc = "\"arch\""] - pub fd: Handle, - #[doc = "CTRU handle"] - pub index: isize, - #[doc = "Current entry index"] - pub size: usize, - #[doc = "Current batch size"] - pub entry_data: [FS_DirectoryEntry; 32usize], -} -impl Default for archive_dir_t { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -extern "C" { - #[must_use] - #[doc = "Mounts the SD"] - pub fn archiveMountSdmc() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Mounts and opens an archive as deviceName\n Returns either an archive open error code, or -1 for generic failure"] - pub fn archiveMount( - archiveID: FS_ArchiveID, - archivePath: FS_Path, - deviceName: *const ::libc::c_char, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Uses FSUSER_ControlArchive with control action ARCHIVE_ACTION_COMMIT_SAVE_DATA on the opened archive. Not done automatically at unmount.\n Returns -1 if the specified device is not found"] - pub fn archiveCommitSaveData(deviceName: *const ::libc::c_char) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Unmounts the specified device, closing its archive in the process\n Returns -1 if the specified device was not found"] - pub fn archiveUnmount(deviceName: *const ::libc::c_char) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Unmounts all devices and cleans up any resources used by the driver"] - pub fn archiveUnmountAll() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Get a file's mtime"] - pub fn archive_getmtime(name: *const ::libc::c_char, mtime: *mut u64_) -> Result; -} -#[doc = "RomFS header."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct romfs_header { - #[doc = "< Size of the header."] - pub headerSize: u32_, - #[doc = "< Offset of the directory hash table."] - pub dirHashTableOff: u32_, - #[doc = "< Size of the directory hash table."] - pub dirHashTableSize: u32_, - #[doc = "< Offset of the directory table."] - pub dirTableOff: u32_, - #[doc = "< Size of the directory table."] - pub dirTableSize: u32_, - #[doc = "< Offset of the file hash table."] - pub fileHashTableOff: u32_, - #[doc = "< Size of the file hash table."] - pub fileHashTableSize: u32_, - #[doc = "< Offset of the file table."] - pub fileTableOff: u32_, - #[doc = "< Size of the file table."] - pub fileTableSize: u32_, - #[doc = "< Offset of the file data."] - pub fileDataOff: u32_, -} -#[doc = "RomFS directory."] -#[repr(C)] -#[derive(Debug, Default)] -pub struct romfs_dir { - #[doc = "< Offset of the parent directory."] - pub parent: u32_, - #[doc = "< Offset of the next sibling directory."] - pub sibling: u32_, - #[doc = "< Offset of the first child directory."] - pub childDir: u32_, - #[doc = "< Offset of the first file."] - pub childFile: u32_, - #[doc = "< Directory hash table pointer."] - pub nextHash: u32_, - #[doc = "< Name length."] - pub nameLen: u32_, - #[doc = "< Name. (UTF-16)"] - pub name: __IncompleteArrayField, -} -#[doc = "RomFS file."] -#[repr(C)] -#[derive(Debug, Default)] -pub struct romfs_file { - #[doc = "< Offset of the parent directory."] - pub parent: u32_, - #[doc = "< Offset of the next sibling file."] - pub sibling: u32_, - #[doc = "< Offset of the file's data."] - pub dataOff: u64_, - #[doc = "< Length of the file's data."] - pub dataSize: u64_, - #[doc = "< File hash table pointer."] - pub nextHash: u32_, - #[doc = "< Name length."] - pub nameLen: u32_, - #[doc = "< Name. (UTF-16)"] - pub name: __IncompleteArrayField, -} -extern "C" { - #[must_use] - #[doc = "Mounts the Application's RomFS.\n # Arguments\n\n* `name` - Device mount name.\n > This function is intended to be used to access one's own RomFS.\n If the application is running as 3DSX, it mounts the embedded RomFS section inside the 3DSX.\n If on the other hand it's an NCCH, it behaves identically to romfsMountFromCurrentProcess."] - pub fn romfsMountSelf(name: *const ::libc::c_char) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Mounts RomFS from an open file.\n # Arguments\n\n* `fd` - FSFILE handle of the RomFS image.\n * `offset` - Offset of the RomFS within the file.\n * `name` - Device mount name."] - pub fn romfsMountFromFile(fd: Handle, offset: u32_, name: *const ::libc::c_char) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Mounts RomFS using the current process host program RomFS.\n # Arguments\n\n* `name` - Device mount name."] - pub fn romfsMountFromCurrentProcess(name: *const ::libc::c_char) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Mounts RomFS from the specified title.\n # Arguments\n\n* `tid` - Title ID\n * `mediatype` - Mediatype\n * `name` - Device mount name."] - pub fn romfsMountFromTitle( - tid: u64_, - mediatype: FS_MediaType, - name: *const ::libc::c_char, - ) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Unmounts the RomFS device."] - pub fn romfsUnmount(name: *const ::libc::c_char) -> Result; -} -extern "C" { - #[must_use] - #[doc = "Wrapper for romfsMountSelf with the default \"romfs\" device name."] - #[link_name = "romfsInit__extern"] - pub fn romfsInit() -> Result; -} -extern "C" { - #[must_use] - #[doc = "Wrapper for romfsUnmount with the default \"romfs\" device name."] - #[link_name = "romfsExit__extern"] - pub fn romfsExit() -> Result; -} -#[doc = "Character width information structure."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct charWidthInfo_s { - #[doc = "< Horizontal offset to draw the glyph with."] - pub left: s8, - #[doc = "< Width of the glyph."] - pub glyphWidth: u8_, - #[doc = "< Width of the character, that is, horizontal distance to advance."] - pub charWidth: u8_, -} -#[doc = "Font texture sheet information."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct TGLP_s { - #[doc = "< Width of a glyph cell."] - pub cellWidth: u8_, - #[doc = "< Height of a glyph cell."] - pub cellHeight: u8_, - #[doc = "< Vertical position of the baseline."] - pub baselinePos: u8_, - #[doc = "< Maximum character width."] - pub maxCharWidth: u8_, - #[doc = "< Size in bytes of a texture sheet."] - pub sheetSize: u32_, - #[doc = "< Number of texture sheets."] - pub nSheets: u16_, - #[doc = "< GPU texture format (GPU_TEXCOLOR)."] - pub sheetFmt: u16_, - #[doc = "< Number of glyphs per row per sheet."] - pub nRows: u16_, - #[doc = "< Number of glyph rows per sheet."] - pub nLines: u16_, - #[doc = "< Texture sheet width."] - pub sheetWidth: u16_, - #[doc = "< Texture sheet height."] - pub sheetHeight: u16_, - #[doc = "< Pointer to texture sheet data."] - pub sheetData: *mut u8_, -} -impl Default for TGLP_s { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "Font character width information block type."] -pub type CWDH_s = tag_CWDH_s; -#[doc = "Font character width information block structure."] -#[repr(C)] -#[derive(Debug)] -pub struct tag_CWDH_s { - #[doc = "< First Unicode codepoint the block applies to."] - pub startIndex: u16_, - #[doc = "< Last Unicode codepoint the block applies to."] - pub endIndex: u16_, - #[doc = "< Pointer to the next block."] - pub next: *mut CWDH_s, - #[doc = "< Table of character width information structures."] - pub widths: __IncompleteArrayField, -} -impl Default for tag_CWDH_s { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "< Identity mapping."] -pub const CMAP_TYPE_DIRECT: _bindgen_ty_36 = 0; -#[doc = "< Mapping using a table."] -pub const CMAP_TYPE_TABLE: _bindgen_ty_36 = 1; -#[doc = "< Mapping using a list of mapped characters."] -pub const CMAP_TYPE_SCAN: _bindgen_ty_36 = 2; -#[doc = "Font character map methods."] -pub type _bindgen_ty_36 = ::libc::c_uint; -#[doc = "Font character map type."] -pub type CMAP_s = tag_CMAP_s; -#[doc = "Font character map structure."] -#[repr(C)] -pub struct tag_CMAP_s { - #[doc = "< First Unicode codepoint the block applies to."] - pub codeBegin: u16_, - #[doc = "< Last Unicode codepoint the block applies to."] - pub codeEnd: u16_, - #[doc = "< Mapping method."] - pub mappingMethod: u16_, - pub reserved: u16_, - #[doc = "< Pointer to the next map."] - 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 { - #[doc = "< For CMAP_TYPE_DIRECT: index of the first glyph."] - pub indexOffset: __BindgenUnionField, - #[doc = "< For CMAP_TYPE_TABLE: table of glyph indices."] - pub indexTable: __BindgenUnionField<[u16_; 0usize]>, - pub __bindgen_anon_1: __BindgenUnionField, - pub bindgen_union_field: u16, -} -#[doc = "For CMAP_TYPE_SCAN: Mapping data."] -#[repr(C)] -#[derive(Debug, Default)] -pub struct tag_CMAP_s__bindgen_ty_1__bindgen_ty_1 { - #[doc = "< Number of pairs."] - pub nScanEntries: u16_, - pub scanEntries: __IncompleteArrayField, -} -#[doc = "Mapping pairs."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct tag_CMAP_s__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 { - #[doc = "< Unicode codepoint."] - pub code: u16_, - #[doc = "< Mapped glyph index."] - pub glyphIndex: u16_, -} -impl Default for tag_CMAP_s__bindgen_ty_1 { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl Default for tag_CMAP_s { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "Font information structure."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct FINF_s { - #[doc = "< Signature (FINF)."] - pub signature: u32_, - #[doc = "< Section size."] - pub sectionSize: u32_, - #[doc = "< Font type"] - pub fontType: u8_, - #[doc = "< Line feed vertical distance."] - pub lineFeed: u8_, - #[doc = "< Glyph index of the replacement character."] - pub alterCharIndex: u16_, - #[doc = "< Default character width information."] - pub defaultWidth: charWidthInfo_s, - #[doc = "< Font encoding (?)"] - pub encoding: u8_, - #[doc = "< Pointer to texture sheet information."] - pub tglp: *mut TGLP_s, - #[doc = "< Pointer to the first character width information block."] - pub cwdh: *mut CWDH_s, - #[doc = "< Pointer to the first character map."] - pub cmap: *mut CMAP_s, - #[doc = "< Font height."] - pub height: u8_, - #[doc = "< Font width."] - pub width: u8_, - #[doc = "< Font ascent."] - pub ascent: u8_, - pub padding: u8_, -} -impl Default for FINF_s { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "Font structure."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct CFNT_s { - #[doc = "< Signature (CFNU)."] - pub signature: u32_, - #[doc = "< Endianness constant (0xFEFF)."] - pub endianness: u16_, - #[doc = "< Header size."] - pub headerSize: u16_, - #[doc = "< Format version."] - pub version: u32_, - #[doc = "< File size."] - pub fileSize: u32_, - #[doc = "< Number of blocks."] - pub nBlocks: u32_, - #[doc = "< Font information."] - pub finf: FINF_s, -} -impl Default for CFNT_s { - fn default() -> Self { - let mut s = ::core::mem::MaybeUninit::::uninit(); - unsafe { - ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = "Font glyph position structure."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct fontGlyphPos_s { - #[doc = "< Texture sheet index to use to render the glyph."] - pub sheetIndex: ::libc::c_int, - #[doc = "< Horizontal offset to draw the glyph width."] - pub xOffset: f32, - #[doc = "< Horizontal distance to advance after drawing the glyph."] - pub xAdvance: f32, - #[doc = "< Glyph width."] - pub width: f32, - pub texcoord: fontGlyphPos_s__bindgen_ty_1, - pub vtxcoord: fontGlyphPos_s__bindgen_ty_2, -} -#[doc = "Texture coordinates to use to render the glyph."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct fontGlyphPos_s__bindgen_ty_1 { - pub left: f32, - pub top: f32, - pub right: f32, - pub bottom: f32, -} -#[doc = "Vertex coordinates to use to render the glyph."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct fontGlyphPos_s__bindgen_ty_2 { - pub left: f32, - pub top: f32, - pub right: f32, - pub bottom: f32, -} -#[doc = "< Calculates vertex coordinates in addition to texture coordinates."] -pub const GLYPH_POS_CALC_VTXCOORD: _bindgen_ty_37 = 1; -#[doc = "< Position the glyph at the baseline instead of at the top-left corner."] -pub const GLYPH_POS_AT_BASELINE: _bindgen_ty_37 = 2; -#[doc = "< Indicates that the Y axis points up instead of down."] -pub const GLYPH_POS_Y_POINTS_UP: _bindgen_ty_37 = 4; -#[doc = "Flags for use with fontCalcGlyphPos."] -pub type _bindgen_ty_37 = ::libc::c_uint; -extern "C" { - #[must_use] - #[doc = "Ensures the shared system font is mapped."] - pub fn fontEnsureMapped() -> Result; -} -extern "C" { - #[doc = "Fixes the pointers internal to a just-loaded font\n # Arguments\n\n* `font` - Font to fix\n > Should never be run on the system font, and only once on any other font."] - pub fn fontFixPointers(font: *mut CFNT_s); -} -extern "C" { - #[doc = "Gets the currently loaded system font"] - #[link_name = "fontGetSystemFont__extern"] - pub fn fontGetSystemFont() -> *mut CFNT_s; -} -extern "C" { - #[doc = "Retrieves the font information structure of a font.\n # Arguments\n\n* `font` - Pointer to font structure. If NULL, the shared system font is used."] - #[link_name = "fontGetInfo__extern"] - pub fn fontGetInfo(font: *mut CFNT_s) -> *mut FINF_s; -} -extern "C" { - #[doc = "Retrieves the texture sheet information of a font.\n # Arguments\n\n* `font` - Pointer to font structure. If NULL, the shared system font is used."] - #[link_name = "fontGetGlyphInfo__extern"] - pub fn fontGetGlyphInfo(font: *mut CFNT_s) -> *mut TGLP_s; -} -extern "C" { - #[doc = "Retrieves the pointer to texture data for the specified texture sheet.\n # Arguments\n\n* `font` - Pointer to font structure. If NULL, the shared system font is used.\n * `sheetIndex` - Index of the texture sheet."] - #[link_name = "fontGetGlyphSheetTex__extern"] - pub fn fontGetGlyphSheetTex( - font: *mut CFNT_s, - sheetIndex: ::libc::c_int, - ) -> *mut ::libc::c_void; -} -extern "C" { - #[doc = "Retrieves the glyph index of the specified Unicode codepoint.\n # Arguments\n\n* `font` - Pointer to font structure. If NULL, the shared system font is used.\n * `codePoint` - Unicode codepoint."] - pub fn fontGlyphIndexFromCodePoint(font: *mut CFNT_s, codePoint: u32_) -> ::libc::c_int; -} -extern "C" { - #[doc = "Retrieves character width information of the specified glyph.\n # Arguments\n\n* `font` - Pointer to font structure. If NULL, the shared system font is used.\n * `glyphIndex` - Index of the glyph."] - pub fn fontGetCharWidthInfo( - font: *mut CFNT_s, - glyphIndex: ::libc::c_int, - ) -> *mut charWidthInfo_s; -} -extern "C" { - #[doc = "Calculates position information for the specified glyph.\n # Arguments\n\n* `out` - Output structure in which to write the information.\n * `font` - Pointer to font structure. If NULL, the shared system font is used.\n * `glyphIndex` - Index of the glyph.\n * `flags` - Calculation flags (see GLYPH_POS_* flags).\n * `scaleX` - Scale factor to apply horizontally.\n * `scaleY` - Scale factor to apply vertically."] - pub fn fontCalcGlyphPos( - out: *mut fontGlyphPos_s, - font: *mut CFNT_s, - glyphIndex: ::libc::c_int, - flags: u32_, - scaleX: f32, - scaleY: f32, - ); -} -extern "C" { - pub fn gdbHioDevInit() -> ::libc::c_int; -} -extern "C" { - pub fn gdbHioDevExit(); -} -extern "C" { - pub fn gdbHioDevGetStdin() -> ::libc::c_int; -} -extern "C" { - pub fn gdbHioDevGetStdout() -> ::libc::c_int; -} -extern "C" { - pub fn gdbHioDevGetStderr() -> ::libc::c_int; -} -extern "C" { - pub fn gdbHioDevRedirectStdStreams(in_: bool, out: bool, err: bool) -> ::libc::c_int; -} -extern "C" { - pub fn gdbHioDevGettimeofday(tv: *mut timeval, tz: *mut ::libc::c_void) -> ::libc::c_int; -} -extern "C" { - pub fn gdbHioDevIsatty(fd: ::libc::c_int) -> ::libc::c_int; -} -extern "C" { - pub fn gdbHioDevSystem(command: *const ::libc::c_char) -> ::libc::c_int; -} -extern "C" { - #[doc = "Address of the host connected through 3dslink"] - pub static mut __3dslink_host: in_addr; -} -extern "C" { - #[doc = "Connects to the 3dslink host, setting up an output stream.\n # Arguments\n\n* `redirStdout` (direction in) - Whether to redirect stdout to nxlink output.\n * `redirStderr` (direction in) - Whether to redirect stderr to nxlink output.\n # Returns\n\nSocket fd on success, negative number on failure.\n > **Note:** The socket should be closed with close() during application cleanup."] - pub fn link3dsConnectToHost(redirStdout: bool, redirStderr: bool) -> ::libc::c_int; -} -extern "C" { - #[doc = "Same as link3dsConnectToHost but redirecting both stdout/stderr."] - #[link_name = "link3dsStdio__extern"] - pub fn link3dsStdio() -> ::libc::c_int; -} -extern "C" { - #[doc = "Same as link3dsConnectToHost but redirecting only stderr."] - #[link_name = "link3dsStdioForDebug__extern"] - pub fn link3dsStdioForDebug() -> ::libc::c_int; -} -pub type error_t = ::libc::c_int; -extern "C" { - pub fn __errno() -> *mut ::libc::c_int; -} -extern "C" { - pub static _sys_errlist: [*const ::libc::c_char; 0usize]; -} -extern "C" { - pub static mut _sys_nerr: ::libc::c_int; -} diff --git a/ctru-sys/src/lib.rs b/ctru-sys/src/lib.rs index 474e1d2..8801af3 100644 --- a/ctru-sys/src/lib.rs +++ b/ctru-sys/src/lib.rs @@ -5,12 +5,10 @@ #![allow(clippy::all)] pub mod result; - -mod bindings; - -pub use bindings::*; pub use result::*; +include!(concat!(env!("OUT_DIR"), "/bindings.rs")); + /// In lieu of a proper errno function exposed by libc /// (). pub unsafe fn errno() -> s32 { From 47e3a73e144e963ea078897cbb7e0eec35e571b3 Mon Sep 17 00:00:00 2001 From: Meziu <55318903+Meziu@users.noreply.github.com> Date: Sat, 29 Jul 2023 11:44:18 +0200 Subject: [PATCH 050/101] Fix typo in play_shutter_sound docs Co-authored-by: FenrirWolf --- ctru-rs/src/services/cam.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctru-rs/src/services/cam.rs b/ctru-rs/src/services/cam.rs index 23316c1..1a4d6ad 100644 --- a/ctru-rs/src/services/cam.rs +++ b/ctru-rs/src/services/cam.rs @@ -978,7 +978,7 @@ impl Cam { /// /// # Notes /// - /// Playing the shutter sound does not require a liviving handle to the [`Ndsp`](crate::services::ndsp::Ndsp) service. + /// Playing the shutter sound does not require a living handle to the [`Ndsp`](crate::services::ndsp::Ndsp) service. /// Volume will always be maxed out to ensure everyone within photo range can hear the picture being taken (as by japanese law). /// /// # Example From 79e0d04da6a1ba0da5015c9a4153bc5e31db4157 Mon Sep 17 00:00:00 2001 From: Meziu <55318903+Meziu@users.noreply.github.com> Date: Fri, 4 Aug 2023 23:15:12 +0200 Subject: [PATCH 051/101] Update ctru-rs/examples/file-explorer.rs Co-authored-by: Ian Chamberlain --- ctru-rs/examples/file-explorer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctru-rs/examples/file-explorer.rs b/ctru-rs/examples/file-explorer.rs index 4a7fbda..6fa1183 100644 --- a/ctru-rs/examples/file-explorer.rs +++ b/ctru-rs/examples/file-explorer.rs @@ -143,7 +143,7 @@ impl<'a> FileExplorer<'a> { } } - /// Paginate output.' + // Paginate output. fn wait_for_page_down(&mut self) { println!("Press A to go to next page, or Start to exit"); From f260e943a3eadb5ab9284b0be6a6412f8c36e3f8 Mon Sep 17 00:00:00 2001 From: Meziu <55318903+Meziu@users.noreply.github.com> Date: Fri, 4 Aug 2023 23:15:33 +0200 Subject: [PATCH 052/101] Update ctru-rs/examples/gfx-3d-mode.rs Co-authored-by: Ian Chamberlain --- ctru-rs/examples/gfx-3d-mode.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctru-rs/examples/gfx-3d-mode.rs b/ctru-rs/examples/gfx-3d-mode.rs index 32d7af1..6ad75e5 100644 --- a/ctru-rs/examples/gfx-3d-mode.rs +++ b/ctru-rs/examples/gfx-3d-mode.rs @@ -1,7 +1,7 @@ //! 3D Graphics example. //! //! This example showcases 3D mode rendering (using the CPU). -//! In a normal application, all rendering should be hanlded via the GPU. +//! In a normal application, all rendering should be handled via the GPU. use ctru::prelude::*; use ctru::services::gfx::{Flush, Screen, Side, Swap, TopScreen3D}; From fde132a11117b18aec55988beb5dff6466918e1a Mon Sep 17 00:00:00 2001 From: Meziu <55318903+Meziu@users.noreply.github.com> Date: Sat, 5 Aug 2023 18:28:38 +0200 Subject: [PATCH 053/101] Apply suggestions from code review Co-authored-by: Ian Chamberlain --- ctru-rs/src/console.rs | 10 +++++----- ctru-rs/src/mii.rs | 2 +- ctru-rs/src/services/cam.rs | 2 +- ctru-rs/src/services/hid.rs | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ctru-rs/src/console.rs b/ctru-rs/src/console.rs index ca3681d..ecbde9f 100644 --- a/ctru-rs/src/console.rs +++ b/ctru-rs/src/console.rs @@ -21,15 +21,15 @@ static mut EMPTY_CONSOLE: PrintConsole = unsafe { const_zero::const_zero!(PrintC /// /// # Notes /// -/// The [`Console`] will take full possession of the screen handed to it as long as it stays alive. It also supports ANSI codes. +/// The [`Console`] will take full possession of the screen handed to it as long as it stays alive. It also supports some ANSI codes, such as text color and cursor positioning. /// The [`Console`]'s window will have a size of 40x30 on the bottom screen, 50x30 on the normal top screen and /// 100x30 on the top screen when wide mode is enabled. /// /// # Alternatives /// -/// If you'd like to see live `stdout` output while running the application but cannnot/do not want to show the text on the 3DS itself, +/// If you'd like to see live `stdout` output while running the application but cannot or do not want to show the text on the 3DS itself, /// you can try using [`Soc::redirect_to_3dslink`](crate::services::soc::Soc::redirect_to_3dslink) while activating the `--server` flag for `3dslink` (also supported by `cargo-3ds`). -/// More info in the `cargo-3ds` docs. +/// More info in the [`cargo-3ds` docs](https://github.com/rust3ds/cargo-3ds#running-executables). #[doc(alias = "PrintConsole")] pub struct Console<'screen> { context: Box, @@ -41,7 +41,7 @@ impl<'screen> Console<'screen> { /// /// # Notes /// - /// This operation overwrites whatever was on the screen before the inizialization (including other [`Console`]s) + /// This operation overwrites whatever was on the screen before the initialization (including other [`Console`]s) /// and changes the [`FramebufferFormat`](crate::services::gspgpu::FramebufferFormat) of the selected screen to better suit the [`Console`]. /// /// The new console is automatically selected for printing. @@ -144,7 +144,7 @@ impl<'screen> Console<'screen> { /// // Create a `Console` that takes control of the lower LCD screen. /// let bottom_console = Console::new(gfx.bottom_screen.borrow_mut()); /// - /// // Remember that `Console::new` automatically selects the new `Console` for ouput. + /// // Remember that `Console::new` automatically selects the new `Console` for output. /// println!("I'm on the bottom screen!"); /// /// top_console.select(); diff --git a/ctru-rs/src/mii.rs b/ctru-rs/src/mii.rs index beccd4e..78fef80 100644 --- a/ctru-rs/src/mii.rs +++ b/ctru-rs/src/mii.rs @@ -245,7 +245,7 @@ pub struct MoleDetails { /// /// Some values are not ordered *like* the Mii Editor UI. The mapped values can be seen [here](https://www.3dbrew.org/wiki/Mii#Mapped_Editor_.3C-.3E_Hex_values). /// -/// This struct can be retrieved by [`MiiSelector::lauch()`](crate::applets::mii_selector::MiiSelector::launch). +/// This struct can be retrieved by [`MiiSelector::launch()`](crate::applets::mii_selector::MiiSelector::launch). #[derive(Clone, Debug)] pub struct Mii { /// Mii options. diff --git a/ctru-rs/src/services/cam.rs b/ctru-rs/src/services/cam.rs index 1a4d6ad..1e64322 100644 --- a/ctru-rs/src/services/cam.rs +++ b/ctru-rs/src/services/cam.rs @@ -979,7 +979,7 @@ impl Cam { /// # Notes /// /// Playing the shutter sound does not require a living handle to the [`Ndsp`](crate::services::ndsp::Ndsp) service. - /// Volume will always be maxed out to ensure everyone within photo range can hear the picture being taken (as by japanese law). + /// Volume will always be maxed out to ensure everyone within photo range can hear the picture being taken (as by Japanese law). /// /// # Example /// diff --git a/ctru-rs/src/services/hid.rs b/ctru-rs/src/services/hid.rs index c790131..d972e00 100644 --- a/ctru-rs/src/services/hid.rs +++ b/ctru-rs/src/services/hid.rs @@ -66,7 +66,7 @@ bitflags! { const DOWN = KeyPad::DPAD_DOWN.bits() | KeyPad::CPAD_DOWN.bits(); /// Direction Left (either D-Pad or C-Pad). const LEFT = KeyPad::DPAD_LEFT.bits() | KeyPad::CPAD_LEFT.bits(); - /// Direction Right (either D-Pad or C-Pad).. + /// Direction Right (either D-Pad or C-Pad). const RIGHT = KeyPad::DPAD_RIGHT.bits() | KeyPad::CPAD_RIGHT.bits(); } } From 414b760bd7181adb820acff108882746c56a2c52 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sat, 5 Aug 2023 18:52:06 +0200 Subject: [PATCH 054/101] Easy fixes to review suggestions --- ctru-rs/Cargo.toml | 3 ++- ctru-rs/examples/gfx-3d-mode.rs | 11 +++++++---- ctru-rs/src/applets/swkbd.rs | 2 +- ctru-rs/src/console.rs | 16 +++++++++------- ctru-rs/src/error.rs | 6 +++--- ctru-rs/src/services/hid.rs | 10 +++++----- ctru-rs/src/services/romfs.rs | 5 ----- ctru-sys/Cargo.toml | 3 ++- 8 files changed, 29 insertions(+), 27 deletions(-) diff --git a/ctru-rs/Cargo.toml b/ctru-rs/Cargo.toml index 027a3cb..0523b27 100644 --- a/ctru-rs/Cargo.toml +++ b/ctru-rs/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Rust3DS Org", "Ronald Kinard "] description = "A safe wrapper around libctru" repository = "https://github.com/rust3ds/ctru-rs" keywords = ["3ds", "libctru"] -categories = ["os", "api-bindings"] +categories = ["os", "api-bindings", "hardware-support"] exclude = ["examples"] license = "Zlib" edition = "2021" @@ -51,6 +51,7 @@ romfs_dir = "examples/romfs" [package.metadata.docs.rs] default-target = "armv6k-nintendo-3ds" +targets = [] cargo-args = ["-Z", "build-std"] [[example]] diff --git a/ctru-rs/examples/gfx-3d-mode.rs b/ctru-rs/examples/gfx-3d-mode.rs index 6ad75e5..7176085 100644 --- a/ctru-rs/examples/gfx-3d-mode.rs +++ b/ctru-rs/examples/gfx-3d-mode.rs @@ -2,14 +2,17 @@ //! //! This example showcases 3D mode rendering (using the CPU). //! In a normal application, all rendering should be handled via the GPU. +//! +//! See `gfx-bitmap.rs` for details on how the image is generated. +//! +//! # Warning +//! +//! This example uses 3D mode in a rather unnatural way, and should +//! probably not be viewed for too long or at all if you are photosensitive. use ctru::prelude::*; use ctru::services::gfx::{Flush, Screen, Side, Swap, TopScreen3D}; -// See `graphics-bitmap.rs` for details on how the image is generated. -// -// WARNING: this example uses 3D mode in a rather unnatural way, and should -// probably not be viewed for too long or at all if you are photosensitive. const IMAGE: &[u8] = include_bytes!("assets/ferris.rgb"); static ZERO: &[u8] = &[0; IMAGE.len()]; diff --git a/ctru-rs/src/applets/swkbd.rs b/ctru-rs/src/applets/swkbd.rs index f20819b..36413c6 100644 --- a/ctru-rs/src/applets/swkbd.rs +++ b/ctru-rs/src/applets/swkbd.rs @@ -391,7 +391,7 @@ impl SoftwareKeyboard { } /// Configure the maximum number of UTF-16 code units that can be entered into the software - /// keyboard. By default the limit is `0xFDE8` code units. + /// keyboard. By default the limit is `65000` code units. /// /// # Notes /// diff --git a/ctru-rs/src/console.rs b/ctru-rs/src/console.rs index ecbde9f..6768d47 100644 --- a/ctru-rs/src/console.rs +++ b/ctru-rs/src/console.rs @@ -16,18 +16,20 @@ static mut EMPTY_CONSOLE: PrintConsole = unsafe { const_zero::const_zero!(PrintC /// Virtual text console. /// -/// [`Console`] lets the application redirect `stdout` to a simple text displayer on the 3DS screen. -/// This means that any text written to `stdout` (e.g. using `println!` or `dbg!`) will become visible in the area taken by the console. +/// [`Console`] lets the application redirect `stdout` and `stderr` to a simple text displayer on the 3DS screen. +/// This means that any text written to `stdout` and `stderr` (e.g. using `println!`, `eprintln!` or `dbg!`) will become visible in the area taken by the console. /// /// # Notes /// /// The [`Console`] will take full possession of the screen handed to it as long as it stays alive. It also supports some ANSI codes, such as text color and cursor positioning. -/// The [`Console`]'s window will have a size of 40x30 on the bottom screen, 50x30 on the normal top screen and -/// 100x30 on the top screen when wide mode is enabled. +/// The [`Console`]'s window size will be: +/// - 40x30 on the [`BottomScreen`](crate::services::gfx::BottomScreen). +/// - 50x30 on the normal [`TopScreen`](crate::services::gfx::TopScreen). +/// - 100x30 on the [`TopScreen`](crate::services::gfx::TopScreen) when wide mode is enabled. /// /// # Alternatives /// -/// If you'd like to see live `stdout` output while running the application but cannot or do not want to show the text on the 3DS itself, +/// If you'd like to see live standard output while running the application but cannot or do not want to show the text on the 3DS itself, /// you can try using [`Soc::redirect_to_3dslink`](crate::services::soc::Soc::redirect_to_3dslink) while activating the `--server` flag for `3dslink` (also supported by `cargo-3ds`). /// More info in the [`cargo-3ds` docs](https://github.com/rust3ds/cargo-3ds#running-executables). #[doc(alias = "PrintConsole")] @@ -121,11 +123,11 @@ impl<'screen> Console<'screen> { } } - /// Select this console as the current target for `stdout`. + /// Select this console as the current target for standard output. /// /// # Notes /// - /// Any previously selected console will be unhooked and will not show the `stdout` output. + /// Any previously selected console will be unhooked and will not show the `stdout` and `stderr` output. /// /// # Example /// diff --git a/ctru-rs/src/error.rs b/ctru-rs/src/error.rs index becfaef..41b09f8 100644 --- a/ctru-rs/src/error.rs +++ b/ctru-rs/src/error.rs @@ -12,10 +12,10 @@ use ctru_sys::result::{R_DESCRIPTION, R_LEVEL, R_MODULE, R_SUMMARY}; /// Custom type alias for generic [`ctru-rs`](crate) operations. /// -/// This type is compatible with `ctru-sys::Result` codes. +/// This type is compatible with [`ctru_sys::Result`] codes. pub type Result = ::std::result::Result; -/// Validity checker of raw `ctru_sys::Result` codes. +/// Validity checker of raw [`ctru_sys::Result`] codes. /// /// This struct supports the "try" syntax (`?`) to convert to an [`Error::Os`]. /// @@ -80,7 +80,7 @@ impl FromResidual for Result { pub enum Error { /// Raw [`ctru_sys::Result`] codes. Os(ctru_sys::Result), - /// Generic `libc` error codes. + /// Generic [`libc`] errors. Libc(String), /// Requested service is already active and cannot be activated again. ServiceAlreadyActive, diff --git a/ctru-rs/src/services/hid.rs b/ctru-rs/src/services/hid.rs index d972e00..a136a94 100644 --- a/ctru-rs/src/services/hid.rs +++ b/ctru-rs/src/services/hid.rs @@ -58,15 +58,15 @@ bitflags! { /// CirclePad Down. const CPAD_DOWN = ctru_sys::KEY_CPAD_DOWN; - // Convenience catch-all for the D-Pad and the C-Pad + // Convenience catch-all for the D-Pad and the CirclePad - /// Direction Up (either D-Pad or C-Pad). + /// Direction Up (either D-Pad or CirclePad). const UP = KeyPad::DPAD_UP.bits() | KeyPad::CPAD_UP.bits(); - /// Direction Down (either D-Pad or C-Pad). + /// Direction Down (either D-Pad or CirclePad). const DOWN = KeyPad::DPAD_DOWN.bits() | KeyPad::CPAD_DOWN.bits(); - /// Direction Left (either D-Pad or C-Pad). + /// Direction Left (either D-Pad or CirclePad). const LEFT = KeyPad::DPAD_LEFT.bits() | KeyPad::CPAD_LEFT.bits(); - /// Direction Right (either D-Pad or C-Pad). + /// Direction Right (either D-Pad or CirclePad). const RIGHT = KeyPad::DPAD_RIGHT.bits() | KeyPad::CPAD_RIGHT.bits(); } } diff --git a/ctru-rs/src/services/romfs.rs b/ctru-rs/src/services/romfs.rs index ad5429f..7b686fa 100644 --- a/ctru-rs/src/services/romfs.rs +++ b/ctru-rs/src/services/romfs.rs @@ -71,11 +71,6 @@ impl RomFS { } } -impl Drop for RomFS { - #[doc(alias = "romfsUnmount")] - fn drop(&mut self) {} -} - #[cfg(test)] mod tests { use super::*; diff --git a/ctru-sys/Cargo.toml b/ctru-sys/Cargo.toml index c6bb12f..0041d0c 100644 --- a/ctru-sys/Cargo.toml +++ b/ctru-sys/Cargo.toml @@ -5,7 +5,7 @@ authors = [ "Rust3DS Org", "Ronald Kinard " ] description = "Raw bindings to libctru" repository = "https://github.com/rust3ds/ctru-rs" keywords = ["3ds", "libctru"] -categories = ["os", "external-ffi-bindings", "no-std"] +categories = ["os", "external-ffi-bindings", "no-std", "hardware-support"] exclude = ["bindgen.sh", "src/.gitattributes"] license = "Zlib" links = "ctru" @@ -19,4 +19,5 @@ which = "4.4.0" [package.metadata.docs.rs] default-target = "armv6k-nintendo-3ds" +targets = [] cargo-args = ["-Z", "build-std"] From 00f264be8c2bfff677382b316c7a88cb8b0a21f4 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sat, 5 Aug 2023 20:04:49 +0200 Subject: [PATCH 055/101] Module doc aliases --- ctru-rs/src/applets/swkbd.rs | 1 + ctru-rs/src/services/am.rs | 2 ++ ctru-rs/src/services/cam.rs | 1 + ctru-rs/src/services/cfgu.rs | 1 + ctru-rs/src/services/fs.rs | 1 + ctru-rs/src/services/gfx.rs | 1 + ctru-rs/src/services/hid.rs | 3 +++ ctru-rs/src/services/ndsp/mod.rs | 1 + ctru-rs/src/services/romfs.rs | 2 ++ ctru-rs/src/services/soc.rs | 2 ++ 10 files changed, 15 insertions(+) diff --git a/ctru-rs/src/applets/swkbd.rs b/ctru-rs/src/applets/swkbd.rs index 36413c6..9eda97e 100644 --- a/ctru-rs/src/applets/swkbd.rs +++ b/ctru-rs/src/applets/swkbd.rs @@ -3,6 +3,7 @@ //! This applet opens a virtual keyboard on the console's bottom screen which lets the user write UTF-16 valid text. // TODO: Implement remaining functionality (password mode, filter callbacks, etc.). Also improve "max text length" API. Improve `number of buttons` API when creating a new SoftwareKeyboard. // TODO: Split the Parental PIN lock operations into a different type. +#[doc(alias = "keyboard")] use bitflags::bitflags; use ctru_sys::{ diff --git a/ctru-rs/src/services/am.rs b/ctru-rs/src/services/am.rs index ee5a480..c120541 100644 --- a/ctru-rs/src/services/am.rs +++ b/ctru-rs/src/services/am.rs @@ -5,6 +5,8 @@ //! - Install compatible applications to the console. //! //! TODO: [`ctru-rs`](crate) doesn't support installing or uninstalling titles yet. +#[doc(alias = "app")] +#[doc(alias = "manager")] use crate::error::ResultCode; use crate::services::fs::FsMediaType; diff --git a/ctru-rs/src/services/cam.rs b/ctru-rs/src/services/cam.rs index 1e64322..57966f8 100644 --- a/ctru-rs/src/services/cam.rs +++ b/ctru-rs/src/services/cam.rs @@ -2,6 +2,7 @@ //! //! The CAM service provides access to the built-in cameras. [`Camera`]s can return images //! in the form of byte vectors which can be displayed to the screen or used in other ways. +#[doc(alias = "camera")] use crate::error::{Error, ResultCode}; use crate::services::gspgpu::FramebufferFormat; diff --git a/ctru-rs/src/services/cfgu.rs b/ctru-rs/src/services/cfgu.rs index d63f227..9f90935 100644 --- a/ctru-rs/src/services/cfgu.rs +++ b/ctru-rs/src/services/cfgu.rs @@ -1,6 +1,7 @@ //! System Configuration service. //! //! This module contains basic methods to retrieve the console's system configuration. +#[doc(alias = "configuration")] use crate::error::ResultCode; diff --git a/ctru-rs/src/services/fs.rs b/ctru-rs/src/services/fs.rs index f168e32..d79d73f 100644 --- a/ctru-rs/src/services/fs.rs +++ b/ctru-rs/src/services/fs.rs @@ -3,6 +3,7 @@ //! This module contains basic methods to manipulate the contents of the 3DS's filesystem. //! Only the SD card is currently supported. You should prefer using `std::fs`. // TODO: Refactor service to accomodate for various changes (such as SMDH support). Properly document the public API. +#[doc(alias = "filesystem")] use bitflags::bitflags; use std::ffi::OsString; diff --git a/ctru-rs/src/services/gfx.rs b/ctru-rs/src/services/gfx.rs index 2769c85..73bb60a 100644 --- a/ctru-rs/src/services/gfx.rs +++ b/ctru-rs/src/services/gfx.rs @@ -2,6 +2,7 @@ //! //! The GFX service controls (in a somewhat high-level way) the console's LCD screens. //! The screens are subordinate to the GFX service handle and can be used by only one borrower at a time. +#[doc(alias = "graphics")] use std::cell::{Ref, RefCell, RefMut}; use std::marker::PhantomData; diff --git a/ctru-rs/src/services/hid.rs b/ctru-rs/src/services/hid.rs index a136a94..74c69c6 100644 --- a/ctru-rs/src/services/hid.rs +++ b/ctru-rs/src/services/hid.rs @@ -3,6 +3,9 @@ //! The HID service provides read access to user input such as [button presses](Hid::keys_down), [touch screen presses](Hid::touch_position), //! and [circle pad information](Hid::circlepad_position). It also provides information from the sound volume slider, the accelerometer, and the gyroscope. // TODO: Implement volume slider, accelerometer and gyroscope + any other missing functionality. +#[doc(alias = "input")] +#[doc(alias = "controller")] +#[doc(alias = "gamepad")] use crate::error::ResultCode; use bitflags::bitflags; diff --git a/ctru-rs/src/services/ndsp/mod.rs b/ctru-rs/src/services/ndsp/mod.rs index eb9328d..b109c98 100644 --- a/ctru-rs/src/services/ndsp/mod.rs +++ b/ctru-rs/src/services/ndsp/mod.rs @@ -3,6 +3,7 @@ //! The NDSP service is used to handle communications to the DSP processor present on the console's motherboard. //! Thanks to the DSP processor the program can play sound effects and music on the console's built-in speakers or to any audio device //! connected via the audio jack. +#[doc(alias = "audio")] pub mod wave; use wave::{Status, Wave}; diff --git a/ctru-rs/src/services/romfs.rs b/ctru-rs/src/services/romfs.rs index 7b686fa..7b0f34f 100644 --- a/ctru-rs/src/services/romfs.rs +++ b/ctru-rs/src/services/romfs.rs @@ -18,6 +18,8 @@ //! ``` //! //! Alternatively, you can include the RomFS archive manually when building with `3dsxtool`. +#[doc(alias = "embed")] +#[doc(alias = "filesystem")] use crate::error::ResultCode; use std::ffi::CStr; diff --git a/ctru-rs/src/services/soc.rs b/ctru-rs/src/services/soc.rs index 00a7a5c..b17cd86 100644 --- a/ctru-rs/src/services/soc.rs +++ b/ctru-rs/src/services/soc.rs @@ -2,6 +2,8 @@ //! //! By using this service the program enables the use of network sockets and utilities such as those found in `std::net`, which are completely inaccessible by default. //! As such, remember to hold a handle to this service handle while using any network functionality, or else the `std::net` methods will return generic OS errors. +#[doc(alias = "socket")] +#[doc(alias = "network")] use libc::memalign; use std::net::Ipv4Addr; From 869cd50d06e18864c9cdb43f838de494dd1d55d9 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sat, 5 Aug 2023 20:19:10 +0200 Subject: [PATCH 056/101] Fixed romfs suggestions --- ctru-rs/src/applets/swkbd.rs | 2 +- ctru-rs/src/services/am.rs | 4 ++-- ctru-rs/src/services/cam.rs | 2 +- ctru-rs/src/services/cfgu.rs | 2 +- ctru-rs/src/services/fs.rs | 2 +- ctru-rs/src/services/gfx.rs | 2 +- ctru-rs/src/services/hid.rs | 6 +++--- ctru-rs/src/services/ndsp/mod.rs | 2 +- ctru-rs/src/services/romfs.rs | 10 ++++++++-- ctru-rs/src/services/soc.rs | 4 ++-- 10 files changed, 21 insertions(+), 15 deletions(-) diff --git a/ctru-rs/src/applets/swkbd.rs b/ctru-rs/src/applets/swkbd.rs index 9eda97e..8861ace 100644 --- a/ctru-rs/src/applets/swkbd.rs +++ b/ctru-rs/src/applets/swkbd.rs @@ -3,7 +3,7 @@ //! This applet opens a virtual keyboard on the console's bottom screen which lets the user write UTF-16 valid text. // TODO: Implement remaining functionality (password mode, filter callbacks, etc.). Also improve "max text length" API. Improve `number of buttons` API when creating a new SoftwareKeyboard. // TODO: Split the Parental PIN lock operations into a different type. -#[doc(alias = "keyboard")] +#![doc(alias = "keyboard")] use bitflags::bitflags; use ctru_sys::{ diff --git a/ctru-rs/src/services/am.rs b/ctru-rs/src/services/am.rs index c120541..68b3af3 100644 --- a/ctru-rs/src/services/am.rs +++ b/ctru-rs/src/services/am.rs @@ -5,8 +5,8 @@ //! - Install compatible applications to the console. //! //! TODO: [`ctru-rs`](crate) doesn't support installing or uninstalling titles yet. -#[doc(alias = "app")] -#[doc(alias = "manager")] +#![doc(alias = "app")] +#![doc(alias = "manager")] use crate::error::ResultCode; use crate::services::fs::FsMediaType; diff --git a/ctru-rs/src/services/cam.rs b/ctru-rs/src/services/cam.rs index 57966f8..8d4af7b 100644 --- a/ctru-rs/src/services/cam.rs +++ b/ctru-rs/src/services/cam.rs @@ -2,7 +2,7 @@ //! //! The CAM service provides access to the built-in cameras. [`Camera`]s can return images //! in the form of byte vectors which can be displayed to the screen or used in other ways. -#[doc(alias = "camera")] +#![doc(alias = "camera")] use crate::error::{Error, ResultCode}; use crate::services::gspgpu::FramebufferFormat; diff --git a/ctru-rs/src/services/cfgu.rs b/ctru-rs/src/services/cfgu.rs index 9f90935..b1cbe76 100644 --- a/ctru-rs/src/services/cfgu.rs +++ b/ctru-rs/src/services/cfgu.rs @@ -1,7 +1,7 @@ //! System Configuration service. //! //! This module contains basic methods to retrieve the console's system configuration. -#[doc(alias = "configuration")] +#![doc(alias = "configuration")] use crate::error::ResultCode; diff --git a/ctru-rs/src/services/fs.rs b/ctru-rs/src/services/fs.rs index d79d73f..821b8b9 100644 --- a/ctru-rs/src/services/fs.rs +++ b/ctru-rs/src/services/fs.rs @@ -3,7 +3,7 @@ //! This module contains basic methods to manipulate the contents of the 3DS's filesystem. //! Only the SD card is currently supported. You should prefer using `std::fs`. // TODO: Refactor service to accomodate for various changes (such as SMDH support). Properly document the public API. -#[doc(alias = "filesystem")] +#![doc(alias = "filesystem")] use bitflags::bitflags; use std::ffi::OsString; diff --git a/ctru-rs/src/services/gfx.rs b/ctru-rs/src/services/gfx.rs index 73bb60a..68ac957 100644 --- a/ctru-rs/src/services/gfx.rs +++ b/ctru-rs/src/services/gfx.rs @@ -2,7 +2,7 @@ //! //! The GFX service controls (in a somewhat high-level way) the console's LCD screens. //! The screens are subordinate to the GFX service handle and can be used by only one borrower at a time. -#[doc(alias = "graphics")] +#![doc(alias = "graphics")] use std::cell::{Ref, RefCell, RefMut}; use std::marker::PhantomData; diff --git a/ctru-rs/src/services/hid.rs b/ctru-rs/src/services/hid.rs index 74c69c6..56a6035 100644 --- a/ctru-rs/src/services/hid.rs +++ b/ctru-rs/src/services/hid.rs @@ -3,9 +3,9 @@ //! The HID service provides read access to user input such as [button presses](Hid::keys_down), [touch screen presses](Hid::touch_position), //! and [circle pad information](Hid::circlepad_position). It also provides information from the sound volume slider, the accelerometer, and the gyroscope. // TODO: Implement volume slider, accelerometer and gyroscope + any other missing functionality. -#[doc(alias = "input")] -#[doc(alias = "controller")] -#[doc(alias = "gamepad")] +#![doc(alias = "input")] +#![doc(alias = "controller")] +#![doc(alias = "gamepad")] use crate::error::ResultCode; use bitflags::bitflags; diff --git a/ctru-rs/src/services/ndsp/mod.rs b/ctru-rs/src/services/ndsp/mod.rs index b109c98..8cda802 100644 --- a/ctru-rs/src/services/ndsp/mod.rs +++ b/ctru-rs/src/services/ndsp/mod.rs @@ -3,7 +3,7 @@ //! The NDSP service is used to handle communications to the DSP processor present on the console's motherboard. //! Thanks to the DSP processor the program can play sound effects and music on the console's built-in speakers or to any audio device //! connected via the audio jack. -#[doc(alias = "audio")] +#![doc(alias = "audio")] pub mod wave; use wave::{Status, Wave}; diff --git a/ctru-rs/src/services/romfs.rs b/ctru-rs/src/services/romfs.rs index 7b0f34f..e6f1c3b 100644 --- a/ctru-rs/src/services/romfs.rs +++ b/ctru-rs/src/services/romfs.rs @@ -18,8 +18,14 @@ //! ``` //! //! Alternatively, you can include the RomFS archive manually when building with `3dsxtool`. -#[doc(alias = "embed")] -#[doc(alias = "filesystem")] +//! +//! # Notes +//! +//! `std::path` has problems when parsing file paths that include the `romfs:` prefix. +//! As such, it's suggested to use the paths directly or to do simple append operations to avoid unexpected behaviour. +//! Related [issue](https://github.com/rust-lang/rust/issues/52331). +#![doc(alias = "embed")] +#![doc(alias = "filesystem")] use crate::error::ResultCode; use std::ffi::CStr; diff --git a/ctru-rs/src/services/soc.rs b/ctru-rs/src/services/soc.rs index b17cd86..d418919 100644 --- a/ctru-rs/src/services/soc.rs +++ b/ctru-rs/src/services/soc.rs @@ -2,8 +2,8 @@ //! //! By using this service the program enables the use of network sockets and utilities such as those found in `std::net`, which are completely inaccessible by default. //! As such, remember to hold a handle to this service handle while using any network functionality, or else the `std::net` methods will return generic OS errors. -#[doc(alias = "socket")] -#[doc(alias = "network")] +#![doc(alias = "socket")] +#![doc(alias = "network")] use libc::memalign; use std::net::Ipv4Addr; From ff12bd0818c4001b0efc196648d027e5ad5460f4 Mon Sep 17 00:00:00 2001 From: Ian Chamberlain Date: Wed, 9 Aug 2023 22:42:03 -0400 Subject: [PATCH 057/101] Add test-runner as a dependency and fix build errs Luckily, Cargo doesn't mind circular dev-dependencies and we can patch to ensure it's using the same version. We can also leave this as a `git = "..."` dependency if we want, since it's a dev dependency. --- Cargo.toml | 4 ++- ctru-rs/Cargo.toml | 8 +++-- ctru-rs/src/lib.rs | 8 ++--- ctru-rs/src/test_runner.rs | 73 -------------------------------------- ctru-sys/Cargo.toml | 2 +- ctru-sys/build.rs | 3 +- ctru-sys/src/lib.rs | 8 +++++ 7 files changed, 22 insertions(+), 84 deletions(-) delete mode 100644 ctru-rs/src/test_runner.rs diff --git a/Cargo.toml b/Cargo.toml index 33abd1c..065d39b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,5 +4,7 @@ default-members = ["ctru-rs", "ctru-sys"] resolver = "2" [patch.'https://github.com/rust3ds/ctru-rs'] -# Make sure all dependencies use the local ctru-sys package +# Make sure all dependencies use the local packages. This is needed for things +# like pthread-3ds that rely on ctru-sys, and test-runner which relies on ctru-rs +ctru-rs = { path = "ctru-rs" } ctru-sys = { path = "ctru-sys" } diff --git a/ctru-rs/Cargo.toml b/ctru-rs/Cargo.toml index 0523b27..bdd7a4d 100644 --- a/ctru-rs/Cargo.toml +++ b/ctru-rs/Cargo.toml @@ -29,13 +29,15 @@ widestring = "0.2.2" toml = "0.5" [dev-dependencies] +bytemuck = "1.12.3" +cfg-if = "1.0.0" ferris-says = "0.2.1" futures = "0.3" +lewton = "0.10.2" +# TODO: switch to rust3ds org once migrated there. Also, rename? +test-runner = { git = "https://github.com/ian-h-chamberlain/test-runner-3ds" } time = "0.3.7" tokio = { version = "1.16", features = ["rt", "time", "sync", "macros"] } -cfg-if = "1.0.0" -bytemuck = "1.12.3" -lewton = "0.10.2" [features] default = ["romfs", "big-stack"] diff --git a/ctru-rs/src/lib.rs b/ctru-rs/src/lib.rs index ecc7dd9..87e1343 100644 --- a/ctru-rs/src/lib.rs +++ b/ctru-rs/src/lib.rs @@ -22,7 +22,7 @@ #![feature(custom_test_frameworks)] #![feature(try_trait_v2)] #![feature(allocator_api)] -#![test_runner(test_runner::run)] +#![test_runner(test_runner::run_gdb)] // TODO: does this make sense to have configurable? #![doc( html_favicon_url = "https://user-images.githubusercontent.com/11131775/225929072-2fa1741c-93ae-4b47-9bdf-af70f3d59910.png" )] @@ -73,9 +73,10 @@ pub fn use_panic_handler() { /// When `test` is enabled, this function will be ignored. #[cfg(not(test))] fn panic_hook_setup() { - use crate::services::hid::{Hid, KeyPad}; use std::panic::PanicInfo; + use crate::services::hid::{Hid, KeyPad}; + let main_thread = std::thread::current().id(); // Panic Hook setup @@ -110,7 +111,4 @@ pub mod mii; pub mod prelude; pub mod services; -#[cfg(test)] -mod test_runner; - pub use crate::error::{Error, Result}; diff --git a/ctru-rs/src/test_runner.rs b/ctru-rs/src/test_runner.rs deleted file mode 100644 index 97aa5f4..0000000 --- a/ctru-rs/src/test_runner.rs +++ /dev/null @@ -1,73 +0,0 @@ -//! Custom test runner for building/running unit tests on the 3DS. - -extern crate test; - -use std::io; - -use test::{ColorConfig, OutputFormat, TestDescAndFn, TestFn, TestOpts}; - -use crate::prelude::*; - -/// A custom runner to be used with `#[test_runner]`. This simple implementation -/// runs all tests in series, "failing" on the first one to panic (really, the -/// panic is just treated the same as any normal application panic). -pub(crate) fn run(tests: &[&TestDescAndFn]) { - let gfx = Gfx::new().unwrap(); - let mut hid = Hid::new().unwrap(); - let apt = Apt::new().unwrap(); - - let mut top_screen = gfx.top_screen.borrow_mut(); - top_screen.set_wide_mode(true); - let _console = Console::new(top_screen); - - let opts = TestOpts { - force_run_in_process: true, - run_tests: true, - // TODO: color doesn't work because of TERM/TERMINFO. - // With RomFS we might be able to fake this out nicely... - color: ColorConfig::AutoColor, - format: OutputFormat::Pretty, - // Hopefully this interface is more stable vs specifying individual options, - // and parsing the empty list of args should always work, I think. - // TODO Ideally we could pass actual std::env::args() here too - ..test::test::parse_opts(&[]).unwrap().unwrap() - }; - // Use the default test implementation with our hardcoded options - let _success = run_static_tests(&opts, tests).unwrap(); - - // Make sure the user can actually see the results before we exit - println!("Press START to exit."); - - while apt.main_loop() { - gfx.wait_for_vblank(); - - hid.scan_input(); - if hid.keys_down().contains(KeyPad::START) { - break; - } - } -} - -/// Adapted from [`test::test_main_static`] and [`test::make_owned_test`]. -fn run_static_tests(opts: &TestOpts, tests: &[&TestDescAndFn]) -> io::Result { - let tests = tests.iter().map(make_owned_test).collect(); - test::run_tests_console(opts, tests) -} - -/// Clones static values for putting into a dynamic vector, which test_main() -/// needs to hand out ownership of tests to parallel test runners. -/// -/// This will panic when fed any dynamic tests, because they cannot be cloned. -fn make_owned_test(test: &&TestDescAndFn) -> TestDescAndFn { - match test.testfn { - TestFn::StaticTestFn(f) => TestDescAndFn { - testfn: TestFn::StaticTestFn(f), - desc: test.desc.clone(), - }, - TestFn::StaticBenchFn(f) => TestDescAndFn { - testfn: TestFn::StaticBenchFn(f), - desc: test.desc.clone(), - }, - _ => panic!("non-static tests passed to test::test_main_static"), - } -} diff --git a/ctru-sys/Cargo.toml b/ctru-sys/Cargo.toml index 0041d0c..552f206 100644 --- a/ctru-sys/Cargo.toml +++ b/ctru-sys/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "ctru-sys" version = "22.2.0+2.2.2-1" -authors = [ "Rust3DS Org", "Ronald Kinard " ] +authors = ["Rust3DS Org", "Ronald Kinard "] description = "Raw bindings to libctru" repository = "https://github.com/rust3ds/ctru-rs" keywords = ["3ds", "libctru"] diff --git a/ctru-sys/build.rs b/ctru-sys/build.rs index 7c55caa..0bf3369 100644 --- a/ctru-sys/build.rs +++ b/ctru-sys/build.rs @@ -68,7 +68,8 @@ fn check_libctru_version() -> Result<(String, String, String), Box> { if lib_version != crate_built_version { return Err(format!( "libctru version is {lib_version} but this crate was built for {crate_built_version}" - ))?; + ) + .into()); } let Output { stdout, .. } = Command::new(pacman) diff --git a/ctru-sys/src/lib.rs b/ctru-sys/src/lib.rs index 474e1d2..98ffb1f 100644 --- a/ctru-sys/src/lib.rs +++ b/ctru-sys/src/lib.rs @@ -16,3 +16,11 @@ pub use result::*; pub unsafe fn errno() -> s32 { *__errno() } + +// TODO: not sure if there's a better way to do this, but I have gotten myself +// with this a couple times so having the hint seems nice to have. +#[cfg(test)] +compile_error!(concat!( + "ctru-sys doesn't have tests and its lib test will fail to build at link time. ", + "Try specifying `--package ctru-rs` to build those tests.", +)); From 3a74c5bcaf875eae6144867bb66afb50e04dd414 Mon Sep 17 00:00:00 2001 From: Ian Chamberlain Date: Wed, 9 Aug 2023 23:03:55 -0400 Subject: [PATCH 058/101] Use actions from test-runner-3ds repo Actually run tests now!!! --- .github/actions/setup/action.yml | 46 -------------------------------- .github/workflows/ci.yml | 45 ++++++++++++++++++++++--------- 2 files changed, 32 insertions(+), 59 deletions(-) delete mode 100644 .github/actions/setup/action.yml diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml deleted file mode 100644 index a86d6f6..0000000 --- a/.github/actions/setup/action.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Setup -description: Set up CI environment for Rust + 3DS development - -inputs: - toolchain: - description: The Rust toolchain to use for the steps - required: true - default: nightly - -runs: - using: composite - steps: - # https://github.com/nektos/act/issues/917#issuecomment-1074421318 - - if: ${{ env.ACT }} - shell: bash - name: Hack container for local development - run: | - curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - - sudo apt-get install -y nodejs - - - name: Setup default Rust toolchain - # Use this helper action so we get matcher support - # https://github.com/actions-rust-lang/setup-rust-toolchain/pull/15 - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - components: clippy, rustfmt, rust-src - toolchain: ${{ inputs.toolchain }} - - - name: Install build tools for host - shell: bash - run: sudo apt-get update && sudo apt-get install -y build-essential - - - name: Install cargo-3ds - uses: actions-rs/cargo@v1 - with: - command: install - # TODO: this should probably just be a released version from crates.io - # once cargo-3ds gets published somewhere... - args: >- - --git https://github.com/rust3ds/cargo-3ds - --rev 78a652fdfb01e2614a792d1a56b10c980ee1dae9 - - - name: Set PATH to include devkitARM - shell: bash - # For some reason devkitARM/bin is not part of the default PATH in the container - run: echo "${DEVKITARM}/bin" >> $GITHUB_PATH diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee97ccc..08c26f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,11 +33,13 @@ jobs: - name: Checkout branch uses: actions/checkout@v2 - - uses: ./.github/actions/setup + # TODO update to to rust3ds/$something once migrated. Also, this is a bit + # wordy, it might be nicer to put the actions at the top level of the repo + - uses: ian-h-chamberlain/test-runner-3ds/.github/actions/setup@v1 with: toolchain: ${{ matrix.toolchain }} - - name: Hide duplicate warnings from lint job + - name: Hide duplicate warnings from nightly if: ${{ matrix.toolchain == 'nightly' }} run: | echo "::remove-matcher owner=clippy::" @@ -46,14 +48,13 @@ jobs: - name: Check formatting run: cargo fmt --all --verbose -- --check - - name: Cargo check - run: cargo 3ds clippy --color=always --verbose --all-targets - # --deny=warnings would be nice, but can easily break CI for new clippy - # lints getting added. I'd also like to use Github's "inline warnings" - # feature, but https://github.com/actions/runner/issues/2341 means we - # can't have both that *and* colored output. + - name: Cargo check ctru-sys (without tests) + run: cargo 3ds clippy --package ctru-sys --color=always --verbose - doctests: + - name: Cargo check ctru-rs (including tests) + run: cargo 3ds clippy --package ctru-rs --color=always --verbose --all-targets + + test: strategy: matrix: toolchain: @@ -66,15 +67,33 @@ jobs: - name: Checkout branch uses: actions/checkout@v2 - - uses: ./.github/actions/setup + - uses: ian-h-chamberlain/test-runner-3ds/.github/actions/setup@v1 with: toolchain: ${{ matrix.toolchain }} - name: Hide duplicated warnings from lint job run: echo "::remove-matcher owner=clippy::" + - name: Build lib + integration tests + # Technically this will only build one 3dsx even if there's more than one executable, + # but we only run the `.elf` outputs so it doesn't really matter. + run: cargo 3ds test --no-run --tests --package ctru-rs + - name: Build doc tests - run: cargo 3ds test --doc --verbose + run: cargo 3ds test --no-run --doc + + - name: Run lib + integration tests + uses: ian-h-chamberlain/test-runner-3ds/.github/actions/citra@v1 + with: + executable: ./target/armv6k-nintendo-3ds/debug/deps/*.elf + + # TODO: run doc tests https://github.com/ian-h-chamberlain/test-runner-3ds/issues/4 - # TODO: it would be nice to actually build 3dsx for examples/tests, etc. - # and run it somehow, but exactly how remains to be seen. + - name: Upload citra logs and capture videos + uses: actions/upload-artifact@v3 + if: success() || failure() # always run unless the workflow was cancelled + with: + name: citra-logs-${{ matrix.toolchain }} + path: | + target/armv6k-nintendo-3ds/debug/deps/*.txt + target/armv6k-nintendo-3ds/debug/deps/*.webm From 7cd4ae0deb994afbb025c4e667df7a30e04b609b Mon Sep 17 00:00:00 2001 From: Ian Chamberlain Date: Wed, 9 Aug 2023 23:47:25 -0400 Subject: [PATCH 059/101] Fix link error with multiply-defined stack size We don't want to define __stacksize__ more than once, since the linker will reject it even if the definition is the same. For some reason this seems to link fine with devkitARM release 62, but not 61 (which is the version in the latest upstream docker images). This is probably safer anyway, since there are technically two copies of `ctru-rs` at play here. --- ctru-rs/src/lib.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ctru-rs/src/lib.rs b/ctru-rs/src/lib.rs index 87e1343..aeda735 100644 --- a/ctru-rs/src/lib.rs +++ b/ctru-rs/src/lib.rs @@ -18,7 +18,6 @@ #![crate_type = "rlib"] #![crate_name = "ctru"] #![warn(missing_docs)] -#![feature(test)] #![feature(custom_test_frameworks)] #![feature(try_trait_v2)] #![feature(allocator_api)] @@ -40,7 +39,11 @@ extern crate shim_3ds; /// /// This value was chosen to support crate dependencies which expected more stack than provided. It's suggested to use less stack if possible. #[no_mangle] -#[cfg(feature = "big-stack")] +// When building lib tests, we don't want to redefine the same symbol twice, +// since ctru-rs is both the crate under test and a dev-dependency (non-test). +// We might also be able to use #[linkage] for similar effect, but this way +// works without depending on another unstable feature. +#[cfg(all(feature = "big-stack", not(test)))] static __stacksize__: usize = 2 * 1024 * 1024; // 2MB macro_rules! from_impl { From 318c341271fb8c09d553d0a70ceddeb472b51d9e Mon Sep 17 00:00:00 2001 From: Ian Chamberlain Date: Thu, 10 Aug 2023 00:05:36 -0400 Subject: [PATCH 060/101] Fix test failures from running tests These mostly have to do with the test environment itself, so we might not want to keep these changes, if they are fixed in the runner. --- ctru-rs/src/services/gfx.rs | 7 ++++--- ctru-rs/src/services/romfs.rs | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ctru-rs/src/services/gfx.rs b/ctru-rs/src/services/gfx.rs index 68ac957..77198cf 100644 --- a/ctru-rs/src/services/gfx.rs +++ b/ctru-rs/src/services/gfx.rs @@ -344,7 +344,7 @@ impl Gfx { /// // Simple main loop. /// while apt.main_loop() { /// // Main program logic - /// + /// /// // Wait for the screens to refresh. /// // This blocks the current thread to make it run at 60Hz. /// gfx.wait_for_vblank(); @@ -499,7 +499,8 @@ mod tests { #[test] fn gfx_duplicate() { - // We don't need to build a `Gfx` because the test runner has one already - assert!(matches!(Gfx::new(), Err(Error::ServiceAlreadyActive))); + // NOTE: this will fail if using the console test runner, since that creates + // a Gfx as part of its test setup. + Gfx::new().unwrap(); } } diff --git a/ctru-rs/src/services/romfs.rs b/ctru-rs/src/services/romfs.rs index e6f1c3b..bc0896d 100644 --- a/ctru-rs/src/services/romfs.rs +++ b/ctru-rs/src/services/romfs.rs @@ -84,6 +84,7 @@ mod tests { use super::*; #[test] + #[ignore = "library test .elf doesn't have the romfs in it. citra runner needs to support 3dsx"] fn romfs_counter() { let _romfs = RomFS::new().unwrap(); let value = *ROMFS_ACTIVE.lock().unwrap(); From 685ea7f16816dc74758bfc04a1e79ed6b6122778 Mon Sep 17 00:00:00 2001 From: Ian Chamberlain Date: Thu, 10 Aug 2023 09:07:08 -0400 Subject: [PATCH 061/101] Bump toolchain version by 1 day The old `cargo-3ds` we were using didn't care about the commit date being 05-30, but the new one used by the `test-runner` action does. Since the rustc version is one day older than the toolchain date, we should be able to work with just the 06-01 toolchain instead. --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 08c26f9..08c9a44 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,8 +20,8 @@ jobs: strategy: matrix: toolchain: - # Run against a "known good" nightly - - nightly-2023-05-31 + # Run against a "known good" nightly. Rustc version is 1 day behind the toolchain date + - nightly-2023-06-01 # Check for breakage on latest nightly - nightly @@ -58,7 +58,7 @@ jobs: strategy: matrix: toolchain: - - nightly-2023-05-31 + - nightly-2023-06-01 - nightly continue-on-error: ${{ matrix.toolchain == 'nightly' }} runs-on: ubuntu-latest From 18924dfcf45aac087e08f0cf4139f6548fb46a5e Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Thu, 31 Aug 2023 18:25:03 +0200 Subject: [PATCH 062/101] Rename functions to allowlist/blocklist --- ctru-rs/examples/mii-selector.rs | 2 +- ctru-rs/src/applets/mii_selector.rs | 38 ++++++++++++++--------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/ctru-rs/examples/mii-selector.rs b/ctru-rs/examples/mii-selector.rs index db3a9ea..2987970 100644 --- a/ctru-rs/examples/mii-selector.rs +++ b/ctru-rs/examples/mii-selector.rs @@ -19,7 +19,7 @@ fn main() { mii_selector.set_options(Options::ENABLE_CANCEL); mii_selector.set_initial_index(3); // The first user-made Mii cannot be used. - mii_selector.blacklist_user_mii(0.into()); + mii_selector.blocklist_user_mii(0.into()); mii_selector.set_title("Great Mii Selector!"); // Launch the Mii Selector and use its result to print the selected Mii's information. diff --git a/ctru-rs/src/applets/mii_selector.rs b/ctru-rs/src/applets/mii_selector.rs index bd0e4b4..a2ef72d 100644 --- a/ctru-rs/src/applets/mii_selector.rs +++ b/ctru-rs/src/applets/mii_selector.rs @@ -9,7 +9,7 @@ use std::{ffi::CString, fmt}; /// Index of a Mii on the [`MiiSelector`] interface. /// -/// See [`MiiSelector::whitelist_user_mii()`] and related functions for more information. +/// See [`MiiSelector::allowlist_user_mii()`] and related functions for more information. #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub enum Index { /// Specific Mii index. @@ -136,11 +136,11 @@ impl MiiSelector { unsafe { ctru_sys::miiSelectorSetOptions(self.config.as_mut(), options.bits()) } } - /// Whitelist a guest Mii based on its index. + /// Allowlist a guest Mii based on its index. /// /// # Notes /// - /// Guest Mii's won't be available regardless of their whitelist/blacklist state if the [`MiiSelector`] is run without setting [`Options::ENABLE_GUESTS`]. + /// Guest Mii's won't be available regardless of their allowlist/blocklist state if the [`MiiSelector`] is run without setting [`Options::ENABLE_GUESTS`]. /// Look into [`MiiSelector::set_options()`] to see how to work with options. /// /// # Example @@ -151,12 +151,12 @@ impl MiiSelector { /// use ctru::applets::mii_selector::{Index, MiiSelector}; /// let mut mii_selector = MiiSelector::new(); /// - /// // Whitelist the guest Mii at index 2. - /// mii_selector.whitelist_guest_mii(Index::Index(2)); + /// // Allowlist the guest Mii at index 2. + /// mii_selector.allowlist_guest_mii(Index::Index(2)); /// # } /// ``` #[doc(alias = "miiSelectorWhitelistGuestMii")] - pub fn whitelist_guest_mii(&mut self, mii_index: Index) { + pub fn allowlist_guest_mii(&mut self, mii_index: Index) { let index = match mii_index { Index::Index(i) => i, Index::All => ctru_sys::MIISELECTOR_GUESTMII_SLOTS, @@ -165,11 +165,11 @@ impl MiiSelector { unsafe { ctru_sys::miiSelectorWhitelistGuestMii(self.config.as_mut(), index) } } - /// Blacklist a guest Mii based on its index. + /// Blocklist a guest Mii based on its index. /// /// # Notes /// - /// Guest Mii's won't be available regardless of their whitelist/blacklist state if the [`MiiSelector`] is run without setting [`Options::ENABLE_GUESTS`]. + /// Guest Mii's won't be available regardless of their allowlist/blocklist state if the [`MiiSelector`] is run without setting [`Options::ENABLE_GUESTS`]. /// Look into [`MiiSelector::set_options()`] to see how to work with options. /// /// # Example @@ -180,12 +180,12 @@ impl MiiSelector { /// use ctru::applets::mii_selector::{Index, MiiSelector}; /// let mut mii_selector = MiiSelector::new(); /// - /// // Blacklist the guest Mii at index 1 so that it cannot be selected. - /// mii_selector.blacklist_guest_mii(Index::Index(1)); + /// // Blocklist the guest Mii at index 1 so that it cannot be selected. + /// mii_selector.blocklist_guest_mii(Index::Index(1)); /// # } /// ``` #[doc(alias = "miiSelectorBlacklistGuestMii")] - pub fn blacklist_guest_mii(&mut self, mii_index: Index) { + pub fn blocklist_guest_mii(&mut self, mii_index: Index) { let index = match mii_index { Index::Index(i) => i, Index::All => ctru_sys::MIISELECTOR_GUESTMII_SLOTS, @@ -194,7 +194,7 @@ impl MiiSelector { unsafe { ctru_sys::miiSelectorBlacklistGuestMii(self.config.as_mut(), index) } } - /// Whitelist a user-created Mii based on its index. + /// Allowlist a user-created Mii based on its index. /// /// # Example /// @@ -204,12 +204,12 @@ impl MiiSelector { /// use ctru::applets::mii_selector::{Index, MiiSelector}; /// let mut mii_selector = MiiSelector::new(); /// - /// // Whitelist the user-created Mii at index 0. - /// mii_selector.whitelist_user_mii(Index::Index(0)); + /// // Allowlist the user-created Mii at index 0. + /// mii_selector.allowlist_user_mii(Index::Index(0)); /// # } /// ``` #[doc(alias = "miiSelectorWhitelistUserMii")] - pub fn whitelist_user_mii(&mut self, mii_index: Index) { + pub fn allowlist_user_mii(&mut self, mii_index: Index) { let index = match mii_index { Index::Index(i) => i, Index::All => ctru_sys::MIISELECTOR_USERMII_SLOTS, @@ -218,7 +218,7 @@ impl MiiSelector { unsafe { ctru_sys::miiSelectorWhitelistUserMii(self.config.as_mut(), index) } } - /// Blacklist a user-created Mii based on its index. + /// Blocklist a user-created Mii based on its index. /// /// # Example /// @@ -228,12 +228,12 @@ impl MiiSelector { /// use ctru::applets::mii_selector::{Index, MiiSelector}; /// let mut mii_selector = MiiSelector::new(); /// - /// // Blacklist all user-created Miis so that they cannot be selected. - /// mii_selector.blacklist_user_mii(Index::All); + /// // Blocklist all user-created Miis so that they cannot be selected. + /// mii_selector.blocklist_user_mii(Index::All); /// # } /// ``` #[doc(alias = "miiSelectorBlacklistUserMii")] - pub fn blacklist_user_mii(&mut self, mii_index: Index) { + pub fn blocklist_user_mii(&mut self, mii_index: Index) { let index = match mii_index { Index::Index(i) => i, Index::All => ctru_sys::MIISELECTOR_USERMII_SLOTS, From 45617265fe29b2a5f30fd235f69fb1235ebe0a44 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sun, 3 Sep 2023 13:36:15 +0200 Subject: [PATCH 063/101] Safely wrap Console::set_window --- ctru-rs/src/console.rs | 126 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 115 insertions(+), 11 deletions(-) diff --git a/ctru-rs/src/console.rs b/ctru-rs/src/console.rs index 6768d47..e39f8d0 100644 --- a/ctru-rs/src/console.rs +++ b/ctru-rs/src/console.rs @@ -35,7 +35,7 @@ static mut EMPTY_CONSOLE: PrintConsole = unsafe { const_zero::const_zero!(PrintC #[doc(alias = "PrintConsole")] pub struct Console<'screen> { context: Box, - _screen: RefMut<'screen, dyn Screen>, + screen: RefMut<'screen, dyn Screen>, } impl<'screen> Console<'screen> { @@ -78,7 +78,7 @@ impl<'screen> Console<'screen> { Console { context, - _screen: screen, + screen, } } @@ -174,16 +174,120 @@ impl<'screen> Console<'screen> { /// # Notes /// /// The first two arguments are the desired coordinates of the top-left corner - /// of the console, and the second pair is the new width and height. - /// - /// # Safety - /// - /// This function is unsafe because it does not validate whether the input will produce - /// a console that actually fits on the screen. - // TODO: Wrap this safely. + /// of the new window based on the row/column coordinates of a full-screen console. + /// The second pair is the new width and height. + /// + /// # Panics + /// + /// This function will panic if the new window's position or size does not fit the screen. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// # use ctru::services::gfx::Gfx; + /// # let gfx = Gfx::new()?; + /// # + /// # use ctru::console::Console; + /// # + /// let mut top_console = Console::new(gfx.top_screen.borrow_mut()); + /// top_console.set_window(10, 10, 16, 6); + /// + /// println!("I'm becoming claustrophobic in here!"); + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "consoleSetWindow")] - pub unsafe fn set_window(&mut self, x: i32, y: i32, width: i32, height: i32) { - consoleSetWindow(self.context.as_mut(), x, y, width, height); + pub fn set_window(&mut self, x: u8, y: u8, width: u8, height: u8) { + let height_limit = 30; + let length_limit = self.max_width(); + + if x >= length_limit { + panic!("x coordinate of new console window out of bounds"); + } + if y >= height_limit { + panic!("y coordinate of new console window out of bounds"); + } + + if (x+width) > length_limit { + panic!("width of new console window out of bounds"); + } + if (y+height) > height_limit { + panic!("height of new console window out of bounds"); + } + + unsafe { consoleSetWindow(self.context.as_mut(), x.into(), y.into(), width.into(), height.into()) }; + } + + /// Reset the window's size to default parameters. + /// + /// This can be used to undo the changes made by [`set_window()`](Console::set_window()). + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// # use ctru::services::gfx::Gfx; + /// # let gfx = Gfx::new()?; + /// # + /// # use ctru::console::Console; + /// # + /// let mut top_console = Console::new(gfx.top_screen.borrow_mut()); + /// top_console.set_window(15, 15, 8, 10); + /// + /// println!("It's really jammed in here!"); + /// + /// top_console.reset_window(); + /// + /// println!("Phew, finally a breath of fresh air."); + /// # + /// # Ok(()) + /// # } + /// ``` + pub fn reset_window(&mut self) { + let width = self.max_width(); + + unsafe { consoleSetWindow(self.context.as_mut(), 0, 0, width.into(), 30) }; + } + + /// Returns this [`Console`]'s maximum character width depending on the screen used. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// # use ctru::services::gfx::Gfx; + /// # use ctru::console::Console; + /// # + /// let gfx = Gfx::new()?; + /// + /// let top_console = Console::new(gfx.top_screen.borrow_mut()); + /// + /// // The maximum width for the top screen (without any alterations) is 50 characters. + /// assert_eq!(top_console.max_width(), 50); + /// # + /// # Ok(()) + /// # } + /// ``` + pub fn max_width(&self) -> u8 { + match self.screen.as_raw() { + ctru_sys::GFX_TOP => { + if unsafe { ctru_sys::gfxIsWide() } { + 100 + } else { + 50 + } + } + ctru_sys::GFX_BOTTOM => 40, + _ => unreachable!(), + } } } From c3576c73bea9c41cbf426be8bb935684f9398477 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sun, 3 Sep 2023 16:07:52 +0200 Subject: [PATCH 064/101] Better GSPGPU docs --- ctru-rs/src/services/gspgpu.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ctru-rs/src/services/gspgpu.rs b/ctru-rs/src/services/gspgpu.rs index 81872d0..34d867f 100644 --- a/ctru-rs/src/services/gspgpu.rs +++ b/ctru-rs/src/services/gspgpu.rs @@ -5,19 +5,19 @@ #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] pub enum Event { - /// Memory fill completed. + /// Memory fill 1 completed. Psc0 = ctru_sys::GSPGPU_EVENT_PSC0, - /// TODO: Unknown. + /// Memory fill 2 completed. Psc1 = ctru_sys::GSPGPU_EVENT_PSC1, - /// TODO: Unknown. + /// Top screen VBlank. VBlank0 = ctru_sys::GSPGPU_EVENT_VBlank0, - /// TODO: Unknown. + /// Bottom screen VBlank. VBlank1 = ctru_sys::GSPGPU_EVENT_VBlank1, - /// Display transfer finished. + /// Display transfer completed. PPF = ctru_sys::GSPGPU_EVENT_PPF, - /// Command list processing finished. + /// Command list processing completed. P3D = ctru_sys::GSPGPU_EVENT_P3D, - /// TODO: Unknown. + /// Direct Memory Access requested. DMA = ctru_sys::GSPGPU_EVENT_DMA, } From 1a704b0006dd5133e5d9782a0d0d100aca59ed8c Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Mon, 18 Sep 2023 19:42:54 +0200 Subject: [PATCH 065/101] Restructure ServiceReference and wip Hid --- ctru-rs/examples/buttons.rs | 9 +- ctru-rs/examples/movement.rs | 46 +++++++++ ctru-rs/src/console.rs | 53 +++++----- ctru-rs/src/lib.rs | 23 +++-- ctru-rs/src/services/gfx.rs | 3 +- ctru-rs/src/services/hid.rs | 161 +++++++++++++++++++++++++++--- ctru-rs/src/services/ndsp/mod.rs | 3 +- ctru-rs/src/services/reference.rs | 47 ++++----- ctru-rs/src/services/romfs.rs | 3 +- ctru-rs/src/services/soc.rs | 3 +- 10 files changed, 273 insertions(+), 78 deletions(-) create mode 100644 ctru-rs/examples/movement.rs diff --git a/ctru-rs/examples/buttons.rs b/ctru-rs/examples/buttons.rs index 0de9e7c..e92c349 100644 --- a/ctru-rs/examples/buttons.rs +++ b/ctru-rs/examples/buttons.rs @@ -25,6 +25,13 @@ fn main() { // Get information about which keys were held down on this frame. let keys = hid.keys_held(); + // Print the status of the 2 sliders. + println!( + "\x1b[20;0HVolume slider: {} ", + hid.slider_volume() + ); + println!("\x1b[21;0H3D slider: {} ", hid.slider_3d()); + // We only want to print when the keys we're holding now are different // from what they were on the previous frame. if keys != old_keys { @@ -44,7 +51,7 @@ fn main() { // and the `.intersects()` method checks for any of the provided keys. // // You can also use the `.bits()` method to do direct comparisons on - // the underlying bits + // the underlying bits. if keys.contains(KeyPad::A) { println!("You held A!"); diff --git a/ctru-rs/examples/movement.rs b/ctru-rs/examples/movement.rs new file mode 100644 index 0000000..984b779 --- /dev/null +++ b/ctru-rs/examples/movement.rs @@ -0,0 +1,46 @@ +//! Movement example. +//! +//! Simple application to showcase the use of the accellerometer and gyroscope. + +use ctru::prelude::*; + +fn main() { + ctru::use_panic_handler(); + + let gfx = Gfx::new().expect("Couldn't obtain GFX controller"); + let mut hid = Hid::new().expect("Couldn't obtain HID controller"); + let apt = Apt::new().expect("Couldn't obtain APT controller"); + + let _console = Console::new(gfx.top_screen.borrow_mut()); + + println!("Move the console around!"); + println!("\x1b[29;16HPress Start to exit"); + + // Activate the accelerometer and the gyroscope. + // Because of the complex nature of the movement sensors, they aren't activated by default with the `Hid` service. + // However, they can simply be turned on and off whenever necessary. + hid.enable_accellerometer(); + hid.enable_gyroscope(); + + while apt.main_loop() { + // Scan all the controller inputs. + // Accellerometer and gyroscope require this step to update the readings. + hid.scan_input(); + + if hid.keys_down().contains(KeyPad::START) { + break; + } + + // Be careful: reading without activating the sensors (as done before this loop) will result in a panic. + println!( + "\x1b[3;0HAccelleration: {:?} ", + hid.accellerometer_vector() + ); + println!( + "\x1b[4;0HGyroscope angular rate: {:?} ", + hid.gyroscope_rate() + ); + + gfx.wait_for_vblank(); + } +} diff --git a/ctru-rs/src/console.rs b/ctru-rs/src/console.rs index e39f8d0..d37ea06 100644 --- a/ctru-rs/src/console.rs +++ b/ctru-rs/src/console.rs @@ -76,10 +76,7 @@ impl<'screen> Console<'screen> { unsafe { consoleInit(screen.as_raw(), context.as_mut()) }; - Console { - context, - screen, - } + Console { context, screen } } /// Returns `true` if a valid [`Console`] to print on is currently selected. @@ -176,13 +173,13 @@ impl<'screen> Console<'screen> { /// The first two arguments are the desired coordinates of the top-left corner /// of the new window based on the row/column coordinates of a full-screen console. /// The second pair is the new width and height. - /// + /// /// # Panics - /// + /// /// This function will panic if the new window's position or size does not fit the screen. - /// + /// /// # Example - /// + /// /// ```no_run /// # use std::error::Error; /// # fn main() -> Result<(), Box> { @@ -194,7 +191,7 @@ impl<'screen> Console<'screen> { /// # /// let mut top_console = Console::new(gfx.top_screen.borrow_mut()); /// top_console.set_window(10, 10, 16, 6); - /// + /// /// println!("I'm becoming claustrophobic in here!"); /// # /// # Ok(()) @@ -202,7 +199,7 @@ impl<'screen> Console<'screen> { /// ``` #[doc(alias = "consoleSetWindow")] pub fn set_window(&mut self, x: u8, y: u8, width: u8, height: u8) { - let height_limit = 30; + let height_limit = 30; let length_limit = self.max_width(); if x >= length_limit { @@ -212,22 +209,30 @@ impl<'screen> Console<'screen> { panic!("y coordinate of new console window out of bounds"); } - if (x+width) > length_limit { + if (x + width) > length_limit { panic!("width of new console window out of bounds"); } - if (y+height) > height_limit { + if (y + height) > height_limit { panic!("height of new console window out of bounds"); } - - unsafe { consoleSetWindow(self.context.as_mut(), x.into(), y.into(), width.into(), height.into()) }; + + unsafe { + consoleSetWindow( + self.context.as_mut(), + x.into(), + y.into(), + width.into(), + height.into(), + ) + }; } /// Reset the window's size to default parameters. - /// + /// /// This can be used to undo the changes made by [`set_window()`](Console::set_window()). - /// + /// /// # Example - /// + /// /// ```no_run /// # use std::error::Error; /// # fn main() -> Result<(), Box> { @@ -239,11 +244,11 @@ impl<'screen> Console<'screen> { /// # /// let mut top_console = Console::new(gfx.top_screen.borrow_mut()); /// top_console.set_window(15, 15, 8, 10); - /// + /// /// println!("It's really jammed in here!"); - /// + /// /// top_console.reset_window(); - /// + /// /// println!("Phew, finally a breath of fresh air."); /// # /// # Ok(()) @@ -256,9 +261,9 @@ impl<'screen> Console<'screen> { } /// Returns this [`Console`]'s maximum character width depending on the screen used. - /// + /// /// # Example - /// + /// /// ```no_run /// # use std::error::Error; /// # fn main() -> Result<(), Box> { @@ -267,9 +272,9 @@ impl<'screen> Console<'screen> { /// # use ctru::console::Console; /// # /// let gfx = Gfx::new()?; - /// + /// /// let top_console = Console::new(gfx.top_screen.borrow_mut()); - /// + /// /// // The maximum width for the top screen (without any alterations) is 50 characters. /// assert_eq!(top_console.max_width(), 50); /// # diff --git a/ctru-rs/src/lib.rs b/ctru-rs/src/lib.rs index ecc7dd9..1ba18a6 100644 --- a/ctru-rs/src/lib.rs +++ b/ctru-rs/src/lib.rs @@ -87,15 +87,24 @@ fn panic_hook_setup() { if main_thread == std::thread::current().id() && console::Console::exists() { println!("\nPress SELECT to exit the software"); - match Hid::new() { - Ok(mut hid) => loop { - hid.scan_input(); - let keys = hid.keys_down(); - if keys.contains(KeyPad::SELECT) { + // Due to how the Hid service operates, we can't safely use 2 handles to it at the same time. + // Furthermore, the panic hook runs before the panic cleanup is done, which means that any other handles + // to the service will still be alive during this process. + // Regardless, we can "unsafely" spin up a new instance, since the module won't be used any further from the main process, + // which is going to get cleaned up right after this loop. + unsafe { + let _ = ctru_sys::hidInit(); + + loop { + ctru_sys::hidScanInput(); + let keys = ctru_sys::hidKeysDown(); + + if KeyPad::from_bits_truncate(keys).contains(KeyPad::SELECT) { break; } - }, - Err(e) => println!("Error while intializing Hid controller during panic: {e}"), + } + + ctru_sys::hidExit(); } } }); diff --git a/ctru-rs/src/services/gfx.rs b/ctru-rs/src/services/gfx.rs index 68ac957..c32a603 100644 --- a/ctru-rs/src/services/gfx.rs +++ b/ctru-rs/src/services/gfx.rs @@ -244,7 +244,7 @@ pub struct Gfx { _service_handler: ServiceReference, } -static GFX_ACTIVE: Mutex = Mutex::new(0); +static GFX_ACTIVE: Mutex<()> = Mutex::new(()); impl Gfx { /// Initialize a new default service handle. @@ -311,7 +311,6 @@ impl Gfx { ) -> Result { let handler = ServiceReference::new( &GFX_ACTIVE, - false, || unsafe { ctru_sys::gfxInit(top_fb_fmt.into(), bottom_fb_fmt.into(), use_vram_buffers); diff --git a/ctru-rs/src/services/hid.rs b/ctru-rs/src/services/hid.rs index 56a6035..16d10c5 100644 --- a/ctru-rs/src/services/hid.rs +++ b/ctru-rs/src/services/hid.rs @@ -1,15 +1,21 @@ //! Human Interface Device service. //! //! The HID service provides read access to user input such as [button presses](Hid::keys_down), [touch screen presses](Hid::touch_position), -//! and [circle pad information](Hid::circlepad_position). It also provides information from the sound volume slider, the accelerometer, and the gyroscope. -// TODO: Implement volume slider, accelerometer and gyroscope + any other missing functionality. +//! and [circle pad information](Hid::circlepad_position). It also provides information from the [3D slider](Hid::slider_3d()), the [volume slider](Hid::slider_volume()), +//! the [accelerometer](Hid::accellerometer_vector()), and the [gyroscope](Hid::gyroscope_rate()). #![doc(alias = "input")] #![doc(alias = "controller")] #![doc(alias = "gamepad")] +use std::sync::Mutex; + use crate::error::ResultCode; +use crate::services::ServiceReference; + use bitflags::bitflags; +static HID_ACTIVE: Mutex<()> = Mutex::new(()); + bitflags! { /// A set of flags corresponding to the button and directional pad inputs present on the 3DS. #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)] @@ -75,7 +81,11 @@ bitflags! { } /// Handle to the HID service. -pub struct Hid(()); +pub struct Hid { + active_accellerometer: bool, + active_gyroscope: bool, + _service_handler: ServiceReference, +} impl Hid { /// Initialize a new service handle. @@ -100,10 +110,26 @@ impl Hid { /// ``` #[doc(alias = "hidInit")] pub fn new() -> crate::Result { - unsafe { - ResultCode(ctru_sys::hidInit())?; - Ok(Hid(())) - } + let handler = ServiceReference::new( + &HID_ACTIVE, + || { + ResultCode(unsafe { ctru_sys::hidInit() })?; + + Ok(()) + }, + || unsafe { + let _ = ctru_sys::HIDUSER_DisableGyroscope(); + let _ = ctru_sys::HIDUSER_DisableAccelerometer(); + + ctru_sys::hidExit(); + }, + )?; + + Ok(Self { + active_accellerometer: false, + active_gyroscope: false, + _service_handler: handler, + }) } /// Scan the HID service for all user input occurring on the current frame. @@ -282,11 +308,122 @@ impl Hid { (res.dx, res.dy) } -} -impl Drop for Hid { - #[doc(alias = "hidExit")] - fn drop(&mut self) { - unsafe { ctru_sys::hidExit() }; + /// Returns the current volume slider position (between 0 and 1). + /// + /// # Notes + /// + /// The [`ndsp`](crate::services::ndsp) service automatically uses the volume slider's position to handle audio mixing. + /// As such this method should not be used to programmatically change the volume. + /// + /// Its purpose is only to inform the program of the volume slider's position (e.g. checking if the user has muted the audio). + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::hid::Hid; + /// let mut hid = Hid::new()?; + /// + /// hid.scan_input(); + /// + /// let volume = hid.slider_volume(); + /// # + /// # Ok(()) + /// # } + /// ``` + #[doc(alias = "HIDUSER_GetSoundVolume")] + pub fn slider_volume(&self) -> f32 { + let mut slider = 0; + + unsafe { + let _ = ctru_sys::HIDUSER_GetSoundVolume(&mut slider); + } + + (slider as f32) / 63. + } + + /// Returns the current 3D slider position (between 0 and 1). + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::hid::Hid; + /// let mut hid = Hid::new()?; + /// + /// hid.scan_input(); + /// + /// let volume = hid.volume_slider(); + /// # + /// # Ok(()) + /// # } + /// ``` + #[doc(alias = "osGet3DSliderState")] + pub fn slider_3d(&self) -> f32 { + // TODO: Replace with the static inline function `osGet3DSliderState`, which works the exact same way. + unsafe { (*(ctru_sys::OS_SHAREDCFG_VADDR as *mut ctru_sys::osSharedConfig_s)).slider_3d } + } + + #[doc(alias = "HIDUSER_EnableAccelerometer")] + pub fn enable_accellerometer(&mut self) { + let _ = unsafe { ctru_sys::HIDUSER_EnableAccelerometer() }; + + self.active_accellerometer = true; + } + + #[doc(alias = "HIDUSER_EnableGyroscope")] + pub fn enable_gyroscope(&mut self) { + let _ = unsafe { ctru_sys::HIDUSER_EnableGyroscope() }; + + self.active_gyroscope = true; + } + + #[doc(alias = "HIDUSER_DisableAccelerometer")] + pub fn disable_accellerometer(&mut self) { + let _ = unsafe { ctru_sys::HIDUSER_DisableAccelerometer() }; + + self.active_accellerometer = false; + } + + #[doc(alias = "HIDUSER_DisableGyroscope")] + pub fn disable_gyroscope(&mut self) { + let _ = unsafe { ctru_sys::HIDUSER_DisableGyroscope() }; + + self.active_gyroscope = false; + } + + #[doc(alias = "hidAccelRead")] + pub fn accellerometer_vector(&self) -> (i16, i16, i16) { + if !self.active_accellerometer { + panic!("tried to read accellerometer while disabled") + } + + let mut res = ctru_sys::accelVector { x: 0, y: 0, z: 0 }; + + unsafe { + ctru_sys::hidAccelRead(&mut res); + } + + (res.x, res.y, res.z) + } + + #[doc(alias = "hidGyroRead")] + pub fn gyroscope_rate(&self) -> (i16, i16, i16) { + if !self.active_gyroscope { + panic!("tried to read accellerometer while disabled") + } + + let mut res = ctru_sys::angularRate { x: 0, y: 0, z: 0 }; + + unsafe { + ctru_sys::hidGyroRead(&mut res); + } + + (res.x, res.y, res.z) } } diff --git a/ctru-rs/src/services/ndsp/mod.rs b/ctru-rs/src/services/ndsp/mod.rs index 8cda802..1da683c 100644 --- a/ctru-rs/src/services/ndsp/mod.rs +++ b/ctru-rs/src/services/ndsp/mod.rs @@ -98,7 +98,7 @@ pub struct Channel<'ndsp> { _rf: RefMut<'ndsp, ()>, // we don't need to hold any data } -static NDSP_ACTIVE: Mutex = Mutex::new(0); +static NDSP_ACTIVE: Mutex<()> = Mutex::new(()); /// Handle to the DSP service. /// @@ -133,7 +133,6 @@ impl Ndsp { pub fn new() -> crate::Result { let _service_handler = ServiceReference::new( &NDSP_ACTIVE, - false, || { ResultCode(unsafe { ctru_sys::ndspInit() })?; diff --git a/ctru-rs/src/services/reference.rs b/ctru-rs/src/services/reference.rs index 41319a7..0fad37d 100644 --- a/ctru-rs/src/services/reference.rs +++ b/ctru-rs/src/services/reference.rs @@ -1,35 +1,37 @@ use crate::Error; -use std::sync::Mutex; +use std::sync::{Mutex, MutexGuard, TryLockError}; + pub(crate) struct ServiceReference { - counter: &'static Mutex, + _guard: MutexGuard<'static, ()>, close: Box, } impl ServiceReference { - pub fn new( - counter: &'static Mutex, - allow_multiple: bool, - start: S, - close: E, - ) -> crate::Result + pub fn new(counter: &'static Mutex<()>, start: S, close: E) -> crate::Result where S: FnOnce() -> crate::Result<()>, E: Fn() + Send + Sync + 'static, { - let mut value = counter - .lock() - .expect("Mutex Counter for ServiceReference is poisoned"); // todo: handle poisoning + let _guard = match counter.try_lock() { + Ok(lock) => lock, + Err(e) => match e { + TryLockError::Poisoned(guard) => { + // If the MutexGuard is poisoned that means that the "other" service instance (of which the thread panicked) + // was NOT properly closed. To avoid any weird behaviour, we try closing the service now, to then re-open a fresh instance. + // + // It's up to our `close()` implementations to avoid panicking/doing weird stuff again. + close(); - if *value == 0 { - start()?; - } else if !allow_multiple { - return Err(Error::ServiceAlreadyActive); - } + guard.into_inner() + } + TryLockError::WouldBlock => return Err(Error::ServiceAlreadyActive), + }, + }; - *value += 1; + start()?; Ok(Self { - counter, + _guard, close: Box::new(close), }) } @@ -37,13 +39,6 @@ impl ServiceReference { impl Drop for ServiceReference { fn drop(&mut self) { - let mut value = self - .counter - .lock() - .expect("Mutex Counter for ServiceReference is poisoned"); // todo: handle poisoning - *value -= 1; - if *value == 0 { - (self.close)(); - } + (self.close)(); } } diff --git a/ctru-rs/src/services/romfs.rs b/ctru-rs/src/services/romfs.rs index e6f1c3b..aaf863f 100644 --- a/ctru-rs/src/services/romfs.rs +++ b/ctru-rs/src/services/romfs.rs @@ -38,7 +38,7 @@ pub struct RomFS { _service_handler: ServiceReference, } -static ROMFS_ACTIVE: Mutex = Mutex::new(0); +static ROMFS_ACTIVE: Mutex<()> = Mutex::new(()); impl RomFS { /// Mount the bundled RomFS archive as a virtual drive. @@ -63,7 +63,6 @@ impl RomFS { pub fn new() -> crate::Result { let _service_handler = ServiceReference::new( &ROMFS_ACTIVE, - true, || { let mount_name = CStr::from_bytes_with_nul(b"romfs\0").unwrap(); ResultCode(unsafe { ctru_sys::romfsMountSelf(mount_name.as_ptr()) })?; diff --git a/ctru-rs/src/services/soc.rs b/ctru-rs/src/services/soc.rs index d418919..5e61484 100644 --- a/ctru-rs/src/services/soc.rs +++ b/ctru-rs/src/services/soc.rs @@ -19,7 +19,7 @@ pub struct Soc { sock_3dslink: libc::c_int, } -static SOC_ACTIVE: Mutex = Mutex::new(0); +static SOC_ACTIVE: Mutex<()> = Mutex::new(()); impl Soc { /// Initialize a new service handle using a socket buffer size of `0x100000` bytes. @@ -71,7 +71,6 @@ impl Soc { pub fn init_with_buffer_size(num_bytes: usize) -> crate::Result { let _service_handler = ServiceReference::new( &SOC_ACTIVE, - false, || { let soc_mem = unsafe { memalign(0x1000, num_bytes) } as *mut u32; ResultCode(unsafe { ctru_sys::socInit(soc_mem, num_bytes as u32) })?; From d71774b6bf2f5333b2c040fb0ee936f98484e0ae Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Mon, 18 Sep 2023 20:37:29 +0200 Subject: [PATCH 066/101] Less panics, more errors --- ctru-rs/src/console.rs | 74 +++++++++++++++++++++++++++---- ctru-rs/src/lib.rs | 4 +- ctru-rs/src/services/hid.rs | 32 ++++++++++--- ctru-rs/src/services/ndsp/mod.rs | 58 +++++++++++------------- ctru-rs/src/services/ndsp/wave.rs | 12 ++--- ctru-rs/src/services/romfs.rs | 14 +++--- ctru-sys/build.rs | 2 +- 7 files changed, 131 insertions(+), 65 deletions(-) diff --git a/ctru-rs/src/console.rs b/ctru-rs/src/console.rs index d37ea06..ba85222 100644 --- a/ctru-rs/src/console.rs +++ b/ctru-rs/src/console.rs @@ -14,6 +14,31 @@ use crate::services::gfx::Screen; static mut EMPTY_CONSOLE: PrintConsole = unsafe { const_zero::const_zero!(PrintConsole) }; +/// Error enum for generic errors within [`Console`]. +#[derive(Copy, Clone, Debug, PartialEq, Eq)] +pub enum Error { + /// The coordinate specified on the given axis exceeds the limits imposed by the [`Console`] window. + CoordinateOutOfBounds(Axis), + /// The size specified for the given dimension exceeds the limits imposed by the [`Console`] window. + DimensionOutOfBounds(Dimension), +} + +/// 2D coordinate axes. +#[allow(missing_docs)] +#[derive(Copy, Clone, Debug, PartialEq, Eq)] +pub enum Axis { + X, + Y, +} + +/// 2D dimensions. +#[allow(missing_docs)] +#[derive(Copy, Clone, Debug, PartialEq, Eq)] +pub enum Dimension { + Width, + Height, +} + /// Virtual text console. /// /// [`Console`] lets the application redirect `stdout` and `stderr` to a simple text displayer on the 3DS screen. @@ -174,10 +199,6 @@ impl<'screen> Console<'screen> { /// of the new window based on the row/column coordinates of a full-screen console. /// The second pair is the new width and height. /// - /// # Panics - /// - /// This function will panic if the new window's position or size does not fit the screen. - /// /// # Example /// /// ```no_run @@ -198,22 +219,22 @@ impl<'screen> Console<'screen> { /// # } /// ``` #[doc(alias = "consoleSetWindow")] - pub fn set_window(&mut self, x: u8, y: u8, width: u8, height: u8) { + pub fn set_window(&mut self, x: u8, y: u8, width: u8, height: u8) -> Result<(), Error> { let height_limit = 30; let length_limit = self.max_width(); if x >= length_limit { - panic!("x coordinate of new console window out of bounds"); + return Err(Error::CoordinateOutOfBounds(Axis::X)); } if y >= height_limit { - panic!("y coordinate of new console window out of bounds"); + return Err(Error::CoordinateOutOfBounds(Axis::Y)); } if (x + width) > length_limit { - panic!("width of new console window out of bounds"); + return Err(Error::DimensionOutOfBounds(Dimension::Width)); } if (y + height) > height_limit { - panic!("height of new console window out of bounds"); + return Err(Error::DimensionOutOfBounds(Dimension::Height)); } unsafe { @@ -225,6 +246,8 @@ impl<'screen> Console<'screen> { height.into(), ) }; + + Ok(()) } /// Reset the window's size to default parameters. @@ -321,3 +344,36 @@ impl Drop for Console<'_> { } } } + +impl std::fmt::Display for Axis { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::X => write!(f, "x"), + Self::Y => write!(f, "y"), + } + } +} + +impl std::fmt::Display for Dimension { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::Width => write!(f, "width"), + Self::Height => write!(f, "height"), + } + } +} + +impl std::fmt::Display for Error { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::CoordinateOutOfBounds(a) => { + write!(f, "coordinate specified for the {a} axis is out of bounds") + } + Self::DimensionOutOfBounds(d) => { + write!(f, "size specified for the {d} is out of bounds") + } + } + } +} + +impl std::error::Error for Error {} diff --git a/ctru-rs/src/lib.rs b/ctru-rs/src/lib.rs index 1ba18a6..329d063 100644 --- a/ctru-rs/src/lib.rs +++ b/ctru-rs/src/lib.rs @@ -73,7 +73,7 @@ pub fn use_panic_handler() { /// When `test` is enabled, this function will be ignored. #[cfg(not(test))] fn panic_hook_setup() { - use crate::services::hid::{Hid, KeyPad}; + use crate::services::hid::KeyPad; use std::panic::PanicInfo; let main_thread = std::thread::current().id(); @@ -103,7 +103,7 @@ fn panic_hook_setup() { break; } } - + ctru_sys::hidExit(); } } diff --git a/ctru-rs/src/services/hid.rs b/ctru-rs/src/services/hid.rs index 16d10c5..1811c28 100644 --- a/ctru-rs/src/services/hid.rs +++ b/ctru-rs/src/services/hid.rs @@ -80,6 +80,15 @@ bitflags! { } } +/// Error enum for generic errors within the [`Hid`] service. +#[derive(Copy, Clone, Debug, PartialEq, Eq)] +pub enum Error { + /// An attempt was made to access the accelerometer while disabled. + UnavailableAccelerometer, + /// An attempt was made to access the gyroscope while disabled. + UnavailableGyroscope, +} + /// Handle to the HID service. pub struct Hid { active_accellerometer: bool, @@ -398,9 +407,9 @@ impl Hid { } #[doc(alias = "hidAccelRead")] - pub fn accellerometer_vector(&self) -> (i16, i16, i16) { + pub fn accellerometer_vector(&self) -> Result<(i16, i16, i16), Error> { if !self.active_accellerometer { - panic!("tried to read accellerometer while disabled") + return Err(Error::UnavailableAccelerometer); } let mut res = ctru_sys::accelVector { x: 0, y: 0, z: 0 }; @@ -409,13 +418,13 @@ impl Hid { ctru_sys::hidAccelRead(&mut res); } - (res.x, res.y, res.z) + Ok((res.x, res.y, res.z)) } #[doc(alias = "hidGyroRead")] - pub fn gyroscope_rate(&self) -> (i16, i16, i16) { + pub fn gyroscope_rate(&self) -> Result<(i16, i16, i16), Error> { if !self.active_gyroscope { - panic!("tried to read accellerometer while disabled") + return Err(Error::UnavailableGyroscope); } let mut res = ctru_sys::angularRate { x: 0, y: 0, z: 0 }; @@ -424,6 +433,17 @@ impl Hid { ctru_sys::hidGyroRead(&mut res); } - (res.x, res.y, res.z) + Ok((res.x, res.y, res.z)) } } + +impl std::fmt::Display for Error { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::UnavailableAccelerometer => write!(f, "tried using accelerometer while disabled"), + Self::UnavailableGyroscope => write!(f, "tried using gyroscope while disabled"), + } + } +} + +impl std::error::Error for Error {} diff --git a/ctru-rs/src/services/ndsp/mod.rs b/ctru-rs/src/services/ndsp/mod.rs index 1da683c..78c744b 100644 --- a/ctru-rs/src/services/ndsp/mod.rs +++ b/ctru-rs/src/services/ndsp/mod.rs @@ -52,6 +52,16 @@ pub struct AudioMix { raw: [f32; 12], } +/// Auxiliary Device index. +#[derive(Copy, Clone, Debug, PartialEq, Eq)] +#[repr(usize)] +pub enum AuxDevice { + /// Aux device with index 0. + Zero = 0, + /// Aux device with index 1. + One = 1, +} + /// Interpolation used between audio frames. #[doc(alias = "ndspInterpType")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] @@ -67,7 +77,7 @@ pub enum InterpolationType { /// Errors returned by [`ndsp`](self) functions. #[derive(Copy, Clone, Debug, PartialEq, Eq)] -pub enum NdspError { +pub enum Error { /// Channel with the specified ID does not exist. InvalidChannel(u8), /// Channel with the specified ID is already being used. @@ -169,7 +179,7 @@ impl Ndsp { /// # Ok(()) /// # } /// ``` - pub fn channel(&self, id: u8) -> std::result::Result { + pub fn channel(&self, id: u8) -> std::result::Result { let in_bounds = self.channel_flags.get(id as usize); match in_bounds { @@ -177,10 +187,10 @@ impl Ndsp { let flag = ref_cell.try_borrow_mut(); match flag { Ok(_rf) => Ok(Channel { id, _rf }), - Err(_) => Err(NdspError::ChannelAlreadyInUse(id)), + Err(_) => Err(Error::ChannelAlreadyInUse(id)), } } - None => Err(NdspError::InvalidChannel(id)), + None => Err(Error::InvalidChannel(id)), } } @@ -516,9 +526,9 @@ impl Channel<'_> { // TODO: Find a better way to handle the wave lifetime problem. // These "alive wave" shenanigans are the most substantial reason why I'd like to fully re-write this service in Rust. #[doc(alias = "ndspChnWaveBufAdd")] - pub fn queue_wave(&mut self, wave: &mut Wave) -> std::result::Result<(), NdspError> { + pub fn queue_wave(&mut self, wave: &mut Wave) -> std::result::Result<(), Error> { match wave.status() { - Status::Playing | Status::Queued => return Err(NdspError::WaveBusy(self.id)), + Status::Playing | Status::Queued => return Err(Error::WaveBusy(self.id)), _ => (), } @@ -660,23 +670,15 @@ impl AudioMix { } /// Returns the values set for the "front" volume mix (left and right channel) for the specified auxiliary output device (either 0 or 1). - pub fn aux_front(&self, id: usize) -> (f32, f32) { - if id > 1 { - panic!("invalid auxiliary output device index") - } - - let index = 4 + id * 4; + pub fn aux_front(&self, id: AuxDevice) -> (f32, f32) { + let index = 4 + (id as usize * 4); (self.raw[index], self.raw[index + 1]) } /// Returns the values set for the "back" volume mix (left and right channel) for the specified auxiliary output device (either 0 or 1). - pub fn aux_back(&self, id: usize) -> (f32, f32) { - if id > 1 { - panic!("invalid auxiliary output device index") - } - - let index = 6 + id * 4; + pub fn aux_back(&self, id: AuxDevice) -> (f32, f32) { + let index = 6 + (id as usize * 4); (self.raw[index], self.raw[index + 1]) } @@ -709,12 +711,8 @@ impl AudioMix { /// /// [`Channel`] will normalize the mix values to be within 0 and 1. /// However, an [`AudioMix`] instance with larger/smaller values is valid. - pub fn set_aux_front(&mut self, left: f32, right: f32, id: usize) { - if id > 1 { - panic!("invalid auxiliary output device index") - } - - let index = 4 + id * 4; + pub fn set_aux_front(&mut self, left: f32, right: f32, id: AuxDevice) { + let index = 4 + (id as usize * 4); self.raw[index] = left; self.raw[index + 1] = right; @@ -726,12 +724,8 @@ impl AudioMix { /// /// [`Channel`] will normalize the mix values to be within 0 and 1. /// However, an [`AudioMix`] instance with larger/smaller values is valid. - pub fn set_aux_back(&mut self, left: f32, right: f32, id: usize) { - if id > 1 { - panic!("invalid auxiliary output device index") - } - - let index = 6 + id * 4; + pub fn set_aux_back(&mut self, left: f32, right: f32, id: AuxDevice) { + let index = 6 + (id as usize * 4); self.raw[index] = left; self.raw[index + 1] = right; @@ -754,7 +748,7 @@ impl From<[f32; 12]> for AudioMix { } } -impl fmt::Display for NdspError { +impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { Self::InvalidChannel(id) => write!(f, "audio Channel with ID {id} doesn't exist. Valid channels have an ID between 0 and 23"), @@ -765,7 +759,7 @@ impl fmt::Display for NdspError { } } -impl error::Error for NdspError {} +impl error::Error for Error {} impl Drop for Ndsp { #[doc(alias = "ndspExit")] diff --git a/ctru-rs/src/services/ndsp/wave.rs b/ctru-rs/src/services/ndsp/wave.rs index 1a383ca..7f8c9f9 100644 --- a/ctru-rs/src/services/ndsp/wave.rs +++ b/ctru-rs/src/services/ndsp/wave.rs @@ -2,7 +2,7 @@ //! //! This modules has all methods and structs required to work with audio waves meant to be played via the [`ndsp`](crate::services::ndsp) service. -use super::{AudioFormat, NdspError}; +use super::{AudioFormat, Error}; use crate::linear::LinearAllocator; /// Informational struct holding the raw audio data and playback info. @@ -97,10 +97,10 @@ impl Wave { /// /// This function will return an error if the [`Wave`] is currently busy, /// with the id to the channel in which it's queued. - pub fn get_buffer_mut(&mut self) -> Result<&mut [u8], NdspError> { + pub fn get_buffer_mut(&mut self) -> Result<&mut [u8], Error> { match self.status() { Status::Playing | Status::Queued => { - Err(NdspError::WaveBusy(self.played_on_channel.unwrap())) + Err(Error::WaveBusy(self.played_on_channel.unwrap())) } _ => Ok(&mut self.buffer), } @@ -163,10 +163,10 @@ impl Wave { /// /// This function will return an error if the sample size exceeds the buffer's capacity /// or if the [`Wave`] is currently queued. - pub fn set_sample_count(&mut self, sample_count: usize) -> Result<(), NdspError> { + pub fn set_sample_count(&mut self, sample_count: usize) -> Result<(), Error> { match self.status() { Status::Playing | Status::Queued => { - return Err(NdspError::WaveBusy(self.played_on_channel.unwrap())); + return Err(Error::WaveBusy(self.played_on_channel.unwrap())); } _ => (), } @@ -174,7 +174,7 @@ impl Wave { let max_count = self.buffer.len() / self.audio_format.size(); if sample_count > max_count { - return Err(NdspError::SampleCountOutOfBounds(sample_count, max_count)); + return Err(Error::SampleCountOutOfBounds(sample_count, max_count)); } self.raw_data.nsamples = sample_count as u32; diff --git a/ctru-rs/src/services/romfs.rs b/ctru-rs/src/services/romfs.rs index aaf863f..fd6064b 100644 --- a/ctru-rs/src/services/romfs.rs +++ b/ctru-rs/src/services/romfs.rs @@ -83,16 +83,12 @@ mod tests { use super::*; #[test] - fn romfs_counter() { - let _romfs = RomFS::new().unwrap(); - let value = *ROMFS_ACTIVE.lock().unwrap(); + #[should_panic] + fn romfs_lock() { + let romfs = RomFS::new().unwrap(); - assert_eq!(value, 1); + let _value = *ROMFS_ACTIVE.lock().unwrap(); - drop(_romfs); - - let value = *ROMFS_ACTIVE.lock().unwrap(); - - assert_eq!(value, 0); + drop(romfs); } } diff --git a/ctru-sys/build.rs b/ctru-sys/build.rs index 1643b8b..fa34560 100644 --- a/ctru-sys/build.rs +++ b/ctru-sys/build.rs @@ -169,7 +169,7 @@ fn check_libctru_version() -> Result<(String, String, String), Box> { .expect("crate version should have '+' delimeter"); if lib_version != crate_built_version { - return Err(format!( + Err(format!( "libctru version is {lib_version} but this crate was built for {crate_built_version}" ))?; } From 64d977749790ff1589ca7fe4385bf536e38a1f07 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sat, 23 Sep 2023 18:30:17 +0200 Subject: [PATCH 067/101] Fixed docs and typos --- ctru-rs/examples/movement.rs | 10 +-- ctru-rs/src/services/hid.rs | 138 ++++++++++++++++++++++++++++------- 2 files changed, 117 insertions(+), 31 deletions(-) diff --git a/ctru-rs/examples/movement.rs b/ctru-rs/examples/movement.rs index 984b779..b293c71 100644 --- a/ctru-rs/examples/movement.rs +++ b/ctru-rs/examples/movement.rs @@ -1,6 +1,6 @@ //! Movement example. //! -//! Simple application to showcase the use of the accellerometer and gyroscope. +//! Simple application to showcase the use of the accelerometer and gyroscope. use ctru::prelude::*; @@ -19,12 +19,12 @@ fn main() { // Activate the accelerometer and the gyroscope. // Because of the complex nature of the movement sensors, they aren't activated by default with the `Hid` service. // However, they can simply be turned on and off whenever necessary. - hid.enable_accellerometer(); + hid.enable_accelerometer(); hid.enable_gyroscope(); while apt.main_loop() { // Scan all the controller inputs. - // Accellerometer and gyroscope require this step to update the readings. + // Accelerometer and gyroscope require this step to update the readings. hid.scan_input(); if hid.keys_down().contains(KeyPad::START) { @@ -33,8 +33,8 @@ fn main() { // Be careful: reading without activating the sensors (as done before this loop) will result in a panic. println!( - "\x1b[3;0HAccelleration: {:?} ", - hid.accellerometer_vector() + "\x1b[3;0HAcceleration: {:?} ", + hid.accelerometer_vector() ); println!( "\x1b[4;0HGyroscope angular rate: {:?} ", diff --git a/ctru-rs/src/services/hid.rs b/ctru-rs/src/services/hid.rs index 1811c28..0634091 100644 --- a/ctru-rs/src/services/hid.rs +++ b/ctru-rs/src/services/hid.rs @@ -2,7 +2,7 @@ //! //! The HID service provides read access to user input such as [button presses](Hid::keys_down), [touch screen presses](Hid::touch_position), //! and [circle pad information](Hid::circlepad_position). It also provides information from the [3D slider](Hid::slider_3d()), the [volume slider](Hid::slider_volume()), -//! the [accelerometer](Hid::accellerometer_vector()), and the [gyroscope](Hid::gyroscope_rate()). +//! the [accelerometer](Hid::accelerometer_vector()), and the [gyroscope](Hid::gyroscope_rate()). #![doc(alias = "input")] #![doc(alias = "controller")] #![doc(alias = "gamepad")] @@ -91,7 +91,7 @@ pub enum Error { /// Handle to the HID service. pub struct Hid { - active_accellerometer: bool, + active_accelerometer: bool, active_gyroscope: bool, _service_handler: ServiceReference, } @@ -135,7 +135,7 @@ impl Hid { )?; Ok(Self { - active_accellerometer: false, + active_accelerometer: false, active_gyroscope: false, _service_handler: handler, }) @@ -367,7 +367,7 @@ impl Hid { /// /// hid.scan_input(); /// - /// let volume = hid.volume_slider(); + /// let volume = hid.slider_3d(); /// # /// # Ok(()) /// # } @@ -378,37 +378,95 @@ impl Hid { unsafe { (*(ctru_sys::OS_SHAREDCFG_VADDR as *mut ctru_sys::osSharedConfig_s)).slider_3d } } + /// Activate/deactivate the console's acceleration sensor. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::hid::Hid; + /// let mut hid = Hid::new()?; + /// + /// // The accelerometer will start to register movements. + /// hid.set_accelerometer(true); + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "HIDUSER_EnableAccelerometer")] - pub fn enable_accellerometer(&mut self) { - let _ = unsafe { ctru_sys::HIDUSER_EnableAccelerometer() }; - - self.active_accellerometer = true; - } - - #[doc(alias = "HIDUSER_EnableGyroscope")] - pub fn enable_gyroscope(&mut self) { - let _ = unsafe { ctru_sys::HIDUSER_EnableGyroscope() }; - - self.active_gyroscope = true; - } - #[doc(alias = "HIDUSER_DisableAccelerometer")] - pub fn disable_accellerometer(&mut self) { - let _ = unsafe { ctru_sys::HIDUSER_DisableAccelerometer() }; + pub fn set_accelerometer(&mut self, enabled: bool) { + if enabled { + let _ = unsafe { ctru_sys::HIDUSER_EnableAccelerometer() }; + } else { + let _ = unsafe { ctru_sys::HIDUSER_DisableAccelerometer() }; + } - self.active_accellerometer = false; + self.active_accelerometer = enabled; } - + + /// Activate/deactivate the console's gyroscopic sensor. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::hid::Hid; + /// let mut hid = Hid::new()?; + /// + /// // The gyroscope will start to register positions. + /// hid.set_gyroscope(true); + /// # + /// # Ok(()) + /// # } + /// ``` + #[doc(alias = "HIDUSER_EnableGyroscope")] #[doc(alias = "HIDUSER_DisableGyroscope")] - pub fn disable_gyroscope(&mut self) { - let _ = unsafe { ctru_sys::HIDUSER_DisableGyroscope() }; + pub fn set_gyroscope(&mut self, enabled: bool) { + if enabled { + let _ = unsafe { ctru_sys::HIDUSER_EnableGyroscope() }; + } else { + let _ = unsafe { ctru_sys::HIDUSER_DisableGyroscope() }; + } - self.active_gyroscope = false; + self.active_gyroscope = enabled; } + /// Returns the acceleration vector (x,y,z) registered by the accelerometer. + /// + /// # Errors + /// + /// This function will return an error if the accelerometer was not previously enabled. + /// Have a look at [`Hid::set_accelerometer()`] to enable the accelerometer. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::hid::Hid; + /// let mut hid = Hid::new()?; + /// + /// // The accelerometer will start to register movements. + /// hid.set_accelerometer(true); + /// + /// // It's necessary to run `scan_input()` to update the accelerometer's readings. + /// hid.scan_input(); + /// + /// // This call fails if the accelerometer was not previously enabled. + /// let acceleration = hid.accelerometer_vector()?; + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "hidAccelRead")] - pub fn accellerometer_vector(&self) -> Result<(i16, i16, i16), Error> { - if !self.active_accellerometer { + pub fn accelerometer_vector(&self) -> Result<(i16, i16, i16), Error> { + if !self.active_accelerometer { return Err(Error::UnavailableAccelerometer); } @@ -421,6 +479,34 @@ impl Hid { Ok((res.x, res.y, res.z)) } + /// Returns the angular rate (x,y,z) registered by the gyroscope. + /// + /// # Errors + /// + /// This function returns an error if the gyroscope was not previously enabled. + /// Have a look at [`Hid::set_gyroscope()`]. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::hid::Hid; + /// let mut hid = Hid::new()?; + /// + /// // The gyroscope will start to register positions. + /// hid.set_gyroscope(true); + /// + /// // It's necessary to run `scan_input()` to update the gyroscope's readings. + /// hid.scan_input(); + /// + /// // This call fails if the gyroscope was not previously enabled. + /// let angular_rate = hid.gyroscope_rate()?; + /// # + /// # Ok(()) + /// # } + /// ``` #[doc(alias = "hidGyroRead")] pub fn gyroscope_rate(&self) -> Result<(i16, i16, i16), Error> { if !self.active_gyroscope { From a84d2045f22678bf1a386c7b540ed242d73dcb53 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sun, 24 Sep 2023 13:40:39 +0200 Subject: [PATCH 068/101] Fixed Screen unsafety on VRAM --- ctru-rs/src/console.rs | 7 ++- ctru-rs/src/services/gfx.rs | 81 ++++++++++++++++++++++++++++++----- ctru-rs/src/services/hid.rs | 22 +++++----- ctru-rs/src/services/romfs.rs | 2 +- 4 files changed, 88 insertions(+), 24 deletions(-) diff --git a/ctru-rs/src/console.rs b/ctru-rs/src/console.rs index ba85222..697b088 100644 --- a/ctru-rs/src/console.rs +++ b/ctru-rs/src/console.rs @@ -75,6 +75,11 @@ impl<'screen> Console<'screen> { /// /// [`Console`] automatically takes care of flushing and swapping buffers for its screen when printing. /// + /// # Panics + /// + /// If the [`Gfx`](crate::services::gfx::Gfx) service was initialised via [`Gfx::with_formats_vram()`](crate::services::gfx::Gfx::with_formats_vram) + /// this function will crash the program with an ARM exception. + /// /// # Example /// /// ```no_run @@ -84,7 +89,7 @@ impl<'screen> Console<'screen> { /// use ctru::services::gfx::Gfx; /// use ctru::console::Console; /// - /// // Initialize graphics. + /// // Initialize graphics (using framebuffers allocated on the HEAP). /// let gfx = Gfx::new()?; /// /// // Create a `Console` that takes control of the upper LCD screen. diff --git a/ctru-rs/src/services/gfx.rs b/ctru-rs/src/services/gfx.rs index c32a603..dc1dca6 100644 --- a/ctru-rs/src/services/gfx.rs +++ b/ctru-rs/src/services/gfx.rs @@ -37,10 +37,16 @@ pub trait Screen: private::Sealed { /// Returns the Screen side (left or right). fn side(&self) -> Side; - /// Returns a [`RawFrameBuffer`] for the screen. + /// Returns a [`RawFrameBuffer`] for the screen (if the framebuffer was allocated on the HEAP). /// - /// Note that the pointer of the framebuffer returned by this function can - /// change after each call to this function if double buffering is enabled. + /// # Notes + /// + /// The pointer of the framebuffer returned by this function can change after each call + /// to this function if double buffering is enabled, so it's suggested to NOT save it for later use. + /// + /// # Panics + /// + /// If the [`Gfx`] service was initialised via [`Gfx::with_formats_vram()`] this function will crash the program with an ARM exception. #[doc(alias = "gfxGetFramebuffer")] fn raw_framebuffer(&mut self) -> RawFrameBuffer { let mut width: u16 = 0; @@ -251,7 +257,8 @@ impl Gfx { /// /// # Notes /// - /// It's the same as calling: + /// The new `Gfx` instance will allocate the needed framebuffers in the CPU-GPU shared memory region (to ensure compatibiltiy with all possible uses of the `Gfx` service). + /// As such, it's the same as calling: /// /// ```no_run /// # use std::error::Error; @@ -260,12 +267,14 @@ impl Gfx { /// # use ctru::services::gfx::Gfx; /// # use ctru::services::gspgpu::FramebufferFormat; /// # - /// Gfx::with_formats(FramebufferFormat::Bgr8, FramebufferFormat::Bgr8, false)?; + /// Gfx::with_formats_shared(FramebufferFormat::Bgr8, FramebufferFormat::Bgr8)?; /// # /// # Ok(()) /// # } /// ``` /// + /// Have a look at [`Gfx::with_formats_vram()`] if you aren't interested in manipulating the framebuffers using the CPU. + /// /// # Example /// /// ```no_run @@ -281,10 +290,10 @@ impl Gfx { /// ``` #[doc(alias = "gfxInit")] pub fn new() -> Result { - Gfx::with_formats(FramebufferFormat::Bgr8, FramebufferFormat::Bgr8, false) + Gfx::with_formats_shared(FramebufferFormat::Bgr8, FramebufferFormat::Bgr8) } - /// Initialize a new service handle with the chosen framebuffer formats for the top and bottom screens. + /// Initialize a new service handle with the chosen framebuffer formats on the HEAP for the top and bottom screens. /// /// Use [`Gfx::new()`] instead of this function to initialize the module with default parameters /// @@ -298,21 +307,71 @@ impl Gfx { /// /// // Top screen uses RGBA8, bottom screen uses RGB565. /// // The screen buffers are allocated in the standard HEAP memory, and not in VRAM. - /// let gfx = Gfx::with_formats(FramebufferFormat::Rgba8, FramebufferFormat::Rgb565, false)?; + /// let gfx = Gfx::with_formats_shared(FramebufferFormat::Rgba8, FramebufferFormat::Rgb565)?; + /// # + /// # Ok(()) + /// # } + /// ``` + #[doc(alias = "gfxInit")] + pub fn with_formats_shared( + top_fb_fmt: FramebufferFormat, + bottom_fb_fmt: FramebufferFormat, + ) -> Result { + let handler = ServiceReference::new( + &GFX_ACTIVE, + || unsafe { + ctru_sys::gfxInit(top_fb_fmt.into(), bottom_fb_fmt.into(), false); + + Ok(()) + }, + || unsafe { ctru_sys::gfxExit() }, + )?; + + Ok(Self { + top_screen: RefCell::new(TopScreen::new()), + bottom_screen: RefCell::new(BottomScreen), + _service_handler: handler, + }) + } + + /// Initialize a new service handle with the chosen framebuffer formats on the VRAM for the top and bottom screens. + /// + /// # Notes + /// + /// Though unsafe to do so, it's suggested to use VRAM buffers when working exclusively with the GPU, + /// since they result in faster performance and less memory waste. + /// + /// # Safety + /// + /// By initializing the [`Gfx`] service as such, all functionality that relies on CPU manipulation of the framebuffers will + /// be completely unavailable (usually resulting in an ARM panic if wrongly used). + /// + /// Things such as [`Console`](crate::console::Console) and [`Screen::raw_framebuffer()`] will result in ARM exceptions. + /// + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::{gfx::Gfx, gspgpu::FramebufferFormat}; + /// + /// // Top screen uses RGBA8, bottom screen uses RGB565. + /// // The screen buffers are allocated in the in VRAM, so they will NOT be accessible from the CPU. + /// let gfx = unsafe { Gfx::with_formats_vram(FramebufferFormat::Rgba8, FramebufferFormat::Rgb565)? }; /// # /// # Ok(()) /// # } /// ``` #[doc(alias = "gfxInit")] - pub fn with_formats( + pub unsafe fn with_formats_vram( top_fb_fmt: FramebufferFormat, bottom_fb_fmt: FramebufferFormat, - use_vram_buffers: bool, ) -> Result { let handler = ServiceReference::new( &GFX_ACTIVE, || unsafe { - ctru_sys::gfxInit(top_fb_fmt.into(), bottom_fb_fmt.into(), use_vram_buffers); + ctru_sys::gfxInit(top_fb_fmt.into(), bottom_fb_fmt.into(), true); Ok(()) }, diff --git a/ctru-rs/src/services/hid.rs b/ctru-rs/src/services/hid.rs index 0634091..5daabb1 100644 --- a/ctru-rs/src/services/hid.rs +++ b/ctru-rs/src/services/hid.rs @@ -400,13 +400,13 @@ impl Hid { pub fn set_accelerometer(&mut self, enabled: bool) { if enabled { let _ = unsafe { ctru_sys::HIDUSER_EnableAccelerometer() }; - } else { + } else { let _ = unsafe { ctru_sys::HIDUSER_DisableAccelerometer() }; } self.active_accelerometer = enabled; } - + /// Activate/deactivate the console's gyroscopic sensor. /// /// # Example @@ -429,7 +429,7 @@ impl Hid { pub fn set_gyroscope(&mut self, enabled: bool) { if enabled { let _ = unsafe { ctru_sys::HIDUSER_EnableGyroscope() }; - } else { + } else { let _ = unsafe { ctru_sys::HIDUSER_DisableGyroscope() }; } @@ -437,9 +437,9 @@ impl Hid { } /// Returns the acceleration vector (x,y,z) registered by the accelerometer. - /// + /// /// # Errors - /// + /// /// This function will return an error if the accelerometer was not previously enabled. /// Have a look at [`Hid::set_accelerometer()`] to enable the accelerometer. /// @@ -451,10 +451,10 @@ impl Hid { /// # /// use ctru::services::hid::Hid; /// let mut hid = Hid::new()?; - /// + /// /// // The accelerometer will start to register movements. /// hid.set_accelerometer(true); - /// + /// /// // It's necessary to run `scan_input()` to update the accelerometer's readings. /// hid.scan_input(); /// @@ -480,9 +480,9 @@ impl Hid { } /// Returns the angular rate (x,y,z) registered by the gyroscope. - /// + /// /// # Errors - /// + /// /// This function returns an error if the gyroscope was not previously enabled. /// Have a look at [`Hid::set_gyroscope()`]. /// @@ -494,10 +494,10 @@ impl Hid { /// # /// use ctru::services::hid::Hid; /// let mut hid = Hid::new()?; - /// + /// /// // The gyroscope will start to register positions. /// hid.set_gyroscope(true); - /// + /// /// // It's necessary to run `scan_input()` to update the gyroscope's readings. /// hid.scan_input(); /// diff --git a/ctru-rs/src/services/romfs.rs b/ctru-rs/src/services/romfs.rs index fd6064b..572aea6 100644 --- a/ctru-rs/src/services/romfs.rs +++ b/ctru-rs/src/services/romfs.rs @@ -87,7 +87,7 @@ mod tests { fn romfs_lock() { let romfs = RomFS::new().unwrap(); - let _value = *ROMFS_ACTIVE.lock().unwrap(); + let _value = *ROMFS_ACTIVE.try_lock().unwrap(); drop(romfs); } From b577a393236efbfa4faa0b6b873723526156804b Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sun, 24 Sep 2023 13:40:56 +0200 Subject: [PATCH 069/101] Fixed doc lints --- ctru-rs/src/applets/mii_selector.rs | 2 +- ctru-rs/src/linear.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ctru-rs/src/applets/mii_selector.rs b/ctru-rs/src/applets/mii_selector.rs index a2ef72d..bdf661b 100644 --- a/ctru-rs/src/applets/mii_selector.rs +++ b/ctru-rs/src/applets/mii_selector.rs @@ -1,7 +1,7 @@ //! Mii Selector applet. //! //! This applet opens a window which lets the player/user choose a Mii from the ones present on their console. -//! The selected Mii is readable as a [`Mii`](crate::mii::Mii). +//! The selected Mii is readable as a [`Mii`]. use crate::mii::Mii; use bitflags::bitflags; diff --git a/ctru-rs/src/linear.rs b/ctru-rs/src/linear.rs index 269e5dd..927d556 100644 --- a/ctru-rs/src/linear.rs +++ b/ctru-rs/src/linear.rs @@ -16,7 +16,7 @@ use std::ptr::NonNull; // Sadly the linear memory allocator included in `libctru` doesn't implement `linearRealloc` at the time of these additions, // but the default fallback of the `std` will take care of that for us. -/// [`Allocator`](std::alloc::Allocator) struct for LINEAR memory. +/// [`Allocator`] struct for LINEAR memory. /// /// To use this struct the main crate must activate the `allocator_api` unstable feature. #[derive(Copy, Clone, Default, Debug)] From c3021fe39d623ed12a0c02c61e6c8e0b6eb89ca5 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sun, 24 Sep 2023 18:50:08 +0200 Subject: [PATCH 070/101] Translate impls to static inline --- ctru-rs/src/applets/mii_selector.rs | 4 +--- ctru-rs/src/services/hid.rs | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/ctru-rs/src/applets/mii_selector.rs b/ctru-rs/src/applets/mii_selector.rs index bdf661b..2353d7d 100644 --- a/ctru-rs/src/applets/mii_selector.rs +++ b/ctru-rs/src/applets/mii_selector.rs @@ -247,9 +247,7 @@ impl MiiSelector { /// If there's no Mii at that index, the cursor will start at the Mii with the index 0. #[doc(alias = "miiSelectorSetInitialIndex")] pub fn set_initial_index(&mut self, index: usize) { - // This function is static inline in libctru - // https://github.com/devkitPro/libctru/blob/af5321c78ee5c72a55b526fd2ed0d95ca1c05af9/libctru/include/3ds/applets/miiselector.h#L155 - self.config.initial_index = index as u32; + unsafe { ctru_sys::miiSelectorSetInitialIndex(self.config.as_mut(), index as u32) }; } /// Launch the Mii Selector. diff --git a/ctru-rs/src/services/hid.rs b/ctru-rs/src/services/hid.rs index 5daabb1..808ff03 100644 --- a/ctru-rs/src/services/hid.rs +++ b/ctru-rs/src/services/hid.rs @@ -374,8 +374,7 @@ impl Hid { /// ``` #[doc(alias = "osGet3DSliderState")] pub fn slider_3d(&self) -> f32 { - // TODO: Replace with the static inline function `osGet3DSliderState`, which works the exact same way. - unsafe { (*(ctru_sys::OS_SHAREDCFG_VADDR as *mut ctru_sys::osSharedConfig_s)).slider_3d } + unsafe { ctru_sys::osGet3DSliderState() } } /// Activate/deactivate the console's acceleration sensor. From 1905c0ca1b1b520765a3f925ea5016a61dbba352 Mon Sep 17 00:00:00 2001 From: Ian Chamberlain Date: Sun, 24 Sep 2023 17:46:29 -0400 Subject: [PATCH 071/101] More cleanup after updates to test-runner-3ds --- .github/workflows/ci.yml | 37 +++++++++++++-------------------- ctru-rs/examples/hello-world.rs | 2 ++ ctru-rs/src/services/gfx.rs | 8 ++++--- ctru-rs/src/services/romfs.rs | 3 +-- 4 files changed, 22 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 08c9a44..9bd4f8f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,12 +9,6 @@ on: - master workflow_dispatch: -env: - # https://blog.rust-lang.org/2022/06/22/sparse-registry-testing.html - CARGO_UNSTABLE_SPARSE_REGISTRY: "true" - # actions-rust-lang/setup-rust-toolchain sets some default RUSTFLAGS - RUSTFLAGS: "" - jobs: lint: strategy: @@ -33,13 +27,15 @@ jobs: - name: Checkout branch uses: actions/checkout@v2 - # TODO update to to rust3ds/$something once migrated. Also, this is a bit - # wordy, it might be nicer to put the actions at the top level of the repo - - uses: ian-h-chamberlain/test-runner-3ds/.github/actions/setup@v1 + # TODO point to to rust3ds/test-runner once migrated + - uses: ian-h-chamberlain/test-runner-3ds/setup@v1 with: toolchain: ${{ matrix.toolchain }} - - name: Hide duplicate warnings from nightly + # https://github.com/actions/runner/issues/504 + # Removing the matchers won't keep the job from failing if there are errors, + # but will at least declutter pull request annotations (especially for warnings). + - name: Hide duplicate annotations from nightly if: ${{ matrix.toolchain == 'nightly' }} run: | echo "::remove-matcher owner=clippy::" @@ -67,27 +63,22 @@ jobs: - name: Checkout branch uses: actions/checkout@v2 - - uses: ian-h-chamberlain/test-runner-3ds/.github/actions/setup@v1 + - uses: ian-h-chamberlain/test-runner-3ds/setup@v1 with: toolchain: ${{ matrix.toolchain }} - name: Hide duplicated warnings from lint job run: echo "::remove-matcher owner=clippy::" - - name: Build lib + integration tests - # Technically this will only build one 3dsx even if there's more than one executable, - # but we only run the `.elf` outputs so it doesn't really matter. - run: cargo 3ds test --no-run --tests --package ctru-rs - - - name: Build doc tests - run: cargo 3ds test --no-run --doc - - - name: Run lib + integration tests - uses: ian-h-chamberlain/test-runner-3ds/.github/actions/citra@v1 + - name: Build and run lib and integration tests + uses: ian-h-chamberlain/test-runner-3ds/run-tests@v1 with: - executable: ./target/armv6k-nintendo-3ds/debug/deps/*.elf + args: --tests --package ctru-rs - # TODO: run doc tests https://github.com/ian-h-chamberlain/test-runner-3ds/issues/4 + - name: Build and run doc tests + uses: ian-h-chamberlain/test-runner-3ds/run-tests@v1 + with: + args: --doc --package ctru-rs - name: Upload citra logs and capture videos uses: actions/upload-artifact@v3 diff --git a/ctru-rs/examples/hello-world.rs b/ctru-rs/examples/hello-world.rs index 9210484..c3c2791 100644 --- a/ctru-rs/examples/hello-world.rs +++ b/ctru-rs/examples/hello-world.rs @@ -31,6 +31,8 @@ fn main() { String::from_utf8_lossy(&writer.into_inner().unwrap()) ); + dbg!(std::env::args()); + println!("\x1b[29;16HPress Start to exit"); // Main application loop. This checks whether the app is normally running in the foreground. diff --git a/ctru-rs/src/services/gfx.rs b/ctru-rs/src/services/gfx.rs index 77198cf..7768ee1 100644 --- a/ctru-rs/src/services/gfx.rs +++ b/ctru-rs/src/services/gfx.rs @@ -499,8 +499,10 @@ mod tests { #[test] fn gfx_duplicate() { - // NOTE: this will fail if using the console test runner, since that creates - // a Gfx as part of its test setup. - Gfx::new().unwrap(); + // NOTE: this is expected to fail if using the console test runner, since + // that necessarily creates a Gfx as part of its test setup: + let _gfx = Gfx::new().unwrap(); + + assert!(matches!(Gfx::new(), Err(Error::ServiceAlreadyActive))); } } diff --git a/ctru-rs/src/services/romfs.rs b/ctru-rs/src/services/romfs.rs index bc0896d..d697e8a 100644 --- a/ctru-rs/src/services/romfs.rs +++ b/ctru-rs/src/services/romfs.rs @@ -27,10 +27,10 @@ #![doc(alias = "embed")] #![doc(alias = "filesystem")] -use crate::error::ResultCode; use std::ffi::CStr; use std::sync::Mutex; +use crate::error::ResultCode; use crate::services::ServiceReference; /// Handle to the RomFS service. @@ -84,7 +84,6 @@ mod tests { use super::*; #[test] - #[ignore = "library test .elf doesn't have the romfs in it. citra runner needs to support 3dsx"] fn romfs_counter() { let _romfs = RomFS::new().unwrap(); let value = *ROMFS_ACTIVE.lock().unwrap(); From ee68d9d806cf1220b808b23d681262216aee3748 Mon Sep 17 00:00:00 2001 From: Ian Chamberlain Date: Mon, 25 Sep 2023 22:06:36 -0400 Subject: [PATCH 072/101] Enable running all tests and fix issues We had a couple `fs` examples unwrapping expected errors, but mostly everything passed! --- ctru-rs/examples/audio-filters.rs | 6 +-- ctru-rs/examples/camera-image.rs | 4 +- ctru-rs/examples/file-explorer.rs | 6 +-- ctru-rs/examples/futures-basic.rs | 4 +- ctru-rs/examples/futures-tokio.rs | 4 +- ctru-rs/examples/hello-world.rs | 3 +- ctru-rs/examples/network-sockets.rs | 4 +- ctru-rs/examples/thread-basic.rs | 4 +- ctru-rs/examples/thread-info.rs | 4 +- ctru-rs/examples/thread-locals.rs | 4 +- ctru-rs/src/applets/mii_selector.rs | 28 ++++++---- ctru-rs/src/applets/swkbd.rs | 34 +++++++----- ctru-rs/src/console.rs | 11 ++-- ctru-rs/src/error.rs | 10 ++-- ctru-rs/src/prelude.rs | 10 ++-- ctru-rs/src/services/am.rs | 18 ++++--- ctru-rs/src/services/apt.rs | 6 ++- ctru-rs/src/services/cam.rs | 25 +++++---- ctru-rs/src/services/cfgu.rs | 18 ++++--- ctru-rs/src/services/fs.rs | 83 ++++++++++++++++------------- ctru-rs/src/services/gfx.rs | 21 +++++--- ctru-rs/src/services/hid.rs | 24 ++++++--- ctru-rs/src/services/ndsp/mod.rs | 59 ++++++++++++-------- ctru-rs/src/services/ndsp/wave.rs | 12 +++-- ctru-rs/src/services/ps.rs | 12 +++-- ctru-rs/src/services/reference.rs | 3 +- ctru-rs/src/services/romfs.rs | 3 +- ctru-rs/src/services/soc.rs | 15 ++++-- ctru-rs/src/services/sslc.rs | 3 +- 29 files changed, 268 insertions(+), 170 deletions(-) diff --git a/ctru-rs/examples/audio-filters.rs b/ctru-rs/examples/audio-filters.rs index 75941b7..706d65f 100644 --- a/ctru-rs/examples/audio-filters.rs +++ b/ctru-rs/examples/audio-filters.rs @@ -8,10 +8,8 @@ use std::f32::consts::PI; use ctru::linear::LinearAllocator; use ctru::prelude::*; -use ctru::services::ndsp::{ - wave::{Status, Wave}, - AudioFormat, AudioMix, InterpolationType, Ndsp, OutputMode, -}; +use ctru::services::ndsp::wave::{Status, Wave}; +use ctru::services::ndsp::{AudioFormat, AudioMix, InterpolationType, Ndsp, OutputMode}; // Configuration for the NDSP process and channels. const SAMPLE_RATE: usize = 22050; diff --git a/ctru-rs/examples/camera-image.rs b/ctru-rs/examples/camera-image.rs index 851aa2a..ca9abcc 100644 --- a/ctru-rs/examples/camera-image.rs +++ b/ctru-rs/examples/camera-image.rs @@ -2,13 +2,13 @@ //! //! This example demonstrates how to use the built-in cameras to take a picture and display it to the screen. +use std::time::Duration; + use ctru::prelude::*; use ctru::services::cam::{Cam, Camera, OutputFormat, ShutterSound, ViewSize}; use ctru::services::gfx::{Flush, Screen, Swap}; use ctru::services::gspgpu::FramebufferFormat; -use std::time::Duration; - const WIDTH: usize = 400; const HEIGHT: usize = 240; diff --git a/ctru-rs/examples/file-explorer.rs b/ctru-rs/examples/file-explorer.rs index 6fa1183..d0a8718 100644 --- a/ctru-rs/examples/file-explorer.rs +++ b/ctru-rs/examples/file-explorer.rs @@ -3,13 +3,13 @@ //! This (rather complex) example creates a working text-based file explorer which shows off using standard library file system APIs to //! read the SD card and RomFS (if properly read via the `romfs:/` prefix). -use ctru::applets::swkbd::{Button, SoftwareKeyboard}; -use ctru::prelude::*; - use std::fs::DirEntry; use std::os::horizon::fs::MetadataExt; use std::path::{Path, PathBuf}; +use ctru::applets::swkbd::{Button, SoftwareKeyboard}; +use ctru::prelude::*; + fn main() { ctru::use_panic_handler(); diff --git a/ctru-rs/examples/futures-basic.rs b/ctru-rs/examples/futures-basic.rs index c41245c..e2159c3 100644 --- a/ctru-rs/examples/futures-basic.rs +++ b/ctru-rs/examples/futures-basic.rs @@ -7,10 +7,10 @@ #![feature(horizon_thread_ext)] -use ctru::prelude::*; +use std::os::horizon::thread::BuilderExt; +use ctru::prelude::*; use futures::StreamExt; -use std::os::horizon::thread::BuilderExt; fn main() { ctru::use_panic_handler(); diff --git a/ctru-rs/examples/futures-tokio.rs b/ctru-rs/examples/futures-tokio.rs index 986e930..9aa5647 100644 --- a/ctru-rs/examples/futures-tokio.rs +++ b/ctru-rs/examples/futures-tokio.rs @@ -1,10 +1,10 @@ #![feature(horizon_thread_ext)] -use ctru::prelude::*; - use std::os::horizon::thread::BuilderExt; use std::time::Duration; +use ctru::prelude::*; + fn main() { ctru::use_panic_handler(); diff --git a/ctru-rs/examples/hello-world.rs b/ctru-rs/examples/hello-world.rs index c3c2791..230d25a 100644 --- a/ctru-rs/examples/hello-world.rs +++ b/ctru-rs/examples/hello-world.rs @@ -2,9 +2,10 @@ //! //! Simple "Hello World" application to showcase the basic setup needed for any user-oriented app to work. -use ctru::prelude::*; use std::io::BufWriter; +use ctru::prelude::*; + fn main() { // Setup the custom panic handler in case any errors arise. // Thanks to it the user will get promptly notified of any panics. diff --git a/ctru-rs/examples/network-sockets.rs b/ctru-rs/examples/network-sockets.rs index d55e29c..98faa26 100644 --- a/ctru-rs/examples/network-sockets.rs +++ b/ctru-rs/examples/network-sockets.rs @@ -2,12 +2,12 @@ //! //! This example showcases the use of network sockets via the `Soc` service and the standard library's implementations. -use ctru::prelude::*; - use std::io::{self, Read, Write}; use std::net::{Shutdown, TcpListener}; use std::time::Duration; +use ctru::prelude::*; + fn main() { ctru::use_panic_handler(); diff --git a/ctru-rs/examples/thread-basic.rs b/ctru-rs/examples/thread-basic.rs index 3e4604b..b59a644 100644 --- a/ctru-rs/examples/thread-basic.rs +++ b/ctru-rs/examples/thread-basic.rs @@ -1,10 +1,10 @@ #![feature(horizon_thread_ext)] -use ctru::prelude::*; - use std::os::horizon::thread::BuilderExt; use std::time::Duration; +use ctru::prelude::*; + fn main() { ctru::use_panic_handler(); diff --git a/ctru-rs/examples/thread-info.rs b/ctru-rs/examples/thread-info.rs index 46d34d3..54b82c0 100644 --- a/ctru-rs/examples/thread-info.rs +++ b/ctru-rs/examples/thread-info.rs @@ -2,10 +2,10 @@ #![feature(horizon_thread_ext)] -use ctru::prelude::*; - use std::os::horizon::thread::BuilderExt; +use ctru::prelude::*; + fn main() { ctru::use_panic_handler(); diff --git a/ctru-rs/examples/thread-locals.rs b/ctru-rs/examples/thread-locals.rs index 72458c9..310244d 100644 --- a/ctru-rs/examples/thread-locals.rs +++ b/ctru-rs/examples/thread-locals.rs @@ -1,10 +1,10 @@ #![feature(horizon_thread_ext)] -use ctru::prelude::*; - use std::cell::RefCell; use std::os::horizon::thread::BuilderExt; +use ctru::prelude::*; + std::thread_local! { static MY_LOCAL: RefCell<&'static str> = RefCell::new("initial value"); } diff --git a/ctru-rs/src/applets/mii_selector.rs b/ctru-rs/src/applets/mii_selector.rs index bd0e4b4..9bcfbbb 100644 --- a/ctru-rs/src/applets/mii_selector.rs +++ b/ctru-rs/src/applets/mii_selector.rs @@ -3,9 +3,12 @@ //! This applet opens a window which lets the player/user choose a Mii from the ones present on their console. //! The selected Mii is readable as a [`Mii`](crate::mii::Mii). -use crate::mii::Mii; +use std::ffi::CString; +use std::fmt; + use bitflags::bitflags; -use std::{ffi::CString, fmt}; + +use crate::mii::Mii; /// Index of a Mii on the [`MiiSelector`] interface. /// @@ -97,7 +100,8 @@ impl MiiSelector { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # fn main() { /// use ctru::applets::mii_selector::MiiSelector; /// @@ -121,7 +125,8 @@ impl MiiSelector { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # fn main() { /// use ctru::applets::mii_selector::{MiiSelector, Options}; /// let mut mii_selector = MiiSelector::new(); @@ -145,7 +150,8 @@ impl MiiSelector { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # fn main() { /// # /// use ctru::applets::mii_selector::{Index, MiiSelector}; @@ -174,7 +180,8 @@ impl MiiSelector { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # fn main() { /// # /// use ctru::applets::mii_selector::{Index, MiiSelector}; @@ -198,7 +205,8 @@ impl MiiSelector { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # fn main() { /// # /// use ctru::applets::mii_selector::{Index, MiiSelector}; @@ -222,7 +230,8 @@ impl MiiSelector { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # fn main() { /// # /// use ctru::applets::mii_selector::{Index, MiiSelector}; @@ -260,7 +269,8 @@ impl MiiSelector { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # diff --git a/ctru-rs/src/applets/swkbd.rs b/ctru-rs/src/applets/swkbd.rs index 8861ace..931b1c7 100644 --- a/ctru-rs/src/applets/swkbd.rs +++ b/ctru-rs/src/applets/swkbd.rs @@ -5,14 +5,15 @@ // TODO: Split the Parental PIN lock operations into a different type. #![doc(alias = "keyboard")] +use std::fmt::Display; +use std::iter::once; +use std::str; + use bitflags::bitflags; use ctru_sys::{ self, swkbdInit, swkbdInputText, swkbdSetButton, swkbdSetFeatures, swkbdSetHintText, SwkbdState, }; use libc; -use std::fmt::Display; -use std::iter::once; -use std::str; /// Configuration structure to setup the Software Keyboard applet. #[doc(alias = "SwkbdState")] @@ -160,7 +161,8 @@ impl SoftwareKeyboard { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # fn main() { /// # /// use ctru::applets::swkbd::{SoftwareKeyboard, Kind}; @@ -191,7 +193,8 @@ impl SoftwareKeyboard { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -235,7 +238,8 @@ impl SoftwareKeyboard { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -266,7 +270,8 @@ impl SoftwareKeyboard { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # fn main() { /// # /// use ctru::applets::swkbd::{SoftwareKeyboard, Features}; @@ -286,7 +291,8 @@ impl SoftwareKeyboard { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # fn main() { /// # /// use ctru::applets::swkbd::{SoftwareKeyboard, ValidInput, Filters}; @@ -309,7 +315,8 @@ impl SoftwareKeyboard { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # fn main() { /// # /// use ctru::applets::swkbd::{SoftwareKeyboard, ValidInput, Filters}; @@ -336,7 +343,8 @@ impl SoftwareKeyboard { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # fn main() { /// # /// use ctru::applets::swkbd::SoftwareKeyboard; @@ -363,7 +371,8 @@ impl SoftwareKeyboard { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # fn main() { /// # /// use ctru::applets::swkbd::{SoftwareKeyboard, Button, Kind}; @@ -402,7 +411,8 @@ impl SoftwareKeyboard { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # fn main() { /// # /// use ctru::applets::swkbd::{SoftwareKeyboard, Button, Kind}; diff --git a/ctru-rs/src/console.rs b/ctru-rs/src/console.rs index 6768d47..6d25d93 100644 --- a/ctru-rs/src/console.rs +++ b/ctru-rs/src/console.rs @@ -52,12 +52,13 @@ impl<'screen> Console<'screen> { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # - /// use ctru::services::gfx::Gfx; /// use ctru::console::Console; + /// use ctru::services::gfx::Gfx; /// /// // Initialize graphics. /// let gfx = Gfx::new()?; @@ -94,7 +95,8 @@ impl<'screen> Console<'screen> { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -131,7 +133,8 @@ impl<'screen> Console<'screen> { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # diff --git a/ctru-rs/src/error.rs b/ctru-rs/src/error.rs index 41b09f8..a91da3f 100644 --- a/ctru-rs/src/error.rs +++ b/ctru-rs/src/error.rs @@ -3,10 +3,9 @@ //! This module holds the generic error and result types to interface with `ctru_sys` and the [`ctru-rs`](crate) safe wrapper. use std::borrow::Cow; -use std::error; use std::ffi::CStr; -use std::fmt; use std::ops::{ControlFlow, FromResidual, Try}; +use std::{error, fmt}; use ctru_sys::result::{R_DESCRIPTION, R_LEVEL, R_MODULE, R_SUMMARY}; @@ -21,13 +20,14 @@ pub type Result = ::std::result::Result; /// /// # Example /// -/// ```no_run +/// ``` /// use ctru::error::{Result, ResultCode}; /// -/// pub fn hid_init() -> Result<()> { +/// pub fn main() -> Result<()> { +/// # let _runner = test_runner::GdbRunner::default(); /// // We run an unsafe function which returns a `ctru_sys::Result`. /// let result: ctru_sys::Result = unsafe { ctru_sys::hidInit() }; -/// +/// /// // The result code is parsed and any possible error gets returned by the function. /// ResultCode(result)?; /// Ok(()) diff --git a/ctru-rs/src/prelude.rs b/ctru-rs/src/prelude.rs index ee18eab..4e9bd68 100644 --- a/ctru-rs/src/prelude.rs +++ b/ctru-rs/src/prelude.rs @@ -3,9 +3,7 @@ //! Particularly useful when writing very small applications. pub use crate::console::Console; -pub use crate::services::{ - apt::Apt, - gfx::Gfx, - hid::{Hid, KeyPad}, - soc::Soc, -}; +pub use crate::services::apt::Apt; +pub use crate::services::gfx::Gfx; +pub use crate::services::hid::{Hid, KeyPad}; +pub use crate::services::soc::Soc; diff --git a/ctru-rs/src/services/am.rs b/ctru-rs/src/services/am.rs index 68b3af3..33c145f 100644 --- a/ctru-rs/src/services/am.rs +++ b/ctru-rs/src/services/am.rs @@ -8,9 +8,10 @@ #![doc(alias = "app")] #![doc(alias = "manager")] +use std::marker::PhantomData; + use crate::error::ResultCode; use crate::services::fs::FsMediaType; -use std::marker::PhantomData; /// General information about a specific title entry. #[doc(alias = "AM_TitleEntry")] @@ -61,7 +62,8 @@ impl Am { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -84,11 +86,13 @@ impl Am { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # - /// use ctru::services::{fs::FsMediaType, am::Am}; + /// use ctru::services::am::Am; + /// use ctru::services::fs::FsMediaType; /// let app_manager = Am::new()?; /// /// // Number of titles installed on the Nand storage. @@ -113,11 +117,13 @@ impl Am { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # - /// use ctru::services::{fs::FsMediaType, am::Am}; + /// use ctru::services::am::Am; + /// use ctru::services::fs::FsMediaType; /// let app_manager = Am::new()?; /// /// // Number of apps installed on the SD card storage diff --git a/ctru-rs/src/services/apt.rs b/ctru-rs/src/services/apt.rs index b30be85..89ad255 100644 --- a/ctru-rs/src/services/apt.rs +++ b/ctru-rs/src/services/apt.rs @@ -16,7 +16,8 @@ impl Apt { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -44,7 +45,8 @@ impl Apt { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// use std::error::Error; /// use ctru::services::apt::Apt; /// diff --git a/ctru-rs/src/services/cam.rs b/ctru-rs/src/services/cam.rs index 8d4af7b..596741c 100644 --- a/ctru-rs/src/services/cam.rs +++ b/ctru-rs/src/services/cam.rs @@ -4,10 +4,12 @@ //! in the form of byte vectors which can be displayed to the screen or used in other ways. #![doc(alias = "camera")] +use std::time::Duration; + +use ctru_sys::Handle; + use crate::error::{Error, ResultCode}; use crate::services::gspgpu::FramebufferFormat; -use ctru_sys::Handle; -use std::time::Duration; /// Handle to the Camera service. #[non_exhaustive] @@ -343,7 +345,8 @@ pub trait Camera { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -372,7 +375,8 @@ pub trait Camera { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -841,12 +845,13 @@ pub trait Camera { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # use std::time::Duration; /// # fn main() -> Result<(), Box> { /// # - /// use ctru::services::cam::{Cam, Camera, ViewSize, OutputFormat}; + /// use ctru::services::cam::{Cam, Camera, OutputFormat, ViewSize}; /// let mut cam = Cam::new()?; /// /// // We borrow the inward facing `Camera`. @@ -859,7 +864,7 @@ pub trait Camera { /// inward.set_auto_white_balance(true)?; /// /// // Size of the top screen buffer at 2 bytes per pixel (RGB565). - /// let mut buffer = vec![0; 400*240*2]; + /// let mut buffer = vec![0; 400 * 240 * 2]; /// /// // Take picture with 3 seconds of timeout. /// inward.take_picture(&mut buffer, 400, 240, Duration::from_secs(3)); @@ -951,7 +956,8 @@ impl Cam { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -984,7 +990,8 @@ impl Cam { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # diff --git a/ctru-rs/src/services/cfgu.rs b/ctru-rs/src/services/cfgu.rs index b1cbe76..981f8e6 100644 --- a/ctru-rs/src/services/cfgu.rs +++ b/ctru-rs/src/services/cfgu.rs @@ -84,7 +84,8 @@ impl Cfgu { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -105,7 +106,8 @@ impl Cfgu { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -129,7 +131,8 @@ impl Cfgu { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -153,7 +156,8 @@ impl Cfgu { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -177,7 +181,8 @@ impl Cfgu { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -205,7 +210,8 @@ impl Cfgu { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # diff --git a/ctru-rs/src/services/fs.rs b/ctru-rs/src/services/fs.rs index 821b8b9..2ae9bfb 100644 --- a/ctru-rs/src/services/fs.rs +++ b/ctru-rs/src/services/fs.rs @@ -5,17 +5,15 @@ // TODO: Refactor service to accomodate for various changes (such as SMDH support). Properly document the public API. #![doc(alias = "filesystem")] -use bitflags::bitflags; use std::ffi::OsString; -use std::io::Error as IoError; -use std::io::ErrorKind as IoErrorKind; -use std::io::Result as IoResult; -use std::io::{Read, Seek, SeekFrom, Write}; -use std::mem; +use std::io::{ + Error as IoError, ErrorKind as IoErrorKind, Read, Result as IoResult, Seek, SeekFrom, Write, +}; use std::path::{Path, PathBuf}; -use std::ptr; -use std::slice; use std::sync::Arc; +use std::{mem, ptr, slice}; + +use bitflags::bitflags; use widestring::{WideCStr, WideCString}; bitflags! { @@ -136,7 +134,8 @@ pub struct Fs(()); /// /// # Examples /// -/// ```no_run +/// ``` +/// # let _runner = test_runner::GdbRunner::default(); /// use ctru::services::fs::Fs; /// /// let mut fs = Fs::new().unwrap(); @@ -158,12 +157,14 @@ pub struct Archive { /// /// Create a new file and write bytes to it: /// -/// ```no_run +/// ``` +/// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # /// use std::io::prelude::*; -/// use ctru::services::fs::{Fs, File}; +/// +/// use ctru::services::fs::{File, Fs}; /// /// let mut fs = Fs::new()?; /// let mut sdmc = fs.sdmc()?; @@ -174,12 +175,14 @@ pub struct Archive { /// /// Read the contents of a file into a `String`:: /// -/// ```no_run +/// ``` +/// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # /// use std::io::prelude::*; -/// use ctru::services::fs::{Fs, File}; +/// +/// use ctru::services::fs::{File, Fs}; /// /// let mut fs = Fs::new()?; /// let mut sdmc = fs.sdmc()?; @@ -196,13 +199,15 @@ pub struct Archive { /// It can be more efficient to read the contents of a file with a buffered /// `Read`er. This can be accomplished with `BufReader`: /// -/// ```no_run +/// ``` +/// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # -/// use std::io::BufReader; /// use std::io::prelude::*; -/// use ctru::services::fs::{Fs, File}; +/// use std::io::BufReader; +/// +/// use ctru::services::fs::{File, Fs}; /// /// let mut fs = Fs::new()?; /// let mut sdmc = fs.sdmc()?; @@ -247,33 +252,36 @@ pub struct Metadata { /// /// Opening a file to read: /// -/// ```no_run +/// ``` +/// # let _runner = test_runner::GdbRunner::default(); /// use ctru::services::fs::{Fs, OpenOptions}; /// /// let mut fs = Fs::new().unwrap(); /// let mut sdmc_archive = fs.sdmc().unwrap(); -/// let file = OpenOptions::new() -/// .read(true) -/// .archive(&sdmc_archive) -/// .open("foo.txt") -/// .unwrap(); +/// let result = OpenOptions::new() +/// .read(true) +/// .archive(&sdmc_archive) +/// .open("foo.txt"); +/// +/// assert!(result.is_err()); /// ``` /// /// Opening a file for both reading and writing, as well as creating it if it /// doesn't exist: /// -/// ```no_run +/// ``` +/// # let _runner = test_runner::GdbRunner::default(); /// use ctru::services::fs::{Fs, OpenOptions}; /// /// let mut fs = Fs::new().unwrap(); /// let mut sdmc_archive = fs.sdmc().unwrap(); /// let file = OpenOptions::new() -/// .read(true) -/// .write(true) -/// .create(true) -/// .archive(&sdmc_archive) -/// .open("foo.txt") -/// .unwrap(); +/// .read(true) +/// .write(true) +/// .create(true) +/// .archive(&sdmc_archive) +/// .open("/foo.txt") +/// .unwrap(); /// ``` #[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] pub struct OpenOptions { @@ -380,12 +388,14 @@ impl File { /// /// # Examples /// - /// ```no_run - /// use ctru::services::fs::{Fs, File}; + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); + /// use ctru::services::fs::{File, Fs}; /// - /// let mut fs = Fs::new().unwrap(); + /// let mut fs = Fs::new().unwrap(); /// let mut sdmc_archive = fs.sdmc().unwrap(); - /// let mut f = File::open(&sdmc_archive, "/foo.txt").unwrap(); + /// // Non-existent file: + /// assert!(File::open(&sdmc_archive, "/foo.txt").is_err()); /// ``` pub fn open>(arch: &Archive, path: P) -> IoResult { OpenOptions::new() @@ -407,10 +417,11 @@ impl File { /// /// # Examples /// - /// ```no_run - /// use ctru::services::fs::{Fs, File}; + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); + /// use ctru::services::fs::{File, Fs}; /// - /// let mut fs = Fs::new().unwrap(); + /// let mut fs = Fs::new().unwrap(); /// let mut sdmc_archive = fs.sdmc().unwrap(); /// let mut f = File::create(&mut sdmc_archive, "/foo.txt").unwrap(); /// ``` diff --git a/ctru-rs/src/services/gfx.rs b/ctru-rs/src/services/gfx.rs index 7768ee1..4c64c2b 100644 --- a/ctru-rs/src/services/gfx.rs +++ b/ctru-rs/src/services/gfx.rs @@ -253,7 +253,8 @@ impl Gfx { /// /// It's the same as calling: /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -268,7 +269,8 @@ impl Gfx { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -290,11 +292,13 @@ impl Gfx { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # - /// use ctru::services::{gfx::Gfx, gspgpu::FramebufferFormat}; + /// use ctru::services::gfx::Gfx; + /// use ctru::services::gspgpu::FramebufferFormat; /// /// // Top screen uses RGBA8, bottom screen uses RGB565. /// // The screen buffers are allocated in the standard HEAP memory, and not in VRAM. @@ -333,11 +337,13 @@ impl Gfx { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # - /// use ctru::services::{apt::Apt, gfx::Gfx}; + /// use ctru::services::apt::Apt; + /// use ctru::services::gfx::Gfx; /// let apt = Apt::new()?; /// let gfx = Gfx::new()?; /// @@ -376,7 +382,8 @@ impl TopScreen3D<'_> { /// /// # Example /// -/// ```no_run +/// ``` +/// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # diff --git a/ctru-rs/src/services/hid.rs b/ctru-rs/src/services/hid.rs index 56a6035..4b2a360 100644 --- a/ctru-rs/src/services/hid.rs +++ b/ctru-rs/src/services/hid.rs @@ -7,9 +7,10 @@ #![doc(alias = "controller")] #![doc(alias = "gamepad")] -use crate::error::ResultCode; use bitflags::bitflags; +use crate::error::ResultCode; + bitflags! { /// A set of flags corresponding to the button and directional pad inputs present on the 3DS. #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)] @@ -87,7 +88,8 @@ impl Hid { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -113,7 +115,8 @@ impl Hid { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -135,7 +138,8 @@ impl Hid { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -164,7 +168,8 @@ impl Hid { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -193,7 +198,8 @@ impl Hid { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -225,7 +231,8 @@ impl Hid { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -258,7 +265,8 @@ impl Hid { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # diff --git a/ctru-rs/src/services/ndsp/mod.rs b/ctru-rs/src/services/ndsp/mod.rs index 8cda802..b9717eb 100644 --- a/ctru-rs/src/services/ndsp/mod.rs +++ b/ctru-rs/src/services/ndsp/mod.rs @@ -6,17 +6,16 @@ #![doc(alias = "audio")] pub mod wave; +use std::cell::{RefCell, RefMut}; +use std::default::Default; +use std::sync::Mutex; +use std::{error, fmt}; + use wave::{Status, Wave}; use crate::error::ResultCode; use crate::services::ServiceReference; -use std::cell::{RefCell, RefMut}; -use std::default::Default; -use std::error; -use std::fmt; -use std::sync::Mutex; - const NUMBER_OF_CHANNELS: u8 = 24; /// Audio output mode. @@ -118,7 +117,8 @@ impl Ndsp { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -158,7 +158,8 @@ impl Ndsp { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -189,7 +190,8 @@ impl Ndsp { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -213,7 +215,8 @@ impl Channel<'_> { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -235,7 +238,8 @@ impl Channel<'_> { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -257,7 +261,8 @@ impl Channel<'_> { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -280,7 +285,8 @@ impl Channel<'_> { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -303,7 +309,8 @@ impl Channel<'_> { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -339,7 +346,8 @@ impl Channel<'_> { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -366,7 +374,8 @@ impl Channel<'_> { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -390,7 +399,8 @@ impl Channel<'_> { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -415,7 +425,8 @@ impl Channel<'_> { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # use std::default::Default; /// # fn main() -> Result<(), Box> { @@ -439,7 +450,8 @@ impl Channel<'_> { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -464,7 +476,8 @@ impl Channel<'_> { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -493,13 +506,15 @@ impl Channel<'_> { /// /// # Example /// - /// ```no_run + /// ``` /// # #![feature(allocator_api)] /// # use std::error::Error; /// # fn main() -> Result<(), Box> { + /// # let _runner = test_runner::GdbRunner::default(); /// # /// # use ctru::linear::LinearAllocator; - /// use ctru::services::ndsp::{AudioFormat, Ndsp, wave::Wave}; + /// use ctru::services::ndsp::wave::Wave; + /// use ctru::services::ndsp::{AudioFormat, Ndsp}; /// let ndsp = Ndsp::new()?; /// let mut channel_0 = ndsp.channel(0)?; /// diff --git a/ctru-rs/src/services/ndsp/wave.rs b/ctru-rs/src/services/ndsp/wave.rs index 1a383ca..79659fd 100644 --- a/ctru-rs/src/services/ndsp/wave.rs +++ b/ctru-rs/src/services/ndsp/wave.rs @@ -36,12 +36,14 @@ impl Wave { /// /// # Example /// - /// ```no_run + /// ``` /// # #![feature(allocator_api)] /// # fn main() { + /// # let _runner = test_runner::GdbRunner::default(); /// # /// use ctru::linear::LinearAllocator; - /// use ctru::services::ndsp::{AudioFormat, wave::Wave}; + /// use ctru::services::ndsp::wave::Wave; + /// use ctru::services::ndsp::AudioFormat; /// /// // Zeroed box allocated in the LINEAR memory. /// let audio_data = Box::new_in([0u8; 96], LinearAllocator); @@ -110,14 +112,16 @@ impl Wave { /// /// # Example /// - /// ```no_run + /// ``` /// # #![feature(allocator_api)] /// # fn main() { + /// # let _runner = test_runner::GdbRunner::default(); /// # /// # use ctru::linear::LinearAllocator; /// # let _audio_data = Box::new_in([0u8; 96], LinearAllocator); /// # - /// use ctru::services::ndsp::{AudioFormat, wave::{Wave, Status}}; + /// use ctru::services::ndsp::wave::{Status, Wave}; + /// use ctru::services::ndsp::AudioFormat; /// /// // Provide your own audio data. /// let wave = Wave::new(_audio_data, AudioFormat::PCM16Stereo, false); diff --git a/ctru-rs/src/services/ps.rs b/ctru-rs/src/services/ps.rs index fc20a78..27f21a2 100644 --- a/ctru-rs/src/services/ps.rs +++ b/ctru-rs/src/services/ps.rs @@ -63,7 +63,8 @@ impl Ps { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -86,7 +87,8 @@ impl Ps { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -110,7 +112,8 @@ impl Ps { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -134,7 +137,8 @@ impl Ps { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # diff --git a/ctru-rs/src/services/reference.rs b/ctru-rs/src/services/reference.rs index 41319a7..7f6f5ed 100644 --- a/ctru-rs/src/services/reference.rs +++ b/ctru-rs/src/services/reference.rs @@ -1,5 +1,6 @@ -use crate::Error; use std::sync::Mutex; + +use crate::Error; pub(crate) struct ServiceReference { counter: &'static Mutex, close: Box, diff --git a/ctru-rs/src/services/romfs.rs b/ctru-rs/src/services/romfs.rs index d697e8a..c1a9a57 100644 --- a/ctru-rs/src/services/romfs.rs +++ b/ctru-rs/src/services/romfs.rs @@ -45,7 +45,8 @@ impl RomFS { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # diff --git a/ctru-rs/src/services/soc.rs b/ctru-rs/src/services/soc.rs index d418919..2797ae6 100644 --- a/ctru-rs/src/services/soc.rs +++ b/ctru-rs/src/services/soc.rs @@ -5,10 +5,11 @@ #![doc(alias = "socket")] #![doc(alias = "network")] -use libc::memalign; use std::net::Ipv4Addr; use std::sync::Mutex; +use libc::memalign; + use crate::error::ResultCode; use crate::services::ServiceReference; use crate::Error; @@ -30,7 +31,8 @@ impl Soc { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -56,7 +58,8 @@ impl Soc { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -97,7 +100,8 @@ impl Soc { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -130,7 +134,8 @@ impl Soc { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # diff --git a/ctru-rs/src/services/sslc.rs b/ctru-rs/src/services/sslc.rs index af8b65d..81674ad 100644 --- a/ctru-rs/src/services/sslc.rs +++ b/ctru-rs/src/services/sslc.rs @@ -12,7 +12,8 @@ impl SslC { /// /// # Example /// - /// ```no_run + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # From 6881dce541a428e3431981e677d3ebef79c303b0 Mon Sep 17 00:00:00 2001 From: Ian Chamberlain Date: Wed, 27 Sep 2023 00:21:59 -0400 Subject: [PATCH 073/101] Don't run NDSP doctests --- ctru-rs/src/services/ndsp/mod.rs | 61 +++++++++++++++----------------- 1 file changed, 28 insertions(+), 33 deletions(-) diff --git a/ctru-rs/src/services/ndsp/mod.rs b/ctru-rs/src/services/ndsp/mod.rs index b9717eb..a85a325 100644 --- a/ctru-rs/src/services/ndsp/mod.rs +++ b/ctru-rs/src/services/ndsp/mod.rs @@ -3,8 +3,17 @@ //! The NDSP service is used to handle communications to the DSP processor present on the console's motherboard. //! Thanks to the DSP processor the program can play sound effects and music on the console's built-in speakers or to any audio device //! connected via the audio jack. +//! +//! To use NDSP audio, you will need to dump DSP firmware from a real 3DS using +//! something like [DSP1](https://www.gamebrew.org/wiki/DSP1_3DS). +//! +//! `libctru` expects to find it at `sdmc:/3ds/dspfirm.cdc` when initializing the NDSP service. #![doc(alias = "audio")] +// As a result of requiring DSP firmware to initialize, all of the doctests in +// this module are `no_run`, since Citra doesn't provide a stub for the DSP firmware: +// https://github.com/citra-emu/citra/issues/6111 + pub mod wave; use std::cell::{RefCell, RefMut}; use std::default::Default; @@ -113,12 +122,12 @@ impl Ndsp { /// # Errors /// /// This function will return an error if an instance of the [`Ndsp`] struct already exists - /// or if there are any issues during initialization. + /// or if there are any issues during initialization (for example, DSP firmware + /// cannot be found. See [module documentation](super::ndsp) for more details.). /// /// # Example /// - /// ``` - /// # let _runner = test_runner::GdbRunner::default(); + /// ```no_run /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -158,8 +167,7 @@ impl Ndsp { /// /// # Example /// - /// ``` - /// # let _runner = test_runner::GdbRunner::default(); + /// ```no_run /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -190,8 +198,7 @@ impl Ndsp { /// /// # Example /// - /// ``` - /// # let _runner = test_runner::GdbRunner::default(); + /// ```no_run /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -215,8 +222,7 @@ impl Channel<'_> { /// /// # Example /// - /// ``` - /// # let _runner = test_runner::GdbRunner::default(); + /// ```no_run /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -238,8 +244,7 @@ impl Channel<'_> { /// /// # Example /// - /// ``` - /// # let _runner = test_runner::GdbRunner::default(); + /// ```no_run /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -261,8 +266,7 @@ impl Channel<'_> { /// /// # Example /// - /// ``` - /// # let _runner = test_runner::GdbRunner::default(); + /// ```no_run /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -285,8 +289,7 @@ impl Channel<'_> { /// /// # Example /// - /// ``` - /// # let _runner = test_runner::GdbRunner::default(); + /// ```no_run /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -309,8 +312,7 @@ impl Channel<'_> { /// /// # Example /// - /// ``` - /// # let _runner = test_runner::GdbRunner::default(); + /// ```no_run /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -346,8 +348,7 @@ impl Channel<'_> { /// /// # Example /// - /// ``` - /// # let _runner = test_runner::GdbRunner::default(); + /// ```no_run /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -374,8 +375,7 @@ impl Channel<'_> { /// /// # Example /// - /// ``` - /// # let _runner = test_runner::GdbRunner::default(); + /// ```no_run /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -399,8 +399,7 @@ impl Channel<'_> { /// /// # Example /// - /// ``` - /// # let _runner = test_runner::GdbRunner::default(); + /// ```no_run /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -425,8 +424,7 @@ impl Channel<'_> { /// /// # Example /// - /// ``` - /// # let _runner = test_runner::GdbRunner::default(); + /// ```no_run /// # use std::error::Error; /// # use std::default::Default; /// # fn main() -> Result<(), Box> { @@ -450,8 +448,7 @@ impl Channel<'_> { /// /// # Example /// - /// ``` - /// # let _runner = test_runner::GdbRunner::default(); + /// ```no_run /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -476,8 +473,7 @@ impl Channel<'_> { /// /// # Example /// - /// ``` - /// # let _runner = test_runner::GdbRunner::default(); + /// ```no_run /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -506,11 +502,10 @@ impl Channel<'_> { /// /// # Example /// - /// ``` + /// ```no_run /// # #![feature(allocator_api)] /// # use std::error::Error; /// # fn main() -> Result<(), Box> { - /// # let _runner = test_runner::GdbRunner::default(); /// # /// # use ctru::linear::LinearAllocator; /// use ctru::services::ndsp::wave::Wave; @@ -518,10 +513,10 @@ impl Channel<'_> { /// let ndsp = Ndsp::new()?; /// let mut channel_0 = ndsp.channel(0)?; /// - /// # let _audio_data = Box::new_in([0u8; 96], LinearAllocator); + /// # let audio_data = Box::new_in([0u8; 96], LinearAllocator); /// /// // Provide your own audio data. - /// let mut wave = Wave::new(_audio_data, AudioFormat::PCM16Stereo, false); + /// let mut wave = Wave::new(audio_data, AudioFormat::PCM16Stereo, false); /// /// // Clear the audio queue and stop playback. /// channel_0.queue_wave(&mut wave); From ce2023307dca21587e48e60b576b24f03aba7b3b Mon Sep 17 00:00:00 2001 From: Ian Chamberlain Date: Sat, 30 Sep 2023 09:15:05 -0400 Subject: [PATCH 074/101] Fix some small bugs / workarounds for CI --- .github/workflows/ci.yml | 10 +++++++++- ctru-rs/examples/hello-world.rs | 2 -- ctru-rs/src/services/romfs.rs | 2 ++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9bd4f8f..8c43d8a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,7 +70,15 @@ jobs: - name: Hide duplicated warnings from lint job run: echo "::remove-matcher owner=clippy::" - - name: Build and run lib and integration tests + # This needs to be done separately from running the tests to ensure the + # lib tests' .3dsx is built before the test is run (for romfs). We don't + # really have a good way to build the 3dsx in between the build + test, + # unless cargo-3ds actually runs them as separate commands. See + # https://github.com/rust3ds/cargo-3ds/issues/44 for more details + - name: Build lib and integration tests + run: cargo 3ds test --no-run --tests --package ctru-rs + + - name: Run lib and integration tests uses: ian-h-chamberlain/test-runner-3ds/run-tests@v1 with: args: --tests --package ctru-rs diff --git a/ctru-rs/examples/hello-world.rs b/ctru-rs/examples/hello-world.rs index 230d25a..1be0107 100644 --- a/ctru-rs/examples/hello-world.rs +++ b/ctru-rs/examples/hello-world.rs @@ -32,8 +32,6 @@ fn main() { String::from_utf8_lossy(&writer.into_inner().unwrap()) ); - dbg!(std::env::args()); - println!("\x1b[29;16HPress Start to exit"); // Main application loop. This checks whether the app is normally running in the foreground. diff --git a/ctru-rs/src/services/romfs.rs b/ctru-rs/src/services/romfs.rs index c1a9a57..fdf65d7 100644 --- a/ctru-rs/src/services/romfs.rs +++ b/ctru-rs/src/services/romfs.rs @@ -85,6 +85,8 @@ mod tests { use super::*; #[test] + // NOTE: this test only passes when run with a .3dsx, which for now requires separate build + // and run steps so the 3dsx is built before the runner looks for the executable fn romfs_counter() { let _romfs = RomFS::new().unwrap(); let value = *ROMFS_ACTIVE.lock().unwrap(); From 33268566c86cf47f19a7e589c9161f942f500158 Mon Sep 17 00:00:00 2001 From: Ian Chamberlain Date: Sat, 30 Sep 2023 09:33:04 -0400 Subject: [PATCH 075/101] Revert accidental formatting changes --- ctru-rs/examples/audio-filters.rs | 6 ++++-- ctru-rs/examples/camera-image.rs | 4 ++-- ctru-rs/examples/file-explorer.rs | 6 +++--- ctru-rs/examples/futures-basic.rs | 4 ++-- ctru-rs/examples/futures-tokio.rs | 4 ++-- ctru-rs/examples/hello-world.rs | 3 +-- ctru-rs/examples/network-sockets.rs | 4 ++-- ctru-rs/examples/thread-basic.rs | 4 ++-- ctru-rs/examples/thread-info.rs | 4 ++-- ctru-rs/examples/thread-locals.rs | 4 ++-- ctru-rs/src/applets/mii_selector.rs | 28 ++++++++----------------- ctru-rs/src/applets/swkbd.rs | 7 +++---- ctru-rs/src/error.rs | 5 +++-- ctru-rs/src/lib.rs | 3 +-- ctru-rs/src/prelude.rs | 10 +++++---- ctru-rs/src/services/am.rs | 3 +-- ctru-rs/src/services/cam.rs | 8 +++----- ctru-rs/src/services/fs.rs | 32 +++++++++++++++-------------- ctru-rs/src/services/hid.rs | 3 +-- ctru-rs/src/services/ndsp/mod.rs | 11 +++++----- ctru-rs/src/services/ndsp/wave.rs | 6 ++---- ctru-rs/src/services/reference.rs | 3 +-- ctru-rs/src/services/romfs.rs | 2 +- ctru-rs/src/services/soc.rs | 3 +-- 24 files changed, 77 insertions(+), 90 deletions(-) diff --git a/ctru-rs/examples/audio-filters.rs b/ctru-rs/examples/audio-filters.rs index 706d65f..75941b7 100644 --- a/ctru-rs/examples/audio-filters.rs +++ b/ctru-rs/examples/audio-filters.rs @@ -8,8 +8,10 @@ use std::f32::consts::PI; use ctru::linear::LinearAllocator; use ctru::prelude::*; -use ctru::services::ndsp::wave::{Status, Wave}; -use ctru::services::ndsp::{AudioFormat, AudioMix, InterpolationType, Ndsp, OutputMode}; +use ctru::services::ndsp::{ + wave::{Status, Wave}, + AudioFormat, AudioMix, InterpolationType, Ndsp, OutputMode, +}; // Configuration for the NDSP process and channels. const SAMPLE_RATE: usize = 22050; diff --git a/ctru-rs/examples/camera-image.rs b/ctru-rs/examples/camera-image.rs index ca9abcc..851aa2a 100644 --- a/ctru-rs/examples/camera-image.rs +++ b/ctru-rs/examples/camera-image.rs @@ -2,13 +2,13 @@ //! //! This example demonstrates how to use the built-in cameras to take a picture and display it to the screen. -use std::time::Duration; - use ctru::prelude::*; use ctru::services::cam::{Cam, Camera, OutputFormat, ShutterSound, ViewSize}; use ctru::services::gfx::{Flush, Screen, Swap}; use ctru::services::gspgpu::FramebufferFormat; +use std::time::Duration; + const WIDTH: usize = 400; const HEIGHT: usize = 240; diff --git a/ctru-rs/examples/file-explorer.rs b/ctru-rs/examples/file-explorer.rs index d0a8718..6fa1183 100644 --- a/ctru-rs/examples/file-explorer.rs +++ b/ctru-rs/examples/file-explorer.rs @@ -3,13 +3,13 @@ //! This (rather complex) example creates a working text-based file explorer which shows off using standard library file system APIs to //! read the SD card and RomFS (if properly read via the `romfs:/` prefix). +use ctru::applets::swkbd::{Button, SoftwareKeyboard}; +use ctru::prelude::*; + use std::fs::DirEntry; use std::os::horizon::fs::MetadataExt; use std::path::{Path, PathBuf}; -use ctru::applets::swkbd::{Button, SoftwareKeyboard}; -use ctru::prelude::*; - fn main() { ctru::use_panic_handler(); diff --git a/ctru-rs/examples/futures-basic.rs b/ctru-rs/examples/futures-basic.rs index e2159c3..c41245c 100644 --- a/ctru-rs/examples/futures-basic.rs +++ b/ctru-rs/examples/futures-basic.rs @@ -7,10 +7,10 @@ #![feature(horizon_thread_ext)] -use std::os::horizon::thread::BuilderExt; - use ctru::prelude::*; + use futures::StreamExt; +use std::os::horizon::thread::BuilderExt; fn main() { ctru::use_panic_handler(); diff --git a/ctru-rs/examples/futures-tokio.rs b/ctru-rs/examples/futures-tokio.rs index 9aa5647..986e930 100644 --- a/ctru-rs/examples/futures-tokio.rs +++ b/ctru-rs/examples/futures-tokio.rs @@ -1,10 +1,10 @@ #![feature(horizon_thread_ext)] +use ctru::prelude::*; + use std::os::horizon::thread::BuilderExt; use std::time::Duration; -use ctru::prelude::*; - fn main() { ctru::use_panic_handler(); diff --git a/ctru-rs/examples/hello-world.rs b/ctru-rs/examples/hello-world.rs index 1be0107..9210484 100644 --- a/ctru-rs/examples/hello-world.rs +++ b/ctru-rs/examples/hello-world.rs @@ -2,9 +2,8 @@ //! //! Simple "Hello World" application to showcase the basic setup needed for any user-oriented app to work. -use std::io::BufWriter; - use ctru::prelude::*; +use std::io::BufWriter; fn main() { // Setup the custom panic handler in case any errors arise. diff --git a/ctru-rs/examples/network-sockets.rs b/ctru-rs/examples/network-sockets.rs index 98faa26..d55e29c 100644 --- a/ctru-rs/examples/network-sockets.rs +++ b/ctru-rs/examples/network-sockets.rs @@ -2,12 +2,12 @@ //! //! This example showcases the use of network sockets via the `Soc` service and the standard library's implementations. +use ctru::prelude::*; + use std::io::{self, Read, Write}; use std::net::{Shutdown, TcpListener}; use std::time::Duration; -use ctru::prelude::*; - fn main() { ctru::use_panic_handler(); diff --git a/ctru-rs/examples/thread-basic.rs b/ctru-rs/examples/thread-basic.rs index b59a644..3e4604b 100644 --- a/ctru-rs/examples/thread-basic.rs +++ b/ctru-rs/examples/thread-basic.rs @@ -1,10 +1,10 @@ #![feature(horizon_thread_ext)] +use ctru::prelude::*; + use std::os::horizon::thread::BuilderExt; use std::time::Duration; -use ctru::prelude::*; - fn main() { ctru::use_panic_handler(); diff --git a/ctru-rs/examples/thread-info.rs b/ctru-rs/examples/thread-info.rs index 54b82c0..46d34d3 100644 --- a/ctru-rs/examples/thread-info.rs +++ b/ctru-rs/examples/thread-info.rs @@ -2,10 +2,10 @@ #![feature(horizon_thread_ext)] -use std::os::horizon::thread::BuilderExt; - use ctru::prelude::*; +use std::os::horizon::thread::BuilderExt; + fn main() { ctru::use_panic_handler(); diff --git a/ctru-rs/examples/thread-locals.rs b/ctru-rs/examples/thread-locals.rs index 310244d..72458c9 100644 --- a/ctru-rs/examples/thread-locals.rs +++ b/ctru-rs/examples/thread-locals.rs @@ -1,10 +1,10 @@ #![feature(horizon_thread_ext)] +use ctru::prelude::*; + use std::cell::RefCell; use std::os::horizon::thread::BuilderExt; -use ctru::prelude::*; - std::thread_local! { static MY_LOCAL: RefCell<&'static str> = RefCell::new("initial value"); } diff --git a/ctru-rs/src/applets/mii_selector.rs b/ctru-rs/src/applets/mii_selector.rs index 9bcfbbb..bd0e4b4 100644 --- a/ctru-rs/src/applets/mii_selector.rs +++ b/ctru-rs/src/applets/mii_selector.rs @@ -3,12 +3,9 @@ //! This applet opens a window which lets the player/user choose a Mii from the ones present on their console. //! The selected Mii is readable as a [`Mii`](crate::mii::Mii). -use std::ffi::CString; -use std::fmt; - -use bitflags::bitflags; - use crate::mii::Mii; +use bitflags::bitflags; +use std::{ffi::CString, fmt}; /// Index of a Mii on the [`MiiSelector`] interface. /// @@ -100,8 +97,7 @@ impl MiiSelector { /// /// # Example /// - /// ``` - /// # let _runner = test_runner::GdbRunner::default(); + /// ```no_run /// # fn main() { /// use ctru::applets::mii_selector::MiiSelector; /// @@ -125,8 +121,7 @@ impl MiiSelector { /// /// # Example /// - /// ``` - /// # let _runner = test_runner::GdbRunner::default(); + /// ```no_run /// # fn main() { /// use ctru::applets::mii_selector::{MiiSelector, Options}; /// let mut mii_selector = MiiSelector::new(); @@ -150,8 +145,7 @@ impl MiiSelector { /// /// # Example /// - /// ``` - /// # let _runner = test_runner::GdbRunner::default(); + /// ```no_run /// # fn main() { /// # /// use ctru::applets::mii_selector::{Index, MiiSelector}; @@ -180,8 +174,7 @@ impl MiiSelector { /// /// # Example /// - /// ``` - /// # let _runner = test_runner::GdbRunner::default(); + /// ```no_run /// # fn main() { /// # /// use ctru::applets::mii_selector::{Index, MiiSelector}; @@ -205,8 +198,7 @@ impl MiiSelector { /// /// # Example /// - /// ``` - /// # let _runner = test_runner::GdbRunner::default(); + /// ```no_run /// # fn main() { /// # /// use ctru::applets::mii_selector::{Index, MiiSelector}; @@ -230,8 +222,7 @@ impl MiiSelector { /// /// # Example /// - /// ``` - /// # let _runner = test_runner::GdbRunner::default(); + /// ```no_run /// # fn main() { /// # /// use ctru::applets::mii_selector::{Index, MiiSelector}; @@ -269,8 +260,7 @@ impl MiiSelector { /// /// # Example /// - /// ``` - /// # let _runner = test_runner::GdbRunner::default(); + /// ```no_run /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # diff --git a/ctru-rs/src/applets/swkbd.rs b/ctru-rs/src/applets/swkbd.rs index 931b1c7..8497233 100644 --- a/ctru-rs/src/applets/swkbd.rs +++ b/ctru-rs/src/applets/swkbd.rs @@ -5,15 +5,14 @@ // TODO: Split the Parental PIN lock operations into a different type. #![doc(alias = "keyboard")] -use std::fmt::Display; -use std::iter::once; -use std::str; - use bitflags::bitflags; use ctru_sys::{ self, swkbdInit, swkbdInputText, swkbdSetButton, swkbdSetFeatures, swkbdSetHintText, SwkbdState, }; use libc; +use std::fmt::Display; +use std::iter::once; +use std::str; /// Configuration structure to setup the Software Keyboard applet. #[doc(alias = "SwkbdState")] diff --git a/ctru-rs/src/error.rs b/ctru-rs/src/error.rs index a91da3f..b01d898 100644 --- a/ctru-rs/src/error.rs +++ b/ctru-rs/src/error.rs @@ -3,9 +3,10 @@ //! This module holds the generic error and result types to interface with `ctru_sys` and the [`ctru-rs`](crate) safe wrapper. use std::borrow::Cow; +use std::error; use std::ffi::CStr; +use std::fmt; use std::ops::{ControlFlow, FromResidual, Try}; -use std::{error, fmt}; use ctru_sys::result::{R_DESCRIPTION, R_LEVEL, R_MODULE, R_SUMMARY}; @@ -27,7 +28,7 @@ pub type Result = ::std::result::Result; /// # let _runner = test_runner::GdbRunner::default(); /// // We run an unsafe function which returns a `ctru_sys::Result`. /// let result: ctru_sys::Result = unsafe { ctru_sys::hidInit() }; -/// +/// /// // The result code is parsed and any possible error gets returned by the function. /// ResultCode(result)?; /// Ok(()) diff --git a/ctru-rs/src/lib.rs b/ctru-rs/src/lib.rs index aeda735..72bdebd 100644 --- a/ctru-rs/src/lib.rs +++ b/ctru-rs/src/lib.rs @@ -76,9 +76,8 @@ pub fn use_panic_handler() { /// When `test` is enabled, this function will be ignored. #[cfg(not(test))] fn panic_hook_setup() { - use std::panic::PanicInfo; - use crate::services::hid::{Hid, KeyPad}; + use std::panic::PanicInfo; let main_thread = std::thread::current().id(); diff --git a/ctru-rs/src/prelude.rs b/ctru-rs/src/prelude.rs index 4e9bd68..ee18eab 100644 --- a/ctru-rs/src/prelude.rs +++ b/ctru-rs/src/prelude.rs @@ -3,7 +3,9 @@ //! Particularly useful when writing very small applications. pub use crate::console::Console; -pub use crate::services::apt::Apt; -pub use crate::services::gfx::Gfx; -pub use crate::services::hid::{Hid, KeyPad}; -pub use crate::services::soc::Soc; +pub use crate::services::{ + apt::Apt, + gfx::Gfx, + hid::{Hid, KeyPad}, + soc::Soc, +}; diff --git a/ctru-rs/src/services/am.rs b/ctru-rs/src/services/am.rs index 33c145f..cab13b3 100644 --- a/ctru-rs/src/services/am.rs +++ b/ctru-rs/src/services/am.rs @@ -8,10 +8,9 @@ #![doc(alias = "app")] #![doc(alias = "manager")] -use std::marker::PhantomData; - use crate::error::ResultCode; use crate::services::fs::FsMediaType; +use std::marker::PhantomData; /// General information about a specific title entry. #[doc(alias = "AM_TitleEntry")] diff --git a/ctru-rs/src/services/cam.rs b/ctru-rs/src/services/cam.rs index 596741c..449972d 100644 --- a/ctru-rs/src/services/cam.rs +++ b/ctru-rs/src/services/cam.rs @@ -4,12 +4,10 @@ //! in the form of byte vectors which can be displayed to the screen or used in other ways. #![doc(alias = "camera")] -use std::time::Duration; - -use ctru_sys::Handle; - use crate::error::{Error, ResultCode}; use crate::services::gspgpu::FramebufferFormat; +use ctru_sys::Handle; +use std::time::Duration; /// Handle to the Camera service. #[non_exhaustive] @@ -864,7 +862,7 @@ pub trait Camera { /// inward.set_auto_white_balance(true)?; /// /// // Size of the top screen buffer at 2 bytes per pixel (RGB565). - /// let mut buffer = vec![0; 400 * 240 * 2]; + /// let mut buffer = vec![0; 400*240*2]; /// /// // Take picture with 3 seconds of timeout. /// inward.take_picture(&mut buffer, 400, 240, Duration::from_secs(3)); diff --git a/ctru-rs/src/services/fs.rs b/ctru-rs/src/services/fs.rs index 2ae9bfb..0be5425 100644 --- a/ctru-rs/src/services/fs.rs +++ b/ctru-rs/src/services/fs.rs @@ -5,15 +5,17 @@ // TODO: Refactor service to accomodate for various changes (such as SMDH support). Properly document the public API. #![doc(alias = "filesystem")] +use bitflags::bitflags; use std::ffi::OsString; -use std::io::{ - Error as IoError, ErrorKind as IoErrorKind, Read, Result as IoResult, Seek, SeekFrom, Write, -}; +use std::io::Error as IoError; +use std::io::ErrorKind as IoErrorKind; +use std::io::Result as IoResult; +use std::io::{Read, Seek, SeekFrom, Write}; +use std::mem; use std::path::{Path, PathBuf}; +use std::ptr; +use std::slice; use std::sync::Arc; -use std::{mem, ptr, slice}; - -use bitflags::bitflags; use widestring::{WideCStr, WideCString}; bitflags! { @@ -259,8 +261,8 @@ pub struct Metadata { /// let mut fs = Fs::new().unwrap(); /// let mut sdmc_archive = fs.sdmc().unwrap(); /// let result = OpenOptions::new() -/// .read(true) -/// .archive(&sdmc_archive) +/// .read(true) +/// .archive(&sdmc_archive) /// .open("foo.txt"); /// /// assert!(result.is_err()); @@ -276,12 +278,12 @@ pub struct Metadata { /// let mut fs = Fs::new().unwrap(); /// let mut sdmc_archive = fs.sdmc().unwrap(); /// let file = OpenOptions::new() -/// .read(true) -/// .write(true) -/// .create(true) -/// .archive(&sdmc_archive) +/// .read(true) +/// .write(true) +/// .create(true) +/// .archive(&sdmc_archive) /// .open("/foo.txt") -/// .unwrap(); +/// .unwrap(); /// ``` #[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] pub struct OpenOptions { @@ -392,7 +394,7 @@ impl File { /// # let _runner = test_runner::GdbRunner::default(); /// use ctru::services::fs::{File, Fs}; /// - /// let mut fs = Fs::new().unwrap(); + /// let mut fs = Fs::new().unwrap(); /// let mut sdmc_archive = fs.sdmc().unwrap(); /// // Non-existent file: /// assert!(File::open(&sdmc_archive, "/foo.txt").is_err()); @@ -421,7 +423,7 @@ impl File { /// # let _runner = test_runner::GdbRunner::default(); /// use ctru::services::fs::{File, Fs}; /// - /// let mut fs = Fs::new().unwrap(); + /// let mut fs = Fs::new().unwrap(); /// let mut sdmc_archive = fs.sdmc().unwrap(); /// let mut f = File::create(&mut sdmc_archive, "/foo.txt").unwrap(); /// ``` diff --git a/ctru-rs/src/services/hid.rs b/ctru-rs/src/services/hid.rs index 4b2a360..1e0ceee 100644 --- a/ctru-rs/src/services/hid.rs +++ b/ctru-rs/src/services/hid.rs @@ -7,9 +7,8 @@ #![doc(alias = "controller")] #![doc(alias = "gamepad")] -use bitflags::bitflags; - use crate::error::ResultCode; +use bitflags::bitflags; bitflags! { /// A set of flags corresponding to the button and directional pad inputs present on the 3DS. diff --git a/ctru-rs/src/services/ndsp/mod.rs b/ctru-rs/src/services/ndsp/mod.rs index a85a325..987881a 100644 --- a/ctru-rs/src/services/ndsp/mod.rs +++ b/ctru-rs/src/services/ndsp/mod.rs @@ -15,16 +15,17 @@ // https://github.com/citra-emu/citra/issues/6111 pub mod wave; -use std::cell::{RefCell, RefMut}; -use std::default::Default; -use std::sync::Mutex; -use std::{error, fmt}; - use wave::{Status, Wave}; use crate::error::ResultCode; use crate::services::ServiceReference; +use std::cell::{RefCell, RefMut}; +use std::default::Default; +use std::error; +use std::fmt; +use std::sync::Mutex; + const NUMBER_OF_CHANNELS: u8 = 24; /// Audio output mode. diff --git a/ctru-rs/src/services/ndsp/wave.rs b/ctru-rs/src/services/ndsp/wave.rs index 79659fd..9c467e0 100644 --- a/ctru-rs/src/services/ndsp/wave.rs +++ b/ctru-rs/src/services/ndsp/wave.rs @@ -42,8 +42,7 @@ impl Wave { /// # let _runner = test_runner::GdbRunner::default(); /// # /// use ctru::linear::LinearAllocator; - /// use ctru::services::ndsp::wave::Wave; - /// use ctru::services::ndsp::AudioFormat; + /// use ctru::services::ndsp::{AudioFormat, wave::Wave}; /// /// // Zeroed box allocated in the LINEAR memory. /// let audio_data = Box::new_in([0u8; 96], LinearAllocator); @@ -120,8 +119,7 @@ impl Wave { /// # use ctru::linear::LinearAllocator; /// # let _audio_data = Box::new_in([0u8; 96], LinearAllocator); /// # - /// use ctru::services::ndsp::wave::{Status, Wave}; - /// use ctru::services::ndsp::AudioFormat; + /// use ctru::services::ndsp::{AudioFormat, wave::{Wave, Status}}; /// /// // Provide your own audio data. /// let wave = Wave::new(_audio_data, AudioFormat::PCM16Stereo, false); diff --git a/ctru-rs/src/services/reference.rs b/ctru-rs/src/services/reference.rs index 7f6f5ed..41319a7 100644 --- a/ctru-rs/src/services/reference.rs +++ b/ctru-rs/src/services/reference.rs @@ -1,6 +1,5 @@ -use std::sync::Mutex; - use crate::Error; +use std::sync::Mutex; pub(crate) struct ServiceReference { counter: &'static Mutex, close: Box, diff --git a/ctru-rs/src/services/romfs.rs b/ctru-rs/src/services/romfs.rs index fdf65d7..4018a7c 100644 --- a/ctru-rs/src/services/romfs.rs +++ b/ctru-rs/src/services/romfs.rs @@ -27,10 +27,10 @@ #![doc(alias = "embed")] #![doc(alias = "filesystem")] +use crate::error::ResultCode; use std::ffi::CStr; use std::sync::Mutex; -use crate::error::ResultCode; use crate::services::ServiceReference; /// Handle to the RomFS service. diff --git a/ctru-rs/src/services/soc.rs b/ctru-rs/src/services/soc.rs index 2797ae6..548e44d 100644 --- a/ctru-rs/src/services/soc.rs +++ b/ctru-rs/src/services/soc.rs @@ -5,11 +5,10 @@ #![doc(alias = "socket")] #![doc(alias = "network")] +use libc::memalign; use std::net::Ipv4Addr; use std::sync::Mutex; -use libc::memalign; - use crate::error::ResultCode; use crate::services::ServiceReference; use crate::Error; From a187a503cce077a7dd221b7cdc037c60040623fd Mon Sep 17 00:00:00 2001 From: Ian Chamberlain Date: Sat, 30 Sep 2023 09:38:13 -0400 Subject: [PATCH 076/101] Update references to point at rust3ds/test-runner --- .github/workflows/ci.yml | 8 ++++---- ctru-rs/Cargo.toml | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c43d8a..017fc2e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: uses: actions/checkout@v2 # TODO point to to rust3ds/test-runner once migrated - - uses: ian-h-chamberlain/test-runner-3ds/setup@v1 + - uses: rust3ds/test-runner/setup@v1 with: toolchain: ${{ matrix.toolchain }} @@ -63,7 +63,7 @@ jobs: - name: Checkout branch uses: actions/checkout@v2 - - uses: ian-h-chamberlain/test-runner-3ds/setup@v1 + - uses: rust3ds/test-runner/setup@v1 with: toolchain: ${{ matrix.toolchain }} @@ -79,12 +79,12 @@ jobs: run: cargo 3ds test --no-run --tests --package ctru-rs - name: Run lib and integration tests - uses: ian-h-chamberlain/test-runner-3ds/run-tests@v1 + uses: rust3ds/test-runner/run-tests@v1 with: args: --tests --package ctru-rs - name: Build and run doc tests - uses: ian-h-chamberlain/test-runner-3ds/run-tests@v1 + uses: rust3ds/test-runner/run-tests@v1 with: args: --doc --package ctru-rs diff --git a/ctru-rs/Cargo.toml b/ctru-rs/Cargo.toml index bdd7a4d..ac10586 100644 --- a/ctru-rs/Cargo.toml +++ b/ctru-rs/Cargo.toml @@ -34,8 +34,7 @@ cfg-if = "1.0.0" ferris-says = "0.2.1" futures = "0.3" lewton = "0.10.2" -# TODO: switch to rust3ds org once migrated there. Also, rename? -test-runner = { git = "https://github.com/ian-h-chamberlain/test-runner-3ds" } +test-runner = { git = "https://github.com/rust3ds/test-runner.git" } time = "0.3.7" tokio = { version = "1.16", features = ["rt", "time", "sync", "macros"] } From 45468d3aa51c5896648492fb9af69621c47590b8 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Wed, 4 Oct 2023 11:35:08 +0200 Subject: [PATCH 077/101] WIP camera service overhaul --- ctru-rs/examples/buttons.rs | 3 +- ctru-rs/examples/camera-image.rs | 82 ++-- ctru-rs/src/services/cam.rs | 690 ++++++++++++++++++++----------- ctru-rs/src/services/hid.rs | 29 +- 4 files changed, 494 insertions(+), 310 deletions(-) diff --git a/ctru-rs/examples/buttons.rs b/ctru-rs/examples/buttons.rs index e92c349..e7662a1 100644 --- a/ctru-rs/examples/buttons.rs +++ b/ctru-rs/examples/buttons.rs @@ -25,12 +25,11 @@ fn main() { // Get information about which keys were held down on this frame. let keys = hid.keys_held(); - // Print the status of the 2 sliders. + // Print the status of the volume slider. println!( "\x1b[20;0HVolume slider: {} ", hid.slider_volume() ); - println!("\x1b[21;0H3D slider: {} ", hid.slider_3d()); // We only want to print when the keys we're holding now are different // from what they were on the previous frame. diff --git a/ctru-rs/examples/camera-image.rs b/ctru-rs/examples/camera-image.rs index 851aa2a..386f3b5 100644 --- a/ctru-rs/examples/camera-image.rs +++ b/ctru-rs/examples/camera-image.rs @@ -3,17 +3,16 @@ //! This example demonstrates how to use the built-in cameras to take a picture and display it to the screen. use ctru::prelude::*; -use ctru::services::cam::{Cam, Camera, OutputFormat, ShutterSound, ViewSize}; +use ctru::services::cam::{ + Cam, Camera, OutputFormat, ShutterSound, Trimming, ViewSize, WhiteBalance, +}; use ctru::services::gfx::{Flush, Screen, Swap}; use ctru::services::gspgpu::FramebufferFormat; use std::time::Duration; -const WIDTH: usize = 400; -const HEIGHT: usize = 240; - -// The screen size is the width and height multiplied by 2 (RGB565 store pixels in 2 bytes). -const BUF_SIZE: usize = WIDTH * HEIGHT * 2; +const WIDTH: usize = 200; +const HEIGHT: usize = 100; const WAIT_TIMEOUT: Duration = Duration::from_millis(300); @@ -35,30 +34,35 @@ fn main() { let mut cam = Cam::new().expect("Failed to initialize CAM service."); // Camera setup. - { - let camera = &mut cam.outer_right_cam; - - camera - .set_view_size(ViewSize::TopLCD) - .expect("Failed to set camera size"); - camera - .set_output_format(OutputFormat::Rgb565) - .expect("Failed to set camera output format"); - camera - .set_noise_filter(true) - .expect("Failed to enable noise filter"); - camera - .set_auto_exposure(true) - .expect("Failed to enable auto exposure"); - camera - .set_auto_white_balance(true) - .expect("Failed to enable auto white balance"); - camera - .set_trimming(false) - .expect("Failed to disable trimming"); - } - - let mut buf = vec![0u8; BUF_SIZE]; + let camera = &mut cam.outer_right_cam; + + camera + .set_view_size(ViewSize::TopLCD) + .expect("Failed to set camera size"); + camera + .set_output_format(OutputFormat::Rgb565) + .expect("Failed to set camera output format"); + camera + .set_noise_filter(true) + .expect("Failed to enable noise filter"); + camera + .set_auto_exposure(true) + .expect("Failed to enable auto exposure"); + camera + .set_white_balance(WhiteBalance::Auto) + .expect("Failed to enable auto white balance"); + camera + .set_trimming(Trimming::Centered { + width: WIDTH as i16, + height: HEIGHT as i16, + }) + .expect("Failed to disable trimming"); + + // We don't intend on making any other modifications to the camera, so this size should be enough. + let len = camera + .max_byte_count() + .expect("could not retrieve max image buffer size"); + let mut buf = vec![0u8; len]; println!("\nPress R to take a new picture"); println!("Press Start to exit"); @@ -79,20 +83,24 @@ fn main() { // Take a picture and write it to the buffer. camera - .take_picture( - &mut buf, - WIDTH.try_into().unwrap(), - HEIGHT.try_into().unwrap(), - WAIT_TIMEOUT, - ) + .take_picture(&mut buf, WAIT_TIMEOUT) .expect("Failed to take picture"); + let image_size = camera + .final_image_size() + .expect("could not retrieve final image size"); + // Play the normal shutter sound. cam.play_shutter_sound(ShutterSound::Normal) .expect("Failed to play shutter sound"); // Rotate the image and correctly display it on the screen. - rotate_image_to_screen(&buf, top_screen.raw_framebuffer().ptr, WIDTH, HEIGHT); + rotate_image_to_screen( + &buf, + top_screen.raw_framebuffer().ptr, + image_size.0 as usize, + image_size.1 as usize, + ); // We will only flush and swap the "camera" screen, since the other screen is handled by the `Console`. top_screen.flush_buffers(); diff --git a/ctru-rs/src/services/cam.rs b/ctru-rs/src/services/cam.rs index 8d4af7b..fad9159 100644 --- a/ctru-rs/src/services/cam.rs +++ b/ctru-rs/src/services/cam.rs @@ -6,12 +6,17 @@ use crate::error::{Error, ResultCode}; use crate::services::gspgpu::FramebufferFormat; +use crate::services::ServiceReference; use ctru_sys::Handle; + +use std::sync::Mutex; use std::time::Duration; +static CAM_ACTIVE: Mutex<()> = Mutex::new(()); + /// Handle to the Camera service. -#[non_exhaustive] pub struct Cam { + _service_handler: ServiceReference, /// Inside-facing camera. pub inner_cam: InwardCam, /// Outside-facing right camera. @@ -224,33 +229,25 @@ pub enum ShutterSound { MovieEnd = ctru_sys::SHUTTER_SOUND_TYPE_MOVIE_END, } -/// Parameters to handle image trimming. -/// -/// See [`Camera::set_trimming_params()`] to learn how to use this. +/// Configuration to handle image trimming. #[derive(Clone, Copy, Debug, PartialEq, Eq)] -pub struct TrimmingParams { - x_start: i16, - y_start: i16, - x_end: i16, - y_end: i16, -} - -impl TrimmingParams { - /// Creates a new [`TrimmingParams`] and guarantees the start coordinates are less than or - /// equal to the end coordinates. - /// - /// # Panics - /// - /// This function panics if the start coordinates are larger than the end coordinates (for each axis). - pub fn new(x_start: i16, y_start: i16, x_end: i16, y_end: i16) -> TrimmingParams { - assert!(x_start <= x_end && y_start <= y_end); - Self { - x_start, - y_start, - x_end, - y_end, - } - } +pub enum Trimming { + /// Trimming configuration based on absolute coordinates of the image. + Absolute { + /// Top-left corner coordinates (x,y) of the trimmed area. + top_left: (i16, i16), + /// Bottom-right corner coordinates (x,y) of the trimmed area. + bottom_right: (i16, i16), + }, + /// Trimming configuration relatively to the center of the image. + Centered { + /// Width of the trimmed area. + width: i16, + /// Height of the trimmed area. + height: i16, + }, + /// Trimming disabled. + Off, } /// Data used by the camera to calibrate image quality for a single camera. @@ -268,39 +265,33 @@ pub struct StereoCameraCalibrationData(pub ctru_sys::CAMU_StereoCameraCalibratio /// /// Usually used for selfies. #[non_exhaustive] -pub struct InwardCam; - -impl Camera for InwardCam { - fn camera_as_raw(&self) -> ctru_sys::u32_ { - ctru_sys::SELECT_IN1 - } +pub struct InwardCam { + view_size: ViewSize, + trimming: Trimming, } /// Right-side outward camera representation. #[non_exhaustive] -pub struct OutwardRightCam; - -impl Camera for OutwardRightCam { - fn camera_as_raw(&self) -> ctru_sys::u32_ { - ctru_sys::SELECT_OUT1 - } +pub struct OutwardRightCam { + view_size: ViewSize, + trimming: Trimming, } /// Left-side outward camera representation. #[non_exhaustive] -pub struct OutwardLeftCam; - -impl Camera for OutwardLeftCam { - fn camera_as_raw(&self) -> ctru_sys::u32_ { - ctru_sys::SELECT_OUT2 - } +pub struct OutwardLeftCam { + view_size: ViewSize, + trimming: Trimming, } /// Both outer cameras combined. /// /// Usually used for 3D photos. #[non_exhaustive] -pub struct BothOutwardCam; +pub struct BothOutwardCam { + view_size: ViewSize, + trimming: Trimming, +} impl BothOutwardCam { /// Set whether to enable or disable brightness synchronization between the two cameras. @@ -318,6 +309,148 @@ impl BothOutwardCam { } } +impl Camera for InwardCam { + fn camera_as_raw(&self) -> ctru_sys::u32_ { + ctru_sys::SELECT_IN1 + } + + fn view_size(&self) -> ViewSize { + self.view_size + } + + fn set_view_size(&mut self, size: ViewSize) -> crate::Result<()> { + unsafe { + ResultCode(ctru_sys::CAMU_SetSize( + self.camera_as_raw(), + size.into(), + ctru_sys::CONTEXT_A, + ))?; + } + + self.view_size = size; + + self.set_trimming(Trimming::Off); + + Ok(()) + } + + fn trimming(&self) -> Trimming { + self.trimming + } + + fn set_trimming(&mut self, trimming: Trimming) { + match trimming { + Trimming::Absolute { + top_left, + bottom_right, + } => unsafe { + // Top left corner is "before" bottom right corner. + assert!(top_left.0 <= bottom_right.0 && top_left.1 <= bottom_right.1); + // All coordinates are positive. + assert!( + top_left.0 >= 0 + && top_left.1 >= 0 + && bottom_right.0 >= 0 + && bottom_right.1 >= 0 + ); + // All coordinates are within the view. + assert!( + top_left.0 < view_size.0 + && bottom_right.0 < view_size.0 + && top_left.1 < view_size.1 + && bottom_right.1 < view_size.1 + ); + + ResultCode(ctru_sys::CAMU_SetTrimming(self.port_as_raw(), true))?; + + ResultCode(ctru_sys::CAMU_SetTrimmingParams( + self.port_as_raw(), + top_left.0, + top_left.1, + bottom_right.0, + bottom_right.1, + ))?; + Ok(()) + }, + Trimming::Centered { width, height } => unsafe { + let view_size: (i16, i16) = self.view_size().into(); + + // Trim sizes are positive. + assert!(width >= 0 && height >= 0); + // Trim sizes are within the view. + assert!(width <= view_size.0 && height <= view_size.1); + + ResultCode(ctru_sys::CAMU_SetTrimming(self.port_as_raw(), true))?; + + ResultCode(ctru_sys::CAMU_SetTrimmingParamsCenter( + self.port_as_raw(), + width, + height, + view_size.0, + view_size.1, + ))?; + Ok(()) + }, + Trimming::Off => unsafe { + ResultCode(ctru_sys::CAMU_SetTrimming(self.port_as_raw(), false))?; + Ok(()) + }, + } + } +} + +impl Camera for OutwardRightCam { + fn camera_as_raw(&self) -> ctru_sys::u32_ { + ctru_sys::SELECT_OUT1 + } + + fn view_size(&self) -> ViewSize { + self.view_size + } + + fn set_view_size(&mut self, size: ViewSize) -> crate::Result<()> { + unsafe { + ResultCode(ctru_sys::CAMU_SetSize( + self.camera_as_raw(), + size.into(), + ctru_sys::CONTEXT_A, + ))?; + } + + self.view_size = size; + + self.set_trimming(Trimming::Off)?; + + Ok(()) + } +} + +impl Camera for OutwardLeftCam { + fn camera_as_raw(&self) -> ctru_sys::u32_ { + ctru_sys::SELECT_OUT2 + } + + fn view_size(&self) -> ViewSize { + self.view_size + } + + fn set_view_size(&mut self, size: ViewSize) -> crate::Result<()> { + unsafe { + ResultCode(ctru_sys::CAMU_SetSize( + self.camera_as_raw(), + size.into(), + ctru_sys::CONTEXT_A, + ))?; + } + + self.view_size = size; + + self.set_trimming(Trimming::Off)?; + + Ok(()) + } +} + impl Camera for BothOutwardCam { fn camera_as_raw(&self) -> ctru_sys::u32_ { ctru_sys::SELECT_OUT1_OUT2 @@ -326,14 +459,41 @@ impl Camera for BothOutwardCam { fn port_as_raw(&self) -> ctru_sys::u32_ { ctru_sys::PORT_BOTH } + + fn view_size(&self) -> ViewSize { + self.view_size + } + + fn set_view_size(&mut self, size: ViewSize) -> crate::Result<()> { + unsafe { + ResultCode(ctru_sys::CAMU_SetSize( + self.camera_as_raw(), + size.into(), + ctru_sys::CONTEXT_A, + ))?; + } + + self.view_size = size; + + self.set_trimming(Trimming::Off)?; + + Ok(()) + } } /// Generic functionality common to all cameras. -// TODO: Change "set true/set parameters" scheme (classic of C code) into a single "set parameter" scheme using enums. This is valid for stuff such as [`TrimmingParams`] pub trait Camera { /// Returns the raw value of the selected camera. fn camera_as_raw(&self) -> ctru_sys::u32_; + /// Returns view size of the selected camera. + /// + /// # Notes + /// + /// This view is the full resolution at which the camera will take the photo. + /// If you are interested in the final image dimension, after all processing and modifications, have a look at [`Camera::final_image_size()`]. + fn view_size(&self) -> ViewSize; + /// Returns the raw port of the selected camera. fn port_as_raw(&self) -> ctru_sys::u32_ { ctru_sys::PORT_CAM1 @@ -367,7 +527,7 @@ pub trait Camera { } } - /// Returns the maximum amount of transfer bytes based on the view size, trimming, and other + /// Returns the maximum amount of bytes the final image will occupy based on the view size, trimming, pixel depth and other /// modifications set to the camera. /// /// # Example @@ -381,35 +541,81 @@ pub trait Camera { /// /// let inward = &cam.inner_cam; /// - /// // Inward cam is not busy since it is not being used. - /// let transfer_count = inward.transfer_byte_count(); + /// let transfer_count = inward.max_byte_count(); /// # /// # Ok(()) /// # } /// ``` #[doc(alias = "CAMU_GetTransferBytes")] - fn transfer_byte_count(&self) -> crate::Result { - unsafe { - let mut transfer_bytes = 0; - ResultCode(ctru_sys::CAMU_GetTransferBytes( - &mut transfer_bytes, - self.port_as_raw(), - ))?; - Ok(transfer_bytes) + fn max_byte_count(&self) -> crate::Result { + let size = self.final_image_size()?; + + let mut res: usize = (size.0 as usize * size.1 as usize) * std::mem::size_of::(); + + // If we are taking a picture using both outwards cameras, we need to expect 2 images, rather than just 1 + if self.port_as_raw() == ctru_sys::PORT_BOTH { + res = res * 2; } + + Ok(res) } - /// Set whether or not the camera should trim the image. + /// Returns the dimensions of the final image based on the view size, trimming and other + /// modifications set to the camera. /// - /// [`TrimmingParams`] can be set via [`Camera::set_trimming_params`]. - #[doc(alias = "CAMU_SetTrimming")] - fn set_trimming(&mut self, enabled: bool) -> crate::Result<()> { - unsafe { - ResultCode(ctru_sys::CAMU_SetTrimming(self.port_as_raw(), enabled))?; - Ok(()) + /// # Example + /// + /// ```no_run + /// # use std::error::Error; + /// # fn main() -> Result<(), Box> { + /// # + /// use ctru::services::cam::{Cam, Camera}; + /// let cam = Cam::new()?; + /// + /// let mut inward = &cam.inner_cam; + /// + /// inward.set_trimming(Trimming::Centered { + /// width: 100, + /// height: 100, + /// }); + /// + /// // This result will take into account the trimming. + /// let final_resolution = inward.final_image_size(); + /// # + /// # Ok(()) + /// # } + /// ``` + fn final_image_size(&self) -> crate::Result<(i16, i16)> { + match self.is_trimming_enabled()? { + // Take trimming into account + true => { + // This request should never fail, at least not under safe `ctru-rs` usage. + let trimming = self.trimming_configuration()?; + + let Trimming::Absolute { + top_left, + bottom_right, + } = trimming + else { + unreachable!() + }; + + let width = bottom_right.0 - top_left.0; + let height = bottom_right.1 - top_left.1; + + Ok((width, height)) + } + // Simply use the full view size. + false => Ok(self.view_size().into()), } } + fn trimming(&self) -> Trimming; + + /// Set trimming bounds to trim the camera photo. + #[doc(alias = "CAMU_SetTrimming")] + fn set_trimming(&mut self, trimming: Trimming); + /// Returns whether or not trimming is currently enabled for the camera. #[doc(alias = "CAMU_IsTrimming")] fn is_trimming_enabled(&self) -> crate::Result { @@ -420,76 +626,32 @@ pub trait Camera { } } - /// Set trimming bounds based on image coordinates. + /// Returns the [`Trimming`] configuration currently set. /// - /// For trimming to take effect it is required to pass `true` into [`Camera::set_trimming()`]. - #[doc(alias = "CAMU_SetTrimmingParams")] - fn set_trimming_params(&mut self, params: TrimmingParams) -> crate::Result<()> { - unsafe { - ResultCode(ctru_sys::CAMU_SetTrimmingParams( - self.port_as_raw(), - params.x_start, - params.y_start, - params.x_end, - params.y_end, - ))?; - Ok(()) - } - } - - /// Returns the [`TrimmingParams`] currently set. + /// # Notes + /// + /// If successful, this function will always return a [`Trimming::Absolute`]. #[doc(alias = "CAMU_GetTrimmingParams")] - fn trimming_params(&self) -> crate::Result { + fn trimming_configuration(&self) -> crate::Result { unsafe { - let mut x_start = 0; - let mut y_start = 0; - let mut x_end = 0; - let mut y_end = 0; + let mut top_left = (0, 0); + let mut bottom_right = (0, 0); ResultCode(ctru_sys::CAMU_GetTrimmingParams( - &mut x_start, - &mut y_start, - &mut x_end, - &mut y_end, + &mut top_left.0, + &mut top_left.1, + &mut bottom_right.0, + &mut bottom_right.1, self.port_as_raw(), ))?; - Ok(TrimmingParams { - x_start, - y_start, - x_end, - y_end, + Ok(Trimming::Absolute { + top_left, + bottom_right, }) } } - /// Set the trimming bounds relatively to the center of the image. - /// - /// # Notes - /// - /// The new width will be `trim_width / 2` to the left and right of the center. - /// The new height will be `trim_height / 2` above and below the center. - // TODO: This function doesn't use `TrimmingParams`. It'd be better to merge it with `set_trimming_params()` and change the `TrimmingParams` representation. - #[doc(alias = "CAMU_SetTrimmingParamsCenter")] - fn set_trimming_params_center( - &mut self, - trim_width: i16, - trim_height: i16, - cam_width: i16, - cam_height: i16, - ) -> crate::Result<()> { - unsafe { - ResultCode(ctru_sys::CAMU_SetTrimmingParamsCenter( - self.port_as_raw(), - trim_width, - trim_height, - cam_width, - cam_height, - ))?; - Ok(()) - } - } - - /// Set the exposure level of the camera.å + /// Set the exposure level of the camera. #[doc(alias = "CAMU_SetExposure")] fn set_exposure(&mut self, exposure: i8) -> crate::Result<()> { unsafe { @@ -560,31 +722,6 @@ pub trait Camera { } } - /// Set whether auto white balance is enabled or disabled for the camera. - #[doc(alias = "CAMU_SetAutoWhiteBalance")] - fn set_auto_white_balance(&mut self, enabled: bool) -> crate::Result<()> { - unsafe { - ResultCode(ctru_sys::CAMU_SetAutoWhiteBalance( - self.camera_as_raw(), - enabled, - ))?; - Ok(()) - } - } - - /// Returns `true` if auto white balance is enabled for the camera. - #[doc(alias = "CAMU_IsAutoWhiteBalance")] - fn is_auto_white_balance_enabled(&self) -> crate::Result { - unsafe { - let mut enabled = false; - ResultCode(ctru_sys::CAMU_IsAutoWhiteBalance( - &mut enabled, - self.camera_as_raw(), - ))?; - Ok(enabled) - } - } - /// Set the flip mode of the camera's image. #[doc(alias = "CAMU_FlipImage")] fn flip_image(&mut self, flip: FlipMode) -> crate::Result<()> { @@ -598,54 +735,13 @@ pub trait Camera { } } - /// Set the image resolution of the camera in detail. - /// - /// # Errors - /// - /// This function will error if the coordinates of the first crop point are greater than the - /// coordinates of the second crop point. + /// Set the view size of the camera. /// - /// # Arguments + /// # Notes /// - /// * `width` - Width of the image - /// * `height` - height of the image - /// * `crop_0` - The first crop point in which the image will be trimmed - /// * `crop_1` - The second crop point in which the image will be trimmed - #[doc(alias = "CAMU_SetDetailSize")] - fn set_detail_size( - &mut self, - width: i16, - height: i16, - crop_0: (i16, i16), - crop_1: (i16, i16), - ) -> crate::Result<()> { - unsafe { - ResultCode(ctru_sys::CAMU_SetDetailSize( - self.camera_as_raw(), - width, - height, - crop_0.0, - crop_0.1, - crop_1.0, - crop_1.1, - ctru_sys::CONTEXT_A, - ))?; - Ok(()) - } - } - - /// Set the view size of the camera. + /// Calling this function will reset the trimming configuration. #[doc(alias = "CAMU_SetSize")] - fn set_view_size(&mut self, size: ViewSize) -> crate::Result<()> { - unsafe { - ResultCode(ctru_sys::CAMU_SetSize( - self.camera_as_raw(), - size.into(), - ctru_sys::CONTEXT_A, - ))?; - Ok(()) - } - } + fn set_view_size(&mut self, size: ViewSize) -> crate::Result<()>; /// Set the frame rate of the camera. #[doc(alias = "CAMU_SetFrameRate")] @@ -867,59 +963,119 @@ pub trait Camera { /// # Ok(()) /// # } /// ``` - // TODO: This should use the value passed within `set_view_size` rather than arbitrary `width` and `height` values. - // Furthermore, it's pretty unclear what the "default" view size is. What happens if the user doesn't set it before taking the picture? - fn take_picture( - &mut self, - buffer: &mut [u8], - width: u16, - height: u16, - timeout: Duration, - ) -> crate::Result<()> { - let transfer_unit = unsafe { - let mut buf_size = 0; - ResultCode(ctru_sys::CAMU_GetMaxBytes( - &mut buf_size, - width as i16, - height as i16, - ))?; - Ok::(buf_size) - }?; - - unsafe { - ResultCode(ctru_sys::CAMU_SetTransferBytes( - self.port_as_raw(), - transfer_unit, - width as i16, - height as i16, - ))?; - }; + fn take_picture(&mut self, buffer: &mut [u8], timeout: Duration) -> crate::Result<()> { + let full_view: (i16, i16) = self.view_size().into(); - let screen_size: usize = usize::from(width) * usize::from(height) * 2; - if buffer.len() < screen_size { + // Check whether the input buffer is big enough for the image. + let max_size = + (final_view.0 as usize * final_view.1 as usize) * std::mem::size_of::(); + if buffer.len() < max_size { return Err(Error::BufferTooShort { provided: buffer.len(), - wanted: screen_size, + wanted: max_size, }); } unsafe { ResultCode(ctru_sys::CAMU_Activate(self.camera_as_raw()))?; - ResultCode(ctru_sys::CAMU_ClearBuffer(self.port_as_raw()))?; - ResultCode(ctru_sys::CAMU_StartCapture(self.port_as_raw()))?; + }; + + let transfer_unit = match self.trimming() { + Trimming::Absolute { + top_left, + bottom_right, + } => unsafe { + ResultCode(ctru_sys::CAMU_SetTrimming(self.port_as_raw(), true))?; + + ResultCode(ctru_sys::CAMU_SetTrimmingParams( + self.port_as_raw(), + top_left.0, + top_left.1, + bottom_right.0, + bottom_right.1, + ))?; + + // The transfer unit is NOT the "max number of bytes" or whatever the docs make you think it is... + let transfer_unit = unsafe { + let mut transfer_unit = 0; + + ResultCode(ctru_sys::CAMU_GetMaxBytes( + &mut transfer_unit, + final_view.0, + final_view.1, + ))?; + + transfer_unit + }; + + unsafe { + ResultCode(ctru_sys::CAMU_SetTransferBytes( + self.port_as_raw(), + transfer_unit, + final_view.0, + final_view.1, + ))?; + }; + + transfer_unit + }, + Trimming::Centered { width, height } => unsafe { + ResultCode(ctru_sys::CAMU_SetTrimming(self.port_as_raw(), true))?; + + ResultCode(ctru_sys::CAMU_SetTrimmingParamsCenter( + self.port_as_raw(), + width, + height, + full_view.0, + full_view.1, + ))?; + + // The transfer unit is NOT the "max number of bytes" or whatever the docs make you think it is... + let transfer_unit = unsafe { + let mut transfer_unit = 0; + + ResultCode(ctru_sys::CAMU_GetMaxBytes( + &mut transfer_unit, + width, + height, + ))?; + + transfer_unit + }; + + unsafe { + ResultCode(ctru_sys::CAMU_SetTransferBytes( + self.port_as_raw(), + transfer_unit, + width, + height, + ))?; + }; + + transfer_unit + }, + Trimming::Off => unsafe { + ResultCode(ctru_sys::CAMU_SetTrimming(self.port_as_raw(), false))?; + }, }; let receive_event = unsafe { let mut completion_handle: Handle = 0; + ResultCode(ctru_sys::CAMU_SetReceiving( &mut completion_handle, buffer.as_mut_ptr().cast(), self.port_as_raw(), - screen_size as u32, + max_size as u32, transfer_unit.try_into().unwrap(), ))?; - Ok::(completion_handle) - }?; + + completion_handle + }; + + unsafe { + ResultCode(ctru_sys::CAMU_StartCapture(self.port_as_raw()))?; + }; unsafe { // Panicking without closing an SVC handle causes an ARM exception, we have to handle it carefully (TODO: SVC module) @@ -930,7 +1086,10 @@ pub trait Camera { // We close everything first, then we check for possible errors let _ = ctru_sys::svcCloseHandle(receive_event); // We wouldn't return the error even if there was one, so no use of ResultCode is needed + + // Camera state cleanup ResultCode(ctru_sys::CAMU_StopCapture(self.port_as_raw()))?; + ResultCode(ctru_sys::CAMU_ClearBuffer(self.port_as_raw()))?; ResultCode(ctru_sys::CAMU_Activate(ctru_sys::SELECT_NONE))?; wait_result?; @@ -943,6 +1102,11 @@ pub trait Camera { impl Cam { /// Initialize a new service handle. /// + /// # Notes + /// + /// All cameras default to taking photos with [`ViewSize::TopLCD`] and [`OutputFormat::Yuv422`]. + /// Have a look at [`Camera::set_view_size()`] and [`Camera::set_output_format()`] to change these settings. + /// /// # Errors /// /// This function will return an error if the service was unable to be initialized. @@ -964,15 +1128,43 @@ impl Cam { /// ``` #[doc(alias = "camInit")] pub fn new() -> crate::Result { - unsafe { - ResultCode(ctru_sys::camInit())?; - Ok(Cam { - inner_cam: InwardCam, - outer_right_cam: OutwardRightCam, - outer_left_cam: OutwardLeftCam, - both_outer_cams: BothOutwardCam, - }) - } + let _service_handler = ServiceReference::new( + &CAM_ACTIVE, + || { + ResultCode(unsafe { ctru_sys::camInit() })?; + + Ok(()) + }, + || unsafe { + ctru_sys::camExit(); + }, + )?; + + let mut inner_cam = InwardCam { + view_size: ViewSize::TopLCD, + }; + let mut outer_right_cam = OutwardRightCam { + view_size: ViewSize::TopLCD, + }; + let mut outer_left_cam = OutwardLeftCam { + view_size: ViewSize::TopLCD, + }; + let mut both_outer_cams = BothOutwardCam { + view_size: ViewSize::TopLCD, + }; + + inner_cam.set_view_size(ViewSize::TopLCD)?; + outer_right_cam.set_view_size(ViewSize::TopLCD)?; + outer_left_cam.set_view_size(ViewSize::TopLCD)?; + both_outer_cams.set_view_size(ViewSize::TopLCD)?; + + Ok(Cam { + _service_handler, + inner_cam, + outer_right_cam, + outer_left_cam, + both_outer_cams, + }) } /// Play the specified sound based on the [`ShutterSound`] argument @@ -1007,13 +1199,6 @@ impl Cam { } } -impl Drop for Cam { - #[doc(alias = "camExit")] - fn drop(&mut self) { - unsafe { ctru_sys::camExit() }; - } -} - impl TryFrom for OutputFormat { type Error = (); @@ -1036,6 +1221,21 @@ impl TryFrom for FramebufferFormat { } } +impl From for (i16, i16) { + fn from(value: ViewSize) -> Self { + match value { + ViewSize::TopLCD => (400, 240), + ViewSize::BottomLCD => (320, 240), + ViewSize::Vga => (640, 480), + ViewSize::QQVga => (160, 120), + ViewSize::Cif => (352, 288), + ViewSize::QCif => (176, 144), + ViewSize::DS => (256, 192), + ViewSize::DSX4 => (512, 384), + } + } +} + from_impl!(FlipMode, ctru_sys::CAMU_Flip); from_impl!(ViewSize, ctru_sys::CAMU_Size); from_impl!(FrameRate, ctru_sys::CAMU_FrameRate); diff --git a/ctru-rs/src/services/hid.rs b/ctru-rs/src/services/hid.rs index 808ff03..fadd9fd 100644 --- a/ctru-rs/src/services/hid.rs +++ b/ctru-rs/src/services/hid.rs @@ -1,7 +1,7 @@ //! Human Interface Device service. //! //! The HID service provides read access to user input such as [button presses](Hid::keys_down), [touch screen presses](Hid::touch_position), -//! and [circle pad information](Hid::circlepad_position). It also provides information from the [3D slider](Hid::slider_3d()), the [volume slider](Hid::slider_volume()), +//! and [circle pad information](Hid::circlepad_position). It also provides information from the [volume slider](Hid::slider_volume()), //! the [accelerometer](Hid::accelerometer_vector()), and the [gyroscope](Hid::gyroscope_rate()). #![doc(alias = "input")] #![doc(alias = "controller")] @@ -344,7 +344,7 @@ impl Hid { /// # } /// ``` #[doc(alias = "HIDUSER_GetSoundVolume")] - pub fn slider_volume(&self) -> f32 { + pub fn volume_slider(&self) -> f32 { let mut slider = 0; unsafe { @@ -354,29 +354,6 @@ impl Hid { (slider as f32) / 63. } - /// Returns the current 3D slider position (between 0 and 1). - /// - /// # Example - /// - /// ```no_run - /// # use std::error::Error; - /// # fn main() -> Result<(), Box> { - /// # - /// use ctru::services::hid::Hid; - /// let mut hid = Hid::new()?; - /// - /// hid.scan_input(); - /// - /// let volume = hid.slider_3d(); - /// # - /// # Ok(()) - /// # } - /// ``` - #[doc(alias = "osGet3DSliderState")] - pub fn slider_3d(&self) -> f32 { - unsafe { ctru_sys::osGet3DSliderState() } - } - /// Activate/deactivate the console's acceleration sensor. /// /// # Example @@ -478,7 +455,7 @@ impl Hid { Ok((res.x, res.y, res.z)) } - /// Returns the angular rate (x,y,z) registered by the gyroscope. + /// Returns the angular rate (roll,pitch,yaw) registered by the gyroscope. /// /// # Errors /// From b17bed0aeb2b2da0eeb2ab11c6d358504b0dcfd7 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sat, 7 Oct 2023 12:19:59 +0200 Subject: [PATCH 078/101] More CAM changes and WIP trimming --- ctru-rs/examples/camera-image.rs | 22 +- ctru-rs/src/services/cam.rs | 403 ++++++++++++++----------------- 2 files changed, 183 insertions(+), 242 deletions(-) diff --git a/ctru-rs/examples/camera-image.rs b/ctru-rs/examples/camera-image.rs index 386f3b5..9f31f4e 100644 --- a/ctru-rs/examples/camera-image.rs +++ b/ctru-rs/examples/camera-image.rs @@ -11,8 +11,8 @@ use ctru::services::gspgpu::FramebufferFormat; use std::time::Duration; -const WIDTH: usize = 200; -const HEIGHT: usize = 100; +const WIDTH: i16 = 400; +const HEIGHT: i16 = 240; const WAIT_TIMEOUT: Duration = Duration::from_millis(300); @@ -51,17 +51,13 @@ fn main() { camera .set_white_balance(WhiteBalance::Auto) .expect("Failed to enable auto white balance"); - camera - .set_trimming(Trimming::Centered { - width: WIDTH as i16, - height: HEIGHT as i16, - }) - .expect("Failed to disable trimming"); + camera.set_trimming(Trimming::Centered { + width: WIDTH, + height: HEIGHT, + }); // We don't intend on making any other modifications to the camera, so this size should be enough. - let len = camera - .max_byte_count() - .expect("could not retrieve max image buffer size"); + let len = camera.max_byte_count(); let mut buf = vec![0u8; len]; println!("\nPress R to take a new picture"); @@ -86,9 +82,7 @@ fn main() { .take_picture(&mut buf, WAIT_TIMEOUT) .expect("Failed to take picture"); - let image_size = camera - .final_image_size() - .expect("could not retrieve final image size"); + let image_size = camera.final_image_size(); // Play the normal shutter sound. cam.play_shutter_sound(ShutterSound::Normal) diff --git a/ctru-rs/src/services/cam.rs b/ctru-rs/src/services/cam.rs index fad9159..de04ade 100644 --- a/ctru-rs/src/services/cam.rs +++ b/ctru-rs/src/services/cam.rs @@ -261,27 +261,40 @@ pub struct ImageQualityCalibrationData(pub ctru_sys::CAMU_ImageQualityCalibratio #[derive(Default, Clone, Copy, Debug)] pub struct StereoCameraCalibrationData(pub ctru_sys::CAMU_StereoCameraCalibrationData); +/// Basic configuration needed to properly use the built-in cameras. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +struct Configuration { + view_size: ViewSize, + trimming: Trimming, +} + +impl Configuration { + fn new() -> Self { + Self { + view_size: ViewSize::TopLCD, + trimming: Trimming::Off, + } + } +} + /// Inward camera representation (facing the user of the 3DS). /// /// Usually used for selfies. #[non_exhaustive] pub struct InwardCam { - view_size: ViewSize, - trimming: Trimming, + configuration: Configuration, } /// Right-side outward camera representation. #[non_exhaustive] pub struct OutwardRightCam { - view_size: ViewSize, - trimming: Trimming, + configuration: Configuration, } /// Left-side outward camera representation. #[non_exhaustive] pub struct OutwardLeftCam { - view_size: ViewSize, - trimming: Trimming, + configuration: Configuration, } /// Both outer cameras combined. @@ -289,8 +302,7 @@ pub struct OutwardLeftCam { /// Usually used for 3D photos. #[non_exhaustive] pub struct BothOutwardCam { - view_size: ViewSize, - trimming: Trimming, + configuration: Configuration, } impl BothOutwardCam { @@ -309,13 +321,52 @@ impl BothOutwardCam { } } +macro_rules! trimming_checks { + ($trimming:ident, $view_size:expr) => { + match $trimming { + Trimming::Absolute { + top_left, + bottom_right, + } => { + let view_size: (i16, i16) = $view_size; + + // Top left corner is "before" bottom right corner. + assert!(top_left.0 <= bottom_right.0 && top_left.1 <= bottom_right.1); + // All coordinates are positive. + assert!( + top_left.0 >= 0 + && top_left.1 >= 0 + && bottom_right.0 >= 0 + && bottom_right.1 >= 0 + ); + // All coordinates are within the view. + assert!( + top_left.0 < view_size.0 + && bottom_right.0 < view_size.0 + && top_left.1 < view_size.1 + && bottom_right.1 < view_size.1 + ); + } + Trimming::Centered { width, height } => { + let view_size: (i16, i16) = $view_size; + + // Trim sizes are positive. + assert!(width >= 0 && height >= 0); + // Trim sizes are within the view. + assert!(width <= view_size.0 && height <= view_size.1); + } + Trimming::Off => (), + } + }; +} + impl Camera for InwardCam { fn camera_as_raw(&self) -> ctru_sys::u32_ { ctru_sys::SELECT_IN1 } fn view_size(&self) -> ViewSize { - self.view_size + self.configuration.view_size } fn set_view_size(&mut self, size: ViewSize) -> crate::Result<()> { @@ -327,7 +378,7 @@ impl Camera for InwardCam { ))?; } - self.view_size = size; + self.configuration.view_size = size; self.set_trimming(Trimming::Off); @@ -335,67 +386,14 @@ impl Camera for InwardCam { } fn trimming(&self) -> Trimming { - self.trimming + self.configuration.trimming } fn set_trimming(&mut self, trimming: Trimming) { - match trimming { - Trimming::Absolute { - top_left, - bottom_right, - } => unsafe { - // Top left corner is "before" bottom right corner. - assert!(top_left.0 <= bottom_right.0 && top_left.1 <= bottom_right.1); - // All coordinates are positive. - assert!( - top_left.0 >= 0 - && top_left.1 >= 0 - && bottom_right.0 >= 0 - && bottom_right.1 >= 0 - ); - // All coordinates are within the view. - assert!( - top_left.0 < view_size.0 - && bottom_right.0 < view_size.0 - && top_left.1 < view_size.1 - && bottom_right.1 < view_size.1 - ); - - ResultCode(ctru_sys::CAMU_SetTrimming(self.port_as_raw(), true))?; - - ResultCode(ctru_sys::CAMU_SetTrimmingParams( - self.port_as_raw(), - top_left.0, - top_left.1, - bottom_right.0, - bottom_right.1, - ))?; - Ok(()) - }, - Trimming::Centered { width, height } => unsafe { - let view_size: (i16, i16) = self.view_size().into(); - - // Trim sizes are positive. - assert!(width >= 0 && height >= 0); - // Trim sizes are within the view. - assert!(width <= view_size.0 && height <= view_size.1); - - ResultCode(ctru_sys::CAMU_SetTrimming(self.port_as_raw(), true))?; + // Run checks for all trimming possibilities. + trimming_checks!(trimming, self.view_size().into()); - ResultCode(ctru_sys::CAMU_SetTrimmingParamsCenter( - self.port_as_raw(), - width, - height, - view_size.0, - view_size.1, - ))?; - Ok(()) - }, - Trimming::Off => unsafe { - ResultCode(ctru_sys::CAMU_SetTrimming(self.port_as_raw(), false))?; - Ok(()) - }, - } + self.configuration.trimming = trimming; } } @@ -405,7 +403,7 @@ impl Camera for OutwardRightCam { } fn view_size(&self) -> ViewSize { - self.view_size + self.configuration.view_size } fn set_view_size(&mut self, size: ViewSize) -> crate::Result<()> { @@ -417,12 +415,23 @@ impl Camera for OutwardRightCam { ))?; } - self.view_size = size; + self.configuration.view_size = size; - self.set_trimming(Trimming::Off)?; + self.set_trimming(Trimming::Off); Ok(()) } + + fn trimming(&self) -> Trimming { + self.configuration.trimming + } + + fn set_trimming(&mut self, trimming: Trimming) { + // Run checks for all trimming possibilities. + trimming_checks!(trimming, self.view_size().into()); + + self.configuration.trimming = trimming; + } } impl Camera for OutwardLeftCam { @@ -431,7 +440,7 @@ impl Camera for OutwardLeftCam { } fn view_size(&self) -> ViewSize { - self.view_size + self.configuration.view_size } fn set_view_size(&mut self, size: ViewSize) -> crate::Result<()> { @@ -443,12 +452,23 @@ impl Camera for OutwardLeftCam { ))?; } - self.view_size = size; + self.configuration.view_size = size; - self.set_trimming(Trimming::Off)?; + self.set_trimming(Trimming::Off); Ok(()) } + + fn trimming(&self) -> Trimming { + self.configuration.trimming + } + + fn set_trimming(&mut self, trimming: Trimming) { + // Run checks for all trimming possibilities. + trimming_checks!(trimming, self.view_size().into()); + + self.configuration.trimming = trimming; + } } impl Camera for BothOutwardCam { @@ -461,7 +481,7 @@ impl Camera for BothOutwardCam { } fn view_size(&self) -> ViewSize { - self.view_size + self.configuration.view_size } fn set_view_size(&mut self, size: ViewSize) -> crate::Result<()> { @@ -473,12 +493,23 @@ impl Camera for BothOutwardCam { ))?; } - self.view_size = size; + self.configuration.view_size = size; - self.set_trimming(Trimming::Off)?; + self.set_trimming(Trimming::Off); Ok(()) } + + fn trimming(&self) -> Trimming { + self.configuration.trimming + } + + fn set_trimming(&mut self, trimming: Trimming) { + // Run checks for all trimming possibilities. + trimming_checks!(trimming, self.view_size().into()); + + self.configuration.trimming = trimming; + } } /// Generic functionality common to all cameras. @@ -547,8 +578,8 @@ pub trait Camera { /// # } /// ``` #[doc(alias = "CAMU_GetTransferBytes")] - fn max_byte_count(&self) -> crate::Result { - let size = self.final_image_size()?; + fn max_byte_count(&self) -> usize { + let size = self.final_image_size(); let mut res: usize = (size.0 as usize * size.1 as usize) * std::mem::size_of::(); @@ -557,7 +588,7 @@ pub trait Camera { res = res * 2; } - Ok(res) + res } /// Returns the dimensions of the final image based on the view size, trimming and other @@ -585,31 +616,18 @@ pub trait Camera { /// # Ok(()) /// # } /// ``` - fn final_image_size(&self) -> crate::Result<(i16, i16)> { - match self.is_trimming_enabled()? { - // Take trimming into account - true => { - // This request should never fail, at least not under safe `ctru-rs` usage. - let trimming = self.trimming_configuration()?; - - let Trimming::Absolute { - top_left, - bottom_right, - } = trimming - else { - unreachable!() - }; - - let width = bottom_right.0 - top_left.0; - let height = bottom_right.1 - top_left.1; - - Ok((width, height)) - } - // Simply use the full view size. - false => Ok(self.view_size().into()), + fn final_image_size(&self) -> (i16, i16) { + match self.trimming() { + Trimming::Absolute { + top_left, + bottom_right, + } => (bottom_right.0 - top_left.0, bottom_right.1 - top_left.1), + Trimming::Centered { width, height } => (width, height), + Trimming::Off => self.view_size().into(), } } + /// Returns the [`Trimming`] configuration currently set. fn trimming(&self) -> Trimming; /// Set trimming bounds to trim the camera photo. @@ -618,37 +636,8 @@ pub trait Camera { /// Returns whether or not trimming is currently enabled for the camera. #[doc(alias = "CAMU_IsTrimming")] - fn is_trimming_enabled(&self) -> crate::Result { - unsafe { - let mut trimming = false; - ResultCode(ctru_sys::CAMU_IsTrimming(&mut trimming, self.port_as_raw()))?; - Ok(trimming) - } - } - - /// Returns the [`Trimming`] configuration currently set. - /// - /// # Notes - /// - /// If successful, this function will always return a [`Trimming::Absolute`]. - #[doc(alias = "CAMU_GetTrimmingParams")] - fn trimming_configuration(&self) -> crate::Result { - unsafe { - let mut top_left = (0, 0); - let mut bottom_right = (0, 0); - ResultCode(ctru_sys::CAMU_GetTrimmingParams( - &mut top_left.0, - &mut top_left.1, - &mut bottom_right.0, - &mut bottom_right.1, - self.port_as_raw(), - ))?; - - Ok(Trimming::Absolute { - top_left, - bottom_right, - }) - } + fn is_trimming(&self) -> bool { + matches!(self.trimming(), Trimming::Off) } /// Set the exposure level of the camera. @@ -672,22 +661,6 @@ pub trait Camera { } } - /// Set the white balance of the camera. - // TODO: Explain what "without base up" means. - #[doc(alias = "CAMU_SetWhiteBalanceWithoutBaseUp")] - fn set_white_balance_without_base_up( - &mut self, - white_balance: WhiteBalance, - ) -> crate::Result<()> { - unsafe { - ResultCode(ctru_sys::CAMU_SetWhiteBalanceWithoutBaseUp( - self.camera_as_raw(), - white_balance.into(), - ))?; - Ok(()) - } - } - /// Set the sharpness of the camera. #[doc(alias = "CAMU_SetSharpness")] fn set_sharpness(&mut self, sharpness: i8) -> crate::Result<()> { @@ -913,16 +886,6 @@ pub trait Camera { } } - /// Set the camera as the current sleep camera. - // TODO: Explain sleep camera - #[doc(alias = "CAMU_SetSleepCamera")] - fn set_sleep_camera(&mut self) -> crate::Result<()> { - unsafe { - ResultCode(ctru_sys::CAMU_SetSleepCamera(self.camera_as_raw()))?; - Ok(()) - } - } - /// Request the camera to take a picture and write it in a buffer. /// /// # Errors @@ -966,21 +929,13 @@ pub trait Camera { fn take_picture(&mut self, buffer: &mut [u8], timeout: Duration) -> crate::Result<()> { let full_view: (i16, i16) = self.view_size().into(); - // Check whether the input buffer is big enough for the image. - let max_size = - (final_view.0 as usize * final_view.1 as usize) * std::mem::size_of::(); - if buffer.len() < max_size { - return Err(Error::BufferTooShort { - provided: buffer.len(), - wanted: max_size, - }); - } - + // It seems like doing this as the first step gives the option to use trimming and get correct readings for the transfer bytes. unsafe { ResultCode(ctru_sys::CAMU_Activate(self.camera_as_raw()))?; }; - let transfer_unit = match self.trimming() { + // Obtain the final view size and make the needed modifications to the camera. + let final_view: (i16, i16) = match self.trimming() { Trimming::Absolute { top_left, bottom_right, @@ -995,29 +950,7 @@ pub trait Camera { bottom_right.1, ))?; - // The transfer unit is NOT the "max number of bytes" or whatever the docs make you think it is... - let transfer_unit = unsafe { - let mut transfer_unit = 0; - - ResultCode(ctru_sys::CAMU_GetMaxBytes( - &mut transfer_unit, - final_view.0, - final_view.1, - ))?; - - transfer_unit - }; - - unsafe { - ResultCode(ctru_sys::CAMU_SetTransferBytes( - self.port_as_raw(), - transfer_unit, - final_view.0, - final_view.1, - ))?; - }; - - transfer_unit + (bottom_right.0 - top_left.0, bottom_right.1 - top_left.1) }, Trimming::Centered { width, height } => unsafe { ResultCode(ctru_sys::CAMU_SetTrimming(self.port_as_raw(), true))?; @@ -1030,38 +963,57 @@ pub trait Camera { full_view.1, ))?; - // The transfer unit is NOT the "max number of bytes" or whatever the docs make you think it is... - let transfer_unit = unsafe { - let mut transfer_unit = 0; - - ResultCode(ctru_sys::CAMU_GetMaxBytes( - &mut transfer_unit, - width, - height, - ))?; - - transfer_unit - }; - - unsafe { - ResultCode(ctru_sys::CAMU_SetTransferBytes( - self.port_as_raw(), - transfer_unit, - width, - height, - ))?; - }; - - transfer_unit + (width, height) }, Trimming::Off => unsafe { ResultCode(ctru_sys::CAMU_SetTrimming(self.port_as_raw(), false))?; + + full_view }, }; + println!("CAMU_GetMaxBytes{:?}", final_view); + + // The transfer unit is NOT the "max number of bytes" or whatever the docs make you think it is... + let transfer_unit = unsafe { + let mut transfer_unit = 0; + + ResultCode(ctru_sys::CAMU_GetMaxBytes( + &mut transfer_unit, + final_view.0, + final_view.1, + ))?; + + transfer_unit + }; + + unsafe { + ResultCode(ctru_sys::CAMU_SetTransferBytes( + self.port_as_raw(), + transfer_unit, + final_view.0, + final_view.1, + ))?; + }; + + // Check whether the input buffer is big enough for the image. + let max_size = (final_view.0 as usize * final_view.1 as usize) * std::mem::size_of::(); + if buffer.len() < max_size { + // We deactivate the camera prematurely. + // + // Note that it shouldn't be too important whether the camera closes or not here, + // since it only starts capturing later. + unsafe { ResultCode(ctru_sys::CAMU_Activate(ctru_sys::SELECT_NONE))? }; + + return Err(Error::BufferTooShort { + provided: buffer.len(), + wanted: max_size, + }); + } + let receive_event = unsafe { let mut completion_handle: Handle = 0; - + ResultCode(ctru_sys::CAMU_SetReceiving( &mut completion_handle, buffer.as_mut_ptr().cast(), @@ -1073,6 +1025,7 @@ pub trait Camera { completion_handle }; + // Start capturing with the camera. unsafe { ResultCode(ctru_sys::CAMU_StartCapture(self.port_as_raw()))?; }; @@ -1140,18 +1093,12 @@ impl Cam { }, )?; - let mut inner_cam = InwardCam { - view_size: ViewSize::TopLCD, - }; - let mut outer_right_cam = OutwardRightCam { - view_size: ViewSize::TopLCD, - }; - let mut outer_left_cam = OutwardLeftCam { - view_size: ViewSize::TopLCD, - }; - let mut both_outer_cams = BothOutwardCam { - view_size: ViewSize::TopLCD, - }; + let configuration = Configuration::new(); + + let mut inner_cam = InwardCam { configuration }; + let mut outer_right_cam = OutwardRightCam { configuration }; + let mut outer_left_cam = OutwardLeftCam { configuration }; + let mut both_outer_cams = BothOutwardCam { configuration }; inner_cam.set_view_size(ViewSize::TopLCD)?; outer_right_cam.set_view_size(ViewSize::TopLCD)?; From 0067d55abf73f82064d937fcb7a4497e3e4a792c Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sat, 7 Oct 2023 12:21:49 +0200 Subject: [PATCH 079/101] More CAM changes and WIP trimming --- ctru-rs/src/services/cam.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ctru-rs/src/services/cam.rs b/ctru-rs/src/services/cam.rs index de04ade..008dbb4 100644 --- a/ctru-rs/src/services/cam.rs +++ b/ctru-rs/src/services/cam.rs @@ -980,8 +980,8 @@ pub trait Camera { ResultCode(ctru_sys::CAMU_GetMaxBytes( &mut transfer_unit, - final_view.0, - final_view.1, + full_view.0, + full_view.1, ))?; transfer_unit From 2453499d58d789a398bb7c427e9c68e00f294fae Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sat, 7 Oct 2023 13:35:09 +0200 Subject: [PATCH 080/101] Trimming works, finally --- ctru-rs/examples/camera-image.rs | 10 +- ctru-rs/src/services/cam.rs | 158 +++++++++++-------------------- ctru-rs/src/services/hid.rs | 4 +- 3 files changed, 58 insertions(+), 114 deletions(-) diff --git a/ctru-rs/examples/camera-image.rs b/ctru-rs/examples/camera-image.rs index 9f31f4e..9155def 100644 --- a/ctru-rs/examples/camera-image.rs +++ b/ctru-rs/examples/camera-image.rs @@ -11,9 +11,6 @@ use ctru::services::gspgpu::FramebufferFormat; use std::time::Duration; -const WIDTH: i16 = 400; -const HEIGHT: i16 = 240; - const WAIT_TIMEOUT: Duration = Duration::from_millis(300); fn main() { @@ -51,10 +48,9 @@ fn main() { camera .set_white_balance(WhiteBalance::Auto) .expect("Failed to enable auto white balance"); - camera.set_trimming(Trimming::Centered { - width: WIDTH, - height: HEIGHT, - }); + + // Un-comment this line and see how it changes! + // camera.set_trimming(Trimming::Centered(ViewSize::BottomLCD)); // We don't intend on making any other modifications to the camera, so this size should be enough. let len = camera.max_byte_count(); diff --git a/ctru-rs/src/services/cam.rs b/ctru-rs/src/services/cam.rs index 008dbb4..f521d16 100644 --- a/ctru-rs/src/services/cam.rs +++ b/ctru-rs/src/services/cam.rs @@ -110,7 +110,7 @@ pub enum FrameRate { /// White balance settings. /// -/// See [`Camera::set_white_balance()`] and [`Camera::set_white_balance_without_base_up()`] to learn how to use this. +/// See [`Camera::set_white_balance()`] to learn how to use this. #[doc(alias = "CAMU_WhiteBalance")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u32)] @@ -230,22 +230,11 @@ pub enum ShutterSound { } /// Configuration to handle image trimming. +#[non_exhaustive] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum Trimming { - /// Trimming configuration based on absolute coordinates of the image. - Absolute { - /// Top-left corner coordinates (x,y) of the trimmed area. - top_left: (i16, i16), - /// Bottom-right corner coordinates (x,y) of the trimmed area. - bottom_right: (i16, i16), - }, /// Trimming configuration relatively to the center of the image. - Centered { - /// Width of the trimmed area. - width: i16, - /// Height of the trimmed area. - height: i16, - }, + Centered(ViewSize), /// Trimming disabled. Off, } @@ -324,36 +313,12 @@ impl BothOutwardCam { macro_rules! trimming_checks { ($trimming:ident, $view_size:expr) => { match $trimming { - Trimming::Absolute { - top_left, - bottom_right, - } => { + Trimming::Centered(trim_size) => { let view_size: (i16, i16) = $view_size; + let trim_size: (i16, i16) = trim_size.into(); - // Top left corner is "before" bottom right corner. - assert!(top_left.0 <= bottom_right.0 && top_left.1 <= bottom_right.1); - // All coordinates are positive. - assert!( - top_left.0 >= 0 - && top_left.1 >= 0 - && bottom_right.0 >= 0 - && bottom_right.1 >= 0 - ); - // All coordinates are within the view. - assert!( - top_left.0 < view_size.0 - && bottom_right.0 < view_size.0 - && top_left.1 < view_size.1 - && bottom_right.1 < view_size.1 - ); - } - Trimming::Centered { width, height } => { - let view_size: (i16, i16) = $view_size; - - // Trim sizes are positive. - assert!(width >= 0 && height >= 0); // Trim sizes are within the view. - assert!(width <= view_size.0 && height <= view_size.1); + assert!(trim_size.0 <= view_size.0 && trim_size.1 <= view_size.1); } Trimming::Off => (), } @@ -522,7 +487,8 @@ pub trait Camera { /// # Notes /// /// This view is the full resolution at which the camera will take the photo. - /// If you are interested in the final image dimension, after all processing and modifications, have a look at [`Camera::final_image_size()`]. + /// If you are interested in the final image's size, calculated while taking into account all processing and modifications, + /// have a look at [`Camera::final_view_size()`]. fn view_size(&self) -> ViewSize; /// Returns the raw port of the selected camera. @@ -558,9 +524,13 @@ pub trait Camera { } } - /// Returns the maximum amount of bytes the final image will occupy based on the view size, trimming, pixel depth and other + /// Returns the maximum amount of bytes the final image will occupy in memory based on the view size, trimming, pixel depth and other /// modifications set to the camera. /// + /// # Notes + /// + /// Remember to query this information again if *any* changes are applied to the [`Camera`] configuration! + /// /// # Example /// /// ```no_run @@ -572,20 +542,19 @@ pub trait Camera { /// /// let inward = &cam.inner_cam; /// - /// let transfer_count = inward.max_byte_count(); + /// let transfer_count = inward.final_byte_length(); /// # /// # Ok(()) /// # } /// ``` - #[doc(alias = "CAMU_GetTransferBytes")] - fn max_byte_count(&self) -> usize { - let size = self.final_image_size(); + fn final_byte_length(&self) -> usize { + let size = self.final_view_size(); let mut res: usize = (size.0 as usize * size.1 as usize) * std::mem::size_of::(); // If we are taking a picture using both outwards cameras, we need to expect 2 images, rather than just 1 if self.port_as_raw() == ctru_sys::PORT_BOTH { - res = res * 2; + res *= 2; } res @@ -594,35 +563,33 @@ pub trait Camera { /// Returns the dimensions of the final image based on the view size, trimming and other /// modifications set to the camera. /// + /// # Notes + /// + /// Remember to query this information again if *any* changes are applied to the [`Camera`] configuration! + /// /// # Example /// /// ```no_run /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # - /// use ctru::services::cam::{Cam, Camera}; - /// let cam = Cam::new()?; + /// use ctru::services::cam::{Cam, Camera, Trimming, ViewSize}; + /// let mut cam = Cam::new()?; /// - /// let mut inward = &cam.inner_cam; + /// let mut inward = &mut cam.inner_cam; /// - /// inward.set_trimming(Trimming::Centered { - /// width: 100, - /// height: 100, - /// }); + /// // We trim the image down so that it fits on a DS screen! + /// inward.set_trimming(Trimming::Centered(ViewSize::DS)); /// /// // This result will take into account the trimming. - /// let final_resolution = inward.final_image_size(); + /// let final_resolution = inward.final_view_size(); /// # /// # Ok(()) /// # } /// ``` - fn final_image_size(&self) -> (i16, i16) { + fn final_view_size(&self) -> (i16, i16) { match self.trimming() { - Trimming::Absolute { - top_left, - bottom_right, - } => (bottom_right.0 - top_left.0, bottom_right.1 - top_left.1), - Trimming::Centered { width, height } => (width, height), + Trimming::Centered(trim_size) => trim_size.into(), Trimming::Off => self.view_size().into(), } } @@ -905,74 +872,50 @@ pub trait Camera { /// # use std::time::Duration; /// # fn main() -> Result<(), Box> { /// # - /// use ctru::services::cam::{Cam, Camera, ViewSize, OutputFormat}; + /// use ctru::services::cam::{Cam, Camera, ViewSize, OutputFormat, WhiteBalance}; /// let mut cam = Cam::new()?; /// /// // We borrow the inward facing `Camera`. - /// let inward = &mut cam.inner_cam; + /// let camera = &mut cam.inner_cam; /// - /// inward.set_view_size(ViewSize::TopLCD)?; - /// inward.set_output_format(OutputFormat::Rgb565)?; - /// inward.set_noise_filter(true)?; - /// inward.set_auto_exposure(true)?; - /// inward.set_auto_white_balance(true)?; + /// camera.set_view_size(ViewSize::TopLCD)?; + /// camera.set_output_format(OutputFormat::Rgb565)?; + /// camera.set_noise_filter(true)?; + /// camera.set_auto_exposure(true)?; + /// camera.set_white_balance(WhiteBalance::Auto)?; /// /// // Size of the top screen buffer at 2 bytes per pixel (RGB565). - /// let mut buffer = vec![0; 400*240*2]; + /// let mut buffer = vec![0; camera.final_byte_length()]; /// /// // Take picture with 3 seconds of timeout. - /// inward.take_picture(&mut buffer, 400, 240, Duration::from_secs(3)); + /// camera.take_picture(&mut buffer, Duration::from_secs(3)); /// # /// # Ok(()) /// # } /// ``` fn take_picture(&mut self, buffer: &mut [u8], timeout: Duration) -> crate::Result<()> { - let full_view: (i16, i16) = self.view_size().into(); - - // It seems like doing this as the first step gives the option to use trimming and get correct readings for the transfer bytes. - unsafe { - ResultCode(ctru_sys::CAMU_Activate(self.camera_as_raw()))?; - }; - // Obtain the final view size and make the needed modifications to the camera. - let final_view: (i16, i16) = match self.trimming() { - Trimming::Absolute { - top_left, - bottom_right, - } => unsafe { + match self.trimming() { + Trimming::Centered(trim_size) => unsafe { ResultCode(ctru_sys::CAMU_SetTrimming(self.port_as_raw(), true))?; - ResultCode(ctru_sys::CAMU_SetTrimmingParams( - self.port_as_raw(), - top_left.0, - top_left.1, - bottom_right.0, - bottom_right.1, - ))?; - - (bottom_right.0 - top_left.0, bottom_right.1 - top_left.1) - }, - Trimming::Centered { width, height } => unsafe { - ResultCode(ctru_sys::CAMU_SetTrimming(self.port_as_raw(), true))?; + let full_view: (i16, i16) = self.view_size().into(); + let trim_size: (i16, i16) = trim_size.into(); ResultCode(ctru_sys::CAMU_SetTrimmingParamsCenter( self.port_as_raw(), - width, - height, + trim_size.0, + trim_size.1, full_view.0, full_view.1, ))?; - - (width, height) }, Trimming::Off => unsafe { ResultCode(ctru_sys::CAMU_SetTrimming(self.port_as_raw(), false))?; - - full_view }, }; - println!("CAMU_GetMaxBytes{:?}", final_view); + let final_view = self.final_view_size(); // The transfer unit is NOT the "max number of bytes" or whatever the docs make you think it is... let transfer_unit = unsafe { @@ -980,8 +923,8 @@ pub trait Camera { ResultCode(ctru_sys::CAMU_GetMaxBytes( &mut transfer_unit, - full_view.0, - full_view.1, + final_view.0, + final_view.1, ))?; transfer_unit @@ -997,7 +940,7 @@ pub trait Camera { }; // Check whether the input buffer is big enough for the image. - let max_size = (final_view.0 as usize * final_view.1 as usize) * std::mem::size_of::(); + let max_size = self.final_byte_length(); if buffer.len() < max_size { // We deactivate the camera prematurely. // @@ -1011,6 +954,11 @@ pub trait Camera { }); } + unsafe { + ResultCode(ctru_sys::CAMU_Activate(self.camera_as_raw()))?; + ResultCode(ctru_sys::CAMU_ClearBuffer(self.port_as_raw()))?; + }; + let receive_event = unsafe { let mut completion_handle: Handle = 0; diff --git a/ctru-rs/src/services/hid.rs b/ctru-rs/src/services/hid.rs index fadd9fd..7f6abc7 100644 --- a/ctru-rs/src/services/hid.rs +++ b/ctru-rs/src/services/hid.rs @@ -1,7 +1,7 @@ //! Human Interface Device service. //! //! The HID service provides read access to user input such as [button presses](Hid::keys_down), [touch screen presses](Hid::touch_position), -//! and [circle pad information](Hid::circlepad_position). It also provides information from the [volume slider](Hid::slider_volume()), +//! and [circle pad information](Hid::circlepad_position). It also provides information from the [volume slider](Hid::volume_slider()), //! the [accelerometer](Hid::accelerometer_vector()), and the [gyroscope](Hid::gyroscope_rate()). #![doc(alias = "input")] #![doc(alias = "controller")] @@ -338,7 +338,7 @@ impl Hid { /// /// hid.scan_input(); /// - /// let volume = hid.slider_volume(); + /// let volume = hid.volume_slider(); /// # /// # Ok(()) /// # } From ce8fc4ef838486af26556e406f870a9800d97ac7 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sat, 7 Oct 2023 16:54:49 +0200 Subject: [PATCH 081/101] Squash down camera functions --- ctru-rs/examples/camera-image.rs | 44 ++-- ctru-rs/src/services/cam.rs | 351 +++++++++++++------------------ 2 files changed, 166 insertions(+), 229 deletions(-) diff --git a/ctru-rs/examples/camera-image.rs b/ctru-rs/examples/camera-image.rs index 9155def..7ee9b56 100644 --- a/ctru-rs/examples/camera-image.rs +++ b/ctru-rs/examples/camera-image.rs @@ -32,28 +32,30 @@ fn main() { // Camera setup. let camera = &mut cam.outer_right_cam; - - camera - .set_view_size(ViewSize::TopLCD) - .expect("Failed to set camera size"); - camera - .set_output_format(OutputFormat::Rgb565) - .expect("Failed to set camera output format"); - camera - .set_noise_filter(true) - .expect("Failed to enable noise filter"); - camera - .set_auto_exposure(true) - .expect("Failed to enable auto exposure"); - camera - .set_white_balance(WhiteBalance::Auto) - .expect("Failed to enable auto white balance"); - - // Un-comment this line and see how it changes! - // camera.set_trimming(Trimming::Centered(ViewSize::BottomLCD)); + { + camera + .set_view_size(ViewSize::TopLCD) + .expect("Failed to set camera size"); + camera + .set_output_format(OutputFormat::Rgb565) + .expect("Failed to set camera output format"); + camera + .set_noise_filter(true) + .expect("Failed to enable noise filter"); + camera + .set_auto_exposure(true) + .expect("Failed to enable auto exposure"); + camera + .set_white_balance(WhiteBalance::Auto) + .expect("Failed to enable auto white balance"); + // This line has no effect on the camera since the photos are already shot with `TopLCD` size. + camera + .set_trimming(Trimming::Centered(ViewSize::TopLCD)) + .expect("Failed to enable trimming"); + } // We don't intend on making any other modifications to the camera, so this size should be enough. - let len = camera.max_byte_count(); + let len = camera.final_byte_length(); let mut buf = vec![0u8; len]; println!("\nPress R to take a new picture"); @@ -78,7 +80,7 @@ fn main() { .take_picture(&mut buf, WAIT_TIMEOUT) .expect("Failed to take picture"); - let image_size = camera.final_image_size(); + let image_size = camera.final_view_size(); // Play the normal shutter sound. cam.play_shutter_sound(ShutterSound::Normal) diff --git a/ctru-rs/src/services/cam.rs b/ctru-rs/src/services/cam.rs index f521d16..614de33 100644 --- a/ctru-rs/src/services/cam.rs +++ b/ctru-rs/src/services/cam.rs @@ -8,6 +8,7 @@ use crate::error::{Error, ResultCode}; use crate::services::gspgpu::FramebufferFormat; use crate::services::ServiceReference; use ctru_sys::Handle; +use private::Configuration; use std::sync::Mutex; use std::time::Duration; @@ -250,38 +251,19 @@ pub struct ImageQualityCalibrationData(pub ctru_sys::CAMU_ImageQualityCalibratio #[derive(Default, Clone, Copy, Debug)] pub struct StereoCameraCalibrationData(pub ctru_sys::CAMU_StereoCameraCalibrationData); -/// Basic configuration needed to properly use the built-in cameras. -#[derive(Clone, Copy, Debug, PartialEq, Eq)] -struct Configuration { - view_size: ViewSize, - trimming: Trimming, -} - -impl Configuration { - fn new() -> Self { - Self { - view_size: ViewSize::TopLCD, - trimming: Trimming::Off, - } - } -} - /// Inward camera representation (facing the user of the 3DS). /// /// Usually used for selfies. -#[non_exhaustive] pub struct InwardCam { configuration: Configuration, } /// Right-side outward camera representation. -#[non_exhaustive] pub struct OutwardRightCam { configuration: Configuration, } /// Left-side outward camera representation. -#[non_exhaustive] pub struct OutwardLeftCam { configuration: Configuration, } @@ -289,113 +271,107 @@ pub struct OutwardLeftCam { /// Both outer cameras combined. /// /// Usually used for 3D photos. -#[non_exhaustive] pub struct BothOutwardCam { configuration: Configuration, } -impl BothOutwardCam { - /// Set whether to enable or disable brightness synchronization between the two cameras. - #[doc(alias = "CAMU_SetBrightnessSynchronization")] - pub fn set_brightness_synchronization( - &mut self, - brightness_synchronization: bool, - ) -> crate::Result<()> { - unsafe { - ResultCode(ctru_sys::CAMU_SetBrightnessSynchronization( - brightness_synchronization, - ))?; - Ok(()) - } +mod private { + use super::{BothOutwardCam, InwardCam, OutwardLeftCam, OutwardRightCam, Trimming, ViewSize}; + + /// Basic configuration needed to properly use the built-in cameras. + #[derive(Clone, Copy, Debug, PartialEq, Eq)] + pub struct Configuration { + pub view_size: ViewSize, + pub trimming: Trimming, } -} -macro_rules! trimming_checks { - ($trimming:ident, $view_size:expr) => { - match $trimming { - Trimming::Centered(trim_size) => { - let view_size: (i16, i16) = $view_size; - let trim_size: (i16, i16) = trim_size.into(); + impl Configuration { + pub fn new() -> Self { + Self::default() + } + } - // Trim sizes are within the view. - assert!(trim_size.0 <= view_size.0 && trim_size.1 <= view_size.1); + impl Default for Configuration { + fn default() -> Self { + Self { + view_size: ViewSize::TopLCD, + trimming: Trimming::Off, } - Trimming::Off => (), } - }; -} - -impl Camera for InwardCam { - fn camera_as_raw(&self) -> ctru_sys::u32_ { - ctru_sys::SELECT_IN1 } - fn view_size(&self) -> ViewSize { - self.configuration.view_size + pub trait ConfigurableCamera { + fn configuration(&self) -> &Configuration; + + fn configuration_mut(&mut self) -> &mut Configuration; } - fn set_view_size(&mut self, size: ViewSize) -> crate::Result<()> { - unsafe { - ResultCode(ctru_sys::CAMU_SetSize( - self.camera_as_raw(), - size.into(), - ctru_sys::CONTEXT_A, - ))?; + impl ConfigurableCamera for InwardCam { + fn configuration(&self) -> &Configuration { + &self.configuration } - self.configuration.view_size = size; - - self.set_trimming(Trimming::Off); - - Ok(()) + fn configuration_mut(&mut self) -> &mut Configuration { + &mut self.configuration + } } - fn trimming(&self) -> Trimming { - self.configuration.trimming + impl ConfigurableCamera for OutwardRightCam { + fn configuration(&self) -> &Configuration { + &self.configuration + } + + fn configuration_mut(&mut self) -> &mut Configuration { + &mut self.configuration + } } - fn set_trimming(&mut self, trimming: Trimming) { - // Run checks for all trimming possibilities. - trimming_checks!(trimming, self.view_size().into()); + impl ConfigurableCamera for OutwardLeftCam { + fn configuration(&self) -> &Configuration { + &self.configuration + } - self.configuration.trimming = trimming; + fn configuration_mut(&mut self) -> &mut Configuration { + &mut self.configuration + } } -} -impl Camera for OutwardRightCam { - fn camera_as_raw(&self) -> ctru_sys::u32_ { - ctru_sys::SELECT_OUT1 - } + impl ConfigurableCamera for BothOutwardCam { + fn configuration(&self) -> &Configuration { + &self.configuration + } - fn view_size(&self) -> ViewSize { - self.configuration.view_size + fn configuration_mut(&mut self) -> &mut Configuration { + &mut self.configuration + } } +} - fn set_view_size(&mut self, size: ViewSize) -> crate::Result<()> { +impl BothOutwardCam { + /// Set whether to enable or disable brightness synchronization between the two cameras. + #[doc(alias = "CAMU_SetBrightnessSynchronization")] + pub fn set_brightness_synchronization( + &mut self, + brightness_synchronization: bool, + ) -> crate::Result<()> { unsafe { - ResultCode(ctru_sys::CAMU_SetSize( - self.camera_as_raw(), - size.into(), - ctru_sys::CONTEXT_A, + ResultCode(ctru_sys::CAMU_SetBrightnessSynchronization( + brightness_synchronization, ))?; + Ok(()) } - - self.configuration.view_size = size; - - self.set_trimming(Trimming::Off); - - Ok(()) } +} - fn trimming(&self) -> Trimming { - self.configuration.trimming +impl Camera for InwardCam { + fn camera_as_raw(&self) -> ctru_sys::u32_ { + ctru_sys::SELECT_IN1 } +} - fn set_trimming(&mut self, trimming: Trimming) { - // Run checks for all trimming possibilities. - trimming_checks!(trimming, self.view_size().into()); - - self.configuration.trimming = trimming; +impl Camera for OutwardRightCam { + fn camera_as_raw(&self) -> ctru_sys::u32_ { + ctru_sys::SELECT_OUT1 } } @@ -403,37 +379,6 @@ impl Camera for OutwardLeftCam { fn camera_as_raw(&self) -> ctru_sys::u32_ { ctru_sys::SELECT_OUT2 } - - fn view_size(&self) -> ViewSize { - self.configuration.view_size - } - - fn set_view_size(&mut self, size: ViewSize) -> crate::Result<()> { - unsafe { - ResultCode(ctru_sys::CAMU_SetSize( - self.camera_as_raw(), - size.into(), - ctru_sys::CONTEXT_A, - ))?; - } - - self.configuration.view_size = size; - - self.set_trimming(Trimming::Off); - - Ok(()) - } - - fn trimming(&self) -> Trimming { - self.configuration.trimming - } - - fn set_trimming(&mut self, trimming: Trimming) { - // Run checks for all trimming possibilities. - trimming_checks!(trimming, self.view_size().into()); - - self.configuration.trimming = trimming; - } } impl Camera for BothOutwardCam { @@ -444,41 +389,10 @@ impl Camera for BothOutwardCam { fn port_as_raw(&self) -> ctru_sys::u32_ { ctru_sys::PORT_BOTH } - - fn view_size(&self) -> ViewSize { - self.configuration.view_size - } - - fn set_view_size(&mut self, size: ViewSize) -> crate::Result<()> { - unsafe { - ResultCode(ctru_sys::CAMU_SetSize( - self.camera_as_raw(), - size.into(), - ctru_sys::CONTEXT_A, - ))?; - } - - self.configuration.view_size = size; - - self.set_trimming(Trimming::Off); - - Ok(()) - } - - fn trimming(&self) -> Trimming { - self.configuration.trimming - } - - fn set_trimming(&mut self, trimming: Trimming) { - // Run checks for all trimming possibilities. - trimming_checks!(trimming, self.view_size().into()); - - self.configuration.trimming = trimming; - } } /// Generic functionality common to all cameras. -pub trait Camera { +pub trait Camera: private::ConfigurableCamera { /// Returns the raw value of the selected camera. fn camera_as_raw(&self) -> ctru_sys::u32_; @@ -489,7 +403,9 @@ pub trait Camera { /// This view is the full resolution at which the camera will take the photo. /// If you are interested in the final image's size, calculated while taking into account all processing and modifications, /// have a look at [`Camera::final_view_size()`]. - fn view_size(&self) -> ViewSize; + fn view_size(&self) -> ViewSize { + self.configuration().view_size + } /// Returns the raw port of the selected camera. fn port_as_raw(&self) -> ctru_sys::u32_ { @@ -595,11 +511,50 @@ pub trait Camera { } /// Returns the [`Trimming`] configuration currently set. - fn trimming(&self) -> Trimming; + fn trimming(&self) -> Trimming { + self.configuration().trimming + } /// Set trimming bounds to trim the camera photo. + /// + /// # Notes + /// + /// Trimming the image view directly on the cameras can only work if the final image has the size of one of the supported image formats. + /// As such, even after trimming the image (which will result in a "zoomed in" view of the original image) + /// the resulting picture must still be of [`ViewSize`] dimensions. #[doc(alias = "CAMU_SetTrimming")] - fn set_trimming(&mut self, trimming: Trimming); + fn set_trimming(&mut self, trimming: Trimming) -> crate::Result<()> { + // Run checks for all trimming possibilities. + match trimming { + Trimming::Centered(trim_size) => unsafe { + let view_size: (i16, i16) = self.view_size().into(); + let trim_size: (i16, i16) = trim_size.into(); + + // Trim sizes are within the view. + assert!( + trim_size.0 <= view_size.0 && trim_size.1 <= view_size.1, + "trimmed view is bigger than the camera view" + ); + + ResultCode(ctru_sys::CAMU_SetTrimming(self.port_as_raw(), true))?; + + ResultCode(ctru_sys::CAMU_SetTrimmingParamsCenter( + self.port_as_raw(), + trim_size.0, + trim_size.1, + view_size.0, + view_size.1, + ))?; + }, + Trimming::Off => unsafe { + ResultCode(ctru_sys::CAMU_SetTrimming(self.port_as_raw(), false))?; + }, + } + + self.configuration_mut().trimming = trimming; + + Ok(()) + } /// Returns whether or not trimming is currently enabled for the camera. #[doc(alias = "CAMU_IsTrimming")] @@ -681,7 +636,21 @@ pub trait Camera { /// /// Calling this function will reset the trimming configuration. #[doc(alias = "CAMU_SetSize")] - fn set_view_size(&mut self, size: ViewSize) -> crate::Result<()>; + fn set_view_size(&mut self, size: ViewSize) -> crate::Result<()> { + unsafe { + ResultCode(ctru_sys::CAMU_SetSize( + self.camera_as_raw(), + size.into(), + ctru_sys::CONTEXT_A, + ))?; + } + + self.configuration_mut().view_size = size; + + self.set_trimming(Trimming::Off)?; + + Ok(()) + } /// Set the frame rate of the camera. #[doc(alias = "CAMU_SetFrameRate")] @@ -711,8 +680,7 @@ pub trait Camera { /// /// # Notes /// - /// This operation will override any previously set [`Effect`]s. - /// Multiple effects can be set at once by combining the bitflags of [`Effect`]. + /// This operation will override any previously set [`Effect`]. #[doc(alias = "CAMU_SetEffect")] fn set_effect(&mut self, effect: Effect) -> crate::Result<()> { unsafe { @@ -857,14 +825,7 @@ pub trait Camera { /// /// # Errors /// - /// This function will return an error if the camera is busy or if the timeout duration gets reached. - /// - /// # Arguments - /// - /// * `width` - Width of the desired image - /// * `height` - Height of the desired image - /// * `timeout` - Duration to wait for the image - /// + /// This function will return an error if the camera is already busy or if the timeout duration is reached. /// # Example /// /// ```no_run @@ -894,27 +855,16 @@ pub trait Camera { /// # } /// ``` fn take_picture(&mut self, buffer: &mut [u8], timeout: Duration) -> crate::Result<()> { - // Obtain the final view size and make the needed modifications to the camera. - match self.trimming() { - Trimming::Centered(trim_size) => unsafe { - ResultCode(ctru_sys::CAMU_SetTrimming(self.port_as_raw(), true))?; - - let full_view: (i16, i16) = self.view_size().into(); - let trim_size: (i16, i16) = trim_size.into(); - - ResultCode(ctru_sys::CAMU_SetTrimmingParamsCenter( - self.port_as_raw(), - trim_size.0, - trim_size.1, - full_view.0, - full_view.1, - ))?; - }, - Trimming::Off => unsafe { - ResultCode(ctru_sys::CAMU_SetTrimming(self.port_as_raw(), false))?; - }, - }; + // Check whether the provided buffer is big enough to store the image. + let max_size = self.final_byte_length(); + if buffer.len() < max_size { + return Err(Error::BufferTooShort { + provided: buffer.len(), + wanted: max_size, + }); + } + let final_view = self.final_view_size(); // The transfer unit is NOT the "max number of bytes" or whatever the docs make you think it is... @@ -939,21 +889,6 @@ pub trait Camera { ))?; }; - // Check whether the input buffer is big enough for the image. - let max_size = self.final_byte_length(); - if buffer.len() < max_size { - // We deactivate the camera prematurely. - // - // Note that it shouldn't be too important whether the camera closes or not here, - // since it only starts capturing later. - unsafe { ResultCode(ctru_sys::CAMU_Activate(ctru_sys::SELECT_NONE))? }; - - return Err(Error::BufferTooShort { - provided: buffer.len(), - wanted: max_size, - }); - } - unsafe { ResultCode(ctru_sys::CAMU_Activate(self.camera_as_raw()))?; ResultCode(ctru_sys::CAMU_ClearBuffer(self.port_as_raw()))?; @@ -979,14 +914,14 @@ pub trait Camera { }; unsafe { - // Panicking without closing an SVC handle causes an ARM exception, we have to handle it carefully (TODO: SVC module) + // Panicking without closing an SVC handle causes an ARM exception, we have to handle it carefully. let wait_result = ResultCode(ctru_sys::svcWaitSynchronization( receive_event, timeout.as_nanos().try_into().unwrap(), )); // We close everything first, then we check for possible errors - let _ = ctru_sys::svcCloseHandle(receive_event); // We wouldn't return the error even if there was one, so no use of ResultCode is needed + let _ = ctru_sys::svcCloseHandle(receive_event); // We wouldn't return the error even if there was one, so no use of ResultCode is needed. // Camera state cleanup ResultCode(ctru_sys::CAMU_StopCapture(self.port_as_raw()))?; From c2827aa2691ce4c9dfe5ae7cb98d38ba97bb934b Mon Sep 17 00:00:00 2001 From: Ian Chamberlain Date: Sat, 30 Sep 2023 23:54:08 -0400 Subject: [PATCH 082/101] Add `os` module for querying OS and hardware state Most of these are dead simple and don't require any service initialization etc., so all we need is a simple wrapper. I didn't implement everything in <3ds/os.h> yet, but got most of the basic ones which seemed like likely use cases to me. --- ctru-rs/src/error.rs | 4 +- ctru-rs/src/lib.rs | 1 + ctru-rs/src/os.rs | 135 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 139 insertions(+), 1 deletion(-) create mode 100644 ctru-rs/src/os.rs diff --git a/ctru-rs/src/error.rs b/ctru-rs/src/error.rs index 41b09f8..62a4646 100644 --- a/ctru-rs/src/error.rs +++ b/ctru-rs/src/error.rs @@ -27,7 +27,7 @@ pub type Result = ::std::result::Result; /// pub fn hid_init() -> Result<()> { /// // We run an unsafe function which returns a `ctru_sys::Result`. /// let result: ctru_sys::Result = unsafe { ctru_sys::hidInit() }; -/// +/// /// // The result code is parsed and any possible error gets returned by the function. /// ResultCode(result)?; /// Ok(()) @@ -152,6 +152,8 @@ impl fmt::Debug for Error { impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { + // TODO: should we consider using ctru_sys::osStrError here as well? + // It might do some of the work for us or provide additional details &Self::Os(err) => write!( f, "libctru result code 0x{err:08X}: [{} {}] {}: {}", diff --git a/ctru-rs/src/lib.rs b/ctru-rs/src/lib.rs index ecc7dd9..baa9936 100644 --- a/ctru-rs/src/lib.rs +++ b/ctru-rs/src/lib.rs @@ -107,6 +107,7 @@ pub mod console; pub mod error; pub mod linear; pub mod mii; +pub mod os; pub mod prelude; pub mod services; diff --git a/ctru-rs/src/os.rs b/ctru-rs/src/os.rs new file mode 100644 index 0000000..58a4e87 --- /dev/null +++ b/ctru-rs/src/os.rs @@ -0,0 +1,135 @@ +//! Utilities to get information about the operating system and hardware state. + +/// System version information. +#[derive(Clone, Copy)] +pub struct Version(u32); + +impl Version { + /// Pack a system version from its components + pub fn new(major: u8, minor: u8, revision: u8) -> Self { + let major = u32::from(major); + let minor = u32::from(minor); + let revision = u32::from(revision); + + Self(major << 24 | minor << 16 | revision << 8) + } + + /// Get the major version from a packed system version. + pub fn major(&self) -> u8 { + (self.0 >> 24).try_into().unwrap() + } + + /// Get the minor version from a packed system version. + pub fn minor(&self) -> u8 { + (self.0 >> 16 & 0xFF).try_into().unwrap() + } + + /// Get the revision from a packed system version. + pub fn revision(&self) -> u8 { + (self.0 >> 8 & 0xFF).try_into().unwrap() + } +} + +/// Get the system's FIRM version. +pub fn firm_version() -> Version { + Version(unsafe { ctru_sys::osGetFirmVersion() }) +} + +/// Get the system's kernel version. +pub fn kernel_version() -> Version { + Version(unsafe { ctru_sys::osGetKernelVersion() }) +} + +// TODO: I can't seem to find good documentation on it, but we could probably +// define enums for firmware type (NATIVE_FIRM, SAFE_FIRM etc.) as well as +// application memory layout. Leaving those as future enhancements for now + +/// A region of memory. Most applications will only use [`Application`](MemRegion::Application) +/// memory, but the other types can be used to query memory usage information. +/// See +/// for more details on the different types of memory. +/// +/// # Example +/// ``` +/// # let _runner = test_runner::GdbRunner::default(); +/// let all_memory = ctru::os::MemRegion::All; +/// +/// assert!(all_memory.size() > 0); +/// assert!(all_memory.used() > 0); +/// assert!(all_memory.free() > 0); +/// ``` +#[derive(Clone, Copy, Debug)] +#[non_exhaustive] +#[repr(u32)] +pub enum MemRegion { + /// All memory regions. + All = ctru_sys::MEMREGION_ALL, + /// APPLICATION memory. + Application = ctru_sys::MEMREGION_APPLICATION, + /// SYSTEM memory. + System = ctru_sys::MEMREGION_SYSTEM, + /// BASE memory. + Base = ctru_sys::MEMREGION_BASE, +} + +impl MemRegion { + /// Get the total size of this memory region, in bytes. + pub fn size(&self) -> usize { + unsafe { ctru_sys::osGetMemRegionSize(*self as u32) } + .try_into() + .unwrap() + } + + /// Get the number of bytes used within this memory region. + pub fn used(&self) -> usize { + unsafe { ctru_sys::osGetMemRegionUsed(*self as u32) } + .try_into() + .unwrap() + } + + /// Get the number of bytes free within this memory region. + pub fn free(&self) -> usize { + unsafe { ctru_sys::osGetMemRegionFree(*self as u32) } + .try_into() + .unwrap() + } +} + +/// WiFi signal strength. This enum's [`u8`] representation corresponds with +/// the number of bars displayed in the Home menu. +#[non_exhaustive] +#[repr(u8)] +pub enum WifiStrength { + /// This may indicate a very poor signal quality even worse than `Bad`, + /// or it may indicate that no network is connected at all. + Disconnected = 0, + /// Poor signal strength. + Bad = 1, + /// Medium signal strength. + Decent = 2, + /// Good signal strength. + Good = 3, +} + +impl WifiStrength { + /// Get the current WiFi signal strength. + pub fn current() -> Self { + match unsafe { ctru_sys::osGetWifiStrength() } { + 0 => Self::Disconnected, + 1 => Self::Bad, + 2 => Self::Decent, + 3 => Self::Good, + other => panic!("Got unexpected WiFi strength value {other}"), + } + } +} + +/// Get the current value of the stereoscopic 3D slider on a scale from 0.0­–­1.0. +pub fn current_3d_slider_state() -> f32 { + unsafe { ctru_sys::osGet3DSliderState() } +} + +/// Whether or not a headset is currently plugged into the device. +pub fn is_headset_connected() -> bool { + unsafe { ctru_sys::osIsHeadsetConnected() } +} From 6aa50357c8b6bfbd435a7c745fc1d1d9dcb67443 Mon Sep 17 00:00:00 2001 From: Ian Chamberlain Date: Sun, 1 Oct 2023 00:07:49 -0400 Subject: [PATCH 083/101] Add some simple doctests for some new functions --- ctru-rs/src/os.rs | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/ctru-rs/src/os.rs b/ctru-rs/src/os.rs index 58a4e87..8be1de1 100644 --- a/ctru-rs/src/os.rs +++ b/ctru-rs/src/os.rs @@ -1,6 +1,16 @@ //! Utilities to get information about the operating system and hardware state. -/// System version information. +/// System version information. This struct is used for both kernel and firmware versions. +/// +/// # Example +/// ``` +/// # let _runner = test_runner::GdbRunner::default(); +/// let firm_version = ctru::os::firm_version(); +/// assert_ne!(firm_version.major(), 0); +/// +/// let kernel_version = ctru::os::kernel_version(); +/// assert_ne!(kernel_version.major(), 0); +/// ``` #[derive(Clone, Copy)] pub struct Version(u32); @@ -95,13 +105,22 @@ impl MemRegion { } } -/// WiFi signal strength. This enum's [`u8`] representation corresponds with +/// WiFi signal strength. This enum's `u8` representation corresponds with /// the number of bars displayed in the Home menu. +/// +/// # Example +/// +/// ``` +/// # let _runner = test_runner::GdbRunner::default(); +/// let strength = ctru::os::WifiStrength::current(); +/// assert!((strength as u8) < 4); +/// ``` +#[derive(Clone, Copy, Debug)] #[non_exhaustive] #[repr(u8)] pub enum WifiStrength { /// This may indicate a very poor signal quality even worse than `Bad`, - /// or it may indicate that no network is connected at all. + /// or that no network is connected at all. Disconnected = 0, /// Poor signal strength. Bad = 1, From 421a09bc37ab8a2311498be1b6a898b15a4697f7 Mon Sep 17 00:00:00 2001 From: Ian Chamberlain Date: Sun, 8 Oct 2023 17:33:18 -0400 Subject: [PATCH 084/101] Remove references to test_runner temporarily --- ctru-rs/src/os.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ctru-rs/src/os.rs b/ctru-rs/src/os.rs index 8be1de1..8eea697 100644 --- a/ctru-rs/src/os.rs +++ b/ctru-rs/src/os.rs @@ -4,7 +4,7 @@ /// /// # Example /// ``` -/// # let _runner = test_runner::GdbRunner::default(); +/// # // let _runner = test_runner::GdbRunner::default(); /// let firm_version = ctru::os::firm_version(); /// assert_ne!(firm_version.major(), 0); /// @@ -61,7 +61,7 @@ pub fn kernel_version() -> Version { /// /// # Example /// ``` -/// # let _runner = test_runner::GdbRunner::default(); +/// # // let _runner = test_runner::GdbRunner::default(); /// let all_memory = ctru::os::MemRegion::All; /// /// assert!(all_memory.size() > 0); @@ -111,7 +111,7 @@ impl MemRegion { /// # Example /// /// ``` -/// # let _runner = test_runner::GdbRunner::default(); +/// # // let _runner = test_runner::GdbRunner::default(); /// let strength = ctru::os::WifiStrength::current(); /// assert!((strength as u8) < 4); /// ``` From 0ec4c92fbc35b1159c428a5e0dcfdf2b368a5bd9 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sun, 15 Oct 2023 13:43:19 +0200 Subject: [PATCH 085/101] 3D images without stereo calibration --- ctru-rs/examples/camera-image.rs | 45 +++++--- ctru-rs/src/services/cam.rs | 174 +++++++++++++++++++++++++++++-- 2 files changed, 193 insertions(+), 26 deletions(-) diff --git a/ctru-rs/examples/camera-image.rs b/ctru-rs/examples/camera-image.rs index 7ee9b56..ff2339f 100644 --- a/ctru-rs/examples/camera-image.rs +++ b/ctru-rs/examples/camera-image.rs @@ -6,7 +6,7 @@ use ctru::prelude::*; use ctru::services::cam::{ Cam, Camera, OutputFormat, ShutterSound, Trimming, ViewSize, WhiteBalance, }; -use ctru::services::gfx::{Flush, Screen, Swap}; +use ctru::services::gfx::{Flush, Screen, Swap, TopScreen3D}; use ctru::services::gspgpu::FramebufferFormat; use std::time::Duration; @@ -20,9 +20,12 @@ fn main() { let mut hid = Hid::new().expect("Failed to initialize Hid service."); let gfx = Gfx::new().expect("Failed to initialize GFX service."); - let mut top_screen = gfx.top_screen.borrow_mut(); - top_screen.set_double_buffering(true); - top_screen.set_framebuffer_format(FramebufferFormat::Rgb565); + gfx.top_screen.borrow_mut().set_double_buffering(true); + gfx.top_screen + .borrow_mut() + .set_framebuffer_format(FramebufferFormat::Rgb565); + + let mut top_screen_3d = TopScreen3D::from(&gfx.top_screen); let _console = Console::new(gfx.bottom_screen.borrow_mut()); @@ -31,7 +34,7 @@ fn main() { let mut cam = Cam::new().expect("Failed to initialize CAM service."); // Camera setup. - let camera = &mut cam.outer_right_cam; + let camera = &mut cam.both_outer_cams; { camera .set_view_size(ViewSize::TopLCD) @@ -73,7 +76,7 @@ fn main() { if keys_down.contains(KeyPad::R) { println!("Capturing new image"); - let camera = &mut cam.outer_right_cam; + let mut camera = &mut cam.both_outer_cams; // Take a picture and write it to the buffer. camera @@ -86,17 +89,29 @@ fn main() { cam.play_shutter_sound(ShutterSound::Normal) .expect("Failed to play shutter sound"); - // Rotate the image and correctly display it on the screen. - rotate_image_to_screen( - &buf, - top_screen.raw_framebuffer().ptr, - image_size.0 as usize, - image_size.1 as usize, - ); + { + let (mut left_side, mut right_side) = top_screen_3d.split_mut(); + + // Rotate the left image and correctly display it on the screen. + rotate_image_to_screen( + &buf, + left_side.raw_framebuffer().ptr, + image_size.0 as usize, + image_size.1 as usize, + ); + + // Rotate the right image and correctly display it on the screen. + rotate_image_to_screen( + &buf[len / 2..], + right_side.raw_framebuffer().ptr, + image_size.0 as usize, + image_size.1 as usize, + ); + } // We will only flush and swap the "camera" screen, since the other screen is handled by the `Console`. - top_screen.flush_buffers(); - top_screen.swap_buffers(); + top_screen_3d.flush_buffers(); + top_screen_3d.swap_buffers(); gfx.wait_for_vblank(); } diff --git a/ctru-rs/src/services/cam.rs b/ctru-rs/src/services/cam.rs index 614de33..991db74 100644 --- a/ctru-rs/src/services/cam.rs +++ b/ctru-rs/src/services/cam.rs @@ -241,15 +241,16 @@ pub enum Trimming { } /// Data used by the camera to calibrate image quality for a single camera. +// TODO: Implement Image quality calibration. #[doc(alias = "CAMU_ImageQualityCalibrationData")] #[derive(Default, Clone, Copy, Debug)] -pub struct ImageQualityCalibrationData(pub ctru_sys::CAMU_ImageQualityCalibrationData); +pub struct ImageQualityCalibration(pub ctru_sys::CAMU_ImageQualityCalibrationData); /// Data used by the camera to calibrate image quality when using both outward cameras. // TODO: Implement Stereo camera calibration. #[doc(alias = "CAMU_StereoCameraCalibrationData")] #[derive(Default, Clone, Copy, Debug)] -pub struct StereoCameraCalibrationData(pub ctru_sys::CAMU_StereoCameraCalibrationData); +pub struct StereoCameraCalibration(ctru_sys::CAMU_StereoCameraCalibrationData); /// Inward camera representation (facing the user of the 3DS). /// @@ -358,8 +359,44 @@ impl BothOutwardCam { ResultCode(ctru_sys::CAMU_SetBrightnessSynchronization( brightness_synchronization, ))?; - Ok(()) } + + Ok(()) + } + + #[doc(alias = "CAMU_GetStereoCameraCalibrationData")] + /// Returns the currently set [`StereoCameraCalibration`]. + pub fn stereo_calibration(&self) -> crate::Result { + let mut calibration = StereoCameraCalibration::default(); + + unsafe { + ResultCode(ctru_sys::CAMU_GetStereoCameraCalibrationData( + &mut calibration.0, + ))?; + } + + Ok(calibration) + } + + #[doc(alias = "CAMU_SetStereoCameraCalibrationData")] + /// Set the [`StereoCameraCalibration`]. + // TODO: This seems to have no effect. + pub fn set_stereo_calibration( + &mut self, + mut stereo_calibration: StereoCameraCalibration, + ) -> crate::Result<()> { + let view_size = self.final_view_size(); + + stereo_calibration.0.imageWidth = view_size.0; + stereo_calibration.0.imageHeight = view_size.1; + + unsafe { + ResultCode(ctru_sys::CAMU_SetStereoCameraCalibrationData( + stereo_calibration.0, + ))?; + } + + Ok(()) } } @@ -389,6 +426,114 @@ impl Camera for BothOutwardCam { fn port_as_raw(&self) -> ctru_sys::u32_ { ctru_sys::PORT_BOTH } + + fn take_picture(&mut self, buffer: &mut [u8], timeout: Duration) -> crate::Result<()> { + // Check whether the provided buffer is big enough to store the image. + let max_size = self.final_byte_length(); + if buffer.len() < max_size { + return Err(Error::BufferTooShort { + provided: buffer.len(), + wanted: max_size, + }); + } + + let final_view = self.final_view_size(); + + // The transfer unit is NOT the "max number of bytes" or whatever the docs make you think it is... + let transfer_unit = unsafe { + let mut transfer_unit = 0; + + ResultCode(ctru_sys::CAMU_GetMaxBytes( + &mut transfer_unit, + final_view.0, + final_view.1, + ))?; + + transfer_unit + }; + + unsafe { + ResultCode(ctru_sys::CAMU_SetTransferBytes( + self.port_as_raw(), + transfer_unit, + final_view.0, + final_view.1, + ))?; + }; + + unsafe { + ResultCode(ctru_sys::CAMU_Activate(self.camera_as_raw()))?; + ResultCode(ctru_sys::CAMU_ClearBuffer(self.port_as_raw()))?; + }; + + // Synchronize the two cameras. + unsafe { + ResultCode(ctru_sys::CAMU_SynchronizeVsyncTiming( + ctru_sys::SELECT_OUT1, + ctru_sys::SELECT_OUT2, + ))?; + } + + // Start capturing with the camera. + unsafe { + ResultCode(ctru_sys::CAMU_StartCapture(self.port_as_raw()))?; + }; + + let receive_event_1 = unsafe { + let mut completion_handle: Handle = 0; + + ResultCode(ctru_sys::CAMU_SetReceiving( + &mut completion_handle, + buffer.as_mut_ptr().cast(), + ctru_sys::PORT_CAM1, + (max_size / 2) as u32, + transfer_unit.try_into().unwrap(), + ))?; + + completion_handle + }; + + let receive_event_2 = unsafe { + let mut completion_handle: Handle = 0; + + ResultCode(ctru_sys::CAMU_SetReceiving( + &mut completion_handle, + buffer[max_size / 2..].as_mut_ptr().cast(), + ctru_sys::PORT_CAM2, + (max_size / 2) as u32, + transfer_unit.try_into().unwrap(), + ))?; + + completion_handle + }; + + unsafe { + // Panicking without closing an SVC handle causes an ARM exception, we have to handle it carefully. + let wait_result_1 = ResultCode(ctru_sys::svcWaitSynchronization( + receive_event_1, + timeout.as_nanos().try_into().unwrap(), + )); + + let wait_result_2 = ResultCode(ctru_sys::svcWaitSynchronization( + receive_event_2, + timeout.as_nanos().try_into().unwrap(), + )); + + // We close everything first, then we check for possible errors + let _ = ctru_sys::svcCloseHandle(receive_event_1); // We wouldn't return the error even if there was one, so no use of ResultCode is needed. + let _ = ctru_sys::svcCloseHandle(receive_event_2); + + // Camera state cleanup + ResultCode(ctru_sys::CAMU_StopCapture(self.port_as_raw()))?; + ResultCode(ctru_sys::CAMU_ClearBuffer(self.port_as_raw()))?; + ResultCode(ctru_sys::CAMU_Activate(ctru_sys::SELECT_NONE))?; + + wait_result_1?; + wait_result_2?; + }; + + Ok(()) + } } /// Generic functionality common to all cameras. @@ -445,6 +590,7 @@ pub trait Camera: private::ConfigurableCamera { /// /// # Notes /// + /// The value returned will be double the image size if requested by [`BothOutwardCam`]. /// Remember to query this information again if *any* changes are applied to the [`Camera`] configuration! /// /// # Example @@ -799,11 +945,11 @@ pub trait Camera: private::ConfigurableCamera { } } - /// Set the [`ImageQualityCalibrationData`] for the camera. + /// Set the [`ImageQualityCalibration`] for the camera. #[doc(alias = "CAMU_SetImageQualityCalibrationData")] - fn set_image_quality_calibration_data( + fn set_image_quality_calibration( &mut self, - data: ImageQualityCalibrationData, + data: ImageQualityCalibration, ) -> crate::Result<()> { unsafe { ResultCode(ctru_sys::CAMU_SetImageQualityCalibrationData(data.0))?; @@ -811,11 +957,11 @@ pub trait Camera: private::ConfigurableCamera { } } - /// Returns the current [`ImageQualityCalibrationData`] for the camera. + /// Returns the current [`ImageQualityCalibration`] for the camera. #[doc(alias = "CAMU_GetImageQualityCalibrationData")] - fn image_quality_calibration_data(&self) -> crate::Result { + fn image_quality_calibration(&self) -> crate::Result { unsafe { - let mut data = ImageQualityCalibrationData::default(); + let mut data = ImageQualityCalibration::default(); ResultCode(ctru_sys::CAMU_GetImageQualityCalibrationData(&mut data.0))?; Ok(data) } @@ -826,6 +972,13 @@ pub trait Camera: private::ConfigurableCamera { /// # Errors /// /// This function will return an error if the camera is already busy or if the timeout duration is reached. + /// + /// # Notes + /// + /// If the picture is taken using [`BothOutwardCam`], the buffer will have to be able to hold both images + /// (from each camera), which will be written into it sequentially. + /// Use [`Camera::final_byte_length()`] to know how big the buffer needs to be to hold your next image. + /// /// # Example /// /// ```no_run @@ -858,13 +1011,12 @@ pub trait Camera: private::ConfigurableCamera { // Check whether the provided buffer is big enough to store the image. let max_size = self.final_byte_length(); if buffer.len() < max_size { - return Err(Error::BufferTooShort { provided: buffer.len(), wanted: max_size, }); } - + let final_view = self.final_view_size(); // The transfer unit is NOT the "max number of bytes" or whatever the docs make you think it is... From fdd836ba9d5d437717bc0f151a5e5c1412928ff0 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sun, 15 Oct 2023 14:00:09 +0200 Subject: [PATCH 086/101] Fix lints --- ctru-rs/examples/buttons.rs | 2 +- ctru-rs/examples/camera-image.rs | 2 +- ctru-rs/examples/movement.rs | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ctru-rs/examples/buttons.rs b/ctru-rs/examples/buttons.rs index e7662a1..90862bf 100644 --- a/ctru-rs/examples/buttons.rs +++ b/ctru-rs/examples/buttons.rs @@ -28,7 +28,7 @@ fn main() { // Print the status of the volume slider. println!( "\x1b[20;0HVolume slider: {} ", - hid.slider_volume() + hid.volume_slider() ); // We only want to print when the keys we're holding now are different diff --git a/ctru-rs/examples/camera-image.rs b/ctru-rs/examples/camera-image.rs index ff2339f..ecf9f65 100644 --- a/ctru-rs/examples/camera-image.rs +++ b/ctru-rs/examples/camera-image.rs @@ -76,7 +76,7 @@ fn main() { if keys_down.contains(KeyPad::R) { println!("Capturing new image"); - let mut camera = &mut cam.both_outer_cams; + let camera = &mut cam.both_outer_cams; // Take a picture and write it to the buffer. camera diff --git a/ctru-rs/examples/movement.rs b/ctru-rs/examples/movement.rs index b293c71..a0aa2c8 100644 --- a/ctru-rs/examples/movement.rs +++ b/ctru-rs/examples/movement.rs @@ -19,8 +19,8 @@ fn main() { // Activate the accelerometer and the gyroscope. // Because of the complex nature of the movement sensors, they aren't activated by default with the `Hid` service. // However, they can simply be turned on and off whenever necessary. - hid.enable_accelerometer(); - hid.enable_gyroscope(); + hid.set_accelerometer(true); + hid.set_gyroscope(true); while apt.main_loop() { // Scan all the controller inputs. @@ -35,10 +35,12 @@ fn main() { println!( "\x1b[3;0HAcceleration: {:?} ", hid.accelerometer_vector() + .expect("could not retrieve acceleration vector") ); println!( "\x1b[4;0HGyroscope angular rate: {:?} ", hid.gyroscope_rate() + .expect("could not retrieve angular rate") ); gfx.wait_for_vblank(); From 6afad4dceb9b9badcb6fc5de588c842d1170aa14 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sun, 15 Oct 2023 14:08:27 +0200 Subject: [PATCH 087/101] Even more lints --- ctru-rs/examples/camera-image.rs | 4 ++-- ctru-rs/examples/title-info.rs | 12 +++++------- ctru-rs/src/services/romfs.rs | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/ctru-rs/examples/camera-image.rs b/ctru-rs/examples/camera-image.rs index ecf9f65..30938ce 100644 --- a/ctru-rs/examples/camera-image.rs +++ b/ctru-rs/examples/camera-image.rs @@ -140,8 +140,8 @@ fn rotate_image_to_screen(src: &[u8], framebuf: *mut u8, width: usize, height: u unsafe { // We'll work with pointers since the framebuffer is a raw pointer regardless. // The offsets are completely safe as long as the width and height are correct. - let pixel_pointer = framebuf.offset(draw_index as isize); - pixel_pointer.copy_from(src.as_ptr().offset(read_index as isize), 2); + let pixel_pointer = framebuf.add(draw_index); + pixel_pointer.copy_from(src.as_ptr().add(read_index), 2); } } } diff --git a/ctru-rs/examples/title-info.rs b/ctru-rs/examples/title-info.rs index d2898ac..b3b3f8e 100644 --- a/ctru-rs/examples/title-info.rs +++ b/ctru-rs/examples/title-info.rs @@ -58,19 +58,17 @@ fn main() { if hid.keys_down().intersects(KeyPad::DOWN) { if offset + 1 < cur_list.len() { - offset = offset + 1; - refresh = true; - } - } else if hid.keys_down().intersects(KeyPad::UP) { - if offset > 0 { - offset = offset - 1; + offset += 1; refresh = true; } + } else if hid.keys_down().intersects(KeyPad::UP) && offset > 0 { + offset -= 1; + refresh = true; } // Render the title list via a scrollable text UI. if refresh { - let mut selected_title = cur_list.iter().skip(offset).next().unwrap(); + let mut selected_title = cur_list.iter().nth(offset).unwrap(); // Clear the top screen and write title IDs to it. top_screen.select(); diff --git a/ctru-rs/src/services/romfs.rs b/ctru-rs/src/services/romfs.rs index 572aea6..1202f6d 100644 --- a/ctru-rs/src/services/romfs.rs +++ b/ctru-rs/src/services/romfs.rs @@ -87,7 +87,7 @@ mod tests { fn romfs_lock() { let romfs = RomFS::new().unwrap(); - let _value = *ROMFS_ACTIVE.try_lock().unwrap(); + *ROMFS_ACTIVE.try_lock().unwrap(); drop(romfs); } From c8e38a6fe42c312abb98524cc6a1ffeb89a12a9a Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sun, 15 Oct 2023 16:27:29 +0200 Subject: [PATCH 088/101] Final lint fixing? --- ctru-rs/examples/title-info.rs | 2 +- ctru-rs/src/services/romfs.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ctru-rs/examples/title-info.rs b/ctru-rs/examples/title-info.rs index b3b3f8e..4332750 100644 --- a/ctru-rs/examples/title-info.rs +++ b/ctru-rs/examples/title-info.rs @@ -68,7 +68,7 @@ fn main() { // Render the title list via a scrollable text UI. if refresh { - let mut selected_title = cur_list.iter().nth(offset).unwrap(); + let mut selected_title = cur_list.get(offset).unwrap(); // Clear the top screen and write title IDs to it. top_screen.select(); diff --git a/ctru-rs/src/services/romfs.rs b/ctru-rs/src/services/romfs.rs index 1202f6d..029525c 100644 --- a/ctru-rs/src/services/romfs.rs +++ b/ctru-rs/src/services/romfs.rs @@ -87,7 +87,7 @@ mod tests { fn romfs_lock() { let romfs = RomFS::new().unwrap(); - *ROMFS_ACTIVE.try_lock().unwrap(); + ROMFS_ACTIVE.try_lock().unwrap(); drop(romfs); } From 0ff7cae9b4b43feded0cd48126e2da0ff56753e7 Mon Sep 17 00:00:00 2001 From: Ian Chamberlain Date: Sat, 21 Oct 2023 14:25:59 -0400 Subject: [PATCH 089/101] Clean up minor leftover comments --- .github/workflows/ci.yml | 1 - ctru-rs/src/os.rs | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 017fc2e..69a3978 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,6 @@ jobs: - name: Checkout branch uses: actions/checkout@v2 - # TODO point to to rust3ds/test-runner once migrated - uses: rust3ds/test-runner/setup@v1 with: toolchain: ${{ matrix.toolchain }} diff --git a/ctru-rs/src/os.rs b/ctru-rs/src/os.rs index 8eea697..baf654c 100644 --- a/ctru-rs/src/os.rs +++ b/ctru-rs/src/os.rs @@ -4,7 +4,7 @@ /// /// # Example /// ``` -/// # // let _runner = test_runner::GdbRunner::default(); +/// # let _runner = test_runner::GdbRunner::default(); /// let firm_version = ctru::os::firm_version(); /// assert_ne!(firm_version.major(), 0); /// @@ -61,7 +61,7 @@ pub fn kernel_version() -> Version { /// /// # Example /// ``` -/// # // let _runner = test_runner::GdbRunner::default(); +/// # let _runner = test_runner::GdbRunner::default(); /// let all_memory = ctru::os::MemRegion::All; /// /// assert!(all_memory.size() > 0); @@ -111,7 +111,7 @@ impl MemRegion { /// # Example /// /// ``` -/// # // let _runner = test_runner::GdbRunner::default(); +/// let _runner = test_runner::GdbRunner::default(); /// let strength = ctru::os::WifiStrength::current(); /// assert!((strength as u8) < 4); /// ``` From 2e442752b47b5b09525560cf2257f1deb3021922 Mon Sep 17 00:00:00 2001 From: Lena Date: Wed, 25 Oct 2023 15:33:12 +0200 Subject: [PATCH 090/101] add `set_initial_text` swkbd method --- ctru-rs/src/applets/swkbd.rs | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/ctru-rs/src/applets/swkbd.rs b/ctru-rs/src/applets/swkbd.rs index 8497233..69d4329 100644 --- a/ctru-rs/src/applets/swkbd.rs +++ b/ctru-rs/src/applets/swkbd.rs @@ -7,7 +7,8 @@ use bitflags::bitflags; use ctru_sys::{ - self, swkbdInit, swkbdInputText, swkbdSetButton, swkbdSetFeatures, swkbdSetHintText, SwkbdState, + self, swkbdInit, swkbdInputText, swkbdSetButton, swkbdSetFeatures, swkbdSetHintText, + swkbdSetInitialText, SwkbdState, }; use libc; use std::fmt::Display; @@ -336,6 +337,30 @@ impl SoftwareKeyboard { self.state.max_digits = digits; } + /// Set the initial text for this software keyboard. + /// + /// The initial text is the text already written when you open the software keyboard. + /// + /// # Example + /// + /// ``` + /// # let _runner = test_runner::GdbRunner::default(); + /// # fn main() { + /// # + /// use ctru::applets::swkbd::SoftwareKeyboard; + /// let mut keyboard = SoftwareKeyboard::default(); + /// + /// keyboard.set_initial_text("Write here what you like!"); + /// # + /// # } + #[doc(alias = "swkbdSetInitialText")] + pub fn set_initial_text(&mut self, text: &str) { + unsafe { + let nul_terminated: String = text.chars().chain(once('\0')).collect(); + swkbdSetInitialText(self.state.as_mut(), nul_terminated.as_ptr()); + } + } + /// Set the hint text for this software keyboard. /// /// The hint text is the text shown in gray before any text gets written in the input box. From 4b0b966026b8837e06713488afb90026589d2d92 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sun, 12 Nov 2023 16:03:08 +0100 Subject: [PATCH 091/101] Fix errors --- ctru-rs/src/services/romfs.rs | 2 +- ctru-sys/build.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ctru-rs/src/services/romfs.rs b/ctru-rs/src/services/romfs.rs index a311e9c..e7f992c 100644 --- a/ctru-rs/src/services/romfs.rs +++ b/ctru-rs/src/services/romfs.rs @@ -89,7 +89,7 @@ mod tests { #[should_panic] fn romfs_lock() { let romfs = RomFS::new().unwrap(); - + ROMFS_ACTIVE.try_lock().unwrap(); drop(romfs); diff --git a/ctru-sys/build.rs b/ctru-sys/build.rs index 3ad5851..b1a48b3 100644 --- a/ctru-sys/build.rs +++ b/ctru-sys/build.rs @@ -169,7 +169,7 @@ fn check_libctru_version() -> Result<(String, String, String), Box> { .expect("crate version should have '+' delimeter"); if lib_version != crate_built_version { - Err(format!( + return Err(format!( "libctru version is {lib_version} but this crate was built for {crate_built_version}" ) .into()); From 079f3bdc3c7c70f06a07bea9f15dea5154cae892 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sun, 12 Nov 2023 16:47:13 +0100 Subject: [PATCH 092/101] Fixed nits and suggestions --- ctru-rs/examples/camera-image.rs | 10 ++-- ctru-rs/examples/movement.rs | 18 ++++--- ctru-rs/src/console.rs | 8 +-- ctru-rs/src/lib.rs | 23 +-------- ctru-rs/src/services/cam.rs | 2 +- ctru-rs/src/services/gfx.rs | 4 +- ctru-rs/src/services/hid.rs | 89 ++++++++++++++++++++++++-------- ctru-rs/src/services/ndsp/mod.rs | 1 + 8 files changed, 95 insertions(+), 60 deletions(-) diff --git a/ctru-rs/examples/camera-image.rs b/ctru-rs/examples/camera-image.rs index 30938ce..8395883 100644 --- a/ctru-rs/examples/camera-image.rs +++ b/ctru-rs/examples/camera-image.rs @@ -83,7 +83,7 @@ fn main() { .take_picture(&mut buf, WAIT_TIMEOUT) .expect("Failed to take picture"); - let image_size = camera.final_view_size(); + let (width, height) = camera.final_view_size(); // Play the normal shutter sound. cam.play_shutter_sound(ShutterSound::Normal) @@ -96,16 +96,16 @@ fn main() { rotate_image_to_screen( &buf, left_side.raw_framebuffer().ptr, - image_size.0 as usize, - image_size.1 as usize, + width as usize, + height as usize, ); // Rotate the right image and correctly display it on the screen. rotate_image_to_screen( &buf[len / 2..], right_side.raw_framebuffer().ptr, - image_size.0 as usize, - image_size.1 as usize, + width as usize, + height as usize, ); } diff --git a/ctru-rs/examples/movement.rs b/ctru-rs/examples/movement.rs index a0aa2c8..1cbefc1 100644 --- a/ctru-rs/examples/movement.rs +++ b/ctru-rs/examples/movement.rs @@ -19,8 +19,10 @@ fn main() { // Activate the accelerometer and the gyroscope. // Because of the complex nature of the movement sensors, they aren't activated by default with the `Hid` service. // However, they can simply be turned on and off whenever necessary. - hid.set_accelerometer(true); - hid.set_gyroscope(true); + hid.set_accelerometer(true) + .expect("Couldn't activate accelerometer"); + hid.set_gyroscope(true) + .expect("Couldn't activate gyroscope"); while apt.main_loop() { // Scan all the controller inputs. @@ -34,13 +36,17 @@ fn main() { // Be careful: reading without activating the sensors (as done before this loop) will result in a panic. println!( "\x1b[3;0HAcceleration: {:?} ", - hid.accelerometer_vector() - .expect("could not retrieve acceleration vector") + Into::<(i16, i16, i16)>::into( + hid.accelerometer_vector() + .expect("could not retrieve acceleration vector") + ) ); println!( "\x1b[4;0HGyroscope angular rate: {:?} ", - hid.gyroscope_rate() - .expect("could not retrieve angular rate") + Into::<(i16, i16, i16)>::into( + hid.gyroscope_rate() + .expect("could not retrieve angular rate") + ) ); gfx.wait_for_vblank(); diff --git a/ctru-rs/src/console.rs b/ctru-rs/src/console.rs index f88e11b..5c9fba1 100644 --- a/ctru-rs/src/console.rs +++ b/ctru-rs/src/console.rs @@ -209,7 +209,7 @@ impl<'screen> Console<'screen> { /// /// # Example /// - /// ```no_run + /// ``` /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -264,7 +264,7 @@ impl<'screen> Console<'screen> { /// /// # Example /// - /// ```no_run + /// ``` /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -288,14 +288,14 @@ impl<'screen> Console<'screen> { pub fn reset_window(&mut self) { let width = self.max_width(); - unsafe { consoleSetWindow(self.context.as_mut(), 0, 0, width.into(), 30) }; + self.set_window(0, 0, width, 30).unwrap(); } /// Returns this [`Console`]'s maximum character width depending on the screen used. /// /// # Example /// - /// ```no_run + /// ``` /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # diff --git a/ctru-rs/src/lib.rs b/ctru-rs/src/lib.rs index a57cc00..f1569bb 100644 --- a/ctru-rs/src/lib.rs +++ b/ctru-rs/src/lib.rs @@ -76,7 +76,6 @@ pub fn use_panic_handler() { /// When `test` is enabled, this function will be ignored. #[cfg(not(test))] fn panic_hook_setup() { - use crate::services::hid::KeyPad; use std::panic::PanicInfo; let main_thread = std::thread::current().id(); @@ -88,27 +87,9 @@ fn panic_hook_setup() { // Only for panics in the main thread if main_thread == std::thread::current().id() && console::Console::exists() { - println!("\nPress SELECT to exit the software"); + println!("\nThe software will exit in 5 seconds"); - // Due to how the Hid service operates, we can't safely use 2 handles to it at the same time. - // Furthermore, the panic hook runs before the panic cleanup is done, which means that any other handles - // to the service will still be alive during this process. - // Regardless, we can "unsafely" spin up a new instance, since the module won't be used any further from the main process, - // which is going to get cleaned up right after this loop. - unsafe { - let _ = ctru_sys::hidInit(); - - loop { - ctru_sys::hidScanInput(); - let keys = ctru_sys::hidKeysDown(); - - if KeyPad::from_bits_truncate(keys).contains(KeyPad::SELECT) { - break; - } - } - - ctru_sys::hidExit(); - } + std::thread::sleep(std::time::Duration::from_secs(5)); } }); std::panic::set_hook(new_hook); diff --git a/ctru-rs/src/services/cam.rs b/ctru-rs/src/services/cam.rs index 3dd52ef..1964cb9 100644 --- a/ctru-rs/src/services/cam.rs +++ b/ctru-rs/src/services/cam.rs @@ -633,7 +633,7 @@ pub trait Camera: private::ConfigurableCamera { /// /// # Example /// - /// ```no_run + /// ``` /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # diff --git a/ctru-rs/src/services/gfx.rs b/ctru-rs/src/services/gfx.rs index 25830a6..8c8764a 100644 --- a/ctru-rs/src/services/gfx.rs +++ b/ctru-rs/src/services/gfx.rs @@ -350,11 +350,11 @@ impl Gfx { /// By initializing the [`Gfx`] service as such, all functionality that relies on CPU manipulation of the framebuffers will /// be completely unavailable (usually resulting in an ARM panic if wrongly used). /// - /// Things such as [`Console`](crate::console::Console) and [`Screen::raw_framebuffer()`] will result in ARM exceptions. + /// Usage of functionality such as [`Console`](crate::console::Console) and [`Screen::raw_framebuffer()`] will result in ARM exceptions. /// /// # Example /// - /// ```no_run + /// ``` /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # diff --git a/ctru-rs/src/services/hid.rs b/ctru-rs/src/services/hid.rs index 4997158..36588b0 100644 --- a/ctru-rs/src/services/hid.rs +++ b/ctru-rs/src/services/hid.rs @@ -81,6 +81,7 @@ bitflags! { } /// Error enum for generic errors within the [`Hid`] service. +#[non_exhaustive] #[derive(Copy, Clone, Debug, PartialEq, Eq)] pub enum Error { /// An attempt was made to access the accelerometer while disabled. @@ -89,6 +90,28 @@ pub enum Error { UnavailableGyroscope, } +/// Representation of the acceleration vector read by the accelerometer. +/// +/// Have a look at [`Hid::enable_accelerometer()`] for more information. +#[allow(missing_docs)] +#[derive(Default, Copy, Clone, Debug, PartialEq, Eq)] +pub struct Acceleration { + x: i16, + y: i16, + z: i16, +} + +/// Representation of the angular rate read by the gyroscope. +/// +/// Have a look at [`Hid::enable_gyroscope())`] for more information. +#[allow(missing_docs)] +#[derive(Default, Copy, Clone, Debug, PartialEq, Eq)] +pub struct AngularRate { + roll: i16, + pitch: i16, + yaw: i16, +} + /// Handle to the HID service. pub struct Hid { active_accelerometer: bool, @@ -336,7 +359,7 @@ impl Hid { /// /// # Example /// - /// ```no_run + /// ``` /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -365,7 +388,7 @@ impl Hid { /// /// # Example /// - /// ```no_run + /// ``` /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -373,28 +396,30 @@ impl Hid { /// let mut hid = Hid::new()?; /// /// // The accelerometer will start to register movements. - /// hid.set_accelerometer(true); + /// hid.set_accelerometer(true).unwrap(); /// # /// # Ok(()) /// # } /// ``` #[doc(alias = "HIDUSER_EnableAccelerometer")] #[doc(alias = "HIDUSER_DisableAccelerometer")] - pub fn set_accelerometer(&mut self, enabled: bool) { + pub fn set_accelerometer(&mut self, enabled: bool) -> crate::Result<()> { if enabled { - let _ = unsafe { ctru_sys::HIDUSER_EnableAccelerometer() }; + ResultCode(unsafe { ctru_sys::HIDUSER_EnableAccelerometer() })?; } else { - let _ = unsafe { ctru_sys::HIDUSER_DisableAccelerometer() }; + ResultCode(unsafe { ctru_sys::HIDUSER_DisableAccelerometer() })?; } self.active_accelerometer = enabled; + + Ok(()) } /// Activate/deactivate the console's gyroscopic sensor. /// /// # Example /// - /// ```no_run + /// ``` /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -402,24 +427,26 @@ impl Hid { /// let mut hid = Hid::new()?; /// /// // The gyroscope will start to register positions. - /// hid.set_gyroscope(true); + /// hid.set_gyroscope(true).unwrap(); /// # /// # Ok(()) /// # } /// ``` #[doc(alias = "HIDUSER_EnableGyroscope")] #[doc(alias = "HIDUSER_DisableGyroscope")] - pub fn set_gyroscope(&mut self, enabled: bool) { + pub fn set_gyroscope(&mut self, enabled: bool) -> crate::Result<()> { if enabled { - let _ = unsafe { ctru_sys::HIDUSER_EnableGyroscope() }; + ResultCode(unsafe { ctru_sys::HIDUSER_EnableGyroscope() })?; } else { - let _ = unsafe { ctru_sys::HIDUSER_DisableGyroscope() }; + ResultCode(unsafe { ctru_sys::HIDUSER_DisableGyroscope() })?; } self.active_gyroscope = enabled; + + Ok(()) } - /// Returns the acceleration vector (x,y,z) registered by the accelerometer. + /// Returns the acceleration vector (x, y, z) registered by the accelerometer. /// /// # Errors /// @@ -428,7 +455,7 @@ impl Hid { /// /// # Example /// - /// ```no_run + /// ``` /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -436,7 +463,7 @@ impl Hid { /// let mut hid = Hid::new()?; /// /// // The accelerometer will start to register movements. - /// hid.set_accelerometer(true); + /// hid.set_accelerometer(true).unwrap(); /// /// // It's necessary to run `scan_input()` to update the accelerometer's readings. /// hid.scan_input(); @@ -448,7 +475,7 @@ impl Hid { /// # } /// ``` #[doc(alias = "hidAccelRead")] - pub fn accelerometer_vector(&self) -> Result<(i16, i16, i16), Error> { + pub fn accelerometer_vector(&self) -> Result { if !self.active_accelerometer { return Err(Error::UnavailableAccelerometer); } @@ -459,10 +486,14 @@ impl Hid { ctru_sys::hidAccelRead(&mut res); } - Ok((res.x, res.y, res.z)) + Ok(Acceleration { + x: res.x, + y: res.y, + z: res.z, + }) } - /// Returns the angular rate (roll,pitch,yaw) registered by the gyroscope. + /// Returns the angular rate registered by the gyroscope. /// /// # Errors /// @@ -471,7 +502,7 @@ impl Hid { /// /// # Example /// - /// ```no_run + /// ``` /// # use std::error::Error; /// # fn main() -> Result<(), Box> { /// # @@ -479,7 +510,7 @@ impl Hid { /// let mut hid = Hid::new()?; /// /// // The gyroscope will start to register positions. - /// hid.set_gyroscope(true); + /// hid.set_gyroscope(true).unwrap(); /// /// // It's necessary to run `scan_input()` to update the gyroscope's readings. /// hid.scan_input(); @@ -491,7 +522,7 @@ impl Hid { /// # } /// ``` #[doc(alias = "hidGyroRead")] - pub fn gyroscope_rate(&self) -> Result<(i16, i16, i16), Error> { + pub fn gyroscope_rate(&self) -> Result { if !self.active_gyroscope { return Err(Error::UnavailableGyroscope); } @@ -502,7 +533,23 @@ impl Hid { ctru_sys::hidGyroRead(&mut res); } - Ok((res.x, res.y, res.z)) + Ok(AngularRate { + roll: res.x, + pitch: res.y, + yaw: res.z, + }) + } +} + +impl From for (i16, i16, i16) { + fn from(value: Acceleration) -> (i16, i16, i16) { + (value.x, value.y, value.z) + } +} + +impl From for (i16, i16, i16) { + fn from(value: AngularRate) -> (i16, i16, i16) { + (value.roll, value.pitch, value.yaw) } } diff --git a/ctru-rs/src/services/ndsp/mod.rs b/ctru-rs/src/services/ndsp/mod.rs index 4176f70..3e96184 100644 --- a/ctru-rs/src/services/ndsp/mod.rs +++ b/ctru-rs/src/services/ndsp/mod.rs @@ -85,6 +85,7 @@ pub enum InterpolationType { } /// Errors returned by [`ndsp`](self) functions. +#[non_exhaustive] #[derive(Copy, Clone, Debug, PartialEq, Eq)] pub enum Error { /// Channel with the specified ID does not exist. From 99814fd5a1eef202646c02a119a77dab9f229f5b Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sun, 19 Nov 2023 18:34:09 +0100 Subject: [PATCH 093/101] Finish up trimming --- ctru-rs/examples/camera-image.rs | 2 +- ctru-rs/src/services/cam.rs | 63 +++++++++++++++++++++++++------- 2 files changed, 51 insertions(+), 14 deletions(-) diff --git a/ctru-rs/examples/camera-image.rs b/ctru-rs/examples/camera-image.rs index 8395883..0c73f92 100644 --- a/ctru-rs/examples/camera-image.rs +++ b/ctru-rs/examples/camera-image.rs @@ -53,7 +53,7 @@ fn main() { .expect("Failed to enable auto white balance"); // This line has no effect on the camera since the photos are already shot with `TopLCD` size. camera - .set_trimming(Trimming::Centered(ViewSize::TopLCD)) + .set_trimming(Trimming::new_centered_with_view(ViewSize::TopLCD)) .expect("Failed to enable trimming"); } diff --git a/ctru-rs/src/services/cam.rs b/ctru-rs/src/services/cam.rs index 1964cb9..0e31d13 100644 --- a/ctru-rs/src/services/cam.rs +++ b/ctru-rs/src/services/cam.rs @@ -231,11 +231,18 @@ pub enum ShutterSound { } /// Configuration to handle image trimming. +/// +/// See [`Trimming::new_centered()`] and the other associated methods for controlled +/// ways of configuring trimming. #[non_exhaustive] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum Trimming { /// Trimming configuration relatively to the center of the image. - Centered(ViewSize), + #[allow(missing_docs)] + Centered{ + width: i16, + height: i16, + }, /// Trimming disabled. Off, } @@ -653,7 +660,7 @@ pub trait Camera: private::ConfigurableCamera { /// ``` fn final_view_size(&self) -> (i16, i16) { match self.trimming() { - Trimming::Centered(trim_size) => trim_size.into(), + Trimming::Centered{width, height} => (width, height), Trimming::Off => self.view_size().into(), } } @@ -667,22 +674,24 @@ pub trait Camera: private::ConfigurableCamera { /// /// # Notes /// - /// Trimming the image view directly on the cameras can only work if the final image has the size of one of the supported image formats. - /// As such, even after trimming the image (which will result in a "zoomed in" view of the original image) - /// the resulting picture must still be of [`ViewSize`] dimensions. + /// Setting up a [`Trimming`] configurations that exceeds the bounds of the original + /// image's size will result in the trimming to be clamped to the maximum borders of the image. + /// Also, the final image size must have a pixel area multiple of 128, + /// otherwise the "status_changed" error may be returned. #[doc(alias = "CAMU_SetTrimming")] fn set_trimming(&mut self, trimming: Trimming) -> crate::Result<()> { - // Run checks for all trimming possibilities. match trimming { - Trimming::Centered(trim_size) => unsafe { + Trimming::Centered{width, height} => unsafe { let view_size: (i16, i16) = self.view_size().into(); - let trim_size: (i16, i16) = trim_size.into(); + let mut trim_size: (i16, i16) = (width, height); + + if trim_size.0 > view_size.0 { + trim_size.0 = view_size.0; + }; - // Trim sizes are within the view. - assert!( - trim_size.0 <= view_size.0 && trim_size.1 <= view_size.1, - "trimmed view is bigger than the camera view" - ); + if trim_size.1 > view_size.1 { + trim_size.1 = view_size.1; + }; ResultCode(ctru_sys::CAMU_SetTrimming(self.port_as_raw(), true))?; @@ -1090,6 +1099,34 @@ pub trait Camera: private::ConfigurableCamera { } } +impl Trimming { + /// Create a new [`Trimming`] configuration using width and height centered to the original image. + /// + /// # Panics + /// + /// This function will panic if the pixel area of the new configuration (`width * height`) + /// is not a multiple of 128. + pub fn new_centered(width: i16, height: i16) -> Self { + // Pixel area must be a multiple of 128. + assert!((width * height) % 128 == 0); + + Self::Centered { + width, + height, + } + } + + /// Create a new [`Trimming`] configuration using a standard view size centered to the original image. + pub fn new_centered_with_view(size: ViewSize) -> Self { + let size: (i16, i16) = size.into(); + + Self::Centered { + width: size.0, + height: size.1, + } + } +} + impl Cam { /// Initialize a new service handle. /// From 28a8b08f09ca82f155a662d0cdbdb7171d7f5b39 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sun, 19 Nov 2023 18:42:14 +0100 Subject: [PATCH 094/101] Fmt and docs lints --- ctru-rs/src/services/cam.rs | 18 ++++++------------ ctru-rs/src/services/hid.rs | 4 ++-- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/ctru-rs/src/services/cam.rs b/ctru-rs/src/services/cam.rs index 0e31d13..a4c799d 100644 --- a/ctru-rs/src/services/cam.rs +++ b/ctru-rs/src/services/cam.rs @@ -239,10 +239,7 @@ pub enum ShutterSound { pub enum Trimming { /// Trimming configuration relatively to the center of the image. #[allow(missing_docs)] - Centered{ - width: i16, - height: i16, - }, + Centered { width: i16, height: i16 }, /// Trimming disabled. Off, } @@ -660,7 +657,7 @@ pub trait Camera: private::ConfigurableCamera { /// ``` fn final_view_size(&self) -> (i16, i16) { match self.trimming() { - Trimming::Centered{width, height} => (width, height), + Trimming::Centered { width, height } => (width, height), Trimming::Off => self.view_size().into(), } } @@ -681,7 +678,7 @@ pub trait Camera: private::ConfigurableCamera { #[doc(alias = "CAMU_SetTrimming")] fn set_trimming(&mut self, trimming: Trimming) -> crate::Result<()> { match trimming { - Trimming::Centered{width, height} => unsafe { + Trimming::Centered { width, height } => unsafe { let view_size: (i16, i16) = self.view_size().into(); let mut trim_size: (i16, i16) = (width, height); @@ -1103,17 +1100,14 @@ impl Trimming { /// Create a new [`Trimming`] configuration using width and height centered to the original image. /// /// # Panics - /// + /// /// This function will panic if the pixel area of the new configuration (`width * height`) /// is not a multiple of 128. pub fn new_centered(width: i16, height: i16) -> Self { // Pixel area must be a multiple of 128. assert!((width * height) % 128 == 0); - - Self::Centered { - width, - height, - } + + Self::Centered { width, height } } /// Create a new [`Trimming`] configuration using a standard view size centered to the original image. diff --git a/ctru-rs/src/services/hid.rs b/ctru-rs/src/services/hid.rs index 36588b0..10d89c4 100644 --- a/ctru-rs/src/services/hid.rs +++ b/ctru-rs/src/services/hid.rs @@ -92,7 +92,7 @@ pub enum Error { /// Representation of the acceleration vector read by the accelerometer. /// -/// Have a look at [`Hid::enable_accelerometer()`] for more information. +/// Have a look at [`Hid::set_accelerometer()`] for more information. #[allow(missing_docs)] #[derive(Default, Copy, Clone, Debug, PartialEq, Eq)] pub struct Acceleration { @@ -103,7 +103,7 @@ pub struct Acceleration { /// Representation of the angular rate read by the gyroscope. /// -/// Have a look at [`Hid::enable_gyroscope())`] for more information. +/// Have a look at [`Hid::set_gyroscope()`] for more information. #[allow(missing_docs)] #[derive(Default, Copy, Clone, Debug, PartialEq, Eq)] pub struct AngularRate { From 3e2861323f695f6782594bdec59015390be072ae Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sun, 19 Nov 2023 18:46:23 +0100 Subject: [PATCH 095/101] Revert trim clamping --- ctru-rs/src/services/cam.rs | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/ctru-rs/src/services/cam.rs b/ctru-rs/src/services/cam.rs index a4c799d..e571aaa 100644 --- a/ctru-rs/src/services/cam.rs +++ b/ctru-rs/src/services/cam.rs @@ -669,26 +669,22 @@ pub trait Camera: private::ConfigurableCamera { /// Set trimming bounds to trim the camera photo. /// - /// # Notes + /// # Panics /// /// Setting up a [`Trimming`] configurations that exceeds the bounds of the original - /// image's size will result in the trimming to be clamped to the maximum borders of the image. - /// Also, the final image size must have a pixel area multiple of 128, - /// otherwise the "status_changed" error may be returned. + /// image's size will result in a panic. #[doc(alias = "CAMU_SetTrimming")] fn set_trimming(&mut self, trimming: Trimming) -> crate::Result<()> { match trimming { Trimming::Centered { width, height } => unsafe { let view_size: (i16, i16) = self.view_size().into(); - let mut trim_size: (i16, i16) = (width, height); - - if trim_size.0 > view_size.0 { - trim_size.0 = view_size.0; - }; + let trim_size: (i16, i16) = (width, height); - if trim_size.1 > view_size.1 { - trim_size.1 = view_size.1; - }; + // Check whether the trim size is within the view. + assert!( + trim_size.0 <= view_size.0 && trim_size.1 <= view_size.1, + "trimmed view is bigger than the camera view", + ); ResultCode(ctru_sys::CAMU_SetTrimming(self.port_as_raw(), true))?; From 8addde71b481919292c2a09514b118ba95777262 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sun, 19 Nov 2023 18:48:19 +0100 Subject: [PATCH 096/101] Docs --- ctru-rs/src/services/cam.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ctru-rs/src/services/cam.rs b/ctru-rs/src/services/cam.rs index e571aaa..33a0753 100644 --- a/ctru-rs/src/services/cam.rs +++ b/ctru-rs/src/services/cam.rs @@ -669,6 +669,11 @@ pub trait Camera: private::ConfigurableCamera { /// Set trimming bounds to trim the camera photo. /// + /// # Notes + /// + /// The trimmed image must have a pixel area of (`width * height`) multiple of 128. + /// If not, a raw `libctru` error may be returned. + /// /// # Panics /// /// Setting up a [`Trimming`] configurations that exceeds the bounds of the original From 42b6f27fa6e1d9f1ec4ddc1b258ee340b04690ec Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sun, 19 Nov 2023 18:55:43 +0100 Subject: [PATCH 097/101] Fix tests --- ctru-rs/src/services/cam.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctru-rs/src/services/cam.rs b/ctru-rs/src/services/cam.rs index 33a0753..dc76cf2 100644 --- a/ctru-rs/src/services/cam.rs +++ b/ctru-rs/src/services/cam.rs @@ -647,7 +647,7 @@ pub trait Camera: private::ConfigurableCamera { /// let mut inward = &mut cam.inner_cam; /// /// // We trim the image down so that it fits on a DS screen! - /// inward.set_trimming(Trimming::Centered(ViewSize::DS)); + /// inward.set_trimming(Trimming::new_centered_with_view(ViewSize::DS)); /// /// // This result will take into account the trimming. /// let final_resolution = inward.final_view_size(); From 73aac708f14325ac6f267f4bcefb9fe2b25de9d4 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Sun, 19 Nov 2023 19:11:42 +0100 Subject: [PATCH 098/101] Fix gfx nits --- ctru-rs/src/services/gfx.rs | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/ctru-rs/src/services/gfx.rs b/ctru-rs/src/services/gfx.rs index 8c8764a..6eb04f6 100644 --- a/ctru-rs/src/services/gfx.rs +++ b/ctru-rs/src/services/gfx.rs @@ -321,21 +321,7 @@ impl Gfx { top_fb_fmt: FramebufferFormat, bottom_fb_fmt: FramebufferFormat, ) -> Result { - let handler = ServiceReference::new( - &GFX_ACTIVE, - || unsafe { - ctru_sys::gfxInit(top_fb_fmt.into(), bottom_fb_fmt.into(), false); - - Ok(()) - }, - || unsafe { ctru_sys::gfxExit() }, - )?; - - Ok(Self { - top_screen: RefCell::new(TopScreen::new()), - bottom_screen: RefCell::new(BottomScreen), - _service_handler: handler, - }) + Self::with_configuration(top_fb_fmt, bottom_fb_fmt, false) } /// Initialize a new service handle with the chosen framebuffer formats on the VRAM for the top and bottom screens. @@ -371,11 +357,20 @@ impl Gfx { pub unsafe fn with_formats_vram( top_fb_fmt: FramebufferFormat, bottom_fb_fmt: FramebufferFormat, + ) -> Result { + Self::with_configuration(top_fb_fmt, bottom_fb_fmt, true) + } + + // Internal function to handle the initialization of `Gfx`. + fn with_configuration( + top_fb_fmt: FramebufferFormat, + bottom_fb_fmt: FramebufferFormat, + vram_buffer: bool, ) -> Result { let handler = ServiceReference::new( &GFX_ACTIVE, || unsafe { - ctru_sys::gfxInit(top_fb_fmt.into(), bottom_fb_fmt.into(), true); + ctru_sys::gfxInit(top_fb_fmt.into(), bottom_fb_fmt.into(), vram_buffer); Ok(()) }, From ccc9dbf57164310342b5d5cb3250ce3af82a3bb0 Mon Sep 17 00:00:00 2001 From: Meziu <55318903+Meziu@users.noreply.github.com> Date: Mon, 20 Nov 2023 10:36:03 +0100 Subject: [PATCH 099/101] Update ctru-rs/examples/movement.rs Co-authored-by: Ian Chamberlain --- ctru-rs/examples/movement.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctru-rs/examples/movement.rs b/ctru-rs/examples/movement.rs index 1cbefc1..fe5e764 100644 --- a/ctru-rs/examples/movement.rs +++ b/ctru-rs/examples/movement.rs @@ -36,7 +36,7 @@ fn main() { // Be careful: reading without activating the sensors (as done before this loop) will result in a panic. println!( "\x1b[3;0HAcceleration: {:?} ", - Into::<(i16, i16, i16)>::into( + <(i16, i16, i16)>::from( hid.accelerometer_vector() .expect("could not retrieve acceleration vector") ) From 39bd6c27178214eb4369ebf4656e7ab5ddffbbc2 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Wed, 22 Nov 2023 20:29:30 +0100 Subject: [PATCH 100/101] Remove panic handler --- ctru-rs/examples/audio-filters.rs | 2 -- ctru-rs/examples/buttons.rs | 2 -- ctru-rs/examples/camera-image.rs | 2 -- ctru-rs/examples/file-explorer.rs | 2 -- ctru-rs/examples/futures-basic.rs | 2 -- ctru-rs/examples/futures-tokio.rs | 2 -- ctru-rs/examples/gfx-3d-mode.rs | 2 -- ctru-rs/examples/gfx-bitmap.rs | 2 -- ctru-rs/examples/gfx-wide-mode.rs | 2 -- ctru-rs/examples/hashmaps.rs | 2 -- ctru-rs/examples/hello-both-screens.rs | 2 -- ctru-rs/examples/hello-world.rs | 1 - ctru-rs/examples/linear-memory.rs | 2 -- ctru-rs/examples/mii-selector.rs | 2 -- ctru-rs/examples/movement.rs | 2 -- ctru-rs/examples/network-sockets.rs | 2 -- ctru-rs/examples/output-3dslink.rs | 2 -- ctru-rs/examples/romfs.rs | 2 -- ctru-rs/examples/software-keyboard.rs | 2 -- ctru-rs/examples/system-configuration.rs | 2 -- ctru-rs/examples/thread-basic.rs | 2 -- ctru-rs/examples/thread-info.rs | 2 -- ctru-rs/examples/thread-locals.rs | 2 -- ctru-rs/examples/time-rtc.rs | 2 -- ctru-rs/examples/title-info.rs | 2 -- ctru-rs/examples/touch-screen.rs | 2 -- ctru-rs/src/console.rs | 3 -- ctru-rs/src/lib.rs | 39 ------------------------ 28 files changed, 93 deletions(-) diff --git a/ctru-rs/examples/audio-filters.rs b/ctru-rs/examples/audio-filters.rs index 75941b7..1dfde5a 100644 --- a/ctru-rs/examples/audio-filters.rs +++ b/ctru-rs/examples/audio-filters.rs @@ -40,8 +40,6 @@ fn fill_buffer(audio_data: &mut [u8], frequency: f32) { } fn main() { - ctru::use_panic_handler(); - let gfx = Gfx::new().expect("Couldn't obtain GFX controller"); let mut hid = Hid::new().expect("Couldn't obtain HID controller"); let apt = Apt::new().expect("Couldn't obtain APT controller"); diff --git a/ctru-rs/examples/buttons.rs b/ctru-rs/examples/buttons.rs index 90862bf..258a715 100644 --- a/ctru-rs/examples/buttons.rs +++ b/ctru-rs/examples/buttons.rs @@ -5,8 +5,6 @@ use ctru::prelude::*; fn main() { - ctru::use_panic_handler(); - let apt = Apt::new().unwrap(); let mut hid = Hid::new().unwrap(); let gfx = Gfx::new().unwrap(); diff --git a/ctru-rs/examples/camera-image.rs b/ctru-rs/examples/camera-image.rs index 0c73f92..4084f21 100644 --- a/ctru-rs/examples/camera-image.rs +++ b/ctru-rs/examples/camera-image.rs @@ -14,8 +14,6 @@ use std::time::Duration; const WAIT_TIMEOUT: Duration = Duration::from_millis(300); fn main() { - ctru::use_panic_handler(); - let apt = Apt::new().expect("Failed to initialize Apt service."); let mut hid = Hid::new().expect("Failed to initialize Hid service."); let gfx = Gfx::new().expect("Failed to initialize GFX service."); diff --git a/ctru-rs/examples/file-explorer.rs b/ctru-rs/examples/file-explorer.rs index 6fa1183..3ad37c9 100644 --- a/ctru-rs/examples/file-explorer.rs +++ b/ctru-rs/examples/file-explorer.rs @@ -11,8 +11,6 @@ use std::os::horizon::fs::MetadataExt; use std::path::{Path, PathBuf}; fn main() { - ctru::use_panic_handler(); - let apt = Apt::new().unwrap(); let mut hid = Hid::new().unwrap(); let gfx = Gfx::new().unwrap(); diff --git a/ctru-rs/examples/futures-basic.rs b/ctru-rs/examples/futures-basic.rs index c41245c..5eb1c2a 100644 --- a/ctru-rs/examples/futures-basic.rs +++ b/ctru-rs/examples/futures-basic.rs @@ -13,8 +13,6 @@ use futures::StreamExt; use std::os::horizon::thread::BuilderExt; fn main() { - ctru::use_panic_handler(); - let gfx = Gfx::new().expect("Couldn't obtain GFX controller"); let mut hid = Hid::new().expect("Couldn't obtain HID controller"); let apt = Apt::new().expect("Couldn't obtain APT controller"); diff --git a/ctru-rs/examples/futures-tokio.rs b/ctru-rs/examples/futures-tokio.rs index 986e930..06a7cff 100644 --- a/ctru-rs/examples/futures-tokio.rs +++ b/ctru-rs/examples/futures-tokio.rs @@ -6,8 +6,6 @@ use std::os::horizon::thread::BuilderExt; use std::time::Duration; fn main() { - ctru::use_panic_handler(); - let gfx = Gfx::new().expect("Couldn't obtain GFX controller"); let mut hid = Hid::new().expect("Couldn't obtain HID controller"); let apt = Apt::new().expect("Couldn't obtain APT controller"); diff --git a/ctru-rs/examples/gfx-3d-mode.rs b/ctru-rs/examples/gfx-3d-mode.rs index 7176085..a5f3b1c 100644 --- a/ctru-rs/examples/gfx-3d-mode.rs +++ b/ctru-rs/examples/gfx-3d-mode.rs @@ -17,8 +17,6 @@ const IMAGE: &[u8] = include_bytes!("assets/ferris.rgb"); static ZERO: &[u8] = &[0; IMAGE.len()]; fn main() { - ctru::use_panic_handler(); - let gfx = Gfx::new().expect("Couldn't obtain GFX controller"); let mut hid = Hid::new().expect("Couldn't obtain HID controller"); let apt = Apt::new().expect("Couldn't obtain APT controller"); diff --git a/ctru-rs/examples/gfx-bitmap.rs b/ctru-rs/examples/gfx-bitmap.rs index 8efb2be..e775d8e 100644 --- a/ctru-rs/examples/gfx-bitmap.rs +++ b/ctru-rs/examples/gfx-bitmap.rs @@ -18,8 +18,6 @@ use ctru::services::gfx::{Flush, Screen, Swap}; static IMAGE: &[u8] = include_bytes!("assets/ferris.rgb"); fn main() { - ctru::use_panic_handler(); - let gfx = Gfx::new().expect("Couldn't obtain GFX controller"); let mut hid = Hid::new().expect("Couldn't obtain HID controller"); let apt = Apt::new().expect("Couldn't obtain APT controller"); diff --git a/ctru-rs/examples/gfx-wide-mode.rs b/ctru-rs/examples/gfx-wide-mode.rs index 109169d..5cae138 100644 --- a/ctru-rs/examples/gfx-wide-mode.rs +++ b/ctru-rs/examples/gfx-wide-mode.rs @@ -8,8 +8,6 @@ use ctru::prelude::*; fn main() { - ctru::use_panic_handler(); - let apt = Apt::new().unwrap(); let mut hid = Hid::new().unwrap(); let gfx = Gfx::new().unwrap(); diff --git a/ctru-rs/examples/hashmaps.rs b/ctru-rs/examples/hashmaps.rs index e563068..97f42ae 100644 --- a/ctru-rs/examples/hashmaps.rs +++ b/ctru-rs/examples/hashmaps.rs @@ -9,8 +9,6 @@ use ctru::prelude::*; fn main() { - ctru::use_panic_handler(); - // HashMaps generate hashes thanks to the 3DS' cryptografically secure generator. // This generator is only active when activating the `PS` service. // This service is automatically initialized. diff --git a/ctru-rs/examples/hello-both-screens.rs b/ctru-rs/examples/hello-both-screens.rs index 1f2b383..d7dc798 100644 --- a/ctru-rs/examples/hello-both-screens.rs +++ b/ctru-rs/examples/hello-both-screens.rs @@ -5,8 +5,6 @@ use ctru::prelude::*; fn main() { - ctru::use_panic_handler(); - let apt = Apt::new().unwrap(); let mut hid = Hid::new().unwrap(); let gfx = Gfx::new().unwrap(); diff --git a/ctru-rs/examples/hello-world.rs b/ctru-rs/examples/hello-world.rs index 9210484..cab15f3 100644 --- a/ctru-rs/examples/hello-world.rs +++ b/ctru-rs/examples/hello-world.rs @@ -8,7 +8,6 @@ use std::io::BufWriter; fn main() { // Setup the custom panic handler in case any errors arise. // Thanks to it the user will get promptly notified of any panics. - ctru::use_panic_handler(); // Setup Graphics, Controller Inputs, Application runtime. // These is standard setup any app would need. diff --git a/ctru-rs/examples/linear-memory.rs b/ctru-rs/examples/linear-memory.rs index de653e6..8b386fb 100644 --- a/ctru-rs/examples/linear-memory.rs +++ b/ctru-rs/examples/linear-memory.rs @@ -10,8 +10,6 @@ use ctru::linear::LinearAllocator; use ctru::prelude::*; fn main() { - ctru::use_panic_handler(); - let gfx = Gfx::new().expect("Couldn't obtain GFX controller"); let mut hid = Hid::new().expect("Couldn't obtain HID controller"); let apt = Apt::new().expect("Couldn't obtain APT controller"); diff --git a/ctru-rs/examples/mii-selector.rs b/ctru-rs/examples/mii-selector.rs index 2987970..3b2b0ef 100644 --- a/ctru-rs/examples/mii-selector.rs +++ b/ctru-rs/examples/mii-selector.rs @@ -6,8 +6,6 @@ use ctru::applets::mii_selector::{Error, MiiSelector, Options}; use ctru::prelude::*; fn main() { - ctru::use_panic_handler(); - let gfx = Gfx::new().expect("Couldn't obtain GFX controller"); let mut hid = Hid::new().expect("Couldn't obtain HID controller"); let apt = Apt::new().expect("Couldn't obtain APT controller"); diff --git a/ctru-rs/examples/movement.rs b/ctru-rs/examples/movement.rs index fe5e764..af83488 100644 --- a/ctru-rs/examples/movement.rs +++ b/ctru-rs/examples/movement.rs @@ -5,8 +5,6 @@ use ctru::prelude::*; fn main() { - ctru::use_panic_handler(); - let gfx = Gfx::new().expect("Couldn't obtain GFX controller"); let mut hid = Hid::new().expect("Couldn't obtain HID controller"); let apt = Apt::new().expect("Couldn't obtain APT controller"); diff --git a/ctru-rs/examples/network-sockets.rs b/ctru-rs/examples/network-sockets.rs index d55e29c..9689500 100644 --- a/ctru-rs/examples/network-sockets.rs +++ b/ctru-rs/examples/network-sockets.rs @@ -9,8 +9,6 @@ use std::net::{Shutdown, TcpListener}; use std::time::Duration; fn main() { - ctru::use_panic_handler(); - let gfx = Gfx::new().unwrap(); let mut hid = Hid::new().unwrap(); let apt = Apt::new().unwrap(); diff --git a/ctru-rs/examples/output-3dslink.rs b/ctru-rs/examples/output-3dslink.rs index 9df3f3d..fb1194a 100644 --- a/ctru-rs/examples/output-3dslink.rs +++ b/ctru-rs/examples/output-3dslink.rs @@ -13,8 +13,6 @@ use ctru::prelude::*; fn main() { - ctru::use_panic_handler(); - let gfx = Gfx::new().expect("Couldn't obtain GFX controller"); let mut hid = Hid::new().expect("Couldn't obtain HID controller"); let apt = Apt::new().expect("Couldn't obtain APT controller"); diff --git a/ctru-rs/examples/romfs.rs b/ctru-rs/examples/romfs.rs index 490a785..e9c7f04 100644 --- a/ctru-rs/examples/romfs.rs +++ b/ctru-rs/examples/romfs.rs @@ -5,8 +5,6 @@ use ctru::prelude::*; fn main() { - ctru::use_panic_handler(); - let gfx = Gfx::new().expect("Couldn't obtain GFX controller"); let mut hid = Hid::new().expect("Couldn't obtain HID controller"); let apt = Apt::new().expect("Couldn't obtain APT controller"); diff --git a/ctru-rs/examples/software-keyboard.rs b/ctru-rs/examples/software-keyboard.rs index e754781..61c32db 100644 --- a/ctru-rs/examples/software-keyboard.rs +++ b/ctru-rs/examples/software-keyboard.rs @@ -6,8 +6,6 @@ use ctru::applets::swkbd::{Button, SoftwareKeyboard}; use ctru::prelude::*; fn main() { - ctru::use_panic_handler(); - let apt = Apt::new().unwrap(); let mut hid = Hid::new().unwrap(); let gfx = Gfx::new().unwrap(); diff --git a/ctru-rs/examples/system-configuration.rs b/ctru-rs/examples/system-configuration.rs index f1748f7..6060066 100644 --- a/ctru-rs/examples/system-configuration.rs +++ b/ctru-rs/examples/system-configuration.rs @@ -7,8 +7,6 @@ use ctru::prelude::*; use ctru::services::cfgu::Cfgu; fn main() { - ctru::use_panic_handler(); - let gfx = Gfx::new().expect("Couldn't obtain GFX controller"); let mut hid = Hid::new().expect("Couldn't obtain HID controller"); let apt = Apt::new().expect("Couldn't obtain APT controller"); diff --git a/ctru-rs/examples/thread-basic.rs b/ctru-rs/examples/thread-basic.rs index 3e4604b..58474ba 100644 --- a/ctru-rs/examples/thread-basic.rs +++ b/ctru-rs/examples/thread-basic.rs @@ -6,8 +6,6 @@ use std::os::horizon::thread::BuilderExt; use std::time::Duration; fn main() { - ctru::use_panic_handler(); - let apt = Apt::new().unwrap(); let mut hid = Hid::new().unwrap(); let gfx = Gfx::new().unwrap(); diff --git a/ctru-rs/examples/thread-info.rs b/ctru-rs/examples/thread-info.rs index 46d34d3..4069bc3 100644 --- a/ctru-rs/examples/thread-info.rs +++ b/ctru-rs/examples/thread-info.rs @@ -7,8 +7,6 @@ use ctru::prelude::*; use std::os::horizon::thread::BuilderExt; fn main() { - ctru::use_panic_handler(); - let gfx = Gfx::new().expect("Couldn't obtain GFX controller"); let mut hid = Hid::new().expect("Couldn't obtain HID controller"); let apt = Apt::new().expect("Couldn't obtain APT controller"); diff --git a/ctru-rs/examples/thread-locals.rs b/ctru-rs/examples/thread-locals.rs index 72458c9..50e24a3 100644 --- a/ctru-rs/examples/thread-locals.rs +++ b/ctru-rs/examples/thread-locals.rs @@ -10,8 +10,6 @@ std::thread_local! { } fn main() { - ctru::use_panic_handler(); - let gfx = Gfx::new().expect("Couldn't obtain GFX controller"); gfx.top_screen.borrow_mut().set_wide_mode(true); let mut hid = Hid::new().expect("Couldn't obtain HID controller"); diff --git a/ctru-rs/examples/time-rtc.rs b/ctru-rs/examples/time-rtc.rs index ca4709a..f05cd64 100644 --- a/ctru-rs/examples/time-rtc.rs +++ b/ctru-rs/examples/time-rtc.rs @@ -6,8 +6,6 @@ use ctru::prelude::*; fn main() { - ctru::use_panic_handler(); - let gfx = Gfx::new().expect("Couldn't obtain GFX controller"); let mut hid = Hid::new().expect("Couldn't obtain HID controller"); let apt = Apt::new().expect("Couldn't obtain APT controller"); diff --git a/ctru-rs/examples/title-info.rs b/ctru-rs/examples/title-info.rs index 4332750..03fe08f 100644 --- a/ctru-rs/examples/title-info.rs +++ b/ctru-rs/examples/title-info.rs @@ -8,8 +8,6 @@ use ctru::services::am::Am; use ctru::services::fs::FsMediaType; fn main() { - ctru::use_panic_handler(); - let gfx = Gfx::new().expect("Couldn't obtain GFX controller"); let mut hid = Hid::new().expect("Couldn't obtain HID controller"); let apt = Apt::new().expect("Couldn't obtain APT controller"); diff --git a/ctru-rs/examples/touch-screen.rs b/ctru-rs/examples/touch-screen.rs index fe2409d..8475eac 100644 --- a/ctru-rs/examples/touch-screen.rs +++ b/ctru-rs/examples/touch-screen.rs @@ -5,8 +5,6 @@ use ctru::prelude::*; fn main() { - ctru::use_panic_handler(); - let gfx = Gfx::new().expect("Couldn't obtain GFX controller"); let mut hid = Hid::new().expect("Couldn't obtain HID controller"); let apt = Apt::new().expect("Couldn't obtain APT controller"); diff --git a/ctru-rs/src/console.rs b/ctru-rs/src/console.rs index 5c9fba1..5a8c772 100644 --- a/ctru-rs/src/console.rs +++ b/ctru-rs/src/console.rs @@ -117,9 +117,6 @@ impl<'screen> Console<'screen> { /// This function is used to check whether one of the two screens has an existing (and selected) [`Console`], /// so that the program can be sure its output will be shown *somewhere*. /// - /// The main use of this is within the [`ctru::use_panic_handler()`](crate::use_panic_handler()) hook, - /// since it will only stop the program's execution if the user is able to see the panic information output on screen. - /// /// # Example /// /// ``` diff --git a/ctru-rs/src/lib.rs b/ctru-rs/src/lib.rs index f1569bb..58537ee 100644 --- a/ctru-rs/src/lib.rs +++ b/ctru-rs/src/lib.rs @@ -56,45 +56,6 @@ macro_rules! from_impl { }; } -/// Activate the custom [`ctru-rs`](crate) panic handler. -/// -/// With this implementation, the main thread will stop and try to print debug info to an available [`Console`](console::Console). -/// In case it fails to find an active [`Console`](console::Console) the program will just exit. -/// -/// # Notes -/// -/// When `test` is enabled, this function will not do anything, as its behaviour should be overridden by the `test` environment. -pub fn use_panic_handler() { - #[cfg(not(test))] - panic_hook_setup(); -} - -/// Internal protocol to activate the custom panic handler hook. -/// -/// # Notes -/// -/// When `test` is enabled, this function will be ignored. -#[cfg(not(test))] -fn panic_hook_setup() { - use std::panic::PanicInfo; - - let main_thread = std::thread::current().id(); - - // Panic Hook setup - let default_hook = std::panic::take_hook(); - let new_hook = Box::new(move |info: &PanicInfo| { - default_hook(info); - - // Only for panics in the main thread - if main_thread == std::thread::current().id() && console::Console::exists() { - println!("\nThe software will exit in 5 seconds"); - - std::thread::sleep(std::time::Duration::from_secs(5)); - } - }); - std::panic::set_hook(new_hook); -} - pub mod applets; pub mod console; pub mod error; From 1f72bfd9d8b97291fd1d4489934895803eaf1930 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Wed, 22 Nov 2023 20:32:15 +0100 Subject: [PATCH 101/101] remove reference to panic hook --- ctru-rs/examples/hello-world.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/ctru-rs/examples/hello-world.rs b/ctru-rs/examples/hello-world.rs index cab15f3..348f96d 100644 --- a/ctru-rs/examples/hello-world.rs +++ b/ctru-rs/examples/hello-world.rs @@ -6,9 +6,6 @@ use ctru::prelude::*; use std::io::BufWriter; fn main() { - // Setup the custom panic handler in case any errors arise. - // Thanks to it the user will get promptly notified of any panics. - // Setup Graphics, Controller Inputs, Application runtime. // These is standard setup any app would need. let gfx = Gfx::new().expect("Couldn't obtain GFX controller");