1#[repr(C)]
4#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
5pub struct __BindgenBitfieldUnit<Storage> {
6 storage: Storage,
7}
8impl<Storage> __BindgenBitfieldUnit<Storage> {
9 #[inline]
10 pub const fn new(storage: Storage) -> Self {
11 Self { storage }
12 }
13}
14impl<Storage> __BindgenBitfieldUnit<Storage>
15where
16 Storage: AsRef<[u8]> + AsMut<[u8]>,
17{
18 #[inline]
19 fn extract_bit(byte: u8, index: usize) -> bool {
20 let bit_index = if cfg!(target_endian = "big") {
21 7 - (index % 8)
22 } else {
23 index % 8
24 };
25 let mask = 1 << bit_index;
26 byte & mask == mask
27 }
28 #[inline]
29 pub fn get_bit(&self, index: usize) -> bool {
30 debug_assert!(index / 8 < self.storage.as_ref().len());
31 let byte_index = index / 8;
32 let byte = self.storage.as_ref()[byte_index];
33 Self::extract_bit(byte, index)
34 }
35 #[inline]
36 pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool {
37 debug_assert!(index / 8 < core::mem::size_of::<Storage>());
38 let byte_index = index / 8;
39 let byte = unsafe {
40 *(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize)
41 };
42 Self::extract_bit(byte, index)
43 }
44 #[inline]
45 fn change_bit(byte: u8, index: usize, val: bool) -> u8 {
46 let bit_index = if cfg!(target_endian = "big") {
47 7 - (index % 8)
48 } else {
49 index % 8
50 };
51 let mask = 1 << bit_index;
52 if val { byte | mask } else { byte & !mask }
53 }
54 #[inline]
55 pub fn set_bit(&mut self, index: usize, val: bool) {
56 debug_assert!(index / 8 < self.storage.as_ref().len());
57 let byte_index = index / 8;
58 let byte = &mut self.storage.as_mut()[byte_index];
59 *byte = Self::change_bit(*byte, index, val);
60 }
61 #[inline]
62 pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) {
63 debug_assert!(index / 8 < core::mem::size_of::<Storage>());
64 let byte_index = index / 8;
65 let byte = unsafe {
66 (core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize)
67 };
68 unsafe { *byte = Self::change_bit(*byte, index, val) };
69 }
70 #[inline]
71 pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
72 debug_assert!(bit_width <= 64);
73 debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
74 debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
75 let mut val = 0;
76 for i in 0..(bit_width as usize) {
77 if self.get_bit(i + bit_offset) {
78 let index = if cfg!(target_endian = "big") {
79 bit_width as usize - 1 - i
80 } else {
81 i
82 };
83 val |= 1 << index;
84 }
85 }
86 val
87 }
88 #[inline]
89 pub unsafe fn raw_get(this: *const Self, bit_offset: usize, bit_width: u8) -> u64 {
90 debug_assert!(bit_width <= 64);
91 debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
92 debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
93 let mut val = 0;
94 for i in 0..(bit_width as usize) {
95 if unsafe { Self::raw_get_bit(this, i + bit_offset) } {
96 let index = if cfg!(target_endian = "big") {
97 bit_width as usize - 1 - i
98 } else {
99 i
100 };
101 val |= 1 << index;
102 }
103 }
104 val
105 }
106 #[inline]
107 pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
108 debug_assert!(bit_width <= 64);
109 debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
110 debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
111 for i in 0..(bit_width as usize) {
112 let mask = 1 << i;
113 let val_bit_is_set = val & mask == mask;
114 let index = if cfg!(target_endian = "big") {
115 bit_width as usize - 1 - i
116 } else {
117 i
118 };
119 self.set_bit(index + bit_offset, val_bit_is_set);
120 }
121 }
122 #[inline]
123 pub unsafe fn raw_set(this: *mut Self, bit_offset: usize, bit_width: u8, val: u64) {
124 debug_assert!(bit_width <= 64);
125 debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
126 debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
127 for i in 0..(bit_width as usize) {
128 let mask = 1 << i;
129 let val_bit_is_set = val & mask == mask;
130 let index = if cfg!(target_endian = "big") {
131 bit_width as usize - 1 - i
132 } else {
133 i
134 };
135 unsafe { Self::raw_set_bit(this, index + bit_offset, val_bit_is_set) };
136 }
137 }
138}
139#[repr(C)]
140#[derive(Default)]
141pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
142impl<T> __IncompleteArrayField<T> {
143 #[inline]
144 pub const fn new() -> Self {
145 __IncompleteArrayField(::core::marker::PhantomData, [])
146 }
147 #[inline]
148 pub fn as_ptr(&self) -> *const T {
149 self as *const _ as *const T
150 }
151 #[inline]
152 pub fn as_mut_ptr(&mut self) -> *mut T {
153 self as *mut _ as *mut T
154 }
155 #[inline]
156 pub unsafe fn as_slice(&self, len: usize) -> &[T] {
157 unsafe { ::core::slice::from_raw_parts(self.as_ptr(), len) }
158 }
159 #[inline]
160 pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
161 unsafe { ::core::slice::from_raw_parts_mut(self.as_mut_ptr(), len) }
162 }
163}
164impl<T> ::core::fmt::Debug for __IncompleteArrayField<T> {
165 fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
166 fmt.write_str("__IncompleteArrayField")
167 }
168}
169#[repr(C)]
170pub struct __BindgenUnionField<T>(::core::marker::PhantomData<T>);
171impl<T> __BindgenUnionField<T> {
172 #[inline]
173 pub const fn new() -> Self {
174 __BindgenUnionField(::core::marker::PhantomData)
175 }
176 #[inline]
177 pub unsafe fn as_ref(&self) -> &T {
178 unsafe { ::core::mem::transmute(self) }
179 }
180 #[inline]
181 pub unsafe fn as_mut(&mut self) -> &mut T {
182 unsafe { ::core::mem::transmute(self) }
183 }
184}
185impl<T> ::core::default::Default for __BindgenUnionField<T> {
186 #[inline]
187 fn default() -> Self {
188 Self::new()
189 }
190}
191impl<T> ::core::clone::Clone for __BindgenUnionField<T> {
192 #[inline]
193 fn clone(&self) -> Self {
194 *self
195 }
196}
197impl<T> ::core::marker::Copy for __BindgenUnionField<T> {}
198impl<T> ::core::fmt::Debug for __BindgenUnionField<T> {
199 fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
200 fmt.write_str("__BindgenUnionField")
201 }
202}
203impl<T> ::core::hash::Hash for __BindgenUnionField<T> {
204 fn hash<H: ::core::hash::Hasher>(&self, _state: &mut H) {}
205}
206impl<T> ::core::cmp::PartialEq for __BindgenUnionField<T> {
207 fn eq(&self, _other: &__BindgenUnionField<T>) -> bool {
208 true
209 }
210}
211impl<T> ::core::cmp::Eq for __BindgenUnionField<T> {}
212pub const CUR_PROCESS_HANDLE: u32 = 4294934529;
213pub const ARBITRATION_SIGNAL_ALL: i32 = -1;
214pub const CUR_THREAD_HANDLE: u32 = 4294934528;
215pub const SYSCLOCK_SOC: u32 = 16756991;
216pub const SYSCLOCK_SYS: u32 = 33513982;
217pub const SYSCLOCK_SDMMC: u32 = 67027964;
218pub const SYSCLOCK_ARM9: u32 = 134055928;
219pub const SYSCLOCK_ARM11: u32 = 268111856;
220pub const SYSCLOCK_ARM11_LGR1: u32 = 536223712;
221pub const SYSCLOCK_ARM11_LGR2: u32 = 804335568;
222pub const SYSCLOCK_ARM11_NEW: u32 = 804335568;
223pub const CPU_TICKS_PER_MSEC: f64 = 268111.856;
224pub const CPU_TICKS_PER_USEC: f64 = 268.111856;
225pub const OS_HEAP_AREA_BEGIN: u32 = 134217728;
226pub const OS_HEAP_AREA_END: u32 = 234881024;
227pub const OS_MAP_AREA_BEGIN: u32 = 268435456;
228pub const OS_MAP_AREA_END: u32 = 335544320;
229pub const OS_OLD_FCRAM_VADDR: u32 = 335544320;
230pub const OS_OLD_FCRAM_PADDR: u32 = 536870912;
231pub const OS_OLD_FCRAM_SIZE: u32 = 134217728;
232pub const OS_QTMRAM_VADDR: u32 = 511705088;
233pub const OS_QTMRAM_PADDR: u32 = 520093696;
234pub const OS_QTMRAM_SIZE: u32 = 4194304;
235pub const OS_MMIO_VADDR: u32 = 515899392;
236pub const OS_MMIO_PADDR: u32 = 269484032;
237pub const OS_MMIO_SIZE: u32 = 4194304;
238pub const OS_VRAM_VADDR: u32 = 520093696;
239pub const OS_VRAM_PADDR: u32 = 402653184;
240pub const OS_VRAM_SIZE: u32 = 6291456;
241pub const OS_DSPRAM_VADDR: u32 = 535822336;
242pub const OS_DSPRAM_PADDR: u32 = 535822336;
243pub const OS_DSPRAM_SIZE: u32 = 524288;
244pub const OS_KERNELCFG_VADDR: u32 = 536346624;
245pub const OS_SHAREDCFG_VADDR: u32 = 536350720;
246pub const OS_FCRAM_VADDR: u32 = 805306368;
247pub const OS_FCRAM_PADDR: u32 = 536870912;
248pub const OS_FCRAM_SIZE: u32 = 268435456;
249pub const GSP_SCREEN_TOP: u32 = 0;
250pub const GSP_SCREEN_BOTTOM: u32 = 1;
251pub const GSP_SCREEN_WIDTH: u32 = 240;
252pub const GSP_SCREEN_HEIGHT_TOP: u32 = 400;
253pub const GSP_SCREEN_HEIGHT_TOP_2X: u32 = 800;
254pub const GSP_SCREEN_HEIGHT_BOTTOM: u32 = 320;
255pub const CONSOLE_COLOR_BOLD: u32 = 1;
256pub const CONSOLE_COLOR_FAINT: u32 = 2;
257pub const CONSOLE_ITALIC: u32 = 4;
258pub const CONSOLE_UNDERLINE: u32 = 8;
259pub const CONSOLE_BLINK_SLOW: u32 = 16;
260pub const CONSOLE_BLINK_FAST: u32 = 32;
261pub const CONSOLE_COLOR_REVERSE: u32 = 64;
262pub const CONSOLE_CONCEAL: u32 = 128;
263pub const CONSOLE_CROSSED_OUT: u32 = 256;
264pub const CONSOLE_FG_CUSTOM: u32 = 512;
265pub const CONSOLE_BG_CUSTOM: u32 = 1024;
266pub const CONSOLE_COLOR_FG_BRIGHT: u32 = 2048;
267pub const CONSOLE_COLOR_BG_BRIGHT: u32 = 4096;
268pub const MII_NAME_LEN: u32 = 11;
269pub const FRIEND_COMMENT_LEN: u32 = 17;
270pub const FRIEND_GAME_MODE_DESCRIPTION_LEN: u32 = 128;
271pub const NASC_INGAMESN_LEN: u32 = 12;
272pub const NASC_KEYHASH_LEN: u32 = 9;
273pub const NASC_SVC_LEN: u32 = 5;
274pub const FRIEND_LIST_SIZE: u32 = 100;
275pub const NFS_TYPESTR_LEN: u32 = 3;
276pub const ACCOUNT_ID_LEN: u32 = 17;
277pub const ACCOUNT_EMAIL_LEN: u32 = 257;
278pub const ACCOUNT_PASSWORD_LEN: u32 = 18;
279pub const ACT_NNAS_SUBDOMAIN_LEN: u32 = 33;
280pub const ACT_UUID_LEN: u32 = 16;
281pub const ACT_DEFAULT_ACCOUNT: u32 = 254;
282pub const ACT_UUID_REGULAR: i32 = -1;
283pub const ACT_UUID_CURRENT_PROCESS: i32 = -2;
284pub const ACT_TRANSFERABLE_ID_BASE_COMMON: u32 = 255;
285pub const ACT_TRANSFERABLE_ID_BASE_CURRENT_ACCOUNT: u32 = 254;
286pub const CSND_NUM_CHANNELS: u32 = 32;
287pub const HTTPC_RESULTCODE_DOWNLOADPENDING: u32 = 3628113963;
288pub const HTTPC_RESULTCODE_NOTFOUND: u32 = 3628113960;
289pub const HTTPC_RESULTCODE_TIMEDOUT: u32 = 3626016873;
290pub const UDS_MAXNODES: u32 = 16;
291pub const UDS_BROADCAST_NETWORKNODEID: u32 = 65535;
292pub const UDS_HOST_NETWORKNODEID: u32 = 1;
293pub const UDS_DEFAULT_RECVBUFSIZE: u32 = 11824;
294pub const UDS_DATAFRAME_MAXSIZE: u32 = 1478;
295pub const ROUTING_FLAG_G: u32 = 1;
296pub const TCP_STATE_CLOSED: u32 = 1;
297pub const TCP_STATE_LISTEN: u32 = 2;
298pub const TCP_STATE_ESTABLISHED: u32 = 5;
299pub const TCP_STATE_FINWAIT1: u32 = 6;
300pub const TCP_STATE_FINWAIT2: u32 = 7;
301pub const TCP_STATE_CLOSE_WAIT: u32 = 8;
302pub const TCP_STATE_LAST_ACK: u32 = 9;
303pub const TCP_STATE_TIME_WAIT: u32 = 11;
304pub const MVD_STATUS_OK: u32 = 94208;
305pub const MVD_STATUS_PARAMSET: u32 = 94209;
306pub const MVD_STATUS_BUSY: u32 = 94210;
307pub const MVD_STATUS_FRAMEREADY: u32 = 94211;
308pub const MVD_STATUS_INCOMPLETEPROCESSING: u32 = 94212;
309pub const MVD_STATUS_NALUPROCFLAG: u32 = 94215;
310pub const MVD_DEFAULT_WORKBUF_SIZE: u32 = 9438920;
311pub const MVD_CALC_WITH_LEVEL_FLAG_NONE: u32 = 0;
312pub const MVD_CALC_WITH_LEVEL_FLAG_ENABLE_CALC: u32 = 1;
313pub const MVD_CALC_WITH_LEVEL_FLAG_ENABLE_EXTRA_OP: u32 = 2;
314pub const MVD_CALC_WITH_LEVEL_FLAG_UNK: u32 = 4;
315pub const MVD_H264_LEVEL_1_0: u32 = 0;
316pub const MVD_H264_LEVEL_1_0B: u32 = 1;
317pub const MVD_H264_LEVEL_1_1: u32 = 2;
318pub const MVD_H264_LEVEL_1_2: u32 = 3;
319pub const MVD_H264_LEVEL_1_3: u32 = 4;
320pub const MVD_H264_LEVEL_2_0: u32 = 5;
321pub const MVD_H264_LEVEL_2_1: u32 = 6;
322pub const MVD_H264_LEVEL_2_2: u32 = 7;
323pub const MVD_H264_LEVEL_3_0: u32 = 8;
324pub const MVD_H264_LEVEL_3_1: u32 = 9;
325pub const MVD_H264_LEVEL_3_2: u32 = 10;
326pub const MVD_H264_LEVEL_4_0: u32 = 11;
327pub const MVD_H264_LEVEL_4_1: u32 = 12;
328pub const MVD_H264_LEVEL_4_2: u32 = 13;
329pub const MVD_H264_LEVEL_5_0: u32 = 14;
330pub const MVD_H264_LEVEL_5_1: u32 = 15;
331pub const MVD_H264_LEVEL_5_2: u32 = 16;
332pub const NFC_ERR_INVALID_STATE: u32 = 3366024704;
333pub const NFC_ERR_APPDATA_UNINITIALIZED: u32 = 3366024736;
334pub const NFC_ERR_AMIIBO_NOTSETUP: u32 = 3366024744;
335pub const NFC_ERR_APPID_MISMATCH: u32 = 3366024760;
336pub const NFC_ERR_DATACORRUPTION0: u32 = 3368121868;
337pub const NFC_ERR_DATACORRUPTION1: u32 = 3366024728;
338pub const NFC_STARTSCAN_DEFAULTINPUT: u32 = 0;
339pub const QTM_STATUS_CFG_BLK_ID: u32 = 1572864;
340pub const QTM_CAL_CFG_BLK_ID: u32 = 1572865;
341pub const GPUREG_0000: u32 = 0;
342pub const GPUREG_0001: u32 = 1;
343pub const GPUREG_0002: u32 = 2;
344pub const GPUREG_0003: u32 = 3;
345pub const GPUREG_0004: u32 = 4;
346pub const GPUREG_0005: u32 = 5;
347pub const GPUREG_0006: u32 = 6;
348pub const GPUREG_0007: u32 = 7;
349pub const GPUREG_0008: u32 = 8;
350pub const GPUREG_0009: u32 = 9;
351pub const GPUREG_000A: u32 = 10;
352pub const GPUREG_000B: u32 = 11;
353pub const GPUREG_000C: u32 = 12;
354pub const GPUREG_000D: u32 = 13;
355pub const GPUREG_000E: u32 = 14;
356pub const GPUREG_000F: u32 = 15;
357pub const GPUREG_FINALIZE: u32 = 16;
358pub const GPUREG_0011: u32 = 17;
359pub const GPUREG_0012: u32 = 18;
360pub const GPUREG_0013: u32 = 19;
361pub const GPUREG_0014: u32 = 20;
362pub const GPUREG_0015: u32 = 21;
363pub const GPUREG_0016: u32 = 22;
364pub const GPUREG_0017: u32 = 23;
365pub const GPUREG_0018: u32 = 24;
366pub const GPUREG_0019: u32 = 25;
367pub const GPUREG_001A: u32 = 26;
368pub const GPUREG_001B: u32 = 27;
369pub const GPUREG_001C: u32 = 28;
370pub const GPUREG_001D: u32 = 29;
371pub const GPUREG_001E: u32 = 30;
372pub const GPUREG_001F: u32 = 31;
373pub const GPUREG_0020: u32 = 32;
374pub const GPUREG_0021: u32 = 33;
375pub const GPUREG_0022: u32 = 34;
376pub const GPUREG_0023: u32 = 35;
377pub const GPUREG_0024: u32 = 36;
378pub const GPUREG_0025: u32 = 37;
379pub const GPUREG_0026: u32 = 38;
380pub const GPUREG_0027: u32 = 39;
381pub const GPUREG_0028: u32 = 40;
382pub const GPUREG_0029: u32 = 41;
383pub const GPUREG_002A: u32 = 42;
384pub const GPUREG_002B: u32 = 43;
385pub const GPUREG_002C: u32 = 44;
386pub const GPUREG_002D: u32 = 45;
387pub const GPUREG_002E: u32 = 46;
388pub const GPUREG_002F: u32 = 47;
389pub const GPUREG_0030: u32 = 48;
390pub const GPUREG_0031: u32 = 49;
391pub const GPUREG_0032: u32 = 50;
392pub const GPUREG_0033: u32 = 51;
393pub const GPUREG_0034: u32 = 52;
394pub const GPUREG_0035: u32 = 53;
395pub const GPUREG_0036: u32 = 54;
396pub const GPUREG_0037: u32 = 55;
397pub const GPUREG_0038: u32 = 56;
398pub const GPUREG_0039: u32 = 57;
399pub const GPUREG_003A: u32 = 58;
400pub const GPUREG_003B: u32 = 59;
401pub const GPUREG_003C: u32 = 60;
402pub const GPUREG_003D: u32 = 61;
403pub const GPUREG_003E: u32 = 62;
404pub const GPUREG_003F: u32 = 63;
405pub const GPUREG_FACECULLING_CONFIG: u32 = 64;
406pub const GPUREG_VIEWPORT_WIDTH: u32 = 65;
407pub const GPUREG_VIEWPORT_INVW: u32 = 66;
408pub const GPUREG_VIEWPORT_HEIGHT: u32 = 67;
409pub const GPUREG_VIEWPORT_INVH: u32 = 68;
410pub const GPUREG_0045: u32 = 69;
411pub const GPUREG_0046: u32 = 70;
412pub const GPUREG_FRAGOP_CLIP: u32 = 71;
413pub const GPUREG_FRAGOP_CLIP_DATA0: u32 = 72;
414pub const GPUREG_FRAGOP_CLIP_DATA1: u32 = 73;
415pub const GPUREG_FRAGOP_CLIP_DATA2: u32 = 74;
416pub const GPUREG_FRAGOP_CLIP_DATA3: u32 = 75;
417pub const GPUREG_004C: u32 = 76;
418pub const GPUREG_DEPTHMAP_SCALE: u32 = 77;
419pub const GPUREG_DEPTHMAP_OFFSET: u32 = 78;
420pub const GPUREG_SH_OUTMAP_TOTAL: u32 = 79;
421pub const GPUREG_SH_OUTMAP_O0: u32 = 80;
422pub const GPUREG_SH_OUTMAP_O1: u32 = 81;
423pub const GPUREG_SH_OUTMAP_O2: u32 = 82;
424pub const GPUREG_SH_OUTMAP_O3: u32 = 83;
425pub const GPUREG_SH_OUTMAP_O4: u32 = 84;
426pub const GPUREG_SH_OUTMAP_O5: u32 = 85;
427pub const GPUREG_SH_OUTMAP_O6: u32 = 86;
428pub const GPUREG_0057: u32 = 87;
429pub const GPUREG_0058: u32 = 88;
430pub const GPUREG_0059: u32 = 89;
431pub const GPUREG_005A: u32 = 90;
432pub const GPUREG_005B: u32 = 91;
433pub const GPUREG_005C: u32 = 92;
434pub const GPUREG_005D: u32 = 93;
435pub const GPUREG_005E: u32 = 94;
436pub const GPUREG_005F: u32 = 95;
437pub const GPUREG_0060: u32 = 96;
438pub const GPUREG_EARLYDEPTH_FUNC: u32 = 97;
439pub const GPUREG_EARLYDEPTH_TEST1: u32 = 98;
440pub const GPUREG_EARLYDEPTH_CLEAR: u32 = 99;
441pub const GPUREG_SH_OUTATTR_MODE: u32 = 100;
442pub const GPUREG_SCISSORTEST_MODE: u32 = 101;
443pub const GPUREG_SCISSORTEST_POS: u32 = 102;
444pub const GPUREG_SCISSORTEST_DIM: u32 = 103;
445pub const GPUREG_VIEWPORT_XY: u32 = 104;
446pub const GPUREG_0069: u32 = 105;
447pub const GPUREG_EARLYDEPTH_DATA: u32 = 106;
448pub const GPUREG_006B: u32 = 107;
449pub const GPUREG_006C: u32 = 108;
450pub const GPUREG_DEPTHMAP_ENABLE: u32 = 109;
451pub const GPUREG_RENDERBUF_DIM: u32 = 110;
452pub const GPUREG_SH_OUTATTR_CLOCK: u32 = 111;
453pub const GPUREG_0070: u32 = 112;
454pub const GPUREG_0071: u32 = 113;
455pub const GPUREG_0072: u32 = 114;
456pub const GPUREG_0073: u32 = 115;
457pub const GPUREG_0074: u32 = 116;
458pub const GPUREG_0075: u32 = 117;
459pub const GPUREG_0076: u32 = 118;
460pub const GPUREG_0077: u32 = 119;
461pub const GPUREG_0078: u32 = 120;
462pub const GPUREG_0079: u32 = 121;
463pub const GPUREG_007A: u32 = 122;
464pub const GPUREG_007B: u32 = 123;
465pub const GPUREG_007C: u32 = 124;
466pub const GPUREG_007D: u32 = 125;
467pub const GPUREG_007E: u32 = 126;
468pub const GPUREG_007F: u32 = 127;
469pub const GPUREG_TEXUNIT_CONFIG: u32 = 128;
470pub const GPUREG_TEXUNIT0_BORDER_COLOR: u32 = 129;
471pub const GPUREG_TEXUNIT0_DIM: u32 = 130;
472pub const GPUREG_TEXUNIT0_PARAM: u32 = 131;
473pub const GPUREG_TEXUNIT0_LOD: u32 = 132;
474pub const GPUREG_TEXUNIT0_ADDR1: u32 = 133;
475pub const GPUREG_TEXUNIT0_ADDR2: u32 = 134;
476pub const GPUREG_TEXUNIT0_ADDR3: u32 = 135;
477pub const GPUREG_TEXUNIT0_ADDR4: u32 = 136;
478pub const GPUREG_TEXUNIT0_ADDR5: u32 = 137;
479pub const GPUREG_TEXUNIT0_ADDR6: u32 = 138;
480pub const GPUREG_TEXUNIT0_SHADOW: u32 = 139;
481pub const GPUREG_008C: u32 = 140;
482pub const GPUREG_008D: u32 = 141;
483pub const GPUREG_TEXUNIT0_TYPE: u32 = 142;
484pub const GPUREG_LIGHTING_ENABLE0: u32 = 143;
485pub const GPUREG_0090: u32 = 144;
486pub const GPUREG_TEXUNIT1_BORDER_COLOR: u32 = 145;
487pub const GPUREG_TEXUNIT1_DIM: u32 = 146;
488pub const GPUREG_TEXUNIT1_PARAM: u32 = 147;
489pub const GPUREG_TEXUNIT1_LOD: u32 = 148;
490pub const GPUREG_TEXUNIT1_ADDR: u32 = 149;
491pub const GPUREG_TEXUNIT1_TYPE: u32 = 150;
492pub const GPUREG_0097: u32 = 151;
493pub const GPUREG_0098: u32 = 152;
494pub const GPUREG_TEXUNIT2_BORDER_COLOR: u32 = 153;
495pub const GPUREG_TEXUNIT2_DIM: u32 = 154;
496pub const GPUREG_TEXUNIT2_PARAM: u32 = 155;
497pub const GPUREG_TEXUNIT2_LOD: u32 = 156;
498pub const GPUREG_TEXUNIT2_ADDR: u32 = 157;
499pub const GPUREG_TEXUNIT2_TYPE: u32 = 158;
500pub const GPUREG_009F: u32 = 159;
501pub const GPUREG_00A0: u32 = 160;
502pub const GPUREG_00A1: u32 = 161;
503pub const GPUREG_00A2: u32 = 162;
504pub const GPUREG_00A3: u32 = 163;
505pub const GPUREG_00A4: u32 = 164;
506pub const GPUREG_00A5: u32 = 165;
507pub const GPUREG_00A6: u32 = 166;
508pub const GPUREG_00A7: u32 = 167;
509pub const GPUREG_TEXUNIT3_PROCTEX0: u32 = 168;
510pub const GPUREG_TEXUNIT3_PROCTEX1: u32 = 169;
511pub const GPUREG_TEXUNIT3_PROCTEX2: u32 = 170;
512pub const GPUREG_TEXUNIT3_PROCTEX3: u32 = 171;
513pub const GPUREG_TEXUNIT3_PROCTEX4: u32 = 10;
514pub const GPUREG_TEXUNIT3_PROCTEX5: u32 = 13;
515pub const GPUREG_00AE: u32 = 174;
516pub const GPUREG_PROCTEX_LUT: u32 = 175;
517pub const GPUREG_PROCTEX_LUT_DATA0: u32 = 176;
518pub const GPUREG_PROCTEX_LUT_DATA1: u32 = 177;
519pub const GPUREG_PROCTEX_LUT_DATA2: u32 = 178;
520pub const GPUREG_PROCTEX_LUT_DATA3: u32 = 179;
521pub const GPUREG_PROCTEX_LUT_DATA4: u32 = 180;
522pub const GPUREG_PROCTEX_LUT_DATA5: u32 = 181;
523pub const GPUREG_PROCTEX_LUT_DATA6: u32 = 182;
524pub const GPUREG_PROCTEX_LUT_DATA7: u32 = 183;
525pub const GPUREG_00B8: u32 = 184;
526pub const GPUREG_00B9: u32 = 185;
527pub const GPUREG_00BA: u32 = 186;
528pub const GPUREG_00BB: u32 = 187;
529pub const GPUREG_00BC: u32 = 188;
530pub const GPUREG_00BD: u32 = 189;
531pub const GPUREG_00BE: u32 = 190;
532pub const GPUREG_00BF: u32 = 191;
533pub const GPUREG_TEXENV0_SOURCE: u32 = 192;
534pub const GPUREG_TEXENV0_OPERAND: u32 = 193;
535pub const GPUREG_TEXENV0_COMBINER: u32 = 194;
536pub const GPUREG_TEXENV0_COLOR: u32 = 195;
537pub const GPUREG_TEXENV0_SCALE: u32 = 196;
538pub const GPUREG_00C5: u32 = 197;
539pub const GPUREG_00C6: u32 = 198;
540pub const GPUREG_00C7: u32 = 199;
541pub const GPUREG_TEXENV1_SOURCE: u32 = 200;
542pub const GPUREG_TEXENV1_OPERAND: u32 = 201;
543pub const GPUREG_TEXENV1_COMBINER: u32 = 202;
544pub const GPUREG_TEXENV1_COLOR: u32 = 203;
545pub const GPUREG_TEXENV1_SCALE: u32 = 204;
546pub const GPUREG_00CD: u32 = 205;
547pub const GPUREG_00CE: u32 = 206;
548pub const GPUREG_00CF: u32 = 207;
549pub const GPUREG_TEXENV2_SOURCE: u32 = 208;
550pub const GPUREG_TEXENV2_OPERAND: u32 = 209;
551pub const GPUREG_TEXENV2_COMBINER: u32 = 210;
552pub const GPUREG_TEXENV2_COLOR: u32 = 211;
553pub const GPUREG_TEXENV2_SCALE: u32 = 212;
554pub const GPUREG_00D5: u32 = 213;
555pub const GPUREG_00D6: u32 = 214;
556pub const GPUREG_00D7: u32 = 215;
557pub const GPUREG_TEXENV3_SOURCE: u32 = 216;
558pub const GPUREG_TEXENV3_OPERAND: u32 = 217;
559pub const GPUREG_TEXENV3_COMBINER: u32 = 218;
560pub const GPUREG_TEXENV3_COLOR: u32 = 219;
561pub const GPUREG_TEXENV3_SCALE: u32 = 220;
562pub const GPUREG_00DD: u32 = 221;
563pub const GPUREG_00DE: u32 = 222;
564pub const GPUREG_00DF: u32 = 223;
565pub const GPUREG_TEXENV_UPDATE_BUFFER: u32 = 224;
566pub const GPUREG_FOG_COLOR: u32 = 225;
567pub const GPUREG_00E2: u32 = 226;
568pub const GPUREG_00E3: u32 = 227;
569pub const GPUREG_GAS_ATTENUATION: u32 = 228;
570pub const GPUREG_GAS_ACCMAX: u32 = 229;
571pub const GPUREG_FOG_LUT_INDEX: u32 = 230;
572pub const GPUREG_00E7: u32 = 231;
573pub const GPUREG_FOG_LUT_DATA0: u32 = 232;
574pub const GPUREG_FOG_LUT_DATA1: u32 = 233;
575pub const GPUREG_FOG_LUT_DATA2: u32 = 234;
576pub const GPUREG_FOG_LUT_DATA3: u32 = 235;
577pub const GPUREG_FOG_LUT_DATA4: u32 = 236;
578pub const GPUREG_FOG_LUT_DATA5: u32 = 237;
579pub const GPUREG_FOG_LUT_DATA6: u32 = 238;
580pub const GPUREG_FOG_LUT_DATA7: u32 = 239;
581pub const GPUREG_TEXENV4_SOURCE: u32 = 240;
582pub const GPUREG_TEXENV4_OPERAND: u32 = 241;
583pub const GPUREG_TEXENV4_COMBINER: u32 = 242;
584pub const GPUREG_TEXENV4_COLOR: u32 = 243;
585pub const GPUREG_TEXENV4_SCALE: u32 = 244;
586pub const GPUREG_00F5: u32 = 245;
587pub const GPUREG_00F6: u32 = 246;
588pub const GPUREG_00F7: u32 = 247;
589pub const GPUREG_TEXENV5_SOURCE: u32 = 248;
590pub const GPUREG_TEXENV5_OPERAND: u32 = 249;
591pub const GPUREG_TEXENV5_COMBINER: u32 = 250;
592pub const GPUREG_TEXENV5_COLOR: u32 = 251;
593pub const GPUREG_TEXENV5_SCALE: u32 = 252;
594pub const GPUREG_TEXENV_BUFFER_COLOR: u32 = 253;
595pub const GPUREG_00FE: u32 = 254;
596pub const GPUREG_00FF: u32 = 255;
597pub const GPUREG_COLOR_OPERATION: u32 = 256;
598pub const GPUREG_BLEND_FUNC: u32 = 257;
599pub const GPUREG_LOGIC_OP: u32 = 258;
600pub const GPUREG_BLEND_COLOR: u32 = 259;
601pub const GPUREG_FRAGOP_ALPHA_TEST: u32 = 260;
602pub const GPUREG_STENCIL_TEST: u32 = 261;
603pub const GPUREG_STENCIL_OP: u32 = 262;
604pub const GPUREG_DEPTH_COLOR_MASK: u32 = 263;
605pub const GPUREG_0108: u32 = 264;
606pub const GPUREG_0109: u32 = 265;
607pub const GPUREG_010A: u32 = 266;
608pub const GPUREG_010B: u32 = 267;
609pub const GPUREG_010C: u32 = 268;
610pub const GPUREG_010D: u32 = 269;
611pub const GPUREG_010E: u32 = 270;
612pub const GPUREG_010F: u32 = 271;
613pub const GPUREG_FRAMEBUFFER_INVALIDATE: u32 = 272;
614pub const GPUREG_FRAMEBUFFER_FLUSH: u32 = 273;
615pub const GPUREG_COLORBUFFER_READ: u32 = 274;
616pub const GPUREG_COLORBUFFER_WRITE: u32 = 275;
617pub const GPUREG_DEPTHBUFFER_READ: u32 = 276;
618pub const GPUREG_DEPTHBUFFER_WRITE: u32 = 277;
619pub const GPUREG_DEPTHBUFFER_FORMAT: u32 = 278;
620pub const GPUREG_COLORBUFFER_FORMAT: u32 = 279;
621pub const GPUREG_EARLYDEPTH_TEST2: u32 = 280;
622pub const GPUREG_0119: u32 = 281;
623pub const GPUREG_011A: u32 = 282;
624pub const GPUREG_FRAMEBUFFER_BLOCK32: u32 = 283;
625pub const GPUREG_DEPTHBUFFER_LOC: u32 = 284;
626pub const GPUREG_COLORBUFFER_LOC: u32 = 285;
627pub const GPUREG_FRAMEBUFFER_DIM: u32 = 286;
628pub const GPUREG_011F: u32 = 287;
629pub const GPUREG_GAS_LIGHT_XY: u32 = 288;
630pub const GPUREG_GAS_LIGHT_Z: u32 = 289;
631pub const GPUREG_GAS_LIGHT_Z_COLOR: u32 = 290;
632pub const GPUREG_GAS_LUT_INDEX: u32 = 291;
633pub const GPUREG_GAS_LUT_DATA: u32 = 292;
634pub const GPUREG_GAS_ACCMAX_FEEDBACK: u32 = 293;
635pub const GPUREG_GAS_DELTAZ_DEPTH: u32 = 294;
636pub const GPUREG_0127: u32 = 295;
637pub const GPUREG_0128: u32 = 296;
638pub const GPUREG_0129: u32 = 297;
639pub const GPUREG_012A: u32 = 298;
640pub const GPUREG_012B: u32 = 299;
641pub const GPUREG_012C: u32 = 300;
642pub const GPUREG_012D: u32 = 301;
643pub const GPUREG_012E: u32 = 302;
644pub const GPUREG_012F: u32 = 303;
645pub const GPUREG_FRAGOP_SHADOW: u32 = 304;
646pub const GPUREG_0131: u32 = 305;
647pub const GPUREG_0132: u32 = 306;
648pub const GPUREG_0133: u32 = 307;
649pub const GPUREG_0134: u32 = 308;
650pub const GPUREG_0135: u32 = 309;
651pub const GPUREG_0136: u32 = 310;
652pub const GPUREG_0137: u32 = 311;
653pub const GPUREG_0138: u32 = 312;
654pub const GPUREG_0139: u32 = 313;
655pub const GPUREG_013A: u32 = 314;
656pub const GPUREG_013B: u32 = 315;
657pub const GPUREG_013C: u32 = 316;
658pub const GPUREG_013D: u32 = 317;
659pub const GPUREG_013E: u32 = 318;
660pub const GPUREG_013F: u32 = 319;
661pub const GPUREG_LIGHT0_SPECULAR0: u32 = 320;
662pub const GPUREG_LIGHT0_SPECULAR1: u32 = 321;
663pub const GPUREG_LIGHT0_DIFFUSE: u32 = 322;
664pub const GPUREG_LIGHT0_AMBIENT: u32 = 323;
665pub const GPUREG_LIGHT0_XY: u32 = 324;
666pub const GPUREG_LIGHT0_Z: u32 = 325;
667pub const GPUREG_LIGHT0_SPOTDIR_XY: u32 = 326;
668pub const GPUREG_LIGHT0_SPOTDIR_Z: u32 = 327;
669pub const GPUREG_0148: u32 = 328;
670pub const GPUREG_LIGHT0_CONFIG: u32 = 329;
671pub const GPUREG_LIGHT0_ATTENUATION_BIAS: u32 = 330;
672pub const GPUREG_LIGHT0_ATTENUATION_SCALE: u32 = 331;
673pub const GPUREG_014C: u32 = 332;
674pub const GPUREG_014D: u32 = 333;
675pub const GPUREG_014E: u32 = 334;
676pub const GPUREG_014F: u32 = 335;
677pub const GPUREG_LIGHT1_SPECULAR0: u32 = 336;
678pub const GPUREG_LIGHT1_SPECULAR1: u32 = 337;
679pub const GPUREG_LIGHT1_DIFFUSE: u32 = 338;
680pub const GPUREG_LIGHT1_AMBIENT: u32 = 339;
681pub const GPUREG_LIGHT1_XY: u32 = 340;
682pub const GPUREG_LIGHT1_Z: u32 = 341;
683pub const GPUREG_LIGHT1_SPOTDIR_XY: u32 = 342;
684pub const GPUREG_LIGHT1_SPOTDIR_Z: u32 = 343;
685pub const GPUREG_0158: u32 = 344;
686pub const GPUREG_LIGHT1_CONFIG: u32 = 345;
687pub const GPUREG_LIGHT1_ATTENUATION_BIAS: u32 = 346;
688pub const GPUREG_LIGHT1_ATTENUATION_SCALE: u32 = 347;
689pub const GPUREG_015C: u32 = 348;
690pub const GPUREG_015D: u32 = 349;
691pub const GPUREG_015E: u32 = 350;
692pub const GPUREG_015F: u32 = 351;
693pub const GPUREG_LIGHT2_SPECULAR0: u32 = 352;
694pub const GPUREG_LIGHT2_SPECULAR1: u32 = 353;
695pub const GPUREG_LIGHT2_DIFFUSE: u32 = 354;
696pub const GPUREG_LIGHT2_AMBIENT: u32 = 355;
697pub const GPUREG_LIGHT2_XY: u32 = 356;
698pub const GPUREG_LIGHT2_Z: u32 = 357;
699pub const GPUREG_LIGHT2_SPOTDIR_XY: u32 = 358;
700pub const GPUREG_LIGHT2_SPOTDIR_Z: u32 = 359;
701pub const GPUREG_0168: u32 = 360;
702pub const GPUREG_LIGHT2_CONFIG: u32 = 361;
703pub const GPUREG_LIGHT2_ATTENUATION_BIAS: u32 = 362;
704pub const GPUREG_LIGHT2_ATTENUATION_SCALE: u32 = 363;
705pub const GPUREG_016C: u32 = 364;
706pub const GPUREG_016D: u32 = 365;
707pub const GPUREG_016E: u32 = 366;
708pub const GPUREG_016F: u32 = 367;
709pub const GPUREG_LIGHT3_SPECULAR0: u32 = 368;
710pub const GPUREG_LIGHT3_SPECULAR1: u32 = 369;
711pub const GPUREG_LIGHT3_DIFFUSE: u32 = 370;
712pub const GPUREG_LIGHT3_AMBIENT: u32 = 371;
713pub const GPUREG_LIGHT3_XY: u32 = 372;
714pub const GPUREG_LIGHT3_Z: u32 = 373;
715pub const GPUREG_LIGHT3_SPOTDIR_XY: u32 = 374;
716pub const GPUREG_LIGHT3_SPOTDIR_Z: u32 = 375;
717pub const GPUREG_0178: u32 = 376;
718pub const GPUREG_LIGHT3_CONFIG: u32 = 377;
719pub const GPUREG_LIGHT3_ATTENUATION_BIAS: u32 = 378;
720pub const GPUREG_LIGHT3_ATTENUATION_SCALE: u32 = 379;
721pub const GPUREG_017C: u32 = 380;
722pub const GPUREG_017D: u32 = 381;
723pub const GPUREG_017E: u32 = 382;
724pub const GPUREG_017F: u32 = 383;
725pub const GPUREG_LIGHT4_SPECULAR0: u32 = 384;
726pub const GPUREG_LIGHT4_SPECULAR1: u32 = 385;
727pub const GPUREG_LIGHT4_DIFFUSE: u32 = 386;
728pub const GPUREG_LIGHT4_AMBIENT: u32 = 387;
729pub const GPUREG_LIGHT4_XY: u32 = 388;
730pub const GPUREG_LIGHT4_Z: u32 = 389;
731pub const GPUREG_LIGHT4_SPOTDIR_XY: u32 = 390;
732pub const GPUREG_LIGHT4_SPOTDIR_Z: u32 = 391;
733pub const GPUREG_0188: u32 = 392;
734pub const GPUREG_LIGHT4_CONFIG: u32 = 393;
735pub const GPUREG_LIGHT4_ATTENUATION_BIAS: u32 = 394;
736pub const GPUREG_LIGHT4_ATTENUATION_SCALE: u32 = 395;
737pub const GPUREG_018C: u32 = 396;
738pub const GPUREG_018D: u32 = 397;
739pub const GPUREG_018E: u32 = 398;
740pub const GPUREG_018F: u32 = 399;
741pub const GPUREG_LIGHT5_SPECULAR0: u32 = 400;
742pub const GPUREG_LIGHT5_SPECULAR1: u32 = 401;
743pub const GPUREG_LIGHT5_DIFFUSE: u32 = 402;
744pub const GPUREG_LIGHT5_AMBIENT: u32 = 403;
745pub const GPUREG_LIGHT5_XY: u32 = 404;
746pub const GPUREG_LIGHT5_Z: u32 = 405;
747pub const GPUREG_LIGHT5_SPOTDIR_XY: u32 = 406;
748pub const GPUREG_LIGHT5_SPOTDIR_Z: u32 = 407;
749pub const GPUREG_0198: u32 = 408;
750pub const GPUREG_LIGHT5_CONFIG: u32 = 409;
751pub const GPUREG_LIGHT5_ATTENUATION_BIAS: u32 = 410;
752pub const GPUREG_LIGHT5_ATTENUATION_SCALE: u32 = 411;
753pub const GPUREG_019C: u32 = 412;
754pub const GPUREG_019D: u32 = 413;
755pub const GPUREG_019E: u32 = 414;
756pub const GPUREG_019F: u32 = 415;
757pub const GPUREG_LIGHT6_SPECULAR0: u32 = 416;
758pub const GPUREG_LIGHT6_SPECULAR1: u32 = 417;
759pub const GPUREG_LIGHT6_DIFFUSE: u32 = 418;
760pub const GPUREG_LIGHT6_AMBIENT: u32 = 419;
761pub const GPUREG_LIGHT6_XY: u32 = 420;
762pub const GPUREG_LIGHT6_Z: u32 = 421;
763pub const GPUREG_LIGHT6_SPOTDIR_XY: u32 = 422;
764pub const GPUREG_LIGHT6_SPOTDIR_Z: u32 = 423;
765pub const GPUREG_01A8: u32 = 424;
766pub const GPUREG_LIGHT6_CONFIG: u32 = 425;
767pub const GPUREG_LIGHT6_ATTENUATION_BIAS: u32 = 426;
768pub const GPUREG_LIGHT6_ATTENUATION_SCALE: u32 = 427;
769pub const GPUREG_01AC: u32 = 428;
770pub const GPUREG_01AD: u32 = 429;
771pub const GPUREG_01AE: u32 = 430;
772pub const GPUREG_01AF: u32 = 431;
773pub const GPUREG_LIGHT7_SPECULAR0: u32 = 432;
774pub const GPUREG_LIGHT7_SPECULAR1: u32 = 433;
775pub const GPUREG_LIGHT7_DIFFUSE: u32 = 434;
776pub const GPUREG_LIGHT7_AMBIENT: u32 = 435;
777pub const GPUREG_LIGHT7_XY: u32 = 436;
778pub const GPUREG_LIGHT7_Z: u32 = 437;
779pub const GPUREG_LIGHT7_SPOTDIR_XY: u32 = 438;
780pub const GPUREG_LIGHT7_SPOTDIR_Z: u32 = 439;
781pub const GPUREG_01B8: u32 = 440;
782pub const GPUREG_LIGHT7_CONFIG: u32 = 441;
783pub const GPUREG_LIGHT7_ATTENUATION_BIAS: u32 = 442;
784pub const GPUREG_LIGHT7_ATTENUATION_SCALE: u32 = 443;
785pub const GPUREG_01BC: u32 = 444;
786pub const GPUREG_01BD: u32 = 445;
787pub const GPUREG_01BE: u32 = 446;
788pub const GPUREG_01BF: u32 = 447;
789pub const GPUREG_LIGHTING_AMBIENT: u32 = 448;
790pub const GPUREG_01C1: u32 = 449;
791pub const GPUREG_LIGHTING_NUM_LIGHTS: u32 = 450;
792pub const GPUREG_LIGHTING_CONFIG0: u32 = 451;
793pub const GPUREG_LIGHTING_CONFIG1: u32 = 452;
794pub const GPUREG_LIGHTING_LUT_INDEX: u32 = 453;
795pub const GPUREG_LIGHTING_ENABLE1: u32 = 454;
796pub const GPUREG_01C7: u32 = 455;
797pub const GPUREG_LIGHTING_LUT_DATA0: u32 = 456;
798pub const GPUREG_LIGHTING_LUT_DATA1: u32 = 457;
799pub const GPUREG_LIGHTING_LUT_DATA2: u32 = 458;
800pub const GPUREG_LIGHTING_LUT_DATA3: u32 = 459;
801pub const GPUREG_LIGHTING_LUT_DATA4: u32 = 460;
802pub const GPUREG_LIGHTING_LUT_DATA5: u32 = 461;
803pub const GPUREG_LIGHTING_LUT_DATA6: u32 = 462;
804pub const GPUREG_LIGHTING_LUT_DATA7: u32 = 463;
805pub const GPUREG_LIGHTING_LUTINPUT_ABS: u32 = 464;
806pub const GPUREG_LIGHTING_LUTINPUT_SELECT: u32 = 465;
807pub const GPUREG_LIGHTING_LUTINPUT_SCALE: u32 = 466;
808pub const GPUREG_01D3: u32 = 467;
809pub const GPUREG_01D4: u32 = 468;
810pub const GPUREG_01D5: u32 = 469;
811pub const GPUREG_01D6: u32 = 470;
812pub const GPUREG_01D7: u32 = 471;
813pub const GPUREG_01D8: u32 = 472;
814pub const GPUREG_LIGHTING_LIGHT_PERMUTATION: u32 = 473;
815pub const GPUREG_01DA: u32 = 474;
816pub const GPUREG_01DB: u32 = 475;
817pub const GPUREG_01DC: u32 = 476;
818pub const GPUREG_01DD: u32 = 477;
819pub const GPUREG_01DE: u32 = 478;
820pub const GPUREG_01DF: u32 = 479;
821pub const GPUREG_01E0: u32 = 480;
822pub const GPUREG_01E1: u32 = 481;
823pub const GPUREG_01E2: u32 = 482;
824pub const GPUREG_01E3: u32 = 483;
825pub const GPUREG_01E4: u32 = 484;
826pub const GPUREG_01E5: u32 = 485;
827pub const GPUREG_01E6: u32 = 486;
828pub const GPUREG_01E7: u32 = 487;
829pub const GPUREG_01E8: u32 = 488;
830pub const GPUREG_01E9: u32 = 489;
831pub const GPUREG_01EA: u32 = 490;
832pub const GPUREG_01EB: u32 = 491;
833pub const GPUREG_01EC: u32 = 492;
834pub const GPUREG_01ED: u32 = 493;
835pub const GPUREG_01EE: u32 = 494;
836pub const GPUREG_01EF: u32 = 495;
837pub const GPUREG_01F0: u32 = 496;
838pub const GPUREG_01F1: u32 = 497;
839pub const GPUREG_01F2: u32 = 498;
840pub const GPUREG_01F3: u32 = 499;
841pub const GPUREG_01F4: u32 = 500;
842pub const GPUREG_01F5: u32 = 501;
843pub const GPUREG_01F6: u32 = 502;
844pub const GPUREG_01F7: u32 = 503;
845pub const GPUREG_01F8: u32 = 504;
846pub const GPUREG_01F9: u32 = 505;
847pub const GPUREG_01FA: u32 = 506;
848pub const GPUREG_01FB: u32 = 507;
849pub const GPUREG_01FC: u32 = 508;
850pub const GPUREG_01FD: u32 = 509;
851pub const GPUREG_01FE: u32 = 510;
852pub const GPUREG_01FF: u32 = 511;
853pub const GPUREG_ATTRIBBUFFERS_LOC: u32 = 512;
854pub const GPUREG_ATTRIBBUFFERS_FORMAT_LOW: u32 = 513;
855pub const GPUREG_ATTRIBBUFFERS_FORMAT_HIGH: u32 = 514;
856pub const GPUREG_ATTRIBBUFFER0_OFFSET: u32 = 515;
857pub const GPUREG_ATTRIBBUFFER0_CONFIG1: u32 = 516;
858pub const GPUREG_ATTRIBBUFFER0_CONFIG2: u32 = 517;
859pub const GPUREG_ATTRIBBUFFER1_OFFSET: u32 = 518;
860pub const GPUREG_ATTRIBBUFFER1_CONFIG1: u32 = 519;
861pub const GPUREG_ATTRIBBUFFER1_CONFIG2: u32 = 520;
862pub const GPUREG_ATTRIBBUFFER2_OFFSET: u32 = 521;
863pub const GPUREG_ATTRIBBUFFER2_CONFIG1: u32 = 522;
864pub const GPUREG_ATTRIBBUFFER2_CONFIG2: u32 = 523;
865pub const GPUREG_ATTRIBBUFFER3_OFFSET: u32 = 524;
866pub const GPUREG_ATTRIBBUFFER3_CONFIG1: u32 = 525;
867pub const GPUREG_ATTRIBBUFFER3_CONFIG2: u32 = 526;
868pub const GPUREG_ATTRIBBUFFER4_OFFSET: u32 = 527;
869pub const GPUREG_ATTRIBBUFFER4_CONFIG1: u32 = 528;
870pub const GPUREG_ATTRIBBUFFER4_CONFIG2: u32 = 529;
871pub const GPUREG_ATTRIBBUFFER5_OFFSET: u32 = 530;
872pub const GPUREG_ATTRIBBUFFER5_CONFIG1: u32 = 531;
873pub const GPUREG_ATTRIBBUFFER5_CONFIG2: u32 = 532;
874pub const GPUREG_ATTRIBBUFFER6_OFFSET: u32 = 533;
875pub const GPUREG_ATTRIBBUFFER6_CONFIG1: u32 = 534;
876pub const GPUREG_ATTRIBBUFFER6_CONFIG2: u32 = 535;
877pub const GPUREG_ATTRIBBUFFER7_OFFSET: u32 = 536;
878pub const GPUREG_ATTRIBBUFFER7_CONFIG1: u32 = 537;
879pub const GPUREG_ATTRIBBUFFER7_CONFIG2: u32 = 538;
880pub const GPUREG_ATTRIBBUFFER8_OFFSET: u32 = 539;
881pub const GPUREG_ATTRIBBUFFER8_CONFIG1: u32 = 540;
882pub const GPUREG_ATTRIBBUFFER8_CONFIG2: u32 = 541;
883pub const GPUREG_ATTRIBBUFFER9_OFFSET: u32 = 542;
884pub const GPUREG_ATTRIBBUFFER9_CONFIG1: u32 = 543;
885pub const GPUREG_ATTRIBBUFFER9_CONFIG2: u32 = 544;
886pub const GPUREG_ATTRIBBUFFERA_OFFSET: u32 = 545;
887pub const GPUREG_ATTRIBBUFFERA_CONFIG1: u32 = 546;
888pub const GPUREG_ATTRIBBUFFERA_CONFIG2: u32 = 547;
889pub const GPUREG_ATTRIBBUFFERB_OFFSET: u32 = 548;
890pub const GPUREG_ATTRIBBUFFERB_CONFIG1: u32 = 549;
891pub const GPUREG_ATTRIBBUFFERB_CONFIG2: u32 = 550;
892pub const GPUREG_INDEXBUFFER_CONFIG: u32 = 551;
893pub const GPUREG_NUMVERTICES: u32 = 552;
894pub const GPUREG_GEOSTAGE_CONFIG: u32 = 553;
895pub const GPUREG_VERTEX_OFFSET: u32 = 554;
896pub const GPUREG_022B: u32 = 555;
897pub const GPUREG_022C: u32 = 556;
898pub const GPUREG_POST_VERTEX_CACHE_NUM: u32 = 557;
899pub const GPUREG_DRAWARRAYS: u32 = 558;
900pub const GPUREG_DRAWELEMENTS: u32 = 559;
901pub const GPUREG_0230: u32 = 560;
902pub const GPUREG_VTX_FUNC: u32 = 561;
903pub const GPUREG_FIXEDATTRIB_INDEX: u32 = 562;
904pub const GPUREG_FIXEDATTRIB_DATA0: u32 = 563;
905pub const GPUREG_FIXEDATTRIB_DATA1: u32 = 564;
906pub const GPUREG_FIXEDATTRIB_DATA2: u32 = 565;
907pub const GPUREG_0236: u32 = 566;
908pub const GPUREG_0237: u32 = 567;
909pub const GPUREG_CMDBUF_SIZE0: u32 = 568;
910pub const GPUREG_CMDBUF_SIZE1: u32 = 569;
911pub const GPUREG_CMDBUF_ADDR0: u32 = 570;
912pub const GPUREG_CMDBUF_ADDR1: u32 = 571;
913pub const GPUREG_CMDBUF_JUMP0: u32 = 572;
914pub const GPUREG_CMDBUF_JUMP1: u32 = 573;
915pub const GPUREG_023E: u32 = 574;
916pub const GPUREG_023F: u32 = 575;
917pub const GPUREG_0240: u32 = 576;
918pub const GPUREG_0241: u32 = 577;
919pub const GPUREG_VSH_NUM_ATTR: u32 = 578;
920pub const GPUREG_0243: u32 = 579;
921pub const GPUREG_VSH_COM_MODE: u32 = 580;
922pub const GPUREG_START_DRAW_FUNC0: u32 = 581;
923pub const GPUREG_0246: u32 = 582;
924pub const GPUREG_0247: u32 = 583;
925pub const GPUREG_0248: u32 = 584;
926pub const GPUREG_0249: u32 = 585;
927pub const GPUREG_VSH_OUTMAP_TOTAL1: u32 = 586;
928pub const GPUREG_024B: u32 = 587;
929pub const GPUREG_024C: u32 = 588;
930pub const GPUREG_024D: u32 = 589;
931pub const GPUREG_024E: u32 = 590;
932pub const GPUREG_024F: u32 = 591;
933pub const GPUREG_0250: u32 = 592;
934pub const GPUREG_VSH_OUTMAP_TOTAL2: u32 = 593;
935pub const GPUREG_GSH_MISC0: u32 = 594;
936pub const GPUREG_GEOSTAGE_CONFIG2: u32 = 595;
937pub const GPUREG_GSH_MISC1: u32 = 596;
938pub const GPUREG_0255: u32 = 597;
939pub const GPUREG_0256: u32 = 598;
940pub const GPUREG_0257: u32 = 599;
941pub const GPUREG_0258: u32 = 600;
942pub const GPUREG_0259: u32 = 601;
943pub const GPUREG_025A: u32 = 602;
944pub const GPUREG_025B: u32 = 603;
945pub const GPUREG_025C: u32 = 604;
946pub const GPUREG_025D: u32 = 605;
947pub const GPUREG_PRIMITIVE_CONFIG: u32 = 606;
948pub const GPUREG_RESTART_PRIMITIVE: u32 = 607;
949pub const GPUREG_0260: u32 = 608;
950pub const GPUREG_0261: u32 = 609;
951pub const GPUREG_0262: u32 = 610;
952pub const GPUREG_0263: u32 = 611;
953pub const GPUREG_0264: u32 = 612;
954pub const GPUREG_0265: u32 = 613;
955pub const GPUREG_0266: u32 = 614;
956pub const GPUREG_0267: u32 = 615;
957pub const GPUREG_0268: u32 = 616;
958pub const GPUREG_0269: u32 = 617;
959pub const GPUREG_026A: u32 = 618;
960pub const GPUREG_026B: u32 = 619;
961pub const GPUREG_026C: u32 = 620;
962pub const GPUREG_026D: u32 = 621;
963pub const GPUREG_026E: u32 = 622;
964pub const GPUREG_026F: u32 = 623;
965pub const GPUREG_0270: u32 = 624;
966pub const GPUREG_0271: u32 = 625;
967pub const GPUREG_0272: u32 = 626;
968pub const GPUREG_0273: u32 = 627;
969pub const GPUREG_0274: u32 = 628;
970pub const GPUREG_0275: u32 = 629;
971pub const GPUREG_0276: u32 = 630;
972pub const GPUREG_0277: u32 = 631;
973pub const GPUREG_0278: u32 = 632;
974pub const GPUREG_0279: u32 = 633;
975pub const GPUREG_027A: u32 = 634;
976pub const GPUREG_027B: u32 = 635;
977pub const GPUREG_027C: u32 = 636;
978pub const GPUREG_027D: u32 = 637;
979pub const GPUREG_027E: u32 = 638;
980pub const GPUREG_027F: u32 = 639;
981pub const GPUREG_GSH_BOOLUNIFORM: u32 = 640;
982pub const GPUREG_GSH_INTUNIFORM_I0: u32 = 641;
983pub const GPUREG_GSH_INTUNIFORM_I1: u32 = 642;
984pub const GPUREG_GSH_INTUNIFORM_I2: u32 = 643;
985pub const GPUREG_GSH_INTUNIFORM_I3: u32 = 644;
986pub const GPUREG_0285: u32 = 645;
987pub const GPUREG_0286: u32 = 646;
988pub const GPUREG_0287: u32 = 647;
989pub const GPUREG_0288: u32 = 648;
990pub const GPUREG_GSH_INPUTBUFFER_CONFIG: u32 = 649;
991pub const GPUREG_GSH_ENTRYPOINT: u32 = 650;
992pub const GPUREG_GSH_ATTRIBUTES_PERMUTATION_LOW: u32 = 651;
993pub const GPUREG_GSH_ATTRIBUTES_PERMUTATION_HIGH: u32 = 652;
994pub const GPUREG_GSH_OUTMAP_MASK: u32 = 653;
995pub const GPUREG_028E: u32 = 654;
996pub const GPUREG_GSH_CODETRANSFER_END: u32 = 655;
997pub const GPUREG_GSH_FLOATUNIFORM_CONFIG: u32 = 656;
998pub const GPUREG_GSH_FLOATUNIFORM_DATA: u32 = 657;
999pub const GPUREG_0299: u32 = 665;
1000pub const GPUREG_029A: u32 = 666;
1001pub const GPUREG_GSH_CODETRANSFER_CONFIG: u32 = 667;
1002pub const GPUREG_GSH_CODETRANSFER_DATA: u32 = 668;
1003pub const GPUREG_02A4: u32 = 676;
1004pub const GPUREG_GSH_OPDESCS_CONFIG: u32 = 677;
1005pub const GPUREG_GSH_OPDESCS_DATA: u32 = 678;
1006pub const GPUREG_02AE: u32 = 686;
1007pub const GPUREG_02AF: u32 = 687;
1008pub const GPUREG_VSH_BOOLUNIFORM: u32 = 688;
1009pub const GPUREG_VSH_INTUNIFORM_I0: u32 = 689;
1010pub const GPUREG_VSH_INTUNIFORM_I1: u32 = 690;
1011pub const GPUREG_VSH_INTUNIFORM_I2: u32 = 691;
1012pub const GPUREG_VSH_INTUNIFORM_I3: u32 = 692;
1013pub const GPUREG_02B5: u32 = 693;
1014pub const GPUREG_02B6: u32 = 694;
1015pub const GPUREG_02B7: u32 = 695;
1016pub const GPUREG_02B8: u32 = 696;
1017pub const GPUREG_VSH_INPUTBUFFER_CONFIG: u32 = 697;
1018pub const GPUREG_VSH_ENTRYPOINT: u32 = 698;
1019pub const GPUREG_VSH_ATTRIBUTES_PERMUTATION_LOW: u32 = 699;
1020pub const GPUREG_VSH_ATTRIBUTES_PERMUTATION_HIGH: u32 = 700;
1021pub const GPUREG_VSH_OUTMAP_MASK: u32 = 701;
1022pub const GPUREG_02BE: u32 = 702;
1023pub const GPUREG_VSH_CODETRANSFER_END: u32 = 703;
1024pub const GPUREG_VSH_FLOATUNIFORM_CONFIG: u32 = 704;
1025pub const GPUREG_VSH_FLOATUNIFORM_DATA: u32 = 705;
1026pub const GPUREG_02C9: u32 = 713;
1027pub const GPUREG_02CA: u32 = 714;
1028pub const GPUREG_VSH_CODETRANSFER_CONFIG: u32 = 715;
1029pub const GPUREG_VSH_CODETRANSFER_DATA: u32 = 716;
1030pub const GPUREG_02D4: u32 = 724;
1031pub const GPUREG_VSH_OPDESCS_CONFIG: u32 = 725;
1032pub const GPUREG_VSH_OPDESCS_DATA: u32 = 726;
1033pub const GPUREG_02DE: u32 = 734;
1034pub const GPUREG_02DF: u32 = 735;
1035pub const GPUREG_02E0: u32 = 736;
1036pub const GPUREG_02E1: u32 = 737;
1037pub const GPUREG_02E2: u32 = 738;
1038pub const GPUREG_02E3: u32 = 739;
1039pub const GPUREG_02E4: u32 = 740;
1040pub const GPUREG_02E5: u32 = 741;
1041pub const GPUREG_02E6: u32 = 742;
1042pub const GPUREG_02E7: u32 = 743;
1043pub const GPUREG_02E8: u32 = 744;
1044pub const GPUREG_02E9: u32 = 745;
1045pub const GPUREG_02EA: u32 = 746;
1046pub const GPUREG_02EB: u32 = 747;
1047pub const GPUREG_02EC: u32 = 748;
1048pub const GPUREG_02ED: u32 = 749;
1049pub const GPUREG_02EE: u32 = 750;
1050pub const GPUREG_02EF: u32 = 751;
1051pub const GPUREG_02F0: u32 = 752;
1052pub const GPUREG_02F1: u32 = 753;
1053pub const GPUREG_02F2: u32 = 754;
1054pub const GPUREG_02F3: u32 = 755;
1055pub const GPUREG_02F4: u32 = 756;
1056pub const GPUREG_02F5: u32 = 757;
1057pub const GPUREG_02F6: u32 = 758;
1058pub const GPUREG_02F7: u32 = 759;
1059pub const GPUREG_02F8: u32 = 760;
1060pub const GPUREG_02F9: u32 = 761;
1061pub const GPUREG_02FA: u32 = 762;
1062pub const GPUREG_02FB: u32 = 763;
1063pub const GPUREG_02FC: u32 = 764;
1064pub const GPUREG_02FD: u32 = 765;
1065pub const GPUREG_02FE: u32 = 766;
1066pub const GPUREG_02FF: u32 = 767;
1067pub const NDSP_SAMPLE_RATE: f64 = 32728.498046875;
1068pub const SWKBD_MAX_WORD_LEN: u32 = 40;
1069pub const SWKBD_MAX_BUTTON_TEXT_LEN: u32 = 16;
1070pub const SWKBD_MAX_HINT_TEXT_LEN: u32 = 64;
1071pub const SWKBD_MAX_CALLBACK_MSG_LEN: u32 = 256;
1072pub const MIISELECTOR_MAGIC: u32 = 333326543;
1073pub const MIISELECTOR_TITLE_LEN: u32 = 64;
1074pub const MIISELECTOR_GUESTMII_SLOTS: u32 = 6;
1075pub const MIISELECTOR_USERMII_SLOTS: u32 = 100;
1076pub const MIISELECTOR_GUESTMII_NAME_LEN: u32 = 12;
1077pub const ARCHIVE_DIRITER_MAGIC: u32 = 1751347809;
1078pub const LINK3DS_COMM_PORT: u32 = 17491;
1079pub type __uint32_t = ::libc::c_uint;
1080pub type __int_least64_t = ::libc::c_longlong;
1081pub type u8_ = u8;
1082pub type u16_ = u16;
1083pub type u32_ = u32;
1084pub type u64_ = u64;
1085pub type s8 = i8;
1086pub type s16 = i16;
1087pub type s32 = i32;
1088pub type s64 = i64;
1089pub type vu8 = u8_;
1090pub type vu16 = u16_;
1091pub type vu32 = u32_;
1092pub type vu64 = u64_;
1093pub type vs8 = s8;
1094pub type vs16 = s16;
1095pub type vs32 = s32;
1096pub type vs64 = s64;
1097pub type Handle = u32_;
1098pub type Result = s32;
1099pub type ThreadFunc = ::core::option::Option<unsafe extern "C" fn(arg1: *mut ::libc::c_void)>;
1100pub type voidfn = ::core::option::Option<unsafe extern "C" fn()>;
1101#[doc = "Structure representing CPU registers"]
1102#[repr(C)]
1103#[derive(Debug, Default, Copy, Clone)]
1104pub struct CpuRegisters {
1105 #[doc = "< r0-r12."]
1106 pub r: [u32_; 13usize],
1107 #[doc = "< sp."]
1108 pub sp: u32_,
1109 #[doc = "< lr."]
1110 pub lr: u32_,
1111 #[doc = "< pc. May need to be adjusted."]
1112 pub pc: u32_,
1113 #[doc = "< cpsr."]
1114 pub cpsr: u32_,
1115}
1116#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1117const _: () = {
1118 ["Size of CpuRegisters"][::core::mem::size_of::<CpuRegisters>() - 68usize];
1119 ["Alignment of CpuRegisters"][::core::mem::align_of::<CpuRegisters>() - 4usize];
1120 ["Offset of field: CpuRegisters::r"][::core::mem::offset_of!(CpuRegisters, r) - 0usize];
1121 ["Offset of field: CpuRegisters::sp"][::core::mem::offset_of!(CpuRegisters, sp) - 52usize];
1122 ["Offset of field: CpuRegisters::lr"][::core::mem::offset_of!(CpuRegisters, lr) - 56usize];
1123 ["Offset of field: CpuRegisters::pc"][::core::mem::offset_of!(CpuRegisters, pc) - 60usize];
1124 ["Offset of field: CpuRegisters::cpsr"][::core::mem::offset_of!(CpuRegisters, cpsr) - 64usize];
1125};
1126#[doc = "Structure representing FPU registers"]
1127#[repr(C)]
1128#[derive(Copy, Clone)]
1129pub struct FpuRegisters {
1130 pub __bindgen_anon_1: FpuRegisters__bindgen_ty_1,
1131 #[doc = "< fpscr."]
1132 pub fpscr: u32_,
1133 #[doc = "< fpexc."]
1134 pub fpexc: u32_,
1135}
1136#[repr(C)]
1137#[derive(Copy, Clone)]
1138pub union FpuRegisters__bindgen_ty_1 {
1139 pub __bindgen_anon_1: FpuRegisters__bindgen_ty_1__bindgen_ty_1,
1140 #[doc = "< s0-s31."]
1141 pub s: [f32; 32usize],
1142}
1143#[repr(C, packed)]
1144#[derive(Debug, Default, Copy, Clone)]
1145pub struct FpuRegisters__bindgen_ty_1__bindgen_ty_1 {
1146 #[doc = "< d0-d15."]
1147 pub d: [f64; 16usize],
1148}
1149#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1150const _: () = {
1151 ["Size of FpuRegisters__bindgen_ty_1__bindgen_ty_1"]
1152 [::core::mem::size_of::<FpuRegisters__bindgen_ty_1__bindgen_ty_1>() - 128usize];
1153 ["Alignment of FpuRegisters__bindgen_ty_1__bindgen_ty_1"]
1154 [::core::mem::align_of::<FpuRegisters__bindgen_ty_1__bindgen_ty_1>() - 1usize];
1155 ["Offset of field: FpuRegisters__bindgen_ty_1__bindgen_ty_1::d"]
1156 [::core::mem::offset_of!(FpuRegisters__bindgen_ty_1__bindgen_ty_1, d) - 0usize];
1157};
1158#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1159const _: () = {
1160 ["Size of FpuRegisters__bindgen_ty_1"]
1161 [::core::mem::size_of::<FpuRegisters__bindgen_ty_1>() - 128usize];
1162 ["Alignment of FpuRegisters__bindgen_ty_1"]
1163 [::core::mem::align_of::<FpuRegisters__bindgen_ty_1>() - 4usize];
1164 ["Offset of field: FpuRegisters__bindgen_ty_1::s"]
1165 [::core::mem::offset_of!(FpuRegisters__bindgen_ty_1, s) - 0usize];
1166};
1167impl Default for FpuRegisters__bindgen_ty_1 {
1168 fn default() -> Self {
1169 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
1170 unsafe {
1171 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1172 s.assume_init()
1173 }
1174 }
1175}
1176#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1177const _: () = {
1178 ["Size of FpuRegisters"][::core::mem::size_of::<FpuRegisters>() - 136usize];
1179 ["Alignment of FpuRegisters"][::core::mem::align_of::<FpuRegisters>() - 4usize];
1180 ["Offset of field: FpuRegisters::fpscr"]
1181 [::core::mem::offset_of!(FpuRegisters, fpscr) - 128usize];
1182 ["Offset of field: FpuRegisters::fpexc"]
1183 [::core::mem::offset_of!(FpuRegisters, fpexc) - 132usize];
1184};
1185impl Default for FpuRegisters {
1186 fn default() -> Self {
1187 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
1188 unsafe {
1189 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1190 s.assume_init()
1191 }
1192 }
1193}
1194pub const RL_SUCCESS: _bindgen_ty_1 = 0;
1195pub const RL_INFO: _bindgen_ty_1 = 1;
1196pub const RL_FATAL: _bindgen_ty_1 = 31;
1197pub const RL_RESET: _bindgen_ty_1 = 30;
1198pub const RL_REINITIALIZE: _bindgen_ty_1 = 29;
1199pub const RL_USAGE: _bindgen_ty_1 = 28;
1200pub const RL_PERMANENT: _bindgen_ty_1 = 27;
1201pub const RL_TEMPORARY: _bindgen_ty_1 = 26;
1202pub const RL_STATUS: _bindgen_ty_1 = 25;
1203#[doc = "Result code level values."]
1204pub type _bindgen_ty_1 = ::libc::c_uchar;
1205pub const RS_SUCCESS: _bindgen_ty_2 = 0;
1206pub const RS_NOP: _bindgen_ty_2 = 1;
1207pub const RS_WOULDBLOCK: _bindgen_ty_2 = 2;
1208pub const RS_OUTOFRESOURCE: _bindgen_ty_2 = 3;
1209pub const RS_NOTFOUND: _bindgen_ty_2 = 4;
1210pub const RS_INVALIDSTATE: _bindgen_ty_2 = 5;
1211pub const RS_NOTSUPPORTED: _bindgen_ty_2 = 6;
1212pub const RS_INVALIDARG: _bindgen_ty_2 = 7;
1213pub const RS_WRONGARG: _bindgen_ty_2 = 8;
1214pub const RS_CANCELED: _bindgen_ty_2 = 9;
1215pub const RS_STATUSCHANGED: _bindgen_ty_2 = 10;
1216pub const RS_INTERNAL: _bindgen_ty_2 = 11;
1217pub const RS_INVALIDRESVAL: _bindgen_ty_2 = 63;
1218#[doc = "Result code summary values."]
1219pub type _bindgen_ty_2 = ::libc::c_uchar;
1220pub const RM_COMMON: _bindgen_ty_3 = 0;
1221pub const RM_KERNEL: _bindgen_ty_3 = 1;
1222pub const RM_UTIL: _bindgen_ty_3 = 2;
1223pub const RM_FILE_SERVER: _bindgen_ty_3 = 3;
1224pub const RM_LOADER_SERVER: _bindgen_ty_3 = 4;
1225pub const RM_TCB: _bindgen_ty_3 = 5;
1226pub const RM_OS: _bindgen_ty_3 = 6;
1227pub const RM_DBG: _bindgen_ty_3 = 7;
1228pub const RM_DMNT: _bindgen_ty_3 = 8;
1229pub const RM_PDN: _bindgen_ty_3 = 9;
1230pub const RM_GSP: _bindgen_ty_3 = 10;
1231pub const RM_I2C: _bindgen_ty_3 = 11;
1232pub const RM_GPIO: _bindgen_ty_3 = 12;
1233pub const RM_DD: _bindgen_ty_3 = 13;
1234pub const RM_CODEC: _bindgen_ty_3 = 14;
1235pub const RM_SPI: _bindgen_ty_3 = 15;
1236pub const RM_PXI: _bindgen_ty_3 = 16;
1237pub const RM_FS: _bindgen_ty_3 = 17;
1238pub const RM_DI: _bindgen_ty_3 = 18;
1239pub const RM_HID: _bindgen_ty_3 = 19;
1240pub const RM_CAM: _bindgen_ty_3 = 20;
1241pub const RM_PI: _bindgen_ty_3 = 21;
1242pub const RM_PM: _bindgen_ty_3 = 22;
1243pub const RM_PM_LOW: _bindgen_ty_3 = 23;
1244pub const RM_FSI: _bindgen_ty_3 = 24;
1245pub const RM_SRV: _bindgen_ty_3 = 25;
1246pub const RM_NDM: _bindgen_ty_3 = 26;
1247pub const RM_NWM: _bindgen_ty_3 = 27;
1248pub const RM_SOC: _bindgen_ty_3 = 28;
1249pub const RM_LDR: _bindgen_ty_3 = 29;
1250pub const RM_ACC: _bindgen_ty_3 = 30;
1251pub const RM_ROMFS: _bindgen_ty_3 = 31;
1252pub const RM_AM: _bindgen_ty_3 = 32;
1253pub const RM_HIO: _bindgen_ty_3 = 33;
1254pub const RM_UPDATER: _bindgen_ty_3 = 34;
1255pub const RM_MIC: _bindgen_ty_3 = 35;
1256pub const RM_FND: _bindgen_ty_3 = 36;
1257pub const RM_MP: _bindgen_ty_3 = 37;
1258pub const RM_MPWL: _bindgen_ty_3 = 38;
1259pub const RM_AC: _bindgen_ty_3 = 39;
1260pub const RM_HTTP: _bindgen_ty_3 = 40;
1261pub const RM_DSP: _bindgen_ty_3 = 41;
1262pub const RM_SND: _bindgen_ty_3 = 42;
1263pub const RM_DLP: _bindgen_ty_3 = 43;
1264pub const RM_HIO_LOW: _bindgen_ty_3 = 44;
1265pub const RM_CSND: _bindgen_ty_3 = 45;
1266pub const RM_SSL: _bindgen_ty_3 = 46;
1267pub const RM_AM_LOW: _bindgen_ty_3 = 47;
1268pub const RM_NEX: _bindgen_ty_3 = 48;
1269pub const RM_FRIENDS: _bindgen_ty_3 = 49;
1270pub const RM_RDT: _bindgen_ty_3 = 50;
1271pub const RM_APPLET: _bindgen_ty_3 = 51;
1272pub const RM_NIM: _bindgen_ty_3 = 52;
1273pub const RM_PTM: _bindgen_ty_3 = 53;
1274pub const RM_MIDI: _bindgen_ty_3 = 54;
1275pub const RM_MC: _bindgen_ty_3 = 55;
1276pub const RM_SWC: _bindgen_ty_3 = 56;
1277pub const RM_FATFS: _bindgen_ty_3 = 57;
1278pub const RM_NGC: _bindgen_ty_3 = 58;
1279pub const RM_CARD: _bindgen_ty_3 = 59;
1280pub const RM_CARDNOR: _bindgen_ty_3 = 60;
1281pub const RM_SDMC: _bindgen_ty_3 = 61;
1282pub const RM_BOSS: _bindgen_ty_3 = 62;
1283pub const RM_DBM: _bindgen_ty_3 = 63;
1284pub const RM_CONFIG: _bindgen_ty_3 = 64;
1285pub const RM_PS: _bindgen_ty_3 = 65;
1286pub const RM_CEC: _bindgen_ty_3 = 66;
1287pub const RM_IR: _bindgen_ty_3 = 67;
1288pub const RM_UDS: _bindgen_ty_3 = 68;
1289pub const RM_PL: _bindgen_ty_3 = 69;
1290pub const RM_CUP: _bindgen_ty_3 = 70;
1291pub const RM_GYROSCOPE: _bindgen_ty_3 = 71;
1292pub const RM_MCU: _bindgen_ty_3 = 72;
1293pub const RM_NS: _bindgen_ty_3 = 73;
1294pub const RM_NEWS: _bindgen_ty_3 = 74;
1295pub const RM_RO: _bindgen_ty_3 = 75;
1296pub const RM_GD: _bindgen_ty_3 = 76;
1297pub const RM_CARD_SPI: _bindgen_ty_3 = 77;
1298pub const RM_EC: _bindgen_ty_3 = 78;
1299pub const RM_WEB_BROWSER: _bindgen_ty_3 = 79;
1300pub const RM_TEST: _bindgen_ty_3 = 80;
1301pub const RM_ENC: _bindgen_ty_3 = 81;
1302pub const RM_PIA: _bindgen_ty_3 = 82;
1303pub const RM_ACT: _bindgen_ty_3 = 83;
1304pub const RM_VCTL: _bindgen_ty_3 = 84;
1305pub const RM_OLV: _bindgen_ty_3 = 85;
1306pub const RM_NEIA: _bindgen_ty_3 = 86;
1307pub const RM_NPNS: _bindgen_ty_3 = 87;
1308pub const RM_AVD: _bindgen_ty_3 = 90;
1309pub const RM_L2B: _bindgen_ty_3 = 91;
1310pub const RM_MVD: _bindgen_ty_3 = 92;
1311pub const RM_NFC: _bindgen_ty_3 = 93;
1312pub const RM_UART: _bindgen_ty_3 = 94;
1313pub const RM_SPM: _bindgen_ty_3 = 95;
1314pub const RM_QTM: _bindgen_ty_3 = 96;
1315pub const RM_NFP: _bindgen_ty_3 = 97;
1316pub const RM_APPLICATION: _bindgen_ty_3 = 254;
1317pub const RM_INVALIDRESVAL: _bindgen_ty_3 = 255;
1318#[doc = "Result code module values."]
1319pub type _bindgen_ty_3 = ::libc::c_uchar;
1320pub const RD_SUCCESS: _bindgen_ty_4 = 0;
1321pub const RD_INVALID_RESULT_VALUE: _bindgen_ty_4 = 1023;
1322pub const RD_TIMEOUT: _bindgen_ty_4 = 1022;
1323pub const RD_OUT_OF_RANGE: _bindgen_ty_4 = 1021;
1324pub const RD_ALREADY_EXISTS: _bindgen_ty_4 = 1020;
1325pub const RD_CANCEL_REQUESTED: _bindgen_ty_4 = 1019;
1326pub const RD_NOT_FOUND: _bindgen_ty_4 = 1018;
1327pub const RD_ALREADY_INITIALIZED: _bindgen_ty_4 = 1017;
1328pub const RD_NOT_INITIALIZED: _bindgen_ty_4 = 1016;
1329pub const RD_INVALID_HANDLE: _bindgen_ty_4 = 1015;
1330pub const RD_INVALID_POINTER: _bindgen_ty_4 = 1014;
1331pub const RD_INVALID_ADDRESS: _bindgen_ty_4 = 1013;
1332pub const RD_NOT_IMPLEMENTED: _bindgen_ty_4 = 1012;
1333pub const RD_OUT_OF_MEMORY: _bindgen_ty_4 = 1011;
1334pub const RD_MISALIGNED_SIZE: _bindgen_ty_4 = 1010;
1335pub const RD_MISALIGNED_ADDRESS: _bindgen_ty_4 = 1009;
1336pub const RD_BUSY: _bindgen_ty_4 = 1008;
1337pub const RD_NO_DATA: _bindgen_ty_4 = 1007;
1338pub const RD_INVALID_COMBINATION: _bindgen_ty_4 = 1006;
1339pub const RD_INVALID_ENUM_VALUE: _bindgen_ty_4 = 1005;
1340pub const RD_INVALID_SIZE: _bindgen_ty_4 = 1004;
1341pub const RD_ALREADY_DONE: _bindgen_ty_4 = 1003;
1342pub const RD_NOT_AUTHORIZED: _bindgen_ty_4 = 1002;
1343pub const RD_TOO_LARGE: _bindgen_ty_4 = 1001;
1344pub const RD_INVALID_SELECTION: _bindgen_ty_4 = 1000;
1345#[doc = "Result code generic description values."]
1346pub type _bindgen_ty_4 = ::libc::c_ushort;
1347#[doc = "< Readable"]
1348pub const IPC_BUFFER_R: IPC_BufferRights = 2;
1349#[doc = "< Writable"]
1350pub const IPC_BUFFER_W: IPC_BufferRights = 4;
1351#[doc = "< Readable and Writable"]
1352pub const IPC_BUFFER_RW: IPC_BufferRights = 6;
1353#[doc = "IPC buffer access rights."]
1354pub type IPC_BufferRights = ::libc::c_uchar;
1355unsafe extern "C" {
1356 #[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."]
1357 #[link_name = "IPC_MakeHeader__extern"]
1358 pub fn IPC_MakeHeader(
1359 command_id: u16_,
1360 normal_params: ::libc::c_uint,
1361 translate_params: ::libc::c_uint,
1362 ) -> u32_;
1363}
1364unsafe extern "C" {
1365 #[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."]
1366 #[link_name = "IPC_Desc_SharedHandles__extern"]
1367 pub fn IPC_Desc_SharedHandles(number: ::libc::c_uint) -> u32_;
1368}
1369unsafe extern "C" {
1370 #[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."]
1371 #[link_name = "IPC_Desc_MoveHandles__extern"]
1372 pub fn IPC_Desc_MoveHandles(number: ::libc::c_uint) -> u32_;
1373}
1374unsafe extern "C" {
1375 #[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."]
1376 #[link_name = "IPC_Desc_CurProcessId__extern"]
1377 pub fn IPC_Desc_CurProcessId() -> u32_;
1378}
1379unsafe extern "C" {
1380 #[link_name = "IPC_Desc_CurProcessHandle__extern"]
1381 pub fn IPC_Desc_CurProcessHandle() -> u32_;
1382}
1383unsafe extern "C" {
1384 #[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."]
1385 #[link_name = "IPC_Desc_StaticBuffer__extern"]
1386 pub fn IPC_Desc_StaticBuffer(size: usize, buffer_id: ::libc::c_uint) -> u32_;
1387}
1388unsafe extern "C" {
1389 #[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."]
1390 #[link_name = "IPC_Desc_PXIBuffer__extern"]
1391 pub fn IPC_Desc_PXIBuffer(size: usize, buffer_id: ::libc::c_uint, is_read_only: bool) -> u32_;
1392}
1393unsafe extern "C" {
1394 #[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."]
1395 #[link_name = "IPC_Desc_Buffer__extern"]
1396 pub fn IPC_Desc_Buffer(size: usize, rights: IPC_BufferRights) -> u32_;
1397}
1398#[doc = "< Memory un-mapping"]
1399pub const MEMOP_FREE: MemOp = 1;
1400#[doc = "< Reserve memory"]
1401pub const MEMOP_RESERVE: MemOp = 2;
1402#[doc = "< Memory mapping"]
1403pub const MEMOP_ALLOC: MemOp = 3;
1404#[doc = "< Mirror mapping"]
1405pub const MEMOP_MAP: MemOp = 4;
1406#[doc = "< Mirror unmapping"]
1407pub const MEMOP_UNMAP: MemOp = 5;
1408#[doc = "< Change protection"]
1409pub const MEMOP_PROT: MemOp = 6;
1410#[doc = "< APPLICATION memory region."]
1411pub const MEMOP_REGION_APP: MemOp = 256;
1412#[doc = "< SYSTEM memory region."]
1413pub const MEMOP_REGION_SYSTEM: MemOp = 512;
1414#[doc = "< BASE memory region."]
1415pub const MEMOP_REGION_BASE: MemOp = 768;
1416#[doc = "< Operation bitmask."]
1417pub const MEMOP_OP_MASK: MemOp = 255;
1418#[doc = "< Region bitmask."]
1419pub const MEMOP_REGION_MASK: MemOp = 3840;
1420#[doc = "< Flag for linear memory operations"]
1421pub const MEMOP_LINEAR_FLAG: MemOp = 65536;
1422#[doc = "< Allocates linear memory."]
1423pub const MEMOP_ALLOC_LINEAR: MemOp = 65539;
1424#[doc = "svcControlMemory operation flags\n\n The lowest 8 bits are the operation"]
1425pub type MemOp = ::libc::c_uint;
1426#[doc = "< Free memory"]
1427pub const MEMSTATE_FREE: MemState = 0;
1428#[doc = "< Reserved memory"]
1429pub const MEMSTATE_RESERVED: MemState = 1;
1430#[doc = "< I/O memory"]
1431pub const MEMSTATE_IO: MemState = 2;
1432#[doc = "< Static memory"]
1433pub const MEMSTATE_STATIC: MemState = 3;
1434#[doc = "< Code memory"]
1435pub const MEMSTATE_CODE: MemState = 4;
1436#[doc = "< Private memory"]
1437pub const MEMSTATE_PRIVATE: MemState = 5;
1438#[doc = "< Shared memory"]
1439pub const MEMSTATE_SHARED: MemState = 6;
1440#[doc = "< Continuous memory"]
1441pub const MEMSTATE_CONTINUOUS: MemState = 7;
1442#[doc = "< Aliased memory"]
1443pub const MEMSTATE_ALIASED: MemState = 8;
1444#[doc = "< Alias memory"]
1445pub const MEMSTATE_ALIAS: MemState = 9;
1446#[doc = "< Aliased code memory"]
1447pub const MEMSTATE_ALIASCODE: MemState = 10;
1448#[doc = "< Locked memory"]
1449pub const MEMSTATE_LOCKED: MemState = 11;
1450#[doc = "The state of a memory block."]
1451pub type MemState = ::libc::c_uchar;
1452#[doc = "< Readable"]
1453pub const MEMPERM_READ: MemPerm = 1;
1454#[doc = "< Writable"]
1455pub const MEMPERM_WRITE: MemPerm = 2;
1456#[doc = "< Executable"]
1457pub const MEMPERM_EXECUTE: MemPerm = 4;
1458#[doc = "< Readable and writable"]
1459pub const MEMPERM_READWRITE: MemPerm = 3;
1460#[doc = "< Readable and executable"]
1461pub const MEMPERM_READEXECUTE: MemPerm = 5;
1462#[doc = "< Don't care"]
1463pub const MEMPERM_DONTCARE: MemPerm = 268435456;
1464#[doc = "Memory permission flags"]
1465pub type MemPerm = ::libc::c_uint;
1466#[doc = "< All regions."]
1467pub const MEMREGION_ALL: MemRegion = 0;
1468#[doc = "< APPLICATION memory."]
1469pub const MEMREGION_APPLICATION: MemRegion = 1;
1470#[doc = "< SYSTEM memory."]
1471pub const MEMREGION_SYSTEM: MemRegion = 2;
1472#[doc = "< BASE memory."]
1473pub const MEMREGION_BASE: MemRegion = 3;
1474#[doc = "Memory regions."]
1475pub type MemRegion = ::libc::c_uchar;
1476#[doc = "Memory information."]
1477#[repr(C)]
1478#[derive(Debug, Default, Copy, Clone)]
1479pub struct MemInfo {
1480 #[doc = "< Base address."]
1481 pub base_addr: u32_,
1482 #[doc = "< Size."]
1483 pub size: u32_,
1484 #[doc = "< Memory permissions. See MemPerm"]
1485 pub perm: u32_,
1486 #[doc = "< Memory state. See MemState"]
1487 pub state: u32_,
1488}
1489#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1490const _: () = {
1491 ["Size of MemInfo"][::core::mem::size_of::<MemInfo>() - 16usize];
1492 ["Alignment of MemInfo"][::core::mem::align_of::<MemInfo>() - 4usize];
1493 ["Offset of field: MemInfo::base_addr"][::core::mem::offset_of!(MemInfo, base_addr) - 0usize];
1494 ["Offset of field: MemInfo::size"][::core::mem::offset_of!(MemInfo, size) - 4usize];
1495 ["Offset of field: MemInfo::perm"][::core::mem::offset_of!(MemInfo, perm) - 8usize];
1496 ["Offset of field: MemInfo::state"][::core::mem::offset_of!(MemInfo, state) - 12usize];
1497};
1498#[doc = "Memory page information."]
1499#[repr(C)]
1500#[derive(Debug, Default, Copy, Clone)]
1501pub struct PageInfo {
1502 #[doc = "< Page flags."]
1503 pub flags: u32_,
1504}
1505#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1506const _: () = {
1507 ["Size of PageInfo"][::core::mem::size_of::<PageInfo>() - 4usize];
1508 ["Alignment of PageInfo"][::core::mem::align_of::<PageInfo>() - 4usize];
1509 ["Offset of field: PageInfo::flags"][::core::mem::offset_of!(PageInfo, flags) - 0usize];
1510};
1511#[doc = "< Signal #value threads for wake-up."]
1512pub const ARBITRATION_SIGNAL: ArbitrationType = 0;
1513#[doc = "< If the memory at the address is strictly lower than #value, then wait for signal."]
1514pub const ARBITRATION_WAIT_IF_LESS_THAN: ArbitrationType = 1;
1515#[doc = "< If the memory at the address is strictly lower than #value, then decrement it and wait for signal."]
1516pub const ARBITRATION_DECREMENT_AND_WAIT_IF_LESS_THAN: ArbitrationType = 2;
1517#[doc = "< If the memory at the address is strictly lower than #value, then wait for signal or timeout."]
1518pub const ARBITRATION_WAIT_IF_LESS_THAN_TIMEOUT: ArbitrationType = 3;
1519#[doc = "< If the memory at the address is strictly lower than #value, then decrement it and wait for signal or timeout."]
1520pub const ARBITRATION_DECREMENT_AND_WAIT_IF_LESS_THAN_TIMEOUT: ArbitrationType = 4;
1521#[doc = "Arbitration modes."]
1522pub type ArbitrationType = ::libc::c_uchar;
1523#[doc = "< When the primitive is signaled, it will wake up exactly one thread and will clear itself automatically."]
1524pub const RESET_ONESHOT: ResetType = 0;
1525#[doc = "< When the primitive is signaled, it will wake up all threads and it won't clear itself automatically."]
1526pub const RESET_STICKY: ResetType = 1;
1527#[doc = "< Only meaningful for timers: same as ONESHOT but it will periodically signal the timer instead of just once."]
1528pub const RESET_PULSE: ResetType = 2;
1529#[doc = "Reset types (for use with events and timers)"]
1530pub type ResetType = ::libc::c_uchar;
1531#[doc = "< Unknown."]
1532pub const THREADINFO_TYPE_UNKNOWN: ThreadInfoType = 0;
1533#[doc = "Types of thread info."]
1534pub type ThreadInfoType = ::libc::c_uchar;
1535#[doc = "< Thread priority"]
1536pub const RESLIMIT_PRIORITY: ResourceLimitType = 0;
1537#[doc = "< Quantity of allocatable memory"]
1538pub const RESLIMIT_COMMIT: ResourceLimitType = 1;
1539#[doc = "< Number of threads"]
1540pub const RESLIMIT_THREAD: ResourceLimitType = 2;
1541#[doc = "< Number of events"]
1542pub const RESLIMIT_EVENT: ResourceLimitType = 3;
1543#[doc = "< Number of mutexes"]
1544pub const RESLIMIT_MUTEX: ResourceLimitType = 4;
1545#[doc = "< Number of semaphores"]
1546pub const RESLIMIT_SEMAPHORE: ResourceLimitType = 5;
1547#[doc = "< Number of timers"]
1548pub const RESLIMIT_TIMER: ResourceLimitType = 6;
1549#[doc = "< Number of shared memory objects, see svcCreateMemoryBlock"]
1550pub const RESLIMIT_SHAREDMEMORY: ResourceLimitType = 7;
1551#[doc = "< Number of address arbiters"]
1552pub const RESLIMIT_ADDRESSARBITER: ResourceLimitType = 8;
1553#[doc = "< CPU time. Value expressed in percentage regular until it reaches 90."]
1554pub const RESLIMIT_CPUTIME: ResourceLimitType = 9;
1555#[doc = "< Forces enum size to be 32 bits"]
1556pub const RESLIMIT_BIT: ResourceLimitType = 2147483648;
1557#[doc = "Types of resource limit"]
1558pub type ResourceLimitType = ::libc::c_uint;
1559#[doc = "< DMA transfer involving at least one device is starting and has not reached DMAWFP yet."]
1560pub const DMASTATE_STARTING: DmaState = 0;
1561#[doc = "< DMA channel is in WFP state for the destination device (2nd loop iteration onwards)."]
1562pub const DMASTATE_WFP_DST: DmaState = 1;
1563#[doc = "< DMA channel is in WFP state for the source device (2nd loop iteration onwards)."]
1564pub const DMASTATE_WFP_SRC: DmaState = 2;
1565#[doc = "< DMA transfer is running."]
1566pub const DMASTATE_RUNNING: DmaState = 3;
1567#[doc = "< DMA transfer is done."]
1568pub const DMASTATE_DONE: DmaState = 4;
1569#[doc = "DMA transfer state."]
1570pub type DmaState = ::libc::c_uchar;
1571#[doc = "< DMA source is a device/peripheral. Address will not auto-increment."]
1572pub const DMACFG_SRC_IS_DEVICE: _bindgen_ty_5 = 1;
1573#[doc = "< DMA destination is a device/peripheral. Address will not auto-increment."]
1574pub const DMACFG_DST_IS_DEVICE: _bindgen_ty_5 = 2;
1575#[doc = "< Make svcStartInterProcessDma wait for the channel to be unlocked."]
1576pub const DMACFG_WAIT_AVAILABLE: _bindgen_ty_5 = 4;
1577#[doc = "< Keep the channel locked after the transfer. Required for svcRestartDma."]
1578pub const DMACFG_KEEP_LOCKED: _bindgen_ty_5 = 8;
1579#[doc = "< Use the provided source device configuration even if the DMA source is not a device."]
1580pub const DMACFG_USE_SRC_CONFIG: _bindgen_ty_5 = 64;
1581#[doc = "< Use the provided destination device configuration even if the DMA destination is not a device."]
1582pub const DMACFG_USE_DST_CONFIG: _bindgen_ty_5 = 128;
1583#[doc = "Configuration flags for DmaConfig."]
1584pub type _bindgen_ty_5 = ::libc::c_uchar;
1585#[doc = "< Unlock the channel after transfer."]
1586pub const DMARST_UNLOCK: _bindgen_ty_6 = 1;
1587#[doc = "< Replace DMAFLUSHP instructions by NOP (they may not be regenerated even if this flag is not set)."]
1588pub const DMARST_RESUME_DEVICE: _bindgen_ty_6 = 2;
1589#[doc = "Configuration flags for svcRestartDma."]
1590pub type _bindgen_ty_6 = ::libc::c_uchar;
1591#[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."]
1592#[repr(C)]
1593#[derive(Debug, Default, Copy, Clone)]
1594pub struct DmaDeviceConfig {
1595 #[doc = "< DMA device ID."]
1596 pub deviceId: s8,
1597 #[doc = "< Mask of allowed access alignments (8, 4, 2, 1)."]
1598 pub allowedAlignments: s8,
1599 #[doc = "< Number of bytes transferred in a burst loop. Can be 0 (in which case the max allowed alignment is used as unit)."]
1600 pub burstSize: s16,
1601 #[doc = "< Number of bytes transferred in a \"transfer\" loop (made of burst loops)."]
1602 pub transferSize: s16,
1603 #[doc = "< Burst loop stride, can be <= 0."]
1604 pub burstStride: s16,
1605 #[doc = "< \"Transfer\" loop stride, can be <= 0."]
1606 pub transferStride: s16,
1607}
1608#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1609const _: () = {
1610 ["Size of DmaDeviceConfig"][::core::mem::size_of::<DmaDeviceConfig>() - 10usize];
1611 ["Alignment of DmaDeviceConfig"][::core::mem::align_of::<DmaDeviceConfig>() - 2usize];
1612 ["Offset of field: DmaDeviceConfig::deviceId"]
1613 [::core::mem::offset_of!(DmaDeviceConfig, deviceId) - 0usize];
1614 ["Offset of field: DmaDeviceConfig::allowedAlignments"]
1615 [::core::mem::offset_of!(DmaDeviceConfig, allowedAlignments) - 1usize];
1616 ["Offset of field: DmaDeviceConfig::burstSize"]
1617 [::core::mem::offset_of!(DmaDeviceConfig, burstSize) - 2usize];
1618 ["Offset of field: DmaDeviceConfig::transferSize"]
1619 [::core::mem::offset_of!(DmaDeviceConfig, transferSize) - 4usize];
1620 ["Offset of field: DmaDeviceConfig::burstStride"]
1621 [::core::mem::offset_of!(DmaDeviceConfig, burstStride) - 6usize];
1622 ["Offset of field: DmaDeviceConfig::transferStride"]
1623 [::core::mem::offset_of!(DmaDeviceConfig, transferStride) - 8usize];
1624};
1625#[doc = "Configuration stucture for svcStartInterProcessDma."]
1626#[repr(C)]
1627#[derive(Debug, Default, Copy, Clone)]
1628pub struct DmaConfig {
1629 #[doc = "< Channel ID (Arm11: 0-7, Arm9: 0-1). Use -1 to auto-assign to a free channel (Arm11: 3-7, Arm9: 0-1)."]
1630 pub channelId: s8,
1631 #[doc = "< Endian swap size (can be 0)."]
1632 pub endianSwapSize: s8,
1633 #[doc = "< DMACFG_* flags."]
1634 pub flags: u8_,
1635 pub _padding: u8_,
1636 #[doc = "< Source device configuration, read if DMACFG_SRC_IS_DEVICE and/or DMACFG_USE_SRC_CONFIG are set."]
1637 pub srcCfg: DmaDeviceConfig,
1638 #[doc = "< Destination device configuration, read if DMACFG_SRC_IS_DEVICE and/or DMACFG_USE_SRC_CONFIG are set."]
1639 pub dstCfg: DmaDeviceConfig,
1640}
1641#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1642const _: () = {
1643 ["Size of DmaConfig"][::core::mem::size_of::<DmaConfig>() - 24usize];
1644 ["Alignment of DmaConfig"][::core::mem::align_of::<DmaConfig>() - 2usize];
1645 ["Offset of field: DmaConfig::channelId"]
1646 [::core::mem::offset_of!(DmaConfig, channelId) - 0usize];
1647 ["Offset of field: DmaConfig::endianSwapSize"]
1648 [::core::mem::offset_of!(DmaConfig, endianSwapSize) - 1usize];
1649 ["Offset of field: DmaConfig::flags"][::core::mem::offset_of!(DmaConfig, flags) - 2usize];
1650 ["Offset of field: DmaConfig::_padding"][::core::mem::offset_of!(DmaConfig, _padding) - 3usize];
1651 ["Offset of field: DmaConfig::srcCfg"][::core::mem::offset_of!(DmaConfig, srcCfg) - 4usize];
1652 ["Offset of field: DmaConfig::dstCfg"][::core::mem::offset_of!(DmaConfig, dstCfg) - 14usize];
1653};
1654#[doc = "< Enable and lock perfmon. functionality."]
1655pub const PERFCOUNTEROP_ENABLE: PerfCounterOperation = 0;
1656#[doc = "< Disable and forcibly unlock perfmon. functionality."]
1657pub const PERFCOUNTEROP_DISABLE: PerfCounterOperation = 1;
1658#[doc = "< Get the value of a counter register."]
1659pub const PERFCOUNTEROP_GET_VALUE: PerfCounterOperation = 2;
1660#[doc = "< Set the value of a counter register."]
1661pub const PERFCOUNTEROP_SET_VALUE: PerfCounterOperation = 3;
1662#[doc = "< Get the overflow flags for all CP15 and SCU counters."]
1663pub const PERFCOUNTEROP_GET_OVERFLOW_FLAGS: PerfCounterOperation = 4;
1664#[doc = "< Reset the value and/or overflow flags of selected counters."]
1665pub const PERFCOUNTEROP_RESET: PerfCounterOperation = 5;
1666#[doc = "< Get the event ID associated to a particular counter."]
1667pub const PERFCOUNTEROP_GET_EVENT: PerfCounterOperation = 6;
1668#[doc = "< Set the event ID associated to a paritcular counter."]
1669pub const PERFCOUNTEROP_SET_EVENT: PerfCounterOperation = 7;
1670#[doc = "< (Dis)allow the kernel to track counter overflows and to use 64-bit counter values."]
1671pub const PERFCOUNTEROP_SET_VIRTUAL_COUNTER_ENABLED: PerfCounterOperation = 8;
1672#[doc = "Operations for svcControlPerformanceCounter"]
1673pub type PerfCounterOperation = ::libc::c_uchar;
1674pub const PERFCOUNTERREG_CORE_BASE: PerfCounterRegister = 0;
1675#[doc = "< CP15 PMN0."]
1676pub const PERFCOUNTERREG_CORE_COUNT_REG_0: PerfCounterRegister = 0;
1677#[doc = "< CP15 PMN1."]
1678pub const PERFCOUNTERREG_CORE_COUNT_REG_1: PerfCounterRegister = 1;
1679#[doc = "< CP15 CCNT."]
1680pub const PERFCOUNTERREG_CORE_CYCLE_COUNTER: PerfCounterRegister = 2;
1681pub const PERFCOUNTERREG_SCU_BASE: PerfCounterRegister = 16;
1682#[doc = "< SCU MN0."]
1683pub const PERFCOUNTERREG_SCU_0: PerfCounterRegister = 16;
1684#[doc = "< SCU MN1."]
1685pub const PERFCOUNTERREG_SCU_1: PerfCounterRegister = 17;
1686#[doc = "< SCU MN2."]
1687pub const PERFCOUNTERREG_SCU_2: PerfCounterRegister = 18;
1688#[doc = "< SCU MN3."]
1689pub const PERFCOUNTERREG_SCU_3: PerfCounterRegister = 19;
1690#[doc = "< SCU MN4. Prod-N3DS only. IRQ line missing."]
1691pub const PERFCOUNTERREG_SCU_4: PerfCounterRegister = 20;
1692#[doc = "< SCU MN5. Prod-N3DS only. IRQ line missing."]
1693pub const PERFCOUNTERREG_SCU_5: PerfCounterRegister = 21;
1694#[doc = "< SCU MN6. Prod-N3DS only. IRQ line missing."]
1695pub const PERFCOUNTERREG_SCU_6: PerfCounterRegister = 22;
1696#[doc = "< SCU MN7. Prod-N3DS only. IRQ line missing."]
1697pub const PERFCOUNTERREG_SCU_7: PerfCounterRegister = 23;
1698#[doc = "Performance counter register IDs (CP15 and SCU)."]
1699pub type PerfCounterRegister = ::libc::c_uchar;
1700pub const PERFCOUNTEREVT_CORE_BASE: PerfCounterEvent = 0;
1701pub const PERFCOUNTEREVT_CORE_INST_CACHE_MISS: PerfCounterEvent = 0;
1702pub const PERFCOUNTEREVT_CORE_STALL_BY_LACK_OF_INST: PerfCounterEvent = 1;
1703pub const PERFCOUNTEREVT_CORE_STALL_BY_DATA_HAZARD: PerfCounterEvent = 2;
1704pub const PERFCOUNTEREVT_CORE_INST_MICRO_TLB_MISS: PerfCounterEvent = 3;
1705pub const PERFCOUNTEREVT_CORE_DATA_MICRO_TLB_MISS: PerfCounterEvent = 4;
1706pub const PERFCOUNTEREVT_CORE_BRANCH_INST: PerfCounterEvent = 5;
1707pub const PERFCOUNTEREVT_CORE_BRANCH_NOT_PREDICTED: PerfCounterEvent = 6;
1708pub const PERFCOUNTEREVT_CORE_BRANCH_MISS_PREDICTED: PerfCounterEvent = 7;
1709pub const PERFCOUNTEREVT_CORE_INST_EXECUTED: PerfCounterEvent = 8;
1710pub const PERFCOUNTEREVT_CORE_FOLDED_INST_EXECUTED: PerfCounterEvent = 9;
1711pub const PERFCOUNTEREVT_CORE_DATA_CACHE_READ: PerfCounterEvent = 10;
1712pub const PERFCOUNTEREVT_CORE_DATA_CACHE_READ_MISS: PerfCounterEvent = 11;
1713pub const PERFCOUNTEREVT_CORE_DATA_CACHE_WRITE: PerfCounterEvent = 12;
1714pub const PERFCOUNTEREVT_CORE_DATA_CACHE_WRITE_MISS: PerfCounterEvent = 13;
1715pub const PERFCOUNTEREVT_CORE_DATA_CACHE_LINE_EVICTION: PerfCounterEvent = 14;
1716pub const PERFCOUNTEREVT_CORE_PC_CHANGED: PerfCounterEvent = 15;
1717pub const PERFCOUNTEREVT_CORE_MAIN_TLB_MISS: PerfCounterEvent = 16;
1718pub const PERFCOUNTEREVT_CORE_EXTERNAL_REQUEST: PerfCounterEvent = 17;
1719pub const PERFCOUNTEREVT_CORE_STALL_BY_LSU_FULL: PerfCounterEvent = 18;
1720pub const PERFCOUNTEREVT_CORE_STORE_BUFFER_DRAIN: PerfCounterEvent = 19;
1721pub const PERFCOUNTEREVT_CORE_MERGE_IN_STORE_BUFFER: PerfCounterEvent = 20;
1722#[doc = "< One cycle elapsed."]
1723pub const PERFCOUNTEREVT_CORE_CYCLE_COUNT: PerfCounterEvent = 255;
1724#[doc = "< 64 cycles elapsed."]
1725pub const PERFCOUNTEREVT_CORE_CYCLE_COUNT_64: PerfCounterEvent = 4095;
1726pub const PERFCOUNTEREVT_SCU_BASE: PerfCounterEvent = 4096;
1727pub const PERFCOUNTEREVT_SCU_DISABLED: PerfCounterEvent = 4096;
1728pub const PERFCOUNTEREVT_SCU_LINEFILL_MISS_FROM_CORE0: PerfCounterEvent = 4097;
1729pub const PERFCOUNTEREVT_SCU_LINEFILL_MISS_FROM_CORE1: PerfCounterEvent = 4098;
1730pub const PERFCOUNTEREVT_SCU_LINEFILL_MISS_FROM_CORE2: PerfCounterEvent = 4099;
1731pub const PERFCOUNTEREVT_SCU_LINEFILL_MISS_FROM_CORE3: PerfCounterEvent = 4100;
1732pub const PERFCOUNTEREVT_SCU_LINEFILL_HIT_FROM_CORE0: PerfCounterEvent = 4101;
1733pub const PERFCOUNTEREVT_SCU_LINEFILL_HIT_FROM_CORE1: PerfCounterEvent = 4102;
1734pub const PERFCOUNTEREVT_SCU_LINEFILL_HIT_FROM_CORE2: PerfCounterEvent = 4103;
1735pub const PERFCOUNTEREVT_SCU_LINEFILL_HIT_FROM_CORE3: PerfCounterEvent = 4104;
1736pub const PERFCOUNTEREVT_SCU_LINE_MISSING_FROM_CORE0: PerfCounterEvent = 4105;
1737pub const PERFCOUNTEREVT_SCU_LINE_MISSING_FROM_CORE1: PerfCounterEvent = 4106;
1738pub const PERFCOUNTEREVT_SCU_LINE_MISSING_FROM_CORE2: PerfCounterEvent = 4107;
1739pub const PERFCOUNTEREVT_SCU_LINE_MISSING_FROM_CORE3: PerfCounterEvent = 4108;
1740pub const PERFCOUNTEREVT_SCU_LINE_MIGRATION: PerfCounterEvent = 4109;
1741pub const PERFCOUNTEREVT_SCU_READ_BUSY_PORT0: PerfCounterEvent = 4110;
1742pub const PERFCOUNTEREVT_SCU_READ_BUSY_PORT1: PerfCounterEvent = 4111;
1743pub const PERFCOUNTEREVT_SCU_WRITE_BUSY_PORT0: PerfCounterEvent = 4112;
1744pub const PERFCOUNTEREVT_SCU_WRITE_BUSY_PORT1: PerfCounterEvent = 4113;
1745pub const PERFCOUNTEREVT_SCU_EXTERNAL_READ: PerfCounterEvent = 4114;
1746pub const PERFCOUNTEREVT_SCU_EXTERNAL_WRITE: PerfCounterEvent = 4115;
1747pub const PERFCOUNTEREVT_SCU_CYCLE_COUNT: PerfCounterEvent = 4127;
1748#[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"]
1749pub type PerfCounterEvent = ::libc::c_ushort;
1750#[doc = "Event relating to the attachment of a process."]
1751#[repr(C)]
1752#[derive(Debug, Default, Copy, Clone)]
1753pub struct AttachProcessEvent {
1754 #[doc = "< ID of the program."]
1755 pub program_id: u64_,
1756 #[doc = "< Name of the process."]
1757 pub process_name: [::libc::c_char; 8usize],
1758 #[doc = "< ID of the process."]
1759 pub process_id: u32_,
1760 #[doc = "< Always 0"]
1761 pub other_flags: u32_,
1762}
1763#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1764const _: () = {
1765 ["Size of AttachProcessEvent"][::core::mem::size_of::<AttachProcessEvent>() - 24usize];
1766 ["Alignment of AttachProcessEvent"][::core::mem::align_of::<AttachProcessEvent>() - 8usize];
1767 ["Offset of field: AttachProcessEvent::program_id"]
1768 [::core::mem::offset_of!(AttachProcessEvent, program_id) - 0usize];
1769 ["Offset of field: AttachProcessEvent::process_name"]
1770 [::core::mem::offset_of!(AttachProcessEvent, process_name) - 8usize];
1771 ["Offset of field: AttachProcessEvent::process_id"]
1772 [::core::mem::offset_of!(AttachProcessEvent, process_id) - 16usize];
1773 ["Offset of field: AttachProcessEvent::other_flags"]
1774 [::core::mem::offset_of!(AttachProcessEvent, other_flags) - 20usize];
1775};
1776#[doc = "< Process exited either normally or due to an uncaught exception."]
1777pub const EXITPROCESS_EVENT_EXIT: ExitProcessEventReason = 0;
1778#[doc = "< Process has been terminated by svcTerminateProcess."]
1779pub const EXITPROCESS_EVENT_TERMINATE: ExitProcessEventReason = 1;
1780#[doc = "< Process has been terminated by svcTerminateDebugProcess."]
1781pub const EXITPROCESS_EVENT_DEBUG_TERMINATE: ExitProcessEventReason = 2;
1782#[doc = "Reasons for an exit process event."]
1783pub type ExitProcessEventReason = ::libc::c_uchar;
1784#[doc = "Event relating to the exiting of a process."]
1785#[repr(C)]
1786#[derive(Debug, Copy, Clone)]
1787pub struct ExitProcessEvent {
1788 #[doc = "< Reason for exiting. See ExitProcessEventReason"]
1789 pub reason: ExitProcessEventReason,
1790}
1791#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1792const _: () = {
1793 ["Size of ExitProcessEvent"][::core::mem::size_of::<ExitProcessEvent>() - 1usize];
1794 ["Alignment of ExitProcessEvent"][::core::mem::align_of::<ExitProcessEvent>() - 1usize];
1795 ["Offset of field: ExitProcessEvent::reason"]
1796 [::core::mem::offset_of!(ExitProcessEvent, reason) - 0usize];
1797};
1798impl Default for ExitProcessEvent {
1799 fn default() -> Self {
1800 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
1801 unsafe {
1802 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1803 s.assume_init()
1804 }
1805 }
1806}
1807#[doc = "Event relating to the attachment of a thread."]
1808#[repr(C)]
1809#[derive(Debug, Default, Copy, Clone)]
1810pub struct AttachThreadEvent {
1811 #[doc = "< ID of the creating thread."]
1812 pub creator_thread_id: u32_,
1813 #[doc = "< Thread local storage."]
1814 pub thread_local_storage: u32_,
1815 #[doc = "< Entry point of the thread."]
1816 pub entry_point: u32_,
1817}
1818#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1819const _: () = {
1820 ["Size of AttachThreadEvent"][::core::mem::size_of::<AttachThreadEvent>() - 12usize];
1821 ["Alignment of AttachThreadEvent"][::core::mem::align_of::<AttachThreadEvent>() - 4usize];
1822 ["Offset of field: AttachThreadEvent::creator_thread_id"]
1823 [::core::mem::offset_of!(AttachThreadEvent, creator_thread_id) - 0usize];
1824 ["Offset of field: AttachThreadEvent::thread_local_storage"]
1825 [::core::mem::offset_of!(AttachThreadEvent, thread_local_storage) - 4usize];
1826 ["Offset of field: AttachThreadEvent::entry_point"]
1827 [::core::mem::offset_of!(AttachThreadEvent, entry_point) - 8usize];
1828};
1829#[doc = "< Thread exited."]
1830pub const EXITTHREAD_EVENT_EXIT: ExitThreadEventReason = 0;
1831#[doc = "< Thread terminated."]
1832pub const EXITTHREAD_EVENT_TERMINATE: ExitThreadEventReason = 1;
1833#[doc = "< Process exited either normally or due to an uncaught exception."]
1834pub const EXITTHREAD_EVENT_EXIT_PROCESS: ExitThreadEventReason = 2;
1835#[doc = "< Process has been terminated by svcTerminateProcess."]
1836pub const EXITTHREAD_EVENT_TERMINATE_PROCESS: ExitThreadEventReason = 3;
1837#[doc = "Reasons for an exit thread event."]
1838pub type ExitThreadEventReason = ::libc::c_uchar;
1839#[doc = "Event relating to the exiting of a thread."]
1840#[repr(C)]
1841#[derive(Debug, Copy, Clone)]
1842pub struct ExitThreadEvent {
1843 #[doc = "< Reason for exiting. See ExitThreadEventReason"]
1844 pub reason: ExitThreadEventReason,
1845}
1846#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1847const _: () = {
1848 ["Size of ExitThreadEvent"][::core::mem::size_of::<ExitThreadEvent>() - 1usize];
1849 ["Alignment of ExitThreadEvent"][::core::mem::align_of::<ExitThreadEvent>() - 1usize];
1850 ["Offset of field: ExitThreadEvent::reason"]
1851 [::core::mem::offset_of!(ExitThreadEvent, reason) - 0usize];
1852};
1853impl Default for ExitThreadEvent {
1854 fn default() -> Self {
1855 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
1856 unsafe {
1857 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1858 s.assume_init()
1859 }
1860 }
1861}
1862#[doc = "< Panic."]
1863pub const USERBREAK_PANIC: UserBreakType = 0;
1864#[doc = "< Assertion failed."]
1865pub const USERBREAK_ASSERT: UserBreakType = 1;
1866#[doc = "< User related."]
1867pub const USERBREAK_USER: UserBreakType = 2;
1868#[doc = "< Load RO."]
1869pub const USERBREAK_LOAD_RO: UserBreakType = 3;
1870#[doc = "< Unload RO."]
1871pub const USERBREAK_UNLOAD_RO: UserBreakType = 4;
1872#[doc = "Reasons for a user break."]
1873pub type UserBreakType = ::libc::c_uchar;
1874#[doc = "< Undefined instruction."]
1875pub const EXCEVENT_UNDEFINED_INSTRUCTION: ExceptionEventType = 0;
1876#[doc = "< Prefetch abort."]
1877pub const EXCEVENT_PREFETCH_ABORT: ExceptionEventType = 1;
1878#[doc = "< Data abort (other than the below kind)."]
1879pub const EXCEVENT_DATA_ABORT: ExceptionEventType = 2;
1880#[doc = "< Unaligned data access."]
1881pub const EXCEVENT_UNALIGNED_DATA_ACCESS: ExceptionEventType = 3;
1882#[doc = "< Attached break."]
1883pub const EXCEVENT_ATTACH_BREAK: ExceptionEventType = 4;
1884#[doc = "< Stop point reached."]
1885pub const EXCEVENT_STOP_POINT: ExceptionEventType = 5;
1886#[doc = "< User break occurred."]
1887pub const EXCEVENT_USER_BREAK: ExceptionEventType = 6;
1888#[doc = "< Debugger break occurred."]
1889pub const EXCEVENT_DEBUGGER_BREAK: ExceptionEventType = 7;
1890#[doc = "< Undefined syscall."]
1891pub const EXCEVENT_UNDEFINED_SYSCALL: ExceptionEventType = 8;
1892#[doc = "Reasons for an exception event."]
1893pub type ExceptionEventType = ::libc::c_uchar;
1894#[doc = "Event relating to fault exceptions (CPU exceptions other than stop points and undefined syscalls)."]
1895#[repr(C)]
1896#[derive(Debug, Default, Copy, Clone)]
1897pub struct FaultExceptionEvent {
1898 #[doc = "< FAR (for DATA ABORT / UNALIGNED DATA ACCESS), attempted syscall or 0"]
1899 pub fault_information: u32_,
1900}
1901#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1902const _: () = {
1903 ["Size of FaultExceptionEvent"][::core::mem::size_of::<FaultExceptionEvent>() - 4usize];
1904 ["Alignment of FaultExceptionEvent"][::core::mem::align_of::<FaultExceptionEvent>() - 4usize];
1905 ["Offset of field: FaultExceptionEvent::fault_information"]
1906 [::core::mem::offset_of!(FaultExceptionEvent, fault_information) - 0usize];
1907};
1908#[doc = "< See SVC_STOP_POINT."]
1909pub const STOPPOINT_SVC_FF: StopPointType = 0;
1910#[doc = "< Breakpoint."]
1911pub const STOPPOINT_BREAKPOINT: StopPointType = 1;
1912#[doc = "< Watchpoint."]
1913pub const STOPPOINT_WATCHPOINT: StopPointType = 2;
1914#[doc = "Stop point types"]
1915pub type StopPointType = ::libc::c_uchar;
1916#[doc = "Event relating to stop points"]
1917#[repr(C)]
1918#[derive(Debug, Copy, Clone)]
1919pub struct StopPointExceptionEvent {
1920 #[doc = "< Stop point type, see StopPointType."]
1921 pub type_: StopPointType,
1922 #[doc = "< FAR for Watchpoints, otherwise 0."]
1923 pub fault_information: u32_,
1924}
1925#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1926const _: () = {
1927 ["Size of StopPointExceptionEvent"][::core::mem::size_of::<StopPointExceptionEvent>() - 8usize];
1928 ["Alignment of StopPointExceptionEvent"]
1929 [::core::mem::align_of::<StopPointExceptionEvent>() - 4usize];
1930 ["Offset of field: StopPointExceptionEvent::type_"]
1931 [::core::mem::offset_of!(StopPointExceptionEvent, type_) - 0usize];
1932 ["Offset of field: StopPointExceptionEvent::fault_information"]
1933 [::core::mem::offset_of!(StopPointExceptionEvent, fault_information) - 4usize];
1934};
1935impl Default for StopPointExceptionEvent {
1936 fn default() -> Self {
1937 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
1938 unsafe {
1939 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1940 s.assume_init()
1941 }
1942 }
1943}
1944#[doc = "Event relating to svcBreak"]
1945#[repr(C)]
1946#[derive(Debug, Copy, Clone)]
1947pub struct UserBreakExceptionEvent {
1948 #[doc = "< User break type, see UserBreakType."]
1949 pub type_: UserBreakType,
1950 #[doc = "< For LOAD_RO and UNLOAD_RO."]
1951 pub croInfo: u32_,
1952 #[doc = "< For LOAD_RO and UNLOAD_RO."]
1953 pub croInfoSize: u32_,
1954}
1955#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1956const _: () = {
1957 ["Size of UserBreakExceptionEvent"]
1958 [::core::mem::size_of::<UserBreakExceptionEvent>() - 12usize];
1959 ["Alignment of UserBreakExceptionEvent"]
1960 [::core::mem::align_of::<UserBreakExceptionEvent>() - 4usize];
1961 ["Offset of field: UserBreakExceptionEvent::type_"]
1962 [::core::mem::offset_of!(UserBreakExceptionEvent, type_) - 0usize];
1963 ["Offset of field: UserBreakExceptionEvent::croInfo"]
1964 [::core::mem::offset_of!(UserBreakExceptionEvent, croInfo) - 4usize];
1965 ["Offset of field: UserBreakExceptionEvent::croInfoSize"]
1966 [::core::mem::offset_of!(UserBreakExceptionEvent, croInfoSize) - 8usize];
1967};
1968impl Default for UserBreakExceptionEvent {
1969 fn default() -> Self {
1970 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
1971 unsafe {
1972 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1973 s.assume_init()
1974 }
1975 }
1976}
1977#[doc = "Event relating to svcBreakDebugProcess"]
1978#[repr(C)]
1979#[derive(Debug, Default, Copy, Clone)]
1980pub struct DebuggerBreakExceptionEvent {
1981 #[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)."]
1982 pub thread_ids: [s32; 4usize],
1983}
1984#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1985const _: () = {
1986 ["Size of DebuggerBreakExceptionEvent"]
1987 [::core::mem::size_of::<DebuggerBreakExceptionEvent>() - 16usize];
1988 ["Alignment of DebuggerBreakExceptionEvent"]
1989 [::core::mem::align_of::<DebuggerBreakExceptionEvent>() - 4usize];
1990 ["Offset of field: DebuggerBreakExceptionEvent::thread_ids"]
1991 [::core::mem::offset_of!(DebuggerBreakExceptionEvent, thread_ids) - 0usize];
1992};
1993#[doc = "Event relating to exceptions."]
1994#[repr(C)]
1995#[derive(Copy, Clone)]
1996pub struct ExceptionEvent {
1997 #[doc = "< Type of event. See ExceptionEventType."]
1998 pub type_: ExceptionEventType,
1999 #[doc = "< Address of the exception."]
2000 pub address: u32_,
2001 pub __bindgen_anon_1: ExceptionEvent__bindgen_ty_1,
2002}
2003#[repr(C)]
2004#[derive(Copy, Clone)]
2005pub union ExceptionEvent__bindgen_ty_1 {
2006 #[doc = "< Fault exception event data."]
2007 pub fault: FaultExceptionEvent,
2008 #[doc = "< Stop point exception event data."]
2009 pub stop_point: StopPointExceptionEvent,
2010 #[doc = "< User break exception event data."]
2011 pub user_break: UserBreakExceptionEvent,
2012 #[doc = "< Debugger break exception event data"]
2013 pub debugger_break: DebuggerBreakExceptionEvent,
2014}
2015#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2016const _: () = {
2017 ["Size of ExceptionEvent__bindgen_ty_1"]
2018 [::core::mem::size_of::<ExceptionEvent__bindgen_ty_1>() - 16usize];
2019 ["Alignment of ExceptionEvent__bindgen_ty_1"]
2020 [::core::mem::align_of::<ExceptionEvent__bindgen_ty_1>() - 4usize];
2021 ["Offset of field: ExceptionEvent__bindgen_ty_1::fault"]
2022 [::core::mem::offset_of!(ExceptionEvent__bindgen_ty_1, fault) - 0usize];
2023 ["Offset of field: ExceptionEvent__bindgen_ty_1::stop_point"]
2024 [::core::mem::offset_of!(ExceptionEvent__bindgen_ty_1, stop_point) - 0usize];
2025 ["Offset of field: ExceptionEvent__bindgen_ty_1::user_break"]
2026 [::core::mem::offset_of!(ExceptionEvent__bindgen_ty_1, user_break) - 0usize];
2027 ["Offset of field: ExceptionEvent__bindgen_ty_1::debugger_break"]
2028 [::core::mem::offset_of!(ExceptionEvent__bindgen_ty_1, debugger_break) - 0usize];
2029};
2030impl Default for ExceptionEvent__bindgen_ty_1 {
2031 fn default() -> Self {
2032 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
2033 unsafe {
2034 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
2035 s.assume_init()
2036 }
2037 }
2038}
2039#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2040const _: () = {
2041 ["Size of ExceptionEvent"][::core::mem::size_of::<ExceptionEvent>() - 24usize];
2042 ["Alignment of ExceptionEvent"][::core::mem::align_of::<ExceptionEvent>() - 4usize];
2043 ["Offset of field: ExceptionEvent::type_"]
2044 [::core::mem::offset_of!(ExceptionEvent, type_) - 0usize];
2045 ["Offset of field: ExceptionEvent::address"]
2046 [::core::mem::offset_of!(ExceptionEvent, address) - 4usize];
2047};
2048impl Default for ExceptionEvent {
2049 fn default() -> Self {
2050 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
2051 unsafe {
2052 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
2053 s.assume_init()
2054 }
2055 }
2056}
2057#[doc = "Event relating to the scheduler."]
2058#[repr(C)]
2059#[derive(Debug, Default, Copy, Clone)]
2060pub struct ScheduleInOutEvent {
2061 #[doc = "< Clock tick that the event occurred."]
2062 pub clock_tick: u64_,
2063}
2064#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2065const _: () = {
2066 ["Size of ScheduleInOutEvent"][::core::mem::size_of::<ScheduleInOutEvent>() - 8usize];
2067 ["Alignment of ScheduleInOutEvent"][::core::mem::align_of::<ScheduleInOutEvent>() - 8usize];
2068 ["Offset of field: ScheduleInOutEvent::clock_tick"]
2069 [::core::mem::offset_of!(ScheduleInOutEvent, clock_tick) - 0usize];
2070};
2071#[doc = "Event relating to syscalls."]
2072#[repr(C)]
2073#[derive(Debug, Default, Copy, Clone)]
2074pub struct SyscallInOutEvent {
2075 #[doc = "< Clock tick that the event occurred."]
2076 pub clock_tick: u64_,
2077 #[doc = "< Syscall sent/received."]
2078 pub syscall: u32_,
2079}
2080#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2081const _: () = {
2082 ["Size of SyscallInOutEvent"][::core::mem::size_of::<SyscallInOutEvent>() - 16usize];
2083 ["Alignment of SyscallInOutEvent"][::core::mem::align_of::<SyscallInOutEvent>() - 8usize];
2084 ["Offset of field: SyscallInOutEvent::clock_tick"]
2085 [::core::mem::offset_of!(SyscallInOutEvent, clock_tick) - 0usize];
2086 ["Offset of field: SyscallInOutEvent::syscall"]
2087 [::core::mem::offset_of!(SyscallInOutEvent, syscall) - 8usize];
2088};
2089#[doc = "Event relating to debug output."]
2090#[repr(C)]
2091#[derive(Debug, Default, Copy, Clone)]
2092pub struct OutputStringEvent {
2093 #[doc = "< Address of the outputted string."]
2094 pub string_addr: u32_,
2095 #[doc = "< Size of the outputted string."]
2096 pub string_size: u32_,
2097}
2098#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2099const _: () = {
2100 ["Size of OutputStringEvent"][::core::mem::size_of::<OutputStringEvent>() - 8usize];
2101 ["Alignment of OutputStringEvent"][::core::mem::align_of::<OutputStringEvent>() - 4usize];
2102 ["Offset of field: OutputStringEvent::string_addr"]
2103 [::core::mem::offset_of!(OutputStringEvent, string_addr) - 0usize];
2104 ["Offset of field: OutputStringEvent::string_size"]
2105 [::core::mem::offset_of!(OutputStringEvent, string_size) - 4usize];
2106};
2107#[doc = "Event relating to the mapping of memory."]
2108#[repr(C)]
2109#[derive(Debug, Copy, Clone)]
2110pub struct MapEvent {
2111 #[doc = "< Mapped address."]
2112 pub mapped_addr: u32_,
2113 #[doc = "< Mapped size."]
2114 pub mapped_size: u32_,
2115 #[doc = "< Memory permissions. See MemPerm."]
2116 pub memperm: MemPerm,
2117 #[doc = "< Memory state. See MemState."]
2118 pub memstate: MemState,
2119}
2120#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2121const _: () = {
2122 ["Size of MapEvent"][::core::mem::size_of::<MapEvent>() - 16usize];
2123 ["Alignment of MapEvent"][::core::mem::align_of::<MapEvent>() - 4usize];
2124 ["Offset of field: MapEvent::mapped_addr"]
2125 [::core::mem::offset_of!(MapEvent, mapped_addr) - 0usize];
2126 ["Offset of field: MapEvent::mapped_size"]
2127 [::core::mem::offset_of!(MapEvent, mapped_size) - 4usize];
2128 ["Offset of field: MapEvent::memperm"][::core::mem::offset_of!(MapEvent, memperm) - 8usize];
2129 ["Offset of field: MapEvent::memstate"][::core::mem::offset_of!(MapEvent, memstate) - 12usize];
2130};
2131impl Default for MapEvent {
2132 fn default() -> Self {
2133 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
2134 unsafe {
2135 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
2136 s.assume_init()
2137 }
2138 }
2139}
2140#[doc = "< Process attached event."]
2141pub const DBGEVENT_ATTACH_PROCESS: DebugEventType = 0;
2142#[doc = "< Thread attached event."]
2143pub const DBGEVENT_ATTACH_THREAD: DebugEventType = 1;
2144#[doc = "< Thread exit event."]
2145pub const DBGEVENT_EXIT_THREAD: DebugEventType = 2;
2146#[doc = "< Process exit event."]
2147pub const DBGEVENT_EXIT_PROCESS: DebugEventType = 3;
2148#[doc = "< Exception event."]
2149pub const DBGEVENT_EXCEPTION: DebugEventType = 4;
2150#[doc = "< DLL load event."]
2151pub const DBGEVENT_DLL_LOAD: DebugEventType = 5;
2152#[doc = "< DLL unload event."]
2153pub const DBGEVENT_DLL_UNLOAD: DebugEventType = 6;
2154#[doc = "< Schedule in event."]
2155pub const DBGEVENT_SCHEDULE_IN: DebugEventType = 7;
2156#[doc = "< Schedule out event."]
2157pub const DBGEVENT_SCHEDULE_OUT: DebugEventType = 8;
2158#[doc = "< Syscall in event."]
2159pub const DBGEVENT_SYSCALL_IN: DebugEventType = 9;
2160#[doc = "< Syscall out event."]
2161pub const DBGEVENT_SYSCALL_OUT: DebugEventType = 10;
2162#[doc = "< Output string event."]
2163pub const DBGEVENT_OUTPUT_STRING: DebugEventType = 11;
2164#[doc = "< Map event."]
2165pub const DBGEVENT_MAP: DebugEventType = 12;
2166#[doc = "Debug event type."]
2167pub type DebugEventType = ::libc::c_uchar;
2168#[doc = "Information about a debug event."]
2169#[repr(C)]
2170#[derive(Copy, Clone)]
2171pub struct DebugEventInfo {
2172 #[doc = "< Type of event. See DebugEventType"]
2173 pub type_: DebugEventType,
2174 #[doc = "< ID of the thread."]
2175 pub thread_id: u32_,
2176 #[doc = "< Flags. Bit0 means that svcContinueDebugEvent needs to be called for this event (except for EXIT PROCESS events, where this flag is disregarded)."]
2177 pub flags: u32_,
2178 #[doc = "< Always 0."]
2179 pub remnants: [u8_; 4usize],
2180 pub __bindgen_anon_1: DebugEventInfo__bindgen_ty_1,
2181}
2182#[repr(C)]
2183#[derive(Copy, Clone)]
2184pub union DebugEventInfo__bindgen_ty_1 {
2185 #[doc = "< Process attachment event data."]
2186 pub attach_process: AttachProcessEvent,
2187 #[doc = "< Thread attachment event data."]
2188 pub attach_thread: AttachThreadEvent,
2189 #[doc = "< Thread exit event data."]
2190 pub exit_thread: ExitThreadEvent,
2191 #[doc = "< Process exit event data."]
2192 pub exit_process: ExitProcessEvent,
2193 #[doc = "< Exception event data."]
2194 pub exception: ExceptionEvent,
2195 #[doc = "< Schedule in/out event data."]
2196 pub scheduler: ScheduleInOutEvent,
2197 #[doc = "< Syscall in/out event data."]
2198 pub syscall: SyscallInOutEvent,
2199 #[doc = "< Output string event data."]
2200 pub output_string: OutputStringEvent,
2201 #[doc = "< Map event data."]
2202 pub map: MapEvent,
2203}
2204#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2205const _: () = {
2206 ["Size of DebugEventInfo__bindgen_ty_1"]
2207 [::core::mem::size_of::<DebugEventInfo__bindgen_ty_1>() - 24usize];
2208 ["Alignment of DebugEventInfo__bindgen_ty_1"]
2209 [::core::mem::align_of::<DebugEventInfo__bindgen_ty_1>() - 8usize];
2210 ["Offset of field: DebugEventInfo__bindgen_ty_1::attach_process"]
2211 [::core::mem::offset_of!(DebugEventInfo__bindgen_ty_1, attach_process) - 0usize];
2212 ["Offset of field: DebugEventInfo__bindgen_ty_1::attach_thread"]
2213 [::core::mem::offset_of!(DebugEventInfo__bindgen_ty_1, attach_thread) - 0usize];
2214 ["Offset of field: DebugEventInfo__bindgen_ty_1::exit_thread"]
2215 [::core::mem::offset_of!(DebugEventInfo__bindgen_ty_1, exit_thread) - 0usize];
2216 ["Offset of field: DebugEventInfo__bindgen_ty_1::exit_process"]
2217 [::core::mem::offset_of!(DebugEventInfo__bindgen_ty_1, exit_process) - 0usize];
2218 ["Offset of field: DebugEventInfo__bindgen_ty_1::exception"]
2219 [::core::mem::offset_of!(DebugEventInfo__bindgen_ty_1, exception) - 0usize];
2220 ["Offset of field: DebugEventInfo__bindgen_ty_1::scheduler"]
2221 [::core::mem::offset_of!(DebugEventInfo__bindgen_ty_1, scheduler) - 0usize];
2222 ["Offset of field: DebugEventInfo__bindgen_ty_1::syscall"]
2223 [::core::mem::offset_of!(DebugEventInfo__bindgen_ty_1, syscall) - 0usize];
2224 ["Offset of field: DebugEventInfo__bindgen_ty_1::output_string"]
2225 [::core::mem::offset_of!(DebugEventInfo__bindgen_ty_1, output_string) - 0usize];
2226 ["Offset of field: DebugEventInfo__bindgen_ty_1::map"]
2227 [::core::mem::offset_of!(DebugEventInfo__bindgen_ty_1, map) - 0usize];
2228};
2229impl Default for DebugEventInfo__bindgen_ty_1 {
2230 fn default() -> Self {
2231 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
2232 unsafe {
2233 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
2234 s.assume_init()
2235 }
2236 }
2237}
2238#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2239const _: () = {
2240 ["Size of DebugEventInfo"][::core::mem::size_of::<DebugEventInfo>() - 40usize];
2241 ["Alignment of DebugEventInfo"][::core::mem::align_of::<DebugEventInfo>() - 8usize];
2242 ["Offset of field: DebugEventInfo::type_"]
2243 [::core::mem::offset_of!(DebugEventInfo, type_) - 0usize];
2244 ["Offset of field: DebugEventInfo::thread_id"]
2245 [::core::mem::offset_of!(DebugEventInfo, thread_id) - 4usize];
2246 ["Offset of field: DebugEventInfo::flags"]
2247 [::core::mem::offset_of!(DebugEventInfo, flags) - 8usize];
2248 ["Offset of field: DebugEventInfo::remnants"]
2249 [::core::mem::offset_of!(DebugEventInfo, remnants) - 12usize];
2250};
2251impl Default for DebugEventInfo {
2252 fn default() -> Self {
2253 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
2254 unsafe {
2255 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
2256 s.assume_init()
2257 }
2258 }
2259}
2260#[doc = "< Inhibit user-defined CPU exception handlers (including watchpoints and breakpoints, regardless of any svcKernelSetState call)."]
2261pub const DBG_INHIBIT_USER_CPU_EXCEPTION_HANDLERS: DebugFlags = 1;
2262#[doc = "< Signal fault exception events. See FaultExceptionEvent."]
2263pub const DBG_SIGNAL_FAULT_EXCEPTION_EVENTS: DebugFlags = 2;
2264#[doc = "< Signal schedule in/out events. See ScheduleInOutEvent."]
2265pub const DBG_SIGNAL_SCHEDULE_EVENTS: DebugFlags = 4;
2266#[doc = "< Signal syscall in/out events. See SyscallInOutEvent."]
2267pub const DBG_SIGNAL_SYSCALL_EVENTS: DebugFlags = 8;
2268#[doc = "< Signal map events. See MapEvent."]
2269pub const DBG_SIGNAL_MAP_EVENTS: DebugFlags = 16;
2270#[doc = "Debug flags for an attached process, set by svcContinueDebugEvent"]
2271pub type DebugFlags = ::libc::c_uchar;
2272#[repr(C)]
2273#[derive(Copy, Clone)]
2274pub struct ThreadContext {
2275 #[doc = "< CPU registers."]
2276 pub cpu_registers: CpuRegisters,
2277 #[doc = "< FPU registers."]
2278 pub fpu_registers: FpuRegisters,
2279}
2280#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2281const _: () = {
2282 ["Size of ThreadContext"][::core::mem::size_of::<ThreadContext>() - 204usize];
2283 ["Alignment of ThreadContext"][::core::mem::align_of::<ThreadContext>() - 4usize];
2284 ["Offset of field: ThreadContext::cpu_registers"]
2285 [::core::mem::offset_of!(ThreadContext, cpu_registers) - 0usize];
2286 ["Offset of field: ThreadContext::fpu_registers"]
2287 [::core::mem::offset_of!(ThreadContext, fpu_registers) - 68usize];
2288};
2289impl Default for ThreadContext {
2290 fn default() -> Self {
2291 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
2292 unsafe {
2293 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
2294 s.assume_init()
2295 }
2296 }
2297}
2298#[doc = "< Control r0-r12."]
2299pub const THREADCONTEXT_CONTROL_CPU_GPRS: ThreadContextControlFlags = 1;
2300#[doc = "< Control sp, lr, pc, cpsr."]
2301pub const THREADCONTEXT_CONTROL_CPU_SPRS: ThreadContextControlFlags = 2;
2302#[doc = "< Control d0-d15 (or s0-s31)."]
2303pub const THREADCONTEXT_CONTROL_FPU_GPRS: ThreadContextControlFlags = 4;
2304#[doc = "< Control fpscr, fpexc."]
2305pub const THREADCONTEXT_CONTROL_FPU_SPRS: ThreadContextControlFlags = 8;
2306#[doc = "< Control r0-r12, sp, lr, pc, cpsr."]
2307pub const THREADCONTEXT_CONTROL_CPU_REGS: ThreadContextControlFlags = 3;
2308#[doc = "< Control d0-d15, fpscr, fpexc."]
2309pub const THREADCONTEXT_CONTROL_FPU_REGS: ThreadContextControlFlags = 12;
2310#[doc = "< Control all of the above."]
2311pub const THREADCONTEXT_CONTROL_ALL: ThreadContextControlFlags = 15;
2312#[doc = "Control flags for svcGetDebugThreadContext and svcSetDebugThreadContext"]
2313pub type ThreadContextControlFlags = ::libc::c_uchar;
2314#[doc = "< Thread priority."]
2315pub const DBGTHREAD_PARAMETER_PRIORITY: DebugThreadParameter = 0;
2316#[doc = "< Low scheduling mask."]
2317pub const DBGTHREAD_PARAMETER_SCHEDULING_MASK_LOW: DebugThreadParameter = 1;
2318#[doc = "< Ideal processor."]
2319pub const DBGTHREAD_PARAMETER_CPU_IDEAL: DebugThreadParameter = 2;
2320#[doc = "< Processor that created the threod."]
2321pub const DBGTHREAD_PARAMETER_CPU_CREATOR: DebugThreadParameter = 3;
2322#[doc = "Thread parameter field for svcGetDebugThreadParameter"]
2323pub type DebugThreadParameter = ::libc::c_uchar;
2324#[doc = "Information on address space for process. All sizes are in pages (0x1000 bytes)"]
2325#[repr(C)]
2326#[derive(Debug, Default, Copy, Clone)]
2327pub struct CodeSetHeader {
2328 #[doc = "< ASCII name of codeset"]
2329 pub name: [u8_; 8usize],
2330 #[doc = "< Version field of codeset (unused)"]
2331 pub version: u16_,
2332 #[doc = "< Padding"]
2333 pub padding: [u16_; 3usize],
2334 #[doc = "< .text start address"]
2335 pub text_addr: u32_,
2336 #[doc = "< .text number of pages"]
2337 pub text_size: u32_,
2338 #[doc = "< .rodata start address"]
2339 pub ro_addr: u32_,
2340 #[doc = "< .rodata number of pages"]
2341 pub ro_size: u32_,
2342 #[doc = "< .data, .bss start address"]
2343 pub rw_addr: u32_,
2344 #[doc = "< .data number of pages"]
2345 pub rw_size: u32_,
2346 #[doc = "< total pages for .text (aligned)"]
2347 pub text_size_total: u32_,
2348 #[doc = "< total pages for .rodata (aligned)"]
2349 pub ro_size_total: u32_,
2350 #[doc = "< total pages for .data, .bss (aligned)"]
2351 pub rw_size_total: u32_,
2352 #[doc = "< Padding"]
2353 pub padding2: u32_,
2354 #[doc = "< Program ID"]
2355 pub program_id: u64_,
2356}
2357#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2358const _: () = {
2359 ["Size of CodeSetHeader"][::core::mem::size_of::<CodeSetHeader>() - 64usize];
2360 ["Alignment of CodeSetHeader"][::core::mem::align_of::<CodeSetHeader>() - 8usize];
2361 ["Offset of field: CodeSetHeader::name"][::core::mem::offset_of!(CodeSetHeader, name) - 0usize];
2362 ["Offset of field: CodeSetHeader::version"]
2363 [::core::mem::offset_of!(CodeSetHeader, version) - 8usize];
2364 ["Offset of field: CodeSetHeader::padding"]
2365 [::core::mem::offset_of!(CodeSetHeader, padding) - 10usize];
2366 ["Offset of field: CodeSetHeader::text_addr"]
2367 [::core::mem::offset_of!(CodeSetHeader, text_addr) - 16usize];
2368 ["Offset of field: CodeSetHeader::text_size"]
2369 [::core::mem::offset_of!(CodeSetHeader, text_size) - 20usize];
2370 ["Offset of field: CodeSetHeader::ro_addr"]
2371 [::core::mem::offset_of!(CodeSetHeader, ro_addr) - 24usize];
2372 ["Offset of field: CodeSetHeader::ro_size"]
2373 [::core::mem::offset_of!(CodeSetHeader, ro_size) - 28usize];
2374 ["Offset of field: CodeSetHeader::rw_addr"]
2375 [::core::mem::offset_of!(CodeSetHeader, rw_addr) - 32usize];
2376 ["Offset of field: CodeSetHeader::rw_size"]
2377 [::core::mem::offset_of!(CodeSetHeader, rw_size) - 36usize];
2378 ["Offset of field: CodeSetHeader::text_size_total"]
2379 [::core::mem::offset_of!(CodeSetHeader, text_size_total) - 40usize];
2380 ["Offset of field: CodeSetHeader::ro_size_total"]
2381 [::core::mem::offset_of!(CodeSetHeader, ro_size_total) - 44usize];
2382 ["Offset of field: CodeSetHeader::rw_size_total"]
2383 [::core::mem::offset_of!(CodeSetHeader, rw_size_total) - 48usize];
2384 ["Offset of field: CodeSetHeader::padding2"]
2385 [::core::mem::offset_of!(CodeSetHeader, padding2) - 52usize];
2386 ["Offset of field: CodeSetHeader::program_id"]
2387 [::core::mem::offset_of!(CodeSetHeader, program_id) - 56usize];
2388};
2389#[doc = "Information for the main thread of a process."]
2390#[repr(C)]
2391#[derive(Debug, Copy, Clone)]
2392pub struct StartupInfo {
2393 #[doc = "< Priority of the main thread."]
2394 pub priority: ::libc::c_int,
2395 #[doc = "< Size of the stack of the main thread."]
2396 pub stack_size: u32_,
2397 #[doc = "< Unused on retail kernel."]
2398 pub argc: ::libc::c_int,
2399 #[doc = "< Unused on retail kernel."]
2400 pub argv: *mut u16_,
2401 #[doc = "< Unused on retail kernel."]
2402 pub envp: *mut u16_,
2403}
2404#[allow(clippy::unnecessary_operation, clippy::identity_op)]
2405const _: () = {
2406 ["Size of StartupInfo"][::core::mem::size_of::<StartupInfo>() - 20usize];
2407 ["Alignment of StartupInfo"][::core::mem::align_of::<StartupInfo>() - 4usize];
2408 ["Offset of field: StartupInfo::priority"]
2409 [::core::mem::offset_of!(StartupInfo, priority) - 0usize];
2410 ["Offset of field: StartupInfo::stack_size"]
2411 [::core::mem::offset_of!(StartupInfo, stack_size) - 4usize];
2412 ["Offset of field: StartupInfo::argc"][::core::mem::offset_of!(StartupInfo, argc) - 8usize];
2413 ["Offset of field: StartupInfo::argv"][::core::mem::offset_of!(StartupInfo, argv) - 12usize];
2414 ["Offset of field: StartupInfo::envp"][::core::mem::offset_of!(StartupInfo, envp) - 16usize];
2415};
2416impl Default for StartupInfo {
2417 fn default() -> Self {
2418 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
2419 unsafe {
2420 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
2421 s.assume_init()
2422 }
2423 }
2424}
2425unsafe extern "C" {
2426 #[doc = "Gets the thread local storage buffer.\n # Returns\n\nThe thread local storage buffer."]
2427 #[link_name = "getThreadLocalStorage__extern"]
2428 pub fn getThreadLocalStorage() -> *mut ::libc::c_void;
2429}
2430unsafe extern "C" {
2431 #[doc = "Gets the thread command buffer.\n # Returns\n\nThe thread command buffer."]
2432 #[link_name = "getThreadCommandBuffer__extern"]
2433 pub fn getThreadCommandBuffer() -> *mut u32_;
2434}
2435unsafe extern "C" {
2436 #[doc = "Gets the thread static buffer.\n # Returns\n\nThe thread static buffer."]
2437 #[link_name = "getThreadStaticBuffers__extern"]
2438 pub fn getThreadStaticBuffers() -> *mut u32_;
2439}
2440unsafe extern "C" {
2441 #[doc = "Writes the default DMA device config that the kernel uses when DMACFG_*_IS_DEVICE and DMACFG_*_USE_CFG are not set"]
2442 #[link_name = "dmaDeviceConfigInitDefault__extern"]
2443 pub fn dmaDeviceConfigInitDefault(cfg: *mut DmaDeviceConfig);
2444}
2445unsafe extern "C" {
2446 #[doc = "Initializes a DmaConfig instance with sane defaults for RAM<>RAM tranfers"]
2447 #[link_name = "dmaConfigInitDefault__extern"]
2448 pub fn dmaConfigInitDefault(cfg: *mut DmaConfig);
2449}
2450unsafe extern "C" {
2451 #[must_use]
2452 #[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/"]
2453 pub fn svcControlMemory(
2454 addr_out: *mut u32_,
2455 addr0: u32_,
2456 addr1: u32_,
2457 size: u32_,
2458 op: MemOp,
2459 perm: MemPerm,
2460 ) -> Result;
2461}
2462unsafe extern "C" {
2463 #[must_use]
2464 #[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`]"]
2465 pub fn svcControlProcessMemory(
2466 process: Handle,
2467 addr0: u32_,
2468 addr1: u32_,
2469 size: u32_,
2470 type_: u32_,
2471 perm: u32_,
2472 ) -> Result;
2473}
2474unsafe extern "C" {
2475 #[must_use]
2476 #[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."]
2477 pub fn svcCreateMemoryBlock(
2478 memblock: *mut Handle,
2479 addr: u32_,
2480 size: u32_,
2481 my_perm: MemPerm,
2482 other_perm: MemPerm,
2483 ) -> Result;
2484}
2485unsafe extern "C" {
2486 #[must_use]
2487 #[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."]
2488 pub fn svcMapMemoryBlock(
2489 memblock: Handle,
2490 addr: u32_,
2491 my_perm: MemPerm,
2492 other_perm: MemPerm,
2493 ) -> Result;
2494}
2495unsafe extern "C" {
2496 #[must_use]
2497 #[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)."]
2498 pub fn svcMapProcessMemory(process: Handle, destAddress: u32_, size: u32_) -> Result;
2499}
2500unsafe extern "C" {
2501 #[must_use]
2502 #[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)."]
2503 pub fn svcUnmapProcessMemory(process: Handle, destAddress: u32_, size: u32_) -> Result;
2504}
2505unsafe extern "C" {
2506 #[must_use]
2507 #[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."]
2508 pub fn svcUnmapMemoryBlock(memblock: Handle, addr: u32_) -> Result;
2509}
2510unsafe extern "C" {
2511 #[must_use]
2512 #[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."]
2513 pub fn svcQueryMemory(info: *mut MemInfo, out: *mut PageInfo, addr: u32_) -> Result;
2514}
2515unsafe extern "C" {
2516 #[must_use]
2517 #[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."]
2518 pub fn svcQueryProcessMemory(
2519 info: *mut MemInfo,
2520 out: *mut PageInfo,
2521 process: Handle,
2522 addr: u32_,
2523 ) -> Result;
2524}
2525unsafe extern "C" {
2526 #[must_use]
2527 #[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/"]
2528 pub fn svcOpenProcess(process: *mut Handle, processId: u32_) -> Result;
2529}
2530unsafe extern "C" {
2531 #[doc = "Exits the current process."]
2532 pub fn svcExitProcess() -> !;
2533}
2534unsafe extern "C" {
2535 #[must_use]
2536 #[doc = "Terminates a process.\n # Arguments\n\n* `process` - Handle of the process to terminate."]
2537 pub fn svcTerminateProcess(process: Handle) -> Result;
2538}
2539unsafe extern "C" {
2540 #[must_use]
2541 #[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."]
2542 pub fn svcGetProcessInfo(out: *mut s64, process: Handle, type_: u32_) -> Result;
2543}
2544unsafe extern "C" {
2545 #[must_use]
2546 #[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."]
2547 pub fn svcGetProcessId(out: *mut u32_, handle: Handle) -> Result;
2548}
2549unsafe extern "C" {
2550 #[must_use]
2551 #[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."]
2552 pub fn svcGetProcessList(
2553 processCount: *mut s32,
2554 processIds: *mut u32_,
2555 processIdMaxCount: s32,
2556 ) -> Result;
2557}
2558unsafe extern "C" {
2559 #[must_use]
2560 #[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."]
2561 pub fn svcGetThreadList(
2562 threadCount: *mut s32,
2563 threadIds: *mut u32_,
2564 threadIdMaxCount: s32,
2565 process: Handle,
2566 ) -> Result;
2567}
2568unsafe extern "C" {
2569 #[must_use]
2570 #[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."]
2571 pub fn svcCreatePort(
2572 portServer: *mut Handle,
2573 portClient: *mut Handle,
2574 name: *const ::libc::c_char,
2575 maxSessions: s32,
2576 ) -> Result;
2577}
2578unsafe extern "C" {
2579 #[must_use]
2580 #[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."]
2581 pub fn svcConnectToPort(out: *mut Handle, portName: *const ::libc::c_char) -> Result;
2582}
2583unsafe extern "C" {
2584 #[must_use]
2585 #[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."]
2586 pub fn svcCreateCodeSet(
2587 out: *mut Handle,
2588 info: *const CodeSetHeader,
2589 textSegmentLma: u32_,
2590 roSegmentLma: u32_,
2591 dataSegmentLma: u32_,
2592 ) -> Result;
2593}
2594unsafe extern "C" {
2595 #[must_use]
2596 #[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."]
2597 pub fn svcCreateProcess(
2598 out: *mut Handle,
2599 codeset: Handle,
2600 arm11KernelCaps: *const u32_,
2601 numArm11KernelCaps: s32,
2602 ) -> Result;
2603}
2604unsafe extern "C" {
2605 #[must_use]
2606 #[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."]
2607 pub fn svcGetProcessAffinityMask(
2608 affinitymask: *mut u8_,
2609 process: Handle,
2610 processorcount: s32,
2611 ) -> Result;
2612}
2613unsafe extern "C" {
2614 #[must_use]
2615 #[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."]
2616 pub fn svcSetProcessAffinityMask(
2617 process: Handle,
2618 affinitymask: *const u8_,
2619 processorcount: s32,
2620 ) -> Result;
2621}
2622unsafe extern "C" {
2623 #[must_use]
2624 #[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."]
2625 pub fn svcGetProcessIdealProcessor(processorid: *mut s32, process: Handle) -> Result;
2626}
2627unsafe extern "C" {
2628 #[must_use]
2629 #[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."]
2630 pub fn svcSetProcessIdealProcessor(process: Handle, processorid: s32) -> Result;
2631}
2632unsafe extern "C" {
2633 #[must_use]
2634 #[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."]
2635 pub fn svcRun(process: Handle, info: *const StartupInfo) -> Result;
2636}
2637unsafe extern "C" {
2638 #[must_use]
2639 #[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/"]
2640 pub fn svcCreateThread(
2641 thread: *mut Handle,
2642 entrypoint: ThreadFunc,
2643 arg: u32_,
2644 stack_top: *mut u32_,
2645 thread_priority: s32,
2646 processor_id: s32,
2647 ) -> Result;
2648}
2649unsafe extern "C" {
2650 #[must_use]
2651 #[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"]
2652 pub fn svcOpenThread(thread: *mut Handle, process: Handle, threadId: u32_) -> Result;
2653}
2654unsafe extern "C" {
2655 #[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); "]
2656 pub fn svcExitThread() -> !;
2657}
2658unsafe extern "C" {
2659 #[doc = "Puts the current thread to sleep.\n # Arguments\n\n* `ns` - The minimum number of nanoseconds to sleep for."]
2660 pub fn svcSleepThread(ns: s64);
2661}
2662unsafe extern "C" {
2663 #[must_use]
2664 #[doc = "Retrieves the priority of a thread."]
2665 pub fn svcGetThreadPriority(out: *mut s32, handle: Handle) -> Result;
2666}
2667unsafe extern "C" {
2668 #[must_use]
2669 #[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."]
2670 pub fn svcSetThreadPriority(thread: Handle, prio: s32) -> Result;
2671}
2672unsafe extern "C" {
2673 #[must_use]
2674 #[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."]
2675 pub fn svcGetThreadAffinityMask(
2676 affinitymask: *mut u8_,
2677 thread: Handle,
2678 processorcount: s32,
2679 ) -> Result;
2680}
2681unsafe extern "C" {
2682 #[must_use]
2683 #[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."]
2684 pub fn svcSetThreadAffinityMask(
2685 thread: Handle,
2686 affinitymask: *const u8_,
2687 processorcount: s32,
2688 ) -> Result;
2689}
2690unsafe extern "C" {
2691 #[must_use]
2692 #[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."]
2693 pub fn svcGetThreadIdealProcessor(processorid: *mut s32, thread: Handle) -> Result;
2694}
2695unsafe extern "C" {
2696 #[must_use]
2697 #[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."]
2698 pub fn svcSetThreadIdealProcessor(thread: Handle, processorid: s32) -> Result;
2699}
2700unsafe extern "C" {
2701 #[doc = "Returns the ID of the processor the current thread is running on.\n [`svcCreateThread`]"]
2702 pub fn svcGetProcessorID() -> s32;
2703}
2704unsafe extern "C" {
2705 #[must_use]
2706 #[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."]
2707 pub fn svcGetThreadId(out: *mut u32_, handle: Handle) -> Result;
2708}
2709unsafe extern "C" {
2710 #[must_use]
2711 #[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."]
2712 pub fn svcGetResourceLimit(resourceLimit: *mut Handle, process: Handle) -> Result;
2713}
2714unsafe extern "C" {
2715 #[must_use]
2716 #[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."]
2717 pub fn svcGetResourceLimitLimitValues(
2718 values: *mut s64,
2719 resourceLimit: Handle,
2720 names: *mut ResourceLimitType,
2721 nameCount: s32,
2722 ) -> Result;
2723}
2724unsafe extern "C" {
2725 #[must_use]
2726 #[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."]
2727 pub fn svcGetResourceLimitCurrentValues(
2728 values: *mut s64,
2729 resourceLimit: Handle,
2730 names: *mut ResourceLimitType,
2731 nameCount: s32,
2732 ) -> Result;
2733}
2734unsafe extern "C" {
2735 #[must_use]
2736 #[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."]
2737 pub fn svcSetProcessResourceLimits(process: Handle, resourceLimit: Handle) -> Result;
2738}
2739unsafe extern "C" {
2740 #[must_use]
2741 #[doc = "Creates a resource limit set.\n # Arguments\n\n* `resourceLimit` (direction out) - Pointer to output the resource limit set handle to."]
2742 pub fn svcCreateResourceLimit(resourceLimit: *mut Handle) -> Result;
2743}
2744unsafe extern "C" {
2745 #[must_use]
2746 #[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."]
2747 pub fn svcSetResourceLimitValues(
2748 resourceLimit: Handle,
2749 names: *const ResourceLimitType,
2750 values: *const s64,
2751 nameCount: s32,
2752 ) -> Result;
2753}
2754unsafe extern "C" {
2755 #[must_use]
2756 #[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`]"]
2757 pub fn svcGetProcessIdOfThread(out: *mut u32_, handle: Handle) -> Result;
2758}
2759unsafe extern "C" {
2760 #[must_use]
2761 #[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."]
2762 pub fn svcGetThreadInfo(out: *mut s64, thread: Handle, type_: ThreadInfoType) -> Result;
2763}
2764unsafe extern "C" {
2765 #[must_use]
2766 #[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/"]
2767 pub fn svcCreateMutex(mutex: *mut Handle, initially_locked: bool) -> Result;
2768}
2769unsafe extern "C" {
2770 #[must_use]
2771 #[doc = "Releases a mutex.\n # Arguments\n\n* `handle` - Handle of the mutex."]
2772 pub fn svcReleaseMutex(handle: Handle) -> Result;
2773}
2774unsafe extern "C" {
2775 #[must_use]
2776 #[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."]
2777 pub fn svcCreateSemaphore(semaphore: *mut Handle, initial_count: s32, max_count: s32)
2778 -> Result;
2779}
2780unsafe extern "C" {
2781 #[must_use]
2782 #[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."]
2783 pub fn svcReleaseSemaphore(count: *mut s32, semaphore: Handle, release_count: s32) -> Result;
2784}
2785unsafe extern "C" {
2786 #[must_use]
2787 #[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)."]
2788 pub fn svcCreateEvent(event: *mut Handle, reset_type: ResetType) -> Result;
2789}
2790unsafe extern "C" {
2791 #[must_use]
2792 #[doc = "Signals an event.\n # Arguments\n\n* `handle` - Handle of the event to signal."]
2793 pub fn svcSignalEvent(handle: Handle) -> Result;
2794}
2795unsafe extern "C" {
2796 #[must_use]
2797 #[doc = "Clears an event.\n # Arguments\n\n* `handle` - Handle of the event to clear."]
2798 pub fn svcClearEvent(handle: Handle) -> Result;
2799}
2800unsafe extern "C" {
2801 #[must_use]
2802 #[doc = "Waits for synchronization on a handle.\n # Arguments\n\n* `handle` - Handle to wait on.\n * `nanoseconds` - Maximum nanoseconds to wait for."]
2803 pub fn svcWaitSynchronization(handle: Handle, nanoseconds: s64) -> Result;
2804}
2805unsafe extern "C" {
2806 #[must_use]
2807 #[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."]
2808 pub fn svcWaitSynchronizationN(
2809 out: *mut s32,
2810 handles: *const Handle,
2811 handles_num: s32,
2812 wait_all: bool,
2813 nanoseconds: s64,
2814 ) -> Result;
2815}
2816unsafe extern "C" {
2817 #[must_use]
2818 #[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`]"]
2819 pub fn svcCreateAddressArbiter(arbiter: *mut Handle) -> Result;
2820}
2821unsafe extern "C" {
2822 #[must_use]
2823 #[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."]
2824 pub fn svcArbitrateAddress(
2825 arbiter: Handle,
2826 addr: u32_,
2827 type_: ArbitrationType,
2828 value: s32,
2829 timeout_ns: s64,
2830 ) -> Result;
2831}
2832unsafe extern "C" {
2833 #[must_use]
2834 #[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."]
2835 pub fn svcArbitrateAddressNoTimeout(
2836 arbiter: Handle,
2837 addr: u32_,
2838 type_: ArbitrationType,
2839 value: s32,
2840 ) -> Result;
2841}
2842unsafe extern "C" {
2843 #[must_use]
2844 #[doc = "Sends a synchronized request to a session handle.\n # Arguments\n\n* `session` - Handle of the session."]
2845 pub fn svcSendSyncRequest(session: Handle) -> Result;
2846}
2847unsafe extern "C" {
2848 #[must_use]
2849 #[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."]
2850 pub fn svcCreateSessionToPort(clientSession: *mut Handle, clientPort: Handle) -> Result;
2851}
2852unsafe extern "C" {
2853 #[must_use]
2854 #[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."]
2855 pub fn svcCreateSession(serverSession: *mut Handle, clientSession: *mut Handle) -> Result;
2856}
2857unsafe extern "C" {
2858 #[must_use]
2859 #[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."]
2860 pub fn svcAcceptSession(session: *mut Handle, port: Handle) -> Result;
2861}
2862unsafe extern "C" {
2863 #[must_use]
2864 #[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."]
2865 pub fn svcReplyAndReceive(
2866 index: *mut s32,
2867 handles: *const Handle,
2868 handleCount: s32,
2869 replyTarget: Handle,
2870 ) -> Result;
2871}
2872unsafe extern "C" {
2873 #[must_use]
2874 #[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/"]
2875 pub fn svcCreateTimer(timer: *mut Handle, reset_type: ResetType) -> Result;
2876}
2877unsafe extern "C" {
2878 #[must_use]
2879 #[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."]
2880 pub fn svcSetTimer(timer: Handle, initial: s64, interval: s64) -> Result;
2881}
2882unsafe extern "C" {
2883 #[must_use]
2884 #[doc = "Cancels a timer.\n # Arguments\n\n* `timer` - Handle of the timer to cancel."]
2885 pub fn svcCancelTimer(timer: Handle) -> Result;
2886}
2887unsafe extern "C" {
2888 #[must_use]
2889 #[doc = "Clears a timer.\n # Arguments\n\n* `timer` - Handle of the timer to clear."]
2890 pub fn svcClearTimer(timer: Handle) -> Result;
2891}
2892unsafe extern "C" {
2893 #[doc = "Gets the current system tick.\n # Returns\n\nThe current system tick."]
2894 pub fn svcGetSystemTick() -> u64_;
2895}
2896unsafe extern "C" {
2897 #[must_use]
2898 #[doc = "System\n# *\n* Closes a handle.\n # Arguments\n\n* `handle` - Handle to close.\n/"]
2899 pub fn svcCloseHandle(handle: Handle) -> Result;
2900}
2901unsafe extern "C" {
2902 #[must_use]
2903 #[doc = "Duplicates a handle.\n # Arguments\n\n* `out` (direction out) - Pointer to output the duplicated handle to.\n * `original` - Handle to duplicate."]
2904 pub fn svcDuplicateHandle(out: *mut Handle, original: Handle) -> Result;
2905}
2906unsafe extern "C" {
2907 #[must_use]
2908 #[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."]
2909 pub fn svcGetHandleInfo(out: *mut s64, handle: Handle, param: u32_) -> Result;
2910}
2911unsafe extern "C" {
2912 #[must_use]
2913 #[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."]
2914 pub fn svcGetSystemInfo(out: *mut s64, type_: u32_, param: s32) -> Result;
2915}
2916unsafe extern "C" {
2917 #[must_use]
2918 #[doc = "Sets the current kernel state.\n # Arguments\n\n* `type` - Type of state to set (the other parameters depend on it)."]
2919 pub fn svcKernelSetState(type_: u32_, ...) -> Result;
2920}
2921unsafe extern "C" {
2922 #[must_use]
2923 #[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)."]
2924 pub fn svcBindInterrupt(
2925 interruptId: u32_,
2926 eventOrSemaphore: Handle,
2927 priority: s32,
2928 isManualClear: bool,
2929 ) -> Result;
2930}
2931unsafe extern "C" {
2932 #[must_use]
2933 #[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."]
2934 pub fn svcUnbindInterrupt(interruptId: u32_, eventOrSemaphore: Handle) -> Result;
2935}
2936unsafe extern "C" {
2937 #[must_use]
2938 #[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."]
2939 pub fn svcInvalidateProcessDataCache(process: Handle, addr: u32_, size: u32_) -> Result;
2940}
2941unsafe extern "C" {
2942 #[must_use]
2943 #[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."]
2944 pub fn svcStoreProcessDataCache(process: Handle, addr: u32_, size: u32_) -> Result;
2945}
2946unsafe extern "C" {
2947 #[must_use]
2948 #[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."]
2949 pub fn svcFlushProcessDataCache(process: Handle, addr: u32_, size: u32_) -> Result;
2950}
2951unsafe extern "C" {
2952 #[must_use]
2953 #[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."]
2954 pub fn svcStartInterProcessDma(
2955 dma: *mut Handle,
2956 dstProcess: Handle,
2957 dstAddr: u32_,
2958 srcProcess: Handle,
2959 srcAddr: u32_,
2960 size: u32_,
2961 cfg: *const DmaConfig,
2962 ) -> Result;
2963}
2964unsafe extern "C" {
2965 #[must_use]
2966 #[doc = "Stops an inter-process DMA transfer.\n # Arguments\n\n* `dma` - Handle of the DMA channel object."]
2967 pub fn svcStopDma(dma: Handle) -> Result;
2968}
2969unsafe extern "C" {
2970 #[must_use]
2971 #[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."]
2972 pub fn svcGetDmaState(state: *mut DmaState, dma: Handle) -> Result;
2973}
2974unsafe extern "C" {
2975 #[must_use]
2976 #[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."]
2977 pub fn svcRestartDma(
2978 dma: Handle,
2979 dstAddr: u32_,
2980 srcAddr: u32_,
2981 size: u32_,
2982 flags: s8,
2983 ) -> Result;
2984}
2985unsafe extern "C" {
2986 #[must_use]
2987 #[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."]
2988 pub fn svcSetGpuProt(useApplicationRestriction: bool) -> Result;
2989}
2990unsafe extern "C" {
2991 #[must_use]
2992 #[doc = "Enables or disables Wi-Fi. 11.4+ only.\n # Arguments\n\n* `enabled` - Whether to enable or disable Wi-Fi."]
2993 pub fn svcSetWifiEnabled(enabled: bool) -> Result;
2994}
2995unsafe extern "C" {
2996 #[doc = "Debugging\n# *\n* Breaks execution.\n # Arguments\n\n* `breakReason` - Reason for breaking.\n/"]
2997 pub fn svcBreak(breakReason: UserBreakType);
2998}
2999unsafe extern "C" {
3000 #[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."]
3001 pub fn svcBreakRO(
3002 breakReason: UserBreakType,
3003 croInfo: *const ::libc::c_void,
3004 croInfoSize: u32_,
3005 );
3006}
3007unsafe extern "C" {
3008 #[must_use]
3009 #[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."]
3010 pub fn svcOutputDebugString(str_: *const ::libc::c_char, length: s32) -> Result;
3011}
3012unsafe extern "C" {
3013 #[must_use]
3014 #[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."]
3015 pub fn svcControlPerformanceCounter(
3016 out: *mut u64_,
3017 op: PerfCounterOperation,
3018 param1: u32_,
3019 param2: u64_,
3020 ) -> Result;
3021}
3022unsafe extern "C" {
3023 #[must_use]
3024 #[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."]
3025 pub fn svcDebugActiveProcess(debug: *mut Handle, processId: u32_) -> Result;
3026}
3027unsafe extern "C" {
3028 #[must_use]
3029 #[doc = "Breaks a debugged process.\n # Arguments\n\n* `debug` - Debug handle of the process."]
3030 pub fn svcBreakDebugProcess(debug: Handle) -> Result;
3031}
3032unsafe extern "C" {
3033 #[must_use]
3034 #[doc = "Terminates a debugged process.\n # Arguments\n\n* `debug` - Debug handle of the process."]
3035 pub fn svcTerminateDebugProcess(debug: Handle) -> Result;
3036}
3037unsafe extern "C" {
3038 #[must_use]
3039 #[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."]
3040 pub fn svcGetProcessDebugEvent(info: *mut DebugEventInfo, debug: Handle) -> Result;
3041}
3042unsafe extern "C" {
3043 #[must_use]
3044 #[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."]
3045 pub fn svcContinueDebugEvent(debug: Handle, flags: DebugFlags) -> Result;
3046}
3047unsafe extern "C" {
3048 #[must_use]
3049 #[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."]
3050 pub fn svcGetDebugThreadContext(
3051 context: *mut ThreadContext,
3052 debug: Handle,
3053 threadId: u32_,
3054 controlFlags: ThreadContextControlFlags,
3055 ) -> Result;
3056}
3057unsafe extern "C" {
3058 #[must_use]
3059 #[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."]
3060 pub fn svcSetDebugThreadContext(
3061 debug: Handle,
3062 threadId: u32_,
3063 context: *mut ThreadContext,
3064 controlFlags: ThreadContextControlFlags,
3065 ) -> Result;
3066}
3067unsafe extern "C" {
3068 #[must_use]
3069 #[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."]
3070 pub fn svcQueryDebugProcessMemory(
3071 info: *mut MemInfo,
3072 out: *mut PageInfo,
3073 debug: Handle,
3074 addr: u32_,
3075 ) -> Result;
3076}
3077unsafe extern "C" {
3078 #[must_use]
3079 #[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."]
3080 pub fn svcReadProcessMemory(
3081 buffer: *mut ::libc::c_void,
3082 debug: Handle,
3083 addr: u32_,
3084 size: u32_,
3085 ) -> Result;
3086}
3087unsafe extern "C" {
3088 #[must_use]
3089 #[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."]
3090 pub fn svcWriteProcessMemory(
3091 debug: Handle,
3092 buffer: *const ::libc::c_void,
3093 addr: u32_,
3094 size: u32_,
3095 ) -> Result;
3096}
3097unsafe extern "C" {
3098 #[must_use]
3099 #[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."]
3100 pub fn svcSetHardwareBreakPoint(registerId: s32, control: u32_, value: u32_) -> Result;
3101}
3102unsafe extern "C" {
3103 #[must_use]
3104 #[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."]
3105 pub fn svcGetDebugThreadParam(
3106 unused: *mut s64,
3107 out: *mut u32_,
3108 debug: Handle,
3109 threadId: u32_,
3110 parameter: DebugThreadParameter,
3111 ) -> Result;
3112}
3113unsafe extern "C" {
3114 #[must_use]
3115 #[doc = "Executes a function in supervisor mode.\n # Arguments\n\n* `callback` - Function to execute."]
3116 pub fn svcBackdoor(callback: ::core::option::Option<unsafe extern "C" fn() -> s32>) -> Result;
3117}
3118#[doc = "< Mount \"nand:/\""]
3119pub const ARM9DESC_MOUNT_NAND: _bindgen_ty_7 = 1;
3120#[doc = "< Mount nand:/ro/ as read-write"]
3121pub const ARM9DESC_MOUNT_NANDRO_RW: _bindgen_ty_7 = 2;
3122#[doc = "< Mount \"twln:/\""]
3123pub const ARM9DESC_MOUNT_TWLN: _bindgen_ty_7 = 4;
3124#[doc = "< Mount \"wnand:/\""]
3125pub const ARM9DESC_MOUNT_WNAND: _bindgen_ty_7 = 8;
3126#[doc = "< Mount \"cardspi:/\""]
3127pub const ARM9DESC_MOUNT_CARDSPI: _bindgen_ty_7 = 16;
3128#[doc = "< Use SDIF3"]
3129pub const ARM9DESC_USE_SDIF3: _bindgen_ty_7 = 32;
3130#[doc = "< Create seed (movable.sed)"]
3131pub const ARM9DESC_CREATE_SEED: _bindgen_ty_7 = 64;
3132#[doc = "< Use card SPI, required by multiple pxi:dev commands"]
3133pub const ARM9DESC_USE_CARD_SPI: _bindgen_ty_7 = 128;
3134#[doc = "< SD application (not checked)"]
3135pub const ARM9DESC_SD_APPLICATION: _bindgen_ty_7 = 256;
3136#[doc = "< Mount \"sdmc:/\" as read-write"]
3137pub const ARM9DESC_MOUNT_SDMC_RW: _bindgen_ty_7 = 512;
3138#[doc = "ARM9 descriptor flags"]
3139pub type _bindgen_ty_7 = ::libc::c_ushort;
3140#[doc = "< Category \"system application\""]
3141pub const FSACCESS_CATEGORY_SYSTEM_APPLICATION: _bindgen_ty_8 = 1;
3142#[doc = "< Category \"hardware check\""]
3143pub const FSACCESS_CATEGORY_HARDWARE_CHECK: _bindgen_ty_8 = 2;
3144#[doc = "< Category \"filesystem tool\""]
3145pub const FSACCESS_CATEGORY_FILESYSTEM_TOOL: _bindgen_ty_8 = 4;
3146#[doc = "< Debug"]
3147pub const FSACCESS_DEBUG: _bindgen_ty_8 = 8;
3148#[doc = "< TWLCARD backup"]
3149pub const FSACCESS_TWLCARD_BACKUP: _bindgen_ty_8 = 16;
3150#[doc = "< TWLNAND data"]
3151pub const FSACCESS_TWLNAND_DATA: _bindgen_ty_8 = 32;
3152#[doc = "< BOSS (SpotPass)"]
3153pub const FSACCESS_BOSS: _bindgen_ty_8 = 64;
3154#[doc = "< SDMC (read-write)"]
3155pub const FSACCESS_SDMC_RW: _bindgen_ty_8 = 128;
3156#[doc = "< Core"]
3157pub const FSACCESS_CORE: _bindgen_ty_8 = 256;
3158#[doc = "< nand:/ro/ (read-only)"]
3159pub const FSACCESS_NANDRO_RO: _bindgen_ty_8 = 512;
3160#[doc = "< nand:/rw/"]
3161pub const FSACCESS_NANDRW: _bindgen_ty_8 = 1024;
3162#[doc = "< nand:/ro/ (read-write)"]
3163pub const FSACCESS_NANDRO_RW: _bindgen_ty_8 = 2048;
3164#[doc = "< Category \"System Settings\""]
3165pub const FSACCESS_CATEGORY_SYSTEM_SETTINGS: _bindgen_ty_8 = 4096;
3166#[doc = "< Cardboard (System Transfer)"]
3167pub const FSACCESS_CARDBOARD: _bindgen_ty_8 = 8192;
3168#[doc = "< Export/Import IVs (movable.sed)"]
3169pub const FSACCESS_EXPORT_IMPORT_IVS: _bindgen_ty_8 = 16384;
3170#[doc = "< SDMC (write-only)"]
3171pub const FSACCESS_SDMC_WO: _bindgen_ty_8 = 32768;
3172#[doc = "< \"Switch cleanup\" (3.0+)"]
3173pub const FSACCESS_SWITCH_CLEANUP: _bindgen_ty_8 = 65536;
3174#[doc = "< Savedata move (5.0+)"]
3175pub const FSACCESS_SAVEDATA_MOVE: _bindgen_ty_8 = 131072;
3176#[doc = "< Shop (5.0+)"]
3177pub const FSACCESS_SHOP: _bindgen_ty_8 = 262144;
3178#[doc = "< Shop (5.0+)"]
3179pub const FSACCESS_SHELL: _bindgen_ty_8 = 524288;
3180#[doc = "< Category \"Home Menu\" (6.0+)"]
3181pub const FSACCESS_CATEGORY_HOME_MENU: _bindgen_ty_8 = 1048576;
3182#[doc = "< Seed DB (9.6+)"]
3183pub const FSACCESS_SEEDDB: _bindgen_ty_8 = 2097152;
3184#[doc = "Filesystem access flags"]
3185pub type _bindgen_ty_8 = ::libc::c_uint;
3186#[doc = "< Regular application"]
3187pub const RESLIMIT_CATEGORY_APPLICATION: ResourceLimitCategory = 0;
3188#[doc = "< System applet"]
3189pub const RESLIMIT_CATEGORY_SYS_APPLET: ResourceLimitCategory = 1;
3190#[doc = "< Library applet"]
3191pub const RESLIMIT_CATEGORY_LIB_APPLET: ResourceLimitCategory = 2;
3192#[doc = "< System modules running inside the BASE memregion"]
3193pub const RESLIMIT_CATEGORY_OTHER: ResourceLimitCategory = 3;
3194#[doc = "The resource limit category of a title"]
3195pub type ResourceLimitCategory = ::libc::c_uchar;
3196#[doc = "< 64MB of usable application memory"]
3197pub const SYSMODE_O3DS_PROD: SystemMode = 0;
3198#[doc = "< 124MB of usable application memory. Unusable on O3DS"]
3199pub const SYSMODE_N3DS_PROD: SystemMode = 1;
3200#[doc = "< 97MB/178MB of usable application memory"]
3201pub const SYSMODE_DEV1: SystemMode = 2;
3202#[doc = "< 80MB/124MB of usable application memory"]
3203pub const SYSMODE_DEV2: SystemMode = 3;
3204#[doc = "< 72MB of usable application memory. Same as \"Prod\" on N3DS"]
3205pub const SYSMODE_DEV3: SystemMode = 4;
3206#[doc = "< 32MB of usable application memory. Same as \"Prod\" on N3DS"]
3207pub const SYSMODE_DEV4: SystemMode = 5;
3208#[doc = "The system mode a title should be launched under"]
3209pub type SystemMode = ::libc::c_uchar;
3210#[doc = "The system info flags and remaster version of a title"]
3211#[repr(C)]
3212#[derive(Debug, Default, Copy, Clone)]
3213pub struct ExHeader_SystemInfoFlags {
3214 #[doc = "< Reserved"]
3215 pub reserved: [u8_; 5usize],
3216 pub _bitfield_align_1: [u8; 0],
3217 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
3218 #[doc = "< Remaster version"]
3219 pub remaster_version: u16_,
3220}
3221#[allow(clippy::unnecessary_operation, clippy::identity_op)]
3222const _: () = {
3223 ["Size of ExHeader_SystemInfoFlags"]
3224 [::core::mem::size_of::<ExHeader_SystemInfoFlags>() - 8usize];
3225 ["Alignment of ExHeader_SystemInfoFlags"]
3226 [::core::mem::align_of::<ExHeader_SystemInfoFlags>() - 2usize];
3227 ["Offset of field: ExHeader_SystemInfoFlags::reserved"]
3228 [::core::mem::offset_of!(ExHeader_SystemInfoFlags, reserved) - 0usize];
3229 ["Offset of field: ExHeader_SystemInfoFlags::remaster_version"]
3230 [::core::mem::offset_of!(ExHeader_SystemInfoFlags, remaster_version) - 6usize];
3231};
3232impl ExHeader_SystemInfoFlags {
3233 #[inline]
3234 pub fn compress_exefs_code(&self) -> bool {
3235 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
3236 }
3237 #[inline]
3238 pub fn set_compress_exefs_code(&mut self, val: bool) {
3239 unsafe {
3240 let val: u8 = ::core::mem::transmute(val);
3241 self._bitfield_1.set(0usize, 1u8, val as u64)
3242 }
3243 }
3244 #[inline]
3245 pub unsafe fn compress_exefs_code_raw(this: *const Self) -> bool {
3246 unsafe {
3247 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
3248 ::core::ptr::addr_of!((*this)._bitfield_1),
3249 0usize,
3250 1u8,
3251 ) as u8)
3252 }
3253 }
3254 #[inline]
3255 pub unsafe fn set_compress_exefs_code_raw(this: *mut Self, val: bool) {
3256 unsafe {
3257 let val: u8 = ::core::mem::transmute(val);
3258 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
3259 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
3260 0usize,
3261 1u8,
3262 val as u64,
3263 )
3264 }
3265 }
3266 #[inline]
3267 pub fn is_sd_application(&self) -> bool {
3268 unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
3269 }
3270 #[inline]
3271 pub fn set_is_sd_application(&mut self, val: bool) {
3272 unsafe {
3273 let val: u8 = ::core::mem::transmute(val);
3274 self._bitfield_1.set(1usize, 1u8, val as u64)
3275 }
3276 }
3277 #[inline]
3278 pub unsafe fn is_sd_application_raw(this: *const Self) -> bool {
3279 unsafe {
3280 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
3281 ::core::ptr::addr_of!((*this)._bitfield_1),
3282 1usize,
3283 1u8,
3284 ) as u8)
3285 }
3286 }
3287 #[inline]
3288 pub unsafe fn set_is_sd_application_raw(this: *mut Self, val: bool) {
3289 unsafe {
3290 let val: u8 = ::core::mem::transmute(val);
3291 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
3292 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
3293 1usize,
3294 1u8,
3295 val as u64,
3296 )
3297 }
3298 }
3299 #[inline]
3300 pub fn new_bitfield_1(
3301 compress_exefs_code: bool,
3302 is_sd_application: bool,
3303 ) -> __BindgenBitfieldUnit<[u8; 1usize]> {
3304 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
3305 __bindgen_bitfield_unit.set(0usize, 1u8, {
3306 let compress_exefs_code: u8 = unsafe { ::core::mem::transmute(compress_exefs_code) };
3307 compress_exefs_code as u64
3308 });
3309 __bindgen_bitfield_unit.set(1usize, 1u8, {
3310 let is_sd_application: u8 = unsafe { ::core::mem::transmute(is_sd_application) };
3311 is_sd_application as u64
3312 });
3313 __bindgen_bitfield_unit
3314 }
3315}
3316#[doc = "Information about a title's section"]
3317#[repr(C)]
3318#[derive(Debug, Default, Copy, Clone)]
3319pub struct ExHeader_CodeSectionInfo {
3320 #[doc = "< The address of the section"]
3321 pub address: u32_,
3322 #[doc = "< The number of pages the section occupies"]
3323 pub num_pages: u32_,
3324 #[doc = "< The size of the section"]
3325 pub size: u32_,
3326}
3327#[allow(clippy::unnecessary_operation, clippy::identity_op)]
3328const _: () = {
3329 ["Size of ExHeader_CodeSectionInfo"]
3330 [::core::mem::size_of::<ExHeader_CodeSectionInfo>() - 12usize];
3331 ["Alignment of ExHeader_CodeSectionInfo"]
3332 [::core::mem::align_of::<ExHeader_CodeSectionInfo>() - 4usize];
3333 ["Offset of field: ExHeader_CodeSectionInfo::address"]
3334 [::core::mem::offset_of!(ExHeader_CodeSectionInfo, address) - 0usize];
3335 ["Offset of field: ExHeader_CodeSectionInfo::num_pages"]
3336 [::core::mem::offset_of!(ExHeader_CodeSectionInfo, num_pages) - 4usize];
3337 ["Offset of field: ExHeader_CodeSectionInfo::size"]
3338 [::core::mem::offset_of!(ExHeader_CodeSectionInfo, size) - 8usize];
3339};
3340#[doc = "The name of a title and infomation about its section"]
3341#[repr(C)]
3342#[derive(Debug, Default, Copy, Clone)]
3343pub struct ExHeader_CodeSetInfo {
3344 #[doc = "< Title name"]
3345 pub name: [::libc::c_char; 8usize],
3346 #[doc = "< System info flags, see ExHeader_SystemInfoFlags"]
3347 pub flags: ExHeader_SystemInfoFlags,
3348 #[doc = "< .text section info, see ExHeader_CodeSectionInfo"]
3349 pub text: ExHeader_CodeSectionInfo,
3350 #[doc = "< Stack size"]
3351 pub stack_size: u32_,
3352 #[doc = "< .rodata section info, see ExHeader_CodeSectionInfo"]
3353 pub rodata: ExHeader_CodeSectionInfo,
3354 #[doc = "< Reserved"]
3355 pub reserved: u32_,
3356 #[doc = "< .data section info, see ExHeader_CodeSectionInfo"]
3357 pub data: ExHeader_CodeSectionInfo,
3358 #[doc = "< .bss section size"]
3359 pub bss_size: u32_,
3360}
3361#[allow(clippy::unnecessary_operation, clippy::identity_op)]
3362const _: () = {
3363 ["Size of ExHeader_CodeSetInfo"][::core::mem::size_of::<ExHeader_CodeSetInfo>() - 64usize];
3364 ["Alignment of ExHeader_CodeSetInfo"][::core::mem::align_of::<ExHeader_CodeSetInfo>() - 4usize];
3365 ["Offset of field: ExHeader_CodeSetInfo::name"]
3366 [::core::mem::offset_of!(ExHeader_CodeSetInfo, name) - 0usize];
3367 ["Offset of field: ExHeader_CodeSetInfo::flags"]
3368 [::core::mem::offset_of!(ExHeader_CodeSetInfo, flags) - 8usize];
3369 ["Offset of field: ExHeader_CodeSetInfo::text"]
3370 [::core::mem::offset_of!(ExHeader_CodeSetInfo, text) - 16usize];
3371 ["Offset of field: ExHeader_CodeSetInfo::stack_size"]
3372 [::core::mem::offset_of!(ExHeader_CodeSetInfo, stack_size) - 28usize];
3373 ["Offset of field: ExHeader_CodeSetInfo::rodata"]
3374 [::core::mem::offset_of!(ExHeader_CodeSetInfo, rodata) - 32usize];
3375 ["Offset of field: ExHeader_CodeSetInfo::reserved"]
3376 [::core::mem::offset_of!(ExHeader_CodeSetInfo, reserved) - 44usize];
3377 ["Offset of field: ExHeader_CodeSetInfo::data"]
3378 [::core::mem::offset_of!(ExHeader_CodeSetInfo, data) - 48usize];
3379 ["Offset of field: ExHeader_CodeSetInfo::bss_size"]
3380 [::core::mem::offset_of!(ExHeader_CodeSetInfo, bss_size) - 60usize];
3381};
3382#[doc = "The savedata size and jump ID of a title"]
3383#[repr(C)]
3384#[derive(Debug, Copy, Clone)]
3385pub struct ExHeader_SystemInfo {
3386 #[doc = "< Savedata size"]
3387 pub savedata_size: u64_,
3388 #[doc = "< Jump ID"]
3389 pub jump_id: u64_,
3390 #[doc = "< Reserved"]
3391 pub reserved: [u8_; 48usize],
3392}
3393#[allow(clippy::unnecessary_operation, clippy::identity_op)]
3394const _: () = {
3395 ["Size of ExHeader_SystemInfo"][::core::mem::size_of::<ExHeader_SystemInfo>() - 64usize];
3396 ["Alignment of ExHeader_SystemInfo"][::core::mem::align_of::<ExHeader_SystemInfo>() - 8usize];
3397 ["Offset of field: ExHeader_SystemInfo::savedata_size"]
3398 [::core::mem::offset_of!(ExHeader_SystemInfo, savedata_size) - 0usize];
3399 ["Offset of field: ExHeader_SystemInfo::jump_id"]
3400 [::core::mem::offset_of!(ExHeader_SystemInfo, jump_id) - 8usize];
3401 ["Offset of field: ExHeader_SystemInfo::reserved"]
3402 [::core::mem::offset_of!(ExHeader_SystemInfo, reserved) - 16usize];
3403};
3404impl Default for ExHeader_SystemInfo {
3405 fn default() -> Self {
3406 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
3407 unsafe {
3408 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
3409 s.assume_init()
3410 }
3411 }
3412}
3413#[doc = "The code set info, dependencies and system info of a title (SCI)"]
3414#[repr(C)]
3415#[derive(Debug, Copy, Clone)]
3416pub struct ExHeader_SystemControlInfo {
3417 #[doc = "< Code set info, see ExHeader_CodeSetInfo"]
3418 pub codeset_info: ExHeader_CodeSetInfo,
3419 #[doc = "< Title IDs of the titles that this program depends on"]
3420 pub dependencies: [u64_; 48usize],
3421 #[doc = "< System info, see ExHeader_SystemInfo"]
3422 pub system_info: ExHeader_SystemInfo,
3423}
3424#[allow(clippy::unnecessary_operation, clippy::identity_op)]
3425const _: () = {
3426 ["Size of ExHeader_SystemControlInfo"]
3427 [::core::mem::size_of::<ExHeader_SystemControlInfo>() - 512usize];
3428 ["Alignment of ExHeader_SystemControlInfo"]
3429 [::core::mem::align_of::<ExHeader_SystemControlInfo>() - 8usize];
3430 ["Offset of field: ExHeader_SystemControlInfo::codeset_info"]
3431 [::core::mem::offset_of!(ExHeader_SystemControlInfo, codeset_info) - 0usize];
3432 ["Offset of field: ExHeader_SystemControlInfo::dependencies"]
3433 [::core::mem::offset_of!(ExHeader_SystemControlInfo, dependencies) - 64usize];
3434 ["Offset of field: ExHeader_SystemControlInfo::system_info"]
3435 [::core::mem::offset_of!(ExHeader_SystemControlInfo, system_info) - 448usize];
3436};
3437impl Default for ExHeader_SystemControlInfo {
3438 fn default() -> Self {
3439 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
3440 unsafe {
3441 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
3442 s.assume_init()
3443 }
3444 }
3445}
3446#[doc = "The ARM11 filesystem info of a title"]
3447#[repr(C)]
3448#[derive(Debug, Default, Copy, Clone)]
3449pub struct ExHeader_Arm11StorageInfo {
3450 #[doc = "< Extdata ID"]
3451 pub extdata_id: u64_,
3452 #[doc = "< IDs of the system savedata accessible by the title"]
3453 pub system_savedata_ids: [u32_; 2usize],
3454 #[doc = "< IDs of the savedata accessible by the title, 20 bits each, followed by \"Use other variation savedata\""]
3455 pub accessible_savedata_ids: u64_,
3456 #[doc = "< FS access flags"]
3457 pub fs_access_info: u32_,
3458 pub _bitfield_align_1: [u32; 0],
3459 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>,
3460}
3461#[allow(clippy::unnecessary_operation, clippy::identity_op)]
3462const _: () = {
3463 ["Size of ExHeader_Arm11StorageInfo"]
3464 [::core::mem::size_of::<ExHeader_Arm11StorageInfo>() - 32usize];
3465 ["Alignment of ExHeader_Arm11StorageInfo"]
3466 [::core::mem::align_of::<ExHeader_Arm11StorageInfo>() - 8usize];
3467 ["Offset of field: ExHeader_Arm11StorageInfo::extdata_id"]
3468 [::core::mem::offset_of!(ExHeader_Arm11StorageInfo, extdata_id) - 0usize];
3469 ["Offset of field: ExHeader_Arm11StorageInfo::system_savedata_ids"]
3470 [::core::mem::offset_of!(ExHeader_Arm11StorageInfo, system_savedata_ids) - 8usize];
3471 ["Offset of field: ExHeader_Arm11StorageInfo::accessible_savedata_ids"]
3472 [::core::mem::offset_of!(ExHeader_Arm11StorageInfo, accessible_savedata_ids) - 16usize];
3473 ["Offset of field: ExHeader_Arm11StorageInfo::fs_access_info"]
3474 [::core::mem::offset_of!(ExHeader_Arm11StorageInfo, fs_access_info) - 24usize];
3475};
3476impl ExHeader_Arm11StorageInfo {
3477 #[inline]
3478 pub fn reserved(&self) -> u32_ {
3479 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 24u8) as u32) }
3480 }
3481 #[inline]
3482 pub fn set_reserved(&mut self, val: u32_) {
3483 unsafe {
3484 let val: u32 = ::core::mem::transmute(val);
3485 self._bitfield_1.set(0usize, 24u8, val as u64)
3486 }
3487 }
3488 #[inline]
3489 pub unsafe fn reserved_raw(this: *const Self) -> u32_ {
3490 unsafe {
3491 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
3492 ::core::ptr::addr_of!((*this)._bitfield_1),
3493 0usize,
3494 24u8,
3495 ) as u32)
3496 }
3497 }
3498 #[inline]
3499 pub unsafe fn set_reserved_raw(this: *mut Self, val: u32_) {
3500 unsafe {
3501 let val: u32 = ::core::mem::transmute(val);
3502 <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
3503 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
3504 0usize,
3505 24u8,
3506 val as u64,
3507 )
3508 }
3509 }
3510 #[inline]
3511 pub fn no_romfs(&self) -> bool {
3512 unsafe { ::core::mem::transmute(self._bitfield_1.get(24usize, 1u8) as u8) }
3513 }
3514 #[inline]
3515 pub fn set_no_romfs(&mut self, val: bool) {
3516 unsafe {
3517 let val: u8 = ::core::mem::transmute(val);
3518 self._bitfield_1.set(24usize, 1u8, val as u64)
3519 }
3520 }
3521 #[inline]
3522 pub unsafe fn no_romfs_raw(this: *const Self) -> bool {
3523 unsafe {
3524 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
3525 ::core::ptr::addr_of!((*this)._bitfield_1),
3526 24usize,
3527 1u8,
3528 ) as u8)
3529 }
3530 }
3531 #[inline]
3532 pub unsafe fn set_no_romfs_raw(this: *mut Self, val: bool) {
3533 unsafe {
3534 let val: u8 = ::core::mem::transmute(val);
3535 <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
3536 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
3537 24usize,
3538 1u8,
3539 val as u64,
3540 )
3541 }
3542 }
3543 #[inline]
3544 pub fn use_extended_savedata_access(&self) -> bool {
3545 unsafe { ::core::mem::transmute(self._bitfield_1.get(25usize, 1u8) as u8) }
3546 }
3547 #[inline]
3548 pub fn set_use_extended_savedata_access(&mut self, val: bool) {
3549 unsafe {
3550 let val: u8 = ::core::mem::transmute(val);
3551 self._bitfield_1.set(25usize, 1u8, val as u64)
3552 }
3553 }
3554 #[inline]
3555 pub unsafe fn use_extended_savedata_access_raw(this: *const Self) -> bool {
3556 unsafe {
3557 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
3558 ::core::ptr::addr_of!((*this)._bitfield_1),
3559 25usize,
3560 1u8,
3561 ) as u8)
3562 }
3563 }
3564 #[inline]
3565 pub unsafe fn set_use_extended_savedata_access_raw(this: *mut Self, val: bool) {
3566 unsafe {
3567 let val: u8 = ::core::mem::transmute(val);
3568 <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
3569 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
3570 25usize,
3571 1u8,
3572 val as u64,
3573 )
3574 }
3575 }
3576 #[inline]
3577 pub fn new_bitfield_1(
3578 reserved: u32_,
3579 no_romfs: bool,
3580 use_extended_savedata_access: bool,
3581 ) -> __BindgenBitfieldUnit<[u8; 4usize]> {
3582 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default();
3583 __bindgen_bitfield_unit.set(0usize, 24u8, {
3584 let reserved: u32 = unsafe { ::core::mem::transmute(reserved) };
3585 reserved as u64
3586 });
3587 __bindgen_bitfield_unit.set(24usize, 1u8, {
3588 let no_romfs: u8 = unsafe { ::core::mem::transmute(no_romfs) };
3589 no_romfs as u64
3590 });
3591 __bindgen_bitfield_unit.set(25usize, 1u8, {
3592 let use_extended_savedata_access: u8 =
3593 unsafe { ::core::mem::transmute(use_extended_savedata_access) };
3594 use_extended_savedata_access as u64
3595 });
3596 __bindgen_bitfield_unit
3597 }
3598}
3599#[doc = "The CPU-related and memory-layout-related info of a title"]
3600#[repr(C)]
3601#[derive(Debug, Copy, Clone)]
3602pub struct ExHeader_Arm11CoreInfo {
3603 #[doc = "< The low title ID of the target firmware"]
3604 pub core_version: u32_,
3605 pub _bitfield_align_1: [u8; 0],
3606 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 3usize]>,
3607 #[doc = "< The priority of the title's main thread"]
3608 pub priority: u8_,
3609}
3610#[allow(clippy::unnecessary_operation, clippy::identity_op)]
3611const _: () = {
3612 ["Size of ExHeader_Arm11CoreInfo"][::core::mem::size_of::<ExHeader_Arm11CoreInfo>() - 8usize];
3613 ["Alignment of ExHeader_Arm11CoreInfo"]
3614 [::core::mem::align_of::<ExHeader_Arm11CoreInfo>() - 4usize];
3615 ["Offset of field: ExHeader_Arm11CoreInfo::core_version"]
3616 [::core::mem::offset_of!(ExHeader_Arm11CoreInfo, core_version) - 0usize];
3617 ["Offset of field: ExHeader_Arm11CoreInfo::priority"]
3618 [::core::mem::offset_of!(ExHeader_Arm11CoreInfo, priority) - 7usize];
3619};
3620impl Default for ExHeader_Arm11CoreInfo {
3621 fn default() -> Self {
3622 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
3623 unsafe {
3624 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
3625 s.assume_init()
3626 }
3627 }
3628}
3629impl ExHeader_Arm11CoreInfo {
3630 #[inline]
3631 pub fn use_cpu_clockrate_804MHz(&self) -> bool {
3632 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
3633 }
3634 #[inline]
3635 pub fn set_use_cpu_clockrate_804MHz(&mut self, val: bool) {
3636 unsafe {
3637 let val: u8 = ::core::mem::transmute(val);
3638 self._bitfield_1.set(0usize, 1u8, val as u64)
3639 }
3640 }
3641 #[inline]
3642 pub unsafe fn use_cpu_clockrate_804MHz_raw(this: *const Self) -> bool {
3643 unsafe {
3644 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 3usize]>>::raw_get(
3645 ::core::ptr::addr_of!((*this)._bitfield_1),
3646 0usize,
3647 1u8,
3648 ) as u8)
3649 }
3650 }
3651 #[inline]
3652 pub unsafe fn set_use_cpu_clockrate_804MHz_raw(this: *mut Self, val: bool) {
3653 unsafe {
3654 let val: u8 = ::core::mem::transmute(val);
3655 <__BindgenBitfieldUnit<[u8; 3usize]>>::raw_set(
3656 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
3657 0usize,
3658 1u8,
3659 val as u64,
3660 )
3661 }
3662 }
3663 #[inline]
3664 pub fn enable_l2c(&self) -> bool {
3665 unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
3666 }
3667 #[inline]
3668 pub fn set_enable_l2c(&mut self, val: bool) {
3669 unsafe {
3670 let val: u8 = ::core::mem::transmute(val);
3671 self._bitfield_1.set(1usize, 1u8, val as u64)
3672 }
3673 }
3674 #[inline]
3675 pub unsafe fn enable_l2c_raw(this: *const Self) -> bool {
3676 unsafe {
3677 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 3usize]>>::raw_get(
3678 ::core::ptr::addr_of!((*this)._bitfield_1),
3679 1usize,
3680 1u8,
3681 ) as u8)
3682 }
3683 }
3684 #[inline]
3685 pub unsafe fn set_enable_l2c_raw(this: *mut Self, val: bool) {
3686 unsafe {
3687 let val: u8 = ::core::mem::transmute(val);
3688 <__BindgenBitfieldUnit<[u8; 3usize]>>::raw_set(
3689 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
3690 1usize,
3691 1u8,
3692 val as u64,
3693 )
3694 }
3695 }
3696 #[inline]
3697 pub fn flag1_unused(&self) -> u8_ {
3698 unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 6u8) as u8) }
3699 }
3700 #[inline]
3701 pub fn set_flag1_unused(&mut self, val: u8_) {
3702 unsafe {
3703 let val: u8 = ::core::mem::transmute(val);
3704 self._bitfield_1.set(2usize, 6u8, val as u64)
3705 }
3706 }
3707 #[inline]
3708 pub unsafe fn flag1_unused_raw(this: *const Self) -> u8_ {
3709 unsafe {
3710 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 3usize]>>::raw_get(
3711 ::core::ptr::addr_of!((*this)._bitfield_1),
3712 2usize,
3713 6u8,
3714 ) as u8)
3715 }
3716 }
3717 #[inline]
3718 pub unsafe fn set_flag1_unused_raw(this: *mut Self, val: u8_) {
3719 unsafe {
3720 let val: u8 = ::core::mem::transmute(val);
3721 <__BindgenBitfieldUnit<[u8; 3usize]>>::raw_set(
3722 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
3723 2usize,
3724 6u8,
3725 val as u64,
3726 )
3727 }
3728 }
3729 #[inline]
3730 pub fn n3ds_system_mode(&self) -> SystemMode {
3731 unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 4u8) as u8) }
3732 }
3733 #[inline]
3734 pub fn set_n3ds_system_mode(&mut self, val: SystemMode) {
3735 unsafe {
3736 let val: u8 = ::core::mem::transmute(val);
3737 self._bitfield_1.set(8usize, 4u8, val as u64)
3738 }
3739 }
3740 #[inline]
3741 pub unsafe fn n3ds_system_mode_raw(this: *const Self) -> SystemMode {
3742 unsafe {
3743 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 3usize]>>::raw_get(
3744 ::core::ptr::addr_of!((*this)._bitfield_1),
3745 8usize,
3746 4u8,
3747 ) as u8)
3748 }
3749 }
3750 #[inline]
3751 pub unsafe fn set_n3ds_system_mode_raw(this: *mut Self, val: SystemMode) {
3752 unsafe {
3753 let val: u8 = ::core::mem::transmute(val);
3754 <__BindgenBitfieldUnit<[u8; 3usize]>>::raw_set(
3755 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
3756 8usize,
3757 4u8,
3758 val as u64,
3759 )
3760 }
3761 }
3762 #[inline]
3763 pub fn flag2_unused(&self) -> u8_ {
3764 unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 4u8) as u8) }
3765 }
3766 #[inline]
3767 pub fn set_flag2_unused(&mut self, val: u8_) {
3768 unsafe {
3769 let val: u8 = ::core::mem::transmute(val);
3770 self._bitfield_1.set(12usize, 4u8, val as u64)
3771 }
3772 }
3773 #[inline]
3774 pub unsafe fn flag2_unused_raw(this: *const Self) -> u8_ {
3775 unsafe {
3776 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 3usize]>>::raw_get(
3777 ::core::ptr::addr_of!((*this)._bitfield_1),
3778 12usize,
3779 4u8,
3780 ) as u8)
3781 }
3782 }
3783 #[inline]
3784 pub unsafe fn set_flag2_unused_raw(this: *mut Self, val: u8_) {
3785 unsafe {
3786 let val: u8 = ::core::mem::transmute(val);
3787 <__BindgenBitfieldUnit<[u8; 3usize]>>::raw_set(
3788 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
3789 12usize,
3790 4u8,
3791 val as u64,
3792 )
3793 }
3794 }
3795 #[inline]
3796 pub fn ideal_processor(&self) -> u8_ {
3797 unsafe { ::core::mem::transmute(self._bitfield_1.get(16usize, 2u8) as u8) }
3798 }
3799 #[inline]
3800 pub fn set_ideal_processor(&mut self, val: u8_) {
3801 unsafe {
3802 let val: u8 = ::core::mem::transmute(val);
3803 self._bitfield_1.set(16usize, 2u8, val as u64)
3804 }
3805 }
3806 #[inline]
3807 pub unsafe fn ideal_processor_raw(this: *const Self) -> u8_ {
3808 unsafe {
3809 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 3usize]>>::raw_get(
3810 ::core::ptr::addr_of!((*this)._bitfield_1),
3811 16usize,
3812 2u8,
3813 ) as u8)
3814 }
3815 }
3816 #[inline]
3817 pub unsafe fn set_ideal_processor_raw(this: *mut Self, val: u8_) {
3818 unsafe {
3819 let val: u8 = ::core::mem::transmute(val);
3820 <__BindgenBitfieldUnit<[u8; 3usize]>>::raw_set(
3821 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
3822 16usize,
3823 2u8,
3824 val as u64,
3825 )
3826 }
3827 }
3828 #[inline]
3829 pub fn affinity_mask(&self) -> u8_ {
3830 unsafe { ::core::mem::transmute(self._bitfield_1.get(18usize, 2u8) as u8) }
3831 }
3832 #[inline]
3833 pub fn set_affinity_mask(&mut self, val: u8_) {
3834 unsafe {
3835 let val: u8 = ::core::mem::transmute(val);
3836 self._bitfield_1.set(18usize, 2u8, val as u64)
3837 }
3838 }
3839 #[inline]
3840 pub unsafe fn affinity_mask_raw(this: *const Self) -> u8_ {
3841 unsafe {
3842 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 3usize]>>::raw_get(
3843 ::core::ptr::addr_of!((*this)._bitfield_1),
3844 18usize,
3845 2u8,
3846 ) as u8)
3847 }
3848 }
3849 #[inline]
3850 pub unsafe fn set_affinity_mask_raw(this: *mut Self, val: u8_) {
3851 unsafe {
3852 let val: u8 = ::core::mem::transmute(val);
3853 <__BindgenBitfieldUnit<[u8; 3usize]>>::raw_set(
3854 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
3855 18usize,
3856 2u8,
3857 val as u64,
3858 )
3859 }
3860 }
3861 #[inline]
3862 pub fn o3ds_system_mode(&self) -> SystemMode {
3863 unsafe { ::core::mem::transmute(self._bitfield_1.get(20usize, 4u8) as u8) }
3864 }
3865 #[inline]
3866 pub fn set_o3ds_system_mode(&mut self, val: SystemMode) {
3867 unsafe {
3868 let val: u8 = ::core::mem::transmute(val);
3869 self._bitfield_1.set(20usize, 4u8, val as u64)
3870 }
3871 }
3872 #[inline]
3873 pub unsafe fn o3ds_system_mode_raw(this: *const Self) -> SystemMode {
3874 unsafe {
3875 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 3usize]>>::raw_get(
3876 ::core::ptr::addr_of!((*this)._bitfield_1),
3877 20usize,
3878 4u8,
3879 ) as u8)
3880 }
3881 }
3882 #[inline]
3883 pub unsafe fn set_o3ds_system_mode_raw(this: *mut Self, val: SystemMode) {
3884 unsafe {
3885 let val: u8 = ::core::mem::transmute(val);
3886 <__BindgenBitfieldUnit<[u8; 3usize]>>::raw_set(
3887 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
3888 20usize,
3889 4u8,
3890 val as u64,
3891 )
3892 }
3893 }
3894 #[inline]
3895 pub fn new_bitfield_1(
3896 use_cpu_clockrate_804MHz: bool,
3897 enable_l2c: bool,
3898 flag1_unused: u8_,
3899 n3ds_system_mode: SystemMode,
3900 flag2_unused: u8_,
3901 ideal_processor: u8_,
3902 affinity_mask: u8_,
3903 o3ds_system_mode: SystemMode,
3904 ) -> __BindgenBitfieldUnit<[u8; 3usize]> {
3905 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 3usize]> = Default::default();
3906 __bindgen_bitfield_unit.set(0usize, 1u8, {
3907 let use_cpu_clockrate_804MHz: u8 =
3908 unsafe { ::core::mem::transmute(use_cpu_clockrate_804MHz) };
3909 use_cpu_clockrate_804MHz as u64
3910 });
3911 __bindgen_bitfield_unit.set(1usize, 1u8, {
3912 let enable_l2c: u8 = unsafe { ::core::mem::transmute(enable_l2c) };
3913 enable_l2c as u64
3914 });
3915 __bindgen_bitfield_unit.set(2usize, 6u8, {
3916 let flag1_unused: u8 = unsafe { ::core::mem::transmute(flag1_unused) };
3917 flag1_unused as u64
3918 });
3919 __bindgen_bitfield_unit.set(8usize, 4u8, {
3920 let n3ds_system_mode: u8 = unsafe { ::core::mem::transmute(n3ds_system_mode) };
3921 n3ds_system_mode as u64
3922 });
3923 __bindgen_bitfield_unit.set(12usize, 4u8, {
3924 let flag2_unused: u8 = unsafe { ::core::mem::transmute(flag2_unused) };
3925 flag2_unused as u64
3926 });
3927 __bindgen_bitfield_unit.set(16usize, 2u8, {
3928 let ideal_processor: u8 = unsafe { ::core::mem::transmute(ideal_processor) };
3929 ideal_processor as u64
3930 });
3931 __bindgen_bitfield_unit.set(18usize, 2u8, {
3932 let affinity_mask: u8 = unsafe { ::core::mem::transmute(affinity_mask) };
3933 affinity_mask as u64
3934 });
3935 __bindgen_bitfield_unit.set(20usize, 4u8, {
3936 let o3ds_system_mode: u8 = unsafe { ::core::mem::transmute(o3ds_system_mode) };
3937 o3ds_system_mode as u64
3938 });
3939 __bindgen_bitfield_unit
3940 }
3941}
3942#[doc = "The ARM11 system-local capabilities of a title"]
3943#[repr(C)]
3944#[derive(Debug, Copy, Clone)]
3945pub struct ExHeader_Arm11SystemLocalCapabilities {
3946 #[doc = "< Title ID"]
3947 pub title_id: u64_,
3948 #[doc = "< Core info, see ExHeader_Arm11CoreInfo"]
3949 pub core_info: ExHeader_Arm11CoreInfo,
3950 #[doc = "< Resource limit descriptors, only \"CpuTime\" (first byte) sems to be used"]
3951 pub reslimits: [u16_; 16usize],
3952 #[doc = "< Storage info, see ExHeader_Arm11StorageInfo"]
3953 pub storage_info: ExHeader_Arm11StorageInfo,
3954 #[doc = "< List of the services the title has access to. Limited to 32 prior to system version 9.3"]
3955 pub service_access: [[::libc::c_char; 8usize]; 34usize],
3956 #[doc = "< Reserved"]
3957 pub reserved: [u8_; 15usize],
3958 #[doc = "< Resource limit category, see ExHeader_Arm11SystemLocalCapabilities"]
3959 pub reslimit_category: ResourceLimitCategory,
3960}
3961#[allow(clippy::unnecessary_operation, clippy::identity_op)]
3962const _: () = {
3963 ["Size of ExHeader_Arm11SystemLocalCapabilities"]
3964 [::core::mem::size_of::<ExHeader_Arm11SystemLocalCapabilities>() - 368usize];
3965 ["Alignment of ExHeader_Arm11SystemLocalCapabilities"]
3966 [::core::mem::align_of::<ExHeader_Arm11SystemLocalCapabilities>() - 8usize];
3967 ["Offset of field: ExHeader_Arm11SystemLocalCapabilities::title_id"]
3968 [::core::mem::offset_of!(ExHeader_Arm11SystemLocalCapabilities, title_id) - 0usize];
3969 ["Offset of field: ExHeader_Arm11SystemLocalCapabilities::core_info"]
3970 [::core::mem::offset_of!(ExHeader_Arm11SystemLocalCapabilities, core_info) - 8usize];
3971 ["Offset of field: ExHeader_Arm11SystemLocalCapabilities::reslimits"]
3972 [::core::mem::offset_of!(ExHeader_Arm11SystemLocalCapabilities, reslimits) - 16usize];
3973 ["Offset of field: ExHeader_Arm11SystemLocalCapabilities::storage_info"]
3974 [::core::mem::offset_of!(ExHeader_Arm11SystemLocalCapabilities, storage_info) - 48usize];
3975 ["Offset of field: ExHeader_Arm11SystemLocalCapabilities::service_access"]
3976 [::core::mem::offset_of!(ExHeader_Arm11SystemLocalCapabilities, service_access) - 80usize];
3977 ["Offset of field: ExHeader_Arm11SystemLocalCapabilities::reserved"]
3978 [::core::mem::offset_of!(ExHeader_Arm11SystemLocalCapabilities, reserved) - 352usize];
3979 ["Offset of field: ExHeader_Arm11SystemLocalCapabilities::reslimit_category"][::core::mem::offset_of!(
3980 ExHeader_Arm11SystemLocalCapabilities,
3981 reslimit_category
3982 ) - 367usize];
3983};
3984impl Default for ExHeader_Arm11SystemLocalCapabilities {
3985 fn default() -> Self {
3986 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
3987 unsafe {
3988 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
3989 s.assume_init()
3990 }
3991 }
3992}
3993#[doc = "The ARM11 kernel capabilities of a title"]
3994#[repr(C)]
3995#[derive(Debug, Default, Copy, Clone)]
3996pub struct ExHeader_Arm11KernelCapabilities {
3997 #[doc = "< ARM11 kernel descriptors, see 3dbrew"]
3998 pub descriptors: [u32_; 28usize],
3999 #[doc = "< Reserved"]
4000 pub reserved: [u8_; 16usize],
4001}
4002#[allow(clippy::unnecessary_operation, clippy::identity_op)]
4003const _: () = {
4004 ["Size of ExHeader_Arm11KernelCapabilities"]
4005 [::core::mem::size_of::<ExHeader_Arm11KernelCapabilities>() - 128usize];
4006 ["Alignment of ExHeader_Arm11KernelCapabilities"]
4007 [::core::mem::align_of::<ExHeader_Arm11KernelCapabilities>() - 4usize];
4008 ["Offset of field: ExHeader_Arm11KernelCapabilities::descriptors"]
4009 [::core::mem::offset_of!(ExHeader_Arm11KernelCapabilities, descriptors) - 0usize];
4010 ["Offset of field: ExHeader_Arm11KernelCapabilities::reserved"]
4011 [::core::mem::offset_of!(ExHeader_Arm11KernelCapabilities, reserved) - 112usize];
4012};
4013#[doc = "The ARM9 access control of a title"]
4014#[repr(C)]
4015#[derive(Debug, Default, Copy, Clone)]
4016pub struct ExHeader_Arm9AccessControl {
4017 #[doc = "< Process9 FS descriptors, see 3dbrew"]
4018 pub descriptors: [u8_; 15usize],
4019 #[doc = "< Descriptor version"]
4020 pub descriptor_version: u8_,
4021}
4022#[allow(clippy::unnecessary_operation, clippy::identity_op)]
4023const _: () = {
4024 ["Size of ExHeader_Arm9AccessControl"]
4025 [::core::mem::size_of::<ExHeader_Arm9AccessControl>() - 16usize];
4026 ["Alignment of ExHeader_Arm9AccessControl"]
4027 [::core::mem::align_of::<ExHeader_Arm9AccessControl>() - 1usize];
4028 ["Offset of field: ExHeader_Arm9AccessControl::descriptors"]
4029 [::core::mem::offset_of!(ExHeader_Arm9AccessControl, descriptors) - 0usize];
4030 ["Offset of field: ExHeader_Arm9AccessControl::descriptor_version"]
4031 [::core::mem::offset_of!(ExHeader_Arm9AccessControl, descriptor_version) - 15usize];
4032};
4033#[doc = "The access control information of a title"]
4034#[repr(C)]
4035#[derive(Debug, Copy, Clone)]
4036pub struct ExHeader_AccessControlInfo {
4037 #[doc = "< ARM11 system-local capabilities, see ExHeader_Arm11SystemLocalCapabilities"]
4038 pub local_caps: ExHeader_Arm11SystemLocalCapabilities,
4039 #[doc = "< ARM11 kernel capabilities, see ExHeader_Arm11SystemLocalCapabilities"]
4040 pub kernel_caps: ExHeader_Arm11KernelCapabilities,
4041 #[doc = "< ARM9 access control, see ExHeader_Arm9AccessControl"]
4042 pub access_control: ExHeader_Arm9AccessControl,
4043}
4044#[allow(clippy::unnecessary_operation, clippy::identity_op)]
4045const _: () = {
4046 ["Size of ExHeader_AccessControlInfo"]
4047 [::core::mem::size_of::<ExHeader_AccessControlInfo>() - 512usize];
4048 ["Alignment of ExHeader_AccessControlInfo"]
4049 [::core::mem::align_of::<ExHeader_AccessControlInfo>() - 8usize];
4050 ["Offset of field: ExHeader_AccessControlInfo::local_caps"]
4051 [::core::mem::offset_of!(ExHeader_AccessControlInfo, local_caps) - 0usize];
4052 ["Offset of field: ExHeader_AccessControlInfo::kernel_caps"]
4053 [::core::mem::offset_of!(ExHeader_AccessControlInfo, kernel_caps) - 368usize];
4054 ["Offset of field: ExHeader_AccessControlInfo::access_control"]
4055 [::core::mem::offset_of!(ExHeader_AccessControlInfo, access_control) - 496usize];
4056};
4057impl Default for ExHeader_AccessControlInfo {
4058 fn default() -> Self {
4059 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
4060 unsafe {
4061 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
4062 s.assume_init()
4063 }
4064 }
4065}
4066#[doc = "Main extended header data, as returned by PXIPM, Loader and FSREG service commands"]
4067#[repr(C)]
4068#[derive(Debug, Copy, Clone)]
4069pub struct ExHeader_Info {
4070 #[doc = "< System control info, see ExHeader_SystemControlInfo"]
4071 pub sci: ExHeader_SystemControlInfo,
4072 #[doc = "< Access control info, see ExHeader_AccessControlInfo"]
4073 pub aci: ExHeader_AccessControlInfo,
4074}
4075#[allow(clippy::unnecessary_operation, clippy::identity_op)]
4076const _: () = {
4077 ["Size of ExHeader_Info"][::core::mem::size_of::<ExHeader_Info>() - 1024usize];
4078 ["Alignment of ExHeader_Info"][::core::mem::align_of::<ExHeader_Info>() - 8usize];
4079 ["Offset of field: ExHeader_Info::sci"][::core::mem::offset_of!(ExHeader_Info, sci) - 0usize];
4080 ["Offset of field: ExHeader_Info::aci"][::core::mem::offset_of!(ExHeader_Info, aci) - 512usize];
4081};
4082impl Default for ExHeader_Info {
4083 fn default() -> Self {
4084 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
4085 unsafe {
4086 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
4087 s.assume_init()
4088 }
4089 }
4090}
4091#[doc = "Extended header access descriptor"]
4092#[repr(C)]
4093#[derive(Debug, Copy, Clone)]
4094pub struct ExHeader_AccessDescriptor {
4095 #[doc = "< The signature of the access descriptor (RSA-2048-SHA256)"]
4096 pub signature: [u8_; 256usize],
4097 #[doc = "< The modulus used for the above signature, with 65537 as public exponent"]
4098 pub ncchModulus: [u8_; 256usize],
4099 #[doc = "< This is compared for equality with the first ACI by Process9, see ExHeader_AccessControlInfo"]
4100 pub acli: ExHeader_AccessControlInfo,
4101}
4102#[allow(clippy::unnecessary_operation, clippy::identity_op)]
4103const _: () = {
4104 ["Size of ExHeader_AccessDescriptor"]
4105 [::core::mem::size_of::<ExHeader_AccessDescriptor>() - 1024usize];
4106 ["Alignment of ExHeader_AccessDescriptor"]
4107 [::core::mem::align_of::<ExHeader_AccessDescriptor>() - 8usize];
4108 ["Offset of field: ExHeader_AccessDescriptor::signature"]
4109 [::core::mem::offset_of!(ExHeader_AccessDescriptor, signature) - 0usize];
4110 ["Offset of field: ExHeader_AccessDescriptor::ncchModulus"]
4111 [::core::mem::offset_of!(ExHeader_AccessDescriptor, ncchModulus) - 256usize];
4112 ["Offset of field: ExHeader_AccessDescriptor::acli"]
4113 [::core::mem::offset_of!(ExHeader_AccessDescriptor, acli) - 512usize];
4114};
4115impl Default for ExHeader_AccessDescriptor {
4116 fn default() -> Self {
4117 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
4118 unsafe {
4119 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
4120 s.assume_init()
4121 }
4122 }
4123}
4124#[doc = "The NCCH Extended Header of a title"]
4125#[repr(C)]
4126#[derive(Debug, Copy, Clone)]
4127pub struct ExHeader {
4128 #[doc = "< Main extended header data, see ExHeader_Info"]
4129 pub info: ExHeader_Info,
4130 #[doc = "< Access descriptor, see ExHeader_AccessDescriptor"]
4131 pub access_descriptor: ExHeader_AccessDescriptor,
4132}
4133#[allow(clippy::unnecessary_operation, clippy::identity_op)]
4134const _: () = {
4135 ["Size of ExHeader"][::core::mem::size_of::<ExHeader>() - 2048usize];
4136 ["Alignment of ExHeader"][::core::mem::align_of::<ExHeader>() - 8usize];
4137 ["Offset of field: ExHeader::info"][::core::mem::offset_of!(ExHeader, info) - 0usize];
4138 ["Offset of field: ExHeader::access_descriptor"]
4139 [::core::mem::offset_of!(ExHeader, access_descriptor) - 1024usize];
4140};
4141impl Default for ExHeader {
4142 fn default() -> Self {
4143 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
4144 unsafe {
4145 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
4146 s.assume_init()
4147 }
4148 }
4149}
4150unsafe extern "C" {
4151 #[must_use]
4152 #[doc = "Initializes the service API."]
4153 pub fn srvInit() -> Result;
4154}
4155unsafe extern "C" {
4156 #[doc = "Exits the service API."]
4157 pub fn srvExit();
4158}
4159unsafe extern "C" {
4160 #[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."]
4161 pub fn srvSetBlockingPolicy(nonBlocking: bool);
4162}
4163unsafe extern "C" {
4164 #[doc = "Gets the current service API session handle.\n # Returns\n\nThe current service API session handle."]
4165 pub fn srvGetSessionHandle() -> *mut Handle;
4166}
4167unsafe extern "C" {
4168 #[must_use]
4169 #[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)."]
4170 pub fn srvGetServiceHandle(out: *mut Handle, name: *const ::libc::c_char) -> Result;
4171}
4172unsafe extern "C" {
4173 #[must_use]
4174 #[doc = "Registers the current process as a client to the service API."]
4175 pub fn srvRegisterClient() -> Result;
4176}
4177unsafe extern "C" {
4178 #[must_use]
4179 #[doc = "Enables service notificatios, returning a notification semaphore.\n # Arguments\n\n* `semaphoreOut` - Pointer to output the notification semaphore to."]
4180 pub fn srvEnableNotification(semaphoreOut: *mut Handle) -> Result;
4181}
4182unsafe extern "C" {
4183 #[must_use]
4184 #[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."]
4185 pub fn srvRegisterService(
4186 out: *mut Handle,
4187 name: *const ::libc::c_char,
4188 maxSessions: ::libc::c_int,
4189 ) -> Result;
4190}
4191unsafe extern "C" {
4192 #[must_use]
4193 #[doc = "Unregisters the current process as a service.\n # Arguments\n\n* `name` - Name of the service."]
4194 pub fn srvUnregisterService(name: *const ::libc::c_char) -> Result;
4195}
4196unsafe extern "C" {
4197 #[must_use]
4198 #[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)."]
4199 pub fn srvGetServiceHandleDirect(out: *mut Handle, name: *const ::libc::c_char) -> Result;
4200}
4201unsafe extern "C" {
4202 #[must_use]
4203 #[doc = "Registers a port.\n # Arguments\n\n* `name` - Name of the port.\n * `clientHandle` - Client handle of the port."]
4204 pub fn srvRegisterPort(name: *const ::libc::c_char, clientHandle: Handle) -> Result;
4205}
4206unsafe extern "C" {
4207 #[must_use]
4208 #[doc = "Unregisters a port.\n # Arguments\n\n* `name` - Name of the port."]
4209 pub fn srvUnregisterPort(name: *const ::libc::c_char) -> Result;
4210}
4211unsafe extern "C" {
4212 #[must_use]
4213 #[doc = "Retrieves a port handle.\n # Arguments\n\n* `out` - Pointer to output the handle to.\n * `name` - Name of the port."]
4214 pub fn srvGetPort(out: *mut Handle, name: *const ::libc::c_char) -> Result;
4215}
4216unsafe extern "C" {
4217 #[must_use]
4218 #[doc = "Waits for a port to be registered.\n # Arguments\n\n* `name` - Name of the port to wait for registration."]
4219 pub fn srvWaitForPortRegistered(name: *const ::libc::c_char) -> Result;
4220}
4221unsafe extern "C" {
4222 #[must_use]
4223 #[doc = "Subscribes to a notification.\n # Arguments\n\n* `notificationId` - ID of the notification."]
4224 pub fn srvSubscribe(notificationId: u32_) -> Result;
4225}
4226unsafe extern "C" {
4227 #[must_use]
4228 #[doc = "Unsubscribes from a notification.\n # Arguments\n\n* `notificationId` - ID of the notification."]
4229 pub fn srvUnsubscribe(notificationId: u32_) -> Result;
4230}
4231unsafe extern "C" {
4232 #[must_use]
4233 #[doc = "Receives a notification.\n # Arguments\n\n* `notificationIdOut` - Pointer to output the ID of the received notification to."]
4234 pub fn srvReceiveNotification(notificationIdOut: *mut u32_) -> Result;
4235}
4236unsafe extern "C" {
4237 #[must_use]
4238 #[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)"]
4239 pub fn srvPublishToSubscriber(notificationId: u32_, flags: u32_) -> Result;
4240}
4241unsafe extern "C" {
4242 #[must_use]
4243 #[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."]
4244 pub fn srvPublishAndGetSubscriber(
4245 processIdCountOut: *mut u32_,
4246 processIdsOut: *mut u32_,
4247 notificationId: u32_,
4248 ) -> Result;
4249}
4250unsafe extern "C" {
4251 #[must_use]
4252 #[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."]
4253 pub fn srvIsServiceRegistered(registeredOut: *mut bool, name: *const ::libc::c_char) -> Result;
4254}
4255unsafe extern "C" {
4256 #[must_use]
4257 #[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."]
4258 pub fn srvIsPortRegistered(registeredOut: *mut bool, name: *const ::libc::c_char) -> Result;
4259}
4260#[doc = "< Generic fatal error. Shows miscellaneous info, including the address of the caller"]
4261pub const ERRF_ERRTYPE_GENERIC: ERRF_ErrType = 0;
4262#[doc = "< Damaged NAND (CC_ERROR after reading CSR)"]
4263pub const ERRF_ERRTYPE_NAND_DAMAGED: ERRF_ErrType = 1;
4264#[doc = "< Game content storage medium (cartridge and/or SD card) ejected. Not logged"]
4265pub const ERRF_ERRTYPE_CARD_REMOVED: ERRF_ErrType = 2;
4266#[doc = "< CPU or VFP exception"]
4267pub const ERRF_ERRTYPE_EXCEPTION: ERRF_ErrType = 3;
4268#[doc = "< Fatal error with a message instead of the caller's address"]
4269pub const ERRF_ERRTYPE_FAILURE: ERRF_ErrType = 4;
4270#[doc = "< Log-level failure. Does not display the exception and does not force the system to reboot"]
4271pub const ERRF_ERRTYPE_LOG_ONLY: ERRF_ErrType = 5;
4272#[doc = "Types of errors that can be thrown by err:f."]
4273pub type ERRF_ErrType = ::libc::c_uchar;
4274#[doc = "< Prefetch Abort"]
4275pub const ERRF_EXCEPTION_PREFETCH_ABORT: ERRF_ExceptionType = 0;
4276#[doc = "< Data abort"]
4277pub const ERRF_EXCEPTION_DATA_ABORT: ERRF_ExceptionType = 1;
4278#[doc = "< Undefined instruction"]
4279pub const ERRF_EXCEPTION_UNDEFINED: ERRF_ExceptionType = 2;
4280#[doc = "< VFP (floating point) exception."]
4281pub const ERRF_EXCEPTION_VFP: ERRF_ExceptionType = 3;
4282#[doc = "Types of 'Exceptions' thrown for ERRF_ERRTYPE_EXCEPTION"]
4283pub type ERRF_ExceptionType = ::libc::c_uchar;
4284#[repr(C)]
4285#[derive(Debug, Copy, Clone)]
4286pub struct ERRF_ExceptionInfo {
4287 #[doc = "< Type of the exception. One of the ERRF_EXCEPTION_* values."]
4288 pub type_: ERRF_ExceptionType,
4289 pub reserved: [u8_; 3usize],
4290 #[doc = "< ifsr (prefetch abort) / dfsr (data abort)"]
4291 pub fsr: u32_,
4292 #[doc = "< pc = ifar (prefetch abort) / dfar (data abort)"]
4293 pub far: u32_,
4294 pub fpexc: u32_,
4295 pub fpinst: u32_,
4296 pub fpinst2: u32_,
4297}
4298#[allow(clippy::unnecessary_operation, clippy::identity_op)]
4299const _: () = {
4300 ["Size of ERRF_ExceptionInfo"][::core::mem::size_of::<ERRF_ExceptionInfo>() - 24usize];
4301 ["Alignment of ERRF_ExceptionInfo"][::core::mem::align_of::<ERRF_ExceptionInfo>() - 4usize];
4302 ["Offset of field: ERRF_ExceptionInfo::type_"]
4303 [::core::mem::offset_of!(ERRF_ExceptionInfo, type_) - 0usize];
4304 ["Offset of field: ERRF_ExceptionInfo::reserved"]
4305 [::core::mem::offset_of!(ERRF_ExceptionInfo, reserved) - 1usize];
4306 ["Offset of field: ERRF_ExceptionInfo::fsr"]
4307 [::core::mem::offset_of!(ERRF_ExceptionInfo, fsr) - 4usize];
4308 ["Offset of field: ERRF_ExceptionInfo::far"]
4309 [::core::mem::offset_of!(ERRF_ExceptionInfo, far) - 8usize];
4310 ["Offset of field: ERRF_ExceptionInfo::fpexc"]
4311 [::core::mem::offset_of!(ERRF_ExceptionInfo, fpexc) - 12usize];
4312 ["Offset of field: ERRF_ExceptionInfo::fpinst"]
4313 [::core::mem::offset_of!(ERRF_ExceptionInfo, fpinst) - 16usize];
4314 ["Offset of field: ERRF_ExceptionInfo::fpinst2"]
4315 [::core::mem::offset_of!(ERRF_ExceptionInfo, fpinst2) - 20usize];
4316};
4317impl Default for ERRF_ExceptionInfo {
4318 fn default() -> Self {
4319 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
4320 unsafe {
4321 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
4322 s.assume_init()
4323 }
4324 }
4325}
4326#[repr(C)]
4327#[derive(Debug, Copy, Clone)]
4328pub struct ERRF_ExceptionData {
4329 #[doc = "< Exception info struct"]
4330 pub excep: ERRF_ExceptionInfo,
4331 #[doc = "< CPU register dump."]
4332 pub regs: CpuRegisters,
4333}
4334#[allow(clippy::unnecessary_operation, clippy::identity_op)]
4335const _: () = {
4336 ["Size of ERRF_ExceptionData"][::core::mem::size_of::<ERRF_ExceptionData>() - 92usize];
4337 ["Alignment of ERRF_ExceptionData"][::core::mem::align_of::<ERRF_ExceptionData>() - 4usize];
4338 ["Offset of field: ERRF_ExceptionData::excep"]
4339 [::core::mem::offset_of!(ERRF_ExceptionData, excep) - 0usize];
4340 ["Offset of field: ERRF_ExceptionData::regs"]
4341 [::core::mem::offset_of!(ERRF_ExceptionData, regs) - 24usize];
4342};
4343impl Default for ERRF_ExceptionData {
4344 fn default() -> Self {
4345 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
4346 unsafe {
4347 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
4348 s.assume_init()
4349 }
4350 }
4351}
4352#[repr(C)]
4353#[derive(Copy, Clone)]
4354pub struct ERRF_FatalErrInfo {
4355 #[doc = "< Type, one of the ERRF_ERRTYPE_* enum"]
4356 pub type_: ERRF_ErrType,
4357 #[doc = "< High revison ID"]
4358 pub revHigh: u8_,
4359 #[doc = "< Low revision ID"]
4360 pub revLow: u16_,
4361 #[doc = "< Result code"]
4362 pub resCode: u32_,
4363 #[doc = "< PC address at exception"]
4364 pub pcAddr: u32_,
4365 #[doc = "< Process ID of the caller"]
4366 pub procId: u32_,
4367 #[doc = "< Title ID of the caller"]
4368 pub titleId: u64_,
4369 #[doc = "< Title ID of the running application"]
4370 pub appTitleId: u64_,
4371 #[doc = "< The different types of data for errors."]
4372 pub data: ERRF_FatalErrInfo__bindgen_ty_1,
4373}
4374#[repr(C)]
4375#[derive(Copy, Clone)]
4376pub union ERRF_FatalErrInfo__bindgen_ty_1 {
4377 #[doc = "< Data for when type is ERRF_ERRTYPE_EXCEPTION"]
4378 pub exception_data: ERRF_ExceptionData,
4379 #[doc = "< String for when type is ERRF_ERRTYPE_FAILURE"]
4380 pub failure_mesg: [::libc::c_char; 96usize],
4381}
4382#[allow(clippy::unnecessary_operation, clippy::identity_op)]
4383const _: () = {
4384 ["Size of ERRF_FatalErrInfo__bindgen_ty_1"]
4385 [::core::mem::size_of::<ERRF_FatalErrInfo__bindgen_ty_1>() - 96usize];
4386 ["Alignment of ERRF_FatalErrInfo__bindgen_ty_1"]
4387 [::core::mem::align_of::<ERRF_FatalErrInfo__bindgen_ty_1>() - 4usize];
4388 ["Offset of field: ERRF_FatalErrInfo__bindgen_ty_1::exception_data"]
4389 [::core::mem::offset_of!(ERRF_FatalErrInfo__bindgen_ty_1, exception_data) - 0usize];
4390 ["Offset of field: ERRF_FatalErrInfo__bindgen_ty_1::failure_mesg"]
4391 [::core::mem::offset_of!(ERRF_FatalErrInfo__bindgen_ty_1, failure_mesg) - 0usize];
4392};
4393impl Default for ERRF_FatalErrInfo__bindgen_ty_1 {
4394 fn default() -> Self {
4395 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
4396 unsafe {
4397 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
4398 s.assume_init()
4399 }
4400 }
4401}
4402#[allow(clippy::unnecessary_operation, clippy::identity_op)]
4403const _: () = {
4404 ["Size of ERRF_FatalErrInfo"][::core::mem::size_of::<ERRF_FatalErrInfo>() - 128usize];
4405 ["Alignment of ERRF_FatalErrInfo"][::core::mem::align_of::<ERRF_FatalErrInfo>() - 8usize];
4406 ["Offset of field: ERRF_FatalErrInfo::type_"]
4407 [::core::mem::offset_of!(ERRF_FatalErrInfo, type_) - 0usize];
4408 ["Offset of field: ERRF_FatalErrInfo::revHigh"]
4409 [::core::mem::offset_of!(ERRF_FatalErrInfo, revHigh) - 1usize];
4410 ["Offset of field: ERRF_FatalErrInfo::revLow"]
4411 [::core::mem::offset_of!(ERRF_FatalErrInfo, revLow) - 2usize];
4412 ["Offset of field: ERRF_FatalErrInfo::resCode"]
4413 [::core::mem::offset_of!(ERRF_FatalErrInfo, resCode) - 4usize];
4414 ["Offset of field: ERRF_FatalErrInfo::pcAddr"]
4415 [::core::mem::offset_of!(ERRF_FatalErrInfo, pcAddr) - 8usize];
4416 ["Offset of field: ERRF_FatalErrInfo::procId"]
4417 [::core::mem::offset_of!(ERRF_FatalErrInfo, procId) - 12usize];
4418 ["Offset of field: ERRF_FatalErrInfo::titleId"]
4419 [::core::mem::offset_of!(ERRF_FatalErrInfo, titleId) - 16usize];
4420 ["Offset of field: ERRF_FatalErrInfo::appTitleId"]
4421 [::core::mem::offset_of!(ERRF_FatalErrInfo, appTitleId) - 24usize];
4422 ["Offset of field: ERRF_FatalErrInfo::data"]
4423 [::core::mem::offset_of!(ERRF_FatalErrInfo, data) - 32usize];
4424};
4425impl Default for ERRF_FatalErrInfo {
4426 fn default() -> Self {
4427 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
4428 unsafe {
4429 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
4430 s.assume_init()
4431 }
4432 }
4433}
4434unsafe extern "C" {
4435 #[must_use]
4436 #[doc = "Initializes ERR:f. Unless you plan to call ERRF_Throw yourself, do not use this."]
4437 pub fn errfInit() -> Result;
4438}
4439unsafe extern "C" {
4440 #[doc = "Exits ERR:f. Unless you plan to call ERRF_Throw yourself, do not use this."]
4441 pub fn errfExit();
4442}
4443unsafe extern "C" {
4444 #[doc = "Gets the current err:f API session handle.\n # Returns\n\nThe current err:f API session handle."]
4445 pub fn errfGetSessionHandle() -> *mut Handle;
4446}
4447unsafe extern "C" {
4448 #[must_use]
4449 #[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."]
4450 pub fn ERRF_Throw(error: *const ERRF_FatalErrInfo) -> Result;
4451}
4452unsafe extern "C" {
4453 #[must_use]
4454 #[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."]
4455 pub fn ERRF_ThrowResult(failure: Result) -> Result;
4456}
4457unsafe extern "C" {
4458 #[must_use]
4459 #[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."]
4460 pub fn ERRF_LogResult(failure: Result) -> Result;
4461}
4462unsafe extern "C" {
4463 #[must_use]
4464 #[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."]
4465 pub fn ERRF_ThrowResultWithMessage(failure: Result, message: *const ::libc::c_char) -> Result;
4466}
4467unsafe extern "C" {
4468 #[must_use]
4469 #[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)"]
4470 pub fn ERRF_SetUserString(user_string: *const ::libc::c_char) -> Result;
4471}
4472unsafe extern "C" {
4473 #[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`]"]
4474 pub fn ERRF_ExceptionHandler(excep: *mut ERRF_ExceptionInfo, regs: *mut CpuRegisters) -> !;
4475}
4476#[doc = "Kernel configuration page (read-only)."]
4477#[repr(C)]
4478#[derive(Debug, Default, Copy, Clone)]
4479pub struct osKernelConfig_s {
4480 pub kernel_ver: u32_,
4481 pub update_flag: u32_,
4482 pub ns_tid: u64_,
4483 pub kernel_syscore_ver: u32_,
4484 pub env_info: u8_,
4485 pub unit_info: u8_,
4486 pub boot_env: u8_,
4487 pub unk_0x17: u8_,
4488 pub kernel_ctrsdk_ver: u32_,
4489 pub unk_0x1c: u32_,
4490 pub firmlaunch_flags: u32_,
4491 pub unk_0x24: [u8_; 12usize],
4492 pub app_memtype: u32_,
4493 pub unk_0x34: [u8_; 12usize],
4494 pub memregion_sz: [u32_; 3usize],
4495 pub unk_0x4c: [u8_; 20usize],
4496 pub firm_ver: u32_,
4497 pub firm_syscore_ver: u32_,
4498 pub firm_ctrsdk_ver: u32_,
4499}
4500#[allow(clippy::unnecessary_operation, clippy::identity_op)]
4501const _: () = {
4502 ["Size of osKernelConfig_s"][::core::mem::size_of::<osKernelConfig_s>() - 112usize];
4503 ["Alignment of osKernelConfig_s"][::core::mem::align_of::<osKernelConfig_s>() - 8usize];
4504 ["Offset of field: osKernelConfig_s::kernel_ver"]
4505 [::core::mem::offset_of!(osKernelConfig_s, kernel_ver) - 0usize];
4506 ["Offset of field: osKernelConfig_s::update_flag"]
4507 [::core::mem::offset_of!(osKernelConfig_s, update_flag) - 4usize];
4508 ["Offset of field: osKernelConfig_s::ns_tid"]
4509 [::core::mem::offset_of!(osKernelConfig_s, ns_tid) - 8usize];
4510 ["Offset of field: osKernelConfig_s::kernel_syscore_ver"]
4511 [::core::mem::offset_of!(osKernelConfig_s, kernel_syscore_ver) - 16usize];
4512 ["Offset of field: osKernelConfig_s::env_info"]
4513 [::core::mem::offset_of!(osKernelConfig_s, env_info) - 20usize];
4514 ["Offset of field: osKernelConfig_s::unit_info"]
4515 [::core::mem::offset_of!(osKernelConfig_s, unit_info) - 21usize];
4516 ["Offset of field: osKernelConfig_s::boot_env"]
4517 [::core::mem::offset_of!(osKernelConfig_s, boot_env) - 22usize];
4518 ["Offset of field: osKernelConfig_s::unk_0x17"]
4519 [::core::mem::offset_of!(osKernelConfig_s, unk_0x17) - 23usize];
4520 ["Offset of field: osKernelConfig_s::kernel_ctrsdk_ver"]
4521 [::core::mem::offset_of!(osKernelConfig_s, kernel_ctrsdk_ver) - 24usize];
4522 ["Offset of field: osKernelConfig_s::unk_0x1c"]
4523 [::core::mem::offset_of!(osKernelConfig_s, unk_0x1c) - 28usize];
4524 ["Offset of field: osKernelConfig_s::firmlaunch_flags"]
4525 [::core::mem::offset_of!(osKernelConfig_s, firmlaunch_flags) - 32usize];
4526 ["Offset of field: osKernelConfig_s::unk_0x24"]
4527 [::core::mem::offset_of!(osKernelConfig_s, unk_0x24) - 36usize];
4528 ["Offset of field: osKernelConfig_s::app_memtype"]
4529 [::core::mem::offset_of!(osKernelConfig_s, app_memtype) - 48usize];
4530 ["Offset of field: osKernelConfig_s::unk_0x34"]
4531 [::core::mem::offset_of!(osKernelConfig_s, unk_0x34) - 52usize];
4532 ["Offset of field: osKernelConfig_s::memregion_sz"]
4533 [::core::mem::offset_of!(osKernelConfig_s, memregion_sz) - 64usize];
4534 ["Offset of field: osKernelConfig_s::unk_0x4c"]
4535 [::core::mem::offset_of!(osKernelConfig_s, unk_0x4c) - 76usize];
4536 ["Offset of field: osKernelConfig_s::firm_ver"]
4537 [::core::mem::offset_of!(osKernelConfig_s, firm_ver) - 96usize];
4538 ["Offset of field: osKernelConfig_s::firm_syscore_ver"]
4539 [::core::mem::offset_of!(osKernelConfig_s, firm_syscore_ver) - 100usize];
4540 ["Offset of field: osKernelConfig_s::firm_ctrsdk_ver"]
4541 [::core::mem::offset_of!(osKernelConfig_s, firm_ctrsdk_ver) - 104usize];
4542};
4543#[doc = "Time reference information struct (filled in by PTM)."]
4544#[repr(C)]
4545#[derive(Debug, Default, Copy, Clone)]
4546pub struct osTimeRef_s {
4547 #[doc = "< Milliseconds elapsed since January 1900 when this structure was last updated"]
4548 pub value_ms: u64_,
4549 #[doc = "< System ticks elapsed since boot when this structure was last updated"]
4550 pub value_tick: u64_,
4551 #[doc = "< System clock frequency in Hz adjusted using RTC measurements (usually around SYSCLOCK_ARM11)"]
4552 pub sysclock_hz: s64,
4553 #[doc = "< Measured time drift of the system clock (according to the RTC) in milliseconds since the last update"]
4554 pub drift_ms: s64,
4555}
4556#[allow(clippy::unnecessary_operation, clippy::identity_op)]
4557const _: () = {
4558 ["Size of osTimeRef_s"][::core::mem::size_of::<osTimeRef_s>() - 32usize];
4559 ["Alignment of osTimeRef_s"][::core::mem::align_of::<osTimeRef_s>() - 8usize];
4560 ["Offset of field: osTimeRef_s::value_ms"]
4561 [::core::mem::offset_of!(osTimeRef_s, value_ms) - 0usize];
4562 ["Offset of field: osTimeRef_s::value_tick"]
4563 [::core::mem::offset_of!(osTimeRef_s, value_tick) - 8usize];
4564 ["Offset of field: osTimeRef_s::sysclock_hz"]
4565 [::core::mem::offset_of!(osTimeRef_s, sysclock_hz) - 16usize];
4566 ["Offset of field: osTimeRef_s::drift_ms"]
4567 [::core::mem::offset_of!(osTimeRef_s, drift_ms) - 24usize];
4568};
4569#[doc = "Shared system configuration page structure (read-only or read-write depending on exheader)."]
4570#[repr(C)]
4571#[derive(Debug, Default, Copy, Clone)]
4572pub struct osSharedConfig_s {
4573 pub timeref_cnt: vu32,
4574 pub running_hw: u8_,
4575 pub mcu_hwinfo: u8_,
4576 pub unk_0x06: [u8_; 26usize],
4577 pub timeref: [osTimeRef_s; 2usize],
4578 pub wifi_macaddr: [u8_; 6usize],
4579 pub wifi_strength: vu8,
4580 pub network_state: vu8,
4581 pub unk_0x68: [u8_; 24usize],
4582 pub slider_3d: f32,
4583 pub led_3d: vu8,
4584 pub led_battery: vu8,
4585 pub unk_flag: vu8,
4586 pub unk_0x87: u8_,
4587 pub unk_0x88: [u8_; 24usize],
4588 pub menu_tid: vu64,
4589 pub cur_menu_tid: vu64,
4590 pub unk_0xB0: [u8_; 16usize],
4591 pub headset_connected: vu8,
4592}
4593#[allow(clippy::unnecessary_operation, clippy::identity_op)]
4594const _: () = {
4595 ["Size of osSharedConfig_s"][::core::mem::size_of::<osSharedConfig_s>() - 200usize];
4596 ["Alignment of osSharedConfig_s"][::core::mem::align_of::<osSharedConfig_s>() - 8usize];
4597 ["Offset of field: osSharedConfig_s::timeref_cnt"]
4598 [::core::mem::offset_of!(osSharedConfig_s, timeref_cnt) - 0usize];
4599 ["Offset of field: osSharedConfig_s::running_hw"]
4600 [::core::mem::offset_of!(osSharedConfig_s, running_hw) - 4usize];
4601 ["Offset of field: osSharedConfig_s::mcu_hwinfo"]
4602 [::core::mem::offset_of!(osSharedConfig_s, mcu_hwinfo) - 5usize];
4603 ["Offset of field: osSharedConfig_s::unk_0x06"]
4604 [::core::mem::offset_of!(osSharedConfig_s, unk_0x06) - 6usize];
4605 ["Offset of field: osSharedConfig_s::timeref"]
4606 [::core::mem::offset_of!(osSharedConfig_s, timeref) - 32usize];
4607 ["Offset of field: osSharedConfig_s::wifi_macaddr"]
4608 [::core::mem::offset_of!(osSharedConfig_s, wifi_macaddr) - 96usize];
4609 ["Offset of field: osSharedConfig_s::wifi_strength"]
4610 [::core::mem::offset_of!(osSharedConfig_s, wifi_strength) - 102usize];
4611 ["Offset of field: osSharedConfig_s::network_state"]
4612 [::core::mem::offset_of!(osSharedConfig_s, network_state) - 103usize];
4613 ["Offset of field: osSharedConfig_s::unk_0x68"]
4614 [::core::mem::offset_of!(osSharedConfig_s, unk_0x68) - 104usize];
4615 ["Offset of field: osSharedConfig_s::slider_3d"]
4616 [::core::mem::offset_of!(osSharedConfig_s, slider_3d) - 128usize];
4617 ["Offset of field: osSharedConfig_s::led_3d"]
4618 [::core::mem::offset_of!(osSharedConfig_s, led_3d) - 132usize];
4619 ["Offset of field: osSharedConfig_s::led_battery"]
4620 [::core::mem::offset_of!(osSharedConfig_s, led_battery) - 133usize];
4621 ["Offset of field: osSharedConfig_s::unk_flag"]
4622 [::core::mem::offset_of!(osSharedConfig_s, unk_flag) - 134usize];
4623 ["Offset of field: osSharedConfig_s::unk_0x87"]
4624 [::core::mem::offset_of!(osSharedConfig_s, unk_0x87) - 135usize];
4625 ["Offset of field: osSharedConfig_s::unk_0x88"]
4626 [::core::mem::offset_of!(osSharedConfig_s, unk_0x88) - 136usize];
4627 ["Offset of field: osSharedConfig_s::menu_tid"]
4628 [::core::mem::offset_of!(osSharedConfig_s, menu_tid) - 160usize];
4629 ["Offset of field: osSharedConfig_s::cur_menu_tid"]
4630 [::core::mem::offset_of!(osSharedConfig_s, cur_menu_tid) - 168usize];
4631 ["Offset of field: osSharedConfig_s::unk_0xB0"]
4632 [::core::mem::offset_of!(osSharedConfig_s, unk_0xB0) - 176usize];
4633 ["Offset of field: osSharedConfig_s::headset_connected"]
4634 [::core::mem::offset_of!(osSharedConfig_s, headset_connected) - 192usize];
4635};
4636#[doc = "Tick counter."]
4637#[repr(C)]
4638#[derive(Debug, Default, Copy, Clone)]
4639pub struct TickCounter {
4640 #[doc = "< Elapsed CPU ticks between measurements."]
4641 pub elapsed: u64_,
4642 #[doc = "< Point in time used as reference."]
4643 pub reference: u64_,
4644}
4645#[allow(clippy::unnecessary_operation, clippy::identity_op)]
4646const _: () = {
4647 ["Size of TickCounter"][::core::mem::size_of::<TickCounter>() - 16usize];
4648 ["Alignment of TickCounter"][::core::mem::align_of::<TickCounter>() - 8usize];
4649 ["Offset of field: TickCounter::elapsed"]
4650 [::core::mem::offset_of!(TickCounter, elapsed) - 0usize];
4651 ["Offset of field: TickCounter::reference"]
4652 [::core::mem::offset_of!(TickCounter, reference) - 8usize];
4653};
4654#[doc = "OS_VersionBin. Format of the system version: \"<major>.<minor>.<build>-<nupver><region>\""]
4655#[repr(C)]
4656#[derive(Debug, Default, Copy, Clone)]
4657pub struct OS_VersionBin {
4658 pub build: u8_,
4659 pub minor: u8_,
4660 pub mainver: u8_,
4661 pub reserved_x3: u8_,
4662 pub region: ::libc::c_char,
4663 pub reserved_x5: [u8_; 3usize],
4664}
4665#[allow(clippy::unnecessary_operation, clippy::identity_op)]
4666const _: () = {
4667 ["Size of OS_VersionBin"][::core::mem::size_of::<OS_VersionBin>() - 8usize];
4668 ["Alignment of OS_VersionBin"][::core::mem::align_of::<OS_VersionBin>() - 1usize];
4669 ["Offset of field: OS_VersionBin::build"]
4670 [::core::mem::offset_of!(OS_VersionBin, build) - 0usize];
4671 ["Offset of field: OS_VersionBin::minor"]
4672 [::core::mem::offset_of!(OS_VersionBin, minor) - 1usize];
4673 ["Offset of field: OS_VersionBin::mainver"]
4674 [::core::mem::offset_of!(OS_VersionBin, mainver) - 2usize];
4675 ["Offset of field: OS_VersionBin::reserved_x3"]
4676 [::core::mem::offset_of!(OS_VersionBin, reserved_x3) - 3usize];
4677 ["Offset of field: OS_VersionBin::region"]
4678 [::core::mem::offset_of!(OS_VersionBin, region) - 4usize];
4679 ["Offset of field: OS_VersionBin::reserved_x5"]
4680 [::core::mem::offset_of!(OS_VersionBin, reserved_x5) - 5usize];
4681};
4682unsafe extern "C" {
4683 #[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."]
4684 pub fn osConvertVirtToPhys(vaddr: *const ::libc::c_void) -> u32_;
4685}
4686unsafe extern "C" {
4687 #[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."]
4688 pub fn osConvertOldLINEARMemToNew(vaddr: *const ::libc::c_void) -> *mut ::libc::c_void;
4689}
4690unsafe extern "C" {
4691 #[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."]
4692 pub fn osStrError(error: Result) -> *const ::libc::c_char;
4693}
4694unsafe extern "C" {
4695 #[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."]
4696 #[link_name = "osGetFirmVersion__extern"]
4697 pub fn osGetFirmVersion() -> u32_;
4698}
4699unsafe extern "C" {
4700 #[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"]
4701 #[link_name = "osGetKernelVersion__extern"]
4702 pub fn osGetKernelVersion() -> u32_;
4703}
4704unsafe extern "C" {
4705 #[doc = "Gets the system's \"core version\" (2 on NATIVE_FIRM, 3 on SAFE_FIRM, etc.)"]
4706 #[link_name = "osGetSystemCoreVersion__extern"]
4707 pub fn osGetSystemCoreVersion() -> u32_;
4708}
4709unsafe extern "C" {
4710 #[doc = "Gets the system's memory layout ID (0-5 on Old 3DS, 6-8 on New 3DS)"]
4711 #[link_name = "osGetApplicationMemType__extern"]
4712 pub fn osGetApplicationMemType() -> u32_;
4713}
4714unsafe extern "C" {
4715 #[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."]
4716 #[link_name = "osGetMemRegionSize__extern"]
4717 pub fn osGetMemRegionSize(region: MemRegion) -> u32_;
4718}
4719unsafe extern "C" {
4720 #[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."]
4721 #[link_name = "osGetMemRegionUsed__extern"]
4722 pub fn osGetMemRegionUsed(region: MemRegion) -> u32_;
4723}
4724unsafe extern "C" {
4725 #[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."]
4726 #[link_name = "osGetMemRegionFree__extern"]
4727 pub fn osGetMemRegionFree(region: MemRegion) -> u32_;
4728}
4729unsafe extern "C" {
4730 #[doc = "Reads the latest reference timepoint published by PTM.\n # Returns\n\nStructure (see osTimeRef_s)."]
4731 pub fn osGetTimeRef() -> osTimeRef_s;
4732}
4733unsafe extern "C" {
4734 #[doc = "Gets the current time.\n # Returns\n\nThe number of milliseconds since 1st Jan 1900 00:00."]
4735 pub fn osGetTime() -> u64_;
4736}
4737unsafe extern "C" {
4738 #[doc = "Starts a tick counter.\n # Arguments\n\n* `cnt` - The tick counter."]
4739 #[link_name = "osTickCounterStart__extern"]
4740 pub fn osTickCounterStart(cnt: *mut TickCounter);
4741}
4742unsafe extern "C" {
4743 #[doc = "Updates the elapsed time in a tick counter.\n # Arguments\n\n* `cnt` - The tick counter."]
4744 #[link_name = "osTickCounterUpdate__extern"]
4745 pub fn osTickCounterUpdate(cnt: *mut TickCounter);
4746}
4747unsafe extern "C" {
4748 #[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."]
4749 pub fn osTickCounterRead(cnt: *const TickCounter) -> f64;
4750}
4751unsafe extern "C" {
4752 #[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."]
4753 #[link_name = "osGetWifiStrength__extern"]
4754 pub fn osGetWifiStrength() -> u8_;
4755}
4756unsafe extern "C" {
4757 #[doc = "Gets the state of the 3D slider.\n # Returns\n\nThe state of the 3D slider (0.0~1.0)"]
4758 #[link_name = "osGet3DSliderState__extern"]
4759 pub fn osGet3DSliderState() -> f32;
4760}
4761unsafe extern "C" {
4762 #[doc = "Checks whether a headset is connected.\n # Returns\n\ntrue or false."]
4763 #[link_name = "osIsHeadsetConnected__extern"]
4764 pub fn osIsHeadsetConnected() -> bool;
4765}
4766unsafe extern "C" {
4767 #[doc = "Configures the New 3DS speedup.\n # Arguments\n\n* `enable` - Specifies whether to enable or disable the speedup."]
4768 pub fn osSetSpeedupEnable(enable: bool);
4769}
4770unsafe extern "C" {
4771 #[must_use]
4772 #[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."]
4773 pub fn osGetSystemVersionData(
4774 nver_versionbin: *mut OS_VersionBin,
4775 cver_versionbin: *mut OS_VersionBin,
4776 ) -> Result;
4777}
4778unsafe extern "C" {
4779 #[must_use]
4780 #[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."]
4781 pub fn osGetSystemVersionDataString(
4782 nver_versionbin: *mut OS_VersionBin,
4783 cver_versionbin: *mut OS_VersionBin,
4784 sysverstr: *mut ::libc::c_char,
4785 sysverstr_maxsize: u32_,
4786 ) -> Result;
4787}
4788pub type _LOCK_T = i32;
4789#[repr(C)]
4790#[derive(Debug, Default, Copy, Clone)]
4791pub struct __lock_t {
4792 pub lock: _LOCK_T,
4793 pub thread_tag: u32,
4794 pub counter: u32,
4795}
4796#[allow(clippy::unnecessary_operation, clippy::identity_op)]
4797const _: () = {
4798 ["Size of __lock_t"][::core::mem::size_of::<__lock_t>() - 12usize];
4799 ["Alignment of __lock_t"][::core::mem::align_of::<__lock_t>() - 4usize];
4800 ["Offset of field: __lock_t::lock"][::core::mem::offset_of!(__lock_t, lock) - 0usize];
4801 ["Offset of field: __lock_t::thread_tag"]
4802 [::core::mem::offset_of!(__lock_t, thread_tag) - 4usize];
4803 ["Offset of field: __lock_t::counter"][::core::mem::offset_of!(__lock_t, counter) - 8usize];
4804};
4805pub type _LOCK_RECURSIVE_T = __lock_t;
4806#[doc = "A light lock."]
4807pub type LightLock = _LOCK_T;
4808#[doc = "A recursive lock."]
4809pub type RecursiveLock = _LOCK_RECURSIVE_T;
4810#[doc = "A condition variable."]
4811pub type CondVar = s32;
4812#[doc = "A light event."]
4813#[repr(C)]
4814#[derive(Debug, Default, Copy, Clone)]
4815pub struct LightEvent {
4816 #[doc = "< State of the event: -2=cleared sticky, -1=cleared oneshot, 0=signaled oneshot, 1=signaled sticky"]
4817 pub state: s32,
4818 #[doc = "< Lock used for sticky timer operation"]
4819 pub lock: LightLock,
4820}
4821#[allow(clippy::unnecessary_operation, clippy::identity_op)]
4822const _: () = {
4823 ["Size of LightEvent"][::core::mem::size_of::<LightEvent>() - 8usize];
4824 ["Alignment of LightEvent"][::core::mem::align_of::<LightEvent>() - 4usize];
4825 ["Offset of field: LightEvent::state"][::core::mem::offset_of!(LightEvent, state) - 0usize];
4826 ["Offset of field: LightEvent::lock"][::core::mem::offset_of!(LightEvent, lock) - 4usize];
4827};
4828#[doc = "A light semaphore."]
4829#[repr(C)]
4830#[derive(Debug, Default, Copy, Clone)]
4831pub struct LightSemaphore {
4832 #[doc = "< The current release count of the semaphore"]
4833 pub current_count: s32,
4834 #[doc = "< Number of threads concurrently acquiring the semaphore"]
4835 pub num_threads_acq: s16,
4836 #[doc = "< The maximum release count of the semaphore"]
4837 pub max_count: s16,
4838}
4839#[allow(clippy::unnecessary_operation, clippy::identity_op)]
4840const _: () = {
4841 ["Size of LightSemaphore"][::core::mem::size_of::<LightSemaphore>() - 8usize];
4842 ["Alignment of LightSemaphore"][::core::mem::align_of::<LightSemaphore>() - 4usize];
4843 ["Offset of field: LightSemaphore::current_count"]
4844 [::core::mem::offset_of!(LightSemaphore, current_count) - 0usize];
4845 ["Offset of field: LightSemaphore::num_threads_acq"]
4846 [::core::mem::offset_of!(LightSemaphore, num_threads_acq) - 4usize];
4847 ["Offset of field: LightSemaphore::max_count"]
4848 [::core::mem::offset_of!(LightSemaphore, max_count) - 6usize];
4849};
4850unsafe extern "C" {
4851 #[doc = "Performs a Data Synchronization Barrier operation."]
4852 #[link_name = "__dsb__extern"]
4853 pub fn __dsb();
4854}
4855unsafe extern "C" {
4856 #[doc = "Performs a Data Memory Barrier operation."]
4857 #[link_name = "__dmb__extern"]
4858 pub fn __dmb();
4859}
4860unsafe extern "C" {
4861 #[doc = "Performs an Instruction Synchronization Barrier (officially \"flush prefetch buffer\") operation."]
4862 #[link_name = "__isb__extern"]
4863 pub fn __isb();
4864}
4865unsafe extern "C" {
4866 #[doc = "Performs a clrex operation."]
4867 #[link_name = "__clrex__extern"]
4868 pub fn __clrex();
4869}
4870unsafe extern "C" {
4871 #[doc = "Performs a ldrex operation.\n # Arguments\n\n* `addr` - Address to perform the operation on.\n # Returns\n\nThe resulting value."]
4872 #[link_name = "__ldrex__extern"]
4873 pub fn __ldrex(addr: *mut s32) -> s32;
4874}
4875unsafe extern "C" {
4876 #[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."]
4877 #[link_name = "__strex__extern"]
4878 pub fn __strex(addr: *mut s32, val: s32) -> bool;
4879}
4880unsafe extern "C" {
4881 #[doc = "Performs a ldrexh operation.\n # Arguments\n\n* `addr` - Address to perform the operation on.\n # Returns\n\nThe resulting value."]
4882 #[link_name = "__ldrexh__extern"]
4883 pub fn __ldrexh(addr: *mut u16_) -> u16_;
4884}
4885unsafe extern "C" {
4886 #[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."]
4887 #[link_name = "__strexh__extern"]
4888 pub fn __strexh(addr: *mut u16_, val: u16_) -> bool;
4889}
4890unsafe extern "C" {
4891 #[doc = "Performs a ldrexb operation.\n # Arguments\n\n* `addr` - Address to perform the operation on.\n # Returns\n\nThe resulting value."]
4892 #[link_name = "__ldrexb__extern"]
4893 pub fn __ldrexb(addr: *mut u8_) -> u8_;
4894}
4895unsafe extern "C" {
4896 #[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."]
4897 #[link_name = "__strexb__extern"]
4898 pub fn __strexb(addr: *mut u8_, val: u8_) -> bool;
4899}
4900unsafe extern "C" {
4901 #[must_use]
4902 #[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)."]
4903 pub fn syncArbitrateAddress(addr: *mut s32, type_: ArbitrationType, value: s32) -> Result;
4904}
4905unsafe extern "C" {
4906 #[must_use]
4907 #[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)."]
4908 pub fn syncArbitrateAddressWithTimeout(
4909 addr: *mut s32,
4910 type_: ArbitrationType,
4911 value: s32,
4912 timeout_ns: s64,
4913 ) -> Result;
4914}
4915unsafe extern "C" {
4916 #[doc = "Initializes a light lock.\n # Arguments\n\n* `lock` - Pointer to the lock."]
4917 pub fn LightLock_Init(lock: *mut LightLock);
4918}
4919unsafe extern "C" {
4920 #[doc = "Locks a light lock.\n # Arguments\n\n* `lock` - Pointer to the lock."]
4921 pub fn LightLock_Lock(lock: *mut LightLock);
4922}
4923unsafe extern "C" {
4924 #[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."]
4925 pub fn LightLock_TryLock(lock: *mut LightLock) -> ::libc::c_int;
4926}
4927unsafe extern "C" {
4928 #[doc = "Unlocks a light lock.\n # Arguments\n\n* `lock` - Pointer to the lock."]
4929 pub fn LightLock_Unlock(lock: *mut LightLock);
4930}
4931unsafe extern "C" {
4932 #[doc = "Initializes a recursive lock.\n # Arguments\n\n* `lock` - Pointer to the lock."]
4933 pub fn RecursiveLock_Init(lock: *mut RecursiveLock);
4934}
4935unsafe extern "C" {
4936 #[doc = "Locks a recursive lock.\n # Arguments\n\n* `lock` - Pointer to the lock."]
4937 pub fn RecursiveLock_Lock(lock: *mut RecursiveLock);
4938}
4939unsafe extern "C" {
4940 #[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."]
4941 pub fn RecursiveLock_TryLock(lock: *mut RecursiveLock) -> ::libc::c_int;
4942}
4943unsafe extern "C" {
4944 #[doc = "Unlocks a recursive lock.\n # Arguments\n\n* `lock` - Pointer to the lock."]
4945 pub fn RecursiveLock_Unlock(lock: *mut RecursiveLock);
4946}
4947unsafe extern "C" {
4948 #[doc = "Initializes a condition variable.\n # Arguments\n\n* `cv` - Pointer to the condition variable."]
4949 pub fn CondVar_Init(cv: *mut CondVar);
4950}
4951unsafe extern "C" {
4952 #[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."]
4953 pub fn CondVar_Wait(cv: *mut CondVar, lock: *mut LightLock);
4954}
4955unsafe extern "C" {
4956 #[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."]
4957 pub fn CondVar_WaitTimeout(
4958 cv: *mut CondVar,
4959 lock: *mut LightLock,
4960 timeout_ns: s64,
4961 ) -> ::libc::c_int;
4962}
4963unsafe extern "C" {
4964 #[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)."]
4965 pub fn CondVar_WakeUp(cv: *mut CondVar, num_threads: s32);
4966}
4967unsafe extern "C" {
4968 #[doc = "Wakes up a single thread waiting on a condition variable.\n # Arguments\n\n* `cv` - Pointer to the condition variable."]
4969 #[link_name = "CondVar_Signal__extern"]
4970 pub fn CondVar_Signal(cv: *mut CondVar);
4971}
4972unsafe extern "C" {
4973 #[doc = "Wakes up all threads waiting on a condition variable.\n # Arguments\n\n* `cv` - Pointer to the condition variable."]
4974 #[link_name = "CondVar_Broadcast__extern"]
4975 pub fn CondVar_Broadcast(cv: *mut CondVar);
4976}
4977unsafe extern "C" {
4978 #[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)."]
4979 pub fn LightEvent_Init(event: *mut LightEvent, reset_type: ResetType);
4980}
4981unsafe extern "C" {
4982 #[doc = "Clears a light event.\n # Arguments\n\n* `event` - Pointer to the event."]
4983 pub fn LightEvent_Clear(event: *mut LightEvent);
4984}
4985unsafe extern "C" {
4986 #[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."]
4987 pub fn LightEvent_Pulse(event: *mut LightEvent);
4988}
4989unsafe extern "C" {
4990 #[doc = "Signals a light event, waking up threads waiting on it.\n # Arguments\n\n* `event` - Pointer to the event."]
4991 pub fn LightEvent_Signal(event: *mut LightEvent);
4992}
4993unsafe extern "C" {
4994 #[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."]
4995 pub fn LightEvent_TryWait(event: *mut LightEvent) -> ::libc::c_int;
4996}
4997unsafe extern "C" {
4998 #[doc = "Waits on a light event.\n # Arguments\n\n* `event` - Pointer to the event."]
4999 pub fn LightEvent_Wait(event: *mut LightEvent);
5000}
5001unsafe extern "C" {
5002 #[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."]
5003 pub fn LightEvent_WaitTimeout(event: *mut LightEvent, timeout_ns: s64) -> ::libc::c_int;
5004}
5005unsafe extern "C" {
5006 #[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."]
5007 pub fn LightSemaphore_Init(semaphore: *mut LightSemaphore, initial_count: s16, max_count: s16);
5008}
5009unsafe extern "C" {
5010 #[doc = "Acquires a light semaphore.\n # Arguments\n\n* `semaphore` - Pointer to the semaphore.\n * `count` - Acquire count"]
5011 pub fn LightSemaphore_Acquire(semaphore: *mut LightSemaphore, count: s32);
5012}
5013unsafe extern "C" {
5014 #[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"]
5015 pub fn LightSemaphore_TryAcquire(semaphore: *mut LightSemaphore, count: s32) -> ::libc::c_int;
5016}
5017unsafe extern "C" {
5018 #[doc = "Releases a light semaphore.\n # Arguments\n\n* `semaphore` - Pointer to the semaphore.\n * `count` - Release count"]
5019 pub fn LightSemaphore_Release(semaphore: *mut LightSemaphore, count: s32);
5020}
5021#[repr(C)]
5022#[derive(Debug, Copy, Clone)]
5023pub struct Thread_tag {
5024 _unused: [u8; 0],
5025}
5026#[doc = "libctru thread handle type"]
5027pub type Thread = *mut Thread_tag;
5028#[doc = "Exception handler type, necessarily an ARM function that does not return."]
5029pub type ExceptionHandler = ::core::option::Option<
5030 unsafe extern "C" fn(excep: *mut ERRF_ExceptionInfo, regs: *mut CpuRegisters),
5031>;
5032unsafe extern "C" {
5033 #[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."]
5034 pub fn threadCreate(
5035 entrypoint: ThreadFunc,
5036 arg: *mut ::libc::c_void,
5037 stack_size: usize,
5038 prio: ::libc::c_int,
5039 core_id: ::libc::c_int,
5040 detached: bool,
5041 ) -> Thread;
5042}
5043unsafe extern "C" {
5044 #[doc = "Retrieves the OS thread handle of a libctru thread.\n # Arguments\n\n* `thread` - libctru thread handle\n # Returns\n\nOS thread handle"]
5045 pub fn threadGetHandle(thread: Thread) -> Handle;
5046}
5047unsafe extern "C" {
5048 #[doc = "Retrieves the exit code of a finished libctru thread.\n # Arguments\n\n* `thread` - libctru thread handle\n # Returns\n\nExit code"]
5049 pub fn threadGetExitCode(thread: Thread) -> ::libc::c_int;
5050}
5051unsafe extern "C" {
5052 #[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."]
5053 pub fn threadFree(thread: Thread);
5054}
5055unsafe extern "C" {
5056 #[must_use]
5057 #[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"]
5058 pub fn threadJoin(thread: Thread, timeout_ns: u64_) -> Result;
5059}
5060unsafe extern "C" {
5061 #[doc = "Changes a thread's status from attached to detached.\n # Arguments\n\n* `thread` - libctru thread handle"]
5062 pub fn threadDetach(thread: Thread);
5063}
5064unsafe extern "C" {
5065 #[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"]
5066 pub fn threadGetCurrent() -> Thread;
5067}
5068unsafe extern "C" {
5069 #[doc = "Exits the current libctru thread with an exit code (not usable from the main thread).\n # Arguments\n\n* `rc` - Exit code"]
5070 pub fn threadExit(rc: ::libc::c_int) -> !;
5071}
5072unsafe extern "C" {
5073 #[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."]
5074 #[link_name = "threadOnException__extern"]
5075 pub fn threadOnException(
5076 handler: ExceptionHandler,
5077 stack_top: *mut ::libc::c_void,
5078 exception_data: *mut ERRF_ExceptionData,
5079 );
5080}
5081#[doc = "Framebuffer information."]
5082#[repr(C)]
5083#[derive(Debug, Copy, Clone)]
5084pub struct GSPGPU_FramebufferInfo {
5085 #[doc = "< Active framebuffer. (0 = first, 1 = second)"]
5086 pub active_framebuf: u32_,
5087 #[doc = "< Framebuffer virtual address, for the main screen this is the 3D left framebuffer."]
5088 pub framebuf0_vaddr: *mut u32_,
5089 #[doc = "< For the main screen: 3D right framebuffer address."]
5090 pub framebuf1_vaddr: *mut u32_,
5091 #[doc = "< Value for 0x1EF00X90, controls framebuffer width."]
5092 pub framebuf_widthbytesize: u32_,
5093 #[doc = "< Framebuffer format, this u16 is written to the low u16 for LCD register 0x1EF00X70."]
5094 pub format: u32_,
5095 #[doc = "< Value for 0x1EF00X78, controls which framebuffer is displayed."]
5096 pub framebuf_dispselect: u32_,
5097 #[doc = "< Unknown."]
5098 pub unk: u32_,
5099}
5100#[allow(clippy::unnecessary_operation, clippy::identity_op)]
5101const _: () = {
5102 ["Size of GSPGPU_FramebufferInfo"][::core::mem::size_of::<GSPGPU_FramebufferInfo>() - 28usize];
5103 ["Alignment of GSPGPU_FramebufferInfo"]
5104 [::core::mem::align_of::<GSPGPU_FramebufferInfo>() - 4usize];
5105 ["Offset of field: GSPGPU_FramebufferInfo::active_framebuf"]
5106 [::core::mem::offset_of!(GSPGPU_FramebufferInfo, active_framebuf) - 0usize];
5107 ["Offset of field: GSPGPU_FramebufferInfo::framebuf0_vaddr"]
5108 [::core::mem::offset_of!(GSPGPU_FramebufferInfo, framebuf0_vaddr) - 4usize];
5109 ["Offset of field: GSPGPU_FramebufferInfo::framebuf1_vaddr"]
5110 [::core::mem::offset_of!(GSPGPU_FramebufferInfo, framebuf1_vaddr) - 8usize];
5111 ["Offset of field: GSPGPU_FramebufferInfo::framebuf_widthbytesize"]
5112 [::core::mem::offset_of!(GSPGPU_FramebufferInfo, framebuf_widthbytesize) - 12usize];
5113 ["Offset of field: GSPGPU_FramebufferInfo::format"]
5114 [::core::mem::offset_of!(GSPGPU_FramebufferInfo, format) - 16usize];
5115 ["Offset of field: GSPGPU_FramebufferInfo::framebuf_dispselect"]
5116 [::core::mem::offset_of!(GSPGPU_FramebufferInfo, framebuf_dispselect) - 20usize];
5117 ["Offset of field: GSPGPU_FramebufferInfo::unk"]
5118 [::core::mem::offset_of!(GSPGPU_FramebufferInfo, unk) - 24usize];
5119};
5120impl Default for GSPGPU_FramebufferInfo {
5121 fn default() -> Self {
5122 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
5123 unsafe {
5124 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
5125 s.assume_init()
5126 }
5127 }
5128}
5129#[doc = "< RGBA8. (4 bytes)"]
5130pub const GSP_RGBA8_OES: GSPGPU_FramebufferFormat = 0;
5131#[doc = "< BGR8. (3 bytes)"]
5132pub const GSP_BGR8_OES: GSPGPU_FramebufferFormat = 1;
5133#[doc = "< RGB565. (2 bytes)"]
5134pub const GSP_RGB565_OES: GSPGPU_FramebufferFormat = 2;
5135#[doc = "< RGB5A1. (2 bytes)"]
5136pub const GSP_RGB5_A1_OES: GSPGPU_FramebufferFormat = 3;
5137#[doc = "< RGBA4. (2 bytes)"]
5138pub const GSP_RGBA4_OES: GSPGPU_FramebufferFormat = 4;
5139#[doc = "Framebuffer format."]
5140pub type GSPGPU_FramebufferFormat = ::libc::c_uchar;
5141#[doc = "Capture info entry."]
5142#[repr(C)]
5143#[derive(Debug, Copy, Clone)]
5144pub struct GSPGPU_CaptureInfoEntry {
5145 #[doc = "< Left framebuffer."]
5146 pub framebuf0_vaddr: *mut u32_,
5147 #[doc = "< Right framebuffer."]
5148 pub framebuf1_vaddr: *mut u32_,
5149 #[doc = "< Framebuffer format."]
5150 pub format: u32_,
5151 #[doc = "< Framebuffer pitch."]
5152 pub framebuf_widthbytesize: u32_,
5153}
5154#[allow(clippy::unnecessary_operation, clippy::identity_op)]
5155const _: () = {
5156 ["Size of GSPGPU_CaptureInfoEntry"]
5157 [::core::mem::size_of::<GSPGPU_CaptureInfoEntry>() - 16usize];
5158 ["Alignment of GSPGPU_CaptureInfoEntry"]
5159 [::core::mem::align_of::<GSPGPU_CaptureInfoEntry>() - 4usize];
5160 ["Offset of field: GSPGPU_CaptureInfoEntry::framebuf0_vaddr"]
5161 [::core::mem::offset_of!(GSPGPU_CaptureInfoEntry, framebuf0_vaddr) - 0usize];
5162 ["Offset of field: GSPGPU_CaptureInfoEntry::framebuf1_vaddr"]
5163 [::core::mem::offset_of!(GSPGPU_CaptureInfoEntry, framebuf1_vaddr) - 4usize];
5164 ["Offset of field: GSPGPU_CaptureInfoEntry::format"]
5165 [::core::mem::offset_of!(GSPGPU_CaptureInfoEntry, format) - 8usize];
5166 ["Offset of field: GSPGPU_CaptureInfoEntry::framebuf_widthbytesize"]
5167 [::core::mem::offset_of!(GSPGPU_CaptureInfoEntry, framebuf_widthbytesize) - 12usize];
5168};
5169impl Default for GSPGPU_CaptureInfoEntry {
5170 fn default() -> Self {
5171 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
5172 unsafe {
5173 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
5174 s.assume_init()
5175 }
5176 }
5177}
5178#[doc = "Capture info."]
5179#[repr(C)]
5180#[derive(Debug, Copy, Clone)]
5181pub struct GSPGPU_CaptureInfo {
5182 #[doc = "< Capture info entries, one for each screen."]
5183 pub screencapture: [GSPGPU_CaptureInfoEntry; 2usize],
5184}
5185#[allow(clippy::unnecessary_operation, clippy::identity_op)]
5186const _: () = {
5187 ["Size of GSPGPU_CaptureInfo"][::core::mem::size_of::<GSPGPU_CaptureInfo>() - 32usize];
5188 ["Alignment of GSPGPU_CaptureInfo"][::core::mem::align_of::<GSPGPU_CaptureInfo>() - 4usize];
5189 ["Offset of field: GSPGPU_CaptureInfo::screencapture"]
5190 [::core::mem::offset_of!(GSPGPU_CaptureInfo, screencapture) - 0usize];
5191};
5192impl Default for GSPGPU_CaptureInfo {
5193 fn default() -> Self {
5194 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
5195 unsafe {
5196 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
5197 s.assume_init()
5198 }
5199 }
5200}
5201#[doc = "< Memory fill completed."]
5202pub const GSPGPU_EVENT_PSC0: GSPGPU_Event = 0;
5203#[doc = "< TODO"]
5204pub const GSPGPU_EVENT_PSC1: GSPGPU_Event = 1;
5205#[doc = "< TODO"]
5206pub const GSPGPU_EVENT_VBlank0: GSPGPU_Event = 2;
5207#[doc = "< TODO"]
5208pub const GSPGPU_EVENT_VBlank1: GSPGPU_Event = 3;
5209#[doc = "< Display transfer finished."]
5210pub const GSPGPU_EVENT_PPF: GSPGPU_Event = 4;
5211#[doc = "< Command list processing finished."]
5212pub const GSPGPU_EVENT_P3D: GSPGPU_Event = 5;
5213#[doc = "< TODO"]
5214pub const GSPGPU_EVENT_DMA: GSPGPU_Event = 6;
5215#[doc = "< Used to know how many events there are."]
5216pub const GSPGPU_EVENT_MAX: GSPGPU_Event = 7;
5217#[doc = "GSPGPU events."]
5218pub type GSPGPU_Event = ::libc::c_uchar;
5219#[doc = "GSPGPU performance log entry.\n\n Use the lastDurationUs field when benchmarking single GPU operations, this is usally meant\n for 3D library writers.\n\n Use the difference between two totalDurationUs when using a GPU library (e.g. citro3d), as\n there can be multiple GPU operations (e.g. P3D, PPF) per render pass, or per frame, and so on.\n Don't use totalDurationUs as-is (rather, take the difference as just described), because it\n can overflow."]
5220#[repr(C)]
5221#[derive(Debug, Default, Copy, Clone)]
5222pub struct GSPGPU_PerfLogEntry {
5223 #[doc = "< Duration of the last corresponding PICA200 operation (time between op is started and IRQ is received)."]
5224 pub lastDurationUs: u32_,
5225 #[doc = "< Sum of lastDurationUs for the corresponding PICA200 operation. Can overflow."]
5226 pub totalDurationUs: u32_,
5227}
5228#[allow(clippy::unnecessary_operation, clippy::identity_op)]
5229const _: () = {
5230 ["Size of GSPGPU_PerfLogEntry"][::core::mem::size_of::<GSPGPU_PerfLogEntry>() - 8usize];
5231 ["Alignment of GSPGPU_PerfLogEntry"][::core::mem::align_of::<GSPGPU_PerfLogEntry>() - 4usize];
5232 ["Offset of field: GSPGPU_PerfLogEntry::lastDurationUs"]
5233 [::core::mem::offset_of!(GSPGPU_PerfLogEntry, lastDurationUs) - 0usize];
5234 ["Offset of field: GSPGPU_PerfLogEntry::totalDurationUs"]
5235 [::core::mem::offset_of!(GSPGPU_PerfLogEntry, totalDurationUs) - 4usize];
5236};
5237#[doc = "GSPGPU performance log"]
5238#[repr(C)]
5239#[derive(Debug, Default, Copy, Clone)]
5240pub struct GSPGPU_PerfLog {
5241 #[doc = "< Performance log entries (one per operation/\"event\")."]
5242 pub entries: [GSPGPU_PerfLogEntry; 7usize],
5243}
5244#[allow(clippy::unnecessary_operation, clippy::identity_op)]
5245const _: () = {
5246 ["Size of GSPGPU_PerfLog"][::core::mem::size_of::<GSPGPU_PerfLog>() - 56usize];
5247 ["Alignment of GSPGPU_PerfLog"][::core::mem::align_of::<GSPGPU_PerfLog>() - 4usize];
5248 ["Offset of field: GSPGPU_PerfLog::entries"]
5249 [::core::mem::offset_of!(GSPGPU_PerfLog, entries) - 0usize];
5250};
5251unsafe extern "C" {
5252 #[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."]
5253 #[link_name = "gspGetBytesPerPixel__extern"]
5254 pub fn gspGetBytesPerPixel(format: GSPGPU_FramebufferFormat) -> ::libc::c_uint;
5255}
5256unsafe extern "C" {
5257 #[must_use]
5258 #[doc = "Initializes GSPGPU."]
5259 pub fn gspInit() -> Result;
5260}
5261unsafe extern "C" {
5262 #[doc = "Exits GSPGPU."]
5263 pub fn gspExit();
5264}
5265unsafe extern "C" {
5266 #[doc = "Gets a pointer to the current gsp::Gpu session handle.\n # Returns\n\nA pointer to the current gsp::Gpu session handle."]
5267 pub fn gspGetSessionHandle() -> *mut Handle;
5268}
5269unsafe extern "C" {
5270 #[doc = "Returns true if the application currently has GPU rights."]
5271 pub fn gspHasGpuRight() -> bool;
5272}
5273unsafe extern "C" {
5274 #[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."]
5275 pub fn gspPresentBuffer(
5276 screen: ::libc::c_uint,
5277 swap: ::libc::c_uint,
5278 fb_a: *const ::libc::c_void,
5279 fb_b: *const ::libc::c_void,
5280 stride: u32_,
5281 mode: u32_,
5282 ) -> bool;
5283}
5284unsafe extern "C" {
5285 #[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)"]
5286 pub fn gspIsPresentPending(screen: ::libc::c_uint) -> bool;
5287}
5288unsafe extern "C" {
5289 #[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."]
5290 pub fn gspSetEventCallback(
5291 id: GSPGPU_Event,
5292 cb: ThreadFunc,
5293 data: *mut ::libc::c_void,
5294 oneShot: bool,
5295 );
5296}
5297unsafe extern "C" {
5298 #[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."]
5299 pub fn gspWaitForEvent(id: GSPGPU_Event, nextEvent: bool);
5300}
5301unsafe extern "C" {
5302 #[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."]
5303 pub fn gspWaitForAnyEvent() -> GSPGPU_Event;
5304}
5305unsafe extern "C" {
5306 #[must_use]
5307 #[doc = "Submits a GX command.\n # Arguments\n\n* `gxCommand` - GX command to execute."]
5308 pub fn gspSubmitGxCommand(gxCommand: *const u32_) -> Result;
5309}
5310unsafe extern "C" {
5311 #[must_use]
5312 #[doc = "Acquires GPU rights.\n # Arguments\n\n* `flags` - Flags to acquire with."]
5313 pub fn GSPGPU_AcquireRight(flags: u8_) -> Result;
5314}
5315unsafe extern "C" {
5316 #[must_use]
5317 #[doc = "Releases GPU rights."]
5318 pub fn GSPGPU_ReleaseRight() -> Result;
5319}
5320unsafe extern "C" {
5321 #[must_use]
5322 #[doc = "Retrieves display capture info.\n # Arguments\n\n* `captureinfo` - Pointer to output capture info to."]
5323 pub fn GSPGPU_ImportDisplayCaptureInfo(captureinfo: *mut GSPGPU_CaptureInfo) -> Result;
5324}
5325unsafe extern "C" {
5326 #[must_use]
5327 #[doc = "Saves the VRAM sys area."]
5328 pub fn GSPGPU_SaveVramSysArea() -> Result;
5329}
5330unsafe extern "C" {
5331 #[must_use]
5332 #[doc = "Resets the GPU"]
5333 pub fn GSPGPU_ResetGpuCore() -> Result;
5334}
5335unsafe extern "C" {
5336 #[must_use]
5337 #[doc = "Restores the VRAM sys area."]
5338 pub fn GSPGPU_RestoreVramSysArea() -> Result;
5339}
5340unsafe extern "C" {
5341 #[must_use]
5342 #[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)"]
5343 pub fn GSPGPU_SetLcdForceBlack(flags: u8_) -> Result;
5344}
5345unsafe extern "C" {
5346 #[must_use]
5347 #[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."]
5348 pub fn GSPGPU_SetBufferSwap(
5349 screenid: u32_,
5350 framebufinfo: *const GSPGPU_FramebufferInfo,
5351 ) -> Result;
5352}
5353unsafe extern "C" {
5354 #[must_use]
5355 #[doc = "Flushes memory from the data cache.\n # Arguments\n\n* `adr` - Address to flush.\n * `size` - Size of the memory to flush."]
5356 pub fn GSPGPU_FlushDataCache(adr: *const ::libc::c_void, size: u32_) -> Result;
5357}
5358unsafe extern "C" {
5359 #[must_use]
5360 #[doc = "Invalidates memory in the data cache.\n # Arguments\n\n* `adr` - Address to invalidate.\n * `size` - Size of the memory to invalidate."]
5361 pub fn GSPGPU_InvalidateDataCache(adr: *const ::libc::c_void, size: u32_) -> Result;
5362}
5363unsafe extern "C" {
5364 #[must_use]
5365 #[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."]
5366 pub fn GSPGPU_WriteHWRegs(regAddr: u32_, data: *const u32_, size: u8_) -> Result;
5367}
5368unsafe extern "C" {
5369 #[must_use]
5370 #[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."]
5371 pub fn GSPGPU_WriteHWRegsWithMask(
5372 regAddr: u32_,
5373 data: *const u32_,
5374 datasize: u8_,
5375 maskdata: *const u32_,
5376 masksize: u8_,
5377 ) -> Result;
5378}
5379unsafe extern "C" {
5380 #[must_use]
5381 #[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."]
5382 pub fn GSPGPU_ReadHWRegs(regAddr: u32_, data: *mut u32_, size: u8_) -> Result;
5383}
5384unsafe extern "C" {
5385 #[must_use]
5386 #[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."]
5387 pub fn GSPGPU_RegisterInterruptRelayQueue(
5388 eventHandle: Handle,
5389 flags: u32_,
5390 outMemHandle: *mut Handle,
5391 threadID: *mut u8_,
5392 ) -> Result;
5393}
5394unsafe extern "C" {
5395 #[must_use]
5396 #[doc = "Unregisters the interrupt relay queue."]
5397 pub fn GSPGPU_UnregisterInterruptRelayQueue() -> Result;
5398}
5399unsafe extern "C" {
5400 #[must_use]
5401 #[doc = "Triggers a handling of commands written to shared memory."]
5402 pub fn GSPGPU_TriggerCmdReqQueue() -> Result;
5403}
5404unsafe extern "C" {
5405 #[must_use]
5406 #[doc = "Sets 3D_LEDSTATE to the input state value.\n # Arguments\n\n* `disable` - False = 3D LED enable, true = 3D LED disable."]
5407 pub fn GSPGPU_SetLedForceOff(disable: bool) -> Result;
5408}
5409unsafe extern "C" {
5410 #[must_use]
5411 #[doc = "Enables or disables the performance log and clear\n its state to zero.\n # Arguments\n\n* `enabled` - Whether to enable the performance log.\n > **Note:** It is assumed that no GPU operation is in progress when calling this function.\n The official sysmodule forgets to clear the \"start tick\" states to 0, though\n this should not be much of an issue (as per the note above)."]
5412 pub fn GSPGPU_SetPerfLogMode(enabled: bool) -> Result;
5413}
5414unsafe extern "C" {
5415 #[must_use]
5416 #[doc = "Retrieves the performance log.\n # Arguments\n\n* `outPerfLog` (direction out) - Pointer to output the performance log to.\n > **Note:** Use the difference between two totalDurationUs when using a GPU library (e.g. citro3d), as\n there can be multiple GPU operations (e.g. P3D, PPF) per render pass, or per frame, and so on.\n Don't use totalDurationUs as-is (rather, take the difference as just described), because it\n can overflow.\n > **Note:** For a MemoryFill operation that uses both PSC0 and PSC1, take the maximum\n of the two \"last duration\" entries.\n > **Note:** For PDC0/PDC1 (VBlank0/1), the \"last duration\" entry corresponds to the time between\n the current PDC (VBlank) IRQ and the previous one. The official GSP sysmodule\n assumes both PDC0 and PDC1 IRQ happens at the same rate (this is almost always\n the case, but not always if user changes PDC timings), and sets both entries\n in the PDC0 handler.\n The official sysmodule doesn't handle the PDC0/1 entries correctly after init. On the first\n frame GSPGPU_SetPerfLogMode is enabled, \"last duration\" will have a nonsensical\n value; and \"total duration\" stays nonsensical. This isn't much of a problem, except for the\n first frame, because \"total duration\" is not supposed to be used as-is (you are supposed\n to take the difference of this field between two time points of your choosing, instead).\n Since it is running at approx. 3.25 GiB/s per bank, some small PSC operations might\n complete before the official GSP has time to record the start time.\n The official sysmodule doesn't properly handle data synchronization for the perflog,\n in practice this should be fine, however."]
5417 pub fn GSPGPU_GetPerfLog(outPerfLog: *mut GSPGPU_PerfLog) -> Result;
5418}
5419#[doc = "< Top screen"]
5420pub const GFX_TOP: gfxScreen_t = 0;
5421#[doc = "< Bottom screen"]
5422pub const GFX_BOTTOM: gfxScreen_t = 1;
5423#[doc = "Screen IDs."]
5424pub type gfxScreen_t = ::libc::c_uchar;
5425#[doc = "< Left eye framebuffer"]
5426pub const GFX_LEFT: gfx3dSide_t = 0;
5427#[doc = "< Right eye framebuffer"]
5428pub const GFX_RIGHT: gfx3dSide_t = 1;
5429#[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."]
5430pub type gfx3dSide_t = ::libc::c_uchar;
5431unsafe extern "C" {
5432 #[doc = "Initializes the LCD framebuffers with default parameters\n This is equivalent to calling: gfxInit(GSP_BGR8_OES,GSP_BGR8_OES,false); "]
5433 pub fn gfxInitDefault();
5434}
5435unsafe extern "C" {
5436 #[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."]
5437 pub fn gfxInit(
5438 topFormat: GSPGPU_FramebufferFormat,
5439 bottomFormat: GSPGPU_FramebufferFormat,
5440 vrambuffers: bool,
5441 );
5442}
5443unsafe extern "C" {
5444 #[doc = "Deinitializes and frees the LCD framebuffers.\n > **Note:** This function internally calls gspExit."]
5445 pub fn gfxExit();
5446}
5447unsafe extern "C" {
5448 #[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."]
5449 pub fn gfxSet3D(enable: bool);
5450}
5451unsafe extern "C" {
5452 #[doc = "Retrieves the status of the 3D stereoscopic effect on the top screen.\n # Returns\n\ntrue if 3D enabled, false otherwise."]
5453 pub fn gfxIs3D() -> bool;
5454}
5455unsafe extern "C" {
5456 #[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."]
5457 pub fn gfxIsWide() -> bool;
5458}
5459unsafe extern "C" {
5460 #[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)."]
5461 pub fn gfxSetWide(enable: bool);
5462}
5463unsafe extern "C" {
5464 #[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."]
5465 pub fn gfxSetScreenFormat(screen: gfxScreen_t, format: GSPGPU_FramebufferFormat);
5466}
5467unsafe extern "C" {
5468 #[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)"]
5469 pub fn gfxGetScreenFormat(screen: gfxScreen_t) -> GSPGPU_FramebufferFormat;
5470}
5471unsafe extern "C" {
5472 #[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."]
5473 pub fn gfxSetDoubleBuffering(screen: gfxScreen_t, enable: bool);
5474}
5475unsafe extern "C" {
5476 #[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."]
5477 pub fn gfxGetFramebuffer(
5478 screen: gfxScreen_t,
5479 side: gfx3dSide_t,
5480 width: *mut u16_,
5481 height: *mut u16_,
5482 ) -> *mut u8_;
5483}
5484unsafe extern "C" {
5485 #[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."]
5486 pub fn gfxFlushBuffers();
5487}
5488unsafe extern "C" {
5489 #[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."]
5490 pub fn gfxScreenSwapBuffers(scr: gfxScreen_t, hasStereo: bool);
5491}
5492unsafe extern "C" {
5493 #[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."]
5494 pub fn gfxConfigScreen(scr: gfxScreen_t, immediate: bool);
5495}
5496unsafe extern "C" {
5497 #[doc = "Updates the configuration of both screens.\n > **Note:** This function is equivalent to: gfxScreenSwapBuffers(GFX_TOP,true); gfxScreenSwapBuffers(GFX_BOTTOM,true); "]
5498 pub fn gfxSwapBuffers();
5499}
5500unsafe extern "C" {
5501 #[doc = "Same as gfxSwapBuffers (formerly different)."]
5502 pub fn gfxSwapBuffersGpu();
5503}
5504#[doc = "A callback for printing a character."]
5505pub type ConsolePrint = ::core::option::Option<
5506 unsafe extern "C" fn(con: *mut ::libc::c_void, c: ::libc::c_int) -> bool,
5507>;
5508#[doc = "A font struct for the console."]
5509#[repr(C)]
5510#[derive(Debug, Copy, Clone)]
5511pub struct ConsoleFont {
5512 #[doc = "< A pointer to the font graphics"]
5513 pub gfx: *mut u8_,
5514 #[doc = "< Offset to the first valid character in the font table"]
5515 pub asciiOffset: u16_,
5516 #[doc = "< Number of characters in the font graphics"]
5517 pub numChars: u16_,
5518}
5519#[allow(clippy::unnecessary_operation, clippy::identity_op)]
5520const _: () = {
5521 ["Size of ConsoleFont"][::core::mem::size_of::<ConsoleFont>() - 8usize];
5522 ["Alignment of ConsoleFont"][::core::mem::align_of::<ConsoleFont>() - 4usize];
5523 ["Offset of field: ConsoleFont::gfx"][::core::mem::offset_of!(ConsoleFont, gfx) - 0usize];
5524 ["Offset of field: ConsoleFont::asciiOffset"]
5525 [::core::mem::offset_of!(ConsoleFont, asciiOffset) - 4usize];
5526 ["Offset of field: ConsoleFont::numChars"]
5527 [::core::mem::offset_of!(ConsoleFont, numChars) - 6usize];
5528};
5529impl Default for ConsoleFont {
5530 fn default() -> Self {
5531 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
5532 unsafe {
5533 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
5534 s.assume_init()
5535 }
5536 }
5537}
5538#[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 "]
5539#[repr(C)]
5540#[derive(Debug, Copy, Clone)]
5541pub struct PrintConsole {
5542 #[doc = "< Font of the console"]
5543 pub font: ConsoleFont,
5544 #[doc = "< Framebuffer address"]
5545 pub frameBuffer: *mut u16_,
5546 #[doc = "< Current X location of the cursor (as a tile offset by default)"]
5547 pub cursorX: ::libc::c_int,
5548 #[doc = "< Current Y location of the cursor (as a tile offset by default)"]
5549 pub cursorY: ::libc::c_int,
5550 #[doc = "< Internal state"]
5551 pub prevCursorX: ::libc::c_int,
5552 #[doc = "< Internal state"]
5553 pub prevCursorY: ::libc::c_int,
5554 #[doc = "< Width of the console hardware layer in characters"]
5555 pub consoleWidth: ::libc::c_int,
5556 #[doc = "< Height of the console hardware layer in characters"]
5557 pub consoleHeight: ::libc::c_int,
5558 #[doc = "< Window X location in characters (not implemented)"]
5559 pub windowX: ::libc::c_int,
5560 #[doc = "< Window Y location in characters (not implemented)"]
5561 pub windowY: ::libc::c_int,
5562 #[doc = "< Window width in characters (not implemented)"]
5563 pub windowWidth: ::libc::c_int,
5564 #[doc = "< Window height in characters (not implemented)"]
5565 pub windowHeight: ::libc::c_int,
5566 #[doc = "< Size of a tab"]
5567 pub tabSize: ::libc::c_int,
5568 #[doc = "< Foreground color"]
5569 pub fg: u16_,
5570 #[doc = "< Background color"]
5571 pub bg: u16_,
5572 #[doc = "< Reverse/bright flags"]
5573 pub flags: ::libc::c_int,
5574 #[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)."]
5575 pub PrintChar: ConsolePrint,
5576 #[doc = "< True if the console is initialized"]
5577 pub consoleInitialised: bool,
5578}
5579#[allow(clippy::unnecessary_operation, clippy::identity_op)]
5580const _: () = {
5581 ["Size of PrintConsole"][::core::mem::size_of::<PrintConsole>() - 72usize];
5582 ["Alignment of PrintConsole"][::core::mem::align_of::<PrintConsole>() - 4usize];
5583 ["Offset of field: PrintConsole::font"][::core::mem::offset_of!(PrintConsole, font) - 0usize];
5584 ["Offset of field: PrintConsole::frameBuffer"]
5585 [::core::mem::offset_of!(PrintConsole, frameBuffer) - 8usize];
5586 ["Offset of field: PrintConsole::cursorX"]
5587 [::core::mem::offset_of!(PrintConsole, cursorX) - 12usize];
5588 ["Offset of field: PrintConsole::cursorY"]
5589 [::core::mem::offset_of!(PrintConsole, cursorY) - 16usize];
5590 ["Offset of field: PrintConsole::prevCursorX"]
5591 [::core::mem::offset_of!(PrintConsole, prevCursorX) - 20usize];
5592 ["Offset of field: PrintConsole::prevCursorY"]
5593 [::core::mem::offset_of!(PrintConsole, prevCursorY) - 24usize];
5594 ["Offset of field: PrintConsole::consoleWidth"]
5595 [::core::mem::offset_of!(PrintConsole, consoleWidth) - 28usize];
5596 ["Offset of field: PrintConsole::consoleHeight"]
5597 [::core::mem::offset_of!(PrintConsole, consoleHeight) - 32usize];
5598 ["Offset of field: PrintConsole::windowX"]
5599 [::core::mem::offset_of!(PrintConsole, windowX) - 36usize];
5600 ["Offset of field: PrintConsole::windowY"]
5601 [::core::mem::offset_of!(PrintConsole, windowY) - 40usize];
5602 ["Offset of field: PrintConsole::windowWidth"]
5603 [::core::mem::offset_of!(PrintConsole, windowWidth) - 44usize];
5604 ["Offset of field: PrintConsole::windowHeight"]
5605 [::core::mem::offset_of!(PrintConsole, windowHeight) - 48usize];
5606 ["Offset of field: PrintConsole::tabSize"]
5607 [::core::mem::offset_of!(PrintConsole, tabSize) - 52usize];
5608 ["Offset of field: PrintConsole::fg"][::core::mem::offset_of!(PrintConsole, fg) - 56usize];
5609 ["Offset of field: PrintConsole::bg"][::core::mem::offset_of!(PrintConsole, bg) - 58usize];
5610 ["Offset of field: PrintConsole::flags"]
5611 [::core::mem::offset_of!(PrintConsole, flags) - 60usize];
5612 ["Offset of field: PrintConsole::PrintChar"]
5613 [::core::mem::offset_of!(PrintConsole, PrintChar) - 64usize];
5614 ["Offset of field: PrintConsole::consoleInitialised"]
5615 [::core::mem::offset_of!(PrintConsole, consoleInitialised) - 68usize];
5616};
5617impl Default for PrintConsole {
5618 fn default() -> Self {
5619 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
5620 unsafe {
5621 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
5622 s.assume_init()
5623 }
5624 }
5625}
5626#[doc = "< Swallows prints to stderr"]
5627pub const debugDevice_NULL: debugDevice = 0;
5628#[doc = "< Outputs stderr debug statements using svcOutputDebugString, which can then be captured by interactive debuggers"]
5629pub const debugDevice_SVC: debugDevice = 1;
5630#[doc = "< Directs stderr debug statements to 3DS console window"]
5631pub const debugDevice_CONSOLE: debugDevice = 2;
5632pub const debugDevice_3DMOO: debugDevice = 1;
5633#[doc = "Console debug devices supported by libctru."]
5634pub type debugDevice = ::libc::c_uchar;
5635unsafe extern "C" {
5636 #[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."]
5637 pub fn consoleSetFont(console: *mut PrintConsole, font: *mut ConsoleFont);
5638}
5639unsafe extern "C" {
5640 #[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."]
5641 pub fn consoleSetWindow(
5642 console: *mut PrintConsole,
5643 x: ::libc::c_int,
5644 y: ::libc::c_int,
5645 width: ::libc::c_int,
5646 height: ::libc::c_int,
5647 );
5648}
5649unsafe extern "C" {
5650 #[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."]
5651 pub fn consoleGetDefault() -> *mut PrintConsole;
5652}
5653unsafe extern "C" {
5654 #[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."]
5655 pub fn consoleSelect(console: *mut PrintConsole) -> *mut PrintConsole;
5656}
5657unsafe extern "C" {
5658 #[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."]
5659 pub fn consoleInit(screen: gfxScreen_t, console: *mut PrintConsole) -> *mut PrintConsole;
5660}
5661unsafe extern "C" {
5662 #[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."]
5663 pub fn consoleDebugInit(device: debugDevice);
5664}
5665unsafe extern "C" {
5666 #[doc = "Clears the screen by using iprintf(\""]
5667 pub fn consoleClear();
5668}
5669#[doc = "< Use APT workaround."]
5670pub const RUNFLAG_APTWORKAROUND: _bindgen_ty_9 = 1;
5671#[doc = "< Reinitialize APT."]
5672pub const RUNFLAG_APTREINIT: _bindgen_ty_9 = 2;
5673#[doc = "< Chainload APT on return."]
5674pub const RUNFLAG_APTCHAINLOAD: _bindgen_ty_9 = 4;
5675#[doc = "System run-flags."]
5676pub type _bindgen_ty_9 = ::libc::c_uchar;
5677unsafe extern "C" {
5678 #[doc = "Gets whether the application was launched from a homebrew environment.\n # Returns\n\nWhether the application was launched from a homebrew environment."]
5679 #[link_name = "envIsHomebrew__extern"]
5680 pub fn envIsHomebrew() -> bool;
5681}
5682unsafe extern "C" {
5683 #[doc = "Retrieves a handle from the environment handle list.\n # Arguments\n\n* `name` - Name of the handle.\n # Returns\n\nThe retrieved handle."]
5684 pub fn envGetHandle(name: *const ::libc::c_char) -> Handle;
5685}
5686unsafe extern "C" {
5687 #[doc = "Gets the environment-recommended app ID to use with APT.\n # Returns\n\nThe APT app ID."]
5688 #[link_name = "envGetAptAppId__extern"]
5689 pub fn envGetAptAppId() -> u32_;
5690}
5691unsafe extern "C" {
5692 #[doc = "Gets the size of the application heap.\n # Returns\n\nThe application heap size."]
5693 #[link_name = "envGetHeapSize__extern"]
5694 pub fn envGetHeapSize() -> u32_;
5695}
5696unsafe extern "C" {
5697 #[doc = "Gets the size of the linear heap.\n # Returns\n\nThe linear heap size."]
5698 #[link_name = "envGetLinearHeapSize__extern"]
5699 pub fn envGetLinearHeapSize() -> u32_;
5700}
5701unsafe extern "C" {
5702 #[doc = "Gets the environment argument list.\n # Returns\n\nThe argument list."]
5703 #[link_name = "envGetSystemArgList__extern"]
5704 pub fn envGetSystemArgList() -> *const ::libc::c_char;
5705}
5706unsafe extern "C" {
5707 #[doc = "Gets the environment run flags.\n # Returns\n\nThe run flags."]
5708 #[link_name = "envGetSystemRunFlags__extern"]
5709 pub fn envGetSystemRunFlags() -> u32_;
5710}
5711pub type __suseconds_t = ::libc::c_long;
5712#[doc = "< Dummy compression"]
5713pub const DECOMPRESS_DUMMY: decompressType = 0;
5714#[doc = "< LZSS/LZ10 compression"]
5715pub const DECOMPRESS_LZSS: decompressType = 16;
5716#[doc = "< LZSS/LZ10 compression"]
5717pub const DECOMPRESS_LZ10: decompressType = 16;
5718#[doc = "< LZ11 compression"]
5719pub const DECOMPRESS_LZ11: decompressType = 17;
5720#[doc = "< Huffman compression with 1-bit data"]
5721pub const DECOMPRESS_HUFF1: decompressType = 33;
5722#[doc = "< Huffman compression with 2-bit data"]
5723pub const DECOMPRESS_HUFF2: decompressType = 34;
5724#[doc = "< Huffman compression with 3-bit data"]
5725pub const DECOMPRESS_HUFF3: decompressType = 35;
5726#[doc = "< Huffman compression with 4-bit data"]
5727pub const DECOMPRESS_HUFF4: decompressType = 36;
5728#[doc = "< Huffman compression with 5-bit data"]
5729pub const DECOMPRESS_HUFF5: decompressType = 37;
5730#[doc = "< Huffman compression with 6-bit data"]
5731pub const DECOMPRESS_HUFF6: decompressType = 38;
5732#[doc = "< Huffman compression with 7-bit data"]
5733pub const DECOMPRESS_HUFF7: decompressType = 39;
5734#[doc = "< Huffman compression with 8-bit data"]
5735pub const DECOMPRESS_HUFF8: decompressType = 40;
5736#[doc = "< Huffman compression with 8-bit data"]
5737pub const DECOMPRESS_HUFF: decompressType = 40;
5738#[doc = "< Run-length encoding compression"]
5739pub const DECOMPRESS_RLE: decompressType = 48;
5740#[doc = "Compression types"]
5741pub type decompressType = ::libc::c_uchar;
5742#[doc = "I/O vector"]
5743#[repr(C)]
5744#[derive(Debug, Copy, Clone)]
5745pub struct decompressIOVec {
5746 #[doc = "< I/O buffer"]
5747 pub data: *mut ::libc::c_void,
5748 #[doc = "< Buffer size"]
5749 pub size: usize,
5750}
5751#[allow(clippy::unnecessary_operation, clippy::identity_op)]
5752const _: () = {
5753 ["Size of decompressIOVec"][::core::mem::size_of::<decompressIOVec>() - 8usize];
5754 ["Alignment of decompressIOVec"][::core::mem::align_of::<decompressIOVec>() - 4usize];
5755 ["Offset of field: decompressIOVec::data"]
5756 [::core::mem::offset_of!(decompressIOVec, data) - 0usize];
5757 ["Offset of field: decompressIOVec::size"]
5758 [::core::mem::offset_of!(decompressIOVec, size) - 4usize];
5759};
5760impl Default for decompressIOVec {
5761 fn default() -> Self {
5762 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
5763 unsafe {
5764 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
5765 s.assume_init()
5766 }
5767 }
5768}
5769#[doc = "Data callback"]
5770pub type decompressCallback = ::core::option::Option<
5771 unsafe extern "C" fn(
5772 userdata: *mut ::libc::c_void,
5773 buffer: *mut ::libc::c_void,
5774 size: usize,
5775 ) -> isize,
5776>;
5777unsafe extern "C" {
5778 #[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"]
5779 pub fn decompressCallback_FD(
5780 userdata: *mut ::libc::c_void,
5781 buffer: *mut ::libc::c_void,
5782 size: usize,
5783 ) -> isize;
5784}
5785unsafe extern "C" {
5786 #[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"]
5787 pub fn decompressCallback_Stdio(
5788 userdata: *mut ::libc::c_void,
5789 buffer: *mut ::libc::c_void,
5790 size: usize,
5791 ) -> isize;
5792}
5793unsafe extern "C" {
5794 #[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"]
5795 pub fn decompressHeader(
5796 type_: *mut decompressType,
5797 size: *mut usize,
5798 callback: decompressCallback,
5799 userdata: *mut ::libc::c_void,
5800 insize: usize,
5801 ) -> isize;
5802}
5803unsafe extern "C" {
5804 #[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."]
5805 pub fn decompressV(
5806 iov: *const decompressIOVec,
5807 iovcnt: usize,
5808 callback: decompressCallback,
5809 userdata: *mut ::libc::c_void,
5810 insize: usize,
5811 ) -> bool;
5812}
5813unsafe extern "C" {
5814 #[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"]
5815 #[link_name = "decompress__extern"]
5816 pub fn decompress(
5817 output: *mut ::libc::c_void,
5818 size: usize,
5819 callback: decompressCallback,
5820 userdata: *mut ::libc::c_void,
5821 insize: usize,
5822 ) -> bool;
5823}
5824unsafe extern "C" {
5825 #[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"]
5826 pub fn decompressV_LZSS(
5827 iov: *const decompressIOVec,
5828 iovcnt: usize,
5829 callback: decompressCallback,
5830 userdata: *mut ::libc::c_void,
5831 insize: usize,
5832 ) -> bool;
5833}
5834unsafe extern "C" {
5835 #[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"]
5836 #[link_name = "decompress_LZSS__extern"]
5837 pub fn decompress_LZSS(
5838 output: *mut ::libc::c_void,
5839 size: usize,
5840 callback: decompressCallback,
5841 userdata: *mut ::libc::c_void,
5842 insize: usize,
5843 ) -> bool;
5844}
5845unsafe extern "C" {
5846 #[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"]
5847 pub fn decompressV_LZ11(
5848 iov: *const decompressIOVec,
5849 iovcnt: usize,
5850 callback: decompressCallback,
5851 userdata: *mut ::libc::c_void,
5852 insize: usize,
5853 ) -> bool;
5854}
5855unsafe extern "C" {
5856 #[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"]
5857 #[link_name = "decompress_LZ11__extern"]
5858 pub fn decompress_LZ11(
5859 output: *mut ::libc::c_void,
5860 size: usize,
5861 callback: decompressCallback,
5862 userdata: *mut ::libc::c_void,
5863 insize: usize,
5864 ) -> bool;
5865}
5866unsafe extern "C" {
5867 #[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"]
5868 pub fn decompressV_Huff(
5869 bits: usize,
5870 iov: *const decompressIOVec,
5871 iovcnt: usize,
5872 callback: decompressCallback,
5873 userdata: *mut ::libc::c_void,
5874 insize: usize,
5875 ) -> bool;
5876}
5877unsafe extern "C" {
5878 #[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"]
5879 #[link_name = "decompress_Huff__extern"]
5880 pub fn decompress_Huff(
5881 bits: usize,
5882 output: *mut ::libc::c_void,
5883 size: usize,
5884 callback: decompressCallback,
5885 userdata: *mut ::libc::c_void,
5886 insize: usize,
5887 ) -> bool;
5888}
5889unsafe extern "C" {
5890 #[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"]
5891 pub fn decompressV_RLE(
5892 iov: *const decompressIOVec,
5893 iovcnt: usize,
5894 callback: decompressCallback,
5895 userdata: *mut ::libc::c_void,
5896 insize: usize,
5897 ) -> bool;
5898}
5899unsafe extern "C" {
5900 #[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"]
5901 #[link_name = "decompress_RLE__extern"]
5902 pub fn decompress_RLE(
5903 output: *mut ::libc::c_void,
5904 size: usize,
5905 callback: decompressCallback,
5906 userdata: *mut ::libc::c_void,
5907 insize: usize,
5908 ) -> bool;
5909}
5910unsafe extern "C" {
5911 #[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"]
5912 pub fn decode_utf8(out: *mut u32, in_: *const u8) -> isize;
5913}
5914unsafe extern "C" {
5915 #[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"]
5916 pub fn decode_utf16(out: *mut u32, in_: *const u16) -> isize;
5917}
5918unsafe extern "C" {
5919 #[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"]
5920 pub fn encode_utf8(out: *mut u8, in_: u32) -> isize;
5921}
5922unsafe extern "C" {
5923 #[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"]
5924 pub fn encode_utf16(out: *mut u16, in_: u32) -> isize;
5925}
5926unsafe extern "C" {
5927 #[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"]
5928 pub fn utf8_to_utf16(out: *mut u16, in_: *const u8, len: usize) -> isize;
5929}
5930unsafe extern "C" {
5931 #[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"]
5932 pub fn utf8_to_utf32(out: *mut u32, in_: *const u8, len: usize) -> isize;
5933}
5934unsafe extern "C" {
5935 #[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"]
5936 pub fn utf16_to_utf8(out: *mut u8, in_: *const u16, len: usize) -> isize;
5937}
5938unsafe extern "C" {
5939 #[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"]
5940 pub fn utf16_to_utf32(out: *mut u32, in_: *const u16, len: usize) -> isize;
5941}
5942unsafe extern "C" {
5943 #[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"]
5944 pub fn utf32_to_utf8(out: *mut u8, in_: *const u32, len: usize) -> isize;
5945}
5946unsafe extern "C" {
5947 #[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"]
5948 pub fn utf32_to_utf16(out: *mut u16, in_: *const u32, len: usize) -> isize;
5949}
5950unsafe extern "C" {
5951 #[doc = "Allocates a 0x80-byte aligned buffer.\n # Arguments\n\n* `size` - Size of the buffer to allocate.\n # Returns\n\nThe allocated buffer."]
5952 pub fn linearAlloc(size: usize) -> *mut ::libc::c_void;
5953}
5954unsafe extern "C" {
5955 #[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."]
5956 pub fn linearMemAlign(size: usize, alignment: usize) -> *mut ::libc::c_void;
5957}
5958unsafe extern "C" {
5959 #[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."]
5960 pub fn linearRealloc(mem: *mut ::libc::c_void, size: usize) -> *mut ::libc::c_void;
5961}
5962unsafe extern "C" {
5963 #[doc = "Retrieves the allocated size of a buffer.\n # Returns\n\nThe size of the buffer."]
5964 pub fn linearGetSize(mem: *mut ::libc::c_void) -> usize;
5965}
5966unsafe extern "C" {
5967 #[doc = "Frees a buffer.\n # Arguments\n\n* `mem` - Buffer to free."]
5968 pub fn linearFree(mem: *mut ::libc::c_void);
5969}
5970unsafe extern "C" {
5971 #[doc = "Gets the current linear free space.\n # Returns\n\nThe current linear free space."]
5972 pub fn linearSpaceFree() -> u32_;
5973}
5974unsafe extern "C" {
5975 #[doc = "Initializes the mappable allocator.\n # Arguments\n\n* `addrMin` - Minimum address.\n * `addrMax` - Maxium address."]
5976 pub fn mappableInit(addrMin: u32_, addrMax: u32_);
5977}
5978unsafe extern "C" {
5979 #[doc = "Finds a mappable memory area.\n # Arguments\n\n* `size` - Size of the area to find.\n # Returns\n\nThe mappable area."]
5980 pub fn mappableAlloc(size: usize) -> *mut ::libc::c_void;
5981}
5982unsafe extern "C" {
5983 #[doc = "Frees a mappable area (stubbed).\n # Arguments\n\n* `mem` - Mappable area to free."]
5984 pub fn mappableFree(mem: *mut ::libc::c_void);
5985}
5986pub const VRAM_ALLOC_A: vramAllocPos = 1;
5987pub const VRAM_ALLOC_B: vramAllocPos = 2;
5988pub const VRAM_ALLOC_ANY: vramAllocPos = 3;
5989pub type vramAllocPos = ::libc::c_uchar;
5990unsafe extern "C" {
5991 #[doc = "Allocates a 0x80-byte aligned buffer.\n # Arguments\n\n* `size` - Size of the buffer to allocate.\n # Returns\n\nThe allocated buffer."]
5992 pub fn vramAlloc(size: usize) -> *mut ::libc::c_void;
5993}
5994unsafe extern "C" {
5995 #[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."]
5996 pub fn vramAllocAt(size: usize, pos: vramAllocPos) -> *mut ::libc::c_void;
5997}
5998unsafe extern "C" {
5999 #[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."]
6000 pub fn vramMemAlign(size: usize, alignment: usize) -> *mut ::libc::c_void;
6001}
6002unsafe extern "C" {
6003 #[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."]
6004 pub fn vramMemAlignAt(size: usize, alignment: usize, pos: vramAllocPos) -> *mut ::libc::c_void;
6005}
6006unsafe extern "C" {
6007 #[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."]
6008 pub fn vramRealloc(mem: *mut ::libc::c_void, size: usize) -> *mut ::libc::c_void;
6009}
6010unsafe extern "C" {
6011 #[doc = "Retrieves the allocated size of a buffer.\n # Returns\n\nThe size of the buffer."]
6012 pub fn vramGetSize(mem: *mut ::libc::c_void) -> usize;
6013}
6014unsafe extern "C" {
6015 #[doc = "Frees a buffer.\n # Arguments\n\n* `mem` - Buffer to free."]
6016 pub fn vramFree(mem: *mut ::libc::c_void);
6017}
6018unsafe extern "C" {
6019 #[doc = "Gets the current VRAM free space.\n # Returns\n\nThe current VRAM free space."]
6020 pub fn vramSpaceFree() -> u32_;
6021}
6022#[doc = "< Open authentication."]
6023pub const AC_OPEN: acSecurityMode = 0;
6024#[doc = "< WEP 40-bit authentication."]
6025pub const AC_WEP_40BIT: acSecurityMode = 1;
6026#[doc = "< WEP 104-bit authentication."]
6027pub const AC_WEP_104BIT: acSecurityMode = 2;
6028#[doc = "< WEP 128-bit authentication."]
6029pub const AC_WEP_128BIT: acSecurityMode = 3;
6030#[doc = "< WPA TKIP authentication."]
6031pub const AC_WPA_TKIP: acSecurityMode = 4;
6032#[doc = "< WPA2 TKIP authentication."]
6033pub const AC_WPA2_TKIP: acSecurityMode = 5;
6034#[doc = "< WPA AES authentication."]
6035pub const AC_WPA_AES: acSecurityMode = 6;
6036#[doc = "< WPA2 AES authentication."]
6037pub const AC_WPA2_AES: acSecurityMode = 7;
6038#[doc = "Wifi security modes."]
6039pub type acSecurityMode = ::libc::c_uchar;
6040#[doc = "< No access point/none allowed."]
6041pub const AC_AP_TYPE_NONE: _bindgen_ty_10 = 0;
6042#[doc = "< Slot 1 in System Settings."]
6043pub const AC_AP_TYPE_SLOT1: _bindgen_ty_10 = 2;
6044#[doc = "< Slot 2 in System Settings."]
6045pub const AC_AP_TYPE_SLOT2: _bindgen_ty_10 = 4;
6046#[doc = "< Slot 3 in System Settings."]
6047pub const AC_AP_TYPE_SLOT3: _bindgen_ty_10 = 8;
6048#[doc = "< All access point types allowed."]
6049pub const AC_AP_TYPE_ALL: _bindgen_ty_10 = 2147483647;
6050#[doc = "Wifi access point types (bitfield)."]
6051pub type _bindgen_ty_10 = ::libc::c_uint;
6052#[doc = "Struct to contain the data for connecting to a Wifi network from a stored slot."]
6053#[repr(C)]
6054#[derive(Debug, Copy, Clone)]
6055pub struct acuConfig {
6056 pub reserved: [u8_; 512usize],
6057}
6058#[allow(clippy::unnecessary_operation, clippy::identity_op)]
6059const _: () = {
6060 ["Size of acuConfig"][::core::mem::size_of::<acuConfig>() - 512usize];
6061 ["Alignment of acuConfig"][::core::mem::align_of::<acuConfig>() - 1usize];
6062 ["Offset of field: acuConfig::reserved"][::core::mem::offset_of!(acuConfig, reserved) - 0usize];
6063};
6064impl Default for acuConfig {
6065 fn default() -> Self {
6066 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
6067 unsafe {
6068 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
6069 s.assume_init()
6070 }
6071 }
6072}
6073unsafe extern "C" {
6074 #[must_use]
6075 #[doc = "Initializes AC."]
6076 pub fn acInit() -> Result;
6077}
6078unsafe extern "C" {
6079 #[doc = "Exits AC."]
6080 pub fn acExit();
6081}
6082unsafe extern "C" {
6083 #[doc = "Gets the current AC session handle."]
6084 pub fn acGetSessionHandle() -> *mut Handle;
6085}
6086unsafe extern "C" {
6087 #[must_use]
6088 #[doc = "Waits for the system to connect to the internet."]
6089 pub fn acWaitInternetConnection() -> Result;
6090}
6091unsafe extern "C" {
6092 #[must_use]
6093 #[doc = "Describes the access point the console is currently connected to with AC_AP_TYPE_* flags.\n # Arguments\n\n* `out` - Pointer to output the combination of AC_AP_TYPE_* flags describing the AP to."]
6094 pub fn ACU_GetWifiStatus(out: *mut u32_) -> Result;
6095}
6096unsafe extern "C" {
6097 #[must_use]
6098 #[doc = "Gets the connected Wifi status.\n # Arguments\n\n* `out` - Pointer to output the connected Wifi status to. (1 = not connected, 3 = connected)"]
6099 pub fn ACU_GetStatus(out: *mut u32_) -> Result;
6100}
6101unsafe extern "C" {
6102 #[must_use]
6103 #[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)"]
6104 pub fn ACU_GetSecurityMode(mode: *mut acSecurityMode) -> Result;
6105}
6106unsafe extern "C" {
6107 #[must_use]
6108 #[doc = "Gets the connected Wifi SSID.\n # Arguments\n\n* `SSID` - Pointer to output the connected Wifi SSID to."]
6109 pub fn ACU_GetSSID(SSID: *mut ::libc::c_char) -> Result;
6110}
6111unsafe extern "C" {
6112 #[must_use]
6113 #[doc = "Gets the connected Wifi SSID length.\n # Arguments\n\n* `out` - Pointer to output the connected Wifi SSID length to."]
6114 pub fn ACU_GetSSIDLength(out: *mut u32_) -> Result;
6115}
6116unsafe extern "C" {
6117 #[must_use]
6118 #[doc = "Determines whether proxy is enabled for the connected network.\n # Arguments\n\n* `enable` - Pointer to output the proxy status to."]
6119 pub fn ACU_GetProxyEnable(enable: *mut bool) -> Result;
6120}
6121unsafe extern "C" {
6122 #[must_use]
6123 #[doc = "Gets the connected network's proxy host.\n # Arguments\n\n* `host` - Pointer to output the proxy host to. (The size must be at least 0x100-bytes)"]
6124 pub fn ACU_GetProxyHost(host: *mut ::libc::c_char) -> Result;
6125}
6126unsafe extern "C" {
6127 #[must_use]
6128 #[doc = "Gets the connected network's proxy port.\n # Arguments\n\n* `out` - Pointer to output the proxy port to."]
6129 pub fn ACU_GetProxyPort(out: *mut u16_) -> Result;
6130}
6131unsafe extern "C" {
6132 #[must_use]
6133 #[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)"]
6134 pub fn ACU_GetProxyUserName(username: *mut ::libc::c_char) -> Result;
6135}
6136unsafe extern "C" {
6137 #[must_use]
6138 #[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)"]
6139 pub fn ACU_GetProxyPassword(password: *mut ::libc::c_char) -> Result;
6140}
6141unsafe extern "C" {
6142 #[must_use]
6143 #[doc = "Gets the last error to occur during a connection.\n # Arguments\n\n* `errorCode` - Pointer to output the error code to."]
6144 pub fn ACU_GetLastErrorCode(errorCode: *mut u32_) -> Result;
6145}
6146unsafe extern "C" {
6147 #[must_use]
6148 #[doc = "Gets the last detailed error to occur during a connection.\n # Arguments\n\n* `errorCode` - Pointer to output the error code to."]
6149 pub fn ACU_GetLastDetailErrorCode(errorCode: *mut u32_) -> Result;
6150}
6151unsafe extern "C" {
6152 #[must_use]
6153 #[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."]
6154 pub fn ACU_CreateDefaultConfig(config: *mut acuConfig) -> Result;
6155}
6156unsafe extern "C" {
6157 #[must_use]
6158 #[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 ?"]
6159 pub fn ACU_SetNetworkArea(config: *mut acuConfig, area: u8_) -> Result;
6160}
6161unsafe extern "C" {
6162 #[must_use]
6163 #[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 AP types bitmask, a combination of AC_AP_TYPE_* flags."]
6164 pub fn ACU_SetAllowApType(config: *mut acuConfig, type_: u8_) -> Result;
6165}
6166unsafe extern "C" {
6167 #[must_use]
6168 #[doc = "Sets something that makes the connection reliable.\n # Arguments\n\n* `config` - Pointer to an acuConfig struct used with ACU_CreateDefaultConfig previously."]
6169 pub fn ACU_SetRequestEulaVersion(config: *mut acuConfig) -> Result;
6170}
6171unsafe extern "C" {
6172 #[must_use]
6173 #[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."]
6174 pub fn ACU_ConnectAsync(config: *const acuConfig, connectionHandle: Handle) -> Result;
6175}
6176unsafe extern "C" {
6177 #[must_use]
6178 #[doc = "Selects the WiFi configuration slot for further ac:i operations.\n # Arguments\n\n* `slot` - WiFi slot (0, 1 or 2)."]
6179 pub fn ACI_LoadNetworkSetting(slot: u32_) -> Result;
6180}
6181unsafe extern "C" {
6182 #[must_use]
6183 #[doc = "Fetches the SSID of the previously selected WiFi configuration slot.\n # Arguments\n\n* `ssid` (direction out) - Pointer to the output buffer of size 32B the SSID will be stored in."]
6184 pub fn ACI_GetNetworkWirelessEssidSecuritySsid(ssid: *mut ::libc::c_void) -> Result;
6185}
6186pub type MiiScreenName = [u16_; 11usize];
6187#[doc = "Shared Base Mii struct"]
6188#[repr(C, packed)]
6189#[derive(Debug, Default, Copy, Clone)]
6190pub struct MiiData {
6191 #[doc = "< Always 3"]
6192 pub version: u8_,
6193 pub mii_options: MiiData__bindgen_ty_1,
6194 pub mii_pos: MiiData__bindgen_ty_2,
6195 pub console_identity: MiiData__bindgen_ty_3,
6196 #[doc = "< Identifies the system that the Mii was created on (Determines pants)"]
6197 pub system_id: u64_,
6198 #[doc = "< ID of Mii"]
6199 pub mii_id: u32_,
6200 #[doc = "< Creator's system's full MAC address"]
6201 pub mac: [u8_; 6usize],
6202 #[doc = "< Padding"]
6203 pub pad: [u8_; 2usize],
6204 pub mii_details: MiiData__bindgen_ty_4,
6205 #[doc = "< Name of Mii (Encoded using UTF16)"]
6206 pub mii_name: [u16_; 10usize],
6207 #[doc = "< How tall the Mii is"]
6208 pub height: u8_,
6209 #[doc = "< How wide the Mii is"]
6210 pub width: u8_,
6211 pub face_style: MiiData__bindgen_ty_5,
6212 pub face_details: MiiData__bindgen_ty_6,
6213 pub hair_style: u8_,
6214 pub hair_details: MiiData__bindgen_ty_7,
6215 pub eye_details: MiiData__bindgen_ty_8,
6216 pub eyebrow_details: MiiData__bindgen_ty_9,
6217 pub nose_details: MiiData__bindgen_ty_10,
6218 pub mouth_details: MiiData__bindgen_ty_11,
6219 pub mustache_details: MiiData__bindgen_ty_12,
6220 pub beard_details: MiiData__bindgen_ty_13,
6221 pub glasses_details: MiiData__bindgen_ty_14,
6222 pub mole_details: MiiData__bindgen_ty_15,
6223 #[doc = "< Name of Mii's author (Encoded using UTF16)"]
6224 pub author_name: [u16_; 10usize],
6225}
6226#[doc = "Mii options"]
6227#[repr(C)]
6228#[derive(Debug, Default, Copy, Clone)]
6229pub struct MiiData__bindgen_ty_1 {
6230 pub _bitfield_align_1: [u8; 0],
6231 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
6232}
6233#[allow(clippy::unnecessary_operation, clippy::identity_op)]
6234const _: () = {
6235 ["Size of MiiData__bindgen_ty_1"][::core::mem::size_of::<MiiData__bindgen_ty_1>() - 1usize];
6236 ["Alignment of MiiData__bindgen_ty_1"]
6237 [::core::mem::align_of::<MiiData__bindgen_ty_1>() - 1usize];
6238};
6239impl MiiData__bindgen_ty_1 {
6240 #[inline]
6241 pub fn allow_copying(&self) -> bool {
6242 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
6243 }
6244 #[inline]
6245 pub fn set_allow_copying(&mut self, val: bool) {
6246 unsafe {
6247 let val: u8 = ::core::mem::transmute(val);
6248 self._bitfield_1.set(0usize, 1u8, val as u64)
6249 }
6250 }
6251 #[inline]
6252 pub unsafe fn allow_copying_raw(this: *const Self) -> bool {
6253 unsafe {
6254 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
6255 ::core::ptr::addr_of!((*this)._bitfield_1),
6256 0usize,
6257 1u8,
6258 ) as u8)
6259 }
6260 }
6261 #[inline]
6262 pub unsafe fn set_allow_copying_raw(this: *mut Self, val: bool) {
6263 unsafe {
6264 let val: u8 = ::core::mem::transmute(val);
6265 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
6266 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
6267 0usize,
6268 1u8,
6269 val as u64,
6270 )
6271 }
6272 }
6273 #[inline]
6274 pub fn is_private_name(&self) -> bool {
6275 unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u8) }
6276 }
6277 #[inline]
6278 pub fn set_is_private_name(&mut self, val: bool) {
6279 unsafe {
6280 let val: u8 = ::core::mem::transmute(val);
6281 self._bitfield_1.set(1usize, 1u8, val as u64)
6282 }
6283 }
6284 #[inline]
6285 pub unsafe fn is_private_name_raw(this: *const Self) -> bool {
6286 unsafe {
6287 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
6288 ::core::ptr::addr_of!((*this)._bitfield_1),
6289 1usize,
6290 1u8,
6291 ) as u8)
6292 }
6293 }
6294 #[inline]
6295 pub unsafe fn set_is_private_name_raw(this: *mut Self, val: bool) {
6296 unsafe {
6297 let val: u8 = ::core::mem::transmute(val);
6298 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
6299 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
6300 1usize,
6301 1u8,
6302 val as u64,
6303 )
6304 }
6305 }
6306 #[inline]
6307 pub fn region_lock(&self) -> u8_ {
6308 unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 2u8) as u8) }
6309 }
6310 #[inline]
6311 pub fn set_region_lock(&mut self, val: u8_) {
6312 unsafe {
6313 let val: u8 = ::core::mem::transmute(val);
6314 self._bitfield_1.set(2usize, 2u8, val as u64)
6315 }
6316 }
6317 #[inline]
6318 pub unsafe fn region_lock_raw(this: *const Self) -> u8_ {
6319 unsafe {
6320 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
6321 ::core::ptr::addr_of!((*this)._bitfield_1),
6322 2usize,
6323 2u8,
6324 ) as u8)
6325 }
6326 }
6327 #[inline]
6328 pub unsafe fn set_region_lock_raw(this: *mut Self, val: u8_) {
6329 unsafe {
6330 let val: u8 = ::core::mem::transmute(val);
6331 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
6332 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
6333 2usize,
6334 2u8,
6335 val as u64,
6336 )
6337 }
6338 }
6339 #[inline]
6340 pub fn char_set(&self) -> u8_ {
6341 unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 2u8) as u8) }
6342 }
6343 #[inline]
6344 pub fn set_char_set(&mut self, val: u8_) {
6345 unsafe {
6346 let val: u8 = ::core::mem::transmute(val);
6347 self._bitfield_1.set(4usize, 2u8, val as u64)
6348 }
6349 }
6350 #[inline]
6351 pub unsafe fn char_set_raw(this: *const Self) -> u8_ {
6352 unsafe {
6353 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
6354 ::core::ptr::addr_of!((*this)._bitfield_1),
6355 4usize,
6356 2u8,
6357 ) as u8)
6358 }
6359 }
6360 #[inline]
6361 pub unsafe fn set_char_set_raw(this: *mut Self, val: u8_) {
6362 unsafe {
6363 let val: u8 = ::core::mem::transmute(val);
6364 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
6365 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
6366 4usize,
6367 2u8,
6368 val as u64,
6369 )
6370 }
6371 }
6372 #[inline]
6373 pub fn _pad(&self) -> u8_ {
6374 unsafe { ::core::mem::transmute(self._bitfield_1.get(6usize, 2u8) as u8) }
6375 }
6376 #[inline]
6377 pub fn set__pad(&mut self, val: u8_) {
6378 unsafe {
6379 let val: u8 = ::core::mem::transmute(val);
6380 self._bitfield_1.set(6usize, 2u8, val as u64)
6381 }
6382 }
6383 #[inline]
6384 pub unsafe fn _pad_raw(this: *const Self) -> u8_ {
6385 unsafe {
6386 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
6387 ::core::ptr::addr_of!((*this)._bitfield_1),
6388 6usize,
6389 2u8,
6390 ) as u8)
6391 }
6392 }
6393 #[inline]
6394 pub unsafe fn set__pad_raw(this: *mut Self, val: u8_) {
6395 unsafe {
6396 let val: u8 = ::core::mem::transmute(val);
6397 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
6398 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
6399 6usize,
6400 2u8,
6401 val as u64,
6402 )
6403 }
6404 }
6405 #[inline]
6406 pub fn new_bitfield_1(
6407 allow_copying: bool,
6408 is_private_name: bool,
6409 region_lock: u8_,
6410 char_set: u8_,
6411 _pad: u8_,
6412 ) -> __BindgenBitfieldUnit<[u8; 1usize]> {
6413 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
6414 __bindgen_bitfield_unit.set(0usize, 1u8, {
6415 let allow_copying: u8 = unsafe { ::core::mem::transmute(allow_copying) };
6416 allow_copying as u64
6417 });
6418 __bindgen_bitfield_unit.set(1usize, 1u8, {
6419 let is_private_name: u8 = unsafe { ::core::mem::transmute(is_private_name) };
6420 is_private_name as u64
6421 });
6422 __bindgen_bitfield_unit.set(2usize, 2u8, {
6423 let region_lock: u8 = unsafe { ::core::mem::transmute(region_lock) };
6424 region_lock as u64
6425 });
6426 __bindgen_bitfield_unit.set(4usize, 2u8, {
6427 let char_set: u8 = unsafe { ::core::mem::transmute(char_set) };
6428 char_set as u64
6429 });
6430 __bindgen_bitfield_unit.set(6usize, 2u8, {
6431 let _pad: u8 = unsafe { ::core::mem::transmute(_pad) };
6432 _pad as u64
6433 });
6434 __bindgen_bitfield_unit
6435 }
6436}
6437#[doc = "Mii position in Mii selector or Mii maker"]
6438#[repr(C)]
6439#[derive(Debug, Default, Copy, Clone)]
6440pub struct MiiData__bindgen_ty_2 {
6441 pub _bitfield_align_1: [u8; 0],
6442 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
6443}
6444#[allow(clippy::unnecessary_operation, clippy::identity_op)]
6445const _: () = {
6446 ["Size of MiiData__bindgen_ty_2"][::core::mem::size_of::<MiiData__bindgen_ty_2>() - 1usize];
6447 ["Alignment of MiiData__bindgen_ty_2"]
6448 [::core::mem::align_of::<MiiData__bindgen_ty_2>() - 1usize];
6449};
6450impl MiiData__bindgen_ty_2 {
6451 #[inline]
6452 pub fn page_index(&self) -> u8_ {
6453 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
6454 }
6455 #[inline]
6456 pub fn set_page_index(&mut self, val: u8_) {
6457 unsafe {
6458 let val: u8 = ::core::mem::transmute(val);
6459 self._bitfield_1.set(0usize, 4u8, val as u64)
6460 }
6461 }
6462 #[inline]
6463 pub unsafe fn page_index_raw(this: *const Self) -> u8_ {
6464 unsafe {
6465 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
6466 ::core::ptr::addr_of!((*this)._bitfield_1),
6467 0usize,
6468 4u8,
6469 ) as u8)
6470 }
6471 }
6472 #[inline]
6473 pub unsafe fn set_page_index_raw(this: *mut Self, val: u8_) {
6474 unsafe {
6475 let val: u8 = ::core::mem::transmute(val);
6476 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
6477 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
6478 0usize,
6479 4u8,
6480 val as u64,
6481 )
6482 }
6483 }
6484 #[inline]
6485 pub fn slot_index(&self) -> u8_ {
6486 unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
6487 }
6488 #[inline]
6489 pub fn set_slot_index(&mut self, val: u8_) {
6490 unsafe {
6491 let val: u8 = ::core::mem::transmute(val);
6492 self._bitfield_1.set(4usize, 4u8, val as u64)
6493 }
6494 }
6495 #[inline]
6496 pub unsafe fn slot_index_raw(this: *const Self) -> u8_ {
6497 unsafe {
6498 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
6499 ::core::ptr::addr_of!((*this)._bitfield_1),
6500 4usize,
6501 4u8,
6502 ) as u8)
6503 }
6504 }
6505 #[inline]
6506 pub unsafe fn set_slot_index_raw(this: *mut Self, val: u8_) {
6507 unsafe {
6508 let val: u8 = ::core::mem::transmute(val);
6509 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
6510 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
6511 4usize,
6512 4u8,
6513 val as u64,
6514 )
6515 }
6516 }
6517 #[inline]
6518 pub fn new_bitfield_1(page_index: u8_, slot_index: u8_) -> __BindgenBitfieldUnit<[u8; 1usize]> {
6519 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
6520 __bindgen_bitfield_unit.set(0usize, 4u8, {
6521 let page_index: u8 = unsafe { ::core::mem::transmute(page_index) };
6522 page_index as u64
6523 });
6524 __bindgen_bitfield_unit.set(4usize, 4u8, {
6525 let slot_index: u8 = unsafe { ::core::mem::transmute(slot_index) };
6526 slot_index as u64
6527 });
6528 __bindgen_bitfield_unit
6529 }
6530}
6531#[doc = "Console Identity"]
6532#[repr(C)]
6533#[derive(Debug, Default, Copy, Clone)]
6534pub struct MiiData__bindgen_ty_3 {
6535 pub _bitfield_align_1: [u8; 0],
6536 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
6537}
6538#[allow(clippy::unnecessary_operation, clippy::identity_op)]
6539const _: () = {
6540 ["Size of MiiData__bindgen_ty_3"][::core::mem::size_of::<MiiData__bindgen_ty_3>() - 1usize];
6541 ["Alignment of MiiData__bindgen_ty_3"]
6542 [::core::mem::align_of::<MiiData__bindgen_ty_3>() - 1usize];
6543};
6544impl MiiData__bindgen_ty_3 {
6545 #[inline]
6546 pub fn unknown0(&self) -> u8_ {
6547 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
6548 }
6549 #[inline]
6550 pub fn set_unknown0(&mut self, val: u8_) {
6551 unsafe {
6552 let val: u8 = ::core::mem::transmute(val);
6553 self._bitfield_1.set(0usize, 4u8, val as u64)
6554 }
6555 }
6556 #[inline]
6557 pub unsafe fn unknown0_raw(this: *const Self) -> u8_ {
6558 unsafe {
6559 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
6560 ::core::ptr::addr_of!((*this)._bitfield_1),
6561 0usize,
6562 4u8,
6563 ) as u8)
6564 }
6565 }
6566 #[inline]
6567 pub unsafe fn set_unknown0_raw(this: *mut Self, val: u8_) {
6568 unsafe {
6569 let val: u8 = ::core::mem::transmute(val);
6570 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
6571 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
6572 0usize,
6573 4u8,
6574 val as u64,
6575 )
6576 }
6577 }
6578 #[inline]
6579 pub fn origin_console(&self) -> u8_ {
6580 unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 3u8) as u8) }
6581 }
6582 #[inline]
6583 pub fn set_origin_console(&mut self, val: u8_) {
6584 unsafe {
6585 let val: u8 = ::core::mem::transmute(val);
6586 self._bitfield_1.set(4usize, 3u8, val as u64)
6587 }
6588 }
6589 #[inline]
6590 pub unsafe fn origin_console_raw(this: *const Self) -> u8_ {
6591 unsafe {
6592 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
6593 ::core::ptr::addr_of!((*this)._bitfield_1),
6594 4usize,
6595 3u8,
6596 ) as u8)
6597 }
6598 }
6599 #[inline]
6600 pub unsafe fn set_origin_console_raw(this: *mut Self, val: u8_) {
6601 unsafe {
6602 let val: u8 = ::core::mem::transmute(val);
6603 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
6604 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
6605 4usize,
6606 3u8,
6607 val as u64,
6608 )
6609 }
6610 }
6611 #[inline]
6612 pub fn _pad(&self) -> u8_ {
6613 unsafe { ::core::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u8) }
6614 }
6615 #[inline]
6616 pub fn set__pad(&mut self, val: u8_) {
6617 unsafe {
6618 let val: u8 = ::core::mem::transmute(val);
6619 self._bitfield_1.set(7usize, 1u8, val as u64)
6620 }
6621 }
6622 #[inline]
6623 pub unsafe fn _pad_raw(this: *const Self) -> u8_ {
6624 unsafe {
6625 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
6626 ::core::ptr::addr_of!((*this)._bitfield_1),
6627 7usize,
6628 1u8,
6629 ) as u8)
6630 }
6631 }
6632 #[inline]
6633 pub unsafe fn set__pad_raw(this: *mut Self, val: u8_) {
6634 unsafe {
6635 let val: u8 = ::core::mem::transmute(val);
6636 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
6637 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
6638 7usize,
6639 1u8,
6640 val as u64,
6641 )
6642 }
6643 }
6644 #[inline]
6645 pub fn new_bitfield_1(
6646 unknown0: u8_,
6647 origin_console: u8_,
6648 _pad: u8_,
6649 ) -> __BindgenBitfieldUnit<[u8; 1usize]> {
6650 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
6651 __bindgen_bitfield_unit.set(0usize, 4u8, {
6652 let unknown0: u8 = unsafe { ::core::mem::transmute(unknown0) };
6653 unknown0 as u64
6654 });
6655 __bindgen_bitfield_unit.set(4usize, 3u8, {
6656 let origin_console: u8 = unsafe { ::core::mem::transmute(origin_console) };
6657 origin_console as u64
6658 });
6659 __bindgen_bitfield_unit.set(7usize, 1u8, {
6660 let _pad: u8 = unsafe { ::core::mem::transmute(_pad) };
6661 _pad as u64
6662 });
6663 __bindgen_bitfield_unit
6664 }
6665}
6666#[doc = "Mii details"]
6667#[repr(C, packed)]
6668#[derive(Debug, Default, Copy, Clone)]
6669pub struct MiiData__bindgen_ty_4 {
6670 pub _bitfield_align_1: [u8; 0],
6671 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
6672}
6673#[allow(clippy::unnecessary_operation, clippy::identity_op)]
6674const _: () = {
6675 ["Size of MiiData__bindgen_ty_4"][::core::mem::size_of::<MiiData__bindgen_ty_4>() - 2usize];
6676 ["Alignment of MiiData__bindgen_ty_4"]
6677 [::core::mem::align_of::<MiiData__bindgen_ty_4>() - 1usize];
6678};
6679impl MiiData__bindgen_ty_4 {
6680 #[inline]
6681 pub fn sex(&self) -> bool {
6682 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
6683 }
6684 #[inline]
6685 pub fn set_sex(&mut self, val: bool) {
6686 unsafe {
6687 let val: u8 = ::core::mem::transmute(val);
6688 self._bitfield_1.set(0usize, 1u8, val as u64)
6689 }
6690 }
6691 #[inline]
6692 pub unsafe fn sex_raw(this: *const Self) -> bool {
6693 unsafe {
6694 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
6695 ::core::ptr::addr_of!((*this)._bitfield_1),
6696 0usize,
6697 1u8,
6698 ) as u8)
6699 }
6700 }
6701 #[inline]
6702 pub unsafe fn set_sex_raw(this: *mut Self, val: bool) {
6703 unsafe {
6704 let val: u8 = ::core::mem::transmute(val);
6705 <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
6706 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
6707 0usize,
6708 1u8,
6709 val as u64,
6710 )
6711 }
6712 }
6713 #[inline]
6714 pub fn bday_month(&self) -> u16_ {
6715 unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 4u8) as u16) }
6716 }
6717 #[inline]
6718 pub fn set_bday_month(&mut self, val: u16_) {
6719 unsafe {
6720 let val: u16 = ::core::mem::transmute(val);
6721 self._bitfield_1.set(1usize, 4u8, val as u64)
6722 }
6723 }
6724 #[inline]
6725 pub unsafe fn bday_month_raw(this: *const Self) -> u16_ {
6726 unsafe {
6727 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
6728 ::core::ptr::addr_of!((*this)._bitfield_1),
6729 1usize,
6730 4u8,
6731 ) as u16)
6732 }
6733 }
6734 #[inline]
6735 pub unsafe fn set_bday_month_raw(this: *mut Self, val: u16_) {
6736 unsafe {
6737 let val: u16 = ::core::mem::transmute(val);
6738 <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
6739 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
6740 1usize,
6741 4u8,
6742 val as u64,
6743 )
6744 }
6745 }
6746 #[inline]
6747 pub fn bday_day(&self) -> u16_ {
6748 unsafe { ::core::mem::transmute(self._bitfield_1.get(5usize, 5u8) as u16) }
6749 }
6750 #[inline]
6751 pub fn set_bday_day(&mut self, val: u16_) {
6752 unsafe {
6753 let val: u16 = ::core::mem::transmute(val);
6754 self._bitfield_1.set(5usize, 5u8, val as u64)
6755 }
6756 }
6757 #[inline]
6758 pub unsafe fn bday_day_raw(this: *const Self) -> u16_ {
6759 unsafe {
6760 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
6761 ::core::ptr::addr_of!((*this)._bitfield_1),
6762 5usize,
6763 5u8,
6764 ) as u16)
6765 }
6766 }
6767 #[inline]
6768 pub unsafe fn set_bday_day_raw(this: *mut Self, val: u16_) {
6769 unsafe {
6770 let val: u16 = ::core::mem::transmute(val);
6771 <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
6772 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
6773 5usize,
6774 5u8,
6775 val as u64,
6776 )
6777 }
6778 }
6779 #[inline]
6780 pub fn shirt_color(&self) -> u16_ {
6781 unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 4u8) as u16) }
6782 }
6783 #[inline]
6784 pub fn set_shirt_color(&mut self, val: u16_) {
6785 unsafe {
6786 let val: u16 = ::core::mem::transmute(val);
6787 self._bitfield_1.set(10usize, 4u8, val as u64)
6788 }
6789 }
6790 #[inline]
6791 pub unsafe fn shirt_color_raw(this: *const Self) -> u16_ {
6792 unsafe {
6793 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
6794 ::core::ptr::addr_of!((*this)._bitfield_1),
6795 10usize,
6796 4u8,
6797 ) as u16)
6798 }
6799 }
6800 #[inline]
6801 pub unsafe fn set_shirt_color_raw(this: *mut Self, val: u16_) {
6802 unsafe {
6803 let val: u16 = ::core::mem::transmute(val);
6804 <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
6805 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
6806 10usize,
6807 4u8,
6808 val as u64,
6809 )
6810 }
6811 }
6812 #[inline]
6813 pub fn favorite(&self) -> u16_ {
6814 unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
6815 }
6816 #[inline]
6817 pub fn set_favorite(&mut self, val: u16_) {
6818 unsafe {
6819 let val: u16 = ::core::mem::transmute(val);
6820 self._bitfield_1.set(14usize, 1u8, val as u64)
6821 }
6822 }
6823 #[inline]
6824 pub unsafe fn favorite_raw(this: *const Self) -> u16_ {
6825 unsafe {
6826 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
6827 ::core::ptr::addr_of!((*this)._bitfield_1),
6828 14usize,
6829 1u8,
6830 ) as u16)
6831 }
6832 }
6833 #[inline]
6834 pub unsafe fn set_favorite_raw(this: *mut Self, val: u16_) {
6835 unsafe {
6836 let val: u16 = ::core::mem::transmute(val);
6837 <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
6838 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
6839 14usize,
6840 1u8,
6841 val as u64,
6842 )
6843 }
6844 }
6845 #[inline]
6846 pub fn _pad(&self) -> u16_ {
6847 unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
6848 }
6849 #[inline]
6850 pub fn set__pad(&mut self, val: u16_) {
6851 unsafe {
6852 let val: u16 = ::core::mem::transmute(val);
6853 self._bitfield_1.set(15usize, 1u8, val as u64)
6854 }
6855 }
6856 #[inline]
6857 pub unsafe fn _pad_raw(this: *const Self) -> u16_ {
6858 unsafe {
6859 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
6860 ::core::ptr::addr_of!((*this)._bitfield_1),
6861 15usize,
6862 1u8,
6863 ) as u16)
6864 }
6865 }
6866 #[inline]
6867 pub unsafe fn set__pad_raw(this: *mut Self, val: u16_) {
6868 unsafe {
6869 let val: u16 = ::core::mem::transmute(val);
6870 <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
6871 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
6872 15usize,
6873 1u8,
6874 val as u64,
6875 )
6876 }
6877 }
6878 #[inline]
6879 pub fn new_bitfield_1(
6880 sex: bool,
6881 bday_month: u16_,
6882 bday_day: u16_,
6883 shirt_color: u16_,
6884 favorite: u16_,
6885 _pad: u16_,
6886 ) -> __BindgenBitfieldUnit<[u8; 2usize]> {
6887 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
6888 __bindgen_bitfield_unit.set(0usize, 1u8, {
6889 let sex: u8 = unsafe { ::core::mem::transmute(sex) };
6890 sex as u64
6891 });
6892 __bindgen_bitfield_unit.set(1usize, 4u8, {
6893 let bday_month: u16 = unsafe { ::core::mem::transmute(bday_month) };
6894 bday_month as u64
6895 });
6896 __bindgen_bitfield_unit.set(5usize, 5u8, {
6897 let bday_day: u16 = unsafe { ::core::mem::transmute(bday_day) };
6898 bday_day as u64
6899 });
6900 __bindgen_bitfield_unit.set(10usize, 4u8, {
6901 let shirt_color: u16 = unsafe { ::core::mem::transmute(shirt_color) };
6902 shirt_color as u64
6903 });
6904 __bindgen_bitfield_unit.set(14usize, 1u8, {
6905 let favorite: u16 = unsafe { ::core::mem::transmute(favorite) };
6906 favorite as u64
6907 });
6908 __bindgen_bitfield_unit.set(15usize, 1u8, {
6909 let _pad: u16 = unsafe { ::core::mem::transmute(_pad) };
6910 _pad as u64
6911 });
6912 __bindgen_bitfield_unit
6913 }
6914}
6915#[doc = "Face style"]
6916#[repr(C, packed)]
6917#[derive(Debug, Default, Copy, Clone)]
6918pub struct MiiData__bindgen_ty_5 {
6919 pub _bitfield_align_1: [u8; 0],
6920 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
6921}
6922#[allow(clippy::unnecessary_operation, clippy::identity_op)]
6923const _: () = {
6924 ["Size of MiiData__bindgen_ty_5"][::core::mem::size_of::<MiiData__bindgen_ty_5>() - 1usize];
6925 ["Alignment of MiiData__bindgen_ty_5"]
6926 [::core::mem::align_of::<MiiData__bindgen_ty_5>() - 1usize];
6927};
6928impl MiiData__bindgen_ty_5 {
6929 #[inline]
6930 pub fn disable_sharing(&self) -> u16_ {
6931 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u16) }
6932 }
6933 #[inline]
6934 pub fn set_disable_sharing(&mut self, val: u16_) {
6935 unsafe {
6936 let val: u16 = ::core::mem::transmute(val);
6937 self._bitfield_1.set(0usize, 1u8, val as u64)
6938 }
6939 }
6940 #[inline]
6941 pub unsafe fn disable_sharing_raw(this: *const Self) -> u16_ {
6942 unsafe {
6943 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
6944 ::core::ptr::addr_of!((*this)._bitfield_1),
6945 0usize,
6946 1u8,
6947 ) as u16)
6948 }
6949 }
6950 #[inline]
6951 pub unsafe fn set_disable_sharing_raw(this: *mut Self, val: u16_) {
6952 unsafe {
6953 let val: u16 = ::core::mem::transmute(val);
6954 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
6955 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
6956 0usize,
6957 1u8,
6958 val as u64,
6959 )
6960 }
6961 }
6962 #[inline]
6963 pub fn shape(&self) -> u16_ {
6964 unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 4u8) as u16) }
6965 }
6966 #[inline]
6967 pub fn set_shape(&mut self, val: u16_) {
6968 unsafe {
6969 let val: u16 = ::core::mem::transmute(val);
6970 self._bitfield_1.set(1usize, 4u8, val as u64)
6971 }
6972 }
6973 #[inline]
6974 pub unsafe fn shape_raw(this: *const Self) -> u16_ {
6975 unsafe {
6976 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
6977 ::core::ptr::addr_of!((*this)._bitfield_1),
6978 1usize,
6979 4u8,
6980 ) as u16)
6981 }
6982 }
6983 #[inline]
6984 pub unsafe fn set_shape_raw(this: *mut Self, val: u16_) {
6985 unsafe {
6986 let val: u16 = ::core::mem::transmute(val);
6987 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
6988 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
6989 1usize,
6990 4u8,
6991 val as u64,
6992 )
6993 }
6994 }
6995 #[inline]
6996 pub fn skinColor(&self) -> u16_ {
6997 unsafe { ::core::mem::transmute(self._bitfield_1.get(5usize, 3u8) as u16) }
6998 }
6999 #[inline]
7000 pub fn set_skinColor(&mut self, val: u16_) {
7001 unsafe {
7002 let val: u16 = ::core::mem::transmute(val);
7003 self._bitfield_1.set(5usize, 3u8, val as u64)
7004 }
7005 }
7006 #[inline]
7007 pub unsafe fn skinColor_raw(this: *const Self) -> u16_ {
7008 unsafe {
7009 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
7010 ::core::ptr::addr_of!((*this)._bitfield_1),
7011 5usize,
7012 3u8,
7013 ) as u16)
7014 }
7015 }
7016 #[inline]
7017 pub unsafe fn set_skinColor_raw(this: *mut Self, val: u16_) {
7018 unsafe {
7019 let val: u16 = ::core::mem::transmute(val);
7020 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
7021 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
7022 5usize,
7023 3u8,
7024 val as u64,
7025 )
7026 }
7027 }
7028 #[inline]
7029 pub fn new_bitfield_1(
7030 disable_sharing: u16_,
7031 shape: u16_,
7032 skinColor: u16_,
7033 ) -> __BindgenBitfieldUnit<[u8; 1usize]> {
7034 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
7035 __bindgen_bitfield_unit.set(0usize, 1u8, {
7036 let disable_sharing: u16 = unsafe { ::core::mem::transmute(disable_sharing) };
7037 disable_sharing as u64
7038 });
7039 __bindgen_bitfield_unit.set(1usize, 4u8, {
7040 let shape: u16 = unsafe { ::core::mem::transmute(shape) };
7041 shape as u64
7042 });
7043 __bindgen_bitfield_unit.set(5usize, 3u8, {
7044 let skinColor: u16 = unsafe { ::core::mem::transmute(skinColor) };
7045 skinColor as u64
7046 });
7047 __bindgen_bitfield_unit
7048 }
7049}
7050#[doc = "Face details"]
7051#[repr(C, packed)]
7052#[derive(Debug, Default, Copy, Clone)]
7053pub struct MiiData__bindgen_ty_6 {
7054 pub _bitfield_align_1: [u8; 0],
7055 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
7056}
7057#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7058const _: () = {
7059 ["Size of MiiData__bindgen_ty_6"][::core::mem::size_of::<MiiData__bindgen_ty_6>() - 1usize];
7060 ["Alignment of MiiData__bindgen_ty_6"]
7061 [::core::mem::align_of::<MiiData__bindgen_ty_6>() - 1usize];
7062};
7063impl MiiData__bindgen_ty_6 {
7064 #[inline]
7065 pub fn wrinkles(&self) -> u16_ {
7066 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
7067 }
7068 #[inline]
7069 pub fn set_wrinkles(&mut self, val: u16_) {
7070 unsafe {
7071 let val: u16 = ::core::mem::transmute(val);
7072 self._bitfield_1.set(0usize, 4u8, val as u64)
7073 }
7074 }
7075 #[inline]
7076 pub unsafe fn wrinkles_raw(this: *const Self) -> u16_ {
7077 unsafe {
7078 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
7079 ::core::ptr::addr_of!((*this)._bitfield_1),
7080 0usize,
7081 4u8,
7082 ) as u16)
7083 }
7084 }
7085 #[inline]
7086 pub unsafe fn set_wrinkles_raw(this: *mut Self, val: u16_) {
7087 unsafe {
7088 let val: u16 = ::core::mem::transmute(val);
7089 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
7090 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
7091 0usize,
7092 4u8,
7093 val as u64,
7094 )
7095 }
7096 }
7097 #[inline]
7098 pub fn makeup(&self) -> u16_ {
7099 unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
7100 }
7101 #[inline]
7102 pub fn set_makeup(&mut self, val: u16_) {
7103 unsafe {
7104 let val: u16 = ::core::mem::transmute(val);
7105 self._bitfield_1.set(4usize, 4u8, val as u64)
7106 }
7107 }
7108 #[inline]
7109 pub unsafe fn makeup_raw(this: *const Self) -> u16_ {
7110 unsafe {
7111 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
7112 ::core::ptr::addr_of!((*this)._bitfield_1),
7113 4usize,
7114 4u8,
7115 ) as u16)
7116 }
7117 }
7118 #[inline]
7119 pub unsafe fn set_makeup_raw(this: *mut Self, val: u16_) {
7120 unsafe {
7121 let val: u16 = ::core::mem::transmute(val);
7122 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
7123 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
7124 4usize,
7125 4u8,
7126 val as u64,
7127 )
7128 }
7129 }
7130 #[inline]
7131 pub fn new_bitfield_1(wrinkles: u16_, makeup: u16_) -> __BindgenBitfieldUnit<[u8; 1usize]> {
7132 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
7133 __bindgen_bitfield_unit.set(0usize, 4u8, {
7134 let wrinkles: u16 = unsafe { ::core::mem::transmute(wrinkles) };
7135 wrinkles as u64
7136 });
7137 __bindgen_bitfield_unit.set(4usize, 4u8, {
7138 let makeup: u16 = unsafe { ::core::mem::transmute(makeup) };
7139 makeup as u64
7140 });
7141 __bindgen_bitfield_unit
7142 }
7143}
7144#[doc = "Hair details"]
7145#[repr(C, packed)]
7146#[derive(Debug, Default, Copy, Clone)]
7147pub struct MiiData__bindgen_ty_7 {
7148 pub _bitfield_align_1: [u8; 0],
7149 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
7150}
7151#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7152const _: () = {
7153 ["Size of MiiData__bindgen_ty_7"][::core::mem::size_of::<MiiData__bindgen_ty_7>() - 1usize];
7154 ["Alignment of MiiData__bindgen_ty_7"]
7155 [::core::mem::align_of::<MiiData__bindgen_ty_7>() - 1usize];
7156};
7157impl MiiData__bindgen_ty_7 {
7158 #[inline]
7159 pub fn color(&self) -> u16_ {
7160 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 3u8) as u16) }
7161 }
7162 #[inline]
7163 pub fn set_color(&mut self, val: u16_) {
7164 unsafe {
7165 let val: u16 = ::core::mem::transmute(val);
7166 self._bitfield_1.set(0usize, 3u8, val as u64)
7167 }
7168 }
7169 #[inline]
7170 pub unsafe fn color_raw(this: *const Self) -> u16_ {
7171 unsafe {
7172 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
7173 ::core::ptr::addr_of!((*this)._bitfield_1),
7174 0usize,
7175 3u8,
7176 ) as u16)
7177 }
7178 }
7179 #[inline]
7180 pub unsafe fn set_color_raw(this: *mut Self, val: u16_) {
7181 unsafe {
7182 let val: u16 = ::core::mem::transmute(val);
7183 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
7184 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
7185 0usize,
7186 3u8,
7187 val as u64,
7188 )
7189 }
7190 }
7191 #[inline]
7192 pub fn flip(&self) -> u16_ {
7193 unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u16) }
7194 }
7195 #[inline]
7196 pub fn set_flip(&mut self, val: u16_) {
7197 unsafe {
7198 let val: u16 = ::core::mem::transmute(val);
7199 self._bitfield_1.set(3usize, 1u8, val as u64)
7200 }
7201 }
7202 #[inline]
7203 pub unsafe fn flip_raw(this: *const Self) -> u16_ {
7204 unsafe {
7205 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
7206 ::core::ptr::addr_of!((*this)._bitfield_1),
7207 3usize,
7208 1u8,
7209 ) as u16)
7210 }
7211 }
7212 #[inline]
7213 pub unsafe fn set_flip_raw(this: *mut Self, val: u16_) {
7214 unsafe {
7215 let val: u16 = ::core::mem::transmute(val);
7216 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
7217 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
7218 3usize,
7219 1u8,
7220 val as u64,
7221 )
7222 }
7223 }
7224 #[inline]
7225 pub fn _pad(&self) -> u16_ {
7226 unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
7227 }
7228 #[inline]
7229 pub fn set__pad(&mut self, val: u16_) {
7230 unsafe {
7231 let val: u16 = ::core::mem::transmute(val);
7232 self._bitfield_1.set(4usize, 4u8, val as u64)
7233 }
7234 }
7235 #[inline]
7236 pub unsafe fn _pad_raw(this: *const Self) -> u16_ {
7237 unsafe {
7238 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
7239 ::core::ptr::addr_of!((*this)._bitfield_1),
7240 4usize,
7241 4u8,
7242 ) as u16)
7243 }
7244 }
7245 #[inline]
7246 pub unsafe fn set__pad_raw(this: *mut Self, val: u16_) {
7247 unsafe {
7248 let val: u16 = ::core::mem::transmute(val);
7249 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
7250 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
7251 4usize,
7252 4u8,
7253 val as u64,
7254 )
7255 }
7256 }
7257 #[inline]
7258 pub fn new_bitfield_1(
7259 color: u16_,
7260 flip: u16_,
7261 _pad: u16_,
7262 ) -> __BindgenBitfieldUnit<[u8; 1usize]> {
7263 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
7264 __bindgen_bitfield_unit.set(0usize, 3u8, {
7265 let color: u16 = unsafe { ::core::mem::transmute(color) };
7266 color as u64
7267 });
7268 __bindgen_bitfield_unit.set(3usize, 1u8, {
7269 let flip: u16 = unsafe { ::core::mem::transmute(flip) };
7270 flip as u64
7271 });
7272 __bindgen_bitfield_unit.set(4usize, 4u8, {
7273 let _pad: u16 = unsafe { ::core::mem::transmute(_pad) };
7274 _pad as u64
7275 });
7276 __bindgen_bitfield_unit
7277 }
7278}
7279#[doc = "Eye details"]
7280#[repr(C, packed)]
7281#[derive(Debug, Default, Copy, Clone)]
7282pub struct MiiData__bindgen_ty_8 {
7283 pub _bitfield_align_1: [u8; 0],
7284 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>,
7285}
7286#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7287const _: () = {
7288 ["Size of MiiData__bindgen_ty_8"][::core::mem::size_of::<MiiData__bindgen_ty_8>() - 4usize];
7289 ["Alignment of MiiData__bindgen_ty_8"]
7290 [::core::mem::align_of::<MiiData__bindgen_ty_8>() - 1usize];
7291};
7292impl MiiData__bindgen_ty_8 {
7293 #[inline]
7294 pub fn style(&self) -> u16_ {
7295 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 6u8) as u16) }
7296 }
7297 #[inline]
7298 pub fn set_style(&mut self, val: u16_) {
7299 unsafe {
7300 let val: u16 = ::core::mem::transmute(val);
7301 self._bitfield_1.set(0usize, 6u8, val as u64)
7302 }
7303 }
7304 #[inline]
7305 pub unsafe fn style_raw(this: *const Self) -> u16_ {
7306 unsafe {
7307 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
7308 ::core::ptr::addr_of!((*this)._bitfield_1),
7309 0usize,
7310 6u8,
7311 ) as u16)
7312 }
7313 }
7314 #[inline]
7315 pub unsafe fn set_style_raw(this: *mut Self, val: u16_) {
7316 unsafe {
7317 let val: u16 = ::core::mem::transmute(val);
7318 <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
7319 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
7320 0usize,
7321 6u8,
7322 val as u64,
7323 )
7324 }
7325 }
7326 #[inline]
7327 pub fn color(&self) -> u16_ {
7328 unsafe { ::core::mem::transmute(self._bitfield_1.get(6usize, 3u8) as u16) }
7329 }
7330 #[inline]
7331 pub fn set_color(&mut self, val: u16_) {
7332 unsafe {
7333 let val: u16 = ::core::mem::transmute(val);
7334 self._bitfield_1.set(6usize, 3u8, val as u64)
7335 }
7336 }
7337 #[inline]
7338 pub unsafe fn color_raw(this: *const Self) -> u16_ {
7339 unsafe {
7340 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
7341 ::core::ptr::addr_of!((*this)._bitfield_1),
7342 6usize,
7343 3u8,
7344 ) as u16)
7345 }
7346 }
7347 #[inline]
7348 pub unsafe fn set_color_raw(this: *mut Self, val: u16_) {
7349 unsafe {
7350 let val: u16 = ::core::mem::transmute(val);
7351 <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
7352 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
7353 6usize,
7354 3u8,
7355 val as u64,
7356 )
7357 }
7358 }
7359 #[inline]
7360 pub fn scale(&self) -> u16_ {
7361 unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 4u8) as u16) }
7362 }
7363 #[inline]
7364 pub fn set_scale(&mut self, val: u16_) {
7365 unsafe {
7366 let val: u16 = ::core::mem::transmute(val);
7367 self._bitfield_1.set(9usize, 4u8, val as u64)
7368 }
7369 }
7370 #[inline]
7371 pub unsafe fn scale_raw(this: *const Self) -> u16_ {
7372 unsafe {
7373 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
7374 ::core::ptr::addr_of!((*this)._bitfield_1),
7375 9usize,
7376 4u8,
7377 ) as u16)
7378 }
7379 }
7380 #[inline]
7381 pub unsafe fn set_scale_raw(this: *mut Self, val: u16_) {
7382 unsafe {
7383 let val: u16 = ::core::mem::transmute(val);
7384 <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
7385 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
7386 9usize,
7387 4u8,
7388 val as u64,
7389 )
7390 }
7391 }
7392 #[inline]
7393 pub fn yscale(&self) -> u16_ {
7394 unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 3u8) as u16) }
7395 }
7396 #[inline]
7397 pub fn set_yscale(&mut self, val: u16_) {
7398 unsafe {
7399 let val: u16 = ::core::mem::transmute(val);
7400 self._bitfield_1.set(13usize, 3u8, val as u64)
7401 }
7402 }
7403 #[inline]
7404 pub unsafe fn yscale_raw(this: *const Self) -> u16_ {
7405 unsafe {
7406 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
7407 ::core::ptr::addr_of!((*this)._bitfield_1),
7408 13usize,
7409 3u8,
7410 ) as u16)
7411 }
7412 }
7413 #[inline]
7414 pub unsafe fn set_yscale_raw(this: *mut Self, val: u16_) {
7415 unsafe {
7416 let val: u16 = ::core::mem::transmute(val);
7417 <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
7418 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
7419 13usize,
7420 3u8,
7421 val as u64,
7422 )
7423 }
7424 }
7425 #[inline]
7426 pub fn rotation(&self) -> u16_ {
7427 unsafe { ::core::mem::transmute(self._bitfield_1.get(16usize, 5u8) as u16) }
7428 }
7429 #[inline]
7430 pub fn set_rotation(&mut self, val: u16_) {
7431 unsafe {
7432 let val: u16 = ::core::mem::transmute(val);
7433 self._bitfield_1.set(16usize, 5u8, val as u64)
7434 }
7435 }
7436 #[inline]
7437 pub unsafe fn rotation_raw(this: *const Self) -> u16_ {
7438 unsafe {
7439 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
7440 ::core::ptr::addr_of!((*this)._bitfield_1),
7441 16usize,
7442 5u8,
7443 ) as u16)
7444 }
7445 }
7446 #[inline]
7447 pub unsafe fn set_rotation_raw(this: *mut Self, val: u16_) {
7448 unsafe {
7449 let val: u16 = ::core::mem::transmute(val);
7450 <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
7451 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
7452 16usize,
7453 5u8,
7454 val as u64,
7455 )
7456 }
7457 }
7458 #[inline]
7459 pub fn xspacing(&self) -> u16_ {
7460 unsafe { ::core::mem::transmute(self._bitfield_1.get(21usize, 4u8) as u16) }
7461 }
7462 #[inline]
7463 pub fn set_xspacing(&mut self, val: u16_) {
7464 unsafe {
7465 let val: u16 = ::core::mem::transmute(val);
7466 self._bitfield_1.set(21usize, 4u8, val as u64)
7467 }
7468 }
7469 #[inline]
7470 pub unsafe fn xspacing_raw(this: *const Self) -> u16_ {
7471 unsafe {
7472 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
7473 ::core::ptr::addr_of!((*this)._bitfield_1),
7474 21usize,
7475 4u8,
7476 ) as u16)
7477 }
7478 }
7479 #[inline]
7480 pub unsafe fn set_xspacing_raw(this: *mut Self, val: u16_) {
7481 unsafe {
7482 let val: u16 = ::core::mem::transmute(val);
7483 <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
7484 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
7485 21usize,
7486 4u8,
7487 val as u64,
7488 )
7489 }
7490 }
7491 #[inline]
7492 pub fn yposition(&self) -> u16_ {
7493 unsafe { ::core::mem::transmute(self._bitfield_1.get(25usize, 5u8) as u16) }
7494 }
7495 #[inline]
7496 pub fn set_yposition(&mut self, val: u16_) {
7497 unsafe {
7498 let val: u16 = ::core::mem::transmute(val);
7499 self._bitfield_1.set(25usize, 5u8, val as u64)
7500 }
7501 }
7502 #[inline]
7503 pub unsafe fn yposition_raw(this: *const Self) -> u16_ {
7504 unsafe {
7505 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
7506 ::core::ptr::addr_of!((*this)._bitfield_1),
7507 25usize,
7508 5u8,
7509 ) as u16)
7510 }
7511 }
7512 #[inline]
7513 pub unsafe fn set_yposition_raw(this: *mut Self, val: u16_) {
7514 unsafe {
7515 let val: u16 = ::core::mem::transmute(val);
7516 <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
7517 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
7518 25usize,
7519 5u8,
7520 val as u64,
7521 )
7522 }
7523 }
7524 #[inline]
7525 pub fn _pad(&self) -> u16_ {
7526 unsafe { ::core::mem::transmute(self._bitfield_1.get(30usize, 2u8) as u16) }
7527 }
7528 #[inline]
7529 pub fn set__pad(&mut self, val: u16_) {
7530 unsafe {
7531 let val: u16 = ::core::mem::transmute(val);
7532 self._bitfield_1.set(30usize, 2u8, val as u64)
7533 }
7534 }
7535 #[inline]
7536 pub unsafe fn _pad_raw(this: *const Self) -> u16_ {
7537 unsafe {
7538 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
7539 ::core::ptr::addr_of!((*this)._bitfield_1),
7540 30usize,
7541 2u8,
7542 ) as u16)
7543 }
7544 }
7545 #[inline]
7546 pub unsafe fn set__pad_raw(this: *mut Self, val: u16_) {
7547 unsafe {
7548 let val: u16 = ::core::mem::transmute(val);
7549 <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
7550 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
7551 30usize,
7552 2u8,
7553 val as u64,
7554 )
7555 }
7556 }
7557 #[inline]
7558 pub fn new_bitfield_1(
7559 style: u16_,
7560 color: u16_,
7561 scale: u16_,
7562 yscale: u16_,
7563 rotation: u16_,
7564 xspacing: u16_,
7565 yposition: u16_,
7566 _pad: u16_,
7567 ) -> __BindgenBitfieldUnit<[u8; 4usize]> {
7568 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default();
7569 __bindgen_bitfield_unit.set(0usize, 6u8, {
7570 let style: u16 = unsafe { ::core::mem::transmute(style) };
7571 style as u64
7572 });
7573 __bindgen_bitfield_unit.set(6usize, 3u8, {
7574 let color: u16 = unsafe { ::core::mem::transmute(color) };
7575 color as u64
7576 });
7577 __bindgen_bitfield_unit.set(9usize, 4u8, {
7578 let scale: u16 = unsafe { ::core::mem::transmute(scale) };
7579 scale as u64
7580 });
7581 __bindgen_bitfield_unit.set(13usize, 3u8, {
7582 let yscale: u16 = unsafe { ::core::mem::transmute(yscale) };
7583 yscale as u64
7584 });
7585 __bindgen_bitfield_unit.set(16usize, 5u8, {
7586 let rotation: u16 = unsafe { ::core::mem::transmute(rotation) };
7587 rotation as u64
7588 });
7589 __bindgen_bitfield_unit.set(21usize, 4u8, {
7590 let xspacing: u16 = unsafe { ::core::mem::transmute(xspacing) };
7591 xspacing as u64
7592 });
7593 __bindgen_bitfield_unit.set(25usize, 5u8, {
7594 let yposition: u16 = unsafe { ::core::mem::transmute(yposition) };
7595 yposition as u64
7596 });
7597 __bindgen_bitfield_unit.set(30usize, 2u8, {
7598 let _pad: u16 = unsafe { ::core::mem::transmute(_pad) };
7599 _pad as u64
7600 });
7601 __bindgen_bitfield_unit
7602 }
7603}
7604#[doc = "Eyebrow details"]
7605#[repr(C, packed)]
7606#[derive(Debug, Default, Copy, Clone)]
7607pub struct MiiData__bindgen_ty_9 {
7608 pub _bitfield_align_1: [u8; 0],
7609 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>,
7610}
7611#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7612const _: () = {
7613 ["Size of MiiData__bindgen_ty_9"][::core::mem::size_of::<MiiData__bindgen_ty_9>() - 4usize];
7614 ["Alignment of MiiData__bindgen_ty_9"]
7615 [::core::mem::align_of::<MiiData__bindgen_ty_9>() - 1usize];
7616};
7617impl MiiData__bindgen_ty_9 {
7618 #[inline]
7619 pub fn style(&self) -> u16_ {
7620 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 5u8) as u16) }
7621 }
7622 #[inline]
7623 pub fn set_style(&mut self, val: u16_) {
7624 unsafe {
7625 let val: u16 = ::core::mem::transmute(val);
7626 self._bitfield_1.set(0usize, 5u8, val as u64)
7627 }
7628 }
7629 #[inline]
7630 pub unsafe fn style_raw(this: *const Self) -> u16_ {
7631 unsafe {
7632 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
7633 ::core::ptr::addr_of!((*this)._bitfield_1),
7634 0usize,
7635 5u8,
7636 ) as u16)
7637 }
7638 }
7639 #[inline]
7640 pub unsafe fn set_style_raw(this: *mut Self, val: u16_) {
7641 unsafe {
7642 let val: u16 = ::core::mem::transmute(val);
7643 <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
7644 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
7645 0usize,
7646 5u8,
7647 val as u64,
7648 )
7649 }
7650 }
7651 #[inline]
7652 pub fn color(&self) -> u16_ {
7653 unsafe { ::core::mem::transmute(self._bitfield_1.get(5usize, 3u8) as u16) }
7654 }
7655 #[inline]
7656 pub fn set_color(&mut self, val: u16_) {
7657 unsafe {
7658 let val: u16 = ::core::mem::transmute(val);
7659 self._bitfield_1.set(5usize, 3u8, val as u64)
7660 }
7661 }
7662 #[inline]
7663 pub unsafe fn color_raw(this: *const Self) -> u16_ {
7664 unsafe {
7665 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
7666 ::core::ptr::addr_of!((*this)._bitfield_1),
7667 5usize,
7668 3u8,
7669 ) as u16)
7670 }
7671 }
7672 #[inline]
7673 pub unsafe fn set_color_raw(this: *mut Self, val: u16_) {
7674 unsafe {
7675 let val: u16 = ::core::mem::transmute(val);
7676 <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
7677 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
7678 5usize,
7679 3u8,
7680 val as u64,
7681 )
7682 }
7683 }
7684 #[inline]
7685 pub fn scale(&self) -> u16_ {
7686 unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 4u8) as u16) }
7687 }
7688 #[inline]
7689 pub fn set_scale(&mut self, val: u16_) {
7690 unsafe {
7691 let val: u16 = ::core::mem::transmute(val);
7692 self._bitfield_1.set(8usize, 4u8, val as u64)
7693 }
7694 }
7695 #[inline]
7696 pub unsafe fn scale_raw(this: *const Self) -> u16_ {
7697 unsafe {
7698 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
7699 ::core::ptr::addr_of!((*this)._bitfield_1),
7700 8usize,
7701 4u8,
7702 ) as u16)
7703 }
7704 }
7705 #[inline]
7706 pub unsafe fn set_scale_raw(this: *mut Self, val: u16_) {
7707 unsafe {
7708 let val: u16 = ::core::mem::transmute(val);
7709 <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
7710 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
7711 8usize,
7712 4u8,
7713 val as u64,
7714 )
7715 }
7716 }
7717 #[inline]
7718 pub fn yscale(&self) -> u16_ {
7719 unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 3u8) as u16) }
7720 }
7721 #[inline]
7722 pub fn set_yscale(&mut self, val: u16_) {
7723 unsafe {
7724 let val: u16 = ::core::mem::transmute(val);
7725 self._bitfield_1.set(12usize, 3u8, val as u64)
7726 }
7727 }
7728 #[inline]
7729 pub unsafe fn yscale_raw(this: *const Self) -> u16_ {
7730 unsafe {
7731 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
7732 ::core::ptr::addr_of!((*this)._bitfield_1),
7733 12usize,
7734 3u8,
7735 ) as u16)
7736 }
7737 }
7738 #[inline]
7739 pub unsafe fn set_yscale_raw(this: *mut Self, val: u16_) {
7740 unsafe {
7741 let val: u16 = ::core::mem::transmute(val);
7742 <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
7743 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
7744 12usize,
7745 3u8,
7746 val as u64,
7747 )
7748 }
7749 }
7750 #[inline]
7751 pub fn _pad(&self) -> u16_ {
7752 unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
7753 }
7754 #[inline]
7755 pub fn set__pad(&mut self, val: u16_) {
7756 unsafe {
7757 let val: u16 = ::core::mem::transmute(val);
7758 self._bitfield_1.set(15usize, 1u8, val as u64)
7759 }
7760 }
7761 #[inline]
7762 pub unsafe fn _pad_raw(this: *const Self) -> u16_ {
7763 unsafe {
7764 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
7765 ::core::ptr::addr_of!((*this)._bitfield_1),
7766 15usize,
7767 1u8,
7768 ) as u16)
7769 }
7770 }
7771 #[inline]
7772 pub unsafe fn set__pad_raw(this: *mut Self, val: u16_) {
7773 unsafe {
7774 let val: u16 = ::core::mem::transmute(val);
7775 <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
7776 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
7777 15usize,
7778 1u8,
7779 val as u64,
7780 )
7781 }
7782 }
7783 #[inline]
7784 pub fn rotation(&self) -> u16_ {
7785 unsafe { ::core::mem::transmute(self._bitfield_1.get(16usize, 4u8) as u16) }
7786 }
7787 #[inline]
7788 pub fn set_rotation(&mut self, val: u16_) {
7789 unsafe {
7790 let val: u16 = ::core::mem::transmute(val);
7791 self._bitfield_1.set(16usize, 4u8, val as u64)
7792 }
7793 }
7794 #[inline]
7795 pub unsafe fn rotation_raw(this: *const Self) -> u16_ {
7796 unsafe {
7797 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
7798 ::core::ptr::addr_of!((*this)._bitfield_1),
7799 16usize,
7800 4u8,
7801 ) as u16)
7802 }
7803 }
7804 #[inline]
7805 pub unsafe fn set_rotation_raw(this: *mut Self, val: u16_) {
7806 unsafe {
7807 let val: u16 = ::core::mem::transmute(val);
7808 <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
7809 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
7810 16usize,
7811 4u8,
7812 val as u64,
7813 )
7814 }
7815 }
7816 #[inline]
7817 pub fn xspacing(&self) -> u16_ {
7818 unsafe { ::core::mem::transmute(self._bitfield_1.get(20usize, 4u8) as u16) }
7819 }
7820 #[inline]
7821 pub fn set_xspacing(&mut self, val: u16_) {
7822 unsafe {
7823 let val: u16 = ::core::mem::transmute(val);
7824 self._bitfield_1.set(20usize, 4u8, val as u64)
7825 }
7826 }
7827 #[inline]
7828 pub unsafe fn xspacing_raw(this: *const Self) -> u16_ {
7829 unsafe {
7830 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
7831 ::core::ptr::addr_of!((*this)._bitfield_1),
7832 20usize,
7833 4u8,
7834 ) as u16)
7835 }
7836 }
7837 #[inline]
7838 pub unsafe fn set_xspacing_raw(this: *mut Self, val: u16_) {
7839 unsafe {
7840 let val: u16 = ::core::mem::transmute(val);
7841 <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
7842 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
7843 20usize,
7844 4u8,
7845 val as u64,
7846 )
7847 }
7848 }
7849 #[inline]
7850 pub fn yposition(&self) -> u16_ {
7851 unsafe { ::core::mem::transmute(self._bitfield_1.get(24usize, 5u8) as u16) }
7852 }
7853 #[inline]
7854 pub fn set_yposition(&mut self, val: u16_) {
7855 unsafe {
7856 let val: u16 = ::core::mem::transmute(val);
7857 self._bitfield_1.set(24usize, 5u8, val as u64)
7858 }
7859 }
7860 #[inline]
7861 pub unsafe fn yposition_raw(this: *const Self) -> u16_ {
7862 unsafe {
7863 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
7864 ::core::ptr::addr_of!((*this)._bitfield_1),
7865 24usize,
7866 5u8,
7867 ) as u16)
7868 }
7869 }
7870 #[inline]
7871 pub unsafe fn set_yposition_raw(this: *mut Self, val: u16_) {
7872 unsafe {
7873 let val: u16 = ::core::mem::transmute(val);
7874 <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
7875 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
7876 24usize,
7877 5u8,
7878 val as u64,
7879 )
7880 }
7881 }
7882 #[inline]
7883 pub fn _pad2(&self) -> u16_ {
7884 unsafe { ::core::mem::transmute(self._bitfield_1.get(29usize, 3u8) as u16) }
7885 }
7886 #[inline]
7887 pub fn set__pad2(&mut self, val: u16_) {
7888 unsafe {
7889 let val: u16 = ::core::mem::transmute(val);
7890 self._bitfield_1.set(29usize, 3u8, val as u64)
7891 }
7892 }
7893 #[inline]
7894 pub unsafe fn _pad2_raw(this: *const Self) -> u16_ {
7895 unsafe {
7896 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
7897 ::core::ptr::addr_of!((*this)._bitfield_1),
7898 29usize,
7899 3u8,
7900 ) as u16)
7901 }
7902 }
7903 #[inline]
7904 pub unsafe fn set__pad2_raw(this: *mut Self, val: u16_) {
7905 unsafe {
7906 let val: u16 = ::core::mem::transmute(val);
7907 <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
7908 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
7909 29usize,
7910 3u8,
7911 val as u64,
7912 )
7913 }
7914 }
7915 #[inline]
7916 pub fn new_bitfield_1(
7917 style: u16_,
7918 color: u16_,
7919 scale: u16_,
7920 yscale: u16_,
7921 _pad: u16_,
7922 rotation: u16_,
7923 xspacing: u16_,
7924 yposition: u16_,
7925 _pad2: u16_,
7926 ) -> __BindgenBitfieldUnit<[u8; 4usize]> {
7927 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default();
7928 __bindgen_bitfield_unit.set(0usize, 5u8, {
7929 let style: u16 = unsafe { ::core::mem::transmute(style) };
7930 style as u64
7931 });
7932 __bindgen_bitfield_unit.set(5usize, 3u8, {
7933 let color: u16 = unsafe { ::core::mem::transmute(color) };
7934 color as u64
7935 });
7936 __bindgen_bitfield_unit.set(8usize, 4u8, {
7937 let scale: u16 = unsafe { ::core::mem::transmute(scale) };
7938 scale as u64
7939 });
7940 __bindgen_bitfield_unit.set(12usize, 3u8, {
7941 let yscale: u16 = unsafe { ::core::mem::transmute(yscale) };
7942 yscale as u64
7943 });
7944 __bindgen_bitfield_unit.set(15usize, 1u8, {
7945 let _pad: u16 = unsafe { ::core::mem::transmute(_pad) };
7946 _pad as u64
7947 });
7948 __bindgen_bitfield_unit.set(16usize, 4u8, {
7949 let rotation: u16 = unsafe { ::core::mem::transmute(rotation) };
7950 rotation as u64
7951 });
7952 __bindgen_bitfield_unit.set(20usize, 4u8, {
7953 let xspacing: u16 = unsafe { ::core::mem::transmute(xspacing) };
7954 xspacing as u64
7955 });
7956 __bindgen_bitfield_unit.set(24usize, 5u8, {
7957 let yposition: u16 = unsafe { ::core::mem::transmute(yposition) };
7958 yposition as u64
7959 });
7960 __bindgen_bitfield_unit.set(29usize, 3u8, {
7961 let _pad2: u16 = unsafe { ::core::mem::transmute(_pad2) };
7962 _pad2 as u64
7963 });
7964 __bindgen_bitfield_unit
7965 }
7966}
7967#[doc = "Nose details"]
7968#[repr(C, packed)]
7969#[derive(Debug, Default, Copy, Clone)]
7970pub struct MiiData__bindgen_ty_10 {
7971 pub _bitfield_align_1: [u8; 0],
7972 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
7973}
7974#[allow(clippy::unnecessary_operation, clippy::identity_op)]
7975const _: () = {
7976 ["Size of MiiData__bindgen_ty_10"][::core::mem::size_of::<MiiData__bindgen_ty_10>() - 2usize];
7977 ["Alignment of MiiData__bindgen_ty_10"]
7978 [::core::mem::align_of::<MiiData__bindgen_ty_10>() - 1usize];
7979};
7980impl MiiData__bindgen_ty_10 {
7981 #[inline]
7982 pub fn style(&self) -> u16_ {
7983 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 5u8) as u16) }
7984 }
7985 #[inline]
7986 pub fn set_style(&mut self, val: u16_) {
7987 unsafe {
7988 let val: u16 = ::core::mem::transmute(val);
7989 self._bitfield_1.set(0usize, 5u8, val as u64)
7990 }
7991 }
7992 #[inline]
7993 pub unsafe fn style_raw(this: *const Self) -> u16_ {
7994 unsafe {
7995 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
7996 ::core::ptr::addr_of!((*this)._bitfield_1),
7997 0usize,
7998 5u8,
7999 ) as u16)
8000 }
8001 }
8002 #[inline]
8003 pub unsafe fn set_style_raw(this: *mut Self, val: u16_) {
8004 unsafe {
8005 let val: u16 = ::core::mem::transmute(val);
8006 <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
8007 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
8008 0usize,
8009 5u8,
8010 val as u64,
8011 )
8012 }
8013 }
8014 #[inline]
8015 pub fn scale(&self) -> u16_ {
8016 unsafe { ::core::mem::transmute(self._bitfield_1.get(5usize, 4u8) as u16) }
8017 }
8018 #[inline]
8019 pub fn set_scale(&mut self, val: u16_) {
8020 unsafe {
8021 let val: u16 = ::core::mem::transmute(val);
8022 self._bitfield_1.set(5usize, 4u8, val as u64)
8023 }
8024 }
8025 #[inline]
8026 pub unsafe fn scale_raw(this: *const Self) -> u16_ {
8027 unsafe {
8028 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
8029 ::core::ptr::addr_of!((*this)._bitfield_1),
8030 5usize,
8031 4u8,
8032 ) as u16)
8033 }
8034 }
8035 #[inline]
8036 pub unsafe fn set_scale_raw(this: *mut Self, val: u16_) {
8037 unsafe {
8038 let val: u16 = ::core::mem::transmute(val);
8039 <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
8040 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
8041 5usize,
8042 4u8,
8043 val as u64,
8044 )
8045 }
8046 }
8047 #[inline]
8048 pub fn yposition(&self) -> u16_ {
8049 unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 5u8) as u16) }
8050 }
8051 #[inline]
8052 pub fn set_yposition(&mut self, val: u16_) {
8053 unsafe {
8054 let val: u16 = ::core::mem::transmute(val);
8055 self._bitfield_1.set(9usize, 5u8, val as u64)
8056 }
8057 }
8058 #[inline]
8059 pub unsafe fn yposition_raw(this: *const Self) -> u16_ {
8060 unsafe {
8061 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
8062 ::core::ptr::addr_of!((*this)._bitfield_1),
8063 9usize,
8064 5u8,
8065 ) as u16)
8066 }
8067 }
8068 #[inline]
8069 pub unsafe fn set_yposition_raw(this: *mut Self, val: u16_) {
8070 unsafe {
8071 let val: u16 = ::core::mem::transmute(val);
8072 <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
8073 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
8074 9usize,
8075 5u8,
8076 val as u64,
8077 )
8078 }
8079 }
8080 #[inline]
8081 pub fn _pad(&self) -> u16_ {
8082 unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 2u8) as u16) }
8083 }
8084 #[inline]
8085 pub fn set__pad(&mut self, val: u16_) {
8086 unsafe {
8087 let val: u16 = ::core::mem::transmute(val);
8088 self._bitfield_1.set(14usize, 2u8, val as u64)
8089 }
8090 }
8091 #[inline]
8092 pub unsafe fn _pad_raw(this: *const Self) -> u16_ {
8093 unsafe {
8094 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
8095 ::core::ptr::addr_of!((*this)._bitfield_1),
8096 14usize,
8097 2u8,
8098 ) as u16)
8099 }
8100 }
8101 #[inline]
8102 pub unsafe fn set__pad_raw(this: *mut Self, val: u16_) {
8103 unsafe {
8104 let val: u16 = ::core::mem::transmute(val);
8105 <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
8106 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
8107 14usize,
8108 2u8,
8109 val as u64,
8110 )
8111 }
8112 }
8113 #[inline]
8114 pub fn new_bitfield_1(
8115 style: u16_,
8116 scale: u16_,
8117 yposition: u16_,
8118 _pad: u16_,
8119 ) -> __BindgenBitfieldUnit<[u8; 2usize]> {
8120 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
8121 __bindgen_bitfield_unit.set(0usize, 5u8, {
8122 let style: u16 = unsafe { ::core::mem::transmute(style) };
8123 style as u64
8124 });
8125 __bindgen_bitfield_unit.set(5usize, 4u8, {
8126 let scale: u16 = unsafe { ::core::mem::transmute(scale) };
8127 scale as u64
8128 });
8129 __bindgen_bitfield_unit.set(9usize, 5u8, {
8130 let yposition: u16 = unsafe { ::core::mem::transmute(yposition) };
8131 yposition as u64
8132 });
8133 __bindgen_bitfield_unit.set(14usize, 2u8, {
8134 let _pad: u16 = unsafe { ::core::mem::transmute(_pad) };
8135 _pad as u64
8136 });
8137 __bindgen_bitfield_unit
8138 }
8139}
8140#[doc = "Mouth details"]
8141#[repr(C, packed)]
8142#[derive(Debug, Default, Copy, Clone)]
8143pub struct MiiData__bindgen_ty_11 {
8144 pub _bitfield_align_1: [u8; 0],
8145 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
8146}
8147#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8148const _: () = {
8149 ["Size of MiiData__bindgen_ty_11"][::core::mem::size_of::<MiiData__bindgen_ty_11>() - 2usize];
8150 ["Alignment of MiiData__bindgen_ty_11"]
8151 [::core::mem::align_of::<MiiData__bindgen_ty_11>() - 1usize];
8152};
8153impl MiiData__bindgen_ty_11 {
8154 #[inline]
8155 pub fn style(&self) -> u16_ {
8156 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 6u8) as u16) }
8157 }
8158 #[inline]
8159 pub fn set_style(&mut self, val: u16_) {
8160 unsafe {
8161 let val: u16 = ::core::mem::transmute(val);
8162 self._bitfield_1.set(0usize, 6u8, val as u64)
8163 }
8164 }
8165 #[inline]
8166 pub unsafe fn style_raw(this: *const Self) -> u16_ {
8167 unsafe {
8168 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
8169 ::core::ptr::addr_of!((*this)._bitfield_1),
8170 0usize,
8171 6u8,
8172 ) as u16)
8173 }
8174 }
8175 #[inline]
8176 pub unsafe fn set_style_raw(this: *mut Self, val: u16_) {
8177 unsafe {
8178 let val: u16 = ::core::mem::transmute(val);
8179 <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
8180 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
8181 0usize,
8182 6u8,
8183 val as u64,
8184 )
8185 }
8186 }
8187 #[inline]
8188 pub fn color(&self) -> u16_ {
8189 unsafe { ::core::mem::transmute(self._bitfield_1.get(6usize, 3u8) as u16) }
8190 }
8191 #[inline]
8192 pub fn set_color(&mut self, val: u16_) {
8193 unsafe {
8194 let val: u16 = ::core::mem::transmute(val);
8195 self._bitfield_1.set(6usize, 3u8, val as u64)
8196 }
8197 }
8198 #[inline]
8199 pub unsafe fn color_raw(this: *const Self) -> u16_ {
8200 unsafe {
8201 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
8202 ::core::ptr::addr_of!((*this)._bitfield_1),
8203 6usize,
8204 3u8,
8205 ) as u16)
8206 }
8207 }
8208 #[inline]
8209 pub unsafe fn set_color_raw(this: *mut Self, val: u16_) {
8210 unsafe {
8211 let val: u16 = ::core::mem::transmute(val);
8212 <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
8213 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
8214 6usize,
8215 3u8,
8216 val as u64,
8217 )
8218 }
8219 }
8220 #[inline]
8221 pub fn scale(&self) -> u16_ {
8222 unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 4u8) as u16) }
8223 }
8224 #[inline]
8225 pub fn set_scale(&mut self, val: u16_) {
8226 unsafe {
8227 let val: u16 = ::core::mem::transmute(val);
8228 self._bitfield_1.set(9usize, 4u8, val as u64)
8229 }
8230 }
8231 #[inline]
8232 pub unsafe fn scale_raw(this: *const Self) -> u16_ {
8233 unsafe {
8234 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
8235 ::core::ptr::addr_of!((*this)._bitfield_1),
8236 9usize,
8237 4u8,
8238 ) as u16)
8239 }
8240 }
8241 #[inline]
8242 pub unsafe fn set_scale_raw(this: *mut Self, val: u16_) {
8243 unsafe {
8244 let val: u16 = ::core::mem::transmute(val);
8245 <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
8246 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
8247 9usize,
8248 4u8,
8249 val as u64,
8250 )
8251 }
8252 }
8253 #[inline]
8254 pub fn yscale(&self) -> u16_ {
8255 unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 3u8) as u16) }
8256 }
8257 #[inline]
8258 pub fn set_yscale(&mut self, val: u16_) {
8259 unsafe {
8260 let val: u16 = ::core::mem::transmute(val);
8261 self._bitfield_1.set(13usize, 3u8, val as u64)
8262 }
8263 }
8264 #[inline]
8265 pub unsafe fn yscale_raw(this: *const Self) -> u16_ {
8266 unsafe {
8267 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
8268 ::core::ptr::addr_of!((*this)._bitfield_1),
8269 13usize,
8270 3u8,
8271 ) as u16)
8272 }
8273 }
8274 #[inline]
8275 pub unsafe fn set_yscale_raw(this: *mut Self, val: u16_) {
8276 unsafe {
8277 let val: u16 = ::core::mem::transmute(val);
8278 <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
8279 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
8280 13usize,
8281 3u8,
8282 val as u64,
8283 )
8284 }
8285 }
8286 #[inline]
8287 pub fn new_bitfield_1(
8288 style: u16_,
8289 color: u16_,
8290 scale: u16_,
8291 yscale: u16_,
8292 ) -> __BindgenBitfieldUnit<[u8; 2usize]> {
8293 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
8294 __bindgen_bitfield_unit.set(0usize, 6u8, {
8295 let style: u16 = unsafe { ::core::mem::transmute(style) };
8296 style as u64
8297 });
8298 __bindgen_bitfield_unit.set(6usize, 3u8, {
8299 let color: u16 = unsafe { ::core::mem::transmute(color) };
8300 color as u64
8301 });
8302 __bindgen_bitfield_unit.set(9usize, 4u8, {
8303 let scale: u16 = unsafe { ::core::mem::transmute(scale) };
8304 scale as u64
8305 });
8306 __bindgen_bitfield_unit.set(13usize, 3u8, {
8307 let yscale: u16 = unsafe { ::core::mem::transmute(yscale) };
8308 yscale as u64
8309 });
8310 __bindgen_bitfield_unit
8311 }
8312}
8313#[doc = "Mustache details"]
8314#[repr(C, packed)]
8315#[derive(Debug, Default, Copy, Clone)]
8316pub struct MiiData__bindgen_ty_12 {
8317 pub _bitfield_align_1: [u8; 0],
8318 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
8319}
8320#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8321const _: () = {
8322 ["Size of MiiData__bindgen_ty_12"][::core::mem::size_of::<MiiData__bindgen_ty_12>() - 2usize];
8323 ["Alignment of MiiData__bindgen_ty_12"]
8324 [::core::mem::align_of::<MiiData__bindgen_ty_12>() - 1usize];
8325};
8326impl MiiData__bindgen_ty_12 {
8327 #[inline]
8328 pub fn mouth_yposition(&self) -> u16_ {
8329 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 5u8) as u16) }
8330 }
8331 #[inline]
8332 pub fn set_mouth_yposition(&mut self, val: u16_) {
8333 unsafe {
8334 let val: u16 = ::core::mem::transmute(val);
8335 self._bitfield_1.set(0usize, 5u8, val as u64)
8336 }
8337 }
8338 #[inline]
8339 pub unsafe fn mouth_yposition_raw(this: *const Self) -> u16_ {
8340 unsafe {
8341 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
8342 ::core::ptr::addr_of!((*this)._bitfield_1),
8343 0usize,
8344 5u8,
8345 ) as u16)
8346 }
8347 }
8348 #[inline]
8349 pub unsafe fn set_mouth_yposition_raw(this: *mut Self, val: u16_) {
8350 unsafe {
8351 let val: u16 = ::core::mem::transmute(val);
8352 <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
8353 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
8354 0usize,
8355 5u8,
8356 val as u64,
8357 )
8358 }
8359 }
8360 #[inline]
8361 pub fn mustache_style(&self) -> u16_ {
8362 unsafe { ::core::mem::transmute(self._bitfield_1.get(5usize, 3u8) as u16) }
8363 }
8364 #[inline]
8365 pub fn set_mustache_style(&mut self, val: u16_) {
8366 unsafe {
8367 let val: u16 = ::core::mem::transmute(val);
8368 self._bitfield_1.set(5usize, 3u8, val as u64)
8369 }
8370 }
8371 #[inline]
8372 pub unsafe fn mustache_style_raw(this: *const Self) -> u16_ {
8373 unsafe {
8374 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
8375 ::core::ptr::addr_of!((*this)._bitfield_1),
8376 5usize,
8377 3u8,
8378 ) as u16)
8379 }
8380 }
8381 #[inline]
8382 pub unsafe fn set_mustache_style_raw(this: *mut Self, val: u16_) {
8383 unsafe {
8384 let val: u16 = ::core::mem::transmute(val);
8385 <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
8386 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
8387 5usize,
8388 3u8,
8389 val as u64,
8390 )
8391 }
8392 }
8393 #[inline]
8394 pub fn _pad(&self) -> u16_ {
8395 unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 8u8) as u16) }
8396 }
8397 #[inline]
8398 pub fn set__pad(&mut self, val: u16_) {
8399 unsafe {
8400 let val: u16 = ::core::mem::transmute(val);
8401 self._bitfield_1.set(8usize, 8u8, val as u64)
8402 }
8403 }
8404 #[inline]
8405 pub unsafe fn _pad_raw(this: *const Self) -> u16_ {
8406 unsafe {
8407 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
8408 ::core::ptr::addr_of!((*this)._bitfield_1),
8409 8usize,
8410 8u8,
8411 ) as u16)
8412 }
8413 }
8414 #[inline]
8415 pub unsafe fn set__pad_raw(this: *mut Self, val: u16_) {
8416 unsafe {
8417 let val: u16 = ::core::mem::transmute(val);
8418 <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
8419 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
8420 8usize,
8421 8u8,
8422 val as u64,
8423 )
8424 }
8425 }
8426 #[inline]
8427 pub fn new_bitfield_1(
8428 mouth_yposition: u16_,
8429 mustache_style: u16_,
8430 _pad: u16_,
8431 ) -> __BindgenBitfieldUnit<[u8; 2usize]> {
8432 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
8433 __bindgen_bitfield_unit.set(0usize, 5u8, {
8434 let mouth_yposition: u16 = unsafe { ::core::mem::transmute(mouth_yposition) };
8435 mouth_yposition as u64
8436 });
8437 __bindgen_bitfield_unit.set(5usize, 3u8, {
8438 let mustache_style: u16 = unsafe { ::core::mem::transmute(mustache_style) };
8439 mustache_style as u64
8440 });
8441 __bindgen_bitfield_unit.set(8usize, 8u8, {
8442 let _pad: u16 = unsafe { ::core::mem::transmute(_pad) };
8443 _pad as u64
8444 });
8445 __bindgen_bitfield_unit
8446 }
8447}
8448#[doc = "Beard details"]
8449#[repr(C, packed)]
8450#[derive(Debug, Default, Copy, Clone)]
8451pub struct MiiData__bindgen_ty_13 {
8452 pub _bitfield_align_1: [u8; 0],
8453 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
8454}
8455#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8456const _: () = {
8457 ["Size of MiiData__bindgen_ty_13"][::core::mem::size_of::<MiiData__bindgen_ty_13>() - 2usize];
8458 ["Alignment of MiiData__bindgen_ty_13"]
8459 [::core::mem::align_of::<MiiData__bindgen_ty_13>() - 1usize];
8460};
8461impl MiiData__bindgen_ty_13 {
8462 #[inline]
8463 pub fn style(&self) -> u16_ {
8464 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 3u8) as u16) }
8465 }
8466 #[inline]
8467 pub fn set_style(&mut self, val: u16_) {
8468 unsafe {
8469 let val: u16 = ::core::mem::transmute(val);
8470 self._bitfield_1.set(0usize, 3u8, val as u64)
8471 }
8472 }
8473 #[inline]
8474 pub unsafe fn style_raw(this: *const Self) -> u16_ {
8475 unsafe {
8476 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
8477 ::core::ptr::addr_of!((*this)._bitfield_1),
8478 0usize,
8479 3u8,
8480 ) as u16)
8481 }
8482 }
8483 #[inline]
8484 pub unsafe fn set_style_raw(this: *mut Self, val: u16_) {
8485 unsafe {
8486 let val: u16 = ::core::mem::transmute(val);
8487 <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
8488 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
8489 0usize,
8490 3u8,
8491 val as u64,
8492 )
8493 }
8494 }
8495 #[inline]
8496 pub fn color(&self) -> u16_ {
8497 unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 3u8) as u16) }
8498 }
8499 #[inline]
8500 pub fn set_color(&mut self, val: u16_) {
8501 unsafe {
8502 let val: u16 = ::core::mem::transmute(val);
8503 self._bitfield_1.set(3usize, 3u8, val as u64)
8504 }
8505 }
8506 #[inline]
8507 pub unsafe fn color_raw(this: *const Self) -> u16_ {
8508 unsafe {
8509 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
8510 ::core::ptr::addr_of!((*this)._bitfield_1),
8511 3usize,
8512 3u8,
8513 ) as u16)
8514 }
8515 }
8516 #[inline]
8517 pub unsafe fn set_color_raw(this: *mut Self, val: u16_) {
8518 unsafe {
8519 let val: u16 = ::core::mem::transmute(val);
8520 <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
8521 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
8522 3usize,
8523 3u8,
8524 val as u64,
8525 )
8526 }
8527 }
8528 #[inline]
8529 pub fn scale(&self) -> u16_ {
8530 unsafe { ::core::mem::transmute(self._bitfield_1.get(6usize, 4u8) as u16) }
8531 }
8532 #[inline]
8533 pub fn set_scale(&mut self, val: u16_) {
8534 unsafe {
8535 let val: u16 = ::core::mem::transmute(val);
8536 self._bitfield_1.set(6usize, 4u8, val as u64)
8537 }
8538 }
8539 #[inline]
8540 pub unsafe fn scale_raw(this: *const Self) -> u16_ {
8541 unsafe {
8542 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
8543 ::core::ptr::addr_of!((*this)._bitfield_1),
8544 6usize,
8545 4u8,
8546 ) as u16)
8547 }
8548 }
8549 #[inline]
8550 pub unsafe fn set_scale_raw(this: *mut Self, val: u16_) {
8551 unsafe {
8552 let val: u16 = ::core::mem::transmute(val);
8553 <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
8554 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
8555 6usize,
8556 4u8,
8557 val as u64,
8558 )
8559 }
8560 }
8561 #[inline]
8562 pub fn ypos(&self) -> u16_ {
8563 unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 5u8) as u16) }
8564 }
8565 #[inline]
8566 pub fn set_ypos(&mut self, val: u16_) {
8567 unsafe {
8568 let val: u16 = ::core::mem::transmute(val);
8569 self._bitfield_1.set(10usize, 5u8, val as u64)
8570 }
8571 }
8572 #[inline]
8573 pub unsafe fn ypos_raw(this: *const Self) -> u16_ {
8574 unsafe {
8575 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
8576 ::core::ptr::addr_of!((*this)._bitfield_1),
8577 10usize,
8578 5u8,
8579 ) as u16)
8580 }
8581 }
8582 #[inline]
8583 pub unsafe fn set_ypos_raw(this: *mut Self, val: u16_) {
8584 unsafe {
8585 let val: u16 = ::core::mem::transmute(val);
8586 <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
8587 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
8588 10usize,
8589 5u8,
8590 val as u64,
8591 )
8592 }
8593 }
8594 #[inline]
8595 pub fn _pad(&self) -> u16_ {
8596 unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
8597 }
8598 #[inline]
8599 pub fn set__pad(&mut self, val: u16_) {
8600 unsafe {
8601 let val: u16 = ::core::mem::transmute(val);
8602 self._bitfield_1.set(15usize, 1u8, val as u64)
8603 }
8604 }
8605 #[inline]
8606 pub unsafe fn _pad_raw(this: *const Self) -> u16_ {
8607 unsafe {
8608 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
8609 ::core::ptr::addr_of!((*this)._bitfield_1),
8610 15usize,
8611 1u8,
8612 ) as u16)
8613 }
8614 }
8615 #[inline]
8616 pub unsafe fn set__pad_raw(this: *mut Self, val: u16_) {
8617 unsafe {
8618 let val: u16 = ::core::mem::transmute(val);
8619 <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
8620 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
8621 15usize,
8622 1u8,
8623 val as u64,
8624 )
8625 }
8626 }
8627 #[inline]
8628 pub fn new_bitfield_1(
8629 style: u16_,
8630 color: u16_,
8631 scale: u16_,
8632 ypos: u16_,
8633 _pad: u16_,
8634 ) -> __BindgenBitfieldUnit<[u8; 2usize]> {
8635 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
8636 __bindgen_bitfield_unit.set(0usize, 3u8, {
8637 let style: u16 = unsafe { ::core::mem::transmute(style) };
8638 style as u64
8639 });
8640 __bindgen_bitfield_unit.set(3usize, 3u8, {
8641 let color: u16 = unsafe { ::core::mem::transmute(color) };
8642 color as u64
8643 });
8644 __bindgen_bitfield_unit.set(6usize, 4u8, {
8645 let scale: u16 = unsafe { ::core::mem::transmute(scale) };
8646 scale as u64
8647 });
8648 __bindgen_bitfield_unit.set(10usize, 5u8, {
8649 let ypos: u16 = unsafe { ::core::mem::transmute(ypos) };
8650 ypos as u64
8651 });
8652 __bindgen_bitfield_unit.set(15usize, 1u8, {
8653 let _pad: u16 = unsafe { ::core::mem::transmute(_pad) };
8654 _pad as u64
8655 });
8656 __bindgen_bitfield_unit
8657 }
8658}
8659#[doc = "Glasses details"]
8660#[repr(C, packed)]
8661#[derive(Debug, Default, Copy, Clone)]
8662pub struct MiiData__bindgen_ty_14 {
8663 pub _bitfield_align_1: [u8; 0],
8664 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
8665}
8666#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8667const _: () = {
8668 ["Size of MiiData__bindgen_ty_14"][::core::mem::size_of::<MiiData__bindgen_ty_14>() - 2usize];
8669 ["Alignment of MiiData__bindgen_ty_14"]
8670 [::core::mem::align_of::<MiiData__bindgen_ty_14>() - 1usize];
8671};
8672impl MiiData__bindgen_ty_14 {
8673 #[inline]
8674 pub fn style(&self) -> u16_ {
8675 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
8676 }
8677 #[inline]
8678 pub fn set_style(&mut self, val: u16_) {
8679 unsafe {
8680 let val: u16 = ::core::mem::transmute(val);
8681 self._bitfield_1.set(0usize, 4u8, val as u64)
8682 }
8683 }
8684 #[inline]
8685 pub unsafe fn style_raw(this: *const Self) -> u16_ {
8686 unsafe {
8687 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
8688 ::core::ptr::addr_of!((*this)._bitfield_1),
8689 0usize,
8690 4u8,
8691 ) as u16)
8692 }
8693 }
8694 #[inline]
8695 pub unsafe fn set_style_raw(this: *mut Self, val: u16_) {
8696 unsafe {
8697 let val: u16 = ::core::mem::transmute(val);
8698 <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
8699 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
8700 0usize,
8701 4u8,
8702 val as u64,
8703 )
8704 }
8705 }
8706 #[inline]
8707 pub fn color(&self) -> u16_ {
8708 unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 3u8) as u16) }
8709 }
8710 #[inline]
8711 pub fn set_color(&mut self, val: u16_) {
8712 unsafe {
8713 let val: u16 = ::core::mem::transmute(val);
8714 self._bitfield_1.set(4usize, 3u8, val as u64)
8715 }
8716 }
8717 #[inline]
8718 pub unsafe fn color_raw(this: *const Self) -> u16_ {
8719 unsafe {
8720 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
8721 ::core::ptr::addr_of!((*this)._bitfield_1),
8722 4usize,
8723 3u8,
8724 ) as u16)
8725 }
8726 }
8727 #[inline]
8728 pub unsafe fn set_color_raw(this: *mut Self, val: u16_) {
8729 unsafe {
8730 let val: u16 = ::core::mem::transmute(val);
8731 <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
8732 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
8733 4usize,
8734 3u8,
8735 val as u64,
8736 )
8737 }
8738 }
8739 #[inline]
8740 pub fn scale(&self) -> u16_ {
8741 unsafe { ::core::mem::transmute(self._bitfield_1.get(7usize, 4u8) as u16) }
8742 }
8743 #[inline]
8744 pub fn set_scale(&mut self, val: u16_) {
8745 unsafe {
8746 let val: u16 = ::core::mem::transmute(val);
8747 self._bitfield_1.set(7usize, 4u8, val as u64)
8748 }
8749 }
8750 #[inline]
8751 pub unsafe fn scale_raw(this: *const Self) -> u16_ {
8752 unsafe {
8753 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
8754 ::core::ptr::addr_of!((*this)._bitfield_1),
8755 7usize,
8756 4u8,
8757 ) as u16)
8758 }
8759 }
8760 #[inline]
8761 pub unsafe fn set_scale_raw(this: *mut Self, val: u16_) {
8762 unsafe {
8763 let val: u16 = ::core::mem::transmute(val);
8764 <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
8765 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
8766 7usize,
8767 4u8,
8768 val as u64,
8769 )
8770 }
8771 }
8772 #[inline]
8773 pub fn ypos(&self) -> u16_ {
8774 unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 5u8) as u16) }
8775 }
8776 #[inline]
8777 pub fn set_ypos(&mut self, val: u16_) {
8778 unsafe {
8779 let val: u16 = ::core::mem::transmute(val);
8780 self._bitfield_1.set(11usize, 5u8, val as u64)
8781 }
8782 }
8783 #[inline]
8784 pub unsafe fn ypos_raw(this: *const Self) -> u16_ {
8785 unsafe {
8786 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
8787 ::core::ptr::addr_of!((*this)._bitfield_1),
8788 11usize,
8789 5u8,
8790 ) as u16)
8791 }
8792 }
8793 #[inline]
8794 pub unsafe fn set_ypos_raw(this: *mut Self, val: u16_) {
8795 unsafe {
8796 let val: u16 = ::core::mem::transmute(val);
8797 <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
8798 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
8799 11usize,
8800 5u8,
8801 val as u64,
8802 )
8803 }
8804 }
8805 #[inline]
8806 pub fn new_bitfield_1(
8807 style: u16_,
8808 color: u16_,
8809 scale: u16_,
8810 ypos: u16_,
8811 ) -> __BindgenBitfieldUnit<[u8; 2usize]> {
8812 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
8813 __bindgen_bitfield_unit.set(0usize, 4u8, {
8814 let style: u16 = unsafe { ::core::mem::transmute(style) };
8815 style as u64
8816 });
8817 __bindgen_bitfield_unit.set(4usize, 3u8, {
8818 let color: u16 = unsafe { ::core::mem::transmute(color) };
8819 color as u64
8820 });
8821 __bindgen_bitfield_unit.set(7usize, 4u8, {
8822 let scale: u16 = unsafe { ::core::mem::transmute(scale) };
8823 scale as u64
8824 });
8825 __bindgen_bitfield_unit.set(11usize, 5u8, {
8826 let ypos: u16 = unsafe { ::core::mem::transmute(ypos) };
8827 ypos as u64
8828 });
8829 __bindgen_bitfield_unit
8830 }
8831}
8832#[doc = "Mole details"]
8833#[repr(C, packed)]
8834#[derive(Debug, Default, Copy, Clone)]
8835pub struct MiiData__bindgen_ty_15 {
8836 pub _bitfield_align_1: [u8; 0],
8837 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
8838}
8839#[allow(clippy::unnecessary_operation, clippy::identity_op)]
8840const _: () = {
8841 ["Size of MiiData__bindgen_ty_15"][::core::mem::size_of::<MiiData__bindgen_ty_15>() - 2usize];
8842 ["Alignment of MiiData__bindgen_ty_15"]
8843 [::core::mem::align_of::<MiiData__bindgen_ty_15>() - 1usize];
8844};
8845impl MiiData__bindgen_ty_15 {
8846 #[inline]
8847 pub fn enable(&self) -> bool {
8848 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u8) }
8849 }
8850 #[inline]
8851 pub fn set_enable(&mut self, val: bool) {
8852 unsafe {
8853 let val: u8 = ::core::mem::transmute(val);
8854 self._bitfield_1.set(0usize, 1u8, val as u64)
8855 }
8856 }
8857 #[inline]
8858 pub unsafe fn enable_raw(this: *const Self) -> bool {
8859 unsafe {
8860 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
8861 ::core::ptr::addr_of!((*this)._bitfield_1),
8862 0usize,
8863 1u8,
8864 ) as u8)
8865 }
8866 }
8867 #[inline]
8868 pub unsafe fn set_enable_raw(this: *mut Self, val: bool) {
8869 unsafe {
8870 let val: u8 = ::core::mem::transmute(val);
8871 <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
8872 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
8873 0usize,
8874 1u8,
8875 val as u64,
8876 )
8877 }
8878 }
8879 #[inline]
8880 pub fn scale(&self) -> u16_ {
8881 unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 4u8) as u16) }
8882 }
8883 #[inline]
8884 pub fn set_scale(&mut self, val: u16_) {
8885 unsafe {
8886 let val: u16 = ::core::mem::transmute(val);
8887 self._bitfield_1.set(1usize, 4u8, val as u64)
8888 }
8889 }
8890 #[inline]
8891 pub unsafe fn scale_raw(this: *const Self) -> u16_ {
8892 unsafe {
8893 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
8894 ::core::ptr::addr_of!((*this)._bitfield_1),
8895 1usize,
8896 4u8,
8897 ) as u16)
8898 }
8899 }
8900 #[inline]
8901 pub unsafe fn set_scale_raw(this: *mut Self, val: u16_) {
8902 unsafe {
8903 let val: u16 = ::core::mem::transmute(val);
8904 <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
8905 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
8906 1usize,
8907 4u8,
8908 val as u64,
8909 )
8910 }
8911 }
8912 #[inline]
8913 pub fn xpos(&self) -> u16_ {
8914 unsafe { ::core::mem::transmute(self._bitfield_1.get(5usize, 5u8) as u16) }
8915 }
8916 #[inline]
8917 pub fn set_xpos(&mut self, val: u16_) {
8918 unsafe {
8919 let val: u16 = ::core::mem::transmute(val);
8920 self._bitfield_1.set(5usize, 5u8, val as u64)
8921 }
8922 }
8923 #[inline]
8924 pub unsafe fn xpos_raw(this: *const Self) -> u16_ {
8925 unsafe {
8926 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
8927 ::core::ptr::addr_of!((*this)._bitfield_1),
8928 5usize,
8929 5u8,
8930 ) as u16)
8931 }
8932 }
8933 #[inline]
8934 pub unsafe fn set_xpos_raw(this: *mut Self, val: u16_) {
8935 unsafe {
8936 let val: u16 = ::core::mem::transmute(val);
8937 <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
8938 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
8939 5usize,
8940 5u8,
8941 val as u64,
8942 )
8943 }
8944 }
8945 #[inline]
8946 pub fn ypos(&self) -> u16_ {
8947 unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 5u8) as u16) }
8948 }
8949 #[inline]
8950 pub fn set_ypos(&mut self, val: u16_) {
8951 unsafe {
8952 let val: u16 = ::core::mem::transmute(val);
8953 self._bitfield_1.set(10usize, 5u8, val as u64)
8954 }
8955 }
8956 #[inline]
8957 pub unsafe fn ypos_raw(this: *const Self) -> u16_ {
8958 unsafe {
8959 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
8960 ::core::ptr::addr_of!((*this)._bitfield_1),
8961 10usize,
8962 5u8,
8963 ) as u16)
8964 }
8965 }
8966 #[inline]
8967 pub unsafe fn set_ypos_raw(this: *mut Self, val: u16_) {
8968 unsafe {
8969 let val: u16 = ::core::mem::transmute(val);
8970 <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
8971 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
8972 10usize,
8973 5u8,
8974 val as u64,
8975 )
8976 }
8977 }
8978 #[inline]
8979 pub fn _pad(&self) -> u16_ {
8980 unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
8981 }
8982 #[inline]
8983 pub fn set__pad(&mut self, val: u16_) {
8984 unsafe {
8985 let val: u16 = ::core::mem::transmute(val);
8986 self._bitfield_1.set(15usize, 1u8, val as u64)
8987 }
8988 }
8989 #[inline]
8990 pub unsafe fn _pad_raw(this: *const Self) -> u16_ {
8991 unsafe {
8992 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get(
8993 ::core::ptr::addr_of!((*this)._bitfield_1),
8994 15usize,
8995 1u8,
8996 ) as u16)
8997 }
8998 }
8999 #[inline]
9000 pub unsafe fn set__pad_raw(this: *mut Self, val: u16_) {
9001 unsafe {
9002 let val: u16 = ::core::mem::transmute(val);
9003 <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set(
9004 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
9005 15usize,
9006 1u8,
9007 val as u64,
9008 )
9009 }
9010 }
9011 #[inline]
9012 pub fn new_bitfield_1(
9013 enable: bool,
9014 scale: u16_,
9015 xpos: u16_,
9016 ypos: u16_,
9017 _pad: u16_,
9018 ) -> __BindgenBitfieldUnit<[u8; 2usize]> {
9019 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
9020 __bindgen_bitfield_unit.set(0usize, 1u8, {
9021 let enable: u8 = unsafe { ::core::mem::transmute(enable) };
9022 enable as u64
9023 });
9024 __bindgen_bitfield_unit.set(1usize, 4u8, {
9025 let scale: u16 = unsafe { ::core::mem::transmute(scale) };
9026 scale as u64
9027 });
9028 __bindgen_bitfield_unit.set(5usize, 5u8, {
9029 let xpos: u16 = unsafe { ::core::mem::transmute(xpos) };
9030 xpos as u64
9031 });
9032 __bindgen_bitfield_unit.set(10usize, 5u8, {
9033 let ypos: u16 = unsafe { ::core::mem::transmute(ypos) };
9034 ypos as u64
9035 });
9036 __bindgen_bitfield_unit.set(15usize, 1u8, {
9037 let _pad: u16 = unsafe { ::core::mem::transmute(_pad) };
9038 _pad as u64
9039 });
9040 __bindgen_bitfield_unit
9041 }
9042}
9043#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9044const _: () = {
9045 ["Size of MiiData"][::core::mem::size_of::<MiiData>() - 92usize];
9046 ["Alignment of MiiData"][::core::mem::align_of::<MiiData>() - 1usize];
9047 ["Offset of field: MiiData::version"][::core::mem::offset_of!(MiiData, version) - 0usize];
9048 ["Offset of field: MiiData::mii_options"]
9049 [::core::mem::offset_of!(MiiData, mii_options) - 1usize];
9050 ["Offset of field: MiiData::mii_pos"][::core::mem::offset_of!(MiiData, mii_pos) - 2usize];
9051 ["Offset of field: MiiData::console_identity"]
9052 [::core::mem::offset_of!(MiiData, console_identity) - 3usize];
9053 ["Offset of field: MiiData::system_id"][::core::mem::offset_of!(MiiData, system_id) - 4usize];
9054 ["Offset of field: MiiData::mii_id"][::core::mem::offset_of!(MiiData, mii_id) - 12usize];
9055 ["Offset of field: MiiData::mac"][::core::mem::offset_of!(MiiData, mac) - 16usize];
9056 ["Offset of field: MiiData::pad"][::core::mem::offset_of!(MiiData, pad) - 22usize];
9057 ["Offset of field: MiiData::mii_details"]
9058 [::core::mem::offset_of!(MiiData, mii_details) - 24usize];
9059 ["Offset of field: MiiData::mii_name"][::core::mem::offset_of!(MiiData, mii_name) - 26usize];
9060 ["Offset of field: MiiData::height"][::core::mem::offset_of!(MiiData, height) - 46usize];
9061 ["Offset of field: MiiData::width"][::core::mem::offset_of!(MiiData, width) - 47usize];
9062 ["Offset of field: MiiData::face_style"]
9063 [::core::mem::offset_of!(MiiData, face_style) - 48usize];
9064 ["Offset of field: MiiData::face_details"]
9065 [::core::mem::offset_of!(MiiData, face_details) - 49usize];
9066 ["Offset of field: MiiData::hair_style"]
9067 [::core::mem::offset_of!(MiiData, hair_style) - 50usize];
9068 ["Offset of field: MiiData::hair_details"]
9069 [::core::mem::offset_of!(MiiData, hair_details) - 51usize];
9070 ["Offset of field: MiiData::eye_details"]
9071 [::core::mem::offset_of!(MiiData, eye_details) - 52usize];
9072 ["Offset of field: MiiData::eyebrow_details"]
9073 [::core::mem::offset_of!(MiiData, eyebrow_details) - 56usize];
9074 ["Offset of field: MiiData::nose_details"]
9075 [::core::mem::offset_of!(MiiData, nose_details) - 60usize];
9076 ["Offset of field: MiiData::mouth_details"]
9077 [::core::mem::offset_of!(MiiData, mouth_details) - 62usize];
9078 ["Offset of field: MiiData::mustache_details"]
9079 [::core::mem::offset_of!(MiiData, mustache_details) - 64usize];
9080 ["Offset of field: MiiData::beard_details"]
9081 [::core::mem::offset_of!(MiiData, beard_details) - 66usize];
9082 ["Offset of field: MiiData::glasses_details"]
9083 [::core::mem::offset_of!(MiiData, glasses_details) - 68usize];
9084 ["Offset of field: MiiData::mole_details"]
9085 [::core::mem::offset_of!(MiiData, mole_details) - 70usize];
9086 ["Offset of field: MiiData::author_name"]
9087 [::core::mem::offset_of!(MiiData, author_name) - 72usize];
9088};
9089pub type FriendComment = [u16_; 17usize];
9090pub type FriendGameModeDescription = [u16_; 128usize];
9091pub type ScrambledFriendCode = [u16_; 6usize];
9092pub type NfsTypeStr = [::libc::c_char; 3usize];
9093#[doc = "Friend key data"]
9094#[repr(C, packed)]
9095#[derive(Debug, Default, Copy, Clone)]
9096pub struct FriendKey {
9097 pub principalId: u32_,
9098 pub padding: u32_,
9099 pub localFriendCode: u64_,
9100}
9101#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9102const _: () = {
9103 ["Size of FriendKey"][::core::mem::size_of::<FriendKey>() - 16usize];
9104 ["Alignment of FriendKey"][::core::mem::align_of::<FriendKey>() - 1usize];
9105 ["Offset of field: FriendKey::principalId"]
9106 [::core::mem::offset_of!(FriendKey, principalId) - 0usize];
9107 ["Offset of field: FriendKey::padding"][::core::mem::offset_of!(FriendKey, padding) - 4usize];
9108 ["Offset of field: FriendKey::localFriendCode"]
9109 [::core::mem::offset_of!(FriendKey, localFriendCode) - 8usize];
9110};
9111#[doc = "Game key data"]
9112#[repr(C, packed)]
9113#[derive(Debug, Default, Copy, Clone)]
9114pub struct GameKey {
9115 pub titleId: u64_,
9116 pub version: u16_,
9117 pub reserved: [u8_; 6usize],
9118}
9119#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9120const _: () = {
9121 ["Size of GameKey"][::core::mem::size_of::<GameKey>() - 16usize];
9122 ["Alignment of GameKey"][::core::mem::align_of::<GameKey>() - 1usize];
9123 ["Offset of field: GameKey::titleId"][::core::mem::offset_of!(GameKey, titleId) - 0usize];
9124 ["Offset of field: GameKey::version"][::core::mem::offset_of!(GameKey, version) - 8usize];
9125 ["Offset of field: GameKey::reserved"][::core::mem::offset_of!(GameKey, reserved) - 10usize];
9126};
9127#[doc = "Base profile data"]
9128#[repr(C)]
9129#[derive(Debug, Default, Copy, Clone)]
9130pub struct Profile {
9131 #[doc = "< The region code for the hardware."]
9132 pub region: u8_,
9133 #[doc = "< Country code."]
9134 pub country: u8_,
9135 #[doc = "< Area code."]
9136 pub area: u8_,
9137 #[doc = "< Language code."]
9138 pub language: u8_,
9139 #[doc = "< Platform code."]
9140 pub platform: u8_,
9141 pub padding: [u8_; 3usize],
9142}
9143#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9144const _: () = {
9145 ["Size of Profile"][::core::mem::size_of::<Profile>() - 8usize];
9146 ["Alignment of Profile"][::core::mem::align_of::<Profile>() - 1usize];
9147 ["Offset of field: Profile::region"][::core::mem::offset_of!(Profile, region) - 0usize];
9148 ["Offset of field: Profile::country"][::core::mem::offset_of!(Profile, country) - 1usize];
9149 ["Offset of field: Profile::area"][::core::mem::offset_of!(Profile, area) - 2usize];
9150 ["Offset of field: Profile::language"][::core::mem::offset_of!(Profile, language) - 3usize];
9151 ["Offset of field: Profile::platform"][::core::mem::offset_of!(Profile, platform) - 4usize];
9152 ["Offset of field: Profile::padding"][::core::mem::offset_of!(Profile, padding) - 5usize];
9153};
9154#[doc = "Friend profile data"]
9155#[repr(C, packed)]
9156#[derive(Debug, Default, Copy, Clone)]
9157pub struct FriendProfile {
9158 #[doc = "< Base profile data of this friend."]
9159 pub profile: Profile,
9160 #[doc = "< Favorite game of this friend."]
9161 pub favoriteGame: GameKey,
9162 #[doc = "< NC PrincipalID of this friend."]
9163 pub ncPrincipalId: u32_,
9164 #[doc = "< Personal message (comment) of this friend."]
9165 pub personalMessage: FriendComment,
9166 pub pad: [u8_; 2usize],
9167 #[doc = "< NEX timestamp of when this friend was last seen online."]
9168 pub lastOnlineTimestamp: s64,
9169}
9170#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9171const _: () = {
9172 ["Size of FriendProfile"][::core::mem::size_of::<FriendProfile>() - 72usize];
9173 ["Alignment of FriendProfile"][::core::mem::align_of::<FriendProfile>() - 1usize];
9174 ["Offset of field: FriendProfile::profile"]
9175 [::core::mem::offset_of!(FriendProfile, profile) - 0usize];
9176 ["Offset of field: FriendProfile::favoriteGame"]
9177 [::core::mem::offset_of!(FriendProfile, favoriteGame) - 8usize];
9178 ["Offset of field: FriendProfile::ncPrincipalId"]
9179 [::core::mem::offset_of!(FriendProfile, ncPrincipalId) - 24usize];
9180 ["Offset of field: FriendProfile::personalMessage"]
9181 [::core::mem::offset_of!(FriendProfile, personalMessage) - 28usize];
9182 ["Offset of field: FriendProfile::pad"][::core::mem::offset_of!(FriendProfile, pad) - 62usize];
9183 ["Offset of field: FriendProfile::lastOnlineTimestamp"]
9184 [::core::mem::offset_of!(FriendProfile, lastOnlineTimestamp) - 64usize];
9185};
9186#[doc = "Base presence data"]
9187#[repr(C, packed)]
9188#[derive(Debug, Default, Copy, Clone)]
9189pub struct Presence {
9190 pub joinAvailabilityFlag: u32_,
9191 pub matchmakeSystemType: u32_,
9192 pub joinGameId: u32_,
9193 pub joinGameMode: u32_,
9194 pub ownerPrincipalId: u32_,
9195 pub joinGroupId: u32_,
9196 pub applicationArg: [u8_; 20usize],
9197}
9198#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9199const _: () = {
9200 ["Size of Presence"][::core::mem::size_of::<Presence>() - 44usize];
9201 ["Alignment of Presence"][::core::mem::align_of::<Presence>() - 1usize];
9202 ["Offset of field: Presence::joinAvailabilityFlag"]
9203 [::core::mem::offset_of!(Presence, joinAvailabilityFlag) - 0usize];
9204 ["Offset of field: Presence::matchmakeSystemType"]
9205 [::core::mem::offset_of!(Presence, matchmakeSystemType) - 4usize];
9206 ["Offset of field: Presence::joinGameId"]
9207 [::core::mem::offset_of!(Presence, joinGameId) - 8usize];
9208 ["Offset of field: Presence::joinGameMode"]
9209 [::core::mem::offset_of!(Presence, joinGameMode) - 12usize];
9210 ["Offset of field: Presence::ownerPrincipalId"]
9211 [::core::mem::offset_of!(Presence, ownerPrincipalId) - 16usize];
9212 ["Offset of field: Presence::joinGroupId"]
9213 [::core::mem::offset_of!(Presence, joinGroupId) - 20usize];
9214 ["Offset of field: Presence::applicationArg"]
9215 [::core::mem::offset_of!(Presence, applicationArg) - 24usize];
9216};
9217#[doc = "Current user's presence data"]
9218#[repr(C, packed)]
9219#[derive(Debug, Copy, Clone)]
9220pub struct MyPresence {
9221 #[doc = "< The actual presence data."]
9222 pub presence: Presence,
9223 #[doc = "< The game mode description of the current user."]
9224 pub gameModeDescription: FriendGameModeDescription,
9225}
9226#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9227const _: () = {
9228 ["Size of MyPresence"][::core::mem::size_of::<MyPresence>() - 300usize];
9229 ["Alignment of MyPresence"][::core::mem::align_of::<MyPresence>() - 1usize];
9230 ["Offset of field: MyPresence::presence"]
9231 [::core::mem::offset_of!(MyPresence, presence) - 0usize];
9232 ["Offset of field: MyPresence::gameModeDescription"]
9233 [::core::mem::offset_of!(MyPresence, gameModeDescription) - 44usize];
9234};
9235impl Default for MyPresence {
9236 fn default() -> Self {
9237 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
9238 unsafe {
9239 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
9240 s.assume_init()
9241 }
9242 }
9243}
9244#[doc = "Friend presence data"]
9245#[repr(C)]
9246#[derive(Debug, Default, Copy, Clone)]
9247pub struct FriendPresence {
9248 #[doc = "< The actual presence data."]
9249 pub presence: Presence,
9250 #[doc = "< Whether or not the presence data for this user has been loaded from the server."]
9251 pub isPresenceLoaded: bool,
9252 #[doc = "< Whether or not this friend has sent the current user an invitation."]
9253 pub hasSentInvitation: bool,
9254 #[doc = "< Whether or not this friend was found."]
9255 pub found: bool,
9256 pub pad: u8_,
9257}
9258#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9259const _: () = {
9260 ["Size of FriendPresence"][::core::mem::size_of::<FriendPresence>() - 48usize];
9261 ["Alignment of FriendPresence"][::core::mem::align_of::<FriendPresence>() - 1usize];
9262 ["Offset of field: FriendPresence::presence"]
9263 [::core::mem::offset_of!(FriendPresence, presence) - 0usize];
9264 ["Offset of field: FriendPresence::isPresenceLoaded"]
9265 [::core::mem::offset_of!(FriendPresence, isPresenceLoaded) - 44usize];
9266 ["Offset of field: FriendPresence::hasSentInvitation"]
9267 [::core::mem::offset_of!(FriendPresence, hasSentInvitation) - 45usize];
9268 ["Offset of field: FriendPresence::found"]
9269 [::core::mem::offset_of!(FriendPresence, found) - 46usize];
9270 ["Offset of field: FriendPresence::pad"]
9271 [::core::mem::offset_of!(FriendPresence, pad) - 47usize];
9272};
9273#[doc = "Friend Mii data"]
9274#[repr(C)]
9275#[derive(Debug, Default, Copy, Clone)]
9276pub struct FriendMii {
9277 #[doc = "< Whether or not the Mii contains profanity."]
9278 pub profanityFlag: bool,
9279 #[doc = "< The character set for text data."]
9280 pub characterSet: u8_,
9281 #[doc = "< Whether or not the Mii is marked as \"dirty\" (needs to be uploaded to the server)."]
9282 pub dirtyFlag: bool,
9283 pub pad: u8_,
9284 #[doc = "< The actual Mii data."]
9285 pub mii: MiiData,
9286}
9287#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9288const _: () = {
9289 ["Size of FriendMii"][::core::mem::size_of::<FriendMii>() - 96usize];
9290 ["Alignment of FriendMii"][::core::mem::align_of::<FriendMii>() - 1usize];
9291 ["Offset of field: FriendMii::profanityFlag"]
9292 [::core::mem::offset_of!(FriendMii, profanityFlag) - 0usize];
9293 ["Offset of field: FriendMii::characterSet"]
9294 [::core::mem::offset_of!(FriendMii, characterSet) - 1usize];
9295 ["Offset of field: FriendMii::dirtyFlag"]
9296 [::core::mem::offset_of!(FriendMii, dirtyFlag) - 2usize];
9297 ["Offset of field: FriendMii::pad"][::core::mem::offset_of!(FriendMii, pad) - 3usize];
9298 ["Offset of field: FriendMii::mii"][::core::mem::offset_of!(FriendMii, mii) - 4usize];
9299};
9300#[doc = "Friend playing game structure"]
9301#[repr(C, packed)]
9302#[derive(Debug, Copy, Clone)]
9303pub struct FriendPlayingGame {
9304 #[doc = "< Game key of the game."]
9305 pub game: GameKey,
9306 pub gameModeDescription: FriendGameModeDescription,
9307}
9308#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9309const _: () = {
9310 ["Size of FriendPlayingGame"][::core::mem::size_of::<FriendPlayingGame>() - 272usize];
9311 ["Alignment of FriendPlayingGame"][::core::mem::align_of::<FriendPlayingGame>() - 1usize];
9312 ["Offset of field: FriendPlayingGame::game"]
9313 [::core::mem::offset_of!(FriendPlayingGame, game) - 0usize];
9314 ["Offset of field: FriendPlayingGame::gameModeDescription"]
9315 [::core::mem::offset_of!(FriendPlayingGame, gameModeDescription) - 16usize];
9316};
9317impl Default for FriendPlayingGame {
9318 fn default() -> Self {
9319 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
9320 unsafe {
9321 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
9322 s.assume_init()
9323 }
9324 }
9325}
9326#[doc = "Friend info structure"]
9327#[repr(C, packed)]
9328#[derive(Debug, Default, Copy, Clone)]
9329pub struct FriendInfo {
9330 #[doc = "< FriendKey of this friend."]
9331 pub friendKey: FriendKey,
9332 #[doc = "< NEX timestamp of when this friend was added to the current user's friend list."]
9333 pub addedTimestamp: s64,
9334 #[doc = "< The type of the relationship with this friend."]
9335 pub relationship: u8_,
9336 pub pad: [u8_; 7usize],
9337 #[doc = "< Friend profile data of this friend."]
9338 pub friendProfile: FriendProfile,
9339 #[doc = "< The screen name of this friend."]
9340 pub screenName: MiiScreenName,
9341 #[doc = "< The character set used for the text parts of the data of this friend."]
9342 pub characterSet: u8_,
9343 pub pad2: u8_,
9344 #[doc = "< The Mii of this friend."]
9345 pub mii: FriendMii,
9346}
9347#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9348const _: () = {
9349 ["Size of FriendInfo"][::core::mem::size_of::<FriendInfo>() - 224usize];
9350 ["Alignment of FriendInfo"][::core::mem::align_of::<FriendInfo>() - 1usize];
9351 ["Offset of field: FriendInfo::friendKey"]
9352 [::core::mem::offset_of!(FriendInfo, friendKey) - 0usize];
9353 ["Offset of field: FriendInfo::addedTimestamp"]
9354 [::core::mem::offset_of!(FriendInfo, addedTimestamp) - 16usize];
9355 ["Offset of field: FriendInfo::relationship"]
9356 [::core::mem::offset_of!(FriendInfo, relationship) - 24usize];
9357 ["Offset of field: FriendInfo::pad"][::core::mem::offset_of!(FriendInfo, pad) - 25usize];
9358 ["Offset of field: FriendInfo::friendProfile"]
9359 [::core::mem::offset_of!(FriendInfo, friendProfile) - 32usize];
9360 ["Offset of field: FriendInfo::screenName"]
9361 [::core::mem::offset_of!(FriendInfo, screenName) - 104usize];
9362 ["Offset of field: FriendInfo::characterSet"]
9363 [::core::mem::offset_of!(FriendInfo, characterSet) - 126usize];
9364 ["Offset of field: FriendInfo::pad2"][::core::mem::offset_of!(FriendInfo, pad2) - 127usize];
9365 ["Offset of field: FriendInfo::mii"][::core::mem::offset_of!(FriendInfo, mii) - 128usize];
9366};
9367#[doc = "Friend Notification Event structure"]
9368#[repr(C)]
9369#[derive(Debug, Default, Copy, Clone)]
9370pub struct NotificationEvent {
9371 #[doc = "< Type of event."]
9372 pub type_: u8_,
9373 pub padding: [u8_; 7usize],
9374 #[doc = "< Friend key of friend who caused this notification event to be sent."]
9375 pub sender: FriendKey,
9376}
9377#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9378const _: () = {
9379 ["Size of NotificationEvent"][::core::mem::size_of::<NotificationEvent>() - 24usize];
9380 ["Alignment of NotificationEvent"][::core::mem::align_of::<NotificationEvent>() - 1usize];
9381 ["Offset of field: NotificationEvent::type_"]
9382 [::core::mem::offset_of!(NotificationEvent, type_) - 0usize];
9383 ["Offset of field: NotificationEvent::padding"]
9384 [::core::mem::offset_of!(NotificationEvent, padding) - 1usize];
9385 ["Offset of field: NotificationEvent::sender"]
9386 [::core::mem::offset_of!(NotificationEvent, sender) - 8usize];
9387};
9388#[doc = "Game Authentication Data structure"]
9389#[repr(C, packed)]
9390#[derive(Debug, Copy, Clone)]
9391pub struct GameAuthenticationData {
9392 #[doc = "< NASC result code for the LOGIN operation."]
9393 pub nascResult: u32_,
9394 #[doc = "< HTTP status code for the NASC LOGIN operation."]
9395 pub httpStatusCode: u32_,
9396 #[doc = "< Address of the game server."]
9397 pub serverAddress: [::libc::c_char; 32usize],
9398 #[doc = "< Port of the game server."]
9399 pub serverPort: u16_,
9400 pub pad: [u8_; 6usize],
9401 #[doc = "< Game server authentication token."]
9402 pub authToken: [::libc::c_char; 256usize],
9403 #[doc = "< NEX timestamp for current server time."]
9404 pub serverTime: u64_,
9405}
9406#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9407const _: () = {
9408 ["Size of GameAuthenticationData"][::core::mem::size_of::<GameAuthenticationData>() - 312usize];
9409 ["Alignment of GameAuthenticationData"]
9410 [::core::mem::align_of::<GameAuthenticationData>() - 1usize];
9411 ["Offset of field: GameAuthenticationData::nascResult"]
9412 [::core::mem::offset_of!(GameAuthenticationData, nascResult) - 0usize];
9413 ["Offset of field: GameAuthenticationData::httpStatusCode"]
9414 [::core::mem::offset_of!(GameAuthenticationData, httpStatusCode) - 4usize];
9415 ["Offset of field: GameAuthenticationData::serverAddress"]
9416 [::core::mem::offset_of!(GameAuthenticationData, serverAddress) - 8usize];
9417 ["Offset of field: GameAuthenticationData::serverPort"]
9418 [::core::mem::offset_of!(GameAuthenticationData, serverPort) - 40usize];
9419 ["Offset of field: GameAuthenticationData::pad"]
9420 [::core::mem::offset_of!(GameAuthenticationData, pad) - 42usize];
9421 ["Offset of field: GameAuthenticationData::authToken"]
9422 [::core::mem::offset_of!(GameAuthenticationData, authToken) - 48usize];
9423 ["Offset of field: GameAuthenticationData::serverTime"]
9424 [::core::mem::offset_of!(GameAuthenticationData, serverTime) - 304usize];
9425};
9426impl Default for GameAuthenticationData {
9427 fn default() -> Self {
9428 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
9429 unsafe {
9430 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
9431 s.assume_init()
9432 }
9433 }
9434}
9435#[doc = "Service Locator Data strcture"]
9436#[repr(C, packed)]
9437#[derive(Debug, Copy, Clone)]
9438pub struct ServiceLocatorData {
9439 #[doc = "< NASC result code for the SVCLOC operation."]
9440 pub nascResult: u32_,
9441 #[doc = "< HTTP status code for the NASC LOGIN operation."]
9442 pub httpStatusCode: u32_,
9443 #[doc = "< Host address of the target service."]
9444 pub serviceHost: [::libc::c_char; 128usize],
9445 #[doc = "< Token for the target service."]
9446 pub serviceToken: [::libc::c_char; 256usize],
9447 #[doc = "< `statusdata` value from the NASC response data."]
9448 pub statusData: u8_,
9449 pub padding: [u8_; 7usize],
9450 #[doc = "< NEX timestamp for current server time."]
9451 pub serverTime: u64_,
9452}
9453#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9454const _: () = {
9455 ["Size of ServiceLocatorData"][::core::mem::size_of::<ServiceLocatorData>() - 408usize];
9456 ["Alignment of ServiceLocatorData"][::core::mem::align_of::<ServiceLocatorData>() - 1usize];
9457 ["Offset of field: ServiceLocatorData::nascResult"]
9458 [::core::mem::offset_of!(ServiceLocatorData, nascResult) - 0usize];
9459 ["Offset of field: ServiceLocatorData::httpStatusCode"]
9460 [::core::mem::offset_of!(ServiceLocatorData, httpStatusCode) - 4usize];
9461 ["Offset of field: ServiceLocatorData::serviceHost"]
9462 [::core::mem::offset_of!(ServiceLocatorData, serviceHost) - 8usize];
9463 ["Offset of field: ServiceLocatorData::serviceToken"]
9464 [::core::mem::offset_of!(ServiceLocatorData, serviceToken) - 136usize];
9465 ["Offset of field: ServiceLocatorData::statusData"]
9466 [::core::mem::offset_of!(ServiceLocatorData, statusData) - 392usize];
9467 ["Offset of field: ServiceLocatorData::padding"]
9468 [::core::mem::offset_of!(ServiceLocatorData, padding) - 393usize];
9469 ["Offset of field: ServiceLocatorData::serverTime"]
9470 [::core::mem::offset_of!(ServiceLocatorData, serverTime) - 400usize];
9471};
9472impl Default for ServiceLocatorData {
9473 fn default() -> Self {
9474 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
9475 unsafe {
9476 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
9477 s.assume_init()
9478 }
9479 }
9480}
9481#[doc = "Encrypted inner Approach Context structure"]
9482#[repr(C, packed)]
9483#[derive(Debug, Copy, Clone)]
9484pub struct ApproachContext {
9485 pub friendProfile: FriendProfile,
9486 pub hasMii: bool,
9487 pub profanityFlag: bool,
9488 pub characterSet: u8_,
9489 pub wrappedMii: [u8_; 112usize],
9490 pub screenName: MiiScreenName,
9491 pub reserved: [u8_; 271usize],
9492}
9493#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9494const _: () = {
9495 ["Size of ApproachContext"][::core::mem::size_of::<ApproachContext>() - 480usize];
9496 ["Alignment of ApproachContext"][::core::mem::align_of::<ApproachContext>() - 1usize];
9497 ["Offset of field: ApproachContext::friendProfile"]
9498 [::core::mem::offset_of!(ApproachContext, friendProfile) - 0usize];
9499 ["Offset of field: ApproachContext::hasMii"]
9500 [::core::mem::offset_of!(ApproachContext, hasMii) - 72usize];
9501 ["Offset of field: ApproachContext::profanityFlag"]
9502 [::core::mem::offset_of!(ApproachContext, profanityFlag) - 73usize];
9503 ["Offset of field: ApproachContext::characterSet"]
9504 [::core::mem::offset_of!(ApproachContext, characterSet) - 74usize];
9505 ["Offset of field: ApproachContext::wrappedMii"]
9506 [::core::mem::offset_of!(ApproachContext, wrappedMii) - 75usize];
9507 ["Offset of field: ApproachContext::screenName"]
9508 [::core::mem::offset_of!(ApproachContext, screenName) - 187usize];
9509 ["Offset of field: ApproachContext::reserved"]
9510 [::core::mem::offset_of!(ApproachContext, reserved) - 209usize];
9511};
9512impl Default for ApproachContext {
9513 fn default() -> Self {
9514 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
9515 unsafe {
9516 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
9517 s.assume_init()
9518 }
9519 }
9520}
9521#[doc = "Encrypted Approach Context structure"]
9522#[repr(C)]
9523#[derive(Debug, Copy, Clone)]
9524pub struct EncryptedApproachContext {
9525 pub unknown0: u8_,
9526 pub unknown1: u8_,
9527 pub unknown2: u8_,
9528 pub unknown3: u8_,
9529 pub nonce: EncryptedApproachContext__bindgen_ty_1,
9530 pub encryptedPayload: ApproachContext,
9531 pub ccmMac: [u8_; 16usize],
9532}
9533#[repr(C, packed)]
9534#[derive(Debug, Default, Copy, Clone)]
9535pub struct EncryptedApproachContext__bindgen_ty_1 {
9536 pub principalId: u32_,
9537 pub friendCode: u64_,
9538}
9539#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9540const _: () = {
9541 ["Size of EncryptedApproachContext__bindgen_ty_1"]
9542 [::core::mem::size_of::<EncryptedApproachContext__bindgen_ty_1>() - 12usize];
9543 ["Alignment of EncryptedApproachContext__bindgen_ty_1"]
9544 [::core::mem::align_of::<EncryptedApproachContext__bindgen_ty_1>() - 1usize];
9545 ["Offset of field: EncryptedApproachContext__bindgen_ty_1::principalId"]
9546 [::core::mem::offset_of!(EncryptedApproachContext__bindgen_ty_1, principalId) - 0usize];
9547 ["Offset of field: EncryptedApproachContext__bindgen_ty_1::friendCode"]
9548 [::core::mem::offset_of!(EncryptedApproachContext__bindgen_ty_1, friendCode) - 4usize];
9549};
9550#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9551const _: () = {
9552 ["Size of EncryptedApproachContext"]
9553 [::core::mem::size_of::<EncryptedApproachContext>() - 512usize];
9554 ["Alignment of EncryptedApproachContext"]
9555 [::core::mem::align_of::<EncryptedApproachContext>() - 1usize];
9556 ["Offset of field: EncryptedApproachContext::unknown0"]
9557 [::core::mem::offset_of!(EncryptedApproachContext, unknown0) - 0usize];
9558 ["Offset of field: EncryptedApproachContext::unknown1"]
9559 [::core::mem::offset_of!(EncryptedApproachContext, unknown1) - 1usize];
9560 ["Offset of field: EncryptedApproachContext::unknown2"]
9561 [::core::mem::offset_of!(EncryptedApproachContext, unknown2) - 2usize];
9562 ["Offset of field: EncryptedApproachContext::unknown3"]
9563 [::core::mem::offset_of!(EncryptedApproachContext, unknown3) - 3usize];
9564 ["Offset of field: EncryptedApproachContext::nonce"]
9565 [::core::mem::offset_of!(EncryptedApproachContext, nonce) - 4usize];
9566 ["Offset of field: EncryptedApproachContext::encryptedPayload"]
9567 [::core::mem::offset_of!(EncryptedApproachContext, encryptedPayload) - 16usize];
9568 ["Offset of field: EncryptedApproachContext::ccmMac"]
9569 [::core::mem::offset_of!(EncryptedApproachContext, ccmMac) - 496usize];
9570};
9571impl Default for EncryptedApproachContext {
9572 fn default() -> Self {
9573 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
9574 unsafe {
9575 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
9576 s.assume_init()
9577 }
9578 }
9579}
9580#[doc = "Decrypted Approach Context structure"]
9581#[repr(C, packed)]
9582#[derive(Debug, Copy, Clone)]
9583pub struct DecryptedApproachContext {
9584 pub unknown0: u8_,
9585 pub unknown1: u8_,
9586 pub unknown2: u8_,
9587 pub unknown3: u8_,
9588 #[doc = "< Whether or not this friend has a Mii."]
9589 pub hasMii: bool,
9590 pub profanityFlag: bool,
9591 #[doc = "< Character set for text data."]
9592 pub characterSet: u8_,
9593 pub pad: u8_,
9594 #[doc = "< Friend key of this friend."]
9595 pub friendKey: FriendKey,
9596 #[doc = "< Friend profile of this friend."]
9597 pub friendProfile: FriendProfile,
9598 #[doc = "< Mii data of this friend."]
9599 pub mii: FriendMii,
9600 #[doc = "< UTF-16 screen name of this friend."]
9601 pub screenName: MiiScreenName,
9602 pub reserved: [u8_; 298usize],
9603}
9604#[allow(clippy::unnecessary_operation, clippy::identity_op)]
9605const _: () = {
9606 ["Size of DecryptedApproachContext"]
9607 [::core::mem::size_of::<DecryptedApproachContext>() - 512usize];
9608 ["Alignment of DecryptedApproachContext"]
9609 [::core::mem::align_of::<DecryptedApproachContext>() - 1usize];
9610 ["Offset of field: DecryptedApproachContext::unknown0"]
9611 [::core::mem::offset_of!(DecryptedApproachContext, unknown0) - 0usize];
9612 ["Offset of field: DecryptedApproachContext::unknown1"]
9613 [::core::mem::offset_of!(DecryptedApproachContext, unknown1) - 1usize];
9614 ["Offset of field: DecryptedApproachContext::unknown2"]
9615 [::core::mem::offset_of!(DecryptedApproachContext, unknown2) - 2usize];
9616 ["Offset of field: DecryptedApproachContext::unknown3"]
9617 [::core::mem::offset_of!(DecryptedApproachContext, unknown3) - 3usize];
9618 ["Offset of field: DecryptedApproachContext::hasMii"]
9619 [::core::mem::offset_of!(DecryptedApproachContext, hasMii) - 4usize];
9620 ["Offset of field: DecryptedApproachContext::profanityFlag"]
9621 [::core::mem::offset_of!(DecryptedApproachContext, profanityFlag) - 5usize];
9622 ["Offset of field: DecryptedApproachContext::characterSet"]
9623 [::core::mem::offset_of!(DecryptedApproachContext, characterSet) - 6usize];
9624 ["Offset of field: DecryptedApproachContext::pad"]
9625 [::core::mem::offset_of!(DecryptedApproachContext, pad) - 7usize];
9626 ["Offset of field: DecryptedApproachContext::friendKey"]
9627 [::core::mem::offset_of!(DecryptedApproachContext, friendKey) - 8usize];
9628 ["Offset of field: DecryptedApproachContext::friendProfile"]
9629 [::core::mem::offset_of!(DecryptedApproachContext, friendProfile) - 24usize];
9630 ["Offset of field: DecryptedApproachContext::mii"]
9631 [::core::mem::offset_of!(DecryptedApproachContext, mii) - 96usize];
9632 ["Offset of field: DecryptedApproachContext::screenName"]
9633 [::core::mem::offset_of!(DecryptedApproachContext, screenName) - 192usize];
9634 ["Offset of field: DecryptedApproachContext::reserved"]
9635 [::core::mem::offset_of!(DecryptedApproachContext, reserved) - 214usize];
9636};
9637impl Default for DecryptedApproachContext {
9638 fn default() -> Self {
9639 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
9640 unsafe {
9641 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
9642 s.assume_init()
9643 }
9644 }
9645}
9646#[doc = "< Character set for JPN, USA, and EUR(+AUS)."]
9647pub const CHARSET_JPN_USA_EUR: CharacterSet = 0;
9648#[doc = "< Character set for CHN."]
9649pub const CHARSET_CHN: CharacterSet = 1;
9650#[doc = "< Character set for KOR."]
9651pub const CHARSET_KOR: CharacterSet = 2;
9652#[doc = "< Character set for TWN."]
9653pub const CHARSET_TWN: CharacterSet = 3;
9654#[doc = "Enum for character set"]
9655pub type CharacterSet = ::libc::c_uchar;
9656pub const NASC_SUCCESS: NASCResult = 1;
9657pub const NASC_SERVER_UNDER_MAINTENANCE: NASCResult = 101;
9658pub const NASC_DEVICE_BANNED: NASCResult = 102;
9659pub const NASC_INVALID_PRODUCT_CODE: NASCResult = 107;
9660pub const NASC_INVALID_REQUEST_PARAM: NASCResult = 109;
9661pub const NASC_SERVER_NO_LONGER_AVAILABLE: NASCResult = 110;
9662pub const NASC_INVALID_SVC: NASCResult = 112;
9663pub const NASC_INVALID_FPD_VERSION: NASCResult = 119;
9664pub const NASC_INVALID_TITLE_VERSION: NASCResult = 120;
9665pub const NASC_INVALID_DEVICE_CERTIFICATE: NASCResult = 121;
9666pub const NASC_INVALID_PID_HMAC: NASCResult = 122;
9667pub const NASC_BANNED_ROM_ID: NASCResult = 123;
9668pub const NASC_INVALID_GAME_ID: NASCResult = 125;
9669pub const NASC_INVALID_KEY_HASH: NASCResult = 127;
9670#[doc = "Enum for NASC Result"]
9671pub type NASCResult = ::libc::c_uchar;
9672pub const NASC_PRODUCTION: NASCEnvironment = 0;
9673pub const NASC_TESTING: NASCEnvironment = 1;
9674pub const NASC_DEVELOPMENT: NASCEnvironment = 2;
9675#[doc = "Enum for NASC Server Environment"]
9676pub type NASCEnvironment = ::libc::c_uchar;
9677#[doc = "< Self went online"]
9678pub const USER_WENT_ONLINE: FriendNotificationTypes = 1;
9679#[doc = "< Self went offline"]
9680pub const USER_WENT_OFFLINE: FriendNotificationTypes = 2;
9681#[doc = "< Friend Went Online"]
9682pub const FRIEND_WENT_ONLINE: FriendNotificationTypes = 3;
9683#[doc = "< Friend Presence changed (with matching GameJoinID)"]
9684pub const FRIEND_UPDATED_PRESENCE: FriendNotificationTypes = 4;
9685#[doc = "< Friend Mii changed"]
9686pub const FRIEND_UPDATED_MII: FriendNotificationTypes = 5;
9687#[doc = "< Friend Profile changed"]
9688pub const FRIEND_UPDATED_PROFILE: FriendNotificationTypes = 6;
9689#[doc = "< Friend went offline"]
9690pub const FRIEND_WENT_OFFLINE: FriendNotificationTypes = 7;
9691#[doc = "< Friend registered self as friend"]
9692pub const FRIEND_REGISTERED_USER: FriendNotificationTypes = 8;
9693#[doc = "< Friend sent invitation (with matching GameJoinID)"]
9694pub const FRIEND_SENT_JOINABLE_INVITATION: FriendNotificationTypes = 9;
9695#[doc = "< Friend changed game mode description"]
9696pub const FRIEND_CHANGED_GAME_MODE_DESCRIPTION: FriendNotificationTypes = 145;
9697#[doc = "< Friend changed favorite game"]
9698pub const FRIEND_CHANGED_FAVORITE_GAME: FriendNotificationTypes = 146;
9699#[doc = "< Friend changed comment"]
9700pub const FRIEND_CHANGED_COMMENT: FriendNotificationTypes = 147;
9701#[doc = "< Friend Presence changed (with nonmatching GameJoinID)"]
9702pub const FRIEND_CHANGED_ANY_PRESENCE: FriendNotificationTypes = 148;
9703#[doc = "< Friend sent invitiation (with nonmatching GameJoinID)"]
9704pub const FRIEND_SENT_ANY_INVITATION: FriendNotificationTypes = 149;
9705#[doc = "Enum for notification event types"]
9706pub type FriendNotificationTypes = ::libc::c_uchar;
9707pub const MASK_USER_WENT_ONLINE: FriendNotificationMask = 1;
9708pub const MASK_USER_WENT_OFFLINE: FriendNotificationMask = 2;
9709pub const MASK_FRIEND_WENT_ONLINE: FriendNotificationMask = 4;
9710pub const MASK_FRIEND_UPDATED_PRESENCE: FriendNotificationMask = 8;
9711pub const MASK_FRIEND_UPDATED_MII: FriendNotificationMask = 16;
9712pub const MASK_FRIEND_UPDATED_PROFILE: FriendNotificationMask = 32;
9713pub const MASK_FRIEND_WENT_OFFLINE: FriendNotificationMask = 64;
9714pub const MASK_FRIEND_REGISTERED_USER: FriendNotificationMask = 128;
9715pub const MASK_FRIEND_SENT_JOINABLE_INVITATION: FriendNotificationMask = 256;
9716#[doc = "Enum for notification event mask"]
9717pub type FriendNotificationMask = ::libc::c_ushort;
9718#[doc = "< Provisionally registered friend."]
9719pub const RELATIONSHIP_INCOMPLETE: RelationshipType = 0;
9720#[doc = "< Fully registered friend."]
9721pub const RELATIONSHIP_COMPLETE: RelationshipType = 1;
9722#[doc = "< Friend not registered at all."]
9723pub const RELATIONSHIP_NOT_FOUND: RelationshipType = 2;
9724#[doc = "< Relationship was deleted."]
9725pub const RELATIONSHIP_DELETED: RelationshipType = 3;
9726#[doc = "< Provisionally registered friend (but this relationship has not been sent to the server yet)."]
9727pub const RELATIONSHIP_LOCAL: RelationshipType = 4;
9728#[doc = "Enum for friend relationship type"]
9729pub type RelationshipType = ::libc::c_uchar;
9730#[doc = "< Whether or not the current user has ever been in a friend relationship with the friend. This is set when the relationship type is either incomplete, complete, local, or deleted."]
9731pub const FRIEND_ATTRIBUTE_EVER_REGISTERED: FriendAttributes = 1;
9732#[doc = "< Whether or not the current user has been fully registered by this friend. Set only when the relationship type is complete."]
9733pub const FRIEND_ATTRIBUTE_REGISTRATION_COMPLETE: FriendAttributes = 2;
9734#[doc = "Enum for friend attributes according to relationship type"]
9735pub type FriendAttributes = ::libc::c_uchar;
9736pub const NAT_MAPPING_UNKNOWN: NatMappingType = 0;
9737pub const NAT_MAPPING_ENDPOINT_INDEPENDENT: NatMappingType = 1;
9738pub const NAT_MAPPING_ENDPOINT_DEPENDENT: NatMappingType = 2;
9739#[doc = "Enum for NAT mapping type"]
9740pub type NatMappingType = ::libc::c_uchar;
9741pub const NAT_FILTERING_UNKNOWN: NatFilteringType = 0;
9742pub const NAT_FILTERING_PORT_INDEPENDENT: NatFilteringType = 1;
9743pub const NAT_FILTERING_PORT_DEPENDENT: NatFilteringType = 2;
9744#[doc = "Enum for NAT filtering type"]
9745pub type NatFilteringType = ::libc::c_uchar;
9746unsafe extern "C" {
9747 #[must_use]
9748 #[doc = "Initializes friend services.\n # Arguments\n\n* `forceUser` - Whether or not to force using the user service frd:u instead of the default (admin service frd:a)."]
9749 pub fn frdInit(forceUser: bool) -> Result;
9750}
9751unsafe extern "C" {
9752 #[doc = "Exits friend services."]
9753 pub fn frdExit();
9754}
9755unsafe extern "C" {
9756 #[doc = "Get the friend user/admin service handle."]
9757 pub fn frdGetSessionHandle() -> *mut Handle;
9758}
9759unsafe extern "C" {
9760 #[must_use]
9761 #[doc = "Gets the login status of the current user.\n # Arguments\n\n* `state` - Pointer to write the current user's login status to."]
9762 pub fn FRD_HasLoggedIn(state: *mut bool) -> Result;
9763}
9764unsafe extern "C" {
9765 #[must_use]
9766 #[doc = "Gets the online status of the current user.\n # Arguments\n\n* `state` - Pointer to write the current user's online status to."]
9767 pub fn FRD_IsOnline(state: *mut bool) -> Result;
9768}
9769unsafe extern "C" {
9770 #[must_use]
9771 #[doc = "Log in to Nintendo's friend server.\n # Arguments\n\n* `event` - Event to signal when Login is done."]
9772 pub fn FRD_Login(event: Handle) -> Result;
9773}
9774unsafe extern "C" {
9775 #[must_use]
9776 #[doc = "Logs out of Nintendo's friend server."]
9777 pub fn FRD_Logout() -> Result;
9778}
9779unsafe extern "C" {
9780 #[must_use]
9781 #[doc = "Gets the current user's friend key.\n # Arguments\n\n* `key` - Pointer to write the current user's friend key to."]
9782 pub fn FRD_GetMyFriendKey(key: *mut FriendKey) -> Result;
9783}
9784unsafe extern "C" {
9785 #[must_use]
9786 #[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."]
9787 pub fn FRD_GetMyPreference(
9788 isPublicMode: *mut bool,
9789 isShowGameName: *mut bool,
9790 isShowPlayedGame: *mut bool,
9791 ) -> Result;
9792}
9793unsafe extern "C" {
9794 #[must_use]
9795 #[doc = "Gets the current user's profile information.\n # Arguments\n\n* `profile` - Pointer to write the current user's profile information to."]
9796 pub fn FRD_GetMyProfile(profile: *mut Profile) -> Result;
9797}
9798unsafe extern "C" {
9799 #[must_use]
9800 #[doc = "Gets the current user's presence information.\n # Arguments\n\n* `presence` - Pointer to write the current user's presence information to."]
9801 pub fn FRD_GetMyPresence(presence: *mut MyPresence) -> Result;
9802}
9803unsafe extern "C" {
9804 #[must_use]
9805 #[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."]
9806 pub fn FRD_GetMyScreenName(name: *mut MiiScreenName) -> Result;
9807}
9808unsafe extern "C" {
9809 #[must_use]
9810 #[doc = "Gets the current user's Mii data.\n # Arguments\n\n* `mii` - Pointer to write the current user's mii data to."]
9811 pub fn FRD_GetMyMii(mii: *mut FriendMii) -> Result;
9812}
9813unsafe extern "C" {
9814 #[must_use]
9815 #[doc = "Gets the ID of the current local account.\n # Arguments\n\n* `localAccountId` - Pointer to write the current local account ID to."]
9816 pub fn FRD_GetMyLocalAccountId(localAccountId: *mut u8_) -> Result;
9817}
9818unsafe extern "C" {
9819 #[must_use]
9820 #[doc = "Gets the current user's playing game.\n # Arguments\n\n* `titleId` - Pointer to write the current user's playing game to."]
9821 pub fn FRD_GetMyPlayingGame(playingGame: *mut GameKey) -> Result;
9822}
9823unsafe extern "C" {
9824 #[must_use]
9825 #[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."]
9826 pub fn FRD_GetMyFavoriteGame(favoriteGame: *mut GameKey) -> Result;
9827}
9828unsafe extern "C" {
9829 #[must_use]
9830 #[doc = "Gets the NcPrincipalId for the current user.\n # Arguments\n\n* `ncPrincipalId` - Pointer to output the NcPrincipalId to."]
9831 pub fn FRD_GetMyNcPrincipalId(ncPrincipalId: *mut u32_) -> Result;
9832}
9833unsafe extern "C" {
9834 #[must_use]
9835 #[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."]
9836 pub fn FRD_GetMyComment(comment: *mut FriendComment) -> Result;
9837}
9838unsafe extern "C" {
9839 #[must_use]
9840 #[doc = "Gets the current friend account's NEX password.\n # Arguments\n\n* `password` - Pointer to write the NEX password to.\n * `max_size` - Max size of the output buffer. Must not exceed 0x800."]
9841 pub fn FRD_GetMyPassword(password: *mut ::libc::c_char, bufsize: u32_) -> Result;
9842}
9843unsafe extern "C" {
9844 #[must_use]
9845 #[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)"]
9846 pub fn FRD_GetFriendKeyList(
9847 friendKeyList: *mut FriendKey,
9848 num: *mut u32_,
9849 offset: u32_,
9850 size: u32_,
9851 ) -> Result;
9852}
9853unsafe extern "C" {
9854 #[must_use]
9855 #[doc = "Gets friend presence data for the current user's friends.\n # Arguments\n\n* `friendPresences` - Pointer to write the friend presence data to.\n * `friendKeyList` - The friend keys of the friends to get presence data for.\n * `count` - The number of input friend keys."]
9856 pub fn FRD_GetFriendPresence(
9857 friendPresences: *mut FriendPresence,
9858 friendKeyList: *const FriendKey,
9859 count: u32_,
9860 ) -> Result;
9861}
9862unsafe extern "C" {
9863 #[must_use]
9864 #[doc = "Gets screen names for the current user's friends.\n # Arguments\n\n* `screenNames` - Pointer to write the UTF-16 screen names to.\n * `screenNamesLen` - Number of UTF-16 characters `screenNames` can hold. (max: 0x800)\n * `characterSets` - Pointer to write the character sets for the screen names to.\n * `characterSetsLen` - Size of buffer to output character sets to.\n * `friendKeyList` - The friend keys for the friends to get screen names for.\n * `count` - The number of input friend keys.\n * `maskNonAscii` - Whether or not to replace all non-ASCII characters with question marks ('?') if the given character set doesn't match that of the corresponding friend's Mii data.\n * `profanityFlag` - Setting this to true replaces the screen names with all question marks ('?') if profanityFlag is also set in the corresponding friend's Mii data."]
9865 pub fn FRD_GetMiiScreenName(
9866 screenNames: *mut MiiScreenName,
9867 screenNamesLen: u32_,
9868 characterSets: *mut u8_,
9869 characterSetsLen: u32_,
9870 friendKeyList: *const FriendKey,
9871 count: u32_,
9872 maskNonAscii: bool,
9873 profanityFlag: bool,
9874 ) -> Result;
9875}
9876unsafe extern "C" {
9877 #[must_use]
9878 #[doc = "Gets the current user's friends' Mii data.\n # Arguments\n\n* `miiList` - Pointer to write Mii data to.\n * `friendKeyList` - Pointer to input friend keys.\n * `count` - Number of input friend keys."]
9879 pub fn FRD_GetFriendMii(
9880 miiList: *mut FriendMii,
9881 friendKeyList: *const FriendKey,
9882 count: u32_,
9883 ) -> Result;
9884}
9885unsafe extern "C" {
9886 #[must_use]
9887 #[doc = "Get the current user's friends' profile data.\n # Arguments\n\n* `profile` - Pointer to write profile data to.\n * `friendKeyList` - Pointer to input friend keys.\n * `count` - Number of input friend keys."]
9888 pub fn FRD_GetFriendProfile(
9889 profiles: *mut Profile,
9890 friendKeyList: *const FriendKey,
9891 count: u32_,
9892 ) -> Result;
9893}
9894unsafe extern "C" {
9895 #[must_use]
9896 #[doc = "Get the relationship type for the current user's friends.\n # Arguments\n\n* `relationships` - Pointer to output relationship types to.\n * `friendKeyList` - Pointer to input friend keys to query relationship types for.\n * `count` - Number of input friend keys."]
9897 pub fn FRD_GetFriendRelationship(
9898 relationships: *mut u8_,
9899 friendKeyList: *const FriendKey,
9900 count: u32_,
9901 ) -> Result;
9902}
9903unsafe extern "C" {
9904 #[must_use]
9905 #[doc = "Get attributes for the current user's friends.\n # Arguments\n\n* `attributes` - Pointer to output the attributes to.\n * `friendKeyList` - Pointer to input friend keys to query attributes for.\n * `count` - Number of input friend keys."]
9906 pub fn FRD_GetFriendAttributeFlags(
9907 attributes: *mut u32_,
9908 friendKeyList: *const FriendKey,
9909 count: u32_,
9910 ) -> Result;
9911}
9912unsafe extern "C" {
9913 #[must_use]
9914 #[doc = "Get the current user's friends' playing game.\n # Arguments\n\n* `playingGames` - Pointer to write playing game data to.\n * `friendKeyList` - Pointer to friend keys.\n * `count` - Number of input friend keys."]
9915 pub fn FRD_GetFriendPlayingGame(
9916 playingGames: *mut FriendPlayingGame,
9917 friendKeyList: *const FriendKey,
9918 count: u32_,
9919 ) -> Result;
9920}
9921unsafe extern "C" {
9922 #[must_use]
9923 #[doc = "Get the current user's friends' favourite games.\n # Arguments\n\n* `favoriteGames` - Pointer to write game key data to.\n * `friendKeyList` - Pointer to friend keys.\n * `count` - Number of friend keys."]
9924 pub fn FRD_GetFriendFavoriteGame(
9925 favoriteGames: *mut GameKey,
9926 friendKeyList: *const FriendKey,
9927 count: u32_,
9928 ) -> Result;
9929}
9930unsafe extern "C" {
9931 #[must_use]
9932 #[doc = "Get info about the current user's friends.\n # Arguments\n\n* `infos` - Pointer to output friend info data to.\n * `friendKeyList` - Pointer to input friend keys.\n * `count` - Number of input friend keys.\n * `maskNonAscii` - Whether or not to replace all non-ASCII characters with question marks ('?') if the given character set doesn't match that of the corresponding friend's Mii data.\n * `profanityFlag` - Setting this to true replaces the screen names with all question marks ('?') if profanityFlag is also set in the corresponding friend's Mii data."]
9933 pub fn FRD_GetFriendInfo(
9934 infos: *mut FriendInfo,
9935 friendKeyList: *const FriendKey,
9936 count: u32_,
9937 maskNonAscii: bool,
9938 profanityFlag: bool,
9939 ) -> Result;
9940}
9941unsafe extern "C" {
9942 #[must_use]
9943 #[doc = "Gets whether a friend code is included in the current user's friend list.\n # Arguments\n\n* `friendCode` - The friend code to check for.\n * `isFromList` - Pointer to write whether or not the given friend code was found in the current user's friends list."]
9944 pub fn FRD_IsInFriendList(friendCode: u64_, isFromList: *mut bool) -> Result;
9945}
9946unsafe extern "C" {
9947 #[must_use]
9948 #[doc = "Unscrambles a scrambled friend code.\n # Arguments\n\n* `unscrambled` - Pointer to output the unscrambled friend codes to.\n * `scrambled` - Pointer to the input scrambled friend codes.\n * `count` - Number of input scrambled codes."]
9949 pub fn FRD_UnscrambleLocalFriendCode(
9950 unscrambled: *mut u64_,
9951 scrambled: *mut ScrambledFriendCode,
9952 count: u32_,
9953 ) -> Result;
9954}
9955unsafe extern "C" {
9956 #[must_use]
9957 #[doc = "Updates the game mode description string.\n # Arguments\n\n* `desc` - Pointer to the UTF-8 game mode description to use."]
9958 pub fn FRD_UpdateGameModeDescription(desc: *mut FriendGameModeDescription) -> Result;
9959}
9960unsafe extern "C" {
9961 #[must_use]
9962 #[doc = "Updates the current user's presence data and game mode description.\n # Arguments\n\n* `presence` - The new presence data to use.\n * `desc` - The new game mode description to use."]
9963 pub fn FRD_UpdateMyPresence(
9964 presence: *mut Presence,
9965 desc: *mut FriendGameModeDescription,
9966 ) -> Result;
9967}
9968unsafe extern "C" {
9969 #[must_use]
9970 #[doc = "Sends an invitation to the current user's friends.\n # Arguments\n\n* `friendKeyList` - The friend keys to send an invitation to.\n * `count` - The number of input friend keys."]
9971 pub fn FRD_SendInvitation(friendKeyList: *const FriendKey, count: u32_) -> Result;
9972}
9973unsafe extern "C" {
9974 #[must_use]
9975 #[doc = "Registers the event handle that will be signaled to inform the session of various status changes.\n # Arguments\n\n* `event` - The event handle to register for notification signaling."]
9976 pub fn FRD_AttachToEventNotification(event: Handle) -> Result;
9977}
9978unsafe extern "C" {
9979 #[must_use]
9980 #[doc = "Sets the notification mask for the event notification system.\n # Arguments\n\n* `mask` - The notifications to subscribe to for the event notification system."]
9981 pub fn FRD_SetNotificationMask(mask: FriendNotificationMask) -> Result;
9982}
9983unsafe extern "C" {
9984 #[must_use]
9985 #[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."]
9986 pub fn FRD_GetEventNotification(
9987 event: *mut NotificationEvent,
9988 count: u32_,
9989 recievedNotifCount: *mut u32_,
9990 ) -> Result;
9991}
9992unsafe extern "C" {
9993 #[must_use]
9994 #[doc = "Get the result of the last internal operation."]
9995 pub fn FRD_GetLastResponseResult() -> Result;
9996}
9997unsafe extern "C" {
9998 #[must_use]
9999 #[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."]
10000 pub fn FRD_PrincipalIdToFriendCode(principalId: u32_, friendCode: *mut u64_) -> Result;
10001}
10002unsafe extern "C" {
10003 #[must_use]
10004 #[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."]
10005 pub fn FRD_FriendCodeToPrincipalId(friendCode: u64_, principalId: *mut u32_) -> Result;
10006}
10007unsafe extern "C" {
10008 #[must_use]
10009 #[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."]
10010 pub fn FRD_IsValidFriendCode(friendCode: u64_, isValid: *mut bool) -> Result;
10011}
10012unsafe extern "C" {
10013 #[must_use]
10014 #[doc = "Get a support error code (XXX-YYYY) for the given result code.\n # Arguments\n\n* `errorCode` - Pointer to write the support error code to.\n * `res` - The result code to convert."]
10015 pub fn FRD_ResultToErrorCode(errorCode: *mut u32_, res: Result) -> Result;
10016}
10017unsafe extern "C" {
10018 #[must_use]
10019 #[doc = "Requests game server authentication.\n # Arguments\n\n* `serverId` - The ID of the NEX server to request authentication for.\n * `ingamesn` - The UTF-16 nickname to use in game.\n * `ingamesnSize` - Buffer size of the input ingamesn buffer. (max: FRIEND_INGAMESN_LEN * 2)\n * `majorSdkVersion` - The major SDK version.\n * `minorSdkVersion` - The minor SDK version.\n * `completionEvent` - The event handle to signal once the operation has completed."]
10020 pub fn FRD_RequestGameAuthentication(
10021 serverId: u32_,
10022 ingamesn: *mut u16_,
10023 ingamesnSize: u32_,
10024 majorSdkVersion: u8_,
10025 minorSdkVersion: u8_,
10026 completionEvent: Handle,
10027 ) -> Result;
10028}
10029unsafe extern "C" {
10030 #[must_use]
10031 #[doc = "Get game server authentication data requested using FRD_RequestGameAuthentication.\n # Arguments\n\n* `data` - Pointer to write game server authentication data to."]
10032 pub fn FRD_GetGameAuthenticationData(data: *mut GameAuthenticationData) -> Result;
10033}
10034unsafe extern "C" {
10035 #[must_use]
10036 #[doc = "Request service locator info for a given NEX server.\n # Arguments\n\n* `keyhash` - The `keyhash` value to use for the NASC request.\n * `svc` - The svc `value` to use for the NASC request.\n * `majorSdkVersion` - The major SDK version.\n * `minorSdkVersion` - The minor SDK version.\n * `completionEvent` - The event handle to signal once the operation has completed.\n * `serverId` -"]
10037 pub fn FRD_RequestServiceLocator(
10038 serverId: u32_,
10039 keyhash: *mut ::libc::c_char,
10040 svc: *mut ::libc::c_char,
10041 majorSdkVersion: u8_,
10042 minorSdkVersion: u8_,
10043 completionEvent: Handle,
10044 ) -> Result;
10045}
10046unsafe extern "C" {
10047 #[must_use]
10048 #[doc = "Get service locator data requested using FRD_RequestServiceLocator.\n # Arguments\n\n* `data` - Pointer to write the service locator data to."]
10049 pub fn FRD_GetServiceLocatorData(data: *mut ServiceLocatorData) -> Result;
10050}
10051unsafe extern "C" {
10052 #[must_use]
10053 #[doc = "Starts an internal task to determine the NAT properties of the current internet connection.\n # Arguments\n\n* `completionEvent` - The event handle to signal once the task has completed."]
10054 pub fn FRD_DetectNatProperties(completionEvent: Handle) -> Result;
10055}
10056unsafe extern "C" {
10057 #[must_use]
10058 #[doc = "Returns NAT properties for the current internet connection.\n # Arguments\n\n* `natMappingType` - Pointer to write the NAT mapping type of the connection to.\n * `natFilteringType` - Pointer to write the NAT filtering type of the connection to."]
10059 pub fn FRD_GetNatProperties(natMappingType: *mut u32_, natFilteringType: *mut u32_) -> Result;
10060}
10061unsafe extern "C" {
10062 #[must_use]
10063 #[doc = "Returns the difference (in nanoseconds) between server time and device time. This difference is calculated every time the system logs into friend services.\n # Arguments\n\n* `diffMs` - The pointer to write the time difference (in nanoseconds) to."]
10064 pub fn FRD_GetServerTimeDifference(diff: *mut u64_) -> Result;
10065}
10066unsafe extern "C" {
10067 #[must_use]
10068 #[doc = "Configures the current session to allow or disallow running the friends service in sleep mode (half-awake mode).\n # Arguments\n\n* `allow` - Whether or not to enable half-awake mode."]
10069 pub fn FRD_AllowHalfAwake(allow: bool) -> Result;
10070}
10071unsafe extern "C" {
10072 #[must_use]
10073 #[doc = "Gets the server environment configuration for the current user.\n # Arguments\n\n* `nascEnvironment` - Pointer to write the NASC server environment type to.\n * `nfsType` - Pointer to write the NFS (Nintendo Friend Server) type to.\n * `nfsNo` - Pointer to write the NFS (Nintendo Friend Server) number to."]
10074 pub fn FRD_GetServerTypes(
10075 nascEnvironment: *mut u8_,
10076 nfsType: *mut u8_,
10077 nfsNo: *mut u8_,
10078 ) -> Result;
10079}
10080unsafe extern "C" {
10081 #[must_use]
10082 #[doc = "Gets the comment (personal) message of the current user's friends.\n # Arguments\n\n* `comments` - Pointer to write the friend comment data to.\n * `commentsLen` - Number of UTF-16 characters `screenNames` can hold. (max: 0xC00)\n * `friendKeyList` - Pointer to input friend keys.\n * `count` - Number of input friend keys."]
10083 pub fn FRD_GetFriendComment(
10084 comments: *mut FriendComment,
10085 commentsLen: u32_,
10086 friendKeyList: *const FriendKey,
10087 count: u32_,
10088 ) -> Result;
10089}
10090unsafe extern "C" {
10091 #[must_use]
10092 #[doc = "Sets the Friend API to use a specific SDK version.\n # Arguments\n\n* `sdkVer` - The SDK version needed to be used."]
10093 pub fn FRD_SetClientSdkVersion(sdkVer: u32_) -> Result;
10094}
10095unsafe extern "C" {
10096 #[must_use]
10097 #[doc = "Gets the current user's encrypted approach context.\n # Arguments\n\n* `ctx` - Pointer to write the encrypted approach context data to."]
10098 pub fn FRD_GetMyApproachContext(ctx: *mut EncryptedApproachContext) -> Result;
10099}
10100unsafe extern "C" {
10101 #[must_use]
10102 #[doc = "Adds a friend using their encrypted approach context.\n # Arguments\n\n* `unkbuf` - Pointer to unknown (and unused) data.\n * `unkbufSize` - Size of unknown (and unused) data. (max: 0x600)\n * `ctx` - Pointer to encrypted approach context data.\n * `completionEvent` - The event handle to signal when this action is completed."]
10103 pub fn FRD_AddFriendWithApproach(
10104 unkbuf: *mut u8_,
10105 unkbufSize: u32_,
10106 ctx: *mut EncryptedApproachContext,
10107 completionEvent: Handle,
10108 ) -> Result;
10109}
10110unsafe extern "C" {
10111 #[must_use]
10112 #[doc = "Decrypts an encrypted approach context.\n # Arguments\n\n* `decryptedContext` - Pointer to write the decrypted approach context data to.\n * `encryptedContext` - Pointer to input encrypted approach context.\n * `maskNonAscii` - Whether or not to replace all non-ASCII characters with question marks ('?') if the given character set doesn't match that of the corresponding friend's Mii data.\n * `characterSet` - The character set to use for text conversions."]
10113 pub fn FRD_DecryptApproachContext(
10114 decryptedContext: *mut DecryptedApproachContext,
10115 encryptedContext: *mut EncryptedApproachContext,
10116 maskNonAscii: bool,
10117 characterSet: u8_,
10118 ) -> Result;
10119}
10120unsafe extern "C" {
10121 #[must_use]
10122 #[doc = "Gets extended NAT properties. This is the same as FRD_GetNatProperties, with this version also returning the NAT Mapping Port Increment.\n # Arguments\n\n* `natMappingType` - Pointer to write the NAT mapping type of the connection to.\n * `natFilteringType` - Pointer to write the NAT filtering type of the connection to.\n * `natMappingPortIncrement` - Pointer to write the NAT mapping port increment to."]
10123 pub fn FRD_GetExtendedNatProperties(
10124 natMappingType: *mut u32_,
10125 natFilteringType: *mut u32_,
10126 natMappingPortIncrement: *mut u32_,
10127 ) -> Result;
10128}
10129unsafe extern "C" {
10130 #[must_use]
10131 #[doc = "Creates a new local friends account.\n # Arguments\n\n* `localAccountId` - The local account ID to use.\n * `nascEnvironment` - The NASC environment to create this account in.\n * `nfsType` - The NFS (Nintendo Friend Server) type this account should use.\n * `nfsNo` - The NFS (Nintendo Friend Server) number this account should use."]
10132 pub fn FRDA_CreateLocalAccount(
10133 localAccountId: u8_,
10134 nascEnvironment: u8_,
10135 nfsType: u8_,
10136 nfsNo: u8_,
10137 ) -> Result;
10138}
10139unsafe extern "C" {
10140 #[must_use]
10141 #[doc = "Deletes a local friends account.\n # Arguments\n\n* `localAccountId` - The ID of the local account to delete."]
10142 pub fn FRDA_DeleteLocalAccount(localAccountId: u8_) -> Result;
10143}
10144unsafe extern "C" {
10145 #[must_use]
10146 #[doc = "Loads a local friends account.\n # Arguments\n\n* `localAccountId` - The ID of the local account to load."]
10147 pub fn FRDA_LoadLocalAccount(localAccountId: u8_) -> Result;
10148}
10149unsafe extern "C" {
10150 #[must_use]
10151 #[doc = "Unloads the currently active local account."]
10152 pub fn FRDA_UnloadLocalAccount() -> Result;
10153}
10154unsafe extern "C" {
10155 #[must_use]
10156 #[doc = "Saves all data of the friends module."]
10157 pub fn FRDA_Save() -> Result;
10158}
10159unsafe extern "C" {
10160 #[must_use]
10161 #[doc = "Adds a friend online (\"Internet\" option).\n # Arguments\n\n* `event` - Event signaled when friend is registered.\n * `principalId` - PrincipalId of the friend to add."]
10162 pub fn FRDA_AddFriendOnline(event: Handle, principalId: u32_) -> Result;
10163}
10164unsafe extern "C" {
10165 #[must_use]
10166 #[doc = "Adds a friend offline (\"Local\" option).\n # Arguments\n\n* `friendKey` - Pointer to the friend key of the friend to add.\n * `mii` - Pointer to the Mii of the friend to add.\n * `friendProfile` - Pointer to the friend profile of the friend to add.\n * `screenName` - Pointer to the UTF-16 screen name of the friend to add.\n * `profanityFlag` - Setting this to true will cause calls that return the screen name to replace it with question marks ('?') when profanityFlag is true in those calls.\n * `characterSet` - The character set to use for text data of the friend."]
10167 pub fn FRDA_AddFriendOffline(
10168 friendKey: *mut FriendKey,
10169 mii: *mut FriendMii,
10170 friendProfile: *mut FriendProfile,
10171 screenName: *mut MiiScreenName,
10172 profanityFlag: bool,
10173 characterSet: u8_,
10174 ) -> Result;
10175}
10176unsafe extern "C" {
10177 #[must_use]
10178 #[doc = "Updates a friend's display name.\n # Arguments\n\n* `friendKey` - Pointer to friend key of the friend to update the screen name of.\n * `screenName` - Pointer to the new screen name to use.\n * `characterSet` - The character set of the new screen name."]
10179 pub fn FRDA_UpdateMiiScreenName(
10180 friendKey: *mut FriendKey,
10181 screenName: *mut MiiScreenName,
10182 characterSet: u8_,
10183 ) -> Result;
10184}
10185unsafe extern "C" {
10186 #[must_use]
10187 #[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."]
10188 pub fn FRDA_RemoveFriend(principalId: u32_, localFriendCode: u64_) -> Result;
10189}
10190unsafe extern "C" {
10191 #[must_use]
10192 #[doc = "Updates the game being played by the current user.\n # Arguments\n\n* `playingGame` - Pointer to game key of the game being played."]
10193 pub fn FRDA_UpdatePlayingGame(playingGame: *mut GameKey) -> Result;
10194}
10195unsafe extern "C" {
10196 #[must_use]
10197 #[doc = "Updates the current user's friend list preferences.\n # Arguments\n\n* `isPublicMode` - Whether or not the online status should be public.\n * `isShowGameMode` - Whether or not the currently played game is shown.\n * `isShowPlayedMode` - Whether or not the play history is shown."]
10198 pub fn FRDA_UpdatePreference(
10199 isPublicMode: bool,
10200 isShowGameMode: bool,
10201 isShowPlayedMode: bool,
10202 ) -> Result;
10203}
10204unsafe extern "C" {
10205 #[must_use]
10206 #[doc = "Updates the current user's Mii.\n # Arguments\n\n* `mii` - Pointer to the new Mii data to use.\n * `screenName` - Pointer to new screen name associated with the new Mii.\n * `profanityFlag` - Setting this to true will cause calls that return the screen name to replace it with question marks ('?') when profanityFlag is true in those calls.\n * `characterSet` - The character set to use for the screen name."]
10207 pub fn FRDA_UpdateMii(
10208 mii: *mut FriendMii,
10209 screenName: *mut MiiScreenName,
10210 profanityFlag: bool,
10211 characterSet: u8_,
10212 ) -> Result;
10213}
10214unsafe extern "C" {
10215 #[must_use]
10216 #[doc = "Updates the current user's favorite game.\n # Arguments\n\n* `favoriteGame` - Pointer to the game key of the new favorite game."]
10217 pub fn FRDA_UpdateFavoriteGame(favoriteGame: *mut GameKey) -> Result;
10218}
10219unsafe extern "C" {
10220 #[must_use]
10221 #[doc = "Sets the NcPrincipalId of the current user.\n # Arguments\n\n* `ncPrincipalId` - The new NcPrincipalId."]
10222 pub fn FRDA_SetNcPrincipalId(ncPrincipalId: u32_) -> Result;
10223}
10224unsafe extern "C" {
10225 #[must_use]
10226 #[doc = "Updates the current user's comment (personal message).\n # Arguments\n\n* `comment` - Pointer to the new comment (personal message)."]
10227 pub fn FRDA_UpdateComment(comment: *mut FriendComment) -> Result;
10228}
10229unsafe extern "C" {
10230 #[must_use]
10231 #[doc = "Increments the move count in the current local account's save data."]
10232 pub fn FRDA_IncrementMoveCount() -> Result;
10233}
10234pub type ActUuid = [u8_; 16usize];
10235pub type ActNnasSubdomain = [::libc::c_char; 33usize];
10236pub type AccountId = [::libc::c_char; 17usize];
10237pub type AccountPassword = [::libc::c_char; 18usize];
10238pub type AccountMailAddress = [::libc::c_char; 257usize];
10239#[doc = "< u8"]
10240pub const INFO_TYPE_COMMON_NUM_ACCOUNTS: ACT_InfoType = 1;
10241#[doc = "< u8"]
10242pub const INFO_TYPE_COMMON_CURRENT_ACCOUNT_SLOT: ACT_InfoType = 2;
10243#[doc = "< u8"]
10244pub const INFO_TYPE_COMMON_DEFAULT_ACCOUNT_SLOT: ACT_InfoType = 3;
10245#[doc = "< s64, difference between server time and device time in nanoseconds."]
10246pub const INFO_TYPE_COMMON_NETWORK_TIME_DIFF: ACT_InfoType = 4;
10247#[doc = "< u32"]
10248pub const INFO_TYPE_PERSISTENT_ID: ACT_InfoType = 5;
10249#[doc = "< u64"]
10250pub const INFO_TYPE_COMMON_TRANSFERABLE_ID_BASE: ACT_InfoType = 6;
10251#[doc = "< u64"]
10252pub const INFO_TYPE_TRANSFERABLE_ID_BASE: ACT_InfoType = 6;
10253#[doc = "< CFLStoreData"]
10254pub const INFO_TYPE_MII: ACT_InfoType = 7;
10255#[doc = "< AccountId"]
10256pub const INFO_TYPE_ACCOUNT_ID: ACT_InfoType = 8;
10257#[doc = "< AccountMailAddress"]
10258pub const INFO_TYPE_MAIL_ADDRESS: ACT_InfoType = 9;
10259#[doc = "< BirthDate structure"]
10260pub const INFO_TYPE_BIRTH_DATE: ACT_InfoType = 10;
10261#[doc = "< char[2+1]"]
10262pub const INFO_TYPE_COUNTRY_NAME: ACT_InfoType = 11;
10263#[doc = "< u32"]
10264pub const INFO_TYPE_PRINCIPAL_ID: ACT_InfoType = 12;
10265pub const INFO_TYPE_STUB_0xD: ACT_InfoType = 13;
10266#[doc = "< bool"]
10267pub const INFO_TYPE_IS_PASSWORD_CACHE_ENABLED: ACT_InfoType = 14;
10268pub const INFO_TYPE_STUB_0xF: ACT_InfoType = 15;
10269pub const INFO_TYPE_STUB_0x10: ACT_InfoType = 16;
10270#[doc = "< AccountInfo structure"]
10271pub const INFO_TYPE_ACCOUNT_INFO: ACT_InfoType = 17;
10272pub const INFO_TYPE_ACCOUNT_SERVER_TYPES: ACT_InfoType = 18;
10273#[doc = "< u8, F = 0, M = 1"]
10274pub const INFO_TYPE_GENDER: ACT_InfoType = 19;
10275#[doc = "< Result"]
10276pub const INFO_TYPE_LAST_AUTHENTICATION_RESULT: ACT_InfoType = 20;
10277#[doc = "< AccountId"]
10278pub const INFO_TYPE_ASSIGNED_ACCOUNT_ID: ACT_InfoType = 21;
10279#[doc = "< u8"]
10280pub const INFO_TYPE_PARENTAL_CONTROL_SLOT_NUMBER: ACT_InfoType = 22;
10281#[doc = "< u32"]
10282pub const INFO_TYPE_SIMPLE_ADDRESS_ID: ACT_InfoType = 23;
10283pub const INFO_TYPE_STUB_0x18: ACT_InfoType = 24;
10284#[doc = "< s64"]
10285pub const INFO_TYPE_UTC_OFFSET: ACT_InfoType = 25;
10286#[doc = "< bool"]
10287pub const INFO_TYPE_IS_COMMITTED: ACT_InfoType = 26;
10288#[doc = "< MiiScreenName"]
10289pub const INFO_TYPE_MII_NAME: ACT_InfoType = 27;
10290#[doc = "< char[0x10+1]"]
10291pub const INFO_TYPE_NFS_PASSWORD: ACT_InfoType = 28;
10292#[doc = "< bool"]
10293pub const INFO_TYPE_HAS_ECI_VIRTUAL_ACCOUNT: ACT_InfoType = 29;
10294#[doc = "< char[0x40+1]"]
10295pub const INFO_TYPE_TIMEZONE_ID: ACT_InfoType = 30;
10296#[doc = "< bool"]
10297pub const INFO_TYPE_IS_MII_UPDATED: ACT_InfoType = 31;
10298#[doc = "< bool"]
10299pub const INFO_TYPE_IS_MAIL_ADDRESS_VALIDATED: ACT_InfoType = 32;
10300#[doc = "< AccountAccessToken structure"]
10301pub const INFO_TYPE_ACCOUNT_ACCESS_TOKEN: ACT_InfoType = 33;
10302#[doc = "< bool"]
10303pub const INFO_TYPE_COMMON_IS_APPLICATION_UPDATE_REQUIRED: ACT_InfoType = 34;
10304#[doc = "< AccountServerTypes"]
10305pub const INFO_TYPE_COMMON_DEFAULT_ACCOUNT_SERVER_TYPES: ACT_InfoType = 35;
10306#[doc = "< bool"]
10307pub const INFO_TYPE_IS_SERVER_ACCOUNT_DELETED: ACT_InfoType = 36;
10308#[doc = "< char[0x100+1]"]
10309pub const INFO_TYPE_MII_IMAGE_URL: ACT_InfoType = 37;
10310#[doc = "< u32"]
10311pub const INFO_TYPE_ASSIGNED_PRINCIPAL_ID: ACT_InfoType = 38;
10312#[doc = "< u32, AccountAccessTokenState enum"]
10313pub const INFO_TYPE_ACCOUNT_ACCESS_TOKEN_STATE: ACT_InfoType = 39;
10314#[doc = "< AccountServerTypesStr structure"]
10315pub const INFO_TYPE_ACCOUNT_SERVER_ENVIRONMENT: ACT_InfoType = 40;
10316#[doc = "< AccountServerTypesStr structure"]
10317pub const INFO_TYPE_COMMON_DEFAULT_ACCOUNT_SERVER_ENVIRONMENT: ACT_InfoType = 41;
10318#[doc = "< u8[8]"]
10319pub const INFO_TYPE_COMMON_DEVICE_HASH: ACT_InfoType = 42;
10320#[doc = "< u8"]
10321pub const INFO_TYPE_FP_LOCAL_ACCOUNT_ID: ACT_InfoType = 43;
10322#[doc = "< u16"]
10323pub const INFO_TYPE_AGE: ACT_InfoType = 44;
10324#[doc = "< bool"]
10325pub const INFO_TYPE_IS_ENABLED_RECEIVE_ADS: ACT_InfoType = 45;
10326#[doc = "< bool"]
10327pub const INFO_TYPE_IS_OFF_DEVICE_ENABLED: ACT_InfoType = 46;
10328#[doc = "< u32"]
10329pub const INFO_TYPE_TRANSLATED_SIMPLE_ADDRESS_ID: ACT_InfoType = 47;
10330#[doc = "Enum for common / account specific info types"]
10331pub type ACT_InfoType = ::libc::c_uchar;
10332#[doc = "< ExistentServerAccountData struct"]
10333pub const REQUEST_INQUIRE_BINDING_TO_EXISTENT_SERVER_ACCOUNT: ACT_AsyncRequestType = 1;
10334#[doc = "< u32, parentalConsentApprovalId"]
10335pub const REQUEST_BIND_TO_EXISTENT_SERVER_ACCOUNT: ACT_AsyncRequestType = 2;
10336#[doc = "< EulaList structure (dynamically sized)"]
10337pub const REQUEST_ACQUIRE_EULA: ACT_AsyncRequestType = 3;
10338#[doc = "< EulaList structure (dynamically sized)"]
10339pub const REQUEST_ACQUIRE_EULA_LIST: ACT_AsyncRequestType = 3;
10340#[doc = "< EulaList structure with only the languageNameOffsets populated (dynamically sized)"]
10341pub const REQUEST_ACQUIRE_EULA_LANGUAGE_LIST: ACT_AsyncRequestType = 3;
10342#[doc = "< TimezoneList structure"]
10343pub const REQUEST_ACQUIRE_TIMEZONE_LIST: ACT_AsyncRequestType = 4;
10344#[doc = "< INFO_TYPE_MAIL_ADDRESS: AccountMailAddress"]
10345pub const REQUEST_ACQUIRE_ACCOUNT_INFO: ACT_AsyncRequestType = 5;
10346#[doc = "< AccountId[count]"]
10347pub const REQUEST_ACQUIRE_ACCOUNT_ID_BY_PRINCIPAL_ID_MULTI: ACT_AsyncRequestType = 6;
10348#[doc = "< AccountId"]
10349pub const REQUEST_ACQUIRE_ACCOUNT_ID_BY_PRINCIPAL_ID: ACT_AsyncRequestType = 7;
10350#[doc = "< u32[count]"]
10351pub const REQUEST_ACQUIRE_PRINCIPAL_ID_BY_ACCOUNT_ID_MULTI: ACT_AsyncRequestType = 8;
10352#[doc = "< u32"]
10353pub const REQUEST_ACQUIRE_PRINCIPAL_ID_BY_ACCOUNT_ID: ACT_AsyncRequestType = 9;
10354#[doc = "< u32, approvalId"]
10355pub const REQUEST_APPROVE_BY_CREDIT_CARD: ACT_AsyncRequestType = 10;
10356#[doc = "< CoppaCodeMailData structure"]
10357pub const REQUEST_SEND_COPPA_CODE_MAIL: ACT_AsyncRequestType = 11;
10358#[doc = "< CFLStoreData[count]"]
10359pub const REQUEST_ACQUIRE_MII: ACT_AsyncRequestType = 12;
10360#[doc = "< char[0xC00+1], NULL-terminate ASCII raw profile XML data"]
10361pub const REQUEST_ACQUIRE_ACCOUNT_INFO_RAW: ACT_AsyncRequestType = 13;
10362pub type ACT_AsyncRequestType = ::libc::c_uchar;
10363#[doc = "< The user's primary Mii image."]
10364pub const MII_IMAGE_PRIMARY: MiiImageType = 0;
10365pub const MII_IMAGE_1: MiiImageType = 1;
10366pub const MII_IMAGE_2: MiiImageType = 2;
10367pub const MII_IMAGE_3: MiiImageType = 3;
10368pub const MII_IMAGE_4: MiiImageType = 4;
10369pub const MII_IMAGE_5: MiiImageType = 5;
10370pub const MII_IMAGE_6: MiiImageType = 6;
10371pub const MII_IMAGE_7: MiiImageType = 7;
10372pub const MII_IMAGE_8: MiiImageType = 8;
10373#[doc = "Enum for Mii image type"]
10374pub type MiiImageType = ::libc::c_uchar;
10375pub const NNAS_PRODUCTION: NnasServerType = 0;
10376pub const NNAS_GAME_DEVELOPMENT: NnasServerType = 1;
10377pub const NNAS_SYSTEM_DEVELOPMENT: NnasServerType = 2;
10378pub const NNAS_LIBRARY_DEVELOPMENT: NnasServerType = 3;
10379pub const NNAS_STAGING: NnasServerType = 4;
10380#[doc = "Enum for NNAS (Nintendo Network Authentication Server) type"]
10381pub type NnasServerType = ::libc::c_uchar;
10382pub const ACCESS_TOKEN_UNINITIALIZED: AccountAccessTokenState = 0;
10383pub const ACCESS_TOKEN_EXPIRED: AccountAccessTokenState = 1;
10384pub const ACCESS_TOKEN_VALID: AccountAccessTokenState = 2;
10385#[doc = "Enum for account access token state"]
10386pub type AccountAccessTokenState = ::libc::c_uchar;
10387#[doc = "< Invalidates only the account token itself (and the expiry date)."]
10388pub const INVALIDATE_ACCESS_TOKEN: InvalidateAccessTokenAction = 1;
10389#[doc = "< Invalidates only the refresh token."]
10390pub const INVALIDATE_REFRESH_TOKEN: InvalidateAccessTokenAction = 2;
10391#[doc = "Enum for account access token invalidation action"]
10392pub type InvalidateAccessTokenAction = ::libc::c_uchar;
10393#[doc = "Coppa Code Mail Data Structure"]
10394#[repr(C)]
10395#[derive(Debug, Copy, Clone)]
10396pub struct CoppaCodeMailData {
10397 pub coppaCode: [::libc::c_char; 6usize],
10398 pub parentEmail: AccountMailAddress,
10399}
10400#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10401const _: () = {
10402 ["Size of CoppaCodeMailData"][::core::mem::size_of::<CoppaCodeMailData>() - 263usize];
10403 ["Alignment of CoppaCodeMailData"][::core::mem::align_of::<CoppaCodeMailData>() - 1usize];
10404 ["Offset of field: CoppaCodeMailData::coppaCode"]
10405 [::core::mem::offset_of!(CoppaCodeMailData, coppaCode) - 0usize];
10406 ["Offset of field: CoppaCodeMailData::parentEmail"]
10407 [::core::mem::offset_of!(CoppaCodeMailData, parentEmail) - 6usize];
10408};
10409impl Default for CoppaCodeMailData {
10410 fn default() -> Self {
10411 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
10412 unsafe {
10413 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10414 s.assume_init()
10415 }
10416 }
10417}
10418#[doc = "Mii CFLStoreData (CTR Face Library Store Data) structure"]
10419#[repr(C, packed)]
10420#[derive(Debug, Default, Copy, Clone)]
10421pub struct CFLStoreData {
10422 pub miiData: MiiData,
10423 pub pad: [u8_; 2usize],
10424 pub crc16: u16_,
10425}
10426#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10427const _: () = {
10428 ["Size of CFLStoreData"][::core::mem::size_of::<CFLStoreData>() - 96usize];
10429 ["Alignment of CFLStoreData"][::core::mem::align_of::<CFLStoreData>() - 1usize];
10430 ["Offset of field: CFLStoreData::miiData"]
10431 [::core::mem::offset_of!(CFLStoreData, miiData) - 0usize];
10432 ["Offset of field: CFLStoreData::pad"][::core::mem::offset_of!(CFLStoreData, pad) - 92usize];
10433 ["Offset of field: CFLStoreData::crc16"]
10434 [::core::mem::offset_of!(CFLStoreData, crc16) - 94usize];
10435};
10436#[doc = "Birth date structure"]
10437#[repr(C, packed)]
10438#[derive(Debug, Default, Copy, Clone)]
10439pub struct BirthDate {
10440 pub year: u16_,
10441 pub month: u8_,
10442 pub day: u8_,
10443}
10444#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10445const _: () = {
10446 ["Size of BirthDate"][::core::mem::size_of::<BirthDate>() - 4usize];
10447 ["Alignment of BirthDate"][::core::mem::align_of::<BirthDate>() - 1usize];
10448 ["Offset of field: BirthDate::year"][::core::mem::offset_of!(BirthDate, year) - 0usize];
10449 ["Offset of field: BirthDate::month"][::core::mem::offset_of!(BirthDate, month) - 2usize];
10450 ["Offset of field: BirthDate::day"][::core::mem::offset_of!(BirthDate, day) - 3usize];
10451};
10452#[doc = "Account info structure"]
10453#[repr(C, packed)]
10454#[derive(Debug, Default, Copy, Clone)]
10455pub struct AccountInfo {
10456 pub persistentId: u32_,
10457 pub pad: [u8_; 4usize],
10458 pub transferableIdBase: u64_,
10459 pub mii: CFLStoreData,
10460 pub screenName: MiiScreenName,
10461 pub accountId: [::libc::c_char; 17usize],
10462 pub pad2: u8_,
10463 pub birthDate: BirthDate,
10464 pub principalId: u32_,
10465}
10466#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10467const _: () = {
10468 ["Size of AccountInfo"][::core::mem::size_of::<AccountInfo>() - 160usize];
10469 ["Alignment of AccountInfo"][::core::mem::align_of::<AccountInfo>() - 1usize];
10470 ["Offset of field: AccountInfo::persistentId"]
10471 [::core::mem::offset_of!(AccountInfo, persistentId) - 0usize];
10472 ["Offset of field: AccountInfo::pad"][::core::mem::offset_of!(AccountInfo, pad) - 4usize];
10473 ["Offset of field: AccountInfo::transferableIdBase"]
10474 [::core::mem::offset_of!(AccountInfo, transferableIdBase) - 8usize];
10475 ["Offset of field: AccountInfo::mii"][::core::mem::offset_of!(AccountInfo, mii) - 16usize];
10476 ["Offset of field: AccountInfo::screenName"]
10477 [::core::mem::offset_of!(AccountInfo, screenName) - 112usize];
10478 ["Offset of field: AccountInfo::accountId"]
10479 [::core::mem::offset_of!(AccountInfo, accountId) - 134usize];
10480 ["Offset of field: AccountInfo::pad2"][::core::mem::offset_of!(AccountInfo, pad2) - 151usize];
10481 ["Offset of field: AccountInfo::birthDate"]
10482 [::core::mem::offset_of!(AccountInfo, birthDate) - 152usize];
10483 ["Offset of field: AccountInfo::principalId"]
10484 [::core::mem::offset_of!(AccountInfo, principalId) - 156usize];
10485};
10486#[doc = "Account Timezone structure"]
10487#[repr(C, packed)]
10488#[derive(Debug, Copy, Clone)]
10489pub struct AccountTimezone {
10490 pub timezoneArea: [::libc::c_char; 65usize],
10491 pub pad: [::libc::c_char; 3usize],
10492 pub timezoneId: [::libc::c_char; 65usize],
10493 pub pad2: [::libc::c_char; 3usize],
10494 pub utcOffset: s64,
10495}
10496#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10497const _: () = {
10498 ["Size of AccountTimezone"][::core::mem::size_of::<AccountTimezone>() - 144usize];
10499 ["Alignment of AccountTimezone"][::core::mem::align_of::<AccountTimezone>() - 1usize];
10500 ["Offset of field: AccountTimezone::timezoneArea"]
10501 [::core::mem::offset_of!(AccountTimezone, timezoneArea) - 0usize];
10502 ["Offset of field: AccountTimezone::pad"]
10503 [::core::mem::offset_of!(AccountTimezone, pad) - 65usize];
10504 ["Offset of field: AccountTimezone::timezoneId"]
10505 [::core::mem::offset_of!(AccountTimezone, timezoneId) - 68usize];
10506 ["Offset of field: AccountTimezone::pad2"]
10507 [::core::mem::offset_of!(AccountTimezone, pad2) - 133usize];
10508 ["Offset of field: AccountTimezone::utcOffset"]
10509 [::core::mem::offset_of!(AccountTimezone, utcOffset) - 136usize];
10510};
10511impl Default for AccountTimezone {
10512 fn default() -> Self {
10513 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
10514 unsafe {
10515 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10516 s.assume_init()
10517 }
10518 }
10519}
10520#[doc = "Timezone List structure"]
10521#[repr(C, packed)]
10522#[derive(Debug, Copy, Clone)]
10523pub struct TimezoneList {
10524 pub capacity: u32_,
10525 pub count: u32_,
10526 pub timezones: [AccountTimezone; 32usize],
10527}
10528#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10529const _: () = {
10530 ["Size of TimezoneList"][::core::mem::size_of::<TimezoneList>() - 4616usize];
10531 ["Alignment of TimezoneList"][::core::mem::align_of::<TimezoneList>() - 1usize];
10532 ["Offset of field: TimezoneList::capacity"]
10533 [::core::mem::offset_of!(TimezoneList, capacity) - 0usize];
10534 ["Offset of field: TimezoneList::count"][::core::mem::offset_of!(TimezoneList, count) - 4usize];
10535 ["Offset of field: TimezoneList::timezones"]
10536 [::core::mem::offset_of!(TimezoneList, timezones) - 8usize];
10537};
10538impl Default for TimezoneList {
10539 fn default() -> Self {
10540 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
10541 unsafe {
10542 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10543 s.assume_init()
10544 }
10545 }
10546}
10547#[doc = "EULA Info structure"]
10548#[repr(C, packed)]
10549#[derive(Debug, Default, Copy, Clone)]
10550pub struct EulaInfo {
10551 #[doc = "< ISO 3166-1 A-2 country code"]
10552 pub countryCode: [::libc::c_char; 3usize],
10553 #[doc = "< ISO 639 Set 1 language code"]
10554 pub languageCode: [::libc::c_char; 3usize],
10555 pub eulaVersion: u16_,
10556}
10557#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10558const _: () = {
10559 ["Size of EulaInfo"][::core::mem::size_of::<EulaInfo>() - 8usize];
10560 ["Alignment of EulaInfo"][::core::mem::align_of::<EulaInfo>() - 1usize];
10561 ["Offset of field: EulaInfo::countryCode"]
10562 [::core::mem::offset_of!(EulaInfo, countryCode) - 0usize];
10563 ["Offset of field: EulaInfo::languageCode"]
10564 [::core::mem::offset_of!(EulaInfo, languageCode) - 3usize];
10565 ["Offset of field: EulaInfo::eulaVersion"]
10566 [::core::mem::offset_of!(EulaInfo, eulaVersion) - 6usize];
10567};
10568#[doc = "Existent Server Account Data structure"]
10569#[repr(C, packed)]
10570#[derive(Debug, Copy, Clone)]
10571pub struct ExistentServerAccountData {
10572 pub hasMii: bool,
10573 pub pad: [u8_; 3usize],
10574 pub miiData: CFLStoreData,
10575 pub principalId: u32_,
10576 pub coppaRequiredFlag: bool,
10577 pub pad2: [u8_; 3usize],
10578 pub coppaMailData: CoppaCodeMailData,
10579 pub pad3: u8_,
10580 pub birthDate: BirthDate,
10581}
10582#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10583const _: () = {
10584 ["Size of ExistentServerAccountData"]
10585 [::core::mem::size_of::<ExistentServerAccountData>() - 376usize];
10586 ["Alignment of ExistentServerAccountData"]
10587 [::core::mem::align_of::<ExistentServerAccountData>() - 1usize];
10588 ["Offset of field: ExistentServerAccountData::hasMii"]
10589 [::core::mem::offset_of!(ExistentServerAccountData, hasMii) - 0usize];
10590 ["Offset of field: ExistentServerAccountData::pad"]
10591 [::core::mem::offset_of!(ExistentServerAccountData, pad) - 1usize];
10592 ["Offset of field: ExistentServerAccountData::miiData"]
10593 [::core::mem::offset_of!(ExistentServerAccountData, miiData) - 4usize];
10594 ["Offset of field: ExistentServerAccountData::principalId"]
10595 [::core::mem::offset_of!(ExistentServerAccountData, principalId) - 100usize];
10596 ["Offset of field: ExistentServerAccountData::coppaRequiredFlag"]
10597 [::core::mem::offset_of!(ExistentServerAccountData, coppaRequiredFlag) - 104usize];
10598 ["Offset of field: ExistentServerAccountData::pad2"]
10599 [::core::mem::offset_of!(ExistentServerAccountData, pad2) - 105usize];
10600 ["Offset of field: ExistentServerAccountData::coppaMailData"]
10601 [::core::mem::offset_of!(ExistentServerAccountData, coppaMailData) - 108usize];
10602 ["Offset of field: ExistentServerAccountData::pad3"]
10603 [::core::mem::offset_of!(ExistentServerAccountData, pad3) - 371usize];
10604 ["Offset of field: ExistentServerAccountData::birthDate"]
10605 [::core::mem::offset_of!(ExistentServerAccountData, birthDate) - 372usize];
10606};
10607impl Default for ExistentServerAccountData {
10608 fn default() -> Self {
10609 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
10610 unsafe {
10611 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10612 s.assume_init()
10613 }
10614 }
10615}
10616#[doc = "EULA entry header structure"]
10617#[repr(C, packed)]
10618pub struct EulaEntry {
10619 #[doc = "< ISO 3166-1 A-2 country code"]
10620 pub countryCode: [::libc::c_char; 3usize],
10621 pub pad: u8_,
10622 #[doc = "< ISO 639 Set 1 language code"]
10623 pub languageCode: [::libc::c_char; 3usize],
10624 pub pad2: u8_,
10625 pub eulaVersion: u16_,
10626 pub pad3: [u8_; 2usize],
10627 #[doc = "< Offset of next EULA entry, relative to full data blob."]
10628 pub nextEntryOffset: u32_,
10629 #[doc = "< Offset of the EulaType within textData."]
10630 pub eulaTypeOffset: u32_,
10631 #[doc = "< Offset of the AgreeText within textData."]
10632 pub agreeTextOffset: u32_,
10633 #[doc = "< Offset of the NonAgreeText within textData."]
10634 pub nonAgreeTextOffset: u32_,
10635 #[doc = "< Offset of the LanguageName within textData."]
10636 pub languageNameOffset: u32_,
10637 #[doc = "< Offset of the MainTitle within textData."]
10638 pub mainTitleOffset: u32_,
10639 #[doc = "< Offset of the MainText within textData."]
10640 pub mainTextOffset: u32_,
10641 #[doc = "< Offset of the SubTitle within textData."]
10642 pub subTitleOffset: u32_,
10643 #[doc = "< Offset of the SubText within textData."]
10644 pub subTextOffset: u32_,
10645 pub textData: __IncompleteArrayField<::libc::c_char>,
10646}
10647#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10648const _: () = {
10649 ["Size of EulaEntry"][::core::mem::size_of::<EulaEntry>() - 48usize];
10650 ["Alignment of EulaEntry"][::core::mem::align_of::<EulaEntry>() - 1usize];
10651 ["Offset of field: EulaEntry::countryCode"]
10652 [::core::mem::offset_of!(EulaEntry, countryCode) - 0usize];
10653 ["Offset of field: EulaEntry::pad"][::core::mem::offset_of!(EulaEntry, pad) - 3usize];
10654 ["Offset of field: EulaEntry::languageCode"]
10655 [::core::mem::offset_of!(EulaEntry, languageCode) - 4usize];
10656 ["Offset of field: EulaEntry::pad2"][::core::mem::offset_of!(EulaEntry, pad2) - 7usize];
10657 ["Offset of field: EulaEntry::eulaVersion"]
10658 [::core::mem::offset_of!(EulaEntry, eulaVersion) - 8usize];
10659 ["Offset of field: EulaEntry::pad3"][::core::mem::offset_of!(EulaEntry, pad3) - 10usize];
10660 ["Offset of field: EulaEntry::nextEntryOffset"]
10661 [::core::mem::offset_of!(EulaEntry, nextEntryOffset) - 12usize];
10662 ["Offset of field: EulaEntry::eulaTypeOffset"]
10663 [::core::mem::offset_of!(EulaEntry, eulaTypeOffset) - 16usize];
10664 ["Offset of field: EulaEntry::agreeTextOffset"]
10665 [::core::mem::offset_of!(EulaEntry, agreeTextOffset) - 20usize];
10666 ["Offset of field: EulaEntry::nonAgreeTextOffset"]
10667 [::core::mem::offset_of!(EulaEntry, nonAgreeTextOffset) - 24usize];
10668 ["Offset of field: EulaEntry::languageNameOffset"]
10669 [::core::mem::offset_of!(EulaEntry, languageNameOffset) - 28usize];
10670 ["Offset of field: EulaEntry::mainTitleOffset"]
10671 [::core::mem::offset_of!(EulaEntry, mainTitleOffset) - 32usize];
10672 ["Offset of field: EulaEntry::mainTextOffset"]
10673 [::core::mem::offset_of!(EulaEntry, mainTextOffset) - 36usize];
10674 ["Offset of field: EulaEntry::subTitleOffset"]
10675 [::core::mem::offset_of!(EulaEntry, subTitleOffset) - 40usize];
10676 ["Offset of field: EulaEntry::subTextOffset"]
10677 [::core::mem::offset_of!(EulaEntry, subTextOffset) - 44usize];
10678 ["Offset of field: EulaEntry::textData"]
10679 [::core::mem::offset_of!(EulaEntry, textData) - 48usize];
10680};
10681impl Default for EulaEntry {
10682 fn default() -> Self {
10683 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
10684 unsafe {
10685 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10686 s.assume_init()
10687 }
10688 }
10689}
10690#[doc = "Support Context structure"]
10691#[repr(C, packed)]
10692#[derive(Debug, Default, Copy, Clone)]
10693pub struct SupportContext {
10694 #[doc = "< Account ID of the account."]
10695 pub accountId: AccountId,
10696 pub pad: [u8_; 3usize],
10697 #[doc = "< Serial number of the console (only digits)."]
10698 pub serialNumber: u32_,
10699 pub principalId: u32_,
10700 #[doc = "< Random number based on the principalId and serialNumber."]
10701 pub randomNumber: u16_,
10702 pub pad2: [u8_; 2usize],
10703}
10704#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10705const _: () = {
10706 ["Size of SupportContext"][::core::mem::size_of::<SupportContext>() - 32usize];
10707 ["Alignment of SupportContext"][::core::mem::align_of::<SupportContext>() - 1usize];
10708 ["Offset of field: SupportContext::accountId"]
10709 [::core::mem::offset_of!(SupportContext, accountId) - 0usize];
10710 ["Offset of field: SupportContext::pad"]
10711 [::core::mem::offset_of!(SupportContext, pad) - 17usize];
10712 ["Offset of field: SupportContext::serialNumber"]
10713 [::core::mem::offset_of!(SupportContext, serialNumber) - 20usize];
10714 ["Offset of field: SupportContext::principalId"]
10715 [::core::mem::offset_of!(SupportContext, principalId) - 24usize];
10716 ["Offset of field: SupportContext::randomNumber"]
10717 [::core::mem::offset_of!(SupportContext, randomNumber) - 28usize];
10718 ["Offset of field: SupportContext::pad2"]
10719 [::core::mem::offset_of!(SupportContext, pad2) - 30usize];
10720};
10721#[doc = "EULA list structure"]
10722#[repr(C)]
10723#[derive(Debug, Default)]
10724pub struct EulaList {
10725 #[doc = "< Number of entries within the list."]
10726 pub numEntries: u8_,
10727 #[doc = "< EULA Entries (dynamically sized)"]
10728 pub entries: __IncompleteArrayField<u8_>,
10729}
10730#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10731const _: () = {
10732 ["Size of EulaList"][::core::mem::size_of::<EulaList>() - 1usize];
10733 ["Alignment of EulaList"][::core::mem::align_of::<EulaList>() - 1usize];
10734 ["Offset of field: EulaList::numEntries"]
10735 [::core::mem::offset_of!(EulaList, numEntries) - 0usize];
10736 ["Offset of field: EulaList::entries"][::core::mem::offset_of!(EulaList, entries) - 1usize];
10737};
10738#[doc = "Device Info structure"]
10739#[repr(C)]
10740#[derive(Debug, Default, Copy, Clone)]
10741pub struct DeviceInfo {
10742 pub deviceId: u32_,
10743 pub serialNumber: [::libc::c_char; 16usize],
10744}
10745#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10746const _: () = {
10747 ["Size of DeviceInfo"][::core::mem::size_of::<DeviceInfo>() - 20usize];
10748 ["Alignment of DeviceInfo"][::core::mem::align_of::<DeviceInfo>() - 4usize];
10749 ["Offset of field: DeviceInfo::deviceId"]
10750 [::core::mem::offset_of!(DeviceInfo, deviceId) - 0usize];
10751 ["Offset of field: DeviceInfo::serialNumber"]
10752 [::core::mem::offset_of!(DeviceInfo, serialNumber) - 4usize];
10753};
10754#[doc = "NEX service token structure"]
10755#[repr(C)]
10756#[derive(Debug, Copy, Clone)]
10757pub struct NexServiceToken {
10758 pub serviceToken: [::libc::c_char; 513usize],
10759 pub pad: [u8_; 3usize],
10760 pub password: [::libc::c_char; 65usize],
10761 pub pad2: [u8_; 3usize],
10762 pub serverHost: [::libc::c_char; 16usize],
10763 pub serverPort: u16_,
10764 pub pad3: [u8_; 2usize],
10765}
10766#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10767const _: () = {
10768 ["Size of NexServiceToken"][::core::mem::size_of::<NexServiceToken>() - 604usize];
10769 ["Alignment of NexServiceToken"][::core::mem::align_of::<NexServiceToken>() - 2usize];
10770 ["Offset of field: NexServiceToken::serviceToken"]
10771 [::core::mem::offset_of!(NexServiceToken, serviceToken) - 0usize];
10772 ["Offset of field: NexServiceToken::pad"]
10773 [::core::mem::offset_of!(NexServiceToken, pad) - 513usize];
10774 ["Offset of field: NexServiceToken::password"]
10775 [::core::mem::offset_of!(NexServiceToken, password) - 516usize];
10776 ["Offset of field: NexServiceToken::pad2"]
10777 [::core::mem::offset_of!(NexServiceToken, pad2) - 581usize];
10778 ["Offset of field: NexServiceToken::serverHost"]
10779 [::core::mem::offset_of!(NexServiceToken, serverHost) - 584usize];
10780 ["Offset of field: NexServiceToken::serverPort"]
10781 [::core::mem::offset_of!(NexServiceToken, serverPort) - 600usize];
10782 ["Offset of field: NexServiceToken::pad3"]
10783 [::core::mem::offset_of!(NexServiceToken, pad3) - 602usize];
10784};
10785impl Default for NexServiceToken {
10786 fn default() -> Self {
10787 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
10788 unsafe {
10789 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10790 s.assume_init()
10791 }
10792 }
10793}
10794#[doc = "Credit Card Info structure"]
10795#[repr(C)]
10796#[derive(Debug, Copy, Clone)]
10797pub struct CreditCardInfo {
10798 pub cardType: u8_,
10799 pub cardNumber: [::libc::c_char; 17usize],
10800 pub securityCode: [::libc::c_char; 4usize],
10801 pub expirationMonth: u8_,
10802 pub expirationYear: u8_,
10803 pub postalCode: [::libc::c_char; 7usize],
10804 pub mailAddress: AccountMailAddress,
10805}
10806#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10807const _: () = {
10808 ["Size of CreditCardInfo"][::core::mem::size_of::<CreditCardInfo>() - 288usize];
10809 ["Alignment of CreditCardInfo"][::core::mem::align_of::<CreditCardInfo>() - 1usize];
10810 ["Offset of field: CreditCardInfo::cardType"]
10811 [::core::mem::offset_of!(CreditCardInfo, cardType) - 0usize];
10812 ["Offset of field: CreditCardInfo::cardNumber"]
10813 [::core::mem::offset_of!(CreditCardInfo, cardNumber) - 1usize];
10814 ["Offset of field: CreditCardInfo::securityCode"]
10815 [::core::mem::offset_of!(CreditCardInfo, securityCode) - 18usize];
10816 ["Offset of field: CreditCardInfo::expirationMonth"]
10817 [::core::mem::offset_of!(CreditCardInfo, expirationMonth) - 22usize];
10818 ["Offset of field: CreditCardInfo::expirationYear"]
10819 [::core::mem::offset_of!(CreditCardInfo, expirationYear) - 23usize];
10820 ["Offset of field: CreditCardInfo::postalCode"]
10821 [::core::mem::offset_of!(CreditCardInfo, postalCode) - 24usize];
10822 ["Offset of field: CreditCardInfo::mailAddress"]
10823 [::core::mem::offset_of!(CreditCardInfo, mailAddress) - 31usize];
10824};
10825impl Default for CreditCardInfo {
10826 fn default() -> Self {
10827 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
10828 unsafe {
10829 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10830 s.assume_init()
10831 }
10832 }
10833}
10834#[doc = "V1 Independent service token structure"]
10835#[repr(C)]
10836#[derive(Debug, Copy, Clone)]
10837pub struct IndependentServiceTokenV1 {
10838 #[doc = "< base64"]
10839 pub token: [::libc::c_char; 513usize],
10840}
10841#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10842const _: () = {
10843 ["Size of IndependentServiceTokenV1"]
10844 [::core::mem::size_of::<IndependentServiceTokenV1>() - 513usize];
10845 ["Alignment of IndependentServiceTokenV1"]
10846 [::core::mem::align_of::<IndependentServiceTokenV1>() - 1usize];
10847 ["Offset of field: IndependentServiceTokenV1::token"]
10848 [::core::mem::offset_of!(IndependentServiceTokenV1, token) - 0usize];
10849};
10850impl Default for IndependentServiceTokenV1 {
10851 fn default() -> Self {
10852 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
10853 unsafe {
10854 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10855 s.assume_init()
10856 }
10857 }
10858}
10859#[doc = "V2 Independent service token structure"]
10860#[repr(C)]
10861#[derive(Debug, Copy, Clone)]
10862pub struct IndependentServiceTokenV2 {
10863 #[doc = "< base64"]
10864 pub token: [::libc::c_char; 513usize],
10865 #[doc = "< base64"]
10866 pub iv: [::libc::c_char; 25usize],
10867 #[doc = "< base64"]
10868 pub signature: [::libc::c_char; 345usize],
10869 pub nfsTypeStr: NfsTypeStr,
10870}
10871#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10872const _: () = {
10873 ["Size of IndependentServiceTokenV2"]
10874 [::core::mem::size_of::<IndependentServiceTokenV2>() - 886usize];
10875 ["Alignment of IndependentServiceTokenV2"]
10876 [::core::mem::align_of::<IndependentServiceTokenV2>() - 1usize];
10877 ["Offset of field: IndependentServiceTokenV2::token"]
10878 [::core::mem::offset_of!(IndependentServiceTokenV2, token) - 0usize];
10879 ["Offset of field: IndependentServiceTokenV2::iv"]
10880 [::core::mem::offset_of!(IndependentServiceTokenV2, iv) - 513usize];
10881 ["Offset of field: IndependentServiceTokenV2::signature"]
10882 [::core::mem::offset_of!(IndependentServiceTokenV2, signature) - 538usize];
10883 ["Offset of field: IndependentServiceTokenV2::nfsTypeStr"]
10884 [::core::mem::offset_of!(IndependentServiceTokenV2, nfsTypeStr) - 883usize];
10885};
10886impl Default for IndependentServiceTokenV2 {
10887 fn default() -> Self {
10888 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
10889 unsafe {
10890 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10891 s.assume_init()
10892 }
10893 }
10894}
10895#[doc = "Account server types structure (raw format)"]
10896#[repr(C)]
10897#[derive(Debug, Default, Copy, Clone)]
10898pub struct AccountServerTypes {
10899 #[doc = "< NNAS (Nintendo Network Authentication Server) type"]
10900 pub nnasType: u8_,
10901 #[doc = "< NFS (Nintendo Friend Server) type"]
10902 pub nfsType: u8_,
10903 #[doc = "< NFS (Nintendo Friend Server) number"]
10904 pub nfsNo: u8_,
10905 pub pad: u8_,
10906}
10907#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10908const _: () = {
10909 ["Size of AccountServerTypes"][::core::mem::size_of::<AccountServerTypes>() - 4usize];
10910 ["Alignment of AccountServerTypes"][::core::mem::align_of::<AccountServerTypes>() - 1usize];
10911 ["Offset of field: AccountServerTypes::nnasType"]
10912 [::core::mem::offset_of!(AccountServerTypes, nnasType) - 0usize];
10913 ["Offset of field: AccountServerTypes::nfsType"]
10914 [::core::mem::offset_of!(AccountServerTypes, nfsType) - 1usize];
10915 ["Offset of field: AccountServerTypes::nfsNo"]
10916 [::core::mem::offset_of!(AccountServerTypes, nfsNo) - 2usize];
10917 ["Offset of field: AccountServerTypes::pad"]
10918 [::core::mem::offset_of!(AccountServerTypes, pad) - 3usize];
10919};
10920#[doc = "Account server types structure (string format)"]
10921#[repr(C)]
10922#[derive(Debug, Copy, Clone)]
10923pub struct AccountServerTypesStr {
10924 #[doc = "< NNAS (Nintendo Network Authentication Server) subdomain"]
10925 pub nnasSubdomain: ActNnasSubdomain,
10926 #[doc = "< NFS (Nintendo Friend Server) type string (letter + number)"]
10927 pub nfsTypeStr: NfsTypeStr,
10928}
10929#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10930const _: () = {
10931 ["Size of AccountServerTypesStr"][::core::mem::size_of::<AccountServerTypesStr>() - 36usize];
10932 ["Alignment of AccountServerTypesStr"]
10933 [::core::mem::align_of::<AccountServerTypesStr>() - 1usize];
10934 ["Offset of field: AccountServerTypesStr::nnasSubdomain"]
10935 [::core::mem::offset_of!(AccountServerTypesStr, nnasSubdomain) - 0usize];
10936 ["Offset of field: AccountServerTypesStr::nfsTypeStr"]
10937 [::core::mem::offset_of!(AccountServerTypesStr, nfsTypeStr) - 33usize];
10938};
10939impl Default for AccountServerTypesStr {
10940 fn default() -> Self {
10941 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
10942 unsafe {
10943 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10944 s.assume_init()
10945 }
10946 }
10947}
10948#[doc = "Account access token structure"]
10949#[repr(C)]
10950#[derive(Debug, Copy, Clone)]
10951pub struct AccountAccessToken {
10952 #[doc = "< AccountAccessTokenState enum"]
10953 pub state: u8_,
10954 pub accessToken: [::libc::c_char; 33usize],
10955 pub refreshToken: [::libc::c_char; 41usize],
10956 pub pad: u8_,
10957}
10958#[allow(clippy::unnecessary_operation, clippy::identity_op)]
10959const _: () = {
10960 ["Size of AccountAccessToken"][::core::mem::size_of::<AccountAccessToken>() - 76usize];
10961 ["Alignment of AccountAccessToken"][::core::mem::align_of::<AccountAccessToken>() - 1usize];
10962 ["Offset of field: AccountAccessToken::state"]
10963 [::core::mem::offset_of!(AccountAccessToken, state) - 0usize];
10964 ["Offset of field: AccountAccessToken::accessToken"]
10965 [::core::mem::offset_of!(AccountAccessToken, accessToken) - 1usize];
10966 ["Offset of field: AccountAccessToken::refreshToken"]
10967 [::core::mem::offset_of!(AccountAccessToken, refreshToken) - 34usize];
10968 ["Offset of field: AccountAccessToken::pad"]
10969 [::core::mem::offset_of!(AccountAccessToken, pad) - 75usize];
10970};
10971impl Default for AccountAccessToken {
10972 fn default() -> Self {
10973 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
10974 unsafe {
10975 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
10976 s.assume_init()
10977 }
10978 }
10979}
10980unsafe extern "C" {
10981 #[must_use]
10982 #[doc = "Initializes ACT services.\n # Arguments\n\n* `forceUser` - Whether or not to force using the user service act:u instead of the default (admin service act:a)."]
10983 pub fn actInit(forceUser: bool) -> Result;
10984}
10985unsafe extern "C" {
10986 #[doc = "Exits ACT services."]
10987 pub fn actExit();
10988}
10989unsafe extern "C" {
10990 #[doc = "Get the ACT user/admin service handle."]
10991 pub fn actGetSessionHandle() -> *mut Handle;
10992}
10993unsafe extern "C" {
10994 #[must_use]
10995 #[doc = "Initializes the current ACT session.\n # Arguments\n\n* `sdkVersion` - The SDK version of the client process.\n * `sharedMemSize` - The size of the shared memory block.\n * `sharedMem` - Handle to the shared memory block."]
10996 pub fn ACT_Initialize(sdkVersion: u32_, sharedMemSize: u32_, sharedMem: Handle) -> Result;
10997}
10998unsafe extern "C" {
10999 #[must_use]
11000 #[doc = "Returns a support error code (XXX-YYYY) for the given ACT result code.\n # Arguments\n\n* `code` - The result code to convert."]
11001 pub fn ACT_ResultToErrorCode(code: Result) -> Result;
11002}
11003unsafe extern "C" {
11004 #[must_use]
11005 #[doc = "Gets the result of the last internal operation."]
11006 pub fn ACT_GetLastResponseResult() -> Result;
11007}
11008unsafe extern "C" {
11009 #[must_use]
11010 #[doc = "Cancels any currently running async operation."]
11011 pub fn ACT_Cancel() -> Result;
11012}
11013unsafe extern "C" {
11014 #[must_use]
11015 #[doc = "Retrieves information not specific to any one account.\n # Arguments\n\n* `output` - Pointer to buffer to output the data to.\n * `outputSize` - Size of the output buffer.\n * `infoType` - The type of data to retrieve."]
11016 pub fn ACT_GetCommonInfo(
11017 output: *mut ::libc::c_void,
11018 outputSize: u32_,
11019 infoType: u32_,
11020 ) -> Result;
11021}
11022unsafe extern "C" {
11023 #[must_use]
11024 #[doc = "Retrieves information of a certain account.\n # Arguments\n\n* `output` - Pointer to buffer to output the data to.\n * `outputSize` - Size of the output buffer.\n * `accountSlot` - The account slot number of the account to retrieve information for.\n * `infoType` - The type of data to retrieve."]
11025 pub fn ACT_GetAccountInfo(
11026 output: *mut ::libc::c_void,
11027 outputSize: u32_,
11028 accountSlot: u8_,
11029 infoType: u32_,
11030 ) -> Result;
11031}
11032unsafe extern "C" {
11033 #[must_use]
11034 #[doc = "Returns the data resulting from an async request.\n # Arguments\n\n* `outReadSize` - Pointer to output the number of retrieved bytes to.\n * `output` - Pointer to buffer to output the data to.\n * `outputSize` - Size of the output buffer.\n * `requestType` - The type of async request to retrieve data for."]
11035 pub fn ACT_GetAsyncResult(
11036 outReadSize: *mut u32_,
11037 output: *mut ::libc::c_void,
11038 outputSize: u32_,
11039 requestType: u32_,
11040 ) -> Result;
11041}
11042unsafe extern "C" {
11043 #[must_use]
11044 #[doc = "Gets one of the Mii images of a certain account.\n # Arguments\n\n* `outSize` - Pointer to output the raw size of the image to.\n * `output` - Pointer to output the image data to.\n * `outputSize` - Size of the output buffer.\n * `accountSlot` - The account slot number of the account to get the Mii image for.\n * `miiImageType` - The type of the Mii image to get."]
11045 pub fn ACT_GetMiiImage(
11046 outSize: *mut u32_,
11047 output: *mut ::libc::c_void,
11048 outputSize: u32_,
11049 accountSlot: u8_,
11050 miiImageType: u8_,
11051 ) -> Result;
11052}
11053unsafe extern "C" {
11054 #[must_use]
11055 #[doc = "Sets the NFS (Nintendo Friend Server) password for a certain account.\n # Arguments\n\n* `accountSlot` - The account slot number of the account to set the NfsPassword for.\n * `password` - Pointer to the new NFS password to use."]
11056 pub fn ACT_SetNfsPassword(accountSlot: u8_, password: *mut ::libc::c_char) -> Result;
11057}
11058unsafe extern "C" {
11059 #[must_use]
11060 #[doc = "Sets the `IsApplicationUpdateRequired` field in the internal account manager.\n # Arguments\n\n* `required` - The new value to use."]
11061 pub fn ACT_SetIsApplicationUpdateRequired(required: bool) -> Result;
11062}
11063unsafe extern "C" {
11064 #[must_use]
11065 #[doc = "Acquires a list of EULA agreements for the specified country.\n # Arguments\n\n* `countryCode` - The country code of the country to acquire EULA agreements for.\n * `completionEvent` - The event handle to signal when the request has finished."]
11066 pub fn ACT_AcquireEulaList(countryCode: u8_, completionEvent: Handle) -> Result;
11067}
11068unsafe extern "C" {
11069 #[must_use]
11070 #[doc = "Acquires a list of timezones for the specified country and language combination.\n # Arguments\n\n* `countryCode` - The country code of the country to acquire time zones for.\n * `language` - code The language code of the language to acquire the time zones in.\n * `completionEvent` - The event handle to signal when the request has finished."]
11071 pub fn ACT_AcquireTimezoneList(
11072 countryCode: u8_,
11073 languageCode: u8_,
11074 completionEvent: Handle,
11075 ) -> Result;
11076}
11077unsafe extern "C" {
11078 #[must_use]
11079 #[doc = "Generates a UUID.\n # Arguments\n\n* `uuid` - Pointer to output the generated UUID to.\n * `uniqueId` - The unique ID to use during generation. Special values include `ACT_UUID_REGULAR` and `ACT_UUID_CURRENT_PROCESS`."]
11080 pub fn ACT_GenerateUuid(uuid: *mut ActUuid, uniqueId: u32_) -> Result;
11081}
11082unsafe extern "C" {
11083 #[must_use]
11084 #[doc = "Gets a specific account's UUID.\n # Arguments\n\n* `uuid` - Pointer to output the UUID to.\n * `uniqueId` - The unique ID to use during the retrieval of the UUID. Special values include `ACT_UUID_REGULAR` and `ACT_UUID_CURRENT_PROCESS`."]
11085 pub fn ACT_GetUuid(uuid: *mut ActUuid, accountSlot: u8_, uniqueId: u32_) -> Result;
11086}
11087unsafe extern "C" {
11088 #[must_use]
11089 #[doc = "Finds the account slot number of the account having the specified UUID.\n # Arguments\n\n* `accountSlot` - Pointer to output the account slot number to.\n * `uuid` - Pointer to the UUID to find the account slot number for.\n * `uniqueId` - The unique ID to use during internal UUID generation. Special values include `ACT_UUID_REGULAR` and `ACT_UUID_CURRENT_PROCESS`."]
11090 pub fn ACT_FindSlotNoByUuid(
11091 accountSlot: *mut u8_,
11092 uuid: *mut ActUuid,
11093 uniqueId: u32_,
11094 ) -> Result;
11095}
11096unsafe extern "C" {
11097 #[must_use]
11098 #[doc = "Saves all pending changes to the ACT system save data."]
11099 pub fn ACT_Save() -> Result;
11100}
11101unsafe extern "C" {
11102 #[must_use]
11103 #[doc = "Returns a TransferableID for a certain account.\n # Arguments\n\n* `transferableId` - Pointer to output the generated TransferableID to.\n * `accountSlot` - The account slot number of the account to generate the TransferableID for. Special values include `ACT_TRANSFERABLE_ID_BASE_COMMON` and `ACT_TRANSFERABLE_ID_BASE_CURRENT_ACCOUNT`.\n * `saltValue` - The value to use as a salt during generation."]
11104 pub fn ACT_GetTransferableId(
11105 transferableId: *mut u64_,
11106 accountSlot: u8_,
11107 saltValue: u8_,
11108 ) -> Result;
11109}
11110unsafe extern "C" {
11111 #[must_use]
11112 #[doc = "Acquires an account-specific service token for a NEX server.\n # Arguments\n\n* `accountSlot` - The account slot number of the account to use for acquiring the token.\n * `serverId` - The NEX server ID to request a service token for.\n * `doParentalControlsCheck` - Whether or not to perform a parental controls check before requesting the token. (unused)\n * `callerProcessId` - The process ID of the process requesting the token.\n * `completionEvent` - The event handle to signal once the request has finished."]
11113 pub fn ACT_AcquireNexServiceToken(
11114 accountSlot: u8_,
11115 serverId: u32_,
11116 doParentralControlsCheck: bool,
11117 callerProcessId: u32_,
11118 completionEvent: Handle,
11119 ) -> Result;
11120}
11121unsafe extern "C" {
11122 #[must_use]
11123 #[doc = "Gets a NEX service token requested using ACT_AcquireNexServiceToken.\n # Arguments\n\n* `token` - Pointer to output the NEX service token data to."]
11124 pub fn ACT_GetNexServiceToken(token: *mut NexServiceToken) -> Result;
11125}
11126unsafe extern "C" {
11127 #[must_use]
11128 #[doc = "Requests a V1 independent service token for a specific account.\n # Arguments\n\n* `accountSlot` - The account slot number of the account to request the token with.\n * `clientId` - The client ID to use for requesting the independent service token.\n * `cacheDuration` - The duration in seconds to cache the token. If a token was requested within the past cacheDuration seconds, this command returns that token instead of requesting a new one. Passing 0 will cause ACT to always request a new token.\n * `doParentalControlsCheck` - Whether or not to perform a parental controls check before requesting the token. (unused)\n * `shared` - Whether or not this token should be shared with other processes. If set to false, it will only be accessible to the process with the given process ID.\n * `callerProcessId` - The process ID of the process requesting the token.\n * `completionEvent` - The event handle to signal once the request has finished."]
11129 pub fn ACT_AcquireIndependentServiceToken(
11130 accountSlot: u8_,
11131 clientId: *mut ::libc::c_char,
11132 cacheDuration: u32_,
11133 doParentalControlsCheck: bool,
11134 shared: bool,
11135 callerProcessId: u32_,
11136 completionEvent: Handle,
11137 ) -> Result;
11138}
11139unsafe extern "C" {
11140 #[must_use]
11141 #[doc = "Gets a V1 independent service token requested using ACT_AcquireIndependentServiceToken.\n # Arguments\n\n* `token` - Pointer to output the V1 independent service token to."]
11142 pub fn ACT_GetIndependentServiceToken(token: *mut IndependentServiceTokenV1) -> Result;
11143}
11144unsafe extern "C" {
11145 #[must_use]
11146 #[doc = "Acquires account information for the specified account.\n # Arguments\n\n* `accountSlot` - The account slot number to acquire information for.\n * `infoType` - The type of info to obtain. (only INFO_TYPE_MAIL_ADDRESS is supported.)\n * `completionEvent` - The event handle to signal once the request has finished."]
11147 pub fn ACT_AcquireAccountInfo(
11148 accountSlot: u8_,
11149 infoType: u32_,
11150 completionEvent: Handle,
11151 ) -> Result;
11152}
11153unsafe extern "C" {
11154 #[must_use]
11155 #[doc = "Acquires account IDs from a list of principal IDs.\n # Arguments\n\n* `principalIds` - Pointer to the input principal IDs.\n * `principalIdsSize` - Size of the input principal IDs buffer.\n * `unk` - Unknown value. Must be 0.\n * `completionEvent` - The event handle to signal once the request has finished."]
11156 pub fn ACT_AcquireAccountIdByPrincipalId(
11157 principalIds: *mut u32_,
11158 principalIdsSize: u32_,
11159 unk: u8_,
11160 completionEvent: Handle,
11161 ) -> Result;
11162}
11163unsafe extern "C" {
11164 #[must_use]
11165 #[doc = "Acquires principal IDs from a list of account IDs.\n # Arguments\n\n* `accountIds` - Pointer to input account IDs.\n * `accountIdsSize` - Size of the input account IDs buffer.\n * `completionEvent` - The event handle to signal once the request has finished."]
11166 pub fn ACT_AcquirePrincipalIdByAccountId(
11167 accountIds: *mut AccountId,
11168 accountIdsSize: u32_,
11169 completionHandle: Handle,
11170 ) -> Result;
11171}
11172unsafe extern "C" {
11173 #[must_use]
11174 #[doc = "Acquires Miis corresponding to a given list of persistent IDs.\n # Arguments\n\n* `persistentIds` - Pointer to input persistent IDs to use.\n * `persistentIdsSize` - Size of the input persistent IDs buffer.\n * `completionEvent` - The event handle to signal once the request has finished."]
11175 pub fn ACT_AcquireMii(
11176 persistentIds: *mut u32_,
11177 persistentIdsSize: u32_,
11178 completionEvent: Handle,
11179 ) -> Result;
11180}
11181unsafe extern "C" {
11182 #[must_use]
11183 #[doc = "Acquires raw (XML) account info for the specified account.\n # Arguments\n\n* `accountSlot` - The account slot number of the account to acquire raw info for."]
11184 pub fn ACT_AcquireAccountInfoRaw(accountSlot: u8_, completionEvent: Handle) -> Result;
11185}
11186unsafe extern "C" {
11187 #[must_use]
11188 #[doc = "Gets a cached V1 independent service token for a specific account.\n # Arguments\n\n* `accountSlot` - The account slot number of the account to get the token for.\n * `clientId` - The client ID to use for the cache lookup.\n * `cacheDuration` - The duration in seconds ago this token must have been requested in at least for it to be eligible for retrieval.\n * `doParentalControlsCheck` - Whether or not to perform a parental controls check before getting the token. (unused)\n * `shared` - Whether or not to only look for shared (non-process-specific) tokens in the cache."]
11189 pub fn ACT_GetCachedIndependentServiceToken(
11190 token: *mut IndependentServiceTokenV1,
11191 accountSlot: u8_,
11192 clientId: *mut ::libc::c_char,
11193 cacheDuration: u32_,
11194 doParentralControlsCheck: bool,
11195 shared: bool,
11196 ) -> Result;
11197}
11198unsafe extern "C" {
11199 #[must_use]
11200 #[doc = "Inquires whether or not the given email address is available for creating a new account.\n # Arguments\n\n* `mailAddress` - Pointer to the input email address to check.\n * `completionEvent` - The event handle to signal once the request has finished."]
11201 pub fn ACT_InquireMailAddressAvailability(
11202 mailAddress: *mut AccountMailAddress,
11203 completionEvent: Handle,
11204 ) -> Result;
11205}
11206unsafe extern "C" {
11207 #[must_use]
11208 #[doc = "Acquires the EULA for the given country and language combination.\n # Arguments\n\n* `countryCode` - The country code of the country for the EULA.\n * `languageCode` - The 2-character ISO 639 Set 1 language code for the EULA.\n * `completionEvent` - The event handle to signal once the request has finished."]
11209 pub fn ACT_AcquireEula(
11210 countryCode: u8_,
11211 languageCode: *mut ::libc::c_char,
11212 completionEvent: Handle,
11213 ) -> Result;
11214}
11215unsafe extern "C" {
11216 #[must_use]
11217 #[doc = "Acquires a list of languages the EULA is available in for a given country.\n # Arguments\n\n* `countryCode` - The country code to acquire the EULA language list for.\n * `completionEvent` - The event handle to signal once the request has finished."]
11218 pub fn ACT_AcquireEulaLanguageList(countryCode: u8_, completionEvent: Handle) -> Result;
11219}
11220unsafe extern "C" {
11221 #[must_use]
11222 #[doc = "Requests a V2 independent service token for a specific account.\n # Arguments\n\n* `accountSlot` - The account slot number of the account to request the token with.\n * `clientId` - The client ID to use for requesting the independent service token.\n * `cacheDuration` - The duration in seconds to cache the token. If a token was requested within the past cacheDuration seconds, this command returns that token instead of requesting a new one. Passing 0 will cause ACT to always request a new token.\n * `doParentalControlsCheck` - Whether or not to perform a parental controls check before requesting the token. (unused)\n * `shared` - Whether or not this token should be shared with other processes. If set to false, it will only be accessible to the process with the given process ID.\n * `callerProcessId` - The process ID of the process requesting the token.\n * `completionEvent` - The event handle to signal once the request has finished."]
11223 pub fn ACT_AcquireIndependentServiceTokenV2(
11224 accountSlot: u8_,
11225 clientId: *mut ::libc::c_char,
11226 cacheDuration: u32_,
11227 doParentalControlsCheck: bool,
11228 shared: bool,
11229 callerProcessId: u32_,
11230 completionEvent: Handle,
11231 ) -> Result;
11232}
11233unsafe extern "C" {
11234 #[must_use]
11235 #[doc = "Gets a V2 independent service token requested using ACT_AcquireIndependentServiceTokenV2.\n # Arguments\n\n* `token` - Pointer to output the V2 independent service token to."]
11236 pub fn ACT_GetIndependentServiceTokenV2(token: *mut IndependentServiceTokenV2) -> Result;
11237}
11238unsafe extern "C" {
11239 #[must_use]
11240 #[doc = "Gets a cached V2 independent service token for a specific account.\n # Arguments\n\n* `accountSlot` - The account slot number of the account to get the token for.\n * `clientId` - The client ID to use for the cache lookup.\n * `cacheDuration` - The duration in seconds ago this token must have been requested in at least for it to be eligible for retrieval.\n * `doParentalControlsCheck` - Whether or not to perform a parental controls check before getting the token. (unused)\n * `shared` - Whether or not to only look for shared (non-process-specific) tokens in the cache."]
11241 pub fn ACT_GetCachedIndependentServiceTokenV2(
11242 token: *mut IndependentServiceTokenV2,
11243 accountSlot: u8_,
11244 clientId: *mut ::libc::c_char,
11245 cacheDuration: u32_,
11246 doParentralControlsCheck: bool,
11247 shared: bool,
11248 ) -> Result;
11249}
11250unsafe extern "C" {
11251 #[must_use]
11252 #[doc = "Swaps the account slot numbers of two accounts.\n # Arguments\n\n* `accountSlot1` - The first account slot number.\n * `accountSlot2` - The second account slot number."]
11253 pub fn ACTA_SwapAccounts(accountSlot1: u8_, accountSlot2: u8_) -> Result;
11254}
11255unsafe extern "C" {
11256 #[must_use]
11257 #[doc = "Creates a new local console account."]
11258 pub fn ACTA_CreateConsoleAccount() -> Result;
11259}
11260unsafe extern "C" {
11261 #[must_use]
11262 #[doc = "Sets a local console account as committed.\n # Arguments\n\n* `accountSlot` - The account slot number of the account to set as committed."]
11263 pub fn ACTA_CommitConsoleAccount(accountSlot: u8_) -> Result;
11264}
11265unsafe extern "C" {
11266 #[must_use]
11267 #[doc = "Clears (but does not delete) account data for the given account slot. The FpLocalAccountId will not be cleared.\n # Arguments\n\n* `accountSlot` - The account slot number of the account to clear.\n * `completely` - Whether or not to also clear the AssignedAccountId and AssignedPrincipalId in the account data."]
11268 pub fn ACTA_UnbindServerAccount(accountSlot: u8_, completely: bool) -> Result;
11269}
11270unsafe extern "C" {
11271 #[must_use]
11272 #[doc = "Deletes a local console account.\n # Arguments\n\n* `accountSlot` - The account slot number of the local console account to delete."]
11273 pub fn ACTA_DeleteConsoleAccount(accountSlot: u8_) -> Result;
11274}
11275unsafe extern "C" {
11276 #[must_use]
11277 #[doc = "Loads (\"logs in to\") a local console account.\n # Arguments\n\n* `accountSlot` - The account slot number of the local console account to load.\n * `doPasswordCheck` - Whether or not the check the input password, or if one isn't provided, the cached password (if enabled).\n * `password` - Pointer to the input password.\n * `useNullPassword` - Whether or not to forcefully use NULL as the password (= no password).\n * `dryRun` - Whether or not to execute this command as a \"dry run,\" not actually changing the current account to specified one."]
11278 pub fn ACTA_LoadConsoleAccount(
11279 accountSlot: u8_,
11280 doPasswordCheck: bool,
11281 password: *mut AccountPassword,
11282 useNullPassword: bool,
11283 dryRun: bool,
11284 ) -> Result;
11285}
11286unsafe extern "C" {
11287 #[must_use]
11288 #[doc = "Unloads the currently loaded local console account."]
11289 pub fn ACTA_UnloadConsoleAccount() -> Result;
11290}
11291unsafe extern "C" {
11292 #[must_use]
11293 #[doc = "Enables or disables the account password cache for a specific account. When the account password cache is enabled, entering the password is not required to log into the account.\n # Arguments\n\n* `accountSlot` - The account slot number to enable/disable the account password cache for.\n * `enabled` - Whether or not to enable the account password cache."]
11294 pub fn ACTA_EnableAccountPasswordCache(accountSlot: u8_, enabled: bool) -> Result;
11295}
11296unsafe extern "C" {
11297 #[must_use]
11298 #[doc = "Sets the default account that is loaded when the ACT module is initialized.\n # Arguments\n\n* `accountSlot` - The account slot number of the account to set as the default."]
11299 pub fn ACTA_SetDefaultAccount(accountSlot: u8_) -> Result;
11300}
11301unsafe extern "C" {
11302 #[must_use]
11303 #[doc = "Replaces the AccountId with the AssignedAccountId for a specific account.\n # Arguments\n\n* `accountSlot` - The account slot number of the account to perform this replacement for."]
11304 pub fn ACTA_ReplaceAccountId(accountSlot: u8_) -> Result;
11305}
11306unsafe extern "C" {
11307 #[must_use]
11308 #[doc = "Creates a support context for a specific account.\n # Arguments\n\n* `supportContext` - Pointer to write the support context data to.\n * `accountSlot` - The account slot number of the account to create the support context for."]
11309 pub fn ACTA_GetSupportContext(supportContext: *mut SupportContext, accountSlot: u8_) -> Result;
11310}
11311unsafe extern "C" {
11312 #[must_use]
11313 #[doc = "Sets server environment settings for a specific account. This will also update CFG configuration block 0x150002 accordingly.\n # Arguments\n\n* `accountSlot` - The account slot number of the account to set the host server settings for.\n * `nnasType` - The NNAS (Nintendo Network Authentication Server) type.\n * `nfsType` - The NFS (Nintendo Friend Server) type.\n * `nfsNo` - The NFS (Nintendo Friend Server) number."]
11314 pub fn ACTA_SetHostServerSettings(
11315 accountSlot: u8_,
11316 nnasType: u8_,
11317 nfsType: u8_,
11318 nfsNo: u8_,
11319 ) -> Result;
11320}
11321unsafe extern "C" {
11322 #[must_use]
11323 #[doc = "Sets default server environment settings. This will also update CFG configuration block 0x150002 accordingly.\n # Arguments\n\n* `nnasType` - The NNAS (Nintendo Network Authentication Server) type.\n * `nfsType` - The NFS (Nintendo Friend Server) type.\n * `nfsNo` - The NFS (Nintendo Friend Server) number."]
11324 pub fn ACTA_SetDefaultHostServerSettings(nnasType: u8_, nfsType: u8_, nfsNo: u8_) -> Result;
11325}
11326unsafe extern "C" {
11327 #[must_use]
11328 #[doc = "Sets server environment settings (in string form) for a specific account. This will also update CFG configuration block 0x150002 accordingly.\n # Arguments\n\n* `accountSlot` - The account slot number of the account to set the host server settings for.\n * `nnasSubdomain` - Pointer to the new NNAS (Nintendo Network Authentication Server) subdomain to use.\n * `nfsTypeStr` - Pointer to the new NFS (Nintendo Friend Server) type to use."]
11329 pub fn ACTA_SetHostServerSettingsStr(
11330 accountSlot: u8_,
11331 nnasSubdomain: *mut ActNnasSubdomain,
11332 nfsTypeStr: *mut NfsTypeStr,
11333 ) -> Result;
11334}
11335unsafe extern "C" {
11336 #[must_use]
11337 #[doc = "Sets default server environment settings (in string form). This will also update CFG configuration block 0x150002 accordingly.\n # Arguments\n\n* `nnasSubdomain` - Pointer to the new NNAS (Nintendo Network Authentication Server) subdomain to use.\n * `nfsTypeStr` - Pointer to the new NFS (Nintendo Friend Server) type to use."]
11338 pub fn ACTA_SetDefaultHostServerSettingsStr(
11339 nnasSubdomain: *mut ActNnasSubdomain,
11340 nfsTypeStr: *mut NfsTypeStr,
11341 ) -> Result;
11342}
11343unsafe extern "C" {
11344 #[must_use]
11345 #[doc = "Sets the internal base value for generating new persistent IDs.\n # Arguments\n\n* `head` - The new base value to use."]
11346 pub fn ACTA_SetPersistentIdHead(head: u32_) -> Result;
11347}
11348unsafe extern "C" {
11349 #[must_use]
11350 #[doc = "Sets the internal base value for generating new transferable IDs.\n # Arguments\n\n* `counter` - The new base value to use."]
11351 pub fn ACTA_SetTransferableIdCounter(counter: u16_) -> Result;
11352}
11353unsafe extern "C" {
11354 #[must_use]
11355 #[doc = "Updates a specific account's Mii data and screen name.\n # Arguments\n\n* `accountSlot` - The account slot number of the account to update the Mii and screen name of.\n * `miiData` - Pointer to the new Mii data to use.\n * `screenName` - Pointer to the new screen name to use."]
11356 pub fn ACTA_UpdateMiiData(
11357 accountSlot: u8_,
11358 miiData: *mut CFLStoreData,
11359 screenName: *mut MiiScreenName,
11360 ) -> Result;
11361}
11362unsafe extern "C" {
11363 #[must_use]
11364 #[doc = "Updates a Mii image of a specific account.\n # Arguments\n\n* `accountSlot` - The account slot number of the account to update the Mii image for.\n * `miiImageType` - The type of Mii image to update.\n * `image` - Pointer to the Mii image data to use.\n * `imageSize` - Size of the Mii image data."]
11365 pub fn ACTA_UpdateMiiImage(
11366 accountSlot: u8_,
11367 miiImageType: u8_,
11368 image: *mut ::libc::c_void,
11369 imageSize: u32_,
11370 ) -> Result;
11371}
11372unsafe extern "C" {
11373 #[must_use]
11374 #[doc = "Checks whether or not the given account ID is available for creating a new server account.\n # Arguments\n\n* `accountSlot` - The account slot number of the account to perform the check for.\n * `accountId` - Pointer to the input account ID to check.\n * `completionEvent` - The event handle to signal once the request has finished."]
11375 pub fn ACTA_InquireAccountIdAvailability(
11376 accountSlot: u8_,
11377 accountId: *mut AccountId,
11378 completionEvent: Handle,
11379 ) -> Result;
11380}
11381unsafe extern "C" {
11382 #[must_use]
11383 #[doc = "Links a new server account to a local console account. In other words, this creates and links an NNID.\n # Arguments\n\n* `accountSlot` - The account slot number of the local console account to bind.\n * `accountId` - Pointer to the account ID to use for the new server account.\n * `mailAddress` - Pointer to the email address to use for the new server account.\n * `password` - Pointer to the password to use for the new server account.\n * `isParentEmail` - Whether or not the input email address is a parental email address.\n * `marketingFlag` - Whether or not the user has consented to receiving marketing emails. (\"Customized Email Offers\")\n * `offDeviceFlag` - Whether or not the user has allowed using the server account from other devices. (\"Access from PCs and Other Devices\")\n * `birthDateTimestamp` - A birth date timestamp in the format milliseconds elapsed since 01.01.2000 00:00:00 UTC.\n * `parentalConsentTimestamp` - When parental consent is required, the timestamp of parental consent in the format milliseconds elapsed since 01.01.2000 00:00:00 UTC.\n * `parentalConsentId` - When parental consent is required, the resulting ID corresponding to the consent.\n * `completionEvent` - The event handle to signal once the request has finished."]
11384 pub fn ACTA_BindToNewServerAccount(
11385 accountSlot: u8_,
11386 accountId: *mut AccountId,
11387 mailAddress: *mut AccountMailAddress,
11388 password: *mut AccountPassword,
11389 isParentEmail: bool,
11390 marketingFlag: bool,
11391 offDeviceFlag: bool,
11392 birthDateTimestatmp: s64,
11393 gender: u8_,
11394 region: u32_,
11395 timezone: *mut AccountTimezone,
11396 eulaInfo: *mut EulaInfo,
11397 parentalConsentTimestamp: s64,
11398 parentalConsentId: u32_,
11399 completionEvent: Handle,
11400 ) -> Result;
11401}
11402unsafe extern "C" {
11403 #[must_use]
11404 #[doc = "Links a local console account to an existing server account. In other words, this links an existing NNID.\n # Arguments\n\n* `accountSlot` - The account slot number of the local console account to bind.\n * `accountId` - Pointer to the account ID of the existing server account.\n * `mailAddress` - Pointer to the email address of the existing server account.\n * `password` - Pointer to the password of the existing server account.\n * `completionEvent` - The event handle to signal once the request has finished."]
11405 pub fn ACTA_BindToExistentServerAccount(
11406 accountSlot: u8_,
11407 accountId: *mut AccountId,
11408 mailAddress: *mut AccountMailAddress,
11409 password: *mut AccountPassword,
11410 completionEvent: Handle,
11411 ) -> Result;
11412}
11413unsafe extern "C" {
11414 #[must_use]
11415 #[doc = "Acquires information about an existing server account.\n # Arguments\n\n* `accountSlot` - The account slot number of the local console account to use for the request.\n * `accountId` - Pointer to the account ID of the existing server account.\n * `mailAddress` - Pointer to the email address of the existing server account.\n * `password` - Pointer to the password of the existing server account.\n * `completionEvent` - The event handle to signal once the request has finished."]
11416 pub fn ACTA_InquireBindingToExistentServerAccount(
11417 accountSlot: u8_,
11418 accountId: *mut AccountId,
11419 mailAddress: *mut AccountMailAddress,
11420 password: *mut AccountPassword,
11421 completionEvent: Handle,
11422 ) -> Result;
11423}
11424unsafe extern "C" {
11425 #[must_use]
11426 #[doc = "Deletes a server account. In other words, this deletes an NNID (server-side).\n # Arguments\n\n* `accountSlot` - The account slot number of the local console account bound to the server account to delete.\n * `completionEvent` - The event handle to signal once the request has finished."]
11427 pub fn ACTA_DeleteServerAccount(accountSlot: u8_, completionEvent: Handle) -> Result;
11428}
11429unsafe extern "C" {
11430 #[must_use]
11431 #[doc = "Acquires an account token for a specific account.\n # Arguments\n\n* `accountSlot` - The account slot number of the account to acquire the account token for.\n * `password` - Pointer to the password of the account.\n * `useNullPassword` - Whether or not to force NULL as the password (no password). This will cause the account password cache to be used instead, if it is enabled.\n * `completionEvent` - The event handle to signal once the request has finished."]
11432 pub fn ACTA_AcquireAccountTokenEx(
11433 accountSlot: u8_,
11434 password: *mut AccountPassword,
11435 useNullPassword: bool,
11436 completionEvent: Handle,
11437 ) -> Result;
11438}
11439unsafe extern "C" {
11440 #[must_use]
11441 #[doc = "Submits a EULA agreement to the account server.\n # Arguments\n\n* `accountSlot` - The account slot number of the account to use to submit the agreement.\n * `eulaInfo` - Pointer to a EULA information structure describing the agreed EULA.\n * `agreementTimestamp` - A timestamp in the format milliseconds elapsed since 01.01.2000 00:00:00 UTC of when the user agreed to the EULA.\n * `completionEvent` - The event handle to signal once the request has finished."]
11442 pub fn ACTA_AgreeEula(
11443 accountSlot: u8_,
11444 eulaInfo: *mut EulaInfo,
11445 agreementTimestamp: s64,
11446 completionEvent: Handle,
11447 ) -> Result;
11448}
11449unsafe extern "C" {
11450 #[must_use]
11451 #[doc = "Reloads account information from the server for a specific account.\n # Arguments\n\n* `accountSlot` - The account slot number of the account to reload information for.\n * `completionEvent` - The event handle to signal once the request has finished."]
11452 pub fn ACTA_SyncAccountInfo(accountSlot: u8_, completionEvent: Handle) -> Result;
11453}
11454unsafe extern "C" {
11455 #[must_use]
11456 #[doc = "Invalidates a specific account's access token in different ways.\n # Arguments\n\n* `accountSlot` - The account slot number of the account to invalidate the access token for.\n * `invalidationMask` - A bitfield of the actions to take to invalidate the access token."]
11457 pub fn ACTA_InvalidateAccountToken(accountSlot: u8_, invalidationActionMask: u32_) -> Result;
11458}
11459unsafe extern "C" {
11460 #[must_use]
11461 #[doc = "Updates the account password for a specific account.\n # Arguments\n\n* `accountSlot` - The account slot number of the account to update the password for.\n * `password` - Pointer to the new password to use.\n * `completionEvent` - The event handle to signal once the request has finished."]
11462 pub fn ACTA_UpdateAccountPassword(
11463 accountSlot: u8_,
11464 newPassword: *mut AccountPassword,
11465 completionEvent: Handle,
11466 ) -> Result;
11467}
11468unsafe extern "C" {
11469 #[must_use]
11470 #[doc = "Requests the issuing of a temporary password (valid for 24 hours) to the email address associated with a specific account.\n # Arguments\n\n* `accountSlot` - The account slot number of the account to issue the temporary password for.\n * `completionEvent` - The event handle to signal once the request has finished."]
11471 pub fn ACTA_ReissueAccountPassword(accountSlot: u8_, completionEvent: Handle) -> Result;
11472}
11473unsafe extern "C" {
11474 #[must_use]
11475 #[doc = "Sets the account password input for a specific account. This value is not stored in the save data and only resides in memory. Following up a call to this command with a call to ACTA_EnableAccountPasswordCache will lead to the account password cache being updated."]
11476 pub fn ACTA_SetAccountPasswordInput(
11477 accountSlot: u8_,
11478 passwordInput: *mut AccountPassword,
11479 ) -> Result;
11480}
11481unsafe extern "C" {
11482 #[must_use]
11483 #[doc = "Uploads the Mii data of a specific account to the account server.\n # Arguments\n\n* `accountSlot` - The account slot number of the account to upload the Mii for.\n * `completionEvent` - The event handle to signal once the request has finished."]
11484 pub fn ACTA_UploadMii(accountSlot: u8_, completionEvent: Handle) -> Result;
11485}
11486unsafe extern "C" {
11487 #[must_use]
11488 #[doc = "Inactivates the device association for a specific account.\n # Arguments\n\n* `accountSlot` - The account slot number of the account to inactive the device association for.\n * `completionEvent` - The event handle to signal once the request has finished."]
11489 pub fn ACTA_InactivateDeviceAssociation(accountSlot: u8_, completionEvent: Handle) -> Result;
11490}
11491unsafe extern "C" {
11492 #[must_use]
11493 #[doc = "Validates the email address of a specific account using the code received via the confirmation email.\n # Arguments\n\n* `accountSlot` - The account slot number of the account to validate the email address for.\n * `confirmationCode` - The confirmation code received via email.\n * `completionEvent` - The event handle to signal once the request has finished."]
11494 pub fn ACTA_ValidateMailAddress(
11495 accountSlot: u8_,
11496 confirmationCode: u32_,
11497 completionEvent: Handle,
11498 ) -> Result;
11499}
11500unsafe extern "C" {
11501 #[must_use]
11502 #[doc = "Requests parental approval for a specific account.\n # Arguments\n\n* `accountSlot` - The account slot number of the account to request parental approval for.\n * `parentalEmail` - Pointer to a parental email to use for parental consent.\n * `completionEvent` - The event handle to signal once the request has finished."]
11503 pub fn ACTA_SendPostingApprovalMail(
11504 accountSlot: u8_,
11505 parentalEmail: *mut AccountMailAddress,
11506 completionEvent: Handle,
11507 ) -> Result;
11508}
11509unsafe extern "C" {
11510 #[must_use]
11511 #[doc = "Requests the email address confirmation mail to be resent for a specific account.\n # Arguments\n\n* `accountSlot` - The account slot number of the account for which the confirmation mail should be resent.\n * `completionEvent` - The event handle to signal once the request has finished."]
11512 pub fn ACTA_SendConfirmationMail(accountSlot: u8_, completionEvent: Handle) -> Result;
11513}
11514unsafe extern "C" {
11515 #[must_use]
11516 #[doc = "Registers a parental email address to be used in case the parental controls PIN has been forgotten for a specific account.\n # Arguments\n\n* `accountSlot` - The account slot number of the account to register the fallback parental email for.\n * `parentalEmail` - Pointer to the parental email to use.\n * `completionEvent` - The event handle to signal once the request has finished."]
11517 pub fn ACTA_SendConfirmationMailForPin(
11518 accountSlot: u8_,
11519 parentalEmail: *mut AccountMailAddress,
11520 completionEvent: Handle,
11521 ) -> Result;
11522}
11523unsafe extern "C" {
11524 #[must_use]
11525 #[doc = "Sends the master key for resetting parental controls to a parental email for a specific account.\n # Arguments\n\n* `accountSlot` - The account slot number for the account to be used for this operation.\n * `masterKey` - The master key to send to the parental email address.\n * `parentalEmail` - Pointer to the parental email address to send the master key to.\n * `completionEvent` - The event handle to signal once the request has finished."]
11526 pub fn ACTA_SendMasterKeyMailForPin(
11527 accountSlot: u8_,
11528 masterKey: u32_,
11529 parentalEmail: *mut AccountMailAddress,
11530 completionEvent: Handle,
11531 ) -> Result;
11532}
11533unsafe extern "C" {
11534 #[must_use]
11535 #[doc = "Requests COPPA parental consent using credit card information.\n # Arguments\n\n* `accountSlot` - The account slot number for the account to request approval for.\n * `cardInfo` - Pointer to the credit card information to use for the approval process.\n * `completionEvent` - The event handle to signal once the request has finished."]
11536 pub fn ACTA_ApproveByCreditCard(
11537 accountSlot: u8_,
11538 cardInfo: *mut CreditCardInfo,
11539 completionEvent: Handle,
11540 ) -> Result;
11541}
11542unsafe extern "C" {
11543 #[must_use]
11544 #[doc = "Requests a COPPA code for a specific account.\n # Arguments\n\n* `accountSlot` - The account slot number for the account to send the request for.\n * `principalId` - The principalId of the account to send the request for.\n * `completionEvent` - The event handle to signal once the request has finished."]
11545 pub fn ACTA_SendCoppaCodeMail(
11546 accountSlot: u8_,
11547 principalId: u32_,
11548 completionEvent: Handle,
11549 ) -> Result;
11550}
11551unsafe extern "C" {
11552 #[must_use]
11553 #[doc = "Set a flag in a specifc account's data that determines whether or not it is necessary to upload the account Mii data to the account server.\n # Arguments\n\n* `accountSlot` - The account slot number of the account to set the flag for.\n * `isDirty` - Whether or not the Mii data should be reuploaded to the account server."]
11554 pub fn ACTA_SetIsMiiUpdated(accountSlot: u8_, isDirty: bool) -> Result;
11555}
11556unsafe extern "C" {
11557 #[must_use]
11558 #[doc = "Initializes a server account transfer of a specific account to another device.\n # Arguments\n\n* `accountSlot` - The account slot number of the account to transfer the server account of.\n * `newDevice` - Pointer to device info of the target device.\n * `operatorData` - Pointer to operator data for the transfer.\n * `operatorSize` - Size of the operator data buffer (max: 0x100)\n * `completionEvent` - The event handle to signal once the request has finished."]
11559 pub fn ACTA_ReserveTransfer(
11560 accountSlot: u8_,
11561 newDevice: *mut DeviceInfo,
11562 operatorData: *mut ::libc::c_char,
11563 operatorSize: u32_,
11564 completionEvent: Handle,
11565 ) -> Result;
11566}
11567unsafe extern "C" {
11568 #[must_use]
11569 #[doc = "Finalizes a server account transfer of a specifc account to another device.\n # Arguments\n\n* `accountSlot` - The account slot number of the account to complete the transfer for.\n * `completionEvent` - The event handle to signal once the request has finished."]
11570 pub fn ACTA_CompleteTransfer(accountSlot: u8_, completionEvent: Handle) -> Result;
11571}
11572unsafe extern "C" {
11573 #[must_use]
11574 #[doc = "Inactivates the account-device association for a specific account. In other words, this deletes an NNID.\n # Arguments\n\n* `accountSlot` - The account slot number of the account to perform this action on.\n * `completionEvent` - The event handle to signal once the request has finished."]
11575 pub fn ACTA_InactivateAccountDeviceAssociation(
11576 accountSlot: u8_,
11577 completionEvent: Handle,
11578 ) -> Result;
11579}
11580unsafe extern "C" {
11581 #[must_use]
11582 #[doc = "Set the internal network time field.\n # Arguments\n\n* `timestamp` - The new server time timestamp to use. The timestamp format is milliseconds elapsed since 01.01.2000 00:00:00 UTC."]
11583 pub fn ACTA_SetNetworkTime(timestamp: s64) -> Result;
11584}
11585unsafe extern "C" {
11586 #[must_use]
11587 #[doc = "Updates the account info of a specific account using raw XML data.\n # Arguments\n\n* `accountSlot` - The account slot number of the account to update information for.\n * `xmlData` - Pointer to the input XML data.\n * `xmlDataSize` - Size of the input XML data.\n * `completionEvent` - The event handle to signal once the request has finished."]
11588 pub fn ACTA_UpdateAccountInfo(
11589 accountSlot: u8_,
11590 xmlData: *mut ::libc::c_char,
11591 xmlDataSize: u32_,
11592 completionEvent: Handle,
11593 ) -> Result;
11594}
11595unsafe extern "C" {
11596 #[must_use]
11597 #[doc = "Updates the email address of a specific account.\n # Arguments\n\n* `accountSlot` - The account slot number of the account to update the email address for.\n * `newEmail` - Pointer to the new email address to use.\n * `completionEvent` - The event handle to signal once the request has finished."]
11598 pub fn ACTA_UpdateAccountMailAddress(
11599 accountSlot: u8_,
11600 newEmail: *mut AccountMailAddress,
11601 completionEvent: Handle,
11602 ) -> Result;
11603}
11604unsafe extern "C" {
11605 #[must_use]
11606 #[doc = "Deletes the device association for a specific account.\n # Arguments\n\n* `accountSlot` - The account slot of the account to perform this action on.\n * `completionEvent` - The event handle to signal once the request has finished."]
11607 pub fn ACTA_DeleteDeviceAssociation(accountSlot: u8_, completionEvent: Handle) -> Result;
11608}
11609unsafe extern "C" {
11610 #[must_use]
11611 #[doc = "Deletes the account-device association for a specific account.\n # Arguments\n\n* `accountSlot` - The account slot of the account to perform this action on.\n * `completionEvent` - The event handle to signal once the request has finished."]
11612 pub fn ACTA_DeleteAccountDeviceAssociation(accountSlot: u8_, completionEvent: Handle)
11613 -> Result;
11614}
11615unsafe extern "C" {
11616 #[must_use]
11617 #[doc = "Cancels a pending server account transfer of a specific account to another device.\n # Arguments\n\n* `accountSlot` - The account slot number of the account to cancel the transfer for.\n * `completionEvent` - The event handle to signal once the request has finished."]
11618 pub fn ACTA_CancelTransfer(accountSlot: u8_, completionEvent: Handle) -> Result;
11619}
11620unsafe extern "C" {
11621 #[must_use]
11622 #[doc = "Cancels any running HTTP requests, saves all pending changes to the system save data, then signals unloadFinishedEvent. Then, waits for remountAndBlockEvent, and once this has been signaled, remounts the system save, and blocks subsequent attempts to save the system save data (which can be bypassed by entering and exiting sleep mode).\n # Arguments\n\n* `unloadFinishedEvent` - The event handle for ACT to signal once it has saved pending changes and has unmounted its system save.\n * `remountAndBlockEvent` - The event handle for the caller to signal once ACT should remount its save data and block subsequent save attempts."]
11623 pub fn ACTA_ReloadAndBlockSaveData(
11624 unloadFinishedEvent: Handle,
11625 remountAndBlockEvent: Handle,
11626 ) -> Result;
11627}
11628unsafe extern "C" {
11629 #[must_use]
11630 #[doc = "Initializes server-side account deletion for a specific account. In other words, this deletes an NNID.\n # Arguments\n\n* `accountSlot` - The account slot number of the account to perform this action on.\n * `completionEvent` - The event handle to signal once the request has finished."]
11631 pub fn ACTA_ReserveServerAccountDeletion(accountSlot: u8_, completionEvent: Handle) -> Result;
11632}
11633#[doc = "< Open for reading."]
11634pub const FS_OPEN_READ: _bindgen_ty_11 = 1;
11635#[doc = "< Open for writing."]
11636pub const FS_OPEN_WRITE: _bindgen_ty_11 = 2;
11637#[doc = "< Create file."]
11638pub const FS_OPEN_CREATE: _bindgen_ty_11 = 4;
11639#[doc = "Open flags."]
11640pub type _bindgen_ty_11 = ::libc::c_uchar;
11641#[doc = "< Flush."]
11642pub const FS_WRITE_FLUSH: _bindgen_ty_12 = 1;
11643#[doc = "< Update file timestamp."]
11644pub const FS_WRITE_UPDATE_TIME: _bindgen_ty_12 = 256;
11645#[doc = "Write flags."]
11646pub type _bindgen_ty_12 = ::libc::c_ushort;
11647#[doc = "< Directory."]
11648pub const FS_ATTRIBUTE_DIRECTORY: _bindgen_ty_13 = 1;
11649#[doc = "< Hidden."]
11650pub const FS_ATTRIBUTE_HIDDEN: _bindgen_ty_13 = 256;
11651#[doc = "< Archive."]
11652pub const FS_ATTRIBUTE_ARCHIVE: _bindgen_ty_13 = 65536;
11653#[doc = "< Read-only."]
11654pub const FS_ATTRIBUTE_READ_ONLY: _bindgen_ty_13 = 16777216;
11655#[doc = "Attribute flags."]
11656pub type _bindgen_ty_13 = ::libc::c_uint;
11657#[doc = "< NAND."]
11658pub const MEDIATYPE_NAND: FS_MediaType = 0;
11659#[doc = "< SD card."]
11660pub const MEDIATYPE_SD: FS_MediaType = 1;
11661#[doc = "< Game card."]
11662pub const MEDIATYPE_GAME_CARD: FS_MediaType = 2;
11663#[doc = "Media types."]
11664pub type FS_MediaType = ::libc::c_uchar;
11665#[doc = "< CTR NAND."]
11666pub const SYSTEM_MEDIATYPE_CTR_NAND: FS_SystemMediaType = 0;
11667#[doc = "< TWL NAND."]
11668pub const SYSTEM_MEDIATYPE_TWL_NAND: FS_SystemMediaType = 1;
11669#[doc = "< SD card."]
11670pub const SYSTEM_MEDIATYPE_SD: FS_SystemMediaType = 2;
11671#[doc = "< TWL Photo."]
11672pub const SYSTEM_MEDIATYPE_TWL_PHOTO: FS_SystemMediaType = 3;
11673#[doc = "System media types."]
11674pub type FS_SystemMediaType = ::libc::c_uchar;
11675#[doc = "< RomFS archive."]
11676pub const ARCHIVE_ROMFS: FS_ArchiveID = 3;
11677#[doc = "< Save data archive."]
11678pub const ARCHIVE_SAVEDATA: FS_ArchiveID = 4;
11679#[doc = "< Ext data archive."]
11680pub const ARCHIVE_EXTDATA: FS_ArchiveID = 6;
11681#[doc = "< Shared ext data archive."]
11682pub const ARCHIVE_SHARED_EXTDATA: FS_ArchiveID = 7;
11683#[doc = "< System save data archive."]
11684pub const ARCHIVE_SYSTEM_SAVEDATA: FS_ArchiveID = 8;
11685#[doc = "< SDMC archive."]
11686pub const ARCHIVE_SDMC: FS_ArchiveID = 9;
11687#[doc = "< Write-only SDMC archive."]
11688pub const ARCHIVE_SDMC_WRITE_ONLY: FS_ArchiveID = 10;
11689#[doc = "< BOSS ext data archive."]
11690pub const ARCHIVE_BOSS_EXTDATA: FS_ArchiveID = 305419896;
11691#[doc = "< Card SPI FS archive."]
11692pub const ARCHIVE_CARD_SPIFS: FS_ArchiveID = 305419897;
11693#[doc = "< Ext data and BOSS ext data archive."]
11694pub const ARCHIVE_EXTDATA_AND_BOSS_EXTDATA: FS_ArchiveID = 305419899;
11695#[doc = "< System save data archive."]
11696pub const ARCHIVE_SYSTEM_SAVEDATA2: FS_ArchiveID = 305419900;
11697#[doc = "< Read-write NAND archive."]
11698pub const ARCHIVE_NAND_RW: FS_ArchiveID = 305419901;
11699#[doc = "< Read-only NAND archive."]
11700pub const ARCHIVE_NAND_RO: FS_ArchiveID = 305419902;
11701#[doc = "< Read-only write access NAND archive."]
11702pub const ARCHIVE_NAND_RO_WRITE_ACCESS: FS_ArchiveID = 305419903;
11703#[doc = "< User save data and ExeFS/RomFS archive."]
11704pub const ARCHIVE_SAVEDATA_AND_CONTENT: FS_ArchiveID = 591751050;
11705#[doc = "< User save data and ExeFS/RomFS archive (only ExeFS for fs:LDR)."]
11706pub const ARCHIVE_SAVEDATA_AND_CONTENT2: FS_ArchiveID = 591751054;
11707#[doc = "< NAND CTR FS archive."]
11708pub const ARCHIVE_NAND_CTR_FS: FS_ArchiveID = 1450741931;
11709#[doc = "< TWL PHOTO archive."]
11710pub const ARCHIVE_TWL_PHOTO: FS_ArchiveID = 1450741932;
11711#[doc = "< TWL SOUND archive."]
11712pub const ARCHIVE_TWL_SOUND: FS_ArchiveID = 1450741933;
11713#[doc = "< NAND TWL FS archive."]
11714pub const ARCHIVE_NAND_TWL_FS: FS_ArchiveID = 1450741934;
11715#[doc = "< NAND W FS archive."]
11716pub const ARCHIVE_NAND_W_FS: FS_ArchiveID = 1450741935;
11717#[doc = "< Game card save data archive."]
11718pub const ARCHIVE_GAMECARD_SAVEDATA: FS_ArchiveID = 1450741937;
11719#[doc = "< User save data archive."]
11720pub const ARCHIVE_USER_SAVEDATA: FS_ArchiveID = 1450741938;
11721#[doc = "< Demo save data archive."]
11722pub const ARCHIVE_DEMO_SAVEDATA: FS_ArchiveID = 1450741940;
11723#[doc = "Archive IDs."]
11724pub type FS_ArchiveID = ::libc::c_uint;
11725#[doc = "< Invalid path."]
11726pub const PATH_INVALID: FS_PathType = 0;
11727#[doc = "< Empty path."]
11728pub const PATH_EMPTY: FS_PathType = 1;
11729#[doc = "< Binary path. Meaning is per-archive."]
11730pub const PATH_BINARY: FS_PathType = 2;
11731#[doc = "< ASCII text path."]
11732pub const PATH_ASCII: FS_PathType = 3;
11733#[doc = "< UTF-16 text path."]
11734pub const PATH_UTF16: FS_PathType = 4;
11735#[doc = "Path types."]
11736pub type FS_PathType = ::libc::c_uchar;
11737#[doc = "< SD application."]
11738pub const SECUREVALUE_SLOT_SD: FS_SecureValueSlot = 4096;
11739#[doc = "Secure value slot."]
11740pub type FS_SecureValueSlot = ::libc::c_ushort;
11741#[doc = "< 512KHz."]
11742pub const BAUDRATE_512KHZ: FS_CardSpiBaudRate = 0;
11743#[doc = "< 1MHz."]
11744pub const BAUDRATE_1MHZ: FS_CardSpiBaudRate = 1;
11745#[doc = "< 2MHz."]
11746pub const BAUDRATE_2MHZ: FS_CardSpiBaudRate = 2;
11747#[doc = "< 4MHz."]
11748pub const BAUDRATE_4MHZ: FS_CardSpiBaudRate = 3;
11749#[doc = "< 8MHz."]
11750pub const BAUDRATE_8MHZ: FS_CardSpiBaudRate = 4;
11751#[doc = "< 16MHz."]
11752pub const BAUDRATE_16MHZ: FS_CardSpiBaudRate = 5;
11753#[doc = "Card SPI baud rate."]
11754pub type FS_CardSpiBaudRate = ::libc::c_uchar;
11755#[doc = "< 1-bit."]
11756pub const BUSMODE_1BIT: FS_CardSpiBusMode = 0;
11757#[doc = "< 4-bit."]
11758pub const BUSMODE_4BIT: FS_CardSpiBusMode = 1;
11759#[doc = "Card SPI bus mode."]
11760pub type FS_CardSpiBusMode = ::libc::c_uchar;
11761#[doc = "< Update."]
11762pub const SPECIALCONTENT_UPDATE: FS_SpecialContentType = 1;
11763#[doc = "< Manual."]
11764pub const SPECIALCONTENT_MANUAL: FS_SpecialContentType = 2;
11765#[doc = "< DLP child."]
11766pub const SPECIALCONTENT_DLP_CHILD: FS_SpecialContentType = 3;
11767#[doc = "Card SPI bus mode."]
11768pub type FS_SpecialContentType = ::libc::c_uchar;
11769#[doc = "< CTR card."]
11770pub const CARD_CTR: FS_CardType = 0;
11771#[doc = "< TWL card."]
11772pub const CARD_TWL: FS_CardType = 1;
11773pub type FS_CardType = ::libc::c_uchar;
11774pub const FS_ACTION_UNKNOWN: FS_Action = 0;
11775#[doc = "FS control actions."]
11776pub type FS_Action = ::libc::c_uchar;
11777#[doc = "< Commits save data changes. No inputs/outputs."]
11778pub const ARCHIVE_ACTION_COMMIT_SAVE_DATA: FS_ArchiveAction = 0;
11779#[doc = "< Retrieves a file's last-modified timestamp. In: \"u16*, UTF-16 Path\", Out: \"u64, Time Stamp\"."]
11780pub const ARCHIVE_ACTION_GET_TIMESTAMP: FS_ArchiveAction = 1;
11781pub const ARCHIVE_ACTION_UNKNOWN: FS_ArchiveAction = 30877;
11782#[doc = "Archive control actions."]
11783pub type FS_ArchiveAction = ::libc::c_ushort;
11784#[doc = "< Deletes a save's secure value. In: \"u64, ((SecureValueSlot << 32) | (TitleUniqueId << 8) | TitleVariation)\", Out: \"u8, Value Existed\""]
11785pub const SECURESAVE_ACTION_DELETE: FS_SecureSaveAction = 0;
11786#[doc = "< Formats a save. No inputs/outputs."]
11787pub const SECURESAVE_ACTION_FORMAT: FS_SecureSaveAction = 1;
11788#[doc = "Secure save control actions."]
11789pub type FS_SecureSaveAction = ::libc::c_uchar;
11790pub const FILE_ACTION_UNKNOWN: FS_FileAction = 0;
11791#[doc = "File control actions."]
11792pub type FS_FileAction = ::libc::c_uchar;
11793pub const DIRECTORY_ACTION_UNKNOWN: FS_DirectoryAction = 0;
11794#[doc = "Directory control actions."]
11795pub type FS_DirectoryAction = ::libc::c_uchar;
11796#[doc = "Directory entry."]
11797#[repr(C)]
11798#[derive(Debug, Copy, Clone)]
11799pub struct FS_DirectoryEntry {
11800 #[doc = "< UTF-16 directory name."]
11801 pub name: [u16_; 262usize],
11802 #[doc = "< File name."]
11803 pub shortName: [::libc::c_char; 10usize],
11804 #[doc = "< File extension."]
11805 pub shortExt: [::libc::c_char; 4usize],
11806 #[doc = "< Valid flag. (Always 1)"]
11807 pub valid: u8_,
11808 #[doc = "< Reserved."]
11809 pub reserved: u8_,
11810 #[doc = "< Attributes."]
11811 pub attributes: u32_,
11812 #[doc = "< File size."]
11813 pub fileSize: u64_,
11814}
11815#[allow(clippy::unnecessary_operation, clippy::identity_op)]
11816const _: () = {
11817 ["Size of FS_DirectoryEntry"][::core::mem::size_of::<FS_DirectoryEntry>() - 552usize];
11818 ["Alignment of FS_DirectoryEntry"][::core::mem::align_of::<FS_DirectoryEntry>() - 8usize];
11819 ["Offset of field: FS_DirectoryEntry::name"]
11820 [::core::mem::offset_of!(FS_DirectoryEntry, name) - 0usize];
11821 ["Offset of field: FS_DirectoryEntry::shortName"]
11822 [::core::mem::offset_of!(FS_DirectoryEntry, shortName) - 524usize];
11823 ["Offset of field: FS_DirectoryEntry::shortExt"]
11824 [::core::mem::offset_of!(FS_DirectoryEntry, shortExt) - 534usize];
11825 ["Offset of field: FS_DirectoryEntry::valid"]
11826 [::core::mem::offset_of!(FS_DirectoryEntry, valid) - 538usize];
11827 ["Offset of field: FS_DirectoryEntry::reserved"]
11828 [::core::mem::offset_of!(FS_DirectoryEntry, reserved) - 539usize];
11829 ["Offset of field: FS_DirectoryEntry::attributes"]
11830 [::core::mem::offset_of!(FS_DirectoryEntry, attributes) - 540usize];
11831 ["Offset of field: FS_DirectoryEntry::fileSize"]
11832 [::core::mem::offset_of!(FS_DirectoryEntry, fileSize) - 544usize];
11833};
11834impl Default for FS_DirectoryEntry {
11835 fn default() -> Self {
11836 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
11837 unsafe {
11838 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11839 s.assume_init()
11840 }
11841 }
11842}
11843#[doc = "Archive resource information."]
11844#[repr(C)]
11845#[derive(Debug, Default, Copy, Clone)]
11846pub struct FS_ArchiveResource {
11847 #[doc = "< Size of each sector, in bytes."]
11848 pub sectorSize: u32_,
11849 #[doc = "< Size of each cluster, in bytes."]
11850 pub clusterSize: u32_,
11851 #[doc = "< Total number of clusters."]
11852 pub totalClusters: u32_,
11853 #[doc = "< Number of free clusters."]
11854 pub freeClusters: u32_,
11855}
11856#[allow(clippy::unnecessary_operation, clippy::identity_op)]
11857const _: () = {
11858 ["Size of FS_ArchiveResource"][::core::mem::size_of::<FS_ArchiveResource>() - 16usize];
11859 ["Alignment of FS_ArchiveResource"][::core::mem::align_of::<FS_ArchiveResource>() - 4usize];
11860 ["Offset of field: FS_ArchiveResource::sectorSize"]
11861 [::core::mem::offset_of!(FS_ArchiveResource, sectorSize) - 0usize];
11862 ["Offset of field: FS_ArchiveResource::clusterSize"]
11863 [::core::mem::offset_of!(FS_ArchiveResource, clusterSize) - 4usize];
11864 ["Offset of field: FS_ArchiveResource::totalClusters"]
11865 [::core::mem::offset_of!(FS_ArchiveResource, totalClusters) - 8usize];
11866 ["Offset of field: FS_ArchiveResource::freeClusters"]
11867 [::core::mem::offset_of!(FS_ArchiveResource, freeClusters) - 12usize];
11868};
11869#[doc = "Program information."]
11870#[repr(C)]
11871#[derive(Debug, Copy, Clone)]
11872pub struct FS_ProgramInfo {
11873 #[doc = "< Program ID."]
11874 pub programId: u64_,
11875 pub _bitfield_align_1: [u8; 0],
11876 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
11877 #[doc = "< Padding."]
11878 pub padding: [u8_; 7usize],
11879}
11880#[allow(clippy::unnecessary_operation, clippy::identity_op)]
11881const _: () = {
11882 ["Size of FS_ProgramInfo"][::core::mem::size_of::<FS_ProgramInfo>() - 16usize];
11883 ["Alignment of FS_ProgramInfo"][::core::mem::align_of::<FS_ProgramInfo>() - 8usize];
11884 ["Offset of field: FS_ProgramInfo::programId"]
11885 [::core::mem::offset_of!(FS_ProgramInfo, programId) - 0usize];
11886 ["Offset of field: FS_ProgramInfo::padding"]
11887 [::core::mem::offset_of!(FS_ProgramInfo, padding) - 9usize];
11888};
11889impl Default for FS_ProgramInfo {
11890 fn default() -> Self {
11891 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
11892 unsafe {
11893 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11894 s.assume_init()
11895 }
11896 }
11897}
11898impl FS_ProgramInfo {
11899 #[inline]
11900 pub fn mediaType(&self) -> FS_MediaType {
11901 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 8u8) as u8) }
11902 }
11903 #[inline]
11904 pub fn set_mediaType(&mut self, val: FS_MediaType) {
11905 unsafe {
11906 let val: u8 = ::core::mem::transmute(val);
11907 self._bitfield_1.set(0usize, 8u8, val as u64)
11908 }
11909 }
11910 #[inline]
11911 pub unsafe fn mediaType_raw(this: *const Self) -> FS_MediaType {
11912 unsafe {
11913 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
11914 ::core::ptr::addr_of!((*this)._bitfield_1),
11915 0usize,
11916 8u8,
11917 ) as u8)
11918 }
11919 }
11920 #[inline]
11921 pub unsafe fn set_mediaType_raw(this: *mut Self, val: FS_MediaType) {
11922 unsafe {
11923 let val: u8 = ::core::mem::transmute(val);
11924 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
11925 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
11926 0usize,
11927 8u8,
11928 val as u64,
11929 )
11930 }
11931 }
11932 #[inline]
11933 pub fn new_bitfield_1(mediaType: FS_MediaType) -> __BindgenBitfieldUnit<[u8; 1usize]> {
11934 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
11935 __bindgen_bitfield_unit.set(0usize, 8u8, {
11936 let mediaType: u8 = unsafe { ::core::mem::transmute(mediaType) };
11937 mediaType as u64
11938 });
11939 __bindgen_bitfield_unit
11940 }
11941}
11942#[doc = "Product information."]
11943#[repr(C)]
11944#[derive(Debug, Default, Copy, Clone)]
11945pub struct FS_ProductInfo {
11946 #[doc = "< Product code."]
11947 pub productCode: [::libc::c_char; 16usize],
11948 #[doc = "< Company code."]
11949 pub companyCode: [::libc::c_char; 2usize],
11950 #[doc = "< Remaster version."]
11951 pub remasterVersion: u16_,
11952}
11953#[allow(clippy::unnecessary_operation, clippy::identity_op)]
11954const _: () = {
11955 ["Size of FS_ProductInfo"][::core::mem::size_of::<FS_ProductInfo>() - 20usize];
11956 ["Alignment of FS_ProductInfo"][::core::mem::align_of::<FS_ProductInfo>() - 2usize];
11957 ["Offset of field: FS_ProductInfo::productCode"]
11958 [::core::mem::offset_of!(FS_ProductInfo, productCode) - 0usize];
11959 ["Offset of field: FS_ProductInfo::companyCode"]
11960 [::core::mem::offset_of!(FS_ProductInfo, companyCode) - 16usize];
11961 ["Offset of field: FS_ProductInfo::remasterVersion"]
11962 [::core::mem::offset_of!(FS_ProductInfo, remasterVersion) - 18usize];
11963};
11964#[doc = "Integrity verification seed."]
11965#[repr(C)]
11966#[derive(Debug, Copy, Clone)]
11967pub struct FS_IntegrityVerificationSeed {
11968 #[doc = "< AES-CBC MAC over a SHA256 hash, which hashes the first 0x110-bytes of the cleartext SEED."]
11969 pub aesCbcMac: [u8_; 16usize],
11970 #[doc = "< The \"nand/private/movable.sed\", encrypted with AES-CTR using the above MAC for the counter."]
11971 pub movableSed: [u8_; 288usize],
11972}
11973#[allow(clippy::unnecessary_operation, clippy::identity_op)]
11974const _: () = {
11975 ["Size of FS_IntegrityVerificationSeed"]
11976 [::core::mem::size_of::<FS_IntegrityVerificationSeed>() - 304usize];
11977 ["Alignment of FS_IntegrityVerificationSeed"]
11978 [::core::mem::align_of::<FS_IntegrityVerificationSeed>() - 1usize];
11979 ["Offset of field: FS_IntegrityVerificationSeed::aesCbcMac"]
11980 [::core::mem::offset_of!(FS_IntegrityVerificationSeed, aesCbcMac) - 0usize];
11981 ["Offset of field: FS_IntegrityVerificationSeed::movableSed"]
11982 [::core::mem::offset_of!(FS_IntegrityVerificationSeed, movableSed) - 16usize];
11983};
11984impl Default for FS_IntegrityVerificationSeed {
11985 fn default() -> Self {
11986 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
11987 unsafe {
11988 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
11989 s.assume_init()
11990 }
11991 }
11992}
11993#[doc = "Ext save data information."]
11994#[repr(C, packed)]
11995#[derive(Debug, Copy, Clone)]
11996pub struct FS_ExtSaveDataInfo {
11997 pub _bitfield_align_1: [u8; 0],
11998 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
11999 #[doc = "< Unknown."]
12000 pub unknown: u8_,
12001 #[doc = "< Reserved."]
12002 pub reserved1: u16_,
12003 #[doc = "< Save ID."]
12004 pub saveId: u64_,
12005 #[doc = "< Reserved."]
12006 pub reserved2: u32_,
12007}
12008#[allow(clippy::unnecessary_operation, clippy::identity_op)]
12009const _: () = {
12010 ["Size of FS_ExtSaveDataInfo"][::core::mem::size_of::<FS_ExtSaveDataInfo>() - 16usize];
12011 ["Alignment of FS_ExtSaveDataInfo"][::core::mem::align_of::<FS_ExtSaveDataInfo>() - 1usize];
12012 ["Offset of field: FS_ExtSaveDataInfo::unknown"]
12013 [::core::mem::offset_of!(FS_ExtSaveDataInfo, unknown) - 1usize];
12014 ["Offset of field: FS_ExtSaveDataInfo::reserved1"]
12015 [::core::mem::offset_of!(FS_ExtSaveDataInfo, reserved1) - 2usize];
12016 ["Offset of field: FS_ExtSaveDataInfo::saveId"]
12017 [::core::mem::offset_of!(FS_ExtSaveDataInfo, saveId) - 4usize];
12018 ["Offset of field: FS_ExtSaveDataInfo::reserved2"]
12019 [::core::mem::offset_of!(FS_ExtSaveDataInfo, reserved2) - 12usize];
12020};
12021impl Default for FS_ExtSaveDataInfo {
12022 fn default() -> Self {
12023 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
12024 unsafe {
12025 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
12026 s.assume_init()
12027 }
12028 }
12029}
12030impl FS_ExtSaveDataInfo {
12031 #[inline]
12032 pub fn mediaType(&self) -> FS_MediaType {
12033 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 8u8) as u8) }
12034 }
12035 #[inline]
12036 pub fn set_mediaType(&mut self, val: FS_MediaType) {
12037 unsafe {
12038 let val: u8 = ::core::mem::transmute(val);
12039 self._bitfield_1.set(0usize, 8u8, val as u64)
12040 }
12041 }
12042 #[inline]
12043 pub unsafe fn mediaType_raw(this: *const Self) -> FS_MediaType {
12044 unsafe {
12045 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
12046 ::core::ptr::addr_of!((*this)._bitfield_1),
12047 0usize,
12048 8u8,
12049 ) as u8)
12050 }
12051 }
12052 #[inline]
12053 pub unsafe fn set_mediaType_raw(this: *mut Self, val: FS_MediaType) {
12054 unsafe {
12055 let val: u8 = ::core::mem::transmute(val);
12056 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
12057 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
12058 0usize,
12059 8u8,
12060 val as u64,
12061 )
12062 }
12063 }
12064 #[inline]
12065 pub fn new_bitfield_1(mediaType: FS_MediaType) -> __BindgenBitfieldUnit<[u8; 1usize]> {
12066 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
12067 __bindgen_bitfield_unit.set(0usize, 8u8, {
12068 let mediaType: u8 = unsafe { ::core::mem::transmute(mediaType) };
12069 mediaType as u64
12070 });
12071 __bindgen_bitfield_unit
12072 }
12073}
12074#[doc = "System save data information."]
12075#[repr(C)]
12076#[derive(Debug, Copy, Clone)]
12077pub struct FS_SystemSaveDataInfo {
12078 pub _bitfield_align_1: [u8; 0],
12079 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
12080 #[doc = "< Unknown."]
12081 pub unknown: u8_,
12082 #[doc = "< Reserved."]
12083 pub reserved: u16_,
12084 #[doc = "< Save ID."]
12085 pub saveId: u32_,
12086}
12087#[allow(clippy::unnecessary_operation, clippy::identity_op)]
12088const _: () = {
12089 ["Size of FS_SystemSaveDataInfo"][::core::mem::size_of::<FS_SystemSaveDataInfo>() - 8usize];
12090 ["Alignment of FS_SystemSaveDataInfo"]
12091 [::core::mem::align_of::<FS_SystemSaveDataInfo>() - 4usize];
12092 ["Offset of field: FS_SystemSaveDataInfo::unknown"]
12093 [::core::mem::offset_of!(FS_SystemSaveDataInfo, unknown) - 1usize];
12094 ["Offset of field: FS_SystemSaveDataInfo::reserved"]
12095 [::core::mem::offset_of!(FS_SystemSaveDataInfo, reserved) - 2usize];
12096 ["Offset of field: FS_SystemSaveDataInfo::saveId"]
12097 [::core::mem::offset_of!(FS_SystemSaveDataInfo, saveId) - 4usize];
12098};
12099impl Default for FS_SystemSaveDataInfo {
12100 fn default() -> Self {
12101 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
12102 unsafe {
12103 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
12104 s.assume_init()
12105 }
12106 }
12107}
12108impl FS_SystemSaveDataInfo {
12109 #[inline]
12110 pub fn mediaType(&self) -> FS_MediaType {
12111 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 8u8) as u8) }
12112 }
12113 #[inline]
12114 pub fn set_mediaType(&mut self, val: FS_MediaType) {
12115 unsafe {
12116 let val: u8 = ::core::mem::transmute(val);
12117 self._bitfield_1.set(0usize, 8u8, val as u64)
12118 }
12119 }
12120 #[inline]
12121 pub unsafe fn mediaType_raw(this: *const Self) -> FS_MediaType {
12122 unsafe {
12123 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
12124 ::core::ptr::addr_of!((*this)._bitfield_1),
12125 0usize,
12126 8u8,
12127 ) as u8)
12128 }
12129 }
12130 #[inline]
12131 pub unsafe fn set_mediaType_raw(this: *mut Self, val: FS_MediaType) {
12132 unsafe {
12133 let val: u8 = ::core::mem::transmute(val);
12134 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
12135 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
12136 0usize,
12137 8u8,
12138 val as u64,
12139 )
12140 }
12141 }
12142 #[inline]
12143 pub fn new_bitfield_1(mediaType: FS_MediaType) -> __BindgenBitfieldUnit<[u8; 1usize]> {
12144 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
12145 __bindgen_bitfield_unit.set(0usize, 8u8, {
12146 let mediaType: u8 = unsafe { ::core::mem::transmute(mediaType) };
12147 mediaType as u64
12148 });
12149 __bindgen_bitfield_unit
12150 }
12151}
12152#[doc = "Device move context."]
12153#[repr(C)]
12154#[derive(Debug, Default, Copy, Clone)]
12155pub struct FS_DeviceMoveContext {
12156 #[doc = "< IVs."]
12157 pub ivs: [u8_; 16usize],
12158 #[doc = "< Encrypt parameter."]
12159 pub encryptParameter: [u8_; 16usize],
12160}
12161#[allow(clippy::unnecessary_operation, clippy::identity_op)]
12162const _: () = {
12163 ["Size of FS_DeviceMoveContext"][::core::mem::size_of::<FS_DeviceMoveContext>() - 32usize];
12164 ["Alignment of FS_DeviceMoveContext"][::core::mem::align_of::<FS_DeviceMoveContext>() - 1usize];
12165 ["Offset of field: FS_DeviceMoveContext::ivs"]
12166 [::core::mem::offset_of!(FS_DeviceMoveContext, ivs) - 0usize];
12167 ["Offset of field: FS_DeviceMoveContext::encryptParameter"]
12168 [::core::mem::offset_of!(FS_DeviceMoveContext, encryptParameter) - 16usize];
12169};
12170#[doc = "Filesystem path data, detailing the specific target of an operation."]
12171#[repr(C)]
12172#[derive(Debug, Copy, Clone)]
12173pub struct FS_Path {
12174 #[doc = "< FS path type."]
12175 pub type_: FS_PathType,
12176 #[doc = "< FS path size."]
12177 pub size: u32_,
12178 #[doc = "< Pointer to FS path data."]
12179 pub data: *const ::libc::c_void,
12180}
12181#[allow(clippy::unnecessary_operation, clippy::identity_op)]
12182const _: () = {
12183 ["Size of FS_Path"][::core::mem::size_of::<FS_Path>() - 12usize];
12184 ["Alignment of FS_Path"][::core::mem::align_of::<FS_Path>() - 4usize];
12185 ["Offset of field: FS_Path::type_"][::core::mem::offset_of!(FS_Path, type_) - 0usize];
12186 ["Offset of field: FS_Path::size"][::core::mem::offset_of!(FS_Path, size) - 4usize];
12187 ["Offset of field: FS_Path::data"][::core::mem::offset_of!(FS_Path, data) - 8usize];
12188};
12189impl Default for FS_Path {
12190 fn default() -> Self {
12191 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
12192 unsafe {
12193 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
12194 s.assume_init()
12195 }
12196 }
12197}
12198#[doc = "SDMC/NAND speed information"]
12199#[repr(C)]
12200#[derive(Debug, Default, Copy, Clone)]
12201pub struct FS_SdMmcSpeedInfo {
12202 #[doc = "< Whether or not High Speed Mode is enabled."]
12203 pub highSpeedModeEnabled: bool,
12204 #[doc = "< Whether or not a clock divider of 2 is being used."]
12205 pub usesHighestClockRate: bool,
12206 #[doc = "< The value of the SD_CLK_CTRL register."]
12207 pub sdClkCtrl: u16_,
12208}
12209#[allow(clippy::unnecessary_operation, clippy::identity_op)]
12210const _: () = {
12211 ["Size of FS_SdMmcSpeedInfo"][::core::mem::size_of::<FS_SdMmcSpeedInfo>() - 4usize];
12212 ["Alignment of FS_SdMmcSpeedInfo"][::core::mem::align_of::<FS_SdMmcSpeedInfo>() - 2usize];
12213 ["Offset of field: FS_SdMmcSpeedInfo::highSpeedModeEnabled"]
12214 [::core::mem::offset_of!(FS_SdMmcSpeedInfo, highSpeedModeEnabled) - 0usize];
12215 ["Offset of field: FS_SdMmcSpeedInfo::usesHighestClockRate"]
12216 [::core::mem::offset_of!(FS_SdMmcSpeedInfo, usesHighestClockRate) - 1usize];
12217 ["Offset of field: FS_SdMmcSpeedInfo::sdClkCtrl"]
12218 [::core::mem::offset_of!(FS_SdMmcSpeedInfo, sdClkCtrl) - 2usize];
12219};
12220#[doc = "Filesystem archive handle, providing access to a filesystem's contents."]
12221pub type FS_Archive = u64_;
12222unsafe extern "C" {
12223 #[must_use]
12224 #[doc = "Initializes FS."]
12225 pub fn fsInit() -> Result;
12226}
12227unsafe extern "C" {
12228 #[doc = "Exits FS."]
12229 pub fn fsExit();
12230}
12231unsafe extern "C" {
12232 #[doc = "Sets the FSUSER session to use in the current thread.\n # Arguments\n\n* `session` - The handle of the FSUSER session to use."]
12233 pub fn fsUseSession(session: Handle);
12234}
12235unsafe extern "C" {
12236 #[doc = "Disables the FSUSER session override in the current thread."]
12237 pub fn fsEndUseSession();
12238}
12239unsafe extern "C" {
12240 #[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."]
12241 pub fn fsExemptFromSession(archive: FS_Archive);
12242}
12243unsafe extern "C" {
12244 #[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."]
12245 pub fn fsUnexemptFromSession(archive: FS_Archive);
12246}
12247unsafe extern "C" {
12248 #[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."]
12249 pub fn fsMakePath(type_: FS_PathType, path: *const ::libc::c_void) -> FS_Path;
12250}
12251unsafe extern "C" {
12252 #[doc = "Gets the current FS session handle.\n # Returns\n\nThe current FS session handle."]
12253 pub fn fsGetSessionHandle() -> *mut Handle;
12254}
12255unsafe extern "C" {
12256 #[must_use]
12257 #[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."]
12258 pub fn FSUSER_Control(
12259 action: FS_Action,
12260 input: *mut ::libc::c_void,
12261 inputSize: u32_,
12262 output: *mut ::libc::c_void,
12263 outputSize: u32_,
12264 ) -> Result;
12265}
12266unsafe extern "C" {
12267 #[must_use]
12268 #[doc = "Initializes a FSUSER session.\n # Arguments\n\n* `session` - The handle of the FSUSER session to initialize."]
12269 pub fn FSUSER_Initialize(session: Handle) -> Result;
12270}
12271unsafe extern "C" {
12272 #[must_use]
12273 #[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."]
12274 pub fn FSUSER_OpenFile(
12275 out: *mut Handle,
12276 archive: FS_Archive,
12277 path: FS_Path,
12278 openFlags: u32_,
12279 attributes: u32_,
12280 ) -> Result;
12281}
12282unsafe extern "C" {
12283 #[must_use]
12284 #[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."]
12285 pub fn FSUSER_OpenFileDirectly(
12286 out: *mut Handle,
12287 archiveId: FS_ArchiveID,
12288 archivePath: FS_Path,
12289 filePath: FS_Path,
12290 openFlags: u32_,
12291 attributes: u32_,
12292 ) -> Result;
12293}
12294unsafe extern "C" {
12295 #[must_use]
12296 #[doc = "Deletes a file.\n # Arguments\n\n* `archive` - Archive containing the file.\n * `path` - Path of the file."]
12297 pub fn FSUSER_DeleteFile(archive: FS_Archive, path: FS_Path) -> Result;
12298}
12299unsafe extern "C" {
12300 #[must_use]
12301 #[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."]
12302 pub fn FSUSER_RenameFile(
12303 srcArchive: FS_Archive,
12304 srcPath: FS_Path,
12305 dstArchive: FS_Archive,
12306 dstPath: FS_Path,
12307 ) -> Result;
12308}
12309unsafe extern "C" {
12310 #[must_use]
12311 #[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."]
12312 pub fn FSUSER_DeleteDirectory(archive: FS_Archive, path: FS_Path) -> Result;
12313}
12314unsafe extern "C" {
12315 #[must_use]
12316 #[doc = "Deletes a directory, also deleting its contents.\n # Arguments\n\n* `archive` - Archive containing the directory.\n * `path` - Path of the directory."]
12317 pub fn FSUSER_DeleteDirectoryRecursively(archive: FS_Archive, path: FS_Path) -> Result;
12318}
12319unsafe extern "C" {
12320 #[must_use]
12321 #[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."]
12322 pub fn FSUSER_CreateFile(
12323 archive: FS_Archive,
12324 path: FS_Path,
12325 attributes: u32_,
12326 fileSize: u64_,
12327 ) -> Result;
12328}
12329unsafe extern "C" {
12330 #[must_use]
12331 #[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."]
12332 pub fn FSUSER_CreateDirectory(archive: FS_Archive, path: FS_Path, attributes: u32_) -> Result;
12333}
12334unsafe extern "C" {
12335 #[must_use]
12336 #[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."]
12337 pub fn FSUSER_RenameDirectory(
12338 srcArchive: FS_Archive,
12339 srcPath: FS_Path,
12340 dstArchive: FS_Archive,
12341 dstPath: FS_Path,
12342 ) -> Result;
12343}
12344unsafe extern "C" {
12345 #[must_use]
12346 #[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."]
12347 pub fn FSUSER_OpenDirectory(out: *mut Handle, archive: FS_Archive, path: FS_Path) -> Result;
12348}
12349unsafe extern "C" {
12350 #[must_use]
12351 #[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."]
12352 pub fn FSUSER_OpenArchive(archive: *mut FS_Archive, id: FS_ArchiveID, path: FS_Path) -> Result;
12353}
12354unsafe extern "C" {
12355 #[must_use]
12356 #[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."]
12357 pub fn FSUSER_ControlArchive(
12358 archive: FS_Archive,
12359 action: FS_ArchiveAction,
12360 input: *mut ::libc::c_void,
12361 inputSize: u32_,
12362 output: *mut ::libc::c_void,
12363 outputSize: u32_,
12364 ) -> Result;
12365}
12366unsafe extern "C" {
12367 #[must_use]
12368 #[doc = "Closes an archive.\n # Arguments\n\n* `archive` - Archive to close."]
12369 pub fn FSUSER_CloseArchive(archive: FS_Archive) -> Result;
12370}
12371unsafe extern "C" {
12372 #[must_use]
12373 #[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."]
12374 pub fn FSUSER_GetFreeBytes(freeBytes: *mut u64_, archive: FS_Archive) -> Result;
12375}
12376unsafe extern "C" {
12377 #[must_use]
12378 #[doc = "Gets the inserted card type.\n # Arguments\n\n* `type` - Pointer to output the card type to."]
12379 pub fn FSUSER_GetCardType(type_: *mut FS_CardType) -> Result;
12380}
12381unsafe extern "C" {
12382 #[must_use]
12383 #[doc = "Gets the SDMC archive resource information.\n # Arguments\n\n* `archiveResource` - Pointer to output the archive resource information to."]
12384 pub fn FSUSER_GetSdmcArchiveResource(archiveResource: *mut FS_ArchiveResource) -> Result;
12385}
12386unsafe extern "C" {
12387 #[must_use]
12388 #[doc = "Gets the NAND archive resource information.\n # Arguments\n\n* `archiveResource` - Pointer to output the archive resource information to."]
12389 pub fn FSUSER_GetNandArchiveResource(archiveResource: *mut FS_ArchiveResource) -> Result;
12390}
12391unsafe extern "C" {
12392 #[must_use]
12393 #[doc = "Gets the last SDMC fatfs error.\n # Arguments\n\n* `error` - Pointer to output the error to."]
12394 pub fn FSUSER_GetSdmcFatfsError(error: *mut u32_) -> Result;
12395}
12396unsafe extern "C" {
12397 #[must_use]
12398 #[doc = "Gets whether an SD card is detected.\n # Arguments\n\n* `detected` - Pointer to output the detection status to."]
12399 pub fn FSUSER_IsSdmcDetected(detected: *mut bool) -> Result;
12400}
12401unsafe extern "C" {
12402 #[must_use]
12403 #[doc = "Gets whether the SD card is writable.\n # Arguments\n\n* `writable` - Pointer to output the writable status to."]
12404 pub fn FSUSER_IsSdmcWritable(writable: *mut bool) -> Result;
12405}
12406unsafe extern "C" {
12407 #[must_use]
12408 #[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)"]
12409 pub fn FSUSER_GetSdmcCid(out: *mut u8_, length: u32_) -> Result;
12410}
12411unsafe extern "C" {
12412 #[must_use]
12413 #[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)"]
12414 pub fn FSUSER_GetNandCid(out: *mut u8_, length: u32_) -> Result;
12415}
12416unsafe extern "C" {
12417 #[must_use]
12418 #[doc = "Gets the SDMC speed info.\n # Arguments\n\n* `speedInfo` - Pointer to output the speed info to."]
12419 pub fn FSUSER_GetSdmcSpeedInfo(speedInfo: *mut FS_SdMmcSpeedInfo) -> Result;
12420}
12421unsafe extern "C" {
12422 #[must_use]
12423 #[doc = "Gets the NAND speed info.\n # Arguments\n\n* `speedInfo` - Pointer to output the speed info to."]
12424 pub fn FSUSER_GetNandSpeedInfo(speedInfo: *mut FS_SdMmcSpeedInfo) -> Result;
12425}
12426unsafe extern "C" {
12427 #[must_use]
12428 #[doc = "Gets the SDMC log.\n # Arguments\n\n* `out` - Pointer to output the log to.\n * `length` - Length of the log buffer."]
12429 pub fn FSUSER_GetSdmcLog(out: *mut u8_, length: u32_) -> Result;
12430}
12431unsafe extern "C" {
12432 #[must_use]
12433 #[doc = "Gets the NAND log.\n # Arguments\n\n* `out` - Pointer to output the log to.\n * `length` - Length of the log buffer."]
12434 pub fn FSUSER_GetNandLog(out: *mut u8_, length: u32_) -> Result;
12435}
12436unsafe extern "C" {
12437 #[must_use]
12438 #[doc = "Clears the SDMC log."]
12439 pub fn FSUSER_ClearSdmcLog() -> Result;
12440}
12441unsafe extern "C" {
12442 #[must_use]
12443 #[doc = "Clears the NAND log."]
12444 pub fn FSUSER_ClearNandLog() -> Result;
12445}
12446unsafe extern "C" {
12447 #[must_use]
12448 #[doc = "Gets whether a card is inserted.\n # Arguments\n\n* `inserted` - Pointer to output the insertion status to."]
12449 pub fn FSUSER_CardSlotIsInserted(inserted: *mut bool) -> Result;
12450}
12451unsafe extern "C" {
12452 #[must_use]
12453 #[doc = "Powers on the card slot.\n # Arguments\n\n* `status` - Pointer to output the power status to."]
12454 pub fn FSUSER_CardSlotPowerOn(status: *mut bool) -> Result;
12455}
12456unsafe extern "C" {
12457 #[must_use]
12458 #[doc = "Powers off the card slot.\n # Arguments\n\n* `status` - Pointer to output the power status to."]
12459 pub fn FSUSER_CardSlotPowerOff(status: *mut bool) -> Result;
12460}
12461unsafe extern "C" {
12462 #[must_use]
12463 #[doc = "Gets the card's power status.\n # Arguments\n\n* `status` - Pointer to output the power status to."]
12464 pub fn FSUSER_CardSlotGetCardIFPowerStatus(status: *mut bool) -> Result;
12465}
12466unsafe extern "C" {
12467 #[must_use]
12468 #[doc = "Executes a CARDNOR direct command.\n # Arguments\n\n* `commandId` - ID of the command."]
12469 pub fn FSUSER_CardNorDirectCommand(commandId: u8_) -> Result;
12470}
12471unsafe extern "C" {
12472 #[must_use]
12473 #[doc = "Executes a CARDNOR direct command with an address.\n # Arguments\n\n* `commandId` - ID of the command.\n * `address` - Address to provide."]
12474 pub fn FSUSER_CardNorDirectCommandWithAddress(commandId: u8_, address: u32_) -> Result;
12475}
12476unsafe extern "C" {
12477 #[must_use]
12478 #[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."]
12479 pub fn FSUSER_CardNorDirectRead(
12480 commandId: u8_,
12481 size: u32_,
12482 output: *mut ::libc::c_void,
12483 ) -> Result;
12484}
12485unsafe extern "C" {
12486 #[must_use]
12487 #[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."]
12488 pub fn FSUSER_CardNorDirectReadWithAddress(
12489 commandId: u8_,
12490 address: u32_,
12491 size: u32_,
12492 output: *mut ::libc::c_void,
12493 ) -> Result;
12494}
12495unsafe extern "C" {
12496 #[must_use]
12497 #[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."]
12498 pub fn FSUSER_CardNorDirectWrite(
12499 commandId: u8_,
12500 size: u32_,
12501 input: *const ::libc::c_void,
12502 ) -> Result;
12503}
12504unsafe extern "C" {
12505 #[must_use]
12506 #[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."]
12507 pub fn FSUSER_CardNorDirectWriteWithAddress(
12508 commandId: u8_,
12509 address: u32_,
12510 size: u32_,
12511 input: *const ::libc::c_void,
12512 ) -> Result;
12513}
12514unsafe extern "C" {
12515 #[must_use]
12516 #[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."]
12517 pub fn FSUSER_CardNorDirectRead_4xIO(
12518 commandId: u8_,
12519 address: u32_,
12520 size: u32_,
12521 output: *mut ::libc::c_void,
12522 ) -> Result;
12523}
12524unsafe extern "C" {
12525 #[must_use]
12526 #[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."]
12527 pub fn FSUSER_CardNorDirectCpuWriteWithoutVerify(
12528 address: u32_,
12529 size: u32_,
12530 input: *const ::libc::c_void,
12531 ) -> Result;
12532}
12533unsafe extern "C" {
12534 #[must_use]
12535 #[doc = "Executes a CARDNOR direct sector erase without verify.\n # Arguments\n\n* `address` - Address to provide."]
12536 pub fn FSUSER_CardNorDirectSectorEraseWithoutVerify(address: u32_) -> Result;
12537}
12538unsafe extern "C" {
12539 #[must_use]
12540 #[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."]
12541 pub fn FSUSER_GetProductInfo(info: *mut FS_ProductInfo, processId: u32_) -> Result;
12542}
12543unsafe extern "C" {
12544 #[must_use]
12545 #[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."]
12546 pub fn FSUSER_GetProgramLaunchInfo(info: *mut FS_ProgramInfo, processId: u32_) -> Result;
12547}
12548unsafe extern "C" {
12549 #[must_use]
12550 #[doc = "Sets the CARDSPI baud rate.\n # Arguments\n\n* `baudRate` - Baud rate to set."]
12551 pub fn FSUSER_SetCardSpiBaudRate(baudRate: FS_CardSpiBaudRate) -> Result;
12552}
12553unsafe extern "C" {
12554 #[must_use]
12555 #[doc = "Sets the CARDSPI bus mode.\n # Arguments\n\n* `busMode` - Bus mode to set."]
12556 pub fn FSUSER_SetCardSpiBusMode(busMode: FS_CardSpiBusMode) -> Result;
12557}
12558unsafe extern "C" {
12559 #[must_use]
12560 #[doc = "Sends initialization info to ARM9."]
12561 pub fn FSUSER_SendInitializeInfoTo9() -> Result;
12562}
12563unsafe extern "C" {
12564 #[must_use]
12565 #[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."]
12566 pub fn FSUSER_GetSpecialContentIndex(
12567 index: *mut u16_,
12568 mediaType: FS_MediaType,
12569 programId: u64_,
12570 type_: FS_SpecialContentType,
12571 ) -> Result;
12572}
12573unsafe extern "C" {
12574 #[must_use]
12575 #[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)"]
12576 pub fn FSUSER_GetLegacyRomHeader(
12577 mediaType: FS_MediaType,
12578 programId: u64_,
12579 header: *mut ::libc::c_void,
12580 ) -> Result;
12581}
12582unsafe extern "C" {
12583 #[must_use]
12584 #[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)"]
12585 pub fn FSUSER_GetLegacyBannerData(
12586 mediaType: FS_MediaType,
12587 programId: u64_,
12588 banner: *mut ::libc::c_void,
12589 ) -> Result;
12590}
12591unsafe extern "C" {
12592 #[must_use]
12593 #[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."]
12594 pub fn FSUSER_CheckAuthorityToAccessExtSaveData(
12595 access: *mut bool,
12596 mediaType: FS_MediaType,
12597 saveId: u64_,
12598 processId: u32_,
12599 ) -> Result;
12600}
12601unsafe extern "C" {
12602 #[must_use]
12603 #[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."]
12604 pub fn FSUSER_QueryTotalQuotaSize(
12605 quotaSize: *mut u64_,
12606 directories: u32_,
12607 files: u32_,
12608 fileSizeCount: u32_,
12609 fileSizes: *mut u64_,
12610 ) -> Result;
12611}
12612unsafe extern "C" {
12613 #[must_use]
12614 #[doc = "Abnegates an access right.\n # Arguments\n\n* `accessRight` - Access right to abnegate."]
12615 pub fn FSUSER_AbnegateAccessRight(accessRight: u32_) -> Result;
12616}
12617unsafe extern "C" {
12618 #[must_use]
12619 #[doc = "Deletes the 3DS SDMC root."]
12620 pub fn FSUSER_DeleteSdmcRoot() -> Result;
12621}
12622unsafe extern "C" {
12623 #[must_use]
12624 #[doc = "Deletes all ext save data on the NAND."]
12625 pub fn FSUSER_DeleteAllExtSaveDataOnNand() -> Result;
12626}
12627unsafe extern "C" {
12628 #[must_use]
12629 #[doc = "Initializes the CTR file system."]
12630 pub fn FSUSER_InitializeCtrFileSystem() -> Result;
12631}
12632unsafe extern "C" {
12633 #[must_use]
12634 #[doc = "Creates the FS seed."]
12635 pub fn FSUSER_CreateSeed() -> Result;
12636}
12637unsafe extern "C" {
12638 #[must_use]
12639 #[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."]
12640 pub fn FSUSER_GetFormatInfo(
12641 totalSize: *mut u32_,
12642 directories: *mut u32_,
12643 files: *mut u32_,
12644 duplicateData: *mut bool,
12645 archiveId: FS_ArchiveID,
12646 path: FS_Path,
12647 ) -> Result;
12648}
12649unsafe extern "C" {
12650 #[must_use]
12651 #[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."]
12652 pub fn FSUSER_GetLegacyRomHeader2(
12653 headerSize: u32_,
12654 mediaType: FS_MediaType,
12655 programId: u64_,
12656 header: *mut ::libc::c_void,
12657 ) -> Result;
12658}
12659unsafe extern "C" {
12660 #[must_use]
12661 #[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."]
12662 pub fn FSUSER_GetSdmcCtrRootPath(out: *mut u8_, length: u32_) -> Result;
12663}
12664unsafe extern "C" {
12665 #[must_use]
12666 #[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."]
12667 pub fn FSUSER_GetArchiveResource(
12668 archiveResource: *mut FS_ArchiveResource,
12669 mediaType: FS_SystemMediaType,
12670 ) -> Result;
12671}
12672unsafe extern "C" {
12673 #[must_use]
12674 #[doc = "Exports the integrity verification seed.\n # Arguments\n\n* `seed` - Pointer to output the seed to."]
12675 pub fn FSUSER_ExportIntegrityVerificationSeed(
12676 seed: *mut FS_IntegrityVerificationSeed,
12677 ) -> Result;
12678}
12679unsafe extern "C" {
12680 #[must_use]
12681 #[doc = "Imports an integrity verification seed.\n # Arguments\n\n* `seed` - Seed to import."]
12682 pub fn FSUSER_ImportIntegrityVerificationSeed(
12683 seed: *mut FS_IntegrityVerificationSeed,
12684 ) -> Result;
12685}
12686unsafe extern "C" {
12687 #[must_use]
12688 #[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."]
12689 pub fn FSUSER_FormatSaveData(
12690 archiveId: FS_ArchiveID,
12691 path: FS_Path,
12692 blocks: u32_,
12693 directories: u32_,
12694 files: u32_,
12695 directoryBuckets: u32_,
12696 fileBuckets: u32_,
12697 duplicateData: bool,
12698 ) -> Result;
12699}
12700unsafe extern "C" {
12701 #[must_use]
12702 #[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."]
12703 pub fn FSUSER_GetLegacySubBannerData(
12704 bannerSize: u32_,
12705 mediaType: FS_MediaType,
12706 programId: u64_,
12707 banner: *mut ::libc::c_void,
12708 ) -> Result;
12709}
12710unsafe extern "C" {
12711 #[must_use]
12712 #[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."]
12713 pub fn FSUSER_UpdateSha256Context(
12714 data: *const ::libc::c_void,
12715 inputSize: u32_,
12716 hash: *mut u8_,
12717 ) -> Result;
12718}
12719unsafe extern "C" {
12720 #[must_use]
12721 #[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."]
12722 pub fn FSUSER_ReadSpecialFile(
12723 bytesRead: *mut u32_,
12724 fileOffset: u64_,
12725 size: u32_,
12726 data: *mut ::libc::c_void,
12727 ) -> Result;
12728}
12729unsafe extern "C" {
12730 #[must_use]
12731 #[doc = "Gets the size of a special file.\n # Arguments\n\n* `fileSize` - Pointer to output the size to."]
12732 pub fn FSUSER_GetSpecialFileSize(fileSize: *mut u64_) -> Result;
12733}
12734unsafe extern "C" {
12735 #[must_use]
12736 #[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."]
12737 pub fn FSUSER_CreateExtSaveData(
12738 info: FS_ExtSaveDataInfo,
12739 directories: u32_,
12740 files: u32_,
12741 sizeLimit: u64_,
12742 smdhSize: u32_,
12743 smdh: *mut u8_,
12744 ) -> Result;
12745}
12746unsafe extern "C" {
12747 #[must_use]
12748 #[doc = "Deletes ext save data.\n # Arguments\n\n* `info` - Info of the save data."]
12749 pub fn FSUSER_DeleteExtSaveData(info: FS_ExtSaveDataInfo) -> Result;
12750}
12751unsafe extern "C" {
12752 #[must_use]
12753 #[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."]
12754 pub fn FSUSER_ReadExtSaveDataIcon(
12755 bytesRead: *mut u32_,
12756 info: FS_ExtSaveDataInfo,
12757 smdhSize: u32_,
12758 smdh: *mut u8_,
12759 ) -> Result;
12760}
12761unsafe extern "C" {
12762 #[must_use]
12763 #[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."]
12764 pub fn FSUSER_GetExtDataBlockSize(
12765 totalBlocks: *mut u64_,
12766 freeBlocks: *mut u64_,
12767 blockSize: *mut u32_,
12768 info: FS_ExtSaveDataInfo,
12769 ) -> Result;
12770}
12771unsafe extern "C" {
12772 #[must_use]
12773 #[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."]
12774 pub fn FSUSER_EnumerateExtSaveData(
12775 idsWritten: *mut u32_,
12776 idsSize: u32_,
12777 mediaType: FS_MediaType,
12778 idSize: u32_,
12779 shared: bool,
12780 ids: *mut u8_,
12781 ) -> Result;
12782}
12783unsafe extern "C" {
12784 #[must_use]
12785 #[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."]
12786 pub fn FSUSER_CreateSystemSaveData(
12787 info: FS_SystemSaveDataInfo,
12788 totalSize: u32_,
12789 blockSize: u32_,
12790 directories: u32_,
12791 files: u32_,
12792 directoryBuckets: u32_,
12793 fileBuckets: u32_,
12794 duplicateData: bool,
12795 ) -> Result;
12796}
12797unsafe extern "C" {
12798 #[must_use]
12799 #[doc = "Deletes system save data.\n # Arguments\n\n* `info` - Info of the save data."]
12800 pub fn FSUSER_DeleteSystemSaveData(info: FS_SystemSaveDataInfo) -> Result;
12801}
12802unsafe extern "C" {
12803 #[must_use]
12804 #[doc = "Initiates a device move as the source device.\n # Arguments\n\n* `context` - Pointer to output the context to."]
12805 pub fn FSUSER_StartDeviceMoveAsSource(context: *mut FS_DeviceMoveContext) -> Result;
12806}
12807unsafe extern "C" {
12808 #[must_use]
12809 #[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."]
12810 pub fn FSUSER_StartDeviceMoveAsDestination(
12811 context: FS_DeviceMoveContext,
12812 clear: bool,
12813 ) -> Result;
12814}
12815unsafe extern "C" {
12816 #[must_use]
12817 #[doc = "Sets an archive's priority.\n # Arguments\n\n* `archive` - Archive to use.\n * `priority` - Priority to set."]
12818 pub fn FSUSER_SetArchivePriority(archive: FS_Archive, priority: u32_) -> Result;
12819}
12820unsafe extern "C" {
12821 #[must_use]
12822 #[doc = "Gets an archive's priority.\n # Arguments\n\n* `priority` - Pointer to output the priority to.\n * `archive` - Archive to use."]
12823 pub fn FSUSER_GetArchivePriority(priority: *mut u32_, archive: FS_Archive) -> Result;
12824}
12825unsafe extern "C" {
12826 #[must_use]
12827 #[doc = "Configures CTRCARD latency emulation.\n # Arguments\n\n* `latency` - Latency to apply, in milliseconds.\n * `emulateEndurance` - Whether to emulate card endurance."]
12828 pub fn FSUSER_SetCtrCardLatencyParameter(latency: u64_, emulateEndurance: bool) -> Result;
12829}
12830unsafe extern "C" {
12831 #[must_use]
12832 #[doc = "Toggles cleaning up invalid save data.\n # Arguments\n\n* `enable` - Whether to enable cleaning up invalid save data."]
12833 pub fn FSUSER_SwitchCleanupInvalidSaveData(enable: bool) -> Result;
12834}
12835unsafe extern "C" {
12836 #[must_use]
12837 #[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."]
12838 pub fn FSUSER_EnumerateSystemSaveData(
12839 idsWritten: *mut u32_,
12840 idsSize: u32_,
12841 ids: *mut u32_,
12842 ) -> Result;
12843}
12844unsafe extern "C" {
12845 #[must_use]
12846 #[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."]
12847 pub fn FSUSER_InitializeWithSdkVersion(session: Handle, version: u32_) -> Result;
12848}
12849unsafe extern "C" {
12850 #[must_use]
12851 #[doc = "Sets the file system priority.\n # Arguments\n\n* `priority` - Priority to set."]
12852 pub fn FSUSER_SetPriority(priority: u32_) -> Result;
12853}
12854unsafe extern "C" {
12855 #[must_use]
12856 #[doc = "Gets the file system priority.\n # Arguments\n\n* `priority` - Pointer to output the priority to."]
12857 pub fn FSUSER_GetPriority(priority: *mut u32_) -> Result;
12858}
12859unsafe extern "C" {
12860 #[must_use]
12861 #[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)"]
12862 pub fn FSUSER_SetSaveDataSecureValue(
12863 value: u64_,
12864 slot: FS_SecureValueSlot,
12865 titleUniqueId: u32_,
12866 titleVariation: u8_,
12867 ) -> Result;
12868}
12869unsafe extern "C" {
12870 #[must_use]
12871 #[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)"]
12872 pub fn FSUSER_GetSaveDataSecureValue(
12873 exists: *mut bool,
12874 value: *mut u64_,
12875 slot: FS_SecureValueSlot,
12876 titleUniqueId: u32_,
12877 titleVariation: u8_,
12878 ) -> Result;
12879}
12880unsafe extern "C" {
12881 #[must_use]
12882 #[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."]
12883 pub fn FSUSER_ControlSecureSave(
12884 action: FS_SecureSaveAction,
12885 input: *mut ::libc::c_void,
12886 inputSize: u32_,
12887 output: *mut ::libc::c_void,
12888 outputSize: u32_,
12889 ) -> Result;
12890}
12891unsafe extern "C" {
12892 #[must_use]
12893 #[doc = "Gets the media type of the current application.\n # Arguments\n\n* `mediaType` - Pointer to output the media type to."]
12894 pub fn FSUSER_GetMediaType(mediaType: *mut FS_MediaType) -> Result;
12895}
12896unsafe extern "C" {
12897 #[must_use]
12898 #[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."]
12899 pub fn FSFILE_Control(
12900 handle: Handle,
12901 action: FS_FileAction,
12902 input: *mut ::libc::c_void,
12903 inputSize: u32_,
12904 output: *mut ::libc::c_void,
12905 outputSize: u32_,
12906 ) -> Result;
12907}
12908unsafe extern "C" {
12909 #[must_use]
12910 #[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."]
12911 pub fn FSFILE_OpenSubFile(
12912 handle: Handle,
12913 subFile: *mut Handle,
12914 offset: u64_,
12915 size: u64_,
12916 ) -> Result;
12917}
12918unsafe extern "C" {
12919 #[must_use]
12920 #[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."]
12921 pub fn FSFILE_Read(
12922 handle: Handle,
12923 bytesRead: *mut u32_,
12924 offset: u64_,
12925 buffer: *mut ::libc::c_void,
12926 size: u32_,
12927 ) -> Result;
12928}
12929unsafe extern "C" {
12930 #[must_use]
12931 #[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."]
12932 pub fn FSFILE_Write(
12933 handle: Handle,
12934 bytesWritten: *mut u32_,
12935 offset: u64_,
12936 buffer: *const ::libc::c_void,
12937 size: u32_,
12938 flags: u32_,
12939 ) -> Result;
12940}
12941unsafe extern "C" {
12942 #[must_use]
12943 #[doc = "Gets the size of a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `size` - Pointer to output the size to."]
12944 pub fn FSFILE_GetSize(handle: Handle, size: *mut u64_) -> Result;
12945}
12946unsafe extern "C" {
12947 #[must_use]
12948 #[doc = "Sets the size of a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `size` - Size to set."]
12949 pub fn FSFILE_SetSize(handle: Handle, size: u64_) -> Result;
12950}
12951unsafe extern "C" {
12952 #[must_use]
12953 #[doc = "Gets the attributes of a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `attributes` - Pointer to output the attributes to."]
12954 pub fn FSFILE_GetAttributes(handle: Handle, attributes: *mut u32_) -> Result;
12955}
12956unsafe extern "C" {
12957 #[must_use]
12958 #[doc = "Sets the attributes of a file.\n # Arguments\n\n* `handle` - Handle of the file.\n * `attributes` - Attributes to set."]
12959 pub fn FSFILE_SetAttributes(handle: Handle, attributes: u32_) -> Result;
12960}
12961unsafe extern "C" {
12962 #[must_use]
12963 #[doc = "Closes a file.\n # Arguments\n\n* `handle` - Handle of the file."]
12964 pub fn FSFILE_Close(handle: Handle) -> Result;
12965}
12966unsafe extern "C" {
12967 #[must_use]
12968 #[doc = "Flushes a file's contents.\n # Arguments\n\n* `handle` - Handle of the file."]
12969 pub fn FSFILE_Flush(handle: Handle) -> Result;
12970}
12971unsafe extern "C" {
12972 #[must_use]
12973 #[doc = "Sets a file's priority.\n # Arguments\n\n* `handle` - Handle of the file.\n * `priority` - Priority to set."]
12974 pub fn FSFILE_SetPriority(handle: Handle, priority: u32_) -> Result;
12975}
12976unsafe extern "C" {
12977 #[must_use]
12978 #[doc = "Gets a file's priority.\n # Arguments\n\n* `handle` - Handle of the file.\n * `priority` - Pointer to output the priority to."]
12979 pub fn FSFILE_GetPriority(handle: Handle, priority: *mut u32_) -> Result;
12980}
12981unsafe extern "C" {
12982 #[must_use]
12983 #[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."]
12984 pub fn FSFILE_OpenLinkFile(handle: Handle, linkFile: *mut Handle) -> Result;
12985}
12986unsafe extern "C" {
12987 #[must_use]
12988 #[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."]
12989 pub fn FSDIR_Control(
12990 handle: Handle,
12991 action: FS_DirectoryAction,
12992 input: *mut ::libc::c_void,
12993 inputSize: u32_,
12994 output: *mut ::libc::c_void,
12995 outputSize: u32_,
12996 ) -> Result;
12997}
12998unsafe extern "C" {
12999 #[must_use]
13000 #[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."]
13001 pub fn FSDIR_Read(
13002 handle: Handle,
13003 entriesRead: *mut u32_,
13004 entryCount: u32_,
13005 entries: *mut FS_DirectoryEntry,
13006 ) -> Result;
13007}
13008unsafe extern "C" {
13009 #[must_use]
13010 #[doc = "Closes a directory.\n # Arguments\n\n* `handle` - Handle of the directory."]
13011 pub fn FSDIR_Close(handle: Handle) -> Result;
13012}
13013unsafe extern "C" {
13014 #[must_use]
13015 #[doc = "Sets a directory's priority.\n # Arguments\n\n* `handle` - Handle of the directory.\n * `priority` - Priority to set."]
13016 pub fn FSDIR_SetPriority(handle: Handle, priority: u32_) -> Result;
13017}
13018unsafe extern "C" {
13019 #[must_use]
13020 #[doc = "Gets a directory's priority.\n # Arguments\n\n* `handle` - Handle of the directory.\n * `priority` - Pointer to output the priority to."]
13021 pub fn FSDIR_GetPriority(handle: Handle, priority: *mut u32_) -> Result;
13022}
13023#[doc = "Contains basic information about a title."]
13024#[repr(C)]
13025#[derive(Debug, Default, Copy, Clone)]
13026pub struct AM_TitleEntry {
13027 #[doc = "< The title's ID."]
13028 pub titleID: u64_,
13029 #[doc = "< The title's installed size."]
13030 pub size: u64_,
13031 #[doc = "< The title's version."]
13032 pub version: u16_,
13033 #[doc = "< Unknown title data."]
13034 pub unk: [u8_; 6usize],
13035}
13036#[allow(clippy::unnecessary_operation, clippy::identity_op)]
13037const _: () = {
13038 ["Size of AM_TitleEntry"][::core::mem::size_of::<AM_TitleEntry>() - 24usize];
13039 ["Alignment of AM_TitleEntry"][::core::mem::align_of::<AM_TitleEntry>() - 8usize];
13040 ["Offset of field: AM_TitleEntry::titleID"]
13041 [::core::mem::offset_of!(AM_TitleEntry, titleID) - 0usize];
13042 ["Offset of field: AM_TitleEntry::size"][::core::mem::offset_of!(AM_TitleEntry, size) - 8usize];
13043 ["Offset of field: AM_TitleEntry::version"]
13044 [::core::mem::offset_of!(AM_TitleEntry, version) - 16usize];
13045 ["Offset of field: AM_TitleEntry::unk"][::core::mem::offset_of!(AM_TitleEntry, unk) - 18usize];
13046};
13047#[doc = "< Titles currently installing."]
13048pub const AM_STATUS_MASK_INSTALLING: _bindgen_ty_14 = 1;
13049#[doc = "< Titles awaiting finalization."]
13050pub const AM_STATUS_MASK_AWAITING_FINALIZATION: _bindgen_ty_14 = 2;
13051#[doc = "Pending title status mask values."]
13052pub type _bindgen_ty_14 = ::libc::c_uchar;
13053#[doc = "< Install aborted."]
13054pub const AM_STATUS_ABORTED: AM_InstallStatus = 2;
13055#[doc = "< Title saved, but not installed."]
13056pub const AM_STATUS_SAVED: AM_InstallStatus = 3;
13057#[doc = "< Install in progress."]
13058pub const AM_STATUS_INSTALL_IN_PROGRESS: AM_InstallStatus = 2050;
13059#[doc = "< Awaiting finalization."]
13060pub const AM_STATUS_AWAITING_FINALIZATION: AM_InstallStatus = 2051;
13061#[doc = "Pending title status values."]
13062pub type AM_InstallStatus = ::libc::c_ushort;
13063#[repr(C)]
13064#[derive(Debug, Default, Copy, Clone)]
13065pub struct AM_PendingTitleEntry {
13066 #[doc = "< Title ID"]
13067 pub titleId: u64_,
13068 #[doc = "< Version"]
13069 pub version: u16_,
13070 #[doc = "< AM_InstallStatus"]
13071 pub status: u16_,
13072 #[doc = "< Title Type"]
13073 pub titleType: u32_,
13074 #[doc = "< Unknown"]
13075 pub unk: [u8_; 8usize],
13076}
13077#[allow(clippy::unnecessary_operation, clippy::identity_op)]
13078const _: () = {
13079 ["Size of AM_PendingTitleEntry"][::core::mem::size_of::<AM_PendingTitleEntry>() - 24usize];
13080 ["Alignment of AM_PendingTitleEntry"][::core::mem::align_of::<AM_PendingTitleEntry>() - 8usize];
13081 ["Offset of field: AM_PendingTitleEntry::titleId"]
13082 [::core::mem::offset_of!(AM_PendingTitleEntry, titleId) - 0usize];
13083 ["Offset of field: AM_PendingTitleEntry::version"]
13084 [::core::mem::offset_of!(AM_PendingTitleEntry, version) - 8usize];
13085 ["Offset of field: AM_PendingTitleEntry::status"]
13086 [::core::mem::offset_of!(AM_PendingTitleEntry, status) - 10usize];
13087 ["Offset of field: AM_PendingTitleEntry::titleType"]
13088 [::core::mem::offset_of!(AM_PendingTitleEntry, titleType) - 12usize];
13089 ["Offset of field: AM_PendingTitleEntry::unk"]
13090 [::core::mem::offset_of!(AM_PendingTitleEntry, unk) - 16usize];
13091};
13092#[doc = "< Non-system titles."]
13093pub const AM_DELETE_PENDING_NON_SYSTEM: _bindgen_ty_15 = 1;
13094#[doc = "< System titles."]
13095pub const AM_DELETE_PENDING_SYSTEM: _bindgen_ty_15 = 2;
13096#[doc = "Pending title deletion flags."]
13097pub type _bindgen_ty_15 = ::libc::c_uchar;
13098#[doc = "Information about the TWL NAND partition."]
13099#[repr(C)]
13100#[derive(Debug, Default, Copy, Clone)]
13101pub struct AM_TWLPartitionInfo {
13102 #[doc = "< Total capacity."]
13103 pub capacity: u64_,
13104 #[doc = "< Total free space."]
13105 pub freeSpace: u64_,
13106 #[doc = "< Capacity for titles."]
13107 pub titlesCapacity: u64_,
13108 #[doc = "< Free space for titles."]
13109 pub titlesFreeSpace: u64_,
13110}
13111#[allow(clippy::unnecessary_operation, clippy::identity_op)]
13112const _: () = {
13113 ["Size of AM_TWLPartitionInfo"][::core::mem::size_of::<AM_TWLPartitionInfo>() - 32usize];
13114 ["Alignment of AM_TWLPartitionInfo"][::core::mem::align_of::<AM_TWLPartitionInfo>() - 8usize];
13115 ["Offset of field: AM_TWLPartitionInfo::capacity"]
13116 [::core::mem::offset_of!(AM_TWLPartitionInfo, capacity) - 0usize];
13117 ["Offset of field: AM_TWLPartitionInfo::freeSpace"]
13118 [::core::mem::offset_of!(AM_TWLPartitionInfo, freeSpace) - 8usize];
13119 ["Offset of field: AM_TWLPartitionInfo::titlesCapacity"]
13120 [::core::mem::offset_of!(AM_TWLPartitionInfo, titlesCapacity) - 16usize];
13121 ["Offset of field: AM_TWLPartitionInfo::titlesFreeSpace"]
13122 [::core::mem::offset_of!(AM_TWLPartitionInfo, titlesFreeSpace) - 24usize];
13123};
13124#[doc = "Contains information about a title's content."]
13125#[repr(C)]
13126#[derive(Debug, Default, Copy, Clone)]
13127pub struct AM_ContentInfo {
13128 #[doc = "< Index of the content in the title."]
13129 pub index: u16_,
13130 #[doc = "< ?"]
13131 pub type_: u16_,
13132 #[doc = "< ID of the content in the title."]
13133 pub contentId: u32_,
13134 #[doc = "< Size of the content in the title."]
13135 pub size: u64_,
13136 #[doc = "< AM_ContentInfoFlags"]
13137 pub flags: u8_,
13138 #[doc = "< Padding"]
13139 pub padding: [u8_; 7usize],
13140}
13141#[allow(clippy::unnecessary_operation, clippy::identity_op)]
13142const _: () = {
13143 ["Size of AM_ContentInfo"][::core::mem::size_of::<AM_ContentInfo>() - 24usize];
13144 ["Alignment of AM_ContentInfo"][::core::mem::align_of::<AM_ContentInfo>() - 8usize];
13145 ["Offset of field: AM_ContentInfo::index"]
13146 [::core::mem::offset_of!(AM_ContentInfo, index) - 0usize];
13147 ["Offset of field: AM_ContentInfo::type_"]
13148 [::core::mem::offset_of!(AM_ContentInfo, type_) - 2usize];
13149 ["Offset of field: AM_ContentInfo::contentId"]
13150 [::core::mem::offset_of!(AM_ContentInfo, contentId) - 4usize];
13151 ["Offset of field: AM_ContentInfo::size"]
13152 [::core::mem::offset_of!(AM_ContentInfo, size) - 8usize];
13153 ["Offset of field: AM_ContentInfo::flags"]
13154 [::core::mem::offset_of!(AM_ContentInfo, flags) - 16usize];
13155 ["Offset of field: AM_ContentInfo::padding"]
13156 [::core::mem::offset_of!(AM_ContentInfo, padding) - 17usize];
13157};
13158#[doc = "< ?"]
13159pub const AM_CONTENT_DOWNLOADED: AM_ContentInfoFlags = 1;
13160#[doc = "< ?"]
13161pub const AM_CONTENT_OWNED: AM_ContentInfoFlags = 2;
13162#[doc = "Title ContentInfo flags."]
13163pub type AM_ContentInfoFlags = ::libc::c_uchar;
13164unsafe extern "C" {
13165 #[must_use]
13166 #[doc = "Initializes AM. This doesn't initialize with \"am:app\", see amAppInit()."]
13167 pub fn amInit() -> Result;
13168}
13169unsafe extern "C" {
13170 #[must_use]
13171 #[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."]
13172 pub fn amAppInit() -> Result;
13173}
13174unsafe extern "C" {
13175 #[doc = "Exits AM."]
13176 pub fn amExit();
13177}
13178unsafe extern "C" {
13179 #[doc = "Gets the current AM session handle."]
13180 pub fn amGetSessionHandle() -> *mut Handle;
13181}
13182unsafe extern "C" {
13183 #[must_use]
13184 #[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."]
13185 pub fn AM_GetTitleCount(mediatype: FS_MediaType, count: *mut u32_) -> Result;
13186}
13187unsafe extern "C" {
13188 #[must_use]
13189 #[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."]
13190 pub fn AM_GetTitleList(
13191 titlesRead: *mut u32_,
13192 mediatype: FS_MediaType,
13193 titleCount: u32_,
13194 titleIds: *mut u64_,
13195 ) -> Result;
13196}
13197unsafe extern "C" {
13198 #[must_use]
13199 #[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."]
13200 pub fn AM_GetTitleInfo(
13201 mediatype: FS_MediaType,
13202 titleCount: u32_,
13203 titleIds: *mut u64_,
13204 titleInfo: *mut AM_TitleEntry,
13205 ) -> Result;
13206}
13207unsafe extern "C" {
13208 #[must_use]
13209 #[doc = "Gets the number of tickets installed on the system.\n # Arguments\n\n* `count` (direction out) - Pointer to output the ticket count to."]
13210 pub fn AM_GetTicketCount(count: *mut u32_) -> Result;
13211}
13212unsafe extern "C" {
13213 #[must_use]
13214 #[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."]
13215 pub fn AM_GetTicketList(
13216 ticketsRead: *mut u32_,
13217 ticketCount: u32_,
13218 skip: u32_,
13219 ticketIds: *mut u64_,
13220 ) -> Result;
13221}
13222unsafe extern "C" {
13223 #[must_use]
13224 #[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."]
13225 pub fn AM_GetPendingTitleCount(
13226 count: *mut u32_,
13227 mediatype: FS_MediaType,
13228 statusMask: u32_,
13229 ) -> Result;
13230}
13231unsafe extern "C" {
13232 #[must_use]
13233 #[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."]
13234 pub fn AM_GetPendingTitleList(
13235 titlesRead: *mut u32_,
13236 titleCount: u32_,
13237 mediatype: FS_MediaType,
13238 statusMask: u32_,
13239 titleIds: *mut u64_,
13240 ) -> Result;
13241}
13242unsafe extern "C" {
13243 #[must_use]
13244 #[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."]
13245 pub fn AM_GetPendingTitleInfo(
13246 titleCount: u32_,
13247 mediatype: FS_MediaType,
13248 titleIds: *mut u64_,
13249 titleInfo: *mut AM_PendingTitleEntry,
13250 ) -> Result;
13251}
13252unsafe extern "C" {
13253 #[must_use]
13254 #[doc = "Gets a 32-bit device-specific ID.\n # Arguments\n\n* `deviceID` - Pointer to write the device ID to."]
13255 pub fn AM_GetDeviceId(deviceID: *mut u32_) -> Result;
13256}
13257unsafe extern "C" {
13258 #[must_use]
13259 #[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)."]
13260 pub fn AM_ExportTwlBackup(
13261 titleID: u64_,
13262 operation: u8_,
13263 workbuf: *mut ::libc::c_void,
13264 workbuf_size: u32_,
13265 filepath: *const ::libc::c_char,
13266 ) -> Result;
13267}
13268unsafe extern "C" {
13269 #[must_use]
13270 #[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."]
13271 pub fn AM_ImportTwlBackup(
13272 filehandle: Handle,
13273 operation: u8_,
13274 buffer: *mut ::libc::c_void,
13275 size: u32_,
13276 ) -> Result;
13277}
13278unsafe extern "C" {
13279 #[must_use]
13280 #[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."]
13281 pub fn AM_ReadTwlBackupInfo(
13282 filehandle: Handle,
13283 outinfo: *mut ::libc::c_void,
13284 outinfo_size: u32_,
13285 workbuf: *mut ::libc::c_void,
13286 workbuf_size: u32_,
13287 banner: *mut ::libc::c_void,
13288 banner_size: u32_,
13289 ) -> Result;
13290}
13291unsafe extern "C" {
13292 #[must_use]
13293 #[doc = "Retrieves information about the NAND TWL partition.\n # Arguments\n\n* `info` (direction out) - Pointer to output the TWL partition info to."]
13294 pub fn AM_GetTWLPartitionInfo(info: *mut AM_TWLPartitionInfo) -> Result;
13295}
13296unsafe extern "C" {
13297 #[must_use]
13298 #[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."]
13299 pub fn AM_StartCiaInstall(mediatype: FS_MediaType, ciaHandle: *mut Handle) -> Result;
13300}
13301unsafe extern "C" {
13302 #[must_use]
13303 #[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."]
13304 pub fn AM_StartDlpChildCiaInstall(ciaHandle: *mut Handle) -> Result;
13305}
13306unsafe extern "C" {
13307 #[must_use]
13308 #[doc = "Aborts the CIA install process.\n # Arguments\n\n* `ciaHandle` - CIA handle to cancel."]
13309 pub fn AM_CancelCIAInstall(ciaHandle: Handle) -> Result;
13310}
13311unsafe extern "C" {
13312 #[must_use]
13313 #[doc = "Finalizes the CIA install process.\n # Arguments\n\n* `ciaHandle` - CIA handle to finalize."]
13314 pub fn AM_FinishCiaInstall(ciaHandle: Handle) -> Result;
13315}
13316unsafe extern "C" {
13317 #[must_use]
13318 #[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."]
13319 pub fn AM_FinishCiaInstallWithoutCommit(ciaHandle: Handle) -> Result;
13320}
13321unsafe extern "C" {
13322 #[must_use]
13323 #[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."]
13324 pub fn AM_CommitImportPrograms(
13325 mediaType: FS_MediaType,
13326 titleCount: u32_,
13327 temp: bool,
13328 titleIds: *const u64_,
13329 ) -> Result;
13330}
13331unsafe extern "C" {
13332 #[must_use]
13333 #[doc = "Deletes a title.\n # Arguments\n\n* `mediatype` - Media type to delete from.\n * `titleID` - ID of the title to delete."]
13334 pub fn AM_DeleteTitle(mediatype: FS_MediaType, titleID: u64_) -> Result;
13335}
13336unsafe extern "C" {
13337 #[must_use]
13338 #[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."]
13339 pub fn AM_DeleteAppTitle(mediatype: FS_MediaType, titleID: u64_) -> Result;
13340}
13341unsafe extern "C" {
13342 #[must_use]
13343 #[doc = "Deletes a ticket.\n # Arguments\n\n* `titleID` - ID of the ticket to delete."]
13344 pub fn AM_DeleteTicket(ticketId: u64_) -> Result;
13345}
13346unsafe extern "C" {
13347 #[must_use]
13348 #[doc = "Deletes a pending title.\n # Arguments\n\n* `mediatype` - Media type to delete from.\n * `titleId` - ID of the pending title to delete."]
13349 pub fn AM_DeletePendingTitle(mediatype: FS_MediaType, titleId: u64_) -> Result;
13350}
13351unsafe extern "C" {
13352 #[must_use]
13353 #[doc = "Deletes pending titles.\n # Arguments\n\n* `mediatype` - Media type to delete from.\n * `flags` - Flags used to select pending titles."]
13354 pub fn AM_DeletePendingTitles(mediatype: FS_MediaType, flags: u32_) -> Result;
13355}
13356unsafe extern "C" {
13357 #[must_use]
13358 #[doc = "Deletes all pending titles.\n # Arguments\n\n* `mediatype` - Media type to delete from."]
13359 pub fn AM_DeleteAllPendingTitles(mediatype: FS_MediaType) -> Result;
13360}
13361unsafe extern "C" {
13362 #[must_use]
13363 #[doc = "Installs the current NATIVE_FIRM title to NAND (firm0:/ & firm1:/)"]
13364 pub fn AM_InstallNativeFirm() -> Result;
13365}
13366unsafe extern "C" {
13367 #[must_use]
13368 #[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."]
13369 pub fn AM_InstallFirm(titleID: u64_) -> Result;
13370}
13371unsafe extern "C" {
13372 #[must_use]
13373 #[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)"]
13374 pub fn AM_GetTitleProductCode(
13375 mediatype: FS_MediaType,
13376 titleId: u64_,
13377 productCode: *mut ::libc::c_char,
13378 ) -> Result;
13379}
13380unsafe extern "C" {
13381 #[must_use]
13382 #[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."]
13383 pub fn AM_GetTitleExtDataId(
13384 extDataId: *mut u64_,
13385 mediatype: FS_MediaType,
13386 titleId: u64_,
13387 ) -> Result;
13388}
13389unsafe extern "C" {
13390 #[must_use]
13391 #[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."]
13392 pub fn AM_GetCiaFileInfo(
13393 mediatype: FS_MediaType,
13394 titleEntry: *mut AM_TitleEntry,
13395 fileHandle: Handle,
13396 ) -> Result;
13397}
13398unsafe extern "C" {
13399 #[must_use]
13400 #[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."]
13401 pub fn AM_GetCiaIcon(icon: *mut ::libc::c_void, fileHandle: Handle) -> Result;
13402}
13403unsafe extern "C" {
13404 #[must_use]
13405 #[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."]
13406 pub fn AM_GetCiaDependencies(dependencies: *mut u64_, fileHandle: Handle) -> Result;
13407}
13408unsafe extern "C" {
13409 #[must_use]
13410 #[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."]
13411 pub fn AM_GetCiaMetaOffset(metaOffset: *mut u64_, fileHandle: Handle) -> Result;
13412}
13413unsafe extern "C" {
13414 #[must_use]
13415 #[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."]
13416 pub fn AM_GetCiaCoreVersion(coreVersion: *mut u32_, fileHandle: Handle) -> Result;
13417}
13418unsafe extern "C" {
13419 #[must_use]
13420 #[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."]
13421 pub fn AM_GetCiaRequiredSpace(
13422 requiredSpace: *mut u64_,
13423 mediaType: FS_MediaType,
13424 fileHandle: Handle,
13425 ) -> Result;
13426}
13427unsafe extern "C" {
13428 #[must_use]
13429 #[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."]
13430 pub fn AM_GetCiaMetaSection(
13431 meta: *mut ::libc::c_void,
13432 size: u32_,
13433 fileHandle: Handle,
13434 ) -> Result;
13435}
13436unsafe extern "C" {
13437 #[must_use]
13438 #[doc = "Initializes the external (SD) title database.\n # Arguments\n\n* `overwrite` - Overwrites the database if it already exists."]
13439 pub fn AM_InitializeExternalTitleDatabase(overwrite: bool) -> Result;
13440}
13441unsafe extern "C" {
13442 #[must_use]
13443 #[doc = "Queries whether the external title database is available.\n # Arguments\n\n* `available` (direction out) - Pointer to output the availability status to."]
13444 pub fn AM_QueryAvailableExternalTitleDatabase(available: *mut bool) -> Result;
13445}
13446unsafe extern "C" {
13447 #[must_use]
13448 #[doc = "Begins installing a ticket.\n # Arguments\n\n* `ticketHandle` (direction out) - Pointer to output a handle to write ticket data to."]
13449 pub fn AM_InstallTicketBegin(ticketHandle: *mut Handle) -> Result;
13450}
13451unsafe extern "C" {
13452 #[must_use]
13453 #[doc = "Aborts installing a ticket.\n # Arguments\n\n* `ticketHandle` - Handle of the installation to abort."]
13454 pub fn AM_InstallTicketAbort(ticketHandle: Handle) -> Result;
13455}
13456unsafe extern "C" {
13457 #[must_use]
13458 #[doc = "Finishes installing a ticket.\n # Arguments\n\n* `ticketHandle` - Handle of the installation to finalize."]
13459 pub fn AM_InstallTicketFinish(ticketHandle: Handle) -> Result;
13460}
13461unsafe extern "C" {
13462 #[must_use]
13463 #[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)"]
13464 pub fn AM_InstallTitleBegin(mediaType: FS_MediaType, titleId: u64_, unk: bool) -> Result;
13465}
13466unsafe extern "C" {
13467 #[must_use]
13468 #[doc = "Stops installing a title, generally to be resumed later."]
13469 pub fn AM_InstallTitleStop() -> Result;
13470}
13471unsafe extern "C" {
13472 #[must_use]
13473 #[doc = "Resumes installing a title.\n # Arguments\n\n* `mediaType` - Destination to install to.\n * `titleId` - ID of the title to install."]
13474 pub fn AM_InstallTitleResume(mediaType: FS_MediaType, titleId: u64_) -> Result;
13475}
13476unsafe extern "C" {
13477 #[must_use]
13478 #[doc = "Aborts installing a title."]
13479 pub fn AM_InstallTitleAbort() -> Result;
13480}
13481unsafe extern "C" {
13482 #[must_use]
13483 #[doc = "Finishes installing a title."]
13484 pub fn AM_InstallTitleFinish() -> Result;
13485}
13486unsafe extern "C" {
13487 #[must_use]
13488 #[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."]
13489 pub fn AM_CommitImportTitles(
13490 mediaType: FS_MediaType,
13491 titleCount: u32_,
13492 temp: bool,
13493 titleIds: *const u64_,
13494 ) -> Result;
13495}
13496unsafe extern "C" {
13497 #[must_use]
13498 #[doc = "Begins installing a TMD.\n # Arguments\n\n* `tmdHandle` (direction out) - Pointer to output a handle to write TMD data to."]
13499 pub fn AM_InstallTmdBegin(tmdHandle: *mut Handle) -> Result;
13500}
13501unsafe extern "C" {
13502 #[must_use]
13503 #[doc = "Aborts installing a TMD.\n # Arguments\n\n* `tmdHandle` - Handle of the installation to abort."]
13504 pub fn AM_InstallTmdAbort(tmdHandle: Handle) -> Result;
13505}
13506unsafe extern "C" {
13507 #[must_use]
13508 #[doc = "Finishes installing a TMD.\n # Arguments\n\n* `tmdHandle` - Handle of the installation to finalize.\n * `unk` - Unknown. (usually true)"]
13509 pub fn AM_InstallTmdFinish(tmdHandle: Handle, unk: bool) -> Result;
13510}
13511unsafe extern "C" {
13512 #[must_use]
13513 #[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."]
13514 pub fn AM_CreateImportContentContexts(contentCount: u32_, contentIndices: *mut u16_) -> Result;
13515}
13516unsafe extern "C" {
13517 #[must_use]
13518 #[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."]
13519 pub fn AM_InstallContentBegin(contentHandle: *mut Handle, index: u16_) -> Result;
13520}
13521unsafe extern "C" {
13522 #[must_use]
13523 #[doc = "Stops installing title content, generally to be resumed later.\n # Arguments\n\n* `contentHandle` - Handle of the installation to abort."]
13524 pub fn AM_InstallContentStop(contentHandle: Handle) -> Result;
13525}
13526unsafe extern "C" {
13527 #[must_use]
13528 #[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."]
13529 pub fn AM_InstallContentResume(
13530 contentHandle: *mut Handle,
13531 resumeOffset: *mut u64_,
13532 index: u16_,
13533 ) -> Result;
13534}
13535unsafe extern "C" {
13536 #[must_use]
13537 #[doc = "Cancels installing title content.\n # Arguments\n\n* `contentHandle` - Handle of the installation to finalize."]
13538 pub fn AM_InstallContentCancel(contentHandle: Handle) -> Result;
13539}
13540unsafe extern "C" {
13541 #[must_use]
13542 #[doc = "Finishes installing title content.\n # Arguments\n\n* `contentHandle` - Handle of the installation to finalize."]
13543 pub fn AM_InstallContentFinish(contentHandle: Handle) -> Result;
13544}
13545unsafe extern "C" {
13546 #[must_use]
13547 #[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."]
13548 pub fn AM_ImportCertificates(
13549 cert1Size: u32_,
13550 cert1: *mut ::libc::c_void,
13551 cert2Size: u32_,
13552 cert2: *mut ::libc::c_void,
13553 cert3Size: u32_,
13554 cert3: *mut ::libc::c_void,
13555 cert4Size: u32_,
13556 cert4: *mut ::libc::c_void,
13557 ) -> Result;
13558}
13559unsafe extern "C" {
13560 #[must_use]
13561 #[doc = "Imports a certificate into the ticket certificate chain.\n # Arguments\n\n* `certSize` - Size of the certificate.\n * `cert` - Data of the certificate."]
13562 pub fn AM_ImportCertificate(certSize: u32_, cert: *mut ::libc::c_void) -> Result;
13563}
13564unsafe extern "C" {
13565 #[must_use]
13566 #[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."]
13567 pub fn AM_CommitImportTitlesAndUpdateFirmwareAuto(
13568 mediaType: FS_MediaType,
13569 titleCount: u32_,
13570 temp: bool,
13571 titleIds: *mut u64_,
13572 ) -> Result;
13573}
13574unsafe extern "C" {
13575 #[must_use]
13576 #[doc = "Resets play count of all installed demos by deleting their launch info."]
13577 pub fn AM_DeleteAllDemoLaunchInfos() -> Result;
13578}
13579unsafe extern "C" {
13580 #[must_use]
13581 #[doc = "Deletes temporary titles."]
13582 pub fn AM_DeleteAllTemporaryTitles() -> Result;
13583}
13584unsafe extern "C" {
13585 #[must_use]
13586 #[doc = "Deletes all expired titles.\n # Arguments\n\n* `mediatype` - Media type to delete from."]
13587 pub fn AM_DeleteAllExpiredTitles(mediatype: FS_MediaType) -> Result;
13588}
13589unsafe extern "C" {
13590 #[must_use]
13591 #[doc = "Deletes all TWL titles."]
13592 pub fn AM_DeleteAllTwlTitles() -> Result;
13593}
13594unsafe extern "C" {
13595 #[must_use]
13596 #[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)."]
13597 pub fn AMAPP_GetDLCContentInfoCount(
13598 count: *mut u32_,
13599 mediatype: FS_MediaType,
13600 titleID: u64_,
13601 ) -> Result;
13602}
13603unsafe extern "C" {
13604 #[must_use]
13605 #[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."]
13606 pub fn AMAPP_ListDLCContentInfos(
13607 contentInfoRead: *mut u32_,
13608 mediatype: FS_MediaType,
13609 titleID: u64_,
13610 contentInfoCount: u32_,
13611 offset: u32_,
13612 contentInfos: *mut AM_ContentInfo,
13613 ) -> Result;
13614}
13615unsafe extern "C" {
13616 #[must_use]
13617 #[doc = "Initializes AMPXI.\n # Arguments\n\n* `servhandle` - Optional service session handle to use for AMPXI, if zero srvGetServiceHandle() will be used."]
13618 pub fn ampxiInit(servhandle: Handle) -> Result;
13619}
13620unsafe extern "C" {
13621 #[doc = "Exits AMPXI."]
13622 pub fn ampxiExit();
13623}
13624unsafe extern "C" {
13625 #[must_use]
13626 #[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"]
13627 pub fn AMPXI_WriteTWLSavedata(
13628 titleid: u64_,
13629 buffer: *mut u8_,
13630 size: u32_,
13631 image_filepos: u32_,
13632 section_type: u8_,
13633 operation: u8_,
13634 ) -> Result;
13635}
13636unsafe extern "C" {
13637 #[must_use]
13638 #[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."]
13639 pub fn AMPXI_InstallTitlesFinish(
13640 mediaType: FS_MediaType,
13641 db: u8_,
13642 titlecount: u32_,
13643 tidlist: *mut u64_,
13644 ) -> Result;
13645}
13646pub const APPID_NONE: NS_APPID = 0;
13647#[doc = "< Home Menu"]
13648pub const APPID_HOMEMENU: NS_APPID = 257;
13649#[doc = "< Camera applet"]
13650pub const APPID_CAMERA: NS_APPID = 272;
13651#[doc = "< Friends List applet"]
13652pub const APPID_FRIENDS_LIST: NS_APPID = 274;
13653#[doc = "< Game Notes applet"]
13654pub const APPID_GAME_NOTES: NS_APPID = 275;
13655#[doc = "< Internet Browser"]
13656pub const APPID_WEB: NS_APPID = 276;
13657#[doc = "< Instruction Manual applet"]
13658pub const APPID_INSTRUCTION_MANUAL: NS_APPID = 277;
13659#[doc = "< Notifications applet"]
13660pub const APPID_NOTIFICATIONS: NS_APPID = 278;
13661#[doc = "< Miiverse applet (olv)"]
13662pub const APPID_MIIVERSE: NS_APPID = 279;
13663#[doc = "< Miiverse posting applet (solv3)"]
13664pub const APPID_MIIVERSE_POSTING: NS_APPID = 280;
13665#[doc = "< Amiibo settings applet (cabinet)"]
13666pub const APPID_AMIIBO_SETTINGS: NS_APPID = 281;
13667#[doc = "< Application"]
13668pub const APPID_APPLICATION: NS_APPID = 768;
13669#[doc = "< eShop (tiger)"]
13670pub const APPID_ESHOP: NS_APPID = 769;
13671#[doc = "< Software Keyboard"]
13672pub const APPID_SOFTWARE_KEYBOARD: NS_APPID = 1025;
13673#[doc = "< appletEd"]
13674pub const APPID_APPLETED: NS_APPID = 1026;
13675#[doc = "< PNOTE_AP"]
13676pub const APPID_PNOTE_AP: NS_APPID = 1028;
13677#[doc = "< SNOTE_AP"]
13678pub const APPID_SNOTE_AP: NS_APPID = 1029;
13679#[doc = "< error"]
13680pub const APPID_ERROR: NS_APPID = 1030;
13681#[doc = "< mint"]
13682pub const APPID_MINT: NS_APPID = 1031;
13683#[doc = "< extrapad"]
13684pub const APPID_EXTRAPAD: NS_APPID = 1032;
13685#[doc = "< memolib"]
13686pub const APPID_MEMOLIB: NS_APPID = 1033;
13687#[doc = "NS Application IDs.\n\n Retrieved from http://3dbrew.org/wiki/NS_and_APT_Services#AppIDs"]
13688pub type NS_APPID = ::libc::c_ushort;
13689#[doc = "< No position specified."]
13690pub const APTPOS_NONE: APT_AppletPos = -1;
13691#[doc = "< Application."]
13692pub const APTPOS_APP: APT_AppletPos = 0;
13693#[doc = "< Application library (?)."]
13694pub const APTPOS_APPLIB: APT_AppletPos = 1;
13695#[doc = "< System applet."]
13696pub const APTPOS_SYS: APT_AppletPos = 2;
13697#[doc = "< System library (?)."]
13698pub const APTPOS_SYSLIB: APT_AppletPos = 3;
13699#[doc = "< Resident applet."]
13700pub const APTPOS_RESIDENT: APT_AppletPos = 4;
13701#[doc = "APT applet position."]
13702pub type APT_AppletPos = ::libc::c_schar;
13703pub type APT_AppletAttr = u8_;
13704unsafe extern "C" {
13705 #[doc = "Create an APT_AppletAttr bitfield from its components."]
13706 #[link_name = "aptMakeAppletAttr__extern"]
13707 pub fn aptMakeAppletAttr(
13708 pos: APT_AppletPos,
13709 manualGpuRights: bool,
13710 manualDspRights: bool,
13711 ) -> APT_AppletAttr;
13712}
13713pub const APTREPLY_REJECT: APT_QueryReply = 0;
13714pub const APTREPLY_ACCEPT: APT_QueryReply = 1;
13715pub const APTREPLY_LATER: APT_QueryReply = 2;
13716#[doc = "APT query reply."]
13717pub type APT_QueryReply = ::libc::c_uchar;
13718#[doc = "< No signal received."]
13719pub const APTSIGNAL_NONE: APT_Signal = 0;
13720#[doc = "< HOME button pressed."]
13721pub const APTSIGNAL_HOMEBUTTON: APT_Signal = 1;
13722#[doc = "< HOME button pressed (again?)."]
13723pub const APTSIGNAL_HOMEBUTTON2: APT_Signal = 2;
13724#[doc = "< Prepare to enter sleep mode."]
13725pub const APTSIGNAL_SLEEP_QUERY: APT_Signal = 3;
13726#[doc = "< Triggered when ptm:s GetShellStatus() returns 5."]
13727pub const APTSIGNAL_SLEEP_CANCEL: APT_Signal = 4;
13728#[doc = "< Enter sleep mode."]
13729pub const APTSIGNAL_SLEEP_ENTER: APT_Signal = 5;
13730#[doc = "< Wake from sleep mode."]
13731pub const APTSIGNAL_SLEEP_WAKEUP: APT_Signal = 6;
13732#[doc = "< Shutdown."]
13733pub const APTSIGNAL_SHUTDOWN: APT_Signal = 7;
13734#[doc = "< POWER button pressed."]
13735pub const APTSIGNAL_POWERBUTTON: APT_Signal = 8;
13736#[doc = "< POWER button cleared (?)."]
13737pub const APTSIGNAL_POWERBUTTON2: APT_Signal = 9;
13738#[doc = "< System sleeping (?)."]
13739pub const APTSIGNAL_TRY_SLEEP: APT_Signal = 10;
13740#[doc = "< Order to close (such as when an error happens?)."]
13741pub const APTSIGNAL_ORDERTOCLOSE: APT_Signal = 11;
13742#[doc = "APT signals."]
13743pub type APT_Signal = ::libc::c_uchar;
13744#[doc = "< No command received."]
13745pub const APTCMD_NONE: APT_Command = 0;
13746#[doc = "< Applet should wake up."]
13747pub const APTCMD_WAKEUP: APT_Command = 1;
13748#[doc = "< Source applet sent us a parameter."]
13749pub const APTCMD_REQUEST: APT_Command = 2;
13750#[doc = "< Target applet replied to our parameter."]
13751pub const APTCMD_RESPONSE: APT_Command = 3;
13752#[doc = "< Exit (??)"]
13753pub const APTCMD_EXIT: APT_Command = 4;
13754#[doc = "< Message (??)"]
13755pub const APTCMD_MESSAGE: APT_Command = 5;
13756#[doc = "< HOME button pressed once."]
13757pub const APTCMD_HOMEBUTTON_ONCE: APT_Command = 6;
13758#[doc = "< HOME button pressed twice (double-pressed)."]
13759pub const APTCMD_HOMEBUTTON_TWICE: APT_Command = 7;
13760#[doc = "< DSP should sleep (manual DSP rights related?)."]
13761pub const APTCMD_DSP_SLEEP: APT_Command = 8;
13762#[doc = "< DSP should wake up (manual DSP rights related?)."]
13763pub const APTCMD_DSP_WAKEUP: APT_Command = 9;
13764#[doc = "< Applet wakes up due to a different applet exiting."]
13765pub const APTCMD_WAKEUP_EXIT: APT_Command = 10;
13766#[doc = "< Applet wakes up after being paused through HOME menu."]
13767pub const APTCMD_WAKEUP_PAUSE: APT_Command = 11;
13768#[doc = "< Applet wakes up due to being cancelled."]
13769pub const APTCMD_WAKEUP_CANCEL: APT_Command = 12;
13770#[doc = "< Applet wakes up due to all applets being cancelled."]
13771pub const APTCMD_WAKEUP_CANCELALL: APT_Command = 13;
13772#[doc = "< Applet wakes up due to POWER button being pressed (?)."]
13773pub const APTCMD_WAKEUP_POWERBUTTON: APT_Command = 14;
13774#[doc = "< Applet wakes up and is instructed to jump to HOME menu (?)."]
13775pub const APTCMD_WAKEUP_JUMPTOHOME: APT_Command = 15;
13776#[doc = "< Request for sysapplet (?)."]
13777pub const APTCMD_SYSAPPLET_REQUEST: APT_Command = 16;
13778#[doc = "< Applet wakes up and is instructed to launch another applet (?)."]
13779pub const APTCMD_WAKEUP_LAUNCHAPP: APT_Command = 17;
13780#[doc = "APT commands."]
13781pub type APT_Command = ::libc::c_uchar;
13782#[doc = "APT capture buffer information."]
13783#[repr(C)]
13784#[derive(Debug, Default, Copy, Clone)]
13785pub struct aptCaptureBufInfo {
13786 pub size: u32_,
13787 pub is3D: u32_,
13788 pub top: aptCaptureBufInfo__bindgen_ty_1,
13789 pub bottom: aptCaptureBufInfo__bindgen_ty_1,
13790}
13791#[repr(C)]
13792#[derive(Debug, Default, Copy, Clone)]
13793pub struct aptCaptureBufInfo__bindgen_ty_1 {
13794 pub leftOffset: u32_,
13795 pub rightOffset: u32_,
13796 pub format: u32_,
13797}
13798#[allow(clippy::unnecessary_operation, clippy::identity_op)]
13799const _: () = {
13800 ["Size of aptCaptureBufInfo__bindgen_ty_1"]
13801 [::core::mem::size_of::<aptCaptureBufInfo__bindgen_ty_1>() - 12usize];
13802 ["Alignment of aptCaptureBufInfo__bindgen_ty_1"]
13803 [::core::mem::align_of::<aptCaptureBufInfo__bindgen_ty_1>() - 4usize];
13804 ["Offset of field: aptCaptureBufInfo__bindgen_ty_1::leftOffset"]
13805 [::core::mem::offset_of!(aptCaptureBufInfo__bindgen_ty_1, leftOffset) - 0usize];
13806 ["Offset of field: aptCaptureBufInfo__bindgen_ty_1::rightOffset"]
13807 [::core::mem::offset_of!(aptCaptureBufInfo__bindgen_ty_1, rightOffset) - 4usize];
13808 ["Offset of field: aptCaptureBufInfo__bindgen_ty_1::format"]
13809 [::core::mem::offset_of!(aptCaptureBufInfo__bindgen_ty_1, format) - 8usize];
13810};
13811#[allow(clippy::unnecessary_operation, clippy::identity_op)]
13812const _: () = {
13813 ["Size of aptCaptureBufInfo"][::core::mem::size_of::<aptCaptureBufInfo>() - 32usize];
13814 ["Alignment of aptCaptureBufInfo"][::core::mem::align_of::<aptCaptureBufInfo>() - 4usize];
13815 ["Offset of field: aptCaptureBufInfo::size"]
13816 [::core::mem::offset_of!(aptCaptureBufInfo, size) - 0usize];
13817 ["Offset of field: aptCaptureBufInfo::is3D"]
13818 [::core::mem::offset_of!(aptCaptureBufInfo, is3D) - 4usize];
13819 ["Offset of field: aptCaptureBufInfo::top"]
13820 [::core::mem::offset_of!(aptCaptureBufInfo, top) - 8usize];
13821 ["Offset of field: aptCaptureBufInfo::bottom"]
13822 [::core::mem::offset_of!(aptCaptureBufInfo, bottom) - 20usize];
13823};
13824#[doc = "< App suspended."]
13825pub const APTHOOK_ONSUSPEND: APT_HookType = 0;
13826#[doc = "< App restored."]
13827pub const APTHOOK_ONRESTORE: APT_HookType = 1;
13828#[doc = "< App sleeping."]
13829pub const APTHOOK_ONSLEEP: APT_HookType = 2;
13830#[doc = "< App waking up."]
13831pub const APTHOOK_ONWAKEUP: APT_HookType = 3;
13832#[doc = "< App exiting."]
13833pub const APTHOOK_ONEXIT: APT_HookType = 4;
13834#[doc = "< Number of APT hook types."]
13835pub const APTHOOK_COUNT: APT_HookType = 5;
13836#[doc = "APT hook types."]
13837pub type APT_HookType = ::libc::c_uchar;
13838#[doc = "APT hook function."]
13839pub type aptHookFn =
13840 ::core::option::Option<unsafe extern "C" fn(hook: APT_HookType, param: *mut ::libc::c_void)>;
13841#[doc = "APT hook cookie."]
13842#[repr(C)]
13843#[derive(Debug, Copy, Clone)]
13844pub struct tag_aptHookCookie {
13845 #[doc = "< Next cookie."]
13846 pub next: *mut tag_aptHookCookie,
13847 #[doc = "< Hook callback."]
13848 pub callback: aptHookFn,
13849 #[doc = "< Callback parameter."]
13850 pub param: *mut ::libc::c_void,
13851}
13852#[allow(clippy::unnecessary_operation, clippy::identity_op)]
13853const _: () = {
13854 ["Size of tag_aptHookCookie"][::core::mem::size_of::<tag_aptHookCookie>() - 12usize];
13855 ["Alignment of tag_aptHookCookie"][::core::mem::align_of::<tag_aptHookCookie>() - 4usize];
13856 ["Offset of field: tag_aptHookCookie::next"]
13857 [::core::mem::offset_of!(tag_aptHookCookie, next) - 0usize];
13858 ["Offset of field: tag_aptHookCookie::callback"]
13859 [::core::mem::offset_of!(tag_aptHookCookie, callback) - 4usize];
13860 ["Offset of field: tag_aptHookCookie::param"]
13861 [::core::mem::offset_of!(tag_aptHookCookie, param) - 8usize];
13862};
13863impl Default for tag_aptHookCookie {
13864 fn default() -> Self {
13865 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
13866 unsafe {
13867 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
13868 s.assume_init()
13869 }
13870 }
13871}
13872#[doc = "APT hook cookie."]
13873pub type aptHookCookie = tag_aptHookCookie;
13874#[doc = "APT message callback."]
13875pub type aptMessageCb = ::core::option::Option<
13876 unsafe extern "C" fn(
13877 user: *mut ::libc::c_void,
13878 sender: NS_APPID,
13879 msg: *mut ::libc::c_void,
13880 msgsize: usize,
13881 ),
13882>;
13883unsafe extern "C" {
13884 #[must_use]
13885 #[doc = "Initializes APT."]
13886 pub fn aptInit() -> Result;
13887}
13888unsafe extern "C" {
13889 #[doc = "Exits APT."]
13890 pub fn aptExit();
13891}
13892unsafe extern "C" {
13893 #[must_use]
13894 #[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)."]
13895 pub fn aptSendCommand(aptcmdbuf: *mut u32_) -> Result;
13896}
13897unsafe extern "C" {
13898 #[doc = "Returns true if the application is currently in the foreground."]
13899 pub fn aptIsActive() -> bool;
13900}
13901unsafe extern "C" {
13902 #[doc = "Returns true if the system has told the application to close."]
13903 pub fn aptShouldClose() -> bool;
13904}
13905unsafe extern "C" {
13906 #[doc = "Returns true if the system can enter sleep mode while the application is active."]
13907 pub fn aptIsSleepAllowed() -> bool;
13908}
13909unsafe extern "C" {
13910 #[doc = "Configures whether the system can enter sleep mode while the application is active."]
13911 pub fn aptSetSleepAllowed(allowed: bool);
13912}
13913unsafe extern "C" {
13914 #[doc = "Handles incoming sleep mode requests."]
13915 pub fn aptHandleSleep();
13916}
13917unsafe extern "C" {
13918 #[doc = "Returns true if the user can press the HOME button to jump back to the HOME menu while the application is active."]
13919 pub fn aptIsHomeAllowed() -> bool;
13920}
13921unsafe extern "C" {
13922 #[doc = "Configures whether the user can press the HOME button to jump back to the HOME menu while the application is active."]
13923 pub fn aptSetHomeAllowed(allowed: bool);
13924}
13925unsafe extern "C" {
13926 #[doc = "Returns true if the system requires the application to jump back to the HOME menu."]
13927 pub fn aptShouldJumpToHome() -> bool;
13928}
13929unsafe extern "C" {
13930 #[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)."]
13931 pub fn aptCheckHomePressRejected() -> bool;
13932}
13933unsafe extern "C" {
13934 #[doc = "> **Deprecated** Alias for aptCheckHomePressRejected."]
13935 #[link_name = "aptIsHomePressed__extern"]
13936 pub fn aptIsHomePressed() -> bool;
13937}
13938unsafe extern "C" {
13939 #[doc = "Jumps back to the HOME menu."]
13940 pub fn aptJumpToHomeMenu();
13941}
13942unsafe extern "C" {
13943 #[doc = "Handles incoming jump-to-HOME requests."]
13944 #[link_name = "aptHandleJumpToHome__extern"]
13945 pub fn aptHandleJumpToHome();
13946}
13947unsafe extern "C" {
13948 #[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)."]
13949 pub fn aptMainLoop() -> bool;
13950}
13951unsafe extern "C" {
13952 #[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."]
13953 pub fn aptHook(cookie: *mut aptHookCookie, callback: aptHookFn, param: *mut ::libc::c_void);
13954}
13955unsafe extern "C" {
13956 #[doc = "Removes an APT status hook.\n # Arguments\n\n* `cookie` - Hook cookie to remove."]
13957 pub fn aptUnhook(cookie: *mut aptHookCookie);
13958}
13959unsafe extern "C" {
13960 #[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."]
13961 pub fn aptSetMessageCallback(callback: aptMessageCb, user: *mut ::libc::c_void);
13962}
13963unsafe extern "C" {
13964 #[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."]
13965 pub fn aptLaunchLibraryApplet(
13966 appId: NS_APPID,
13967 buf: *mut ::libc::c_void,
13968 bufsize: usize,
13969 handle: Handle,
13970 );
13971}
13972unsafe extern "C" {
13973 #[doc = "Launches a system 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 system applet."]
13974 pub fn aptLaunchSystemApplet(
13975 appId: NS_APPID,
13976 buf: *mut ::libc::c_void,
13977 bufsize: usize,
13978 handle: Handle,
13979 );
13980}
13981unsafe extern "C" {
13982 #[doc = "Clears the chainloader state."]
13983 pub fn aptClearChainloader();
13984}
13985unsafe extern "C" {
13986 #[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."]
13987 pub fn aptSetChainloader(programID: u64_, mediatype: u8_);
13988}
13989unsafe extern "C" {
13990 #[doc = "Configures the chainloader to launch the previous application."]
13991 pub fn aptSetChainloaderToCaller();
13992}
13993unsafe extern "C" {
13994 #[doc = "Configures the chainloader to relaunch the current application (i.e. soft-reset)"]
13995 pub fn aptSetChainloaderToSelf();
13996}
13997unsafe extern "C" {
13998 #[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."]
13999 pub fn aptSetChainloaderArgs(
14000 deliverArg: *const ::libc::c_void,
14001 deliverArgSize: usize,
14002 hmac: *const ::libc::c_void,
14003 );
14004}
14005unsafe extern "C" {
14006 #[must_use]
14007 #[doc = "Gets an APT lock handle.\n # Arguments\n\n* `flags` - Flags to use.\n * `lockHandle` - Pointer to output the lock handle to."]
14008 pub fn APT_GetLockHandle(flags: u16_, lockHandle: *mut Handle) -> Result;
14009}
14010unsafe extern "C" {
14011 #[must_use]
14012 #[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."]
14013 pub fn APT_Initialize(
14014 appId: NS_APPID,
14015 attr: APT_AppletAttr,
14016 signalEvent: *mut Handle,
14017 resumeEvent: *mut Handle,
14018 ) -> Result;
14019}
14020unsafe extern "C" {
14021 #[must_use]
14022 #[doc = "Terminates an application's registration with APT.\n # Arguments\n\n* `appID` - ID of the application."]
14023 pub fn APT_Finalize(appId: NS_APPID) -> Result;
14024}
14025unsafe extern "C" {
14026 #[must_use]
14027 #[doc = "Asynchronously resets the hardware."]
14028 pub fn APT_HardwareResetAsync() -> Result;
14029}
14030unsafe extern "C" {
14031 #[must_use]
14032 #[doc = "Enables APT.\n # Arguments\n\n* `attr` - Attributes of the application."]
14033 pub fn APT_Enable(attr: APT_AppletAttr) -> Result;
14034}
14035unsafe extern "C" {
14036 #[must_use]
14037 #[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."]
14038 pub fn APT_GetAppletManInfo(
14039 inpos: APT_AppletPos,
14040 outpos: *mut APT_AppletPos,
14041 req_appid: *mut NS_APPID,
14042 menu_appid: *mut NS_APPID,
14043 active_appid: *mut NS_APPID,
14044 ) -> Result;
14045}
14046unsafe extern "C" {
14047 #[doc = "Gets the menu's app ID.\n # Returns\n\nThe menu's app ID."]
14048 #[link_name = "aptGetMenuAppID__extern"]
14049 pub fn aptGetMenuAppID() -> NS_APPID;
14050}
14051unsafe extern "C" {
14052 #[must_use]
14053 #[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."]
14054 pub fn APT_GetAppletInfo(
14055 appID: NS_APPID,
14056 pProgramID: *mut u64_,
14057 pMediaType: *mut u8_,
14058 pRegistered: *mut bool,
14059 pLoadState: *mut bool,
14060 pAttributes: *mut APT_AppletAttr,
14061 ) -> Result;
14062}
14063unsafe extern "C" {
14064 #[must_use]
14065 #[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."]
14066 pub fn APT_GetAppletProgramInfo(id: u32_, flags: u32_, titleversion: *mut u16_) -> Result;
14067}
14068unsafe extern "C" {
14069 #[must_use]
14070 #[doc = "Gets the current application's program ID.\n # Arguments\n\n* `pProgramID` - Pointer to output the program ID to."]
14071 pub fn APT_GetProgramID(pProgramID: *mut u64_) -> Result;
14072}
14073unsafe extern "C" {
14074 #[must_use]
14075 #[doc = "Prepares to jump to the home menu."]
14076 pub fn APT_PrepareToJumpToHomeMenu() -> Result;
14077}
14078unsafe extern "C" {
14079 #[must_use]
14080 #[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."]
14081 pub fn APT_JumpToHomeMenu(
14082 param: *const ::libc::c_void,
14083 paramSize: usize,
14084 handle: Handle,
14085 ) -> Result;
14086}
14087unsafe extern "C" {
14088 #[must_use]
14089 #[doc = "Prepares to jump to an application.\n # Arguments\n\n* `exiting` - Specifies whether the applet is exiting."]
14090 pub fn APT_PrepareToJumpToApplication(exiting: bool) -> Result;
14091}
14092unsafe extern "C" {
14093 #[must_use]
14094 #[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."]
14095 pub fn APT_JumpToApplication(
14096 param: *const ::libc::c_void,
14097 paramSize: usize,
14098 handle: Handle,
14099 ) -> Result;
14100}
14101unsafe extern "C" {
14102 #[must_use]
14103 #[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."]
14104 pub fn APT_IsRegistered(appID: NS_APPID, out: *mut bool) -> Result;
14105}
14106unsafe extern "C" {
14107 #[must_use]
14108 #[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."]
14109 pub fn APT_InquireNotification(appID: u32_, signalType: *mut APT_Signal) -> Result;
14110}
14111unsafe extern "C" {
14112 #[must_use]
14113 #[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."]
14114 pub fn APT_SleepSystem(wakeEvents: *const PtmWakeEvents) -> Result;
14115}
14116unsafe extern "C" {
14117 #[must_use]
14118 #[doc = "Notifies an application to wait.\n # Arguments\n\n* `appID` - ID of the application."]
14119 pub fn APT_NotifyToWait(appID: NS_APPID) -> Result;
14120}
14121unsafe extern "C" {
14122 #[must_use]
14123 #[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."]
14124 pub fn APT_AppletUtility(
14125 id: ::libc::c_int,
14126 out: *mut ::libc::c_void,
14127 outSize: usize,
14128 in_: *const ::libc::c_void,
14129 inSize: usize,
14130 ) -> Result;
14131}
14132unsafe extern "C" {
14133 #[must_use]
14134 #[doc = "Sleeps if shell is closed (?)."]
14135 pub fn APT_SleepIfShellClosed() -> Result;
14136}
14137unsafe extern "C" {
14138 #[must_use]
14139 #[doc = "Locks a transition (?).\n # Arguments\n\n* `transition` - Transition ID.\n * `flag` - Flag (?)"]
14140 pub fn APT_LockTransition(transition: u32_, flag: bool) -> Result;
14141}
14142unsafe extern "C" {
14143 #[must_use]
14144 #[doc = "Tries to lock a transition (?).\n # Arguments\n\n* `transition` - Transition ID.\n * `succeeded` - Pointer to output whether the lock was successfully applied."]
14145 pub fn APT_TryLockTransition(transition: u32_, succeeded: *mut bool) -> Result;
14146}
14147unsafe extern "C" {
14148 #[must_use]
14149 #[doc = "Unlocks a transition (?).\n # Arguments\n\n* `transition` - Transition ID."]
14150 pub fn APT_UnlockTransition(transition: u32_) -> Result;
14151}
14152unsafe extern "C" {
14153 #[must_use]
14154 #[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."]
14155 pub fn APT_GlanceParameter(
14156 appID: NS_APPID,
14157 buffer: *mut ::libc::c_void,
14158 bufferSize: usize,
14159 sender: *mut NS_APPID,
14160 command: *mut APT_Command,
14161 actualSize: *mut usize,
14162 parameter: *mut Handle,
14163 ) -> Result;
14164}
14165unsafe extern "C" {
14166 #[must_use]
14167 #[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."]
14168 pub fn APT_ReceiveParameter(
14169 appID: NS_APPID,
14170 buffer: *mut ::libc::c_void,
14171 bufferSize: usize,
14172 sender: *mut NS_APPID,
14173 command: *mut APT_Command,
14174 actualSize: *mut usize,
14175 parameter: *mut Handle,
14176 ) -> Result;
14177}
14178unsafe extern "C" {
14179 #[must_use]
14180 #[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."]
14181 pub fn APT_SendParameter(
14182 source: NS_APPID,
14183 dest: NS_APPID,
14184 command: APT_Command,
14185 buffer: *const ::libc::c_void,
14186 bufferSize: u32_,
14187 parameter: Handle,
14188 ) -> Result;
14189}
14190unsafe extern "C" {
14191 #[must_use]
14192 #[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."]
14193 pub fn APT_CancelParameter(source: NS_APPID, dest: NS_APPID, success: *mut bool) -> Result;
14194}
14195unsafe extern "C" {
14196 #[must_use]
14197 #[doc = "Sends capture buffer information.\n # Arguments\n\n* `captureBuf` - Capture buffer information to send."]
14198 pub fn APT_SendCaptureBufferInfo(captureBuf: *const aptCaptureBufInfo) -> Result;
14199}
14200unsafe extern "C" {
14201 #[must_use]
14202 #[doc = "Replies to a sleep query.\n # Arguments\n\n* `appID` - ID of the application.\n * `reply` - Query reply value."]
14203 pub fn APT_ReplySleepQuery(appID: NS_APPID, reply: APT_QueryReply) -> Result;
14204}
14205unsafe extern "C" {
14206 #[must_use]
14207 #[doc = "Replies that a sleep notification has been completed.\n # Arguments\n\n* `appID` - ID of the application."]
14208 pub fn APT_ReplySleepNotificationComplete(appID: NS_APPID) -> Result;
14209}
14210unsafe extern "C" {
14211 #[must_use]
14212 #[doc = "Prepares to close the application.\n # Arguments\n\n* `cancelPreload` - Whether applet preloads should be cancelled."]
14213 pub fn APT_PrepareToCloseApplication(cancelPreload: bool) -> Result;
14214}
14215unsafe extern "C" {
14216 #[must_use]
14217 #[doc = "Closes the application.\n # Arguments\n\n* `param` - Parameters to close with.\n * `paramSize` - Size of param.\n * `handle` - Handle to pass."]
14218 pub fn APT_CloseApplication(
14219 param: *const ::libc::c_void,
14220 paramSize: usize,
14221 handle: Handle,
14222 ) -> Result;
14223}
14224unsafe extern "C" {
14225 #[must_use]
14226 #[doc = "Sets the application's CPU time limit.\n # Arguments\n\n* `percent` - CPU time limit percentage to set."]
14227 pub fn APT_SetAppCpuTimeLimit(percent: u32_) -> Result;
14228}
14229unsafe extern "C" {
14230 #[must_use]
14231 #[doc = "Gets the application's CPU time limit.\n # Arguments\n\n* `percent` - Pointer to output the CPU time limit percentage to."]
14232 pub fn APT_GetAppCpuTimeLimit(percent: *mut u32_) -> Result;
14233}
14234unsafe extern "C" {
14235 #[must_use]
14236 #[doc = "Checks whether the system is a New 3DS.\n # Arguments\n\n* `out` - Pointer to write the New 3DS flag to."]
14237 pub fn APT_CheckNew3DS(out: *mut bool) -> Result;
14238}
14239unsafe extern "C" {
14240 #[must_use]
14241 #[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."]
14242 pub fn APT_PrepareToDoApplicationJump(flags: u8_, programID: u64_, mediatype: u8_) -> Result;
14243}
14244unsafe extern "C" {
14245 #[must_use]
14246 #[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)."]
14247 pub fn APT_DoApplicationJump(
14248 param: *const ::libc::c_void,
14249 paramSize: usize,
14250 hmac: *const ::libc::c_void,
14251 ) -> Result;
14252}
14253unsafe extern "C" {
14254 #[must_use]
14255 #[doc = "Prepares to start a library applet.\n # Arguments\n\n* `appID` - AppID of the applet to start."]
14256 pub fn APT_PrepareToStartLibraryApplet(appID: NS_APPID) -> Result;
14257}
14258unsafe extern "C" {
14259 #[must_use]
14260 #[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."]
14261 pub fn APT_StartLibraryApplet(
14262 appID: NS_APPID,
14263 param: *const ::libc::c_void,
14264 paramSize: usize,
14265 handle: Handle,
14266 ) -> Result;
14267}
14268unsafe extern "C" {
14269 #[must_use]
14270 #[doc = "Prepares to start a system applet.\n # Arguments\n\n* `appID` - AppID of the applet to start."]
14271 pub fn APT_PrepareToStartSystemApplet(appID: NS_APPID) -> Result;
14272}
14273unsafe extern "C" {
14274 #[must_use]
14275 #[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."]
14276 pub fn APT_StartSystemApplet(
14277 appID: NS_APPID,
14278 param: *const ::libc::c_void,
14279 paramSize: usize,
14280 handle: Handle,
14281 ) -> Result;
14282}
14283unsafe extern "C" {
14284 #[must_use]
14285 #[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."]
14286 pub fn APT_GetSharedFont(fontHandle: *mut Handle, mapAddr: *mut u32_) -> Result;
14287}
14288unsafe extern "C" {
14289 #[must_use]
14290 #[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."]
14291 pub fn APT_ReceiveDeliverArg(
14292 param: *mut ::libc::c_void,
14293 paramSize: usize,
14294 hmac: *mut ::libc::c_void,
14295 sender: *mut u64_,
14296 received: *mut bool,
14297 ) -> Result;
14298}
14299#[doc = "BOSS context."]
14300#[repr(C)]
14301#[derive(Debug, Copy, Clone)]
14302pub struct bossContext {
14303 pub property: [u32_; 7usize],
14304 pub url: [::libc::c_char; 512usize],
14305 pub property_x8: u32_,
14306 pub property_x9: u8_,
14307 pub property_xa: [u8_; 256usize],
14308 pub property_xb: [u8_; 512usize],
14309 pub property_xd: [::libc::c_char; 864usize],
14310 pub property_xe: u32_,
14311 pub property_xf: [u32_; 3usize],
14312 pub property_x10: u8_,
14313 pub property_x11: u8_,
14314 pub property_x12: u8_,
14315 pub property_x13: u32_,
14316 pub property_x14: u32_,
14317 pub property_x15: [u8_; 64usize],
14318 pub property_x16: u32_,
14319 pub property_x3b: u32_,
14320 pub property_x3e: [u8_; 512usize],
14321}
14322#[allow(clippy::unnecessary_operation, clippy::identity_op)]
14323const _: () = {
14324 ["Size of bossContext"][::core::mem::size_of::<bossContext>() - 2792usize];
14325 ["Alignment of bossContext"][::core::mem::align_of::<bossContext>() - 4usize];
14326 ["Offset of field: bossContext::property"]
14327 [::core::mem::offset_of!(bossContext, property) - 0usize];
14328 ["Offset of field: bossContext::url"][::core::mem::offset_of!(bossContext, url) - 28usize];
14329 ["Offset of field: bossContext::property_x8"]
14330 [::core::mem::offset_of!(bossContext, property_x8) - 540usize];
14331 ["Offset of field: bossContext::property_x9"]
14332 [::core::mem::offset_of!(bossContext, property_x9) - 544usize];
14333 ["Offset of field: bossContext::property_xa"]
14334 [::core::mem::offset_of!(bossContext, property_xa) - 545usize];
14335 ["Offset of field: bossContext::property_xb"]
14336 [::core::mem::offset_of!(bossContext, property_xb) - 801usize];
14337 ["Offset of field: bossContext::property_xd"]
14338 [::core::mem::offset_of!(bossContext, property_xd) - 1313usize];
14339 ["Offset of field: bossContext::property_xe"]
14340 [::core::mem::offset_of!(bossContext, property_xe) - 2180usize];
14341 ["Offset of field: bossContext::property_xf"]
14342 [::core::mem::offset_of!(bossContext, property_xf) - 2184usize];
14343 ["Offset of field: bossContext::property_x10"]
14344 [::core::mem::offset_of!(bossContext, property_x10) - 2196usize];
14345 ["Offset of field: bossContext::property_x11"]
14346 [::core::mem::offset_of!(bossContext, property_x11) - 2197usize];
14347 ["Offset of field: bossContext::property_x12"]
14348 [::core::mem::offset_of!(bossContext, property_x12) - 2198usize];
14349 ["Offset of field: bossContext::property_x13"]
14350 [::core::mem::offset_of!(bossContext, property_x13) - 2200usize];
14351 ["Offset of field: bossContext::property_x14"]
14352 [::core::mem::offset_of!(bossContext, property_x14) - 2204usize];
14353 ["Offset of field: bossContext::property_x15"]
14354 [::core::mem::offset_of!(bossContext, property_x15) - 2208usize];
14355 ["Offset of field: bossContext::property_x16"]
14356 [::core::mem::offset_of!(bossContext, property_x16) - 2272usize];
14357 ["Offset of field: bossContext::property_x3b"]
14358 [::core::mem::offset_of!(bossContext, property_x3b) - 2276usize];
14359 ["Offset of field: bossContext::property_x3e"]
14360 [::core::mem::offset_of!(bossContext, property_x3e) - 2280usize];
14361};
14362impl Default for bossContext {
14363 fn default() -> Self {
14364 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
14365 unsafe {
14366 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
14367 s.assume_init()
14368 }
14369 }
14370}
14371pub const BOSSTASKSTATUS_STARTED: bossTaskStatus = 2;
14372pub const BOSSTASKSTATUS_ERROR: bossTaskStatus = 7;
14373#[doc = "BOSS task status."]
14374pub type bossTaskStatus = ::libc::c_uchar;
14375pub const bossNsDataHeaderInfoType_ContentSize: bossNsDataHeaderInfoTypes = 3;
14376#[doc = "Type values for bossGetNsDataHeaderInfo()."]
14377pub type bossNsDataHeaderInfoTypes = ::libc::c_uchar;
14378pub const bossNsDataHeaderInfoTypeSize_ContentSize: bossNsDataHeaderInfoTypeSizes = 4;
14379#[doc = "Size of the output data for bossGetNsDataHeaderInfo()."]
14380pub type bossNsDataHeaderInfoTypeSizes = ::libc::c_uchar;
14381unsafe extern "C" {
14382 #[must_use]
14383 #[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."]
14384 pub fn bossInit(programID: u64_, force_user: bool) -> Result;
14385}
14386unsafe extern "C" {
14387 #[must_use]
14388 #[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."]
14389 pub fn bossReinit(programID: u64_) -> Result;
14390}
14391unsafe extern "C" {
14392 #[doc = "Exits BOSS."]
14393 pub fn bossExit();
14394}
14395unsafe extern "C" {
14396 #[doc = "Returns the BOSS session handle."]
14397 pub fn bossGetSessionHandle() -> Handle;
14398}
14399unsafe extern "C" {
14400 #[must_use]
14401 #[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."]
14402 pub fn bossSetStorageInfo(extdataID: u64_, boss_size: u32_, mediaType: u8_) -> Result;
14403}
14404unsafe extern "C" {
14405 #[must_use]
14406 #[doc = "Unregister the content data storage location, which includes unregistering the BOSS-session programID with BOSS."]
14407 pub fn bossUnregisterStorage() -> Result;
14408}
14409unsafe extern "C" {
14410 #[must_use]
14411 #[doc = "Register a task.\n # Arguments\n\n* `taskID` - BOSS taskID.\n * `unk0` - Unknown, usually zero.\n * `unk1` - Unknown, usually zero."]
14412 pub fn bossRegisterTask(taskID: *const ::libc::c_char, unk0: u8_, unk1: u8_) -> Result;
14413}
14414unsafe extern "C" {
14415 #[must_use]
14416 #[doc = "Send a property.\n # Arguments\n\n* `PropertyID` - PropertyID\n * `buf` - Input buffer data.\n * `size` - Buffer size."]
14417 pub fn bossSendProperty(PropertyID: u16_, buf: *const ::libc::c_void, size: u32_) -> Result;
14418}
14419unsafe extern "C" {
14420 #[must_use]
14421 #[doc = "Deletes the content file for the specified NsDataId.\n # Arguments\n\n* `NsDataId` - NsDataId"]
14422 pub fn bossDeleteNsData(NsDataId: u32_) -> Result;
14423}
14424unsafe extern "C" {
14425 #[must_use]
14426 #[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."]
14427 pub fn bossGetNsDataHeaderInfo(
14428 NsDataId: u32_,
14429 type_: u8_,
14430 buffer: *mut ::libc::c_void,
14431 size: u32_,
14432 ) -> Result;
14433}
14434unsafe extern "C" {
14435 #[must_use]
14436 #[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."]
14437 pub fn bossReadNsData(
14438 NsDataId: u32_,
14439 offset: u64_,
14440 buffer: *mut ::libc::c_void,
14441 size: u32_,
14442 transfer_total: *mut u32_,
14443 unk_out: *mut u32_,
14444 ) -> Result;
14445}
14446unsafe extern "C" {
14447 #[must_use]
14448 #[doc = "Starts a task soon after running this command.\n # Arguments\n\n* `taskID` - BOSS taskID."]
14449 pub fn bossStartTaskImmediate(taskID: *const ::libc::c_char) -> Result;
14450}
14451unsafe extern "C" {
14452 #[must_use]
14453 #[doc = "Similar to bossStartTaskImmediate?\n # Arguments\n\n* `taskID` - BOSS taskID."]
14454 pub fn bossStartBgImmediate(taskID: *const ::libc::c_char) -> Result;
14455}
14456unsafe extern "C" {
14457 #[must_use]
14458 #[doc = "Deletes a task by using CancelTask and UnregisterTask internally.\n # Arguments\n\n* `taskID` - BOSS taskID.\n * `unk` - Unknown, usually zero?"]
14459 pub fn bossDeleteTask(taskID: *const ::libc::c_char, unk: u32_) -> Result;
14460}
14461unsafe extern "C" {
14462 #[must_use]
14463 #[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."]
14464 pub fn bossGetTaskState(
14465 taskID: *const ::libc::c_char,
14466 inval: s8,
14467 status: *mut u8_,
14468 out1: *mut u32_,
14469 out2: *mut u8_,
14470 ) -> Result;
14471}
14472unsafe extern "C" {
14473 #[must_use]
14474 #[doc = "This loads the current state of PropertyID 0x0 for the specified task.\n # Arguments\n\n* `taskID` - BOSS taskID."]
14475 pub fn bossGetTaskProperty0(taskID: *const ::libc::c_char, out: *mut u8_) -> Result;
14476}
14477unsafe extern "C" {
14478 #[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."]
14479 pub fn bossSetupContextDefault(
14480 ctx: *mut bossContext,
14481 seconds_interval: u32_,
14482 url: *const ::libc::c_char,
14483 );
14484}
14485unsafe extern "C" {
14486 #[must_use]
14487 #[doc = "Sends the config stored in the context. Used before registering a task.\n # Arguments\n\n* `bossContext` - BOSS context."]
14488 pub fn bossSendContextConfig(ctx: *mut bossContext) -> Result;
14489}
14490#[doc = "< 8-bit per component, planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples).Usually named YUV422P."]
14491pub const INPUT_YUV422_INDIV_8: Y2RU_InputFormat = 0;
14492#[doc = "< 8-bit per component, planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples).Usually named YUV420P."]
14493pub const INPUT_YUV420_INDIV_8: Y2RU_InputFormat = 1;
14494#[doc = "< 16-bit per component, planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples).Usually named YUV422P16."]
14495pub const INPUT_YUV422_INDIV_16: Y2RU_InputFormat = 2;
14496#[doc = "< 16-bit per component, planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples).Usually named YUV420P16."]
14497pub const INPUT_YUV420_INDIV_16: Y2RU_InputFormat = 3;
14498#[doc = "< 8-bit per component, packed YUV 4:2:2, 16bpp, (Y0 Cb Y1 Cr).Usually named YUYV422."]
14499pub const INPUT_YUV422_BATCH: Y2RU_InputFormat = 4;
14500#[doc = "Input color formats\n\n For the 16-bit per component formats, bits 15-8 are padding and 7-0 contains the value."]
14501pub type Y2RU_InputFormat = ::libc::c_uchar;
14502#[doc = "< 32-bit RGBA8888. The alpha component is the 8-bit value set by Y2RU_SetAlpha"]
14503pub const OUTPUT_RGB_32: Y2RU_OutputFormat = 0;
14504#[doc = "< 24-bit RGB888."]
14505pub const OUTPUT_RGB_24: Y2RU_OutputFormat = 1;
14506#[doc = "< 16-bit RGBA5551. The alpha bit is the 7th bit of the alpha value set by Y2RU_SetAlpha"]
14507pub const OUTPUT_RGB_16_555: Y2RU_OutputFormat = 2;
14508#[doc = "< 16-bit RGB565."]
14509pub const OUTPUT_RGB_16_565: Y2RU_OutputFormat = 3;
14510#[doc = "Output color formats\n\n Those are the same as the framebuffer and GPU texture formats."]
14511pub type Y2RU_OutputFormat = ::libc::c_uchar;
14512#[doc = "< No rotation."]
14513pub const ROTATION_NONE: Y2RU_Rotation = 0;
14514#[doc = "< Clockwise 90 degrees."]
14515pub const ROTATION_CLOCKWISE_90: Y2RU_Rotation = 1;
14516#[doc = "< Clockwise 180 degrees."]
14517pub const ROTATION_CLOCKWISE_180: Y2RU_Rotation = 2;
14518#[doc = "< Clockwise 270 degrees."]
14519pub const ROTATION_CLOCKWISE_270: Y2RU_Rotation = 3;
14520#[doc = "Rotation to be applied to the output."]
14521pub type Y2RU_Rotation = ::libc::c_uchar;
14522#[doc = "< The result buffer will be laid out in linear format, the usual way."]
14523pub const BLOCK_LINE: Y2RU_BlockAlignment = 0;
14524#[doc = "< The result will be stored as 8x8 blocks in Z-order.Useful for textures since it is the format used by the PICA200."]
14525pub const BLOCK_8_BY_8: Y2RU_BlockAlignment = 1;
14526#[doc = "Block alignment of output\n\n Defines the way the output will be laid out in memory."]
14527pub type Y2RU_BlockAlignment = ::libc::c_uchar;
14528#[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 "]
14529#[repr(C)]
14530#[derive(Debug, Default, Copy, Clone)]
14531pub struct Y2RU_ColorCoefficients {
14532 #[doc = "< RGB per unit Y."]
14533 pub rgb_Y: u16_,
14534 #[doc = "< Red per unit V."]
14535 pub r_V: u16_,
14536 #[doc = "< Green per unit V."]
14537 pub g_V: u16_,
14538 #[doc = "< Green per unit U."]
14539 pub g_U: u16_,
14540 #[doc = "< Blue per unit U."]
14541 pub b_U: u16_,
14542 #[doc = "< Red offset."]
14543 pub r_offset: u16_,
14544 #[doc = "< Green offset."]
14545 pub g_offset: u16_,
14546 #[doc = "< Blue offset."]
14547 pub b_offset: u16_,
14548}
14549#[allow(clippy::unnecessary_operation, clippy::identity_op)]
14550const _: () = {
14551 ["Size of Y2RU_ColorCoefficients"][::core::mem::size_of::<Y2RU_ColorCoefficients>() - 16usize];
14552 ["Alignment of Y2RU_ColorCoefficients"]
14553 [::core::mem::align_of::<Y2RU_ColorCoefficients>() - 2usize];
14554 ["Offset of field: Y2RU_ColorCoefficients::rgb_Y"]
14555 [::core::mem::offset_of!(Y2RU_ColorCoefficients, rgb_Y) - 0usize];
14556 ["Offset of field: Y2RU_ColorCoefficients::r_V"]
14557 [::core::mem::offset_of!(Y2RU_ColorCoefficients, r_V) - 2usize];
14558 ["Offset of field: Y2RU_ColorCoefficients::g_V"]
14559 [::core::mem::offset_of!(Y2RU_ColorCoefficients, g_V) - 4usize];
14560 ["Offset of field: Y2RU_ColorCoefficients::g_U"]
14561 [::core::mem::offset_of!(Y2RU_ColorCoefficients, g_U) - 6usize];
14562 ["Offset of field: Y2RU_ColorCoefficients::b_U"]
14563 [::core::mem::offset_of!(Y2RU_ColorCoefficients, b_U) - 8usize];
14564 ["Offset of field: Y2RU_ColorCoefficients::r_offset"]
14565 [::core::mem::offset_of!(Y2RU_ColorCoefficients, r_offset) - 10usize];
14566 ["Offset of field: Y2RU_ColorCoefficients::g_offset"]
14567 [::core::mem::offset_of!(Y2RU_ColorCoefficients, g_offset) - 12usize];
14568 ["Offset of field: Y2RU_ColorCoefficients::b_offset"]
14569 [::core::mem::offset_of!(Y2RU_ColorCoefficients, b_offset) - 14usize];
14570};
14571#[doc = "< Coefficients from the ITU-R BT.601 standard with PC ranges."]
14572pub const COEFFICIENT_ITU_R_BT_601: Y2RU_StandardCoefficient = 0;
14573#[doc = "< Coefficients from the ITU-R BT.709 standard with PC ranges."]
14574pub const COEFFICIENT_ITU_R_BT_709: Y2RU_StandardCoefficient = 1;
14575#[doc = "< Coefficients from the ITU-R BT.601 standard with TV ranges."]
14576pub const COEFFICIENT_ITU_R_BT_601_SCALING: Y2RU_StandardCoefficient = 2;
14577#[doc = "< Coefficients from the ITU-R BT.709 standard with TV ranges."]
14578pub const COEFFICIENT_ITU_R_BT_709_SCALING: Y2RU_StandardCoefficient = 3;
14579#[doc = "Preset conversion coefficients based on ITU standards for the YUV->RGB formula.\n\n For more details refer to Y2RU_ColorCoefficients"]
14580pub type Y2RU_StandardCoefficient = ::libc::c_uchar;
14581#[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."]
14582#[repr(C)]
14583#[derive(Debug, Copy, Clone)]
14584pub struct Y2RU_ConversionParams {
14585 pub _bitfield_align_1: [u8; 0],
14586 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>,
14587 #[doc = "< Value passed to Y2RU_SetInputLineWidth"]
14588 pub input_line_width: s16,
14589 #[doc = "< Value passed to Y2RU_SetInputLines"]
14590 pub input_lines: s16,
14591 pub _bitfield_align_2: [u8; 0],
14592 pub _bitfield_2: __BindgenBitfieldUnit<[u8; 1usize]>,
14593 #[doc = "< Unused."]
14594 pub unused: u8_,
14595 #[doc = "< Value passed to Y2RU_SetAlpha"]
14596 pub alpha: u16_,
14597}
14598#[allow(clippy::unnecessary_operation, clippy::identity_op)]
14599const _: () = {
14600 ["Size of Y2RU_ConversionParams"][::core::mem::size_of::<Y2RU_ConversionParams>() - 12usize];
14601 ["Alignment of Y2RU_ConversionParams"]
14602 [::core::mem::align_of::<Y2RU_ConversionParams>() - 2usize];
14603 ["Offset of field: Y2RU_ConversionParams::input_line_width"]
14604 [::core::mem::offset_of!(Y2RU_ConversionParams, input_line_width) - 4usize];
14605 ["Offset of field: Y2RU_ConversionParams::input_lines"]
14606 [::core::mem::offset_of!(Y2RU_ConversionParams, input_lines) - 6usize];
14607 ["Offset of field: Y2RU_ConversionParams::unused"]
14608 [::core::mem::offset_of!(Y2RU_ConversionParams, unused) - 9usize];
14609 ["Offset of field: Y2RU_ConversionParams::alpha"]
14610 [::core::mem::offset_of!(Y2RU_ConversionParams, alpha) - 10usize];
14611};
14612impl Default for Y2RU_ConversionParams {
14613 fn default() -> Self {
14614 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
14615 unsafe {
14616 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
14617 s.assume_init()
14618 }
14619 }
14620}
14621impl Y2RU_ConversionParams {
14622 #[inline]
14623 pub fn input_format(&self) -> Y2RU_InputFormat {
14624 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 8u8) as u8) }
14625 }
14626 #[inline]
14627 pub fn set_input_format(&mut self, val: Y2RU_InputFormat) {
14628 unsafe {
14629 let val: u8 = ::core::mem::transmute(val);
14630 self._bitfield_1.set(0usize, 8u8, val as u64)
14631 }
14632 }
14633 #[inline]
14634 pub unsafe fn input_format_raw(this: *const Self) -> Y2RU_InputFormat {
14635 unsafe {
14636 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
14637 ::core::ptr::addr_of!((*this)._bitfield_1),
14638 0usize,
14639 8u8,
14640 ) as u8)
14641 }
14642 }
14643 #[inline]
14644 pub unsafe fn set_input_format_raw(this: *mut Self, val: Y2RU_InputFormat) {
14645 unsafe {
14646 let val: u8 = ::core::mem::transmute(val);
14647 <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
14648 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
14649 0usize,
14650 8u8,
14651 val as u64,
14652 )
14653 }
14654 }
14655 #[inline]
14656 pub fn output_format(&self) -> Y2RU_OutputFormat {
14657 unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 8u8) as u8) }
14658 }
14659 #[inline]
14660 pub fn set_output_format(&mut self, val: Y2RU_OutputFormat) {
14661 unsafe {
14662 let val: u8 = ::core::mem::transmute(val);
14663 self._bitfield_1.set(8usize, 8u8, val as u64)
14664 }
14665 }
14666 #[inline]
14667 pub unsafe fn output_format_raw(this: *const Self) -> Y2RU_OutputFormat {
14668 unsafe {
14669 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
14670 ::core::ptr::addr_of!((*this)._bitfield_1),
14671 8usize,
14672 8u8,
14673 ) as u8)
14674 }
14675 }
14676 #[inline]
14677 pub unsafe fn set_output_format_raw(this: *mut Self, val: Y2RU_OutputFormat) {
14678 unsafe {
14679 let val: u8 = ::core::mem::transmute(val);
14680 <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
14681 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
14682 8usize,
14683 8u8,
14684 val as u64,
14685 )
14686 }
14687 }
14688 #[inline]
14689 pub fn rotation(&self) -> Y2RU_Rotation {
14690 unsafe { ::core::mem::transmute(self._bitfield_1.get(16usize, 8u8) as u8) }
14691 }
14692 #[inline]
14693 pub fn set_rotation(&mut self, val: Y2RU_Rotation) {
14694 unsafe {
14695 let val: u8 = ::core::mem::transmute(val);
14696 self._bitfield_1.set(16usize, 8u8, val as u64)
14697 }
14698 }
14699 #[inline]
14700 pub unsafe fn rotation_raw(this: *const Self) -> Y2RU_Rotation {
14701 unsafe {
14702 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
14703 ::core::ptr::addr_of!((*this)._bitfield_1),
14704 16usize,
14705 8u8,
14706 ) as u8)
14707 }
14708 }
14709 #[inline]
14710 pub unsafe fn set_rotation_raw(this: *mut Self, val: Y2RU_Rotation) {
14711 unsafe {
14712 let val: u8 = ::core::mem::transmute(val);
14713 <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
14714 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
14715 16usize,
14716 8u8,
14717 val as u64,
14718 )
14719 }
14720 }
14721 #[inline]
14722 pub fn block_alignment(&self) -> Y2RU_BlockAlignment {
14723 unsafe { ::core::mem::transmute(self._bitfield_1.get(24usize, 8u8) as u8) }
14724 }
14725 #[inline]
14726 pub fn set_block_alignment(&mut self, val: Y2RU_BlockAlignment) {
14727 unsafe {
14728 let val: u8 = ::core::mem::transmute(val);
14729 self._bitfield_1.set(24usize, 8u8, val as u64)
14730 }
14731 }
14732 #[inline]
14733 pub unsafe fn block_alignment_raw(this: *const Self) -> Y2RU_BlockAlignment {
14734 unsafe {
14735 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
14736 ::core::ptr::addr_of!((*this)._bitfield_1),
14737 24usize,
14738 8u8,
14739 ) as u8)
14740 }
14741 }
14742 #[inline]
14743 pub unsafe fn set_block_alignment_raw(this: *mut Self, val: Y2RU_BlockAlignment) {
14744 unsafe {
14745 let val: u8 = ::core::mem::transmute(val);
14746 <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
14747 ::core::ptr::addr_of_mut!((*this)._bitfield_1),
14748 24usize,
14749 8u8,
14750 val as u64,
14751 )
14752 }
14753 }
14754 #[inline]
14755 pub fn new_bitfield_1(
14756 input_format: Y2RU_InputFormat,
14757 output_format: Y2RU_OutputFormat,
14758 rotation: Y2RU_Rotation,
14759 block_alignment: Y2RU_BlockAlignment,
14760 ) -> __BindgenBitfieldUnit<[u8; 4usize]> {
14761 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default();
14762 __bindgen_bitfield_unit.set(0usize, 8u8, {
14763 let input_format: u8 = unsafe { ::core::mem::transmute(input_format) };
14764 input_format as u64
14765 });
14766 __bindgen_bitfield_unit.set(8usize, 8u8, {
14767 let output_format: u8 = unsafe { ::core::mem::transmute(output_format) };
14768 output_format as u64
14769 });
14770 __bindgen_bitfield_unit.set(16usize, 8u8, {
14771 let rotation: u8 = unsafe { ::core::mem::transmute(rotation) };
14772 rotation as u64
14773 });
14774 __bindgen_bitfield_unit.set(24usize, 8u8, {
14775 let block_alignment: u8 = unsafe { ::core::mem::transmute(block_alignment) };
14776 block_alignment as u64
14777 });
14778 __bindgen_bitfield_unit
14779 }
14780 #[inline]
14781 pub fn standard_coefficient(&self) -> Y2RU_StandardCoefficient {
14782 unsafe { ::core::mem::transmute(self._bitfield_2.get(0usize, 8u8) as u8) }
14783 }
14784 #[inline]
14785 pub fn set_standard_coefficient(&mut self, val: Y2RU_StandardCoefficient) {
14786 unsafe {
14787 let val: u8 = ::core::mem::transmute(val);
14788 self._bitfield_2.set(0usize, 8u8, val as u64)
14789 }
14790 }
14791 #[inline]
14792 pub unsafe fn standard_coefficient_raw(this: *const Self) -> Y2RU_StandardCoefficient {
14793 unsafe {
14794 ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 1usize]>>::raw_get(
14795 ::core::ptr::addr_of!((*this)._bitfield_2),
14796 0usize,
14797 8u8,
14798 ) as u8)
14799 }
14800 }
14801 #[inline]
14802 pub unsafe fn set_standard_coefficient_raw(this: *mut Self, val: Y2RU_StandardCoefficient) {
14803 unsafe {
14804 let val: u8 = ::core::mem::transmute(val);
14805 <__BindgenBitfieldUnit<[u8; 1usize]>>::raw_set(
14806 ::core::ptr::addr_of_mut!((*this)._bitfield_2),
14807 0usize,
14808 8u8,
14809 val as u64,
14810 )
14811 }
14812 }
14813 #[inline]
14814 pub fn new_bitfield_2(
14815 standard_coefficient: Y2RU_StandardCoefficient,
14816 ) -> __BindgenBitfieldUnit<[u8; 1usize]> {
14817 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
14818 __bindgen_bitfield_unit.set(0usize, 8u8, {
14819 let standard_coefficient: u8 = unsafe { ::core::mem::transmute(standard_coefficient) };
14820 standard_coefficient as u64
14821 });
14822 __bindgen_bitfield_unit
14823 }
14824}
14825#[doc = "Dithering weights."]
14826#[repr(C)]
14827#[derive(Debug, Default, Copy, Clone)]
14828pub struct Y2RU_DitheringWeightParams {
14829 #[doc = "< Weight 0 for even X, even Y."]
14830 pub w0_xEven_yEven: u16_,
14831 #[doc = "< Weight 0 for odd X, even Y."]
14832 pub w0_xOdd_yEven: u16_,
14833 #[doc = "< Weight 0 for even X, odd Y."]
14834 pub w0_xEven_yOdd: u16_,
14835 #[doc = "< Weight 0 for odd X, odd Y."]
14836 pub w0_xOdd_yOdd: u16_,
14837 #[doc = "< Weight 1 for even X, even Y."]
14838 pub w1_xEven_yEven: u16_,
14839 #[doc = "< Weight 1 for odd X, even Y."]
14840 pub w1_xOdd_yEven: u16_,
14841 #[doc = "< Weight 1 for even X, odd Y."]
14842 pub w1_xEven_yOdd: u16_,
14843 #[doc = "< Weight 1 for odd X, odd Y."]
14844 pub w1_xOdd_yOdd: u16_,
14845 #[doc = "< Weight 2 for even X, even Y."]
14846 pub w2_xEven_yEven: u16_,
14847 #[doc = "< Weight 2 for odd X, even Y."]
14848 pub w2_xOdd_yEven: u16_,
14849 #[doc = "< Weight 2 for even X, odd Y."]
14850 pub w2_xEven_yOdd: u16_,
14851 #[doc = "< Weight 2 for odd X, odd Y."]
14852 pub w2_xOdd_yOdd: u16_,
14853 #[doc = "< Weight 3 for even X, even Y."]
14854 pub w3_xEven_yEven: u16_,
14855 #[doc = "< Weight 3 for odd X, even Y."]
14856 pub w3_xOdd_yEven: u16_,
14857 #[doc = "< Weight 3 for even X, odd Y."]
14858 pub w3_xEven_yOdd: u16_,
14859 #[doc = "< Weight 3 for odd X, odd Y."]
14860 pub w3_xOdd_yOdd: u16_,
14861}
14862#[allow(clippy::unnecessary_operation, clippy::identity_op)]
14863const _: () = {
14864 ["Size of Y2RU_DitheringWeightParams"]
14865 [::core::mem::size_of::<Y2RU_DitheringWeightParams>() - 32usize];
14866 ["Alignment of Y2RU_DitheringWeightParams"]
14867 [::core::mem::align_of::<Y2RU_DitheringWeightParams>() - 2usize];
14868 ["Offset of field: Y2RU_DitheringWeightParams::w0_xEven_yEven"]
14869 [::core::mem::offset_of!(Y2RU_DitheringWeightParams, w0_xEven_yEven) - 0usize];
14870 ["Offset of field: Y2RU_DitheringWeightParams::w0_xOdd_yEven"]
14871 [::core::mem::offset_of!(Y2RU_DitheringWeightParams, w0_xOdd_yEven) - 2usize];
14872 ["Offset of field: Y2RU_DitheringWeightParams::w0_xEven_yOdd"]
14873 [::core::mem::offset_of!(Y2RU_DitheringWeightParams, w0_xEven_yOdd) - 4usize];
14874 ["Offset of field: Y2RU_DitheringWeightParams::w0_xOdd_yOdd"]
14875 [::core::mem::offset_of!(Y2RU_DitheringWeightParams, w0_xOdd_yOdd) - 6usize];
14876 ["Offset of field: Y2RU_DitheringWeightParams::w1_xEven_yEven"]
14877 [::core::mem::offset_of!(Y2RU_DitheringWeightParams, w1_xEven_yEven) - 8usize];
14878 ["Offset of field: Y2RU_DitheringWeightParams::w1_xOdd_yEven"]
14879 [::core::mem::offset_of!(Y2RU_DitheringWeightParams, w1_xOdd_yEven) - 10usize];
14880 ["Offset of field: Y2RU_DitheringWeightParams::w1_xEven_yOdd"]
14881 [::core::mem::offset_of!(Y2RU_DitheringWeightParams, w1_xEven_yOdd) - 12usize];
14882 ["Offset of field: Y2RU_DitheringWeightParams::w1_xOdd_yOdd"]
14883 [::core::mem::offset_of!(Y2RU_DitheringWeightParams, w1_xOdd_yOdd) - 14usize];
14884 ["Offset of field: Y2RU_DitheringWeightParams::w2_xEven_yEven"]
14885 [::core::mem::offset_of!(Y2RU_DitheringWeightParams, w2_xEven_yEven) - 16usize];
14886 ["Offset of field: Y2RU_DitheringWeightParams::w2_xOdd_yEven"]
14887 [::core::mem::offset_of!(Y2RU_DitheringWeightParams, w2_xOdd_yEven) - 18usize];
14888 ["Offset of field: Y2RU_DitheringWeightParams::w2_xEven_yOdd"]
14889 [::core::mem::offset_of!(Y2RU_DitheringWeightParams, w2_xEven_yOdd) - 20usize];
14890 ["Offset of field: Y2RU_DitheringWeightParams::w2_xOdd_yOdd"]
14891 [::core::mem::offset_of!(Y2RU_DitheringWeightParams, w2_xOdd_yOdd) - 22usize];
14892 ["Offset of field: Y2RU_DitheringWeightParams::w3_xEven_yEven"]
14893 [::core::mem::offset_of!(Y2RU_DitheringWeightParams, w3_xEven_yEven) - 24usize];
14894 ["Offset of field: Y2RU_DitheringWeightParams::w3_xOdd_yEven"]
14895 [::core::mem::offset_of!(Y2RU_DitheringWeightParams, w3_xOdd_yEven) - 26usize];
14896 ["Offset of field: Y2RU_DitheringWeightParams::w3_xEven_yOdd"]
14897 [::core::mem::offset_of!(Y2RU_DitheringWeightParams, w3_xEven_yOdd) - 28usize];
14898 ["Offset of field: Y2RU_DitheringWeightParams::w3_xOdd_yOdd"]
14899 [::core::mem::offset_of!(Y2RU_DitheringWeightParams, w3_xOdd_yOdd) - 30usize];
14900};
14901unsafe extern "C" {
14902 #[must_use]
14903 #[doc = "Initializes the y2r service.\n\n This will internally get the handle of the service, and on success call Y2RU_DriverInitialize."]
14904 pub fn y2rInit() -> Result;
14905}
14906unsafe extern "C" {
14907 #[doc = "Closes the y2r service.\n\n This will internally call Y2RU_DriverFinalize and close the handle of the service."]
14908 pub fn y2rExit();
14909}
14910unsafe extern "C" {
14911 #[must_use]
14912 #[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."]
14913 pub fn Y2RU_SetInputFormat(format: Y2RU_InputFormat) -> Result;
14914}
14915unsafe extern "C" {
14916 #[must_use]
14917 #[doc = "Gets the configured input format.\n # Arguments\n\n* `format` - Pointer to output the input format to."]
14918 pub fn Y2RU_GetInputFormat(format: *mut Y2RU_InputFormat) -> Result;
14919}
14920unsafe extern "C" {
14921 #[must_use]
14922 #[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."]
14923 pub fn Y2RU_SetOutputFormat(format: Y2RU_OutputFormat) -> Result;
14924}
14925unsafe extern "C" {
14926 #[must_use]
14927 #[doc = "Gets the configured output format.\n # Arguments\n\n* `format` - Pointer to output the output format to."]
14928 pub fn Y2RU_GetOutputFormat(format: *mut Y2RU_OutputFormat) -> Result;
14929}
14930unsafe extern "C" {
14931 #[must_use]
14932 #[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."]
14933 pub fn Y2RU_SetRotation(rotation: Y2RU_Rotation) -> Result;
14934}
14935unsafe extern "C" {
14936 #[must_use]
14937 #[doc = "Gets the configured rotation.\n # Arguments\n\n* `rotation` - Pointer to output the rotation to."]
14938 pub fn Y2RU_GetRotation(rotation: *mut Y2RU_Rotation) -> Result;
14939}
14940unsafe extern "C" {
14941 #[must_use]
14942 #[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."]
14943 pub fn Y2RU_SetBlockAlignment(alignment: Y2RU_BlockAlignment) -> Result;
14944}
14945unsafe extern "C" {
14946 #[must_use]
14947 #[doc = "Gets the configured alignment.\n # Arguments\n\n* `alignment` - Pointer to output the alignment to."]
14948 pub fn Y2RU_GetBlockAlignment(alignment: *mut Y2RU_BlockAlignment) -> Result;
14949}
14950unsafe extern "C" {
14951 #[must_use]
14952 #[doc = "Sets whether to use spacial dithering.\n # Arguments\n\n* `enable` - Whether to use spacial dithering."]
14953 pub fn Y2RU_SetSpacialDithering(enable: bool) -> Result;
14954}
14955unsafe extern "C" {
14956 #[must_use]
14957 #[doc = "Gets whether to use spacial dithering.\n # Arguments\n\n* `enable` - Pointer to output the spacial dithering state to."]
14958 pub fn Y2RU_GetSpacialDithering(enabled: *mut bool) -> Result;
14959}
14960unsafe extern "C" {
14961 #[must_use]
14962 #[doc = "Sets whether to use temporal dithering.\n # Arguments\n\n* `enable` - Whether to use temporal dithering."]
14963 pub fn Y2RU_SetTemporalDithering(enable: bool) -> Result;
14964}
14965unsafe extern "C" {
14966 #[must_use]
14967 #[doc = "Gets whether to use temporal dithering.\n # Arguments\n\n* `enable` - Pointer to output the temporal dithering state to."]
14968 pub fn Y2RU_GetTemporalDithering(enabled: *mut bool) -> Result;
14969}
14970unsafe extern "C" {
14971 #[must_use]
14972 #[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."]
14973 pub fn Y2RU_SetInputLineWidth(line_width: u16_) -> Result;
14974}
14975unsafe extern "C" {
14976 #[must_use]
14977 #[doc = "Gets the configured input line width.\n # Arguments\n\n* `line_width` - Pointer to output the line width to."]
14978 pub fn Y2RU_GetInputLineWidth(line_width: *mut u16_) -> Result;
14979}
14980unsafe extern "C" {
14981 #[must_use]
14982 #[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."]
14983 pub fn Y2RU_SetInputLines(num_lines: u16_) -> Result;
14984}
14985unsafe extern "C" {
14986 #[must_use]
14987 #[doc = "Gets the configured number of input lines.\n # Arguments\n\n* `num_lines` - Pointer to output the input lines to."]
14988 pub fn Y2RU_GetInputLines(num_lines: *mut u16_) -> Result;
14989}
14990unsafe extern "C" {
14991 #[must_use]
14992 #[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."]
14993 pub fn Y2RU_SetCoefficients(coefficients: *const Y2RU_ColorCoefficients) -> Result;
14994}
14995unsafe extern "C" {
14996 #[must_use]
14997 #[doc = "Gets the configured color coefficients.\n # Arguments\n\n* `num_lines` - Pointer to output the coefficients to."]
14998 pub fn Y2RU_GetCoefficients(coefficients: *mut Y2RU_ColorCoefficients) -> Result;
14999}
15000unsafe extern "C" {
15001 #[must_use]
15002 #[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."]
15003 pub fn Y2RU_SetStandardCoefficient(coefficient: Y2RU_StandardCoefficient) -> Result;
15004}
15005unsafe extern "C" {
15006 #[must_use]
15007 #[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."]
15008 pub fn Y2RU_GetStandardCoefficient(
15009 coefficients: *mut Y2RU_ColorCoefficients,
15010 standardCoeff: Y2RU_StandardCoefficient,
15011 ) -> Result;
15012}
15013unsafe extern "C" {
15014 #[must_use]
15015 #[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."]
15016 pub fn Y2RU_SetAlpha(alpha: u16_) -> Result;
15017}
15018unsafe extern "C" {
15019 #[must_use]
15020 #[doc = "Gets the configured output alpha value.\n # Arguments\n\n* `alpha` - Pointer to output the alpha value to."]
15021 pub fn Y2RU_GetAlpha(alpha: *mut u16_) -> Result;
15022}
15023unsafe extern "C" {
15024 #[must_use]
15025 #[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"]
15026 pub fn Y2RU_SetTransferEndInterrupt(should_interrupt: bool) -> Result;
15027}
15028unsafe extern "C" {
15029 #[must_use]
15030 #[doc = "Gets whether the transfer end interrupt is enabled.\n # Arguments\n\n* `should_interrupt` - Pointer to output the interrupt state to."]
15031 pub fn Y2RU_GetTransferEndInterrupt(should_interrupt: *mut bool) -> Result;
15032}
15033unsafe extern "C" {
15034 #[must_use]
15035 #[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."]
15036 pub fn Y2RU_GetTransferEndEvent(end_event: *mut Handle) -> Result;
15037}
15038unsafe extern "C" {
15039 #[must_use]
15040 #[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."]
15041 pub fn Y2RU_SetSendingY(
15042 src_buf: *const ::libc::c_void,
15043 image_size: u32_,
15044 transfer_unit: s16,
15045 transfer_gap: s16,
15046 ) -> Result;
15047}
15048unsafe extern "C" {
15049 #[must_use]
15050 #[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."]
15051 pub fn Y2RU_SetSendingU(
15052 src_buf: *const ::libc::c_void,
15053 image_size: u32_,
15054 transfer_unit: s16,
15055 transfer_gap: s16,
15056 ) -> Result;
15057}
15058unsafe extern "C" {
15059 #[must_use]
15060 #[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."]
15061 pub fn Y2RU_SetSendingV(
15062 src_buf: *const ::libc::c_void,
15063 image_size: u32_,
15064 transfer_unit: s16,
15065 transfer_gap: s16,
15066 ) -> Result;
15067}
15068unsafe extern "C" {
15069 #[must_use]
15070 #[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."]
15071 pub fn Y2RU_SetSendingYUYV(
15072 src_buf: *const ::libc::c_void,
15073 image_size: u32_,
15074 transfer_unit: s16,
15075 transfer_gap: s16,
15076 ) -> Result;
15077}
15078unsafe extern "C" {
15079 #[must_use]
15080 #[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."]
15081 pub fn Y2RU_SetReceiving(
15082 dst_buf: *mut ::libc::c_void,
15083 image_size: u32_,
15084 transfer_unit: s16,
15085 transfer_gap: s16,
15086 ) -> Result;
15087}
15088unsafe extern "C" {
15089 #[must_use]
15090 #[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."]
15091 pub fn Y2RU_IsDoneSendingY(is_done: *mut bool) -> Result;
15092}
15093unsafe extern "C" {
15094 #[must_use]
15095 #[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."]
15096 pub fn Y2RU_IsDoneSendingU(is_done: *mut bool) -> Result;
15097}
15098unsafe extern "C" {
15099 #[must_use]
15100 #[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."]
15101 pub fn Y2RU_IsDoneSendingV(is_done: *mut bool) -> Result;
15102}
15103unsafe extern "C" {
15104 #[must_use]
15105 #[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."]
15106 pub fn Y2RU_IsDoneSendingYUYV(is_done: *mut bool) -> Result;
15107}
15108unsafe extern "C" {
15109 #[must_use]
15110 #[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."]
15111 pub fn Y2RU_IsDoneReceiving(is_done: *mut bool) -> Result;
15112}
15113unsafe extern "C" {
15114 #[must_use]
15115 #[doc = "Configures the dithering weight parameters.\n # Arguments\n\n* `params` - Dithering weight parameters to use."]
15116 pub fn Y2RU_SetDitheringWeightParams(params: *const Y2RU_DitheringWeightParams) -> Result;
15117}
15118unsafe extern "C" {
15119 #[must_use]
15120 #[doc = "Gets the configured dithering weight parameters.\n # Arguments\n\n* `params` - Pointer to output the dithering weight parameters to."]
15121 pub fn Y2RU_GetDitheringWeightParams(params: *mut Y2RU_DitheringWeightParams) -> Result;
15122}
15123unsafe extern "C" {
15124 #[must_use]
15125 #[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."]
15126 pub fn Y2RU_SetConversionParams(params: *const Y2RU_ConversionParams) -> Result;
15127}
15128unsafe extern "C" {
15129 #[must_use]
15130 #[doc = "Starts the conversion process"]
15131 pub fn Y2RU_StartConversion() -> Result;
15132}
15133unsafe extern "C" {
15134 #[must_use]
15135 #[doc = "Cancels the conversion"]
15136 pub fn Y2RU_StopConversion() -> Result;
15137}
15138unsafe extern "C" {
15139 #[must_use]
15140 #[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."]
15141 pub fn Y2RU_IsBusyConversion(is_busy: *mut bool) -> Result;
15142}
15143unsafe extern "C" {
15144 #[must_use]
15145 #[doc = "Checks whether Y2R is ready to be used.\n # Arguments\n\n* `ping` - Pointer to output the ready status to."]
15146 pub fn Y2RU_PingProcess(ping: *mut u8_) -> Result;
15147}
15148unsafe extern "C" {
15149 #[must_use]
15150 #[doc = "Initializes the Y2R driver."]
15151 pub fn Y2RU_DriverInitialize() -> Result;
15152}
15153unsafe extern "C" {
15154 #[must_use]
15155 #[doc = "Terminates the Y2R driver."]
15156 pub fn Y2RU_DriverFinalize() -> Result;
15157}
15158#[doc = "< No port."]
15159pub const PORT_NONE: _bindgen_ty_16 = 0;
15160#[doc = "< CAM1 port."]
15161pub const PORT_CAM1: _bindgen_ty_16 = 1;
15162#[doc = "< CAM2 port."]
15163pub const PORT_CAM2: _bindgen_ty_16 = 2;
15164#[doc = "< Both ports."]
15165pub const PORT_BOTH: _bindgen_ty_16 = 3;
15166#[doc = "Camera connection target ports."]
15167pub type _bindgen_ty_16 = ::libc::c_uchar;
15168#[doc = "< No camera."]
15169pub const SELECT_NONE: _bindgen_ty_17 = 0;
15170#[doc = "< Outer camera 1."]
15171pub const SELECT_OUT1: _bindgen_ty_17 = 1;
15172#[doc = "< Inner camera 1."]
15173pub const SELECT_IN1: _bindgen_ty_17 = 2;
15174#[doc = "< Outer camera 2."]
15175pub const SELECT_OUT2: _bindgen_ty_17 = 4;
15176#[doc = "< Outer camera 1 and inner camera 1."]
15177pub const SELECT_IN1_OUT1: _bindgen_ty_17 = 3;
15178#[doc = "< Both outer cameras."]
15179pub const SELECT_OUT1_OUT2: _bindgen_ty_17 = 5;
15180#[doc = "< Inner camera 1 and outer camera 2."]
15181pub const SELECT_IN1_OUT2: _bindgen_ty_17 = 6;
15182#[doc = "< All cameras."]
15183pub const SELECT_ALL: _bindgen_ty_17 = 7;
15184#[doc = "Camera combinations."]
15185pub type _bindgen_ty_17 = ::libc::c_uchar;
15186#[doc = "< No context."]
15187pub const CONTEXT_NONE: CAMU_Context = 0;
15188#[doc = "< Context A."]
15189pub const CONTEXT_A: CAMU_Context = 1;
15190#[doc = "< Context B."]
15191pub const CONTEXT_B: CAMU_Context = 2;
15192#[doc = "< Both contexts."]
15193pub const CONTEXT_BOTH: CAMU_Context = 3;
15194#[doc = "Camera contexts."]
15195pub type CAMU_Context = ::libc::c_uchar;
15196#[doc = "< No flip."]
15197pub const FLIP_NONE: CAMU_Flip = 0;
15198#[doc = "< Horizontal flip."]
15199pub const FLIP_HORIZONTAL: CAMU_Flip = 1;
15200#[doc = "< Vertical flip."]
15201pub const FLIP_VERTICAL: CAMU_Flip = 2;
15202#[doc = "< Reverse flip."]
15203pub const FLIP_REVERSE: CAMU_Flip = 3;
15204#[doc = "Ways to flip the camera image."]
15205pub type CAMU_Flip = ::libc::c_uchar;
15206#[doc = "< VGA size. (640x480)"]
15207pub const SIZE_VGA: CAMU_Size = 0;
15208#[doc = "< QVGA size. (320x240)"]
15209pub const SIZE_QVGA: CAMU_Size = 1;
15210#[doc = "< QQVGA size. (160x120)"]
15211pub const SIZE_QQVGA: CAMU_Size = 2;
15212#[doc = "< CIF size. (352x288)"]
15213pub const SIZE_CIF: CAMU_Size = 3;
15214#[doc = "< QCIF size. (176x144)"]
15215pub const SIZE_QCIF: CAMU_Size = 4;
15216#[doc = "< DS LCD size. (256x192)"]
15217pub const SIZE_DS_LCD: CAMU_Size = 5;
15218#[doc = "< DS LCD x4 size. (512x384)"]
15219pub const SIZE_DS_LCDx4: CAMU_Size = 6;
15220#[doc = "< CTR Top LCD size. (400x240)"]
15221pub const SIZE_CTR_TOP_LCD: CAMU_Size = 7;
15222#[doc = "< CTR Bottom LCD size. (320x240)"]
15223pub const SIZE_CTR_BOTTOM_LCD: CAMU_Size = 1;
15224#[doc = "Camera image resolutions."]
15225pub type CAMU_Size = ::libc::c_uchar;
15226#[doc = "< 15 FPS."]
15227pub const FRAME_RATE_15: CAMU_FrameRate = 0;
15228#[doc = "< 15-5 FPS."]
15229pub const FRAME_RATE_15_TO_5: CAMU_FrameRate = 1;
15230#[doc = "< 15-2 FPS."]
15231pub const FRAME_RATE_15_TO_2: CAMU_FrameRate = 2;
15232#[doc = "< 10 FPS."]
15233pub const FRAME_RATE_10: CAMU_FrameRate = 3;
15234#[doc = "< 8.5 FPS."]
15235pub const FRAME_RATE_8_5: CAMU_FrameRate = 4;
15236#[doc = "< 5 FPS."]
15237pub const FRAME_RATE_5: CAMU_FrameRate = 5;
15238#[doc = "< 20 FPS."]
15239pub const FRAME_RATE_20: CAMU_FrameRate = 6;
15240#[doc = "< 20-5 FPS."]
15241pub const FRAME_RATE_20_TO_5: CAMU_FrameRate = 7;
15242#[doc = "< 30 FPS."]
15243pub const FRAME_RATE_30: CAMU_FrameRate = 8;
15244#[doc = "< 30-5 FPS."]
15245pub const FRAME_RATE_30_TO_5: CAMU_FrameRate = 9;
15246#[doc = "< 15-10 FPS."]
15247pub const FRAME_RATE_15_TO_10: CAMU_FrameRate = 10;
15248#[doc = "< 20-10 FPS."]
15249pub const FRAME_RATE_20_TO_10: CAMU_FrameRate = 11;
15250#[doc = "< 30-10 FPS."]
15251pub const FRAME_RATE_30_TO_10: CAMU_FrameRate = 12;
15252#[doc = "Camera capture frame rates."]
15253pub type CAMU_FrameRate = ::libc::c_uchar;
15254#[doc = "< Auto white balance."]
15255pub const WHITE_BALANCE_AUTO: CAMU_WhiteBalance = 0;
15256#[doc = "< 3200K white balance."]
15257pub const WHITE_BALANCE_3200K: CAMU_WhiteBalance = 1;
15258#[doc = "< 4150K white balance."]
15259pub const WHITE_BALANCE_4150K: CAMU_WhiteBalance = 2;
15260#[doc = "< 5200K white balance."]
15261pub const WHITE_BALANCE_5200K: CAMU_WhiteBalance = 3;
15262#[doc = "< 6000K white balance."]
15263pub const WHITE_BALANCE_6000K: CAMU_WhiteBalance = 4;
15264#[doc = "< 7000K white balance."]
15265pub const WHITE_BALANCE_7000K: CAMU_WhiteBalance = 5;
15266pub const WHITE_BALANCE_NORMAL: CAMU_WhiteBalance = 0;
15267pub const WHITE_BALANCE_TUNGSTEN: CAMU_WhiteBalance = 1;
15268pub const WHITE_BALANCE_WHITE_FLUORESCENT_LIGHT: CAMU_WhiteBalance = 2;
15269pub const WHITE_BALANCE_DAYLIGHT: CAMU_WhiteBalance = 3;
15270pub const WHITE_BALANCE_CLOUDY: CAMU_WhiteBalance = 4;
15271pub const WHITE_BALANCE_HORIZON: CAMU_WhiteBalance = 4;
15272pub const WHITE_BALANCE_SHADE: CAMU_WhiteBalance = 5;
15273#[doc = "Camera white balance modes."]
15274pub type CAMU_WhiteBalance = ::libc::c_uchar;
15275#[doc = "< Normal mode."]
15276pub const PHOTO_MODE_NORMAL: CAMU_PhotoMode = 0;
15277#[doc = "< Portrait mode."]
15278pub const PHOTO_MODE_PORTRAIT: CAMU_PhotoMode = 1;
15279#[doc = "< Landscape mode."]
15280pub const PHOTO_MODE_LANDSCAPE: CAMU_PhotoMode = 2;
15281#[doc = "< Night mode."]
15282pub const PHOTO_MODE_NIGHTVIEW: CAMU_PhotoMode = 3;
15283#[doc = "< Letter mode."]
15284pub const PHOTO_MODE_LETTER: CAMU_PhotoMode = 4;
15285#[doc = "Camera photo modes."]
15286pub type CAMU_PhotoMode = ::libc::c_uchar;
15287#[doc = "< No effects."]
15288pub const EFFECT_NONE: CAMU_Effect = 0;
15289#[doc = "< Mono effect."]
15290pub const EFFECT_MONO: CAMU_Effect = 1;
15291#[doc = "< Sepia effect."]
15292pub const EFFECT_SEPIA: CAMU_Effect = 2;
15293#[doc = "< Negative effect."]
15294pub const EFFECT_NEGATIVE: CAMU_Effect = 3;
15295#[doc = "< Negative film effect."]
15296pub const EFFECT_NEGAFILM: CAMU_Effect = 4;
15297#[doc = "< Sepia effect."]
15298pub const EFFECT_SEPIA01: CAMU_Effect = 5;
15299#[doc = "Camera special effects."]
15300pub type CAMU_Effect = ::libc::c_uchar;
15301#[doc = "< Pattern 1."]
15302pub const CONTRAST_PATTERN_01: CAMU_Contrast = 0;
15303#[doc = "< Pattern 2."]
15304pub const CONTRAST_PATTERN_02: CAMU_Contrast = 1;
15305#[doc = "< Pattern 3."]
15306pub const CONTRAST_PATTERN_03: CAMU_Contrast = 2;
15307#[doc = "< Pattern 4."]
15308pub const CONTRAST_PATTERN_04: CAMU_Contrast = 3;
15309#[doc = "< Pattern 5."]
15310pub const CONTRAST_PATTERN_05: CAMU_Contrast = 4;
15311#[doc = "< Pattern 6."]
15312pub const CONTRAST_PATTERN_06: CAMU_Contrast = 5;
15313#[doc = "< Pattern 7."]
15314pub const CONTRAST_PATTERN_07: CAMU_Contrast = 6;
15315#[doc = "< Pattern 8."]
15316pub const CONTRAST_PATTERN_08: CAMU_Contrast = 7;
15317#[doc = "< Pattern 9."]
15318pub const CONTRAST_PATTERN_09: CAMU_Contrast = 8;
15319#[doc = "< Pattern 10."]
15320pub const CONTRAST_PATTERN_10: CAMU_Contrast = 9;
15321#[doc = "< Pattern 11."]
15322pub const CONTRAST_PATTERN_11: CAMU_Contrast = 10;
15323#[doc = "< Low contrast. (5)"]
15324pub const CONTRAST_LOW: CAMU_Contrast = 4;
15325#[doc = "< Normal contrast. (6)"]
15326pub const CONTRAST_NORMAL: CAMU_Contrast = 5;
15327#[doc = "< High contrast. (7)"]
15328pub const CONTRAST_HIGH: CAMU_Contrast = 6;
15329#[doc = "Camera contrast patterns."]
15330pub type CAMU_Contrast = ::libc::c_uchar;
15331#[doc = "< No lens correction."]
15332pub const LENS_CORRECTION_OFF: CAMU_LensCorrection = 0;
15333#[doc = "< Edge-to-center brightness ratio of 70."]
15334pub const LENS_CORRECTION_ON_70: CAMU_LensCorrection = 1;
15335#[doc = "< Edge-to-center brightness ratio of 90."]
15336pub const LENS_CORRECTION_ON_90: CAMU_LensCorrection = 2;
15337#[doc = "< Dark lens correction. (OFF)"]
15338pub const LENS_CORRECTION_DARK: CAMU_LensCorrection = 0;
15339#[doc = "< Normal lens correction. (70)"]
15340pub const LENS_CORRECTION_NORMAL: CAMU_LensCorrection = 1;
15341#[doc = "< Bright lens correction. (90)"]
15342pub const LENS_CORRECTION_BRIGHT: CAMU_LensCorrection = 2;
15343#[doc = "Camera lens correction modes."]
15344pub type CAMU_LensCorrection = ::libc::c_uchar;
15345#[doc = "< YUV422"]
15346pub const OUTPUT_YUV_422: CAMU_OutputFormat = 0;
15347#[doc = "< RGB565"]
15348pub const OUTPUT_RGB_565: CAMU_OutputFormat = 1;
15349#[doc = "Camera image output formats."]
15350pub type CAMU_OutputFormat = ::libc::c_uchar;
15351#[doc = "< Normal shutter sound."]
15352pub const SHUTTER_SOUND_TYPE_NORMAL: CAMU_ShutterSoundType = 0;
15353#[doc = "< Shutter sound to begin a movie."]
15354pub const SHUTTER_SOUND_TYPE_MOVIE: CAMU_ShutterSoundType = 1;
15355#[doc = "< Shutter sound to end a movie."]
15356pub const SHUTTER_SOUND_TYPE_MOVIE_END: CAMU_ShutterSoundType = 2;
15357#[doc = "Camera shutter sounds."]
15358pub type CAMU_ShutterSoundType = ::libc::c_uchar;
15359#[doc = "Image quality calibration data."]
15360#[repr(C)]
15361#[derive(Debug, Default, Copy, Clone)]
15362pub struct CAMU_ImageQualityCalibrationData {
15363 #[doc = "< Auto exposure base target brightness."]
15364 pub aeBaseTarget: s16,
15365 #[doc = "< Left color correction matrix red normalization coefficient."]
15366 pub kRL: s16,
15367 #[doc = "< Left color correction matrix green normalization coefficient."]
15368 pub kGL: s16,
15369 #[doc = "< Left color correction matrix blue normalization coefficient."]
15370 pub kBL: s16,
15371 #[doc = "< Color correction matrix position."]
15372 pub ccmPosition: s16,
15373 #[doc = "< Right camera, left color correction matrix red/green gain."]
15374 pub awbCcmL9Right: u16_,
15375 #[doc = "< Left camera, left color correction matrix red/green gain."]
15376 pub awbCcmL9Left: u16_,
15377 #[doc = "< Right camera, left color correction matrix blue/green gain."]
15378 pub awbCcmL10Right: u16_,
15379 #[doc = "< Left camera, left color correction matrix blue/green gain."]
15380 pub awbCcmL10Left: u16_,
15381 #[doc = "< Right camera, color correction matrix position threshold."]
15382 pub awbX0Right: u16_,
15383 #[doc = "< Left camera, color correction matrix position threshold."]
15384 pub awbX0Left: u16_,
15385}
15386#[allow(clippy::unnecessary_operation, clippy::identity_op)]
15387const _: () = {
15388 ["Size of CAMU_ImageQualityCalibrationData"]
15389 [::core::mem::size_of::<CAMU_ImageQualityCalibrationData>() - 22usize];
15390 ["Alignment of CAMU_ImageQualityCalibrationData"]
15391 [::core::mem::align_of::<CAMU_ImageQualityCalibrationData>() - 2usize];
15392 ["Offset of field: CAMU_ImageQualityCalibrationData::aeBaseTarget"]
15393 [::core::mem::offset_of!(CAMU_ImageQualityCalibrationData, aeBaseTarget) - 0usize];
15394 ["Offset of field: CAMU_ImageQualityCalibrationData::kRL"]
15395 [::core::mem::offset_of!(CAMU_ImageQualityCalibrationData, kRL) - 2usize];
15396 ["Offset of field: CAMU_ImageQualityCalibrationData::kGL"]
15397 [::core::mem::offset_of!(CAMU_ImageQualityCalibrationData, kGL) - 4usize];
15398 ["Offset of field: CAMU_ImageQualityCalibrationData::kBL"]
15399 [::core::mem::offset_of!(CAMU_ImageQualityCalibrationData, kBL) - 6usize];
15400 ["Offset of field: CAMU_ImageQualityCalibrationData::ccmPosition"]
15401 [::core::mem::offset_of!(CAMU_ImageQualityCalibrationData, ccmPosition) - 8usize];
15402 ["Offset of field: CAMU_ImageQualityCalibrationData::awbCcmL9Right"]
15403 [::core::mem::offset_of!(CAMU_ImageQualityCalibrationData, awbCcmL9Right) - 10usize];
15404 ["Offset of field: CAMU_ImageQualityCalibrationData::awbCcmL9Left"]
15405 [::core::mem::offset_of!(CAMU_ImageQualityCalibrationData, awbCcmL9Left) - 12usize];
15406 ["Offset of field: CAMU_ImageQualityCalibrationData::awbCcmL10Right"]
15407 [::core::mem::offset_of!(CAMU_ImageQualityCalibrationData, awbCcmL10Right) - 14usize];
15408 ["Offset of field: CAMU_ImageQualityCalibrationData::awbCcmL10Left"]
15409 [::core::mem::offset_of!(CAMU_ImageQualityCalibrationData, awbCcmL10Left) - 16usize];
15410 ["Offset of field: CAMU_ImageQualityCalibrationData::awbX0Right"]
15411 [::core::mem::offset_of!(CAMU_ImageQualityCalibrationData, awbX0Right) - 18usize];
15412 ["Offset of field: CAMU_ImageQualityCalibrationData::awbX0Left"]
15413 [::core::mem::offset_of!(CAMU_ImageQualityCalibrationData, awbX0Left) - 20usize];
15414};
15415#[doc = "Stereo camera calibration data."]
15416#[repr(C)]
15417#[derive(Debug, Default, Copy, Clone)]
15418pub struct CAMU_StereoCameraCalibrationData {
15419 #[doc = "< #bool Whether the X and Y rotation data is valid."]
15420 pub isValidRotationXY: u8_,
15421 #[doc = "< Padding. (Aligns isValidRotationXY to 4 bytes)"]
15422 pub padding: [u8_; 3usize],
15423 #[doc = "< Scale to match the left camera image with the right."]
15424 pub scale: f32,
15425 #[doc = "< Z axis rotation to match the left camera image with the right."]
15426 pub rotationZ: f32,
15427 #[doc = "< X axis translation to match the left camera image with the right."]
15428 pub translationX: f32,
15429 #[doc = "< Y axis translation to match the left camera image with the right."]
15430 pub translationY: f32,
15431 #[doc = "< X axis rotation to match the left camera image with the right."]
15432 pub rotationX: f32,
15433 #[doc = "< Y axis rotation to match the left camera image with the right."]
15434 pub rotationY: f32,
15435 #[doc = "< Right camera angle of view."]
15436 pub angleOfViewRight: f32,
15437 #[doc = "< Left camera angle of view."]
15438 pub angleOfViewLeft: f32,
15439 #[doc = "< Distance between cameras and measurement chart."]
15440 pub distanceToChart: f32,
15441 #[doc = "< Distance between left and right cameras."]
15442 pub distanceCameras: f32,
15443 #[doc = "< Image width."]
15444 pub imageWidth: s16,
15445 #[doc = "< Image height."]
15446 pub imageHeight: s16,
15447 #[doc = "< Reserved for future use. (unused)"]
15448 pub reserved: [u8_; 16usize],
15449}
15450#[allow(clippy::unnecessary_operation, clippy::identity_op)]
15451const _: () = {
15452 ["Size of CAMU_StereoCameraCalibrationData"]
15453 [::core::mem::size_of::<CAMU_StereoCameraCalibrationData>() - 64usize];
15454 ["Alignment of CAMU_StereoCameraCalibrationData"]
15455 [::core::mem::align_of::<CAMU_StereoCameraCalibrationData>() - 4usize];
15456 ["Offset of field: CAMU_StereoCameraCalibrationData::isValidRotationXY"]
15457 [::core::mem::offset_of!(CAMU_StereoCameraCalibrationData, isValidRotationXY) - 0usize];
15458 ["Offset of field: CAMU_StereoCameraCalibrationData::padding"]
15459 [::core::mem::offset_of!(CAMU_StereoCameraCalibrationData, padding) - 1usize];
15460 ["Offset of field: CAMU_StereoCameraCalibrationData::scale"]
15461 [::core::mem::offset_of!(CAMU_StereoCameraCalibrationData, scale) - 4usize];
15462 ["Offset of field: CAMU_StereoCameraCalibrationData::rotationZ"]
15463 [::core::mem::offset_of!(CAMU_StereoCameraCalibrationData, rotationZ) - 8usize];
15464 ["Offset of field: CAMU_StereoCameraCalibrationData::translationX"]
15465 [::core::mem::offset_of!(CAMU_StereoCameraCalibrationData, translationX) - 12usize];
15466 ["Offset of field: CAMU_StereoCameraCalibrationData::translationY"]
15467 [::core::mem::offset_of!(CAMU_StereoCameraCalibrationData, translationY) - 16usize];
15468 ["Offset of field: CAMU_StereoCameraCalibrationData::rotationX"]
15469 [::core::mem::offset_of!(CAMU_StereoCameraCalibrationData, rotationX) - 20usize];
15470 ["Offset of field: CAMU_StereoCameraCalibrationData::rotationY"]
15471 [::core::mem::offset_of!(CAMU_StereoCameraCalibrationData, rotationY) - 24usize];
15472 ["Offset of field: CAMU_StereoCameraCalibrationData::angleOfViewRight"]
15473 [::core::mem::offset_of!(CAMU_StereoCameraCalibrationData, angleOfViewRight) - 28usize];
15474 ["Offset of field: CAMU_StereoCameraCalibrationData::angleOfViewLeft"]
15475 [::core::mem::offset_of!(CAMU_StereoCameraCalibrationData, angleOfViewLeft) - 32usize];
15476 ["Offset of field: CAMU_StereoCameraCalibrationData::distanceToChart"]
15477 [::core::mem::offset_of!(CAMU_StereoCameraCalibrationData, distanceToChart) - 36usize];
15478 ["Offset of field: CAMU_StereoCameraCalibrationData::distanceCameras"]
15479 [::core::mem::offset_of!(CAMU_StereoCameraCalibrationData, distanceCameras) - 40usize];
15480 ["Offset of field: CAMU_StereoCameraCalibrationData::imageWidth"]
15481 [::core::mem::offset_of!(CAMU_StereoCameraCalibrationData, imageWidth) - 44usize];
15482 ["Offset of field: CAMU_StereoCameraCalibrationData::imageHeight"]
15483 [::core::mem::offset_of!(CAMU_StereoCameraCalibrationData, imageHeight) - 46usize];
15484 ["Offset of field: CAMU_StereoCameraCalibrationData::reserved"]
15485 [::core::mem::offset_of!(CAMU_StereoCameraCalibrationData, reserved) - 48usize];
15486};
15487#[doc = "Batch camera configuration for use without a context."]
15488#[repr(C)]
15489#[derive(Debug, Default, Copy, Clone)]
15490pub struct CAMU_PackageParameterCameraSelect {
15491 #[doc = "< Selected camera."]
15492 pub camera: u8_,
15493 #[doc = "< Camera exposure."]
15494 pub exposure: s8,
15495 #[doc = "< #CAMU_WhiteBalance Camera white balance."]
15496 pub whiteBalance: u8_,
15497 #[doc = "< Camera sharpness."]
15498 pub sharpness: s8,
15499 #[doc = "< #bool Whether to automatically determine the proper exposure."]
15500 pub autoExposureOn: u8_,
15501 #[doc = "< #bool Whether to automatically determine the white balance mode."]
15502 pub autoWhiteBalanceOn: u8_,
15503 #[doc = "< #CAMU_FrameRate Camera frame rate."]
15504 pub frameRate: u8_,
15505 #[doc = "< #CAMU_PhotoMode Camera photo mode."]
15506 pub photoMode: u8_,
15507 #[doc = "< #CAMU_Contrast Camera contrast."]
15508 pub contrast: u8_,
15509 #[doc = "< #CAMU_LensCorrection Camera lens correction."]
15510 pub lensCorrection: u8_,
15511 #[doc = "< #bool Whether to enable the camera's noise filter."]
15512 pub noiseFilterOn: u8_,
15513 #[doc = "< Padding. (Aligns last 3 fields to 4 bytes)"]
15514 pub padding: u8_,
15515 #[doc = "< X of the region to use for auto exposure."]
15516 pub autoExposureWindowX: s16,
15517 #[doc = "< Y of the region to use for auto exposure."]
15518 pub autoExposureWindowY: s16,
15519 #[doc = "< Width of the region to use for auto exposure."]
15520 pub autoExposureWindowWidth: s16,
15521 #[doc = "< Height of the region to use for auto exposure."]
15522 pub autoExposureWindowHeight: s16,
15523 #[doc = "< X of the region to use for auto white balance."]
15524 pub autoWhiteBalanceWindowX: s16,
15525 #[doc = "< Y of the region to use for auto white balance."]
15526 pub autoWhiteBalanceWindowY: s16,
15527 #[doc = "< Width of the region to use for auto white balance."]
15528 pub autoWhiteBalanceWindowWidth: s16,
15529 #[doc = "< Height of the region to use for auto white balance."]
15530 pub autoWhiteBalanceWindowHeight: s16,
15531}
15532#[allow(clippy::unnecessary_operation, clippy::identity_op)]
15533const _: () = {
15534 ["Size of CAMU_PackageParameterCameraSelect"]
15535 [::core::mem::size_of::<CAMU_PackageParameterCameraSelect>() - 28usize];
15536 ["Alignment of CAMU_PackageParameterCameraSelect"]
15537 [::core::mem::align_of::<CAMU_PackageParameterCameraSelect>() - 2usize];
15538 ["Offset of field: CAMU_PackageParameterCameraSelect::camera"]
15539 [::core::mem::offset_of!(CAMU_PackageParameterCameraSelect, camera) - 0usize];
15540 ["Offset of field: CAMU_PackageParameterCameraSelect::exposure"]
15541 [::core::mem::offset_of!(CAMU_PackageParameterCameraSelect, exposure) - 1usize];
15542 ["Offset of field: CAMU_PackageParameterCameraSelect::whiteBalance"]
15543 [::core::mem::offset_of!(CAMU_PackageParameterCameraSelect, whiteBalance) - 2usize];
15544 ["Offset of field: CAMU_PackageParameterCameraSelect::sharpness"]
15545 [::core::mem::offset_of!(CAMU_PackageParameterCameraSelect, sharpness) - 3usize];
15546 ["Offset of field: CAMU_PackageParameterCameraSelect::autoExposureOn"]
15547 [::core::mem::offset_of!(CAMU_PackageParameterCameraSelect, autoExposureOn) - 4usize];
15548 ["Offset of field: CAMU_PackageParameterCameraSelect::autoWhiteBalanceOn"]
15549 [::core::mem::offset_of!(CAMU_PackageParameterCameraSelect, autoWhiteBalanceOn) - 5usize];
15550 ["Offset of field: CAMU_PackageParameterCameraSelect::frameRate"]
15551 [::core::mem::offset_of!(CAMU_PackageParameterCameraSelect, frameRate) - 6usize];
15552 ["Offset of field: CAMU_PackageParameterCameraSelect::photoMode"]
15553 [::core::mem::offset_of!(CAMU_PackageParameterCameraSelect, photoMode) - 7usize];
15554 ["Offset of field: CAMU_PackageParameterCameraSelect::contrast"]
15555 [::core::mem::offset_of!(CAMU_PackageParameterCameraSelect, contrast) - 8usize];
15556 ["Offset of field: CAMU_PackageParameterCameraSelect::lensCorrection"]
15557 [::core::mem::offset_of!(CAMU_PackageParameterCameraSelect, lensCorrection) - 9usize];
15558 ["Offset of field: CAMU_PackageParameterCameraSelect::noiseFilterOn"]
15559 [::core::mem::offset_of!(CAMU_PackageParameterCameraSelect, noiseFilterOn) - 10usize];
15560 ["Offset of field: CAMU_PackageParameterCameraSelect::padding"]
15561 [::core::mem::offset_of!(CAMU_PackageParameterCameraSelect, padding) - 11usize];
15562 ["Offset of field: CAMU_PackageParameterCameraSelect::autoExposureWindowX"]
15563 [::core::mem::offset_of!(CAMU_PackageParameterCameraSelect, autoExposureWindowX) - 12usize];
15564 ["Offset of field: CAMU_PackageParameterCameraSelect::autoExposureWindowY"]
15565 [::core::mem::offset_of!(CAMU_PackageParameterCameraSelect, autoExposureWindowY) - 14usize];
15566 ["Offset of field: CAMU_PackageParameterCameraSelect::autoExposureWindowWidth"][::core::mem::offset_of!(
15567 CAMU_PackageParameterCameraSelect,
15568 autoExposureWindowWidth
15569 ) - 16usize];
15570 ["Offset of field: CAMU_PackageParameterCameraSelect::autoExposureWindowHeight"][::core::mem::offset_of!(
15571 CAMU_PackageParameterCameraSelect,
15572 autoExposureWindowHeight
15573 ) - 18usize];
15574 ["Offset of field: CAMU_PackageParameterCameraSelect::autoWhiteBalanceWindowX"][::core::mem::offset_of!(
15575 CAMU_PackageParameterCameraSelect,
15576 autoWhiteBalanceWindowX
15577 ) - 20usize];
15578 ["Offset of field: CAMU_PackageParameterCameraSelect::autoWhiteBalanceWindowY"][::core::mem::offset_of!(
15579 CAMU_PackageParameterCameraSelect,
15580 autoWhiteBalanceWindowY
15581 ) - 22usize];
15582 ["Offset of field: CAMU_PackageParameterCameraSelect::autoWhiteBalanceWindowWidth"][::core::mem::offset_of!(
15583 CAMU_PackageParameterCameraSelect,
15584 autoWhiteBalanceWindowWidth
15585 )
15586 - 24usize];
15587 ["Offset of field: CAMU_PackageParameterCameraSelect::autoWhiteBalanceWindowHeight"][::core::mem::offset_of!(
15588 CAMU_PackageParameterCameraSelect,
15589 autoWhiteBalanceWindowHeight
15590 )
15591 - 26usize];
15592};
15593#[doc = "Batch camera configuration for use with a context."]
15594#[repr(C)]
15595#[derive(Debug, Default, Copy, Clone)]
15596pub struct CAMU_PackageParameterContext {
15597 #[doc = "< Selected camera."]
15598 pub camera: u8_,
15599 #[doc = "< #CAMU_Context Selected context."]
15600 pub context: u8_,
15601 #[doc = "< #CAMU_Flip Camera image flip mode."]
15602 pub flip: u8_,
15603 #[doc = "< #CAMU_Effect Camera image special effects."]
15604 pub effect: u8_,
15605 #[doc = "< #CAMU_Size Camera image resolution."]
15606 pub size: u8_,
15607}
15608#[allow(clippy::unnecessary_operation, clippy::identity_op)]
15609const _: () = {
15610 ["Size of CAMU_PackageParameterContext"]
15611 [::core::mem::size_of::<CAMU_PackageParameterContext>() - 5usize];
15612 ["Alignment of CAMU_PackageParameterContext"]
15613 [::core::mem::align_of::<CAMU_PackageParameterContext>() - 1usize];
15614 ["Offset of field: CAMU_PackageParameterContext::camera"]
15615 [::core::mem::offset_of!(CAMU_PackageParameterContext, camera) - 0usize];
15616 ["Offset of field: CAMU_PackageParameterContext::context"]
15617 [::core::mem::offset_of!(CAMU_PackageParameterContext, context) - 1usize];
15618 ["Offset of field: CAMU_PackageParameterContext::flip"]
15619 [::core::mem::offset_of!(CAMU_PackageParameterContext, flip) - 2usize];
15620 ["Offset of field: CAMU_PackageParameterContext::effect"]
15621 [::core::mem::offset_of!(CAMU_PackageParameterContext, effect) - 3usize];
15622 ["Offset of field: CAMU_PackageParameterContext::size"]
15623 [::core::mem::offset_of!(CAMU_PackageParameterContext, size) - 4usize];
15624};
15625#[doc = "Batch camera configuration for use with a context and with detailed size information."]
15626#[repr(C)]
15627#[derive(Debug, Default, Copy, Clone)]
15628pub struct CAMU_PackageParameterContextDetail {
15629 #[doc = "< Selected camera."]
15630 pub camera: u8_,
15631 #[doc = "< #CAMU_Context Selected context."]
15632 pub context: u8_,
15633 #[doc = "< #CAMU_Flip Camera image flip mode."]
15634 pub flip: u8_,
15635 #[doc = "< #CAMU_Effect Camera image special effects."]
15636 pub effect: u8_,
15637 #[doc = "< Image width."]
15638 pub width: s16,
15639 #[doc = "< Image height."]
15640 pub height: s16,
15641 #[doc = "< First crop point X."]
15642 pub cropX0: s16,
15643 #[doc = "< First crop point Y."]
15644 pub cropY0: s16,
15645 #[doc = "< Second crop point X."]
15646 pub cropX1: s16,
15647 #[doc = "< Second crop point Y."]
15648 pub cropY1: s16,
15649}
15650#[allow(clippy::unnecessary_operation, clippy::identity_op)]
15651const _: () = {
15652 ["Size of CAMU_PackageParameterContextDetail"]
15653 [::core::mem::size_of::<CAMU_PackageParameterContextDetail>() - 16usize];
15654 ["Alignment of CAMU_PackageParameterContextDetail"]
15655 [::core::mem::align_of::<CAMU_PackageParameterContextDetail>() - 2usize];
15656 ["Offset of field: CAMU_PackageParameterContextDetail::camera"]
15657 [::core::mem::offset_of!(CAMU_PackageParameterContextDetail, camera) - 0usize];
15658 ["Offset of field: CAMU_PackageParameterContextDetail::context"]
15659 [::core::mem::offset_of!(CAMU_PackageParameterContextDetail, context) - 1usize];
15660 ["Offset of field: CAMU_PackageParameterContextDetail::flip"]
15661 [::core::mem::offset_of!(CAMU_PackageParameterContextDetail, flip) - 2usize];
15662 ["Offset of field: CAMU_PackageParameterContextDetail::effect"]
15663 [::core::mem::offset_of!(CAMU_PackageParameterContextDetail, effect) - 3usize];
15664 ["Offset of field: CAMU_PackageParameterContextDetail::width"]
15665 [::core::mem::offset_of!(CAMU_PackageParameterContextDetail, width) - 4usize];
15666 ["Offset of field: CAMU_PackageParameterContextDetail::height"]
15667 [::core::mem::offset_of!(CAMU_PackageParameterContextDetail, height) - 6usize];
15668 ["Offset of field: CAMU_PackageParameterContextDetail::cropX0"]
15669 [::core::mem::offset_of!(CAMU_PackageParameterContextDetail, cropX0) - 8usize];
15670 ["Offset of field: CAMU_PackageParameterContextDetail::cropY0"]
15671 [::core::mem::offset_of!(CAMU_PackageParameterContextDetail, cropY0) - 10usize];
15672 ["Offset of field: CAMU_PackageParameterContextDetail::cropX1"]
15673 [::core::mem::offset_of!(CAMU_PackageParameterContextDetail, cropX1) - 12usize];
15674 ["Offset of field: CAMU_PackageParameterContextDetail::cropY1"]
15675 [::core::mem::offset_of!(CAMU_PackageParameterContextDetail, cropY1) - 14usize];
15676};
15677unsafe extern "C" {
15678 #[must_use]
15679 #[doc = "Initializes the cam service.\n\n This will internally get the handle of the service, and on success call CAMU_DriverInitialize."]
15680 pub fn camInit() -> Result;
15681}
15682unsafe extern "C" {
15683 #[doc = "Closes the cam service.\n\n This will internally call CAMU_DriverFinalize and close the handle of the service."]
15684 pub fn camExit();
15685}
15686unsafe extern "C" {
15687 #[must_use]
15688 #[doc = "Begins capture on the specified camera port.\n # Arguments\n\n* `port` - Port to begin capture on."]
15689 pub fn CAMU_StartCapture(port: u32_) -> Result;
15690}
15691unsafe extern "C" {
15692 #[must_use]
15693 #[doc = "Terminates capture on the specified camera port.\n # Arguments\n\n* `port` - Port to terminate capture on."]
15694 pub fn CAMU_StopCapture(port: u32_) -> Result;
15695}
15696unsafe extern "C" {
15697 #[must_use]
15698 #[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."]
15699 pub fn CAMU_IsBusy(busy: *mut bool, port: u32_) -> Result;
15700}
15701unsafe extern "C" {
15702 #[must_use]
15703 #[doc = "Clears the buffer and error flags of the specified camera port.\n # Arguments\n\n* `port` - Port to clear."]
15704 pub fn CAMU_ClearBuffer(port: u32_) -> Result;
15705}
15706unsafe extern "C" {
15707 #[must_use]
15708 #[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."]
15709 pub fn CAMU_GetVsyncInterruptEvent(event: *mut Handle, port: u32_) -> Result;
15710}
15711unsafe extern "C" {
15712 #[must_use]
15713 #[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."]
15714 pub fn CAMU_GetBufferErrorInterruptEvent(event: *mut Handle, port: u32_) -> Result;
15715}
15716unsafe extern "C" {
15717 #[must_use]
15718 #[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."]
15719 pub fn CAMU_SetReceiving(
15720 event: *mut Handle,
15721 dst: *mut ::libc::c_void,
15722 port: u32_,
15723 imageSize: u32_,
15724 transferUnit: s16,
15725 ) -> Result;
15726}
15727unsafe extern "C" {
15728 #[must_use]
15729 #[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."]
15730 pub fn CAMU_IsFinishedReceiving(finishedReceiving: *mut bool, port: u32_) -> Result;
15731}
15732unsafe extern "C" {
15733 #[must_use]
15734 #[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."]
15735 pub fn CAMU_SetTransferLines(port: u32_, lines: s16, width: s16, height: s16) -> Result;
15736}
15737unsafe extern "C" {
15738 #[must_use]
15739 #[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."]
15740 pub fn CAMU_GetMaxLines(maxLines: *mut s16, width: s16, height: s16) -> Result;
15741}
15742unsafe extern "C" {
15743 #[must_use]
15744 #[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."]
15745 pub fn CAMU_SetTransferBytes(port: u32_, bytes: u32_, width: s16, height: s16) -> Result;
15746}
15747unsafe extern "C" {
15748 #[must_use]
15749 #[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."]
15750 pub fn CAMU_GetTransferBytes(transferBytes: *mut u32_, port: u32_) -> Result;
15751}
15752unsafe extern "C" {
15753 #[must_use]
15754 #[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."]
15755 pub fn CAMU_GetMaxBytes(maxBytes: *mut u32_, width: s16, height: s16) -> Result;
15756}
15757unsafe extern "C" {
15758 #[must_use]
15759 #[doc = "Sets whether image trimming is enabled.\n # Arguments\n\n* `port` - Port to use.\n * `trimming` - Whether image trimming is enabled."]
15760 pub fn CAMU_SetTrimming(port: u32_, trimming: bool) -> Result;
15761}
15762unsafe extern "C" {
15763 #[must_use]
15764 #[doc = "Gets whether image trimming is enabled.\n # Arguments\n\n* `trimming` - Pointer to output the trim state to.\n * `port` - Port to use."]
15765 pub fn CAMU_IsTrimming(trimming: *mut bool, port: u32_) -> Result;
15766}
15767unsafe extern "C" {
15768 #[must_use]
15769 #[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."]
15770 pub fn CAMU_SetTrimmingParams(
15771 port: u32_,
15772 xStart: s16,
15773 yStart: s16,
15774 xEnd: s16,
15775 yEnd: s16,
15776 ) -> Result;
15777}
15778unsafe extern "C" {
15779 #[must_use]
15780 #[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."]
15781 pub fn CAMU_GetTrimmingParams(
15782 xStart: *mut s16,
15783 yStart: *mut s16,
15784 xEnd: *mut s16,
15785 yEnd: *mut s16,
15786 port: u32_,
15787 ) -> Result;
15788}
15789unsafe extern "C" {
15790 #[must_use]
15791 #[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."]
15792 pub fn CAMU_SetTrimmingParamsCenter(
15793 port: u32_,
15794 trimWidth: s16,
15795 trimHeight: s16,
15796 camWidth: s16,
15797 camHeight: s16,
15798 ) -> Result;
15799}
15800unsafe extern "C" {
15801 #[must_use]
15802 #[doc = "Activates the specified camera.\n # Arguments\n\n* `select` - Camera to use."]
15803 pub fn CAMU_Activate(select: u32_) -> Result;
15804}
15805unsafe extern "C" {
15806 #[must_use]
15807 #[doc = "Switches the specified camera's active context.\n # Arguments\n\n* `select` - Camera to use.\n * `context` - Context to use."]
15808 pub fn CAMU_SwitchContext(select: u32_, context: CAMU_Context) -> Result;
15809}
15810unsafe extern "C" {
15811 #[must_use]
15812 #[doc = "Sets the exposure value of the specified camera.\n # Arguments\n\n* `select` - Camera to use.\n * `exposure` - Exposure value to use."]
15813 pub fn CAMU_SetExposure(select: u32_, exposure: s8) -> Result;
15814}
15815unsafe extern "C" {
15816 #[must_use]
15817 #[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."]
15818 pub fn CAMU_SetWhiteBalance(select: u32_, whiteBalance: CAMU_WhiteBalance) -> Result;
15819}
15820unsafe extern "C" {
15821 #[must_use]
15822 #[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."]
15823 pub fn CAMU_SetWhiteBalanceWithoutBaseUp(
15824 select: u32_,
15825 whiteBalance: CAMU_WhiteBalance,
15826 ) -> Result;
15827}
15828unsafe extern "C" {
15829 #[must_use]
15830 #[doc = "Sets the sharpness of the specified camera.\n # Arguments\n\n* `select` - Camera to use.\n * `sharpness` - Sharpness to use."]
15831 pub fn CAMU_SetSharpness(select: u32_, sharpness: s8) -> Result;
15832}
15833unsafe extern "C" {
15834 #[must_use]
15835 #[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."]
15836 pub fn CAMU_SetAutoExposure(select: u32_, autoExposure: bool) -> Result;
15837}
15838unsafe extern "C" {
15839 #[must_use]
15840 #[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."]
15841 pub fn CAMU_IsAutoExposure(autoExposure: *mut bool, select: u32_) -> Result;
15842}
15843unsafe extern "C" {
15844 #[must_use]
15845 #[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."]
15846 pub fn CAMU_SetAutoWhiteBalance(select: u32_, autoWhiteBalance: bool) -> Result;
15847}
15848unsafe extern "C" {
15849 #[must_use]
15850 #[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."]
15851 pub fn CAMU_IsAutoWhiteBalance(autoWhiteBalance: *mut bool, select: u32_) -> Result;
15852}
15853unsafe extern "C" {
15854 #[must_use]
15855 #[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."]
15856 pub fn CAMU_FlipImage(select: u32_, flip: CAMU_Flip, context: CAMU_Context) -> Result;
15857}
15858unsafe extern "C" {
15859 #[must_use]
15860 #[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."]
15861 pub fn CAMU_SetDetailSize(
15862 select: u32_,
15863 width: s16,
15864 height: s16,
15865 cropX0: s16,
15866 cropY0: s16,
15867 cropX1: s16,
15868 cropY1: s16,
15869 context: CAMU_Context,
15870 ) -> Result;
15871}
15872unsafe extern "C" {
15873 #[must_use]
15874 #[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."]
15875 pub fn CAMU_SetSize(select: u32_, size: CAMU_Size, context: CAMU_Context) -> Result;
15876}
15877unsafe extern "C" {
15878 #[must_use]
15879 #[doc = "Sets the frame rate of the given camera.\n # Arguments\n\n* `select` - Camera to use.\n * `frameRate` - Frame rate to use."]
15880 pub fn CAMU_SetFrameRate(select: u32_, frameRate: CAMU_FrameRate) -> Result;
15881}
15882unsafe extern "C" {
15883 #[must_use]
15884 #[doc = "Sets the photo mode of the given camera.\n # Arguments\n\n* `select` - Camera to use.\n * `photoMode` - Photo mode to use."]
15885 pub fn CAMU_SetPhotoMode(select: u32_, photoMode: CAMU_PhotoMode) -> Result;
15886}
15887unsafe extern "C" {
15888 #[must_use]
15889 #[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."]
15890 pub fn CAMU_SetEffect(select: u32_, effect: CAMU_Effect, context: CAMU_Context) -> Result;
15891}
15892unsafe extern "C" {
15893 #[must_use]
15894 #[doc = "Sets the contrast mode of the given camera.\n # Arguments\n\n* `select` - Camera to use.\n * `contrast` - Contrast mode to use."]
15895 pub fn CAMU_SetContrast(select: u32_, contrast: CAMU_Contrast) -> Result;
15896}
15897unsafe extern "C" {
15898 #[must_use]
15899 #[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."]
15900 pub fn CAMU_SetLensCorrection(select: u32_, lensCorrection: CAMU_LensCorrection) -> Result;
15901}
15902unsafe extern "C" {
15903 #[must_use]
15904 #[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."]
15905 pub fn CAMU_SetOutputFormat(
15906 select: u32_,
15907 format: CAMU_OutputFormat,
15908 context: CAMU_Context,
15909 ) -> Result;
15910}
15911unsafe extern "C" {
15912 #[must_use]
15913 #[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."]
15914 pub fn CAMU_SetAutoExposureWindow(
15915 select: u32_,
15916 x: s16,
15917 y: s16,
15918 width: s16,
15919 height: s16,
15920 ) -> Result;
15921}
15922unsafe extern "C" {
15923 #[must_use]
15924 #[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."]
15925 pub fn CAMU_SetAutoWhiteBalanceWindow(
15926 select: u32_,
15927 x: s16,
15928 y: s16,
15929 width: s16,
15930 height: s16,
15931 ) -> Result;
15932}
15933unsafe extern "C" {
15934 #[must_use]
15935 #[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."]
15936 pub fn CAMU_SetNoiseFilter(select: u32_, noiseFilter: bool) -> Result;
15937}
15938unsafe extern "C" {
15939 #[must_use]
15940 #[doc = "Synchronizes the specified cameras' vsync timing.\n # Arguments\n\n* `select1` - First camera.\n * `select2` - Second camera."]
15941 pub fn CAMU_SynchronizeVsyncTiming(select1: u32_, select2: u32_) -> Result;
15942}
15943unsafe extern "C" {
15944 #[must_use]
15945 #[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."]
15946 pub fn CAMU_GetLatestVsyncTiming(timing: *mut s64, port: u32_, past: u32_) -> Result;
15947}
15948unsafe extern "C" {
15949 #[must_use]
15950 #[doc = "Gets the specified camera's stereo camera calibration data.\n # Arguments\n\n* `data` - Pointer to output the stereo camera data to."]
15951 pub fn CAMU_GetStereoCameraCalibrationData(
15952 data: *mut CAMU_StereoCameraCalibrationData,
15953 ) -> Result;
15954}
15955unsafe extern "C" {
15956 #[must_use]
15957 #[doc = "Sets the specified camera's stereo camera calibration data.\n # Arguments\n\n* `data` - Data to set."]
15958 pub fn CAMU_SetStereoCameraCalibrationData(data: CAMU_StereoCameraCalibrationData) -> Result;
15959}
15960unsafe extern "C" {
15961 #[must_use]
15962 #[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."]
15963 pub fn CAMU_WriteRegisterI2c(select: u32_, addr: u16_, data: u16_) -> Result;
15964}
15965unsafe extern "C" {
15966 #[must_use]
15967 #[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."]
15968 pub fn CAMU_WriteMcuVariableI2c(select: u32_, addr: u16_, data: u16_) -> Result;
15969}
15970unsafe extern "C" {
15971 #[must_use]
15972 #[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."]
15973 pub fn CAMU_ReadRegisterI2cExclusive(data: *mut u16_, select: u32_, addr: u16_) -> Result;
15974}
15975unsafe extern "C" {
15976 #[must_use]
15977 #[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."]
15978 pub fn CAMU_ReadMcuVariableI2cExclusive(data: *mut u16_, select: u32_, addr: u16_) -> Result;
15979}
15980unsafe extern "C" {
15981 #[must_use]
15982 #[doc = "Sets the specified camera's image quality calibration data.\n # Arguments\n\n* `data` - Data to set."]
15983 pub fn CAMU_SetImageQualityCalibrationData(data: CAMU_ImageQualityCalibrationData) -> Result;
15984}
15985unsafe extern "C" {
15986 #[must_use]
15987 #[doc = "Gets the specified camera's image quality calibration data.\n # Arguments\n\n* `data` - Pointer to write the quality data to."]
15988 pub fn CAMU_GetImageQualityCalibrationData(
15989 data: *mut CAMU_ImageQualityCalibrationData,
15990 ) -> Result;
15991}
15992unsafe extern "C" {
15993 #[must_use]
15994 #[doc = "Configures a camera with pre-packaged configuration data without a context.\n # Arguments\n\n* `Parameter` - to use."]
15995 pub fn CAMU_SetPackageParameterWithoutContext(
15996 param: CAMU_PackageParameterCameraSelect,
15997 ) -> Result;
15998}
15999unsafe extern "C" {
16000 #[must_use]
16001 #[doc = "Configures a camera with pre-packaged configuration data with a context.\n # Arguments\n\n* `Parameter` - to use."]
16002 pub fn CAMU_SetPackageParameterWithContext(param: CAMU_PackageParameterContext) -> Result;
16003}
16004unsafe extern "C" {
16005 #[must_use]
16006 #[doc = "Configures a camera with pre-packaged configuration data without a context and extra resolution details.\n # Arguments\n\n* `Parameter` - to use."]
16007 pub fn CAMU_SetPackageParameterWithContextDetail(
16008 param: CAMU_PackageParameterContextDetail,
16009 ) -> Result;
16010}
16011unsafe extern "C" {
16012 #[must_use]
16013 #[doc = "Gets the Y2R coefficient applied to image data by the camera.\n # Arguments\n\n* `coefficient` - Pointer to output the Y2R coefficient to."]
16014 pub fn CAMU_GetSuitableY2rStandardCoefficient(
16015 coefficient: *mut Y2RU_StandardCoefficient,
16016 ) -> Result;
16017}
16018unsafe extern "C" {
16019 #[must_use]
16020 #[doc = "Plays the specified shutter sound.\n # Arguments\n\n* `sound` - Shutter sound to play."]
16021 pub fn CAMU_PlayShutterSound(sound: CAMU_ShutterSoundType) -> Result;
16022}
16023unsafe extern "C" {
16024 #[must_use]
16025 #[doc = "Initializes the camera driver."]
16026 pub fn CAMU_DriverInitialize() -> Result;
16027}
16028unsafe extern "C" {
16029 #[must_use]
16030 #[doc = "Finalizes the camera driver."]
16031 pub fn CAMU_DriverFinalize() -> Result;
16032}
16033unsafe extern "C" {
16034 #[must_use]
16035 #[doc = "Gets the current activated camera.\n # Arguments\n\n* `select` - Pointer to output the current activated camera to."]
16036 pub fn CAMU_GetActivatedCamera(select: *mut u32_) -> Result;
16037}
16038unsafe extern "C" {
16039 #[must_use]
16040 #[doc = "Gets the current sleep camera.\n # Arguments\n\n* `select` - Pointer to output the current sleep camera to."]
16041 pub fn CAMU_GetSleepCamera(select: *mut u32_) -> Result;
16042}
16043unsafe extern "C" {
16044 #[must_use]
16045 #[doc = "Sets the current sleep camera.\n # Arguments\n\n* `select` - Camera to set."]
16046 pub fn CAMU_SetSleepCamera(select: u32_) -> Result;
16047}
16048unsafe extern "C" {
16049 #[must_use]
16050 #[doc = "Sets whether to enable synchronization of left and right camera brightnesses.\n # Arguments\n\n* `brightnessSynchronization` - Whether to enable brightness synchronization."]
16051 pub fn CAMU_SetBrightnessSynchronization(brightnessSynchronization: bool) -> Result;
16052}
16053unsafe extern "C" {
16054 #[must_use]
16055 #[doc = "Initializes CFGNOR.\n # Arguments\n\n* `value` - Unknown, usually 1."]
16056 pub fn cfgnorInit(value: u8_) -> Result;
16057}
16058unsafe extern "C" {
16059 #[doc = "Exits CFGNOR"]
16060 pub fn cfgnorExit();
16061}
16062unsafe extern "C" {
16063 #[must_use]
16064 #[doc = "Dumps the NOR flash.\n # Arguments\n\n* `buf` - Buffer to dump to.\n * `size` - Size of the buffer."]
16065 pub fn cfgnorDumpFlash(buf: *mut u32_, size: u32_) -> Result;
16066}
16067unsafe extern "C" {
16068 #[must_use]
16069 #[doc = "Writes the NOR flash.\n # Arguments\n\n* `buf` - Buffer to write from.\n * `size` - Size of the buffer."]
16070 pub fn cfgnorWriteFlash(buf: *mut u32_, size: u32_) -> Result;
16071}
16072unsafe extern "C" {
16073 #[must_use]
16074 #[doc = "Initializes the CFGNOR session.\n # Arguments\n\n* `value` - Unknown, usually 1."]
16075 pub fn CFGNOR_Initialize(value: u8_) -> Result;
16076}
16077unsafe extern "C" {
16078 #[must_use]
16079 #[doc = "Shuts down the CFGNOR session."]
16080 pub fn CFGNOR_Shutdown() -> Result;
16081}
16082unsafe extern "C" {
16083 #[must_use]
16084 #[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."]
16085 pub fn CFGNOR_ReadData(offset: u32_, buf: *mut u32_, size: u32_) -> Result;
16086}
16087unsafe extern "C" {
16088 #[must_use]
16089 #[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."]
16090 pub fn CFGNOR_WriteData(offset: u32_, buf: *mut u32_, size: u32_) -> Result;
16091}
16092#[doc = "< Japan"]
16093pub const CFG_REGION_JPN: CFG_Region = 0;
16094#[doc = "< USA"]
16095pub const CFG_REGION_USA: CFG_Region = 1;
16096#[doc = "< Europe"]
16097pub const CFG_REGION_EUR: CFG_Region = 2;
16098#[doc = "< Australia"]
16099pub const CFG_REGION_AUS: CFG_Region = 3;
16100#[doc = "< China"]
16101pub const CFG_REGION_CHN: CFG_Region = 4;
16102#[doc = "< Korea"]
16103pub const CFG_REGION_KOR: CFG_Region = 5;
16104#[doc = "< Taiwan"]
16105pub const CFG_REGION_TWN: CFG_Region = 6;
16106#[doc = "Configuration region values."]
16107pub type CFG_Region = ::libc::c_uchar;
16108#[doc = "< Use system language in errorInit"]
16109pub const CFG_LANGUAGE_DEFAULT: CFG_Language = -1;
16110#[doc = "< Japanese"]
16111pub const CFG_LANGUAGE_JP: CFG_Language = 0;
16112#[doc = "< English"]
16113pub const CFG_LANGUAGE_EN: CFG_Language = 1;
16114#[doc = "< French"]
16115pub const CFG_LANGUAGE_FR: CFG_Language = 2;
16116#[doc = "< German"]
16117pub const CFG_LANGUAGE_DE: CFG_Language = 3;
16118#[doc = "< Italian"]
16119pub const CFG_LANGUAGE_IT: CFG_Language = 4;
16120#[doc = "< Spanish"]
16121pub const CFG_LANGUAGE_ES: CFG_Language = 5;
16122#[doc = "< Simplified Chinese"]
16123pub const CFG_LANGUAGE_ZH: CFG_Language = 6;
16124#[doc = "< Korean"]
16125pub const CFG_LANGUAGE_KO: CFG_Language = 7;
16126#[doc = "< Dutch"]
16127pub const CFG_LANGUAGE_NL: CFG_Language = 8;
16128#[doc = "< Portugese"]
16129pub const CFG_LANGUAGE_PT: CFG_Language = 9;
16130#[doc = "< Russian"]
16131pub const CFG_LANGUAGE_RU: CFG_Language = 10;
16132#[doc = "< Traditional Chinese"]
16133pub const CFG_LANGUAGE_TW: CFG_Language = 11;
16134#[doc = "Configuration language values."]
16135pub type CFG_Language = ::libc::c_schar;
16136#[doc = "< Old 3DS (CTR)"]
16137pub const CFG_MODEL_3DS: CFG_SystemModel = 0;
16138#[doc = "< Old 3DS XL (SPR)"]
16139pub const CFG_MODEL_3DSXL: CFG_SystemModel = 1;
16140#[doc = "< New 3DS (KTR)"]
16141pub const CFG_MODEL_N3DS: CFG_SystemModel = 2;
16142#[doc = "< Old 2DS (FTR)"]
16143pub const CFG_MODEL_2DS: CFG_SystemModel = 3;
16144#[doc = "< New 3DS XL (RED)"]
16145pub const CFG_MODEL_N3DSXL: CFG_SystemModel = 4;
16146#[doc = "< New 2DS XL (JAN)"]
16147pub const CFG_MODEL_N2DSXL: CFG_SystemModel = 5;
16148pub type CFG_SystemModel = ::libc::c_uchar;
16149unsafe extern "C" {
16150 #[must_use]
16151 #[doc = "Initializes CFGU."]
16152 pub fn cfguInit() -> Result;
16153}
16154unsafe extern "C" {
16155 #[doc = "Exits CFGU."]
16156 pub fn cfguExit();
16157}
16158unsafe extern "C" {
16159 #[must_use]
16160 #[doc = "Gets the system's region from secure info.\n # Arguments\n\n* `region` - Pointer to output the region to. (see CFG_Region)"]
16161 pub fn CFGU_SecureInfoGetRegion(region: *mut u8_) -> Result;
16162}
16163unsafe extern "C" {
16164 #[must_use]
16165 #[doc = "Generates a console-unique hash.\n # Arguments\n\n* `appIDSalt` - Salt to use.\n * `hash` - Pointer to output the hash to."]
16166 pub fn CFGU_GenHashConsoleUnique(appIDSalt: u32_, hash: *mut u64_) -> Result;
16167}
16168unsafe extern "C" {
16169 #[must_use]
16170 #[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)"]
16171 pub fn CFGU_GetRegionCanadaUSA(value: *mut u8_) -> Result;
16172}
16173unsafe extern "C" {
16174 #[must_use]
16175 #[doc = "Gets the system's model.\n # Arguments\n\n* `model` - Pointer to output the model to. (see CFG_SystemModel)"]
16176 pub fn CFGU_GetSystemModel(model: *mut u8_) -> Result;
16177}
16178unsafe extern "C" {
16179 #[must_use]
16180 #[doc = "Gets whether the system is a 2DS.\n # Arguments\n\n* `value` - Pointer to output the result to. (0 = yes, 1 = no)"]
16181 pub fn CFGU_GetModelNintendo2DS(value: *mut u8_) -> Result;
16182}
16183unsafe extern "C" {
16184 #[must_use]
16185 #[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."]
16186 pub fn CFGU_GetCountryCodeString(code: u16_, string: *mut u16_) -> Result;
16187}
16188unsafe extern "C" {
16189 #[must_use]
16190 #[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."]
16191 pub fn CFGU_GetCountryCodeID(string: u16_, code: *mut u16_) -> Result;
16192}
16193unsafe extern "C" {
16194 #[must_use]
16195 #[doc = "Checks if NFC (code name: fangate) is supported.\n # Arguments\n\n* `isSupported` - pointer to the output the result to."]
16196 pub fn CFGU_IsNFCSupported(isSupported: *mut bool) -> Result;
16197}
16198unsafe extern "C" {
16199 #[must_use]
16200 #[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."]
16201 pub fn CFGU_GetConfigInfoBlk2(size: u32_, blkID: u32_, outData: *mut ::libc::c_void) -> Result;
16202}
16203unsafe extern "C" {
16204 #[must_use]
16205 #[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."]
16206 pub fn CFG_GetConfigInfoBlk4(size: u32_, blkID: u32_, outData: *mut ::libc::c_void) -> Result;
16207}
16208unsafe extern "C" {
16209 #[must_use]
16210 #[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."]
16211 pub fn CFG_GetConfigInfoBlk8(size: u32_, blkID: u32_, outData: *mut ::libc::c_void) -> Result;
16212}
16213unsafe extern "C" {
16214 #[must_use]
16215 #[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."]
16216 pub fn CFG_SetConfigInfoBlk4(size: u32_, blkID: u32_, inData: *const ::libc::c_void) -> Result;
16217}
16218unsafe extern "C" {
16219 #[must_use]
16220 #[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."]
16221 pub fn CFG_SetConfigInfoBlk8(size: u32_, blkID: u32_, inData: *const ::libc::c_void) -> Result;
16222}
16223unsafe extern "C" {
16224 #[must_use]
16225 #[doc = "Writes the CFG buffer in memory to the savegame in NAND."]
16226 pub fn CFG_UpdateConfigSavegame() -> Result;
16227}
16228unsafe extern "C" {
16229 #[must_use]
16230 #[doc = "Gets the system's language.\n # Arguments\n\n* `language` - Pointer to write the language to. (see CFG_Language)"]
16231 pub fn CFGU_GetSystemLanguage(language: *mut u8_) -> Result;
16232}
16233unsafe extern "C" {
16234 #[must_use]
16235 #[doc = "Deletes the NAND LocalFriendCodeSeed file, then recreates it using the LocalFriendCodeSeed data stored in memory."]
16236 pub fn CFGI_RestoreLocalFriendCodeSeed() -> Result;
16237}
16238unsafe extern "C" {
16239 #[must_use]
16240 #[doc = "Deletes the NAND SecureInfo file, then recreates it using the SecureInfo data stored in memory."]
16241 pub fn CFGI_RestoreSecureInfo() -> Result;
16242}
16243unsafe extern "C" {
16244 #[must_use]
16245 #[doc = "Deletes the \"config\" file stored in the NAND Config_Savegame."]
16246 pub fn CFGI_DeleteConfigSavefile() -> Result;
16247}
16248unsafe extern "C" {
16249 #[must_use]
16250 #[doc = "Formats Config_Savegame."]
16251 pub fn CFGI_FormatConfig() -> Result;
16252}
16253unsafe extern "C" {
16254 #[must_use]
16255 #[doc = "Clears parental controls"]
16256 pub fn CFGI_ClearParentalControls() -> Result;
16257}
16258unsafe extern "C" {
16259 #[must_use]
16260 #[doc = "Verifies the RSA signature for the LocalFriendCodeSeed data already stored in memory."]
16261 pub fn CFGI_VerifySigLocalFriendCodeSeed() -> Result;
16262}
16263unsafe extern "C" {
16264 #[must_use]
16265 #[doc = "Verifies the RSA signature for the SecureInfo data already stored in memory."]
16266 pub fn CFGI_VerifySigSecureInfo() -> Result;
16267}
16268unsafe extern "C" {
16269 #[must_use]
16270 #[doc = "Gets the system's serial number.\n # Arguments\n\n* `serial` - Pointer to output the serial to. (This is normally 0xF)"]
16271 pub fn CFGI_SecureInfoGetSerialNumber(serial: *mut u8_) -> Result;
16272}
16273unsafe extern "C" {
16274 #[must_use]
16275 #[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)"]
16276 pub fn CFGI_GetLocalFriendCodeSeedData(data: *mut u8_) -> Result;
16277}
16278unsafe extern "C" {
16279 #[must_use]
16280 #[doc = "Gets the 64-bit local friend code seed.\n # Arguments\n\n* `seed` - Pointer to write the friend code seed to."]
16281 pub fn CFGI_GetLocalFriendCodeSeed(seed: *mut u64_) -> Result;
16282}
16283unsafe extern "C" {
16284 #[must_use]
16285 #[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)"]
16286 pub fn CFGI_GetSecureInfoData(data: *mut u8_) -> Result;
16287}
16288unsafe extern "C" {
16289 #[must_use]
16290 #[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)"]
16291 pub fn CFGI_GetSecureInfoSignature(data: *mut u8_) -> Result;
16292}
16293unsafe extern "C" {
16294 #[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."]
16295 #[link_name = "CSND_VOL__extern"]
16296 pub fn CSND_VOL(vol: f32, pan: f32) -> u32_;
16297}
16298#[doc = "< PCM8"]
16299pub const CSND_ENCODING_PCM8: _bindgen_ty_18 = 0;
16300#[doc = "< PCM16"]
16301pub const CSND_ENCODING_PCM16: _bindgen_ty_18 = 1;
16302#[doc = "< IMA-ADPCM"]
16303pub const CSND_ENCODING_ADPCM: _bindgen_ty_18 = 2;
16304#[doc = "< PSG (Similar to DS?)"]
16305pub const CSND_ENCODING_PSG: _bindgen_ty_18 = 3;
16306#[doc = "CSND encodings."]
16307pub type _bindgen_ty_18 = ::libc::c_uchar;
16308#[doc = "< Manual loop."]
16309pub const CSND_LOOPMODE_MANUAL: _bindgen_ty_19 = 0;
16310#[doc = "< Normal loop."]
16311pub const CSND_LOOPMODE_NORMAL: _bindgen_ty_19 = 1;
16312#[doc = "< Do not loop."]
16313pub const CSND_LOOPMODE_ONESHOT: _bindgen_ty_19 = 2;
16314#[doc = "< Don't reload."]
16315pub const CSND_LOOPMODE_NORELOAD: _bindgen_ty_19 = 3;
16316#[doc = "CSND loop modes."]
16317pub type _bindgen_ty_19 = ::libc::c_uchar;
16318#[doc = "< Linear interpolation."]
16319pub const SOUND_LINEAR_INTERP: _bindgen_ty_20 = 64;
16320#[doc = "< Repeat the sound."]
16321pub const SOUND_REPEAT: _bindgen_ty_20 = 1024;
16322#[doc = "< Play the sound once."]
16323pub const SOUND_ONE_SHOT: _bindgen_ty_20 = 2048;
16324#[doc = "< PCM8"]
16325pub const SOUND_FORMAT_8BIT: _bindgen_ty_20 = 0;
16326#[doc = "< PCM16"]
16327pub const SOUND_FORMAT_16BIT: _bindgen_ty_20 = 4096;
16328#[doc = "< ADPCM"]
16329pub const SOUND_FORMAT_ADPCM: _bindgen_ty_20 = 8192;
16330#[doc = "< PSG"]
16331pub const SOUND_FORMAT_PSG: _bindgen_ty_20 = 12288;
16332#[doc = "< Enable sound."]
16333pub const SOUND_ENABLE: _bindgen_ty_20 = 16384;
16334#[doc = "Sound flags."]
16335pub type _bindgen_ty_20 = ::libc::c_ushort;
16336#[doc = "< Repeat capture."]
16337pub const CAPTURE_REPEAT: _bindgen_ty_21 = 0;
16338#[doc = "< Capture once."]
16339pub const CAPTURE_ONE_SHOT: _bindgen_ty_21 = 1;
16340#[doc = "< PCM16"]
16341pub const CAPTURE_FORMAT_16BIT: _bindgen_ty_21 = 0;
16342#[doc = "< PCM8"]
16343pub const CAPTURE_FORMAT_8BIT: _bindgen_ty_21 = 2;
16344#[doc = "< Enable capture."]
16345pub const CAPTURE_ENABLE: _bindgen_ty_21 = 32768;
16346#[doc = "Capture modes."]
16347pub type _bindgen_ty_21 = ::libc::c_ushort;
16348#[doc = "< 0.0% duty cycle"]
16349pub const DutyCycle_0: CSND_DutyCycle = 7;
16350#[doc = "< 12.5% duty cycle"]
16351pub const DutyCycle_12: CSND_DutyCycle = 0;
16352#[doc = "< 25.0% duty cycle"]
16353pub const DutyCycle_25: CSND_DutyCycle = 1;
16354#[doc = "< 37.5% duty cycle"]
16355pub const DutyCycle_37: CSND_DutyCycle = 2;
16356#[doc = "< 50.0% duty cycle"]
16357pub const DutyCycle_50: CSND_DutyCycle = 3;
16358#[doc = "< 62.5% duty cycle"]
16359pub const DutyCycle_62: CSND_DutyCycle = 4;
16360#[doc = "< 75.0% duty cycle"]
16361pub const DutyCycle_75: CSND_DutyCycle = 5;
16362#[doc = "< 87.5% duty cycle"]
16363pub const DutyCycle_87: CSND_DutyCycle = 6;
16364#[doc = "Duty cycles for a PSG channel."]
16365pub type CSND_DutyCycle = ::libc::c_uchar;
16366#[doc = "Channel info."]
16367#[repr(C)]
16368#[derive(Copy, Clone)]
16369pub union CSND_ChnInfo {
16370 #[doc = "< Raw values."]
16371 pub value: [u32_; 3usize],
16372 pub __bindgen_anon_1: CSND_ChnInfo__bindgen_ty_1,
16373}
16374#[repr(C)]
16375#[derive(Debug, Default, Copy, Clone)]
16376pub struct CSND_ChnInfo__bindgen_ty_1 {
16377 #[doc = "< Channel active."]
16378 pub active: u8_,
16379 #[doc = "< Padding."]
16380 pub _pad1: u8_,
16381 #[doc = "< Padding."]
16382 pub _pad2: u16_,
16383 #[doc = "< Current ADPCM sample."]
16384 pub adpcmSample: s16,
16385 #[doc = "< Current ADPCM index."]
16386 pub adpcmIndex: u8_,
16387 #[doc = "< Padding."]
16388 pub _pad3: u8_,
16389 #[doc = "< Unknown."]
16390 pub unknownZero: u32_,
16391}
16392#[allow(clippy::unnecessary_operation, clippy::identity_op)]
16393const _: () = {
16394 ["Size of CSND_ChnInfo__bindgen_ty_1"]
16395 [::core::mem::size_of::<CSND_ChnInfo__bindgen_ty_1>() - 12usize];
16396 ["Alignment of CSND_ChnInfo__bindgen_ty_1"]
16397 [::core::mem::align_of::<CSND_ChnInfo__bindgen_ty_1>() - 4usize];
16398 ["Offset of field: CSND_ChnInfo__bindgen_ty_1::active"]
16399 [::core::mem::offset_of!(CSND_ChnInfo__bindgen_ty_1, active) - 0usize];
16400 ["Offset of field: CSND_ChnInfo__bindgen_ty_1::_pad1"]
16401 [::core::mem::offset_of!(CSND_ChnInfo__bindgen_ty_1, _pad1) - 1usize];
16402 ["Offset of field: CSND_ChnInfo__bindgen_ty_1::_pad2"]
16403 [::core::mem::offset_of!(CSND_ChnInfo__bindgen_ty_1, _pad2) - 2usize];
16404 ["Offset of field: CSND_ChnInfo__bindgen_ty_1::adpcmSample"]
16405 [::core::mem::offset_of!(CSND_ChnInfo__bindgen_ty_1, adpcmSample) - 4usize];
16406 ["Offset of field: CSND_ChnInfo__bindgen_ty_1::adpcmIndex"]
16407 [::core::mem::offset_of!(CSND_ChnInfo__bindgen_ty_1, adpcmIndex) - 6usize];
16408 ["Offset of field: CSND_ChnInfo__bindgen_ty_1::_pad3"]
16409 [::core::mem::offset_of!(CSND_ChnInfo__bindgen_ty_1, _pad3) - 7usize];
16410 ["Offset of field: CSND_ChnInfo__bindgen_ty_1::unknownZero"]
16411 [::core::mem::offset_of!(CSND_ChnInfo__bindgen_ty_1, unknownZero) - 8usize];
16412};
16413#[allow(clippy::unnecessary_operation, clippy::identity_op)]
16414const _: () = {
16415 ["Size of CSND_ChnInfo"][::core::mem::size_of::<CSND_ChnInfo>() - 12usize];
16416 ["Alignment of CSND_ChnInfo"][::core::mem::align_of::<CSND_ChnInfo>() - 4usize];
16417 ["Offset of field: CSND_ChnInfo::value"][::core::mem::offset_of!(CSND_ChnInfo, value) - 0usize];
16418};
16419impl Default for CSND_ChnInfo {
16420 fn default() -> Self {
16421 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
16422 unsafe {
16423 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
16424 s.assume_init()
16425 }
16426 }
16427}
16428#[doc = "Capture info."]
16429#[repr(C)]
16430#[derive(Copy, Clone)]
16431pub union CSND_CapInfo {
16432 #[doc = "< Raw values."]
16433 pub value: [u32_; 2usize],
16434 pub __bindgen_anon_1: CSND_CapInfo__bindgen_ty_1,
16435}
16436#[repr(C)]
16437#[derive(Debug, Default, Copy, Clone)]
16438pub struct CSND_CapInfo__bindgen_ty_1 {
16439 #[doc = "< Capture active."]
16440 pub active: u8_,
16441 #[doc = "< Padding."]
16442 pub _pad1: u8_,
16443 #[doc = "< Padding."]
16444 pub _pad2: u16_,
16445 #[doc = "< Unknown."]
16446 pub unknownZero: u32_,
16447}
16448#[allow(clippy::unnecessary_operation, clippy::identity_op)]
16449const _: () = {
16450 ["Size of CSND_CapInfo__bindgen_ty_1"]
16451 [::core::mem::size_of::<CSND_CapInfo__bindgen_ty_1>() - 8usize];
16452 ["Alignment of CSND_CapInfo__bindgen_ty_1"]
16453 [::core::mem::align_of::<CSND_CapInfo__bindgen_ty_1>() - 4usize];
16454 ["Offset of field: CSND_CapInfo__bindgen_ty_1::active"]
16455 [::core::mem::offset_of!(CSND_CapInfo__bindgen_ty_1, active) - 0usize];
16456 ["Offset of field: CSND_CapInfo__bindgen_ty_1::_pad1"]
16457 [::core::mem::offset_of!(CSND_CapInfo__bindgen_ty_1, _pad1) - 1usize];
16458 ["Offset of field: CSND_CapInfo__bindgen_ty_1::_pad2"]
16459 [::core::mem::offset_of!(CSND_CapInfo__bindgen_ty_1, _pad2) - 2usize];
16460 ["Offset of field: CSND_CapInfo__bindgen_ty_1::unknownZero"]
16461 [::core::mem::offset_of!(CSND_CapInfo__bindgen_ty_1, unknownZero) - 4usize];
16462};
16463#[allow(clippy::unnecessary_operation, clippy::identity_op)]
16464const _: () = {
16465 ["Size of CSND_CapInfo"][::core::mem::size_of::<CSND_CapInfo>() - 8usize];
16466 ["Alignment of CSND_CapInfo"][::core::mem::align_of::<CSND_CapInfo>() - 4usize];
16467 ["Offset of field: CSND_CapInfo::value"][::core::mem::offset_of!(CSND_CapInfo, value) - 0usize];
16468};
16469impl Default for CSND_CapInfo {
16470 fn default() -> Self {
16471 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
16472 unsafe {
16473 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
16474 s.assume_init()
16475 }
16476 }
16477}
16478unsafe extern "C" {
16479 #[doc = "< CSND shared memory."]
16480 pub static mut csndSharedMem: *mut vu32;
16481}
16482unsafe extern "C" {
16483 #[doc = "< CSND shared memory size."]
16484 pub static mut csndSharedMemSize: u32_;
16485}
16486unsafe extern "C" {
16487 #[doc = "< Bitmask of channels that are allowed for usage."]
16488 pub static mut csndChannels: u32_;
16489}
16490unsafe extern "C" {
16491 #[must_use]
16492 #[doc = "Acquires a capture unit.\n # Arguments\n\n* `capUnit` - Pointer to output the capture unit to."]
16493 pub fn CSND_AcquireCapUnit(capUnit: *mut u32_) -> Result;
16494}
16495unsafe extern "C" {
16496 #[must_use]
16497 #[doc = "Releases a capture unit.\n # Arguments\n\n* `capUnit` - Capture unit to release."]
16498 pub fn CSND_ReleaseCapUnit(capUnit: u32_) -> Result;
16499}
16500unsafe extern "C" {
16501 #[must_use]
16502 #[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."]
16503 pub fn CSND_FlushDataCache(adr: *const ::libc::c_void, size: u32_) -> Result;
16504}
16505unsafe extern "C" {
16506 #[must_use]
16507 #[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."]
16508 pub fn CSND_StoreDataCache(adr: *const ::libc::c_void, size: u32_) -> Result;
16509}
16510unsafe extern "C" {
16511 #[must_use]
16512 #[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."]
16513 pub fn CSND_InvalidateDataCache(adr: *const ::libc::c_void, size: u32_) -> Result;
16514}
16515unsafe extern "C" {
16516 #[must_use]
16517 #[doc = "Resets CSND.\n Note: Currently breaks sound, don't use for now!"]
16518 pub fn CSND_Reset() -> Result;
16519}
16520unsafe extern "C" {
16521 #[must_use]
16522 #[doc = "Initializes CSND."]
16523 pub fn csndInit() -> Result;
16524}
16525unsafe extern "C" {
16526 #[doc = "Exits CSND."]
16527 pub fn csndExit();
16528}
16529unsafe extern "C" {
16530 #[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."]
16531 pub fn csndAddCmd(cmdid: ::libc::c_int) -> *mut u32_;
16532}
16533unsafe extern "C" {
16534 #[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."]
16535 pub fn csndWriteCmd(cmdid: ::libc::c_int, cmdparams: *mut u8_);
16536}
16537unsafe extern "C" {
16538 #[must_use]
16539 #[doc = "Executes pending CSND commands.\n # Arguments\n\n* `waitDone` - Whether to wait until the commands have finished executing."]
16540 pub fn csndExecCmds(waitDone: bool) -> Result;
16541}
16542unsafe extern "C" {
16543 #[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."]
16544 pub fn CSND_SetPlayStateR(channel: u32_, value: u32_);
16545}
16546unsafe extern "C" {
16547 #[doc = "Sets a channel's play state.\n # Arguments\n\n* `channel` - Channel to use.\n * `value` - Play state to set."]
16548 pub fn CSND_SetPlayState(channel: u32_, value: u32_);
16549}
16550unsafe extern "C" {
16551 #[doc = "Sets a channel's encoding.\n # Arguments\n\n* `channel` - Channel to use.\n * `value` - Encoding to set."]
16552 pub fn CSND_SetEncoding(channel: u32_, value: u32_);
16553}
16554unsafe extern "C" {
16555 #[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."]
16556 pub fn CSND_SetBlock(channel: u32_, block: ::libc::c_int, physaddr: u32_, size: u32_);
16557}
16558unsafe extern "C" {
16559 #[doc = "Sets whether to loop a channel.\n # Arguments\n\n* `channel` - Channel to use.\n * `value` - Whether to loop the channel."]
16560 pub fn CSND_SetLooping(channel: u32_, value: u32_);
16561}
16562unsafe extern "C" {
16563 #[doc = "Sets bit 7 of a channel.\n # Arguments\n\n* `channel` - Channel to use.\n * `set` - Value to set."]
16564 pub fn CSND_SetBit7(channel: u32_, set: bool);
16565}
16566unsafe extern "C" {
16567 #[doc = "Sets whether a channel should use interpolation.\n # Arguments\n\n* `channel` - Channel to use.\n * `interp` - Whether to use interpolation."]
16568 pub fn CSND_SetInterp(channel: u32_, interp: bool);
16569}
16570unsafe extern "C" {
16571 #[doc = "Sets a channel's duty.\n # Arguments\n\n* `channel` - Channel to use.\n * `duty` - Duty to set."]
16572 pub fn CSND_SetDuty(channel: u32_, duty: CSND_DutyCycle);
16573}
16574unsafe extern "C" {
16575 #[doc = "Sets a channel's timer.\n # Arguments\n\n* `channel` - Channel to use.\n * `timer` - Timer to set."]
16576 pub fn CSND_SetTimer(channel: u32_, timer: u32_);
16577}
16578unsafe extern "C" {
16579 #[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."]
16580 pub fn CSND_SetVol(channel: u32_, chnVolumes: u32_, capVolumes: u32_);
16581}
16582unsafe extern "C" {
16583 #[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."]
16584 pub fn CSND_SetAdpcmState(
16585 channel: u32_,
16586 block: ::libc::c_int,
16587 sample: ::libc::c_int,
16588 index: ::libc::c_int,
16589 );
16590}
16591unsafe extern "C" {
16592 #[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."]
16593 pub fn CSND_SetAdpcmReload(channel: u32_, reload: bool);
16594}
16595unsafe extern "C" {
16596 #[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."]
16597 pub fn CSND_SetChnRegs(
16598 flags: u32_,
16599 physaddr0: u32_,
16600 physaddr1: u32_,
16601 totalbytesize: u32_,
16602 chnVolumes: u32_,
16603 capVolumes: u32_,
16604 );
16605}
16606unsafe extern "C" {
16607 #[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."]
16608 pub fn CSND_SetChnRegsPSG(
16609 flags: u32_,
16610 chnVolumes: u32_,
16611 capVolumes: u32_,
16612 duty: CSND_DutyCycle,
16613 );
16614}
16615unsafe extern "C" {
16616 #[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."]
16617 pub fn CSND_SetChnRegsNoise(flags: u32_, chnVolumes: u32_, capVolumes: u32_);
16618}
16619unsafe extern "C" {
16620 #[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."]
16621 pub fn CSND_CapEnable(capUnit: u32_, enable: bool);
16622}
16623unsafe extern "C" {
16624 #[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."]
16625 pub fn CSND_CapSetRepeat(capUnit: u32_, repeat: bool);
16626}
16627unsafe extern "C" {
16628 #[doc = "Sets a capture unit's format.\n # Arguments\n\n* `capUnit` - Capture unit to use.\n * `eightbit` - Format to use."]
16629 pub fn CSND_CapSetFormat(capUnit: u32_, eightbit: bool);
16630}
16631unsafe extern "C" {
16632 #[doc = "Sets a capture unit's second bit.\n # Arguments\n\n* `capUnit` - Capture unit to use.\n * `set` - Value to set."]
16633 pub fn CSND_CapSetBit2(capUnit: u32_, set: bool);
16634}
16635unsafe extern "C" {
16636 #[doc = "Sets a capture unit's timer.\n # Arguments\n\n* `capUnit` - Capture unit to use.\n * `timer` - Timer to set."]
16637 pub fn CSND_CapSetTimer(capUnit: u32_, timer: u32_);
16638}
16639unsafe extern "C" {
16640 #[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."]
16641 pub fn CSND_CapSetBuffer(capUnit: u32_, addr: u32_, size: u32_);
16642}
16643unsafe extern "C" {
16644 #[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."]
16645 pub fn CSND_SetCapRegs(capUnit: u32_, flags: u32_, addr: u32_, size: u32_);
16646}
16647unsafe extern "C" {
16648 #[must_use]
16649 #[doc = "Sets up DSP flags.\n # Arguments\n\n* `waitDone` - Whether to wait for completion."]
16650 pub fn CSND_SetDspFlags(waitDone: bool) -> Result;
16651}
16652unsafe extern "C" {
16653 #[must_use]
16654 #[doc = "Updates CSND information.\n # Arguments\n\n* `waitDone` - Whether to wait for completion."]
16655 pub fn CSND_UpdateInfo(waitDone: bool) -> Result;
16656}
16657unsafe extern "C" {
16658 #[must_use]
16659 #[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."]
16660 pub fn csndPlaySound(
16661 chn: ::libc::c_int,
16662 flags: u32_,
16663 sampleRate: u32_,
16664 vol: f32,
16665 pan: f32,
16666 data0: *mut ::libc::c_void,
16667 data1: *mut ::libc::c_void,
16668 size: u32_,
16669 ) -> Result;
16670}
16671unsafe extern "C" {
16672 #[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."]
16673 pub fn csndGetDspFlags(outSemFlags: *mut u32_, outIrqFlags: *mut u32_);
16674}
16675unsafe extern "C" {
16676 #[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."]
16677 pub fn csndGetChnInfo(channel: u32_) -> *mut CSND_ChnInfo;
16678}
16679unsafe extern "C" {
16680 #[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."]
16681 pub fn csndGetCapInfo(capUnit: u32_) -> *mut CSND_CapInfo;
16682}
16683unsafe extern "C" {
16684 #[must_use]
16685 #[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."]
16686 pub fn csndGetState(channel: u32_, out: *mut CSND_ChnInfo) -> Result;
16687}
16688unsafe extern "C" {
16689 #[must_use]
16690 #[doc = "Gets whether a channel is playing.\n # Arguments\n\n* `channel` - Channel to check.\n * `status` - Pointer to output the channel status to."]
16691 pub fn csndIsPlaying(channel: u32_, status: *mut u8_) -> Result;
16692}
16693#[doc = "< Pipe interrupt."]
16694pub const DSP_INTERRUPT_PIPE: DSP_InterruptType = 2;
16695#[doc = "DSP interrupt types."]
16696pub type DSP_InterruptType = ::libc::c_uchar;
16697#[doc = "< DSP is going to sleep."]
16698pub const DSPHOOK_ONSLEEP: DSP_HookType = 0;
16699#[doc = "< DSP is waking up."]
16700pub const DSPHOOK_ONWAKEUP: DSP_HookType = 1;
16701#[doc = "< DSP was sleeping and the app was cancelled."]
16702pub const DSPHOOK_ONCANCEL: DSP_HookType = 2;
16703#[doc = "DSP hook types."]
16704pub type DSP_HookType = ::libc::c_uchar;
16705#[doc = "DSP hook function."]
16706pub type dspHookFn = ::core::option::Option<unsafe extern "C" fn(hook: DSP_HookType)>;
16707#[doc = "DSP hook cookie."]
16708#[repr(C)]
16709#[derive(Debug, Copy, Clone)]
16710pub struct tag_dspHookCookie {
16711 #[doc = "< Next cookie."]
16712 pub next: *mut tag_dspHookCookie,
16713 #[doc = "< Hook callback."]
16714 pub callback: dspHookFn,
16715}
16716#[allow(clippy::unnecessary_operation, clippy::identity_op)]
16717const _: () = {
16718 ["Size of tag_dspHookCookie"][::core::mem::size_of::<tag_dspHookCookie>() - 8usize];
16719 ["Alignment of tag_dspHookCookie"][::core::mem::align_of::<tag_dspHookCookie>() - 4usize];
16720 ["Offset of field: tag_dspHookCookie::next"]
16721 [::core::mem::offset_of!(tag_dspHookCookie, next) - 0usize];
16722 ["Offset of field: tag_dspHookCookie::callback"]
16723 [::core::mem::offset_of!(tag_dspHookCookie, callback) - 4usize];
16724};
16725impl Default for tag_dspHookCookie {
16726 fn default() -> Self {
16727 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
16728 unsafe {
16729 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
16730 s.assume_init()
16731 }
16732 }
16733}
16734#[doc = "DSP hook cookie."]
16735pub type dspHookCookie = tag_dspHookCookie;
16736unsafe extern "C" {
16737 #[must_use]
16738 #[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."]
16739 pub fn dspInit() -> Result;
16740}
16741unsafe extern "C" {
16742 #[doc = "Closes the dsp service.\n > **Note:** This will also unload the DSP binary."]
16743 pub fn dspExit();
16744}
16745unsafe extern "C" {
16746 #[doc = "Returns true if a component is loaded, false otherwise."]
16747 pub fn dspIsComponentLoaded() -> bool;
16748}
16749unsafe extern "C" {
16750 #[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."]
16751 pub fn dspHook(cookie: *mut dspHookCookie, callback: dspHookFn);
16752}
16753unsafe extern "C" {
16754 #[doc = "Removes a DSP status hook.\n # Arguments\n\n* `cookie` - Hook cookie to remove."]
16755 pub fn dspUnhook(cookie: *mut dspHookCookie);
16756}
16757unsafe extern "C" {
16758 #[must_use]
16759 #[doc = "Checks if a headphone is inserted.\n # Arguments\n\n* `is_inserted` - Pointer to output the insertion status to."]
16760 pub fn DSP_GetHeadphoneStatus(is_inserted: *mut bool) -> Result;
16761}
16762unsafe extern "C" {
16763 #[must_use]
16764 #[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"]
16765 pub fn DSP_FlushDataCache(address: *const ::libc::c_void, size: u32_) -> Result;
16766}
16767unsafe extern "C" {
16768 #[must_use]
16769 #[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"]
16770 pub fn DSP_InvalidateDataCache(address: *const ::libc::c_void, size: u32_) -> Result;
16771}
16772unsafe extern "C" {
16773 #[must_use]
16774 #[doc = "Retrieves the handle of the DSP semaphore.\n # Arguments\n\n* `semaphore` - Pointer to output the semaphore to."]
16775 pub fn DSP_GetSemaphoreHandle(semaphore: *mut Handle) -> Result;
16776}
16777unsafe extern "C" {
16778 #[must_use]
16779 #[doc = "Sets the DSP hardware semaphore value.\n # Arguments\n\n* `value` - Value to set."]
16780 pub fn DSP_SetSemaphore(value: u16_) -> Result;
16781}
16782unsafe extern "C" {
16783 #[must_use]
16784 #[doc = "Masks the DSP hardware semaphore value.\n # Arguments\n\n* `mask` - Mask to apply."]
16785 pub fn DSP_SetSemaphoreMask(mask: u16_) -> Result;
16786}
16787unsafe extern "C" {
16788 #[must_use]
16789 #[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"]
16790 pub fn DSP_LoadComponent(
16791 component: *const ::libc::c_void,
16792 size: u32_,
16793 prog_mask: u16_,
16794 data_mask: u16_,
16795 is_loaded: *mut bool,
16796 ) -> Result;
16797}
16798unsafe extern "C" {
16799 #[must_use]
16800 #[doc = "Stops the DSP by unloading the binary."]
16801 pub fn DSP_UnloadComponent() -> Result;
16802}
16803unsafe extern "C" {
16804 #[must_use]
16805 #[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"]
16806 pub fn DSP_RegisterInterruptEvents(handle: Handle, interrupt: u32_, channel: u32_) -> Result;
16807}
16808unsafe extern "C" {
16809 #[must_use]
16810 #[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"]
16811 pub fn DSP_ReadPipeIfPossible(
16812 channel: u32_,
16813 peer: u32_,
16814 buffer: *mut ::libc::c_void,
16815 length: u16_,
16816 length_read: *mut u16_,
16817 ) -> Result;
16818}
16819unsafe extern "C" {
16820 #[must_use]
16821 #[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"]
16822 pub fn DSP_WriteProcessPipe(
16823 channel: u32_,
16824 buffer: *const ::libc::c_void,
16825 length: u32_,
16826 ) -> Result;
16827}
16828unsafe extern "C" {
16829 #[must_use]
16830 #[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."]
16831 pub fn DSP_ConvertProcessAddressFromDspDram(
16832 dsp_address: u32_,
16833 arm_address: *mut u32_,
16834 ) -> Result;
16835}
16836unsafe extern "C" {
16837 #[must_use]
16838 #[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."]
16839 pub fn DSP_RecvData(regNo: u16_, value: *mut u16_) -> Result;
16840}
16841unsafe extern "C" {
16842 #[must_use]
16843 #[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."]
16844 pub fn DSP_RecvDataIsReady(regNo: u16_, is_ready: *mut bool) -> Result;
16845}
16846unsafe extern "C" {
16847 #[must_use]
16848 #[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."]
16849 pub fn DSP_SendData(regNo: u16_, value: u16_) -> Result;
16850}
16851unsafe extern "C" {
16852 #[must_use]
16853 #[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."]
16854 pub fn DSP_SendDataIsEmpty(regNo: u16_, is_empty: *mut bool) -> Result;
16855}
16856pub type FSPXI_Archive = u64_;
16857pub type FSPXI_File = u64_;
16858pub type FSPXI_Directory = u64_;
16859unsafe extern "C" {
16860 #[must_use]
16861 #[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."]
16862 pub fn FSPXI_OpenFile(
16863 serviceHandle: Handle,
16864 out: *mut FSPXI_File,
16865 archive: FSPXI_Archive,
16866 path: FS_Path,
16867 flags: u32_,
16868 attributes: u32_,
16869 ) -> Result;
16870}
16871unsafe extern "C" {
16872 #[must_use]
16873 #[doc = "Deletes a file.\n # Arguments\n\n* `archive` - Archive containing the file.\n * `path` - Path of the file."]
16874 pub fn FSPXI_DeleteFile(serviceHandle: Handle, archive: FSPXI_Archive, path: FS_Path)
16875 -> Result;
16876}
16877unsafe extern "C" {
16878 #[must_use]
16879 #[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."]
16880 pub fn FSPXI_RenameFile(
16881 serviceHandle: Handle,
16882 srcArchive: FSPXI_Archive,
16883 srcPath: FS_Path,
16884 dstArchive: FSPXI_Archive,
16885 dstPath: FS_Path,
16886 ) -> Result;
16887}
16888unsafe extern "C" {
16889 #[must_use]
16890 #[doc = "Deletes a directory.\n # Arguments\n\n* `archive` - Archive containing the directory.\n * `path` - Path of the directory."]
16891 pub fn FSPXI_DeleteDirectory(
16892 serviceHandle: Handle,
16893 archive: FSPXI_Archive,
16894 path: FS_Path,
16895 ) -> Result;
16896}
16897unsafe extern "C" {
16898 #[must_use]
16899 #[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."]
16900 pub fn FSPXI_CreateFile(
16901 serviceHandle: Handle,
16902 archive: FSPXI_Archive,
16903 path: FS_Path,
16904 attributes: u32_,
16905 fileSize: u64_,
16906 ) -> Result;
16907}
16908unsafe extern "C" {
16909 #[must_use]
16910 #[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."]
16911 pub fn FSPXI_CreateDirectory(
16912 serviceHandle: Handle,
16913 archive: FSPXI_Archive,
16914 path: FS_Path,
16915 attributes: u32_,
16916 ) -> Result;
16917}
16918unsafe extern "C" {
16919 #[must_use]
16920 #[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."]
16921 pub fn FSPXI_RenameDirectory(
16922 serviceHandle: Handle,
16923 srcArchive: FSPXI_Archive,
16924 srcPath: FS_Path,
16925 dstArchive: FSPXI_Archive,
16926 dstPath: FS_Path,
16927 ) -> Result;
16928}
16929unsafe extern "C" {
16930 #[must_use]
16931 #[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."]
16932 pub fn FSPXI_OpenDirectory(
16933 serviceHandle: Handle,
16934 out: *mut FSPXI_Directory,
16935 archive: FSPXI_Archive,
16936 path: FS_Path,
16937 ) -> Result;
16938}
16939unsafe extern "C" {
16940 #[must_use]
16941 #[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."]
16942 pub fn FSPXI_ReadFile(
16943 serviceHandle: Handle,
16944 file: FSPXI_File,
16945 bytesRead: *mut u32_,
16946 offset: u64_,
16947 buffer: *mut ::libc::c_void,
16948 size: u32_,
16949 ) -> Result;
16950}
16951unsafe extern "C" {
16952 #[must_use]
16953 #[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."]
16954 pub fn FSPXI_CalculateFileHashSHA256(
16955 serviceHandle: Handle,
16956 file: FSPXI_File,
16957 buffer: *mut ::libc::c_void,
16958 size: u32_,
16959 ) -> Result;
16960}
16961unsafe extern "C" {
16962 #[must_use]
16963 #[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."]
16964 pub fn FSPXI_WriteFile(
16965 serviceHandle: Handle,
16966 file: FSPXI_File,
16967 bytesWritten: *mut u32_,
16968 offset: u64_,
16969 buffer: *const ::libc::c_void,
16970 size: u32_,
16971 flags: u32_,
16972 ) -> Result;
16973}
16974unsafe extern "C" {
16975 #[must_use]
16976 #[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."]
16977 pub fn FSPXI_CalcSavegameMAC(
16978 serviceHandle: Handle,
16979 file: FSPXI_File,
16980 inBuffer: *const ::libc::c_void,
16981 inSize: u32_,
16982 outBuffer: *mut ::libc::c_void,
16983 outSize: u32_,
16984 ) -> Result;
16985}
16986unsafe extern "C" {
16987 #[must_use]
16988 #[doc = "Get size of a file\n # Arguments\n\n* `file` - File to get the size of.\n * `size` - Pointer to output size to."]
16989 pub fn FSPXI_GetFileSize(serviceHandle: Handle, file: FSPXI_File, size: *mut u64_) -> Result;
16990}
16991unsafe extern "C" {
16992 #[must_use]
16993 #[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"]
16994 pub fn FSPXI_SetFileSize(serviceHandle: Handle, file: FSPXI_File, size: u64_) -> Result;
16995}
16996unsafe extern "C" {
16997 #[must_use]
16998 #[doc = "Close a file\n # Arguments\n\n* `file` - File to close"]
16999 pub fn FSPXI_CloseFile(serviceHandle: Handle, file: FSPXI_File) -> Result;
17000}
17001unsafe extern "C" {
17002 #[must_use]
17003 #[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."]
17004 pub fn FSPXI_ReadDirectory(
17005 serviceHandle: Handle,
17006 directory: FSPXI_Directory,
17007 entriesRead: *mut u32_,
17008 entryCount: u32_,
17009 entries: *mut FS_DirectoryEntry,
17010 ) -> Result;
17011}
17012unsafe extern "C" {
17013 #[must_use]
17014 #[doc = "Close a directory\n # Arguments\n\n* `directory` - Directory to close."]
17015 pub fn FSPXI_CloseDirectory(serviceHandle: Handle, directory: FSPXI_Directory) -> Result;
17016}
17017unsafe extern "C" {
17018 #[must_use]
17019 #[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."]
17020 pub fn FSPXI_OpenArchive(
17021 serviceHandle: Handle,
17022 archive: *mut FSPXI_Archive,
17023 archiveID: FS_ArchiveID,
17024 path: FS_Path,
17025 ) -> Result;
17026}
17027unsafe extern "C" {
17028 #[must_use]
17029 #[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"]
17030 pub fn FSPXI_HasFile(
17031 serviceHandle: Handle,
17032 archive: FSPXI_Archive,
17033 out: *mut bool,
17034 path: FS_Path,
17035 ) -> Result;
17036}
17037unsafe extern "C" {
17038 #[must_use]
17039 #[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"]
17040 pub fn FSPXI_HasDirectory(
17041 serviceHandle: Handle,
17042 archive: FSPXI_Archive,
17043 out: *mut bool,
17044 path: FS_Path,
17045 ) -> Result;
17046}
17047unsafe extern "C" {
17048 #[must_use]
17049 #[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."]
17050 pub fn FSPXI_CommitSaveData(serviceHandle: Handle, archive: FSPXI_Archive, id: u32_) -> Result;
17051}
17052unsafe extern "C" {
17053 #[must_use]
17054 #[doc = "Close an archive\n # Arguments\n\n* `archive` - Archive to close."]
17055 pub fn FSPXI_CloseArchive(serviceHandle: Handle, archive: FSPXI_Archive) -> Result;
17056}
17057unsafe extern "C" {
17058 #[must_use]
17059 #[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."]
17060 pub fn FSPXI_Unknown0x17(
17061 serviceHandle: Handle,
17062 archive: FSPXI_Archive,
17063 out: *mut bool,
17064 ) -> Result;
17065}
17066unsafe extern "C" {
17067 #[must_use]
17068 #[doc = "Gets the inserted card type.\n # Arguments\n\n* `out` - Pointer to output the card type to."]
17069 pub fn FSPXI_GetCardType(serviceHandle: Handle, out: *mut FS_CardType) -> Result;
17070}
17071unsafe extern "C" {
17072 #[must_use]
17073 #[doc = "Gets the SDMC archive resource information.\n # Arguments\n\n* `out` - Pointer to output the archive resource information to."]
17074 pub fn FSPXI_GetSdmcArchiveResource(
17075 serviceHandle: Handle,
17076 out: *mut FS_ArchiveResource,
17077 ) -> Result;
17078}
17079unsafe extern "C" {
17080 #[must_use]
17081 #[doc = "Gets the NAND archive resource information.\n # Arguments\n\n* `out` - Pointer to output the archive resource information to."]
17082 pub fn FSPXI_GetNandArchiveResource(
17083 serviceHandle: Handle,
17084 out: *mut FS_ArchiveResource,
17085 ) -> Result;
17086}
17087unsafe extern "C" {
17088 #[must_use]
17089 #[doc = "Gets the error code from the SDMC FatFS driver\n # Arguments\n\n* `out` - Pointer to output the error code to"]
17090 pub fn FSPXI_GetSdmcFatFsError(serviceHandle: Handle, out: *mut u32_) -> Result;
17091}
17092unsafe extern "C" {
17093 #[must_use]
17094 #[doc = "Gets whether PXIFS0 detects the SD\n # Arguments\n\n* `out` - Pointer to output the detection status to"]
17095 pub fn FSPXI_IsSdmcDetected(serviceHandle: Handle, out: *mut bool) -> Result;
17096}
17097unsafe extern "C" {
17098 #[must_use]
17099 #[doc = "Gets whether PXIFS0 can write to the SD\n # Arguments\n\n* `out` - Pointer to output the writable status to"]
17100 pub fn FSPXI_IsSdmcWritable(serviceHandle: Handle, out: *mut bool) -> Result;
17101}
17102unsafe extern "C" {
17103 #[must_use]
17104 #[doc = "Gets the SDMC CID\n # Arguments\n\n* `out` - Buffer to output the CID to.\n * `size` - Size of buffer."]
17105 pub fn FSPXI_GetSdmcCid(serviceHandle: Handle, out: *mut ::libc::c_void, size: u32_) -> Result;
17106}
17107unsafe extern "C" {
17108 #[must_use]
17109 #[doc = "Gets the NAND CID\n # Arguments\n\n* `out` - Buffer to output the CID to.\n * `size` - Size of buffer."]
17110 pub fn FSPXI_GetNandCid(serviceHandle: Handle, out: *mut ::libc::c_void, size: u32_) -> Result;
17111}
17112unsafe extern "C" {
17113 #[must_use]
17114 #[doc = "Gets the SDMC speed info\n # Arguments\n\n* `out` - Buffer to output the speed info to."]
17115 pub fn FSPXI_GetSdmcSpeedInfo(serviceHandle: Handle, out: *mut FS_SdMmcSpeedInfo) -> Result;
17116}
17117unsafe extern "C" {
17118 #[must_use]
17119 #[doc = "Gets the NAND speed info\n # Arguments\n\n* `out` - Buffer to output the speed info to."]
17120 pub fn FSPXI_GetNandSpeedInfo(serviceHandle: Handle, out: *mut FS_SdMmcSpeedInfo) -> Result;
17121}
17122unsafe extern "C" {
17123 #[must_use]
17124 #[doc = "Gets the SDMC log\n # Arguments\n\n* `out` - Buffer to output the log to.\n * `size` - Size of buffer."]
17125 pub fn FSPXI_GetSdmcLog(serviceHandle: Handle, out: *mut ::libc::c_void, size: u32_) -> Result;
17126}
17127unsafe extern "C" {
17128 #[must_use]
17129 #[doc = "Gets the NAND log\n # Arguments\n\n* `out` - Buffer to output the log to.\n * `size` - Size of buffer."]
17130 pub fn FSPXI_GetNandLog(serviceHandle: Handle, out: *mut ::libc::c_void, size: u32_) -> Result;
17131}
17132unsafe extern "C" {
17133 #[must_use]
17134 #[doc = "Clears the SDMC log"]
17135 pub fn FSPXI_ClearSdmcLog(serviceHandle: Handle) -> Result;
17136}
17137unsafe extern "C" {
17138 #[must_use]
17139 #[doc = "Clears the NAND log"]
17140 pub fn FSPXI_ClearNandLog(serviceHandle: Handle) -> Result;
17141}
17142unsafe extern "C" {
17143 #[must_use]
17144 #[doc = "Gets whether a card is inserted.\n # Arguments\n\n* `inserted` - Pointer to output the insertion status to."]
17145 pub fn FSPXI_CardSlotIsInserted(serviceHandle: Handle, inserted: *mut bool) -> Result;
17146}
17147unsafe extern "C" {
17148 #[must_use]
17149 #[doc = "Powers on the card slot.\n # Arguments\n\n* `status` - Pointer to output the power status to."]
17150 pub fn FSPXI_CardSlotPowerOn(serviceHandle: Handle, status: *mut bool) -> Result;
17151}
17152unsafe extern "C" {
17153 #[must_use]
17154 #[doc = "Powers off the card slot.\n # Arguments\n\n* `status` - Pointer to output the power status to."]
17155 pub fn FSPXI_CardSlotPowerOff(serviceHandle: Handle, status: *mut bool) -> Result;
17156}
17157unsafe extern "C" {
17158 #[must_use]
17159 #[doc = "Gets the card's power status.\n # Arguments\n\n* `status` - Pointer to output the power status to."]
17160 pub fn FSPXI_CardSlotGetCardIFPowerStatus(serviceHandle: Handle, status: *mut bool) -> Result;
17161}
17162unsafe extern "C" {
17163 #[must_use]
17164 #[doc = "Executes a CARDNOR direct command.\n # Arguments\n\n* `commandId` - ID of the command."]
17165 pub fn FSPXI_CardNorDirectCommand(serviceHandle: Handle, commandId: u8_) -> Result;
17166}
17167unsafe extern "C" {
17168 #[must_use]
17169 #[doc = "Executes a CARDNOR direct command with an address.\n # Arguments\n\n* `commandId` - ID of the command.\n * `address` - Address to provide."]
17170 pub fn FSPXI_CardNorDirectCommandWithAddress(
17171 serviceHandle: Handle,
17172 commandId: u8_,
17173 address: u32_,
17174 ) -> Result;
17175}
17176unsafe extern "C" {
17177 #[must_use]
17178 #[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."]
17179 pub fn FSPXI_CardNorDirectRead(
17180 serviceHandle: Handle,
17181 commandId: u8_,
17182 size: u32_,
17183 output: *mut ::libc::c_void,
17184 ) -> Result;
17185}
17186unsafe extern "C" {
17187 #[must_use]
17188 #[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."]
17189 pub fn FSPXI_CardNorDirectReadWithAddress(
17190 serviceHandle: Handle,
17191 commandId: u8_,
17192 address: u32_,
17193 size: u32_,
17194 output: *mut ::libc::c_void,
17195 ) -> Result;
17196}
17197unsafe extern "C" {
17198 #[must_use]
17199 #[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 ?.?.?"]
17200 pub fn FSPXI_CardNorDirectWrite(
17201 serviceHandle: Handle,
17202 commandId: u8_,
17203 size: u32_,
17204 input: *const ::libc::c_void,
17205 ) -> Result;
17206}
17207unsafe extern "C" {
17208 #[must_use]
17209 #[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."]
17210 pub fn FSPXI_CardNorDirectWriteWithAddress(
17211 serviceHandle: Handle,
17212 commandId: u8_,
17213 address: u32_,
17214 size: u32_,
17215 input: *const ::libc::c_void,
17216 ) -> Result;
17217}
17218unsafe extern "C" {
17219 #[must_use]
17220 #[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."]
17221 pub fn FSPXI_CardNorDirectRead_4xIO(
17222 serviceHandle: Handle,
17223 commandId: u8_,
17224 address: u32_,
17225 size: u32_,
17226 output: *mut ::libc::c_void,
17227 ) -> Result;
17228}
17229unsafe extern "C" {
17230 #[must_use]
17231 #[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."]
17232 pub fn FSPXI_CardNorDirectCpuWriteWithoutVerify(
17233 serviceHandle: Handle,
17234 address: u32_,
17235 size: u32_,
17236 input: *const ::libc::c_void,
17237 ) -> Result;
17238}
17239unsafe extern "C" {
17240 #[must_use]
17241 #[doc = "Executes a CARDNOR direct sector erase without verify.\n # Arguments\n\n* `address` - Address to provide."]
17242 pub fn FSPXI_CardNorDirectSectorEraseWithoutVerify(
17243 serviceHandle: Handle,
17244 address: u32_,
17245 ) -> Result;
17246}
17247unsafe extern "C" {
17248 #[must_use]
17249 #[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"]
17250 pub fn FSPXI_GetProductInfo(
17251 serviceHandle: Handle,
17252 info: *mut FS_ProductInfo,
17253 archive: FSPXI_Archive,
17254 ) -> Result;
17255}
17256unsafe extern "C" {
17257 #[must_use]
17258 #[doc = "Sets the CARDSPI baud rate.\n # Arguments\n\n* `baudRate` - Baud rate to set."]
17259 pub fn FSPXI_SetCardSpiBaudrate(serviceHandle: Handle, baudRate: FS_CardSpiBaudRate) -> Result;
17260}
17261unsafe extern "C" {
17262 #[must_use]
17263 #[doc = "Sets the CARDSPI bus mode.\n # Arguments\n\n* `busMode` - Bus mode to set."]
17264 pub fn FSPXI_SetCardSpiBusMode(serviceHandle: Handle, busMode: FS_CardSpiBusMode) -> Result;
17265}
17266unsafe extern "C" {
17267 #[must_use]
17268 #[doc = "Sends initialization info to ARM9\n # Arguments\n\n* `unk` - FS sends *(0x1FF81086)"]
17269 pub fn FSPXI_SendInitializeInfoTo9(serviceHandle: Handle, unk: u8_) -> Result;
17270}
17271unsafe extern "C" {
17272 #[must_use]
17273 #[doc = "Creates ext save data.\n # Arguments\n\n* `info` - Info of the save data."]
17274 pub fn FSPXI_CreateExtSaveData(serviceHandle: Handle, info: FS_ExtSaveDataInfo) -> Result;
17275}
17276unsafe extern "C" {
17277 #[must_use]
17278 #[doc = "Deletes ext save data.\n # Arguments\n\n* `info` - Info of the save data."]
17279 pub fn FSPXI_DeleteExtSaveData(serviceHandle: Handle, info: FS_ExtSaveDataInfo) -> Result;
17280}
17281unsafe extern "C" {
17282 #[must_use]
17283 #[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."]
17284 pub fn FSPXI_EnumerateExtSaveData(
17285 serviceHandle: Handle,
17286 idsWritten: *mut u32_,
17287 idsSize: u32_,
17288 mediaType: FS_MediaType,
17289 idSize: u32_,
17290 shared: bool,
17291 ids: *mut u8_,
17292 ) -> Result;
17293}
17294unsafe extern "C" {
17295 #[must_use]
17296 #[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."]
17297 pub fn FSPXI_GetSpecialContentIndex(
17298 serviceHandle: Handle,
17299 index: *mut u16_,
17300 mediaType: FS_MediaType,
17301 programId: u64_,
17302 type_: FS_SpecialContentType,
17303 ) -> Result;
17304}
17305unsafe extern "C" {
17306 #[must_use]
17307 #[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)"]
17308 pub fn FSPXI_GetLegacyRomHeader(
17309 serviceHandle: Handle,
17310 mediaType: FS_MediaType,
17311 programId: u64_,
17312 header: *mut ::libc::c_void,
17313 ) -> Result;
17314}
17315unsafe extern "C" {
17316 #[must_use]
17317 #[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?"]
17318 pub fn FSPXI_GetLegacyBannerData(
17319 serviceHandle: Handle,
17320 mediaType: FS_MediaType,
17321 programId: u64_,
17322 banner: *mut ::libc::c_void,
17323 unk: u8_,
17324 ) -> Result;
17325}
17326unsafe extern "C" {
17327 #[must_use]
17328 #[doc = "Formats the CARDNOR device.\n # Arguments\n\n* `unk` - Unknown. Transaction?"]
17329 pub fn FSPXI_FormatCardNorDevice(serviceHandle: Handle, unk: u32_) -> Result;
17330}
17331unsafe extern "C" {
17332 #[must_use]
17333 #[doc = "Deletes the 3DS SDMC root."]
17334 pub fn FSPXI_DeleteSdmcRoot(serviceHandle: Handle) -> Result;
17335}
17336unsafe extern "C" {
17337 #[must_use]
17338 #[doc = "Deletes all ext save data on the NAND."]
17339 pub fn FSPXI_DeleteAllExtSaveDataOnNand(serviceHandle: Handle) -> Result;
17340}
17341unsafe extern "C" {
17342 #[must_use]
17343 #[doc = "Initializes the CTR file system."]
17344 pub fn FSPXI_InitializeCtrFilesystem(serviceHandle: Handle) -> Result;
17345}
17346unsafe extern "C" {
17347 #[must_use]
17348 #[doc = "Creates the FS seed."]
17349 pub fn FSPXI_CreateSeed(serviceHandle: Handle) -> Result;
17350}
17351unsafe extern "C" {
17352 #[must_use]
17353 #[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."]
17354 pub fn FSPXI_GetSdmcCtrRootPath(serviceHandle: Handle, out: *mut u16_, length: u32_) -> Result;
17355}
17356unsafe extern "C" {
17357 #[must_use]
17358 #[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."]
17359 pub fn FSPXI_GetArchiveResource(
17360 serviceHandle: Handle,
17361 archiveResource: *mut FS_ArchiveResource,
17362 mediaType: FS_SystemMediaType,
17363 ) -> Result;
17364}
17365unsafe extern "C" {
17366 #[must_use]
17367 #[doc = "Exports the integrity verification seed.\n # Arguments\n\n* `seed` - Pointer to output the seed to."]
17368 pub fn FSPXI_ExportIntegrityVerificationSeed(
17369 serviceHandle: Handle,
17370 seed: *mut FS_IntegrityVerificationSeed,
17371 ) -> Result;
17372}
17373unsafe extern "C" {
17374 #[must_use]
17375 #[doc = "Imports an integrity verification seed.\n # Arguments\n\n* `seed` - Seed to import."]
17376 pub fn FSPXI_ImportIntegrityVerificationSeed(
17377 serviceHandle: Handle,
17378 seed: *const FS_IntegrityVerificationSeed,
17379 ) -> Result;
17380}
17381unsafe extern "C" {
17382 #[must_use]
17383 #[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."]
17384 pub fn FSPXI_GetLegacySubBannerData(
17385 serviceHandle: Handle,
17386 bannerSize: u32_,
17387 mediaType: FS_MediaType,
17388 programId: u64_,
17389 banner: *mut ::libc::c_void,
17390 ) -> Result;
17391}
17392unsafe extern "C" {
17393 #[must_use]
17394 #[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."]
17395 pub fn FSPXI_GenerateRandomBytes(
17396 serviceHandle: Handle,
17397 buffer: *mut ::libc::c_void,
17398 size: u32_,
17399 ) -> Result;
17400}
17401unsafe extern "C" {
17402 #[must_use]
17403 #[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."]
17404 pub fn FSPXI_GetFileLastModified(
17405 serviceHandle: Handle,
17406 archive: FSPXI_Archive,
17407 out: *mut u64_,
17408 path: *const u16_,
17409 size: u32_,
17410 ) -> Result;
17411}
17412unsafe extern "C" {
17413 #[must_use]
17414 #[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."]
17415 pub fn FSPXI_ReadSpecialFile(
17416 serviceHandle: Handle,
17417 bytesRead: *mut u32_,
17418 fileOffset: u64_,
17419 size: u32_,
17420 data: *mut ::libc::c_void,
17421 ) -> Result;
17422}
17423unsafe extern "C" {
17424 #[must_use]
17425 #[doc = "Gets the size of a special file.\n # Arguments\n\n* `fileSize` - Pointer to output the size to."]
17426 pub fn FSPXI_GetSpecialFileSize(serviceHandle: Handle, fileSize: *mut u64_) -> Result;
17427}
17428unsafe extern "C" {
17429 #[must_use]
17430 #[doc = "Initiates a device move as the source device.\n # Arguments\n\n* `context` - Pointer to output the context to."]
17431 pub fn FSPXI_StartDeviceMoveAsSource(
17432 serviceHandle: Handle,
17433 context: *mut FS_DeviceMoveContext,
17434 ) -> Result;
17435}
17436unsafe extern "C" {
17437 #[must_use]
17438 #[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."]
17439 pub fn FSPXI_StartDeviceMoveAsDestination(
17440 serviceHandle: Handle,
17441 context: FS_DeviceMoveContext,
17442 clear: bool,
17443 ) -> Result;
17444}
17445unsafe extern "C" {
17446 #[must_use]
17447 #[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?"]
17448 pub fn FSPXI_ReadFileSHA256(
17449 serviceHandle: Handle,
17450 file: FSPXI_File,
17451 bytesRead: *mut u32_,
17452 offset: u64_,
17453 readBuffer: *mut ::libc::c_void,
17454 readBufferSize: u32_,
17455 hashtable: *mut ::libc::c_void,
17456 hashtableSize: u32_,
17457 unk: u32_,
17458 ) -> Result;
17459}
17460unsafe extern "C" {
17461 #[must_use]
17462 #[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?"]
17463 pub fn FSPXI_WriteFileSHA256(
17464 serviceHandle: Handle,
17465 file: FSPXI_File,
17466 bytesWritten: *mut u32_,
17467 offset: u64_,
17468 writeBuffer: *const ::libc::c_void,
17469 writeBufferSize: u32_,
17470 hashtable: *mut ::libc::c_void,
17471 hashtableSize: u32_,
17472 unk1: u32_,
17473 unk2: u32_,
17474 ) -> Result;
17475}
17476unsafe extern "C" {
17477 #[must_use]
17478 #[doc = "Configures CTRCARD latency emulation.\n # Arguments\n\n* `latency` - Latency to apply."]
17479 pub fn FSPXI_SetCtrCardLatencyParameter(serviceHandle: Handle, latency: u64_) -> Result;
17480}
17481unsafe extern "C" {
17482 #[must_use]
17483 #[doc = "Sets the file system priority.\n # Arguments\n\n* `priority` - Priority to set."]
17484 pub fn FSPXI_SetPriority(serviceHandle: Handle, priority: u32_) -> Result;
17485}
17486unsafe extern "C" {
17487 #[must_use]
17488 #[doc = "Toggles cleaning up invalid save data.\n # Arguments\n\n* `enable` - Whether to enable cleaning up invalid save data."]
17489 pub fn FSPXI_SwitchCleanupInvalidSaveData(serviceHandle: Handle, enable: bool) -> Result;
17490}
17491unsafe extern "C" {
17492 #[must_use]
17493 #[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."]
17494 pub fn FSPXI_EnumerateSystemSaveData(
17495 serviceHandle: Handle,
17496 idsWritten: *mut u32_,
17497 idsSize: u32_,
17498 ids: *mut u32_,
17499 ) -> Result;
17500}
17501unsafe extern "C" {
17502 #[must_use]
17503 #[doc = "Reads the NAND report.\n # Arguments\n\n* `unk` - Unknown\n * `buffer` - Buffer to write the report to.\n * `size` - Size of buffer"]
17504 pub fn FSPXI_ReadNandReport(
17505 serviceHandle: Handle,
17506 buffer: *mut ::libc::c_void,
17507 size: u32_,
17508 unk: u32_,
17509 ) -> Result;
17510}
17511unsafe extern "C" {
17512 #[must_use]
17513 #[doc = "Unknown command 0x56\n > Called by FSUSER_ControlArchive with ArchiveAction 0x789D"]
17514 pub fn FSPXI_Unknown0x56(
17515 serviceHandle: Handle,
17516 out: *mut u32_,
17517 archive: FS_Archive,
17518 path: FS_Path,
17519 ) -> Result;
17520}
17521unsafe extern "C" {
17522 #[must_use]
17523 #[doc = "Initializes fs:REG."]
17524 pub fn fsRegInit() -> Result;
17525}
17526unsafe extern "C" {
17527 #[doc = "Exits fs:REG."]
17528 pub fn fsRegExit();
17529}
17530unsafe extern "C" {
17531 #[doc = "Gets the current fs:REG session handle.\n # Returns\n\nThe current fs:REG session handle."]
17532 pub fn fsRegGetSessionHandle() -> *mut Handle;
17533}
17534unsafe extern "C" {
17535 #[must_use]
17536 #[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."]
17537 pub fn FSREG_Register(
17538 pid: u32_,
17539 programHandle: u64_,
17540 programInfo: *const FS_ProgramInfo,
17541 storageInfo: *const ExHeader_Arm11StorageInfo,
17542 ) -> Result;
17543}
17544unsafe extern "C" {
17545 #[must_use]
17546 #[doc = "Unregisters a program's storage information.\n # Arguments\n\n* `pid` - The Process ID of the program."]
17547 pub fn FSREG_Unregister(pid: u32_) -> Result;
17548}
17549unsafe extern "C" {
17550 #[must_use]
17551 #[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."]
17552 pub fn FSREG_GetProgramInfo(
17553 exheaderInfos: *mut ExHeader_Info,
17554 maxNumEntries: u32_,
17555 programHandle: u64_,
17556 ) -> Result;
17557}
17558unsafe extern "C" {
17559 #[must_use]
17560 #[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."]
17561 pub fn FSREG_LoadProgram(
17562 programHandle: *mut u64_,
17563 programInfo: *const FS_ProgramInfo,
17564 ) -> Result;
17565}
17566unsafe extern "C" {
17567 #[must_use]
17568 #[doc = "Unloads a program.\n # Arguments\n\n* `programHandle` - The program handle."]
17569 pub fn FSREG_UnloadProgram(programHandle: u64_) -> Result;
17570}
17571unsafe extern "C" {
17572 #[must_use]
17573 #[doc = "Checks if a program has been loaded by fs:REG.\n # Arguments\n\n* `programHandle` - The program handle."]
17574 pub fn FSREG_CheckHostLoadId(programHandle: u64_) -> Result;
17575}
17576#[doc = "< Top screen."]
17577pub const GSPLCD_SCREEN_TOP: _bindgen_ty_22 = 1;
17578#[doc = "< Bottom screen."]
17579pub const GSPLCD_SCREEN_BOTTOM: _bindgen_ty_22 = 2;
17580#[doc = "< Both screens."]
17581pub const GSPLCD_SCREEN_BOTH: _bindgen_ty_22 = 3;
17582#[doc = "LCD screens."]
17583pub type _bindgen_ty_22 = ::libc::c_uchar;
17584unsafe extern "C" {
17585 #[must_use]
17586 #[doc = "Initializes GSPLCD."]
17587 pub fn gspLcdInit() -> Result;
17588}
17589unsafe extern "C" {
17590 #[doc = "Exits GSPLCD."]
17591 pub fn gspLcdExit();
17592}
17593unsafe extern "C" {
17594 #[doc = "Gets a pointer to the current gsp::Lcd session handle.\n # Returns\n\nA pointer to the current gsp::Lcd session handle."]
17595 pub fn gspLcdGetSessionHandle() -> *mut Handle;
17596}
17597unsafe extern "C" {
17598 #[must_use]
17599 #[doc = "Powers on both backlights."]
17600 pub fn GSPLCD_PowerOnAllBacklights() -> Result;
17601}
17602unsafe extern "C" {
17603 #[must_use]
17604 #[doc = "Powers off both backlights."]
17605 pub fn GSPLCD_PowerOffAllBacklights() -> Result;
17606}
17607unsafe extern "C" {
17608 #[must_use]
17609 #[doc = "Powers on the backlight.\n # Arguments\n\n* `screen` - Screen to power on."]
17610 pub fn GSPLCD_PowerOnBacklight(screen: u32_) -> Result;
17611}
17612unsafe extern "C" {
17613 #[must_use]
17614 #[doc = "Powers off the backlight.\n # Arguments\n\n* `screen` - Screen to power off."]
17615 pub fn GSPLCD_PowerOffBacklight(screen: u32_) -> Result;
17616}
17617unsafe extern "C" {
17618 #[must_use]
17619 #[doc = "Sets 3D_LEDSTATE to the input state value.\n # Arguments\n\n* `disable` - False = 3D LED enable, true = 3D LED disable."]
17620 pub fn GSPLCD_SetLedForceOff(disable: bool) -> Result;
17621}
17622unsafe extern "C" {
17623 #[must_use]
17624 #[doc = "Gets the LCD screens' vendors. Stubbed on old 3ds.\n # Arguments\n\n* `vendor` - Pointer to output the screen vendors to."]
17625 pub fn GSPLCD_GetVendors(vendors: *mut u8_) -> Result;
17626}
17627unsafe extern "C" {
17628 #[must_use]
17629 #[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."]
17630 pub fn GSPLCD_GetBrightness(screen: u32_, brightness: *mut u32_) -> Result;
17631}
17632unsafe extern "C" {
17633 #[must_use]
17634 #[doc = "Sets the LCD screens' brightness.\n # Arguments\n\n* `screen` - Screen to set the brightness value of.\n * `brightness` - Brightness value set."]
17635 pub fn GSPLCD_SetBrightness(screen: u32_, brightness: u32_) -> Result;
17636}
17637unsafe extern "C" {
17638 #[must_use]
17639 #[doc = "Sets the LCD screens' raw brightness.\n # Arguments\n\n* `screen` - Screen to set the brightness value of.\n * `brightness` - Brightness value set."]
17640 pub fn GSPLCD_SetBrightnessRaw(screen: u32_, brightness: u32_) -> Result;
17641}
17642#[doc = "< A"]
17643pub const KEY_A: _bindgen_ty_23 = 1;
17644#[doc = "< B"]
17645pub const KEY_B: _bindgen_ty_23 = 2;
17646#[doc = "< Select"]
17647pub const KEY_SELECT: _bindgen_ty_23 = 4;
17648#[doc = "< Start"]
17649pub const KEY_START: _bindgen_ty_23 = 8;
17650#[doc = "< D-Pad Right"]
17651pub const KEY_DRIGHT: _bindgen_ty_23 = 16;
17652#[doc = "< D-Pad Left"]
17653pub const KEY_DLEFT: _bindgen_ty_23 = 32;
17654#[doc = "< D-Pad Up"]
17655pub const KEY_DUP: _bindgen_ty_23 = 64;
17656#[doc = "< D-Pad Down"]
17657pub const KEY_DDOWN: _bindgen_ty_23 = 128;
17658#[doc = "< R"]
17659pub const KEY_R: _bindgen_ty_23 = 256;
17660#[doc = "< L"]
17661pub const KEY_L: _bindgen_ty_23 = 512;
17662#[doc = "< X"]
17663pub const KEY_X: _bindgen_ty_23 = 1024;
17664#[doc = "< Y"]
17665pub const KEY_Y: _bindgen_ty_23 = 2048;
17666#[doc = "< ZL (New 3DS only)"]
17667pub const KEY_ZL: _bindgen_ty_23 = 16384;
17668#[doc = "< ZR (New 3DS only)"]
17669pub const KEY_ZR: _bindgen_ty_23 = 32768;
17670#[doc = "< Touch (Not actually provided by HID)"]
17671pub const KEY_TOUCH: _bindgen_ty_23 = 1048576;
17672#[doc = "< C-Stick Right (New 3DS only)"]
17673pub const KEY_CSTICK_RIGHT: _bindgen_ty_23 = 16777216;
17674#[doc = "< C-Stick Left (New 3DS only)"]
17675pub const KEY_CSTICK_LEFT: _bindgen_ty_23 = 33554432;
17676#[doc = "< C-Stick Up (New 3DS only)"]
17677pub const KEY_CSTICK_UP: _bindgen_ty_23 = 67108864;
17678#[doc = "< C-Stick Down (New 3DS only)"]
17679pub const KEY_CSTICK_DOWN: _bindgen_ty_23 = 134217728;
17680#[doc = "< Circle Pad Right"]
17681pub const KEY_CPAD_RIGHT: _bindgen_ty_23 = 268435456;
17682#[doc = "< Circle Pad Left"]
17683pub const KEY_CPAD_LEFT: _bindgen_ty_23 = 536870912;
17684#[doc = "< Circle Pad Up"]
17685pub const KEY_CPAD_UP: _bindgen_ty_23 = 1073741824;
17686#[doc = "< Circle Pad Down"]
17687pub const KEY_CPAD_DOWN: _bindgen_ty_23 = 2147483648;
17688#[doc = "< D-Pad Up or Circle Pad Up"]
17689pub const KEY_UP: _bindgen_ty_23 = 1073741888;
17690#[doc = "< D-Pad Down or Circle Pad Down"]
17691pub const KEY_DOWN: _bindgen_ty_23 = 2147483776;
17692#[doc = "< D-Pad Left or Circle Pad Left"]
17693pub const KEY_LEFT: _bindgen_ty_23 = 536870944;
17694#[doc = "< D-Pad Right or Circle Pad Right"]
17695pub const KEY_RIGHT: _bindgen_ty_23 = 268435472;
17696#[doc = "Key values."]
17697pub type _bindgen_ty_23 = ::libc::c_uint;
17698#[doc = "Touch position."]
17699#[repr(C)]
17700#[derive(Debug, Default, Copy, Clone)]
17701pub struct touchPosition {
17702 #[doc = "< Touch X"]
17703 pub px: u16_,
17704 #[doc = "< Touch Y"]
17705 pub py: u16_,
17706}
17707#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17708const _: () = {
17709 ["Size of touchPosition"][::core::mem::size_of::<touchPosition>() - 4usize];
17710 ["Alignment of touchPosition"][::core::mem::align_of::<touchPosition>() - 2usize];
17711 ["Offset of field: touchPosition::px"][::core::mem::offset_of!(touchPosition, px) - 0usize];
17712 ["Offset of field: touchPosition::py"][::core::mem::offset_of!(touchPosition, py) - 2usize];
17713};
17714#[doc = "Circle Pad position."]
17715#[repr(C)]
17716#[derive(Debug, Default, Copy, Clone)]
17717pub struct circlePosition {
17718 #[doc = "< Pad X"]
17719 pub dx: s16,
17720 #[doc = "< Pad Y"]
17721 pub dy: s16,
17722}
17723#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17724const _: () = {
17725 ["Size of circlePosition"][::core::mem::size_of::<circlePosition>() - 4usize];
17726 ["Alignment of circlePosition"][::core::mem::align_of::<circlePosition>() - 2usize];
17727 ["Offset of field: circlePosition::dx"][::core::mem::offset_of!(circlePosition, dx) - 0usize];
17728 ["Offset of field: circlePosition::dy"][::core::mem::offset_of!(circlePosition, dy) - 2usize];
17729};
17730#[doc = "Accelerometer vector."]
17731#[repr(C)]
17732#[derive(Debug, Default, Copy, Clone)]
17733pub struct accelVector {
17734 #[doc = "< Accelerometer X"]
17735 pub x: s16,
17736 #[doc = "< Accelerometer Y"]
17737 pub y: s16,
17738 #[doc = "< Accelerometer Z"]
17739 pub z: s16,
17740}
17741#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17742const _: () = {
17743 ["Size of accelVector"][::core::mem::size_of::<accelVector>() - 6usize];
17744 ["Alignment of accelVector"][::core::mem::align_of::<accelVector>() - 2usize];
17745 ["Offset of field: accelVector::x"][::core::mem::offset_of!(accelVector, x) - 0usize];
17746 ["Offset of field: accelVector::y"][::core::mem::offset_of!(accelVector, y) - 2usize];
17747 ["Offset of field: accelVector::z"][::core::mem::offset_of!(accelVector, z) - 4usize];
17748};
17749#[doc = "Gyroscope angular rate."]
17750#[repr(C)]
17751#[derive(Debug, Default, Copy, Clone)]
17752pub struct angularRate {
17753 #[doc = "< Roll"]
17754 pub x: s16,
17755 #[doc = "< Yaw"]
17756 pub z: s16,
17757 #[doc = "< Pitch"]
17758 pub y: s16,
17759}
17760#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17761const _: () = {
17762 ["Size of angularRate"][::core::mem::size_of::<angularRate>() - 6usize];
17763 ["Alignment of angularRate"][::core::mem::align_of::<angularRate>() - 2usize];
17764 ["Offset of field: angularRate::x"][::core::mem::offset_of!(angularRate, x) - 0usize];
17765 ["Offset of field: angularRate::z"][::core::mem::offset_of!(angularRate, z) - 2usize];
17766 ["Offset of field: angularRate::y"][::core::mem::offset_of!(angularRate, y) - 4usize];
17767};
17768#[doc = "< Event signaled by HID-module, when the sharedmem+0(PAD/circle-pad)/+0xA8(touch-screen) region was updated."]
17769pub const HIDEVENT_PAD0: HID_Event = 0;
17770#[doc = "< Event signaled by HID-module, when the sharedmem+0(PAD/circle-pad)/+0xA8(touch-screen) region was updated."]
17771pub const HIDEVENT_PAD1: HID_Event = 1;
17772#[doc = "< Event signaled by HID-module, when the sharedmem accelerometer state was updated."]
17773pub const HIDEVENT_Accel: HID_Event = 2;
17774#[doc = "< Event signaled by HID-module, when the sharedmem gyroscope state was updated."]
17775pub const HIDEVENT_Gyro: HID_Event = 3;
17776#[doc = "< Event signaled by HID-module, when the sharedmem DebugPad state was updated."]
17777pub const HIDEVENT_DebugPad: HID_Event = 4;
17778#[doc = "< Used to know how many events there are."]
17779pub const HIDEVENT_MAX: HID_Event = 5;
17780#[doc = "HID events."]
17781pub type HID_Event = ::libc::c_uchar;
17782unsafe extern "C" {
17783 #[doc = "< HID shared memory handle."]
17784 pub static mut hidMemHandle: Handle;
17785}
17786unsafe extern "C" {
17787 #[doc = "< HID shared memory."]
17788 pub static mut hidSharedMem: *mut vu32;
17789}
17790unsafe extern "C" {
17791 #[must_use]
17792 #[doc = "Initializes HID."]
17793 pub fn hidInit() -> Result;
17794}
17795unsafe extern "C" {
17796 #[doc = "Exits HID."]
17797 pub fn hidExit();
17798}
17799unsafe extern "C" {
17800 #[doc = "Sets the key repeat parameters for hidKeysRepeat.\n # Arguments\n\n* `delay` - Initial delay.\n * `interval` - Repeat interval."]
17801 pub fn hidSetRepeatParameters(delay: u32_, interval: u32_);
17802}
17803unsafe extern "C" {
17804 #[doc = "Scans HID for input data."]
17805 pub fn hidScanInput();
17806}
17807unsafe extern "C" {
17808 #[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)."]
17809 pub fn hidKeysHeld() -> u32_;
17810}
17811unsafe extern "C" {
17812 #[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."]
17813 pub fn hidKeysDown() -> u32_;
17814}
17815unsafe extern "C" {
17816 #[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."]
17817 pub fn hidKeysDownRepeat() -> u32_;
17818}
17819unsafe extern "C" {
17820 #[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."]
17821 pub fn hidKeysUp() -> u32_;
17822}
17823unsafe extern "C" {
17824 #[doc = "Reads the current touch position.\n # Arguments\n\n* `pos` - Pointer to output the touch position to."]
17825 pub fn hidTouchRead(pos: *mut touchPosition);
17826}
17827unsafe extern "C" {
17828 #[doc = "Reads the current circle pad position.\n # Arguments\n\n* `pos` - Pointer to output the circle pad position to."]
17829 pub fn hidCircleRead(pos: *mut circlePosition);
17830}
17831unsafe extern "C" {
17832 #[doc = "Reads the current accelerometer data.\n # Arguments\n\n* `vector` - Pointer to output the accelerometer data to."]
17833 pub fn hidAccelRead(vector: *mut accelVector);
17834}
17835unsafe extern "C" {
17836 #[doc = "Reads the current gyroscope data.\n # Arguments\n\n* `rate` - Pointer to output the gyroscope data to."]
17837 pub fn hidGyroRead(rate: *mut angularRate);
17838}
17839unsafe extern "C" {
17840 #[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."]
17841 pub fn hidWaitForEvent(id: HID_Event, nextEvent: bool);
17842}
17843unsafe extern "C" {
17844 #[must_use]
17845 #[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."]
17846 pub fn hidWaitForAnyEvent(nextEvents: bool, cancelEvent: Handle, timeout: s64) -> Result;
17847}
17848unsafe extern "C" {
17849 #[must_use]
17850 #[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."]
17851 pub fn HIDUSER_GetHandles(
17852 outMemHandle: *mut Handle,
17853 eventpad0: *mut Handle,
17854 eventpad1: *mut Handle,
17855 eventaccel: *mut Handle,
17856 eventgyro: *mut Handle,
17857 eventdebugpad: *mut Handle,
17858 ) -> Result;
17859}
17860unsafe extern "C" {
17861 #[must_use]
17862 #[doc = "Enables the accelerometer."]
17863 pub fn HIDUSER_EnableAccelerometer() -> Result;
17864}
17865unsafe extern "C" {
17866 #[must_use]
17867 #[doc = "Disables the accelerometer."]
17868 pub fn HIDUSER_DisableAccelerometer() -> Result;
17869}
17870unsafe extern "C" {
17871 #[must_use]
17872 #[doc = "Enables the gyroscope."]
17873 pub fn HIDUSER_EnableGyroscope() -> Result;
17874}
17875unsafe extern "C" {
17876 #[must_use]
17877 #[doc = "Disables the gyroscope."]
17878 pub fn HIDUSER_DisableGyroscope() -> Result;
17879}
17880unsafe extern "C" {
17881 #[must_use]
17882 #[doc = "Gets the gyroscope raw to dps coefficient.\n # Arguments\n\n* `coeff` - Pointer to output the coefficient to."]
17883 pub fn HIDUSER_GetGyroscopeRawToDpsCoefficient(coeff: *mut f32) -> Result;
17884}
17885unsafe extern "C" {
17886 #[must_use]
17887 #[doc = "Gets the current volume slider value. (0-63)\n # Arguments\n\n* `volume` - Pointer to write the volume slider value to."]
17888 pub fn HIDUSER_GetSoundVolume(volume: *mut u8_) -> Result;
17889}
17890unsafe extern "C" {
17891 #[doc = "IRRST's shared memory handle."]
17892 pub static mut irrstMemHandle: Handle;
17893}
17894unsafe extern "C" {
17895 #[doc = "IRRST's shared memory."]
17896 pub static mut irrstSharedMem: *mut vu32;
17897}
17898unsafe extern "C" {
17899 #[doc = "IRRST's state update event"]
17900 pub static mut irrstEvent: Handle;
17901}
17902unsafe extern "C" {
17903 #[must_use]
17904 #[doc = "Initializes IRRST."]
17905 pub fn irrstInit() -> Result;
17906}
17907unsafe extern "C" {
17908 #[doc = "Exits IRRST."]
17909 pub fn irrstExit();
17910}
17911unsafe extern "C" {
17912 #[doc = "Scans IRRST for input."]
17913 pub fn irrstScanInput();
17914}
17915unsafe extern "C" {
17916 #[doc = "Gets IRRST's held keys.\n # Returns\n\nIRRST's held keys."]
17917 pub fn irrstKeysHeld() -> u32_;
17918}
17919unsafe extern "C" {
17920 #[doc = "Reads the current c-stick position.\n # Arguments\n\n* `pos` - Pointer to output the current c-stick position to."]
17921 pub fn irrstCstickRead(pos: *mut circlePosition);
17922}
17923unsafe extern "C" {
17924 #[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."]
17925 pub fn irrstWaitForEvent(nextEvent: bool);
17926}
17927unsafe extern "C" {
17928 #[must_use]
17929 #[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."]
17930 pub fn IRRST_GetHandles(outMemHandle: *mut Handle, outEventHandle: *mut Handle) -> Result;
17931}
17932unsafe extern "C" {
17933 #[must_use]
17934 #[doc = "Initializes IRRST.\n # Arguments\n\n* `unk1` - Unknown.\n * `unk2` - Unknown."]
17935 pub fn IRRST_Initialize(unk1: u32_, unk2: u8_) -> Result;
17936}
17937unsafe extern "C" {
17938 #[must_use]
17939 #[doc = "Shuts down IRRST."]
17940 pub fn IRRST_Shutdown() -> Result;
17941}
17942#[doc = "sslc context."]
17943#[repr(C)]
17944#[derive(Debug, Default, Copy, Clone)]
17945pub struct sslcContext {
17946 #[doc = "< Service handle."]
17947 pub servhandle: Handle,
17948 #[doc = "< SSLC handle."]
17949 pub sslchandle: u32_,
17950 pub sharedmem_handle: Handle,
17951}
17952#[allow(clippy::unnecessary_operation, clippy::identity_op)]
17953const _: () = {
17954 ["Size of sslcContext"][::core::mem::size_of::<sslcContext>() - 12usize];
17955 ["Alignment of sslcContext"][::core::mem::align_of::<sslcContext>() - 4usize];
17956 ["Offset of field: sslcContext::servhandle"]
17957 [::core::mem::offset_of!(sslcContext, servhandle) - 0usize];
17958 ["Offset of field: sslcContext::sslchandle"]
17959 [::core::mem::offset_of!(sslcContext, sslchandle) - 4usize];
17960 ["Offset of field: sslcContext::sharedmem_handle"]
17961 [::core::mem::offset_of!(sslcContext, sharedmem_handle) - 8usize];
17962};
17963pub const SSLC_DefaultRootCert_Nintendo_CA: SSLC_DefaultRootCert = 1;
17964pub const SSLC_DefaultRootCert_Nintendo_CA_G2: SSLC_DefaultRootCert = 2;
17965pub const SSLC_DefaultRootCert_Nintendo_CA_G3: SSLC_DefaultRootCert = 3;
17966pub const SSLC_DefaultRootCert_Nintendo_Class2_CA: SSLC_DefaultRootCert = 4;
17967pub const SSLC_DefaultRootCert_Nintendo_Class2_CA_G2: SSLC_DefaultRootCert = 5;
17968pub const SSLC_DefaultRootCert_Nintendo_Class2_CA_G3: SSLC_DefaultRootCert = 6;
17969pub const SSLC_DefaultRootCert_CyberTrust: SSLC_DefaultRootCert = 7;
17970pub const SSLC_DefaultRootCert_AddTrust_External_CA: SSLC_DefaultRootCert = 8;
17971pub const SSLC_DefaultRootCert_COMODO: SSLC_DefaultRootCert = 9;
17972pub const SSLC_DefaultRootCert_USERTrust: SSLC_DefaultRootCert = 10;
17973pub const SSLC_DefaultRootCert_DigiCert_EV: SSLC_DefaultRootCert = 11;
17974pub type SSLC_DefaultRootCert = ::libc::c_uchar;
17975pub const SSLC_DefaultClientCert_ClCertA: SSLC_DefaultClientCert = 64;
17976pub type SSLC_DefaultClientCert = ::libc::c_uchar;
17977pub const SSLCOPT_Default: _bindgen_ty_24 = 0;
17978pub const SSLCOPT_DisableVerify: _bindgen_ty_24 = 512;
17979pub const SSLCOPT_TLSv10: _bindgen_ty_24 = 2048;
17980#[doc = "sslc options. https://www.3dbrew.org/wiki/SSL_Services#SSLOpt"]
17981pub type _bindgen_ty_24 = ::libc::c_ushort;
17982unsafe extern "C" {
17983 #[must_use]
17984 #[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."]
17985 pub fn sslcInit(session_handle: Handle) -> Result;
17986}
17987unsafe extern "C" {
17988 #[doc = "Exits SSLC."]
17989 pub fn sslcExit();
17990}
17991unsafe extern "C" {
17992 #[must_use]
17993 #[doc = "Creates a RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - Output contexthandle."]
17994 pub fn sslcCreateRootCertChain(RootCertChain_contexthandle: *mut u32_) -> Result;
17995}
17996unsafe extern "C" {
17997 #[must_use]
17998 #[doc = "Destroys a RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - RootCertChain contexthandle."]
17999 pub fn sslcDestroyRootCertChain(RootCertChain_contexthandle: u32_) -> Result;
18000}
18001unsafe extern "C" {
18002 #[must_use]
18003 #[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."]
18004 pub fn sslcAddTrustedRootCA(
18005 RootCertChain_contexthandle: u32_,
18006 cert: *const u8_,
18007 certsize: u32_,
18008 cert_contexthandle: *mut u32_,
18009 ) -> Result;
18010}
18011unsafe extern "C" {
18012 #[must_use]
18013 #[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."]
18014 pub fn sslcRootCertChainAddDefaultCert(
18015 RootCertChain_contexthandle: u32_,
18016 certID: SSLC_DefaultRootCert,
18017 cert_contexthandle: *mut u32_,
18018 ) -> Result;
18019}
18020unsafe extern "C" {
18021 #[must_use]
18022 #[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."]
18023 pub fn sslcRootCertChainRemoveCert(
18024 RootCertChain_contexthandle: u32_,
18025 cert_contexthandle: u32_,
18026 ) -> Result;
18027}
18028unsafe extern "C" {
18029 #[must_use]
18030 #[doc = "Creates an unknown CertChain.\n # Arguments\n\n* `CertChain_contexthandle` - Output contexthandle."]
18031 pub fn sslcCreate8CertChain(CertChain_contexthandle: *mut u32_) -> Result;
18032}
18033unsafe extern "C" {
18034 #[must_use]
18035 #[doc = "Destroys a CertChain from sslcCreate8CertChain().\n # Arguments\n\n* `CertChain_contexthandle` - CertChain contexthandle."]
18036 pub fn sslcDestroy8CertChain(CertChain_contexthandle: u32_) -> Result;
18037}
18038unsafe extern "C" {
18039 #[must_use]
18040 #[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."]
18041 pub fn sslc8CertChainAddCert(
18042 CertChain_contexthandle: u32_,
18043 cert: *const u8_,
18044 certsize: u32_,
18045 cert_contexthandle: *mut u32_,
18046 ) -> Result;
18047}
18048unsafe extern "C" {
18049 #[must_use]
18050 #[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."]
18051 pub fn sslc8CertChainAddDefaultCert(
18052 CertChain_contexthandle: u32_,
18053 certID: u8_,
18054 cert_contexthandle: *mut u32_,
18055 ) -> Result;
18056}
18057unsafe extern "C" {
18058 #[must_use]
18059 #[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."]
18060 pub fn sslc8CertChainRemoveCert(
18061 CertChain_contexthandle: u32_,
18062 cert_contexthandle: u32_,
18063 ) -> Result;
18064}
18065unsafe extern "C" {
18066 #[must_use]
18067 #[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."]
18068 pub fn sslcOpenClientCertContext(
18069 cert: *const u8_,
18070 certsize: u32_,
18071 key: *const u8_,
18072 keysize: u32_,
18073 ClientCert_contexthandle: *mut u32_,
18074 ) -> Result;
18075}
18076unsafe extern "C" {
18077 #[must_use]
18078 #[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."]
18079 pub fn sslcOpenDefaultClientCertContext(
18080 certID: SSLC_DefaultClientCert,
18081 ClientCert_contexthandle: *mut u32_,
18082 ) -> Result;
18083}
18084unsafe extern "C" {
18085 #[must_use]
18086 #[doc = "Closes the specified ClientCert-context.\n # Arguments\n\n* `ClientCert_contexthandle` - ClientCert-context to use."]
18087 pub fn sslcCloseClientCertContext(ClientCert_contexthandle: u32_) -> Result;
18088}
18089unsafe extern "C" {
18090 #[must_use]
18091 #[doc = "This uses ps:ps SeedRNG internally."]
18092 pub fn sslcSeedRNG() -> Result;
18093}
18094unsafe extern "C" {
18095 #[must_use]
18096 #[doc = "This uses ps:ps GenerateRandomData internally.\n # Arguments\n\n* `buf` - Output buffer.\n * `size` - Output size."]
18097 pub fn sslcGenerateRandomData(buf: *mut u8_, size: u32_) -> Result;
18098}
18099unsafe extern "C" {
18100 #[must_use]
18101 #[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."]
18102 pub fn sslcCreateContext(
18103 context: *mut sslcContext,
18104 sockfd: ::libc::c_int,
18105 input_opt: u32_,
18106 hostname: *const ::libc::c_char,
18107 ) -> Result;
18108}
18109unsafe extern "C" {
18110 #[must_use]
18111 pub fn sslcDestroyContext(context: *mut sslcContext) -> Result;
18112}
18113unsafe extern "C" {
18114 #[must_use]
18115 pub fn sslcStartConnection(
18116 context: *mut sslcContext,
18117 internal_retval: *mut ::libc::c_int,
18118 out: *mut u32_,
18119 ) -> Result;
18120}
18121unsafe extern "C" {
18122 #[must_use]
18123 pub fn sslcRead(
18124 context: *mut sslcContext,
18125 buf: *mut ::libc::c_void,
18126 len: usize,
18127 peek: bool,
18128 ) -> Result;
18129}
18130unsafe extern "C" {
18131 #[must_use]
18132 pub fn sslcWrite(context: *mut sslcContext, buf: *const ::libc::c_void, len: usize) -> Result;
18133}
18134unsafe extern "C" {
18135 #[must_use]
18136 pub fn sslcContextSetRootCertChain(context: *mut sslcContext, handle: u32_) -> Result;
18137}
18138unsafe extern "C" {
18139 #[must_use]
18140 pub fn sslcContextSetClientCert(context: *mut sslcContext, handle: u32_) -> Result;
18141}
18142unsafe extern "C" {
18143 #[must_use]
18144 pub fn sslcContextSetHandle8(context: *mut sslcContext, handle: u32_) -> Result;
18145}
18146unsafe extern "C" {
18147 #[must_use]
18148 pub fn sslcContextClearOpt(context: *mut sslcContext, bitmask: u32_) -> Result;
18149}
18150unsafe extern "C" {
18151 #[must_use]
18152 pub fn sslcContextGetProtocolCipher(
18153 context: *mut sslcContext,
18154 outprotocols: *mut ::libc::c_char,
18155 outprotocols_maxsize: u32_,
18156 outcipher: *mut ::libc::c_char,
18157 outcipher_maxsize: u32_,
18158 ) -> Result;
18159}
18160unsafe extern "C" {
18161 #[must_use]
18162 pub fn sslcContextGetState(context: *mut sslcContext, out: *mut u32_) -> Result;
18163}
18164unsafe extern "C" {
18165 #[must_use]
18166 pub fn sslcContextInitSharedmem(context: *mut sslcContext, buf: *mut u8_, size: u32_)
18167 -> Result;
18168}
18169unsafe extern "C" {
18170 #[must_use]
18171 pub fn sslcAddCert(context: *mut sslcContext, buf: *const u8_, size: u32_) -> Result;
18172}
18173#[doc = "HTTP context."]
18174#[repr(C)]
18175#[derive(Debug, Default, Copy, Clone)]
18176pub struct httpcContext {
18177 #[doc = "< Service handle."]
18178 pub servhandle: Handle,
18179 #[doc = "< HTTP handle."]
18180 pub httphandle: u32_,
18181}
18182#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18183const _: () = {
18184 ["Size of httpcContext"][::core::mem::size_of::<httpcContext>() - 8usize];
18185 ["Alignment of httpcContext"][::core::mem::align_of::<httpcContext>() - 4usize];
18186 ["Offset of field: httpcContext::servhandle"]
18187 [::core::mem::offset_of!(httpcContext, servhandle) - 0usize];
18188 ["Offset of field: httpcContext::httphandle"]
18189 [::core::mem::offset_of!(httpcContext, httphandle) - 4usize];
18190};
18191pub const HTTPC_METHOD_GET: HTTPC_RequestMethod = 1;
18192pub const HTTPC_METHOD_POST: HTTPC_RequestMethod = 2;
18193pub const HTTPC_METHOD_HEAD: HTTPC_RequestMethod = 3;
18194pub const HTTPC_METHOD_PUT: HTTPC_RequestMethod = 4;
18195pub const HTTPC_METHOD_DELETE: HTTPC_RequestMethod = 5;
18196#[doc = "HTTP request method."]
18197pub type HTTPC_RequestMethod = ::libc::c_uchar;
18198#[doc = "< Request in progress."]
18199pub const HTTPC_STATUS_REQUEST_IN_PROGRESS: HTTPC_RequestStatus = 5;
18200#[doc = "< Download ready."]
18201pub const HTTPC_STATUS_DOWNLOAD_READY: HTTPC_RequestStatus = 7;
18202#[doc = "HTTP request status."]
18203pub type HTTPC_RequestStatus = ::libc::c_uchar;
18204pub const HTTPC_KEEPALIVE_DISABLED: HTTPC_KeepAlive = 0;
18205pub const HTTPC_KEEPALIVE_ENABLED: HTTPC_KeepAlive = 1;
18206#[doc = "HTTP KeepAlive option."]
18207pub type HTTPC_KeepAlive = ::libc::c_uchar;
18208unsafe extern "C" {
18209 #[must_use]
18210 #[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."]
18211 pub fn httpcInit(sharedmem_size: u32_) -> Result;
18212}
18213unsafe extern "C" {
18214 #[doc = "Exits HTTPC."]
18215 pub fn httpcExit();
18216}
18217unsafe extern "C" {
18218 #[must_use]
18219 #[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)"]
18220 pub fn httpcOpenContext(
18221 context: *mut httpcContext,
18222 method: HTTPC_RequestMethod,
18223 url: *const ::libc::c_char,
18224 use_defaultproxy: u32_,
18225 ) -> Result;
18226}
18227unsafe extern "C" {
18228 #[must_use]
18229 #[doc = "Closes a HTTP context.\n # Arguments\n\n* `context` - Context to close."]
18230 pub fn httpcCloseContext(context: *mut httpcContext) -> Result;
18231}
18232unsafe extern "C" {
18233 #[must_use]
18234 #[doc = "Cancels a HTTP connection.\n # Arguments\n\n* `context` - Context to close."]
18235 pub fn httpcCancelConnection(context: *mut httpcContext) -> Result;
18236}
18237unsafe extern "C" {
18238 #[must_use]
18239 #[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."]
18240 pub fn httpcAddRequestHeaderField(
18241 context: *mut httpcContext,
18242 name: *const ::libc::c_char,
18243 value: *const ::libc::c_char,
18244 ) -> Result;
18245}
18246unsafe extern "C" {
18247 #[must_use]
18248 #[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."]
18249 pub fn httpcAddPostDataAscii(
18250 context: *mut httpcContext,
18251 name: *const ::libc::c_char,
18252 value: *const ::libc::c_char,
18253 ) -> Result;
18254}
18255unsafe extern "C" {
18256 #[must_use]
18257 #[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."]
18258 pub fn httpcAddPostDataBinary(
18259 context: *mut httpcContext,
18260 name: *const ::libc::c_char,
18261 value: *const u8_,
18262 len: u32_,
18263 ) -> Result;
18264}
18265unsafe extern "C" {
18266 #[must_use]
18267 #[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."]
18268 pub fn httpcAddPostDataRaw(context: *mut httpcContext, data: *const u32_, len: u32_) -> Result;
18269}
18270unsafe extern "C" {
18271 #[must_use]
18272 #[doc = "Begins a HTTP request.\n # Arguments\n\n* `context` - Context to use."]
18273 pub fn httpcBeginRequest(context: *mut httpcContext) -> Result;
18274}
18275unsafe extern "C" {
18276 #[must_use]
18277 #[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."]
18278 pub fn httpcReceiveData(context: *mut httpcContext, buffer: *mut u8_, size: u32_) -> Result;
18279}
18280unsafe extern "C" {
18281 #[must_use]
18282 #[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."]
18283 pub fn httpcReceiveDataTimeout(
18284 context: *mut httpcContext,
18285 buffer: *mut u8_,
18286 size: u32_,
18287 timeout: u64_,
18288 ) -> Result;
18289}
18290unsafe extern "C" {
18291 #[must_use]
18292 #[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."]
18293 pub fn httpcGetRequestState(
18294 context: *mut httpcContext,
18295 out: *mut HTTPC_RequestStatus,
18296 ) -> Result;
18297}
18298unsafe extern "C" {
18299 #[must_use]
18300 #[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."]
18301 pub fn httpcGetDownloadSizeState(
18302 context: *mut httpcContext,
18303 downloadedsize: *mut u32_,
18304 contentsize: *mut u32_,
18305 ) -> Result;
18306}
18307unsafe extern "C" {
18308 #[must_use]
18309 #[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."]
18310 pub fn httpcGetResponseStatusCode(context: *mut httpcContext, out: *mut u32_) -> Result;
18311}
18312unsafe extern "C" {
18313 #[must_use]
18314 #[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."]
18315 pub fn httpcGetResponseStatusCodeTimeout(
18316 context: *mut httpcContext,
18317 out: *mut u32_,
18318 timeout: u64_,
18319 ) -> Result;
18320}
18321unsafe extern "C" {
18322 #[must_use]
18323 #[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."]
18324 pub fn httpcGetResponseHeader(
18325 context: *mut httpcContext,
18326 name: *const ::libc::c_char,
18327 value: *mut ::libc::c_char,
18328 valuebuf_maxsize: u32_,
18329 ) -> Result;
18330}
18331unsafe extern "C" {
18332 #[must_use]
18333 #[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."]
18334 pub fn httpcAddTrustedRootCA(
18335 context: *mut httpcContext,
18336 cert: *const u8_,
18337 certsize: u32_,
18338 ) -> Result;
18339}
18340unsafe extern "C" {
18341 #[must_use]
18342 #[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."]
18343 pub fn httpcAddDefaultCert(context: *mut httpcContext, certID: SSLC_DefaultRootCert) -> Result;
18344}
18345unsafe extern "C" {
18346 #[must_use]
18347 #[doc = "Sets the RootCertChain for a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `RootCertChain_contexthandle` - Contexthandle for the RootCertChain."]
18348 pub fn httpcSelectRootCertChain(
18349 context: *mut httpcContext,
18350 RootCertChain_contexthandle: u32_,
18351 ) -> Result;
18352}
18353unsafe extern "C" {
18354 #[must_use]
18355 #[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."]
18356 pub fn httpcSetClientCert(
18357 context: *mut httpcContext,
18358 cert: *const u8_,
18359 certsize: u32_,
18360 privk: *const u8_,
18361 privk_size: u32_,
18362 ) -> Result;
18363}
18364unsafe extern "C" {
18365 #[must_use]
18366 #[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."]
18367 pub fn httpcSetClientCertDefault(
18368 context: *mut httpcContext,
18369 certID: SSLC_DefaultClientCert,
18370 ) -> Result;
18371}
18372unsafe extern "C" {
18373 #[must_use]
18374 #[doc = "Sets the ClientCert contexthandle for a HTTP context.\n # Arguments\n\n* `context` - Context to use.\n * `ClientCert_contexthandle` - Contexthandle for the ClientCert."]
18375 pub fn httpcSetClientCertContext(
18376 context: *mut httpcContext,
18377 ClientCert_contexthandle: u32_,
18378 ) -> Result;
18379}
18380unsafe extern "C" {
18381 #[must_use]
18382 #[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."]
18383 pub fn httpcSetSSLOpt(context: *mut httpcContext, options: u32_) -> Result;
18384}
18385unsafe extern "C" {
18386 #[must_use]
18387 #[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."]
18388 pub fn httpcSetSSLClearOpt(context: *mut httpcContext, options: u32_) -> Result;
18389}
18390unsafe extern "C" {
18391 #[must_use]
18392 #[doc = "Creates a RootCertChain. Up to 2 RootCertChains can be created under this user-process.\n # Arguments\n\n* `RootCertChain_contexthandle` - Output RootCertChain contexthandle."]
18393 pub fn httpcCreateRootCertChain(RootCertChain_contexthandle: *mut u32_) -> Result;
18394}
18395unsafe extern "C" {
18396 #[must_use]
18397 #[doc = "Destroy a RootCertChain.\n # Arguments\n\n* `RootCertChain_contexthandle` - RootCertChain to use."]
18398 pub fn httpcDestroyRootCertChain(RootCertChain_contexthandle: u32_) -> Result;
18399}
18400unsafe extern "C" {
18401 #[must_use]
18402 #[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)."]
18403 pub fn httpcRootCertChainAddCert(
18404 RootCertChain_contexthandle: u32_,
18405 cert: *const u8_,
18406 certsize: u32_,
18407 cert_contexthandle: *mut u32_,
18408 ) -> Result;
18409}
18410unsafe extern "C" {
18411 #[must_use]
18412 #[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)."]
18413 pub fn httpcRootCertChainAddDefaultCert(
18414 RootCertChain_contexthandle: u32_,
18415 certID: SSLC_DefaultRootCert,
18416 cert_contexthandle: *mut u32_,
18417 ) -> Result;
18418}
18419unsafe extern "C" {
18420 #[must_use]
18421 #[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."]
18422 pub fn httpcRootCertChainRemoveCert(
18423 RootCertChain_contexthandle: u32_,
18424 cert_contexthandle: u32_,
18425 ) -> Result;
18426}
18427unsafe extern "C" {
18428 #[must_use]
18429 #[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."]
18430 pub fn httpcOpenClientCertContext(
18431 cert: *const u8_,
18432 certsize: u32_,
18433 privk: *const u8_,
18434 privk_size: u32_,
18435 ClientCert_contexthandle: *mut u32_,
18436 ) -> Result;
18437}
18438unsafe extern "C" {
18439 #[must_use]
18440 #[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."]
18441 pub fn httpcOpenDefaultClientCertContext(
18442 certID: SSLC_DefaultClientCert,
18443 ClientCert_contexthandle: *mut u32_,
18444 ) -> Result;
18445}
18446unsafe extern "C" {
18447 #[must_use]
18448 #[doc = "Closes a ClientCert context.\n # Arguments\n\n* `ClientCert_contexthandle` - ClientCert context to use."]
18449 pub fn httpcCloseClientCertContext(ClientCert_contexthandle: u32_) -> Result;
18450}
18451unsafe extern "C" {
18452 #[must_use]
18453 #[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."]
18454 pub fn httpcDownloadData(
18455 context: *mut httpcContext,
18456 buffer: *mut u8_,
18457 size: u32_,
18458 downloadedsize: *mut u32_,
18459 ) -> Result;
18460}
18461unsafe extern "C" {
18462 #[must_use]
18463 #[doc = "Sets Keep-Alive for the context.\n # Arguments\n\n* `context` - Context to set the KeepAlive flag on.\n * `option` - HTTPC_KeepAlive option."]
18464 pub fn httpcSetKeepAlive(context: *mut httpcContext, option: HTTPC_KeepAlive) -> Result;
18465}
18466#[doc = "Node info struct."]
18467#[repr(C)]
18468#[derive(Copy, Clone)]
18469pub struct udsNodeInfo {
18470 pub uds_friendcodeseed: u64_,
18471 pub __bindgen_anon_1: udsNodeInfo__bindgen_ty_1,
18472 pub NetworkNodeID: u16_,
18473 pub pad_x22: u16_,
18474 pub word_x24: u32_,
18475}
18476#[repr(C)]
18477#[derive(Copy, Clone)]
18478pub union udsNodeInfo__bindgen_ty_1 {
18479 pub usercfg: [u8_; 24usize],
18480 pub __bindgen_anon_1: udsNodeInfo__bindgen_ty_1__bindgen_ty_1,
18481}
18482#[repr(C)]
18483#[derive(Debug, Default, Copy, Clone)]
18484pub struct udsNodeInfo__bindgen_ty_1__bindgen_ty_1 {
18485 pub username: [u16_; 10usize],
18486 pub unk_x1c: u16_,
18487 pub flag: u8_,
18488 pub pad_x1f: u8_,
18489}
18490#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18491const _: () = {
18492 ["Size of udsNodeInfo__bindgen_ty_1__bindgen_ty_1"]
18493 [::core::mem::size_of::<udsNodeInfo__bindgen_ty_1__bindgen_ty_1>() - 24usize];
18494 ["Alignment of udsNodeInfo__bindgen_ty_1__bindgen_ty_1"]
18495 [::core::mem::align_of::<udsNodeInfo__bindgen_ty_1__bindgen_ty_1>() - 2usize];
18496 ["Offset of field: udsNodeInfo__bindgen_ty_1__bindgen_ty_1::username"]
18497 [::core::mem::offset_of!(udsNodeInfo__bindgen_ty_1__bindgen_ty_1, username) - 0usize];
18498 ["Offset of field: udsNodeInfo__bindgen_ty_1__bindgen_ty_1::unk_x1c"]
18499 [::core::mem::offset_of!(udsNodeInfo__bindgen_ty_1__bindgen_ty_1, unk_x1c) - 20usize];
18500 ["Offset of field: udsNodeInfo__bindgen_ty_1__bindgen_ty_1::flag"]
18501 [::core::mem::offset_of!(udsNodeInfo__bindgen_ty_1__bindgen_ty_1, flag) - 22usize];
18502 ["Offset of field: udsNodeInfo__bindgen_ty_1__bindgen_ty_1::pad_x1f"]
18503 [::core::mem::offset_of!(udsNodeInfo__bindgen_ty_1__bindgen_ty_1, pad_x1f) - 23usize];
18504};
18505#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18506const _: () = {
18507 ["Size of udsNodeInfo__bindgen_ty_1"]
18508 [::core::mem::size_of::<udsNodeInfo__bindgen_ty_1>() - 24usize];
18509 ["Alignment of udsNodeInfo__bindgen_ty_1"]
18510 [::core::mem::align_of::<udsNodeInfo__bindgen_ty_1>() - 2usize];
18511 ["Offset of field: udsNodeInfo__bindgen_ty_1::usercfg"]
18512 [::core::mem::offset_of!(udsNodeInfo__bindgen_ty_1, usercfg) - 0usize];
18513};
18514impl Default for udsNodeInfo__bindgen_ty_1 {
18515 fn default() -> Self {
18516 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
18517 unsafe {
18518 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
18519 s.assume_init()
18520 }
18521 }
18522}
18523#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18524const _: () = {
18525 ["Size of udsNodeInfo"][::core::mem::size_of::<udsNodeInfo>() - 40usize];
18526 ["Alignment of udsNodeInfo"][::core::mem::align_of::<udsNodeInfo>() - 8usize];
18527 ["Offset of field: udsNodeInfo::uds_friendcodeseed"]
18528 [::core::mem::offset_of!(udsNodeInfo, uds_friendcodeseed) - 0usize];
18529 ["Offset of field: udsNodeInfo::NetworkNodeID"]
18530 [::core::mem::offset_of!(udsNodeInfo, NetworkNodeID) - 32usize];
18531 ["Offset of field: udsNodeInfo::pad_x22"]
18532 [::core::mem::offset_of!(udsNodeInfo, pad_x22) - 34usize];
18533 ["Offset of field: udsNodeInfo::word_x24"]
18534 [::core::mem::offset_of!(udsNodeInfo, word_x24) - 36usize];
18535};
18536impl Default for udsNodeInfo {
18537 fn default() -> Self {
18538 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
18539 unsafe {
18540 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
18541 s.assume_init()
18542 }
18543 }
18544}
18545#[doc = "Connection status struct."]
18546#[repr(C)]
18547#[derive(Debug, Default, Copy, Clone)]
18548pub struct udsConnectionStatus {
18549 pub status: u32_,
18550 pub unk_x4: u32_,
18551 pub cur_NetworkNodeID: u16_,
18552 pub unk_xa: u16_,
18553 pub unk_xc: [u32_; 8usize],
18554 pub total_nodes: u8_,
18555 pub max_nodes: u8_,
18556 pub node_bitmask: u16_,
18557}
18558#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18559const _: () = {
18560 ["Size of udsConnectionStatus"][::core::mem::size_of::<udsConnectionStatus>() - 48usize];
18561 ["Alignment of udsConnectionStatus"][::core::mem::align_of::<udsConnectionStatus>() - 4usize];
18562 ["Offset of field: udsConnectionStatus::status"]
18563 [::core::mem::offset_of!(udsConnectionStatus, status) - 0usize];
18564 ["Offset of field: udsConnectionStatus::unk_x4"]
18565 [::core::mem::offset_of!(udsConnectionStatus, unk_x4) - 4usize];
18566 ["Offset of field: udsConnectionStatus::cur_NetworkNodeID"]
18567 [::core::mem::offset_of!(udsConnectionStatus, cur_NetworkNodeID) - 8usize];
18568 ["Offset of field: udsConnectionStatus::unk_xa"]
18569 [::core::mem::offset_of!(udsConnectionStatus, unk_xa) - 10usize];
18570 ["Offset of field: udsConnectionStatus::unk_xc"]
18571 [::core::mem::offset_of!(udsConnectionStatus, unk_xc) - 12usize];
18572 ["Offset of field: udsConnectionStatus::total_nodes"]
18573 [::core::mem::offset_of!(udsConnectionStatus, total_nodes) - 44usize];
18574 ["Offset of field: udsConnectionStatus::max_nodes"]
18575 [::core::mem::offset_of!(udsConnectionStatus, max_nodes) - 45usize];
18576 ["Offset of field: udsConnectionStatus::node_bitmask"]
18577 [::core::mem::offset_of!(udsConnectionStatus, node_bitmask) - 46usize];
18578};
18579#[doc = "Network struct stored as big-endian."]
18580#[repr(C)]
18581#[derive(Debug, Copy, Clone)]
18582pub struct udsNetworkStruct {
18583 pub host_macaddress: [u8_; 6usize],
18584 pub channel: u8_,
18585 pub pad_x7: u8_,
18586 pub initialized_flag: u8_,
18587 pub unk_x9: [u8_; 3usize],
18588 pub oui_value: [u8_; 3usize],
18589 pub oui_type: u8_,
18590 pub wlancommID: u32_,
18591 pub id8: u8_,
18592 pub unk_x15: u8_,
18593 pub attributes: u16_,
18594 pub networkID: u32_,
18595 pub total_nodes: u8_,
18596 pub max_nodes: u8_,
18597 pub unk_x1e: u8_,
18598 pub unk_x1f: u8_,
18599 pub unk_x20: [u8_; 31usize],
18600 pub appdata_size: u8_,
18601 pub appdata: [u8_; 200usize],
18602}
18603#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18604const _: () = {
18605 ["Size of udsNetworkStruct"][::core::mem::size_of::<udsNetworkStruct>() - 264usize];
18606 ["Alignment of udsNetworkStruct"][::core::mem::align_of::<udsNetworkStruct>() - 4usize];
18607 ["Offset of field: udsNetworkStruct::host_macaddress"]
18608 [::core::mem::offset_of!(udsNetworkStruct, host_macaddress) - 0usize];
18609 ["Offset of field: udsNetworkStruct::channel"]
18610 [::core::mem::offset_of!(udsNetworkStruct, channel) - 6usize];
18611 ["Offset of field: udsNetworkStruct::pad_x7"]
18612 [::core::mem::offset_of!(udsNetworkStruct, pad_x7) - 7usize];
18613 ["Offset of field: udsNetworkStruct::initialized_flag"]
18614 [::core::mem::offset_of!(udsNetworkStruct, initialized_flag) - 8usize];
18615 ["Offset of field: udsNetworkStruct::unk_x9"]
18616 [::core::mem::offset_of!(udsNetworkStruct, unk_x9) - 9usize];
18617 ["Offset of field: udsNetworkStruct::oui_value"]
18618 [::core::mem::offset_of!(udsNetworkStruct, oui_value) - 12usize];
18619 ["Offset of field: udsNetworkStruct::oui_type"]
18620 [::core::mem::offset_of!(udsNetworkStruct, oui_type) - 15usize];
18621 ["Offset of field: udsNetworkStruct::wlancommID"]
18622 [::core::mem::offset_of!(udsNetworkStruct, wlancommID) - 16usize];
18623 ["Offset of field: udsNetworkStruct::id8"]
18624 [::core::mem::offset_of!(udsNetworkStruct, id8) - 20usize];
18625 ["Offset of field: udsNetworkStruct::unk_x15"]
18626 [::core::mem::offset_of!(udsNetworkStruct, unk_x15) - 21usize];
18627 ["Offset of field: udsNetworkStruct::attributes"]
18628 [::core::mem::offset_of!(udsNetworkStruct, attributes) - 22usize];
18629 ["Offset of field: udsNetworkStruct::networkID"]
18630 [::core::mem::offset_of!(udsNetworkStruct, networkID) - 24usize];
18631 ["Offset of field: udsNetworkStruct::total_nodes"]
18632 [::core::mem::offset_of!(udsNetworkStruct, total_nodes) - 28usize];
18633 ["Offset of field: udsNetworkStruct::max_nodes"]
18634 [::core::mem::offset_of!(udsNetworkStruct, max_nodes) - 29usize];
18635 ["Offset of field: udsNetworkStruct::unk_x1e"]
18636 [::core::mem::offset_of!(udsNetworkStruct, unk_x1e) - 30usize];
18637 ["Offset of field: udsNetworkStruct::unk_x1f"]
18638 [::core::mem::offset_of!(udsNetworkStruct, unk_x1f) - 31usize];
18639 ["Offset of field: udsNetworkStruct::unk_x20"]
18640 [::core::mem::offset_of!(udsNetworkStruct, unk_x20) - 32usize];
18641 ["Offset of field: udsNetworkStruct::appdata_size"]
18642 [::core::mem::offset_of!(udsNetworkStruct, appdata_size) - 63usize];
18643 ["Offset of field: udsNetworkStruct::appdata"]
18644 [::core::mem::offset_of!(udsNetworkStruct, appdata) - 64usize];
18645};
18646impl Default for udsNetworkStruct {
18647 fn default() -> Self {
18648 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
18649 unsafe {
18650 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
18651 s.assume_init()
18652 }
18653 }
18654}
18655#[repr(C)]
18656#[derive(Debug, Default, Copy, Clone)]
18657pub struct udsBindContext {
18658 pub BindNodeID: u32_,
18659 pub event: Handle,
18660 pub spectator: bool,
18661}
18662#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18663const _: () = {
18664 ["Size of udsBindContext"][::core::mem::size_of::<udsBindContext>() - 12usize];
18665 ["Alignment of udsBindContext"][::core::mem::align_of::<udsBindContext>() - 4usize];
18666 ["Offset of field: udsBindContext::BindNodeID"]
18667 [::core::mem::offset_of!(udsBindContext, BindNodeID) - 0usize];
18668 ["Offset of field: udsBindContext::event"]
18669 [::core::mem::offset_of!(udsBindContext, event) - 4usize];
18670 ["Offset of field: udsBindContext::spectator"]
18671 [::core::mem::offset_of!(udsBindContext, spectator) - 8usize];
18672};
18673#[doc = "General NWM input structure used for AP scanning."]
18674#[repr(C)]
18675#[derive(Debug, Copy, Clone)]
18676pub struct nwmScanInputStruct {
18677 pub unk_x0: u16_,
18678 pub unk_x2: u16_,
18679 pub unk_x4: u16_,
18680 pub unk_x6: u16_,
18681 pub mac_address: [u8_; 6usize],
18682 pub unk_xe: [u8_; 38usize],
18683}
18684#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18685const _: () = {
18686 ["Size of nwmScanInputStruct"][::core::mem::size_of::<nwmScanInputStruct>() - 52usize];
18687 ["Alignment of nwmScanInputStruct"][::core::mem::align_of::<nwmScanInputStruct>() - 2usize];
18688 ["Offset of field: nwmScanInputStruct::unk_x0"]
18689 [::core::mem::offset_of!(nwmScanInputStruct, unk_x0) - 0usize];
18690 ["Offset of field: nwmScanInputStruct::unk_x2"]
18691 [::core::mem::offset_of!(nwmScanInputStruct, unk_x2) - 2usize];
18692 ["Offset of field: nwmScanInputStruct::unk_x4"]
18693 [::core::mem::offset_of!(nwmScanInputStruct, unk_x4) - 4usize];
18694 ["Offset of field: nwmScanInputStruct::unk_x6"]
18695 [::core::mem::offset_of!(nwmScanInputStruct, unk_x6) - 6usize];
18696 ["Offset of field: nwmScanInputStruct::mac_address"]
18697 [::core::mem::offset_of!(nwmScanInputStruct, mac_address) - 8usize];
18698 ["Offset of field: nwmScanInputStruct::unk_xe"]
18699 [::core::mem::offset_of!(nwmScanInputStruct, unk_xe) - 14usize];
18700};
18701impl Default for nwmScanInputStruct {
18702 fn default() -> Self {
18703 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
18704 unsafe {
18705 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
18706 s.assume_init()
18707 }
18708 }
18709}
18710#[doc = "General NWM output structure from AP scanning."]
18711#[repr(C)]
18712#[derive(Debug, Default, Copy, Clone)]
18713pub struct nwmBeaconDataReplyHeader {
18714 pub maxsize: u32_,
18715 pub size: u32_,
18716 pub total_entries: u32_,
18717}
18718#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18719const _: () = {
18720 ["Size of nwmBeaconDataReplyHeader"]
18721 [::core::mem::size_of::<nwmBeaconDataReplyHeader>() - 12usize];
18722 ["Alignment of nwmBeaconDataReplyHeader"]
18723 [::core::mem::align_of::<nwmBeaconDataReplyHeader>() - 4usize];
18724 ["Offset of field: nwmBeaconDataReplyHeader::maxsize"]
18725 [::core::mem::offset_of!(nwmBeaconDataReplyHeader, maxsize) - 0usize];
18726 ["Offset of field: nwmBeaconDataReplyHeader::size"]
18727 [::core::mem::offset_of!(nwmBeaconDataReplyHeader, size) - 4usize];
18728 ["Offset of field: nwmBeaconDataReplyHeader::total_entries"]
18729 [::core::mem::offset_of!(nwmBeaconDataReplyHeader, total_entries) - 8usize];
18730};
18731#[doc = "General NWM output structure from AP scanning, for each entry."]
18732#[repr(C)]
18733#[derive(Debug, Default, Copy, Clone)]
18734pub struct nwmBeaconDataReplyEntry {
18735 pub size: u32_,
18736 pub unk_x4: u8_,
18737 pub channel: u8_,
18738 pub unk_x6: u8_,
18739 pub unk_x7: u8_,
18740 pub mac_address: [u8_; 6usize],
18741 pub unk_xe: [u8_; 6usize],
18742 pub unk_x14: u32_,
18743 pub val_x1c: u32_,
18744}
18745#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18746const _: () = {
18747 ["Size of nwmBeaconDataReplyEntry"]
18748 [::core::mem::size_of::<nwmBeaconDataReplyEntry>() - 28usize];
18749 ["Alignment of nwmBeaconDataReplyEntry"]
18750 [::core::mem::align_of::<nwmBeaconDataReplyEntry>() - 4usize];
18751 ["Offset of field: nwmBeaconDataReplyEntry::size"]
18752 [::core::mem::offset_of!(nwmBeaconDataReplyEntry, size) - 0usize];
18753 ["Offset of field: nwmBeaconDataReplyEntry::unk_x4"]
18754 [::core::mem::offset_of!(nwmBeaconDataReplyEntry, unk_x4) - 4usize];
18755 ["Offset of field: nwmBeaconDataReplyEntry::channel"]
18756 [::core::mem::offset_of!(nwmBeaconDataReplyEntry, channel) - 5usize];
18757 ["Offset of field: nwmBeaconDataReplyEntry::unk_x6"]
18758 [::core::mem::offset_of!(nwmBeaconDataReplyEntry, unk_x6) - 6usize];
18759 ["Offset of field: nwmBeaconDataReplyEntry::unk_x7"]
18760 [::core::mem::offset_of!(nwmBeaconDataReplyEntry, unk_x7) - 7usize];
18761 ["Offset of field: nwmBeaconDataReplyEntry::mac_address"]
18762 [::core::mem::offset_of!(nwmBeaconDataReplyEntry, mac_address) - 8usize];
18763 ["Offset of field: nwmBeaconDataReplyEntry::unk_xe"]
18764 [::core::mem::offset_of!(nwmBeaconDataReplyEntry, unk_xe) - 14usize];
18765 ["Offset of field: nwmBeaconDataReplyEntry::unk_x14"]
18766 [::core::mem::offset_of!(nwmBeaconDataReplyEntry, unk_x14) - 20usize];
18767 ["Offset of field: nwmBeaconDataReplyEntry::val_x1c"]
18768 [::core::mem::offset_of!(nwmBeaconDataReplyEntry, val_x1c) - 24usize];
18769};
18770#[doc = "Output structure generated from host scanning output."]
18771#[repr(C)]
18772#[derive(Copy, Clone)]
18773pub struct udsNetworkScanInfo {
18774 pub datareply_entry: nwmBeaconDataReplyEntry,
18775 pub network: udsNetworkStruct,
18776 pub nodes: [udsNodeInfo; 16usize],
18777}
18778#[allow(clippy::unnecessary_operation, clippy::identity_op)]
18779const _: () = {
18780 ["Size of udsNetworkScanInfo"][::core::mem::size_of::<udsNetworkScanInfo>() - 936usize];
18781 ["Alignment of udsNetworkScanInfo"][::core::mem::align_of::<udsNetworkScanInfo>() - 8usize];
18782 ["Offset of field: udsNetworkScanInfo::datareply_entry"]
18783 [::core::mem::offset_of!(udsNetworkScanInfo, datareply_entry) - 0usize];
18784 ["Offset of field: udsNetworkScanInfo::network"]
18785 [::core::mem::offset_of!(udsNetworkScanInfo, network) - 28usize];
18786 ["Offset of field: udsNetworkScanInfo::nodes"]
18787 [::core::mem::offset_of!(udsNetworkScanInfo, nodes) - 296usize];
18788};
18789impl Default for udsNetworkScanInfo {
18790 fn default() -> Self {
18791 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
18792 unsafe {
18793 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
18794 s.assume_init()
18795 }
18796 }
18797}
18798pub const UDSNETATTR_DisableConnectSpectators: _bindgen_ty_25 = 1;
18799pub const UDSNETATTR_DisableConnectClients: _bindgen_ty_25 = 2;
18800pub const UDSNETATTR_x4: _bindgen_ty_25 = 4;
18801pub const UDSNETATTR_Default: _bindgen_ty_25 = 32768;
18802pub type _bindgen_ty_25 = ::libc::c_ushort;
18803pub const UDS_SENDFLAG_Default: _bindgen_ty_26 = 1;
18804pub const UDS_SENDFLAG_Broadcast: _bindgen_ty_26 = 2;
18805pub type _bindgen_ty_26 = ::libc::c_uchar;
18806pub const UDSCONTYPE_Client: udsConnectionType = 1;
18807pub const UDSCONTYPE_Spectator: udsConnectionType = 2;
18808pub type udsConnectionType = ::libc::c_uchar;
18809unsafe extern "C" {
18810 #[must_use]
18811 #[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."]
18812 pub fn udsInit(sharedmem_size: usize, username: *const ::libc::c_char) -> Result;
18813}
18814unsafe extern "C" {
18815 #[doc = "Exits UDS."]
18816 pub fn udsExit();
18817}
18818unsafe extern "C" {
18819 #[must_use]
18820 #[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."]
18821 pub fn udsGenerateNodeInfo(
18822 nodeinfo: *mut udsNodeInfo,
18823 username: *const ::libc::c_char,
18824 ) -> Result;
18825}
18826unsafe extern "C" {
18827 #[must_use]
18828 #[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."]
18829 pub fn udsGetNodeInfoUsername(
18830 nodeinfo: *const udsNodeInfo,
18831 username: *mut ::libc::c_char,
18832 ) -> Result;
18833}
18834unsafe extern "C" {
18835 #[doc = "Checks whether a NodeInfo struct was initialized by NWM-module(not any output from udsGenerateNodeInfo()).\n # Arguments\n\n* `nodeinfo` - Input NodeInfo struct."]
18836 pub fn udsCheckNodeInfoInitialized(nodeinfo: *const udsNodeInfo) -> bool;
18837}
18838unsafe extern "C" {
18839 #[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."]
18840 pub fn udsGenerateDefaultNetworkStruct(
18841 network: *mut udsNetworkStruct,
18842 wlancommID: u32_,
18843 id8: u8_,
18844 max_nodes: u8_,
18845 );
18846}
18847unsafe extern "C" {
18848 #[must_use]
18849 #[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."]
18850 pub fn udsScanBeacons(
18851 outbuf: *mut ::libc::c_void,
18852 maxsize: usize,
18853 networks: *mut *mut udsNetworkScanInfo,
18854 total_networks: *mut usize,
18855 wlancommID: u32_,
18856 id8: u8_,
18857 host_macaddress: *const u8_,
18858 connected: bool,
18859 ) -> Result;
18860}
18861unsafe extern "C" {
18862 #[must_use]
18863 #[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."]
18864 pub fn udsSetApplicationData(buf: *const ::libc::c_void, size: usize) -> Result;
18865}
18866unsafe extern "C" {
18867 #[must_use]
18868 #[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."]
18869 pub fn udsGetApplicationData(
18870 buf: *mut ::libc::c_void,
18871 size: usize,
18872 actual_size: *mut usize,
18873 ) -> Result;
18874}
18875unsafe extern "C" {
18876 #[must_use]
18877 #[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."]
18878 pub fn udsGetNetworkStructApplicationData(
18879 network: *const udsNetworkStruct,
18880 buf: *mut ::libc::c_void,
18881 size: usize,
18882 actual_size: *mut usize,
18883 ) -> Result;
18884}
18885unsafe extern "C" {
18886 #[must_use]
18887 #[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."]
18888 pub fn udsBind(
18889 bindcontext: *mut udsBindContext,
18890 NetworkNodeID: u16_,
18891 spectator: bool,
18892 data_channel: u8_,
18893 recv_buffer_size: u32_,
18894 ) -> Result;
18895}
18896unsafe extern "C" {
18897 #[must_use]
18898 #[doc = "Remove a bind.\n # Arguments\n\n* `bindcontext` - The bind context."]
18899 pub fn udsUnbind(bindcontext: *mut udsBindContext) -> Result;
18900}
18901unsafe extern "C" {
18902 #[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."]
18903 pub fn udsWaitDataAvailable(
18904 bindcontext: *const udsBindContext,
18905 nextEvent: bool,
18906 wait: bool,
18907 ) -> bool;
18908}
18909unsafe extern "C" {
18910 #[must_use]
18911 #[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."]
18912 pub fn udsPullPacket(
18913 bindcontext: *const udsBindContext,
18914 buf: *mut ::libc::c_void,
18915 size: usize,
18916 actual_size: *mut usize,
18917 src_NetworkNodeID: *mut u16_,
18918 ) -> Result;
18919}
18920unsafe extern "C" {
18921 #[must_use]
18922 #[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."]
18923 pub fn udsSendTo(
18924 dst_NetworkNodeID: u16_,
18925 data_channel: u8_,
18926 flags: u8_,
18927 buf: *const ::libc::c_void,
18928 size: usize,
18929 ) -> Result;
18930}
18931unsafe extern "C" {
18932 #[must_use]
18933 #[doc = "Gets the wifi channel currently being used.\n # Arguments\n\n* `channel` - Output channel."]
18934 pub fn udsGetChannel(channel: *mut u8_) -> Result;
18935}
18936unsafe extern "C" {
18937 #[must_use]
18938 #[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."]
18939 pub fn udsCreateNetwork(
18940 network: *const udsNetworkStruct,
18941 passphrase: *const ::libc::c_void,
18942 passphrase_size: usize,
18943 context: *mut udsBindContext,
18944 data_channel: u8_,
18945 recv_buffer_size: u32_,
18946 ) -> Result;
18947}
18948unsafe extern "C" {
18949 #[must_use]
18950 #[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."]
18951 pub fn udsConnectNetwork(
18952 network: *const udsNetworkStruct,
18953 passphrase: *const ::libc::c_void,
18954 passphrase_size: usize,
18955 context: *mut udsBindContext,
18956 recv_NetworkNodeID: u16_,
18957 connection_type: udsConnectionType,
18958 data_channel: u8_,
18959 recv_buffer_size: u32_,
18960 ) -> Result;
18961}
18962unsafe extern "C" {
18963 #[must_use]
18964 #[doc = "Stop hosting the network."]
18965 pub fn udsDestroyNetwork() -> Result;
18966}
18967unsafe extern "C" {
18968 #[must_use]
18969 #[doc = "Disconnect this client device from the network."]
18970 pub fn udsDisconnectNetwork() -> Result;
18971}
18972unsafe extern "C" {
18973 #[must_use]
18974 #[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."]
18975 pub fn udsEjectClient(NetworkNodeID: u16_) -> Result;
18976}
18977unsafe extern "C" {
18978 #[must_use]
18979 #[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."]
18980 pub fn udsEjectSpectator() -> Result;
18981}
18982unsafe extern "C" {
18983 #[must_use]
18984 #[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."]
18985 pub fn udsUpdateNetworkAttribute(bitmask: u16_, flag: bool) -> Result;
18986}
18987unsafe extern "C" {
18988 #[must_use]
18989 #[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."]
18990 pub fn udsSetNewConnectionsBlocked(block: bool, clients: bool, flag: bool) -> Result;
18991}
18992unsafe extern "C" {
18993 #[must_use]
18994 #[doc = "This uses udsUpdateNetworkAttribute() for unblocking new spectator connections to this host. See udsEjectSpectator() for blocking new spectators."]
18995 pub fn udsAllowSpectators() -> Result;
18996}
18997unsafe extern "C" {
18998 #[must_use]
18999 #[doc = "This loads the current ConnectionStatus struct.\n # Arguments\n\n* `output` - Output ConnectionStatus struct."]
19000 pub fn udsGetConnectionStatus(output: *mut udsConnectionStatus) -> Result;
19001}
19002unsafe extern "C" {
19003 #[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."]
19004 pub fn udsWaitConnectionStatusEvent(nextEvent: bool, wait: bool) -> bool;
19005}
19006unsafe extern "C" {
19007 #[must_use]
19008 #[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."]
19009 pub fn udsGetNodeInformation(NetworkNodeID: u16_, output: *mut udsNodeInfo) -> Result;
19010}
19011pub const NDM_EXCLUSIVE_STATE_NONE: ndmExclusiveState = 0;
19012pub const NDM_EXCLUSIVE_STATE_INFRASTRUCTURE: ndmExclusiveState = 1;
19013pub const NDM_EXCLUSIVE_STATE_LOCAL_COMMUNICATIONS: ndmExclusiveState = 2;
19014pub const NDM_EXCLUSIVE_STATE_STREETPASS: ndmExclusiveState = 3;
19015pub const NDM_EXCLUSIVE_STATE_STREETPASS_DATA: ndmExclusiveState = 4;
19016#[doc = "Exclusive states."]
19017pub type ndmExclusiveState = ::libc::c_uchar;
19018pub const NDM_STATE_INITIAL: ndmState = 0;
19019pub const NDM_STATE_SUSPENDED: ndmState = 1;
19020pub const NDM_STATE_INFRASTRUCTURE_CONNECTING: ndmState = 2;
19021pub const NDM_STATE_INFRASTRUCTURE_CONNECTED: ndmState = 3;
19022pub const NDM_STATE_INFRASTRUCTURE_WORKING: ndmState = 4;
19023pub const NDM_STATE_INFRASTRUCTURE_SUSPENDING: ndmState = 5;
19024pub const NDM_STATE_INFRASTRUCTURE_FORCE_SUSPENDING: ndmState = 6;
19025pub const NDM_STATE_INFRASTRUCTURE_DISCONNECTING: ndmState = 7;
19026pub const NDM_STATE_INFRASTRUCTURE_FORCE_DISCONNECTING: ndmState = 8;
19027pub const NDM_STATE_CEC_WORKING: ndmState = 9;
19028pub const NDM_STATE_CEC_FORCE_SUSPENDING: ndmState = 10;
19029pub const NDM_STATE_CEC_SUSPENDING: ndmState = 11;
19030#[doc = "Current states."]
19031pub type ndmState = ::libc::c_uchar;
19032pub const NDM_DAEMON_CEC: ndmDaemon = 0;
19033pub const NDM_DAEMON_BOSS: ndmDaemon = 1;
19034pub const NDM_DAEMON_NIM: ndmDaemon = 2;
19035pub const NDM_DAEMON_FRIENDS: ndmDaemon = 3;
19036pub type ndmDaemon = ::libc::c_uchar;
19037pub const NDM_DAEMON_MASK_CEC: ndmDaemonMask = 1;
19038pub const NDM_DAEMON_MASK_BOSS: ndmDaemonMask = 2;
19039pub const NDM_DAEMON_MASK_NIM: ndmDaemonMask = 4;
19040pub const NDM_DAEMON_MASK_FRIENDS: ndmDaemonMask = 8;
19041pub const NDM_DAEMON_MASK_BACKGROUOND: ndmDaemonMask = 7;
19042pub const NDM_DAEMON_MASK_ALL: ndmDaemonMask = 15;
19043pub const NDM_DAEMON_MASK_DEFAULT: ndmDaemonMask = 9;
19044#[doc = "Used to specify multiple daemons."]
19045pub type ndmDaemonMask = ::libc::c_uchar;
19046pub const NDM_DAEMON_STATUS_BUSY: ndmDaemonStatus = 0;
19047pub const NDM_DAEMON_STATUS_IDLE: ndmDaemonStatus = 1;
19048pub const NDM_DAEMON_STATUS_SUSPENDING: ndmDaemonStatus = 2;
19049pub const NDM_DAEMON_STATUS_SUSPENDED: ndmDaemonStatus = 3;
19050pub type ndmDaemonStatus = ::libc::c_uchar;
19051unsafe extern "C" {
19052 #[must_use]
19053 #[doc = "Initializes ndmu."]
19054 pub fn ndmuInit() -> Result;
19055}
19056unsafe extern "C" {
19057 #[doc = "Exits ndmu."]
19058 pub fn ndmuExit();
19059}
19060unsafe extern "C" {
19061 #[must_use]
19062 #[doc = "Sets the network daemon to an exclusive state.\n # Arguments\n\n* `state` - State specified in the ndmExclusiveState enumerator."]
19063 pub fn NDMU_EnterExclusiveState(state: ndmExclusiveState) -> Result;
19064}
19065unsafe extern "C" {
19066 #[must_use]
19067 #[doc = "Cancels an exclusive state for the network daemon."]
19068 pub fn NDMU_LeaveExclusiveState() -> Result;
19069}
19070unsafe extern "C" {
19071 #[must_use]
19072 #[doc = "Returns the exclusive state for the network daemon.\n # Arguments\n\n* `state` - Pointer to write the exclsuive state to."]
19073 pub fn NDMU_GetExclusiveState(state: *mut ndmExclusiveState) -> Result;
19074}
19075unsafe extern "C" {
19076 #[must_use]
19077 #[doc = "Locks the exclusive state."]
19078 pub fn NDMU_LockState() -> Result;
19079}
19080unsafe extern "C" {
19081 #[must_use]
19082 #[doc = "Unlocks the exclusive state."]
19083 pub fn NDMU_UnlockState() -> Result;
19084}
19085unsafe extern "C" {
19086 #[must_use]
19087 #[doc = "Suspends network daemon.\n # Arguments\n\n* `mask` - The specified daemon."]
19088 pub fn NDMU_SuspendDaemons(mask: ndmDaemonMask) -> Result;
19089}
19090unsafe extern "C" {
19091 #[must_use]
19092 #[doc = "Resumes network daemon.\n # Arguments\n\n* `mask` - The specified daemon."]
19093 pub fn NDMU_ResumeDaemons(mask: ndmDaemonMask) -> Result;
19094}
19095unsafe extern "C" {
19096 #[must_use]
19097 #[doc = "Suspends scheduling for all network daemons.\n # Arguments\n\n* `flag` - 0 = Wait for completion, 1 = Perform in background."]
19098 pub fn NDMU_SuspendScheduler(flag: u32_) -> Result;
19099}
19100unsafe extern "C" {
19101 #[must_use]
19102 #[doc = "Resumes daemon scheduling."]
19103 pub fn NDMU_ResumeScheduler() -> Result;
19104}
19105unsafe extern "C" {
19106 #[must_use]
19107 #[doc = "Returns the current state for the network daemon.\n # Arguments\n\n* `state` - Pointer to write the current state to."]
19108 pub fn NDMU_GetCurrentState(state: *mut ndmState) -> Result;
19109}
19110unsafe extern "C" {
19111 #[must_use]
19112 #[doc = "Returns a daemon state.\n # Arguments\n\n* `daemon` - The specified daemon.\n * `state` - Pointer to write the daemon state to."]
19113 pub fn NDMU_QueryStatus(daemon: ndmDaemon, status: *mut ndmDaemonStatus) -> Result;
19114}
19115unsafe extern "C" {
19116 #[must_use]
19117 #[doc = "Sets the scan interval.\n # Arguments\n\n* `interval` - Value to set the scan interval to."]
19118 pub fn NDMU_SetScanInterval(interval: u32_) -> Result;
19119}
19120unsafe extern "C" {
19121 #[must_use]
19122 #[doc = "Returns the scan interval.\n # Arguments\n\n* `interval` - Pointer to write the interval value to."]
19123 pub fn NDMU_GetScanInterval(interval: *mut u32_) -> Result;
19124}
19125unsafe extern "C" {
19126 #[must_use]
19127 #[doc = "Returns the retry interval.\n # Arguments\n\n* `interval` - Pointer to write the interval value to."]
19128 pub fn NDMU_GetRetryInterval(interval: *mut u32_) -> Result;
19129}
19130unsafe extern "C" {
19131 #[must_use]
19132 #[doc = "Reverts network daemon to defaults."]
19133 pub fn NDMU_ResetDaemons() -> Result;
19134}
19135unsafe extern "C" {
19136 #[must_use]
19137 #[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)"]
19138 pub fn NDMU_GetDefaultDaemons(mask: *mut ndmDaemonMask) -> Result;
19139}
19140unsafe extern "C" {
19141 #[must_use]
19142 #[doc = "Clears half awake mac filter."]
19143 pub fn NDMU_ClearMacFilter() -> Result;
19144}
19145#[doc = "< Initial installation"]
19146pub const IM_DEFAULT: NIM_InstallationMode = 0;
19147#[doc = "< Unknown"]
19148pub const IM_UNKNOWN1: NIM_InstallationMode = 1;
19149#[doc = "< Unknown"]
19150pub const IM_UNKNOWN2: NIM_InstallationMode = 2;
19151#[doc = "< Reinstall currently installed title; use this if the title is already installed (including updates)"]
19152pub const IM_REINSTALL: NIM_InstallationMode = 3;
19153#[doc = "Mode that NIM downloads/installs a title with."]
19154pub type NIM_InstallationMode = ::libc::c_uchar;
19155#[doc = "< Download not yet initialized"]
19156pub const DS_NOT_INITIALIZED: NIM_DownloadState = 0;
19157#[doc = "< Download initialized"]
19158pub const DS_INITIALIZED: NIM_DownloadState = 1;
19159#[doc = "< Downloading and installing TMD"]
19160pub const DS_DOWNLOAD_TMD: NIM_DownloadState = 2;
19161#[doc = "< Initializing save data"]
19162pub const DS_PREPARE_SAVE_DATA: NIM_DownloadState = 3;
19163#[doc = "< Downloading and installing contents"]
19164pub const DS_DOWNLOAD_CONTENTS: NIM_DownloadState = 4;
19165#[doc = "< Waiting before calling AM_CommitImportTitles"]
19166pub const DS_WAIT_COMMIT: NIM_DownloadState = 5;
19167#[doc = "< Running AM_CommitImportTitles"]
19168pub const DS_COMMITTING: NIM_DownloadState = 6;
19169#[doc = "< Title installation finished"]
19170pub const DS_FINISHED: NIM_DownloadState = 7;
19171#[doc = "< (unknown error regarding title version)"]
19172pub const DS_VERSION_ERROR: NIM_DownloadState = 8;
19173#[doc = "< Creating the .ctx file?"]
19174pub const DS_CREATE_CONTEXT: NIM_DownloadState = 9;
19175#[doc = "< Irrecoverable error encountered (e.g. out of space)"]
19176pub const DS_CANNOT_RECOVER: NIM_DownloadState = 10;
19177#[doc = "< Invalid state"]
19178pub const DS_INVALID: NIM_DownloadState = 11;
19179#[doc = "Current state of a NIM download/installation."]
19180pub type NIM_DownloadState = ::libc::c_uchar;
19181#[doc = "Input configuration for NIM download/installation tasks."]
19182#[repr(C)]
19183#[derive(Debug, Default, Copy, Clone)]
19184pub struct NIM_TitleConfig {
19185 #[doc = "< Title ID"]
19186 pub titleId: u64_,
19187 #[doc = "< Title version"]
19188 pub version: u32_,
19189 #[doc = "< Always 0"]
19190 pub unknown_0: u32_,
19191 #[doc = "< Age for the HOME Menu parental controls"]
19192 pub ratingAge: u8_,
19193 #[doc = "< Media type, see FS_MediaType enum"]
19194 pub mediaType: u8_,
19195 #[doc = "< Padding"]
19196 pub padding: [u8_; 2usize],
19197 #[doc = "< Unknown input, seems to be always 0"]
19198 pub unknown_1: u32_,
19199}
19200#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19201const _: () = {
19202 ["Size of NIM_TitleConfig"][::core::mem::size_of::<NIM_TitleConfig>() - 24usize];
19203 ["Alignment of NIM_TitleConfig"][::core::mem::align_of::<NIM_TitleConfig>() - 8usize];
19204 ["Offset of field: NIM_TitleConfig::titleId"]
19205 [::core::mem::offset_of!(NIM_TitleConfig, titleId) - 0usize];
19206 ["Offset of field: NIM_TitleConfig::version"]
19207 [::core::mem::offset_of!(NIM_TitleConfig, version) - 8usize];
19208 ["Offset of field: NIM_TitleConfig::unknown_0"]
19209 [::core::mem::offset_of!(NIM_TitleConfig, unknown_0) - 12usize];
19210 ["Offset of field: NIM_TitleConfig::ratingAge"]
19211 [::core::mem::offset_of!(NIM_TitleConfig, ratingAge) - 16usize];
19212 ["Offset of field: NIM_TitleConfig::mediaType"]
19213 [::core::mem::offset_of!(NIM_TitleConfig, mediaType) - 17usize];
19214 ["Offset of field: NIM_TitleConfig::padding"]
19215 [::core::mem::offset_of!(NIM_TitleConfig, padding) - 18usize];
19216 ["Offset of field: NIM_TitleConfig::unknown_1"]
19217 [::core::mem::offset_of!(NIM_TitleConfig, unknown_1) - 20usize];
19218};
19219#[doc = "Output struct for NIM downloads/installations in progress."]
19220#[repr(C)]
19221#[derive(Debug, Default, Copy, Clone)]
19222pub struct NIM_TitleProgress {
19223 #[doc = "< State, see NIM_DownloadState enum"]
19224 pub state: u32_,
19225 #[doc = "< Last result code in NIM"]
19226 pub lastResult: Result,
19227 #[doc = "< Amount of bytes that have been downloaded"]
19228 pub downloadedSize: u64_,
19229 #[doc = "< Amount of bytes that need to be downloaded in total"]
19230 pub totalSize: u64_,
19231}
19232#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19233const _: () = {
19234 ["Size of NIM_TitleProgress"][::core::mem::size_of::<NIM_TitleProgress>() - 24usize];
19235 ["Alignment of NIM_TitleProgress"][::core::mem::align_of::<NIM_TitleProgress>() - 8usize];
19236 ["Offset of field: NIM_TitleProgress::state"]
19237 [::core::mem::offset_of!(NIM_TitleProgress, state) - 0usize];
19238 ["Offset of field: NIM_TitleProgress::lastResult"]
19239 [::core::mem::offset_of!(NIM_TitleProgress, lastResult) - 4usize];
19240 ["Offset of field: NIM_TitleProgress::downloadedSize"]
19241 [::core::mem::offset_of!(NIM_TitleProgress, downloadedSize) - 8usize];
19242 ["Offset of field: NIM_TitleProgress::totalSize"]
19243 [::core::mem::offset_of!(NIM_TitleProgress, totalSize) - 16usize];
19244};
19245unsafe extern "C" {
19246 #[must_use]
19247 #[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."]
19248 pub fn nimsInit(buffer: *mut ::libc::c_void, buffer_len: usize) -> Result;
19249}
19250unsafe extern "C" {
19251 #[must_use]
19252 #[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."]
19253 pub fn nimsInitWithTIN(
19254 buffer: *mut ::libc::c_void,
19255 buffer_len: usize,
19256 TIN: *const ::libc::c_char,
19257 ) -> Result;
19258}
19259unsafe extern "C" {
19260 #[doc = "Exits nim:s."]
19261 pub fn nimsExit();
19262}
19263unsafe extern "C" {
19264 #[doc = "Gets the current nim:s session handle."]
19265 pub fn nimsGetSessionHandle() -> *mut Handle;
19266}
19267unsafe extern "C" {
19268 #[must_use]
19269 #[doc = "Sets an attribute.\n # Arguments\n\n* `attr` - Name of the attribute.\n * `val` - Value of the attribute."]
19270 pub fn NIMS_SetAttribute(attr: *const ::libc::c_char, val: *const ::libc::c_char) -> Result;
19271}
19272unsafe extern "C" {
19273 #[must_use]
19274 #[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."]
19275 pub fn NIMS_WantUpdate(want_update: *mut bool) -> Result;
19276}
19277unsafe extern "C" {
19278 #[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."]
19279 pub fn NIMS_MakeTitleConfig(
19280 cfg: *mut NIM_TitleConfig,
19281 titleId: u64_,
19282 version: u32_,
19283 ratingAge: u8_,
19284 mediaType: FS_MediaType,
19285 );
19286}
19287unsafe extern "C" {
19288 #[must_use]
19289 #[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."]
19290 pub fn NIMS_RegisterTask(
19291 cfg: *const NIM_TitleConfig,
19292 name: *const ::libc::c_char,
19293 maker: *const ::libc::c_char,
19294 ) -> Result;
19295}
19296unsafe extern "C" {
19297 #[must_use]
19298 #[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."]
19299 pub fn NIMS_IsTaskRegistered(titleId: u64_, registered: *mut bool) -> Result;
19300}
19301unsafe extern "C" {
19302 #[must_use]
19303 #[doc = "Unregisters a background download task.\n # Arguments\n\n* `titleId` - Title ID whose background download task to cancel."]
19304 pub fn NIMS_UnregisterTask(titleId: u64_) -> Result;
19305}
19306unsafe extern "C" {
19307 #[must_use]
19308 #[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."]
19309 pub fn NIMS_StartDownload(cfg: *const NIM_TitleConfig, mode: NIM_InstallationMode) -> Result;
19310}
19311unsafe extern "C" {
19312 #[must_use]
19313 #[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."]
19314 pub fn NIMS_StartDownloadSimple(cfg: *const NIM_TitleConfig) -> Result;
19315}
19316unsafe extern "C" {
19317 #[must_use]
19318 #[doc = "Checks the status of the current active download.\n # Arguments\n\n* `tp` - Title progress struct to write to. See NIM_TitleProgress."]
19319 pub fn NIMS_GetProgress(tp: *mut NIM_TitleProgress) -> Result;
19320}
19321unsafe extern "C" {
19322 #[must_use]
19323 #[doc = "Cancels the current active download with NIM."]
19324 pub fn NIMS_CancelDownload() -> Result;
19325}
19326unsafe extern "C" {
19327 #[must_use]
19328 pub fn nwmExtInit() -> Result;
19329}
19330unsafe extern "C" {
19331 pub fn nwmExtExit();
19332}
19333unsafe extern "C" {
19334 #[must_use]
19335 #[doc = "Turns wireless on or off.\n # Arguments\n\n* `enableWifi` - True enables it, false disables it."]
19336 pub fn NWMEXT_ControlWirelessEnabled(enableWifi: bool) -> Result;
19337}
19338unsafe extern "C" {
19339 #[must_use]
19340 #[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."]
19341 pub fn iruInit(sharedmem_addr: *mut u32_, sharedmem_size: u32_) -> Result;
19342}
19343unsafe extern "C" {
19344 #[doc = "Shuts down IRU."]
19345 pub fn iruExit();
19346}
19347unsafe extern "C" {
19348 #[doc = "Gets the IRU service handle.\n # Returns\n\nThe IRU service handle."]
19349 pub fn iruGetServHandle() -> Handle;
19350}
19351unsafe extern "C" {
19352 #[must_use]
19353 #[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."]
19354 pub fn iruSendData(buf: *mut u8_, size: u32_, wait: bool) -> Result;
19355}
19356unsafe extern "C" {
19357 #[must_use]
19358 #[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."]
19359 pub fn iruRecvData(
19360 buf: *mut u8_,
19361 size: u32_,
19362 flag: u8_,
19363 transfercount: *mut u32_,
19364 wait: bool,
19365 ) -> Result;
19366}
19367unsafe extern "C" {
19368 #[must_use]
19369 #[doc = "Initializes the IR session."]
19370 pub fn IRU_Initialize() -> Result;
19371}
19372unsafe extern "C" {
19373 #[must_use]
19374 #[doc = "Shuts down the IR session."]
19375 pub fn IRU_Shutdown() -> Result;
19376}
19377unsafe extern "C" {
19378 #[must_use]
19379 #[doc = "Begins sending data.\n # Arguments\n\n* `buf` - Buffer to send.\n * `size` - Size of the buffer."]
19380 pub fn IRU_StartSendTransfer(buf: *mut u8_, size: u32_) -> Result;
19381}
19382unsafe extern "C" {
19383 #[must_use]
19384 #[doc = "Waits for a send operation to complete."]
19385 pub fn IRU_WaitSendTransfer() -> Result;
19386}
19387unsafe extern "C" {
19388 #[must_use]
19389 #[doc = "Begins receiving data.\n # Arguments\n\n* `size` - Size of the data to receive.\n * `flag` - Flags to use when receiving."]
19390 pub fn IRU_StartRecvTransfer(size: u32_, flag: u8_) -> Result;
19391}
19392unsafe extern "C" {
19393 #[must_use]
19394 #[doc = "Waits for a receive operation to complete.\n # Arguments\n\n* `transfercount` - Pointer to output the number of bytes read to."]
19395 pub fn IRU_WaitRecvTransfer(transfercount: *mut u32_) -> Result;
19396}
19397unsafe extern "C" {
19398 #[must_use]
19399 #[doc = "Sets the IR bit rate.\n # Arguments\n\n* `value` - Bit rate to set."]
19400 pub fn IRU_SetBitRate(value: u8_) -> Result;
19401}
19402unsafe extern "C" {
19403 #[must_use]
19404 #[doc = "Gets the IR bit rate.\n # Arguments\n\n* `out` - Pointer to write the bit rate to."]
19405 pub fn IRU_GetBitRate(out: *mut u8_) -> Result;
19406}
19407unsafe extern "C" {
19408 #[must_use]
19409 #[doc = "Sets the IR LED state.\n # Arguments\n\n* `value` - IR LED state to set."]
19410 pub fn IRU_SetIRLEDState(value: u32_) -> Result;
19411}
19412unsafe extern "C" {
19413 #[must_use]
19414 #[doc = "Gets the IR LED state.\n # Arguments\n\n* `out` - Pointer to write the IR LED state to."]
19415 pub fn IRU_GetIRLEDRecvState(out: *mut u32_) -> Result;
19416}
19417unsafe extern "C" {
19418 #[must_use]
19419 #[doc = "Gets an event which is signaled once a send finishes.\n # Arguments\n\n* `out` - Pointer to write the event handle to."]
19420 pub fn IRU_GetSendFinishedEvent(out: *mut Handle) -> Result;
19421}
19422unsafe extern "C" {
19423 #[must_use]
19424 #[doc = "Gets an event which is signaled once a receive finishes.\n # Arguments\n\n* `out` - Pointer to write the event handle to."]
19425 pub fn IRU_GetRecvFinishedEvent(out: *mut Handle) -> Result;
19426}
19427unsafe extern "C" {
19428 #[must_use]
19429 #[doc = "Initializes NS."]
19430 pub fn nsInit() -> Result;
19431}
19432unsafe extern "C" {
19433 #[doc = "Exits NS."]
19434 pub fn nsExit();
19435}
19436unsafe extern "C" {
19437 #[must_use]
19438 #[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."]
19439 pub fn NS_LaunchFIRM(titleid: u64_) -> Result;
19440}
19441unsafe extern "C" {
19442 #[must_use]
19443 #[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."]
19444 pub fn NS_LaunchTitle(titleid: u64_, launch_flags: u32_, procid: *mut u32_) -> Result;
19445}
19446unsafe extern "C" {
19447 #[must_use]
19448 #[doc = "Terminates the application from which this function is called"]
19449 pub fn NS_TerminateTitle() -> Result;
19450}
19451unsafe extern "C" {
19452 #[must_use]
19453 #[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."]
19454 pub fn NS_LaunchApplicationFIRM(titleid: u64_, flags: u32_) -> Result;
19455}
19456unsafe extern "C" {
19457 #[must_use]
19458 #[doc = "Reboots to a title.\n # Arguments\n\n* `mediatype` - Mediatype of the title.\n * `titleid` - ID of the title to launch."]
19459 pub fn NS_RebootToTitle(mediatype: u8_, titleid: u64_) -> Result;
19460}
19461unsafe extern "C" {
19462 #[must_use]
19463 #[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."]
19464 pub fn NS_TerminateProcessTID(titleid: u64_, timeout: u64_) -> Result;
19465}
19466unsafe extern "C" {
19467 #[must_use]
19468 #[doc = "Reboots the system"]
19469 pub fn NS_RebootSystem() -> Result;
19470}
19471pub const PMLAUNCHFLAG_NORMAL_APPLICATION: _bindgen_ty_27 = 1;
19472pub const PMLAUNCHFLAG_LOAD_DEPENDENCIES: _bindgen_ty_27 = 2;
19473pub const PMLAUNCHFLAG_NOTIFY_TERMINATION: _bindgen_ty_27 = 4;
19474pub const PMLAUNCHFLAG_QUEUE_DEBUG_APPLICATION: _bindgen_ty_27 = 8;
19475pub const PMLAUNCHFLAG_TERMINATION_NOTIFICATION_MASK: _bindgen_ty_27 = 240;
19476#[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."]
19477pub const PMLAUNCHFLAG_FORCE_USE_O3DS_APP_MEM: _bindgen_ty_27 = 256;
19478#[doc = "< In conjunction with the above, forces the 96MB app memory setting. N3DS only."]
19479pub const PMLAUNCHFLAG_FORCE_USE_O3DS_MAX_APP_MEM: _bindgen_ty_27 = 512;
19480pub const PMLAUNCHFLAG_USE_UPDATE_TITLE: _bindgen_ty_27 = 65536;
19481#[doc = "Launch flags for PM launch commands."]
19482pub type _bindgen_ty_27 = ::libc::c_uint;
19483unsafe extern "C" {
19484 #[must_use]
19485 #[doc = "Initializes pm:app."]
19486 pub fn pmAppInit() -> Result;
19487}
19488unsafe extern "C" {
19489 #[doc = "Exits pm:app."]
19490 pub fn pmAppExit();
19491}
19492unsafe extern "C" {
19493 #[doc = "Gets the current pm:app session handle.\n # Returns\n\nThe current pm:app session handle."]
19494 pub fn pmAppGetSessionHandle() -> *mut Handle;
19495}
19496unsafe extern "C" {
19497 #[must_use]
19498 #[doc = "Launches a title.\n # Arguments\n\n* `programInfo` - Program information of the title.\n * `launchFlags` - Flags to launch the title with."]
19499 pub fn PMAPP_LaunchTitle(programInfo: *const FS_ProgramInfo, launchFlags: u32_) -> Result;
19500}
19501unsafe extern "C" {
19502 #[must_use]
19503 #[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."]
19504 pub fn PMAPP_LaunchTitleUpdate(
19505 programInfo: *const FS_ProgramInfo,
19506 programInfoUpdate: *const FS_ProgramInfo,
19507 launchFlags: u32_,
19508 ) -> Result;
19509}
19510unsafe extern "C" {
19511 #[must_use]
19512 #[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."]
19513 pub fn PMAPP_GetTitleExheaderFlags(
19514 outCoreInfo: *mut ExHeader_Arm11CoreInfo,
19515 outSiFlags: *mut ExHeader_SystemInfoFlags,
19516 programInfo: *const FS_ProgramInfo,
19517 ) -> Result;
19518}
19519unsafe extern "C" {
19520 #[must_use]
19521 #[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."]
19522 pub fn PMAPP_SetFIRMLaunchParams(size: u32_, in_: *const ::libc::c_void) -> Result;
19523}
19524unsafe extern "C" {
19525 #[must_use]
19526 #[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."]
19527 pub fn PMAPP_GetFIRMLaunchParams(out: *mut ::libc::c_void, size: u32_) -> Result;
19528}
19529unsafe extern "C" {
19530 #[must_use]
19531 #[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."]
19532 pub fn PMAPP_LaunchFIRMSetParams(
19533 firmTidLow: u32_,
19534 size: u32_,
19535 in_: *const ::libc::c_void,
19536 ) -> Result;
19537}
19538unsafe extern "C" {
19539 #[must_use]
19540 #[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."]
19541 pub fn PMAPP_PrepareForReboot(timeout: s64) -> Result;
19542}
19543unsafe extern "C" {
19544 #[must_use]
19545 #[doc = "Terminates the current Application\n # Arguments\n\n* `timeout` - Timeout in nanoseconds"]
19546 pub fn PMAPP_TerminateCurrentApplication(timeout: s64) -> Result;
19547}
19548unsafe extern "C" {
19549 #[must_use]
19550 #[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"]
19551 pub fn PMAPP_TerminateTitle(titleId: u64_, timeout: s64) -> Result;
19552}
19553unsafe extern "C" {
19554 #[must_use]
19555 #[doc = "Terminates the specified process\n # Arguments\n\n* `pid` - Process-ID of the process to terminate\n * `timeout` - Timeout in nanoseconds"]
19556 pub fn PMAPP_TerminateProcess(pid: u32_, timeout: s64) -> Result;
19557}
19558unsafe extern "C" {
19559 #[must_use]
19560 #[doc = "Unregisters a process\n # Arguments\n\n* `tid` - TitleID of the process to unregister"]
19561 pub fn PMAPP_UnregisterProcess(tid: u64_) -> Result;
19562}
19563unsafe extern "C" {
19564 #[must_use]
19565 #[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)."]
19566 pub fn PMAPP_SetAppResourceLimit(cpuTime: s64) -> Result;
19567}
19568unsafe extern "C" {
19569 #[must_use]
19570 #[doc = "Gets the APPLICATION cputime reslimit.\n # Arguments\n\n* `cpuTime` (direction out) - Pointer to write the reslimit value to."]
19571 pub fn PMAPP_GetAppResourceLimit(outCpuTime: *mut s64) -> Result;
19572}
19573unsafe extern "C" {
19574 #[must_use]
19575 #[doc = "Initializes pm:dbg."]
19576 pub fn pmDbgInit() -> Result;
19577}
19578unsafe extern "C" {
19579 #[doc = "Exits pm:dbg."]
19580 pub fn pmDbgExit();
19581}
19582unsafe extern "C" {
19583 #[doc = "Gets the current pm:dbg session handle.\n # Returns\n\nThe current pm:dbg session handle."]
19584 pub fn pmDbgGetSessionHandle() -> *mut Handle;
19585}
19586unsafe extern "C" {
19587 #[must_use]
19588 #[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."]
19589 pub fn PMDBG_LaunchAppDebug(
19590 outDebug: *mut Handle,
19591 programInfo: *const FS_ProgramInfo,
19592 launchFlags: u32_,
19593 ) -> Result;
19594}
19595unsafe extern "C" {
19596 #[must_use]
19597 #[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."]
19598 pub fn PMDBG_LaunchApp(programInfo: *const FS_ProgramInfo, launchFlags: u32_) -> Result;
19599}
19600unsafe extern "C" {
19601 #[must_use]
19602 #[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."]
19603 pub fn PMDBG_RunQueuedProcess(outDebug: *mut Handle) -> Result;
19604}
19605#[doc = "< CBC encryption."]
19606pub const PS_ALGORITHM_CBC_ENC: PS_AESAlgorithm = 0;
19607#[doc = "< CBC decryption."]
19608pub const PS_ALGORITHM_CBC_DEC: PS_AESAlgorithm = 1;
19609#[doc = "< CTR encryption."]
19610pub const PS_ALGORITHM_CTR_ENC: PS_AESAlgorithm = 2;
19611#[doc = "< CTR decryption(same as PS_ALGORITHM_CTR_ENC)."]
19612pub const PS_ALGORITHM_CTR_DEC: PS_AESAlgorithm = 3;
19613#[doc = "< CCM encryption."]
19614pub const PS_ALGORITHM_CCM_ENC: PS_AESAlgorithm = 4;
19615#[doc = "< CCM decryption."]
19616pub const PS_ALGORITHM_CCM_DEC: PS_AESAlgorithm = 5;
19617#[doc = "PS AES algorithms."]
19618pub type PS_AESAlgorithm = ::libc::c_uchar;
19619#[doc = "< Key slot 0x0D."]
19620pub const PS_KEYSLOT_0D: PS_AESKeyType = 0;
19621#[doc = "< Key slot 0x2D."]
19622pub const PS_KEYSLOT_2D: PS_AESKeyType = 1;
19623#[doc = "< Key slot 0x31."]
19624pub const PS_KEYSLOT_31: PS_AESKeyType = 2;
19625#[doc = "< Key slot 0x38."]
19626pub const PS_KEYSLOT_38: PS_AESKeyType = 3;
19627#[doc = "< Key slot 0x32."]
19628pub const PS_KEYSLOT_32: PS_AESKeyType = 4;
19629#[doc = "< Key slot 0x39. (DLP)"]
19630pub const PS_KEYSLOT_39_DLP: PS_AESKeyType = 5;
19631#[doc = "< Key slot 0x2E."]
19632pub const PS_KEYSLOT_2E: PS_AESKeyType = 6;
19633#[doc = "< Invalid key slot."]
19634pub const PS_KEYSLOT_INVALID: PS_AESKeyType = 7;
19635#[doc = "< Key slot 0x36."]
19636pub const PS_KEYSLOT_36: PS_AESKeyType = 8;
19637#[doc = "< Key slot 0x39. (NFC)"]
19638pub const PS_KEYSLOT_39_NFC: PS_AESKeyType = 9;
19639#[doc = "PS key slots."]
19640pub type PS_AESKeyType = ::libc::c_uchar;
19641#[doc = "RSA context."]
19642#[repr(C)]
19643#[derive(Debug, Copy, Clone)]
19644pub struct psRSAContext {
19645 pub modulo: [u8_; 256usize],
19646 pub exponent: [u8_; 256usize],
19647 pub rsa_bitsize: u32_,
19648 pub unk: u32_,
19649}
19650#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19651const _: () = {
19652 ["Size of psRSAContext"][::core::mem::size_of::<psRSAContext>() - 520usize];
19653 ["Alignment of psRSAContext"][::core::mem::align_of::<psRSAContext>() - 4usize];
19654 ["Offset of field: psRSAContext::modulo"]
19655 [::core::mem::offset_of!(psRSAContext, modulo) - 0usize];
19656 ["Offset of field: psRSAContext::exponent"]
19657 [::core::mem::offset_of!(psRSAContext, exponent) - 256usize];
19658 ["Offset of field: psRSAContext::rsa_bitsize"]
19659 [::core::mem::offset_of!(psRSAContext, rsa_bitsize) - 512usize];
19660 ["Offset of field: psRSAContext::unk"][::core::mem::offset_of!(psRSAContext, unk) - 516usize];
19661};
19662impl Default for psRSAContext {
19663 fn default() -> Self {
19664 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
19665 unsafe {
19666 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
19667 s.assume_init()
19668 }
19669 }
19670}
19671unsafe extern "C" {
19672 #[must_use]
19673 #[doc = "Initializes PS."]
19674 pub fn psInit() -> Result;
19675}
19676unsafe extern "C" {
19677 #[must_use]
19678 #[doc = "Initializes PS with the specified session handle.\n # Arguments\n\n* `handle` - Session handle."]
19679 pub fn psInitHandle(handle: Handle) -> Result;
19680}
19681unsafe extern "C" {
19682 #[doc = "Exits PS."]
19683 pub fn psExit();
19684}
19685unsafe extern "C" {
19686 #[doc = "Returns the PS session handle."]
19687 pub fn psGetSessionHandle() -> Handle;
19688}
19689unsafe extern "C" {
19690 #[must_use]
19691 #[doc = "Signs a RSA signature.\n # Arguments\n\n* `hash` - SHA256 hash to sign.\n * `ctx` - RSA context.\n * `signature` - RSA signature."]
19692 pub fn PS_SignRsaSha256(hash: *mut u8_, ctx: *mut psRSAContext, signature: *mut u8_) -> Result;
19693}
19694unsafe extern "C" {
19695 #[must_use]
19696 #[doc = "Verifies a RSA signature.\n # Arguments\n\n* `hash` - SHA256 hash to compare with.\n * `ctx` - RSA context.\n * `signature` - RSA signature."]
19697 pub fn PS_VerifyRsaSha256(
19698 hash: *mut u8_,
19699 ctx: *mut psRSAContext,
19700 signature: *mut u8_,
19701 ) -> Result;
19702}
19703unsafe extern "C" {
19704 #[must_use]
19705 #[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."]
19706 pub fn PS_EncryptDecryptAes(
19707 size: u32_,
19708 in_: *mut u8_,
19709 out: *mut u8_,
19710 aes_algo: PS_AESAlgorithm,
19711 key_type: PS_AESKeyType,
19712 iv: *mut u8_,
19713 ) -> Result;
19714}
19715unsafe extern "C" {
19716 #[must_use]
19717 #[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."]
19718 pub fn PS_EncryptSignDecryptVerifyAesCcm(
19719 in_: *mut u8_,
19720 in_size: u32_,
19721 out: *mut u8_,
19722 out_size: u32_,
19723 data_len: u32_,
19724 mac_data_len: u32_,
19725 mac_len: u32_,
19726 aes_algo: PS_AESAlgorithm,
19727 key_type: PS_AESKeyType,
19728 nonce: *mut u8_,
19729 ) -> Result;
19730}
19731unsafe extern "C" {
19732 #[must_use]
19733 #[doc = "Gets the 64-bit console friend code seed.\n # Arguments\n\n* `seed` - Pointer to write the friend code seed to."]
19734 pub fn PS_GetLocalFriendCodeSeed(seed: *mut u64_) -> Result;
19735}
19736unsafe extern "C" {
19737 #[must_use]
19738 #[doc = "Gets the 32-bit device ID.\n # Arguments\n\n* `device_id` - Pointer to write the device ID to."]
19739 pub fn PS_GetDeviceId(device_id: *mut u32_) -> Result;
19740}
19741unsafe extern "C" {
19742 #[must_use]
19743 #[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."]
19744 pub fn PS_GenerateRandomBytes(out: *mut ::libc::c_void, len: usize) -> Result;
19745}
19746unsafe extern "C" {
19747 #[must_use]
19748 #[doc = "Initializes PTMU."]
19749 pub fn ptmuInit() -> Result;
19750}
19751unsafe extern "C" {
19752 #[doc = "Exits PTMU."]
19753 pub fn ptmuExit();
19754}
19755unsafe extern "C" {
19756 #[doc = "Gets a pointer to the current ptm:u session handle.\n # Returns\n\nA pointer to the current ptm:u session handle."]
19757 pub fn ptmuGetSessionHandle() -> *mut Handle;
19758}
19759unsafe extern "C" {
19760 #[must_use]
19761 #[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)"]
19762 pub fn PTMU_GetShellState(out: *mut u8_) -> Result;
19763}
19764unsafe extern "C" {
19765 #[must_use]
19766 #[doc = "Gets the system's current battery level.\n # Arguments\n\n* `out` - Pointer to write the current battery level to. (0-5)"]
19767 pub fn PTMU_GetBatteryLevel(out: *mut u8_) -> Result;
19768}
19769unsafe extern "C" {
19770 #[must_use]
19771 #[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)"]
19772 pub fn PTMU_GetBatteryChargeState(out: *mut u8_) -> Result;
19773}
19774unsafe extern "C" {
19775 #[must_use]
19776 #[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)"]
19777 pub fn PTMU_GetPedometerState(out: *mut u8_) -> Result;
19778}
19779unsafe extern "C" {
19780 #[must_use]
19781 #[doc = "Gets the system's step count history.\n # Arguments\n\n* `hours` - Number of hours to get the step count history for.\n * `stepValue` - Pointer to output the step count history to. (The buffer size must be at least `hours` in length)"]
19782 pub fn PTMU_GetStepHistory(hours: u32_, stepValue: *mut u16_) -> Result;
19783}
19784unsafe extern "C" {
19785 #[must_use]
19786 #[doc = "Gets the pedometer's total step count.\n # Arguments\n\n* `steps` - Pointer to write the total step count to."]
19787 pub fn PTMU_GetTotalStepCount(steps: *mut u32_) -> Result;
19788}
19789unsafe extern "C" {
19790 #[must_use]
19791 #[doc = "Gets whether the adapter is plugged in or not\n # Arguments\n\n* `out` - Pointer to write the adapter state to."]
19792 pub fn PTMU_GetAdapterState(out: *mut bool) -> Result;
19793}
19794#[doc = "PDN wake events and MCU interrupts to select, combined with those of other processes"]
19795#[repr(C)]
19796#[derive(Debug, Default, Copy, Clone)]
19797pub struct PtmWakeEvents {
19798 #[doc = "< Written to PDN_WAKE_EVENTS. Don't select bit26 (MCU), PTM will do it automatically."]
19799 pub pdn_wake_events: u32_,
19800 #[doc = "< MCU interrupts to check when a MCU wake event happens."]
19801 pub mcu_interupt_mask: u32_,
19802}
19803#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19804const _: () = {
19805 ["Size of PtmWakeEvents"][::core::mem::size_of::<PtmWakeEvents>() - 8usize];
19806 ["Alignment of PtmWakeEvents"][::core::mem::align_of::<PtmWakeEvents>() - 4usize];
19807 ["Offset of field: PtmWakeEvents::pdn_wake_events"]
19808 [::core::mem::offset_of!(PtmWakeEvents, pdn_wake_events) - 0usize];
19809 ["Offset of field: PtmWakeEvents::mcu_interupt_mask"]
19810 [::core::mem::offset_of!(PtmWakeEvents, mcu_interupt_mask) - 4usize];
19811};
19812#[repr(C)]
19813#[derive(Debug, Default, Copy, Clone)]
19814pub struct PtmSleepConfig {
19815 #[doc = "< Wake events for which the system should fully wake up."]
19816 pub exit_sleep_events: PtmWakeEvents,
19817 #[doc = "< Wake events for which the system should return to sleep."]
19818 pub continue_sleep_events: PtmWakeEvents,
19819}
19820#[allow(clippy::unnecessary_operation, clippy::identity_op)]
19821const _: () = {
19822 ["Size of PtmSleepConfig"][::core::mem::size_of::<PtmSleepConfig>() - 16usize];
19823 ["Alignment of PtmSleepConfig"][::core::mem::align_of::<PtmSleepConfig>() - 4usize];
19824 ["Offset of field: PtmSleepConfig::exit_sleep_events"]
19825 [::core::mem::offset_of!(PtmSleepConfig, exit_sleep_events) - 0usize];
19826 ["Offset of field: PtmSleepConfig::continue_sleep_events"]
19827 [::core::mem::offset_of!(PtmSleepConfig, continue_sleep_events) - 8usize];
19828};
19829#[doc = "< PTMSYSM_RequestSleep has been called (ack = 3)"]
19830pub const PTMNOTIFID_SLEEP_REQUESTED: _bindgen_ty_28 = 257;
19831#[doc = "< The sleep request has been denied by PTMSYSM_ReplyToSleepQuery(true) (no ack required)."]
19832pub const PTMNOTIFID_SLEEP_DENIED: _bindgen_ty_28 = 258;
19833#[doc = "< The sleep request has been allowed by PTMSYSM_ReplyToSleepQuery(false) (ack = 1)."]
19834pub const PTMNOTIFID_SLEEP_ALLOWED: _bindgen_ty_28 = 259;
19835#[doc = "< All processes not having \"RunnableOnSleep\" have been paused & the system is about to go to sleep (ack = 0)."]
19836pub const PTMNOTIFID_GOING_TO_SLEEP: _bindgen_ty_28 = 260;
19837#[doc = "< The system has been woken up, and the paused processes are about to be unpaused (ack = 1)."]
19838pub const PTMNOTIFID_FULLY_WAKING_UP: _bindgen_ty_28 = 261;
19839#[doc = "< The system is fully awake (no ack required)."]
19840pub const PTMNOTIFID_FULLY_AWAKE: _bindgen_ty_28 = 262;
19841#[doc = "< The system has been woken up but is about to go to sleep again (ack = 2)."]
19842pub const PTMNOTIFID_HALF_AWAKE: _bindgen_ty_28 = 263;
19843#[doc = "< The system is about to power off or reboot."]
19844pub const PTMNOTIFID_SHUTDOWN: _bindgen_ty_28 = 264;
19845#[doc = "< The battery level has reached 5% or below."]
19846pub const PTMNOTIFID_BATTERY_VERY_LOW: _bindgen_ty_28 = 529;
19847#[doc = "< The battery level has reached 10% or below."]
19848pub const PTMNOTIFID_BATTERY_LOW: _bindgen_ty_28 = 530;
19849pub type _bindgen_ty_28 = ::libc::c_ushort;
19850unsafe extern "C" {
19851 #[doc = "See PTMSYSM_NotifySleepPreparationComplete. Corresponds to the number of potentially remaning notifs. until sleep/wakeup."]
19852 #[link_name = "ptmSysmGetNotificationAckValue__extern"]
19853 pub fn ptmSysmGetNotificationAckValue(id: u32_) -> s32;
19854}
19855unsafe extern "C" {
19856 #[must_use]
19857 #[doc = "Initializes ptm:sysm."]
19858 pub fn ptmSysmInit() -> Result;
19859}
19860unsafe extern "C" {
19861 #[doc = "Exits ptm:sysm."]
19862 pub fn ptmSysmExit();
19863}
19864unsafe extern "C" {
19865 #[doc = "Gets a pointer to the current ptm:sysm session handle.\n # Returns\n\nA pointer to the current ptm:sysm session handle."]
19866 pub fn ptmSysmGetSessionHandle() -> *mut Handle;
19867}
19868unsafe extern "C" {
19869 #[must_use]
19870 #[doc = "Requests to enter sleep mode."]
19871 pub fn PTMSYSM_RequestSleep() -> Result;
19872}
19873unsafe extern "C" {
19874 #[must_use]
19875 #[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)"]
19876 pub fn PTMSYSM_ReplyToSleepQuery(deny: bool) -> Result;
19877}
19878unsafe extern "C" {
19879 #[must_use]
19880 #[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."]
19881 pub fn PTMSYSM_NotifySleepPreparationComplete(ackValue: s32) -> Result;
19882}
19883unsafe extern "C" {
19884 #[must_use]
19885 #[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."]
19886 pub fn PTMSYSM_SetWakeEvents(sleepConfig: *const PtmSleepConfig) -> Result;
19887}
19888unsafe extern "C" {
19889 #[must_use]
19890 #[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."]
19891 pub fn PTMSYSM_GetWakeReason(outSleepConfig: *mut PtmSleepConfig) -> Result;
19892}
19893unsafe extern "C" {
19894 #[must_use]
19895 #[doc = "Cancels the \"half-awake\" state and fully wakes up the 3DS after some delay."]
19896 pub fn PTMSYSM_Awaken() -> Result;
19897}
19898unsafe extern "C" {
19899 #[must_use]
19900 #[doc = "Clear the \"step history\"."]
19901 pub fn PTMSYSM_ClearStepHistory() -> Result;
19902}
19903unsafe extern "C" {
19904 #[must_use]
19905 #[doc = "Sets the system's step count history.\n # Arguments\n\n* `hours` - Number of hours to set the step count history for.\n * `stepValue` - Pointer to read the step count history from. (The buffer size must be at least `hours` in length)"]
19906 pub fn PTMSYSM_SetStepHistory(hours: u32_, stepValue: *const u16_) -> Result;
19907}
19908unsafe extern "C" {
19909 #[must_use]
19910 #[doc = "Clear the \"play history\"."]
19911 pub fn PTMSYSM_ClearPlayHistory() -> Result;
19912}
19913unsafe extern "C" {
19914 #[must_use]
19915 #[doc = "Sets the user time by updating the user time offset.\n # Arguments\n\n* `msY2k` - The number of milliseconds since 01/01/2000."]
19916 pub fn PTMSYSM_SetUserTime(msY2k: s64) -> Result;
19917}
19918unsafe extern "C" {
19919 #[must_use]
19920 #[doc = "Invalidates the \"system time\" (cfg block 0x30002)"]
19921 pub fn PTMSYSM_InvalidateSystemTime() -> Result;
19922}
19923unsafe extern "C" {
19924 #[must_use]
19925 #[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."]
19926 pub fn PTMSYSM_GetRtcTime(outMsY2k: *mut s64) -> Result;
19927}
19928unsafe extern "C" {
19929 #[must_use]
19930 #[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."]
19931 pub fn PTMSYSM_SetRtcTime(msY2k: s64) -> Result;
19932}
19933unsafe extern "C" {
19934 #[must_use]
19935 #[doc = "Checks whether the system is a New 3DS.\n # Arguments\n\n* `out` (direction out) - Pointer to write the New 3DS flag to."]
19936 pub fn PTMSYSM_CheckNew3DS(out: *mut bool) -> Result;
19937}
19938unsafe extern "C" {
19939 #[must_use]
19940 #[doc = "Configures the New 3DS' CPU clock speed and L2 cache.\n # Arguments\n\n* `value` - Bit0: enable higher clock, Bit1: enable L2 cache."]
19941 pub fn PTMSYSM_ConfigureNew3DSCPU(value: u8_) -> Result;
19942}
19943unsafe extern "C" {
19944 #[must_use]
19945 #[doc = "Trigger a hardware system shutdown via the MCU.\n # Arguments\n\n* `timeout:` - timeout passed to PMApp:ShutdownAsync (PrepareForReboot)."]
19946 pub fn PTMSYSM_ShutdownAsync(timeout: u64_) -> Result;
19947}
19948unsafe extern "C" {
19949 #[must_use]
19950 #[doc = "Trigger a hardware system reboot via the MCU.\n # Arguments\n\n* `timeout:` - timeout passed to PMApp:ShutdownAsync (PrepareForReboot)."]
19951 pub fn PTMSYSM_RebootAsync(timeout: u64_) -> Result;
19952}
19953unsafe extern "C" {
19954 #[must_use]
19955 #[doc = "Initializes PTMGETS."]
19956 pub fn ptmGetsInit() -> Result;
19957}
19958unsafe extern "C" {
19959 #[doc = "Exits PTMGETS."]
19960 pub fn ptmGetsExit();
19961}
19962unsafe extern "C" {
19963 #[doc = "Gets a pointer to the current ptm:gets session handle.\n # Returns\n\nA pointer to the current ptm:gets session handle."]
19964 pub fn ptmGetsGetSessionHandle() -> *mut Handle;
19965}
19966unsafe extern "C" {
19967 #[must_use]
19968 #[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."]
19969 pub fn PTMGETS_GetSystemTime(outMsY2k: *mut s64) -> Result;
19970}
19971unsafe extern "C" {
19972 #[must_use]
19973 #[doc = "Initializes PTMSETS."]
19974 pub fn ptmSetsInit() -> Result;
19975}
19976unsafe extern "C" {
19977 #[doc = "Exits PTMSETS."]
19978 pub fn ptmSetsExit();
19979}
19980unsafe extern "C" {
19981 #[doc = "Gets a pointer to the current ptm:sets session handle.\n # Returns\n\nA pointer to the current ptm:sets session handle."]
19982 pub fn ptmSetsGetSessionHandle() -> *mut Handle;
19983}
19984unsafe extern "C" {
19985 #[must_use]
19986 #[doc = "Sets the system time.\n # Arguments\n\n* `msY2k` - The number of milliseconds since 01/01/2000."]
19987 pub fn PTMSETS_SetSystemTime(msY2k: s64) -> Result;
19988}
19989#[doc = "< Do not wait."]
19990pub const WAIT_NONE: PXIDEV_WaitType = 0;
19991#[doc = "< Sleep for the specified number of nanoseconds."]
19992pub const WAIT_SLEEP: PXIDEV_WaitType = 1;
19993#[doc = "< Wait for IREQ, return if timeout."]
19994pub const WAIT_IREQ_RETURN: PXIDEV_WaitType = 2;
19995#[doc = "< Wait for IREQ, continue if timeout."]
19996pub const WAIT_IREQ_CONTINUE: PXIDEV_WaitType = 3;
19997#[doc = "Card SPI wait operation type."]
19998pub type PXIDEV_WaitType = ::libc::c_uchar;
19999#[doc = "< Do not deassert."]
20000pub const DEASSERT_NONE: PXIDEV_DeassertType = 0;
20001#[doc = "< Deassert before waiting."]
20002pub const DEASSERT_BEFORE_WAIT: PXIDEV_DeassertType = 1;
20003#[doc = "< Deassert after waiting."]
20004pub const DEASSERT_AFTER_WAIT: PXIDEV_DeassertType = 2;
20005#[doc = "Card SPI register deassertion type."]
20006pub type PXIDEV_DeassertType = ::libc::c_uchar;
20007#[doc = "Card SPI transfer buffer."]
20008#[repr(C)]
20009#[derive(Debug, Copy, Clone)]
20010pub struct PXIDEV_SPIBuffer {
20011 #[doc = "< Data pointer."]
20012 pub ptr: *mut ::libc::c_void,
20013 #[doc = "< Data size."]
20014 pub size: u32_,
20015 #[doc = "< Transfer options. See pxiDevMakeTransferOption"]
20016 pub transferOption: u8_,
20017 #[doc = "< Wait operation. See pxiDevMakeWaitOperation"]
20018 pub waitOperation: u64_,
20019}
20020#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20021const _: () = {
20022 ["Size of PXIDEV_SPIBuffer"][::core::mem::size_of::<PXIDEV_SPIBuffer>() - 24usize];
20023 ["Alignment of PXIDEV_SPIBuffer"][::core::mem::align_of::<PXIDEV_SPIBuffer>() - 8usize];
20024 ["Offset of field: PXIDEV_SPIBuffer::ptr"]
20025 [::core::mem::offset_of!(PXIDEV_SPIBuffer, ptr) - 0usize];
20026 ["Offset of field: PXIDEV_SPIBuffer::size"]
20027 [::core::mem::offset_of!(PXIDEV_SPIBuffer, size) - 4usize];
20028 ["Offset of field: PXIDEV_SPIBuffer::transferOption"]
20029 [::core::mem::offset_of!(PXIDEV_SPIBuffer, transferOption) - 8usize];
20030 ["Offset of field: PXIDEV_SPIBuffer::waitOperation"]
20031 [::core::mem::offset_of!(PXIDEV_SPIBuffer, waitOperation) - 16usize];
20032};
20033impl Default for PXIDEV_SPIBuffer {
20034 fn default() -> Self {
20035 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
20036 unsafe {
20037 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
20038 s.assume_init()
20039 }
20040 }
20041}
20042unsafe extern "C" {
20043 #[must_use]
20044 #[doc = "Initializes pxi:dev."]
20045 pub fn pxiDevInit() -> Result;
20046}
20047unsafe extern "C" {
20048 #[doc = "Shuts down pxi:dev."]
20049 pub fn pxiDevExit();
20050}
20051unsafe extern "C" {
20052 #[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."]
20053 #[link_name = "pxiDevMakeTransferOption__extern"]
20054 pub fn pxiDevMakeTransferOption(
20055 baudRate: FS_CardSpiBaudRate,
20056 busMode: FS_CardSpiBusMode,
20057 ) -> u8_;
20058}
20059unsafe extern "C" {
20060 #[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."]
20061 #[link_name = "pxiDevMakeWaitOperation__extern"]
20062 pub fn pxiDevMakeWaitOperation(
20063 waitType: PXIDEV_WaitType,
20064 deassertType: PXIDEV_DeassertType,
20065 timeout: u64_,
20066 ) -> u64_;
20067}
20068unsafe extern "C" {
20069 #[must_use]
20070 #[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."]
20071 pub fn PXIDEV_SPIMultiWriteRead(
20072 header: *mut PXIDEV_SPIBuffer,
20073 writeBuffer1: *mut PXIDEV_SPIBuffer,
20074 readBuffer1: *mut PXIDEV_SPIBuffer,
20075 writeBuffer2: *mut PXIDEV_SPIBuffer,
20076 readBuffer2: *mut PXIDEV_SPIBuffer,
20077 footer: *mut PXIDEV_SPIBuffer,
20078 ) -> Result;
20079}
20080unsafe extern "C" {
20081 #[must_use]
20082 #[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."]
20083 pub fn PXIDEV_SPIWriteRead(
20084 bytesRead: *mut u32_,
20085 initialWaitOperation: u64_,
20086 writeBuffer: *mut PXIDEV_SPIBuffer,
20087 readBuffer: *mut PXIDEV_SPIBuffer,
20088 ) -> Result;
20089}
20090unsafe extern "C" {
20091 #[must_use]
20092 #[doc = "Initializes PxiPM."]
20093 pub fn pxiPmInit() -> Result;
20094}
20095unsafe extern "C" {
20096 #[doc = "Exits PxiPM."]
20097 pub fn pxiPmExit();
20098}
20099unsafe extern "C" {
20100 #[doc = "Gets the current PxiPM session handle.\n # Returns\n\nThe current PxiPM session handle."]
20101 pub fn pxiPmGetSessionHandle() -> *mut Handle;
20102}
20103unsafe extern "C" {
20104 #[must_use]
20105 #[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."]
20106 pub fn PXIPM_GetProgramInfo(exheaderInfo: *mut ExHeader_Info, programHandle: u64_) -> Result;
20107}
20108unsafe extern "C" {
20109 #[must_use]
20110 #[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."]
20111 pub fn PXIPM_RegisterProgram(
20112 programHandle: *mut u64_,
20113 programInfo: *const FS_ProgramInfo,
20114 updateInfo: *const FS_ProgramInfo,
20115 ) -> Result;
20116}
20117unsafe extern "C" {
20118 #[must_use]
20119 #[doc = "Unloads a program and unregisters it from Process9.\n # Arguments\n\n* `programHandle` - The program handle."]
20120 pub fn PXIPM_UnregisterProgram(programHandle: u64_) -> Result;
20121}
20122#[doc = "< The mac address of the interface (u32 mac[6])"]
20123pub const NETOPT_MAC_ADDRESS: NetworkOpt = 4100;
20124#[doc = "< The ARP table [`SOCU_ARPTableEntry`]"]
20125pub const NETOPT_ARP_TABLE: NetworkOpt = 12290;
20126#[doc = "< The current IP setup [`SOCU_IPInfo`]"]
20127pub const NETOPT_IP_INFO: NetworkOpt = 16387;
20128#[doc = "< The value of the IP MTU (u32)"]
20129pub const NETOPT_IP_MTU: NetworkOpt = 16388;
20130#[doc = "< The routing table [`SOCU_RoutingTableEntry`]"]
20131pub const NETOPT_ROUTING_TABLE: NetworkOpt = 16390;
20132#[doc = "< The number of sockets in the UDP table (u32)"]
20133pub const NETOPT_UDP_NUMBER: NetworkOpt = 32770;
20134#[doc = "< The table of opened UDP sockets [`SOCU_UDPTableEntry`]"]
20135pub const NETOPT_UDP_TABLE: NetworkOpt = 32771;
20136#[doc = "< The number of sockets in the TCP table (u32)"]
20137pub const NETOPT_TCP_NUMBER: NetworkOpt = 36866;
20138#[doc = "< The table of opened TCP sockets [`SOCU_TCPTableEntry`]"]
20139pub const NETOPT_TCP_TABLE: NetworkOpt = 36867;
20140#[doc = "< The table of the DNS servers [`SOCU_DNSTableEntry`] -- Returns a buffer of size 336 but only 2 entries are set ?"]
20141pub const NETOPT_DNS_TABLE: NetworkOpt = 45059;
20142#[doc = "< The DHCP lease time remaining, in seconds"]
20143pub const NETOPT_DHCP_LEASE_TIME: NetworkOpt = 49153;
20144#[doc = "Options to be used with SOCU_GetNetworkOpt"]
20145pub type NetworkOpt = ::libc::c_ushort;
20146#[doc = "One entry of the ARP table retrieved by using SOCU_GetNetworkOpt and NETOPT_ARP_TABLE"]
20147#[repr(C)]
20148pub struct SOCU_ARPTableEntry {
20149 pub unk0: u32_,
20150 #[doc = "< The IPv4 address associated to the entry"]
20151 pub ip: in_addr,
20152 #[doc = "< The MAC address of associated to the entry"]
20153 pub mac: [u8_; 6usize],
20154 pub padding: [u8_; 2usize],
20155}
20156#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20157const _: () = {
20158 ["Size of SOCU_ARPTableEntry"][::core::mem::size_of::<SOCU_ARPTableEntry>() - 16usize];
20159 ["Alignment of SOCU_ARPTableEntry"][::core::mem::align_of::<SOCU_ARPTableEntry>() - 4usize];
20160 ["Offset of field: SOCU_ARPTableEntry::unk0"]
20161 [::core::mem::offset_of!(SOCU_ARPTableEntry, unk0) - 0usize];
20162 ["Offset of field: SOCU_ARPTableEntry::ip"]
20163 [::core::mem::offset_of!(SOCU_ARPTableEntry, ip) - 4usize];
20164 ["Offset of field: SOCU_ARPTableEntry::mac"]
20165 [::core::mem::offset_of!(SOCU_ARPTableEntry, mac) - 8usize];
20166 ["Offset of field: SOCU_ARPTableEntry::padding"]
20167 [::core::mem::offset_of!(SOCU_ARPTableEntry, padding) - 14usize];
20168};
20169impl Default for SOCU_ARPTableEntry {
20170 fn default() -> Self {
20171 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
20172 unsafe {
20173 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
20174 s.assume_init()
20175 }
20176 }
20177}
20178#[doc = "Structure returned by SOCU_GetNetworkOpt when using NETOPT_IP_INFO"]
20179#[repr(C)]
20180pub struct SOCU_IPInfo {
20181 #[doc = "< Current IPv4 address"]
20182 pub ip: in_addr,
20183 #[doc = "< Current network mask"]
20184 pub netmask: in_addr,
20185 #[doc = "< Current network broadcast address"]
20186 pub broadcast: in_addr,
20187}
20188#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20189const _: () = {
20190 ["Size of SOCU_IPInfo"][::core::mem::size_of::<SOCU_IPInfo>() - 12usize];
20191 ["Alignment of SOCU_IPInfo"][::core::mem::align_of::<SOCU_IPInfo>() - 4usize];
20192 ["Offset of field: SOCU_IPInfo::ip"][::core::mem::offset_of!(SOCU_IPInfo, ip) - 0usize];
20193 ["Offset of field: SOCU_IPInfo::netmask"]
20194 [::core::mem::offset_of!(SOCU_IPInfo, netmask) - 4usize];
20195 ["Offset of field: SOCU_IPInfo::broadcast"]
20196 [::core::mem::offset_of!(SOCU_IPInfo, broadcast) - 8usize];
20197};
20198impl Default for SOCU_IPInfo {
20199 fn default() -> Self {
20200 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
20201 unsafe {
20202 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
20203 s.assume_init()
20204 }
20205 }
20206}
20207#[doc = "One entry of the routing table retrieved by using SOCU_GetNetworkOpt and NETOPT_ROUTING_TABLE"]
20208#[repr(C)]
20209pub struct SOCU_RoutingTableEntry {
20210 #[doc = "< Destination IP address of the route"]
20211 pub dest_ip: in_addr,
20212 #[doc = "< Mask used for this route"]
20213 pub netmask: in_addr,
20214 #[doc = "< Gateway address to reach the network"]
20215 pub gateway: in_addr,
20216 #[doc = "< Linux netstat flags [`ROUTING_FLAG_G`]"]
20217 pub flags: u32_,
20218 #[doc = "< number of milliseconds since 1st Jan 1900 00:00."]
20219 pub time: u64_,
20220}
20221#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20222const _: () = {
20223 ["Size of SOCU_RoutingTableEntry"][::core::mem::size_of::<SOCU_RoutingTableEntry>() - 24usize];
20224 ["Alignment of SOCU_RoutingTableEntry"]
20225 [::core::mem::align_of::<SOCU_RoutingTableEntry>() - 8usize];
20226 ["Offset of field: SOCU_RoutingTableEntry::dest_ip"]
20227 [::core::mem::offset_of!(SOCU_RoutingTableEntry, dest_ip) - 0usize];
20228 ["Offset of field: SOCU_RoutingTableEntry::netmask"]
20229 [::core::mem::offset_of!(SOCU_RoutingTableEntry, netmask) - 4usize];
20230 ["Offset of field: SOCU_RoutingTableEntry::gateway"]
20231 [::core::mem::offset_of!(SOCU_RoutingTableEntry, gateway) - 8usize];
20232 ["Offset of field: SOCU_RoutingTableEntry::flags"]
20233 [::core::mem::offset_of!(SOCU_RoutingTableEntry, flags) - 12usize];
20234 ["Offset of field: SOCU_RoutingTableEntry::time"]
20235 [::core::mem::offset_of!(SOCU_RoutingTableEntry, time) - 16usize];
20236};
20237impl Default for SOCU_RoutingTableEntry {
20238 fn default() -> Self {
20239 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
20240 unsafe {
20241 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
20242 s.assume_init()
20243 }
20244 }
20245}
20246#[doc = "One entry of the UDP sockets table retrieved by using SOCU_GetNetworkOpt and NETOPT_UDP_TABLE"]
20247#[repr(C)]
20248pub struct SOCU_UDPTableEntry {
20249 #[doc = "< Local address information"]
20250 pub local: sockaddr_storage,
20251 #[doc = "< Remote address information"]
20252 pub remote: sockaddr_storage,
20253}
20254#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20255const _: () = {
20256 ["Size of SOCU_UDPTableEntry"][::core::mem::size_of::<SOCU_UDPTableEntry>() - 56usize];
20257 ["Alignment of SOCU_UDPTableEntry"][::core::mem::align_of::<SOCU_UDPTableEntry>() - 2usize];
20258 ["Offset of field: SOCU_UDPTableEntry::local"]
20259 [::core::mem::offset_of!(SOCU_UDPTableEntry, local) - 0usize];
20260 ["Offset of field: SOCU_UDPTableEntry::remote"]
20261 [::core::mem::offset_of!(SOCU_UDPTableEntry, remote) - 28usize];
20262};
20263impl Default for SOCU_UDPTableEntry {
20264 fn default() -> Self {
20265 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
20266 unsafe {
20267 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
20268 s.assume_init()
20269 }
20270 }
20271}
20272#[doc = "One entry of the TCP sockets table retrieved by using SOCU_GetNetworkOpt and NETOPT_TCP_TABLE"]
20273#[repr(C)]
20274pub struct SOCU_TCPTableEntry {
20275 #[doc = "< [`TCP`] states defines"]
20276 pub state: u32_,
20277 #[doc = "< Local address information"]
20278 pub local: sockaddr_storage,
20279 #[doc = "< Remote address information"]
20280 pub remote: sockaddr_storage,
20281}
20282#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20283const _: () = {
20284 ["Size of SOCU_TCPTableEntry"][::core::mem::size_of::<SOCU_TCPTableEntry>() - 60usize];
20285 ["Alignment of SOCU_TCPTableEntry"][::core::mem::align_of::<SOCU_TCPTableEntry>() - 4usize];
20286 ["Offset of field: SOCU_TCPTableEntry::state"]
20287 [::core::mem::offset_of!(SOCU_TCPTableEntry, state) - 0usize];
20288 ["Offset of field: SOCU_TCPTableEntry::local"]
20289 [::core::mem::offset_of!(SOCU_TCPTableEntry, local) - 4usize];
20290 ["Offset of field: SOCU_TCPTableEntry::remote"]
20291 [::core::mem::offset_of!(SOCU_TCPTableEntry, remote) - 32usize];
20292};
20293impl Default for SOCU_TCPTableEntry {
20294 fn default() -> Self {
20295 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
20296 unsafe {
20297 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
20298 s.assume_init()
20299 }
20300 }
20301}
20302#[doc = "One entry of the DNS servers table retrieved by using SOCU_GetNetworkOpt and NETOPT_DNS_TABLE"]
20303#[repr(C)]
20304pub struct SOCU_DNSTableEntry {
20305 pub family: u32_,
20306 #[doc = "Family of the address of the DNS server"]
20307 pub ip: in_addr,
20308 #[doc = "IP of the DNS server"]
20309 pub padding: [u8_; 12usize],
20310}
20311#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20312const _: () = {
20313 ["Size of SOCU_DNSTableEntry"][::core::mem::size_of::<SOCU_DNSTableEntry>() - 20usize];
20314 ["Alignment of SOCU_DNSTableEntry"][::core::mem::align_of::<SOCU_DNSTableEntry>() - 4usize];
20315 ["Offset of field: SOCU_DNSTableEntry::family"]
20316 [::core::mem::offset_of!(SOCU_DNSTableEntry, family) - 0usize];
20317 ["Offset of field: SOCU_DNSTableEntry::ip"]
20318 [::core::mem::offset_of!(SOCU_DNSTableEntry, ip) - 4usize];
20319 ["Offset of field: SOCU_DNSTableEntry::padding"]
20320 [::core::mem::offset_of!(SOCU_DNSTableEntry, padding) - 8usize];
20321};
20322impl Default for SOCU_DNSTableEntry {
20323 fn default() -> Self {
20324 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
20325 unsafe {
20326 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
20327 s.assume_init()
20328 }
20329 }
20330}
20331unsafe extern "C" {
20332 #[must_use]
20333 #[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."]
20334 pub fn socInit(context_addr: *mut u32_, context_size: u32_) -> Result;
20335}
20336unsafe extern "C" {
20337 #[must_use]
20338 #[doc = "Closes the soc service.\n > **Note:** You need to call this in order to be able to use the buffer again."]
20339 pub fn socExit() -> Result;
20340}
20341unsafe extern "C" {
20342 pub fn SOCU_ShutdownSockets() -> ::libc::c_int;
20343}
20344unsafe extern "C" {
20345 pub fn SOCU_CloseSockets() -> ::libc::c_int;
20346}
20347unsafe extern "C" {
20348 #[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."]
20349 pub fn SOCU_GetNetworkOpt(
20350 level: ::libc::c_int,
20351 optname: NetworkOpt,
20352 optval: *mut ::libc::c_void,
20353 optlen: *mut socklen_t,
20354 ) -> ::libc::c_int;
20355}
20356unsafe extern "C" {
20357 #[doc = "Gets the system's IP address, netmask, and subnet broadcast\n # Returns\n\nerror"]
20358 pub fn SOCU_GetIPInfo(
20359 ip: *mut in_addr,
20360 netmask: *mut in_addr,
20361 broadcast: *mut in_addr,
20362 ) -> ::libc::c_int;
20363}
20364unsafe extern "C" {
20365 #[doc = "Adds a global socket.\n # Arguments\n\n* `sockfd` - The socket fd.\n # Returns\n\nerror"]
20366 pub fn SOCU_AddGlobalSocket(sockfd: ::libc::c_int) -> ::libc::c_int;
20367}
20368#[doc = "< Unsigned 8-bit PCM."]
20369pub const MICU_ENCODING_PCM8: MICU_Encoding = 0;
20370#[doc = "< Unsigned 16-bit PCM."]
20371pub const MICU_ENCODING_PCM16: MICU_Encoding = 1;
20372#[doc = "< Signed 8-bit PCM."]
20373pub const MICU_ENCODING_PCM8_SIGNED: MICU_Encoding = 2;
20374#[doc = "< Signed 16-bit PCM."]
20375pub const MICU_ENCODING_PCM16_SIGNED: MICU_Encoding = 3;
20376#[doc = "Microphone audio encodings."]
20377pub type MICU_Encoding = ::libc::c_uchar;
20378#[doc = "< 32728.498 Hz"]
20379pub const MICU_SAMPLE_RATE_32730: MICU_SampleRate = 0;
20380#[doc = "< 16364.479 Hz"]
20381pub const MICU_SAMPLE_RATE_16360: MICU_SampleRate = 1;
20382#[doc = "< 10909.499 Hz"]
20383pub const MICU_SAMPLE_RATE_10910: MICU_SampleRate = 2;
20384#[doc = "< 8182.1245 Hz"]
20385pub const MICU_SAMPLE_RATE_8180: MICU_SampleRate = 3;
20386#[doc = "Microphone audio sampling rates."]
20387pub type MICU_SampleRate = ::libc::c_uchar;
20388unsafe extern "C" {
20389 #[must_use]
20390 #[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."]
20391 pub fn micInit(buffer: *mut u8_, bufferSize: u32_) -> Result;
20392}
20393unsafe extern "C" {
20394 #[doc = "Exits MIC."]
20395 pub fn micExit();
20396}
20397unsafe extern "C" {
20398 #[doc = "Gets the size of the sample data area within the shared memory buffer.\n # Returns\n\nThe sample data's size."]
20399 pub fn micGetSampleDataSize() -> u32_;
20400}
20401unsafe extern "C" {
20402 #[doc = "Gets the offset within the shared memory buffer of the last sample written.\n # Returns\n\nThe last sample's offset."]
20403 pub fn micGetLastSampleOffset() -> u32_;
20404}
20405unsafe extern "C" {
20406 #[must_use]
20407 #[doc = "Maps MIC shared memory.\n # Arguments\n\n* `size` - Size of the shared memory.\n * `handle` - Handle of the shared memory."]
20408 pub fn MICU_MapSharedMem(size: u32_, handle: Handle) -> Result;
20409}
20410unsafe extern "C" {
20411 #[must_use]
20412 #[doc = "Unmaps MIC shared memory."]
20413 pub fn MICU_UnmapSharedMem() -> Result;
20414}
20415unsafe extern "C" {
20416 #[must_use]
20417 #[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."]
20418 pub fn MICU_StartSampling(
20419 encoding: MICU_Encoding,
20420 sampleRate: MICU_SampleRate,
20421 offset: u32_,
20422 size: u32_,
20423 loop_: bool,
20424 ) -> Result;
20425}
20426unsafe extern "C" {
20427 #[must_use]
20428 #[doc = "Adjusts the configuration of the current sampling session.\n # Arguments\n\n* `sampleRate` - Sample rate of outputted audio."]
20429 pub fn MICU_AdjustSampling(sampleRate: MICU_SampleRate) -> Result;
20430}
20431unsafe extern "C" {
20432 #[must_use]
20433 #[doc = "Stops sampling microphone input."]
20434 pub fn MICU_StopSampling() -> Result;
20435}
20436unsafe extern "C" {
20437 #[must_use]
20438 #[doc = "Gets whether microphone input is currently being sampled.\n # Arguments\n\n* `sampling` - Pointer to output the sampling state to."]
20439 pub fn MICU_IsSampling(sampling: *mut bool) -> Result;
20440}
20441unsafe extern "C" {
20442 #[must_use]
20443 #[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."]
20444 pub fn MICU_GetEventHandle(handle: *mut Handle) -> Result;
20445}
20446unsafe extern "C" {
20447 #[must_use]
20448 #[doc = "Sets the microphone's gain.\n # Arguments\n\n* `gain` - Gain to set."]
20449 pub fn MICU_SetGain(gain: u8_) -> Result;
20450}
20451unsafe extern "C" {
20452 #[must_use]
20453 #[doc = "Gets the microphone's gain.\n # Arguments\n\n* `gain` - Pointer to output the current gain to."]
20454 pub fn MICU_GetGain(gain: *mut u8_) -> Result;
20455}
20456unsafe extern "C" {
20457 #[must_use]
20458 #[doc = "Sets whether the microphone is powered on.\n # Arguments\n\n* `power` - Whether the microphone is powered on."]
20459 pub fn MICU_SetPower(power: bool) -> Result;
20460}
20461unsafe extern "C" {
20462 #[must_use]
20463 #[doc = "Gets whether the microphone is powered on.\n # Arguments\n\n* `power` - Pointer to output the power state to."]
20464 pub fn MICU_GetPower(power: *mut bool) -> Result;
20465}
20466unsafe extern "C" {
20467 #[must_use]
20468 #[doc = "Sets whether to clamp microphone input.\n # Arguments\n\n* `clamp` - Whether to clamp microphone input."]
20469 pub fn MICU_SetClamp(clamp: bool) -> Result;
20470}
20471unsafe extern "C" {
20472 #[must_use]
20473 #[doc = "Gets whether to clamp microphone input.\n # Arguments\n\n* `clamp` - Pointer to output the clamp state to."]
20474 pub fn MICU_GetClamp(clamp: *mut bool) -> Result;
20475}
20476unsafe extern "C" {
20477 #[must_use]
20478 #[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."]
20479 pub fn MICU_SetAllowShellClosed(allowShellClosed: bool) -> Result;
20480}
20481#[doc = "< Converting color formats."]
20482pub const MVDMODE_COLORFORMATCONV: MVDSTD_Mode = 0;
20483#[doc = "< Processing video."]
20484pub const MVDMODE_VIDEOPROCESSING: MVDSTD_Mode = 1;
20485#[doc = "Processing mode."]
20486pub type MVDSTD_Mode = ::libc::c_uchar;
20487#[doc = "< YUYV422"]
20488pub const MVD_INPUT_YUYV422: MVDSTD_InputFormat = 65537;
20489#[doc = "< H264"]
20490pub const MVD_INPUT_H264: MVDSTD_InputFormat = 131073;
20491#[doc = "Input format."]
20492pub type MVDSTD_InputFormat = ::libc::c_uint;
20493#[doc = "< YUYV422"]
20494pub const MVD_OUTPUT_YUYV422: MVDSTD_OutputFormat = 65537;
20495#[doc = "< BGR565"]
20496pub const MVD_OUTPUT_BGR565: MVDSTD_OutputFormat = 262146;
20497#[doc = "< RGB565"]
20498pub const MVD_OUTPUT_RGB565: MVDSTD_OutputFormat = 262148;
20499#[doc = "Output format."]
20500pub type MVDSTD_OutputFormat = ::libc::c_uint;
20501#[doc = "Processing configuration."]
20502#[repr(C)]
20503#[derive(Debug, Copy, Clone)]
20504pub struct MVDSTD_Config {
20505 #[doc = "< Input type."]
20506 pub input_type: MVDSTD_InputFormat,
20507 #[doc = "< Unknown."]
20508 pub unk_x04: u32_,
20509 #[doc = "< Unknown. Referred to as \"H264 range\" in SKATER."]
20510 pub unk_x08: u32_,
20511 #[doc = "< Input width."]
20512 pub inwidth: u32_,
20513 #[doc = "< Input height."]
20514 pub inheight: u32_,
20515 #[doc = "< Physical address of color conversion input data."]
20516 pub physaddr_colorconv_indata: u32_,
20517 #[doc = "< Physical address used with color conversion."]
20518 pub physaddr_colorconv_unk0: u32_,
20519 #[doc = "< Physical address used with color conversion."]
20520 pub physaddr_colorconv_unk1: u32_,
20521 #[doc = "< Physical address used with color conversion."]
20522 pub physaddr_colorconv_unk2: u32_,
20523 #[doc = "< Physical address used with color conversion."]
20524 pub physaddr_colorconv_unk3: u32_,
20525 #[doc = "< Unknown."]
20526 pub unk_x28: [u32_; 6usize],
20527 #[doc = "< Enables cropping with the input image when non-zero via the following 4 words."]
20528 pub enable_cropping: u32_,
20529 pub input_crop_x_pos: u32_,
20530 pub input_crop_y_pos: u32_,
20531 pub input_crop_height: u32_,
20532 pub input_crop_width: u32_,
20533 #[doc = "< Unknown."]
20534 pub unk_x54: u32_,
20535 #[doc = "< Output type."]
20536 pub output_type: MVDSTD_OutputFormat,
20537 #[doc = "< Output width."]
20538 pub outwidth: u32_,
20539 #[doc = "< Output height."]
20540 pub outheight: u32_,
20541 #[doc = "< Physical address of output data."]
20542 pub physaddr_outdata0: u32_,
20543 #[doc = "< Additional physical address for output data, only used when the output format type is value 0x00020001."]
20544 pub physaddr_outdata1: u32_,
20545 #[doc = "< Unknown."]
20546 pub unk_x6c: [u32_; 38usize],
20547 #[doc = "< This enables using the following 4 words when non-zero."]
20548 pub flag_x104: u32_,
20549 #[doc = "< Output X position in the output buffer."]
20550 pub output_x_pos: u32_,
20551 #[doc = "< Same as above except for the Y pos."]
20552 pub output_y_pos: u32_,
20553 #[doc = "< Used for aligning the output width when larger than the output width. Overrides the output width when smaller than the output width."]
20554 pub output_width_override: u32_,
20555 #[doc = "< Same as output_width_override except for the output height."]
20556 pub output_height_override: u32_,
20557 pub unk_x118: u32_,
20558}
20559#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20560const _: () = {
20561 ["Size of MVDSTD_Config"][::core::mem::size_of::<MVDSTD_Config>() - 284usize];
20562 ["Alignment of MVDSTD_Config"][::core::mem::align_of::<MVDSTD_Config>() - 4usize];
20563 ["Offset of field: MVDSTD_Config::input_type"]
20564 [::core::mem::offset_of!(MVDSTD_Config, input_type) - 0usize];
20565 ["Offset of field: MVDSTD_Config::unk_x04"]
20566 [::core::mem::offset_of!(MVDSTD_Config, unk_x04) - 4usize];
20567 ["Offset of field: MVDSTD_Config::unk_x08"]
20568 [::core::mem::offset_of!(MVDSTD_Config, unk_x08) - 8usize];
20569 ["Offset of field: MVDSTD_Config::inwidth"]
20570 [::core::mem::offset_of!(MVDSTD_Config, inwidth) - 12usize];
20571 ["Offset of field: MVDSTD_Config::inheight"]
20572 [::core::mem::offset_of!(MVDSTD_Config, inheight) - 16usize];
20573 ["Offset of field: MVDSTD_Config::physaddr_colorconv_indata"]
20574 [::core::mem::offset_of!(MVDSTD_Config, physaddr_colorconv_indata) - 20usize];
20575 ["Offset of field: MVDSTD_Config::physaddr_colorconv_unk0"]
20576 [::core::mem::offset_of!(MVDSTD_Config, physaddr_colorconv_unk0) - 24usize];
20577 ["Offset of field: MVDSTD_Config::physaddr_colorconv_unk1"]
20578 [::core::mem::offset_of!(MVDSTD_Config, physaddr_colorconv_unk1) - 28usize];
20579 ["Offset of field: MVDSTD_Config::physaddr_colorconv_unk2"]
20580 [::core::mem::offset_of!(MVDSTD_Config, physaddr_colorconv_unk2) - 32usize];
20581 ["Offset of field: MVDSTD_Config::physaddr_colorconv_unk3"]
20582 [::core::mem::offset_of!(MVDSTD_Config, physaddr_colorconv_unk3) - 36usize];
20583 ["Offset of field: MVDSTD_Config::unk_x28"]
20584 [::core::mem::offset_of!(MVDSTD_Config, unk_x28) - 40usize];
20585 ["Offset of field: MVDSTD_Config::enable_cropping"]
20586 [::core::mem::offset_of!(MVDSTD_Config, enable_cropping) - 64usize];
20587 ["Offset of field: MVDSTD_Config::input_crop_x_pos"]
20588 [::core::mem::offset_of!(MVDSTD_Config, input_crop_x_pos) - 68usize];
20589 ["Offset of field: MVDSTD_Config::input_crop_y_pos"]
20590 [::core::mem::offset_of!(MVDSTD_Config, input_crop_y_pos) - 72usize];
20591 ["Offset of field: MVDSTD_Config::input_crop_height"]
20592 [::core::mem::offset_of!(MVDSTD_Config, input_crop_height) - 76usize];
20593 ["Offset of field: MVDSTD_Config::input_crop_width"]
20594 [::core::mem::offset_of!(MVDSTD_Config, input_crop_width) - 80usize];
20595 ["Offset of field: MVDSTD_Config::unk_x54"]
20596 [::core::mem::offset_of!(MVDSTD_Config, unk_x54) - 84usize];
20597 ["Offset of field: MVDSTD_Config::output_type"]
20598 [::core::mem::offset_of!(MVDSTD_Config, output_type) - 88usize];
20599 ["Offset of field: MVDSTD_Config::outwidth"]
20600 [::core::mem::offset_of!(MVDSTD_Config, outwidth) - 92usize];
20601 ["Offset of field: MVDSTD_Config::outheight"]
20602 [::core::mem::offset_of!(MVDSTD_Config, outheight) - 96usize];
20603 ["Offset of field: MVDSTD_Config::physaddr_outdata0"]
20604 [::core::mem::offset_of!(MVDSTD_Config, physaddr_outdata0) - 100usize];
20605 ["Offset of field: MVDSTD_Config::physaddr_outdata1"]
20606 [::core::mem::offset_of!(MVDSTD_Config, physaddr_outdata1) - 104usize];
20607 ["Offset of field: MVDSTD_Config::unk_x6c"]
20608 [::core::mem::offset_of!(MVDSTD_Config, unk_x6c) - 108usize];
20609 ["Offset of field: MVDSTD_Config::flag_x104"]
20610 [::core::mem::offset_of!(MVDSTD_Config, flag_x104) - 260usize];
20611 ["Offset of field: MVDSTD_Config::output_x_pos"]
20612 [::core::mem::offset_of!(MVDSTD_Config, output_x_pos) - 264usize];
20613 ["Offset of field: MVDSTD_Config::output_y_pos"]
20614 [::core::mem::offset_of!(MVDSTD_Config, output_y_pos) - 268usize];
20615 ["Offset of field: MVDSTD_Config::output_width_override"]
20616 [::core::mem::offset_of!(MVDSTD_Config, output_width_override) - 272usize];
20617 ["Offset of field: MVDSTD_Config::output_height_override"]
20618 [::core::mem::offset_of!(MVDSTD_Config, output_height_override) - 276usize];
20619 ["Offset of field: MVDSTD_Config::unk_x118"]
20620 [::core::mem::offset_of!(MVDSTD_Config, unk_x118) - 280usize];
20621};
20622impl Default for MVDSTD_Config {
20623 fn default() -> Self {
20624 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
20625 unsafe {
20626 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
20627 s.assume_init()
20628 }
20629 }
20630}
20631#[repr(C)]
20632#[derive(Debug, Default, Copy, Clone)]
20633pub struct MVDSTD_ProcessNALUnitOut {
20634 pub end_vaddr: u32_,
20635 pub end_physaddr: u32_,
20636 pub remaining_size: u32_,
20637}
20638#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20639const _: () = {
20640 ["Size of MVDSTD_ProcessNALUnitOut"]
20641 [::core::mem::size_of::<MVDSTD_ProcessNALUnitOut>() - 12usize];
20642 ["Alignment of MVDSTD_ProcessNALUnitOut"]
20643 [::core::mem::align_of::<MVDSTD_ProcessNALUnitOut>() - 4usize];
20644 ["Offset of field: MVDSTD_ProcessNALUnitOut::end_vaddr"]
20645 [::core::mem::offset_of!(MVDSTD_ProcessNALUnitOut, end_vaddr) - 0usize];
20646 ["Offset of field: MVDSTD_ProcessNALUnitOut::end_physaddr"]
20647 [::core::mem::offset_of!(MVDSTD_ProcessNALUnitOut, end_physaddr) - 4usize];
20648 ["Offset of field: MVDSTD_ProcessNALUnitOut::remaining_size"]
20649 [::core::mem::offset_of!(MVDSTD_ProcessNALUnitOut, remaining_size) - 8usize];
20650};
20651#[repr(C)]
20652#[derive(Debug, Copy, Clone)]
20653pub struct MVDSTD_OutputBuffersEntry {
20654 pub outdata0: *mut ::libc::c_void,
20655 pub outdata1: *mut ::libc::c_void,
20656}
20657#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20658const _: () = {
20659 ["Size of MVDSTD_OutputBuffersEntry"]
20660 [::core::mem::size_of::<MVDSTD_OutputBuffersEntry>() - 8usize];
20661 ["Alignment of MVDSTD_OutputBuffersEntry"]
20662 [::core::mem::align_of::<MVDSTD_OutputBuffersEntry>() - 4usize];
20663 ["Offset of field: MVDSTD_OutputBuffersEntry::outdata0"]
20664 [::core::mem::offset_of!(MVDSTD_OutputBuffersEntry, outdata0) - 0usize];
20665 ["Offset of field: MVDSTD_OutputBuffersEntry::outdata1"]
20666 [::core::mem::offset_of!(MVDSTD_OutputBuffersEntry, outdata1) - 4usize];
20667};
20668impl Default for MVDSTD_OutputBuffersEntry {
20669 fn default() -> Self {
20670 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
20671 unsafe {
20672 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
20673 s.assume_init()
20674 }
20675 }
20676}
20677#[repr(C)]
20678#[derive(Debug, Copy, Clone)]
20679pub struct MVDSTD_OutputBuffersEntryList {
20680 pub total_entries: u32_,
20681 pub entries: [MVDSTD_OutputBuffersEntry; 17usize],
20682}
20683#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20684const _: () = {
20685 ["Size of MVDSTD_OutputBuffersEntryList"]
20686 [::core::mem::size_of::<MVDSTD_OutputBuffersEntryList>() - 140usize];
20687 ["Alignment of MVDSTD_OutputBuffersEntryList"]
20688 [::core::mem::align_of::<MVDSTD_OutputBuffersEntryList>() - 4usize];
20689 ["Offset of field: MVDSTD_OutputBuffersEntryList::total_entries"]
20690 [::core::mem::offset_of!(MVDSTD_OutputBuffersEntryList, total_entries) - 0usize];
20691 ["Offset of field: MVDSTD_OutputBuffersEntryList::entries"]
20692 [::core::mem::offset_of!(MVDSTD_OutputBuffersEntryList, entries) - 4usize];
20693};
20694impl Default for MVDSTD_OutputBuffersEntryList {
20695 fn default() -> Self {
20696 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
20697 unsafe {
20698 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
20699 s.assume_init()
20700 }
20701 }
20702}
20703#[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"]
20704#[repr(C)]
20705#[derive(Debug, Default, Copy, Clone)]
20706pub struct MVDSTD_InitStruct {
20707 pub cmd5_inval0: s8,
20708 pub cmd5_inval1: s8,
20709 pub cmd5_inval2: s8,
20710 pub cmd5_inval3: u32_,
20711 pub cmd1b_inval: u8_,
20712}
20713#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20714const _: () = {
20715 ["Size of MVDSTD_InitStruct"][::core::mem::size_of::<MVDSTD_InitStruct>() - 12usize];
20716 ["Alignment of MVDSTD_InitStruct"][::core::mem::align_of::<MVDSTD_InitStruct>() - 4usize];
20717 ["Offset of field: MVDSTD_InitStruct::cmd5_inval0"]
20718 [::core::mem::offset_of!(MVDSTD_InitStruct, cmd5_inval0) - 0usize];
20719 ["Offset of field: MVDSTD_InitStruct::cmd5_inval1"]
20720 [::core::mem::offset_of!(MVDSTD_InitStruct, cmd5_inval1) - 1usize];
20721 ["Offset of field: MVDSTD_InitStruct::cmd5_inval2"]
20722 [::core::mem::offset_of!(MVDSTD_InitStruct, cmd5_inval2) - 2usize];
20723 ["Offset of field: MVDSTD_InitStruct::cmd5_inval3"]
20724 [::core::mem::offset_of!(MVDSTD_InitStruct, cmd5_inval3) - 4usize];
20725 ["Offset of field: MVDSTD_InitStruct::cmd1b_inval"]
20726 [::core::mem::offset_of!(MVDSTD_InitStruct, cmd1b_inval) - 8usize];
20727};
20728#[repr(C)]
20729#[derive(Debug, Default, Copy, Clone)]
20730pub struct MVDSTD_WithLevel {
20731 pub enable: u8_,
20732 pub flag: u8_,
20733 pub double_size: u8_,
20734 pub level: u8_,
20735}
20736#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20737const _: () = {
20738 ["Size of MVDSTD_WithLevel"][::core::mem::size_of::<MVDSTD_WithLevel>() - 4usize];
20739 ["Alignment of MVDSTD_WithLevel"][::core::mem::align_of::<MVDSTD_WithLevel>() - 1usize];
20740 ["Offset of field: MVDSTD_WithLevel::enable"]
20741 [::core::mem::offset_of!(MVDSTD_WithLevel, enable) - 0usize];
20742 ["Offset of field: MVDSTD_WithLevel::flag"]
20743 [::core::mem::offset_of!(MVDSTD_WithLevel, flag) - 1usize];
20744 ["Offset of field: MVDSTD_WithLevel::double_size"]
20745 [::core::mem::offset_of!(MVDSTD_WithLevel, double_size) - 2usize];
20746 ["Offset of field: MVDSTD_WithLevel::level"]
20747 [::core::mem::offset_of!(MVDSTD_WithLevel, level) - 3usize];
20748};
20749#[repr(C)]
20750#[derive(Debug, Default, Copy, Clone)]
20751pub struct MVDSTD_WithNumOfRefFrames {
20752 pub enable: u8_,
20753 pub ref_frames: u8_,
20754}
20755#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20756const _: () = {
20757 ["Size of MVDSTD_WithNumOfRefFrames"]
20758 [::core::mem::size_of::<MVDSTD_WithNumOfRefFrames>() - 2usize];
20759 ["Alignment of MVDSTD_WithNumOfRefFrames"]
20760 [::core::mem::align_of::<MVDSTD_WithNumOfRefFrames>() - 1usize];
20761 ["Offset of field: MVDSTD_WithNumOfRefFrames::enable"]
20762 [::core::mem::offset_of!(MVDSTD_WithNumOfRefFrames, enable) - 0usize];
20763 ["Offset of field: MVDSTD_WithNumOfRefFrames::ref_frames"]
20764 [::core::mem::offset_of!(MVDSTD_WithNumOfRefFrames, ref_frames) - 1usize];
20765};
20766#[doc = "H.264 buffer calculation configuration.\n See here for detailed explanations : https://www.3dbrew.org/wiki/MVDSTD:CalculateWorkBufSize."]
20767#[repr(C)]
20768#[derive(Debug, Default, Copy, Clone)]
20769pub struct MVDSTD_CalculateWorkBufSizeConfig {
20770 pub unused_0x00: u8_,
20771 pub level: MVDSTD_WithLevel,
20772 pub ref_frames_a: MVDSTD_WithNumOfRefFrames,
20773 pub ref_frames_b: MVDSTD_WithNumOfRefFrames,
20774 pub unused_0x09: [u8_; 3usize],
20775 pub unk_0x0c: u32_,
20776 pub unk_0x10: u32_,
20777 pub unk_0x14: u32_,
20778 pub unk_0x18: u32_,
20779 pub unk_0x1c: u32_,
20780 pub unk_0x20: u32_,
20781 pub unk_0x24: u32_,
20782 pub width: u32_,
20783 pub height: u32_,
20784}
20785#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20786const _: () = {
20787 ["Size of MVDSTD_CalculateWorkBufSizeConfig"]
20788 [::core::mem::size_of::<MVDSTD_CalculateWorkBufSizeConfig>() - 48usize];
20789 ["Alignment of MVDSTD_CalculateWorkBufSizeConfig"]
20790 [::core::mem::align_of::<MVDSTD_CalculateWorkBufSizeConfig>() - 4usize];
20791 ["Offset of field: MVDSTD_CalculateWorkBufSizeConfig::unused_0x00"]
20792 [::core::mem::offset_of!(MVDSTD_CalculateWorkBufSizeConfig, unused_0x00) - 0usize];
20793 ["Offset of field: MVDSTD_CalculateWorkBufSizeConfig::level"]
20794 [::core::mem::offset_of!(MVDSTD_CalculateWorkBufSizeConfig, level) - 1usize];
20795 ["Offset of field: MVDSTD_CalculateWorkBufSizeConfig::ref_frames_a"]
20796 [::core::mem::offset_of!(MVDSTD_CalculateWorkBufSizeConfig, ref_frames_a) - 5usize];
20797 ["Offset of field: MVDSTD_CalculateWorkBufSizeConfig::ref_frames_b"]
20798 [::core::mem::offset_of!(MVDSTD_CalculateWorkBufSizeConfig, ref_frames_b) - 7usize];
20799 ["Offset of field: MVDSTD_CalculateWorkBufSizeConfig::unused_0x09"]
20800 [::core::mem::offset_of!(MVDSTD_CalculateWorkBufSizeConfig, unused_0x09) - 9usize];
20801 ["Offset of field: MVDSTD_CalculateWorkBufSizeConfig::unk_0x0c"]
20802 [::core::mem::offset_of!(MVDSTD_CalculateWorkBufSizeConfig, unk_0x0c) - 12usize];
20803 ["Offset of field: MVDSTD_CalculateWorkBufSizeConfig::unk_0x10"]
20804 [::core::mem::offset_of!(MVDSTD_CalculateWorkBufSizeConfig, unk_0x10) - 16usize];
20805 ["Offset of field: MVDSTD_CalculateWorkBufSizeConfig::unk_0x14"]
20806 [::core::mem::offset_of!(MVDSTD_CalculateWorkBufSizeConfig, unk_0x14) - 20usize];
20807 ["Offset of field: MVDSTD_CalculateWorkBufSizeConfig::unk_0x18"]
20808 [::core::mem::offset_of!(MVDSTD_CalculateWorkBufSizeConfig, unk_0x18) - 24usize];
20809 ["Offset of field: MVDSTD_CalculateWorkBufSizeConfig::unk_0x1c"]
20810 [::core::mem::offset_of!(MVDSTD_CalculateWorkBufSizeConfig, unk_0x1c) - 28usize];
20811 ["Offset of field: MVDSTD_CalculateWorkBufSizeConfig::unk_0x20"]
20812 [::core::mem::offset_of!(MVDSTD_CalculateWorkBufSizeConfig, unk_0x20) - 32usize];
20813 ["Offset of field: MVDSTD_CalculateWorkBufSizeConfig::unk_0x24"]
20814 [::core::mem::offset_of!(MVDSTD_CalculateWorkBufSizeConfig, unk_0x24) - 36usize];
20815 ["Offset of field: MVDSTD_CalculateWorkBufSizeConfig::width"]
20816 [::core::mem::offset_of!(MVDSTD_CalculateWorkBufSizeConfig, width) - 40usize];
20817 ["Offset of field: MVDSTD_CalculateWorkBufSizeConfig::height"]
20818 [::core::mem::offset_of!(MVDSTD_CalculateWorkBufSizeConfig, height) - 44usize];
20819};
20820unsafe extern "C" {
20821 #[must_use]
20822 #[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."]
20823 pub fn mvdstdInit(
20824 mode: MVDSTD_Mode,
20825 input_type: MVDSTD_InputFormat,
20826 output_type: MVDSTD_OutputFormat,
20827 size: u32_,
20828 initstruct: *mut MVDSTD_InitStruct,
20829 ) -> Result;
20830}
20831unsafe extern "C" {
20832 #[doc = "Shuts down MVDSTD."]
20833 pub fn mvdstdExit();
20834}
20835unsafe extern "C" {
20836 #[must_use]
20837 #[doc = "Calculate working buffer size for H.264 decoding.\n # Arguments\n\n* `config` - Calculation config, config->level.level must NOT exceed MVD_H264_LEVEL_5_2. See here for more explanations : https://www.3dbrew.org/wiki/MVDSTD:CalculateWorkBufSize.\n * `size_out` - Calculated buffer size in bytes."]
20838 pub fn mvdstdCalculateBufferSize(
20839 config: *const MVDSTD_CalculateWorkBufSizeConfig,
20840 size_out: *mut u32_,
20841 ) -> Result;
20842}
20843unsafe extern "C" {
20844 #[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."]
20845 pub fn mvdstdGenerateDefaultConfig(
20846 config: *mut MVDSTD_Config,
20847 input_width: u32_,
20848 input_height: u32_,
20849 output_width: u32_,
20850 output_height: u32_,
20851 vaddr_colorconv_indata: *mut u32_,
20852 vaddr_outdata0: *mut u32_,
20853 vaddr_outdata1: *mut u32_,
20854 );
20855}
20856unsafe extern "C" {
20857 #[must_use]
20858 #[doc = "Run color-format-conversion.\n # Arguments\n\n* `config` - Pointer to the configuration to use."]
20859 pub fn mvdstdConvertImage(config: *mut MVDSTD_Config) -> Result;
20860}
20861unsafe extern "C" {
20862 #[must_use]
20863 #[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."]
20864 pub fn mvdstdProcessVideoFrame(
20865 inbuf_vaddr: *mut ::libc::c_void,
20866 size: usize,
20867 flag: u32_,
20868 out: *mut MVDSTD_ProcessNALUnitOut,
20869 ) -> Result;
20870}
20871unsafe extern "C" {
20872 #[must_use]
20873 #[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."]
20874 pub fn mvdstdRenderVideoFrame(config: *mut MVDSTD_Config, wait: bool) -> Result;
20875}
20876unsafe extern "C" {
20877 #[must_use]
20878 #[doc = "Sets the current configuration of MVDSTD.\n # Arguments\n\n* `config` - Pointer to the configuration to set."]
20879 pub fn MVDSTD_SetConfig(config: *mut MVDSTD_Config) -> Result;
20880}
20881unsafe extern "C" {
20882 #[must_use]
20883 #[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."]
20884 pub fn mvdstdSetupOutputBuffers(
20885 entrylist: *mut MVDSTD_OutputBuffersEntryList,
20886 bufsize: u32_,
20887 ) -> Result;
20888}
20889unsafe extern "C" {
20890 #[must_use]
20891 #[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."]
20892 pub fn mvdstdOverrideOutputBuffers(
20893 cur_outdata0: *mut ::libc::c_void,
20894 cur_outdata1: *mut ::libc::c_void,
20895 new_outdata0: *mut ::libc::c_void,
20896 new_outdata1: *mut ::libc::c_void,
20897 ) -> Result;
20898}
20899pub const NFC_OpType_1: NFC_OpType = 1;
20900#[doc = "Unknown."]
20901pub const NFC_OpType_NFCTag: NFC_OpType = 2;
20902#[doc = "This is the default."]
20903pub const NFC_OpType_RawNFC: NFC_OpType = 3;
20904#[doc = "NFC operation type."]
20905pub type NFC_OpType = ::libc::c_uchar;
20906pub const NFC_TagState_Uninitialized: NFC_TagState = 0;
20907#[doc = "nfcInit() was not used yet."]
20908pub const NFC_TagState_ScanningStopped: NFC_TagState = 1;
20909#[doc = "Not currently scanning for NFC tags. Set by nfcStopScanning() and nfcInit(), when successful."]
20910pub const NFC_TagState_Scanning: NFC_TagState = 2;
20911#[doc = "Currently scanning for NFC tags. Set by nfcStartScanning() when successful."]
20912pub const NFC_TagState_InRange: NFC_TagState = 3;
20913#[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."]
20914pub const NFC_TagState_OutOfRange: NFC_TagState = 4;
20915#[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."]
20916pub const NFC_TagState_DataReady: NFC_TagState = 5;
20917pub type NFC_TagState = ::libc::c_uchar;
20918pub const NFC_amiiboFlag_Setup: _bindgen_ty_29 = 16;
20919#[doc = "This indicates that the amiibo was setup with amiibo Settings. nfcGetAmiiboSettings() will return an all-zero struct when this is not set."]
20920pub const NFC_amiiboFlag_AppDataSetup: _bindgen_ty_29 = 32;
20921#[doc = "Bit4-7 are always clear with nfcGetAmiiboSettings() due to \"& 0xF\"."]
20922pub type _bindgen_ty_29 = ::libc::c_uchar;
20923#[repr(C)]
20924#[derive(Debug, Copy, Clone)]
20925pub struct NFC_TagInfo {
20926 pub id_offset_size: u16_,
20927 #[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+<offsetfield-10>. It's unknown in what cases this 10-byte ID data is used.\""]
20928 pub unk_x2: u8_,
20929 pub unk_x3: u8_,
20930 pub id: [u8_; 40usize],
20931}
20932#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20933const _: () = {
20934 ["Size of NFC_TagInfo"][::core::mem::size_of::<NFC_TagInfo>() - 44usize];
20935 ["Alignment of NFC_TagInfo"][::core::mem::align_of::<NFC_TagInfo>() - 2usize];
20936 ["Offset of field: NFC_TagInfo::id_offset_size"]
20937 [::core::mem::offset_of!(NFC_TagInfo, id_offset_size) - 0usize];
20938 ["Offset of field: NFC_TagInfo::unk_x2"][::core::mem::offset_of!(NFC_TagInfo, unk_x2) - 2usize];
20939 ["Offset of field: NFC_TagInfo::unk_x3"][::core::mem::offset_of!(NFC_TagInfo, unk_x3) - 3usize];
20940 ["Offset of field: NFC_TagInfo::id"][::core::mem::offset_of!(NFC_TagInfo, id) - 4usize];
20941};
20942impl Default for NFC_TagInfo {
20943 fn default() -> Self {
20944 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
20945 unsafe {
20946 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
20947 s.assume_init()
20948 }
20949 }
20950}
20951#[doc = "AmiiboSettings structure, see also here: https://3dbrew.org/wiki/NFC:GetAmiiboSettings"]
20952#[repr(C)]
20953#[derive(Debug, Copy, Clone)]
20954pub struct NFC_AmiiboSettings {
20955 pub mii: [u8_; 96usize],
20956 #[doc = "\"Owner Mii.\""]
20957 pub nickname: [u16_; 11usize],
20958 #[doc = "\"UTF-16BE Amiibo nickname.\""]
20959 pub flags: u8_,
20960 #[doc = "\"This is plaintext_amiibosettingsdata[0] & 0xF.\" See also the NFC_amiiboFlag enums."]
20961 pub countrycodeid: u8_,
20962 #[doc = "\"This is plaintext_amiibosettingsdata[1].\" \"Country Code ID, from the system which setup this amiibo.\""]
20963 pub setupdate_year: u16_,
20964 pub setupdate_month: u8_,
20965 pub setupdate_day: u8_,
20966 pub unk_x7c: [u8_; 44usize],
20967}
20968#[allow(clippy::unnecessary_operation, clippy::identity_op)]
20969const _: () = {
20970 ["Size of NFC_AmiiboSettings"][::core::mem::size_of::<NFC_AmiiboSettings>() - 168usize];
20971 ["Alignment of NFC_AmiiboSettings"][::core::mem::align_of::<NFC_AmiiboSettings>() - 2usize];
20972 ["Offset of field: NFC_AmiiboSettings::mii"]
20973 [::core::mem::offset_of!(NFC_AmiiboSettings, mii) - 0usize];
20974 ["Offset of field: NFC_AmiiboSettings::nickname"]
20975 [::core::mem::offset_of!(NFC_AmiiboSettings, nickname) - 96usize];
20976 ["Offset of field: NFC_AmiiboSettings::flags"]
20977 [::core::mem::offset_of!(NFC_AmiiboSettings, flags) - 118usize];
20978 ["Offset of field: NFC_AmiiboSettings::countrycodeid"]
20979 [::core::mem::offset_of!(NFC_AmiiboSettings, countrycodeid) - 119usize];
20980 ["Offset of field: NFC_AmiiboSettings::setupdate_year"]
20981 [::core::mem::offset_of!(NFC_AmiiboSettings, setupdate_year) - 120usize];
20982 ["Offset of field: NFC_AmiiboSettings::setupdate_month"]
20983 [::core::mem::offset_of!(NFC_AmiiboSettings, setupdate_month) - 122usize];
20984 ["Offset of field: NFC_AmiiboSettings::setupdate_day"]
20985 [::core::mem::offset_of!(NFC_AmiiboSettings, setupdate_day) - 123usize];
20986 ["Offset of field: NFC_AmiiboSettings::unk_x7c"]
20987 [::core::mem::offset_of!(NFC_AmiiboSettings, unk_x7c) - 124usize];
20988};
20989impl Default for NFC_AmiiboSettings {
20990 fn default() -> Self {
20991 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
20992 unsafe {
20993 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
20994 s.assume_init()
20995 }
20996 }
20997}
20998#[doc = "AmiiboConfig structure, see also here: https://3dbrew.org/wiki/NFC:GetAmiiboConfig"]
20999#[repr(C)]
21000#[derive(Debug, Copy, Clone)]
21001pub struct NFC_AmiiboConfig {
21002 pub lastwritedate_year: u16_,
21003 pub lastwritedate_month: u8_,
21004 pub lastwritedate_day: u8_,
21005 pub write_counter: u16_,
21006 pub characterID: [u8_; 3usize],
21007 #[doc = "the first element is the collection ID, the second the character in this collection, the third the variant"]
21008 pub series: u8_,
21009 #[doc = "ID of the series"]
21010 pub amiiboID: u16_,
21011 #[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"]
21012 pub type_: u8_,
21013 #[doc = "Type of amiibo 0 = figure, 1 = card, 2 = plush"]
21014 pub pagex4_byte3: u8_,
21015 pub appdata_size: u16_,
21016 #[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. ...\""]
21017 pub zeros: [u8_; 48usize],
21018}
21019#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21020const _: () = {
21021 ["Size of NFC_AmiiboConfig"][::core::mem::size_of::<NFC_AmiiboConfig>() - 64usize];
21022 ["Alignment of NFC_AmiiboConfig"][::core::mem::align_of::<NFC_AmiiboConfig>() - 2usize];
21023 ["Offset of field: NFC_AmiiboConfig::lastwritedate_year"]
21024 [::core::mem::offset_of!(NFC_AmiiboConfig, lastwritedate_year) - 0usize];
21025 ["Offset of field: NFC_AmiiboConfig::lastwritedate_month"]
21026 [::core::mem::offset_of!(NFC_AmiiboConfig, lastwritedate_month) - 2usize];
21027 ["Offset of field: NFC_AmiiboConfig::lastwritedate_day"]
21028 [::core::mem::offset_of!(NFC_AmiiboConfig, lastwritedate_day) - 3usize];
21029 ["Offset of field: NFC_AmiiboConfig::write_counter"]
21030 [::core::mem::offset_of!(NFC_AmiiboConfig, write_counter) - 4usize];
21031 ["Offset of field: NFC_AmiiboConfig::characterID"]
21032 [::core::mem::offset_of!(NFC_AmiiboConfig, characterID) - 6usize];
21033 ["Offset of field: NFC_AmiiboConfig::series"]
21034 [::core::mem::offset_of!(NFC_AmiiboConfig, series) - 9usize];
21035 ["Offset of field: NFC_AmiiboConfig::amiiboID"]
21036 [::core::mem::offset_of!(NFC_AmiiboConfig, amiiboID) - 10usize];
21037 ["Offset of field: NFC_AmiiboConfig::type_"]
21038 [::core::mem::offset_of!(NFC_AmiiboConfig, type_) - 12usize];
21039 ["Offset of field: NFC_AmiiboConfig::pagex4_byte3"]
21040 [::core::mem::offset_of!(NFC_AmiiboConfig, pagex4_byte3) - 13usize];
21041 ["Offset of field: NFC_AmiiboConfig::appdata_size"]
21042 [::core::mem::offset_of!(NFC_AmiiboConfig, appdata_size) - 14usize];
21043 ["Offset of field: NFC_AmiiboConfig::zeros"]
21044 [::core::mem::offset_of!(NFC_AmiiboConfig, zeros) - 16usize];
21045};
21046impl Default for NFC_AmiiboConfig {
21047 fn default() -> Self {
21048 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
21049 unsafe {
21050 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
21051 s.assume_init()
21052 }
21053 }
21054}
21055#[doc = "Used by nfcInitializeWriteAppData() internally, see also here: https://3dbrew.org/wiki/NFC:GetAppDataInitStruct"]
21056#[repr(C)]
21057#[derive(Debug, Copy, Clone)]
21058pub struct NFC_AppDataInitStruct {
21059 pub data_x0: [u8_; 12usize],
21060 pub data_xc: [u8_; 48usize],
21061}
21062#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21063const _: () = {
21064 ["Size of NFC_AppDataInitStruct"][::core::mem::size_of::<NFC_AppDataInitStruct>() - 60usize];
21065 ["Alignment of NFC_AppDataInitStruct"]
21066 [::core::mem::align_of::<NFC_AppDataInitStruct>() - 1usize];
21067 ["Offset of field: NFC_AppDataInitStruct::data_x0"]
21068 [::core::mem::offset_of!(NFC_AppDataInitStruct, data_x0) - 0usize];
21069 ["Offset of field: NFC_AppDataInitStruct::data_xc"]
21070 [::core::mem::offset_of!(NFC_AppDataInitStruct, data_xc) - 12usize];
21071};
21072impl Default for NFC_AppDataInitStruct {
21073 fn default() -> Self {
21074 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
21075 unsafe {
21076 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
21077 s.assume_init()
21078 }
21079 }
21080}
21081#[doc = "Used by nfcWriteAppData() internally, see also: https://3dbrew.org/wiki/NFC:WriteAppData"]
21082#[repr(C)]
21083#[derive(Debug, Default, Copy, Clone)]
21084pub struct NFC_AppDataWriteStruct {
21085 pub id: [u8_; 10usize],
21086 pub id_size: u8_,
21087 pub unused_xb: [u8_; 21usize],
21088}
21089#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21090const _: () = {
21091 ["Size of NFC_AppDataWriteStruct"][::core::mem::size_of::<NFC_AppDataWriteStruct>() - 32usize];
21092 ["Alignment of NFC_AppDataWriteStruct"]
21093 [::core::mem::align_of::<NFC_AppDataWriteStruct>() - 1usize];
21094 ["Offset of field: NFC_AppDataWriteStruct::id"]
21095 [::core::mem::offset_of!(NFC_AppDataWriteStruct, id) - 0usize];
21096 ["Offset of field: NFC_AppDataWriteStruct::id_size"]
21097 [::core::mem::offset_of!(NFC_AppDataWriteStruct, id_size) - 10usize];
21098 ["Offset of field: NFC_AppDataWriteStruct::unused_xb"]
21099 [::core::mem::offset_of!(NFC_AppDataWriteStruct, unused_xb) - 11usize];
21100};
21101unsafe extern "C" {
21102 #[must_use]
21103 #[doc = "Initializes NFC.\n # Arguments\n\n* `type` - See the NFC_OpType enum."]
21104 pub fn nfcInit(type_: NFC_OpType) -> Result;
21105}
21106unsafe extern "C" {
21107 #[doc = "Shuts down NFC."]
21108 pub fn nfcExit();
21109}
21110unsafe extern "C" {
21111 #[doc = "Gets the NFC service handle.\n # Returns\n\nThe NFC service handle."]
21112 pub fn nfcGetSessionHandle() -> Handle;
21113}
21114unsafe extern "C" {
21115 #[must_use]
21116 #[doc = "Starts scanning for NFC tags.\n # Arguments\n\n* `inval` - Unknown. See NFC_STARTSCAN_DEFAULTINPUT."]
21117 pub fn nfcStartScanning(inval: u16_) -> Result;
21118}
21119unsafe extern "C" {
21120 #[doc = "Stops scanning for NFC tags."]
21121 pub fn nfcStopScanning();
21122}
21123unsafe extern "C" {
21124 #[must_use]
21125 #[doc = "Read amiibo NFC data and load in memory."]
21126 pub fn nfcLoadAmiiboData() -> Result;
21127}
21128unsafe extern "C" {
21129 #[must_use]
21130 #[doc = "If the tagstate is valid(NFC_TagState_DataReady or 6), it then sets the current tagstate to NFC_TagState_InRange."]
21131 pub fn nfcResetTagScanState() -> Result;
21132}
21133unsafe extern "C" {
21134 #[must_use]
21135 #[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."]
21136 pub fn nfcUpdateStoredAmiiboData() -> Result;
21137}
21138unsafe extern "C" {
21139 #[must_use]
21140 #[doc = "Returns the current NFC tag state.\n # Arguments\n\n* `state` - Pointer to write NFC tag state."]
21141 pub fn nfcGetTagState(state: *mut NFC_TagState) -> Result;
21142}
21143unsafe extern "C" {
21144 #[must_use]
21145 #[doc = "Returns the current TagInfo.\n # Arguments\n\n* `out` - Pointer to write the output TagInfo."]
21146 pub fn nfcGetTagInfo(out: *mut NFC_TagInfo) -> Result;
21147}
21148unsafe extern "C" {
21149 #[must_use]
21150 #[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"]
21151 pub fn nfcOpenAppData(amiibo_appid: u32_) -> Result;
21152}
21153unsafe extern "C" {
21154 #[must_use]
21155 #[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."]
21156 pub fn nfcInitializeWriteAppData(
21157 amiibo_appid: u32_,
21158 buf: *const ::libc::c_void,
21159 size: usize,
21160 ) -> Result;
21161}
21162unsafe extern "C" {
21163 #[must_use]
21164 #[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."]
21165 pub fn nfcReadAppData(buf: *mut ::libc::c_void, size: usize) -> Result;
21166}
21167unsafe extern "C" {
21168 #[must_use]
21169 #[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()."]
21170 pub fn nfcWriteAppData(
21171 buf: *const ::libc::c_void,
21172 size: usize,
21173 taginfo: *mut NFC_TagInfo,
21174 ) -> Result;
21175}
21176unsafe extern "C" {
21177 #[must_use]
21178 #[doc = "Returns the current AmiiboSettings.\n # Arguments\n\n* `out` - Pointer to write the output AmiiboSettings."]
21179 pub fn nfcGetAmiiboSettings(out: *mut NFC_AmiiboSettings) -> Result;
21180}
21181unsafe extern "C" {
21182 #[must_use]
21183 #[doc = "Returns the current AmiiboConfig.\n # Arguments\n\n* `out` - Pointer to write the output AmiiboConfig."]
21184 pub fn nfcGetAmiiboConfig(out: *mut NFC_AmiiboConfig) -> Result;
21185}
21186unsafe extern "C" {
21187 #[must_use]
21188 #[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."]
21189 pub fn nfcStartOtherTagScanning(unk0: u16_, unk1: u32_) -> Result;
21190}
21191unsafe extern "C" {
21192 #[must_use]
21193 #[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."]
21194 pub fn nfcSendTagCommand(
21195 inbuf: *const ::libc::c_void,
21196 insize: usize,
21197 outbuf: *mut ::libc::c_void,
21198 outsize: usize,
21199 actual_transfer_size: *mut usize,
21200 microseconds: u64_,
21201 ) -> Result;
21202}
21203unsafe extern "C" {
21204 #[must_use]
21205 #[doc = "Unknown. This can only be used when initialized with NFC_OpType_RawNFC, and when the TagState is NFC_TagState_InRange."]
21206 pub fn nfcCmd21() -> Result;
21207}
21208unsafe extern "C" {
21209 #[must_use]
21210 #[doc = "Unknown. This can only be used when initialized with NFC_OpType_RawNFC, and when the TagState is NFC_TagState_InRange."]
21211 pub fn nfcCmd22() -> Result;
21212}
21213#[doc = "Notification header data."]
21214#[repr(C)]
21215#[derive(Debug, Default, Copy, Clone)]
21216pub struct NotificationHeader {
21217 pub dataSet: bool,
21218 pub unread: bool,
21219 pub enableJPEG: bool,
21220 pub isSpotPass: bool,
21221 pub isOptedOut: bool,
21222 pub unkData: [u8_; 3usize],
21223 pub processID: u64_,
21224 pub unkData2: [u8_; 8usize],
21225 pub jumpParam: u64_,
21226 pub unkData3: [u8_; 8usize],
21227 pub time: u64_,
21228 pub title: [u16_; 32usize],
21229}
21230#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21231const _: () = {
21232 ["Size of NotificationHeader"][::core::mem::size_of::<NotificationHeader>() - 112usize];
21233 ["Alignment of NotificationHeader"][::core::mem::align_of::<NotificationHeader>() - 8usize];
21234 ["Offset of field: NotificationHeader::dataSet"]
21235 [::core::mem::offset_of!(NotificationHeader, dataSet) - 0usize];
21236 ["Offset of field: NotificationHeader::unread"]
21237 [::core::mem::offset_of!(NotificationHeader, unread) - 1usize];
21238 ["Offset of field: NotificationHeader::enableJPEG"]
21239 [::core::mem::offset_of!(NotificationHeader, enableJPEG) - 2usize];
21240 ["Offset of field: NotificationHeader::isSpotPass"]
21241 [::core::mem::offset_of!(NotificationHeader, isSpotPass) - 3usize];
21242 ["Offset of field: NotificationHeader::isOptedOut"]
21243 [::core::mem::offset_of!(NotificationHeader, isOptedOut) - 4usize];
21244 ["Offset of field: NotificationHeader::unkData"]
21245 [::core::mem::offset_of!(NotificationHeader, unkData) - 5usize];
21246 ["Offset of field: NotificationHeader::processID"]
21247 [::core::mem::offset_of!(NotificationHeader, processID) - 8usize];
21248 ["Offset of field: NotificationHeader::unkData2"]
21249 [::core::mem::offset_of!(NotificationHeader, unkData2) - 16usize];
21250 ["Offset of field: NotificationHeader::jumpParam"]
21251 [::core::mem::offset_of!(NotificationHeader, jumpParam) - 24usize];
21252 ["Offset of field: NotificationHeader::unkData3"]
21253 [::core::mem::offset_of!(NotificationHeader, unkData3) - 32usize];
21254 ["Offset of field: NotificationHeader::time"]
21255 [::core::mem::offset_of!(NotificationHeader, time) - 40usize];
21256 ["Offset of field: NotificationHeader::title"]
21257 [::core::mem::offset_of!(NotificationHeader, title) - 48usize];
21258};
21259unsafe extern "C" {
21260 #[must_use]
21261 #[doc = "Initializes NEWS."]
21262 pub fn newsInit() -> Result;
21263}
21264unsafe extern "C" {
21265 #[doc = "Exits NEWS."]
21266 pub fn newsExit();
21267}
21268unsafe extern "C" {
21269 #[must_use]
21270 #[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."]
21271 pub fn NEWS_AddNotification(
21272 title: *const u16_,
21273 titleLength: u32_,
21274 message: *const u16_,
21275 messageLength: u32_,
21276 imageData: *const ::libc::c_void,
21277 imageSize: u32_,
21278 jpeg: bool,
21279 ) -> Result;
21280}
21281unsafe extern "C" {
21282 #[must_use]
21283 #[doc = "Gets current total notifications number.\n # Arguments\n\n* `num` - Pointer where total number will be saved."]
21284 pub fn NEWS_GetTotalNotifications(num: *mut u32_) -> Result;
21285}
21286unsafe extern "C" {
21287 #[must_use]
21288 #[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."]
21289 pub fn NEWS_SetNotificationHeader(news_id: u32_, header: *const NotificationHeader) -> Result;
21290}
21291unsafe extern "C" {
21292 #[must_use]
21293 #[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."]
21294 pub fn NEWS_GetNotificationHeader(news_id: u32_, header: *mut NotificationHeader) -> Result;
21295}
21296unsafe extern "C" {
21297 #[must_use]
21298 #[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."]
21299 pub fn NEWS_SetNotificationMessage(news_id: u32_, message: *const u16_, size: u32_) -> Result;
21300}
21301unsafe extern "C" {
21302 #[must_use]
21303 #[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."]
21304 pub fn NEWS_GetNotificationMessage(
21305 news_id: u32_,
21306 message: *mut u16_,
21307 size: *mut u32_,
21308 ) -> Result;
21309}
21310unsafe extern "C" {
21311 #[must_use]
21312 #[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."]
21313 pub fn NEWS_SetNotificationImage(
21314 news_id: u32_,
21315 buffer: *const ::libc::c_void,
21316 size: u32_,
21317 ) -> Result;
21318}
21319unsafe extern "C" {
21320 #[must_use]
21321 #[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."]
21322 pub fn NEWS_GetNotificationImage(
21323 news_id: u32_,
21324 buffer: *mut ::libc::c_void,
21325 size: *mut u32_,
21326 ) -> Result;
21327}
21328#[doc = "< QTM is fully enabled."]
21329pub const QTM_STATUS_ENABLED: QtmStatus = 0;
21330#[doc = "< QTM \"super stable 3D\" feature is disabled. Parallax barrier hardware state is configured to match O3DS."]
21331pub const QTM_STATUS_SS3D_DISABLED: QtmStatus = 1;
21332#[doc = "QTM is unavailable: either \"blacklisted\" (usually by NS) for the current title, **or console is a N2DSXL**.\n\n In this state, all QTM functionality is disabled. This includes \"super-stable 3D\"\n (ie. auto barrier adjustment) including `qtm:s` manual barrier position setting functions,\n head tracking, IR LED control and camera luminance reporting (400.0 is returned instead).\n\n > **Note:** `qtm:c` barrier hardware state setting function (blah) bypasses this state.\n > **Note:** Due to an oversight, QTMS_SetQtmStatus allows changing QTM state on N2DSXL. This is not intended\n to be done, and is in fact never done by official software."]
21333pub const QTM_STATUS_UNAVAILABLE: QtmStatus = 2;
21334#[doc = "QTM enablement status (when cameras not in use by user), set by `qtm:s`.\n > **Note:** Manual IR LED control, camera lux, and `qtm:c` commands remain available\n for use on N3DS and N3DSXL regardless."]
21335pub type QtmStatus = ::libc::c_uchar;
21336#[doc = "QTM status data (fully enabled/SS3D disabled) in `cfg`. Usually all-zero on N2DSXL."]
21337#[repr(C)]
21338#[derive(Debug, Copy, Clone)]
21339pub struct QtmStatusCfgData {
21340 #[doc = "< QTM status at boot (fully enabled or SS3D disabled)."]
21341 pub defaultStats: QtmStatus,
21342 #[doc = "\"Global variable\" (.data) section load mode? Unused.\n From CTRAging:\n - 0: \"normal\"\n - 1: \"single reacq\"\n - 2: \"double reacq\"\n- 3/4/5: \"w2w copy 1/10/100\""]
21343 pub gvLoadMode: u8_,
21344 #[doc = "< Padding."]
21345 pub _padding: [u8_; 2usize],
21346}
21347#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21348const _: () = {
21349 ["Size of QtmStatusCfgData"][::core::mem::size_of::<QtmStatusCfgData>() - 4usize];
21350 ["Alignment of QtmStatusCfgData"][::core::mem::align_of::<QtmStatusCfgData>() - 1usize];
21351 ["Offset of field: QtmStatusCfgData::defaultStats"]
21352 [::core::mem::offset_of!(QtmStatusCfgData, defaultStats) - 0usize];
21353 ["Offset of field: QtmStatusCfgData::gvLoadMode"]
21354 [::core::mem::offset_of!(QtmStatusCfgData, gvLoadMode) - 1usize];
21355 ["Offset of field: QtmStatusCfgData::_padding"]
21356 [::core::mem::offset_of!(QtmStatusCfgData, _padding) - 2usize];
21357};
21358impl Default for QtmStatusCfgData {
21359 fn default() -> Self {
21360 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
21361 unsafe {
21362 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
21363 s.assume_init()
21364 }
21365 }
21366}
21367#[doc = "QTM calibration data (fully enabled/SS3D disabled) in `cfg`. Usually all-zero on N2DSXL."]
21368#[repr(C)]
21369#[derive(Debug, Default, Copy, Clone)]
21370pub struct QtmCalibrationData {
21371 #[doc = "Neutral (center) barrier position/offset (with slit width of 6 units), when the user is\n facing directly facing the camera, that is to say, their eye midpoint normalized X coord\n in the camera's plane is 0, assuming the user's head is located at the expected viewing distance\n and at the expected eye-to-camera angle (as per the rest of this structure).\n This is expressed in terms of iod/12 units modulo iod/12 (thus, range is 0 to 11 included),\n with IOD (interocular distance) assumed to be 62mm.\n > **Note:** This field is floating-point for QTM auto-adjustment purposes, however the actual barrier\n position in hardware is an integer.\n > **Note:** This is the field that System Settings lets you add -1.0 to +1.0 to.\n > **Note:** Moreover, this field can be directly changed through QTMS_SetCenterBarrierPosition."]
21372 pub centerBarrierPosition: f32,
21373 #[doc = "< Lens X coord in inner camera space? Very low value and seems to be unused."]
21374 pub translationX: f32,
21375 #[doc = "< Lens Y coord in inner camera space? Very low value and seems to be unused."]
21376 pub translationY: f32,
21377 #[doc = "< Optimal eye-to-camera angle, in radians, without accounting for lens distortion."]
21378 pub rotationZ: f32,
21379 #[doc = "< Camera's horizontal FoV in degrees, without accounting for lens distortion."]
21380 pub fovX: f32,
21381 #[doc = "< Optimal viewing distance between user and top screen, assuming iod to be 62mm."]
21382 pub viewingDistance: f32,
21383}
21384#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21385const _: () = {
21386 ["Size of QtmCalibrationData"][::core::mem::size_of::<QtmCalibrationData>() - 24usize];
21387 ["Alignment of QtmCalibrationData"][::core::mem::align_of::<QtmCalibrationData>() - 4usize];
21388 ["Offset of field: QtmCalibrationData::centerBarrierPosition"]
21389 [::core::mem::offset_of!(QtmCalibrationData, centerBarrierPosition) - 0usize];
21390 ["Offset of field: QtmCalibrationData::translationX"]
21391 [::core::mem::offset_of!(QtmCalibrationData, translationX) - 4usize];
21392 ["Offset of field: QtmCalibrationData::translationY"]
21393 [::core::mem::offset_of!(QtmCalibrationData, translationY) - 8usize];
21394 ["Offset of field: QtmCalibrationData::rotationZ"]
21395 [::core::mem::offset_of!(QtmCalibrationData, rotationZ) - 12usize];
21396 ["Offset of field: QtmCalibrationData::fovX"]
21397 [::core::mem::offset_of!(QtmCalibrationData, fovX) - 16usize];
21398 ["Offset of field: QtmCalibrationData::viewingDistance"]
21399 [::core::mem::offset_of!(QtmCalibrationData, viewingDistance) - 20usize];
21400};
21401#[doc = "< Left eye."]
21402pub const QTM_EYE_LEFT: QtmEyeSide = 0;
21403#[doc = "< Right eye."]
21404pub const QTM_EYE_RIGHT: QtmEyeSide = 1;
21405#[doc = "< Number of eyes."]
21406pub const QTM_EYE_NUM: QtmEyeSide = 2;
21407#[doc = "Left eye or right eye, for QtmTrackingData and QtmRawTrackingData"]
21408pub type QtmEyeSide = ::libc::c_uchar;
21409#[doc = "QTM raw eye tracking data"]
21410#[repr(C)]
21411#[derive(Debug, Default, Copy, Clone)]
21412pub struct QtmRawTrackingData {
21413 #[doc = "< Eye position detected or predicted, equals (confidenceLevel > 0)."]
21414 pub eyesTracked: bool,
21415 #[doc = "< Padding."]
21416 pub _padding: [u8_; 3usize],
21417 #[doc = "< Pointer to eye-tracking singleton pointer, in QTM's .bss, located in N3DS extra memory."]
21418 pub singletonQtmPtr: u32_,
21419 #[doc = "< Eye tracking confidence level (0 to 1)."]
21420 pub confidenceLevel: f32,
21421 #[doc = "Raw predicted or detected eye coordinates. Each eye is represented as one point.\n Fractional part is *not* necessarily zero.\n > **Note:** X coord is within 0 to 320.\n > **Note:** Y coord is within 0 to 240."]
21422 pub rawEyeCameraCoordinates: [[f32; 2usize]; 2usize],
21423 #[doc = "< Difference in gyro pitch from position at console boot."]
21424 pub dPitch: f32,
21425 #[doc = "< Difference in gyro yaw from position at console boot."]
21426 pub dYaw: f32,
21427 #[doc = "< Difference in gyro roll from position at console boot."]
21428 pub dRoll: f32,
21429 #[doc = "< Time point the current measurements were made."]
21430 pub samplingTick: s64,
21431}
21432#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21433const _: () = {
21434 ["Size of QtmRawTrackingData"][::core::mem::size_of::<QtmRawTrackingData>() - 48usize];
21435 ["Alignment of QtmRawTrackingData"][::core::mem::align_of::<QtmRawTrackingData>() - 8usize];
21436 ["Offset of field: QtmRawTrackingData::eyesTracked"]
21437 [::core::mem::offset_of!(QtmRawTrackingData, eyesTracked) - 0usize];
21438 ["Offset of field: QtmRawTrackingData::_padding"]
21439 [::core::mem::offset_of!(QtmRawTrackingData, _padding) - 1usize];
21440 ["Offset of field: QtmRawTrackingData::singletonQtmPtr"]
21441 [::core::mem::offset_of!(QtmRawTrackingData, singletonQtmPtr) - 4usize];
21442 ["Offset of field: QtmRawTrackingData::confidenceLevel"]
21443 [::core::mem::offset_of!(QtmRawTrackingData, confidenceLevel) - 8usize];
21444 ["Offset of field: QtmRawTrackingData::rawEyeCameraCoordinates"]
21445 [::core::mem::offset_of!(QtmRawTrackingData, rawEyeCameraCoordinates) - 12usize];
21446 ["Offset of field: QtmRawTrackingData::dPitch"]
21447 [::core::mem::offset_of!(QtmRawTrackingData, dPitch) - 28usize];
21448 ["Offset of field: QtmRawTrackingData::dYaw"]
21449 [::core::mem::offset_of!(QtmRawTrackingData, dYaw) - 32usize];
21450 ["Offset of field: QtmRawTrackingData::dRoll"]
21451 [::core::mem::offset_of!(QtmRawTrackingData, dRoll) - 36usize];
21452 ["Offset of field: QtmRawTrackingData::samplingTick"]
21453 [::core::mem::offset_of!(QtmRawTrackingData, samplingTick) - 40usize];
21454};
21455#[doc = "QTM processed eye tracking data, suitable for 3D programming"]
21456#[repr(C)]
21457#[derive(Debug, Default, Copy, Clone)]
21458pub struct QtmTrackingData {
21459 #[doc = "< Eye position detected or tracked with some confidence, equals (confidenceLevel > 0). Even if false, QTM may make a guess"]
21460 pub eyesTracked: bool,
21461 #[doc = "< Whether or not the entirety of the user's face has been detected with good confidence."]
21462 pub faceDetected: bool,
21463 #[doc = "< Whether or not the user's eyes have actually been detected with full confidence."]
21464 pub eyesDetected: bool,
21465 #[doc = "< Unused."]
21466 pub _unused: u8_,
21467 #[doc = "< Whether or not the normalized eye coordinates have been clamped after accounting for lens distortion."]
21468 pub clamped: bool,
21469 #[doc = "< Padding."]
21470 pub _padding: [u8_; 3usize],
21471 #[doc = "< Eye tracking confidence level (0 to 1)."]
21472 pub confidenceLevel: f32,
21473 #[doc = "Normalized eye coordinates, for each eye, after accounting for lens distortion, centered around camera.\n X coord is in the -1 to 1 range, and Y coord range depends on inverse aspect ratio (-0.75 to 0.75 on real hardware).\n > **Note:** On real hardware, X coord equals `((rawX / 160.0) - 1.00) * 1.0639` before clamping.\n > **Note:** On real hardware, Y coord equals `((rawY / 160.0) - 0.75) * 1.0637` before clamping."]
21474 pub eyeCameraCoordinates: [[f32; 2usize]; 2usize],
21475 #[doc = "Normalized eye coordinates, for each eye, in world space.\n Corresponds to eyeCameraCoordinates multiplied by tangent of field of view.\n > **Note:** On real hardware, X coord equals `eyeCameraCoordinates.x * tan(64.9 deg / 2)`.\n > **Note:** On real hardware, Y coord equals `eyeCameraCoordinates.x * tan(51.0 deg / 2)`."]
21476 pub eyeWorldCoordinates: [[f32; 2usize]; 2usize],
21477 #[doc = "< Difference in gyro pitch from position at console boot."]
21478 pub dPitch: f32,
21479 #[doc = "< Difference in gyro yaw from position at console boot."]
21480 pub dYaw: f32,
21481 #[doc = "< Difference in gyro roll from position at console boot."]
21482 pub dRoll: f32,
21483 #[doc = "< Time point the current measurements were made."]
21484 pub samplingTick: s64,
21485}
21486#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21487const _: () = {
21488 ["Size of QtmTrackingData"][::core::mem::size_of::<QtmTrackingData>() - 64usize];
21489 ["Alignment of QtmTrackingData"][::core::mem::align_of::<QtmTrackingData>() - 8usize];
21490 ["Offset of field: QtmTrackingData::eyesTracked"]
21491 [::core::mem::offset_of!(QtmTrackingData, eyesTracked) - 0usize];
21492 ["Offset of field: QtmTrackingData::faceDetected"]
21493 [::core::mem::offset_of!(QtmTrackingData, faceDetected) - 1usize];
21494 ["Offset of field: QtmTrackingData::eyesDetected"]
21495 [::core::mem::offset_of!(QtmTrackingData, eyesDetected) - 2usize];
21496 ["Offset of field: QtmTrackingData::_unused"]
21497 [::core::mem::offset_of!(QtmTrackingData, _unused) - 3usize];
21498 ["Offset of field: QtmTrackingData::clamped"]
21499 [::core::mem::offset_of!(QtmTrackingData, clamped) - 4usize];
21500 ["Offset of field: QtmTrackingData::_padding"]
21501 [::core::mem::offset_of!(QtmTrackingData, _padding) - 5usize];
21502 ["Offset of field: QtmTrackingData::confidenceLevel"]
21503 [::core::mem::offset_of!(QtmTrackingData, confidenceLevel) - 8usize];
21504 ["Offset of field: QtmTrackingData::eyeCameraCoordinates"]
21505 [::core::mem::offset_of!(QtmTrackingData, eyeCameraCoordinates) - 12usize];
21506 ["Offset of field: QtmTrackingData::eyeWorldCoordinates"]
21507 [::core::mem::offset_of!(QtmTrackingData, eyeWorldCoordinates) - 28usize];
21508 ["Offset of field: QtmTrackingData::dPitch"]
21509 [::core::mem::offset_of!(QtmTrackingData, dPitch) - 44usize];
21510 ["Offset of field: QtmTrackingData::dYaw"]
21511 [::core::mem::offset_of!(QtmTrackingData, dYaw) - 48usize];
21512 ["Offset of field: QtmTrackingData::dRoll"]
21513 [::core::mem::offset_of!(QtmTrackingData, dRoll) - 52usize];
21514 ["Offset of field: QtmTrackingData::samplingTick"]
21515 [::core::mem::offset_of!(QtmTrackingData, samplingTick) - 56usize];
21516};
21517#[doc = "`qtm:u`: has eye-tracking commands and IR LED control commands, but for some\n reason cannot fetch ambiant lux data from the camera's luminosity sensor."]
21518pub const QTM_SERVICE_USER: QtmServiceName = 0;
21519#[doc = "`qtm:s`: has access to all `qtm:u` commands, plus luminosity sensor, plus\n manual barrier position setting and calibration adjustment commands.\n Automatic barrier control is reenabled on session exit."]
21520pub const QTM_SERVICE_SYSTEM: QtmServiceName = 1;
21521#[doc = "`qtm:sp`: has access to all `qtm:s` (and `qtm:u`) commands, and merely has a\n few more commands that GSP uses to notify QTM of 2D<>3D mode switches and\n power events. Automatic barrier control is reenabled on session exit.\n GSP always keeps a `qtm:sp` sessions open (at least on latest system version),\n whereas NS opens then immediately closes a `qtm:sp` sessions only when dealing\n with a \"blacklisted\" application (that is, almost never)."]
21522pub const QTM_SERVICE_SYSTEM_PROCESS: QtmServiceName = 2;
21523#[doc = "QTM service name enum, excluding `qtm:c`"]
21524pub type QtmServiceName = ::libc::c_uchar;
21525unsafe extern "C" {
21526 #[doc = "Check whether or not QTM services are registered.\n # Returns\n\nTrue on O3DS systems, false on N3DS systems."]
21527 pub fn qtmCheckServicesRegistered() -> bool;
21528}
21529unsafe extern "C" {
21530 #[must_use]
21531 #[doc = "Initializes QTM (except `qtm:c`).\n Excluding `qtm:c`, QTM has three main services.\n Only 3 sessions (2 until 9.3.0 sysupdate) for ALL services COMBINED, including `qtm:c`,\n can be open at a time.\n Refer to QtmServiceName enum value descriptions to see which service to choose.\n\n # Arguments\n\n* `serviceName` - QTM service name enum value (corresponding to `qtm:u`, `qtm:s` and `qtm:sp`\n respectively).\n > **Note:** Result of qtmCheckServicesRegistered should be checked before calling this function."]
21532 pub fn qtmInit(serviceName: QtmServiceName) -> Result;
21533}
21534unsafe extern "C" {
21535 #[doc = "Exits QTM."]
21536 pub fn qtmExit();
21537}
21538unsafe extern "C" {
21539 #[doc = "Checks whether or not a `qtm:u`, `qtm:s` or `qtm:sp` session is active."]
21540 pub fn qtmIsInitialized() -> bool;
21541}
21542unsafe extern "C" {
21543 #[doc = "Returns a pointer to the current `qtm:u` / `qtm:s` / `qtm:sp` session handle."]
21544 pub fn qtmGetSessionHandle() -> *mut Handle;
21545}
21546unsafe extern "C" {
21547 #[must_use]
21548 #[doc = "Gets the current raw eye tracking data, with an optional prediction made for predictionTimePointOrZero = t+dt,\n or for the current time point (QTM makes predictions based on gyro data since inner camera runs at 30 FPS).\n\n # Arguments\n\n* `outData` (direction out) - Where to write the raw tracking data to. Cleared to all-zero on failure (instead of being left uninitialized).\n * `predictionTimePointOrZero` - Either zero, or the time point (in system ticks) for which to make a prediction for.\n Maximum 1 frame (at 30 FPS) in the past, and up to 5 frames in the future.\n # Returns\n\n`0xC8A18008` if camera is in use by user, or `0xC8A183EF` if QTM is unavailable (in particular, QTM is always\n unavailable on N2DSXL), Otherwise, 0 (success). Return value should be checked by caller.\n > **Note:** Consider using QTMU_GetTrackingDataEx instead."]
21549 pub fn QTMU_GetRawTrackingDataEx(
21550 outData: *mut QtmRawTrackingData,
21551 predictionTimePointOrZero: s64,
21552 ) -> Result;
21553}
21554unsafe extern "C" {
21555 #[must_use]
21556 #[doc = "Gets the current raw eye tracking data.\n\n # Arguments\n\n* `outData` (direction out) - Where to write the raw tracking data to. Cleared to all-zero on failure (instead of being left uninitialized).\n # Returns\n\n`0xC8A18008` if camera is in use by user, or `0xC8A183EF` if QTM is unavailable (in particular, QTM is always\n unavailable on N2DSXL), Otherwise, 0 (success). Return value should be checked by caller.\n > **Note:** Consider using QTMU_GetTrackingData instead."]
21557 #[link_name = "QTMU_GetRawTrackingData__extern"]
21558 pub fn QTMU_GetRawTrackingData(outData: *mut QtmRawTrackingData) -> Result;
21559}
21560unsafe extern "C" {
21561 #[must_use]
21562 #[doc = "Gets the current normalized eye tracking data, made suitable for 3D programming with an optional prediction made\n for predictionTimePointOrZero = t+dt, or for the current time point (QTM makes predictions based on gyro data since\n inner camera runs at 30 FPS).\n\n # Arguments\n\n* `outData` (direction out) - Where to write the raw tracking data to. Cleared to all-zero on failure (instead of being left uninitialized).\n * `predictionTimePointOrZero` - Either zero, or the time point (in system ticks) for which to make a prediction for.\n Maximum 1 frame (at 30 FPS) in the past, and up to 5 frames in the future.\n # Returns\n\n`0xC8A18008` if camera is in use by user, or `0xC8A183EF` if QTM is unavailable (in particular, QTM is always\n unavailable on N2DSXL). Otherwise, 0 (success). Return value should be checked by caller.\n > **Note:** This can, for example, be used in games to allow the user to control the scene's camera with their own face."]
21563 pub fn QTMU_GetTrackingDataEx(
21564 outData: *mut QtmTrackingData,
21565 predictionTimePointOrZero: s64,
21566 ) -> Result;
21567}
21568unsafe extern "C" {
21569 #[must_use]
21570 #[doc = "Gets the current normalized eye tracking data, made suitable for 3D programming.\n\n # Arguments\n\n* `outData` (direction out) - Where to write the raw tracking data to. Cleared to all-zero on failure (instead of being left uninitialized).\n # Returns\n\n`0xC8A18008` if camera is in use by user, or `0xC8A183EF` if QTM is unavailable (in particular, QTM is always\n unavailable on N2DSXL). Otherwise, 0 (success). Return value should be checked by caller.\n > **Note:** This can, for example, be used in games to allow the user to control the scene's camera with their own face."]
21571 #[link_name = "QTMU_GetTrackingData__extern"]
21572 pub fn QTMU_GetTrackingData(outData: *mut QtmTrackingData) -> Result;
21573}
21574unsafe extern "C" {
21575 #[doc = "Computes an approximation of the horizontal angular field of view of the camera based on eye tracking data.\n\n # Arguments\n\n* `data` - Eye tracking data, obtained from QTMU_GetTrackingData or QTMU_GetTrackingDataEx.\n # Returns\n\nHorizontal angular field of view in radians. Corresponds to 64.9 degrees on real hardware."]
21576 pub fn qtmComputeFovX(data: *const QtmTrackingData) -> f32;
21577}
21578unsafe extern "C" {
21579 #[doc = "Computes an approximation of the vertical angular field of view of the camera based on eye tracking data.\n\n # Arguments\n\n* `data` - Eye tracking data, obtained from QTMU_GetTrackingData or QTMU_GetTrackingDataEx.\n # Returns\n\nVertical angular field of view in radians. Corresponds to 51.0 degrees on real hardware."]
21580 pub fn qtmComputeFovY(data: *const QtmTrackingData) -> f32;
21581}
21582unsafe extern "C" {
21583 #[doc = "Computes a rough approximation of the inverse of the aspect ration of the camera based on eye tracking data.\n\n # Arguments\n\n* `data` - Eye tracking data, obtained from QTMU_GetTrackingData or QTMU_GetTrackingDataEx.\n # Returns\n\nRough approximation of the inverse of the aspect ratio of the camera. Aspect ratio is exactly 0.75 on real hardware."]
21584 pub fn qtmComputeInverseAspectRatio(data: *const QtmTrackingData) -> f32;
21585}
21586unsafe extern "C" {
21587 #[doc = "Computes the user's head tilt angle, that is, the angle between the line through both eyes and the camera's\n horizontal axis in camera space.\n\n # Arguments\n\n* `data` - Eye tracking data, obtained from QTMU_GetTrackingData or QTMU_GetTrackingDataEx.\n # Returns\n\nHorizontal head angle relative to camera, in radians."]
21588 pub fn qtmComputeHeadTiltAngle(data: *const QtmTrackingData) -> f32;
21589}
21590unsafe extern "C" {
21591 #[doc = "Estimates the distance between the user's eyes and the camera, based on\n eye tracking data. This may be a little bit inaccurate, as this assumes\n interocular distance of 62mm (like all 3DS software does), and that both\n eyes are at the same distance from the screen.\n\n # Arguments\n\n* `data` - Eye tracking data, obtained from QTMU_GetTrackingData or QTMU_GetTrackingDataEx.\n # Returns\n\nEye-to-camera distance in millimeters."]
21592 pub fn qtmEstimateEyeToCameraDistance(data: *const QtmTrackingData) -> f32;
21593}
21594unsafe extern "C" {
21595 #[must_use]
21596 #[doc = "Temporarily enables manual control of the IR LED by user, disabling its automatic control.\n If not already done, this also turns off the IR LED. This setting is cleared when user closes the console's shell.\n # Returns\n\nAlways 0 (success)."]
21597 pub fn QTMU_EnableManualIrLedControl() -> Result;
21598}
21599unsafe extern "C" {
21600 #[must_use]
21601 #[doc = "Temporarily disables manual control of the IR LED by user, re-enabling its automatic control.\n If not already done, this also turns off the IR LED.\n # Returns\n\nAlways 0 (success)."]
21602 pub fn QTMU_DisableManualIrLedControl() -> Result;
21603}
21604unsafe extern "C" {
21605 #[must_use]
21606 #[doc = "Turns the IR LED on or off during manual control. QTMU_EnableManualIrLedControl must have been called.\n\n # Arguments\n\n* `on` - Whether to turn the IR LED on or off.\n # Returns\n\n`0xC8A18005` if manual control was not enabled or if the operation failed, `0xC8A18008` if camera is in use\n by user, or `0xC8A18009` if QTM is unavailable (in particular, QTM is always unavailable on N2DSXL).\n Otherwise, 0 (success)."]
21607 pub fn QTMU_SetIrLedStatus(on: bool) -> Result;
21608}
21609unsafe extern "C" {
21610 #[must_use]
21611 #[doc = "Attempts to clear IR LED overrides from any of the relevant commands in `qtm:u`, `qtm:s` (and `qtm:c`) commands\n by calling QTMU_EnableManualIrLedControl followed by QTMU_DisableManualIrLedControl, so that auto IR LED\n management takes place again.\n # Returns\n\nThe value returned by QTMU_DisableManualIrLedControl."]
21612 pub fn qtmClearIrLedOverrides() -> Result;
21613}
21614unsafe extern "C" {
21615 #[must_use]
21616 #[doc = "Checks whether or not QTM has been blacklisted, ie. that it has been made unavailable.\n In detail, this means that the last call to QTMS_SetQtmStatus was made with argument QTM_STATUS_UNAVAILABLE,\n usually by NS. This feature seems to only be used for some internal test titles.\n\n # Arguments\n\n* `outBlacklisted` (direction out) - Whether or not QTM is unavailable. Always true on N2DSXL.\n # Returns\n\nAlways 0 (success).\n > **Note:** On N2DSXL, even though status is always supposed to be QTM_STATUS_UNAVAILABLE, this function often returns true\n (because NS doesn't change QTM's status if title isn't blacklisted). Do not rely on this for N2DSXL detection.\n > **Note:** Refer to https://www.3dbrew.org/wiki/NS_CFA for a list of title UIDs this is used for."]
21617 pub fn QTMU_IsCurrentAppBlacklisted(outBlacklisted: *mut bool) -> Result;
21618}
21619unsafe extern "C" {
21620 #[must_use]
21621 #[doc = "Sets the neutral (center) barrier position/offset in calibration, _without_ saving it to `cfg`.\n Takes effect immediately. SS3D works by calculating the position of the eye midpoint, rotated\n by the ideal eye-to-camera angle, expressed in (iod/12 units, iod assumed to be 62mm).\n\n # Arguments\n\n* `position` - Center barrier position, in terms of iod/12 units modulo iod/12.\n > **Note:** This field is floating-point for QTM auto-adjustment purposes, however the actual barrier position\n in hardware is an integer.\n > **Note:** This is the field that System Settings lets you add -1.0 to +1.0 to.\n > **Note:** There is no \"get\" counterpart for this.\n # Returns\n\n`0xC8A18009` if QTM is unavailable (in particular, QTM is always unavailable on N2DSXL), otherwise\n0 (success)."]
21622 pub fn QTMS_SetCenterBarrierPosition(position: f32) -> Result;
21623}
21624unsafe extern "C" {
21625 #[must_use]
21626 #[doc = "Gets the average ambient luminance as perceived by the inner camera (in lux).\n If QTM is unavailable (in particular, QTM is always unavailable on N2DSXL), returns 400.0 instead\n of the actual luminance.\n\n # Arguments\n\n* `outLuminanceLux` (direction out) - Where to write the luminance to. Always 400.0 on N2DSXL.\n > **Note:** Camera exposure, and in particular auto-exposure affects the returned luminance value. This must be\n taken into consideration, because this value can thus surge when user covers the inner camera.\n # Returns\n\nAlways 0 (success)."]
21627 pub fn QTMS_GetCameraLuminance(outLuminanceLux: *mut f32) -> Result;
21628}
21629unsafe extern "C" {
21630 #[must_use]
21631 #[doc = "Enables automatic barrier control when in 3D mode with \"super stable 3D\" enabled.\n\n > **Note:** This is automatically called upon `qtm:s` and `qtm:sp` session exit.\n # Returns\n\n`0xC8A18009` if QTM is unavailable (in particular, QTM is always unavailable on N2DSXL), otherwise\n0 (success).\n > **Note:** Due to an oversight, QTMS_SetQtmStatus allows changing QTM state on N2DSXL. This is not intended\n to be done, and is in fact never done by official software. If that is regardless the case,\n this function here does nothing."]
21632 pub fn QTMS_EnableAutoBarrierControl() -> Result;
21633}
21634unsafe extern "C" {
21635 #[must_use]
21636 #[doc = "Temporarily disables automatic barrier control (when in 3D mode with \"super stable 3D\" enabled).\n\n > **Note:** This is automatically called upon `qtm:s` and `qtm:sp` session exit.\n # Returns\n\n`0xC8A18009` if QTM is unavailable (in particular, QTM is always unavailable on N2DSXL), otherwise\n0 (success).\n > **Note:** Due to an oversight, QTMS_SetQtmStatus allows changing QTM state on N2DSXL. This is not intended\n to be done, and is in fact never done by official software. If that is regardless the case,\n this function here does nothing."]
21637 pub fn QTMS_DisableAutoBarrierControl() -> Result;
21638}
21639unsafe extern "C" {
21640 #[must_use]
21641 #[doc = "Temporarily sets the parallax barrier's position (offset in iod/12 units, assuming slit width of 6 units).\n Does nothing in 2D mode and/or if \"super stable 3D\" is disabled.\n\n # Arguments\n\n* `position` - Parallax barrier position (offset in units), must be between 0 and 11 (both included)\n # Returns\n\n`0xC8A18009` if QTM is unavailable (in particular, QTM is always unavailable on N2DSXL), 0xE0E18002\n if `position` is not in range, otherwise 0 (success).\n > **Note:** Due to an oversight, QTMS_SetQtmStatus allows changing QTM state on N2DSXL. This is not intended\n to be done, and is in fact never done by official software. If that is regardless the case,\n this function here does nothing.\n > **Note:** No effect when the screen is in 2D mode.\n [`QTMC_SetBarrierPattern`]"]
21642 pub fn QTMS_SetBarrierPosition(position: u8_) -> Result;
21643}
21644unsafe extern "C" {
21645 #[must_use]
21646 #[doc = "Gets the current position of the parallax barrier (offset in iod/12 units, slit width of 6 units).\n When \"super stable 3D\" is disabled, returns 13 instead.\n\n # Arguments\n\n* `outPosition` (direction out) - Where to write the barrier's position to.\n # Returns\n\n`0xC8A18009` if QTM is unavailable (in particular, QTM is always unavailable on N2DSXL), otherwise\n0 (success).\n > **Note:** When SS3D is disabled, this returns 13 to `outPosition` . When in 2D mode, the returned position is not\nupdated.\n > **Note:** Due to an oversight, QTMS_SetQtmStatus allows changing QTM state on N2DSXL. This is not intended\n to be done, and is in fact never done by official software. If that is regardless the case,\n this function here returns 13 to `outPosition` .\n [`QTMC_SetBarrierPattern`]"]
21647 pub fn QTMS_GetCurrentBarrierPosition(outPosition: *mut u8_) -> Result;
21648}
21649unsafe extern "C" {
21650 #[must_use]
21651 #[doc = "Temporarily overrides IR LED state. Requires \"manual control\" from `qtm:u` to be disabled, and has\n lower priority than it.\n\n # Arguments\n\n* `on` - Whether to turn the IR LED on or off.\n # Returns\n\n`0xC8A18005` if manual control was enabled or if the operation failed, `0xC8A18008` if camera is in use\n by user (unless \"hardware check\" API enabled), or `0xC8A18009` if QTM is unavailable (in particular,\n QTM is always unavailable on N2DSXL). Otherwise, 0 (success)."]
21652 pub fn QTMS_SetIrLedStatusOverride(on: bool) -> Result;
21653}
21654unsafe extern "C" {
21655 #[must_use]
21656 #[doc = "Sets calibration data, taking effect immediately, and optionally saves it to `cfg`.\n\n # Arguments\n\n* `cal` - Pointer to calibration data.\n * `saveCalToCfg` - Whether or not to persist the calibration data in `cfg`.\n # Returns\n\n`0xC8A18009` if QTM is unavailable (in particular, QTM is always unavailable on N2DSXL), otherwise\nwhatever `cfg:s` commands return (if used), or 0 (success).\n > **Note:** There is no \"get\" counterpart for this function, and there is no way to see the current calibration data\nin use unless it has been saved to `cfg`.\n > **Note:** Due to an oversight, QTMS_SetQtmStatus allows changing QTM state on N2DSXL. This is not intended\n to be done, and is in fact never done by official software. If that is regardless the case,\n this function here doesn't apply calibrations parameters (they may still be saved, however,\n even though QTM calibration blocks are always normally 0 on N2DSXL)."]
21657 pub fn QTMS_SetCalibrationData(cal: *const QtmCalibrationData, saveCalToCfg: bool) -> Result;
21658}
21659unsafe extern "C" {
21660 #[must_use]
21661 #[doc = "Gets the current QTM status (enabled/ss3d disabled/unavailable).\n\n # Arguments\n\n* `outQtmStatus` (direction out) - Where to write the QTM status to.\n # Returns\n\nAlways 0."]
21662 pub fn QTMS_GetQtmStatus(outQtmStatus: *mut QtmStatus) -> Result;
21663}
21664unsafe extern "C" {
21665 #[must_use]
21666 #[doc = "Gets the current QTM status (enabled/ss3d disabled/unavailable). Also sets or clear the\n \"blacklisted\" flag returned by QTMU_IsCurrentAppBlacklisted.\n\n # Arguments\n\n* `qtmStatus` - QTM status to set. If equal to QTM_STATUS_UNAVAILABLE, sets the \"blacklisted\" flag,\n otherwise clears it.\n # Returns\n\n`0xE0E18002` if enum value is invalid, otherwise 0 (success).\n > **Note:** System settings uses this to disable super-stable 3D, and NS to \"blacklist\" (make QTM unavailable)\n specific applications."]
21667 pub fn QTMS_SetQtmStatus(qtmStatus: QtmStatus) -> Result;
21668}
21669unsafe extern "C" {
21670 #[must_use]
21671 #[doc = "Called by GSP's LCD driver to signal 2D<>3D mode change\n # Arguments\n\n* `newMode` - 0 for 2D, 1 for 800px 2D (unused for this function, same as 0), 2 for 3D\n # Returns\n\nAlways 0 (success)."]
21672 pub fn QTMSP_NotifyTopLcdModeChange(newMode: u8_) -> Result;
21673}
21674unsafe extern "C" {
21675 #[must_use]
21676 #[doc = "Called by GSP's LCD driver during top LCD power-on to signal to QTM that it may power on\n and/or reconfigure then use the TI TCA6416A expander. In the process, QTM re-creates its\n expander thread.\n # Returns\n\nAlways 0 (success)."]
21677 pub fn QTMSP_NotifyTopLcdPowerOn() -> Result;
21678}
21679unsafe extern "C" {
21680 #[must_use]
21681 #[doc = "Called by GSP's LCD driver to know whether or not QTM's expander thread is using\n the TI TCA6416A expander; it is waiting for this to become true/false during LCD\n power on/power off to proceed. Always false on N2DSXL.\n # Arguments\n\n* `outActive` (direction out) - Where to write the \"in use\" status to.\n # Returns\n\nAlways 0 (success)."]
21682 pub fn QTMSP_IsExpanderInUse(outActive: *mut bool) -> Result;
21683}
21684unsafe extern "C" {
21685 #[must_use]
21686 #[doc = "Called by GSP's LCD driver during top LCD power-on to signal to QTM that it needs to\n switch the parallax barrier state to a 2D state (all-transparent mask). Causes QTM's\n expander thread to exit, relinquishing its `i2c::QTM` session with it.\n # Returns\n\nAlways 0 (success)."]
21687 pub fn QTMSP_NotifyTopLcdPowerOff() -> Result;
21688}
21689unsafe extern "C" {
21690 #[must_use]
21691 #[doc = "Initializes `qtm:c`.\n Only 3 sessions (2 until 9.3.0 sysupdate) for ALL services COMBINED, including the main\n services, can be open at a time."]
21692 pub fn qtmcInit() -> Result;
21693}
21694unsafe extern "C" {
21695 #[doc = "Exits `qtm:c`."]
21696 pub fn qtmcExit();
21697}
21698unsafe extern "C" {
21699 #[doc = "Returns a pointer to the current `qtm:c` session handle."]
21700 pub fn qtmcGetSessionHandle() -> *mut Handle;
21701}
21702unsafe extern "C" {
21703 #[must_use]
21704 #[doc = "Starts the QTM Hardware Check API. This must be called before using any other `qtm:c` command,\n and causes barrier pattern to be overriden by what was last set in QTMC_SetBarrierPattern,\n **even in 2D mode**. Also allows IR LED state to be overridden even if user uses the inner camera.\n # Returns\n\n`0xD82183F9` if already started, otherwise 0 (success)."]
21705 pub fn QTMC_StartHardwareCheck() -> Result;
21706}
21707unsafe extern "C" {
21708 #[must_use]
21709 #[doc = "Stops the QTM Hardware Check API. Restore normal barrier and IR LED management behavior.\n # Returns\n\n`0xD82183F8` if API not started, otherwise 0 (success)."]
21710 pub fn QTMC_StopHardwareCheck() -> Result;
21711}
21712unsafe extern "C" {
21713 #[must_use]
21714 #[doc = "Sets the parallax barrier's mask pattern and polarity phase (12+1 bits).\n\n Bit11 to 0 correspond to a repeating barrier mask pattern, 0 meaning the corresponding mask unit is\n transparent and 1 that it is opaque. The direction is: left->right corresponds to MSB->LSB.\n\n Bit12 is the polarity bit.\n\n QTM's expander management thread repeatedly writes (on every loop iteration) the current mask pattern\n plus polarity bit, whether it is normally set or overridden by `qtm:c`, then on the following set,\n negates both (it writes pattern ^ 0x1FFF). This is done at all times, even it 2D mode.\n\n The register being written to are regId 0x02 and 0x03 (output ports).\n TI TCA6416A I2C->Parallel expander is located on bus I2C1 (PA 0x10161000) device ID 0x40.\n\n This function has no effect on N2DSXL.\n\n # Arguments\n\n* `pattern` - Barrier mask pattern (bit12: polarity, bit11-0: 12-bit mask pattern)\n # Returns\n\n`0xD82183F8` if API not started, otherwise 0 (success).\n [`Patent`] US20030234980A1 for a description of parallax barriers.\n mask pattern used for super-stable 3D are as follows (position 0 to 11):\n\n 000011111100\n 000001111110\n 000000111111\n 100000011111\n 110000001111\n 111000000111\n 111100000011\n 111110000001\n 111111000000\n 011111100000\n 001111110000\n 000111111000\n\n When SS3D is disabled (ie. it tries to match O3DS behavior), then pattern becomes:\n 111100000111\n Notice that the slit width is reduced from 6 to 5 units there.\n\n For 2D it is all-zero:\n 000000000000\n\n 2D pattern is automatically set on QTM process init and exit."]
21715 pub fn QTMC_SetBarrierPattern(pattern: u32_) -> Result;
21716}
21717unsafe extern "C" {
21718 #[must_use]
21719 #[doc = "Waits for the expander management thread to (re)initalize the TI TCA6416A I2C->Parallel expander,\n then checks if that expander is behaving as expected (responds with the port direction config\n it has been configured with): it checks whether all ports have been configured as outputs.\n\n On N2DSXL, this function waits forever and never returns.\n\n In detail, the hardware init procedure for the expander is as follows (as done by the expander mgmt. thread):\n - configure enable expander pin on SoC: set GPIO3.bit11 to OUTPUT, then set to 1\n - on the expander (I2C1 deviceId 0x40), set all ports to OUTPUT (regId 0x06, 0x07)\n - on the expander, write 0 (all-transparent mask/2D) to the data registers (regId 0x02, 0x03)\n\n # Arguments\n\n* `outWorking` (direction out) - Where to write the working status to. If true, expander is present working.\n If false, the expander is present but is misbehaving. If the function does not\n return, then expander is missing (e.g. on N2DSXL).\n # Returns\n\n`0xD82183F8` if API not started, otherwise 0 (success)."]
21720 pub fn QTMC_WaitAndCheckExpanderWorking(outWorking: *mut bool) -> Result;
21721}
21722unsafe extern "C" {
21723 #[must_use]
21724 #[doc = "Temporarily overrides IR LED state. Requires \"manual control\" from `qtm:u` to be disabled, and has\n lower priority than it. Same implementation as QTMS_SetIrLedStatusOverride.\n\n # Arguments\n\n* `on` - Whether to turn the IR LED on or off.\n # Returns\n\n`0xD82183F8` if API not started, `0xC8A18005` if manual control was enabled or if the operation failed,\n or `0xC8A18009` if QTM is unavailable (in particular, QTM is always unavailable on N2DSXL). Otherwise, 0 (success)."]
21725 pub fn QTMC_SetIrLedStatusOverride(on: bool) -> Result;
21726}
21727unsafe extern "C" {
21728 #[must_use]
21729 #[doc = "Initializes srv:pm and the service API."]
21730 pub fn srvPmInit() -> Result;
21731}
21732unsafe extern "C" {
21733 #[doc = "Exits srv:pm and the service API."]
21734 pub fn srvPmExit();
21735}
21736unsafe extern "C" {
21737 #[doc = "Gets the current srv:pm session handle.\n # Returns\n\nThe current srv:pm session handle."]
21738 pub fn srvPmGetSessionHandle() -> *mut Handle;
21739}
21740unsafe extern "C" {
21741 #[must_use]
21742 #[doc = "Publishes a notification to a process.\n # Arguments\n\n* `notificationId` - ID of the notification.\n * `process` - Process to publish to."]
21743 pub fn SRVPM_PublishToProcess(notificationId: u32_, process: Handle) -> Result;
21744}
21745unsafe extern "C" {
21746 #[must_use]
21747 #[doc = "Publishes a notification to all processes.\n # Arguments\n\n* `notificationId` - ID of the notification."]
21748 pub fn SRVPM_PublishToAll(notificationId: u32_) -> Result;
21749}
21750unsafe extern "C" {
21751 #[must_use]
21752 #[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."]
21753 pub fn SRVPM_RegisterProcess(
21754 pid: u32_,
21755 count: u32_,
21756 serviceAccessControlList: *const [::libc::c_char; 8usize],
21757 ) -> Result;
21758}
21759unsafe extern "C" {
21760 #[must_use]
21761 #[doc = "Unregisters a process with SRV.\n # Arguments\n\n* `pid` - ID of the process."]
21762 pub fn SRVPM_UnregisterProcess(pid: u32_) -> Result;
21763}
21764unsafe extern "C" {
21765 #[must_use]
21766 #[doc = "Initializes LOADER."]
21767 pub fn loaderInit() -> Result;
21768}
21769unsafe extern "C" {
21770 #[doc = "Exits LOADER."]
21771 pub fn loaderExit();
21772}
21773unsafe extern "C" {
21774 #[must_use]
21775 #[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."]
21776 pub fn LOADER_LoadProcess(process: *mut Handle, programHandle: u64_) -> Result;
21777}
21778unsafe extern "C" {
21779 #[must_use]
21780 #[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."]
21781 pub fn LOADER_RegisterProgram(
21782 programHandle: *mut u64_,
21783 programInfo: *const FS_ProgramInfo,
21784 programInfoUpdate: *const FS_ProgramInfo,
21785 ) -> Result;
21786}
21787unsafe extern "C" {
21788 #[must_use]
21789 #[doc = "Unregisters a program (along with its update).\n # Arguments\n\n* `programHandle` - The handle of the program to unregister."]
21790 pub fn LOADER_UnregisterProgram(programHandle: u64_) -> Result;
21791}
21792unsafe extern "C" {
21793 #[must_use]
21794 #[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"]
21795 pub fn LOADER_GetProgramInfo(exheaderInfo: *mut ExHeader_Info, programHandle: u64_) -> Result;
21796}
21797#[doc = "< The normal mode of the led"]
21798pub const LED_NORMAL: powerLedState = 1;
21799#[doc = "< The led pulses slowly as it does in the sleep mode"]
21800pub const LED_SLEEP_MODE: powerLedState = 2;
21801#[doc = "< Switch off power led"]
21802pub const LED_OFF: powerLedState = 3;
21803#[doc = "< Red state of the led"]
21804pub const LED_RED: powerLedState = 4;
21805#[doc = "< Blue state of the led"]
21806pub const LED_BLUE: powerLedState = 5;
21807#[doc = "< Blinking red state of power led and notification led"]
21808pub const LED_BLINK_RED: powerLedState = 6;
21809pub type powerLedState = ::libc::c_uchar;
21810#[repr(C)]
21811#[derive(Debug, Default, Copy, Clone)]
21812pub struct InfoLedPattern {
21813 #[doc = "< Delay between pattern values, 1/16th of a second (1 second = 0x10)"]
21814 pub delay: u8_,
21815 #[doc = "< Smoothing between pattern values (higher = smoother)"]
21816 pub smoothing: u8_,
21817 #[doc = "< Delay between pattern loops, 1/16th of a second (1 second = 0x10, 0xFF = pattern is played only once)"]
21818 pub loopDelay: u8_,
21819 #[doc = "< Blink speed, when smoothing == 0x00"]
21820 pub blinkSpeed: u8_,
21821 #[doc = "< Pattern for red component"]
21822 pub redPattern: [u8_; 32usize],
21823 #[doc = "< Pattern for green component"]
21824 pub greenPattern: [u8_; 32usize],
21825 #[doc = "< Pattern for blue component"]
21826 pub bluePattern: [u8_; 32usize],
21827}
21828#[allow(clippy::unnecessary_operation, clippy::identity_op)]
21829const _: () = {
21830 ["Size of InfoLedPattern"][::core::mem::size_of::<InfoLedPattern>() - 100usize];
21831 ["Alignment of InfoLedPattern"][::core::mem::align_of::<InfoLedPattern>() - 1usize];
21832 ["Offset of field: InfoLedPattern::delay"]
21833 [::core::mem::offset_of!(InfoLedPattern, delay) - 0usize];
21834 ["Offset of field: InfoLedPattern::smoothing"]
21835 [::core::mem::offset_of!(InfoLedPattern, smoothing) - 1usize];
21836 ["Offset of field: InfoLedPattern::loopDelay"]
21837 [::core::mem::offset_of!(InfoLedPattern, loopDelay) - 2usize];
21838 ["Offset of field: InfoLedPattern::blinkSpeed"]
21839 [::core::mem::offset_of!(InfoLedPattern, blinkSpeed) - 3usize];
21840 ["Offset of field: InfoLedPattern::redPattern"]
21841 [::core::mem::offset_of!(InfoLedPattern, redPattern) - 4usize];
21842 ["Offset of field: InfoLedPattern::greenPattern"]
21843 [::core::mem::offset_of!(InfoLedPattern, greenPattern) - 36usize];
21844 ["Offset of field: InfoLedPattern::bluePattern"]
21845 [::core::mem::offset_of!(InfoLedPattern, bluePattern) - 68usize];
21846};
21847unsafe extern "C" {
21848 #[must_use]
21849 #[doc = "Initializes mcuHwc."]
21850 pub fn mcuHwcInit() -> Result;
21851}
21852unsafe extern "C" {
21853 #[doc = "Exits mcuHwc."]
21854 pub fn mcuHwcExit();
21855}
21856unsafe extern "C" {
21857 #[doc = "Gets the current mcuHwc session handle.\n # Returns\n\nA pointer to the current mcuHwc session handle."]
21858 pub fn mcuHwcGetSessionHandle() -> *mut Handle;
21859}
21860unsafe extern "C" {
21861 #[must_use]
21862 #[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"]
21863 pub fn MCUHWC_ReadRegister(reg: u8_, data: *mut ::libc::c_void, size: u32_) -> Result;
21864}
21865unsafe extern "C" {
21866 #[must_use]
21867 #[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"]
21868 pub fn MCUHWC_WriteRegister(reg: u8_, data: *const ::libc::c_void, size: u32_) -> Result;
21869}
21870unsafe extern "C" {
21871 #[must_use]
21872 #[doc = "Gets the battery voltage\n # Arguments\n\n* `voltage` - Pointer to write the battery voltage to."]
21873 pub fn MCUHWC_GetBatteryVoltage(voltage: *mut u8_) -> Result;
21874}
21875unsafe extern "C" {
21876 #[must_use]
21877 #[doc = "Gets the battery level\n # Arguments\n\n* `level` - Pointer to write the current battery level to."]
21878 pub fn MCUHWC_GetBatteryLevel(level: *mut u8_) -> Result;
21879}
21880unsafe extern "C" {
21881 #[must_use]
21882 #[doc = "Gets the sound slider level\n # Arguments\n\n* `level` - Pointer to write the slider level to."]
21883 pub fn MCUHWC_GetSoundSliderLevel(level: *mut u8_) -> Result;
21884}
21885unsafe extern "C" {
21886 #[must_use]
21887 #[doc = "Sets Wifi LED state\n # Arguments\n\n* `state` - State of Wifi LED. (True/False)"]
21888 pub fn MCUHWC_SetWifiLedState(state: bool) -> Result;
21889}
21890unsafe extern "C" {
21891 #[must_use]
21892 #[doc = "Sets the notification LED pattern\n # Arguments\n\n* `pattern` - Pattern for the notification LED."]
21893 pub fn MCUHWC_SetInfoLedPattern(pattern: *const InfoLedPattern) -> Result;
21894}
21895unsafe extern "C" {
21896 #[must_use]
21897 #[doc = "Sets Power LED state\n # Arguments\n\n* `state` - powerLedState State of power LED."]
21898 pub fn MCUHWC_SetPowerLedState(state: powerLedState) -> Result;
21899}
21900unsafe extern "C" {
21901 #[must_use]
21902 #[doc = "Gets 3d slider level\n # Arguments\n\n* `level` - Pointer to write 3D slider level to."]
21903 pub fn MCUHWC_Get3dSliderLevel(level: *mut u8_) -> Result;
21904}
21905unsafe extern "C" {
21906 #[must_use]
21907 #[doc = "Gets the major MCU firmware version\n # Arguments\n\n* `out` - Pointer to write the major firmware version to."]
21908 pub fn MCUHWC_GetFwVerHigh(out: *mut u8_) -> Result;
21909}
21910unsafe extern "C" {
21911 #[must_use]
21912 #[doc = "Gets the minor MCU firmware version\n # Arguments\n\n* `out` - Pointer to write the minor firmware version to."]
21913 pub fn MCUHWC_GetFwVerLow(out: *mut u8_) -> Result;
21914}
21915#[doc = "< Primary I2S line, used by DSP/Mic (configurable)/GBA sound controller."]
21916pub const CODEC_I2S_LINE_1: CodecI2sLine = 0;
21917#[doc = "< Secondary I2S line, used by CSND hardware."]
21918pub const CODEC_I2S_LINE_2: CodecI2sLine = 1;
21919#[doc = "I2S line enumeration"]
21920pub type CodecI2sLine = ::libc::c_uchar;
21921unsafe extern "C" {
21922 #[must_use]
21923 #[doc = "Initializes CDCCHK."]
21924 pub fn cdcChkInit() -> Result;
21925}
21926unsafe extern "C" {
21927 #[doc = "Exits CDCCHK."]
21928 pub fn cdcChkExit();
21929}
21930unsafe extern "C" {
21931 #[doc = "Gets a pointer to the current cdc:CHK session handle.\n # Returns\n\nA pointer to the current cdc:CHK session handle."]
21932 pub fn cdcChkGetSessionHandle() -> *mut Handle;
21933}
21934unsafe extern "C" {
21935 #[must_use]
21936 #[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)."]
21937 pub fn CDCCHK_ReadRegisters1(
21938 pageId: u8_,
21939 initialRegAddr: u8_,
21940 outData: *mut ::libc::c_void,
21941 size: usize,
21942 ) -> Result;
21943}
21944unsafe extern "C" {
21945 #[must_use]
21946 #[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)."]
21947 pub fn CDCCHK_ReadRegisters2(
21948 pageId: u8_,
21949 initialRegAddr: u8_,
21950 outData: *mut ::libc::c_void,
21951 size: usize,
21952 ) -> Result;
21953}
21954unsafe extern "C" {
21955 #[must_use]
21956 #[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)."]
21957 pub fn CDCCHK_WriteRegisters1(
21958 pageId: u8_,
21959 initialRegAddr: u8_,
21960 data: *const ::libc::c_void,
21961 size: usize,
21962 ) -> Result;
21963}
21964unsafe extern "C" {
21965 #[must_use]
21966 #[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)."]
21967 pub fn CDCCHK_WriteRegisters2(
21968 pageId: u8_,
21969 initialRegAddr: u8_,
21970 data: *const ::libc::c_void,
21971 size: usize,
21972 ) -> Result;
21973}
21974unsafe extern "C" {
21975 #[must_use]
21976 #[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."]
21977 pub fn CDCCHK_ReadNtrPmicRegister(outData: *mut u8_, regAddr: u8_) -> Result;
21978}
21979unsafe extern "C" {
21980 #[must_use]
21981 #[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."]
21982 pub fn CDCCHK_WriteNtrPmicRegister(regAddr: u8_, data: u8_) -> Result;
21983}
21984unsafe extern "C" {
21985 #[must_use]
21986 #[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)."]
21987 pub fn CDCCHK_SetI2sVolume(i2sLine: CodecI2sLine, volume: s8) -> Result;
21988}
21989#[doc = "< 8-bit Red + 8-bit Green + 8-bit Blue + 8-bit Alpha"]
21990pub const GX_TRANSFER_FMT_RGBA8: GX_TRANSFER_FORMAT = 0;
21991#[doc = "< 8-bit Red + 8-bit Green + 8-bit Blue"]
21992pub const GX_TRANSFER_FMT_RGB8: GX_TRANSFER_FORMAT = 1;
21993#[doc = "< 5-bit Red + 6-bit Green + 5-bit Blue"]
21994pub const GX_TRANSFER_FMT_RGB565: GX_TRANSFER_FORMAT = 2;
21995#[doc = "< 5-bit Red + 5-bit Green + 5-bit Blue + 1-bit Alpha"]
21996pub const GX_TRANSFER_FMT_RGB5A1: GX_TRANSFER_FORMAT = 3;
21997#[doc = "< 4-bit Red + 4-bit Green + 4-bit Blue + 4-bit Alpha"]
21998pub const GX_TRANSFER_FMT_RGBA4: GX_TRANSFER_FORMAT = 4;
21999#[doc = "Supported transfer pixel formats.\n [`GSPGPU_FramebufferFormat`]"]
22000pub type GX_TRANSFER_FORMAT = ::libc::c_uchar;
22001#[doc = "< No anti-aliasing"]
22002pub const GX_TRANSFER_SCALE_NO: GX_TRANSFER_SCALE = 0;
22003#[doc = "< 2x1 anti-aliasing"]
22004pub const GX_TRANSFER_SCALE_X: GX_TRANSFER_SCALE = 1;
22005#[doc = "< 2x2 anti-aliasing"]
22006pub const GX_TRANSFER_SCALE_XY: GX_TRANSFER_SCALE = 2;
22007#[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"]
22008pub type GX_TRANSFER_SCALE = ::libc::c_uchar;
22009#[doc = "< Trigger the PPF event"]
22010pub const GX_FILL_TRIGGER: GX_FILL_CONTROL = 1;
22011#[doc = "< Indicates if the memory fill is complete. You should not use it when requesting a transfer."]
22012pub const GX_FILL_FINISHED: GX_FILL_CONTROL = 2;
22013#[doc = "< The buffer has a 16 bit per pixel depth"]
22014pub const GX_FILL_16BIT_DEPTH: GX_FILL_CONTROL = 0;
22015#[doc = "< The buffer has a 24 bit per pixel depth"]
22016pub const GX_FILL_24BIT_DEPTH: GX_FILL_CONTROL = 256;
22017#[doc = "< The buffer has a 32 bit per pixel depth"]
22018pub const GX_FILL_32BIT_DEPTH: GX_FILL_CONTROL = 512;
22019#[doc = "GX transfer control flags"]
22020pub type GX_FILL_CONTROL = ::libc::c_ushort;
22021#[doc = "GX command entry"]
22022#[repr(C)]
22023#[derive(Copy, Clone)]
22024pub union gxCmdEntry_s {
22025 #[doc = "< Raw command data"]
22026 pub data: [u32_; 8usize],
22027 pub __bindgen_anon_1: gxCmdEntry_s__bindgen_ty_1,
22028}
22029#[repr(C)]
22030#[derive(Debug, Default, Copy, Clone)]
22031pub struct gxCmdEntry_s__bindgen_ty_1 {
22032 #[doc = "< Command type"]
22033 pub type_: u8_,
22034 pub unk1: u8_,
22035 pub unk2: u8_,
22036 pub unk3: u8_,
22037 #[doc = "< Command arguments"]
22038 pub args: [u32_; 7usize],
22039}
22040#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22041const _: () = {
22042 ["Size of gxCmdEntry_s__bindgen_ty_1"]
22043 [::core::mem::size_of::<gxCmdEntry_s__bindgen_ty_1>() - 32usize];
22044 ["Alignment of gxCmdEntry_s__bindgen_ty_1"]
22045 [::core::mem::align_of::<gxCmdEntry_s__bindgen_ty_1>() - 4usize];
22046 ["Offset of field: gxCmdEntry_s__bindgen_ty_1::type_"]
22047 [::core::mem::offset_of!(gxCmdEntry_s__bindgen_ty_1, type_) - 0usize];
22048 ["Offset of field: gxCmdEntry_s__bindgen_ty_1::unk1"]
22049 [::core::mem::offset_of!(gxCmdEntry_s__bindgen_ty_1, unk1) - 1usize];
22050 ["Offset of field: gxCmdEntry_s__bindgen_ty_1::unk2"]
22051 [::core::mem::offset_of!(gxCmdEntry_s__bindgen_ty_1, unk2) - 2usize];
22052 ["Offset of field: gxCmdEntry_s__bindgen_ty_1::unk3"]
22053 [::core::mem::offset_of!(gxCmdEntry_s__bindgen_ty_1, unk3) - 3usize];
22054 ["Offset of field: gxCmdEntry_s__bindgen_ty_1::args"]
22055 [::core::mem::offset_of!(gxCmdEntry_s__bindgen_ty_1, args) - 4usize];
22056};
22057#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22058const _: () = {
22059 ["Size of gxCmdEntry_s"][::core::mem::size_of::<gxCmdEntry_s>() - 32usize];
22060 ["Alignment of gxCmdEntry_s"][::core::mem::align_of::<gxCmdEntry_s>() - 4usize];
22061 ["Offset of field: gxCmdEntry_s::data"][::core::mem::offset_of!(gxCmdEntry_s, data) - 0usize];
22062};
22063impl Default for gxCmdEntry_s {
22064 fn default() -> Self {
22065 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
22066 unsafe {
22067 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
22068 s.assume_init()
22069 }
22070 }
22071}
22072#[doc = "GX command queue structure"]
22073#[repr(C)]
22074#[derive(Debug, Copy, Clone)]
22075pub struct tag_gxCmdQueue_s {
22076 #[doc = "< Pointer to array of GX command entries"]
22077 pub entries: *mut gxCmdEntry_s,
22078 #[doc = "< Capacity of the command array"]
22079 pub maxEntries: u16_,
22080 #[doc = "< Number of commands in the queue"]
22081 pub numEntries: u16_,
22082 #[doc = "< Index of the first pending command to be submitted to GX"]
22083 pub curEntry: u16_,
22084 #[doc = "< Number of commands completed by GX"]
22085 pub lastEntry: u16_,
22086 #[doc = "< User callback"]
22087 pub callback: ::core::option::Option<unsafe extern "C" fn(arg1: *mut tag_gxCmdQueue_s)>,
22088 #[doc = "< Data for user callback"]
22089 pub user: *mut ::libc::c_void,
22090}
22091#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22092const _: () = {
22093 ["Size of tag_gxCmdQueue_s"][::core::mem::size_of::<tag_gxCmdQueue_s>() - 20usize];
22094 ["Alignment of tag_gxCmdQueue_s"][::core::mem::align_of::<tag_gxCmdQueue_s>() - 4usize];
22095 ["Offset of field: tag_gxCmdQueue_s::entries"]
22096 [::core::mem::offset_of!(tag_gxCmdQueue_s, entries) - 0usize];
22097 ["Offset of field: tag_gxCmdQueue_s::maxEntries"]
22098 [::core::mem::offset_of!(tag_gxCmdQueue_s, maxEntries) - 4usize];
22099 ["Offset of field: tag_gxCmdQueue_s::numEntries"]
22100 [::core::mem::offset_of!(tag_gxCmdQueue_s, numEntries) - 6usize];
22101 ["Offset of field: tag_gxCmdQueue_s::curEntry"]
22102 [::core::mem::offset_of!(tag_gxCmdQueue_s, curEntry) - 8usize];
22103 ["Offset of field: tag_gxCmdQueue_s::lastEntry"]
22104 [::core::mem::offset_of!(tag_gxCmdQueue_s, lastEntry) - 10usize];
22105 ["Offset of field: tag_gxCmdQueue_s::callback"]
22106 [::core::mem::offset_of!(tag_gxCmdQueue_s, callback) - 12usize];
22107 ["Offset of field: tag_gxCmdQueue_s::user"]
22108 [::core::mem::offset_of!(tag_gxCmdQueue_s, user) - 16usize];
22109};
22110impl Default for tag_gxCmdQueue_s {
22111 fn default() -> Self {
22112 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
22113 unsafe {
22114 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
22115 s.assume_init()
22116 }
22117 }
22118}
22119#[doc = "GX command queue structure"]
22120pub type gxCmdQueue_s = tag_gxCmdQueue_s;
22121unsafe extern "C" {
22122 #[doc = "Clears a GX command queue.\n # Arguments\n\n* `queue` - The GX command queue."]
22123 pub fn gxCmdQueueClear(queue: *mut gxCmdQueue_s);
22124}
22125unsafe extern "C" {
22126 #[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."]
22127 pub fn gxCmdQueueAdd(queue: *mut gxCmdQueue_s, entry: *const gxCmdEntry_s);
22128}
22129unsafe extern "C" {
22130 #[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."]
22131 pub fn gxCmdQueueRun(queue: *mut gxCmdQueue_s);
22132}
22133unsafe extern "C" {
22134 #[doc = "Stops a GX command queue from processing incoming commands.\n # Arguments\n\n* `queue` - The GX command queue."]
22135 pub fn gxCmdQueueStop(queue: *mut gxCmdQueue_s);
22136}
22137unsafe extern "C" {
22138 #[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."]
22139 pub fn gxCmdQueueWait(queue: *mut gxCmdQueue_s, timeout: s64) -> bool;
22140}
22141unsafe extern "C" {
22142 #[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."]
22143 #[link_name = "gxCmdQueueSetCallback__extern"]
22144 pub fn gxCmdQueueSetCallback(
22145 queue: *mut gxCmdQueue_s,
22146 callback: ::core::option::Option<unsafe extern "C" fn(arg1: *mut gxCmdQueue_s)>,
22147 user: *mut ::libc::c_void,
22148 );
22149}
22150unsafe extern "C" {
22151 #[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)"]
22152 pub fn GX_BindQueue(queue: *mut gxCmdQueue_s);
22153}
22154unsafe extern "C" {
22155 #[must_use]
22156 #[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."]
22157 pub fn GX_RequestDma(src: *mut u32_, dst: *mut u32_, length: u32_) -> Result;
22158}
22159unsafe extern "C" {
22160 #[must_use]
22161 #[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."]
22162 pub fn GX_ProcessCommandList(buf0a: *mut u32_, buf0s: u32_, flags: u8_) -> Result;
22163}
22164unsafe extern "C" {
22165 #[must_use]
22166 #[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."]
22167 pub fn GX_MemoryFill(
22168 buf0a: *mut u32_,
22169 buf0v: u32_,
22170 buf0e: *mut u32_,
22171 control0: u16_,
22172 buf1a: *mut u32_,
22173 buf1v: u32_,
22174 buf1e: *mut u32_,
22175 control1: u16_,
22176 ) -> Result;
22177}
22178unsafe extern "C" {
22179 #[must_use]
22180 #[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."]
22181 pub fn GX_DisplayTransfer(
22182 inadr: *mut u32_,
22183 indim: u32_,
22184 outadr: *mut u32_,
22185 outdim: u32_,
22186 flags: u32_,
22187 ) -> Result;
22188}
22189unsafe extern "C" {
22190 #[must_use]
22191 #[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."]
22192 pub fn GX_TextureCopy(
22193 inadr: *mut u32_,
22194 indim: u32_,
22195 outadr: *mut u32_,
22196 outdim: u32_,
22197 size: u32_,
22198 flags: u32_,
22199 ) -> Result;
22200}
22201unsafe extern "C" {
22202 #[must_use]
22203 #[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."]
22204 pub fn GX_FlushCacheRegions(
22205 buf0a: *mut u32_,
22206 buf0s: u32_,
22207 buf1a: *mut u32_,
22208 buf1s: u32_,
22209 buf2a: *mut u32_,
22210 buf2s: u32_,
22211 ) -> Result;
22212}
22213#[doc = "< Nearest-neighbor interpolation."]
22214pub const GPU_NEAREST: GPU_TEXTURE_FILTER_PARAM = 0;
22215#[doc = "< Linear interpolation."]
22216pub const GPU_LINEAR: GPU_TEXTURE_FILTER_PARAM = 1;
22217#[doc = "Texture filters."]
22218pub type GPU_TEXTURE_FILTER_PARAM = ::libc::c_uchar;
22219#[doc = "< Clamps to edge."]
22220pub const GPU_CLAMP_TO_EDGE: GPU_TEXTURE_WRAP_PARAM = 0;
22221#[doc = "< Clamps to border."]
22222pub const GPU_CLAMP_TO_BORDER: GPU_TEXTURE_WRAP_PARAM = 1;
22223#[doc = "< Repeats texture."]
22224pub const GPU_REPEAT: GPU_TEXTURE_WRAP_PARAM = 2;
22225#[doc = "< Repeats with mirrored texture."]
22226pub const GPU_MIRRORED_REPEAT: GPU_TEXTURE_WRAP_PARAM = 3;
22227#[doc = "Texture wrap modes."]
22228pub type GPU_TEXTURE_WRAP_PARAM = ::libc::c_uchar;
22229#[doc = "< 2D texture"]
22230pub const GPU_TEX_2D: GPU_TEXTURE_MODE_PARAM = 0;
22231#[doc = "< Cube map"]
22232pub const GPU_TEX_CUBE_MAP: GPU_TEXTURE_MODE_PARAM = 1;
22233#[doc = "< 2D Shadow texture"]
22234pub const GPU_TEX_SHADOW_2D: GPU_TEXTURE_MODE_PARAM = 2;
22235#[doc = "< Projection texture"]
22236pub const GPU_TEX_PROJECTION: GPU_TEXTURE_MODE_PARAM = 3;
22237#[doc = "< Shadow cube map"]
22238pub const GPU_TEX_SHADOW_CUBE: GPU_TEXTURE_MODE_PARAM = 4;
22239#[doc = "< Disabled"]
22240pub const GPU_TEX_DISABLED: GPU_TEXTURE_MODE_PARAM = 5;
22241#[doc = "Texture modes."]
22242pub type GPU_TEXTURE_MODE_PARAM = ::libc::c_uchar;
22243#[doc = "< Texture unit 0."]
22244pub const GPU_TEXUNIT0: GPU_TEXUNIT = 1;
22245#[doc = "< Texture unit 1."]
22246pub const GPU_TEXUNIT1: GPU_TEXUNIT = 2;
22247#[doc = "< Texture unit 2."]
22248pub const GPU_TEXUNIT2: GPU_TEXUNIT = 4;
22249#[doc = "Supported texture units."]
22250pub type GPU_TEXUNIT = ::libc::c_uchar;
22251#[doc = "< 8-bit Red + 8-bit Green + 8-bit Blue + 8-bit Alpha"]
22252pub const GPU_RGBA8: GPU_TEXCOLOR = 0;
22253#[doc = "< 8-bit Red + 8-bit Green + 8-bit Blue"]
22254pub const GPU_RGB8: GPU_TEXCOLOR = 1;
22255#[doc = "< 5-bit Red + 5-bit Green + 5-bit Blue + 1-bit Alpha"]
22256pub const GPU_RGBA5551: GPU_TEXCOLOR = 2;
22257#[doc = "< 5-bit Red + 6-bit Green + 5-bit Blue"]
22258pub const GPU_RGB565: GPU_TEXCOLOR = 3;
22259#[doc = "< 4-bit Red + 4-bit Green + 4-bit Blue + 4-bit Alpha"]
22260pub const GPU_RGBA4: GPU_TEXCOLOR = 4;
22261#[doc = "< 8-bit Luminance + 8-bit Alpha"]
22262pub const GPU_LA8: GPU_TEXCOLOR = 5;
22263#[doc = "< 8-bit Hi + 8-bit Lo"]
22264pub const GPU_HILO8: GPU_TEXCOLOR = 6;
22265#[doc = "< 8-bit Luminance"]
22266pub const GPU_L8: GPU_TEXCOLOR = 7;
22267#[doc = "< 8-bit Alpha"]
22268pub const GPU_A8: GPU_TEXCOLOR = 8;
22269#[doc = "< 4-bit Luminance + 4-bit Alpha"]
22270pub const GPU_LA4: GPU_TEXCOLOR = 9;
22271#[doc = "< 4-bit Luminance"]
22272pub const GPU_L4: GPU_TEXCOLOR = 10;
22273#[doc = "< 4-bit Alpha"]
22274pub const GPU_A4: GPU_TEXCOLOR = 11;
22275#[doc = "< ETC1 texture compression"]
22276pub const GPU_ETC1: GPU_TEXCOLOR = 12;
22277#[doc = "< ETC1 texture compression + 4-bit Alpha"]
22278pub const GPU_ETC1A4: GPU_TEXCOLOR = 13;
22279#[doc = "Supported texture formats."]
22280pub type GPU_TEXCOLOR = ::libc::c_uchar;
22281#[doc = "< 2D face"]
22282pub const GPU_TEXFACE_2D: GPU_TEXFACE = 0;
22283#[doc = "< +X face"]
22284pub const GPU_POSITIVE_X: GPU_TEXFACE = 0;
22285#[doc = "< -X face"]
22286pub const GPU_NEGATIVE_X: GPU_TEXFACE = 1;
22287#[doc = "< +Y face"]
22288pub const GPU_POSITIVE_Y: GPU_TEXFACE = 2;
22289#[doc = "< -Y face"]
22290pub const GPU_NEGATIVE_Y: GPU_TEXFACE = 3;
22291#[doc = "< +Z face"]
22292pub const GPU_POSITIVE_Z: GPU_TEXFACE = 4;
22293#[doc = "< -Z face"]
22294pub const GPU_NEGATIVE_Z: GPU_TEXFACE = 5;
22295#[doc = "Texture faces."]
22296pub type GPU_TEXFACE = ::libc::c_uchar;
22297#[doc = "< Clamp to zero."]
22298pub const GPU_PT_CLAMP_TO_ZERO: GPU_PROCTEX_CLAMP = 0;
22299#[doc = "< Clamp to edge."]
22300pub const GPU_PT_CLAMP_TO_EDGE: GPU_PROCTEX_CLAMP = 1;
22301#[doc = "< Symmetrical repeat."]
22302pub const GPU_PT_REPEAT: GPU_PROCTEX_CLAMP = 2;
22303#[doc = "< Mirrored repeat."]
22304pub const GPU_PT_MIRRORED_REPEAT: GPU_PROCTEX_CLAMP = 3;
22305#[doc = "< Pulse."]
22306pub const GPU_PT_PULSE: GPU_PROCTEX_CLAMP = 4;
22307#[doc = "Procedural texture clamp modes."]
22308pub type GPU_PROCTEX_CLAMP = ::libc::c_uchar;
22309#[doc = "< U"]
22310pub const GPU_PT_U: GPU_PROCTEX_MAPFUNC = 0;
22311#[doc = "< U2"]
22312pub const GPU_PT_U2: GPU_PROCTEX_MAPFUNC = 1;
22313#[doc = "< V"]
22314pub const GPU_PT_V: GPU_PROCTEX_MAPFUNC = 2;
22315#[doc = "< V2"]
22316pub const GPU_PT_V2: GPU_PROCTEX_MAPFUNC = 3;
22317#[doc = "< U+V"]
22318pub const GPU_PT_ADD: GPU_PROCTEX_MAPFUNC = 4;
22319#[doc = "< U2+V2"]
22320pub const GPU_PT_ADD2: GPU_PROCTEX_MAPFUNC = 5;
22321#[doc = "< sqrt(U2+V2)"]
22322pub const GPU_PT_SQRT2: GPU_PROCTEX_MAPFUNC = 6;
22323#[doc = "< min"]
22324pub const GPU_PT_MIN: GPU_PROCTEX_MAPFUNC = 7;
22325#[doc = "< max"]
22326pub const GPU_PT_MAX: GPU_PROCTEX_MAPFUNC = 8;
22327#[doc = "< rmax"]
22328pub const GPU_PT_RMAX: GPU_PROCTEX_MAPFUNC = 9;
22329#[doc = "Procedural texture mapping functions."]
22330pub type GPU_PROCTEX_MAPFUNC = ::libc::c_uchar;
22331#[doc = "< No shift."]
22332pub const GPU_PT_NONE: GPU_PROCTEX_SHIFT = 0;
22333#[doc = "< Odd shift."]
22334pub const GPU_PT_ODD: GPU_PROCTEX_SHIFT = 1;
22335#[doc = "< Even shift."]
22336pub const GPU_PT_EVEN: GPU_PROCTEX_SHIFT = 2;
22337#[doc = "Procedural texture shift values."]
22338pub type GPU_PROCTEX_SHIFT = ::libc::c_uchar;
22339#[doc = "< Nearest-neighbor"]
22340pub const GPU_PT_NEAREST: GPU_PROCTEX_FILTER = 0;
22341#[doc = "< Linear interpolation"]
22342pub const GPU_PT_LINEAR: GPU_PROCTEX_FILTER = 1;
22343#[doc = "< Nearest-neighbor with mipmap using nearest-neighbor"]
22344pub const GPU_PT_NEAREST_MIP_NEAREST: GPU_PROCTEX_FILTER = 2;
22345#[doc = "< Linear interpolation with mipmap using nearest-neighbor"]
22346pub const GPU_PT_LINEAR_MIP_NEAREST: GPU_PROCTEX_FILTER = 3;
22347#[doc = "< Nearest-neighbor with mipmap using linear interpolation"]
22348pub const GPU_PT_NEAREST_MIP_LINEAR: GPU_PROCTEX_FILTER = 4;
22349#[doc = "< Linear interpolation with mipmap using linear interpolation"]
22350pub const GPU_PT_LINEAR_MIP_LINEAR: GPU_PROCTEX_FILTER = 5;
22351#[doc = "Procedural texture filter values."]
22352pub type GPU_PROCTEX_FILTER = ::libc::c_uchar;
22353#[doc = "< Noise table"]
22354pub const GPU_LUT_NOISE: GPU_PROCTEX_LUTID = 0;
22355#[doc = "< RGB mapping function table"]
22356pub const GPU_LUT_RGBMAP: GPU_PROCTEX_LUTID = 2;
22357#[doc = "< Alpha mapping function table"]
22358pub const GPU_LUT_ALPHAMAP: GPU_PROCTEX_LUTID = 3;
22359#[doc = "< Color table"]
22360pub const GPU_LUT_COLOR: GPU_PROCTEX_LUTID = 4;
22361#[doc = "< Color difference table"]
22362pub const GPU_LUT_COLORDIF: GPU_PROCTEX_LUTID = 5;
22363#[doc = "Procedural texture LUT IDs."]
22364pub type GPU_PROCTEX_LUTID = ::libc::c_uchar;
22365#[doc = "< 8-bit Red + 8-bit Green + 8-bit Blue + 8-bit Alpha"]
22366pub const GPU_RB_RGBA8: GPU_COLORBUF = 0;
22367#[doc = "< 8-bit Red + 8-bit Green + 8-bit Blue"]
22368pub const GPU_RB_RGB8: GPU_COLORBUF = 1;
22369#[doc = "< 5-bit Red + 5-bit Green + 5-bit Blue + 1-bit Alpha"]
22370pub const GPU_RB_RGBA5551: GPU_COLORBUF = 2;
22371#[doc = "< 5-bit Red + 6-bit Green + 5-bit Blue"]
22372pub const GPU_RB_RGB565: GPU_COLORBUF = 3;
22373#[doc = "< 4-bit Red + 4-bit Green + 4-bit Blue + 4-bit Alpha"]
22374pub const GPU_RB_RGBA4: GPU_COLORBUF = 4;
22375#[doc = "Supported color buffer formats."]
22376pub type GPU_COLORBUF = ::libc::c_uchar;
22377#[doc = "< 16-bit Depth"]
22378pub const GPU_RB_DEPTH16: GPU_DEPTHBUF = 0;
22379#[doc = "< 24-bit Depth"]
22380pub const GPU_RB_DEPTH24: GPU_DEPTHBUF = 2;
22381#[doc = "< 24-bit Depth + 8-bit Stencil"]
22382pub const GPU_RB_DEPTH24_STENCIL8: GPU_DEPTHBUF = 3;
22383#[doc = "Supported depth buffer formats."]
22384pub type GPU_DEPTHBUF = ::libc::c_uchar;
22385#[doc = "< Never pass."]
22386pub const GPU_NEVER: GPU_TESTFUNC = 0;
22387#[doc = "< Always pass."]
22388pub const GPU_ALWAYS: GPU_TESTFUNC = 1;
22389#[doc = "< Pass if equal."]
22390pub const GPU_EQUAL: GPU_TESTFUNC = 2;
22391#[doc = "< Pass if not equal."]
22392pub const GPU_NOTEQUAL: GPU_TESTFUNC = 3;
22393#[doc = "< Pass if less than."]
22394pub const GPU_LESS: GPU_TESTFUNC = 4;
22395#[doc = "< Pass if less than or equal."]
22396pub const GPU_LEQUAL: GPU_TESTFUNC = 5;
22397#[doc = "< Pass if greater than."]
22398pub const GPU_GREATER: GPU_TESTFUNC = 6;
22399#[doc = "< Pass if greater than or equal."]
22400pub const GPU_GEQUAL: GPU_TESTFUNC = 7;
22401#[doc = "Test functions."]
22402pub type GPU_TESTFUNC = ::libc::c_uchar;
22403#[doc = "< Pass if greater than or equal."]
22404pub const GPU_EARLYDEPTH_GEQUAL: GPU_EARLYDEPTHFUNC = 0;
22405#[doc = "< Pass if greater than."]
22406pub const GPU_EARLYDEPTH_GREATER: GPU_EARLYDEPTHFUNC = 1;
22407#[doc = "< Pass if less than or equal."]
22408pub const GPU_EARLYDEPTH_LEQUAL: GPU_EARLYDEPTHFUNC = 2;
22409#[doc = "< Pass if less than."]
22410pub const GPU_EARLYDEPTH_LESS: GPU_EARLYDEPTHFUNC = 3;
22411#[doc = "Early depth test functions."]
22412pub type GPU_EARLYDEPTHFUNC = ::libc::c_uchar;
22413#[doc = "< Never pass (0)."]
22414pub const GPU_GAS_NEVER: GPU_GASDEPTHFUNC = 0;
22415#[doc = "< Always pass (1)."]
22416pub const GPU_GAS_ALWAYS: GPU_GASDEPTHFUNC = 1;
22417#[doc = "< Pass if greater than (1-X)."]
22418pub const GPU_GAS_GREATER: GPU_GASDEPTHFUNC = 2;
22419#[doc = "< Pass if less than (X)."]
22420pub const GPU_GAS_LESS: GPU_GASDEPTHFUNC = 3;
22421#[doc = "Gas depth functions."]
22422pub type GPU_GASDEPTHFUNC = ::libc::c_uchar;
22423#[doc = "< Disable."]
22424pub const GPU_SCISSOR_DISABLE: GPU_SCISSORMODE = 0;
22425#[doc = "< Exclude pixels inside the scissor box."]
22426pub const GPU_SCISSOR_INVERT: GPU_SCISSORMODE = 1;
22427#[doc = "< Exclude pixels outside of the scissor box."]
22428pub const GPU_SCISSOR_NORMAL: GPU_SCISSORMODE = 3;
22429#[doc = "Scissor test modes."]
22430pub type GPU_SCISSORMODE = ::libc::c_uchar;
22431#[doc = "< Keep old value. (old_stencil)"]
22432pub const GPU_STENCIL_KEEP: GPU_STENCILOP = 0;
22433#[doc = "< Zero. (0)"]
22434pub const GPU_STENCIL_ZERO: GPU_STENCILOP = 1;
22435#[doc = "< Replace value. (ref)"]
22436pub const GPU_STENCIL_REPLACE: GPU_STENCILOP = 2;
22437#[doc = "< Increment value. (old_stencil + 1 saturated to [0, 255])"]
22438pub const GPU_STENCIL_INCR: GPU_STENCILOP = 3;
22439#[doc = "< Decrement value. (old_stencil - 1 saturated to [0, 255])"]
22440pub const GPU_STENCIL_DECR: GPU_STENCILOP = 4;
22441#[doc = "< Invert value. (~old_stencil)"]
22442pub const GPU_STENCIL_INVERT: GPU_STENCILOP = 5;
22443#[doc = "< Increment value. (old_stencil + 1)"]
22444pub const GPU_STENCIL_INCR_WRAP: GPU_STENCILOP = 6;
22445#[doc = "< Decrement value. (old_stencil - 1)"]
22446pub const GPU_STENCIL_DECR_WRAP: GPU_STENCILOP = 7;
22447#[doc = "Stencil operations."]
22448pub type GPU_STENCILOP = ::libc::c_uchar;
22449#[doc = "< Write red."]
22450pub const GPU_WRITE_RED: GPU_WRITEMASK = 1;
22451#[doc = "< Write green."]
22452pub const GPU_WRITE_GREEN: GPU_WRITEMASK = 2;
22453#[doc = "< Write blue."]
22454pub const GPU_WRITE_BLUE: GPU_WRITEMASK = 4;
22455#[doc = "< Write alpha."]
22456pub const GPU_WRITE_ALPHA: GPU_WRITEMASK = 8;
22457#[doc = "< Write depth."]
22458pub const GPU_WRITE_DEPTH: GPU_WRITEMASK = 16;
22459#[doc = "< Write all color components."]
22460pub const GPU_WRITE_COLOR: GPU_WRITEMASK = 15;
22461#[doc = "< Write all components."]
22462pub const GPU_WRITE_ALL: GPU_WRITEMASK = 31;
22463#[doc = "Pixel write mask."]
22464pub type GPU_WRITEMASK = ::libc::c_uchar;
22465#[doc = "< Add colors."]
22466pub const GPU_BLEND_ADD: GPU_BLENDEQUATION = 0;
22467#[doc = "< Subtract colors."]
22468pub const GPU_BLEND_SUBTRACT: GPU_BLENDEQUATION = 1;
22469#[doc = "< Reverse-subtract colors."]
22470pub const GPU_BLEND_REVERSE_SUBTRACT: GPU_BLENDEQUATION = 2;
22471#[doc = "< Use the minimum color."]
22472pub const GPU_BLEND_MIN: GPU_BLENDEQUATION = 3;
22473#[doc = "< Use the maximum color."]
22474pub const GPU_BLEND_MAX: GPU_BLENDEQUATION = 4;
22475#[doc = "Blend modes."]
22476pub type GPU_BLENDEQUATION = ::libc::c_uchar;
22477#[doc = "< Zero."]
22478pub const GPU_ZERO: GPU_BLENDFACTOR = 0;
22479#[doc = "< One."]
22480pub const GPU_ONE: GPU_BLENDFACTOR = 1;
22481#[doc = "< Source color."]
22482pub const GPU_SRC_COLOR: GPU_BLENDFACTOR = 2;
22483#[doc = "< Source color - 1."]
22484pub const GPU_ONE_MINUS_SRC_COLOR: GPU_BLENDFACTOR = 3;
22485#[doc = "< Destination color."]
22486pub const GPU_DST_COLOR: GPU_BLENDFACTOR = 4;
22487#[doc = "< Destination color - 1."]
22488pub const GPU_ONE_MINUS_DST_COLOR: GPU_BLENDFACTOR = 5;
22489#[doc = "< Source alpha."]
22490pub const GPU_SRC_ALPHA: GPU_BLENDFACTOR = 6;
22491#[doc = "< Source alpha - 1."]
22492pub const GPU_ONE_MINUS_SRC_ALPHA: GPU_BLENDFACTOR = 7;
22493#[doc = "< Destination alpha."]
22494pub const GPU_DST_ALPHA: GPU_BLENDFACTOR = 8;
22495#[doc = "< Destination alpha - 1."]
22496pub const GPU_ONE_MINUS_DST_ALPHA: GPU_BLENDFACTOR = 9;
22497#[doc = "< Constant color."]
22498pub const GPU_CONSTANT_COLOR: GPU_BLENDFACTOR = 10;
22499#[doc = "< Constant color - 1."]
22500pub const GPU_ONE_MINUS_CONSTANT_COLOR: GPU_BLENDFACTOR = 11;
22501#[doc = "< Constant alpha."]
22502pub const GPU_CONSTANT_ALPHA: GPU_BLENDFACTOR = 12;
22503#[doc = "< Constant alpha - 1."]
22504pub const GPU_ONE_MINUS_CONSTANT_ALPHA: GPU_BLENDFACTOR = 13;
22505#[doc = "< Saturated alpha."]
22506pub const GPU_SRC_ALPHA_SATURATE: GPU_BLENDFACTOR = 14;
22507#[doc = "Blend factors."]
22508pub type GPU_BLENDFACTOR = ::libc::c_uchar;
22509#[doc = "< Clear."]
22510pub const GPU_LOGICOP_CLEAR: GPU_LOGICOP = 0;
22511#[doc = "< Bitwise AND."]
22512pub const GPU_LOGICOP_AND: GPU_LOGICOP = 1;
22513#[doc = "< Reverse bitwise AND."]
22514pub const GPU_LOGICOP_AND_REVERSE: GPU_LOGICOP = 2;
22515#[doc = "< Copy."]
22516pub const GPU_LOGICOP_COPY: GPU_LOGICOP = 3;
22517#[doc = "< Set."]
22518pub const GPU_LOGICOP_SET: GPU_LOGICOP = 4;
22519#[doc = "< Inverted copy."]
22520pub const GPU_LOGICOP_COPY_INVERTED: GPU_LOGICOP = 5;
22521#[doc = "< No operation."]
22522pub const GPU_LOGICOP_NOOP: GPU_LOGICOP = 6;
22523#[doc = "< Invert."]
22524pub const GPU_LOGICOP_INVERT: GPU_LOGICOP = 7;
22525#[doc = "< Bitwise NAND."]
22526pub const GPU_LOGICOP_NAND: GPU_LOGICOP = 8;
22527#[doc = "< Bitwise OR."]
22528pub const GPU_LOGICOP_OR: GPU_LOGICOP = 9;
22529#[doc = "< Bitwise NOR."]
22530pub const GPU_LOGICOP_NOR: GPU_LOGICOP = 10;
22531#[doc = "< Bitwise XOR."]
22532pub const GPU_LOGICOP_XOR: GPU_LOGICOP = 11;
22533#[doc = "< Equivalent."]
22534pub const GPU_LOGICOP_EQUIV: GPU_LOGICOP = 12;
22535#[doc = "< Inverted bitwise AND."]
22536pub const GPU_LOGICOP_AND_INVERTED: GPU_LOGICOP = 13;
22537#[doc = "< Reverse bitwise OR."]
22538pub const GPU_LOGICOP_OR_REVERSE: GPU_LOGICOP = 14;
22539#[doc = "< Inverted bitwize OR."]
22540pub const GPU_LOGICOP_OR_INVERTED: GPU_LOGICOP = 15;
22541#[doc = "Logical operations."]
22542pub type GPU_LOGICOP = ::libc::c_uchar;
22543#[doc = "< OpenGL mode."]
22544pub const GPU_FRAGOPMODE_GL: GPU_FRAGOPMODE = 0;
22545#[doc = "< Gas mode (?)."]
22546pub const GPU_FRAGOPMODE_GAS_ACC: GPU_FRAGOPMODE = 1;
22547#[doc = "< Shadow mode (?)."]
22548pub const GPU_FRAGOPMODE_SHADOW: GPU_FRAGOPMODE = 3;
22549#[doc = "Fragment operation modes."]
22550pub type GPU_FRAGOPMODE = ::libc::c_uchar;
22551#[doc = "< 8-bit byte."]
22552pub const GPU_BYTE: GPU_FORMATS = 0;
22553#[doc = "< 8-bit unsigned byte."]
22554pub const GPU_UNSIGNED_BYTE: GPU_FORMATS = 1;
22555#[doc = "< 16-bit short."]
22556pub const GPU_SHORT: GPU_FORMATS = 2;
22557#[doc = "< 32-bit float."]
22558pub const GPU_FLOAT: GPU_FORMATS = 3;
22559#[doc = "Supported component formats."]
22560pub type GPU_FORMATS = ::libc::c_uchar;
22561#[doc = "< Disabled."]
22562pub const GPU_CULL_NONE: GPU_CULLMODE = 0;
22563#[doc = "< Front, counter-clockwise."]
22564pub const GPU_CULL_FRONT_CCW: GPU_CULLMODE = 1;
22565#[doc = "< Back, counter-clockwise."]
22566pub const GPU_CULL_BACK_CCW: GPU_CULLMODE = 2;
22567#[doc = "Cull modes."]
22568pub type GPU_CULLMODE = ::libc::c_uchar;
22569#[doc = "< Primary color."]
22570pub const GPU_PRIMARY_COLOR: GPU_TEVSRC = 0;
22571#[doc = "< Primary fragment color."]
22572pub const GPU_FRAGMENT_PRIMARY_COLOR: GPU_TEVSRC = 1;
22573#[doc = "< Secondary fragment color."]
22574pub const GPU_FRAGMENT_SECONDARY_COLOR: GPU_TEVSRC = 2;
22575#[doc = "< Texture unit 0."]
22576pub const GPU_TEXTURE0: GPU_TEVSRC = 3;
22577#[doc = "< Texture unit 1."]
22578pub const GPU_TEXTURE1: GPU_TEVSRC = 4;
22579#[doc = "< Texture unit 2."]
22580pub const GPU_TEXTURE2: GPU_TEVSRC = 5;
22581#[doc = "< Texture unit 3."]
22582pub const GPU_TEXTURE3: GPU_TEVSRC = 6;
22583#[doc = "< Previous buffer."]
22584pub const GPU_PREVIOUS_BUFFER: GPU_TEVSRC = 13;
22585#[doc = "< Constant value."]
22586pub const GPU_CONSTANT: GPU_TEVSRC = 14;
22587#[doc = "< Previous value."]
22588pub const GPU_PREVIOUS: GPU_TEVSRC = 15;
22589#[doc = "Texture combiner sources."]
22590pub type GPU_TEVSRC = ::libc::c_uchar;
22591#[doc = "< Source color."]
22592pub const GPU_TEVOP_RGB_SRC_COLOR: GPU_TEVOP_RGB = 0;
22593#[doc = "< Source color - 1."]
22594pub const GPU_TEVOP_RGB_ONE_MINUS_SRC_COLOR: GPU_TEVOP_RGB = 1;
22595#[doc = "< Source alpha."]
22596pub const GPU_TEVOP_RGB_SRC_ALPHA: GPU_TEVOP_RGB = 2;
22597#[doc = "< Source alpha - 1."]
22598pub const GPU_TEVOP_RGB_ONE_MINUS_SRC_ALPHA: GPU_TEVOP_RGB = 3;
22599#[doc = "< Source red."]
22600pub const GPU_TEVOP_RGB_SRC_R: GPU_TEVOP_RGB = 4;
22601#[doc = "< Source red - 1."]
22602pub const GPU_TEVOP_RGB_ONE_MINUS_SRC_R: GPU_TEVOP_RGB = 5;
22603#[doc = "< Unknown."]
22604pub const GPU_TEVOP_RGB_0x06: GPU_TEVOP_RGB = 6;
22605#[doc = "< Unknown."]
22606pub const GPU_TEVOP_RGB_0x07: GPU_TEVOP_RGB = 7;
22607#[doc = "< Source green."]
22608pub const GPU_TEVOP_RGB_SRC_G: GPU_TEVOP_RGB = 8;
22609#[doc = "< Source green - 1."]
22610pub const GPU_TEVOP_RGB_ONE_MINUS_SRC_G: GPU_TEVOP_RGB = 9;
22611#[doc = "< Unknown."]
22612pub const GPU_TEVOP_RGB_0x0A: GPU_TEVOP_RGB = 10;
22613#[doc = "< Unknown."]
22614pub const GPU_TEVOP_RGB_0x0B: GPU_TEVOP_RGB = 11;
22615#[doc = "< Source blue."]
22616pub const GPU_TEVOP_RGB_SRC_B: GPU_TEVOP_RGB = 12;
22617#[doc = "< Source blue - 1."]
22618pub const GPU_TEVOP_RGB_ONE_MINUS_SRC_B: GPU_TEVOP_RGB = 13;
22619#[doc = "< Unknown."]
22620pub const GPU_TEVOP_RGB_0x0E: GPU_TEVOP_RGB = 14;
22621#[doc = "< Unknown."]
22622pub const GPU_TEVOP_RGB_0x0F: GPU_TEVOP_RGB = 15;
22623#[doc = "Texture RGB combiner operands."]
22624pub type GPU_TEVOP_RGB = ::libc::c_uchar;
22625#[doc = "< Source alpha."]
22626pub const GPU_TEVOP_A_SRC_ALPHA: GPU_TEVOP_A = 0;
22627#[doc = "< Source alpha - 1."]
22628pub const GPU_TEVOP_A_ONE_MINUS_SRC_ALPHA: GPU_TEVOP_A = 1;
22629#[doc = "< Source red."]
22630pub const GPU_TEVOP_A_SRC_R: GPU_TEVOP_A = 2;
22631#[doc = "< Source red - 1."]
22632pub const GPU_TEVOP_A_ONE_MINUS_SRC_R: GPU_TEVOP_A = 3;
22633#[doc = "< Source green."]
22634pub const GPU_TEVOP_A_SRC_G: GPU_TEVOP_A = 4;
22635#[doc = "< Source green - 1."]
22636pub const GPU_TEVOP_A_ONE_MINUS_SRC_G: GPU_TEVOP_A = 5;
22637#[doc = "< Source blue."]
22638pub const GPU_TEVOP_A_SRC_B: GPU_TEVOP_A = 6;
22639#[doc = "< Source blue - 1."]
22640pub const GPU_TEVOP_A_ONE_MINUS_SRC_B: GPU_TEVOP_A = 7;
22641#[doc = "Texture Alpha combiner operands."]
22642pub type GPU_TEVOP_A = ::libc::c_uchar;
22643#[doc = "< Replace."]
22644pub const GPU_REPLACE: GPU_COMBINEFUNC = 0;
22645#[doc = "< Modulate."]
22646pub const GPU_MODULATE: GPU_COMBINEFUNC = 1;
22647#[doc = "< Add."]
22648pub const GPU_ADD: GPU_COMBINEFUNC = 2;
22649#[doc = "< Signed add."]
22650pub const GPU_ADD_SIGNED: GPU_COMBINEFUNC = 3;
22651#[doc = "< Interpolate."]
22652pub const GPU_INTERPOLATE: GPU_COMBINEFUNC = 4;
22653#[doc = "< Subtract."]
22654pub const GPU_SUBTRACT: GPU_COMBINEFUNC = 5;
22655#[doc = "< Dot3. Scalar result is written to RGB only."]
22656pub const GPU_DOT3_RGB: GPU_COMBINEFUNC = 6;
22657#[doc = "< Dot3. Scalar result is written to RGBA."]
22658pub const GPU_DOT3_RGBA: GPU_COMBINEFUNC = 7;
22659#[doc = "< Multiply then add."]
22660pub const GPU_MULTIPLY_ADD: GPU_COMBINEFUNC = 8;
22661#[doc = "< Add then multiply."]
22662pub const GPU_ADD_MULTIPLY: GPU_COMBINEFUNC = 9;
22663#[doc = "Texture combiner functions."]
22664pub type GPU_COMBINEFUNC = ::libc::c_uchar;
22665#[doc = "< 1x"]
22666pub const GPU_TEVSCALE_1: GPU_TEVSCALE = 0;
22667#[doc = "< 2x"]
22668pub const GPU_TEVSCALE_2: GPU_TEVSCALE = 1;
22669#[doc = "< 4x"]
22670pub const GPU_TEVSCALE_4: GPU_TEVSCALE = 2;
22671#[doc = "Texture scale factors."]
22672pub type GPU_TEVSCALE = ::libc::c_uchar;
22673#[doc = "< None."]
22674pub const GPU_NO_FRESNEL: GPU_FRESNELSEL = 0;
22675#[doc = "< Primary alpha."]
22676pub const GPU_PRI_ALPHA_FRESNEL: GPU_FRESNELSEL = 1;
22677#[doc = "< Secondary alpha."]
22678pub const GPU_SEC_ALPHA_FRESNEL: GPU_FRESNELSEL = 2;
22679#[doc = "< Primary and secondary alpha."]
22680pub const GPU_PRI_SEC_ALPHA_FRESNEL: GPU_FRESNELSEL = 3;
22681#[doc = "Fresnel options."]
22682pub type GPU_FRESNELSEL = ::libc::c_uchar;
22683#[doc = "< Disabled."]
22684pub const GPU_BUMP_NOT_USED: GPU_BUMPMODE = 0;
22685#[doc = "< Bump as bump mapping."]
22686pub const GPU_BUMP_AS_BUMP: GPU_BUMPMODE = 1;
22687#[doc = "< Bump as tangent/normal mapping."]
22688pub const GPU_BUMP_AS_TANG: GPU_BUMPMODE = 2;
22689#[doc = "Bump map modes."]
22690pub type GPU_BUMPMODE = ::libc::c_uchar;
22691#[doc = "< D0 LUT."]
22692pub const GPU_LUT_D0: GPU_LIGHTLUTID = 0;
22693#[doc = "< D1 LUT."]
22694pub const GPU_LUT_D1: GPU_LIGHTLUTID = 1;
22695#[doc = "< Spotlight LUT."]
22696pub const GPU_LUT_SP: GPU_LIGHTLUTID = 2;
22697#[doc = "< Fresnel LUT."]
22698pub const GPU_LUT_FR: GPU_LIGHTLUTID = 3;
22699#[doc = "< Reflection-Blue LUT."]
22700pub const GPU_LUT_RB: GPU_LIGHTLUTID = 4;
22701#[doc = "< Reflection-Green LUT."]
22702pub const GPU_LUT_RG: GPU_LIGHTLUTID = 5;
22703#[doc = "< Reflection-Red LUT."]
22704pub const GPU_LUT_RR: GPU_LIGHTLUTID = 6;
22705#[doc = "< Distance attenuation LUT."]
22706pub const GPU_LUT_DA: GPU_LIGHTLUTID = 7;
22707#[doc = "LUT IDs."]
22708pub type GPU_LIGHTLUTID = ::libc::c_uchar;
22709#[doc = "< Normal*HalfVector"]
22710pub const GPU_LUTINPUT_NH: GPU_LIGHTLUTINPUT = 0;
22711#[doc = "< View*HalfVector"]
22712pub const GPU_LUTINPUT_VH: GPU_LIGHTLUTINPUT = 1;
22713#[doc = "< Normal*View"]
22714pub const GPU_LUTINPUT_NV: GPU_LIGHTLUTINPUT = 2;
22715#[doc = "< LightVector*Normal"]
22716pub const GPU_LUTINPUT_LN: GPU_LIGHTLUTINPUT = 3;
22717#[doc = "< -LightVector*SpotlightVector"]
22718pub const GPU_LUTINPUT_SP: GPU_LIGHTLUTINPUT = 4;
22719#[doc = "< cosine of phi"]
22720pub const GPU_LUTINPUT_CP: GPU_LIGHTLUTINPUT = 5;
22721#[doc = "LUT inputs."]
22722pub type GPU_LIGHTLUTINPUT = ::libc::c_uchar;
22723#[doc = "< 1x scale."]
22724pub const GPU_LUTSCALER_1x: GPU_LIGHTLUTSCALER = 0;
22725#[doc = "< 2x scale."]
22726pub const GPU_LUTSCALER_2x: GPU_LIGHTLUTSCALER = 1;
22727#[doc = "< 4x scale."]
22728pub const GPU_LUTSCALER_4x: GPU_LIGHTLUTSCALER = 2;
22729#[doc = "< 8x scale."]
22730pub const GPU_LUTSCALER_8x: GPU_LIGHTLUTSCALER = 3;
22731#[doc = "< 0.25x scale."]
22732pub const GPU_LUTSCALER_0_25x: GPU_LIGHTLUTSCALER = 6;
22733#[doc = "< 0.5x scale."]
22734pub const GPU_LUTSCALER_0_5x: GPU_LIGHTLUTSCALER = 7;
22735#[doc = "LUT scalers."]
22736pub type GPU_LIGHTLUTSCALER = ::libc::c_uchar;
22737#[doc = "< LUTs that are common to all lights."]
22738pub const GPU_LUTSELECT_COMMON: GPU_LIGHTLUTSELECT = 0;
22739#[doc = "< Spotlight LUT."]
22740pub const GPU_LUTSELECT_SP: GPU_LIGHTLUTSELECT = 1;
22741#[doc = "< Distance attenuation LUT."]
22742pub const GPU_LUTSELECT_DA: GPU_LIGHTLUTSELECT = 2;
22743#[doc = "LUT selection."]
22744pub type GPU_LIGHTLUTSELECT = ::libc::c_uchar;
22745#[doc = "< Fog/Gas unit disabled."]
22746pub const GPU_NO_FOG: GPU_FOGMODE = 0;
22747#[doc = "< Fog/Gas unit configured in Fog mode."]
22748pub const GPU_FOG: GPU_FOGMODE = 5;
22749#[doc = "< Fog/Gas unit configured in Gas mode."]
22750pub const GPU_GAS: GPU_FOGMODE = 7;
22751#[doc = "Fog modes."]
22752pub type GPU_FOGMODE = ::libc::c_uchar;
22753#[doc = "< Plain density."]
22754pub const GPU_PLAIN_DENSITY: GPU_GASMODE = 0;
22755#[doc = "< Depth density."]
22756pub const GPU_DEPTH_DENSITY: GPU_GASMODE = 1;
22757#[doc = "Gas shading density source values."]
22758pub type GPU_GASMODE = ::libc::c_uchar;
22759#[doc = "< Gas density used as input."]
22760pub const GPU_GAS_DENSITY: GPU_GASLUTINPUT = 0;
22761#[doc = "< Light factor used as input."]
22762pub const GPU_GAS_LIGHT_FACTOR: GPU_GASLUTINPUT = 1;
22763#[doc = "Gas color LUT inputs."]
22764pub type GPU_GASLUTINPUT = ::libc::c_uchar;
22765#[doc = "< Triangles."]
22766pub const GPU_TRIANGLES: GPU_Primitive_t = 0;
22767#[doc = "< Triangle strip."]
22768pub const GPU_TRIANGLE_STRIP: GPU_Primitive_t = 256;
22769#[doc = "< Triangle fan."]
22770pub const GPU_TRIANGLE_FAN: GPU_Primitive_t = 512;
22771#[doc = "< Geometry shader primitive."]
22772pub const GPU_GEOMETRY_PRIM: GPU_Primitive_t = 768;
22773#[doc = "Supported primitives."]
22774pub type GPU_Primitive_t = ::libc::c_ushort;
22775#[doc = "< Vertex shader."]
22776pub const GPU_VERTEX_SHADER: GPU_SHADER_TYPE = 0;
22777#[doc = "< Geometry shader."]
22778pub const GPU_GEOMETRY_SHADER: GPU_SHADER_TYPE = 1;
22779#[doc = "Shader types."]
22780pub type GPU_SHADER_TYPE = ::libc::c_uchar;
22781unsafe extern "C" {
22782 #[doc = "< GPU command buffer."]
22783 pub static mut gpuCmdBuf: *mut u32_;
22784}
22785unsafe extern "C" {
22786 #[doc = "< GPU command buffer size."]
22787 pub static mut gpuCmdBufSize: u32_;
22788}
22789unsafe extern "C" {
22790 #[doc = "< GPU command buffer offset."]
22791 pub static mut gpuCmdBufOffset: u32_;
22792}
22793unsafe extern "C" {
22794 #[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."]
22795 #[link_name = "GPUCMD_SetBuffer__extern"]
22796 pub fn GPUCMD_SetBuffer(adr: *mut u32_, size: u32_, offset: u32_);
22797}
22798unsafe extern "C" {
22799 #[doc = "Sets the offset of the GPU command buffer.\n # Arguments\n\n* `offset` - Offset of the command buffer."]
22800 #[link_name = "GPUCMD_SetBufferOffset__extern"]
22801 pub fn GPUCMD_SetBufferOffset(offset: u32_);
22802}
22803unsafe extern "C" {
22804 #[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."]
22805 #[link_name = "GPUCMD_GetBuffer__extern"]
22806 pub fn GPUCMD_GetBuffer(addr: *mut *mut u32_, size: *mut u32_, offset: *mut u32_);
22807}
22808unsafe extern "C" {
22809 #[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."]
22810 pub fn GPUCMD_AddRawCommands(cmd: *const u32_, size: u32_);
22811}
22812unsafe extern "C" {
22813 #[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."]
22814 pub fn GPUCMD_Add(header: u32_, param: *const u32_, paramlength: u32_);
22815}
22816unsafe extern "C" {
22817 #[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."]
22818 pub fn GPUCMD_Split(addr: *mut *mut u32_, size: *mut u32_);
22819}
22820unsafe extern "C" {
22821 #[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."]
22822 pub fn f32tof16(f: f32) -> u32_;
22823}
22824unsafe extern "C" {
22825 #[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."]
22826 pub fn f32tof20(f: f32) -> u32_;
22827}
22828unsafe extern "C" {
22829 #[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."]
22830 pub fn f32tof24(f: f32) -> u32_;
22831}
22832unsafe extern "C" {
22833 #[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."]
22834 pub fn f32tof31(f: f32) -> u32_;
22835}
22836unsafe extern "C" {
22837 #[doc = "Adds a command with a single parameter to the current command buffer."]
22838 #[link_name = "GPUCMD_AddSingleParam__extern"]
22839 pub fn GPUCMD_AddSingleParam(header: u32_, param: u32_);
22840}
22841#[doc = "< Vertex shader."]
22842pub const VERTEX_SHDR: DVLE_type = 0;
22843#[doc = "< Geometry shader."]
22844pub const GEOMETRY_SHDR: DVLE_type = 1;
22845#[doc = "DVLE type."]
22846pub type DVLE_type = ::libc::c_uchar;
22847#[doc = "< Bool."]
22848pub const DVLE_CONST_BOOL: DVLE_constantType = 0;
22849#[doc = "< Unsigned 8-bit integer."]
22850pub const DVLE_CONST_u8: DVLE_constantType = 1;
22851#[doc = "< 24-bit float."]
22852pub const DVLE_CONST_FLOAT24: DVLE_constantType = 2;
22853#[doc = "Constant type."]
22854pub type DVLE_constantType = ::libc::c_uchar;
22855#[doc = "< Position."]
22856pub const RESULT_POSITION: DVLE_outputAttribute_t = 0;
22857#[doc = "< Normal Quaternion."]
22858pub const RESULT_NORMALQUAT: DVLE_outputAttribute_t = 1;
22859#[doc = "< Color."]
22860pub const RESULT_COLOR: DVLE_outputAttribute_t = 2;
22861#[doc = "< Texture coordinate 0."]
22862pub const RESULT_TEXCOORD0: DVLE_outputAttribute_t = 3;
22863#[doc = "< Texture coordinate 0 W."]
22864pub const RESULT_TEXCOORD0W: DVLE_outputAttribute_t = 4;
22865#[doc = "< Texture coordinate 1."]
22866pub const RESULT_TEXCOORD1: DVLE_outputAttribute_t = 5;
22867#[doc = "< Texture coordinate 2."]
22868pub const RESULT_TEXCOORD2: DVLE_outputAttribute_t = 6;
22869#[doc = "< View."]
22870pub const RESULT_VIEW: DVLE_outputAttribute_t = 8;
22871#[doc = "< Dummy attribute (used as passthrough for geometry shader input)."]
22872pub const RESULT_DUMMY: DVLE_outputAttribute_t = 9;
22873#[doc = "Output attribute."]
22874pub type DVLE_outputAttribute_t = ::libc::c_uchar;
22875#[doc = "< Point processing mode."]
22876pub const GSH_POINT: DVLE_geoShaderMode = 0;
22877#[doc = "< Variable-size primitive processing mode."]
22878pub const GSH_VARIABLE_PRIM: DVLE_geoShaderMode = 1;
22879#[doc = "< Fixed-size primitive processing mode."]
22880pub const GSH_FIXED_PRIM: DVLE_geoShaderMode = 2;
22881#[doc = "Geometry shader operation modes."]
22882pub type DVLE_geoShaderMode = ::libc::c_uchar;
22883#[doc = "DVLP data."]
22884#[repr(C)]
22885#[derive(Debug, Copy, Clone)]
22886pub struct DVLP_s {
22887 #[doc = "< Code size."]
22888 pub codeSize: u32_,
22889 #[doc = "< Code data."]
22890 pub codeData: *mut u32_,
22891 #[doc = "< Operand description size."]
22892 pub opdescSize: u32_,
22893 #[doc = "< Operand description data."]
22894 pub opcdescData: *mut u32_,
22895}
22896#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22897const _: () = {
22898 ["Size of DVLP_s"][::core::mem::size_of::<DVLP_s>() - 16usize];
22899 ["Alignment of DVLP_s"][::core::mem::align_of::<DVLP_s>() - 4usize];
22900 ["Offset of field: DVLP_s::codeSize"][::core::mem::offset_of!(DVLP_s, codeSize) - 0usize];
22901 ["Offset of field: DVLP_s::codeData"][::core::mem::offset_of!(DVLP_s, codeData) - 4usize];
22902 ["Offset of field: DVLP_s::opdescSize"][::core::mem::offset_of!(DVLP_s, opdescSize) - 8usize];
22903 ["Offset of field: DVLP_s::opcdescData"]
22904 [::core::mem::offset_of!(DVLP_s, opcdescData) - 12usize];
22905};
22906impl Default for DVLP_s {
22907 fn default() -> Self {
22908 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
22909 unsafe {
22910 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
22911 s.assume_init()
22912 }
22913 }
22914}
22915#[doc = "DVLE constant entry data."]
22916#[repr(C)]
22917#[derive(Debug, Default, Copy, Clone)]
22918pub struct DVLE_constEntry_s {
22919 #[doc = "< Constant type. See DVLE_constantType"]
22920 pub type_: u16_,
22921 #[doc = "< Constant ID."]
22922 pub id: u16_,
22923 #[doc = "< Constant data."]
22924 pub data: [u32_; 4usize],
22925}
22926#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22927const _: () = {
22928 ["Size of DVLE_constEntry_s"][::core::mem::size_of::<DVLE_constEntry_s>() - 20usize];
22929 ["Alignment of DVLE_constEntry_s"][::core::mem::align_of::<DVLE_constEntry_s>() - 4usize];
22930 ["Offset of field: DVLE_constEntry_s::type_"]
22931 [::core::mem::offset_of!(DVLE_constEntry_s, type_) - 0usize];
22932 ["Offset of field: DVLE_constEntry_s::id"]
22933 [::core::mem::offset_of!(DVLE_constEntry_s, id) - 2usize];
22934 ["Offset of field: DVLE_constEntry_s::data"]
22935 [::core::mem::offset_of!(DVLE_constEntry_s, data) - 4usize];
22936};
22937#[doc = "DVLE output entry data."]
22938#[repr(C)]
22939#[derive(Debug, Default, Copy, Clone)]
22940pub struct DVLE_outEntry_s {
22941 #[doc = "< Output type. See DVLE_outputAttribute_t"]
22942 pub type_: u16_,
22943 #[doc = "< Output register ID."]
22944 pub regID: u16_,
22945 #[doc = "< Output mask."]
22946 pub mask: u8_,
22947 #[doc = "< Unknown."]
22948 pub unk: [u8_; 3usize],
22949}
22950#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22951const _: () = {
22952 ["Size of DVLE_outEntry_s"][::core::mem::size_of::<DVLE_outEntry_s>() - 8usize];
22953 ["Alignment of DVLE_outEntry_s"][::core::mem::align_of::<DVLE_outEntry_s>() - 2usize];
22954 ["Offset of field: DVLE_outEntry_s::type_"]
22955 [::core::mem::offset_of!(DVLE_outEntry_s, type_) - 0usize];
22956 ["Offset of field: DVLE_outEntry_s::regID"]
22957 [::core::mem::offset_of!(DVLE_outEntry_s, regID) - 2usize];
22958 ["Offset of field: DVLE_outEntry_s::mask"]
22959 [::core::mem::offset_of!(DVLE_outEntry_s, mask) - 4usize];
22960 ["Offset of field: DVLE_outEntry_s::unk"]
22961 [::core::mem::offset_of!(DVLE_outEntry_s, unk) - 5usize];
22962};
22963#[doc = "DVLE uniform entry data."]
22964#[repr(C)]
22965#[derive(Debug, Default, Copy, Clone)]
22966pub struct DVLE_uniformEntry_s {
22967 #[doc = "< Symbol offset."]
22968 pub symbolOffset: u32_,
22969 #[doc = "< Start register."]
22970 pub startReg: u16_,
22971 #[doc = "< End register."]
22972 pub endReg: u16_,
22973}
22974#[allow(clippy::unnecessary_operation, clippy::identity_op)]
22975const _: () = {
22976 ["Size of DVLE_uniformEntry_s"][::core::mem::size_of::<DVLE_uniformEntry_s>() - 8usize];
22977 ["Alignment of DVLE_uniformEntry_s"][::core::mem::align_of::<DVLE_uniformEntry_s>() - 4usize];
22978 ["Offset of field: DVLE_uniformEntry_s::symbolOffset"]
22979 [::core::mem::offset_of!(DVLE_uniformEntry_s, symbolOffset) - 0usize];
22980 ["Offset of field: DVLE_uniformEntry_s::startReg"]
22981 [::core::mem::offset_of!(DVLE_uniformEntry_s, startReg) - 4usize];
22982 ["Offset of field: DVLE_uniformEntry_s::endReg"]
22983 [::core::mem::offset_of!(DVLE_uniformEntry_s, endReg) - 6usize];
22984};
22985#[doc = "DVLE data."]
22986#[repr(C)]
22987#[derive(Debug, Copy, Clone)]
22988pub struct DVLE_s {
22989 #[doc = "< DVLE type."]
22990 pub type_: DVLE_type,
22991 #[doc = "< true = merge vertex/geometry shader outmaps ('dummy' output attribute is present)."]
22992 pub mergeOutmaps: bool,
22993 #[doc = "< Geometry shader operation mode."]
22994 pub gshMode: DVLE_geoShaderMode,
22995 #[doc = "< Starting float uniform register number for storing the fixed-size primitive vertex array."]
22996 pub gshFixedVtxStart: u8_,
22997 #[doc = "< Number of fully-defined vertices in the variable-size primitive vertex array."]
22998 pub gshVariableVtxNum: u8_,
22999 #[doc = "< Number of vertices in the fixed-size primitive vertex array."]
23000 pub gshFixedVtxNum: u8_,
23001 #[doc = "< Contained DVLPs."]
23002 pub dvlp: *mut DVLP_s,
23003 #[doc = "< Offset of the start of the main function."]
23004 pub mainOffset: u32_,
23005 #[doc = "< Offset of the end of the main function."]
23006 pub endmainOffset: u32_,
23007 #[doc = "< Constant table size."]
23008 pub constTableSize: u32_,
23009 #[doc = "< Constant table data."]
23010 pub constTableData: *mut DVLE_constEntry_s,
23011 #[doc = "< Output table size."]
23012 pub outTableSize: u32_,
23013 #[doc = "< Output table data."]
23014 pub outTableData: *mut DVLE_outEntry_s,
23015 #[doc = "< Uniform table size."]
23016 pub uniformTableSize: u32_,
23017 #[doc = "< Uniform table data."]
23018 pub uniformTableData: *mut DVLE_uniformEntry_s,
23019 #[doc = "< Symbol table data."]
23020 pub symbolTableData: *mut ::libc::c_char,
23021 #[doc = "< Output map mask."]
23022 pub outmapMask: u8_,
23023 #[doc = "< Output map data."]
23024 pub outmapData: [u32_; 8usize],
23025 #[doc = "< Output map mode."]
23026 pub outmapMode: u32_,
23027 #[doc = "< Output map attribute clock."]
23028 pub outmapClock: u32_,
23029}
23030#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23031const _: () = {
23032 ["Size of DVLE_s"][::core::mem::size_of::<DVLE_s>() - 92usize];
23033 ["Alignment of DVLE_s"][::core::mem::align_of::<DVLE_s>() - 4usize];
23034 ["Offset of field: DVLE_s::type_"][::core::mem::offset_of!(DVLE_s, type_) - 0usize];
23035 ["Offset of field: DVLE_s::mergeOutmaps"]
23036 [::core::mem::offset_of!(DVLE_s, mergeOutmaps) - 1usize];
23037 ["Offset of field: DVLE_s::gshMode"][::core::mem::offset_of!(DVLE_s, gshMode) - 2usize];
23038 ["Offset of field: DVLE_s::gshFixedVtxStart"]
23039 [::core::mem::offset_of!(DVLE_s, gshFixedVtxStart) - 3usize];
23040 ["Offset of field: DVLE_s::gshVariableVtxNum"]
23041 [::core::mem::offset_of!(DVLE_s, gshVariableVtxNum) - 4usize];
23042 ["Offset of field: DVLE_s::gshFixedVtxNum"]
23043 [::core::mem::offset_of!(DVLE_s, gshFixedVtxNum) - 5usize];
23044 ["Offset of field: DVLE_s::dvlp"][::core::mem::offset_of!(DVLE_s, dvlp) - 8usize];
23045 ["Offset of field: DVLE_s::mainOffset"][::core::mem::offset_of!(DVLE_s, mainOffset) - 12usize];
23046 ["Offset of field: DVLE_s::endmainOffset"]
23047 [::core::mem::offset_of!(DVLE_s, endmainOffset) - 16usize];
23048 ["Offset of field: DVLE_s::constTableSize"]
23049 [::core::mem::offset_of!(DVLE_s, constTableSize) - 20usize];
23050 ["Offset of field: DVLE_s::constTableData"]
23051 [::core::mem::offset_of!(DVLE_s, constTableData) - 24usize];
23052 ["Offset of field: DVLE_s::outTableSize"]
23053 [::core::mem::offset_of!(DVLE_s, outTableSize) - 28usize];
23054 ["Offset of field: DVLE_s::outTableData"]
23055 [::core::mem::offset_of!(DVLE_s, outTableData) - 32usize];
23056 ["Offset of field: DVLE_s::uniformTableSize"]
23057 [::core::mem::offset_of!(DVLE_s, uniformTableSize) - 36usize];
23058 ["Offset of field: DVLE_s::uniformTableData"]
23059 [::core::mem::offset_of!(DVLE_s, uniformTableData) - 40usize];
23060 ["Offset of field: DVLE_s::symbolTableData"]
23061 [::core::mem::offset_of!(DVLE_s, symbolTableData) - 44usize];
23062 ["Offset of field: DVLE_s::outmapMask"][::core::mem::offset_of!(DVLE_s, outmapMask) - 48usize];
23063 ["Offset of field: DVLE_s::outmapData"][::core::mem::offset_of!(DVLE_s, outmapData) - 52usize];
23064 ["Offset of field: DVLE_s::outmapMode"][::core::mem::offset_of!(DVLE_s, outmapMode) - 84usize];
23065 ["Offset of field: DVLE_s::outmapClock"]
23066 [::core::mem::offset_of!(DVLE_s, outmapClock) - 88usize];
23067};
23068impl Default for DVLE_s {
23069 fn default() -> Self {
23070 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
23071 unsafe {
23072 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
23073 s.assume_init()
23074 }
23075 }
23076}
23077#[doc = "DVLB data."]
23078#[repr(C)]
23079#[derive(Debug, Copy, Clone)]
23080pub struct DVLB_s {
23081 #[doc = "< DVLE count."]
23082 pub numDVLE: u32_,
23083 #[doc = "< Primary DVLP."]
23084 pub DVLP: DVLP_s,
23085 #[doc = "< Contained DVLE."]
23086 pub DVLE: *mut DVLE_s,
23087}
23088#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23089const _: () = {
23090 ["Size of DVLB_s"][::core::mem::size_of::<DVLB_s>() - 24usize];
23091 ["Alignment of DVLB_s"][::core::mem::align_of::<DVLB_s>() - 4usize];
23092 ["Offset of field: DVLB_s::numDVLE"][::core::mem::offset_of!(DVLB_s, numDVLE) - 0usize];
23093 ["Offset of field: DVLB_s::DVLP"][::core::mem::offset_of!(DVLB_s, DVLP) - 4usize];
23094 ["Offset of field: DVLB_s::DVLE"][::core::mem::offset_of!(DVLB_s, DVLE) - 20usize];
23095};
23096impl Default for DVLB_s {
23097 fn default() -> Self {
23098 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
23099 unsafe {
23100 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
23101 s.assume_init()
23102 }
23103 }
23104}
23105unsafe extern "C" {
23106 #[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."]
23107 pub fn DVLB_ParseFile(shbinData: *mut u32_, shbinSize: u32_) -> *mut DVLB_s;
23108}
23109unsafe extern "C" {
23110 #[doc = "Frees shader binary data.\n # Arguments\n\n* `dvlb` - DVLB to free."]
23111 pub fn DVLB_Free(dvlb: *mut DVLB_s);
23112}
23113unsafe extern "C" {
23114 #[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."]
23115 pub fn DVLE_GetUniformRegister(dvle: *mut DVLE_s, name: *const ::libc::c_char) -> s8;
23116}
23117unsafe extern "C" {
23118 #[doc = "Generates a shader output map.\n # Arguments\n\n* `dvle` - Shader to generate an output map for."]
23119 pub fn DVLE_GenerateOutmap(dvle: *mut DVLE_s);
23120}
23121#[doc = "24-bit float uniforms."]
23122#[repr(C)]
23123#[derive(Debug, Default, Copy, Clone)]
23124pub struct float24Uniform_s {
23125 #[doc = "< Uniform ID."]
23126 pub id: u32_,
23127 #[doc = "< Uniform data."]
23128 pub data: [u32_; 3usize],
23129}
23130#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23131const _: () = {
23132 ["Size of float24Uniform_s"][::core::mem::size_of::<float24Uniform_s>() - 16usize];
23133 ["Alignment of float24Uniform_s"][::core::mem::align_of::<float24Uniform_s>() - 4usize];
23134 ["Offset of field: float24Uniform_s::id"]
23135 [::core::mem::offset_of!(float24Uniform_s, id) - 0usize];
23136 ["Offset of field: float24Uniform_s::data"]
23137 [::core::mem::offset_of!(float24Uniform_s, data) - 4usize];
23138};
23139#[doc = "Describes an instance of either a vertex or geometry shader."]
23140#[repr(C)]
23141#[derive(Debug, Copy, Clone)]
23142pub struct shaderInstance_s {
23143 #[doc = "< Shader DVLE."]
23144 pub dvle: *mut DVLE_s,
23145 #[doc = "< Boolean uniforms."]
23146 pub boolUniforms: u16_,
23147 #[doc = "< Used boolean uniform mask."]
23148 pub boolUniformMask: u16_,
23149 #[doc = "< Integer uniforms."]
23150 pub intUniforms: [u32_; 4usize],
23151 #[doc = "< 24-bit float uniforms."]
23152 pub float24Uniforms: *mut float24Uniform_s,
23153 #[doc = "< Used integer uniform mask."]
23154 pub intUniformMask: u8_,
23155 #[doc = "< Float uniform count."]
23156 pub numFloat24Uniforms: u8_,
23157}
23158#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23159const _: () = {
23160 ["Size of shaderInstance_s"][::core::mem::size_of::<shaderInstance_s>() - 32usize];
23161 ["Alignment of shaderInstance_s"][::core::mem::align_of::<shaderInstance_s>() - 4usize];
23162 ["Offset of field: shaderInstance_s::dvle"]
23163 [::core::mem::offset_of!(shaderInstance_s, dvle) - 0usize];
23164 ["Offset of field: shaderInstance_s::boolUniforms"]
23165 [::core::mem::offset_of!(shaderInstance_s, boolUniforms) - 4usize];
23166 ["Offset of field: shaderInstance_s::boolUniformMask"]
23167 [::core::mem::offset_of!(shaderInstance_s, boolUniformMask) - 6usize];
23168 ["Offset of field: shaderInstance_s::intUniforms"]
23169 [::core::mem::offset_of!(shaderInstance_s, intUniforms) - 8usize];
23170 ["Offset of field: shaderInstance_s::float24Uniforms"]
23171 [::core::mem::offset_of!(shaderInstance_s, float24Uniforms) - 24usize];
23172 ["Offset of field: shaderInstance_s::intUniformMask"]
23173 [::core::mem::offset_of!(shaderInstance_s, intUniformMask) - 28usize];
23174 ["Offset of field: shaderInstance_s::numFloat24Uniforms"]
23175 [::core::mem::offset_of!(shaderInstance_s, numFloat24Uniforms) - 29usize];
23176};
23177impl Default for shaderInstance_s {
23178 fn default() -> Self {
23179 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
23180 unsafe {
23181 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
23182 s.assume_init()
23183 }
23184 }
23185}
23186#[doc = "Describes an instance of a full shader program."]
23187#[repr(C)]
23188#[derive(Debug, Copy, Clone)]
23189pub struct shaderProgram_s {
23190 #[doc = "< Vertex shader."]
23191 pub vertexShader: *mut shaderInstance_s,
23192 #[doc = "< Geometry shader."]
23193 pub geometryShader: *mut shaderInstance_s,
23194 #[doc = "< Geometry shader input permutation."]
23195 pub geoShaderInputPermutation: [u32_; 2usize],
23196 #[doc = "< Geometry shader input stride."]
23197 pub geoShaderInputStride: u8_,
23198}
23199#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23200const _: () = {
23201 ["Size of shaderProgram_s"][::core::mem::size_of::<shaderProgram_s>() - 20usize];
23202 ["Alignment of shaderProgram_s"][::core::mem::align_of::<shaderProgram_s>() - 4usize];
23203 ["Offset of field: shaderProgram_s::vertexShader"]
23204 [::core::mem::offset_of!(shaderProgram_s, vertexShader) - 0usize];
23205 ["Offset of field: shaderProgram_s::geometryShader"]
23206 [::core::mem::offset_of!(shaderProgram_s, geometryShader) - 4usize];
23207 ["Offset of field: shaderProgram_s::geoShaderInputPermutation"]
23208 [::core::mem::offset_of!(shaderProgram_s, geoShaderInputPermutation) - 8usize];
23209 ["Offset of field: shaderProgram_s::geoShaderInputStride"]
23210 [::core::mem::offset_of!(shaderProgram_s, geoShaderInputStride) - 16usize];
23211};
23212impl Default for shaderProgram_s {
23213 fn default() -> Self {
23214 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
23215 unsafe {
23216 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
23217 s.assume_init()
23218 }
23219 }
23220}
23221unsafe extern "C" {
23222 #[must_use]
23223 #[doc = "Initializes a shader instance.\n # Arguments\n\n* `si` - Shader instance to initialize.\n * `dvle` - DVLE to initialize the shader instance with."]
23224 pub fn shaderInstanceInit(si: *mut shaderInstance_s, dvle: *mut DVLE_s) -> Result;
23225}
23226unsafe extern "C" {
23227 #[must_use]
23228 #[doc = "Frees a shader instance.\n # Arguments\n\n* `si` - Shader instance to free."]
23229 pub fn shaderInstanceFree(si: *mut shaderInstance_s) -> Result;
23230}
23231unsafe extern "C" {
23232 #[must_use]
23233 #[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."]
23234 pub fn shaderInstanceSetBool(
23235 si: *mut shaderInstance_s,
23236 id: ::libc::c_int,
23237 value: bool,
23238 ) -> Result;
23239}
23240unsafe extern "C" {
23241 #[must_use]
23242 #[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."]
23243 pub fn shaderInstanceGetBool(
23244 si: *mut shaderInstance_s,
23245 id: ::libc::c_int,
23246 value: *mut bool,
23247 ) -> Result;
23248}
23249unsafe extern "C" {
23250 #[doc = "Gets the location of a shader's uniform.\n # Arguments\n\n* `si` - Shader instance to use.\n * `name` - Name of the uniform."]
23251 pub fn shaderInstanceGetUniformLocation(
23252 si: *mut shaderInstance_s,
23253 name: *const ::libc::c_char,
23254 ) -> s8;
23255}
23256unsafe extern "C" {
23257 #[must_use]
23258 #[doc = "Initializes a shader program.\n # Arguments\n\n* `sp` - Shader program to initialize."]
23259 pub fn shaderProgramInit(sp: *mut shaderProgram_s) -> Result;
23260}
23261unsafe extern "C" {
23262 #[must_use]
23263 #[doc = "Frees a shader program.\n # Arguments\n\n* `sp` - Shader program to free."]
23264 pub fn shaderProgramFree(sp: *mut shaderProgram_s) -> Result;
23265}
23266unsafe extern "C" {
23267 #[must_use]
23268 #[doc = "Sets the vertex shader of a shader program.\n # Arguments\n\n* `sp` - Shader program to use.\n * `dvle` - Vertex shader to set."]
23269 pub fn shaderProgramSetVsh(sp: *mut shaderProgram_s, dvle: *mut DVLE_s) -> Result;
23270}
23271unsafe extern "C" {
23272 #[must_use]
23273 #[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)."]
23274 pub fn shaderProgramSetGsh(sp: *mut shaderProgram_s, dvle: *mut DVLE_s, stride: u8_) -> Result;
23275}
23276unsafe extern "C" {
23277 #[must_use]
23278 #[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."]
23279 pub fn shaderProgramSetGshInputPermutation(
23280 sp: *mut shaderProgram_s,
23281 permutation: u64_,
23282 ) -> Result;
23283}
23284unsafe extern "C" {
23285 #[must_use]
23286 #[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."]
23287 pub fn shaderProgramConfigure(
23288 sp: *mut shaderProgram_s,
23289 sendVshCode: bool,
23290 sendGshCode: bool,
23291 ) -> Result;
23292}
23293unsafe extern "C" {
23294 #[must_use]
23295 #[doc = "Same as shaderProgramConfigure, but always loading code/operand descriptors and uploading DVLE constants afterwards.\n # Arguments\n\n* `sp` - Shader program to use."]
23296 pub fn shaderProgramUse(sp: *mut shaderProgram_s) -> Result;
23297}
23298#[doc = "< Mono sound"]
23299pub const NDSP_OUTPUT_MONO: ndspOutputMode = 0;
23300#[doc = "< Stereo sound"]
23301pub const NDSP_OUTPUT_STEREO: ndspOutputMode = 1;
23302#[doc = "< 3D Surround sound"]
23303pub const NDSP_OUTPUT_SURROUND: ndspOutputMode = 2;
23304#[doc = "Data types\n# Sound output modes."]
23305pub type ndspOutputMode = ::libc::c_uchar;
23306#[doc = "< \"Normal\" clipping mode (?)"]
23307pub const NDSP_CLIP_NORMAL: ndspClippingMode = 0;
23308#[doc = "< \"Soft\" clipping mode (?)"]
23309pub const NDSP_CLIP_SOFT: ndspClippingMode = 1;
23310pub type ndspClippingMode = ::libc::c_uchar;
23311#[doc = "<?"]
23312pub const NDSP_SPKPOS_SQUARE: ndspSpeakerPos = 0;
23313#[doc = "<?"]
23314pub const NDSP_SPKPOS_WIDE: ndspSpeakerPos = 1;
23315#[doc = "<?"]
23316pub const NDSP_SPKPOS_NUM: ndspSpeakerPos = 2;
23317pub type ndspSpeakerPos = ::libc::c_uchar;
23318#[doc = "ADPCM data."]
23319#[repr(C)]
23320#[derive(Debug, Default, Copy, Clone)]
23321pub struct ndspAdpcmData {
23322 #[doc = "< Current predictor index"]
23323 pub index: u16_,
23324 #[doc = "< Last outputted PCM16 sample."]
23325 pub history0: s16,
23326 #[doc = "< Second to last outputted PCM16 sample."]
23327 pub history1: s16,
23328}
23329#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23330const _: () = {
23331 ["Size of ndspAdpcmData"][::core::mem::size_of::<ndspAdpcmData>() - 6usize];
23332 ["Alignment of ndspAdpcmData"][::core::mem::align_of::<ndspAdpcmData>() - 2usize];
23333 ["Offset of field: ndspAdpcmData::index"]
23334 [::core::mem::offset_of!(ndspAdpcmData, index) - 0usize];
23335 ["Offset of field: ndspAdpcmData::history0"]
23336 [::core::mem::offset_of!(ndspAdpcmData, history0) - 2usize];
23337 ["Offset of field: ndspAdpcmData::history1"]
23338 [::core::mem::offset_of!(ndspAdpcmData, history1) - 4usize];
23339};
23340#[doc = "Wave buffer type."]
23341pub type ndspWaveBuf = tag_ndspWaveBuf;
23342#[doc = "< The wave buffer is not queued."]
23343pub const NDSP_WBUF_FREE: _bindgen_ty_30 = 0;
23344#[doc = "< The wave buffer is queued and has not been played yet."]
23345pub const NDSP_WBUF_QUEUED: _bindgen_ty_30 = 1;
23346#[doc = "< The wave buffer is playing right now."]
23347pub const NDSP_WBUF_PLAYING: _bindgen_ty_30 = 2;
23348#[doc = "< The wave buffer has finished being played."]
23349pub const NDSP_WBUF_DONE: _bindgen_ty_30 = 3;
23350#[doc = "Wave buffer status."]
23351pub type _bindgen_ty_30 = ::libc::c_uchar;
23352#[doc = "Wave buffer struct."]
23353#[repr(C)]
23354#[derive(Copy, Clone)]
23355pub struct tag_ndspWaveBuf {
23356 pub __bindgen_anon_1: tag_ndspWaveBuf__bindgen_ty_1,
23357 #[doc = "< Total number of samples (PCM8=bytes, PCM16=halfwords, DSPADPCM=nibbles without frame headers)"]
23358 pub nsamples: u32_,
23359 #[doc = "< ADPCM data."]
23360 pub adpcm_data: *mut ndspAdpcmData,
23361 #[doc = "< Buffer offset. Only used for capture."]
23362 pub offset: u32_,
23363 #[doc = "< Whether to loop the buffer."]
23364 pub looping: bool,
23365 #[doc = "< Queuing/playback status."]
23366 pub status: u8_,
23367 #[doc = "< Sequence ID. Assigned automatically by ndspChnWaveBufAdd."]
23368 pub sequence_id: u16_,
23369 #[doc = "< Next buffer to play. Used internally, do not modify."]
23370 pub next: *mut ndspWaveBuf,
23371}
23372#[repr(C)]
23373#[derive(Copy, Clone)]
23374pub union tag_ndspWaveBuf__bindgen_ty_1 {
23375 #[doc = "< Pointer to PCM8 sample data."]
23376 pub data_pcm8: *mut s8,
23377 #[doc = "< Pointer to PCM16 sample data."]
23378 pub data_pcm16: *mut s16,
23379 #[doc = "< Pointer to DSPADPCM sample data."]
23380 pub data_adpcm: *mut u8_,
23381 #[doc = "< Data virtual address."]
23382 pub data_vaddr: *const ::libc::c_void,
23383}
23384#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23385const _: () = {
23386 ["Size of tag_ndspWaveBuf__bindgen_ty_1"]
23387 [::core::mem::size_of::<tag_ndspWaveBuf__bindgen_ty_1>() - 4usize];
23388 ["Alignment of tag_ndspWaveBuf__bindgen_ty_1"]
23389 [::core::mem::align_of::<tag_ndspWaveBuf__bindgen_ty_1>() - 4usize];
23390 ["Offset of field: tag_ndspWaveBuf__bindgen_ty_1::data_pcm8"]
23391 [::core::mem::offset_of!(tag_ndspWaveBuf__bindgen_ty_1, data_pcm8) - 0usize];
23392 ["Offset of field: tag_ndspWaveBuf__bindgen_ty_1::data_pcm16"]
23393 [::core::mem::offset_of!(tag_ndspWaveBuf__bindgen_ty_1, data_pcm16) - 0usize];
23394 ["Offset of field: tag_ndspWaveBuf__bindgen_ty_1::data_adpcm"]
23395 [::core::mem::offset_of!(tag_ndspWaveBuf__bindgen_ty_1, data_adpcm) - 0usize];
23396 ["Offset of field: tag_ndspWaveBuf__bindgen_ty_1::data_vaddr"]
23397 [::core::mem::offset_of!(tag_ndspWaveBuf__bindgen_ty_1, data_vaddr) - 0usize];
23398};
23399impl Default for tag_ndspWaveBuf__bindgen_ty_1 {
23400 fn default() -> Self {
23401 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
23402 unsafe {
23403 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
23404 s.assume_init()
23405 }
23406 }
23407}
23408#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23409const _: () = {
23410 ["Size of tag_ndspWaveBuf"][::core::mem::size_of::<tag_ndspWaveBuf>() - 24usize];
23411 ["Alignment of tag_ndspWaveBuf"][::core::mem::align_of::<tag_ndspWaveBuf>() - 4usize];
23412 ["Offset of field: tag_ndspWaveBuf::nsamples"]
23413 [::core::mem::offset_of!(tag_ndspWaveBuf, nsamples) - 4usize];
23414 ["Offset of field: tag_ndspWaveBuf::adpcm_data"]
23415 [::core::mem::offset_of!(tag_ndspWaveBuf, adpcm_data) - 8usize];
23416 ["Offset of field: tag_ndspWaveBuf::offset"]
23417 [::core::mem::offset_of!(tag_ndspWaveBuf, offset) - 12usize];
23418 ["Offset of field: tag_ndspWaveBuf::looping"]
23419 [::core::mem::offset_of!(tag_ndspWaveBuf, looping) - 16usize];
23420 ["Offset of field: tag_ndspWaveBuf::status"]
23421 [::core::mem::offset_of!(tag_ndspWaveBuf, status) - 17usize];
23422 ["Offset of field: tag_ndspWaveBuf::sequence_id"]
23423 [::core::mem::offset_of!(tag_ndspWaveBuf, sequence_id) - 18usize];
23424 ["Offset of field: tag_ndspWaveBuf::next"]
23425 [::core::mem::offset_of!(tag_ndspWaveBuf, next) - 20usize];
23426};
23427impl Default for tag_ndspWaveBuf {
23428 fn default() -> Self {
23429 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
23430 unsafe {
23431 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
23432 s.assume_init()
23433 }
23434 }
23435}
23436#[doc = "Sound frame callback function. (data = User provided data)"]
23437pub type ndspCallback = ::core::option::Option<unsafe extern "C" fn(data: *mut ::libc::c_void)>;
23438#[doc = "Auxiliary output callback function. (data = User provided data, nsamples = Number of samples, samples = Sample data)"]
23439pub type ndspAuxCallback = ::core::option::Option<
23440 unsafe extern "C" fn(
23441 data: *mut ::libc::c_void,
23442 nsamples: ::libc::c_int,
23443 samples: *mut *mut ::libc::c_void,
23444 ),
23445>;
23446unsafe extern "C" {
23447 #[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/"]
23448 pub fn ndspUseComponent(
23449 binary: *const ::libc::c_void,
23450 size: u32_,
23451 progMask: u16_,
23452 dataMask: u16_,
23453 );
23454}
23455unsafe extern "C" {
23456 #[must_use]
23457 #[doc = "Initializes NDSP."]
23458 pub fn ndspInit() -> Result;
23459}
23460unsafe extern "C" {
23461 #[doc = "Exits NDSP."]
23462 pub fn ndspExit();
23463}
23464unsafe extern "C" {
23465 #[doc = "Gets the number of dropped sound frames.\n # Returns\n\nThe number of dropped sound frames."]
23466 pub fn ndspGetDroppedFrames() -> u32_;
23467}
23468unsafe extern "C" {
23469 #[doc = "Gets the total sound frame count.\n # Returns\n\nThe total sound frame count."]
23470 pub fn ndspGetFrameCount() -> u32_;
23471}
23472unsafe extern "C" {
23473 #[doc = "General parameters\n# *\n* Sets the master volume.\n # Arguments\n\n* `volume` - Volume to set. Defaults to 1.0f.\n/"]
23474 pub fn ndspSetMasterVol(volume: f32);
23475}
23476unsafe extern "C" {
23477 #[doc = "Gets the master volume.\n # Returns\n\nThe master volume."]
23478 pub fn ndspGetMasterVol() -> f32;
23479}
23480unsafe extern "C" {
23481 #[doc = "Sets the output mode.\n # Arguments\n\n* `mode` - Output mode to set. Defaults to NDSP_OUTPUT_STEREO."]
23482 pub fn ndspSetOutputMode(mode: ndspOutputMode);
23483}
23484unsafe extern "C" {
23485 #[doc = "Gets the output mode.\n # Returns\n\nThe output mode."]
23486 pub fn ndspGetOutputMode() -> ndspOutputMode;
23487}
23488unsafe extern "C" {
23489 #[doc = "Sets the clipping mode.\n # Arguments\n\n* `mode` - Clipping mode to set. Defaults to NDSP_CLIP_SOFT."]
23490 pub fn ndspSetClippingMode(mode: ndspClippingMode);
23491}
23492unsafe extern "C" {
23493 #[doc = "Gets the clipping mode.\n # Returns\n\nThe clipping mode."]
23494 pub fn ndspGetClippingMode() -> ndspClippingMode;
23495}
23496unsafe extern "C" {
23497 #[doc = "Sets the output count.\n # Arguments\n\n* `count` - Output count to set. Defaults to 2."]
23498 pub fn ndspSetOutputCount(count: ::libc::c_int);
23499}
23500unsafe extern "C" {
23501 #[doc = "Gets the output count.\n # Returns\n\nThe output count."]
23502 pub fn ndspGetOutputCount() -> ::libc::c_int;
23503}
23504unsafe extern "C" {
23505 #[doc = "Sets the wave buffer to capture audio to.\n # Arguments\n\n* `capture` - Wave buffer to capture to."]
23506 pub fn ndspSetCapture(capture: *mut ndspWaveBuf);
23507}
23508unsafe extern "C" {
23509 #[doc = "Sets the sound frame callback.\n # Arguments\n\n* `callback` - Callback to set.\n * `data` - User-defined data to pass to the callback."]
23510 pub fn ndspSetCallback(callback: ndspCallback, data: *mut ::libc::c_void);
23511}
23512unsafe extern "C" {
23513 #[doc = "Surround\n# *\n* Sets the surround sound depth.\n # Arguments\n\n* `depth` - Depth to set. Defaults to 0x7FFF.\n/"]
23514 pub fn ndspSurroundSetDepth(depth: u16_);
23515}
23516unsafe extern "C" {
23517 #[doc = "Gets the surround sound depth.\n # Returns\n\nThe surround sound depth."]
23518 pub fn ndspSurroundGetDepth() -> u16_;
23519}
23520unsafe extern "C" {
23521 #[doc = "Sets the surround sound position.\n # Arguments\n\n* `pos` - Position to set. Defaults to NDSP_SPKPOS_SQUARE."]
23522 pub fn ndspSurroundSetPos(pos: ndspSpeakerPos);
23523}
23524unsafe extern "C" {
23525 #[doc = "Gets the surround sound position.\n # Returns\n\nThe surround sound speaker position."]
23526 pub fn ndspSurroundGetPos() -> ndspSpeakerPos;
23527}
23528unsafe extern "C" {
23529 #[doc = "Sets the surround sound rear ratio.\n # Arguments\n\n* `ratio` - Rear ratio to set. Defaults to 0x8000."]
23530 pub fn ndspSurroundSetRearRatio(ratio: u16_);
23531}
23532unsafe extern "C" {
23533 #[doc = "Gets the surround sound rear ratio.\n # Returns\n\nThe rear ratio."]
23534 pub fn ndspSurroundGetRearRatio() -> u16_;
23535}
23536unsafe extern "C" {
23537 #[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/"]
23538 pub fn ndspAuxSetEnable(id: ::libc::c_int, enable: bool);
23539}
23540unsafe extern "C" {
23541 #[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."]
23542 pub fn ndspAuxIsEnabled(id: ::libc::c_int) -> bool;
23543}
23544unsafe extern "C" {
23545 #[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."]
23546 pub fn ndspAuxSetFrontBypass(id: ::libc::c_int, bypass: bool);
23547}
23548unsafe extern "C" {
23549 #[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."]
23550 pub fn ndspAuxGetFrontBypass(id: ::libc::c_int) -> bool;
23551}
23552unsafe extern "C" {
23553 #[doc = "Sets the volume of an auxiliary output.\n # Arguments\n\n* `id` - ID of the auxiliary output.\n * `volume` - Volume to set."]
23554 pub fn ndspAuxSetVolume(id: ::libc::c_int, volume: f32);
23555}
23556unsafe extern "C" {
23557 #[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."]
23558 pub fn ndspAuxGetVolume(id: ::libc::c_int) -> f32;
23559}
23560unsafe extern "C" {
23561 #[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."]
23562 pub fn ndspAuxSetCallback(
23563 id: ::libc::c_int,
23564 callback: ndspAuxCallback,
23565 data: *mut ::libc::c_void,
23566 );
23567}
23568#[doc = "< PCM8"]
23569pub const NDSP_ENCODING_PCM8: _bindgen_ty_31 = 0;
23570#[doc = "< PCM16"]
23571pub const NDSP_ENCODING_PCM16: _bindgen_ty_31 = 1;
23572#[doc = "< DSPADPCM (GameCube format)"]
23573pub const NDSP_ENCODING_ADPCM: _bindgen_ty_31 = 2;
23574#[doc = "Data types\n# Supported sample encodings."]
23575pub type _bindgen_ty_31 = ::libc::c_uchar;
23576#[doc = "< Buffer contains Mono PCM8."]
23577pub const NDSP_FORMAT_MONO_PCM8: _bindgen_ty_32 = 1;
23578#[doc = "< Buffer contains Mono PCM16."]
23579pub const NDSP_FORMAT_MONO_PCM16: _bindgen_ty_32 = 5;
23580#[doc = "< Buffer contains Mono ADPCM."]
23581pub const NDSP_FORMAT_MONO_ADPCM: _bindgen_ty_32 = 9;
23582#[doc = "< Buffer contains Stereo PCM8."]
23583pub const NDSP_FORMAT_STEREO_PCM8: _bindgen_ty_32 = 2;
23584#[doc = "< Buffer contains Stereo PCM16."]
23585pub const NDSP_FORMAT_STEREO_PCM16: _bindgen_ty_32 = 6;
23586#[doc = "< (Alias) Buffer contains Mono PCM8."]
23587pub const NDSP_FORMAT_PCM8: _bindgen_ty_32 = 1;
23588#[doc = "< (Alias) Buffer contains Mono PCM16."]
23589pub const NDSP_FORMAT_PCM16: _bindgen_ty_32 = 5;
23590#[doc = "< (Alias) Buffer contains Mono ADPCM."]
23591pub const NDSP_FORMAT_ADPCM: _bindgen_ty_32 = 9;
23592#[doc = "< Front bypass."]
23593pub const NDSP_FRONT_BYPASS: _bindgen_ty_32 = 16;
23594#[doc = "< (?) Unknown, under research"]
23595pub const NDSP_3D_SURROUND_PREPROCESSED: _bindgen_ty_32 = 64;
23596#[doc = "Channel format flags for use with ndspChnSetFormat."]
23597pub type _bindgen_ty_32 = ::libc::c_uchar;
23598#[doc = "< Polyphase interpolation"]
23599pub const NDSP_INTERP_POLYPHASE: ndspInterpType = 0;
23600#[doc = "< Linear interpolation"]
23601pub const NDSP_INTERP_LINEAR: ndspInterpType = 1;
23602#[doc = "< No interpolation"]
23603pub const NDSP_INTERP_NONE: ndspInterpType = 2;
23604#[doc = "Interpolation types."]
23605pub type ndspInterpType = ::libc::c_uchar;
23606unsafe extern "C" {
23607 #[doc = "Basic channel operation\n# *\n* Resets a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23).\n/"]
23608 pub fn ndspChnReset(id: ::libc::c_int);
23609}
23610unsafe extern "C" {
23611 #[doc = "Initializes the parameters of a channel.\n # Arguments\n\n* `id` - ID of the channel (0..23)."]
23612 pub fn ndspChnInitParams(id: ::libc::c_int);
23613}
23614unsafe extern "C" {
23615 #[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."]
23616 pub fn ndspChnIsPlaying(id: ::libc::c_int) -> bool;
23617}
23618unsafe extern "C" {
23619 #[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."]
23620 pub fn ndspChnGetSamplePos(id: ::libc::c_int) -> u32_;
23621}
23622unsafe extern "C" {
23623 #[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."]
23624 pub fn ndspChnGetWaveBufSeq(id: ::libc::c_int) -> u16_;
23625}
23626unsafe extern "C" {
23627 #[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."]
23628 pub fn ndspChnIsPaused(id: ::libc::c_int) -> bool;
23629}
23630unsafe extern "C" {
23631 #[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)."]
23632 pub fn ndspChnSetPaused(id: ::libc::c_int, paused: bool);
23633}
23634unsafe extern "C" {
23635 #[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/"]
23636 pub fn ndspChnSetFormat(id: ::libc::c_int, format: u16_);
23637}
23638unsafe extern "C" {
23639 #[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."]
23640 pub fn ndspChnGetFormat(id: ::libc::c_int) -> u16_;
23641}
23642unsafe extern "C" {
23643 #[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."]
23644 pub fn ndspChnSetInterp(id: ::libc::c_int, type_: ndspInterpType);
23645}
23646unsafe extern "C" {
23647 #[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."]
23648 pub fn ndspChnGetInterp(id: ::libc::c_int) -> ndspInterpType;
23649}
23650unsafe extern "C" {
23651 #[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."]
23652 pub fn ndspChnSetRate(id: ::libc::c_int, rate: f32);
23653}
23654unsafe extern "C" {
23655 #[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."]
23656 pub fn ndspChnGetRate(id: ::libc::c_int) -> f32;
23657}
23658unsafe extern "C" {
23659 #[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."]
23660 pub fn ndspChnSetMix(id: ::libc::c_int, mix: *mut f32);
23661}
23662unsafe extern "C" {
23663 #[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."]
23664 pub fn ndspChnGetMix(id: ::libc::c_int, mix: *mut f32);
23665}
23666unsafe extern "C" {
23667 #[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."]
23668 pub fn ndspChnSetAdpcmCoefs(id: ::libc::c_int, coefs: *mut u16_);
23669}
23670unsafe extern "C" {
23671 #[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/"]
23672 pub fn ndspChnWaveBufClear(id: ::libc::c_int);
23673}
23674unsafe extern "C" {
23675 #[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."]
23676 pub fn ndspChnWaveBufAdd(id: ::libc::c_int, buf: *mut ndspWaveBuf);
23677}
23678unsafe extern "C" {
23679 #[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/"]
23680 pub fn ndspChnIirMonoSetEnable(id: ::libc::c_int, enable: bool);
23681}
23682unsafe extern "C" {
23683 #[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."]
23684 pub fn ndspChnIirMonoSetParamsCustomFilter(
23685 id: ::libc::c_int,
23686 a0: f32,
23687 a1: f32,
23688 b0: f32,
23689 ) -> bool;
23690}
23691unsafe extern "C" {
23692 #[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."]
23693 pub fn ndspChnIirMonoSetParamsLowPassFilter(id: ::libc::c_int, f0: f32) -> bool;
23694}
23695unsafe extern "C" {
23696 #[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."]
23697 pub fn ndspChnIirMonoSetParamsHighPassFilter(id: ::libc::c_int, f0: f32) -> bool;
23698}
23699unsafe extern "C" {
23700 #[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."]
23701 pub fn ndspChnIirBiquadSetEnable(id: ::libc::c_int, enable: bool);
23702}
23703unsafe extern "C" {
23704 #[doc = "Manually sets up the parameters of the biquad filter\n # Arguments\n\n* `id` - ID of the channel (0..23)."]
23705 pub fn ndspChnIirBiquadSetParamsCustomFilter(
23706 id: ::libc::c_int,
23707 a0: f32,
23708 a1: f32,
23709 a2: f32,
23710 b0: f32,
23711 b1: f32,
23712 b2: f32,
23713 ) -> bool;
23714}
23715unsafe extern "C" {
23716 #[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)."]
23717 pub fn ndspChnIirBiquadSetParamsLowPassFilter(id: ::libc::c_int, f0: f32, Q: f32) -> bool;
23718}
23719unsafe extern "C" {
23720 #[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)."]
23721 pub fn ndspChnIirBiquadSetParamsHighPassFilter(id: ::libc::c_int, f0: f32, Q: f32) -> bool;
23722}
23723unsafe extern "C" {
23724 #[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)."]
23725 pub fn ndspChnIirBiquadSetParamsBandPassFilter(id: ::libc::c_int, f0: f32, Q: f32) -> bool;
23726}
23727unsafe extern "C" {
23728 #[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)."]
23729 pub fn ndspChnIirBiquadSetParamsNotchFilter(id: ::libc::c_int, f0: f32, Q: f32) -> bool;
23730}
23731unsafe extern "C" {
23732 #[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)"]
23733 pub fn ndspChnIirBiquadSetParamsPeakingEqualizer(
23734 id: ::libc::c_int,
23735 f0: f32,
23736 Q: f32,
23737 gain: f32,
23738 ) -> bool;
23739}
23740#[doc = "< Normal keyboard with several pages (QWERTY/accents/symbol/mobile)"]
23741pub const SWKBD_TYPE_NORMAL: SwkbdType = 0;
23742#[doc = "< QWERTY keyboard only."]
23743pub const SWKBD_TYPE_QWERTY: SwkbdType = 1;
23744#[doc = "< Number pad."]
23745pub const SWKBD_TYPE_NUMPAD: SwkbdType = 2;
23746#[doc = "< On JPN systems, a text keyboard without Japanese input capabilities, otherwise same as SWKBD_TYPE_NORMAL."]
23747pub const SWKBD_TYPE_WESTERN: SwkbdType = 3;
23748#[doc = "Keyboard types."]
23749pub type SwkbdType = ::libc::c_uchar;
23750#[doc = "< All inputs are accepted."]
23751pub const SWKBD_ANYTHING: SwkbdValidInput = 0;
23752#[doc = "< Empty inputs are not accepted."]
23753pub const SWKBD_NOTEMPTY: SwkbdValidInput = 1;
23754#[doc = "< Empty or blank inputs (consisting solely of whitespace) are not accepted."]
23755pub const SWKBD_NOTEMPTY_NOTBLANK: SwkbdValidInput = 2;
23756pub const SWKBD_NOTBLANK_NOTEMPTY: SwkbdValidInput = 2;
23757#[doc = "< Blank inputs (consisting solely of whitespace) are not accepted, but empty inputs are."]
23758pub const SWKBD_NOTBLANK: SwkbdValidInput = 3;
23759#[doc = "< The input must have a fixed length (specified by maxTextLength in swkbdInit)."]
23760pub const SWKBD_FIXEDLEN: SwkbdValidInput = 4;
23761#[doc = "Accepted input types."]
23762pub type SwkbdValidInput = ::libc::c_uchar;
23763#[doc = "< Left button (usually Cancel)"]
23764pub const SWKBD_BUTTON_LEFT: SwkbdButton = 0;
23765#[doc = "< Middle button (usually I Forgot)"]
23766pub const SWKBD_BUTTON_MIDDLE: SwkbdButton = 1;
23767#[doc = "< Right button (usually OK)"]
23768pub const SWKBD_BUTTON_RIGHT: SwkbdButton = 2;
23769pub const SWKBD_BUTTON_CONFIRM: SwkbdButton = 2;
23770#[doc = "< No button (returned by swkbdInputText in special cases)"]
23771pub const SWKBD_BUTTON_NONE: SwkbdButton = 3;
23772#[doc = "Keyboard dialog buttons."]
23773pub type SwkbdButton = ::libc::c_uchar;
23774#[doc = "< Characters are not concealed."]
23775pub const SWKBD_PASSWORD_NONE: SwkbdPasswordMode = 0;
23776#[doc = "< Characters are concealed immediately."]
23777pub const SWKBD_PASSWORD_HIDE: SwkbdPasswordMode = 1;
23778#[doc = "< Characters are concealed a second after they've been typed."]
23779pub const SWKBD_PASSWORD_HIDE_DELAY: SwkbdPasswordMode = 2;
23780#[doc = "Keyboard password modes."]
23781pub type SwkbdPasswordMode = ::libc::c_uchar;
23782#[doc = "< Disallow the use of more than a certain number of digits (0 or more)"]
23783pub const SWKBD_FILTER_DIGITS: _bindgen_ty_33 = 1;
23784#[doc = "< Disallow the use of the sign."]
23785pub const SWKBD_FILTER_AT: _bindgen_ty_33 = 2;
23786#[doc = "< Disallow the use of the % sign."]
23787pub const SWKBD_FILTER_PERCENT: _bindgen_ty_33 = 4;
23788#[doc = "< Disallow the use of the sign."]
23789pub const SWKBD_FILTER_BACKSLASH: _bindgen_ty_33 = 8;
23790#[doc = "< Disallow profanity using Nintendo's profanity filter."]
23791pub const SWKBD_FILTER_PROFANITY: _bindgen_ty_33 = 16;
23792#[doc = "< Use a callback in order to check the input."]
23793pub const SWKBD_FILTER_CALLBACK: _bindgen_ty_33 = 32;
23794#[doc = "Keyboard input filtering flags."]
23795pub type _bindgen_ty_33 = ::libc::c_uchar;
23796#[doc = "< Parental PIN mode."]
23797pub const SWKBD_PARENTAL: _bindgen_ty_34 = 1;
23798#[doc = "< Darken the top screen when the keyboard is shown."]
23799pub const SWKBD_DARKEN_TOP_SCREEN: _bindgen_ty_34 = 2;
23800#[doc = "< Enable predictive input (necessary for Kanji input in JPN systems)."]
23801pub const SWKBD_PREDICTIVE_INPUT: _bindgen_ty_34 = 4;
23802#[doc = "< Enable multiline input."]
23803pub const SWKBD_MULTILINE: _bindgen_ty_34 = 8;
23804#[doc = "< Enable fixed-width mode."]
23805pub const SWKBD_FIXED_WIDTH: _bindgen_ty_34 = 16;
23806#[doc = "< Allow the usage of the HOME button."]
23807pub const SWKBD_ALLOW_HOME: _bindgen_ty_34 = 32;
23808#[doc = "< Allow the usage of a software-reset combination."]
23809pub const SWKBD_ALLOW_RESET: _bindgen_ty_34 = 64;
23810#[doc = "< Allow the usage of the POWER button."]
23811pub const SWKBD_ALLOW_POWER: _bindgen_ty_34 = 128;
23812#[doc = "< Default to the QWERTY page when the keyboard is shown."]
23813pub const SWKBD_DEFAULT_QWERTY: _bindgen_ty_34 = 512;
23814#[doc = "Keyboard features."]
23815pub type _bindgen_ty_34 = ::libc::c_ushort;
23816#[doc = "< Specifies that the input is valid."]
23817pub const SWKBD_CALLBACK_OK: SwkbdCallbackResult = 0;
23818#[doc = "< Displays an error message, then closes the keyboard."]
23819pub const SWKBD_CALLBACK_CLOSE: SwkbdCallbackResult = 1;
23820#[doc = "< Displays an error message and continues displaying the keyboard."]
23821pub const SWKBD_CALLBACK_CONTINUE: SwkbdCallbackResult = 2;
23822#[doc = "Keyboard filter callback return values."]
23823pub type SwkbdCallbackResult = ::libc::c_uchar;
23824#[doc = "< Dummy/unused."]
23825pub const SWKBD_NONE: SwkbdResult = -1;
23826#[doc = "< Invalid parameters to swkbd."]
23827pub const SWKBD_INVALID_INPUT: SwkbdResult = -2;
23828#[doc = "< Out of memory."]
23829pub const SWKBD_OUTOFMEM: SwkbdResult = -3;
23830#[doc = "< The button was clicked in 1-button dialogs."]
23831pub const SWKBD_D0_CLICK: SwkbdResult = 0;
23832#[doc = "< The left button was clicked in 2-button dialogs."]
23833pub const SWKBD_D1_CLICK0: SwkbdResult = 1;
23834#[doc = "< The right button was clicked in 2-button dialogs."]
23835pub const SWKBD_D1_CLICK1: SwkbdResult = 2;
23836#[doc = "< The left button was clicked in 3-button dialogs."]
23837pub const SWKBD_D2_CLICK0: SwkbdResult = 3;
23838#[doc = "< The middle button was clicked in 3-button dialogs."]
23839pub const SWKBD_D2_CLICK1: SwkbdResult = 4;
23840#[doc = "< The right button was clicked in 3-button dialogs."]
23841pub const SWKBD_D2_CLICK2: SwkbdResult = 5;
23842#[doc = "< The HOME button was pressed."]
23843pub const SWKBD_HOMEPRESSED: SwkbdResult = 10;
23844#[doc = "< The soft-reset key combination was pressed."]
23845pub const SWKBD_RESETPRESSED: SwkbdResult = 11;
23846#[doc = "< The POWER button was pressed."]
23847pub const SWKBD_POWERPRESSED: SwkbdResult = 12;
23848#[doc = "< The parental PIN was verified successfully."]
23849pub const SWKBD_PARENTAL_OK: SwkbdResult = 20;
23850#[doc = "< The parental PIN was incorrect."]
23851pub const SWKBD_PARENTAL_FAIL: SwkbdResult = 21;
23852#[doc = "< The filter callback returned SWKBD_CALLBACK_CLOSE."]
23853pub const SWKBD_BANNED_INPUT: SwkbdResult = 30;
23854#[doc = "Keyboard return values."]
23855pub type SwkbdResult = ::libc::c_schar;
23856#[doc = "Keyboard dictionary word for predictive input."]
23857#[repr(C)]
23858#[derive(Debug, Copy, Clone)]
23859pub struct SwkbdDictWord {
23860 #[doc = "< Reading of the word (that is, the string that needs to be typed)."]
23861 pub reading: [u16_; 41usize],
23862 #[doc = "< Spelling of the word."]
23863 pub word: [u16_; 41usize],
23864 #[doc = "< Language the word applies to."]
23865 pub language: u8_,
23866 #[doc = "< Specifies if the word applies to all languages."]
23867 pub all_languages: bool,
23868}
23869#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23870const _: () = {
23871 ["Size of SwkbdDictWord"][::core::mem::size_of::<SwkbdDictWord>() - 166usize];
23872 ["Alignment of SwkbdDictWord"][::core::mem::align_of::<SwkbdDictWord>() - 2usize];
23873 ["Offset of field: SwkbdDictWord::reading"]
23874 [::core::mem::offset_of!(SwkbdDictWord, reading) - 0usize];
23875 ["Offset of field: SwkbdDictWord::word"]
23876 [::core::mem::offset_of!(SwkbdDictWord, word) - 82usize];
23877 ["Offset of field: SwkbdDictWord::language"]
23878 [::core::mem::offset_of!(SwkbdDictWord, language) - 164usize];
23879 ["Offset of field: SwkbdDictWord::all_languages"]
23880 [::core::mem::offset_of!(SwkbdDictWord, all_languages) - 165usize];
23881};
23882impl Default for SwkbdDictWord {
23883 fn default() -> Self {
23884 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
23885 unsafe {
23886 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
23887 s.assume_init()
23888 }
23889 }
23890}
23891#[doc = "Keyboard filter callback function."]
23892pub type SwkbdCallbackFn = ::core::option::Option<
23893 unsafe extern "C" fn(
23894 user: *mut ::libc::c_void,
23895 ppMessage: *mut *const ::libc::c_char,
23896 text: *const ::libc::c_char,
23897 textlen: usize,
23898 ) -> SwkbdCallbackResult,
23899>;
23900#[doc = "Keyboard status data."]
23901#[repr(C)]
23902#[derive(Debug, Default, Copy, Clone)]
23903pub struct SwkbdStatusData {
23904 pub data: [u32_; 17usize],
23905}
23906#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23907const _: () = {
23908 ["Size of SwkbdStatusData"][::core::mem::size_of::<SwkbdStatusData>() - 68usize];
23909 ["Alignment of SwkbdStatusData"][::core::mem::align_of::<SwkbdStatusData>() - 4usize];
23910 ["Offset of field: SwkbdStatusData::data"]
23911 [::core::mem::offset_of!(SwkbdStatusData, data) - 0usize];
23912};
23913#[doc = "Keyboard predictive input learning data."]
23914#[repr(C)]
23915#[derive(Debug, Copy, Clone)]
23916pub struct SwkbdLearningData {
23917 pub data: [u32_; 10523usize],
23918}
23919#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23920const _: () = {
23921 ["Size of SwkbdLearningData"][::core::mem::size_of::<SwkbdLearningData>() - 42092usize];
23922 ["Alignment of SwkbdLearningData"][::core::mem::align_of::<SwkbdLearningData>() - 4usize];
23923 ["Offset of field: SwkbdLearningData::data"]
23924 [::core::mem::offset_of!(SwkbdLearningData, data) - 0usize];
23925};
23926impl Default for SwkbdLearningData {
23927 fn default() -> Self {
23928 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
23929 unsafe {
23930 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
23931 s.assume_init()
23932 }
23933 }
23934}
23935#[doc = "Internal libctru book-keeping structure for software keyboards."]
23936#[repr(C)]
23937#[derive(Debug, Copy, Clone)]
23938pub struct SwkbdExtra {
23939 pub initial_text: *const ::libc::c_char,
23940 pub dict: *const SwkbdDictWord,
23941 pub status_data: *mut SwkbdStatusData,
23942 pub learning_data: *mut SwkbdLearningData,
23943 pub callback: SwkbdCallbackFn,
23944 pub callback_user: *mut ::libc::c_void,
23945}
23946#[allow(clippy::unnecessary_operation, clippy::identity_op)]
23947const _: () = {
23948 ["Size of SwkbdExtra"][::core::mem::size_of::<SwkbdExtra>() - 24usize];
23949 ["Alignment of SwkbdExtra"][::core::mem::align_of::<SwkbdExtra>() - 4usize];
23950 ["Offset of field: SwkbdExtra::initial_text"]
23951 [::core::mem::offset_of!(SwkbdExtra, initial_text) - 0usize];
23952 ["Offset of field: SwkbdExtra::dict"][::core::mem::offset_of!(SwkbdExtra, dict) - 4usize];
23953 ["Offset of field: SwkbdExtra::status_data"]
23954 [::core::mem::offset_of!(SwkbdExtra, status_data) - 8usize];
23955 ["Offset of field: SwkbdExtra::learning_data"]
23956 [::core::mem::offset_of!(SwkbdExtra, learning_data) - 12usize];
23957 ["Offset of field: SwkbdExtra::callback"]
23958 [::core::mem::offset_of!(SwkbdExtra, callback) - 16usize];
23959 ["Offset of field: SwkbdExtra::callback_user"]
23960 [::core::mem::offset_of!(SwkbdExtra, callback_user) - 20usize];
23961};
23962impl Default for SwkbdExtra {
23963 fn default() -> Self {
23964 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
23965 unsafe {
23966 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
23967 s.assume_init()
23968 }
23969 }
23970}
23971#[doc = "Software keyboard parameter structure, it shouldn't be modified directly."]
23972#[repr(C)]
23973#[derive(Copy, Clone)]
23974pub struct SwkbdState {
23975 pub type_: ::libc::c_int,
23976 pub num_buttons_m1: ::libc::c_int,
23977 pub valid_input: ::libc::c_int,
23978 pub password_mode: ::libc::c_int,
23979 pub is_parental_screen: ::libc::c_int,
23980 pub darken_top_screen: ::libc::c_int,
23981 pub filter_flags: u32_,
23982 pub save_state_flags: u32_,
23983 pub max_text_len: u16_,
23984 pub dict_word_count: u16_,
23985 pub max_digits: u16_,
23986 pub button_text: [[u16_; 17usize]; 3usize],
23987 pub numpad_keys: [u16_; 2usize],
23988 pub hint_text: [u16_; 65usize],
23989 pub predictive_input: bool,
23990 pub multiline: bool,
23991 pub fixed_width: bool,
23992 pub allow_home: bool,
23993 pub allow_reset: bool,
23994 pub allow_power: bool,
23995 pub unknown: bool,
23996 pub default_qwerty: bool,
23997 pub button_submits_text: [bool; 4usize],
23998 pub language: u16_,
23999 pub initial_text_offset: ::libc::c_int,
24000 pub dict_offset: ::libc::c_int,
24001 pub initial_status_offset: ::libc::c_int,
24002 pub initial_learning_offset: ::libc::c_int,
24003 pub shared_memory_size: usize,
24004 pub version: u32_,
24005 pub result: SwkbdResult,
24006 pub status_offset: ::libc::c_int,
24007 pub learning_offset: ::libc::c_int,
24008 pub text_offset: ::libc::c_int,
24009 pub text_length: u16_,
24010 pub callback_result: ::libc::c_int,
24011 pub callback_msg: [u16_; 257usize],
24012 pub skip_at_check: bool,
24013 pub __bindgen_anon_1: SwkbdState__bindgen_ty_1,
24014}
24015#[repr(C)]
24016#[derive(Copy, Clone)]
24017pub union SwkbdState__bindgen_ty_1 {
24018 pub reserved: [u8_; 171usize],
24019 pub extra: SwkbdExtra,
24020}
24021#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24022const _: () = {
24023 ["Size of SwkbdState__bindgen_ty_1"]
24024 [::core::mem::size_of::<SwkbdState__bindgen_ty_1>() - 172usize];
24025 ["Alignment of SwkbdState__bindgen_ty_1"]
24026 [::core::mem::align_of::<SwkbdState__bindgen_ty_1>() - 4usize];
24027 ["Offset of field: SwkbdState__bindgen_ty_1::reserved"]
24028 [::core::mem::offset_of!(SwkbdState__bindgen_ty_1, reserved) - 0usize];
24029 ["Offset of field: SwkbdState__bindgen_ty_1::extra"]
24030 [::core::mem::offset_of!(SwkbdState__bindgen_ty_1, extra) - 0usize];
24031};
24032impl Default for SwkbdState__bindgen_ty_1 {
24033 fn default() -> Self {
24034 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
24035 unsafe {
24036 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
24037 s.assume_init()
24038 }
24039 }
24040}
24041#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24042const _: () = {
24043 ["Size of SwkbdState"][::core::mem::size_of::<SwkbdState>() - 1024usize];
24044 ["Alignment of SwkbdState"][::core::mem::align_of::<SwkbdState>() - 4usize];
24045 ["Offset of field: SwkbdState::type_"][::core::mem::offset_of!(SwkbdState, type_) - 0usize];
24046 ["Offset of field: SwkbdState::num_buttons_m1"]
24047 [::core::mem::offset_of!(SwkbdState, num_buttons_m1) - 4usize];
24048 ["Offset of field: SwkbdState::valid_input"]
24049 [::core::mem::offset_of!(SwkbdState, valid_input) - 8usize];
24050 ["Offset of field: SwkbdState::password_mode"]
24051 [::core::mem::offset_of!(SwkbdState, password_mode) - 12usize];
24052 ["Offset of field: SwkbdState::is_parental_screen"]
24053 [::core::mem::offset_of!(SwkbdState, is_parental_screen) - 16usize];
24054 ["Offset of field: SwkbdState::darken_top_screen"]
24055 [::core::mem::offset_of!(SwkbdState, darken_top_screen) - 20usize];
24056 ["Offset of field: SwkbdState::filter_flags"]
24057 [::core::mem::offset_of!(SwkbdState, filter_flags) - 24usize];
24058 ["Offset of field: SwkbdState::save_state_flags"]
24059 [::core::mem::offset_of!(SwkbdState, save_state_flags) - 28usize];
24060 ["Offset of field: SwkbdState::max_text_len"]
24061 [::core::mem::offset_of!(SwkbdState, max_text_len) - 32usize];
24062 ["Offset of field: SwkbdState::dict_word_count"]
24063 [::core::mem::offset_of!(SwkbdState, dict_word_count) - 34usize];
24064 ["Offset of field: SwkbdState::max_digits"]
24065 [::core::mem::offset_of!(SwkbdState, max_digits) - 36usize];
24066 ["Offset of field: SwkbdState::button_text"]
24067 [::core::mem::offset_of!(SwkbdState, button_text) - 38usize];
24068 ["Offset of field: SwkbdState::numpad_keys"]
24069 [::core::mem::offset_of!(SwkbdState, numpad_keys) - 140usize];
24070 ["Offset of field: SwkbdState::hint_text"]
24071 [::core::mem::offset_of!(SwkbdState, hint_text) - 144usize];
24072 ["Offset of field: SwkbdState::predictive_input"]
24073 [::core::mem::offset_of!(SwkbdState, predictive_input) - 274usize];
24074 ["Offset of field: SwkbdState::multiline"]
24075 [::core::mem::offset_of!(SwkbdState, multiline) - 275usize];
24076 ["Offset of field: SwkbdState::fixed_width"]
24077 [::core::mem::offset_of!(SwkbdState, fixed_width) - 276usize];
24078 ["Offset of field: SwkbdState::allow_home"]
24079 [::core::mem::offset_of!(SwkbdState, allow_home) - 277usize];
24080 ["Offset of field: SwkbdState::allow_reset"]
24081 [::core::mem::offset_of!(SwkbdState, allow_reset) - 278usize];
24082 ["Offset of field: SwkbdState::allow_power"]
24083 [::core::mem::offset_of!(SwkbdState, allow_power) - 279usize];
24084 ["Offset of field: SwkbdState::unknown"]
24085 [::core::mem::offset_of!(SwkbdState, unknown) - 280usize];
24086 ["Offset of field: SwkbdState::default_qwerty"]
24087 [::core::mem::offset_of!(SwkbdState, default_qwerty) - 281usize];
24088 ["Offset of field: SwkbdState::button_submits_text"]
24089 [::core::mem::offset_of!(SwkbdState, button_submits_text) - 282usize];
24090 ["Offset of field: SwkbdState::language"]
24091 [::core::mem::offset_of!(SwkbdState, language) - 286usize];
24092 ["Offset of field: SwkbdState::initial_text_offset"]
24093 [::core::mem::offset_of!(SwkbdState, initial_text_offset) - 288usize];
24094 ["Offset of field: SwkbdState::dict_offset"]
24095 [::core::mem::offset_of!(SwkbdState, dict_offset) - 292usize];
24096 ["Offset of field: SwkbdState::initial_status_offset"]
24097 [::core::mem::offset_of!(SwkbdState, initial_status_offset) - 296usize];
24098 ["Offset of field: SwkbdState::initial_learning_offset"]
24099 [::core::mem::offset_of!(SwkbdState, initial_learning_offset) - 300usize];
24100 ["Offset of field: SwkbdState::shared_memory_size"]
24101 [::core::mem::offset_of!(SwkbdState, shared_memory_size) - 304usize];
24102 ["Offset of field: SwkbdState::version"]
24103 [::core::mem::offset_of!(SwkbdState, version) - 308usize];
24104 ["Offset of field: SwkbdState::result"][::core::mem::offset_of!(SwkbdState, result) - 312usize];
24105 ["Offset of field: SwkbdState::status_offset"]
24106 [::core::mem::offset_of!(SwkbdState, status_offset) - 316usize];
24107 ["Offset of field: SwkbdState::learning_offset"]
24108 [::core::mem::offset_of!(SwkbdState, learning_offset) - 320usize];
24109 ["Offset of field: SwkbdState::text_offset"]
24110 [::core::mem::offset_of!(SwkbdState, text_offset) - 324usize];
24111 ["Offset of field: SwkbdState::text_length"]
24112 [::core::mem::offset_of!(SwkbdState, text_length) - 328usize];
24113 ["Offset of field: SwkbdState::callback_result"]
24114 [::core::mem::offset_of!(SwkbdState, callback_result) - 332usize];
24115 ["Offset of field: SwkbdState::callback_msg"]
24116 [::core::mem::offset_of!(SwkbdState, callback_msg) - 336usize];
24117 ["Offset of field: SwkbdState::skip_at_check"]
24118 [::core::mem::offset_of!(SwkbdState, skip_at_check) - 850usize];
24119};
24120impl Default for SwkbdState {
24121 fn default() -> Self {
24122 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
24123 unsafe {
24124 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
24125 s.assume_init()
24126 }
24127 }
24128}
24129unsafe extern "C" {
24130 #[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)."]
24131 pub fn swkbdInit(
24132 swkbd: *mut SwkbdState,
24133 type_: SwkbdType,
24134 numButtons: ::libc::c_int,
24135 maxTextLength: ::libc::c_int,
24136 );
24137}
24138unsafe extern "C" {
24139 #[doc = "Configures password mode in a software keyboard.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `mode` - Password mode."]
24140 #[link_name = "swkbdSetPasswordMode__extern"]
24141 pub fn swkbdSetPasswordMode(swkbd: *mut SwkbdState, mode: SwkbdPasswordMode);
24142}
24143unsafe extern "C" {
24144 #[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)."]
24145 #[link_name = "swkbdSetValidation__extern"]
24146 pub fn swkbdSetValidation(
24147 swkbd: *mut SwkbdState,
24148 validInput: SwkbdValidInput,
24149 filterFlags: u32_,
24150 maxDigits: ::libc::c_int,
24151 );
24152}
24153unsafe extern "C" {
24154 #[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)."]
24155 #[link_name = "swkbdSetNumpadKeys__extern"]
24156 pub fn swkbdSetNumpadKeys(swkbd: *mut SwkbdState, left: ::libc::c_int, right: ::libc::c_int);
24157}
24158unsafe extern "C" {
24159 #[doc = "Specifies which special features are enabled in a software keyboard.\n # Arguments\n\n* `swkbd` - Pointer to swkbd state.\n * `features` - Feature bitmask."]
24160 pub fn swkbdSetFeatures(swkbd: *mut SwkbdState, features: u32_);
24161}
24162unsafe extern "C" {
24163 #[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."]
24164 pub fn swkbdSetHintText(swkbd: *mut SwkbdState, text: *const ::libc::c_char);
24165}
24166unsafe extern "C" {
24167 #[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."]
24168 pub fn swkbdSetButton(
24169 swkbd: *mut SwkbdState,
24170 button: SwkbdButton,
24171 text: *const ::libc::c_char,
24172 submit: bool,
24173 );
24174}
24175unsafe extern "C" {
24176 #[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."]
24177 pub fn swkbdSetInitialText(swkbd: *mut SwkbdState, text: *const ::libc::c_char);
24178}
24179unsafe extern "C" {
24180 #[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."]
24181 pub fn swkbdSetDictWord(
24182 word: *mut SwkbdDictWord,
24183 reading: *const ::libc::c_char,
24184 text: *const ::libc::c_char,
24185 );
24186}
24187unsafe extern "C" {
24188 #[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."]
24189 pub fn swkbdSetDictionary(
24190 swkbd: *mut SwkbdState,
24191 dict: *const SwkbdDictWord,
24192 wordCount: ::libc::c_int,
24193 );
24194}
24195unsafe extern "C" {
24196 #[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."]
24197 pub fn swkbdSetStatusData(
24198 swkbd: *mut SwkbdState,
24199 data: *mut SwkbdStatusData,
24200 in_: bool,
24201 out: bool,
24202 );
24203}
24204unsafe extern "C" {
24205 #[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."]
24206 pub fn swkbdSetLearningData(
24207 swkbd: *mut SwkbdState,
24208 data: *mut SwkbdLearningData,
24209 in_: bool,
24210 out: bool,
24211 );
24212}
24213unsafe extern "C" {
24214 #[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."]
24215 pub fn swkbdSetFilterCallback(
24216 swkbd: *mut SwkbdState,
24217 callback: SwkbdCallbackFn,
24218 user: *mut ::libc::c_void,
24219 );
24220}
24221unsafe extern "C" {
24222 #[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."]
24223 pub fn swkbdInputText(
24224 swkbd: *mut SwkbdState,
24225 buf: *mut ::libc::c_char,
24226 bufsize: usize,
24227 ) -> SwkbdButton;
24228}
24229unsafe extern "C" {
24230 #[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."]
24231 #[link_name = "swkbdGetResult__extern"]
24232 pub fn swkbdGetResult(swkbd: *mut SwkbdState) -> SwkbdResult;
24233}
24234#[doc = "<??-Unknown flag"]
24235pub const ERROR_LANGUAGE_FLAG: _bindgen_ty_35 = 256;
24236#[doc = "<??-Unknown flag"]
24237pub const ERROR_WORD_WRAP_FLAG: _bindgen_ty_35 = 512;
24238pub type _bindgen_ty_35 = ::libc::c_ushort;
24239#[doc = "< Displays the infrastructure communications-related error message corresponding to the error code."]
24240pub const ERROR_CODE: errorType = 0;
24241#[doc = "< Displays text passed to this applet."]
24242pub const ERROR_TEXT: errorType = 1;
24243#[doc = "< Displays the EULA"]
24244pub const ERROR_EULA: errorType = 2;
24245#[doc = "< Use prohibited."]
24246pub const ERROR_TYPE_EULA_FIRST_BOOT: errorType = 3;
24247#[doc = "< Use prohibited."]
24248pub const ERROR_TYPE_EULA_DRAW_ONLY: errorType = 4;
24249#[doc = "< Use prohibited."]
24250pub const ERROR_TYPE_AGREE: errorType = 5;
24251#[doc = "< Displays a network error message in a specified language."]
24252pub const ERROR_CODE_LANGUAGE: errorType = 256;
24253#[doc = "< Displays text passed to this applet in a specified language."]
24254pub const ERROR_TEXT_LANGUAGE: errorType = 257;
24255#[doc = "< Displays EULA in a specified language."]
24256pub const ERROR_EULA_LANGUAGE: errorType = 258;
24257#[doc = "< Displays the custom error message passed to this applet with automatic line wrapping"]
24258pub const ERROR_TEXT_WORD_WRAP: errorType = 513;
24259#[doc = "< Displays the custom error message with automatic line wrapping and in the specified language."]
24260pub const ERROR_TEXT_LANGUAGE_WORD_WRAP: errorType = 769;
24261pub type errorType = ::libc::c_ushort;
24262pub const ERROR_NORMAL: errorScreenFlag = 0;
24263pub const ERROR_STEREO: errorScreenFlag = 1;
24264pub type errorScreenFlag = ::libc::c_uchar;
24265pub const ERROR_UNKNOWN: errorReturnCode = -1;
24266pub const ERROR_NONE: errorReturnCode = 0;
24267pub const ERROR_SUCCESS: errorReturnCode = 1;
24268pub const ERROR_NOT_SUPPORTED: errorReturnCode = 2;
24269pub const ERROR_HOME_BUTTON: errorReturnCode = 10;
24270pub const ERROR_SOFTWARE_RESET: errorReturnCode = 11;
24271pub const ERROR_POWER_BUTTON: errorReturnCode = 12;
24272pub type errorReturnCode = ::libc::c_schar;
24273#[repr(C)]
24274#[derive(Debug, Copy, Clone)]
24275pub struct errorConf {
24276 pub type_: errorType,
24277 pub errorCode: ::libc::c_int,
24278 pub upperScreenFlag: errorScreenFlag,
24279 pub useLanguage: u16_,
24280 pub Text: [u16_; 1900usize],
24281 pub homeButton: bool,
24282 pub softwareReset: bool,
24283 pub appJump: bool,
24284 pub returnCode: errorReturnCode,
24285 pub eulaVersion: u16_,
24286}
24287#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24288const _: () = {
24289 ["Size of errorConf"][::core::mem::size_of::<errorConf>() - 3820usize];
24290 ["Alignment of errorConf"][::core::mem::align_of::<errorConf>() - 4usize];
24291 ["Offset of field: errorConf::type_"][::core::mem::offset_of!(errorConf, type_) - 0usize];
24292 ["Offset of field: errorConf::errorCode"]
24293 [::core::mem::offset_of!(errorConf, errorCode) - 4usize];
24294 ["Offset of field: errorConf::upperScreenFlag"]
24295 [::core::mem::offset_of!(errorConf, upperScreenFlag) - 8usize];
24296 ["Offset of field: errorConf::useLanguage"]
24297 [::core::mem::offset_of!(errorConf, useLanguage) - 10usize];
24298 ["Offset of field: errorConf::Text"][::core::mem::offset_of!(errorConf, Text) - 12usize];
24299 ["Offset of field: errorConf::homeButton"]
24300 [::core::mem::offset_of!(errorConf, homeButton) - 3812usize];
24301 ["Offset of field: errorConf::softwareReset"]
24302 [::core::mem::offset_of!(errorConf, softwareReset) - 3813usize];
24303 ["Offset of field: errorConf::appJump"]
24304 [::core::mem::offset_of!(errorConf, appJump) - 3814usize];
24305 ["Offset of field: errorConf::returnCode"]
24306 [::core::mem::offset_of!(errorConf, returnCode) - 3815usize];
24307 ["Offset of field: errorConf::eulaVersion"]
24308 [::core::mem::offset_of!(errorConf, eulaVersion) - 3816usize];
24309};
24310impl Default for errorConf {
24311 fn default() -> Self {
24312 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
24313 unsafe {
24314 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
24315 s.assume_init()
24316 }
24317 }
24318}
24319unsafe extern "C" {
24320 #[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."]
24321 pub fn errorInit(err: *mut errorConf, type_: errorType, lang: CFG_Language);
24322}
24323unsafe extern "C" {
24324 #[doc = "Sets error code to display.\n # Arguments\n\n* `err` - Pointer to errorConf.\n * `error` - Error-code to display."]
24325 pub fn errorCode(err: *mut errorConf, error: ::libc::c_int);
24326}
24327unsafe extern "C" {
24328 #[doc = "Sets error text to display.\n # Arguments\n\n* `err` - Pointer to errorConf.\n * `text` - Error-text to display."]
24329 pub fn errorText(err: *mut errorConf, text: *const ::libc::c_char);
24330}
24331unsafe extern "C" {
24332 #[doc = "Displays the error applet.\n # Arguments\n\n* `err` - Pointer to errorConf."]
24333 pub fn errorDisp(err: *mut errorConf);
24334}
24335#[doc = "Parameter structure passed to AppletEd"]
24336#[repr(C)]
24337#[derive(Debug, Copy, Clone)]
24338pub struct MiiSelectorConf {
24339 #[doc = "< Enables canceling of selection if nonzero."]
24340 pub enable_cancel_button: u8_,
24341 #[doc = "< Makes Guets Miis selectable if nonzero."]
24342 pub enable_selecting_guests: u8_,
24343 #[doc = "< Shows applet on top screen if nonzero,\n< otherwise show it on the bottom screen."]
24344 pub show_on_top_screen: u8_,
24345 #[doc = "< "]
24346 pub _unk0x3: [u8_; 5usize],
24347 #[doc = "< UTF16-LE string displayed at the top of the applet. If\n< set to the empty string, a default title is displayed."]
24348 pub title: [u16_; 64usize],
24349 #[doc = "< "]
24350 pub _unk0x88: [u8_; 4usize],
24351 #[doc = "< If nonzero, the applet shows a page with Guest\n< Miis on launch."]
24352 pub show_guest_page: u8_,
24353 #[doc = "< "]
24354 pub _unk0x8D: [u8_; 3usize],
24355 #[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."]
24356 pub initial_index: u32_,
24357 #[doc = "< Each byte set to a nonzero value\n< enables its corresponding Guest\n< Mii to be enabled for selection."]
24358 pub mii_guest_whitelist: [u8_; 6usize],
24359 #[doc = "< Each byte set to a nonzero value enables\n< its corresponding user Mii to be enabled\n< for selection."]
24360 pub mii_whitelist: [u8_; 100usize],
24361 #[doc = "< "]
24362 pub _unk0xFE: u16_,
24363 #[doc = "< Will be set to MIISELECTOR_MAGIC before launching the\n< applet."]
24364 pub magic: u32_,
24365}
24366#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24367const _: () = {
24368 ["Size of MiiSelectorConf"][::core::mem::size_of::<MiiSelectorConf>() - 260usize];
24369 ["Alignment of MiiSelectorConf"][::core::mem::align_of::<MiiSelectorConf>() - 4usize];
24370 ["Offset of field: MiiSelectorConf::enable_cancel_button"]
24371 [::core::mem::offset_of!(MiiSelectorConf, enable_cancel_button) - 0usize];
24372 ["Offset of field: MiiSelectorConf::enable_selecting_guests"]
24373 [::core::mem::offset_of!(MiiSelectorConf, enable_selecting_guests) - 1usize];
24374 ["Offset of field: MiiSelectorConf::show_on_top_screen"]
24375 [::core::mem::offset_of!(MiiSelectorConf, show_on_top_screen) - 2usize];
24376 ["Offset of field: MiiSelectorConf::_unk0x3"]
24377 [::core::mem::offset_of!(MiiSelectorConf, _unk0x3) - 3usize];
24378 ["Offset of field: MiiSelectorConf::title"]
24379 [::core::mem::offset_of!(MiiSelectorConf, title) - 8usize];
24380 ["Offset of field: MiiSelectorConf::_unk0x88"]
24381 [::core::mem::offset_of!(MiiSelectorConf, _unk0x88) - 136usize];
24382 ["Offset of field: MiiSelectorConf::show_guest_page"]
24383 [::core::mem::offset_of!(MiiSelectorConf, show_guest_page) - 140usize];
24384 ["Offset of field: MiiSelectorConf::_unk0x8D"]
24385 [::core::mem::offset_of!(MiiSelectorConf, _unk0x8D) - 141usize];
24386 ["Offset of field: MiiSelectorConf::initial_index"]
24387 [::core::mem::offset_of!(MiiSelectorConf, initial_index) - 144usize];
24388 ["Offset of field: MiiSelectorConf::mii_guest_whitelist"]
24389 [::core::mem::offset_of!(MiiSelectorConf, mii_guest_whitelist) - 148usize];
24390 ["Offset of field: MiiSelectorConf::mii_whitelist"]
24391 [::core::mem::offset_of!(MiiSelectorConf, mii_whitelist) - 154usize];
24392 ["Offset of field: MiiSelectorConf::_unk0xFE"]
24393 [::core::mem::offset_of!(MiiSelectorConf, _unk0xFE) - 254usize];
24394 ["Offset of field: MiiSelectorConf::magic"]
24395 [::core::mem::offset_of!(MiiSelectorConf, magic) - 256usize];
24396};
24397impl Default for MiiSelectorConf {
24398 fn default() -> Self {
24399 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
24400 unsafe {
24401 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
24402 s.assume_init()
24403 }
24404 }
24405}
24406#[doc = "Structure written by AppletEd"]
24407#[repr(C)]
24408#[derive(Debug, Default, Copy, Clone)]
24409pub struct MiiSelectorReturn {
24410 #[doc = "< 0 if a Mii was selected, 1 if the selection was\n< canceled."]
24411 pub no_mii_selected: u32_,
24412 #[doc = "< 1 if a Guest Mii was selected, 0 otherwise."]
24413 pub guest_mii_was_selected: u32_,
24414 #[doc = "< Index of the selected Guest Mii,\n< 0xFFFFFFFF if no guest was selected."]
24415 pub guest_mii_index: u32_,
24416 #[doc = "< Data of selected Mii."]
24417 pub mii: MiiData,
24418 #[doc = "< "]
24419 pub _pad0x68: u16_,
24420 #[doc = "< Checksum of the returned Mii data.\n< Stored as a big-endian value; use\n< miiSelectorChecksumIsValid to\n< verify."]
24421 pub checksum: u16_,
24422 #[doc = "< Localized name of a Guest Mii,\n< if one was selected (UTF16-LE\n< string). Zeroed otherwise."]
24423 pub guest_mii_name: [u16_; 12usize],
24424}
24425#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24426const _: () = {
24427 ["Size of MiiSelectorReturn"][::core::mem::size_of::<MiiSelectorReturn>() - 132usize];
24428 ["Alignment of MiiSelectorReturn"][::core::mem::align_of::<MiiSelectorReturn>() - 4usize];
24429 ["Offset of field: MiiSelectorReturn::no_mii_selected"]
24430 [::core::mem::offset_of!(MiiSelectorReturn, no_mii_selected) - 0usize];
24431 ["Offset of field: MiiSelectorReturn::guest_mii_was_selected"]
24432 [::core::mem::offset_of!(MiiSelectorReturn, guest_mii_was_selected) - 4usize];
24433 ["Offset of field: MiiSelectorReturn::guest_mii_index"]
24434 [::core::mem::offset_of!(MiiSelectorReturn, guest_mii_index) - 8usize];
24435 ["Offset of field: MiiSelectorReturn::mii"]
24436 [::core::mem::offset_of!(MiiSelectorReturn, mii) - 12usize];
24437 ["Offset of field: MiiSelectorReturn::_pad0x68"]
24438 [::core::mem::offset_of!(MiiSelectorReturn, _pad0x68) - 104usize];
24439 ["Offset of field: MiiSelectorReturn::checksum"]
24440 [::core::mem::offset_of!(MiiSelectorReturn, checksum) - 106usize];
24441 ["Offset of field: MiiSelectorReturn::guest_mii_name"]
24442 [::core::mem::offset_of!(MiiSelectorReturn, guest_mii_name) - 108usize];
24443};
24444#[doc = "< Show the cancel button"]
24445pub const MIISELECTOR_CANCEL: _bindgen_ty_36 = 1;
24446#[doc = "< Make Guets Miis selectable"]
24447pub const MIISELECTOR_GUESTS: _bindgen_ty_36 = 2;
24448#[doc = "< Show AppletEd on top screen"]
24449pub const MIISELECTOR_TOP: _bindgen_ty_36 = 4;
24450#[doc = "< Start on guest page"]
24451pub const MIISELECTOR_GUESTSTART: _bindgen_ty_36 = 8;
24452#[doc = "AppletEd options"]
24453pub type _bindgen_ty_36 = ::libc::c_uchar;
24454unsafe extern "C" {
24455 #[doc = "Initialize Mii selector config\n # Arguments\n\n* `conf` - Pointer to Miiselector config."]
24456 pub fn miiSelectorInit(conf: *mut MiiSelectorConf);
24457}
24458unsafe extern "C" {
24459 #[doc = "Launch the Mii selector library applet\n\n # Arguments\n\n* `conf` - Configuration determining how the applet should behave"]
24460 pub fn miiSelectorLaunch(conf: *const MiiSelectorConf, returnbuf: *mut MiiSelectorReturn);
24461}
24462unsafe extern "C" {
24463 #[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"]
24464 pub fn miiSelectorSetTitle(conf: *mut MiiSelectorConf, text: *const ::libc::c_char);
24465}
24466unsafe extern "C" {
24467 #[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"]
24468 pub fn miiSelectorSetOptions(conf: *mut MiiSelectorConf, options: u32_);
24469}
24470unsafe extern "C" {
24471 #[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."]
24472 pub fn miiSelectorWhitelistGuestMii(conf: *mut MiiSelectorConf, index: u32_);
24473}
24474unsafe extern "C" {
24475 #[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."]
24476 pub fn miiSelectorBlacklistGuestMii(conf: *mut MiiSelectorConf, index: u32_);
24477}
24478unsafe extern "C" {
24479 #[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"]
24480 pub fn miiSelectorWhitelistUserMii(conf: *mut MiiSelectorConf, index: u32_);
24481}
24482unsafe extern "C" {
24483 #[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"]
24484 pub fn miiSelectorBlacklistUserMii(conf: *mut MiiSelectorConf, index: u32_);
24485}
24486unsafe extern "C" {
24487 #[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)."]
24488 #[link_name = "miiSelectorSetInitialIndex__extern"]
24489 pub fn miiSelectorSetInitialIndex(conf: *mut MiiSelectorConf, index: u32_);
24490}
24491unsafe extern "C" {
24492 #[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)."]
24493 pub fn miiSelectorReturnGetName(
24494 returnbuf: *const MiiSelectorReturn,
24495 out: *mut ::libc::c_char,
24496 max_size: usize,
24497 );
24498}
24499unsafe extern "C" {
24500 #[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."]
24501 pub fn miiSelectorReturnGetAuthor(
24502 returnbuf: *const MiiSelectorReturn,
24503 out: *mut ::libc::c_char,
24504 max_size: usize,
24505 );
24506}
24507unsafe extern "C" {
24508 #[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`"]
24509 pub fn miiSelectorChecksumIsValid(returnbuf: *const MiiSelectorReturn) -> bool;
24510}
24511#[doc = "Open directory struct"]
24512#[repr(C)]
24513#[derive(Debug, Copy, Clone)]
24514pub struct archive_dir_t {
24515 pub magic: u32_,
24516 #[doc = "\"arch\""]
24517 pub fd: Handle,
24518 #[doc = "CTRU handle"]
24519 pub index: isize,
24520 #[doc = "Current entry index"]
24521 pub size: usize,
24522 #[doc = "Current batch size"]
24523 pub entry_data: [FS_DirectoryEntry; 32usize],
24524}
24525#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24526const _: () = {
24527 ["Size of archive_dir_t"][::core::mem::size_of::<archive_dir_t>() - 17680usize];
24528 ["Alignment of archive_dir_t"][::core::mem::align_of::<archive_dir_t>() - 8usize];
24529 ["Offset of field: archive_dir_t::magic"]
24530 [::core::mem::offset_of!(archive_dir_t, magic) - 0usize];
24531 ["Offset of field: archive_dir_t::fd"][::core::mem::offset_of!(archive_dir_t, fd) - 4usize];
24532 ["Offset of field: archive_dir_t::index"]
24533 [::core::mem::offset_of!(archive_dir_t, index) - 8usize];
24534 ["Offset of field: archive_dir_t::size"]
24535 [::core::mem::offset_of!(archive_dir_t, size) - 12usize];
24536 ["Offset of field: archive_dir_t::entry_data"]
24537 [::core::mem::offset_of!(archive_dir_t, entry_data) - 16usize];
24538};
24539impl Default for archive_dir_t {
24540 fn default() -> Self {
24541 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
24542 unsafe {
24543 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
24544 s.assume_init()
24545 }
24546 }
24547}
24548unsafe extern "C" {
24549 #[must_use]
24550 #[doc = "Mounts the SD"]
24551 pub fn archiveMountSdmc() -> Result;
24552}
24553unsafe extern "C" {
24554 #[must_use]
24555 #[doc = "Mounts and opens an archive as deviceName\n Returns either an archive open error code, or -1 for generic failure"]
24556 pub fn archiveMount(
24557 archiveID: FS_ArchiveID,
24558 archivePath: FS_Path,
24559 deviceName: *const ::libc::c_char,
24560 ) -> Result;
24561}
24562unsafe extern "C" {
24563 #[must_use]
24564 #[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"]
24565 pub fn archiveCommitSaveData(deviceName: *const ::libc::c_char) -> Result;
24566}
24567unsafe extern "C" {
24568 #[must_use]
24569 #[doc = "Unmounts the specified device, closing its archive in the process\n Returns -1 if the specified device was not found"]
24570 pub fn archiveUnmount(deviceName: *const ::libc::c_char) -> Result;
24571}
24572unsafe extern "C" {
24573 #[must_use]
24574 #[doc = "Unmounts all devices and cleans up any resources used by the driver"]
24575 pub fn archiveUnmountAll() -> Result;
24576}
24577unsafe extern "C" {
24578 #[must_use]
24579 #[doc = "Get a file's mtime"]
24580 pub fn archive_getmtime(name: *const ::libc::c_char, mtime: *mut u64_) -> Result;
24581}
24582#[doc = "RomFS header."]
24583#[repr(C)]
24584#[derive(Debug, Default, Copy, Clone)]
24585pub struct romfs_header {
24586 #[doc = "< Size of the header."]
24587 pub headerSize: u32_,
24588 #[doc = "< Offset of the directory hash table."]
24589 pub dirHashTableOff: u32_,
24590 #[doc = "< Size of the directory hash table."]
24591 pub dirHashTableSize: u32_,
24592 #[doc = "< Offset of the directory table."]
24593 pub dirTableOff: u32_,
24594 #[doc = "< Size of the directory table."]
24595 pub dirTableSize: u32_,
24596 #[doc = "< Offset of the file hash table."]
24597 pub fileHashTableOff: u32_,
24598 #[doc = "< Size of the file hash table."]
24599 pub fileHashTableSize: u32_,
24600 #[doc = "< Offset of the file table."]
24601 pub fileTableOff: u32_,
24602 #[doc = "< Size of the file table."]
24603 pub fileTableSize: u32_,
24604 #[doc = "< Offset of the file data."]
24605 pub fileDataOff: u32_,
24606}
24607#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24608const _: () = {
24609 ["Size of romfs_header"][::core::mem::size_of::<romfs_header>() - 40usize];
24610 ["Alignment of romfs_header"][::core::mem::align_of::<romfs_header>() - 4usize];
24611 ["Offset of field: romfs_header::headerSize"]
24612 [::core::mem::offset_of!(romfs_header, headerSize) - 0usize];
24613 ["Offset of field: romfs_header::dirHashTableOff"]
24614 [::core::mem::offset_of!(romfs_header, dirHashTableOff) - 4usize];
24615 ["Offset of field: romfs_header::dirHashTableSize"]
24616 [::core::mem::offset_of!(romfs_header, dirHashTableSize) - 8usize];
24617 ["Offset of field: romfs_header::dirTableOff"]
24618 [::core::mem::offset_of!(romfs_header, dirTableOff) - 12usize];
24619 ["Offset of field: romfs_header::dirTableSize"]
24620 [::core::mem::offset_of!(romfs_header, dirTableSize) - 16usize];
24621 ["Offset of field: romfs_header::fileHashTableOff"]
24622 [::core::mem::offset_of!(romfs_header, fileHashTableOff) - 20usize];
24623 ["Offset of field: romfs_header::fileHashTableSize"]
24624 [::core::mem::offset_of!(romfs_header, fileHashTableSize) - 24usize];
24625 ["Offset of field: romfs_header::fileTableOff"]
24626 [::core::mem::offset_of!(romfs_header, fileTableOff) - 28usize];
24627 ["Offset of field: romfs_header::fileTableSize"]
24628 [::core::mem::offset_of!(romfs_header, fileTableSize) - 32usize];
24629 ["Offset of field: romfs_header::fileDataOff"]
24630 [::core::mem::offset_of!(romfs_header, fileDataOff) - 36usize];
24631};
24632#[doc = "RomFS directory."]
24633#[repr(C)]
24634#[derive(Debug, Default)]
24635pub struct romfs_dir {
24636 #[doc = "< Offset of the parent directory."]
24637 pub parent: u32_,
24638 #[doc = "< Offset of the next sibling directory."]
24639 pub sibling: u32_,
24640 #[doc = "< Offset of the first child directory."]
24641 pub childDir: u32_,
24642 #[doc = "< Offset of the first file."]
24643 pub childFile: u32_,
24644 #[doc = "< Directory hash table pointer."]
24645 pub nextHash: u32_,
24646 #[doc = "< Name length."]
24647 pub nameLen: u32_,
24648 #[doc = "< Name. (UTF-16)"]
24649 pub name: __IncompleteArrayField<u16_>,
24650}
24651#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24652const _: () = {
24653 ["Size of romfs_dir"][::core::mem::size_of::<romfs_dir>() - 24usize];
24654 ["Alignment of romfs_dir"][::core::mem::align_of::<romfs_dir>() - 4usize];
24655 ["Offset of field: romfs_dir::parent"][::core::mem::offset_of!(romfs_dir, parent) - 0usize];
24656 ["Offset of field: romfs_dir::sibling"][::core::mem::offset_of!(romfs_dir, sibling) - 4usize];
24657 ["Offset of field: romfs_dir::childDir"][::core::mem::offset_of!(romfs_dir, childDir) - 8usize];
24658 ["Offset of field: romfs_dir::childFile"]
24659 [::core::mem::offset_of!(romfs_dir, childFile) - 12usize];
24660 ["Offset of field: romfs_dir::nextHash"]
24661 [::core::mem::offset_of!(romfs_dir, nextHash) - 16usize];
24662 ["Offset of field: romfs_dir::nameLen"][::core::mem::offset_of!(romfs_dir, nameLen) - 20usize];
24663 ["Offset of field: romfs_dir::name"][::core::mem::offset_of!(romfs_dir, name) - 24usize];
24664};
24665#[doc = "RomFS file."]
24666#[repr(C)]
24667#[derive(Debug, Default)]
24668pub struct romfs_file {
24669 #[doc = "< Offset of the parent directory."]
24670 pub parent: u32_,
24671 #[doc = "< Offset of the next sibling file."]
24672 pub sibling: u32_,
24673 #[doc = "< Offset of the file's data."]
24674 pub dataOff: u64_,
24675 #[doc = "< Length of the file's data."]
24676 pub dataSize: u64_,
24677 #[doc = "< File hash table pointer."]
24678 pub nextHash: u32_,
24679 #[doc = "< Name length."]
24680 pub nameLen: u32_,
24681 #[doc = "< Name. (UTF-16)"]
24682 pub name: __IncompleteArrayField<u16_>,
24683}
24684#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24685const _: () = {
24686 ["Size of romfs_file"][::core::mem::size_of::<romfs_file>() - 32usize];
24687 ["Alignment of romfs_file"][::core::mem::align_of::<romfs_file>() - 8usize];
24688 ["Offset of field: romfs_file::parent"][::core::mem::offset_of!(romfs_file, parent) - 0usize];
24689 ["Offset of field: romfs_file::sibling"][::core::mem::offset_of!(romfs_file, sibling) - 4usize];
24690 ["Offset of field: romfs_file::dataOff"][::core::mem::offset_of!(romfs_file, dataOff) - 8usize];
24691 ["Offset of field: romfs_file::dataSize"]
24692 [::core::mem::offset_of!(romfs_file, dataSize) - 16usize];
24693 ["Offset of field: romfs_file::nextHash"]
24694 [::core::mem::offset_of!(romfs_file, nextHash) - 24usize];
24695 ["Offset of field: romfs_file::nameLen"]
24696 [::core::mem::offset_of!(romfs_file, nameLen) - 28usize];
24697 ["Offset of field: romfs_file::name"][::core::mem::offset_of!(romfs_file, name) - 32usize];
24698};
24699unsafe extern "C" {
24700 #[must_use]
24701 #[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."]
24702 pub fn romfsMountSelf(name: *const ::libc::c_char) -> Result;
24703}
24704unsafe extern "C" {
24705 #[must_use]
24706 #[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."]
24707 pub fn romfsMountFromFile(fd: Handle, offset: u32_, name: *const ::libc::c_char) -> Result;
24708}
24709unsafe extern "C" {
24710 #[must_use]
24711 #[doc = "Mounts RomFS using the current process host program RomFS.\n # Arguments\n\n* `name` - Device mount name."]
24712 pub fn romfsMountFromCurrentProcess(name: *const ::libc::c_char) -> Result;
24713}
24714unsafe extern "C" {
24715 #[must_use]
24716 #[doc = "Mounts RomFS from the specified title.\n # Arguments\n\n* `tid` - Title ID\n * `mediatype` - Mediatype\n * `name` - Device mount name."]
24717 pub fn romfsMountFromTitle(
24718 tid: u64_,
24719 mediatype: FS_MediaType,
24720 name: *const ::libc::c_char,
24721 ) -> Result;
24722}
24723unsafe extern "C" {
24724 #[must_use]
24725 #[doc = "Unmounts the RomFS device."]
24726 pub fn romfsUnmount(name: *const ::libc::c_char) -> Result;
24727}
24728unsafe extern "C" {
24729 #[must_use]
24730 #[doc = "Wrapper for romfsMountSelf with the default \"romfs\" device name."]
24731 #[link_name = "romfsInit__extern"]
24732 pub fn romfsInit() -> Result;
24733}
24734unsafe extern "C" {
24735 #[must_use]
24736 #[doc = "Wrapper for romfsUnmount with the default \"romfs\" device name."]
24737 #[link_name = "romfsExit__extern"]
24738 pub fn romfsExit() -> Result;
24739}
24740#[doc = "Character width information structure."]
24741#[repr(C)]
24742#[derive(Debug, Default, Copy, Clone)]
24743pub struct charWidthInfo_s {
24744 #[doc = "< Horizontal offset to draw the glyph with."]
24745 pub left: s8,
24746 #[doc = "< Width of the glyph."]
24747 pub glyphWidth: u8_,
24748 #[doc = "< Width of the character, that is, horizontal distance to advance."]
24749 pub charWidth: u8_,
24750}
24751#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24752const _: () = {
24753 ["Size of charWidthInfo_s"][::core::mem::size_of::<charWidthInfo_s>() - 3usize];
24754 ["Alignment of charWidthInfo_s"][::core::mem::align_of::<charWidthInfo_s>() - 1usize];
24755 ["Offset of field: charWidthInfo_s::left"]
24756 [::core::mem::offset_of!(charWidthInfo_s, left) - 0usize];
24757 ["Offset of field: charWidthInfo_s::glyphWidth"]
24758 [::core::mem::offset_of!(charWidthInfo_s, glyphWidth) - 1usize];
24759 ["Offset of field: charWidthInfo_s::charWidth"]
24760 [::core::mem::offset_of!(charWidthInfo_s, charWidth) - 2usize];
24761};
24762#[doc = "Font texture sheet information."]
24763#[repr(C)]
24764#[derive(Debug, Copy, Clone)]
24765pub struct TGLP_s {
24766 #[doc = "< Width of a glyph cell."]
24767 pub cellWidth: u8_,
24768 #[doc = "< Height of a glyph cell."]
24769 pub cellHeight: u8_,
24770 #[doc = "< Vertical position of the baseline."]
24771 pub baselinePos: u8_,
24772 #[doc = "< Maximum character width."]
24773 pub maxCharWidth: u8_,
24774 #[doc = "< Size in bytes of a texture sheet."]
24775 pub sheetSize: u32_,
24776 #[doc = "< Number of texture sheets."]
24777 pub nSheets: u16_,
24778 #[doc = "< GPU texture format (GPU_TEXCOLOR)."]
24779 pub sheetFmt: u16_,
24780 #[doc = "< Number of glyphs per row per sheet."]
24781 pub nRows: u16_,
24782 #[doc = "< Number of glyph rows per sheet."]
24783 pub nLines: u16_,
24784 #[doc = "< Texture sheet width."]
24785 pub sheetWidth: u16_,
24786 #[doc = "< Texture sheet height."]
24787 pub sheetHeight: u16_,
24788 #[doc = "< Pointer to texture sheet data."]
24789 pub sheetData: *mut u8_,
24790}
24791#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24792const _: () = {
24793 ["Size of TGLP_s"][::core::mem::size_of::<TGLP_s>() - 24usize];
24794 ["Alignment of TGLP_s"][::core::mem::align_of::<TGLP_s>() - 4usize];
24795 ["Offset of field: TGLP_s::cellWidth"][::core::mem::offset_of!(TGLP_s, cellWidth) - 0usize];
24796 ["Offset of field: TGLP_s::cellHeight"][::core::mem::offset_of!(TGLP_s, cellHeight) - 1usize];
24797 ["Offset of field: TGLP_s::baselinePos"][::core::mem::offset_of!(TGLP_s, baselinePos) - 2usize];
24798 ["Offset of field: TGLP_s::maxCharWidth"]
24799 [::core::mem::offset_of!(TGLP_s, maxCharWidth) - 3usize];
24800 ["Offset of field: TGLP_s::sheetSize"][::core::mem::offset_of!(TGLP_s, sheetSize) - 4usize];
24801 ["Offset of field: TGLP_s::nSheets"][::core::mem::offset_of!(TGLP_s, nSheets) - 8usize];
24802 ["Offset of field: TGLP_s::sheetFmt"][::core::mem::offset_of!(TGLP_s, sheetFmt) - 10usize];
24803 ["Offset of field: TGLP_s::nRows"][::core::mem::offset_of!(TGLP_s, nRows) - 12usize];
24804 ["Offset of field: TGLP_s::nLines"][::core::mem::offset_of!(TGLP_s, nLines) - 14usize];
24805 ["Offset of field: TGLP_s::sheetWidth"][::core::mem::offset_of!(TGLP_s, sheetWidth) - 16usize];
24806 ["Offset of field: TGLP_s::sheetHeight"]
24807 [::core::mem::offset_of!(TGLP_s, sheetHeight) - 18usize];
24808 ["Offset of field: TGLP_s::sheetData"][::core::mem::offset_of!(TGLP_s, sheetData) - 20usize];
24809};
24810impl Default for TGLP_s {
24811 fn default() -> Self {
24812 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
24813 unsafe {
24814 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
24815 s.assume_init()
24816 }
24817 }
24818}
24819#[doc = "Font character width information block type."]
24820pub type CWDH_s = tag_CWDH_s;
24821#[doc = "Font character width information block structure."]
24822#[repr(C)]
24823#[derive(Debug)]
24824pub struct tag_CWDH_s {
24825 #[doc = "< First Unicode codepoint the block applies to."]
24826 pub startIndex: u16_,
24827 #[doc = "< Last Unicode codepoint the block applies to."]
24828 pub endIndex: u16_,
24829 #[doc = "< Pointer to the next block."]
24830 pub next: *mut CWDH_s,
24831 #[doc = "< Table of character width information structures."]
24832 pub widths: __IncompleteArrayField<charWidthInfo_s>,
24833}
24834#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24835const _: () = {
24836 ["Size of tag_CWDH_s"][::core::mem::size_of::<tag_CWDH_s>() - 8usize];
24837 ["Alignment of tag_CWDH_s"][::core::mem::align_of::<tag_CWDH_s>() - 4usize];
24838 ["Offset of field: tag_CWDH_s::startIndex"]
24839 [::core::mem::offset_of!(tag_CWDH_s, startIndex) - 0usize];
24840 ["Offset of field: tag_CWDH_s::endIndex"]
24841 [::core::mem::offset_of!(tag_CWDH_s, endIndex) - 2usize];
24842 ["Offset of field: tag_CWDH_s::next"][::core::mem::offset_of!(tag_CWDH_s, next) - 4usize];
24843 ["Offset of field: tag_CWDH_s::widths"][::core::mem::offset_of!(tag_CWDH_s, widths) - 8usize];
24844};
24845impl Default for tag_CWDH_s {
24846 fn default() -> Self {
24847 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
24848 unsafe {
24849 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
24850 s.assume_init()
24851 }
24852 }
24853}
24854#[doc = "< Identity mapping."]
24855pub const CMAP_TYPE_DIRECT: _bindgen_ty_37 = 0;
24856#[doc = "< Mapping using a table."]
24857pub const CMAP_TYPE_TABLE: _bindgen_ty_37 = 1;
24858#[doc = "< Mapping using a list of mapped characters."]
24859pub const CMAP_TYPE_SCAN: _bindgen_ty_37 = 2;
24860#[doc = "Font character map methods."]
24861pub type _bindgen_ty_37 = ::libc::c_uchar;
24862#[doc = "Font character map type."]
24863pub type CMAP_s = tag_CMAP_s;
24864#[doc = "Font character map structure."]
24865#[repr(C)]
24866pub struct tag_CMAP_s {
24867 #[doc = "< First Unicode codepoint the block applies to."]
24868 pub codeBegin: u16_,
24869 #[doc = "< Last Unicode codepoint the block applies to."]
24870 pub codeEnd: u16_,
24871 #[doc = "< Mapping method."]
24872 pub mappingMethod: u16_,
24873 pub reserved: u16_,
24874 #[doc = "< Pointer to the next map."]
24875 pub next: *mut CMAP_s,
24876 pub __bindgen_anon_1: tag_CMAP_s__bindgen_ty_1,
24877}
24878#[repr(C)]
24879pub struct tag_CMAP_s__bindgen_ty_1 {
24880 #[doc = "< For CMAP_TYPE_DIRECT: index of the first glyph."]
24881 pub indexOffset: __BindgenUnionField<u16_>,
24882 #[doc = "< For CMAP_TYPE_TABLE: table of glyph indices."]
24883 pub indexTable: __BindgenUnionField<[u16_; 0usize]>,
24884 pub __bindgen_anon_1: __BindgenUnionField<tag_CMAP_s__bindgen_ty_1__bindgen_ty_1>,
24885 pub bindgen_union_field: u16,
24886}
24887#[doc = "For CMAP_TYPE_SCAN: Mapping data."]
24888#[repr(C)]
24889#[derive(Debug, Default)]
24890pub struct tag_CMAP_s__bindgen_ty_1__bindgen_ty_1 {
24891 #[doc = "< Number of pairs."]
24892 pub nScanEntries: u16_,
24893 pub scanEntries: __IncompleteArrayField<tag_CMAP_s__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1>,
24894}
24895#[doc = "Mapping pairs."]
24896#[repr(C)]
24897#[derive(Debug, Default, Copy, Clone)]
24898pub struct tag_CMAP_s__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1 {
24899 #[doc = "< Unicode codepoint."]
24900 pub code: u16_,
24901 #[doc = "< Mapped glyph index."]
24902 pub glyphIndex: u16_,
24903}
24904#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24905const _: () = {
24906 ["Size of tag_CMAP_s__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1"]
24907 [::core::mem::size_of::<tag_CMAP_s__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1>() - 4usize];
24908 ["Alignment of tag_CMAP_s__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1"]
24909 [::core::mem::align_of::<tag_CMAP_s__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1>() - 2usize];
24910 ["Offset of field: tag_CMAP_s__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1::code"][::core::mem::offset_of!(
24911 tag_CMAP_s__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1,
24912 code
24913 ) - 0usize];
24914 ["Offset of field: tag_CMAP_s__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1::glyphIndex"][::core::mem::offset_of!(
24915 tag_CMAP_s__bindgen_ty_1__bindgen_ty_1__bindgen_ty_1,
24916 glyphIndex
24917 )
24918 - 2usize];
24919};
24920#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24921const _: () = {
24922 ["Size of tag_CMAP_s__bindgen_ty_1__bindgen_ty_1"]
24923 [::core::mem::size_of::<tag_CMAP_s__bindgen_ty_1__bindgen_ty_1>() - 2usize];
24924 ["Alignment of tag_CMAP_s__bindgen_ty_1__bindgen_ty_1"]
24925 [::core::mem::align_of::<tag_CMAP_s__bindgen_ty_1__bindgen_ty_1>() - 2usize];
24926 ["Offset of field: tag_CMAP_s__bindgen_ty_1__bindgen_ty_1::nScanEntries"]
24927 [::core::mem::offset_of!(tag_CMAP_s__bindgen_ty_1__bindgen_ty_1, nScanEntries) - 0usize];
24928 ["Offset of field: tag_CMAP_s__bindgen_ty_1__bindgen_ty_1::scanEntries"]
24929 [::core::mem::offset_of!(tag_CMAP_s__bindgen_ty_1__bindgen_ty_1, scanEntries) - 2usize];
24930};
24931#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24932const _: () = {
24933 ["Size of tag_CMAP_s__bindgen_ty_1"]
24934 [::core::mem::size_of::<tag_CMAP_s__bindgen_ty_1>() - 2usize];
24935 ["Alignment of tag_CMAP_s__bindgen_ty_1"]
24936 [::core::mem::align_of::<tag_CMAP_s__bindgen_ty_1>() - 2usize];
24937 ["Offset of field: tag_CMAP_s__bindgen_ty_1::indexOffset"]
24938 [::core::mem::offset_of!(tag_CMAP_s__bindgen_ty_1, indexOffset) - 0usize];
24939 ["Offset of field: tag_CMAP_s__bindgen_ty_1::indexTable"]
24940 [::core::mem::offset_of!(tag_CMAP_s__bindgen_ty_1, indexTable) - 0usize];
24941};
24942impl Default for tag_CMAP_s__bindgen_ty_1 {
24943 fn default() -> Self {
24944 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
24945 unsafe {
24946 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
24947 s.assume_init()
24948 }
24949 }
24950}
24951#[allow(clippy::unnecessary_operation, clippy::identity_op)]
24952const _: () = {
24953 ["Size of tag_CMAP_s"][::core::mem::size_of::<tag_CMAP_s>() - 16usize];
24954 ["Alignment of tag_CMAP_s"][::core::mem::align_of::<tag_CMAP_s>() - 4usize];
24955 ["Offset of field: tag_CMAP_s::codeBegin"]
24956 [::core::mem::offset_of!(tag_CMAP_s, codeBegin) - 0usize];
24957 ["Offset of field: tag_CMAP_s::codeEnd"][::core::mem::offset_of!(tag_CMAP_s, codeEnd) - 2usize];
24958 ["Offset of field: tag_CMAP_s::mappingMethod"]
24959 [::core::mem::offset_of!(tag_CMAP_s, mappingMethod) - 4usize];
24960 ["Offset of field: tag_CMAP_s::reserved"]
24961 [::core::mem::offset_of!(tag_CMAP_s, reserved) - 6usize];
24962 ["Offset of field: tag_CMAP_s::next"][::core::mem::offset_of!(tag_CMAP_s, next) - 8usize];
24963};
24964impl Default for tag_CMAP_s {
24965 fn default() -> Self {
24966 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
24967 unsafe {
24968 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
24969 s.assume_init()
24970 }
24971 }
24972}
24973#[doc = "Font information structure."]
24974#[repr(C)]
24975#[derive(Debug, Copy, Clone)]
24976pub struct FINF_s {
24977 #[doc = "< Signature (FINF)."]
24978 pub signature: u32_,
24979 #[doc = "< Section size."]
24980 pub sectionSize: u32_,
24981 #[doc = "< Font type"]
24982 pub fontType: u8_,
24983 #[doc = "< Line feed vertical distance."]
24984 pub lineFeed: u8_,
24985 #[doc = "< Glyph index of the replacement character."]
24986 pub alterCharIndex: u16_,
24987 #[doc = "< Default character width information."]
24988 pub defaultWidth: charWidthInfo_s,
24989 #[doc = "< Font encoding (?)"]
24990 pub encoding: u8_,
24991 #[doc = "< Pointer to texture sheet information."]
24992 pub tglp: *mut TGLP_s,
24993 #[doc = "< Pointer to the first character width information block."]
24994 pub cwdh: *mut CWDH_s,
24995 #[doc = "< Pointer to the first character map."]
24996 pub cmap: *mut CMAP_s,
24997 #[doc = "< Font height."]
24998 pub height: u8_,
24999 #[doc = "< Font width."]
25000 pub width: u8_,
25001 #[doc = "< Font ascent."]
25002 pub ascent: u8_,
25003 pub padding: u8_,
25004}
25005#[allow(clippy::unnecessary_operation, clippy::identity_op)]
25006const _: () = {
25007 ["Size of FINF_s"][::core::mem::size_of::<FINF_s>() - 32usize];
25008 ["Alignment of FINF_s"][::core::mem::align_of::<FINF_s>() - 4usize];
25009 ["Offset of field: FINF_s::signature"][::core::mem::offset_of!(FINF_s, signature) - 0usize];
25010 ["Offset of field: FINF_s::sectionSize"][::core::mem::offset_of!(FINF_s, sectionSize) - 4usize];
25011 ["Offset of field: FINF_s::fontType"][::core::mem::offset_of!(FINF_s, fontType) - 8usize];
25012 ["Offset of field: FINF_s::lineFeed"][::core::mem::offset_of!(FINF_s, lineFeed) - 9usize];
25013 ["Offset of field: FINF_s::alterCharIndex"]
25014 [::core::mem::offset_of!(FINF_s, alterCharIndex) - 10usize];
25015 ["Offset of field: FINF_s::defaultWidth"]
25016 [::core::mem::offset_of!(FINF_s, defaultWidth) - 12usize];
25017 ["Offset of field: FINF_s::encoding"][::core::mem::offset_of!(FINF_s, encoding) - 15usize];
25018 ["Offset of field: FINF_s::tglp"][::core::mem::offset_of!(FINF_s, tglp) - 16usize];
25019 ["Offset of field: FINF_s::cwdh"][::core::mem::offset_of!(FINF_s, cwdh) - 20usize];
25020 ["Offset of field: FINF_s::cmap"][::core::mem::offset_of!(FINF_s, cmap) - 24usize];
25021 ["Offset of field: FINF_s::height"][::core::mem::offset_of!(FINF_s, height) - 28usize];
25022 ["Offset of field: FINF_s::width"][::core::mem::offset_of!(FINF_s, width) - 29usize];
25023 ["Offset of field: FINF_s::ascent"][::core::mem::offset_of!(FINF_s, ascent) - 30usize];
25024 ["Offset of field: FINF_s::padding"][::core::mem::offset_of!(FINF_s, padding) - 31usize];
25025};
25026impl Default for FINF_s {
25027 fn default() -> Self {
25028 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
25029 unsafe {
25030 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
25031 s.assume_init()
25032 }
25033 }
25034}
25035#[doc = "Font structure."]
25036#[repr(C)]
25037#[derive(Debug, Copy, Clone)]
25038pub struct CFNT_s {
25039 #[doc = "< Signature (CFNU)."]
25040 pub signature: u32_,
25041 #[doc = "< Endianness constant (0xFEFF)."]
25042 pub endianness: u16_,
25043 #[doc = "< Header size."]
25044 pub headerSize: u16_,
25045 #[doc = "< Format version."]
25046 pub version: u32_,
25047 #[doc = "< File size."]
25048 pub fileSize: u32_,
25049 #[doc = "< Number of blocks."]
25050 pub nBlocks: u32_,
25051 #[doc = "< Font information."]
25052 pub finf: FINF_s,
25053}
25054#[allow(clippy::unnecessary_operation, clippy::identity_op)]
25055const _: () = {
25056 ["Size of CFNT_s"][::core::mem::size_of::<CFNT_s>() - 52usize];
25057 ["Alignment of CFNT_s"][::core::mem::align_of::<CFNT_s>() - 4usize];
25058 ["Offset of field: CFNT_s::signature"][::core::mem::offset_of!(CFNT_s, signature) - 0usize];
25059 ["Offset of field: CFNT_s::endianness"][::core::mem::offset_of!(CFNT_s, endianness) - 4usize];
25060 ["Offset of field: CFNT_s::headerSize"][::core::mem::offset_of!(CFNT_s, headerSize) - 6usize];
25061 ["Offset of field: CFNT_s::version"][::core::mem::offset_of!(CFNT_s, version) - 8usize];
25062 ["Offset of field: CFNT_s::fileSize"][::core::mem::offset_of!(CFNT_s, fileSize) - 12usize];
25063 ["Offset of field: CFNT_s::nBlocks"][::core::mem::offset_of!(CFNT_s, nBlocks) - 16usize];
25064 ["Offset of field: CFNT_s::finf"][::core::mem::offset_of!(CFNT_s, finf) - 20usize];
25065};
25066impl Default for CFNT_s {
25067 fn default() -> Self {
25068 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
25069 unsafe {
25070 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
25071 s.assume_init()
25072 }
25073 }
25074}
25075#[doc = "Font glyph position structure."]
25076#[repr(C)]
25077#[derive(Debug, Default, Copy, Clone)]
25078pub struct fontGlyphPos_s {
25079 #[doc = "< Texture sheet index to use to render the glyph."]
25080 pub sheetIndex: ::libc::c_int,
25081 #[doc = "< Horizontal offset to draw the glyph width."]
25082 pub xOffset: f32,
25083 #[doc = "< Horizontal distance to advance after drawing the glyph."]
25084 pub xAdvance: f32,
25085 #[doc = "< Glyph width."]
25086 pub width: f32,
25087 pub texcoord: fontGlyphPos_s__bindgen_ty_1,
25088 pub vtxcoord: fontGlyphPos_s__bindgen_ty_2,
25089}
25090#[doc = "Texture coordinates to use to render the glyph."]
25091#[repr(C)]
25092#[derive(Debug, Default, Copy, Clone)]
25093pub struct fontGlyphPos_s__bindgen_ty_1 {
25094 pub left: f32,
25095 pub top: f32,
25096 pub right: f32,
25097 pub bottom: f32,
25098}
25099#[allow(clippy::unnecessary_operation, clippy::identity_op)]
25100const _: () = {
25101 ["Size of fontGlyphPos_s__bindgen_ty_1"]
25102 [::core::mem::size_of::<fontGlyphPos_s__bindgen_ty_1>() - 16usize];
25103 ["Alignment of fontGlyphPos_s__bindgen_ty_1"]
25104 [::core::mem::align_of::<fontGlyphPos_s__bindgen_ty_1>() - 4usize];
25105 ["Offset of field: fontGlyphPos_s__bindgen_ty_1::left"]
25106 [::core::mem::offset_of!(fontGlyphPos_s__bindgen_ty_1, left) - 0usize];
25107 ["Offset of field: fontGlyphPos_s__bindgen_ty_1::top"]
25108 [::core::mem::offset_of!(fontGlyphPos_s__bindgen_ty_1, top) - 4usize];
25109 ["Offset of field: fontGlyphPos_s__bindgen_ty_1::right"]
25110 [::core::mem::offset_of!(fontGlyphPos_s__bindgen_ty_1, right) - 8usize];
25111 ["Offset of field: fontGlyphPos_s__bindgen_ty_1::bottom"]
25112 [::core::mem::offset_of!(fontGlyphPos_s__bindgen_ty_1, bottom) - 12usize];
25113};
25114#[doc = "Vertex coordinates to use to render the glyph."]
25115#[repr(C)]
25116#[derive(Debug, Default, Copy, Clone)]
25117pub struct fontGlyphPos_s__bindgen_ty_2 {
25118 pub left: f32,
25119 pub top: f32,
25120 pub right: f32,
25121 pub bottom: f32,
25122}
25123#[allow(clippy::unnecessary_operation, clippy::identity_op)]
25124const _: () = {
25125 ["Size of fontGlyphPos_s__bindgen_ty_2"]
25126 [::core::mem::size_of::<fontGlyphPos_s__bindgen_ty_2>() - 16usize];
25127 ["Alignment of fontGlyphPos_s__bindgen_ty_2"]
25128 [::core::mem::align_of::<fontGlyphPos_s__bindgen_ty_2>() - 4usize];
25129 ["Offset of field: fontGlyphPos_s__bindgen_ty_2::left"]
25130 [::core::mem::offset_of!(fontGlyphPos_s__bindgen_ty_2, left) - 0usize];
25131 ["Offset of field: fontGlyphPos_s__bindgen_ty_2::top"]
25132 [::core::mem::offset_of!(fontGlyphPos_s__bindgen_ty_2, top) - 4usize];
25133 ["Offset of field: fontGlyphPos_s__bindgen_ty_2::right"]
25134 [::core::mem::offset_of!(fontGlyphPos_s__bindgen_ty_2, right) - 8usize];
25135 ["Offset of field: fontGlyphPos_s__bindgen_ty_2::bottom"]
25136 [::core::mem::offset_of!(fontGlyphPos_s__bindgen_ty_2, bottom) - 12usize];
25137};
25138#[allow(clippy::unnecessary_operation, clippy::identity_op)]
25139const _: () = {
25140 ["Size of fontGlyphPos_s"][::core::mem::size_of::<fontGlyphPos_s>() - 48usize];
25141 ["Alignment of fontGlyphPos_s"][::core::mem::align_of::<fontGlyphPos_s>() - 4usize];
25142 ["Offset of field: fontGlyphPos_s::sheetIndex"]
25143 [::core::mem::offset_of!(fontGlyphPos_s, sheetIndex) - 0usize];
25144 ["Offset of field: fontGlyphPos_s::xOffset"]
25145 [::core::mem::offset_of!(fontGlyphPos_s, xOffset) - 4usize];
25146 ["Offset of field: fontGlyphPos_s::xAdvance"]
25147 [::core::mem::offset_of!(fontGlyphPos_s, xAdvance) - 8usize];
25148 ["Offset of field: fontGlyphPos_s::width"]
25149 [::core::mem::offset_of!(fontGlyphPos_s, width) - 12usize];
25150 ["Offset of field: fontGlyphPos_s::texcoord"]
25151 [::core::mem::offset_of!(fontGlyphPos_s, texcoord) - 16usize];
25152 ["Offset of field: fontGlyphPos_s::vtxcoord"]
25153 [::core::mem::offset_of!(fontGlyphPos_s, vtxcoord) - 32usize];
25154};
25155#[doc = "< Calculates vertex coordinates in addition to texture coordinates."]
25156pub const GLYPH_POS_CALC_VTXCOORD: _bindgen_ty_38 = 1;
25157#[doc = "< Position the glyph at the baseline instead of at the top-left corner."]
25158pub const GLYPH_POS_AT_BASELINE: _bindgen_ty_38 = 2;
25159#[doc = "< Indicates that the Y axis points up instead of down."]
25160pub const GLYPH_POS_Y_POINTS_UP: _bindgen_ty_38 = 4;
25161#[doc = "Flags for use with fontCalcGlyphPos."]
25162pub type _bindgen_ty_38 = ::libc::c_uchar;
25163unsafe extern "C" {
25164 #[must_use]
25165 #[doc = "Ensures the shared system font is mapped."]
25166 pub fn fontEnsureMapped() -> Result;
25167}
25168unsafe extern "C" {
25169 #[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."]
25170 pub fn fontFixPointers(font: *mut CFNT_s);
25171}
25172unsafe extern "C" {
25173 #[doc = "Gets the currently loaded system font"]
25174 #[link_name = "fontGetSystemFont__extern"]
25175 pub fn fontGetSystemFont() -> *mut CFNT_s;
25176}
25177unsafe extern "C" {
25178 #[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."]
25179 #[link_name = "fontGetInfo__extern"]
25180 pub fn fontGetInfo(font: *mut CFNT_s) -> *mut FINF_s;
25181}
25182unsafe extern "C" {
25183 #[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."]
25184 #[link_name = "fontGetGlyphInfo__extern"]
25185 pub fn fontGetGlyphInfo(font: *mut CFNT_s) -> *mut TGLP_s;
25186}
25187unsafe extern "C" {
25188 #[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."]
25189 #[link_name = "fontGetGlyphSheetTex__extern"]
25190 pub fn fontGetGlyphSheetTex(
25191 font: *mut CFNT_s,
25192 sheetIndex: ::libc::c_int,
25193 ) -> *mut ::libc::c_void;
25194}
25195unsafe extern "C" {
25196 #[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."]
25197 pub fn fontGlyphIndexFromCodePoint(font: *mut CFNT_s, codePoint: u32_) -> ::libc::c_int;
25198}
25199unsafe extern "C" {
25200 #[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."]
25201 pub fn fontGetCharWidthInfo(
25202 font: *mut CFNT_s,
25203 glyphIndex: ::libc::c_int,
25204 ) -> *mut charWidthInfo_s;
25205}
25206unsafe extern "C" {
25207 #[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."]
25208 pub fn fontCalcGlyphPos(
25209 out: *mut fontGlyphPos_s,
25210 font: *mut CFNT_s,
25211 glyphIndex: ::libc::c_int,
25212 flags: u32_,
25213 scaleX: f32,
25214 scaleY: f32,
25215 );
25216}
25217unsafe extern "C" {
25218 pub fn gdbHioDevInit() -> ::libc::c_int;
25219}
25220unsafe extern "C" {
25221 pub fn gdbHioDevExit();
25222}
25223unsafe extern "C" {
25224 pub fn gdbHioDevGetStdin() -> ::libc::c_int;
25225}
25226unsafe extern "C" {
25227 pub fn gdbHioDevGetStdout() -> ::libc::c_int;
25228}
25229unsafe extern "C" {
25230 pub fn gdbHioDevGetStderr() -> ::libc::c_int;
25231}
25232unsafe extern "C" {
25233 pub fn gdbHioDevRedirectStdStreams(in_: bool, out: bool, err: bool) -> ::libc::c_int;
25234}
25235unsafe extern "C" {
25236 pub fn gdbHioDevGettimeofday(tv: *mut timeval, tz: *mut ::libc::c_void) -> ::libc::c_int;
25237}
25238unsafe extern "C" {
25239 pub fn gdbHioDevIsatty(fd: ::libc::c_int) -> ::libc::c_int;
25240}
25241unsafe extern "C" {
25242 pub fn gdbHioDevSystem(command: *const ::libc::c_char) -> ::libc::c_int;
25243}
25244unsafe extern "C" {
25245 #[doc = "Address of the host connected through 3dslink"]
25246 pub static mut __3dslink_host: in_addr;
25247}
25248unsafe extern "C" {
25249 #[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."]
25250 pub fn link3dsConnectToHost(redirStdout: bool, redirStderr: bool) -> ::libc::c_int;
25251}
25252unsafe extern "C" {
25253 #[doc = "Same as link3dsConnectToHost but redirecting both stdout/stderr."]
25254 #[link_name = "link3dsStdio__extern"]
25255 pub fn link3dsStdio() -> ::libc::c_int;
25256}
25257unsafe extern "C" {
25258 #[doc = "Same as link3dsConnectToHost but redirecting only stderr."]
25259 #[link_name = "link3dsStdioForDebug__extern"]
25260 pub fn link3dsStdioForDebug() -> ::libc::c_int;
25261}
25262unsafe extern "C" {
25263 pub fn __errno() -> *mut ::libc::c_int;
25264}