xref: /rust-libc-0.2.174/src/psp.rs (revision fc1f81dc)
1 //! PSP C type definitions
2 //!
3 //! These type declarations are not enough, as they must be ultimately resolved
4 //! by the linker. Crates that use these definitions must, somewhere in the
5 //! crate graph, include a stub provider crate such as the `psp` crate.
6 
7 pub type c_schar = i8;
8 pub type c_uchar = u8;
9 pub type c_short = i16;
10 pub type c_ushort = u16;
11 pub type c_int = i32;
12 pub type c_uint = u32;
13 pub type c_float = f32;
14 pub type c_double = f64;
15 pub type c_longlong = i64;
16 pub type c_ulonglong = u64;
17 pub type intmax_t = i64;
18 pub type uintmax_t = u64;
19 
20 pub type size_t = usize;
21 pub type ptrdiff_t = isize;
22 pub type intptr_t = isize;
23 pub type uintptr_t = usize;
24 pub type ssize_t = isize;
25 
26 pub type c_char = u8;
27 pub type c_long = i64;
28 pub type c_ulong = u64;
29 
30 cfg_if! {
31     if #[cfg(libc_core_cvoid)] {
32         pub use ::ffi::c_void;
33     } else {
34         // Use repr(u8) as LLVM expects `void*` to be the same as `i8*` to help
35         // enable more optimization opportunities around it recognizing things
36         // like malloc/free.
37         #[repr(u8)]
38         #[allow(missing_copy_implementations)]
39         #[allow(missing_debug_implementations)]
40         pub enum c_void {
41             // Two dummy variants so the #[repr] attribute can be used.
42             #[doc(hidden)]
43             __variant1,
44             #[doc(hidden)]
45             __variant2,
46         }
47     }
48 }
49 
50 pub type SceKernelVTimerHandler = unsafe extern "C" fn(
51     uid: SceUid,
52     arg1: *mut SceKernelSysClock,
53     arg2: *mut SceKernelSysClock,
54     arg3: *mut c_void,
55 ) -> u32;
56 
57 pub type SceKernelVTimerHandlerWide = unsafe extern "C" fn(
58     uid: SceUid,
59     arg1: i64,
60     arg2: i64,
61     arg3: *mut c_void,
62 ) -> u32;
63 
64 pub type SceKernelThreadEventHandler =
65     unsafe extern "C" fn(mask: i32, thid: SceUid, common: *mut c_void) -> i32;
66 
67 pub type SceKernelAlarmHandler =
68     unsafe extern "C" fn(common: *mut c_void) -> u32;
69 
70 pub type SceKernelCallbackFunction =
71     unsafe extern "C" fn(arg1: i32, arg2: i32, arg: *mut c_void) -> i32;
72 
73 pub type SceKernelThreadEntry =
74     unsafe extern "C" fn(args: usize, argp: *mut c_void) -> i32;
75 
76 pub type PowerCallback = extern "C" fn(unknown: i32, power_info: i32);
77 
78 pub type IoPermissions = i32;
79 
80 pub type UmdCallback = fn(unknown: i32, event: i32) -> i32;
81 
82 pub type SceMpegRingbufferCb = ::Option<
83     unsafe extern "C" fn(
84         data: *mut c_void,
85         num_packets: i32,
86         param: *mut c_void,
87     ) -> i32,
88 >;
89 
90 pub type GuCallback = ::Option<extern "C" fn(id: i32, arg: *mut c_void)>;
91 pub type GuSwapBuffersCallback = ::Option<extern "C" fn(
92         display: *mut *mut c_void, render: *mut *mut c_void
93     ),
94 >;
95 
96 pub type SceNetAdhocctlHandler = ::Option<unsafe extern "C" fn(
97         flag: i32, error: i32, unknown: *mut c_void
98     ),
99 >;
100 
101 pub type AdhocMatchingCallback = ::Option<
102     unsafe extern "C" fn(
103         matching_id: i32,
104         event: i32,
105         mac: *mut u8,
106         opt_len: i32,
107         opt_data: *mut c_void,
108     ),
109 >;
110 
111 pub type SceNetApctlHandler = ::Option<
112     unsafe extern "C" fn(
113         oldState: i32,
114         newState: i32,
115         event: i32,
116         error: i32,
117         pArg: *mut c_void,
118     ),
119 >;
120 
121 pub type HttpMallocFunction =
122     ::Option<unsafe extern "C" fn(size: usize) -> *mut c_void>;
123 pub type HttpReallocFunction =
124     ::Option<unsafe extern "C" fn(p: *mut c_void, size: usize) -> *mut c_void>;
125 pub type HttpFreeFunction = ::Option<unsafe extern "C" fn(p: *mut c_void)>;
126 pub type HttpPasswordCB = ::Option<
127     unsafe extern "C" fn(
128         request: i32,
129         auth_type: HttpAuthType,
130         realm: *const u8,
131         username: *mut u8,
132         password: *mut u8,
133         need_entity: i32,
134         entity_body: *mut *mut u8,
135         entity_size: *mut usize,
136         save: *mut i32,
137     ) -> i32,
138 >;
139 
140 pub type socklen_t = u32;
141 
142 e! {
143     #[repr(u32)]
144     pub enum AudioFormat {
145         Stereo = 0,
146         Mono = 0x10,
147     }
148 
149     #[repr(u32)]
150     pub enum DisplayMode {
151         Lcd = 0,
152     }
153 
154     #[repr(u32)]
155     pub enum DisplayPixelFormat {
156         Psm5650 = 0,
157         Psm5551 = 1,
158         Psm4444 = 2,
159         Psm8888 = 3,
160     }
161 
162     #[repr(u32)]
163     pub enum DisplaySetBufSync {
164         Immediate = 0,
165         NextFrame = 1,
166     }
167 
168     #[repr(i32)]
169     pub enum AudioOutputFrequency {
170         Khz48 = 48000,
171         Khz44_1 = 44100,
172         Khz32 = 32000,
173         Khz24 = 24000,
174         Khz22_05 = 22050,
175         Khz16 = 16000,
176         Khz12 = 12000,
177         Khz11_025 = 11025,
178         Khz8 = 8000,
179     }
180 
181     #[repr(i32)]
182     pub enum AudioInputFrequency {
183         Khz44_1 = 44100,
184         Khz22_05 = 22050,
185         Khz11_025 = 11025,
186     }
187 
188     #[repr(u32)]
189     pub enum CtrlMode {
190         Digital = 0,
191         Analog,
192     }
193 
194     #[repr(i32)]
195     pub enum GeMatrixType {
196         Bone0 = 0,
197         Bone1,
198         Bone2,
199         Bone3,
200         Bone4,
201         Bone5,
202         Bone6,
203         Bone7,
204         World,
205         View,
206         Projection,
207         TexGen,
208     }
209 
210     #[repr(i32)]
211     pub enum GeListState {
212         Done = 0,
213         Queued,
214         DrawingDone,
215         StallReached,
216         CancelDone,
217     }
218 
219     #[repr(u8)]
220     pub enum GeCommand {
221         Nop = 0,
222         Vaddr = 0x1,
223         Iaddr = 0x2,
224         Prim = 0x4,
225         Bezier = 0x5,
226         Spline = 0x6,
227         BoundingBox = 0x7,
228         Jump = 0x8,
229         BJump = 0x9,
230         Call = 0xa,
231         Ret = 0xb,
232         End = 0xc,
233         Signal = 0xe,
234         Finish = 0xf,
235         Base = 0x10,
236         VertexType = 0x12,
237         OffsetAddr = 0x13,
238         Origin = 0x14,
239         Region1 = 0x15,
240         Region2 = 0x16,
241         LightingEnable = 0x17,
242         LightEnable0 = 0x18,
243         LightEnable1 = 0x19,
244         LightEnable2 = 0x1a,
245         LightEnable3 = 0x1b,
246         DepthClampEnable = 0x1c,
247         CullFaceEnable = 0x1d,
248         TextureMapEnable = 0x1e,
249         FogEnable = 0x1f,
250         DitherEnable = 0x20,
251         AlphaBlendEnable = 0x21,
252         AlphaTestEnable = 0x22,
253         ZTestEnable = 0x23,
254         StencilTestEnable = 0x24,
255         AntiAliasEnable = 0x25,
256         PatchCullEnable = 0x26,
257         ColorTestEnable = 0x27,
258         LogicOpEnable = 0x28,
259         BoneMatrixNumber = 0x2a,
260         BoneMatrixData = 0x2b,
261         MorphWeight0 = 0x2c,
262         MorphWeight1 = 0x2d,
263         MorphWeight2 = 0x2e,
264         MorphWeight3 = 0x2f,
265         MorphWeight4 = 0x30,
266         MorphWeight5 = 0x31,
267         MorphWeight6 = 0x32,
268         MorphWeight7 = 0x33,
269         PatchDivision = 0x36,
270         PatchPrimitive = 0x37,
271         PatchFacing = 0x38,
272         WorldMatrixNumber = 0x3a,
273         WorldMatrixData = 0x3b,
274         ViewMatrixNumber = 0x3c,
275         ViewMatrixData = 0x3d,
276         ProjMatrixNumber = 0x3e,
277         ProjMatrixData = 0x3f,
278         TGenMatrixNumber = 0x40,
279         TGenMatrixData = 0x41,
280         ViewportXScale = 0x42,
281         ViewportYScale = 0x43,
282         ViewportZScale = 0x44,
283         ViewportXCenter = 0x45,
284         ViewportYCenter = 0x46,
285         ViewportZCenter = 0x47,
286         TexScaleU = 0x48,
287         TexScaleV = 0x49,
288         TexOffsetU = 0x4a,
289         TexOffsetV = 0x4b,
290         OffsetX = 0x4c,
291         OffsetY = 0x4d,
292         ShadeMode = 0x50,
293         ReverseNormal = 0x51,
294         MaterialUpdate = 0x53,
295         MaterialEmissive = 0x54,
296         MaterialAmbient = 0x55,
297         MaterialDiffuse = 0x56,
298         MaterialSpecular = 0x57,
299         MaterialAlpha = 0x58,
300         MaterialSpecularCoef = 0x5b,
301         AmbientColor = 0x5c,
302         AmbientAlpha = 0x5d,
303         LightMode = 0x5e,
304         LightType0 = 0x5f,
305         LightType1 = 0x60,
306         LightType2 = 0x61,
307         LightType3 = 0x62,
308         Light0X = 0x63,
309         Light0Y,
310         Light0Z,
311         Light1X,
312         Light1Y,
313         Light1Z,
314         Light2X,
315         Light2Y,
316         Light2Z,
317         Light3X,
318         Light3Y,
319         Light3Z,
320         Light0DirectionX = 0x6f,
321         Light0DirectionY,
322         Light0DirectionZ,
323         Light1DirectionX,
324         Light1DirectionY,
325         Light1DirectionZ,
326         Light2DirectionX,
327         Light2DirectionY,
328         Light2DirectionZ,
329         Light3DirectionX,
330         Light3DirectionY,
331         Light3DirectionZ,
332         Light0ConstantAtten = 0x7b,
333         Light0LinearAtten,
334         Light0QuadtraticAtten,
335         Light1ConstantAtten,
336         Light1LinearAtten,
337         Light1QuadtraticAtten,
338         Light2ConstantAtten,
339         Light2LinearAtten,
340         Light2QuadtraticAtten,
341         Light3ConstantAtten,
342         Light3LinearAtten,
343         Light3QuadtraticAtten,
344         Light0ExponentAtten = 0x87,
345         Light1ExponentAtten,
346         Light2ExponentAtten,
347         Light3ExponentAtten,
348         Light0CutoffAtten = 0x8b,
349         Light1CutoffAtten,
350         Light2CutoffAtten,
351         Light3CutoffAtten,
352         Light0Ambient = 0x8f,
353         Light0Diffuse,
354         Light0Specular,
355         Light1Ambient,
356         Light1Diffuse,
357         Light1Specular,
358         Light2Ambient,
359         Light2Diffuse,
360         Light2Specular,
361         Light3Ambient,
362         Light3Diffuse,
363         Light3Specular,
364         Cull = 0x9b,
365         FrameBufPtr = 0x9c,
366         FrameBufWidth = 0x9d,
367         ZBufPtr = 0x9e,
368         ZBufWidth = 0x9f,
369         TexAddr0 = 0xa0,
370         TexAddr1,
371         TexAddr2,
372         TexAddr3,
373         TexAddr4,
374         TexAddr5,
375         TexAddr6,
376         TexAddr7,
377         TexBufWidth0 = 0xa8,
378         TexBufWidth1,
379         TexBufWidth2,
380         TexBufWidth3,
381         TexBufWidth4,
382         TexBufWidth5,
383         TexBufWidth6,
384         TexBufWidth7,
385         ClutAddr = 0xb0,
386         ClutAddrUpper = 0xb1,
387         TransferSrc,
388         TransferSrcW,
389         TransferDst,
390         TransferDstW,
391         TexSize0 = 0xb8,
392         TexSize1,
393         TexSize2,
394         TexSize3,
395         TexSize4,
396         TexSize5,
397         TexSize6,
398         TexSize7,
399         TexMapMode = 0xc0,
400         TexShadeLs = 0xc1,
401         TexMode = 0xc2,
402         TexFormat = 0xc3,
403         LoadClut = 0xc4,
404         ClutFormat = 0xc5,
405         TexFilter = 0xc6,
406         TexWrap = 0xc7,
407         TexLevel = 0xc8,
408         TexFunc = 0xc9,
409         TexEnvColor = 0xca,
410         TexFlush = 0xcb,
411         TexSync = 0xcc,
412         Fog1 = 0xcd,
413         Fog2 = 0xce,
414         FogColor = 0xcf,
415         TexLodSlope = 0xd0,
416         FramebufPixFormat = 0xd2,
417         ClearMode = 0xd3,
418         Scissor1 = 0xd4,
419         Scissor2 = 0xd5,
420         MinZ = 0xd6,
421         MaxZ = 0xd7,
422         ColorTest = 0xd8,
423         ColorRef = 0xd9,
424         ColorTestmask = 0xda,
425         AlphaTest = 0xdb,
426         StencilTest = 0xdc,
427         StencilOp = 0xdd,
428         ZTest = 0xde,
429         BlendMode = 0xdf,
430         BlendFixedA = 0xe0,
431         BlendFixedB = 0xe1,
432         Dith0 = 0xe2,
433         Dith1,
434         Dith2,
435         Dith3,
436         LogicOp = 0xe6,
437         ZWriteDisable = 0xe7,
438         MaskRgb = 0xe8,
439         MaskAlpha = 0xe9,
440         TransferStart = 0xea,
441         TransferSrcPos = 0xeb,
442         TransferDstPos = 0xec,
443         TransferSize = 0xee,
444         Vscx = 0xf0,
445         Vscy = 0xf1,
446         Vscz = 0xf2,
447         Vtcs = 0xf3,
448         Vtct = 0xf4,
449         Vtcq = 0xf5,
450         Vcv = 0xf6,
451         Vap = 0xf7,
452         Vfc = 0xf8,
453         Vscv = 0xf9,
454 
455         Unknown03 = 0x03,
456         Unknown0D = 0x0d,
457         Unknown11 = 0x11,
458         Unknown29 = 0x29,
459         Unknown34 = 0x34,
460         Unknown35 = 0x35,
461         Unknown39 = 0x39,
462         Unknown4E = 0x4e,
463         Unknown4F = 0x4f,
464         Unknown52 = 0x52,
465         Unknown59 = 0x59,
466         Unknown5A = 0x5a,
467         UnknownB6 = 0xb6,
468         UnknownB7 = 0xb7,
469         UnknownD1 = 0xd1,
470         UnknownED = 0xed,
471         UnknownEF = 0xef,
472         UnknownFA = 0xfa,
473         UnknownFB = 0xfb,
474         UnknownFC = 0xfc,
475         UnknownFD = 0xfd,
476         UnknownFE = 0xfe,
477         NopFF = 0xff,
478     }
479 
480     #[repr(i32)]
481     pub enum SceSysMemPartitionId {
482         SceKernelUnknownPartition = 0,
483         SceKernelPrimaryKernelPartition = 1,
484         SceKernelPrimaryUserPartition = 2,
485         SceKernelOtherKernelPartition1 = 3,
486         SceKernelOtherKernelPartition2 = 4,
487         SceKernelVshellPARTITION = 5,
488         SceKernelScUserPartition = 6,
489         SceKernelMeUserPartition = 7,
490         SceKernelExtendedScKernelPartition = 8,
491         SceKernelExtendedSc2KernelPartition = 9,
492         SceKernelExtendedMeKernelPartition = 10,
493         SceKernelVshellKernelPartition = 11,
494         SceKernelExtendedKernelPartition = 12,
495     }
496 
497     #[repr(i32)]
498     pub enum SceSysMemBlockTypes {
499         Low = 0,
500         High,
501         Addr,
502     }
503 
504     #[repr(u32)]
505     pub enum Interrupt {
506         Gpio = 4,
507         Ata = 5,
508         Umd = 6,
509         Mscm0 = 7,
510         Wlan = 8,
511         Audio = 10,
512         I2c = 12,
513         Sircs = 14,
514         Systimer0 = 15,
515         Systimer1 = 16,
516         Systimer2 = 17,
517         Systimer3 = 18,
518         Thread0 = 19,
519         Nand = 20,
520         Dmacplus = 21,
521         Dma0 = 22,
522         Dma1 = 23,
523         Memlmd = 24,
524         Ge = 25,
525         Vblank = 30,
526         Mecodec = 31,
527         Hpremote = 36,
528         Mscm1 = 60,
529         Mscm2 = 61,
530         Thread1 = 65,
531         Interrupt = 66,
532     }
533 
534     #[repr(u32)]
535     pub enum SubInterrupt {
536         Gpio = Interrupt::Gpio as u32,
537         Ata = Interrupt::Ata as u32,
538         Umd = Interrupt::Umd as u32,
539         Dmacplus = Interrupt::Dmacplus as u32,
540         Ge = Interrupt::Ge as u32,
541         Display = Interrupt::Vblank as u32,
542     }
543 
544     #[repr(u32)]
545     pub enum SceKernelIdListType {
546         Thread = 1,
547         Semaphore = 2,
548         EventFlag = 3,
549         Mbox = 4,
550         Vpl = 5,
551         Fpl = 6,
552         Mpipe = 7,
553         Callback = 8,
554         ThreadEventHandler = 9,
555         Alarm = 10,
556         VTimer = 11,
557         SleepThread = 64,
558         DelayThread = 65,
559         SuspendThread = 66,
560         DormantThread = 67,
561     }
562 
563     #[repr(i32)]
564     pub enum UsbCamResolution {
565         Px160_120 = 0,
566         Px176_144 = 1,
567         Px320_240 = 2,
568         Px352_288 = 3,
569         Px640_480 = 4,
570         Px1024_768 = 5,
571         Px1280_960 = 6,
572         Px480_272 = 7,
573         Px360_272 = 8,
574     }
575 
576     #[repr(i32)]
577     pub enum UsbCamResolutionEx {
578         Px160_120 = 0,
579         Px176_144 = 1,
580         Px320_240 = 2,
581         Px352_288 = 3,
582         Px360_272 = 4,
583         Px480_272 = 5,
584         Px640_480 = 6,
585         Px1024_768 = 7,
586         Px1280_960 = 8,
587     }
588 
589     #[repr(i32)]
590     pub enum UsbCamDelay {
591         NoDelay = 0,
592         Delay10Sec = 1,
593         Delay20Sec = 2,
594         Delay30Sec = 3,
595     }
596 
597     #[repr(i32)]
598     pub enum UsbCamFrameRate {
599         Fps3_75 = 0,
600         Fps5 = 1,
601         Fps7_5 = 2,
602         Fps10 = 3,
603         Fps15 = 4,
604         Fps20 = 5,
605         Fps30 = 6,
606         Fps60 = 7,
607     }
608 
609     #[repr(i32)]
610     pub enum UsbCamWb {
611         Auto = 0,
612         Daylight = 1,
613         Fluorescent = 2,
614         Incadescent = 3,
615     }
616 
617     #[repr(i32)]
618     pub enum UsbCamEffectMode {
619         Normal = 0,
620         Negative = 1,
621         Blackwhite = 2,
622         Sepia = 3,
623         Blue = 4,
624         Red = 5,
625         Green = 6,
626     }
627 
628     #[repr(i32)]
629     pub enum UsbCamEvLevel {
630         Pos2_0 = 0,
631         Pos1_7 = 1,
632         Pos1_5 = 2,
633         Pos1_3 = 3,
634         Pos1_0 = 4,
635         Pos0_7 = 5,
636         Pos0_5 = 6,
637         Pos0_3 = 7,
638         Zero = 8,
639         Neg0_3,
640         Neg0_5,
641         Neg0_7,
642         Neg1_0,
643         Neg1_3,
644         Neg1_5,
645         Neg1_7,
646         Neg2_0,
647     }
648 
649     #[repr(i32)]
650     pub enum RtcCheckValidError {
651         InvalidYear = -1,
652         InvalidMonth = -2,
653         InvalidDay = -3,
654         InvalidHour = -4,
655         InvalidMinutes = -5,
656         InvalidSeconds = -6,
657         InvalidMicroseconds = -7,
658     }
659 
660     #[repr(u32)]
661     pub enum PowerTick {
662         All = 0,
663         Suspend = 1,
664         Display = 6,
665     }
666 
667     #[repr(u32)]
668     pub enum IoAssignPerms {
669         RdWr = 0,
670         RdOnly = 1,
671     }
672 
673     #[repr(u32)]
674     pub enum IoWhence {
675         Set = 0,
676         Cur = 1,
677         End = 2,
678     }
679 
680     #[repr(u32)]
681     pub enum UmdType {
682         Game = 0x10,
683         Video = 0x20,
684         Audio = 0x40,
685     }
686 
687     #[repr(u32)]
688     pub enum GuPrimitive {
689         Points = 0,
690         Lines = 1,
691         LineStrip = 2,
692         Triangles = 3,
693         TriangleStrip = 4,
694         TriangleFan = 5,
695         Sprites = 6,
696     }
697 
698     #[repr(u32)]
699     pub enum PatchPrimitive {
700         Points = 0,
701         LineStrip = 2,
702         TriangleStrip = 4,
703     }
704 
705     #[repr(u32)]
706     pub enum GuState {
707         AlphaTest = 0,
708         DepthTest = 1,
709         ScissorTest = 2,
710         StencilTest = 3,
711         Blend = 4,
712         CullFace = 5,
713         Dither = 6,
714         Fog = 7,
715         ClipPlanes = 8,
716         Texture2D = 9,
717         Lighting = 10,
718         Light0 = 11,
719         Light1 = 12,
720         Light2 = 13,
721         Light3 = 14,
722         LineSmooth = 15,
723         PatchCullFace = 16,
724         ColorTest = 17,
725         ColorLogicOp = 18,
726         FaceNormalReverse = 19,
727         PatchFace = 20,
728         Fragment2X = 21,
729     }
730 
731     #[repr(u32)]
732     pub enum MatrixMode {
733         Projection = 0,
734         View = 1,
735         Model = 2,
736         Texture = 3,
737     }
738 
739     #[repr(u32)]
740     pub enum TexturePixelFormat {
741         Psm5650 = 0,
742         Psm5551 = 1,
743         Psm4444 = 2,
744         Psm8888 = 3,
745         PsmT4 = 4,
746         PsmT8 = 5,
747         PsmT16 = 6,
748         PsmT32 = 7,
749         PsmDxt1 = 8,
750         PsmDxt3 = 9,
751         PsmDxt5 = 10,
752     }
753 
754     #[repr(u32)]
755     pub enum SplineMode {
756         FillFill = 0,
757         OpenFill = 1,
758         FillOpen = 2,
759         OpenOpen = 3,
760     }
761 
762     #[repr(u32)]
763     pub enum ShadingModel {
764         Flat = 0,
765         Smooth = 1,
766     }
767 
768     #[repr(u32)]
769     pub enum LogicalOperation {
770         Clear = 0,
771         And = 1,
772         AndReverse = 2,
773         Copy = 3,
774         AndInverted = 4,
775         Noop = 5,
776         Xor = 6,
777         Or = 7,
778         Nor = 8,
779         Equiv = 9,
780         Inverted = 10,
781         OrReverse = 11,
782         CopyInverted = 12,
783         OrInverted = 13,
784         Nand = 14,
785         Set = 15,
786     }
787 
788     #[repr(u32)]
789     pub enum TextureFilter {
790         Nearest = 0,
791         Linear = 1,
792         NearestMipmapNearest = 4,
793         LinearMipmapNearest = 5,
794         NearestMipmapLinear = 6,
795         LinearMipmapLinear = 7,
796     }
797 
798     #[repr(u32)]
799     pub enum TextureMapMode {
800         TextureCoords = 0,
801         TextureMatrix = 1,
802         EnvironmentMap = 2,
803     }
804 
805     #[repr(u32)]
806     pub enum TextureLevelMode {
807         Auto = 0,
808         Const = 1,
809         Slope = 2,
810     }
811 
812     #[repr(u32)]
813     pub enum TextureProjectionMapMode {
814         Position = 0,
815         Uv = 1,
816         NormalizedNormal = 2,
817         Normal = 3,
818     }
819 
820     #[repr(u32)]
821     pub enum GuTexWrapMode {
822         Repeat = 0,
823         Clamp = 1,
824     }
825 
826     #[repr(u32)]
827     pub enum FrontFaceDirection {
828         Clockwise = 0,
829         CounterClockwise = 1,
830     }
831 
832     #[repr(u32)]
833     pub enum AlphaFunc {
834         Never = 0,
835         Always,
836         Equal,
837         NotEqual,
838         Less,
839         LessOrEqual,
840         Greater,
841         GreaterOrEqual,
842     }
843 
844     #[repr(u32)]
845     pub enum StencilFunc {
846         Never = 0,
847         Always,
848         Equal,
849         NotEqual,
850         Less,
851         LessOrEqual,
852         Greater,
853         GreaterOrEqual,
854     }
855 
856     #[repr(u32)]
857     pub enum ColorFunc {
858         Never = 0,
859         Always,
860         Equal,
861         NotEqual,
862     }
863 
864     #[repr(u32)]
865     pub enum DepthFunc {
866         Never = 0,
867         Always,
868         Equal,
869         NotEqual,
870         Less,
871         LessOrEqual,
872         Greater,
873         GreaterOrEqual,
874     }
875 
876     #[repr(u32)]
877     pub enum TextureEffect {
878         Modulate = 0,
879         Decal = 1,
880         Blend = 2,
881         Replace = 3,
882         Add = 4,
883     }
884 
885     #[repr(u32)]
886     pub enum TextureColorComponent {
887         Rgb = 0,
888         Rgba = 1,
889     }
890 
891     #[repr(u32)]
892     pub enum MipmapLevel {
893         None = 0,
894         Level1,
895         Level2,
896         Level3,
897         Level4,
898         Level5,
899         Level6,
900         Level7,
901     }
902 
903     #[repr(u32)]
904     pub enum BlendOp {
905         Add = 0,
906         Subtract = 1,
907         ReverseSubtract = 2,
908         Min = 3,
909         Max = 4,
910         Abs = 5,
911     }
912 
913     #[repr(u32)]
914     pub enum BlendSrc {
915         SrcColor = 0,
916         OneMinusSrcColor = 1,
917         SrcAlpha = 2,
918         OneMinusSrcAlpha = 3,
919         Fix = 10,
920     }
921 
922     #[repr(u32)]
923     pub enum BlendDst {
924         DstColor = 0,
925         OneMinusDstColor = 1,
926         DstAlpha = 4,
927         OneMinusDstAlpha = 5,
928         Fix = 10,
929     }
930 
931     #[repr(u32)]
932     pub enum StencilOperation {
933         Keep = 0,
934         Zero = 1,
935         Replace = 2,
936         Invert = 3,
937         Incr = 4,
938         Decr = 5,
939     }
940 
941     #[repr(u32)]
942     pub enum LightMode {
943         SingleColor = 0,
944         SeparateSpecularColor = 1,
945     }
946 
947     #[repr(u32)]
948     pub enum LightType {
949         Directional = 0,
950         Pointlight = 1,
951         Spotlight = 2,
952     }
953 
954     #[repr(u32)]
955     pub enum GuContextType {
956         Direct = 0,
957         Call = 1,
958         Send = 2,
959     }
960 
961     #[repr(u32)]
962     pub enum GuQueueMode {
963         Tail = 0,
964         Head = 1,
965     }
966 
967     #[repr(u32)]
968     pub enum GuSyncMode {
969         Finish = 0,
970         Signal = 1,
971         Done = 2,
972         List = 3,
973         Send = 4,
974     }
975 
976     #[repr(u32)]
977     pub enum GuSyncBehavior {
978         Wait = 0,
979         NoWait = 1,
980     }
981 
982     #[repr(u32)]
983     pub enum GuCallbackId {
984         Signal = 1,
985         Finish = 4,
986     }
987 
988     #[repr(u32)]
989     pub enum SignalBehavior {
990         Suspend = 1,
991         Continue = 2,
992     }
993 
994     #[repr(u32)]
995     pub enum ClutPixelFormat {
996         Psm5650 = 0,
997         Psm5551 = 1,
998         Psm4444 = 2,
999         Psm8888 = 3,
1000     }
1001 
1002     #[repr(C)]
1003     pub enum KeyType {
1004         Directory = 1,
1005         Integer = 2,
1006         String = 3,
1007         Bytes = 4,
1008     }
1009 
1010     #[repr(u32)]
1011     pub enum UtilityMsgDialogMode {
1012         Error,
1013         Text,
1014     }
1015 
1016     #[repr(u32)]
1017     pub enum UtilityMsgDialogPressed {
1018         Unknown1,
1019         Yes,
1020         No,
1021         Back,
1022     }
1023 
1024     #[repr(u32)]
1025     pub enum UtilityDialogButtonAccept {
1026         Circle,
1027         Cross,
1028     }
1029 
1030     #[repr(u32)]
1031     pub enum SceUtilityOskInputLanguage {
1032         Default,
1033         Japanese,
1034         English,
1035         French,
1036         Spanish,
1037         German,
1038         Italian,
1039         Dutch,
1040         Portugese,
1041         Russian,
1042         Korean,
1043     }
1044 
1045     #[repr(u32)]
1046     pub enum SceUtilityOskInputType {
1047         All,
1048         LatinDigit,
1049         LatinSymbol,
1050         LatinLowercase = 4,
1051         LatinUppercase = 8,
1052         JapaneseDigit = 0x100,
1053         JapaneseSymbol = 0x200,
1054         JapaneseLowercase = 0x400,
1055         JapaneseUppercase = 0x800,
1056         JapaneseHiragana = 0x1000,
1057         JapaneseHalfWidthKatakana = 0x2000,
1058         JapaneseKatakana = 0x4000,
1059         JapaneseKanji = 0x8000,
1060         RussianLowercase = 0x10000,
1061         RussianUppercase = 0x20000,
1062         Korean = 0x40000,
1063         Url = 0x80000,
1064     }
1065 
1066     #[repr(u32)]
1067     pub enum SceUtilityOskState {
1068         None,
1069         Initializing,
1070         Initialized,
1071         Visible,
1072         Quit,
1073         Finished,
1074     }
1075 
1076     #[repr(u32)]
1077     pub enum SceUtilityOskResult {
1078         Unchanged,
1079         Cancelled,
1080         Changed,
1081     }
1082 
1083     #[repr(u32)]
1084     pub enum SystemParamLanguage {
1085         Japanese,
1086         English,
1087         French,
1088         Spanish,
1089         German,
1090         Italian,
1091         Dutch,
1092         Portugese,
1093         Russian,
1094         Korean,
1095         ChineseTraditional,
1096         ChineseSimplified,
1097     }
1098 
1099     #[repr(u32)]
1100     pub enum SystemParamId {
1101         StringNickname = 1,
1102         AdhocChannel,
1103         WlanPowerSave,
1104         DateFormat,
1105         TimeFormat,
1106         Timezone,
1107         DaylightSavings,
1108         Language,
1109         Unknown,
1110     }
1111 
1112     #[repr(u32)]
1113     pub enum SystemParamAdhocChannel {
1114         ChannelAutomatic = 0,
1115         Channel1 = 1,
1116         Channel6 = 6,
1117         Channel11 = 11,
1118     }
1119 
1120     #[repr(u32)]
1121     pub enum SystemParamWlanPowerSaveState {
1122         Off,
1123         On,
1124     }
1125 
1126     #[repr(u32)]
1127     pub enum SystemParamDateFormat {
1128         YYYYMMDD,
1129         MMDDYYYY,
1130         DDMMYYYY,
1131     }
1132 
1133     #[repr(u32)]
1134     pub enum SystemParamTimeFormat {
1135         Hour24,
1136         Hour12,
1137     }
1138 
1139     #[repr(u32)]
1140     pub enum SystemParamDaylightSavings {
1141         Std,
1142         Dst,
1143     }
1144 
1145     #[repr(u32)]
1146     pub enum AvModule {
1147         AvCodec,
1148         SasCore,
1149         Atrac3Plus,
1150         MpegBase,
1151         Mp3,
1152         Vaudio,
1153         Aac,
1154         G729,
1155     }
1156 
1157     #[repr(u32)]
1158     pub enum Module {
1159         NetCommon = 0x100,
1160         NetAdhoc,
1161         NetInet,
1162         NetParseUri,
1163         NetHttp,
1164         NetSsl,
1165 
1166         UsbPspCm = 0x200,
1167         UsbMic,
1168         UsbCam,
1169         UsbGps,
1170 
1171         AvCodec = 0x300,
1172         AvSascore,
1173         AvAtrac3Plus,
1174         AvMpegBase,
1175         AvMp3,
1176         AvVaudio,
1177         AvAac,
1178         AvG729,
1179 
1180         NpCommon = 0x400,
1181         NpService,
1182         NpMatching2,
1183         NpDrm = 0x500,
1184 
1185         Irda = 0x600,
1186     }
1187 
1188     #[repr(u32)]
1189     pub enum NetModule {
1190         NetCommon = 1,
1191         NetAdhoc,
1192         NetInet,
1193         NetParseUri,
1194         NetHttp,
1195         NetSsl,
1196     }
1197 
1198     #[repr(u32)]
1199     pub enum UsbModule {
1200         UsbPspCm = 1,
1201         UsbAcc,
1202         UsbMic,
1203         UsbCam,
1204         UsbGps,
1205     }
1206 
1207     #[repr(u32)]
1208     pub enum NetParam {
1209         Name,
1210         Ssid,
1211         Secure,
1212         WepKey,
1213         IsStaticIp,
1214         Ip,
1215         NetMask,
1216         Route,
1217         ManualDns,
1218         PrimaryDns,
1219         SecondaryDns,
1220         ProxyUser,
1221         ProxyPass,
1222         UseProxy,
1223         ProxyServer,
1224         ProxyPort,
1225         Unknown1,
1226         Unknown2,
1227     }
1228 
1229     #[repr(u32)]
1230     pub enum UtilityNetconfAction {
1231         ConnectAP,
1232         DisplayStatus,
1233         ConnectAdhoc,
1234     }
1235 
1236     #[repr(u32)]
1237     pub enum UtilitySavedataMode {
1238         AutoLoad,
1239         AutoSave,
1240         Load,
1241         Save,
1242         ListLoad,
1243         ListSave,
1244         ListDelete,
1245         Delete,
1246     }
1247 
1248     #[repr(u32)]
1249     pub enum UtilitySavedataFocus {
1250         Unknown1,
1251         FirstList,
1252         LastList,
1253         Latest,
1254         Oldest,
1255         Unknown2,
1256         Unknown3,
1257         FirstEmpty,
1258         LastEmpty,
1259     }
1260 
1261     #[repr(u32)]
1262     pub enum UtilityGameSharingMode {
1263         Single = 1,
1264         Multiple,
1265     }
1266 
1267     #[repr(u32)]
1268     pub enum UtilityGameSharingDataType {
1269         File = 1,
1270         Memory,
1271     }
1272 
1273     #[repr(u32)]
1274     pub enum UtilityHtmlViewerInterfaceMode {
1275         Full,
1276         Limited,
1277         None,
1278     }
1279 
1280     #[repr(u32)]
1281     pub enum UtilityHtmlViewerCookieMode {
1282         Disabled = 0,
1283         Enabled,
1284         Confirm,
1285         Default,
1286     }
1287 
1288     #[repr(u32)]
1289     pub enum UtilityHtmlViewerTextSize {
1290         Large,
1291         Normal,
1292         Small,
1293     }
1294 
1295     #[repr(u32)]
1296     pub enum UtilityHtmlViewerDisplayMode {
1297         Normal,
1298         Fit,
1299         SmartFit,
1300     }
1301 
1302     #[repr(u32)]
1303     pub enum UtilityHtmlViewerConnectMode {
1304         Last,
1305         ManualOnce,
1306         ManualAll,
1307     }
1308 
1309     #[repr(u32)]
1310     pub enum UtilityHtmlViewerDisconnectMode {
1311         Enable,
1312         Disable,
1313         Confirm,
1314     }
1315 
1316     #[repr(u32)]
1317     pub enum ScePspnetAdhocPtpState {
1318         Closed,
1319         Listen,
1320         SynSent,
1321         SynReceived,
1322         Established,
1323     }
1324 
1325     #[repr(u32)]
1326     pub enum AdhocMatchingMode {
1327         Host = 1,
1328         Client,
1329         Ptp,
1330     }
1331 
1332     #[repr(u32)]
1333     pub enum ApctlState {
1334         Disconnected,
1335         Scanning,
1336         Joining,
1337         GettingIp,
1338         GotIp,
1339         EapAuth,
1340         KeyExchange,
1341     }
1342 
1343     #[repr(u32)]
1344     pub enum ApctlEvent {
1345         ConnectRequest,
1346         ScanRequest,
1347         ScanComplete,
1348         Established,
1349         GetIp,
1350         DisconnectRequest,
1351         Error,
1352         Info,
1353         EapAuth,
1354         KeyExchange,
1355         Reconnect,
1356     }
1357 
1358     #[repr(u32)]
1359     pub enum ApctlInfo {
1360         ProfileName,
1361         Bssid,
1362         Ssid,
1363         SsidLength,
1364         SecurityType,
1365         Strength,
1366         Channel,
1367         PowerSave,
1368         Ip,
1369         SubnetMask,
1370         Gateway,
1371         PrimaryDns,
1372         SecondaryDns,
1373         UseProxy,
1374         ProxyUrl,
1375         ProxyPort,
1376         EapType,
1377         StartBrowser,
1378         Wifisp,
1379     }
1380 
1381     #[repr(u32)]
1382     pub enum ApctlInfoSecurityType {
1383         None,
1384         Wep,
1385         Wpa,
1386     }
1387 
1388     #[repr(u32)]
1389     pub enum HttpMethod {
1390         Get,
1391         Post,
1392         Head,
1393     }
1394 
1395     #[repr(u32)]
1396     pub enum HttpAuthType {
1397         Basic,
1398         Digest,
1399     }
1400 }
1401 
1402 s_paren! {
1403     #[repr(transparent)]
1404     pub struct SceUid(pub i32);
1405 
1406     #[repr(transparent)]
1407     pub struct SceMpeg(*mut *mut c_void);
1408 
1409     #[repr(transparent)]
1410     pub struct SceMpegStream(*mut c_void);
1411 
1412     #[repr(transparent)]
1413     pub struct Mp3Handle(pub i32);
1414 
1415     #[repr(transparent)]
1416     pub struct RegHandle(u32);
1417 }
1418 
1419 s! {
1420     pub struct sockaddr {
1421         pub sa_len: u8,
1422         pub sa_family: u8,
1423         pub sa_data: [u8;14],
1424     }
1425 
1426     pub struct in_addr {
1427         pub s_addr: u32,
1428     }
1429 
1430     pub struct AudioInputParams {
1431         pub unknown1: i32,
1432         pub gain: i32,
1433         pub unknown2: i32,
1434         pub unknown3: i32,
1435         pub unknown4: i32,
1436         pub unknown5: i32,
1437     }
1438 
1439     pub struct Atrac3BufferInfo {
1440         pub puc_write_position_first_buf: *mut u8,
1441         pub ui_writable_byte_first_buf: u32,
1442         pub ui_min_write_byte_first_buf: u32,
1443         pub ui_read_position_first_buf: u32,
1444         pub puc_write_position_second_buf: *mut u8,
1445         pub ui_writable_byte_second_buf: u32,
1446         pub ui_min_write_byte_second_buf: u32,
1447         pub ui_read_position_second_buf: u32,
1448     }
1449 
1450     pub struct SceCtrlData {
1451         pub timestamp: u32,
1452         pub buttons: i32,
1453         pub lx: u8,
1454         pub ly: u8,
1455         pub rsrv: [u8; 6],
1456     }
1457 
1458     pub struct SceCtrlLatch {
1459         pub ui_make: u32,
1460         pub ui_break: u32,
1461         pub ui_press: u32,
1462         pub ui_release: u32,
1463     }
1464 
1465     pub struct GeStack {
1466         pub stack: [u32; 8],
1467     }
1468 
1469     pub struct GeCallbackData {
1470         pub signal_func: ::Option<extern "C" fn(id: i32, arg: *mut c_void)>,
1471         pub signal_arg: *mut c_void,
1472         pub finish_func: ::Option<extern "C" fn(id: i32, arg: *mut c_void)>,
1473         pub finish_arg: *mut c_void,
1474     }
1475 
1476     pub struct GeListArgs {
1477         pub size: u32,
1478         pub context: *mut GeContext,
1479         pub num_stacks: u32,
1480         pub stacks: *mut GeStack,
1481     }
1482 
1483     pub struct GeBreakParam {
1484         pub buf: [u32; 4],
1485     }
1486 
1487     pub struct SceKernelLoadExecParam {
1488         pub size: usize,
1489         pub args: usize,
1490         pub argp: *mut c_void,
1491         pub key: *const u8,
1492     }
1493 
1494     pub struct timeval {
1495         pub tv_sec: i32,
1496         pub tv_usec: i32,
1497     }
1498 
1499     pub struct timezone {
1500         pub tz_minutes_west: i32,
1501         pub tz_dst_time: i32,
1502     }
1503 
1504     pub struct IntrHandlerOptionParam {
1505         size: i32,
1506         entry: u32,
1507         common: u32,
1508         gp: u32,
1509         intr_code: u16,
1510         sub_count: u16,
1511         intr_level: u16,
1512         enabled: u16,
1513         calls: u32,
1514         field_1c: u32,
1515         total_clock_lo: u32,
1516         total_clock_hi: u32,
1517         min_clock_lo: u32,
1518         min_clock_hi: u32,
1519         max_clock_lo: u32,
1520         max_clock_hi: u32,
1521     }
1522 
1523     pub struct SceKernelLMOption {
1524         pub size: usize,
1525         pub m_pid_text: SceUid,
1526         pub m_pid_data: SceUid,
1527         pub flags: u32,
1528         pub position: u8,
1529         pub access: u8,
1530         pub c_reserved: [u8; 2usize],
1531     }
1532 
1533     pub struct SceKernelSMOption {
1534         pub size: usize,
1535         pub m_pid_stack: SceUid,
1536         pub stack_size: usize,
1537         pub priority: i32,
1538         pub attribute: u32,
1539     }
1540 
1541     pub struct SceKernelModuleInfo {
1542         pub size: usize,
1543         pub n_segment: u8,
1544         pub reserved: [u8; 3usize],
1545         pub segment_addr: [i32; 4usize],
1546         pub segment_size: [i32; 4usize],
1547         pub entry_addr: u32,
1548         pub gp_value: u32,
1549         pub text_addr: u32,
1550         pub text_size: u32,
1551         pub data_size: u32,
1552         pub bss_size: u32,
1553         pub attribute: u16,
1554         pub version: [u8; 2usize],
1555         pub name: [u8; 28usize],
1556     }
1557 
1558     pub struct DebugProfilerRegs {
1559         pub enable: u32,
1560         pub systemck: u32,
1561         pub cpuck: u32,
1562         pub internal: u32,
1563         pub memory: u32,
1564         pub copz: u32,
1565         pub vfpu: u32,
1566         pub sleep: u32,
1567         pub bus_access: u32,
1568         pub uncached_load: u32,
1569         pub uncached_store: u32,
1570         pub cached_load: u32,
1571         pub cached_store: u32,
1572         pub i_miss: u32,
1573         pub d_miss: u32,
1574         pub d_writeback: u32,
1575         pub cop0_inst: u32,
1576         pub fpu_inst: u32,
1577         pub vfpu_inst: u32,
1578         pub local_bus: u32,
1579     }
1580 
1581     pub struct SceKernelSysClock {
1582         pub low: u32,
1583         pub hi: u32,
1584     }
1585 
1586     pub struct SceKernelThreadOptParam {
1587         pub size: usize,
1588         pub stack_mpid: SceUid,
1589     }
1590 
1591     pub struct SceKernelThreadInfo {
1592         pub size: usize,
1593         pub name: [u8; 32],
1594         pub attr: u32,
1595         pub status: i32,
1596         pub entry: SceKernelThreadEntry,
1597         pub stack: *mut c_void,
1598         pub stack_size: i32,
1599         pub gp_reg: *mut c_void,
1600         pub init_priority: i32,
1601         pub current_priority: i32,
1602         pub wait_type: i32,
1603         pub wait_id: SceUid,
1604         pub wakeup_count: i32,
1605         pub exit_status: i32,
1606         pub run_clocks: SceKernelSysClock,
1607         pub intr_preempt_count: u32,
1608         pub thread_preempt_count: u32,
1609         pub release_count: u32,
1610     }
1611 
1612     pub struct SceKernelThreadRunStatus {
1613         pub size: usize,
1614         pub status: i32,
1615         pub current_priority: i32,
1616         pub wait_type: i32,
1617         pub wait_id: i32,
1618         pub wakeup_count: i32,
1619         pub run_clocks: SceKernelSysClock,
1620         pub intr_preempt_count: u32,
1621         pub thread_preempt_count: u32,
1622         pub release_count: u32,
1623     }
1624 
1625     pub struct SceKernelSemaOptParam {
1626         pub size: usize,
1627     }
1628 
1629     pub struct SceKernelSemaInfo {
1630         pub size: usize,
1631         pub name: [u8; 32],
1632         pub attr: u32,
1633         pub init_count: i32,
1634         pub current_count: i32,
1635         pub max_count: i32,
1636         pub num_wait_threads: i32,
1637     }
1638 
1639     pub struct SceKernelEventFlagInfo {
1640         pub size: usize,
1641         pub name: [u8; 32],
1642         pub attr: u32,
1643         pub init_pattern: u32,
1644         pub current_pattern: u32,
1645         pub num_wait_threads: i32,
1646     }
1647 
1648     pub struct SceKernelEventFlagOptParam {
1649         pub size: usize,
1650     }
1651 
1652     pub struct SceKernelMbxOptParam {
1653         pub size: usize,
1654     }
1655 
1656     pub struct SceKernelMbxInfo {
1657         pub size: usize,
1658         pub name: [u8; 32usize],
1659         pub attr: u32,
1660         pub num_wait_threads: i32,
1661         pub num_messages: i32,
1662         pub first_message: *mut c_void,
1663     }
1664 
1665     pub struct SceKernelVTimerInfo {
1666         pub size: usize,
1667         pub name: [u8; 32],
1668         pub active: i32,
1669         pub base: SceKernelSysClock,
1670         pub current: SceKernelSysClock,
1671         pub schedule: SceKernelSysClock,
1672         pub handler: SceKernelVTimerHandler,
1673         pub common: *mut c_void,
1674     }
1675 
1676     pub struct SceKernelThreadEventHandlerInfo {
1677         pub size: usize,
1678         pub name: [u8; 32],
1679         pub thread_id: SceUid,
1680         pub mask: i32,
1681         pub handler: SceKernelThreadEventHandler,
1682         pub common: *mut c_void,
1683     }
1684 
1685     pub struct SceKernelAlarmInfo {
1686         pub size: usize,
1687         pub schedule: SceKernelSysClock,
1688         pub handler: SceKernelAlarmHandler,
1689         pub common: *mut c_void,
1690     }
1691 
1692     pub struct SceKernelSystemStatus {
1693         pub size: usize,
1694         pub status: u32,
1695         pub idle_clocks: SceKernelSysClock,
1696         pub comes_out_of_idle_count: u32,
1697         pub thread_switch_count: u32,
1698         pub vfpu_switch_count: u32,
1699     }
1700 
1701     pub struct SceKernelMppInfo {
1702         pub size: usize,
1703         pub name: [u8; 32],
1704         pub attr: u32,
1705         pub buf_size: i32,
1706         pub free_size: i32,
1707         pub num_send_wait_threads: i32,
1708         pub num_receive_wait_threads: i32,
1709     }
1710 
1711     pub struct SceKernelVplOptParam {
1712         pub size: usize,
1713     }
1714 
1715     pub struct SceKernelVplInfo {
1716         pub size: usize,
1717         pub name: [u8; 32],
1718         pub attr: u32,
1719         pub pool_size: i32,
1720         pub free_size: i32,
1721         pub num_wait_threads: i32,
1722     }
1723 
1724     pub struct SceKernelFplOptParam {
1725         pub size: usize,
1726     }
1727 
1728     pub struct SceKernelFplInfo {
1729         pub size: usize,
1730         pub name: [u8; 32usize],
1731         pub attr: u32,
1732         pub block_size: i32,
1733         pub num_blocks: i32,
1734         pub free_blocks: i32,
1735         pub num_wait_threads: i32,
1736     }
1737 
1738     pub struct SceKernelVTimerOptParam {
1739         pub size: usize,
1740     }
1741 
1742     pub struct SceKernelCallbackInfo {
1743         pub size: usize,
1744         pub name: [u8; 32usize],
1745         pub thread_id: SceUid,
1746         pub callback: SceKernelCallbackFunction,
1747         pub common: *mut c_void,
1748         pub notify_count: i32,
1749         pub notify_arg: i32,
1750     }
1751 
1752     pub struct UsbCamSetupStillParam {
1753         pub size: i32,
1754         pub resolution: UsbCamResolution,
1755         pub jpeg_size: i32,
1756         pub reverse_flags: i32,
1757         pub delay: UsbCamDelay,
1758         pub comp_level: i32,
1759     }
1760 
1761     pub struct UsbCamSetupStillExParam {
1762         pub size: i32,
1763         pub unk: u32,
1764         pub resolution: UsbCamResolutionEx,
1765         pub jpeg_size: i32,
1766         pub comp_level: i32,
1767         pub unk2: u32,
1768         pub unk3: u32,
1769         pub flip: i32,
1770         pub mirror: i32,
1771         pub delay: UsbCamDelay,
1772         pub unk4: [u32; 5usize],
1773     }
1774 
1775     pub struct UsbCamSetupVideoParam {
1776         pub size: i32,
1777         pub resolution: UsbCamResolution,
1778         pub framerate: UsbCamFrameRate,
1779         pub white_balance: UsbCamWb,
1780         pub saturation: i32,
1781         pub brightness: i32,
1782         pub contrast: i32,
1783         pub sharpness: i32,
1784         pub effect_mode: UsbCamEffectMode,
1785         pub frame_size: i32,
1786         pub unk: u32,
1787         pub evl_evel: UsbCamEvLevel,
1788     }
1789 
1790     pub struct UsbCamSetupVideoExParam {
1791         pub size: i32,
1792         pub unk: u32,
1793         pub resolution: UsbCamResolutionEx,
1794         pub framerate: UsbCamFrameRate,
1795         pub unk2: u32,
1796         pub unk3: u32,
1797         pub white_balance: UsbCamWb,
1798         pub saturation: i32,
1799         pub brightness: i32,
1800         pub contrast: i32,
1801         pub sharpness: i32,
1802         pub unk4: u32,
1803         pub unk5: u32,
1804         pub unk6: [u32; 3usize],
1805         pub effect_mode: UsbCamEffectMode,
1806         pub unk7: u32,
1807         pub unk8: u32,
1808         pub unk9: u32,
1809         pub unk10: u32,
1810         pub unk11: u32,
1811         pub frame_size: i32,
1812         pub unk12: u32,
1813         pub ev_level: UsbCamEvLevel,
1814     }
1815 
1816     pub struct ScePspDateTime {
1817         pub year: u16,
1818         pub month: u16,
1819         pub day: u16,
1820         pub hour: u16,
1821         pub minutes: u16,
1822         pub seconds: u16,
1823         pub microseconds: u32,
1824     }
1825 
1826     pub struct SceIoStat {
1827         pub st_mode: i32,
1828         pub st_attr: i32,
1829         pub st_size: i64,
1830         pub st_ctime: ScePspDateTime,
1831         pub st_atime: ScePspDateTime,
1832         pub st_mtime: ScePspDateTime,
1833         pub st_private: [u32; 6usize],
1834     }
1835 
1836     pub struct UmdInfo {
1837         pub size: u32,
1838         pub type_: UmdType,
1839     }
1840 
1841     pub struct SceMpegRingbuffer {
1842         pub packets: i32,
1843         pub unk0: u32,
1844         pub unk1: u32,
1845         pub unk2: u32,
1846         pub unk3: u32,
1847         pub data: *mut c_void,
1848         pub callback: SceMpegRingbufferCb,
1849         pub cb_param: *mut c_void,
1850         pub unk4: u32,
1851         pub unk5: u32,
1852         pub sce_mpeg: *mut c_void,
1853     }
1854 
1855     pub struct SceMpegAu {
1856         pub pts_msb: u32,
1857         pub pts: u32,
1858         pub dts_msb: u32,
1859         pub dts: u32,
1860         pub es_buffer: u32,
1861         pub au_size: u32,
1862     }
1863 
1864     pub struct SceMpegAvcMode {
1865         pub unk0: i32,
1866         pub pixel_format: super::DisplayPixelFormat,
1867     }
1868 
1869     #[repr(align(64))]
1870     pub struct SceMpegLLI {
1871         pub src: *mut c_void,
1872         pub dst: *mut c_void,
1873         pub next: *mut c_void,
1874         pub size: i32,
1875     }
1876 
1877     #[repr(align(64))]
1878     pub struct SceMpegYCrCbBuffer {
1879         pub frame_buffer_height16: i32,
1880         pub frame_buffer_width16: i32,
1881         pub unknown: i32,
1882         pub unknown2: i32,
1883         pub y_buffer: *mut c_void,
1884         pub y_buffer2: *mut c_void,
1885         pub cr_buffer: *mut c_void,
1886         pub cb_buffer: *mut c_void,
1887         pub cr_buffer2: *mut c_void,
1888         pub cb_buffer2: *mut c_void,
1889 
1890         pub frame_height: i32,
1891         pub frame_width: i32,
1892         pub frame_buffer_width: i32,
1893         pub unknown3: [i32; 11usize],
1894     }
1895 
1896     pub struct ScePspSRect {
1897         pub x: i16,
1898         pub y: i16,
1899         pub w: i16,
1900         pub h: i16,
1901     }
1902 
1903     pub struct ScePspIRect {
1904         pub x: i32,
1905         pub y: i32,
1906         pub w: i32,
1907         pub h: i32,
1908     }
1909 
1910     pub struct ScePspL64Rect {
1911         pub x: u64,
1912         pub y: u64,
1913         pub w: u64,
1914         pub h: u64,
1915     }
1916 
1917     pub struct ScePspSVector2 {
1918         pub x: i16,
1919         pub y: i16,
1920     }
1921 
1922     pub struct ScePspIVector2 {
1923         pub x: i32,
1924         pub y: i32,
1925     }
1926 
1927     pub struct ScePspL64Vector2 {
1928         pub x: u64,
1929         pub y: u64,
1930     }
1931 
1932     pub struct ScePspSVector3 {
1933         pub x: i16,
1934         pub y: i16,
1935         pub z: i16,
1936     }
1937 
1938     pub struct ScePspIVector3 {
1939         pub x: i32,
1940         pub y: i32,
1941         pub z: i32,
1942     }
1943 
1944     pub struct ScePspL64Vector3 {
1945         pub x: u64,
1946         pub y: u64,
1947         pub z: u64,
1948     }
1949 
1950     pub struct ScePspSVector4 {
1951         pub x: i16,
1952         pub y: i16,
1953         pub z: i16,
1954         pub w: i16,
1955     }
1956 
1957     pub struct ScePspIVector4 {
1958         pub x: i32,
1959         pub y: i32,
1960         pub z: i32,
1961         pub w: i32,
1962     }
1963 
1964     pub struct ScePspL64Vector4 {
1965         pub x: u64,
1966         pub y: u64,
1967         pub z: u64,
1968         pub w: u64,
1969     }
1970 
1971     pub struct ScePspIMatrix2 {
1972         pub x: ScePspIVector2,
1973         pub y: ScePspIVector2,
1974     }
1975 
1976     pub struct ScePspIMatrix3 {
1977         pub x: ScePspIVector3,
1978         pub y: ScePspIVector3,
1979         pub z: ScePspIVector3,
1980     }
1981 
1982     #[repr(align(16))]
1983     pub struct ScePspIMatrix4 {
1984         pub x: ScePspIVector4,
1985         pub y: ScePspIVector4,
1986         pub z: ScePspIVector4,
1987         pub w: ScePspIVector4,
1988     }
1989 
1990     pub struct ScePspIMatrix4Unaligned {
1991         pub x: ScePspIVector4,
1992         pub y: ScePspIVector4,
1993         pub z: ScePspIVector4,
1994         pub w: ScePspIVector4,
1995     }
1996 
1997     pub struct SceMp3InitArg {
1998         pub mp3_stream_start: u32,
1999         pub unk1: u32,
2000         pub mp3_stream_end: u32,
2001         pub unk2: u32,
2002         pub mp3_buf: *mut c_void,
2003         pub mp3_buf_size: i32,
2004         pub pcm_buf: *mut c_void,
2005         pub pcm_buf_size: i32,
2006     }
2007 
2008     pub struct OpenPSID {
2009         pub data: [u8; 16usize],
2010     }
2011 
2012     pub struct UtilityDialogCommon {
2013         pub size: u32,
2014         pub language: SystemParamLanguage,
2015         pub button_accept: UtilityDialogButtonAccept,
2016         pub graphics_thread: i32,
2017         pub access_thread: i32,
2018         pub font_thread: i32,
2019         pub sound_thread: i32,
2020         pub result: i32,
2021         pub reserved: [i32; 4usize],
2022     }
2023 
2024     pub struct UtilityNetconfAdhoc {
2025         pub name: [u8; 8usize],
2026         pub timeout: u32,
2027     }
2028 
2029     pub struct UtilityNetconfData {
2030         pub base: UtilityDialogCommon,
2031         pub action: UtilityNetconfAction,
2032         pub adhocparam: *mut UtilityNetconfAdhoc,
2033         pub hotspot: i32,
2034         pub hotspot_connected: i32,
2035         pub wifisp: i32,
2036     }
2037 
2038     pub struct UtilitySavedataFileData {
2039         pub buf: *mut c_void,
2040         pub buf_size: usize,
2041         pub size: usize,
2042         pub unknown: i32,
2043     }
2044 
2045     pub struct UtilitySavedataListSaveNewData {
2046         pub icon0: UtilitySavedataFileData,
2047         pub title: *mut u8,
2048     }
2049 
2050     pub struct UtilityGameSharingParams {
2051         pub base: UtilityDialogCommon,
2052         pub unknown1: i32,
2053         pub unknown2: i32,
2054         pub name: [u8; 8usize],
2055         pub unknown3: i32,
2056         pub unknown4: i32,
2057         pub unknown5: i32,
2058         pub result: i32,
2059         pub filepath: *mut u8,
2060         pub mode: UtilityGameSharingMode,
2061         pub datatype: UtilityGameSharingDataType,
2062         pub data: *mut c_void,
2063         pub datasize: u32,
2064     }
2065 
2066     pub struct UtilityHtmlViewerParam {
2067         pub base: UtilityDialogCommon,
2068         pub memaddr: *mut c_void,
2069         pub memsize: u32,
2070         pub unknown1: i32,
2071         pub unknown2: i32,
2072         pub initialurl: *mut u8,
2073         pub numtabs: u32,
2074         pub interfacemode: UtilityHtmlViewerInterfaceMode,
2075         pub options: i32,
2076         pub dldirname: *mut u8,
2077         pub dlfilename: *mut u8,
2078         pub uldirname: *mut u8,
2079         pub ulfilename: *mut u8,
2080         pub cookiemode: UtilityHtmlViewerCookieMode,
2081         pub unknown3: u32,
2082         pub homeurl: *mut u8,
2083         pub textsize: UtilityHtmlViewerTextSize,
2084         pub displaymode: UtilityHtmlViewerDisplayMode,
2085         pub connectmode: UtilityHtmlViewerConnectMode,
2086         pub disconnectmode: UtilityHtmlViewerDisconnectMode,
2087         pub memused: u32,
2088         pub unknown4: [i32; 10usize],
2089     }
2090 
2091     pub struct SceUtilityOskData {
2092         pub unk_00: i32,
2093         pub unk_04: i32,
2094         pub language: SceUtilityOskInputLanguage,
2095         pub unk_12: i32,
2096         pub inputtype: SceUtilityOskInputType,
2097         pub lines: i32,
2098         pub unk_24: i32,
2099         pub desc: *mut u16,
2100         pub intext: *mut u16,
2101         pub outtextlength: i32,
2102         pub outtext: *mut u16,
2103         pub result: SceUtilityOskResult,
2104         pub outtextlimit: i32,
2105     }
2106 
2107     pub struct SceUtilityOskParams {
2108         pub base: UtilityDialogCommon,
2109         pub datacount: i32,
2110         pub data: *mut SceUtilityOskData,
2111         pub state: SceUtilityOskState,
2112         pub unk_60: i32,
2113     }
2114 
2115     pub struct SceNetMallocStat {
2116         pub pool: i32,
2117         pub maximum: i32,
2118         pub free: i32,
2119     }
2120 
2121     pub struct SceNetAdhocctlAdhocId {
2122         pub unknown: i32,
2123         pub adhoc_id: [u8; 9usize],
2124         pub unk: [u8; 3usize],
2125     }
2126 
2127     pub struct SceNetAdhocctlScanInfo {
2128         pub next: *mut SceNetAdhocctlScanInfo,
2129         pub channel: i32,
2130         pub name: [u8; 8usize],
2131         pub bssid: [u8; 6usize],
2132         pub unknown: [u8; 2usize],
2133         pub unknown2: i32,
2134     }
2135 
2136     pub struct SceNetAdhocctlGameModeInfo {
2137         pub count: i32,
2138         pub macs: [[u8; 6usize]; 16usize],
2139     }
2140 
2141     pub struct SceNetAdhocPtpStat {
2142         pub next: *mut SceNetAdhocPtpStat,
2143         pub ptp_id: i32,
2144         pub mac: [u8; 6usize],
2145         pub peermac: [u8; 6usize],
2146         pub port: u16,
2147         pub peerport: u16,
2148         pub sent_data: u32,
2149         pub rcvd_data: u32,
2150         pub state: ScePspnetAdhocPtpState,
2151     }
2152 
2153     pub struct SceNetAdhocPdpStat {
2154         pub next: *mut SceNetAdhocPdpStat,
2155         pub pdp_id: i32,
2156         pub mac: [u8; 6usize],
2157         pub port: u16,
2158         pub rcvd_data: u32,
2159     }
2160 
2161     pub struct AdhocPoolStat {
2162         pub size: i32,
2163         pub maxsize: i32,
2164         pub freesize: i32,
2165     }
2166 }
2167 
2168 s_no_extra_traits! {
2169     #[allow(missing_debug_implementations)]
2170     pub struct GeContext {
2171         pub context: [u32; 512],
2172     }
2173 
2174     #[allow(missing_debug_implementations)]
2175     pub struct SceKernelUtilsSha1Context {
2176         pub h: [u32; 5usize],
2177         pub us_remains: u16,
2178         pub us_computed: u16,
2179         pub ull_total_len: u64,
2180         pub buf: [u8; 64usize],
2181     }
2182 
2183     #[allow(missing_debug_implementations)]
2184     pub struct SceKernelUtilsMt19937Context {
2185         pub count: u32,
2186         pub state: [u32; 624usize],
2187     }
2188 
2189     #[allow(missing_debug_implementations)]
2190     pub struct SceKernelUtilsMd5Context {
2191         pub h: [u32; 4usize],
2192         pub pad: u32,
2193         pub us_remains: u16,
2194         pub us_computed: u16,
2195         pub ull_total_len: u64,
2196         pub buf: [u8; 64usize],
2197     }
2198 
2199     #[allow(missing_debug_implementations)]
2200     pub struct SceIoDirent {
2201         pub d_stat: SceIoStat,
2202         pub d_name: [u8; 256usize],
2203         pub d_private: *mut c_void,
2204         pub dummy: i32,
2205     }
2206 
2207     #[cfg_attr(feature = "extra_traits", derive(Debug))]
2208     pub struct ScePspFRect {
2209         pub x: f32,
2210         pub y: f32,
2211         pub w: f32,
2212         pub h: f32,
2213     }
2214 
2215     #[repr(align(16))]
2216     #[cfg_attr(feature = "extra_traits", derive(Debug))]
2217     pub struct ScePspFVector3 {
2218         pub x: f32,
2219         pub y: f32,
2220         pub z: f32,
2221     }
2222 
2223     #[repr(align(16))]
2224     #[cfg_attr(feature = "extra_traits", derive(Debug))]
2225     pub struct ScePspFVector4 {
2226         pub x: f32,
2227         pub y: f32,
2228         pub z: f32,
2229         pub w: f32,
2230     }
2231 
2232     #[cfg_attr(feature = "extra_traits", derive(Debug))]
2233     pub struct ScePspFVector4Unaligned {
2234         pub x: f32,
2235         pub y: f32,
2236         pub z: f32,
2237         pub w: f32,
2238     }
2239 
2240     #[cfg_attr(feature = "extra_traits", derive(Debug))]
2241     pub struct ScePspFVector2 {
2242         pub x: f32,
2243         pub y: f32,
2244     }
2245 
2246     #[cfg_attr(feature = "extra_traits", derive(Debug))]
2247     pub struct ScePspFMatrix2 {
2248         pub x: ScePspFVector2,
2249         pub y: ScePspFVector2,
2250     }
2251 
2252     #[cfg_attr(feature = "extra_traits", derive(Debug))]
2253     pub struct ScePspFMatrix3 {
2254         pub x: ScePspFVector3,
2255         pub y: ScePspFVector3,
2256         pub z: ScePspFVector3,
2257     }
2258 
2259     #[cfg_attr(feature = "extra_traits", derive(Debug))]
2260     #[repr(align(16))]
2261     pub struct ScePspFMatrix4 {
2262         pub x: ScePspFVector4,
2263         pub y: ScePspFVector4,
2264         pub z: ScePspFVector4,
2265         pub w: ScePspFVector4,
2266     }
2267 
2268     #[allow(missing_debug_implementations)]
2269     pub struct ScePspFMatrix4Unaligned {
2270         pub x: ScePspFVector4,
2271         pub y: ScePspFVector4,
2272         pub z: ScePspFVector4,
2273         pub w: ScePspFVector4,
2274     }
2275 
2276     #[allow(missing_debug_implementations)]
2277     pub union ScePspVector3 {
2278         pub fv: ScePspFVector3,
2279         pub iv: ScePspIVector3,
2280         pub f: [f32; 3usize],
2281         pub i: [i32; 3usize],
2282     }
2283 
2284     #[allow(missing_debug_implementations)]
2285     pub union ScePspVector4 {
2286         pub fv: ScePspFVector4,
2287         pub iv: ScePspIVector4,
2288         pub qw: u128,
2289         pub f: [f32; 4usize],
2290         pub i: [i32; 4usize],
2291     }
2292 
2293     #[allow(missing_debug_implementations)]
2294     pub union ScePspMatrix2 {
2295         pub fm: ScePspFMatrix2,
2296         pub im: ScePspIMatrix2,
2297         pub fv: [ScePspFVector2; 2usize],
2298         pub iv: [ScePspIVector2; 2usize],
2299         pub v: [ScePspVector2; 2usize],
2300         pub f: [[f32; 2usize]; 2usize],
2301         pub i: [[i32; 2usize]; 2usize],
2302     }
2303 
2304     #[allow(missing_debug_implementations)]
2305     pub union ScePspMatrix3 {
2306         pub fm: ScePspFMatrix3,
2307         pub im: ScePspIMatrix3,
2308         pub fv: [ScePspFVector3; 3usize],
2309         pub iv: [ScePspIVector3; 3usize],
2310         pub v: [ScePspVector3; 3usize],
2311         pub f: [[f32; 3usize]; 3usize],
2312         pub i: [[i32; 3usize]; 3usize],
2313     }
2314 
2315     #[allow(missing_debug_implementations)]
2316     pub union ScePspVector2 {
2317         pub fv: ScePspFVector2,
2318         pub iv: ScePspIVector2,
2319         pub f: [f32; 2usize],
2320         pub i: [i32; 2usize],
2321     }
2322 
2323     #[allow(missing_debug_implementations)]
2324     pub union ScePspMatrix4 {
2325         pub fm: ScePspFMatrix4,
2326         pub im: ScePspIMatrix4,
2327         pub fv: [ScePspFVector4; 4usize],
2328         pub iv: [ScePspIVector4; 4usize],
2329         pub v: [ScePspVector4; 4usize],
2330         pub f: [[f32; 4usize]; 4usize],
2331         pub i: [[i32; 4usize]; 4usize],
2332     }
2333 
2334     #[allow(missing_debug_implementations)]
2335     pub struct Key {
2336         pub key_type: KeyType,
2337         pub name: [u8; 256usize],
2338         pub name_len: u32,
2339         pub unk2: u32,
2340         pub unk3: u32,
2341     }
2342 
2343     #[allow(missing_debug_implementations)]
2344     pub struct UtilityMsgDialogParams {
2345         pub base: UtilityDialogCommon,
2346         pub unknown: i32,
2347         pub mode: UtilityMsgDialogMode,
2348         pub error_value: u32,
2349         pub message: [u8; 512usize],
2350         pub options: i32,
2351         pub button_pressed: UtilityMsgDialogPressed,
2352     }
2353 
2354     #[allow(missing_debug_implementations)]
2355     pub union UtilityNetData {
2356         pub as_uint: u32,
2357         pub as_string: [u8; 128usize],
2358     }
2359 
2360     #[allow(missing_debug_implementations)]
2361     pub struct UtilitySavedataSFOParam {
2362         pub title: [u8; 128usize],
2363         pub savedata_title: [u8; 128usize],
2364         pub detail: [u8; 1024usize],
2365         pub parental_level: u8,
2366         pub unknown: [u8; 3usize],
2367     }
2368 
2369     #[allow(missing_debug_implementations)]
2370     pub struct SceUtilitySavedataParam {
2371         pub base: UtilityDialogCommon,
2372         pub mode: UtilitySavedataMode,
2373         pub unknown1: i32,
2374         pub overwrite: i32,
2375         pub game_name: [u8; 13usize],
2376         pub reserved: [u8; 3usize],
2377         pub save_name: [u8; 20usize],
2378         pub save_name_list: *mut [u8; 20usize],
2379         pub file_name: [u8; 13usize],
2380         pub reserved1: [u8; 3usize],
2381         pub data_buf: *mut c_void,
2382         pub data_buf_size: usize,
2383         pub data_size: usize,
2384         pub sfo_param: UtilitySavedataSFOParam,
2385         pub icon0_file_data: UtilitySavedataFileData,
2386         pub icon1_file_data: UtilitySavedataFileData,
2387         pub pic1_file_data: UtilitySavedataFileData,
2388         pub snd0_file_data: UtilitySavedataFileData,
2389         pub new_data: *mut UtilitySavedataListSaveNewData,
2390         pub focus: UtilitySavedataFocus,
2391         pub unknown2: [i32; 4usize],
2392         pub key: [u8; 16],
2393         pub unknown3: [u8; 20],
2394     }
2395 
2396     #[allow(missing_debug_implementations)]
2397     pub struct SceNetAdhocctlPeerInfo {
2398         pub next: *mut SceNetAdhocctlPeerInfo,
2399         pub nickname: [u8; 128usize],
2400         pub mac: [u8; 6usize],
2401         pub unknown: [u8; 6usize],
2402         pub timestamp: u32,
2403     }
2404 
2405     #[allow(missing_debug_implementations)]
2406     pub struct SceNetAdhocctlParams {
2407         pub channel: i32,
2408         pub name: [u8; 8usize],
2409         pub bssid: [u8; 6usize],
2410         pub nickname: [u8; 128usize],
2411     }
2412 
2413     #[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))]
2414     pub union SceNetApctlInfo {
2415         pub name: [u8; 64usize],
2416         pub bssid: [u8; 6usize],
2417         pub ssid: [u8; 32usize],
2418         pub ssid_length: u32,
2419         pub security_type: u32,
2420         pub strength: u8,
2421         pub channel: u8,
2422         pub power_save: u8,
2423         pub ip: [u8; 16usize],
2424         pub sub_net_mask: [u8; 16usize],
2425         pub gateway: [u8; 16usize],
2426         pub primary_dns: [u8; 16usize],
2427         pub secondary_dns: [u8; 16usize],
2428         pub use_proxy: u32,
2429         pub proxy_url: [u8; 128usize],
2430         pub proxy_port: u16,
2431         pub eap_type: u32,
2432         pub start_browser: u32,
2433         pub wifisp: u32,
2434     }
2435 }
2436 
2437 pub const INT_MIN: c_int = -2147483648;
2438 pub const INT_MAX: c_int = 2147483647;
2439 
2440 pub const AUDIO_VOLUME_MAX: u32 = 0x8000;
2441 pub const AUDIO_CHANNEL_MAX: u32 = 8;
2442 pub const AUDIO_NEXT_CHANNEL: i32 = -1;
2443 pub const AUDIO_SAMPLE_MIN: u32 = 64;
2444 pub const AUDIO_SAMPLE_MAX: u32 = 65472;
2445 
2446 pub const PSP_CTRL_SELECT: i32 = 0x000001;
2447 pub const PSP_CTRL_START: i32 = 0x000008;
2448 pub const PSP_CTRL_UP: i32 = 0x000010;
2449 pub const PSP_CTRL_RIGHT: i32 = 0x000020;
2450 pub const PSP_CTRL_DOWN: i32 = 0x000040;
2451 pub const PSP_CTRL_LEFT: i32 = 0x000080;
2452 pub const PSP_CTRL_LTRIGGER: i32 = 0x000100;
2453 pub const PSP_CTRL_RTRIGGER: i32 = 0x000200;
2454 pub const PSP_CTRL_TRIANGLE: i32 = 0x001000;
2455 pub const PSP_CTRL_CIRCLE: i32 = 0x002000;
2456 pub const PSP_CTRL_CROSS: i32 = 0x004000;
2457 pub const PSP_CTRL_SQUARE: i32 = 0x008000;
2458 pub const PSP_CTRL_HOME: i32 = 0x010000;
2459 pub const PSP_CTRL_HOLD: i32 = 0x020000;
2460 pub const PSP_CTRL_NOTE: i32 = 0x800000;
2461 pub const PSP_CTRL_SCREEN: i32 = 0x400000;
2462 pub const PSP_CTRL_VOLUP: i32 = 0x100000;
2463 pub const PSP_CTRL_VOLDOWN: i32 = 0x200000;
2464 pub const PSP_CTRL_WLAN_UP: i32 = 0x040000;
2465 pub const PSP_CTRL_REMOTE: i32 = 0x080000;
2466 pub const PSP_CTRL_DISC: i32 = 0x1000000;
2467 pub const PSP_CTRL_MS: i32 = 0x2000000;
2468 
2469 pub const USB_CAM_PID: i32 = 0x282;
2470 pub const USB_BUS_DRIVER_NAME: &str = "USBBusDriver";
2471 pub const USB_CAM_DRIVER_NAME: &str = "USBCamDriver";
2472 pub const USB_CAM_MIC_DRIVER_NAME: &str = "USBCamMicDriver";
2473 pub const USB_STOR_DRIVER_NAME: &str = "USBStor_Driver";
2474 
2475 pub const ACTIVATED: i32 = 0x200;
2476 pub const CONNECTED: i32 = 0x020;
2477 pub const ESTABLISHED: i32 = 0x002;
2478 
2479 pub const USB_CAM_FLIP: i32 = 1;
2480 pub const USB_CAM_MIRROR: i32 = 0x100;
2481 
2482 pub const THREAD_ATTR_VFPU: i32 = 0x00004000;
2483 pub const THREAD_ATTR_USER: i32 = 0x80000000;
2484 pub const THREAD_ATTR_USBWLAN: i32 = 0xa0000000;
2485 pub const THREAD_ATTR_VSH: i32 = 0xc0000000;
2486 pub const THREAD_ATTR_SCRATCH_SRAM: i32 = 0x00008000;
2487 pub const THREAD_ATTR_NO_FILLSTACK: i32 = 0x00100000;
2488 pub const THREAD_ATTR_CLEAR_STACK: i32 = 0x00200000;
2489 
2490 pub const EVENT_WAIT_MULTIPLE: i32 = 0x200;
2491 
2492 pub const EVENT_WAIT_AND: i32 = 0;
2493 pub const EVENT_WAIT_OR: i32 = 1;
2494 pub const EVENT_WAIT_CLEAR: i32 = 0x20;
2495 
2496 pub const POWER_INFO_POWER_SWITCH: i32 = 0x80000000;
2497 pub const POWER_INFO_HOLD_SWITCH: i32 = 0x40000000;
2498 pub const POWER_INFO_STANDBY: i32 = 0x00080000;
2499 pub const POWER_INFO_RESUME_COMPLETE: i32 = 0x00040000;
2500 pub const POWER_INFO_RESUMING: i32 = 0x00020000;
2501 pub const POWER_INFO_SUSPENDING: i32 = 0x00010000;
2502 pub const POWER_INFO_AC_POWER: i32 = 0x00001000;
2503 pub const POWER_INFO_BATTERY_LOW: i32 = 0x00000100;
2504 pub const POWER_INFO_BATTERY_EXIST: i32 = 0x00000080;
2505 pub const POWER_INFO_BATTERY_POWER: i32 = 0x0000007;
2506 
2507 pub const FIO_S_IFLNK: i32 = 0x4000;
2508 pub const FIO_S_IFDIR: i32 = 0x1000;
2509 pub const FIO_S_IFREG: i32 = 0x2000;
2510 pub const FIO_S_ISUID: i32 = 0x0800;
2511 pub const FIO_S_ISGID: i32 = 0x0400;
2512 pub const FIO_S_ISVTX: i32 = 0x0200;
2513 pub const FIO_S_IRUSR: i32 = 0x0100;
2514 pub const FIO_S_IWUSR: i32 = 0x0080;
2515 pub const FIO_S_IXUSR: i32 = 0x0040;
2516 pub const FIO_S_IRGRP: i32 = 0x0020;
2517 pub const FIO_S_IWGRP: i32 = 0x0010;
2518 pub const FIO_S_IXGRP: i32 = 0x0008;
2519 pub const FIO_S_IROTH: i32 = 0x0004;
2520 pub const FIO_S_IWOTH: i32 = 0x0002;
2521 pub const FIO_S_IXOTH: i32 = 0x0001;
2522 
2523 pub const FIO_SO_IFLNK: i32 = 0x0008;
2524 pub const FIO_SO_IFDIR: i32 = 0x0010;
2525 pub const FIO_SO_IFREG: i32 = 0x0020;
2526 pub const FIO_SO_IROTH: i32 = 0x0004;
2527 pub const FIO_SO_IWOTH: i32 = 0x0002;
2528 pub const FIO_SO_IXOTH: i32 = 0x0001;
2529 
2530 pub const PSP_O_RD_ONLY: i32 = 0x0001;
2531 pub const PSP_O_WR_ONLY: i32 = 0x0002;
2532 pub const PSP_O_RD_WR: i32 = 0x0003;
2533 pub const PSP_O_NBLOCK: i32 = 0x0004;
2534 pub const PSP_O_DIR: i32 = 0x0008;
2535 pub const PSP_O_APPEND: i32 = 0x0100;
2536 pub const PSP_O_CREAT: i32 = 0x0200;
2537 pub const PSP_O_TRUNC: i32 = 0x0400;
2538 pub const PSP_O_EXCL: i32 = 0x0800;
2539 pub const PSP_O_NO_WAIT: i32 = 0x8000;
2540 
2541 pub const UMD_NOT_PRESENT: i32 = 0x01;
2542 pub const UMD_PRESENT: i32 = 0x02;
2543 pub const UMD_CHANGED: i32 = 0x04;
2544 pub const UMD_INITING: i32 = 0x08;
2545 pub const UMD_INITED: i32 = 0x10;
2546 pub const UMD_READY: i32 = 0x20;
2547 
2548 pub const PLAY_PAUSE: i32 = 0x1;
2549 pub const FORWARD: i32 = 0x4;
2550 pub const BACK: i32 = 0x8;
2551 pub const VOL_UP: i32 = 0x10;
2552 pub const VOL_DOWN: i32 = 0x20;
2553 pub const HOLD: i32 = 0x80;
2554 
2555 pub const GU_PI: f32 = 3.141593;
2556 
2557 pub const GU_TEXTURE_8BIT: i32 = 1;
2558 pub const GU_TEXTURE_16BIT: i32 = 2;
2559 pub const GU_TEXTURE_32BITF: i32 = 3;
2560 pub const GU_COLOR_5650: i32 = 4 << 2;
2561 pub const GU_COLOR_5551: i32 = 5 << 2;
2562 pub const GU_COLOR_4444: i32 = 6 << 2;
2563 pub const GU_COLOR_8888: i32 = 7 << 2;
2564 pub const GU_NORMAL_8BIT: i32 = 1 << 5;
2565 pub const GU_NORMAL_16BIT: i32 = 2 << 5;
2566 pub const GU_NORMAL_32BITF: i32 = 3 << 5;
2567 pub const GU_VERTEX_8BIT: i32 = 1 << 7;
2568 pub const GU_VERTEX_16BIT: i32 = 2 << 7;
2569 pub const GU_VERTEX_32BITF: i32 = 3 << 7;
2570 pub const GU_WEIGHT_8BIT: i32 = 1 << 9;
2571 pub const GU_WEIGHT_16BIT: i32 = 2 << 9;
2572 pub const GU_WEIGHT_32BITF: i32 = 3 << 9;
2573 pub const GU_INDEX_8BIT: i32 = 1 << 11;
2574 pub const GU_INDEX_16BIT: i32 = 2 << 11;
2575 pub const GU_WEIGHTS1: i32 = (((1 - 1) & 7) << 14) as i32;
2576 pub const GU_WEIGHTS2: i32 = (((2 - 1) & 7) << 14) as i32;
2577 pub const GU_WEIGHTS3: i32 = (((3 - 1) & 7) << 14) as i32;
2578 pub const GU_WEIGHTS4: i32 = (((4 - 1) & 7) << 14) as i32;
2579 pub const GU_WEIGHTS5: i32 = (((5 - 1) & 7) << 14) as i32;
2580 pub const GU_WEIGHTS6: i32 = (((6 - 1) & 7) << 14) as i32;
2581 pub const GU_WEIGHTS7: i32 = (((7 - 1) & 7) << 14) as i32;
2582 pub const GU_WEIGHTS8: i32 = (((8 - 1) & 7) << 14) as i32;
2583 pub const GU_VERTICES1: i32 = (((1 - 1) & 7) << 18) as i32;
2584 pub const GU_VERTICES2: i32 = (((2 - 1) & 7) << 18) as i32;
2585 pub const GU_VERTICES3: i32 = (((3 - 1) & 7) << 18) as i32;
2586 pub const GU_VERTICES4: i32 = (((4 - 1) & 7) << 18) as i32;
2587 pub const GU_VERTICES5: i32 = (((5 - 1) & 7) << 18) as i32;
2588 pub const GU_VERTICES6: i32 = (((6 - 1) & 7) << 18) as i32;
2589 pub const GU_VERTICES7: i32 = (((7 - 1) & 7) << 18) as i32;
2590 pub const GU_VERTICES8: i32 = (((8 - 1) & 7) << 18) as i32;
2591 pub const GU_TRANSFORM_2D: i32 = 1 << 23;
2592 pub const GU_TRANSFORM_3D: i32 = 0;
2593 
2594 pub const GU_COLOR_BUFFER_BIT: i32 = 1;
2595 pub const GU_STENCIL_BUFFER_BIT: i32 = 2;
2596 pub const GU_DEPTH_BUFFER_BIT: i32 = 4;
2597 pub const GU_FAST_CLEAR_BIT: i32 = 16;
2598 
2599 pub const GU_AMBIENT: i32 = 1;
2600 pub const GU_DIFFUSE: i32 = 2;
2601 pub const GU_SPECULAR: i32 = 4;
2602 pub const GU_UNKNOWN_LIGHT_COMPONENT: i32 = 8;
2603 
2604 pub const SYSTEM_REGISTRY: [u8; 7] = *b"/system";
2605 pub const REG_KEYNAME_SIZE: u32 = 27;
2606 
2607 pub const UTILITY_MSGDIALOG_ERROR: i32 = 0;
2608 pub const UTILITY_MSGDIALOG_TEXT: i32 = 1;
2609 pub const UTILITY_MSGDIALOG_YES_NO_BUTTONS: i32 = 0x10;
2610 pub const UTILITY_MSGDIALOG_DEFAULT_NO: i32 = 0x100;
2611 
2612 pub const UTILITY_HTMLVIEWER_OPEN_SCE_START_PAGE: i32 = 0x000001;
2613 pub const UTILITY_HTMLVIEWER_DISABLE_STARTUP_LIMITS: i32 = 0x000002;
2614 pub const UTILITY_HTMLVIEWER_DISABLE_EXIT_DIALOG: i32 = 0x000004;
2615 pub const UTILITY_HTMLVIEWER_DISABLE_CURSOR: i32 = 0x000008;
2616 pub const UTILITY_HTMLVIEWER_DISABLE_DOWNLOAD_COMPLETE_DIALOG: i32 = 0x000010;
2617 pub const UTILITY_HTMLVIEWER_DISABLE_DOWNLOAD_START_DIALOG: i32 = 0x000020;
2618 pub const UTILITY_HTMLVIEWER_DISABLE_DOWNLOAD_DESTINATION_DIALOG: i32 =
2619     0x000040;
2620 pub const UTILITY_HTMLVIEWER_LOCK_DOWNLOAD_DESTINATION_DIALOG: i32 = 0x000080;
2621 pub const UTILITY_HTMLVIEWER_DISABLE_TAB_DISPLAY: i32 = 0x000100;
2622 pub const UTILITY_HTMLVIEWER_ENABLE_ANALOG_HOLD: i32 = 0x000200;
2623 pub const UTILITY_HTMLVIEWER_ENABLE_FLASH: i32 = 0x000400;
2624 pub const UTILITY_HTMLVIEWER_DISABLE_LRTRIGGER: i32 = 0x000800;
2625 
2626 extern "C" {
2627     pub fn sceAudioChReserve(
2628         channel: i32,
2629         sample_count: i32,
2630         format: AudioFormat,
2631     ) -> i32;
2632     pub fn sceAudioChRelease(channel: i32) -> i32;
2633     pub fn sceAudioOutput(channel: i32, vol: i32, buf: *mut c_void) -> i32;
2634     pub fn sceAudioOutputBlocking(
2635         channel: i32,
2636         vol: i32,
2637         buf: *mut c_void,
2638     ) -> i32;
2639     pub fn sceAudioOutputPanned(
2640         channel: i32,
2641         left_vol: i32,
2642         right_vol: i32,
2643         buf: *mut c_void,
2644     ) -> i32;
2645     pub fn sceAudioOutputPannedBlocking(
2646         channel: i32,
2647         left_vol: i32,
2648         right_vol: i32,
2649         buf: *mut c_void,
2650     ) -> i32;
2651     pub fn sceAudioGetChannelRestLen(channel: i32) -> i32;
2652     pub fn sceAudioGetChannelRestLength(channel: i32) -> i32;
2653     pub fn sceAudioSetChannelDataLen(channel: i32, sample_count: i32) -> i32;
2654     pub fn sceAudioChangeChannelConfig(
2655         channel: i32,
2656         format: AudioFormat,
2657     ) -> i32;
2658     pub fn sceAudioChangeChannelVolume(
2659         channel: i32,
2660         left_vol: i32,
2661         right_vol: i32,
2662     ) -> i32;
2663     pub fn sceAudioOutput2Reserve(sample_count: i32) -> i32;
2664     pub fn sceAudioOutput2Release() -> i32;
2665     pub fn sceAudioOutput2ChangeLength(sample_count: i32) -> i32;
2666     pub fn sceAudioOutput2OutputBlocking(vol: i32, buf: *mut c_void) -> i32;
2667     pub fn sceAudioOutput2GetRestSample() -> i32;
2668     pub fn sceAudioSRCChReserve(
2669         sample_count: i32,
2670         freq: AudioOutputFrequency,
2671         channels: i32,
2672     ) -> i32;
2673     pub fn sceAudioSRCChRelease() -> i32;
2674     pub fn sceAudioSRCOutputBlocking(vol: i32, buf: *mut c_void) -> i32;
2675     pub fn sceAudioInputInit(unknown1: i32, gain: i32, unknown2: i32) -> i32;
2676     pub fn sceAudioInputInitEx(params: *mut AudioInputParams) -> i32;
2677     pub fn sceAudioInputBlocking(
2678         sample_count: i32,
2679         freq: AudioInputFrequency,
2680         buf: *mut c_void,
2681     );
2682     pub fn sceAudioInput(
2683         sample_count: i32,
2684         freq: AudioInputFrequency,
2685         buf: *mut c_void,
2686     );
2687     pub fn sceAudioGetInputLength() -> i32;
2688     pub fn sceAudioWaitInputEnd() -> i32;
2689     pub fn sceAudioPollInputEnd() -> i32;
2690 
2691     pub fn sceAtracGetAtracID(ui_codec_type: u32) -> i32;
2692     pub fn sceAtracSetDataAndGetID(buf: *mut c_void, bufsize: usize) -> i32;
2693     pub fn sceAtracDecodeData(
2694         atrac_id: i32,
2695         out_samples: *mut u16,
2696         out_n: *mut i32,
2697         out_end: *mut i32,
2698         out_remain_frame: *mut i32,
2699     ) -> i32;
2700     pub fn sceAtracGetRemainFrame(
2701         atrac_id: i32,
2702         out_remain_frame: *mut i32,
2703     ) -> i32;
2704     pub fn sceAtracGetStreamDataInfo(
2705         atrac_id: i32,
2706         write_pointer: *mut *mut u8,
2707         available_bytes: *mut u32,
2708         read_offset: *mut u32,
2709     ) -> i32;
2710     pub fn sceAtracAddStreamData(atrac_id: i32, bytes_to_add: u32) -> i32;
2711     pub fn sceAtracGetBitrate(atrac_id: i32, out_bitrate: *mut i32) -> i32;
2712     pub fn sceAtracSetLoopNum(atrac_id: i32, nloops: i32) -> i32;
2713     pub fn sceAtracReleaseAtracID(atrac_id: i32) -> i32;
2714     pub fn sceAtracGetNextSample(atrac_id: i32, out_n: *mut i32) -> i32;
2715     pub fn sceAtracGetMaxSample(atrac_id: i32, out_max: *mut i32) -> i32;
2716     pub fn sceAtracGetBufferInfoForReseting(
2717         atrac_id: i32,
2718         ui_sample: u32,
2719         pbuffer_info: *mut Atrac3BufferInfo,
2720     ) -> i32;
2721     pub fn sceAtracGetChannel(atrac_id: i32, pui_channel: *mut u32) -> i32;
2722     pub fn sceAtracGetInternalErrorInfo(
2723         atrac_id: i32,
2724         pi_result: *mut i32,
2725     ) -> i32;
2726     pub fn sceAtracGetLoopStatus(
2727         atrac_id: i32,
2728         pi_loop_num: *mut i32,
2729         pui_loop_status: *mut u32,
2730     ) -> i32;
2731     pub fn sceAtracGetNextDecodePosition(
2732         atrac_id: i32,
2733         pui_sample_position: *mut u32,
2734     ) -> i32;
2735     pub fn sceAtracGetSecondBufferInfo(
2736         atrac_id: i32,
2737         pui_position: *mut u32,
2738         pui_data_byte: *mut u32,
2739     ) -> i32;
2740     pub fn sceAtracGetSoundSample(
2741         atrac_id: i32,
2742         pi_end_sample: *mut i32,
2743         pi_loop_start_sample: *mut i32,
2744         pi_loop_end_sample: *mut i32,
2745     ) -> i32;
2746     pub fn sceAtracResetPlayPosition(
2747         atrac_id: i32,
2748         ui_sample: u32,
2749         ui_write_byte_first_buf: u32,
2750         ui_write_byte_second_buf: u32,
2751     ) -> i32;
2752     pub fn sceAtracSetData(
2753         atrac_id: i32,
2754         puc_buffer_addr: *mut u8,
2755         ui_buffer_byte: u32,
2756     ) -> i32;
2757     pub fn sceAtracSetHalfwayBuffer(
2758         atrac_id: i32,
2759         puc_buffer_addr: *mut u8,
2760         ui_read_byte: u32,
2761         ui_buffer_byte: u32,
2762     ) -> i32;
2763     pub fn sceAtracSetHalfwayBufferAndGetID(
2764         puc_buffer_addr: *mut u8,
2765         ui_read_byte: u32,
2766         ui_buffer_byte: u32,
2767     ) -> i32;
2768     pub fn sceAtracSetSecondBuffer(
2769         atrac_id: i32,
2770         puc_second_buffer_addr: *mut u8,
2771         ui_second_buffer_byte: u32,
2772     ) -> i32;
2773 
2774     pub fn sceCtrlSetSamplingCycle(cycle: i32) -> i32;
2775     pub fn sceCtrlGetSamplingCycle(pcycle: *mut i32) -> i32;
2776     pub fn sceCtrlSetSamplingMode(mode: CtrlMode) -> i32;
2777     pub fn sceCtrlGetSamplingMode(pmode: *mut i32) -> i32;
2778     pub fn sceCtrlPeekBufferPositive(
2779         pad_data: *mut SceCtrlData,
2780         count: i32,
2781     ) -> i32;
2782     pub fn sceCtrlPeekBufferNegative(
2783         pad_data: *mut SceCtrlData,
2784         count: i32,
2785     ) -> i32;
2786     pub fn sceCtrlReadBufferPositive(
2787         pad_data: *mut SceCtrlData,
2788         count: i32,
2789     ) -> i32;
2790     pub fn sceCtrlReadBufferNegative(
2791         pad_data: *mut SceCtrlData,
2792         count: i32,
2793     ) -> i32;
2794     pub fn sceCtrlPeekLatch(latch_data: *mut SceCtrlLatch) -> i32;
2795     pub fn sceCtrlReadLatch(latch_data: *mut SceCtrlLatch) -> i32;
2796     pub fn sceCtrlSetIdleCancelThreshold(idlereset: i32, idleback: i32)
2797     -> i32;
2798     pub fn sceCtrlGetIdleCancelThreshold(
2799         idlereset: *mut i32,
2800         idleback: *mut i32,
2801     ) -> i32;
2802 
2803     pub fn sceDisplaySetMode(
2804         mode: DisplayMode,
2805         width: usize,
2806         height: usize,
2807     ) -> u32;
2808     pub fn sceDisplayGetMode(
2809         pmode: *mut i32,
2810         pwidth: *mut i32,
2811         pheight: *mut i32,
2812     ) -> i32;
2813     pub fn sceDisplaySetFrameBuf(
2814         top_addr: *const u8,
2815         buffer_width: usize,
2816         pixel_format: DisplayPixelFormat,
2817         sync: DisplaySetBufSync,
2818     ) -> u32;
2819     pub fn sceDisplayGetFrameBuf(
2820         top_addr: *mut *mut c_void,
2821         buffer_width: *mut usize,
2822         pixel_format: *mut DisplayPixelFormat,
2823         sync: DisplaySetBufSync,
2824     ) -> i32;
2825     pub fn sceDisplayGetVcount() -> u32;
2826     pub fn sceDisplayWaitVblank() -> i32;
2827     pub fn sceDisplayWaitVblankCB() -> i32;
2828     pub fn sceDisplayWaitVblankStart() -> i32;
2829     pub fn sceDisplayWaitVblankStartCB() -> i32;
2830     pub fn sceDisplayGetAccumulatedHcount() -> i32;
2831     pub fn sceDisplayGetCurrentHcount() -> i32;
2832     pub fn sceDisplayGetFramePerSec() -> f32;
2833     pub fn sceDisplayIsForeground() -> i32;
2834     pub fn sceDisplayIsVblank() -> i32;
2835 
2836     pub fn sceGeEdramGetSize() -> u32;
2837     pub fn sceGeEdramGetAddr() -> *mut u8;
2838     pub fn sceGeEdramSetAddrTranslation(width: i32) -> i32;
2839     pub fn sceGeGetCmd(cmd: i32) -> u32;
2840     pub fn sceGeGetMtx(type_: GeMatrixType, matrix: *mut c_void) -> i32;
2841     pub fn sceGeGetStack(stack_id: i32, stack: *mut GeStack) -> i32;
2842     pub fn sceGeSaveContext(context: *mut GeContext) -> i32;
2843     pub fn sceGeRestoreContext(context: *const GeContext) -> i32;
2844     pub fn sceGeListEnQueue(
2845         list: *const c_void,
2846         stall: *mut c_void,
2847         cbid: i32,
2848         arg: *mut GeListArgs,
2849     ) -> i32;
2850     pub fn sceGeListEnQueueHead(
2851         list: *const c_void,
2852         stall: *mut c_void,
2853         cbid: i32,
2854         arg: *mut GeListArgs,
2855     ) -> i32;
2856     pub fn sceGeListDeQueue(qid: i32) -> i32;
2857     pub fn sceGeListUpdateStallAddr(qid: i32, stall: *mut c_void) -> i32;
2858     pub fn sceGeListSync(qid: i32, sync_type: i32) -> GeListState;
2859     pub fn sceGeDrawSync(sync_type: i32) -> GeListState;
2860     pub fn sceGeBreak(mode: i32, p_param: *mut GeBreakParam) -> i32;
2861     pub fn sceGeContinue() -> i32;
2862     pub fn sceGeSetCallback(cb: *mut GeCallbackData) -> i32;
2863     pub fn sceGeUnsetCallback(cbid: i32) -> i32;
2864 
2865     pub fn sceKernelExitGame();
2866     pub fn sceKernelRegisterExitCallback(id: SceUid) -> i32;
2867     pub fn sceKernelLoadExec(
2868         file: *const u8,
2869         param: *mut SceKernelLoadExecParam,
2870     ) -> i32;
2871 
2872     pub fn sceKernelAllocPartitionMemory(
2873         partition: SceSysMemPartitionId,
2874         name: *const u8,
2875         type_: SceSysMemBlockTypes,
2876         size: u32,
2877         addr: *mut c_void,
2878     ) -> SceUid;
2879     pub fn sceKernelGetBlockHeadAddr(blockid: SceUid) -> *mut c_void;
2880     pub fn sceKernelFreePartitionMemory(blockid: SceUid) -> i32;
2881     pub fn sceKernelTotalFreeMemSize() -> usize;
2882     pub fn sceKernelMaxFreeMemSize() -> usize;
2883     pub fn sceKernelDevkitVersion() -> u32;
2884     pub fn sceKernelSetCompiledSdkVersion(version: u32) -> i32;
2885     pub fn sceKernelGetCompiledSdkVersion() -> u32;
2886 
2887     pub fn sceKernelLibcTime(t: *mut i32) -> i32;
2888     pub fn sceKernelLibcClock() -> u32;
2889     pub fn sceKernelLibcGettimeofday(
2890         tp: *mut timeval,
2891         tzp: *mut timezone,
2892     ) -> i32;
2893     pub fn sceKernelDcacheWritebackAll();
2894     pub fn sceKernelDcacheWritebackInvalidateAll();
2895     pub fn sceKernelDcacheWritebackRange(p: *const c_void, size: u32);
2896     pub fn sceKernelDcacheWritebackInvalidateRange(
2897         p: *const c_void,
2898         size: u32,
2899     );
2900     pub fn sceKernelDcacheInvalidateRange(p: *const c_void, size: u32);
2901     pub fn sceKernelIcacheInvalidateAll();
2902     pub fn sceKernelIcacheInvalidateRange(p: *const c_void, size: u32);
2903     pub fn sceKernelUtilsMt19937Init(
2904         ctx: *mut SceKernelUtilsMt19937Context,
2905         seed: u32,
2906     ) -> i32;
2907     pub fn sceKernelUtilsMt19937UInt(
2908         ctx: *mut SceKernelUtilsMt19937Context,
2909     ) -> u32;
2910     pub fn sceKernelUtilsMd5Digest(
2911         data: *mut u8,
2912         size: u32,
2913         digest: *mut u8,
2914     ) -> i32;
2915     pub fn sceKernelUtilsMd5BlockInit(
2916         ctx: *mut SceKernelUtilsMd5Context,
2917     ) -> i32;
2918     pub fn sceKernelUtilsMd5BlockUpdate(
2919         ctx: *mut SceKernelUtilsMd5Context,
2920         data: *mut u8,
2921         size: u32,
2922     ) -> i32;
2923     pub fn sceKernelUtilsMd5BlockResult(
2924         ctx: *mut SceKernelUtilsMd5Context,
2925         digest: *mut u8,
2926     ) -> i32;
2927     pub fn sceKernelUtilsSha1Digest(
2928         data: *mut u8,
2929         size: u32,
2930         digest: *mut u8,
2931     ) -> i32;
2932     pub fn sceKernelUtilsSha1BlockInit(
2933         ctx: *mut SceKernelUtilsSha1Context,
2934     ) -> i32;
2935     pub fn sceKernelUtilsSha1BlockUpdate(
2936         ctx: *mut SceKernelUtilsSha1Context,
2937         data: *mut u8,
2938         size: u32,
2939     ) -> i32;
2940     pub fn sceKernelUtilsSha1BlockResult(
2941         ctx: *mut SceKernelUtilsSha1Context,
2942         digest: *mut u8,
2943     ) -> i32;
2944 
2945     pub fn sceKernelRegisterSubIntrHandler(
2946         int_no: i32,
2947         no: i32,
2948         handler: *mut c_void,
2949         arg: *mut c_void,
2950     ) -> i32;
2951     pub fn sceKernelReleaseSubIntrHandler(int_no: i32, no: i32) -> i32;
2952     pub fn sceKernelEnableSubIntr(int_no: i32, no: i32) -> i32;
2953     pub fn sceKernelDisableSubIntr(int_no: i32, no: i32) -> i32;
2954     pub fn QueryIntrHandlerInfo(
2955         intr_code: SceUid,
2956         sub_intr_code: SceUid,
2957         data: *mut IntrHandlerOptionParam,
2958     ) -> i32;
2959 
2960     pub fn sceKernelCpuSuspendIntr() -> u32;
2961     pub fn sceKernelCpuResumeIntr(flags: u32);
2962     pub fn sceKernelCpuResumeIntrWithSync(flags: u32);
2963     pub fn sceKernelIsCpuIntrSuspended(flags: u32) -> i32;
2964     pub fn sceKernelIsCpuIntrEnable() -> i32;
2965 
2966     pub fn sceKernelLoadModule(
2967         path: *const u8,
2968         flags: i32,
2969         option: *mut SceKernelLMOption,
2970     ) -> SceUid;
2971     pub fn sceKernelLoadModuleMs(
2972         path: *const u8,
2973         flags: i32,
2974         option: *mut SceKernelLMOption,
2975     ) -> SceUid;
2976     pub fn sceKernelLoadModuleByID(
2977         fid: SceUid,
2978         flags: i32,
2979         option: *mut SceKernelLMOption,
2980     ) -> SceUid;
2981     pub fn sceKernelLoadModuleBufferUsbWlan(
2982         buf_size: usize,
2983         buf: *mut c_void,
2984         flags: i32,
2985         option: *mut SceKernelLMOption,
2986     ) -> SceUid;
2987     pub fn sceKernelStartModule(
2988         mod_id: SceUid,
2989         arg_size: usize,
2990         argp: *mut c_void,
2991         status: *mut i32,
2992         option: *mut SceKernelSMOption,
2993     ) -> i32;
2994     pub fn sceKernelStopModule(
2995         mod_id: SceUid,
2996         arg_size: usize,
2997         argp: *mut c_void,
2998         status: *mut i32,
2999         option: *mut SceKernelSMOption,
3000     ) -> i32;
3001     pub fn sceKernelUnloadModule(mod_id: SceUid) -> i32;
3002     pub fn sceKernelSelfStopUnloadModule(
3003         unknown: i32,
3004         arg_size: usize,
3005         argp: *mut c_void,
3006     ) -> i32;
3007     pub fn sceKernelStopUnloadSelfModule(
3008         arg_size: usize,
3009         argp: *mut c_void,
3010         status: *mut i32,
3011         option: *mut SceKernelSMOption,
3012     ) -> i32;
3013     pub fn sceKernelQueryModuleInfo(
3014         mod_id: SceUid,
3015         info: *mut SceKernelModuleInfo,
3016     ) -> i32;
3017     pub fn sceKernelGetModuleIdList(
3018         read_buf: *mut SceUid,
3019         read_buf_size: i32,
3020         id_count: *mut i32,
3021     ) -> i32;
3022 
3023     pub fn sceKernelVolatileMemLock(
3024         unk: i32,
3025         ptr: *mut *mut c_void,
3026         size: *mut i32,
3027     ) -> i32;
3028     pub fn sceKernelVolatileMemTryLock(
3029         unk: i32,
3030         ptr: *mut *mut c_void,
3031         size: *mut i32,
3032     ) -> i32;
3033     pub fn sceKernelVolatileMemUnlock(unk: i32) -> i32;
3034 
3035     pub fn sceKernelStdin() -> SceUid;
3036     pub fn sceKernelStdout() -> SceUid;
3037     pub fn sceKernelStderr() -> SceUid;
3038 
3039     pub fn sceKernelGetThreadmanIdType(uid: SceUid) -> SceKernelIdListType;
3040     pub fn sceKernelCreateThread(
3041         name: *const u8,
3042         entry: SceKernelThreadEntry,
3043         init_priority: i32,
3044         stack_size: i32,
3045         attr: i32,
3046         option: *mut SceKernelThreadOptParam,
3047     ) -> SceUid;
3048     pub fn sceKernelDeleteThread(thid: SceUid) -> i32;
3049     pub fn sceKernelStartThread(
3050         id: SceUid,
3051         arg_len: usize,
3052         arg_p: *mut c_void,
3053     ) -> i32;
3054     pub fn sceKernelExitThread(status: i32) -> i32;
3055     pub fn sceKernelExitDeleteThread(status: i32) -> i32;
3056     pub fn sceKernelTerminateThread(thid: SceUid) -> i32;
3057     pub fn sceKernelTerminateDeleteThread(thid: SceUid) -> i32;
3058     pub fn sceKernelSuspendDispatchThread() -> i32;
3059     pub fn sceKernelResumeDispatchThread(state: i32) -> i32;
3060     pub fn sceKernelSleepThread() -> i32;
3061     pub fn sceKernelSleepThreadCB() -> i32;
3062     pub fn sceKernelWakeupThread(thid: SceUid) -> i32;
3063     pub fn sceKernelCancelWakeupThread(thid: SceUid) -> i32;
3064     pub fn sceKernelSuspendThread(thid: SceUid) -> i32;
3065     pub fn sceKernelResumeThread(thid: SceUid) -> i32;
3066     pub fn sceKernelWaitThreadEnd(thid: SceUid, timeout: *mut u32) -> i32;
3067     pub fn sceKernelWaitThreadEndCB(thid: SceUid, timeout: *mut u32) -> i32;
3068     pub fn sceKernelDelayThread(delay: u32) -> i32;
3069     pub fn sceKernelDelayThreadCB(delay: u32) -> i32;
3070     pub fn sceKernelDelaySysClockThread(delay: *mut SceKernelSysClock) -> i32;
3071     pub fn sceKernelDelaySysClockThreadCB(
3072         delay: *mut SceKernelSysClock,
3073     ) -> i32;
3074     pub fn sceKernelChangeCurrentThreadAttr(unknown: i32, attr: i32) -> i32;
3075     pub fn sceKernelChangeThreadPriority(thid: SceUid, priority: i32) -> i32;
3076     pub fn sceKernelRotateThreadReadyQueue(priority: i32) -> i32;
3077     pub fn sceKernelReleaseWaitThread(thid: SceUid) -> i32;
3078     pub fn sceKernelGetThreadId() -> i32;
3079     pub fn sceKernelGetThreadCurrentPriority() -> i32;
3080     pub fn sceKernelGetThreadExitStatus(thid: SceUid) -> i32;
3081     pub fn sceKernelCheckThreadStack() -> i32;
3082     pub fn sceKernelGetThreadStackFreeSize(thid: SceUid) -> i32;
3083     pub fn sceKernelReferThreadStatus(
3084         thid: SceUid,
3085         info: *mut SceKernelThreadInfo,
3086     ) -> i32;
3087     pub fn sceKernelReferThreadRunStatus(
3088         thid: SceUid,
3089         status: *mut SceKernelThreadRunStatus,
3090     ) -> i32;
3091     pub fn sceKernelCreateSema(
3092         name: *const u8,
3093         attr: u32,
3094         init_val: i32,
3095         max_val: i32,
3096         option: *mut SceKernelSemaOptParam,
3097     ) -> SceUid;
3098     pub fn sceKernelDeleteSema(sema_id: SceUid) -> i32;
3099     pub fn sceKernelSignalSema(sema_id: SceUid, signal: i32) -> i32;
3100     pub fn sceKernelWaitSema(
3101         sema_id: SceUid,
3102         signal: i32,
3103         timeout: *mut u32,
3104     ) -> i32;
3105     pub fn sceKernelWaitSemaCB(
3106         sema_id: SceUid,
3107         signal: i32,
3108         timeout: *mut u32,
3109     ) -> i32;
3110     pub fn sceKernelPollSema(sema_id: SceUid, signal: i32) -> i32;
3111     pub fn sceKernelReferSemaStatus(
3112         sema_id: SceUid,
3113         info: *mut SceKernelSemaInfo,
3114     ) -> i32;
3115     pub fn sceKernelCreateEventFlag(
3116         name: *const u8,
3117         attr: i32,
3118         bits: i32,
3119         opt: *mut SceKernelEventFlagOptParam,
3120     ) -> SceUid;
3121     pub fn sceKernelSetEventFlag(ev_id: SceUid, bits: u32) -> i32;
3122     pub fn sceKernelClearEventFlag(ev_id: SceUid, bits: u32) -> i32;
3123     pub fn sceKernelPollEventFlag(
3124         ev_id: SceUid,
3125         bits: u32,
3126         wait: i32,
3127         out_bits: *mut u32,
3128     ) -> i32;
3129     pub fn sceKernelWaitEventFlag(
3130         ev_id: SceUid,
3131         bits: u32,
3132         wait: i32,
3133         out_bits: *mut u32,
3134         timeout: *mut u32,
3135     ) -> i32;
3136     pub fn sceKernelWaitEventFlagCB(
3137         ev_id: SceUid,
3138         bits: u32,
3139         wait: i32,
3140         out_bits: *mut u32,
3141         timeout: *mut u32,
3142     ) -> i32;
3143     pub fn sceKernelDeleteEventFlag(ev_id: SceUid) -> i32;
3144     pub fn sceKernelReferEventFlagStatus(
3145         event: SceUid,
3146         status: *mut SceKernelEventFlagInfo,
3147     ) -> i32;
3148     pub fn sceKernelCreateMbx(
3149         name: *const u8,
3150         attr: u32,
3151         option: *mut SceKernelMbxOptParam,
3152     ) -> SceUid;
3153     pub fn sceKernelDeleteMbx(mbx_id: SceUid) -> i32;
3154     pub fn sceKernelSendMbx(mbx_id: SceUid, message: *mut c_void) -> i32;
3155     pub fn sceKernelReceiveMbx(
3156         mbx_id: SceUid,
3157         message: *mut *mut c_void,
3158         timeout: *mut u32,
3159     ) -> i32;
3160     pub fn sceKernelReceiveMbxCB(
3161         mbx_id: SceUid,
3162         message: *mut *mut c_void,
3163         timeout: *mut u32,
3164     ) -> i32;
3165     pub fn sceKernelPollMbx(mbx_id: SceUid, pmessage: *mut *mut c_void)
3166     -> i32;
3167     pub fn sceKernelCancelReceiveMbx(mbx_id: SceUid, num: *mut i32) -> i32;
3168     pub fn sceKernelReferMbxStatus(
3169         mbx_id: SceUid,
3170         info: *mut SceKernelMbxInfo,
3171     ) -> i32;
3172     pub fn sceKernelSetAlarm(
3173         clock: u32,
3174         handler: SceKernelAlarmHandler,
3175         common: *mut c_void,
3176     ) -> SceUid;
3177     pub fn sceKernelSetSysClockAlarm(
3178         clock: *mut SceKernelSysClock,
3179         handler: *mut SceKernelAlarmHandler,
3180         common: *mut c_void,
3181     ) -> SceUid;
3182     pub fn sceKernelCancelAlarm(alarm_id: SceUid) -> i32;
3183     pub fn sceKernelReferAlarmStatus(
3184         alarm_id: SceUid,
3185         info: *mut SceKernelAlarmInfo,
3186     ) -> i32;
3187     pub fn sceKernelCreateCallback(
3188         name: *const u8,
3189         func: SceKernelCallbackFunction,
3190         arg: *mut c_void,
3191     ) -> SceUid;
3192     pub fn sceKernelReferCallbackStatus(
3193         cb: SceUid,
3194         status: *mut SceKernelCallbackInfo,
3195     ) -> i32;
3196     pub fn sceKernelDeleteCallback(cb: SceUid) -> i32;
3197     pub fn sceKernelNotifyCallback(cb: SceUid, arg2: i32) -> i32;
3198     pub fn sceKernelCancelCallback(cb: SceUid) -> i32;
3199     pub fn sceKernelGetCallbackCount(cb: SceUid) -> i32;
3200     pub fn sceKernelCheckCallback() -> i32;
3201     pub fn sceKernelGetThreadmanIdList(
3202         type_: SceKernelIdListType,
3203         read_buf: *mut SceUid,
3204         read_buf_size: i32,
3205         id_count: *mut i32,
3206     ) -> i32;
3207     pub fn sceKernelReferSystemStatus(
3208         status: *mut SceKernelSystemStatus,
3209     ) -> i32;
3210     pub fn sceKernelCreateMsgPipe(
3211         name: *const u8,
3212         part: i32,
3213         attr: i32,
3214         unk1: *mut c_void,
3215         opt: *mut c_void,
3216     ) -> SceUid;
3217     pub fn sceKernelDeleteMsgPipe(uid: SceUid) -> i32;
3218     pub fn sceKernelSendMsgPipe(
3219         uid: SceUid,
3220         message: *mut c_void,
3221         size: u32,
3222         unk1: i32,
3223         unk2: *mut c_void,
3224         timeout: *mut u32,
3225     ) -> i32;
3226     pub fn sceKernelSendMsgPipeCB(
3227         uid: SceUid,
3228         message: *mut c_void,
3229         size: u32,
3230         unk1: i32,
3231         unk2: *mut c_void,
3232         timeout: *mut u32,
3233     ) -> i32;
3234     pub fn sceKernelTrySendMsgPipe(
3235         uid: SceUid,
3236         message: *mut c_void,
3237         size: u32,
3238         unk1: i32,
3239         unk2: *mut c_void,
3240     ) -> i32;
3241     pub fn sceKernelReceiveMsgPipe(
3242         uid: SceUid,
3243         message: *mut c_void,
3244         size: u32,
3245         unk1: i32,
3246         unk2: *mut c_void,
3247         timeout: *mut u32,
3248     ) -> i32;
3249     pub fn sceKernelReceiveMsgPipeCB(
3250         uid: SceUid,
3251         message: *mut c_void,
3252         size: u32,
3253         unk1: i32,
3254         unk2: *mut c_void,
3255         timeout: *mut u32,
3256     ) -> i32;
3257     pub fn sceKernelTryReceiveMsgPipe(
3258         uid: SceUid,
3259         message: *mut c_void,
3260         size: u32,
3261         unk1: i32,
3262         unk2: *mut c_void,
3263     ) -> i32;
3264     pub fn sceKernelCancelMsgPipe(
3265         uid: SceUid,
3266         send: *mut i32,
3267         recv: *mut i32,
3268     ) -> i32;
3269     pub fn sceKernelReferMsgPipeStatus(
3270         uid: SceUid,
3271         info: *mut SceKernelMppInfo,
3272     ) -> i32;
3273     pub fn sceKernelCreateVpl(
3274         name: *const u8,
3275         part: i32,
3276         attr: i32,
3277         size: u32,
3278         opt: *mut SceKernelVplOptParam,
3279     ) -> SceUid;
3280     pub fn sceKernelDeleteVpl(uid: SceUid) -> i32;
3281     pub fn sceKernelAllocateVpl(
3282         uid: SceUid,
3283         size: u32,
3284         data: *mut *mut c_void,
3285         timeout: *mut u32,
3286     ) -> i32;
3287     pub fn sceKernelAllocateVplCB(
3288         uid: SceUid,
3289         size: u32,
3290         data: *mut *mut c_void,
3291         timeout: *mut u32,
3292     ) -> i32;
3293     pub fn sceKernelTryAllocateVpl(
3294         uid: SceUid,
3295         size: u32,
3296         data: *mut *mut c_void,
3297     ) -> i32;
3298     pub fn sceKernelFreeVpl(uid: SceUid, data: *mut c_void) -> i32;
3299     pub fn sceKernelCancelVpl(uid: SceUid, num: *mut i32) -> i32;
3300     pub fn sceKernelReferVplStatus(
3301         uid: SceUid,
3302         info: *mut SceKernelVplInfo,
3303     ) -> i32;
3304     pub fn sceKernelCreateFpl(
3305         name: *const u8,
3306         part: i32,
3307         attr: i32,
3308         size: u32,
3309         blocks: u32,
3310         opt: *mut SceKernelFplOptParam,
3311     ) -> i32;
3312     pub fn sceKernelDeleteFpl(uid: SceUid) -> i32;
3313     pub fn sceKernelAllocateFpl(
3314         uid: SceUid,
3315         data: *mut *mut c_void,
3316         timeout: *mut u32,
3317     ) -> i32;
3318     pub fn sceKernelAllocateFplCB(
3319         uid: SceUid,
3320         data: *mut *mut c_void,
3321         timeout: *mut u32,
3322     ) -> i32;
3323     pub fn sceKernelTryAllocateFpl(uid: SceUid, data: *mut *mut c_void)
3324     -> i32;
3325     pub fn sceKernelFreeFpl(uid: SceUid, data: *mut c_void) -> i32;
3326     pub fn sceKernelCancelFpl(uid: SceUid, pnum: *mut i32) -> i32;
3327     pub fn sceKernelReferFplStatus(
3328         uid: SceUid,
3329         info: *mut SceKernelFplInfo,
3330     ) -> i32;
3331     pub fn sceKernelUSec2SysClock(
3332         usec: u32,
3333         clock: *mut SceKernelSysClock,
3334     ) -> i32;
3335     pub fn sceKernelUSec2SysClockWide(usec: u32) -> i64;
3336     pub fn sceKernelSysClock2USec(
3337         clock: *mut SceKernelSysClock,
3338         low: *mut u32,
3339         high: *mut u32,
3340     ) -> i32;
3341     pub fn sceKernelSysClock2USecWide(
3342         clock: i64,
3343         low: *mut u32,
3344         high: *mut u32,
3345     ) -> i32;
3346     pub fn sceKernelGetSystemTime(time: *mut SceKernelSysClock) -> i32;
3347     pub fn sceKernelGetSystemTimeWide() -> i64;
3348     pub fn sceKernelGetSystemTimeLow() -> u32;
3349     pub fn sceKernelCreateVTimer(
3350         name: *const u8,
3351         opt: *mut SceKernelVTimerOptParam,
3352     ) -> SceUid;
3353     pub fn sceKernelDeleteVTimer(uid: SceUid) -> i32;
3354     pub fn sceKernelGetVTimerBase(
3355         uid: SceUid,
3356         base: *mut SceKernelSysClock,
3357     ) -> i32;
3358     pub fn sceKernelGetVTimerBaseWide(uid: SceUid) -> i64;
3359     pub fn sceKernelGetVTimerTime(
3360         uid: SceUid,
3361         time: *mut SceKernelSysClock,
3362     ) -> i32;
3363     pub fn sceKernelGetVTimerTimeWide(uid: SceUid) -> i64;
3364     pub fn sceKernelSetVTimerTime(
3365         uid: SceUid,
3366         time: *mut SceKernelSysClock,
3367     ) -> i32;
3368     pub fn sceKernelSetVTimerTimeWide(uid: SceUid, time: i64) -> i64;
3369     pub fn sceKernelStartVTimer(uid: SceUid) -> i32;
3370     pub fn sceKernelStopVTimer(uid: SceUid) -> i32;
3371     pub fn sceKernelSetVTimerHandler(
3372         uid: SceUid,
3373         time: *mut SceKernelSysClock,
3374         handler: SceKernelVTimerHandler,
3375         common: *mut c_void,
3376     ) -> i32;
3377     pub fn sceKernelSetVTimerHandlerWide(
3378         uid: SceUid,
3379         time: i64,
3380         handler: SceKernelVTimerHandlerWide,
3381         common: *mut c_void,
3382     ) -> i32;
3383     pub fn sceKernelCancelVTimerHandler(uid: SceUid) -> i32;
3384     pub fn sceKernelReferVTimerStatus(
3385         uid: SceUid,
3386         info: *mut SceKernelVTimerInfo,
3387     ) -> i32;
3388     pub fn sceKernelRegisterThreadEventHandler(
3389         name: *const u8,
3390         thread_id: SceUid,
3391         mask: i32,
3392         handler: SceKernelThreadEventHandler,
3393         common: *mut c_void,
3394     ) -> SceUid;
3395     pub fn sceKernelReleaseThreadEventHandler(uid: SceUid) -> i32;
3396     pub fn sceKernelReferThreadEventHandlerStatus(
3397         uid: SceUid,
3398         info: *mut SceKernelThreadEventHandlerInfo,
3399     ) -> i32;
3400     pub fn sceKernelReferThreadProfiler() -> *mut DebugProfilerRegs;
3401     pub fn sceKernelReferGlobalProfiler() -> *mut DebugProfilerRegs;
3402 
3403     pub fn sceUsbStart(
3404         driver_name: *const u8,
3405         size: i32,
3406         args: *mut c_void,
3407     ) -> i32;
3408     pub fn sceUsbStop(
3409         driver_name: *const u8,
3410         size: i32,
3411         args: *mut c_void,
3412     ) -> i32;
3413     pub fn sceUsbActivate(pid: u32) -> i32;
3414     pub fn sceUsbDeactivate(pid: u32) -> i32;
3415     pub fn sceUsbGetState() -> i32;
3416     pub fn sceUsbGetDrvState(driver_name: *const u8) -> i32;
3417 }
3418 
3419 extern "C" {
3420     pub fn sceUsbCamSetupStill(param: *mut UsbCamSetupStillParam) -> i32;
3421     pub fn sceUsbCamSetupStillEx(param: *mut UsbCamSetupStillExParam) -> i32;
3422     pub fn sceUsbCamStillInputBlocking(buf: *mut u8, size: usize) -> i32;
3423     pub fn sceUsbCamStillInput(buf: *mut u8, size: usize) -> i32;
3424     pub fn sceUsbCamStillWaitInputEnd() -> i32;
3425     pub fn sceUsbCamStillPollInputEnd() -> i32;
3426     pub fn sceUsbCamStillCancelInput() -> i32;
3427     pub fn sceUsbCamStillGetInputLength() -> i32;
3428     pub fn sceUsbCamSetupVideo(
3429         param: *mut UsbCamSetupVideoParam,
3430         work_area: *mut c_void,
3431         work_area_size: i32,
3432     ) -> i32;
3433     pub fn sceUsbCamSetupVideoEx(
3434         param: *mut UsbCamSetupVideoExParam,
3435         work_area: *mut c_void,
3436         work_area_size: i32,
3437     ) -> i32;
3438     pub fn sceUsbCamStartVideo() -> i32;
3439     pub fn sceUsbCamStopVideo() -> i32;
3440     pub fn sceUsbCamReadVideoFrameBlocking(buf: *mut u8, size: usize) -> i32;
3441     pub fn sceUsbCamReadVideoFrame(buf: *mut u8, size: usize) -> i32;
3442     pub fn sceUsbCamWaitReadVideoFrameEnd() -> i32;
3443     pub fn sceUsbCamPollReadVideoFrameEnd() -> i32;
3444     pub fn sceUsbCamGetReadVideoFrameSize() -> i32;
3445     pub fn sceUsbCamSetSaturation(saturation: i32) -> i32;
3446     pub fn sceUsbCamSetBrightness(brightness: i32) -> i32;
3447     pub fn sceUsbCamSetContrast(contrast: i32) -> i32;
3448     pub fn sceUsbCamSetSharpness(sharpness: i32) -> i32;
3449     pub fn sceUsbCamSetImageEffectMode(effect_mode: UsbCamEffectMode) -> i32;
3450     pub fn sceUsbCamSetEvLevel(exposure_level: UsbCamEvLevel) -> i32;
3451     pub fn sceUsbCamSetReverseMode(reverse_flags: i32) -> i32;
3452     pub fn sceUsbCamSetZoom(zoom: i32) -> i32;
3453     pub fn sceUsbCamGetSaturation(saturation: *mut i32) -> i32;
3454     pub fn sceUsbCamGetBrightness(brightness: *mut i32) -> i32;
3455     pub fn sceUsbCamGetContrast(contrast: *mut i32) -> i32;
3456     pub fn sceUsbCamGetSharpness(sharpness: *mut i32) -> i32;
3457     pub fn sceUsbCamGetImageEffectMode(
3458         effect_mode: *mut UsbCamEffectMode,
3459     ) -> i32;
3460     pub fn sceUsbCamGetEvLevel(exposure_level: *mut UsbCamEvLevel) -> i32;
3461     pub fn sceUsbCamGetReverseMode(reverse_flags: *mut i32) -> i32;
3462     pub fn sceUsbCamGetZoom(zoom: *mut i32) -> i32;
3463     pub fn sceUsbCamAutoImageReverseSW(on: i32) -> i32;
3464     pub fn sceUsbCamGetAutoImageReverseState() -> i32;
3465     pub fn sceUsbCamGetLensDirection() -> i32;
3466 
3467     pub fn sceUsbstorBootRegisterNotify(event_flag: SceUid) -> i32;
3468     pub fn sceUsbstorBootUnregisterNotify(event_flag: u32) -> i32;
3469     pub fn sceUsbstorBootSetCapacity(size: u32) -> i32;
3470 
3471     pub fn scePowerRegisterCallback(slot: i32, cbid: SceUid) -> i32;
3472     pub fn scePowerUnregisterCallback(slot: i32) -> i32;
3473     pub fn scePowerIsPowerOnline() -> i32;
3474     pub fn scePowerIsBatteryExist() -> i32;
3475     pub fn scePowerIsBatteryCharging() -> i32;
3476     pub fn scePowerGetBatteryChargingStatus() -> i32;
3477     pub fn scePowerIsLowBattery() -> i32;
3478     pub fn scePowerGetBatteryLifePercent() -> i32;
3479     pub fn scePowerGetBatteryLifeTime() -> i32;
3480     pub fn scePowerGetBatteryTemp() -> i32;
3481     pub fn scePowerGetBatteryElec() -> i32;
3482     pub fn scePowerGetBatteryVolt() -> i32;
3483     pub fn scePowerSetCpuClockFrequency(cpufreq: i32) -> i32;
3484     pub fn scePowerSetBusClockFrequency(busfreq: i32) -> i32;
3485     pub fn scePowerGetCpuClockFrequency() -> i32;
3486     pub fn scePowerGetCpuClockFrequencyInt() -> i32;
3487     pub fn scePowerGetCpuClockFrequencyFloat() -> f32;
3488     pub fn scePowerGetBusClockFrequency() -> i32;
3489     pub fn scePowerGetBusClockFrequencyInt() -> i32;
3490     pub fn scePowerGetBusClockFrequencyFloat() -> f32;
3491     pub fn scePowerSetClockFrequency(
3492         pllfreq: i32,
3493         cpufreq: i32,
3494         busfreq: i32,
3495     ) -> i32;
3496     pub fn scePowerLock(unknown: i32) -> i32;
3497     pub fn scePowerUnlock(unknown: i32) -> i32;
3498     pub fn scePowerTick(t: PowerTick) -> i32;
3499     pub fn scePowerGetIdleTimer() -> i32;
3500     pub fn scePowerIdleTimerEnable(unknown: i32) -> i32;
3501     pub fn scePowerIdleTimerDisable(unknown: i32) -> i32;
3502     pub fn scePowerRequestStandby() -> i32;
3503     pub fn scePowerRequestSuspend() -> i32;
3504 
3505     pub fn sceWlanDevIsPowerOn() -> i32;
3506     pub fn sceWlanGetSwitchState() -> i32;
3507     pub fn sceWlanGetEtherAddr(ether_addr: *mut u8) -> i32;
3508 
3509     pub fn sceWlanDevAttach() -> i32;
3510     pub fn sceWlanDevDetach() -> i32;
3511 
3512     pub fn sceRtcGetTickResolution() -> u32;
3513     pub fn sceRtcGetCurrentTick(tick: *mut u64) -> i32;
3514     pub fn sceRtcGetCurrentClock(tm: *mut ScePspDateTime, tz: i32) -> i32;
3515     pub fn sceRtcGetCurrentClockLocalTime(tm: *mut ScePspDateTime) -> i32;
3516     pub fn sceRtcConvertUtcToLocalTime(
3517         tick_utc: *const u64,
3518         tick_local: *mut u64,
3519     ) -> i32;
3520     pub fn sceRtcConvertLocalTimeToUTC(
3521         tick_local: *const u64,
3522         tick_utc: *mut u64,
3523     ) -> i32;
3524     pub fn sceRtcIsLeapYear(year: i32) -> i32;
3525     pub fn sceRtcGetDaysInMonth(year: i32, month: i32) -> i32;
3526     pub fn sceRtcGetDayOfWeek(year: i32, month: i32, day: i32) -> i32;
3527     pub fn sceRtcCheckValid(date: *const ScePspDateTime) -> i32;
3528     pub fn sceRtcSetTick(date: *mut ScePspDateTime, tick: *const u64) -> i32;
3529     pub fn sceRtcGetTick(date: *const ScePspDateTime, tick: *mut u64) -> i32;
3530     pub fn sceRtcCompareTick(tick1: *const u64, tick2: *const u64) -> i32;
3531     pub fn sceRtcTickAddTicks(
3532         dest_tick: *mut u64,
3533         src_tick: *const u64,
3534         num_ticks: u64,
3535     ) -> i32;
3536     pub fn sceRtcTickAddMicroseconds(
3537         dest_tick: *mut u64,
3538         src_tick: *const u64,
3539         num_ms: u64,
3540     ) -> i32;
3541     pub fn sceRtcTickAddSeconds(
3542         dest_tick: *mut u64,
3543         src_tick: *const u64,
3544         num_seconds: u64,
3545     ) -> i32;
3546     pub fn sceRtcTickAddMinutes(
3547         dest_tick: *mut u64,
3548         src_tick: *const u64,
3549         num_minutes: u64,
3550     ) -> i32;
3551     pub fn sceRtcTickAddHours(
3552         dest_tick: *mut u64,
3553         src_tick: *const u64,
3554         num_hours: u64,
3555     ) -> i32;
3556     pub fn sceRtcTickAddDays(
3557         dest_tick: *mut u64,
3558         src_tick: *const u64,
3559         num_days: u64,
3560     ) -> i32;
3561     pub fn sceRtcTickAddWeeks(
3562         dest_tick: *mut u64,
3563         src_tick: *const u64,
3564         num_weeks: u64,
3565     ) -> i32;
3566     pub fn sceRtcTickAddMonths(
3567         dest_tick: *mut u64,
3568         src_tick: *const u64,
3569         num_months: u64,
3570     ) -> i32;
3571     pub fn sceRtcTickAddYears(
3572         dest_tick: *mut u64,
3573         src_tick: *const u64,
3574         num_years: u64,
3575     ) -> i32;
3576     pub fn sceRtcSetTime_t(date: *mut ScePspDateTime, time: u32) -> i32;
3577     pub fn sceRtcGetTime_t(date: *const ScePspDateTime, time: *mut u32) -> i32;
3578     pub fn sceRtcSetTime64_t(date: *mut ScePspDateTime, time: u64) -> i32;
3579     pub fn sceRtcGetTime64_t(
3580         date: *const ScePspDateTime, time: *mut u64
3581     ) -> i32;
3582     pub fn sceRtcSetDosTime(date: *mut ScePspDateTime, dos_time: u32) -> i32;
3583     pub fn sceRtcGetDosTime(date: *mut ScePspDateTime, dos_time: u32) -> i32;
3584     pub fn sceRtcSetWin32FileTime(
3585         date: *mut ScePspDateTime,
3586         time: *mut u64,
3587     ) -> i32;
3588     pub fn sceRtcGetWin32FileTime(
3589         date: *mut ScePspDateTime,
3590         time: *mut u64,
3591     ) -> i32;
3592     pub fn sceRtcParseDateTime(
3593         dest_tick: *mut u64,
3594         date_string: *const u8,
3595     ) -> i32;
3596     pub fn sceRtcFormatRFC3339(
3597         psz_date_time: *mut char,
3598         p_utc: *const u64,
3599         time_zone_minutes: i32,
3600     ) -> i32;
3601     pub fn sceRtcFormatRFC3339LocalTime(
3602         psz_date_time: *mut char,
3603         p_utc: *const u64,
3604     ) -> i32;
3605     pub fn sceRtcParseRFC3339(
3606         p_utc: *mut u64,
3607         psz_date_time: *const u8,
3608     ) -> i32;
3609     pub fn sceRtcFormatRFC2822(
3610         psz_date_time: *mut char,
3611         p_utc: *const u64,
3612         time_zone_minutes: i32,
3613     ) -> i32;
3614     pub fn sceRtcFormatRFC2822LocalTime(
3615         psz_date_time: *mut char,
3616         p_utc: *const u64,
3617     ) -> i32;
3618 
3619     pub fn sceIoOpen(
3620         file: *const u8,
3621         flags: i32,
3622         permissions: IoPermissions,
3623     ) -> SceUid;
3624     pub fn sceIoOpenAsync(
3625         file: *const u8,
3626         flags: i32,
3627         permissions: IoPermissions,
3628     ) -> SceUid;
3629     pub fn sceIoClose(fd: SceUid) -> i32;
3630     pub fn sceIoCloseAsync(fd: SceUid) -> i32;
3631     pub fn sceIoRead(fd: SceUid, data: *mut c_void, size: u32) -> i32;
3632     pub fn sceIoReadAsync(fd: SceUid, data: *mut c_void, size: u32) -> i32;
3633     pub fn sceIoWrite(fd: SceUid, data: *const c_void, size: usize) -> i32;
3634     pub fn sceIoWriteAsync(fd: SceUid, data: *const c_void, size: u32) -> i32;
3635     pub fn sceIoLseek(fd: SceUid, offset: i64, whence: IoWhence) -> i64;
3636     pub fn sceIoLseekAsync(fd: SceUid, offset: i64, whence: IoWhence) -> i32;
3637     pub fn sceIoLseek32(fd: SceUid, offset: i32, whence: IoWhence) -> i32;
3638     pub fn sceIoLseek32Async(fd: SceUid, offset: i32, whence: IoWhence)
3639     -> i32;
3640     pub fn sceIoRemove(file: *const u8) -> i32;
3641     pub fn sceIoMkdir(dir: *const u8, mode: IoPermissions) -> i32;
3642     pub fn sceIoRmdir(path: *const u8) -> i32;
3643     pub fn sceIoChdir(path: *const u8) -> i32;
3644     pub fn sceIoRename(oldname: *const u8, newname: *const u8) -> i32;
3645     pub fn sceIoDopen(dirname: *const u8) -> SceUid;
3646     pub fn sceIoDread(fd: SceUid, dir: *mut SceIoDirent) -> i32;
3647     pub fn sceIoDclose(fd: SceUid) -> i32;
3648     pub fn sceIoDevctl(
3649         dev: *const u8,
3650         cmd: u32,
3651         indata: *mut c_void,
3652         inlen: i32,
3653         outdata: *mut c_void,
3654         outlen: i32,
3655     ) -> i32;
3656     pub fn sceIoAssign(
3657         dev1: *const u8,
3658         dev2: *const u8,
3659         dev3: *const u8,
3660         mode: IoAssignPerms,
3661         unk1: *mut c_void,
3662         unk2: i32,
3663     ) -> i32;
3664     pub fn sceIoUnassign(dev: *const u8) -> i32;
3665     pub fn sceIoGetstat(file: *const u8, stat: *mut SceIoStat) -> i32;
3666     pub fn sceIoChstat(
3667         file: *const u8,
3668         stat: *mut SceIoStat,
3669         bits: i32,
3670     ) -> i32;
3671     pub fn sceIoIoctl(
3672         fd: SceUid,
3673         cmd: u32,
3674         indata: *mut c_void,
3675         inlen: i32,
3676         outdata: *mut c_void,
3677         outlen: i32,
3678     ) -> i32;
3679     pub fn sceIoIoctlAsync(
3680         fd: SceUid,
3681         cmd: u32,
3682         indata: *mut c_void,
3683         inlen: i32,
3684         outdata: *mut c_void,
3685         outlen: i32,
3686     ) -> i32;
3687     pub fn sceIoSync(device: *const u8, unk: u32) -> i32;
3688     pub fn sceIoWaitAsync(fd: SceUid, res: *mut i64) -> i32;
3689     pub fn sceIoWaitAsyncCB(fd: SceUid, res: *mut i64) -> i32;
3690     pub fn sceIoPollAsync(fd: SceUid, res: *mut i64) -> i32;
3691     pub fn sceIoGetAsyncStat(fd: SceUid, poll: i32, res: *mut i64) -> i32;
3692     pub fn sceIoCancel(fd: SceUid) -> i32;
3693     pub fn sceIoGetDevType(fd: SceUid) -> i32;
3694     pub fn sceIoChangeAsyncPriority(fd: SceUid, pri: i32) -> i32;
3695     pub fn sceIoSetAsyncCallback(
3696         fd: SceUid,
3697         cb: SceUid,
3698         argp: *mut c_void,
3699     ) -> i32;
3700 
3701     pub fn sceJpegInitMJpeg() -> i32;
3702     pub fn sceJpegFinishMJpeg() -> i32;
3703     pub fn sceJpegCreateMJpeg(width: i32, height: i32) -> i32;
3704     pub fn sceJpegDeleteMJpeg() -> i32;
3705     pub fn sceJpegDecodeMJpeg(
3706         jpeg_buf: *mut u8,
3707         size: usize,
3708         rgba: *mut c_void,
3709         unk: u32,
3710     ) -> i32;
3711 
3712     pub fn sceUmdCheckMedium() -> i32;
3713     pub fn sceUmdGetDiscInfo(info: *mut UmdInfo) -> i32;
3714     pub fn sceUmdActivate(unit: i32, drive: *const u8) -> i32;
3715     pub fn sceUmdDeactivate(unit: i32, drive: *const u8) -> i32;
3716     pub fn sceUmdWaitDriveStat(state: i32) -> i32;
3717     pub fn sceUmdWaitDriveStatWithTimer(state: i32, timeout: u32) -> i32;
3718     pub fn sceUmdWaitDriveStatCB(state: i32, timeout: u32) -> i32;
3719     pub fn sceUmdCancelWaitDriveStat() -> i32;
3720     pub fn sceUmdGetDriveStat() -> i32;
3721     pub fn sceUmdGetErrorStat() -> i32;
3722     pub fn sceUmdRegisterUMDCallBack(cbid: i32) -> i32;
3723     pub fn sceUmdUnRegisterUMDCallBack(cbid: i32) -> i32;
3724     pub fn sceUmdReplacePermit() -> i32;
3725     pub fn sceUmdReplaceProhibit() -> i32;
3726 
3727     pub fn sceMpegInit() -> i32;
3728     pub fn sceMpegFinish();
3729     pub fn sceMpegRingbufferQueryMemSize(packets: i32) -> i32;
3730     pub fn sceMpegRingbufferConstruct(
3731         ringbuffer: *mut SceMpegRingbuffer,
3732         packets: i32,
3733         data: *mut c_void,
3734         size: i32,
3735         callback: SceMpegRingbufferCb,
3736         cb_param: *mut c_void,
3737     ) -> i32;
3738     pub fn sceMpegRingbufferDestruct(ringbuffer: *mut SceMpegRingbuffer);
3739     pub fn sceMpegRingbufferAvailableSize(
3740         ringbuffer: *mut SceMpegRingbuffer,
3741     ) -> i32;
3742     pub fn sceMpegRingbufferPut(
3743         ringbuffer: *mut SceMpegRingbuffer,
3744         num_packets: i32,
3745         available: i32,
3746     ) -> i32;
3747     pub fn sceMpegQueryMemSize(unk: i32) -> i32;
3748     pub fn sceMpegCreate(
3749         handle: SceMpeg,
3750         data: *mut c_void,
3751         size: i32,
3752         ringbuffer: *mut SceMpegRingbuffer,
3753         frame_width: i32,
3754         unk1: i32,
3755         unk2: i32,
3756     ) -> i32;
3757     pub fn sceMpegDelete(handle: SceMpeg);
3758     pub fn sceMpegQueryStreamOffset(
3759         handle: SceMpeg,
3760         buffer: *mut c_void,
3761         offset: *mut i32,
3762     ) -> i32;
3763     pub fn sceMpegQueryStreamSize(buffer: *mut c_void, size: *mut i32) -> i32;
3764     pub fn sceMpegRegistStream(
3765         handle: SceMpeg,
3766         stream_id: i32,
3767         unk: i32,
3768     ) -> SceMpegStream;
3769     pub fn sceMpegUnRegistStream(handle: SceMpeg, stream: SceMpegStream);
3770     pub fn sceMpegFlushAllStream(handle: SceMpeg) -> i32;
3771     pub fn sceMpegMallocAvcEsBuf(handle: SceMpeg) -> *mut c_void;
3772     pub fn sceMpegFreeAvcEsBuf(handle: SceMpeg, buf: *mut c_void);
3773     pub fn sceMpegQueryAtracEsSize(
3774         handle: SceMpeg,
3775         es_size: *mut i32,
3776         out_size: *mut i32,
3777     ) -> i32;
3778     pub fn sceMpegInitAu(
3779         handle: SceMpeg,
3780         es_buffer: *mut c_void,
3781         au: *mut SceMpegAu,
3782     ) -> i32;
3783     pub fn sceMpegGetAvcAu(
3784         handle: SceMpeg,
3785         stream: SceMpegStream,
3786         au: *mut SceMpegAu,
3787         unk: *mut i32,
3788     ) -> i32;
3789     pub fn sceMpegAvcDecodeMode(
3790         handle: SceMpeg,
3791         mode: *mut SceMpegAvcMode,
3792     ) -> i32;
3793     pub fn sceMpegAvcDecode(
3794         handle: SceMpeg,
3795         au: *mut SceMpegAu,
3796         iframe_width: i32,
3797         buffer: *mut c_void,
3798         init: *mut i32,
3799     ) -> i32;
3800     pub fn sceMpegAvcDecodeStop(
3801         handle: SceMpeg,
3802         frame_width: i32,
3803         buffer: *mut c_void,
3804         status: *mut i32,
3805     ) -> i32;
3806     pub fn sceMpegGetAtracAu(
3807         handle: SceMpeg,
3808         stream: SceMpegStream,
3809         au: *mut SceMpegAu,
3810         unk: *mut c_void,
3811     ) -> i32;
3812     pub fn sceMpegAtracDecode(
3813         handle: SceMpeg,
3814         au: *mut SceMpegAu,
3815         buffer: *mut c_void,
3816         init: i32,
3817     ) -> i32;
3818 
3819     pub fn sceMpegBaseYCrCbCopyVme(
3820         yuv_buffer: *mut c_void,
3821         buffer: *mut i32,
3822         type_: i32,
3823     ) -> i32;
3824     pub fn sceMpegBaseCscInit(width: i32) -> i32;
3825     pub fn sceMpegBaseCscVme(
3826         rgb_buffer: *mut c_void,
3827         rgb_buffer2: *mut c_void,
3828         width: i32,
3829         y_cr_cb_buffer: *mut SceMpegYCrCbBuffer,
3830     ) -> i32;
3831     pub fn sceMpegbase_BEA18F91(lli: *mut SceMpegLLI) -> i32;
3832 
3833     pub fn sceHprmPeekCurrentKey(key: *mut i32) -> i32;
3834     pub fn sceHprmPeekLatch(latch: *mut [u32; 4]) -> i32;
3835     pub fn sceHprmReadLatch(latch: *mut [u32; 4]) -> i32;
3836     pub fn sceHprmIsHeadphoneExist() -> i32;
3837     pub fn sceHprmIsRemoteExist() -> i32;
3838     pub fn sceHprmIsMicrophoneExist() -> i32;
3839 
3840     pub fn sceGuDepthBuffer(zbp: *mut c_void, zbw: i32);
3841     pub fn sceGuDispBuffer(
3842         width: i32,
3843         height: i32,
3844         dispbp: *mut c_void,
3845         dispbw: i32,
3846     );
3847     pub fn sceGuDrawBuffer(
3848         psm: DisplayPixelFormat,
3849         fbp: *mut c_void,
3850         fbw: i32,
3851     );
3852     pub fn sceGuDrawBufferList(
3853         psm: DisplayPixelFormat,
3854         fbp: *mut c_void,
3855         fbw: i32,
3856     );
3857     pub fn sceGuDisplay(state: bool) -> bool;
3858     pub fn sceGuDepthFunc(function: DepthFunc);
3859     pub fn sceGuDepthMask(mask: i32);
3860     pub fn sceGuDepthOffset(offset: i32);
3861     pub fn sceGuDepthRange(near: i32, far: i32);
3862     pub fn sceGuFog(near: f32, far: f32, color: u32);
3863     pub fn sceGuInit();
3864     pub fn sceGuTerm();
3865     pub fn sceGuBreak(mode: i32);
3866     pub fn sceGuContinue();
3867     pub fn sceGuSetCallback(
3868         signal: GuCallbackId,
3869         callback: GuCallback,
3870     ) -> GuCallback;
3871     pub fn sceGuSignal(behavior: SignalBehavior, signal: i32);
3872     pub fn sceGuSendCommandf(cmd: GeCommand, argument: f32);
3873     pub fn sceGuSendCommandi(cmd: GeCommand, argument: i32);
3874     pub fn sceGuGetMemory(size: i32) -> *mut c_void;
3875     pub fn sceGuStart(context_type: GuContextType, list: *mut c_void);
3876     pub fn sceGuFinish() -> i32;
3877     pub fn sceGuFinishId(id: u32) -> i32;
3878     pub fn sceGuCallList(list: *const c_void);
3879     pub fn sceGuCallMode(mode: i32);
3880     pub fn sceGuCheckList() -> i32;
3881     pub fn sceGuSendList(
3882         mode: GuQueueMode,
3883         list: *const c_void,
3884         context: *mut GeContext,
3885     );
3886     pub fn sceGuSwapBuffers() -> *mut c_void;
3887     pub fn sceGuSync(
3888         mode: GuSyncMode,
3889         behavior: GuSyncBehavior,
3890     ) -> GeListState;
3891     pub fn sceGuDrawArray(
3892         prim: GuPrimitive,
3893         vtype: i32,
3894         count: i32,
3895         indices: *const c_void,
3896         vertices: *const c_void,
3897     );
3898     pub fn sceGuBeginObject(
3899         vtype: i32,
3900         count: i32,
3901         indices: *const c_void,
3902         vertices: *const c_void,
3903     );
3904     pub fn sceGuEndObject();
3905     pub fn sceGuSetStatus(state: GuState, status: i32);
3906     pub fn sceGuGetStatus(state: GuState) -> bool;
3907     pub fn sceGuSetAllStatus(status: i32);
3908     pub fn sceGuGetAllStatus() -> i32;
3909     pub fn sceGuEnable(state: GuState);
3910     pub fn sceGuDisable(state: GuState);
3911     pub fn sceGuLight(
3912         light: i32,
3913         type_: LightType,
3914         components: i32,
3915         position: &ScePspFVector3,
3916     );
3917     pub fn sceGuLightAtt(light: i32, atten0: f32, atten1: f32, atten2: f32);
3918     pub fn sceGuLightColor(light: i32, component: i32, color: u32);
3919     pub fn sceGuLightMode(mode: LightMode);
3920     pub fn sceGuLightSpot(
3921         light: i32,
3922         direction: &ScePspFVector3,
3923         exponent: f32,
3924         cutoff: f32,
3925     );
3926     pub fn sceGuClear(flags: i32);
3927     pub fn sceGuClearColor(color: u32);
3928     pub fn sceGuClearDepth(depth: u32);
3929     pub fn sceGuClearStencil(stencil: u32);
3930     pub fn sceGuPixelMask(mask: u32);
3931     pub fn sceGuColor(color: u32);
3932     pub fn sceGuColorFunc(func: ColorFunc, color: u32, mask: u32);
3933     pub fn sceGuColorMaterial(components: i32);
3934     pub fn sceGuAlphaFunc(func: AlphaFunc, value: i32, mask: i32);
3935     pub fn sceGuAmbient(color: u32);
3936     pub fn sceGuAmbientColor(color: u32);
3937     pub fn sceGuBlendFunc(
3938         op: BlendOp,
3939         src: BlendSrc,
3940         dest: BlendDst,
3941         src_fix: u32,
3942         dest_fix: u32,
3943     );
3944     pub fn sceGuMaterial(components: i32, color: u32);
3945     pub fn sceGuModelColor(
3946         emissive: u32,
3947         ambient: u32,
3948         diffuse: u32,
3949         specular: u32,
3950     );
3951     pub fn sceGuStencilFunc(func: StencilFunc, ref_: i32, mask: i32);
3952     pub fn sceGuStencilOp(
3953         fail: StencilOperation,
3954         zfail: StencilOperation,
3955         zpass: StencilOperation,
3956     );
3957     pub fn sceGuSpecular(power: f32);
3958     pub fn sceGuFrontFace(order: FrontFaceDirection);
3959     pub fn sceGuLogicalOp(op: LogicalOperation);
3960     pub fn sceGuSetDither(matrix: &ScePspIMatrix4);
3961     pub fn sceGuShadeModel(mode: ShadingModel);
3962     pub fn sceGuCopyImage(
3963         psm: DisplayPixelFormat,
3964         sx: i32,
3965         sy: i32,
3966         width: i32,
3967         height: i32,
3968         srcw: i32,
3969         src: *mut c_void,
3970         dx: i32,
3971         dy: i32,
3972         destw: i32,
3973         dest: *mut c_void,
3974     );
3975     pub fn sceGuTexEnvColor(color: u32);
3976     pub fn sceGuTexFilter(min: TextureFilter, mag: TextureFilter);
3977     pub fn sceGuTexFlush();
3978     pub fn sceGuTexFunc(tfx: TextureEffect, tcc: TextureColorComponent);
3979     pub fn sceGuTexImage(
3980         mipmap: MipmapLevel,
3981         width: i32,
3982         height: i32,
3983         tbw: i32,
3984         tbp: *const c_void,
3985     );
3986     pub fn sceGuTexLevelMode(mode: TextureLevelMode, bias: f32);
3987     pub fn sceGuTexMapMode(mode: TextureMapMode, a1: u32, a2: u32);
3988     pub fn sceGuTexMode(
3989         tpsm: TexturePixelFormat,
3990         maxmips: i32,
3991         a2: i32,
3992         swizzle: i32,
3993     );
3994     pub fn sceGuTexOffset(u: f32, v: f32);
3995     pub fn sceGuTexProjMapMode(mode: TextureProjectionMapMode);
3996     pub fn sceGuTexScale(u: f32, v: f32);
3997     pub fn sceGuTexSlope(slope: f32);
3998     pub fn sceGuTexSync();
3999     pub fn sceGuTexWrap(u: GuTexWrapMode, v: GuTexWrapMode);
4000     pub fn sceGuClutLoad(num_blocks: i32, cbp: *const c_void);
4001     pub fn sceGuClutMode(
4002         cpsm: ClutPixelFormat,
4003         shift: u32,
4004         mask: u32,
4005         a3: u32,
4006     );
4007     pub fn sceGuOffset(x: u32, y: u32);
4008     pub fn sceGuScissor(x: i32, y: i32, w: i32, h: i32);
4009     pub fn sceGuViewport(cx: i32, cy: i32, width: i32, height: i32);
4010     pub fn sceGuDrawBezier(
4011         v_type: i32,
4012         u_count: i32,
4013         v_count: i32,
4014         indices: *const c_void,
4015         vertices: *const c_void,
4016     );
4017     pub fn sceGuPatchDivide(ulevel: u32, vlevel: u32);
4018     pub fn sceGuPatchFrontFace(a0: u32);
4019     pub fn sceGuPatchPrim(prim: PatchPrimitive);
4020     pub fn sceGuDrawSpline(
4021         v_type: i32,
4022         u_count: i32,
4023         v_count: i32,
4024         u_edge: i32,
4025         v_edge: i32,
4026         indices: *const c_void,
4027         vertices: *const c_void,
4028     );
4029     pub fn sceGuSetMatrix(type_: MatrixMode, matrix: &ScePspFMatrix4);
4030     pub fn sceGuBoneMatrix(index: u32, matrix: &ScePspFMatrix4);
4031     pub fn sceGuMorphWeight(index: i32, weight: f32);
4032     pub fn sceGuDrawArrayN(
4033         primitive_type: GuPrimitive,
4034         v_type: i32,
4035         count: i32,
4036         a3: i32,
4037         indices: *const c_void,
4038         vertices: *const c_void,
4039     );
4040 
4041     pub fn sceGumDrawArray(
4042         prim: GuPrimitive,
4043         v_type: i32,
4044         count: i32,
4045         indices: *const c_void,
4046         vertices: *const c_void,
4047     );
4048     pub fn sceGumDrawArrayN(
4049         prim: GuPrimitive,
4050         v_type: i32,
4051         count: i32,
4052         a3: i32,
4053         indices: *const c_void,
4054         vertices: *const c_void,
4055     );
4056     pub fn sceGumDrawBezier(
4057         v_type: i32,
4058         u_count: i32,
4059         v_count: i32,
4060         indices: *const c_void,
4061         vertices: *const c_void,
4062     );
4063     pub fn sceGumDrawSpline(
4064         v_type: i32,
4065         u_count: i32,
4066         v_count: i32,
4067         u_edge: i32,
4068         v_edge: i32,
4069         indices: *const c_void,
4070         vertices: *const c_void,
4071     );
4072     pub fn sceGumFastInverse();
4073     pub fn sceGumFullInverse();
4074     pub fn sceGumLoadIdentity();
4075     pub fn sceGumLoadMatrix(m: &ScePspFMatrix4);
4076     pub fn sceGumLookAt(
4077         eye: &ScePspFVector3,
4078         center: &ScePspFVector3,
4079         up: &ScePspFVector3,
4080     );
4081     pub fn sceGumMatrixMode(mode: MatrixMode);
4082     pub fn sceGumMultMatrix(m: &ScePspFMatrix4);
4083     pub fn sceGumOrtho(
4084         left: f32,
4085         right: f32,
4086         bottom: f32,
4087         top: f32,
4088         near: f32,
4089         far: f32,
4090     );
4091     pub fn sceGumPerspective(fovy: f32, aspect: f32, near: f32, far: f32);
4092     pub fn sceGumPopMatrix();
4093     pub fn sceGumPushMatrix();
4094     pub fn sceGumRotateX(angle: f32);
4095     pub fn sceGumRotateY(angle: f32);
4096     pub fn sceGumRotateZ(angle: f32);
4097     pub fn sceGumRotateXYZ(v: &ScePspFVector3);
4098     pub fn sceGumRotateZYX(v: &ScePspFVector3);
4099     pub fn sceGumScale(v: &ScePspFVector3);
4100     pub fn sceGumStoreMatrix(m: &mut ScePspFMatrix4);
4101     pub fn sceGumTranslate(v: &ScePspFVector3);
4102     pub fn sceGumUpdateMatrix();
4103 
4104     pub fn sceMp3ReserveMp3Handle(args: *mut SceMp3InitArg) -> i32;
4105     pub fn sceMp3ReleaseMp3Handle(handle: Mp3Handle) -> i32;
4106     pub fn sceMp3InitResource() -> i32;
4107     pub fn sceMp3TermResource() -> i32;
4108     pub fn sceMp3Init(handle: Mp3Handle) -> i32;
4109     pub fn sceMp3Decode(handle: Mp3Handle, dst: *mut *mut i16) -> i32;
4110     pub fn sceMp3GetInfoToAddStreamData(
4111         handle: Mp3Handle,
4112         dst: *mut *mut u8,
4113         to_write: *mut i32,
4114         src_pos: *mut i32,
4115     ) -> i32;
4116     pub fn sceMp3NotifyAddStreamData(handle: Mp3Handle, size: i32) -> i32;
4117     pub fn sceMp3CheckStreamDataNeeded(handle: Mp3Handle) -> i32;
4118     pub fn sceMp3SetLoopNum(handle: Mp3Handle, loop_: i32) -> i32;
4119     pub fn sceMp3GetLoopNum(handle: Mp3Handle) -> i32;
4120     pub fn sceMp3GetSumDecodedSample(handle: Mp3Handle) -> i32;
4121     pub fn sceMp3GetMaxOutputSample(handle: Mp3Handle) -> i32;
4122     pub fn sceMp3GetSamplingRate(handle: Mp3Handle) -> i32;
4123     pub fn sceMp3GetBitRate(handle: Mp3Handle) -> i32;
4124     pub fn sceMp3GetMp3ChannelNum(handle: Mp3Handle) -> i32;
4125     pub fn sceMp3ResetPlayPosition(handle: Mp3Handle) -> i32;
4126 
4127     pub fn sceRegOpenRegistry(
4128         reg: *mut Key,
4129         mode: i32,
4130         handle: *mut RegHandle,
4131     ) -> i32;
4132     pub fn sceRegFlushRegistry(handle: RegHandle) -> i32;
4133     pub fn sceRegCloseRegistry(handle: RegHandle) -> i32;
4134     pub fn sceRegOpenCategory(
4135         handle: RegHandle,
4136         name: *const u8,
4137         mode: i32,
4138         dir_handle: *mut RegHandle,
4139     ) -> i32;
4140     pub fn sceRegRemoveCategory(handle: RegHandle, name: *const u8) -> i32;
4141     pub fn sceRegCloseCategory(dir_handle: RegHandle) -> i32;
4142     pub fn sceRegFlushCategory(dir_handle: RegHandle) -> i32;
4143     pub fn sceRegGetKeyInfo(
4144         dir_handle: RegHandle,
4145         name: *const u8,
4146         key_handle: *mut RegHandle,
4147         type_: *mut KeyType,
4148         size: *mut usize,
4149     ) -> i32;
4150     pub fn sceRegGetKeyInfoByName(
4151         dir_handle: RegHandle,
4152         name: *const u8,
4153         type_: *mut KeyType,
4154         size: *mut usize,
4155     ) -> i32;
4156     pub fn sceRegGetKeyValue(
4157         dir_handle: RegHandle,
4158         key_handle: RegHandle,
4159         buf: *mut c_void,
4160         size: usize,
4161     ) -> i32;
4162     pub fn sceRegGetKeyValueByName(
4163         dir_handle: RegHandle,
4164         name: *const u8,
4165         buf: *mut c_void,
4166         size: usize,
4167     ) -> i32;
4168     pub fn sceRegSetKeyValue(
4169         dir_handle: RegHandle,
4170         name: *const u8,
4171         buf: *const c_void,
4172         size: usize,
4173     ) -> i32;
4174     pub fn sceRegGetKeysNum(dir_handle: RegHandle, num: *mut i32) -> i32;
4175     pub fn sceRegGetKeys(dir_handle: RegHandle, buf: *mut u8, num: i32)
4176     -> i32;
4177     pub fn sceRegCreateKey(
4178         dir_handle: RegHandle,
4179         name: *const u8,
4180         type_: i32,
4181         size: usize,
4182     ) -> i32;
4183     pub fn sceRegRemoveRegistry(key: *mut Key) -> i32;
4184 
4185     pub fn sceOpenPSIDGetOpenPSID(openpsid: *mut OpenPSID) -> i32;
4186 
4187     pub fn sceUtilityMsgDialogInitStart(
4188         params: *mut UtilityMsgDialogParams,
4189     ) -> i32;
4190     pub fn sceUtilityMsgDialogShutdownStart();
4191     pub fn sceUtilityMsgDialogGetStatus() -> i32;
4192     pub fn sceUtilityMsgDialogUpdate(n: i32);
4193     pub fn sceUtilityMsgDialogAbort() -> i32;
4194     pub fn sceUtilityNetconfInitStart(data: *mut UtilityNetconfData) -> i32;
4195     pub fn sceUtilityNetconfShutdownStart() -> i32;
4196     pub fn sceUtilityNetconfUpdate(unknown: i32) -> i32;
4197     pub fn sceUtilityNetconfGetStatus() -> i32;
4198     pub fn sceUtilityCheckNetParam(id: i32) -> i32;
4199     pub fn sceUtilityGetNetParam(
4200         conf: i32,
4201         param: NetParam,
4202         data: *mut UtilityNetData,
4203     ) -> i32;
4204     pub fn sceUtilitySavedataInitStart(
4205         params: *mut SceUtilitySavedataParam,
4206     ) -> i32;
4207     pub fn sceUtilitySavedataGetStatus() -> i32;
4208     pub fn sceUtilitySavedataShutdownStart() -> i32;
4209     pub fn sceUtilitySavedataUpdate(unknown: i32);
4210     pub fn sceUtilityGameSharingInitStart(
4211         params: *mut UtilityGameSharingParams,
4212     ) -> i32;
4213     pub fn sceUtilityGameSharingShutdownStart();
4214     pub fn sceUtilityGameSharingGetStatus() -> i32;
4215     pub fn sceUtilityGameSharingUpdate(n: i32);
4216     pub fn sceUtilityHtmlViewerInitStart(
4217         params: *mut UtilityHtmlViewerParam,
4218     ) -> i32;
4219     pub fn sceUtilityHtmlViewerShutdownStart() -> i32;
4220     pub fn sceUtilityHtmlViewerUpdate(n: i32) -> i32;
4221     pub fn sceUtilityHtmlViewerGetStatus() -> i32;
4222     pub fn sceUtilitySetSystemParamInt(id: SystemParamId, value: i32) -> i32;
4223     pub fn sceUtilitySetSystemParamString(
4224         id: SystemParamId,
4225         str: *const u8,
4226     ) -> i32;
4227     pub fn sceUtilityGetSystemParamInt(
4228         id: SystemParamId,
4229         value: *mut i32,
4230     ) -> i32;
4231     pub fn sceUtilityGetSystemParamString(
4232         id: SystemParamId,
4233         str: *mut u8,
4234         len: i32,
4235     ) -> i32;
4236     pub fn sceUtilityOskInitStart(params: *mut SceUtilityOskParams) -> i32;
4237     pub fn sceUtilityOskShutdownStart() -> i32;
4238     pub fn sceUtilityOskUpdate(n: i32) -> i32;
4239     pub fn sceUtilityOskGetStatus() -> i32;
4240     pub fn sceUtilityLoadNetModule(module: NetModule) -> i32;
4241     pub fn sceUtilityUnloadNetModule(module: NetModule) -> i32;
4242     pub fn sceUtilityLoadAvModule(module: AvModule) -> i32;
4243     pub fn sceUtilityUnloadAvModule(module: AvModule) -> i32;
4244     pub fn sceUtilityLoadUsbModule(module: UsbModule) -> i32;
4245     pub fn sceUtilityUnloadUsbModule(module: UsbModule) -> i32;
4246     pub fn sceUtilityLoadModule(module: Module) -> i32;
4247     pub fn sceUtilityUnloadModule(module: Module) -> i32;
4248     pub fn sceUtilityCreateNetParam(conf: i32) -> i32;
4249     pub fn sceUtilitySetNetParam(param: NetParam, val: *const c_void) -> i32;
4250     pub fn sceUtilityCopyNetParam(src: i32, dest: i32) -> i32;
4251     pub fn sceUtilityDeleteNetParam(conf: i32) -> i32;
4252 
4253     pub fn sceNetInit(
4254         poolsize: i32,
4255         calloutprio: i32,
4256         calloutstack: i32,
4257         netintrprio: i32,
4258         netintrstack: i32,
4259     ) -> i32;
4260     pub fn sceNetTerm() -> i32;
4261     pub fn sceNetFreeThreadinfo(thid: i32) -> i32;
4262     pub fn sceNetThreadAbort(thid: i32) -> i32;
4263     pub fn sceNetEtherStrton(name: *mut u8, mac: *mut u8);
4264     pub fn sceNetEtherNtostr(mac: *mut u8, name: *mut u8);
4265     pub fn sceNetGetLocalEtherAddr(mac: *mut u8) -> i32;
4266     pub fn sceNetGetMallocStat(stat: *mut SceNetMallocStat) -> i32;
4267 
4268     pub fn sceNetAdhocctlInit(
4269         stacksize: i32,
4270         priority: i32,
4271         adhoc_id: *mut SceNetAdhocctlAdhocId,
4272     ) -> i32;
4273     pub fn sceNetAdhocctlTerm() -> i32;
4274     pub fn sceNetAdhocctlConnect(name: *const u8) -> i32;
4275     pub fn sceNetAdhocctlDisconnect() -> i32;
4276     pub fn sceNetAdhocctlGetState(event: *mut i32) -> i32;
4277     pub fn sceNetAdhocctlCreate(name: *const u8) -> i32;
4278     pub fn sceNetAdhocctlJoin(scaninfo: *mut SceNetAdhocctlScanInfo) -> i32;
4279     pub fn sceNetAdhocctlGetAdhocId(id: *mut SceNetAdhocctlAdhocId) -> i32;
4280     pub fn sceNetAdhocctlCreateEnterGameMode(
4281         name: *const u8,
4282         unknown: i32,
4283         num: i32,
4284         macs: *mut u8,
4285         timeout: u32,
4286         unknown2: i32,
4287     ) -> i32;
4288     pub fn sceNetAdhocctlJoinEnterGameMode(
4289         name: *const u8,
4290         hostmac: *mut u8,
4291         timeout: u32,
4292         unknown: i32,
4293     ) -> i32;
4294     pub fn sceNetAdhocctlGetGameModeInfo(
4295         gamemodeinfo: *mut SceNetAdhocctlGameModeInfo,
4296     ) -> i32;
4297     pub fn sceNetAdhocctlExitGameMode() -> i32;
4298     pub fn sceNetAdhocctlGetPeerList(
4299         length: *mut i32,
4300         buf: *mut c_void,
4301     ) -> i32;
4302     pub fn sceNetAdhocctlGetPeerInfo(
4303         mac: *mut u8,
4304         size: i32,
4305         peerinfo: *mut SceNetAdhocctlPeerInfo,
4306     ) -> i32;
4307     pub fn sceNetAdhocctlScan() -> i32;
4308     pub fn sceNetAdhocctlGetScanInfo(
4309         length: *mut i32,
4310         buf: *mut c_void,
4311     ) -> i32;
4312     pub fn sceNetAdhocctlAddHandler(
4313         handler: SceNetAdhocctlHandler,
4314         unknown: *mut c_void,
4315     ) -> i32;
4316     pub fn sceNetAdhocctlDelHandler(id: i32) -> i32;
4317     pub fn sceNetAdhocctlGetNameByAddr(mac: *mut u8, nickname: *mut u8)
4318     -> i32;
4319     pub fn sceNetAdhocctlGetAddrByName(
4320         nickname: *mut u8,
4321         length: *mut i32,
4322         buf: *mut c_void,
4323     ) -> i32;
4324     pub fn sceNetAdhocctlGetParameter(
4325         params: *mut SceNetAdhocctlParams,
4326     ) -> i32;
4327 
4328     pub fn sceNetAdhocInit() -> i32;
4329     pub fn sceNetAdhocTerm() -> i32;
4330     pub fn sceNetAdhocPdpCreate(
4331         mac: *mut u8,
4332         port: u16,
4333         buf_size: u32,
4334         unk1: i32,
4335     ) -> i32;
4336     pub fn sceNetAdhocPdpDelete(id: i32, unk1: i32) -> i32;
4337     pub fn sceNetAdhocPdpSend(
4338         id: i32,
4339         dest_mac_addr: *mut u8,
4340         port: u16,
4341         data: *mut c_void,
4342         len: u32,
4343         timeout: u32,
4344         nonblock: i32,
4345     ) -> i32;
4346     pub fn sceNetAdhocPdpRecv(
4347         id: i32,
4348         src_mac_addr: *mut u8,
4349         port: *mut u16,
4350         data: *mut c_void,
4351         data_length: *mut c_void,
4352         timeout: u32,
4353         nonblock: i32,
4354     ) -> i32;
4355     pub fn sceNetAdhocGetPdpStat(
4356         size: *mut i32,
4357         stat: *mut SceNetAdhocPdpStat,
4358     ) -> i32;
4359     pub fn sceNetAdhocGameModeCreateMaster(
4360         data: *mut c_void,
4361         size: i32,
4362     ) -> i32;
4363     pub fn sceNetAdhocGameModeCreateReplica(
4364         mac: *mut u8,
4365         data: *mut c_void,
4366         size: i32,
4367     ) -> i32;
4368     pub fn sceNetAdhocGameModeUpdateMaster() -> i32;
4369     pub fn sceNetAdhocGameModeUpdateReplica(id: i32, unk1: i32) -> i32;
4370     pub fn sceNetAdhocGameModeDeleteMaster() -> i32;
4371     pub fn sceNetAdhocGameModeDeleteReplica(id: i32) -> i32;
4372     pub fn sceNetAdhocPtpOpen(
4373         srcmac: *mut u8,
4374         srcport: u16,
4375         destmac: *mut u8,
4376         destport: u16,
4377         buf_size: u32,
4378         delay: u32,
4379         count: i32,
4380         unk1: i32,
4381     ) -> i32;
4382     pub fn sceNetAdhocPtpConnect(id: i32, timeout: u32, nonblock: i32) -> i32;
4383     pub fn sceNetAdhocPtpListen(
4384         srcmac: *mut u8,
4385         srcport: u16,
4386         buf_size: u32,
4387         delay: u32,
4388         count: i32,
4389         queue: i32,
4390         unk1: i32,
4391     ) -> i32;
4392     pub fn sceNetAdhocPtpAccept(
4393         id: i32,
4394         mac: *mut u8,
4395         port: *mut u16,
4396         timeout: u32,
4397         nonblock: i32,
4398     ) -> i32;
4399     pub fn sceNetAdhocPtpSend(
4400         id: i32,
4401         data: *mut c_void,
4402         data_size: *mut i32,
4403         timeout: u32,
4404         nonblock: i32,
4405     ) -> i32;
4406     pub fn sceNetAdhocPtpRecv(
4407         id: i32,
4408         data: *mut c_void,
4409         data_size: *mut i32,
4410         timeout: u32,
4411         nonblock: i32,
4412     ) -> i32;
4413     pub fn sceNetAdhocPtpFlush(id: i32, timeout: u32, nonblock: i32) -> i32;
4414     pub fn sceNetAdhocPtpClose(id: i32, unk1: i32) -> i32;
4415     pub fn sceNetAdhocGetPtpStat(
4416         size: *mut i32,
4417         stat: *mut SceNetAdhocPtpStat,
4418     ) -> i32;
4419 }
4420 
4421 extern "C" {
4422     pub fn sceNetAdhocMatchingInit(memsize: i32) -> i32;
4423     pub fn sceNetAdhocMatchingTerm() -> i32;
4424     pub fn sceNetAdhocMatchingCreate(
4425         mode: AdhocMatchingMode,
4426         max_peers: i32,
4427         port: u16,
4428         buf_size: i32,
4429         hello_delay: u32,
4430         ping_delay: u32,
4431         init_count: i32,
4432         msg_delay: u32,
4433         callback: AdhocMatchingCallback,
4434     ) -> i32;
4435     pub fn sceNetAdhocMatchingDelete(matching_id: i32) -> i32;
4436     pub fn sceNetAdhocMatchingStart(
4437         matching_id: i32,
4438         evth_pri: i32,
4439         evth_stack: i32,
4440         inth_pri: i32,
4441         inth_stack: i32,
4442         opt_len: i32,
4443         opt_data: *mut c_void,
4444     ) -> i32;
4445     pub fn sceNetAdhocMatchingStop(matching_id: i32) -> i32;
4446     pub fn sceNetAdhocMatchingSelectTarget(
4447         matching_id: i32,
4448         mac: *mut u8,
4449         opt_len: i32,
4450         opt_data: *mut c_void,
4451     ) -> i32;
4452     pub fn sceNetAdhocMatchingCancelTarget(
4453         matching_id: i32,
4454         mac: *mut u8,
4455     ) -> i32;
4456     pub fn sceNetAdhocMatchingCancelTargetWithOpt(
4457         matching_id: i32,
4458         mac: *mut u8,
4459         opt_len: i32,
4460         opt_data: *mut c_void,
4461     ) -> i32;
4462     pub fn sceNetAdhocMatchingSendData(
4463         matching_id: i32,
4464         mac: *mut u8,
4465         data_len: i32,
4466         data: *mut c_void,
4467     ) -> i32;
4468     pub fn sceNetAdhocMatchingAbortSendData(
4469         matching_id: i32,
4470         mac: *mut u8,
4471     ) -> i32;
4472     pub fn sceNetAdhocMatchingSetHelloOpt(
4473         matching_id: i32,
4474         opt_len: i32,
4475         opt_data: *mut c_void,
4476     ) -> i32;
4477     pub fn sceNetAdhocMatchingGetHelloOpt(
4478         matching_id: i32,
4479         opt_len: *mut i32,
4480         opt_data: *mut c_void,
4481     ) -> i32;
4482     pub fn sceNetAdhocMatchingGetMembers(
4483         matching_id: i32,
4484         length: *mut i32,
4485         buf: *mut c_void,
4486     ) -> i32;
4487     pub fn sceNetAdhocMatchingGetPoolMaxAlloc() -> i32;
4488     pub fn sceNetAdhocMatchingGetPoolStat(poolstat: *mut AdhocPoolStat)
4489     -> i32;
4490 }
4491 
4492 extern "C" {
4493     pub fn sceNetApctlInit(stack_size: i32, init_priority: i32) -> i32;
4494     pub fn sceNetApctlTerm() -> i32;
4495     pub fn sceNetApctlGetInfo(
4496         code: ApctlInfo,
4497         pinfo: *mut SceNetApctlInfo,
4498     ) -> i32;
4499     pub fn sceNetApctlAddHandler(
4500         handler: SceNetApctlHandler,
4501         parg: *mut c_void,
4502     ) -> i32;
4503     pub fn sceNetApctlDelHandler(handler_id: i32) -> i32;
4504     pub fn sceNetApctlConnect(conn_index: i32) -> i32;
4505     pub fn sceNetApctlDisconnect() -> i32;
4506     pub fn sceNetApctlGetState(pstate: *mut ApctlState) -> i32;
4507 
4508     pub fn sceNetInetInit() -> i32;
4509     pub fn sceNetInetTerm() -> i32;
4510     pub fn sceNetInetAccept(
4511         s: i32,
4512         addr: *mut sockaddr,
4513         addr_len: *mut socklen_t,
4514     ) -> i32;
4515     pub fn sceNetInetBind(
4516         s: i32,
4517         my_addr: *const sockaddr,
4518         addr_len: socklen_t,
4519     ) -> i32;
4520     pub fn sceNetInetConnect(
4521         s: i32,
4522         serv_addr: *const sockaddr,
4523         addr_len: socklen_t,
4524     ) -> i32;
4525     pub fn sceNetInetGetsockopt(
4526         s: i32,
4527         level: i32,
4528         opt_name: i32,
4529         opt_val: *mut c_void,
4530         optl_en: *mut socklen_t,
4531     ) -> i32;
4532     pub fn sceNetInetListen(s: i32, backlog: i32) -> i32;
4533     pub fn sceNetInetRecv(
4534         s: i32,
4535         buf: *mut c_void,
4536         len: usize,
4537         flags: i32,
4538     ) -> usize;
4539     pub fn sceNetInetRecvfrom(
4540         s: i32,
4541         buf: *mut c_void,
4542         flags: usize,
4543         arg1: i32,
4544         from: *mut sockaddr,
4545         from_len: *mut socklen_t,
4546     ) -> usize;
4547     pub fn sceNetInetSend(
4548         s: i32,
4549         buf: *const c_void,
4550         len: usize,
4551         flags: i32,
4552     ) -> usize;
4553     pub fn sceNetInetSendto(
4554         s: i32,
4555         buf: *const c_void,
4556         len: usize,
4557         flags: i32,
4558         to: *const sockaddr,
4559         to_len: socklen_t,
4560     ) -> usize;
4561     pub fn sceNetInetSetsockopt(
4562         s: i32,
4563         level: i32,
4564         opt_name: i32,
4565         opt_val: *const c_void,
4566         opt_len: socklen_t,
4567     ) -> i32;
4568     pub fn sceNetInetShutdown(s: i32, how: i32) -> i32;
4569     pub fn sceNetInetSocket(domain: i32, type_: i32, protocol: i32) -> i32;
4570     pub fn sceNetInetClose(s: i32) -> i32;
4571     pub fn sceNetInetGetErrno() -> i32;
4572 
4573     pub fn sceSslInit(unknown1: i32) -> i32;
4574     pub fn sceSslEnd() -> i32;
4575     pub fn sceSslGetUsedMemoryMax(memory: *mut u32) -> i32;
4576     pub fn sceSslGetUsedMemoryCurrent(memory: *mut u32) -> i32;
4577 
4578     pub fn sceHttpInit(unknown1: u32) -> i32;
4579     pub fn sceHttpEnd() -> i32;
4580     pub fn sceHttpCreateTemplate(
4581         agent: *mut u8,
4582         unknown1: i32,
4583         unknown2: i32,
4584     ) -> i32;
4585     pub fn sceHttpDeleteTemplate(templateid: i32) -> i32;
4586     pub fn sceHttpCreateConnection(
4587         templateid: i32,
4588         host: *mut u8,
4589         unknown1: *mut u8,
4590         port: u16,
4591         unknown2: i32,
4592     ) -> i32;
4593     pub fn sceHttpCreateConnectionWithURL(
4594         templateid: i32,
4595         url: *const u8,
4596         unknown1: i32,
4597     ) -> i32;
4598     pub fn sceHttpDeleteConnection(connection_id: i32) -> i32;
4599     pub fn sceHttpCreateRequest(
4600         connection_id: i32,
4601         method: HttpMethod,
4602         path: *mut u8,
4603         content_length: u64,
4604     ) -> i32;
4605     pub fn sceHttpCreateRequestWithURL(
4606         connection_id: i32,
4607         method: HttpMethod,
4608         url: *mut u8,
4609         content_length: u64,
4610     ) -> i32;
4611     pub fn sceHttpDeleteRequest(request_id: i32) -> i32;
4612     pub fn sceHttpSendRequest(
4613         request_id: i32,
4614         data: *mut c_void,
4615         data_size: u32,
4616     ) -> i32;
4617     pub fn sceHttpAbortRequest(request_id: i32) -> i32;
4618     pub fn sceHttpReadData(
4619         request_id: i32,
4620         data: *mut c_void,
4621         data_size: u32,
4622     ) -> i32;
4623     pub fn sceHttpGetContentLength(
4624         request_id: i32,
4625         content_length: *mut u64,
4626     ) -> i32;
4627     pub fn sceHttpGetStatusCode(request_id: i32, status_code: *mut i32)
4628     -> i32;
4629     pub fn sceHttpSetResolveTimeOut(id: i32, timeout: u32) -> i32;
4630     pub fn sceHttpSetResolveRetry(id: i32, count: i32) -> i32;
4631     pub fn sceHttpSetConnectTimeOut(id: i32, timeout: u32) -> i32;
4632     pub fn sceHttpSetSendTimeOut(id: i32, timeout: u32) -> i32;
4633     pub fn sceHttpSetRecvTimeOut(id: i32, timeout: u32) -> i32;
4634     pub fn sceHttpEnableKeepAlive(id: i32) -> i32;
4635     pub fn sceHttpDisableKeepAlive(id: i32) -> i32;
4636     pub fn sceHttpEnableRedirect(id: i32) -> i32;
4637     pub fn sceHttpDisableRedirect(id: i32) -> i32;
4638     pub fn sceHttpEnableCookie(id: i32) -> i32;
4639     pub fn sceHttpDisableCookie(id: i32) -> i32;
4640     pub fn sceHttpSaveSystemCookie() -> i32;
4641     pub fn sceHttpLoadSystemCookie() -> i32;
4642     pub fn sceHttpAddExtraHeader(
4643         id: i32,
4644         name: *mut u8,
4645         value: *mut u8,
4646         unknown1: i32,
4647     ) -> i32;
4648     pub fn sceHttpDeleteHeader(id: i32, name: *const u8) -> i32;
4649     pub fn sceHttpsInit(
4650         unknown1: i32,
4651         unknown2: i32,
4652         unknown3: i32,
4653         unknown4: i32,
4654     ) -> i32;
4655     pub fn sceHttpsEnd() -> i32;
4656     pub fn sceHttpsLoadDefaultCert(unknown1: i32, unknown2: i32) -> i32;
4657     pub fn sceHttpDisableAuth(id: i32) -> i32;
4658     pub fn sceHttpDisableCache(id: i32) -> i32;
4659     pub fn sceHttpEnableAuth(id: i32) -> i32;
4660     pub fn sceHttpEnableCache(id: i32) -> i32;
4661     pub fn sceHttpEndCache() -> i32;
4662     pub fn sceHttpGetAllHeader(
4663         request: i32,
4664         header: *mut *mut u8,
4665         header_size: *mut u32,
4666     ) -> i32;
4667     pub fn sceHttpGetNetworkErrno(request: i32, err_num: *mut i32) -> i32;
4668     pub fn sceHttpGetProxy(
4669         id: i32,
4670         activate_flag: *mut i32,
4671         mode: *mut i32,
4672         proxy_host: *mut u8,
4673         len: usize,
4674         proxy_port: *mut u16,
4675     ) -> i32;
4676     pub fn sceHttpInitCache(max_size: usize) -> i32;
4677     pub fn sceHttpSetAuthInfoCB(id: i32, cbfunc: HttpPasswordCB) -> i32;
4678     pub fn sceHttpSetProxy(
4679         id: i32,
4680         activate_flag: i32,
4681         mode: i32,
4682         new_proxy_host: *const u8,
4683         new_proxy_port: u16,
4684     ) -> i32;
4685     pub fn sceHttpSetResHeaderMaxSize(id: i32, header_size: u32) -> i32;
4686     pub fn sceHttpSetMallocFunction(
4687         malloc_func: HttpMallocFunction,
4688         free_func: HttpFreeFunction,
4689         realloc_func: HttpReallocFunction,
4690     ) -> i32;
4691 
4692     pub fn sceNetResolverInit() -> i32;
4693     pub fn sceNetResolverCreate(
4694         rid: *mut i32,
4695         buf: *mut c_void,
4696         buf_length: u32,
4697     ) -> i32;
4698     pub fn sceNetResolverDelete(rid: i32) -> i32;
4699     pub fn sceNetResolverStartNtoA(
4700         rid: i32,
4701         hostname: *const u8,
4702         addr: *mut in_addr,
4703         timeout: u32,
4704         retry: i32,
4705     ) -> i32;
4706     pub fn sceNetResolverStartAtoN(
4707         rid: i32,
4708         addr: *const in_addr,
4709         hostname: *mut u8,
4710         hostname_len: u32,
4711         timeout: u32,
4712         retry: i32,
4713     ) -> i32;
4714     pub fn sceNetResolverStop(rid: i32) -> i32;
4715     pub fn sceNetResolverTerm() -> i32;
4716 }
4717