Skip to main content

pspsdk_sys/
sdk.rs

1/* automatically generated by rust-bindgen */
2
3pub const _PSPTYPES_H_: libc::c_uint = 1;
4pub const __have_longlong64: libc::c_uint = 1;
5pub const __have_long64: libc::c_uint = 1;
6pub const __int8_t_defined: libc::c_uint = 1;
7pub const __int_least8_t_defined: libc::c_uint = 1;
8pub const __int16_t_defined: libc::c_uint = 1;
9pub const __int_least16_t_defined: libc::c_uint = 1;
10pub const __int32_t_defined: libc::c_uint = 1;
11pub const __int_least32_t_defined: libc::c_uint = 1;
12pub const __int64_t_defined: libc::c_uint = 1;
13pub const __int_least64_t_defined: libc::c_uint = 1;
14pub const __int_fast8_t_defined: libc::c_uint = 1;
15pub const __int_fast16_t_defined: libc::c_uint = 1;
16pub const __int_fast32_t_defined: libc::c_uint = 1;
17pub const __int_fast64_t_defined: libc::c_uint = 1;
18pub const INT8_MIN: libc::c_int = -128;
19pub const INT8_MAX: libc::c_uint = 127;
20pub const UINT8_MAX: libc::c_uint = 255;
21pub const INT_LEAST8_MIN: libc::c_int = -128;
22pub const INT_LEAST8_MAX: libc::c_uint = 127;
23pub const UINT_LEAST8_MAX: libc::c_uint = 255;
24pub const INT16_MIN: libc::c_int = -32768;
25pub const INT16_MAX: libc::c_uint = 32767;
26pub const UINT16_MAX: libc::c_uint = 65535;
27pub const INT_LEAST16_MIN: libc::c_int = -32768;
28pub const INT_LEAST16_MAX: libc::c_uint = 32767;
29pub const UINT_LEAST16_MAX: libc::c_uint = 65535;
30pub const INT32_MIN: libc::c_int = -2147483648;
31pub const INT32_MAX: libc::c_uint = 2147483647;
32pub const UINT32_MAX: libc::c_uint = 4294967295;
33pub const INT_LEAST32_MIN: libc::c_int = -2147483648;
34pub const INT_LEAST32_MAX: libc::c_uint = 2147483647;
35pub const UINT_LEAST32_MAX: libc::c_uint = 4294967295;
36pub const INT64_MIN: libc::c_longlong = -9223372036854775808;
37pub const INT64_MAX: libc::c_ulonglong = 9223372036854775807;
38pub const UINT64_MAX: libc::c_int = -1;
39pub const INT_LEAST64_MIN: libc::c_longlong = -9223372036854775808;
40pub const INT_LEAST64_MAX: libc::c_ulonglong = 9223372036854775807;
41pub const UINT_LEAST64_MAX: libc::c_int = -1;
42pub const INT_FAST64_MIN: libc::c_longlong = -9223372036854775808;
43pub const INT_FAST64_MAX: libc::c_ulonglong = 9223372036854775807;
44pub const UINT_FAST64_MAX: libc::c_int = -1;
45pub const WINT_MIN: libc::c_uint = 0;
46pub const PSP_O_RDONLY: libc::c_uint = 1;
47pub const PSP_O_WRONLY: libc::c_uint = 2;
48pub const PSP_O_RDWR: libc::c_uint = 3;
49pub const PSP_O_NBLOCK: libc::c_uint = 4;
50pub const PSP_O_DIROPEN: libc::c_uint = 8;
51pub const PSP_O_APPEND: libc::c_uint = 256;
52pub const PSP_O_CREAT: libc::c_uint = 512;
53pub const PSP_O_TRUNC: libc::c_uint = 1024;
54pub const PSP_O_EXCL: libc::c_uint = 2048;
55pub const PSP_O_NOWAIT: libc::c_uint = 32768;
56pub const PSP_SEEK_SET: libc::c_uint = 0;
57pub const PSP_SEEK_CUR: libc::c_uint = 1;
58pub const PSP_SEEK_END: libc::c_uint = 2;
59pub const PSP_MEMORY_PARTITION_KERNEL: libc::c_uint = 1;
60pub const PSP_MEMORY_PARTITION_USER: libc::c_uint = 2;
61pub const __NEWLIB_H__: libc::c_uint = 1;
62pub const _NEWLIB_VERSION: &'static [u8; 7usize] = b"1.20.0\x00";
63pub const _WANT_IO_LONG_LONG: libc::c_uint = 1;
64pub const _MB_CAPABLE: libc::c_uint = 1;
65pub const _MB_LEN_MAX: libc::c_uint = 8;
66pub const _ICONV_ENABLED: libc::c_uint = 1;
67pub const HAVE_INITFINI_ARRAY: libc::c_uint = 1;
68pub const _ATEXIT_DYNAMIC_ALLOC: libc::c_uint = 1;
69pub const _HAVE_LONG_DOUBLE: libc::c_uint = 1;
70pub const _LDBL_EQ_DBL: libc::c_uint = 1;
71pub const __RAND_MAX: libc::c_uint = 2147483647;
72pub const ___int8_t_defined: libc::c_uint = 1;
73pub const ___int16_t_defined: libc::c_uint = 1;
74pub const ___int_least16_t_defined: libc::c_uint = 1;
75pub const ___int32_t_defined: libc::c_uint = 1;
76pub const ___int_least32_t_defined: libc::c_uint = 1;
77pub const ___int64_t_defined: libc::c_uint = 1;
78pub const NBBY: libc::c_uint = 8;
79pub const FD_SETSIZE: libc::c_uint = 64;
80pub const ITIMER_REAL: libc::c_uint = 0;
81pub const ITIMER_VIRTUAL: libc::c_uint = 1;
82pub const ITIMER_PROF: libc::c_uint = 2;
83pub const PSP_ATRAC_ERROR_PARAM_FAIL: libc::c_uint = 2153971713;
84pub const PSP_ATRAC_ERROR_API_FAIL: libc::c_uint = 2153971714;
85pub const PSP_ATRAC_ERROR_NO_ATRACID: libc::c_uint = 2153971715;
86pub const PSP_ATRAC_ERROR_BAD_CODECTYPE: libc::c_uint = 2153971716;
87pub const PSP_ATRAC_ERROR_BAD_ATRACID: libc::c_uint = 2153971717;
88pub const PSP_ATRAC_ERROR_UNKNOWN_FORMAT: libc::c_uint = 2153971718;
89pub const PSP_ATRAC_ERROR_UNMATCH_FORMAT: libc::c_uint = 2153971719;
90pub const PSP_ATRAC_ERROR_BAD_DATA: libc::c_uint = 2153971720;
91pub const PSP_ATRAC_ERROR_ALLDATA_IS_ONMEMORY: libc::c_uint = 2153971721;
92pub const PSP_ATRAC_ERROR_UNSET_DATA: libc::c_uint = 2153971728;
93pub const PSP_ATRAC_ERROR_READSIZE_IS_TOO_SMALL: libc::c_uint = 2153971729;
94pub const PSP_ATRAC_ERROR_NEED_SECOND_BUFFER: libc::c_uint = 2153971730;
95pub const PSP_ATRAC_ERROR_READSIZE_OVER_BUFFER: libc::c_uint = 2153971731;
96pub const PSP_ATRAC_ERROR_NOT_4BYTE_ALIGNMENT: libc::c_uint = 2153971732;
97pub const PSP_ATRAC_ERROR_BAD_SAMPLE: libc::c_uint = 2153971733;
98pub const PSP_ATRAC_ERROR_WRITEBYTE_FIRST_BUFFER: libc::c_uint = 2153971734;
99pub const PSP_ATRAC_ERROR_WRITEBYTE_SECOND_BUFFER: libc::c_uint = 2153971735;
100pub const PSP_ATRAC_ERROR_ADD_DATA_IS_TOO_BIG: libc::c_uint = 2153971736;
101pub const PSP_ATRAC_ERROR_UNSET_PARAM: libc::c_uint = 2153971745;
102pub const PSP_ATRAC_ERROR_NONEED_SECOND_BUFFER: libc::c_uint = 2153971746;
103pub const PSP_ATRAC_ERROR_NODATA_IN_BUFFER: libc::c_uint = 2153971747;
104pub const PSP_ATRAC_ERROR_ALLDATA_WAS_DECODED: libc::c_uint = 2153971748;
105pub const PSP_ATRAC_AT3PLUS: libc::c_uint = 4096;
106pub const PSP_ATRAC_AT3: libc::c_uint = 4097;
107pub const PSP_ATRAC_ALLDATA_IS_ON_MEMORY: libc::c_int = -1;
108pub const PSP_ATRAC_NONLOOP_STREAM_DATA_IS_ON_MEMORY: libc::c_int = -2;
109pub const PSP_ATRAC_LOOP_STREAM_DATA_IS_ON_MEMORY: libc::c_int = -3;
110pub const PSP_CODEC_AT3PLUS: libc::c_uint = 4096;
111pub const PSP_CODEC_AT3: libc::c_uint = 4097;
112pub const PSP_CODEC_MP3: libc::c_uint = 4098;
113pub const PSP_CODEC_AAC: libc::c_uint = 4099;
114pub const PSP_AUDIO_VOLUME_MAX: libc::c_uint = 32768;
115pub const PSP_AUDIO_CHANNEL_MAX: libc::c_uint = 8;
116pub const PSP_AUDIO_NEXT_CHANNEL: libc::c_int = -1;
117pub const PSP_AUDIO_SAMPLE_MIN: libc::c_uint = 64;
118pub const PSP_AUDIO_SAMPLE_MAX: libc::c_uint = 65472;
119pub const PSP_NUM_AUDIO_CHANNELS: libc::c_uint = 4;
120pub const PSP_NUM_AUDIO_SAMPLES: libc::c_uint = 1024;
121pub const PSP_VOLUME_MAX: libc::c_uint = 32768;
122pub const PSP_FPU_RM_MASK: libc::c_uint = 3;
123pub const PSP_FPU_FLAGS_POS: libc::c_uint = 2;
124pub const PSP_FPU_ENABLE_POS: libc::c_uint = 7;
125pub const PSP_FPU_CAUSE_POS: libc::c_uint = 12;
126pub const PSP_FPU_CC0_POS: libc::c_uint = 23;
127pub const PSP_FPU_FS_POS: libc::c_uint = 24;
128pub const PSP_FPU_CC17_POS: libc::c_uint = 25;
129pub const PSP_FPU_FLAGS_MASK: libc::c_uint = 124;
130pub const PSP_FPU_ENABLE_MASK: libc::c_uint = 3968;
131pub const PSP_FPU_CAUSE_MASK: libc::c_uint = 258048;
132pub const PSP_FPU_CC0_MASK: libc::c_uint = 8388608;
133pub const PSP_FPU_FS_MASK: libc::c_uint = 16777216;
134pub const PSP_FPU_CC17_MASK: libc::c_uint = 4261412864;
135pub const GU_PI: f64 = 3.141593;
136pub const GU_FALSE: libc::c_uint = 0;
137pub const GU_TRUE: libc::c_uint = 1;
138pub const GU_POINTS: libc::c_uint = 0;
139pub const GU_LINES: libc::c_uint = 1;
140pub const GU_LINE_STRIP: libc::c_uint = 2;
141pub const GU_TRIANGLES: libc::c_uint = 3;
142pub const GU_TRIANGLE_STRIP: libc::c_uint = 4;
143pub const GU_TRIANGLE_FAN: libc::c_uint = 5;
144pub const GU_SPRITES: libc::c_uint = 6;
145pub const GU_ALPHA_TEST: libc::c_uint = 0;
146pub const GU_DEPTH_TEST: libc::c_uint = 1;
147pub const GU_SCISSOR_TEST: libc::c_uint = 2;
148pub const GU_STENCIL_TEST: libc::c_uint = 3;
149pub const GU_BLEND: libc::c_uint = 4;
150pub const GU_CULL_FACE: libc::c_uint = 5;
151pub const GU_DITHER: libc::c_uint = 6;
152pub const GU_FOG: libc::c_uint = 7;
153pub const GU_CLIP_PLANES: libc::c_uint = 8;
154pub const GU_TEXTURE_2D: libc::c_uint = 9;
155pub const GU_LIGHTING: libc::c_uint = 10;
156pub const GU_LIGHT0: libc::c_uint = 11;
157pub const GU_LIGHT1: libc::c_uint = 12;
158pub const GU_LIGHT2: libc::c_uint = 13;
159pub const GU_LIGHT3: libc::c_uint = 14;
160pub const GU_LINE_SMOOTH: libc::c_uint = 15;
161pub const GU_PATCH_CULL_FACE: libc::c_uint = 16;
162pub const GU_COLOR_TEST: libc::c_uint = 17;
163pub const GU_COLOR_LOGIC_OP: libc::c_uint = 18;
164pub const GU_FACE_NORMAL_REVERSE: libc::c_uint = 19;
165pub const GU_PATCH_FACE: libc::c_uint = 20;
166pub const GU_FRAGMENT_2X: libc::c_uint = 21;
167pub const GU_PROJECTION: libc::c_uint = 0;
168pub const GU_VIEW: libc::c_uint = 1;
169pub const GU_MODEL: libc::c_uint = 2;
170pub const GU_TEXTURE: libc::c_uint = 3;
171pub const GU_PSM_5650: libc::c_uint = 0;
172pub const GU_PSM_5551: libc::c_uint = 1;
173pub const GU_PSM_4444: libc::c_uint = 2;
174pub const GU_PSM_8888: libc::c_uint = 3;
175pub const GU_PSM_T4: libc::c_uint = 4;
176pub const GU_PSM_T8: libc::c_uint = 5;
177pub const GU_PSM_T16: libc::c_uint = 6;
178pub const GU_PSM_T32: libc::c_uint = 7;
179pub const GU_PSM_DXT1: libc::c_uint = 8;
180pub const GU_PSM_DXT3: libc::c_uint = 9;
181pub const GU_PSM_DXT5: libc::c_uint = 10;
182pub const GU_FILL_FILL: libc::c_uint = 0;
183pub const GU_OPEN_FILL: libc::c_uint = 1;
184pub const GU_FILL_OPEN: libc::c_uint = 2;
185pub const GU_OPEN_OPEN: libc::c_uint = 3;
186pub const GU_FLAT: libc::c_uint = 0;
187pub const GU_SMOOTH: libc::c_uint = 1;
188pub const GU_CLEAR: libc::c_uint = 0;
189pub const GU_AND: libc::c_uint = 1;
190pub const GU_AND_REVERSE: libc::c_uint = 2;
191pub const GU_COPY: libc::c_uint = 3;
192pub const GU_AND_INVERTED: libc::c_uint = 4;
193pub const GU_NOOP: libc::c_uint = 5;
194pub const GU_XOR: libc::c_uint = 6;
195pub const GU_OR: libc::c_uint = 7;
196pub const GU_NOR: libc::c_uint = 8;
197pub const GU_EQUIV: libc::c_uint = 9;
198pub const GU_INVERTED: libc::c_uint = 10;
199pub const GU_OR_REVERSE: libc::c_uint = 11;
200pub const GU_COPY_INVERTED: libc::c_uint = 12;
201pub const GU_OR_INVERTED: libc::c_uint = 13;
202pub const GU_NAND: libc::c_uint = 14;
203pub const GU_SET: libc::c_uint = 15;
204pub const GU_NEAREST: libc::c_uint = 0;
205pub const GU_LINEAR: libc::c_uint = 1;
206pub const GU_NEAREST_MIPMAP_NEAREST: libc::c_uint = 4;
207pub const GU_LINEAR_MIPMAP_NEAREST: libc::c_uint = 5;
208pub const GU_NEAREST_MIPMAP_LINEAR: libc::c_uint = 6;
209pub const GU_LINEAR_MIPMAP_LINEAR: libc::c_uint = 7;
210pub const GU_TEXTURE_COORDS: libc::c_uint = 0;
211pub const GU_TEXTURE_MATRIX: libc::c_uint = 1;
212pub const GU_ENVIRONMENT_MAP: libc::c_uint = 2;
213pub const GU_TEXTURE_AUTO: libc::c_uint = 0;
214pub const GU_TEXTURE_CONST: libc::c_uint = 1;
215pub const GU_TEXTURE_SLOPE: libc::c_uint = 2;
216pub const GU_POSITION: libc::c_uint = 0;
217pub const GU_UV: libc::c_uint = 1;
218pub const GU_NORMALIZED_NORMAL: libc::c_uint = 2;
219pub const GU_NORMAL: libc::c_uint = 3;
220pub const GU_REPEAT: libc::c_uint = 0;
221pub const GU_CLAMP: libc::c_uint = 1;
222pub const GU_CW: libc::c_uint = 0;
223pub const GU_CCW: libc::c_uint = 1;
224pub const GU_NEVER: libc::c_uint = 0;
225pub const GU_ALWAYS: libc::c_uint = 1;
226pub const GU_EQUAL: libc::c_uint = 2;
227pub const GU_NOTEQUAL: libc::c_uint = 3;
228pub const GU_LESS: libc::c_uint = 4;
229pub const GU_LEQUAL: libc::c_uint = 5;
230pub const GU_GREATER: libc::c_uint = 6;
231pub const GU_GEQUAL: libc::c_uint = 7;
232pub const GU_COLOR_BUFFER_BIT: libc::c_uint = 1;
233pub const GU_STENCIL_BUFFER_BIT: libc::c_uint = 2;
234pub const GU_DEPTH_BUFFER_BIT: libc::c_uint = 4;
235pub const GU_FAST_CLEAR_BIT: libc::c_uint = 16;
236pub const GU_TFX_MODULATE: libc::c_uint = 0;
237pub const GU_TFX_DECAL: libc::c_uint = 1;
238pub const GU_TFX_BLEND: libc::c_uint = 2;
239pub const GU_TFX_REPLACE: libc::c_uint = 3;
240pub const GU_TFX_ADD: libc::c_uint = 4;
241pub const GU_TCC_RGB: libc::c_uint = 0;
242pub const GU_TCC_RGBA: libc::c_uint = 1;
243pub const GU_ADD: libc::c_uint = 0;
244pub const GU_SUBTRACT: libc::c_uint = 1;
245pub const GU_REVERSE_SUBTRACT: libc::c_uint = 2;
246pub const GU_MIN: libc::c_uint = 3;
247pub const GU_MAX: libc::c_uint = 4;
248pub const GU_ABS: libc::c_uint = 5;
249pub const GU_SRC_COLOR: libc::c_uint = 0;
250pub const GU_ONE_MINUS_SRC_COLOR: libc::c_uint = 1;
251pub const GU_SRC_ALPHA: libc::c_uint = 2;
252pub const GU_ONE_MINUS_SRC_ALPHA: libc::c_uint = 3;
253pub const GU_DST_COLOR: libc::c_uint = 0;
254pub const GU_ONE_MINUS_DST_COLOR: libc::c_uint = 1;
255pub const GU_DST_ALPHA: libc::c_uint = 4;
256pub const GU_ONE_MINUS_DST_ALPHA: libc::c_uint = 5;
257pub const GU_FIX: libc::c_uint = 10;
258pub const GU_KEEP: libc::c_uint = 0;
259pub const GU_ZERO: libc::c_uint = 1;
260pub const GU_REPLACE: libc::c_uint = 2;
261pub const GU_INVERT: libc::c_uint = 3;
262pub const GU_INCR: libc::c_uint = 4;
263pub const GU_DECR: libc::c_uint = 5;
264pub const GU_AMBIENT: libc::c_uint = 1;
265pub const GU_DIFFUSE: libc::c_uint = 2;
266pub const GU_SPECULAR: libc::c_uint = 4;
267pub const GU_AMBIENT_AND_DIFFUSE: libc::c_uint = 3;
268pub const GU_DIFFUSE_AND_SPECULAR: libc::c_uint = 6;
269pub const GU_UNKNOWN_LIGHT_COMPONENT: libc::c_uint = 8;
270pub const GU_SINGLE_COLOR: libc::c_uint = 0;
271pub const GU_SEPARATE_SPECULAR_COLOR: libc::c_uint = 1;
272pub const GU_DIRECTIONAL: libc::c_uint = 0;
273pub const GU_POINTLIGHT: libc::c_uint = 1;
274pub const GU_SPOTLIGHT: libc::c_uint = 2;
275pub const GU_DIRECT: libc::c_uint = 0;
276pub const GU_CALL: libc::c_uint = 1;
277pub const GU_SEND: libc::c_uint = 2;
278pub const GU_TAIL: libc::c_uint = 0;
279pub const GU_HEAD: libc::c_uint = 1;
280pub const GU_SYNC_FINISH: libc::c_uint = 0;
281pub const GU_SYNC_SIGNAL: libc::c_uint = 1;
282pub const GU_SYNC_DONE: libc::c_uint = 2;
283pub const GU_SYNC_LIST: libc::c_uint = 3;
284pub const GU_SYNC_SEND: libc::c_uint = 4;
285pub const GU_SYNC_WAIT: libc::c_uint = 0;
286pub const GU_SYNC_NOWAIT: libc::c_uint = 1;
287pub const GU_SYNC_WHAT_DONE: libc::c_uint = 0;
288pub const GU_SYNC_WHAT_QUEUED: libc::c_uint = 1;
289pub const GU_SYNC_WHAT_DRAW: libc::c_uint = 2;
290pub const GU_SYNC_WHAT_STALL: libc::c_uint = 3;
291pub const GU_SYNC_WHAT_CANCEL: libc::c_uint = 4;
292pub const GU_CALLBACK_SIGNAL: libc::c_uint = 1;
293pub const GU_CALLBACK_FINISH: libc::c_uint = 4;
294pub const GU_BEHAVIOR_SUSPEND: libc::c_uint = 1;
295pub const GU_BEHAVIOR_CONTINUE: libc::c_uint = 2;
296pub const PSP_IMPOSE_MAIN_VOLUME: libc::c_uint = 1;
297pub const PSP_IMPOSE_BACKLIGHT_BRIGHTNESS: libc::c_uint = 2;
298pub const PSP_IMPOSE_EQUALIZER_MODE: libc::c_uint = 4;
299pub const PSP_IMPOSE_MUTE: libc::c_uint = 8;
300pub const PSP_IMPOSE_AVLS: libc::c_uint = 16;
301pub const PSP_IMPOSE_TIME_FORMAT: libc::c_uint = 32;
302pub const PSP_IMPOSE_DATE_FORMAT: libc::c_uint = 64;
303pub const PSP_IMPOSE_LANGUAGE: libc::c_uint = 128;
304pub const PSP_IMPOSE_BACKLIGHT_OFF_INTERVAL: libc::c_uint = 512;
305pub const PSP_IMPOSE_SOUND_REDUCTION: libc::c_uint = 1024;
306pub const PSP_IMPOSE_UMD_POPUP_ENABLED: libc::c_uint = 1;
307pub const PSP_IMPOSE_UMD_POPUP_DISABLED: libc::c_uint = 0;
308pub const SCE_MPEG_AVC_FORMAT_DEFAULT: libc::c_int = -1;
309pub const SCE_MPEG_AVC_FORMAT_5650: libc::c_uint = 0;
310pub const SCE_MPEG_AVC_FORMAT_5551: libc::c_uint = 1;
311pub const SCE_MPEG_AVC_FORMAT_4444: libc::c_uint = 2;
312pub const SCE_MPEG_AVC_FORMAT_8888: libc::c_uint = 3;
313pub const MS_CB_EVENT_INSERTED: libc::c_uint = 1;
314pub const MS_CB_EVENT_EJECTED: libc::c_uint = 2;
315pub const PSP_NET_APCTL_STATE_DISCONNECTED: libc::c_uint = 0;
316pub const PSP_NET_APCTL_STATE_SCANNING: libc::c_uint = 1;
317pub const PSP_NET_APCTL_STATE_JOINING: libc::c_uint = 2;
318pub const PSP_NET_APCTL_STATE_GETTING_IP: libc::c_uint = 3;
319pub const PSP_NET_APCTL_STATE_GOT_IP: libc::c_uint = 4;
320pub const PSP_NET_APCTL_STATE_EAP_AUTH: libc::c_uint = 5;
321pub const PSP_NET_APCTL_STATE_KEY_EXCHANGE: libc::c_uint = 6;
322pub const PSP_NET_APCTL_EVENT_CONNECT_REQUEST: libc::c_uint = 0;
323pub const PSP_NET_APCTL_EVENT_SCAN_REQUEST: libc::c_uint = 1;
324pub const PSP_NET_APCTL_EVENT_SCAN_COMPLETE: libc::c_uint = 2;
325pub const PSP_NET_APCTL_EVENT_ESTABLISHED: libc::c_uint = 3;
326pub const PSP_NET_APCTL_EVENT_GET_IP: libc::c_uint = 4;
327pub const PSP_NET_APCTL_EVENT_DISCONNECT_REQUEST: libc::c_uint = 5;
328pub const PSP_NET_APCTL_EVENT_ERROR: libc::c_uint = 6;
329pub const PSP_NET_APCTL_EVENT_INFO: libc::c_uint = 7;
330pub const PSP_NET_APCTL_EVENT_EAP_AUTH: libc::c_uint = 8;
331pub const PSP_NET_APCTL_EVENT_KEY_EXCHANGE: libc::c_uint = 9;
332pub const PSP_NET_APCTL_EVENT_RECONNECT: libc::c_uint = 10;
333pub const PSP_NET_APCTL_INFO_PROFILE_NAME: libc::c_uint = 0;
334pub const PSP_NET_APCTL_INFO_BSSID: libc::c_uint = 1;
335pub const PSP_NET_APCTL_INFO_SSID: libc::c_uint = 2;
336pub const PSP_NET_APCTL_INFO_SSID_LENGTH: libc::c_uint = 3;
337pub const PSP_NET_APCTL_INFO_SECURITY_TYPE: libc::c_uint = 4;
338pub const PSP_NET_APCTL_INFO_STRENGTH: libc::c_uint = 5;
339pub const PSP_NET_APCTL_INFO_CHANNEL: libc::c_uint = 6;
340pub const PSP_NET_APCTL_INFO_POWER_SAVE: libc::c_uint = 7;
341pub const PSP_NET_APCTL_INFO_IP: libc::c_uint = 8;
342pub const PSP_NET_APCTL_INFO_SUBNETMASK: libc::c_uint = 9;
343pub const PSP_NET_APCTL_INFO_GATEWAY: libc::c_uint = 10;
344pub const PSP_NET_APCTL_INFO_PRIMDNS: libc::c_uint = 11;
345pub const PSP_NET_APCTL_INFO_SECDNS: libc::c_uint = 12;
346pub const PSP_NET_APCTL_INFO_USE_PROXY: libc::c_uint = 13;
347pub const PSP_NET_APCTL_INFO_PROXY_URL: libc::c_uint = 14;
348pub const PSP_NET_APCTL_INFO_PROXY_PORT: libc::c_uint = 15;
349pub const PSP_NET_APCTL_INFO_8021_EAP_TYPE: libc::c_uint = 16;
350pub const PSP_NET_APCTL_INFO_START_BROWSER: libc::c_uint = 17;
351pub const PSP_NET_APCTL_INFO_WIFISP: libc::c_uint = 18;
352pub const PSP_NET_APCTL_INFO_SECURITY_TYPE_NONE: libc::c_uint = 0;
353pub const PSP_NET_APCTL_INFO_SECURITY_TYPE_WEP: libc::c_uint = 1;
354pub const PSP_NET_APCTL_INFO_SECURITY_TYPE_WPA: libc::c_uint = 2;
355pub const SOCK_STREAM: libc::c_uint = 1;
356pub const SOCK_DGRAM: libc::c_uint = 2;
357pub const SOCK_RAW: libc::c_uint = 3;
358pub const SOCK_RDM: libc::c_uint = 4;
359pub const SOCK_SEQPACKET: libc::c_uint = 5;
360pub const SO_DEBUG: libc::c_uint = 1;
361pub const SO_ACCEPTCONN: libc::c_uint = 2;
362pub const SO_REUSEADDR: libc::c_uint = 4;
363pub const SO_KEEPALIVE: libc::c_uint = 8;
364pub const SO_DONTROUTE: libc::c_uint = 16;
365pub const SO_BROADCAST: libc::c_uint = 32;
366pub const SO_USELOOPBACK: libc::c_uint = 64;
367pub const SO_LINGER: libc::c_uint = 128;
368pub const SO_OOBINLINE: libc::c_uint = 256;
369pub const SO_REUSEPORT: libc::c_uint = 512;
370pub const SO_TIMESTAMP: libc::c_uint = 1024;
371pub const SO_SNDBUF: libc::c_uint = 4097;
372pub const SO_RCVBUF: libc::c_uint = 4098;
373pub const SO_SNDLOWAT: libc::c_uint = 4099;
374pub const SO_RCVLOWAT: libc::c_uint = 4100;
375pub const SO_SNDTIMEO: libc::c_uint = 4101;
376pub const SO_RCVTIMEO: libc::c_uint = 4102;
377pub const SO_ERROR: libc::c_uint = 4103;
378pub const SO_TYPE: libc::c_uint = 4104;
379pub const SO_OVERFLOWED: libc::c_uint = 4105;
380pub const SO_NONBLOCK: libc::c_uint = 4105;
381pub const SOL_SOCKET: libc::c_uint = 65535;
382pub const AF_UNSPEC: libc::c_uint = 0;
383pub const AF_LOCAL: libc::c_uint = 1;
384pub const AF_UNIX: libc::c_uint = 1;
385pub const AF_INET: libc::c_uint = 2;
386pub const AF_IMPLINK: libc::c_uint = 3;
387pub const AF_PUP: libc::c_uint = 4;
388pub const AF_CHAOS: libc::c_uint = 5;
389pub const AF_NS: libc::c_uint = 6;
390pub const AF_ISO: libc::c_uint = 7;
391pub const AF_OSI: libc::c_uint = 7;
392pub const AF_ECMA: libc::c_uint = 8;
393pub const AF_DATAKIT: libc::c_uint = 9;
394pub const AF_CCITT: libc::c_uint = 10;
395pub const AF_SNA: libc::c_uint = 11;
396pub const AF_DECnet: libc::c_uint = 12;
397pub const AF_DLI: libc::c_uint = 13;
398pub const AF_LAT: libc::c_uint = 14;
399pub const AF_HYLINK: libc::c_uint = 15;
400pub const AF_APPLETALK: libc::c_uint = 16;
401pub const AF_ROUTE: libc::c_uint = 17;
402pub const AF_LINK: libc::c_uint = 18;
403pub const AF_COIP: libc::c_uint = 20;
404pub const AF_CNT: libc::c_uint = 21;
405pub const AF_IPX: libc::c_uint = 23;
406pub const AF_INET6: libc::c_uint = 24;
407pub const AF_ISDN: libc::c_uint = 26;
408pub const AF_E164: libc::c_uint = 26;
409pub const AF_NATM: libc::c_uint = 27;
410pub const AF_ARP: libc::c_uint = 28;
411pub const AF_MAX: libc::c_uint = 31;
412pub const PF_UNSPEC: libc::c_uint = 0;
413pub const PF_LOCAL: libc::c_uint = 1;
414pub const PF_UNIX: libc::c_uint = 1;
415pub const PF_INET: libc::c_uint = 2;
416pub const PF_IMPLINK: libc::c_uint = 3;
417pub const PF_PUP: libc::c_uint = 4;
418pub const PF_CHAOS: libc::c_uint = 5;
419pub const PF_NS: libc::c_uint = 6;
420pub const PF_ISO: libc::c_uint = 7;
421pub const PF_OSI: libc::c_uint = 7;
422pub const PF_ECMA: libc::c_uint = 8;
423pub const PF_DATAKIT: libc::c_uint = 9;
424pub const PF_CCITT: libc::c_uint = 10;
425pub const PF_SNA: libc::c_uint = 11;
426pub const PF_DECnet: libc::c_uint = 12;
427pub const PF_DLI: libc::c_uint = 13;
428pub const PF_LAT: libc::c_uint = 14;
429pub const PF_HYLINK: libc::c_uint = 15;
430pub const PF_APPLETALK: libc::c_uint = 16;
431pub const PF_ROUTE: libc::c_uint = 17;
432pub const PF_LINK: libc::c_uint = 18;
433pub const PF_COIP: libc::c_uint = 20;
434pub const PF_CNT: libc::c_uint = 21;
435pub const PF_INET6: libc::c_uint = 24;
436pub const PF_IPX: libc::c_uint = 23;
437pub const PF_ISDN: libc::c_uint = 26;
438pub const PF_E164: libc::c_uint = 26;
439pub const PF_NATM: libc::c_uint = 27;
440pub const PF_ARP: libc::c_uint = 28;
441pub const PF_MAX: libc::c_uint = 31;
442pub const MSG_OOB: libc::c_uint = 1;
443pub const MSG_PEEK: libc::c_uint = 2;
444pub const MSG_DONTROUTE: libc::c_uint = 4;
445pub const MSG_EOR: libc::c_uint = 8;
446pub const MSG_TRUNC: libc::c_uint = 16;
447pub const MSG_CTRUNC: libc::c_uint = 32;
448pub const MSG_WAITALL: libc::c_uint = 64;
449pub const MSG_DONTWAIT: libc::c_uint = 128;
450pub const MSG_BCAST: libc::c_uint = 256;
451pub const MSG_MCAST: libc::c_uint = 512;
452pub const SHUT_RD: libc::c_uint = 0;
453pub const SHUT_WR: libc::c_uint = 1;
454pub const SHUT_RDWR: libc::c_uint = 2;
455pub const IPPROTO_IP: libc::c_uint = 0;
456pub const IPPROTO_HOPOPTS: libc::c_uint = 0;
457pub const IPPROTO_ICMP: libc::c_uint = 1;
458pub const IPPROTO_IGMP: libc::c_uint = 2;
459pub const IPPROTO_GGP: libc::c_uint = 3;
460pub const IPPROTO_IPV4: libc::c_uint = 4;
461pub const IPPROTO_IPIP: libc::c_uint = 4;
462pub const IPPROTO_TCP: libc::c_uint = 6;
463pub const IPPROTO_EGP: libc::c_uint = 8;
464pub const IPPROTO_PUP: libc::c_uint = 12;
465pub const IPPROTO_UDP: libc::c_uint = 17;
466pub const IPPROTO_IDP: libc::c_uint = 22;
467pub const IPPROTO_TP: libc::c_uint = 29;
468pub const IPPROTO_IPV6: libc::c_uint = 41;
469pub const IPPROTO_ROUTING: libc::c_uint = 43;
470pub const IPPROTO_FRAGMENT: libc::c_uint = 44;
471pub const IPPROTO_RSVP: libc::c_uint = 46;
472pub const IPPROTO_GRE: libc::c_uint = 47;
473pub const IPPROTO_ESP: libc::c_uint = 50;
474pub const IPPROTO_AH: libc::c_uint = 51;
475pub const IPPROTO_MOBILE: libc::c_uint = 55;
476pub const IPPROTO_IPV6_ICMP: libc::c_uint = 58;
477pub const IPPROTO_ICMPV6: libc::c_uint = 58;
478pub const IPPROTO_NONE: libc::c_uint = 59;
479pub const IPPROTO_DSTOPTS: libc::c_uint = 60;
480pub const IPPROTO_EON: libc::c_uint = 80;
481pub const IPPROTO_ETHERIP: libc::c_uint = 97;
482pub const IPPROTO_ENCAP: libc::c_uint = 98;
483pub const IPPROTO_PIM: libc::c_uint = 103;
484pub const IPPROTO_IPCOMP: libc::c_uint = 108;
485pub const IPPROTO_VRRP: libc::c_uint = 112;
486pub const IPPROTO_RAW: libc::c_uint = 255;
487pub const IPPROTO_MAX: libc::c_uint = 256;
488pub const IPPROTO_DONE: libc::c_uint = 257;
489pub const CTL_IPPROTO_IPSEC: libc::c_uint = 258;
490pub const IPPORT_RESERVED: libc::c_uint = 1024;
491pub const IPPORT_ANONMIN: libc::c_uint = 49152;
492pub const IPPORT_ANONMAX: libc::c_uint = 65535;
493pub const IPPORT_RESERVEDMIN: libc::c_uint = 600;
494pub const IPPORT_RESERVEDMAX: libc::c_uint = 1023;
495pub const IN_CLASSA_NSHIFT: libc::c_uint = 24;
496pub const IN_CLASSA_MAX: libc::c_uint = 128;
497pub const IN_CLASSB_NSHIFT: libc::c_uint = 16;
498pub const IN_CLASSB_MAX: libc::c_uint = 65536;
499pub const IN_CLASSC_NSHIFT: libc::c_uint = 8;
500pub const IN_CLASSD_NSHIFT: libc::c_uint = 28;
501pub const IN_LOOPBACKNET: libc::c_uint = 127;
502pub const INET_ADDRSTRLEN: libc::c_uint = 16;
503pub const IP_OPTIONS: libc::c_uint = 1;
504pub const IP_HDRINCL: libc::c_uint = 2;
505pub const IP_TOS: libc::c_uint = 3;
506pub const IP_TTL: libc::c_uint = 4;
507pub const IP_RECVOPTS: libc::c_uint = 5;
508pub const IP_RECVRETOPTS: libc::c_uint = 6;
509pub const IP_RECVDSTADDR: libc::c_uint = 7;
510pub const IP_RETOPTS: libc::c_uint = 8;
511pub const IP_MULTICAST_IF: libc::c_uint = 9;
512pub const IP_MULTICAST_TTL: libc::c_uint = 10;
513pub const IP_MULTICAST_LOOP: libc::c_uint = 11;
514pub const IP_ADD_MEMBERSHIP: libc::c_uint = 12;
515pub const IP_DROP_MEMBERSHIP: libc::c_uint = 13;
516pub const IP_PORTRANGE: libc::c_uint = 19;
517pub const IP_RECVIF: libc::c_uint = 20;
518pub const IP_ERRORMTU: libc::c_uint = 21;
519pub const IP_IPSEC_POLICY: libc::c_uint = 22;
520pub const IP_DEFAULT_MULTICAST_TTL: libc::c_uint = 1;
521pub const IP_DEFAULT_MULTICAST_LOOP: libc::c_uint = 1;
522pub const IP_MAX_MEMBERSHIPS: libc::c_uint = 20;
523pub const IP_PORTRANGE_DEFAULT: libc::c_uint = 0;
524pub const IP_PORTRANGE_HIGH: libc::c_uint = 1;
525pub const IP_PORTRANGE_LOW: libc::c_uint = 2;
526pub const PSP_POWER_CB_POWER_SWITCH: libc::c_uint = 2147483648;
527pub const PSP_POWER_CB_HOLD_SWITCH: libc::c_uint = 1073741824;
528pub const PSP_POWER_CB_STANDBY: libc::c_uint = 524288;
529pub const PSP_POWER_CB_RESUME_COMPLETE: libc::c_uint = 262144;
530pub const PSP_POWER_CB_RESUMING: libc::c_uint = 131072;
531pub const PSP_POWER_CB_SUSPENDING: libc::c_uint = 65536;
532pub const PSP_POWER_CB_AC_POWER: libc::c_uint = 4096;
533pub const PSP_POWER_CB_BATTERY_LOW: libc::c_uint = 256;
534pub const PSP_POWER_CB_BATTERY_EXIST: libc::c_uint = 128;
535pub const PSP_POWER_CB_BATTPOWER: libc::c_uint = 127;
536pub const PSP_POWER_TICK_ALL: libc::c_uint = 0;
537pub const PSP_POWER_TICK_SUSPEND: libc::c_uint = 1;
538pub const PSP_POWER_TICK_DISPLAY: libc::c_uint = 6;
539pub const SYSTEM_REGISTRY: &'static [u8; 8usize] = b"/system\x00";
540pub const REG_KEYNAME_SIZE: libc::c_uint = 27;
541pub const __GNUC_VA_LIST: libc::c_uint = 1;
542pub const SCE_LED_POWER: libc::c_uint = 1;
543pub const LED_ON: libc::c_uint = 1;
544pub const LED_OFF: libc::c_uint = 0;
545pub const PSP_USBACC_DRIVERNAME: &'static [u8; 17usize] =
546    b"USBAccBaseDriver\x00";
547pub const PSP_USBCAM_PID: libc::c_uint = 642;
548pub const PSP_USBCAM_DRIVERNAME: &'static [u8; 13usize] = b"USBCamDriver\x00";
549pub const PSP_USBCAMMIC_DRIVERNAME: &'static [u8; 16usize] =
550    b"USBCamMicDriver\x00";
551pub const PSP_USBBUS_DRIVERNAME: &'static [u8; 13usize] = b"USBBusDriver\x00";
552pub const PSP_USB_ACTIVATED: libc::c_uint = 512;
553pub const PSP_USB_CABLE_CONNECTED: libc::c_uint = 32;
554pub const PSP_USB_CONNECTION_ESTABLISHED: libc::c_uint = 2;
555pub const PSP_USBSTOR_DRIVERNAME: &'static [u8; 15usize] =
556    b"USBStor_Driver\x00";
557pub const PSP_NETPARAM_NAME: libc::c_uint = 0;
558pub const PSP_NETPARAM_SSID: libc::c_uint = 1;
559pub const PSP_NETPARAM_SECURE: libc::c_uint = 2;
560pub const PSP_NETPARAM_WEPKEY: libc::c_uint = 3;
561pub const PSP_NETPARAM_IS_STATIC_IP: libc::c_uint = 4;
562pub const PSP_NETPARAM_IP: libc::c_uint = 5;
563pub const PSP_NETPARAM_NETMASK: libc::c_uint = 6;
564pub const PSP_NETPARAM_ROUTE: libc::c_uint = 7;
565pub const PSP_NETPARAM_MANUAL_DNS: libc::c_uint = 8;
566pub const PSP_NETPARAM_PRIMARYDNS: libc::c_uint = 9;
567pub const PSP_NETPARAM_SECONDARYDNS: libc::c_uint = 10;
568pub const PSP_NETPARAM_PROXY_USER: libc::c_uint = 11;
569pub const PSP_NETPARAM_PROXY_PASS: libc::c_uint = 12;
570pub const PSP_NETPARAM_USE_PROXY: libc::c_uint = 13;
571pub const PSP_NETPARAM_PROXY_SERVER: libc::c_uint = 14;
572pub const PSP_NETPARAM_PROXY_PORT: libc::c_uint = 15;
573pub const PSP_NETPARAM_UNKNOWN1: libc::c_uint = 16;
574pub const PSP_NETPARAM_UNKNOWN2: libc::c_uint = 17;
575pub const PSP_NETPARAM_ERROR_BAD_NETCONF: libc::c_uint = 2148599297;
576pub const PSP_NETPARAM_ERROR_BAD_PARAM: libc::c_uint = 2148599300;
577pub const PSP_SYSTEMPARAM_ID_STRING_NICKNAME: libc::c_uint = 1;
578pub const PSP_SYSTEMPARAM_ID_INT_ADHOC_CHANNEL: libc::c_uint = 2;
579pub const PSP_SYSTEMPARAM_ID_INT_WLAN_POWERSAVE: libc::c_uint = 3;
580pub const PSP_SYSTEMPARAM_ID_INT_DATE_FORMAT: libc::c_uint = 4;
581pub const PSP_SYSTEMPARAM_ID_INT_TIME_FORMAT: libc::c_uint = 5;
582pub const PSP_SYSTEMPARAM_ID_INT_TIMEZONE: libc::c_uint = 6;
583pub const PSP_SYSTEMPARAM_ID_INT_DAYLIGHTSAVINGS: libc::c_uint = 7;
584pub const PSP_SYSTEMPARAM_ID_INT_LANGUAGE: libc::c_uint = 8;
585pub const PSP_SYSTEMPARAM_ID_INT_UNKNOWN: libc::c_uint = 9;
586pub const PSP_SYSTEMPARAM_RETVAL_OK: libc::c_uint = 0;
587pub const PSP_SYSTEMPARAM_RETVAL_FAIL: libc::c_uint = 2148598019;
588pub const PSP_SYSTEMPARAM_ADHOC_CHANNEL_AUTOMATIC: libc::c_uint = 0;
589pub const PSP_SYSTEMPARAM_ADHOC_CHANNEL_1: libc::c_uint = 1;
590pub const PSP_SYSTEMPARAM_ADHOC_CHANNEL_6: libc::c_uint = 6;
591pub const PSP_SYSTEMPARAM_ADHOC_CHANNEL_11: libc::c_uint = 11;
592pub const PSP_SYSTEMPARAM_WLAN_POWERSAVE_OFF: libc::c_uint = 0;
593pub const PSP_SYSTEMPARAM_WLAN_POWERSAVE_ON: libc::c_uint = 1;
594pub const PSP_SYSTEMPARAM_DATE_FORMAT_YYYYMMDD: libc::c_uint = 0;
595pub const PSP_SYSTEMPARAM_DATE_FORMAT_MMDDYYYY: libc::c_uint = 1;
596pub const PSP_SYSTEMPARAM_DATE_FORMAT_DDMMYYYY: libc::c_uint = 2;
597pub const PSP_SYSTEMPARAM_TIME_FORMAT_24HR: libc::c_uint = 0;
598pub const PSP_SYSTEMPARAM_TIME_FORMAT_12HR: libc::c_uint = 1;
599pub const PSP_SYSTEMPARAM_DAYLIGHTSAVINGS_STD: libc::c_uint = 0;
600pub const PSP_SYSTEMPARAM_DAYLIGHTSAVINGS_SAVING: libc::c_uint = 1;
601pub const PSP_SYSTEMPARAM_LANGUAGE_JAPANESE: libc::c_uint = 0;
602pub const PSP_SYSTEMPARAM_LANGUAGE_ENGLISH: libc::c_uint = 1;
603pub const PSP_SYSTEMPARAM_LANGUAGE_FRENCH: libc::c_uint = 2;
604pub const PSP_SYSTEMPARAM_LANGUAGE_SPANISH: libc::c_uint = 3;
605pub const PSP_SYSTEMPARAM_LANGUAGE_GERMAN: libc::c_uint = 4;
606pub const PSP_SYSTEMPARAM_LANGUAGE_ITALIAN: libc::c_uint = 5;
607pub const PSP_SYSTEMPARAM_LANGUAGE_DUTCH: libc::c_uint = 6;
608pub const PSP_SYSTEMPARAM_LANGUAGE_PORTUGUESE: libc::c_uint = 7;
609pub const PSP_SYSTEMPARAM_LANGUAGE_RUSSIAN: libc::c_uint = 8;
610pub const PSP_SYSTEMPARAM_LANGUAGE_KOREAN: libc::c_uint = 9;
611pub const PSP_SYSTEMPARAM_LANGUAGE_CHINESE_TRADITIONAL: libc::c_uint = 10;
612pub const PSP_SYSTEMPARAM_LANGUAGE_CHINESE_SIMPLIFIED: libc::c_uint = 11;
613pub const PSP_NET_MODULE_COMMON: libc::c_uint = 1;
614pub const PSP_NET_MODULE_ADHOC: libc::c_uint = 2;
615pub const PSP_NET_MODULE_INET: libc::c_uint = 3;
616pub const PSP_NET_MODULE_PARSEURI: libc::c_uint = 4;
617pub const PSP_NET_MODULE_PARSEHTTP: libc::c_uint = 5;
618pub const PSP_NET_MODULE_HTTP: libc::c_uint = 6;
619pub const PSP_NET_MODULE_SSL: libc::c_uint = 7;
620pub const PSP_AV_MODULE_AVCODEC: libc::c_uint = 0;
621pub const PSP_AV_MODULE_SASCORE: libc::c_uint = 1;
622pub const PSP_AV_MODULE_ATRAC3PLUS: libc::c_uint = 2;
623pub const PSP_AV_MODULE_MPEGBASE: libc::c_uint = 3;
624pub const PSP_AV_MODULE_MP3: libc::c_uint = 4;
625pub const PSP_AV_MODULE_VAUDIO: libc::c_uint = 5;
626pub const PSP_AV_MODULE_AAC: libc::c_uint = 6;
627pub const PSP_AV_MODULE_G729: libc::c_uint = 7;
628pub const PSP_USB_MODULE_PSPCM: libc::c_uint = 1;
629pub const PSP_USB_MODULE_ACC: libc::c_uint = 2;
630pub const PSP_USB_MODULE_MIC: libc::c_uint = 3;
631pub const PSP_USB_MODULE_CAM: libc::c_uint = 4;
632pub const PSP_USB_MODULE_GPS: libc::c_uint = 5;
633pub const PSP_MODULE_NET_COMMON: libc::c_uint = 256;
634pub const PSP_MODULE_NET_ADHOC: libc::c_uint = 257;
635pub const PSP_MODULE_NET_INET: libc::c_uint = 258;
636pub const PSP_MODULE_NET_PARSEURI: libc::c_uint = 259;
637pub const PSP_MODULE_NET_PARSEHTTP: libc::c_uint = 260;
638pub const PSP_MODULE_NET_HTTP: libc::c_uint = 261;
639pub const PSP_MODULE_NET_SSL: libc::c_uint = 262;
640pub const PSP_MODULE_USB_PSPCM: libc::c_uint = 512;
641pub const PSP_MODULE_USB_MIC: libc::c_uint = 513;
642pub const PSP_MODULE_USB_CAM: libc::c_uint = 514;
643pub const PSP_MODULE_USB_GPS: libc::c_uint = 515;
644pub const PSP_MODULE_AV_AVCODEC: libc::c_uint = 768;
645pub const PSP_MODULE_AV_SASCORE: libc::c_uint = 769;
646pub const PSP_MODULE_AV_ATRAC3PLUS: libc::c_uint = 770;
647pub const PSP_MODULE_AV_MPEGBASE: libc::c_uint = 771;
648pub const PSP_MODULE_AV_MP3: libc::c_uint = 772;
649pub const PSP_MODULE_AV_VAUDIO: libc::c_uint = 773;
650pub const PSP_MODULE_AV_AAC: libc::c_uint = 774;
651pub const PSP_MODULE_AV_G729: libc::c_uint = 775;
652pub const PSP_MODULE_NP_COMMON: libc::c_uint = 1024;
653pub const PSP_MODULE_NP_SERVICE: libc::c_uint = 1025;
654pub const PSP_MODULE_NP_MATCHING2: libc::c_uint = 1026;
655pub const PSP_MODULE_NP_DRM: libc::c_uint = 1280;
656pub const PSP_MODULE_IRDA: libc::c_uint = 1536;
657pub const PSP_UTILITY_ACCEPT_CIRCLE: libc::c_uint = 0;
658pub const PSP_UTILITY_ACCEPT_CROSS: libc::c_uint = 1;
659pub const VMAT0: libc::c_uint = 1;
660pub const VMAT1: libc::c_uint = 2;
661pub const VMAT2: libc::c_uint = 4;
662pub const VMAT3: libc::c_uint = 8;
663pub const VMAT4: libc::c_uint = 16;
664pub const VMAT5: libc::c_uint = 32;
665pub const VMAT6: libc::c_uint = 64;
666pub const VMAT7: libc::c_uint = 128;
667pub type int_least8_t = libc::c_schar;
668pub type uint_least8_t = libc::c_uchar;
669pub type int_least16_t = i16;
670pub type uint_least16_t = u16;
671pub type int_least32_t = i32;
672pub type uint_least32_t = u32;
673pub type int_least64_t = i64;
674pub type uint_least64_t = u64;
675pub type int_fast8_t = libc::c_int;
676pub type uint_fast8_t = libc::c_uint;
677pub type int_fast16_t = libc::c_int;
678pub type uint_fast16_t = libc::c_uint;
679pub type int_fast32_t = libc::c_int;
680pub type uint_fast32_t = libc::c_uint;
681pub type int_fast64_t = int_least64_t;
682pub type uint_fast64_t = uint_least64_t;
683pub type intmax_t = libc::c_long;
684pub type uintmax_t = libc::c_ulong;
685pub type s8 = i8;
686pub type s16 = i16;
687pub type s32 = i32;
688pub type s64 = i64;
689pub type vu8 = u8;
690pub type vu16 = u16;
691pub type vu32 = u32;
692pub type vu64 = u64;
693pub type vs8 = i8;
694pub type vs16 = i16;
695pub type vs32 = i32;
696pub type vs64 = i64;
697pub type SceUChar8 = libc::c_uchar;
698pub type SceUShort16 = u16;
699pub type SceUInt32 = u32;
700pub type SceUInt64 = u64;
701pub type SceULong64 = u64;
702pub type SceChar8 = libc::c_char;
703pub type SceShort16 = i16;
704pub type SceInt32 = i32;
705pub type SceInt64 = i64;
706pub type SceLong64 = i64;
707pub type SceFloat = f32;
708pub type SceFloat32 = f32;
709pub type SceWChar16 = libc::c_ushort;
710pub type SceWChar32 = libc::c_uint;
711pub type SceBool = libc::c_int;
712pub type SceVoid = libc::c_void;
713pub type ScePVoid = *mut libc::c_void;
714#[repr(C)]
715#[derive(Debug, Copy)]
716pub struct ScePspSRect {
717    pub x: libc::c_short,
718    pub y: libc::c_short,
719    pub w: libc::c_short,
720    pub h: libc::c_short,
721}
722#[test]
723fn bindgen_test_layout_ScePspSRect() {
724    assert_eq!(::core::mem::size_of::<ScePspSRect>() , 8usize , concat ! (
725               "Size of: " , stringify ! ( ScePspSRect ) ));
726    assert_eq! (::core::mem::align_of::<ScePspSRect>() , 2usize , concat ! (
727                "Alignment of " , stringify ! ( ScePspSRect ) ));
728    assert_eq! (unsafe {
729                & ( * ( 0 as * const ScePspSRect ) ) . x as * const _ as usize
730                } , 0usize , concat ! (
731                "Alignment of field: " , stringify ! ( ScePspSRect ) , "::" ,
732                stringify ! ( x ) ));
733    assert_eq! (unsafe {
734                & ( * ( 0 as * const ScePspSRect ) ) . y as * const _ as usize
735                } , 2usize , concat ! (
736                "Alignment of field: " , stringify ! ( ScePspSRect ) , "::" ,
737                stringify ! ( y ) ));
738    assert_eq! (unsafe {
739                & ( * ( 0 as * const ScePspSRect ) ) . w as * const _ as usize
740                } , 4usize , concat ! (
741                "Alignment of field: " , stringify ! ( ScePspSRect ) , "::" ,
742                stringify ! ( w ) ));
743    assert_eq! (unsafe {
744                & ( * ( 0 as * const ScePspSRect ) ) . h as * const _ as usize
745                } , 6usize , concat ! (
746                "Alignment of field: " , stringify ! ( ScePspSRect ) , "::" ,
747                stringify ! ( h ) ));
748}
749impl Clone for ScePspSRect {
750    fn clone(&self) -> Self { *self }
751}
752#[repr(C)]
753#[derive(Debug, Copy)]
754pub struct ScePspIRect {
755    pub x: libc::c_int,
756    pub y: libc::c_int,
757    pub w: libc::c_int,
758    pub h: libc::c_int,
759}
760#[test]
761fn bindgen_test_layout_ScePspIRect() {
762    assert_eq!(::core::mem::size_of::<ScePspIRect>() , 16usize , concat ! (
763               "Size of: " , stringify ! ( ScePspIRect ) ));
764    assert_eq! (::core::mem::align_of::<ScePspIRect>() , 4usize , concat ! (
765                "Alignment of " , stringify ! ( ScePspIRect ) ));
766    assert_eq! (unsafe {
767                & ( * ( 0 as * const ScePspIRect ) ) . x as * const _ as usize
768                } , 0usize , concat ! (
769                "Alignment of field: " , stringify ! ( ScePspIRect ) , "::" ,
770                stringify ! ( x ) ));
771    assert_eq! (unsafe {
772                & ( * ( 0 as * const ScePspIRect ) ) . y as * const _ as usize
773                } , 4usize , concat ! (
774                "Alignment of field: " , stringify ! ( ScePspIRect ) , "::" ,
775                stringify ! ( y ) ));
776    assert_eq! (unsafe {
777                & ( * ( 0 as * const ScePspIRect ) ) . w as * const _ as usize
778                } , 8usize , concat ! (
779                "Alignment of field: " , stringify ! ( ScePspIRect ) , "::" ,
780                stringify ! ( w ) ));
781    assert_eq! (unsafe {
782                & ( * ( 0 as * const ScePspIRect ) ) . h as * const _ as usize
783                } , 12usize , concat ! (
784                "Alignment of field: " , stringify ! ( ScePspIRect ) , "::" ,
785                stringify ! ( h ) ));
786}
787impl Clone for ScePspIRect {
788    fn clone(&self) -> Self { *self }
789}
790#[repr(C)]
791#[derive(Debug, Copy)]
792pub struct ScePspL64Rect {
793    pub x: SceLong64,
794    pub y: SceLong64,
795    pub w: SceLong64,
796    pub h: SceLong64,
797}
798#[test]
799fn bindgen_test_layout_ScePspL64Rect() {
800    assert_eq!(::core::mem::size_of::<ScePspL64Rect>() , 32usize , concat ! (
801               "Size of: " , stringify ! ( ScePspL64Rect ) ));
802    assert_eq! (::core::mem::align_of::<ScePspL64Rect>() , 8usize , concat ! (
803                "Alignment of " , stringify ! ( ScePspL64Rect ) ));
804    assert_eq! (unsafe {
805                & ( * ( 0 as * const ScePspL64Rect ) ) . x as * const _ as
806                usize } , 0usize , concat ! (
807                "Alignment of field: " , stringify ! ( ScePspL64Rect ) , "::"
808                , stringify ! ( x ) ));
809    assert_eq! (unsafe {
810                & ( * ( 0 as * const ScePspL64Rect ) ) . y as * const _ as
811                usize } , 8usize , concat ! (
812                "Alignment of field: " , stringify ! ( ScePspL64Rect ) , "::"
813                , stringify ! ( y ) ));
814    assert_eq! (unsafe {
815                & ( * ( 0 as * const ScePspL64Rect ) ) . w as * const _ as
816                usize } , 16usize , concat ! (
817                "Alignment of field: " , stringify ! ( ScePspL64Rect ) , "::"
818                , stringify ! ( w ) ));
819    assert_eq! (unsafe {
820                & ( * ( 0 as * const ScePspL64Rect ) ) . h as * const _ as
821                usize } , 24usize , concat ! (
822                "Alignment of field: " , stringify ! ( ScePspL64Rect ) , "::"
823                , stringify ! ( h ) ));
824}
825impl Clone for ScePspL64Rect {
826    fn clone(&self) -> Self { *self }
827}
828#[repr(C)]
829#[derive(Debug, Copy)]
830pub struct ScePspFRect {
831    pub x: f32,
832    pub y: f32,
833    pub w: f32,
834    pub h: f32,
835}
836#[test]
837fn bindgen_test_layout_ScePspFRect() {
838    assert_eq!(::core::mem::size_of::<ScePspFRect>() , 16usize , concat ! (
839               "Size of: " , stringify ! ( ScePspFRect ) ));
840    assert_eq! (::core::mem::align_of::<ScePspFRect>() , 4usize , concat ! (
841                "Alignment of " , stringify ! ( ScePspFRect ) ));
842    assert_eq! (unsafe {
843                & ( * ( 0 as * const ScePspFRect ) ) . x as * const _ as usize
844                } , 0usize , concat ! (
845                "Alignment of field: " , stringify ! ( ScePspFRect ) , "::" ,
846                stringify ! ( x ) ));
847    assert_eq! (unsafe {
848                & ( * ( 0 as * const ScePspFRect ) ) . y as * const _ as usize
849                } , 4usize , concat ! (
850                "Alignment of field: " , stringify ! ( ScePspFRect ) , "::" ,
851                stringify ! ( y ) ));
852    assert_eq! (unsafe {
853                & ( * ( 0 as * const ScePspFRect ) ) . w as * const _ as usize
854                } , 8usize , concat ! (
855                "Alignment of field: " , stringify ! ( ScePspFRect ) , "::" ,
856                stringify ! ( w ) ));
857    assert_eq! (unsafe {
858                & ( * ( 0 as * const ScePspFRect ) ) . h as * const _ as usize
859                } , 12usize , concat ! (
860                "Alignment of field: " , stringify ! ( ScePspFRect ) , "::" ,
861                stringify ! ( h ) ));
862}
863impl Clone for ScePspFRect {
864    fn clone(&self) -> Self { *self }
865}
866#[repr(C)]
867#[derive(Debug, Copy)]
868pub struct ScePspSVector2 {
869    pub x: libc::c_short,
870    pub y: libc::c_short,
871}
872#[test]
873fn bindgen_test_layout_ScePspSVector2() {
874    assert_eq!(::core::mem::size_of::<ScePspSVector2>() , 4usize , concat ! (
875               "Size of: " , stringify ! ( ScePspSVector2 ) ));
876    assert_eq! (::core::mem::align_of::<ScePspSVector2>() , 2usize , concat !
877                ( "Alignment of " , stringify ! ( ScePspSVector2 ) ));
878    assert_eq! (unsafe {
879                & ( * ( 0 as * const ScePspSVector2 ) ) . x as * const _ as
880                usize } , 0usize , concat ! (
881                "Alignment of field: " , stringify ! ( ScePspSVector2 ) , "::"
882                , stringify ! ( x ) ));
883    assert_eq! (unsafe {
884                & ( * ( 0 as * const ScePspSVector2 ) ) . y as * const _ as
885                usize } , 2usize , concat ! (
886                "Alignment of field: " , stringify ! ( ScePspSVector2 ) , "::"
887                , stringify ! ( y ) ));
888}
889impl Clone for ScePspSVector2 {
890    fn clone(&self) -> Self { *self }
891}
892#[repr(C)]
893#[derive(Debug, Copy)]
894pub struct ScePspIVector2 {
895    pub x: libc::c_int,
896    pub y: libc::c_int,
897}
898#[test]
899fn bindgen_test_layout_ScePspIVector2() {
900    assert_eq!(::core::mem::size_of::<ScePspIVector2>() , 8usize , concat ! (
901               "Size of: " , stringify ! ( ScePspIVector2 ) ));
902    assert_eq! (::core::mem::align_of::<ScePspIVector2>() , 4usize , concat !
903                ( "Alignment of " , stringify ! ( ScePspIVector2 ) ));
904    assert_eq! (unsafe {
905                & ( * ( 0 as * const ScePspIVector2 ) ) . x as * const _ as
906                usize } , 0usize , concat ! (
907                "Alignment of field: " , stringify ! ( ScePspIVector2 ) , "::"
908                , stringify ! ( x ) ));
909    assert_eq! (unsafe {
910                & ( * ( 0 as * const ScePspIVector2 ) ) . y as * const _ as
911                usize } , 4usize , concat ! (
912                "Alignment of field: " , stringify ! ( ScePspIVector2 ) , "::"
913                , stringify ! ( y ) ));
914}
915impl Clone for ScePspIVector2 {
916    fn clone(&self) -> Self { *self }
917}
918#[repr(C)]
919#[derive(Debug, Copy)]
920pub struct ScePspL64Vector2 {
921    pub x: SceLong64,
922    pub y: SceLong64,
923}
924#[test]
925fn bindgen_test_layout_ScePspL64Vector2() {
926    assert_eq!(::core::mem::size_of::<ScePspL64Vector2>() , 16usize , concat !
927               ( "Size of: " , stringify ! ( ScePspL64Vector2 ) ));
928    assert_eq! (::core::mem::align_of::<ScePspL64Vector2>() , 8usize , concat
929                ! ( "Alignment of " , stringify ! ( ScePspL64Vector2 ) ));
930    assert_eq! (unsafe {
931                & ( * ( 0 as * const ScePspL64Vector2 ) ) . x as * const _ as
932                usize } , 0usize , concat ! (
933                "Alignment of field: " , stringify ! ( ScePspL64Vector2 ) ,
934                "::" , stringify ! ( x ) ));
935    assert_eq! (unsafe {
936                & ( * ( 0 as * const ScePspL64Vector2 ) ) . y as * const _ as
937                usize } , 8usize , concat ! (
938                "Alignment of field: " , stringify ! ( ScePspL64Vector2 ) ,
939                "::" , stringify ! ( y ) ));
940}
941impl Clone for ScePspL64Vector2 {
942    fn clone(&self) -> Self { *self }
943}
944#[repr(C)]
945#[derive(Debug, Copy)]
946pub struct ScePspFVector2 {
947    pub x: f32,
948    pub y: f32,
949}
950#[test]
951fn bindgen_test_layout_ScePspFVector2() {
952    assert_eq!(::core::mem::size_of::<ScePspFVector2>() , 8usize , concat ! (
953               "Size of: " , stringify ! ( ScePspFVector2 ) ));
954    assert_eq! (::core::mem::align_of::<ScePspFVector2>() , 4usize , concat !
955                ( "Alignment of " , stringify ! ( ScePspFVector2 ) ));
956    assert_eq! (unsafe {
957                & ( * ( 0 as * const ScePspFVector2 ) ) . x as * const _ as
958                usize } , 0usize , concat ! (
959                "Alignment of field: " , stringify ! ( ScePspFVector2 ) , "::"
960                , stringify ! ( x ) ));
961    assert_eq! (unsafe {
962                & ( * ( 0 as * const ScePspFVector2 ) ) . y as * const _ as
963                usize } , 4usize , concat ! (
964                "Alignment of field: " , stringify ! ( ScePspFVector2 ) , "::"
965                , stringify ! ( y ) ));
966}
967impl Clone for ScePspFVector2 {
968    fn clone(&self) -> Self { *self }
969}
970#[repr(C)]
971#[derive(Copy)]
972pub union ScePspVector2 {
973    pub fv: ScePspFVector2,
974    pub iv: ScePspIVector2,
975    pub f: [f32; 2usize],
976    pub i: [libc::c_int; 2usize],
977    _bindgen_union_align: [u32; 2usize],
978}
979#[test]
980fn bindgen_test_layout_ScePspVector2() {
981    assert_eq!(::core::mem::size_of::<ScePspVector2>() , 8usize , concat ! (
982               "Size of: " , stringify ! ( ScePspVector2 ) ));
983    assert_eq! (::core::mem::align_of::<ScePspVector2>() , 4usize , concat ! (
984                "Alignment of " , stringify ! ( ScePspVector2 ) ));
985    assert_eq! (unsafe {
986                & ( * ( 0 as * const ScePspVector2 ) ) . fv as * const _ as
987                usize } , 0usize , concat ! (
988                "Alignment of field: " , stringify ! ( ScePspVector2 ) , "::"
989                , stringify ! ( fv ) ));
990    assert_eq! (unsafe {
991                & ( * ( 0 as * const ScePspVector2 ) ) . iv as * const _ as
992                usize } , 0usize , concat ! (
993                "Alignment of field: " , stringify ! ( ScePspVector2 ) , "::"
994                , stringify ! ( iv ) ));
995    assert_eq! (unsafe {
996                & ( * ( 0 as * const ScePspVector2 ) ) . f as * const _ as
997                usize } , 0usize , concat ! (
998                "Alignment of field: " , stringify ! ( ScePspVector2 ) , "::"
999                , stringify ! ( f ) ));
1000    assert_eq! (unsafe {
1001                & ( * ( 0 as * const ScePspVector2 ) ) . i as * const _ as
1002                usize } , 0usize , concat ! (
1003                "Alignment of field: " , stringify ! ( ScePspVector2 ) , "::"
1004                , stringify ! ( i ) ));
1005}
1006impl Clone for ScePspVector2 {
1007    fn clone(&self) -> Self { *self }
1008}
1009#[repr(C)]
1010#[derive(Debug, Copy)]
1011pub struct ScePspSVector3 {
1012    pub x: libc::c_short,
1013    pub y: libc::c_short,
1014    pub z: libc::c_short,
1015}
1016#[test]
1017fn bindgen_test_layout_ScePspSVector3() {
1018    assert_eq!(::core::mem::size_of::<ScePspSVector3>() , 6usize , concat ! (
1019               "Size of: " , stringify ! ( ScePspSVector3 ) ));
1020    assert_eq! (::core::mem::align_of::<ScePspSVector3>() , 2usize , concat !
1021                ( "Alignment of " , stringify ! ( ScePspSVector3 ) ));
1022    assert_eq! (unsafe {
1023                & ( * ( 0 as * const ScePspSVector3 ) ) . x as * const _ as
1024                usize } , 0usize , concat ! (
1025                "Alignment of field: " , stringify ! ( ScePspSVector3 ) , "::"
1026                , stringify ! ( x ) ));
1027    assert_eq! (unsafe {
1028                & ( * ( 0 as * const ScePspSVector3 ) ) . y as * const _ as
1029                usize } , 2usize , concat ! (
1030                "Alignment of field: " , stringify ! ( ScePspSVector3 ) , "::"
1031                , stringify ! ( y ) ));
1032    assert_eq! (unsafe {
1033                & ( * ( 0 as * const ScePspSVector3 ) ) . z as * const _ as
1034                usize } , 4usize , concat ! (
1035                "Alignment of field: " , stringify ! ( ScePspSVector3 ) , "::"
1036                , stringify ! ( z ) ));
1037}
1038impl Clone for ScePspSVector3 {
1039    fn clone(&self) -> Self { *self }
1040}
1041#[repr(C)]
1042#[derive(Debug, Copy)]
1043pub struct ScePspIVector3 {
1044    pub x: libc::c_int,
1045    pub y: libc::c_int,
1046    pub z: libc::c_int,
1047}
1048#[test]
1049fn bindgen_test_layout_ScePspIVector3() {
1050    assert_eq!(::core::mem::size_of::<ScePspIVector3>() , 12usize , concat ! (
1051               "Size of: " , stringify ! ( ScePspIVector3 ) ));
1052    assert_eq! (::core::mem::align_of::<ScePspIVector3>() , 4usize , concat !
1053                ( "Alignment of " , stringify ! ( ScePspIVector3 ) ));
1054    assert_eq! (unsafe {
1055                & ( * ( 0 as * const ScePspIVector3 ) ) . x as * const _ as
1056                usize } , 0usize , concat ! (
1057                "Alignment of field: " , stringify ! ( ScePspIVector3 ) , "::"
1058                , stringify ! ( x ) ));
1059    assert_eq! (unsafe {
1060                & ( * ( 0 as * const ScePspIVector3 ) ) . y as * const _ as
1061                usize } , 4usize , concat ! (
1062                "Alignment of field: " , stringify ! ( ScePspIVector3 ) , "::"
1063                , stringify ! ( y ) ));
1064    assert_eq! (unsafe {
1065                & ( * ( 0 as * const ScePspIVector3 ) ) . z as * const _ as
1066                usize } , 8usize , concat ! (
1067                "Alignment of field: " , stringify ! ( ScePspIVector3 ) , "::"
1068                , stringify ! ( z ) ));
1069}
1070impl Clone for ScePspIVector3 {
1071    fn clone(&self) -> Self { *self }
1072}
1073#[repr(C)]
1074#[derive(Debug, Copy)]
1075pub struct ScePspL64Vector3 {
1076    pub x: SceLong64,
1077    pub y: SceLong64,
1078    pub z: SceLong64,
1079}
1080#[test]
1081fn bindgen_test_layout_ScePspL64Vector3() {
1082    assert_eq!(::core::mem::size_of::<ScePspL64Vector3>() , 24usize , concat !
1083               ( "Size of: " , stringify ! ( ScePspL64Vector3 ) ));
1084    assert_eq! (::core::mem::align_of::<ScePspL64Vector3>() , 8usize , concat
1085                ! ( "Alignment of " , stringify ! ( ScePspL64Vector3 ) ));
1086    assert_eq! (unsafe {
1087                & ( * ( 0 as * const ScePspL64Vector3 ) ) . x as * const _ as
1088                usize } , 0usize , concat ! (
1089                "Alignment of field: " , stringify ! ( ScePspL64Vector3 ) ,
1090                "::" , stringify ! ( x ) ));
1091    assert_eq! (unsafe {
1092                & ( * ( 0 as * const ScePspL64Vector3 ) ) . y as * const _ as
1093                usize } , 8usize , concat ! (
1094                "Alignment of field: " , stringify ! ( ScePspL64Vector3 ) ,
1095                "::" , stringify ! ( y ) ));
1096    assert_eq! (unsafe {
1097                & ( * ( 0 as * const ScePspL64Vector3 ) ) . z as * const _ as
1098                usize } , 16usize , concat ! (
1099                "Alignment of field: " , stringify ! ( ScePspL64Vector3 ) ,
1100                "::" , stringify ! ( z ) ));
1101}
1102impl Clone for ScePspL64Vector3 {
1103    fn clone(&self) -> Self { *self }
1104}
1105#[repr(C)]
1106#[derive(Debug, Copy)]
1107pub struct ScePspFVector3 {
1108    pub x: f32,
1109    pub y: f32,
1110    pub z: f32,
1111}
1112#[test]
1113fn bindgen_test_layout_ScePspFVector3() {
1114    assert_eq!(::core::mem::size_of::<ScePspFVector3>() , 12usize , concat ! (
1115               "Size of: " , stringify ! ( ScePspFVector3 ) ));
1116    assert_eq! (::core::mem::align_of::<ScePspFVector3>() , 4usize , concat !
1117                ( "Alignment of " , stringify ! ( ScePspFVector3 ) ));
1118    assert_eq! (unsafe {
1119                & ( * ( 0 as * const ScePspFVector3 ) ) . x as * const _ as
1120                usize } , 0usize , concat ! (
1121                "Alignment of field: " , stringify ! ( ScePspFVector3 ) , "::"
1122                , stringify ! ( x ) ));
1123    assert_eq! (unsafe {
1124                & ( * ( 0 as * const ScePspFVector3 ) ) . y as * const _ as
1125                usize } , 4usize , concat ! (
1126                "Alignment of field: " , stringify ! ( ScePspFVector3 ) , "::"
1127                , stringify ! ( y ) ));
1128    assert_eq! (unsafe {
1129                & ( * ( 0 as * const ScePspFVector3 ) ) . z as * const _ as
1130                usize } , 8usize , concat ! (
1131                "Alignment of field: " , stringify ! ( ScePspFVector3 ) , "::"
1132                , stringify ! ( z ) ));
1133}
1134impl Clone for ScePspFVector3 {
1135    fn clone(&self) -> Self { *self }
1136}
1137#[repr(C)]
1138#[derive(Copy)]
1139pub union ScePspVector3 {
1140    pub fv: ScePspFVector3,
1141    pub iv: ScePspIVector3,
1142    pub f: [f32; 3usize],
1143    pub i: [libc::c_int; 3usize],
1144    _bindgen_union_align: [u32; 3usize],
1145}
1146#[test]
1147fn bindgen_test_layout_ScePspVector3() {
1148    assert_eq!(::core::mem::size_of::<ScePspVector3>() , 12usize , concat ! (
1149               "Size of: " , stringify ! ( ScePspVector3 ) ));
1150    assert_eq! (::core::mem::align_of::<ScePspVector3>() , 4usize , concat ! (
1151                "Alignment of " , stringify ! ( ScePspVector3 ) ));
1152    assert_eq! (unsafe {
1153                & ( * ( 0 as * const ScePspVector3 ) ) . fv as * const _ as
1154                usize } , 0usize , concat ! (
1155                "Alignment of field: " , stringify ! ( ScePspVector3 ) , "::"
1156                , stringify ! ( fv ) ));
1157    assert_eq! (unsafe {
1158                & ( * ( 0 as * const ScePspVector3 ) ) . iv as * const _ as
1159                usize } , 0usize , concat ! (
1160                "Alignment of field: " , stringify ! ( ScePspVector3 ) , "::"
1161                , stringify ! ( iv ) ));
1162    assert_eq! (unsafe {
1163                & ( * ( 0 as * const ScePspVector3 ) ) . f as * const _ as
1164                usize } , 0usize , concat ! (
1165                "Alignment of field: " , stringify ! ( ScePspVector3 ) , "::"
1166                , stringify ! ( f ) ));
1167    assert_eq! (unsafe {
1168                & ( * ( 0 as * const ScePspVector3 ) ) . i as * const _ as
1169                usize } , 0usize , concat ! (
1170                "Alignment of field: " , stringify ! ( ScePspVector3 ) , "::"
1171                , stringify ! ( i ) ));
1172}
1173impl Clone for ScePspVector3 {
1174    fn clone(&self) -> Self { *self }
1175}
1176#[repr(C)]
1177#[derive(Debug, Copy)]
1178pub struct ScePspSVector4 {
1179    pub x: libc::c_short,
1180    pub y: libc::c_short,
1181    pub z: libc::c_short,
1182    pub w: libc::c_short,
1183}
1184#[test]
1185fn bindgen_test_layout_ScePspSVector4() {
1186    assert_eq!(::core::mem::size_of::<ScePspSVector4>() , 8usize , concat ! (
1187               "Size of: " , stringify ! ( ScePspSVector4 ) ));
1188    assert_eq! (::core::mem::align_of::<ScePspSVector4>() , 2usize , concat !
1189                ( "Alignment of " , stringify ! ( ScePspSVector4 ) ));
1190    assert_eq! (unsafe {
1191                & ( * ( 0 as * const ScePspSVector4 ) ) . x as * const _ as
1192                usize } , 0usize , concat ! (
1193                "Alignment of field: " , stringify ! ( ScePspSVector4 ) , "::"
1194                , stringify ! ( x ) ));
1195    assert_eq! (unsafe {
1196                & ( * ( 0 as * const ScePspSVector4 ) ) . y as * const _ as
1197                usize } , 2usize , concat ! (
1198                "Alignment of field: " , stringify ! ( ScePspSVector4 ) , "::"
1199                , stringify ! ( y ) ));
1200    assert_eq! (unsafe {
1201                & ( * ( 0 as * const ScePspSVector4 ) ) . z as * const _ as
1202                usize } , 4usize , concat ! (
1203                "Alignment of field: " , stringify ! ( ScePspSVector4 ) , "::"
1204                , stringify ! ( z ) ));
1205    assert_eq! (unsafe {
1206                & ( * ( 0 as * const ScePspSVector4 ) ) . w as * const _ as
1207                usize } , 6usize , concat ! (
1208                "Alignment of field: " , stringify ! ( ScePspSVector4 ) , "::"
1209                , stringify ! ( w ) ));
1210}
1211impl Clone for ScePspSVector4 {
1212    fn clone(&self) -> Self { *self }
1213}
1214#[repr(C)]
1215#[derive(Debug, Copy)]
1216pub struct ScePspIVector4 {
1217    pub x: libc::c_int,
1218    pub y: libc::c_int,
1219    pub z: libc::c_int,
1220    pub w: libc::c_int,
1221}
1222#[test]
1223fn bindgen_test_layout_ScePspIVector4() {
1224    assert_eq!(::core::mem::size_of::<ScePspIVector4>() , 16usize , concat ! (
1225               "Size of: " , stringify ! ( ScePspIVector4 ) ));
1226    assert_eq! (::core::mem::align_of::<ScePspIVector4>() , 4usize , concat !
1227                ( "Alignment of " , stringify ! ( ScePspIVector4 ) ));
1228    assert_eq! (unsafe {
1229                & ( * ( 0 as * const ScePspIVector4 ) ) . x as * const _ as
1230                usize } , 0usize , concat ! (
1231                "Alignment of field: " , stringify ! ( ScePspIVector4 ) , "::"
1232                , stringify ! ( x ) ));
1233    assert_eq! (unsafe {
1234                & ( * ( 0 as * const ScePspIVector4 ) ) . y as * const _ as
1235                usize } , 4usize , concat ! (
1236                "Alignment of field: " , stringify ! ( ScePspIVector4 ) , "::"
1237                , stringify ! ( y ) ));
1238    assert_eq! (unsafe {
1239                & ( * ( 0 as * const ScePspIVector4 ) ) . z as * const _ as
1240                usize } , 8usize , concat ! (
1241                "Alignment of field: " , stringify ! ( ScePspIVector4 ) , "::"
1242                , stringify ! ( z ) ));
1243    assert_eq! (unsafe {
1244                & ( * ( 0 as * const ScePspIVector4 ) ) . w as * const _ as
1245                usize } , 12usize , concat ! (
1246                "Alignment of field: " , stringify ! ( ScePspIVector4 ) , "::"
1247                , stringify ! ( w ) ));
1248}
1249impl Clone for ScePspIVector4 {
1250    fn clone(&self) -> Self { *self }
1251}
1252#[repr(C)]
1253#[derive(Debug, Copy)]
1254pub struct ScePspL64Vector4 {
1255    pub x: SceLong64,
1256    pub y: SceLong64,
1257    pub z: SceLong64,
1258    pub w: SceLong64,
1259}
1260#[test]
1261fn bindgen_test_layout_ScePspL64Vector4() {
1262    assert_eq!(::core::mem::size_of::<ScePspL64Vector4>() , 32usize , concat !
1263               ( "Size of: " , stringify ! ( ScePspL64Vector4 ) ));
1264    assert_eq! (::core::mem::align_of::<ScePspL64Vector4>() , 8usize , concat
1265                ! ( "Alignment of " , stringify ! ( ScePspL64Vector4 ) ));
1266    assert_eq! (unsafe {
1267                & ( * ( 0 as * const ScePspL64Vector4 ) ) . x as * const _ as
1268                usize } , 0usize , concat ! (
1269                "Alignment of field: " , stringify ! ( ScePspL64Vector4 ) ,
1270                "::" , stringify ! ( x ) ));
1271    assert_eq! (unsafe {
1272                & ( * ( 0 as * const ScePspL64Vector4 ) ) . y as * const _ as
1273                usize } , 8usize , concat ! (
1274                "Alignment of field: " , stringify ! ( ScePspL64Vector4 ) ,
1275                "::" , stringify ! ( y ) ));
1276    assert_eq! (unsafe {
1277                & ( * ( 0 as * const ScePspL64Vector4 ) ) . z as * const _ as
1278                usize } , 16usize , concat ! (
1279                "Alignment of field: " , stringify ! ( ScePspL64Vector4 ) ,
1280                "::" , stringify ! ( z ) ));
1281    assert_eq! (unsafe {
1282                & ( * ( 0 as * const ScePspL64Vector4 ) ) . w as * const _ as
1283                usize } , 24usize , concat ! (
1284                "Alignment of field: " , stringify ! ( ScePspL64Vector4 ) ,
1285                "::" , stringify ! ( w ) ));
1286}
1287impl Clone for ScePspL64Vector4 {
1288    fn clone(&self) -> Self { *self }
1289}
1290#[repr(C)]
1291#[derive(Debug, Copy)]
1292pub struct ScePspFVector4 {
1293    pub x: f32,
1294    pub y: f32,
1295    pub z: f32,
1296    pub w: f32,
1297}
1298#[test]
1299fn bindgen_test_layout_ScePspFVector4() {
1300    assert_eq!(::core::mem::size_of::<ScePspFVector4>() , 16usize , concat ! (
1301               "Size of: " , stringify ! ( ScePspFVector4 ) ));
1302    assert_eq! (::core::mem::align_of::<ScePspFVector4>() , 4usize , concat !
1303                ( "Alignment of " , stringify ! ( ScePspFVector4 ) ));
1304    assert_eq! (unsafe {
1305                & ( * ( 0 as * const ScePspFVector4 ) ) . x as * const _ as
1306                usize } , 0usize , concat ! (
1307                "Alignment of field: " , stringify ! ( ScePspFVector4 ) , "::"
1308                , stringify ! ( x ) ));
1309    assert_eq! (unsafe {
1310                & ( * ( 0 as * const ScePspFVector4 ) ) . y as * const _ as
1311                usize } , 4usize , concat ! (
1312                "Alignment of field: " , stringify ! ( ScePspFVector4 ) , "::"
1313                , stringify ! ( y ) ));
1314    assert_eq! (unsafe {
1315                & ( * ( 0 as * const ScePspFVector4 ) ) . z as * const _ as
1316                usize } , 8usize , concat ! (
1317                "Alignment of field: " , stringify ! ( ScePspFVector4 ) , "::"
1318                , stringify ! ( z ) ));
1319    assert_eq! (unsafe {
1320                & ( * ( 0 as * const ScePspFVector4 ) ) . w as * const _ as
1321                usize } , 12usize , concat ! (
1322                "Alignment of field: " , stringify ! ( ScePspFVector4 ) , "::"
1323                , stringify ! ( w ) ));
1324}
1325impl Clone for ScePspFVector4 {
1326    fn clone(&self) -> Self { *self }
1327}
1328#[repr(C)]
1329#[derive(Debug, Copy)]
1330pub struct ScePspFVector4Unaligned {
1331    pub x: f32,
1332    pub y: f32,
1333    pub z: f32,
1334    pub w: f32,
1335}
1336#[test]
1337fn bindgen_test_layout_ScePspFVector4Unaligned() {
1338    assert_eq!(::core::mem::size_of::<ScePspFVector4Unaligned>() , 16usize ,
1339               concat ! (
1340               "Size of: " , stringify ! ( ScePspFVector4Unaligned ) ));
1341    assert_eq! (::core::mem::align_of::<ScePspFVector4Unaligned>() , 4usize ,
1342                concat ! (
1343                "Alignment of " , stringify ! ( ScePspFVector4Unaligned ) ));
1344    assert_eq! (unsafe {
1345                & ( * ( 0 as * const ScePspFVector4Unaligned ) ) . x as *
1346                const _ as usize } , 0usize , concat ! (
1347                "Alignment of field: " , stringify ! ( ScePspFVector4Unaligned
1348                ) , "::" , stringify ! ( x ) ));
1349    assert_eq! (unsafe {
1350                & ( * ( 0 as * const ScePspFVector4Unaligned ) ) . y as *
1351                const _ as usize } , 4usize , concat ! (
1352                "Alignment of field: " , stringify ! ( ScePspFVector4Unaligned
1353                ) , "::" , stringify ! ( y ) ));
1354    assert_eq! (unsafe {
1355                & ( * ( 0 as * const ScePspFVector4Unaligned ) ) . z as *
1356                const _ as usize } , 8usize , concat ! (
1357                "Alignment of field: " , stringify ! ( ScePspFVector4Unaligned
1358                ) , "::" , stringify ! ( z ) ));
1359    assert_eq! (unsafe {
1360                & ( * ( 0 as * const ScePspFVector4Unaligned ) ) . w as *
1361                const _ as usize } , 12usize , concat ! (
1362                "Alignment of field: " , stringify ! ( ScePspFVector4Unaligned
1363                ) , "::" , stringify ! ( w ) ));
1364}
1365impl Clone for ScePspFVector4Unaligned {
1366    fn clone(&self) -> Self { *self }
1367}
1368#[repr(C)]
1369#[derive(Copy)]
1370pub union ScePspVector4 {
1371    pub fv: ScePspFVector4,
1372    pub iv: ScePspIVector4,
1373    pub f: [f32; 4usize],
1374    pub i: [libc::c_int; 4usize],
1375    _bindgen_union_align: [u8; 16usize],
1376}
1377#[test]
1378fn bindgen_test_layout_ScePspVector4() {
1379    assert_eq!(::core::mem::size_of::<ScePspVector4>() , 16usize , concat ! (
1380               "Size of: " , stringify ! ( ScePspVector4 ) ));
1381    assert_eq! (unsafe {
1382                & ( * ( 0 as * const ScePspVector4 ) ) . fv as * const _ as
1383                usize } , 0usize , concat ! (
1384                "Alignment of field: " , stringify ! ( ScePspVector4 ) , "::"
1385                , stringify ! ( fv ) ));
1386    assert_eq! (unsafe {
1387                & ( * ( 0 as * const ScePspVector4 ) ) . iv as * const _ as
1388                usize } , 0usize , concat ! (
1389                "Alignment of field: " , stringify ! ( ScePspVector4 ) , "::"
1390                , stringify ! ( iv ) ));
1391    assert_eq! (unsafe {
1392                & ( * ( 0 as * const ScePspVector4 ) ) . f as * const _ as
1393                usize } , 0usize , concat ! (
1394                "Alignment of field: " , stringify ! ( ScePspVector4 ) , "::"
1395                , stringify ! ( f ) ));
1396    assert_eq! (unsafe {
1397                & ( * ( 0 as * const ScePspVector4 ) ) . i as * const _ as
1398                usize } , 0usize , concat ! (
1399                "Alignment of field: " , stringify ! ( ScePspVector4 ) , "::"
1400                , stringify ! ( i ) ));
1401}
1402impl Clone for ScePspVector4 {
1403    fn clone(&self) -> Self { *self }
1404}
1405#[repr(C)]
1406#[derive(Debug, Copy)]
1407pub struct ScePspIMatrix2 {
1408    pub x: ScePspIVector2,
1409    pub y: ScePspIVector2,
1410}
1411#[test]
1412fn bindgen_test_layout_ScePspIMatrix2() {
1413    assert_eq!(::core::mem::size_of::<ScePspIMatrix2>() , 16usize , concat ! (
1414               "Size of: " , stringify ! ( ScePspIMatrix2 ) ));
1415    assert_eq! (::core::mem::align_of::<ScePspIMatrix2>() , 4usize , concat !
1416                ( "Alignment of " , stringify ! ( ScePspIMatrix2 ) ));
1417    assert_eq! (unsafe {
1418                & ( * ( 0 as * const ScePspIMatrix2 ) ) . x as * const _ as
1419                usize } , 0usize , concat ! (
1420                "Alignment of field: " , stringify ! ( ScePspIMatrix2 ) , "::"
1421                , stringify ! ( x ) ));
1422    assert_eq! (unsafe {
1423                & ( * ( 0 as * const ScePspIMatrix2 ) ) . y as * const _ as
1424                usize } , 8usize , concat ! (
1425                "Alignment of field: " , stringify ! ( ScePspIMatrix2 ) , "::"
1426                , stringify ! ( y ) ));
1427}
1428impl Clone for ScePspIMatrix2 {
1429    fn clone(&self) -> Self { *self }
1430}
1431#[repr(C)]
1432#[derive(Debug, Copy)]
1433pub struct ScePspFMatrix2 {
1434    pub x: ScePspFVector2,
1435    pub y: ScePspFVector2,
1436}
1437#[test]
1438fn bindgen_test_layout_ScePspFMatrix2() {
1439    assert_eq!(::core::mem::size_of::<ScePspFMatrix2>() , 16usize , concat ! (
1440               "Size of: " , stringify ! ( ScePspFMatrix2 ) ));
1441    assert_eq! (::core::mem::align_of::<ScePspFMatrix2>() , 4usize , concat !
1442                ( "Alignment of " , stringify ! ( ScePspFMatrix2 ) ));
1443    assert_eq! (unsafe {
1444                & ( * ( 0 as * const ScePspFMatrix2 ) ) . x as * const _ as
1445                usize } , 0usize , concat ! (
1446                "Alignment of field: " , stringify ! ( ScePspFMatrix2 ) , "::"
1447                , stringify ! ( x ) ));
1448    assert_eq! (unsafe {
1449                & ( * ( 0 as * const ScePspFMatrix2 ) ) . y as * const _ as
1450                usize } , 8usize , concat ! (
1451                "Alignment of field: " , stringify ! ( ScePspFMatrix2 ) , "::"
1452                , stringify ! ( y ) ));
1453}
1454impl Clone for ScePspFMatrix2 {
1455    fn clone(&self) -> Self { *self }
1456}
1457#[repr(C)]
1458#[derive(Copy)]
1459pub union ScePspMatrix2 {
1460    pub fm: ScePspFMatrix2,
1461    pub im: ScePspIMatrix2,
1462    pub fv: [ScePspFVector2; 2usize],
1463    pub iv: [ScePspIVector2; 2usize],
1464    pub v: [ScePspVector2; 2usize],
1465    pub f: [[f32; 2usize]; 2usize],
1466    pub i: [[libc::c_int; 2usize]; 2usize],
1467    _bindgen_union_align: [u32; 4usize],
1468}
1469#[test]
1470fn bindgen_test_layout_ScePspMatrix2() {
1471    assert_eq!(::core::mem::size_of::<ScePspMatrix2>() , 16usize , concat ! (
1472               "Size of: " , stringify ! ( ScePspMatrix2 ) ));
1473    assert_eq! (::core::mem::align_of::<ScePspMatrix2>() , 4usize , concat ! (
1474                "Alignment of " , stringify ! ( ScePspMatrix2 ) ));
1475    assert_eq! (unsafe {
1476                & ( * ( 0 as * const ScePspMatrix2 ) ) . fm as * const _ as
1477                usize } , 0usize , concat ! (
1478                "Alignment of field: " , stringify ! ( ScePspMatrix2 ) , "::"
1479                , stringify ! ( fm ) ));
1480    assert_eq! (unsafe {
1481                & ( * ( 0 as * const ScePspMatrix2 ) ) . im as * const _ as
1482                usize } , 0usize , concat ! (
1483                "Alignment of field: " , stringify ! ( ScePspMatrix2 ) , "::"
1484                , stringify ! ( im ) ));
1485    assert_eq! (unsafe {
1486                & ( * ( 0 as * const ScePspMatrix2 ) ) . fv as * const _ as
1487                usize } , 0usize , concat ! (
1488                "Alignment of field: " , stringify ! ( ScePspMatrix2 ) , "::"
1489                , stringify ! ( fv ) ));
1490    assert_eq! (unsafe {
1491                & ( * ( 0 as * const ScePspMatrix2 ) ) . iv as * const _ as
1492                usize } , 0usize , concat ! (
1493                "Alignment of field: " , stringify ! ( ScePspMatrix2 ) , "::"
1494                , stringify ! ( iv ) ));
1495    assert_eq! (unsafe {
1496                & ( * ( 0 as * const ScePspMatrix2 ) ) . v as * const _ as
1497                usize } , 0usize , concat ! (
1498                "Alignment of field: " , stringify ! ( ScePspMatrix2 ) , "::"
1499                , stringify ! ( v ) ));
1500    assert_eq! (unsafe {
1501                & ( * ( 0 as * const ScePspMatrix2 ) ) . f as * const _ as
1502                usize } , 0usize , concat ! (
1503                "Alignment of field: " , stringify ! ( ScePspMatrix2 ) , "::"
1504                , stringify ! ( f ) ));
1505    assert_eq! (unsafe {
1506                & ( * ( 0 as * const ScePspMatrix2 ) ) . i as * const _ as
1507                usize } , 0usize , concat ! (
1508                "Alignment of field: " , stringify ! ( ScePspMatrix2 ) , "::"
1509                , stringify ! ( i ) ));
1510}
1511impl Clone for ScePspMatrix2 {
1512    fn clone(&self) -> Self { *self }
1513}
1514#[repr(C)]
1515#[derive(Debug, Copy)]
1516pub struct ScePspIMatrix3 {
1517    pub x: ScePspIVector3,
1518    pub y: ScePspIVector3,
1519    pub z: ScePspIVector3,
1520}
1521#[test]
1522fn bindgen_test_layout_ScePspIMatrix3() {
1523    assert_eq!(::core::mem::size_of::<ScePspIMatrix3>() , 36usize , concat ! (
1524               "Size of: " , stringify ! ( ScePspIMatrix3 ) ));
1525    assert_eq! (::core::mem::align_of::<ScePspIMatrix3>() , 4usize , concat !
1526                ( "Alignment of " , stringify ! ( ScePspIMatrix3 ) ));
1527    assert_eq! (unsafe {
1528                & ( * ( 0 as * const ScePspIMatrix3 ) ) . x as * const _ as
1529                usize } , 0usize , concat ! (
1530                "Alignment of field: " , stringify ! ( ScePspIMatrix3 ) , "::"
1531                , stringify ! ( x ) ));
1532    assert_eq! (unsafe {
1533                & ( * ( 0 as * const ScePspIMatrix3 ) ) . y as * const _ as
1534                usize } , 12usize , concat ! (
1535                "Alignment of field: " , stringify ! ( ScePspIMatrix3 ) , "::"
1536                , stringify ! ( y ) ));
1537    assert_eq! (unsafe {
1538                & ( * ( 0 as * const ScePspIMatrix3 ) ) . z as * const _ as
1539                usize } , 24usize , concat ! (
1540                "Alignment of field: " , stringify ! ( ScePspIMatrix3 ) , "::"
1541                , stringify ! ( z ) ));
1542}
1543impl Clone for ScePspIMatrix3 {
1544    fn clone(&self) -> Self { *self }
1545}
1546#[repr(C)]
1547#[derive(Debug, Copy)]
1548pub struct ScePspFMatrix3 {
1549    pub x: ScePspFVector3,
1550    pub y: ScePspFVector3,
1551    pub z: ScePspFVector3,
1552}
1553#[test]
1554fn bindgen_test_layout_ScePspFMatrix3() {
1555    assert_eq!(::core::mem::size_of::<ScePspFMatrix3>() , 36usize , concat ! (
1556               "Size of: " , stringify ! ( ScePspFMatrix3 ) ));
1557    assert_eq! (::core::mem::align_of::<ScePspFMatrix3>() , 4usize , concat !
1558                ( "Alignment of " , stringify ! ( ScePspFMatrix3 ) ));
1559    assert_eq! (unsafe {
1560                & ( * ( 0 as * const ScePspFMatrix3 ) ) . x as * const _ as
1561                usize } , 0usize , concat ! (
1562                "Alignment of field: " , stringify ! ( ScePspFMatrix3 ) , "::"
1563                , stringify ! ( x ) ));
1564    assert_eq! (unsafe {
1565                & ( * ( 0 as * const ScePspFMatrix3 ) ) . y as * const _ as
1566                usize } , 12usize , concat ! (
1567                "Alignment of field: " , stringify ! ( ScePspFMatrix3 ) , "::"
1568                , stringify ! ( y ) ));
1569    assert_eq! (unsafe {
1570                & ( * ( 0 as * const ScePspFMatrix3 ) ) . z as * const _ as
1571                usize } , 24usize , concat ! (
1572                "Alignment of field: " , stringify ! ( ScePspFMatrix3 ) , "::"
1573                , stringify ! ( z ) ));
1574}
1575impl Clone for ScePspFMatrix3 {
1576    fn clone(&self) -> Self { *self }
1577}
1578#[repr(C)]
1579#[derive(Copy)]
1580pub union ScePspMatrix3 {
1581    pub fm: ScePspFMatrix3,
1582    pub im: ScePspIMatrix3,
1583    pub fv: [ScePspFVector3; 3usize],
1584    pub iv: [ScePspIVector3; 3usize],
1585    pub v: [ScePspVector3; 3usize],
1586    pub f: [[f32; 3usize]; 3usize],
1587    pub i: [[libc::c_int; 3usize]; 3usize],
1588    _bindgen_union_align: [u32; 9usize],
1589}
1590#[test]
1591fn bindgen_test_layout_ScePspMatrix3() {
1592    assert_eq!(::core::mem::size_of::<ScePspMatrix3>() , 36usize , concat ! (
1593               "Size of: " , stringify ! ( ScePspMatrix3 ) ));
1594    assert_eq! (::core::mem::align_of::<ScePspMatrix3>() , 4usize , concat ! (
1595                "Alignment of " , stringify ! ( ScePspMatrix3 ) ));
1596    assert_eq! (unsafe {
1597                & ( * ( 0 as * const ScePspMatrix3 ) ) . fm as * const _ as
1598                usize } , 0usize , concat ! (
1599                "Alignment of field: " , stringify ! ( ScePspMatrix3 ) , "::"
1600                , stringify ! ( fm ) ));
1601    assert_eq! (unsafe {
1602                & ( * ( 0 as * const ScePspMatrix3 ) ) . im as * const _ as
1603                usize } , 0usize , concat ! (
1604                "Alignment of field: " , stringify ! ( ScePspMatrix3 ) , "::"
1605                , stringify ! ( im ) ));
1606    assert_eq! (unsafe {
1607                & ( * ( 0 as * const ScePspMatrix3 ) ) . fv as * const _ as
1608                usize } , 0usize , concat ! (
1609                "Alignment of field: " , stringify ! ( ScePspMatrix3 ) , "::"
1610                , stringify ! ( fv ) ));
1611    assert_eq! (unsafe {
1612                & ( * ( 0 as * const ScePspMatrix3 ) ) . iv as * const _ as
1613                usize } , 0usize , concat ! (
1614                "Alignment of field: " , stringify ! ( ScePspMatrix3 ) , "::"
1615                , stringify ! ( iv ) ));
1616    assert_eq! (unsafe {
1617                & ( * ( 0 as * const ScePspMatrix3 ) ) . v as * const _ as
1618                usize } , 0usize , concat ! (
1619                "Alignment of field: " , stringify ! ( ScePspMatrix3 ) , "::"
1620                , stringify ! ( v ) ));
1621    assert_eq! (unsafe {
1622                & ( * ( 0 as * const ScePspMatrix3 ) ) . f as * const _ as
1623                usize } , 0usize , concat ! (
1624                "Alignment of field: " , stringify ! ( ScePspMatrix3 ) , "::"
1625                , stringify ! ( f ) ));
1626    assert_eq! (unsafe {
1627                & ( * ( 0 as * const ScePspMatrix3 ) ) . i as * const _ as
1628                usize } , 0usize , concat ! (
1629                "Alignment of field: " , stringify ! ( ScePspMatrix3 ) , "::"
1630                , stringify ! ( i ) ));
1631}
1632impl Clone for ScePspMatrix3 {
1633    fn clone(&self) -> Self { *self }
1634}
1635#[repr(C)]
1636#[derive(Debug, Copy)]
1637pub struct ScePspIMatrix4 {
1638    pub x: ScePspIVector4,
1639    pub y: ScePspIVector4,
1640    pub z: ScePspIVector4,
1641    pub w: ScePspIVector4,
1642}
1643#[test]
1644fn bindgen_test_layout_ScePspIMatrix4() {
1645    assert_eq!(::core::mem::size_of::<ScePspIMatrix4>() , 64usize , concat ! (
1646               "Size of: " , stringify ! ( ScePspIMatrix4 ) ));
1647    assert_eq! (::core::mem::align_of::<ScePspIMatrix4>() , 4usize , concat !
1648                ( "Alignment of " , stringify ! ( ScePspIMatrix4 ) ));
1649    assert_eq! (unsafe {
1650                & ( * ( 0 as * const ScePspIMatrix4 ) ) . x as * const _ as
1651                usize } , 0usize , concat ! (
1652                "Alignment of field: " , stringify ! ( ScePspIMatrix4 ) , "::"
1653                , stringify ! ( x ) ));
1654    assert_eq! (unsafe {
1655                & ( * ( 0 as * const ScePspIMatrix4 ) ) . y as * const _ as
1656                usize } , 16usize , concat ! (
1657                "Alignment of field: " , stringify ! ( ScePspIMatrix4 ) , "::"
1658                , stringify ! ( y ) ));
1659    assert_eq! (unsafe {
1660                & ( * ( 0 as * const ScePspIMatrix4 ) ) . z as * const _ as
1661                usize } , 32usize , concat ! (
1662                "Alignment of field: " , stringify ! ( ScePspIMatrix4 ) , "::"
1663                , stringify ! ( z ) ));
1664    assert_eq! (unsafe {
1665                & ( * ( 0 as * const ScePspIMatrix4 ) ) . w as * const _ as
1666                usize } , 48usize , concat ! (
1667                "Alignment of field: " , stringify ! ( ScePspIMatrix4 ) , "::"
1668                , stringify ! ( w ) ));
1669}
1670impl Clone for ScePspIMatrix4 {
1671    fn clone(&self) -> Self { *self }
1672}
1673#[repr(C)]
1674#[derive(Debug, Copy)]
1675pub struct ScePspIMatrix4Unaligned {
1676    pub x: ScePspIVector4,
1677    pub y: ScePspIVector4,
1678    pub z: ScePspIVector4,
1679    pub w: ScePspIVector4,
1680}
1681#[test]
1682fn bindgen_test_layout_ScePspIMatrix4Unaligned() {
1683    assert_eq!(::core::mem::size_of::<ScePspIMatrix4Unaligned>() , 64usize ,
1684               concat ! (
1685               "Size of: " , stringify ! ( ScePspIMatrix4Unaligned ) ));
1686    assert_eq! (::core::mem::align_of::<ScePspIMatrix4Unaligned>() , 4usize ,
1687                concat ! (
1688                "Alignment of " , stringify ! ( ScePspIMatrix4Unaligned ) ));
1689    assert_eq! (unsafe {
1690                & ( * ( 0 as * const ScePspIMatrix4Unaligned ) ) . x as *
1691                const _ as usize } , 0usize , concat ! (
1692                "Alignment of field: " , stringify ! ( ScePspIMatrix4Unaligned
1693                ) , "::" , stringify ! ( x ) ));
1694    assert_eq! (unsafe {
1695                & ( * ( 0 as * const ScePspIMatrix4Unaligned ) ) . y as *
1696                const _ as usize } , 16usize , concat ! (
1697                "Alignment of field: " , stringify ! ( ScePspIMatrix4Unaligned
1698                ) , "::" , stringify ! ( y ) ));
1699    assert_eq! (unsafe {
1700                & ( * ( 0 as * const ScePspIMatrix4Unaligned ) ) . z as *
1701                const _ as usize } , 32usize , concat ! (
1702                "Alignment of field: " , stringify ! ( ScePspIMatrix4Unaligned
1703                ) , "::" , stringify ! ( z ) ));
1704    assert_eq! (unsafe {
1705                & ( * ( 0 as * const ScePspIMatrix4Unaligned ) ) . w as *
1706                const _ as usize } , 48usize , concat ! (
1707                "Alignment of field: " , stringify ! ( ScePspIMatrix4Unaligned
1708                ) , "::" , stringify ! ( w ) ));
1709}
1710impl Clone for ScePspIMatrix4Unaligned {
1711    fn clone(&self) -> Self { *self }
1712}
1713#[repr(C)]
1714#[derive(Debug, Copy)]
1715pub struct ScePspFMatrix4 {
1716    pub x: ScePspFVector4,
1717    pub y: ScePspFVector4,
1718    pub z: ScePspFVector4,
1719    pub w: ScePspFVector4,
1720}
1721#[test]
1722fn bindgen_test_layout_ScePspFMatrix4() {
1723    assert_eq!(::core::mem::size_of::<ScePspFMatrix4>() , 64usize , concat ! (
1724               "Size of: " , stringify ! ( ScePspFMatrix4 ) ));
1725    assert_eq! (unsafe {
1726                & ( * ( 0 as * const ScePspFMatrix4 ) ) . x as * const _ as
1727                usize } , 0usize , concat ! (
1728                "Alignment of field: " , stringify ! ( ScePspFMatrix4 ) , "::"
1729                , stringify ! ( x ) ));
1730    assert_eq! (unsafe {
1731                & ( * ( 0 as * const ScePspFMatrix4 ) ) . y as * const _ as
1732                usize } , 16usize , concat ! (
1733                "Alignment of field: " , stringify ! ( ScePspFMatrix4 ) , "::"
1734                , stringify ! ( y ) ));
1735    assert_eq! (unsafe {
1736                & ( * ( 0 as * const ScePspFMatrix4 ) ) . z as * const _ as
1737                usize } , 32usize , concat ! (
1738                "Alignment of field: " , stringify ! ( ScePspFMatrix4 ) , "::"
1739                , stringify ! ( z ) ));
1740    assert_eq! (unsafe {
1741                & ( * ( 0 as * const ScePspFMatrix4 ) ) . w as * const _ as
1742                usize } , 48usize , concat ! (
1743                "Alignment of field: " , stringify ! ( ScePspFMatrix4 ) , "::"
1744                , stringify ! ( w ) ));
1745}
1746impl Clone for ScePspFMatrix4 {
1747    fn clone(&self) -> Self { *self }
1748}
1749#[repr(C)]
1750#[derive(Debug, Copy)]
1751pub struct ScePspFMatrix4Unaligned {
1752    pub x: ScePspFVector4,
1753    pub y: ScePspFVector4,
1754    pub z: ScePspFVector4,
1755    pub w: ScePspFVector4,
1756}
1757#[test]
1758fn bindgen_test_layout_ScePspFMatrix4Unaligned() {
1759    assert_eq!(::core::mem::size_of::<ScePspFMatrix4Unaligned>() , 64usize ,
1760               concat ! (
1761               "Size of: " , stringify ! ( ScePspFMatrix4Unaligned ) ));
1762    assert_eq! (unsafe {
1763                & ( * ( 0 as * const ScePspFMatrix4Unaligned ) ) . x as *
1764                const _ as usize } , 0usize , concat ! (
1765                "Alignment of field: " , stringify ! ( ScePspFMatrix4Unaligned
1766                ) , "::" , stringify ! ( x ) ));
1767    assert_eq! (unsafe {
1768                & ( * ( 0 as * const ScePspFMatrix4Unaligned ) ) . y as *
1769                const _ as usize } , 16usize , concat ! (
1770                "Alignment of field: " , stringify ! ( ScePspFMatrix4Unaligned
1771                ) , "::" , stringify ! ( y ) ));
1772    assert_eq! (unsafe {
1773                & ( * ( 0 as * const ScePspFMatrix4Unaligned ) ) . z as *
1774                const _ as usize } , 32usize , concat ! (
1775                "Alignment of field: " , stringify ! ( ScePspFMatrix4Unaligned
1776                ) , "::" , stringify ! ( z ) ));
1777    assert_eq! (unsafe {
1778                & ( * ( 0 as * const ScePspFMatrix4Unaligned ) ) . w as *
1779                const _ as usize } , 48usize , concat ! (
1780                "Alignment of field: " , stringify ! ( ScePspFMatrix4Unaligned
1781                ) , "::" , stringify ! ( w ) ));
1782}
1783impl Clone for ScePspFMatrix4Unaligned {
1784    fn clone(&self) -> Self { *self }
1785}
1786#[repr(C)]
1787#[derive(Copy)]
1788pub union ScePspMatrix4 {
1789    pub fm: ScePspFMatrix4,
1790    pub im: ScePspIMatrix4,
1791    pub fv: [ScePspFVector4; 4usize],
1792    pub iv: [ScePspIVector4; 4usize],
1793    pub v: [ScePspVector4; 4usize],
1794    pub f: [[f32; 4usize]; 4usize],
1795    pub i: [[libc::c_int; 4usize]; 4usize],
1796    _bindgen_union_align: [u8; 64usize],
1797}
1798#[test]
1799fn bindgen_test_layout_ScePspMatrix4() {
1800    assert_eq!(::core::mem::size_of::<ScePspMatrix4>() , 64usize , concat ! (
1801               "Size of: " , stringify ! ( ScePspMatrix4 ) ));
1802    assert_eq! (unsafe {
1803                & ( * ( 0 as * const ScePspMatrix4 ) ) . fm as * const _ as
1804                usize } , 0usize , concat ! (
1805                "Alignment of field: " , stringify ! ( ScePspMatrix4 ) , "::"
1806                , stringify ! ( fm ) ));
1807    assert_eq! (unsafe {
1808                & ( * ( 0 as * const ScePspMatrix4 ) ) . im as * const _ as
1809                usize } , 0usize , concat ! (
1810                "Alignment of field: " , stringify ! ( ScePspMatrix4 ) , "::"
1811                , stringify ! ( im ) ));
1812    assert_eq! (unsafe {
1813                & ( * ( 0 as * const ScePspMatrix4 ) ) . fv as * const _ as
1814                usize } , 0usize , concat ! (
1815                "Alignment of field: " , stringify ! ( ScePspMatrix4 ) , "::"
1816                , stringify ! ( fv ) ));
1817    assert_eq! (unsafe {
1818                & ( * ( 0 as * const ScePspMatrix4 ) ) . iv as * const _ as
1819                usize } , 0usize , concat ! (
1820                "Alignment of field: " , stringify ! ( ScePspMatrix4 ) , "::"
1821                , stringify ! ( iv ) ));
1822    assert_eq! (unsafe {
1823                & ( * ( 0 as * const ScePspMatrix4 ) ) . v as * const _ as
1824                usize } , 0usize , concat ! (
1825                "Alignment of field: " , stringify ! ( ScePspMatrix4 ) , "::"
1826                , stringify ! ( v ) ));
1827    assert_eq! (unsafe {
1828                & ( * ( 0 as * const ScePspMatrix4 ) ) . f as * const _ as
1829                usize } , 0usize , concat ! (
1830                "Alignment of field: " , stringify ! ( ScePspMatrix4 ) , "::"
1831                , stringify ! ( f ) ));
1832    assert_eq! (unsafe {
1833                & ( * ( 0 as * const ScePspMatrix4 ) ) . i as * const _ as
1834                usize } , 0usize , concat ! (
1835                "Alignment of field: " , stringify ! ( ScePspMatrix4 ) , "::"
1836                , stringify ! ( i ) ));
1837}
1838impl Clone for ScePspMatrix4 {
1839    fn clone(&self) -> Self { *self }
1840}
1841#[repr(C)]
1842#[derive(Debug, Copy)]
1843pub struct ScePspFQuaternion {
1844    pub x: f32,
1845    pub y: f32,
1846    pub z: f32,
1847    pub w: f32,
1848}
1849#[test]
1850fn bindgen_test_layout_ScePspFQuaternion() {
1851    assert_eq!(::core::mem::size_of::<ScePspFQuaternion>() , 16usize , concat
1852               ! ( "Size of: " , stringify ! ( ScePspFQuaternion ) ));
1853    assert_eq! (::core::mem::align_of::<ScePspFQuaternion>() , 4usize , concat
1854                ! ( "Alignment of " , stringify ! ( ScePspFQuaternion ) ));
1855    assert_eq! (unsafe {
1856                & ( * ( 0 as * const ScePspFQuaternion ) ) . x as * const _ as
1857                usize } , 0usize , concat ! (
1858                "Alignment of field: " , stringify ! ( ScePspFQuaternion ) ,
1859                "::" , stringify ! ( x ) ));
1860    assert_eq! (unsafe {
1861                & ( * ( 0 as * const ScePspFQuaternion ) ) . y as * const _ as
1862                usize } , 4usize , concat ! (
1863                "Alignment of field: " , stringify ! ( ScePspFQuaternion ) ,
1864                "::" , stringify ! ( y ) ));
1865    assert_eq! (unsafe {
1866                & ( * ( 0 as * const ScePspFQuaternion ) ) . z as * const _ as
1867                usize } , 8usize , concat ! (
1868                "Alignment of field: " , stringify ! ( ScePspFQuaternion ) ,
1869                "::" , stringify ! ( z ) ));
1870    assert_eq! (unsafe {
1871                & ( * ( 0 as * const ScePspFQuaternion ) ) . w as * const _ as
1872                usize } , 12usize , concat ! (
1873                "Alignment of field: " , stringify ! ( ScePspFQuaternion ) ,
1874                "::" , stringify ! ( w ) ));
1875}
1876impl Clone for ScePspFQuaternion {
1877    fn clone(&self) -> Self { *self }
1878}
1879#[repr(C)]
1880#[derive(Debug, Copy)]
1881pub struct ScePspFQuaternionUnaligned {
1882    pub x: f32,
1883    pub y: f32,
1884    pub z: f32,
1885    pub w: f32,
1886}
1887#[test]
1888fn bindgen_test_layout_ScePspFQuaternionUnaligned() {
1889    assert_eq!(::core::mem::size_of::<ScePspFQuaternionUnaligned>() , 16usize
1890               , concat ! (
1891               "Size of: " , stringify ! ( ScePspFQuaternionUnaligned ) ));
1892    assert_eq! (::core::mem::align_of::<ScePspFQuaternionUnaligned>() , 4usize
1893                , concat ! (
1894                "Alignment of " , stringify ! ( ScePspFQuaternionUnaligned )
1895                ));
1896    assert_eq! (unsafe {
1897                & ( * ( 0 as * const ScePspFQuaternionUnaligned ) ) . x as *
1898                const _ as usize } , 0usize , concat ! (
1899                "Alignment of field: " , stringify ! (
1900                ScePspFQuaternionUnaligned ) , "::" , stringify ! ( x ) ));
1901    assert_eq! (unsafe {
1902                & ( * ( 0 as * const ScePspFQuaternionUnaligned ) ) . y as *
1903                const _ as usize } , 4usize , concat ! (
1904                "Alignment of field: " , stringify ! (
1905                ScePspFQuaternionUnaligned ) , "::" , stringify ! ( y ) ));
1906    assert_eq! (unsafe {
1907                & ( * ( 0 as * const ScePspFQuaternionUnaligned ) ) . z as *
1908                const _ as usize } , 8usize , concat ! (
1909                "Alignment of field: " , stringify ! (
1910                ScePspFQuaternionUnaligned ) , "::" , stringify ! ( z ) ));
1911    assert_eq! (unsafe {
1912                & ( * ( 0 as * const ScePspFQuaternionUnaligned ) ) . w as *
1913                const _ as usize } , 12usize , concat ! (
1914                "Alignment of field: " , stringify ! (
1915                ScePspFQuaternionUnaligned ) , "::" , stringify ! ( w ) ));
1916}
1917impl Clone for ScePspFQuaternionUnaligned {
1918    fn clone(&self) -> Self { *self }
1919}
1920#[repr(C)]
1921#[derive(Debug, Copy)]
1922pub struct ScePspFColor {
1923    pub r: f32,
1924    pub g: f32,
1925    pub b: f32,
1926    pub a: f32,
1927}
1928#[test]
1929fn bindgen_test_layout_ScePspFColor() {
1930    assert_eq!(::core::mem::size_of::<ScePspFColor>() , 16usize , concat ! (
1931               "Size of: " , stringify ! ( ScePspFColor ) ));
1932    assert_eq! (::core::mem::align_of::<ScePspFColor>() , 4usize , concat ! (
1933                "Alignment of " , stringify ! ( ScePspFColor ) ));
1934    assert_eq! (unsafe {
1935                & ( * ( 0 as * const ScePspFColor ) ) . r as * const _ as
1936                usize } , 0usize , concat ! (
1937                "Alignment of field: " , stringify ! ( ScePspFColor ) , "::" ,
1938                stringify ! ( r ) ));
1939    assert_eq! (unsafe {
1940                & ( * ( 0 as * const ScePspFColor ) ) . g as * const _ as
1941                usize } , 4usize , concat ! (
1942                "Alignment of field: " , stringify ! ( ScePspFColor ) , "::" ,
1943                stringify ! ( g ) ));
1944    assert_eq! (unsafe {
1945                & ( * ( 0 as * const ScePspFColor ) ) . b as * const _ as
1946                usize } , 8usize , concat ! (
1947                "Alignment of field: " , stringify ! ( ScePspFColor ) , "::" ,
1948                stringify ! ( b ) ));
1949    assert_eq! (unsafe {
1950                & ( * ( 0 as * const ScePspFColor ) ) . a as * const _ as
1951                usize } , 12usize , concat ! (
1952                "Alignment of field: " , stringify ! ( ScePspFColor ) , "::" ,
1953                stringify ! ( a ) ));
1954}
1955impl Clone for ScePspFColor {
1956    fn clone(&self) -> Self { *self }
1957}
1958#[repr(C)]
1959#[derive(Debug, Copy)]
1960pub struct ScePspFColorUnaligned {
1961    pub r: f32,
1962    pub g: f32,
1963    pub b: f32,
1964    pub a: f32,
1965}
1966#[test]
1967fn bindgen_test_layout_ScePspFColorUnaligned() {
1968    assert_eq!(::core::mem::size_of::<ScePspFColorUnaligned>() , 16usize ,
1969               concat ! ( "Size of: " , stringify ! ( ScePspFColorUnaligned )
1970               ));
1971    assert_eq! (::core::mem::align_of::<ScePspFColorUnaligned>() , 4usize ,
1972                concat ! (
1973                "Alignment of " , stringify ! ( ScePspFColorUnaligned ) ));
1974    assert_eq! (unsafe {
1975                & ( * ( 0 as * const ScePspFColorUnaligned ) ) . r as * const
1976                _ as usize } , 0usize , concat ! (
1977                "Alignment of field: " , stringify ! ( ScePspFColorUnaligned )
1978                , "::" , stringify ! ( r ) ));
1979    assert_eq! (unsafe {
1980                & ( * ( 0 as * const ScePspFColorUnaligned ) ) . g as * const
1981                _ as usize } , 4usize , concat ! (
1982                "Alignment of field: " , stringify ! ( ScePspFColorUnaligned )
1983                , "::" , stringify ! ( g ) ));
1984    assert_eq! (unsafe {
1985                & ( * ( 0 as * const ScePspFColorUnaligned ) ) . b as * const
1986                _ as usize } , 8usize , concat ! (
1987                "Alignment of field: " , stringify ! ( ScePspFColorUnaligned )
1988                , "::" , stringify ! ( b ) ));
1989    assert_eq! (unsafe {
1990                & ( * ( 0 as * const ScePspFColorUnaligned ) ) . a as * const
1991                _ as usize } , 12usize , concat ! (
1992                "Alignment of field: " , stringify ! ( ScePspFColorUnaligned )
1993                , "::" , stringify ! ( a ) ));
1994}
1995impl Clone for ScePspFColorUnaligned {
1996    fn clone(&self) -> Self { *self }
1997}
1998pub type ScePspRGBA8888 = libc::c_uint;
1999pub type ScePspRGBA4444 = libc::c_ushort;
2000pub type ScePspRGBA5551 = libc::c_ushort;
2001pub type ScePspRGB565 = libc::c_ushort;
2002#[repr(C)]
2003#[derive(Copy)]
2004pub union ScePspUnion32 {
2005    pub ui: libc::c_uint,
2006    pub i: libc::c_int,
2007    pub us: [libc::c_ushort; 2usize],
2008    pub s: [libc::c_short; 2usize],
2009    pub uc: [libc::c_uchar; 4usize],
2010    pub c: [libc::c_char; 4usize],
2011    pub f: f32,
2012    pub rgba8888: ScePspRGBA8888,
2013    pub rgba4444: [ScePspRGBA4444; 2usize],
2014    pub rgba5551: [ScePspRGBA5551; 2usize],
2015    pub rgb565: [ScePspRGB565; 2usize],
2016    _bindgen_union_align: u32,
2017}
2018#[test]
2019fn bindgen_test_layout_ScePspUnion32() {
2020    assert_eq!(::core::mem::size_of::<ScePspUnion32>() , 4usize , concat ! (
2021               "Size of: " , stringify ! ( ScePspUnion32 ) ));
2022    assert_eq! (::core::mem::align_of::<ScePspUnion32>() , 4usize , concat ! (
2023                "Alignment of " , stringify ! ( ScePspUnion32 ) ));
2024    assert_eq! (unsafe {
2025                & ( * ( 0 as * const ScePspUnion32 ) ) . ui as * const _ as
2026                usize } , 0usize , concat ! (
2027                "Alignment of field: " , stringify ! ( ScePspUnion32 ) , "::"
2028                , stringify ! ( ui ) ));
2029    assert_eq! (unsafe {
2030                & ( * ( 0 as * const ScePspUnion32 ) ) . i as * const _ as
2031                usize } , 0usize , concat ! (
2032                "Alignment of field: " , stringify ! ( ScePspUnion32 ) , "::"
2033                , stringify ! ( i ) ));
2034    assert_eq! (unsafe {
2035                & ( * ( 0 as * const ScePspUnion32 ) ) . us as * const _ as
2036                usize } , 0usize , concat ! (
2037                "Alignment of field: " , stringify ! ( ScePspUnion32 ) , "::"
2038                , stringify ! ( us ) ));
2039    assert_eq! (unsafe {
2040                & ( * ( 0 as * const ScePspUnion32 ) ) . s as * const _ as
2041                usize } , 0usize , concat ! (
2042                "Alignment of field: " , stringify ! ( ScePspUnion32 ) , "::"
2043                , stringify ! ( s ) ));
2044    assert_eq! (unsafe {
2045                & ( * ( 0 as * const ScePspUnion32 ) ) . uc as * const _ as
2046                usize } , 0usize , concat ! (
2047                "Alignment of field: " , stringify ! ( ScePspUnion32 ) , "::"
2048                , stringify ! ( uc ) ));
2049    assert_eq! (unsafe {
2050                & ( * ( 0 as * const ScePspUnion32 ) ) . c as * const _ as
2051                usize } , 0usize , concat ! (
2052                "Alignment of field: " , stringify ! ( ScePspUnion32 ) , "::"
2053                , stringify ! ( c ) ));
2054    assert_eq! (unsafe {
2055                & ( * ( 0 as * const ScePspUnion32 ) ) . f as * const _ as
2056                usize } , 0usize , concat ! (
2057                "Alignment of field: " , stringify ! ( ScePspUnion32 ) , "::"
2058                , stringify ! ( f ) ));
2059    assert_eq! (unsafe {
2060                & ( * ( 0 as * const ScePspUnion32 ) ) . rgba8888 as * const _
2061                as usize } , 0usize , concat ! (
2062                "Alignment of field: " , stringify ! ( ScePspUnion32 ) , "::"
2063                , stringify ! ( rgba8888 ) ));
2064    assert_eq! (unsafe {
2065                & ( * ( 0 as * const ScePspUnion32 ) ) . rgba4444 as * const _
2066                as usize } , 0usize , concat ! (
2067                "Alignment of field: " , stringify ! ( ScePspUnion32 ) , "::"
2068                , stringify ! ( rgba4444 ) ));
2069    assert_eq! (unsafe {
2070                & ( * ( 0 as * const ScePspUnion32 ) ) . rgba5551 as * const _
2071                as usize } , 0usize , concat ! (
2072                "Alignment of field: " , stringify ! ( ScePspUnion32 ) , "::"
2073                , stringify ! ( rgba5551 ) ));
2074    assert_eq! (unsafe {
2075                & ( * ( 0 as * const ScePspUnion32 ) ) . rgb565 as * const _
2076                as usize } , 0usize , concat ! (
2077                "Alignment of field: " , stringify ! ( ScePspUnion32 ) , "::"
2078                , stringify ! ( rgb565 ) ));
2079}
2080impl Clone for ScePspUnion32 {
2081    fn clone(&self) -> Self { *self }
2082}
2083#[repr(C)]
2084#[derive(Copy)]
2085pub union ScePspUnion64 {
2086    pub ul: SceULong64,
2087    pub l: SceLong64,
2088    pub ui: [libc::c_uint; 2usize],
2089    pub i: [libc::c_int; 2usize],
2090    pub us: [libc::c_ushort; 4usize],
2091    pub s: [libc::c_short; 4usize],
2092    pub uc: [libc::c_uchar; 8usize],
2093    pub c: [libc::c_char; 8usize],
2094    pub f: [f32; 2usize],
2095    pub sr: ScePspSRect,
2096    pub sv: ScePspSVector4,
2097    pub rgba8888: [ScePspRGBA8888; 2usize],
2098    pub rgba4444: [ScePspRGBA4444; 4usize],
2099    pub rgba5551: [ScePspRGBA5551; 4usize],
2100    pub rgb565: [ScePspRGB565; 4usize],
2101    _bindgen_union_align: u64,
2102}
2103#[test]
2104fn bindgen_test_layout_ScePspUnion64() {
2105    assert_eq!(::core::mem::size_of::<ScePspUnion64>() , 8usize , concat ! (
2106               "Size of: " , stringify ! ( ScePspUnion64 ) ));
2107    assert_eq! (::core::mem::align_of::<ScePspUnion64>() , 8usize , concat ! (
2108                "Alignment of " , stringify ! ( ScePspUnion64 ) ));
2109    assert_eq! (unsafe {
2110                & ( * ( 0 as * const ScePspUnion64 ) ) . ul as * const _ as
2111                usize } , 0usize , concat ! (
2112                "Alignment of field: " , stringify ! ( ScePspUnion64 ) , "::"
2113                , stringify ! ( ul ) ));
2114    assert_eq! (unsafe {
2115                & ( * ( 0 as * const ScePspUnion64 ) ) . l as * const _ as
2116                usize } , 0usize , concat ! (
2117                "Alignment of field: " , stringify ! ( ScePspUnion64 ) , "::"
2118                , stringify ! ( l ) ));
2119    assert_eq! (unsafe {
2120                & ( * ( 0 as * const ScePspUnion64 ) ) . ui as * const _ as
2121                usize } , 0usize , concat ! (
2122                "Alignment of field: " , stringify ! ( ScePspUnion64 ) , "::"
2123                , stringify ! ( ui ) ));
2124    assert_eq! (unsafe {
2125                & ( * ( 0 as * const ScePspUnion64 ) ) . i as * const _ as
2126                usize } , 0usize , concat ! (
2127                "Alignment of field: " , stringify ! ( ScePspUnion64 ) , "::"
2128                , stringify ! ( i ) ));
2129    assert_eq! (unsafe {
2130                & ( * ( 0 as * const ScePspUnion64 ) ) . us as * const _ as
2131                usize } , 0usize , concat ! (
2132                "Alignment of field: " , stringify ! ( ScePspUnion64 ) , "::"
2133                , stringify ! ( us ) ));
2134    assert_eq! (unsafe {
2135                & ( * ( 0 as * const ScePspUnion64 ) ) . s as * const _ as
2136                usize } , 0usize , concat ! (
2137                "Alignment of field: " , stringify ! ( ScePspUnion64 ) , "::"
2138                , stringify ! ( s ) ));
2139    assert_eq! (unsafe {
2140                & ( * ( 0 as * const ScePspUnion64 ) ) . uc as * const _ as
2141                usize } , 0usize , concat ! (
2142                "Alignment of field: " , stringify ! ( ScePspUnion64 ) , "::"
2143                , stringify ! ( uc ) ));
2144    assert_eq! (unsafe {
2145                & ( * ( 0 as * const ScePspUnion64 ) ) . c as * const _ as
2146                usize } , 0usize , concat ! (
2147                "Alignment of field: " , stringify ! ( ScePspUnion64 ) , "::"
2148                , stringify ! ( c ) ));
2149    assert_eq! (unsafe {
2150                & ( * ( 0 as * const ScePspUnion64 ) ) . f as * const _ as
2151                usize } , 0usize , concat ! (
2152                "Alignment of field: " , stringify ! ( ScePspUnion64 ) , "::"
2153                , stringify ! ( f ) ));
2154    assert_eq! (unsafe {
2155                & ( * ( 0 as * const ScePspUnion64 ) ) . sr as * const _ as
2156                usize } , 0usize , concat ! (
2157                "Alignment of field: " , stringify ! ( ScePspUnion64 ) , "::"
2158                , stringify ! ( sr ) ));
2159    assert_eq! (unsafe {
2160                & ( * ( 0 as * const ScePspUnion64 ) ) . sv as * const _ as
2161                usize } , 0usize , concat ! (
2162                "Alignment of field: " , stringify ! ( ScePspUnion64 ) , "::"
2163                , stringify ! ( sv ) ));
2164    assert_eq! (unsafe {
2165                & ( * ( 0 as * const ScePspUnion64 ) ) . rgba8888 as * const _
2166                as usize } , 0usize , concat ! (
2167                "Alignment of field: " , stringify ! ( ScePspUnion64 ) , "::"
2168                , stringify ! ( rgba8888 ) ));
2169    assert_eq! (unsafe {
2170                & ( * ( 0 as * const ScePspUnion64 ) ) . rgba4444 as * const _
2171                as usize } , 0usize , concat ! (
2172                "Alignment of field: " , stringify ! ( ScePspUnion64 ) , "::"
2173                , stringify ! ( rgba4444 ) ));
2174    assert_eq! (unsafe {
2175                & ( * ( 0 as * const ScePspUnion64 ) ) . rgba5551 as * const _
2176                as usize } , 0usize , concat ! (
2177                "Alignment of field: " , stringify ! ( ScePspUnion64 ) , "::"
2178                , stringify ! ( rgba5551 ) ));
2179    assert_eq! (unsafe {
2180                & ( * ( 0 as * const ScePspUnion64 ) ) . rgb565 as * const _
2181                as usize } , 0usize , concat ! (
2182                "Alignment of field: " , stringify ! ( ScePspUnion64 ) , "::"
2183                , stringify ! ( rgb565 ) ));
2184}
2185impl Clone for ScePspUnion64 {
2186    fn clone(&self) -> Self { *self }
2187}
2188#[repr(C)]
2189#[derive(Copy)]
2190pub union ScePspUnion128 {
2191    pub ul: [SceULong64; 2usize],
2192    pub l: [SceLong64; 2usize],
2193    pub ui: [libc::c_uint; 4usize],
2194    pub i: [libc::c_int; 4usize],
2195    pub us: [libc::c_ushort; 8usize],
2196    pub s: [libc::c_short; 8usize],
2197    pub uc: [libc::c_uchar; 16usize],
2198    pub c: [libc::c_char; 16usize],
2199    pub f: [f32; 4usize],
2200    pub fr: ScePspFRect,
2201    pub ir: ScePspIRect,
2202    pub fv: ScePspFVector4,
2203    pub iv: ScePspIVector4,
2204    pub fq: ScePspFQuaternion,
2205    pub fc: ScePspFColor,
2206    pub rgba8888: [ScePspRGBA8888; 4usize],
2207    pub rgba4444: [ScePspRGBA4444; 8usize],
2208    pub rgba5551: [ScePspRGBA5551; 8usize],
2209    pub rgb565: [ScePspRGB565; 8usize],
2210    _bindgen_union_align: [u8; 16usize],
2211}
2212#[test]
2213fn bindgen_test_layout_ScePspUnion128() {
2214    assert_eq!(::core::mem::size_of::<ScePspUnion128>() , 16usize , concat ! (
2215               "Size of: " , stringify ! ( ScePspUnion128 ) ));
2216    assert_eq! (unsafe {
2217                & ( * ( 0 as * const ScePspUnion128 ) ) . ul as * const _ as
2218                usize } , 0usize , concat ! (
2219                "Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
2220                , stringify ! ( ul ) ));
2221    assert_eq! (unsafe {
2222                & ( * ( 0 as * const ScePspUnion128 ) ) . l as * const _ as
2223                usize } , 0usize , concat ! (
2224                "Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
2225                , stringify ! ( l ) ));
2226    assert_eq! (unsafe {
2227                & ( * ( 0 as * const ScePspUnion128 ) ) . ui as * const _ as
2228                usize } , 0usize , concat ! (
2229                "Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
2230                , stringify ! ( ui ) ));
2231    assert_eq! (unsafe {
2232                & ( * ( 0 as * const ScePspUnion128 ) ) . i as * const _ as
2233                usize } , 0usize , concat ! (
2234                "Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
2235                , stringify ! ( i ) ));
2236    assert_eq! (unsafe {
2237                & ( * ( 0 as * const ScePspUnion128 ) ) . us as * const _ as
2238                usize } , 0usize , concat ! (
2239                "Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
2240                , stringify ! ( us ) ));
2241    assert_eq! (unsafe {
2242                & ( * ( 0 as * const ScePspUnion128 ) ) . s as * const _ as
2243                usize } , 0usize , concat ! (
2244                "Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
2245                , stringify ! ( s ) ));
2246    assert_eq! (unsafe {
2247                & ( * ( 0 as * const ScePspUnion128 ) ) . uc as * const _ as
2248                usize } , 0usize , concat ! (
2249                "Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
2250                , stringify ! ( uc ) ));
2251    assert_eq! (unsafe {
2252                & ( * ( 0 as * const ScePspUnion128 ) ) . c as * const _ as
2253                usize } , 0usize , concat ! (
2254                "Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
2255                , stringify ! ( c ) ));
2256    assert_eq! (unsafe {
2257                & ( * ( 0 as * const ScePspUnion128 ) ) . f as * const _ as
2258                usize } , 0usize , concat ! (
2259                "Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
2260                , stringify ! ( f ) ));
2261    assert_eq! (unsafe {
2262                & ( * ( 0 as * const ScePspUnion128 ) ) . fr as * const _ as
2263                usize } , 0usize , concat ! (
2264                "Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
2265                , stringify ! ( fr ) ));
2266    assert_eq! (unsafe {
2267                & ( * ( 0 as * const ScePspUnion128 ) ) . ir as * const _ as
2268                usize } , 0usize , concat ! (
2269                "Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
2270                , stringify ! ( ir ) ));
2271    assert_eq! (unsafe {
2272                & ( * ( 0 as * const ScePspUnion128 ) ) . fv as * const _ as
2273                usize } , 0usize , concat ! (
2274                "Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
2275                , stringify ! ( fv ) ));
2276    assert_eq! (unsafe {
2277                & ( * ( 0 as * const ScePspUnion128 ) ) . iv as * const _ as
2278                usize } , 0usize , concat ! (
2279                "Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
2280                , stringify ! ( iv ) ));
2281    assert_eq! (unsafe {
2282                & ( * ( 0 as * const ScePspUnion128 ) ) . fq as * const _ as
2283                usize } , 0usize , concat ! (
2284                "Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
2285                , stringify ! ( fq ) ));
2286    assert_eq! (unsafe {
2287                & ( * ( 0 as * const ScePspUnion128 ) ) . fc as * const _ as
2288                usize } , 0usize , concat ! (
2289                "Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
2290                , stringify ! ( fc ) ));
2291    assert_eq! (unsafe {
2292                & ( * ( 0 as * const ScePspUnion128 ) ) . rgba8888 as * const
2293                _ as usize } , 0usize , concat ! (
2294                "Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
2295                , stringify ! ( rgba8888 ) ));
2296    assert_eq! (unsafe {
2297                & ( * ( 0 as * const ScePspUnion128 ) ) . rgba4444 as * const
2298                _ as usize } , 0usize , concat ! (
2299                "Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
2300                , stringify ! ( rgba4444 ) ));
2301    assert_eq! (unsafe {
2302                & ( * ( 0 as * const ScePspUnion128 ) ) . rgba5551 as * const
2303                _ as usize } , 0usize , concat ! (
2304                "Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
2305                , stringify ! ( rgba5551 ) ));
2306    assert_eq! (unsafe {
2307                & ( * ( 0 as * const ScePspUnion128 ) ) . rgb565 as * const _
2308                as usize } , 0usize , concat ! (
2309                "Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
2310                , stringify ! ( rgb565 ) ));
2311}
2312impl Clone for ScePspUnion128 {
2313    fn clone(&self) -> Self { *self }
2314}
2315#[repr(C)]
2316#[derive(Debug, Copy)]
2317pub struct ScePspDateTime {
2318    pub year: libc::c_ushort,
2319    pub month: libc::c_ushort,
2320    pub day: libc::c_ushort,
2321    pub hour: libc::c_ushort,
2322    pub minute: libc::c_ushort,
2323    pub second: libc::c_ushort,
2324    pub microsecond: libc::c_uint,
2325}
2326#[test]
2327fn bindgen_test_layout_ScePspDateTime() {
2328    assert_eq!(::core::mem::size_of::<ScePspDateTime>() , 16usize , concat ! (
2329               "Size of: " , stringify ! ( ScePspDateTime ) ));
2330    assert_eq! (::core::mem::align_of::<ScePspDateTime>() , 4usize , concat !
2331                ( "Alignment of " , stringify ! ( ScePspDateTime ) ));
2332    assert_eq! (unsafe {
2333                & ( * ( 0 as * const ScePspDateTime ) ) . year as * const _ as
2334                usize } , 0usize , concat ! (
2335                "Alignment of field: " , stringify ! ( ScePspDateTime ) , "::"
2336                , stringify ! ( year ) ));
2337    assert_eq! (unsafe {
2338                & ( * ( 0 as * const ScePspDateTime ) ) . month as * const _
2339                as usize } , 2usize , concat ! (
2340                "Alignment of field: " , stringify ! ( ScePspDateTime ) , "::"
2341                , stringify ! ( month ) ));
2342    assert_eq! (unsafe {
2343                & ( * ( 0 as * const ScePspDateTime ) ) . day as * const _ as
2344                usize } , 4usize , concat ! (
2345                "Alignment of field: " , stringify ! ( ScePspDateTime ) , "::"
2346                , stringify ! ( day ) ));
2347    assert_eq! (unsafe {
2348                & ( * ( 0 as * const ScePspDateTime ) ) . hour as * const _ as
2349                usize } , 6usize , concat ! (
2350                "Alignment of field: " , stringify ! ( ScePspDateTime ) , "::"
2351                , stringify ! ( hour ) ));
2352    assert_eq! (unsafe {
2353                & ( * ( 0 as * const ScePspDateTime ) ) . minute as * const _
2354                as usize } , 8usize , concat ! (
2355                "Alignment of field: " , stringify ! ( ScePspDateTime ) , "::"
2356                , stringify ! ( minute ) ));
2357    assert_eq! (unsafe {
2358                & ( * ( 0 as * const ScePspDateTime ) ) . second as * const _
2359                as usize } , 10usize , concat ! (
2360                "Alignment of field: " , stringify ! ( ScePspDateTime ) , "::"
2361                , stringify ! ( second ) ));
2362    assert_eq! (unsafe {
2363                & ( * ( 0 as * const ScePspDateTime ) ) . microsecond as *
2364                const _ as usize } , 12usize , concat ! (
2365                "Alignment of field: " , stringify ! ( ScePspDateTime ) , "::"
2366                , stringify ! ( microsecond ) ));
2367}
2368impl Clone for ScePspDateTime {
2369    fn clone(&self) -> Self { *self }
2370}
2371/// UIDs are used to describe many different kernel objects.
2372pub type SceUID = libc::c_int;
2373pub type SceSize = libc::c_uint;
2374pub type SceSSize = libc::c_int;
2375pub type SceUChar = libc::c_uchar;
2376pub type SceUInt = libc::c_uint;
2377pub type SceMode = libc::c_int;
2378pub type SceOff = SceInt64;
2379pub type SceIores = SceInt64;
2380#[repr(u32)]
2381/// Access modes for st_mode in SceIoStat (confirm?).
2382#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
2383pub enum IOAccessModes {
2384    FIO_S_IFMT = 61440,
2385    FIO_S_IFLNK = 16384,
2386    FIO_S_IFDIR = 4096,
2387    FIO_S_IFREG = 8192,
2388    FIO_S_ISUID = 2048,
2389    FIO_S_ISGID = 1024,
2390    FIO_S_ISVTX = 512,
2391    FIO_S_IRWXU = 448,
2392    FIO_S_IRUSR = 256,
2393    FIO_S_IWUSR = 128,
2394    FIO_S_IXUSR = 64,
2395    FIO_S_IRWXG = 56,
2396    FIO_S_IRGRP = 32,
2397    FIO_S_IWGRP = 16,
2398    FIO_S_IXGRP = 8,
2399    FIO_S_IRWXO = 7,
2400    FIO_S_IROTH = 4,
2401    FIO_S_IWOTH = 2,
2402    FIO_S_IXOTH = 1,
2403}
2404#[repr(u32)]
2405/// File modes, used for the st_attr parameter in SceIoStat (confirm?).
2406#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
2407pub enum IOFileModes {
2408    FIO_SO_IFMT = 56,
2409    FIO_SO_IFLNK = 8,
2410    FIO_SO_IFDIR = 16,
2411    FIO_SO_IFREG = 32,
2412    FIO_SO_IROTH = 4,
2413    FIO_SO_IWOTH = 2,
2414    FIO_SO_IXOTH = 1,
2415}
2416/// Structure to hold the status information about a file
2417#[repr(C)]
2418#[derive(Debug, Copy)]
2419pub struct SceIoStat {
2420    pub st_mode: SceMode,
2421    pub st_attr: libc::c_uint,
2422    /// Size of the file in bytes.
2423    pub st_size: SceOff,
2424    /// Creation time.
2425    pub st_ctime: ScePspDateTime,
2426    /// Access time.
2427    pub st_atime: ScePspDateTime,
2428    /// Modification time.
2429    pub st_mtime: ScePspDateTime,
2430    /// Device-specific data.
2431    pub st_private: [libc::c_uint; 6usize],
2432}
2433#[test]
2434fn bindgen_test_layout_SceIoStat() {
2435    assert_eq!(::core::mem::size_of::<SceIoStat>() , 88usize , concat ! (
2436               "Size of: " , stringify ! ( SceIoStat ) ));
2437    assert_eq! (::core::mem::align_of::<SceIoStat>() , 8usize , concat ! (
2438                "Alignment of " , stringify ! ( SceIoStat ) ));
2439    assert_eq! (unsafe {
2440                & ( * ( 0 as * const SceIoStat ) ) . st_mode as * const _ as
2441                usize } , 0usize , concat ! (
2442                "Alignment of field: " , stringify ! ( SceIoStat ) , "::" ,
2443                stringify ! ( st_mode ) ));
2444    assert_eq! (unsafe {
2445                & ( * ( 0 as * const SceIoStat ) ) . st_attr as * const _ as
2446                usize } , 4usize , concat ! (
2447                "Alignment of field: " , stringify ! ( SceIoStat ) , "::" ,
2448                stringify ! ( st_attr ) ));
2449    assert_eq! (unsafe {
2450                & ( * ( 0 as * const SceIoStat ) ) . st_size as * const _ as
2451                usize } , 8usize , concat ! (
2452                "Alignment of field: " , stringify ! ( SceIoStat ) , "::" ,
2453                stringify ! ( st_size ) ));
2454    assert_eq! (unsafe {
2455                & ( * ( 0 as * const SceIoStat ) ) . st_ctime as * const _ as
2456                usize } , 16usize , concat ! (
2457                "Alignment of field: " , stringify ! ( SceIoStat ) , "::" ,
2458                stringify ! ( st_ctime ) ));
2459    assert_eq! (unsafe {
2460                & ( * ( 0 as * const SceIoStat ) ) . st_atime as * const _ as
2461                usize } , 32usize , concat ! (
2462                "Alignment of field: " , stringify ! ( SceIoStat ) , "::" ,
2463                stringify ! ( st_atime ) ));
2464    assert_eq! (unsafe {
2465                & ( * ( 0 as * const SceIoStat ) ) . st_mtime as * const _ as
2466                usize } , 48usize , concat ! (
2467                "Alignment of field: " , stringify ! ( SceIoStat ) , "::" ,
2468                stringify ! ( st_mtime ) ));
2469    assert_eq! (unsafe {
2470                & ( * ( 0 as * const SceIoStat ) ) . st_private as * const _
2471                as usize } , 64usize , concat ! (
2472                "Alignment of field: " , stringify ! ( SceIoStat ) , "::" ,
2473                stringify ! ( st_private ) ));
2474}
2475impl Clone for SceIoStat {
2476    fn clone(&self) -> Self { *self }
2477}
2478/// Describes a single directory entry
2479#[repr(C)]
2480#[derive(Copy)]
2481pub struct SceIoDirent {
2482    /// File status.
2483    pub d_stat: SceIoStat,
2484    /// File name.
2485    pub d_name: [libc::c_char; 256usize],
2486    /// Device-specific data.
2487    pub d_private: *mut libc::c_void,
2488    pub dummy: libc::c_int,
2489}
2490#[test]
2491fn bindgen_test_layout_SceIoDirent() {
2492    assert_eq!(::core::mem::size_of::<SceIoDirent>() , 360usize , concat ! (
2493               "Size of: " , stringify ! ( SceIoDirent ) ));
2494    assert_eq! (::core::mem::align_of::<SceIoDirent>() , 8usize , concat ! (
2495                "Alignment of " , stringify ! ( SceIoDirent ) ));
2496    assert_eq! (unsafe {
2497                & ( * ( 0 as * const SceIoDirent ) ) . d_stat as * const _ as
2498                usize } , 0usize , concat ! (
2499                "Alignment of field: " , stringify ! ( SceIoDirent ) , "::" ,
2500                stringify ! ( d_stat ) ));
2501    assert_eq! (unsafe {
2502                & ( * ( 0 as * const SceIoDirent ) ) . d_name as * const _ as
2503                usize } , 88usize , concat ! (
2504                "Alignment of field: " , stringify ! ( SceIoDirent ) , "::" ,
2505                stringify ! ( d_name ) ));
2506    assert_eq! (unsafe {
2507                & ( * ( 0 as * const SceIoDirent ) ) . d_private as * const _
2508                as usize } , 344usize , concat ! (
2509                "Alignment of field: " , stringify ! ( SceIoDirent ) , "::" ,
2510                stringify ! ( d_private ) ));
2511    assert_eq! (unsafe {
2512                & ( * ( 0 as * const SceIoDirent ) ) . dummy as * const _ as
2513                usize } , 352usize , concat ! (
2514                "Alignment of field: " , stringify ! ( SceIoDirent ) , "::" ,
2515                stringify ! ( dummy ) ));
2516}
2517impl Clone for SceIoDirent {
2518    fn clone(&self) -> Self { *self }
2519}
2520#[repr(u32)]
2521/// Permission value for the sceIoAssign function
2522#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
2523pub enum IoAssignPerms { IOASSIGN_RDWR = 0, IOASSIGN_RDONLY = 1, }
2524extern "C" {
2525    /// Open or create a file for reading or writing
2526///
2527/// @par Example1: Open a file for reading
2528/// @code
2529/// if(!(fd = sceIoOpen("device:/path/to/file", O_RDONLY, 0777)) {
2530/// // error
2531/// }
2532/// @endcode
2533/// @par Example2: Open a file for writing, creating it if it doesnt exist
2534/// @code
2535/// if(!(fd = sceIoOpen("device:/path/to/file", O_WRONLY|O_CREAT, 0777)) {
2536/// // error
2537/// }
2538/// @endcode
2539///
2540/// @param file - Pointer to a string holding the name of the file to open
2541/// @param flags - Libc styled flags that are or'ed together
2542/// @param mode - File access mode.
2543/// @return A non-negative integer is a valid fd, anything else an error
2544    pub fn sceIoOpen(file: *const libc::c_char, flags: libc::c_int,
2545                     mode: SceMode) -> SceUID;
2546}
2547extern "C" {
2548    /// Open or create a file for reading or writing (asynchronous)
2549///
2550/// @param file - Pointer to a string holding the name of the file to open
2551/// @param flags - Libc styled flags that are or'ed together
2552/// @param mode - File access mode.
2553/// @return A non-negative integer is a valid fd, anything else an error
2554    pub fn sceIoOpenAsync(file: *const libc::c_char, flags: libc::c_int,
2555                          mode: SceMode) -> SceUID;
2556}
2557extern "C" {
2558    /// Delete a descriptor
2559///
2560/// @code
2561/// sceIoClose(fd);
2562/// @endcode
2563///
2564/// @param fd - File descriptor to close
2565/// @return < 0 on error
2566    pub fn sceIoClose(fd: SceUID) -> libc::c_int;
2567}
2568extern "C" {
2569    /// Delete a descriptor (asynchronous)
2570///
2571/// @param fd - File descriptor to close
2572/// @return < 0 on error
2573    pub fn sceIoCloseAsync(fd: SceUID) -> libc::c_int;
2574}
2575extern "C" {
2576    /// Read input
2577///
2578/// @par Example:
2579/// @code
2580/// bytes_read = sceIoRead(fd, data, 100);
2581/// @endcode
2582///
2583/// @param fd - Opened file descriptor to read from
2584/// @param data - Pointer to the buffer where the read data will be placed
2585/// @param size - Size of the read in bytes
2586///
2587/// @return The number of bytes read
2588    pub fn sceIoRead(fd: SceUID, data: *mut libc::c_void, size: SceSize)
2589     -> libc::c_int;
2590}
2591extern "C" {
2592    /// Read input (asynchronous)
2593///
2594/// @par Example:
2595/// @code
2596/// bytes_read = sceIoRead(fd, data, 100);
2597/// @endcode
2598///
2599/// @param fd - Opened file descriptor to read from
2600/// @param data - Pointer to the buffer where the read data will be placed
2601/// @param size - Size of the read in bytes
2602///
2603/// @return < 0 on error.
2604    pub fn sceIoReadAsync(fd: SceUID, data: *mut libc::c_void, size: SceSize)
2605     -> libc::c_int;
2606}
2607extern "C" {
2608    /// Write output
2609///
2610/// @par Example:
2611/// @code
2612/// bytes_written = sceIoWrite(fd, data, 100);
2613/// @endcode
2614///
2615/// @param fd - Opened file descriptor to write to
2616/// @param data - Pointer to the data to write
2617/// @param size - Size of data to write
2618///
2619/// @return The number of bytes written
2620    pub fn sceIoWrite(fd: SceUID, data: *const libc::c_void, size: SceSize)
2621     -> libc::c_int;
2622}
2623extern "C" {
2624    /// Write output (asynchronous)
2625///
2626/// @param fd - Opened file descriptor to write to
2627/// @param data - Pointer to the data to write
2628/// @param size - Size of data to write
2629///
2630/// @return < 0 on error.
2631    pub fn sceIoWriteAsync(fd: SceUID, data: *const libc::c_void,
2632                           size: SceSize) -> libc::c_int;
2633}
2634extern "C" {
2635    /// Reposition read/write file descriptor offset
2636///
2637/// @par Example:
2638/// @code
2639/// pos = sceIoLseek(fd, -10, SEEK_END);
2640/// @endcode
2641///
2642/// @param fd - Opened file descriptor with which to seek
2643/// @param offset - Relative offset from the start position given by whence
2644/// @param whence - Set to SEEK_SET to seek from the start of the file, SEEK_CUR
2645/// seek from the current position and SEEK_END to seek from the end.
2646///
2647/// @return The position in the file after the seek.
2648    pub fn sceIoLseek(fd: SceUID, offset: SceOff, whence: libc::c_int)
2649     -> SceOff;
2650}
2651extern "C" {
2652    /// Reposition read/write file descriptor offset (asynchronous)
2653///
2654/// @param fd - Opened file descriptor with which to seek
2655/// @param offset - Relative offset from the start position given by whence
2656/// @param whence - Set to SEEK_SET to seek from the start of the file, SEEK_CUR
2657/// seek from the current position and SEEK_END to seek from the end.
2658///
2659/// @return < 0 on error. Actual value should be passed returned by the ::sceIoWaitAsync call.
2660    pub fn sceIoLseekAsync(fd: SceUID, offset: SceOff, whence: libc::c_int)
2661     -> libc::c_int;
2662}
2663extern "C" {
2664    /// Reposition read/write file descriptor offset (32bit mode)
2665///
2666/// @par Example:
2667/// @code
2668/// pos = sceIoLseek32(fd, -10, SEEK_END);
2669/// @endcode
2670///
2671/// @param fd - Opened file descriptor with which to seek
2672/// @param offset - Relative offset from the start position given by whence
2673/// @param whence - Set to SEEK_SET to seek from the start of the file, SEEK_CUR
2674/// seek from the current position and SEEK_END to seek from the end.
2675///
2676/// @return The position in the file after the seek.
2677    pub fn sceIoLseek32(fd: SceUID, offset: libc::c_int, whence: libc::c_int)
2678     -> libc::c_int;
2679}
2680extern "C" {
2681    /// Reposition read/write file descriptor offset (32bit mode, asynchronous)
2682///
2683/// @param fd - Opened file descriptor with which to seek
2684/// @param offset - Relative offset from the start position given by whence
2685/// @param whence - Set to SEEK_SET to seek from the start of the file, SEEK_CUR
2686/// seek from the current position and SEEK_END to seek from the end.
2687///
2688/// @return < 0 on error.
2689    pub fn sceIoLseek32Async(fd: SceUID, offset: libc::c_int,
2690                             whence: libc::c_int) -> libc::c_int;
2691}
2692extern "C" {
2693    /// Remove directory entry
2694///
2695/// @param file - Path to the file to remove
2696/// @return < 0 on error
2697    pub fn sceIoRemove(file: *const libc::c_char) -> libc::c_int;
2698}
2699extern "C" {
2700    /// Make a directory file
2701///
2702/// @param dir
2703/// @param mode - Access mode.
2704/// @return Returns the value 0 if its succesful otherwise -1
2705    pub fn sceIoMkdir(dir: *const libc::c_char, mode: SceMode) -> libc::c_int;
2706}
2707extern "C" {
2708    /// Remove a directory file
2709///
2710/// @param path - Removes a directory file pointed by the string path
2711/// @return Returns the value 0 if its succesful otherwise -1
2712    pub fn sceIoRmdir(path: *const libc::c_char) -> libc::c_int;
2713}
2714extern "C" {
2715    /// Change the current directory.
2716///
2717/// @param path - The path to change to.
2718/// @return < 0 on error.
2719    pub fn sceIoChdir(path: *const libc::c_char) -> libc::c_int;
2720}
2721extern "C" {
2722    /// Change the name of a file
2723///
2724/// @param oldname - The old filename
2725/// @param newname - The new filename
2726/// @return < 0 on error.
2727    pub fn sceIoRename(oldname: *const libc::c_char,
2728                       newname: *const libc::c_char) -> libc::c_int;
2729}
2730extern "C" {
2731    /// Open a directory
2732///
2733/// @par Example:
2734/// @code
2735/// int dfd;
2736/// dfd = sceIoDopen("device:/");
2737/// if(dfd >= 0)
2738/// { Do something with the file descriptor }
2739/// @endcode
2740/// @param dirname - The directory to open for reading.
2741/// @return If >= 0 then a valid file descriptor, otherwise a Sony error code.
2742    pub fn sceIoDopen(dirname: *const libc::c_char) -> SceUID;
2743}
2744extern "C" {
2745    /// Reads an entry from an opened file descriptor.
2746///
2747/// @param fd - Already opened file descriptor (using sceIoDopen)
2748/// @param dir - Pointer to an io_dirent_t structure to hold the file information
2749///
2750/// @return Read status
2751/// -   0 - No more directory entries left
2752/// - > 0 - More directory entired to go
2753/// - < 0 - Error
2754    pub fn sceIoDread(fd: SceUID, dir: *mut SceIoDirent) -> libc::c_int;
2755}
2756extern "C" {
2757    /// Close an opened directory file descriptor
2758///
2759/// @param fd - Already opened file descriptor (using sceIoDopen)
2760/// @return < 0 on error
2761    pub fn sceIoDclose(fd: SceUID) -> libc::c_int;
2762}
2763extern "C" {
2764    /// Send a devctl command to a device.
2765///
2766/// @par Example: Sending a simple command to a device (not a real devctl)
2767/// @code
2768/// sceIoDevctl("ms0:", 0x200000, indata, 4, NULL, NULL);
2769/// @endcode
2770///
2771/// @param dev - String for the device to send the devctl to (e.g. "ms0:")
2772/// @param cmd - The command to send to the device
2773/// @param indata - A data block to send to the device, if NULL sends no data
2774/// @param inlen - Length of indata, if 0 sends no data
2775/// @param outdata - A data block to receive the result of a command, if NULL receives no data
2776/// @param outlen - Length of outdata, if 0 receives no data
2777/// @return 0 on success, < 0 on error
2778    pub fn sceIoDevctl(dev: *const libc::c_char, cmd: libc::c_uint,
2779                       indata: *mut libc::c_void, inlen: libc::c_int,
2780                       outdata: *mut libc::c_void, outlen: libc::c_int)
2781     -> libc::c_int;
2782}
2783extern "C" {
2784    /// Assigns one IO device to another (I guess)
2785/// @param dev1 - The device name to assign.
2786/// @param dev2 - The block device to assign from.
2787/// @param dev3 - The filesystem device to mape the block device to dev1
2788/// @param mode - Read/Write mode. One of IoAssignPerms.
2789/// @param unk1 - Unknown, set to NULL.
2790/// @param unk2 - Unknown, set to 0.
2791/// @return < 0 on error.
2792///
2793/// @par Example: Reassign flash0 in read/write mode.
2794/// @code
2795/// sceIoUnassign("flash0");
2796/// sceIoAssign("flash0", "lflash0:0,0", "flashfat0:", IOASSIGN_RDWR, NULL, 0);
2797/// @endcode
2798///
2799    pub fn sceIoAssign(dev1: *const libc::c_char, dev2: *const libc::c_char,
2800                       dev3: *const libc::c_char, mode: libc::c_int,
2801                       unk1: *mut libc::c_void, unk2: libc::c_long)
2802     -> libc::c_int;
2803}
2804extern "C" {
2805    /// Unassign an IO device.
2806/// @param dev - The device to unassign.
2807/// @return < 0 on error
2808///
2809/// @par Example: See ::sceIoAssign
2810    pub fn sceIoUnassign(dev: *const libc::c_char) -> libc::c_int;
2811}
2812extern "C" {
2813    /// Get the status of a file.
2814///
2815/// @param file - The path to the file.
2816/// @param stat - A pointer to an io_stat_t structure.
2817///
2818/// @return < 0 on error.
2819    pub fn sceIoGetstat(file: *const libc::c_char, stat: *mut SceIoStat)
2820     -> libc::c_int;
2821}
2822extern "C" {
2823    /// Change the status of a file.
2824///
2825/// @param file - The path to the file.
2826/// @param stat - A pointer to an io_stat_t structure.
2827/// @param bits - Bitmask defining which bits to change.
2828///
2829/// @return < 0 on error.
2830    pub fn sceIoChstat(file: *const libc::c_char, stat: *mut SceIoStat,
2831                       bits: libc::c_int) -> libc::c_int;
2832}
2833extern "C" {
2834    /// Perform an ioctl on a device.
2835///
2836/// @param fd - Opened file descriptor to ioctl to
2837/// @param cmd - The command to send to the device
2838/// @param indata - A data block to send to the device, if NULL sends no data
2839/// @param inlen - Length of indata, if 0 sends no data
2840/// @param outdata - A data block to receive the result of a command, if NULL receives no data
2841/// @param outlen - Length of outdata, if 0 receives no data
2842/// @return 0 on success, < 0 on error
2843    pub fn sceIoIoctl(fd: SceUID, cmd: libc::c_uint,
2844                      indata: *mut libc::c_void, inlen: libc::c_int,
2845                      outdata: *mut libc::c_void, outlen: libc::c_int)
2846     -> libc::c_int;
2847}
2848extern "C" {
2849    /// Perform an ioctl on a device. (asynchronous)
2850///
2851/// @param fd - Opened file descriptor to ioctl to
2852/// @param cmd - The command to send to the device
2853/// @param indata - A data block to send to the device, if NULL sends no data
2854/// @param inlen - Length of indata, if 0 sends no data
2855/// @param outdata - A data block to receive the result of a command, if NULL receives no data
2856/// @param outlen - Length of outdata, if 0 receives no data
2857/// @return 0 on success, < 0 on error
2858    pub fn sceIoIoctlAsync(fd: SceUID, cmd: libc::c_uint,
2859                           indata: *mut libc::c_void, inlen: libc::c_int,
2860                           outdata: *mut libc::c_void, outlen: libc::c_int)
2861     -> libc::c_int;
2862}
2863extern "C" {
2864    /// Synchronise the file data on the device.
2865///
2866/// @param device - The device to synchronise (e.g. msfat0:)
2867/// @param unk - Unknown
2868    pub fn sceIoSync(device: *const libc::c_char, unk: libc::c_uint)
2869     -> libc::c_int;
2870}
2871extern "C" {
2872    /// Wait for asyncronous completion.
2873///
2874/// @param fd - The file descriptor which is current performing an asynchronous action.
2875/// @param res - The result of the async action.
2876///
2877/// @return < 0 on error.
2878    pub fn sceIoWaitAsync(fd: SceUID, res: *mut SceInt64) -> libc::c_int;
2879}
2880extern "C" {
2881    /// Wait for asyncronous completion (with callbacks).
2882///
2883/// @param fd - The file descriptor which is current performing an asynchronous action.
2884/// @param res - The result of the async action.
2885///
2886/// @return < 0 on error.
2887    pub fn sceIoWaitAsyncCB(fd: SceUID, res: *mut SceInt64) -> libc::c_int;
2888}
2889extern "C" {
2890    /// Poll for asyncronous completion.
2891///
2892/// @param fd - The file descriptor which is current performing an asynchronous action.
2893/// @param res - The result of the async action.
2894///
2895/// @return < 0 on error.
2896    pub fn sceIoPollAsync(fd: SceUID, res: *mut SceInt64) -> libc::c_int;
2897}
2898extern "C" {
2899    /// Get the asyncronous completion status.
2900///
2901/// @param fd - The file descriptor which is current performing an asynchronous action.
2902/// @param poll - If 0 then waits for the status, otherwise it polls the fd.
2903/// @param res - The result of the async action.
2904///
2905/// @return < 0 on error.
2906    pub fn sceIoGetAsyncStat(fd: SceUID, poll: libc::c_int,
2907                             res: *mut SceInt64) -> libc::c_int;
2908}
2909extern "C" {
2910    /// Cancel an asynchronous operation on a file descriptor.
2911///
2912/// @param fd - The file descriptor to perform cancel on.
2913///
2914/// @return < 0 on error.
2915    pub fn sceIoCancel(fd: SceUID) -> libc::c_int;
2916}
2917extern "C" {
2918    /// Get the device type of the currently opened file descriptor.
2919///
2920/// @param fd - The opened file descriptor.
2921///
2922/// @return < 0 on error. Otherwise the device type?
2923    pub fn sceIoGetDevType(fd: SceUID) -> libc::c_int;
2924}
2925extern "C" {
2926    /// Change the priority of the asynchronous thread.
2927///
2928/// @param fd - The opened fd on which the priority should be changed.
2929/// @param pri - The priority of the thread.
2930///
2931/// @return < 0 on error.
2932    pub fn sceIoChangeAsyncPriority(fd: SceUID, pri: libc::c_int)
2933     -> libc::c_int;
2934}
2935extern "C" {
2936    /// Sets a callback for the asynchronous action.
2937///
2938/// @param fd - The filedescriptor currently performing an asynchronous action.
2939/// @param cb - The UID of the callback created with ::sceKernelCreateCallback
2940/// @param argp - Pointer to an argument to pass to the callback.
2941///
2942/// @return < 0 on error.
2943    pub fn sceIoSetAsyncCallback(fd: SceUID, cb: SceUID,
2944                                 argp: *mut libc::c_void) -> libc::c_int;
2945}
2946extern "C" {
2947    /// Register callback
2948///
2949/// @note By installing the exit callback the home button becomes active. However if sceKernelExitGame
2950/// is not called in the callback it is likely that the psp will just crash.
2951///
2952/// @par Example:
2953/// @code
2954/// int exit_callback(void) { sceKernelExitGame(); }
2955///
2956/// cbid = sceKernelCreateCallback("ExitCallback", exit_callback, NULL);
2957/// sceKernelRegisterExitCallback(cbid);
2958/// @endcode
2959///
2960/// @param cbid Callback id
2961/// @return < 0 on error
2962    pub fn sceKernelRegisterExitCallback(cbid: libc::c_int) -> libc::c_int;
2963}
2964extern "C" {
2965    /// Exit game and go back to the PSP browser.
2966///
2967/// @note You need to be in a thread in order for this function to work
2968///
2969    pub fn sceKernelExitGame();
2970}
2971/// Structure to pass to loadexec
2972#[repr(C)]
2973#[derive(Debug, Copy)]
2974pub struct SceKernelLoadExecParam {
2975    /// Size of the structure
2976    pub size: SceSize,
2977    /// Size of the arg string
2978    pub args: SceSize,
2979    /// Pointer to the arg string
2980    pub argp: *mut libc::c_void,
2981    /// Encryption key ?
2982    pub key: *const libc::c_char,
2983}
2984#[test]
2985fn bindgen_test_layout_SceKernelLoadExecParam() {
2986    assert_eq!(::core::mem::size_of::<SceKernelLoadExecParam>() , 24usize ,
2987               concat ! ( "Size of: " , stringify ! ( SceKernelLoadExecParam )
2988               ));
2989    assert_eq! (::core::mem::align_of::<SceKernelLoadExecParam>() , 8usize ,
2990                concat ! (
2991                "Alignment of " , stringify ! ( SceKernelLoadExecParam ) ));
2992    assert_eq! (unsafe {
2993                & ( * ( 0 as * const SceKernelLoadExecParam ) ) . size as *
2994                const _ as usize } , 0usize , concat ! (
2995                "Alignment of field: " , stringify ! ( SceKernelLoadExecParam
2996                ) , "::" , stringify ! ( size ) ));
2997    assert_eq! (unsafe {
2998                & ( * ( 0 as * const SceKernelLoadExecParam ) ) . args as *
2999                const _ as usize } , 4usize , concat ! (
3000                "Alignment of field: " , stringify ! ( SceKernelLoadExecParam
3001                ) , "::" , stringify ! ( args ) ));
3002    assert_eq! (unsafe {
3003                & ( * ( 0 as * const SceKernelLoadExecParam ) ) . argp as *
3004                const _ as usize } , 8usize , concat ! (
3005                "Alignment of field: " , stringify ! ( SceKernelLoadExecParam
3006                ) , "::" , stringify ! ( argp ) ));
3007    assert_eq! (unsafe {
3008                & ( * ( 0 as * const SceKernelLoadExecParam ) ) . key as *
3009                const _ as usize } , 16usize , concat ! (
3010                "Alignment of field: " , stringify ! ( SceKernelLoadExecParam
3011                ) , "::" , stringify ! ( key ) ));
3012}
3013impl Clone for SceKernelLoadExecParam {
3014    fn clone(&self) -> Self { *self }
3015}
3016extern "C" {
3017    /// Execute a new game executable, limited when not running in kernel mode.
3018///
3019/// @param file - The file to execute.
3020/// @param param - Pointer to a ::SceKernelLoadExecParam structure, or NULL.
3021///
3022/// @return < 0 on error, probably.
3023///
3024    pub fn sceKernelLoadExec(file: *const libc::c_char,
3025                             param: *mut SceKernelLoadExecParam)
3026     -> libc::c_int;
3027}
3028#[repr(C)]
3029#[derive(Debug, Copy)]
3030pub struct _scemoduleinfo {
3031    pub modattribute: libc::c_ushort,
3032    pub modversion: [libc::c_uchar; 2usize],
3033    pub modname: [libc::c_char; 27usize],
3034    pub terminal: libc::c_char,
3035    pub gp_value: *mut libc::c_void,
3036    pub ent_top: *mut libc::c_void,
3037    pub ent_end: *mut libc::c_void,
3038    pub stub_top: *mut libc::c_void,
3039    pub stub_end: *mut libc::c_void,
3040}
3041#[test]
3042fn bindgen_test_layout__scemoduleinfo() {
3043    assert_eq!(::core::mem::size_of::<_scemoduleinfo>() , 72usize , concat ! (
3044               "Size of: " , stringify ! ( _scemoduleinfo ) ));
3045    assert_eq! (::core::mem::align_of::<_scemoduleinfo>() , 8usize , concat !
3046                ( "Alignment of " , stringify ! ( _scemoduleinfo ) ));
3047    assert_eq! (unsafe {
3048                & ( * ( 0 as * const _scemoduleinfo ) ) . modattribute as *
3049                const _ as usize } , 0usize , concat ! (
3050                "Alignment of field: " , stringify ! ( _scemoduleinfo ) , "::"
3051                , stringify ! ( modattribute ) ));
3052    assert_eq! (unsafe {
3053                & ( * ( 0 as * const _scemoduleinfo ) ) . modversion as *
3054                const _ as usize } , 2usize , concat ! (
3055                "Alignment of field: " , stringify ! ( _scemoduleinfo ) , "::"
3056                , stringify ! ( modversion ) ));
3057    assert_eq! (unsafe {
3058                & ( * ( 0 as * const _scemoduleinfo ) ) . modname as * const _
3059                as usize } , 4usize , concat ! (
3060                "Alignment of field: " , stringify ! ( _scemoduleinfo ) , "::"
3061                , stringify ! ( modname ) ));
3062    assert_eq! (unsafe {
3063                & ( * ( 0 as * const _scemoduleinfo ) ) . terminal as * const
3064                _ as usize } , 31usize , concat ! (
3065                "Alignment of field: " , stringify ! ( _scemoduleinfo ) , "::"
3066                , stringify ! ( terminal ) ));
3067    assert_eq! (unsafe {
3068                & ( * ( 0 as * const _scemoduleinfo ) ) . gp_value as * const
3069                _ as usize } , 32usize , concat ! (
3070                "Alignment of field: " , stringify ! ( _scemoduleinfo ) , "::"
3071                , stringify ! ( gp_value ) ));
3072    assert_eq! (unsafe {
3073                & ( * ( 0 as * const _scemoduleinfo ) ) . ent_top as * const _
3074                as usize } , 40usize , concat ! (
3075                "Alignment of field: " , stringify ! ( _scemoduleinfo ) , "::"
3076                , stringify ! ( ent_top ) ));
3077    assert_eq! (unsafe {
3078                & ( * ( 0 as * const _scemoduleinfo ) ) . ent_end as * const _
3079                as usize } , 48usize , concat ! (
3080                "Alignment of field: " , stringify ! ( _scemoduleinfo ) , "::"
3081                , stringify ! ( ent_end ) ));
3082    assert_eq! (unsafe {
3083                & ( * ( 0 as * const _scemoduleinfo ) ) . stub_top as * const
3084                _ as usize } , 56usize , concat ! (
3085                "Alignment of field: " , stringify ! ( _scemoduleinfo ) , "::"
3086                , stringify ! ( stub_top ) ));
3087    assert_eq! (unsafe {
3088                & ( * ( 0 as * const _scemoduleinfo ) ) . stub_end as * const
3089                _ as usize } , 64usize , concat ! (
3090                "Alignment of field: " , stringify ! ( _scemoduleinfo ) , "::"
3091                , stringify ! ( stub_end ) ));
3092}
3093impl Clone for _scemoduleinfo {
3094    fn clone(&self) -> Self { *self }
3095}
3096pub type _sceModuleInfo = _scemoduleinfo;
3097pub type SceModuleInfo = _sceModuleInfo;
3098extern "C" {
3099    #[link_name = "_gp"]
3100    pub static mut _gp: [libc::c_char; 0usize];
3101}
3102#[repr(u32)]
3103#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
3104pub enum PspModuleInfoAttr {
3105    PSP_MODULE_USER = 0,
3106    PSP_MODULE_NO_STOP = 1,
3107    PSP_MODULE_SINGLE_LOAD = 2,
3108    PSP_MODULE_SINGLE_START = 4,
3109    PSP_MODULE_KERNEL = 4096,
3110}
3111#[repr(C)]
3112#[derive(Debug, Copy)]
3113pub struct SceKernelLMOption {
3114    pub size: SceSize,
3115    pub mpidtext: SceUID,
3116    pub mpiddata: SceUID,
3117    pub flags: libc::c_uint,
3118    pub position: libc::c_char,
3119    pub access: libc::c_char,
3120    pub creserved: [libc::c_char; 2usize],
3121}
3122#[test]
3123fn bindgen_test_layout_SceKernelLMOption() {
3124    assert_eq!(::core::mem::size_of::<SceKernelLMOption>() , 20usize , concat
3125               ! ( "Size of: " , stringify ! ( SceKernelLMOption ) ));
3126    assert_eq! (::core::mem::align_of::<SceKernelLMOption>() , 4usize , concat
3127                ! ( "Alignment of " , stringify ! ( SceKernelLMOption ) ));
3128    assert_eq! (unsafe {
3129                & ( * ( 0 as * const SceKernelLMOption ) ) . size as * const _
3130                as usize } , 0usize , concat ! (
3131                "Alignment of field: " , stringify ! ( SceKernelLMOption ) ,
3132                "::" , stringify ! ( size ) ));
3133    assert_eq! (unsafe {
3134                & ( * ( 0 as * const SceKernelLMOption ) ) . mpidtext as *
3135                const _ as usize } , 4usize , concat ! (
3136                "Alignment of field: " , stringify ! ( SceKernelLMOption ) ,
3137                "::" , stringify ! ( mpidtext ) ));
3138    assert_eq! (unsafe {
3139                & ( * ( 0 as * const SceKernelLMOption ) ) . mpiddata as *
3140                const _ as usize } , 8usize , concat ! (
3141                "Alignment of field: " , stringify ! ( SceKernelLMOption ) ,
3142                "::" , stringify ! ( mpiddata ) ));
3143    assert_eq! (unsafe {
3144                & ( * ( 0 as * const SceKernelLMOption ) ) . flags as * const
3145                _ as usize } , 12usize , concat ! (
3146                "Alignment of field: " , stringify ! ( SceKernelLMOption ) ,
3147                "::" , stringify ! ( flags ) ));
3148    assert_eq! (unsafe {
3149                & ( * ( 0 as * const SceKernelLMOption ) ) . position as *
3150                const _ as usize } , 16usize , concat ! (
3151                "Alignment of field: " , stringify ! ( SceKernelLMOption ) ,
3152                "::" , stringify ! ( position ) ));
3153    assert_eq! (unsafe {
3154                & ( * ( 0 as * const SceKernelLMOption ) ) . access as * const
3155                _ as usize } , 17usize , concat ! (
3156                "Alignment of field: " , stringify ! ( SceKernelLMOption ) ,
3157                "::" , stringify ! ( access ) ));
3158    assert_eq! (unsafe {
3159                & ( * ( 0 as * const SceKernelLMOption ) ) . creserved as *
3160                const _ as usize } , 18usize , concat ! (
3161                "Alignment of field: " , stringify ! ( SceKernelLMOption ) ,
3162                "::" , stringify ! ( creserved ) ));
3163}
3164impl Clone for SceKernelLMOption {
3165    fn clone(&self) -> Self { *self }
3166}
3167#[repr(C)]
3168#[derive(Debug, Copy)]
3169pub struct SceKernelSMOption {
3170    pub size: SceSize,
3171    pub mpidstack: SceUID,
3172    pub stacksize: SceSize,
3173    pub priority: libc::c_int,
3174    pub attribute: libc::c_uint,
3175}
3176#[test]
3177fn bindgen_test_layout_SceKernelSMOption() {
3178    assert_eq!(::core::mem::size_of::<SceKernelSMOption>() , 20usize , concat
3179               ! ( "Size of: " , stringify ! ( SceKernelSMOption ) ));
3180    assert_eq! (::core::mem::align_of::<SceKernelSMOption>() , 4usize , concat
3181                ! ( "Alignment of " , stringify ! ( SceKernelSMOption ) ));
3182    assert_eq! (unsafe {
3183                & ( * ( 0 as * const SceKernelSMOption ) ) . size as * const _
3184                as usize } , 0usize , concat ! (
3185                "Alignment of field: " , stringify ! ( SceKernelSMOption ) ,
3186                "::" , stringify ! ( size ) ));
3187    assert_eq! (unsafe {
3188                & ( * ( 0 as * const SceKernelSMOption ) ) . mpidstack as *
3189                const _ as usize } , 4usize , concat ! (
3190                "Alignment of field: " , stringify ! ( SceKernelSMOption ) ,
3191                "::" , stringify ! ( mpidstack ) ));
3192    assert_eq! (unsafe {
3193                & ( * ( 0 as * const SceKernelSMOption ) ) . stacksize as *
3194                const _ as usize } , 8usize , concat ! (
3195                "Alignment of field: " , stringify ! ( SceKernelSMOption ) ,
3196                "::" , stringify ! ( stacksize ) ));
3197    assert_eq! (unsafe {
3198                & ( * ( 0 as * const SceKernelSMOption ) ) . priority as *
3199                const _ as usize } , 12usize , concat ! (
3200                "Alignment of field: " , stringify ! ( SceKernelSMOption ) ,
3201                "::" , stringify ! ( priority ) ));
3202    assert_eq! (unsafe {
3203                & ( * ( 0 as * const SceKernelSMOption ) ) . attribute as *
3204                const _ as usize } , 16usize , concat ! (
3205                "Alignment of field: " , stringify ! ( SceKernelSMOption ) ,
3206                "::" , stringify ! ( attribute ) ));
3207}
3208impl Clone for SceKernelSMOption {
3209    fn clone(&self) -> Self { *self }
3210}
3211extern "C" {
3212    /// Load a module.
3213/// @note This function restricts where it can load from (such as from flash0)
3214/// unless you call it in kernel mode. It also must be called from a thread.
3215///
3216/// @param path - The path to the module to load.
3217/// @param flags - Unused, always 0 .
3218/// @param option  - Pointer to a mod_param_t structure. Can be NULL.
3219///
3220/// @return The UID of the loaded module on success, otherwise one of ::PspKernelErrorCodes.
3221    pub fn sceKernelLoadModule(path: *const libc::c_char, flags: libc::c_int,
3222                               option: *mut SceKernelLMOption) -> SceUID;
3223}
3224extern "C" {
3225    /// Load a module from MS.
3226/// @note This function restricts what it can load, e.g. it wont load plain executables.
3227///
3228/// @param path - The path to the module to load.
3229/// @param flags - Unused, set to 0.
3230/// @param option  - Pointer to a mod_param_t structure. Can be NULL.
3231///
3232/// @return The UID of the loaded module on success, otherwise one of ::PspKernelErrorCodes.
3233    pub fn sceKernelLoadModuleMs(path: *const libc::c_char,
3234                                 flags: libc::c_int,
3235                                 option: *mut SceKernelLMOption) -> SceUID;
3236}
3237extern "C" {
3238    /// Load a module from the given file UID.
3239///
3240/// @param fid - The module's file UID.
3241/// @param flags - Unused, always 0.
3242/// @param option - Pointer to an optional ::SceKernelLMOption structure.
3243///
3244/// @return The UID of the loaded module on success, otherwise one of ::PspKernelErrorCodes.
3245    pub fn sceKernelLoadModuleByID(fid: SceUID, flags: libc::c_int,
3246                                   option: *mut SceKernelLMOption) -> SceUID;
3247}
3248extern "C" {
3249    /// Load a module from a buffer using the USB/WLAN API.
3250///
3251/// Can only be called from kernel mode, or from a thread that has attributes of 0xa0000000.
3252///
3253/// @param bufsize - Size (in bytes) of the buffer pointed to by buf.
3254/// @param buf - Pointer to a buffer containing the module to load.  The buffer must reside at an
3255/// address that is a multiple to 64 bytes.
3256/// @param flags - Unused, always 0.
3257/// @param option - Pointer to an optional ::SceKernelLMOption structure.
3258///
3259/// @return The UID of the loaded module on success, otherwise one of ::PspKernelErrorCodes.
3260    pub fn sceKernelLoadModuleBufferUsbWlan(bufsize: SceSize,
3261                                            buf: *mut libc::c_void,
3262                                            flags: libc::c_int,
3263                                            option: *mut SceKernelLMOption)
3264     -> SceUID;
3265}
3266extern "C" {
3267    /// Start a loaded module.
3268///
3269/// @param modid - The ID of the module returned from LoadModule.
3270/// @param argsize - Length of the args.
3271/// @param argp - A pointer to the arguments to the module.
3272/// @param status - Returns the status of the start.
3273/// @param option - Pointer to an optional ::SceKernelSMOption structure.
3274///
3275/// @return ??? on success, otherwise one of ::PspKernelErrorCodes.
3276    pub fn sceKernelStartModule(modid: SceUID, argsize: SceSize,
3277                                argp: *mut libc::c_void,
3278                                status: *mut libc::c_int,
3279                                option: *mut SceKernelSMOption)
3280     -> libc::c_int;
3281}
3282extern "C" {
3283    /// Stop a running module.
3284///
3285/// @param modid - The UID of the module to stop.
3286/// @param argsize - The length of the arguments pointed to by argp.
3287/// @param argp - Pointer to arguments to pass to the module's module_stop() routine.
3288/// @param status - Return value of the module's module_stop() routine.
3289/// @param option - Pointer to an optional ::SceKernelSMOption structure.
3290///
3291/// @return ??? on success, otherwise one of ::PspKernelErrorCodes.
3292    pub fn sceKernelStopModule(modid: SceUID, argsize: SceSize,
3293                               argp: *mut libc::c_void,
3294                               status: *mut libc::c_int,
3295                               option: *mut SceKernelSMOption) -> libc::c_int;
3296}
3297extern "C" {
3298    /// Unload a stopped module.
3299///
3300/// @param modid - The UID of the module to unload.
3301///
3302/// @return ??? on success, otherwise one of ::PspKernelErrorCodes.
3303    pub fn sceKernelUnloadModule(modid: SceUID) -> libc::c_int;
3304}
3305extern "C" {
3306    /// Stop and unload the current module.
3307///
3308/// @param unknown - Unknown (I've seen 1 passed).
3309/// @param argsize - Size (in bytes) of the arguments that will be passed to module_stop().
3310/// @param argp - Pointer to arguments that will be passed to module_stop().
3311///
3312/// @return ??? on success, otherwise one of ::PspKernelErrorCodes.
3313    pub fn sceKernelSelfStopUnloadModule(unknown: libc::c_int,
3314                                         argsize: SceSize,
3315                                         argp: *mut libc::c_void)
3316     -> libc::c_int;
3317}
3318extern "C" {
3319    /// Stop and unload the current module.
3320///
3321/// @param argsize - Size (in bytes) of the arguments that will be passed to module_stop().
3322/// @param argp - Poitner to arguments that will be passed to module_stop().
3323/// @param status - Return value from module_stop().
3324/// @param option - Pointer to an optional ::SceKernelSMOption structure.
3325///
3326/// @return ??? on success, otherwise one of ::PspKernelErrorCodes.
3327    pub fn sceKernelStopUnloadSelfModule(argsize: SceSize,
3328                                         argp: *mut libc::c_void,
3329                                         status: *mut libc::c_int,
3330                                         option: *mut SceKernelSMOption)
3331     -> libc::c_int;
3332}
3333#[repr(C)]
3334#[derive(Debug, Copy)]
3335pub struct SceKernelModuleInfo {
3336    pub size: SceSize,
3337    pub nsegment: libc::c_char,
3338    pub reserved: [libc::c_char; 3usize],
3339    pub segmentaddr: [libc::c_int; 4usize],
3340    pub segmentsize: [libc::c_int; 4usize],
3341    pub entry_addr: libc::c_uint,
3342    pub gp_value: libc::c_uint,
3343    pub text_addr: libc::c_uint,
3344    pub text_size: libc::c_uint,
3345    pub data_size: libc::c_uint,
3346    pub bss_size: libc::c_uint,
3347    pub attribute: libc::c_ushort,
3348    pub version: [libc::c_uchar; 2usize],
3349    pub name: [libc::c_char; 28usize],
3350}
3351#[test]
3352fn bindgen_test_layout_SceKernelModuleInfo() {
3353    assert_eq!(::core::mem::size_of::<SceKernelModuleInfo>() , 96usize ,
3354               concat ! ( "Size of: " , stringify ! ( SceKernelModuleInfo )
3355               ));
3356    assert_eq! (::core::mem::align_of::<SceKernelModuleInfo>() , 4usize ,
3357                concat ! (
3358                "Alignment of " , stringify ! ( SceKernelModuleInfo ) ));
3359    assert_eq! (unsafe {
3360                & ( * ( 0 as * const SceKernelModuleInfo ) ) . size as * const
3361                _ as usize } , 0usize , concat ! (
3362                "Alignment of field: " , stringify ! ( SceKernelModuleInfo ) ,
3363                "::" , stringify ! ( size ) ));
3364    assert_eq! (unsafe {
3365                & ( * ( 0 as * const SceKernelModuleInfo ) ) . nsegment as *
3366                const _ as usize } , 4usize , concat ! (
3367                "Alignment of field: " , stringify ! ( SceKernelModuleInfo ) ,
3368                "::" , stringify ! ( nsegment ) ));
3369    assert_eq! (unsafe {
3370                & ( * ( 0 as * const SceKernelModuleInfo ) ) . reserved as *
3371                const _ as usize } , 5usize , concat ! (
3372                "Alignment of field: " , stringify ! ( SceKernelModuleInfo ) ,
3373                "::" , stringify ! ( reserved ) ));
3374    assert_eq! (unsafe {
3375                & ( * ( 0 as * const SceKernelModuleInfo ) ) . segmentaddr as
3376                * const _ as usize } , 8usize , concat ! (
3377                "Alignment of field: " , stringify ! ( SceKernelModuleInfo ) ,
3378                "::" , stringify ! ( segmentaddr ) ));
3379    assert_eq! (unsafe {
3380                & ( * ( 0 as * const SceKernelModuleInfo ) ) . segmentsize as
3381                * const _ as usize } , 24usize , concat ! (
3382                "Alignment of field: " , stringify ! ( SceKernelModuleInfo ) ,
3383                "::" , stringify ! ( segmentsize ) ));
3384    assert_eq! (unsafe {
3385                & ( * ( 0 as * const SceKernelModuleInfo ) ) . entry_addr as *
3386                const _ as usize } , 40usize , concat ! (
3387                "Alignment of field: " , stringify ! ( SceKernelModuleInfo ) ,
3388                "::" , stringify ! ( entry_addr ) ));
3389    assert_eq! (unsafe {
3390                & ( * ( 0 as * const SceKernelModuleInfo ) ) . gp_value as *
3391                const _ as usize } , 44usize , concat ! (
3392                "Alignment of field: " , stringify ! ( SceKernelModuleInfo ) ,
3393                "::" , stringify ! ( gp_value ) ));
3394    assert_eq! (unsafe {
3395                & ( * ( 0 as * const SceKernelModuleInfo ) ) . text_addr as *
3396                const _ as usize } , 48usize , concat ! (
3397                "Alignment of field: " , stringify ! ( SceKernelModuleInfo ) ,
3398                "::" , stringify ! ( text_addr ) ));
3399    assert_eq! (unsafe {
3400                & ( * ( 0 as * const SceKernelModuleInfo ) ) . text_size as *
3401                const _ as usize } , 52usize , concat ! (
3402                "Alignment of field: " , stringify ! ( SceKernelModuleInfo ) ,
3403                "::" , stringify ! ( text_size ) ));
3404    assert_eq! (unsafe {
3405                & ( * ( 0 as * const SceKernelModuleInfo ) ) . data_size as *
3406                const _ as usize } , 56usize , concat ! (
3407                "Alignment of field: " , stringify ! ( SceKernelModuleInfo ) ,
3408                "::" , stringify ! ( data_size ) ));
3409    assert_eq! (unsafe {
3410                & ( * ( 0 as * const SceKernelModuleInfo ) ) . bss_size as *
3411                const _ as usize } , 60usize , concat ! (
3412                "Alignment of field: " , stringify ! ( SceKernelModuleInfo ) ,
3413                "::" , stringify ! ( bss_size ) ));
3414    assert_eq! (unsafe {
3415                & ( * ( 0 as * const SceKernelModuleInfo ) ) . attribute as *
3416                const _ as usize } , 64usize , concat ! (
3417                "Alignment of field: " , stringify ! ( SceKernelModuleInfo ) ,
3418                "::" , stringify ! ( attribute ) ));
3419    assert_eq! (unsafe {
3420                & ( * ( 0 as * const SceKernelModuleInfo ) ) . version as *
3421                const _ as usize } , 66usize , concat ! (
3422                "Alignment of field: " , stringify ! ( SceKernelModuleInfo ) ,
3423                "::" , stringify ! ( version ) ));
3424    assert_eq! (unsafe {
3425                & ( * ( 0 as * const SceKernelModuleInfo ) ) . name as * const
3426                _ as usize } , 68usize , concat ! (
3427                "Alignment of field: " , stringify ! ( SceKernelModuleInfo ) ,
3428                "::" , stringify ! ( name ) ));
3429}
3430impl Clone for SceKernelModuleInfo {
3431    fn clone(&self) -> Self { *self }
3432}
3433extern "C" {
3434    /// Query the information about a loaded module from its UID.
3435/// @note This fails on v1.0 firmware (and even it worked has a limited structure)
3436/// so if you want to be compatible with both 1.5 and 1.0 (and you are running in
3437/// kernel mode) then call this function first then ::pspSdkQueryModuleInfoV1
3438/// if it fails, or make separate v1 and v1.5+ builds.
3439///
3440/// @param modid - The UID of the loaded module.
3441/// @param info - Pointer to a ::SceKernelModuleInfo structure.
3442///
3443/// @return 0 on success, otherwise one of ::PspKernelErrorCodes.
3444    pub fn sceKernelQueryModuleInfo(modid: SceUID,
3445                                    info: *mut SceKernelModuleInfo)
3446     -> libc::c_int;
3447}
3448extern "C" {
3449    /// Get a list of module IDs. NOTE: This is only available on 1.5 firmware
3450/// and above. For V1 use ::pspSdkGetModuleIdList.
3451///
3452/// @param readbuf - Buffer to store the module list.
3453/// @param readbufsize - Number of elements in the readbuffer.
3454/// @param idcount - Returns the number of module ids
3455///
3456/// @return >= 0 on success
3457    pub fn sceKernelGetModuleIdList(readbuf: *mut SceUID,
3458                                    readbufsize: libc::c_int,
3459                                    idcount: *mut libc::c_int) -> libc::c_int;
3460}
3461#[repr(u32)]
3462/// Specifies the type of allocation used for memory blocks.
3463#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
3464pub enum PspSysMemBlockTypes {
3465    PSP_SMEM_Low = 0,
3466    PSP_SMEM_High = 1,
3467    PSP_SMEM_Addr = 2,
3468}
3469pub type SceKernelSysMemAlloc_t = libc::c_int;
3470extern "C" {
3471    /// Allocate a memory block from a memory partition.
3472///
3473/// @param partitionid - The UID of the partition to allocate from.
3474/// @param name - Name assigned to the new block.
3475/// @param type - Specifies how the block is allocated within the partition.  One of ::PspSysMemBlockTypes.
3476/// @param size - Size of the memory block, in bytes.
3477/// @param addr - If type is PSP_SMEM_Addr, then addr specifies the lowest address allocate the block from.
3478///
3479/// @return The UID of the new block, or if less than 0 an error.
3480    pub fn sceKernelAllocPartitionMemory(partitionid: SceUID,
3481                                         name: *const libc::c_char,
3482                                         type_: libc::c_int, size: SceSize,
3483                                         addr: *mut libc::c_void) -> SceUID;
3484}
3485extern "C" {
3486    /// Free a memory block allocated with ::sceKernelAllocPartitionMemory.
3487///
3488/// @param blockid - UID of the block to free.
3489///
3490/// @return ? on success, less than 0 on error.
3491    pub fn sceKernelFreePartitionMemory(blockid: SceUID) -> libc::c_int;
3492}
3493extern "C" {
3494    /// Get the address of a memory block.
3495///
3496/// @param blockid - UID of the memory block.
3497///
3498/// @return The lowest address belonging to the memory block.
3499    pub fn sceKernelGetBlockHeadAddr(blockid: SceUID) -> *mut libc::c_void;
3500}
3501extern "C" {
3502    /// Get the total amount of free memory.
3503///
3504/// @return The total amount of free memory, in bytes.
3505    pub fn sceKernelTotalFreeMemSize() -> SceSize;
3506}
3507extern "C" {
3508    /// Get the size of the largest free memory block.
3509///
3510/// @return The size of the largest free memory block, in bytes.
3511    pub fn sceKernelMaxFreeMemSize() -> SceSize;
3512}
3513extern "C" {
3514    /// Get the firmware version.
3515///
3516/// @return The firmware version.
3517/// 0x01000300 on v1.00 unit,
3518/// 0x01050001 on v1.50 unit,
3519/// 0x01050100 on v1.51 unit,
3520/// 0x01050200 on v1.52 unit,
3521/// 0x02000010 on v2.00/v2.01 unit,
3522/// 0x02050010 on v2.50 unit,
3523/// 0x02060010 on v2.60 unit,
3524/// 0x02070010 on v2.70 unit,
3525/// 0x02070110 on v2.71 unit.
3526    pub fn sceKernelDevkitVersion() -> libc::c_int;
3527}
3528extern "C" {
3529    /// Set the version of the SDK with which the caller was compiled.
3530/// Version numbers are as for sceKernelDevkitVersion().
3531///
3532/// @return 0 on success, < 0 on error.
3533    pub fn sceKernelSetCompiledSdkVersion(version: libc::c_int)
3534     -> libc::c_int;
3535}
3536extern "C" {
3537    /// Get the SDK version set with sceKernelSetCompiledSdkVersion().
3538///
3539/// @return Version number, or 0 if unset.
3540    pub fn sceKernelGetCompiledSdkVersion() -> libc::c_int;
3541}
3542extern "C" {
3543    /// Initialise the debug screen
3544    pub fn pspDebugScreenInit();
3545}
3546extern "C" {
3547    /// Extended debug screen init
3548///
3549/// @param vram_base - Base address of frame buffer, if NULL then sets a default
3550/// @param mode - Colour mode
3551/// @param setup - Setup the screen if 1
3552    pub fn pspDebugScreenInitEx(vram_base: *mut libc::c_void,
3553                                mode: libc::c_int, setup: libc::c_int);
3554}
3555extern "C" {
3556    /// Do a printf to the debug screen.
3557///
3558/// @param fmt - Format string to print
3559/// @param ... - Arguments
3560    pub fn pspDebugScreenPrintf(fmt: *const libc::c_char, ...);
3561}
3562extern "C" {
3563    /// Do a printf to the debug screen.
3564/// @note This is for kernel mode only as it uses a kernel function
3565/// to perform the printf instead of using vsnprintf, use normal printf for
3566/// user mode.
3567///
3568/// @param format - Format string to print
3569/// @param ... - Arguments
3570    pub fn pspDebugScreenKprintf(format: *const libc::c_char, ...);
3571}
3572extern "C" {
3573    /// Enable or disable background colour writing (defaults to enabled)
3574///
3575/// @param enable - Set 1 to to enable background color, 0 for disable
3576    pub fn pspDebugScreenEnableBackColor(enable: libc::c_int);
3577}
3578extern "C" {
3579    /// Set the background color for the text
3580/// @note To reset the entire screens bg colour you need to call pspDebugScreenClear
3581///
3582/// @param color - A 32bit RGB colour
3583    pub fn pspDebugScreenSetBackColor(color: u32);
3584}
3585extern "C" {
3586    /// Set the text color
3587///
3588/// @param color - A 32 bit RGB color
3589    pub fn pspDebugScreenSetTextColor(color: u32);
3590}
3591extern "C" {
3592    /// Set the color mode (you must have switched the frame buffer appropriately)
3593///
3594/// @param mode - Color mode
3595    pub fn pspDebugScreenSetColorMode(mode: libc::c_int);
3596}
3597extern "C" {
3598    /// Draw a single character to the screen.
3599///
3600/// @param x - The x co-ordinate to draw to (pixel units)
3601/// @param y - The y co-ordinate to draw to (pixel units)
3602/// @param color - The text color to draw
3603/// @param ch - The character to draw
3604    pub fn pspDebugScreenPutChar(x: libc::c_int, y: libc::c_int, color: u32,
3605                                 ch: u8);
3606}
3607extern "C" {
3608    /// Set the current X and Y co-ordinate for the screen (in character units)
3609    pub fn pspDebugScreenSetXY(x: libc::c_int, y: libc::c_int);
3610}
3611extern "C" {
3612    /// Set the video ram offset used for the screen
3613///
3614/// @param offset - Offset in bytes
3615    pub fn pspDebugScreenSetOffset(offset: libc::c_int);
3616}
3617extern "C" {
3618    /// Set the video ram base used for the screen
3619///
3620/// @param base - Base address in bytes
3621    pub fn pspDebugScreenSetBase(base: *mut u32);
3622}
3623extern "C" {
3624    /// Get the current X co-ordinate (in character units)
3625///
3626/// @return The X co-ordinate
3627    pub fn pspDebugScreenGetX() -> libc::c_int;
3628}
3629extern "C" {
3630    /// Get the current Y co-ordinate (in character units)
3631///
3632/// @return The Y co-ordinate
3633    pub fn pspDebugScreenGetY() -> libc::c_int;
3634}
3635extern "C" {
3636    /// Clear the debug screen.
3637    pub fn pspDebugScreenClear();
3638}
3639extern "C" {
3640    /// Print non-nul terminated strings.
3641///
3642/// @param buff - Buffer containing the text.
3643/// @param size - Size of the data
3644///
3645/// @return The number of characters written
3646    pub fn pspDebugScreenPrintData(buff: *const libc::c_char,
3647                                   size: libc::c_int) -> libc::c_int;
3648}
3649extern "C" {
3650    /// Print a string
3651///
3652/// @param str - String
3653///
3654/// @return The number of characters written
3655    pub fn pspDebugScreenPuts(str: *const libc::c_char) -> libc::c_int;
3656}
3657extern "C" {
3658    /// Get a MIPS stack trace (might work :P)
3659///
3660/// @param results - List of points to store the results of the trace, (up to max)
3661/// @param max - Maximum number of back traces
3662///
3663/// @return The number of frames stored in results.
3664    pub fn pspDebugGetStackTrace(results: *mut libc::c_uint, max: libc::c_int)
3665     -> libc::c_int;
3666}
3667extern "C" {
3668    /// Enable the clear line function that allows debug to clear the screen
3669    pub fn pspDebugScreenClearLineEnable();
3670}
3671extern "C" {
3672    /// Disable the clear line function that causes flicker on constant refreshes
3673    pub fn pspDebugScreenClearLineDisable();
3674}
3675/// Structure to hold the register data associated with an exception
3676#[repr(C)]
3677#[derive(Copy)]
3678pub struct _PspDebugRegBlock {
3679    pub frame: [u32; 6usize],
3680    /// Array of the 32 GPRs
3681    pub r: [u32; 32usize],
3682    /// The status register
3683    pub status: u32,
3684    /// lo
3685    pub lo: u32,
3686    pub hi: u32,
3687    pub badvaddr: u32,
3688    pub cause: u32,
3689    pub epc: u32,
3690    pub fpr: [f32; 32usize],
3691    pub fsr: u32,
3692    pub fir: u32,
3693    pub frame_ptr: u32,
3694    pub unused: u32,
3695    pub index: u32,
3696    pub random: u32,
3697    pub entrylo0: u32,
3698    pub entrylo1: u32,
3699    pub context: u32,
3700    pub pagemask: u32,
3701    pub wired: u32,
3702    pub cop0_7: u32,
3703    pub cop0_8: u32,
3704    pub cop0_9: u32,
3705    pub entryhi: u32,
3706    pub cop0_11: u32,
3707    pub cop0_12: u32,
3708    pub cop0_13: u32,
3709    pub cop0_14: u32,
3710    pub prid: u32,
3711    pub padding: [u32; 100usize],
3712}
3713#[test]
3714fn bindgen_test_layout__PspDebugRegBlock() {
3715    assert_eq!(::core::mem::size_of::<_PspDebugRegBlock>() , 784usize , concat
3716               ! ( "Size of: " , stringify ! ( _PspDebugRegBlock ) ));
3717    assert_eq! (::core::mem::align_of::<_PspDebugRegBlock>() , 4usize , concat
3718                ! ( "Alignment of " , stringify ! ( _PspDebugRegBlock ) ));
3719    assert_eq! (unsafe {
3720                & ( * ( 0 as * const _PspDebugRegBlock ) ) . frame as * const
3721                _ as usize } , 0usize , concat ! (
3722                "Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
3723                "::" , stringify ! ( frame ) ));
3724    assert_eq! (unsafe {
3725                & ( * ( 0 as * const _PspDebugRegBlock ) ) . r as * const _ as
3726                usize } , 24usize , concat ! (
3727                "Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
3728                "::" , stringify ! ( r ) ));
3729    assert_eq! (unsafe {
3730                & ( * ( 0 as * const _PspDebugRegBlock ) ) . status as * const
3731                _ as usize } , 152usize , concat ! (
3732                "Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
3733                "::" , stringify ! ( status ) ));
3734    assert_eq! (unsafe {
3735                & ( * ( 0 as * const _PspDebugRegBlock ) ) . lo as * const _
3736                as usize } , 156usize , concat ! (
3737                "Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
3738                "::" , stringify ! ( lo ) ));
3739    assert_eq! (unsafe {
3740                & ( * ( 0 as * const _PspDebugRegBlock ) ) . hi as * const _
3741                as usize } , 160usize , concat ! (
3742                "Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
3743                "::" , stringify ! ( hi ) ));
3744    assert_eq! (unsafe {
3745                & ( * ( 0 as * const _PspDebugRegBlock ) ) . badvaddr as *
3746                const _ as usize } , 164usize , concat ! (
3747                "Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
3748                "::" , stringify ! ( badvaddr ) ));
3749    assert_eq! (unsafe {
3750                & ( * ( 0 as * const _PspDebugRegBlock ) ) . cause as * const
3751                _ as usize } , 168usize , concat ! (
3752                "Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
3753                "::" , stringify ! ( cause ) ));
3754    assert_eq! (unsafe {
3755                & ( * ( 0 as * const _PspDebugRegBlock ) ) . epc as * const _
3756                as usize } , 172usize , concat ! (
3757                "Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
3758                "::" , stringify ! ( epc ) ));
3759    assert_eq! (unsafe {
3760                & ( * ( 0 as * const _PspDebugRegBlock ) ) . fpr as * const _
3761                as usize } , 176usize , concat ! (
3762                "Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
3763                "::" , stringify ! ( fpr ) ));
3764    assert_eq! (unsafe {
3765                & ( * ( 0 as * const _PspDebugRegBlock ) ) . fsr as * const _
3766                as usize } , 304usize , concat ! (
3767                "Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
3768                "::" , stringify ! ( fsr ) ));
3769    assert_eq! (unsafe {
3770                & ( * ( 0 as * const _PspDebugRegBlock ) ) . fir as * const _
3771                as usize } , 308usize , concat ! (
3772                "Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
3773                "::" , stringify ! ( fir ) ));
3774    assert_eq! (unsafe {
3775                & ( * ( 0 as * const _PspDebugRegBlock ) ) . frame_ptr as *
3776                const _ as usize } , 312usize , concat ! (
3777                "Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
3778                "::" , stringify ! ( frame_ptr ) ));
3779    assert_eq! (unsafe {
3780                & ( * ( 0 as * const _PspDebugRegBlock ) ) . unused as * const
3781                _ as usize } , 316usize , concat ! (
3782                "Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
3783                "::" , stringify ! ( unused ) ));
3784    assert_eq! (unsafe {
3785                & ( * ( 0 as * const _PspDebugRegBlock ) ) . index as * const
3786                _ as usize } , 320usize , concat ! (
3787                "Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
3788                "::" , stringify ! ( index ) ));
3789    assert_eq! (unsafe {
3790                & ( * ( 0 as * const _PspDebugRegBlock ) ) . random as * const
3791                _ as usize } , 324usize , concat ! (
3792                "Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
3793                "::" , stringify ! ( random ) ));
3794    assert_eq! (unsafe {
3795                & ( * ( 0 as * const _PspDebugRegBlock ) ) . entrylo0 as *
3796                const _ as usize } , 328usize , concat ! (
3797                "Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
3798                "::" , stringify ! ( entrylo0 ) ));
3799    assert_eq! (unsafe {
3800                & ( * ( 0 as * const _PspDebugRegBlock ) ) . entrylo1 as *
3801                const _ as usize } , 332usize , concat ! (
3802                "Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
3803                "::" , stringify ! ( entrylo1 ) ));
3804    assert_eq! (unsafe {
3805                & ( * ( 0 as * const _PspDebugRegBlock ) ) . context as *
3806                const _ as usize } , 336usize , concat ! (
3807                "Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
3808                "::" , stringify ! ( context ) ));
3809    assert_eq! (unsafe {
3810                & ( * ( 0 as * const _PspDebugRegBlock ) ) . pagemask as *
3811                const _ as usize } , 340usize , concat ! (
3812                "Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
3813                "::" , stringify ! ( pagemask ) ));
3814    assert_eq! (unsafe {
3815                & ( * ( 0 as * const _PspDebugRegBlock ) ) . wired as * const
3816                _ as usize } , 344usize , concat ! (
3817                "Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
3818                "::" , stringify ! ( wired ) ));
3819    assert_eq! (unsafe {
3820                & ( * ( 0 as * const _PspDebugRegBlock ) ) . cop0_7 as * const
3821                _ as usize } , 348usize , concat ! (
3822                "Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
3823                "::" , stringify ! ( cop0_7 ) ));
3824    assert_eq! (unsafe {
3825                & ( * ( 0 as * const _PspDebugRegBlock ) ) . cop0_8 as * const
3826                _ as usize } , 352usize , concat ! (
3827                "Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
3828                "::" , stringify ! ( cop0_8 ) ));
3829    assert_eq! (unsafe {
3830                & ( * ( 0 as * const _PspDebugRegBlock ) ) . cop0_9 as * const
3831                _ as usize } , 356usize , concat ! (
3832                "Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
3833                "::" , stringify ! ( cop0_9 ) ));
3834    assert_eq! (unsafe {
3835                & ( * ( 0 as * const _PspDebugRegBlock ) ) . entryhi as *
3836                const _ as usize } , 360usize , concat ! (
3837                "Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
3838                "::" , stringify ! ( entryhi ) ));
3839    assert_eq! (unsafe {
3840                & ( * ( 0 as * const _PspDebugRegBlock ) ) . cop0_11 as *
3841                const _ as usize } , 364usize , concat ! (
3842                "Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
3843                "::" , stringify ! ( cop0_11 ) ));
3844    assert_eq! (unsafe {
3845                & ( * ( 0 as * const _PspDebugRegBlock ) ) . cop0_12 as *
3846                const _ as usize } , 368usize , concat ! (
3847                "Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
3848                "::" , stringify ! ( cop0_12 ) ));
3849    assert_eq! (unsafe {
3850                & ( * ( 0 as * const _PspDebugRegBlock ) ) . cop0_13 as *
3851                const _ as usize } , 372usize , concat ! (
3852                "Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
3853                "::" , stringify ! ( cop0_13 ) ));
3854    assert_eq! (unsafe {
3855                & ( * ( 0 as * const _PspDebugRegBlock ) ) . cop0_14 as *
3856                const _ as usize } , 376usize , concat ! (
3857                "Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
3858                "::" , stringify ! ( cop0_14 ) ));
3859    assert_eq! (unsafe {
3860                & ( * ( 0 as * const _PspDebugRegBlock ) ) . prid as * const _
3861                as usize } , 380usize , concat ! (
3862                "Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
3863                "::" , stringify ! ( prid ) ));
3864    assert_eq! (unsafe {
3865                & ( * ( 0 as * const _PspDebugRegBlock ) ) . padding as *
3866                const _ as usize } , 384usize , concat ! (
3867                "Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
3868                "::" , stringify ! ( padding ) ));
3869}
3870impl Clone for _PspDebugRegBlock {
3871    fn clone(&self) -> Self { *self }
3872}
3873/// Structure to hold the register data associated with an exception
3874pub type PspDebugRegBlock = _PspDebugRegBlock;
3875/// Defines a debug error handler
3876pub type PspDebugErrorHandler =
3877    ::core::option::Option<unsafe extern "C" fn(regs: *mut PspDebugRegBlock)>;
3878extern "C" {
3879    /// Install an error handler to catch unhandled exceptions.
3880///
3881/// @param handler - Pointer to a handler function. If set to NULL it will default
3882/// to resetting the screen and dumping the error.
3883/// @return < 0 on error
3884    pub fn pspDebugInstallErrorHandler(handler: PspDebugErrorHandler)
3885     -> libc::c_int;
3886}
3887extern "C" {
3888    /// Dump an exception to screen using the pspDebugScreen functions.
3889/// @note This function will not setup the screen for debug output, you should call sceDebugScreenInit
3890/// before using it if it isn't already.
3891///
3892/// @param regs - Pointer to a register block.
3893///
3894    pub fn pspDebugDumpException(regs: *mut PspDebugRegBlock);
3895}
3896/// Type for Kprintf handler
3897pub type PspDebugKprintfHandler =
3898    ::core::option::Option<unsafe extern "C" fn(format: *const libc::c_char,
3899                                                args: *mut u32)
3900                               -> libc::c_int>;
3901extern "C" {
3902    /// Install a Kprintf handler into the system.
3903///
3904/// @param handler - Function pointer to the handler.
3905/// @return < 0 on error.
3906    pub fn pspDebugInstallKprintfHandler(handler: PspDebugKprintfHandler)
3907     -> libc::c_int;
3908}
3909/// Structure to hold a single stack trace entry
3910#[repr(C)]
3911#[derive(Debug, Copy)]
3912pub struct _PspDebugStackTrace {
3913    /// The address which called the function
3914    pub call_addr: u32,
3915    /// The address of the function called
3916    pub func_addr: u32,
3917}
3918#[test]
3919fn bindgen_test_layout__PspDebugStackTrace() {
3920    assert_eq!(::core::mem::size_of::<_PspDebugStackTrace>() , 8usize , concat
3921               ! ( "Size of: " , stringify ! ( _PspDebugStackTrace ) ));
3922    assert_eq! (::core::mem::align_of::<_PspDebugStackTrace>() , 4usize ,
3923                concat ! (
3924                "Alignment of " , stringify ! ( _PspDebugStackTrace ) ));
3925    assert_eq! (unsafe {
3926                & ( * ( 0 as * const _PspDebugStackTrace ) ) . call_addr as *
3927                const _ as usize } , 0usize , concat ! (
3928                "Alignment of field: " , stringify ! ( _PspDebugStackTrace ) ,
3929                "::" , stringify ! ( call_addr ) ));
3930    assert_eq! (unsafe {
3931                & ( * ( 0 as * const _PspDebugStackTrace ) ) . func_addr as *
3932                const _ as usize } , 4usize , concat ! (
3933                "Alignment of field: " , stringify ! ( _PspDebugStackTrace ) ,
3934                "::" , stringify ! ( func_addr ) ));
3935}
3936impl Clone for _PspDebugStackTrace {
3937    fn clone(&self) -> Self { *self }
3938}
3939/// Structure to hold a single stack trace entry
3940pub type PspDebugStackTrace = _PspDebugStackTrace;
3941extern "C" {
3942    /// Do a stack trace from the current exception.
3943/// @note This function really isn't too general purpose and it is more than likely to generate a few
3944/// false positives but I consider that better then missing out calls entirely. You have to use your
3945/// discretion, your code and a objdump to work out if some calls are completely surprious or not ;)
3946///
3947/// @param regs - Pointer to a register block from an exception.
3948/// @param trace - Pointer to an array of PspDebugStackTrace structures.
3949/// @param max - The maximum number of traces to make.
3950///
3951/// @return The number of functions found.
3952    pub fn pspDebugGetStackTrace2(regs: *mut PspDebugRegBlock,
3953                                  trace: *mut PspDebugStackTrace,
3954                                  max: libc::c_int) -> libc::c_int;
3955}
3956/// Structure to hold the psp profiler register values
3957#[repr(C)]
3958#[derive(Debug, Copy)]
3959pub struct _PspDebugProfilerRegs {
3960    pub enable: u32,
3961    pub systemck: u32,
3962    pub cpuck: u32,
3963    pub internal: u32,
3964    pub memory: u32,
3965    pub copz: u32,
3966    pub vfpu: u32,
3967    pub sleep: u32,
3968    pub bus_access: u32,
3969    pub uncached_load: u32,
3970    pub uncached_store: u32,
3971    pub cached_load: u32,
3972    pub cached_store: u32,
3973    pub i_miss: u32,
3974    pub d_miss: u32,
3975    pub d_writeback: u32,
3976    pub cop0_inst: u32,
3977    pub fpu_inst: u32,
3978    pub vfpu_inst: u32,
3979    pub local_bus: u32,
3980}
3981#[test]
3982fn bindgen_test_layout__PspDebugProfilerRegs() {
3983    assert_eq!(::core::mem::size_of::<_PspDebugProfilerRegs>() , 80usize ,
3984               concat ! ( "Size of: " , stringify ! ( _PspDebugProfilerRegs )
3985               ));
3986    assert_eq! (::core::mem::align_of::<_PspDebugProfilerRegs>() , 4usize ,
3987                concat ! (
3988                "Alignment of " , stringify ! ( _PspDebugProfilerRegs ) ));
3989    assert_eq! (unsafe {
3990                & ( * ( 0 as * const _PspDebugProfilerRegs ) ) . enable as *
3991                const _ as usize } , 0usize , concat ! (
3992                "Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
3993                , "::" , stringify ! ( enable ) ));
3994    assert_eq! (unsafe {
3995                & ( * ( 0 as * const _PspDebugProfilerRegs ) ) . systemck as *
3996                const _ as usize } , 4usize , concat ! (
3997                "Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
3998                , "::" , stringify ! ( systemck ) ));
3999    assert_eq! (unsafe {
4000                & ( * ( 0 as * const _PspDebugProfilerRegs ) ) . cpuck as *
4001                const _ as usize } , 8usize , concat ! (
4002                "Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
4003                , "::" , stringify ! ( cpuck ) ));
4004    assert_eq! (unsafe {
4005                & ( * ( 0 as * const _PspDebugProfilerRegs ) ) . internal as *
4006                const _ as usize } , 12usize , concat ! (
4007                "Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
4008                , "::" , stringify ! ( internal ) ));
4009    assert_eq! (unsafe {
4010                & ( * ( 0 as * const _PspDebugProfilerRegs ) ) . memory as *
4011                const _ as usize } , 16usize , concat ! (
4012                "Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
4013                , "::" , stringify ! ( memory ) ));
4014    assert_eq! (unsafe {
4015                & ( * ( 0 as * const _PspDebugProfilerRegs ) ) . copz as *
4016                const _ as usize } , 20usize , concat ! (
4017                "Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
4018                , "::" , stringify ! ( copz ) ));
4019    assert_eq! (unsafe {
4020                & ( * ( 0 as * const _PspDebugProfilerRegs ) ) . vfpu as *
4021                const _ as usize } , 24usize , concat ! (
4022                "Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
4023                , "::" , stringify ! ( vfpu ) ));
4024    assert_eq! (unsafe {
4025                & ( * ( 0 as * const _PspDebugProfilerRegs ) ) . sleep as *
4026                const _ as usize } , 28usize , concat ! (
4027                "Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
4028                , "::" , stringify ! ( sleep ) ));
4029    assert_eq! (unsafe {
4030                & ( * ( 0 as * const _PspDebugProfilerRegs ) ) . bus_access as
4031                * const _ as usize } , 32usize , concat ! (
4032                "Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
4033                , "::" , stringify ! ( bus_access ) ));
4034    assert_eq! (unsafe {
4035                & ( * ( 0 as * const _PspDebugProfilerRegs ) ) . uncached_load
4036                as * const _ as usize } , 36usize , concat ! (
4037                "Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
4038                , "::" , stringify ! ( uncached_load ) ));
4039    assert_eq! (unsafe {
4040                & ( * ( 0 as * const _PspDebugProfilerRegs ) ) .
4041                uncached_store as * const _ as usize } , 40usize , concat ! (
4042                "Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
4043                , "::" , stringify ! ( uncached_store ) ));
4044    assert_eq! (unsafe {
4045                & ( * ( 0 as * const _PspDebugProfilerRegs ) ) . cached_load
4046                as * const _ as usize } , 44usize , concat ! (
4047                "Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
4048                , "::" , stringify ! ( cached_load ) ));
4049    assert_eq! (unsafe {
4050                & ( * ( 0 as * const _PspDebugProfilerRegs ) ) . cached_store
4051                as * const _ as usize } , 48usize , concat ! (
4052                "Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
4053                , "::" , stringify ! ( cached_store ) ));
4054    assert_eq! (unsafe {
4055                & ( * ( 0 as * const _PspDebugProfilerRegs ) ) . i_miss as *
4056                const _ as usize } , 52usize , concat ! (
4057                "Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
4058                , "::" , stringify ! ( i_miss ) ));
4059    assert_eq! (unsafe {
4060                & ( * ( 0 as * const _PspDebugProfilerRegs ) ) . d_miss as *
4061                const _ as usize } , 56usize , concat ! (
4062                "Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
4063                , "::" , stringify ! ( d_miss ) ));
4064    assert_eq! (unsafe {
4065                & ( * ( 0 as * const _PspDebugProfilerRegs ) ) . d_writeback
4066                as * const _ as usize } , 60usize , concat ! (
4067                "Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
4068                , "::" , stringify ! ( d_writeback ) ));
4069    assert_eq! (unsafe {
4070                & ( * ( 0 as * const _PspDebugProfilerRegs ) ) . cop0_inst as
4071                * const _ as usize } , 64usize , concat ! (
4072                "Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
4073                , "::" , stringify ! ( cop0_inst ) ));
4074    assert_eq! (unsafe {
4075                & ( * ( 0 as * const _PspDebugProfilerRegs ) ) . fpu_inst as *
4076                const _ as usize } , 68usize , concat ! (
4077                "Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
4078                , "::" , stringify ! ( fpu_inst ) ));
4079    assert_eq! (unsafe {
4080                & ( * ( 0 as * const _PspDebugProfilerRegs ) ) . vfpu_inst as
4081                * const _ as usize } , 72usize , concat ! (
4082                "Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
4083                , "::" , stringify ! ( vfpu_inst ) ));
4084    assert_eq! (unsafe {
4085                & ( * ( 0 as * const _PspDebugProfilerRegs ) ) . local_bus as
4086                * const _ as usize } , 76usize , concat ! (
4087                "Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
4088                , "::" , stringify ! ( local_bus ) ));
4089}
4090impl Clone for _PspDebugProfilerRegs {
4091    fn clone(&self) -> Self { *self }
4092}
4093/// Structure to hold the psp profiler register values
4094pub type PspDebugProfilerRegs = _PspDebugProfilerRegs;
4095extern "C" {
4096    /// Enables the profiler hardware
4097    pub fn pspDebugProfilerEnable();
4098}
4099extern "C" {
4100    /// Disables the profiler hardware
4101    pub fn pspDebugProfilerDisable();
4102}
4103extern "C" {
4104    /// Clear the profiler registers
4105    pub fn pspDebugProfilerClear();
4106}
4107extern "C" {
4108    /// Get the profiler register state
4109///
4110/// @param regs - A pointer to a PspDebugProfilerRegs structure.
4111    pub fn pspDebugProfilerGetRegs(regs: *mut PspDebugProfilerRegs);
4112}
4113extern "C" {
4114    /// Print the profiler registers to screen
4115    pub fn pspDebugProfilerPrint();
4116}
4117/// Type for the debug print handlers
4118pub type PspDebugPrintHandler =
4119    ::core::option::Option<unsafe extern "C" fn(data: *const libc::c_char,
4120                                                len: libc::c_int)
4121                               -> libc::c_int>;
4122/// Type for the debug input handler
4123pub type PspDebugInputHandler =
4124    ::core::option::Option<unsafe extern "C" fn(data: *mut libc::c_char,
4125                                                len: libc::c_int)
4126                               -> libc::c_int>;
4127extern "C" {
4128    /// Install a handler for stdin (so you can use normal stdio functions)
4129///
4130/// @param handler - A pointer to input handler, NULL to disable.
4131///
4132/// @return < 0 on error, else 0.
4133    pub fn pspDebugInstallStdinHandler(handler: PspDebugInputHandler)
4134     -> libc::c_int;
4135}
4136extern "C" {
4137    /// Install a print handler for stdout (so you can use normal print functions)
4138///
4139/// @param handler - A pointer to print handler, NULL to disable.
4140///
4141/// @return < 0 on error, else 0.
4142    pub fn pspDebugInstallStdoutHandler(handler: PspDebugPrintHandler)
4143     -> libc::c_int;
4144}
4145extern "C" {
4146    /// Install a print handler for stderr (so you can use normal print functions)
4147///
4148/// @param handler - A pointer to print handler, NULL to disable.
4149///
4150/// @return < 0 on error, else 0.
4151    pub fn pspDebugInstallStderrHandler(handler: PspDebugPrintHandler)
4152     -> libc::c_int;
4153}
4154extern "C" {
4155    /// Put a character to the remote sio.
4156///
4157/// @param ch - Character to write.
4158    pub fn pspDebugSioPutchar(ch: libc::c_int);
4159}
4160extern "C" {
4161    /// Get a character from the remote sio
4162///
4163/// @return The character read or -1 if no characters available.
4164    pub fn pspDebugSioGetchar() -> libc::c_int;
4165}
4166extern "C" {
4167    /// Write a string to the sio port.
4168///
4169/// @param str - String to write.
4170    pub fn pspDebugSioPuts(str: *const libc::c_char);
4171}
4172extern "C" {
4173    /// Write a set of data to the sio port
4174///
4175/// @param data - Pointer to the data to send.
4176/// @param len - Length of the data.
4177///
4178/// @return Number of characters written.
4179    pub fn pspDebugSioPutData(data: *const libc::c_char, len: libc::c_int)
4180     -> libc::c_int;
4181}
4182extern "C" {
4183    /// Write a set of data to the sio port converting single
4184/// line feeds to CRLF and single CR to CRLF
4185///
4186/// @param data - Pointer to the data to send.
4187/// @param len - Length of the data.
4188///
4189/// @return Number of characters written.
4190    pub fn pspDebugSioPutText(data: *const libc::c_char, len: libc::c_int)
4191     -> libc::c_int;
4192}
4193extern "C" {
4194    /// Initialise the remote SIO port (defaults to 4800 8N1).
4195/// @note will delay 2 seconds to wait for the power to come up.
4196    pub fn pspDebugSioInit();
4197}
4198extern "C" {
4199    /// Set the baud rate of the SIO, e.g. 4800/9600..115200.
4200/// @param baud - The baudrate to set.
4201    pub fn pspDebugSioSetBaud(baud: libc::c_int);
4202}
4203extern "C" {
4204    /// Enable debug character output. Needs to be called in order
4205/// for the default Kprintf handler to work.
4206    pub fn pspDebugEnablePutchar();
4207}
4208extern "C" {
4209    /// Install a kprintf debug putchar handler. Implicitly calls ::pspDebugEnablePutchar
4210/// so you do not need to call it explicitly. Sio must be initialised before calling
4211/// this function however.
4212    pub fn pspDebugSioInstallKprintf();
4213}
4214extern "C" {
4215    /// Install the gdb stub handler.
4216    pub fn pspDebugGdbStubInit();
4217}
4218extern "C" {
4219    /// Generate a breakpoint exception.
4220    pub fn pspDebugBreakpoint();
4221}
4222extern "C" {
4223    /// Enable the kprintf handler (once installed)
4224    pub fn pspDebugSioEnableKprintf();
4225}
4226extern "C" {
4227    /// Disable the kprintf handler (once installed)
4228    pub fn pspDebugSioDisableKprintf();
4229}
4230/// 64-bit system clock type.
4231#[repr(C)]
4232#[derive(Debug, Copy)]
4233pub struct SceKernelSysClock {
4234    pub low: SceUInt32,
4235    pub hi: SceUInt32,
4236}
4237#[test]
4238fn bindgen_test_layout_SceKernelSysClock() {
4239    assert_eq!(::core::mem::size_of::<SceKernelSysClock>() , 8usize , concat !
4240               ( "Size of: " , stringify ! ( SceKernelSysClock ) ));
4241    assert_eq! (::core::mem::align_of::<SceKernelSysClock>() , 4usize , concat
4242                ! ( "Alignment of " , stringify ! ( SceKernelSysClock ) ));
4243    assert_eq! (unsafe {
4244                & ( * ( 0 as * const SceKernelSysClock ) ) . low as * const _
4245                as usize } , 0usize , concat ! (
4246                "Alignment of field: " , stringify ! ( SceKernelSysClock ) ,
4247                "::" , stringify ! ( low ) ));
4248    assert_eq! (unsafe {
4249                & ( * ( 0 as * const SceKernelSysClock ) ) . hi as * const _
4250                as usize } , 4usize , concat ! (
4251                "Alignment of field: " , stringify ! ( SceKernelSysClock ) ,
4252                "::" , stringify ! ( hi ) ));
4253}
4254impl Clone for SceKernelSysClock {
4255    fn clone(&self) -> Self { *self }
4256}
4257#[repr(u32)]
4258/// Attribute for threads.
4259#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
4260pub enum PspThreadAttributes {
4261    PSP_THREAD_ATTR_VFPU = 16384,
4262    PSP_THREAD_ATTR_USER = 2147483648,
4263    PSP_THREAD_ATTR_USBWLAN = 2684354560,
4264    PSP_THREAD_ATTR_VSH = 3221225472,
4265    PSP_THREAD_ATTR_SCRATCH_SRAM = 32768,
4266    PSP_THREAD_ATTR_NO_FILLSTACK = 1048576,
4267    PSP_THREAD_ATTR_CLEAR_STACK = 2097152,
4268}
4269pub type SceKernelThreadEntry =
4270    ::core::option::Option<unsafe extern "C" fn(args: SceSize,
4271                                                argp: *mut libc::c_void)
4272                               -> libc::c_int>;
4273/// Additional options used when creating threads.
4274#[repr(C)]
4275#[derive(Debug, Copy)]
4276pub struct SceKernelThreadOptParam {
4277    /// Size of the ::SceKernelThreadOptParam structure.
4278    pub size: SceSize,
4279    /// UID of the memory block (?) allocated for the thread's stack.
4280    pub stackMpid: SceUID,
4281}
4282#[test]
4283fn bindgen_test_layout_SceKernelThreadOptParam() {
4284    assert_eq!(::core::mem::size_of::<SceKernelThreadOptParam>() , 8usize ,
4285               concat ! (
4286               "Size of: " , stringify ! ( SceKernelThreadOptParam ) ));
4287    assert_eq! (::core::mem::align_of::<SceKernelThreadOptParam>() , 4usize ,
4288                concat ! (
4289                "Alignment of " , stringify ! ( SceKernelThreadOptParam ) ));
4290    assert_eq! (unsafe {
4291                & ( * ( 0 as * const SceKernelThreadOptParam ) ) . size as *
4292                const _ as usize } , 0usize , concat ! (
4293                "Alignment of field: " , stringify ! ( SceKernelThreadOptParam
4294                ) , "::" , stringify ! ( size ) ));
4295    assert_eq! (unsafe {
4296                & ( * ( 0 as * const SceKernelThreadOptParam ) ) . stackMpid
4297                as * const _ as usize } , 4usize , concat ! (
4298                "Alignment of field: " , stringify ! ( SceKernelThreadOptParam
4299                ) , "::" , stringify ! ( stackMpid ) ));
4300}
4301impl Clone for SceKernelThreadOptParam {
4302    fn clone(&self) -> Self { *self }
4303}
4304/// Structure to hold the status information for a thread
4305/// @see sceKernelReferThreadStatus
4306#[repr(C)]
4307#[derive(Debug, Copy)]
4308pub struct SceKernelThreadInfo {
4309    /// Size of the structure
4310    pub size: SceSize,
4311    /// Nul terminated name of the thread
4312    pub name: [libc::c_char; 32usize],
4313    /// Thread attributes
4314    pub attr: SceUInt,
4315    /// Thread status
4316    pub status: libc::c_int,
4317    /// Thread entry point
4318    pub entry: SceKernelThreadEntry,
4319    /// Thread stack pointer
4320    pub stack: *mut libc::c_void,
4321    /// Thread stack size
4322    pub stackSize: libc::c_int,
4323    /// Pointer to the gp
4324    pub gpReg: *mut libc::c_void,
4325    /// Initial priority
4326    pub initPriority: libc::c_int,
4327    /// Current priority
4328    pub currentPriority: libc::c_int,
4329    /// Wait type
4330    pub waitType: libc::c_int,
4331    /// Wait id
4332    pub waitId: SceUID,
4333    /// Wakeup count
4334    pub wakeupCount: libc::c_int,
4335    /// Exit status of the thread
4336    pub exitStatus: libc::c_int,
4337    /// Number of clock cycles run
4338    pub runClocks: SceKernelSysClock,
4339    /// Interrupt preemption count
4340    pub intrPreemptCount: SceUInt,
4341    /// Thread preemption count
4342    pub threadPreemptCount: SceUInt,
4343    /// Release count
4344    pub releaseCount: SceUInt,
4345}
4346#[test]
4347fn bindgen_test_layout_SceKernelThreadInfo() {
4348    assert_eq!(::core::mem::size_of::<SceKernelThreadInfo>() , 128usize ,
4349               concat ! ( "Size of: " , stringify ! ( SceKernelThreadInfo )
4350               ));
4351    assert_eq! (::core::mem::align_of::<SceKernelThreadInfo>() , 8usize ,
4352                concat ! (
4353                "Alignment of " , stringify ! ( SceKernelThreadInfo ) ));
4354    assert_eq! (unsafe {
4355                & ( * ( 0 as * const SceKernelThreadInfo ) ) . size as * const
4356                _ as usize } , 0usize , concat ! (
4357                "Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
4358                "::" , stringify ! ( size ) ));
4359    assert_eq! (unsafe {
4360                & ( * ( 0 as * const SceKernelThreadInfo ) ) . name as * const
4361                _ as usize } , 4usize , concat ! (
4362                "Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
4363                "::" , stringify ! ( name ) ));
4364    assert_eq! (unsafe {
4365                & ( * ( 0 as * const SceKernelThreadInfo ) ) . attr as * const
4366                _ as usize } , 36usize , concat ! (
4367                "Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
4368                "::" , stringify ! ( attr ) ));
4369    assert_eq! (unsafe {
4370                & ( * ( 0 as * const SceKernelThreadInfo ) ) . status as *
4371                const _ as usize } , 40usize , concat ! (
4372                "Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
4373                "::" , stringify ! ( status ) ));
4374    assert_eq! (unsafe {
4375                & ( * ( 0 as * const SceKernelThreadInfo ) ) . entry as *
4376                const _ as usize } , 48usize , concat ! (
4377                "Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
4378                "::" , stringify ! ( entry ) ));
4379    assert_eq! (unsafe {
4380                & ( * ( 0 as * const SceKernelThreadInfo ) ) . stack as *
4381                const _ as usize } , 56usize , concat ! (
4382                "Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
4383                "::" , stringify ! ( stack ) ));
4384    assert_eq! (unsafe {
4385                & ( * ( 0 as * const SceKernelThreadInfo ) ) . stackSize as *
4386                const _ as usize } , 64usize , concat ! (
4387                "Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
4388                "::" , stringify ! ( stackSize ) ));
4389    assert_eq! (unsafe {
4390                & ( * ( 0 as * const SceKernelThreadInfo ) ) . gpReg as *
4391                const _ as usize } , 72usize , concat ! (
4392                "Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
4393                "::" , stringify ! ( gpReg ) ));
4394    assert_eq! (unsafe {
4395                & ( * ( 0 as * const SceKernelThreadInfo ) ) . initPriority as
4396                * const _ as usize } , 80usize , concat ! (
4397                "Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
4398                "::" , stringify ! ( initPriority ) ));
4399    assert_eq! (unsafe {
4400                & ( * ( 0 as * const SceKernelThreadInfo ) ) . currentPriority
4401                as * const _ as usize } , 84usize , concat ! (
4402                "Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
4403                "::" , stringify ! ( currentPriority ) ));
4404    assert_eq! (unsafe {
4405                & ( * ( 0 as * const SceKernelThreadInfo ) ) . waitType as *
4406                const _ as usize } , 88usize , concat ! (
4407                "Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
4408                "::" , stringify ! ( waitType ) ));
4409    assert_eq! (unsafe {
4410                & ( * ( 0 as * const SceKernelThreadInfo ) ) . waitId as *
4411                const _ as usize } , 92usize , concat ! (
4412                "Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
4413                "::" , stringify ! ( waitId ) ));
4414    assert_eq! (unsafe {
4415                & ( * ( 0 as * const SceKernelThreadInfo ) ) . wakeupCount as
4416                * const _ as usize } , 96usize , concat ! (
4417                "Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
4418                "::" , stringify ! ( wakeupCount ) ));
4419    assert_eq! (unsafe {
4420                & ( * ( 0 as * const SceKernelThreadInfo ) ) . exitStatus as *
4421                const _ as usize } , 100usize , concat ! (
4422                "Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
4423                "::" , stringify ! ( exitStatus ) ));
4424    assert_eq! (unsafe {
4425                & ( * ( 0 as * const SceKernelThreadInfo ) ) . runClocks as *
4426                const _ as usize } , 104usize , concat ! (
4427                "Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
4428                "::" , stringify ! ( runClocks ) ));
4429    assert_eq! (unsafe {
4430                & ( * ( 0 as * const SceKernelThreadInfo ) ) .
4431                intrPreemptCount as * const _ as usize } , 112usize , concat !
4432                (
4433                "Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
4434                "::" , stringify ! ( intrPreemptCount ) ));
4435    assert_eq! (unsafe {
4436                & ( * ( 0 as * const SceKernelThreadInfo ) ) .
4437                threadPreemptCount as * const _ as usize } , 116usize , concat
4438                ! (
4439                "Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
4440                "::" , stringify ! ( threadPreemptCount ) ));
4441    assert_eq! (unsafe {
4442                & ( * ( 0 as * const SceKernelThreadInfo ) ) . releaseCount as
4443                * const _ as usize } , 120usize , concat ! (
4444                "Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
4445                "::" , stringify ! ( releaseCount ) ));
4446}
4447impl Clone for SceKernelThreadInfo {
4448    fn clone(&self) -> Self { *self }
4449}
4450/// Statistics about a running thread.
4451/// @see sceKernelReferThreadRunStatus.
4452#[repr(C)]
4453#[derive(Debug, Copy)]
4454pub struct SceKernelThreadRunStatus {
4455    pub size: SceSize,
4456    pub status: libc::c_int,
4457    pub currentPriority: libc::c_int,
4458    pub waitType: libc::c_int,
4459    pub waitId: libc::c_int,
4460    pub wakeupCount: libc::c_int,
4461    pub runClocks: SceKernelSysClock,
4462    pub intrPreemptCount: SceUInt,
4463    pub threadPreemptCount: SceUInt,
4464    pub releaseCount: SceUInt,
4465}
4466#[test]
4467fn bindgen_test_layout_SceKernelThreadRunStatus() {
4468    assert_eq!(::core::mem::size_of::<SceKernelThreadRunStatus>() , 44usize ,
4469               concat ! (
4470               "Size of: " , stringify ! ( SceKernelThreadRunStatus ) ));
4471    assert_eq! (::core::mem::align_of::<SceKernelThreadRunStatus>() , 4usize ,
4472                concat ! (
4473                "Alignment of " , stringify ! ( SceKernelThreadRunStatus ) ));
4474    assert_eq! (unsafe {
4475                & ( * ( 0 as * const SceKernelThreadRunStatus ) ) . size as *
4476                const _ as usize } , 0usize , concat ! (
4477                "Alignment of field: " , stringify ! (
4478                SceKernelThreadRunStatus ) , "::" , stringify ! ( size ) ));
4479    assert_eq! (unsafe {
4480                & ( * ( 0 as * const SceKernelThreadRunStatus ) ) . status as
4481                * const _ as usize } , 4usize , concat ! (
4482                "Alignment of field: " , stringify ! (
4483                SceKernelThreadRunStatus ) , "::" , stringify ! ( status ) ));
4484    assert_eq! (unsafe {
4485                & ( * ( 0 as * const SceKernelThreadRunStatus ) ) .
4486                currentPriority as * const _ as usize } , 8usize , concat ! (
4487                "Alignment of field: " , stringify ! (
4488                SceKernelThreadRunStatus ) , "::" , stringify ! (
4489                currentPriority ) ));
4490    assert_eq! (unsafe {
4491                & ( * ( 0 as * const SceKernelThreadRunStatus ) ) . waitType
4492                as * const _ as usize } , 12usize , concat ! (
4493                "Alignment of field: " , stringify ! (
4494                SceKernelThreadRunStatus ) , "::" , stringify ! ( waitType )
4495                ));
4496    assert_eq! (unsafe {
4497                & ( * ( 0 as * const SceKernelThreadRunStatus ) ) . waitId as
4498                * const _ as usize } , 16usize , concat ! (
4499                "Alignment of field: " , stringify ! (
4500                SceKernelThreadRunStatus ) , "::" , stringify ! ( waitId ) ));
4501    assert_eq! (unsafe {
4502                & ( * ( 0 as * const SceKernelThreadRunStatus ) ) .
4503                wakeupCount as * const _ as usize } , 20usize , concat ! (
4504                "Alignment of field: " , stringify ! (
4505                SceKernelThreadRunStatus ) , "::" , stringify ! ( wakeupCount
4506                ) ));
4507    assert_eq! (unsafe {
4508                & ( * ( 0 as * const SceKernelThreadRunStatus ) ) . runClocks
4509                as * const _ as usize } , 24usize , concat ! (
4510                "Alignment of field: " , stringify ! (
4511                SceKernelThreadRunStatus ) , "::" , stringify ! ( runClocks )
4512                ));
4513    assert_eq! (unsafe {
4514                & ( * ( 0 as * const SceKernelThreadRunStatus ) ) .
4515                intrPreemptCount as * const _ as usize } , 32usize , concat !
4516                (
4517                "Alignment of field: " , stringify ! (
4518                SceKernelThreadRunStatus ) , "::" , stringify ! (
4519                intrPreemptCount ) ));
4520    assert_eq! (unsafe {
4521                & ( * ( 0 as * const SceKernelThreadRunStatus ) ) .
4522                threadPreemptCount as * const _ as usize } , 36usize , concat
4523                ! (
4524                "Alignment of field: " , stringify ! (
4525                SceKernelThreadRunStatus ) , "::" , stringify ! (
4526                threadPreemptCount ) ));
4527    assert_eq! (unsafe {
4528                & ( * ( 0 as * const SceKernelThreadRunStatus ) ) .
4529                releaseCount as * const _ as usize } , 40usize , concat ! (
4530                "Alignment of field: " , stringify ! (
4531                SceKernelThreadRunStatus ) , "::" , stringify ! ( releaseCount
4532                ) ));
4533}
4534impl Clone for SceKernelThreadRunStatus {
4535    fn clone(&self) -> Self { *self }
4536}
4537#[repr(u32)]
4538#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
4539pub enum PspThreadStatus {
4540    PSP_THREAD_RUNNING = 1,
4541    PSP_THREAD_READY = 2,
4542    PSP_THREAD_WAITING = 4,
4543    PSP_THREAD_SUSPEND = 8,
4544    PSP_THREAD_STOPPED = 16,
4545    PSP_THREAD_KILLED = 32,
4546}
4547extern "C" {
4548    /// Create a thread
4549///
4550/// @par Example:
4551/// @code
4552/// SceUID thid;
4553/// thid = sceKernelCreateThread("my_thread", threadFunc, 0x18, 0x10000, 0, NULL);
4554/// @endcode
4555///
4556/// @param name - An arbitrary thread name.
4557/// @param entry - The thread function to run when started.
4558/// @param initPriority - The initial priority of the thread. Less if higher priority.
4559/// @param stackSize - The size of the initial stack.
4560/// @param attr - The thread attributes, zero or more of ::PspThreadAttributes.
4561/// @param option - Additional options specified by ::SceKernelThreadOptParam.
4562///
4563/// @return UID of the created thread, or an error code.
4564    pub fn sceKernelCreateThread(name: *const libc::c_char,
4565                                 entry: SceKernelThreadEntry,
4566                                 initPriority: libc::c_int,
4567                                 stackSize: libc::c_int, attr: SceUInt,
4568                                 option: *mut SceKernelThreadOptParam)
4569     -> SceUID;
4570}
4571extern "C" {
4572    /// Delate a thread
4573///
4574/// @param thid - UID of the thread to be deleted.
4575///
4576/// @return < 0 on error.
4577    pub fn sceKernelDeleteThread(thid: SceUID) -> libc::c_int;
4578}
4579extern "C" {
4580    /// Start a created thread
4581///
4582/// @param thid - Thread id from sceKernelCreateThread
4583/// @param arglen - Length of the data pointed to by argp, in bytes
4584/// @param argp - Pointer to the arguments.
4585    pub fn sceKernelStartThread(thid: SceUID, arglen: SceSize,
4586                                argp: *mut libc::c_void) -> libc::c_int;
4587}
4588extern "C" {
4589    /// Exit a thread
4590///
4591/// @param status - Exit status.
4592    pub fn sceKernelExitThread(status: libc::c_int) -> libc::c_int;
4593}
4594extern "C" {
4595    /// Exit a thread and delete itself.
4596///
4597/// @param status - Exit status
4598    pub fn sceKernelExitDeleteThread(status: libc::c_int) -> libc::c_int;
4599}
4600extern "C" {
4601    /// Terminate a thread.
4602///
4603/// @param thid - UID of the thread to terminate.
4604///
4605/// @return Success if >= 0, an error if < 0.
4606    pub fn sceKernelTerminateThread(thid: SceUID) -> libc::c_int;
4607}
4608extern "C" {
4609    /// Terminate and delete a thread.
4610///
4611/// @param thid - UID of the thread to terminate and delete.
4612///
4613/// @return Success if >= 0, an error if < 0.
4614    pub fn sceKernelTerminateDeleteThread(thid: SceUID) -> libc::c_int;
4615}
4616extern "C" {
4617    /// Suspend the dispatch thread
4618///
4619/// @return The current state of the dispatch thread, < 0 on error
4620    pub fn sceKernelSuspendDispatchThread() -> libc::c_int;
4621}
4622extern "C" {
4623    /// Resume the dispatch thread
4624///
4625/// @param state - The state of the dispatch thread
4626/// (from ::sceKernelSuspendDispatchThread)
4627///
4628/// @return 0 on success, < 0 on error
4629    pub fn sceKernelResumeDispatchThread(state: libc::c_int) -> libc::c_int;
4630}
4631extern "C" {
4632    /// Sleep thread
4633///
4634/// @return < 0 on error.
4635    pub fn sceKernelSleepThread() -> libc::c_int;
4636}
4637extern "C" {
4638    /// Sleep thread but service any callbacks as necessary
4639///
4640/// @par Example:
4641/// @code
4642/// // Once all callbacks have been setup call this function
4643/// sceKernelSleepThreadCB();
4644/// @endcode
4645    pub fn sceKernelSleepThreadCB() -> libc::c_int;
4646}
4647extern "C" {
4648    /// Wake a thread previously put into the sleep state.
4649///
4650/// @param thid - UID of the thread to wake.
4651///
4652/// @return Success if >= 0, an error if < 0.
4653    pub fn sceKernelWakeupThread(thid: SceUID) -> libc::c_int;
4654}
4655extern "C" {
4656    /// Cancel a thread that was to be woken with ::sceKernelWakeupThread.
4657///
4658/// @param thid - UID of the thread to cancel.
4659///
4660/// @return Success if >= 0, an error if < 0.
4661    pub fn sceKernelCancelWakeupThread(thid: SceUID) -> libc::c_int;
4662}
4663extern "C" {
4664    /// Suspend a thread.
4665///
4666/// @param thid - UID of the thread to suspend.
4667///
4668/// @return Success if >= 0, an error if < 0.
4669    pub fn sceKernelSuspendThread(thid: SceUID) -> libc::c_int;
4670}
4671extern "C" {
4672    /// Resume a thread previously put into a suspended state with ::sceKernelSuspendThread.
4673///
4674/// @param thid - UID of the thread to resume.
4675///
4676/// @return Success if >= 0, an error if < 0.
4677    pub fn sceKernelResumeThread(thid: SceUID) -> libc::c_int;
4678}
4679extern "C" {
4680    /// Wait until a thread has ended.
4681///
4682/// @param thid - Id of the thread to wait for.
4683/// @param timeout - Timeout in microseconds (assumed).
4684///
4685/// @return < 0 on error.
4686    pub fn sceKernelWaitThreadEnd(thid: SceUID, timeout: *mut SceUInt)
4687     -> libc::c_int;
4688}
4689extern "C" {
4690    /// Wait until a thread has ended and handle callbacks if necessary.
4691///
4692/// @param thid - Id of the thread to wait for.
4693/// @param timeout - Timeout in microseconds (assumed).
4694///
4695/// @return < 0 on error.
4696    pub fn sceKernelWaitThreadEndCB(thid: SceUID, timeout: *mut SceUInt)
4697     -> libc::c_int;
4698}
4699extern "C" {
4700    /// Delay the current thread by a specified number of microseconds
4701///
4702/// @param delay - Delay in microseconds.
4703///
4704/// @par Example:
4705/// @code
4706/// sceKernelDelayThread(1000000); // Delay for a second
4707/// @endcode
4708    pub fn sceKernelDelayThread(delay: SceUInt) -> libc::c_int;
4709}
4710extern "C" {
4711    /// Delay the current thread by a specified number of microseconds and handle any callbacks.
4712///
4713/// @param delay - Delay in microseconds.
4714///
4715/// @par Example:
4716/// @code
4717/// sceKernelDelayThread(1000000); // Delay for a second
4718/// @endcode
4719    pub fn sceKernelDelayThreadCB(delay: SceUInt) -> libc::c_int;
4720}
4721extern "C" {
4722    /// Delay the current thread by a specified number of sysclocks
4723///
4724/// @param delay - Delay in sysclocks
4725///
4726/// @return 0 on success, < 0 on error
4727    pub fn sceKernelDelaySysClockThread(delay: *mut SceKernelSysClock)
4728     -> libc::c_int;
4729}
4730extern "C" {
4731    /// Delay the current thread by a specified number of sysclocks handling callbacks
4732///
4733/// @param delay - Delay in sysclocks
4734///
4735/// @return 0 on success, < 0 on error
4736///
4737    pub fn sceKernelDelaySysClockThreadCB(delay: *mut SceKernelSysClock)
4738     -> libc::c_int;
4739}
4740extern "C" {
4741    /// Modify the attributes of the current thread.
4742///
4743/// @param unknown - Set to 0.
4744/// @param attr - The thread attributes to modify.  One of ::PspThreadAttributes.
4745///
4746/// @return < 0 on error.
4747    pub fn sceKernelChangeCurrentThreadAttr(unknown: libc::c_int,
4748                                            attr: SceUInt) -> libc::c_int;
4749}
4750extern "C" {
4751    /// Change the threads current priority.
4752///
4753/// @param thid - The ID of the thread (from sceKernelCreateThread or sceKernelGetThreadId)
4754/// @param priority - The new priority (the lower the number the higher the priority)
4755///
4756/// @par Example:
4757/// @code
4758/// int thid = sceKernelGetThreadId();
4759/// // Change priority of current thread to 16
4760/// sceKernelChangeThreadPriority(thid, 16);
4761/// @endcode
4762///
4763/// @return 0 if successful, otherwise the error code.
4764    pub fn sceKernelChangeThreadPriority(thid: SceUID, priority: libc::c_int)
4765     -> libc::c_int;
4766}
4767extern "C" {
4768    /// Rotate thread ready queue at a set priority
4769///
4770/// @param priority - The priority of the queue
4771///
4772/// @return 0 on success, < 0 on error.
4773    pub fn sceKernelRotateThreadReadyQueue(priority: libc::c_int)
4774     -> libc::c_int;
4775}
4776extern "C" {
4777    /// Release a thread in the wait state.
4778///
4779/// @param thid - The UID of the thread.
4780///
4781/// @return 0 on success, < 0 on error
4782    pub fn sceKernelReleaseWaitThread(thid: SceUID) -> libc::c_int;
4783}
4784extern "C" {
4785    /// Get the current thread Id
4786///
4787/// @return The thread id of the calling thread.
4788    pub fn sceKernelGetThreadId() -> libc::c_int;
4789}
4790extern "C" {
4791    /// Get the current priority of the thread you are in.
4792///
4793/// @return The current thread priority
4794    pub fn sceKernelGetThreadCurrentPriority() -> libc::c_int;
4795}
4796extern "C" {
4797    /// Get the exit status of a thread.
4798///
4799/// @param thid - The UID of the thread to check.
4800///
4801/// @return The exit status
4802    pub fn sceKernelGetThreadExitStatus(thid: SceUID) -> libc::c_int;
4803}
4804extern "C" {
4805    /// Check the thread stack?
4806///
4807/// @return Unknown.
4808    pub fn sceKernelCheckThreadStack() -> libc::c_int;
4809}
4810extern "C" {
4811    /// Get the free stack size for a thread.
4812///
4813/// @param thid - The thread ID. Seem to take current thread
4814/// if set to 0.
4815///
4816/// @return The free size.
4817    pub fn sceKernelGetThreadStackFreeSize(thid: SceUID) -> libc::c_int;
4818}
4819extern "C" {
4820    /// Get the status information for the specified thread.
4821///
4822/// @param thid - Id of the thread to get status
4823/// @param info - Pointer to the info structure to receive the data.
4824/// Note: The structures size field should be set to
4825/// sizeof(SceKernelThreadInfo) before calling this function.
4826///
4827/// @par Example:
4828/// @code
4829/// SceKernelThreadInfo status;
4830/// status.size = sizeof(SceKernelThreadInfo);
4831/// if(sceKernelReferThreadStatus(thid, &status) == 0)
4832/// { Do something... }
4833/// @endcode
4834/// @return 0 if successful, otherwise the error code.
4835    pub fn sceKernelReferThreadStatus(thid: SceUID,
4836                                      info: *mut SceKernelThreadInfo)
4837     -> libc::c_int;
4838}
4839extern "C" {
4840    /// Retrive the runtime status of a thread.
4841///
4842/// @param thid - UID of the thread to retrive status.
4843/// @param status - Pointer to a ::SceKernelThreadRunStatus struct to receive the runtime status.
4844///
4845/// @return 0 if successful, otherwise the error code.
4846    pub fn sceKernelReferThreadRunStatus(thid: SceUID,
4847                                         status:
4848                                             *mut SceKernelThreadRunStatus)
4849     -> libc::c_int;
4850}
4851/// Additional options used when creating semaphores.
4852#[repr(C)]
4853#[derive(Debug, Copy)]
4854pub struct SceKernelSemaOptParam {
4855    /// Size of the ::SceKernelSemaOptParam structure.
4856    pub size: SceSize,
4857}
4858#[test]
4859fn bindgen_test_layout_SceKernelSemaOptParam() {
4860    assert_eq!(::core::mem::size_of::<SceKernelSemaOptParam>() , 4usize ,
4861               concat ! ( "Size of: " , stringify ! ( SceKernelSemaOptParam )
4862               ));
4863    assert_eq! (::core::mem::align_of::<SceKernelSemaOptParam>() , 4usize ,
4864                concat ! (
4865                "Alignment of " , stringify ! ( SceKernelSemaOptParam ) ));
4866    assert_eq! (unsafe {
4867                & ( * ( 0 as * const SceKernelSemaOptParam ) ) . size as *
4868                const _ as usize } , 0usize , concat ! (
4869                "Alignment of field: " , stringify ! ( SceKernelSemaOptParam )
4870                , "::" , stringify ! ( size ) ));
4871}
4872impl Clone for SceKernelSemaOptParam {
4873    fn clone(&self) -> Self { *self }
4874}
4875/// Current state of a semaphore.
4876/// @see sceKernelReferSemaStatus.
4877#[repr(C)]
4878#[derive(Debug, Copy)]
4879pub struct SceKernelSemaInfo {
4880    /// Size of the ::SceKernelSemaInfo structure.
4881    pub size: SceSize,
4882    /// NUL-terminated name of the semaphore.
4883    pub name: [libc::c_char; 32usize],
4884    /// Attributes.
4885    pub attr: SceUInt,
4886    /// The initial count the semaphore was created with.
4887    pub initCount: libc::c_int,
4888    /// The current count.
4889    pub currentCount: libc::c_int,
4890    /// The maximum count.
4891    pub maxCount: libc::c_int,
4892    /// The number of threads waiting on the semaphore.
4893    pub numWaitThreads: libc::c_int,
4894}
4895#[test]
4896fn bindgen_test_layout_SceKernelSemaInfo() {
4897    assert_eq!(::core::mem::size_of::<SceKernelSemaInfo>() , 56usize , concat
4898               ! ( "Size of: " , stringify ! ( SceKernelSemaInfo ) ));
4899    assert_eq! (::core::mem::align_of::<SceKernelSemaInfo>() , 4usize , concat
4900                ! ( "Alignment of " , stringify ! ( SceKernelSemaInfo ) ));
4901    assert_eq! (unsafe {
4902                & ( * ( 0 as * const SceKernelSemaInfo ) ) . size as * const _
4903                as usize } , 0usize , concat ! (
4904                "Alignment of field: " , stringify ! ( SceKernelSemaInfo ) ,
4905                "::" , stringify ! ( size ) ));
4906    assert_eq! (unsafe {
4907                & ( * ( 0 as * const SceKernelSemaInfo ) ) . name as * const _
4908                as usize } , 4usize , concat ! (
4909                "Alignment of field: " , stringify ! ( SceKernelSemaInfo ) ,
4910                "::" , stringify ! ( name ) ));
4911    assert_eq! (unsafe {
4912                & ( * ( 0 as * const SceKernelSemaInfo ) ) . attr as * const _
4913                as usize } , 36usize , concat ! (
4914                "Alignment of field: " , stringify ! ( SceKernelSemaInfo ) ,
4915                "::" , stringify ! ( attr ) ));
4916    assert_eq! (unsafe {
4917                & ( * ( 0 as * const SceKernelSemaInfo ) ) . initCount as *
4918                const _ as usize } , 40usize , concat ! (
4919                "Alignment of field: " , stringify ! ( SceKernelSemaInfo ) ,
4920                "::" , stringify ! ( initCount ) ));
4921    assert_eq! (unsafe {
4922                & ( * ( 0 as * const SceKernelSemaInfo ) ) . currentCount as *
4923                const _ as usize } , 44usize , concat ! (
4924                "Alignment of field: " , stringify ! ( SceKernelSemaInfo ) ,
4925                "::" , stringify ! ( currentCount ) ));
4926    assert_eq! (unsafe {
4927                & ( * ( 0 as * const SceKernelSemaInfo ) ) . maxCount as *
4928                const _ as usize } , 48usize , concat ! (
4929                "Alignment of field: " , stringify ! ( SceKernelSemaInfo ) ,
4930                "::" , stringify ! ( maxCount ) ));
4931    assert_eq! (unsafe {
4932                & ( * ( 0 as * const SceKernelSemaInfo ) ) . numWaitThreads as
4933                * const _ as usize } , 52usize , concat ! (
4934                "Alignment of field: " , stringify ! ( SceKernelSemaInfo ) ,
4935                "::" , stringify ! ( numWaitThreads ) ));
4936}
4937impl Clone for SceKernelSemaInfo {
4938    fn clone(&self) -> Self { *self }
4939}
4940extern "C" {
4941    /// Creates a new semaphore
4942///
4943/// @par Example:
4944/// @code
4945/// int semaid;
4946/// semaid = sceKernelCreateSema("MyMutex", 0, 1, 1, 0);
4947/// @endcode
4948///
4949/// @param name - Specifies the name of the sema
4950/// @param attr - Sema attribute flags (normally set to 0)
4951/// @param initVal - Sema initial value
4952/// @param maxVal - Sema maximum value
4953/// @param option - Sema options (normally set to 0)
4954/// @return A semaphore id
4955    pub fn sceKernelCreateSema(name: *const libc::c_char, attr: SceUInt,
4956                               initVal: libc::c_int, maxVal: libc::c_int,
4957                               option: *mut SceKernelSemaOptParam) -> SceUID;
4958}
4959extern "C" {
4960    /// Destroy a semaphore
4961///
4962/// @param semaid - The semaid returned from a previous create call.
4963/// @return Returns the value 0 if its succesful otherwise -1
4964    pub fn sceKernelDeleteSema(semaid: SceUID) -> libc::c_int;
4965}
4966extern "C" {
4967    /// Send a signal to a semaphore
4968///
4969/// @par Example:
4970/// @code
4971/// // Signal the sema
4972/// sceKernelSignalSema(semaid, 1);
4973/// @endcode
4974///
4975/// @param semaid - The sema id returned from sceKernelCreateSema
4976/// @param signal - The amount to signal the sema (i.e. if 2 then increment the sema by 2)
4977///
4978/// @return < 0 On error.
4979    pub fn sceKernelSignalSema(semaid: SceUID, signal: libc::c_int)
4980     -> libc::c_int;
4981}
4982extern "C" {
4983    /// Lock a semaphore
4984///
4985/// @par Example:
4986/// @code
4987/// sceKernelWaitSema(semaid, 1, 0);
4988/// @endcode
4989///
4990/// @param semaid - The sema id returned from sceKernelCreateSema
4991/// @param signal - The value to wait for (i.e. if 1 then wait till reaches a signal state of 1)
4992/// @param timeout - Timeout in microseconds (assumed).
4993///
4994/// @return < 0 on error.
4995    pub fn sceKernelWaitSema(semaid: SceUID, signal: libc::c_int,
4996                             timeout: *mut SceUInt) -> libc::c_int;
4997}
4998extern "C" {
4999    /// Lock a semaphore a handle callbacks if necessary.
5000///
5001/// @par Example:
5002/// @code
5003/// sceKernelWaitSemaCB(semaid, 1, 0);
5004/// @endcode
5005///
5006/// @param semaid - The sema id returned from sceKernelCreateSema
5007/// @param signal - The value to wait for (i.e. if 1 then wait till reaches a signal state of 1)
5008/// @param timeout - Timeout in microseconds (assumed).
5009///
5010/// @return < 0 on error.
5011    pub fn sceKernelWaitSemaCB(semaid: SceUID, signal: libc::c_int,
5012                               timeout: *mut SceUInt) -> libc::c_int;
5013}
5014extern "C" {
5015    /// Poll a sempahore.
5016///
5017/// @param semaid - UID of the semaphore to poll.
5018/// @param signal - The value to test for.
5019///
5020/// @return < 0 on error.
5021    pub fn sceKernelPollSema(semaid: SceUID, signal: libc::c_int)
5022     -> libc::c_int;
5023}
5024extern "C" {
5025    /// Retrieve information about a semaphore.
5026///
5027/// @param semaid - UID of the semaphore to retrieve info for.
5028/// @param info - Pointer to a ::SceKernelSemaInfo struct to receive the info.
5029///
5030/// @return < 0 on error.
5031    pub fn sceKernelReferSemaStatus(semaid: SceUID,
5032                                    info: *mut SceKernelSemaInfo)
5033     -> libc::c_int;
5034}
5035/// Structure to hold the event flag information
5036#[repr(C)]
5037#[derive(Debug, Copy)]
5038pub struct SceKernelEventFlagInfo {
5039    pub size: SceSize,
5040    pub name: [libc::c_char; 32usize],
5041    pub attr: SceUInt,
5042    pub initPattern: SceUInt,
5043    pub currentPattern: SceUInt,
5044    pub numWaitThreads: libc::c_int,
5045}
5046#[test]
5047fn bindgen_test_layout_SceKernelEventFlagInfo() {
5048    assert_eq!(::core::mem::size_of::<SceKernelEventFlagInfo>() , 52usize ,
5049               concat ! ( "Size of: " , stringify ! ( SceKernelEventFlagInfo )
5050               ));
5051    assert_eq! (::core::mem::align_of::<SceKernelEventFlagInfo>() , 4usize ,
5052                concat ! (
5053                "Alignment of " , stringify ! ( SceKernelEventFlagInfo ) ));
5054    assert_eq! (unsafe {
5055                & ( * ( 0 as * const SceKernelEventFlagInfo ) ) . size as *
5056                const _ as usize } , 0usize , concat ! (
5057                "Alignment of field: " , stringify ! ( SceKernelEventFlagInfo
5058                ) , "::" , stringify ! ( size ) ));
5059    assert_eq! (unsafe {
5060                & ( * ( 0 as * const SceKernelEventFlagInfo ) ) . name as *
5061                const _ as usize } , 4usize , concat ! (
5062                "Alignment of field: " , stringify ! ( SceKernelEventFlagInfo
5063                ) , "::" , stringify ! ( name ) ));
5064    assert_eq! (unsafe {
5065                & ( * ( 0 as * const SceKernelEventFlagInfo ) ) . attr as *
5066                const _ as usize } , 36usize , concat ! (
5067                "Alignment of field: " , stringify ! ( SceKernelEventFlagInfo
5068                ) , "::" , stringify ! ( attr ) ));
5069    assert_eq! (unsafe {
5070                & ( * ( 0 as * const SceKernelEventFlagInfo ) ) . initPattern
5071                as * const _ as usize } , 40usize , concat ! (
5072                "Alignment of field: " , stringify ! ( SceKernelEventFlagInfo
5073                ) , "::" , stringify ! ( initPattern ) ));
5074    assert_eq! (unsafe {
5075                & ( * ( 0 as * const SceKernelEventFlagInfo ) ) .
5076                currentPattern as * const _ as usize } , 44usize , concat ! (
5077                "Alignment of field: " , stringify ! ( SceKernelEventFlagInfo
5078                ) , "::" , stringify ! ( currentPattern ) ));
5079    assert_eq! (unsafe {
5080                & ( * ( 0 as * const SceKernelEventFlagInfo ) ) .
5081                numWaitThreads as * const _ as usize } , 48usize , concat ! (
5082                "Alignment of field: " , stringify ! ( SceKernelEventFlagInfo
5083                ) , "::" , stringify ! ( numWaitThreads ) ));
5084}
5085impl Clone for SceKernelEventFlagInfo {
5086    fn clone(&self) -> Self { *self }
5087}
5088#[repr(C)]
5089#[derive(Debug, Copy)]
5090pub struct SceKernelEventFlagOptParam {
5091    pub size: SceSize,
5092}
5093#[test]
5094fn bindgen_test_layout_SceKernelEventFlagOptParam() {
5095    assert_eq!(::core::mem::size_of::<SceKernelEventFlagOptParam>() , 4usize ,
5096               concat ! (
5097               "Size of: " , stringify ! ( SceKernelEventFlagOptParam ) ));
5098    assert_eq! (::core::mem::align_of::<SceKernelEventFlagOptParam>() , 4usize
5099                , concat ! (
5100                "Alignment of " , stringify ! ( SceKernelEventFlagOptParam )
5101                ));
5102    assert_eq! (unsafe {
5103                & ( * ( 0 as * const SceKernelEventFlagOptParam ) ) . size as
5104                * const _ as usize } , 0usize , concat ! (
5105                "Alignment of field: " , stringify ! (
5106                SceKernelEventFlagOptParam ) , "::" , stringify ! ( size ) ));
5107}
5108impl Clone for SceKernelEventFlagOptParam {
5109    fn clone(&self) -> Self { *self }
5110}
5111#[repr(u32)]
5112/// Event flag creation attributes
5113#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
5114pub enum PspEventFlagAttributes { PSP_EVENT_WAITMULTIPLE = 512, }
5115#[repr(u32)]
5116/// Event flag wait types
5117#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
5118pub enum PspEventFlagWaitTypes {
5119    PSP_EVENT_WAITAND = 0,
5120    PSP_EVENT_WAITOR = 1,
5121    PSP_EVENT_WAITCLEAR = 32,
5122}
5123extern "C" {
5124    /// Create an event flag.
5125///
5126/// @param name - The name of the event flag.
5127/// @param attr - Attributes from ::PspEventFlagAttributes
5128/// @param bits - Initial bit pattern.
5129/// @param opt  - Options, set to NULL
5130/// @return < 0 on error. >= 0 event flag id.
5131///
5132/// @par Example:
5133/// @code
5134/// int evid;
5135/// evid = sceKernelCreateEventFlag("wait_event", 0, 0, 0);
5136/// @endcode
5137    pub fn sceKernelCreateEventFlag(name: *const libc::c_char,
5138                                    attr: libc::c_int, bits: libc::c_int,
5139                                    opt: *mut SceKernelEventFlagOptParam)
5140     -> SceUID;
5141}
5142extern "C" {
5143    /// Set an event flag bit pattern.
5144///
5145/// @param evid - The event id returned by sceKernelCreateEventFlag.
5146/// @param bits - The bit pattern to set.
5147///
5148/// @return < 0 On error
5149    pub fn sceKernelSetEventFlag(evid: SceUID, bits: u32) -> libc::c_int;
5150}
5151extern "C" {
5152    /// Clear a event flag bit pattern
5153///
5154/// @param evid - The event id returned by ::sceKernelCreateEventFlag
5155/// @param bits - The bits to clean
5156///
5157/// @return < 0 on Error
5158    pub fn sceKernelClearEventFlag(evid: SceUID, bits: u32) -> libc::c_int;
5159}
5160extern "C" {
5161    /// Poll an event flag for a given bit pattern.
5162///
5163/// @param evid - The event id returned by sceKernelCreateEventFlag.
5164/// @param bits - The bit pattern to poll for.
5165/// @param wait - Wait type, one or more of ::PspEventFlagWaitTypes or'ed together
5166/// @param outBits - The bit pattern that was matched.
5167/// @return < 0 On error
5168    pub fn sceKernelPollEventFlag(evid: libc::c_int, bits: u32, wait: u32,
5169                                  outBits: *mut u32) -> libc::c_int;
5170}
5171extern "C" {
5172    /// Wait for an event flag for a given bit pattern.
5173///
5174/// @param evid - The event id returned by sceKernelCreateEventFlag.
5175/// @param bits - The bit pattern to poll for.
5176/// @param wait - Wait type, one or more of ::PspEventFlagWaitTypes or'ed together
5177/// @param outBits - The bit pattern that was matched.
5178/// @param timeout  - Timeout in microseconds
5179/// @return < 0 On error
5180    pub fn sceKernelWaitEventFlag(evid: libc::c_int, bits: u32, wait: u32,
5181                                  outBits: *mut u32, timeout: *mut SceUInt)
5182     -> libc::c_int;
5183}
5184extern "C" {
5185    /// Wait for an event flag for a given bit pattern with callback.
5186///
5187/// @param evid - The event id returned by sceKernelCreateEventFlag.
5188/// @param bits - The bit pattern to poll for.
5189/// @param wait - Wait type, one or more of ::PspEventFlagWaitTypes or'ed together
5190/// @param outBits - The bit pattern that was matched.
5191/// @param timeout  - Timeout in microseconds
5192/// @return < 0 On error
5193    pub fn sceKernelWaitEventFlagCB(evid: libc::c_int, bits: u32, wait: u32,
5194                                    outBits: *mut u32, timeout: *mut SceUInt)
5195     -> libc::c_int;
5196}
5197extern "C" {
5198    /// Delete an event flag
5199///
5200/// @param evid - The event id returned by sceKernelCreateEventFlag.
5201///
5202/// @return < 0 On error
5203    pub fn sceKernelDeleteEventFlag(evid: libc::c_int) -> libc::c_int;
5204}
5205extern "C" {
5206    /// Get the status of an event flag.
5207///
5208/// @param event - The UID of the event.
5209/// @param status - A pointer to a ::SceKernelEventFlagInfo structure.
5210///
5211/// @return < 0 on error.
5212    pub fn sceKernelReferEventFlagStatus(event: SceUID,
5213                                         status: *mut SceKernelEventFlagInfo)
5214     -> libc::c_int;
5215}
5216/// Additional options used when creating messageboxes.
5217#[repr(C)]
5218#[derive(Debug, Copy)]
5219pub struct SceKernelMbxOptParam {
5220    /// Size of the ::SceKernelMbxOptParam structure.
5221    pub size: SceSize,
5222}
5223#[test]
5224fn bindgen_test_layout_SceKernelMbxOptParam() {
5225    assert_eq!(::core::mem::size_of::<SceKernelMbxOptParam>() , 4usize ,
5226               concat ! ( "Size of: " , stringify ! ( SceKernelMbxOptParam )
5227               ));
5228    assert_eq! (::core::mem::align_of::<SceKernelMbxOptParam>() , 4usize ,
5229                concat ! (
5230                "Alignment of " , stringify ! ( SceKernelMbxOptParam ) ));
5231    assert_eq! (unsafe {
5232                & ( * ( 0 as * const SceKernelMbxOptParam ) ) . size as *
5233                const _ as usize } , 0usize , concat ! (
5234                "Alignment of field: " , stringify ! ( SceKernelMbxOptParam )
5235                , "::" , stringify ! ( size ) ));
5236}
5237impl Clone for SceKernelMbxOptParam {
5238    fn clone(&self) -> Self { *self }
5239}
5240/// Current state of a messagebox.
5241/// @see sceKernelReferMbxStatus.
5242#[repr(C)]
5243#[derive(Debug, Copy)]
5244pub struct SceKernelMbxInfo {
5245    /// Size of the ::SceKernelMbxInfo structure.
5246    pub size: SceSize,
5247    /// NUL-terminated name of the messagebox.
5248    pub name: [libc::c_char; 32usize],
5249    /// Attributes.
5250    pub attr: SceUInt,
5251    /// The number of threads waiting on the messagebox.
5252    pub numWaitThreads: libc::c_int,
5253    /// Number of messages currently in the messagebox.
5254    pub numMessages: libc::c_int,
5255    /// The message currently at the head of the queue.
5256    pub firstMessage: *mut libc::c_void,
5257}
5258#[test]
5259fn bindgen_test_layout_SceKernelMbxInfo() {
5260    assert_eq!(::core::mem::size_of::<SceKernelMbxInfo>() , 56usize , concat !
5261               ( "Size of: " , stringify ! ( SceKernelMbxInfo ) ));
5262    assert_eq! (::core::mem::align_of::<SceKernelMbxInfo>() , 8usize , concat
5263                ! ( "Alignment of " , stringify ! ( SceKernelMbxInfo ) ));
5264    assert_eq! (unsafe {
5265                & ( * ( 0 as * const SceKernelMbxInfo ) ) . size as * const _
5266                as usize } , 0usize , concat ! (
5267                "Alignment of field: " , stringify ! ( SceKernelMbxInfo ) ,
5268                "::" , stringify ! ( size ) ));
5269    assert_eq! (unsafe {
5270                & ( * ( 0 as * const SceKernelMbxInfo ) ) . name as * const _
5271                as usize } , 4usize , concat ! (
5272                "Alignment of field: " , stringify ! ( SceKernelMbxInfo ) ,
5273                "::" , stringify ! ( name ) ));
5274    assert_eq! (unsafe {
5275                & ( * ( 0 as * const SceKernelMbxInfo ) ) . attr as * const _
5276                as usize } , 36usize , concat ! (
5277                "Alignment of field: " , stringify ! ( SceKernelMbxInfo ) ,
5278                "::" , stringify ! ( attr ) ));
5279    assert_eq! (unsafe {
5280                & ( * ( 0 as * const SceKernelMbxInfo ) ) . numWaitThreads as
5281                * const _ as usize } , 40usize , concat ! (
5282                "Alignment of field: " , stringify ! ( SceKernelMbxInfo ) ,
5283                "::" , stringify ! ( numWaitThreads ) ));
5284    assert_eq! (unsafe {
5285                & ( * ( 0 as * const SceKernelMbxInfo ) ) . numMessages as *
5286                const _ as usize } , 44usize , concat ! (
5287                "Alignment of field: " , stringify ! ( SceKernelMbxInfo ) ,
5288                "::" , stringify ! ( numMessages ) ));
5289    assert_eq! (unsafe {
5290                & ( * ( 0 as * const SceKernelMbxInfo ) ) . firstMessage as *
5291                const _ as usize } , 48usize , concat ! (
5292                "Alignment of field: " , stringify ! ( SceKernelMbxInfo ) ,
5293                "::" , stringify ! ( firstMessage ) ));
5294}
5295impl Clone for SceKernelMbxInfo {
5296    fn clone(&self) -> Self { *self }
5297}
5298/// Header for a message box packet
5299#[repr(C)]
5300#[derive(Debug, Copy)]
5301pub struct SceKernelMsgPacket {
5302    /// Pointer to next msg (used by the kernel)
5303    pub next: *mut SceKernelMsgPacket,
5304    /// Priority ?
5305    pub msgPriority: SceUChar,
5306    pub dummy: [SceUChar; 3usize],
5307}
5308#[test]
5309fn bindgen_test_layout_SceKernelMsgPacket() {
5310    assert_eq!(::core::mem::size_of::<SceKernelMsgPacket>() , 16usize , concat
5311               ! ( "Size of: " , stringify ! ( SceKernelMsgPacket ) ));
5312    assert_eq! (::core::mem::align_of::<SceKernelMsgPacket>() , 8usize ,
5313                concat ! (
5314                "Alignment of " , stringify ! ( SceKernelMsgPacket ) ));
5315    assert_eq! (unsafe {
5316                & ( * ( 0 as * const SceKernelMsgPacket ) ) . next as * const
5317                _ as usize } , 0usize , concat ! (
5318                "Alignment of field: " , stringify ! ( SceKernelMsgPacket ) ,
5319                "::" , stringify ! ( next ) ));
5320    assert_eq! (unsafe {
5321                & ( * ( 0 as * const SceKernelMsgPacket ) ) . msgPriority as *
5322                const _ as usize } , 8usize , concat ! (
5323                "Alignment of field: " , stringify ! ( SceKernelMsgPacket ) ,
5324                "::" , stringify ! ( msgPriority ) ));
5325    assert_eq! (unsafe {
5326                & ( * ( 0 as * const SceKernelMsgPacket ) ) . dummy as * const
5327                _ as usize } , 9usize , concat ! (
5328                "Alignment of field: " , stringify ! ( SceKernelMsgPacket ) ,
5329                "::" , stringify ! ( dummy ) ));
5330}
5331impl Clone for SceKernelMsgPacket {
5332    fn clone(&self) -> Self { *self }
5333}
5334extern "C" {
5335    /// Creates a new messagebox
5336///
5337/// @par Example:
5338/// @code
5339/// int mbxid;
5340/// mbxid = sceKernelCreateMbx("MyMessagebox", 0, NULL);
5341/// @endcode
5342///
5343/// @param name - Specifies the name of the mbx
5344/// @param attr - Mbx attribute flags (normally set to 0)
5345/// @param option - Mbx options (normally set to NULL)
5346/// @return A messagebox id
5347    pub fn sceKernelCreateMbx(name: *const libc::c_char, attr: SceUInt,
5348                              option: *mut SceKernelMbxOptParam) -> SceUID;
5349}
5350extern "C" {
5351    /// Destroy a messagebox
5352///
5353/// @param mbxid - The mbxid returned from a previous create call.
5354/// @return Returns the value 0 if its succesful otherwise an error code
5355    pub fn sceKernelDeleteMbx(mbxid: SceUID) -> libc::c_int;
5356}
5357extern "C" {
5358    /// Send a message to a messagebox
5359///
5360/// @par Example:
5361/// @code
5362/// struct MyMessage {
5363/// SceKernelMsgPacket header;
5364/// char text[8];
5365/// };
5366///
5367/// struct MyMessage msg = { {0}, "Hello" };
5368/// // Send the message
5369/// sceKernelSendMbx(mbxid, (void*) &msg);
5370/// @endcode
5371///
5372/// @param mbxid - The mbx id returned from sceKernelCreateMbx
5373/// @param message - A message to be forwarded to the receiver.
5374/// The start of the message should be the
5375/// ::SceKernelMsgPacket structure, the rest
5376///
5377/// @return < 0 On error.
5378    pub fn sceKernelSendMbx(mbxid: SceUID, message: *mut libc::c_void)
5379     -> libc::c_int;
5380}
5381extern "C" {
5382    /// Wait for a message to arrive in a messagebox
5383///
5384/// @par Example:
5385/// @code
5386/// void *msg;
5387/// sceKernelReceiveMbx(mbxid, &msg, NULL);
5388/// @endcode
5389///
5390/// @param mbxid - The mbx id returned from sceKernelCreateMbx
5391/// @param pmessage - A pointer to where a pointer to the
5392/// received message should be stored
5393/// @param timeout - Timeout in microseconds
5394///
5395/// @return < 0 on error.
5396    pub fn sceKernelReceiveMbx(mbxid: SceUID,
5397                               pmessage: *mut *mut libc::c_void,
5398                               timeout: *mut SceUInt) -> libc::c_int;
5399}
5400extern "C" {
5401    /// Wait for a message to arrive in a messagebox and handle callbacks if necessary.
5402///
5403/// @par Example:
5404/// @code
5405/// void *msg;
5406/// sceKernelReceiveMbxCB(mbxid, &msg, NULL);
5407/// @endcode
5408///
5409/// @param mbxid - The mbx id returned from sceKernelCreateMbx
5410/// @param pmessage - A pointer to where a pointer to the
5411/// received message should be stored
5412/// @param timeout - Timeout in microseconds
5413///
5414/// @return < 0 on error.
5415    pub fn sceKernelReceiveMbxCB(mbxid: SceUID,
5416                                 pmessage: *mut *mut libc::c_void,
5417                                 timeout: *mut SceUInt) -> libc::c_int;
5418}
5419extern "C" {
5420    /// Check if a message has arrived in a messagebox
5421///
5422/// @par Example:
5423/// @code
5424/// void *msg;
5425/// sceKernelPollMbx(mbxid, &msg);
5426/// @endcode
5427///
5428/// @param mbxid - The mbx id returned from sceKernelCreateMbx
5429/// @param pmessage - A pointer to where a pointer to the
5430/// received message should be stored
5431///
5432/// @return < 0 on error (SCE_KERNEL_ERROR_MBOX_NOMSG if the mbx is empty).
5433    pub fn sceKernelPollMbx(mbxid: SceUID, pmessage: *mut *mut libc::c_void)
5434     -> libc::c_int;
5435}
5436extern "C" {
5437    /// Abort all wait operations on a messagebox
5438///
5439/// @par Example:
5440/// @code
5441/// sceKernelCancelReceiveMbx(mbxid, NULL);
5442/// @endcode
5443///
5444/// @param mbxid - The mbx id returned from sceKernelCreateMbx
5445/// @param pnum  - A pointer to where the number of threads which
5446/// were waiting on the mbx should be stored (NULL
5447/// if you don't care)
5448///
5449/// @return < 0 on error
5450    pub fn sceKernelCancelReceiveMbx(mbxid: SceUID, pnum: *mut libc::c_int)
5451     -> libc::c_int;
5452}
5453extern "C" {
5454    /// Retrieve information about a messagebox.
5455///
5456/// @param mbxid - UID of the messagebox to retrieve info for.
5457/// @param info - Pointer to a ::SceKernelMbxInfo struct to receive the info.
5458///
5459/// @return < 0 on error.
5460    pub fn sceKernelReferMbxStatus(mbxid: SceUID, info: *mut SceKernelMbxInfo)
5461     -> libc::c_int;
5462}
5463/// Prototype for alarm handlers.
5464pub type SceKernelAlarmHandler =
5465    ::core::option::Option<unsafe extern "C" fn(common: *mut libc::c_void)
5466                               -> SceUInt>;
5467/// Struct containing alarm info
5468#[repr(C)]
5469#[derive(Debug, Copy)]
5470pub struct SceKernelAlarmInfo {
5471    /// Size of the structure (should be set before calling
5472    /// :: sceKernelReferAlarmStatus
5473    pub size: SceSize,
5474    pub schedule: SceKernelSysClock,
5475    /// Pointer to the alarm handler
5476    pub handler: SceKernelAlarmHandler,
5477    /// Common pointer argument
5478    pub common: *mut libc::c_void,
5479}
5480#[test]
5481fn bindgen_test_layout_SceKernelAlarmInfo() {
5482    assert_eq!(::core::mem::size_of::<SceKernelAlarmInfo>() , 32usize , concat
5483               ! ( "Size of: " , stringify ! ( SceKernelAlarmInfo ) ));
5484    assert_eq! (::core::mem::align_of::<SceKernelAlarmInfo>() , 8usize ,
5485                concat ! (
5486                "Alignment of " , stringify ! ( SceKernelAlarmInfo ) ));
5487    assert_eq! (unsafe {
5488                & ( * ( 0 as * const SceKernelAlarmInfo ) ) . size as * const
5489                _ as usize } , 0usize , concat ! (
5490                "Alignment of field: " , stringify ! ( SceKernelAlarmInfo ) ,
5491                "::" , stringify ! ( size ) ));
5492    assert_eq! (unsafe {
5493                & ( * ( 0 as * const SceKernelAlarmInfo ) ) . schedule as *
5494                const _ as usize } , 4usize , concat ! (
5495                "Alignment of field: " , stringify ! ( SceKernelAlarmInfo ) ,
5496                "::" , stringify ! ( schedule ) ));
5497    assert_eq! (unsafe {
5498                & ( * ( 0 as * const SceKernelAlarmInfo ) ) . handler as *
5499                const _ as usize } , 16usize , concat ! (
5500                "Alignment of field: " , stringify ! ( SceKernelAlarmInfo ) ,
5501                "::" , stringify ! ( handler ) ));
5502    assert_eq! (unsafe {
5503                & ( * ( 0 as * const SceKernelAlarmInfo ) ) . common as *
5504                const _ as usize } , 24usize , concat ! (
5505                "Alignment of field: " , stringify ! ( SceKernelAlarmInfo ) ,
5506                "::" , stringify ! ( common ) ));
5507}
5508impl Clone for SceKernelAlarmInfo {
5509    fn clone(&self) -> Self { *self }
5510}
5511extern "C" {
5512    /// Set an alarm.
5513/// @param clock - The number of micro seconds till the alarm occurrs.
5514/// @param handler - Pointer to a ::SceKernelAlarmHandler
5515/// @param common - Common pointer for the alarm handler
5516///
5517/// @return A UID representing the created alarm, < 0 on error.
5518    pub fn sceKernelSetAlarm(clock: SceUInt, handler: SceKernelAlarmHandler,
5519                             common: *mut libc::c_void) -> SceUID;
5520}
5521extern "C" {
5522    /// Set an alarm using a ::SceKernelSysClock structure for the time
5523///
5524/// @param clock - Pointer to a ::SceKernelSysClock structure
5525/// @param handler - Pointer to a ::SceKernelAlarmHandler
5526/// @param common - Common pointer for the alarm handler.
5527///
5528/// @return A UID representing the created alarm, < 0 on error.
5529    pub fn sceKernelSetSysClockAlarm(clock: *mut SceKernelSysClock,
5530                                     handler: SceKernelAlarmHandler,
5531                                     common: *mut libc::c_void) -> SceUID;
5532}
5533extern "C" {
5534    /// Cancel a pending alarm.
5535///
5536/// @param alarmid - UID of the alarm to cancel.
5537///
5538/// @return 0 on success, < 0 on error.
5539    pub fn sceKernelCancelAlarm(alarmid: SceUID) -> libc::c_int;
5540}
5541extern "C" {
5542    /// Refer the status of a created alarm.
5543///
5544/// @param alarmid - UID of the alarm to get the info of
5545/// @param info - Pointer to a ::SceKernelAlarmInfo structure
5546///
5547/// @return 0 on success, < 0 on error.
5548    pub fn sceKernelReferAlarmStatus(alarmid: SceUID,
5549                                     info: *mut SceKernelAlarmInfo)
5550     -> libc::c_int;
5551}
5552/// Callback function prototype
5553pub type SceKernelCallbackFunction =
5554    ::core::option::Option<unsafe extern "C" fn(arg1: libc::c_int,
5555                                                arg2: libc::c_int,
5556                                                arg: *mut libc::c_void)
5557                               -> libc::c_int>;
5558/// Structure to hold the status information for a callback
5559#[repr(C)]
5560#[derive(Debug, Copy)]
5561pub struct SceKernelCallbackInfo {
5562    /// Size of the structure (i.e. sizeof(SceKernelCallbackInfo))
5563    pub size: SceSize,
5564    /// The name given to the callback
5565    pub name: [libc::c_char; 32usize],
5566    /// The thread id associated with the callback
5567    pub threadId: SceUID,
5568    /// Pointer to the callback function
5569    pub callback: SceKernelCallbackFunction,
5570    /// User supplied argument for the callback
5571    pub common: *mut libc::c_void,
5572    /// Unknown
5573    pub notifyCount: libc::c_int,
5574    /// Unknown
5575    pub notifyArg: libc::c_int,
5576}
5577#[test]
5578fn bindgen_test_layout_SceKernelCallbackInfo() {
5579    assert_eq!(::core::mem::size_of::<SceKernelCallbackInfo>() , 64usize ,
5580               concat ! ( "Size of: " , stringify ! ( SceKernelCallbackInfo )
5581               ));
5582    assert_eq! (::core::mem::align_of::<SceKernelCallbackInfo>() , 8usize ,
5583                concat ! (
5584                "Alignment of " , stringify ! ( SceKernelCallbackInfo ) ));
5585    assert_eq! (unsafe {
5586                & ( * ( 0 as * const SceKernelCallbackInfo ) ) . size as *
5587                const _ as usize } , 0usize , concat ! (
5588                "Alignment of field: " , stringify ! ( SceKernelCallbackInfo )
5589                , "::" , stringify ! ( size ) ));
5590    assert_eq! (unsafe {
5591                & ( * ( 0 as * const SceKernelCallbackInfo ) ) . name as *
5592                const _ as usize } , 4usize , concat ! (
5593                "Alignment of field: " , stringify ! ( SceKernelCallbackInfo )
5594                , "::" , stringify ! ( name ) ));
5595    assert_eq! (unsafe {
5596                & ( * ( 0 as * const SceKernelCallbackInfo ) ) . threadId as *
5597                const _ as usize } , 36usize , concat ! (
5598                "Alignment of field: " , stringify ! ( SceKernelCallbackInfo )
5599                , "::" , stringify ! ( threadId ) ));
5600    assert_eq! (unsafe {
5601                & ( * ( 0 as * const SceKernelCallbackInfo ) ) . callback as *
5602                const _ as usize } , 40usize , concat ! (
5603                "Alignment of field: " , stringify ! ( SceKernelCallbackInfo )
5604                , "::" , stringify ! ( callback ) ));
5605    assert_eq! (unsafe {
5606                & ( * ( 0 as * const SceKernelCallbackInfo ) ) . common as *
5607                const _ as usize } , 48usize , concat ! (
5608                "Alignment of field: " , stringify ! ( SceKernelCallbackInfo )
5609                , "::" , stringify ! ( common ) ));
5610    assert_eq! (unsafe {
5611                & ( * ( 0 as * const SceKernelCallbackInfo ) ) . notifyCount
5612                as * const _ as usize } , 56usize , concat ! (
5613                "Alignment of field: " , stringify ! ( SceKernelCallbackInfo )
5614                , "::" , stringify ! ( notifyCount ) ));
5615    assert_eq! (unsafe {
5616                & ( * ( 0 as * const SceKernelCallbackInfo ) ) . notifyArg as
5617                * const _ as usize } , 60usize , concat ! (
5618                "Alignment of field: " , stringify ! ( SceKernelCallbackInfo )
5619                , "::" , stringify ! ( notifyArg ) ));
5620}
5621impl Clone for SceKernelCallbackInfo {
5622    fn clone(&self) -> Self { *self }
5623}
5624extern "C" {
5625    /// Create callback
5626///
5627/// @par Example:
5628/// @code
5629/// int cbid;
5630/// cbid = sceKernelCreateCallback("Exit Callback", exit_cb, NULL);
5631/// @endcode
5632///
5633/// @param name - A textual name for the callback
5634/// @param func - A pointer to a function that will be called as the callback
5635/// @param arg  - Argument for the callback ?
5636///
5637/// @return >= 0 A callback id which can be used in subsequent functions, < 0 an error.
5638    pub fn sceKernelCreateCallback(name: *const libc::c_char,
5639                                   func: SceKernelCallbackFunction,
5640                                   arg: *mut libc::c_void) -> libc::c_int;
5641}
5642extern "C" {
5643    /// Gets the status of a specified callback.
5644///
5645/// @param cb - The UID of the callback to refer.
5646/// @param status - Pointer to a status structure. The size parameter should be
5647/// initialised before calling.
5648///
5649/// @return < 0 on error.
5650    pub fn sceKernelReferCallbackStatus(cb: SceUID,
5651                                        status: *mut SceKernelCallbackInfo)
5652     -> libc::c_int;
5653}
5654extern "C" {
5655    /// Delete a callback
5656///
5657/// @param cb - The UID of the specified callback
5658///
5659/// @return 0 on success, < 0 on error
5660    pub fn sceKernelDeleteCallback(cb: SceUID) -> libc::c_int;
5661}
5662extern "C" {
5663    /// Notify a callback
5664///
5665/// @param cb - The UID of the specified callback
5666/// @param arg2 - Passed as arg2 into the callback function
5667///
5668/// @return 0 on success, < 0 on error
5669    pub fn sceKernelNotifyCallback(cb: SceUID, arg2: libc::c_int)
5670     -> libc::c_int;
5671}
5672extern "C" {
5673    /// Cancel a callback ?
5674///
5675/// @param cb - The UID of the specified callback
5676///
5677/// @return 0 on succes, < 0 on error
5678    pub fn sceKernelCancelCallback(cb: SceUID) -> libc::c_int;
5679}
5680extern "C" {
5681    /// Get the callback count
5682///
5683/// @param cb - The UID of the specified callback
5684///
5685/// @return The callback count, < 0 on error
5686    pub fn sceKernelGetCallbackCount(cb: SceUID) -> libc::c_int;
5687}
5688extern "C" {
5689    /// Check callback ?
5690///
5691/// @return Something or another
5692    pub fn sceKernelCheckCallback() -> libc::c_int;
5693}
5694#[repr(u32)]
5695/// Threadman types for ::sceKernelGetThreadmanIdList
5696#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
5697pub enum SceKernelIdListType {
5698    SCE_KERNEL_TMID_Thread = 1,
5699    SCE_KERNEL_TMID_Semaphore = 2,
5700    SCE_KERNEL_TMID_EventFlag = 3,
5701    SCE_KERNEL_TMID_Mbox = 4,
5702    SCE_KERNEL_TMID_Vpl = 5,
5703    SCE_KERNEL_TMID_Fpl = 6,
5704    SCE_KERNEL_TMID_Mpipe = 7,
5705    SCE_KERNEL_TMID_Callback = 8,
5706    SCE_KERNEL_TMID_ThreadEventHandler = 9,
5707    SCE_KERNEL_TMID_Alarm = 10,
5708    SCE_KERNEL_TMID_VTimer = 11,
5709    SCE_KERNEL_TMID_SleepThread = 64,
5710    SCE_KERNEL_TMID_DelayThread = 65,
5711    SCE_KERNEL_TMID_SuspendThread = 66,
5712    SCE_KERNEL_TMID_DormantThread = 67,
5713}
5714extern "C" {
5715    /// Get a list of UIDs from threadman. Allows you to enumerate
5716/// resources such as threads or semaphores.
5717///
5718/// @param type - The type of resource to list, one of ::SceKernelIdListType.
5719/// @param readbuf - A pointer to a buffer to store the list.
5720/// @param readbufsize - The size of the buffer in SceUID units.
5721/// @param idcount - Pointer to an integer in which to return the number of ids in the list.
5722///
5723/// @return < 0 on error. Either 0 or the same as idcount on success.
5724    pub fn sceKernelGetThreadmanIdList(type_: SceKernelIdListType,
5725                                       readbuf: *mut SceUID,
5726                                       readbufsize: libc::c_int,
5727                                       idcount: *mut libc::c_int)
5728     -> libc::c_int;
5729}
5730/// Structure to contain the system status returned by ::sceKernelReferSystemStatus
5731#[repr(C)]
5732#[derive(Debug, Copy)]
5733pub struct SceKernelSystemStatus {
5734    /// Size of the structure (should be set prior to the call)
5735    pub size: SceSize,
5736    /// The status ?
5737    pub status: SceUInt,
5738    /// The number of cpu clocks in the idle thread
5739    pub idleClocks: SceKernelSysClock,
5740    /// Number of times we resumed from idle
5741    pub comesOutOfIdleCount: SceUInt,
5742    /// Number of thread context switches
5743    pub threadSwitchCount: SceUInt,
5744    /// Number of vfpu switches ?
5745    pub vfpuSwitchCount: SceUInt,
5746}
5747#[test]
5748fn bindgen_test_layout_SceKernelSystemStatus() {
5749    assert_eq!(::core::mem::size_of::<SceKernelSystemStatus>() , 28usize ,
5750               concat ! ( "Size of: " , stringify ! ( SceKernelSystemStatus )
5751               ));
5752    assert_eq! (::core::mem::align_of::<SceKernelSystemStatus>() , 4usize ,
5753                concat ! (
5754                "Alignment of " , stringify ! ( SceKernelSystemStatus ) ));
5755    assert_eq! (unsafe {
5756                & ( * ( 0 as * const SceKernelSystemStatus ) ) . size as *
5757                const _ as usize } , 0usize , concat ! (
5758                "Alignment of field: " , stringify ! ( SceKernelSystemStatus )
5759                , "::" , stringify ! ( size ) ));
5760    assert_eq! (unsafe {
5761                & ( * ( 0 as * const SceKernelSystemStatus ) ) . status as *
5762                const _ as usize } , 4usize , concat ! (
5763                "Alignment of field: " , stringify ! ( SceKernelSystemStatus )
5764                , "::" , stringify ! ( status ) ));
5765    assert_eq! (unsafe {
5766                & ( * ( 0 as * const SceKernelSystemStatus ) ) . idleClocks as
5767                * const _ as usize } , 8usize , concat ! (
5768                "Alignment of field: " , stringify ! ( SceKernelSystemStatus )
5769                , "::" , stringify ! ( idleClocks ) ));
5770    assert_eq! (unsafe {
5771                & ( * ( 0 as * const SceKernelSystemStatus ) ) .
5772                comesOutOfIdleCount as * const _ as usize } , 16usize , concat
5773                ! (
5774                "Alignment of field: " , stringify ! ( SceKernelSystemStatus )
5775                , "::" , stringify ! ( comesOutOfIdleCount ) ));
5776    assert_eq! (unsafe {
5777                & ( * ( 0 as * const SceKernelSystemStatus ) ) .
5778                threadSwitchCount as * const _ as usize } , 20usize , concat !
5779                (
5780                "Alignment of field: " , stringify ! ( SceKernelSystemStatus )
5781                , "::" , stringify ! ( threadSwitchCount ) ));
5782    assert_eq! (unsafe {
5783                & ( * ( 0 as * const SceKernelSystemStatus ) ) .
5784                vfpuSwitchCount as * const _ as usize } , 24usize , concat ! (
5785                "Alignment of field: " , stringify ! ( SceKernelSystemStatus )
5786                , "::" , stringify ! ( vfpuSwitchCount ) ));
5787}
5788impl Clone for SceKernelSystemStatus {
5789    fn clone(&self) -> Self { *self }
5790}
5791extern "C" {
5792    /// Get the current system status.
5793///
5794/// @param status - Pointer to a ::SceKernelSystemStatus structure.
5795///
5796/// @return < 0 on error.
5797    pub fn sceKernelReferSystemStatus(status: *mut SceKernelSystemStatus)
5798     -> libc::c_int;
5799}
5800extern "C" {
5801    /// Create a message pipe
5802///
5803/// @param name - Name of the pipe
5804/// @param part - ID of the memory partition
5805/// @param attr - Set to 0?
5806/// @param unk1 - Unknown
5807/// @param opt  - Message pipe options (set to NULL)
5808///
5809/// @return The UID of the created pipe, < 0 on error
5810    pub fn sceKernelCreateMsgPipe(name: *const libc::c_char,
5811                                  part: libc::c_int, attr: libc::c_int,
5812                                  unk1: *mut libc::c_void,
5813                                  opt: *mut libc::c_void) -> SceUID;
5814}
5815extern "C" {
5816    /// Delete a message pipe
5817///
5818/// @param uid - The UID of the pipe
5819///
5820/// @return 0 on success, < 0 on error
5821    pub fn sceKernelDeleteMsgPipe(uid: SceUID) -> libc::c_int;
5822}
5823extern "C" {
5824    /// Send a message to a pipe
5825///
5826/// @param uid - The UID of the pipe
5827/// @param message - Pointer to the message
5828/// @param size - Size of the message
5829/// @param unk1 - Unknown
5830/// @param unk2 - Unknown
5831/// @param timeout - Timeout for send
5832///
5833/// @return 0 on success, < 0 on error
5834    pub fn sceKernelSendMsgPipe(uid: SceUID, message: *mut libc::c_void,
5835                                size: libc::c_uint, unk1: libc::c_int,
5836                                unk2: *mut libc::c_void,
5837                                timeout: *mut libc::c_uint) -> libc::c_int;
5838}
5839extern "C" {
5840    /// Send a message to a pipe (with callback)
5841///
5842/// @param uid - The UID of the pipe
5843/// @param message - Pointer to the message
5844/// @param size - Size of the message
5845/// @param unk1 - Unknown
5846/// @param unk2 - Unknown
5847/// @param timeout - Timeout for send
5848///
5849/// @return 0 on success, < 0 on error
5850    pub fn sceKernelSendMsgPipeCB(uid: SceUID, message: *mut libc::c_void,
5851                                  size: libc::c_uint, unk1: libc::c_int,
5852                                  unk2: *mut libc::c_void,
5853                                  timeout: *mut libc::c_uint) -> libc::c_int;
5854}
5855extern "C" {
5856    /// Try to send a message to a pipe
5857///
5858/// @param uid - The UID of the pipe
5859/// @param message - Pointer to the message
5860/// @param size - Size of the message
5861/// @param unk1 - Unknown
5862/// @param unk2 - Unknown
5863///
5864/// @return 0 on success, < 0 on error
5865    pub fn sceKernelTrySendMsgPipe(uid: SceUID, message: *mut libc::c_void,
5866                                   size: libc::c_uint, unk1: libc::c_int,
5867                                   unk2: *mut libc::c_void) -> libc::c_int;
5868}
5869extern "C" {
5870    /// Receive a message from a pipe
5871///
5872/// @param uid - The UID of the pipe
5873/// @param message - Pointer to the message
5874/// @param size - Size of the message
5875/// @param unk1 - Unknown
5876/// @param unk2 - Unknown
5877/// @param timeout - Timeout for receive
5878///
5879/// @return 0 on success, < 0 on error
5880    pub fn sceKernelReceiveMsgPipe(uid: SceUID, message: *mut libc::c_void,
5881                                   size: libc::c_uint, unk1: libc::c_int,
5882                                   unk2: *mut libc::c_void,
5883                                   timeout: *mut libc::c_uint) -> libc::c_int;
5884}
5885extern "C" {
5886    /// Receive a message from a pipe (with callback)
5887///
5888/// @param uid - The UID of the pipe
5889/// @param message - Pointer to the message
5890/// @param size - Size of the message
5891/// @param unk1 - Unknown
5892/// @param unk2 - Unknown
5893/// @param timeout - Timeout for receive
5894///
5895/// @return 0 on success, < 0 on error
5896    pub fn sceKernelReceiveMsgPipeCB(uid: SceUID, message: *mut libc::c_void,
5897                                     size: libc::c_uint, unk1: libc::c_int,
5898                                     unk2: *mut libc::c_void,
5899                                     timeout: *mut libc::c_uint)
5900     -> libc::c_int;
5901}
5902extern "C" {
5903    /// Receive a message from a pipe
5904///
5905/// @param uid - The UID of the pipe
5906/// @param message - Pointer to the message
5907/// @param size - Size of the message
5908/// @param unk1 - Unknown
5909/// @param unk2 - Unknown
5910///
5911/// @return 0 on success, < 0 on error
5912    pub fn sceKernelTryReceiveMsgPipe(uid: SceUID, message: *mut libc::c_void,
5913                                      size: libc::c_uint, unk1: libc::c_int,
5914                                      unk2: *mut libc::c_void) -> libc::c_int;
5915}
5916extern "C" {
5917    /// Cancel a message pipe
5918///
5919/// @param uid - UID of the pipe to cancel
5920/// @param psend - Receive number of sending threads?
5921/// @param precv - Receive number of receiving threads?
5922///
5923/// @return 0 on success, < 0 on error
5924    pub fn sceKernelCancelMsgPipe(uid: SceUID, psend: *mut libc::c_int,
5925                                  precv: *mut libc::c_int) -> libc::c_int;
5926}
5927/// Message Pipe status info
5928#[repr(C)]
5929#[derive(Debug, Copy)]
5930pub struct SceKernelMppInfo {
5931    pub size: SceSize,
5932    pub name: [libc::c_char; 32usize],
5933    pub attr: SceUInt,
5934    pub bufSize: libc::c_int,
5935    pub freeSize: libc::c_int,
5936    pub numSendWaitThreads: libc::c_int,
5937    pub numReceiveWaitThreads: libc::c_int,
5938}
5939#[test]
5940fn bindgen_test_layout_SceKernelMppInfo() {
5941    assert_eq!(::core::mem::size_of::<SceKernelMppInfo>() , 56usize , concat !
5942               ( "Size of: " , stringify ! ( SceKernelMppInfo ) ));
5943    assert_eq! (::core::mem::align_of::<SceKernelMppInfo>() , 4usize , concat
5944                ! ( "Alignment of " , stringify ! ( SceKernelMppInfo ) ));
5945    assert_eq! (unsafe {
5946                & ( * ( 0 as * const SceKernelMppInfo ) ) . size as * const _
5947                as usize } , 0usize , concat ! (
5948                "Alignment of field: " , stringify ! ( SceKernelMppInfo ) ,
5949                "::" , stringify ! ( size ) ));
5950    assert_eq! (unsafe {
5951                & ( * ( 0 as * const SceKernelMppInfo ) ) . name as * const _
5952                as usize } , 4usize , concat ! (
5953                "Alignment of field: " , stringify ! ( SceKernelMppInfo ) ,
5954                "::" , stringify ! ( name ) ));
5955    assert_eq! (unsafe {
5956                & ( * ( 0 as * const SceKernelMppInfo ) ) . attr as * const _
5957                as usize } , 36usize , concat ! (
5958                "Alignment of field: " , stringify ! ( SceKernelMppInfo ) ,
5959                "::" , stringify ! ( attr ) ));
5960    assert_eq! (unsafe {
5961                & ( * ( 0 as * const SceKernelMppInfo ) ) . bufSize as * const
5962                _ as usize } , 40usize , concat ! (
5963                "Alignment of field: " , stringify ! ( SceKernelMppInfo ) ,
5964                "::" , stringify ! ( bufSize ) ));
5965    assert_eq! (unsafe {
5966                & ( * ( 0 as * const SceKernelMppInfo ) ) . freeSize as *
5967                const _ as usize } , 44usize , concat ! (
5968                "Alignment of field: " , stringify ! ( SceKernelMppInfo ) ,
5969                "::" , stringify ! ( freeSize ) ));
5970    assert_eq! (unsafe {
5971                & ( * ( 0 as * const SceKernelMppInfo ) ) . numSendWaitThreads
5972                as * const _ as usize } , 48usize , concat ! (
5973                "Alignment of field: " , stringify ! ( SceKernelMppInfo ) ,
5974                "::" , stringify ! ( numSendWaitThreads ) ));
5975    assert_eq! (unsafe {
5976                & ( * ( 0 as * const SceKernelMppInfo ) ) .
5977                numReceiveWaitThreads as * const _ as usize } , 52usize ,
5978                concat ! (
5979                "Alignment of field: " , stringify ! ( SceKernelMppInfo ) ,
5980                "::" , stringify ! ( numReceiveWaitThreads ) ));
5981}
5982impl Clone for SceKernelMppInfo {
5983    fn clone(&self) -> Self { *self }
5984}
5985extern "C" {
5986    /// Get the status of a Message Pipe
5987///
5988/// @param uid - The uid of the Message Pipe
5989/// @param info - Pointer to a ::SceKernelMppInfo structure
5990///
5991/// @return 0 on success, < 0 on error
5992    pub fn sceKernelReferMsgPipeStatus(uid: SceUID,
5993                                       info: *mut SceKernelMppInfo)
5994     -> libc::c_int;
5995}
5996#[repr(C)]
5997#[derive(Debug, Copy)]
5998pub struct SceKernelVplOptParam {
5999    pub size: SceSize,
6000}
6001#[test]
6002fn bindgen_test_layout_SceKernelVplOptParam() {
6003    assert_eq!(::core::mem::size_of::<SceKernelVplOptParam>() , 4usize ,
6004               concat ! ( "Size of: " , stringify ! ( SceKernelVplOptParam )
6005               ));
6006    assert_eq! (::core::mem::align_of::<SceKernelVplOptParam>() , 4usize ,
6007                concat ! (
6008                "Alignment of " , stringify ! ( SceKernelVplOptParam ) ));
6009    assert_eq! (unsafe {
6010                & ( * ( 0 as * const SceKernelVplOptParam ) ) . size as *
6011                const _ as usize } , 0usize , concat ! (
6012                "Alignment of field: " , stringify ! ( SceKernelVplOptParam )
6013                , "::" , stringify ! ( size ) ));
6014}
6015impl Clone for SceKernelVplOptParam {
6016    fn clone(&self) -> Self { *self }
6017}
6018extern "C" {
6019    /// Create a variable pool
6020///
6021/// @param name - Name of the pool
6022/// @param part - The memory partition ID
6023/// @param attr - Attributes
6024/// @param size - Size of pool
6025/// @param opt  - Options (set to NULL)
6026///
6027/// @return The UID of the created pool, < 0 on error.
6028    pub fn sceKernelCreateVpl(name: *const libc::c_char, part: libc::c_int,
6029                              attr: libc::c_int, size: libc::c_uint,
6030                              opt: *mut SceKernelVplOptParam) -> SceUID;
6031}
6032extern "C" {
6033    /// Delete a variable pool
6034///
6035/// @param uid - The UID of the pool
6036///
6037/// @return 0 on success, < 0 on error
6038    pub fn sceKernelDeleteVpl(uid: SceUID) -> libc::c_int;
6039}
6040extern "C" {
6041    /// Allocate from the pool
6042///
6043/// @param uid - The UID of the pool
6044/// @param size - The size to allocate
6045/// @param data - Receives the address of the allocated data
6046/// @param timeout - Amount of time to wait for allocation?
6047///
6048/// @return 0 on success, < 0 on error
6049    pub fn sceKernelAllocateVpl(uid: SceUID, size: libc::c_uint,
6050                                data: *mut *mut libc::c_void,
6051                                timeout: *mut libc::c_uint) -> libc::c_int;
6052}
6053extern "C" {
6054    /// Allocate from the pool (with callback)
6055///
6056/// @param uid - The UID of the pool
6057/// @param size - The size to allocate
6058/// @param data - Receives the address of the allocated data
6059/// @param timeout - Amount of time to wait for allocation?
6060///
6061/// @return 0 on success, < 0 on error
6062    pub fn sceKernelAllocateVplCB(uid: SceUID, size: libc::c_uint,
6063                                  data: *mut *mut libc::c_void,
6064                                  timeout: *mut libc::c_uint) -> libc::c_int;
6065}
6066extern "C" {
6067    /// Try to allocate from the pool
6068///
6069/// @param uid - The UID of the pool
6070/// @param size - The size to allocate
6071/// @param data - Receives the address of the allocated data
6072///
6073/// @return 0 on success, < 0 on error
6074    pub fn sceKernelTryAllocateVpl(uid: SceUID, size: libc::c_uint,
6075                                   data: *mut *mut libc::c_void)
6076     -> libc::c_int;
6077}
6078extern "C" {
6079    /// Free a block
6080///
6081/// @param uid - The UID of the pool
6082/// @param data - The data block to deallocate
6083///
6084/// @return 0 on success, < 0 on error
6085    pub fn sceKernelFreeVpl(uid: SceUID, data: *mut libc::c_void)
6086     -> libc::c_int;
6087}
6088extern "C" {
6089    /// Cancel a pool
6090///
6091/// @param uid - The UID of the pool
6092/// @param pnum - Receives the number of waiting threads
6093///
6094/// @return 0 on success, < 0 on error
6095    pub fn sceKernelCancelVpl(uid: SceUID, pnum: *mut libc::c_int)
6096     -> libc::c_int;
6097}
6098/// Variable pool status info
6099#[repr(C)]
6100#[derive(Debug, Copy)]
6101pub struct SceKernelVplInfo {
6102    pub size: SceSize,
6103    pub name: [libc::c_char; 32usize],
6104    pub attr: SceUInt,
6105    pub poolSize: libc::c_int,
6106    pub freeSize: libc::c_int,
6107    pub numWaitThreads: libc::c_int,
6108}
6109#[test]
6110fn bindgen_test_layout_SceKernelVplInfo() {
6111    assert_eq!(::core::mem::size_of::<SceKernelVplInfo>() , 52usize , concat !
6112               ( "Size of: " , stringify ! ( SceKernelVplInfo ) ));
6113    assert_eq! (::core::mem::align_of::<SceKernelVplInfo>() , 4usize , concat
6114                ! ( "Alignment of " , stringify ! ( SceKernelVplInfo ) ));
6115    assert_eq! (unsafe {
6116                & ( * ( 0 as * const SceKernelVplInfo ) ) . size as * const _
6117                as usize } , 0usize , concat ! (
6118                "Alignment of field: " , stringify ! ( SceKernelVplInfo ) ,
6119                "::" , stringify ! ( size ) ));
6120    assert_eq! (unsafe {
6121                & ( * ( 0 as * const SceKernelVplInfo ) ) . name as * const _
6122                as usize } , 4usize , concat ! (
6123                "Alignment of field: " , stringify ! ( SceKernelVplInfo ) ,
6124                "::" , stringify ! ( name ) ));
6125    assert_eq! (unsafe {
6126                & ( * ( 0 as * const SceKernelVplInfo ) ) . attr as * const _
6127                as usize } , 36usize , concat ! (
6128                "Alignment of field: " , stringify ! ( SceKernelVplInfo ) ,
6129                "::" , stringify ! ( attr ) ));
6130    assert_eq! (unsafe {
6131                & ( * ( 0 as * const SceKernelVplInfo ) ) . poolSize as *
6132                const _ as usize } , 40usize , concat ! (
6133                "Alignment of field: " , stringify ! ( SceKernelVplInfo ) ,
6134                "::" , stringify ! ( poolSize ) ));
6135    assert_eq! (unsafe {
6136                & ( * ( 0 as * const SceKernelVplInfo ) ) . freeSize as *
6137                const _ as usize } , 44usize , concat ! (
6138                "Alignment of field: " , stringify ! ( SceKernelVplInfo ) ,
6139                "::" , stringify ! ( freeSize ) ));
6140    assert_eq! (unsafe {
6141                & ( * ( 0 as * const SceKernelVplInfo ) ) . numWaitThreads as
6142                * const _ as usize } , 48usize , concat ! (
6143                "Alignment of field: " , stringify ! ( SceKernelVplInfo ) ,
6144                "::" , stringify ! ( numWaitThreads ) ));
6145}
6146impl Clone for SceKernelVplInfo {
6147    fn clone(&self) -> Self { *self }
6148}
6149extern "C" {
6150    /// Get the status of an VPL
6151///
6152/// @param uid - The uid of the VPL
6153/// @param info - Pointer to a ::SceKernelVplInfo structure
6154///
6155/// @return 0 on success, < 0 on error
6156    pub fn sceKernelReferVplStatus(uid: SceUID, info: *mut SceKernelVplInfo)
6157     -> libc::c_int;
6158}
6159#[repr(C)]
6160#[derive(Debug, Copy)]
6161pub struct SceKernelFplOptParam {
6162    pub size: SceSize,
6163}
6164#[test]
6165fn bindgen_test_layout_SceKernelFplOptParam() {
6166    assert_eq!(::core::mem::size_of::<SceKernelFplOptParam>() , 4usize ,
6167               concat ! ( "Size of: " , stringify ! ( SceKernelFplOptParam )
6168               ));
6169    assert_eq! (::core::mem::align_of::<SceKernelFplOptParam>() , 4usize ,
6170                concat ! (
6171                "Alignment of " , stringify ! ( SceKernelFplOptParam ) ));
6172    assert_eq! (unsafe {
6173                & ( * ( 0 as * const SceKernelFplOptParam ) ) . size as *
6174                const _ as usize } , 0usize , concat ! (
6175                "Alignment of field: " , stringify ! ( SceKernelFplOptParam )
6176                , "::" , stringify ! ( size ) ));
6177}
6178impl Clone for SceKernelFplOptParam {
6179    fn clone(&self) -> Self { *self }
6180}
6181extern "C" {
6182    /// Create a fixed pool
6183///
6184/// @param name - Name of the pool
6185/// @param part - The memory partition ID
6186/// @param attr - Attributes
6187/// @param size - Size of pool block
6188/// @param blocks - Number of blocks to allocate
6189/// @param opt  - Options (set to NULL)
6190///
6191/// @return The UID of the created pool, < 0 on error.
6192    pub fn sceKernelCreateFpl(name: *const libc::c_char, part: libc::c_int,
6193                              attr: libc::c_int, size: libc::c_uint,
6194                              blocks: libc::c_uint,
6195                              opt: *mut SceKernelFplOptParam) -> libc::c_int;
6196}
6197extern "C" {
6198    /// Delete a fixed pool
6199///
6200/// @param uid - The UID of the pool
6201///
6202/// @return 0 on success, < 0 on error
6203    pub fn sceKernelDeleteFpl(uid: SceUID) -> libc::c_int;
6204}
6205extern "C" {
6206    /// Allocate from the pool
6207///
6208/// @param uid - The UID of the pool
6209/// @param data - Receives the address of the allocated data
6210/// @param timeout - Amount of time to wait for allocation?
6211///
6212/// @return 0 on success, < 0 on error
6213    pub fn sceKernelAllocateFpl(uid: SceUID, data: *mut *mut libc::c_void,
6214                                timeout: *mut libc::c_uint) -> libc::c_int;
6215}
6216extern "C" {
6217    /// Allocate from the pool (with callback)
6218///
6219/// @param uid - The UID of the pool
6220/// @param data - Receives the address of the allocated data
6221/// @param timeout - Amount of time to wait for allocation?
6222///
6223/// @return 0 on success, < 0 on error
6224    pub fn sceKernelAllocateFplCB(uid: SceUID, data: *mut *mut libc::c_void,
6225                                  timeout: *mut libc::c_uint) -> libc::c_int;
6226}
6227extern "C" {
6228    /// Try to allocate from the pool
6229///
6230/// @param uid - The UID of the pool
6231/// @param data - Receives the address of the allocated data
6232///
6233/// @return 0 on success, < 0 on error
6234    pub fn sceKernelTryAllocateFpl(uid: SceUID, data: *mut *mut libc::c_void)
6235     -> libc::c_int;
6236}
6237extern "C" {
6238    /// Free a block
6239///
6240/// @param uid - The UID of the pool
6241/// @param data - The data block to deallocate
6242///
6243/// @return 0 on success, < 0 on error
6244    pub fn sceKernelFreeFpl(uid: SceUID, data: *mut libc::c_void)
6245     -> libc::c_int;
6246}
6247extern "C" {
6248    /// Cancel a pool
6249///
6250/// @param uid - The UID of the pool
6251/// @param pnum - Receives the number of waiting threads
6252///
6253/// @return 0 on success, < 0 on error
6254    pub fn sceKernelCancelFpl(uid: SceUID, pnum: *mut libc::c_int)
6255     -> libc::c_int;
6256}
6257/// Fixed pool status information
6258#[repr(C)]
6259#[derive(Debug, Copy)]
6260pub struct SceKernelFplInfo {
6261    pub size: SceSize,
6262    pub name: [libc::c_char; 32usize],
6263    pub attr: SceUInt,
6264    pub blockSize: libc::c_int,
6265    pub numBlocks: libc::c_int,
6266    pub freeBlocks: libc::c_int,
6267    pub numWaitThreads: libc::c_int,
6268}
6269#[test]
6270fn bindgen_test_layout_SceKernelFplInfo() {
6271    assert_eq!(::core::mem::size_of::<SceKernelFplInfo>() , 56usize , concat !
6272               ( "Size of: " , stringify ! ( SceKernelFplInfo ) ));
6273    assert_eq! (::core::mem::align_of::<SceKernelFplInfo>() , 4usize , concat
6274                ! ( "Alignment of " , stringify ! ( SceKernelFplInfo ) ));
6275    assert_eq! (unsafe {
6276                & ( * ( 0 as * const SceKernelFplInfo ) ) . size as * const _
6277                as usize } , 0usize , concat ! (
6278                "Alignment of field: " , stringify ! ( SceKernelFplInfo ) ,
6279                "::" , stringify ! ( size ) ));
6280    assert_eq! (unsafe {
6281                & ( * ( 0 as * const SceKernelFplInfo ) ) . name as * const _
6282                as usize } , 4usize , concat ! (
6283                "Alignment of field: " , stringify ! ( SceKernelFplInfo ) ,
6284                "::" , stringify ! ( name ) ));
6285    assert_eq! (unsafe {
6286                & ( * ( 0 as * const SceKernelFplInfo ) ) . attr as * const _
6287                as usize } , 36usize , concat ! (
6288                "Alignment of field: " , stringify ! ( SceKernelFplInfo ) ,
6289                "::" , stringify ! ( attr ) ));
6290    assert_eq! (unsafe {
6291                & ( * ( 0 as * const SceKernelFplInfo ) ) . blockSize as *
6292                const _ as usize } , 40usize , concat ! (
6293                "Alignment of field: " , stringify ! ( SceKernelFplInfo ) ,
6294                "::" , stringify ! ( blockSize ) ));
6295    assert_eq! (unsafe {
6296                & ( * ( 0 as * const SceKernelFplInfo ) ) . numBlocks as *
6297                const _ as usize } , 44usize , concat ! (
6298                "Alignment of field: " , stringify ! ( SceKernelFplInfo ) ,
6299                "::" , stringify ! ( numBlocks ) ));
6300    assert_eq! (unsafe {
6301                & ( * ( 0 as * const SceKernelFplInfo ) ) . freeBlocks as *
6302                const _ as usize } , 48usize , concat ! (
6303                "Alignment of field: " , stringify ! ( SceKernelFplInfo ) ,
6304                "::" , stringify ! ( freeBlocks ) ));
6305    assert_eq! (unsafe {
6306                & ( * ( 0 as * const SceKernelFplInfo ) ) . numWaitThreads as
6307                * const _ as usize } , 52usize , concat ! (
6308                "Alignment of field: " , stringify ! ( SceKernelFplInfo ) ,
6309                "::" , stringify ! ( numWaitThreads ) ));
6310}
6311impl Clone for SceKernelFplInfo {
6312    fn clone(&self) -> Self { *self }
6313}
6314extern "C" {
6315    /// Get the status of an FPL
6316///
6317/// @param uid - The uid of the FPL
6318/// @param info - Pointer to a ::SceKernelFplInfo structure
6319///
6320/// @return 0 on success, < 0 on error
6321    pub fn sceKernelReferFplStatus(uid: SceUID, info: *mut SceKernelFplInfo)
6322     -> libc::c_int;
6323}
6324extern "C" {
6325    /// Return from a timer handler (doesn't seem to do alot)
6326    pub fn _sceKernelReturnFromTimerHandler();
6327}
6328extern "C" {
6329    /// Return from a callback (used as a syscall for the return
6330/// of the callback function)
6331    pub fn _sceKernelReturnFromCallback();
6332}
6333extern "C" {
6334    /// Convert a number of microseconds to a ::SceKernelSysClock structure
6335///
6336/// @param usec - Number of microseconds
6337/// @param clock - Pointer to a ::SceKernelSysClock structure
6338///
6339/// @return 0 on success, < 0 on error
6340    pub fn sceKernelUSec2SysClock(usec: libc::c_uint,
6341                                  clock: *mut SceKernelSysClock)
6342     -> libc::c_int;
6343}
6344extern "C" {
6345    /// Convert a number of microseconds to a wide time
6346///
6347/// @param usec - Number of microseconds.
6348///
6349/// @return The time
6350    pub fn sceKernelUSec2SysClockWide(usec: libc::c_uint) -> SceInt64;
6351}
6352extern "C" {
6353    /// Convert a ::SceKernelSysClock structure to microseconds
6354///
6355/// @param clock - Pointer to a ::SceKernelSysClock structure
6356/// @param low - Pointer to the low part of the time
6357/// @param high - Pointer to the high part of the time
6358///
6359/// @return 0 on success, < 0 on error
6360    pub fn sceKernelSysClock2USec(clock: *mut SceKernelSysClock,
6361                                  low: *mut libc::c_uint,
6362                                  high: *mut libc::c_uint) -> libc::c_int;
6363}
6364extern "C" {
6365    /// Convert a wide time to microseconds
6366///
6367/// @param clock - Wide time
6368/// @param low - Pointer to the low part of the time
6369/// @param high - Pointer to the high part of the time
6370///
6371/// @return 0 on success, < 0 on error
6372    pub fn sceKernelSysClock2USecWide(clock: SceInt64, low: *mut libc::c_uint,
6373                                      high: *mut libc::c_uint) -> libc::c_int;
6374}
6375extern "C" {
6376    /// Get the system time
6377///
6378/// @param time - Pointer to a ::SceKernelSysClock structure
6379///
6380/// @return 0 on success, < 0 on error
6381    pub fn sceKernelGetSystemTime(time: *mut SceKernelSysClock)
6382     -> libc::c_int;
6383}
6384extern "C" {
6385    /// Get the system time (wide version)
6386///
6387/// @return The system time
6388    pub fn sceKernelGetSystemTimeWide() -> SceInt64;
6389}
6390extern "C" {
6391    /// Get the low 32bits of the current system time
6392///
6393/// @return The low 32bits of the system time
6394    pub fn sceKernelGetSystemTimeLow() -> libc::c_uint;
6395}
6396#[repr(C)]
6397#[derive(Debug, Copy)]
6398pub struct SceKernelVTimerOptParam {
6399    pub size: SceSize,
6400}
6401#[test]
6402fn bindgen_test_layout_SceKernelVTimerOptParam() {
6403    assert_eq!(::core::mem::size_of::<SceKernelVTimerOptParam>() , 4usize ,
6404               concat ! (
6405               "Size of: " , stringify ! ( SceKernelVTimerOptParam ) ));
6406    assert_eq! (::core::mem::align_of::<SceKernelVTimerOptParam>() , 4usize ,
6407                concat ! (
6408                "Alignment of " , stringify ! ( SceKernelVTimerOptParam ) ));
6409    assert_eq! (unsafe {
6410                & ( * ( 0 as * const SceKernelVTimerOptParam ) ) . size as *
6411                const _ as usize } , 0usize , concat ! (
6412                "Alignment of field: " , stringify ! ( SceKernelVTimerOptParam
6413                ) , "::" , stringify ! ( size ) ));
6414}
6415impl Clone for SceKernelVTimerOptParam {
6416    fn clone(&self) -> Self { *self }
6417}
6418extern "C" {
6419    /// Create a virtual timer
6420///
6421/// @param name - Name for the timer.
6422/// @param opt  - Pointer to an ::SceKernelVTimerOptParam (pass NULL)
6423///
6424/// @return The VTimer's UID or < 0 on error.
6425    pub fn sceKernelCreateVTimer(name: *const libc::c_char,
6426                                 opt: *mut SceKernelVTimerOptParam) -> SceUID;
6427}
6428extern "C" {
6429    /// Delete a virtual timer
6430///
6431/// @param uid - The UID of the timer
6432///
6433/// @return < 0 on error.
6434    pub fn sceKernelDeleteVTimer(uid: SceUID) -> libc::c_int;
6435}
6436extern "C" {
6437    /// Get the timer base
6438///
6439/// @param uid - UID of the vtimer
6440/// @param base - Pointer to a ::SceKernelSysClock structure
6441///
6442/// @return 0 on success, < 0 on error
6443    pub fn sceKernelGetVTimerBase(uid: SceUID, base: *mut SceKernelSysClock)
6444     -> libc::c_int;
6445}
6446extern "C" {
6447    /// Get the timer base (wide format)
6448///
6449/// @param uid - UID of the vtimer
6450///
6451/// @return The 64bit timer base
6452    pub fn sceKernelGetVTimerBaseWide(uid: SceUID) -> SceInt64;
6453}
6454extern "C" {
6455    /// Get the timer time
6456///
6457/// @param uid - UID of the vtimer
6458/// @param time - Pointer to a ::SceKernelSysClock structure
6459///
6460/// @return 0 on success, < 0 on error
6461    pub fn sceKernelGetVTimerTime(uid: SceUID, time: *mut SceKernelSysClock)
6462     -> libc::c_int;
6463}
6464extern "C" {
6465    /// Get the timer time (wide format)
6466///
6467/// @param uid - UID of the vtimer
6468///
6469/// @return The 64bit timer time
6470    pub fn sceKernelGetVTimerTimeWide(uid: SceUID) -> SceInt64;
6471}
6472extern "C" {
6473    /// Set the timer time
6474///
6475/// @param uid - UID of the vtimer
6476/// @param time - Pointer to a ::SceKernelSysClock structure
6477///
6478/// @return 0 on success, < 0 on error
6479    pub fn sceKernelSetVTimerTime(uid: SceUID, time: *mut SceKernelSysClock)
6480     -> libc::c_int;
6481}
6482extern "C" {
6483    /// Set the timer time (wide format)
6484///
6485/// @param uid - UID of the vtimer
6486/// @param time - Pointer to a ::SceKernelSysClock structure
6487///
6488/// @return Possibly the last time
6489    pub fn sceKernelSetVTimerTimeWide(uid: SceUID, time: SceInt64)
6490     -> SceInt64;
6491}
6492extern "C" {
6493    /// Start a virtual timer
6494///
6495/// @param uid - The UID of the timer
6496///
6497/// @return < 0 on error
6498    pub fn sceKernelStartVTimer(uid: SceUID) -> libc::c_int;
6499}
6500extern "C" {
6501    /// Stop a virtual timer
6502///
6503/// @param uid - The UID of the timer
6504///
6505/// @return < 0 on error
6506    pub fn sceKernelStopVTimer(uid: SceUID) -> libc::c_int;
6507}
6508pub type SceKernelVTimerHandler =
6509    ::core::option::Option<unsafe extern "C" fn(uid: SceUID,
6510                                                arg1: *mut SceKernelSysClock,
6511                                                arg2: *mut SceKernelSysClock,
6512                                                arg3: *mut libc::c_void)
6513                               -> SceUInt>;
6514pub type SceKernelVTimerHandlerWide =
6515    ::core::option::Option<unsafe extern "C" fn(uid: SceUID, arg1: SceInt64,
6516                                                arg2: SceInt64,
6517                                                arg3: *mut libc::c_void)
6518                               -> SceUInt>;
6519extern "C" {
6520    /// Set the timer handler
6521///
6522/// @param uid - UID of the vtimer
6523/// @param time - Time to call the handler?
6524/// @param handler - The timer handler
6525/// @param common  - Common pointer
6526///
6527/// @return 0 on success, < 0 on error
6528    pub fn sceKernelSetVTimerHandler(uid: SceUID,
6529                                     time: *mut SceKernelSysClock,
6530                                     handler: SceKernelVTimerHandler,
6531                                     common: *mut libc::c_void)
6532     -> libc::c_int;
6533}
6534extern "C" {
6535    /// Set the timer handler (wide mode)
6536///
6537/// @param uid - UID of the vtimer
6538/// @param time - Time to call the handler?
6539/// @param handler - The timer handler
6540/// @param common  - Common pointer
6541///
6542/// @return 0 on success, < 0 on error
6543    pub fn sceKernelSetVTimerHandlerWide(uid: SceUID, time: SceInt64,
6544                                         handler: SceKernelVTimerHandlerWide,
6545                                         common: *mut libc::c_void)
6546     -> libc::c_int;
6547}
6548extern "C" {
6549    /// Cancel the timer handler
6550///
6551/// @param uid - The UID of the vtimer
6552///
6553/// @return 0 on success, < 0 on error
6554    pub fn sceKernelCancelVTimerHandler(uid: SceUID) -> libc::c_int;
6555}
6556#[repr(C)]
6557#[derive(Debug, Copy)]
6558pub struct SceKernelVTimerInfo {
6559    pub size: SceSize,
6560    pub name: [libc::c_char; 32usize],
6561    pub active: libc::c_int,
6562    pub base: SceKernelSysClock,
6563    pub current: SceKernelSysClock,
6564    pub schedule: SceKernelSysClock,
6565    pub handler: SceKernelVTimerHandler,
6566    pub common: *mut libc::c_void,
6567}
6568#[test]
6569fn bindgen_test_layout_SceKernelVTimerInfo() {
6570    assert_eq!(::core::mem::size_of::<SceKernelVTimerInfo>() , 80usize ,
6571               concat ! ( "Size of: " , stringify ! ( SceKernelVTimerInfo )
6572               ));
6573    assert_eq! (::core::mem::align_of::<SceKernelVTimerInfo>() , 8usize ,
6574                concat ! (
6575                "Alignment of " , stringify ! ( SceKernelVTimerInfo ) ));
6576    assert_eq! (unsafe {
6577                & ( * ( 0 as * const SceKernelVTimerInfo ) ) . size as * const
6578                _ as usize } , 0usize , concat ! (
6579                "Alignment of field: " , stringify ! ( SceKernelVTimerInfo ) ,
6580                "::" , stringify ! ( size ) ));
6581    assert_eq! (unsafe {
6582                & ( * ( 0 as * const SceKernelVTimerInfo ) ) . name as * const
6583                _ as usize } , 4usize , concat ! (
6584                "Alignment of field: " , stringify ! ( SceKernelVTimerInfo ) ,
6585                "::" , stringify ! ( name ) ));
6586    assert_eq! (unsafe {
6587                & ( * ( 0 as * const SceKernelVTimerInfo ) ) . active as *
6588                const _ as usize } , 36usize , concat ! (
6589                "Alignment of field: " , stringify ! ( SceKernelVTimerInfo ) ,
6590                "::" , stringify ! ( active ) ));
6591    assert_eq! (unsafe {
6592                & ( * ( 0 as * const SceKernelVTimerInfo ) ) . base as * const
6593                _ as usize } , 40usize , concat ! (
6594                "Alignment of field: " , stringify ! ( SceKernelVTimerInfo ) ,
6595                "::" , stringify ! ( base ) ));
6596    assert_eq! (unsafe {
6597                & ( * ( 0 as * const SceKernelVTimerInfo ) ) . current as *
6598                const _ as usize } , 48usize , concat ! (
6599                "Alignment of field: " , stringify ! ( SceKernelVTimerInfo ) ,
6600                "::" , stringify ! ( current ) ));
6601    assert_eq! (unsafe {
6602                & ( * ( 0 as * const SceKernelVTimerInfo ) ) . schedule as *
6603                const _ as usize } , 56usize , concat ! (
6604                "Alignment of field: " , stringify ! ( SceKernelVTimerInfo ) ,
6605                "::" , stringify ! ( schedule ) ));
6606    assert_eq! (unsafe {
6607                & ( * ( 0 as * const SceKernelVTimerInfo ) ) . handler as *
6608                const _ as usize } , 64usize , concat ! (
6609                "Alignment of field: " , stringify ! ( SceKernelVTimerInfo ) ,
6610                "::" , stringify ! ( handler ) ));
6611    assert_eq! (unsafe {
6612                & ( * ( 0 as * const SceKernelVTimerInfo ) ) . common as *
6613                const _ as usize } , 72usize , concat ! (
6614                "Alignment of field: " , stringify ! ( SceKernelVTimerInfo ) ,
6615                "::" , stringify ! ( common ) ));
6616}
6617impl Clone for SceKernelVTimerInfo {
6618    fn clone(&self) -> Self { *self }
6619}
6620extern "C" {
6621    /// Get the status of a VTimer
6622///
6623/// @param uid - The uid of the VTimer
6624/// @param info - Pointer to a ::SceKernelVTimerInfo structure
6625///
6626/// @return 0 on success, < 0 on error
6627    pub fn sceKernelReferVTimerStatus(uid: SceUID,
6628                                      info: *mut SceKernelVTimerInfo)
6629     -> libc::c_int;
6630}
6631extern "C" {
6632    /// Exit the thread (probably used as the syscall when the main thread
6633/// returns
6634    pub fn _sceKernelExitThread();
6635}
6636extern "C" {
6637    /// Get the type of a threadman uid
6638///
6639/// @param uid - The uid to get the type from
6640///
6641/// @return The type, < 0 on error
6642    pub fn sceKernelGetThreadmanIdType(uid: SceUID) -> SceKernelIdListType;
6643}
6644pub type SceKernelThreadEventHandler =
6645    ::core::option::Option<unsafe extern "C" fn(mask: libc::c_int,
6646                                                thid: SceUID,
6647                                                common: *mut libc::c_void)
6648                               -> libc::c_int>;
6649/// Struct for event handler info
6650#[repr(C)]
6651#[derive(Debug, Copy)]
6652pub struct SceKernelThreadEventHandlerInfo {
6653    pub size: SceSize,
6654    pub name: [libc::c_char; 32usize],
6655    pub threadId: SceUID,
6656    pub mask: libc::c_int,
6657    pub handler: SceKernelThreadEventHandler,
6658    pub common: *mut libc::c_void,
6659}
6660#[test]
6661fn bindgen_test_layout_SceKernelThreadEventHandlerInfo() {
6662    assert_eq!(::core::mem::size_of::<SceKernelThreadEventHandlerInfo>() ,
6663               64usize , concat ! (
6664               "Size of: " , stringify ! ( SceKernelThreadEventHandlerInfo )
6665               ));
6666    assert_eq! (::core::mem::align_of::<SceKernelThreadEventHandlerInfo>() ,
6667                8usize , concat ! (
6668                "Alignment of " , stringify ! (
6669                SceKernelThreadEventHandlerInfo ) ));
6670    assert_eq! (unsafe {
6671                & ( * ( 0 as * const SceKernelThreadEventHandlerInfo ) ) .
6672                size as * const _ as usize } , 0usize , concat ! (
6673                "Alignment of field: " , stringify ! (
6674                SceKernelThreadEventHandlerInfo ) , "::" , stringify ! ( size
6675                ) ));
6676    assert_eq! (unsafe {
6677                & ( * ( 0 as * const SceKernelThreadEventHandlerInfo ) ) .
6678                name as * const _ as usize } , 4usize , concat ! (
6679                "Alignment of field: " , stringify ! (
6680                SceKernelThreadEventHandlerInfo ) , "::" , stringify ! ( name
6681                ) ));
6682    assert_eq! (unsafe {
6683                & ( * ( 0 as * const SceKernelThreadEventHandlerInfo ) ) .
6684                threadId as * const _ as usize } , 36usize , concat ! (
6685                "Alignment of field: " , stringify ! (
6686                SceKernelThreadEventHandlerInfo ) , "::" , stringify ! (
6687                threadId ) ));
6688    assert_eq! (unsafe {
6689                & ( * ( 0 as * const SceKernelThreadEventHandlerInfo ) ) .
6690                mask as * const _ as usize } , 40usize , concat ! (
6691                "Alignment of field: " , stringify ! (
6692                SceKernelThreadEventHandlerInfo ) , "::" , stringify ! ( mask
6693                ) ));
6694    assert_eq! (unsafe {
6695                & ( * ( 0 as * const SceKernelThreadEventHandlerInfo ) ) .
6696                handler as * const _ as usize } , 48usize , concat ! (
6697                "Alignment of field: " , stringify ! (
6698                SceKernelThreadEventHandlerInfo ) , "::" , stringify ! (
6699                handler ) ));
6700    assert_eq! (unsafe {
6701                & ( * ( 0 as * const SceKernelThreadEventHandlerInfo ) ) .
6702                common as * const _ as usize } , 56usize , concat ! (
6703                "Alignment of field: " , stringify ! (
6704                SceKernelThreadEventHandlerInfo ) , "::" , stringify ! (
6705                common ) ));
6706}
6707impl Clone for SceKernelThreadEventHandlerInfo {
6708    fn clone(&self) -> Self { *self }
6709}
6710#[repr(u32)]
6711#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
6712pub enum ThreadEventIds {
6713    THREADEVENT_ALL = 4294967295,
6714    THREADEVENT_KERN = 4294967288,
6715    THREADEVENT_USER = 4294967280,
6716    THREADEVENT_CURRENT = 0,
6717}
6718#[repr(u32)]
6719#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
6720pub enum ThreadEvents {
6721    THREAD_CREATE = 1,
6722    THREAD_START = 2,
6723    THREAD_EXIT = 4,
6724    THREAD_DELETE = 8,
6725}
6726extern "C" {
6727    /// Register a thread event handler
6728///
6729/// @param name - Name for the thread event handler
6730/// @param threadID - Thread ID to monitor
6731/// @param mask - Bit mask for what events to handle (only lowest 4 bits valid)
6732/// @param handler - Pointer to a ::SceKernelThreadEventHandler function
6733/// @param common - Common pointer
6734///
6735/// @return The UID of the create event handler, < 0 on error
6736    pub fn sceKernelRegisterThreadEventHandler(name: *const libc::c_char,
6737                                               threadID: SceUID,
6738                                               mask: libc::c_int,
6739                                               handler:
6740                                                   SceKernelThreadEventHandler,
6741                                               common: *mut libc::c_void)
6742     -> SceUID;
6743}
6744extern "C" {
6745    /// Release a thread event handler.
6746///
6747/// @param uid - The UID of the event handler
6748///
6749/// @return 0 on success, < 0 on error
6750    pub fn sceKernelReleaseThreadEventHandler(uid: SceUID) -> libc::c_int;
6751}
6752extern "C" {
6753    /// Refer the status of an thread event handler
6754///
6755/// @param uid - The UID of the event handler
6756/// @param info - Pointer to a ::SceKernelThreadEventHandlerInfo structure
6757///
6758/// @return 0 on success, < 0 on error
6759    pub fn sceKernelReferThreadEventHandlerStatus(uid: SceUID,
6760                                                  info:
6761                                                      *mut SceKernelThreadEventHandlerInfo)
6762     -> libc::c_int;
6763}
6764extern "C" {
6765    /// Get the thread profiler registers.
6766/// @return Pointer to the registers, NULL on error
6767    pub fn sceKernelReferThreadProfiler() -> *mut PspDebugProfilerRegs;
6768}
6769extern "C" {
6770    /// Get the globile profiler registers.
6771/// @return Pointer to the registers, NULL on error
6772    pub fn sceKernelReferGlobalProfiler() -> *mut PspDebugProfilerRegs;
6773}
6774pub type __int8_t = libc::c_schar;
6775pub type __uint8_t = libc::c_uchar;
6776pub type __int16_t = libc::c_short;
6777pub type __uint16_t = libc::c_ushort;
6778pub type __int_least16_t = __int16_t;
6779pub type __uint_least16_t = __uint16_t;
6780pub type __int32_t = libc::c_int;
6781pub type __uint32_t = libc::c_uint;
6782pub type __int_least32_t = __int32_t;
6783pub type __uint_least32_t = __uint32_t;
6784pub type __int64_t = libc::c_long;
6785pub type __uint64_t = libc::c_ulong;
6786pub type _LOCK_T = libc::c_int;
6787pub type _LOCK_RECURSIVE_T = libc::c_int;
6788pub type _off_t = libc::c_long;
6789pub type __dev_t = libc::c_short;
6790pub type __uid_t = libc::c_ushort;
6791pub type __gid_t = libc::c_ushort;
6792pub type _off64_t = libc::c_longlong;
6793pub type _fpos_t = libc::c_long;
6794pub type _ssize_t = libc::c_int;
6795pub type wint_t = libc::c_uint;
6796#[repr(C)]
6797#[derive(Copy)]
6798pub struct _mbstate_t {
6799    pub __count: libc::c_int,
6800    pub __value: _mbstate_t__bindgen_ty_1,
6801}
6802#[repr(C)]
6803#[derive(Copy)]
6804pub union _mbstate_t__bindgen_ty_1 {
6805    pub __wch: wint_t,
6806    pub __wchb: [libc::c_uchar; 4usize],
6807    _bindgen_union_align: u32,
6808}
6809#[test]
6810fn bindgen_test_layout__mbstate_t__bindgen_ty_1() {
6811    assert_eq!(::core::mem::size_of::<_mbstate_t__bindgen_ty_1>() , 4usize ,
6812               concat ! (
6813               "Size of: " , stringify ! ( _mbstate_t__bindgen_ty_1 ) ));
6814    assert_eq! (::core::mem::align_of::<_mbstate_t__bindgen_ty_1>() , 4usize ,
6815                concat ! (
6816                "Alignment of " , stringify ! ( _mbstate_t__bindgen_ty_1 ) ));
6817    assert_eq! (unsafe {
6818                & ( * ( 0 as * const _mbstate_t__bindgen_ty_1 ) ) . __wch as *
6819                const _ as usize } , 0usize , concat ! (
6820                "Alignment of field: " , stringify ! (
6821                _mbstate_t__bindgen_ty_1 ) , "::" , stringify ! ( __wch ) ));
6822    assert_eq! (unsafe {
6823                & ( * ( 0 as * const _mbstate_t__bindgen_ty_1 ) ) . __wchb as
6824                * const _ as usize } , 0usize , concat ! (
6825                "Alignment of field: " , stringify ! (
6826                _mbstate_t__bindgen_ty_1 ) , "::" , stringify ! ( __wchb ) ));
6827}
6828impl Clone for _mbstate_t__bindgen_ty_1 {
6829    fn clone(&self) -> Self { *self }
6830}
6831#[test]
6832fn bindgen_test_layout__mbstate_t() {
6833    assert_eq!(::core::mem::size_of::<_mbstate_t>() , 8usize , concat ! (
6834               "Size of: " , stringify ! ( _mbstate_t ) ));
6835    assert_eq! (::core::mem::align_of::<_mbstate_t>() , 4usize , concat ! (
6836                "Alignment of " , stringify ! ( _mbstate_t ) ));
6837    assert_eq! (unsafe {
6838                & ( * ( 0 as * const _mbstate_t ) ) . __count as * const _ as
6839                usize } , 0usize , concat ! (
6840                "Alignment of field: " , stringify ! ( _mbstate_t ) , "::" ,
6841                stringify ! ( __count ) ));
6842    assert_eq! (unsafe {
6843                & ( * ( 0 as * const _mbstate_t ) ) . __value as * const _ as
6844                usize } , 4usize , concat ! (
6845                "Alignment of field: " , stringify ! ( _mbstate_t ) , "::" ,
6846                stringify ! ( __value ) ));
6847}
6848impl Clone for _mbstate_t {
6849    fn clone(&self) -> Self { *self }
6850}
6851pub type _flock_t = _LOCK_RECURSIVE_T;
6852pub type _iconv_t = *mut libc::c_void;
6853pub type wchar_t = libc::c_int;
6854#[repr(C)]
6855#[derive(Debug, Copy)]
6856pub struct max_align_t {
6857    pub __clang_max_align_nonce1: libc::c_longlong,
6858    pub __bindgen_padding_0: u64,
6859    pub __clang_max_align_nonce2: f64,
6860}
6861#[test]
6862fn bindgen_test_layout_max_align_t() {
6863    assert_eq!(::core::mem::size_of::<max_align_t>() , 32usize , concat ! (
6864               "Size of: " , stringify ! ( max_align_t ) ));
6865    assert_eq! (unsafe {
6866                & ( * ( 0 as * const max_align_t ) ) .
6867                __clang_max_align_nonce1 as * const _ as usize } , 0usize ,
6868                concat ! (
6869                "Alignment of field: " , stringify ! ( max_align_t ) , "::" ,
6870                stringify ! ( __clang_max_align_nonce1 ) ));
6871    assert_eq! (unsafe {
6872                & ( * ( 0 as * const max_align_t ) ) .
6873                __clang_max_align_nonce2 as * const _ as usize } , 16usize ,
6874                concat ! (
6875                "Alignment of field: " , stringify ! ( max_align_t ) , "::" ,
6876                stringify ! ( __clang_max_align_nonce2 ) ));
6877}
6878impl Clone for max_align_t {
6879    fn clone(&self) -> Self { *self }
6880}
6881pub type __off_t = libc::c_long;
6882pub type __pid_t = libc::c_int;
6883pub type __loff_t = libc::c_longlong;
6884pub type u_char = libc::c_uchar;
6885pub type u_short = libc::c_ushort;
6886pub type u_int = libc::c_uint;
6887pub type u_long = libc::c_ulong;
6888pub type ushort = libc::c_ushort;
6889pub type uint = libc::c_uint;
6890pub type ulong = libc::c_ulong;
6891pub type clock_t = libc::c_ulong;
6892pub type time_t = libc::c_long;
6893#[repr(C)]
6894#[derive(Debug, Copy)]
6895pub struct timespec {
6896    pub tv_sec: time_t,
6897    pub tv_nsec: libc::c_long,
6898}
6899#[test]
6900fn bindgen_test_layout_timespec() {
6901    assert_eq!(::core::mem::size_of::<timespec>() , 16usize , concat ! (
6902               "Size of: " , stringify ! ( timespec ) ));
6903    assert_eq! (::core::mem::align_of::<timespec>() , 8usize , concat ! (
6904                "Alignment of " , stringify ! ( timespec ) ));
6905    assert_eq! (unsafe {
6906                & ( * ( 0 as * const timespec ) ) . tv_sec as * const _ as
6907                usize } , 0usize , concat ! (
6908                "Alignment of field: " , stringify ! ( timespec ) , "::" ,
6909                stringify ! ( tv_sec ) ));
6910    assert_eq! (unsafe {
6911                & ( * ( 0 as * const timespec ) ) . tv_nsec as * const _ as
6912                usize } , 8usize , concat ! (
6913                "Alignment of field: " , stringify ! ( timespec ) , "::" ,
6914                stringify ! ( tv_nsec ) ));
6915}
6916impl Clone for timespec {
6917    fn clone(&self) -> Self { *self }
6918}
6919#[repr(C)]
6920#[derive(Debug, Copy)]
6921pub struct itimerspec {
6922    pub it_interval: timespec,
6923    pub it_value: timespec,
6924}
6925#[test]
6926fn bindgen_test_layout_itimerspec() {
6927    assert_eq!(::core::mem::size_of::<itimerspec>() , 32usize , concat ! (
6928               "Size of: " , stringify ! ( itimerspec ) ));
6929    assert_eq! (::core::mem::align_of::<itimerspec>() , 8usize , concat ! (
6930                "Alignment of " , stringify ! ( itimerspec ) ));
6931    assert_eq! (unsafe {
6932                & ( * ( 0 as * const itimerspec ) ) . it_interval as * const _
6933                as usize } , 0usize , concat ! (
6934                "Alignment of field: " , stringify ! ( itimerspec ) , "::" ,
6935                stringify ! ( it_interval ) ));
6936    assert_eq! (unsafe {
6937                & ( * ( 0 as * const itimerspec ) ) . it_value as * const _ as
6938                usize } , 16usize , concat ! (
6939                "Alignment of field: " , stringify ! ( itimerspec ) , "::" ,
6940                stringify ! ( it_value ) ));
6941}
6942impl Clone for itimerspec {
6943    fn clone(&self) -> Self { *self }
6944}
6945pub type daddr_t = libc::c_long;
6946pub type caddr_t = *mut libc::c_char;
6947pub type ino_t = libc::c_ushort;
6948pub type off_t = _off_t;
6949pub type dev_t = __dev_t;
6950pub type uid_t = __uid_t;
6951pub type gid_t = __gid_t;
6952pub type pid_t = libc::c_int;
6953pub type key_t = libc::c_long;
6954pub type mode_t = libc::c_uint;
6955pub type nlink_t = libc::c_ushort;
6956pub type fd_mask = libc::c_long;
6957#[repr(C)]
6958#[derive(Debug, Copy)]
6959pub struct _types_fd_set {
6960    pub fds_bits: [fd_mask; 1usize],
6961}
6962#[test]
6963fn bindgen_test_layout__types_fd_set() {
6964    assert_eq!(::core::mem::size_of::<_types_fd_set>() , 8usize , concat ! (
6965               "Size of: " , stringify ! ( _types_fd_set ) ));
6966    assert_eq! (::core::mem::align_of::<_types_fd_set>() , 8usize , concat ! (
6967                "Alignment of " , stringify ! ( _types_fd_set ) ));
6968    assert_eq! (unsafe {
6969                & ( * ( 0 as * const _types_fd_set ) ) . fds_bits as * const _
6970                as usize } , 0usize , concat ! (
6971                "Alignment of field: " , stringify ! ( _types_fd_set ) , "::"
6972                , stringify ! ( fds_bits ) ));
6973}
6974impl Clone for _types_fd_set {
6975    fn clone(&self) -> Self { *self }
6976}
6977pub type clockid_t = libc::c_ulong;
6978pub type timer_t = libc::c_ulong;
6979pub type useconds_t = libc::c_ulong;
6980pub type suseconds_t = libc::c_long;
6981#[repr(C)]
6982#[derive(Debug, Copy)]
6983pub struct timeval {
6984    pub tv_sec: time_t,
6985    pub tv_usec: suseconds_t,
6986}
6987#[test]
6988fn bindgen_test_layout_timeval() {
6989    assert_eq!(::core::mem::size_of::<timeval>() , 16usize , concat ! (
6990               "Size of: " , stringify ! ( timeval ) ));
6991    assert_eq! (::core::mem::align_of::<timeval>() , 8usize , concat ! (
6992                "Alignment of " , stringify ! ( timeval ) ));
6993    assert_eq! (unsafe {
6994                & ( * ( 0 as * const timeval ) ) . tv_sec as * const _ as
6995                usize } , 0usize , concat ! (
6996                "Alignment of field: " , stringify ! ( timeval ) , "::" ,
6997                stringify ! ( tv_sec ) ));
6998    assert_eq! (unsafe {
6999                & ( * ( 0 as * const timeval ) ) . tv_usec as * const _ as
7000                usize } , 8usize , concat ! (
7001                "Alignment of field: " , stringify ! ( timeval ) , "::" ,
7002                stringify ! ( tv_usec ) ));
7003}
7004impl Clone for timeval {
7005    fn clone(&self) -> Self { *self }
7006}
7007#[repr(C)]
7008#[derive(Debug, Copy)]
7009pub struct timezone {
7010    pub tz_minuteswest: libc::c_int,
7011    pub tz_dsttime: libc::c_int,
7012}
7013#[test]
7014fn bindgen_test_layout_timezone() {
7015    assert_eq!(::core::mem::size_of::<timezone>() , 8usize , concat ! (
7016               "Size of: " , stringify ! ( timezone ) ));
7017    assert_eq! (::core::mem::align_of::<timezone>() , 4usize , concat ! (
7018                "Alignment of " , stringify ! ( timezone ) ));
7019    assert_eq! (unsafe {
7020                & ( * ( 0 as * const timezone ) ) . tz_minuteswest as * const
7021                _ as usize } , 0usize , concat ! (
7022                "Alignment of field: " , stringify ! ( timezone ) , "::" ,
7023                stringify ! ( tz_minuteswest ) ));
7024    assert_eq! (unsafe {
7025                & ( * ( 0 as * const timezone ) ) . tz_dsttime as * const _ as
7026                usize } , 4usize , concat ! (
7027                "Alignment of field: " , stringify ! ( timezone ) , "::" ,
7028                stringify ! ( tz_dsttime ) ));
7029}
7030impl Clone for timezone {
7031    fn clone(&self) -> Self { *self }
7032}
7033#[repr(C)]
7034#[derive(Debug, Copy)]
7035pub struct itimerval {
7036    pub it_interval: timeval,
7037    pub it_value: timeval,
7038}
7039#[test]
7040fn bindgen_test_layout_itimerval() {
7041    assert_eq!(::core::mem::size_of::<itimerval>() , 32usize , concat ! (
7042               "Size of: " , stringify ! ( itimerval ) ));
7043    assert_eq! (::core::mem::align_of::<itimerval>() , 8usize , concat ! (
7044                "Alignment of " , stringify ! ( itimerval ) ));
7045    assert_eq! (unsafe {
7046                & ( * ( 0 as * const itimerval ) ) . it_interval as * const _
7047                as usize } , 0usize , concat ! (
7048                "Alignment of field: " , stringify ! ( itimerval ) , "::" ,
7049                stringify ! ( it_interval ) ));
7050    assert_eq! (unsafe {
7051                & ( * ( 0 as * const itimerval ) ) . it_value as * const _ as
7052                usize } , 16usize , concat ! (
7053                "Alignment of field: " , stringify ! ( itimerval ) , "::" ,
7054                stringify ! ( it_value ) ));
7055}
7056impl Clone for itimerval {
7057    fn clone(&self) -> Self { *self }
7058}
7059extern "C" {
7060    pub fn gettimeofday(__p: *mut timeval, __tz: *mut libc::c_void)
7061     -> libc::c_int;
7062}
7063extern "C" {
7064    pub fn settimeofday(arg1: *const timeval, arg2: *const timezone)
7065     -> libc::c_int;
7066}
7067extern "C" {
7068    pub fn utimes(__path: *const libc::c_char, __tvp: *const timeval)
7069     -> libc::c_int;
7070}
7071extern "C" {
7072    pub fn getitimer(__which: libc::c_int, __value: *mut itimerval)
7073     -> libc::c_int;
7074}
7075extern "C" {
7076    pub fn setitimer(__which: libc::c_int, __value: *const itimerval,
7077                     __ovalue: *mut itimerval) -> libc::c_int;
7078}
7079extern "C" {
7080    /// Get the time in seconds since the epoc (1st Jan 1970)
7081///
7082    pub fn sceKernelLibcTime(t: *mut time_t) -> time_t;
7083}
7084extern "C" {
7085    /// Get the processor clock used since the start of the process
7086    pub fn sceKernelLibcClock() -> clock_t;
7087}
7088extern "C" {
7089    /// Get the current time of time and time zone information
7090    pub fn sceKernelLibcGettimeofday(tp: *mut timeval, tzp: *mut timezone)
7091     -> libc::c_int;
7092}
7093extern "C" {
7094    /// Write back the data cache to memory
7095    pub fn sceKernelDcacheWritebackAll();
7096}
7097extern "C" {
7098    /// Write back and invalidate the data cache
7099    pub fn sceKernelDcacheWritebackInvalidateAll();
7100}
7101extern "C" {
7102    /// Write back a range of addresses from the data cache to memory
7103    pub fn sceKernelDcacheWritebackRange(p: *const libc::c_void,
7104                                         size: libc::c_uint);
7105}
7106extern "C" {
7107    /// Write back and invalidate a range of addresses in the data cache
7108    pub fn sceKernelDcacheWritebackInvalidateRange(p: *const libc::c_void,
7109                                                   size: libc::c_uint);
7110}
7111extern "C" {
7112    /// Invalidate a range of addresses in data cache
7113    pub fn sceKernelDcacheInvalidateRange(p: *const libc::c_void,
7114                                          size: libc::c_uint);
7115}
7116extern "C" {
7117    /// Invalidate the instruction cache
7118    pub fn sceKernelIcacheInvalidateAll();
7119}
7120extern "C" {
7121    /// Invalidate a range of addresses in the instruction cache
7122    pub fn sceKernelIcacheInvalidateRange(p: *const libc::c_void,
7123                                          size: libc::c_uint);
7124}
7125/// Structure for holding a mersenne twister context
7126#[repr(C)]
7127#[derive(Copy)]
7128pub struct _SceKernelUtilsMt19937Context {
7129    pub count: libc::c_uint,
7130    pub state: [libc::c_uint; 624usize],
7131}
7132#[test]
7133fn bindgen_test_layout__SceKernelUtilsMt19937Context() {
7134    assert_eq!(::core::mem::size_of::<_SceKernelUtilsMt19937Context>() ,
7135               2500usize , concat ! (
7136               "Size of: " , stringify ! ( _SceKernelUtilsMt19937Context ) ));
7137    assert_eq! (::core::mem::align_of::<_SceKernelUtilsMt19937Context>() ,
7138                4usize , concat ! (
7139                "Alignment of " , stringify ! ( _SceKernelUtilsMt19937Context
7140                ) ));
7141    assert_eq! (unsafe {
7142                & ( * ( 0 as * const _SceKernelUtilsMt19937Context ) ) . count
7143                as * const _ as usize } , 0usize , concat ! (
7144                "Alignment of field: " , stringify ! (
7145                _SceKernelUtilsMt19937Context ) , "::" , stringify ! ( count )
7146                ));
7147    assert_eq! (unsafe {
7148                & ( * ( 0 as * const _SceKernelUtilsMt19937Context ) ) . state
7149                as * const _ as usize } , 4usize , concat ! (
7150                "Alignment of field: " , stringify ! (
7151                _SceKernelUtilsMt19937Context ) , "::" , stringify ! ( state )
7152                ));
7153}
7154impl Clone for _SceKernelUtilsMt19937Context {
7155    fn clone(&self) -> Self { *self }
7156}
7157/// Structure for holding a mersenne twister context
7158pub type SceKernelUtilsMt19937Context = _SceKernelUtilsMt19937Context;
7159extern "C" {
7160    /// Function to initialise a mersenne twister context.
7161///
7162/// @param ctx - Pointer to a context
7163/// @param seed - A seed for the random function.
7164///
7165/// @par Example:
7166/// @code
7167/// SceKernelUtilsMt19937Context ctx;
7168/// sceKernelUtilsMt19937Init(&ctx, time(NULL));
7169/// u23 rand_val = sceKernelUtilsMt19937UInt(&ctx);
7170/// @endcode
7171///
7172/// @return < 0 on error.
7173    pub fn sceKernelUtilsMt19937Init(ctx: *mut SceKernelUtilsMt19937Context,
7174                                     seed: u32) -> libc::c_int;
7175}
7176extern "C" {
7177    /// Function to return a new psuedo random number.
7178///
7179/// @param ctx - Pointer to a pre-initialised context.
7180/// @return A pseudo random number (between 0 and MAX_INT).
7181    pub fn sceKernelUtilsMt19937UInt(ctx: *mut SceKernelUtilsMt19937Context)
7182     -> u32;
7183}
7184/// Structure to hold the MD5 context
7185#[repr(C)]
7186#[derive(Copy)]
7187pub struct _SceKernelUtilsMd5Context {
7188    pub h: [libc::c_uint; 4usize],
7189    pub pad: libc::c_uint,
7190    pub usRemains: SceUShort16,
7191    pub usComputed: SceUShort16,
7192    pub ullTotalLen: SceULong64,
7193    pub buf: [libc::c_uchar; 64usize],
7194}
7195#[test]
7196fn bindgen_test_layout__SceKernelUtilsMd5Context() {
7197    assert_eq!(::core::mem::size_of::<_SceKernelUtilsMd5Context>() , 96usize ,
7198               concat ! (
7199               "Size of: " , stringify ! ( _SceKernelUtilsMd5Context ) ));
7200    assert_eq! (::core::mem::align_of::<_SceKernelUtilsMd5Context>() , 8usize
7201                , concat ! (
7202                "Alignment of " , stringify ! ( _SceKernelUtilsMd5Context )
7203                ));
7204    assert_eq! (unsafe {
7205                & ( * ( 0 as * const _SceKernelUtilsMd5Context ) ) . h as *
7206                const _ as usize } , 0usize , concat ! (
7207                "Alignment of field: " , stringify ! (
7208                _SceKernelUtilsMd5Context ) , "::" , stringify ! ( h ) ));
7209    assert_eq! (unsafe {
7210                & ( * ( 0 as * const _SceKernelUtilsMd5Context ) ) . pad as *
7211                const _ as usize } , 16usize , concat ! (
7212                "Alignment of field: " , stringify ! (
7213                _SceKernelUtilsMd5Context ) , "::" , stringify ! ( pad ) ));
7214    assert_eq! (unsafe {
7215                & ( * ( 0 as * const _SceKernelUtilsMd5Context ) ) . usRemains
7216                as * const _ as usize } , 20usize , concat ! (
7217                "Alignment of field: " , stringify ! (
7218                _SceKernelUtilsMd5Context ) , "::" , stringify ! ( usRemains )
7219                ));
7220    assert_eq! (unsafe {
7221                & ( * ( 0 as * const _SceKernelUtilsMd5Context ) ) .
7222                usComputed as * const _ as usize } , 22usize , concat ! (
7223                "Alignment of field: " , stringify ! (
7224                _SceKernelUtilsMd5Context ) , "::" , stringify ! ( usComputed
7225                ) ));
7226    assert_eq! (unsafe {
7227                & ( * ( 0 as * const _SceKernelUtilsMd5Context ) ) .
7228                ullTotalLen as * const _ as usize } , 24usize , concat ! (
7229                "Alignment of field: " , stringify ! (
7230                _SceKernelUtilsMd5Context ) , "::" , stringify ! ( ullTotalLen
7231                ) ));
7232    assert_eq! (unsafe {
7233                & ( * ( 0 as * const _SceKernelUtilsMd5Context ) ) . buf as *
7234                const _ as usize } , 32usize , concat ! (
7235                "Alignment of field: " , stringify ! (
7236                _SceKernelUtilsMd5Context ) , "::" , stringify ! ( buf ) ));
7237}
7238impl Clone for _SceKernelUtilsMd5Context {
7239    fn clone(&self) -> Self { *self }
7240}
7241/// Structure to hold the MD5 context
7242pub type SceKernelUtilsMd5Context = _SceKernelUtilsMd5Context;
7243extern "C" {
7244    /// Function to perform an MD5 digest of a data block.
7245///
7246/// @param data - Pointer to a data block to make a digest of.
7247/// @param size - Size of the data block.
7248/// @param digest - Pointer to a 16byte buffer to store the resulting digest
7249///
7250/// @return < 0 on error.
7251    pub fn sceKernelUtilsMd5Digest(data: *mut u8, size: u32, digest: *mut u8)
7252     -> libc::c_int;
7253}
7254extern "C" {
7255    /// Function to initialise a MD5 digest context
7256///
7257/// @param ctx - A context block to initialise
7258///
7259/// @return < 0 on error.
7260/// @par Example:
7261/// @code
7262/// SceKernelUtilsMd5Context ctx;
7263/// u8 digest[16];
7264/// sceKernelUtilsMd5BlockInit(&ctx);
7265/// sceKernelUtilsMd5BlockUpdate(&ctx, (u8*) "Hello", 5);
7266/// sceKernelUtilsMd5BlockResult(&ctx, digest);
7267/// @endcode
7268    pub fn sceKernelUtilsMd5BlockInit(ctx: *mut SceKernelUtilsMd5Context)
7269     -> libc::c_int;
7270}
7271extern "C" {
7272    /// Function to update the MD5 digest with a block of data.
7273///
7274/// @param ctx - A filled in context block.
7275/// @param data - The data block to hash.
7276/// @param size - The size of the data to hash
7277///
7278/// @return < 0 on error.
7279    pub fn sceKernelUtilsMd5BlockUpdate(ctx: *mut SceKernelUtilsMd5Context,
7280                                        data: *mut u8, size: u32)
7281     -> libc::c_int;
7282}
7283extern "C" {
7284    /// Function to get the digest result of the MD5 hash.
7285///
7286/// @param ctx - A filled in context block.
7287/// @param digest - A 16 byte array to hold the digest.
7288///
7289/// @return < 0 on error.
7290    pub fn sceKernelUtilsMd5BlockResult(ctx: *mut SceKernelUtilsMd5Context,
7291                                        digest: *mut u8) -> libc::c_int;
7292}
7293/// Type to hold a sha1 context
7294#[repr(C)]
7295#[derive(Copy)]
7296pub struct _SceKernelUtilsSha1Context {
7297    pub h: [libc::c_uint; 5usize],
7298    pub usRemains: SceUShort16,
7299    pub usComputed: SceUShort16,
7300    pub ullTotalLen: SceULong64,
7301    pub buf: [libc::c_uchar; 64usize],
7302}
7303#[test]
7304fn bindgen_test_layout__SceKernelUtilsSha1Context() {
7305    assert_eq!(::core::mem::size_of::<_SceKernelUtilsSha1Context>() , 96usize
7306               , concat ! (
7307               "Size of: " , stringify ! ( _SceKernelUtilsSha1Context ) ));
7308    assert_eq! (::core::mem::align_of::<_SceKernelUtilsSha1Context>() , 8usize
7309                , concat ! (
7310                "Alignment of " , stringify ! ( _SceKernelUtilsSha1Context )
7311                ));
7312    assert_eq! (unsafe {
7313                & ( * ( 0 as * const _SceKernelUtilsSha1Context ) ) . h as *
7314                const _ as usize } , 0usize , concat ! (
7315                "Alignment of field: " , stringify ! (
7316                _SceKernelUtilsSha1Context ) , "::" , stringify ! ( h ) ));
7317    assert_eq! (unsafe {
7318                & ( * ( 0 as * const _SceKernelUtilsSha1Context ) ) .
7319                usRemains as * const _ as usize } , 20usize , concat ! (
7320                "Alignment of field: " , stringify ! (
7321                _SceKernelUtilsSha1Context ) , "::" , stringify ! ( usRemains
7322                ) ));
7323    assert_eq! (unsafe {
7324                & ( * ( 0 as * const _SceKernelUtilsSha1Context ) ) .
7325                usComputed as * const _ as usize } , 22usize , concat ! (
7326                "Alignment of field: " , stringify ! (
7327                _SceKernelUtilsSha1Context ) , "::" , stringify ! ( usComputed
7328                ) ));
7329    assert_eq! (unsafe {
7330                & ( * ( 0 as * const _SceKernelUtilsSha1Context ) ) .
7331                ullTotalLen as * const _ as usize } , 24usize , concat ! (
7332                "Alignment of field: " , stringify ! (
7333                _SceKernelUtilsSha1Context ) , "::" , stringify ! (
7334                ullTotalLen ) ));
7335    assert_eq! (unsafe {
7336                & ( * ( 0 as * const _SceKernelUtilsSha1Context ) ) . buf as *
7337                const _ as usize } , 32usize , concat ! (
7338                "Alignment of field: " , stringify ! (
7339                _SceKernelUtilsSha1Context ) , "::" , stringify ! ( buf ) ));
7340}
7341impl Clone for _SceKernelUtilsSha1Context {
7342    fn clone(&self) -> Self { *self }
7343}
7344/// Type to hold a sha1 context
7345pub type SceKernelUtilsSha1Context = _SceKernelUtilsSha1Context;
7346extern "C" {
7347    /// Function to SHA1 hash a data block.
7348///
7349/// @param data - The data to hash.
7350/// @param size - The size of the data.
7351/// @param digest - Pointer to a 20 byte array for storing the digest
7352///
7353/// @return < 0 on error.
7354    pub fn sceKernelUtilsSha1Digest(data: *mut u8, size: u32, digest: *mut u8)
7355     -> libc::c_int;
7356}
7357extern "C" {
7358    /// Function to initialise a context for SHA1 hashing.
7359///
7360/// @param ctx - Pointer to a context.
7361///
7362/// @return < 0 on error.
7363///
7364/// @par Example:
7365/// @code
7366/// SceKernelUtilsSha1Context ctx;
7367/// u8 digest[20];
7368/// sceKernelUtilsSha1BlockInit(&ctx);
7369/// sceKernelUtilsSha1BlockUpdate(&ctx, (u8*) "Hello", 5);
7370/// sceKernelUtilsSha1BlockResult(&ctx, digest);
7371/// @endcode
7372    pub fn sceKernelUtilsSha1BlockInit(ctx: *mut SceKernelUtilsSha1Context)
7373     -> libc::c_int;
7374}
7375extern "C" {
7376    /// Function to update the current hash.
7377///
7378/// @param ctx - Pointer to a prefilled context.
7379/// @param data - The data block to hash.
7380/// @param size - The size of the data block
7381///
7382/// @return < 0 on error.
7383    pub fn sceKernelUtilsSha1BlockUpdate(ctx: *mut SceKernelUtilsSha1Context,
7384                                         data: *mut u8, size: u32)
7385     -> libc::c_int;
7386}
7387extern "C" {
7388    /// Function to get the result of the SHA1 hash.
7389///
7390/// @param ctx - Pointer to a prefilled context.
7391/// @param digest - A pointer to a 20 byte array to contain the digest.
7392///
7393/// @return < 0 on error.
7394    pub fn sceKernelUtilsSha1BlockResult(ctx: *mut SceKernelUtilsSha1Context,
7395                                         digest: *mut u8) -> libc::c_int;
7396}
7397#[repr(u32)]
7398#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
7399pub enum PspKernelErrorCodes {
7400    SCE_KERNEL_ERROR_OK = 0,
7401    SCE_KERNEL_ERROR_ERROR = 2147614721,
7402    SCE_KERNEL_ERROR_NOTIMP = 2147614722,
7403    SCE_KERNEL_ERROR_ILLEGAL_EXPCODE = 2147614770,
7404    SCE_KERNEL_ERROR_EXPHANDLER_NOUSE = 2147614771,
7405    SCE_KERNEL_ERROR_EXPHANDLER_USED = 2147614772,
7406    SCE_KERNEL_ERROR_SYCALLTABLE_NOUSED = 2147614773,
7407    SCE_KERNEL_ERROR_SYCALLTABLE_USED = 2147614774,
7408    SCE_KERNEL_ERROR_ILLEGAL_SYSCALLTABLE = 2147614775,
7409    SCE_KERNEL_ERROR_ILLEGAL_PRIMARY_SYSCALL_NUMBER = 2147614776,
7410    SCE_KERNEL_ERROR_PRIMARY_SYSCALL_NUMBER_INUSE = 2147614777,
7411    SCE_KERNEL_ERROR_ILLEGAL_CONTEXT = 2147614820,
7412    SCE_KERNEL_ERROR_ILLEGAL_INTRCODE = 2147614821,
7413    SCE_KERNEL_ERROR_CPUDI = 2147614822,
7414    SCE_KERNEL_ERROR_FOUND_HANDLER = 2147614823,
7415    SCE_KERNEL_ERROR_NOTFOUND_HANDLER = 2147614824,
7416    SCE_KERNEL_ERROR_ILLEGAL_INTRLEVEL = 2147614825,
7417    SCE_KERNEL_ERROR_ILLEGAL_ADDRESS = 2147614826,
7418    SCE_KERNEL_ERROR_ILLEGAL_INTRPARAM = 2147614827,
7419    SCE_KERNEL_ERROR_ILLEGAL_STACK_ADDRESS = 2147614828,
7420    SCE_KERNEL_ERROR_ALREADY_STACK_SET = 2147614829,
7421    SCE_KERNEL_ERROR_NO_TIMER = 2147614870,
7422    SCE_KERNEL_ERROR_ILLEGAL_TIMERID = 2147614871,
7423    SCE_KERNEL_ERROR_ILLEGAL_SOURCE = 2147614872,
7424    SCE_KERNEL_ERROR_ILLEGAL_PRESCALE = 2147614873,
7425    SCE_KERNEL_ERROR_TIMER_BUSY = 2147614874,
7426    SCE_KERNEL_ERROR_TIMER_NOT_SETUP = 2147614875,
7427    SCE_KERNEL_ERROR_TIMER_NOT_INUSE = 2147614876,
7428    SCE_KERNEL_ERROR_UNIT_USED = 2147614880,
7429    SCE_KERNEL_ERROR_UNIT_NOUSE = 2147614881,
7430    SCE_KERNEL_ERROR_NO_ROMDIR = 2147614882,
7431    SCE_KERNEL_ERROR_IDTYPE_EXIST = 2147614920,
7432    SCE_KERNEL_ERROR_IDTYPE_NOT_EXIST = 2147614921,
7433    SCE_KERNEL_ERROR_IDTYPE_NOT_EMPTY = 2147614922,
7434    SCE_KERNEL_ERROR_UNKNOWN_UID = 2147614923,
7435    SCE_KERNEL_ERROR_UNMATCH_UID_TYPE = 2147614924,
7436    SCE_KERNEL_ERROR_ID_NOT_EXIST = 2147614925,
7437    SCE_KERNEL_ERROR_NOT_FOUND_UIDFUNC = 2147614926,
7438    SCE_KERNEL_ERROR_UID_ALREADY_HOLDER = 2147614927,
7439    SCE_KERNEL_ERROR_UID_NOT_HOLDER = 2147614928,
7440    SCE_KERNEL_ERROR_ILLEGAL_PERM = 2147614929,
7441    SCE_KERNEL_ERROR_ILLEGAL_ARGUMENT = 2147614930,
7442    SCE_KERNEL_ERROR_ILLEGAL_ADDR = 2147614931,
7443    SCE_KERNEL_ERROR_OUT_OF_RANGE = 2147614932,
7444    SCE_KERNEL_ERROR_MEM_RANGE_OVERLAP = 2147614933,
7445    SCE_KERNEL_ERROR_ILLEGAL_PARTITION = 2147614934,
7446    SCE_KERNEL_ERROR_PARTITION_INUSE = 2147614935,
7447    SCE_KERNEL_ERROR_ILLEGAL_MEMBLOCKTYPE = 2147614936,
7448    SCE_KERNEL_ERROR_MEMBLOCK_ALLOC_FAILED = 2147614937,
7449    SCE_KERNEL_ERROR_MEMBLOCK_RESIZE_LOCKED = 2147614938,
7450    SCE_KERNEL_ERROR_MEMBLOCK_RESIZE_FAILED = 2147614939,
7451    SCE_KERNEL_ERROR_HEAPBLOCK_ALLOC_FAILED = 2147614940,
7452    SCE_KERNEL_ERROR_HEAP_ALLOC_FAILED = 2147614941,
7453    SCE_KERNEL_ERROR_ILLEGAL_CHUNK_ID = 2147614942,
7454    SCE_KERNEL_ERROR_NOCHUNK = 2147614943,
7455    SCE_KERNEL_ERROR_NO_FREECHUNK = 2147614944,
7456    SCE_KERNEL_ERROR_LINKERR = 2147615020,
7457    SCE_KERNEL_ERROR_ILLEGAL_OBJECT = 2147615021,
7458    SCE_KERNEL_ERROR_UNKNOWN_MODULE = 2147615022,
7459    SCE_KERNEL_ERROR_NOFILE = 2147615023,
7460    SCE_KERNEL_ERROR_FILEERR = 2147615024,
7461    SCE_KERNEL_ERROR_MEMINUSE = 2147615025,
7462    SCE_KERNEL_ERROR_PARTITION_MISMATCH = 2147615026,
7463    SCE_KERNEL_ERROR_ALREADY_STARTED = 2147615027,
7464    SCE_KERNEL_ERROR_NOT_STARTED = 2147615028,
7465    SCE_KERNEL_ERROR_ALREADY_STOPPED = 2147615029,
7466    SCE_KERNEL_ERROR_CAN_NOT_STOP = 2147615030,
7467    SCE_KERNEL_ERROR_NOT_STOPPED = 2147615031,
7468    SCE_KERNEL_ERROR_NOT_REMOVABLE = 2147615032,
7469    SCE_KERNEL_ERROR_EXCLUSIVE_LOAD = 2147615033,
7470    SCE_KERNEL_ERROR_LIBRARY_NOT_YET_LINKED = 2147615034,
7471    SCE_KERNEL_ERROR_LIBRARY_FOUND = 2147615035,
7472    SCE_KERNEL_ERROR_LIBRARY_NOTFOUND = 2147615036,
7473    SCE_KERNEL_ERROR_ILLEGAL_LIBRARY = 2147615037,
7474    SCE_KERNEL_ERROR_LIBRARY_INUSE = 2147615038,
7475    SCE_KERNEL_ERROR_ALREADY_STOPPING = 2147615039,
7476    SCE_KERNEL_ERROR_ILLEGAL_OFFSET = 2147615040,
7477    SCE_KERNEL_ERROR_ILLEGAL_POSITION = 2147615041,
7478    SCE_KERNEL_ERROR_ILLEGAL_ACCESS = 2147615042,
7479    SCE_KERNEL_ERROR_MODULE_MGR_BUSY = 2147615043,
7480    SCE_KERNEL_ERROR_ILLEGAL_FLAG = 2147615044,
7481    SCE_KERNEL_ERROR_CANNOT_GET_MODULELIST = 2147615045,
7482    SCE_KERNEL_ERROR_PROHIBIT_LOADMODULE_DEVICE = 2147615046,
7483    SCE_KERNEL_ERROR_PROHIBIT_LOADEXEC_DEVICE = 2147615047,
7484    SCE_KERNEL_ERROR_UNSUPPORTED_PRX_TYPE = 2147615048,
7485    SCE_KERNEL_ERROR_ILLEGAL_PERM_CALL = 2147615049,
7486    SCE_KERNEL_ERROR_CANNOT_GET_MODULE_INFORMATION = 2147615050,
7487    SCE_KERNEL_ERROR_ILLEGAL_LOADEXEC_BUFFER = 2147615051,
7488    SCE_KERNEL_ERROR_ILLEGAL_LOADEXEC_FILENAME = 2147615052,
7489    SCE_KERNEL_ERROR_NO_EXIT_CALLBACK = 2147615053,
7490    SCE_KERNEL_ERROR_NO_MEMORY = 2147615120,
7491    SCE_KERNEL_ERROR_ILLEGAL_ATTR = 2147615121,
7492    SCE_KERNEL_ERROR_ILLEGAL_ENTRY = 2147615122,
7493    SCE_KERNEL_ERROR_ILLEGAL_PRIORITY = 2147615123,
7494    SCE_KERNEL_ERROR_ILLEGAL_STACK_SIZE = 2147615124,
7495    SCE_KERNEL_ERROR_ILLEGAL_MODE = 2147615125,
7496    SCE_KERNEL_ERROR_ILLEGAL_MASK = 2147615126,
7497    SCE_KERNEL_ERROR_ILLEGAL_THID = 2147615127,
7498    SCE_KERNEL_ERROR_UNKNOWN_THID = 2147615128,
7499    SCE_KERNEL_ERROR_UNKNOWN_SEMID = 2147615129,
7500    SCE_KERNEL_ERROR_UNKNOWN_EVFID = 2147615130,
7501    SCE_KERNEL_ERROR_UNKNOWN_MBXID = 2147615131,
7502    SCE_KERNEL_ERROR_UNKNOWN_VPLID = 2147615132,
7503    SCE_KERNEL_ERROR_UNKNOWN_FPLID = 2147615133,
7504    SCE_KERNEL_ERROR_UNKNOWN_MPPID = 2147615134,
7505    SCE_KERNEL_ERROR_UNKNOWN_ALMID = 2147615135,
7506    SCE_KERNEL_ERROR_UNKNOWN_TEID = 2147615136,
7507    SCE_KERNEL_ERROR_UNKNOWN_CBID = 2147615137,
7508    SCE_KERNEL_ERROR_DORMANT = 2147615138,
7509    SCE_KERNEL_ERROR_SUSPEND = 2147615139,
7510    SCE_KERNEL_ERROR_NOT_DORMANT = 2147615140,
7511    SCE_KERNEL_ERROR_NOT_SUSPEND = 2147615141,
7512    SCE_KERNEL_ERROR_NOT_WAIT = 2147615142,
7513    SCE_KERNEL_ERROR_CAN_NOT_WAIT = 2147615143,
7514    SCE_KERNEL_ERROR_WAIT_TIMEOUT = 2147615144,
7515    SCE_KERNEL_ERROR_WAIT_CANCEL = 2147615145,
7516    SCE_KERNEL_ERROR_RELEASE_WAIT = 2147615146,
7517    SCE_KERNEL_ERROR_NOTIFY_CALLBACK = 2147615147,
7518    SCE_KERNEL_ERROR_THREAD_TERMINATED = 2147615148,
7519    SCE_KERNEL_ERROR_SEMA_ZERO = 2147615149,
7520    SCE_KERNEL_ERROR_SEMA_OVF = 2147615150,
7521    SCE_KERNEL_ERROR_EVF_COND = 2147615151,
7522    SCE_KERNEL_ERROR_EVF_MULTI = 2147615152,
7523    SCE_KERNEL_ERROR_EVF_ILPAT = 2147615153,
7524    SCE_KERNEL_ERROR_MBOX_NOMSG = 2147615154,
7525    SCE_KERNEL_ERROR_MPP_FULL = 2147615155,
7526    SCE_KERNEL_ERROR_MPP_EMPTY = 2147615156,
7527    SCE_KERNEL_ERROR_WAIT_DELETE = 2147615157,
7528    SCE_KERNEL_ERROR_ILLEGAL_MEMBLOCK = 2147615158,
7529    SCE_KERNEL_ERROR_ILLEGAL_MEMSIZE = 2147615159,
7530    SCE_KERNEL_ERROR_ILLEGAL_SPADADDR = 2147615160,
7531    SCE_KERNEL_ERROR_SPAD_INUSE = 2147615161,
7532    SCE_KERNEL_ERROR_SPAD_NOT_INUSE = 2147615162,
7533    SCE_KERNEL_ERROR_ILLEGAL_TYPE = 2147615163,
7534    SCE_KERNEL_ERROR_ILLEGAL_SIZE = 2147615164,
7535    SCE_KERNEL_ERROR_ILLEGAL_COUNT = 2147615165,
7536    SCE_KERNEL_ERROR_UNKNOWN_VTID = 2147615166,
7537    SCE_KERNEL_ERROR_ILLEGAL_VTID = 2147615167,
7538    SCE_KERNEL_ERROR_ILLEGAL_KTLSID = 2147615168,
7539    SCE_KERNEL_ERROR_KTLS_FULL = 2147615169,
7540    SCE_KERNEL_ERROR_KTLS_BUSY = 2147615170,
7541    SCE_KERNEL_ERROR_PM_INVALID_PRIORITY = 2147615320,
7542    SCE_KERNEL_ERROR_PM_INVALID_DEVNAME = 2147615321,
7543    SCE_KERNEL_ERROR_PM_UNKNOWN_DEVNAME = 2147615322,
7544    SCE_KERNEL_ERROR_PM_PMINFO_REGISTERED = 2147615323,
7545    SCE_KERNEL_ERROR_PM_PMINFO_UNREGISTERED = 2147615324,
7546    SCE_KERNEL_ERROR_PM_INVALID_MAJOR_STATE = 2147615325,
7547    SCE_KERNEL_ERROR_PM_INVALID_REQUEST = 2147615326,
7548    SCE_KERNEL_ERROR_PM_UNKNOWN_REQUEST = 2147615327,
7549    SCE_KERNEL_ERROR_PM_INVALID_UNIT = 2147615328,
7550    SCE_KERNEL_ERROR_PM_CANNOT_CANCEL = 2147615329,
7551    SCE_KERNEL_ERROR_PM_INVALID_PMINFO = 2147615330,
7552    SCE_KERNEL_ERROR_PM_INVALID_ARGUMENT = 2147615331,
7553    SCE_KERNEL_ERROR_PM_ALREADY_TARGET_PWRSTATE = 2147615332,
7554    SCE_KERNEL_ERROR_PM_CHANGE_PWRSTATE_FAILED = 2147615333,
7555    SCE_KERNEL_ERROR_PM_CANNOT_CHANGE_DEVPWR_STATE = 2147615334,
7556    SCE_KERNEL_ERROR_PM_NO_SUPPORT_DEVPWR_STATE = 2147615335,
7557    SCE_KERNEL_ERROR_DMAC_REQUEST_FAILED = 2147615420,
7558    SCE_KERNEL_ERROR_DMAC_REQUEST_DENIED = 2147615421,
7559    SCE_KERNEL_ERROR_DMAC_OP_QUEUED = 2147615422,
7560    SCE_KERNEL_ERROR_DMAC_OP_NOT_QUEUED = 2147615423,
7561    SCE_KERNEL_ERROR_DMAC_OP_RUNNING = 2147615424,
7562    SCE_KERNEL_ERROR_DMAC_OP_NOT_ASSIGNED = 2147615425,
7563    SCE_KERNEL_ERROR_DMAC_OP_TIMEOUT = 2147615426,
7564    SCE_KERNEL_ERROR_DMAC_OP_FREED = 2147615427,
7565    SCE_KERNEL_ERROR_DMAC_OP_USED = 2147615428,
7566    SCE_KERNEL_ERROR_DMAC_OP_EMPTY = 2147615429,
7567    SCE_KERNEL_ERROR_DMAC_OP_ABORTED = 2147615430,
7568    SCE_KERNEL_ERROR_DMAC_OP_ERROR = 2147615431,
7569    SCE_KERNEL_ERROR_DMAC_CHANNEL_RESERVED = 2147615432,
7570    SCE_KERNEL_ERROR_DMAC_CHANNEL_EXCLUDED = 2147615433,
7571    SCE_KERNEL_ERROR_DMAC_PRIVILEGE_ADDRESS = 2147615434,
7572    SCE_KERNEL_ERROR_DMAC_NO_ENOUGHSPACE = 2147615435,
7573    SCE_KERNEL_ERROR_DMAC_CHANNEL_NOT_ASSIGNED = 2147615436,
7574    SCE_KERNEL_ERROR_DMAC_CHILD_OPERATION = 2147615437,
7575    SCE_KERNEL_ERROR_DMAC_TOO_MUCH_SIZE = 2147615438,
7576    SCE_KERNEL_ERROR_DMAC_INVALID_ARGUMENT = 2147615439,
7577    SCE_KERNEL_ERROR_MFILE = 2147615520,
7578    SCE_KERNEL_ERROR_NODEV = 2147615521,
7579    SCE_KERNEL_ERROR_XDEV = 2147615522,
7580    SCE_KERNEL_ERROR_BADF = 2147615523,
7581    SCE_KERNEL_ERROR_INVAL = 2147615524,
7582    SCE_KERNEL_ERROR_UNSUP = 2147615525,
7583    SCE_KERNEL_ERROR_ALIAS_USED = 2147615526,
7584    SCE_KERNEL_ERROR_CANNOT_MOUNT = 2147615527,
7585    SCE_KERNEL_ERROR_DRIVER_DELETED = 2147615528,
7586    SCE_KERNEL_ERROR_ASYNC_BUSY = 2147615529,
7587    SCE_KERNEL_ERROR_NOASYNC = 2147615530,
7588    SCE_KERNEL_ERROR_REGDEV = 2147615531,
7589    SCE_KERNEL_ERROR_NOCWD = 2147615532,
7590    SCE_KERNEL_ERROR_NAMETOOLONG = 2147615533,
7591    SCE_KERNEL_ERROR_NXIO = 2147615720,
7592    SCE_KERNEL_ERROR_IO = 2147615721,
7593    SCE_KERNEL_ERROR_NOMEM = 2147615722,
7594    SCE_KERNEL_ERROR_STDIO_NOT_OPENED = 2147615723,
7595    SCE_KERNEL_ERROR_CACHE_ALIGNMENT = 2147615820,
7596    SCE_KERNEL_ERROR_ERRORMAX = 2147615821,
7597}
7598extern "C" {
7599    /// Function to get the current standard in file no
7600///
7601/// @return The stdin fileno
7602    pub fn sceKernelStdin() -> SceUID;
7603}
7604extern "C" {
7605    /// Function to get the current standard out file no
7606///
7607/// @return The stdout fileno
7608    pub fn sceKernelStdout() -> SceUID;
7609}
7610extern "C" {
7611    /// Function to get the current standard err file no
7612///
7613/// @return The stderr fileno
7614    pub fn sceKernelStderr() -> SceUID;
7615}
7616extern "C" {
7617    #[link_name = "PspInterruptNames"]
7618    pub static mut PspInterruptNames: [*const libc::c_char; 67usize];
7619}
7620#[repr(u32)]
7621#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
7622pub enum PspInterrupts {
7623    PSP_GPIO_INT = 4,
7624    PSP_ATA_INT = 5,
7625    PSP_UMD_INT = 6,
7626    PSP_MSCM0_INT = 7,
7627    PSP_WLAN_INT = 8,
7628    PSP_AUDIO_INT = 10,
7629    PSP_I2C_INT = 12,
7630    PSP_SIRCS_INT = 14,
7631    PSP_SYSTIMER0_INT = 15,
7632    PSP_SYSTIMER1_INT = 16,
7633    PSP_SYSTIMER2_INT = 17,
7634    PSP_SYSTIMER3_INT = 18,
7635    PSP_THREAD0_INT = 19,
7636    PSP_NAND_INT = 20,
7637    PSP_DMACPLUS_INT = 21,
7638    PSP_DMA0_INT = 22,
7639    PSP_DMA1_INT = 23,
7640    PSP_MEMLMD_INT = 24,
7641    PSP_GE_INT = 25,
7642    PSP_VBLANK_INT = 30,
7643    PSP_MECODEC_INT = 31,
7644    PSP_HPREMOTE_INT = 36,
7645    PSP_MSCM1_INT = 60,
7646    PSP_MSCM2_INT = 61,
7647    PSP_THREAD1_INT = 65,
7648    PSP_INTERRUPT_INT = 66,
7649}
7650#[repr(u32)]
7651#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
7652pub enum PspSubInterrupts {
7653    PSP_GPIO_SUBINT = 4,
7654    PSP_ATA_SUBINT = 5,
7655    PSP_UMD_SUBINT = 6,
7656    PSP_DMACPLUS_SUBINT = 21,
7657    PSP_GE_SUBINT = 25,
7658    PSP_DISPLAY_SUBINT = 30,
7659}
7660extern "C" {
7661    /// Suspend all interrupts.
7662///
7663/// @return The current state of the interrupt controller, to be used with ::sceKernelCpuResumeIntr().
7664    pub fn sceKernelCpuSuspendIntr() -> libc::c_uint;
7665}
7666extern "C" {
7667    /// Resume all interrupts.
7668///
7669/// @param flags - The value returned from ::sceKernelCpuSuspendIntr().
7670    pub fn sceKernelCpuResumeIntr(flags: libc::c_uint);
7671}
7672extern "C" {
7673    /// Resume all interrupts (using sync instructions).
7674///
7675/// @param flags - The value returned from ::sceKernelCpuSuspendIntr()
7676    pub fn sceKernelCpuResumeIntrWithSync(flags: libc::c_uint);
7677}
7678extern "C" {
7679    /// Determine if interrupts are suspended or active, based on the given flags.
7680///
7681/// @param flags - The value returned from ::sceKernelCpuSuspendIntr().
7682///
7683/// @return 1 if flags indicate that interrupts were not suspended, 0 otherwise.
7684    pub fn sceKernelIsCpuIntrSuspended(flags: libc::c_uint) -> libc::c_int;
7685}
7686extern "C" {
7687    /// Determine if interrupts are enabled or disabled.
7688///
7689/// @return 1 if interrupts are currently enabled.
7690    pub fn sceKernelIsCpuIntrEnable() -> libc::c_int;
7691}
7692extern "C" {
7693    /// Register a sub interrupt handler.
7694///
7695/// @param intno - The interrupt number to register.
7696/// @param no - The sub interrupt handler number (user controlled)
7697/// @param handler - The interrupt handler
7698/// @param arg - An argument passed to the interrupt handler
7699///
7700/// @return < 0 on error.
7701    pub fn sceKernelRegisterSubIntrHandler(intno: libc::c_int,
7702                                           no: libc::c_int,
7703                                           handler: *mut libc::c_void,
7704                                           arg: *mut libc::c_void)
7705     -> libc::c_int;
7706}
7707extern "C" {
7708    /// Release a sub interrupt handler.
7709///
7710/// @param intno - The interrupt number to register.
7711/// @param no - The sub interrupt handler number
7712///
7713/// @return < 0 on error.
7714    pub fn sceKernelReleaseSubIntrHandler(intno: libc::c_int, no: libc::c_int)
7715     -> libc::c_int;
7716}
7717extern "C" {
7718    /// Enable a sub interrupt.
7719///
7720/// @param intno - The sub interrupt to enable.
7721/// @param no - The sub interrupt handler number
7722///
7723/// @return < 0 on error.
7724    pub fn sceKernelEnableSubIntr(intno: libc::c_int, no: libc::c_int)
7725     -> libc::c_int;
7726}
7727extern "C" {
7728    /// Disable a sub interrupt handler.
7729///
7730/// @param intno - The sub interrupt to disable.
7731/// @param no - The sub interrupt handler number
7732///
7733/// @return < 0 on error.
7734    pub fn sceKernelDisableSubIntr(intno: libc::c_int, no: libc::c_int)
7735     -> libc::c_int;
7736}
7737#[repr(C)]
7738#[derive(Debug, Copy)]
7739pub struct tag_IntrHandlerOptionParam {
7740    pub size: libc::c_int,
7741    pub entry: u32,
7742    pub common: u32,
7743    pub gp: u32,
7744    pub intr_code: u16,
7745    pub sub_count: u16,
7746    pub intr_level: u16,
7747    pub enabled: u16,
7748    pub calls: u32,
7749    pub field_1C: u32,
7750    pub total_clock_lo: u32,
7751    pub total_clock_hi: u32,
7752    pub min_clock_lo: u32,
7753    pub min_clock_hi: u32,
7754    pub max_clock_lo: u32,
7755    pub max_clock_hi: u32,
7756}
7757#[test]
7758fn bindgen_test_layout_tag_IntrHandlerOptionParam() {
7759    assert_eq!(::core::mem::size_of::<tag_IntrHandlerOptionParam>() , 56usize
7760               , concat ! (
7761               "Size of: " , stringify ! ( tag_IntrHandlerOptionParam ) ));
7762    assert_eq! (::core::mem::align_of::<tag_IntrHandlerOptionParam>() , 4usize
7763                , concat ! (
7764                "Alignment of " , stringify ! ( tag_IntrHandlerOptionParam )
7765                ));
7766    assert_eq! (unsafe {
7767                & ( * ( 0 as * const tag_IntrHandlerOptionParam ) ) . size as
7768                * const _ as usize } , 0usize , concat ! (
7769                "Alignment of field: " , stringify ! (
7770                tag_IntrHandlerOptionParam ) , "::" , stringify ! ( size ) ));
7771    assert_eq! (unsafe {
7772                & ( * ( 0 as * const tag_IntrHandlerOptionParam ) ) . entry as
7773                * const _ as usize } , 4usize , concat ! (
7774                "Alignment of field: " , stringify ! (
7775                tag_IntrHandlerOptionParam ) , "::" , stringify ! ( entry )
7776                ));
7777    assert_eq! (unsafe {
7778                & ( * ( 0 as * const tag_IntrHandlerOptionParam ) ) . common
7779                as * const _ as usize } , 8usize , concat ! (
7780                "Alignment of field: " , stringify ! (
7781                tag_IntrHandlerOptionParam ) , "::" , stringify ! ( common )
7782                ));
7783    assert_eq! (unsafe {
7784                & ( * ( 0 as * const tag_IntrHandlerOptionParam ) ) . gp as *
7785                const _ as usize } , 12usize , concat ! (
7786                "Alignment of field: " , stringify ! (
7787                tag_IntrHandlerOptionParam ) , "::" , stringify ! ( gp ) ));
7788    assert_eq! (unsafe {
7789                & ( * ( 0 as * const tag_IntrHandlerOptionParam ) ) .
7790                intr_code as * const _ as usize } , 16usize , concat ! (
7791                "Alignment of field: " , stringify ! (
7792                tag_IntrHandlerOptionParam ) , "::" , stringify ! ( intr_code
7793                ) ));
7794    assert_eq! (unsafe {
7795                & ( * ( 0 as * const tag_IntrHandlerOptionParam ) ) .
7796                sub_count as * const _ as usize } , 18usize , concat ! (
7797                "Alignment of field: " , stringify ! (
7798                tag_IntrHandlerOptionParam ) , "::" , stringify ! ( sub_count
7799                ) ));
7800    assert_eq! (unsafe {
7801                & ( * ( 0 as * const tag_IntrHandlerOptionParam ) ) .
7802                intr_level as * const _ as usize } , 20usize , concat ! (
7803                "Alignment of field: " , stringify ! (
7804                tag_IntrHandlerOptionParam ) , "::" , stringify ! ( intr_level
7805                ) ));
7806    assert_eq! (unsafe {
7807                & ( * ( 0 as * const tag_IntrHandlerOptionParam ) ) . enabled
7808                as * const _ as usize } , 22usize , concat ! (
7809                "Alignment of field: " , stringify ! (
7810                tag_IntrHandlerOptionParam ) , "::" , stringify ! ( enabled )
7811                ));
7812    assert_eq! (unsafe {
7813                & ( * ( 0 as * const tag_IntrHandlerOptionParam ) ) . calls as
7814                * const _ as usize } , 24usize , concat ! (
7815                "Alignment of field: " , stringify ! (
7816                tag_IntrHandlerOptionParam ) , "::" , stringify ! ( calls )
7817                ));
7818    assert_eq! (unsafe {
7819                & ( * ( 0 as * const tag_IntrHandlerOptionParam ) ) . field_1C
7820                as * const _ as usize } , 28usize , concat ! (
7821                "Alignment of field: " , stringify ! (
7822                tag_IntrHandlerOptionParam ) , "::" , stringify ! ( field_1C )
7823                ));
7824    assert_eq! (unsafe {
7825                & ( * ( 0 as * const tag_IntrHandlerOptionParam ) ) .
7826                total_clock_lo as * const _ as usize } , 32usize , concat ! (
7827                "Alignment of field: " , stringify ! (
7828                tag_IntrHandlerOptionParam ) , "::" , stringify ! (
7829                total_clock_lo ) ));
7830    assert_eq! (unsafe {
7831                & ( * ( 0 as * const tag_IntrHandlerOptionParam ) ) .
7832                total_clock_hi as * const _ as usize } , 36usize , concat ! (
7833                "Alignment of field: " , stringify ! (
7834                tag_IntrHandlerOptionParam ) , "::" , stringify ! (
7835                total_clock_hi ) ));
7836    assert_eq! (unsafe {
7837                & ( * ( 0 as * const tag_IntrHandlerOptionParam ) ) .
7838                min_clock_lo as * const _ as usize } , 40usize , concat ! (
7839                "Alignment of field: " , stringify ! (
7840                tag_IntrHandlerOptionParam ) , "::" , stringify ! (
7841                min_clock_lo ) ));
7842    assert_eq! (unsafe {
7843                & ( * ( 0 as * const tag_IntrHandlerOptionParam ) ) .
7844                min_clock_hi as * const _ as usize } , 44usize , concat ! (
7845                "Alignment of field: " , stringify ! (
7846                tag_IntrHandlerOptionParam ) , "::" , stringify ! (
7847                min_clock_hi ) ));
7848    assert_eq! (unsafe {
7849                & ( * ( 0 as * const tag_IntrHandlerOptionParam ) ) .
7850                max_clock_lo as * const _ as usize } , 48usize , concat ! (
7851                "Alignment of field: " , stringify ! (
7852                tag_IntrHandlerOptionParam ) , "::" , stringify ! (
7853                max_clock_lo ) ));
7854    assert_eq! (unsafe {
7855                & ( * ( 0 as * const tag_IntrHandlerOptionParam ) ) .
7856                max_clock_hi as * const _ as usize } , 52usize , concat ! (
7857                "Alignment of field: " , stringify ! (
7858                tag_IntrHandlerOptionParam ) , "::" , stringify ! (
7859                max_clock_hi ) ));
7860}
7861impl Clone for tag_IntrHandlerOptionParam {
7862    fn clone(&self) -> Self { *self }
7863}
7864pub type PspIntrHandlerOptionParam = tag_IntrHandlerOptionParam;
7865extern "C" {
7866    pub fn QueryIntrHandlerInfo(intr_code: SceUID, sub_intr_code: SceUID,
7867                                data: *mut PspIntrHandlerOptionParam)
7868     -> libc::c_int;
7869}
7870#[repr(C)]
7871#[derive(Debug, Copy)]
7872pub struct PspIoDrv {
7873    /// The name of the device to add
7874    pub name: *const libc::c_char,
7875    /// Device type, this 0x10 is for a filesystem driver
7876    pub dev_type: u32,
7877    /// Unknown, set to 0x800
7878    pub unk2: u32,
7879    /// This seems to be the same as name but capitalised :/
7880    pub name2: *const libc::c_char,
7881    /// Pointer to a filled out functions table
7882    pub funcs: *mut PspIoDrvFuncs,
7883}
7884#[test]
7885fn bindgen_test_layout_PspIoDrv() {
7886    assert_eq!(::core::mem::size_of::<PspIoDrv>() , 32usize , concat ! (
7887               "Size of: " , stringify ! ( PspIoDrv ) ));
7888    assert_eq! (::core::mem::align_of::<PspIoDrv>() , 8usize , concat ! (
7889                "Alignment of " , stringify ! ( PspIoDrv ) ));
7890    assert_eq! (unsafe {
7891                & ( * ( 0 as * const PspIoDrv ) ) . name as * const _ as usize
7892                } , 0usize , concat ! (
7893                "Alignment of field: " , stringify ! ( PspIoDrv ) , "::" ,
7894                stringify ! ( name ) ));
7895    assert_eq! (unsafe {
7896                & ( * ( 0 as * const PspIoDrv ) ) . dev_type as * const _ as
7897                usize } , 8usize , concat ! (
7898                "Alignment of field: " , stringify ! ( PspIoDrv ) , "::" ,
7899                stringify ! ( dev_type ) ));
7900    assert_eq! (unsafe {
7901                & ( * ( 0 as * const PspIoDrv ) ) . unk2 as * const _ as usize
7902                } , 12usize , concat ! (
7903                "Alignment of field: " , stringify ! ( PspIoDrv ) , "::" ,
7904                stringify ! ( unk2 ) ));
7905    assert_eq! (unsafe {
7906                & ( * ( 0 as * const PspIoDrv ) ) . name2 as * const _ as
7907                usize } , 16usize , concat ! (
7908                "Alignment of field: " , stringify ! ( PspIoDrv ) , "::" ,
7909                stringify ! ( name2 ) ));
7910    assert_eq! (unsafe {
7911                & ( * ( 0 as * const PspIoDrv ) ) . funcs as * const _ as
7912                usize } , 24usize , concat ! (
7913                "Alignment of field: " , stringify ! ( PspIoDrv ) , "::" ,
7914                stringify ! ( funcs ) ));
7915}
7916impl Clone for PspIoDrv {
7917    fn clone(&self) -> Self { *self }
7918}
7919/// Structure passed to the init and exit functions of the io driver system
7920#[repr(C)]
7921#[derive(Debug, Copy)]
7922pub struct PspIoDrvArg {
7923    /// Pointer to the original driver which was added
7924    pub drv: *mut PspIoDrv,
7925    /// Pointer to a user defined argument (if written by the driver will preseve across calls
7926    pub arg: *mut libc::c_void,
7927}
7928#[test]
7929fn bindgen_test_layout_PspIoDrvArg() {
7930    assert_eq!(::core::mem::size_of::<PspIoDrvArg>() , 16usize , concat ! (
7931               "Size of: " , stringify ! ( PspIoDrvArg ) ));
7932    assert_eq! (::core::mem::align_of::<PspIoDrvArg>() , 8usize , concat ! (
7933                "Alignment of " , stringify ! ( PspIoDrvArg ) ));
7934    assert_eq! (unsafe {
7935                & ( * ( 0 as * const PspIoDrvArg ) ) . drv as * const _ as
7936                usize } , 0usize , concat ! (
7937                "Alignment of field: " , stringify ! ( PspIoDrvArg ) , "::" ,
7938                stringify ! ( drv ) ));
7939    assert_eq! (unsafe {
7940                & ( * ( 0 as * const PspIoDrvArg ) ) . arg as * const _ as
7941                usize } , 8usize , concat ! (
7942                "Alignment of field: " , stringify ! ( PspIoDrvArg ) , "::" ,
7943                stringify ! ( arg ) ));
7944}
7945impl Clone for PspIoDrvArg {
7946    fn clone(&self) -> Self { *self }
7947}
7948/// Structure passed to the file functions of the io driver system
7949#[repr(C)]
7950#[derive(Debug, Copy)]
7951pub struct PspIoDrvFileArg {
7952    /// Unknown
7953    pub unk1: u32,
7954    /// The file system number, e.g. if a file is opened as host5:/myfile.txt this field will be 5
7955    pub fs_num: u32,
7956    /// Pointer to the driver structure
7957    pub drv: *mut PspIoDrvArg,
7958    /// Unknown, again
7959    pub unk2: u32,
7960    /// Pointer to a user defined argument, this is preserved on a per file basis
7961    pub arg: *mut libc::c_void,
7962}
7963#[test]
7964fn bindgen_test_layout_PspIoDrvFileArg() {
7965    assert_eq!(::core::mem::size_of::<PspIoDrvFileArg>() , 32usize , concat !
7966               ( "Size of: " , stringify ! ( PspIoDrvFileArg ) ));
7967    assert_eq! (::core::mem::align_of::<PspIoDrvFileArg>() , 8usize , concat !
7968                ( "Alignment of " , stringify ! ( PspIoDrvFileArg ) ));
7969    assert_eq! (unsafe {
7970                & ( * ( 0 as * const PspIoDrvFileArg ) ) . unk1 as * const _
7971                as usize } , 0usize , concat ! (
7972                "Alignment of field: " , stringify ! ( PspIoDrvFileArg ) ,
7973                "::" , stringify ! ( unk1 ) ));
7974    assert_eq! (unsafe {
7975                & ( * ( 0 as * const PspIoDrvFileArg ) ) . fs_num as * const _
7976                as usize } , 4usize , concat ! (
7977                "Alignment of field: " , stringify ! ( PspIoDrvFileArg ) ,
7978                "::" , stringify ! ( fs_num ) ));
7979    assert_eq! (unsafe {
7980                & ( * ( 0 as * const PspIoDrvFileArg ) ) . drv as * const _ as
7981                usize } , 8usize , concat ! (
7982                "Alignment of field: " , stringify ! ( PspIoDrvFileArg ) ,
7983                "::" , stringify ! ( drv ) ));
7984    assert_eq! (unsafe {
7985                & ( * ( 0 as * const PspIoDrvFileArg ) ) . unk2 as * const _
7986                as usize } , 16usize , concat ! (
7987                "Alignment of field: " , stringify ! ( PspIoDrvFileArg ) ,
7988                "::" , stringify ! ( unk2 ) ));
7989    assert_eq! (unsafe {
7990                & ( * ( 0 as * const PspIoDrvFileArg ) ) . arg as * const _ as
7991                usize } , 24usize , concat ! (
7992                "Alignment of field: " , stringify ! ( PspIoDrvFileArg ) ,
7993                "::" , stringify ! ( arg ) ));
7994}
7995impl Clone for PspIoDrvFileArg {
7996    fn clone(&self) -> Self { *self }
7997}
7998/// Structure to maintain the file driver pointers
7999#[repr(C)]
8000#[derive(Debug, Copy)]
8001pub struct PspIoDrvFuncs {
8002    pub IoInit: ::core::option::Option<unsafe extern "C" fn(arg:
8003                                                                *mut PspIoDrvArg)
8004                                           -> libc::c_int>,
8005    pub IoExit: ::core::option::Option<unsafe extern "C" fn(arg:
8006                                                                *mut PspIoDrvArg)
8007                                           -> libc::c_int>,
8008    pub IoOpen: ::core::option::Option<unsafe extern "C" fn(arg:
8009                                                                *mut PspIoDrvFileArg,
8010                                                            file:
8011                                                                *mut libc::c_char,
8012                                                            flags:
8013                                                                libc::c_int,
8014                                                            mode: SceMode)
8015                                           -> libc::c_int>,
8016    pub IoClose: ::core::option::Option<unsafe extern "C" fn(arg:
8017                                                                 *mut PspIoDrvFileArg)
8018                                            -> libc::c_int>,
8019    pub IoRead: ::core::option::Option<unsafe extern "C" fn(arg:
8020                                                                *mut PspIoDrvFileArg,
8021                                                            data:
8022                                                                *mut libc::c_char,
8023                                                            len: libc::c_int)
8024                                           -> libc::c_int>,
8025    pub IoWrite: ::core::option::Option<unsafe extern "C" fn(arg:
8026                                                                 *mut PspIoDrvFileArg,
8027                                                             data:
8028                                                                 *const libc::c_char,
8029                                                             len: libc::c_int)
8030                                            -> libc::c_int>,
8031    pub IoLseek: ::core::option::Option<unsafe extern "C" fn(arg:
8032                                                                 *mut PspIoDrvFileArg,
8033                                                             ofs: SceOff,
8034                                                             whence:
8035                                                                 libc::c_int)
8036                                            -> SceOff>,
8037    pub IoIoctl: ::core::option::Option<unsafe extern "C" fn(arg:
8038                                                                 *mut PspIoDrvFileArg,
8039                                                             cmd:
8040                                                                 libc::c_uint,
8041                                                             indata:
8042                                                                 *mut libc::c_void,
8043                                                             inlen:
8044                                                                 libc::c_int,
8045                                                             outdata:
8046                                                                 *mut libc::c_void,
8047                                                             outlen:
8048                                                                 libc::c_int)
8049                                            -> libc::c_int>,
8050    pub IoRemove: ::core::option::Option<unsafe extern "C" fn(arg:
8051                                                                  *mut PspIoDrvFileArg,
8052                                                              name:
8053                                                                  *const libc::c_char)
8054                                             -> libc::c_int>,
8055    pub IoMkdir: ::core::option::Option<unsafe extern "C" fn(arg:
8056                                                                 *mut PspIoDrvFileArg,
8057                                                             name:
8058                                                                 *const libc::c_char,
8059                                                             mode: SceMode)
8060                                            -> libc::c_int>,
8061    pub IoRmdir: ::core::option::Option<unsafe extern "C" fn(arg:
8062                                                                 *mut PspIoDrvFileArg,
8063                                                             name:
8064                                                                 *const libc::c_char)
8065                                            -> libc::c_int>,
8066    pub IoDopen: ::core::option::Option<unsafe extern "C" fn(arg:
8067                                                                 *mut PspIoDrvFileArg,
8068                                                             dirname:
8069                                                                 *const libc::c_char)
8070                                            -> libc::c_int>,
8071    pub IoDclose: ::core::option::Option<unsafe extern "C" fn(arg:
8072                                                                  *mut PspIoDrvFileArg)
8073                                             -> libc::c_int>,
8074    pub IoDread: ::core::option::Option<unsafe extern "C" fn(arg:
8075                                                                 *mut PspIoDrvFileArg,
8076                                                             dir:
8077                                                                 *mut SceIoDirent)
8078                                            -> libc::c_int>,
8079    pub IoGetstat: ::core::option::Option<unsafe extern "C" fn(arg:
8080                                                                   *mut PspIoDrvFileArg,
8081                                                               file:
8082                                                                   *const libc::c_char,
8083                                                               stat:
8084                                                                   *mut SceIoStat)
8085                                              -> libc::c_int>,
8086    pub IoChstat: ::core::option::Option<unsafe extern "C" fn(arg:
8087                                                                  *mut PspIoDrvFileArg,
8088                                                              file:
8089                                                                  *const libc::c_char,
8090                                                              stat:
8091                                                                  *mut SceIoStat,
8092                                                              bits:
8093                                                                  libc::c_int)
8094                                             -> libc::c_int>,
8095    pub IoRename: ::core::option::Option<unsafe extern "C" fn(arg:
8096                                                                  *mut PspIoDrvFileArg,
8097                                                              oldname:
8098                                                                  *const libc::c_char,
8099                                                              newname:
8100                                                                  *const libc::c_char)
8101                                             -> libc::c_int>,
8102    pub IoChdir: ::core::option::Option<unsafe extern "C" fn(arg:
8103                                                                 *mut PspIoDrvFileArg,
8104                                                             dir:
8105                                                                 *const libc::c_char)
8106                                            -> libc::c_int>,
8107    pub IoMount: ::core::option::Option<unsafe extern "C" fn(arg:
8108                                                                 *mut PspIoDrvFileArg)
8109                                            -> libc::c_int>,
8110    pub IoUmount: ::core::option::Option<unsafe extern "C" fn(arg:
8111                                                                  *mut PspIoDrvFileArg)
8112                                             -> libc::c_int>,
8113    pub IoDevctl: ::core::option::Option<unsafe extern "C" fn(arg:
8114                                                                  *mut PspIoDrvFileArg,
8115                                                              devname:
8116                                                                  *const libc::c_char,
8117                                                              cmd:
8118                                                                  libc::c_uint,
8119                                                              indata:
8120                                                                  *mut libc::c_void,
8121                                                              inlen:
8122                                                                  libc::c_int,
8123                                                              outdata:
8124                                                                  *mut libc::c_void,
8125                                                              outlen:
8126                                                                  libc::c_int)
8127                                             -> libc::c_int>,
8128    pub IoUnk21: ::core::option::Option<unsafe extern "C" fn(arg:
8129                                                                 *mut PspIoDrvFileArg)
8130                                            -> libc::c_int>,
8131}
8132#[test]
8133fn bindgen_test_layout_PspIoDrvFuncs() {
8134    assert_eq!(::core::mem::size_of::<PspIoDrvFuncs>() , 176usize , concat ! (
8135               "Size of: " , stringify ! ( PspIoDrvFuncs ) ));
8136    assert_eq! (::core::mem::align_of::<PspIoDrvFuncs>() , 8usize , concat ! (
8137                "Alignment of " , stringify ! ( PspIoDrvFuncs ) ));
8138    assert_eq! (unsafe {
8139                & ( * ( 0 as * const PspIoDrvFuncs ) ) . IoInit as * const _
8140                as usize } , 0usize , concat ! (
8141                "Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
8142                , stringify ! ( IoInit ) ));
8143    assert_eq! (unsafe {
8144                & ( * ( 0 as * const PspIoDrvFuncs ) ) . IoExit as * const _
8145                as usize } , 8usize , concat ! (
8146                "Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
8147                , stringify ! ( IoExit ) ));
8148    assert_eq! (unsafe {
8149                & ( * ( 0 as * const PspIoDrvFuncs ) ) . IoOpen as * const _
8150                as usize } , 16usize , concat ! (
8151                "Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
8152                , stringify ! ( IoOpen ) ));
8153    assert_eq! (unsafe {
8154                & ( * ( 0 as * const PspIoDrvFuncs ) ) . IoClose as * const _
8155                as usize } , 24usize , concat ! (
8156                "Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
8157                , stringify ! ( IoClose ) ));
8158    assert_eq! (unsafe {
8159                & ( * ( 0 as * const PspIoDrvFuncs ) ) . IoRead as * const _
8160                as usize } , 32usize , concat ! (
8161                "Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
8162                , stringify ! ( IoRead ) ));
8163    assert_eq! (unsafe {
8164                & ( * ( 0 as * const PspIoDrvFuncs ) ) . IoWrite as * const _
8165                as usize } , 40usize , concat ! (
8166                "Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
8167                , stringify ! ( IoWrite ) ));
8168    assert_eq! (unsafe {
8169                & ( * ( 0 as * const PspIoDrvFuncs ) ) . IoLseek as * const _
8170                as usize } , 48usize , concat ! (
8171                "Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
8172                , stringify ! ( IoLseek ) ));
8173    assert_eq! (unsafe {
8174                & ( * ( 0 as * const PspIoDrvFuncs ) ) . IoIoctl as * const _
8175                as usize } , 56usize , concat ! (
8176                "Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
8177                , stringify ! ( IoIoctl ) ));
8178    assert_eq! (unsafe {
8179                & ( * ( 0 as * const PspIoDrvFuncs ) ) . IoRemove as * const _
8180                as usize } , 64usize , concat ! (
8181                "Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
8182                , stringify ! ( IoRemove ) ));
8183    assert_eq! (unsafe {
8184                & ( * ( 0 as * const PspIoDrvFuncs ) ) . IoMkdir as * const _
8185                as usize } , 72usize , concat ! (
8186                "Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
8187                , stringify ! ( IoMkdir ) ));
8188    assert_eq! (unsafe {
8189                & ( * ( 0 as * const PspIoDrvFuncs ) ) . IoRmdir as * const _
8190                as usize } , 80usize , concat ! (
8191                "Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
8192                , stringify ! ( IoRmdir ) ));
8193    assert_eq! (unsafe {
8194                & ( * ( 0 as * const PspIoDrvFuncs ) ) . IoDopen as * const _
8195                as usize } , 88usize , concat ! (
8196                "Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
8197                , stringify ! ( IoDopen ) ));
8198    assert_eq! (unsafe {
8199                & ( * ( 0 as * const PspIoDrvFuncs ) ) . IoDclose as * const _
8200                as usize } , 96usize , concat ! (
8201                "Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
8202                , stringify ! ( IoDclose ) ));
8203    assert_eq! (unsafe {
8204                & ( * ( 0 as * const PspIoDrvFuncs ) ) . IoDread as * const _
8205                as usize } , 104usize , concat ! (
8206                "Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
8207                , stringify ! ( IoDread ) ));
8208    assert_eq! (unsafe {
8209                & ( * ( 0 as * const PspIoDrvFuncs ) ) . IoGetstat as * const
8210                _ as usize } , 112usize , concat ! (
8211                "Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
8212                , stringify ! ( IoGetstat ) ));
8213    assert_eq! (unsafe {
8214                & ( * ( 0 as * const PspIoDrvFuncs ) ) . IoChstat as * const _
8215                as usize } , 120usize , concat ! (
8216                "Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
8217                , stringify ! ( IoChstat ) ));
8218    assert_eq! (unsafe {
8219                & ( * ( 0 as * const PspIoDrvFuncs ) ) . IoRename as * const _
8220                as usize } , 128usize , concat ! (
8221                "Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
8222                , stringify ! ( IoRename ) ));
8223    assert_eq! (unsafe {
8224                & ( * ( 0 as * const PspIoDrvFuncs ) ) . IoChdir as * const _
8225                as usize } , 136usize , concat ! (
8226                "Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
8227                , stringify ! ( IoChdir ) ));
8228    assert_eq! (unsafe {
8229                & ( * ( 0 as * const PspIoDrvFuncs ) ) . IoMount as * const _
8230                as usize } , 144usize , concat ! (
8231                "Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
8232                , stringify ! ( IoMount ) ));
8233    assert_eq! (unsafe {
8234                & ( * ( 0 as * const PspIoDrvFuncs ) ) . IoUmount as * const _
8235                as usize } , 152usize , concat ! (
8236                "Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
8237                , stringify ! ( IoUmount ) ));
8238    assert_eq! (unsafe {
8239                & ( * ( 0 as * const PspIoDrvFuncs ) ) . IoDevctl as * const _
8240                as usize } , 160usize , concat ! (
8241                "Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
8242                , stringify ! ( IoDevctl ) ));
8243    assert_eq! (unsafe {
8244                & ( * ( 0 as * const PspIoDrvFuncs ) ) . IoUnk21 as * const _
8245                as usize } , 168usize , concat ! (
8246                "Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
8247                , stringify ! ( IoUnk21 ) ));
8248}
8249impl Clone for PspIoDrvFuncs {
8250    fn clone(&self) -> Self { *self }
8251}
8252extern "C" {
8253    /// Adds a new IO driver to the system.
8254/// @note This is only exported in the kernel version of IoFileMgr
8255///
8256/// @param drv - Pointer to a filled out driver structure
8257/// @return < 0 on error.
8258///
8259/// @par Example:
8260/// @code
8261/// PspIoDrvFuncs host_funcs = { ... };
8262/// PspIoDrv host_driver = { "host", 0x10, 0x800, "HOST", &host_funcs };
8263/// sceIoDelDrv("host");
8264/// sceIoAddDrv(&host_driver);
8265/// @endcode
8266    pub fn sceIoAddDrv(drv: *mut PspIoDrv) -> libc::c_int;
8267}
8268extern "C" {
8269    /// Deletes a IO driver from the system.
8270/// @note This is only exported in the kernel version of IoFileMgr
8271///
8272/// @param drv_name - Name of the driver to delete.
8273/// @return < 0 on error
8274    pub fn sceIoDelDrv(drv_name: *const libc::c_char) -> libc::c_int;
8275}
8276extern "C" {
8277    /// Reopens an existing file descriptor.
8278///
8279/// @param file - The new file to open.
8280/// @param flags - The open flags.
8281/// @param mode - The open mode.
8282/// @param fd - The old filedescriptor to reopen
8283///
8284/// @return < 0 on error, otherwise the reopened fd.
8285    pub fn sceIoReopen(file: *const libc::c_char, flags: libc::c_int,
8286                       mode: SceMode, fd: SceUID) -> libc::c_int;
8287}
8288extern "C" {
8289    /// Get the current working directory for a thread.
8290///
8291/// @param uid - The UID of the thread
8292/// @param dir - A character buffer in which to store the cwd
8293/// @param len - The length of the buffer
8294///
8295/// @return Number of characters written to buf, if no cwd then 0 is
8296/// returned.
8297    pub fn sceIoGetThreadCwd(uid: SceUID, dir: *mut libc::c_char,
8298                             len: libc::c_int) -> libc::c_int;
8299}
8300extern "C" {
8301    /// Set the current working directory for a thread
8302///
8303/// @param uid - The UID of the thread
8304/// @param dir - The directory to set
8305///
8306/// @return 0 on success, < 0 on error
8307    pub fn sceIoChangeThreadCwd(uid: SceUID, dir: *mut libc::c_char)
8308     -> libc::c_int;
8309}
8310/// Describes a module.  This structure could change in future firmware revisions.
8311#[repr(C, packed)]
8312#[derive(Debug, Copy)]
8313pub struct SceModule {
8314    pub next: *mut SceModule,
8315    pub attribute: libc::c_ushort,
8316    pub version: [libc::c_uchar; 2usize],
8317    pub modname: [libc::c_char; 27usize],
8318    pub terminal: libc::c_char,
8319    pub unknown1: libc::c_uint,
8320    pub unknown2: libc::c_uint,
8321    pub modid: SceUID,
8322    pub unknown3: [libc::c_uint; 4usize],
8323    pub ent_top: *mut libc::c_void,
8324    pub ent_size: libc::c_uint,
8325    pub stub_top: *mut libc::c_void,
8326    pub stub_size: libc::c_uint,
8327    pub unknown4: [libc::c_uint; 4usize],
8328    pub entry_addr: libc::c_uint,
8329    pub gp_value: libc::c_uint,
8330    pub text_addr: libc::c_uint,
8331    pub text_size: libc::c_uint,
8332    pub data_size: libc::c_uint,
8333    pub bss_size: libc::c_uint,
8334    pub nsegment: libc::c_uint,
8335    pub segmentaddr: [libc::c_uint; 4usize],
8336    pub segmentsize: [libc::c_uint; 4usize],
8337}
8338#[test]
8339fn bindgen_test_layout_SceModule() {
8340    assert_eq!(::core::mem::size_of::<SceModule>() , 168usize , concat ! (
8341               "Size of: " , stringify ! ( SceModule ) ));
8342    assert_eq! (::core::mem::align_of::<SceModule>() , 1usize , concat ! (
8343                "Alignment of " , stringify ! ( SceModule ) ));
8344    assert_eq! (unsafe {
8345                & ( * ( 0 as * const SceModule ) ) . next as * const _ as
8346                usize } , 0usize , concat ! (
8347                "Alignment of field: " , stringify ! ( SceModule ) , "::" ,
8348                stringify ! ( next ) ));
8349    assert_eq! (unsafe {
8350                & ( * ( 0 as * const SceModule ) ) . attribute as * const _ as
8351                usize } , 8usize , concat ! (
8352                "Alignment of field: " , stringify ! ( SceModule ) , "::" ,
8353                stringify ! ( attribute ) ));
8354    assert_eq! (unsafe {
8355                & ( * ( 0 as * const SceModule ) ) . version as * const _ as
8356                usize } , 10usize , concat ! (
8357                "Alignment of field: " , stringify ! ( SceModule ) , "::" ,
8358                stringify ! ( version ) ));
8359    assert_eq! (unsafe {
8360                & ( * ( 0 as * const SceModule ) ) . modname as * const _ as
8361                usize } , 12usize , concat ! (
8362                "Alignment of field: " , stringify ! ( SceModule ) , "::" ,
8363                stringify ! ( modname ) ));
8364    assert_eq! (unsafe {
8365                & ( * ( 0 as * const SceModule ) ) . terminal as * const _ as
8366                usize } , 39usize , concat ! (
8367                "Alignment of field: " , stringify ! ( SceModule ) , "::" ,
8368                stringify ! ( terminal ) ));
8369    assert_eq! (unsafe {
8370                & ( * ( 0 as * const SceModule ) ) . unknown1 as * const _ as
8371                usize } , 40usize , concat ! (
8372                "Alignment of field: " , stringify ! ( SceModule ) , "::" ,
8373                stringify ! ( unknown1 ) ));
8374    assert_eq! (unsafe {
8375                & ( * ( 0 as * const SceModule ) ) . unknown2 as * const _ as
8376                usize } , 44usize , concat ! (
8377                "Alignment of field: " , stringify ! ( SceModule ) , "::" ,
8378                stringify ! ( unknown2 ) ));
8379    assert_eq! (unsafe {
8380                & ( * ( 0 as * const SceModule ) ) . modid as * const _ as
8381                usize } , 48usize , concat ! (
8382                "Alignment of field: " , stringify ! ( SceModule ) , "::" ,
8383                stringify ! ( modid ) ));
8384    assert_eq! (unsafe {
8385                & ( * ( 0 as * const SceModule ) ) . unknown3 as * const _ as
8386                usize } , 52usize , concat ! (
8387                "Alignment of field: " , stringify ! ( SceModule ) , "::" ,
8388                stringify ! ( unknown3 ) ));
8389    assert_eq! (unsafe {
8390                & ( * ( 0 as * const SceModule ) ) . ent_top as * const _ as
8391                usize } , 68usize , concat ! (
8392                "Alignment of field: " , stringify ! ( SceModule ) , "::" ,
8393                stringify ! ( ent_top ) ));
8394    assert_eq! (unsafe {
8395                & ( * ( 0 as * const SceModule ) ) . ent_size as * const _ as
8396                usize } , 76usize , concat ! (
8397                "Alignment of field: " , stringify ! ( SceModule ) , "::" ,
8398                stringify ! ( ent_size ) ));
8399    assert_eq! (unsafe {
8400                & ( * ( 0 as * const SceModule ) ) . stub_top as * const _ as
8401                usize } , 80usize , concat ! (
8402                "Alignment of field: " , stringify ! ( SceModule ) , "::" ,
8403                stringify ! ( stub_top ) ));
8404    assert_eq! (unsafe {
8405                & ( * ( 0 as * const SceModule ) ) . stub_size as * const _ as
8406                usize } , 88usize , concat ! (
8407                "Alignment of field: " , stringify ! ( SceModule ) , "::" ,
8408                stringify ! ( stub_size ) ));
8409    assert_eq! (unsafe {
8410                & ( * ( 0 as * const SceModule ) ) . unknown4 as * const _ as
8411                usize } , 92usize , concat ! (
8412                "Alignment of field: " , stringify ! ( SceModule ) , "::" ,
8413                stringify ! ( unknown4 ) ));
8414    assert_eq! (unsafe {
8415                & ( * ( 0 as * const SceModule ) ) . entry_addr as * const _
8416                as usize } , 108usize , concat ! (
8417                "Alignment of field: " , stringify ! ( SceModule ) , "::" ,
8418                stringify ! ( entry_addr ) ));
8419    assert_eq! (unsafe {
8420                & ( * ( 0 as * const SceModule ) ) . gp_value as * const _ as
8421                usize } , 112usize , concat ! (
8422                "Alignment of field: " , stringify ! ( SceModule ) , "::" ,
8423                stringify ! ( gp_value ) ));
8424    assert_eq! (unsafe {
8425                & ( * ( 0 as * const SceModule ) ) . text_addr as * const _ as
8426                usize } , 116usize , concat ! (
8427                "Alignment of field: " , stringify ! ( SceModule ) , "::" ,
8428                stringify ! ( text_addr ) ));
8429    assert_eq! (unsafe {
8430                & ( * ( 0 as * const SceModule ) ) . text_size as * const _ as
8431                usize } , 120usize , concat ! (
8432                "Alignment of field: " , stringify ! ( SceModule ) , "::" ,
8433                stringify ! ( text_size ) ));
8434    assert_eq! (unsafe {
8435                & ( * ( 0 as * const SceModule ) ) . data_size as * const _ as
8436                usize } , 124usize , concat ! (
8437                "Alignment of field: " , stringify ! ( SceModule ) , "::" ,
8438                stringify ! ( data_size ) ));
8439    assert_eq! (unsafe {
8440                & ( * ( 0 as * const SceModule ) ) . bss_size as * const _ as
8441                usize } , 128usize , concat ! (
8442                "Alignment of field: " , stringify ! ( SceModule ) , "::" ,
8443                stringify ! ( bss_size ) ));
8444    assert_eq! (unsafe {
8445                & ( * ( 0 as * const SceModule ) ) . nsegment as * const _ as
8446                usize } , 132usize , concat ! (
8447                "Alignment of field: " , stringify ! ( SceModule ) , "::" ,
8448                stringify ! ( nsegment ) ));
8449    assert_eq! (unsafe {
8450                & ( * ( 0 as * const SceModule ) ) . segmentaddr as * const _
8451                as usize } , 136usize , concat ! (
8452                "Alignment of field: " , stringify ! ( SceModule ) , "::" ,
8453                stringify ! ( segmentaddr ) ));
8454    assert_eq! (unsafe {
8455                & ( * ( 0 as * const SceModule ) ) . segmentsize as * const _
8456                as usize } , 152usize , concat ! (
8457                "Alignment of field: " , stringify ! ( SceModule ) , "::" ,
8458                stringify ! ( segmentsize ) ));
8459}
8460impl Clone for SceModule {
8461    fn clone(&self) -> Self { *self }
8462}
8463/// Defines a library and its exported functions and variables.  Use the len
8464/// member to determine the real size of the table (size = len * 4).
8465#[repr(C)]
8466#[derive(Debug, Copy)]
8467pub struct SceLibraryEntryTable {
8468    /// The library's name.
8469    pub libname: *const libc::c_char,
8470    /// Library version.
8471    pub version: [libc::c_uchar; 2usize],
8472    /// Library attributes.
8473    pub attribute: libc::c_ushort,
8474    /// Length of this entry table in 32-bit WORDs.
8475    pub len: libc::c_uchar,
8476    /// The number of variables exported by the library.
8477    pub vstubcount: libc::c_uchar,
8478    /// The number of functions exported by the library.
8479    pub stubcount: libc::c_ushort,
8480    /// Pointer to the entry table; an array of NIDs followed by
8481    /// pointers to functions and variables.
8482    pub entrytable: *mut libc::c_void,
8483}
8484#[test]
8485fn bindgen_test_layout_SceLibraryEntryTable() {
8486    assert_eq!(::core::mem::size_of::<SceLibraryEntryTable>() , 24usize ,
8487               concat ! ( "Size of: " , stringify ! ( SceLibraryEntryTable )
8488               ));
8489    assert_eq! (::core::mem::align_of::<SceLibraryEntryTable>() , 8usize ,
8490                concat ! (
8491                "Alignment of " , stringify ! ( SceLibraryEntryTable ) ));
8492    assert_eq! (unsafe {
8493                & ( * ( 0 as * const SceLibraryEntryTable ) ) . libname as *
8494                const _ as usize } , 0usize , concat ! (
8495                "Alignment of field: " , stringify ! ( SceLibraryEntryTable )
8496                , "::" , stringify ! ( libname ) ));
8497    assert_eq! (unsafe {
8498                & ( * ( 0 as * const SceLibraryEntryTable ) ) . version as *
8499                const _ as usize } , 8usize , concat ! (
8500                "Alignment of field: " , stringify ! ( SceLibraryEntryTable )
8501                , "::" , stringify ! ( version ) ));
8502    assert_eq! (unsafe {
8503                & ( * ( 0 as * const SceLibraryEntryTable ) ) . attribute as *
8504                const _ as usize } , 10usize , concat ! (
8505                "Alignment of field: " , stringify ! ( SceLibraryEntryTable )
8506                , "::" , stringify ! ( attribute ) ));
8507    assert_eq! (unsafe {
8508                & ( * ( 0 as * const SceLibraryEntryTable ) ) . len as * const
8509                _ as usize } , 12usize , concat ! (
8510                "Alignment of field: " , stringify ! ( SceLibraryEntryTable )
8511                , "::" , stringify ! ( len ) ));
8512    assert_eq! (unsafe {
8513                & ( * ( 0 as * const SceLibraryEntryTable ) ) . vstubcount as
8514                * const _ as usize } , 13usize , concat ! (
8515                "Alignment of field: " , stringify ! ( SceLibraryEntryTable )
8516                , "::" , stringify ! ( vstubcount ) ));
8517    assert_eq! (unsafe {
8518                & ( * ( 0 as * const SceLibraryEntryTable ) ) . stubcount as *
8519                const _ as usize } , 14usize , concat ! (
8520                "Alignment of field: " , stringify ! ( SceLibraryEntryTable )
8521                , "::" , stringify ! ( stubcount ) ));
8522    assert_eq! (unsafe {
8523                & ( * ( 0 as * const SceLibraryEntryTable ) ) . entrytable as
8524                * const _ as usize } , 16usize , concat ! (
8525                "Alignment of field: " , stringify ! ( SceLibraryEntryTable )
8526                , "::" , stringify ! ( entrytable ) ));
8527}
8528impl Clone for SceLibraryEntryTable {
8529    fn clone(&self) -> Self { *self }
8530}
8531/// Specifies a library and a set of imports from that library.  Use the len
8532/// member to determine the real size of the table (size = len * 4).
8533#[repr(C)]
8534#[derive(Debug, Copy)]
8535pub struct SceLibraryStubTable {
8536    pub libname: *const libc::c_char,
8537    /// Minimum required version of the library we want to import.
8538    pub version: [libc::c_uchar; 2usize],
8539    pub attribute: libc::c_ushort,
8540    /// Length of this stub table in 32-bit WORDs.
8541    pub len: libc::c_uchar,
8542    /// The number of variables imported from the library.
8543    pub vstubcount: libc::c_uchar,
8544    /// The number of functions imported from the library.
8545    pub stubcount: libc::c_ushort,
8546    /// Pointer to an array of NIDs.
8547    pub nidtable: *mut libc::c_uint,
8548    /// Pointer to the imported function stubs.
8549    pub stubtable: *mut libc::c_void,
8550    /// Pointer to the imported variable stubs.
8551    pub vstubtable: *mut libc::c_void,
8552}
8553#[test]
8554fn bindgen_test_layout_SceLibraryStubTable() {
8555    assert_eq!(::core::mem::size_of::<SceLibraryStubTable>() , 40usize ,
8556               concat ! ( "Size of: " , stringify ! ( SceLibraryStubTable )
8557               ));
8558    assert_eq! (::core::mem::align_of::<SceLibraryStubTable>() , 8usize ,
8559                concat ! (
8560                "Alignment of " , stringify ! ( SceLibraryStubTable ) ));
8561    assert_eq! (unsafe {
8562                & ( * ( 0 as * const SceLibraryStubTable ) ) . libname as *
8563                const _ as usize } , 0usize , concat ! (
8564                "Alignment of field: " , stringify ! ( SceLibraryStubTable ) ,
8565                "::" , stringify ! ( libname ) ));
8566    assert_eq! (unsafe {
8567                & ( * ( 0 as * const SceLibraryStubTable ) ) . version as *
8568                const _ as usize } , 8usize , concat ! (
8569                "Alignment of field: " , stringify ! ( SceLibraryStubTable ) ,
8570                "::" , stringify ! ( version ) ));
8571    assert_eq! (unsafe {
8572                & ( * ( 0 as * const SceLibraryStubTable ) ) . attribute as *
8573                const _ as usize } , 10usize , concat ! (
8574                "Alignment of field: " , stringify ! ( SceLibraryStubTable ) ,
8575                "::" , stringify ! ( attribute ) ));
8576    assert_eq! (unsafe {
8577                & ( * ( 0 as * const SceLibraryStubTable ) ) . len as * const
8578                _ as usize } , 12usize , concat ! (
8579                "Alignment of field: " , stringify ! ( SceLibraryStubTable ) ,
8580                "::" , stringify ! ( len ) ));
8581    assert_eq! (unsafe {
8582                & ( * ( 0 as * const SceLibraryStubTable ) ) . vstubcount as *
8583                const _ as usize } , 13usize , concat ! (
8584                "Alignment of field: " , stringify ! ( SceLibraryStubTable ) ,
8585                "::" , stringify ! ( vstubcount ) ));
8586    assert_eq! (unsafe {
8587                & ( * ( 0 as * const SceLibraryStubTable ) ) . stubcount as *
8588                const _ as usize } , 14usize , concat ! (
8589                "Alignment of field: " , stringify ! ( SceLibraryStubTable ) ,
8590                "::" , stringify ! ( stubcount ) ));
8591    assert_eq! (unsafe {
8592                & ( * ( 0 as * const SceLibraryStubTable ) ) . nidtable as *
8593                const _ as usize } , 16usize , concat ! (
8594                "Alignment of field: " , stringify ! ( SceLibraryStubTable ) ,
8595                "::" , stringify ! ( nidtable ) ));
8596    assert_eq! (unsafe {
8597                & ( * ( 0 as * const SceLibraryStubTable ) ) . stubtable as *
8598                const _ as usize } , 24usize , concat ! (
8599                "Alignment of field: " , stringify ! ( SceLibraryStubTable ) ,
8600                "::" , stringify ! ( stubtable ) ));
8601    assert_eq! (unsafe {
8602                & ( * ( 0 as * const SceLibraryStubTable ) ) . vstubtable as *
8603                const _ as usize } , 32usize , concat ! (
8604                "Alignment of field: " , stringify ! ( SceLibraryStubTable ) ,
8605                "::" , stringify ! ( vstubtable ) ));
8606}
8607impl Clone for SceLibraryStubTable {
8608    fn clone(&self) -> Self { *self }
8609}
8610extern "C" {
8611    /// Find a module by it's name.
8612///
8613/// @param modname - The name of the module.
8614///
8615/// @return Pointer to the ::SceModule structure if found, otherwise NULL.
8616    pub fn sceKernelFindModuleByName(modname: *const libc::c_char)
8617     -> *mut SceModule;
8618}
8619extern "C" {
8620    /// Find a module from an address.
8621///
8622/// @param addr - Address somewhere within the module.
8623///
8624/// @return Pointer to the ::SceModule structure if found, otherwise NULL.
8625    pub fn sceKernelFindModuleByAddress(addr: libc::c_uint) -> *mut SceModule;
8626}
8627extern "C" {
8628    /// Find a module by it's UID.
8629///
8630/// @param modid - The UID of the module.
8631///
8632/// @return Pointer to the ::SceModule structure if found, otherwise NULL.
8633    pub fn sceKernelFindModuleByUID(modid: SceUID) -> *mut SceModule;
8634}
8635extern "C" {
8636    /// Return the count of loaded modules.
8637///
8638/// @return The count of loaded modules.
8639    pub fn sceKernelModuleCount() -> libc::c_int;
8640}
8641extern "C" {
8642    /// Invalidate the CPU's instruction cache.
8643    pub fn sceKernelIcacheClearAll();
8644}
8645extern "C" {
8646    /// Function reopen the stdout file handle to a new file
8647///
8648/// @param file - The file to open.
8649/// @param flags - The open flags
8650/// @param mode - The file mode
8651///
8652/// @return < 0 on error.
8653    pub fn sceKernelStdoutReopen(file: *const libc::c_char,
8654                                 flags: libc::c_int, mode: SceMode)
8655     -> libc::c_int;
8656}
8657extern "C" {
8658    /// Function reopen the stderr file handle to a new file
8659///
8660/// @param file - The file to open.
8661/// @param flags - The open flags
8662/// @param mode - The file mode
8663///
8664/// @return < 0 on error.
8665    pub fn sceKernelStderrReopen(file: *const libc::c_char,
8666                                 flags: libc::c_int, mode: SceMode)
8667     -> libc::c_int;
8668}
8669extern "C" {
8670    /// fprintf but for file descriptors
8671///
8672/// @param fd - file descriptor from sceIoOpen
8673/// @param format - format string
8674/// @param ... - variables
8675///
8676/// @return number of characters printed, <0 on error
8677    pub fn fdprintf(fd: libc::c_int, format: *const libc::c_char, ...)
8678     -> libc::c_int;
8679}
8680extern "C" {
8681    /// Enable the ME reset.
8682///
8683/// @return < 0 on error.
8684    pub fn sceSysregMeResetEnable() -> libc::c_int;
8685}
8686extern "C" {
8687    /// Disable the ME reset.
8688///
8689/// @return < 0 on error.
8690    pub fn sceSysregMeResetDisable() -> libc::c_int;
8691}
8692extern "C" {
8693    /// Enable the VME reset.
8694///
8695/// @return < 0 on error.
8696    pub fn sceSysregVmeResetEnable() -> libc::c_int;
8697}
8698extern "C" {
8699    /// Disable the VME reset.
8700///
8701/// @return < 0 on error.
8702    pub fn sceSysregVmeResetDisable() -> libc::c_int;
8703}
8704extern "C" {
8705    /// Enable the ME bus clock.
8706///
8707/// @return < 0 on error.
8708    pub fn sceSysregMeBusClockEnable() -> libc::c_int;
8709}
8710extern "C" {
8711    /// Disable the ME bus clock.
8712///
8713/// @return < 0 on error.
8714    pub fn sceSysregMeBusClockDisable() -> libc::c_int;
8715}
8716extern "C" {
8717    /// Get the PSP's Tachyon version.
8718/// @param version - A pointer to an int to receive the Tachyon version into
8719    pub fn sceSysconGetTachyonVersion(version: *mut libc::c_int)
8720     -> libc::c_int;
8721}
8722/// Typedef for the debug putcharacter handler
8723pub type PspDebugPutChar =
8724    ::core::option::Option<unsafe extern "C" fn(args: *mut libc::c_ushort,
8725                                                ch: libc::c_uint)>;
8726extern "C" {
8727    /// Register a debug put character handler
8728///
8729/// @param func - The put character function to register.
8730    pub fn sceKernelRegisterDebugPutchar(func: PspDebugPutChar);
8731}
8732extern "C" {
8733    /// Get the debug put character handler
8734///
8735/// @return The current debug putchar handler
8736    pub fn sceKernelGetDebugPutchar() -> PspDebugPutChar;
8737}
8738extern "C" {
8739    /// Kernel printf function.
8740///
8741/// @param format - The format string.
8742/// @param ... - Arguments for the format string.
8743    pub fn Kprintf(format: *const libc::c_char, ...);
8744}
8745extern "C" {
8746    /// Register an interrupt handler.
8747///
8748/// @param intno - The interrupt number to register.
8749/// @param no    - The queue number.
8750/// @param handler - Pointer to the handler.
8751/// @param arg1    - Unknown (probably a set of flags)
8752/// @param arg2    - Unknown (probably a common pointer)
8753///
8754/// @return 0 on success.
8755    pub fn sceKernelRegisterIntrHandler(intno: libc::c_int, no: libc::c_int,
8756                                        handler: *mut libc::c_void,
8757                                        arg1: *mut libc::c_void,
8758                                        arg2: *mut libc::c_void)
8759     -> libc::c_int;
8760}
8761extern "C" {
8762    /// Release an interrupt handler
8763///
8764/// @param intno - The interrupt number to release
8765///
8766/// @return 0 on success
8767    pub fn sceKernelReleaseIntrHandler(intno: libc::c_int) -> libc::c_int;
8768}
8769extern "C" {
8770    /// Enable an interrupt.
8771///
8772/// @param intno - Interrupt to enable.
8773///
8774/// @return 0 on success.
8775    pub fn sceKernelEnableIntr(intno: libc::c_int) -> libc::c_int;
8776}
8777extern "C" {
8778    /// Disable an interrupt.
8779///
8780/// @param intno - Interrupt to disable.
8781///
8782/// @return 0 on success.
8783    pub fn sceKernelDisableIntr(intno: libc::c_int) -> libc::c_int;
8784}
8785extern "C" {
8786    /// Check if we are in an interrupt context or not
8787///
8788/// @return 1 if we are in an interrupt context, else 0
8789    pub fn sceKernelIsIntrContext() -> libc::c_int;
8790}
8791extern "C" {
8792    /// Gets the current module list.
8793///
8794/// @param readbufsize - The size of the read buffer.
8795/// @param readbuf     - Pointer to a buffer to store the IDs
8796///
8797/// @return < 0 on error.
8798    pub fn sceKernelGetModuleList(readbufsize: libc::c_int,
8799                                  readbuf: *mut SceUID) -> libc::c_int;
8800}
8801extern "C" {
8802    /// Load a module from a buffer
8803///
8804/// @param buf - Pointer to a buffer containing the module to load.  The buffer must reside at an
8805/// address that is a multiple to 64 bytes.
8806/// @param bufsize - Size (in bytes) of the buffer pointed to by buf.
8807/// @param flags - Unused, always 0.
8808/// @param option - Pointer to an optional ::SceKernelLMOption structure.
8809///
8810/// @return The UID of the loaded module on success, otherwise one of ::PspKernelErrorCodes.
8811    pub fn sceKernelLoadModuleBuffer(buf: *mut libc::c_void, bufsize: SceSize,
8812                                     flags: libc::c_int,
8813                                     option: *mut SceKernelLMOption)
8814     -> SceUID;
8815}
8816#[repr(C)]
8817#[derive(Debug, Copy)]
8818pub struct PspBufferInfo {
8819    pub pucWritePositionFirstBuf: *mut u8,
8820    pub uiWritableByteFirstBuf: u32,
8821    pub uiMinWriteByteFirstBuf: u32,
8822    pub uiReadPositionFirstBuf: u32,
8823    pub pucWritePositionSecondBuf: *mut u8,
8824    pub uiWritableByteSecondBuf: u32,
8825    pub uiMinWriteByteSecondBuf: u32,
8826    pub uiReadPositionSecondBuf: u32,
8827}
8828#[test]
8829fn bindgen_test_layout_PspBufferInfo() {
8830    assert_eq!(::core::mem::size_of::<PspBufferInfo>() , 48usize , concat ! (
8831               "Size of: " , stringify ! ( PspBufferInfo ) ));
8832    assert_eq! (::core::mem::align_of::<PspBufferInfo>() , 8usize , concat ! (
8833                "Alignment of " , stringify ! ( PspBufferInfo ) ));
8834    assert_eq! (unsafe {
8835                & ( * ( 0 as * const PspBufferInfo ) ) .
8836                pucWritePositionFirstBuf as * const _ as usize } , 0usize ,
8837                concat ! (
8838                "Alignment of field: " , stringify ! ( PspBufferInfo ) , "::"
8839                , stringify ! ( pucWritePositionFirstBuf ) ));
8840    assert_eq! (unsafe {
8841                & ( * ( 0 as * const PspBufferInfo ) ) .
8842                uiWritableByteFirstBuf as * const _ as usize } , 8usize ,
8843                concat ! (
8844                "Alignment of field: " , stringify ! ( PspBufferInfo ) , "::"
8845                , stringify ! ( uiWritableByteFirstBuf ) ));
8846    assert_eq! (unsafe {
8847                & ( * ( 0 as * const PspBufferInfo ) ) .
8848                uiMinWriteByteFirstBuf as * const _ as usize } , 12usize ,
8849                concat ! (
8850                "Alignment of field: " , stringify ! ( PspBufferInfo ) , "::"
8851                , stringify ! ( uiMinWriteByteFirstBuf ) ));
8852    assert_eq! (unsafe {
8853                & ( * ( 0 as * const PspBufferInfo ) ) .
8854                uiReadPositionFirstBuf as * const _ as usize } , 16usize ,
8855                concat ! (
8856                "Alignment of field: " , stringify ! ( PspBufferInfo ) , "::"
8857                , stringify ! ( uiReadPositionFirstBuf ) ));
8858    assert_eq! (unsafe {
8859                & ( * ( 0 as * const PspBufferInfo ) ) .
8860                pucWritePositionSecondBuf as * const _ as usize } , 24usize ,
8861                concat ! (
8862                "Alignment of field: " , stringify ! ( PspBufferInfo ) , "::"
8863                , stringify ! ( pucWritePositionSecondBuf ) ));
8864    assert_eq! (unsafe {
8865                & ( * ( 0 as * const PspBufferInfo ) ) .
8866                uiWritableByteSecondBuf as * const _ as usize } , 32usize ,
8867                concat ! (
8868                "Alignment of field: " , stringify ! ( PspBufferInfo ) , "::"
8869                , stringify ! ( uiWritableByteSecondBuf ) ));
8870    assert_eq! (unsafe {
8871                & ( * ( 0 as * const PspBufferInfo ) ) .
8872                uiMinWriteByteSecondBuf as * const _ as usize } , 36usize ,
8873                concat ! (
8874                "Alignment of field: " , stringify ! ( PspBufferInfo ) , "::"
8875                , stringify ! ( uiMinWriteByteSecondBuf ) ));
8876    assert_eq! (unsafe {
8877                & ( * ( 0 as * const PspBufferInfo ) ) .
8878                uiReadPositionSecondBuf as * const _ as usize } , 40usize ,
8879                concat ! (
8880                "Alignment of field: " , stringify ! ( PspBufferInfo ) , "::"
8881                , stringify ! ( uiReadPositionSecondBuf ) ));
8882}
8883impl Clone for PspBufferInfo {
8884    fn clone(&self) -> Self { *self }
8885}
8886extern "C" {
8887    pub fn sceAtracGetAtracID(uiCodecType: uint) -> libc::c_int;
8888}
8889extern "C" {
8890    /// Creates a new Atrac ID from the specified data
8891///
8892/// @param buf - the buffer holding the atrac3 data, including the RIFF/WAVE header.
8893/// @param bufsize - the size of the buffer pointed by buf
8894///
8895/// @return the new atrac ID, or < 0 on error
8896    pub fn sceAtracSetDataAndGetID(buf: *mut libc::c_void, bufsize: SceSize)
8897     -> libc::c_int;
8898}
8899extern "C" {
8900    /// Decode a frame of data.
8901///
8902/// @param atracID - the atrac ID
8903/// @param outSamples - pointer to a buffer that receives the decoded data of the current frame
8904/// @param outN - pointer to a integer that receives the number of audio samples of the decoded frame
8905/// @param outEnd - pointer to a integer that receives a boolean value indicating if the decoded frame is the last one
8906/// @param outRemainFrame - pointer to a integer that receives either -1 if all at3 data is already on memory,
8907/// or the remaining (not decoded yet) frames at memory if not all at3 data is on memory
8908///
8909///
8910/// @return < 0 on error, otherwise 0
8911///
8912    pub fn sceAtracDecodeData(atracID: libc::c_int, outSamples: *mut u16,
8913                              outN: *mut libc::c_int,
8914                              outEnd: *mut libc::c_int,
8915                              outRemainFrame: *mut libc::c_int)
8916     -> libc::c_int;
8917}
8918extern "C" {
8919    /// Gets the remaining (not decoded) number of frames
8920///
8921/// @param atracID - the atrac ID
8922/// @param outRemainFrame - pointer to a integer that receives either -1 if all at3 data is already on memory,
8923/// or the remaining (not decoded yet) frames at memory if not all at3 data is on memory
8924///
8925/// @return < 0 on error, otherwise 0
8926///
8927    pub fn sceAtracGetRemainFrame(atracID: libc::c_int,
8928                                  outRemainFrame: *mut libc::c_int)
8929     -> libc::c_int;
8930}
8931extern "C" {
8932    /// @param atracID - the atrac ID
8933/// @param writePointer - Pointer to where to read the atrac data
8934/// @param availableBytes - Number of bytes available at the writePointer location
8935/// @param readOffset - Offset where to seek into the atrac file before reading
8936///
8937/// @return < 0 on error, otherwise 0
8938///
8939    pub fn sceAtracGetStreamDataInfo(atracID: libc::c_int,
8940                                     writePointer: *mut *mut u8,
8941                                     availableBytes: *mut u32,
8942                                     readOffset: *mut u32) -> libc::c_int;
8943}
8944extern "C" {
8945    /// @param atracID - the atrac ID
8946/// @param bytesToAdd - Number of bytes read into location given by sceAtracGetStreamDataInfo().
8947///
8948/// @return < 0 on error, otherwise 0
8949    pub fn sceAtracAddStreamData(atracID: libc::c_int,
8950                                 bytesToAdd: libc::c_uint) -> libc::c_int;
8951}
8952extern "C" {
8953    /// Gets the bitrate.
8954///
8955/// @param atracID - the atracID
8956/// @param outBitrate - pointer to a integer that receives the bitrate in kbps
8957///
8958/// @return < 0 on error, otherwise 0
8959///
8960    pub fn sceAtracGetBitrate(atracID: libc::c_int,
8961                              outBitrate: *mut libc::c_int) -> libc::c_int;
8962}
8963extern "C" {
8964    /// Sets the number of loops for this atrac ID
8965///
8966/// @param atracID - the atracID
8967/// @param nloops - the number of loops to set
8968///
8969/// @return < 0 on error, otherwise 0
8970///
8971    pub fn sceAtracSetLoopNum(atracID: libc::c_int, nloops: libc::c_int)
8972     -> libc::c_int;
8973}
8974extern "C" {
8975    /// It releases an atrac ID
8976///
8977/// @param atracID - the atrac ID to release
8978///
8979/// @return < 0 on error
8980///
8981    pub fn sceAtracReleaseAtracID(atracID: libc::c_int) -> libc::c_int;
8982}
8983extern "C" {
8984    /// Gets the number of samples of the next frame to be decoded.
8985///
8986/// @param atracID - the atrac ID
8987/// @param outN - pointer to receives the number of samples of the next frame.
8988///
8989/// @return < 0 on error, otherwise 0
8990///
8991    pub fn sceAtracGetNextSample(atracID: libc::c_int, outN: *mut libc::c_int)
8992     -> libc::c_int;
8993}
8994extern "C" {
8995    /// Gets the maximum number of samples of the atrac3 stream.
8996///
8997/// @param atracID - the atrac ID
8998/// @param outMax  - pointer to a integer that receives the maximum number of samples.
8999///
9000/// @return < 0 on error, otherwise 0
9001///
9002    pub fn sceAtracGetMaxSample(atracID: libc::c_int,
9003                                outMax: *mut libc::c_int) -> libc::c_int;
9004}
9005extern "C" {
9006    pub fn sceAtracGetBufferInfoForReseting(atracID: libc::c_int,
9007                                            uiSample: u32,
9008                                            pBufferInfo: *mut PspBufferInfo)
9009     -> libc::c_int;
9010}
9011extern "C" {
9012    pub fn sceAtracGetChannel(atracID: libc::c_int, puiChannel: *mut u32)
9013     -> libc::c_int;
9014}
9015extern "C" {
9016    pub fn sceAtracGetInternalErrorInfo(atracID: libc::c_int,
9017                                        piResult: *mut libc::c_int)
9018     -> libc::c_int;
9019}
9020extern "C" {
9021    pub fn sceAtracGetLoopStatus(atracID: libc::c_int,
9022                                 piLoopNum: *mut libc::c_int,
9023                                 puiLoopStatus: *mut u32) -> libc::c_int;
9024}
9025extern "C" {
9026    pub fn sceAtracGetNextDecodePosition(atracID: libc::c_int,
9027                                         puiSamplePosition: *mut u32)
9028     -> libc::c_int;
9029}
9030extern "C" {
9031    pub fn sceAtracGetSecondBufferInfo(atracID: libc::c_int,
9032                                       puiPosition: *mut u32,
9033                                       puiDataByte: *mut u32) -> libc::c_int;
9034}
9035extern "C" {
9036    pub fn sceAtracGetSoundSample(atracID: libc::c_int,
9037                                  piEndSample: *mut libc::c_int,
9038                                  piLoopStartSample: *mut libc::c_int,
9039                                  piLoopEndSample: *mut libc::c_int)
9040     -> libc::c_int;
9041}
9042extern "C" {
9043    pub fn sceAtracResetPlayPosition(atracID: libc::c_int, uiSample: u32,
9044                                     uiWriteByteFirstBuf: u32,
9045                                     uiWriteByteSecondBuf: u32)
9046     -> libc::c_int;
9047}
9048extern "C" {
9049    pub fn sceAtracSetData(atracID: libc::c_int, pucBufferAddr: *mut u8,
9050                           uiBufferByte: u32) -> libc::c_int;
9051}
9052extern "C" {
9053    pub fn sceAtracSetHalfwayBuffer(atracID: libc::c_int,
9054                                    pucBufferAddr: *mut u8, uiReadByte: u32,
9055                                    uiBufferByte: u32) -> libc::c_int;
9056}
9057extern "C" {
9058    pub fn sceAtracSetHalfwayBufferAndGetID(pucBufferAddr: *mut u8,
9059                                            uiReadByte: u32,
9060                                            uiBufferByte: u32) -> libc::c_int;
9061}
9062extern "C" {
9063    pub fn sceAtracSetSecondBuffer(atracID: libc::c_int,
9064                                   pucSecondBufferAddr: *mut u8,
9065                                   uiSecondBufferByte: u32) -> libc::c_int;
9066}
9067extern "C" {
9068    pub fn sceAudiocodecCheckNeedMem(Buffer: *mut libc::c_ulong,
9069                                     Type: libc::c_int) -> libc::c_int;
9070}
9071extern "C" {
9072    pub fn sceAudiocodecInit(Buffer: *mut libc::c_ulong, Type: libc::c_int)
9073     -> libc::c_int;
9074}
9075extern "C" {
9076    pub fn sceAudiocodecDecode(Buffer: *mut libc::c_ulong, Type: libc::c_int)
9077     -> libc::c_int;
9078}
9079extern "C" {
9080    pub fn sceAudiocodecGetEDRAM(Buffer: *mut libc::c_ulong,
9081                                 Type: libc::c_int) -> libc::c_int;
9082}
9083extern "C" {
9084    pub fn sceAudiocodecReleaseEDRAM(Buffer: *mut libc::c_ulong)
9085     -> libc::c_int;
9086}
9087#[repr(u32)]
9088#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
9089pub enum PspAudioFormats {
9090    PSP_AUDIO_FORMAT_STEREO = 0,
9091    PSP_AUDIO_FORMAT_MONO = 16,
9092}
9093#[repr(C)]
9094#[derive(Debug, Copy)]
9095pub struct pspAudioInputParams {
9096    /// Unknown. Pass 0
9097    pub unknown1: libc::c_int,
9098    pub gain: libc::c_int,
9099    /// Unknown. Pass 0
9100    pub unknown2: libc::c_int,
9101    /// Unknown. Pass 0
9102    pub unknown3: libc::c_int,
9103    /// Unknown. Pass 0
9104    pub unknown4: libc::c_int,
9105    /// Unknown. Pass 0
9106    pub unknown5: libc::c_int,
9107}
9108#[test]
9109fn bindgen_test_layout_pspAudioInputParams() {
9110    assert_eq!(::core::mem::size_of::<pspAudioInputParams>() , 24usize ,
9111               concat ! ( "Size of: " , stringify ! ( pspAudioInputParams )
9112               ));
9113    assert_eq! (::core::mem::align_of::<pspAudioInputParams>() , 4usize ,
9114                concat ! (
9115                "Alignment of " , stringify ! ( pspAudioInputParams ) ));
9116    assert_eq! (unsafe {
9117                & ( * ( 0 as * const pspAudioInputParams ) ) . unknown1 as *
9118                const _ as usize } , 0usize , concat ! (
9119                "Alignment of field: " , stringify ! ( pspAudioInputParams ) ,
9120                "::" , stringify ! ( unknown1 ) ));
9121    assert_eq! (unsafe {
9122                & ( * ( 0 as * const pspAudioInputParams ) ) . gain as * const
9123                _ as usize } , 4usize , concat ! (
9124                "Alignment of field: " , stringify ! ( pspAudioInputParams ) ,
9125                "::" , stringify ! ( gain ) ));
9126    assert_eq! (unsafe {
9127                & ( * ( 0 as * const pspAudioInputParams ) ) . unknown2 as *
9128                const _ as usize } , 8usize , concat ! (
9129                "Alignment of field: " , stringify ! ( pspAudioInputParams ) ,
9130                "::" , stringify ! ( unknown2 ) ));
9131    assert_eq! (unsafe {
9132                & ( * ( 0 as * const pspAudioInputParams ) ) . unknown3 as *
9133                const _ as usize } , 12usize , concat ! (
9134                "Alignment of field: " , stringify ! ( pspAudioInputParams ) ,
9135                "::" , stringify ! ( unknown3 ) ));
9136    assert_eq! (unsafe {
9137                & ( * ( 0 as * const pspAudioInputParams ) ) . unknown4 as *
9138                const _ as usize } , 16usize , concat ! (
9139                "Alignment of field: " , stringify ! ( pspAudioInputParams ) ,
9140                "::" , stringify ! ( unknown4 ) ));
9141    assert_eq! (unsafe {
9142                & ( * ( 0 as * const pspAudioInputParams ) ) . unknown5 as *
9143                const _ as usize } , 20usize , concat ! (
9144                "Alignment of field: " , stringify ! ( pspAudioInputParams ) ,
9145                "::" , stringify ! ( unknown5 ) ));
9146}
9147impl Clone for pspAudioInputParams {
9148    fn clone(&self) -> Self { *self }
9149}
9150extern "C" {
9151    /// Allocate and initialize a hardware output channel.
9152///
9153/// @param channel - Use a value between 0 - 7 to reserve a specific channel.
9154/// Pass PSP_AUDIO_NEXT_CHANNEL to get the first available channel.
9155/// @param samplecount - The number of samples that can be output on the channel per
9156/// output call.  It must be a value between ::PSP_AUDIO_SAMPLE_MIN
9157/// and ::PSP_AUDIO_SAMPLE_MAX, and it must be aligned to 64 bytes
9158/// (use the ::PSP_AUDIO_SAMPLE_ALIGN macro to align it).
9159/// @param format - The output format to use for the channel.  One of ::PspAudioFormats.
9160///
9161/// @return The channel number on success, an error code if less than 0.
9162    pub fn sceAudioChReserve(channel: libc::c_int, samplecount: libc::c_int,
9163                             format: libc::c_int) -> libc::c_int;
9164}
9165extern "C" {
9166    /// Release a hardware output channel.
9167///
9168/// @param channel - The channel to release.
9169///
9170/// @return 0 on success, an error if less than 0.
9171    pub fn sceAudioChRelease(channel: libc::c_int) -> libc::c_int;
9172}
9173extern "C" {
9174    /// Output audio of the specified channel
9175///
9176/// @param channel - The channel number.
9177///
9178/// @param vol - The volume.
9179///
9180/// @param buf - Pointer to the PCM data to output.
9181///
9182/// @return 0 on success, an error if less than 0.
9183    pub fn sceAudioOutput(channel: libc::c_int, vol: libc::c_int,
9184                          buf: *mut libc::c_void) -> libc::c_int;
9185}
9186extern "C" {
9187    /// Output audio of the specified channel (blocking)
9188///
9189/// @param channel - The channel number.
9190///
9191/// @param vol - The volume.
9192///
9193/// @param buf - Pointer to the PCM data to output.
9194///
9195/// @return 0 on success, an error if less than 0.
9196    pub fn sceAudioOutputBlocking(channel: libc::c_int, vol: libc::c_int,
9197                                  buf: *mut libc::c_void) -> libc::c_int;
9198}
9199extern "C" {
9200    /// Output panned audio of the specified channel
9201///
9202/// @param channel - The channel number.
9203///
9204/// @param leftvol - The left volume.
9205///
9206/// @param rightvol - The right volume.
9207///
9208/// @param buf - Pointer to the PCM data to output.
9209///
9210/// @return 0 on success, an error if less than 0.
9211    pub fn sceAudioOutputPanned(channel: libc::c_int, leftvol: libc::c_int,
9212                                rightvol: libc::c_int, buf: *mut libc::c_void)
9213     -> libc::c_int;
9214}
9215extern "C" {
9216    /// Output panned audio of the specified channel (blocking)
9217///
9218/// @param channel - The channel number.
9219///
9220/// @param leftvol - The left volume.
9221///
9222/// @param rightvol - The right volume.
9223///
9224/// @param buf - Pointer to the PCM data to output.
9225///
9226/// @return 0 on success, an error if less than 0.
9227    pub fn sceAudioOutputPannedBlocking(channel: libc::c_int,
9228                                        leftvol: libc::c_int,
9229                                        rightvol: libc::c_int,
9230                                        buf: *mut libc::c_void)
9231     -> libc::c_int;
9232}
9233extern "C" {
9234    /// Get count of unplayed samples remaining
9235///
9236/// @param channel - The channel number.
9237///
9238/// @return Number of samples to be played, an error if less than 0.
9239    pub fn sceAudioGetChannelRestLen(channel: libc::c_int) -> libc::c_int;
9240}
9241extern "C" {
9242    /// Get count of unplayed samples remaining
9243///
9244/// @param channel - The channel number.
9245///
9246/// @return Number of samples to be played, an error if less than 0.
9247    pub fn sceAudioGetChannelRestLength(channel: libc::c_int) -> libc::c_int;
9248}
9249extern "C" {
9250    /// Change the output sample count, after it's already been reserved
9251///
9252/// @param channel - The channel number.
9253/// @param samplecount - The number of samples to output in one output call.
9254///
9255/// @return 0 on success, an error if less than 0.
9256    pub fn sceAudioSetChannelDataLen(channel: libc::c_int,
9257                                     samplecount: libc::c_int) -> libc::c_int;
9258}
9259extern "C" {
9260    /// Change the format of a channel
9261///
9262/// @param channel - The channel number.
9263///
9264/// @param format - One of ::PspAudioFormats
9265///
9266/// @return 0 on success, an error if less than 0.
9267    pub fn sceAudioChangeChannelConfig(channel: libc::c_int,
9268                                       format: libc::c_int) -> libc::c_int;
9269}
9270extern "C" {
9271    /// Change the volume of a channel
9272///
9273/// @param channel - The channel number.
9274///
9275/// @param leftvol - The left volume.
9276///
9277/// @param rightvol - The right volume.
9278///
9279/// @return 0 on success, an error if less than 0.
9280    pub fn sceAudioChangeChannelVolume(channel: libc::c_int,
9281                                       leftvol: libc::c_int,
9282                                       rightvol: libc::c_int) -> libc::c_int;
9283}
9284extern "C" {
9285    /// Reserve the audio output and set the output sample count
9286///
9287/// @param samplecount - The number of samples to output in one output call (min 17, max 4111).
9288///
9289/// @return 0 on success, an error if less than 0.
9290    pub fn sceAudioOutput2Reserve(samplecount: libc::c_int) -> libc::c_int;
9291}
9292extern "C" {
9293    /// Release the audio output
9294///
9295/// @return 0 on success, an error if less than 0.
9296    pub fn sceAudioOutput2Release() -> libc::c_int;
9297}
9298extern "C" {
9299    /// Change the output sample count, after it's already been reserved
9300///
9301/// @param samplecount - The number of samples to output in one output call (min 17, max 4111).
9302///
9303/// @return 0 on success, an error if less than 0.
9304    pub fn sceAudioOutput2ChangeLength(samplecount: libc::c_int)
9305     -> libc::c_int;
9306}
9307extern "C" {
9308    /// Output audio (blocking)
9309///
9310/// @param vol - The volume.
9311///
9312/// @param buf - Pointer to the PCM data.
9313///
9314/// @return 0 on success, an error if less than 0.
9315    pub fn sceAudioOutput2OutputBlocking(vol: libc::c_int,
9316                                         buf: *mut libc::c_void)
9317     -> libc::c_int;
9318}
9319extern "C" {
9320    /// Get count of unplayed samples remaining
9321///
9322/// @return Number of samples to be played, an error if less than 0.
9323    pub fn sceAudioOutput2GetRestSample() -> libc::c_int;
9324}
9325extern "C" {
9326    /// Reserve the audio output
9327///
9328/// @param samplecount - The number of samples to output in one output call (min 17, max 4111).
9329///
9330/// @param freq - The frequency. One of 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11050, 8000.
9331///
9332/// @param channels - Number of channels. Pass 2 (stereo).
9333///
9334/// @return 0 on success, an error if less than 0.
9335    pub fn sceAudioSRCChReserve(samplecount: libc::c_int, freq: libc::c_int,
9336                                channels: libc::c_int) -> libc::c_int;
9337}
9338extern "C" {
9339    /// Release the audio output
9340///
9341/// @return 0 on success, an error if less than 0.
9342    pub fn sceAudioSRCChRelease() -> libc::c_int;
9343}
9344extern "C" {
9345    /// Output audio
9346///
9347/// @param vol - The volume.
9348///
9349/// @param buf - Pointer to the PCM data to output.
9350///
9351/// @return 0 on success, an error if less than 0.
9352    pub fn sceAudioSRCOutputBlocking(vol: libc::c_int, buf: *mut libc::c_void)
9353     -> libc::c_int;
9354}
9355extern "C" {
9356    /// Init audio input
9357///
9358/// @param unknown1 - Unknown. Pass 0.
9359///
9360/// @param gain - Gain.
9361///
9362/// @param unknown2 - Unknown. Pass 0.
9363///
9364/// @return 0 on success, an error if less than 0.
9365    pub fn sceAudioInputInit(unknown1: libc::c_int, gain: libc::c_int,
9366                             unknown2: libc::c_int) -> libc::c_int;
9367}
9368extern "C" {
9369    /// Init audio input (with extra arguments)
9370///
9371/// @param params - A pointer to a ::pspAudioInputParams struct.
9372///
9373/// @return 0 on success, an error if less than 0.
9374    pub fn sceAudioInputInitEx(params: *mut pspAudioInputParams)
9375     -> libc::c_int;
9376}
9377extern "C" {
9378    /// Perform audio input (blocking)
9379///
9380/// @param samplecount - Number of samples.
9381///
9382/// @param freq - Either 44100, 22050 or 11025.
9383///
9384/// @param buf - Pointer to where the audio data will be stored.
9385///
9386/// @return 0 on success, an error if less than 0.
9387    pub fn sceAudioInputBlocking(samplecount: libc::c_int, freq: libc::c_int,
9388                                 buf: *mut libc::c_void) -> libc::c_int;
9389}
9390extern "C" {
9391    /// Perform audio input
9392///
9393/// @param samplecount - Number of samples.
9394///
9395/// @param freq - Either 44100, 22050 or 11025.
9396///
9397/// @param buf - Pointer to where the audio data will be stored.
9398///
9399/// @return 0 on success, an error if less than 0.
9400    pub fn sceAudioInput(samplecount: libc::c_int, freq: libc::c_int,
9401                         buf: *mut libc::c_void) -> libc::c_int;
9402}
9403extern "C" {
9404    /// Get the number of samples that were acquired
9405///
9406/// @return Number of samples acquired, an error if less than 0.
9407    pub fn sceAudioGetInputLength() -> libc::c_int;
9408}
9409extern "C" {
9410    /// Wait for non-blocking audio input to complete
9411///
9412/// @return 0 on success, an error if less than 0.
9413    pub fn sceAudioWaitInputEnd() -> libc::c_int;
9414}
9415extern "C" {
9416    /// Poll for non-blocking audio input status
9417///
9418/// @return 0 if input has completed, 1 if not completed or an error if less than 0.
9419    pub fn sceAudioPollInputEnd() -> libc::c_int;
9420}
9421#[repr(u32)]
9422#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
9423pub enum PspAudioFrequencies {
9424    PSP_AUDIO_FREQ_44K = 44100,
9425    PSP_AUDIO_FREQ_48K = 48000,
9426}
9427extern "C" {
9428    /// Set audio sampling frequency
9429///
9430/// @param frequency - Sampling frequency to set audio output to - either 44100 or 48000.
9431///
9432/// @return 0 on success, an error if less than 0.
9433    pub fn sceAudioSetFrequency(frequency: libc::c_int) -> libc::c_int;
9434}
9435pub type pspAudioCallback_t =
9436    ::core::option::Option<unsafe extern "C" fn(buf: *mut libc::c_void,
9437                                                reqn: libc::c_uint,
9438                                                pdata: *mut libc::c_void)>;
9439#[repr(C)]
9440#[derive(Debug, Copy)]
9441pub struct psp_audio_channelinfo {
9442    pub threadhandle: libc::c_int,
9443    pub handle: libc::c_int,
9444    pub volumeleft: libc::c_int,
9445    pub volumeright: libc::c_int,
9446    pub callback: pspAudioCallback_t,
9447    pub pdata: *mut libc::c_void,
9448}
9449#[test]
9450fn bindgen_test_layout_psp_audio_channelinfo() {
9451    assert_eq!(::core::mem::size_of::<psp_audio_channelinfo>() , 32usize ,
9452               concat ! ( "Size of: " , stringify ! ( psp_audio_channelinfo )
9453               ));
9454    assert_eq! (::core::mem::align_of::<psp_audio_channelinfo>() , 8usize ,
9455                concat ! (
9456                "Alignment of " , stringify ! ( psp_audio_channelinfo ) ));
9457    assert_eq! (unsafe {
9458                & ( * ( 0 as * const psp_audio_channelinfo ) ) . threadhandle
9459                as * const _ as usize } , 0usize , concat ! (
9460                "Alignment of field: " , stringify ! ( psp_audio_channelinfo )
9461                , "::" , stringify ! ( threadhandle ) ));
9462    assert_eq! (unsafe {
9463                & ( * ( 0 as * const psp_audio_channelinfo ) ) . handle as *
9464                const _ as usize } , 4usize , concat ! (
9465                "Alignment of field: " , stringify ! ( psp_audio_channelinfo )
9466                , "::" , stringify ! ( handle ) ));
9467    assert_eq! (unsafe {
9468                & ( * ( 0 as * const psp_audio_channelinfo ) ) . volumeleft as
9469                * const _ as usize } , 8usize , concat ! (
9470                "Alignment of field: " , stringify ! ( psp_audio_channelinfo )
9471                , "::" , stringify ! ( volumeleft ) ));
9472    assert_eq! (unsafe {
9473                & ( * ( 0 as * const psp_audio_channelinfo ) ) . volumeright
9474                as * const _ as usize } , 12usize , concat ! (
9475                "Alignment of field: " , stringify ! ( psp_audio_channelinfo )
9476                , "::" , stringify ! ( volumeright ) ));
9477    assert_eq! (unsafe {
9478                & ( * ( 0 as * const psp_audio_channelinfo ) ) . callback as *
9479                const _ as usize } , 16usize , concat ! (
9480                "Alignment of field: " , stringify ! ( psp_audio_channelinfo )
9481                , "::" , stringify ! ( callback ) ));
9482    assert_eq! (unsafe {
9483                & ( * ( 0 as * const psp_audio_channelinfo ) ) . pdata as *
9484                const _ as usize } , 24usize , concat ! (
9485                "Alignment of field: " , stringify ! ( psp_audio_channelinfo )
9486                , "::" , stringify ! ( pdata ) ));
9487}
9488impl Clone for psp_audio_channelinfo {
9489    fn clone(&self) -> Self { *self }
9490}
9491pub type pspAudioThreadfunc_t =
9492    ::core::option::Option<unsafe extern "C" fn(args: libc::c_int,
9493                                                argp: *mut libc::c_void)
9494                               -> libc::c_int>;
9495extern "C" {
9496    pub fn pspAudioInit() -> libc::c_int;
9497}
9498extern "C" {
9499    pub fn pspAudioEndPre();
9500}
9501extern "C" {
9502    pub fn pspAudioEnd();
9503}
9504extern "C" {
9505    pub fn pspAudioSetVolume(channel: libc::c_int, left: libc::c_int,
9506                             right: libc::c_int);
9507}
9508extern "C" {
9509    pub fn pspAudioChannelThreadCallback(channel: libc::c_int,
9510                                         buf: *mut libc::c_void,
9511                                         reqn: libc::c_uint);
9512}
9513extern "C" {
9514    pub fn pspAudioSetChannelCallback(channel: libc::c_int,
9515                                      callback: pspAudioCallback_t,
9516                                      pdata: *mut libc::c_void);
9517}
9518extern "C" {
9519    pub fn pspAudioOutBlocking(channel: libc::c_uint, vol1: libc::c_uint,
9520                               vol2: libc::c_uint, buf: *mut libc::c_void)
9521     -> libc::c_int;
9522}
9523extern "C" {
9524    /// Set routing mode.
9525///
9526/// @param mode The routing mode to set (0 or 1)
9527///
9528/// @return the previous routing mode, or < 0 on error
9529    pub fn sceAudioRoutingSetMode(mode: libc::c_int) -> libc::c_int;
9530}
9531extern "C" {
9532    /// Get routing mode.
9533///
9534/// @return the current routing mode.
9535    pub fn sceAudioRoutingGetMode() -> libc::c_int;
9536}
9537#[repr(C)]
9538#[derive(Debug, Copy)]
9539pub struct _pspChnnlsvContext1 {
9540    /// Cipher mode
9541    pub mode: libc::c_int,
9542    /// Context data
9543    pub buffer1: [libc::c_char; 16usize],
9544    pub buffer2: [libc::c_char; 16usize],
9545    pub unknown: libc::c_int,
9546}
9547#[test]
9548fn bindgen_test_layout__pspChnnlsvContext1() {
9549    assert_eq!(::core::mem::size_of::<_pspChnnlsvContext1>() , 40usize ,
9550               concat ! ( "Size of: " , stringify ! ( _pspChnnlsvContext1 )
9551               ));
9552    assert_eq! (::core::mem::align_of::<_pspChnnlsvContext1>() , 4usize ,
9553                concat ! (
9554                "Alignment of " , stringify ! ( _pspChnnlsvContext1 ) ));
9555    assert_eq! (unsafe {
9556                & ( * ( 0 as * const _pspChnnlsvContext1 ) ) . mode as * const
9557                _ as usize } , 0usize , concat ! (
9558                "Alignment of field: " , stringify ! ( _pspChnnlsvContext1 ) ,
9559                "::" , stringify ! ( mode ) ));
9560    assert_eq! (unsafe {
9561                & ( * ( 0 as * const _pspChnnlsvContext1 ) ) . buffer1 as *
9562                const _ as usize } , 4usize , concat ! (
9563                "Alignment of field: " , stringify ! ( _pspChnnlsvContext1 ) ,
9564                "::" , stringify ! ( buffer1 ) ));
9565    assert_eq! (unsafe {
9566                & ( * ( 0 as * const _pspChnnlsvContext1 ) ) . buffer2 as *
9567                const _ as usize } , 20usize , concat ! (
9568                "Alignment of field: " , stringify ! ( _pspChnnlsvContext1 ) ,
9569                "::" , stringify ! ( buffer2 ) ));
9570    assert_eq! (unsafe {
9571                & ( * ( 0 as * const _pspChnnlsvContext1 ) ) . unknown as *
9572                const _ as usize } , 36usize , concat ! (
9573                "Alignment of field: " , stringify ! ( _pspChnnlsvContext1 ) ,
9574                "::" , stringify ! ( unknown ) ));
9575}
9576impl Clone for _pspChnnlsvContext1 {
9577    fn clone(&self) -> Self { *self }
9578}
9579pub type pspChnnlsvContext1 = _pspChnnlsvContext1;
9580#[repr(C)]
9581#[derive(Copy)]
9582pub struct _pspChnnlsvContext2 {
9583    /// Context data
9584    pub unknown: [libc::c_char; 256usize],
9585}
9586#[test]
9587fn bindgen_test_layout__pspChnnlsvContext2() {
9588    assert_eq!(::core::mem::size_of::<_pspChnnlsvContext2>() , 256usize ,
9589               concat ! ( "Size of: " , stringify ! ( _pspChnnlsvContext2 )
9590               ));
9591    assert_eq! (::core::mem::align_of::<_pspChnnlsvContext2>() , 1usize ,
9592                concat ! (
9593                "Alignment of " , stringify ! ( _pspChnnlsvContext2 ) ));
9594    assert_eq! (unsafe {
9595                & ( * ( 0 as * const _pspChnnlsvContext2 ) ) . unknown as *
9596                const _ as usize } , 0usize , concat ! (
9597                "Alignment of field: " , stringify ! ( _pspChnnlsvContext2 ) ,
9598                "::" , stringify ! ( unknown ) ));
9599}
9600impl Clone for _pspChnnlsvContext2 {
9601    fn clone(&self) -> Self { *self }
9602}
9603pub type pspChnnlsvContext2 = _pspChnnlsvContext2;
9604extern "C" {
9605    /// Initialize context
9606///
9607/// @param ctx - Context
9608/// @param mode - Cipher mode
9609/// @return < 0 on error
9610    pub fn sceChnnlsv_E7833020(ctx: *mut pspChnnlsvContext1,
9611                               mode: libc::c_int) -> libc::c_int;
9612}
9613extern "C" {
9614    /// Process data
9615///
9616/// @param ctx - Context
9617/// @param data - Data (aligned to 0x10)
9618/// @param len - Length (aligned to 0x10)
9619/// @return < 0 on error
9620    pub fn sceChnnlsv_F21A1FCA(ctx: *mut pspChnnlsvContext1,
9621                               data: *mut libc::c_uchar, len: libc::c_int)
9622     -> libc::c_int;
9623}
9624extern "C" {
9625    /// Finalize hash
9626///
9627/// @param ctx - Context
9628/// @param hash - Hash output (aligned to 0x10, 0x10 bytes long)
9629/// @param cryptkey - Crypt key or NULL.
9630/// @return < 0 on error
9631    pub fn sceChnnlsv_C4C494F8(ctx: *mut pspChnnlsvContext1,
9632                               hash: *mut libc::c_uchar,
9633                               cryptkey: *mut libc::c_uchar) -> libc::c_int;
9634}
9635extern "C" {
9636    /// Prepare a key, and set up integrity check
9637///
9638/// @param ctx - Context
9639/// @param mode1 - Cipher mode
9640/// @param mode2 - Encrypt mode (1 = encrypting, 2 = decrypting)
9641/// @param hashkey - Key out
9642/// @param cipherkey - Key in
9643/// @return < 0 on error
9644    pub fn sceChnnlsv_ABFDFC8B(ctx: *mut pspChnnlsvContext2,
9645                               mode1: libc::c_int, mode2: libc::c_int,
9646                               hashkey: *mut libc::c_uchar,
9647                               cipherkey: *mut libc::c_uchar) -> libc::c_int;
9648}
9649extern "C" {
9650    /// Process data for integrity check
9651///
9652/// @param ctx - Context
9653/// @param data - Data (aligned to 0x10)
9654/// @param len - Length (aligned to 0x10)
9655/// @return < 0 on error
9656    pub fn sceChnnlsv_850A7FA1(ctx: *mut pspChnnlsvContext2,
9657                               data: *mut libc::c_uchar, len: libc::c_int)
9658     -> libc::c_int;
9659}
9660extern "C" {
9661    /// Check integrity
9662///
9663/// @param ctx - Context
9664/// @return < 0 on error
9665    pub fn sceChnnlsv_21BE78B4(ctx: *mut pspChnnlsvContext2) -> libc::c_int;
9666}
9667#[repr(u32)]
9668/// Enumeration for the digital controller buttons.
9669///
9670/// @note PSP_CTRL_HOME, PSP_CTRL_NOTE, PSP_CTRL_SCREEN, PSP_CTRL_VOLUP, PSP_CTRL_VOLDOWN, PSP_CTRL_DISC, PSP_CTRL_WLAN_UP, PSP_CTRL_REMOTE, PSP_CTRL_MS can only be read in kernel mode
9671#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
9672pub enum PspCtrlButtons {
9673    PSP_CTRL_SELECT = 1,
9674    PSP_CTRL_START = 8,
9675    PSP_CTRL_UP = 16,
9676    PSP_CTRL_RIGHT = 32,
9677    PSP_CTRL_DOWN = 64,
9678    PSP_CTRL_LEFT = 128,
9679    PSP_CTRL_LTRIGGER = 256,
9680    PSP_CTRL_RTRIGGER = 512,
9681    PSP_CTRL_TRIANGLE = 4096,
9682    PSP_CTRL_CIRCLE = 8192,
9683    PSP_CTRL_CROSS = 16384,
9684    PSP_CTRL_SQUARE = 32768,
9685    PSP_CTRL_HOME = 65536,
9686    PSP_CTRL_HOLD = 131072,
9687    PSP_CTRL_NOTE = 8388608,
9688    PSP_CTRL_SCREEN = 4194304,
9689    PSP_CTRL_VOLUP = 1048576,
9690    PSP_CTRL_VOLDOWN = 2097152,
9691    PSP_CTRL_WLAN_UP = 262144,
9692    PSP_CTRL_REMOTE = 524288,
9693    PSP_CTRL_DISC = 16777216,
9694    PSP_CTRL_MS = 33554432,
9695}
9696#[repr(u32)]
9697/// Controller mode.
9698#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
9699pub enum PspCtrlMode { PSP_CTRL_MODE_DIGITAL = 0, PSP_CTRL_MODE_ANALOG = 1, }
9700/// Returned controller data
9701#[repr(C)]
9702#[derive(Debug, Copy)]
9703pub struct SceCtrlData {
9704    /// The current read frame.
9705    pub TimeStamp: libc::c_uint,
9706    /// Bit mask containing zero or more of ::PspCtrlButtons.
9707    pub Buttons: libc::c_uint,
9708    /// Analogue stick, X axis.
9709    pub Lx: libc::c_uchar,
9710    /// Analogue stick, Y axis.
9711    pub Ly: libc::c_uchar,
9712    /// Reserved.
9713    pub Rsrv: [libc::c_uchar; 6usize],
9714}
9715#[test]
9716fn bindgen_test_layout_SceCtrlData() {
9717    assert_eq!(::core::mem::size_of::<SceCtrlData>() , 16usize , concat ! (
9718               "Size of: " , stringify ! ( SceCtrlData ) ));
9719    assert_eq! (::core::mem::align_of::<SceCtrlData>() , 4usize , concat ! (
9720                "Alignment of " , stringify ! ( SceCtrlData ) ));
9721    assert_eq! (unsafe {
9722                & ( * ( 0 as * const SceCtrlData ) ) . TimeStamp as * const _
9723                as usize } , 0usize , concat ! (
9724                "Alignment of field: " , stringify ! ( SceCtrlData ) , "::" ,
9725                stringify ! ( TimeStamp ) ));
9726    assert_eq! (unsafe {
9727                & ( * ( 0 as * const SceCtrlData ) ) . Buttons as * const _ as
9728                usize } , 4usize , concat ! (
9729                "Alignment of field: " , stringify ! ( SceCtrlData ) , "::" ,
9730                stringify ! ( Buttons ) ));
9731    assert_eq! (unsafe {
9732                & ( * ( 0 as * const SceCtrlData ) ) . Lx as * const _ as
9733                usize } , 8usize , concat ! (
9734                "Alignment of field: " , stringify ! ( SceCtrlData ) , "::" ,
9735                stringify ! ( Lx ) ));
9736    assert_eq! (unsafe {
9737                & ( * ( 0 as * const SceCtrlData ) ) . Ly as * const _ as
9738                usize } , 9usize , concat ! (
9739                "Alignment of field: " , stringify ! ( SceCtrlData ) , "::" ,
9740                stringify ! ( Ly ) ));
9741    assert_eq! (unsafe {
9742                & ( * ( 0 as * const SceCtrlData ) ) . Rsrv as * const _ as
9743                usize } , 10usize , concat ! (
9744                "Alignment of field: " , stringify ! ( SceCtrlData ) , "::" ,
9745                stringify ! ( Rsrv ) ));
9746}
9747impl Clone for SceCtrlData {
9748    fn clone(&self) -> Self { *self }
9749}
9750#[repr(C)]
9751#[derive(Debug, Copy)]
9752pub struct SceCtrlLatch {
9753    pub uiMake: libc::c_uint,
9754    pub uiBreak: libc::c_uint,
9755    pub uiPress: libc::c_uint,
9756    pub uiRelease: libc::c_uint,
9757}
9758#[test]
9759fn bindgen_test_layout_SceCtrlLatch() {
9760    assert_eq!(::core::mem::size_of::<SceCtrlLatch>() , 16usize , concat ! (
9761               "Size of: " , stringify ! ( SceCtrlLatch ) ));
9762    assert_eq! (::core::mem::align_of::<SceCtrlLatch>() , 4usize , concat ! (
9763                "Alignment of " , stringify ! ( SceCtrlLatch ) ));
9764    assert_eq! (unsafe {
9765                & ( * ( 0 as * const SceCtrlLatch ) ) . uiMake as * const _ as
9766                usize } , 0usize , concat ! (
9767                "Alignment of field: " , stringify ! ( SceCtrlLatch ) , "::" ,
9768                stringify ! ( uiMake ) ));
9769    assert_eq! (unsafe {
9770                & ( * ( 0 as * const SceCtrlLatch ) ) . uiBreak as * const _
9771                as usize } , 4usize , concat ! (
9772                "Alignment of field: " , stringify ! ( SceCtrlLatch ) , "::" ,
9773                stringify ! ( uiBreak ) ));
9774    assert_eq! (unsafe {
9775                & ( * ( 0 as * const SceCtrlLatch ) ) . uiPress as * const _
9776                as usize } , 8usize , concat ! (
9777                "Alignment of field: " , stringify ! ( SceCtrlLatch ) , "::" ,
9778                stringify ! ( uiPress ) ));
9779    assert_eq! (unsafe {
9780                & ( * ( 0 as * const SceCtrlLatch ) ) . uiRelease as * const _
9781                as usize } , 12usize , concat ! (
9782                "Alignment of field: " , stringify ! ( SceCtrlLatch ) , "::" ,
9783                stringify ! ( uiRelease ) ));
9784}
9785impl Clone for SceCtrlLatch {
9786    fn clone(&self) -> Self { *self }
9787}
9788extern "C" {
9789    /// Set the controller cycle setting.
9790///
9791/// @param cycle - Cycle.  Normally set to 0.
9792///
9793/// @return The previous cycle setting.
9794    pub fn sceCtrlSetSamplingCycle(cycle: libc::c_int) -> libc::c_int;
9795}
9796extern "C" {
9797    /// Get the controller current cycle setting.
9798///
9799/// @param pcycle - Return value.
9800///
9801/// @return 0.
9802    pub fn sceCtrlGetSamplingCycle(pcycle: *mut libc::c_int) -> libc::c_int;
9803}
9804extern "C" {
9805    /// Set the controller mode.
9806///
9807/// @param mode - One of ::PspCtrlMode.
9808///
9809/// @return The previous mode.
9810    pub fn sceCtrlSetSamplingMode(mode: libc::c_int) -> libc::c_int;
9811}
9812extern "C" {
9813    /// Get the current controller mode.
9814///
9815/// @param pmode - Return value.
9816///
9817/// @return 0.
9818    pub fn sceCtrlGetSamplingMode(pmode: *mut libc::c_int) -> libc::c_int;
9819}
9820extern "C" {
9821    pub fn sceCtrlPeekBufferPositive(pad_data: *mut SceCtrlData,
9822                                     count: libc::c_int) -> libc::c_int;
9823}
9824extern "C" {
9825    pub fn sceCtrlPeekBufferNegative(pad_data: *mut SceCtrlData,
9826                                     count: libc::c_int) -> libc::c_int;
9827}
9828extern "C" {
9829    /// Read buffer positive
9830///
9831/// @par Example:
9832/// @code
9833/// SceCtrlData pad;
9834///
9835/// sceCtrlSetSamplingCycle(0);
9836/// sceCtrlSetSamplingMode(1);
9837/// sceCtrlReadBufferPositive(&pad, 1);
9838/// // Do something with the read controller data
9839/// @endcode
9840///
9841/// @param pad_data - Pointer to a ::SceCtrlData structure used hold the returned pad data.
9842/// @param count - Number of ::SceCtrlData buffers to read.
9843    pub fn sceCtrlReadBufferPositive(pad_data: *mut SceCtrlData,
9844                                     count: libc::c_int) -> libc::c_int;
9845}
9846extern "C" {
9847    pub fn sceCtrlReadBufferNegative(pad_data: *mut SceCtrlData,
9848                                     count: libc::c_int) -> libc::c_int;
9849}
9850extern "C" {
9851    pub fn sceCtrlPeekLatch(latch_data: *mut SceCtrlLatch) -> libc::c_int;
9852}
9853extern "C" {
9854    pub fn sceCtrlReadLatch(latch_data: *mut SceCtrlLatch) -> libc::c_int;
9855}
9856extern "C" {
9857    /// Set analog threshold relating to the idle timer.
9858///
9859/// @param idlereset - Movement needed by the analog to reset the idle timer.
9860/// @param idleback - Movement needed by the analog to bring the PSP back from an idle state.
9861///
9862/// Set to -1 for analog to not cancel idle timer.
9863/// Set to 0 for idle timer to be cancelled even if the analog is not moved.
9864/// Set between 1 - 128 to specify the movement on either axis needed by the analog to fire the event.
9865///
9866/// @return < 0 on error.
9867    pub fn sceCtrlSetIdleCancelThreshold(idlereset: libc::c_int,
9868                                         idleback: libc::c_int)
9869     -> libc::c_int;
9870}
9871extern "C" {
9872    /// Get the idle threshold values.
9873///
9874/// @param idlerest - Movement needed by the analog to reset the idle timer.
9875/// @param idleback - Movement needed by the analog to bring the PSP back from an idle state.
9876///
9877/// @return < 0 on error.
9878    pub fn sceCtrlGetIdleCancelThreshold(idlerest: *mut libc::c_int,
9879                                         idleback: *mut libc::c_int)
9880     -> libc::c_int;
9881}
9882extern "C" {
9883    /// Set the controller button masks
9884///
9885/// @param mask - The bits to setup
9886/// @param type - The type of operation (0 clear, 1 set mask, 2 set button)
9887///
9888/// @par Example:
9889/// @code
9890/// sceCtrl_driver_7CA723DC(0xFFFF, 1);  // Mask lower 16bits
9891/// sceCtrl_driver_7CA723DC(0x10000, 2); // Always return HOME key
9892/// // Do something
9893/// sceCtrl_driver_7CA723DC(0x10000, 0); // Unset HOME key
9894/// sceCtrl_driver_7CA723DC(0xFFFF, 0);  // Unset mask
9895/// @endcode
9896    pub fn sceCtrl_driver_7CA723DC(mask: libc::c_uint, type_: libc::c_uint);
9897}
9898extern "C" {
9899    /// Get button mask mode
9900///
9901/// @param mask - The bitmask to check
9902///
9903/// @return 0 no setting, 1 set in button mask, 2 set in button set
9904    pub fn sceCtrl_driver_5E77BC8A(mask: libc::c_uint) -> libc::c_int;
9905}
9906extern "C" {
9907    /// Setup a controller callback
9908///
9909/// @param no - The number of the callback (0-3)
9910/// @param mask - The bits to check for
9911/// @param cb - The callback function (int curr_but, int last_but, void *arg)
9912/// @param arg - User defined argument passed
9913///
9914/// @return 0 on success, < 0 on error
9915    pub fn sceCtrl_driver_5C56C779(no: libc::c_int, mask: libc::c_uint,
9916                                   cb:
9917                                       ::core::option::Option<unsafe extern "C" fn(arg1:
9918                                                                                       libc::c_int,
9919                                                                                   arg2:
9920                                                                                       libc::c_int,
9921                                                                                   arg3:
9922                                                                                       *mut libc::c_void)>,
9923                                   arg: *mut libc::c_void) -> libc::c_int;
9924}
9925pub const PspDebugKbSettings_PSP_DEBUG_KB_OFFSET_X: PspDebugKbSettings =
9926    PspDebugKbSettings::PSP_DEBUG_KB_BOX_X;
9927pub const PspDebugKbSettings_PSP_DEBUG_KB_NUM_ROWS: PspDebugKbSettings =
9928    PspDebugKbSettings::PSP_DEBUG_KB_OFFSET_Y;
9929pub const PspDebugKbSettings_PSP_DEBUG_KB_COMMAND_ROW: PspDebugKbSettings =
9930    PspDebugKbSettings::PSP_DEBUG_KB_OFFSET_Y;
9931#[repr(u32)]
9932#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
9933pub enum PspDebugKbSettings {
9934    PSP_DEBUG_KB_MAXLEN = 40,
9935    PSP_DEBUG_KB_BOX_X = 6,
9936    PSP_DEBUG_KB_BOX_Y = 8,
9937    PSP_DEBUG_KB_CHAR_COLOUR = 4294967295,
9938    PSP_DEBUG_KB_BACK_COLOUR = 4278190080,
9939    PSP_DEBUG_KB_CHAR_HIGHLIGHT = 4278255360,
9940    PSP_DEBUG_KB_BACK_HIGHLIGHT = 4279242768,
9941    PSP_DEBUG_KB_OFFSET_Y = 4,
9942    PSP_DEBUG_KB_SPACING_X = 3,
9943    PSP_DEBUG_KB_SPACING_Y = 2,
9944    PSP_DEBUG_KB_NUM_CHARS = 13,
9945    PSP_DEBUG_KB_BOX_WIDTH = 51,
9946    PSP_DEBUG_KB_BOX_HEIGHT = 14,
9947    PSP_DEBUG_KB_NUM_COMMANDS = 5,
9948}
9949extern "C" {
9950    /// Switch charTable when SHIFT is pressed
9951///
9952/// @param shiftState - Pointer to an int indicating Caps Lock
9953    pub fn pspDebugKbShift(shiftState: *mut libc::c_int);
9954}
9955extern "C" {
9956    /// Draw the specified key on the keyboard.
9957///
9958/// @param row - The row of the character to print (in charTable)
9959/// @param col - The column of the character to print (in charTable)
9960/// @param highlight - 0 for plain; otherwise highlighted
9961    pub fn pspDebugKbDrawKey(row: libc::c_int, col: libc::c_int,
9962                             highlight: libc::c_int);
9963}
9964extern "C" {
9965    /// Draw the string at the top of the box
9966///
9967/// @param str - The string to print
9968    pub fn pspDebugKbDrawString(str: *mut libc::c_char);
9969}
9970extern "C" {
9971    /// Clear the area where the box resides.
9972/// Called from pspDebugKbDrawBox and pspDebugKbInit (on exit).
9973    pub fn pspDebugKbClearBox();
9974}
9975extern "C" {
9976    /// Draw the entire box on the desbug screen.
9977/// Called from shift() and doInputBox(char*)
9978    pub fn pspDebugKbDrawBox();
9979}
9980extern "C" {
9981    /// Make the text box happen
9982///
9983/// @param str - The string to edit
9984    pub fn pspDebugKbInit(str: *mut libc::c_char);
9985}
9986#[repr(u32)]
9987/// Framebuffer pixel formats.
9988#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
9989pub enum PspDisplayPixelFormats {
9990    PSP_DISPLAY_PIXEL_FORMAT_565 = 0,
9991    PSP_DISPLAY_PIXEL_FORMAT_5551 = 1,
9992    PSP_DISPLAY_PIXEL_FORMAT_4444 = 2,
9993    PSP_DISPLAY_PIXEL_FORMAT_8888 = 3,
9994}
9995#[repr(u32)]
9996#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
9997pub enum PspDisplaySetBufSync {
9998    PSP_DISPLAY_SETBUF_IMMEDIATE = 0,
9999    PSP_DISPLAY_SETBUF_NEXTFRAME = 1,
10000}
10001#[repr(u32)]
10002#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
10003pub enum PspDisplayErrorCodes {
10004    SCE_DISPLAY_ERROR_OK = 0,
10005    SCE_DISPLAY_ERROR_POINTER = 2147483907,
10006    SCE_DISPLAY_ERROR_ARGUMENT = 2147483911,
10007}
10008extern "C" {
10009    /// Set display mode
10010///
10011/// @par Example1:
10012/// @code
10013/// @endcode
10014///
10015/// @param mode - Display mode, normally 0.
10016/// @param width - Width of screen in pixels.
10017/// @param height - Height of screen in pixels.
10018///
10019/// @return ???
10020    pub fn sceDisplaySetMode(mode: libc::c_int, width: libc::c_int,
10021                             height: libc::c_int) -> libc::c_int;
10022}
10023extern "C" {
10024    /// Get display mode
10025///
10026/// @param pmode - Pointer to an integer to receive the current mode.
10027/// @param pwidth - Pointer to an integer to receive the current width.
10028/// @param pheight - Pointer to an integer to receive the current height,
10029///
10030/// @return 0 on success
10031    pub fn sceDisplayGetMode(pmode: *mut libc::c_int,
10032                             pwidth: *mut libc::c_int,
10033                             pheight: *mut libc::c_int) -> libc::c_int;
10034}
10035extern "C" {
10036    /// Display set framebuf
10037///
10038/// @param topaddr - address of start of framebuffer
10039/// @param bufferwidth - buffer width (must be power of 2)
10040/// @param pixelformat - One of ::PspDisplayPixelFormats.
10041/// @param sync - One of ::PspDisplaySetBufSync
10042///
10043/// @return 0 on success
10044    pub fn sceDisplaySetFrameBuf(topaddr: *mut libc::c_void,
10045                                 bufferwidth: libc::c_int,
10046                                 pixelformat: libc::c_int, sync: libc::c_int)
10047     -> libc::c_int;
10048}
10049extern "C" {
10050    /// Get Display Framebuffer information
10051///
10052/// @param topaddr - pointer to void* to receive address of start of framebuffer
10053/// @param bufferwidth - pointer to int to receive buffer width (must be power of 2)
10054/// @param pixelformat - pointer to int to receive one of ::PspDisplayPixelFormats.
10055/// @param sync - One of ::PspDisplaySetBufSync
10056///
10057/// @return 0 on success
10058    pub fn sceDisplayGetFrameBuf(topaddr: *mut *mut libc::c_void,
10059                                 bufferwidth: *mut libc::c_int,
10060                                 pixelformat: *mut libc::c_int,
10061                                 sync: libc::c_int) -> libc::c_int;
10062}
10063extern "C" {
10064    /// Number of vertical blank pulses up to now
10065    pub fn sceDisplayGetVcount() -> libc::c_uint;
10066}
10067extern "C" {
10068    /// Wait for vertical blank start
10069    pub fn sceDisplayWaitVblankStart() -> libc::c_int;
10070}
10071extern "C" {
10072    /// Wait for vertical blank start with callback
10073    pub fn sceDisplayWaitVblankStartCB() -> libc::c_int;
10074}
10075extern "C" {
10076    /// Wait for vertical blank
10077    pub fn sceDisplayWaitVblank() -> libc::c_int;
10078}
10079extern "C" {
10080    /// Wait for vertical blank with callback
10081    pub fn sceDisplayWaitVblankCB() -> libc::c_int;
10082}
10083extern "C" {
10084    /// Get accumlated HSYNC count
10085    pub fn sceDisplayGetAccumulatedHcount() -> libc::c_int;
10086}
10087extern "C" {
10088    /// Get current HSYNC count
10089    pub fn sceDisplayGetCurrentHcount() -> libc::c_int;
10090}
10091extern "C" {
10092    /// Get number of frames per second
10093    pub fn sceDisplayGetFramePerSec() -> f32;
10094}
10095extern "C" {
10096    /// Get whether or not frame buffer is being displayed
10097    pub fn sceDisplayIsForeground() -> libc::c_int;
10098}
10099extern "C" {
10100    /// Test whether VBLANK is active
10101    pub fn sceDisplayIsVblank() -> libc::c_int;
10102}
10103extern "C" {
10104    /// Display set framebuf
10105///
10106/// @param pri - Priority
10107/// @param topaddr - address of start of framebuffer
10108/// @param bufferwidth - buffer width (must be power of 2)
10109/// @param pixelformat - One of ::PspDisplayPixelFormats.
10110/// @param sync - One of ::PspDisplaySetBufSync
10111///
10112/// @return 0 on success
10113    pub fn sceDisplay_driver_63E22A26(pri: libc::c_int,
10114                                      topaddr: *mut libc::c_void,
10115                                      bufferwidth: libc::c_int,
10116                                      pixelformat: libc::c_int,
10117                                      sync: libc::c_int) -> libc::c_int;
10118}
10119extern "C" {
10120    /// Get Display Framebuffer information
10121///
10122/// @param pri - Priority
10123/// @param topaddr - pointer to void* to receive address of start of framebuffer
10124/// @param bufferwidth - pointer to int to receive buffer width (must be power of 2)
10125/// @param pixelformat - pointer to int to receive one of ::PspDisplayPixelFormats.
10126/// @param sync - One of ::PspDisplaySetBufSync
10127///
10128/// @return 0 on success
10129    pub fn sceDisplay_driver_5B5AEFAD(pri: libc::c_int,
10130                                      topaddr: *mut *mut libc::c_void,
10131                                      bufferwidth: *mut libc::c_int,
10132                                      pixelformat: *mut libc::c_int,
10133                                      sync: libc::c_int) -> libc::c_int;
10134}
10135extern "C" {
10136    /// Set Display brightness to a particular level
10137///
10138/// @param level - Level of the brightness. it goes from 0 (black screen) to 100 (max brightness)
10139/// @param unk1 - Unknown can be 0 or 1 (pass 0)
10140    pub fn sceDisplaySetBrightness(level: libc::c_int, unk1: libc::c_int);
10141}
10142extern "C" {
10143    /// Get current display brightness
10144///
10145/// @param level - Pointer to int to receive the current brightness level (0-100)
10146/// @param unk1 - Pointer to int, receives unknown, it's 1 or 0
10147    pub fn sceDisplayGetBrightness(level: *mut libc::c_int,
10148                                   unk1: *mut libc::c_int);
10149}
10150extern "C" {
10151    /// Register a default exception handler.
10152///
10153/// @param func - Pointer to the exception handler function
10154/// @note The exception handler function must start with a NOP
10155///
10156/// @return 0 on success, < 0 on error
10157    pub fn sceKernelRegisterDefaultExceptionHandler(func: *mut libc::c_void)
10158     -> libc::c_int;
10159}
10160extern "C" {
10161    /// Register a exception handler
10162///
10163/// @param exno - The exception number
10164/// @param func - Pointer to the exception handler function
10165///
10166/// @return 0 on success, < 0 on error
10167    pub fn sceKernelRegisterExceptionHandler(exno: libc::c_int,
10168                                             func: *mut libc::c_void)
10169     -> libc::c_int;
10170}
10171extern "C" {
10172    /// Register a exception handler with a priority
10173///
10174/// @param exno - The exception number
10175/// @param priority - The priority of the exception
10176/// @param func - Pointer to the exception handler function
10177///
10178/// @return 0 on success, < 0 on error
10179    pub fn sceKernelRegisterPriorityExceptionHandler(exno: libc::c_int,
10180                                                     priority: libc::c_int,
10181                                                     func: *mut libc::c_void)
10182     -> libc::c_int;
10183}
10184#[repr(u32)]
10185/// Enumeration for FPU rounding modes
10186#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
10187pub enum PspFpuRoundMode {
10188    PSP_FPU_RN = 0,
10189    PSP_FPU_RZ = 1,
10190    PSP_FPU_RP = 2,
10191    PSP_FPU_RM = 3,
10192}
10193#[repr(u32)]
10194/// Enumeration for FPU exceptions
10195#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
10196pub enum PspFpuExceptions {
10197    PSP_FPU_EXCEPTION_INEXACT = 1,
10198    PSP_FPU_EXCEPTION_UNDERFLOW = 2,
10199    PSP_FPU_EXCEPTION_OVERFLOW = 4,
10200    PSP_FPU_EXCEPTION_DIVBYZERO = 8,
10201    PSP_FPU_EXCEPTION_INVALIDOP = 16,
10202    PSP_FPU_EXCEPTION_UNIMPOP = 32,
10203    PSP_FPU_EXCEPTION_ALL = 63,
10204}
10205extern "C" {
10206    /// Get the current value of the control/status register
10207///
10208/// @return The value of the control/status register
10209    pub fn pspFpuGetFCR31() -> u32;
10210}
10211extern "C" {
10212    /// Set the current value of the control/status register
10213///
10214/// @param var - The value to set.
10215    pub fn pspFpuSetFCR31(var: u32);
10216}
10217extern "C" {
10218    /// Set the current round mode
10219///
10220/// @param mode - The rounding mode to set, one of ::PspFpuRoundMode
10221    pub fn pspFpuSetRoundmode(mode: PspFpuRoundMode);
10222}
10223extern "C" {
10224    /// Get the current round mode
10225///
10226/// @return The round mode, one of ::PspFpuRoundMode
10227    pub fn pspFpuGetRoundmode() -> PspFpuRoundMode;
10228}
10229extern "C" {
10230    /// Get the exception flags (set when an exception occurs but
10231/// the actual exception bit is not enabled)
10232///
10233/// @return Bitmask of the flags, zero or more of ::PspFpuExceptions
10234    pub fn pspFpuGetFlags() -> u32;
10235}
10236extern "C" {
10237    /// Clear the flags bits
10238///
10239/// @param clear - Bitmask of the bits to clear, one or more of ::PspFpuExceptions
10240    pub fn pspFpuClearFlags(clear: u32);
10241}
10242extern "C" {
10243    /// Get the exception enable flags
10244///
10245/// @return Bitmask of the flags, zero or more of ::PspFpuExceptions
10246    pub fn pspFpuGetEnable() -> u32;
10247}
10248extern "C" {
10249    /// Set the enable flags bits
10250///
10251/// @param enable - Bitmask of exceptions to enable, zero or more of ::PspFpuExceptions
10252    pub fn pspFpuSetEnable(enable: u32);
10253}
10254extern "C" {
10255    /// Get the cause bits (only useful if you installed your own exception handler)
10256///
10257/// @return Bitmask of flags, zero or more of ::PspFpuExceptions
10258    pub fn pspFpuGetCause() -> u32;
10259}
10260extern "C" {
10261    /// Clear the cause bits
10262///
10263/// @param clear - Bitmask of the bits to clear, one or more of ::PspFpuExceptions
10264///
10265    pub fn pspFpuClearCause(clear: u32);
10266}
10267extern "C" {
10268    /// Get the current value of the FS bit (if FS is 0 then an exception occurs with
10269/// denormalized values, if 1 then they are rewritten as 0.
10270///
10271/// @return The current state of the FS bit (0 or 1)
10272    pub fn pspFpuGetFS() -> u32;
10273}
10274extern "C" {
10275    /// Set the FS bit
10276///
10277/// @param fs - 0 or 1 to unset or set fs
10278    pub fn pspFpuSetFS(fs: u32);
10279}
10280extern "C" {
10281    /// Get the condition flags (8 bits)
10282///
10283/// @return The current condition flags
10284    pub fn pspFpuGetCondbits() -> u32;
10285}
10286extern "C" {
10287    /// Clear the condition bits
10288///
10289/// @param clear - Bitmask of the bits to clear
10290    pub fn pspFpuClearCondbits(clear: u32);
10291}
10292extern "C" {
10293    /// returns absolute value
10294    pub fn pspFpuAbs(f: f32) -> f32;
10295}
10296extern "C" {
10297    /// Round up
10298    pub fn pspFpuCeil(f: f32) -> libc::c_int;
10299}
10300extern "C" {
10301    /// Truncate
10302    pub fn pspFpuFloor(f: f32) -> libc::c_int;
10303}
10304extern "C" {
10305    /// select maximum value
10306    pub fn pspFpuMax(f1: f32, f2: f32) -> f32;
10307}
10308extern "C" {
10309    /// select minimum value
10310    pub fn pspFpuMin(f1: f32, f2: f32) -> f32;
10311}
10312extern "C" {
10313    /// Sign reversal
10314    pub fn pspFpuNeg(f: f32) -> f32;
10315}
10316extern "C" {
10317    /// Round to nearest
10318    pub fn pspFpuRound(f: f32) -> libc::c_int;
10319}
10320extern "C" {
10321    pub fn pspFpuRsqrt(f: f32) -> f32;
10322}
10323extern "C" {
10324    /// Square root
10325    pub fn pspFpuSqrt(f: f32) -> f32;
10326}
10327extern "C" {
10328    /// Round towards zero
10329    pub fn pspFpuTrunc(f: f32) -> libc::c_int;
10330}
10331extern "C" {
10332    
10333    pub fn pspFpuFmod(fs: f32, fd: f32) -> f32;
10334}
10335extern "C" {
10336    
10337    pub fn pspFpuFrac(f: f32) -> f32;
10338}
10339extern "C" {
10340    
10341    pub fn pspFpuReinterpretFloat(ui: u32) -> f32;
10342}
10343extern "C" {
10344    
10345    pub fn pspFpuReinterpretUint(f: f32) -> u32;
10346}
10347extern "C" {
10348    
10349    pub fn pspFpuIsEqual(f1: f32, f2: f32) -> libc::c_int;
10350}
10351extern "C" {
10352    
10353    pub fn pspFpuSignFloat(f: f32) -> f32;
10354}
10355extern "C" {
10356    
10357    pub fn pspFpuSignInt(f: f32) -> libc::c_int;
10358}
10359extern "C" {
10360    /// Positive zero
10361    pub fn pspFpuPositiveZero() -> f32;
10362}
10363extern "C" {
10364    /// Negative zero
10365    pub fn pspFpuNegativeZero() -> f32;
10366}
10367extern "C" {
10368    /// Test for zero value
10369    pub fn pspFpuIsZero(f: f32) -> libc::c_int;
10370}
10371extern "C" {
10372    /// Test for positive zero
10373    pub fn pspFpuIsPositiveZero(f: f32) -> libc::c_int;
10374}
10375extern "C" {
10376    /// Test for negative zero
10377    pub fn pspFpuIsNegativeZero(f: f32) -> libc::c_int;
10378}
10379extern "C" {
10380    /// Test for denormalized number
10381    pub fn pspFpuIsDenormal(f: f32) -> libc::c_int;
10382}
10383extern "C" {
10384    /// Test for zero or denormalized number
10385    pub fn pspFpuIsZeroOrDenormal(f: f32) -> libc::c_int;
10386}
10387extern "C" {
10388    /// Positive infinity
10389    pub fn pspFpuPositiveInf() -> f32;
10390}
10391extern "C" {
10392    /// Negative infinity
10393    pub fn pspFpuNegativeInf() -> f32;
10394}
10395extern "C" {
10396    /// Test for infinity
10397    pub fn pspFpuIsInf(f: f32) -> libc::c_int;
10398}
10399extern "C" {
10400    /// NaN (positive SNaN)
10401    pub fn pspFpuPositiveNaN() -> f32;
10402}
10403extern "C" {
10404    /// NaN (negative SNaN)
10405    pub fn pspFpuNegativeNaN() -> f32;
10406}
10407extern "C" {
10408    /// Quiet NaN (positive QNaN)
10409    pub fn pspFpuPositiveQNaN() -> f32;
10410}
10411extern "C" {
10412    /// Quiet NaN (positive QNaN)
10413    pub fn pspFpuNegativeQNaN() -> f32;
10414}
10415extern "C" {
10416    /// Signaling NaN (positive SNaN)
10417    pub fn pspFpuPositiveSNaN(uiSignal: libc::c_uint) -> f32;
10418}
10419extern "C" {
10420    /// Signaling NaN (negative SNaN)
10421    pub fn pspFpuNegativeSNaN(uiSignal: libc::c_uint) -> f32;
10422}
10423extern "C" {
10424    /// Test for NaN
10425    pub fn pspFpuIsNaN(f: f32) -> libc::c_int;
10426}
10427extern "C" {
10428    /// Test for infinity or NaN
10429    pub fn pspFpuIsInfOrNaN(f: f32) -> libc::c_int;
10430}
10431extern "C" {
10432    
10433    pub fn pspFpuNormalizePhase(f: f32) -> f32;
10434}
10435extern "C" {
10436    /// Sine
10437    pub fn pspFpuSin(x: f32) -> f32;
10438}
10439extern "C" {
10440    /// Cosine
10441    pub fn pspFpuCos(x: f32) -> f32;
10442}
10443extern "C" {
10444    /// Arc tangent
10445    pub fn pspFpuAtan(x: f32) -> f32;
10446}
10447extern "C" {
10448    /// Natural Logarithm
10449    pub fn pspFpuLog(x: f32) -> f32;
10450}
10451extern "C" {
10452    /// Exponential
10453    pub fn pspFpuExp(x: f32) -> f32;
10454}
10455extern "C" {
10456    /// ArcSin
10457    pub fn pspFpuAsin(x: f32) -> f32;
10458}
10459extern "C" {
10460    /// ArcCos
10461    pub fn pspFpuAcos(x: f32) -> f32;
10462}
10463extern "C" {
10464    /// convert float to double
10465    pub fn pspFpuFloatToDouble(a: f32) -> f64;
10466}
10467extern "C" {
10468    /// convert double to float
10469    pub fn pspFpuDoubleToFloat(a: f64) -> f32;
10470}
10471/// Stores the state of the GE.
10472#[repr(C)]
10473#[derive(Copy)]
10474pub struct PspGeContext {
10475    pub context: [libc::c_uint; 512usize],
10476}
10477#[test]
10478fn bindgen_test_layout_PspGeContext() {
10479    assert_eq!(::core::mem::size_of::<PspGeContext>() , 2048usize , concat ! (
10480               "Size of: " , stringify ! ( PspGeContext ) ));
10481    assert_eq! (::core::mem::align_of::<PspGeContext>() , 4usize , concat ! (
10482                "Alignment of " , stringify ! ( PspGeContext ) ));
10483    assert_eq! (unsafe {
10484                & ( * ( 0 as * const PspGeContext ) ) . context as * const _
10485                as usize } , 0usize , concat ! (
10486                "Alignment of field: " , stringify ! ( PspGeContext ) , "::" ,
10487                stringify ! ( context ) ));
10488}
10489impl Clone for PspGeContext {
10490    fn clone(&self) -> Self { *self }
10491}
10492/// Structure storing a stack (for CALL/RET)
10493#[repr(C)]
10494#[derive(Debug, Copy)]
10495pub struct SceGeStack {
10496    /// The stack buffer
10497    pub stack: [libc::c_uint; 8usize],
10498}
10499#[test]
10500fn bindgen_test_layout_SceGeStack() {
10501    assert_eq!(::core::mem::size_of::<SceGeStack>() , 32usize , concat ! (
10502               "Size of: " , stringify ! ( SceGeStack ) ));
10503    assert_eq! (::core::mem::align_of::<SceGeStack>() , 4usize , concat ! (
10504                "Alignment of " , stringify ! ( SceGeStack ) ));
10505    assert_eq! (unsafe {
10506                & ( * ( 0 as * const SceGeStack ) ) . stack as * const _ as
10507                usize } , 0usize , concat ! (
10508                "Alignment of field: " , stringify ! ( SceGeStack ) , "::" ,
10509                stringify ! ( stack ) ));
10510}
10511impl Clone for SceGeStack {
10512    fn clone(&self) -> Self { *self }
10513}
10514/// Typedef for a GE callback
10515pub type PspGeCallback =
10516    ::core::option::Option<unsafe extern "C" fn(id: libc::c_int,
10517                                                arg: *mut libc::c_void)>;
10518/// Structure to hold the callback data
10519#[repr(C)]
10520#[derive(Debug, Copy)]
10521pub struct PspGeCallbackData {
10522    /// GE callback for the signal interrupt
10523    pub signal_func: PspGeCallback,
10524    /// GE callback argument for signal interrupt
10525    pub signal_arg: *mut libc::c_void,
10526    /// GE callback for the finish interrupt
10527    pub finish_func: PspGeCallback,
10528    /// GE callback argument for finish interrupt
10529    pub finish_arg: *mut libc::c_void,
10530}
10531#[test]
10532fn bindgen_test_layout_PspGeCallbackData() {
10533    assert_eq!(::core::mem::size_of::<PspGeCallbackData>() , 32usize , concat
10534               ! ( "Size of: " , stringify ! ( PspGeCallbackData ) ));
10535    assert_eq! (::core::mem::align_of::<PspGeCallbackData>() , 8usize , concat
10536                ! ( "Alignment of " , stringify ! ( PspGeCallbackData ) ));
10537    assert_eq! (unsafe {
10538                & ( * ( 0 as * const PspGeCallbackData ) ) . signal_func as *
10539                const _ as usize } , 0usize , concat ! (
10540                "Alignment of field: " , stringify ! ( PspGeCallbackData ) ,
10541                "::" , stringify ! ( signal_func ) ));
10542    assert_eq! (unsafe {
10543                & ( * ( 0 as * const PspGeCallbackData ) ) . signal_arg as *
10544                const _ as usize } , 8usize , concat ! (
10545                "Alignment of field: " , stringify ! ( PspGeCallbackData ) ,
10546                "::" , stringify ! ( signal_arg ) ));
10547    assert_eq! (unsafe {
10548                & ( * ( 0 as * const PspGeCallbackData ) ) . finish_func as *
10549                const _ as usize } , 16usize , concat ! (
10550                "Alignment of field: " , stringify ! ( PspGeCallbackData ) ,
10551                "::" , stringify ! ( finish_func ) ));
10552    assert_eq! (unsafe {
10553                & ( * ( 0 as * const PspGeCallbackData ) ) . finish_arg as *
10554                const _ as usize } , 24usize , concat ! (
10555                "Alignment of field: " , stringify ! ( PspGeCallbackData ) ,
10556                "::" , stringify ! ( finish_arg ) ));
10557}
10558impl Clone for PspGeCallbackData {
10559    fn clone(&self) -> Self { *self }
10560}
10561#[repr(C)]
10562#[derive(Debug, Copy)]
10563pub struct PspGeListArgs {
10564    /// Size of the structure (16)
10565    pub size: libc::c_uint,
10566    /// Pointer to a context
10567    pub context: *mut PspGeContext,
10568    /// Number of stacks to use
10569    pub numStacks: u32,
10570    /// Pointer to the stacks (unused)
10571    pub stacks: *mut SceGeStack,
10572}
10573#[test]
10574fn bindgen_test_layout_PspGeListArgs() {
10575    assert_eq!(::core::mem::size_of::<PspGeListArgs>() , 32usize , concat ! (
10576               "Size of: " , stringify ! ( PspGeListArgs ) ));
10577    assert_eq! (::core::mem::align_of::<PspGeListArgs>() , 8usize , concat ! (
10578                "Alignment of " , stringify ! ( PspGeListArgs ) ));
10579    assert_eq! (unsafe {
10580                & ( * ( 0 as * const PspGeListArgs ) ) . size as * const _ as
10581                usize } , 0usize , concat ! (
10582                "Alignment of field: " , stringify ! ( PspGeListArgs ) , "::"
10583                , stringify ! ( size ) ));
10584    assert_eq! (unsafe {
10585                & ( * ( 0 as * const PspGeListArgs ) ) . context as * const _
10586                as usize } , 8usize , concat ! (
10587                "Alignment of field: " , stringify ! ( PspGeListArgs ) , "::"
10588                , stringify ! ( context ) ));
10589    assert_eq! (unsafe {
10590                & ( * ( 0 as * const PspGeListArgs ) ) . numStacks as * const
10591                _ as usize } , 16usize , concat ! (
10592                "Alignment of field: " , stringify ! ( PspGeListArgs ) , "::"
10593                , stringify ! ( numStacks ) ));
10594    assert_eq! (unsafe {
10595                & ( * ( 0 as * const PspGeListArgs ) ) . stacks as * const _
10596                as usize } , 24usize , concat ! (
10597                "Alignment of field: " , stringify ! ( PspGeListArgs ) , "::"
10598                , stringify ! ( stacks ) ));
10599}
10600impl Clone for PspGeListArgs {
10601    fn clone(&self) -> Self { *self }
10602}
10603/// Drawing queue interruption parameter
10604#[repr(C)]
10605#[derive(Debug, Copy)]
10606pub struct PspGeBreakParam {
10607    pub buf: [libc::c_uint; 4usize],
10608}
10609#[test]
10610fn bindgen_test_layout_PspGeBreakParam() {
10611    assert_eq!(::core::mem::size_of::<PspGeBreakParam>() , 16usize , concat !
10612               ( "Size of: " , stringify ! ( PspGeBreakParam ) ));
10613    assert_eq! (::core::mem::align_of::<PspGeBreakParam>() , 4usize , concat !
10614                ( "Alignment of " , stringify ! ( PspGeBreakParam ) ));
10615    assert_eq! (unsafe {
10616                & ( * ( 0 as * const PspGeBreakParam ) ) . buf as * const _ as
10617                usize } , 0usize , concat ! (
10618                "Alignment of field: " , stringify ! ( PspGeBreakParam ) ,
10619                "::" , stringify ! ( buf ) ));
10620}
10621impl Clone for PspGeBreakParam {
10622    fn clone(&self) -> Self { *self }
10623}
10624extern "C" {
10625    /// Get the size of VRAM.
10626///
10627/// @return The size of VRAM (in bytes).
10628    pub fn sceGeEdramGetSize() -> libc::c_uint;
10629}
10630extern "C" {
10631    /// Get the eDRAM address.
10632///
10633/// @return A pointer to the base of the eDRAM.
10634    pub fn sceGeEdramGetAddr() -> *mut libc::c_void;
10635}
10636extern "C" {
10637    /// Retrieve the current value of a GE command.
10638///
10639/// @param cmd - The GE command register to retrieve (0 to 0xFF, both included).
10640///
10641/// @return The value of the GE command, < 0 on error.
10642    pub fn sceGeGetCmd(cmd: libc::c_int) -> libc::c_uint;
10643}
10644#[repr(u32)]
10645/// GE matrix types.
10646#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
10647pub enum PspGeMatrixTypes {
10648    PSP_GE_MATRIX_BONE0 = 0,
10649    PSP_GE_MATRIX_BONE1 = 1,
10650    PSP_GE_MATRIX_BONE2 = 2,
10651    PSP_GE_MATRIX_BONE3 = 3,
10652    PSP_GE_MATRIX_BONE4 = 4,
10653    PSP_GE_MATRIX_BONE5 = 5,
10654    PSP_GE_MATRIX_BONE6 = 6,
10655    PSP_GE_MATRIX_BONE7 = 7,
10656    PSP_GE_MATRIX_WORLD = 8,
10657    PSP_GE_MATRIX_VIEW = 9,
10658    PSP_GE_MATRIX_PROJECTION = 10,
10659    PSP_GE_MATRIX_TEXGEN = 11,
10660}
10661extern "C" {
10662    /// Retrieve a matrix of the given type.
10663///
10664/// @param type - One of ::PspGeMatrixTypes.
10665/// @param matrix - Pointer to a variable to store the matrix.
10666///
10667/// @return < 0 on error.
10668    pub fn sceGeGetMtx(type_: libc::c_int, matrix: *mut libc::c_void)
10669     -> libc::c_int;
10670}
10671/// Structure storing a stack (for CALL/RET).
10672#[repr(C)]
10673#[derive(Debug, Copy)]
10674pub struct PspGeStack {
10675    /// The stack buffer.
10676    pub stack: [libc::c_uint; 8usize],
10677}
10678#[test]
10679fn bindgen_test_layout_PspGeStack() {
10680    assert_eq!(::core::mem::size_of::<PspGeStack>() , 32usize , concat ! (
10681               "Size of: " , stringify ! ( PspGeStack ) ));
10682    assert_eq! (::core::mem::align_of::<PspGeStack>() , 4usize , concat ! (
10683                "Alignment of " , stringify ! ( PspGeStack ) ));
10684    assert_eq! (unsafe {
10685                & ( * ( 0 as * const PspGeStack ) ) . stack as * const _ as
10686                usize } , 0usize , concat ! (
10687                "Alignment of field: " , stringify ! ( PspGeStack ) , "::" ,
10688                stringify ! ( stack ) ));
10689}
10690impl Clone for PspGeStack {
10691    fn clone(&self) -> Self { *self }
10692}
10693extern "C" {
10694    /// Retrieve the stack of the display list currently being executed.
10695///
10696/// @param stackId - The ID of the stack to retrieve.
10697/// @param stack - Pointer to a structure to store the stack, or NULL to not store it.
10698///
10699/// @return The number of stacks of the current display list, < 0 on error.
10700    pub fn sceGeGetStack(stackId: libc::c_int, stack: *mut PspGeStack)
10701     -> libc::c_int;
10702}
10703extern "C" {
10704    /// Save the GE's current state.
10705///
10706/// @param context - Pointer to a ::PspGeContext.
10707///
10708/// @return < 0 on error.
10709    pub fn sceGeSaveContext(context: *mut PspGeContext) -> libc::c_int;
10710}
10711extern "C" {
10712    /// Restore a previously saved GE context.
10713///
10714/// @param context - Pointer to a ::PspGeContext.
10715///
10716/// @return < 0 on error.
10717    pub fn sceGeRestoreContext(context: *const PspGeContext) -> libc::c_int;
10718}
10719extern "C" {
10720    /// Enqueue a display list at the tail of the GE display list queue.
10721///
10722/// @param list - The head of the list to queue.
10723/// @param stall - The stall address.
10724/// If NULL then no stall address is set and the list is transferred immediately.
10725/// @param cbid - ID of the callback set by calling sceGeSetCallback
10726/// @param arg - Structure containing GE context buffer address
10727///
10728/// @return The ID of the queue, < 0 on error.
10729    pub fn sceGeListEnQueue(list: *const libc::c_void,
10730                            stall: *mut libc::c_void, cbid: libc::c_int,
10731                            arg: *mut PspGeListArgs) -> libc::c_int;
10732}
10733extern "C" {
10734    /// Enqueue a display list at the head of the GE display list queue.
10735///
10736/// @param list - The head of the list to queue.
10737/// @param stall - The stall address.
10738/// If NULL then no stall address is set and the list is transferred immediately.
10739/// @param cbid - ID of the callback set by calling sceGeSetCallback
10740/// @param arg - Structure containing GE context buffer address
10741///
10742/// @return The ID of the queue, < 0 on error.
10743    pub fn sceGeListEnQueueHead(list: *const libc::c_void,
10744                                stall: *mut libc::c_void, cbid: libc::c_int,
10745                                arg: *mut PspGeListArgs) -> libc::c_int;
10746}
10747extern "C" {
10748    /// Cancel a queued or running list.
10749///
10750/// @param qid - The ID of the queue.
10751///
10752/// @return < 0 on error.
10753    pub fn sceGeListDeQueue(qid: libc::c_int) -> libc::c_int;
10754}
10755extern "C" {
10756    /// Update the stall address for the specified queue.
10757///
10758/// @param qid - The ID of the queue.
10759/// @param stall - The new stall address.
10760///
10761/// @return < 0 on error
10762    pub fn sceGeListUpdateStallAddr(qid: libc::c_int,
10763                                    stall: *mut libc::c_void) -> libc::c_int;
10764}
10765#[repr(u32)]
10766/// List status for ::sceGeListSync() and ::sceGeDrawSync().
10767#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
10768pub enum PspGeListState {
10769    PSP_GE_LIST_DONE = 0,
10770    PSP_GE_LIST_QUEUED = 1,
10771    PSP_GE_LIST_DRAWING_DONE = 2,
10772    PSP_GE_LIST_STALL_REACHED = 3,
10773    PSP_GE_LIST_CANCEL_DONE = 4,
10774}
10775extern "C" {
10776    /// Wait for syncronisation of a list.
10777///
10778/// @param qid - The queue ID of the list to sync.
10779/// @param syncType - 0 if you want to wait for the list to be completed, or 1 if you just want to peek the actual state.
10780///
10781/// @return The specified queue status, one of ::PspGeListState.
10782    pub fn sceGeListSync(qid: libc::c_int, syncType: libc::c_int)
10783     -> libc::c_int;
10784}
10785extern "C" {
10786    /// Wait for drawing to complete.
10787///
10788/// @param syncType - 0 if you want to wait for the drawing to be completed, or 1 if you just want to peek the state of the display list currently being executed.
10789///
10790/// @return The current queue status, one of ::PspGeListState.
10791    pub fn sceGeDrawSync(syncType: libc::c_int) -> libc::c_int;
10792}
10793extern "C" {
10794    /// Register callback handlers for the the GE.
10795///
10796/// @param cb - Configured callback data structure.
10797///
10798/// @return The callback ID, < 0 on error.
10799    pub fn sceGeSetCallback(cb: *mut PspGeCallbackData) -> libc::c_int;
10800}
10801extern "C" {
10802    /// Unregister the callback handlers.
10803///
10804/// @param cbid - The ID of the callbacks, returned by sceGeSetCallback().
10805///
10806/// @return < 0 on error
10807    pub fn sceGeUnsetCallback(cbid: libc::c_int) -> libc::c_int;
10808}
10809extern "C" {
10810    /// Interrupt drawing queue.
10811///
10812/// @param mode - If set to 1, reset all the queues.
10813/// @param pParam - Unused (just K1-checked).
10814///
10815/// @return The stopped queue ID if mode isn't set to 0, otherwise 0, and < 0 on error.
10816    pub fn sceGeBreak(mode: libc::c_int, pParam: *mut PspGeBreakParam)
10817     -> libc::c_int;
10818}
10819extern "C" {
10820    /// Restart drawing queue.
10821///
10822/// @return < 0 on error.
10823    pub fn sceGeContinue() -> libc::c_int;
10824}
10825extern "C" {
10826    /// Set the eDRAM address translation mode.
10827///
10828/// @param width - 0 to not set the translation width, otherwise 512, 1024, 2048 or 4096.
10829///
10830/// @return The previous width if it was set, otherwise 0, < 0 on error.
10831    pub fn sceGeEdramSetAddrTranslation(width: libc::c_int) -> libc::c_int;
10832}
10833pub type GuSwapBuffersCallback =
10834    ::core::option::Option<unsafe extern "C" fn(display:
10835                                                    *mut *mut libc::c_void,
10836                                                render:
10837                                                    *mut *mut libc::c_void)>;
10838extern "C" {
10839    /// Set depth buffer parameters
10840///
10841/// @param zbp - VRAM pointer where the depthbuffer should start
10842/// @param zbw - The width of the depth-buffer (block-aligned)
10843///
10844    pub fn sceGuDepthBuffer(zbp: *mut libc::c_void, zbw: libc::c_int);
10845}
10846extern "C" {
10847    /// Set display buffer parameters
10848///
10849/// @par Example: Setup a standard 16-bit display buffer
10850/// @code
10851/// sceGuDispBuffer(480,272,(void*)512*272*2,512); // 480*272, skipping the draw buffer located at address 0
10852/// @endcode
10853///
10854/// @param width - Width of the display buffer in pixels
10855/// @param height - Width of the display buffer in pixels
10856/// @param dispbp - VRAM pointer to where the display-buffer starts
10857/// @param dispbw - Display buffer width (block aligned)
10858///
10859    pub fn sceGuDispBuffer(width: libc::c_int, height: libc::c_int,
10860                           dispbp: *mut libc::c_void, dispbw: libc::c_int);
10861}
10862extern "C" {
10863    /// Set draw buffer parameters (and store in context for buffer-swap)
10864///
10865/// Available pixel formats are:
10866/// - GU_PSM_5650
10867/// - GU_PSM_5551
10868/// - GU_PSM_4444
10869/// - GU_PSM_8888
10870///
10871/// @par Example: Setup a standard 16-bit draw buffer
10872/// @code
10873/// sceGuDrawBuffer(GU_PSM_5551,(void*)0,512);
10874/// @endcode
10875///
10876/// @param psm - Pixel format to use for rendering (and display)
10877/// @param fbp - VRAM pointer to where the draw buffer starts
10878/// @param fbw - Frame buffer width (block aligned)
10879    pub fn sceGuDrawBuffer(psm: libc::c_int, fbp: *mut libc::c_void,
10880                           fbw: libc::c_int);
10881}
10882extern "C" {
10883    /// Set draw buffer directly, not storing parameters in the context
10884///
10885/// @param psm - Pixel format to use for rendering
10886/// @param fbp - VRAM pointer to where the draw buffer starts
10887/// @param fbw - Frame buffer width (block aligned)
10888    pub fn sceGuDrawBufferList(psm: libc::c_int, fbp: *mut libc::c_void,
10889                               fbw: libc::c_int);
10890}
10891extern "C" {
10892    /// Turn display on or off
10893///
10894/// Available states are:
10895/// - GU_TRUE (1) - Turns display on
10896/// - GU_FALSE (0) - Turns display off
10897///
10898/// @param state - Turn display on or off
10899/// @return State of the display prior to this call
10900    pub fn sceGuDisplay(state: libc::c_int) -> libc::c_int;
10901}
10902extern "C" {
10903    /// Select which depth-test function to use
10904///
10905/// Valid choices for the depth-test are:
10906/// - GU_NEVER - No pixels pass the depth-test
10907/// - GU_ALWAYS - All pixels pass the depth-test
10908/// - GU_EQUAL - Pixels that match the depth-test pass
10909/// - GU_NOTEQUAL - Pixels that doesn't match the depth-test pass
10910/// - GU_LESS - Pixels that are less in depth passes
10911/// - GU_LEQUAL - Pixels that are less or equal in depth passes
10912/// - GU_GREATER - Pixels that are greater in depth passes
10913/// - GU_GEQUAL - Pixels that are greater or equal passes
10914///
10915/// @param function - Depth test function to use
10916    pub fn sceGuDepthFunc(function: libc::c_int);
10917}
10918extern "C" {
10919    /// Mask depth buffer writes
10920///
10921/// @param mask - GU_TRUE(1) to disable Z writes, GU_FALSE(0) to enable
10922    pub fn sceGuDepthMask(mask: libc::c_int);
10923}
10924extern "C" {
10925    pub fn sceGuDepthOffset(offset: libc::c_uint);
10926}
10927extern "C" {
10928    /// Set which range to use for depth calculations.
10929///
10930/// @note The depth buffer is inversed, and takes values from 65535 to 0.
10931///
10932/// Example: Use the entire depth-range for calculations:
10933/// @code
10934/// sceGuDepthRange(65535,0);
10935/// @endcode
10936///
10937/// @param near - Value to use for the near plane
10938/// @param far - Value to use for the far plane
10939    pub fn sceGuDepthRange(near: libc::c_int, far: libc::c_int);
10940}
10941extern "C" {
10942    pub fn sceGuFog(near: f32, far: f32, color: libc::c_uint);
10943}
10944extern "C" {
10945    /// Initalize the GU system
10946///
10947/// This function MUST be called as the first function, otherwise state is undetermined.
10948    pub fn sceGuInit();
10949}
10950extern "C" {
10951    /// Shutdown the GU system
10952///
10953/// Called when GU is no longer needed
10954    pub fn sceGuTerm();
10955}
10956extern "C" {
10957    pub fn sceGuBreak(a0: libc::c_int);
10958}
10959extern "C" {
10960    pub fn sceGuContinue();
10961}
10962extern "C" {
10963    /// Setup signal handler
10964///
10965/// Available signals are:
10966/// - GU_CALLBACK_SIGNAL - Called when sceGuSignal is used
10967/// - GU_CALLBACK_FINISH - Called when display list is finished
10968///
10969/// @param signal - Signal index to install a handler for
10970/// @param callback - Callback to call when signal index is triggered
10971/// @return The old callback handler
10972    pub fn sceGuSetCallback(signal: libc::c_int,
10973                            callback:
10974                                ::core::option::Option<unsafe extern "C" fn(arg1:
10975                                                                                libc::c_int)>)
10976     -> *mut libc::c_void;
10977}
10978extern "C" {
10979    /// Trigger signal to call code from the command stream
10980///
10981/// Available behaviors are:
10982/// - GU_BEHAVIOR_SUSPEND - Stops display list execution until callback function finished
10983/// - GU_BEHAVIOR_CONTINUE - Do not stop display list execution during callback
10984///
10985/// @param signal - Signal to trigger
10986/// @param behavior - Behavior type
10987    pub fn sceGuSignal(signal: libc::c_int, behavior: libc::c_int);
10988}
10989extern "C" {
10990    /// Send raw float-command to the GE
10991///
10992/// The argument is converted into a 24-bit float before transfer.
10993///
10994/// @param cmd - Which command to send
10995/// @param argument - Argument to pass along
10996    pub fn sceGuSendCommandf(cmd: libc::c_int, argument: f32);
10997}
10998extern "C" {
10999    /// Send raw command to the GE
11000///
11001/// Only the 24 lower bits of the argument is passed along.
11002///
11003/// @param cmd - Which command to send
11004/// @param argument - Argument to pass along
11005    pub fn sceGuSendCommandi(cmd: libc::c_int, argument: libc::c_int);
11006}
11007extern "C" {
11008    /// Allocate memory on the current display list for temporary storage
11009///
11010/// @note This function is NOT for permanent memory allocation, the
11011/// memory will be invalid as soon as you start filling the same display
11012/// list again.
11013///
11014/// @param size - How much memory to allocate
11015/// @return Memory-block ready for use
11016    pub fn sceGuGetMemory(size: libc::c_int) -> *mut libc::c_void;
11017}
11018extern "C" {
11019    /// Start filling a new display-context
11020///
11021/// Contexts available are:
11022/// - GU_DIRECT - Rendering is performed as list is filled
11023/// - GU_CALL - List is setup to be called from the main list
11024/// - GU_SEND - List is buffered for a later call to sceGuSendList()
11025///
11026/// The previous context-type is stored so that it can be restored at sceGuFinish().
11027///
11028/// @param cid - Context Type
11029/// @param list - Pointer to display-list (16 byte aligned)
11030    pub fn sceGuStart(cid: libc::c_int, list: *mut libc::c_void);
11031}
11032extern "C" {
11033    /// Finish current display list and go back to the parent context
11034///
11035/// If the context is GU_DIRECT, the stall-address is updated so that the entire list will
11036/// execute. Otherwise, only the terminating action is written to the list, depending on
11037/// context-type.
11038///
11039/// The finish-callback will get a zero as argument when using this function.
11040///
11041/// This also restores control back to whatever context that was active prior to this call.
11042///
11043/// @return Size of finished display list
11044    pub fn sceGuFinish() -> libc::c_int;
11045}
11046extern "C" {
11047    /// Finish current display list and go back to the parent context, sending argument id for
11048/// the finish callback.
11049///
11050/// If the context is GU_DIRECT, the stall-address is updated so that the entire list will
11051/// execute. Otherwise, only the terminating action is written to the list, depending on
11052/// context-type.
11053///
11054/// @param id - Finish callback id (16-bit)
11055/// @return Size of finished display list
11056    pub fn sceGuFinishId(id: libc::c_uint) -> libc::c_int;
11057}
11058extern "C" {
11059    /// Call previously generated display-list
11060///
11061/// @param list - Display list to call
11062    pub fn sceGuCallList(list: *const libc::c_void);
11063}
11064extern "C" {
11065    /// Set wether to use stack-based calls or signals to handle execution of called lists.
11066///
11067/// @param mode - GU_TRUE(1) to enable signals, GU_FALSE(0) to disable signals and use
11068/// normal calls instead.
11069    pub fn sceGuCallMode(mode: libc::c_int);
11070}
11071extern "C" {
11072    /// Check how large the current display-list is
11073///
11074/// @return The size of the current display list
11075    pub fn sceGuCheckList() -> libc::c_int;
11076}
11077extern "C" {
11078    /// Send a list to the GE directly
11079///
11080/// Available modes are:
11081/// - GU_TAIL - Place list last in the queue, so it executes in-order
11082/// - GU_HEAD - Place list first in queue so that it executes as soon as possible
11083///
11084/// @param mode - Whether to place the list first or last in queue
11085/// @param list - List to send
11086/// @param context - Temporary storage for the GE context
11087    pub fn sceGuSendList(mode: libc::c_int, list: *const libc::c_void,
11088                         context: *mut PspGeContext);
11089}
11090extern "C" {
11091    /// Swap display and draw buffer
11092///
11093/// @return Pointer to the new drawbuffer
11094    pub fn sceGuSwapBuffers() -> *mut libc::c_void;
11095}
11096extern "C" {
11097    /// Wait until display list has finished executing
11098///
11099/// @par Example: Wait for the currently executing display list
11100/// @code
11101/// sceGuSync(0,0);
11102/// @endcode
11103///
11104/// Available what are:
11105/// - GU_SYNC_WHAT_DONE
11106/// - GU_SYNC_WHAT_QUEUED
11107/// - GU_SYNC_WHAT_DRAW
11108/// - GU_SYNC_WHAT_STALL
11109/// - GU_SYNC_WHAT_CANCEL
11110///
11111/// Available mode are:
11112/// - GU_SYNC_FINISH - Wait until the last sceGuFinish command is reached
11113/// - GU_SYNC_SIGNAL - Wait until the last (?) signal is executed
11114/// - GU_SYNC_DONE - Wait until all commands currently in list are executed
11115/// - GU_SYNC_LIST - Wait for the currently executed display list (GU_DIRECT)
11116/// - GU_SYNC_SEND - Wait for the last send list
11117///
11118/// @param mode - What to wait for
11119/// @param what - What to sync to
11120/// @return Unknown at this time
11121    pub fn sceGuSync(mode: libc::c_int, what: libc::c_int) -> libc::c_int;
11122}
11123extern "C" {
11124    /// Draw array of vertices forming primitives
11125///
11126/// Available primitive-types are:
11127/// - GU_POINTS - Single pixel points (1 vertex per primitive)
11128/// - GU_LINES - Single pixel lines (2 vertices per primitive)
11129/// - GU_LINE_STRIP - Single pixel line-strip (2 vertices for the first primitive, 1 for every following)
11130/// - GU_TRIANGLES - Filled triangles (3 vertices per primitive)
11131/// - GU_TRIANGLE_STRIP - Filled triangles-strip (3 vertices for the first primitive, 1 for every following)
11132/// - GU_TRIANGLE_FAN - Filled triangle-fan (3 vertices for the first primitive, 1 for every following)
11133/// - GU_SPRITES - Filled blocks (2 vertices per primitive)
11134///
11135/// The vertex-type decides how the vertices align and what kind of information they contain.
11136/// The following flags are ORed together to compose the final vertex format:
11137/// - GU_TEXTURE_8BIT - 8-bit texture coordinates
11138/// - GU_TEXTURE_16BIT - 16-bit texture coordinates
11139/// - GU_TEXTURE_32BITF - 32-bit texture coordinates (float)
11140///
11141/// - GU_COLOR_5650 - 16-bit color (R5G6B5A0)
11142/// - GU_COLOR_5551 - 16-bit color (R5G5B5A1)
11143/// - GU_COLOR_4444 - 16-bit color (R4G4B4A4)
11144/// - GU_COLOR_8888 - 32-bit color (R8G8B8A8)
11145///
11146/// - GU_NORMAL_8BIT - 8-bit normals
11147/// - GU_NORMAL_16BIT - 16-bit normals
11148/// - GU_NORMAL_32BITF - 32-bit normals (float)
11149///
11150/// - GU_VERTEX_8BIT - 8-bit vertex position
11151/// - GU_VERTEX_16BIT - 16-bit vertex position
11152/// - GU_VERTEX_32BITF - 32-bit vertex position (float)
11153///
11154/// - GU_WEIGHT_8BIT - 8-bit weights
11155/// - GU_WEIGHT_16BIT - 16-bit weights
11156/// - GU_WEIGHT_32BITF - 32-bit weights (float)
11157///
11158/// - GU_INDEX_8BIT - 8-bit vertex index
11159/// - GU_INDEX_16BIT - 16-bit vertex index
11160///
11161/// - GU_WEIGHTS(n) - Number of weights (1-8)
11162/// - GU_VERTICES(n) - Number of vertices (1-8)
11163///
11164/// - GU_TRANSFORM_2D - Coordinate is passed directly to the rasterizer
11165/// - GU_TRANSFORM_3D - Coordinate is transformed before passed to rasterizer
11166///
11167/// @note Every vertex must align to 32 bits, which means that you HAVE to pad if it does not add up!
11168///
11169/// Vertex order:
11170/// [for vertices(1-8)]
11171/// [weights (0-8)]
11172/// [texture uv]
11173/// [color]
11174/// [normal]
11175/// [vertex]
11176/// [/for]
11177///
11178/// @par Example: Render 400 triangles, with floating-point texture coordinates, and floating-point position, no indices
11179/// @code
11180/// sceGuDrawArray(GU_TRIANGLES,GU_TEXTURE_32BITF|GU_VERTEX_32BITF,400*3,0,vertices);
11181/// @endcode
11182///
11183/// @param prim - What kind of primitives to render
11184/// @param vtype - Vertex type to process
11185/// @param count - How many vertices to process
11186/// @param indices - Optional pointer to an index-list
11187/// @param vertices - Pointer to a vertex-list
11188    pub fn sceGuDrawArray(prim: libc::c_int, vtype: libc::c_int,
11189                          count: libc::c_int, indices: *const libc::c_void,
11190                          vertices: *const libc::c_void);
11191}
11192extern "C" {
11193    /// Begin conditional rendering of object
11194///
11195/// If no vertices passed into this function are inside the scissor region, it will skip rendering
11196/// the object. There can be up to 32 levels of conditional testing, and all levels HAVE to
11197/// be terminated by sceGuEndObject().
11198///
11199/// @par Example: test a boundingbox against the frustum, and if visible, render object
11200/// @code
11201/// sceGuBeginObject(GU_VERTEX_32BITF,8,0,boundingBox);
11202/// sceGuDrawArray(GU_TRIANGLES,GU_TEXTURE_32BITF|GU_VERTEX_32BITF,vertexCount,0,vertices);
11203/// sceGuEndObject();
11204/// @endcode
11205///
11206/// @param vtype - Vertex type to process
11207/// @param count - Number of vertices to test
11208/// @param indices - Optional list to an index-list
11209/// @param vertices - Pointer to a vertex-list
11210    pub fn sceGuBeginObject(vtype: libc::c_int, count: libc::c_int,
11211                            indices: *const libc::c_void,
11212                            vertices: *const libc::c_void);
11213}
11214extern "C" {
11215    /// End conditional rendering of object
11216    pub fn sceGuEndObject();
11217}
11218extern "C" {
11219    /// Enable or disable GE state
11220///
11221/// Look at sceGuEnable() for a list of states
11222///
11223/// @param state - Which state to change
11224/// @param status - Wether to enable or disable the state
11225    pub fn sceGuSetStatus(state: libc::c_int, status: libc::c_int);
11226}
11227extern "C" {
11228    /// Get if state is currently enabled or disabled
11229///
11230/// Look at sceGuEnable() for a list of states
11231///
11232/// @param state - Which state to query about
11233/// @return Wether state is enabled or not
11234    pub fn sceGuGetStatus(state: libc::c_int) -> libc::c_int;
11235}
11236extern "C" {
11237    /// Set the status on all 22 available states
11238///
11239/// Look at sceGuEnable() for a list of states
11240///
11241/// @param status - Bit-mask (0-21) containing the status of all 22 states
11242    pub fn sceGuSetAllStatus(status: libc::c_int);
11243}
11244extern "C" {
11245    /// Query status on all 22 available states
11246///
11247/// Look at sceGuEnable() for a list of states
11248///
11249/// @return Status of all 22 states as a bitmask (0-21)
11250    pub fn sceGuGetAllStatus() -> libc::c_int;
11251}
11252extern "C" {
11253    /// Enable GE state
11254///
11255/// The currently available states are:
11256/// - GU_ALPHA_TEST
11257/// - GU_DEPTH_TEST
11258/// - GU_SCISSOR_TEST
11259/// - GU_BLEND
11260/// - GU_CULL_FACE
11261/// - GU_DITHER
11262/// - GU_CLIP_PLANES
11263/// - GU_TEXTURE_2D
11264/// - GU_LIGHTING
11265/// - GU_LIGHT0
11266/// - GU_LIGHT1
11267/// - GU_LIGHT2
11268/// - GU_LIGHT3
11269/// - GU_COLOR_LOGIC_OP
11270///
11271/// @param state - Which state to enable
11272    pub fn sceGuEnable(state: libc::c_int);
11273}
11274extern "C" {
11275    /// Disable GE state
11276///
11277/// Look at sceGuEnable() for a list of states
11278///
11279/// @param state - Which state to disable
11280    pub fn sceGuDisable(state: libc::c_int);
11281}
11282extern "C" {
11283    /// Set light parameters
11284///
11285/// Available light types are:
11286/// - GU_DIRECTIONAL - Directional light
11287/// - GU_POINTLIGHT - Single point of light
11288/// - GU_SPOTLIGHT - Point-light with a cone
11289///
11290/// Available light components are:
11291/// - GU_AMBIENT_AND_DIFFUSE
11292/// - GU_DIFFUSE_AND_SPECULAR
11293/// - GU_UNKNOWN_LIGHT_COMPONENT
11294///
11295/// @param light - Light index
11296/// @param type - Light type
11297/// @param components - Light components
11298/// @param position - Light position
11299    pub fn sceGuLight(light: libc::c_int, type_: libc::c_int,
11300                      components: libc::c_int,
11301                      position: *const ScePspFVector3);
11302}
11303extern "C" {
11304    /// Set light attenuation
11305///
11306/// @param light - Light index
11307/// @param atten0 - Constant attenuation factor
11308/// @param atten1 - Linear attenuation factor
11309/// @param atten2 - Quadratic attenuation factor
11310    pub fn sceGuLightAtt(light: libc::c_int, atten0: f32, atten1: f32,
11311                         atten2: f32);
11312}
11313extern "C" {
11314    /// Set light color
11315///
11316/// Available light components are:
11317/// - GU_AMBIENT
11318/// - GU_DIFFUSE
11319/// - GU_SPECULAR
11320/// - GU_AMBIENT_AND_DIFFUSE
11321/// - GU_DIFFUSE_AND_SPECULAR
11322///
11323/// @param light - Light index
11324/// @param component - Which component to set
11325/// @param color - Which color to use
11326    pub fn sceGuLightColor(light: libc::c_int, component: libc::c_int,
11327                           color: libc::c_uint);
11328}
11329extern "C" {
11330    /// Set light mode
11331///
11332/// Available light modes are:
11333/// - GU_SINGLE_COLOR
11334/// - GU_SEPARATE_SPECULAR_COLOR
11335///
11336/// Separate specular colors are used to interpolate the specular component
11337/// independently, so that it can be added to the fragment after the texture color.
11338///
11339/// @param mode - Light mode to use
11340    pub fn sceGuLightMode(mode: libc::c_int);
11341}
11342extern "C" {
11343    /// Set spotlight parameters
11344///
11345/// @param light - Light index
11346/// @param direction - Spotlight direction
11347/// @param exponent - Spotlight exponent
11348/// @param cutoff - Spotlight cutoff angle (in radians)
11349    pub fn sceGuLightSpot(light: libc::c_int,
11350                          direction: *const ScePspFVector3, exponent: f32,
11351                          cutoff: f32);
11352}
11353extern "C" {
11354    /// Clear current drawbuffer
11355///
11356/// Available clear-flags are (OR them together to get final clear-mode):
11357/// - GU_COLOR_BUFFER_BIT - Clears the color-buffer
11358/// - GU_STENCIL_BUFFER_BIT - Clears the stencil-buffer
11359/// - GU_DEPTH_BUFFER_BIT - Clears the depth-buffer
11360///
11361/// @param flags - Which part of the buffer to clear
11362    pub fn sceGuClear(flags: libc::c_int);
11363}
11364extern "C" {
11365    /// Set the current clear-color
11366///
11367/// @param color - Color to clear with
11368    pub fn sceGuClearColor(color: libc::c_uint);
11369}
11370extern "C" {
11371    /// Set the current clear-depth
11372///
11373/// @param depth - Set which depth to clear with (0x0000-0xffff)
11374    pub fn sceGuClearDepth(depth: libc::c_uint);
11375}
11376extern "C" {
11377    /// Set the current stencil clear value
11378///
11379/// @param stencil - Set which stencil value to clear with (0-255)
11380///
11381    pub fn sceGuClearStencil(stencil: libc::c_uint);
11382}
11383extern "C" {
11384    /// Set mask for which bits of the pixels to write
11385///
11386/// @param mask - Which bits to filter against writes
11387///
11388    pub fn sceGuPixelMask(mask: libc::c_uint);
11389}
11390extern "C" {
11391    /// Set current primitive color
11392///
11393/// @param color - Which color to use (overriden by vertex-colors)
11394    pub fn sceGuColor(color: libc::c_uint);
11395}
11396extern "C" {
11397    /// Set the color test function
11398///
11399/// The color test is only performed while GU_COLOR_TEST is enabled.
11400///
11401/// Available functions are:
11402/// - GU_NEVER
11403/// - GU_ALWAYS
11404/// - GU_EQUAL
11405/// - GU_NOTEQUAL
11406///
11407/// @par Example: Reject any pixel that does not have 0 as the blue channel
11408/// @code
11409/// sceGuColorFunc(GU_EQUAL,0,0xff0000);
11410/// @endcode
11411///
11412/// @param func - Color test function
11413/// @param color - Color to test against
11414/// @param mask - Mask ANDed against both source and destination when testing
11415    pub fn sceGuColorFunc(func: libc::c_int, color: libc::c_uint,
11416                          mask: libc::c_uint);
11417}
11418extern "C" {
11419    /// Set which color components that the material will receive
11420///
11421/// The components are ORed together from the following values:
11422/// - GU_AMBIENT
11423/// - GU_DIFFUSE
11424/// - GU_SPECULAR
11425///
11426/// @param components - Which components to receive
11427    pub fn sceGuColorMaterial(components: libc::c_int);
11428}
11429extern "C" {
11430    /// Set the alpha test parameters
11431///
11432/// Available comparison functions are:
11433/// - GU_NEVER
11434/// - GU_ALWAYS
11435/// - GU_EQUAL
11436/// - GU_NOTEQUAL
11437/// - GU_LESS
11438/// - GU_LEQUAL
11439/// - GU_GREATER
11440/// - GU_GEQUAL
11441///
11442/// @param func - Specifies the alpha comparison function.
11443/// @param value - Specifies the reference value that incoming alpha values are compared to.
11444/// @param mask - Specifies the mask that both values are ANDed with before comparison.
11445    pub fn sceGuAlphaFunc(func: libc::c_int, value: libc::c_int,
11446                          mask: libc::c_int);
11447}
11448extern "C" {
11449    pub fn sceGuAmbient(color: libc::c_uint);
11450}
11451extern "C" {
11452    pub fn sceGuAmbientColor(color: libc::c_uint);
11453}
11454extern "C" {
11455    /// Set the blending-mode
11456///
11457/// Keys for the blending operations:
11458/// - Cs - Source color
11459/// - Cd - Destination color
11460/// - Bs - Blend function for source fragment
11461/// - Bd - Blend function for destination fragment
11462///
11463/// Available blending-operations are:
11464/// - GU_ADD - (Cs*Bs) + (Cd*Bd)
11465/// - GU_SUBTRACT - (Cs*Bs) - (Cd*Bd)
11466/// - GU_REVERSE_SUBTRACT - (Cd*Bd) - (Cs*Bs)
11467/// - GU_MIN - Cs < Cd ? Cs : Cd
11468/// - GU_MAX - Cs < Cd ? Cd : Cs
11469/// - GU_ABS - |Cs-Cd|
11470///
11471/// Available blending-functions are:
11472/// - GU_SRC_COLOR
11473/// - GU_ONE_MINUS_SRC_COLOR
11474/// - GU_SRC_ALPHA
11475/// - GU_ONE_MINUS_SRC_ALPHA
11476/// - GU_DST_ALPHA
11477/// - GU_ONE_MINUS_DST_ALPHA
11478/// - GU_DST_COLOR
11479/// - GU_ONE_MINUS_DST_COLOR
11480/// - GU_FIX
11481///
11482/// @param op - Blending Operation
11483/// @param src - Blending function for source operand
11484/// @param dest - Blending function for dest operand
11485/// @param srcfix - Fix value for GU_FIX (source operand)
11486/// @param destfix - Fix value for GU_FIX (dest operand)
11487    pub fn sceGuBlendFunc(op: libc::c_int, src: libc::c_int,
11488                          dest: libc::c_int, srcfix: libc::c_uint,
11489                          destfix: libc::c_uint);
11490}
11491extern "C" {
11492    pub fn sceGuMaterial(mode: libc::c_int, color: libc::c_int);
11493}
11494extern "C" {
11495    
11496    pub fn sceGuModelColor(emissive: libc::c_uint, ambient: libc::c_uint,
11497                           diffuse: libc::c_uint, specular: libc::c_uint);
11498}
11499extern "C" {
11500    /// Set stencil function and reference value for stencil testing
11501///
11502/// Available functions are:
11503/// - GU_NEVER
11504/// - GU_ALWAYS
11505/// - GU_EQUAL
11506/// - GU_NOTEQUAL
11507/// - GU_LESS
11508/// - GU_LEQUAL
11509/// - GU_GREATER
11510/// - GU_GEQUAL
11511///
11512/// @param func - Test function
11513/// @param ref - The reference value for the stencil test
11514/// @param mask - Mask that is ANDed with both the reference value and stored stencil value when the test is done
11515    pub fn sceGuStencilFunc(func: libc::c_int, ref_: libc::c_int,
11516                            mask: libc::c_int);
11517}
11518extern "C" {
11519    /// Set the stencil test actions
11520///
11521/// Available actions are:
11522/// - GU_KEEP - Keeps the current value
11523/// - GU_ZERO - Sets the stencil buffer value to zero
11524/// - GU_REPLACE - Sets the stencil buffer value to ref, as specified by sceGuStencilFunc()
11525/// - GU_INCR - Increments the current stencil buffer value
11526/// - GU_DECR - Decrease the current stencil buffer value
11527/// - GU_INVERT - Bitwise invert the current stencil buffer value
11528///
11529/// As stencil buffer shares memory with framebuffer alpha, resolution of the buffer
11530/// is directly in relation.
11531///
11532/// @param fail - The action to take when the stencil test fails
11533/// @param zfail - The action to take when stencil test passes, but the depth test fails
11534/// @param zpass - The action to take when both stencil test and depth test passes
11535    pub fn sceGuStencilOp(fail: libc::c_int, zfail: libc::c_int,
11536                          zpass: libc::c_int);
11537}
11538extern "C" {
11539    /// Set the specular power for the material
11540///
11541/// @param power - Specular power
11542///
11543    pub fn sceGuSpecular(power: f32);
11544}
11545extern "C" {
11546    /// Set the current face-order (for culling)
11547///
11548/// This only has effect when culling is enabled (GU_CULL_FACE)
11549///
11550/// Culling order can be:
11551/// - GU_CW - Clockwise primitives are not culled
11552/// - GU_CCW - Counter-clockwise are not culled
11553///
11554/// @param order - Which order to use
11555    pub fn sceGuFrontFace(order: libc::c_int);
11556}
11557extern "C" {
11558    /// Set color logical operation
11559///
11560/// Available operations are:
11561/// - GU_CLEAR
11562/// - GU_AND
11563/// - GU_AND_REVERSE
11564/// - GU_COPY
11565/// - GU_AND_INVERTED
11566/// - GU_NOOP
11567/// - GU_XOR
11568/// - GU_OR
11569/// - GU_NOR
11570/// - GU_EQUIV
11571/// - GU_INVERTED
11572/// - GU_OR_REVERSE
11573/// - GU_COPY_INVERTED
11574/// - GU_OR_INVERTED
11575/// - GU_NAND
11576/// - GU_SET
11577///
11578/// This operation only has effect if GU_COLOR_LOGIC_OP is enabled.
11579///
11580/// @param op - Operation to execute
11581    pub fn sceGuLogicalOp(op: libc::c_int);
11582}
11583extern "C" {
11584    /// Set ordered pixel dither matrix
11585///
11586/// This dither matrix is only applied if GU_DITHER is enabled.
11587///
11588/// @param matrix - Dither matrix
11589    pub fn sceGuSetDither(matrix: *const ScePspIMatrix4);
11590}
11591extern "C" {
11592    /// Set how primitives are shaded
11593///
11594/// The available shading-methods are:
11595/// - GU_FLAT - Primitives are flatshaded, the last vertex-color takes effet
11596/// - GU_SMOOTH - Primtives are gouraud-shaded, all vertex-colors take effect
11597///
11598/// @param mode - Which mode to use
11599    pub fn sceGuShadeModel(mode: libc::c_int);
11600}
11601extern "C" {
11602    /// Image transfer using the GE
11603///
11604/// @note Data must be aligned to 1 quad word (16 bytes)
11605///
11606/// @par Example: Copy a fullscreen 32-bit image from RAM to VRAM
11607/// @code
11608/// sceGuCopyImage(GU_PSM_8888,0,0,480,272,512,pixels,0,0,512,(void*)(((unsigned int)framebuffer)+0x4000000));
11609/// @endcode
11610///
11611/// @param psm - Pixel format for buffer
11612/// @param sx - Source X
11613/// @param sy - Source Y
11614/// @param width - Image width
11615/// @param height - Image height
11616/// @param srcw - Source buffer width (block aligned)
11617/// @param src - Source pointer
11618/// @param dx - Destination X
11619/// @param dy - Destination Y
11620/// @param destw - Destination buffer width (block aligned)
11621/// @param dest - Destination pointer
11622    pub fn sceGuCopyImage(psm: libc::c_int, sx: libc::c_int, sy: libc::c_int,
11623                          width: libc::c_int, height: libc::c_int,
11624                          srcw: libc::c_int, src: *mut libc::c_void,
11625                          dx: libc::c_int, dy: libc::c_int,
11626                          destw: libc::c_int, dest: *mut libc::c_void);
11627}
11628extern "C" {
11629    /// Specify the texture environment color
11630///
11631/// This is used in the texture function when a constant color is needed.
11632///
11633/// See sceGuTexFunc() for more information.
11634///
11635/// @param color - Constant color (0x00BBGGRR)
11636    pub fn sceGuTexEnvColor(color: libc::c_uint);
11637}
11638extern "C" {
11639    /// Set how the texture is filtered
11640///
11641/// Available filters are:
11642/// - GU_NEAREST
11643/// - GU_LINEAR
11644/// - GU_NEAREST_MIPMAP_NEAREST
11645/// - GU_LINEAR_MIPMAP_NEAREST
11646/// - GU_NEAREST_MIPMAP_LINEAR
11647/// - GU_LINEAR_MIPMAP_LINEAR
11648///
11649/// @param min - Minimizing filter
11650/// @param mag - Magnifying filter
11651    pub fn sceGuTexFilter(min: libc::c_int, mag: libc::c_int);
11652}
11653extern "C" {
11654    /// Flush texture page-cache
11655///
11656/// Do this if you have copied/rendered into an area currently in the texture-cache
11657///
11658    pub fn sceGuTexFlush();
11659}
11660extern "C" {
11661    /// Set how textures are applied
11662///
11663/// Key for the apply-modes:
11664/// - Cv - Color value result
11665/// - Ct - Texture color
11666/// - Cf - Fragment color
11667/// - Cc - Constant color (specified by sceGuTexEnvColor())
11668///
11669/// Available apply-modes are: (TFX)
11670/// - GU_TFX_MODULATE - Cv=Ct*Cf TCC_RGB: Av=Af TCC_RGBA: Av=At*Af
11671/// - GU_TFX_DECAL - TCC_RGB: Cv=Ct,Av=Af TCC_RGBA: Cv=Cf*(1-At)+Ct*At Av=Af
11672/// - GU_TFX_BLEND - Cv=(Cf*(1-Ct))+(Cc*Ct) TCC_RGB: Av=Af TCC_RGBA: Av=At*Af
11673/// - GU_TFX_REPLACE - Cv=Ct TCC_RGB: Av=Af TCC_RGBA: Av=At
11674/// - GU_TFX_ADD - Cv=Cf+Ct TCC_RGB: Av=Af TCC_RGBA: Av=At*Af
11675///
11676/// The fields TCC_RGB and TCC_RGBA specify components that differ between
11677/// the two different component modes.
11678///
11679/// - GU_TFX_MODULATE - The texture is multiplied with the current diffuse fragment
11680/// - GU_TFX_REPLACE - The texture replaces the fragment
11681/// - GU_TFX_ADD - The texture is added on-top of the diffuse fragment
11682///
11683/// Available component-modes are: (TCC)
11684/// - GU_TCC_RGB - The texture alpha does not have any effect
11685/// - GU_TCC_RGBA - The texture alpha is taken into account
11686///
11687/// @param tfx - Which apply-mode to use
11688/// @param tcc - Which component-mode to use
11689    pub fn sceGuTexFunc(tfx: libc::c_int, tcc: libc::c_int);
11690}
11691extern "C" {
11692    /// Set current texturemap
11693///
11694/// Textures may reside in main RAM, but it has a huge speed-penalty. Swizzle textures
11695/// to get maximum speed.
11696///
11697/// @note Data must be aligned to 1 quad word (16 bytes)
11698///
11699/// @param mipmap - Mipmap level
11700/// @param width - Width of texture (must be a power of 2)
11701/// @param height - Height of texture (must be a power of 2)
11702/// @param tbw - Texture Buffer Width (block-aligned)
11703/// @param tbp - Texture buffer pointer (16 byte aligned)
11704    pub fn sceGuTexImage(mipmap: libc::c_int, width: libc::c_int,
11705                         height: libc::c_int, tbw: libc::c_int,
11706                         tbp: *const libc::c_void);
11707}
11708extern "C" {
11709    /// Set texture-level mode (mipmapping)
11710///
11711/// Available modes are:
11712/// - GU_TEXTURE_AUTO
11713/// - GU_TEXTURE_CONST
11714/// - GU_TEXTURE_SLOPE
11715///
11716/// @param mode - Which mode to use
11717/// @param bias - Which mipmap bias to use
11718    pub fn sceGuTexLevelMode(mode: libc::c_uint, bias: f32);
11719}
11720extern "C" {
11721    /// Set the texture-mapping mode
11722///
11723/// Available modes are:
11724/// - GU_TEXTURE_COORDS
11725/// - GU_TEXTURE_MATRIX
11726/// - GU_ENVIRONMENT_MAP
11727///
11728/// @param mode - Which mode to use
11729/// @param a1 - Unknown
11730/// @param a2 - Unknown
11731    pub fn sceGuTexMapMode(mode: libc::c_int, a1: libc::c_uint,
11732                           a2: libc::c_uint);
11733}
11734extern "C" {
11735    /// Set texture-mode parameters
11736///
11737/// Available texture-formats are:
11738/// - GU_PSM_5650 - Hicolor, 16-bit
11739/// - GU_PSM_5551 - Hicolor, 16-bit
11740/// - GU_PSM_4444 - Hicolor, 16-bit
11741/// - GU_PSM_8888 - Truecolor, 32-bit
11742/// - GU_PSM_T4 - Indexed, 4-bit (2 pixels per byte)
11743/// - GU_PSM_T8 - Indexed, 8-bit
11744///
11745/// @param tpsm - Which texture format to use
11746/// @param maxmips - Number of mipmaps to use (0-8)
11747/// @param a2 - Unknown, set to 0
11748/// @param swizzle - GU_TRUE(1) to swizzle texture-reads
11749    pub fn sceGuTexMode(tpsm: libc::c_int, maxmips: libc::c_int,
11750                        a2: libc::c_int, swizzle: libc::c_int);
11751}
11752extern "C" {
11753    /// Set texture offset
11754///
11755/// @note Only used by the 3D T&L pipe, renders done with GU_TRANSFORM_2D are
11756/// not affected by this.
11757///
11758/// @param u - Offset to add to the U coordinate
11759/// @param v - Offset to add to the V coordinate
11760    pub fn sceGuTexOffset(u: f32, v: f32);
11761}
11762extern "C" {
11763    /// Set texture projection-map mode
11764///
11765/// Available modes are:
11766/// - GU_POSITION
11767/// - GU_UV
11768/// - GU_NORMALIZED_NORMAL
11769/// - GU_NORMAL
11770///
11771/// @param mode - Which mode to use
11772    pub fn sceGuTexProjMapMode(mode: libc::c_int);
11773}
11774extern "C" {
11775    /// Set texture scale
11776///
11777/// @note Only used by the 3D T&L pipe, renders ton with GU_TRANSFORM_2D are
11778/// not affected by this.
11779///
11780/// @param u - Scalar to multiply U coordinate with
11781/// @param v - Scalar to multiply V coordinate with
11782    pub fn sceGuTexScale(u: f32, v: f32);
11783}
11784extern "C" {
11785    pub fn sceGuTexSlope(slope: f32);
11786}
11787extern "C" {
11788    /// Synchronize rendering pipeline with image upload.
11789///
11790/// This will stall the rendering pipeline until the current image upload initiated by
11791/// sceGuCopyImage() has completed.
11792    pub fn sceGuTexSync();
11793}
11794extern "C" {
11795    /// Set if the texture should repeat or clamp
11796///
11797/// Available modes are:
11798/// - GU_REPEAT - The texture repeats after crossing the border
11799/// - GU_CLAMP - Texture clamps at the border
11800///
11801/// @param u - Wrap-mode for the U direction
11802/// @param v - Wrap-mode for the V direction
11803    pub fn sceGuTexWrap(u: libc::c_int, v: libc::c_int);
11804}
11805extern "C" {
11806    /// Upload CLUT (Color Lookup Table)
11807///
11808/// @note Data must be aligned to 1 quad word (16 bytes)
11809///
11810/// @param num_blocks - How many blocks of 8 entries to upload (32*8 is 256 colors)
11811/// @param cbp - Pointer to palette (16 byte aligned)
11812    pub fn sceGuClutLoad(num_blocks: libc::c_int, cbp: *const libc::c_void);
11813}
11814extern "C" {
11815    /// Set current CLUT mode
11816///
11817/// Available pixel formats for palettes are:
11818/// - GU_PSM_5650
11819/// - GU_PSM_5551
11820/// - GU_PSM_4444
11821/// - GU_PSM_8888
11822///
11823/// @param cpsm - Which pixel format to use for the palette
11824/// @param shift - Shifts color index by that many bits to the right
11825/// @param mask - Masks the color index with this bitmask after the shift (0-0xFF)
11826/// @param a3 - Unknown, set to 0
11827    pub fn sceGuClutMode(cpsm: libc::c_uint, shift: libc::c_uint,
11828                         mask: libc::c_uint, a3: libc::c_uint);
11829}
11830extern "C" {
11831    /// Set virtual coordinate offset
11832///
11833/// The PSP has a virtual coordinate-space of 4096x4096, this controls where rendering is performed
11834///
11835/// @par Example: Center the virtual coordinate range
11836/// @code
11837/// sceGuOffset(2048-(480/2),2048-(480/2));
11838/// @endcode
11839///
11840/// @param x - Offset (0-4095)
11841/// @param y - Offset (0-4095)
11842    pub fn sceGuOffset(x: libc::c_uint, y: libc::c_uint);
11843}
11844extern "C" {
11845    /// Set what to scissor within the current viewport
11846///
11847/// Note that scissoring is only performed if the custom scissoring is enabled (GU_SCISSOR_TEST)
11848///
11849/// @param x - Left of scissor region
11850/// @param y - Top of scissor region
11851/// @param w - Width of scissor region
11852/// @param h - Height of scissor region
11853    pub fn sceGuScissor(x: libc::c_int, y: libc::c_int, w: libc::c_int,
11854                        h: libc::c_int);
11855}
11856extern "C" {
11857    /// Set current viewport
11858///
11859/// @par Example: Setup a viewport of size (480,272) with origo at (2048,2048)
11860/// @code
11861/// sceGuViewport(2048,2048,480,272);
11862/// @endcode
11863///
11864/// @param cx - Center for horizontal viewport
11865/// @param cy - Center for vertical viewport
11866/// @param width - Width of viewport
11867/// @param height - Height of viewport
11868    pub fn sceGuViewport(cx: libc::c_int, cy: libc::c_int, width: libc::c_int,
11869                         height: libc::c_int);
11870}
11871extern "C" {
11872    /// Draw bezier surface
11873///
11874/// @param vtype - Vertex type, look at sceGuDrawArray() for vertex definition
11875/// @param ucount - Number of vertices used in the U direction
11876/// @param vcount - Number of vertices used in the V direction
11877/// @param indices - Pointer to index buffer
11878/// @param vertices - Pointer to vertex buffer
11879    pub fn sceGuDrawBezier(vtype: libc::c_int, ucount: libc::c_int,
11880                           vcount: libc::c_int, indices: *const libc::c_void,
11881                           vertices: *const libc::c_void);
11882}
11883extern "C" {
11884    /// Set dividing for patches (beziers and splines)
11885///
11886/// @param ulevel - Number of division on u direction
11887/// @param vlevel - Number of division on v direction
11888    pub fn sceGuPatchDivide(ulevel: libc::c_uint, vlevel: libc::c_uint);
11889}
11890extern "C" {
11891    pub fn sceGuPatchFrontFace(a0: libc::c_uint);
11892}
11893extern "C" {
11894    /// Set primitive for patches (beziers and splines)
11895///
11896/// @param prim - Desired primitive type (GU_POINTS | GU_LINE_STRIP | GU_TRIANGLE_STRIP)
11897    pub fn sceGuPatchPrim(prim: libc::c_int);
11898}
11899extern "C" {
11900    pub fn sceGuDrawSpline(vtype: libc::c_int, ucount: libc::c_int,
11901                           vcount: libc::c_int, uedge: libc::c_int,
11902                           vedge: libc::c_int, indices: *const libc::c_void,
11903                           vertices: *const libc::c_void);
11904}
11905extern "C" {
11906    /// Set transform matrices
11907///
11908/// Available matrices are:
11909/// - GU_PROJECTION - View->Projection matrix
11910/// - GU_VIEW - World->View matrix
11911/// - GU_MODEL - Model->World matrix
11912/// - GU_TEXTURE - Texture matrix
11913///
11914/// @param type - Which matrix-type to set
11915/// @param matrix - Matrix to load
11916    pub fn sceGuSetMatrix(type_: libc::c_int, matrix: *const ScePspFMatrix4);
11917}
11918extern "C" {
11919    /// Specify skinning matrix entry
11920///
11921/// To enable vertex skinning, pass GU_WEIGHTS(n), where n is between
11922/// 1-8, and pass available GU_WEIGHT_??? declaration. This will change
11923/// the amount of weights passed in the vertex araay, and by setting the skinning,
11924/// matrices, you will multiply each vertex every weight and vertex passed.
11925///
11926/// Please see sceGuDrawArray() for vertex format information.
11927///
11928/// @param index - Skinning matrix index (0-7)
11929/// @param matrix - Matrix to set
11930    pub fn sceGuBoneMatrix(index: libc::c_uint,
11931                           matrix: *const ScePspFMatrix4);
11932}
11933extern "C" {
11934    /// Specify morph weight entry
11935///
11936/// To enable vertex morphing, pass GU_VERTICES(n), where n is between
11937/// 1-8. This will change the amount of vertices passed in the vertex array,
11938/// and by setting the morph weights for every vertex entry in the array,
11939/// you can blend between them.
11940///
11941/// Please see sceGuDrawArray() for vertex format information.
11942///
11943/// @param index - Morph weight index (0-7)
11944/// @param weight - Weight to set
11945    pub fn sceGuMorphWeight(index: libc::c_int, weight: f32);
11946}
11947extern "C" {
11948    pub fn sceGuDrawArrayN(primitive_type: libc::c_int,
11949                           vertex_type: libc::c_int, count: libc::c_int,
11950                           a3: libc::c_int, indices: *const libc::c_void,
11951                           vertices: *const libc::c_void);
11952}
11953extern "C" {
11954    /// Set how the display should be set
11955///
11956/// Available behaviours are:
11957/// - PSP_DISPLAY_SETBUF_IMMEDIATE - Display is swapped immediately
11958/// - PSP_DISPLAY_SETBUF_NEXTFRAME - Display is swapped on the next frame
11959///
11960/// Do remember that this swaps the pointers internally, regardless of setting, so be careful to wait until the next
11961/// vertical blank or use another buffering algorithm (see guSwapBuffersCallback()).
11962    pub fn guSwapBuffersBehaviour(behaviour: libc::c_int);
11963}
11964extern "C" {
11965    /// Set a buffer swap callback to allow for more advanced buffer methods without hacking the library.
11966///
11967/// The GuSwapBuffersCallback is defined like this:
11968/// @code
11969/// void swapBuffersCallback(void** display, void** render);
11970/// @endcode
11971/// and on entry they contain the variables that are to be set. To change the pointers that will be used, just
11972/// write the new pointers. Example of a triple-buffering algorithm:
11973/// @code
11974/// void* doneBuffer;
11975/// void swapBuffersCallback(void** display, void** render)
11976/// {
11977/// void* active = doneBuffer;
11978/// doneBuffer = *display;
11979/// display = active;
11980/// }
11981/// @endcode
11982///
11983/// @param callback - Callback to access when buffers are swapped. Pass 0 to disable.
11984    pub fn guSwapBuffersCallback(callback: GuSwapBuffersCallback);
11985}
11986extern "C" {
11987    pub fn sceGumDrawArray(prim: libc::c_int, vtype: libc::c_int,
11988                           count: libc::c_int, indices: *const libc::c_void,
11989                           vertices: *const libc::c_void);
11990}
11991extern "C" {
11992    pub fn sceGumDrawArrayN(prim: libc::c_int, vtype: libc::c_int,
11993                            count: libc::c_int, a3: libc::c_int,
11994                            indices: *const libc::c_void,
11995                            vertices: *const libc::c_void);
11996}
11997extern "C" {
11998    pub fn sceGumDrawBezier(vtype: libc::c_int, ucount: libc::c_int,
11999                            vcount: libc::c_int, indices: *const libc::c_void,
12000                            vertices: *const libc::c_void);
12001}
12002extern "C" {
12003    pub fn sceGumDrawSpline(vtype: libc::c_int, ucount: libc::c_int,
12004                            vcount: libc::c_int, uedge: libc::c_int,
12005                            vedge: libc::c_int, indices: *const libc::c_void,
12006                            vertices: *const libc::c_void);
12007}
12008extern "C" {
12009    /// Load identity matrix
12010///
12011/// [1 0 0 0]
12012/// [0 1 0 0]
12013/// [0 0 1 0]
12014/// [0 0 0 1]
12015    pub fn sceGumLoadIdentity();
12016}
12017extern "C" {
12018    /// Load matrix
12019///
12020/// @param m - Matrix to load into stack
12021    pub fn sceGumLoadMatrix(m: *const ScePspFMatrix4);
12022}
12023extern "C" {
12024    pub fn sceGumLookAt(eye: *mut ScePspFVector3, center: *mut ScePspFVector3,
12025                        up: *mut ScePspFVector3);
12026}
12027extern "C" {
12028    /// Select which matrix stack to operate on
12029///
12030/// Available matrix modes are:
12031/// - GU_PROJECTION
12032/// - GU_VIEW
12033/// - GU_MODEL
12034/// - GU_TEXTURE
12035///
12036/// @param mode - Matrix mode to use
12037    pub fn sceGumMatrixMode(mode: libc::c_int);
12038}
12039extern "C" {
12040    /// Multiply current matrix with input
12041///
12042/// @param m - Matrix to multiply stack with
12043    pub fn sceGumMultMatrix(m: *const ScePspFMatrix4);
12044}
12045extern "C" {
12046    /// Apply ortho projection matrix
12047///
12048/// @note The matrix loses its orthonogal status after executing this function.
12049    pub fn sceGumOrtho(left: f32, right: f32, bottom: f32, top: f32,
12050                       near: f32, far: f32);
12051}
12052extern "C" {
12053    /// Apply perspective projection matrix
12054///
12055/// @note The matrix loses its orthonogal status after executing this function.
12056    pub fn sceGumPerspective(fovy: f32, aspect: f32, near: f32, far: f32);
12057}
12058extern "C" {
12059    /// Pop matrix from stack
12060    pub fn sceGumPopMatrix();
12061}
12062extern "C" {
12063    /// Push current matrix onto stack
12064    pub fn sceGumPushMatrix();
12065}
12066extern "C" {
12067    /// Rotate around the X axis
12068///
12069/// @param angle - Angle in radians
12070    pub fn sceGumRotateX(angle: f32);
12071}
12072extern "C" {
12073    /// Rotate around the Y axis
12074///
12075/// @param angle - Angle in radians
12076    pub fn sceGumRotateY(angle: f32);
12077}
12078extern "C" {
12079    /// Rotate around the Z axis
12080///
12081/// @param angle - Angle in radians
12082    pub fn sceGumRotateZ(angle: f32);
12083}
12084extern "C" {
12085    /// Rotate around all 3 axis in order X, Y, Z
12086///
12087/// @param v - Pointer to vector containing angles
12088    pub fn sceGumRotateXYZ(v: *const ScePspFVector3);
12089}
12090extern "C" {
12091    /// Rotate around all 3 axis in order Z, Y, X
12092///
12093/// @param v - Pointer to vector containing angles
12094    pub fn sceGumRotateZYX(v: *const ScePspFVector3);
12095}
12096extern "C" {
12097    /// Scale matrix
12098///
12099/// @note The matrix loses its orthonogal status after executing this function.
12100    pub fn sceGumScale(v: *const ScePspFVector3);
12101}
12102extern "C" {
12103    /// Store current matrix in the stack
12104///
12105/// @param m - Matrix to write result to
12106    pub fn sceGumStoreMatrix(m: *mut ScePspFMatrix4);
12107}
12108extern "C" {
12109    /// Translate coordinate system
12110///
12111/// @param v - Translation coordinates
12112    pub fn sceGumTranslate(v: *const ScePspFVector3);
12113}
12114extern "C" {
12115    /// Explicitly flush dirty matrices to the hardware
12116    pub fn sceGumUpdateMatrix();
12117}
12118extern "C" {
12119    /// Invert 4x4 matrix
12120///
12121/// This invert algorithm can operate on matrices that are not orthongal (See sceGumFastInverse())
12122    pub fn sceGumFullInverse();
12123}
12124extern "C" {
12125    /// Invert orthonogal 4x4 matrix
12126///
12127/// Note that the matrix in the stack has to be orthonogal (that is, all rotational axises must be unit length & orthonogal against the others),
12128/// otherwise the result of the function cannot be depended on. If you need to invert a matrix that is not orthonogal, use sceGumFullInverse().
12129    pub fn sceGumFastInverse();
12130}
12131extern "C" {
12132    /// Stack-aware version of sceGuBeginObject() (look in pspgu.h for description)
12133///
12134/// @note NOT YET IMPLEMENTED
12135///
12136/// @param vtype - Vertex type to process
12137/// @param count - Number of vertices to test
12138/// @param indices - Optional index-list
12139/// @param vertices - Vertex-list
12140    pub fn sceGumBeginObject(vtype: libc::c_int, count: libc::c_int,
12141                             indices: *const libc::c_void,
12142                             vertices: *const libc::c_void);
12143}
12144extern "C" {
12145    /// Stack-aware version of sceGuEndObject()
12146///
12147/// @note NOT YET IMPLEMENTED
12148    pub fn sceGumEndObject();
12149}
12150extern "C" {
12151    pub fn gumInit();
12152}
12153extern "C" {
12154    /// Load matrix with identity
12155///
12156/// @param m - Matrix to load with identity
12157    pub fn gumLoadIdentity(m: *mut ScePspFMatrix4);
12158}
12159extern "C" {
12160    pub fn gumLoadMatrix(r: *mut ScePspFMatrix4, a: *const ScePspFMatrix4);
12161}
12162extern "C" {
12163    pub fn gumLookAt(m: *mut ScePspFMatrix4, eye: *mut ScePspFVector3,
12164                     center: *mut ScePspFVector3, up: *mut ScePspFVector3);
12165}
12166extern "C" {
12167    pub fn gumMultMatrix(result: *mut ScePspFMatrix4,
12168                         a: *const ScePspFMatrix4, b: *const ScePspFMatrix4);
12169}
12170extern "C" {
12171    pub fn gumOrtho(m: *mut ScePspFMatrix4, left: f32, right: f32,
12172                    bottom: f32, top: f32, near: f32, far: f32);
12173}
12174extern "C" {
12175    pub fn gumPerspective(m: *mut ScePspFMatrix4, fovy: f32, aspect: f32,
12176                          near: f32, far: f32);
12177}
12178extern "C" {
12179    pub fn gumRotateX(m: *mut ScePspFMatrix4, angle: f32);
12180}
12181extern "C" {
12182    pub fn gumRotateXYZ(m: *mut ScePspFMatrix4, v: *const ScePspFVector3);
12183}
12184extern "C" {
12185    pub fn gumRotateY(m: *mut ScePspFMatrix4, angle: f32);
12186}
12187extern "C" {
12188    pub fn gumRotateZ(m: *mut ScePspFMatrix4, angle: f32);
12189}
12190extern "C" {
12191    pub fn gumRotateZYX(m: *mut ScePspFMatrix4, v: *const ScePspFVector3);
12192}
12193extern "C" {
12194    pub fn gumScale(m: *mut ScePspFMatrix4, v: *const ScePspFVector3);
12195}
12196extern "C" {
12197    pub fn gumTranslate(m: *mut ScePspFMatrix4, v: *const ScePspFVector3);
12198}
12199extern "C" {
12200    pub fn gumFullInverse(r: *mut ScePspFMatrix4, a: *const ScePspFMatrix4);
12201}
12202extern "C" {
12203    /// Invert orthonogal 4x4 matrix
12204///
12205/// Note that the matrix in the stack has to be orthonogal (that is, all rotational axises must be unit length & orthonogal against the others),
12206/// otherwise the result of the function cannot be depended on. If you need to invert a matrix that is not orthonogal, use gumFullInverse().
12207///
12208/// @param r - Matrix receiving result
12209/// @param a - Orthonogal matrix that is to be inverted
12210    pub fn gumFastInverse(r: *mut ScePspFMatrix4, a: *const ScePspFMatrix4);
12211}
12212extern "C" {
12213    pub fn gumCrossProduct(r: *mut ScePspFVector3, a: *const ScePspFVector3,
12214                           b: *const ScePspFVector3);
12215}
12216extern "C" {
12217    pub fn gumDotProduct(a: *const ScePspFVector3, b: *const ScePspFVector3)
12218     -> f32;
12219}
12220extern "C" {
12221    pub fn gumNormalize(v: *mut ScePspFVector3);
12222}
12223#[repr(u32)]
12224/// Enumeration of the remote keys
12225#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
12226pub enum PspHprmKeys {
12227    PSP_HPRM_PLAYPAUSE = 1,
12228    PSP_HPRM_FORWARD = 4,
12229    PSP_HPRM_BACK = 8,
12230    PSP_HPRM_VOL_UP = 16,
12231    PSP_HPRM_VOL_DOWN = 32,
12232    PSP_HPRM_HOLD = 128,
12233}
12234extern "C" {
12235    /// Peek at the current being pressed on the remote.
12236///
12237/// @param key - Pointer to the u32 to receive the key bitmap, should be one or
12238/// more of ::PspHprmKeys
12239///
12240/// @return < 0 on error
12241    pub fn sceHprmPeekCurrentKey(key: *mut u32) -> libc::c_int;
12242}
12243extern "C" {
12244    /// Peek at the current latch data.
12245///
12246/// @param latch - Pointer a to a 4 dword array to contain the latch data.
12247///
12248/// @return < 0 on error.
12249    pub fn sceHprmPeekLatch(latch: *mut u32) -> libc::c_int;
12250}
12251extern "C" {
12252    /// Read the current latch data.
12253///
12254/// @param latch - Pointer a to a 4 dword array to contain the latch data.
12255///
12256/// @return < 0 on error.
12257    pub fn sceHprmReadLatch(latch: *mut u32) -> libc::c_int;
12258}
12259extern "C" {
12260    /// Determines whether the headphones are plugged in.
12261///
12262/// @return 1 if the headphones are plugged in, else 0.
12263    pub fn sceHprmIsHeadphoneExist() -> libc::c_int;
12264}
12265extern "C" {
12266    /// Determines whether the remote is plugged in.
12267///
12268/// @return 1 if the remote is plugged in, else 0.
12269    pub fn sceHprmIsRemoteExist() -> libc::c_int;
12270}
12271extern "C" {
12272    /// Determines whether the microphone is plugged in.
12273///
12274/// @return 1 if the microphone is plugged in, else 0.
12275    pub fn sceHprmIsMicrophoneExist() -> libc::c_int;
12276}
12277#[repr(u32)]
12278#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
12279pub enum PspHttpHttpVersion {
12280    PSP_HTTP_VERSION_1_0 = 0,
12281    PSP_HTTP_VERSION_1_1 = 1,
12282}
12283#[repr(u32)]
12284#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
12285pub enum PspHttpMethod {
12286    PSP_HTTP_METHOD_GET = 0,
12287    PSP_HTTP_METHOD_POST = 1,
12288    PSP_HTTP_METHOD_HEAD = 2,
12289}
12290#[repr(u32)]
12291#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
12292pub enum PspHttpAuthType {
12293    PSP_HTTP_AUTH_BASIC = 0,
12294    PSP_HTTP_AUTH_DIGEST = 1,
12295}
12296#[repr(u32)]
12297#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
12298pub enum PspHttpProxyMode {
12299    PSP_HTTP_PROXY_AUTO = 0,
12300    PSP_HTTP_PROXY_MANUAL = 1,
12301}
12302#[repr(u32)]
12303#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
12304pub enum PspHttpAddHeaderMode {
12305    PSP_HTTP_HEADER_OVERWRITE = 0,
12306    PSP_HTTP_HEADER_ADD = 1,
12307}
12308pub type PspHttpMallocFunction =
12309    ::core::option::Option<unsafe extern "C" fn(size: SceSize)
12310                               -> *mut libc::c_void>;
12311pub type PspHttpReallocFunction =
12312    ::core::option::Option<unsafe extern "C" fn(p: *mut libc::c_void,
12313                                                size: SceSize)
12314                               -> *mut libc::c_void>;
12315pub type PspHttpFreeFunction =
12316    ::core::option::Option<unsafe extern "C" fn(p: *mut libc::c_void)>;
12317pub type PspHttpPasswordCB =
12318    ::core::option::Option<unsafe extern "C" fn(request: libc::c_int,
12319                                                auth_type: PspHttpAuthType,
12320                                                realm: *const libc::c_uchar,
12321                                                username: *mut libc::c_uchar,
12322                                                password: *mut libc::c_uchar,
12323                                                need_entity: SceBool,
12324                                                entity_body:
12325                                                    *mut *mut libc::c_uchar,
12326                                                entity_size: *mut SceSize,
12327                                                save: *mut SceBool)
12328                               -> libc::c_int>;
12329extern "C" {
12330    /// Init the http library.
12331///
12332/// @param unknown1 - Memory pool size? Pass 20000
12333/// @return 0 on success, < 0 on error.
12334    pub fn sceHttpInit(unknown1: libc::c_uint) -> libc::c_int;
12335}
12336extern "C" {
12337    /// Terminate the http library.
12338///
12339/// @return 0 on success, < 0 on error.
12340    pub fn sceHttpEnd() -> libc::c_int;
12341}
12342extern "C" {
12343    /// Create a http template.
12344///
12345/// @param agent - User agent
12346/// @param unknown1 - Pass 1
12347/// @param unknown2 - Pass 0
12348/// @return A template ID on success, < 0 on error.
12349    pub fn sceHttpCreateTemplate(agent: *mut libc::c_char,
12350                                 unknown1: libc::c_int, unknown2: libc::c_int)
12351     -> libc::c_int;
12352}
12353extern "C" {
12354    /// Delete a http template.
12355///
12356/// @param templateid - ID of the template created by sceHttpCreateTemplate
12357/// @return 0 on success, < 0 on error.
12358    pub fn sceHttpDeleteTemplate(templateid: libc::c_int) -> libc::c_int;
12359}
12360extern "C" {
12361    /// Create a http connection.
12362///
12363/// @param templateid - ID of the template created by sceHttpCreateTemplate
12364/// @param host - Host to connect to
12365/// @param unknown1 - Pass "http"
12366/// @param port - Port to connect on
12367/// @param unknown2 - Pass 0
12368/// @return A connection ID on success, < 0 on error.
12369    pub fn sceHttpCreateConnection(templateid: libc::c_int,
12370                                   host: *mut libc::c_char,
12371                                   unknown1: *mut libc::c_char,
12372                                   port: libc::c_ushort,
12373                                   unknown2: libc::c_int) -> libc::c_int;
12374}
12375extern "C" {
12376    /// Create a http connection to a url.
12377///
12378/// @param templateid - ID of the template created by sceHttpCreateTemplate
12379/// @param url - url to connect to
12380/// @param unknown1 - Pass 0
12381/// @return A connection ID on success, < 0 on error.
12382    pub fn sceHttpCreateConnectionWithURL(templateid: libc::c_int,
12383                                          url: *const libc::c_char,
12384                                          unknown1: libc::c_int)
12385     -> libc::c_int;
12386}
12387extern "C" {
12388    /// Delete a http connection.
12389///
12390/// @param connectionid - ID of the connection created by sceHttpCreateConnection or sceHttpCreateConnectionWithURL
12391/// @return 0 on success, < 0 on error.
12392    pub fn sceHttpDeleteConnection(connectionid: libc::c_int) -> libc::c_int;
12393}
12394extern "C" {
12395    /// Create a http request.
12396///
12397/// @param connectionid - ID of the connection created by sceHttpCreateConnection or sceHttpCreateConnectionWithURL
12398/// @param method - One of ::PspHttpMethod
12399/// @param path - Path to access
12400/// @param contentlength - Length of the content (POST method only)
12401/// @return A request ID on success, < 0 on error.
12402    pub fn sceHttpCreateRequest(connectionid: libc::c_int,
12403                                method: PspHttpMethod,
12404                                path: *mut libc::c_char,
12405                                contentlength: SceULong64) -> libc::c_int;
12406}
12407extern "C" {
12408    /// Create a http request with url.
12409///
12410/// @param connectionid - ID of the connection created by sceHttpCreateConnection or sceHttpCreateConnectionWithURL
12411/// @param method - One of ::PspHttpMethod
12412/// @param url - url to access
12413/// @param contentlength - Length of the content (POST method only)
12414/// @return A request ID on success, < 0 on error.
12415    pub fn sceHttpCreateRequestWithURL(connectionid: libc::c_int,
12416                                       method: PspHttpMethod,
12417                                       url: *mut libc::c_char,
12418                                       contentlength: SceULong64)
12419     -> libc::c_int;
12420}
12421extern "C" {
12422    /// Delete a http request.
12423///
12424/// @param requestid - ID of the request created by sceHttpCreateRequest or sceHttpCreateRequestWithURL
12425/// @return 0 on success, < 0 on error.
12426    pub fn sceHttpDeleteRequest(requestid: libc::c_int) -> libc::c_int;
12427}
12428extern "C" {
12429    /// Send a http request.
12430///
12431/// @param requestid - ID of the request created by sceHttpCreateRequest or sceHttpCreateRequestWithURL
12432/// @param data - For POST methods specify a pointer to the post data, otherwise pass NULL
12433/// @param datasize - For POST methods specify the size of the post data, otherwise pass 0
12434/// @return 0 on success, < 0 on error.
12435    pub fn sceHttpSendRequest(requestid: libc::c_int, data: *mut libc::c_void,
12436                              datasize: libc::c_uint) -> libc::c_int;
12437}
12438extern "C" {
12439    /// Abort a http request.
12440///
12441/// @param requestid - ID of the request created by sceHttpCreateRequest or sceHttpCreateRequestWithURL
12442/// @return 0 on success, < 0 on error.
12443    pub fn sceHttpAbortRequest(requestid: libc::c_int) -> libc::c_int;
12444}
12445extern "C" {
12446    /// Read a http request response.
12447///
12448/// @param requestid - ID of the request created by sceHttpCreateRequest or sceHttpCreateRequestWithURL
12449/// @param data - Buffer for the response data to be stored
12450/// @param datasize - Size of the buffer
12451/// @return The size read into the data buffer, 0 if there is no more data, < 0 on error.
12452    pub fn sceHttpReadData(requestid: libc::c_int, data: *mut libc::c_void,
12453                           datasize: libc::c_uint) -> libc::c_int;
12454}
12455extern "C" {
12456    /// Get http request response length.
12457///
12458/// @param requestid - ID of the request created by sceHttpCreateRequest or sceHttpCreateRequestWithURL
12459/// @param contentlength - The size of the content
12460/// @return 0 on success, < 0 on error.
12461    pub fn sceHttpGetContentLength(requestid: libc::c_int,
12462                                   contentlength: *mut SceULong64)
12463     -> libc::c_int;
12464}
12465extern "C" {
12466    /// Get http request status code.
12467///
12468/// @param requestid - ID of the request created by sceHttpCreateRequest or sceHttpCreateRequestWithURL
12469/// @param statuscode - The status code from the host (200 is ok, 404 is not found etc)
12470/// @return 0 on success, < 0 on error.
12471    pub fn sceHttpGetStatusCode(requestid: libc::c_int,
12472                                statuscode: *mut libc::c_int) -> libc::c_int;
12473}
12474extern "C" {
12475    /// Set resolver timeout
12476///
12477/// @param id - ID of the template or connection
12478/// @param timeout - Timeout value in microseconds
12479/// @return 0 on success, < 0 on error.
12480    pub fn sceHttpSetResolveTimeOut(id: libc::c_int, timeout: libc::c_uint)
12481     -> libc::c_int;
12482}
12483extern "C" {
12484    /// Set resolver retry
12485///
12486/// @param id - ID of the template or connection
12487/// @param count - Number of retries
12488/// @return 0 on success, < 0 on error.
12489    pub fn sceHttpSetResolveRetry(id: libc::c_int, count: libc::c_int)
12490     -> libc::c_int;
12491}
12492extern "C" {
12493    /// Set connect timeout
12494///
12495/// @param id - ID of the template, connection or request
12496/// @param timeout - Timeout value in microseconds
12497/// @return 0 on success, < 0 on error.
12498    pub fn sceHttpSetConnectTimeOut(id: libc::c_int, timeout: libc::c_uint)
12499     -> libc::c_int;
12500}
12501extern "C" {
12502    /// Set send timeout
12503///
12504/// @param id - ID of the template, connection or request
12505/// @param timeout - Timeout value in microseconds
12506/// @return 0 on success, < 0 on error.
12507    pub fn sceHttpSetSendTimeOut(id: libc::c_int, timeout: libc::c_uint)
12508     -> libc::c_int;
12509}
12510extern "C" {
12511    /// Set receive timeout
12512///
12513/// @param id - ID of the template or connection
12514/// @param timeout - Timeout value in microseconds
12515/// @return 0 on success, < 0 on error.
12516    pub fn sceHttpSetRecvTimeOut(id: libc::c_int, timeout: libc::c_uint)
12517     -> libc::c_int;
12518}
12519extern "C" {
12520    /// Enable keep alive
12521///
12522/// @param id - ID of the template or connection
12523/// @return 0 on success, < 0 on error.
12524    pub fn sceHttpEnableKeepAlive(id: libc::c_int) -> libc::c_int;
12525}
12526extern "C" {
12527    /// Disable keep alive
12528///
12529/// @param id - ID of the template or connection
12530/// @return 0 on success, < 0 on error.
12531    pub fn sceHttpDisableKeepAlive(id: libc::c_int) -> libc::c_int;
12532}
12533extern "C" {
12534    /// Enable redirect
12535///
12536/// @param id - ID of the template or connection
12537/// @return 0 on success, < 0 on error.
12538    pub fn sceHttpEnableRedirect(id: libc::c_int) -> libc::c_int;
12539}
12540extern "C" {
12541    /// Disable redirect
12542///
12543/// @param id - ID of the template or connection
12544/// @return 0 on success, < 0 on error.
12545    pub fn sceHttpDisableRedirect(id: libc::c_int) -> libc::c_int;
12546}
12547extern "C" {
12548    /// Enable cookie
12549///
12550/// @param id - ID of the template or connection
12551/// @return 0 on success, < 0 on error.
12552    pub fn sceHttpEnableCookie(id: libc::c_int) -> libc::c_int;
12553}
12554extern "C" {
12555    /// Disable cookie
12556///
12557/// @param id - ID of the template or connection
12558/// @return 0 on success, < 0 on error.
12559    pub fn sceHttpDisableCookie(id: libc::c_int) -> libc::c_int;
12560}
12561extern "C" {
12562    /// Save cookie
12563///
12564/// @return 0 on success, < 0 on error.
12565    pub fn sceHttpSaveSystemCookie() -> libc::c_int;
12566}
12567extern "C" {
12568    /// Load cookie
12569///
12570/// @return 0 on success, < 0 on error.
12571    pub fn sceHttpLoadSystemCookie() -> libc::c_int;
12572}
12573extern "C" {
12574    /// Add content header
12575///
12576/// @param id - ID of the template, connection or request
12577/// @param name - Name of the content
12578/// @param value - Value of the content
12579/// @param unknown1 - Pass 0
12580/// @return 0 on success, < 0 on error.
12581    pub fn sceHttpAddExtraHeader(id: libc::c_int, name: *mut libc::c_char,
12582                                 value: *mut libc::c_char,
12583                                 unknown1: libc::c_int) -> libc::c_int;
12584}
12585extern "C" {
12586    /// Delete content header
12587///
12588/// @param id - ID of the template, connection or request
12589/// @param name - Name of the content
12590/// @return 0 on success, < 0 on error.
12591    pub fn sceHttpDeleteHeader(id: libc::c_int, name: *const libc::c_char)
12592     -> libc::c_int;
12593}
12594extern "C" {
12595    /// Init the https library.
12596///
12597/// @param unknown1 - Pass 0
12598/// @param unknown2 - Pass 0
12599/// @param unknown3 - Pass 0
12600/// @param unknown4 - Pass 0
12601///
12602/// @return 0 on success, < 0 on error.
12603    pub fn sceHttpsInit(unknown1: libc::c_int, unknown2: libc::c_int,
12604                        unknown3: libc::c_int, unknown4: libc::c_int)
12605     -> libc::c_int;
12606}
12607extern "C" {
12608    /// Terminate the https library
12609///
12610/// @return 0 on success, < 0 on error.
12611    pub fn sceHttpsEnd() -> libc::c_int;
12612}
12613extern "C" {
12614    /// Load default certificate
12615///
12616/// @param unknown1 - Pass 0
12617/// @param unknown2 - Pass 0
12618/// @return 0 on success, < 0 on error.
12619    pub fn sceHttpsLoadDefaultCert(unknown1: libc::c_int,
12620                                   unknown2: libc::c_int) -> libc::c_int;
12621}
12622extern "C" {
12623    pub fn sceHttpDisableAuth(id: libc::c_int) -> libc::c_int;
12624}
12625extern "C" {
12626    pub fn sceHttpDisableCache(id: libc::c_int) -> libc::c_int;
12627}
12628extern "C" {
12629    pub fn sceHttpEnableAuth(id: libc::c_int) -> libc::c_int;
12630}
12631extern "C" {
12632    pub fn sceHttpEnableCache(id: libc::c_int) -> libc::c_int;
12633}
12634extern "C" {
12635    pub fn sceHttpEndCache() -> libc::c_int;
12636}
12637extern "C" {
12638    pub fn sceHttpGetAllHeader(request: libc::c_int,
12639                               header: *mut *mut libc::c_uchar,
12640                               header_size: *mut libc::c_uint) -> libc::c_int;
12641}
12642extern "C" {
12643    pub fn sceHttpGetNetworkErrno(request: libc::c_int,
12644                                  err_num: *mut libc::c_int) -> libc::c_int;
12645}
12646extern "C" {
12647    pub fn sceHttpGetProxy(id: libc::c_int, activate_flag: *mut libc::c_int,
12648                           mode: *mut libc::c_int,
12649                           proxy_host: *mut libc::c_uchar, len: SceSize,
12650                           proxy_port: *mut libc::c_ushort) -> libc::c_int;
12651}
12652extern "C" {
12653    pub fn sceHttpInitCache(max_size: SceSize) -> libc::c_int;
12654}
12655extern "C" {
12656    pub fn sceHttpSetAuthInfoCB(id: libc::c_int, cbfunc: PspHttpPasswordCB)
12657     -> libc::c_int;
12658}
12659extern "C" {
12660    pub fn sceHttpSetProxy(id: libc::c_int, activate_flag: libc::c_int,
12661                           mode: libc::c_int,
12662                           new_proxy_host: *const libc::c_uchar,
12663                           new_proxy_port: libc::c_ushort) -> libc::c_int;
12664}
12665extern "C" {
12666    pub fn sceHttpSetResHeaderMaxSize(id: libc::c_int,
12667                                      header_size: libc::c_uint)
12668     -> libc::c_int;
12669}
12670extern "C" {
12671    pub fn sceHttpSetMallocFunction(malloc_func: PspHttpMallocFunction,
12672                                    free_func: PspHttpFreeFunction,
12673                                    realloc_func: PspHttpReallocFunction)
12674     -> libc::c_int;
12675}
12676extern "C" {
12677    /// Retrieves the value associated with a key
12678/// @param key    - idstorage key
12679/// @param offset - offset within the 512 byte leaf
12680/// @param buf    - buffer with enough storage
12681/// @param len    - amount of data to retrieve (offset + len must be <= 512 bytes)
12682    pub fn sceIdStorageLookup(key: u16, offset: u32, buf: *mut libc::c_void,
12683                              len: u32) -> libc::c_int;
12684}
12685extern "C" {
12686    /// Retrieves the whole 512 byte container for the key
12687/// @param key - idstorage key
12688/// @param buf - buffer with at last 512 bytes of storage
12689    pub fn sceIdStorageReadLeaf(key: u16, buf: *mut libc::c_void)
12690     -> libc::c_int;
12691}
12692extern "C" {
12693    /// sceIdStorageWriteLeaf() - Writes 512-bytes to idstorage key
12694/// @param key - idstorage key
12695/// @param buf - buffer with 512-btes of data
12696    pub fn sceIdStorageWriteLeaf(key: u16, buf: *mut libc::c_void)
12697     -> libc::c_int;
12698}
12699extern "C" {
12700    /// sceIdStorageIsReadOnly() - Checks idstorage for readonly status
12701    pub fn sceIdStorageIsReadOnly() -> libc::c_int;
12702}
12703extern "C" {
12704    /// sceIdStorageFlush() - Finalizes a write
12705    pub fn sceIdStorageFlush() -> libc::c_int;
12706}
12707pub type SceImposeParam = libc::c_int;
12708extern "C" {
12709    /// Fetch the value of an Impose parameter.
12710///
12711/// @return value of the parameter on success, < 0 on error
12712    pub fn sceImposeGetParam(param: SceImposeParam) -> libc::c_int;
12713}
12714extern "C" {
12715    /// Change the value of an Impose parameter.
12716///
12717/// @param param - The parameter to change.
12718/// @param value - The value to set the parameter to.
12719/// @return < 0 on error
12720///
12721    pub fn sceImposeSetParam(param: SceImposeParam, value: libc::c_int)
12722     -> libc::c_int;
12723}
12724extern "C" {
12725    /// Get the value of the backlight timer.
12726///
12727/// @return backlight timer in seconds or < 0 on error
12728///
12729    pub fn sceImposeGetBacklightOffTime() -> libc::c_int;
12730}
12731extern "C" {
12732    /// Set the value of the backlight timer.
12733///
12734/// @param value - The backlight timer. (30 to a lot of seconds)
12735/// @return < 0 on error
12736///
12737    pub fn sceImposeSetBacklightOffTime(value: libc::c_int) -> libc::c_int;
12738}
12739extern "C" {
12740    /// Get the language and button assignment parameters
12741///
12742/// @return < 0 on error
12743///
12744    pub fn sceImposeGetLanguageMode(lang: *mut libc::c_int,
12745                                    button: *mut libc::c_int) -> libc::c_int;
12746}
12747extern "C" {
12748    /// Set the language and button assignment parameters
12749///
12750/// /!\ parameter values not known.
12751///
12752/// @param lang - Language
12753/// @param button - Button assignment
12754/// @return < 0 on error
12755///
12756    pub fn sceImposeSetLanguageMode(lang: libc::c_int, button: libc::c_int)
12757     -> libc::c_int;
12758}
12759extern "C" {
12760    /// Get the value of the UMD popup.
12761///
12762/// @return umd popup state or < 0 on error
12763///
12764    pub fn sceImposeGetUMDPopup() -> libc::c_int;
12765}
12766extern "C" {
12767    /// Set the value of the UMD popup.
12768///
12769/// @param value - The popup mode.
12770/// @return < 0 on error
12771///
12772    pub fn sceImposeSetUMDPopup(value: libc::c_int) -> libc::c_int;
12773}
12774extern "C" {
12775    /// Get the value of the Home popup.
12776///
12777/// @return home popup state or < 0 on error
12778///
12779    pub fn sceImposeGetHomePopup() -> libc::c_int;
12780}
12781extern "C" {
12782    /// Set the value of the Home popup.
12783///
12784/// @param value - The popup mode.
12785/// @return < 0 on error
12786///
12787    pub fn sceImposeSetHomePopup(value: libc::c_int) -> libc::c_int;
12788}
12789extern "C" {
12790    /// Check the video out. (for psp slim?)
12791///
12792/// @param value - video out mode/status(?)
12793/// @return < 0 on error
12794///
12795    pub fn sceImposeCheckVideoOut(value: *mut libc::c_int) -> libc::c_int;
12796}
12797#[repr(u32)]
12798#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
12799pub enum PSPBootFrom {
12800    PSP_BOOT_FLASH = 0,
12801    PSP_BOOT_DISC = 32,
12802    PSP_BOOT_MS = 64,
12803}
12804#[repr(u32)]
12805#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
12806pub enum PSPInitApitype {
12807    PSP_INIT_APITYPE_DISC = 288,
12808    PSP_INIT_APITYPE_DISC_UPDATER = 289,
12809    PSP_INIT_APITYPE_MS1 = 320,
12810    PSP_INIT_APITYPE_MS2 = 321,
12811    PSP_INIT_APITYPE_MS3 = 322,
12812    PSP_INIT_APITYPE_MS4 = 323,
12813    PSP_INIT_APITYPE_MS5 = 324,
12814    PSP_INIT_APITYPE_VSH1 = 528,
12815    PSP_INIT_APITYPE_VSH2 = 544,
12816}
12817#[repr(u32)]
12818#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
12819pub enum PSPKeyConfig {
12820    PSP_INIT_KEYCONFIG_VSH = 256,
12821    PSP_INIT_KEYCONFIG_GAME = 512,
12822    PSP_INIT_KEYCONFIG_POPS = 768,
12823}
12824extern "C" {
12825    /// Gets the api type
12826///
12827/// @return the api type in which the system has booted
12828    pub fn sceKernelInitApitype() -> libc::c_int;
12829}
12830extern "C" {
12831    /// Gets the filename of the executable to be launched after all modules of the api.
12832///
12833/// @return filename of executable or NULL if no executable found.
12834    pub fn sceKernelInitFileName() -> *mut libc::c_char;
12835}
12836extern "C" {
12837    /// Gets the device in which the application was launched.
12838///
12839/// @return the device code, one of PSPBootFrom values.
12840    pub fn sceKernelBootFrom() -> libc::c_int;
12841}
12842extern "C" {
12843    /// Get the key configuration in which the system has booted.
12844///
12845/// @return the key configuration code, one of PSPKeyConfig values
12846    pub fn InitForKernel_7233B5BC() -> libc::c_int;
12847}
12848extern "C" {
12849    /// Inits the MJpeg library
12850///
12851/// @return 0 on success, < 0 on error
12852    pub fn sceJpegInitMJpeg() -> libc::c_int;
12853}
12854extern "C" {
12855    /// Finishes the MJpeg library
12856///
12857/// @return 0 on success, < 0 on error
12858    pub fn sceJpegFinishMJpeg() -> libc::c_int;
12859}
12860extern "C" {
12861    /// Creates the decoder context.
12862///
12863/// @param width - The width of the frame
12864/// @param height - The height of the frame
12865///
12866/// @return 0 on success, < 0 on error
12867    pub fn sceJpegCreateMJpeg(width: libc::c_int, height: libc::c_int)
12868     -> libc::c_int;
12869}
12870extern "C" {
12871    /// Deletes the current decoder context.
12872///
12873/// @return 0 on success, < 0 on error
12874    pub fn sceJpegDeleteMJpeg() -> libc::c_int;
12875}
12876extern "C" {
12877    /// Decodes a mjpeg frame.
12878///
12879/// @param jpegbuf - the buffer with the mjpeg frame
12880/// @param size - size of the buffer pointed by jpegbuf
12881/// @param rgba - buffer where the decoded data in RGBA format will be stored.
12882/// It should have a size of (width * height * 4).
12883/// @param unk - Unknown, pass 0
12884///
12885/// @return (width * 65536) + height on success, < 0 on error
12886    pub fn sceJpegDecodeMJpeg(jpegbuf: *mut u8, size: SceSize,
12887                              rgba: *mut libc::c_void, unk: u32)
12888     -> libc::c_int;
12889}
12890/// Structure for LoadExecVSH* functions
12891#[repr(C)]
12892#[derive(Debug, Copy)]
12893pub struct SceKernelLoadExecVSHParam {
12894    /// Size of the structure in bytes
12895    pub size: SceSize,
12896    /// Size of the arguments string
12897    pub args: SceSize,
12898    /// Pointer to the arguments strings
12899    pub argp: *mut libc::c_void,
12900    /// The key, usually "game", "updater" or "vsh"
12901    pub key: *const libc::c_char,
12902    /// The size of the vshmain arguments
12903    pub vshmain_args_size: u32,
12904    /// vshmain arguments that will be passed to vshmain after the program has exited
12905    pub vshmain_args: *mut libc::c_void,
12906    /// "/kd/pspbtcnf_game.txt" or "/kd/pspbtcnf.txt" if not supplied (max. 256 chars)
12907    pub configfile: *mut libc::c_char,
12908    /// An unknown string (max. 256 chars) probably used in 2nd stage of loadexec
12909    pub unk4: u32,
12910    /// unknown flag default value = 0x10000
12911    pub unk5: u32,
12912}
12913#[test]
12914fn bindgen_test_layout_SceKernelLoadExecVSHParam() {
12915    assert_eq!(::core::mem::size_of::<SceKernelLoadExecVSHParam>() , 56usize ,
12916               concat ! (
12917               "Size of: " , stringify ! ( SceKernelLoadExecVSHParam ) ));
12918    assert_eq! (::core::mem::align_of::<SceKernelLoadExecVSHParam>() , 8usize
12919                , concat ! (
12920                "Alignment of " , stringify ! ( SceKernelLoadExecVSHParam )
12921                ));
12922    assert_eq! (unsafe {
12923                & ( * ( 0 as * const SceKernelLoadExecVSHParam ) ) . size as *
12924                const _ as usize } , 0usize , concat ! (
12925                "Alignment of field: " , stringify ! (
12926                SceKernelLoadExecVSHParam ) , "::" , stringify ! ( size ) ));
12927    assert_eq! (unsafe {
12928                & ( * ( 0 as * const SceKernelLoadExecVSHParam ) ) . args as *
12929                const _ as usize } , 4usize , concat ! (
12930                "Alignment of field: " , stringify ! (
12931                SceKernelLoadExecVSHParam ) , "::" , stringify ! ( args ) ));
12932    assert_eq! (unsafe {
12933                & ( * ( 0 as * const SceKernelLoadExecVSHParam ) ) . argp as *
12934                const _ as usize } , 8usize , concat ! (
12935                "Alignment of field: " , stringify ! (
12936                SceKernelLoadExecVSHParam ) , "::" , stringify ! ( argp ) ));
12937    assert_eq! (unsafe {
12938                & ( * ( 0 as * const SceKernelLoadExecVSHParam ) ) . key as *
12939                const _ as usize } , 16usize , concat ! (
12940                "Alignment of field: " , stringify ! (
12941                SceKernelLoadExecVSHParam ) , "::" , stringify ! ( key ) ));
12942    assert_eq! (unsafe {
12943                & ( * ( 0 as * const SceKernelLoadExecVSHParam ) ) .
12944                vshmain_args_size as * const _ as usize } , 24usize , concat !
12945                (
12946                "Alignment of field: " , stringify ! (
12947                SceKernelLoadExecVSHParam ) , "::" , stringify ! (
12948                vshmain_args_size ) ));
12949    assert_eq! (unsafe {
12950                & ( * ( 0 as * const SceKernelLoadExecVSHParam ) ) .
12951                vshmain_args as * const _ as usize } , 32usize , concat ! (
12952                "Alignment of field: " , stringify ! (
12953                SceKernelLoadExecVSHParam ) , "::" , stringify ! (
12954                vshmain_args ) ));
12955    assert_eq! (unsafe {
12956                & ( * ( 0 as * const SceKernelLoadExecVSHParam ) ) .
12957                configfile as * const _ as usize } , 40usize , concat ! (
12958                "Alignment of field: " , stringify ! (
12959                SceKernelLoadExecVSHParam ) , "::" , stringify ! ( configfile
12960                ) ));
12961    assert_eq! (unsafe {
12962                & ( * ( 0 as * const SceKernelLoadExecVSHParam ) ) . unk4 as *
12963                const _ as usize } , 48usize , concat ! (
12964                "Alignment of field: " , stringify ! (
12965                SceKernelLoadExecVSHParam ) , "::" , stringify ! ( unk4 ) ));
12966    assert_eq! (unsafe {
12967                & ( * ( 0 as * const SceKernelLoadExecVSHParam ) ) . unk5 as *
12968                const _ as usize } , 52usize , concat ! (
12969                "Alignment of field: " , stringify ! (
12970                SceKernelLoadExecVSHParam ) , "::" , stringify ! ( unk5 ) ));
12971}
12972impl Clone for SceKernelLoadExecVSHParam {
12973    fn clone(&self) -> Self { *self }
12974}
12975extern "C" {
12976    /// Executes a new executable from a buffer.
12977///
12978/// @param bufsize - Size in bytes of the buffer pointed by buf.
12979/// @param buf - Pointer to a buffer containing the module to execute.
12980/// @param param - Pointer to a ::SceKernelLoadExecParam structure, or NULL.
12981///
12982/// @return < 0 on some errors.
12983    pub fn sceKernelLoadExecBufferPlain(bufsize: SceSize,
12984                                        buf: *mut libc::c_void,
12985                                        param: *mut SceKernelLoadExecParam)
12986     -> libc::c_int;
12987}
12988extern "C" {
12989    /// Restart the vsh.
12990///
12991/// @param param - Pointer to a ::SceKernelLoadExecVSHParam structure, or NULL
12992///
12993/// @return < 0 on some errors.
12994///
12995/// @note - when called in game mode it will have the same effect that sceKernelExitGame
12996///
12997    pub fn sceKernelExitVSHVSH(param: *mut SceKernelLoadExecVSHParam)
12998     -> libc::c_int;
12999}
13000extern "C" {
13001    /// Executes a new executable from a disc.
13002/// It is the function used by the firmware to execute the EBOOT.BIN from a disc.
13003///
13004/// @param file - The file to execute.
13005/// @param param - Pointer to a ::SceKernelLoadExecVSHParam structure, or NULL.
13006///
13007/// @return < 0 on some errors.
13008    pub fn sceKernelLoadExecVSHDisc(file: *const libc::c_char,
13009                                    param: *mut SceKernelLoadExecVSHParam)
13010     -> libc::c_int;
13011}
13012extern "C" {
13013    /// Executes a new executable from a disc.
13014/// It is the function used by the firmware to execute an updater from a disc.
13015///
13016/// @param file - The file to execute.
13017/// @param param - Pointer to a ::SceKernelLoadExecVSHParam structure, or NULL.
13018///
13019/// @return < 0 on some errors.
13020    pub fn sceKernelLoadExecVSHDiscUpdater(file: *const libc::c_char,
13021                                           param:
13022                                               *mut SceKernelLoadExecVSHParam)
13023     -> libc::c_int;
13024}
13025extern "C" {
13026    /// Executes a new executable from a memory stick.
13027/// It is the function used by the firmware to execute an updater from a memory stick.
13028///
13029/// @param file - The file to execute.
13030/// @param param - Pointer to a ::SceKernelLoadExecVSHParam structure, or NULL.
13031///
13032/// @return < 0 on some errors.
13033    pub fn sceKernelLoadExecVSHMs1(file: *const libc::c_char,
13034                                   param: *mut SceKernelLoadExecVSHParam)
13035     -> libc::c_int;
13036}
13037extern "C" {
13038    /// Executes a new executable from a memory stick.
13039/// It is the function used by the firmware to execute games (and homebrew :P) from a memory stick.
13040///
13041/// @param file - The file to execute.
13042/// @param param - Pointer to a ::SceKernelLoadExecVSHParam structure, or NULL.
13043///
13044/// @return < 0 on some errors.
13045    pub fn sceKernelLoadExecVSHMs2(file: *const libc::c_char,
13046                                   param: *mut SceKernelLoadExecVSHParam)
13047     -> libc::c_int;
13048}
13049extern "C" {
13050    /// Executes a new executable from a memory stick.
13051/// It is the function used by the firmware to execute ... ?
13052///
13053/// @param file - The file to execute.
13054/// @param param - Pointer to a ::SceKernelLoadExecVSHParam structure, or NULL.
13055///
13056/// @return < 0 on some errors.
13057    pub fn sceKernelLoadExecVSHMs3(file: *const libc::c_char,
13058                                   param: *mut SceKernelLoadExecVSHParam)
13059     -> libc::c_int;
13060}
13061/// Structure to hold a single export entry
13062#[repr(C)]
13063#[derive(Debug, Copy)]
13064pub struct _PspLibraryEntry {
13065    pub name: *const libc::c_char,
13066    pub version: libc::c_ushort,
13067    pub attribute: libc::c_ushort,
13068    pub entLen: libc::c_uchar,
13069    pub varCount: libc::c_uchar,
13070    pub funcCount: libc::c_ushort,
13071    pub entrytable: *mut libc::c_void,
13072}
13073#[test]
13074fn bindgen_test_layout__PspLibraryEntry() {
13075    assert_eq!(::core::mem::size_of::<_PspLibraryEntry>() , 24usize , concat !
13076               ( "Size of: " , stringify ! ( _PspLibraryEntry ) ));
13077    assert_eq! (::core::mem::align_of::<_PspLibraryEntry>() , 8usize , concat
13078                ! ( "Alignment of " , stringify ! ( _PspLibraryEntry ) ));
13079    assert_eq! (unsafe {
13080                & ( * ( 0 as * const _PspLibraryEntry ) ) . name as * const _
13081                as usize } , 0usize , concat ! (
13082                "Alignment of field: " , stringify ! ( _PspLibraryEntry ) ,
13083                "::" , stringify ! ( name ) ));
13084    assert_eq! (unsafe {
13085                & ( * ( 0 as * const _PspLibraryEntry ) ) . version as * const
13086                _ as usize } , 8usize , concat ! (
13087                "Alignment of field: " , stringify ! ( _PspLibraryEntry ) ,
13088                "::" , stringify ! ( version ) ));
13089    assert_eq! (unsafe {
13090                & ( * ( 0 as * const _PspLibraryEntry ) ) . attribute as *
13091                const _ as usize } , 10usize , concat ! (
13092                "Alignment of field: " , stringify ! ( _PspLibraryEntry ) ,
13093                "::" , stringify ! ( attribute ) ));
13094    assert_eq! (unsafe {
13095                & ( * ( 0 as * const _PspLibraryEntry ) ) . entLen as * const
13096                _ as usize } , 12usize , concat ! (
13097                "Alignment of field: " , stringify ! ( _PspLibraryEntry ) ,
13098                "::" , stringify ! ( entLen ) ));
13099    assert_eq! (unsafe {
13100                & ( * ( 0 as * const _PspLibraryEntry ) ) . varCount as *
13101                const _ as usize } , 13usize , concat ! (
13102                "Alignment of field: " , stringify ! ( _PspLibraryEntry ) ,
13103                "::" , stringify ! ( varCount ) ));
13104    assert_eq! (unsafe {
13105                & ( * ( 0 as * const _PspLibraryEntry ) ) . funcCount as *
13106                const _ as usize } , 14usize , concat ! (
13107                "Alignment of field: " , stringify ! ( _PspLibraryEntry ) ,
13108                "::" , stringify ! ( funcCount ) ));
13109    assert_eq! (unsafe {
13110                & ( * ( 0 as * const _PspLibraryEntry ) ) . entrytable as *
13111                const _ as usize } , 16usize , concat ! (
13112                "Alignment of field: " , stringify ! ( _PspLibraryEntry ) ,
13113                "::" , stringify ! ( entrytable ) ));
13114}
13115impl Clone for _PspLibraryEntry {
13116    fn clone(&self) -> Self { *self }
13117}
13118#[repr(C)]
13119#[derive(Debug, Copy)]
13120pub struct SceMp3InitArg {
13121    /// Stream start position
13122    pub mp3StreamStart: SceUInt32,
13123    /// Unknown - set to 0
13124    pub unk1: SceUInt32,
13125    /// Stream end position
13126    pub mp3StreamEnd: SceUInt32,
13127    /// Unknown - set to 0
13128    pub unk2: SceUInt32,
13129    /// Pointer to a buffer to contain raw mp3 stream data (+1472 bytes workspace)
13130    pub mp3Buf: *mut SceVoid,
13131    /// Size of mp3Buf buffer (must be >= 8192)
13132    pub mp3BufSize: SceInt32,
13133    /// Pointer to decoded pcm samples buffer
13134    pub pcmBuf: *mut SceVoid,
13135    /// Size of pcmBuf buffer (must be >= 9216)
13136    pub pcmBufSize: SceInt32,
13137}
13138#[test]
13139fn bindgen_test_layout_SceMp3InitArg() {
13140    assert_eq!(::core::mem::size_of::<SceMp3InitArg>() , 48usize , concat ! (
13141               "Size of: " , stringify ! ( SceMp3InitArg ) ));
13142    assert_eq! (::core::mem::align_of::<SceMp3InitArg>() , 8usize , concat ! (
13143                "Alignment of " , stringify ! ( SceMp3InitArg ) ));
13144    assert_eq! (unsafe {
13145                & ( * ( 0 as * const SceMp3InitArg ) ) . mp3StreamStart as *
13146                const _ as usize } , 0usize , concat ! (
13147                "Alignment of field: " , stringify ! ( SceMp3InitArg ) , "::"
13148                , stringify ! ( mp3StreamStart ) ));
13149    assert_eq! (unsafe {
13150                & ( * ( 0 as * const SceMp3InitArg ) ) . unk1 as * const _ as
13151                usize } , 4usize , concat ! (
13152                "Alignment of field: " , stringify ! ( SceMp3InitArg ) , "::"
13153                , stringify ! ( unk1 ) ));
13154    assert_eq! (unsafe {
13155                & ( * ( 0 as * const SceMp3InitArg ) ) . mp3StreamEnd as *
13156                const _ as usize } , 8usize , concat ! (
13157                "Alignment of field: " , stringify ! ( SceMp3InitArg ) , "::"
13158                , stringify ! ( mp3StreamEnd ) ));
13159    assert_eq! (unsafe {
13160                & ( * ( 0 as * const SceMp3InitArg ) ) . unk2 as * const _ as
13161                usize } , 12usize , concat ! (
13162                "Alignment of field: " , stringify ! ( SceMp3InitArg ) , "::"
13163                , stringify ! ( unk2 ) ));
13164    assert_eq! (unsafe {
13165                & ( * ( 0 as * const SceMp3InitArg ) ) . mp3Buf as * const _
13166                as usize } , 16usize , concat ! (
13167                "Alignment of field: " , stringify ! ( SceMp3InitArg ) , "::"
13168                , stringify ! ( mp3Buf ) ));
13169    assert_eq! (unsafe {
13170                & ( * ( 0 as * const SceMp3InitArg ) ) . mp3BufSize as * const
13171                _ as usize } , 24usize , concat ! (
13172                "Alignment of field: " , stringify ! ( SceMp3InitArg ) , "::"
13173                , stringify ! ( mp3BufSize ) ));
13174    assert_eq! (unsafe {
13175                & ( * ( 0 as * const SceMp3InitArg ) ) . pcmBuf as * const _
13176                as usize } , 32usize , concat ! (
13177                "Alignment of field: " , stringify ! ( SceMp3InitArg ) , "::"
13178                , stringify ! ( pcmBuf ) ));
13179    assert_eq! (unsafe {
13180                & ( * ( 0 as * const SceMp3InitArg ) ) . pcmBufSize as * const
13181                _ as usize } , 40usize , concat ! (
13182                "Alignment of field: " , stringify ! ( SceMp3InitArg ) , "::"
13183                , stringify ! ( pcmBufSize ) ));
13184}
13185impl Clone for SceMp3InitArg {
13186    fn clone(&self) -> Self { *self }
13187}
13188extern "C" {
13189    /// sceMp3ReserveMp3Handle
13190///
13191/// @param args - Pointer to SceMp3InitArg structure
13192///
13193/// @return sceMp3 handle on success, < 0 on error.
13194    pub fn sceMp3ReserveMp3Handle(args: *mut SceMp3InitArg) -> SceInt32;
13195}
13196extern "C" {
13197    /// sceMp3ReleaseMp3Handle
13198///
13199/// @param handle - sceMp3 handle
13200///
13201/// @return 0 if success, < 0 on error.
13202    pub fn sceMp3ReleaseMp3Handle(handle: SceInt32) -> SceInt32;
13203}
13204extern "C" {
13205    /// sceMp3InitResource
13206///
13207/// @return 0 if success, < 0 on error.
13208    pub fn sceMp3InitResource() -> SceInt32;
13209}
13210extern "C" {
13211    /// sceMp3TermResource
13212///
13213/// @return 0 if success, < 0 on error.
13214    pub fn sceMp3TermResource() -> SceInt32;
13215}
13216extern "C" {
13217    /// sceMp3Init
13218///
13219/// @param handle - sceMp3 handle
13220///
13221/// @return 0 if success, < 0 on error.
13222    pub fn sceMp3Init(handle: SceInt32) -> SceInt32;
13223}
13224extern "C" {
13225    /// sceMp3Decode
13226///
13227/// @param handle - sceMp3 handle
13228/// @param dst - Pointer to destination pcm samples buffer
13229///
13230/// @return number of bytes in decoded pcm buffer, < 0 on error.
13231    pub fn sceMp3Decode(handle: SceInt32, dst: *mut *mut SceShort16)
13232     -> SceInt32;
13233}
13234extern "C" {
13235    /// sceMp3GetInfoToAddStreamData
13236///
13237/// @param handle - sceMp3 handle
13238/// @param dst - Pointer to stream data buffer
13239/// @param towrite - Space remaining in stream data buffer
13240/// @param srcpos - Position in source stream to start reading from
13241///
13242/// @return 0 if success, < 0 on error.
13243    pub fn sceMp3GetInfoToAddStreamData(handle: SceInt32,
13244                                        dst: *mut *mut SceUChar8,
13245                                        towrite: *mut SceInt32,
13246                                        srcpos: *mut SceInt32) -> SceInt32;
13247}
13248extern "C" {
13249    /// sceMp3NotifyAddStreamData
13250///
13251/// @param handle - sceMp3 handle
13252/// @param size - number of bytes added to the stream data buffer
13253///
13254/// @return 0 if success, < 0 on error.
13255    pub fn sceMp3NotifyAddStreamData(handle: SceInt32, size: SceInt32)
13256     -> SceInt32;
13257}
13258extern "C" {
13259    /// sceMp3CheckStreamDataNeeded
13260///
13261/// @param handle - sceMp3 handle
13262///
13263/// @return 1 if more stream data is needed, < 0 on error.
13264    pub fn sceMp3CheckStreamDataNeeded(handle: SceInt32) -> SceInt32;
13265}
13266extern "C" {
13267    /// sceMp3SetLoopNum
13268///
13269/// @param handle - sceMp3 handle
13270/// @param loop - Number of loops
13271///
13272/// @return 0 if success, < 0 on error.
13273    pub fn sceMp3SetLoopNum(handle: SceInt32, loop_: SceInt32) -> SceInt32;
13274}
13275extern "C" {
13276    /// sceMp3GetLoopNum
13277///
13278/// @param handle - sceMp3 handle
13279///
13280/// @return Number of loops
13281    pub fn sceMp3GetLoopNum(handle: SceInt32) -> SceInt32;
13282}
13283extern "C" {
13284    /// sceMp3GetSumDecodedSample
13285///
13286/// @param handle - sceMp3 handle
13287///
13288/// @return Number of decoded samples
13289    pub fn sceMp3GetSumDecodedSample(handle: SceInt32) -> SceInt32;
13290}
13291extern "C" {
13292    /// sceMp3GetMaxOutputSample
13293///
13294/// @param handle - sceMp3 handle
13295///
13296/// @return Number of max samples to output
13297    pub fn sceMp3GetMaxOutputSample(handle: SceInt32) -> SceInt32;
13298}
13299extern "C" {
13300    /// sceMp3GetSamplingRate
13301///
13302/// @param handle - sceMp3 handle
13303///
13304/// @return Sampling rate of the mp3
13305    pub fn sceMp3GetSamplingRate(handle: SceInt32) -> SceInt32;
13306}
13307extern "C" {
13308    /// sceMp3GetBitRate
13309///
13310/// @param handle - sceMp3 handle
13311///
13312/// @return Bitrate of the mp3
13313    pub fn sceMp3GetBitRate(handle: SceInt32) -> SceInt32;
13314}
13315extern "C" {
13316    /// sceMp3GetMp3ChannelNum
13317///
13318/// @param handle - sceMp3 handle
13319///
13320/// @return Number of channels of the mp3
13321    pub fn sceMp3GetMp3ChannelNum(handle: SceInt32) -> SceInt32;
13322}
13323extern "C" {
13324    /// sceMp3ResetPlayPosition
13325///
13326/// @param handle - sceMp3 handle
13327///
13328/// @return < 0 on error
13329    pub fn sceMp3ResetPlayPosition(handle: SceInt32) -> SceInt32;
13330}
13331#[repr(C)]
13332#[derive(Copy)]
13333pub struct SceMpegLLI {
13334    pub pSrc: ScePVoid,
13335    pub pDst: ScePVoid,
13336    pub Next: ScePVoid,
13337    pub iSize: SceInt32,
13338    pub __bindgen_padding_0: [u32; 9usize],
13339}
13340#[test]
13341fn bindgen_test_layout_SceMpegLLI() {
13342    assert_eq!(::core::mem::size_of::<SceMpegLLI>() , 64usize , concat ! (
13343               "Size of: " , stringify ! ( SceMpegLLI ) ));
13344    assert_eq! (unsafe {
13345                & ( * ( 0 as * const SceMpegLLI ) ) . pSrc as * const _ as
13346                usize } , 0usize , concat ! (
13347                "Alignment of field: " , stringify ! ( SceMpegLLI ) , "::" ,
13348                stringify ! ( pSrc ) ));
13349    assert_eq! (unsafe {
13350                & ( * ( 0 as * const SceMpegLLI ) ) . pDst as * const _ as
13351                usize } , 8usize , concat ! (
13352                "Alignment of field: " , stringify ! ( SceMpegLLI ) , "::" ,
13353                stringify ! ( pDst ) ));
13354    assert_eq! (unsafe {
13355                & ( * ( 0 as * const SceMpegLLI ) ) . Next as * const _ as
13356                usize } , 16usize , concat ! (
13357                "Alignment of field: " , stringify ! ( SceMpegLLI ) , "::" ,
13358                stringify ! ( Next ) ));
13359    assert_eq! (unsafe {
13360                & ( * ( 0 as * const SceMpegLLI ) ) . iSize as * const _ as
13361                usize } , 24usize , concat ! (
13362                "Alignment of field: " , stringify ! ( SceMpegLLI ) , "::" ,
13363                stringify ! ( iSize ) ));
13364}
13365impl Clone for SceMpegLLI {
13366    fn clone(&self) -> Self { *self }
13367}
13368#[repr(C)]
13369#[derive(Copy)]
13370pub struct SceMpegYCrCbBuffer {
13371    pub iFrameBufferHeight16: SceInt32,
13372    pub iFrameBufferWidth16: SceInt32,
13373    pub iUnknown: SceInt32,
13374    pub iUnknown2: SceInt32,
13375    pub pYBuffer: ScePVoid,
13376    pub pYBuffer2: ScePVoid,
13377    pub pCrBuffer: ScePVoid,
13378    pub pCbBuffer: ScePVoid,
13379    pub pCrBuffer2: ScePVoid,
13380    pub pCbBuffer2: ScePVoid,
13381    pub iFrameHeight: SceInt32,
13382    pub iFrameWidth: SceInt32,
13383    pub iFrameBufferWidth: SceInt32,
13384    pub iUnknown3: [SceInt32; 11usize],
13385    pub __bindgen_padding_0: u64,
13386}
13387#[test]
13388fn bindgen_test_layout_SceMpegYCrCbBuffer() {
13389    assert_eq!(::core::mem::size_of::<SceMpegYCrCbBuffer>() , 128usize ,
13390               concat ! ( "Size of: " , stringify ! ( SceMpegYCrCbBuffer ) ));
13391    assert_eq! (unsafe {
13392                & ( * ( 0 as * const SceMpegYCrCbBuffer ) ) .
13393                iFrameBufferHeight16 as * const _ as usize } , 0usize , concat
13394                ! (
13395                "Alignment of field: " , stringify ! ( SceMpegYCrCbBuffer ) ,
13396                "::" , stringify ! ( iFrameBufferHeight16 ) ));
13397    assert_eq! (unsafe {
13398                & ( * ( 0 as * const SceMpegYCrCbBuffer ) ) .
13399                iFrameBufferWidth16 as * const _ as usize } , 4usize , concat
13400                ! (
13401                "Alignment of field: " , stringify ! ( SceMpegYCrCbBuffer ) ,
13402                "::" , stringify ! ( iFrameBufferWidth16 ) ));
13403    assert_eq! (unsafe {
13404                & ( * ( 0 as * const SceMpegYCrCbBuffer ) ) . iUnknown as *
13405                const _ as usize } , 8usize , concat ! (
13406                "Alignment of field: " , stringify ! ( SceMpegYCrCbBuffer ) ,
13407                "::" , stringify ! ( iUnknown ) ));
13408    assert_eq! (unsafe {
13409                & ( * ( 0 as * const SceMpegYCrCbBuffer ) ) . iUnknown2 as *
13410                const _ as usize } , 12usize , concat ! (
13411                "Alignment of field: " , stringify ! ( SceMpegYCrCbBuffer ) ,
13412                "::" , stringify ! ( iUnknown2 ) ));
13413    assert_eq! (unsafe {
13414                & ( * ( 0 as * const SceMpegYCrCbBuffer ) ) . pYBuffer as *
13415                const _ as usize } , 16usize , concat ! (
13416                "Alignment of field: " , stringify ! ( SceMpegYCrCbBuffer ) ,
13417                "::" , stringify ! ( pYBuffer ) ));
13418    assert_eq! (unsafe {
13419                & ( * ( 0 as * const SceMpegYCrCbBuffer ) ) . pYBuffer2 as *
13420                const _ as usize } , 24usize , concat ! (
13421                "Alignment of field: " , stringify ! ( SceMpegYCrCbBuffer ) ,
13422                "::" , stringify ! ( pYBuffer2 ) ));
13423    assert_eq! (unsafe {
13424                & ( * ( 0 as * const SceMpegYCrCbBuffer ) ) . pCrBuffer as *
13425                const _ as usize } , 32usize , concat ! (
13426                "Alignment of field: " , stringify ! ( SceMpegYCrCbBuffer ) ,
13427                "::" , stringify ! ( pCrBuffer ) ));
13428    assert_eq! (unsafe {
13429                & ( * ( 0 as * const SceMpegYCrCbBuffer ) ) . pCbBuffer as *
13430                const _ as usize } , 40usize , concat ! (
13431                "Alignment of field: " , stringify ! ( SceMpegYCrCbBuffer ) ,
13432                "::" , stringify ! ( pCbBuffer ) ));
13433    assert_eq! (unsafe {
13434                & ( * ( 0 as * const SceMpegYCrCbBuffer ) ) . pCrBuffer2 as *
13435                const _ as usize } , 48usize , concat ! (
13436                "Alignment of field: " , stringify ! ( SceMpegYCrCbBuffer ) ,
13437                "::" , stringify ! ( pCrBuffer2 ) ));
13438    assert_eq! (unsafe {
13439                & ( * ( 0 as * const SceMpegYCrCbBuffer ) ) . pCbBuffer2 as *
13440                const _ as usize } , 56usize , concat ! (
13441                "Alignment of field: " , stringify ! ( SceMpegYCrCbBuffer ) ,
13442                "::" , stringify ! ( pCbBuffer2 ) ));
13443    assert_eq! (unsafe {
13444                & ( * ( 0 as * const SceMpegYCrCbBuffer ) ) . iFrameHeight as
13445                * const _ as usize } , 64usize , concat ! (
13446                "Alignment of field: " , stringify ! ( SceMpegYCrCbBuffer ) ,
13447                "::" , stringify ! ( iFrameHeight ) ));
13448    assert_eq! (unsafe {
13449                & ( * ( 0 as * const SceMpegYCrCbBuffer ) ) . iFrameWidth as *
13450                const _ as usize } , 68usize , concat ! (
13451                "Alignment of field: " , stringify ! ( SceMpegYCrCbBuffer ) ,
13452                "::" , stringify ! ( iFrameWidth ) ));
13453    assert_eq! (unsafe {
13454                & ( * ( 0 as * const SceMpegYCrCbBuffer ) ) .
13455                iFrameBufferWidth as * const _ as usize } , 72usize , concat !
13456                (
13457                "Alignment of field: " , stringify ! ( SceMpegYCrCbBuffer ) ,
13458                "::" , stringify ! ( iFrameBufferWidth ) ));
13459    assert_eq! (unsafe {
13460                & ( * ( 0 as * const SceMpegYCrCbBuffer ) ) . iUnknown3 as *
13461                const _ as usize } , 76usize , concat ! (
13462                "Alignment of field: " , stringify ! ( SceMpegYCrCbBuffer ) ,
13463                "::" , stringify ! ( iUnknown3 ) ));
13464}
13465impl Clone for SceMpegYCrCbBuffer {
13466    fn clone(&self) -> Self { *self }
13467}
13468extern "C" {
13469    pub fn sceMpegBaseYCrCbCopyVme(YUVBuffer: ScePVoid, Buffer: *mut SceInt32,
13470                                   Type: SceInt32) -> SceInt32;
13471}
13472extern "C" {
13473    pub fn sceMpegBaseCscInit(width: SceInt32) -> SceInt32;
13474}
13475extern "C" {
13476    pub fn sceMpegBaseCscVme(pRGBbuffer: ScePVoid, pRGBbuffer2: ScePVoid,
13477                             width: SceInt32,
13478                             pYCrCbBuffer: *mut SceMpegYCrCbBuffer)
13479     -> SceInt32;
13480}
13481extern "C" {
13482    pub fn sceMpegbase_BEA18F91(pLLI: *mut SceMpegLLI) -> SceInt32;
13483}
13484/// points to "LIBMPEG"
13485pub type SceMpeg = ScePVoid;
13486/// some structure
13487pub type SceMpegStream = SceVoid;
13488/// Ringbuffer callback
13489pub type sceMpegRingbufferCB =
13490    ::core::option::Option<unsafe extern "C" fn(pData: ScePVoid,
13491                                                iNumPackets: SceInt32,
13492                                                pParam: ScePVoid)
13493                               -> SceInt32>;
13494#[repr(C)]
13495#[derive(Debug, Copy)]
13496pub struct SceMpegRingbuffer {
13497    /// packets
13498    pub iPackets: SceInt32,
13499    /// unknown
13500    pub iUnk0: SceUInt32,
13501    /// unknown
13502    pub iUnk1: SceUInt32,
13503    /// unknown
13504    pub iUnk2: SceUInt32,
13505    /// unknown
13506    pub iUnk3: SceUInt32,
13507    /// pointer to data
13508    pub pData: ScePVoid,
13509    /// ringbuffer callback
13510    pub Callback: sceMpegRingbufferCB,
13511    /// callback param
13512    pub pCBparam: ScePVoid,
13513    /// unknown
13514    pub iUnk4: SceUInt32,
13515    /// unknown
13516    pub iUnk5: SceUInt32,
13517    /// mpeg id
13518    pub pSceMpeg: SceMpeg,
13519}
13520#[test]
13521fn bindgen_test_layout_SceMpegRingbuffer() {
13522    assert_eq!(::core::mem::size_of::<SceMpegRingbuffer>() , 64usize , concat
13523               ! ( "Size of: " , stringify ! ( SceMpegRingbuffer ) ));
13524    assert_eq! (::core::mem::align_of::<SceMpegRingbuffer>() , 8usize , concat
13525                ! ( "Alignment of " , stringify ! ( SceMpegRingbuffer ) ));
13526    assert_eq! (unsafe {
13527                & ( * ( 0 as * const SceMpegRingbuffer ) ) . iPackets as *
13528                const _ as usize } , 0usize , concat ! (
13529                "Alignment of field: " , stringify ! ( SceMpegRingbuffer ) ,
13530                "::" , stringify ! ( iPackets ) ));
13531    assert_eq! (unsafe {
13532                & ( * ( 0 as * const SceMpegRingbuffer ) ) . iUnk0 as * const
13533                _ as usize } , 4usize , concat ! (
13534                "Alignment of field: " , stringify ! ( SceMpegRingbuffer ) ,
13535                "::" , stringify ! ( iUnk0 ) ));
13536    assert_eq! (unsafe {
13537                & ( * ( 0 as * const SceMpegRingbuffer ) ) . iUnk1 as * const
13538                _ as usize } , 8usize , concat ! (
13539                "Alignment of field: " , stringify ! ( SceMpegRingbuffer ) ,
13540                "::" , stringify ! ( iUnk1 ) ));
13541    assert_eq! (unsafe {
13542                & ( * ( 0 as * const SceMpegRingbuffer ) ) . iUnk2 as * const
13543                _ as usize } , 12usize , concat ! (
13544                "Alignment of field: " , stringify ! ( SceMpegRingbuffer ) ,
13545                "::" , stringify ! ( iUnk2 ) ));
13546    assert_eq! (unsafe {
13547                & ( * ( 0 as * const SceMpegRingbuffer ) ) . iUnk3 as * const
13548                _ as usize } , 16usize , concat ! (
13549                "Alignment of field: " , stringify ! ( SceMpegRingbuffer ) ,
13550                "::" , stringify ! ( iUnk3 ) ));
13551    assert_eq! (unsafe {
13552                & ( * ( 0 as * const SceMpegRingbuffer ) ) . pData as * const
13553                _ as usize } , 24usize , concat ! (
13554                "Alignment of field: " , stringify ! ( SceMpegRingbuffer ) ,
13555                "::" , stringify ! ( pData ) ));
13556    assert_eq! (unsafe {
13557                & ( * ( 0 as * const SceMpegRingbuffer ) ) . Callback as *
13558                const _ as usize } , 32usize , concat ! (
13559                "Alignment of field: " , stringify ! ( SceMpegRingbuffer ) ,
13560                "::" , stringify ! ( Callback ) ));
13561    assert_eq! (unsafe {
13562                & ( * ( 0 as * const SceMpegRingbuffer ) ) . pCBparam as *
13563                const _ as usize } , 40usize , concat ! (
13564                "Alignment of field: " , stringify ! ( SceMpegRingbuffer ) ,
13565                "::" , stringify ! ( pCBparam ) ));
13566    assert_eq! (unsafe {
13567                & ( * ( 0 as * const SceMpegRingbuffer ) ) . iUnk4 as * const
13568                _ as usize } , 48usize , concat ! (
13569                "Alignment of field: " , stringify ! ( SceMpegRingbuffer ) ,
13570                "::" , stringify ! ( iUnk4 ) ));
13571    assert_eq! (unsafe {
13572                & ( * ( 0 as * const SceMpegRingbuffer ) ) . iUnk5 as * const
13573                _ as usize } , 52usize , concat ! (
13574                "Alignment of field: " , stringify ! ( SceMpegRingbuffer ) ,
13575                "::" , stringify ! ( iUnk5 ) ));
13576    assert_eq! (unsafe {
13577                & ( * ( 0 as * const SceMpegRingbuffer ) ) . pSceMpeg as *
13578                const _ as usize } , 56usize , concat ! (
13579                "Alignment of field: " , stringify ! ( SceMpegRingbuffer ) ,
13580                "::" , stringify ! ( pSceMpeg ) ));
13581}
13582impl Clone for SceMpegRingbuffer {
13583    fn clone(&self) -> Self { *self }
13584}
13585#[repr(C)]
13586#[derive(Debug, Copy)]
13587pub struct SceMpegAu {
13588    /// presentation timestamp MSB
13589    pub iPtsMSB: SceUInt32,
13590    /// presentation timestamp LSB
13591    pub iPts: SceUInt32,
13592    /// decode timestamp MSB
13593    pub iDtsMSB: SceUInt32,
13594    /// decode timestamp LSB
13595    pub iDts: SceUInt32,
13596    /// Es buffer handle
13597    pub iEsBuffer: SceUInt32,
13598    /// Au size
13599    pub iAuSize: SceUInt32,
13600}
13601#[test]
13602fn bindgen_test_layout_SceMpegAu() {
13603    assert_eq!(::core::mem::size_of::<SceMpegAu>() , 24usize , concat ! (
13604               "Size of: " , stringify ! ( SceMpegAu ) ));
13605    assert_eq! (::core::mem::align_of::<SceMpegAu>() , 4usize , concat ! (
13606                "Alignment of " , stringify ! ( SceMpegAu ) ));
13607    assert_eq! (unsafe {
13608                & ( * ( 0 as * const SceMpegAu ) ) . iPtsMSB as * const _ as
13609                usize } , 0usize , concat ! (
13610                "Alignment of field: " , stringify ! ( SceMpegAu ) , "::" ,
13611                stringify ! ( iPtsMSB ) ));
13612    assert_eq! (unsafe {
13613                & ( * ( 0 as * const SceMpegAu ) ) . iPts as * const _ as
13614                usize } , 4usize , concat ! (
13615                "Alignment of field: " , stringify ! ( SceMpegAu ) , "::" ,
13616                stringify ! ( iPts ) ));
13617    assert_eq! (unsafe {
13618                & ( * ( 0 as * const SceMpegAu ) ) . iDtsMSB as * const _ as
13619                usize } , 8usize , concat ! (
13620                "Alignment of field: " , stringify ! ( SceMpegAu ) , "::" ,
13621                stringify ! ( iDtsMSB ) ));
13622    assert_eq! (unsafe {
13623                & ( * ( 0 as * const SceMpegAu ) ) . iDts as * const _ as
13624                usize } , 12usize , concat ! (
13625                "Alignment of field: " , stringify ! ( SceMpegAu ) , "::" ,
13626                stringify ! ( iDts ) ));
13627    assert_eq! (unsafe {
13628                & ( * ( 0 as * const SceMpegAu ) ) . iEsBuffer as * const _ as
13629                usize } , 16usize , concat ! (
13630                "Alignment of field: " , stringify ! ( SceMpegAu ) , "::" ,
13631                stringify ! ( iEsBuffer ) ));
13632    assert_eq! (unsafe {
13633                & ( * ( 0 as * const SceMpegAu ) ) . iAuSize as * const _ as
13634                usize } , 20usize , concat ! (
13635                "Alignment of field: " , stringify ! ( SceMpegAu ) , "::" ,
13636                stringify ! ( iAuSize ) ));
13637}
13638impl Clone for SceMpegAu {
13639    fn clone(&self) -> Self { *self }
13640}
13641#[repr(C)]
13642#[derive(Debug, Copy)]
13643pub struct SceMpegAvcMode {
13644    /// unknown, set to -1
13645    pub iUnk0: SceInt32,
13646    /// Decode pixelformat
13647    pub iPixelFormat: SceInt32,
13648}
13649#[test]
13650fn bindgen_test_layout_SceMpegAvcMode() {
13651    assert_eq!(::core::mem::size_of::<SceMpegAvcMode>() , 8usize , concat ! (
13652               "Size of: " , stringify ! ( SceMpegAvcMode ) ));
13653    assert_eq! (::core::mem::align_of::<SceMpegAvcMode>() , 4usize , concat !
13654                ( "Alignment of " , stringify ! ( SceMpegAvcMode ) ));
13655    assert_eq! (unsafe {
13656                & ( * ( 0 as * const SceMpegAvcMode ) ) . iUnk0 as * const _
13657                as usize } , 0usize , concat ! (
13658                "Alignment of field: " , stringify ! ( SceMpegAvcMode ) , "::"
13659                , stringify ! ( iUnk0 ) ));
13660    assert_eq! (unsafe {
13661                & ( * ( 0 as * const SceMpegAvcMode ) ) . iPixelFormat as *
13662                const _ as usize } , 4usize , concat ! (
13663                "Alignment of field: " , stringify ! ( SceMpegAvcMode ) , "::"
13664                , stringify ! ( iPixelFormat ) ));
13665}
13666impl Clone for SceMpegAvcMode {
13667    fn clone(&self) -> Self { *self }
13668}
13669extern "C" {
13670    /// sceMpegInit
13671///
13672/// @return 0 if success.
13673    pub fn sceMpegInit() -> SceInt32;
13674}
13675extern "C" {
13676    /// sceMpegFinish
13677    pub fn sceMpegFinish() -> SceVoid;
13678}
13679extern "C" {
13680    /// sceMpegRingbufferQueryMemSize
13681///
13682/// @param iPackets - number of packets in the ringbuffer
13683///
13684/// @return < 0 if error else ringbuffer data size.
13685    pub fn sceMpegRingbufferQueryMemSize(iPackets: SceInt32) -> SceInt32;
13686}
13687extern "C" {
13688    /// sceMpegRingbufferConstruct
13689///
13690/// @param Ringbuffer - pointer to a sceMpegRingbuffer struct
13691/// @param iPackets - number of packets in the ringbuffer
13692/// @param pData - pointer to allocated memory
13693/// @param iSize - size of allocated memory, shoud be sceMpegRingbufferQueryMemSize(iPackets)
13694/// @param Callback - ringbuffer callback
13695/// @param pCBparam - param passed to callback
13696///
13697/// @return 0 if success.
13698    pub fn sceMpegRingbufferConstruct(Ringbuffer: *mut SceMpegRingbuffer,
13699                                      iPackets: SceInt32, pData: ScePVoid,
13700                                      iSize: SceInt32,
13701                                      Callback: sceMpegRingbufferCB,
13702                                      pCBparam: ScePVoid) -> SceInt32;
13703}
13704extern "C" {
13705    /// sceMpegRingbufferDestruct
13706///
13707/// @param Ringbuffer - pointer to a sceMpegRingbuffer struct
13708    pub fn sceMpegRingbufferDestruct(Ringbuffer: *mut SceMpegRingbuffer)
13709     -> SceVoid;
13710}
13711extern "C" {
13712    /// sceMpegQueryMemSize
13713///
13714/// @param Ringbuffer - pointer to a sceMpegRingbuffer struct
13715///
13716/// @return < 0 if error else number of free packets in the ringbuffer.
13717    pub fn sceMpegRingbufferAvailableSize(Ringbuffer: *mut SceMpegRingbuffer)
13718     -> SceInt32;
13719}
13720extern "C" {
13721    /// sceMpegRingbufferPut
13722///
13723/// @param Ringbuffer - pointer to a sceMpegRingbuffer struct
13724/// @param iNumPackets - num packets to put into the ringbuffer
13725/// @param iAvailable - free packets in the ringbuffer, should be sceMpegRingbufferAvailableSize()
13726///
13727/// @return < 0 if error else number of packets.
13728    pub fn sceMpegRingbufferPut(Ringbuffer: *mut SceMpegRingbuffer,
13729                                iNumPackets: SceInt32, iAvailable: SceInt32)
13730     -> SceInt32;
13731}
13732extern "C" {
13733    /// sceMpegQueryMemSize
13734///
13735/// @param iUnk - Unknown, set to 0
13736///
13737/// @return < 0 if error else decoder data size.
13738    pub fn sceMpegQueryMemSize(iUnk: libc::c_int) -> SceInt32;
13739}
13740extern "C" {
13741    /// sceMpegCreate
13742///
13743/// @param Mpeg - will be filled
13744/// @param pData - pointer to allocated memory of size = sceMpegQueryMemSize()
13745/// @param iSize - size of data, should be = sceMpegQueryMemSize()
13746/// @param Ringbuffer - a ringbuffer
13747/// @param iFrameWidth - display buffer width, set to 512 if writing to framebuffer
13748/// @param iUnk1 - unknown, set to 0
13749/// @param iUnk2 - unknown, set to 0
13750///
13751/// @return 0 if success.
13752    pub fn sceMpegCreate(Mpeg: *mut SceMpeg, pData: ScePVoid, iSize: SceInt32,
13753                         Ringbuffer: *mut SceMpegRingbuffer,
13754                         iFrameWidth: SceInt32, iUnk1: SceInt32,
13755                         iUnk2: SceInt32) -> SceInt32;
13756}
13757extern "C" {
13758    /// sceMpegDelete
13759///
13760/// @param Mpeg - SceMpeg handle
13761    pub fn sceMpegDelete(Mpeg: *mut SceMpeg) -> SceVoid;
13762}
13763extern "C" {
13764    /// sceMpegQueryStreamOffset
13765///
13766/// @param Mpeg - SceMpeg handle
13767/// @param pBuffer - pointer to file header
13768/// @param iOffset - will contain stream offset in bytes, usually 2048
13769///
13770/// @return 0 if success.
13771    pub fn sceMpegQueryStreamOffset(Mpeg: *mut SceMpeg, pBuffer: ScePVoid,
13772                                    iOffset: *mut SceInt32) -> SceInt32;
13773}
13774extern "C" {
13775    /// sceMpegQueryStreamSize
13776///
13777/// @param pBuffer - pointer to file header
13778/// @param iSize - will contain stream size in bytes
13779///
13780/// @return 0 if success.
13781    pub fn sceMpegQueryStreamSize(pBuffer: ScePVoid, iSize: *mut SceInt32)
13782     -> SceInt32;
13783}
13784extern "C" {
13785    /// sceMpegRegistStream
13786///
13787/// @param Mpeg - SceMpeg handle
13788/// @param iStreamID - stream id, 0 for video, 1 for audio
13789/// @param iUnk - unknown, set to 0
13790///
13791/// @return 0 if error.
13792    pub fn sceMpegRegistStream(Mpeg: *mut SceMpeg, iStreamID: SceInt32,
13793                               iUnk: SceInt32) -> *mut SceMpegStream;
13794}
13795extern "C" {
13796    /// sceMpegUnRegistStream
13797///
13798/// @param Mpeg - SceMpeg handle
13799/// @param pStream - pointer to stream
13800    pub fn sceMpegUnRegistStream(Mpeg: SceMpeg, pStream: *mut SceMpegStream)
13801     -> SceVoid;
13802}
13803extern "C" {
13804    /// sceMpegFlushAllStreams
13805///
13806/// @return 0 if success.
13807    pub fn sceMpegFlushAllStream(Mpeg: *mut SceMpeg) -> SceInt32;
13808}
13809extern "C" {
13810    /// sceMpegMallocAvcEsBuf
13811///
13812/// @return 0 if error else pointer to buffer.
13813    pub fn sceMpegMallocAvcEsBuf(Mpeg: *mut SceMpeg) -> ScePVoid;
13814}
13815extern "C" {
13816    /// sceMpegFreeAvcEsBuf
13817///
13818    pub fn sceMpegFreeAvcEsBuf(Mpeg: *mut SceMpeg, pBuf: ScePVoid) -> SceVoid;
13819}
13820extern "C" {
13821    /// sceMpegQueryAtracEsSize
13822///
13823/// @param Mpeg - SceMpeg handle
13824/// @param iEsSize - will contain size of Es
13825/// @param iOutSize - will contain size of decoded data
13826///
13827/// @return 0 if success.
13828    pub fn sceMpegQueryAtracEsSize(Mpeg: *mut SceMpeg, iEsSize: *mut SceInt32,
13829                                   iOutSize: *mut SceInt32) -> SceInt32;
13830}
13831extern "C" {
13832    /// sceMpegInitAu
13833///
13834/// @param Mpeg - SceMpeg handle
13835/// @param pEsBuffer - prevously allocated Es buffer
13836/// @param pAu - will contain pointer to Au
13837///
13838/// @return 0 if success.
13839    pub fn sceMpegInitAu(Mpeg: *mut SceMpeg, pEsBuffer: ScePVoid,
13840                         pAu: *mut SceMpegAu) -> SceInt32;
13841}
13842extern "C" {
13843    /// sceMpegGetAvcAu
13844///
13845/// @param Mpeg - SceMpeg handle
13846/// @param pStream - associated stream
13847/// @param pAu - will contain pointer to Au
13848/// @param iUnk - unknown
13849///
13850/// @return 0 if success.
13851    pub fn sceMpegGetAvcAu(Mpeg: *mut SceMpeg, pStream: *mut SceMpegStream,
13852                           pAu: *mut SceMpegAu, iUnk: *mut SceInt32)
13853     -> SceInt32;
13854}
13855extern "C" {
13856    /// sceMpegAvcDecodeMode
13857///
13858/// @param Mpeg - SceMpeg handle
13859/// @param pMode - pointer to SceMpegAvcMode struct defining the decode mode (pixelformat)
13860/// @return 0 if success.
13861    pub fn sceMpegAvcDecodeMode(Mpeg: *mut SceMpeg,
13862                                pMode: *mut SceMpegAvcMode) -> SceInt32;
13863}
13864extern "C" {
13865    /// sceMpegAvcDecode
13866///
13867/// @param Mpeg - SceMpeg handle
13868/// @param pAu - video Au
13869/// @param iFrameWidth - output buffer width, set to 512 if writing to framebuffer
13870/// @param pBuffer - buffer that will contain the decoded frame
13871/// @param iInit - will be set to 0 on first call, then 1
13872///
13873/// @return 0 if success.
13874    pub fn sceMpegAvcDecode(Mpeg: *mut SceMpeg, pAu: *mut SceMpegAu,
13875                            iFrameWidth: SceInt32, pBuffer: ScePVoid,
13876                            iInit: *mut SceInt32) -> SceInt32;
13877}
13878extern "C" {
13879    /// sceMpegAvcDecodeStop
13880///
13881/// @param Mpeg - SceMpeg handle
13882/// @param iFrameWidth - output buffer width, set to 512 if writing to framebuffer
13883/// @param pBuffer - buffer that will contain the decoded frame
13884/// @param iStatus - frame number
13885///
13886/// @return 0 if success.
13887    pub fn sceMpegAvcDecodeStop(Mpeg: *mut SceMpeg, iFrameWidth: SceInt32,
13888                                pBuffer: ScePVoid, iStatus: *mut SceInt32)
13889     -> SceInt32;
13890}
13891extern "C" {
13892    /// sceMpegGetAtracAu
13893///
13894/// @param Mpeg - SceMpeg handle
13895/// @param pStream - associated stream
13896/// @param pAu - will contain pointer to Au
13897/// @param pUnk - unknown
13898///
13899/// @return 0 if success.
13900    pub fn sceMpegGetAtracAu(Mpeg: *mut SceMpeg, pStream: *mut SceMpegStream,
13901                             pAu: *mut SceMpegAu, pUnk: ScePVoid) -> SceInt32;
13902}
13903extern "C" {
13904    /// sceMpegAtracDecode
13905///
13906/// @param Mpeg - SceMpeg handle
13907/// @param pAu - video Au
13908/// @param pBuffer - buffer that will contain the decoded frame
13909/// @param iInit - set this to 1 on first call
13910///
13911/// @return 0 if success.
13912    pub fn sceMpegAtracDecode(Mpeg: *mut SceMpeg, pAu: *mut SceMpegAu,
13913                              pBuffer: ScePVoid, iInit: SceInt32) -> SceInt32;
13914}
13915extern "C" {
13916    pub fn sceNandSetWriteProtect(protectFlag: libc::c_int) -> libc::c_int;
13917}
13918extern "C" {
13919    pub fn sceNandLock(writeFlag: libc::c_int) -> libc::c_int;
13920}
13921extern "C" {
13922    pub fn sceNandUnlock();
13923}
13924extern "C" {
13925    pub fn sceNandReadStatus() -> libc::c_int;
13926}
13927extern "C" {
13928    pub fn sceNandReset(flag: libc::c_int) -> libc::c_int;
13929}
13930extern "C" {
13931    pub fn sceNandReadId(buf: *mut libc::c_void, size: SceSize)
13932     -> libc::c_int;
13933}
13934extern "C" {
13935    pub fn sceNandReadPages(ppn: u32, buf: *mut libc::c_void,
13936                            buf2: *mut libc::c_void, count: u32)
13937     -> libc::c_int;
13938}
13939extern "C" {
13940    pub fn sceNandGetPageSize() -> libc::c_int;
13941}
13942extern "C" {
13943    pub fn sceNandGetPagesPerBlock() -> libc::c_int;
13944}
13945extern "C" {
13946    pub fn sceNandGetTotalBlocks() -> libc::c_int;
13947}
13948extern "C" {
13949    pub fn sceNandReadBlockWithRetry(ppn: u32, buf: *mut libc::c_void,
13950                                     buf2: *mut libc::c_void) -> libc::c_int;
13951}
13952extern "C" {
13953    pub fn sceNandIsBadBlock(ppn: u32) -> libc::c_int;
13954}
13955/// Product structure
13956#[repr(C)]
13957#[derive(Debug, Copy)]
13958pub struct productStruct {
13959    /// Unknown, set to 0, other values used are 1 and 2. Not sure on what they represent
13960    pub unknown: libc::c_int,
13961    /// The product ID string
13962    pub product: [libc::c_char; 9usize],
13963    pub unk: [libc::c_char; 3usize],
13964}
13965#[test]
13966fn bindgen_test_layout_productStruct() {
13967    assert_eq!(::core::mem::size_of::<productStruct>() , 16usize , concat ! (
13968               "Size of: " , stringify ! ( productStruct ) ));
13969    assert_eq! (::core::mem::align_of::<productStruct>() , 4usize , concat ! (
13970                "Alignment of " , stringify ! ( productStruct ) ));
13971    assert_eq! (unsafe {
13972                & ( * ( 0 as * const productStruct ) ) . unknown as * const _
13973                as usize } , 0usize , concat ! (
13974                "Alignment of field: " , stringify ! ( productStruct ) , "::"
13975                , stringify ! ( unknown ) ));
13976    assert_eq! (unsafe {
13977                & ( * ( 0 as * const productStruct ) ) . product as * const _
13978                as usize } , 4usize , concat ! (
13979                "Alignment of field: " , stringify ! ( productStruct ) , "::"
13980                , stringify ! ( product ) ));
13981    assert_eq! (unsafe {
13982                & ( * ( 0 as * const productStruct ) ) . unk as * const _ as
13983                usize } , 13usize , concat ! (
13984                "Alignment of field: " , stringify ! ( productStruct ) , "::"
13985                , stringify ! ( unk ) ));
13986}
13987impl Clone for productStruct {
13988    fn clone(&self) -> Self { *self }
13989}
13990/// Peer info structure
13991#[repr(C)]
13992#[derive(Copy)]
13993pub struct SceNetAdhocctlPeerInfo {
13994    pub next: *mut SceNetAdhocctlPeerInfo,
13995    /// Nickname
13996    pub nickname: [libc::c_char; 128usize],
13997    /// Mac address
13998    pub mac: [libc::c_uchar; 6usize],
13999    /// Unknown
14000    pub unknown: [libc::c_uchar; 6usize],
14001    /// Time stamp
14002    pub timestamp: libc::c_ulong,
14003}
14004#[test]
14005fn bindgen_test_layout_SceNetAdhocctlPeerInfo() {
14006    assert_eq!(::core::mem::size_of::<SceNetAdhocctlPeerInfo>() , 160usize ,
14007               concat ! ( "Size of: " , stringify ! ( SceNetAdhocctlPeerInfo )
14008               ));
14009    assert_eq! (::core::mem::align_of::<SceNetAdhocctlPeerInfo>() , 8usize ,
14010                concat ! (
14011                "Alignment of " , stringify ! ( SceNetAdhocctlPeerInfo ) ));
14012    assert_eq! (unsafe {
14013                & ( * ( 0 as * const SceNetAdhocctlPeerInfo ) ) . next as *
14014                const _ as usize } , 0usize , concat ! (
14015                "Alignment of field: " , stringify ! ( SceNetAdhocctlPeerInfo
14016                ) , "::" , stringify ! ( next ) ));
14017    assert_eq! (unsafe {
14018                & ( * ( 0 as * const SceNetAdhocctlPeerInfo ) ) . nickname as
14019                * const _ as usize } , 8usize , concat ! (
14020                "Alignment of field: " , stringify ! ( SceNetAdhocctlPeerInfo
14021                ) , "::" , stringify ! ( nickname ) ));
14022    assert_eq! (unsafe {
14023                & ( * ( 0 as * const SceNetAdhocctlPeerInfo ) ) . mac as *
14024                const _ as usize } , 136usize , concat ! (
14025                "Alignment of field: " , stringify ! ( SceNetAdhocctlPeerInfo
14026                ) , "::" , stringify ! ( mac ) ));
14027    assert_eq! (unsafe {
14028                & ( * ( 0 as * const SceNetAdhocctlPeerInfo ) ) . unknown as *
14029                const _ as usize } , 142usize , concat ! (
14030                "Alignment of field: " , stringify ! ( SceNetAdhocctlPeerInfo
14031                ) , "::" , stringify ! ( unknown ) ));
14032    assert_eq! (unsafe {
14033                & ( * ( 0 as * const SceNetAdhocctlPeerInfo ) ) . timestamp as
14034                * const _ as usize } , 152usize , concat ! (
14035                "Alignment of field: " , stringify ! ( SceNetAdhocctlPeerInfo
14036                ) , "::" , stringify ! ( timestamp ) ));
14037}
14038impl Clone for SceNetAdhocctlPeerInfo {
14039    fn clone(&self) -> Self { *self }
14040}
14041/// Scan info structure
14042#[repr(C)]
14043#[derive(Debug, Copy)]
14044pub struct SceNetAdhocctlScanInfo {
14045    pub next: *mut SceNetAdhocctlScanInfo,
14046    /// Channel number
14047    pub channel: libc::c_int,
14048    /// Name of the connection (alphanumeric characters only)
14049    pub name: [libc::c_char; 8usize],
14050    /// The BSSID
14051    pub bssid: [libc::c_uchar; 6usize],
14052    /// Unknown
14053    pub unknown: [libc::c_uchar; 2usize],
14054    /// Unknown
14055    pub unknown2: libc::c_int,
14056}
14057#[test]
14058fn bindgen_test_layout_SceNetAdhocctlScanInfo() {
14059    assert_eq!(::core::mem::size_of::<SceNetAdhocctlScanInfo>() , 32usize ,
14060               concat ! ( "Size of: " , stringify ! ( SceNetAdhocctlScanInfo )
14061               ));
14062    assert_eq! (::core::mem::align_of::<SceNetAdhocctlScanInfo>() , 8usize ,
14063                concat ! (
14064                "Alignment of " , stringify ! ( SceNetAdhocctlScanInfo ) ));
14065    assert_eq! (unsafe {
14066                & ( * ( 0 as * const SceNetAdhocctlScanInfo ) ) . next as *
14067                const _ as usize } , 0usize , concat ! (
14068                "Alignment of field: " , stringify ! ( SceNetAdhocctlScanInfo
14069                ) , "::" , stringify ! ( next ) ));
14070    assert_eq! (unsafe {
14071                & ( * ( 0 as * const SceNetAdhocctlScanInfo ) ) . channel as *
14072                const _ as usize } , 8usize , concat ! (
14073                "Alignment of field: " , stringify ! ( SceNetAdhocctlScanInfo
14074                ) , "::" , stringify ! ( channel ) ));
14075    assert_eq! (unsafe {
14076                & ( * ( 0 as * const SceNetAdhocctlScanInfo ) ) . name as *
14077                const _ as usize } , 12usize , concat ! (
14078                "Alignment of field: " , stringify ! ( SceNetAdhocctlScanInfo
14079                ) , "::" , stringify ! ( name ) ));
14080    assert_eq! (unsafe {
14081                & ( * ( 0 as * const SceNetAdhocctlScanInfo ) ) . bssid as *
14082                const _ as usize } , 20usize , concat ! (
14083                "Alignment of field: " , stringify ! ( SceNetAdhocctlScanInfo
14084                ) , "::" , stringify ! ( bssid ) ));
14085    assert_eq! (unsafe {
14086                & ( * ( 0 as * const SceNetAdhocctlScanInfo ) ) . unknown as *
14087                const _ as usize } , 26usize , concat ! (
14088                "Alignment of field: " , stringify ! ( SceNetAdhocctlScanInfo
14089                ) , "::" , stringify ! ( unknown ) ));
14090    assert_eq! (unsafe {
14091                & ( * ( 0 as * const SceNetAdhocctlScanInfo ) ) . unknown2 as
14092                * const _ as usize } , 28usize , concat ! (
14093                "Alignment of field: " , stringify ! ( SceNetAdhocctlScanInfo
14094                ) , "::" , stringify ! ( unknown2 ) ));
14095}
14096impl Clone for SceNetAdhocctlScanInfo {
14097    fn clone(&self) -> Self { *self }
14098}
14099#[repr(C)]
14100#[derive(Debug, Copy)]
14101pub struct SceNetAdhocctlGameModeInfo {
14102    /// Number of peers (including self)
14103    pub count: libc::c_int,
14104    /// MAC addresses of peers (including self)
14105    pub macs: [[libc::c_uchar; 6usize]; 16usize],
14106}
14107#[test]
14108fn bindgen_test_layout_SceNetAdhocctlGameModeInfo() {
14109    assert_eq!(::core::mem::size_of::<SceNetAdhocctlGameModeInfo>() , 100usize
14110               , concat ! (
14111               "Size of: " , stringify ! ( SceNetAdhocctlGameModeInfo ) ));
14112    assert_eq! (::core::mem::align_of::<SceNetAdhocctlGameModeInfo>() , 4usize
14113                , concat ! (
14114                "Alignment of " , stringify ! ( SceNetAdhocctlGameModeInfo )
14115                ));
14116    assert_eq! (unsafe {
14117                & ( * ( 0 as * const SceNetAdhocctlGameModeInfo ) ) . count as
14118                * const _ as usize } , 0usize , concat ! (
14119                "Alignment of field: " , stringify ! (
14120                SceNetAdhocctlGameModeInfo ) , "::" , stringify ! ( count )
14121                ));
14122    assert_eq! (unsafe {
14123                & ( * ( 0 as * const SceNetAdhocctlGameModeInfo ) ) . macs as
14124                * const _ as usize } , 4usize , concat ! (
14125                "Alignment of field: " , stringify ! (
14126                SceNetAdhocctlGameModeInfo ) , "::" , stringify ! ( macs ) ));
14127}
14128impl Clone for SceNetAdhocctlGameModeInfo {
14129    fn clone(&self) -> Self { *self }
14130}
14131/// Params structure
14132#[repr(C)]
14133#[derive(Copy)]
14134pub struct SceNetAdhocctlParams {
14135    /// Channel number
14136    pub channel: libc::c_int,
14137    /// Name of the connection
14138    pub name: [libc::c_char; 8usize],
14139    /// The BSSID
14140    pub bssid: [libc::c_uchar; 6usize],
14141    /// Nickname
14142    pub nickname: [libc::c_char; 128usize],
14143}
14144#[test]
14145fn bindgen_test_layout_SceNetAdhocctlParams() {
14146    assert_eq!(::core::mem::size_of::<SceNetAdhocctlParams>() , 148usize ,
14147               concat ! ( "Size of: " , stringify ! ( SceNetAdhocctlParams )
14148               ));
14149    assert_eq! (::core::mem::align_of::<SceNetAdhocctlParams>() , 4usize ,
14150                concat ! (
14151                "Alignment of " , stringify ! ( SceNetAdhocctlParams ) ));
14152    assert_eq! (unsafe {
14153                & ( * ( 0 as * const SceNetAdhocctlParams ) ) . channel as *
14154                const _ as usize } , 0usize , concat ! (
14155                "Alignment of field: " , stringify ! ( SceNetAdhocctlParams )
14156                , "::" , stringify ! ( channel ) ));
14157    assert_eq! (unsafe {
14158                & ( * ( 0 as * const SceNetAdhocctlParams ) ) . name as *
14159                const _ as usize } , 4usize , concat ! (
14160                "Alignment of field: " , stringify ! ( SceNetAdhocctlParams )
14161                , "::" , stringify ! ( name ) ));
14162    assert_eq! (unsafe {
14163                & ( * ( 0 as * const SceNetAdhocctlParams ) ) . bssid as *
14164                const _ as usize } , 12usize , concat ! (
14165                "Alignment of field: " , stringify ! ( SceNetAdhocctlParams )
14166                , "::" , stringify ! ( bssid ) ));
14167    assert_eq! (unsafe {
14168                & ( * ( 0 as * const SceNetAdhocctlParams ) ) . nickname as *
14169                const _ as usize } , 18usize , concat ! (
14170                "Alignment of field: " , stringify ! ( SceNetAdhocctlParams )
14171                , "::" , stringify ! ( nickname ) ));
14172}
14173impl Clone for SceNetAdhocctlParams {
14174    fn clone(&self) -> Self { *self }
14175}
14176extern "C" {
14177    /// Initialise the Adhoc control library
14178///
14179/// @param stacksize - Stack size of the adhocctl thread. Set to 0x2000
14180/// @param priority - Priority of the adhocctl thread. Set to 0x30
14181/// @param product - Pass a filled in ::productStruct
14182///
14183/// @return 0 on success, < 0 on error
14184    pub fn sceNetAdhocctlInit(stacksize: libc::c_int, priority: libc::c_int,
14185                              product: *mut productStruct) -> libc::c_int;
14186}
14187extern "C" {
14188    /// Terminate the Adhoc control library
14189///
14190/// @return 0 on success, < on error.
14191    pub fn sceNetAdhocctlTerm() -> libc::c_int;
14192}
14193extern "C" {
14194    /// Connect to the Adhoc control
14195///
14196/// @param name - The name of the connection (maximum 8 alphanumeric characters).
14197///
14198/// @return 0 on success, < 0 on error.
14199    pub fn sceNetAdhocctlConnect(name: *const libc::c_char) -> libc::c_int;
14200}
14201extern "C" {
14202    /// Disconnect from the Adhoc control
14203///
14204/// @return 0 on success, < 0 on error
14205    pub fn sceNetAdhocctlDisconnect() -> libc::c_int;
14206}
14207extern "C" {
14208    /// Get the state of the Adhoc control
14209///
14210/// @param event - Pointer to an integer to receive the status. Can continue when it becomes 1.
14211///
14212/// @return 0 on success, < 0 on error
14213    pub fn sceNetAdhocctlGetState(event: *mut libc::c_int) -> libc::c_int;
14214}
14215extern "C" {
14216    /// Connect to the Adhoc control (as a host)
14217///
14218/// @param name - The name of the connection (maximum 8 alphanumeric characters).
14219///
14220/// @return 0 on success, < 0 on error.
14221    pub fn sceNetAdhocctlCreate(name: *const libc::c_char) -> libc::c_int;
14222}
14223extern "C" {
14224    /// Connect to the Adhoc control (as a client)
14225///
14226/// @param scaninfo - A valid ::SceNetAdhocctlScanInfo struct that has been filled by sceNetAchocctlGetScanInfo
14227///
14228/// @return 0 on success, < 0 on error.
14229    pub fn sceNetAdhocctlJoin(scaninfo: *mut SceNetAdhocctlScanInfo)
14230     -> libc::c_int;
14231}
14232extern "C" {
14233    /// Get the adhoc ID
14234///
14235/// @param product - A pointer to a  ::productStruct
14236///
14237/// @return 0 on success, < 0 on error.
14238    pub fn sceNetAdhocctlGetAdhocId(product: *mut productStruct)
14239     -> libc::c_int;
14240}
14241extern "C" {
14242    /// Connect to the Adhoc control game mode (as a host)
14243///
14244/// @param name - The name of the connection (maximum 8 alphanumeric characters).
14245/// @param unknown - Pass 1.
14246/// @param num - The total number of players (including the host).
14247/// @param macs - A pointer to a list of the participating mac addresses, host first, then clients.
14248/// @param timeout - Timeout in microseconds.
14249/// @param unknown2 - pass 0.
14250///
14251/// @return 0 on success, < 0 on error.
14252    pub fn sceNetAdhocctlCreateEnterGameMode(name: *const libc::c_char,
14253                                             unknown: libc::c_int,
14254                                             num: libc::c_int,
14255                                             macs: *mut libc::c_uchar,
14256                                             timeout: libc::c_uint,
14257                                             unknown2: libc::c_int)
14258     -> libc::c_int;
14259}
14260extern "C" {
14261    /// Connect to the Adhoc control game mode (as a client)
14262///
14263/// @param name - The name of the connection (maximum 8 alphanumeric characters).
14264/// @param hostmac - The mac address of the host.
14265/// @param timeout - Timeout in microseconds.
14266/// @param unknown - pass 0.
14267///
14268/// @return 0 on success, < 0 on error.
14269    pub fn sceNetAdhocctlJoinEnterGameMode(name: *const libc::c_char,
14270                                           hostmac: *mut libc::c_uchar,
14271                                           timeout: libc::c_uint,
14272                                           unknown: libc::c_int)
14273     -> libc::c_int;
14274}
14275extern "C" {
14276    /// Get game mode information
14277///
14278/// @param gamemodeinfo - Pointer to store the info.
14279///
14280/// @return 0 on success, < 0 on error.
14281    pub fn sceNetAdhocctlGetGameModeInfo(gamemodeinfo:
14282                                             *mut SceNetAdhocctlGameModeInfo)
14283     -> libc::c_int;
14284}
14285extern "C" {
14286    /// Exit game mode.
14287///
14288/// @return 0 on success, < 0 on error.
14289    pub fn sceNetAdhocctlExitGameMode() -> libc::c_int;
14290}
14291extern "C" {
14292    /// Get a list of peers
14293///
14294/// @param length - The length of the list.
14295/// @param buf - An allocated area of size length.
14296///
14297/// @return 0 on success, < 0 on error.
14298    pub fn sceNetAdhocctlGetPeerList(length: *mut libc::c_int,
14299                                     buf: *mut libc::c_void) -> libc::c_int;
14300}
14301extern "C" {
14302    /// Get peer information
14303///
14304/// @param mac - The mac address of the peer.
14305/// @param size - Size of peerinfo.
14306/// @param peerinfo - Pointer to store the information.
14307///
14308/// @return 0 on success, < 0 on error.
14309    pub fn sceNetAdhocctlGetPeerInfo(mac: *mut libc::c_uchar,
14310                                     size: libc::c_int,
14311                                     peerinfo: *mut SceNetAdhocctlPeerInfo)
14312     -> libc::c_int;
14313}
14314extern "C" {
14315    /// Scan the adhoc channels
14316///
14317/// @return 0 on success, < 0 on error.
14318    pub fn sceNetAdhocctlScan() -> libc::c_int;
14319}
14320extern "C" {
14321    /// Get the results of a scan
14322///
14323/// @param length - The length of the list.
14324/// @param buf - An allocated area of size length.
14325///
14326/// @return 0 on success, < 0 on error.
14327    pub fn sceNetAdhocctlGetScanInfo(length: *mut libc::c_int,
14328                                     buf: *mut libc::c_void) -> libc::c_int;
14329}
14330pub type sceNetAdhocctlHandler =
14331    ::core::option::Option<unsafe extern "C" fn(flag: libc::c_int,
14332                                                error: libc::c_int,
14333                                                unknown: *mut libc::c_void)>;
14334extern "C" {
14335    /// Register an adhoc event handler
14336///
14337/// @param handler - The event handler.
14338/// @param unknown - Pass NULL.
14339///
14340/// @return Handler id on success, < 0 on error.
14341    pub fn sceNetAdhocctlAddHandler(handler: sceNetAdhocctlHandler,
14342                                    unknown: *mut libc::c_void)
14343     -> libc::c_int;
14344}
14345extern "C" {
14346    /// Delete an adhoc event handler
14347///
14348/// @param id - The handler id as returned by sceNetAdhocctlAddHandler.
14349///
14350/// @return 0 on success, < 0 on error.
14351    pub fn sceNetAdhocctlDelHandler(id: libc::c_int) -> libc::c_int;
14352}
14353extern "C" {
14354    /// Get nickname from a mac address
14355///
14356/// @param mac - The mac address.
14357/// @param nickname - Pointer to a char buffer where the nickname will be stored.
14358///
14359/// @return 0 on success, < 0 on error.
14360    pub fn sceNetAdhocctlGetNameByAddr(mac: *mut libc::c_uchar,
14361                                       nickname: *mut libc::c_char)
14362     -> libc::c_int;
14363}
14364extern "C" {
14365    /// Get mac address from nickname
14366///
14367/// @param nickname - The nickname.
14368/// @param length - The length of the list.
14369/// @param buf - An allocated area of size length.
14370///
14371/// @return 0 on success, < 0 on error.
14372    pub fn sceNetAdhocctlGetAddrByName(nickname: *mut libc::c_char,
14373                                       length: *mut libc::c_int,
14374                                       buf: *mut libc::c_void) -> libc::c_int;
14375}
14376extern "C" {
14377    /// Get Adhocctl parameter
14378///
14379/// @param params - Pointer to a ::SceNetAdhocctlParams
14380///
14381/// @return 0 on success, < 0 on error.
14382    pub fn sceNetAdhocctlGetParameter(params: *mut SceNetAdhocctlParams)
14383     -> libc::c_int;
14384}
14385extern "C" {
14386    /// Initialise the adhoc library.
14387///
14388/// @return 0 on success, < 0 on error
14389    pub fn sceNetAdhocInit() -> libc::c_int;
14390}
14391extern "C" {
14392    /// Terminate the adhoc library
14393///
14394/// @return 0 on success, < 0 on error
14395    pub fn sceNetAdhocTerm() -> libc::c_int;
14396}
14397extern "C" {
14398    /// Create a PDP object.
14399///
14400/// @param mac - Your MAC address (from sceWlanGetEtherAddr)
14401/// @param port - Port to use, lumines uses 0x309
14402/// @param bufsize - Socket buffer size, lumines sets to 0x400
14403/// @param unk1 - Unknown, lumines sets to 0
14404///
14405/// @return The ID of the PDP object (< 0 on error)
14406    pub fn sceNetAdhocPdpCreate(mac: *mut libc::c_uchar, port: libc::c_ushort,
14407                                bufsize: libc::c_uint, unk1: libc::c_int)
14408     -> libc::c_int;
14409}
14410extern "C" {
14411    /// Delete a PDP object.
14412///
14413/// @param id - The ID returned from ::sceNetAdhocPdpCreate
14414/// @param unk1 - Unknown, set to 0
14415///
14416/// @return 0 on success, < 0 on error
14417    pub fn sceNetAdhocPdpDelete(id: libc::c_int, unk1: libc::c_int)
14418     -> libc::c_int;
14419}
14420extern "C" {
14421    /// Set a PDP packet to a destination
14422///
14423/// @param id - The ID as returned by ::sceNetAdhocPdpCreate
14424/// @param destMacAddr - The destination MAC address, can be set to all 0xFF for broadcast
14425/// @param port - The port to send to
14426/// @param data - The data to send
14427/// @param len - The length of the data.
14428/// @param timeout - Timeout in microseconds.
14429/// @param nonblock - Set to 0 to block, 1 for non-blocking.
14430///
14431/// @return Bytes sent, < 0 on error
14432    pub fn sceNetAdhocPdpSend(id: libc::c_int,
14433                              destMacAddr: *mut libc::c_uchar,
14434                              port: libc::c_ushort, data: *mut libc::c_void,
14435                              len: libc::c_uint, timeout: libc::c_uint,
14436                              nonblock: libc::c_int) -> libc::c_int;
14437}
14438extern "C" {
14439    /// Receive a PDP packet
14440///
14441/// @param id - The ID of the PDP object, as returned by ::sceNetAdhocPdpCreate
14442/// @param srcMacAddr - Buffer to hold the source mac address of the sender
14443/// @param port - Buffer to hold the port number of he received data
14444/// @param data - Data buffer
14445/// @param dataLength - The length of the data buffer
14446/// @param timeout - Timeout in microseconds.
14447/// @param nonblock - Set to 0 to block, 1 for non-blocking.
14448///
14449/// @return Number of bytes received, < 0 on error.
14450    pub fn sceNetAdhocPdpRecv(id: libc::c_int, srcMacAddr: *mut libc::c_uchar,
14451                              port: *mut libc::c_ushort,
14452                              data: *mut libc::c_void,
14453                              dataLength: *mut libc::c_void,
14454                              timeout: libc::c_uint, nonblock: libc::c_int)
14455     -> libc::c_int;
14456}
14457/// PDP status structure
14458#[repr(C)]
14459#[derive(Debug, Copy)]
14460pub struct pdpStatStruct {
14461    /// Pointer to next PDP structure in list
14462    pub next: *mut pdpStatStruct,
14463    /// pdp ID
14464    pub pdpId: libc::c_int,
14465    /// MAC address
14466    pub mac: [libc::c_uchar; 6usize],
14467    /// Port
14468    pub port: libc::c_ushort,
14469    /// Bytes received
14470    pub rcvdData: libc::c_uint,
14471}
14472#[test]
14473fn bindgen_test_layout_pdpStatStruct() {
14474    assert_eq!(::core::mem::size_of::<pdpStatStruct>() , 24usize , concat ! (
14475               "Size of: " , stringify ! ( pdpStatStruct ) ));
14476    assert_eq! (::core::mem::align_of::<pdpStatStruct>() , 8usize , concat ! (
14477                "Alignment of " , stringify ! ( pdpStatStruct ) ));
14478    assert_eq! (unsafe {
14479                & ( * ( 0 as * const pdpStatStruct ) ) . next as * const _ as
14480                usize } , 0usize , concat ! (
14481                "Alignment of field: " , stringify ! ( pdpStatStruct ) , "::"
14482                , stringify ! ( next ) ));
14483    assert_eq! (unsafe {
14484                & ( * ( 0 as * const pdpStatStruct ) ) . pdpId as * const _ as
14485                usize } , 8usize , concat ! (
14486                "Alignment of field: " , stringify ! ( pdpStatStruct ) , "::"
14487                , stringify ! ( pdpId ) ));
14488    assert_eq! (unsafe {
14489                & ( * ( 0 as * const pdpStatStruct ) ) . mac as * const _ as
14490                usize } , 12usize , concat ! (
14491                "Alignment of field: " , stringify ! ( pdpStatStruct ) , "::"
14492                , stringify ! ( mac ) ));
14493    assert_eq! (unsafe {
14494                & ( * ( 0 as * const pdpStatStruct ) ) . port as * const _ as
14495                usize } , 18usize , concat ! (
14496                "Alignment of field: " , stringify ! ( pdpStatStruct ) , "::"
14497                , stringify ! ( port ) ));
14498    assert_eq! (unsafe {
14499                & ( * ( 0 as * const pdpStatStruct ) ) . rcvdData as * const _
14500                as usize } , 20usize , concat ! (
14501                "Alignment of field: " , stringify ! ( pdpStatStruct ) , "::"
14502                , stringify ! ( rcvdData ) ));
14503}
14504impl Clone for pdpStatStruct {
14505    fn clone(&self) -> Self { *self }
14506}
14507extern "C" {
14508    /// Get the status of all PDP objects
14509///
14510/// @param size - Pointer to the size of the stat array (e.g 20 for one structure)
14511/// @param stat - Pointer to a list of ::pdpStatStruct structures.
14512///
14513/// @return 0 on success, < 0 on error
14514    pub fn sceNetAdhocGetPdpStat(size: *mut libc::c_int,
14515                                 stat: *mut pdpStatStruct) -> libc::c_int;
14516}
14517extern "C" {
14518    /// Create own game object type data.
14519///
14520/// @param data - A pointer to the game object data.
14521/// @param size - Size of the game data.
14522///
14523/// @return 0 on success, < 0 on error.
14524    pub fn sceNetAdhocGameModeCreateMaster(data: *mut libc::c_void,
14525                                           size: libc::c_int) -> libc::c_int;
14526}
14527extern "C" {
14528    /// Create peer game object type data.
14529///
14530/// @param mac - The mac address of the peer.
14531/// @param data - A pointer to the game object data.
14532/// @param size - Size of the game data.
14533///
14534/// @return The id of the replica on success, < 0 on error.
14535    pub fn sceNetAdhocGameModeCreateReplica(mac: *mut libc::c_uchar,
14536                                            data: *mut libc::c_void,
14537                                            size: libc::c_int) -> libc::c_int;
14538}
14539extern "C" {
14540    /// Update own game object type data.
14541///
14542/// @return 0 on success, < 0 on error.
14543    pub fn sceNetAdhocGameModeUpdateMaster() -> libc::c_int;
14544}
14545extern "C" {
14546    /// Update peer game object type data.
14547///
14548/// @param id - The id of the replica returned by sceNetAdhocGameModeCreateReplica.
14549/// @param unk1 - Pass 0.
14550///
14551/// @return 0 on success, < 0 on error.
14552    pub fn sceNetAdhocGameModeUpdateReplica(id: libc::c_int,
14553                                            unk1: libc::c_int) -> libc::c_int;
14554}
14555extern "C" {
14556    /// Delete own game object type data.
14557///
14558/// @return 0 on success, < 0 on error.
14559    pub fn sceNetAdhocGameModeDeleteMaster() -> libc::c_int;
14560}
14561extern "C" {
14562    /// Delete peer game object type data.
14563///
14564/// @param id - The id of the replica.
14565///
14566/// @return 0 on success, < 0 on error.
14567    pub fn sceNetAdhocGameModeDeleteReplica(id: libc::c_int) -> libc::c_int;
14568}
14569extern "C" {
14570    /// Open a PTP connection
14571///
14572/// @param srcmac - Local mac address.
14573/// @param srcport - Local port.
14574/// @param destmac - Destination mac.
14575/// @param destport - Destination port
14576/// @param bufsize - Socket buffer size
14577/// @param delay - Interval between retrying (microseconds).
14578/// @param count - Number of retries.
14579/// @param unk1 - Pass 0.
14580///
14581/// @return A socket ID on success, < 0 on error.
14582    pub fn sceNetAdhocPtpOpen(srcmac: *mut libc::c_uchar,
14583                              srcport: libc::c_ushort,
14584                              destmac: *mut libc::c_uchar,
14585                              destport: libc::c_ushort, bufsize: libc::c_uint,
14586                              delay: libc::c_uint, count: libc::c_int,
14587                              unk1: libc::c_int) -> libc::c_int;
14588}
14589extern "C" {
14590    /// Wait for connection created by sceNetAdhocPtpOpen()
14591///
14592/// @param id - A socket ID.
14593/// @param timeout - Timeout in microseconds.
14594/// @param nonblock - Set to 0 to block, 1 for non-blocking.
14595///
14596/// @return 0 on success, < 0 on error.
14597    pub fn sceNetAdhocPtpConnect(id: libc::c_int, timeout: libc::c_uint,
14598                                 nonblock: libc::c_int) -> libc::c_int;
14599}
14600extern "C" {
14601    /// Wait for an incoming PTP connection
14602///
14603/// @param srcmac - Local mac address.
14604/// @param srcport - Local port.
14605/// @param bufsize - Socket buffer size
14606/// @param delay - Interval between retrying (microseconds).
14607/// @param count - Number of retries.
14608/// @param queue - Connection queue length.
14609/// @param unk1 - Pass 0.
14610///
14611/// @return A socket ID on success, < 0 on error.
14612    pub fn sceNetAdhocPtpListen(srcmac: *mut libc::c_uchar,
14613                                srcport: libc::c_ushort,
14614                                bufsize: libc::c_uint, delay: libc::c_uint,
14615                                count: libc::c_int, queue: libc::c_int,
14616                                unk1: libc::c_int) -> libc::c_int;
14617}
14618extern "C" {
14619    /// Accept an incoming PTP connection
14620///
14621/// @param id - A socket ID.
14622/// @param mac - Connecting peers mac.
14623/// @param port - Connecting peers port.
14624/// @param timeout - Timeout in microseconds.
14625/// @param nonblock - Set to 0 to block, 1 for non-blocking.
14626///
14627/// @return 0 on success, < 0 on error.
14628    pub fn sceNetAdhocPtpAccept(id: libc::c_int, mac: *mut libc::c_uchar,
14629                                port: *mut libc::c_ushort,
14630                                timeout: libc::c_uint, nonblock: libc::c_int)
14631     -> libc::c_int;
14632}
14633extern "C" {
14634    /// Send data
14635///
14636/// @param id - A socket ID.
14637/// @param data - Data to send.
14638/// @param datasize - Size of the data.
14639/// @param timeout - Timeout in microseconds.
14640/// @param nonblock - Set to 0 to block, 1 for non-blocking.
14641///
14642/// @return 0 success, < 0 on error.
14643    pub fn sceNetAdhocPtpSend(id: libc::c_int, data: *mut libc::c_void,
14644                              datasize: *mut libc::c_int,
14645                              timeout: libc::c_uint, nonblock: libc::c_int)
14646     -> libc::c_int;
14647}
14648extern "C" {
14649    /// Receive data
14650///
14651/// @param id - A socket ID.
14652/// @param data - Buffer for the received data.
14653/// @param datasize - Size of the data received.
14654/// @param timeout - Timeout in microseconds.
14655/// @param nonblock - Set to 0 to block, 1 for non-blocking.
14656///
14657/// @return 0 on success, < 0 on error.
14658    pub fn sceNetAdhocPtpRecv(id: libc::c_int, data: *mut libc::c_void,
14659                              datasize: *mut libc::c_int,
14660                              timeout: libc::c_uint, nonblock: libc::c_int)
14661     -> libc::c_int;
14662}
14663extern "C" {
14664    /// Wait for data in the buffer to be sent
14665///
14666/// @param id - A socket ID.
14667/// @param timeout - Timeout in microseconds.
14668/// @param nonblock - Set to 0 to block, 1 for non-blocking.
14669///
14670/// @return A socket ID on success, < 0 on error.
14671    pub fn sceNetAdhocPtpFlush(id: libc::c_int, timeout: libc::c_uint,
14672                               nonblock: libc::c_int) -> libc::c_int;
14673}
14674extern "C" {
14675    /// Close a socket
14676///
14677/// @param id - A socket ID.
14678/// @param unk1 - Pass 0.
14679///
14680/// @return A socket ID on success, < 0 on error.
14681    pub fn sceNetAdhocPtpClose(id: libc::c_int, unk1: libc::c_int)
14682     -> libc::c_int;
14683}
14684/// PTP status structure
14685#[repr(C)]
14686#[derive(Debug, Copy)]
14687pub struct ptpStatStruct {
14688    /// Pointer to next PTP structure in list
14689    pub next: *mut ptpStatStruct,
14690    /// ptp ID
14691    pub ptpId: libc::c_int,
14692    /// MAC address
14693    pub mac: [libc::c_uchar; 6usize],
14694    /// Peer MAC address
14695    pub peermac: [libc::c_uchar; 6usize],
14696    /// Port
14697    pub port: libc::c_ushort,
14698    /// Peer Port
14699    pub peerport: libc::c_ushort,
14700    /// Bytes sent
14701    pub sentData: libc::c_uint,
14702    /// Bytes received
14703    pub rcvdData: libc::c_uint,
14704    /// Unknown
14705    pub unk1: libc::c_int,
14706}
14707#[test]
14708fn bindgen_test_layout_ptpStatStruct() {
14709    assert_eq!(::core::mem::size_of::<ptpStatStruct>() , 40usize , concat ! (
14710               "Size of: " , stringify ! ( ptpStatStruct ) ));
14711    assert_eq! (::core::mem::align_of::<ptpStatStruct>() , 8usize , concat ! (
14712                "Alignment of " , stringify ! ( ptpStatStruct ) ));
14713    assert_eq! (unsafe {
14714                & ( * ( 0 as * const ptpStatStruct ) ) . next as * const _ as
14715                usize } , 0usize , concat ! (
14716                "Alignment of field: " , stringify ! ( ptpStatStruct ) , "::"
14717                , stringify ! ( next ) ));
14718    assert_eq! (unsafe {
14719                & ( * ( 0 as * const ptpStatStruct ) ) . ptpId as * const _ as
14720                usize } , 8usize , concat ! (
14721                "Alignment of field: " , stringify ! ( ptpStatStruct ) , "::"
14722                , stringify ! ( ptpId ) ));
14723    assert_eq! (unsafe {
14724                & ( * ( 0 as * const ptpStatStruct ) ) . mac as * const _ as
14725                usize } , 12usize , concat ! (
14726                "Alignment of field: " , stringify ! ( ptpStatStruct ) , "::"
14727                , stringify ! ( mac ) ));
14728    assert_eq! (unsafe {
14729                & ( * ( 0 as * const ptpStatStruct ) ) . peermac as * const _
14730                as usize } , 18usize , concat ! (
14731                "Alignment of field: " , stringify ! ( ptpStatStruct ) , "::"
14732                , stringify ! ( peermac ) ));
14733    assert_eq! (unsafe {
14734                & ( * ( 0 as * const ptpStatStruct ) ) . port as * const _ as
14735                usize } , 24usize , concat ! (
14736                "Alignment of field: " , stringify ! ( ptpStatStruct ) , "::"
14737                , stringify ! ( port ) ));
14738    assert_eq! (unsafe {
14739                & ( * ( 0 as * const ptpStatStruct ) ) . peerport as * const _
14740                as usize } , 26usize , concat ! (
14741                "Alignment of field: " , stringify ! ( ptpStatStruct ) , "::"
14742                , stringify ! ( peerport ) ));
14743    assert_eq! (unsafe {
14744                & ( * ( 0 as * const ptpStatStruct ) ) . sentData as * const _
14745                as usize } , 28usize , concat ! (
14746                "Alignment of field: " , stringify ! ( ptpStatStruct ) , "::"
14747                , stringify ! ( sentData ) ));
14748    assert_eq! (unsafe {
14749                & ( * ( 0 as * const ptpStatStruct ) ) . rcvdData as * const _
14750                as usize } , 32usize , concat ! (
14751                "Alignment of field: " , stringify ! ( ptpStatStruct ) , "::"
14752                , stringify ! ( rcvdData ) ));
14753    assert_eq! (unsafe {
14754                & ( * ( 0 as * const ptpStatStruct ) ) . unk1 as * const _ as
14755                usize } , 36usize , concat ! (
14756                "Alignment of field: " , stringify ! ( ptpStatStruct ) , "::"
14757                , stringify ! ( unk1 ) ));
14758}
14759impl Clone for ptpStatStruct {
14760    fn clone(&self) -> Self { *self }
14761}
14762extern "C" {
14763    /// Get the status of all PTP objects
14764///
14765/// @param size - Pointer to the size of the stat array (e.g 20 for one structure)
14766/// @param stat - Pointer to a list of ::ptpStatStruct structures.
14767///
14768/// @return 0 on success, < 0 on error
14769    pub fn sceNetAdhocGetPtpStat(size: *mut libc::c_int,
14770                                 stat: *mut ptpStatStruct) -> libc::c_int;
14771}
14772#[repr(u32)]
14773/// Matching events used in pspAdhocMatchingCallback
14774#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
14775pub enum pspAdhocMatchingEvents {
14776    PSP_ADHOC_MATCHING_EVENT_HELLO = 1,
14777    PSP_ADHOC_MATCHING_EVENT_JOIN = 2,
14778    PSP_ADHOC_MATCHING_EVENT_LEFT = 3,
14779    PSP_ADHOC_MATCHING_EVENT_REJECT = 4,
14780    PSP_ADHOC_MATCHING_EVENT_CANCEL = 5,
14781    PSP_ADHOC_MATCHING_EVENT_ACCEPT = 6,
14782    PSP_ADHOC_MATCHING_EVENT_COMPLETE = 7,
14783    PSP_ADHOC_MATCHING_EVENT_TIMEOUT = 8,
14784    PSP_ADHOC_MATCHING_EVENT_ERROR = 9,
14785    PSP_ADHOC_MATCHING_EVENT_DISCONNECT = 10,
14786    PSP_ADHOC_MATCHING_EVENT_DATA = 11,
14787    PSP_ADHOC_MATCHING_EVENT_DATA_CONFIRM = 12,
14788    PSP_ADHOC_MATCHING_EVENT_DATA_TIMEOUT = 13,
14789}
14790#[repr(u32)]
14791/// Matching modes used in sceNetAdhocMatchingCreate
14792#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
14793pub enum pspAdhocMatchingModes {
14794    PSP_ADHOC_MATCHING_MODE_HOST = 1,
14795    PSP_ADHOC_MATCHING_MODE_CLIENT = 2,
14796    PSP_ADHOC_MATCHING_MODE_PTP = 3,
14797}
14798/// Linked list for sceNetAdhocMatchingGetMembers
14799#[repr(C)]
14800#[derive(Debug, Copy)]
14801pub struct pspAdhocMatchingMember {
14802    pub next: *mut pspAdhocMatchingMember,
14803    pub mac: [libc::c_uchar; 6usize],
14804    pub unknown: [libc::c_char; 2usize],
14805}
14806#[test]
14807fn bindgen_test_layout_pspAdhocMatchingMember() {
14808    assert_eq!(::core::mem::size_of::<pspAdhocMatchingMember>() , 16usize ,
14809               concat ! ( "Size of: " , stringify ! ( pspAdhocMatchingMember )
14810               ));
14811    assert_eq! (::core::mem::align_of::<pspAdhocMatchingMember>() , 8usize ,
14812                concat ! (
14813                "Alignment of " , stringify ! ( pspAdhocMatchingMember ) ));
14814    assert_eq! (unsafe {
14815                & ( * ( 0 as * const pspAdhocMatchingMember ) ) . next as *
14816                const _ as usize } , 0usize , concat ! (
14817                "Alignment of field: " , stringify ! ( pspAdhocMatchingMember
14818                ) , "::" , stringify ! ( next ) ));
14819    assert_eq! (unsafe {
14820                & ( * ( 0 as * const pspAdhocMatchingMember ) ) . mac as *
14821                const _ as usize } , 8usize , concat ! (
14822                "Alignment of field: " , stringify ! ( pspAdhocMatchingMember
14823                ) , "::" , stringify ! ( mac ) ));
14824    assert_eq! (unsafe {
14825                & ( * ( 0 as * const pspAdhocMatchingMember ) ) . unknown as *
14826                const _ as usize } , 14usize , concat ! (
14827                "Alignment of field: " , stringify ! ( pspAdhocMatchingMember
14828                ) , "::" , stringify ! ( unknown ) ));
14829}
14830impl Clone for pspAdhocMatchingMember {
14831    fn clone(&self) -> Self { *self }
14832}
14833/// Linked list for sceNetAdhocMatchingGetMembers
14834#[repr(C)]
14835#[derive(Debug, Copy)]
14836pub struct pspAdhocPoolStat {
14837    /// Size of the pool
14838    pub size: libc::c_int,
14839    /// Maximum size of the pool
14840    pub maxsize: libc::c_int,
14841    /// Unused memory in the pool
14842    pub freesize: libc::c_int,
14843}
14844#[test]
14845fn bindgen_test_layout_pspAdhocPoolStat() {
14846    assert_eq!(::core::mem::size_of::<pspAdhocPoolStat>() , 12usize , concat !
14847               ( "Size of: " , stringify ! ( pspAdhocPoolStat ) ));
14848    assert_eq! (::core::mem::align_of::<pspAdhocPoolStat>() , 4usize , concat
14849                ! ( "Alignment of " , stringify ! ( pspAdhocPoolStat ) ));
14850    assert_eq! (unsafe {
14851                & ( * ( 0 as * const pspAdhocPoolStat ) ) . size as * const _
14852                as usize } , 0usize , concat ! (
14853                "Alignment of field: " , stringify ! ( pspAdhocPoolStat ) ,
14854                "::" , stringify ! ( size ) ));
14855    assert_eq! (unsafe {
14856                & ( * ( 0 as * const pspAdhocPoolStat ) ) . maxsize as * const
14857                _ as usize } , 4usize , concat ! (
14858                "Alignment of field: " , stringify ! ( pspAdhocPoolStat ) ,
14859                "::" , stringify ! ( maxsize ) ));
14860    assert_eq! (unsafe {
14861                & ( * ( 0 as * const pspAdhocPoolStat ) ) . freesize as *
14862                const _ as usize } , 8usize , concat ! (
14863                "Alignment of field: " , stringify ! ( pspAdhocPoolStat ) ,
14864                "::" , stringify ! ( freesize ) ));
14865}
14866impl Clone for pspAdhocPoolStat {
14867    fn clone(&self) -> Self { *self }
14868}
14869extern "C" {
14870    /// Initialise the Adhoc matching library
14871///
14872/// @param memsize - Internal memory pool size. Lumines uses 0x20000
14873///
14874/// @return 0 on success, < 0 on error
14875    pub fn sceNetAdhocMatchingInit(memsize: libc::c_int) -> libc::c_int;
14876}
14877extern "C" {
14878    /// Terminate the Adhoc matching library
14879///
14880/// @return 0 on success, < 0 on error
14881    pub fn sceNetAdhocMatchingTerm() -> libc::c_int;
14882}
14883/// Matching callback
14884pub type pspAdhocMatchingCallback =
14885    ::core::option::Option<unsafe extern "C" fn(matchingid: libc::c_int,
14886                                                event: libc::c_int,
14887                                                mac: *mut libc::c_uchar,
14888                                                optlen: libc::c_int,
14889                                                optdata: *mut libc::c_void)>;
14890extern "C" {
14891    /// Create an Adhoc matching object
14892///
14893/// @param mode - One of ::pspAdhocMatchingModes
14894/// @param maxpeers - Maximum number of peers to match (only used when mode is PSP_ADHOC_MATCHING_MODE_HOST)
14895/// @param port - Port. Lumines uses 0x22B
14896/// @param bufsize - Receiving buffer size
14897/// @param hellodelay - Hello message send delay in microseconds (only used when mode is PSP_ADHOC_MATCHING_MODE_HOST or PSP_ADHOC_MATCHING_MODE_PTP)
14898/// @param pingdelay - Ping send delay in microseconds. Lumines uses 0x5B8D80 (only used when mode is PSP_ADHOC_MATCHING_MODE_HOST or PSP_ADHOC_MATCHING_MODE_PTP)
14899/// @param initcount - Initial count of the of the resend counter. Lumines uses 3
14900/// @param msgdelay - Message send delay in microseconds
14901/// @param callback - Callback to be called for matching
14902///
14903/// @return ID of object on success, < 0 on error.
14904    pub fn sceNetAdhocMatchingCreate(mode: libc::c_int, maxpeers: libc::c_int,
14905                                     port: libc::c_ushort,
14906                                     bufsize: libc::c_int,
14907                                     hellodelay: libc::c_uint,
14908                                     pingdelay: libc::c_uint,
14909                                     initcount: libc::c_int,
14910                                     msgdelay: libc::c_uint,
14911                                     callback: pspAdhocMatchingCallback)
14912     -> libc::c_int;
14913}
14914extern "C" {
14915    /// Delete an Adhoc matching object
14916///
14917/// @param matchingid - The ID returned from ::sceNetAdhocMatchingCreate
14918///
14919/// @return 0 on success, < 0 on error.
14920    pub fn sceNetAdhocMatchingDelete(matchingid: libc::c_int) -> libc::c_int;
14921}
14922extern "C" {
14923    /// Start a matching object
14924///
14925/// @param matchingid - The ID returned from ::sceNetAdhocMatchingCreate
14926/// @param evthpri - Priority of the event handler thread. Lumines uses 0x10
14927/// @param evthstack - Stack size of the event handler thread. Lumines uses 0x2000
14928/// @param inthpri - Priority of the input handler thread. Lumines uses 0x10
14929/// @param inthstack - Stack size of the input handler thread. Lumines uses 0x2000
14930/// @param optlen - Size of hellodata
14931/// @param optdata - Pointer to block of data passed to callback
14932///
14933/// @return 0 on success, < 0 on error
14934    pub fn sceNetAdhocMatchingStart(matchingid: libc::c_int,
14935                                    evthpri: libc::c_int,
14936                                    evthstack: libc::c_int,
14937                                    inthpri: libc::c_int,
14938                                    inthstack: libc::c_int,
14939                                    optlen: libc::c_int,
14940                                    optdata: *mut libc::c_void)
14941     -> libc::c_int;
14942}
14943extern "C" {
14944    /// Stop a matching object
14945///
14946/// @param matchingid - The ID returned from ::sceNetAdhocMatchingCreate
14947///
14948/// @return 0 on success, < 0 on error.
14949    pub fn sceNetAdhocMatchingStop(matchingid: libc::c_int) -> libc::c_int;
14950}
14951extern "C" {
14952    /// Select a matching target
14953///
14954/// @param matchingid - The ID returned from ::sceNetAdhocMatchingCreate
14955/// @param mac - MAC address to select
14956/// @param optlen - Optional data length
14957/// @param optdata - Pointer to the optional data
14958///
14959/// @return 0 on success, < 0 on error.
14960    pub fn sceNetAdhocMatchingSelectTarget(matchingid: libc::c_int,
14961                                           mac: *mut libc::c_uchar,
14962                                           optlen: libc::c_int,
14963                                           optdata: *mut libc::c_void)
14964     -> libc::c_int;
14965}
14966extern "C" {
14967    /// Cancel a matching target
14968///
14969/// @param matchingid - The ID returned from ::sceNetAdhocMatchingCreate
14970/// @param mac - The MAC address to cancel
14971///
14972/// @return 0 on success, < 0 on error.
14973    pub fn sceNetAdhocMatchingCancelTarget(matchingid: libc::c_int,
14974                                           mac: *mut libc::c_uchar)
14975     -> libc::c_int;
14976}
14977extern "C" {
14978    /// Cancel a matching target (with optional data)
14979///
14980/// @param matchingid - The ID returned from ::sceNetAdhocMatchingCreate
14981/// @param mac - The MAC address to cancel
14982/// @param optlen - Optional data length
14983/// @param optdata - Pointer to the optional data
14984///
14985/// @return 0 on success, < 0 on error.
14986    pub fn sceNetAdhocMatchingCancelTargetWithOpt(matchingid: libc::c_int,
14987                                                  mac: *mut libc::c_uchar,
14988                                                  optlen: libc::c_int,
14989                                                  optdata: *mut libc::c_void)
14990     -> libc::c_int;
14991}
14992extern "C" {
14993    /// Send data to a matching target
14994///
14995/// @param matchingid - The ID returned from ::sceNetAdhocMatchingCreate
14996/// @param mac - The MAC address to send the data to
14997/// @param datalen - Length of the data
14998/// @param data - Pointer to the data
14999///
15000/// @return 0 on success, < 0 on error.
15001    pub fn sceNetAdhocMatchingSendData(matchingid: libc::c_int,
15002                                       mac: *mut libc::c_uchar,
15003                                       datalen: libc::c_int,
15004                                       data: *mut libc::c_void)
15005     -> libc::c_int;
15006}
15007extern "C" {
15008    /// Abort a data send to a matching target
15009///
15010/// @param matchingid - The ID returned from ::sceNetAdhocMatchingCreate
15011/// @param mac - The MAC address to send the data to
15012///
15013/// @return 0 on success, < 0 on error.
15014    pub fn sceNetAdhocMatchingAbortSendData(matchingid: libc::c_int,
15015                                            mac: *mut libc::c_uchar)
15016     -> libc::c_int;
15017}
15018extern "C" {
15019    /// Set the optional hello message
15020///
15021/// @param matchingid - The ID returned from ::sceNetAdhocMatchingCreate
15022/// @param optlen - Length of the hello data
15023/// @param optdata - Pointer to the hello data
15024///
15025/// @return 0 on success, < 0 on error.
15026    pub fn sceNetAdhocMatchingSetHelloOpt(matchingid: libc::c_int,
15027                                          optlen: libc::c_int,
15028                                          optdata: *mut libc::c_void)
15029     -> libc::c_int;
15030}
15031extern "C" {
15032    /// Get the optional hello message
15033///
15034/// @param matchingid - The ID returned from ::sceNetAdhocMatchingCreate
15035/// @param optlen - Length of the hello data
15036/// @param optdata - Pointer to the hello data
15037///
15038/// @return 0 on success, < 0 on error.
15039    pub fn sceNetAdhocMatchingGetHelloOpt(matchingid: libc::c_int,
15040                                          optlen: *mut libc::c_int,
15041                                          optdata: *mut libc::c_void)
15042     -> libc::c_int;
15043}
15044extern "C" {
15045    /// Get a list of matching members
15046///
15047/// @param matchingid - The ID returned from ::sceNetAdhocMatchingCreate
15048/// @param length - The length of the list.
15049/// @param buf - An allocated area of size length.
15050///
15051/// @return 0 on success, < 0 on error.
15052    pub fn sceNetAdhocMatchingGetMembers(matchingid: libc::c_int,
15053                                         length: *mut libc::c_int,
15054                                         buf: *mut libc::c_void)
15055     -> libc::c_int;
15056}
15057extern "C" {
15058    /// Get the maximum memory usage by the matching library
15059///
15060/// @return The memory usage on success, < 0 on error.
15061    pub fn sceNetAdhocMatchingGetPoolMaxAlloc() -> libc::c_int;
15062}
15063extern "C" {
15064    /// Get the status of the memory pool used by the matching library
15065///
15066/// @param poolstat - A ::pspAdhocPoolStat.
15067///
15068/// @return 0 on success, < 0 on error.
15069    pub fn sceNetAdhocMatchingGetPoolStat(poolstat: *mut pspAdhocPoolStat)
15070     -> libc::c_int;
15071}
15072#[repr(C)]
15073#[derive(Copy)]
15074pub union SceNetApctlInfo {
15075    pub name: [libc::c_char; 64usize],
15076    pub bssid: [libc::c_uchar; 6usize],
15077    pub ssid: [libc::c_uchar; 32usize],
15078    pub ssidLength: libc::c_uint,
15079    pub securityType: libc::c_uint,
15080    pub strength: libc::c_uchar,
15081    pub channel: libc::c_uchar,
15082    pub powerSave: libc::c_uchar,
15083    pub ip: [libc::c_char; 16usize],
15084    pub subNetMask: [libc::c_char; 16usize],
15085    pub gateway: [libc::c_char; 16usize],
15086    pub primaryDns: [libc::c_char; 16usize],
15087    pub secondaryDns: [libc::c_char; 16usize],
15088    pub useProxy: libc::c_uint,
15089    pub proxyUrl: [libc::c_char; 128usize],
15090    pub proxyPort: libc::c_ushort,
15091    pub eapType: libc::c_uint,
15092    pub startBrowser: libc::c_uint,
15093    pub wifisp: libc::c_uint,
15094    _bindgen_union_align: [u32; 32usize],
15095}
15096#[test]
15097fn bindgen_test_layout_SceNetApctlInfo() {
15098    assert_eq!(::core::mem::size_of::<SceNetApctlInfo>() , 128usize , concat !
15099               ( "Size of: " , stringify ! ( SceNetApctlInfo ) ));
15100    assert_eq! (::core::mem::align_of::<SceNetApctlInfo>() , 4usize , concat !
15101                ( "Alignment of " , stringify ! ( SceNetApctlInfo ) ));
15102    assert_eq! (unsafe {
15103                & ( * ( 0 as * const SceNetApctlInfo ) ) . name as * const _
15104                as usize } , 0usize , concat ! (
15105                "Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
15106                "::" , stringify ! ( name ) ));
15107    assert_eq! (unsafe {
15108                & ( * ( 0 as * const SceNetApctlInfo ) ) . bssid as * const _
15109                as usize } , 0usize , concat ! (
15110                "Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
15111                "::" , stringify ! ( bssid ) ));
15112    assert_eq! (unsafe {
15113                & ( * ( 0 as * const SceNetApctlInfo ) ) . ssid as * const _
15114                as usize } , 0usize , concat ! (
15115                "Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
15116                "::" , stringify ! ( ssid ) ));
15117    assert_eq! (unsafe {
15118                & ( * ( 0 as * const SceNetApctlInfo ) ) . ssidLength as *
15119                const _ as usize } , 0usize , concat ! (
15120                "Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
15121                "::" , stringify ! ( ssidLength ) ));
15122    assert_eq! (unsafe {
15123                & ( * ( 0 as * const SceNetApctlInfo ) ) . securityType as *
15124                const _ as usize } , 0usize , concat ! (
15125                "Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
15126                "::" , stringify ! ( securityType ) ));
15127    assert_eq! (unsafe {
15128                & ( * ( 0 as * const SceNetApctlInfo ) ) . strength as * const
15129                _ as usize } , 0usize , concat ! (
15130                "Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
15131                "::" , stringify ! ( strength ) ));
15132    assert_eq! (unsafe {
15133                & ( * ( 0 as * const SceNetApctlInfo ) ) . channel as * const
15134                _ as usize } , 0usize , concat ! (
15135                "Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
15136                "::" , stringify ! ( channel ) ));
15137    assert_eq! (unsafe {
15138                & ( * ( 0 as * const SceNetApctlInfo ) ) . powerSave as *
15139                const _ as usize } , 0usize , concat ! (
15140                "Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
15141                "::" , stringify ! ( powerSave ) ));
15142    assert_eq! (unsafe {
15143                & ( * ( 0 as * const SceNetApctlInfo ) ) . ip as * const _ as
15144                usize } , 0usize , concat ! (
15145                "Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
15146                "::" , stringify ! ( ip ) ));
15147    assert_eq! (unsafe {
15148                & ( * ( 0 as * const SceNetApctlInfo ) ) . subNetMask as *
15149                const _ as usize } , 0usize , concat ! (
15150                "Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
15151                "::" , stringify ! ( subNetMask ) ));
15152    assert_eq! (unsafe {
15153                & ( * ( 0 as * const SceNetApctlInfo ) ) . gateway as * const
15154                _ as usize } , 0usize , concat ! (
15155                "Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
15156                "::" , stringify ! ( gateway ) ));
15157    assert_eq! (unsafe {
15158                & ( * ( 0 as * const SceNetApctlInfo ) ) . primaryDns as *
15159                const _ as usize } , 0usize , concat ! (
15160                "Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
15161                "::" , stringify ! ( primaryDns ) ));
15162    assert_eq! (unsafe {
15163                & ( * ( 0 as * const SceNetApctlInfo ) ) . secondaryDns as *
15164                const _ as usize } , 0usize , concat ! (
15165                "Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
15166                "::" , stringify ! ( secondaryDns ) ));
15167    assert_eq! (unsafe {
15168                & ( * ( 0 as * const SceNetApctlInfo ) ) . useProxy as * const
15169                _ as usize } , 0usize , concat ! (
15170                "Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
15171                "::" , stringify ! ( useProxy ) ));
15172    assert_eq! (unsafe {
15173                & ( * ( 0 as * const SceNetApctlInfo ) ) . proxyUrl as * const
15174                _ as usize } , 0usize , concat ! (
15175                "Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
15176                "::" , stringify ! ( proxyUrl ) ));
15177    assert_eq! (unsafe {
15178                & ( * ( 0 as * const SceNetApctlInfo ) ) . proxyPort as *
15179                const _ as usize } , 0usize , concat ! (
15180                "Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
15181                "::" , stringify ! ( proxyPort ) ));
15182    assert_eq! (unsafe {
15183                & ( * ( 0 as * const SceNetApctlInfo ) ) . eapType as * const
15184                _ as usize } , 0usize , concat ! (
15185                "Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
15186                "::" , stringify ! ( eapType ) ));
15187    assert_eq! (unsafe {
15188                & ( * ( 0 as * const SceNetApctlInfo ) ) . startBrowser as *
15189                const _ as usize } , 0usize , concat ! (
15190                "Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
15191                "::" , stringify ! ( startBrowser ) ));
15192    assert_eq! (unsafe {
15193                & ( * ( 0 as * const SceNetApctlInfo ) ) . wifisp as * const _
15194                as usize } , 0usize , concat ! (
15195                "Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
15196                "::" , stringify ! ( wifisp ) ));
15197}
15198impl Clone for SceNetApctlInfo {
15199    fn clone(&self) -> Self { *self }
15200}
15201pub type sceNetApctlHandler =
15202    ::core::option::Option<unsafe extern "C" fn(oldState: libc::c_int,
15203                                                newState: libc::c_int,
15204                                                event: libc::c_int,
15205                                                error: libc::c_int,
15206                                                pArg: *mut libc::c_void)>;
15207extern "C" {
15208    /// Init the apctl.
15209///
15210/// @param stackSize - The stack size of the internal thread.
15211///
15212/// @param initPriority - The priority of the internal thread.
15213///
15214/// @return < 0 on error.
15215    pub fn sceNetApctlInit(stackSize: libc::c_int, initPriority: libc::c_int)
15216     -> libc::c_int;
15217}
15218extern "C" {
15219    /// Terminate the apctl.
15220///
15221/// @return < 0 on error.
15222    pub fn sceNetApctlTerm() -> libc::c_int;
15223}
15224extern "C" {
15225    /// Get the apctl information.
15226///
15227/// @param code - One of the PSP_NET_APCTL_INFO_* defines.
15228///
15229/// @param pInfo - Pointer to a ::SceNetApctlInfo.
15230///
15231/// @return < 0 on error.
15232    pub fn sceNetApctlGetInfo(code: libc::c_int, pInfo: *mut SceNetApctlInfo)
15233     -> libc::c_int;
15234}
15235extern "C" {
15236    /// Add an apctl event handler.
15237///
15238/// @param handler - Pointer to the event handler function.
15239///
15240/// @param pArg - Value to be passed to the pArg parameter of the handler function.
15241///
15242/// @return A handler id or < 0 on error.
15243    pub fn sceNetApctlAddHandler(handler: sceNetApctlHandler,
15244                                 pArg: *mut libc::c_void) -> libc::c_int;
15245}
15246extern "C" {
15247    /// Delete an apctl event handler.
15248///
15249/// @param handlerId - A handler as created returned from sceNetApctlAddHandler.
15250///
15251/// @return < 0 on error.
15252    pub fn sceNetApctlDelHandler(handlerId: libc::c_int) -> libc::c_int;
15253}
15254extern "C" {
15255    /// Connect to an access point.
15256///
15257/// @param connIndex - The index of the connection.
15258///
15259/// @return < 0 on error.
15260    pub fn sceNetApctlConnect(connIndex: libc::c_int) -> libc::c_int;
15261}
15262extern "C" {
15263    /// Disconnect from an access point.
15264///
15265/// @return < 0 on error.
15266    pub fn sceNetApctlDisconnect() -> libc::c_int;
15267}
15268extern "C" {
15269    /// Get the state of the access point connection.
15270///
15271/// @param pState - Pointer to receive the current state (one of the PSP_NET_APCTL_STATE_* defines).
15272///
15273/// @return < 0 on error.
15274    pub fn sceNetApctlGetState(pState: *mut libc::c_int) -> libc::c_int;
15275}
15276#[repr(C)]
15277#[derive(Debug, Copy)]
15278pub struct SceNetMallocStat {
15279    pub pool: libc::c_int,
15280    pub maximum: libc::c_int,
15281    pub free: libc::c_int,
15282}
15283#[test]
15284fn bindgen_test_layout_SceNetMallocStat() {
15285    assert_eq!(::core::mem::size_of::<SceNetMallocStat>() , 12usize , concat !
15286               ( "Size of: " , stringify ! ( SceNetMallocStat ) ));
15287    assert_eq! (::core::mem::align_of::<SceNetMallocStat>() , 4usize , concat
15288                ! ( "Alignment of " , stringify ! ( SceNetMallocStat ) ));
15289    assert_eq! (unsafe {
15290                & ( * ( 0 as * const SceNetMallocStat ) ) . pool as * const _
15291                as usize } , 0usize , concat ! (
15292                "Alignment of field: " , stringify ! ( SceNetMallocStat ) ,
15293                "::" , stringify ! ( pool ) ));
15294    assert_eq! (unsafe {
15295                & ( * ( 0 as * const SceNetMallocStat ) ) . maximum as * const
15296                _ as usize } , 4usize , concat ! (
15297                "Alignment of field: " , stringify ! ( SceNetMallocStat ) ,
15298                "::" , stringify ! ( maximum ) ));
15299    assert_eq! (unsafe {
15300                & ( * ( 0 as * const SceNetMallocStat ) ) . free as * const _
15301                as usize } , 8usize , concat ! (
15302                "Alignment of field: " , stringify ! ( SceNetMallocStat ) ,
15303                "::" , stringify ! ( free ) ));
15304}
15305impl Clone for SceNetMallocStat {
15306    fn clone(&self) -> Self { *self }
15307}
15308extern "C" {
15309    /// Initialise the networking library
15310///
15311/// @param poolsize - Memory pool size (appears to be for the whole of the networking library).
15312/// @param calloutprio - Priority of the SceNetCallout thread.
15313/// @param calloutstack - Stack size of the SceNetCallout thread (defaults to 4096 on non 1.5 firmware regardless of what value is passed).
15314/// @param netintrprio - Priority of the SceNetNetintr thread.
15315/// @param netintrstack - Stack size of the SceNetNetintr thread (defaults to 4096 on non 1.5 firmware regardless of what value is passed).
15316///
15317/// @return 0 on success, < 0 on error
15318    pub fn sceNetInit(poolsize: libc::c_int, calloutprio: libc::c_int,
15319                      calloutstack: libc::c_int, netintrprio: libc::c_int,
15320                      netintrstack: libc::c_int) -> libc::c_int;
15321}
15322extern "C" {
15323    /// Terminate the networking library
15324///
15325/// @return 0 on success, < 0 on error
15326    pub fn sceNetTerm() -> libc::c_int;
15327}
15328extern "C" {
15329    /// Free (delete) thread info/data
15330///
15331/// @param thid - The thread id.
15332///
15333/// @return 0 on success, < 0 on error
15334    pub fn sceNetFreeThreadinfo(thid: libc::c_int) -> libc::c_int;
15335}
15336extern "C" {
15337    /// Abort a thread
15338///
15339/// @param thid - The thread id.
15340///
15341/// @return 0 on success, < 0 on error
15342    pub fn sceNetThreadAbort(thid: libc::c_int) -> libc::c_int;
15343}
15344extern "C" {
15345    /// Convert string to a Mac address
15346///
15347/// @param name - The string to convert.
15348/// @param mac - Pointer to a buffer to store the result.
15349    pub fn sceNetEtherStrton(name: *mut libc::c_char,
15350                             mac: *mut libc::c_uchar);
15351}
15352extern "C" {
15353    /// Convert Mac address to a string
15354///
15355/// @param mac - The Mac address to convert.
15356/// @param name - Pointer to a buffer to store the result.
15357    pub fn sceNetEtherNtostr(mac: *mut libc::c_uchar,
15358                             name: *mut libc::c_char);
15359}
15360extern "C" {
15361    /// Retrieve the local Mac address
15362///
15363/// @param mac - Pointer to a buffer to store the result.
15364///
15365/// @return 0 on success, < 0 on error
15366    pub fn sceNetGetLocalEtherAddr(mac: *mut libc::c_uchar) -> libc::c_int;
15367}
15368extern "C" {
15369    /// Retrieve the networking library memory usage
15370///
15371/// @param stat - Pointer to a ::SceNetMallocStat type to store the result.
15372///
15373/// @return 0 on success, < 0 on error
15374    pub fn sceNetGetMallocStat(stat: *mut SceNetMallocStat) -> libc::c_int;
15375}
15376extern "C" {
15377    pub fn sceNetInetInit() -> libc::c_int;
15378}
15379extern "C" {
15380    pub fn sceNetInetTerm() -> libc::c_int;
15381}
15382pub type sa_family_t = u8;
15383pub type socklen_t = u32;
15384#[repr(C)]
15385#[derive(Debug, Copy)]
15386pub struct linger {
15387    pub l_onoff: libc::c_int,
15388    pub l_linger: libc::c_int,
15389}
15390#[test]
15391fn bindgen_test_layout_linger() {
15392    assert_eq!(::core::mem::size_of::<linger>() , 8usize , concat ! (
15393               "Size of: " , stringify ! ( linger ) ));
15394    assert_eq! (::core::mem::align_of::<linger>() , 4usize , concat ! (
15395                "Alignment of " , stringify ! ( linger ) ));
15396    assert_eq! (unsafe {
15397                & ( * ( 0 as * const linger ) ) . l_onoff as * const _ as
15398                usize } , 0usize , concat ! (
15399                "Alignment of field: " , stringify ! ( linger ) , "::" ,
15400                stringify ! ( l_onoff ) ));
15401    assert_eq! (unsafe {
15402                & ( * ( 0 as * const linger ) ) . l_linger as * const _ as
15403                usize } , 4usize , concat ! (
15404                "Alignment of field: " , stringify ! ( linger ) , "::" ,
15405                stringify ! ( l_linger ) ));
15406}
15407impl Clone for linger {
15408    fn clone(&self) -> Self { *self }
15409}
15410#[repr(C)]
15411#[derive(Debug, Copy)]
15412pub struct sockaddr {
15413    pub sa_len: u8,
15414    pub sa_family: sa_family_t,
15415    pub sa_data: [libc::c_char; 14usize],
15416}
15417#[test]
15418fn bindgen_test_layout_sockaddr() {
15419    assert_eq!(::core::mem::size_of::<sockaddr>() , 16usize , concat ! (
15420               "Size of: " , stringify ! ( sockaddr ) ));
15421    assert_eq! (::core::mem::align_of::<sockaddr>() , 1usize , concat ! (
15422                "Alignment of " , stringify ! ( sockaddr ) ));
15423    assert_eq! (unsafe {
15424                & ( * ( 0 as * const sockaddr ) ) . sa_len as * const _ as
15425                usize } , 0usize , concat ! (
15426                "Alignment of field: " , stringify ! ( sockaddr ) , "::" ,
15427                stringify ! ( sa_len ) ));
15428    assert_eq! (unsafe {
15429                & ( * ( 0 as * const sockaddr ) ) . sa_family as * const _ as
15430                usize } , 1usize , concat ! (
15431                "Alignment of field: " , stringify ! ( sockaddr ) , "::" ,
15432                stringify ! ( sa_family ) ));
15433    assert_eq! (unsafe {
15434                & ( * ( 0 as * const sockaddr ) ) . sa_data as * const _ as
15435                usize } , 2usize , concat ! (
15436                "Alignment of field: " , stringify ! ( sockaddr ) , "::" ,
15437                stringify ! ( sa_data ) ));
15438}
15439impl Clone for sockaddr {
15440    fn clone(&self) -> Self { *self }
15441}
15442#[repr(C)]
15443#[derive(Debug, Copy)]
15444pub struct iovec {
15445    pub iov_base: *mut libc::c_void,
15446    pub iov_len: usize,
15447}
15448#[test]
15449fn bindgen_test_layout_iovec() {
15450    assert_eq!(::core::mem::size_of::<iovec>() , 16usize , concat ! (
15451               "Size of: " , stringify ! ( iovec ) ));
15452    assert_eq! (::core::mem::align_of::<iovec>() , 8usize , concat ! (
15453                "Alignment of " , stringify ! ( iovec ) ));
15454    assert_eq! (unsafe {
15455                & ( * ( 0 as * const iovec ) ) . iov_base as * const _ as
15456                usize } , 0usize , concat ! (
15457                "Alignment of field: " , stringify ! ( iovec ) , "::" ,
15458                stringify ! ( iov_base ) ));
15459    assert_eq! (unsafe {
15460                & ( * ( 0 as * const iovec ) ) . iov_len as * const _ as usize
15461                } , 8usize , concat ! (
15462                "Alignment of field: " , stringify ! ( iovec ) , "::" ,
15463                stringify ! ( iov_len ) ));
15464}
15465impl Clone for iovec {
15466    fn clone(&self) -> Self { *self }
15467}
15468#[repr(C)]
15469#[derive(Debug, Copy)]
15470pub struct msghdr {
15471    pub msg_name: *mut libc::c_void,
15472    pub msg_namelen: socklen_t,
15473    pub msg_iov: *mut iovec,
15474    pub msg_iovlen: libc::c_int,
15475    pub msg_control: *mut libc::c_void,
15476    pub msg_controllen: socklen_t,
15477    pub msg_flags: libc::c_int,
15478}
15479#[test]
15480fn bindgen_test_layout_msghdr() {
15481    assert_eq!(::core::mem::size_of::<msghdr>() , 48usize , concat ! (
15482               "Size of: " , stringify ! ( msghdr ) ));
15483    assert_eq! (::core::mem::align_of::<msghdr>() , 8usize , concat ! (
15484                "Alignment of " , stringify ! ( msghdr ) ));
15485    assert_eq! (unsafe {
15486                & ( * ( 0 as * const msghdr ) ) . msg_name as * const _ as
15487                usize } , 0usize , concat ! (
15488                "Alignment of field: " , stringify ! ( msghdr ) , "::" ,
15489                stringify ! ( msg_name ) ));
15490    assert_eq! (unsafe {
15491                & ( * ( 0 as * const msghdr ) ) . msg_namelen as * const _ as
15492                usize } , 8usize , concat ! (
15493                "Alignment of field: " , stringify ! ( msghdr ) , "::" ,
15494                stringify ! ( msg_namelen ) ));
15495    assert_eq! (unsafe {
15496                & ( * ( 0 as * const msghdr ) ) . msg_iov as * const _ as
15497                usize } , 16usize , concat ! (
15498                "Alignment of field: " , stringify ! ( msghdr ) , "::" ,
15499                stringify ! ( msg_iov ) ));
15500    assert_eq! (unsafe {
15501                & ( * ( 0 as * const msghdr ) ) . msg_iovlen as * const _ as
15502                usize } , 24usize , concat ! (
15503                "Alignment of field: " , stringify ! ( msghdr ) , "::" ,
15504                stringify ! ( msg_iovlen ) ));
15505    assert_eq! (unsafe {
15506                & ( * ( 0 as * const msghdr ) ) . msg_control as * const _ as
15507                usize } , 32usize , concat ! (
15508                "Alignment of field: " , stringify ! ( msghdr ) , "::" ,
15509                stringify ! ( msg_control ) ));
15510    assert_eq! (unsafe {
15511                & ( * ( 0 as * const msghdr ) ) . msg_controllen as * const _
15512                as usize } , 40usize , concat ! (
15513                "Alignment of field: " , stringify ! ( msghdr ) , "::" ,
15514                stringify ! ( msg_controllen ) ));
15515    assert_eq! (unsafe {
15516                & ( * ( 0 as * const msghdr ) ) . msg_flags as * const _ as
15517                usize } , 44usize , concat ! (
15518                "Alignment of field: " , stringify ! ( msghdr ) , "::" ,
15519                stringify ! ( msg_flags ) ));
15520}
15521impl Clone for msghdr {
15522    fn clone(&self) -> Self { *self }
15523}
15524extern "C" {
15525    pub fn accept(arg1: libc::c_int, arg2: *mut sockaddr,
15526                  arg3: *mut socklen_t) -> libc::c_int;
15527}
15528extern "C" {
15529    pub fn bind(arg1: libc::c_int, arg2: *const sockaddr, arg3: socklen_t)
15530     -> libc::c_int;
15531}
15532extern "C" {
15533    pub fn connect(arg1: libc::c_int, arg2: *const sockaddr, arg3: socklen_t)
15534     -> libc::c_int;
15535}
15536extern "C" {
15537    pub fn getpeername(arg1: libc::c_int, arg2: *mut sockaddr,
15538                       arg3: *mut socklen_t) -> libc::c_int;
15539}
15540extern "C" {
15541    pub fn getsockname(arg1: libc::c_int, arg2: *mut sockaddr,
15542                       arg3: *mut socklen_t) -> libc::c_int;
15543}
15544extern "C" {
15545    pub fn getsockopt(arg1: libc::c_int, arg2: libc::c_int, arg3: libc::c_int,
15546                      arg4: *mut libc::c_void, arg5: *mut socklen_t)
15547     -> libc::c_int;
15548}
15549extern "C" {
15550    pub fn listen(arg1: libc::c_int, arg2: libc::c_int) -> libc::c_int;
15551}
15552extern "C" {
15553    pub fn recv(arg1: libc::c_int, arg2: *mut libc::c_void, arg3: usize,
15554                arg4: libc::c_int) -> isize;
15555}
15556extern "C" {
15557    pub fn recvfrom(arg1: libc::c_int, arg2: *mut libc::c_void, arg3: usize,
15558                    arg4: libc::c_int, arg5: *mut sockaddr,
15559                    arg6: *mut socklen_t) -> isize;
15560}
15561extern "C" {
15562    pub fn recvmsg(s: libc::c_int, msg: *mut msghdr, flags: libc::c_int)
15563     -> isize;
15564}
15565extern "C" {
15566    pub fn send(arg1: libc::c_int, arg2: *const libc::c_void, arg3: usize,
15567                arg4: libc::c_int) -> isize;
15568}
15569extern "C" {
15570    pub fn sendto(arg1: libc::c_int, arg2: *const libc::c_void, arg3: usize,
15571                  arg4: libc::c_int, arg5: *const sockaddr, arg6: socklen_t)
15572     -> isize;
15573}
15574extern "C" {
15575    pub fn sendmsg(s: libc::c_int, msg: *const msghdr, flags: libc::c_int)
15576     -> isize;
15577}
15578extern "C" {
15579    pub fn setsockopt(arg1: libc::c_int, arg2: libc::c_int, arg3: libc::c_int,
15580                      arg4: *const libc::c_void, arg5: socklen_t)
15581     -> libc::c_int;
15582}
15583extern "C" {
15584    pub fn shutdown(arg1: libc::c_int, arg2: libc::c_int) -> libc::c_int;
15585}
15586extern "C" {
15587    pub fn socket(arg1: libc::c_int, arg2: libc::c_int, arg3: libc::c_int)
15588     -> libc::c_int;
15589}
15590extern "C" {
15591    pub fn sceNetInetAccept(s: libc::c_int, addr: *mut sockaddr,
15592                            addrlen: *mut socklen_t) -> libc::c_int;
15593}
15594extern "C" {
15595    pub fn sceNetInetBind(s: libc::c_int, my_addr: *const sockaddr,
15596                          addrlen: socklen_t) -> libc::c_int;
15597}
15598extern "C" {
15599    pub fn sceNetInetConnect(s: libc::c_int, serv_addr: *const sockaddr,
15600                             addrlen: socklen_t) -> libc::c_int;
15601}
15602extern "C" {
15603    pub fn sceNetInetGetsockopt(s: libc::c_int, level: libc::c_int,
15604                                optname: libc::c_int,
15605                                optval: *mut libc::c_void,
15606                                optlen: *mut socklen_t) -> libc::c_int;
15607}
15608extern "C" {
15609    pub fn sceNetInetListen(s: libc::c_int, backlog: libc::c_int)
15610     -> libc::c_int;
15611}
15612extern "C" {
15613    pub fn sceNetInetRecv(s: libc::c_int, buf: *mut libc::c_void, len: usize,
15614                          flags: libc::c_int) -> isize;
15615}
15616extern "C" {
15617    pub fn sceNetInetRecvfrom(s: libc::c_int, buf: *mut libc::c_void,
15618                              flags: usize, arg1: libc::c_int,
15619                              from: *mut sockaddr, fromlen: *mut socklen_t)
15620     -> isize;
15621}
15622extern "C" {
15623    pub fn sceNetInetRecvmsg(s: libc::c_int, msg: *mut msghdr,
15624                             flags: libc::c_int) -> isize;
15625}
15626extern "C" {
15627    pub fn sceNetInetSend(s: libc::c_int, buf: *const libc::c_void,
15628                          len: usize, flags: libc::c_int) -> isize;
15629}
15630extern "C" {
15631    pub fn sceNetInetSendto(s: libc::c_int, buf: *const libc::c_void,
15632                            len: usize, flags: libc::c_int,
15633                            to: *const sockaddr, tolen: socklen_t) -> isize;
15634}
15635extern "C" {
15636    pub fn sceNetInetSendmsg(s: libc::c_int, msg: *const msghdr,
15637                             flags: libc::c_int) -> isize;
15638}
15639extern "C" {
15640    pub fn sceNetInetSetsockopt(s: libc::c_int, level: libc::c_int,
15641                                optname: libc::c_int,
15642                                optval: *const libc::c_void,
15643                                optlen: socklen_t) -> libc::c_int;
15644}
15645extern "C" {
15646    pub fn sceNetInetShutdown(s: libc::c_int, how: libc::c_int)
15647     -> libc::c_int;
15648}
15649extern "C" {
15650    pub fn sceNetInetSocket(domain: libc::c_int, type_: libc::c_int,
15651                            protocol: libc::c_int) -> libc::c_int;
15652}
15653extern "C" {
15654    pub fn sceNetInetClose(s: libc::c_int) -> libc::c_int;
15655}
15656extern "C" {
15657    pub fn sceNetInetGetErrno() -> libc::c_int;
15658}
15659extern "C" {
15660    pub fn sceNetInetGetsockname(s: libc::c_int, name: *mut sockaddr,
15661                                 namelen: *mut socklen_t) -> libc::c_int;
15662}
15663extern "C" {
15664    pub fn sceNetInetGetpeername(s: libc::c_int, name: *mut sockaddr,
15665                                 namelen: *mut socklen_t) -> libc::c_int;
15666}
15667pub type in_addr_t = u32;
15668pub type in_port_t = u16;
15669#[repr(C, packed)]
15670#[derive(Debug, Copy)]
15671pub struct in_addr {
15672    pub s_addr: in_addr_t,
15673}
15674#[test]
15675fn bindgen_test_layout_in_addr() {
15676    assert_eq!(::core::mem::size_of::<in_addr>() , 4usize , concat ! (
15677               "Size of: " , stringify ! ( in_addr ) ));
15678    assert_eq! (::core::mem::align_of::<in_addr>() , 1usize , concat ! (
15679                "Alignment of " , stringify ! ( in_addr ) ));
15680    assert_eq! (unsafe {
15681                & ( * ( 0 as * const in_addr ) ) . s_addr as * const _ as
15682                usize } , 0usize , concat ! (
15683                "Alignment of field: " , stringify ! ( in_addr ) , "::" ,
15684                stringify ! ( s_addr ) ));
15685}
15686impl Clone for in_addr {
15687    fn clone(&self) -> Self { *self }
15688}
15689#[repr(C)]
15690#[derive(Debug, Copy)]
15691pub struct sockaddr_in {
15692    pub sin_len: u8,
15693    pub sin_family: sa_family_t,
15694    pub sin_port: in_port_t,
15695    pub sin_addr: in_addr,
15696    pub sin_zero: [i8; 8usize],
15697}
15698#[test]
15699fn bindgen_test_layout_sockaddr_in() {
15700    assert_eq!(::core::mem::size_of::<sockaddr_in>() , 16usize , concat ! (
15701               "Size of: " , stringify ! ( sockaddr_in ) ));
15702    assert_eq! (::core::mem::align_of::<sockaddr_in>() , 2usize , concat ! (
15703                "Alignment of " , stringify ! ( sockaddr_in ) ));
15704    assert_eq! (unsafe {
15705                & ( * ( 0 as * const sockaddr_in ) ) . sin_len as * const _ as
15706                usize } , 0usize , concat ! (
15707                "Alignment of field: " , stringify ! ( sockaddr_in ) , "::" ,
15708                stringify ! ( sin_len ) ));
15709    assert_eq! (unsafe {
15710                & ( * ( 0 as * const sockaddr_in ) ) . sin_family as * const _
15711                as usize } , 1usize , concat ! (
15712                "Alignment of field: " , stringify ! ( sockaddr_in ) , "::" ,
15713                stringify ! ( sin_family ) ));
15714    assert_eq! (unsafe {
15715                & ( * ( 0 as * const sockaddr_in ) ) . sin_port as * const _
15716                as usize } , 2usize , concat ! (
15717                "Alignment of field: " , stringify ! ( sockaddr_in ) , "::" ,
15718                stringify ! ( sin_port ) ));
15719    assert_eq! (unsafe {
15720                & ( * ( 0 as * const sockaddr_in ) ) . sin_addr as * const _
15721                as usize } , 4usize , concat ! (
15722                "Alignment of field: " , stringify ! ( sockaddr_in ) , "::" ,
15723                stringify ! ( sin_addr ) ));
15724    assert_eq! (unsafe {
15725                & ( * ( 0 as * const sockaddr_in ) ) . sin_zero as * const _
15726                as usize } , 8usize , concat ! (
15727                "Alignment of field: " , stringify ! ( sockaddr_in ) , "::" ,
15728                stringify ! ( sin_zero ) ));
15729}
15730impl Clone for sockaddr_in {
15731    fn clone(&self) -> Self { *self }
15732}
15733#[repr(C)]
15734#[derive(Copy)]
15735pub struct ip_opts {
15736    pub ip_dst: in_addr,
15737    pub ip_opts: [i8; 40usize],
15738}
15739#[test]
15740fn bindgen_test_layout_ip_opts() {
15741    assert_eq!(::core::mem::size_of::<ip_opts>() , 44usize , concat ! (
15742               "Size of: " , stringify ! ( ip_opts ) ));
15743    assert_eq! (::core::mem::align_of::<ip_opts>() , 1usize , concat ! (
15744                "Alignment of " , stringify ! ( ip_opts ) ));
15745    assert_eq! (unsafe {
15746                & ( * ( 0 as * const ip_opts ) ) . ip_dst as * const _ as
15747                usize } , 0usize , concat ! (
15748                "Alignment of field: " , stringify ! ( ip_opts ) , "::" ,
15749                stringify ! ( ip_dst ) ));
15750    assert_eq! (unsafe {
15751                & ( * ( 0 as * const ip_opts ) ) . ip_opts as * const _ as
15752                usize } , 4usize , concat ! (
15753                "Alignment of field: " , stringify ! ( ip_opts ) , "::" ,
15754                stringify ! ( ip_opts ) ));
15755}
15756impl Clone for ip_opts {
15757    fn clone(&self) -> Self { *self }
15758}
15759#[repr(C)]
15760#[derive(Debug, Copy)]
15761pub struct ip_mreq {
15762    pub imr_multiaddr: in_addr,
15763    pub imr_interface: in_addr,
15764}
15765#[test]
15766fn bindgen_test_layout_ip_mreq() {
15767    assert_eq!(::core::mem::size_of::<ip_mreq>() , 8usize , concat ! (
15768               "Size of: " , stringify ! ( ip_mreq ) ));
15769    assert_eq! (::core::mem::align_of::<ip_mreq>() , 1usize , concat ! (
15770                "Alignment of " , stringify ! ( ip_mreq ) ));
15771    assert_eq! (unsafe {
15772                & ( * ( 0 as * const ip_mreq ) ) . imr_multiaddr as * const _
15773                as usize } , 0usize , concat ! (
15774                "Alignment of field: " , stringify ! ( ip_mreq ) , "::" ,
15775                stringify ! ( imr_multiaddr ) ));
15776    assert_eq! (unsafe {
15777                & ( * ( 0 as * const ip_mreq ) ) . imr_interface as * const _
15778                as usize } , 4usize , concat ! (
15779                "Alignment of field: " , stringify ! ( ip_mreq ) , "::" ,
15780                stringify ! ( imr_interface ) ));
15781}
15782impl Clone for ip_mreq {
15783    fn clone(&self) -> Self { *self }
15784}
15785extern "C" {
15786    /// Inititalise the resolver library
15787///
15788/// @return 0 on sucess, < 0 on error.
15789    pub fn sceNetResolverInit() -> libc::c_int;
15790}
15791extern "C" {
15792    /// Create a resolver object
15793///
15794/// @param rid - Pointer to receive the resolver id
15795/// @param buf - Temporary buffer
15796/// @param buflen - Length of the temporary buffer
15797///
15798/// @return 0 on success, < 0 on error
15799    pub fn sceNetResolverCreate(rid: *mut libc::c_int, buf: *mut libc::c_void,
15800                                buflen: SceSize) -> libc::c_int;
15801}
15802extern "C" {
15803    /// Delete a resolver
15804///
15805/// @param rid - The resolver to delete
15806///
15807/// @return 0 on success, < 0 on error
15808    pub fn sceNetResolverDelete(rid: libc::c_int) -> libc::c_int;
15809}
15810extern "C" {
15811    /// Begin a name to address lookup
15812///
15813/// @param rid - Resolver id
15814/// @param hostname - Name to resolve
15815/// @param addr - Pointer to in_addr structure to receive the address
15816/// @param timeout - Number of seconds before timeout
15817/// @param retry - Number of retires
15818///
15819/// @return 0 on success, < 0 on error
15820    pub fn sceNetResolverStartNtoA(rid: libc::c_int,
15821                                   hostname: *const libc::c_char,
15822                                   addr: *mut in_addr, timeout: libc::c_uint,
15823                                   retry: libc::c_int) -> libc::c_int;
15824}
15825extern "C" {
15826    /// Begin a address to name lookup
15827///
15828/// @param rid -Resolver id
15829/// @param addr - Pointer to the address to resolve
15830/// @param hostname - Buffer to receive the name
15831/// @param hostname_len - Length of the buffer
15832/// @param timeout - Number of seconds before timeout
15833/// @param retry - Number of retries
15834///
15835/// @return 0 on success, < 0 on error
15836    pub fn sceNetResolverStartAtoN(rid: libc::c_int, addr: *const in_addr,
15837                                   hostname: *mut libc::c_char,
15838                                   hostname_len: SceSize,
15839                                   timeout: libc::c_uint, retry: libc::c_int)
15840     -> libc::c_int;
15841}
15842extern "C" {
15843    /// Stop a resolver operation
15844///
15845/// @param rid - Resolver id
15846///
15847/// @return 0 on success, < 0 on error
15848    pub fn sceNetResolverStop(rid: libc::c_int) -> libc::c_int;
15849}
15850extern "C" {
15851    /// Terminate the resolver library
15852///
15853/// @return 0 on success, < 0 on error
15854    pub fn sceNetResolverTerm() -> libc::c_int;
15855}
15856#[repr(C)]
15857#[derive(Debug, Copy)]
15858pub struct PspOpenPSID {
15859    pub data: [libc::c_uchar; 16usize],
15860}
15861#[test]
15862fn bindgen_test_layout_PspOpenPSID() {
15863    assert_eq!(::core::mem::size_of::<PspOpenPSID>() , 16usize , concat ! (
15864               "Size of: " , stringify ! ( PspOpenPSID ) ));
15865    assert_eq! (::core::mem::align_of::<PspOpenPSID>() , 1usize , concat ! (
15866                "Alignment of " , stringify ! ( PspOpenPSID ) ));
15867    assert_eq! (unsafe {
15868                & ( * ( 0 as * const PspOpenPSID ) ) . data as * const _ as
15869                usize } , 0usize , concat ! (
15870                "Alignment of field: " , stringify ! ( PspOpenPSID ) , "::" ,
15871                stringify ! ( data ) ));
15872}
15873impl Clone for PspOpenPSID {
15874    fn clone(&self) -> Self { *self }
15875}
15876extern "C" {
15877    pub fn sceOpenPSIDGetOpenPSID(openpsid: *mut PspOpenPSID) -> libc::c_int;
15878}
15879/// Power Callback Function Definition
15880///
15881/// @param unknown - unknown function, appears to cycle between 1,2 and 3
15882/// @param powerInfo - combination of PSP_POWER_CB_ flags
15883pub type powerCallback_t =
15884    ::core::option::Option<unsafe extern "C" fn(unknown: libc::c_int,
15885                                                powerInfo: libc::c_int)>;
15886extern "C" {
15887    /// Register Power Callback Function
15888///
15889/// @param slot - slot of the callback in the list, 0 to 15, pass -1 to get an auto assignment.
15890/// @param cbid - callback id from calling sceKernelCreateCallback
15891///
15892/// @return 0 on success, the slot number if -1 is passed, < 0 on error.
15893    pub fn scePowerRegisterCallback(slot: libc::c_int, cbid: SceUID)
15894     -> libc::c_int;
15895}
15896extern "C" {
15897    /// Unregister Power Callback Function
15898///
15899/// @param slot - slot of the callback
15900///
15901/// @return 0 on success, < 0 on error.
15902    pub fn scePowerUnregisterCallback(slot: libc::c_int) -> libc::c_int;
15903}
15904extern "C" {
15905    /// Check if unit is plugged in
15906///
15907/// @return 1 if plugged in, 0 if not plugged in, < 0 on error.
15908    pub fn scePowerIsPowerOnline() -> libc::c_int;
15909}
15910extern "C" {
15911    /// Check if a battery is present
15912///
15913/// @return 1 if battery present, 0 if battery not present, < 0 on error.
15914    pub fn scePowerIsBatteryExist() -> libc::c_int;
15915}
15916extern "C" {
15917    /// Check if the battery is charging
15918///
15919/// @return 1 if battery charging, 0 if battery not charging, < 0 on error.
15920    pub fn scePowerIsBatteryCharging() -> libc::c_int;
15921}
15922extern "C" {
15923    /// Get the status of the battery charging
15924    pub fn scePowerGetBatteryChargingStatus() -> libc::c_int;
15925}
15926extern "C" {
15927    /// Check if the battery is low
15928///
15929/// @return 1 if the battery is low, 0 if the battery is not low, < 0 on error.
15930    pub fn scePowerIsLowBattery() -> libc::c_int;
15931}
15932extern "C" {
15933    /// Get battery life as integer percent
15934///
15935/// @return Battery charge percentage (0-100), < 0 on error.
15936    pub fn scePowerGetBatteryLifePercent() -> libc::c_int;
15937}
15938extern "C" {
15939    /// Get battery life as time
15940///
15941/// @return Battery life in minutes, < 0 on error.
15942    pub fn scePowerGetBatteryLifeTime() -> libc::c_int;
15943}
15944extern "C" {
15945    /// Get temperature of the battery
15946    pub fn scePowerGetBatteryTemp() -> libc::c_int;
15947}
15948extern "C" {
15949    /// unknown? - crashes PSP in usermode
15950    pub fn scePowerGetBatteryElec() -> libc::c_int;
15951}
15952extern "C" {
15953    /// Get battery volt level
15954    pub fn scePowerGetBatteryVolt() -> libc::c_int;
15955}
15956extern "C" {
15957    /// Set CPU Frequency
15958/// @param cpufreq - new CPU frequency, valid values are 1 - 333
15959    pub fn scePowerSetCpuClockFrequency(cpufreq: libc::c_int) -> libc::c_int;
15960}
15961extern "C" {
15962    /// Set Bus Frequency
15963/// @param busfreq - new BUS frequency, valid values are 1 - 167
15964    pub fn scePowerSetBusClockFrequency(busfreq: libc::c_int) -> libc::c_int;
15965}
15966extern "C" {
15967    /// Alias for scePowerGetCpuClockFrequencyInt
15968/// @return frequency as int
15969    pub fn scePowerGetCpuClockFrequency() -> libc::c_int;
15970}
15971extern "C" {
15972    /// Get CPU Frequency as Integer
15973/// @return frequency as int
15974    pub fn scePowerGetCpuClockFrequencyInt() -> libc::c_int;
15975}
15976extern "C" {
15977    /// Get CPU Frequency as Float
15978/// @return frequency as float
15979    pub fn scePowerGetCpuClockFrequencyFloat() -> f32;
15980}
15981extern "C" {
15982    /// Alias for scePowerGetBusClockFrequencyInt
15983/// @return frequency as int
15984    pub fn scePowerGetBusClockFrequency() -> libc::c_int;
15985}
15986extern "C" {
15987    /// Get Bus fequency as Integer
15988/// @return frequency as int
15989    pub fn scePowerGetBusClockFrequencyInt() -> libc::c_int;
15990}
15991extern "C" {
15992    /// Get Bus frequency as Float
15993/// @return frequency as float
15994    pub fn scePowerGetBusClockFrequencyFloat() -> f32;
15995}
15996extern "C" {
15997    /// Set Clock Frequencies
15998///
15999/// @param pllfreq - pll frequency, valid from 19-333
16000/// @param cpufreq - cpu frequency, valid from 1-333
16001/// @param busfreq - bus frequency, valid from 1-167
16002///
16003/// and:
16004///
16005/// cpufreq <= pllfreq
16006/// busfreq*2 <= pllfreq
16007///
16008    pub fn scePowerSetClockFrequency(pllfreq: libc::c_int,
16009                                     cpufreq: libc::c_int,
16010                                     busfreq: libc::c_int) -> libc::c_int;
16011}
16012extern "C" {
16013    /// Lock power switch
16014///
16015/// Note: if the power switch is toggled while locked
16016/// it will fire immediately after being unlocked.
16017///
16018/// @param unknown - pass 0
16019///
16020/// @return 0 on success, < 0 on error.
16021    pub fn scePowerLock(unknown: libc::c_int) -> libc::c_int;
16022}
16023extern "C" {
16024    /// Unlock power switch
16025///
16026/// @param unknown - pass 0
16027///
16028/// @return 0 on success, < 0 on error.
16029    pub fn scePowerUnlock(unknown: libc::c_int) -> libc::c_int;
16030}
16031extern "C" {
16032    /// Generate a power tick, preventing unit from
16033/// powering off and turning off display.
16034///
16035/// @param type - Either PSP_POWER_TICK_ALL, PSP_POWER_TICK_SUSPEND or PSP_POWER_TICK_DISPLAY
16036///
16037/// @return 0 on success, < 0 on error.
16038    pub fn scePowerTick(type_: libc::c_int) -> libc::c_int;
16039}
16040extern "C" {
16041    /// Get Idle timer
16042///
16043    pub fn scePowerGetIdleTimer() -> libc::c_int;
16044}
16045extern "C" {
16046    /// Enable Idle timer
16047///
16048/// @param unknown - pass 0
16049    pub fn scePowerIdleTimerEnable(unknown: libc::c_int) -> libc::c_int;
16050}
16051extern "C" {
16052    /// Disable Idle timer
16053///
16054/// @param unknown - pass 0
16055    pub fn scePowerIdleTimerDisable(unknown: libc::c_int) -> libc::c_int;
16056}
16057extern "C" {
16058    /// Request the PSP to go into standby
16059///
16060/// @return 0 always
16061    pub fn scePowerRequestStandby() -> libc::c_int;
16062}
16063extern "C" {
16064    /// Request the PSP to go into suspend
16065///
16066/// @return 0 always
16067    pub fn scePowerRequestSuspend() -> libc::c_int;
16068}
16069extern "C" {
16070    pub fn gprof_cleanup();
16071}
16072#[repr(u32)]
16073/// Key types
16074#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
16075pub enum RegKeyTypes {
16076    REG_TYPE_DIR = 1,
16077    REG_TYPE_INT = 2,
16078    REG_TYPE_STR = 3,
16079    REG_TYPE_BIN = 4,
16080}
16081/// Typedef for a registry handle
16082pub type REGHANDLE = libc::c_uint;
16083/// Struct used to open a registry
16084#[repr(C)]
16085#[derive(Copy)]
16086pub struct RegParam {
16087    pub regtype: libc::c_uint,
16088    /// Seemingly never used, set to ::SYSTEM_REGISTRY
16089    pub name: [libc::c_char; 256usize],
16090    /// Length of the name
16091    pub namelen: libc::c_uint,
16092    /// Unknown, set to 1
16093    pub unk2: libc::c_uint,
16094    /// Unknown, set to 1
16095    pub unk3: libc::c_uint,
16096}
16097#[test]
16098fn bindgen_test_layout_RegParam() {
16099    assert_eq!(::core::mem::size_of::<RegParam>() , 272usize , concat ! (
16100               "Size of: " , stringify ! ( RegParam ) ));
16101    assert_eq! (::core::mem::align_of::<RegParam>() , 4usize , concat ! (
16102                "Alignment of " , stringify ! ( RegParam ) ));
16103    assert_eq! (unsafe {
16104                & ( * ( 0 as * const RegParam ) ) . regtype as * const _ as
16105                usize } , 0usize , concat ! (
16106                "Alignment of field: " , stringify ! ( RegParam ) , "::" ,
16107                stringify ! ( regtype ) ));
16108    assert_eq! (unsafe {
16109                & ( * ( 0 as * const RegParam ) ) . name as * const _ as usize
16110                } , 4usize , concat ! (
16111                "Alignment of field: " , stringify ! ( RegParam ) , "::" ,
16112                stringify ! ( name ) ));
16113    assert_eq! (unsafe {
16114                & ( * ( 0 as * const RegParam ) ) . namelen as * const _ as
16115                usize } , 260usize , concat ! (
16116                "Alignment of field: " , stringify ! ( RegParam ) , "::" ,
16117                stringify ! ( namelen ) ));
16118    assert_eq! (unsafe {
16119                & ( * ( 0 as * const RegParam ) ) . unk2 as * const _ as usize
16120                } , 264usize , concat ! (
16121                "Alignment of field: " , stringify ! ( RegParam ) , "::" ,
16122                stringify ! ( unk2 ) ));
16123    assert_eq! (unsafe {
16124                & ( * ( 0 as * const RegParam ) ) . unk3 as * const _ as usize
16125                } , 268usize , concat ! (
16126                "Alignment of field: " , stringify ! ( RegParam ) , "::" ,
16127                stringify ! ( unk3 ) ));
16128}
16129impl Clone for RegParam {
16130    fn clone(&self) -> Self { *self }
16131}
16132extern "C" {
16133    /// Open the registry
16134///
16135/// @param reg - A filled in ::RegParam structure
16136/// @param mode - Open mode (set to 1)
16137/// @param h - Pointer to a REGHANDLE to receive the registry handle
16138///
16139/// @return 0 on success, < 0 on error
16140    pub fn sceRegOpenRegistry(reg: *mut RegParam, mode: libc::c_int,
16141                              h: *mut REGHANDLE) -> libc::c_int;
16142}
16143extern "C" {
16144    /// Flush the registry to disk
16145///
16146/// @param h - The open registry handle
16147///
16148/// @return 0 on success, < 0 on error
16149    pub fn sceRegFlushRegistry(h: REGHANDLE) -> libc::c_int;
16150}
16151extern "C" {
16152    /// Close the registry
16153///
16154/// @param h - The open registry handle
16155///
16156/// @return 0 on success, < 0 on error
16157    pub fn sceRegCloseRegistry(h: REGHANDLE) -> libc::c_int;
16158}
16159extern "C" {
16160    /// Open a registry directory
16161///
16162/// @param h - The open registry handle
16163/// @param name - The path to the dir to open (e.g. /CONFIG/SYSTEM)
16164/// @param mode - Open mode (can be 1 or 2, probably read or read/write
16165/// @param hd - Pointer to a REGHANDLE to receive the registry dir handle
16166///
16167/// @return 0 on success, < 0 on error
16168    pub fn sceRegOpenCategory(h: REGHANDLE, name: *const libc::c_char,
16169                              mode: libc::c_int, hd: *mut REGHANDLE)
16170     -> libc::c_int;
16171}
16172extern "C" {
16173    /// Remove a registry dir
16174///
16175/// @param h - The open registry dir handle
16176/// @param name - The name of the key
16177///
16178/// @return 0 on success, < 0 on error
16179    pub fn sceRegRemoveCategory(h: REGHANDLE, name: *const libc::c_char)
16180     -> libc::c_int;
16181}
16182extern "C" {
16183    /// Close the registry directory
16184///
16185/// @param hd - The open registry dir handle
16186///
16187/// @return 0 on success, < 0 on error
16188    pub fn sceRegCloseCategory(hd: REGHANDLE) -> libc::c_int;
16189}
16190extern "C" {
16191    /// Flush the registry directory to disk
16192///
16193/// @param hd - The open registry dir handle
16194///
16195/// @return 0 on success, < 0 on error
16196    pub fn sceRegFlushCategory(hd: REGHANDLE) -> libc::c_int;
16197}
16198extern "C" {
16199    /// Get a key's information
16200///
16201/// @param hd - The open registry dir handle
16202/// @param name - Name of the key
16203/// @param hk - Pointer to a REGHANDLE to get registry key handle
16204/// @param type - Type of the key, on of ::RegKeyTypes
16205/// @param size - The size of the key's value in bytes
16206///
16207/// @return 0 on success, < 0 on error
16208    pub fn sceRegGetKeyInfo(hd: REGHANDLE, name: *const libc::c_char,
16209                            hk: *mut REGHANDLE, type_: *mut libc::c_uint,
16210                            size: *mut SceSize) -> libc::c_int;
16211}
16212extern "C" {
16213    /// Get a key's information by name
16214///
16215/// @param hd - The open registry dir handle
16216/// @param name - Name of the key
16217/// @param type - Type of the key, on of ::RegKeyTypes
16218/// @param size - The size of the key's value in bytes
16219///
16220/// @return 0 on success, < 0 on error
16221    pub fn sceRegGetKeyInfoByName(hd: REGHANDLE, name: *const libc::c_char,
16222                                  type_: *mut libc::c_uint,
16223                                  size: *mut SceSize) -> libc::c_int;
16224}
16225extern "C" {
16226    /// Get a key's value
16227///
16228/// @param hd - The open registry dir handle
16229/// @param hk - The open registry key handler (from ::sceRegGetKeyInfo)
16230/// @param buf - Buffer to hold the value
16231/// @param size - The size of the buffer
16232///
16233/// @return 0 on success, < 0 on error
16234    pub fn sceRegGetKeyValue(hd: REGHANDLE, hk: REGHANDLE,
16235                             buf: *mut libc::c_void, size: SceSize)
16236     -> libc::c_int;
16237}
16238extern "C" {
16239    /// Get a key's value by name
16240///
16241/// @param hd - The open registry dir handle
16242/// @param name - The key name
16243/// @param buf - Buffer to hold the value
16244/// @param size - The size of the buffer
16245///
16246/// @return 0 on success, < 0 on error
16247    pub fn sceRegGetKeyValueByName(hd: REGHANDLE, name: *const libc::c_char,
16248                                   buf: *mut libc::c_void, size: SceSize)
16249     -> libc::c_int;
16250}
16251extern "C" {
16252    /// Set a key's value
16253///
16254/// @param hd - The open registry dir handle
16255/// @param name - The key name
16256/// @param buf - Buffer to hold the value
16257/// @param size - The size of the buffer
16258///
16259/// @return 0 on success, < 0 on error
16260    pub fn sceRegSetKeyValue(hd: REGHANDLE, name: *const libc::c_char,
16261                             buf: *const libc::c_void, size: SceSize)
16262     -> libc::c_int;
16263}
16264extern "C" {
16265    /// Get number of subkeys in the current dir
16266///
16267/// @param hd - The open registry dir handle
16268/// @param num - Pointer to an integer to receive the number
16269///
16270/// @return 0 on success, < 0 on error
16271    pub fn sceRegGetKeysNum(hd: REGHANDLE, num: *mut libc::c_int)
16272     -> libc::c_int;
16273}
16274extern "C" {
16275    /// Get the key names in the current directory
16276///
16277/// @param hd - The open registry dir handle
16278/// @param buf - Buffer to hold the NUL terminated strings, should be num*REG_KEYNAME_SIZE
16279/// @param num - Number of elements in buf
16280///
16281/// @return 0 on success, < 0 on error
16282    pub fn sceRegGetKeys(hd: REGHANDLE, buf: *mut libc::c_char,
16283                         num: libc::c_int) -> libc::c_int;
16284}
16285extern "C" {
16286    /// Create a key
16287///
16288/// @param hd - The open registry dir handle
16289/// @param name - Name of the key to create
16290/// @param type - Type of key (note cannot be a directory type)
16291/// @param size - Size of the allocated value space
16292///
16293/// @return 0 on success, < 0 on error
16294    pub fn sceRegCreateKey(hd: REGHANDLE, name: *const libc::c_char,
16295                           type_: libc::c_int, size: SceSize) -> libc::c_int;
16296}
16297extern "C" {
16298    /// Remove a registry (HONESTLY, DO NOT USE)
16299///
16300/// @param reg - Filled out registry parameter
16301///
16302/// @return 0 on success, < 0 on error
16303    pub fn sceRegRemoveRegistry(reg: *mut RegParam) -> libc::c_int;
16304}
16305#[repr(C)]
16306#[derive(Debug, Copy)]
16307pub struct pspTime {
16308    pub year: u16,
16309    pub month: u16,
16310    pub day: u16,
16311    pub hour: u16,
16312    pub minutes: u16,
16313    pub seconds: u16,
16314    pub microseconds: u32,
16315}
16316#[test]
16317fn bindgen_test_layout_pspTime() {
16318    assert_eq!(::core::mem::size_of::<pspTime>() , 16usize , concat ! (
16319               "Size of: " , stringify ! ( pspTime ) ));
16320    assert_eq! (::core::mem::align_of::<pspTime>() , 4usize , concat ! (
16321                "Alignment of " , stringify ! ( pspTime ) ));
16322    assert_eq! (unsafe {
16323                & ( * ( 0 as * const pspTime ) ) . year as * const _ as usize
16324                } , 0usize , concat ! (
16325                "Alignment of field: " , stringify ! ( pspTime ) , "::" ,
16326                stringify ! ( year ) ));
16327    assert_eq! (unsafe {
16328                & ( * ( 0 as * const pspTime ) ) . month as * const _ as usize
16329                } , 2usize , concat ! (
16330                "Alignment of field: " , stringify ! ( pspTime ) , "::" ,
16331                stringify ! ( month ) ));
16332    assert_eq! (unsafe {
16333                & ( * ( 0 as * const pspTime ) ) . day as * const _ as usize }
16334                , 4usize , concat ! (
16335                "Alignment of field: " , stringify ! ( pspTime ) , "::" ,
16336                stringify ! ( day ) ));
16337    assert_eq! (unsafe {
16338                & ( * ( 0 as * const pspTime ) ) . hour as * const _ as usize
16339                } , 6usize , concat ! (
16340                "Alignment of field: " , stringify ! ( pspTime ) , "::" ,
16341                stringify ! ( hour ) ));
16342    assert_eq! (unsafe {
16343                & ( * ( 0 as * const pspTime ) ) . minutes as * const _ as
16344                usize } , 8usize , concat ! (
16345                "Alignment of field: " , stringify ! ( pspTime ) , "::" ,
16346                stringify ! ( minutes ) ));
16347    assert_eq! (unsafe {
16348                & ( * ( 0 as * const pspTime ) ) . seconds as * const _ as
16349                usize } , 10usize , concat ! (
16350                "Alignment of field: " , stringify ! ( pspTime ) , "::" ,
16351                stringify ! ( seconds ) ));
16352    assert_eq! (unsafe {
16353                & ( * ( 0 as * const pspTime ) ) . microseconds as * const _
16354                as usize } , 12usize , concat ! (
16355                "Alignment of field: " , stringify ! ( pspTime ) , "::" ,
16356                stringify ! ( microseconds ) ));
16357}
16358impl Clone for pspTime {
16359    fn clone(&self) -> Self { *self }
16360}
16361#[repr(i32)]
16362#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
16363pub enum pspRtcCheckValidErrors {
16364    PSP_TIME_INVALID_YEAR = -1,
16365    PSP_TIME_INVALID_MONTH = -2,
16366    PSP_TIME_INVALID_DAY = -3,
16367    PSP_TIME_INVALID_HOUR = -4,
16368    PSP_TIME_INVALID_MINUTES = -5,
16369    PSP_TIME_INVALID_SECONDS = -6,
16370    PSP_TIME_INVALID_MICROSECONDS = -7,
16371}
16372extern "C" {
16373    /// Get the resolution of the tick counter
16374///
16375/// @return # of ticks per second
16376    pub fn sceRtcGetTickResolution() -> u32;
16377}
16378extern "C" {
16379    /// Get current tick count
16380///
16381/// @param tick - pointer to u64 to receive tick count
16382/// @return 0 on success, < 0 on error
16383    pub fn sceRtcGetCurrentTick(tick: *mut u64) -> libc::c_int;
16384}
16385extern "C" {
16386    /// Get current tick count, adjusted for local time zone
16387///
16388/// @param time - pointer to pspTime struct to receive time
16389/// @param tz - time zone to adjust to (minutes from UTC)
16390/// @return 0 on success, < 0 on error
16391    pub fn sceRtcGetCurrentClock(time: *mut pspTime, tz: libc::c_int)
16392     -> libc::c_int;
16393}
16394extern "C" {
16395    /// Get current local time into a pspTime struct
16396///
16397/// @param time - pointer to pspTime struct to receive time
16398/// @return 0 on success, < 0 on error
16399    pub fn sceRtcGetCurrentClockLocalTime(time: *mut pspTime) -> libc::c_int;
16400}
16401extern "C" {
16402    /// Convert a UTC-based tickcount into a local time tick count
16403///
16404/// @param tickUTC - pointer to u64 tick in UTC time
16405/// @param tickLocal - pointer to u64 to receive tick in local time
16406/// @return 0 on success, < 0 on error
16407    pub fn sceRtcConvertUtcToLocalTime(tickUTC: *const u64,
16408                                       tickLocal: *mut u64) -> libc::c_int;
16409}
16410extern "C" {
16411    /// Convert a local time based tickcount into a UTC-based tick count
16412///
16413/// @param tickLocal - pointer to u64 tick in local time
16414/// @param tickUTC - pointer to u64 to receive tick in UTC based time
16415/// @return 0 on success, < 0 on error
16416    pub fn sceRtcConvertLocalTimeToUTC(tickLocal: *const u64,
16417                                       tickUTC: *mut u64) -> libc::c_int;
16418}
16419extern "C" {
16420    /// Check if a year is a leap year
16421///
16422/// @param year - year to check if is a leap year
16423/// @return 1 on leapyear, 0 if not
16424    pub fn sceRtcIsLeapYear(year: libc::c_int) -> libc::c_int;
16425}
16426extern "C" {
16427    /// Get number of days in a specific month
16428///
16429/// @param year - year in which to check (accounts for leap year)
16430/// @param month - month to get number of days for
16431/// @return # of days in month, <0 on error (?)
16432    pub fn sceRtcGetDaysInMonth(year: libc::c_int, month: libc::c_int)
16433     -> libc::c_int;
16434}
16435extern "C" {
16436    /// Get day of the week for a date
16437///
16438/// @param year - year in which to check (accounts for leap year)
16439/// @param month - month that day is in
16440/// @param day - day to get day of week for
16441/// @return day of week with 0 representing Monday
16442    pub fn sceRtcGetDayOfWeek(year: libc::c_int, month: libc::c_int,
16443                              day: libc::c_int) -> libc::c_int;
16444}
16445extern "C" {
16446    /// Validate pspDate component ranges
16447///
16448/// @param date - pointer to pspDate struct to be checked
16449/// @return 0 on success, one of ::pspRtcCheckValidErrors on error
16450    pub fn sceRtcCheckValid(date: *const pspTime) -> libc::c_int;
16451}
16452extern "C" {
16453    /// Set a pspTime struct based on ticks
16454///
16455/// @param date - pointer to pspTime struct to set
16456/// @param tick - pointer to ticks to convert
16457/// @return 0 on success, < 0 on error
16458    pub fn sceRtcSetTick(date: *mut pspTime, tick: *const u64) -> libc::c_int;
16459}
16460extern "C" {
16461    /// Set ticks based on a pspTime struct
16462///
16463/// @param date - pointer to pspTime to convert
16464/// @param tick - pointer to tick to set
16465/// @return 0 on success, < 0 on error
16466    pub fn sceRtcGetTick(date: *const pspTime, tick: *mut u64) -> libc::c_int;
16467}
16468extern "C" {
16469    /// Compare two ticks
16470///
16471/// @param tick1 - pointer to first tick
16472/// @param tick2 - poiinter to second tick
16473/// @return 0 on equal, <0 when tick1 < tick2, >0 when tick1 > tick2
16474    pub fn sceRtcCompareTick(tick1: *const u64, tick2: *const u64)
16475     -> libc::c_int;
16476}
16477extern "C" {
16478    /// Add two ticks
16479///
16480/// @param destTick - pointer to tick to hold result
16481/// @param srcTick - pointer to source tick
16482/// @param numTicks - number of ticks to add
16483/// @return 0 on success, <0 on error
16484    pub fn sceRtcTickAddTicks(destTick: *mut u64, srcTick: *const u64,
16485                              numTicks: u64) -> libc::c_int;
16486}
16487extern "C" {
16488    /// Add an amount of ms to a tick
16489///
16490/// @param destTick - pointer to tick to hold result
16491/// @param srcTick - pointer to source tick
16492/// @param numMS - number of ms to add
16493/// @return 0 on success, <0 on error
16494    pub fn sceRtcTickAddMicroseconds(destTick: *mut u64, srcTick: *const u64,
16495                                     numMS: u64) -> libc::c_int;
16496}
16497extern "C" {
16498    /// Add an amount of seconds to a tick
16499///
16500/// @param destTick - pointer to tick to hold result
16501/// @param srcTick - pointer to source tick
16502/// @param numSecs - number of seconds to add
16503/// @return 0 on success, <0 on error
16504    pub fn sceRtcTickAddSeconds(destTick: *mut u64, srcTick: *const u64,
16505                                numSecs: u64) -> libc::c_int;
16506}
16507extern "C" {
16508    /// Add an amount of minutes to a tick
16509///
16510/// @param destTick - pointer to tick to hold result
16511/// @param srcTick - pointer to source tick
16512/// @param numMins - number of minutes to add
16513/// @return 0 on success, <0 on error
16514    pub fn sceRtcTickAddMinutes(destTick: *mut u64, srcTick: *const u64,
16515                                numMins: u64) -> libc::c_int;
16516}
16517extern "C" {
16518    /// Add an amount of hours to a tick
16519///
16520/// @param destTick - pointer to tick to hold result
16521/// @param srcTick - pointer to source tick
16522/// @param numHours - number of hours to add
16523/// @return 0 on success, <0 on error
16524    pub fn sceRtcTickAddHours(destTick: *mut u64, srcTick: *const u64,
16525                              numHours: libc::c_int) -> libc::c_int;
16526}
16527extern "C" {
16528    /// Add an amount of days to a tick
16529///
16530/// @param destTick - pointer to tick to hold result
16531/// @param srcTick - pointer to source tick
16532/// @param numDays - number of days to add
16533/// @return 0 on success, <0 on error
16534    pub fn sceRtcTickAddDays(destTick: *mut u64, srcTick: *const u64,
16535                             numDays: libc::c_int) -> libc::c_int;
16536}
16537extern "C" {
16538    /// Add an amount of weeks to a tick
16539///
16540/// @param destTick - pointer to tick to hold result
16541/// @param srcTick - pointer to source tick
16542/// @param numWeeks - number of weeks to add
16543/// @return 0 on success, <0 on error
16544    pub fn sceRtcTickAddWeeks(destTick: *mut u64, srcTick: *const u64,
16545                              numWeeks: libc::c_int) -> libc::c_int;
16546}
16547extern "C" {
16548    /// Add an amount of months to a tick
16549///
16550/// @param destTick - pointer to tick to hold result
16551/// @param srcTick - pointer to source tick
16552/// @param numMonths - number of months to add
16553/// @return 0 on success, <0 on error
16554    pub fn sceRtcTickAddMonths(destTick: *mut u64, srcTick: *const u64,
16555                               numMonths: libc::c_int) -> libc::c_int;
16556}
16557extern "C" {
16558    /// Add an amount of years to a tick
16559///
16560/// @param destTick - pointer to tick to hold result
16561/// @param srcTick - pointer to source tick
16562/// @param numYears - number of years to add
16563/// @return 0 on success, <0 on error
16564    pub fn sceRtcTickAddYears(destTick: *mut u64, srcTick: *const u64,
16565                              numYears: libc::c_int) -> libc::c_int;
16566}
16567extern "C" {
16568    pub fn sceRtcSetTime_t(date: *mut pspTime, time: time_t) -> libc::c_int;
16569}
16570extern "C" {
16571    pub fn sceRtcGetTime_t(date: *const pspTime, time: *mut time_t)
16572     -> libc::c_int;
16573}
16574extern "C" {
16575    pub fn sceRtcSetDosTime(date: *mut pspTime, dosTime: u32) -> libc::c_int;
16576}
16577extern "C" {
16578    pub fn sceRtcGetDosTime(date: *mut pspTime, dosTime: u32) -> libc::c_int;
16579}
16580extern "C" {
16581    pub fn sceRtcSetWin32FileTime(date: *mut pspTime, win32Time: *mut u64)
16582     -> libc::c_int;
16583}
16584extern "C" {
16585    pub fn sceRtcGetWin32FileTime(date: *mut pspTime, win32Time: *mut u64)
16586     -> libc::c_int;
16587}
16588extern "C" {
16589    pub fn sceRtcParseDateTime(destTick: *mut u64,
16590                               dateString: *const libc::c_char)
16591     -> libc::c_int;
16592}
16593extern "C" {
16594    /// Format Tick-representation UTC time in RFC2822 format
16595    pub fn sceRtcFormatRFC2822(pszDateTime: *mut libc::c_char,
16596                               pUtc: *const u64,
16597                               iTimeZoneMinutes: libc::c_int) -> libc::c_int;
16598}
16599extern "C" {
16600    /// Format Tick-representation UTC time in RFC2822 format
16601    pub fn sceRtcFormatRFC2822LocalTime(pszDateTime: *mut libc::c_char,
16602                                        pUtc: *const u64) -> libc::c_int;
16603}
16604extern "C" {
16605    /// Format Tick-representation UTC time in RFC3339(ISO8601) format
16606    pub fn sceRtcFormatRFC3339(pszDateTime: *mut libc::c_char,
16607                               pUtc: *const u64,
16608                               iTimeZoneMinutes: libc::c_int) -> libc::c_int;
16609}
16610extern "C" {
16611    /// Format Tick-representation UTC time in RFC3339(ISO8601) format
16612    pub fn sceRtcFormatRFC3339LocalTime(pszDateTime: *mut libc::c_char,
16613                                        pUtc: *const u64) -> libc::c_int;
16614}
16615extern "C" {
16616    /// Parse time information represented in RFC3339 format
16617    pub fn sceRtcParseRFC3339(pUtc: *mut u64,
16618                              pszDateTime: *const libc::c_char)
16619     -> libc::c_int;
16620}
16621extern "C" {
16622    /// Query a modules information from its uid.
16623/// @note this is a replacement function for the broken kernel sceKernelQueryModuleInfo in v1.0 firmware
16624/// DO NOT use on a anything above that version. This also needs kernel mode access where
16625/// the normal one has a user mode stub.
16626///
16627/// @param uid - The UID of the module to query.
16628/// @param modinfo - Pointer a module SceKernelModuleInfo structure.
16629///
16630/// @return < 0 on error.
16631    pub fn pspSdkQueryModuleInfoV1(uid: SceUID,
16632                                   modinfo: *mut SceKernelModuleInfo)
16633     -> libc::c_int;
16634}
16635extern "C" {
16636    /// Get the list of module IDs.
16637/// @note This is a replacement function for the missing v1.5 sceKernelGetModuleIdList
16638/// on v1.0 firmware. DO NOT use on anything above that version.
16639///
16640/// @param readbuf - Buffer to store the module list.
16641/// @param readbufsize - Number of elements in the readbuffer.
16642/// @param idcount - Returns the number of module ids
16643///
16644/// @return >= 0 on success
16645    pub fn pspSdkGetModuleIdList(readbuf: *mut SceUID,
16646                                 readbufsize: libc::c_int,
16647                                 idcount: *mut libc::c_int) -> libc::c_int;
16648}
16649extern "C" {
16650    /// Patch the sceModuleManager module to nullify LoadDeviceCheck() calls.
16651///
16652/// @return 0 on success, otherwise one of ::PspKernelErrorCodes.
16653///
16654/// @note This function must be called while running in kernel mode.  The program
16655/// must also be linked against the pspkernel library.
16656    pub fn pspSdkInstallNoDeviceCheckPatch() -> libc::c_int;
16657}
16658extern "C" {
16659    /// Patch sceLoadCore module to remove loading plain module checks
16660///
16661/// @note This function must be called while running in kernel mode.
16662///
16663/// @return 0 on success, otherwise one of ::PspKernelErrorCodes.
16664    pub fn pspSdkInstallNoPlainModuleCheckPatch() -> libc::c_int;
16665}
16666extern "C" {
16667    /// Patch sceLoadModuleWithApiType to remove the kernel check in loadmodule allowing all modules to load
16668///
16669/// @note This function must be called while running in kernel mode
16670///
16671/// @return 0 on success
16672    pub fn pspSdkInstallKernelLoadModulePatch() -> libc::c_int;
16673}
16674extern "C" {
16675    /// Load a module and start it.
16676///
16677/// @param filename - Path to the module.
16678/// @param mpid - Memory parition ID to use to load the module int.
16679///
16680/// @return - The UID of the module on success, otherwise one of ::PspKernelErrorCodes.
16681    pub fn pspSdkLoadStartModule(filename: *const libc::c_char,
16682                                 mpid: libc::c_int) -> SceUID;
16683}
16684extern "C" {
16685    /// Load a module and start it with arguments
16686///
16687/// @param filename - Path to the module.
16688/// @param mpid - Memory parition ID to use to load the module int.
16689/// @param argc - Number of arguments to pass to start module
16690/// @param argv - Array of arguments
16691///
16692/// @return - The UID of the module on success, otherwise one of ::PspKernelErrorCodes.
16693    pub fn pspSdkLoadStartModuleWithArgs(filename: *const libc::c_char,
16694                                         mpid: libc::c_int, argc: libc::c_int,
16695                                         argv: *const *const libc::c_char)
16696     -> SceUID;
16697}
16698extern "C" {
16699    /// Manually fixup library imports for late binding modules.
16700///
16701/// @param moduleId - Id of the module to fixup
16702    pub fn pspSdkFixupImports(moduleId: libc::c_int);
16703}
16704extern "C" {
16705    /// Load Inet related modules.
16706/// @note You must be in kernel mode to execute this function.
16707///
16708/// @return - 0 on success, otherwise one of ::PspKernelErrorCodes.
16709    pub fn pspSdkLoadInetModules() -> libc::c_int;
16710}
16711extern "C" {
16712    /// Initialize Inet related modules.
16713///
16714/// @return - 0 on success, otherwise one of ::PspKernelErrorCodes.
16715    pub fn pspSdkInetInit() -> libc::c_int;
16716}
16717extern "C" {
16718    /// Terminate Inet related modules.
16719    pub fn pspSdkInetTerm();
16720}
16721extern "C" {
16722    /// Search for a thread with the given name and retrieve it's ::SceKernelThreadInfo struct.
16723///
16724/// @param name - The name of the thread to search for.
16725/// @param pUID - If the thread with the given name is found, it's ::SceUID is stored here.
16726/// @param pInfo - If the thread with the given name is found, it's ::SceKernelThreadInfo data is stored here.
16727///
16728/// @return 0 if successful, otherwise one of ::PspKernelErrorCodes.
16729    pub fn pspSdkReferThreadStatusByName(name: *const libc::c_char,
16730                                         pUID: *mut SceUID,
16731                                         pInfo: *mut SceKernelThreadInfo)
16732     -> libc::c_int;
16733}
16734extern "C" {
16735    /// Search for a semaphore with the given name and retrieve it's ::SceKernelSemaInfo struct.
16736///
16737/// @param name - The name of the sema to search for.
16738/// @param pUID - If the sema with the given name is found, it's ::SceUID is stored here.
16739/// @param pInfo - If the sema with the given name is found, it's ::SceKernelSemaInfo data is stored here.
16740///
16741/// @return 0 if successful, otherwise one of ::PspKernelErrorCodes.
16742    pub fn pspSdkReferSemaStatusByName(name: *const libc::c_char,
16743                                       pUID: *mut SceUID,
16744                                       pInfo: *mut SceKernelSemaInfo)
16745     -> libc::c_int;
16746}
16747extern "C" {
16748    /// Search for an event flag with the given name and retrieve it's ::SceKernelEventFlagInfo struct.
16749///
16750/// @param name - The name of the event flag to search for.
16751/// @param pUID - If the event flag with the given name is found, it's ::SceUID is stored here.
16752/// @param pInfo - If the event flag with the given name is found, it's ::SceKernelEventFlagInfo data is stored here.
16753///
16754/// @return 0 if successful, otherwise one of ::PspKernelErrorCodes.
16755    pub fn pspSdkReferEventFlagStatusByName(name: *const libc::c_char,
16756                                            pUID: *mut SceUID,
16757                                            pInfo:
16758                                                *mut SceKernelEventFlagInfo)
16759     -> libc::c_int;
16760}
16761extern "C" {
16762    /// Search for a message box with the given name and retrieve it's ::SceKernelMbxInfo struct.
16763///
16764/// @param name - The name of the message box to search for.
16765/// @param pUID - If the message box with the given name is found, it's ::SceUID is stored here.
16766/// @param pInfo - If the message box with the given name is found, it's ::SceKernelMbxInfo data is stored here.
16767///
16768/// @return 0 if successful, otherwise one of ::PspKernelErrorCodes.
16769    pub fn pspSdkReferMboxStatusByName(name: *const libc::c_char,
16770                                       pUID: *mut SceUID,
16771                                       pInfo: *mut SceKernelMbxInfo)
16772     -> libc::c_int;
16773}
16774extern "C" {
16775    /// Search for a VPL with the given name and retrieve it's ::SceKernelVplInfo struct.
16776///
16777/// @param name - The name of to search for.
16778/// @param pUID - If the given name is found, it's ::SceUID is stored here.
16779/// @param pInfo - If the given name is found, it's ::SceKernelVplInfo data is stored here.
16780///
16781/// @return 0 if successful, otherwise one of ::PspKernelErrorCodes.
16782    pub fn pspSdkReferVplStatusByName(name: *const libc::c_char,
16783                                      pUID: *mut SceUID,
16784                                      pInfo: *mut SceKernelVplInfo)
16785     -> libc::c_int;
16786}
16787extern "C" {
16788    /// Search for a FPL with the given name and retrieve it's ::SceKernelFplInfo struct.
16789///
16790/// @param name - The name of to search for.
16791/// @param pUID - If the given name is found, it's ::SceUID is stored here.
16792/// @param pInfo - If the given name is found, it's ::SceKernelFplInfo data is stored here.
16793///
16794/// @return 0 if successful, otherwise one of ::PspKernelErrorCodes.
16795    pub fn pspSdkReferFplStatusByName(name: *const libc::c_char,
16796                                      pUID: *mut SceUID,
16797                                      pInfo: *mut SceKernelFplInfo)
16798     -> libc::c_int;
16799}
16800extern "C" {
16801    /// Search for a message pipe with the given name and retrieve it's ::SceKernelMppInfo struct.
16802///
16803/// @param name - The name of to search for.
16804/// @param pUID - If the given name is found, it's ::SceUID is stored here.
16805/// @param pInfo - If the given name is found, it's ::SceKernelMppInfo data is stored here.
16806///
16807/// @return 0 if successful, otherwise one of ::PspKernelErrorCodes.
16808    pub fn pspSdkReferMppStatusByName(name: *const libc::c_char,
16809                                      pUID: *mut SceUID,
16810                                      pInfo: *mut SceKernelMppInfo)
16811     -> libc::c_int;
16812}
16813extern "C" {
16814    /// Search for a callback with the given name and retrieve it's ::SceKernelCallbackInfo struct.
16815///
16816/// @param name - The name of to search for.
16817/// @param pUID - If the given name is found, it's ::SceUID is stored here.
16818/// @param pInfo - If the given name is found, it's ::SceKernelMppInfo data is stored here.
16819///
16820/// @return 0 if successful, otherwise one of ::PspKernelErrorCodes.
16821    pub fn pspSdkReferCallbackStatusByName(name: *const libc::c_char,
16822                                           pUID: *mut SceUID,
16823                                           pInfo: *mut SceKernelCallbackInfo)
16824     -> libc::c_int;
16825}
16826extern "C" {
16827    /// Search for a vtimer with the given name and retrieve it's ::SceKernelVTimerInfo struct.
16828///
16829/// @param name - The name of to search for.
16830/// @param pUID - If the given name is found, it's ::SceUID is stored here.
16831/// @param pInfo - If the given name is found, it's ::SceKernelVTimerInfo data is stored here.
16832///
16833/// @return 0 if successful, otherwise one of ::PspKernelErrorCodes.
16834    pub fn pspSdkReferVTimerStatusByName(name: *const libc::c_char,
16835                                         pUID: *mut SceUID,
16836                                         pInfo: *mut SceKernelVTimerInfo)
16837     -> libc::c_int;
16838}
16839extern "C" {
16840    /// Search for a thread event handler with the given name and retrieve it's ::SceKernelThreadEventHandlerInfo struct.
16841///
16842/// @param name - The name of to search for.
16843/// @param pUID - If the given name is found, it's ::SceUID is stored here.
16844/// @param pInfo - If the given name is found, it's ::SceKernelThreadEventHandlerInfo data is stored here.
16845///
16846/// @return 0 if successful, otherwise one of ::PspKernelErrorCodes.
16847    pub fn pspSdkReferThreadEventHandlerStatusByName(name:
16848                                                         *const libc::c_char,
16849                                                     pUID: *mut SceUID,
16850                                                     pInfo:
16851                                                         *mut SceKernelThreadEventHandlerInfo)
16852     -> libc::c_int;
16853}
16854extern "C" {
16855    /// Disable interrupts
16856///
16857/// @note Do not disable interrupts for too long otherwise the watchdog will get you.
16858///
16859/// @return The previous state of the interrupt enable bit (should be passed back to ::pspSdkEnableInterrupts)
16860    pub fn pspSdkDisableInterrupts() -> libc::c_uint;
16861}
16862extern "C" {
16863    /// Enable interrupts
16864///
16865/// @param istate - The interrupt state as returned from ::pspSdkDisableInterrupts
16866    pub fn pspSdkEnableInterrupts(istate: libc::c_uint);
16867}
16868extern "C" {
16869    /// Set the processors K1 register to a known value
16870///
16871/// @note This function is for use in kernel mode syscall exports. The kernel
16872/// sets the k1 register to indicate what mode called the function, i.e.
16873/// whether it was directly called, was called via a syscall from a kernel
16874/// thread or called via a syscall from a user thread. By setting k1 to 0
16875/// before doing anything in your code you can make the other functions think
16876/// you are calling from a kernel thread and therefore disable numerous
16877/// protections.
16878///
16879/// @param k1 - The k1 value to set
16880///
16881/// @return The previous value of k1
16882    pub fn pspSdkSetK1(k1: libc::c_uint) -> libc::c_uint;
16883}
16884extern "C" {
16885    /// Get the current value of the processors K1 register
16886///
16887/// @return The current value of K1
16888    pub fn pspSdkGetK1() -> libc::c_uint;
16889}
16890extern "C" {
16891    /// Disable the CPUs FPU exceptions
16892    pub fn pspSdkDisableFPUExceptions();
16893}
16894#[repr(C)]
16895#[derive(Debug, Copy)]
16896pub struct sircs_data {
16897    pub type_: u8,
16898    pub cmd: u8,
16899    pub dev: u16,
16900}
16901#[test]
16902fn bindgen_test_layout_sircs_data() {
16903    assert_eq!(::core::mem::size_of::<sircs_data>() , 4usize , concat ! (
16904               "Size of: " , stringify ! ( sircs_data ) ));
16905    assert_eq! (::core::mem::align_of::<sircs_data>() , 2usize , concat ! (
16906                "Alignment of " , stringify ! ( sircs_data ) ));
16907    assert_eq! (unsafe {
16908                & ( * ( 0 as * const sircs_data ) ) . type_ as * const _ as
16909                usize } , 0usize , concat ! (
16910                "Alignment of field: " , stringify ! ( sircs_data ) , "::" ,
16911                stringify ! ( type_ ) ));
16912    assert_eq! (unsafe {
16913                & ( * ( 0 as * const sircs_data ) ) . cmd as * const _ as
16914                usize } , 1usize , concat ! (
16915                "Alignment of field: " , stringify ! ( sircs_data ) , "::" ,
16916                stringify ! ( cmd ) ));
16917    assert_eq! (unsafe {
16918                & ( * ( 0 as * const sircs_data ) ) . dev as * const _ as
16919                usize } , 2usize , concat ! (
16920                "Alignment of field: " , stringify ! ( sircs_data ) , "::" ,
16921                stringify ! ( dev ) ));
16922}
16923impl Clone for sircs_data {
16924    fn clone(&self) -> Self { *self }
16925}
16926extern "C" {
16927    #[link_name = "__packed__"]
16928    pub static mut __packed__: sircs_data;
16929}
16930extern "C" {
16931    
16932    pub fn sceSircsSend(sd: *mut sircs_data, count: libc::c_int)
16933     -> libc::c_int;
16934}
16935extern "C" {
16936    /// Init the ssl library.
16937///
16938/// @param unknown1 - Memory size? Pass 0x28000
16939///
16940/// @return 0 on success
16941    pub fn sceSslInit(unknown1: libc::c_int) -> libc::c_int;
16942}
16943extern "C" {
16944    /// Terminate the ssl library.
16945///
16946/// @return 0 on success
16947    pub fn sceSslEnd() -> libc::c_int;
16948}
16949extern "C" {
16950    /// Get the maximum memory size used by ssl.
16951///
16952/// @param memory - Pointer where the maximum memory used value will be stored.
16953///
16954/// @return 0 on success
16955    pub fn sceSslGetUsedMemoryMax(memory: *mut libc::c_uint) -> libc::c_int;
16956}
16957extern "C" {
16958    /// Get the current memory size used by ssl.
16959///
16960/// @param memory - Pointer where the current memory used value will be stored.
16961///
16962/// @return 0 on success
16963    pub fn sceSslGetUsedMemoryCurrent(memory: *mut libc::c_uint)
16964     -> libc::c_int;
16965}
16966extern "C" {
16967    /// Allocate the extra 4megs of RAM
16968///
16969/// @param unk - No idea as it is never used, set to anything
16970/// @param ptr - Pointer to a pointer to hold the address of the memory
16971/// @param size - Pointer to an int which will hold the size of the memory
16972///
16973/// @return 0 on success
16974    pub fn sceKernelVolatileMemLock(unk: libc::c_int,
16975                                    ptr: *mut *mut libc::c_void,
16976                                    size: *mut libc::c_int) -> libc::c_int;
16977}
16978extern "C" {
16979    /// Try and allocate the extra 4megs of RAM, will return an error if
16980/// something has already allocated it
16981///
16982/// @param unk - No idea as it is never used, set to anything
16983/// @param ptr - Pointer to a pointer to hold the address of the memory
16984/// @param size - Pointer to an int which will hold the size of the memory
16985///
16986/// @return 0 on success
16987    pub fn sceKernelVolatileMemTryLock(unk: libc::c_int,
16988                                       ptr: *mut *mut libc::c_void,
16989                                       size: *mut libc::c_int) -> libc::c_int;
16990}
16991extern "C" {
16992    /// Deallocate the extra 4 megs of RAM
16993///
16994/// @param unk - Set to 0, otherwise it fails in 3.52+, possibly earlier
16995/// @return 0 on success
16996    pub fn sceKernelVolatileMemUnlock(unk: libc::c_int) -> libc::c_int;
16997}
16998pub type va_list = __builtin_va_list;
16999pub type __gnuc_va_list = __builtin_va_list;
17000/// Callback type, ch is 0x200 on start of string, 0x201 on end
17001pub type prnt_callback =
17002    ::core::option::Option<unsafe extern "C" fn(ctx: *mut libc::c_void,
17003                                                ch: libc::c_int)>;
17004extern "C" {
17005    /// Generic print routine
17006///
17007/// @param cb - Callback, called for every character printed
17008/// @param ctx - Context parameter passed to the callback
17009/// @param fmt - Format data
17010/// @param args - Arguments for format
17011///
17012    pub fn prnt(cb: prnt_callback, ctx: *mut libc::c_void,
17013                fmt: *const libc::c_char, args: *mut __va_list_tag);
17014}
17015extern "C" {
17016    /// Force the PSP to go into standby
17017    pub fn sceSysconPowerStandby();
17018}
17019extern "C" {
17020    /// Reset the PSP
17021///
17022/// @param unk1 - Unknown, pass 1
17023/// @param unk2 - Unknown, pass 1
17024    pub fn sceSysconResetDevice(unk1: libc::c_int, unk2: libc::c_int);
17025}
17026extern "C" {
17027    /// Control an LED
17028///
17029/// @param SceLED - The led to toggle (only SCE_LED_POWER)
17030/// @param state - Whether to turn on or off
17031    pub fn sceSysconCtrlLED(SceLED: libc::c_int, state: libc::c_int)
17032     -> libc::c_int;
17033}
17034extern "C" {
17035    /// Control the remote control power
17036///
17037/// @param power - 1 is on, 0 is off
17038///
17039/// @return < 0 on error
17040    pub fn sceSysconCtrlHRPower(power: libc::c_int) -> libc::c_int;
17041}
17042extern "C" {
17043    pub fn sceSysconGetHPConnect() -> libc::c_int;
17044}
17045extern "C" {
17046    pub fn sceSysconSetHPConnectCallback(arg1:
17047                                             ::core::option::Option<unsafe extern "C" fn(arg1:
17048                                                                                             libc::c_int)>,
17049                                         unk0: libc::c_int) -> libc::c_int;
17050}
17051extern "C" {
17052    pub fn sceSysconSetHRPowerCallback(arg1:
17053                                           ::core::option::Option<unsafe extern "C" fn(arg1:
17054                                                                                           libc::c_int)>,
17055                                       unk0: libc::c_int) -> libc::c_int;
17056}
17057extern "C" {
17058    /// Get the PSP's Pommel version
17059/// @param version - A pointer to an int to receive the Pommel version into
17060    pub fn sceSysconGetPommelVersion(version: *mut libc::c_int)
17061     -> libc::c_int;
17062}
17063extern "C" {
17064    /// Get the PSP's Baryon version
17065/// @param version - A pointer to an int to receive the Baryon version into
17066    pub fn sceSysconGetBaryonVersion(version: *mut libc::c_int)
17067     -> libc::c_int;
17068}
17069#[repr(C)]
17070#[derive(Debug, Copy)]
17071pub struct PspSysEventHandler {
17072    pub size: libc::c_int,
17073    pub name: *mut libc::c_char,
17074    pub type_mask: libc::c_int,
17075    pub handler: ::core::option::Option<unsafe extern "C" fn(ev_id:
17076                                                                 libc::c_int,
17077                                                             ev_name:
17078                                                                 *mut libc::c_char,
17079                                                             param:
17080                                                                 *mut libc::c_void,
17081                                                             result:
17082                                                                 *mut libc::c_int)
17083                                            -> libc::c_int>,
17084    pub r28: libc::c_int,
17085    pub busy: libc::c_int,
17086    pub next: *mut _PspSysEventHandler,
17087    pub reserved: [libc::c_int; 9usize],
17088}
17089#[test]
17090fn bindgen_test_layout_PspSysEventHandler() {
17091    assert_eq!(::core::mem::size_of::<PspSysEventHandler>() , 88usize , concat
17092               ! ( "Size of: " , stringify ! ( PspSysEventHandler ) ));
17093    assert_eq! (::core::mem::align_of::<PspSysEventHandler>() , 8usize ,
17094                concat ! (
17095                "Alignment of " , stringify ! ( PspSysEventHandler ) ));
17096    assert_eq! (unsafe {
17097                & ( * ( 0 as * const PspSysEventHandler ) ) . size as * const
17098                _ as usize } , 0usize , concat ! (
17099                "Alignment of field: " , stringify ! ( PspSysEventHandler ) ,
17100                "::" , stringify ! ( size ) ));
17101    assert_eq! (unsafe {
17102                & ( * ( 0 as * const PspSysEventHandler ) ) . name as * const
17103                _ as usize } , 8usize , concat ! (
17104                "Alignment of field: " , stringify ! ( PspSysEventHandler ) ,
17105                "::" , stringify ! ( name ) ));
17106    assert_eq! (unsafe {
17107                & ( * ( 0 as * const PspSysEventHandler ) ) . type_mask as *
17108                const _ as usize } , 16usize , concat ! (
17109                "Alignment of field: " , stringify ! ( PspSysEventHandler ) ,
17110                "::" , stringify ! ( type_mask ) ));
17111    assert_eq! (unsafe {
17112                & ( * ( 0 as * const PspSysEventHandler ) ) . handler as *
17113                const _ as usize } , 24usize , concat ! (
17114                "Alignment of field: " , stringify ! ( PspSysEventHandler ) ,
17115                "::" , stringify ! ( handler ) ));
17116    assert_eq! (unsafe {
17117                & ( * ( 0 as * const PspSysEventHandler ) ) . r28 as * const _
17118                as usize } , 32usize , concat ! (
17119                "Alignment of field: " , stringify ! ( PspSysEventHandler ) ,
17120                "::" , stringify ! ( r28 ) ));
17121    assert_eq! (unsafe {
17122                & ( * ( 0 as * const PspSysEventHandler ) ) . busy as * const
17123                _ as usize } , 36usize , concat ! (
17124                "Alignment of field: " , stringify ! ( PspSysEventHandler ) ,
17125                "::" , stringify ! ( busy ) ));
17126    assert_eq! (unsafe {
17127                & ( * ( 0 as * const PspSysEventHandler ) ) . next as * const
17128                _ as usize } , 40usize , concat ! (
17129                "Alignment of field: " , stringify ! ( PspSysEventHandler ) ,
17130                "::" , stringify ! ( next ) ));
17131    assert_eq! (unsafe {
17132                & ( * ( 0 as * const PspSysEventHandler ) ) . reserved as *
17133                const _ as usize } , 48usize , concat ! (
17134                "Alignment of field: " , stringify ! ( PspSysEventHandler ) ,
17135                "::" , stringify ! ( reserved ) ));
17136}
17137impl Clone for PspSysEventHandler {
17138    fn clone(&self) -> Self { *self }
17139}
17140pub type _PspSysEventHandler = PspSysEventHandler;
17141pub type PspSysEventHandlerFunc =
17142    ::core::option::Option<unsafe extern "C" fn(ev_id: libc::c_int,
17143                                                ev_name: *mut libc::c_char,
17144                                                param: *mut libc::c_void,
17145                                                result: *mut libc::c_int)
17146                               -> libc::c_int>;
17147extern "C" {
17148    /// Dispatch a SysEvent event.
17149///
17150/// @param ev_type_mask - the event type mask
17151/// @param ev_id - the event id
17152/// @param ev_name - the event name
17153/// @param param - the pointer to the custom parameters
17154/// @param result - the pointer to the result
17155/// @param break_nonzero - set to 1 to interrupt the calling chain after the first non-zero return
17156/// @param break_handler - the pointer to the event handler having interrupted
17157/// @return 0 on success, < 0 on error
17158    pub fn sceKernelSysEventDispatch(ev_type_mask: libc::c_int,
17159                                     ev_id: libc::c_int,
17160                                     ev_name: *mut libc::c_char,
17161                                     param: *mut libc::c_void,
17162                                     result: *mut libc::c_int,
17163                                     break_nonzero: libc::c_int,
17164                                     break_handler: *mut PspSysEventHandler)
17165     -> libc::c_int;
17166}
17167extern "C" {
17168    /// Get the first SysEvent handler (the rest can be found with the linked list).
17169///
17170/// @return 0 on error, handler on success
17171    pub fn sceKernelReferSysEventHandler() -> *mut PspSysEventHandler;
17172}
17173extern "C" {
17174    /// Check if a SysEvent handler is registered.
17175///
17176/// @param handler - the handler to check
17177/// @return 0 if the handler is not registered
17178    pub fn sceKernelIsRegisterSysEventHandler(handler:
17179                                                  *mut PspSysEventHandler)
17180     -> libc::c_int;
17181}
17182extern "C" {
17183    /// Register a SysEvent handler.
17184///
17185/// @param handler - the handler to register
17186/// @return 0 on success, < 0 on error
17187    pub fn sceKernelRegisterSysEventHandler(handler: *mut PspSysEventHandler)
17188     -> libc::c_int;
17189}
17190extern "C" {
17191    /// Unregister a SysEvent handler.
17192///
17193/// @param handler - the handler to unregister
17194/// @return 0 on success, < 0 on error
17195    pub fn sceKernelUnregisterSysEventHandler(handler:
17196                                                  *mut PspSysEventHandler)
17197     -> libc::c_int;
17198}
17199#[repr(C)]
17200#[derive(Debug, Copy)]
17201pub struct _PspSysmemPartitionInfo {
17202    pub size: SceSize,
17203    pub startaddr: libc::c_uint,
17204    pub memsize: libc::c_uint,
17205    pub attr: libc::c_uint,
17206}
17207#[test]
17208fn bindgen_test_layout__PspSysmemPartitionInfo() {
17209    assert_eq!(::core::mem::size_of::<_PspSysmemPartitionInfo>() , 16usize ,
17210               concat ! (
17211               "Size of: " , stringify ! ( _PspSysmemPartitionInfo ) ));
17212    assert_eq! (::core::mem::align_of::<_PspSysmemPartitionInfo>() , 4usize ,
17213                concat ! (
17214                "Alignment of " , stringify ! ( _PspSysmemPartitionInfo ) ));
17215    assert_eq! (unsafe {
17216                & ( * ( 0 as * const _PspSysmemPartitionInfo ) ) . size as *
17217                const _ as usize } , 0usize , concat ! (
17218                "Alignment of field: " , stringify ! ( _PspSysmemPartitionInfo
17219                ) , "::" , stringify ! ( size ) ));
17220    assert_eq! (unsafe {
17221                & ( * ( 0 as * const _PspSysmemPartitionInfo ) ) . startaddr
17222                as * const _ as usize } , 4usize , concat ! (
17223                "Alignment of field: " , stringify ! ( _PspSysmemPartitionInfo
17224                ) , "::" , stringify ! ( startaddr ) ));
17225    assert_eq! (unsafe {
17226                & ( * ( 0 as * const _PspSysmemPartitionInfo ) ) . memsize as
17227                * const _ as usize } , 8usize , concat ! (
17228                "Alignment of field: " , stringify ! ( _PspSysmemPartitionInfo
17229                ) , "::" , stringify ! ( memsize ) ));
17230    assert_eq! (unsafe {
17231                & ( * ( 0 as * const _PspSysmemPartitionInfo ) ) . attr as *
17232                const _ as usize } , 12usize , concat ! (
17233                "Alignment of field: " , stringify ! ( _PspSysmemPartitionInfo
17234                ) , "::" , stringify ! ( attr ) ));
17235}
17236impl Clone for _PspSysmemPartitionInfo {
17237    fn clone(&self) -> Self { *self }
17238}
17239pub type PspSysmemPartitionInfo = _PspSysmemPartitionInfo;
17240extern "C" {
17241    /// Query the parition information
17242///
17243/// @param pid  - The partition id
17244/// @param info - Pointer to the ::PspSysmemPartitionInfo structure
17245///
17246/// @return 0 on success.
17247    pub fn sceKernelQueryMemoryPartitionInfo(pid: libc::c_int,
17248                                             info:
17249                                                 *mut PspSysmemPartitionInfo)
17250     -> libc::c_int;
17251}
17252extern "C" {
17253    /// Get the total amount of free memory.
17254///
17255/// @param pid - The partition id
17256///
17257/// @return The total amount of free memory, in bytes.
17258    pub fn sceKernelPartitionTotalFreeMemSize(pid: libc::c_int) -> SceSize;
17259}
17260extern "C" {
17261    /// Get the size of the largest free memory block.
17262///
17263/// @param pid - The partition id
17264///
17265/// @return The size of the largest free memory block, in bytes.
17266    pub fn sceKernelPartitionMaxFreeMemSize(pid: libc::c_int) -> SceSize;
17267}
17268extern "C" {
17269    /// Get the kernel to dump the internal memory table to Kprintf
17270    pub fn sceKernelSysMemDump();
17271}
17272extern "C" {
17273    /// Dump the list of memory blocks
17274    pub fn sceKernelSysMemDumpBlock();
17275}
17276extern "C" {
17277    /// Dump the tail blocks
17278    pub fn sceKernelSysMemDumpTail();
17279}
17280extern "C" {
17281    /// Set the protection of a block of ddr memory
17282///
17283/// @param addr - Address to set protection on
17284/// @param size - Size of block
17285/// @param prot - Protection bitmask
17286///
17287/// @return < 0 on error
17288    pub fn sceKernelSetDdrMemoryProtection(addr: *mut libc::c_void,
17289                                           size: libc::c_int,
17290                                           prot: libc::c_int) -> libc::c_int;
17291}
17292extern "C" {
17293    /// Create a heap.
17294///
17295/// @param partitionid - The UID of the partition where allocate the heap.
17296/// @param size - The size in bytes of the heap.
17297/// @param unk - Unknown, probably some flag or type, pass 1.
17298/// @param name - Name assigned to the new heap.
17299///
17300/// @return The UID of the new heap, or if less than 0 an error.
17301    pub fn sceKernelCreateHeap(partitionid: SceUID, size: SceSize,
17302                               unk: libc::c_int, name: *const libc::c_char)
17303     -> SceUID;
17304}
17305extern "C" {
17306    /// Allocate a memory block from a heap.
17307///
17308/// @param heapid - The UID of the heap to allocate from.
17309/// @param size - The number of bytes to allocate.
17310///
17311/// @return The address of the allocated memory block, or NULL on error.
17312    pub fn sceKernelAllocHeapMemory(heapid: SceUID, size: SceSize)
17313     -> *mut libc::c_void;
17314}
17315extern "C" {
17316    /// Free a memory block allocated from a heap.
17317///
17318/// @param heapid - The UID of the heap where block belongs.
17319/// @param block - The block of memory to free from the heap.
17320///
17321/// @return 0 on success, < 0 on error.
17322    pub fn sceKernelFreeHeapMemory(heapid: SceUID, block: *mut libc::c_void)
17323     -> libc::c_int;
17324}
17325extern "C" {
17326    /// Delete a heap.
17327///
17328/// @param heapid - The UID of the heap to delete.
17329///
17330/// @return 0 on success, < 0 on error.
17331    pub fn sceKernelDeleteHeap(heapid: SceUID) -> libc::c_int;
17332}
17333extern "C" {
17334    /// Get the amount of free size of a heap, in bytes.
17335///
17336/// @param heapid - The UID of the heap
17337///
17338/// @return the free size of the heap, in bytes. < 0 on error.
17339    pub fn sceKernelHeapTotalFreeSize(heapid: SceUID) -> SceSize;
17340}
17341/// Structure of a UID control block
17342#[repr(C, packed)]
17343#[derive(Debug, Copy)]
17344pub struct _uidControlBlock {
17345    pub parent: *mut _uidControlBlock,
17346    pub nextChild: *mut _uidControlBlock,
17347    pub type_: *mut _uidControlBlock,
17348    pub UID: u32,
17349    pub name: *mut libc::c_char,
17350    pub unk: libc::c_uchar,
17351    pub size: libc::c_uchar,
17352    pub attribute: libc::c_short,
17353    pub nextEntry: *mut _uidControlBlock,
17354}
17355#[test]
17356fn bindgen_test_layout__uidControlBlock() {
17357    assert_eq!(::core::mem::size_of::<_uidControlBlock>() , 48usize , concat !
17358               ( "Size of: " , stringify ! ( _uidControlBlock ) ));
17359    assert_eq! (::core::mem::align_of::<_uidControlBlock>() , 1usize , concat
17360                ! ( "Alignment of " , stringify ! ( _uidControlBlock ) ));
17361    assert_eq! (unsafe {
17362                & ( * ( 0 as * const _uidControlBlock ) ) . parent as * const
17363                _ as usize } , 0usize , concat ! (
17364                "Alignment of field: " , stringify ! ( _uidControlBlock ) ,
17365                "::" , stringify ! ( parent ) ));
17366    assert_eq! (unsafe {
17367                & ( * ( 0 as * const _uidControlBlock ) ) . nextChild as *
17368                const _ as usize } , 8usize , concat ! (
17369                "Alignment of field: " , stringify ! ( _uidControlBlock ) ,
17370                "::" , stringify ! ( nextChild ) ));
17371    assert_eq! (unsafe {
17372                & ( * ( 0 as * const _uidControlBlock ) ) . type_ as * const _
17373                as usize } , 16usize , concat ! (
17374                "Alignment of field: " , stringify ! ( _uidControlBlock ) ,
17375                "::" , stringify ! ( type_ ) ));
17376    assert_eq! (unsafe {
17377                & ( * ( 0 as * const _uidControlBlock ) ) . UID as * const _
17378                as usize } , 24usize , concat ! (
17379                "Alignment of field: " , stringify ! ( _uidControlBlock ) ,
17380                "::" , stringify ! ( UID ) ));
17381    assert_eq! (unsafe {
17382                & ( * ( 0 as * const _uidControlBlock ) ) . name as * const _
17383                as usize } , 28usize , concat ! (
17384                "Alignment of field: " , stringify ! ( _uidControlBlock ) ,
17385                "::" , stringify ! ( name ) ));
17386    assert_eq! (unsafe {
17387                & ( * ( 0 as * const _uidControlBlock ) ) . unk as * const _
17388                as usize } , 36usize , concat ! (
17389                "Alignment of field: " , stringify ! ( _uidControlBlock ) ,
17390                "::" , stringify ! ( unk ) ));
17391    assert_eq! (unsafe {
17392                & ( * ( 0 as * const _uidControlBlock ) ) . size as * const _
17393                as usize } , 37usize , concat ! (
17394                "Alignment of field: " , stringify ! ( _uidControlBlock ) ,
17395                "::" , stringify ! ( size ) ));
17396    assert_eq! (unsafe {
17397                & ( * ( 0 as * const _uidControlBlock ) ) . attribute as *
17398                const _ as usize } , 38usize , concat ! (
17399                "Alignment of field: " , stringify ! ( _uidControlBlock ) ,
17400                "::" , stringify ! ( attribute ) ));
17401    assert_eq! (unsafe {
17402                & ( * ( 0 as * const _uidControlBlock ) ) . nextEntry as *
17403                const _ as usize } , 40usize , concat ! (
17404                "Alignment of field: " , stringify ! ( _uidControlBlock ) ,
17405                "::" , stringify ! ( nextEntry ) ));
17406}
17407impl Clone for _uidControlBlock {
17408    fn clone(&self) -> Self { *self }
17409}
17410pub type uidControlBlock = _uidControlBlock;
17411extern "C" {
17412    /// Get a UID control block
17413///
17414/// @param uid - The UID to find
17415/// @param block - Pointer to hold the pointer to the block
17416///
17417/// @return 0 on success
17418    pub fn sceKernelGetUIDcontrolBlock(uid: SceUID,
17419                                       block: *mut *mut uidControlBlock)
17420     -> libc::c_int;
17421}
17422extern "C" {
17423    /// Get a UID control block on a particular type
17424///
17425/// @param uid - The UID to find
17426/// @param type - Pointer to the type UID block
17427/// @param block - Pointer to hold the pointer to the block
17428///
17429/// @return 0 on success
17430    pub fn sceKernelGetUIDcontrolBlockWithType(uid: SceUID,
17431                                               type_: *mut uidControlBlock,
17432                                               block:
17433                                                   *mut *mut uidControlBlock)
17434     -> libc::c_int;
17435}
17436extern "C" {
17437    /// Get the root of the UID tree (1.5+ only)
17438///
17439/// @return Pointer to the UID tree root
17440    pub fn SysMemForKernel_536AD5E1() -> *mut uidControlBlock;
17441}
17442extern "C" {
17443    /// Delete a UID
17444///
17445/// @param uid - The UID to delete
17446///
17447/// @return 0 on success
17448    pub fn sceKernelDeleteUID(uid: SceUID) -> libc::c_int;
17449}
17450extern "C" {
17451    /// Get the model of PSP
17452///
17453/// @return <= 0 original, 1 slim
17454    pub fn sceKernelGetModel() -> libc::c_int;
17455}
17456pub type SceSysTimerId = libc::c_int;
17457extern "C" {
17458    /// Allocate a new SysTimer timer instance.
17459///
17460/// @return SysTimerId on success, < 0 on error
17461    pub fn sceSTimerAlloc() -> SceSysTimerId;
17462}
17463extern "C" {
17464    /// Free an instance of a SysTimer timer.
17465///
17466/// @param timer - The timer id.
17467///
17468    pub fn sceSTimerFree(timer: SceSysTimerId);
17469}
17470extern "C" {
17471    /// Start the SysTimer timer count.
17472///
17473/// @param timer - The timer id.
17474///
17475    pub fn sceSTimerStartCount(timer: SceSysTimerId);
17476}
17477extern "C" {
17478    /// Stop the current SysTimer timer count.
17479///
17480/// @param timer - The timer id.
17481///
17482    pub fn sceSTimerStopCount(timer: SceSysTimerId);
17483}
17484extern "C" {
17485    /// Reset the current SysTimer timer count.
17486///
17487/// @param timer - The timer id.
17488///
17489    pub fn sceSTimerResetCount(timer: SceSysTimerId);
17490}
17491extern "C" {
17492    /// Get the current SysTimer timer count.
17493///
17494/// @param timer - The timer id.
17495/// @param count - The pointer to an integer into which the count will be written.
17496///
17497    pub fn sceSTimerGetCount(timer: SceSysTimerId, count: *mut libc::c_int);
17498}
17499extern "C" {
17500    /// Setup a SysTimer handler
17501///
17502/// @param timer - The timer id.
17503/// @param cycle - The timer cycle in microseconds (???). Maximum: 4194303 which represents ~1/10 seconds.
17504/// @param handler - The handler function. Has to return -1.
17505/// @param unk1 - Unknown. Pass 0.
17506///
17507    pub fn sceSTimerSetHandler(timer: SceSysTimerId, cycle: libc::c_int,
17508                               handler:
17509                                   ::core::option::Option<unsafe extern "C" fn()
17510                                                              -> libc::c_int>,
17511                               unk1: libc::c_int);
17512}
17513extern "C" {
17514    pub fn SysTimerForKernel_53231A15(timer: SceSysTimerId,
17515                                      unk1: libc::c_int);
17516}
17517extern "C" {
17518    pub fn SysTimerForKernel_B53534B4(timer: SceSysTimerId, unk1: libc::c_int,
17519                                      unk2: libc::c_int);
17520}
17521extern "C" {
17522    /// Suspend all user mode threads in the system
17523///
17524/// @return 0 on success, < 0 on error
17525    pub fn sceKernelSuspendAllUserThreads() -> libc::c_int;
17526}
17527extern "C" {
17528    /// Checks if the current thread is a usermode thread
17529///
17530/// @return 0 if kernel, 1 if user, < 0 on error
17531    pub fn sceKernelIsUserModeThread() -> libc::c_int;
17532}
17533extern "C" {
17534    /// Get the user level of the current thread
17535///
17536/// @return The user level, < 0 on error
17537    pub fn sceKernelGetUserLevel() -> libc::c_int;
17538}
17539extern "C" {
17540    /// Get the return address of the current thread's syscall
17541///
17542/// @return The RA, 0 on error
17543    pub fn sceKernelGetSyscallRA() -> libc::c_uint;
17544}
17545extern "C" {
17546    /// Get the free stack space on the kernel thread
17547///
17548/// @param thid - The UID of the thread
17549///
17550/// @return The free stack space, < 0 on error
17551    pub fn sceKernelGetThreadKernelStackFreeSize(thid: SceUID) -> libc::c_int;
17552}
17553extern "C" {
17554    /// Check the thread kernel stack
17555///
17556/// @return Unknown
17557    pub fn sceKernelCheckThreadKernelStack() -> libc::c_int;
17558}
17559extern "C" {
17560    /// Extend the kernel thread stack
17561///
17562/// @param type - The type of block allocation. One of ::PspSysMemBlockTypes
17563/// @param cb - A pointer to a callback function
17564/// @param arg - A pointer to a user specified argument
17565///
17566/// @return < 0 on error
17567    pub fn sceKernelExtendKernelStack(type_: libc::c_int,
17568                                      cb:
17569                                          ::core::option::Option<unsafe extern "C" fn(arg1:
17570                                                                                          *mut libc::c_void)>,
17571                                      arg: *mut libc::c_void) -> libc::c_int;
17572}
17573extern "C" {
17574    /// Get the system status flag
17575///
17576/// @return The system status flag
17577    pub fn sceKernelGetSystemStatusFlag() -> libc::c_uint;
17578}
17579extern "C" {
17580    /// Setup the KTLS allocator
17581///
17582/// @param id - The ID of the allocator
17583/// @param cb - The allocator callback
17584/// @param arg - User specified arg passed to the callback
17585///
17586/// @return < 0 on error, allocation id on success
17587    pub fn sceKernelAllocateKTLS(id: libc::c_int,
17588                                 cb:
17589                                     ::core::option::Option<unsafe extern "C" fn(size:
17590                                                                                     *mut libc::c_uint,
17591                                                                                 arg:
17592                                                                                     *mut libc::c_void)
17593                                                                ->
17594                                                                    libc::c_int>,
17595                                 arg: *mut libc::c_void) -> libc::c_int;
17596}
17597extern "C" {
17598    /// Free the KTLS allocator
17599///
17600/// @param id - The allocation id returned from AllocateKTLS
17601///
17602/// @return < 0 on error
17603    pub fn sceKernelFreeKTLS(id: libc::c_int) -> libc::c_int;
17604}
17605extern "C" {
17606    /// Get the KTLS of the current thread
17607///
17608/// @param id - The allocation id returned from AllocateKTLS
17609///
17610/// @return The current KTLS, NULL on error
17611    pub fn sceKernelGetKTLS(id: libc::c_int) -> *mut libc::c_void;
17612}
17613extern "C" {
17614    /// Get the KTLS of a thread
17615///
17616/// @param id - The allocation id returned from AllocateKTLS
17617/// @param thid - The thread is, 0 for current thread
17618/// @param mode - Perhaps? Sees to be set to 0 or 1
17619///
17620/// @return The current KTLS, NULL on error
17621    pub fn sceKernelGetThreadKTLS(id: libc::c_int, thid: SceUID,
17622                                  mode: libc::c_int) -> *mut libc::c_void;
17623}
17624/// Thread context
17625/// Structues for the thread context taken from florinsasu's post on the forums
17626#[repr(C)]
17627#[derive(Debug, Copy)]
17628pub struct SceThreadContext {
17629    pub type_: libc::c_uint,
17630    pub gpr: [libc::c_uint; 31usize],
17631    pub fpr: [libc::c_uint; 32usize],
17632    pub fc31: libc::c_uint,
17633    pub hi: libc::c_uint,
17634    pub lo: libc::c_uint,
17635    pub SR: libc::c_uint,
17636    pub EPC: libc::c_uint,
17637    pub field_114: libc::c_uint,
17638    pub field_118: libc::c_uint,
17639}
17640#[test]
17641fn bindgen_test_layout_SceThreadContext() {
17642    assert_eq!(::core::mem::size_of::<SceThreadContext>() , 284usize , concat
17643               ! ( "Size of: " , stringify ! ( SceThreadContext ) ));
17644    assert_eq! (::core::mem::align_of::<SceThreadContext>() , 4usize , concat
17645                ! ( "Alignment of " , stringify ! ( SceThreadContext ) ));
17646    assert_eq! (unsafe {
17647                & ( * ( 0 as * const SceThreadContext ) ) . type_ as * const _
17648                as usize } , 0usize , concat ! (
17649                "Alignment of field: " , stringify ! ( SceThreadContext ) ,
17650                "::" , stringify ! ( type_ ) ));
17651    assert_eq! (unsafe {
17652                & ( * ( 0 as * const SceThreadContext ) ) . gpr as * const _
17653                as usize } , 4usize , concat ! (
17654                "Alignment of field: " , stringify ! ( SceThreadContext ) ,
17655                "::" , stringify ! ( gpr ) ));
17656    assert_eq! (unsafe {
17657                & ( * ( 0 as * const SceThreadContext ) ) . fpr as * const _
17658                as usize } , 128usize , concat ! (
17659                "Alignment of field: " , stringify ! ( SceThreadContext ) ,
17660                "::" , stringify ! ( fpr ) ));
17661    assert_eq! (unsafe {
17662                & ( * ( 0 as * const SceThreadContext ) ) . fc31 as * const _
17663                as usize } , 256usize , concat ! (
17664                "Alignment of field: " , stringify ! ( SceThreadContext ) ,
17665                "::" , stringify ! ( fc31 ) ));
17666    assert_eq! (unsafe {
17667                & ( * ( 0 as * const SceThreadContext ) ) . hi as * const _ as
17668                usize } , 260usize , concat ! (
17669                "Alignment of field: " , stringify ! ( SceThreadContext ) ,
17670                "::" , stringify ! ( hi ) ));
17671    assert_eq! (unsafe {
17672                & ( * ( 0 as * const SceThreadContext ) ) . lo as * const _ as
17673                usize } , 264usize , concat ! (
17674                "Alignment of field: " , stringify ! ( SceThreadContext ) ,
17675                "::" , stringify ! ( lo ) ));
17676    assert_eq! (unsafe {
17677                & ( * ( 0 as * const SceThreadContext ) ) . SR as * const _ as
17678                usize } , 268usize , concat ! (
17679                "Alignment of field: " , stringify ! ( SceThreadContext ) ,
17680                "::" , stringify ! ( SR ) ));
17681    assert_eq! (unsafe {
17682                & ( * ( 0 as * const SceThreadContext ) ) . EPC as * const _
17683                as usize } , 272usize , concat ! (
17684                "Alignment of field: " , stringify ! ( SceThreadContext ) ,
17685                "::" , stringify ! ( EPC ) ));
17686    assert_eq! (unsafe {
17687                & ( * ( 0 as * const SceThreadContext ) ) . field_114 as *
17688                const _ as usize } , 276usize , concat ! (
17689                "Alignment of field: " , stringify ! ( SceThreadContext ) ,
17690                "::" , stringify ! ( field_114 ) ));
17691    assert_eq! (unsafe {
17692                & ( * ( 0 as * const SceThreadContext ) ) . field_118 as *
17693                const _ as usize } , 280usize , concat ! (
17694                "Alignment of field: " , stringify ! ( SceThreadContext ) ,
17695                "::" , stringify ! ( field_118 ) ));
17696}
17697impl Clone for SceThreadContext {
17698    fn clone(&self) -> Self { *self }
17699}
17700#[repr(C)]
17701#[derive(Debug, Copy)]
17702pub struct SceSCContext {
17703    pub status: libc::c_uint,
17704    pub epc: libc::c_uint,
17705    pub sp: libc::c_uint,
17706    pub ra: libc::c_uint,
17707    pub k1: libc::c_uint,
17708    pub unk: [libc::c_uint; 3usize],
17709}
17710#[test]
17711fn bindgen_test_layout_SceSCContext() {
17712    assert_eq!(::core::mem::size_of::<SceSCContext>() , 32usize , concat ! (
17713               "Size of: " , stringify ! ( SceSCContext ) ));
17714    assert_eq! (::core::mem::align_of::<SceSCContext>() , 4usize , concat ! (
17715                "Alignment of " , stringify ! ( SceSCContext ) ));
17716    assert_eq! (unsafe {
17717                & ( * ( 0 as * const SceSCContext ) ) . status as * const _ as
17718                usize } , 0usize , concat ! (
17719                "Alignment of field: " , stringify ! ( SceSCContext ) , "::" ,
17720                stringify ! ( status ) ));
17721    assert_eq! (unsafe {
17722                & ( * ( 0 as * const SceSCContext ) ) . epc as * const _ as
17723                usize } , 4usize , concat ! (
17724                "Alignment of field: " , stringify ! ( SceSCContext ) , "::" ,
17725                stringify ! ( epc ) ));
17726    assert_eq! (unsafe {
17727                & ( * ( 0 as * const SceSCContext ) ) . sp as * const _ as
17728                usize } , 8usize , concat ! (
17729                "Alignment of field: " , stringify ! ( SceSCContext ) , "::" ,
17730                stringify ! ( sp ) ));
17731    assert_eq! (unsafe {
17732                & ( * ( 0 as * const SceSCContext ) ) . ra as * const _ as
17733                usize } , 12usize , concat ! (
17734                "Alignment of field: " , stringify ! ( SceSCContext ) , "::" ,
17735                stringify ! ( ra ) ));
17736    assert_eq! (unsafe {
17737                & ( * ( 0 as * const SceSCContext ) ) . k1 as * const _ as
17738                usize } , 16usize , concat ! (
17739                "Alignment of field: " , stringify ! ( SceSCContext ) , "::" ,
17740                stringify ! ( k1 ) ));
17741    assert_eq! (unsafe {
17742                & ( * ( 0 as * const SceSCContext ) ) . unk as * const _ as
17743                usize } , 20usize , concat ! (
17744                "Alignment of field: " , stringify ! ( SceSCContext ) , "::" ,
17745                stringify ! ( unk ) ));
17746}
17747impl Clone for SceSCContext {
17748    fn clone(&self) -> Self { *self }
17749}
17750/// Structure to hold the status information for a thread (kernel form)
17751/// 1.5 form
17752#[repr(C)]
17753#[derive(Debug, Copy)]
17754pub struct SceKernelThreadKInfo {
17755    /// Size of the structure
17756    pub size: SceSize,
17757    /// Nul terminated name of the thread
17758    pub name: [libc::c_char; 32usize],
17759    /// Thread attributes
17760    pub attr: SceUInt,
17761    /// Thread status
17762    pub status: libc::c_int,
17763    /// Thread entry point
17764    pub entry: SceKernelThreadEntry,
17765    /// Thread stack pointer
17766    pub stack: *mut libc::c_void,
17767    /// Thread stack size
17768    pub stackSize: libc::c_int,
17769    /// Kernel stack pointer
17770    pub kstack: *mut libc::c_void,
17771    /// Kernel stack size
17772    pub kstackSize: *mut libc::c_void,
17773    /// Pointer to the gp
17774    pub gpReg: *mut libc::c_void,
17775    /// Size of args
17776    pub args: SceSize,
17777    /// Pointer to args
17778    pub argp: *mut libc::c_void,
17779    /// Initial priority
17780    pub initPriority: libc::c_int,
17781    /// Current priority
17782    pub currentPriority: libc::c_int,
17783    /// Wait type
17784    pub waitType: libc::c_int,
17785    /// Wait id
17786    pub waitId: SceUID,
17787    /// Wakeup count
17788    pub wakeupCount: libc::c_int,
17789    /// Number of clock cycles run
17790    pub runClocks: SceKernelSysClock,
17791    /// Interrupt preemption count
17792    pub intrPreemptCount: SceUInt,
17793    /// Thread preemption count
17794    pub threadPreemptCount: SceUInt,
17795    /// Release count
17796    pub releaseCount: SceUInt,
17797    /// Thread Context
17798    pub thContext: *mut SceThreadContext,
17799    /// VFPU Context
17800    pub vfpuContext: *mut f32,
17801    /// Return address from syscall
17802    pub retAddr: *mut libc::c_void,
17803    /// Unknown, possibly size of SC context
17804    pub unknown1: SceUInt,
17805    /// Syscall Context
17806    pub scContext: *mut SceSCContext,
17807}
17808#[test]
17809fn bindgen_test_layout_SceKernelThreadKInfo() {
17810    assert_eq!(::core::mem::size_of::<SceKernelThreadKInfo>() , 192usize ,
17811               concat ! ( "Size of: " , stringify ! ( SceKernelThreadKInfo )
17812               ));
17813    assert_eq! (::core::mem::align_of::<SceKernelThreadKInfo>() , 8usize ,
17814                concat ! (
17815                "Alignment of " , stringify ! ( SceKernelThreadKInfo ) ));
17816    assert_eq! (unsafe {
17817                & ( * ( 0 as * const SceKernelThreadKInfo ) ) . size as *
17818                const _ as usize } , 0usize , concat ! (
17819                "Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
17820                , "::" , stringify ! ( size ) ));
17821    assert_eq! (unsafe {
17822                & ( * ( 0 as * const SceKernelThreadKInfo ) ) . name as *
17823                const _ as usize } , 4usize , concat ! (
17824                "Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
17825                , "::" , stringify ! ( name ) ));
17826    assert_eq! (unsafe {
17827                & ( * ( 0 as * const SceKernelThreadKInfo ) ) . attr as *
17828                const _ as usize } , 36usize , concat ! (
17829                "Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
17830                , "::" , stringify ! ( attr ) ));
17831    assert_eq! (unsafe {
17832                & ( * ( 0 as * const SceKernelThreadKInfo ) ) . status as *
17833                const _ as usize } , 40usize , concat ! (
17834                "Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
17835                , "::" , stringify ! ( status ) ));
17836    assert_eq! (unsafe {
17837                & ( * ( 0 as * const SceKernelThreadKInfo ) ) . entry as *
17838                const _ as usize } , 48usize , concat ! (
17839                "Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
17840                , "::" , stringify ! ( entry ) ));
17841    assert_eq! (unsafe {
17842                & ( * ( 0 as * const SceKernelThreadKInfo ) ) . stack as *
17843                const _ as usize } , 56usize , concat ! (
17844                "Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
17845                , "::" , stringify ! ( stack ) ));
17846    assert_eq! (unsafe {
17847                & ( * ( 0 as * const SceKernelThreadKInfo ) ) . stackSize as *
17848                const _ as usize } , 64usize , concat ! (
17849                "Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
17850                , "::" , stringify ! ( stackSize ) ));
17851    assert_eq! (unsafe {
17852                & ( * ( 0 as * const SceKernelThreadKInfo ) ) . kstack as *
17853                const _ as usize } , 72usize , concat ! (
17854                "Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
17855                , "::" , stringify ! ( kstack ) ));
17856    assert_eq! (unsafe {
17857                & ( * ( 0 as * const SceKernelThreadKInfo ) ) . kstackSize as
17858                * const _ as usize } , 80usize , concat ! (
17859                "Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
17860                , "::" , stringify ! ( kstackSize ) ));
17861    assert_eq! (unsafe {
17862                & ( * ( 0 as * const SceKernelThreadKInfo ) ) . gpReg as *
17863                const _ as usize } , 88usize , concat ! (
17864                "Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
17865                , "::" , stringify ! ( gpReg ) ));
17866    assert_eq! (unsafe {
17867                & ( * ( 0 as * const SceKernelThreadKInfo ) ) . args as *
17868                const _ as usize } , 96usize , concat ! (
17869                "Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
17870                , "::" , stringify ! ( args ) ));
17871    assert_eq! (unsafe {
17872                & ( * ( 0 as * const SceKernelThreadKInfo ) ) . argp as *
17873                const _ as usize } , 104usize , concat ! (
17874                "Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
17875                , "::" , stringify ! ( argp ) ));
17876    assert_eq! (unsafe {
17877                & ( * ( 0 as * const SceKernelThreadKInfo ) ) . initPriority
17878                as * const _ as usize } , 112usize , concat ! (
17879                "Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
17880                , "::" , stringify ! ( initPriority ) ));
17881    assert_eq! (unsafe {
17882                & ( * ( 0 as * const SceKernelThreadKInfo ) ) .
17883                currentPriority as * const _ as usize } , 116usize , concat !
17884                (
17885                "Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
17886                , "::" , stringify ! ( currentPriority ) ));
17887    assert_eq! (unsafe {
17888                & ( * ( 0 as * const SceKernelThreadKInfo ) ) . waitType as *
17889                const _ as usize } , 120usize , concat ! (
17890                "Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
17891                , "::" , stringify ! ( waitType ) ));
17892    assert_eq! (unsafe {
17893                & ( * ( 0 as * const SceKernelThreadKInfo ) ) . waitId as *
17894                const _ as usize } , 124usize , concat ! (
17895                "Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
17896                , "::" , stringify ! ( waitId ) ));
17897    assert_eq! (unsafe {
17898                & ( * ( 0 as * const SceKernelThreadKInfo ) ) . wakeupCount as
17899                * const _ as usize } , 128usize , concat ! (
17900                "Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
17901                , "::" , stringify ! ( wakeupCount ) ));
17902    assert_eq! (unsafe {
17903                & ( * ( 0 as * const SceKernelThreadKInfo ) ) . runClocks as *
17904                const _ as usize } , 132usize , concat ! (
17905                "Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
17906                , "::" , stringify ! ( runClocks ) ));
17907    assert_eq! (unsafe {
17908                & ( * ( 0 as * const SceKernelThreadKInfo ) ) .
17909                intrPreemptCount as * const _ as usize } , 140usize , concat !
17910                (
17911                "Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
17912                , "::" , stringify ! ( intrPreemptCount ) ));
17913    assert_eq! (unsafe {
17914                & ( * ( 0 as * const SceKernelThreadKInfo ) ) .
17915                threadPreemptCount as * const _ as usize } , 144usize , concat
17916                ! (
17917                "Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
17918                , "::" , stringify ! ( threadPreemptCount ) ));
17919    assert_eq! (unsafe {
17920                & ( * ( 0 as * const SceKernelThreadKInfo ) ) . releaseCount
17921                as * const _ as usize } , 148usize , concat ! (
17922                "Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
17923                , "::" , stringify ! ( releaseCount ) ));
17924    assert_eq! (unsafe {
17925                & ( * ( 0 as * const SceKernelThreadKInfo ) ) . thContext as *
17926                const _ as usize } , 152usize , concat ! (
17927                "Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
17928                , "::" , stringify ! ( thContext ) ));
17929    assert_eq! (unsafe {
17930                & ( * ( 0 as * const SceKernelThreadKInfo ) ) . vfpuContext as
17931                * const _ as usize } , 160usize , concat ! (
17932                "Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
17933                , "::" , stringify ! ( vfpuContext ) ));
17934    assert_eq! (unsafe {
17935                & ( * ( 0 as * const SceKernelThreadKInfo ) ) . retAddr as *
17936                const _ as usize } , 168usize , concat ! (
17937                "Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
17938                , "::" , stringify ! ( retAddr ) ));
17939    assert_eq! (unsafe {
17940                & ( * ( 0 as * const SceKernelThreadKInfo ) ) . unknown1 as *
17941                const _ as usize } , 176usize , concat ! (
17942                "Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
17943                , "::" , stringify ! ( unknown1 ) ));
17944    assert_eq! (unsafe {
17945                & ( * ( 0 as * const SceKernelThreadKInfo ) ) . scContext as *
17946                const _ as usize } , 184usize , concat ! (
17947                "Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
17948                , "::" , stringify ! ( scContext ) ));
17949}
17950impl Clone for SceKernelThreadKInfo {
17951    fn clone(&self) -> Self { *self }
17952}
17953extern "C" {
17954    /// Refer kernel version of thread information
17955///
17956/// @param uid - UID to find
17957/// @param info - Pointer to info structure, ensure size is set before calling
17958///
17959/// @return 0 on success
17960    pub fn ThreadManForKernel_2D69D086(uid: SceUID,
17961                                       info: *mut SceKernelThreadKInfo)
17962     -> libc::c_int;
17963}
17964/// UMD Info struct
17965#[repr(C)]
17966#[derive(Debug, Copy)]
17967pub struct pspUmdInfo {
17968    /// Set to sizeof(pspUmdInfo)
17969    pub size: libc::c_uint,
17970    /// One or more of ::pspUmdTypes
17971    pub type_: libc::c_uint,
17972}
17973#[test]
17974fn bindgen_test_layout_pspUmdInfo() {
17975    assert_eq!(::core::mem::size_of::<pspUmdInfo>() , 8usize , concat ! (
17976               "Size of: " , stringify ! ( pspUmdInfo ) ));
17977    assert_eq! (::core::mem::align_of::<pspUmdInfo>() , 4usize , concat ! (
17978                "Alignment of " , stringify ! ( pspUmdInfo ) ));
17979    assert_eq! (unsafe {
17980                & ( * ( 0 as * const pspUmdInfo ) ) . size as * const _ as
17981                usize } , 0usize , concat ! (
17982                "Alignment of field: " , stringify ! ( pspUmdInfo ) , "::" ,
17983                stringify ! ( size ) ));
17984    assert_eq! (unsafe {
17985                & ( * ( 0 as * const pspUmdInfo ) ) . type_ as * const _ as
17986                usize } , 4usize , concat ! (
17987                "Alignment of field: " , stringify ! ( pspUmdInfo ) , "::" ,
17988                stringify ! ( type_ ) ));
17989}
17990impl Clone for pspUmdInfo {
17991    fn clone(&self) -> Self { *self }
17992}
17993#[repr(u32)]
17994/// Enumeration for UMD types
17995#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
17996pub enum pspUmdTypes {
17997    PSP_UMD_TYPE_GAME = 16,
17998    PSP_UMD_TYPE_VIDEO = 32,
17999    PSP_UMD_TYPE_AUDIO = 64,
18000}
18001#[repr(u32)]
18002/// Enumeration for UMD drive state
18003#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
18004pub enum pspUmdState {
18005    PSP_UMD_NOT_PRESENT = 1,
18006    PSP_UMD_PRESENT = 2,
18007    PSP_UMD_CHANGED = 4,
18008    PSP_UMD_INITING = 8,
18009    PSP_UMD_INITED = 16,
18010    PSP_UMD_READY = 32,
18011}
18012#[repr(u32)]
18013/// Enumeration for UMD stats (legacy)
18014#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
18015pub enum UmdDriveStat { UMD_WAITFORDISC = 2, UMD_WAITFORINIT = 32, }
18016/// UMD Callback function
18017pub type UmdCallback =
18018    ::core::option::Option<unsafe extern "C" fn(unknown: libc::c_int,
18019                                                event: libc::c_int)
18020                               -> libc::c_int>;
18021extern "C" {
18022    /// Check whether there is a disc in the UMD drive
18023///
18024/// @return 0 if no disc present, anything else indicates a disc is inserted.
18025    pub fn sceUmdCheckMedium() -> libc::c_int;
18026}
18027extern "C" {
18028    /// Get the disc info
18029///
18030/// @param info - A pointer to a ::pspUmdInfo struct
18031///
18032/// @return < 0 on error
18033    pub fn sceUmdGetDiscInfo(info: *mut pspUmdInfo) -> libc::c_int;
18034}
18035extern "C" {
18036    /// Activates the UMD drive
18037///
18038/// @param unit - The unit to initialise (probably). Should be set to 1.
18039///
18040/// @param drive - A prefix string for the fs device to mount the UMD on (e.g. "disc0:")
18041///
18042/// @return < 0 on error
18043///
18044/// @par Example:
18045/// @code
18046/// // Wait for disc and mount to filesystem
18047/// int i;
18048/// i = sceUmdCheckMedium();
18049/// if(i == 0)
18050/// {
18051/// sceUmdWaitDriveStat(PSP_UMD_PRESENT);
18052/// }
18053/// sceUmdActivate(1, "disc0:"); // Mount UMD to disc0: file system
18054/// sceUmdWaitDriveStat(PSP_UMD_READY);
18055/// // Now you can access the UMD using standard sceIo functions
18056/// @endcode
18057    pub fn sceUmdActivate(unit: libc::c_int, drive: *const libc::c_char)
18058     -> libc::c_int;
18059}
18060extern "C" {
18061    /// Deativates the UMD drive
18062///
18063/// @param unit - The unit to initialise (probably). Should be set to 1.
18064///
18065/// @param drive - A prefix string for the fs device to mount the UMD on (e.g. "disc0:")
18066///
18067/// @return < 0 on error
18068    pub fn sceUmdDeactivate(unit: libc::c_int, drive: *const libc::c_char)
18069     -> libc::c_int;
18070}
18071extern "C" {
18072    /// Wait for the UMD drive to reach a certain state
18073///
18074/// @param stat - One or more of ::pspUmdState
18075///
18076/// @return < 0 on error
18077    pub fn sceUmdWaitDriveStat(stat: libc::c_int) -> libc::c_int;
18078}
18079extern "C" {
18080    /// Wait for the UMD drive to reach a certain state
18081///
18082/// @param stat - One or more of ::pspUmdState
18083///
18084/// @param timeout - Timeout value in microseconds
18085///
18086/// @return < 0 on error
18087    pub fn sceUmdWaitDriveStatWithTimer(stat: libc::c_int,
18088                                        timeout: libc::c_uint) -> libc::c_int;
18089}
18090extern "C" {
18091    /// Wait for the UMD drive to reach a certain state (plus callback)
18092///
18093/// @param stat - One or more of ::pspUmdState
18094///
18095/// @param timeout - Timeout value in microseconds
18096///
18097/// @return < 0 on error
18098    pub fn sceUmdWaitDriveStatCB(stat: libc::c_int, timeout: libc::c_uint)
18099     -> libc::c_int;
18100}
18101extern "C" {
18102    /// Cancel a sceUmdWait* call
18103///
18104/// @return < 0 on error
18105    pub fn sceUmdCancelWaitDriveStat() -> libc::c_int;
18106}
18107extern "C" {
18108    /// Get (poll) the current state of the UMD drive
18109///
18110/// @return < 0 on error, one or more of ::pspUmdState on success
18111    pub fn sceUmdGetDriveStat() -> libc::c_int;
18112}
18113extern "C" {
18114    /// Get the error code associated with a failed event
18115///
18116/// @return < 0 on error, the error code on success
18117    pub fn sceUmdGetErrorStat() -> libc::c_int;
18118}
18119extern "C" {
18120    /// Register a callback for the UMD drive
18121/// @note Callback is of type UmdCallback
18122///
18123/// @param cbid - A callback ID created from sceKernelCreateCallback
18124/// @return < 0 on error
18125/// @par Example:
18126/// @code
18127/// int umd_callback(int unknown, int event)
18128/// {
18129/// //do something
18130/// }
18131/// int cbid = sceKernelCreateCallback("UMD Callback", umd_callback, NULL);
18132/// sceUmdRegisterUMDCallBack(cbid);
18133/// @endcode
18134    pub fn sceUmdRegisterUMDCallBack(cbid: libc::c_int) -> libc::c_int;
18135}
18136extern "C" {
18137    /// Un-register a callback for the UMD drive
18138///
18139/// @param cbid - A callback ID created from sceKernelCreateCallback
18140///
18141/// @return < 0 on error
18142    pub fn sceUmdUnRegisterUMDCallBack(cbid: libc::c_int) -> libc::c_int;
18143}
18144extern "C" {
18145    /// Permit UMD disc being replaced
18146///
18147/// @return < 0 on error
18148    pub fn sceUmdReplacePermit() -> libc::c_int;
18149}
18150extern "C" {
18151    /// Prohibit UMD disc being replaced
18152///
18153/// @return < 0 on error
18154    pub fn sceUmdReplaceProhibit() -> libc::c_int;
18155}
18156/// USB driver interface
18157#[repr(C)]
18158#[derive(Debug, Copy)]
18159pub struct UsbInterface {
18160    /// Expectant interface (0 or -1)
18161    pub expect_interface: libc::c_int,
18162    /// Unknown
18163    pub unk8: libc::c_int,
18164    /// Number of interfaces
18165    pub num_interface: libc::c_int,
18166}
18167#[test]
18168fn bindgen_test_layout_UsbInterface() {
18169    assert_eq!(::core::mem::size_of::<UsbInterface>() , 12usize , concat ! (
18170               "Size of: " , stringify ! ( UsbInterface ) ));
18171    assert_eq! (::core::mem::align_of::<UsbInterface>() , 4usize , concat ! (
18172                "Alignment of " , stringify ! ( UsbInterface ) ));
18173    assert_eq! (unsafe {
18174                & ( * ( 0 as * const UsbInterface ) ) . expect_interface as *
18175                const _ as usize } , 0usize , concat ! (
18176                "Alignment of field: " , stringify ! ( UsbInterface ) , "::" ,
18177                stringify ! ( expect_interface ) ));
18178    assert_eq! (unsafe {
18179                & ( * ( 0 as * const UsbInterface ) ) . unk8 as * const _ as
18180                usize } , 4usize , concat ! (
18181                "Alignment of field: " , stringify ! ( UsbInterface ) , "::" ,
18182                stringify ! ( unk8 ) ));
18183    assert_eq! (unsafe {
18184                & ( * ( 0 as * const UsbInterface ) ) . num_interface as *
18185                const _ as usize } , 8usize , concat ! (
18186                "Alignment of field: " , stringify ! ( UsbInterface ) , "::" ,
18187                stringify ! ( num_interface ) ));
18188}
18189impl Clone for UsbInterface {
18190    fn clone(&self) -> Self { *self }
18191}
18192/// USB driver endpoint
18193#[repr(C)]
18194#[derive(Debug, Copy)]
18195pub struct UsbEndpoint {
18196    /// Endpoint number (must be filled in sequentially)
18197    pub endpnum: libc::c_int,
18198    /// Filled in by the bus driver
18199    pub unk2: libc::c_int,
18200    /// Filled in by the bus driver
18201    pub unk3: libc::c_int,
18202}
18203#[test]
18204fn bindgen_test_layout_UsbEndpoint() {
18205    assert_eq!(::core::mem::size_of::<UsbEndpoint>() , 12usize , concat ! (
18206               "Size of: " , stringify ! ( UsbEndpoint ) ));
18207    assert_eq! (::core::mem::align_of::<UsbEndpoint>() , 4usize , concat ! (
18208                "Alignment of " , stringify ! ( UsbEndpoint ) ));
18209    assert_eq! (unsafe {
18210                & ( * ( 0 as * const UsbEndpoint ) ) . endpnum as * const _ as
18211                usize } , 0usize , concat ! (
18212                "Alignment of field: " , stringify ! ( UsbEndpoint ) , "::" ,
18213                stringify ! ( endpnum ) ));
18214    assert_eq! (unsafe {
18215                & ( * ( 0 as * const UsbEndpoint ) ) . unk2 as * const _ as
18216                usize } , 4usize , concat ! (
18217                "Alignment of field: " , stringify ! ( UsbEndpoint ) , "::" ,
18218                stringify ! ( unk2 ) ));
18219    assert_eq! (unsafe {
18220                & ( * ( 0 as * const UsbEndpoint ) ) . unk3 as * const _ as
18221                usize } , 8usize , concat ! (
18222                "Alignment of field: " , stringify ! ( UsbEndpoint ) , "::" ,
18223                stringify ! ( unk3 ) ));
18224}
18225impl Clone for UsbEndpoint {
18226    fn clone(&self) -> Self { *self }
18227}
18228/// USB string descriptor
18229#[repr(C, packed)]
18230#[derive(Debug, Copy)]
18231pub struct StringDescriptor {
18232    pub bLength: libc::c_uchar,
18233    pub bDescriptorType: libc::c_uchar,
18234    pub bString: [libc::c_short; 32usize],
18235}
18236#[test]
18237fn bindgen_test_layout_StringDescriptor() {
18238    assert_eq!(::core::mem::size_of::<StringDescriptor>() , 66usize , concat !
18239               ( "Size of: " , stringify ! ( StringDescriptor ) ));
18240    assert_eq! (::core::mem::align_of::<StringDescriptor>() , 1usize , concat
18241                ! ( "Alignment of " , stringify ! ( StringDescriptor ) ));
18242    assert_eq! (unsafe {
18243                & ( * ( 0 as * const StringDescriptor ) ) . bLength as * const
18244                _ as usize } , 0usize , concat ! (
18245                "Alignment of field: " , stringify ! ( StringDescriptor ) ,
18246                "::" , stringify ! ( bLength ) ));
18247    assert_eq! (unsafe {
18248                & ( * ( 0 as * const StringDescriptor ) ) . bDescriptorType as
18249                * const _ as usize } , 1usize , concat ! (
18250                "Alignment of field: " , stringify ! ( StringDescriptor ) ,
18251                "::" , stringify ! ( bDescriptorType ) ));
18252    assert_eq! (unsafe {
18253                & ( * ( 0 as * const StringDescriptor ) ) . bString as * const
18254                _ as usize } , 2usize , concat ! (
18255                "Alignment of field: " , stringify ! ( StringDescriptor ) ,
18256                "::" , stringify ! ( bString ) ));
18257}
18258impl Clone for StringDescriptor {
18259    fn clone(&self) -> Self { *self }
18260}
18261/// USB device descriptor
18262#[repr(C, packed)]
18263#[derive(Debug, Copy)]
18264pub struct DeviceDescriptor {
18265    pub bLength: libc::c_uchar,
18266    pub bDescriptorType: libc::c_uchar,
18267    pub bcdUSB: libc::c_ushort,
18268    pub bDeviceClass: libc::c_uchar,
18269    pub bDeviceSubClass: libc::c_uchar,
18270    pub bDeviceProtocol: libc::c_uchar,
18271    pub bMaxPacketSize: libc::c_uchar,
18272    pub idVendor: libc::c_ushort,
18273    pub idProduct: libc::c_ushort,
18274    pub bcdDevice: libc::c_ushort,
18275    pub iManufacturer: libc::c_uchar,
18276    pub iProduct: libc::c_uchar,
18277    pub iSerialNumber: libc::c_uchar,
18278    pub bNumConfigurations: libc::c_uchar,
18279}
18280#[test]
18281fn bindgen_test_layout_DeviceDescriptor() {
18282    assert_eq!(::core::mem::size_of::<DeviceDescriptor>() , 18usize , concat !
18283               ( "Size of: " , stringify ! ( DeviceDescriptor ) ));
18284    assert_eq! (::core::mem::align_of::<DeviceDescriptor>() , 1usize , concat
18285                ! ( "Alignment of " , stringify ! ( DeviceDescriptor ) ));
18286    assert_eq! (unsafe {
18287                & ( * ( 0 as * const DeviceDescriptor ) ) . bLength as * const
18288                _ as usize } , 0usize , concat ! (
18289                "Alignment of field: " , stringify ! ( DeviceDescriptor ) ,
18290                "::" , stringify ! ( bLength ) ));
18291    assert_eq! (unsafe {
18292                & ( * ( 0 as * const DeviceDescriptor ) ) . bDescriptorType as
18293                * const _ as usize } , 1usize , concat ! (
18294                "Alignment of field: " , stringify ! ( DeviceDescriptor ) ,
18295                "::" , stringify ! ( bDescriptorType ) ));
18296    assert_eq! (unsafe {
18297                & ( * ( 0 as * const DeviceDescriptor ) ) . bcdUSB as * const
18298                _ as usize } , 2usize , concat ! (
18299                "Alignment of field: " , stringify ! ( DeviceDescriptor ) ,
18300                "::" , stringify ! ( bcdUSB ) ));
18301    assert_eq! (unsafe {
18302                & ( * ( 0 as * const DeviceDescriptor ) ) . bDeviceClass as *
18303                const _ as usize } , 4usize , concat ! (
18304                "Alignment of field: " , stringify ! ( DeviceDescriptor ) ,
18305                "::" , stringify ! ( bDeviceClass ) ));
18306    assert_eq! (unsafe {
18307                & ( * ( 0 as * const DeviceDescriptor ) ) . bDeviceSubClass as
18308                * const _ as usize } , 5usize , concat ! (
18309                "Alignment of field: " , stringify ! ( DeviceDescriptor ) ,
18310                "::" , stringify ! ( bDeviceSubClass ) ));
18311    assert_eq! (unsafe {
18312                & ( * ( 0 as * const DeviceDescriptor ) ) . bDeviceProtocol as
18313                * const _ as usize } , 6usize , concat ! (
18314                "Alignment of field: " , stringify ! ( DeviceDescriptor ) ,
18315                "::" , stringify ! ( bDeviceProtocol ) ));
18316    assert_eq! (unsafe {
18317                & ( * ( 0 as * const DeviceDescriptor ) ) . bMaxPacketSize as
18318                * const _ as usize } , 7usize , concat ! (
18319                "Alignment of field: " , stringify ! ( DeviceDescriptor ) ,
18320                "::" , stringify ! ( bMaxPacketSize ) ));
18321    assert_eq! (unsafe {
18322                & ( * ( 0 as * const DeviceDescriptor ) ) . idVendor as *
18323                const _ as usize } , 8usize , concat ! (
18324                "Alignment of field: " , stringify ! ( DeviceDescriptor ) ,
18325                "::" , stringify ! ( idVendor ) ));
18326    assert_eq! (unsafe {
18327                & ( * ( 0 as * const DeviceDescriptor ) ) . idProduct as *
18328                const _ as usize } , 10usize , concat ! (
18329                "Alignment of field: " , stringify ! ( DeviceDescriptor ) ,
18330                "::" , stringify ! ( idProduct ) ));
18331    assert_eq! (unsafe {
18332                & ( * ( 0 as * const DeviceDescriptor ) ) . bcdDevice as *
18333                const _ as usize } , 12usize , concat ! (
18334                "Alignment of field: " , stringify ! ( DeviceDescriptor ) ,
18335                "::" , stringify ! ( bcdDevice ) ));
18336    assert_eq! (unsafe {
18337                & ( * ( 0 as * const DeviceDescriptor ) ) . iManufacturer as *
18338                const _ as usize } , 14usize , concat ! (
18339                "Alignment of field: " , stringify ! ( DeviceDescriptor ) ,
18340                "::" , stringify ! ( iManufacturer ) ));
18341    assert_eq! (unsafe {
18342                & ( * ( 0 as * const DeviceDescriptor ) ) . iProduct as *
18343                const _ as usize } , 15usize , concat ! (
18344                "Alignment of field: " , stringify ! ( DeviceDescriptor ) ,
18345                "::" , stringify ! ( iProduct ) ));
18346    assert_eq! (unsafe {
18347                & ( * ( 0 as * const DeviceDescriptor ) ) . iSerialNumber as *
18348                const _ as usize } , 16usize , concat ! (
18349                "Alignment of field: " , stringify ! ( DeviceDescriptor ) ,
18350                "::" , stringify ! ( iSerialNumber ) ));
18351    assert_eq! (unsafe {
18352                & ( * ( 0 as * const DeviceDescriptor ) ) . bNumConfigurations
18353                as * const _ as usize } , 17usize , concat ! (
18354                "Alignment of field: " , stringify ! ( DeviceDescriptor ) ,
18355                "::" , stringify ! ( bNumConfigurations ) ));
18356}
18357impl Clone for DeviceDescriptor {
18358    fn clone(&self) -> Self { *self }
18359}
18360/// USB configuration descriptor
18361#[repr(C, packed)]
18362#[derive(Debug, Copy)]
18363pub struct ConfigDescriptor {
18364    pub bLength: libc::c_uchar,
18365    pub bDescriptorType: libc::c_uchar,
18366    pub wTotalLength: libc::c_ushort,
18367    pub bNumInterfaces: libc::c_uchar,
18368    pub bConfigurationValue: libc::c_uchar,
18369    pub iConfiguration: libc::c_uchar,
18370    pub bmAttributes: libc::c_uchar,
18371    pub bMaxPower: libc::c_uchar,
18372}
18373#[test]
18374fn bindgen_test_layout_ConfigDescriptor() {
18375    assert_eq!(::core::mem::size_of::<ConfigDescriptor>() , 9usize , concat !
18376               ( "Size of: " , stringify ! ( ConfigDescriptor ) ));
18377    assert_eq! (::core::mem::align_of::<ConfigDescriptor>() , 1usize , concat
18378                ! ( "Alignment of " , stringify ! ( ConfigDescriptor ) ));
18379    assert_eq! (unsafe {
18380                & ( * ( 0 as * const ConfigDescriptor ) ) . bLength as * const
18381                _ as usize } , 0usize , concat ! (
18382                "Alignment of field: " , stringify ! ( ConfigDescriptor ) ,
18383                "::" , stringify ! ( bLength ) ));
18384    assert_eq! (unsafe {
18385                & ( * ( 0 as * const ConfigDescriptor ) ) . bDescriptorType as
18386                * const _ as usize } , 1usize , concat ! (
18387                "Alignment of field: " , stringify ! ( ConfigDescriptor ) ,
18388                "::" , stringify ! ( bDescriptorType ) ));
18389    assert_eq! (unsafe {
18390                & ( * ( 0 as * const ConfigDescriptor ) ) . wTotalLength as *
18391                const _ as usize } , 2usize , concat ! (
18392                "Alignment of field: " , stringify ! ( ConfigDescriptor ) ,
18393                "::" , stringify ! ( wTotalLength ) ));
18394    assert_eq! (unsafe {
18395                & ( * ( 0 as * const ConfigDescriptor ) ) . bNumInterfaces as
18396                * const _ as usize } , 4usize , concat ! (
18397                "Alignment of field: " , stringify ! ( ConfigDescriptor ) ,
18398                "::" , stringify ! ( bNumInterfaces ) ));
18399    assert_eq! (unsafe {
18400                & ( * ( 0 as * const ConfigDescriptor ) ) .
18401                bConfigurationValue as * const _ as usize } , 5usize , concat
18402                ! (
18403                "Alignment of field: " , stringify ! ( ConfigDescriptor ) ,
18404                "::" , stringify ! ( bConfigurationValue ) ));
18405    assert_eq! (unsafe {
18406                & ( * ( 0 as * const ConfigDescriptor ) ) . iConfiguration as
18407                * const _ as usize } , 6usize , concat ! (
18408                "Alignment of field: " , stringify ! ( ConfigDescriptor ) ,
18409                "::" , stringify ! ( iConfiguration ) ));
18410    assert_eq! (unsafe {
18411                & ( * ( 0 as * const ConfigDescriptor ) ) . bmAttributes as *
18412                const _ as usize } , 7usize , concat ! (
18413                "Alignment of field: " , stringify ! ( ConfigDescriptor ) ,
18414                "::" , stringify ! ( bmAttributes ) ));
18415    assert_eq! (unsafe {
18416                & ( * ( 0 as * const ConfigDescriptor ) ) . bMaxPower as *
18417                const _ as usize } , 8usize , concat ! (
18418                "Alignment of field: " , stringify ! ( ConfigDescriptor ) ,
18419                "::" , stringify ! ( bMaxPower ) ));
18420}
18421impl Clone for ConfigDescriptor {
18422    fn clone(&self) -> Self { *self }
18423}
18424/// USB Interface descriptor
18425#[repr(C, packed)]
18426#[derive(Debug, Copy)]
18427pub struct InterfaceDescriptor {
18428    pub bLength: libc::c_uchar,
18429    pub bDescriptorType: libc::c_uchar,
18430    pub bInterfaceNumber: libc::c_uchar,
18431    pub bAlternateSetting: libc::c_uchar,
18432    pub bNumEndpoints: libc::c_uchar,
18433    pub bInterfaceClass: libc::c_uchar,
18434    pub bInterfaceSubClass: libc::c_uchar,
18435    pub bInterfaceProtocol: libc::c_uchar,
18436    pub iInterface: libc::c_uchar,
18437}
18438#[test]
18439fn bindgen_test_layout_InterfaceDescriptor() {
18440    assert_eq!(::core::mem::size_of::<InterfaceDescriptor>() , 9usize , concat
18441               ! ( "Size of: " , stringify ! ( InterfaceDescriptor ) ));
18442    assert_eq! (::core::mem::align_of::<InterfaceDescriptor>() , 1usize ,
18443                concat ! (
18444                "Alignment of " , stringify ! ( InterfaceDescriptor ) ));
18445    assert_eq! (unsafe {
18446                & ( * ( 0 as * const InterfaceDescriptor ) ) . bLength as *
18447                const _ as usize } , 0usize , concat ! (
18448                "Alignment of field: " , stringify ! ( InterfaceDescriptor ) ,
18449                "::" , stringify ! ( bLength ) ));
18450    assert_eq! (unsafe {
18451                & ( * ( 0 as * const InterfaceDescriptor ) ) . bDescriptorType
18452                as * const _ as usize } , 1usize , concat ! (
18453                "Alignment of field: " , stringify ! ( InterfaceDescriptor ) ,
18454                "::" , stringify ! ( bDescriptorType ) ));
18455    assert_eq! (unsafe {
18456                & ( * ( 0 as * const InterfaceDescriptor ) ) .
18457                bInterfaceNumber as * const _ as usize } , 2usize , concat ! (
18458                "Alignment of field: " , stringify ! ( InterfaceDescriptor ) ,
18459                "::" , stringify ! ( bInterfaceNumber ) ));
18460    assert_eq! (unsafe {
18461                & ( * ( 0 as * const InterfaceDescriptor ) ) .
18462                bAlternateSetting as * const _ as usize } , 3usize , concat !
18463                (
18464                "Alignment of field: " , stringify ! ( InterfaceDescriptor ) ,
18465                "::" , stringify ! ( bAlternateSetting ) ));
18466    assert_eq! (unsafe {
18467                & ( * ( 0 as * const InterfaceDescriptor ) ) . bNumEndpoints
18468                as * const _ as usize } , 4usize , concat ! (
18469                "Alignment of field: " , stringify ! ( InterfaceDescriptor ) ,
18470                "::" , stringify ! ( bNumEndpoints ) ));
18471    assert_eq! (unsafe {
18472                & ( * ( 0 as * const InterfaceDescriptor ) ) . bInterfaceClass
18473                as * const _ as usize } , 5usize , concat ! (
18474                "Alignment of field: " , stringify ! ( InterfaceDescriptor ) ,
18475                "::" , stringify ! ( bInterfaceClass ) ));
18476    assert_eq! (unsafe {
18477                & ( * ( 0 as * const InterfaceDescriptor ) ) .
18478                bInterfaceSubClass as * const _ as usize } , 6usize , concat !
18479                (
18480                "Alignment of field: " , stringify ! ( InterfaceDescriptor ) ,
18481                "::" , stringify ! ( bInterfaceSubClass ) ));
18482    assert_eq! (unsafe {
18483                & ( * ( 0 as * const InterfaceDescriptor ) ) .
18484                bInterfaceProtocol as * const _ as usize } , 7usize , concat !
18485                (
18486                "Alignment of field: " , stringify ! ( InterfaceDescriptor ) ,
18487                "::" , stringify ! ( bInterfaceProtocol ) ));
18488    assert_eq! (unsafe {
18489                & ( * ( 0 as * const InterfaceDescriptor ) ) . iInterface as *
18490                const _ as usize } , 8usize , concat ! (
18491                "Alignment of field: " , stringify ! ( InterfaceDescriptor ) ,
18492                "::" , stringify ! ( iInterface ) ));
18493}
18494impl Clone for InterfaceDescriptor {
18495    fn clone(&self) -> Self { *self }
18496}
18497/// USB endpoint descriptor
18498#[repr(C, packed)]
18499#[derive(Debug, Copy)]
18500pub struct EndpointDescriptor {
18501    pub bLength: libc::c_uchar,
18502    pub bDescriptorType: libc::c_uchar,
18503    pub bEndpointAddress: libc::c_uchar,
18504    pub bmAttributes: libc::c_uchar,
18505    pub wMaxPacketSize: libc::c_ushort,
18506    pub bInterval: libc::c_uchar,
18507}
18508#[test]
18509fn bindgen_test_layout_EndpointDescriptor() {
18510    assert_eq!(::core::mem::size_of::<EndpointDescriptor>() , 7usize , concat
18511               ! ( "Size of: " , stringify ! ( EndpointDescriptor ) ));
18512    assert_eq! (::core::mem::align_of::<EndpointDescriptor>() , 1usize ,
18513                concat ! (
18514                "Alignment of " , stringify ! ( EndpointDescriptor ) ));
18515    assert_eq! (unsafe {
18516                & ( * ( 0 as * const EndpointDescriptor ) ) . bLength as *
18517                const _ as usize } , 0usize , concat ! (
18518                "Alignment of field: " , stringify ! ( EndpointDescriptor ) ,
18519                "::" , stringify ! ( bLength ) ));
18520    assert_eq! (unsafe {
18521                & ( * ( 0 as * const EndpointDescriptor ) ) . bDescriptorType
18522                as * const _ as usize } , 1usize , concat ! (
18523                "Alignment of field: " , stringify ! ( EndpointDescriptor ) ,
18524                "::" , stringify ! ( bDescriptorType ) ));
18525    assert_eq! (unsafe {
18526                & ( * ( 0 as * const EndpointDescriptor ) ) . bEndpointAddress
18527                as * const _ as usize } , 2usize , concat ! (
18528                "Alignment of field: " , stringify ! ( EndpointDescriptor ) ,
18529                "::" , stringify ! ( bEndpointAddress ) ));
18530    assert_eq! (unsafe {
18531                & ( * ( 0 as * const EndpointDescriptor ) ) . bmAttributes as
18532                * const _ as usize } , 3usize , concat ! (
18533                "Alignment of field: " , stringify ! ( EndpointDescriptor ) ,
18534                "::" , stringify ! ( bmAttributes ) ));
18535    assert_eq! (unsafe {
18536                & ( * ( 0 as * const EndpointDescriptor ) ) . wMaxPacketSize
18537                as * const _ as usize } , 4usize , concat ! (
18538                "Alignment of field: " , stringify ! ( EndpointDescriptor ) ,
18539                "::" , stringify ! ( wMaxPacketSize ) ));
18540    assert_eq! (unsafe {
18541                & ( * ( 0 as * const EndpointDescriptor ) ) . bInterval as *
18542                const _ as usize } , 6usize , concat ! (
18543                "Alignment of field: " , stringify ! ( EndpointDescriptor ) ,
18544                "::" , stringify ! ( bInterval ) ));
18545}
18546impl Clone for EndpointDescriptor {
18547    fn clone(&self) -> Self { *self }
18548}
18549/// USB driver interfaces structure
18550#[repr(C)]
18551#[derive(Debug, Copy)]
18552pub struct UsbInterfaces {
18553    /// Pointers to the individual interface descriptors
18554    pub infp: [*mut InterfaceDescriptor; 2usize],
18555    /// Number of interface descriptors
18556    pub num: libc::c_uint,
18557}
18558#[test]
18559fn bindgen_test_layout_UsbInterfaces() {
18560    assert_eq!(::core::mem::size_of::<UsbInterfaces>() , 24usize , concat ! (
18561               "Size of: " , stringify ! ( UsbInterfaces ) ));
18562    assert_eq! (::core::mem::align_of::<UsbInterfaces>() , 8usize , concat ! (
18563                "Alignment of " , stringify ! ( UsbInterfaces ) ));
18564    assert_eq! (unsafe {
18565                & ( * ( 0 as * const UsbInterfaces ) ) . infp as * const _ as
18566                usize } , 0usize , concat ! (
18567                "Alignment of field: " , stringify ! ( UsbInterfaces ) , "::"
18568                , stringify ! ( infp ) ));
18569    assert_eq! (unsafe {
18570                & ( * ( 0 as * const UsbInterfaces ) ) . num as * const _ as
18571                usize } , 16usize , concat ! (
18572                "Alignment of field: " , stringify ! ( UsbInterfaces ) , "::"
18573                , stringify ! ( num ) ));
18574}
18575impl Clone for UsbInterfaces {
18576    fn clone(&self) -> Self { *self }
18577}
18578/// USB driver configuration
18579#[repr(C)]
18580#[derive(Debug, Copy)]
18581pub struct UsbConfiguration {
18582    /// Pointer to the configuration descriptors
18583    pub confp: *mut ConfigDescriptor,
18584    /// USB driver interfaces pointer
18585    pub infs: *mut UsbInterfaces,
18586    /// Pointer to the first interface descriptor
18587    pub infp: *mut InterfaceDescriptor,
18588    /// Pointer to the first endpoint descriptor (each should be 16byte aligned)
18589    pub endp: *mut EndpointDescriptor,
18590}
18591#[test]
18592fn bindgen_test_layout_UsbConfiguration() {
18593    assert_eq!(::core::mem::size_of::<UsbConfiguration>() , 32usize , concat !
18594               ( "Size of: " , stringify ! ( UsbConfiguration ) ));
18595    assert_eq! (::core::mem::align_of::<UsbConfiguration>() , 8usize , concat
18596                ! ( "Alignment of " , stringify ! ( UsbConfiguration ) ));
18597    assert_eq! (unsafe {
18598                & ( * ( 0 as * const UsbConfiguration ) ) . confp as * const _
18599                as usize } , 0usize , concat ! (
18600                "Alignment of field: " , stringify ! ( UsbConfiguration ) ,
18601                "::" , stringify ! ( confp ) ));
18602    assert_eq! (unsafe {
18603                & ( * ( 0 as * const UsbConfiguration ) ) . infs as * const _
18604                as usize } , 8usize , concat ! (
18605                "Alignment of field: " , stringify ! ( UsbConfiguration ) ,
18606                "::" , stringify ! ( infs ) ));
18607    assert_eq! (unsafe {
18608                & ( * ( 0 as * const UsbConfiguration ) ) . infp as * const _
18609                as usize } , 16usize , concat ! (
18610                "Alignment of field: " , stringify ! ( UsbConfiguration ) ,
18611                "::" , stringify ! ( infp ) ));
18612    assert_eq! (unsafe {
18613                & ( * ( 0 as * const UsbConfiguration ) ) . endp as * const _
18614                as usize } , 24usize , concat ! (
18615                "Alignment of field: " , stringify ! ( UsbConfiguration ) ,
18616                "::" , stringify ! ( endp ) ));
18617}
18618impl Clone for UsbConfiguration {
18619    fn clone(&self) -> Self { *self }
18620}
18621/// Padded data structure, padding is required otherwise the USB hardware crashes
18622#[repr(C, packed)]
18623#[derive(Debug, Copy)]
18624pub struct UsbData {
18625    pub devdesc: [libc::c_uchar; 20usize],
18626    pub config: UsbData_Config,
18627    pub confdesc: UsbData_ConfDesc,
18628    pub pad1: [libc::c_uchar; 8usize],
18629    pub interfaces: UsbData_Interfaces,
18630    pub interdesc: UsbData_InterDesc,
18631    pub endp: [UsbData_Endp; 4usize],
18632}
18633#[repr(C)]
18634#[derive(Debug, Copy)]
18635pub struct UsbData_Config {
18636    pub pconfdesc: *mut libc::c_void,
18637    pub pinterfaces: *mut libc::c_void,
18638    pub pinterdesc: *mut libc::c_void,
18639    pub pendp: *mut libc::c_void,
18640}
18641#[test]
18642fn bindgen_test_layout_UsbData_Config() {
18643    assert_eq!(::core::mem::size_of::<UsbData_Config>() , 32usize , concat ! (
18644               "Size of: " , stringify ! ( UsbData_Config ) ));
18645    assert_eq! (::core::mem::align_of::<UsbData_Config>() , 8usize , concat !
18646                ( "Alignment of " , stringify ! ( UsbData_Config ) ));
18647    assert_eq! (unsafe {
18648                & ( * ( 0 as * const UsbData_Config ) ) . pconfdesc as * const
18649                _ as usize } , 0usize , concat ! (
18650                "Alignment of field: " , stringify ! ( UsbData_Config ) , "::"
18651                , stringify ! ( pconfdesc ) ));
18652    assert_eq! (unsafe {
18653                & ( * ( 0 as * const UsbData_Config ) ) . pinterfaces as *
18654                const _ as usize } , 8usize , concat ! (
18655                "Alignment of field: " , stringify ! ( UsbData_Config ) , "::"
18656                , stringify ! ( pinterfaces ) ));
18657    assert_eq! (unsafe {
18658                & ( * ( 0 as * const UsbData_Config ) ) . pinterdesc as *
18659                const _ as usize } , 16usize , concat ! (
18660                "Alignment of field: " , stringify ! ( UsbData_Config ) , "::"
18661                , stringify ! ( pinterdesc ) ));
18662    assert_eq! (unsafe {
18663                & ( * ( 0 as * const UsbData_Config ) ) . pendp as * const _
18664                as usize } , 24usize , concat ! (
18665                "Alignment of field: " , stringify ! ( UsbData_Config ) , "::"
18666                , stringify ! ( pendp ) ));
18667}
18668impl Clone for UsbData_Config {
18669    fn clone(&self) -> Self { *self }
18670}
18671#[repr(C)]
18672#[derive(Debug, Copy)]
18673pub struct UsbData_ConfDesc {
18674    pub desc: [libc::c_uchar; 12usize],
18675    pub pinterfaces: *mut libc::c_void,
18676}
18677#[test]
18678fn bindgen_test_layout_UsbData_ConfDesc() {
18679    assert_eq!(::core::mem::size_of::<UsbData_ConfDesc>() , 24usize , concat !
18680               ( "Size of: " , stringify ! ( UsbData_ConfDesc ) ));
18681    assert_eq! (::core::mem::align_of::<UsbData_ConfDesc>() , 8usize , concat
18682                ! ( "Alignment of " , stringify ! ( UsbData_ConfDesc ) ));
18683    assert_eq! (unsafe {
18684                & ( * ( 0 as * const UsbData_ConfDesc ) ) . desc as * const _
18685                as usize } , 0usize , concat ! (
18686                "Alignment of field: " , stringify ! ( UsbData_ConfDesc ) ,
18687                "::" , stringify ! ( desc ) ));
18688    assert_eq! (unsafe {
18689                & ( * ( 0 as * const UsbData_ConfDesc ) ) . pinterfaces as *
18690                const _ as usize } , 16usize , concat ! (
18691                "Alignment of field: " , stringify ! ( UsbData_ConfDesc ) ,
18692                "::" , stringify ! ( pinterfaces ) ));
18693}
18694impl Clone for UsbData_ConfDesc {
18695    fn clone(&self) -> Self { *self }
18696}
18697#[repr(C)]
18698#[derive(Debug, Copy)]
18699pub struct UsbData_Interfaces {
18700    pub pinterdesc: [*mut libc::c_void; 2usize],
18701    pub intcount: libc::c_uint,
18702}
18703#[test]
18704fn bindgen_test_layout_UsbData_Interfaces() {
18705    assert_eq!(::core::mem::size_of::<UsbData_Interfaces>() , 24usize , concat
18706               ! ( "Size of: " , stringify ! ( UsbData_Interfaces ) ));
18707    assert_eq! (::core::mem::align_of::<UsbData_Interfaces>() , 8usize ,
18708                concat ! (
18709                "Alignment of " , stringify ! ( UsbData_Interfaces ) ));
18710    assert_eq! (unsafe {
18711                & ( * ( 0 as * const UsbData_Interfaces ) ) . pinterdesc as *
18712                const _ as usize } , 0usize , concat ! (
18713                "Alignment of field: " , stringify ! ( UsbData_Interfaces ) ,
18714                "::" , stringify ! ( pinterdesc ) ));
18715    assert_eq! (unsafe {
18716                & ( * ( 0 as * const UsbData_Interfaces ) ) . intcount as *
18717                const _ as usize } , 16usize , concat ! (
18718                "Alignment of field: " , stringify ! ( UsbData_Interfaces ) ,
18719                "::" , stringify ! ( intcount ) ));
18720}
18721impl Clone for UsbData_Interfaces {
18722    fn clone(&self) -> Self { *self }
18723}
18724#[repr(C)]
18725#[derive(Debug, Copy)]
18726pub struct UsbData_InterDesc {
18727    pub desc: [libc::c_uchar; 12usize],
18728    pub pendp: *mut libc::c_void,
18729    pub pad: [libc::c_uchar; 32usize],
18730}
18731#[test]
18732fn bindgen_test_layout_UsbData_InterDesc() {
18733    assert_eq!(::core::mem::size_of::<UsbData_InterDesc>() , 56usize , concat
18734               ! ( "Size of: " , stringify ! ( UsbData_InterDesc ) ));
18735    assert_eq! (::core::mem::align_of::<UsbData_InterDesc>() , 8usize , concat
18736                ! ( "Alignment of " , stringify ! ( UsbData_InterDesc ) ));
18737    assert_eq! (unsafe {
18738                & ( * ( 0 as * const UsbData_InterDesc ) ) . desc as * const _
18739                as usize } , 0usize , concat ! (
18740                "Alignment of field: " , stringify ! ( UsbData_InterDesc ) ,
18741                "::" , stringify ! ( desc ) ));
18742    assert_eq! (unsafe {
18743                & ( * ( 0 as * const UsbData_InterDesc ) ) . pendp as * const
18744                _ as usize } , 16usize , concat ! (
18745                "Alignment of field: " , stringify ! ( UsbData_InterDesc ) ,
18746                "::" , stringify ! ( pendp ) ));
18747    assert_eq! (unsafe {
18748                & ( * ( 0 as * const UsbData_InterDesc ) ) . pad as * const _
18749                as usize } , 24usize , concat ! (
18750                "Alignment of field: " , stringify ! ( UsbData_InterDesc ) ,
18751                "::" , stringify ! ( pad ) ));
18752}
18753impl Clone for UsbData_InterDesc {
18754    fn clone(&self) -> Self { *self }
18755}
18756#[repr(C)]
18757#[derive(Debug, Copy)]
18758pub struct UsbData_Endp {
18759    pub desc: [libc::c_uchar; 16usize],
18760}
18761#[test]
18762fn bindgen_test_layout_UsbData_Endp() {
18763    assert_eq!(::core::mem::size_of::<UsbData_Endp>() , 16usize , concat ! (
18764               "Size of: " , stringify ! ( UsbData_Endp ) ));
18765    assert_eq! (::core::mem::align_of::<UsbData_Endp>() , 1usize , concat ! (
18766                "Alignment of " , stringify ! ( UsbData_Endp ) ));
18767    assert_eq! (unsafe {
18768                & ( * ( 0 as * const UsbData_Endp ) ) . desc as * const _ as
18769                usize } , 0usize , concat ! (
18770                "Alignment of field: " , stringify ! ( UsbData_Endp ) , "::" ,
18771                stringify ! ( desc ) ));
18772}
18773impl Clone for UsbData_Endp {
18774    fn clone(&self) -> Self { *self }
18775}
18776#[test]
18777fn bindgen_test_layout_UsbData() {
18778    assert_eq!(::core::mem::size_of::<UsbData>() , 228usize , concat ! (
18779               "Size of: " , stringify ! ( UsbData ) ));
18780    assert_eq! (::core::mem::align_of::<UsbData>() , 1usize , concat ! (
18781                "Alignment of " , stringify ! ( UsbData ) ));
18782    assert_eq! (unsafe {
18783                & ( * ( 0 as * const UsbData ) ) . devdesc as * const _ as
18784                usize } , 0usize , concat ! (
18785                "Alignment of field: " , stringify ! ( UsbData ) , "::" ,
18786                stringify ! ( devdesc ) ));
18787    assert_eq! (unsafe {
18788                & ( * ( 0 as * const UsbData ) ) . config as * const _ as
18789                usize } , 20usize , concat ! (
18790                "Alignment of field: " , stringify ! ( UsbData ) , "::" ,
18791                stringify ! ( config ) ));
18792    assert_eq! (unsafe {
18793                & ( * ( 0 as * const UsbData ) ) . confdesc as * const _ as
18794                usize } , 52usize , concat ! (
18795                "Alignment of field: " , stringify ! ( UsbData ) , "::" ,
18796                stringify ! ( confdesc ) ));
18797    assert_eq! (unsafe {
18798                & ( * ( 0 as * const UsbData ) ) . pad1 as * const _ as usize
18799                } , 76usize , concat ! (
18800                "Alignment of field: " , stringify ! ( UsbData ) , "::" ,
18801                stringify ! ( pad1 ) ));
18802    assert_eq! (unsafe {
18803                & ( * ( 0 as * const UsbData ) ) . interfaces as * const _ as
18804                usize } , 84usize , concat ! (
18805                "Alignment of field: " , stringify ! ( UsbData ) , "::" ,
18806                stringify ! ( interfaces ) ));
18807    assert_eq! (unsafe {
18808                & ( * ( 0 as * const UsbData ) ) . interdesc as * const _ as
18809                usize } , 108usize , concat ! (
18810                "Alignment of field: " , stringify ! ( UsbData ) , "::" ,
18811                stringify ! ( interdesc ) ));
18812    assert_eq! (unsafe {
18813                & ( * ( 0 as * const UsbData ) ) . endp as * const _ as usize
18814                } , 164usize , concat ! (
18815                "Alignment of field: " , stringify ! ( UsbData ) , "::" ,
18816                stringify ! ( endp ) ));
18817}
18818impl Clone for UsbData {
18819    fn clone(&self) -> Self { *self }
18820}
18821/// USB EP0 Device Request
18822#[repr(C, packed)]
18823#[derive(Debug, Copy)]
18824pub struct DeviceRequest {
18825    pub bmRequestType: libc::c_uchar,
18826    pub bRequest: libc::c_uchar,
18827    pub wValue: libc::c_ushort,
18828    pub wIndex: libc::c_ushort,
18829    pub wLength: libc::c_ushort,
18830}
18831#[test]
18832fn bindgen_test_layout_DeviceRequest() {
18833    assert_eq!(::core::mem::size_of::<DeviceRequest>() , 8usize , concat ! (
18834               "Size of: " , stringify ! ( DeviceRequest ) ));
18835    assert_eq! (::core::mem::align_of::<DeviceRequest>() , 1usize , concat ! (
18836                "Alignment of " , stringify ! ( DeviceRequest ) ));
18837    assert_eq! (unsafe {
18838                & ( * ( 0 as * const DeviceRequest ) ) . bmRequestType as *
18839                const _ as usize } , 0usize , concat ! (
18840                "Alignment of field: " , stringify ! ( DeviceRequest ) , "::"
18841                , stringify ! ( bmRequestType ) ));
18842    assert_eq! (unsafe {
18843                & ( * ( 0 as * const DeviceRequest ) ) . bRequest as * const _
18844                as usize } , 1usize , concat ! (
18845                "Alignment of field: " , stringify ! ( DeviceRequest ) , "::"
18846                , stringify ! ( bRequest ) ));
18847    assert_eq! (unsafe {
18848                & ( * ( 0 as * const DeviceRequest ) ) . wValue as * const _
18849                as usize } , 2usize , concat ! (
18850                "Alignment of field: " , stringify ! ( DeviceRequest ) , "::"
18851                , stringify ! ( wValue ) ));
18852    assert_eq! (unsafe {
18853                & ( * ( 0 as * const DeviceRequest ) ) . wIndex as * const _
18854                as usize } , 4usize , concat ! (
18855                "Alignment of field: " , stringify ! ( DeviceRequest ) , "::"
18856                , stringify ! ( wIndex ) ));
18857    assert_eq! (unsafe {
18858                & ( * ( 0 as * const DeviceRequest ) ) . wLength as * const _
18859                as usize } , 6usize , concat ! (
18860                "Alignment of field: " , stringify ! ( DeviceRequest ) , "::"
18861                , stringify ! ( wLength ) ));
18862}
18863impl Clone for DeviceRequest {
18864    fn clone(&self) -> Self { *self }
18865}
18866/// USB driver structure used by ::sceUsbbdRegister and ::sceUsbbdUnregister
18867#[repr(C)]
18868#[derive(Debug, Copy)]
18869pub struct UsbDriver {
18870    /// Name of the USB driver
18871    pub name: *const libc::c_char,
18872    /// Number of endpoints in this driver (including default control)
18873    pub endpoints: libc::c_int,
18874    /// List of endpoint structures (used when calling other functions)
18875    pub endp: *mut UsbEndpoint,
18876    /// Interface list
18877    pub intp: *mut UsbInterface,
18878    /// Pointer to hi-speed device descriptor
18879    pub devp_hi: *mut libc::c_void,
18880    /// Pointer to hi-speed device configuration
18881    pub confp_hi: *mut libc::c_void,
18882    /// Pointer to full-speed device descriptor
18883    pub devp: *mut libc::c_void,
18884    /// Pointer to full-speed device configuration
18885    pub confp: *mut libc::c_void,
18886    /// Default String descriptor
18887    pub str: *mut StringDescriptor,
18888    /// Received a control request arg0 is endpoint, arg1 is possibly data arg2 is data buffer
18889    pub recvctl: ::core::option::Option<unsafe extern "C" fn(arg1:
18890                                                                 libc::c_int,
18891                                                             arg2:
18892                                                                 libc::c_int,
18893                                                             req:
18894                                                                 *mut DeviceRequest)
18895                                            -> libc::c_int>,
18896    /// Unknown
18897    pub func28: ::core::option::Option<unsafe extern "C" fn(arg1: libc::c_int,
18898                                                            arg2: libc::c_int,
18899                                                            arg3: libc::c_int)
18900                                           -> libc::c_int>,
18901    /// Configuration set (attach) function
18902    pub attach: ::core::option::Option<unsafe extern "C" fn(speed:
18903                                                                libc::c_int,
18904                                                            arg2:
18905                                                                *mut libc::c_void,
18906                                                            arg3:
18907                                                                *mut libc::c_void)
18908                                           -> libc::c_int>,
18909    /// Configuration unset (detach) function
18910    pub detach: ::core::option::Option<unsafe extern "C" fn(arg1: libc::c_int,
18911                                                            arg2: libc::c_int,
18912                                                            arg3: libc::c_int)
18913                                           -> libc::c_int>,
18914    /// Unknown set to 0
18915    pub unk34: libc::c_int,
18916    /// Function called when the driver is started
18917    pub start_func: ::core::option::Option<unsafe extern "C" fn(size:
18918                                                                    libc::c_int,
18919                                                                args:
18920                                                                    *mut libc::c_void)
18921                                               -> libc::c_int>,
18922    /// Function called when the driver is stopped
18923    pub stop_func: ::core::option::Option<unsafe extern "C" fn(size:
18924                                                                   libc::c_int,
18925                                                               args:
18926                                                                   *mut libc::c_void)
18927                                              -> libc::c_int>,
18928    /// Link to next USB driver in the chain, set to NULL
18929    pub link: *mut UsbDriver,
18930}
18931#[test]
18932fn bindgen_test_layout_UsbDriver() {
18933    assert_eq!(::core::mem::size_of::<UsbDriver>() , 136usize , concat ! (
18934               "Size of: " , stringify ! ( UsbDriver ) ));
18935    assert_eq! (::core::mem::align_of::<UsbDriver>() , 8usize , concat ! (
18936                "Alignment of " , stringify ! ( UsbDriver ) ));
18937    assert_eq! (unsafe {
18938                & ( * ( 0 as * const UsbDriver ) ) . name as * const _ as
18939                usize } , 0usize , concat ! (
18940                "Alignment of field: " , stringify ! ( UsbDriver ) , "::" ,
18941                stringify ! ( name ) ));
18942    assert_eq! (unsafe {
18943                & ( * ( 0 as * const UsbDriver ) ) . endpoints as * const _ as
18944                usize } , 8usize , concat ! (
18945                "Alignment of field: " , stringify ! ( UsbDriver ) , "::" ,
18946                stringify ! ( endpoints ) ));
18947    assert_eq! (unsafe {
18948                & ( * ( 0 as * const UsbDriver ) ) . endp as * const _ as
18949                usize } , 16usize , concat ! (
18950                "Alignment of field: " , stringify ! ( UsbDriver ) , "::" ,
18951                stringify ! ( endp ) ));
18952    assert_eq! (unsafe {
18953                & ( * ( 0 as * const UsbDriver ) ) . intp as * const _ as
18954                usize } , 24usize , concat ! (
18955                "Alignment of field: " , stringify ! ( UsbDriver ) , "::" ,
18956                stringify ! ( intp ) ));
18957    assert_eq! (unsafe {
18958                & ( * ( 0 as * const UsbDriver ) ) . devp_hi as * const _ as
18959                usize } , 32usize , concat ! (
18960                "Alignment of field: " , stringify ! ( UsbDriver ) , "::" ,
18961                stringify ! ( devp_hi ) ));
18962    assert_eq! (unsafe {
18963                & ( * ( 0 as * const UsbDriver ) ) . confp_hi as * const _ as
18964                usize } , 40usize , concat ! (
18965                "Alignment of field: " , stringify ! ( UsbDriver ) , "::" ,
18966                stringify ! ( confp_hi ) ));
18967    assert_eq! (unsafe {
18968                & ( * ( 0 as * const UsbDriver ) ) . devp as * const _ as
18969                usize } , 48usize , concat ! (
18970                "Alignment of field: " , stringify ! ( UsbDriver ) , "::" ,
18971                stringify ! ( devp ) ));
18972    assert_eq! (unsafe {
18973                & ( * ( 0 as * const UsbDriver ) ) . confp as * const _ as
18974                usize } , 56usize , concat ! (
18975                "Alignment of field: " , stringify ! ( UsbDriver ) , "::" ,
18976                stringify ! ( confp ) ));
18977    assert_eq! (unsafe {
18978                & ( * ( 0 as * const UsbDriver ) ) . str as * const _ as usize
18979                } , 64usize , concat ! (
18980                "Alignment of field: " , stringify ! ( UsbDriver ) , "::" ,
18981                stringify ! ( str ) ));
18982    assert_eq! (unsafe {
18983                & ( * ( 0 as * const UsbDriver ) ) . recvctl as * const _ as
18984                usize } , 72usize , concat ! (
18985                "Alignment of field: " , stringify ! ( UsbDriver ) , "::" ,
18986                stringify ! ( recvctl ) ));
18987    assert_eq! (unsafe {
18988                & ( * ( 0 as * const UsbDriver ) ) . func28 as * const _ as
18989                usize } , 80usize , concat ! (
18990                "Alignment of field: " , stringify ! ( UsbDriver ) , "::" ,
18991                stringify ! ( func28 ) ));
18992    assert_eq! (unsafe {
18993                & ( * ( 0 as * const UsbDriver ) ) . attach as * const _ as
18994                usize } , 88usize , concat ! (
18995                "Alignment of field: " , stringify ! ( UsbDriver ) , "::" ,
18996                stringify ! ( attach ) ));
18997    assert_eq! (unsafe {
18998                & ( * ( 0 as * const UsbDriver ) ) . detach as * const _ as
18999                usize } , 96usize , concat ! (
19000                "Alignment of field: " , stringify ! ( UsbDriver ) , "::" ,
19001                stringify ! ( detach ) ));
19002    assert_eq! (unsafe {
19003                & ( * ( 0 as * const UsbDriver ) ) . unk34 as * const _ as
19004                usize } , 104usize , concat ! (
19005                "Alignment of field: " , stringify ! ( UsbDriver ) , "::" ,
19006                stringify ! ( unk34 ) ));
19007    assert_eq! (unsafe {
19008                & ( * ( 0 as * const UsbDriver ) ) . start_func as * const _
19009                as usize } , 112usize , concat ! (
19010                "Alignment of field: " , stringify ! ( UsbDriver ) , "::" ,
19011                stringify ! ( start_func ) ));
19012    assert_eq! (unsafe {
19013                & ( * ( 0 as * const UsbDriver ) ) . stop_func as * const _ as
19014                usize } , 120usize , concat ! (
19015                "Alignment of field: " , stringify ! ( UsbDriver ) , "::" ,
19016                stringify ! ( stop_func ) ));
19017    assert_eq! (unsafe {
19018                & ( * ( 0 as * const UsbDriver ) ) . link as * const _ as
19019                usize } , 128usize , concat ! (
19020                "Alignment of field: " , stringify ! ( UsbDriver ) , "::" ,
19021                stringify ! ( link ) ));
19022}
19023impl Clone for UsbDriver {
19024    fn clone(&self) -> Self { *self }
19025}
19026/// USB device request, used by ::sceUsbbdReqSend and ::sceUsbbdReqRecv.
19027#[repr(C)]
19028#[derive(Debug, Copy)]
19029pub struct UsbdDeviceReq {
19030    /// Pointer to the endpoint to queue request on
19031    pub endp: *mut UsbEndpoint,
19032    /// Pointer to the data buffer to use in the request
19033    pub data: *mut libc::c_void,
19034    /// Size of the data buffer (send == size of data, recv == size of max receive)
19035    pub size: libc::c_int,
19036    /// Unknown
19037    pub unkc: libc::c_int,
19038    /// Pointer to the function to call on completion
19039    pub func: *mut libc::c_void,
19040    /// Resultant size (send == size of data sent, recv == size of data received)
19041    pub recvsize: libc::c_int,
19042    /// Return code of the request, 0 == success, -3 == cancelled
19043    pub retcode: libc::c_int,
19044    /// Unknown
19045    pub unk1c: libc::c_int,
19046    /// A user specified pointer for the device request
19047    pub arg: *mut libc::c_void,
19048    /// Link pointer to next request used by the driver, set it to NULL
19049    pub link: *mut libc::c_void,
19050}
19051#[test]
19052fn bindgen_test_layout_UsbdDeviceReq() {
19053    assert_eq!(::core::mem::size_of::<UsbdDeviceReq>() , 64usize , concat ! (
19054               "Size of: " , stringify ! ( UsbdDeviceReq ) ));
19055    assert_eq! (::core::mem::align_of::<UsbdDeviceReq>() , 8usize , concat ! (
19056                "Alignment of " , stringify ! ( UsbdDeviceReq ) ));
19057    assert_eq! (unsafe {
19058                & ( * ( 0 as * const UsbdDeviceReq ) ) . endp as * const _ as
19059                usize } , 0usize , concat ! (
19060                "Alignment of field: " , stringify ! ( UsbdDeviceReq ) , "::"
19061                , stringify ! ( endp ) ));
19062    assert_eq! (unsafe {
19063                & ( * ( 0 as * const UsbdDeviceReq ) ) . data as * const _ as
19064                usize } , 8usize , concat ! (
19065                "Alignment of field: " , stringify ! ( UsbdDeviceReq ) , "::"
19066                , stringify ! ( data ) ));
19067    assert_eq! (unsafe {
19068                & ( * ( 0 as * const UsbdDeviceReq ) ) . size as * const _ as
19069                usize } , 16usize , concat ! (
19070                "Alignment of field: " , stringify ! ( UsbdDeviceReq ) , "::"
19071                , stringify ! ( size ) ));
19072    assert_eq! (unsafe {
19073                & ( * ( 0 as * const UsbdDeviceReq ) ) . unkc as * const _ as
19074                usize } , 20usize , concat ! (
19075                "Alignment of field: " , stringify ! ( UsbdDeviceReq ) , "::"
19076                , stringify ! ( unkc ) ));
19077    assert_eq! (unsafe {
19078                & ( * ( 0 as * const UsbdDeviceReq ) ) . func as * const _ as
19079                usize } , 24usize , concat ! (
19080                "Alignment of field: " , stringify ! ( UsbdDeviceReq ) , "::"
19081                , stringify ! ( func ) ));
19082    assert_eq! (unsafe {
19083                & ( * ( 0 as * const UsbdDeviceReq ) ) . recvsize as * const _
19084                as usize } , 32usize , concat ! (
19085                "Alignment of field: " , stringify ! ( UsbdDeviceReq ) , "::"
19086                , stringify ! ( recvsize ) ));
19087    assert_eq! (unsafe {
19088                & ( * ( 0 as * const UsbdDeviceReq ) ) . retcode as * const _
19089                as usize } , 36usize , concat ! (
19090                "Alignment of field: " , stringify ! ( UsbdDeviceReq ) , "::"
19091                , stringify ! ( retcode ) ));
19092    assert_eq! (unsafe {
19093                & ( * ( 0 as * const UsbdDeviceReq ) ) . unk1c as * const _ as
19094                usize } , 40usize , concat ! (
19095                "Alignment of field: " , stringify ! ( UsbdDeviceReq ) , "::"
19096                , stringify ! ( unk1c ) ));
19097    assert_eq! (unsafe {
19098                & ( * ( 0 as * const UsbdDeviceReq ) ) . arg as * const _ as
19099                usize } , 48usize , concat ! (
19100                "Alignment of field: " , stringify ! ( UsbdDeviceReq ) , "::"
19101                , stringify ! ( arg ) ));
19102    assert_eq! (unsafe {
19103                & ( * ( 0 as * const UsbdDeviceReq ) ) . link as * const _ as
19104                usize } , 56usize , concat ! (
19105                "Alignment of field: " , stringify ! ( UsbdDeviceReq ) , "::"
19106                , stringify ! ( link ) ));
19107}
19108impl Clone for UsbdDeviceReq {
19109    fn clone(&self) -> Self { *self }
19110}
19111extern "C" {
19112    /// Register a USB driver.
19113///
19114/// @param drv - Pointer to a filled out USB driver
19115///
19116/// @return 0 on success, < 0 on error
19117    pub fn sceUsbbdRegister(drv: *mut UsbDriver) -> libc::c_int;
19118}
19119extern "C" {
19120    /// Unregister a USB driver
19121///
19122/// @param drv - Pointer to a filled out USB driver
19123///
19124/// @return 0 on success, < 0 on error
19125    pub fn sceUsbbdUnregister(drv: *mut UsbDriver) -> libc::c_int;
19126}
19127extern "C" {
19128    /// Clear the FIFO on an endpoint
19129///
19130/// @param endp - The endpoint to clear
19131///
19132/// @return 0 on success, < 0 on error
19133    pub fn sceUsbbdClearFIFO(endp: *mut UsbEndpoint) -> libc::c_int;
19134}
19135extern "C" {
19136    /// Cancel any pending requests on an endpoint.
19137///
19138/// @param endp - The endpoint to cancel
19139///
19140/// @return 0 on success, < 0 on error
19141    pub fn sceUsbbdReqCancelAll(endp: *mut UsbEndpoint) -> libc::c_int;
19142}
19143extern "C" {
19144    /// Stall an endpoint
19145///
19146/// @param endp - The endpoint to stall
19147///
19148/// @return 0 on success, < 0 on error
19149    pub fn sceUsbbdStall(endp: *mut UsbEndpoint) -> libc::c_int;
19150}
19151extern "C" {
19152    /// Queue a send request (IN from host pov)
19153///
19154/// @param req - Pointer to a filled out UsbdDeviceReq structure.
19155///
19156/// @return 0 on success, < 0 on error
19157    pub fn sceUsbbdReqSend(req: *mut UsbdDeviceReq) -> libc::c_int;
19158}
19159extern "C" {
19160    /// Queue a receive request (OUT from host pov)
19161///
19162/// @param req - Pointer to a filled out UsbdDeviceReq structure
19163///
19164/// @return 0 on success, < 0 on error
19165    pub fn sceUsbbdReqRecv(req: *mut UsbdDeviceReq) -> libc::c_int;
19166}
19167#[repr(u32)]
19168/// Resolutions for sceUsbCamSetupStill &
19169/// sceUsbCamSetupVideo
19170/// DO NOT use on sceUsbCamSetupStillEx & sceUsbCamSetupVideoEx
19171#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
19172pub enum PspUsbCamResolution {
19173    PSP_USBCAM_RESOLUTION_160_120 = 0,
19174    PSP_USBCAM_RESOLUTION_176_144 = 1,
19175    PSP_USBCAM_RESOLUTION_320_240 = 2,
19176    PSP_USBCAM_RESOLUTION_352_288 = 3,
19177    PSP_USBCAM_RESOLUTION_640_480 = 4,
19178    PSP_USBCAM_RESOLUTION_1024_768 = 5,
19179    PSP_USBCAM_RESOLUTION_1280_960 = 6,
19180    PSP_USBCAM_RESOLUTION_480_272 = 7,
19181    PSP_USBCAM_RESOLUTION_360_272 = 8,
19182}
19183#[repr(u32)]
19184/// Resolutions for sceUsbCamSetupStillEx &
19185/// sceUsbCamSetupVideoEx
19186/// DO NOT use on sceUsbCamSetupStill & sceUsbCamSetupVideo
19187#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
19188pub enum PspUsbCamResolutionEx {
19189    PSP_USBCAM_RESOLUTION_EX_160_120 = 0,
19190    PSP_USBCAM_RESOLUTION_EX_176_144 = 1,
19191    PSP_USBCAM_RESOLUTION_EX_320_240 = 2,
19192    PSP_USBCAM_RESOLUTION_EX_352_288 = 3,
19193    PSP_USBCAM_RESOLUTION_EX_360_272 = 4,
19194    PSP_USBCAM_RESOLUTION_EX_480_272 = 5,
19195    PSP_USBCAM_RESOLUTION_EX_640_480 = 6,
19196    PSP_USBCAM_RESOLUTION_EX_1024_768 = 7,
19197    PSP_USBCAM_RESOLUTION_EX_1280_960 = 8,
19198}
19199#[repr(u32)]
19200/// Flags for reverse effects.
19201#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
19202pub enum PspUsbCamReverseFlags {
19203    PSP_USBCAM_FLIP = 1,
19204    PSP_USBCAM_MIRROR = 256,
19205}
19206#[repr(u32)]
19207/// Delay to take pictures
19208#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
19209pub enum PspUsbCamDelay {
19210    PSP_USBCAM_NODELAY = 0,
19211    PSP_USBCAM_DELAY_10SEC = 1,
19212    PSP_USBCAM_DELAY_20SEC = 2,
19213    PSP_USBCAM_DELAY_30SEC = 3,
19214}
19215#[repr(u32)]
19216/// Usbcam framerates
19217#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
19218pub enum PspUsbCamFrameRate {
19219    PSP_USBCAM_FRAMERATE_3_75_FPS = 0,
19220    PSP_USBCAM_FRAMERATE_5_FPS = 1,
19221    PSP_USBCAM_FRAMERATE_7_5_FPS = 2,
19222    PSP_USBCAM_FRAMERATE_10_FPS = 3,
19223    PSP_USBCAM_FRAMERATE_15_FPS = 4,
19224    PSP_USBCAM_FRAMERATE_20_FPS = 5,
19225    PSP_USBCAM_FRAMERATE_30_FPS = 6,
19226    PSP_USBCAM_FRAMERATE_60_FPS = 7,
19227}
19228#[repr(u32)]
19229/// White balance values
19230#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
19231pub enum PspUsbCamWB {
19232    PSP_USBCAM_WB_AUTO = 0,
19233    PSP_USBCAM_WB_DAYLIGHT = 1,
19234    PSP_USBCAM_WB_FLUORESCENT = 2,
19235    PSP_USBCAM_WB_INCADESCENT = 3,
19236}
19237#[repr(u32)]
19238/// Effect modes
19239#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
19240pub enum PspUsbCamEffectMode {
19241    PSP_USBCAM_EFFECTMODE_NORMAL = 0,
19242    PSP_USBCAM_EFFECTMODE_NEGATIVE = 1,
19243    PSP_USBCAM_EFFECTMODE_BLACKWHITE = 2,
19244    PSP_USBCAM_EFFECTMODE_SEPIA = 3,
19245    PSP_USBCAM_EFFECTMODE_BLUE = 4,
19246    PSP_USBCAM_EFFECTMODE_RED = 5,
19247    PSP_USBCAM_EFFECTMODE_GREEN = 6,
19248}
19249#[repr(u32)]
19250/// Exposure levels
19251#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
19252pub enum PspUsbCamEVLevel {
19253    PSP_USBCAM_EVLEVEL_2_0_POSITIVE = 0,
19254    PSP_USBCAM_EVLEVEL_1_7_POSITIVE = 1,
19255    PSP_USBCAM_EVLEVEL_1_5_POSITIVE = 2,
19256    PSP_USBCAM_EVLEVEL_1_3_POSITIVE = 3,
19257    PSP_USBCAM_EVLEVEL_1_0_POSITIVE = 4,
19258    PSP_USBCAM_EVLEVEL_0_7_POSITIVE = 5,
19259    PSP_USBCAM_EVLEVEL_0_5_POSITIVE = 6,
19260    PSP_USBCAM_EVLEVEL_0_3_POSITIVE = 7,
19261    PSP_USBCAM_EVLEVEL_0_0 = 8,
19262    PSP_USBCAM_EVLEVEL_0_3_NEGATIVE = 9,
19263    PSP_USBCAM_EVLEVEL_0_5_NEGATIVE = 10,
19264    PSP_USBCAM_EVLEVEL_0_7_NEGATIVE = 11,
19265    PSP_USBCAM_EVLEVEL_1_0_NEGATIVE = 12,
19266    PSP_USBCAM_EVLEVEL_1_3_NEGATIVE = 13,
19267    PSP_USBCAM_EVLEVEL_1_5_NEGATIVE = 14,
19268    PSP_USBCAM_EVLEVEL_1_7_NEGATIVE = 15,
19269    PSP_USBCAM_EVLEVEL_2_0_NEGATIVE = 16,
19270}
19271/// Structure for sceUsbCamSetupStill
19272#[repr(C)]
19273#[derive(Debug, Copy)]
19274pub struct PspUsbCamSetupStillParam {
19275    /// Size of the ::PspUsbCamSetupStillParam structure
19276    pub size: libc::c_int,
19277    /// Resolution. One of ::PspUsbCamResolution
19278    pub resolution: libc::c_int,
19279    /// Size of the jpeg image
19280    pub jpegsize: libc::c_int,
19281    /// Reverse effect to apply. Zero or more of ::PspUsbCamReverseFlags
19282    pub reverseflags: libc::c_int,
19283    /// Delay to apply to take the picture. One of ::PspUsbCamDelay
19284    pub delay: libc::c_int,
19285    /// JPEG compression level, a value from 1-63.
19286    /// 1 -> less compression, better quality; 63 -> max compression, worse quality
19287    pub complevel: libc::c_int,
19288}
19289#[test]
19290fn bindgen_test_layout_PspUsbCamSetupStillParam() {
19291    assert_eq!(::core::mem::size_of::<PspUsbCamSetupStillParam>() , 24usize ,
19292               concat ! (
19293               "Size of: " , stringify ! ( PspUsbCamSetupStillParam ) ));
19294    assert_eq! (::core::mem::align_of::<PspUsbCamSetupStillParam>() , 4usize ,
19295                concat ! (
19296                "Alignment of " , stringify ! ( PspUsbCamSetupStillParam ) ));
19297    assert_eq! (unsafe {
19298                & ( * ( 0 as * const PspUsbCamSetupStillParam ) ) . size as *
19299                const _ as usize } , 0usize , concat ! (
19300                "Alignment of field: " , stringify ! (
19301                PspUsbCamSetupStillParam ) , "::" , stringify ! ( size ) ));
19302    assert_eq! (unsafe {
19303                & ( * ( 0 as * const PspUsbCamSetupStillParam ) ) . resolution
19304                as * const _ as usize } , 4usize , concat ! (
19305                "Alignment of field: " , stringify ! (
19306                PspUsbCamSetupStillParam ) , "::" , stringify ! ( resolution )
19307                ));
19308    assert_eq! (unsafe {
19309                & ( * ( 0 as * const PspUsbCamSetupStillParam ) ) . jpegsize
19310                as * const _ as usize } , 8usize , concat ! (
19311                "Alignment of field: " , stringify ! (
19312                PspUsbCamSetupStillParam ) , "::" , stringify ! ( jpegsize )
19313                ));
19314    assert_eq! (unsafe {
19315                & ( * ( 0 as * const PspUsbCamSetupStillParam ) ) .
19316                reverseflags as * const _ as usize } , 12usize , concat ! (
19317                "Alignment of field: " , stringify ! (
19318                PspUsbCamSetupStillParam ) , "::" , stringify ! ( reverseflags
19319                ) ));
19320    assert_eq! (unsafe {
19321                & ( * ( 0 as * const PspUsbCamSetupStillParam ) ) . delay as *
19322                const _ as usize } , 16usize , concat ! (
19323                "Alignment of field: " , stringify ! (
19324                PspUsbCamSetupStillParam ) , "::" , stringify ! ( delay ) ));
19325    assert_eq! (unsafe {
19326                & ( * ( 0 as * const PspUsbCamSetupStillParam ) ) . complevel
19327                as * const _ as usize } , 20usize , concat ! (
19328                "Alignment of field: " , stringify ! (
19329                PspUsbCamSetupStillParam ) , "::" , stringify ! ( complevel )
19330                ));
19331}
19332impl Clone for PspUsbCamSetupStillParam {
19333    fn clone(&self) -> Self { *self }
19334}
19335/// Structure for sceUsbCamSetupStillEx
19336#[repr(C)]
19337#[derive(Debug, Copy)]
19338pub struct PspUsbCamSetupStillExParam {
19339    /// Size of the ::PspUsbCamSetupStillExParam structure
19340    pub size: libc::c_int,
19341    /// Unknown, set it to 9 at the moment.
19342    pub unk: u32,
19343    /// Resolution. One of ::PspUsbCamResolutionEx
19344    pub resolution: libc::c_int,
19345    /// Size of the jpeg image
19346    pub jpegsize: libc::c_int,
19347    /// JPEG compression level, a value from 1-63.
19348    /// 1 -> less compression, better quality; 63 -> max compression, worse quality
19349    pub complevel: libc::c_int,
19350    /// Unknown, set it to 0 at the moment
19351    pub unk2: u32,
19352    /// Unknown, set it to 1 at the moment
19353    pub unk3: u32,
19354    /// Flag that indicates whether to flip the image
19355    pub flip: libc::c_int,
19356    /// Flag that indicates whether to mirror the image
19357    pub mirror: libc::c_int,
19358    /// Delay to apply to take the picture. One of ::PspUsbCamDelay
19359    pub delay: libc::c_int,
19360    /// Unknown, set it to 0 at the moment
19361    pub unk4: [u32; 5usize],
19362}
19363#[test]
19364fn bindgen_test_layout_PspUsbCamSetupStillExParam() {
19365    assert_eq!(::core::mem::size_of::<PspUsbCamSetupStillExParam>() , 60usize
19366               , concat ! (
19367               "Size of: " , stringify ! ( PspUsbCamSetupStillExParam ) ));
19368    assert_eq! (::core::mem::align_of::<PspUsbCamSetupStillExParam>() , 4usize
19369                , concat ! (
19370                "Alignment of " , stringify ! ( PspUsbCamSetupStillExParam )
19371                ));
19372    assert_eq! (unsafe {
19373                & ( * ( 0 as * const PspUsbCamSetupStillExParam ) ) . size as
19374                * const _ as usize } , 0usize , concat ! (
19375                "Alignment of field: " , stringify ! (
19376                PspUsbCamSetupStillExParam ) , "::" , stringify ! ( size ) ));
19377    assert_eq! (unsafe {
19378                & ( * ( 0 as * const PspUsbCamSetupStillExParam ) ) . unk as *
19379                const _ as usize } , 4usize , concat ! (
19380                "Alignment of field: " , stringify ! (
19381                PspUsbCamSetupStillExParam ) , "::" , stringify ! ( unk ) ));
19382    assert_eq! (unsafe {
19383                & ( * ( 0 as * const PspUsbCamSetupStillExParam ) ) .
19384                resolution as * const _ as usize } , 8usize , concat ! (
19385                "Alignment of field: " , stringify ! (
19386                PspUsbCamSetupStillExParam ) , "::" , stringify ! ( resolution
19387                ) ));
19388    assert_eq! (unsafe {
19389                & ( * ( 0 as * const PspUsbCamSetupStillExParam ) ) . jpegsize
19390                as * const _ as usize } , 12usize , concat ! (
19391                "Alignment of field: " , stringify ! (
19392                PspUsbCamSetupStillExParam ) , "::" , stringify ! ( jpegsize )
19393                ));
19394    assert_eq! (unsafe {
19395                & ( * ( 0 as * const PspUsbCamSetupStillExParam ) ) .
19396                complevel as * const _ as usize } , 16usize , concat ! (
19397                "Alignment of field: " , stringify ! (
19398                PspUsbCamSetupStillExParam ) , "::" , stringify ! ( complevel
19399                ) ));
19400    assert_eq! (unsafe {
19401                & ( * ( 0 as * const PspUsbCamSetupStillExParam ) ) . unk2 as
19402                * const _ as usize } , 20usize , concat ! (
19403                "Alignment of field: " , stringify ! (
19404                PspUsbCamSetupStillExParam ) , "::" , stringify ! ( unk2 ) ));
19405    assert_eq! (unsafe {
19406                & ( * ( 0 as * const PspUsbCamSetupStillExParam ) ) . unk3 as
19407                * const _ as usize } , 24usize , concat ! (
19408                "Alignment of field: " , stringify ! (
19409                PspUsbCamSetupStillExParam ) , "::" , stringify ! ( unk3 ) ));
19410    assert_eq! (unsafe {
19411                & ( * ( 0 as * const PspUsbCamSetupStillExParam ) ) . flip as
19412                * const _ as usize } , 28usize , concat ! (
19413                "Alignment of field: " , stringify ! (
19414                PspUsbCamSetupStillExParam ) , "::" , stringify ! ( flip ) ));
19415    assert_eq! (unsafe {
19416                & ( * ( 0 as * const PspUsbCamSetupStillExParam ) ) . mirror
19417                as * const _ as usize } , 32usize , concat ! (
19418                "Alignment of field: " , stringify ! (
19419                PspUsbCamSetupStillExParam ) , "::" , stringify ! ( mirror )
19420                ));
19421    assert_eq! (unsafe {
19422                & ( * ( 0 as * const PspUsbCamSetupStillExParam ) ) . delay as
19423                * const _ as usize } , 36usize , concat ! (
19424                "Alignment of field: " , stringify ! (
19425                PspUsbCamSetupStillExParam ) , "::" , stringify ! ( delay )
19426                ));
19427    assert_eq! (unsafe {
19428                & ( * ( 0 as * const PspUsbCamSetupStillExParam ) ) . unk4 as
19429                * const _ as usize } , 40usize , concat ! (
19430                "Alignment of field: " , stringify ! (
19431                PspUsbCamSetupStillExParam ) , "::" , stringify ! ( unk4 ) ));
19432}
19433impl Clone for PspUsbCamSetupStillExParam {
19434    fn clone(&self) -> Self { *self }
19435}
19436#[repr(C)]
19437#[derive(Debug, Copy)]
19438pub struct PspUsbCamSetupVideoParam {
19439    /// Size of the ::PspUsbCamSetupVideoParam structure
19440    pub size: libc::c_int,
19441    /// Resolution. One of ::PspUsbCamResolution
19442    pub resolution: libc::c_int,
19443    /// Framerate. One of ::PspUsbCamFrameRate
19444    pub framerate: libc::c_int,
19445    /// White balance. One of ::PspUsbCamWB
19446    pub wb: libc::c_int,
19447    /// Saturarion (0-255)
19448    pub saturation: libc::c_int,
19449    /// Brightness (0-255)
19450    pub brightness: libc::c_int,
19451    /// Contrast (0-255)
19452    pub contrast: libc::c_int,
19453    /// Sharpness (0-255)
19454    pub sharpness: libc::c_int,
19455    /// Effect mode. One of ::PspUsbCamEffectMode
19456    pub effectmode: libc::c_int,
19457    /// Size of jpeg video frame
19458    pub framesize: libc::c_int,
19459    /// Unknown. Set it to 0 at the moment.
19460    pub unk: u32,
19461    /// Exposure value. One of ::PspUsbCamEVLevel
19462    pub evlevel: libc::c_int,
19463}
19464#[test]
19465fn bindgen_test_layout_PspUsbCamSetupVideoParam() {
19466    assert_eq!(::core::mem::size_of::<PspUsbCamSetupVideoParam>() , 48usize ,
19467               concat ! (
19468               "Size of: " , stringify ! ( PspUsbCamSetupVideoParam ) ));
19469    assert_eq! (::core::mem::align_of::<PspUsbCamSetupVideoParam>() , 4usize ,
19470                concat ! (
19471                "Alignment of " , stringify ! ( PspUsbCamSetupVideoParam ) ));
19472    assert_eq! (unsafe {
19473                & ( * ( 0 as * const PspUsbCamSetupVideoParam ) ) . size as *
19474                const _ as usize } , 0usize , concat ! (
19475                "Alignment of field: " , stringify ! (
19476                PspUsbCamSetupVideoParam ) , "::" , stringify ! ( size ) ));
19477    assert_eq! (unsafe {
19478                & ( * ( 0 as * const PspUsbCamSetupVideoParam ) ) . resolution
19479                as * const _ as usize } , 4usize , concat ! (
19480                "Alignment of field: " , stringify ! (
19481                PspUsbCamSetupVideoParam ) , "::" , stringify ! ( resolution )
19482                ));
19483    assert_eq! (unsafe {
19484                & ( * ( 0 as * const PspUsbCamSetupVideoParam ) ) . framerate
19485                as * const _ as usize } , 8usize , concat ! (
19486                "Alignment of field: " , stringify ! (
19487                PspUsbCamSetupVideoParam ) , "::" , stringify ! ( framerate )
19488                ));
19489    assert_eq! (unsafe {
19490                & ( * ( 0 as * const PspUsbCamSetupVideoParam ) ) . wb as *
19491                const _ as usize } , 12usize , concat ! (
19492                "Alignment of field: " , stringify ! (
19493                PspUsbCamSetupVideoParam ) , "::" , stringify ! ( wb ) ));
19494    assert_eq! (unsafe {
19495                & ( * ( 0 as * const PspUsbCamSetupVideoParam ) ) . saturation
19496                as * const _ as usize } , 16usize , concat ! (
19497                "Alignment of field: " , stringify ! (
19498                PspUsbCamSetupVideoParam ) , "::" , stringify ! ( saturation )
19499                ));
19500    assert_eq! (unsafe {
19501                & ( * ( 0 as * const PspUsbCamSetupVideoParam ) ) . brightness
19502                as * const _ as usize } , 20usize , concat ! (
19503                "Alignment of field: " , stringify ! (
19504                PspUsbCamSetupVideoParam ) , "::" , stringify ! ( brightness )
19505                ));
19506    assert_eq! (unsafe {
19507                & ( * ( 0 as * const PspUsbCamSetupVideoParam ) ) . contrast
19508                as * const _ as usize } , 24usize , concat ! (
19509                "Alignment of field: " , stringify ! (
19510                PspUsbCamSetupVideoParam ) , "::" , stringify ! ( contrast )
19511                ));
19512    assert_eq! (unsafe {
19513                & ( * ( 0 as * const PspUsbCamSetupVideoParam ) ) . sharpness
19514                as * const _ as usize } , 28usize , concat ! (
19515                "Alignment of field: " , stringify ! (
19516                PspUsbCamSetupVideoParam ) , "::" , stringify ! ( sharpness )
19517                ));
19518    assert_eq! (unsafe {
19519                & ( * ( 0 as * const PspUsbCamSetupVideoParam ) ) . effectmode
19520                as * const _ as usize } , 32usize , concat ! (
19521                "Alignment of field: " , stringify ! (
19522                PspUsbCamSetupVideoParam ) , "::" , stringify ! ( effectmode )
19523                ));
19524    assert_eq! (unsafe {
19525                & ( * ( 0 as * const PspUsbCamSetupVideoParam ) ) . framesize
19526                as * const _ as usize } , 36usize , concat ! (
19527                "Alignment of field: " , stringify ! (
19528                PspUsbCamSetupVideoParam ) , "::" , stringify ! ( framesize )
19529                ));
19530    assert_eq! (unsafe {
19531                & ( * ( 0 as * const PspUsbCamSetupVideoParam ) ) . unk as *
19532                const _ as usize } , 40usize , concat ! (
19533                "Alignment of field: " , stringify ! (
19534                PspUsbCamSetupVideoParam ) , "::" , stringify ! ( unk ) ));
19535    assert_eq! (unsafe {
19536                & ( * ( 0 as * const PspUsbCamSetupVideoParam ) ) . evlevel as
19537                * const _ as usize } , 44usize , concat ! (
19538                "Alignment of field: " , stringify ! (
19539                PspUsbCamSetupVideoParam ) , "::" , stringify ! ( evlevel )
19540                ));
19541}
19542impl Clone for PspUsbCamSetupVideoParam {
19543    fn clone(&self) -> Self { *self }
19544}
19545#[repr(C)]
19546#[derive(Debug, Copy)]
19547pub struct PspUsbCamSetupVideoExParam {
19548    /// Size of the ::PspUsbCamSetupVideoParam structure
19549    pub size: libc::c_int,
19550    pub unk: u32,
19551    /// Resolution. One of ::PspUsbCamResolutionEx
19552    pub resolution: libc::c_int,
19553    /// Framerate. One of ::PspUsbCamFrameRate
19554    pub framerate: libc::c_int,
19555    /// Unknown. Set it to 2 at the moment
19556    pub unk2: u32,
19557    /// Unknown. Set it to 3 at the moment
19558    pub unk3: u32,
19559    /// White balance. One of ::PspUsbCamWB
19560    pub wb: libc::c_int,
19561    /// Saturarion (0-255)
19562    pub saturation: libc::c_int,
19563    /// Brightness (0-255)
19564    pub brightness: libc::c_int,
19565    /// Contrast (0-255)
19566    pub contrast: libc::c_int,
19567    /// Sharpness (0-255)
19568    pub sharpness: libc::c_int,
19569    /// Unknown. Set it to 0 at the moment
19570    pub unk4: u32,
19571    /// Unknown. Set it to 1 at the moment
19572    pub unk5: u32,
19573    /// Unknown. Set it to 0 at the moment
19574    pub unk6: [u32; 3usize],
19575    /// Effect mode. One of ::PspUsbCamEffectMode
19576    pub effectmode: libc::c_int,
19577    /// Unknown. Set it to 1 at the moment
19578    pub unk7: u32,
19579    /// Unknown. Set it to 10 at the moment
19580    pub unk8: u32,
19581    /// Unknown. Set it to 2 at the moment
19582    pub unk9: u32,
19583    /// Unknown. Set it to 500 at the moment
19584    pub unk10: u32,
19585    /// Unknown. Set it to 1000 at the moment
19586    pub unk11: u32,
19587    /// Size of jpeg video frame
19588    pub framesize: libc::c_int,
19589    /// Unknown. Set it to 0 at the moment
19590    pub unk12: u32,
19591    /// Exposure value. One of ::PspUsbCamEVLevel
19592    pub evlevel: libc::c_int,
19593}
19594#[test]
19595fn bindgen_test_layout_PspUsbCamSetupVideoExParam() {
19596    assert_eq!(::core::mem::size_of::<PspUsbCamSetupVideoExParam>() , 100usize
19597               , concat ! (
19598               "Size of: " , stringify ! ( PspUsbCamSetupVideoExParam ) ));
19599    assert_eq! (::core::mem::align_of::<PspUsbCamSetupVideoExParam>() , 4usize
19600                , concat ! (
19601                "Alignment of " , stringify ! ( PspUsbCamSetupVideoExParam )
19602                ));
19603    assert_eq! (unsafe {
19604                & ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) . size as
19605                * const _ as usize } , 0usize , concat ! (
19606                "Alignment of field: " , stringify ! (
19607                PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( size ) ));
19608    assert_eq! (unsafe {
19609                & ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) . unk as *
19610                const _ as usize } , 4usize , concat ! (
19611                "Alignment of field: " , stringify ! (
19612                PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( unk ) ));
19613    assert_eq! (unsafe {
19614                & ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) .
19615                resolution as * const _ as usize } , 8usize , concat ! (
19616                "Alignment of field: " , stringify ! (
19617                PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( resolution
19618                ) ));
19619    assert_eq! (unsafe {
19620                & ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) .
19621                framerate as * const _ as usize } , 12usize , concat ! (
19622                "Alignment of field: " , stringify ! (
19623                PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( framerate
19624                ) ));
19625    assert_eq! (unsafe {
19626                & ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) . unk2 as
19627                * const _ as usize } , 16usize , concat ! (
19628                "Alignment of field: " , stringify ! (
19629                PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( unk2 ) ));
19630    assert_eq! (unsafe {
19631                & ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) . unk3 as
19632                * const _ as usize } , 20usize , concat ! (
19633                "Alignment of field: " , stringify ! (
19634                PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( unk3 ) ));
19635    assert_eq! (unsafe {
19636                & ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) . wb as *
19637                const _ as usize } , 24usize , concat ! (
19638                "Alignment of field: " , stringify ! (
19639                PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( wb ) ));
19640    assert_eq! (unsafe {
19641                & ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) .
19642                saturation as * const _ as usize } , 28usize , concat ! (
19643                "Alignment of field: " , stringify ! (
19644                PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( saturation
19645                ) ));
19646    assert_eq! (unsafe {
19647                & ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) .
19648                brightness as * const _ as usize } , 32usize , concat ! (
19649                "Alignment of field: " , stringify ! (
19650                PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( brightness
19651                ) ));
19652    assert_eq! (unsafe {
19653                & ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) . contrast
19654                as * const _ as usize } , 36usize , concat ! (
19655                "Alignment of field: " , stringify ! (
19656                PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( contrast )
19657                ));
19658    assert_eq! (unsafe {
19659                & ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) .
19660                sharpness as * const _ as usize } , 40usize , concat ! (
19661                "Alignment of field: " , stringify ! (
19662                PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( sharpness
19663                ) ));
19664    assert_eq! (unsafe {
19665                & ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) . unk4 as
19666                * const _ as usize } , 44usize , concat ! (
19667                "Alignment of field: " , stringify ! (
19668                PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( unk4 ) ));
19669    assert_eq! (unsafe {
19670                & ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) . unk5 as
19671                * const _ as usize } , 48usize , concat ! (
19672                "Alignment of field: " , stringify ! (
19673                PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( unk5 ) ));
19674    assert_eq! (unsafe {
19675                & ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) . unk6 as
19676                * const _ as usize } , 52usize , concat ! (
19677                "Alignment of field: " , stringify ! (
19678                PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( unk6 ) ));
19679    assert_eq! (unsafe {
19680                & ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) .
19681                effectmode as * const _ as usize } , 64usize , concat ! (
19682                "Alignment of field: " , stringify ! (
19683                PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( effectmode
19684                ) ));
19685    assert_eq! (unsafe {
19686                & ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) . unk7 as
19687                * const _ as usize } , 68usize , concat ! (
19688                "Alignment of field: " , stringify ! (
19689                PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( unk7 ) ));
19690    assert_eq! (unsafe {
19691                & ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) . unk8 as
19692                * const _ as usize } , 72usize , concat ! (
19693                "Alignment of field: " , stringify ! (
19694                PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( unk8 ) ));
19695    assert_eq! (unsafe {
19696                & ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) . unk9 as
19697                * const _ as usize } , 76usize , concat ! (
19698                "Alignment of field: " , stringify ! (
19699                PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( unk9 ) ));
19700    assert_eq! (unsafe {
19701                & ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) . unk10 as
19702                * const _ as usize } , 80usize , concat ! (
19703                "Alignment of field: " , stringify ! (
19704                PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( unk10 )
19705                ));
19706    assert_eq! (unsafe {
19707                & ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) . unk11 as
19708                * const _ as usize } , 84usize , concat ! (
19709                "Alignment of field: " , stringify ! (
19710                PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( unk11 )
19711                ));
19712    assert_eq! (unsafe {
19713                & ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) .
19714                framesize as * const _ as usize } , 88usize , concat ! (
19715                "Alignment of field: " , stringify ! (
19716                PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( framesize
19717                ) ));
19718    assert_eq! (unsafe {
19719                & ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) . unk12 as
19720                * const _ as usize } , 92usize , concat ! (
19721                "Alignment of field: " , stringify ! (
19722                PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( unk12 )
19723                ));
19724    assert_eq! (unsafe {
19725                & ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) . evlevel
19726                as * const _ as usize } , 96usize , concat ! (
19727                "Alignment of field: " , stringify ! (
19728                PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( evlevel )
19729                ));
19730}
19731impl Clone for PspUsbCamSetupVideoExParam {
19732    fn clone(&self) -> Self { *self }
19733}
19734extern "C" {
19735    /// Setups the parameters to take a still image.
19736///
19737/// @param param - pointer to a ::PspUsbCamSetupStillParam
19738///
19739/// @return 0 on success, < 0 on error
19740    pub fn sceUsbCamSetupStill(param: *mut PspUsbCamSetupStillParam)
19741     -> libc::c_int;
19742}
19743extern "C" {
19744    /// Setups the parameters to take a still image (with more options)
19745///
19746/// @param param - pointer to a ::PspUsbCamSetupStillExParam
19747///
19748/// @return 0 on success, < 0 on error
19749    pub fn sceUsbCamSetupStillEx(param: *mut PspUsbCamSetupStillExParam)
19750     -> libc::c_int;
19751}
19752extern "C" {
19753    /// Gets a still image. The function doesn't return until the image
19754/// has been acquired.
19755///
19756/// @param buf - The buffer that receives the image jpeg data
19757/// @param size - The size of the buffer.
19758///
19759/// @return size of acquired image on success, < 0 on error
19760    pub fn sceUsbCamStillInputBlocking(buf: *mut u8, size: SceSize)
19761     -> libc::c_int;
19762}
19763extern "C" {
19764    /// Gets a still image. The function returns inmediately, and
19765/// the completion has to be handled by calling ::sceUsbCamStillWaitInputEnd
19766/// or ::sceUsbCamStillPollInputEnd.
19767///
19768/// @param buf - The buffer that receives the image jpeg data
19769/// @param size - The size of the buffer.
19770///
19771/// @return 0 on success, < 0 on error
19772    pub fn sceUsbCamStillInput(buf: *mut u8, size: SceSize) -> libc::c_int;
19773}
19774extern "C" {
19775    /// Waits untils still input has been finished.
19776///
19777/// @return the size of the acquired image on sucess, < 0 on error
19778    pub fn sceUsbCamStillWaitInputEnd() -> libc::c_int;
19779}
19780extern "C" {
19781    /// Polls the status of still input completion.
19782///
19783/// @return the size of the acquired image if still input has ended,
19784/// 0 if the input has not ended, < 0 on error.
19785    pub fn sceUsbCamStillPollInputEnd() -> libc::c_int;
19786}
19787extern "C" {
19788    /// Cancels the still input.
19789///
19790/// @return 0 on success, < 0 on error
19791    pub fn sceUsbCamStillCancelInput() -> libc::c_int;
19792}
19793extern "C" {
19794    /// Gets the size of the acquired still image.
19795///
19796/// @return the size of the acquired image on success, < 0 on error
19797    pub fn sceUsbCamStillGetInputLength() -> libc::c_int;
19798}
19799extern "C" {
19800    /// Set ups the parameters for video capture.
19801///
19802/// @param param - Pointer to a ::PspUsbCamSetupVideoParam structure.
19803/// @param workarea - Pointer to a buffer used as work area by the driver.
19804/// @param wasize - Size of the work area.
19805///
19806/// @return 0 on success, < 0 on error
19807    pub fn sceUsbCamSetupVideo(param: *mut PspUsbCamSetupVideoParam,
19808                               workarea: *mut libc::c_void,
19809                               wasize: libc::c_int) -> libc::c_int;
19810}
19811extern "C" {
19812    /// Set ups the parameters for video capture (with more options)
19813///
19814/// @param param - Pointer to a ::PspUsbCamSetupVideoExParam structure.
19815/// @param workarea - Pointer to a buffer used as work area by the driver.
19816/// @param wasize - Size of the work area.
19817///
19818/// @return 0 on success, < 0 on error
19819    pub fn sceUsbCamSetupVideoEx(param: *mut PspUsbCamSetupVideoExParam,
19820                                 workarea: *mut libc::c_void,
19821                                 wasize: libc::c_int) -> libc::c_int;
19822}
19823extern "C" {
19824    /// Starts video input from the camera.
19825///
19826/// @return 0 on success, < 0 on error
19827    pub fn sceUsbCamStartVideo() -> libc::c_int;
19828}
19829extern "C" {
19830    /// Stops video input from the camera.
19831///
19832/// @return 0 on success, < 0 on error
19833    pub fn sceUsbCamStopVideo() -> libc::c_int;
19834}
19835extern "C" {
19836    /// Reads a video frame. The function doesn't return until the frame
19837/// has been acquired.
19838///
19839/// @param buf - The buffer that receives the frame jpeg data
19840/// @param size - The size of the buffer.
19841///
19842/// @return size of acquired frame on success, < 0 on error
19843    pub fn sceUsbCamReadVideoFrameBlocking(buf: *mut u8, size: SceSize)
19844     -> libc::c_int;
19845}
19846extern "C" {
19847    /// Reads a video frame. The function returns inmediately, and
19848/// the completion has to be handled by calling ::sceUsbCamWaitReadVideoFrameEnd
19849/// or ::sceUsbCamPollReadVideoFrameEnd.
19850///
19851/// @param buf - The buffer that receives the frame jpeg data
19852/// @param size - The size of the buffer.
19853///
19854/// @return 0 on success, < 0 on error
19855    pub fn sceUsbCamReadVideoFrame(buf: *mut u8, size: SceSize)
19856     -> libc::c_int;
19857}
19858extern "C" {
19859    /// Waits untils the current frame has been read.
19860///
19861/// @return the size of the acquired frame on sucess, < 0 on error
19862    pub fn sceUsbCamWaitReadVideoFrameEnd() -> libc::c_int;
19863}
19864extern "C" {
19865    /// Polls the status of video frame read completion.
19866///
19867/// @return the size of the acquired frame if it has been read,
19868/// 0 if the frame has not yet been read, < 0 on error.
19869    pub fn sceUsbCamPollReadVideoFrameEnd() -> libc::c_int;
19870}
19871extern "C" {
19872    /// Gets the size of the acquired frame.
19873///
19874/// @return the size of the acquired frame on success, < 0 on error
19875    pub fn sceUsbCamGetReadVideoFrameSize() -> libc::c_int;
19876}
19877extern "C" {
19878    /// Sets the saturation
19879///
19880/// @param saturation - The saturation (0-255)
19881///
19882/// @return 0 on success, < 0 on error
19883    pub fn sceUsbCamSetSaturation(saturation: libc::c_int) -> libc::c_int;
19884}
19885extern "C" {
19886    /// Sets the brightness
19887///
19888/// @param brightness - The brightness (0-255)
19889///
19890/// @return 0 on success, < 0 on error
19891    pub fn sceUsbCamSetBrightness(brightness: libc::c_int) -> libc::c_int;
19892}
19893extern "C" {
19894    /// Sets the contrast
19895///
19896/// @param contrast - The contrast (0-255)
19897///
19898/// @return 0 on success, < 0 on error
19899    pub fn sceUsbCamSetContrast(contrast: libc::c_int) -> libc::c_int;
19900}
19901extern "C" {
19902    /// Sets the sharpness
19903///
19904/// @param sharpness - The sharpness (0-255)
19905///
19906/// @return 0 on success, < 0 on error
19907    pub fn sceUsbCamSetSharpness(sharpness: libc::c_int) -> libc::c_int;
19908}
19909extern "C" {
19910    /// Sets the image effect mode
19911///
19912/// @param effectmode - The effect mode, one of ::PspUsbCamEffectMode
19913///
19914/// @return 0 on success, < 0 on error
19915    pub fn sceUsbCamSetImageEffectMode(effectmode: libc::c_int)
19916     -> libc::c_int;
19917}
19918extern "C" {
19919    /// Sets the exposure level
19920///
19921/// @param ev - The exposure level, one of ::PspUsbCamEVLevel
19922///
19923/// @return 0 on success, < 0 on error
19924    pub fn sceUsbCamSetEvLevel(ev: libc::c_int) -> libc::c_int;
19925}
19926extern "C" {
19927    /// Sets the reverse mode
19928///
19929/// @param reverseflags - The reverse flags, zero or more of ::PspUsbCamReverseFlags
19930///
19931/// @return 0 on success, < 0 on error
19932    pub fn sceUsbCamSetReverseMode(reverseflags: libc::c_int) -> libc::c_int;
19933}
19934extern "C" {
19935    /// Sets the zoom.
19936///
19937/// @param zoom - The zoom level starting by 10. (10 = 1X, 11 = 1.1X, etc)
19938///
19939/// @returns 0 on success, < 0 on error
19940    pub fn sceUsbCamSetZoom(zoom: libc::c_int) -> libc::c_int;
19941}
19942extern "C" {
19943    /// Gets the current saturation
19944///
19945/// @param saturation - pointer to a variable that receives the current saturation
19946///
19947/// @return 0 on success, < 0 on error
19948    pub fn sceUsbCamGetSaturation(saturation: *mut libc::c_int)
19949     -> libc::c_int;
19950}
19951extern "C" {
19952    /// Gets the current brightness
19953///
19954/// @param brightness - pointer to a variable that receives the current brightness
19955///
19956/// @return 0 on success, < 0 on error
19957    pub fn sceUsbCamGetBrightness(brightness: *mut libc::c_int)
19958     -> libc::c_int;
19959}
19960extern "C" {
19961    /// Gets the current contrast
19962///
19963/// @param contrast - pointer to a variable that receives the current contrast
19964///
19965/// @return 0 on success, < 0 on error
19966    pub fn sceUsbCamGetContrast(contrast: *mut libc::c_int) -> libc::c_int;
19967}
19968extern "C" {
19969    /// Gets the current sharpness
19970///
19971/// @param sharpness - pointer to a variable that receives the current sharpness
19972///
19973/// @return 0 on success, < 0 on error
19974    pub fn sceUsbCamGetSharpness(sharpness: *mut libc::c_int) -> libc::c_int;
19975}
19976extern "C" {
19977    /// Gets the current image efect mode
19978///
19979/// @param effectmode - pointer to a variable that receives the current effect mode
19980///
19981/// @return 0 on success, < 0 on error
19982    pub fn sceUsbCamGetImageEffectMode(effectmode: *mut libc::c_int)
19983     -> libc::c_int;
19984}
19985extern "C" {
19986    /// Gets the current exposure level.
19987///
19988/// @param ev - pointer to a variable that receives the current exposure level
19989///
19990/// @return 0 on success, < 0 on error
19991    pub fn sceUsbCamGetEvLevel(ev: *mut libc::c_int) -> libc::c_int;
19992}
19993extern "C" {
19994    /// Gets the current reverse mode.
19995///
19996/// @param reverseflags - pointer to a variable that receives the current reverse mode flags
19997///
19998/// @return 0 on success, < 0 on error
19999    pub fn sceUsbCamGetReverseMode(reverseflags: *mut libc::c_int)
20000     -> libc::c_int;
20001}
20002extern "C" {
20003    /// Gets the current zoom.
20004///
20005/// @param zoom - pointer to a variable that receives the current zoom
20006///
20007/// @return 0 on success, < 0 on error
20008    pub fn sceUsbCamGetZoom(zoom: *mut libc::c_int) -> libc::c_int;
20009}
20010extern "C" {
20011    /// Sets if the image should be automatically reversed, depending of the position
20012/// of the camera.
20013///
20014/// @param on - 1 to set the automatical reversal of the image, 0 to set it off
20015///
20016/// @return 0 on success, < 0 on error
20017    pub fn sceUsbCamAutoImageReverseSW(on: libc::c_int) -> libc::c_int;
20018}
20019extern "C" {
20020    /// Gets the state of the autoreversal of the image.
20021///
20022/// @return 1 if it is set to automatic, 0 otherwise
20023    pub fn sceUsbCamGetAutoImageReverseState() -> libc::c_int;
20024}
20025extern "C" {
20026    /// Gets the direction of the camera lens
20027///
20028/// @return 1 if the camera is "looking to you", 0 if the camera
20029/// is "looking to the other side".
20030    pub fn sceUsbCamGetLensDirection() -> libc::c_int;
20031}
20032extern "C" {
20033    /// Start a USB driver.
20034///
20035/// @param driverName - name of the USB driver to start
20036/// @param size - Size of arguments to pass to USB driver start
20037/// @param args - Arguments to pass to USB driver start
20038///
20039/// @return 0 on success
20040    pub fn sceUsbStart(driverName: *const libc::c_char, size: libc::c_int,
20041                       args: *mut libc::c_void) -> libc::c_int;
20042}
20043extern "C" {
20044    /// Stop a USB driver.
20045///
20046/// @param driverName - name of the USB driver to stop
20047/// @param size - Size of arguments to pass to USB driver start
20048/// @param args - Arguments to pass to USB driver start
20049///
20050/// @return 0 on success
20051    pub fn sceUsbStop(driverName: *const libc::c_char, size: libc::c_int,
20052                      args: *mut libc::c_void) -> libc::c_int;
20053}
20054extern "C" {
20055    /// Activate a USB driver.
20056///
20057/// @param pid - Product ID for the default USB Driver
20058///
20059/// @return 0 on success
20060    pub fn sceUsbActivate(pid: u32) -> libc::c_int;
20061}
20062extern "C" {
20063    /// Deactivate USB driver.
20064///
20065/// @param pid - Product ID for the default USB driver
20066///
20067/// @return 0 on success
20068    pub fn sceUsbDeactivate(pid: u32) -> libc::c_int;
20069}
20070extern "C" {
20071    /// Get USB state
20072///
20073/// @return OR'd PSP_USB_* constants
20074    pub fn sceUsbGetState() -> libc::c_int;
20075}
20076extern "C" {
20077    /// Get state of a specific USB driver
20078///
20079/// @param driverName - name of USB driver to get status from
20080///
20081/// @return 1 if the driver has been started, 2 if it is stopped
20082    pub fn sceUsbGetDrvState(driverName: *const libc::c_char) -> libc::c_int;
20083}
20084extern "C" {
20085    /// Register an eventFlag to send notifications to.
20086///
20087/// @param eventFlag - eventFlag created with sceKernelCreateEventFlag
20088///
20089/// @return 0 on success
20090    pub fn sceUsbstorBootRegisterNotify(eventFlag: u32) -> libc::c_int;
20091}
20092extern "C" {
20093    /// Unregister a previously registered eventFlag.
20094///
20095/// @param eventFlag - eventFlag created with sceKernelCreateEventFlag
20096///
20097/// @return 0 on success
20098    pub fn sceUsbstorBootUnregisterNotify(eventFlag: u32) -> libc::c_int;
20099}
20100extern "C" {
20101    /// Tell the USBstorBoot driver the size of MS
20102///
20103/// @note I'm not sure if this is the actual size of the media or not
20104/// as it seems to have no bearing on what size windows detects.
20105/// PSPPET passes 0x800000
20106///
20107/// @param size - capacity of memory stick
20108///
20109/// @return 0 on success
20110    pub fn sceUsbstorBootSetCapacity(size: u32) -> libc::c_int;
20111}
20112#[repr(C)]
20113#[derive(Debug, Copy)]
20114pub struct pspUtilityDialogCommon {
20115    pub size: libc::c_uint,
20116    /// Size of the structure
20117    pub language: libc::c_int,
20118    /// Language
20119    pub buttonSwap: libc::c_int,
20120    /// Set to 1 for X/O button swap
20121    pub graphicsThread: libc::c_int,
20122    /// Graphics thread priority
20123    pub accessThread: libc::c_int,
20124    /// Access/fileio thread priority (SceJobThread)
20125    pub fontThread: libc::c_int,
20126    /// Font thread priority (ScePafThread)
20127    pub soundThread: libc::c_int,
20128    /// Sound thread priority
20129    pub result: libc::c_int,
20130    /// Result
20131    pub reserved: [libc::c_int; 4usize],
20132}
20133#[test]
20134fn bindgen_test_layout_pspUtilityDialogCommon() {
20135    assert_eq!(::core::mem::size_of::<pspUtilityDialogCommon>() , 48usize ,
20136               concat ! ( "Size of: " , stringify ! ( pspUtilityDialogCommon )
20137               ));
20138    assert_eq! (::core::mem::align_of::<pspUtilityDialogCommon>() , 4usize ,
20139                concat ! (
20140                "Alignment of " , stringify ! ( pspUtilityDialogCommon ) ));
20141    assert_eq! (unsafe {
20142                & ( * ( 0 as * const pspUtilityDialogCommon ) ) . size as *
20143                const _ as usize } , 0usize , concat ! (
20144                "Alignment of field: " , stringify ! ( pspUtilityDialogCommon
20145                ) , "::" , stringify ! ( size ) ));
20146    assert_eq! (unsafe {
20147                & ( * ( 0 as * const pspUtilityDialogCommon ) ) . language as
20148                * const _ as usize } , 4usize , concat ! (
20149                "Alignment of field: " , stringify ! ( pspUtilityDialogCommon
20150                ) , "::" , stringify ! ( language ) ));
20151    assert_eq! (unsafe {
20152                & ( * ( 0 as * const pspUtilityDialogCommon ) ) . buttonSwap
20153                as * const _ as usize } , 8usize , concat ! (
20154                "Alignment of field: " , stringify ! ( pspUtilityDialogCommon
20155                ) , "::" , stringify ! ( buttonSwap ) ));
20156    assert_eq! (unsafe {
20157                & ( * ( 0 as * const pspUtilityDialogCommon ) ) .
20158                graphicsThread as * const _ as usize } , 12usize , concat ! (
20159                "Alignment of field: " , stringify ! ( pspUtilityDialogCommon
20160                ) , "::" , stringify ! ( graphicsThread ) ));
20161    assert_eq! (unsafe {
20162                & ( * ( 0 as * const pspUtilityDialogCommon ) ) . accessThread
20163                as * const _ as usize } , 16usize , concat ! (
20164                "Alignment of field: " , stringify ! ( pspUtilityDialogCommon
20165                ) , "::" , stringify ! ( accessThread ) ));
20166    assert_eq! (unsafe {
20167                & ( * ( 0 as * const pspUtilityDialogCommon ) ) . fontThread
20168                as * const _ as usize } , 20usize , concat ! (
20169                "Alignment of field: " , stringify ! ( pspUtilityDialogCommon
20170                ) , "::" , stringify ! ( fontThread ) ));
20171    assert_eq! (unsafe {
20172                & ( * ( 0 as * const pspUtilityDialogCommon ) ) . soundThread
20173                as * const _ as usize } , 24usize , concat ! (
20174                "Alignment of field: " , stringify ! ( pspUtilityDialogCommon
20175                ) , "::" , stringify ! ( soundThread ) ));
20176    assert_eq! (unsafe {
20177                & ( * ( 0 as * const pspUtilityDialogCommon ) ) . result as *
20178                const _ as usize } , 28usize , concat ! (
20179                "Alignment of field: " , stringify ! ( pspUtilityDialogCommon
20180                ) , "::" , stringify ! ( result ) ));
20181    assert_eq! (unsafe {
20182                & ( * ( 0 as * const pspUtilityDialogCommon ) ) . reserved as
20183                * const _ as usize } , 32usize , concat ! (
20184                "Alignment of field: " , stringify ! ( pspUtilityDialogCommon
20185                ) , "::" , stringify ! ( reserved ) ));
20186}
20187impl Clone for pspUtilityDialogCommon {
20188    fn clone(&self) -> Self { *self }
20189}
20190#[repr(u32)]
20191#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
20192pub enum pspUtilityMsgDialogMode {
20193    PSP_UTILITY_MSGDIALOG_MODE_ERROR = 0,
20194    PSP_UTILITY_MSGDIALOG_MODE_TEXT = 1,
20195}
20196#[repr(u32)]
20197#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
20198pub enum pspUtilityMsgDialogOption {
20199    PSP_UTILITY_MSGDIALOG_OPTION_ERROR = 0,
20200    PSP_UTILITY_MSGDIALOG_OPTION_TEXT = 1,
20201    PSP_UTILITY_MSGDIALOG_OPTION_YESNO_BUTTONS = 16,
20202    PSP_UTILITY_MSGDIALOG_OPTION_DEFAULT_NO = 256,
20203}
20204#[repr(u32)]
20205#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
20206pub enum pspUtilityMsgDialogPressed {
20207    PSP_UTILITY_MSGDIALOG_RESULT_UNKNOWN1 = 0,
20208    PSP_UTILITY_MSGDIALOG_RESULT_YES = 1,
20209    PSP_UTILITY_MSGDIALOG_RESULT_NO = 2,
20210    PSP_UTILITY_MSGDIALOG_RESULT_BACK = 3,
20211}
20212/// Structure to hold the parameters for a message dialog
20213#[repr(C)]
20214#[derive(Copy)]
20215pub struct _pspUtilityMsgDialogParams {
20216    pub base: pspUtilityDialogCommon,
20217    pub unknown: libc::c_int,
20218    pub mode: pspUtilityMsgDialogMode,
20219    pub errorValue: libc::c_uint,
20220    /// The message to display (may contain embedded linefeeds)
20221    pub message: [libc::c_char; 512usize],
20222    pub options: libc::c_int,
20223    pub buttonPressed: pspUtilityMsgDialogPressed,
20224}
20225#[test]
20226fn bindgen_test_layout__pspUtilityMsgDialogParams() {
20227    assert_eq!(::core::mem::size_of::<_pspUtilityMsgDialogParams>() , 580usize
20228               , concat ! (
20229               "Size of: " , stringify ! ( _pspUtilityMsgDialogParams ) ));
20230    assert_eq! (::core::mem::align_of::<_pspUtilityMsgDialogParams>() , 4usize
20231                , concat ! (
20232                "Alignment of " , stringify ! ( _pspUtilityMsgDialogParams )
20233                ));
20234    assert_eq! (unsafe {
20235                & ( * ( 0 as * const _pspUtilityMsgDialogParams ) ) . base as
20236                * const _ as usize } , 0usize , concat ! (
20237                "Alignment of field: " , stringify ! (
20238                _pspUtilityMsgDialogParams ) , "::" , stringify ! ( base ) ));
20239    assert_eq! (unsafe {
20240                & ( * ( 0 as * const _pspUtilityMsgDialogParams ) ) . unknown
20241                as * const _ as usize } , 48usize , concat ! (
20242                "Alignment of field: " , stringify ! (
20243                _pspUtilityMsgDialogParams ) , "::" , stringify ! ( unknown )
20244                ));
20245    assert_eq! (unsafe {
20246                & ( * ( 0 as * const _pspUtilityMsgDialogParams ) ) . mode as
20247                * const _ as usize } , 52usize , concat ! (
20248                "Alignment of field: " , stringify ! (
20249                _pspUtilityMsgDialogParams ) , "::" , stringify ! ( mode ) ));
20250    assert_eq! (unsafe {
20251                & ( * ( 0 as * const _pspUtilityMsgDialogParams ) ) .
20252                errorValue as * const _ as usize } , 56usize , concat ! (
20253                "Alignment of field: " , stringify ! (
20254                _pspUtilityMsgDialogParams ) , "::" , stringify ! ( errorValue
20255                ) ));
20256    assert_eq! (unsafe {
20257                & ( * ( 0 as * const _pspUtilityMsgDialogParams ) ) . message
20258                as * const _ as usize } , 60usize , concat ! (
20259                "Alignment of field: " , stringify ! (
20260                _pspUtilityMsgDialogParams ) , "::" , stringify ! ( message )
20261                ));
20262    assert_eq! (unsafe {
20263                & ( * ( 0 as * const _pspUtilityMsgDialogParams ) ) . options
20264                as * const _ as usize } , 572usize , concat ! (
20265                "Alignment of field: " , stringify ! (
20266                _pspUtilityMsgDialogParams ) , "::" , stringify ! ( options )
20267                ));
20268    assert_eq! (unsafe {
20269                & ( * ( 0 as * const _pspUtilityMsgDialogParams ) ) .
20270                buttonPressed as * const _ as usize } , 576usize , concat ! (
20271                "Alignment of field: " , stringify ! (
20272                _pspUtilityMsgDialogParams ) , "::" , stringify ! (
20273                buttonPressed ) ));
20274}
20275impl Clone for _pspUtilityMsgDialogParams {
20276    fn clone(&self) -> Self { *self }
20277}
20278/// Structure to hold the parameters for a message dialog
20279pub type pspUtilityMsgDialogParams = _pspUtilityMsgDialogParams;
20280extern "C" {
20281    /// Create a message dialog
20282///
20283/// @param params - dialog parameters
20284/// @return 0 on success
20285    pub fn sceUtilityMsgDialogInitStart(params:
20286                                            *mut pspUtilityMsgDialogParams)
20287     -> libc::c_int;
20288}
20289extern "C" {
20290    /// Remove a message dialog currently active.  After calling this
20291/// function you need to keep calling GetStatus and Update until
20292/// you get a status of 4.
20293    pub fn sceUtilityMsgDialogShutdownStart();
20294}
20295extern "C" {
20296    /// Get the current status of a message dialog currently active.
20297///
20298/// @return 2 if the GUI is visible (you need to call sceUtilityMsgDialogGetStatus).
20299/// 3 if the user cancelled the dialog, and you need to call sceUtilityMsgDialogShutdownStart.
20300/// 4 if the dialog has been successfully shut down.
20301    pub fn sceUtilityMsgDialogGetStatus() -> libc::c_int;
20302}
20303extern "C" {
20304    /// Refresh the GUI for a message dialog currently active
20305///
20306/// @param n - unknown, pass 1
20307    pub fn sceUtilityMsgDialogUpdate(n: libc::c_int);
20308}
20309extern "C" {
20310    /// Abort a message dialog currently active
20311    pub fn sceUtilityMsgDialogAbort() -> libc::c_int;
20312}
20313#[repr(u32)]
20314#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
20315pub enum pspUtilityNetconfActions {
20316    PSP_NETCONF_ACTION_CONNECTAP = 0,
20317    PSP_NETCONF_ACTION_DISPLAYSTATUS = 1,
20318    PSP_NETCONF_ACTION_CONNECT_ADHOC = 2,
20319}
20320#[repr(C)]
20321#[derive(Debug, Copy)]
20322pub struct pspUtilityNetconfAdhoc {
20323    pub name: [libc::c_uchar; 8usize],
20324    pub timeout: libc::c_uint,
20325}
20326#[test]
20327fn bindgen_test_layout_pspUtilityNetconfAdhoc() {
20328    assert_eq!(::core::mem::size_of::<pspUtilityNetconfAdhoc>() , 12usize ,
20329               concat ! ( "Size of: " , stringify ! ( pspUtilityNetconfAdhoc )
20330               ));
20331    assert_eq! (::core::mem::align_of::<pspUtilityNetconfAdhoc>() , 4usize ,
20332                concat ! (
20333                "Alignment of " , stringify ! ( pspUtilityNetconfAdhoc ) ));
20334    assert_eq! (unsafe {
20335                & ( * ( 0 as * const pspUtilityNetconfAdhoc ) ) . name as *
20336                const _ as usize } , 0usize , concat ! (
20337                "Alignment of field: " , stringify ! ( pspUtilityNetconfAdhoc
20338                ) , "::" , stringify ! ( name ) ));
20339    assert_eq! (unsafe {
20340                & ( * ( 0 as * const pspUtilityNetconfAdhoc ) ) . timeout as *
20341                const _ as usize } , 8usize , concat ! (
20342                "Alignment of field: " , stringify ! ( pspUtilityNetconfAdhoc
20343                ) , "::" , stringify ! ( timeout ) ));
20344}
20345impl Clone for pspUtilityNetconfAdhoc {
20346    fn clone(&self) -> Self { *self }
20347}
20348#[repr(C)]
20349#[derive(Debug, Copy)]
20350pub struct _pspUtilityNetconfData {
20351    pub base: pspUtilityDialogCommon,
20352    pub action: libc::c_int,
20353    /// One of pspUtilityNetconfActions
20354    pub adhocparam: *mut pspUtilityNetconfAdhoc,
20355    pub hotspot: libc::c_int,
20356    /// Set to 1 to allow connections with the 'Internet Browser' option set to 'Start' (ie. hotspot connection)
20357    pub hotspot_connected: libc::c_int,
20358    /// Will be set to 1 when connected to a hotspot style connection
20359    pub wifisp: libc::c_int,
20360}
20361#[test]
20362fn bindgen_test_layout__pspUtilityNetconfData() {
20363    assert_eq!(::core::mem::size_of::<_pspUtilityNetconfData>() , 80usize ,
20364               concat ! ( "Size of: " , stringify ! ( _pspUtilityNetconfData )
20365               ));
20366    assert_eq! (::core::mem::align_of::<_pspUtilityNetconfData>() , 8usize ,
20367                concat ! (
20368                "Alignment of " , stringify ! ( _pspUtilityNetconfData ) ));
20369    assert_eq! (unsafe {
20370                & ( * ( 0 as * const _pspUtilityNetconfData ) ) . base as *
20371                const _ as usize } , 0usize , concat ! (
20372                "Alignment of field: " , stringify ! ( _pspUtilityNetconfData
20373                ) , "::" , stringify ! ( base ) ));
20374    assert_eq! (unsafe {
20375                & ( * ( 0 as * const _pspUtilityNetconfData ) ) . action as *
20376                const _ as usize } , 48usize , concat ! (
20377                "Alignment of field: " , stringify ! ( _pspUtilityNetconfData
20378                ) , "::" , stringify ! ( action ) ));
20379    assert_eq! (unsafe {
20380                & ( * ( 0 as * const _pspUtilityNetconfData ) ) . adhocparam
20381                as * const _ as usize } , 56usize , concat ! (
20382                "Alignment of field: " , stringify ! ( _pspUtilityNetconfData
20383                ) , "::" , stringify ! ( adhocparam ) ));
20384    assert_eq! (unsafe {
20385                & ( * ( 0 as * const _pspUtilityNetconfData ) ) . hotspot as *
20386                const _ as usize } , 64usize , concat ! (
20387                "Alignment of field: " , stringify ! ( _pspUtilityNetconfData
20388                ) , "::" , stringify ! ( hotspot ) ));
20389    assert_eq! (unsafe {
20390                & ( * ( 0 as * const _pspUtilityNetconfData ) ) .
20391                hotspot_connected as * const _ as usize } , 68usize , concat !
20392                (
20393                "Alignment of field: " , stringify ! ( _pspUtilityNetconfData
20394                ) , "::" , stringify ! ( hotspot_connected ) ));
20395    assert_eq! (unsafe {
20396                & ( * ( 0 as * const _pspUtilityNetconfData ) ) . wifisp as *
20397                const _ as usize } , 72usize , concat ! (
20398                "Alignment of field: " , stringify ! ( _pspUtilityNetconfData
20399                ) , "::" , stringify ! ( wifisp ) ));
20400}
20401impl Clone for _pspUtilityNetconfData {
20402    fn clone(&self) -> Self { *self }
20403}
20404pub type pspUtilityNetconfData = _pspUtilityNetconfData;
20405extern "C" {
20406    /// Init the Network Configuration Dialog Utility
20407///
20408/// @param data - pointer to pspUtilityNetconfData to be initialized
20409/// @return 0 on success, < 0 on error
20410    pub fn sceUtilityNetconfInitStart(data: *mut pspUtilityNetconfData)
20411     -> libc::c_int;
20412}
20413extern "C" {
20414    /// Shutdown the Network Configuration Dialog Utility
20415///
20416/// @return 0 on success, < 0 on error
20417    pub fn sceUtilityNetconfShutdownStart() -> libc::c_int;
20418}
20419extern "C" {
20420    /// Update the Network Configuration Dialog GUI
20421///
20422/// @param unknown - unknown; set to 1
20423/// @return 0 on success, < 0 on error
20424    pub fn sceUtilityNetconfUpdate(unknown: libc::c_int) -> libc::c_int;
20425}
20426extern "C" {
20427    /// Get the status of a running Network Configuration Dialog
20428///
20429/// @return one of pspUtilityDialogState on success, < 0 on error
20430    pub fn sceUtilityNetconfGetStatus() -> libc::c_int;
20431}
20432/// Datatype for sceUtilityGetNetParam
20433/// since it can return a u32 or a string
20434/// we use a union to avoid ugly casting
20435#[repr(C)]
20436#[derive(Copy)]
20437pub union netData {
20438    pub asUint: u32,
20439    pub asString: [libc::c_char; 128usize],
20440    _bindgen_union_align: [u32; 32usize],
20441}
20442#[test]
20443fn bindgen_test_layout_netData() {
20444    assert_eq!(::core::mem::size_of::<netData>() , 128usize , concat ! (
20445               "Size of: " , stringify ! ( netData ) ));
20446    assert_eq! (::core::mem::align_of::<netData>() , 4usize , concat ! (
20447                "Alignment of " , stringify ! ( netData ) ));
20448    assert_eq! (unsafe {
20449                & ( * ( 0 as * const netData ) ) . asUint as * const _ as
20450                usize } , 0usize , concat ! (
20451                "Alignment of field: " , stringify ! ( netData ) , "::" ,
20452                stringify ! ( asUint ) ));
20453    assert_eq! (unsafe {
20454                & ( * ( 0 as * const netData ) ) . asString as * const _ as
20455                usize } , 0usize , concat ! (
20456                "Alignment of field: " , stringify ! ( netData ) , "::" ,
20457                stringify ! ( asString ) ));
20458}
20459impl Clone for netData {
20460    fn clone(&self) -> Self { *self }
20461}
20462extern "C" {
20463    /// Check existance of a Net Configuration
20464///
20465/// @param id - id of net Configuration (1 to n)
20466/// @return 0 on success,
20467    pub fn sceUtilityCheckNetParam(id: libc::c_int) -> libc::c_int;
20468}
20469extern "C" {
20470    /// Get Net Configuration Parameter
20471///
20472/// @param conf - Net Configuration number (1 to n)
20473/// (0 returns valid but seems to be a copy of the last config requested)
20474/// @param param - which parameter to get
20475/// @param data - parameter data
20476/// @return 0 on success,
20477    pub fn sceUtilityGetNetParam(conf: libc::c_int, param: libc::c_int,
20478                                 data: *mut netData) -> libc::c_int;
20479}
20480extern "C" {
20481    /// Create a new Network Configuration
20482/// @note This creates a new configuration at conf and clears 0
20483///
20484/// @param conf - Net Configuration number (1 to n)
20485///
20486/// @return 0 on success
20487    pub fn sceUtilityCreateNetParam(conf: libc::c_int) -> libc::c_int;
20488}
20489extern "C" {
20490    /// Sets a network parameter
20491/// @note This sets only to configuration 0
20492///
20493/// @param param - Which parameter to set
20494/// @param val - Pointer to the the data to set
20495///
20496/// @return 0 on success
20497    pub fn sceUtilitySetNetParam(param: libc::c_int, val: *const libc::c_void)
20498     -> libc::c_int;
20499}
20500extern "C" {
20501    /// Copies a Network Configuration to another
20502///
20503/// @param src - Source Net Configuration number (0 to n)
20504/// @param dest - Destination Net Configuration number (0 to n)
20505///
20506/// @return 0 on success
20507    pub fn sceUtilityCopyNetParam(src: libc::c_int, dest: libc::c_int)
20508     -> libc::c_int;
20509}
20510extern "C" {
20511    /// Deletes a Network Configuration
20512///
20513/// @param conf - Net Configuration number (1 to n)
20514///
20515/// @return 0 on success
20516    pub fn sceUtilityDeleteNetParam(conf: libc::c_int) -> libc::c_int;
20517}
20518#[repr(u32)]
20519/// Save data utility modes
20520#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
20521pub enum PspUtilitySavedataMode {
20522    PSP_UTILITY_SAVEDATA_AUTOLOAD = 0,
20523    PSP_UTILITY_SAVEDATA_AUTOSAVE = 1,
20524    PSP_UTILITY_SAVEDATA_LOAD = 2,
20525    PSP_UTILITY_SAVEDATA_SAVE = 3,
20526    PSP_UTILITY_SAVEDATA_LISTLOAD = 4,
20527    PSP_UTILITY_SAVEDATA_LISTSAVE = 5,
20528    PSP_UTILITY_SAVEDATA_LISTDELETE = 6,
20529    PSP_UTILITY_SAVEDATADELETE = 7,
20530}
20531#[repr(u32)]
20532/// Initial focus position for list selection types
20533#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
20534pub enum PspUtilitySavedataFocus {
20535    PSP_UTILITY_SAVEDATA_FOCUS_UNKNOWN = 0,
20536    PSP_UTILITY_SAVEDATA_FOCUS_FIRSTLIST = 1,
20537    PSP_UTILITY_SAVEDATA_FOCUS_LASTLIST = 2,
20538    PSP_UTILITY_SAVEDATA_FOCUS_LATEST = 3,
20539    PSP_UTILITY_SAVEDATA_FOCUS_OLDEST = 4,
20540    PSP_UTILITY_SAVEDATA_FOCUS_UNKNOWN2 = 5,
20541    PSP_UTILITY_SAVEDATA_FOCUS_UNKNOWN3 = 6,
20542    PSP_UTILITY_SAVEDATA_FOCUS_FIRSTEMPTY = 7,
20543    PSP_UTILITY_SAVEDATA_FOCUS_LASTEMPTY = 8,
20544}
20545/// title, savedataTitle, detail: parts of the unencrypted SFO
20546/// data, it contains what the VSH and standard load screen shows
20547#[repr(C)]
20548#[derive(Copy)]
20549pub struct PspUtilitySavedataSFOParam {
20550    pub title: [libc::c_char; 128usize],
20551    pub savedataTitle: [libc::c_char; 128usize],
20552    pub detail: [libc::c_char; 1024usize],
20553    pub parentalLevel: libc::c_uchar,
20554    pub unknown: [libc::c_uchar; 3usize],
20555}
20556#[test]
20557fn bindgen_test_layout_PspUtilitySavedataSFOParam() {
20558    assert_eq!(::core::mem::size_of::<PspUtilitySavedataSFOParam>() ,
20559               1284usize , concat ! (
20560               "Size of: " , stringify ! ( PspUtilitySavedataSFOParam ) ));
20561    assert_eq! (::core::mem::align_of::<PspUtilitySavedataSFOParam>() , 1usize
20562                , concat ! (
20563                "Alignment of " , stringify ! ( PspUtilitySavedataSFOParam )
20564                ));
20565    assert_eq! (unsafe {
20566                & ( * ( 0 as * const PspUtilitySavedataSFOParam ) ) . title as
20567                * const _ as usize } , 0usize , concat ! (
20568                "Alignment of field: " , stringify ! (
20569                PspUtilitySavedataSFOParam ) , "::" , stringify ! ( title )
20570                ));
20571    assert_eq! (unsafe {
20572                & ( * ( 0 as * const PspUtilitySavedataSFOParam ) ) .
20573                savedataTitle as * const _ as usize } , 128usize , concat ! (
20574                "Alignment of field: " , stringify ! (
20575                PspUtilitySavedataSFOParam ) , "::" , stringify ! (
20576                savedataTitle ) ));
20577    assert_eq! (unsafe {
20578                & ( * ( 0 as * const PspUtilitySavedataSFOParam ) ) . detail
20579                as * const _ as usize } , 256usize , concat ! (
20580                "Alignment of field: " , stringify ! (
20581                PspUtilitySavedataSFOParam ) , "::" , stringify ! ( detail )
20582                ));
20583    assert_eq! (unsafe {
20584                & ( * ( 0 as * const PspUtilitySavedataSFOParam ) ) .
20585                parentalLevel as * const _ as usize } , 1280usize , concat ! (
20586                "Alignment of field: " , stringify ! (
20587                PspUtilitySavedataSFOParam ) , "::" , stringify ! (
20588                parentalLevel ) ));
20589    assert_eq! (unsafe {
20590                & ( * ( 0 as * const PspUtilitySavedataSFOParam ) ) . unknown
20591                as * const _ as usize } , 1281usize , concat ! (
20592                "Alignment of field: " , stringify ! (
20593                PspUtilitySavedataSFOParam ) , "::" , stringify ! ( unknown )
20594                ));
20595}
20596impl Clone for PspUtilitySavedataSFOParam {
20597    fn clone(&self) -> Self { *self }
20598}
20599#[repr(C)]
20600#[derive(Debug, Copy)]
20601pub struct PspUtilitySavedataFileData {
20602    pub buf: *mut libc::c_void,
20603    pub bufSize: SceSize,
20604    pub size: SceSize,
20605    pub unknown: libc::c_int,
20606}
20607#[test]
20608fn bindgen_test_layout_PspUtilitySavedataFileData() {
20609    assert_eq!(::core::mem::size_of::<PspUtilitySavedataFileData>() , 24usize
20610               , concat ! (
20611               "Size of: " , stringify ! ( PspUtilitySavedataFileData ) ));
20612    assert_eq! (::core::mem::align_of::<PspUtilitySavedataFileData>() , 8usize
20613                , concat ! (
20614                "Alignment of " , stringify ! ( PspUtilitySavedataFileData )
20615                ));
20616    assert_eq! (unsafe {
20617                & ( * ( 0 as * const PspUtilitySavedataFileData ) ) . buf as *
20618                const _ as usize } , 0usize , concat ! (
20619                "Alignment of field: " , stringify ! (
20620                PspUtilitySavedataFileData ) , "::" , stringify ! ( buf ) ));
20621    assert_eq! (unsafe {
20622                & ( * ( 0 as * const PspUtilitySavedataFileData ) ) . bufSize
20623                as * const _ as usize } , 8usize , concat ! (
20624                "Alignment of field: " , stringify ! (
20625                PspUtilitySavedataFileData ) , "::" , stringify ! ( bufSize )
20626                ));
20627    assert_eq! (unsafe {
20628                & ( * ( 0 as * const PspUtilitySavedataFileData ) ) . size as
20629                * const _ as usize } , 12usize , concat ! (
20630                "Alignment of field: " , stringify ! (
20631                PspUtilitySavedataFileData ) , "::" , stringify ! ( size ) ));
20632    assert_eq! (unsafe {
20633                & ( * ( 0 as * const PspUtilitySavedataFileData ) ) . unknown
20634                as * const _ as usize } , 16usize , concat ! (
20635                "Alignment of field: " , stringify ! (
20636                PspUtilitySavedataFileData ) , "::" , stringify ! ( unknown )
20637                ));
20638}
20639impl Clone for PspUtilitySavedataFileData {
20640    fn clone(&self) -> Self { *self }
20641}
20642#[repr(C)]
20643#[derive(Debug, Copy)]
20644pub struct PspUtilitySavedataListSaveNewData {
20645    pub icon0: PspUtilitySavedataFileData,
20646    pub title: *mut libc::c_char,
20647}
20648#[test]
20649fn bindgen_test_layout_PspUtilitySavedataListSaveNewData() {
20650    assert_eq!(::core::mem::size_of::<PspUtilitySavedataListSaveNewData>() ,
20651               32usize , concat ! (
20652               "Size of: " , stringify ! ( PspUtilitySavedataListSaveNewData )
20653               ));
20654    assert_eq! (::core::mem::align_of::<PspUtilitySavedataListSaveNewData>() ,
20655                8usize , concat ! (
20656                "Alignment of " , stringify ! (
20657                PspUtilitySavedataListSaveNewData ) ));
20658    assert_eq! (unsafe {
20659                & ( * ( 0 as * const PspUtilitySavedataListSaveNewData ) ) .
20660                icon0 as * const _ as usize } , 0usize , concat ! (
20661                "Alignment of field: " , stringify ! (
20662                PspUtilitySavedataListSaveNewData ) , "::" , stringify ! (
20663                icon0 ) ));
20664    assert_eq! (unsafe {
20665                & ( * ( 0 as * const PspUtilitySavedataListSaveNewData ) ) .
20666                title as * const _ as usize } , 24usize , concat ! (
20667                "Alignment of field: " , stringify ! (
20668                PspUtilitySavedataListSaveNewData ) , "::" , stringify ! (
20669                title ) ));
20670}
20671impl Clone for PspUtilitySavedataListSaveNewData {
20672    fn clone(&self) -> Self { *self }
20673}
20674/// Structure to hold the parameters for the ::sceUtilitySavedataInitStart function.
20675#[repr(C)]
20676#[derive(Copy)]
20677pub struct SceUtilitySavedataParam {
20678    pub base: pspUtilityDialogCommon,
20679    pub mode: PspUtilitySavedataMode,
20680    pub unknown1: libc::c_int,
20681    pub overwrite: libc::c_int,
20682    /// gameName: name used from the game for saves, equal for all saves
20683    pub gameName: [libc::c_char; 13usize],
20684    pub reserved: [libc::c_char; 3usize],
20685    /// saveName: name of the particular save, normally a number
20686    pub saveName: [libc::c_char; 20usize],
20687    /// saveNameList: used by multiple modes
20688    pub saveNameList: *mut [libc::c_char; 20usize],
20689    /// fileName: name of the data file of the game for example DATA.BIN
20690    pub fileName: [libc::c_char; 13usize],
20691    pub reserved1: [libc::c_char; 3usize],
20692    /// pointer to a buffer that will contain data file unencrypted data
20693    pub dataBuf: *mut libc::c_void,
20694    /// size of allocated space to dataBuf
20695    pub dataBufSize: SceSize,
20696    pub dataSize: SceSize,
20697    pub sfoParam: PspUtilitySavedataSFOParam,
20698    pub icon0FileData: PspUtilitySavedataFileData,
20699    pub icon1FileData: PspUtilitySavedataFileData,
20700    pub pic1FileData: PspUtilitySavedataFileData,
20701    pub snd0FileData: PspUtilitySavedataFileData,
20702    /// Pointer to an PspUtilitySavedataListSaveNewData structure
20703    pub newData: *mut PspUtilitySavedataListSaveNewData,
20704    /// Initial focus for lists
20705    pub focus: PspUtilitySavedataFocus,
20706    /// unknown2: ?
20707    pub unknown2: [libc::c_int; 4usize],
20708}
20709#[test]
20710fn bindgen_test_layout_SceUtilitySavedataParam() {
20711    assert_eq!(::core::mem::size_of::<SceUtilitySavedataParam>() , 1552usize ,
20712               concat ! (
20713               "Size of: " , stringify ! ( SceUtilitySavedataParam ) ));
20714    assert_eq! (::core::mem::align_of::<SceUtilitySavedataParam>() , 8usize ,
20715                concat ! (
20716                "Alignment of " , stringify ! ( SceUtilitySavedataParam ) ));
20717    assert_eq! (unsafe {
20718                & ( * ( 0 as * const SceUtilitySavedataParam ) ) . base as *
20719                const _ as usize } , 0usize , concat ! (
20720                "Alignment of field: " , stringify ! ( SceUtilitySavedataParam
20721                ) , "::" , stringify ! ( base ) ));
20722    assert_eq! (unsafe {
20723                & ( * ( 0 as * const SceUtilitySavedataParam ) ) . mode as *
20724                const _ as usize } , 48usize , concat ! (
20725                "Alignment of field: " , stringify ! ( SceUtilitySavedataParam
20726                ) , "::" , stringify ! ( mode ) ));
20727    assert_eq! (unsafe {
20728                & ( * ( 0 as * const SceUtilitySavedataParam ) ) . unknown1 as
20729                * const _ as usize } , 52usize , concat ! (
20730                "Alignment of field: " , stringify ! ( SceUtilitySavedataParam
20731                ) , "::" , stringify ! ( unknown1 ) ));
20732    assert_eq! (unsafe {
20733                & ( * ( 0 as * const SceUtilitySavedataParam ) ) . overwrite
20734                as * const _ as usize } , 56usize , concat ! (
20735                "Alignment of field: " , stringify ! ( SceUtilitySavedataParam
20736                ) , "::" , stringify ! ( overwrite ) ));
20737    assert_eq! (unsafe {
20738                & ( * ( 0 as * const SceUtilitySavedataParam ) ) . gameName as
20739                * const _ as usize } , 60usize , concat ! (
20740                "Alignment of field: " , stringify ! ( SceUtilitySavedataParam
20741                ) , "::" , stringify ! ( gameName ) ));
20742    assert_eq! (unsafe {
20743                & ( * ( 0 as * const SceUtilitySavedataParam ) ) . reserved as
20744                * const _ as usize } , 73usize , concat ! (
20745                "Alignment of field: " , stringify ! ( SceUtilitySavedataParam
20746                ) , "::" , stringify ! ( reserved ) ));
20747    assert_eq! (unsafe {
20748                & ( * ( 0 as * const SceUtilitySavedataParam ) ) . saveName as
20749                * const _ as usize } , 76usize , concat ! (
20750                "Alignment of field: " , stringify ! ( SceUtilitySavedataParam
20751                ) , "::" , stringify ! ( saveName ) ));
20752    assert_eq! (unsafe {
20753                & ( * ( 0 as * const SceUtilitySavedataParam ) ) .
20754                saveNameList as * const _ as usize } , 96usize , concat ! (
20755                "Alignment of field: " , stringify ! ( SceUtilitySavedataParam
20756                ) , "::" , stringify ! ( saveNameList ) ));
20757    assert_eq! (unsafe {
20758                & ( * ( 0 as * const SceUtilitySavedataParam ) ) . fileName as
20759                * const _ as usize } , 104usize , concat ! (
20760                "Alignment of field: " , stringify ! ( SceUtilitySavedataParam
20761                ) , "::" , stringify ! ( fileName ) ));
20762    assert_eq! (unsafe {
20763                & ( * ( 0 as * const SceUtilitySavedataParam ) ) . reserved1
20764                as * const _ as usize } , 117usize , concat ! (
20765                "Alignment of field: " , stringify ! ( SceUtilitySavedataParam
20766                ) , "::" , stringify ! ( reserved1 ) ));
20767    assert_eq! (unsafe {
20768                & ( * ( 0 as * const SceUtilitySavedataParam ) ) . dataBuf as
20769                * const _ as usize } , 120usize , concat ! (
20770                "Alignment of field: " , stringify ! ( SceUtilitySavedataParam
20771                ) , "::" , stringify ! ( dataBuf ) ));
20772    assert_eq! (unsafe {
20773                & ( * ( 0 as * const SceUtilitySavedataParam ) ) . dataBufSize
20774                as * const _ as usize } , 128usize , concat ! (
20775                "Alignment of field: " , stringify ! ( SceUtilitySavedataParam
20776                ) , "::" , stringify ! ( dataBufSize ) ));
20777    assert_eq! (unsafe {
20778                & ( * ( 0 as * const SceUtilitySavedataParam ) ) . dataSize as
20779                * const _ as usize } , 132usize , concat ! (
20780                "Alignment of field: " , stringify ! ( SceUtilitySavedataParam
20781                ) , "::" , stringify ! ( dataSize ) ));
20782    assert_eq! (unsafe {
20783                & ( * ( 0 as * const SceUtilitySavedataParam ) ) . sfoParam as
20784                * const _ as usize } , 136usize , concat ! (
20785                "Alignment of field: " , stringify ! ( SceUtilitySavedataParam
20786                ) , "::" , stringify ! ( sfoParam ) ));
20787    assert_eq! (unsafe {
20788                & ( * ( 0 as * const SceUtilitySavedataParam ) ) .
20789                icon0FileData as * const _ as usize } , 1424usize , concat ! (
20790                "Alignment of field: " , stringify ! ( SceUtilitySavedataParam
20791                ) , "::" , stringify ! ( icon0FileData ) ));
20792    assert_eq! (unsafe {
20793                & ( * ( 0 as * const SceUtilitySavedataParam ) ) .
20794                icon1FileData as * const _ as usize } , 1448usize , concat ! (
20795                "Alignment of field: " , stringify ! ( SceUtilitySavedataParam
20796                ) , "::" , stringify ! ( icon1FileData ) ));
20797    assert_eq! (unsafe {
20798                & ( * ( 0 as * const SceUtilitySavedataParam ) ) .
20799                pic1FileData as * const _ as usize } , 1472usize , concat ! (
20800                "Alignment of field: " , stringify ! ( SceUtilitySavedataParam
20801                ) , "::" , stringify ! ( pic1FileData ) ));
20802    assert_eq! (unsafe {
20803                & ( * ( 0 as * const SceUtilitySavedataParam ) ) .
20804                snd0FileData as * const _ as usize } , 1496usize , concat ! (
20805                "Alignment of field: " , stringify ! ( SceUtilitySavedataParam
20806                ) , "::" , stringify ! ( snd0FileData ) ));
20807    assert_eq! (unsafe {
20808                & ( * ( 0 as * const SceUtilitySavedataParam ) ) . newData as
20809                * const _ as usize } , 1520usize , concat ! (
20810                "Alignment of field: " , stringify ! ( SceUtilitySavedataParam
20811                ) , "::" , stringify ! ( newData ) ));
20812    assert_eq! (unsafe {
20813                & ( * ( 0 as * const SceUtilitySavedataParam ) ) . focus as *
20814                const _ as usize } , 1528usize , concat ! (
20815                "Alignment of field: " , stringify ! ( SceUtilitySavedataParam
20816                ) , "::" , stringify ! ( focus ) ));
20817    assert_eq! (unsafe {
20818                & ( * ( 0 as * const SceUtilitySavedataParam ) ) . unknown2 as
20819                * const _ as usize } , 1532usize , concat ! (
20820                "Alignment of field: " , stringify ! ( SceUtilitySavedataParam
20821                ) , "::" , stringify ! ( unknown2 ) ));
20822}
20823impl Clone for SceUtilitySavedataParam {
20824    fn clone(&self) -> Self { *self }
20825}
20826extern "C" {
20827    /// Saves or Load savedata to/from the passed structure
20828/// After having called this continue calling sceUtilitySavedataGetStatus to
20829/// check if the operation is completed
20830///
20831/// @param params - savedata parameters
20832/// @return 0 on success
20833    pub fn sceUtilitySavedataInitStart(params: *mut SceUtilitySavedataParam)
20834     -> libc::c_int;
20835}
20836extern "C" {
20837    /// Check the current status of the saving/loading/shutdown process
20838/// Continue calling this to check current status of the process
20839/// before calling this call also sceUtilitySavedataUpdate
20840/// @return 2 if the process is still being processed.
20841/// 3 on save/load success, then you can call sceUtilitySavedataShutdownStart.
20842/// 4 on complete shutdown.
20843    pub fn sceUtilitySavedataGetStatus() -> libc::c_int;
20844}
20845extern "C" {
20846    /// Shutdown the savedata utility. after calling this continue calling
20847/// ::sceUtilitySavedataGetStatus to check when it has shutdown
20848///
20849/// @return 0 on success
20850///
20851    pub fn sceUtilitySavedataShutdownStart() -> libc::c_int;
20852}
20853extern "C" {
20854    /// Refresh status of the savedata function
20855///
20856/// @param unknown - unknown, pass 1
20857    pub fn sceUtilitySavedataUpdate(unknown: libc::c_int);
20858}
20859#[repr(u32)]
20860#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
20861pub enum pspUtilityGameSharingMode {
20862    PSP_UTILITY_GAMESHARING_MODE_SINGLE = 1,
20863    PSP_UTILITY_GAMESHARING_MODE_MULTIPLE = 2,
20864}
20865#[repr(u32)]
20866#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
20867pub enum pspUtilityGameSharingDataType {
20868    PSP_UTILITY_GAMESHARING_DATA_TYPE_FILE = 1,
20869    PSP_UTILITY_GAMESHARING_DATA_TYPE_MEMORY = 2,
20870}
20871/// Structure to hold the parameters for Game Sharing
20872#[repr(C)]
20873#[derive(Debug, Copy)]
20874pub struct _pspUtilityGameSharingParams {
20875    pub base: pspUtilityDialogCommon,
20876    pub unknown1: libc::c_int,
20877    pub unknown2: libc::c_int,
20878    pub name: [libc::c_char; 8usize],
20879    pub unknown3: libc::c_int,
20880    pub unknown4: libc::c_int,
20881    pub unknown5: libc::c_int,
20882    pub result: libc::c_int,
20883    pub filepath: *mut libc::c_char,
20884    pub mode: pspUtilityGameSharingMode,
20885    pub datatype: pspUtilityGameSharingDataType,
20886    pub data: *mut libc::c_void,
20887    pub datasize: libc::c_uint,
20888}
20889#[test]
20890fn bindgen_test_layout__pspUtilityGameSharingParams() {
20891    assert_eq!(::core::mem::size_of::<_pspUtilityGameSharingParams>() ,
20892               112usize , concat ! (
20893               "Size of: " , stringify ! ( _pspUtilityGameSharingParams ) ));
20894    assert_eq! (::core::mem::align_of::<_pspUtilityGameSharingParams>() ,
20895                8usize , concat ! (
20896                "Alignment of " , stringify ! ( _pspUtilityGameSharingParams )
20897                ));
20898    assert_eq! (unsafe {
20899                & ( * ( 0 as * const _pspUtilityGameSharingParams ) ) . base
20900                as * const _ as usize } , 0usize , concat ! (
20901                "Alignment of field: " , stringify ! (
20902                _pspUtilityGameSharingParams ) , "::" , stringify ! ( base )
20903                ));
20904    assert_eq! (unsafe {
20905                & ( * ( 0 as * const _pspUtilityGameSharingParams ) ) .
20906                unknown1 as * const _ as usize } , 48usize , concat ! (
20907                "Alignment of field: " , stringify ! (
20908                _pspUtilityGameSharingParams ) , "::" , stringify ! ( unknown1
20909                ) ));
20910    assert_eq! (unsafe {
20911                & ( * ( 0 as * const _pspUtilityGameSharingParams ) ) .
20912                unknown2 as * const _ as usize } , 52usize , concat ! (
20913                "Alignment of field: " , stringify ! (
20914                _pspUtilityGameSharingParams ) , "::" , stringify ! ( unknown2
20915                ) ));
20916    assert_eq! (unsafe {
20917                & ( * ( 0 as * const _pspUtilityGameSharingParams ) ) . name
20918                as * const _ as usize } , 56usize , concat ! (
20919                "Alignment of field: " , stringify ! (
20920                _pspUtilityGameSharingParams ) , "::" , stringify ! ( name )
20921                ));
20922    assert_eq! (unsafe {
20923                & ( * ( 0 as * const _pspUtilityGameSharingParams ) ) .
20924                unknown3 as * const _ as usize } , 64usize , concat ! (
20925                "Alignment of field: " , stringify ! (
20926                _pspUtilityGameSharingParams ) , "::" , stringify ! ( unknown3
20927                ) ));
20928    assert_eq! (unsafe {
20929                & ( * ( 0 as * const _pspUtilityGameSharingParams ) ) .
20930                unknown4 as * const _ as usize } , 68usize , concat ! (
20931                "Alignment of field: " , stringify ! (
20932                _pspUtilityGameSharingParams ) , "::" , stringify ! ( unknown4
20933                ) ));
20934    assert_eq! (unsafe {
20935                & ( * ( 0 as * const _pspUtilityGameSharingParams ) ) .
20936                unknown5 as * const _ as usize } , 72usize , concat ! (
20937                "Alignment of field: " , stringify ! (
20938                _pspUtilityGameSharingParams ) , "::" , stringify ! ( unknown5
20939                ) ));
20940    assert_eq! (unsafe {
20941                & ( * ( 0 as * const _pspUtilityGameSharingParams ) ) . result
20942                as * const _ as usize } , 76usize , concat ! (
20943                "Alignment of field: " , stringify ! (
20944                _pspUtilityGameSharingParams ) , "::" , stringify ! ( result )
20945                ));
20946    assert_eq! (unsafe {
20947                & ( * ( 0 as * const _pspUtilityGameSharingParams ) ) .
20948                filepath as * const _ as usize } , 80usize , concat ! (
20949                "Alignment of field: " , stringify ! (
20950                _pspUtilityGameSharingParams ) , "::" , stringify ! ( filepath
20951                ) ));
20952    assert_eq! (unsafe {
20953                & ( * ( 0 as * const _pspUtilityGameSharingParams ) ) . mode
20954                as * const _ as usize } , 88usize , concat ! (
20955                "Alignment of field: " , stringify ! (
20956                _pspUtilityGameSharingParams ) , "::" , stringify ! ( mode )
20957                ));
20958    assert_eq! (unsafe {
20959                & ( * ( 0 as * const _pspUtilityGameSharingParams ) ) .
20960                datatype as * const _ as usize } , 92usize , concat ! (
20961                "Alignment of field: " , stringify ! (
20962                _pspUtilityGameSharingParams ) , "::" , stringify ! ( datatype
20963                ) ));
20964    assert_eq! (unsafe {
20965                & ( * ( 0 as * const _pspUtilityGameSharingParams ) ) . data
20966                as * const _ as usize } , 96usize , concat ! (
20967                "Alignment of field: " , stringify ! (
20968                _pspUtilityGameSharingParams ) , "::" , stringify ! ( data )
20969                ));
20970    assert_eq! (unsafe {
20971                & ( * ( 0 as * const _pspUtilityGameSharingParams ) ) .
20972                datasize as * const _ as usize } , 104usize , concat ! (
20973                "Alignment of field: " , stringify ! (
20974                _pspUtilityGameSharingParams ) , "::" , stringify ! ( datasize
20975                ) ));
20976}
20977impl Clone for _pspUtilityGameSharingParams {
20978    fn clone(&self) -> Self { *self }
20979}
20980/// Structure to hold the parameters for Game Sharing
20981pub type pspUtilityGameSharingParams = _pspUtilityGameSharingParams;
20982extern "C" {
20983    /// Init the game sharing
20984///
20985/// @param params - game sharing parameters
20986/// @return 0 on success, < 0 on error.
20987    pub fn sceUtilityGameSharingInitStart(params:
20988                                              *mut pspUtilityGameSharingParams)
20989     -> libc::c_int;
20990}
20991extern "C" {
20992    /// Shutdown game sharing.
20993    pub fn sceUtilityGameSharingShutdownStart();
20994}
20995extern "C" {
20996    /// Get the current status of game sharing.
20997///
20998/// @return 2 if the GUI is visible (you need to call sceUtilityGameSharingGetStatus).
20999/// 3 if the user cancelled the dialog, and you need to call sceUtilityGameSharingShutdownStart.
21000/// 4 if the dialog has been successfully shut down.
21001    pub fn sceUtilityGameSharingGetStatus() -> libc::c_int;
21002}
21003extern "C" {
21004    /// Refresh the GUI for game sharing
21005///
21006/// @param n - unknown, pass 1
21007    pub fn sceUtilityGameSharingUpdate(n: libc::c_int);
21008}
21009#[repr(u32)]
21010#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
21011pub enum pspUtilityHtmlViewerDisconnectModes {
21012    PSP_UTILITY_HTMLVIEWER_DISCONNECTMODE_ENABLE = 0,
21013    PSP_UTILITY_HTMLVIEWER_DISCONNECTMODE_DISABLE = 1,
21014    PSP_UTILITY_HTMLVIEWER_DISCONNECTMODE_CONFIRM = 2,
21015}
21016#[repr(u32)]
21017#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
21018pub enum pspUtilityHtmlViewerInterfaceModes {
21019    PSP_UTILITY_HTMLVIEWER_INTERFACEMODE_FULL = 0,
21020    PSP_UTILITY_HTMLVIEWER_INTERFACEMODE_LIMITED = 1,
21021    PSP_UTILITY_HTMLVIEWER_INTERFACEMODE_NONE = 2,
21022}
21023#[repr(u32)]
21024#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
21025pub enum pspUtilityHtmlViewerCookieModes {
21026    PSP_UTILITY_HTMLVIEWER_COOKIEMODE_DISABLED = 0,
21027    PSP_UTILITY_HTMLVIEWER_COOKIEMODE_ENABLED = 1,
21028    PSP_UTILITY_HTMLVIEWER_COOKIEMODE_CONFIRM = 2,
21029    PSP_UTILITY_HTMLVIEWER_COOKIEMODE_DEFAULT = 3,
21030}
21031#[repr(u32)]
21032#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
21033pub enum pspUtilityHtmlViewerTextSizes {
21034    PSP_UTILITY_HTMLVIEWER_TEXTSIZE_LARGE = 0,
21035    PSP_UTILITY_HTMLVIEWER_TEXTSIZE_NORMAL = 1,
21036    PSP_UTILITY_HTMLVIEWER_TEXTSIZE_SMALL = 2,
21037}
21038#[repr(u32)]
21039#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
21040pub enum pspUtilityHtmlViewerDisplayModes {
21041    PSP_UTILITY_HTMLVIEWER_DISPLAYMODE_NORMAL = 0,
21042    PSP_UTILITY_HTMLVIEWER_DISPLAYMODE_FIT = 1,
21043    PSP_UTILITY_HTMLVIEWER_DISPLAYMODE_SMART_FIT = 2,
21044}
21045#[repr(u32)]
21046#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
21047pub enum pspUtilityHtmlViewerConnectModes {
21048    PSP_UTILITY_HTMLVIEWER_CONNECTMODE_LAST = 0,
21049    PSP_UTILITY_HTMLVIEWER_CONNECTMODE_MANUAL_ONCE = 1,
21050    PSP_UTILITY_HTMLVIEWER_CONNECTMODE_MANUAL_ALL = 2,
21051}
21052#[repr(u32)]
21053#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
21054pub enum pspUtilityHtmlViewerOptions {
21055    PSP_UTILITY_HTMLVIEWER_OPEN_SCE_START_PAGE = 1,
21056    PSP_UTILITY_HTMLVIEWER_DISABLE_STARTUP_LIMITS = 2,
21057    PSP_UTILITY_HTMLVIEWER_DISABLE_EXIT_DIALOG = 4,
21058    PSP_UTILITY_HTMLVIEWER_DISABLE_CURSOR = 8,
21059    PSP_UTILITY_HTMLVIEWER_DISABLE_DOWNLOAD_COMPLETE_DIALOG = 16,
21060    PSP_UTILITY_HTMLVIEWER_DISABLE_DOWNLOAD_START_DIALOG = 32,
21061    PSP_UTILITY_HTMLVIEWER_DISABLE_DOWNLOAD_DESTINATION_DIALOG = 64,
21062    PSP_UTILITY_HTMLVIEWER_LOCK_DOWNLOAD_DESTINATION_DIALOG = 128,
21063    PSP_UTILITY_HTMLVIEWER_DISABLE_TAB_DISPLAY = 256,
21064    PSP_UTILITY_HTMLVIEWER_ENABLE_ANALOG_HOLD = 512,
21065    PSP_UTILITY_HTMLVIEWER_ENABLE_FLASH = 1024,
21066    PSP_UTILITY_HTMLVIEWER_DISABLE_LRTRIGGER = 2048,
21067}
21068#[repr(C)]
21069#[derive(Debug, Copy)]
21070pub struct pspUtilityHtmlViewerParam {
21071    pub base: pspUtilityDialogCommon,
21072    /// Pointer to the memory pool to be used
21073    pub memaddr: *mut libc::c_void,
21074    /// Size of the memory pool
21075    pub memsize: libc::c_uint,
21076    /// Unknown. Pass 0
21077    pub unknown1: libc::c_int,
21078    /// Unknown. Pass 0
21079    pub unknown2: libc::c_int,
21080    /// URL to be opened initially
21081    pub initialurl: *mut libc::c_char,
21082    /// Number of tabs (maximum of 3)
21083    pub numtabs: libc::c_uint,
21084    /// One of ::pspUtilityHtmlViewerInterfaceModes
21085    pub interfacemode: libc::c_uint,
21086    /// Values from ::pspUtilityHtmlViewerOptions. Bitwise OR together
21087    pub options: libc::c_uint,
21088    /// Directory to be used for downloading
21089    pub dldirname: *mut libc::c_char,
21090    /// Filename to be used for downloading
21091    pub dlfilename: *mut libc::c_char,
21092    /// Directory to be used for uploading
21093    pub uldirname: *mut libc::c_char,
21094    /// Filename to be used for uploading
21095    pub ulfilename: *mut libc::c_char,
21096    /// One of ::pspUtilityHtmlViewerCookieModes
21097    pub cookiemode: libc::c_uint,
21098    /// Unknown. Pass 0
21099    pub unknown3: libc::c_uint,
21100    /// URL to set the home page to
21101    pub homeurl: *mut libc::c_char,
21102    /// One of ::pspUtilityHtmlViewerTextSizes
21103    pub textsize: libc::c_uint,
21104    /// One of ::pspUtilityHtmlViewerDisplayModes
21105    pub displaymode: libc::c_uint,
21106    /// One of ::pspUtilityHtmlViewerConnectModes
21107    pub connectmode: libc::c_uint,
21108    /// One of ::pspUtilityHtmlViewerDisconnectModes
21109    pub disconnectmode: libc::c_uint,
21110    /// The maximum amount of memory the browser used
21111    pub memused: libc::c_uint,
21112    /// Unknown. Pass 0
21113    pub unknown4: [libc::c_int; 10usize],
21114}
21115#[test]
21116fn bindgen_test_layout_pspUtilityHtmlViewerParam() {
21117    assert_eq!(::core::mem::size_of::<pspUtilityHtmlViewerParam>() , 208usize
21118               , concat ! (
21119               "Size of: " , stringify ! ( pspUtilityHtmlViewerParam ) ));
21120    assert_eq! (::core::mem::align_of::<pspUtilityHtmlViewerParam>() , 8usize
21121                , concat ! (
21122                "Alignment of " , stringify ! ( pspUtilityHtmlViewerParam )
21123                ));
21124    assert_eq! (unsafe {
21125                & ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) . base as *
21126                const _ as usize } , 0usize , concat ! (
21127                "Alignment of field: " , stringify ! (
21128                pspUtilityHtmlViewerParam ) , "::" , stringify ! ( base ) ));
21129    assert_eq! (unsafe {
21130                & ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) . memaddr
21131                as * const _ as usize } , 48usize , concat ! (
21132                "Alignment of field: " , stringify ! (
21133                pspUtilityHtmlViewerParam ) , "::" , stringify ! ( memaddr )
21134                ));
21135    assert_eq! (unsafe {
21136                & ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) . memsize
21137                as * const _ as usize } , 56usize , concat ! (
21138                "Alignment of field: " , stringify ! (
21139                pspUtilityHtmlViewerParam ) , "::" , stringify ! ( memsize )
21140                ));
21141    assert_eq! (unsafe {
21142                & ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) . unknown1
21143                as * const _ as usize } , 60usize , concat ! (
21144                "Alignment of field: " , stringify ! (
21145                pspUtilityHtmlViewerParam ) , "::" , stringify ! ( unknown1 )
21146                ));
21147    assert_eq! (unsafe {
21148                & ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) . unknown2
21149                as * const _ as usize } , 64usize , concat ! (
21150                "Alignment of field: " , stringify ! (
21151                pspUtilityHtmlViewerParam ) , "::" , stringify ! ( unknown2 )
21152                ));
21153    assert_eq! (unsafe {
21154                & ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) .
21155                initialurl as * const _ as usize } , 72usize , concat ! (
21156                "Alignment of field: " , stringify ! (
21157                pspUtilityHtmlViewerParam ) , "::" , stringify ! ( initialurl
21158                ) ));
21159    assert_eq! (unsafe {
21160                & ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) . numtabs
21161                as * const _ as usize } , 80usize , concat ! (
21162                "Alignment of field: " , stringify ! (
21163                pspUtilityHtmlViewerParam ) , "::" , stringify ! ( numtabs )
21164                ));
21165    assert_eq! (unsafe {
21166                & ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) .
21167                interfacemode as * const _ as usize } , 84usize , concat ! (
21168                "Alignment of field: " , stringify ! (
21169                pspUtilityHtmlViewerParam ) , "::" , stringify ! (
21170                interfacemode ) ));
21171    assert_eq! (unsafe {
21172                & ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) . options
21173                as * const _ as usize } , 88usize , concat ! (
21174                "Alignment of field: " , stringify ! (
21175                pspUtilityHtmlViewerParam ) , "::" , stringify ! ( options )
21176                ));
21177    assert_eq! (unsafe {
21178                & ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) . dldirname
21179                as * const _ as usize } , 96usize , concat ! (
21180                "Alignment of field: " , stringify ! (
21181                pspUtilityHtmlViewerParam ) , "::" , stringify ! ( dldirname )
21182                ));
21183    assert_eq! (unsafe {
21184                & ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) .
21185                dlfilename as * const _ as usize } , 104usize , concat ! (
21186                "Alignment of field: " , stringify ! (
21187                pspUtilityHtmlViewerParam ) , "::" , stringify ! ( dlfilename
21188                ) ));
21189    assert_eq! (unsafe {
21190                & ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) . uldirname
21191                as * const _ as usize } , 112usize , concat ! (
21192                "Alignment of field: " , stringify ! (
21193                pspUtilityHtmlViewerParam ) , "::" , stringify ! ( uldirname )
21194                ));
21195    assert_eq! (unsafe {
21196                & ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) .
21197                ulfilename as * const _ as usize } , 120usize , concat ! (
21198                "Alignment of field: " , stringify ! (
21199                pspUtilityHtmlViewerParam ) , "::" , stringify ! ( ulfilename
21200                ) ));
21201    assert_eq! (unsafe {
21202                & ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) .
21203                cookiemode as * const _ as usize } , 128usize , concat ! (
21204                "Alignment of field: " , stringify ! (
21205                pspUtilityHtmlViewerParam ) , "::" , stringify ! ( cookiemode
21206                ) ));
21207    assert_eq! (unsafe {
21208                & ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) . unknown3
21209                as * const _ as usize } , 132usize , concat ! (
21210                "Alignment of field: " , stringify ! (
21211                pspUtilityHtmlViewerParam ) , "::" , stringify ! ( unknown3 )
21212                ));
21213    assert_eq! (unsafe {
21214                & ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) . homeurl
21215                as * const _ as usize } , 136usize , concat ! (
21216                "Alignment of field: " , stringify ! (
21217                pspUtilityHtmlViewerParam ) , "::" , stringify ! ( homeurl )
21218                ));
21219    assert_eq! (unsafe {
21220                & ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) . textsize
21221                as * const _ as usize } , 144usize , concat ! (
21222                "Alignment of field: " , stringify ! (
21223                pspUtilityHtmlViewerParam ) , "::" , stringify ! ( textsize )
21224                ));
21225    assert_eq! (unsafe {
21226                & ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) .
21227                displaymode as * const _ as usize } , 148usize , concat ! (
21228                "Alignment of field: " , stringify ! (
21229                pspUtilityHtmlViewerParam ) , "::" , stringify ! ( displaymode
21230                ) ));
21231    assert_eq! (unsafe {
21232                & ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) .
21233                connectmode as * const _ as usize } , 152usize , concat ! (
21234                "Alignment of field: " , stringify ! (
21235                pspUtilityHtmlViewerParam ) , "::" , stringify ! ( connectmode
21236                ) ));
21237    assert_eq! (unsafe {
21238                & ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) .
21239                disconnectmode as * const _ as usize } , 156usize , concat ! (
21240                "Alignment of field: " , stringify ! (
21241                pspUtilityHtmlViewerParam ) , "::" , stringify ! (
21242                disconnectmode ) ));
21243    assert_eq! (unsafe {
21244                & ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) . memused
21245                as * const _ as usize } , 160usize , concat ! (
21246                "Alignment of field: " , stringify ! (
21247                pspUtilityHtmlViewerParam ) , "::" , stringify ! ( memused )
21248                ));
21249    assert_eq! (unsafe {
21250                & ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) . unknown4
21251                as * const _ as usize } , 164usize , concat ! (
21252                "Alignment of field: " , stringify ! (
21253                pspUtilityHtmlViewerParam ) , "::" , stringify ! ( unknown4 )
21254                ));
21255}
21256impl Clone for pspUtilityHtmlViewerParam {
21257    fn clone(&self) -> Self { *self }
21258}
21259extern "C" {
21260    /// Init the html viewer
21261///
21262/// @param params - html viewer parameters
21263///
21264/// @return 0 on success, < 0 on error.
21265    pub fn sceUtilityHtmlViewerInitStart(params:
21266                                             *mut pspUtilityHtmlViewerParam)
21267     -> libc::c_int;
21268}
21269extern "C" {
21270    /// Shutdown html viewer.
21271    pub fn sceUtilityHtmlViewerShutdownStart() -> libc::c_int;
21272}
21273extern "C" {
21274    /// Refresh the GUI for html viewer
21275///
21276/// @param n - unknown, pass 1
21277    pub fn sceUtilityHtmlViewerUpdate(n: libc::c_int) -> libc::c_int;
21278}
21279extern "C" {
21280    /// Get the current status of the html viewer.
21281///
21282/// @return 2 if the GUI is visible (you need to call sceUtilityHtmlViewerGetStatus).
21283/// 3 if the user cancelled the dialog, and you need to call sceUtilityHtmlViewerShutdownStart.
21284/// 4 if the dialog has been successfully shut down.
21285    pub fn sceUtilityHtmlViewerGetStatus() -> libc::c_int;
21286}
21287extern "C" {
21288    /// Set Integer System Parameter
21289///
21290/// @param id - which parameter to set
21291/// @param value - integer value to set
21292/// @return 0 on success, PSP_SYSTEMPARAM_RETVAL_FAIL on failure
21293    pub fn sceUtilitySetSystemParamInt(id: libc::c_int, value: libc::c_int)
21294     -> libc::c_int;
21295}
21296extern "C" {
21297    /// Set String System Parameter
21298///
21299/// @param id - which parameter to set
21300/// @param str - char * value to set
21301/// @return 0 on success, PSP_SYSTEMPARAM_RETVAL_FAIL on failure
21302    pub fn sceUtilitySetSystemParamString(id: libc::c_int,
21303                                          str: *const libc::c_char)
21304     -> libc::c_int;
21305}
21306extern "C" {
21307    /// Get Integer System Parameter
21308///
21309/// @param id - which parameter to get
21310/// @param value - pointer to integer value to place result in
21311/// @return 0 on success, PSP_SYSTEMPARAM_RETVAL_FAIL on failure
21312    pub fn sceUtilityGetSystemParamInt(id: libc::c_int,
21313                                       value: *mut libc::c_int)
21314     -> libc::c_int;
21315}
21316extern "C" {
21317    /// Get String System Parameter
21318///
21319/// @param id - which parameter to get
21320/// @param str - char * buffer to place result in
21321/// @param len - length of str buffer
21322/// @return 0 on success, PSP_SYSTEMPARAM_RETVAL_FAIL on failure
21323    pub fn sceUtilityGetSystemParamString(id: libc::c_int,
21324                                          str: *mut libc::c_char,
21325                                          len: libc::c_int) -> libc::c_int;
21326}
21327#[repr(u32)]
21328/// Enumeration for input language
21329#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
21330pub enum SceUtilityOskInputLanguage {
21331    PSP_UTILITY_OSK_LANGUAGE_DEFAULT = 0,
21332    PSP_UTILITY_OSK_LANGUAGE_JAPANESE = 1,
21333    PSP_UTILITY_OSK_LANGUAGE_ENGLISH = 2,
21334    PSP_UTILITY_OSK_LANGUAGE_FRENCH = 3,
21335    PSP_UTILITY_OSK_LANGUAGE_SPANISH = 4,
21336    PSP_UTILITY_OSK_LANGUAGE_GERMAN = 5,
21337    PSP_UTILITY_OSK_LANGUAGE_ITALIAN = 6,
21338    PSP_UTILITY_OSK_LANGUAGE_DUTCH = 7,
21339    PSP_UTILITY_OSK_LANGUAGE_PORTUGESE = 8,
21340    PSP_UTILITY_OSK_LANGUAGE_RUSSIAN = 9,
21341    PSP_UTILITY_OSK_LANGUAGE_KOREAN = 10,
21342}
21343#[repr(u32)]
21344/// Enumeration for OSK internal state
21345#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
21346pub enum SceUtilityOskState {
21347    PSP_UTILITY_OSK_DIALOG_NONE = 0,
21348    PSP_UTILITY_OSK_DIALOG_INITING = 1,
21349    PSP_UTILITY_OSK_DIALOG_INITED = 2,
21350    PSP_UTILITY_OSK_DIALOG_VISIBLE = 3,
21351    PSP_UTILITY_OSK_DIALOG_QUIT = 4,
21352    PSP_UTILITY_OSK_DIALOG_FINISHED = 5,
21353}
21354#[repr(u32)]
21355/// Enumeration for OSK field results
21356#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
21357pub enum SceUtilityOskResult {
21358    PSP_UTILITY_OSK_RESULT_UNCHANGED = 0,
21359    PSP_UTILITY_OSK_RESULT_CANCELLED = 1,
21360    PSP_UTILITY_OSK_RESULT_CHANGED = 2,
21361}
21362#[repr(u32)]
21363/// Enumeration for input types (these are limited by initial choice of language)
21364#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
21365pub enum SceUtilityOskInputType {
21366    PSP_UTILITY_OSK_INPUTTYPE_ALL = 0,
21367    PSP_UTILITY_OSK_INPUTTYPE_LATIN_DIGIT = 1,
21368    PSP_UTILITY_OSK_INPUTTYPE_LATIN_SYMBOL = 2,
21369    PSP_UTILITY_OSK_INPUTTYPE_LATIN_LOWERCASE = 4,
21370    PSP_UTILITY_OSK_INPUTTYPE_LATIN_UPPERCASE = 8,
21371    PSP_UTILITY_OSK_INPUTTYPE_JAPANESE_DIGIT = 256,
21372    PSP_UTILITY_OSK_INPUTTYPE_JAPANESE_SYMBOL = 512,
21373    PSP_UTILITY_OSK_INPUTTYPE_JAPANESE_LOWERCASE = 1024,
21374    PSP_UTILITY_OSK_INPUTTYPE_JAPANESE_UPPERCASE = 2048,
21375    PSP_UTILITY_OSK_INPUTTYPE_JAPANESE_HIRAGANA = 4096,
21376    PSP_UTILITY_OSK_INPUTTYPE_JAPANESE_HALF_KATAKANA = 8192,
21377    PSP_UTILITY_OSK_INPUTTYPE_JAPANESE_KATAKANA = 16384,
21378    PSP_UTILITY_OSK_INPUTTYPE_JAPANESE_KANJI = 32768,
21379    PSP_UTILITY_OSK_INPUTTYPE_RUSSIAN_LOWERCASE = 65536,
21380    PSP_UTILITY_OSK_INPUTTYPE_RUSSIAN_UPPERCASE = 131072,
21381    PSP_UTILITY_OSK_INPUTTYPE_KOREAN = 262144,
21382    PSP_UTILITY_OSK_INPUTTYPE_URL = 524288,
21383}
21384/// OSK Field data
21385#[repr(C)]
21386#[derive(Debug, Copy)]
21387pub struct _SceUtilityOskData {
21388    /// Unknown. Pass 0.
21389    pub unk_00: libc::c_int,
21390    /// Unknown. Pass 0.
21391    pub unk_04: libc::c_int,
21392    /// One of ::SceUtilityOskInputLanguage
21393    pub language: libc::c_int,
21394    /// Unknown. Pass 0.
21395    pub unk_12: libc::c_int,
21396    /// One or more of ::SceUtilityOskInputType (types that are selectable by pressing SELECT)
21397    pub inputtype: libc::c_int,
21398    /// Number of lines
21399    pub lines: libc::c_int,
21400    /// Unknown. Pass 0.
21401    pub unk_24: libc::c_int,
21402    /// Description text
21403    pub desc: *mut libc::c_ushort,
21404    /// Initial text
21405    pub intext: *mut libc::c_ushort,
21406    /// Length of output text
21407    pub outtextlength: libc::c_int,
21408    /// Pointer to the output text
21409    pub outtext: *mut libc::c_ushort,
21410    /// Result. One of ::SceUtilityOskResult
21411    pub result: libc::c_int,
21412    /// The max text that can be input
21413    pub outtextlimit: libc::c_int,
21414}
21415#[test]
21416fn bindgen_test_layout__SceUtilityOskData() {
21417    assert_eq!(::core::mem::size_of::<_SceUtilityOskData>() , 72usize , concat
21418               ! ( "Size of: " , stringify ! ( _SceUtilityOskData ) ));
21419    assert_eq! (::core::mem::align_of::<_SceUtilityOskData>() , 8usize ,
21420                concat ! (
21421                "Alignment of " , stringify ! ( _SceUtilityOskData ) ));
21422    assert_eq! (unsafe {
21423                & ( * ( 0 as * const _SceUtilityOskData ) ) . unk_00 as *
21424                const _ as usize } , 0usize , concat ! (
21425                "Alignment of field: " , stringify ! ( _SceUtilityOskData ) ,
21426                "::" , stringify ! ( unk_00 ) ));
21427    assert_eq! (unsafe {
21428                & ( * ( 0 as * const _SceUtilityOskData ) ) . unk_04 as *
21429                const _ as usize } , 4usize , concat ! (
21430                "Alignment of field: " , stringify ! ( _SceUtilityOskData ) ,
21431                "::" , stringify ! ( unk_04 ) ));
21432    assert_eq! (unsafe {
21433                & ( * ( 0 as * const _SceUtilityOskData ) ) . language as *
21434                const _ as usize } , 8usize , concat ! (
21435                "Alignment of field: " , stringify ! ( _SceUtilityOskData ) ,
21436                "::" , stringify ! ( language ) ));
21437    assert_eq! (unsafe {
21438                & ( * ( 0 as * const _SceUtilityOskData ) ) . unk_12 as *
21439                const _ as usize } , 12usize , concat ! (
21440                "Alignment of field: " , stringify ! ( _SceUtilityOskData ) ,
21441                "::" , stringify ! ( unk_12 ) ));
21442    assert_eq! (unsafe {
21443                & ( * ( 0 as * const _SceUtilityOskData ) ) . inputtype as *
21444                const _ as usize } , 16usize , concat ! (
21445                "Alignment of field: " , stringify ! ( _SceUtilityOskData ) ,
21446                "::" , stringify ! ( inputtype ) ));
21447    assert_eq! (unsafe {
21448                & ( * ( 0 as * const _SceUtilityOskData ) ) . lines as * const
21449                _ as usize } , 20usize , concat ! (
21450                "Alignment of field: " , stringify ! ( _SceUtilityOskData ) ,
21451                "::" , stringify ! ( lines ) ));
21452    assert_eq! (unsafe {
21453                & ( * ( 0 as * const _SceUtilityOskData ) ) . unk_24 as *
21454                const _ as usize } , 24usize , concat ! (
21455                "Alignment of field: " , stringify ! ( _SceUtilityOskData ) ,
21456                "::" , stringify ! ( unk_24 ) ));
21457    assert_eq! (unsafe {
21458                & ( * ( 0 as * const _SceUtilityOskData ) ) . desc as * const
21459                _ as usize } , 32usize , concat ! (
21460                "Alignment of field: " , stringify ! ( _SceUtilityOskData ) ,
21461                "::" , stringify ! ( desc ) ));
21462    assert_eq! (unsafe {
21463                & ( * ( 0 as * const _SceUtilityOskData ) ) . intext as *
21464                const _ as usize } , 40usize , concat ! (
21465                "Alignment of field: " , stringify ! ( _SceUtilityOskData ) ,
21466                "::" , stringify ! ( intext ) ));
21467    assert_eq! (unsafe {
21468                & ( * ( 0 as * const _SceUtilityOskData ) ) . outtextlength as
21469                * const _ as usize } , 48usize , concat ! (
21470                "Alignment of field: " , stringify ! ( _SceUtilityOskData ) ,
21471                "::" , stringify ! ( outtextlength ) ));
21472    assert_eq! (unsafe {
21473                & ( * ( 0 as * const _SceUtilityOskData ) ) . outtext as *
21474                const _ as usize } , 56usize , concat ! (
21475                "Alignment of field: " , stringify ! ( _SceUtilityOskData ) ,
21476                "::" , stringify ! ( outtext ) ));
21477    assert_eq! (unsafe {
21478                & ( * ( 0 as * const _SceUtilityOskData ) ) . result as *
21479                const _ as usize } , 64usize , concat ! (
21480                "Alignment of field: " , stringify ! ( _SceUtilityOskData ) ,
21481                "::" , stringify ! ( result ) ));
21482    assert_eq! (unsafe {
21483                & ( * ( 0 as * const _SceUtilityOskData ) ) . outtextlimit as
21484                * const _ as usize } , 68usize , concat ! (
21485                "Alignment of field: " , stringify ! ( _SceUtilityOskData ) ,
21486                "::" , stringify ! ( outtextlimit ) ));
21487}
21488impl Clone for _SceUtilityOskData {
21489    fn clone(&self) -> Self { *self }
21490}
21491/// OSK Field data
21492pub type SceUtilityOskData = _SceUtilityOskData;
21493/// OSK parameters
21494#[repr(C)]
21495#[derive(Debug, Copy)]
21496pub struct _SceUtilityOskParams {
21497    pub base: pspUtilityDialogCommon,
21498    /// Number of input fields
21499    pub datacount: libc::c_int,
21500    /// Pointer to the start of the data for the input fields
21501    pub data: *mut SceUtilityOskData,
21502    /// The local OSK state, one of ::SceUtilityOskState
21503    pub state: libc::c_int,
21504    /// Unknown. Pass 0
21505    pub unk_60: libc::c_int,
21506}
21507#[test]
21508fn bindgen_test_layout__SceUtilityOskParams() {
21509    assert_eq!(::core::mem::size_of::<_SceUtilityOskParams>() , 72usize ,
21510               concat ! ( "Size of: " , stringify ! ( _SceUtilityOskParams )
21511               ));
21512    assert_eq! (::core::mem::align_of::<_SceUtilityOskParams>() , 8usize ,
21513                concat ! (
21514                "Alignment of " , stringify ! ( _SceUtilityOskParams ) ));
21515    assert_eq! (unsafe {
21516                & ( * ( 0 as * const _SceUtilityOskParams ) ) . base as *
21517                const _ as usize } , 0usize , concat ! (
21518                "Alignment of field: " , stringify ! ( _SceUtilityOskParams )
21519                , "::" , stringify ! ( base ) ));
21520    assert_eq! (unsafe {
21521                & ( * ( 0 as * const _SceUtilityOskParams ) ) . datacount as *
21522                const _ as usize } , 48usize , concat ! (
21523                "Alignment of field: " , stringify ! ( _SceUtilityOskParams )
21524                , "::" , stringify ! ( datacount ) ));
21525    assert_eq! (unsafe {
21526                & ( * ( 0 as * const _SceUtilityOskParams ) ) . data as *
21527                const _ as usize } , 56usize , concat ! (
21528                "Alignment of field: " , stringify ! ( _SceUtilityOskParams )
21529                , "::" , stringify ! ( data ) ));
21530    assert_eq! (unsafe {
21531                & ( * ( 0 as * const _SceUtilityOskParams ) ) . state as *
21532                const _ as usize } , 64usize , concat ! (
21533                "Alignment of field: " , stringify ! ( _SceUtilityOskParams )
21534                , "::" , stringify ! ( state ) ));
21535    assert_eq! (unsafe {
21536                & ( * ( 0 as * const _SceUtilityOskParams ) ) . unk_60 as *
21537                const _ as usize } , 68usize , concat ! (
21538                "Alignment of field: " , stringify ! ( _SceUtilityOskParams )
21539                , "::" , stringify ! ( unk_60 ) ));
21540}
21541impl Clone for _SceUtilityOskParams {
21542    fn clone(&self) -> Self { *self }
21543}
21544/// OSK parameters
21545pub type SceUtilityOskParams = _SceUtilityOskParams;
21546extern "C" {
21547    /// Create an on-screen keyboard
21548///
21549/// @param params - OSK parameters.
21550///
21551/// @return < 0 on error.
21552    pub fn sceUtilityOskInitStart(params: *mut SceUtilityOskParams)
21553     -> libc::c_int;
21554}
21555extern "C" {
21556    /// Remove a currently active keyboard. After calling this function you must
21557///
21558/// poll sceUtilityOskGetStatus() until it returns PSP_UTILITY_DIALOG_NONE.
21559///
21560/// @return < 0 on error.
21561    pub fn sceUtilityOskShutdownStart() -> libc::c_int;
21562}
21563extern "C" {
21564    /// Refresh the GUI for a keyboard currently active
21565///
21566/// @param n - Unknown, pass 1.
21567///
21568/// @return < 0 on error.
21569    pub fn sceUtilityOskUpdate(n: libc::c_int) -> libc::c_int;
21570}
21571extern "C" {
21572    /// Get the status of a on-screen keyboard currently active.
21573///
21574/// @return the current status of the keyboard. See ::pspUtilityDialogState for details.
21575    pub fn sceUtilityOskGetStatus() -> libc::c_int;
21576}
21577extern "C" {
21578    /// Load a network module (PRX) from user mode.
21579/// Load PSP_NET_MODULE_COMMON and PSP_NET_MODULE_INET
21580/// to use infrastructure WifI (via an access point).
21581/// Available on firmware 2.00 and higher only.
21582///
21583/// @param module - module number to load (PSP_NET_MODULE_xxx)
21584/// @return 0 on success, < 0 on error
21585    pub fn sceUtilityLoadNetModule(module: libc::c_int) -> libc::c_int;
21586}
21587extern "C" {
21588    /// Unload a network module (PRX) from user mode.
21589/// Available on firmware 2.00 and higher only.
21590///
21591/// @param module - module number be unloaded
21592/// @return 0 on success, < 0 on error
21593    pub fn sceUtilityUnloadNetModule(module: libc::c_int) -> libc::c_int;
21594}
21595extern "C" {
21596    /// Load an audio/video module (PRX) from user mode.
21597///
21598/// Available on firmware 2.00 and higher only.
21599///
21600/// @param module - module number to load (PSP_AV_MODULE_xxx)
21601/// @return 0 on success, < 0 on error
21602    pub fn sceUtilityLoadAvModule(module: libc::c_int) -> libc::c_int;
21603}
21604extern "C" {
21605    /// Unload an audio/video module (PRX) from user mode.
21606/// Available on firmware 2.00 and higher only.
21607///
21608/// @param module - module number to be unloaded
21609/// @return 0 on success, < 0 on error
21610    pub fn sceUtilityUnloadAvModule(module: libc::c_int) -> libc::c_int;
21611}
21612extern "C" {
21613    /// Load a usb module (PRX) from user mode.
21614/// Available on firmware 2.70 and higher only.
21615///
21616/// @param module - module number to load (PSP_USB_MODULE_xxx)
21617/// @return 0 on success, < 0 on error
21618    pub fn sceUtilityLoadUsbModule(module: libc::c_int) -> libc::c_int;
21619}
21620extern "C" {
21621    /// Unload a usb module (PRX) from user mode.
21622/// Available on firmware 2.70 and higher only.
21623///
21624/// @param module - module number to be unloaded
21625/// @return 0 on success, < 0 on error
21626    pub fn sceUtilityUnloadUsbModule(module: libc::c_int) -> libc::c_int;
21627}
21628extern "C" {
21629    /// Load a module (PRX) from user mode.
21630///
21631/// @param module - module to load (PSP_MODULE_xxx)
21632///
21633/// @return 0 on success, < 0 on error
21634    pub fn sceUtilityLoadModule(module: libc::c_int) -> libc::c_int;
21635}
21636extern "C" {
21637    /// Unload a module (PRX) from user mode.
21638///
21639/// @param module - module to unload (PSP_MODULE_xxx)
21640///
21641/// @return 0 on success, < 0 on error
21642    pub fn sceUtilityUnloadModule(module: libc::c_int) -> libc::c_int;
21643}
21644#[repr(u32)]
21645/// Return-values for the various sceUtility***GetStatus() functions
21646#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
21647pub enum pspUtilityDialogState {
21648    PSP_UTILITY_DIALOG_NONE = 0,
21649    PSP_UTILITY_DIALOG_INIT = 1,
21650    PSP_UTILITY_DIALOG_VISIBLE = 2,
21651    PSP_UTILITY_DIALOG_QUIT = 3,
21652    PSP_UTILITY_DIALOG_FINISHED = 4,
21653}
21654extern "C" {
21655    /// Decompress gzip'd data (requires kernel mode)
21656///
21657/// @param dest - pointer to destination buffer
21658/// @param destSize - size of destination buffer
21659/// @param src - pointer to source (compressed) data
21660/// @param unknown - unknown, pass NULL
21661/// @return size decompressed on success, < 0 on error
21662    pub fn sceKernelGzipDecompress(dest: *mut u8, destSize: u32,
21663                                   src: *const u8, unknown: u32)
21664     -> libc::c_int;
21665}
21666extern "C" {
21667    /// Decompress deflate'd data (requires kernel mode)
21668///
21669/// @param dest - pointer to destination buffer
21670/// @param destSize - size of destination buffer
21671/// @param src - pointer to source (compressed) data
21672/// @param unknown - unknown, pass NULL
21673/// @return size decompressed on success, < 0 on error
21674    pub fn sceKernelDeflateDecompress(dest: *mut u8, destSize: u32,
21675                                      src: *const u8, unknown: u32)
21676     -> libc::c_int;
21677}
21678extern "C" {
21679    /// Invalidate the entire data cache
21680    pub fn sceKernelDcacheInvalidateAll();
21681}
21682extern "C" {
21683    /// Check whether the specified address is in the data cache
21684/// @param addr - The address to check
21685///
21686/// @return 0 = not cached, 1 = cache
21687    pub fn sceKernelDcacheProbe(addr: *mut libc::c_void) -> libc::c_int;
21688}
21689extern "C" {
21690    /// Check whether the specified address is in the instruction cache
21691/// @param addr - The address to check
21692///
21693/// @return 0 = not cached, 1 = cache
21694    pub fn sceKernelIcacheProbe(addr: *const libc::c_void) -> libc::c_int;
21695}
21696#[repr(C)]
21697#[derive(Debug, Copy, Clone)]
21698pub struct pspvfpu_context {
21699    _unused: [u8; 0],
21700}
21701pub type vfpumatrixset_t = libc::c_uchar;
21702extern "C" {
21703    /// Prepare to use the VFPU.  This set's the calling thread's VFPU
21704/// attribute, and returns a pointer to some VFPU state storage.
21705/// The initial value all all VFPU matrix registers is undefined.
21706///
21707/// @return A VFPU context
21708    pub fn pspvfpu_initcontext() -> *mut pspvfpu_context;
21709}
21710extern "C" {
21711    /// Delete a VFPU context.  This frees the resources used by the VFPU
21712/// context.
21713///
21714/// @param context The VFPU context to be deleted.
21715    pub fn pspvfpu_deletecontext(context: *mut pspvfpu_context);
21716}
21717extern "C" {
21718    /// Use a set of VFPU matrices.  This restores the parts of the VFPU
21719/// state the caller wants restored (if necessary).  If the caller was
21720/// the previous user of the the matrix set, then this call is
21721/// effectively a no-op.  If a matrix has never been used by this
21722/// context before, then it will initially have an undefined value.
21723///
21724/// @param context The VFPU context the caller wants to restore
21725/// from. It is valid to pass NULL as a context.  This means the caller
21726/// wants to reserve a temporary matrix without affecting other VFPU
21727/// users, but doesn't want any long-term matrices itself.
21728///
21729/// @param keepset The set of matrices the caller wants to use, and
21730/// keep the values persistently.
21731///
21732/// @param tempset A set of matrices the callers wants to use
21733/// temporarily, but doesn't care about the values in the long-term.
21734    pub fn pspvfpu_use_matrices(context: *mut pspvfpu_context,
21735                                keepset: vfpumatrixset_t,
21736                                tempset: vfpumatrixset_t);
21737}
21738extern "C" {
21739    pub fn sceVideocodecOpen(Buffer: *mut libc::c_ulong, Type: libc::c_int)
21740     -> libc::c_int;
21741}
21742extern "C" {
21743    pub fn sceVideocodecGetEDRAM(Buffer: *mut libc::c_ulong,
21744                                 Type: libc::c_int) -> libc::c_int;
21745}
21746extern "C" {
21747    pub fn sceVideocodecInit(Buffer: *mut libc::c_ulong, Type: libc::c_int)
21748     -> libc::c_int;
21749}
21750extern "C" {
21751    pub fn sceVideocodecDecode(Buffer: *mut libc::c_ulong, Type: libc::c_int)
21752     -> libc::c_int;
21753}
21754extern "C" {
21755    pub fn sceVideocodecReleaseEDRAM(Buffer: *mut libc::c_ulong)
21756     -> libc::c_int;
21757}
21758extern "C" {
21759    /// Determine if the wlan device is currently powered on
21760///
21761/// @return 0 if off, 1 if on
21762    pub fn sceWlanDevIsPowerOn() -> libc::c_int;
21763}
21764extern "C" {
21765    /// Determine the state of the Wlan power switch
21766///
21767/// @return 0 if off, 1 if on
21768    pub fn sceWlanGetSwitchState() -> libc::c_int;
21769}
21770extern "C" {
21771    /// Get the Ethernet Address of the wlan controller
21772///
21773/// @param etherAddr - pointer to a buffer of u8 (NOTE: it only writes to 6 bytes, but
21774/// requests 8 so pass it 8 bytes just in case)
21775/// @return 0 on success, < 0 on error
21776    pub fn sceWlanGetEtherAddr(etherAddr: *mut u8) -> libc::c_int;
21777}
21778extern "C" {
21779    /// Attach to the wlan device
21780///
21781/// @return 0 on success, < 0 on error.
21782    pub fn sceWlanDevAttach() -> libc::c_int;
21783}
21784extern "C" {
21785    /// Detach from the wlan device
21786///
21787/// @return 0 on success, < 0 on error/
21788    pub fn sceWlanDevDetach() -> libc::c_int;
21789}
21790pub type __builtin_va_list = [__va_list_tag; 1usize];
21791#[repr(C)]
21792#[derive(Debug, Copy)]
21793pub struct __va_list_tag {
21794    pub gp_offset: libc::c_uint,
21795    pub fp_offset: libc::c_uint,
21796    pub overflow_arg_area: *mut libc::c_void,
21797    pub reg_save_area: *mut libc::c_void,
21798}
21799#[test]
21800fn bindgen_test_layout___va_list_tag() {
21801    assert_eq!(::core::mem::size_of::<__va_list_tag>() , 24usize , concat ! (
21802               "Size of: " , stringify ! ( __va_list_tag ) ));
21803    assert_eq! (::core::mem::align_of::<__va_list_tag>() , 8usize , concat ! (
21804                "Alignment of " , stringify ! ( __va_list_tag ) ));
21805    assert_eq! (unsafe {
21806                & ( * ( 0 as * const __va_list_tag ) ) . gp_offset as * const
21807                _ as usize } , 0usize , concat ! (
21808                "Alignment of field: " , stringify ! ( __va_list_tag ) , "::"
21809                , stringify ! ( gp_offset ) ));
21810    assert_eq! (unsafe {
21811                & ( * ( 0 as * const __va_list_tag ) ) . fp_offset as * const
21812                _ as usize } , 4usize , concat ! (
21813                "Alignment of field: " , stringify ! ( __va_list_tag ) , "::"
21814                , stringify ! ( fp_offset ) ));
21815    assert_eq! (unsafe {
21816                & ( * ( 0 as * const __va_list_tag ) ) . overflow_arg_area as
21817                * const _ as usize } , 8usize , concat ! (
21818                "Alignment of field: " , stringify ! ( __va_list_tag ) , "::"
21819                , stringify ! ( overflow_arg_area ) ));
21820    assert_eq! (unsafe {
21821                & ( * ( 0 as * const __va_list_tag ) ) . reg_save_area as *
21822                const _ as usize } , 16usize , concat ! (
21823                "Alignment of field: " , stringify ! ( __va_list_tag ) , "::"
21824                , stringify ! ( reg_save_area ) ));
21825}
21826impl Clone for __va_list_tag {
21827    fn clone(&self) -> Self { *self }
21828}