Skip to content

Instantly share code, notes, and snippets.

@sajattack
Created May 11, 2020 17:38
Show Gist options
  • Save sajattack/62cee95df0619e0133f70e40897db2bf to your computer and use it in GitHub Desktop.
Save sajattack/62cee95df0619e0133f70e40897db2bf to your computer and use it in GitHub Desktop.
PSPSDK Rust Bindings
/* automatically generated by rust-bindgen */
pub const _PSPTYPES_H_: u32 = 1;
pub const __have_longlong64: u32 = 1;
pub const __have_long64: u32 = 1;
pub const __int8_t_defined: u32 = 1;
pub const __int_least8_t_defined: u32 = 1;
pub const __int16_t_defined: u32 = 1;
pub const __int_least16_t_defined: u32 = 1;
pub const __int32_t_defined: u32 = 1;
pub const __int_least32_t_defined: u32 = 1;
pub const __int64_t_defined: u32 = 1;
pub const __int_least64_t_defined: u32 = 1;
pub const __int_fast8_t_defined: u32 = 1;
pub const __int_fast16_t_defined: u32 = 1;
pub const __int_fast32_t_defined: u32 = 1;
pub const __int_fast64_t_defined: u32 = 1;
pub const INT8_MIN: i32 = -128;
pub const INT8_MAX: u32 = 127;
pub const UINT8_MAX: u32 = 255;
pub const INT_LEAST8_MIN: i32 = -128;
pub const INT_LEAST8_MAX: u32 = 127;
pub const UINT_LEAST8_MAX: u32 = 255;
pub const INT16_MIN: i32 = -32768;
pub const INT16_MAX: u32 = 32767;
pub const UINT16_MAX: u32 = 65535;
pub const INT_LEAST16_MIN: i32 = -32768;
pub const INT_LEAST16_MAX: u32 = 32767;
pub const UINT_LEAST16_MAX: u32 = 65535;
pub const INT32_MIN: i32 = -2147483648;
pub const INT32_MAX: u32 = 2147483647;
pub const UINT32_MAX: u32 = 4294967295;
pub const INT_LEAST32_MIN: i32 = -2147483648;
pub const INT_LEAST32_MAX: u32 = 2147483647;
pub const UINT_LEAST32_MAX: u32 = 4294967295;
pub const INT64_MIN: i64 = -9223372036854775808;
pub const INT64_MAX: u64 = 9223372036854775807;
pub const UINT64_MAX: i32 = -1;
pub const INT_LEAST64_MIN: i64 = -9223372036854775808;
pub const INT_LEAST64_MAX: u64 = 9223372036854775807;
pub const UINT_LEAST64_MAX: i32 = -1;
pub const INT_FAST64_MIN: i64 = -9223372036854775808;
pub const INT_FAST64_MAX: u64 = 9223372036854775807;
pub const UINT_FAST64_MAX: i32 = -1;
pub const WINT_MIN: u32 = 0;
pub const PSP_O_RDONLY: u32 = 1;
pub const PSP_O_WRONLY: u32 = 2;
pub const PSP_O_RDWR: u32 = 3;
pub const PSP_O_NBLOCK: u32 = 4;
pub const PSP_O_DIROPEN: u32 = 8;
pub const PSP_O_APPEND: u32 = 256;
pub const PSP_O_CREAT: u32 = 512;
pub const PSP_O_TRUNC: u32 = 1024;
pub const PSP_O_EXCL: u32 = 2048;
pub const PSP_O_NOWAIT: u32 = 32768;
pub const PSP_SEEK_SET: u32 = 0;
pub const PSP_SEEK_CUR: u32 = 1;
pub const PSP_SEEK_END: u32 = 2;
pub const PSP_MEMORY_PARTITION_KERNEL: u32 = 1;
pub const PSP_MEMORY_PARTITION_USER: u32 = 2;
pub const __NEWLIB_H__: u32 = 1;
pub const _NEWLIB_VERSION: &'static [u8; 7usize] = b"1.20.0\x00";
pub const _WANT_IO_LONG_LONG: u32 = 1;
pub const _MB_CAPABLE: u32 = 1;
pub const _MB_LEN_MAX: u32 = 8;
pub const _ICONV_ENABLED: u32 = 1;
pub const HAVE_INITFINI_ARRAY: u32 = 1;
pub const _ATEXIT_DYNAMIC_ALLOC: u32 = 1;
pub const _HAVE_LONG_DOUBLE: u32 = 1;
pub const _LDBL_EQ_DBL: u32 = 1;
pub const __RAND_MAX: u32 = 2147483647;
pub const ___int8_t_defined: u32 = 1;
pub const ___int16_t_defined: u32 = 1;
pub const ___int_least16_t_defined: u32 = 1;
pub const ___int32_t_defined: u32 = 1;
pub const ___int_least32_t_defined: u32 = 1;
pub const ___int64_t_defined: u32 = 1;
pub const NBBY: u32 = 8;
pub const FD_SETSIZE: u32 = 64;
pub const ITIMER_REAL: u32 = 0;
pub const ITIMER_VIRTUAL: u32 = 1;
pub const ITIMER_PROF: u32 = 2;
pub const PSP_ATRAC_ERROR_PARAM_FAIL: u32 = 2153971713;
pub const PSP_ATRAC_ERROR_API_FAIL: u32 = 2153971714;
pub const PSP_ATRAC_ERROR_NO_ATRACID: u32 = 2153971715;
pub const PSP_ATRAC_ERROR_BAD_CODECTYPE: u32 = 2153971716;
pub const PSP_ATRAC_ERROR_BAD_ATRACID: u32 = 2153971717;
pub const PSP_ATRAC_ERROR_UNKNOWN_FORMAT: u32 = 2153971718;
pub const PSP_ATRAC_ERROR_UNMATCH_FORMAT: u32 = 2153971719;
pub const PSP_ATRAC_ERROR_BAD_DATA: u32 = 2153971720;
pub const PSP_ATRAC_ERROR_ALLDATA_IS_ONMEMORY: u32 = 2153971721;
pub const PSP_ATRAC_ERROR_UNSET_DATA: u32 = 2153971728;
pub const PSP_ATRAC_ERROR_READSIZE_IS_TOO_SMALL: u32 = 2153971729;
pub const PSP_ATRAC_ERROR_NEED_SECOND_BUFFER: u32 = 2153971730;
pub const PSP_ATRAC_ERROR_READSIZE_OVER_BUFFER: u32 = 2153971731;
pub const PSP_ATRAC_ERROR_NOT_4BYTE_ALIGNMENT: u32 = 2153971732;
pub const PSP_ATRAC_ERROR_BAD_SAMPLE: u32 = 2153971733;
pub const PSP_ATRAC_ERROR_WRITEBYTE_FIRST_BUFFER: u32 = 2153971734;
pub const PSP_ATRAC_ERROR_WRITEBYTE_SECOND_BUFFER: u32 = 2153971735;
pub const PSP_ATRAC_ERROR_ADD_DATA_IS_TOO_BIG: u32 = 2153971736;
pub const PSP_ATRAC_ERROR_UNSET_PARAM: u32 = 2153971745;
pub const PSP_ATRAC_ERROR_NONEED_SECOND_BUFFER: u32 = 2153971746;
pub const PSP_ATRAC_ERROR_NODATA_IN_BUFFER: u32 = 2153971747;
pub const PSP_ATRAC_ERROR_ALLDATA_WAS_DECODED: u32 = 2153971748;
pub const PSP_ATRAC_AT3PLUS: u32 = 4096;
pub const PSP_ATRAC_AT3: u32 = 4097;
pub const PSP_ATRAC_ALLDATA_IS_ON_MEMORY: i32 = -1;
pub const PSP_ATRAC_NONLOOP_STREAM_DATA_IS_ON_MEMORY: i32 = -2;
pub const PSP_ATRAC_LOOP_STREAM_DATA_IS_ON_MEMORY: i32 = -3;
pub const PSP_CODEC_AT3PLUS: u32 = 4096;
pub const PSP_CODEC_AT3: u32 = 4097;
pub const PSP_CODEC_MP3: u32 = 4098;
pub const PSP_CODEC_AAC: u32 = 4099;
pub const PSP_AUDIO_VOLUME_MAX: u32 = 32768;
pub const PSP_AUDIO_CHANNEL_MAX: u32 = 8;
pub const PSP_AUDIO_NEXT_CHANNEL: i32 = -1;
pub const PSP_AUDIO_SAMPLE_MIN: u32 = 64;
pub const PSP_AUDIO_SAMPLE_MAX: u32 = 65472;
pub const PSP_NUM_AUDIO_CHANNELS: u32 = 4;
pub const PSP_NUM_AUDIO_SAMPLES: u32 = 1024;
pub const PSP_VOLUME_MAX: u32 = 32768;
pub const PSP_FPU_RM_MASK: u32 = 3;
pub const PSP_FPU_FLAGS_POS: u32 = 2;
pub const PSP_FPU_ENABLE_POS: u32 = 7;
pub const PSP_FPU_CAUSE_POS: u32 = 12;
pub const PSP_FPU_CC0_POS: u32 = 23;
pub const PSP_FPU_FS_POS: u32 = 24;
pub const PSP_FPU_CC17_POS: u32 = 25;
pub const PSP_FPU_FLAGS_MASK: u32 = 124;
pub const PSP_FPU_ENABLE_MASK: u32 = 3968;
pub const PSP_FPU_CAUSE_MASK: u32 = 258048;
pub const PSP_FPU_CC0_MASK: u32 = 8388608;
pub const PSP_FPU_FS_MASK: u32 = 16777216;
pub const PSP_FPU_CC17_MASK: u32 = 4261412864;
pub const GU_PI: f64 = 3.141593;
pub const GU_FALSE: u32 = 0;
pub const GU_TRUE: u32 = 1;
pub const GU_POINTS: u32 = 0;
pub const GU_LINES: u32 = 1;
pub const GU_LINE_STRIP: u32 = 2;
pub const GU_TRIANGLES: u32 = 3;
pub const GU_TRIANGLE_STRIP: u32 = 4;
pub const GU_TRIANGLE_FAN: u32 = 5;
pub const GU_SPRITES: u32 = 6;
pub const GU_ALPHA_TEST: u32 = 0;
pub const GU_DEPTH_TEST: u32 = 1;
pub const GU_SCISSOR_TEST: u32 = 2;
pub const GU_STENCIL_TEST: u32 = 3;
pub const GU_BLEND: u32 = 4;
pub const GU_CULL_FACE: u32 = 5;
pub const GU_DITHER: u32 = 6;
pub const GU_FOG: u32 = 7;
pub const GU_CLIP_PLANES: u32 = 8;
pub const GU_TEXTURE_2D: u32 = 9;
pub const GU_LIGHTING: u32 = 10;
pub const GU_LIGHT0: u32 = 11;
pub const GU_LIGHT1: u32 = 12;
pub const GU_LIGHT2: u32 = 13;
pub const GU_LIGHT3: u32 = 14;
pub const GU_LINE_SMOOTH: u32 = 15;
pub const GU_PATCH_CULL_FACE: u32 = 16;
pub const GU_COLOR_TEST: u32 = 17;
pub const GU_COLOR_LOGIC_OP: u32 = 18;
pub const GU_FACE_NORMAL_REVERSE: u32 = 19;
pub const GU_PATCH_FACE: u32 = 20;
pub const GU_FRAGMENT_2X: u32 = 21;
pub const GU_PROJECTION: u32 = 0;
pub const GU_VIEW: u32 = 1;
pub const GU_MODEL: u32 = 2;
pub const GU_TEXTURE: u32 = 3;
pub const GU_PSM_5650: u32 = 0;
pub const GU_PSM_5551: u32 = 1;
pub const GU_PSM_4444: u32 = 2;
pub const GU_PSM_8888: u32 = 3;
pub const GU_PSM_T4: u32 = 4;
pub const GU_PSM_T8: u32 = 5;
pub const GU_PSM_T16: u32 = 6;
pub const GU_PSM_T32: u32 = 7;
pub const GU_PSM_DXT1: u32 = 8;
pub const GU_PSM_DXT3: u32 = 9;
pub const GU_PSM_DXT5: u32 = 10;
pub const GU_FILL_FILL: u32 = 0;
pub const GU_OPEN_FILL: u32 = 1;
pub const GU_FILL_OPEN: u32 = 2;
pub const GU_OPEN_OPEN: u32 = 3;
pub const GU_FLAT: u32 = 0;
pub const GU_SMOOTH: u32 = 1;
pub const GU_CLEAR: u32 = 0;
pub const GU_AND: u32 = 1;
pub const GU_AND_REVERSE: u32 = 2;
pub const GU_COPY: u32 = 3;
pub const GU_AND_INVERTED: u32 = 4;
pub const GU_NOOP: u32 = 5;
pub const GU_XOR: u32 = 6;
pub const GU_OR: u32 = 7;
pub const GU_NOR: u32 = 8;
pub const GU_EQUIV: u32 = 9;
pub const GU_INVERTED: u32 = 10;
pub const GU_OR_REVERSE: u32 = 11;
pub const GU_COPY_INVERTED: u32 = 12;
pub const GU_OR_INVERTED: u32 = 13;
pub const GU_NAND: u32 = 14;
pub const GU_SET: u32 = 15;
pub const GU_NEAREST: u32 = 0;
pub const GU_LINEAR: u32 = 1;
pub const GU_NEAREST_MIPMAP_NEAREST: u32 = 4;
pub const GU_LINEAR_MIPMAP_NEAREST: u32 = 5;
pub const GU_NEAREST_MIPMAP_LINEAR: u32 = 6;
pub const GU_LINEAR_MIPMAP_LINEAR: u32 = 7;
pub const GU_TEXTURE_COORDS: u32 = 0;
pub const GU_TEXTURE_MATRIX: u32 = 1;
pub const GU_ENVIRONMENT_MAP: u32 = 2;
pub const GU_TEXTURE_AUTO: u32 = 0;
pub const GU_TEXTURE_CONST: u32 = 1;
pub const GU_TEXTURE_SLOPE: u32 = 2;
pub const GU_POSITION: u32 = 0;
pub const GU_UV: u32 = 1;
pub const GU_NORMALIZED_NORMAL: u32 = 2;
pub const GU_NORMAL: u32 = 3;
pub const GU_REPEAT: u32 = 0;
pub const GU_CLAMP: u32 = 1;
pub const GU_CW: u32 = 0;
pub const GU_CCW: u32 = 1;
pub const GU_NEVER: u32 = 0;
pub const GU_ALWAYS: u32 = 1;
pub const GU_EQUAL: u32 = 2;
pub const GU_NOTEQUAL: u32 = 3;
pub const GU_LESS: u32 = 4;
pub const GU_LEQUAL: u32 = 5;
pub const GU_GREATER: u32 = 6;
pub const GU_GEQUAL: u32 = 7;
pub const GU_COLOR_BUFFER_BIT: u32 = 1;
pub const GU_STENCIL_BUFFER_BIT: u32 = 2;
pub const GU_DEPTH_BUFFER_BIT: u32 = 4;
pub const GU_FAST_CLEAR_BIT: u32 = 16;
pub const GU_TFX_MODULATE: u32 = 0;
pub const GU_TFX_DECAL: u32 = 1;
pub const GU_TFX_BLEND: u32 = 2;
pub const GU_TFX_REPLACE: u32 = 3;
pub const GU_TFX_ADD: u32 = 4;
pub const GU_TCC_RGB: u32 = 0;
pub const GU_TCC_RGBA: u32 = 1;
pub const GU_ADD: u32 = 0;
pub const GU_SUBTRACT: u32 = 1;
pub const GU_REVERSE_SUBTRACT: u32 = 2;
pub const GU_MIN: u32 = 3;
pub const GU_MAX: u32 = 4;
pub const GU_ABS: u32 = 5;
pub const GU_SRC_COLOR: u32 = 0;
pub const GU_ONE_MINUS_SRC_COLOR: u32 = 1;
pub const GU_SRC_ALPHA: u32 = 2;
pub const GU_ONE_MINUS_SRC_ALPHA: u32 = 3;
pub const GU_DST_COLOR: u32 = 0;
pub const GU_ONE_MINUS_DST_COLOR: u32 = 1;
pub const GU_DST_ALPHA: u32 = 4;
pub const GU_ONE_MINUS_DST_ALPHA: u32 = 5;
pub const GU_FIX: u32 = 10;
pub const GU_KEEP: u32 = 0;
pub const GU_ZERO: u32 = 1;
pub const GU_REPLACE: u32 = 2;
pub const GU_INVERT: u32 = 3;
pub const GU_INCR: u32 = 4;
pub const GU_DECR: u32 = 5;
pub const GU_AMBIENT: u32 = 1;
pub const GU_DIFFUSE: u32 = 2;
pub const GU_SPECULAR: u32 = 4;
pub const GU_AMBIENT_AND_DIFFUSE: u32 = 3;
pub const GU_DIFFUSE_AND_SPECULAR: u32 = 6;
pub const GU_UNKNOWN_LIGHT_COMPONENT: u32 = 8;
pub const GU_SINGLE_COLOR: u32 = 0;
pub const GU_SEPARATE_SPECULAR_COLOR: u32 = 1;
pub const GU_DIRECTIONAL: u32 = 0;
pub const GU_POINTLIGHT: u32 = 1;
pub const GU_SPOTLIGHT: u32 = 2;
pub const GU_DIRECT: u32 = 0;
pub const GU_CALL: u32 = 1;
pub const GU_SEND: u32 = 2;
pub const GU_TAIL: u32 = 0;
pub const GU_HEAD: u32 = 1;
pub const GU_SYNC_FINISH: u32 = 0;
pub const GU_SYNC_SIGNAL: u32 = 1;
pub const GU_SYNC_DONE: u32 = 2;
pub const GU_SYNC_LIST: u32 = 3;
pub const GU_SYNC_SEND: u32 = 4;
pub const GU_SYNC_WAIT: u32 = 0;
pub const GU_SYNC_NOWAIT: u32 = 1;
pub const GU_SYNC_WHAT_DONE: u32 = 0;
pub const GU_SYNC_WHAT_QUEUED: u32 = 1;
pub const GU_SYNC_WHAT_DRAW: u32 = 2;
pub const GU_SYNC_WHAT_STALL: u32 = 3;
pub const GU_SYNC_WHAT_CANCEL: u32 = 4;
pub const GU_CALLBACK_SIGNAL: u32 = 1;
pub const GU_CALLBACK_FINISH: u32 = 4;
pub const GU_BEHAVIOR_SUSPEND: u32 = 1;
pub const GU_BEHAVIOR_CONTINUE: u32 = 2;
pub const PSP_IMPOSE_MAIN_VOLUME: u32 = 1;
pub const PSP_IMPOSE_BACKLIGHT_BRIGHTNESS: u32 = 2;
pub const PSP_IMPOSE_EQUALIZER_MODE: u32 = 4;
pub const PSP_IMPOSE_MUTE: u32 = 8;
pub const PSP_IMPOSE_AVLS: u32 = 16;
pub const PSP_IMPOSE_TIME_FORMAT: u32 = 32;
pub const PSP_IMPOSE_DATE_FORMAT: u32 = 64;
pub const PSP_IMPOSE_LANGUAGE: u32 = 128;
pub const PSP_IMPOSE_BACKLIGHT_OFF_INTERVAL: u32 = 512;
pub const PSP_IMPOSE_SOUND_REDUCTION: u32 = 1024;
pub const PSP_IMPOSE_UMD_POPUP_ENABLED: u32 = 1;
pub const PSP_IMPOSE_UMD_POPUP_DISABLED: u32 = 0;
pub const SCE_MPEG_AVC_FORMAT_DEFAULT: i32 = -1;
pub const SCE_MPEG_AVC_FORMAT_5650: u32 = 0;
pub const SCE_MPEG_AVC_FORMAT_5551: u32 = 1;
pub const SCE_MPEG_AVC_FORMAT_4444: u32 = 2;
pub const SCE_MPEG_AVC_FORMAT_8888: u32 = 3;
pub const MS_CB_EVENT_INSERTED: u32 = 1;
pub const MS_CB_EVENT_EJECTED: u32 = 2;
pub const PSP_NET_APCTL_STATE_DISCONNECTED: u32 = 0;
pub const PSP_NET_APCTL_STATE_SCANNING: u32 = 1;
pub const PSP_NET_APCTL_STATE_JOINING: u32 = 2;
pub const PSP_NET_APCTL_STATE_GETTING_IP: u32 = 3;
pub const PSP_NET_APCTL_STATE_GOT_IP: u32 = 4;
pub const PSP_NET_APCTL_STATE_EAP_AUTH: u32 = 5;
pub const PSP_NET_APCTL_STATE_KEY_EXCHANGE: u32 = 6;
pub const PSP_NET_APCTL_EVENT_CONNECT_REQUEST: u32 = 0;
pub const PSP_NET_APCTL_EVENT_SCAN_REQUEST: u32 = 1;
pub const PSP_NET_APCTL_EVENT_SCAN_COMPLETE: u32 = 2;
pub const PSP_NET_APCTL_EVENT_ESTABLISHED: u32 = 3;
pub const PSP_NET_APCTL_EVENT_GET_IP: u32 = 4;
pub const PSP_NET_APCTL_EVENT_DISCONNECT_REQUEST: u32 = 5;
pub const PSP_NET_APCTL_EVENT_ERROR: u32 = 6;
pub const PSP_NET_APCTL_EVENT_INFO: u32 = 7;
pub const PSP_NET_APCTL_EVENT_EAP_AUTH: u32 = 8;
pub const PSP_NET_APCTL_EVENT_KEY_EXCHANGE: u32 = 9;
pub const PSP_NET_APCTL_EVENT_RECONNECT: u32 = 10;
pub const PSP_NET_APCTL_INFO_PROFILE_NAME: u32 = 0;
pub const PSP_NET_APCTL_INFO_BSSID: u32 = 1;
pub const PSP_NET_APCTL_INFO_SSID: u32 = 2;
pub const PSP_NET_APCTL_INFO_SSID_LENGTH: u32 = 3;
pub const PSP_NET_APCTL_INFO_SECURITY_TYPE: u32 = 4;
pub const PSP_NET_APCTL_INFO_STRENGTH: u32 = 5;
pub const PSP_NET_APCTL_INFO_CHANNEL: u32 = 6;
pub const PSP_NET_APCTL_INFO_POWER_SAVE: u32 = 7;
pub const PSP_NET_APCTL_INFO_IP: u32 = 8;
pub const PSP_NET_APCTL_INFO_SUBNETMASK: u32 = 9;
pub const PSP_NET_APCTL_INFO_GATEWAY: u32 = 10;
pub const PSP_NET_APCTL_INFO_PRIMDNS: u32 = 11;
pub const PSP_NET_APCTL_INFO_SECDNS: u32 = 12;
pub const PSP_NET_APCTL_INFO_USE_PROXY: u32 = 13;
pub const PSP_NET_APCTL_INFO_PROXY_URL: u32 = 14;
pub const PSP_NET_APCTL_INFO_PROXY_PORT: u32 = 15;
pub const PSP_NET_APCTL_INFO_8021_EAP_TYPE: u32 = 16;
pub const PSP_NET_APCTL_INFO_START_BROWSER: u32 = 17;
pub const PSP_NET_APCTL_INFO_WIFISP: u32 = 18;
pub const PSP_NET_APCTL_INFO_SECURITY_TYPE_NONE: u32 = 0;
pub const PSP_NET_APCTL_INFO_SECURITY_TYPE_WEP: u32 = 1;
pub const PSP_NET_APCTL_INFO_SECURITY_TYPE_WPA: u32 = 2;
pub const SOCK_STREAM: u32 = 1;
pub const SOCK_DGRAM: u32 = 2;
pub const SOCK_RAW: u32 = 3;
pub const SOCK_RDM: u32 = 4;
pub const SOCK_SEQPACKET: u32 = 5;
pub const SO_DEBUG: u32 = 1;
pub const SO_ACCEPTCONN: u32 = 2;
pub const SO_REUSEADDR: u32 = 4;
pub const SO_KEEPALIVE: u32 = 8;
pub const SO_DONTROUTE: u32 = 16;
pub const SO_BROADCAST: u32 = 32;
pub const SO_USELOOPBACK: u32 = 64;
pub const SO_LINGER: u32 = 128;
pub const SO_OOBINLINE: u32 = 256;
pub const SO_REUSEPORT: u32 = 512;
pub const SO_TIMESTAMP: u32 = 1024;
pub const SO_SNDBUF: u32 = 4097;
pub const SO_RCVBUF: u32 = 4098;
pub const SO_SNDLOWAT: u32 = 4099;
pub const SO_RCVLOWAT: u32 = 4100;
pub const SO_SNDTIMEO: u32 = 4101;
pub const SO_RCVTIMEO: u32 = 4102;
pub const SO_ERROR: u32 = 4103;
pub const SO_TYPE: u32 = 4104;
pub const SO_OVERFLOWED: u32 = 4105;
pub const SO_NONBLOCK: u32 = 4105;
pub const SOL_SOCKET: u32 = 65535;
pub const AF_UNSPEC: u32 = 0;
pub const AF_LOCAL: u32 = 1;
pub const AF_UNIX: u32 = 1;
pub const AF_INET: u32 = 2;
pub const AF_IMPLINK: u32 = 3;
pub const AF_PUP: u32 = 4;
pub const AF_CHAOS: u32 = 5;
pub const AF_NS: u32 = 6;
pub const AF_ISO: u32 = 7;
pub const AF_OSI: u32 = 7;
pub const AF_ECMA: u32 = 8;
pub const AF_DATAKIT: u32 = 9;
pub const AF_CCITT: u32 = 10;
pub const AF_SNA: u32 = 11;
pub const AF_DECnet: u32 = 12;
pub const AF_DLI: u32 = 13;
pub const AF_LAT: u32 = 14;
pub const AF_HYLINK: u32 = 15;
pub const AF_APPLETALK: u32 = 16;
pub const AF_ROUTE: u32 = 17;
pub const AF_LINK: u32 = 18;
pub const AF_COIP: u32 = 20;
pub const AF_CNT: u32 = 21;
pub const AF_IPX: u32 = 23;
pub const AF_INET6: u32 = 24;
pub const AF_ISDN: u32 = 26;
pub const AF_E164: u32 = 26;
pub const AF_NATM: u32 = 27;
pub const AF_ARP: u32 = 28;
pub const AF_MAX: u32 = 31;
pub const PF_UNSPEC: u32 = 0;
pub const PF_LOCAL: u32 = 1;
pub const PF_UNIX: u32 = 1;
pub const PF_INET: u32 = 2;
pub const PF_IMPLINK: u32 = 3;
pub const PF_PUP: u32 = 4;
pub const PF_CHAOS: u32 = 5;
pub const PF_NS: u32 = 6;
pub const PF_ISO: u32 = 7;
pub const PF_OSI: u32 = 7;
pub const PF_ECMA: u32 = 8;
pub const PF_DATAKIT: u32 = 9;
pub const PF_CCITT: u32 = 10;
pub const PF_SNA: u32 = 11;
pub const PF_DECnet: u32 = 12;
pub const PF_DLI: u32 = 13;
pub const PF_LAT: u32 = 14;
pub const PF_HYLINK: u32 = 15;
pub const PF_APPLETALK: u32 = 16;
pub const PF_ROUTE: u32 = 17;
pub const PF_LINK: u32 = 18;
pub const PF_COIP: u32 = 20;
pub const PF_CNT: u32 = 21;
pub const PF_INET6: u32 = 24;
pub const PF_IPX: u32 = 23;
pub const PF_ISDN: u32 = 26;
pub const PF_E164: u32 = 26;
pub const PF_NATM: u32 = 27;
pub const PF_ARP: u32 = 28;
pub const PF_MAX: u32 = 31;
pub const MSG_OOB: u32 = 1;
pub const MSG_PEEK: u32 = 2;
pub const MSG_DONTROUTE: u32 = 4;
pub const MSG_EOR: u32 = 8;
pub const MSG_TRUNC: u32 = 16;
pub const MSG_CTRUNC: u32 = 32;
pub const MSG_WAITALL: u32 = 64;
pub const MSG_DONTWAIT: u32 = 128;
pub const MSG_BCAST: u32 = 256;
pub const MSG_MCAST: u32 = 512;
pub const SHUT_RD: u32 = 0;
pub const SHUT_WR: u32 = 1;
pub const SHUT_RDWR: u32 = 2;
pub const IPPROTO_IP: u32 = 0;
pub const IPPROTO_HOPOPTS: u32 = 0;
pub const IPPROTO_ICMP: u32 = 1;
pub const IPPROTO_IGMP: u32 = 2;
pub const IPPROTO_GGP: u32 = 3;
pub const IPPROTO_IPV4: u32 = 4;
pub const IPPROTO_IPIP: u32 = 4;
pub const IPPROTO_TCP: u32 = 6;
pub const IPPROTO_EGP: u32 = 8;
pub const IPPROTO_PUP: u32 = 12;
pub const IPPROTO_UDP: u32 = 17;
pub const IPPROTO_IDP: u32 = 22;
pub const IPPROTO_TP: u32 = 29;
pub const IPPROTO_IPV6: u32 = 41;
pub const IPPROTO_ROUTING: u32 = 43;
pub const IPPROTO_FRAGMENT: u32 = 44;
pub const IPPROTO_RSVP: u32 = 46;
pub const IPPROTO_GRE: u32 = 47;
pub const IPPROTO_ESP: u32 = 50;
pub const IPPROTO_AH: u32 = 51;
pub const IPPROTO_MOBILE: u32 = 55;
pub const IPPROTO_IPV6_ICMP: u32 = 58;
pub const IPPROTO_ICMPV6: u32 = 58;
pub const IPPROTO_NONE: u32 = 59;
pub const IPPROTO_DSTOPTS: u32 = 60;
pub const IPPROTO_EON: u32 = 80;
pub const IPPROTO_ETHERIP: u32 = 97;
pub const IPPROTO_ENCAP: u32 = 98;
pub const IPPROTO_PIM: u32 = 103;
pub const IPPROTO_IPCOMP: u32 = 108;
pub const IPPROTO_VRRP: u32 = 112;
pub const IPPROTO_RAW: u32 = 255;
pub const IPPROTO_MAX: u32 = 256;
pub const IPPROTO_DONE: u32 = 257;
pub const CTL_IPPROTO_IPSEC: u32 = 258;
pub const IPPORT_RESERVED: u32 = 1024;
pub const IPPORT_ANONMIN: u32 = 49152;
pub const IPPORT_ANONMAX: u32 = 65535;
pub const IPPORT_RESERVEDMIN: u32 = 600;
pub const IPPORT_RESERVEDMAX: u32 = 1023;
pub const IN_CLASSA_NSHIFT: u32 = 24;
pub const IN_CLASSA_MAX: u32 = 128;
pub const IN_CLASSB_NSHIFT: u32 = 16;
pub const IN_CLASSB_MAX: u32 = 65536;
pub const IN_CLASSC_NSHIFT: u32 = 8;
pub const IN_CLASSD_NSHIFT: u32 = 28;
pub const IN_LOOPBACKNET: u32 = 127;
pub const INET_ADDRSTRLEN: u32 = 16;
pub const IP_OPTIONS: u32 = 1;
pub const IP_HDRINCL: u32 = 2;
pub const IP_TOS: u32 = 3;
pub const IP_TTL: u32 = 4;
pub const IP_RECVOPTS: u32 = 5;
pub const IP_RECVRETOPTS: u32 = 6;
pub const IP_RECVDSTADDR: u32 = 7;
pub const IP_RETOPTS: u32 = 8;
pub const IP_MULTICAST_IF: u32 = 9;
pub const IP_MULTICAST_TTL: u32 = 10;
pub const IP_MULTICAST_LOOP: u32 = 11;
pub const IP_ADD_MEMBERSHIP: u32 = 12;
pub const IP_DROP_MEMBERSHIP: u32 = 13;
pub const IP_PORTRANGE: u32 = 19;
pub const IP_RECVIF: u32 = 20;
pub const IP_ERRORMTU: u32 = 21;
pub const IP_IPSEC_POLICY: u32 = 22;
pub const IP_DEFAULT_MULTICAST_TTL: u32 = 1;
pub const IP_DEFAULT_MULTICAST_LOOP: u32 = 1;
pub const IP_MAX_MEMBERSHIPS: u32 = 20;
pub const IP_PORTRANGE_DEFAULT: u32 = 0;
pub const IP_PORTRANGE_HIGH: u32 = 1;
pub const IP_PORTRANGE_LOW: u32 = 2;
pub const PSP_POWER_CB_POWER_SWITCH: u32 = 2147483648;
pub const PSP_POWER_CB_HOLD_SWITCH: u32 = 1073741824;
pub const PSP_POWER_CB_STANDBY: u32 = 524288;
pub const PSP_POWER_CB_RESUME_COMPLETE: u32 = 262144;
pub const PSP_POWER_CB_RESUMING: u32 = 131072;
pub const PSP_POWER_CB_SUSPENDING: u32 = 65536;
pub const PSP_POWER_CB_AC_POWER: u32 = 4096;
pub const PSP_POWER_CB_BATTERY_LOW: u32 = 256;
pub const PSP_POWER_CB_BATTERY_EXIST: u32 = 128;
pub const PSP_POWER_CB_BATTPOWER: u32 = 127;
pub const PSP_POWER_TICK_ALL: u32 = 0;
pub const PSP_POWER_TICK_SUSPEND: u32 = 1;
pub const PSP_POWER_TICK_DISPLAY: u32 = 6;
pub const SYSTEM_REGISTRY: &'static [u8; 8usize] = b"/system\x00";
pub const REG_KEYNAME_SIZE: u32 = 27;
pub const __GNUC_VA_LIST: u32 = 1;
pub const SCE_LED_POWER: u32 = 1;
pub const LED_ON: u32 = 1;
pub const LED_OFF: u32 = 0;
pub const PSP_USBACC_DRIVERNAME: &'static [u8; 17usize] =
b"USBAccBaseDriver\x00";
pub const PSP_USBCAM_PID: u32 = 642;
pub const PSP_USBCAM_DRIVERNAME: &'static [u8; 13usize] = b"USBCamDriver\x00";
pub const PSP_USBCAMMIC_DRIVERNAME: &'static [u8; 16usize] =
b"USBCamMicDriver\x00";
pub const PSP_USBBUS_DRIVERNAME: &'static [u8; 13usize] = b"USBBusDriver\x00";
pub const PSP_USB_ACTIVATED: u32 = 512;
pub const PSP_USB_CABLE_CONNECTED: u32 = 32;
pub const PSP_USB_CONNECTION_ESTABLISHED: u32 = 2;
pub const PSP_USBSTOR_DRIVERNAME: &'static [u8; 15usize] =
b"USBStor_Driver\x00";
pub const PSP_NETPARAM_NAME: u32 = 0;
pub const PSP_NETPARAM_SSID: u32 = 1;
pub const PSP_NETPARAM_SECURE: u32 = 2;
pub const PSP_NETPARAM_WEPKEY: u32 = 3;
pub const PSP_NETPARAM_IS_STATIC_IP: u32 = 4;
pub const PSP_NETPARAM_IP: u32 = 5;
pub const PSP_NETPARAM_NETMASK: u32 = 6;
pub const PSP_NETPARAM_ROUTE: u32 = 7;
pub const PSP_NETPARAM_MANUAL_DNS: u32 = 8;
pub const PSP_NETPARAM_PRIMARYDNS: u32 = 9;
pub const PSP_NETPARAM_SECONDARYDNS: u32 = 10;
pub const PSP_NETPARAM_PROXY_USER: u32 = 11;
pub const PSP_NETPARAM_PROXY_PASS: u32 = 12;
pub const PSP_NETPARAM_USE_PROXY: u32 = 13;
pub const PSP_NETPARAM_PROXY_SERVER: u32 = 14;
pub const PSP_NETPARAM_PROXY_PORT: u32 = 15;
pub const PSP_NETPARAM_UNKNOWN1: u32 = 16;
pub const PSP_NETPARAM_UNKNOWN2: u32 = 17;
pub const PSP_NETPARAM_ERROR_BAD_NETCONF: u32 = 2148599297;
pub const PSP_NETPARAM_ERROR_BAD_PARAM: u32 = 2148599300;
pub const PSP_SYSTEMPARAM_ID_STRING_NICKNAME: u32 = 1;
pub const PSP_SYSTEMPARAM_ID_INT_ADHOC_CHANNEL: u32 = 2;
pub const PSP_SYSTEMPARAM_ID_INT_WLAN_POWERSAVE: u32 = 3;
pub const PSP_SYSTEMPARAM_ID_INT_DATE_FORMAT: u32 = 4;
pub const PSP_SYSTEMPARAM_ID_INT_TIME_FORMAT: u32 = 5;
pub const PSP_SYSTEMPARAM_ID_INT_TIMEZONE: u32 = 6;
pub const PSP_SYSTEMPARAM_ID_INT_DAYLIGHTSAVINGS: u32 = 7;
pub const PSP_SYSTEMPARAM_ID_INT_LANGUAGE: u32 = 8;
pub const PSP_SYSTEMPARAM_ID_INT_UNKNOWN: u32 = 9;
pub const PSP_SYSTEMPARAM_RETVAL_OK: u32 = 0;
pub const PSP_SYSTEMPARAM_RETVAL_FAIL: u32 = 2148598019;
pub const PSP_SYSTEMPARAM_ADHOC_CHANNEL_AUTOMATIC: u32 = 0;
pub const PSP_SYSTEMPARAM_ADHOC_CHANNEL_1: u32 = 1;
pub const PSP_SYSTEMPARAM_ADHOC_CHANNEL_6: u32 = 6;
pub const PSP_SYSTEMPARAM_ADHOC_CHANNEL_11: u32 = 11;
pub const PSP_SYSTEMPARAM_WLAN_POWERSAVE_OFF: u32 = 0;
pub const PSP_SYSTEMPARAM_WLAN_POWERSAVE_ON: u32 = 1;
pub const PSP_SYSTEMPARAM_DATE_FORMAT_YYYYMMDD: u32 = 0;
pub const PSP_SYSTEMPARAM_DATE_FORMAT_MMDDYYYY: u32 = 1;
pub const PSP_SYSTEMPARAM_DATE_FORMAT_DDMMYYYY: u32 = 2;
pub const PSP_SYSTEMPARAM_TIME_FORMAT_24HR: u32 = 0;
pub const PSP_SYSTEMPARAM_TIME_FORMAT_12HR: u32 = 1;
pub const PSP_SYSTEMPARAM_DAYLIGHTSAVINGS_STD: u32 = 0;
pub const PSP_SYSTEMPARAM_DAYLIGHTSAVINGS_SAVING: u32 = 1;
pub const PSP_SYSTEMPARAM_LANGUAGE_JAPANESE: u32 = 0;
pub const PSP_SYSTEMPARAM_LANGUAGE_ENGLISH: u32 = 1;
pub const PSP_SYSTEMPARAM_LANGUAGE_FRENCH: u32 = 2;
pub const PSP_SYSTEMPARAM_LANGUAGE_SPANISH: u32 = 3;
pub const PSP_SYSTEMPARAM_LANGUAGE_GERMAN: u32 = 4;
pub const PSP_SYSTEMPARAM_LANGUAGE_ITALIAN: u32 = 5;
pub const PSP_SYSTEMPARAM_LANGUAGE_DUTCH: u32 = 6;
pub const PSP_SYSTEMPARAM_LANGUAGE_PORTUGUESE: u32 = 7;
pub const PSP_SYSTEMPARAM_LANGUAGE_RUSSIAN: u32 = 8;
pub const PSP_SYSTEMPARAM_LANGUAGE_KOREAN: u32 = 9;
pub const PSP_SYSTEMPARAM_LANGUAGE_CHINESE_TRADITIONAL: u32 = 10;
pub const PSP_SYSTEMPARAM_LANGUAGE_CHINESE_SIMPLIFIED: u32 = 11;
pub const PSP_NET_MODULE_COMMON: u32 = 1;
pub const PSP_NET_MODULE_ADHOC: u32 = 2;
pub const PSP_NET_MODULE_INET: u32 = 3;
pub const PSP_NET_MODULE_PARSEURI: u32 = 4;
pub const PSP_NET_MODULE_PARSEHTTP: u32 = 5;
pub const PSP_NET_MODULE_HTTP: u32 = 6;
pub const PSP_NET_MODULE_SSL: u32 = 7;
pub const PSP_AV_MODULE_AVCODEC: u32 = 0;
pub const PSP_AV_MODULE_SASCORE: u32 = 1;
pub const PSP_AV_MODULE_ATRAC3PLUS: u32 = 2;
pub const PSP_AV_MODULE_MPEGBASE: u32 = 3;
pub const PSP_AV_MODULE_MP3: u32 = 4;
pub const PSP_AV_MODULE_VAUDIO: u32 = 5;
pub const PSP_AV_MODULE_AAC: u32 = 6;
pub const PSP_AV_MODULE_G729: u32 = 7;
pub const PSP_USB_MODULE_PSPCM: u32 = 1;
pub const PSP_USB_MODULE_ACC: u32 = 2;
pub const PSP_USB_MODULE_MIC: u32 = 3;
pub const PSP_USB_MODULE_CAM: u32 = 4;
pub const PSP_USB_MODULE_GPS: u32 = 5;
pub const PSP_MODULE_NET_COMMON: u32 = 256;
pub const PSP_MODULE_NET_ADHOC: u32 = 257;
pub const PSP_MODULE_NET_INET: u32 = 258;
pub const PSP_MODULE_NET_PARSEURI: u32 = 259;
pub const PSP_MODULE_NET_PARSEHTTP: u32 = 260;
pub const PSP_MODULE_NET_HTTP: u32 = 261;
pub const PSP_MODULE_NET_SSL: u32 = 262;
pub const PSP_MODULE_USB_PSPCM: u32 = 512;
pub const PSP_MODULE_USB_MIC: u32 = 513;
pub const PSP_MODULE_USB_CAM: u32 = 514;
pub const PSP_MODULE_USB_GPS: u32 = 515;
pub const PSP_MODULE_AV_AVCODEC: u32 = 768;
pub const PSP_MODULE_AV_SASCORE: u32 = 769;
pub const PSP_MODULE_AV_ATRAC3PLUS: u32 = 770;
pub const PSP_MODULE_AV_MPEGBASE: u32 = 771;
pub const PSP_MODULE_AV_MP3: u32 = 772;
pub const PSP_MODULE_AV_VAUDIO: u32 = 773;
pub const PSP_MODULE_AV_AAC: u32 = 774;
pub const PSP_MODULE_AV_G729: u32 = 775;
pub const PSP_MODULE_NP_COMMON: u32 = 1024;
pub const PSP_MODULE_NP_SERVICE: u32 = 1025;
pub const PSP_MODULE_NP_MATCHING2: u32 = 1026;
pub const PSP_MODULE_NP_DRM: u32 = 1280;
pub const PSP_MODULE_IRDA: u32 = 1536;
pub const PSP_UTILITY_ACCEPT_CIRCLE: u32 = 0;
pub const PSP_UTILITY_ACCEPT_CROSS: u32 = 1;
pub const VMAT0: u32 = 1;
pub const VMAT1: u32 = 2;
pub const VMAT2: u32 = 4;
pub const VMAT3: u32 = 8;
pub const VMAT4: u32 = 16;
pub const VMAT5: u32 = 32;
pub const VMAT6: u32 = 64;
pub const VMAT7: u32 = 128;
pub type int_least8_t = i8;
pub type uint_least8_t = u8;
pub type int_least16_t = i16;
pub type uint_least16_t = u16;
pub type int_least32_t = i32;
pub type uint_least32_t = u32;
pub type int_least64_t = i64;
pub type uint_least64_t = u64;
pub type int_fast8_t = i32;
pub type uint_fast8_t = u32;
pub type int_fast16_t = i32;
pub type uint_fast16_t = u32;
pub type int_fast32_t = i32;
pub type uint_fast32_t = u32;
pub type int_fast64_t = int_least64_t;
pub type uint_fast64_t = uint_least64_t;
pub type intmax_t = i32;
pub type uintmax_t = u32;
pub type u8 = u8;
pub type u16 = u16;
pub type u32 = u32;
pub type u64 = u64;
pub type s8 = i8;
pub type s16 = i16;
pub type s32 = i32;
pub type s64 = i64;
pub type vu8 = u8;
pub type vu16 = u16;
pub type vu32 = u32;
pub type vu64 = u64;
pub type vs8 = i8;
pub type vs16 = i16;
pub type vs32 = i32;
pub type vs64 = i64;
pub type SceUChar8 = u8;
pub type SceUShort16 = u16;
pub type SceUInt32 = u32;
pub type SceUInt64 = u64;
pub type SceULong64 = u64;
pub type SceChar8 = u8;
pub type SceShort16 = i16;
pub type SceInt32 = i32;
pub type SceInt64 = i64;
pub type SceLong64 = i64;
pub type SceFloat = f32;
pub type SceFloat32 = f32;
pub type SceWChar16 = u16;
pub type SceWChar32 = u32;
pub type SceBool = i32;
pub type SceVoid = c_void;
pub type ScePVoid = *mut c_void;
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ScePspSRect {
pub x: i16,
pub y: i16,
pub w: i16,
pub h: i16,
}
#[test]
fn bindgen_test_layout_ScePspSRect() {
assert_eq!(::core::mem::size_of::<ScePspSRect>() , 8usize , concat ! (
"Size of: " , stringify ! ( ScePspSRect ) ));
assert_eq! (::core::mem::align_of::<ScePspSRect>() , 2usize , concat ! (
"Alignment of " , stringify ! ( ScePspSRect ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspSRect ) ) . x as * const _ as usize
} , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspSRect ) , "::" ,
stringify ! ( x ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspSRect ) ) . y as * const _ as usize
} , 2usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspSRect ) , "::" ,
stringify ! ( y ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspSRect ) ) . w as * const _ as usize
} , 4usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspSRect ) , "::" ,
stringify ! ( w ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspSRect ) ) . h as * const _ as usize
} , 6usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspSRect ) , "::" ,
stringify ! ( h ) ));
}
impl Clone for ScePspSRect {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ScePspIRect {
pub x: i32,
pub y: i32,
pub w: i32,
pub h: i32,
}
#[test]
fn bindgen_test_layout_ScePspIRect() {
assert_eq!(::core::mem::size_of::<ScePspIRect>() , 16usize , concat ! (
"Size of: " , stringify ! ( ScePspIRect ) ));
assert_eq! (::core::mem::align_of::<ScePspIRect>() , 4usize , concat ! (
"Alignment of " , stringify ! ( ScePspIRect ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspIRect ) ) . x as * const _ as usize
} , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspIRect ) , "::" ,
stringify ! ( x ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspIRect ) ) . y as * const _ as usize
} , 4usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspIRect ) , "::" ,
stringify ! ( y ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspIRect ) ) . w as * const _ as usize
} , 8usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspIRect ) , "::" ,
stringify ! ( w ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspIRect ) ) . h as * const _ as usize
} , 12usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspIRect ) , "::" ,
stringify ! ( h ) ));
}
impl Clone for ScePspIRect {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ScePspL64Rect {
pub x: SceLong64,
pub y: SceLong64,
pub w: SceLong64,
pub h: SceLong64,
}
#[test]
fn bindgen_test_layout_ScePspL64Rect() {
assert_eq!(::core::mem::size_of::<ScePspL64Rect>() , 32usize , concat ! (
"Size of: " , stringify ! ( ScePspL64Rect ) ));
assert_eq! (::core::mem::align_of::<ScePspL64Rect>() , 8usize , concat ! (
"Alignment of " , stringify ! ( ScePspL64Rect ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspL64Rect ) ) . x as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspL64Rect ) , "::"
, stringify ! ( x ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspL64Rect ) ) . y as * const _ as
usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspL64Rect ) , "::"
, stringify ! ( y ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspL64Rect ) ) . w as * const _ as
usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspL64Rect ) , "::"
, stringify ! ( w ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspL64Rect ) ) . h as * const _ as
usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspL64Rect ) , "::"
, stringify ! ( h ) ));
}
impl Clone for ScePspL64Rect {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ScePspFRect {
pub x: f32,
pub y: f32,
pub w: f32,
pub h: f32,
}
#[test]
fn bindgen_test_layout_ScePspFRect() {
assert_eq!(::core::mem::size_of::<ScePspFRect>() , 16usize , concat ! (
"Size of: " , stringify ! ( ScePspFRect ) ));
assert_eq! (::core::mem::align_of::<ScePspFRect>() , 4usize , concat ! (
"Alignment of " , stringify ! ( ScePspFRect ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFRect ) ) . x as * const _ as usize
} , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFRect ) , "::" ,
stringify ! ( x ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFRect ) ) . y as * const _ as usize
} , 4usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFRect ) , "::" ,
stringify ! ( y ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFRect ) ) . w as * const _ as usize
} , 8usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFRect ) , "::" ,
stringify ! ( w ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFRect ) ) . h as * const _ as usize
} , 12usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFRect ) , "::" ,
stringify ! ( h ) ));
}
impl Clone for ScePspFRect {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ScePspSVector2 {
pub x: i16,
pub y: i16,
}
#[test]
fn bindgen_test_layout_ScePspSVector2() {
assert_eq!(::core::mem::size_of::<ScePspSVector2>() , 4usize , concat ! (
"Size of: " , stringify ! ( ScePspSVector2 ) ));
assert_eq! (::core::mem::align_of::<ScePspSVector2>() , 2usize , concat !
( "Alignment of " , stringify ! ( ScePspSVector2 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspSVector2 ) ) . x as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspSVector2 ) , "::"
, stringify ! ( x ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspSVector2 ) ) . y as * const _ as
usize } , 2usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspSVector2 ) , "::"
, stringify ! ( y ) ));
}
impl Clone for ScePspSVector2 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ScePspIVector2 {
pub x: i32,
pub y: i32,
}
#[test]
fn bindgen_test_layout_ScePspIVector2() {
assert_eq!(::core::mem::size_of::<ScePspIVector2>() , 8usize , concat ! (
"Size of: " , stringify ! ( ScePspIVector2 ) ));
assert_eq! (::core::mem::align_of::<ScePspIVector2>() , 4usize , concat !
( "Alignment of " , stringify ! ( ScePspIVector2 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspIVector2 ) ) . x as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspIVector2 ) , "::"
, stringify ! ( x ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspIVector2 ) ) . y as * const _ as
usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspIVector2 ) , "::"
, stringify ! ( y ) ));
}
impl Clone for ScePspIVector2 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ScePspL64Vector2 {
pub x: SceLong64,
pub y: SceLong64,
}
#[test]
fn bindgen_test_layout_ScePspL64Vector2() {
assert_eq!(::core::mem::size_of::<ScePspL64Vector2>() , 16usize , concat !
( "Size of: " , stringify ! ( ScePspL64Vector2 ) ));
assert_eq! (::core::mem::align_of::<ScePspL64Vector2>() , 8usize , concat
! ( "Alignment of " , stringify ! ( ScePspL64Vector2 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspL64Vector2 ) ) . x as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspL64Vector2 ) ,
"::" , stringify ! ( x ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspL64Vector2 ) ) . y as * const _ as
usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspL64Vector2 ) ,
"::" , stringify ! ( y ) ));
}
impl Clone for ScePspL64Vector2 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ScePspFVector2 {
pub x: f32,
pub y: f32,
}
#[test]
fn bindgen_test_layout_ScePspFVector2() {
assert_eq!(::core::mem::size_of::<ScePspFVector2>() , 8usize , concat ! (
"Size of: " , stringify ! ( ScePspFVector2 ) ));
assert_eq! (::core::mem::align_of::<ScePspFVector2>() , 4usize , concat !
( "Alignment of " , stringify ! ( ScePspFVector2 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFVector2 ) ) . x as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFVector2 ) , "::"
, stringify ! ( x ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFVector2 ) ) . y as * const _ as
usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFVector2 ) , "::"
, stringify ! ( y ) ));
}
impl Clone for ScePspFVector2 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Copy)]
pub union ScePspVector2 {
pub fv: ScePspFVector2,
pub iv: ScePspIVector2,
pub f: [f32; 2usize],
pub i: [i32; 2usize],
_bindgen_union_align: [u32; 2usize],
}
#[test]
fn bindgen_test_layout_ScePspVector2() {
assert_eq!(::core::mem::size_of::<ScePspVector2>() , 8usize , concat ! (
"Size of: " , stringify ! ( ScePspVector2 ) ));
assert_eq! (::core::mem::align_of::<ScePspVector2>() , 4usize , concat ! (
"Alignment of " , stringify ! ( ScePspVector2 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspVector2 ) ) . fv as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspVector2 ) , "::"
, stringify ! ( fv ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspVector2 ) ) . iv as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspVector2 ) , "::"
, stringify ! ( iv ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspVector2 ) ) . f as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspVector2 ) , "::"
, stringify ! ( f ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspVector2 ) ) . i as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspVector2 ) , "::"
, stringify ! ( i ) ));
}
impl Clone for ScePspVector2 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ScePspSVector3 {
pub x: i16,
pub y: i16,
pub z: i16,
}
#[test]
fn bindgen_test_layout_ScePspSVector3() {
assert_eq!(::core::mem::size_of::<ScePspSVector3>() , 6usize , concat ! (
"Size of: " , stringify ! ( ScePspSVector3 ) ));
assert_eq! (::core::mem::align_of::<ScePspSVector3>() , 2usize , concat !
( "Alignment of " , stringify ! ( ScePspSVector3 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspSVector3 ) ) . x as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspSVector3 ) , "::"
, stringify ! ( x ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspSVector3 ) ) . y as * const _ as
usize } , 2usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspSVector3 ) , "::"
, stringify ! ( y ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspSVector3 ) ) . z as * const _ as
usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspSVector3 ) , "::"
, stringify ! ( z ) ));
}
impl Clone for ScePspSVector3 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ScePspIVector3 {
pub x: i32,
pub y: i32,
pub z: i32,
}
#[test]
fn bindgen_test_layout_ScePspIVector3() {
assert_eq!(::core::mem::size_of::<ScePspIVector3>() , 12usize , concat ! (
"Size of: " , stringify ! ( ScePspIVector3 ) ));
assert_eq! (::core::mem::align_of::<ScePspIVector3>() , 4usize , concat !
( "Alignment of " , stringify ! ( ScePspIVector3 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspIVector3 ) ) . x as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspIVector3 ) , "::"
, stringify ! ( x ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspIVector3 ) ) . y as * const _ as
usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspIVector3 ) , "::"
, stringify ! ( y ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspIVector3 ) ) . z as * const _ as
usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspIVector3 ) , "::"
, stringify ! ( z ) ));
}
impl Clone for ScePspIVector3 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ScePspL64Vector3 {
pub x: SceLong64,
pub y: SceLong64,
pub z: SceLong64,
}
#[test]
fn bindgen_test_layout_ScePspL64Vector3() {
assert_eq!(::core::mem::size_of::<ScePspL64Vector3>() , 24usize , concat !
( "Size of: " , stringify ! ( ScePspL64Vector3 ) ));
assert_eq! (::core::mem::align_of::<ScePspL64Vector3>() , 8usize , concat
! ( "Alignment of " , stringify ! ( ScePspL64Vector3 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspL64Vector3 ) ) . x as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspL64Vector3 ) ,
"::" , stringify ! ( x ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspL64Vector3 ) ) . y as * const _ as
usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspL64Vector3 ) ,
"::" , stringify ! ( y ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspL64Vector3 ) ) . z as * const _ as
usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspL64Vector3 ) ,
"::" , stringify ! ( z ) ));
}
impl Clone for ScePspL64Vector3 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ScePspFVector3 {
pub x: f32,
pub y: f32,
pub z: f32,
}
#[test]
fn bindgen_test_layout_ScePspFVector3() {
assert_eq!(::core::mem::size_of::<ScePspFVector3>() , 12usize , concat ! (
"Size of: " , stringify ! ( ScePspFVector3 ) ));
assert_eq! (::core::mem::align_of::<ScePspFVector3>() , 4usize , concat !
( "Alignment of " , stringify ! ( ScePspFVector3 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFVector3 ) ) . x as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFVector3 ) , "::"
, stringify ! ( x ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFVector3 ) ) . y as * const _ as
usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFVector3 ) , "::"
, stringify ! ( y ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFVector3 ) ) . z as * const _ as
usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFVector3 ) , "::"
, stringify ! ( z ) ));
}
impl Clone for ScePspFVector3 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Copy)]
pub union ScePspVector3 {
pub fv: ScePspFVector3,
pub iv: ScePspIVector3,
pub f: [f32; 3usize],
pub i: [i32; 3usize],
_bindgen_union_align: [u32; 3usize],
}
#[test]
fn bindgen_test_layout_ScePspVector3() {
assert_eq!(::core::mem::size_of::<ScePspVector3>() , 12usize , concat ! (
"Size of: " , stringify ! ( ScePspVector3 ) ));
assert_eq! (::core::mem::align_of::<ScePspVector3>() , 4usize , concat ! (
"Alignment of " , stringify ! ( ScePspVector3 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspVector3 ) ) . fv as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspVector3 ) , "::"
, stringify ! ( fv ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspVector3 ) ) . iv as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspVector3 ) , "::"
, stringify ! ( iv ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspVector3 ) ) . f as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspVector3 ) , "::"
, stringify ! ( f ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspVector3 ) ) . i as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspVector3 ) , "::"
, stringify ! ( i ) ));
}
impl Clone for ScePspVector3 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ScePspSVector4 {
pub x: i16,
pub y: i16,
pub z: i16,
pub w: i16,
}
#[test]
fn bindgen_test_layout_ScePspSVector4() {
assert_eq!(::core::mem::size_of::<ScePspSVector4>() , 8usize , concat ! (
"Size of: " , stringify ! ( ScePspSVector4 ) ));
assert_eq! (::core::mem::align_of::<ScePspSVector4>() , 2usize , concat !
( "Alignment of " , stringify ! ( ScePspSVector4 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspSVector4 ) ) . x as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspSVector4 ) , "::"
, stringify ! ( x ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspSVector4 ) ) . y as * const _ as
usize } , 2usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspSVector4 ) , "::"
, stringify ! ( y ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspSVector4 ) ) . z as * const _ as
usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspSVector4 ) , "::"
, stringify ! ( z ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspSVector4 ) ) . w as * const _ as
usize } , 6usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspSVector4 ) , "::"
, stringify ! ( w ) ));
}
impl Clone for ScePspSVector4 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ScePspIVector4 {
pub x: i32,
pub y: i32,
pub z: i32,
pub w: i32,
}
#[test]
fn bindgen_test_layout_ScePspIVector4() {
assert_eq!(::core::mem::size_of::<ScePspIVector4>() , 16usize , concat ! (
"Size of: " , stringify ! ( ScePspIVector4 ) ));
assert_eq! (::core::mem::align_of::<ScePspIVector4>() , 4usize , concat !
( "Alignment of " , stringify ! ( ScePspIVector4 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspIVector4 ) ) . x as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspIVector4 ) , "::"
, stringify ! ( x ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspIVector4 ) ) . y as * const _ as
usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspIVector4 ) , "::"
, stringify ! ( y ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspIVector4 ) ) . z as * const _ as
usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspIVector4 ) , "::"
, stringify ! ( z ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspIVector4 ) ) . w as * const _ as
usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspIVector4 ) , "::"
, stringify ! ( w ) ));
}
impl Clone for ScePspIVector4 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ScePspL64Vector4 {
pub x: SceLong64,
pub y: SceLong64,
pub z: SceLong64,
pub w: SceLong64,
}
#[test]
fn bindgen_test_layout_ScePspL64Vector4() {
assert_eq!(::core::mem::size_of::<ScePspL64Vector4>() , 32usize , concat !
( "Size of: " , stringify ! ( ScePspL64Vector4 ) ));
assert_eq! (::core::mem::align_of::<ScePspL64Vector4>() , 8usize , concat
! ( "Alignment of " , stringify ! ( ScePspL64Vector4 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspL64Vector4 ) ) . x as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspL64Vector4 ) ,
"::" , stringify ! ( x ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspL64Vector4 ) ) . y as * const _ as
usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspL64Vector4 ) ,
"::" , stringify ! ( y ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspL64Vector4 ) ) . z as * const _ as
usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspL64Vector4 ) ,
"::" , stringify ! ( z ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspL64Vector4 ) ) . w as * const _ as
usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspL64Vector4 ) ,
"::" , stringify ! ( w ) ));
}
impl Clone for ScePspL64Vector4 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ScePspFVector4 {
pub x: f32,
pub y: f32,
pub z: f32,
pub w: f32,
}
#[test]
fn bindgen_test_layout_ScePspFVector4() {
assert_eq!(::core::mem::size_of::<ScePspFVector4>() , 16usize , concat ! (
"Size of: " , stringify ! ( ScePspFVector4 ) ));
assert_eq! (::core::mem::align_of::<ScePspFVector4>() , 4usize , concat !
( "Alignment of " , stringify ! ( ScePspFVector4 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFVector4 ) ) . x as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFVector4 ) , "::"
, stringify ! ( x ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFVector4 ) ) . y as * const _ as
usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFVector4 ) , "::"
, stringify ! ( y ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFVector4 ) ) . z as * const _ as
usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFVector4 ) , "::"
, stringify ! ( z ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFVector4 ) ) . w as * const _ as
usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFVector4 ) , "::"
, stringify ! ( w ) ));
}
impl Clone for ScePspFVector4 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ScePspFVector4Unaligned {
pub x: f32,
pub y: f32,
pub z: f32,
pub w: f32,
}
#[test]
fn bindgen_test_layout_ScePspFVector4Unaligned() {
assert_eq!(::core::mem::size_of::<ScePspFVector4Unaligned>() , 16usize ,
concat ! (
"Size of: " , stringify ! ( ScePspFVector4Unaligned ) ));
assert_eq! (::core::mem::align_of::<ScePspFVector4Unaligned>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( ScePspFVector4Unaligned ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFVector4Unaligned ) ) . x as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFVector4Unaligned
) , "::" , stringify ! ( x ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFVector4Unaligned ) ) . y as *
const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFVector4Unaligned
) , "::" , stringify ! ( y ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFVector4Unaligned ) ) . z as *
const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFVector4Unaligned
) , "::" , stringify ! ( z ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFVector4Unaligned ) ) . w as *
const _ as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFVector4Unaligned
) , "::" , stringify ! ( w ) ));
}
impl Clone for ScePspFVector4Unaligned {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Copy)]
pub union ScePspVector4 {
pub fv: ScePspFVector4,
pub iv: ScePspIVector4,
pub f: [f32; 4usize],
pub i: [i32; 4usize],
_bindgen_union_align: [u8; 16usize],
}
#[test]
fn bindgen_test_layout_ScePspVector4() {
assert_eq!(::core::mem::size_of::<ScePspVector4>() , 16usize , concat ! (
"Size of: " , stringify ! ( ScePspVector4 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspVector4 ) ) . fv as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspVector4 ) , "::"
, stringify ! ( fv ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspVector4 ) ) . iv as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspVector4 ) , "::"
, stringify ! ( iv ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspVector4 ) ) . f as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspVector4 ) , "::"
, stringify ! ( f ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspVector4 ) ) . i as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspVector4 ) , "::"
, stringify ! ( i ) ));
}
impl Clone for ScePspVector4 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ScePspIMatrix2 {
pub x: ScePspIVector2,
pub y: ScePspIVector2,
}
#[test]
fn bindgen_test_layout_ScePspIMatrix2() {
assert_eq!(::core::mem::size_of::<ScePspIMatrix2>() , 16usize , concat ! (
"Size of: " , stringify ! ( ScePspIMatrix2 ) ));
assert_eq! (::core::mem::align_of::<ScePspIMatrix2>() , 4usize , concat !
( "Alignment of " , stringify ! ( ScePspIMatrix2 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspIMatrix2 ) ) . x as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspIMatrix2 ) , "::"
, stringify ! ( x ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspIMatrix2 ) ) . y as * const _ as
usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspIMatrix2 ) , "::"
, stringify ! ( y ) ));
}
impl Clone for ScePspIMatrix2 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ScePspFMatrix2 {
pub x: ScePspFVector2,
pub y: ScePspFVector2,
}
#[test]
fn bindgen_test_layout_ScePspFMatrix2() {
assert_eq!(::core::mem::size_of::<ScePspFMatrix2>() , 16usize , concat ! (
"Size of: " , stringify ! ( ScePspFMatrix2 ) ));
assert_eq! (::core::mem::align_of::<ScePspFMatrix2>() , 4usize , concat !
( "Alignment of " , stringify ! ( ScePspFMatrix2 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFMatrix2 ) ) . x as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFMatrix2 ) , "::"
, stringify ! ( x ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFMatrix2 ) ) . y as * const _ as
usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFMatrix2 ) , "::"
, stringify ! ( y ) ));
}
impl Clone for ScePspFMatrix2 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Copy)]
pub union ScePspMatrix2 {
pub fm: ScePspFMatrix2,
pub im: ScePspIMatrix2,
pub fv: [ScePspFVector2; 2usize],
pub iv: [ScePspIVector2; 2usize],
pub v: [ScePspVector2; 2usize],
pub f: [[f32; 2usize]; 2usize],
pub i: [[i32; 2usize]; 2usize],
_bindgen_union_align: [u32; 4usize],
}
#[test]
fn bindgen_test_layout_ScePspMatrix2() {
assert_eq!(::core::mem::size_of::<ScePspMatrix2>() , 16usize , concat ! (
"Size of: " , stringify ! ( ScePspMatrix2 ) ));
assert_eq! (::core::mem::align_of::<ScePspMatrix2>() , 4usize , concat ! (
"Alignment of " , stringify ! ( ScePspMatrix2 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspMatrix2 ) ) . fm as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspMatrix2 ) , "::"
, stringify ! ( fm ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspMatrix2 ) ) . im as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspMatrix2 ) , "::"
, stringify ! ( im ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspMatrix2 ) ) . fv as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspMatrix2 ) , "::"
, stringify ! ( fv ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspMatrix2 ) ) . iv as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspMatrix2 ) , "::"
, stringify ! ( iv ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspMatrix2 ) ) . v as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspMatrix2 ) , "::"
, stringify ! ( v ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspMatrix2 ) ) . f as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspMatrix2 ) , "::"
, stringify ! ( f ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspMatrix2 ) ) . i as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspMatrix2 ) , "::"
, stringify ! ( i ) ));
}
impl Clone for ScePspMatrix2 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ScePspIMatrix3 {
pub x: ScePspIVector3,
pub y: ScePspIVector3,
pub z: ScePspIVector3,
}
#[test]
fn bindgen_test_layout_ScePspIMatrix3() {
assert_eq!(::core::mem::size_of::<ScePspIMatrix3>() , 36usize , concat ! (
"Size of: " , stringify ! ( ScePspIMatrix3 ) ));
assert_eq! (::core::mem::align_of::<ScePspIMatrix3>() , 4usize , concat !
( "Alignment of " , stringify ! ( ScePspIMatrix3 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspIMatrix3 ) ) . x as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspIMatrix3 ) , "::"
, stringify ! ( x ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspIMatrix3 ) ) . y as * const _ as
usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspIMatrix3 ) , "::"
, stringify ! ( y ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspIMatrix3 ) ) . z as * const _ as
usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspIMatrix3 ) , "::"
, stringify ! ( z ) ));
}
impl Clone for ScePspIMatrix3 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ScePspFMatrix3 {
pub x: ScePspFVector3,
pub y: ScePspFVector3,
pub z: ScePspFVector3,
}
#[test]
fn bindgen_test_layout_ScePspFMatrix3() {
assert_eq!(::core::mem::size_of::<ScePspFMatrix3>() , 36usize , concat ! (
"Size of: " , stringify ! ( ScePspFMatrix3 ) ));
assert_eq! (::core::mem::align_of::<ScePspFMatrix3>() , 4usize , concat !
( "Alignment of " , stringify ! ( ScePspFMatrix3 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFMatrix3 ) ) . x as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFMatrix3 ) , "::"
, stringify ! ( x ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFMatrix3 ) ) . y as * const _ as
usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFMatrix3 ) , "::"
, stringify ! ( y ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFMatrix3 ) ) . z as * const _ as
usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFMatrix3 ) , "::"
, stringify ! ( z ) ));
}
impl Clone for ScePspFMatrix3 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Copy)]
pub union ScePspMatrix3 {
pub fm: ScePspFMatrix3,
pub im: ScePspIMatrix3,
pub fv: [ScePspFVector3; 3usize],
pub iv: [ScePspIVector3; 3usize],
pub v: [ScePspVector3; 3usize],
pub f: [[f32; 3usize]; 3usize],
pub i: [[i32; 3usize]; 3usize],
_bindgen_union_align: [u32; 9usize],
}
#[test]
fn bindgen_test_layout_ScePspMatrix3() {
assert_eq!(::core::mem::size_of::<ScePspMatrix3>() , 36usize , concat ! (
"Size of: " , stringify ! ( ScePspMatrix3 ) ));
assert_eq! (::core::mem::align_of::<ScePspMatrix3>() , 4usize , concat ! (
"Alignment of " , stringify ! ( ScePspMatrix3 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspMatrix3 ) ) . fm as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspMatrix3 ) , "::"
, stringify ! ( fm ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspMatrix3 ) ) . im as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspMatrix3 ) , "::"
, stringify ! ( im ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspMatrix3 ) ) . fv as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspMatrix3 ) , "::"
, stringify ! ( fv ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspMatrix3 ) ) . iv as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspMatrix3 ) , "::"
, stringify ! ( iv ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspMatrix3 ) ) . v as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspMatrix3 ) , "::"
, stringify ! ( v ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspMatrix3 ) ) . f as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspMatrix3 ) , "::"
, stringify ! ( f ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspMatrix3 ) ) . i as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspMatrix3 ) , "::"
, stringify ! ( i ) ));
}
impl Clone for ScePspMatrix3 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ScePspIMatrix4 {
pub x: ScePspIVector4,
pub y: ScePspIVector4,
pub z: ScePspIVector4,
pub w: ScePspIVector4,
}
#[test]
fn bindgen_test_layout_ScePspIMatrix4() {
assert_eq!(::core::mem::size_of::<ScePspIMatrix4>() , 64usize , concat ! (
"Size of: " , stringify ! ( ScePspIMatrix4 ) ));
assert_eq! (::core::mem::align_of::<ScePspIMatrix4>() , 4usize , concat !
( "Alignment of " , stringify ! ( ScePspIMatrix4 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspIMatrix4 ) ) . x as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspIMatrix4 ) , "::"
, stringify ! ( x ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspIMatrix4 ) ) . y as * const _ as
usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspIMatrix4 ) , "::"
, stringify ! ( y ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspIMatrix4 ) ) . z as * const _ as
usize } , 32usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspIMatrix4 ) , "::"
, stringify ! ( z ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspIMatrix4 ) ) . w as * const _ as
usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspIMatrix4 ) , "::"
, stringify ! ( w ) ));
}
impl Clone for ScePspIMatrix4 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ScePspIMatrix4Unaligned {
pub x: ScePspIVector4,
pub y: ScePspIVector4,
pub z: ScePspIVector4,
pub w: ScePspIVector4,
}
#[test]
fn bindgen_test_layout_ScePspIMatrix4Unaligned() {
assert_eq!(::core::mem::size_of::<ScePspIMatrix4Unaligned>() , 64usize ,
concat ! (
"Size of: " , stringify ! ( ScePspIMatrix4Unaligned ) ));
assert_eq! (::core::mem::align_of::<ScePspIMatrix4Unaligned>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( ScePspIMatrix4Unaligned ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspIMatrix4Unaligned ) ) . x as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspIMatrix4Unaligned
) , "::" , stringify ! ( x ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspIMatrix4Unaligned ) ) . y as *
const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspIMatrix4Unaligned
) , "::" , stringify ! ( y ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspIMatrix4Unaligned ) ) . z as *
const _ as usize } , 32usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspIMatrix4Unaligned
) , "::" , stringify ! ( z ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspIMatrix4Unaligned ) ) . w as *
const _ as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspIMatrix4Unaligned
) , "::" , stringify ! ( w ) ));
}
impl Clone for ScePspIMatrix4Unaligned {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ScePspFMatrix4 {
pub x: ScePspFVector4,
pub y: ScePspFVector4,
pub z: ScePspFVector4,
pub w: ScePspFVector4,
}
#[test]
fn bindgen_test_layout_ScePspFMatrix4() {
assert_eq!(::core::mem::size_of::<ScePspFMatrix4>() , 64usize , concat ! (
"Size of: " , stringify ! ( ScePspFMatrix4 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFMatrix4 ) ) . x as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFMatrix4 ) , "::"
, stringify ! ( x ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFMatrix4 ) ) . y as * const _ as
usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFMatrix4 ) , "::"
, stringify ! ( y ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFMatrix4 ) ) . z as * const _ as
usize } , 32usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFMatrix4 ) , "::"
, stringify ! ( z ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFMatrix4 ) ) . w as * const _ as
usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFMatrix4 ) , "::"
, stringify ! ( w ) ));
}
impl Clone for ScePspFMatrix4 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ScePspFMatrix4Unaligned {
pub x: ScePspFVector4,
pub y: ScePspFVector4,
pub z: ScePspFVector4,
pub w: ScePspFVector4,
}
#[test]
fn bindgen_test_layout_ScePspFMatrix4Unaligned() {
assert_eq!(::core::mem::size_of::<ScePspFMatrix4Unaligned>() , 64usize ,
concat ! (
"Size of: " , stringify ! ( ScePspFMatrix4Unaligned ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFMatrix4Unaligned ) ) . x as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFMatrix4Unaligned
) , "::" , stringify ! ( x ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFMatrix4Unaligned ) ) . y as *
const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFMatrix4Unaligned
) , "::" , stringify ! ( y ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFMatrix4Unaligned ) ) . z as *
const _ as usize } , 32usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFMatrix4Unaligned
) , "::" , stringify ! ( z ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFMatrix4Unaligned ) ) . w as *
const _ as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFMatrix4Unaligned
) , "::" , stringify ! ( w ) ));
}
impl Clone for ScePspFMatrix4Unaligned {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Copy)]
pub union ScePspMatrix4 {
pub fm: ScePspFMatrix4,
pub im: ScePspIMatrix4,
pub fv: [ScePspFVector4; 4usize],
pub iv: [ScePspIVector4; 4usize],
pub v: [ScePspVector4; 4usize],
pub f: [[f32; 4usize]; 4usize],
pub i: [[i32; 4usize]; 4usize],
_bindgen_union_align: [u8; 64usize],
}
#[test]
fn bindgen_test_layout_ScePspMatrix4() {
assert_eq!(::core::mem::size_of::<ScePspMatrix4>() , 64usize , concat ! (
"Size of: " , stringify ! ( ScePspMatrix4 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspMatrix4 ) ) . fm as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspMatrix4 ) , "::"
, stringify ! ( fm ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspMatrix4 ) ) . im as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspMatrix4 ) , "::"
, stringify ! ( im ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspMatrix4 ) ) . fv as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspMatrix4 ) , "::"
, stringify ! ( fv ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspMatrix4 ) ) . iv as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspMatrix4 ) , "::"
, stringify ! ( iv ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspMatrix4 ) ) . v as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspMatrix4 ) , "::"
, stringify ! ( v ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspMatrix4 ) ) . f as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspMatrix4 ) , "::"
, stringify ! ( f ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspMatrix4 ) ) . i as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspMatrix4 ) , "::"
, stringify ! ( i ) ));
}
impl Clone for ScePspMatrix4 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ScePspFQuaternion {
pub x: f32,
pub y: f32,
pub z: f32,
pub w: f32,
}
#[test]
fn bindgen_test_layout_ScePspFQuaternion() {
assert_eq!(::core::mem::size_of::<ScePspFQuaternion>() , 16usize , concat
! ( "Size of: " , stringify ! ( ScePspFQuaternion ) ));
assert_eq! (::core::mem::align_of::<ScePspFQuaternion>() , 4usize , concat
! ( "Alignment of " , stringify ! ( ScePspFQuaternion ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFQuaternion ) ) . x as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFQuaternion ) ,
"::" , stringify ! ( x ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFQuaternion ) ) . y as * const _ as
usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFQuaternion ) ,
"::" , stringify ! ( y ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFQuaternion ) ) . z as * const _ as
usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFQuaternion ) ,
"::" , stringify ! ( z ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFQuaternion ) ) . w as * const _ as
usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFQuaternion ) ,
"::" , stringify ! ( w ) ));
}
impl Clone for ScePspFQuaternion {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ScePspFQuaternionUnaligned {
pub x: f32,
pub y: f32,
pub z: f32,
pub w: f32,
}
#[test]
fn bindgen_test_layout_ScePspFQuaternionUnaligned() {
assert_eq!(::core::mem::size_of::<ScePspFQuaternionUnaligned>() , 16usize
, concat ! (
"Size of: " , stringify ! ( ScePspFQuaternionUnaligned ) ));
assert_eq! (::core::mem::align_of::<ScePspFQuaternionUnaligned>() , 4usize
, concat ! (
"Alignment of " , stringify ! ( ScePspFQuaternionUnaligned )
));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFQuaternionUnaligned ) ) . x as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! (
ScePspFQuaternionUnaligned ) , "::" , stringify ! ( x ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFQuaternionUnaligned ) ) . y as *
const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! (
ScePspFQuaternionUnaligned ) , "::" , stringify ! ( y ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFQuaternionUnaligned ) ) . z as *
const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! (
ScePspFQuaternionUnaligned ) , "::" , stringify ! ( z ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFQuaternionUnaligned ) ) . w as *
const _ as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! (
ScePspFQuaternionUnaligned ) , "::" , stringify ! ( w ) ));
}
impl Clone for ScePspFQuaternionUnaligned {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ScePspFColor {
pub r: f32,
pub g: f32,
pub b: f32,
pub a: f32,
}
#[test]
fn bindgen_test_layout_ScePspFColor() {
assert_eq!(::core::mem::size_of::<ScePspFColor>() , 16usize , concat ! (
"Size of: " , stringify ! ( ScePspFColor ) ));
assert_eq! (::core::mem::align_of::<ScePspFColor>() , 4usize , concat ! (
"Alignment of " , stringify ! ( ScePspFColor ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFColor ) ) . r as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFColor ) , "::" ,
stringify ! ( r ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFColor ) ) . g as * const _ as
usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFColor ) , "::" ,
stringify ! ( g ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFColor ) ) . b as * const _ as
usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFColor ) , "::" ,
stringify ! ( b ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFColor ) ) . a as * const _ as
usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFColor ) , "::" ,
stringify ! ( a ) ));
}
impl Clone for ScePspFColor {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ScePspFColorUnaligned {
pub r: f32,
pub g: f32,
pub b: f32,
pub a: f32,
}
#[test]
fn bindgen_test_layout_ScePspFColorUnaligned() {
assert_eq!(::core::mem::size_of::<ScePspFColorUnaligned>() , 16usize ,
concat ! ( "Size of: " , stringify ! ( ScePspFColorUnaligned )
));
assert_eq! (::core::mem::align_of::<ScePspFColorUnaligned>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( ScePspFColorUnaligned ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFColorUnaligned ) ) . r as * const
_ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFColorUnaligned )
, "::" , stringify ! ( r ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFColorUnaligned ) ) . g as * const
_ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFColorUnaligned )
, "::" , stringify ! ( g ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFColorUnaligned ) ) . b as * const
_ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFColorUnaligned )
, "::" , stringify ! ( b ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspFColorUnaligned ) ) . a as * const
_ as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspFColorUnaligned )
, "::" , stringify ! ( a ) ));
}
impl Clone for ScePspFColorUnaligned {
fn clone(&self) -> Self { *self }
}
pub type ScePspRGBA8888 = u32;
pub type ScePspRGBA4444 = u16;
pub type ScePspRGBA5551 = u16;
pub type ScePspRGB565 = u16;
#[repr(C)]
#[derive(Copy)]
pub union ScePspUnion32 {
pub ui: u32,
pub i: i32,
pub us: [u16; 2usize],
pub s: [i16; 2usize],
pub uc: [u8; 4usize],
pub c: [u8; 4usize],
pub f: f32,
pub rgba8888: ScePspRGBA8888,
pub rgba4444: [ScePspRGBA4444; 2usize],
pub rgba5551: [ScePspRGBA5551; 2usize],
pub rgb565: [ScePspRGB565; 2usize],
_bindgen_union_align: u32,
}
#[test]
fn bindgen_test_layout_ScePspUnion32() {
assert_eq!(::core::mem::size_of::<ScePspUnion32>() , 4usize , concat ! (
"Size of: " , stringify ! ( ScePspUnion32 ) ));
assert_eq! (::core::mem::align_of::<ScePspUnion32>() , 4usize , concat ! (
"Alignment of " , stringify ! ( ScePspUnion32 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion32 ) ) . ui as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion32 ) , "::"
, stringify ! ( ui ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion32 ) ) . i as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion32 ) , "::"
, stringify ! ( i ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion32 ) ) . us as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion32 ) , "::"
, stringify ! ( us ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion32 ) ) . s as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion32 ) , "::"
, stringify ! ( s ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion32 ) ) . uc as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion32 ) , "::"
, stringify ! ( uc ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion32 ) ) . c as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion32 ) , "::"
, stringify ! ( c ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion32 ) ) . f as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion32 ) , "::"
, stringify ! ( f ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion32 ) ) . rgba8888 as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion32 ) , "::"
, stringify ! ( rgba8888 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion32 ) ) . rgba4444 as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion32 ) , "::"
, stringify ! ( rgba4444 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion32 ) ) . rgba5551 as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion32 ) , "::"
, stringify ! ( rgba5551 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion32 ) ) . rgb565 as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion32 ) , "::"
, stringify ! ( rgb565 ) ));
}
impl Clone for ScePspUnion32 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Copy)]
pub union ScePspUnion64 {
pub ul: SceULong64,
pub l: SceLong64,
pub ui: [u32; 2usize],
pub i: [i32; 2usize],
pub us: [u16; 4usize],
pub s: [i16; 4usize],
pub uc: [u8; 8usize],
pub c: [u8; 8usize],
pub f: [f32; 2usize],
pub sr: ScePspSRect,
pub sv: ScePspSVector4,
pub rgba8888: [ScePspRGBA8888; 2usize],
pub rgba4444: [ScePspRGBA4444; 4usize],
pub rgba5551: [ScePspRGBA5551; 4usize],
pub rgb565: [ScePspRGB565; 4usize],
_bindgen_union_align: u64,
}
#[test]
fn bindgen_test_layout_ScePspUnion64() {
assert_eq!(::core::mem::size_of::<ScePspUnion64>() , 8usize , concat ! (
"Size of: " , stringify ! ( ScePspUnion64 ) ));
assert_eq! (::core::mem::align_of::<ScePspUnion64>() , 8usize , concat ! (
"Alignment of " , stringify ! ( ScePspUnion64 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion64 ) ) . ul as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion64 ) , "::"
, stringify ! ( ul ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion64 ) ) . l as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion64 ) , "::"
, stringify ! ( l ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion64 ) ) . ui as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion64 ) , "::"
, stringify ! ( ui ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion64 ) ) . i as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion64 ) , "::"
, stringify ! ( i ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion64 ) ) . us as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion64 ) , "::"
, stringify ! ( us ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion64 ) ) . s as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion64 ) , "::"
, stringify ! ( s ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion64 ) ) . uc as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion64 ) , "::"
, stringify ! ( uc ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion64 ) ) . c as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion64 ) , "::"
, stringify ! ( c ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion64 ) ) . f as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion64 ) , "::"
, stringify ! ( f ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion64 ) ) . sr as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion64 ) , "::"
, stringify ! ( sr ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion64 ) ) . sv as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion64 ) , "::"
, stringify ! ( sv ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion64 ) ) . rgba8888 as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion64 ) , "::"
, stringify ! ( rgba8888 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion64 ) ) . rgba4444 as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion64 ) , "::"
, stringify ! ( rgba4444 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion64 ) ) . rgba5551 as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion64 ) , "::"
, stringify ! ( rgba5551 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion64 ) ) . rgb565 as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion64 ) , "::"
, stringify ! ( rgb565 ) ));
}
impl Clone for ScePspUnion64 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Copy)]
pub union ScePspUnion128 {
pub ul: [SceULong64; 2usize],
pub l: [SceLong64; 2usize],
pub ui: [u32; 4usize],
pub i: [i32; 4usize],
pub us: [u16; 8usize],
pub s: [i16; 8usize],
pub uc: [u8; 16usize],
pub c: [u8; 16usize],
pub f: [f32; 4usize],
pub fr: ScePspFRect,
pub ir: ScePspIRect,
pub fv: ScePspFVector4,
pub iv: ScePspIVector4,
pub fq: ScePspFQuaternion,
pub fc: ScePspFColor,
pub rgba8888: [ScePspRGBA8888; 4usize],
pub rgba4444: [ScePspRGBA4444; 8usize],
pub rgba5551: [ScePspRGBA5551; 8usize],
pub rgb565: [ScePspRGB565; 8usize],
_bindgen_union_align: [u8; 16usize],
}
#[test]
fn bindgen_test_layout_ScePspUnion128() {
assert_eq!(::core::mem::size_of::<ScePspUnion128>() , 16usize , concat ! (
"Size of: " , stringify ! ( ScePspUnion128 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion128 ) ) . ul as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
, stringify ! ( ul ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion128 ) ) . l as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
, stringify ! ( l ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion128 ) ) . ui as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
, stringify ! ( ui ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion128 ) ) . i as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
, stringify ! ( i ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion128 ) ) . us as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
, stringify ! ( us ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion128 ) ) . s as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
, stringify ! ( s ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion128 ) ) . uc as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
, stringify ! ( uc ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion128 ) ) . c as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
, stringify ! ( c ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion128 ) ) . f as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
, stringify ! ( f ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion128 ) ) . fr as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
, stringify ! ( fr ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion128 ) ) . ir as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
, stringify ! ( ir ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion128 ) ) . fv as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
, stringify ! ( fv ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion128 ) ) . iv as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
, stringify ! ( iv ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion128 ) ) . fq as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
, stringify ! ( fq ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion128 ) ) . fc as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
, stringify ! ( fc ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion128 ) ) . rgba8888 as * const
_ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
, stringify ! ( rgba8888 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion128 ) ) . rgba4444 as * const
_ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
, stringify ! ( rgba4444 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion128 ) ) . rgba5551 as * const
_ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
, stringify ! ( rgba5551 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspUnion128 ) ) . rgb565 as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspUnion128 ) , "::"
, stringify ! ( rgb565 ) ));
}
impl Clone for ScePspUnion128 {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ScePspDateTime {
pub year: u16,
pub month: u16,
pub day: u16,
pub hour: u16,
pub minute: u16,
pub second: u16,
pub microsecond: u32,
}
#[test]
fn bindgen_test_layout_ScePspDateTime() {
assert_eq!(::core::mem::size_of::<ScePspDateTime>() , 16usize , concat ! (
"Size of: " , stringify ! ( ScePspDateTime ) ));
assert_eq! (::core::mem::align_of::<ScePspDateTime>() , 4usize , concat !
( "Alignment of " , stringify ! ( ScePspDateTime ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspDateTime ) ) . year as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspDateTime ) , "::"
, stringify ! ( year ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspDateTime ) ) . month as * const _
as usize } , 2usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspDateTime ) , "::"
, stringify ! ( month ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspDateTime ) ) . day as * const _ as
usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspDateTime ) , "::"
, stringify ! ( day ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspDateTime ) ) . hour as * const _ as
usize } , 6usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspDateTime ) , "::"
, stringify ! ( hour ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspDateTime ) ) . minute as * const _
as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspDateTime ) , "::"
, stringify ! ( minute ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspDateTime ) ) . second as * const _
as usize } , 10usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspDateTime ) , "::"
, stringify ! ( second ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ScePspDateTime ) ) . microsecond as *
const _ as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( ScePspDateTime ) , "::"
, stringify ! ( microsecond ) ));
}
impl Clone for ScePspDateTime {
fn clone(&self) -> Self { *self }
}
/// UIDs are used to describe many different kernel objects.
pub type SceUID = i32;
pub type SceSize = u32;
pub type SceSSize = i32;
pub type SceUChar = u8;
pub type SceUInt = u32;
pub type SceMode = i32;
pub type SceOff = SceInt64;
pub type SceIores = SceInt64;
#[repr(u32)]
/// Access modes for st_mode in SceIoStat (confirm?).
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum IOAccessModes {
FIO_S_IFMT = 61440,
FIO_S_IFLNK = 16384,
FIO_S_IFDIR = 4096,
FIO_S_IFREG = 8192,
FIO_S_ISUID = 2048,
FIO_S_ISGID = 1024,
FIO_S_ISVTX = 512,
FIO_S_IRWXU = 448,
FIO_S_IRUSR = 256,
FIO_S_IWUSR = 128,
FIO_S_IXUSR = 64,
FIO_S_IRWXG = 56,
FIO_S_IRGRP = 32,
FIO_S_IWGRP = 16,
FIO_S_IXGRP = 8,
FIO_S_IRWXO = 7,
FIO_S_IROTH = 4,
FIO_S_IWOTH = 2,
FIO_S_IXOTH = 1,
}
#[repr(u32)]
/// File modes, used for the st_attr parameter in SceIoStat (confirm?).
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum IOFileModes {
FIO_SO_IFMT = 56,
FIO_SO_IFLNK = 8,
FIO_SO_IFDIR = 16,
FIO_SO_IFREG = 32,
FIO_SO_IROTH = 4,
FIO_SO_IWOTH = 2,
FIO_SO_IXOTH = 1,
}
/// Structure to hold the status information about a file
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceIoStat {
pub st_mode: SceMode,
pub st_attr: u32,
/// Size of the file in bytes.
pub st_size: SceOff,
/// Creation time.
pub st_ctime: ScePspDateTime,
/// Access time.
pub st_atime: ScePspDateTime,
/// Modification time.
pub st_mtime: ScePspDateTime,
/// Device-specific data.
pub st_private: [u32; 6usize],
}
#[test]
fn bindgen_test_layout_SceIoStat() {
assert_eq!(::core::mem::size_of::<SceIoStat>() , 88usize , concat ! (
"Size of: " , stringify ! ( SceIoStat ) ));
assert_eq! (::core::mem::align_of::<SceIoStat>() , 8usize , concat ! (
"Alignment of " , stringify ! ( SceIoStat ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceIoStat ) ) . st_mode as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceIoStat ) , "::" ,
stringify ! ( st_mode ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceIoStat ) ) . st_attr as * const _ as
usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( SceIoStat ) , "::" ,
stringify ! ( st_attr ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceIoStat ) ) . st_size as * const _ as
usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( SceIoStat ) , "::" ,
stringify ! ( st_size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceIoStat ) ) . st_ctime as * const _ as
usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( SceIoStat ) , "::" ,
stringify ! ( st_ctime ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceIoStat ) ) . st_atime as * const _ as
usize } , 32usize , concat ! (
"Alignment of field: " , stringify ! ( SceIoStat ) , "::" ,
stringify ! ( st_atime ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceIoStat ) ) . st_mtime as * const _ as
usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! ( SceIoStat ) , "::" ,
stringify ! ( st_mtime ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceIoStat ) ) . st_private as * const _
as usize } , 64usize , concat ! (
"Alignment of field: " , stringify ! ( SceIoStat ) , "::" ,
stringify ! ( st_private ) ));
}
impl Clone for SceIoStat {
fn clone(&self) -> Self { *self }
}
/// Describes a single directory entry
#[repr(C)]
#[derive(Copy)]
pub struct SceIoDirent {
/// File status.
pub d_stat: SceIoStat,
/// File name.
pub d_name: [u8; 256usize],
/// Device-specific data.
pub d_private: *mut c_void,
pub dummy: i32,
}
#[test]
fn bindgen_test_layout_SceIoDirent() {
assert_eq!(::core::mem::size_of::<SceIoDirent>() , 360usize , concat ! (
"Size of: " , stringify ! ( SceIoDirent ) ));
assert_eq! (::core::mem::align_of::<SceIoDirent>() , 8usize , concat ! (
"Alignment of " , stringify ! ( SceIoDirent ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceIoDirent ) ) . d_stat as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceIoDirent ) , "::" ,
stringify ! ( d_stat ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceIoDirent ) ) . d_name as * const _ as
usize } , 88usize , concat ! (
"Alignment of field: " , stringify ! ( SceIoDirent ) , "::" ,
stringify ! ( d_name ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceIoDirent ) ) . d_private as * const _
as usize } , 344usize , concat ! (
"Alignment of field: " , stringify ! ( SceIoDirent ) , "::" ,
stringify ! ( d_private ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceIoDirent ) ) . dummy as * const _ as
usize } , 352usize , concat ! (
"Alignment of field: " , stringify ! ( SceIoDirent ) , "::" ,
stringify ! ( dummy ) ));
}
impl Clone for SceIoDirent {
fn clone(&self) -> Self { *self }
}
#[repr(u32)]
/// Permission value for the sceIoAssign function
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum IoAssignPerms { IOASSIGN_RDWR = 0, IOASSIGN_RDONLY = 1, }
extern "C" {
/// Open or create a file for reading or writing
///
/// @par Example1: Open a file for reading
/// @code
/// if(!(fd = sceIoOpen("device:/path/to/file", O_RDONLY, 0777)) {
/// // error
/// }
/// @endcode
/// @par Example2: Open a file for writing, creating it if it doesnt exist
/// @code
/// if(!(fd = sceIoOpen("device:/path/to/file", O_WRONLY|O_CREAT, 0777)) {
/// // error
/// }
/// @endcode
///
/// @param file - Pointer to a string holding the name of the file to open
/// @param flags - Libc styled flags that are or'ed together
/// @param mode - File access mode.
/// @return A non-negative integer is a valid fd, anything else an error
pub fn sceIoOpen(file: *const u8, flags: i32, mode: SceMode)
-> SceUID;
}
extern "C" {
/// Open or create a file for reading or writing (asynchronous)
///
/// @param file - Pointer to a string holding the name of the file to open
/// @param flags - Libc styled flags that are or'ed together
/// @param mode - File access mode.
/// @return A non-negative integer is a valid fd, anything else an error
pub fn sceIoOpenAsync(file: *const u8, flags: i32,
mode: SceMode) -> SceUID;
}
extern "C" {
/// Delete a descriptor
///
/// @code
/// sceIoClose(fd);
/// @endcode
///
/// @param fd - File descriptor to close
/// @return < 0 on error
pub fn sceIoClose(fd: SceUID) -> i32;
}
extern "C" {
/// Delete a descriptor (asynchronous)
///
/// @param fd - File descriptor to close
/// @return < 0 on error
pub fn sceIoCloseAsync(fd: SceUID) -> i32;
}
extern "C" {
/// Read input
///
/// @par Example:
/// @code
/// bytes_read = sceIoRead(fd, data, 100);
/// @endcode
///
/// @param fd - Opened file descriptor to read from
/// @param data - Pointer to the buffer where the read data will be placed
/// @param size - Size of the read in bytes
///
/// @return The number of bytes read
pub fn sceIoRead(fd: SceUID, data: *mut c_void, size: SceSize)
-> i32;
}
extern "C" {
/// Read input (asynchronous)
///
/// @par Example:
/// @code
/// bytes_read = sceIoRead(fd, data, 100);
/// @endcode
///
/// @param fd - Opened file descriptor to read from
/// @param data - Pointer to the buffer where the read data will be placed
/// @param size - Size of the read in bytes
///
/// @return < 0 on error.
pub fn sceIoReadAsync(fd: SceUID, data: *mut c_void, size: SceSize)
-> i32;
}
extern "C" {
/// Write output
///
/// @par Example:
/// @code
/// bytes_written = sceIoWrite(fd, data, 100);
/// @endcode
///
/// @param fd - Opened file descriptor to write to
/// @param data - Pointer to the data to write
/// @param size - Size of data to write
///
/// @return The number of bytes written
pub fn sceIoWrite(fd: SceUID, data: *const c_void, size: SceSize)
-> i32;
}
extern "C" {
/// Write output (asynchronous)
///
/// @param fd - Opened file descriptor to write to
/// @param data - Pointer to the data to write
/// @param size - Size of data to write
///
/// @return < 0 on error.
pub fn sceIoWriteAsync(fd: SceUID, data: *const c_void, size: SceSize)
-> i32;
}
extern "C" {
/// Reposition read/write file descriptor offset
///
/// @par Example:
/// @code
/// pos = sceIoLseek(fd, -10, SEEK_END);
/// @endcode
///
/// @param fd - Opened file descriptor with which to seek
/// @param offset - Relative offset from the start position given by whence
/// @param whence - Set to SEEK_SET to seek from the start of the file, SEEK_CUR
/// seek from the current position and SEEK_END to seek from the end.
///
/// @return The position in the file after the seek.
pub fn sceIoLseek(fd: SceUID, offset: SceOff, whence: i32) -> SceOff;
}
extern "C" {
/// Reposition read/write file descriptor offset (asynchronous)
///
/// @param fd - Opened file descriptor with which to seek
/// @param offset - Relative offset from the start position given by whence
/// @param whence - Set to SEEK_SET to seek from the start of the file, SEEK_CUR
/// seek from the current position and SEEK_END to seek from the end.
///
/// @return < 0 on error. Actual value should be passed returned by the ::sceIoWaitAsync call.
pub fn sceIoLseekAsync(fd: SceUID, offset: SceOff, whence: i32)
-> i32;
}
extern "C" {
/// Reposition read/write file descriptor offset (32bit mode)
///
/// @par Example:
/// @code
/// pos = sceIoLseek32(fd, -10, SEEK_END);
/// @endcode
///
/// @param fd - Opened file descriptor with which to seek
/// @param offset - Relative offset from the start position given by whence
/// @param whence - Set to SEEK_SET to seek from the start of the file, SEEK_CUR
/// seek from the current position and SEEK_END to seek from the end.
///
/// @return The position in the file after the seek.
pub fn sceIoLseek32(fd: SceUID, offset: i32, whence: i32)
-> i32;
}
extern "C" {
/// Reposition read/write file descriptor offset (32bit mode, asynchronous)
///
/// @param fd - Opened file descriptor with which to seek
/// @param offset - Relative offset from the start position given by whence
/// @param whence - Set to SEEK_SET to seek from the start of the file, SEEK_CUR
/// seek from the current position and SEEK_END to seek from the end.
///
/// @return < 0 on error.
pub fn sceIoLseek32Async(fd: SceUID, offset: i32, whence: i32)
-> i32;
}
extern "C" {
/// Remove directory entry
///
/// @param file - Path to the file to remove
/// @return < 0 on error
pub fn sceIoRemove(file: *const u8) -> i32;
}
extern "C" {
/// Make a directory file
///
/// @param dir
/// @param mode - Access mode.
/// @return Returns the value 0 if its succesful otherwise -1
pub fn sceIoMkdir(dir: *const u8, mode: SceMode) -> i32;
}
extern "C" {
/// Remove a directory file
///
/// @param path - Removes a directory file pointed by the string path
/// @return Returns the value 0 if its succesful otherwise -1
pub fn sceIoRmdir(path: *const u8) -> i32;
}
extern "C" {
/// Change the current directory.
///
/// @param path - The path to change to.
/// @return < 0 on error.
pub fn sceIoChdir(path: *const u8) -> i32;
}
extern "C" {
/// Change the name of a file
///
/// @param oldname - The old filename
/// @param newname - The new filename
/// @return < 0 on error.
pub fn sceIoRename(oldname: *const u8, newname: *const u8)
-> i32;
}
extern "C" {
/// Open a directory
///
/// @par Example:
/// @code
/// int dfd;
/// dfd = sceIoDopen("device:/");
/// if(dfd >= 0)
/// { Do something with the file descriptor }
/// @endcode
/// @param dirname - The directory to open for reading.
/// @return If >= 0 then a valid file descriptor, otherwise a Sony error code.
pub fn sceIoDopen(dirname: *const u8) -> SceUID;
}
extern "C" {
/// Reads an entry from an opened file descriptor.
///
/// @param fd - Already opened file descriptor (using sceIoDopen)
/// @param dir - Pointer to an io_dirent_t structure to hold the file information
///
/// @return Read status
/// - 0 - No more directory entries left
/// - > 0 - More directory entired to go
/// - < 0 - Error
pub fn sceIoDread(fd: SceUID, dir: *mut SceIoDirent) -> i32;
}
extern "C" {
/// Close an opened directory file descriptor
///
/// @param fd - Already opened file descriptor (using sceIoDopen)
/// @return < 0 on error
pub fn sceIoDclose(fd: SceUID) -> i32;
}
extern "C" {
/// Send a devctl command to a device.
///
/// @par Example: Sending a simple command to a device (not a real devctl)
/// @code
/// sceIoDevctl("ms0:", 0x200000, indata, 4, NULL, NULL);
/// @endcode
///
/// @param dev - String for the device to send the devctl to (e.g. "ms0:")
/// @param cmd - The command to send to the device
/// @param indata - A data block to send to the device, if NULL sends no data
/// @param inlen - Length of indata, if 0 sends no data
/// @param outdata - A data block to receive the result of a command, if NULL receives no data
/// @param outlen - Length of outdata, if 0 receives no data
/// @return 0 on success, < 0 on error
pub fn sceIoDevctl(dev: *const u8, cmd: u32,
indata: *mut c_void, inlen: i32,
outdata: *mut c_void, outlen: i32) -> i32;
}
extern "C" {
/// Assigns one IO device to another (I guess)
/// @param dev1 - The device name to assign.
/// @param dev2 - The block device to assign from.
/// @param dev3 - The filesystem device to mape the block device to dev1
/// @param mode - Read/Write mode. One of IoAssignPerms.
/// @param unk1 - Unknown, set to NULL.
/// @param unk2 - Unknown, set to 0.
/// @return < 0 on error.
///
/// @par Example: Reassign flash0 in read/write mode.
/// @code
/// sceIoUnassign("flash0");
/// sceIoAssign("flash0", "lflash0:0,0", "flashfat0:", IOASSIGN_RDWR, NULL, 0);
/// @endcode
///
pub fn sceIoAssign(dev1: *const u8, dev2: *const u8,
dev3: *const u8, mode: i32,
unk1: *mut c_void, unk2: i32) -> i32;
}
extern "C" {
/// Unassign an IO device.
/// @param dev - The device to unassign.
/// @return < 0 on error
///
/// @par Example: See ::sceIoAssign
pub fn sceIoUnassign(dev: *const u8) -> i32;
}
extern "C" {
/// Get the status of a file.
///
/// @param file - The path to the file.
/// @param stat - A pointer to an io_stat_t structure.
///
/// @return < 0 on error.
pub fn sceIoGetstat(file: *const u8, stat: *mut SceIoStat)
-> i32;
}
extern "C" {
/// Change the status of a file.
///
/// @param file - The path to the file.
/// @param stat - A pointer to an io_stat_t structure.
/// @param bits - Bitmask defining which bits to change.
///
/// @return < 0 on error.
pub fn sceIoChstat(file: *const u8, stat: *mut SceIoStat,
bits: i32) -> i32;
}
extern "C" {
/// Perform an ioctl on a device.
///
/// @param fd - Opened file descriptor to ioctl to
/// @param cmd - The command to send to the device
/// @param indata - A data block to send to the device, if NULL sends no data
/// @param inlen - Length of indata, if 0 sends no data
/// @param outdata - A data block to receive the result of a command, if NULL receives no data
/// @param outlen - Length of outdata, if 0 receives no data
/// @return 0 on success, < 0 on error
pub fn sceIoIoctl(fd: SceUID, cmd: u32, indata: *mut c_void,
inlen: i32, outdata: *mut c_void, outlen: i32)
-> i32;
}
extern "C" {
/// Perform an ioctl on a device. (asynchronous)
///
/// @param fd - Opened file descriptor to ioctl to
/// @param cmd - The command to send to the device
/// @param indata - A data block to send to the device, if NULL sends no data
/// @param inlen - Length of indata, if 0 sends no data
/// @param outdata - A data block to receive the result of a command, if NULL receives no data
/// @param outlen - Length of outdata, if 0 receives no data
/// @return 0 on success, < 0 on error
pub fn sceIoIoctlAsync(fd: SceUID, cmd: u32, indata: *mut c_void,
inlen: i32, outdata: *mut c_void,
outlen: i32) -> i32;
}
extern "C" {
/// Synchronise the file data on the device.
///
/// @param device - The device to synchronise (e.g. msfat0:)
/// @param unk - Unknown
pub fn sceIoSync(device: *const u8, unk: u32) -> i32;
}
extern "C" {
/// Wait for asyncronous completion.
///
/// @param fd - The file descriptor which is current performing an asynchronous action.
/// @param res - The result of the async action.
///
/// @return < 0 on error.
pub fn sceIoWaitAsync(fd: SceUID, res: *mut SceInt64) -> i32;
}
extern "C" {
/// Wait for asyncronous completion (with callbacks).
///
/// @param fd - The file descriptor which is current performing an asynchronous action.
/// @param res - The result of the async action.
///
/// @return < 0 on error.
pub fn sceIoWaitAsyncCB(fd: SceUID, res: *mut SceInt64) -> i32;
}
extern "C" {
/// Poll for asyncronous completion.
///
/// @param fd - The file descriptor which is current performing an asynchronous action.
/// @param res - The result of the async action.
///
/// @return < 0 on error.
pub fn sceIoPollAsync(fd: SceUID, res: *mut SceInt64) -> i32;
}
extern "C" {
/// Get the asyncronous completion status.
///
/// @param fd - The file descriptor which is current performing an asynchronous action.
/// @param poll - If 0 then waits for the status, otherwise it polls the fd.
/// @param res - The result of the async action.
///
/// @return < 0 on error.
pub fn sceIoGetAsyncStat(fd: SceUID, poll: i32, res: *mut SceInt64)
-> i32;
}
extern "C" {
/// Cancel an asynchronous operation on a file descriptor.
///
/// @param fd - The file descriptor to perform cancel on.
///
/// @return < 0 on error.
pub fn sceIoCancel(fd: SceUID) -> i32;
}
extern "C" {
/// Get the device type of the currently opened file descriptor.
///
/// @param fd - The opened file descriptor.
///
/// @return < 0 on error. Otherwise the device type?
pub fn sceIoGetDevType(fd: SceUID) -> i32;
}
extern "C" {
/// Change the priority of the asynchronous thread.
///
/// @param fd - The opened fd on which the priority should be changed.
/// @param pri - The priority of the thread.
///
/// @return < 0 on error.
pub fn sceIoChangeAsyncPriority(fd: SceUID, pri: i32) -> i32;
}
extern "C" {
/// Sets a callback for the asynchronous action.
///
/// @param fd - The filedescriptor currently performing an asynchronous action.
/// @param cb - The UID of the callback created with ::sceKernelCreateCallback
/// @param argp - Pointer to an argument to pass to the callback.
///
/// @return < 0 on error.
pub fn sceIoSetAsyncCallback(fd: SceUID, cb: SceUID, argp: *mut c_void)
-> i32;
}
extern "C" {
/// Register callback
///
/// @note By installing the exit callback the home button becomes active. However if sceKernelExitGame
/// is not called in the callback it is likely that the psp will just crash.
///
/// @par Example:
/// @code
/// int exit_callback(void) { sceKernelExitGame(); }
///
/// cbid = sceKernelCreateCallback("ExitCallback", exit_callback, NULL);
/// sceKernelRegisterExitCallback(cbid);
/// @endcode
///
/// @param cbid Callback id
/// @return < 0 on error
pub fn sceKernelRegisterExitCallback(cbid: i32) -> i32;
}
extern "C" {
/// Exit game and go back to the PSP browser.
///
/// @note You need to be in a thread in order for this function to work
///
pub fn sceKernelExitGame();
}
/// Structure to pass to loadexec
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceKernelLoadExecParam {
/// Size of the structure
pub size: SceSize,
/// Size of the arg string
pub args: SceSize,
/// Pointer to the arg string
pub argp: *mut c_void,
/// Encryption key ?
pub key: *const u8,
}
#[test]
fn bindgen_test_layout_SceKernelLoadExecParam() {
assert_eq!(::core::mem::size_of::<SceKernelLoadExecParam>() , 24usize ,
concat ! ( "Size of: " , stringify ! ( SceKernelLoadExecParam )
));
assert_eq! (::core::mem::align_of::<SceKernelLoadExecParam>() , 8usize ,
concat ! (
"Alignment of " , stringify ! ( SceKernelLoadExecParam ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelLoadExecParam ) ) . size as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelLoadExecParam
) , "::" , stringify ! ( size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelLoadExecParam ) ) . args as *
const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelLoadExecParam
) , "::" , stringify ! ( args ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelLoadExecParam ) ) . argp as *
const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelLoadExecParam
) , "::" , stringify ! ( argp ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelLoadExecParam ) ) . key as *
const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelLoadExecParam
) , "::" , stringify ! ( key ) ));
}
impl Clone for SceKernelLoadExecParam {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// Execute a new game executable, limited when not running in kernel mode.
///
/// @param file - The file to execute.
/// @param param - Pointer to a ::SceKernelLoadExecParam structure, or NULL.
///
/// @return < 0 on error, probably.
///
pub fn sceKernelLoadExec(file: *const u8,
param: *mut SceKernelLoadExecParam) -> i32;
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct _scemoduleinfo {
pub modattribute: u16,
pub modversion: [u8; 2usize],
pub modname: [u8; 27usize],
pub terminal: u8,
pub gp_value: *mut c_void,
pub ent_top: *mut c_void,
pub ent_end: *mut c_void,
pub stub_top: *mut c_void,
pub stub_end: *mut c_void,
}
#[test]
fn bindgen_test_layout__scemoduleinfo() {
assert_eq!(::core::mem::size_of::<_scemoduleinfo>() , 72usize , concat ! (
"Size of: " , stringify ! ( _scemoduleinfo ) ));
assert_eq! (::core::mem::align_of::<_scemoduleinfo>() , 8usize , concat !
( "Alignment of " , stringify ! ( _scemoduleinfo ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _scemoduleinfo ) ) . modattribute as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( _scemoduleinfo ) , "::"
, stringify ! ( modattribute ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _scemoduleinfo ) ) . modversion as *
const _ as usize } , 2usize , concat ! (
"Alignment of field: " , stringify ! ( _scemoduleinfo ) , "::"
, stringify ! ( modversion ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _scemoduleinfo ) ) . modname as * const _
as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( _scemoduleinfo ) , "::"
, stringify ! ( modname ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _scemoduleinfo ) ) . terminal as * const
_ as usize } , 31usize , concat ! (
"Alignment of field: " , stringify ! ( _scemoduleinfo ) , "::"
, stringify ! ( terminal ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _scemoduleinfo ) ) . gp_value as * const
_ as usize } , 32usize , concat ! (
"Alignment of field: " , stringify ! ( _scemoduleinfo ) , "::"
, stringify ! ( gp_value ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _scemoduleinfo ) ) . ent_top as * const _
as usize } , 40usize , concat ! (
"Alignment of field: " , stringify ! ( _scemoduleinfo ) , "::"
, stringify ! ( ent_top ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _scemoduleinfo ) ) . ent_end as * const _
as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! ( _scemoduleinfo ) , "::"
, stringify ! ( ent_end ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _scemoduleinfo ) ) . stub_top as * const
_ as usize } , 56usize , concat ! (
"Alignment of field: " , stringify ! ( _scemoduleinfo ) , "::"
, stringify ! ( stub_top ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _scemoduleinfo ) ) . stub_end as * const
_ as usize } , 64usize , concat ! (
"Alignment of field: " , stringify ! ( _scemoduleinfo ) , "::"
, stringify ! ( stub_end ) ));
}
impl Clone for _scemoduleinfo {
fn clone(&self) -> Self { *self }
}
pub type _sceModuleInfo = _scemoduleinfo;
pub type SceModuleInfo = _sceModuleInfo;
extern "C" {
#[link_name = "_gp"]
pub static mut _gp: [u8; 0usize];
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspModuleInfoAttr {
PSP_MODULE_USER = 0,
PSP_MODULE_NO_STOP = 1,
PSP_MODULE_SINGLE_LOAD = 2,
PSP_MODULE_SINGLE_START = 4,
PSP_MODULE_KERNEL = 4096,
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceKernelLMOption {
pub size: SceSize,
pub mpidtext: SceUID,
pub mpiddata: SceUID,
pub flags: u32,
pub position: u8,
pub access: u8,
pub creserved: [u8; 2usize],
}
#[test]
fn bindgen_test_layout_SceKernelLMOption() {
assert_eq!(::core::mem::size_of::<SceKernelLMOption>() , 20usize , concat
! ( "Size of: " , stringify ! ( SceKernelLMOption ) ));
assert_eq! (::core::mem::align_of::<SceKernelLMOption>() , 4usize , concat
! ( "Alignment of " , stringify ! ( SceKernelLMOption ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelLMOption ) ) . size as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelLMOption ) ,
"::" , stringify ! ( size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelLMOption ) ) . mpidtext as *
const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelLMOption ) ,
"::" , stringify ! ( mpidtext ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelLMOption ) ) . mpiddata as *
const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelLMOption ) ,
"::" , stringify ! ( mpiddata ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelLMOption ) ) . flags as * const
_ as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelLMOption ) ,
"::" , stringify ! ( flags ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelLMOption ) ) . position as *
const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelLMOption ) ,
"::" , stringify ! ( position ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelLMOption ) ) . access as * const
_ as usize } , 17usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelLMOption ) ,
"::" , stringify ! ( access ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelLMOption ) ) . creserved as *
const _ as usize } , 18usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelLMOption ) ,
"::" , stringify ! ( creserved ) ));
}
impl Clone for SceKernelLMOption {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceKernelSMOption {
pub size: SceSize,
pub mpidstack: SceUID,
pub stacksize: SceSize,
pub priority: i32,
pub attribute: u32,
}
#[test]
fn bindgen_test_layout_SceKernelSMOption() {
assert_eq!(::core::mem::size_of::<SceKernelSMOption>() , 20usize , concat
! ( "Size of: " , stringify ! ( SceKernelSMOption ) ));
assert_eq! (::core::mem::align_of::<SceKernelSMOption>() , 4usize , concat
! ( "Alignment of " , stringify ! ( SceKernelSMOption ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelSMOption ) ) . size as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelSMOption ) ,
"::" , stringify ! ( size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelSMOption ) ) . mpidstack as *
const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelSMOption ) ,
"::" , stringify ! ( mpidstack ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelSMOption ) ) . stacksize as *
const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelSMOption ) ,
"::" , stringify ! ( stacksize ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelSMOption ) ) . priority as *
const _ as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelSMOption ) ,
"::" , stringify ! ( priority ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelSMOption ) ) . attribute as *
const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelSMOption ) ,
"::" , stringify ! ( attribute ) ));
}
impl Clone for SceKernelSMOption {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// Load a module.
/// @note This function restricts where it can load from (such as from flash0)
/// unless you call it in kernel mode. It also must be called from a thread.
///
/// @param path - The path to the module to load.
/// @param flags - Unused, always 0 .
/// @param option - Pointer to a mod_param_t structure. Can be NULL.
///
/// @return The UID of the loaded module on success, otherwise one of ::PspKernelErrorCodes.
pub fn sceKernelLoadModule(path: *const u8, flags: i32,
option: *mut SceKernelLMOption) -> SceUID;
}
extern "C" {
/// Load a module from MS.
/// @note This function restricts what it can load, e.g. it wont load plain executables.
///
/// @param path - The path to the module to load.
/// @param flags - Unused, set to 0.
/// @param option - Pointer to a mod_param_t structure. Can be NULL.
///
/// @return The UID of the loaded module on success, otherwise one of ::PspKernelErrorCodes.
pub fn sceKernelLoadModuleMs(path: *const u8, flags: i32,
option: *mut SceKernelLMOption) -> SceUID;
}
extern "C" {
/// Load a module from the given file UID.
///
/// @param fid - The module's file UID.
/// @param flags - Unused, always 0.
/// @param option - Pointer to an optional ::SceKernelLMOption structure.
///
/// @return The UID of the loaded module on success, otherwise one of ::PspKernelErrorCodes.
pub fn sceKernelLoadModuleByID(fid: SceUID, flags: i32,
option: *mut SceKernelLMOption) -> SceUID;
}
extern "C" {
/// Load a module from a buffer using the USB/WLAN API.
///
/// Can only be called from kernel mode, or from a thread that has attributes of 0xa0000000.
///
/// @param bufsize - Size (in bytes) of the buffer pointed to by buf.
/// @param buf - Pointer to a buffer containing the module to load. The buffer must reside at an
/// address that is a multiple to 64 bytes.
/// @param flags - Unused, always 0.
/// @param option - Pointer to an optional ::SceKernelLMOption structure.
///
/// @return The UID of the loaded module on success, otherwise one of ::PspKernelErrorCodes.
pub fn sceKernelLoadModuleBufferUsbWlan(bufsize: SceSize,
buf: *mut c_void,
flags: i32,
option: *mut SceKernelLMOption)
-> SceUID;
}
extern "C" {
/// Start a loaded module.
///
/// @param modid - The ID of the module returned from LoadModule.
/// @param argsize - Length of the args.
/// @param argp - A pointer to the arguments to the module.
/// @param status - Returns the status of the start.
/// @param option - Pointer to an optional ::SceKernelSMOption structure.
///
/// @return ??? on success, otherwise one of ::PspKernelErrorCodes.
pub fn sceKernelStartModule(modid: SceUID, argsize: SceSize,
argp: *mut c_void, status: *mut i32,
option: *mut SceKernelSMOption) -> i32;
}
extern "C" {
/// Stop a running module.
///
/// @param modid - The UID of the module to stop.
/// @param argsize - The length of the arguments pointed to by argp.
/// @param argp - Pointer to arguments to pass to the module's module_stop() routine.
/// @param status - Return value of the module's module_stop() routine.
/// @param option - Pointer to an optional ::SceKernelSMOption structure.
///
/// @return ??? on success, otherwise one of ::PspKernelErrorCodes.
pub fn sceKernelStopModule(modid: SceUID, argsize: SceSize,
argp: *mut c_void, status: *mut i32,
option: *mut SceKernelSMOption) -> i32;
}
extern "C" {
/// Unload a stopped module.
///
/// @param modid - The UID of the module to unload.
///
/// @return ??? on success, otherwise one of ::PspKernelErrorCodes.
pub fn sceKernelUnloadModule(modid: SceUID) -> i32;
}
extern "C" {
/// Stop and unload the current module.
///
/// @param unknown - Unknown (I've seen 1 passed).
/// @param argsize - Size (in bytes) of the arguments that will be passed to module_stop().
/// @param argp - Pointer to arguments that will be passed to module_stop().
///
/// @return ??? on success, otherwise one of ::PspKernelErrorCodes.
pub fn sceKernelSelfStopUnloadModule(unknown: i32, argsize: SceSize,
argp: *mut c_void) -> i32;
}
extern "C" {
/// Stop and unload the current module.
///
/// @param argsize - Size (in bytes) of the arguments that will be passed to module_stop().
/// @param argp - Poitner to arguments that will be passed to module_stop().
/// @param status - Return value from module_stop().
/// @param option - Pointer to an optional ::SceKernelSMOption structure.
///
/// @return ??? on success, otherwise one of ::PspKernelErrorCodes.
pub fn sceKernelStopUnloadSelfModule(argsize: SceSize,
argp: *mut c_void,
status: *mut i32,
option: *mut SceKernelSMOption)
-> i32;
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceKernelModuleInfo {
pub size: SceSize,
pub nsegment: u8,
pub reserved: [u8; 3usize],
pub segmentaddr: [i32; 4usize],
pub segmentsize: [i32; 4usize],
pub entry_addr: u32,
pub gp_value: u32,
pub text_addr: u32,
pub text_size: u32,
pub data_size: u32,
pub bss_size: u32,
pub attribute: u16,
pub version: [u8; 2usize],
pub name: [u8; 28usize],
}
#[test]
fn bindgen_test_layout_SceKernelModuleInfo() {
assert_eq!(::core::mem::size_of::<SceKernelModuleInfo>() , 96usize ,
concat ! ( "Size of: " , stringify ! ( SceKernelModuleInfo )
));
assert_eq! (::core::mem::align_of::<SceKernelModuleInfo>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( SceKernelModuleInfo ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelModuleInfo ) ) . size as * const
_ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelModuleInfo ) ,
"::" , stringify ! ( size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelModuleInfo ) ) . nsegment as *
const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelModuleInfo ) ,
"::" , stringify ! ( nsegment ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelModuleInfo ) ) . reserved as *
const _ as usize } , 5usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelModuleInfo ) ,
"::" , stringify ! ( reserved ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelModuleInfo ) ) . segmentaddr as
* const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelModuleInfo ) ,
"::" , stringify ! ( segmentaddr ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelModuleInfo ) ) . segmentsize as
* const _ as usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelModuleInfo ) ,
"::" , stringify ! ( segmentsize ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelModuleInfo ) ) . entry_addr as *
const _ as usize } , 40usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelModuleInfo ) ,
"::" , stringify ! ( entry_addr ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelModuleInfo ) ) . gp_value as *
const _ as usize } , 44usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelModuleInfo ) ,
"::" , stringify ! ( gp_value ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelModuleInfo ) ) . text_addr as *
const _ as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelModuleInfo ) ,
"::" , stringify ! ( text_addr ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelModuleInfo ) ) . text_size as *
const _ as usize } , 52usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelModuleInfo ) ,
"::" , stringify ! ( text_size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelModuleInfo ) ) . data_size as *
const _ as usize } , 56usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelModuleInfo ) ,
"::" , stringify ! ( data_size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelModuleInfo ) ) . bss_size as *
const _ as usize } , 60usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelModuleInfo ) ,
"::" , stringify ! ( bss_size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelModuleInfo ) ) . attribute as *
const _ as usize } , 64usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelModuleInfo ) ,
"::" , stringify ! ( attribute ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelModuleInfo ) ) . version as *
const _ as usize } , 66usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelModuleInfo ) ,
"::" , stringify ! ( version ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelModuleInfo ) ) . name as * const
_ as usize } , 68usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelModuleInfo ) ,
"::" , stringify ! ( name ) ));
}
impl Clone for SceKernelModuleInfo {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// Query the information about a loaded module from its UID.
/// @note This fails on v1.0 firmware (and even it worked has a limited structure)
/// so if you want to be compatible with both 1.5 and 1.0 (and you are running in
/// kernel mode) then call this function first then ::pspSdkQueryModuleInfoV1
/// if it fails, or make separate v1 and v1.5+ builds.
///
/// @param modid - The UID of the loaded module.
/// @param info - Pointer to a ::SceKernelModuleInfo structure.
///
/// @return 0 on success, otherwise one of ::PspKernelErrorCodes.
pub fn sceKernelQueryModuleInfo(modid: SceUID,
info: *mut SceKernelModuleInfo)
-> i32;
}
extern "C" {
/// Get a list of module IDs. NOTE: This is only available on 1.5 firmware
/// and above. For V1 use ::pspSdkGetModuleIdList.
///
/// @param readbuf - Buffer to store the module list.
/// @param readbufsize - Number of elements in the readbuffer.
/// @param idcount - Returns the number of module ids
///
/// @return >= 0 on success
pub fn sceKernelGetModuleIdList(readbuf: *mut SceUID,
readbufsize: i32,
idcount: *mut i32) -> i32;
}
#[repr(u32)]
/// Specifies the type of allocation used for memory blocks.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspSysMemBlockTypes {
PSP_SMEM_Low = 0,
PSP_SMEM_High = 1,
PSP_SMEM_Addr = 2,
}
pub type SceKernelSysMemAlloc_t = i32;
extern "C" {
/// Allocate a memory block from a memory partition.
///
/// @param partitionid - The UID of the partition to allocate from.
/// @param name - Name assigned to the new block.
/// @param type - Specifies how the block is allocated within the partition. One of ::PspSysMemBlockTypes.
/// @param size - Size of the memory block, in bytes.
/// @param addr - If type is PSP_SMEM_Addr, then addr specifies the lowest address allocate the block from.
///
/// @return The UID of the new block, or if less than 0 an error.
pub fn sceKernelAllocPartitionMemory(partitionid: SceUID,
name: *const u8,
type_: i32, size: SceSize,
addr: *mut c_void) -> SceUID;
}
extern "C" {
/// Free a memory block allocated with ::sceKernelAllocPartitionMemory.
///
/// @param blockid - UID of the block to free.
///
/// @return ? on success, less than 0 on error.
pub fn sceKernelFreePartitionMemory(blockid: SceUID) -> i32;
}
extern "C" {
/// Get the address of a memory block.
///
/// @param blockid - UID of the memory block.
///
/// @return The lowest address belonging to the memory block.
pub fn sceKernelGetBlockHeadAddr(blockid: SceUID) -> *mut c_void;
}
extern "C" {
/// Get the total amount of free memory.
///
/// @return The total amount of free memory, in bytes.
pub fn sceKernelTotalFreeMemSize() -> SceSize;
}
extern "C" {
/// Get the size of the largest free memory block.
///
/// @return The size of the largest free memory block, in bytes.
pub fn sceKernelMaxFreeMemSize() -> SceSize;
}
extern "C" {
/// Get the firmware version.
///
/// @return The firmware version.
/// 0x01000300 on v1.00 unit,
/// 0x01050001 on v1.50 unit,
/// 0x01050100 on v1.51 unit,
/// 0x01050200 on v1.52 unit,
/// 0x02000010 on v2.00/v2.01 unit,
/// 0x02050010 on v2.50 unit,
/// 0x02060010 on v2.60 unit,
/// 0x02070010 on v2.70 unit,
/// 0x02070110 on v2.71 unit.
pub fn sceKernelDevkitVersion() -> i32;
}
extern "C" {
/// Set the version of the SDK with which the caller was compiled.
/// Version numbers are as for sceKernelDevkitVersion().
///
/// @return 0 on success, < 0 on error.
pub fn sceKernelSetCompiledSdkVersion(version: i32) -> i32;
}
extern "C" {
/// Get the SDK version set with sceKernelSetCompiledSdkVersion().
///
/// @return Version number, or 0 if unset.
pub fn sceKernelGetCompiledSdkVersion() -> i32;
}
extern "C" {
/// Initialise the debug screen
pub fn pspDebugScreenInit();
}
extern "C" {
/// Extended debug screen init
///
/// @param vram_base - Base address of frame buffer, if NULL then sets a default
/// @param mode - Colour mode
/// @param setup - Setup the screen if 1
pub fn pspDebugScreenInitEx(vram_base: *mut c_void, mode: i32,
setup: i32);
}
extern "C" {
/// Do a printf to the debug screen.
///
/// @param fmt - Format string to print
/// @param ... - Arguments
pub fn pspDebugScreenPrintf(fmt: *const u8, ...);
}
extern "C" {
/// Do a printf to the debug screen.
/// @note This is for kernel mode only as it uses a kernel function
/// to perform the printf instead of using vsnprintf, use normal printf for
/// user mode.
///
/// @param format - Format string to print
/// @param ... - Arguments
pub fn pspDebugScreenKprintf(format: *const u8, ...);
}
extern "C" {
/// Enable or disable background colour writing (defaults to enabled)
///
/// @param enable - Set 1 to to enable background color, 0 for disable
pub fn pspDebugScreenEnableBackColor(enable: i32);
}
extern "C" {
/// Set the background color for the text
/// @note To reset the entire screens bg colour you need to call pspDebugScreenClear
///
/// @param color - A 32bit RGB colour
pub fn pspDebugScreenSetBackColor(color: u32);
}
extern "C" {
/// Set the text color
///
/// @param color - A 32 bit RGB color
pub fn pspDebugScreenSetTextColor(color: u32);
}
extern "C" {
/// Set the color mode (you must have switched the frame buffer appropriately)
///
/// @param mode - Color mode
pub fn pspDebugScreenSetColorMode(mode: i32);
}
extern "C" {
/// Draw a single character to the screen.
///
/// @param x - The x co-ordinate to draw to (pixel units)
/// @param y - The y co-ordinate to draw to (pixel units)
/// @param color - The text color to draw
/// @param ch - The character to draw
pub fn pspDebugScreenPutChar(x: i32, y: i32, color: u32, ch: u8);
}
extern "C" {
/// Set the current X and Y co-ordinate for the screen (in character units)
pub fn pspDebugScreenSetXY(x: i32, y: i32);
}
extern "C" {
/// Set the video ram offset used for the screen
///
/// @param offset - Offset in bytes
pub fn pspDebugScreenSetOffset(offset: i32);
}
extern "C" {
/// Set the video ram base used for the screen
///
/// @param base - Base address in bytes
pub fn pspDebugScreenSetBase(base: *mut u32);
}
extern "C" {
/// Get the current X co-ordinate (in character units)
///
/// @return The X co-ordinate
pub fn pspDebugScreenGetX() -> i32;
}
extern "C" {
/// Get the current Y co-ordinate (in character units)
///
/// @return The Y co-ordinate
pub fn pspDebugScreenGetY() -> i32;
}
extern "C" {
/// Clear the debug screen.
pub fn pspDebugScreenClear();
}
extern "C" {
/// Print non-nul terminated strings.
///
/// @param buff - Buffer containing the text.
/// @param size - Size of the data
///
/// @return The number of characters written
pub fn pspDebugScreenPrintData(buff: *const u8, size: i32)
-> i32;
}
extern "C" {
/// Print a string
///
/// @param str - String
///
/// @return The number of characters written
pub fn pspDebugScreenPuts(str: *const u8) -> i32;
}
extern "C" {
/// Get a MIPS stack trace (might work :P)
///
/// @param results - List of points to store the results of the trace, (up to max)
/// @param max - Maximum number of back traces
///
/// @return The number of frames stored in results.
pub fn pspDebugGetStackTrace(results: *mut u32, max: i32)
-> i32;
}
extern "C" {
/// Enable the clear line function that allows debug to clear the screen
pub fn pspDebugScreenClearLineEnable();
}
extern "C" {
/// Disable the clear line function that causes flicker on constant refreshes
pub fn pspDebugScreenClearLineDisable();
}
/// Structure to hold the register data associated with an exception
#[repr(C)]
#[derive(Copy)]
pub struct _PspDebugRegBlock {
pub frame: [u32; 6usize],
/// Array of the 32 GPRs
pub r: [u32; 32usize],
/// The status register
pub status: u32,
/// lo
pub lo: u32,
pub hi: u32,
pub badvaddr: u32,
pub cause: u32,
pub epc: u32,
pub fpr: [f32; 32usize],
pub fsr: u32,
pub fir: u32,
pub frame_ptr: u32,
pub unused: u32,
pub index: u32,
pub random: u32,
pub entrylo0: u32,
pub entrylo1: u32,
pub context: u32,
pub pagemask: u32,
pub wired: u32,
pub cop0_7: u32,
pub cop0_8: u32,
pub cop0_9: u32,
pub entryhi: u32,
pub cop0_11: u32,
pub cop0_12: u32,
pub cop0_13: u32,
pub cop0_14: u32,
pub prid: u32,
pub padding: [u32; 100usize],
}
#[test]
fn bindgen_test_layout__PspDebugRegBlock() {
assert_eq!(::core::mem::size_of::<_PspDebugRegBlock>() , 784usize , concat
! ( "Size of: " , stringify ! ( _PspDebugRegBlock ) ));
assert_eq! (::core::mem::align_of::<_PspDebugRegBlock>() , 4usize , concat
! ( "Alignment of " , stringify ! ( _PspDebugRegBlock ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugRegBlock ) ) . frame as * const
_ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
"::" , stringify ! ( frame ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugRegBlock ) ) . r as * const _ as
usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
"::" , stringify ! ( r ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugRegBlock ) ) . status as * const
_ as usize } , 152usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
"::" , stringify ! ( status ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugRegBlock ) ) . lo as * const _
as usize } , 156usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
"::" , stringify ! ( lo ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugRegBlock ) ) . hi as * const _
as usize } , 160usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
"::" , stringify ! ( hi ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugRegBlock ) ) . badvaddr as *
const _ as usize } , 164usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
"::" , stringify ! ( badvaddr ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugRegBlock ) ) . cause as * const
_ as usize } , 168usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
"::" , stringify ! ( cause ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugRegBlock ) ) . epc as * const _
as usize } , 172usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
"::" , stringify ! ( epc ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugRegBlock ) ) . fpr as * const _
as usize } , 176usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
"::" , stringify ! ( fpr ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugRegBlock ) ) . fsr as * const _
as usize } , 304usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
"::" , stringify ! ( fsr ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugRegBlock ) ) . fir as * const _
as usize } , 308usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
"::" , stringify ! ( fir ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugRegBlock ) ) . frame_ptr as *
const _ as usize } , 312usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
"::" , stringify ! ( frame_ptr ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugRegBlock ) ) . unused as * const
_ as usize } , 316usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
"::" , stringify ! ( unused ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugRegBlock ) ) . index as * const
_ as usize } , 320usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
"::" , stringify ! ( index ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugRegBlock ) ) . random as * const
_ as usize } , 324usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
"::" , stringify ! ( random ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugRegBlock ) ) . entrylo0 as *
const _ as usize } , 328usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
"::" , stringify ! ( entrylo0 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugRegBlock ) ) . entrylo1 as *
const _ as usize } , 332usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
"::" , stringify ! ( entrylo1 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugRegBlock ) ) . context as *
const _ as usize } , 336usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
"::" , stringify ! ( context ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugRegBlock ) ) . pagemask as *
const _ as usize } , 340usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
"::" , stringify ! ( pagemask ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugRegBlock ) ) . wired as * const
_ as usize } , 344usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
"::" , stringify ! ( wired ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugRegBlock ) ) . cop0_7 as * const
_ as usize } , 348usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
"::" , stringify ! ( cop0_7 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugRegBlock ) ) . cop0_8 as * const
_ as usize } , 352usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
"::" , stringify ! ( cop0_8 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugRegBlock ) ) . cop0_9 as * const
_ as usize } , 356usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
"::" , stringify ! ( cop0_9 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugRegBlock ) ) . entryhi as *
const _ as usize } , 360usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
"::" , stringify ! ( entryhi ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugRegBlock ) ) . cop0_11 as *
const _ as usize } , 364usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
"::" , stringify ! ( cop0_11 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugRegBlock ) ) . cop0_12 as *
const _ as usize } , 368usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
"::" , stringify ! ( cop0_12 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugRegBlock ) ) . cop0_13 as *
const _ as usize } , 372usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
"::" , stringify ! ( cop0_13 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugRegBlock ) ) . cop0_14 as *
const _ as usize } , 376usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
"::" , stringify ! ( cop0_14 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugRegBlock ) ) . prid as * const _
as usize } , 380usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
"::" , stringify ! ( prid ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugRegBlock ) ) . padding as *
const _ as usize } , 384usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugRegBlock ) ,
"::" , stringify ! ( padding ) ));
}
impl Clone for _PspDebugRegBlock {
fn clone(&self) -> Self { *self }
}
/// Structure to hold the register data associated with an exception
pub type PspDebugRegBlock = _PspDebugRegBlock;
/// Defines a debug error handler
pub type PspDebugErrorHandler =
::core::option::Option<unsafe extern "C" fn(regs: *mut PspDebugRegBlock)>;
extern "C" {
/// Install an error handler to catch unhandled exceptions.
///
/// @param handler - Pointer to a handler function. If set to NULL it will default
/// to resetting the screen and dumping the error.
/// @return < 0 on error
pub fn pspDebugInstallErrorHandler(handler: PspDebugErrorHandler)
-> i32;
}
extern "C" {
/// Dump an exception to screen using the pspDebugScreen functions.
/// @note This function will not setup the screen for debug output, you should call sceDebugScreenInit
/// before using it if it isn't already.
///
/// @param regs - Pointer to a register block.
///
pub fn pspDebugDumpException(regs: *mut PspDebugRegBlock);
}
/// Type for Kprintf handler
pub type PspDebugKprintfHandler =
::core::option::Option<unsafe extern "C" fn(format: *const u8,
args: *mut u32) -> i32>;
extern "C" {
/// Install a Kprintf handler into the system.
///
/// @param handler - Function pointer to the handler.
/// @return < 0 on error.
pub fn pspDebugInstallKprintfHandler(handler: PspDebugKprintfHandler)
-> i32;
}
/// Structure to hold a single stack trace entry
#[repr(C)]
#[derive(Debug, Copy)]
pub struct _PspDebugStackTrace {
/// The address which called the function
pub call_addr: u32,
/// The address of the function called
pub func_addr: u32,
}
#[test]
fn bindgen_test_layout__PspDebugStackTrace() {
assert_eq!(::core::mem::size_of::<_PspDebugStackTrace>() , 8usize , concat
! ( "Size of: " , stringify ! ( _PspDebugStackTrace ) ));
assert_eq! (::core::mem::align_of::<_PspDebugStackTrace>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( _PspDebugStackTrace ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugStackTrace ) ) . call_addr as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugStackTrace ) ,
"::" , stringify ! ( call_addr ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugStackTrace ) ) . func_addr as *
const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugStackTrace ) ,
"::" , stringify ! ( func_addr ) ));
}
impl Clone for _PspDebugStackTrace {
fn clone(&self) -> Self { *self }
}
/// Structure to hold a single stack trace entry
pub type PspDebugStackTrace = _PspDebugStackTrace;
extern "C" {
/// Do a stack trace from the current exception.
/// @note This function really isn't too general purpose and it is more than likely to generate a few
/// false positives but I consider that better then missing out calls entirely. You have to use your
/// discretion, your code and a objdump to work out if some calls are completely surprious or not ;)
///
/// @param regs - Pointer to a register block from an exception.
/// @param trace - Pointer to an array of PspDebugStackTrace structures.
/// @param max - The maximum number of traces to make.
///
/// @return The number of functions found.
pub fn pspDebugGetStackTrace2(regs: *mut PspDebugRegBlock,
trace: *mut PspDebugStackTrace,
max: i32) -> i32;
}
/// Structure to hold the psp profiler register values
#[repr(C)]
#[derive(Debug, Copy)]
pub struct _PspDebugProfilerRegs {
pub enable: u32,
pub systemck: u32,
pub cpuck: u32,
pub internal: u32,
pub memory: u32,
pub copz: u32,
pub vfpu: u32,
pub sleep: u32,
pub bus_access: u32,
pub uncached_load: u32,
pub uncached_store: u32,
pub cached_load: u32,
pub cached_store: u32,
pub i_miss: u32,
pub d_miss: u32,
pub d_writeback: u32,
pub cop0_inst: u32,
pub fpu_inst: u32,
pub vfpu_inst: u32,
pub local_bus: u32,
}
#[test]
fn bindgen_test_layout__PspDebugProfilerRegs() {
assert_eq!(::core::mem::size_of::<_PspDebugProfilerRegs>() , 80usize ,
concat ! ( "Size of: " , stringify ! ( _PspDebugProfilerRegs )
));
assert_eq! (::core::mem::align_of::<_PspDebugProfilerRegs>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( _PspDebugProfilerRegs ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugProfilerRegs ) ) . enable as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
, "::" , stringify ! ( enable ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugProfilerRegs ) ) . systemck as *
const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
, "::" , stringify ! ( systemck ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugProfilerRegs ) ) . cpuck as *
const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
, "::" , stringify ! ( cpuck ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugProfilerRegs ) ) . internal as *
const _ as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
, "::" , stringify ! ( internal ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugProfilerRegs ) ) . memory as *
const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
, "::" , stringify ! ( memory ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugProfilerRegs ) ) . copz as *
const _ as usize } , 20usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
, "::" , stringify ! ( copz ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugProfilerRegs ) ) . vfpu as *
const _ as usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
, "::" , stringify ! ( vfpu ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugProfilerRegs ) ) . sleep as *
const _ as usize } , 28usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
, "::" , stringify ! ( sleep ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugProfilerRegs ) ) . bus_access as
* const _ as usize } , 32usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
, "::" , stringify ! ( bus_access ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugProfilerRegs ) ) . uncached_load
as * const _ as usize } , 36usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
, "::" , stringify ! ( uncached_load ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugProfilerRegs ) ) .
uncached_store as * const _ as usize } , 40usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
, "::" , stringify ! ( uncached_store ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugProfilerRegs ) ) . cached_load
as * const _ as usize } , 44usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
, "::" , stringify ! ( cached_load ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugProfilerRegs ) ) . cached_store
as * const _ as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
, "::" , stringify ! ( cached_store ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugProfilerRegs ) ) . i_miss as *
const _ as usize } , 52usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
, "::" , stringify ! ( i_miss ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugProfilerRegs ) ) . d_miss as *
const _ as usize } , 56usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
, "::" , stringify ! ( d_miss ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugProfilerRegs ) ) . d_writeback
as * const _ as usize } , 60usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
, "::" , stringify ! ( d_writeback ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugProfilerRegs ) ) . cop0_inst as
* const _ as usize } , 64usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
, "::" , stringify ! ( cop0_inst ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugProfilerRegs ) ) . fpu_inst as *
const _ as usize } , 68usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
, "::" , stringify ! ( fpu_inst ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugProfilerRegs ) ) . vfpu_inst as
* const _ as usize } , 72usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
, "::" , stringify ! ( vfpu_inst ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspDebugProfilerRegs ) ) . local_bus as
* const _ as usize } , 76usize , concat ! (
"Alignment of field: " , stringify ! ( _PspDebugProfilerRegs )
, "::" , stringify ! ( local_bus ) ));
}
impl Clone for _PspDebugProfilerRegs {
fn clone(&self) -> Self { *self }
}
/// Structure to hold the psp profiler register values
pub type PspDebugProfilerRegs = _PspDebugProfilerRegs;
extern "C" {
/// Enables the profiler hardware
pub fn pspDebugProfilerEnable();
}
extern "C" {
/// Disables the profiler hardware
pub fn pspDebugProfilerDisable();
}
extern "C" {
/// Clear the profiler registers
pub fn pspDebugProfilerClear();
}
extern "C" {
/// Get the profiler register state
///
/// @param regs - A pointer to a PspDebugProfilerRegs structure.
pub fn pspDebugProfilerGetRegs(regs: *mut PspDebugProfilerRegs);
}
extern "C" {
/// Print the profiler registers to screen
pub fn pspDebugProfilerPrint();
}
/// Type for the debug print handlers
pub type PspDebugPrintHandler =
::core::option::Option<unsafe extern "C" fn(data: *const u8,
len: i32) -> i32>;
/// Type for the debug input handler
pub type PspDebugInputHandler =
::core::option::Option<unsafe extern "C" fn(data: *mut u8,
len: i32) -> i32>;
extern "C" {
/// Install a handler for stdin (so you can use normal stdio functions)
///
/// @param handler - A pointer to input handler, NULL to disable.
///
/// @return < 0 on error, else 0.
pub fn pspDebugInstallStdinHandler(handler: PspDebugInputHandler)
-> i32;
}
extern "C" {
/// Install a print handler for stdout (so you can use normal print functions)
///
/// @param handler - A pointer to print handler, NULL to disable.
///
/// @return < 0 on error, else 0.
pub fn pspDebugInstallStdoutHandler(handler: PspDebugPrintHandler)
-> i32;
}
extern "C" {
/// Install a print handler for stderr (so you can use normal print functions)
///
/// @param handler - A pointer to print handler, NULL to disable.
///
/// @return < 0 on error, else 0.
pub fn pspDebugInstallStderrHandler(handler: PspDebugPrintHandler)
-> i32;
}
extern "C" {
/// Put a character to the remote sio.
///
/// @param ch - Character to write.
pub fn pspDebugSioPutchar(ch: i32);
}
extern "C" {
/// Get a character from the remote sio
///
/// @return The character read or -1 if no characters available.
pub fn pspDebugSioGetchar() -> i32;
}
extern "C" {
/// Write a string to the sio port.
///
/// @param str - String to write.
pub fn pspDebugSioPuts(str: *const u8);
}
extern "C" {
/// Write a set of data to the sio port
///
/// @param data - Pointer to the data to send.
/// @param len - Length of the data.
///
/// @return Number of characters written.
pub fn pspDebugSioPutData(data: *const u8, len: i32) -> i32;
}
extern "C" {
/// Write a set of data to the sio port converting single
/// line feeds to CRLF and single CR to CRLF
///
/// @param data - Pointer to the data to send.
/// @param len - Length of the data.
///
/// @return Number of characters written.
pub fn pspDebugSioPutText(data: *const u8, len: i32) -> i32;
}
extern "C" {
/// Initialise the remote SIO port (defaults to 4800 8N1).
/// @note will delay 2 seconds to wait for the power to come up.
pub fn pspDebugSioInit();
}
extern "C" {
/// Set the baud rate of the SIO, e.g. 4800/9600..115200.
/// @param baud - The baudrate to set.
pub fn pspDebugSioSetBaud(baud: i32);
}
extern "C" {
/// Enable debug character output. Needs to be called in order
/// for the default Kprintf handler to work.
pub fn pspDebugEnablePutchar();
}
extern "C" {
/// Install a kprintf debug putchar handler. Implicitly calls ::pspDebugEnablePutchar
/// so you do not need to call it explicitly. Sio must be initialised before calling
/// this function however.
pub fn pspDebugSioInstallKprintf();
}
extern "C" {
/// Install the gdb stub handler.
pub fn pspDebugGdbStubInit();
}
extern "C" {
/// Generate a breakpoint exception.
pub fn pspDebugBreakpoint();
}
extern "C" {
/// Enable the kprintf handler (once installed)
pub fn pspDebugSioEnableKprintf();
}
extern "C" {
/// Disable the kprintf handler (once installed)
pub fn pspDebugSioDisableKprintf();
}
/// 64-bit system clock type.
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceKernelSysClock {
pub low: SceUInt32,
pub hi: SceUInt32,
}
#[test]
fn bindgen_test_layout_SceKernelSysClock() {
assert_eq!(::core::mem::size_of::<SceKernelSysClock>() , 8usize , concat !
( "Size of: " , stringify ! ( SceKernelSysClock ) ));
assert_eq! (::core::mem::align_of::<SceKernelSysClock>() , 4usize , concat
! ( "Alignment of " , stringify ! ( SceKernelSysClock ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelSysClock ) ) . low as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelSysClock ) ,
"::" , stringify ! ( low ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelSysClock ) ) . hi as * const _
as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelSysClock ) ,
"::" , stringify ! ( hi ) ));
}
impl Clone for SceKernelSysClock {
fn clone(&self) -> Self { *self }
}
#[repr(u32)]
/// Attribute for threads.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspThreadAttributes {
PSP_THREAD_ATTR_VFPU = 16384,
PSP_THREAD_ATTR_USER = 2147483648,
PSP_THREAD_ATTR_USBWLAN = 2684354560,
PSP_THREAD_ATTR_VSH = 3221225472,
PSP_THREAD_ATTR_SCRATCH_SRAM = 32768,
PSP_THREAD_ATTR_NO_FILLSTACK = 1048576,
PSP_THREAD_ATTR_CLEAR_STACK = 2097152,
}
pub type SceKernelThreadEntry =
::core::option::Option<unsafe extern "C" fn(args: SceSize,
argp: *mut c_void)
-> i32>;
/// Additional options used when creating threads.
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceKernelThreadOptParam {
/// Size of the ::SceKernelThreadOptParam structure.
pub size: SceSize,
/// UID of the memory block (?) allocated for the thread's stack.
pub stackMpid: SceUID,
}
#[test]
fn bindgen_test_layout_SceKernelThreadOptParam() {
assert_eq!(::core::mem::size_of::<SceKernelThreadOptParam>() , 8usize ,
concat ! (
"Size of: " , stringify ! ( SceKernelThreadOptParam ) ));
assert_eq! (::core::mem::align_of::<SceKernelThreadOptParam>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( SceKernelThreadOptParam ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadOptParam ) ) . size as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadOptParam
) , "::" , stringify ! ( size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadOptParam ) ) . stackMpid
as * const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadOptParam
) , "::" , stringify ! ( stackMpid ) ));
}
impl Clone for SceKernelThreadOptParam {
fn clone(&self) -> Self { *self }
}
/// Structure to hold the status information for a thread
/// @see sceKernelReferThreadStatus
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceKernelThreadInfo {
/// Size of the structure
pub size: SceSize,
/// Nul terminated name of the thread
pub name: [u8; 32usize],
/// Thread attributes
pub attr: SceUInt,
/// Thread status
pub status: i32,
/// Thread entry point
pub entry: SceKernelThreadEntry,
/// Thread stack pointer
pub stack: *mut c_void,
/// Thread stack size
pub stackSize: i32,
/// Pointer to the gp
pub gpReg: *mut c_void,
/// Initial priority
pub initPriority: i32,
/// Current priority
pub currentPriority: i32,
/// Wait type
pub waitType: i32,
/// Wait id
pub waitId: SceUID,
/// Wakeup count
pub wakeupCount: i32,
/// Exit status of the thread
pub exitStatus: i32,
/// Number of clock cycles run
pub runClocks: SceKernelSysClock,
/// Interrupt preemption count
pub intrPreemptCount: SceUInt,
/// Thread preemption count
pub threadPreemptCount: SceUInt,
/// Release count
pub releaseCount: SceUInt,
}
#[test]
fn bindgen_test_layout_SceKernelThreadInfo() {
assert_eq!(::core::mem::size_of::<SceKernelThreadInfo>() , 128usize ,
concat ! ( "Size of: " , stringify ! ( SceKernelThreadInfo )
));
assert_eq! (::core::mem::align_of::<SceKernelThreadInfo>() , 8usize ,
concat ! (
"Alignment of " , stringify ! ( SceKernelThreadInfo ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadInfo ) ) . size as * const
_ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
"::" , stringify ! ( size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadInfo ) ) . name as * const
_ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
"::" , stringify ! ( name ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadInfo ) ) . attr as * const
_ as usize } , 36usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
"::" , stringify ! ( attr ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadInfo ) ) . status as *
const _ as usize } , 40usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
"::" , stringify ! ( status ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadInfo ) ) . entry as *
const _ as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
"::" , stringify ! ( entry ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadInfo ) ) . stack as *
const _ as usize } , 56usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
"::" , stringify ! ( stack ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadInfo ) ) . stackSize as *
const _ as usize } , 64usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
"::" , stringify ! ( stackSize ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadInfo ) ) . gpReg as *
const _ as usize } , 72usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
"::" , stringify ! ( gpReg ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadInfo ) ) . initPriority as
* const _ as usize } , 80usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
"::" , stringify ! ( initPriority ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadInfo ) ) . currentPriority
as * const _ as usize } , 84usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
"::" , stringify ! ( currentPriority ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadInfo ) ) . waitType as *
const _ as usize } , 88usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
"::" , stringify ! ( waitType ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadInfo ) ) . waitId as *
const _ as usize } , 92usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
"::" , stringify ! ( waitId ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadInfo ) ) . wakeupCount as
* const _ as usize } , 96usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
"::" , stringify ! ( wakeupCount ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadInfo ) ) . exitStatus as *
const _ as usize } , 100usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
"::" , stringify ! ( exitStatus ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadInfo ) ) . runClocks as *
const _ as usize } , 104usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
"::" , stringify ! ( runClocks ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadInfo ) ) .
intrPreemptCount as * const _ as usize } , 112usize , concat !
(
"Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
"::" , stringify ! ( intrPreemptCount ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadInfo ) ) .
threadPreemptCount as * const _ as usize } , 116usize , concat
! (
"Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
"::" , stringify ! ( threadPreemptCount ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadInfo ) ) . releaseCount as
* const _ as usize } , 120usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadInfo ) ,
"::" , stringify ! ( releaseCount ) ));
}
impl Clone for SceKernelThreadInfo {
fn clone(&self) -> Self { *self }
}
/// Statistics about a running thread.
/// @see sceKernelReferThreadRunStatus.
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceKernelThreadRunStatus {
pub size: SceSize,
pub status: i32,
pub currentPriority: i32,
pub waitType: i32,
pub waitId: i32,
pub wakeupCount: i32,
pub runClocks: SceKernelSysClock,
pub intrPreemptCount: SceUInt,
pub threadPreemptCount: SceUInt,
pub releaseCount: SceUInt,
}
#[test]
fn bindgen_test_layout_SceKernelThreadRunStatus() {
assert_eq!(::core::mem::size_of::<SceKernelThreadRunStatus>() , 44usize ,
concat ! (
"Size of: " , stringify ! ( SceKernelThreadRunStatus ) ));
assert_eq! (::core::mem::align_of::<SceKernelThreadRunStatus>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( SceKernelThreadRunStatus ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadRunStatus ) ) . size as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! (
SceKernelThreadRunStatus ) , "::" , stringify ! ( size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadRunStatus ) ) . status as
* const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! (
SceKernelThreadRunStatus ) , "::" , stringify ! ( status ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadRunStatus ) ) .
currentPriority as * const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! (
SceKernelThreadRunStatus ) , "::" , stringify ! (
currentPriority ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadRunStatus ) ) . waitType
as * const _ as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! (
SceKernelThreadRunStatus ) , "::" , stringify ! ( waitType )
));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadRunStatus ) ) . waitId as
* const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! (
SceKernelThreadRunStatus ) , "::" , stringify ! ( waitId ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadRunStatus ) ) .
wakeupCount as * const _ as usize } , 20usize , concat ! (
"Alignment of field: " , stringify ! (
SceKernelThreadRunStatus ) , "::" , stringify ! ( wakeupCount
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadRunStatus ) ) . runClocks
as * const _ as usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! (
SceKernelThreadRunStatus ) , "::" , stringify ! ( runClocks )
));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadRunStatus ) ) .
intrPreemptCount as * const _ as usize } , 32usize , concat !
(
"Alignment of field: " , stringify ! (
SceKernelThreadRunStatus ) , "::" , stringify ! (
intrPreemptCount ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadRunStatus ) ) .
threadPreemptCount as * const _ as usize } , 36usize , concat
! (
"Alignment of field: " , stringify ! (
SceKernelThreadRunStatus ) , "::" , stringify ! (
threadPreemptCount ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadRunStatus ) ) .
releaseCount as * const _ as usize } , 40usize , concat ! (
"Alignment of field: " , stringify ! (
SceKernelThreadRunStatus ) , "::" , stringify ! ( releaseCount
) ));
}
impl Clone for SceKernelThreadRunStatus {
fn clone(&self) -> Self { *self }
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspThreadStatus {
PSP_THREAD_RUNNING = 1,
PSP_THREAD_READY = 2,
PSP_THREAD_WAITING = 4,
PSP_THREAD_SUSPEND = 8,
PSP_THREAD_STOPPED = 16,
PSP_THREAD_KILLED = 32,
}
extern "C" {
/// Create a thread
///
/// @par Example:
/// @code
/// SceUID thid;
/// thid = sceKernelCreateThread("my_thread", threadFunc, 0x18, 0x10000, 0, NULL);
/// @endcode
///
/// @param name - An arbitrary thread name.
/// @param entry - The thread function to run when started.
/// @param initPriority - The initial priority of the thread. Less if higher priority.
/// @param stackSize - The size of the initial stack.
/// @param attr - The thread attributes, zero or more of ::PspThreadAttributes.
/// @param option - Additional options specified by ::SceKernelThreadOptParam.
///
/// @return UID of the created thread, or an error code.
pub fn sceKernelCreateThread(name: *const u8,
entry: SceKernelThreadEntry,
initPriority: i32, stackSize: i32,
attr: SceUInt,
option: *mut SceKernelThreadOptParam)
-> SceUID;
}
extern "C" {
/// Delate a thread
///
/// @param thid - UID of the thread to be deleted.
///
/// @return < 0 on error.
pub fn sceKernelDeleteThread(thid: SceUID) -> i32;
}
extern "C" {
/// Start a created thread
///
/// @param thid - Thread id from sceKernelCreateThread
/// @param arglen - Length of the data pointed to by argp, in bytes
/// @param argp - Pointer to the arguments.
pub fn sceKernelStartThread(thid: SceUID, arglen: SceSize,
argp: *mut c_void) -> i32;
}
extern "C" {
/// Exit a thread
///
/// @param status - Exit status.
pub fn sceKernelExitThread(status: i32) -> i32;
}
extern "C" {
/// Exit a thread and delete itself.
///
/// @param status - Exit status
pub fn sceKernelExitDeleteThread(status: i32) -> i32;
}
extern "C" {
/// Terminate a thread.
///
/// @param thid - UID of the thread to terminate.
///
/// @return Success if >= 0, an error if < 0.
pub fn sceKernelTerminateThread(thid: SceUID) -> i32;
}
extern "C" {
/// Terminate and delete a thread.
///
/// @param thid - UID of the thread to terminate and delete.
///
/// @return Success if >= 0, an error if < 0.
pub fn sceKernelTerminateDeleteThread(thid: SceUID) -> i32;
}
extern "C" {
/// Suspend the dispatch thread
///
/// @return The current state of the dispatch thread, < 0 on error
pub fn sceKernelSuspendDispatchThread() -> i32;
}
extern "C" {
/// Resume the dispatch thread
///
/// @param state - The state of the dispatch thread
/// (from ::sceKernelSuspendDispatchThread)
///
/// @return 0 on success, < 0 on error
pub fn sceKernelResumeDispatchThread(state: i32) -> i32;
}
extern "C" {
/// Sleep thread
///
/// @return < 0 on error.
pub fn sceKernelSleepThread() -> i32;
}
extern "C" {
/// Sleep thread but service any callbacks as necessary
///
/// @par Example:
/// @code
/// // Once all callbacks have been setup call this function
/// sceKernelSleepThreadCB();
/// @endcode
pub fn sceKernelSleepThreadCB() -> i32;
}
extern "C" {
/// Wake a thread previously put into the sleep state.
///
/// @param thid - UID of the thread to wake.
///
/// @return Success if >= 0, an error if < 0.
pub fn sceKernelWakeupThread(thid: SceUID) -> i32;
}
extern "C" {
/// Cancel a thread that was to be woken with ::sceKernelWakeupThread.
///
/// @param thid - UID of the thread to cancel.
///
/// @return Success if >= 0, an error if < 0.
pub fn sceKernelCancelWakeupThread(thid: SceUID) -> i32;
}
extern "C" {
/// Suspend a thread.
///
/// @param thid - UID of the thread to suspend.
///
/// @return Success if >= 0, an error if < 0.
pub fn sceKernelSuspendThread(thid: SceUID) -> i32;
}
extern "C" {
/// Resume a thread previously put into a suspended state with ::sceKernelSuspendThread.
///
/// @param thid - UID of the thread to resume.
///
/// @return Success if >= 0, an error if < 0.
pub fn sceKernelResumeThread(thid: SceUID) -> i32;
}
extern "C" {
/// Wait until a thread has ended.
///
/// @param thid - Id of the thread to wait for.
/// @param timeout - Timeout in microseconds (assumed).
///
/// @return < 0 on error.
pub fn sceKernelWaitThreadEnd(thid: SceUID, timeout: *mut SceUInt)
-> i32;
}
extern "C" {
/// Wait until a thread has ended and handle callbacks if necessary.
///
/// @param thid - Id of the thread to wait for.
/// @param timeout - Timeout in microseconds (assumed).
///
/// @return < 0 on error.
pub fn sceKernelWaitThreadEndCB(thid: SceUID, timeout: *mut SceUInt)
-> i32;
}
extern "C" {
/// Delay the current thread by a specified number of microseconds
///
/// @param delay - Delay in microseconds.
///
/// @par Example:
/// @code
/// sceKernelDelayThread(1000000); // Delay for a second
/// @endcode
pub fn sceKernelDelayThread(delay: SceUInt) -> i32;
}
extern "C" {
/// Delay the current thread by a specified number of microseconds and handle any callbacks.
///
/// @param delay - Delay in microseconds.
///
/// @par Example:
/// @code
/// sceKernelDelayThread(1000000); // Delay for a second
/// @endcode
pub fn sceKernelDelayThreadCB(delay: SceUInt) -> i32;
}
extern "C" {
/// Delay the current thread by a specified number of sysclocks
///
/// @param delay - Delay in sysclocks
///
/// @return 0 on success, < 0 on error
pub fn sceKernelDelaySysClockThread(delay: *mut SceKernelSysClock)
-> i32;
}
extern "C" {
/// Delay the current thread by a specified number of sysclocks handling callbacks
///
/// @param delay - Delay in sysclocks
///
/// @return 0 on success, < 0 on error
///
pub fn sceKernelDelaySysClockThreadCB(delay: *mut SceKernelSysClock)
-> i32;
}
extern "C" {
/// Modify the attributes of the current thread.
///
/// @param unknown - Set to 0.
/// @param attr - The thread attributes to modify. One of ::PspThreadAttributes.
///
/// @return < 0 on error.
pub fn sceKernelChangeCurrentThreadAttr(unknown: i32, attr: SceUInt)
-> i32;
}
extern "C" {
/// Change the threads current priority.
///
/// @param thid - The ID of the thread (from sceKernelCreateThread or sceKernelGetThreadId)
/// @param priority - The new priority (the lower the number the higher the priority)
///
/// @par Example:
/// @code
/// int thid = sceKernelGetThreadId();
/// // Change priority of current thread to 16
/// sceKernelChangeThreadPriority(thid, 16);
/// @endcode
///
/// @return 0 if successful, otherwise the error code.
pub fn sceKernelChangeThreadPriority(thid: SceUID, priority: i32)
-> i32;
}
extern "C" {
/// Rotate thread ready queue at a set priority
///
/// @param priority - The priority of the queue
///
/// @return 0 on success, < 0 on error.
pub fn sceKernelRotateThreadReadyQueue(priority: i32) -> i32;
}
extern "C" {
/// Release a thread in the wait state.
///
/// @param thid - The UID of the thread.
///
/// @return 0 on success, < 0 on error
pub fn sceKernelReleaseWaitThread(thid: SceUID) -> i32;
}
extern "C" {
/// Get the current thread Id
///
/// @return The thread id of the calling thread.
pub fn sceKernelGetThreadId() -> i32;
}
extern "C" {
/// Get the current priority of the thread you are in.
///
/// @return The current thread priority
pub fn sceKernelGetThreadCurrentPriority() -> i32;
}
extern "C" {
/// Get the exit status of a thread.
///
/// @param thid - The UID of the thread to check.
///
/// @return The exit status
pub fn sceKernelGetThreadExitStatus(thid: SceUID) -> i32;
}
extern "C" {
/// Check the thread stack?
///
/// @return Unknown.
pub fn sceKernelCheckThreadStack() -> i32;
}
extern "C" {
/// Get the free stack size for a thread.
///
/// @param thid - The thread ID. Seem to take current thread
/// if set to 0.
///
/// @return The free size.
pub fn sceKernelGetThreadStackFreeSize(thid: SceUID) -> i32;
}
extern "C" {
/// Get the status information for the specified thread.
///
/// @param thid - Id of the thread to get status
/// @param info - Pointer to the info structure to receive the data.
/// Note: The structures size field should be set to
/// sizeof(SceKernelThreadInfo) before calling this function.
///
/// @par Example:
/// @code
/// SceKernelThreadInfo status;
/// status.size = sizeof(SceKernelThreadInfo);
/// if(sceKernelReferThreadStatus(thid, &status) == 0)
/// { Do something... }
/// @endcode
/// @return 0 if successful, otherwise the error code.
pub fn sceKernelReferThreadStatus(thid: SceUID,
info: *mut SceKernelThreadInfo)
-> i32;
}
extern "C" {
/// Retrive the runtime status of a thread.
///
/// @param thid - UID of the thread to retrive status.
/// @param status - Pointer to a ::SceKernelThreadRunStatus struct to receive the runtime status.
///
/// @return 0 if successful, otherwise the error code.
pub fn sceKernelReferThreadRunStatus(thid: SceUID,
status:
*mut SceKernelThreadRunStatus)
-> i32;
}
/// Additional options used when creating semaphores.
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceKernelSemaOptParam {
/// Size of the ::SceKernelSemaOptParam structure.
pub size: SceSize,
}
#[test]
fn bindgen_test_layout_SceKernelSemaOptParam() {
assert_eq!(::core::mem::size_of::<SceKernelSemaOptParam>() , 4usize ,
concat ! ( "Size of: " , stringify ! ( SceKernelSemaOptParam )
));
assert_eq! (::core::mem::align_of::<SceKernelSemaOptParam>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( SceKernelSemaOptParam ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelSemaOptParam ) ) . size as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelSemaOptParam )
, "::" , stringify ! ( size ) ));
}
impl Clone for SceKernelSemaOptParam {
fn clone(&self) -> Self { *self }
}
/// Current state of a semaphore.
/// @see sceKernelReferSemaStatus.
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceKernelSemaInfo {
/// Size of the ::SceKernelSemaInfo structure.
pub size: SceSize,
/// NUL-terminated name of the semaphore.
pub name: [u8; 32usize],
/// Attributes.
pub attr: SceUInt,
/// The initial count the semaphore was created with.
pub initCount: i32,
/// The current count.
pub currentCount: i32,
/// The maximum count.
pub maxCount: i32,
/// The number of threads waiting on the semaphore.
pub numWaitThreads: i32,
}
#[test]
fn bindgen_test_layout_SceKernelSemaInfo() {
assert_eq!(::core::mem::size_of::<SceKernelSemaInfo>() , 56usize , concat
! ( "Size of: " , stringify ! ( SceKernelSemaInfo ) ));
assert_eq! (::core::mem::align_of::<SceKernelSemaInfo>() , 4usize , concat
! ( "Alignment of " , stringify ! ( SceKernelSemaInfo ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelSemaInfo ) ) . size as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelSemaInfo ) ,
"::" , stringify ! ( size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelSemaInfo ) ) . name as * const _
as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelSemaInfo ) ,
"::" , stringify ! ( name ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelSemaInfo ) ) . attr as * const _
as usize } , 36usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelSemaInfo ) ,
"::" , stringify ! ( attr ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelSemaInfo ) ) . initCount as *
const _ as usize } , 40usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelSemaInfo ) ,
"::" , stringify ! ( initCount ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelSemaInfo ) ) . currentCount as *
const _ as usize } , 44usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelSemaInfo ) ,
"::" , stringify ! ( currentCount ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelSemaInfo ) ) . maxCount as *
const _ as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelSemaInfo ) ,
"::" , stringify ! ( maxCount ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelSemaInfo ) ) . numWaitThreads as
* const _ as usize } , 52usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelSemaInfo ) ,
"::" , stringify ! ( numWaitThreads ) ));
}
impl Clone for SceKernelSemaInfo {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// Creates a new semaphore
///
/// @par Example:
/// @code
/// int semaid;
/// semaid = sceKernelCreateSema("MyMutex", 0, 1, 1, 0);
/// @endcode
///
/// @param name - Specifies the name of the sema
/// @param attr - Sema attribute flags (normally set to 0)
/// @param initVal - Sema initial value
/// @param maxVal - Sema maximum value
/// @param option - Sema options (normally set to 0)
/// @return A semaphore id
pub fn sceKernelCreateSema(name: *const u8, attr: SceUInt,
initVal: i32, maxVal: i32,
option: *mut SceKernelSemaOptParam) -> SceUID;
}
extern "C" {
/// Destroy a semaphore
///
/// @param semaid - The semaid returned from a previous create call.
/// @return Returns the value 0 if its succesful otherwise -1
pub fn sceKernelDeleteSema(semaid: SceUID) -> i32;
}
extern "C" {
/// Send a signal to a semaphore
///
/// @par Example:
/// @code
/// // Signal the sema
/// sceKernelSignalSema(semaid, 1);
/// @endcode
///
/// @param semaid - The sema id returned from sceKernelCreateSema
/// @param signal - The amount to signal the sema (i.e. if 2 then increment the sema by 2)
///
/// @return < 0 On error.
pub fn sceKernelSignalSema(semaid: SceUID, signal: i32) -> i32;
}
extern "C" {
/// Lock a semaphore
///
/// @par Example:
/// @code
/// sceKernelWaitSema(semaid, 1, 0);
/// @endcode
///
/// @param semaid - The sema id returned from sceKernelCreateSema
/// @param signal - The value to wait for (i.e. if 1 then wait till reaches a signal state of 1)
/// @param timeout - Timeout in microseconds (assumed).
///
/// @return < 0 on error.
pub fn sceKernelWaitSema(semaid: SceUID, signal: i32,
timeout: *mut SceUInt) -> i32;
}
extern "C" {
/// Lock a semaphore a handle callbacks if necessary.
///
/// @par Example:
/// @code
/// sceKernelWaitSemaCB(semaid, 1, 0);
/// @endcode
///
/// @param semaid - The sema id returned from sceKernelCreateSema
/// @param signal - The value to wait for (i.e. if 1 then wait till reaches a signal state of 1)
/// @param timeout - Timeout in microseconds (assumed).
///
/// @return < 0 on error.
pub fn sceKernelWaitSemaCB(semaid: SceUID, signal: i32,
timeout: *mut SceUInt) -> i32;
}
extern "C" {
/// Poll a sempahore.
///
/// @param semaid - UID of the semaphore to poll.
/// @param signal - The value to test for.
///
/// @return < 0 on error.
pub fn sceKernelPollSema(semaid: SceUID, signal: i32) -> i32;
}
extern "C" {
/// Retrieve information about a semaphore.
///
/// @param semaid - UID of the semaphore to retrieve info for.
/// @param info - Pointer to a ::SceKernelSemaInfo struct to receive the info.
///
/// @return < 0 on error.
pub fn sceKernelReferSemaStatus(semaid: SceUID,
info: *mut SceKernelSemaInfo) -> i32;
}
/// Structure to hold the event flag information
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceKernelEventFlagInfo {
pub size: SceSize,
pub name: [u8; 32usize],
pub attr: SceUInt,
pub initPattern: SceUInt,
pub currentPattern: SceUInt,
pub numWaitThreads: i32,
}
#[test]
fn bindgen_test_layout_SceKernelEventFlagInfo() {
assert_eq!(::core::mem::size_of::<SceKernelEventFlagInfo>() , 52usize ,
concat ! ( "Size of: " , stringify ! ( SceKernelEventFlagInfo )
));
assert_eq! (::core::mem::align_of::<SceKernelEventFlagInfo>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( SceKernelEventFlagInfo ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelEventFlagInfo ) ) . size as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelEventFlagInfo
) , "::" , stringify ! ( size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelEventFlagInfo ) ) . name as *
const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelEventFlagInfo
) , "::" , stringify ! ( name ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelEventFlagInfo ) ) . attr as *
const _ as usize } , 36usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelEventFlagInfo
) , "::" , stringify ! ( attr ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelEventFlagInfo ) ) . initPattern
as * const _ as usize } , 40usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelEventFlagInfo
) , "::" , stringify ! ( initPattern ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelEventFlagInfo ) ) .
currentPattern as * const _ as usize } , 44usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelEventFlagInfo
) , "::" , stringify ! ( currentPattern ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelEventFlagInfo ) ) .
numWaitThreads as * const _ as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelEventFlagInfo
) , "::" , stringify ! ( numWaitThreads ) ));
}
impl Clone for SceKernelEventFlagInfo {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceKernelEventFlagOptParam {
pub size: SceSize,
}
#[test]
fn bindgen_test_layout_SceKernelEventFlagOptParam() {
assert_eq!(::core::mem::size_of::<SceKernelEventFlagOptParam>() , 4usize ,
concat ! (
"Size of: " , stringify ! ( SceKernelEventFlagOptParam ) ));
assert_eq! (::core::mem::align_of::<SceKernelEventFlagOptParam>() , 4usize
, concat ! (
"Alignment of " , stringify ! ( SceKernelEventFlagOptParam )
));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelEventFlagOptParam ) ) . size as
* const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! (
SceKernelEventFlagOptParam ) , "::" , stringify ! ( size ) ));
}
impl Clone for SceKernelEventFlagOptParam {
fn clone(&self) -> Self { *self }
}
#[repr(u32)]
/// Event flag creation attributes
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspEventFlagAttributes { PSP_EVENT_WAITMULTIPLE = 512, }
#[repr(u32)]
/// Event flag wait types
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspEventFlagWaitTypes {
PSP_EVENT_WAITAND = 0,
PSP_EVENT_WAITOR = 1,
PSP_EVENT_WAITCLEAR = 32,
}
extern "C" {
/// Create an event flag.
///
/// @param name - The name of the event flag.
/// @param attr - Attributes from ::PspEventFlagAttributes
/// @param bits - Initial bit pattern.
/// @param opt - Options, set to NULL
/// @return < 0 on error. >= 0 event flag id.
///
/// @par Example:
/// @code
/// int evid;
/// evid = sceKernelCreateEventFlag("wait_event", 0, 0, 0);
/// @endcode
pub fn sceKernelCreateEventFlag(name: *const u8, attr: i32,
bits: i32,
opt: *mut SceKernelEventFlagOptParam)
-> SceUID;
}
extern "C" {
/// Set an event flag bit pattern.
///
/// @param evid - The event id returned by sceKernelCreateEventFlag.
/// @param bits - The bit pattern to set.
///
/// @return < 0 On error
pub fn sceKernelSetEventFlag(evid: SceUID, bits: u32) -> i32;
}
extern "C" {
/// Clear a event flag bit pattern
///
/// @param evid - The event id returned by ::sceKernelCreateEventFlag
/// @param bits - The bits to clean
///
/// @return < 0 on Error
pub fn sceKernelClearEventFlag(evid: SceUID, bits: u32) -> i32;
}
extern "C" {
/// Poll an event flag for a given bit pattern.
///
/// @param evid - The event id returned by sceKernelCreateEventFlag.
/// @param bits - The bit pattern to poll for.
/// @param wait - Wait type, one or more of ::PspEventFlagWaitTypes or'ed together
/// @param outBits - The bit pattern that was matched.
/// @return < 0 On error
pub fn sceKernelPollEventFlag(evid: i32, bits: u32, wait: u32,
outBits: *mut u32) -> i32;
}
extern "C" {
/// Wait for an event flag for a given bit pattern.
///
/// @param evid - The event id returned by sceKernelCreateEventFlag.
/// @param bits - The bit pattern to poll for.
/// @param wait - Wait type, one or more of ::PspEventFlagWaitTypes or'ed together
/// @param outBits - The bit pattern that was matched.
/// @param timeout - Timeout in microseconds
/// @return < 0 On error
pub fn sceKernelWaitEventFlag(evid: i32, bits: u32, wait: u32,
outBits: *mut u32, timeout: *mut SceUInt)
-> i32;
}
extern "C" {
/// Wait for an event flag for a given bit pattern with callback.
///
/// @param evid - The event id returned by sceKernelCreateEventFlag.
/// @param bits - The bit pattern to poll for.
/// @param wait - Wait type, one or more of ::PspEventFlagWaitTypes or'ed together
/// @param outBits - The bit pattern that was matched.
/// @param timeout - Timeout in microseconds
/// @return < 0 On error
pub fn sceKernelWaitEventFlagCB(evid: i32, bits: u32, wait: u32,
outBits: *mut u32, timeout: *mut SceUInt)
-> i32;
}
extern "C" {
/// Delete an event flag
///
/// @param evid - The event id returned by sceKernelCreateEventFlag.
///
/// @return < 0 On error
pub fn sceKernelDeleteEventFlag(evid: i32) -> i32;
}
extern "C" {
/// Get the status of an event flag.
///
/// @param event - The UID of the event.
/// @param status - A pointer to a ::SceKernelEventFlagInfo structure.
///
/// @return < 0 on error.
pub fn sceKernelReferEventFlagStatus(event: SceUID,
status: *mut SceKernelEventFlagInfo)
-> i32;
}
/// Additional options used when creating messageboxes.
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceKernelMbxOptParam {
/// Size of the ::SceKernelMbxOptParam structure.
pub size: SceSize,
}
#[test]
fn bindgen_test_layout_SceKernelMbxOptParam() {
assert_eq!(::core::mem::size_of::<SceKernelMbxOptParam>() , 4usize ,
concat ! ( "Size of: " , stringify ! ( SceKernelMbxOptParam )
));
assert_eq! (::core::mem::align_of::<SceKernelMbxOptParam>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( SceKernelMbxOptParam ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelMbxOptParam ) ) . size as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelMbxOptParam )
, "::" , stringify ! ( size ) ));
}
impl Clone for SceKernelMbxOptParam {
fn clone(&self) -> Self { *self }
}
/// Current state of a messagebox.
/// @see sceKernelReferMbxStatus.
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceKernelMbxInfo {
/// Size of the ::SceKernelMbxInfo structure.
pub size: SceSize,
/// NUL-terminated name of the messagebox.
pub name: [u8; 32usize],
/// Attributes.
pub attr: SceUInt,
/// The number of threads waiting on the messagebox.
pub numWaitThreads: i32,
/// Number of messages currently in the messagebox.
pub numMessages: i32,
/// The message currently at the head of the queue.
pub firstMessage: *mut c_void,
}
#[test]
fn bindgen_test_layout_SceKernelMbxInfo() {
assert_eq!(::core::mem::size_of::<SceKernelMbxInfo>() , 56usize , concat !
( "Size of: " , stringify ! ( SceKernelMbxInfo ) ));
assert_eq! (::core::mem::align_of::<SceKernelMbxInfo>() , 8usize , concat
! ( "Alignment of " , stringify ! ( SceKernelMbxInfo ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelMbxInfo ) ) . size as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelMbxInfo ) ,
"::" , stringify ! ( size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelMbxInfo ) ) . name as * const _
as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelMbxInfo ) ,
"::" , stringify ! ( name ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelMbxInfo ) ) . attr as * const _
as usize } , 36usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelMbxInfo ) ,
"::" , stringify ! ( attr ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelMbxInfo ) ) . numWaitThreads as
* const _ as usize } , 40usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelMbxInfo ) ,
"::" , stringify ! ( numWaitThreads ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelMbxInfo ) ) . numMessages as *
const _ as usize } , 44usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelMbxInfo ) ,
"::" , stringify ! ( numMessages ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelMbxInfo ) ) . firstMessage as *
const _ as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelMbxInfo ) ,
"::" , stringify ! ( firstMessage ) ));
}
impl Clone for SceKernelMbxInfo {
fn clone(&self) -> Self { *self }
}
/// Header for a message box packet
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceKernelMsgPacket {
/// Pointer to next msg (used by the kernel)
pub next: *mut SceKernelMsgPacket,
/// Priority ?
pub msgPriority: SceUChar,
pub dummy: [SceUChar; 3usize],
}
#[test]
fn bindgen_test_layout_SceKernelMsgPacket() {
assert_eq!(::core::mem::size_of::<SceKernelMsgPacket>() , 16usize , concat
! ( "Size of: " , stringify ! ( SceKernelMsgPacket ) ));
assert_eq! (::core::mem::align_of::<SceKernelMsgPacket>() , 8usize ,
concat ! (
"Alignment of " , stringify ! ( SceKernelMsgPacket ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelMsgPacket ) ) . next as * const
_ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelMsgPacket ) ,
"::" , stringify ! ( next ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelMsgPacket ) ) . msgPriority as *
const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelMsgPacket ) ,
"::" , stringify ! ( msgPriority ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelMsgPacket ) ) . dummy as * const
_ as usize } , 9usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelMsgPacket ) ,
"::" , stringify ! ( dummy ) ));
}
impl Clone for SceKernelMsgPacket {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// Creates a new messagebox
///
/// @par Example:
/// @code
/// int mbxid;
/// mbxid = sceKernelCreateMbx("MyMessagebox", 0, NULL);
/// @endcode
///
/// @param name - Specifies the name of the mbx
/// @param attr - Mbx attribute flags (normally set to 0)
/// @param option - Mbx options (normally set to NULL)
/// @return A messagebox id
pub fn sceKernelCreateMbx(name: *const u8, attr: SceUInt,
option: *mut SceKernelMbxOptParam) -> SceUID;
}
extern "C" {
/// Destroy a messagebox
///
/// @param mbxid - The mbxid returned from a previous create call.
/// @return Returns the value 0 if its succesful otherwise an error code
pub fn sceKernelDeleteMbx(mbxid: SceUID) -> i32;
}
extern "C" {
/// Send a message to a messagebox
///
/// @par Example:
/// @code
/// struct MyMessage {
/// SceKernelMsgPacket header;
/// char text[8];
/// };
///
/// struct MyMessage msg = { {0}, "Hello" };
/// // Send the message
/// sceKernelSendMbx(mbxid, (void*) &msg);
/// @endcode
///
/// @param mbxid - The mbx id returned from sceKernelCreateMbx
/// @param message - A message to be forwarded to the receiver.
/// The start of the message should be the
/// ::SceKernelMsgPacket structure, the rest
///
/// @return < 0 On error.
pub fn sceKernelSendMbx(mbxid: SceUID, message: *mut c_void) -> i32;
}
extern "C" {
/// Wait for a message to arrive in a messagebox
///
/// @par Example:
/// @code
/// void *msg;
/// sceKernelReceiveMbx(mbxid, &msg, NULL);
/// @endcode
///
/// @param mbxid - The mbx id returned from sceKernelCreateMbx
/// @param pmessage - A pointer to where a pointer to the
/// received message should be stored
/// @param timeout - Timeout in microseconds
///
/// @return < 0 on error.
pub fn sceKernelReceiveMbx(mbxid: SceUID, pmessage: *mut *mut c_void,
timeout: *mut SceUInt) -> i32;
}
extern "C" {
/// Wait for a message to arrive in a messagebox and handle callbacks if necessary.
///
/// @par Example:
/// @code
/// void *msg;
/// sceKernelReceiveMbxCB(mbxid, &msg, NULL);
/// @endcode
///
/// @param mbxid - The mbx id returned from sceKernelCreateMbx
/// @param pmessage - A pointer to where a pointer to the
/// received message should be stored
/// @param timeout - Timeout in microseconds
///
/// @return < 0 on error.
pub fn sceKernelReceiveMbxCB(mbxid: SceUID, pmessage: *mut *mut c_void,
timeout: *mut SceUInt) -> i32;
}
extern "C" {
/// Check if a message has arrived in a messagebox
///
/// @par Example:
/// @code
/// void *msg;
/// sceKernelPollMbx(mbxid, &msg);
/// @endcode
///
/// @param mbxid - The mbx id returned from sceKernelCreateMbx
/// @param pmessage - A pointer to where a pointer to the
/// received message should be stored
///
/// @return < 0 on error (SCE_KERNEL_ERROR_MBOX_NOMSG if the mbx is empty).
pub fn sceKernelPollMbx(mbxid: SceUID, pmessage: *mut *mut c_void)
-> i32;
}
extern "C" {
/// Abort all wait operations on a messagebox
///
/// @par Example:
/// @code
/// sceKernelCancelReceiveMbx(mbxid, NULL);
/// @endcode
///
/// @param mbxid - The mbx id returned from sceKernelCreateMbx
/// @param pnum - A pointer to where the number of threads which
/// were waiting on the mbx should be stored (NULL
/// if you don't care)
///
/// @return < 0 on error
pub fn sceKernelCancelReceiveMbx(mbxid: SceUID, pnum: *mut i32)
-> i32;
}
extern "C" {
/// Retrieve information about a messagebox.
///
/// @param mbxid - UID of the messagebox to retrieve info for.
/// @param info - Pointer to a ::SceKernelMbxInfo struct to receive the info.
///
/// @return < 0 on error.
pub fn sceKernelReferMbxStatus(mbxid: SceUID, info: *mut SceKernelMbxInfo)
-> i32;
}
/// Prototype for alarm handlers.
pub type SceKernelAlarmHandler =
::core::option::Option<unsafe extern "C" fn(common: *mut c_void)
-> SceUInt>;
/// Struct containing alarm info
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceKernelAlarmInfo {
/// Size of the structure (should be set before calling
/// :: sceKernelReferAlarmStatus
pub size: SceSize,
pub schedule: SceKernelSysClock,
/// Pointer to the alarm handler
pub handler: SceKernelAlarmHandler,
/// Common pointer argument
pub common: *mut c_void,
}
#[test]
fn bindgen_test_layout_SceKernelAlarmInfo() {
assert_eq!(::core::mem::size_of::<SceKernelAlarmInfo>() , 32usize , concat
! ( "Size of: " , stringify ! ( SceKernelAlarmInfo ) ));
assert_eq! (::core::mem::align_of::<SceKernelAlarmInfo>() , 8usize ,
concat ! (
"Alignment of " , stringify ! ( SceKernelAlarmInfo ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelAlarmInfo ) ) . size as * const
_ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelAlarmInfo ) ,
"::" , stringify ! ( size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelAlarmInfo ) ) . schedule as *
const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelAlarmInfo ) ,
"::" , stringify ! ( schedule ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelAlarmInfo ) ) . handler as *
const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelAlarmInfo ) ,
"::" , stringify ! ( handler ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelAlarmInfo ) ) . common as *
const _ as usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelAlarmInfo ) ,
"::" , stringify ! ( common ) ));
}
impl Clone for SceKernelAlarmInfo {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// Set an alarm.
/// @param clock - The number of micro seconds till the alarm occurrs.
/// @param handler - Pointer to a ::SceKernelAlarmHandler
/// @param common - Common pointer for the alarm handler
///
/// @return A UID representing the created alarm, < 0 on error.
pub fn sceKernelSetAlarm(clock: SceUInt, handler: SceKernelAlarmHandler,
common: *mut c_void) -> SceUID;
}
extern "C" {
/// Set an alarm using a ::SceKernelSysClock structure for the time
///
/// @param clock - Pointer to a ::SceKernelSysClock structure
/// @param handler - Pointer to a ::SceKernelAlarmHandler
/// @param common - Common pointer for the alarm handler.
///
/// @return A UID representing the created alarm, < 0 on error.
pub fn sceKernelSetSysClockAlarm(clock: *mut SceKernelSysClock,
handler: SceKernelAlarmHandler,
common: *mut c_void) -> SceUID;
}
extern "C" {
/// Cancel a pending alarm.
///
/// @param alarmid - UID of the alarm to cancel.
///
/// @return 0 on success, < 0 on error.
pub fn sceKernelCancelAlarm(alarmid: SceUID) -> i32;
}
extern "C" {
/// Refer the status of a created alarm.
///
/// @param alarmid - UID of the alarm to get the info of
/// @param info - Pointer to a ::SceKernelAlarmInfo structure
///
/// @return 0 on success, < 0 on error.
pub fn sceKernelReferAlarmStatus(alarmid: SceUID,
info: *mut SceKernelAlarmInfo)
-> i32;
}
/// Callback function prototype
pub type SceKernelCallbackFunction =
::core::option::Option<unsafe extern "C" fn(arg1: i32, arg2: i32,
arg: *mut c_void)
-> i32>;
/// Structure to hold the status information for a callback
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceKernelCallbackInfo {
/// Size of the structure (i.e. sizeof(SceKernelCallbackInfo))
pub size: SceSize,
/// The name given to the callback
pub name: [u8; 32usize],
/// The thread id associated with the callback
pub threadId: SceUID,
/// Pointer to the callback function
pub callback: SceKernelCallbackFunction,
/// User supplied argument for the callback
pub common: *mut c_void,
/// Unknown
pub notifyCount: i32,
/// Unknown
pub notifyArg: i32,
}
#[test]
fn bindgen_test_layout_SceKernelCallbackInfo() {
assert_eq!(::core::mem::size_of::<SceKernelCallbackInfo>() , 64usize ,
concat ! ( "Size of: " , stringify ! ( SceKernelCallbackInfo )
));
assert_eq! (::core::mem::align_of::<SceKernelCallbackInfo>() , 8usize ,
concat ! (
"Alignment of " , stringify ! ( SceKernelCallbackInfo ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelCallbackInfo ) ) . size as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelCallbackInfo )
, "::" , stringify ! ( size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelCallbackInfo ) ) . name as *
const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelCallbackInfo )
, "::" , stringify ! ( name ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelCallbackInfo ) ) . threadId as *
const _ as usize } , 36usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelCallbackInfo )
, "::" , stringify ! ( threadId ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelCallbackInfo ) ) . callback as *
const _ as usize } , 40usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelCallbackInfo )
, "::" , stringify ! ( callback ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelCallbackInfo ) ) . common as *
const _ as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelCallbackInfo )
, "::" , stringify ! ( common ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelCallbackInfo ) ) . notifyCount
as * const _ as usize } , 56usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelCallbackInfo )
, "::" , stringify ! ( notifyCount ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelCallbackInfo ) ) . notifyArg as
* const _ as usize } , 60usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelCallbackInfo )
, "::" , stringify ! ( notifyArg ) ));
}
impl Clone for SceKernelCallbackInfo {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// Create callback
///
/// @par Example:
/// @code
/// int cbid;
/// cbid = sceKernelCreateCallback("Exit Callback", exit_cb, NULL);
/// @endcode
///
/// @param name - A textual name for the callback
/// @param func - A pointer to a function that will be called as the callback
/// @param arg - Argument for the callback ?
///
/// @return >= 0 A callback id which can be used in subsequent functions, < 0 an error.
pub fn sceKernelCreateCallback(name: *const u8,
func: SceKernelCallbackFunction,
arg: *mut c_void) -> i32;
}
extern "C" {
/// Gets the status of a specified callback.
///
/// @param cb - The UID of the callback to refer.
/// @param status - Pointer to a status structure. The size parameter should be
/// initialised before calling.
///
/// @return < 0 on error.
pub fn sceKernelReferCallbackStatus(cb: SceUID,
status: *mut SceKernelCallbackInfo)
-> i32;
}
extern "C" {
/// Delete a callback
///
/// @param cb - The UID of the specified callback
///
/// @return 0 on success, < 0 on error
pub fn sceKernelDeleteCallback(cb: SceUID) -> i32;
}
extern "C" {
/// Notify a callback
///
/// @param cb - The UID of the specified callback
/// @param arg2 - Passed as arg2 into the callback function
///
/// @return 0 on success, < 0 on error
pub fn sceKernelNotifyCallback(cb: SceUID, arg2: i32) -> i32;
}
extern "C" {
/// Cancel a callback ?
///
/// @param cb - The UID of the specified callback
///
/// @return 0 on succes, < 0 on error
pub fn sceKernelCancelCallback(cb: SceUID) -> i32;
}
extern "C" {
/// Get the callback count
///
/// @param cb - The UID of the specified callback
///
/// @return The callback count, < 0 on error
pub fn sceKernelGetCallbackCount(cb: SceUID) -> i32;
}
extern "C" {
/// Check callback ?
///
/// @return Something or another
pub fn sceKernelCheckCallback() -> i32;
}
#[repr(u32)]
/// Threadman types for ::sceKernelGetThreadmanIdList
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum SceKernelIdListType {
SCE_KERNEL_TMID_Thread = 1,
SCE_KERNEL_TMID_Semaphore = 2,
SCE_KERNEL_TMID_EventFlag = 3,
SCE_KERNEL_TMID_Mbox = 4,
SCE_KERNEL_TMID_Vpl = 5,
SCE_KERNEL_TMID_Fpl = 6,
SCE_KERNEL_TMID_Mpipe = 7,
SCE_KERNEL_TMID_Callback = 8,
SCE_KERNEL_TMID_ThreadEventHandler = 9,
SCE_KERNEL_TMID_Alarm = 10,
SCE_KERNEL_TMID_VTimer = 11,
SCE_KERNEL_TMID_SleepThread = 64,
SCE_KERNEL_TMID_DelayThread = 65,
SCE_KERNEL_TMID_SuspendThread = 66,
SCE_KERNEL_TMID_DormantThread = 67,
}
extern "C" {
/// Get a list of UIDs from threadman. Allows you to enumerate
/// resources such as threads or semaphores.
///
/// @param type - The type of resource to list, one of ::SceKernelIdListType.
/// @param readbuf - A pointer to a buffer to store the list.
/// @param readbufsize - The size of the buffer in SceUID units.
/// @param idcount - Pointer to an integer in which to return the number of ids in the list.
///
/// @return < 0 on error. Either 0 or the same as idcount on success.
pub fn sceKernelGetThreadmanIdList(type_: SceKernelIdListType,
readbuf: *mut SceUID,
readbufsize: i32,
idcount: *mut i32) -> i32;
}
/// Structure to contain the system status returned by ::sceKernelReferSystemStatus
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceKernelSystemStatus {
/// Size of the structure (should be set prior to the call)
pub size: SceSize,
/// The status ?
pub status: SceUInt,
/// The number of cpu clocks in the idle thread
pub idleClocks: SceKernelSysClock,
/// Number of times we resumed from idle
pub comesOutOfIdleCount: SceUInt,
/// Number of thread context switches
pub threadSwitchCount: SceUInt,
/// Number of vfpu switches ?
pub vfpuSwitchCount: SceUInt,
}
#[test]
fn bindgen_test_layout_SceKernelSystemStatus() {
assert_eq!(::core::mem::size_of::<SceKernelSystemStatus>() , 28usize ,
concat ! ( "Size of: " , stringify ! ( SceKernelSystemStatus )
));
assert_eq! (::core::mem::align_of::<SceKernelSystemStatus>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( SceKernelSystemStatus ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelSystemStatus ) ) . size as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelSystemStatus )
, "::" , stringify ! ( size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelSystemStatus ) ) . status as *
const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelSystemStatus )
, "::" , stringify ! ( status ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelSystemStatus ) ) . idleClocks as
* const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelSystemStatus )
, "::" , stringify ! ( idleClocks ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelSystemStatus ) ) .
comesOutOfIdleCount as * const _ as usize } , 16usize , concat
! (
"Alignment of field: " , stringify ! ( SceKernelSystemStatus )
, "::" , stringify ! ( comesOutOfIdleCount ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelSystemStatus ) ) .
threadSwitchCount as * const _ as usize } , 20usize , concat !
(
"Alignment of field: " , stringify ! ( SceKernelSystemStatus )
, "::" , stringify ! ( threadSwitchCount ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelSystemStatus ) ) .
vfpuSwitchCount as * const _ as usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelSystemStatus )
, "::" , stringify ! ( vfpuSwitchCount ) ));
}
impl Clone for SceKernelSystemStatus {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// Get the current system status.
///
/// @param status - Pointer to a ::SceKernelSystemStatus structure.
///
/// @return < 0 on error.
pub fn sceKernelReferSystemStatus(status: *mut SceKernelSystemStatus)
-> i32;
}
extern "C" {
/// Create a message pipe
///
/// @param name - Name of the pipe
/// @param part - ID of the memory partition
/// @param attr - Set to 0?
/// @param unk1 - Unknown
/// @param opt - Message pipe options (set to NULL)
///
/// @return The UID of the created pipe, < 0 on error
pub fn sceKernelCreateMsgPipe(name: *const u8, part: i32,
attr: i32, unk1: *mut c_void,
opt: *mut c_void) -> SceUID;
}
extern "C" {
/// Delete a message pipe
///
/// @param uid - The UID of the pipe
///
/// @return 0 on success, < 0 on error
pub fn sceKernelDeleteMsgPipe(uid: SceUID) -> i32;
}
extern "C" {
/// Send a message to a pipe
///
/// @param uid - The UID of the pipe
/// @param message - Pointer to the message
/// @param size - Size of the message
/// @param unk1 - Unknown
/// @param unk2 - Unknown
/// @param timeout - Timeout for send
///
/// @return 0 on success, < 0 on error
pub fn sceKernelSendMsgPipe(uid: SceUID, message: *mut c_void,
size: u32, unk1: i32,
unk2: *mut c_void, timeout: *mut u32)
-> i32;
}
extern "C" {
/// Send a message to a pipe (with callback)
///
/// @param uid - The UID of the pipe
/// @param message - Pointer to the message
/// @param size - Size of the message
/// @param unk1 - Unknown
/// @param unk2 - Unknown
/// @param timeout - Timeout for send
///
/// @return 0 on success, < 0 on error
pub fn sceKernelSendMsgPipeCB(uid: SceUID, message: *mut c_void,
size: u32, unk1: i32,
unk2: *mut c_void, timeout: *mut u32)
-> i32;
}
extern "C" {
/// Try to send a message to a pipe
///
/// @param uid - The UID of the pipe
/// @param message - Pointer to the message
/// @param size - Size of the message
/// @param unk1 - Unknown
/// @param unk2 - Unknown
///
/// @return 0 on success, < 0 on error
pub fn sceKernelTrySendMsgPipe(uid: SceUID, message: *mut c_void,
size: u32, unk1: i32,
unk2: *mut c_void) -> i32;
}
extern "C" {
/// Receive a message from a pipe
///
/// @param uid - The UID of the pipe
/// @param message - Pointer to the message
/// @param size - Size of the message
/// @param unk1 - Unknown
/// @param unk2 - Unknown
/// @param timeout - Timeout for receive
///
/// @return 0 on success, < 0 on error
pub fn sceKernelReceiveMsgPipe(uid: SceUID, message: *mut c_void,
size: u32, unk1: i32,
unk2: *mut c_void,
timeout: *mut u32) -> i32;
}
extern "C" {
/// Receive a message from a pipe (with callback)
///
/// @param uid - The UID of the pipe
/// @param message - Pointer to the message
/// @param size - Size of the message
/// @param unk1 - Unknown
/// @param unk2 - Unknown
/// @param timeout - Timeout for receive
///
/// @return 0 on success, < 0 on error
pub fn sceKernelReceiveMsgPipeCB(uid: SceUID, message: *mut c_void,
size: u32, unk1: i32,
unk2: *mut c_void,
timeout: *mut u32) -> i32;
}
extern "C" {
/// Receive a message from a pipe
///
/// @param uid - The UID of the pipe
/// @param message - Pointer to the message
/// @param size - Size of the message
/// @param unk1 - Unknown
/// @param unk2 - Unknown
///
/// @return 0 on success, < 0 on error
pub fn sceKernelTryReceiveMsgPipe(uid: SceUID, message: *mut c_void,
size: u32, unk1: i32,
unk2: *mut c_void) -> i32;
}
extern "C" {
/// Cancel a message pipe
///
/// @param uid - UID of the pipe to cancel
/// @param psend - Receive number of sending threads?
/// @param precv - Receive number of receiving threads?
///
/// @return 0 on success, < 0 on error
pub fn sceKernelCancelMsgPipe(uid: SceUID, psend: *mut i32,
precv: *mut i32) -> i32;
}
/// Message Pipe status info
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceKernelMppInfo {
pub size: SceSize,
pub name: [u8; 32usize],
pub attr: SceUInt,
pub bufSize: i32,
pub freeSize: i32,
pub numSendWaitThreads: i32,
pub numReceiveWaitThreads: i32,
}
#[test]
fn bindgen_test_layout_SceKernelMppInfo() {
assert_eq!(::core::mem::size_of::<SceKernelMppInfo>() , 56usize , concat !
( "Size of: " , stringify ! ( SceKernelMppInfo ) ));
assert_eq! (::core::mem::align_of::<SceKernelMppInfo>() , 4usize , concat
! ( "Alignment of " , stringify ! ( SceKernelMppInfo ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelMppInfo ) ) . size as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelMppInfo ) ,
"::" , stringify ! ( size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelMppInfo ) ) . name as * const _
as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelMppInfo ) ,
"::" , stringify ! ( name ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelMppInfo ) ) . attr as * const _
as usize } , 36usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelMppInfo ) ,
"::" , stringify ! ( attr ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelMppInfo ) ) . bufSize as * const
_ as usize } , 40usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelMppInfo ) ,
"::" , stringify ! ( bufSize ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelMppInfo ) ) . freeSize as *
const _ as usize } , 44usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelMppInfo ) ,
"::" , stringify ! ( freeSize ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelMppInfo ) ) . numSendWaitThreads
as * const _ as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelMppInfo ) ,
"::" , stringify ! ( numSendWaitThreads ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelMppInfo ) ) .
numReceiveWaitThreads as * const _ as usize } , 52usize ,
concat ! (
"Alignment of field: " , stringify ! ( SceKernelMppInfo ) ,
"::" , stringify ! ( numReceiveWaitThreads ) ));
}
impl Clone for SceKernelMppInfo {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// Get the status of a Message Pipe
///
/// @param uid - The uid of the Message Pipe
/// @param info - Pointer to a ::SceKernelMppInfo structure
///
/// @return 0 on success, < 0 on error
pub fn sceKernelReferMsgPipeStatus(uid: SceUID,
info: *mut SceKernelMppInfo)
-> i32;
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceKernelVplOptParam {
pub size: SceSize,
}
#[test]
fn bindgen_test_layout_SceKernelVplOptParam() {
assert_eq!(::core::mem::size_of::<SceKernelVplOptParam>() , 4usize ,
concat ! ( "Size of: " , stringify ! ( SceKernelVplOptParam )
));
assert_eq! (::core::mem::align_of::<SceKernelVplOptParam>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( SceKernelVplOptParam ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelVplOptParam ) ) . size as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelVplOptParam )
, "::" , stringify ! ( size ) ));
}
impl Clone for SceKernelVplOptParam {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// Create a variable pool
///
/// @param name - Name of the pool
/// @param part - The memory partition ID
/// @param attr - Attributes
/// @param size - Size of pool
/// @param opt - Options (set to NULL)
///
/// @return The UID of the created pool, < 0 on error.
pub fn sceKernelCreateVpl(name: *const u8, part: i32,
attr: i32, size: u32,
opt: *mut SceKernelVplOptParam) -> SceUID;
}
extern "C" {
/// Delete a variable pool
///
/// @param uid - The UID of the pool
///
/// @return 0 on success, < 0 on error
pub fn sceKernelDeleteVpl(uid: SceUID) -> i32;
}
extern "C" {
/// Allocate from the pool
///
/// @param uid - The UID of the pool
/// @param size - The size to allocate
/// @param data - Receives the address of the allocated data
/// @param timeout - Amount of time to wait for allocation?
///
/// @return 0 on success, < 0 on error
pub fn sceKernelAllocateVpl(uid: SceUID, size: u32,
data: *mut *mut c_void,
timeout: *mut u32) -> i32;
}
extern "C" {
/// Allocate from the pool (with callback)
///
/// @param uid - The UID of the pool
/// @param size - The size to allocate
/// @param data - Receives the address of the allocated data
/// @param timeout - Amount of time to wait for allocation?
///
/// @return 0 on success, < 0 on error
pub fn sceKernelAllocateVplCB(uid: SceUID, size: u32,
data: *mut *mut c_void,
timeout: *mut u32) -> i32;
}
extern "C" {
/// Try to allocate from the pool
///
/// @param uid - The UID of the pool
/// @param size - The size to allocate
/// @param data - Receives the address of the allocated data
///
/// @return 0 on success, < 0 on error
pub fn sceKernelTryAllocateVpl(uid: SceUID, size: u32,
data: *mut *mut c_void) -> i32;
}
extern "C" {
/// Free a block
///
/// @param uid - The UID of the pool
/// @param data - The data block to deallocate
///
/// @return 0 on success, < 0 on error
pub fn sceKernelFreeVpl(uid: SceUID, data: *mut c_void) -> i32;
}
extern "C" {
/// Cancel a pool
///
/// @param uid - The UID of the pool
/// @param pnum - Receives the number of waiting threads
///
/// @return 0 on success, < 0 on error
pub fn sceKernelCancelVpl(uid: SceUID, pnum: *mut i32) -> i32;
}
/// Variable pool status info
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceKernelVplInfo {
pub size: SceSize,
pub name: [u8; 32usize],
pub attr: SceUInt,
pub poolSize: i32,
pub freeSize: i32,
pub numWaitThreads: i32,
}
#[test]
fn bindgen_test_layout_SceKernelVplInfo() {
assert_eq!(::core::mem::size_of::<SceKernelVplInfo>() , 52usize , concat !
( "Size of: " , stringify ! ( SceKernelVplInfo ) ));
assert_eq! (::core::mem::align_of::<SceKernelVplInfo>() , 4usize , concat
! ( "Alignment of " , stringify ! ( SceKernelVplInfo ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelVplInfo ) ) . size as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelVplInfo ) ,
"::" , stringify ! ( size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelVplInfo ) ) . name as * const _
as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelVplInfo ) ,
"::" , stringify ! ( name ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelVplInfo ) ) . attr as * const _
as usize } , 36usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelVplInfo ) ,
"::" , stringify ! ( attr ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelVplInfo ) ) . poolSize as *
const _ as usize } , 40usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelVplInfo ) ,
"::" , stringify ! ( poolSize ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelVplInfo ) ) . freeSize as *
const _ as usize } , 44usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelVplInfo ) ,
"::" , stringify ! ( freeSize ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelVplInfo ) ) . numWaitThreads as
* const _ as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelVplInfo ) ,
"::" , stringify ! ( numWaitThreads ) ));
}
impl Clone for SceKernelVplInfo {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// Get the status of an VPL
///
/// @param uid - The uid of the VPL
/// @param info - Pointer to a ::SceKernelVplInfo structure
///
/// @return 0 on success, < 0 on error
pub fn sceKernelReferVplStatus(uid: SceUID, info: *mut SceKernelVplInfo)
-> i32;
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceKernelFplOptParam {
pub size: SceSize,
}
#[test]
fn bindgen_test_layout_SceKernelFplOptParam() {
assert_eq!(::core::mem::size_of::<SceKernelFplOptParam>() , 4usize ,
concat ! ( "Size of: " , stringify ! ( SceKernelFplOptParam )
));
assert_eq! (::core::mem::align_of::<SceKernelFplOptParam>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( SceKernelFplOptParam ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelFplOptParam ) ) . size as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelFplOptParam )
, "::" , stringify ! ( size ) ));
}
impl Clone for SceKernelFplOptParam {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// Create a fixed pool
///
/// @param name - Name of the pool
/// @param part - The memory partition ID
/// @param attr - Attributes
/// @param size - Size of pool block
/// @param blocks - Number of blocks to allocate
/// @param opt - Options (set to NULL)
///
/// @return The UID of the created pool, < 0 on error.
pub fn sceKernelCreateFpl(name: *const u8, part: i32,
attr: i32, size: u32, blocks: u32,
opt: *mut SceKernelFplOptParam) -> i32;
}
extern "C" {
/// Delete a fixed pool
///
/// @param uid - The UID of the pool
///
/// @return 0 on success, < 0 on error
pub fn sceKernelDeleteFpl(uid: SceUID) -> i32;
}
extern "C" {
/// Allocate from the pool
///
/// @param uid - The UID of the pool
/// @param data - Receives the address of the allocated data
/// @param timeout - Amount of time to wait for allocation?
///
/// @return 0 on success, < 0 on error
pub fn sceKernelAllocateFpl(uid: SceUID, data: *mut *mut c_void,
timeout: *mut u32) -> i32;
}
extern "C" {
/// Allocate from the pool (with callback)
///
/// @param uid - The UID of the pool
/// @param data - Receives the address of the allocated data
/// @param timeout - Amount of time to wait for allocation?
///
/// @return 0 on success, < 0 on error
pub fn sceKernelAllocateFplCB(uid: SceUID, data: *mut *mut c_void,
timeout: *mut u32) -> i32;
}
extern "C" {
/// Try to allocate from the pool
///
/// @param uid - The UID of the pool
/// @param data - Receives the address of the allocated data
///
/// @return 0 on success, < 0 on error
pub fn sceKernelTryAllocateFpl(uid: SceUID, data: *mut *mut c_void)
-> i32;
}
extern "C" {
/// Free a block
///
/// @param uid - The UID of the pool
/// @param data - The data block to deallocate
///
/// @return 0 on success, < 0 on error
pub fn sceKernelFreeFpl(uid: SceUID, data: *mut c_void) -> i32;
}
extern "C" {
/// Cancel a pool
///
/// @param uid - The UID of the pool
/// @param pnum - Receives the number of waiting threads
///
/// @return 0 on success, < 0 on error
pub fn sceKernelCancelFpl(uid: SceUID, pnum: *mut i32) -> i32;
}
/// Fixed pool status information
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceKernelFplInfo {
pub size: SceSize,
pub name: [u8; 32usize],
pub attr: SceUInt,
pub blockSize: i32,
pub numBlocks: i32,
pub freeBlocks: i32,
pub numWaitThreads: i32,
}
#[test]
fn bindgen_test_layout_SceKernelFplInfo() {
assert_eq!(::core::mem::size_of::<SceKernelFplInfo>() , 56usize , concat !
( "Size of: " , stringify ! ( SceKernelFplInfo ) ));
assert_eq! (::core::mem::align_of::<SceKernelFplInfo>() , 4usize , concat
! ( "Alignment of " , stringify ! ( SceKernelFplInfo ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelFplInfo ) ) . size as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelFplInfo ) ,
"::" , stringify ! ( size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelFplInfo ) ) . name as * const _
as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelFplInfo ) ,
"::" , stringify ! ( name ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelFplInfo ) ) . attr as * const _
as usize } , 36usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelFplInfo ) ,
"::" , stringify ! ( attr ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelFplInfo ) ) . blockSize as *
const _ as usize } , 40usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelFplInfo ) ,
"::" , stringify ! ( blockSize ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelFplInfo ) ) . numBlocks as *
const _ as usize } , 44usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelFplInfo ) ,
"::" , stringify ! ( numBlocks ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelFplInfo ) ) . freeBlocks as *
const _ as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelFplInfo ) ,
"::" , stringify ! ( freeBlocks ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelFplInfo ) ) . numWaitThreads as
* const _ as usize } , 52usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelFplInfo ) ,
"::" , stringify ! ( numWaitThreads ) ));
}
impl Clone for SceKernelFplInfo {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// Get the status of an FPL
///
/// @param uid - The uid of the FPL
/// @param info - Pointer to a ::SceKernelFplInfo structure
///
/// @return 0 on success, < 0 on error
pub fn sceKernelReferFplStatus(uid: SceUID, info: *mut SceKernelFplInfo)
-> i32;
}
extern "C" {
/// Return from a timer handler (doesn't seem to do alot)
pub fn _sceKernelReturnFromTimerHandler();
}
extern "C" {
/// Return from a callback (used as a syscall for the return
/// of the callback function)
pub fn _sceKernelReturnFromCallback();
}
extern "C" {
/// Convert a number of microseconds to a ::SceKernelSysClock structure
///
/// @param usec - Number of microseconds
/// @param clock - Pointer to a ::SceKernelSysClock structure
///
/// @return 0 on success, < 0 on error
pub fn sceKernelUSec2SysClock(usec: u32,
clock: *mut SceKernelSysClock) -> i32;
}
extern "C" {
/// Convert a number of microseconds to a wide time
///
/// @param usec - Number of microseconds.
///
/// @return The time
pub fn sceKernelUSec2SysClockWide(usec: u32) -> SceInt64;
}
extern "C" {
/// Convert a ::SceKernelSysClock structure to microseconds
///
/// @param clock - Pointer to a ::SceKernelSysClock structure
/// @param low - Pointer to the low part of the time
/// @param high - Pointer to the high part of the time
///
/// @return 0 on success, < 0 on error
pub fn sceKernelSysClock2USec(clock: *mut SceKernelSysClock,
low: *mut u32, high: *mut u32)
-> i32;
}
extern "C" {
/// Convert a wide time to microseconds
///
/// @param clock - Wide time
/// @param low - Pointer to the low part of the time
/// @param high - Pointer to the high part of the time
///
/// @return 0 on success, < 0 on error
pub fn sceKernelSysClock2USecWide(clock: SceInt64, low: *mut u32,
high: *mut u32) -> i32;
}
extern "C" {
/// Get the system time
///
/// @param time - Pointer to a ::SceKernelSysClock structure
///
/// @return 0 on success, < 0 on error
pub fn sceKernelGetSystemTime(time: *mut SceKernelSysClock) -> i32;
}
extern "C" {
/// Get the system time (wide version)
///
/// @return The system time
pub fn sceKernelGetSystemTimeWide() -> SceInt64;
}
extern "C" {
/// Get the low 32bits of the current system time
///
/// @return The low 32bits of the system time
pub fn sceKernelGetSystemTimeLow() -> u32;
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceKernelVTimerOptParam {
pub size: SceSize,
}
#[test]
fn bindgen_test_layout_SceKernelVTimerOptParam() {
assert_eq!(::core::mem::size_of::<SceKernelVTimerOptParam>() , 4usize ,
concat ! (
"Size of: " , stringify ! ( SceKernelVTimerOptParam ) ));
assert_eq! (::core::mem::align_of::<SceKernelVTimerOptParam>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( SceKernelVTimerOptParam ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelVTimerOptParam ) ) . size as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelVTimerOptParam
) , "::" , stringify ! ( size ) ));
}
impl Clone for SceKernelVTimerOptParam {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// Create a virtual timer
///
/// @param name - Name for the timer.
/// @param opt - Pointer to an ::SceKernelVTimerOptParam (pass NULL)
///
/// @return The VTimer's UID or < 0 on error.
pub fn sceKernelCreateVTimer(name: *const u8,
opt: *mut SceKernelVTimerOptParam) -> SceUID;
}
extern "C" {
/// Delete a virtual timer
///
/// @param uid - The UID of the timer
///
/// @return < 0 on error.
pub fn sceKernelDeleteVTimer(uid: SceUID) -> i32;
}
extern "C" {
/// Get the timer base
///
/// @param uid - UID of the vtimer
/// @param base - Pointer to a ::SceKernelSysClock structure
///
/// @return 0 on success, < 0 on error
pub fn sceKernelGetVTimerBase(uid: SceUID, base: *mut SceKernelSysClock)
-> i32;
}
extern "C" {
/// Get the timer base (wide format)
///
/// @param uid - UID of the vtimer
///
/// @return The 64bit timer base
pub fn sceKernelGetVTimerBaseWide(uid: SceUID) -> SceInt64;
}
extern "C" {
/// Get the timer time
///
/// @param uid - UID of the vtimer
/// @param time - Pointer to a ::SceKernelSysClock structure
///
/// @return 0 on success, < 0 on error
pub fn sceKernelGetVTimerTime(uid: SceUID, time: *mut SceKernelSysClock)
-> i32;
}
extern "C" {
/// Get the timer time (wide format)
///
/// @param uid - UID of the vtimer
///
/// @return The 64bit timer time
pub fn sceKernelGetVTimerTimeWide(uid: SceUID) -> SceInt64;
}
extern "C" {
/// Set the timer time
///
/// @param uid - UID of the vtimer
/// @param time - Pointer to a ::SceKernelSysClock structure
///
/// @return 0 on success, < 0 on error
pub fn sceKernelSetVTimerTime(uid: SceUID, time: *mut SceKernelSysClock)
-> i32;
}
extern "C" {
/// Set the timer time (wide format)
///
/// @param uid - UID of the vtimer
/// @param time - Pointer to a ::SceKernelSysClock structure
///
/// @return Possibly the last time
pub fn sceKernelSetVTimerTimeWide(uid: SceUID, time: SceInt64)
-> SceInt64;
}
extern "C" {
/// Start a virtual timer
///
/// @param uid - The UID of the timer
///
/// @return < 0 on error
pub fn sceKernelStartVTimer(uid: SceUID) -> i32;
}
extern "C" {
/// Stop a virtual timer
///
/// @param uid - The UID of the timer
///
/// @return < 0 on error
pub fn sceKernelStopVTimer(uid: SceUID) -> i32;
}
pub type SceKernelVTimerHandler =
::core::option::Option<unsafe extern "C" fn(uid: SceUID,
arg1: *mut SceKernelSysClock,
arg2: *mut SceKernelSysClock,
arg3: *mut c_void)
-> SceUInt>;
pub type SceKernelVTimerHandlerWide =
::core::option::Option<unsafe extern "C" fn(uid: SceUID, arg1: SceInt64,
arg2: SceInt64,
arg3: *mut c_void)
-> SceUInt>;
extern "C" {
/// Set the timer handler
///
/// @param uid - UID of the vtimer
/// @param time - Time to call the handler?
/// @param handler - The timer handler
/// @param common - Common pointer
///
/// @return 0 on success, < 0 on error
pub fn sceKernelSetVTimerHandler(uid: SceUID,
time: *mut SceKernelSysClock,
handler: SceKernelVTimerHandler,
common: *mut c_void) -> i32;
}
extern "C" {
/// Set the timer handler (wide mode)
///
/// @param uid - UID of the vtimer
/// @param time - Time to call the handler?
/// @param handler - The timer handler
/// @param common - Common pointer
///
/// @return 0 on success, < 0 on error
pub fn sceKernelSetVTimerHandlerWide(uid: SceUID, time: SceInt64,
handler: SceKernelVTimerHandlerWide,
common: *mut c_void) -> i32;
}
extern "C" {
/// Cancel the timer handler
///
/// @param uid - The UID of the vtimer
///
/// @return 0 on success, < 0 on error
pub fn sceKernelCancelVTimerHandler(uid: SceUID) -> i32;
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceKernelVTimerInfo {
pub size: SceSize,
pub name: [u8; 32usize],
pub active: i32,
pub base: SceKernelSysClock,
pub current: SceKernelSysClock,
pub schedule: SceKernelSysClock,
pub handler: SceKernelVTimerHandler,
pub common: *mut c_void,
}
#[test]
fn bindgen_test_layout_SceKernelVTimerInfo() {
assert_eq!(::core::mem::size_of::<SceKernelVTimerInfo>() , 80usize ,
concat ! ( "Size of: " , stringify ! ( SceKernelVTimerInfo )
));
assert_eq! (::core::mem::align_of::<SceKernelVTimerInfo>() , 8usize ,
concat ! (
"Alignment of " , stringify ! ( SceKernelVTimerInfo ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelVTimerInfo ) ) . size as * const
_ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelVTimerInfo ) ,
"::" , stringify ! ( size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelVTimerInfo ) ) . name as * const
_ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelVTimerInfo ) ,
"::" , stringify ! ( name ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelVTimerInfo ) ) . active as *
const _ as usize } , 36usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelVTimerInfo ) ,
"::" , stringify ! ( active ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelVTimerInfo ) ) . base as * const
_ as usize } , 40usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelVTimerInfo ) ,
"::" , stringify ! ( base ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelVTimerInfo ) ) . current as *
const _ as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelVTimerInfo ) ,
"::" , stringify ! ( current ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelVTimerInfo ) ) . schedule as *
const _ as usize } , 56usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelVTimerInfo ) ,
"::" , stringify ! ( schedule ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelVTimerInfo ) ) . handler as *
const _ as usize } , 64usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelVTimerInfo ) ,
"::" , stringify ! ( handler ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelVTimerInfo ) ) . common as *
const _ as usize } , 72usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelVTimerInfo ) ,
"::" , stringify ! ( common ) ));
}
impl Clone for SceKernelVTimerInfo {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// Get the status of a VTimer
///
/// @param uid - The uid of the VTimer
/// @param info - Pointer to a ::SceKernelVTimerInfo structure
///
/// @return 0 on success, < 0 on error
pub fn sceKernelReferVTimerStatus(uid: SceUID,
info: *mut SceKernelVTimerInfo)
-> i32;
}
extern "C" {
/// Exit the thread (probably used as the syscall when the main thread
/// returns
pub fn _sceKernelExitThread();
}
extern "C" {
/// Get the type of a threadman uid
///
/// @param uid - The uid to get the type from
///
/// @return The type, < 0 on error
pub fn sceKernelGetThreadmanIdType(uid: SceUID) -> SceKernelIdListType;
}
pub type SceKernelThreadEventHandler =
::core::option::Option<unsafe extern "C" fn(mask: i32, thid: SceUID,
common: *mut c_void)
-> i32>;
/// Struct for event handler info
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceKernelThreadEventHandlerInfo {
pub size: SceSize,
pub name: [u8; 32usize],
pub threadId: SceUID,
pub mask: i32,
pub handler: SceKernelThreadEventHandler,
pub common: *mut c_void,
}
#[test]
fn bindgen_test_layout_SceKernelThreadEventHandlerInfo() {
assert_eq!(::core::mem::size_of::<SceKernelThreadEventHandlerInfo>() ,
64usize , concat ! (
"Size of: " , stringify ! ( SceKernelThreadEventHandlerInfo )
));
assert_eq! (::core::mem::align_of::<SceKernelThreadEventHandlerInfo>() ,
8usize , concat ! (
"Alignment of " , stringify ! (
SceKernelThreadEventHandlerInfo ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadEventHandlerInfo ) ) .
size as * const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! (
SceKernelThreadEventHandlerInfo ) , "::" , stringify ! ( size
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadEventHandlerInfo ) ) .
name as * const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! (
SceKernelThreadEventHandlerInfo ) , "::" , stringify ! ( name
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadEventHandlerInfo ) ) .
threadId as * const _ as usize } , 36usize , concat ! (
"Alignment of field: " , stringify ! (
SceKernelThreadEventHandlerInfo ) , "::" , stringify ! (
threadId ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadEventHandlerInfo ) ) .
mask as * const _ as usize } , 40usize , concat ! (
"Alignment of field: " , stringify ! (
SceKernelThreadEventHandlerInfo ) , "::" , stringify ! ( mask
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadEventHandlerInfo ) ) .
handler as * const _ as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! (
SceKernelThreadEventHandlerInfo ) , "::" , stringify ! (
handler ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadEventHandlerInfo ) ) .
common as * const _ as usize } , 56usize , concat ! (
"Alignment of field: " , stringify ! (
SceKernelThreadEventHandlerInfo ) , "::" , stringify ! (
common ) ));
}
impl Clone for SceKernelThreadEventHandlerInfo {
fn clone(&self) -> Self { *self }
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum ThreadEventIds {
THREADEVENT_ALL = 4294967295,
THREADEVENT_KERN = 4294967288,
THREADEVENT_USER = 4294967280,
THREADEVENT_CURRENT = 0,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum ThreadEvents {
THREAD_CREATE = 1,
THREAD_START = 2,
THREAD_EXIT = 4,
THREAD_DELETE = 8,
}
extern "C" {
/// Register a thread event handler
///
/// @param name - Name for the thread event handler
/// @param threadID - Thread ID to monitor
/// @param mask - Bit mask for what events to handle (only lowest 4 bits valid)
/// @param handler - Pointer to a ::SceKernelThreadEventHandler function
/// @param common - Common pointer
///
/// @return The UID of the create event handler, < 0 on error
pub fn sceKernelRegisterThreadEventHandler(name: *const u8,
threadID: SceUID,
mask: i32,
handler:
SceKernelThreadEventHandler,
common: *mut c_void)
-> SceUID;
}
extern "C" {
/// Release a thread event handler.
///
/// @param uid - The UID of the event handler
///
/// @return 0 on success, < 0 on error
pub fn sceKernelReleaseThreadEventHandler(uid: SceUID) -> i32;
}
extern "C" {
/// Refer the status of an thread event handler
///
/// @param uid - The UID of the event handler
/// @param info - Pointer to a ::SceKernelThreadEventHandlerInfo structure
///
/// @return 0 on success, < 0 on error
pub fn sceKernelReferThreadEventHandlerStatus(uid: SceUID,
info:
*mut SceKernelThreadEventHandlerInfo)
-> i32;
}
extern "C" {
/// Get the thread profiler registers.
/// @return Pointer to the registers, NULL on error
pub fn sceKernelReferThreadProfiler() -> *mut PspDebugProfilerRegs;
}
extern "C" {
/// Get the globile profiler registers.
/// @return Pointer to the registers, NULL on error
pub fn sceKernelReferGlobalProfiler() -> *mut PspDebugProfilerRegs;
}
pub type __int8_t = i8;
pub type __uint8_t = u8;
pub type __int16_t = i16;
pub type __uint16_t = u16;
pub type __int_least16_t = __int16_t;
pub type __uint_least16_t = __uint16_t;
pub type __int32_t = i32;
pub type __uint32_t = u32;
pub type __int_least32_t = __int32_t;
pub type __uint_least32_t = __uint32_t;
pub type __int64_t = i32;
pub type __uint64_t = u32;
pub type _LOCK_T = i32;
pub type _LOCK_RECURSIVE_T = i32;
pub type _off_t = i32;
pub type __dev_t = i16;
pub type __uid_t = u16;
pub type __gid_t = u16;
pub type _off64_t = i64;
pub type _fpos_t = i32;
pub type _ssize_t = i32;
pub type wint_t = u32;
#[repr(C)]
#[derive(Copy)]
pub struct _mbstate_t {
pub __count: i32,
pub __value: _mbstate_t__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy)]
pub union _mbstate_t__bindgen_ty_1 {
pub __wch: wint_t,
pub __wchb: [u8; 4usize],
_bindgen_union_align: u32,
}
#[test]
fn bindgen_test_layout__mbstate_t__bindgen_ty_1() {
assert_eq!(::core::mem::size_of::<_mbstate_t__bindgen_ty_1>() , 4usize ,
concat ! (
"Size of: " , stringify ! ( _mbstate_t__bindgen_ty_1 ) ));
assert_eq! (::core::mem::align_of::<_mbstate_t__bindgen_ty_1>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( _mbstate_t__bindgen_ty_1 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _mbstate_t__bindgen_ty_1 ) ) . __wch as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! (
_mbstate_t__bindgen_ty_1 ) , "::" , stringify ! ( __wch ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _mbstate_t__bindgen_ty_1 ) ) . __wchb as
* const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! (
_mbstate_t__bindgen_ty_1 ) , "::" , stringify ! ( __wchb ) ));
}
impl Clone for _mbstate_t__bindgen_ty_1 {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout__mbstate_t() {
assert_eq!(::core::mem::size_of::<_mbstate_t>() , 8usize , concat ! (
"Size of: " , stringify ! ( _mbstate_t ) ));
assert_eq! (::core::mem::align_of::<_mbstate_t>() , 4usize , concat ! (
"Alignment of " , stringify ! ( _mbstate_t ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _mbstate_t ) ) . __count as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( _mbstate_t ) , "::" ,
stringify ! ( __count ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _mbstate_t ) ) . __value as * const _ as
usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( _mbstate_t ) , "::" ,
stringify ! ( __value ) ));
}
impl Clone for _mbstate_t {
fn clone(&self) -> Self { *self }
}
pub type _flock_t = _LOCK_RECURSIVE_T;
pub type _iconv_t = *mut c_void;
pub type wchar_t = i32;
#[repr(C)]
#[derive(Debug, Copy)]
pub struct max_align_t {
pub __clang_max_align_nonce1: i64,
pub __bindgen_padding_0: u64,
pub __clang_max_align_nonce2: f64,
}
#[test]
fn bindgen_test_layout_max_align_t() {
assert_eq!(::core::mem::size_of::<max_align_t>() , 32usize , concat ! (
"Size of: " , stringify ! ( max_align_t ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const max_align_t ) ) .
__clang_max_align_nonce1 as * const _ as usize } , 0usize ,
concat ! (
"Alignment of field: " , stringify ! ( max_align_t ) , "::" ,
stringify ! ( __clang_max_align_nonce1 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const max_align_t ) ) .
__clang_max_align_nonce2 as * const _ as usize } , 16usize ,
concat ! (
"Alignment of field: " , stringify ! ( max_align_t ) , "::" ,
stringify ! ( __clang_max_align_nonce2 ) ));
}
impl Clone for max_align_t {
fn clone(&self) -> Self { *self }
}
pub type __off_t = i32;
pub type __pid_t = i32;
pub type __loff_t = i64;
pub type u_char = u8;
pub type u_short = u16;
pub type u_int = u32;
pub type u_long = u32;
pub type ushort = u16;
pub type uint = u32;
pub type ulong = u32;
pub type clock_t = u32;
pub type time_t = i32;
#[repr(C)]
#[derive(Debug, Copy)]
pub struct timespec {
pub tv_sec: time_t,
pub tv_nsec: i32,
}
#[test]
fn bindgen_test_layout_timespec() {
assert_eq!(::core::mem::size_of::<timespec>() , 16usize , concat ! (
"Size of: " , stringify ! ( timespec ) ));
assert_eq! (::core::mem::align_of::<timespec>() , 8usize , concat ! (
"Alignment of " , stringify ! ( timespec ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const timespec ) ) . tv_sec as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( timespec ) , "::" ,
stringify ! ( tv_sec ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const timespec ) ) . tv_nsec as * const _ as
usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( timespec ) , "::" ,
stringify ! ( tv_nsec ) ));
}
impl Clone for timespec {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct itimerspec {
pub it_interval: timespec,
pub it_value: timespec,
}
#[test]
fn bindgen_test_layout_itimerspec() {
assert_eq!(::core::mem::size_of::<itimerspec>() , 32usize , concat ! (
"Size of: " , stringify ! ( itimerspec ) ));
assert_eq! (::core::mem::align_of::<itimerspec>() , 8usize , concat ! (
"Alignment of " , stringify ! ( itimerspec ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const itimerspec ) ) . it_interval as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( itimerspec ) , "::" ,
stringify ! ( it_interval ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const itimerspec ) ) . it_value as * const _ as
usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( itimerspec ) , "::" ,
stringify ! ( it_value ) ));
}
impl Clone for itimerspec {
fn clone(&self) -> Self { *self }
}
pub type daddr_t = i32;
pub type caddr_t = *mut u8;
pub type ino_t = u16;
pub type off_t = _off_t;
pub type dev_t = __dev_t;
pub type uid_t = __uid_t;
pub type gid_t = __gid_t;
pub type pid_t = i32;
pub type key_t = i32;
pub type mode_t = u32;
pub type nlink_t = u16;
pub type fd_mask = i32;
#[repr(C)]
#[derive(Debug, Copy)]
pub struct _types_fd_set {
pub fds_bits: [fd_mask; 1usize],
}
#[test]
fn bindgen_test_layout__types_fd_set() {
assert_eq!(::core::mem::size_of::<_types_fd_set>() , 8usize , concat ! (
"Size of: " , stringify ! ( _types_fd_set ) ));
assert_eq! (::core::mem::align_of::<_types_fd_set>() , 8usize , concat ! (
"Alignment of " , stringify ! ( _types_fd_set ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _types_fd_set ) ) . fds_bits as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( _types_fd_set ) , "::"
, stringify ! ( fds_bits ) ));
}
impl Clone for _types_fd_set {
fn clone(&self) -> Self { *self }
}
pub type clockid_t = u32;
pub type timer_t = u32;
pub type useconds_t = u32;
pub type suseconds_t = i32;
#[repr(C)]
#[derive(Debug, Copy)]
pub struct timeval {
pub tv_sec: time_t,
pub tv_usec: suseconds_t,
}
#[test]
fn bindgen_test_layout_timeval() {
assert_eq!(::core::mem::size_of::<timeval>() , 16usize , concat ! (
"Size of: " , stringify ! ( timeval ) ));
assert_eq! (::core::mem::align_of::<timeval>() , 8usize , concat ! (
"Alignment of " , stringify ! ( timeval ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const timeval ) ) . tv_sec as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( timeval ) , "::" ,
stringify ! ( tv_sec ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const timeval ) ) . tv_usec as * const _ as
usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( timeval ) , "::" ,
stringify ! ( tv_usec ) ));
}
impl Clone for timeval {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct timezone {
pub tz_minuteswest: i32,
pub tz_dsttime: i32,
}
#[test]
fn bindgen_test_layout_timezone() {
assert_eq!(::core::mem::size_of::<timezone>() , 8usize , concat ! (
"Size of: " , stringify ! ( timezone ) ));
assert_eq! (::core::mem::align_of::<timezone>() , 4usize , concat ! (
"Alignment of " , stringify ! ( timezone ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const timezone ) ) . tz_minuteswest as * const
_ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( timezone ) , "::" ,
stringify ! ( tz_minuteswest ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const timezone ) ) . tz_dsttime as * const _ as
usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( timezone ) , "::" ,
stringify ! ( tz_dsttime ) ));
}
impl Clone for timezone {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct itimerval {
pub it_interval: timeval,
pub it_value: timeval,
}
#[test]
fn bindgen_test_layout_itimerval() {
assert_eq!(::core::mem::size_of::<itimerval>() , 32usize , concat ! (
"Size of: " , stringify ! ( itimerval ) ));
assert_eq! (::core::mem::align_of::<itimerval>() , 8usize , concat ! (
"Alignment of " , stringify ! ( itimerval ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const itimerval ) ) . it_interval as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( itimerval ) , "::" ,
stringify ! ( it_interval ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const itimerval ) ) . it_value as * const _ as
usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( itimerval ) , "::" ,
stringify ! ( it_value ) ));
}
impl Clone for itimerval {
fn clone(&self) -> Self { *self }
}
extern "C" {
pub fn gettimeofday(__p: *mut timeval, __tz: *mut c_void) -> i32;
}
extern "C" {
pub fn settimeofday(arg1: *const timeval, arg2: *const timezone)
-> i32;
}
extern "C" {
pub fn utimes(__path: *const u8, __tvp: *const timeval) -> i32;
}
extern "C" {
pub fn getitimer(__which: i32, __value: *mut itimerval) -> i32;
}
extern "C" {
pub fn setitimer(__which: i32, __value: *const itimerval,
__ovalue: *mut itimerval) -> i32;
}
extern "C" {
/// Get the time in seconds since the epoc (1st Jan 1970)
///
pub fn sceKernelLibcTime(t: *mut time_t) -> time_t;
}
extern "C" {
/// Get the processor clock used since the start of the process
pub fn sceKernelLibcClock() -> clock_t;
}
extern "C" {
/// Get the current time of time and time zone information
pub fn sceKernelLibcGettimeofday(tp: *mut timeval, tzp: *mut timezone)
-> i32;
}
extern "C" {
/// Write back the data cache to memory
pub fn sceKernelDcacheWritebackAll();
}
extern "C" {
/// Write back and invalidate the data cache
pub fn sceKernelDcacheWritebackInvalidateAll();
}
extern "C" {
/// Write back a range of addresses from the data cache to memory
pub fn sceKernelDcacheWritebackRange(p: *const c_void, size: u32);
}
extern "C" {
/// Write back and invalidate a range of addresses in the data cache
pub fn sceKernelDcacheWritebackInvalidateRange(p: *const c_void,
size: u32);
}
extern "C" {
/// Invalidate a range of addresses in data cache
pub fn sceKernelDcacheInvalidateRange(p: *const c_void, size: u32);
}
extern "C" {
/// Invalidate the instruction cache
pub fn sceKernelIcacheInvalidateAll();
}
extern "C" {
/// Invalidate a range of addresses in the instruction cache
pub fn sceKernelIcacheInvalidateRange(p: *const c_void, size: u32);
}
/// Structure for holding a mersenne twister context
#[repr(C)]
#[derive(Copy)]
pub struct _SceKernelUtilsMt19937Context {
pub count: u32,
pub state: [u32; 624usize],
}
#[test]
fn bindgen_test_layout__SceKernelUtilsMt19937Context() {
assert_eq!(::core::mem::size_of::<_SceKernelUtilsMt19937Context>() ,
2500usize , concat ! (
"Size of: " , stringify ! ( _SceKernelUtilsMt19937Context ) ));
assert_eq! (::core::mem::align_of::<_SceKernelUtilsMt19937Context>() ,
4usize , concat ! (
"Alignment of " , stringify ! ( _SceKernelUtilsMt19937Context
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _SceKernelUtilsMt19937Context ) ) . count
as * const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! (
_SceKernelUtilsMt19937Context ) , "::" , stringify ! ( count )
));
assert_eq! (unsafe {
& ( * ( 0 as * const _SceKernelUtilsMt19937Context ) ) . state
as * const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! (
_SceKernelUtilsMt19937Context ) , "::" , stringify ! ( state )
));
}
impl Clone for _SceKernelUtilsMt19937Context {
fn clone(&self) -> Self { *self }
}
/// Structure for holding a mersenne twister context
pub type SceKernelUtilsMt19937Context = _SceKernelUtilsMt19937Context;
extern "C" {
/// Function to initialise a mersenne twister context.
///
/// @param ctx - Pointer to a context
/// @param seed - A seed for the random function.
///
/// @par Example:
/// @code
/// SceKernelUtilsMt19937Context ctx;
/// sceKernelUtilsMt19937Init(&ctx, time(NULL));
/// u23 rand_val = sceKernelUtilsMt19937UInt(&ctx);
/// @endcode
///
/// @return < 0 on error.
pub fn sceKernelUtilsMt19937Init(ctx: *mut SceKernelUtilsMt19937Context,
seed: u32) -> i32;
}
extern "C" {
/// Function to return a new psuedo random number.
///
/// @param ctx - Pointer to a pre-initialised context.
/// @return A pseudo random number (between 0 and MAX_INT).
pub fn sceKernelUtilsMt19937UInt(ctx: *mut SceKernelUtilsMt19937Context)
-> u32;
}
/// Structure to hold the MD5 context
#[repr(C)]
#[derive(Copy)]
pub struct _SceKernelUtilsMd5Context {
pub h: [u32; 4usize],
pub pad: u32,
pub usRemains: SceUShort16,
pub usComputed: SceUShort16,
pub ullTotalLen: SceULong64,
pub buf: [u8; 64usize],
}
#[test]
fn bindgen_test_layout__SceKernelUtilsMd5Context() {
assert_eq!(::core::mem::size_of::<_SceKernelUtilsMd5Context>() , 96usize ,
concat ! (
"Size of: " , stringify ! ( _SceKernelUtilsMd5Context ) ));
assert_eq! (::core::mem::align_of::<_SceKernelUtilsMd5Context>() , 8usize
, concat ! (
"Alignment of " , stringify ! ( _SceKernelUtilsMd5Context )
));
assert_eq! (unsafe {
& ( * ( 0 as * const _SceKernelUtilsMd5Context ) ) . h as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! (
_SceKernelUtilsMd5Context ) , "::" , stringify ! ( h ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _SceKernelUtilsMd5Context ) ) . pad as *
const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! (
_SceKernelUtilsMd5Context ) , "::" , stringify ! ( pad ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _SceKernelUtilsMd5Context ) ) . usRemains
as * const _ as usize } , 20usize , concat ! (
"Alignment of field: " , stringify ! (
_SceKernelUtilsMd5Context ) , "::" , stringify ! ( usRemains )
));
assert_eq! (unsafe {
& ( * ( 0 as * const _SceKernelUtilsMd5Context ) ) .
usComputed as * const _ as usize } , 22usize , concat ! (
"Alignment of field: " , stringify ! (
_SceKernelUtilsMd5Context ) , "::" , stringify ! ( usComputed
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _SceKernelUtilsMd5Context ) ) .
ullTotalLen as * const _ as usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! (
_SceKernelUtilsMd5Context ) , "::" , stringify ! ( ullTotalLen
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _SceKernelUtilsMd5Context ) ) . buf as *
const _ as usize } , 32usize , concat ! (
"Alignment of field: " , stringify ! (
_SceKernelUtilsMd5Context ) , "::" , stringify ! ( buf ) ));
}
impl Clone for _SceKernelUtilsMd5Context {
fn clone(&self) -> Self { *self }
}
/// Structure to hold the MD5 context
pub type SceKernelUtilsMd5Context = _SceKernelUtilsMd5Context;
extern "C" {
/// Function to perform an MD5 digest of a data block.
///
/// @param data - Pointer to a data block to make a digest of.
/// @param size - Size of the data block.
/// @param digest - Pointer to a 16byte buffer to store the resulting digest
///
/// @return < 0 on error.
pub fn sceKernelUtilsMd5Digest(data: *mut u8, size: u32, digest: *mut u8)
-> i32;
}
extern "C" {
/// Function to initialise a MD5 digest context
///
/// @param ctx - A context block to initialise
///
/// @return < 0 on error.
/// @par Example:
/// @code
/// SceKernelUtilsMd5Context ctx;
/// u8 digest[16];
/// sceKernelUtilsMd5BlockInit(&ctx);
/// sceKernelUtilsMd5BlockUpdate(&ctx, (u8*) "Hello", 5);
/// sceKernelUtilsMd5BlockResult(&ctx, digest);
/// @endcode
pub fn sceKernelUtilsMd5BlockInit(ctx: *mut SceKernelUtilsMd5Context)
-> i32;
}
extern "C" {
/// Function to update the MD5 digest with a block of data.
///
/// @param ctx - A filled in context block.
/// @param data - The data block to hash.
/// @param size - The size of the data to hash
///
/// @return < 0 on error.
pub fn sceKernelUtilsMd5BlockUpdate(ctx: *mut SceKernelUtilsMd5Context,
data: *mut u8, size: u32) -> i32;
}
extern "C" {
/// Function to get the digest result of the MD5 hash.
///
/// @param ctx - A filled in context block.
/// @param digest - A 16 byte array to hold the digest.
///
/// @return < 0 on error.
pub fn sceKernelUtilsMd5BlockResult(ctx: *mut SceKernelUtilsMd5Context,
digest: *mut u8) -> i32;
}
/// Type to hold a sha1 context
#[repr(C)]
#[derive(Copy)]
pub struct _SceKernelUtilsSha1Context {
pub h: [u32; 5usize],
pub usRemains: SceUShort16,
pub usComputed: SceUShort16,
pub ullTotalLen: SceULong64,
pub buf: [u8; 64usize],
}
#[test]
fn bindgen_test_layout__SceKernelUtilsSha1Context() {
assert_eq!(::core::mem::size_of::<_SceKernelUtilsSha1Context>() , 96usize
, concat ! (
"Size of: " , stringify ! ( _SceKernelUtilsSha1Context ) ));
assert_eq! (::core::mem::align_of::<_SceKernelUtilsSha1Context>() , 8usize
, concat ! (
"Alignment of " , stringify ! ( _SceKernelUtilsSha1Context )
));
assert_eq! (unsafe {
& ( * ( 0 as * const _SceKernelUtilsSha1Context ) ) . h as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! (
_SceKernelUtilsSha1Context ) , "::" , stringify ! ( h ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _SceKernelUtilsSha1Context ) ) .
usRemains as * const _ as usize } , 20usize , concat ! (
"Alignment of field: " , stringify ! (
_SceKernelUtilsSha1Context ) , "::" , stringify ! ( usRemains
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _SceKernelUtilsSha1Context ) ) .
usComputed as * const _ as usize } , 22usize , concat ! (
"Alignment of field: " , stringify ! (
_SceKernelUtilsSha1Context ) , "::" , stringify ! ( usComputed
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _SceKernelUtilsSha1Context ) ) .
ullTotalLen as * const _ as usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! (
_SceKernelUtilsSha1Context ) , "::" , stringify ! (
ullTotalLen ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _SceKernelUtilsSha1Context ) ) . buf as *
const _ as usize } , 32usize , concat ! (
"Alignment of field: " , stringify ! (
_SceKernelUtilsSha1Context ) , "::" , stringify ! ( buf ) ));
}
impl Clone for _SceKernelUtilsSha1Context {
fn clone(&self) -> Self { *self }
}
/// Type to hold a sha1 context
pub type SceKernelUtilsSha1Context = _SceKernelUtilsSha1Context;
extern "C" {
/// Function to SHA1 hash a data block.
///
/// @param data - The data to hash.
/// @param size - The size of the data.
/// @param digest - Pointer to a 20 byte array for storing the digest
///
/// @return < 0 on error.
pub fn sceKernelUtilsSha1Digest(data: *mut u8, size: u32, digest: *mut u8)
-> i32;
}
extern "C" {
/// Function to initialise a context for SHA1 hashing.
///
/// @param ctx - Pointer to a context.
///
/// @return < 0 on error.
///
/// @par Example:
/// @code
/// SceKernelUtilsSha1Context ctx;
/// u8 digest[20];
/// sceKernelUtilsSha1BlockInit(&ctx);
/// sceKernelUtilsSha1BlockUpdate(&ctx, (u8*) "Hello", 5);
/// sceKernelUtilsSha1BlockResult(&ctx, digest);
/// @endcode
pub fn sceKernelUtilsSha1BlockInit(ctx: *mut SceKernelUtilsSha1Context)
-> i32;
}
extern "C" {
/// Function to update the current hash.
///
/// @param ctx - Pointer to a prefilled context.
/// @param data - The data block to hash.
/// @param size - The size of the data block
///
/// @return < 0 on error.
pub fn sceKernelUtilsSha1BlockUpdate(ctx: *mut SceKernelUtilsSha1Context,
data: *mut u8, size: u32) -> i32;
}
extern "C" {
/// Function to get the result of the SHA1 hash.
///
/// @param ctx - Pointer to a prefilled context.
/// @param digest - A pointer to a 20 byte array to contain the digest.
///
/// @return < 0 on error.
pub fn sceKernelUtilsSha1BlockResult(ctx: *mut SceKernelUtilsSha1Context,
digest: *mut u8) -> i32;
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspKernelErrorCodes {
SCE_KERNEL_ERROR_OK = 0,
SCE_KERNEL_ERROR_ERROR = 2147614721,
SCE_KERNEL_ERROR_NOTIMP = 2147614722,
SCE_KERNEL_ERROR_ILLEGAL_EXPCODE = 2147614770,
SCE_KERNEL_ERROR_EXPHANDLER_NOUSE = 2147614771,
SCE_KERNEL_ERROR_EXPHANDLER_USED = 2147614772,
SCE_KERNEL_ERROR_SYCALLTABLE_NOUSED = 2147614773,
SCE_KERNEL_ERROR_SYCALLTABLE_USED = 2147614774,
SCE_KERNEL_ERROR_ILLEGAL_SYSCALLTABLE = 2147614775,
SCE_KERNEL_ERROR_ILLEGAL_PRIMARY_SYSCALL_NUMBER = 2147614776,
SCE_KERNEL_ERROR_PRIMARY_SYSCALL_NUMBER_INUSE = 2147614777,
SCE_KERNEL_ERROR_ILLEGAL_CONTEXT = 2147614820,
SCE_KERNEL_ERROR_ILLEGAL_INTRCODE = 2147614821,
SCE_KERNEL_ERROR_CPUDI = 2147614822,
SCE_KERNEL_ERROR_FOUND_HANDLER = 2147614823,
SCE_KERNEL_ERROR_NOTFOUND_HANDLER = 2147614824,
SCE_KERNEL_ERROR_ILLEGAL_INTRLEVEL = 2147614825,
SCE_KERNEL_ERROR_ILLEGAL_ADDRESS = 2147614826,
SCE_KERNEL_ERROR_ILLEGAL_INTRPARAM = 2147614827,
SCE_KERNEL_ERROR_ILLEGAL_STACK_ADDRESS = 2147614828,
SCE_KERNEL_ERROR_ALREADY_STACK_SET = 2147614829,
SCE_KERNEL_ERROR_NO_TIMER = 2147614870,
SCE_KERNEL_ERROR_ILLEGAL_TIMERID = 2147614871,
SCE_KERNEL_ERROR_ILLEGAL_SOURCE = 2147614872,
SCE_KERNEL_ERROR_ILLEGAL_PRESCALE = 2147614873,
SCE_KERNEL_ERROR_TIMER_BUSY = 2147614874,
SCE_KERNEL_ERROR_TIMER_NOT_SETUP = 2147614875,
SCE_KERNEL_ERROR_TIMER_NOT_INUSE = 2147614876,
SCE_KERNEL_ERROR_UNIT_USED = 2147614880,
SCE_KERNEL_ERROR_UNIT_NOUSE = 2147614881,
SCE_KERNEL_ERROR_NO_ROMDIR = 2147614882,
SCE_KERNEL_ERROR_IDTYPE_EXIST = 2147614920,
SCE_KERNEL_ERROR_IDTYPE_NOT_EXIST = 2147614921,
SCE_KERNEL_ERROR_IDTYPE_NOT_EMPTY = 2147614922,
SCE_KERNEL_ERROR_UNKNOWN_UID = 2147614923,
SCE_KERNEL_ERROR_UNMATCH_UID_TYPE = 2147614924,
SCE_KERNEL_ERROR_ID_NOT_EXIST = 2147614925,
SCE_KERNEL_ERROR_NOT_FOUND_UIDFUNC = 2147614926,
SCE_KERNEL_ERROR_UID_ALREADY_HOLDER = 2147614927,
SCE_KERNEL_ERROR_UID_NOT_HOLDER = 2147614928,
SCE_KERNEL_ERROR_ILLEGAL_PERM = 2147614929,
SCE_KERNEL_ERROR_ILLEGAL_ARGUMENT = 2147614930,
SCE_KERNEL_ERROR_ILLEGAL_ADDR = 2147614931,
SCE_KERNEL_ERROR_OUT_OF_RANGE = 2147614932,
SCE_KERNEL_ERROR_MEM_RANGE_OVERLAP = 2147614933,
SCE_KERNEL_ERROR_ILLEGAL_PARTITION = 2147614934,
SCE_KERNEL_ERROR_PARTITION_INUSE = 2147614935,
SCE_KERNEL_ERROR_ILLEGAL_MEMBLOCKTYPE = 2147614936,
SCE_KERNEL_ERROR_MEMBLOCK_ALLOC_FAILED = 2147614937,
SCE_KERNEL_ERROR_MEMBLOCK_RESIZE_LOCKED = 2147614938,
SCE_KERNEL_ERROR_MEMBLOCK_RESIZE_FAILED = 2147614939,
SCE_KERNEL_ERROR_HEAPBLOCK_ALLOC_FAILED = 2147614940,
SCE_KERNEL_ERROR_HEAP_ALLOC_FAILED = 2147614941,
SCE_KERNEL_ERROR_ILLEGAL_CHUNK_ID = 2147614942,
SCE_KERNEL_ERROR_NOCHUNK = 2147614943,
SCE_KERNEL_ERROR_NO_FREECHUNK = 2147614944,
SCE_KERNEL_ERROR_LINKERR = 2147615020,
SCE_KERNEL_ERROR_ILLEGAL_OBJECT = 2147615021,
SCE_KERNEL_ERROR_UNKNOWN_MODULE = 2147615022,
SCE_KERNEL_ERROR_NOFILE = 2147615023,
SCE_KERNEL_ERROR_FILEERR = 2147615024,
SCE_KERNEL_ERROR_MEMINUSE = 2147615025,
SCE_KERNEL_ERROR_PARTITION_MISMATCH = 2147615026,
SCE_KERNEL_ERROR_ALREADY_STARTED = 2147615027,
SCE_KERNEL_ERROR_NOT_STARTED = 2147615028,
SCE_KERNEL_ERROR_ALREADY_STOPPED = 2147615029,
SCE_KERNEL_ERROR_CAN_NOT_STOP = 2147615030,
SCE_KERNEL_ERROR_NOT_STOPPED = 2147615031,
SCE_KERNEL_ERROR_NOT_REMOVABLE = 2147615032,
SCE_KERNEL_ERROR_EXCLUSIVE_LOAD = 2147615033,
SCE_KERNEL_ERROR_LIBRARY_NOT_YET_LINKED = 2147615034,
SCE_KERNEL_ERROR_LIBRARY_FOUND = 2147615035,
SCE_KERNEL_ERROR_LIBRARY_NOTFOUND = 2147615036,
SCE_KERNEL_ERROR_ILLEGAL_LIBRARY = 2147615037,
SCE_KERNEL_ERROR_LIBRARY_INUSE = 2147615038,
SCE_KERNEL_ERROR_ALREADY_STOPPING = 2147615039,
SCE_KERNEL_ERROR_ILLEGAL_OFFSET = 2147615040,
SCE_KERNEL_ERROR_ILLEGAL_POSITION = 2147615041,
SCE_KERNEL_ERROR_ILLEGAL_ACCESS = 2147615042,
SCE_KERNEL_ERROR_MODULE_MGR_BUSY = 2147615043,
SCE_KERNEL_ERROR_ILLEGAL_FLAG = 2147615044,
SCE_KERNEL_ERROR_CANNOT_GET_MODULELIST = 2147615045,
SCE_KERNEL_ERROR_PROHIBIT_LOADMODULE_DEVICE = 2147615046,
SCE_KERNEL_ERROR_PROHIBIT_LOADEXEC_DEVICE = 2147615047,
SCE_KERNEL_ERROR_UNSUPPORTED_PRX_TYPE = 2147615048,
SCE_KERNEL_ERROR_ILLEGAL_PERM_CALL = 2147615049,
SCE_KERNEL_ERROR_CANNOT_GET_MODULE_INFORMATION = 2147615050,
SCE_KERNEL_ERROR_ILLEGAL_LOADEXEC_BUFFER = 2147615051,
SCE_KERNEL_ERROR_ILLEGAL_LOADEXEC_FILENAME = 2147615052,
SCE_KERNEL_ERROR_NO_EXIT_CALLBACK = 2147615053,
SCE_KERNEL_ERROR_NO_MEMORY = 2147615120,
SCE_KERNEL_ERROR_ILLEGAL_ATTR = 2147615121,
SCE_KERNEL_ERROR_ILLEGAL_ENTRY = 2147615122,
SCE_KERNEL_ERROR_ILLEGAL_PRIORITY = 2147615123,
SCE_KERNEL_ERROR_ILLEGAL_STACK_SIZE = 2147615124,
SCE_KERNEL_ERROR_ILLEGAL_MODE = 2147615125,
SCE_KERNEL_ERROR_ILLEGAL_MASK = 2147615126,
SCE_KERNEL_ERROR_ILLEGAL_THID = 2147615127,
SCE_KERNEL_ERROR_UNKNOWN_THID = 2147615128,
SCE_KERNEL_ERROR_UNKNOWN_SEMID = 2147615129,
SCE_KERNEL_ERROR_UNKNOWN_EVFID = 2147615130,
SCE_KERNEL_ERROR_UNKNOWN_MBXID = 2147615131,
SCE_KERNEL_ERROR_UNKNOWN_VPLID = 2147615132,
SCE_KERNEL_ERROR_UNKNOWN_FPLID = 2147615133,
SCE_KERNEL_ERROR_UNKNOWN_MPPID = 2147615134,
SCE_KERNEL_ERROR_UNKNOWN_ALMID = 2147615135,
SCE_KERNEL_ERROR_UNKNOWN_TEID = 2147615136,
SCE_KERNEL_ERROR_UNKNOWN_CBID = 2147615137,
SCE_KERNEL_ERROR_DORMANT = 2147615138,
SCE_KERNEL_ERROR_SUSPEND = 2147615139,
SCE_KERNEL_ERROR_NOT_DORMANT = 2147615140,
SCE_KERNEL_ERROR_NOT_SUSPEND = 2147615141,
SCE_KERNEL_ERROR_NOT_WAIT = 2147615142,
SCE_KERNEL_ERROR_CAN_NOT_WAIT = 2147615143,
SCE_KERNEL_ERROR_WAIT_TIMEOUT = 2147615144,
SCE_KERNEL_ERROR_WAIT_CANCEL = 2147615145,
SCE_KERNEL_ERROR_RELEASE_WAIT = 2147615146,
SCE_KERNEL_ERROR_NOTIFY_CALLBACK = 2147615147,
SCE_KERNEL_ERROR_THREAD_TERMINATED = 2147615148,
SCE_KERNEL_ERROR_SEMA_ZERO = 2147615149,
SCE_KERNEL_ERROR_SEMA_OVF = 2147615150,
SCE_KERNEL_ERROR_EVF_COND = 2147615151,
SCE_KERNEL_ERROR_EVF_MULTI = 2147615152,
SCE_KERNEL_ERROR_EVF_ILPAT = 2147615153,
SCE_KERNEL_ERROR_MBOX_NOMSG = 2147615154,
SCE_KERNEL_ERROR_MPP_FULL = 2147615155,
SCE_KERNEL_ERROR_MPP_EMPTY = 2147615156,
SCE_KERNEL_ERROR_WAIT_DELETE = 2147615157,
SCE_KERNEL_ERROR_ILLEGAL_MEMBLOCK = 2147615158,
SCE_KERNEL_ERROR_ILLEGAL_MEMSIZE = 2147615159,
SCE_KERNEL_ERROR_ILLEGAL_SPADADDR = 2147615160,
SCE_KERNEL_ERROR_SPAD_INUSE = 2147615161,
SCE_KERNEL_ERROR_SPAD_NOT_INUSE = 2147615162,
SCE_KERNEL_ERROR_ILLEGAL_TYPE = 2147615163,
SCE_KERNEL_ERROR_ILLEGAL_SIZE = 2147615164,
SCE_KERNEL_ERROR_ILLEGAL_COUNT = 2147615165,
SCE_KERNEL_ERROR_UNKNOWN_VTID = 2147615166,
SCE_KERNEL_ERROR_ILLEGAL_VTID = 2147615167,
SCE_KERNEL_ERROR_ILLEGAL_KTLSID = 2147615168,
SCE_KERNEL_ERROR_KTLS_FULL = 2147615169,
SCE_KERNEL_ERROR_KTLS_BUSY = 2147615170,
SCE_KERNEL_ERROR_PM_INVALID_PRIORITY = 2147615320,
SCE_KERNEL_ERROR_PM_INVALID_DEVNAME = 2147615321,
SCE_KERNEL_ERROR_PM_UNKNOWN_DEVNAME = 2147615322,
SCE_KERNEL_ERROR_PM_PMINFO_REGISTERED = 2147615323,
SCE_KERNEL_ERROR_PM_PMINFO_UNREGISTERED = 2147615324,
SCE_KERNEL_ERROR_PM_INVALID_MAJOR_STATE = 2147615325,
SCE_KERNEL_ERROR_PM_INVALID_REQUEST = 2147615326,
SCE_KERNEL_ERROR_PM_UNKNOWN_REQUEST = 2147615327,
SCE_KERNEL_ERROR_PM_INVALID_UNIT = 2147615328,
SCE_KERNEL_ERROR_PM_CANNOT_CANCEL = 2147615329,
SCE_KERNEL_ERROR_PM_INVALID_PMINFO = 2147615330,
SCE_KERNEL_ERROR_PM_INVALID_ARGUMENT = 2147615331,
SCE_KERNEL_ERROR_PM_ALREADY_TARGET_PWRSTATE = 2147615332,
SCE_KERNEL_ERROR_PM_CHANGE_PWRSTATE_FAILED = 2147615333,
SCE_KERNEL_ERROR_PM_CANNOT_CHANGE_DEVPWR_STATE = 2147615334,
SCE_KERNEL_ERROR_PM_NO_SUPPORT_DEVPWR_STATE = 2147615335,
SCE_KERNEL_ERROR_DMAC_REQUEST_FAILED = 2147615420,
SCE_KERNEL_ERROR_DMAC_REQUEST_DENIED = 2147615421,
SCE_KERNEL_ERROR_DMAC_OP_QUEUED = 2147615422,
SCE_KERNEL_ERROR_DMAC_OP_NOT_QUEUED = 2147615423,
SCE_KERNEL_ERROR_DMAC_OP_RUNNING = 2147615424,
SCE_KERNEL_ERROR_DMAC_OP_NOT_ASSIGNED = 2147615425,
SCE_KERNEL_ERROR_DMAC_OP_TIMEOUT = 2147615426,
SCE_KERNEL_ERROR_DMAC_OP_FREED = 2147615427,
SCE_KERNEL_ERROR_DMAC_OP_USED = 2147615428,
SCE_KERNEL_ERROR_DMAC_OP_EMPTY = 2147615429,
SCE_KERNEL_ERROR_DMAC_OP_ABORTED = 2147615430,
SCE_KERNEL_ERROR_DMAC_OP_ERROR = 2147615431,
SCE_KERNEL_ERROR_DMAC_CHANNEL_RESERVED = 2147615432,
SCE_KERNEL_ERROR_DMAC_CHANNEL_EXCLUDED = 2147615433,
SCE_KERNEL_ERROR_DMAC_PRIVILEGE_ADDRESS = 2147615434,
SCE_KERNEL_ERROR_DMAC_NO_ENOUGHSPACE = 2147615435,
SCE_KERNEL_ERROR_DMAC_CHANNEL_NOT_ASSIGNED = 2147615436,
SCE_KERNEL_ERROR_DMAC_CHILD_OPERATION = 2147615437,
SCE_KERNEL_ERROR_DMAC_TOO_MUCH_SIZE = 2147615438,
SCE_KERNEL_ERROR_DMAC_INVALID_ARGUMENT = 2147615439,
SCE_KERNEL_ERROR_MFILE = 2147615520,
SCE_KERNEL_ERROR_NODEV = 2147615521,
SCE_KERNEL_ERROR_XDEV = 2147615522,
SCE_KERNEL_ERROR_BADF = 2147615523,
SCE_KERNEL_ERROR_INVAL = 2147615524,
SCE_KERNEL_ERROR_UNSUP = 2147615525,
SCE_KERNEL_ERROR_ALIAS_USED = 2147615526,
SCE_KERNEL_ERROR_CANNOT_MOUNT = 2147615527,
SCE_KERNEL_ERROR_DRIVER_DELETED = 2147615528,
SCE_KERNEL_ERROR_ASYNC_BUSY = 2147615529,
SCE_KERNEL_ERROR_NOASYNC = 2147615530,
SCE_KERNEL_ERROR_REGDEV = 2147615531,
SCE_KERNEL_ERROR_NOCWD = 2147615532,
SCE_KERNEL_ERROR_NAMETOOLONG = 2147615533,
SCE_KERNEL_ERROR_NXIO = 2147615720,
SCE_KERNEL_ERROR_IO = 2147615721,
SCE_KERNEL_ERROR_NOMEM = 2147615722,
SCE_KERNEL_ERROR_STDIO_NOT_OPENED = 2147615723,
SCE_KERNEL_ERROR_CACHE_ALIGNMENT = 2147615820,
SCE_KERNEL_ERROR_ERRORMAX = 2147615821,
}
extern "C" {
/// Function to get the current standard in file no
///
/// @return The stdin fileno
pub fn sceKernelStdin() -> SceUID;
}
extern "C" {
/// Function to get the current standard out file no
///
/// @return The stdout fileno
pub fn sceKernelStdout() -> SceUID;
}
extern "C" {
/// Function to get the current standard err file no
///
/// @return The stderr fileno
pub fn sceKernelStderr() -> SceUID;
}
extern "C" {
#[link_name = "PspInterruptNames"]
pub static mut PspInterruptNames: [*const u8; 67usize];
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspInterrupts {
PSP_GPIO_INT = 4,
PSP_ATA_INT = 5,
PSP_UMD_INT = 6,
PSP_MSCM0_INT = 7,
PSP_WLAN_INT = 8,
PSP_AUDIO_INT = 10,
PSP_I2C_INT = 12,
PSP_SIRCS_INT = 14,
PSP_SYSTIMER0_INT = 15,
PSP_SYSTIMER1_INT = 16,
PSP_SYSTIMER2_INT = 17,
PSP_SYSTIMER3_INT = 18,
PSP_THREAD0_INT = 19,
PSP_NAND_INT = 20,
PSP_DMACPLUS_INT = 21,
PSP_DMA0_INT = 22,
PSP_DMA1_INT = 23,
PSP_MEMLMD_INT = 24,
PSP_GE_INT = 25,
PSP_VBLANK_INT = 30,
PSP_MECODEC_INT = 31,
PSP_HPREMOTE_INT = 36,
PSP_MSCM1_INT = 60,
PSP_MSCM2_INT = 61,
PSP_THREAD1_INT = 65,
PSP_INTERRUPT_INT = 66,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspSubInterrupts {
PSP_GPIO_SUBINT = 4,
PSP_ATA_SUBINT = 5,
PSP_UMD_SUBINT = 6,
PSP_DMACPLUS_SUBINT = 21,
PSP_GE_SUBINT = 25,
PSP_DISPLAY_SUBINT = 30,
}
extern "C" {
/// Suspend all interrupts.
///
/// @return The current state of the interrupt controller, to be used with ::sceKernelCpuResumeIntr().
pub fn sceKernelCpuSuspendIntr() -> u32;
}
extern "C" {
/// Resume all interrupts.
///
/// @param flags - The value returned from ::sceKernelCpuSuspendIntr().
pub fn sceKernelCpuResumeIntr(flags: u32);
}
extern "C" {
/// Resume all interrupts (using sync instructions).
///
/// @param flags - The value returned from ::sceKernelCpuSuspendIntr()
pub fn sceKernelCpuResumeIntrWithSync(flags: u32);
}
extern "C" {
/// Determine if interrupts are suspended or active, based on the given flags.
///
/// @param flags - The value returned from ::sceKernelCpuSuspendIntr().
///
/// @return 1 if flags indicate that interrupts were not suspended, 0 otherwise.
pub fn sceKernelIsCpuIntrSuspended(flags: u32) -> i32;
}
extern "C" {
/// Determine if interrupts are enabled or disabled.
///
/// @return 1 if interrupts are currently enabled.
pub fn sceKernelIsCpuIntrEnable() -> i32;
}
extern "C" {
/// Register a sub interrupt handler.
///
/// @param intno - The interrupt number to register.
/// @param no - The sub interrupt handler number (user controlled)
/// @param handler - The interrupt handler
/// @param arg - An argument passed to the interrupt handler
///
/// @return < 0 on error.
pub fn sceKernelRegisterSubIntrHandler(intno: i32, no: i32,
handler: *mut c_void,
arg: *mut c_void) -> i32;
}
extern "C" {
/// Release a sub interrupt handler.
///
/// @param intno - The interrupt number to register.
/// @param no - The sub interrupt handler number
///
/// @return < 0 on error.
pub fn sceKernelReleaseSubIntrHandler(intno: i32, no: i32)
-> i32;
}
extern "C" {
/// Enable a sub interrupt.
///
/// @param intno - The sub interrupt to enable.
/// @param no - The sub interrupt handler number
///
/// @return < 0 on error.
pub fn sceKernelEnableSubIntr(intno: i32, no: i32) -> i32;
}
extern "C" {
/// Disable a sub interrupt handler.
///
/// @param intno - The sub interrupt to disable.
/// @param no - The sub interrupt handler number
///
/// @return < 0 on error.
pub fn sceKernelDisableSubIntr(intno: i32, no: i32) -> i32;
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct tag_IntrHandlerOptionParam {
pub size: i32,
pub entry: u32,
pub common: u32,
pub gp: u32,
pub intr_code: u16,
pub sub_count: u16,
pub intr_level: u16,
pub enabled: u16,
pub calls: u32,
pub field_1C: u32,
pub total_clock_lo: u32,
pub total_clock_hi: u32,
pub min_clock_lo: u32,
pub min_clock_hi: u32,
pub max_clock_lo: u32,
pub max_clock_hi: u32,
}
#[test]
fn bindgen_test_layout_tag_IntrHandlerOptionParam() {
assert_eq!(::core::mem::size_of::<tag_IntrHandlerOptionParam>() , 56usize
, concat ! (
"Size of: " , stringify ! ( tag_IntrHandlerOptionParam ) ));
assert_eq! (::core::mem::align_of::<tag_IntrHandlerOptionParam>() , 4usize
, concat ! (
"Alignment of " , stringify ! ( tag_IntrHandlerOptionParam )
));
assert_eq! (unsafe {
& ( * ( 0 as * const tag_IntrHandlerOptionParam ) ) . size as
* const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! (
tag_IntrHandlerOptionParam ) , "::" , stringify ! ( size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const tag_IntrHandlerOptionParam ) ) . entry as
* const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! (
tag_IntrHandlerOptionParam ) , "::" , stringify ! ( entry )
));
assert_eq! (unsafe {
& ( * ( 0 as * const tag_IntrHandlerOptionParam ) ) . common
as * const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! (
tag_IntrHandlerOptionParam ) , "::" , stringify ! ( common )
));
assert_eq! (unsafe {
& ( * ( 0 as * const tag_IntrHandlerOptionParam ) ) . gp as *
const _ as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! (
tag_IntrHandlerOptionParam ) , "::" , stringify ! ( gp ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const tag_IntrHandlerOptionParam ) ) .
intr_code as * const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! (
tag_IntrHandlerOptionParam ) , "::" , stringify ! ( intr_code
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const tag_IntrHandlerOptionParam ) ) .
sub_count as * const _ as usize } , 18usize , concat ! (
"Alignment of field: " , stringify ! (
tag_IntrHandlerOptionParam ) , "::" , stringify ! ( sub_count
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const tag_IntrHandlerOptionParam ) ) .
intr_level as * const _ as usize } , 20usize , concat ! (
"Alignment of field: " , stringify ! (
tag_IntrHandlerOptionParam ) , "::" , stringify ! ( intr_level
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const tag_IntrHandlerOptionParam ) ) . enabled
as * const _ as usize } , 22usize , concat ! (
"Alignment of field: " , stringify ! (
tag_IntrHandlerOptionParam ) , "::" , stringify ! ( enabled )
));
assert_eq! (unsafe {
& ( * ( 0 as * const tag_IntrHandlerOptionParam ) ) . calls as
* const _ as usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! (
tag_IntrHandlerOptionParam ) , "::" , stringify ! ( calls )
));
assert_eq! (unsafe {
& ( * ( 0 as * const tag_IntrHandlerOptionParam ) ) . field_1C
as * const _ as usize } , 28usize , concat ! (
"Alignment of field: " , stringify ! (
tag_IntrHandlerOptionParam ) , "::" , stringify ! ( field_1C )
));
assert_eq! (unsafe {
& ( * ( 0 as * const tag_IntrHandlerOptionParam ) ) .
total_clock_lo as * const _ as usize } , 32usize , concat ! (
"Alignment of field: " , stringify ! (
tag_IntrHandlerOptionParam ) , "::" , stringify ! (
total_clock_lo ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const tag_IntrHandlerOptionParam ) ) .
total_clock_hi as * const _ as usize } , 36usize , concat ! (
"Alignment of field: " , stringify ! (
tag_IntrHandlerOptionParam ) , "::" , stringify ! (
total_clock_hi ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const tag_IntrHandlerOptionParam ) ) .
min_clock_lo as * const _ as usize } , 40usize , concat ! (
"Alignment of field: " , stringify ! (
tag_IntrHandlerOptionParam ) , "::" , stringify ! (
min_clock_lo ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const tag_IntrHandlerOptionParam ) ) .
min_clock_hi as * const _ as usize } , 44usize , concat ! (
"Alignment of field: " , stringify ! (
tag_IntrHandlerOptionParam ) , "::" , stringify ! (
min_clock_hi ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const tag_IntrHandlerOptionParam ) ) .
max_clock_lo as * const _ as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! (
tag_IntrHandlerOptionParam ) , "::" , stringify ! (
max_clock_lo ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const tag_IntrHandlerOptionParam ) ) .
max_clock_hi as * const _ as usize } , 52usize , concat ! (
"Alignment of field: " , stringify ! (
tag_IntrHandlerOptionParam ) , "::" , stringify ! (
max_clock_hi ) ));
}
impl Clone for tag_IntrHandlerOptionParam {
fn clone(&self) -> Self { *self }
}
pub type PspIntrHandlerOptionParam = tag_IntrHandlerOptionParam;
extern "C" {
pub fn QueryIntrHandlerInfo(intr_code: SceUID, sub_intr_code: SceUID,
data: *mut PspIntrHandlerOptionParam)
-> i32;
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct PspIoDrv {
/// The name of the device to add
pub name: *const u8,
/// Device type, this 0x10 is for a filesystem driver
pub dev_type: u32,
/// Unknown, set to 0x800
pub unk2: u32,
/// This seems to be the same as name but capitalised :/
pub name2: *const u8,
/// Pointer to a filled out functions table
pub funcs: *mut PspIoDrvFuncs,
}
#[test]
fn bindgen_test_layout_PspIoDrv() {
assert_eq!(::core::mem::size_of::<PspIoDrv>() , 32usize , concat ! (
"Size of: " , stringify ! ( PspIoDrv ) ));
assert_eq! (::core::mem::align_of::<PspIoDrv>() , 8usize , concat ! (
"Alignment of " , stringify ! ( PspIoDrv ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspIoDrv ) ) . name as * const _ as usize
} , 0usize , concat ! (
"Alignment of field: " , stringify ! ( PspIoDrv ) , "::" ,
stringify ! ( name ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspIoDrv ) ) . dev_type as * const _ as
usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( PspIoDrv ) , "::" ,
stringify ! ( dev_type ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspIoDrv ) ) . unk2 as * const _ as usize
} , 12usize , concat ! (
"Alignment of field: " , stringify ! ( PspIoDrv ) , "::" ,
stringify ! ( unk2 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspIoDrv ) ) . name2 as * const _ as
usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( PspIoDrv ) , "::" ,
stringify ! ( name2 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspIoDrv ) ) . funcs as * const _ as
usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! ( PspIoDrv ) , "::" ,
stringify ! ( funcs ) ));
}
impl Clone for PspIoDrv {
fn clone(&self) -> Self { *self }
}
/// Structure passed to the init and exit functions of the io driver system
#[repr(C)]
#[derive(Debug, Copy)]
pub struct PspIoDrvArg {
/// Pointer to the original driver which was added
pub drv: *mut PspIoDrv,
/// Pointer to a user defined argument (if written by the driver will preseve across calls
pub arg: *mut c_void,
}
#[test]
fn bindgen_test_layout_PspIoDrvArg() {
assert_eq!(::core::mem::size_of::<PspIoDrvArg>() , 16usize , concat ! (
"Size of: " , stringify ! ( PspIoDrvArg ) ));
assert_eq! (::core::mem::align_of::<PspIoDrvArg>() , 8usize , concat ! (
"Alignment of " , stringify ! ( PspIoDrvArg ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspIoDrvArg ) ) . drv as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( PspIoDrvArg ) , "::" ,
stringify ! ( drv ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspIoDrvArg ) ) . arg as * const _ as
usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( PspIoDrvArg ) , "::" ,
stringify ! ( arg ) ));
}
impl Clone for PspIoDrvArg {
fn clone(&self) -> Self { *self }
}
/// Structure passed to the file functions of the io driver system
#[repr(C)]
#[derive(Debug, Copy)]
pub struct PspIoDrvFileArg {
/// Unknown
pub unk1: u32,
/// The file system number, e.g. if a file is opened as host5:/myfile.txt this field will be 5
pub fs_num: u32,
/// Pointer to the driver structure
pub drv: *mut PspIoDrvArg,
/// Unknown, again
pub unk2: u32,
/// Pointer to a user defined argument, this is preserved on a per file basis
pub arg: *mut c_void,
}
#[test]
fn bindgen_test_layout_PspIoDrvFileArg() {
assert_eq!(::core::mem::size_of::<PspIoDrvFileArg>() , 32usize , concat !
( "Size of: " , stringify ! ( PspIoDrvFileArg ) ));
assert_eq! (::core::mem::align_of::<PspIoDrvFileArg>() , 8usize , concat !
( "Alignment of " , stringify ! ( PspIoDrvFileArg ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspIoDrvFileArg ) ) . unk1 as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( PspIoDrvFileArg ) ,
"::" , stringify ! ( unk1 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspIoDrvFileArg ) ) . fs_num as * const _
as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( PspIoDrvFileArg ) ,
"::" , stringify ! ( fs_num ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspIoDrvFileArg ) ) . drv as * const _ as
usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( PspIoDrvFileArg ) ,
"::" , stringify ! ( drv ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspIoDrvFileArg ) ) . unk2 as * const _
as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( PspIoDrvFileArg ) ,
"::" , stringify ! ( unk2 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspIoDrvFileArg ) ) . arg as * const _ as
usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! ( PspIoDrvFileArg ) ,
"::" , stringify ! ( arg ) ));
}
impl Clone for PspIoDrvFileArg {
fn clone(&self) -> Self { *self }
}
/// Structure to maintain the file driver pointers
#[repr(C)]
#[derive(Debug, Copy)]
pub struct PspIoDrvFuncs {
pub IoInit: ::core::option::Option<unsafe extern "C" fn(arg:
*mut PspIoDrvArg)
-> i32>,
pub IoExit: ::core::option::Option<unsafe extern "C" fn(arg:
*mut PspIoDrvArg)
-> i32>,
pub IoOpen: ::core::option::Option<unsafe extern "C" fn(arg:
*mut PspIoDrvFileArg,
file:
*mut u8,
flags: i32,
mode: SceMode)
-> i32>,
pub IoClose: ::core::option::Option<unsafe extern "C" fn(arg:
*mut PspIoDrvFileArg)
-> i32>,
pub IoRead: ::core::option::Option<unsafe extern "C" fn(arg:
*mut PspIoDrvFileArg,
data:
*mut u8,
len: i32)
-> i32>,
pub IoWrite: ::core::option::Option<unsafe extern "C" fn(arg:
*mut PspIoDrvFileArg,
data:
*const u8,
len: i32)
-> i32>,
pub IoLseek: ::core::option::Option<unsafe extern "C" fn(arg:
*mut PspIoDrvFileArg,
ofs: SceOff,
whence: i32)
-> SceOff>,
pub IoIoctl: ::core::option::Option<unsafe extern "C" fn(arg:
*mut PspIoDrvFileArg,
cmd: u32,
indata:
*mut c_void,
inlen: i32,
outdata:
*mut c_void,
outlen: i32)
-> i32>,
pub IoRemove: ::core::option::Option<unsafe extern "C" fn(arg:
*mut PspIoDrvFileArg,
name:
*const u8)
-> i32>,
pub IoMkdir: ::core::option::Option<unsafe extern "C" fn(arg:
*mut PspIoDrvFileArg,
name:
*const u8,
mode: SceMode)
-> i32>,
pub IoRmdir: ::core::option::Option<unsafe extern "C" fn(arg:
*mut PspIoDrvFileArg,
name:
*const u8)
-> i32>,
pub IoDopen: ::core::option::Option<unsafe extern "C" fn(arg:
*mut PspIoDrvFileArg,
dirname:
*const u8)
-> i32>,
pub IoDclose: ::core::option::Option<unsafe extern "C" fn(arg:
*mut PspIoDrvFileArg)
-> i32>,
pub IoDread: ::core::option::Option<unsafe extern "C" fn(arg:
*mut PspIoDrvFileArg,
dir:
*mut SceIoDirent)
-> i32>,
pub IoGetstat: ::core::option::Option<unsafe extern "C" fn(arg:
*mut PspIoDrvFileArg,
file:
*const u8,
stat:
*mut SceIoStat)
-> i32>,
pub IoChstat: ::core::option::Option<unsafe extern "C" fn(arg:
*mut PspIoDrvFileArg,
file:
*const u8,
stat:
*mut SceIoStat,
bits: i32)
-> i32>,
pub IoRename: ::core::option::Option<unsafe extern "C" fn(arg:
*mut PspIoDrvFileArg,
oldname:
*const u8,
newname:
*const u8)
-> i32>,
pub IoChdir: ::core::option::Option<unsafe extern "C" fn(arg:
*mut PspIoDrvFileArg,
dir:
*const u8)
-> i32>,
pub IoMount: ::core::option::Option<unsafe extern "C" fn(arg:
*mut PspIoDrvFileArg)
-> i32>,
pub IoUmount: ::core::option::Option<unsafe extern "C" fn(arg:
*mut PspIoDrvFileArg)
-> i32>,
pub IoDevctl: ::core::option::Option<unsafe extern "C" fn(arg:
*mut PspIoDrvFileArg,
devname:
*const u8,
cmd: u32,
indata:
*mut c_void,
inlen: i32,
outdata:
*mut c_void,
outlen: i32)
-> i32>,
pub IoUnk21: ::core::option::Option<unsafe extern "C" fn(arg:
*mut PspIoDrvFileArg)
-> i32>,
}
#[test]
fn bindgen_test_layout_PspIoDrvFuncs() {
assert_eq!(::core::mem::size_of::<PspIoDrvFuncs>() , 176usize , concat ! (
"Size of: " , stringify ! ( PspIoDrvFuncs ) ));
assert_eq! (::core::mem::align_of::<PspIoDrvFuncs>() , 8usize , concat ! (
"Alignment of " , stringify ! ( PspIoDrvFuncs ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspIoDrvFuncs ) ) . IoInit as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
, stringify ! ( IoInit ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspIoDrvFuncs ) ) . IoExit as * const _
as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
, stringify ! ( IoExit ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspIoDrvFuncs ) ) . IoOpen as * const _
as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
, stringify ! ( IoOpen ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspIoDrvFuncs ) ) . IoClose as * const _
as usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
, stringify ! ( IoClose ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspIoDrvFuncs ) ) . IoRead as * const _
as usize } , 32usize , concat ! (
"Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
, stringify ! ( IoRead ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspIoDrvFuncs ) ) . IoWrite as * const _
as usize } , 40usize , concat ! (
"Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
, stringify ! ( IoWrite ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspIoDrvFuncs ) ) . IoLseek as * const _
as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
, stringify ! ( IoLseek ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspIoDrvFuncs ) ) . IoIoctl as * const _
as usize } , 56usize , concat ! (
"Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
, stringify ! ( IoIoctl ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspIoDrvFuncs ) ) . IoRemove as * const _
as usize } , 64usize , concat ! (
"Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
, stringify ! ( IoRemove ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspIoDrvFuncs ) ) . IoMkdir as * const _
as usize } , 72usize , concat ! (
"Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
, stringify ! ( IoMkdir ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspIoDrvFuncs ) ) . IoRmdir as * const _
as usize } , 80usize , concat ! (
"Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
, stringify ! ( IoRmdir ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspIoDrvFuncs ) ) . IoDopen as * const _
as usize } , 88usize , concat ! (
"Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
, stringify ! ( IoDopen ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspIoDrvFuncs ) ) . IoDclose as * const _
as usize } , 96usize , concat ! (
"Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
, stringify ! ( IoDclose ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspIoDrvFuncs ) ) . IoDread as * const _
as usize } , 104usize , concat ! (
"Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
, stringify ! ( IoDread ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspIoDrvFuncs ) ) . IoGetstat as * const
_ as usize } , 112usize , concat ! (
"Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
, stringify ! ( IoGetstat ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspIoDrvFuncs ) ) . IoChstat as * const _
as usize } , 120usize , concat ! (
"Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
, stringify ! ( IoChstat ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspIoDrvFuncs ) ) . IoRename as * const _
as usize } , 128usize , concat ! (
"Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
, stringify ! ( IoRename ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspIoDrvFuncs ) ) . IoChdir as * const _
as usize } , 136usize , concat ! (
"Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
, stringify ! ( IoChdir ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspIoDrvFuncs ) ) . IoMount as * const _
as usize } , 144usize , concat ! (
"Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
, stringify ! ( IoMount ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspIoDrvFuncs ) ) . IoUmount as * const _
as usize } , 152usize , concat ! (
"Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
, stringify ! ( IoUmount ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspIoDrvFuncs ) ) . IoDevctl as * const _
as usize } , 160usize , concat ! (
"Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
, stringify ! ( IoDevctl ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspIoDrvFuncs ) ) . IoUnk21 as * const _
as usize } , 168usize , concat ! (
"Alignment of field: " , stringify ! ( PspIoDrvFuncs ) , "::"
, stringify ! ( IoUnk21 ) ));
}
impl Clone for PspIoDrvFuncs {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// Adds a new IO driver to the system.
/// @note This is only exported in the kernel version of IoFileMgr
///
/// @param drv - Pointer to a filled out driver structure
/// @return < 0 on error.
///
/// @par Example:
/// @code
/// PspIoDrvFuncs host_funcs = { ... };
/// PspIoDrv host_driver = { "host", 0x10, 0x800, "HOST", &host_funcs };
/// sceIoDelDrv("host");
/// sceIoAddDrv(&host_driver);
/// @endcode
pub fn sceIoAddDrv(drv: *mut PspIoDrv) -> i32;
}
extern "C" {
/// Deletes a IO driver from the system.
/// @note This is only exported in the kernel version of IoFileMgr
///
/// @param drv_name - Name of the driver to delete.
/// @return < 0 on error
pub fn sceIoDelDrv(drv_name: *const u8) -> i32;
}
extern "C" {
/// Reopens an existing file descriptor.
///
/// @param file - The new file to open.
/// @param flags - The open flags.
/// @param mode - The open mode.
/// @param fd - The old filedescriptor to reopen
///
/// @return < 0 on error, otherwise the reopened fd.
pub fn sceIoReopen(file: *const u8, flags: i32, mode: SceMode,
fd: SceUID) -> i32;
}
extern "C" {
/// Get the current working directory for a thread.
///
/// @param uid - The UID of the thread
/// @param dir - A character buffer in which to store the cwd
/// @param len - The length of the buffer
///
/// @return Number of characters written to buf, if no cwd then 0 is
/// returned.
pub fn sceIoGetThreadCwd(uid: SceUID, dir: *mut u8, len: i32)
-> i32;
}
extern "C" {
/// Set the current working directory for a thread
///
/// @param uid - The UID of the thread
/// @param dir - The directory to set
///
/// @return 0 on success, < 0 on error
pub fn sceIoChangeThreadCwd(uid: SceUID, dir: *mut u8) -> i32;
}
/// Describes a module. This structure could change in future firmware revisions.
#[repr(C, packed)]
#[derive(Debug, Copy)]
pub struct SceModule {
pub next: *mut SceModule,
pub attribute: u16,
pub version: [u8; 2usize],
pub modname: [u8; 27usize],
pub terminal: u8,
pub unknown1: u32,
pub unknown2: u32,
pub modid: SceUID,
pub unknown3: [u32; 4usize],
pub ent_top: *mut c_void,
pub ent_size: u32,
pub stub_top: *mut c_void,
pub stub_size: u32,
pub unknown4: [u32; 4usize],
pub entry_addr: u32,
pub gp_value: u32,
pub text_addr: u32,
pub text_size: u32,
pub data_size: u32,
pub bss_size: u32,
pub nsegment: u32,
pub segmentaddr: [u32; 4usize],
pub segmentsize: [u32; 4usize],
}
#[test]
fn bindgen_test_layout_SceModule() {
assert_eq!(::core::mem::size_of::<SceModule>() , 168usize , concat ! (
"Size of: " , stringify ! ( SceModule ) ));
assert_eq! (::core::mem::align_of::<SceModule>() , 1usize , concat ! (
"Alignment of " , stringify ! ( SceModule ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceModule ) ) . next as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceModule ) , "::" ,
stringify ! ( next ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceModule ) ) . attribute as * const _ as
usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( SceModule ) , "::" ,
stringify ! ( attribute ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceModule ) ) . version as * const _ as
usize } , 10usize , concat ! (
"Alignment of field: " , stringify ! ( SceModule ) , "::" ,
stringify ! ( version ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceModule ) ) . modname as * const _ as
usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( SceModule ) , "::" ,
stringify ! ( modname ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceModule ) ) . terminal as * const _ as
usize } , 39usize , concat ! (
"Alignment of field: " , stringify ! ( SceModule ) , "::" ,
stringify ! ( terminal ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceModule ) ) . unknown1 as * const _ as
usize } , 40usize , concat ! (
"Alignment of field: " , stringify ! ( SceModule ) , "::" ,
stringify ! ( unknown1 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceModule ) ) . unknown2 as * const _ as
usize } , 44usize , concat ! (
"Alignment of field: " , stringify ! ( SceModule ) , "::" ,
stringify ! ( unknown2 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceModule ) ) . modid as * const _ as
usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! ( SceModule ) , "::" ,
stringify ! ( modid ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceModule ) ) . unknown3 as * const _ as
usize } , 52usize , concat ! (
"Alignment of field: " , stringify ! ( SceModule ) , "::" ,
stringify ! ( unknown3 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceModule ) ) . ent_top as * const _ as
usize } , 68usize , concat ! (
"Alignment of field: " , stringify ! ( SceModule ) , "::" ,
stringify ! ( ent_top ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceModule ) ) . ent_size as * const _ as
usize } , 76usize , concat ! (
"Alignment of field: " , stringify ! ( SceModule ) , "::" ,
stringify ! ( ent_size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceModule ) ) . stub_top as * const _ as
usize } , 80usize , concat ! (
"Alignment of field: " , stringify ! ( SceModule ) , "::" ,
stringify ! ( stub_top ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceModule ) ) . stub_size as * const _ as
usize } , 88usize , concat ! (
"Alignment of field: " , stringify ! ( SceModule ) , "::" ,
stringify ! ( stub_size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceModule ) ) . unknown4 as * const _ as
usize } , 92usize , concat ! (
"Alignment of field: " , stringify ! ( SceModule ) , "::" ,
stringify ! ( unknown4 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceModule ) ) . entry_addr as * const _
as usize } , 108usize , concat ! (
"Alignment of field: " , stringify ! ( SceModule ) , "::" ,
stringify ! ( entry_addr ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceModule ) ) . gp_value as * const _ as
usize } , 112usize , concat ! (
"Alignment of field: " , stringify ! ( SceModule ) , "::" ,
stringify ! ( gp_value ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceModule ) ) . text_addr as * const _ as
usize } , 116usize , concat ! (
"Alignment of field: " , stringify ! ( SceModule ) , "::" ,
stringify ! ( text_addr ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceModule ) ) . text_size as * const _ as
usize } , 120usize , concat ! (
"Alignment of field: " , stringify ! ( SceModule ) , "::" ,
stringify ! ( text_size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceModule ) ) . data_size as * const _ as
usize } , 124usize , concat ! (
"Alignment of field: " , stringify ! ( SceModule ) , "::" ,
stringify ! ( data_size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceModule ) ) . bss_size as * const _ as
usize } , 128usize , concat ! (
"Alignment of field: " , stringify ! ( SceModule ) , "::" ,
stringify ! ( bss_size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceModule ) ) . nsegment as * const _ as
usize } , 132usize , concat ! (
"Alignment of field: " , stringify ! ( SceModule ) , "::" ,
stringify ! ( nsegment ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceModule ) ) . segmentaddr as * const _
as usize } , 136usize , concat ! (
"Alignment of field: " , stringify ! ( SceModule ) , "::" ,
stringify ! ( segmentaddr ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceModule ) ) . segmentsize as * const _
as usize } , 152usize , concat ! (
"Alignment of field: " , stringify ! ( SceModule ) , "::" ,
stringify ! ( segmentsize ) ));
}
impl Clone for SceModule {
fn clone(&self) -> Self { *self }
}
/// Defines a library and its exported functions and variables. Use the len
/// member to determine the real size of the table (size = len * 4).
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceLibraryEntryTable {
/// The library's name.
pub libname: *const u8,
/// Library version.
pub version: [u8; 2usize],
/// Library attributes.
pub attribute: u16,
/// Length of this entry table in 32-bit WORDs.
pub len: u8,
/// The number of variables exported by the library.
pub vstubcount: u8,
/// The number of functions exported by the library.
pub stubcount: u16,
/// Pointer to the entry table; an array of NIDs followed by
/// pointers to functions and variables.
pub entrytable: *mut c_void,
}
#[test]
fn bindgen_test_layout_SceLibraryEntryTable() {
assert_eq!(::core::mem::size_of::<SceLibraryEntryTable>() , 24usize ,
concat ! ( "Size of: " , stringify ! ( SceLibraryEntryTable )
));
assert_eq! (::core::mem::align_of::<SceLibraryEntryTable>() , 8usize ,
concat ! (
"Alignment of " , stringify ! ( SceLibraryEntryTable ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceLibraryEntryTable ) ) . libname as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceLibraryEntryTable )
, "::" , stringify ! ( libname ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceLibraryEntryTable ) ) . version as *
const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( SceLibraryEntryTable )
, "::" , stringify ! ( version ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceLibraryEntryTable ) ) . attribute as *
const _ as usize } , 10usize , concat ! (
"Alignment of field: " , stringify ! ( SceLibraryEntryTable )
, "::" , stringify ! ( attribute ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceLibraryEntryTable ) ) . len as * const
_ as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( SceLibraryEntryTable )
, "::" , stringify ! ( len ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceLibraryEntryTable ) ) . vstubcount as
* const _ as usize } , 13usize , concat ! (
"Alignment of field: " , stringify ! ( SceLibraryEntryTable )
, "::" , stringify ! ( vstubcount ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceLibraryEntryTable ) ) . stubcount as *
const _ as usize } , 14usize , concat ! (
"Alignment of field: " , stringify ! ( SceLibraryEntryTable )
, "::" , stringify ! ( stubcount ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceLibraryEntryTable ) ) . entrytable as
* const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( SceLibraryEntryTable )
, "::" , stringify ! ( entrytable ) ));
}
impl Clone for SceLibraryEntryTable {
fn clone(&self) -> Self { *self }
}
/// Specifies a library and a set of imports from that library. Use the len
/// member to determine the real size of the table (size = len * 4).
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceLibraryStubTable {
pub libname: *const u8,
/// Minimum required version of the library we want to import.
pub version: [u8; 2usize],
pub attribute: u16,
/// Length of this stub table in 32-bit WORDs.
pub len: u8,
/// The number of variables imported from the library.
pub vstubcount: u8,
/// The number of functions imported from the library.
pub stubcount: u16,
/// Pointer to an array of NIDs.
pub nidtable: *mut u32,
/// Pointer to the imported function stubs.
pub stubtable: *mut c_void,
/// Pointer to the imported variable stubs.
pub vstubtable: *mut c_void,
}
#[test]
fn bindgen_test_layout_SceLibraryStubTable() {
assert_eq!(::core::mem::size_of::<SceLibraryStubTable>() , 40usize ,
concat ! ( "Size of: " , stringify ! ( SceLibraryStubTable )
));
assert_eq! (::core::mem::align_of::<SceLibraryStubTable>() , 8usize ,
concat ! (
"Alignment of " , stringify ! ( SceLibraryStubTable ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceLibraryStubTable ) ) . libname as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceLibraryStubTable ) ,
"::" , stringify ! ( libname ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceLibraryStubTable ) ) . version as *
const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( SceLibraryStubTable ) ,
"::" , stringify ! ( version ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceLibraryStubTable ) ) . attribute as *
const _ as usize } , 10usize , concat ! (
"Alignment of field: " , stringify ! ( SceLibraryStubTable ) ,
"::" , stringify ! ( attribute ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceLibraryStubTable ) ) . len as * const
_ as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( SceLibraryStubTable ) ,
"::" , stringify ! ( len ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceLibraryStubTable ) ) . vstubcount as *
const _ as usize } , 13usize , concat ! (
"Alignment of field: " , stringify ! ( SceLibraryStubTable ) ,
"::" , stringify ! ( vstubcount ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceLibraryStubTable ) ) . stubcount as *
const _ as usize } , 14usize , concat ! (
"Alignment of field: " , stringify ! ( SceLibraryStubTable ) ,
"::" , stringify ! ( stubcount ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceLibraryStubTable ) ) . nidtable as *
const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( SceLibraryStubTable ) ,
"::" , stringify ! ( nidtable ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceLibraryStubTable ) ) . stubtable as *
const _ as usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! ( SceLibraryStubTable ) ,
"::" , stringify ! ( stubtable ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceLibraryStubTable ) ) . vstubtable as *
const _ as usize } , 32usize , concat ! (
"Alignment of field: " , stringify ! ( SceLibraryStubTable ) ,
"::" , stringify ! ( vstubtable ) ));
}
impl Clone for SceLibraryStubTable {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// Find a module by it's name.
///
/// @param modname - The name of the module.
///
/// @return Pointer to the ::SceModule structure if found, otherwise NULL.
pub fn sceKernelFindModuleByName(modname: *const u8)
-> *mut SceModule;
}
extern "C" {
/// Find a module from an address.
///
/// @param addr - Address somewhere within the module.
///
/// @return Pointer to the ::SceModule structure if found, otherwise NULL.
pub fn sceKernelFindModuleByAddress(addr: u32) -> *mut SceModule;
}
extern "C" {
/// Find a module by it's UID.
///
/// @param modid - The UID of the module.
///
/// @return Pointer to the ::SceModule structure if found, otherwise NULL.
pub fn sceKernelFindModuleByUID(modid: SceUID) -> *mut SceModule;
}
extern "C" {
/// Return the count of loaded modules.
///
/// @return The count of loaded modules.
pub fn sceKernelModuleCount() -> i32;
}
extern "C" {
/// Invalidate the CPU's instruction cache.
pub fn sceKernelIcacheClearAll();
}
extern "C" {
/// Function reopen the stdout file handle to a new file
///
/// @param file - The file to open.
/// @param flags - The open flags
/// @param mode - The file mode
///
/// @return < 0 on error.
pub fn sceKernelStdoutReopen(file: *const u8, flags: i32,
mode: SceMode) -> i32;
}
extern "C" {
/// Function reopen the stderr file handle to a new file
///
/// @param file - The file to open.
/// @param flags - The open flags
/// @param mode - The file mode
///
/// @return < 0 on error.
pub fn sceKernelStderrReopen(file: *const u8, flags: i32,
mode: SceMode) -> i32;
}
extern "C" {
/// fprintf but for file descriptors
///
/// @param fd - file descriptor from sceIoOpen
/// @param format - format string
/// @param ... - variables
///
/// @return number of characters printed, <0 on error
pub fn fdprintf(fd: i32, format: *const u8, ...) -> i32;
}
extern "C" {
/// Enable the ME reset.
///
/// @return < 0 on error.
pub fn sceSysregMeResetEnable() -> i32;
}
extern "C" {
/// Disable the ME reset.
///
/// @return < 0 on error.
pub fn sceSysregMeResetDisable() -> i32;
}
extern "C" {
/// Enable the VME reset.
///
/// @return < 0 on error.
pub fn sceSysregVmeResetEnable() -> i32;
}
extern "C" {
/// Disable the VME reset.
///
/// @return < 0 on error.
pub fn sceSysregVmeResetDisable() -> i32;
}
extern "C" {
/// Enable the ME bus clock.
///
/// @return < 0 on error.
pub fn sceSysregMeBusClockEnable() -> i32;
}
extern "C" {
/// Disable the ME bus clock.
///
/// @return < 0 on error.
pub fn sceSysregMeBusClockDisable() -> i32;
}
extern "C" {
/// Get the PSP's Tachyon version.
/// @param version - A pointer to an int to receive the Tachyon version into
pub fn sceSysconGetTachyonVersion(version: *mut i32) -> i32;
}
/// Typedef for the debug putcharacter handler
pub type PspDebugPutChar =
::core::option::Option<unsafe extern "C" fn(args: *mut u16,
ch: u32)>;
extern "C" {
/// Register a debug put character handler
///
/// @param func - The put character function to register.
pub fn sceKernelRegisterDebugPutchar(func: PspDebugPutChar);
}
extern "C" {
/// Get the debug put character handler
///
/// @return The current debug putchar handler
pub fn sceKernelGetDebugPutchar() -> PspDebugPutChar;
}
extern "C" {
/// Kernel printf function.
///
/// @param format - The format string.
/// @param ... - Arguments for the format string.
pub fn Kprintf(format: *const u8, ...);
}
extern "C" {
/// Register an interrupt handler.
///
/// @param intno - The interrupt number to register.
/// @param no - The queue number.
/// @param handler - Pointer to the handler.
/// @param arg1 - Unknown (probably a set of flags)
/// @param arg2 - Unknown (probably a common pointer)
///
/// @return 0 on success.
pub fn sceKernelRegisterIntrHandler(intno: i32, no: i32,
handler: *mut c_void,
arg1: *mut c_void,
arg2: *mut c_void) -> i32;
}
extern "C" {
/// Release an interrupt handler
///
/// @param intno - The interrupt number to release
///
/// @return 0 on success
pub fn sceKernelReleaseIntrHandler(intno: i32) -> i32;
}
extern "C" {
/// Enable an interrupt.
///
/// @param intno - Interrupt to enable.
///
/// @return 0 on success.
pub fn sceKernelEnableIntr(intno: i32) -> i32;
}
extern "C" {
/// Disable an interrupt.
///
/// @param intno - Interrupt to disable.
///
/// @return 0 on success.
pub fn sceKernelDisableIntr(intno: i32) -> i32;
}
extern "C" {
/// Check if we are in an interrupt context or not
///
/// @return 1 if we are in an interrupt context, else 0
pub fn sceKernelIsIntrContext() -> i32;
}
extern "C" {
/// Gets the current module list.
///
/// @param readbufsize - The size of the read buffer.
/// @param readbuf - Pointer to a buffer to store the IDs
///
/// @return < 0 on error.
pub fn sceKernelGetModuleList(readbufsize: i32, readbuf: *mut SceUID)
-> i32;
}
extern "C" {
/// Load a module from a buffer
///
/// @param buf - Pointer to a buffer containing the module to load. The buffer must reside at an
/// address that is a multiple to 64 bytes.
/// @param bufsize - Size (in bytes) of the buffer pointed to by buf.
/// @param flags - Unused, always 0.
/// @param option - Pointer to an optional ::SceKernelLMOption structure.
///
/// @return The UID of the loaded module on success, otherwise one of ::PspKernelErrorCodes.
pub fn sceKernelLoadModuleBuffer(buf: *mut c_void, bufsize: SceSize,
flags: i32,
option: *mut SceKernelLMOption)
-> SceUID;
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct PspBufferInfo {
pub pucWritePositionFirstBuf: *mut u8,
pub uiWritableByteFirstBuf: u32,
pub uiMinWriteByteFirstBuf: u32,
pub uiReadPositionFirstBuf: u32,
pub pucWritePositionSecondBuf: *mut u8,
pub uiWritableByteSecondBuf: u32,
pub uiMinWriteByteSecondBuf: u32,
pub uiReadPositionSecondBuf: u32,
}
#[test]
fn bindgen_test_layout_PspBufferInfo() {
assert_eq!(::core::mem::size_of::<PspBufferInfo>() , 48usize , concat ! (
"Size of: " , stringify ! ( PspBufferInfo ) ));
assert_eq! (::core::mem::align_of::<PspBufferInfo>() , 8usize , concat ! (
"Alignment of " , stringify ! ( PspBufferInfo ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspBufferInfo ) ) .
pucWritePositionFirstBuf as * const _ as usize } , 0usize ,
concat ! (
"Alignment of field: " , stringify ! ( PspBufferInfo ) , "::"
, stringify ! ( pucWritePositionFirstBuf ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspBufferInfo ) ) .
uiWritableByteFirstBuf as * const _ as usize } , 8usize ,
concat ! (
"Alignment of field: " , stringify ! ( PspBufferInfo ) , "::"
, stringify ! ( uiWritableByteFirstBuf ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspBufferInfo ) ) .
uiMinWriteByteFirstBuf as * const _ as usize } , 12usize ,
concat ! (
"Alignment of field: " , stringify ! ( PspBufferInfo ) , "::"
, stringify ! ( uiMinWriteByteFirstBuf ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspBufferInfo ) ) .
uiReadPositionFirstBuf as * const _ as usize } , 16usize ,
concat ! (
"Alignment of field: " , stringify ! ( PspBufferInfo ) , "::"
, stringify ! ( uiReadPositionFirstBuf ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspBufferInfo ) ) .
pucWritePositionSecondBuf as * const _ as usize } , 24usize ,
concat ! (
"Alignment of field: " , stringify ! ( PspBufferInfo ) , "::"
, stringify ! ( pucWritePositionSecondBuf ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspBufferInfo ) ) .
uiWritableByteSecondBuf as * const _ as usize } , 32usize ,
concat ! (
"Alignment of field: " , stringify ! ( PspBufferInfo ) , "::"
, stringify ! ( uiWritableByteSecondBuf ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspBufferInfo ) ) .
uiMinWriteByteSecondBuf as * const _ as usize } , 36usize ,
concat ! (
"Alignment of field: " , stringify ! ( PspBufferInfo ) , "::"
, stringify ! ( uiMinWriteByteSecondBuf ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspBufferInfo ) ) .
uiReadPositionSecondBuf as * const _ as usize } , 40usize ,
concat ! (
"Alignment of field: " , stringify ! ( PspBufferInfo ) , "::"
, stringify ! ( uiReadPositionSecondBuf ) ));
}
impl Clone for PspBufferInfo {
fn clone(&self) -> Self { *self }
}
extern "C" {
pub fn sceAtracGetAtracID(uiCodecType: uint) -> i32;
}
extern "C" {
/// Creates a new Atrac ID from the specified data
///
/// @param buf - the buffer holding the atrac3 data, including the RIFF/WAVE header.
/// @param bufsize - the size of the buffer pointed by buf
///
/// @return the new atrac ID, or < 0 on error
pub fn sceAtracSetDataAndGetID(buf: *mut c_void, bufsize: SceSize)
-> i32;
}
extern "C" {
/// Decode a frame of data.
///
/// @param atracID - the atrac ID
/// @param outSamples - pointer to a buffer that receives the decoded data of the current frame
/// @param outN - pointer to a integer that receives the number of audio samples of the decoded frame
/// @param outEnd - pointer to a integer that receives a boolean value indicating if the decoded frame is the last one
/// @param outRemainFrame - pointer to a integer that receives either -1 if all at3 data is already on memory,
/// or the remaining (not decoded yet) frames at memory if not all at3 data is on memory
///
///
/// @return < 0 on error, otherwise 0
///
pub fn sceAtracDecodeData(atracID: i32, outSamples: *mut u16,
outN: *mut i32, outEnd: *mut i32,
outRemainFrame: *mut i32) -> i32;
}
extern "C" {
/// Gets the remaining (not decoded) number of frames
///
/// @param atracID - the atrac ID
/// @param outRemainFrame - pointer to a integer that receives either -1 if all at3 data is already on memory,
/// or the remaining (not decoded yet) frames at memory if not all at3 data is on memory
///
/// @return < 0 on error, otherwise 0
///
pub fn sceAtracGetRemainFrame(atracID: i32,
outRemainFrame: *mut i32) -> i32;
}
extern "C" {
/// @param atracID - the atrac ID
/// @param writePointer - Pointer to where to read the atrac data
/// @param availableBytes - Number of bytes available at the writePointer location
/// @param readOffset - Offset where to seek into the atrac file before reading
///
/// @return < 0 on error, otherwise 0
///
pub fn sceAtracGetStreamDataInfo(atracID: i32,
writePointer: *mut *mut u8,
availableBytes: *mut u32,
readOffset: *mut u32) -> i32;
}
extern "C" {
/// @param atracID - the atrac ID
/// @param bytesToAdd - Number of bytes read into location given by sceAtracGetStreamDataInfo().
///
/// @return < 0 on error, otherwise 0
pub fn sceAtracAddStreamData(atracID: i32, bytesToAdd: u32)
-> i32;
}
extern "C" {
/// Gets the bitrate.
///
/// @param atracID - the atracID
/// @param outBitrate - pointer to a integer that receives the bitrate in kbps
///
/// @return < 0 on error, otherwise 0
///
pub fn sceAtracGetBitrate(atracID: i32, outBitrate: *mut i32)
-> i32;
}
extern "C" {
/// Sets the number of loops for this atrac ID
///
/// @param atracID - the atracID
/// @param nloops - the number of loops to set
///
/// @return < 0 on error, otherwise 0
///
pub fn sceAtracSetLoopNum(atracID: i32, nloops: i32) -> i32;
}
extern "C" {
/// It releases an atrac ID
///
/// @param atracID - the atrac ID to release
///
/// @return < 0 on error
///
pub fn sceAtracReleaseAtracID(atracID: i32) -> i32;
}
extern "C" {
/// Gets the number of samples of the next frame to be decoded.
///
/// @param atracID - the atrac ID
/// @param outN - pointer to receives the number of samples of the next frame.
///
/// @return < 0 on error, otherwise 0
///
pub fn sceAtracGetNextSample(atracID: i32, outN: *mut i32)
-> i32;
}
extern "C" {
/// Gets the maximum number of samples of the atrac3 stream.
///
/// @param atracID - the atrac ID
/// @param outMax - pointer to a integer that receives the maximum number of samples.
///
/// @return < 0 on error, otherwise 0
///
pub fn sceAtracGetMaxSample(atracID: i32, outMax: *mut i32)
-> i32;
}
extern "C" {
pub fn sceAtracGetBufferInfoForReseting(atracID: i32, uiSample: u32,
pBufferInfo: *mut PspBufferInfo)
-> i32;
}
extern "C" {
pub fn sceAtracGetChannel(atracID: i32, puiChannel: *mut u32)
-> i32;
}
extern "C" {
pub fn sceAtracGetInternalErrorInfo(atracID: i32,
piResult: *mut i32) -> i32;
}
extern "C" {
pub fn sceAtracGetLoopStatus(atracID: i32, piLoopNum: *mut i32,
puiLoopStatus: *mut u32) -> i32;
}
extern "C" {
pub fn sceAtracGetNextDecodePosition(atracID: i32,
puiSamplePosition: *mut u32)
-> i32;
}
extern "C" {
pub fn sceAtracGetSecondBufferInfo(atracID: i32,
puiPosition: *mut u32,
puiDataByte: *mut u32) -> i32;
}
extern "C" {
pub fn sceAtracGetSoundSample(atracID: i32, piEndSample: *mut i32,
piLoopStartSample: *mut i32,
piLoopEndSample: *mut i32) -> i32;
}
extern "C" {
pub fn sceAtracResetPlayPosition(atracID: i32, uiSample: u32,
uiWriteByteFirstBuf: u32,
uiWriteByteSecondBuf: u32) -> i32;
}
extern "C" {
pub fn sceAtracSetData(atracID: i32, pucBufferAddr: *mut u8,
uiBufferByte: u32) -> i32;
}
extern "C" {
pub fn sceAtracSetHalfwayBuffer(atracID: i32, pucBufferAddr: *mut u8,
uiReadByte: u32, uiBufferByte: u32)
-> i32;
}
extern "C" {
pub fn sceAtracSetHalfwayBufferAndGetID(pucBufferAddr: *mut u8,
uiReadByte: u32,
uiBufferByte: u32) -> i32;
}
extern "C" {
pub fn sceAtracSetSecondBuffer(atracID: i32,
pucSecondBufferAddr: *mut u8,
uiSecondBufferByte: u32) -> i32;
}
extern "C" {
pub fn sceAudiocodecCheckNeedMem(Buffer: *mut u32, Type: i32)
-> i32;
}
extern "C" {
pub fn sceAudiocodecInit(Buffer: *mut u32, Type: i32)
-> i32;
}
extern "C" {
pub fn sceAudiocodecDecode(Buffer: *mut u32, Type: i32)
-> i32;
}
extern "C" {
pub fn sceAudiocodecGetEDRAM(Buffer: *mut u32, Type: i32)
-> i32;
}
extern "C" {
pub fn sceAudiocodecReleaseEDRAM(Buffer: *mut u32) -> i32;
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspAudioFormats {
PSP_AUDIO_FORMAT_STEREO = 0,
PSP_AUDIO_FORMAT_MONO = 16,
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct pspAudioInputParams {
/// Unknown. Pass 0
pub unknown1: i32,
pub gain: i32,
/// Unknown. Pass 0
pub unknown2: i32,
/// Unknown. Pass 0
pub unknown3: i32,
/// Unknown. Pass 0
pub unknown4: i32,
/// Unknown. Pass 0
pub unknown5: i32,
}
#[test]
fn bindgen_test_layout_pspAudioInputParams() {
assert_eq!(::core::mem::size_of::<pspAudioInputParams>() , 24usize ,
concat ! ( "Size of: " , stringify ! ( pspAudioInputParams )
));
assert_eq! (::core::mem::align_of::<pspAudioInputParams>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( pspAudioInputParams ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspAudioInputParams ) ) . unknown1 as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( pspAudioInputParams ) ,
"::" , stringify ! ( unknown1 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspAudioInputParams ) ) . gain as * const
_ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( pspAudioInputParams ) ,
"::" , stringify ! ( gain ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspAudioInputParams ) ) . unknown2 as *
const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( pspAudioInputParams ) ,
"::" , stringify ! ( unknown2 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspAudioInputParams ) ) . unknown3 as *
const _ as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( pspAudioInputParams ) ,
"::" , stringify ! ( unknown3 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspAudioInputParams ) ) . unknown4 as *
const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( pspAudioInputParams ) ,
"::" , stringify ! ( unknown4 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspAudioInputParams ) ) . unknown5 as *
const _ as usize } , 20usize , concat ! (
"Alignment of field: " , stringify ! ( pspAudioInputParams ) ,
"::" , stringify ! ( unknown5 ) ));
}
impl Clone for pspAudioInputParams {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// Allocate and initialize a hardware output channel.
///
/// @param channel - Use a value between 0 - 7 to reserve a specific channel.
/// Pass PSP_AUDIO_NEXT_CHANNEL to get the first available channel.
/// @param samplecount - The number of samples that can be output on the channel per
/// output call. It must be a value between ::PSP_AUDIO_SAMPLE_MIN
/// and ::PSP_AUDIO_SAMPLE_MAX, and it must be aligned to 64 bytes
/// (use the ::PSP_AUDIO_SAMPLE_ALIGN macro to align it).
/// @param format - The output format to use for the channel. One of ::PspAudioFormats.
///
/// @return The channel number on success, an error code if less than 0.
pub fn sceAudioChReserve(channel: i32, samplecount: i32,
format: i32) -> i32;
}
extern "C" {
/// Release a hardware output channel.
///
/// @param channel - The channel to release.
///
/// @return 0 on success, an error if less than 0.
pub fn sceAudioChRelease(channel: i32) -> i32;
}
extern "C" {
/// Output audio of the specified channel
///
/// @param channel - The channel number.
///
/// @param vol - The volume.
///
/// @param buf - Pointer to the PCM data to output.
///
/// @return 0 on success, an error if less than 0.
pub fn sceAudioOutput(channel: i32, vol: i32, buf: *mut c_void)
-> i32;
}
extern "C" {
/// Output audio of the specified channel (blocking)
///
/// @param channel - The channel number.
///
/// @param vol - The volume.
///
/// @param buf - Pointer to the PCM data to output.
///
/// @return 0 on success, an error if less than 0.
pub fn sceAudioOutputBlocking(channel: i32, vol: i32,
buf: *mut c_void) -> i32;
}
extern "C" {
/// Output panned audio of the specified channel
///
/// @param channel - The channel number.
///
/// @param leftvol - The left volume.
///
/// @param rightvol - The right volume.
///
/// @param buf - Pointer to the PCM data to output.
///
/// @return 0 on success, an error if less than 0.
pub fn sceAudioOutputPanned(channel: i32, leftvol: i32,
rightvol: i32, buf: *mut c_void)
-> i32;
}
extern "C" {
/// Output panned audio of the specified channel (blocking)
///
/// @param channel - The channel number.
///
/// @param leftvol - The left volume.
///
/// @param rightvol - The right volume.
///
/// @param buf - Pointer to the PCM data to output.
///
/// @return 0 on success, an error if less than 0.
pub fn sceAudioOutputPannedBlocking(channel: i32, leftvol: i32,
rightvol: i32, buf: *mut c_void)
-> i32;
}
extern "C" {
/// Get count of unplayed samples remaining
///
/// @param channel - The channel number.
///
/// @return Number of samples to be played, an error if less than 0.
pub fn sceAudioGetChannelRestLen(channel: i32) -> i32;
}
extern "C" {
/// Get count of unplayed samples remaining
///
/// @param channel - The channel number.
///
/// @return Number of samples to be played, an error if less than 0.
pub fn sceAudioGetChannelRestLength(channel: i32) -> i32;
}
extern "C" {
/// Change the output sample count, after it's already been reserved
///
/// @param channel - The channel number.
/// @param samplecount - The number of samples to output in one output call.
///
/// @return 0 on success, an error if less than 0.
pub fn sceAudioSetChannelDataLen(channel: i32, samplecount: i32)
-> i32;
}
extern "C" {
/// Change the format of a channel
///
/// @param channel - The channel number.
///
/// @param format - One of ::PspAudioFormats
///
/// @return 0 on success, an error if less than 0.
pub fn sceAudioChangeChannelConfig(channel: i32, format: i32)
-> i32;
}
extern "C" {
/// Change the volume of a channel
///
/// @param channel - The channel number.
///
/// @param leftvol - The left volume.
///
/// @param rightvol - The right volume.
///
/// @return 0 on success, an error if less than 0.
pub fn sceAudioChangeChannelVolume(channel: i32, leftvol: i32,
rightvol: i32) -> i32;
}
extern "C" {
/// Reserve the audio output and set the output sample count
///
/// @param samplecount - The number of samples to output in one output call (min 17, max 4111).
///
/// @return 0 on success, an error if less than 0.
pub fn sceAudioOutput2Reserve(samplecount: i32) -> i32;
}
extern "C" {
/// Release the audio output
///
/// @return 0 on success, an error if less than 0.
pub fn sceAudioOutput2Release() -> i32;
}
extern "C" {
/// Change the output sample count, after it's already been reserved
///
/// @param samplecount - The number of samples to output in one output call (min 17, max 4111).
///
/// @return 0 on success, an error if less than 0.
pub fn sceAudioOutput2ChangeLength(samplecount: i32) -> i32;
}
extern "C" {
/// Output audio (blocking)
///
/// @param vol - The volume.
///
/// @param buf - Pointer to the PCM data.
///
/// @return 0 on success, an error if less than 0.
pub fn sceAudioOutput2OutputBlocking(vol: i32, buf: *mut c_void)
-> i32;
}
extern "C" {
/// Get count of unplayed samples remaining
///
/// @return Number of samples to be played, an error if less than 0.
pub fn sceAudioOutput2GetRestSample() -> i32;
}
extern "C" {
/// Reserve the audio output
///
/// @param samplecount - The number of samples to output in one output call (min 17, max 4111).
///
/// @param freq - The frequency. One of 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11050, 8000.
///
/// @param channels - Number of channels. Pass 2 (stereo).
///
/// @return 0 on success, an error if less than 0.
pub fn sceAudioSRCChReserve(samplecount: i32, freq: i32,
channels: i32) -> i32;
}
extern "C" {
/// Release the audio output
///
/// @return 0 on success, an error if less than 0.
pub fn sceAudioSRCChRelease() -> i32;
}
extern "C" {
/// Output audio
///
/// @param vol - The volume.
///
/// @param buf - Pointer to the PCM data to output.
///
/// @return 0 on success, an error if less than 0.
pub fn sceAudioSRCOutputBlocking(vol: i32, buf: *mut c_void)
-> i32;
}
extern "C" {
/// Init audio input
///
/// @param unknown1 - Unknown. Pass 0.
///
/// @param gain - Gain.
///
/// @param unknown2 - Unknown. Pass 0.
///
/// @return 0 on success, an error if less than 0.
pub fn sceAudioInputInit(unknown1: i32, gain: i32,
unknown2: i32) -> i32;
}
extern "C" {
/// Init audio input (with extra arguments)
///
/// @param params - A pointer to a ::pspAudioInputParams struct.
///
/// @return 0 on success, an error if less than 0.
pub fn sceAudioInputInitEx(params: *mut pspAudioInputParams) -> i32;
}
extern "C" {
/// Perform audio input (blocking)
///
/// @param samplecount - Number of samples.
///
/// @param freq - Either 44100, 22050 or 11025.
///
/// @param buf - Pointer to where the audio data will be stored.
///
/// @return 0 on success, an error if less than 0.
pub fn sceAudioInputBlocking(samplecount: i32, freq: i32,
buf: *mut c_void) -> i32;
}
extern "C" {
/// Perform audio input
///
/// @param samplecount - Number of samples.
///
/// @param freq - Either 44100, 22050 or 11025.
///
/// @param buf - Pointer to where the audio data will be stored.
///
/// @return 0 on success, an error if less than 0.
pub fn sceAudioInput(samplecount: i32, freq: i32,
buf: *mut c_void) -> i32;
}
extern "C" {
/// Get the number of samples that were acquired
///
/// @return Number of samples acquired, an error if less than 0.
pub fn sceAudioGetInputLength() -> i32;
}
extern "C" {
/// Wait for non-blocking audio input to complete
///
/// @return 0 on success, an error if less than 0.
pub fn sceAudioWaitInputEnd() -> i32;
}
extern "C" {
/// Poll for non-blocking audio input status
///
/// @return 0 if input has completed, 1 if not completed or an error if less than 0.
pub fn sceAudioPollInputEnd() -> i32;
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspAudioFrequencies {
PSP_AUDIO_FREQ_44K = 44100,
PSP_AUDIO_FREQ_48K = 48000,
}
extern "C" {
/// Set audio sampling frequency
///
/// @param frequency - Sampling frequency to set audio output to - either 44100 or 48000.
///
/// @return 0 on success, an error if less than 0.
pub fn sceAudioSetFrequency(frequency: i32) -> i32;
}
pub type pspAudioCallback_t =
::core::option::Option<unsafe extern "C" fn(buf: *mut c_void,
reqn: u32,
pdata: *mut c_void)>;
#[repr(C)]
#[derive(Debug, Copy)]
pub struct psp_audio_channelinfo {
pub threadhandle: i32,
pub handle: i32,
pub volumeleft: i32,
pub volumeright: i32,
pub callback: pspAudioCallback_t,
pub pdata: *mut c_void,
}
#[test]
fn bindgen_test_layout_psp_audio_channelinfo() {
assert_eq!(::core::mem::size_of::<psp_audio_channelinfo>() , 32usize ,
concat ! ( "Size of: " , stringify ! ( psp_audio_channelinfo )
));
assert_eq! (::core::mem::align_of::<psp_audio_channelinfo>() , 8usize ,
concat ! (
"Alignment of " , stringify ! ( psp_audio_channelinfo ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const psp_audio_channelinfo ) ) . threadhandle
as * const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( psp_audio_channelinfo )
, "::" , stringify ! ( threadhandle ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const psp_audio_channelinfo ) ) . handle as *
const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( psp_audio_channelinfo )
, "::" , stringify ! ( handle ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const psp_audio_channelinfo ) ) . volumeleft as
* const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( psp_audio_channelinfo )
, "::" , stringify ! ( volumeleft ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const psp_audio_channelinfo ) ) . volumeright
as * const _ as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( psp_audio_channelinfo )
, "::" , stringify ! ( volumeright ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const psp_audio_channelinfo ) ) . callback as *
const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( psp_audio_channelinfo )
, "::" , stringify ! ( callback ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const psp_audio_channelinfo ) ) . pdata as *
const _ as usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! ( psp_audio_channelinfo )
, "::" , stringify ! ( pdata ) ));
}
impl Clone for psp_audio_channelinfo {
fn clone(&self) -> Self { *self }
}
pub type pspAudioThreadfunc_t =
::core::option::Option<unsafe extern "C" fn(args: i32,
argp: *mut c_void)
-> i32>;
extern "C" {
pub fn pspAudioInit() -> i32;
}
extern "C" {
pub fn pspAudioEndPre();
}
extern "C" {
pub fn pspAudioEnd();
}
extern "C" {
pub fn pspAudioSetVolume(channel: i32, left: i32, right: i32);
}
extern "C" {
pub fn pspAudioChannelThreadCallback(channel: i32, buf: *mut c_void,
reqn: u32);
}
extern "C" {
pub fn pspAudioSetChannelCallback(channel: i32,
callback: pspAudioCallback_t,
pdata: *mut c_void);
}
extern "C" {
pub fn pspAudioOutBlocking(channel: u32, vol1: u32,
vol2: u32, buf: *mut c_void) -> i32;
}
extern "C" {
/// Set routing mode.
///
/// @param mode The routing mode to set (0 or 1)
///
/// @return the previous routing mode, or < 0 on error
pub fn sceAudioRoutingSetMode(mode: i32) -> i32;
}
extern "C" {
/// Get routing mode.
///
/// @return the current routing mode.
pub fn sceAudioRoutingGetMode() -> i32;
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct _pspChnnlsvContext1 {
/// Cipher mode
pub mode: i32,
/// Context data
pub buffer1: [u8; 16usize],
pub buffer2: [u8; 16usize],
pub unknown: i32,
}
#[test]
fn bindgen_test_layout__pspChnnlsvContext1() {
assert_eq!(::core::mem::size_of::<_pspChnnlsvContext1>() , 40usize ,
concat ! ( "Size of: " , stringify ! ( _pspChnnlsvContext1 )
));
assert_eq! (::core::mem::align_of::<_pspChnnlsvContext1>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( _pspChnnlsvContext1 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _pspChnnlsvContext1 ) ) . mode as * const
_ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( _pspChnnlsvContext1 ) ,
"::" , stringify ! ( mode ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _pspChnnlsvContext1 ) ) . buffer1 as *
const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( _pspChnnlsvContext1 ) ,
"::" , stringify ! ( buffer1 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _pspChnnlsvContext1 ) ) . buffer2 as *
const _ as usize } , 20usize , concat ! (
"Alignment of field: " , stringify ! ( _pspChnnlsvContext1 ) ,
"::" , stringify ! ( buffer2 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _pspChnnlsvContext1 ) ) . unknown as *
const _ as usize } , 36usize , concat ! (
"Alignment of field: " , stringify ! ( _pspChnnlsvContext1 ) ,
"::" , stringify ! ( unknown ) ));
}
impl Clone for _pspChnnlsvContext1 {
fn clone(&self) -> Self { *self }
}
pub type pspChnnlsvContext1 = _pspChnnlsvContext1;
#[repr(C)]
#[derive(Copy)]
pub struct _pspChnnlsvContext2 {
/// Context data
pub unknown: [u8; 256usize],
}
#[test]
fn bindgen_test_layout__pspChnnlsvContext2() {
assert_eq!(::core::mem::size_of::<_pspChnnlsvContext2>() , 256usize ,
concat ! ( "Size of: " , stringify ! ( _pspChnnlsvContext2 )
));
assert_eq! (::core::mem::align_of::<_pspChnnlsvContext2>() , 1usize ,
concat ! (
"Alignment of " , stringify ! ( _pspChnnlsvContext2 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _pspChnnlsvContext2 ) ) . unknown as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( _pspChnnlsvContext2 ) ,
"::" , stringify ! ( unknown ) ));
}
impl Clone for _pspChnnlsvContext2 {
fn clone(&self) -> Self { *self }
}
pub type pspChnnlsvContext2 = _pspChnnlsvContext2;
extern "C" {
/// Initialize context
///
/// @param ctx - Context
/// @param mode - Cipher mode
/// @return < 0 on error
pub fn sceChnnlsv_E7833020(ctx: *mut pspChnnlsvContext1, mode: i32)
-> i32;
}
extern "C" {
/// Process data
///
/// @param ctx - Context
/// @param data - Data (aligned to 0x10)
/// @param len - Length (aligned to 0x10)
/// @return < 0 on error
pub fn sceChnnlsv_F21A1FCA(ctx: *mut pspChnnlsvContext1,
data: *mut u8, len: i32) -> i32;
}
extern "C" {
/// Finalize hash
///
/// @param ctx - Context
/// @param hash - Hash output (aligned to 0x10, 0x10 bytes long)
/// @param cryptkey - Crypt key or NULL.
/// @return < 0 on error
pub fn sceChnnlsv_C4C494F8(ctx: *mut pspChnnlsvContext1,
hash: *mut u8, cryptkey: *mut u8)
-> i32;
}
extern "C" {
/// Prepare a key, and set up integrity check
///
/// @param ctx - Context
/// @param mode1 - Cipher mode
/// @param mode2 - Encrypt mode (1 = encrypting, 2 = decrypting)
/// @param hashkey - Key out
/// @param cipherkey - Key in
/// @return < 0 on error
pub fn sceChnnlsv_ABFDFC8B(ctx: *mut pspChnnlsvContext2, mode1: i32,
mode2: i32, hashkey: *mut u8,
cipherkey: *mut u8) -> i32;
}
extern "C" {
/// Process data for integrity check
///
/// @param ctx - Context
/// @param data - Data (aligned to 0x10)
/// @param len - Length (aligned to 0x10)
/// @return < 0 on error
pub fn sceChnnlsv_850A7FA1(ctx: *mut pspChnnlsvContext2,
data: *mut u8, len: i32) -> i32;
}
extern "C" {
/// Check integrity
///
/// @param ctx - Context
/// @return < 0 on error
pub fn sceChnnlsv_21BE78B4(ctx: *mut pspChnnlsvContext2) -> i32;
}
#[repr(u32)]
/// Enumeration for the digital controller buttons.
///
/// @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
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspCtrlButtons {
PSP_CTRL_SELECT = 1,
PSP_CTRL_START = 8,
PSP_CTRL_UP = 16,
PSP_CTRL_RIGHT = 32,
PSP_CTRL_DOWN = 64,
PSP_CTRL_LEFT = 128,
PSP_CTRL_LTRIGGER = 256,
PSP_CTRL_RTRIGGER = 512,
PSP_CTRL_TRIANGLE = 4096,
PSP_CTRL_CIRCLE = 8192,
PSP_CTRL_CROSS = 16384,
PSP_CTRL_SQUARE = 32768,
PSP_CTRL_HOME = 65536,
PSP_CTRL_HOLD = 131072,
PSP_CTRL_NOTE = 8388608,
PSP_CTRL_SCREEN = 4194304,
PSP_CTRL_VOLUP = 1048576,
PSP_CTRL_VOLDOWN = 2097152,
PSP_CTRL_WLAN_UP = 262144,
PSP_CTRL_REMOTE = 524288,
PSP_CTRL_DISC = 16777216,
PSP_CTRL_MS = 33554432,
}
#[repr(u32)]
/// Controller mode.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspCtrlMode { PSP_CTRL_MODE_DIGITAL = 0, PSP_CTRL_MODE_ANALOG = 1, }
/// Returned controller data
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceCtrlData {
/// The current read frame.
pub TimeStamp: u32,
/// Bit mask containing zero or more of ::PspCtrlButtons.
pub Buttons: u32,
/// Analogue stick, X axis.
pub Lx: u8,
/// Analogue stick, Y axis.
pub Ly: u8,
/// Reserved.
pub Rsrv: [u8; 6usize],
}
#[test]
fn bindgen_test_layout_SceCtrlData() {
assert_eq!(::core::mem::size_of::<SceCtrlData>() , 16usize , concat ! (
"Size of: " , stringify ! ( SceCtrlData ) ));
assert_eq! (::core::mem::align_of::<SceCtrlData>() , 4usize , concat ! (
"Alignment of " , stringify ! ( SceCtrlData ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceCtrlData ) ) . TimeStamp as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceCtrlData ) , "::" ,
stringify ! ( TimeStamp ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceCtrlData ) ) . Buttons as * const _ as
usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( SceCtrlData ) , "::" ,
stringify ! ( Buttons ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceCtrlData ) ) . Lx as * const _ as
usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( SceCtrlData ) , "::" ,
stringify ! ( Lx ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceCtrlData ) ) . Ly as * const _ as
usize } , 9usize , concat ! (
"Alignment of field: " , stringify ! ( SceCtrlData ) , "::" ,
stringify ! ( Ly ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceCtrlData ) ) . Rsrv as * const _ as
usize } , 10usize , concat ! (
"Alignment of field: " , stringify ! ( SceCtrlData ) , "::" ,
stringify ! ( Rsrv ) ));
}
impl Clone for SceCtrlData {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceCtrlLatch {
pub uiMake: u32,
pub uiBreak: u32,
pub uiPress: u32,
pub uiRelease: u32,
}
#[test]
fn bindgen_test_layout_SceCtrlLatch() {
assert_eq!(::core::mem::size_of::<SceCtrlLatch>() , 16usize , concat ! (
"Size of: " , stringify ! ( SceCtrlLatch ) ));
assert_eq! (::core::mem::align_of::<SceCtrlLatch>() , 4usize , concat ! (
"Alignment of " , stringify ! ( SceCtrlLatch ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceCtrlLatch ) ) . uiMake as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceCtrlLatch ) , "::" ,
stringify ! ( uiMake ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceCtrlLatch ) ) . uiBreak as * const _
as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( SceCtrlLatch ) , "::" ,
stringify ! ( uiBreak ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceCtrlLatch ) ) . uiPress as * const _
as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( SceCtrlLatch ) , "::" ,
stringify ! ( uiPress ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceCtrlLatch ) ) . uiRelease as * const _
as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( SceCtrlLatch ) , "::" ,
stringify ! ( uiRelease ) ));
}
impl Clone for SceCtrlLatch {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// Set the controller cycle setting.
///
/// @param cycle - Cycle. Normally set to 0.
///
/// @return The previous cycle setting.
pub fn sceCtrlSetSamplingCycle(cycle: i32) -> i32;
}
extern "C" {
/// Get the controller current cycle setting.
///
/// @param pcycle - Return value.
///
/// @return 0.
pub fn sceCtrlGetSamplingCycle(pcycle: *mut i32) -> i32;
}
extern "C" {
/// Set the controller mode.
///
/// @param mode - One of ::PspCtrlMode.
///
/// @return The previous mode.
pub fn sceCtrlSetSamplingMode(mode: i32) -> i32;
}
extern "C" {
/// Get the current controller mode.
///
/// @param pmode - Return value.
///
/// @return 0.
pub fn sceCtrlGetSamplingMode(pmode: *mut i32) -> i32;
}
extern "C" {
pub fn sceCtrlPeekBufferPositive(pad_data: *mut SceCtrlData,
count: i32) -> i32;
}
extern "C" {
pub fn sceCtrlPeekBufferNegative(pad_data: *mut SceCtrlData,
count: i32) -> i32;
}
extern "C" {
/// Read buffer positive
///
/// @par Example:
/// @code
/// SceCtrlData pad;
///
/// sceCtrlSetSamplingCycle(0);
/// sceCtrlSetSamplingMode(1);
/// sceCtrlReadBufferPositive(&pad, 1);
/// // Do something with the read controller data
/// @endcode
///
/// @param pad_data - Pointer to a ::SceCtrlData structure used hold the returned pad data.
/// @param count - Number of ::SceCtrlData buffers to read.
pub fn sceCtrlReadBufferPositive(pad_data: *mut SceCtrlData,
count: i32) -> i32;
}
extern "C" {
pub fn sceCtrlReadBufferNegative(pad_data: *mut SceCtrlData,
count: i32) -> i32;
}
extern "C" {
pub fn sceCtrlPeekLatch(latch_data: *mut SceCtrlLatch) -> i32;
}
extern "C" {
pub fn sceCtrlReadLatch(latch_data: *mut SceCtrlLatch) -> i32;
}
extern "C" {
/// Set analog threshold relating to the idle timer.
///
/// @param idlereset - Movement needed by the analog to reset the idle timer.
/// @param idleback - Movement needed by the analog to bring the PSP back from an idle state.
///
/// Set to -1 for analog to not cancel idle timer.
/// Set to 0 for idle timer to be cancelled even if the analog is not moved.
/// Set between 1 - 128 to specify the movement on either axis needed by the analog to fire the event.
///
/// @return < 0 on error.
pub fn sceCtrlSetIdleCancelThreshold(idlereset: i32,
idleback: i32) -> i32;
}
extern "C" {
/// Get the idle threshold values.
///
/// @param idlerest - Movement needed by the analog to reset the idle timer.
/// @param idleback - Movement needed by the analog to bring the PSP back from an idle state.
///
/// @return < 0 on error.
pub fn sceCtrlGetIdleCancelThreshold(idlerest: *mut i32,
idleback: *mut i32) -> i32;
}
extern "C" {
/// Set the controller button masks
///
/// @param mask - The bits to setup
/// @param type - The type of operation (0 clear, 1 set mask, 2 set button)
///
/// @par Example:
/// @code
/// sceCtrl_driver_7CA723DC(0xFFFF, 1); // Mask lower 16bits
/// sceCtrl_driver_7CA723DC(0x10000, 2); // Always return HOME key
/// // Do something
/// sceCtrl_driver_7CA723DC(0x10000, 0); // Unset HOME key
/// sceCtrl_driver_7CA723DC(0xFFFF, 0); // Unset mask
/// @endcode
pub fn sceCtrl_driver_7CA723DC(mask: u32, type_: u32);
}
extern "C" {
/// Get button mask mode
///
/// @param mask - The bitmask to check
///
/// @return 0 no setting, 1 set in button mask, 2 set in button set
pub fn sceCtrl_driver_5E77BC8A(mask: u32) -> i32;
}
extern "C" {
/// Setup a controller callback
///
/// @param no - The number of the callback (0-3)
/// @param mask - The bits to check for
/// @param cb - The callback function (int curr_but, int last_but, void *arg)
/// @param arg - User defined argument passed
///
/// @return 0 on success, < 0 on error
pub fn sceCtrl_driver_5C56C779(no: i32, mask: u32,
cb:
::core::option::Option<unsafe extern "C" fn(arg1:
i32,
arg2:
i32,
arg3:
*mut c_void)>,
arg: *mut c_void) -> i32;
}
pub const PspDebugKbSettings_PSP_DEBUG_KB_OFFSET_X: PspDebugKbSettings =
PspDebugKbSettings::PSP_DEBUG_KB_BOX_X;
pub const PspDebugKbSettings_PSP_DEBUG_KB_NUM_ROWS: PspDebugKbSettings =
PspDebugKbSettings::PSP_DEBUG_KB_OFFSET_Y;
pub const PspDebugKbSettings_PSP_DEBUG_KB_COMMAND_ROW: PspDebugKbSettings =
PspDebugKbSettings::PSP_DEBUG_KB_OFFSET_Y;
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspDebugKbSettings {
PSP_DEBUG_KB_MAXLEN = 40,
PSP_DEBUG_KB_BOX_X = 6,
PSP_DEBUG_KB_BOX_Y = 8,
PSP_DEBUG_KB_CHAR_COLOUR = 4294967295,
PSP_DEBUG_KB_BACK_COLOUR = 4278190080,
PSP_DEBUG_KB_CHAR_HIGHLIGHT = 4278255360,
PSP_DEBUG_KB_BACK_HIGHLIGHT = 4279242768,
PSP_DEBUG_KB_OFFSET_Y = 4,
PSP_DEBUG_KB_SPACING_X = 3,
PSP_DEBUG_KB_SPACING_Y = 2,
PSP_DEBUG_KB_NUM_CHARS = 13,
PSP_DEBUG_KB_BOX_WIDTH = 51,
PSP_DEBUG_KB_BOX_HEIGHT = 14,
PSP_DEBUG_KB_NUM_COMMANDS = 5,
}
extern "C" {
/// Switch charTable when SHIFT is pressed
///
/// @param shiftState - Pointer to an int indicating Caps Lock
pub fn pspDebugKbShift(shiftState: *mut i32);
}
extern "C" {
/// Draw the specified key on the keyboard.
///
/// @param row - The row of the character to print (in charTable)
/// @param col - The column of the character to print (in charTable)
/// @param highlight - 0 for plain; otherwise highlighted
pub fn pspDebugKbDrawKey(row: i32, col: i32, highlight: i32);
}
extern "C" {
/// Draw the string at the top of the box
///
/// @param str - The string to print
pub fn pspDebugKbDrawString(str: *mut u8);
}
extern "C" {
/// Clear the area where the box resides.
/// Called from pspDebugKbDrawBox and pspDebugKbInit (on exit).
pub fn pspDebugKbClearBox();
}
extern "C" {
/// Draw the entire box on the desbug screen.
/// Called from shift() and doInputBox(char*)
pub fn pspDebugKbDrawBox();
}
extern "C" {
/// Make the text box happen
///
/// @param str - The string to edit
pub fn pspDebugKbInit(str: *mut u8);
}
#[repr(u32)]
/// Framebuffer pixel formats.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspDisplayPixelFormats {
PSP_DISPLAY_PIXEL_FORMAT_565 = 0,
PSP_DISPLAY_PIXEL_FORMAT_5551 = 1,
PSP_DISPLAY_PIXEL_FORMAT_4444 = 2,
PSP_DISPLAY_PIXEL_FORMAT_8888 = 3,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspDisplaySetBufSync {
PSP_DISPLAY_SETBUF_IMMEDIATE = 0,
PSP_DISPLAY_SETBUF_NEXTFRAME = 1,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspDisplayErrorCodes {
SCE_DISPLAY_ERROR_OK = 0,
SCE_DISPLAY_ERROR_POINTER = 2147483907,
SCE_DISPLAY_ERROR_ARGUMENT = 2147483911,
}
extern "C" {
/// Set display mode
///
/// @par Example1:
/// @code
/// @endcode
///
/// @param mode - Display mode, normally 0.
/// @param width - Width of screen in pixels.
/// @param height - Height of screen in pixels.
///
/// @return ???
pub fn sceDisplaySetMode(mode: i32, width: i32, height: i32)
-> i32;
}
extern "C" {
/// Get display mode
///
/// @param pmode - Pointer to an integer to receive the current mode.
/// @param pwidth - Pointer to an integer to receive the current width.
/// @param pheight - Pointer to an integer to receive the current height,
///
/// @return 0 on success
pub fn sceDisplayGetMode(pmode: *mut i32, pwidth: *mut i32,
pheight: *mut i32) -> i32;
}
extern "C" {
/// Display set framebuf
///
/// @param topaddr - address of start of framebuffer
/// @param bufferwidth - buffer width (must be power of 2)
/// @param pixelformat - One of ::PspDisplayPixelFormats.
/// @param sync - One of ::PspDisplaySetBufSync
///
/// @return 0 on success
pub fn sceDisplaySetFrameBuf(topaddr: *mut c_void, bufferwidth: i32,
pixelformat: i32, sync: i32)
-> i32;
}
extern "C" {
/// Get Display Framebuffer information
///
/// @param topaddr - pointer to void* to receive address of start of framebuffer
/// @param bufferwidth - pointer to int to receive buffer width (must be power of 2)
/// @param pixelformat - pointer to int to receive one of ::PspDisplayPixelFormats.
/// @param sync - One of ::PspDisplaySetBufSync
///
/// @return 0 on success
pub fn sceDisplayGetFrameBuf(topaddr: *mut *mut c_void,
bufferwidth: *mut i32,
pixelformat: *mut i32, sync: i32)
-> i32;
}
extern "C" {
/// Number of vertical blank pulses up to now
pub fn sceDisplayGetVcount() -> u32;
}
extern "C" {
/// Wait for vertical blank start
pub fn sceDisplayWaitVblankStart() -> i32;
}
extern "C" {
/// Wait for vertical blank start with callback
pub fn sceDisplayWaitVblankStartCB() -> i32;
}
extern "C" {
/// Wait for vertical blank
pub fn sceDisplayWaitVblank() -> i32;
}
extern "C" {
/// Wait for vertical blank with callback
pub fn sceDisplayWaitVblankCB() -> i32;
}
extern "C" {
/// Get accumlated HSYNC count
pub fn sceDisplayGetAccumulatedHcount() -> i32;
}
extern "C" {
/// Get current HSYNC count
pub fn sceDisplayGetCurrentHcount() -> i32;
}
extern "C" {
/// Get number of frames per second
pub fn sceDisplayGetFramePerSec() -> f32;
}
extern "C" {
/// Get whether or not frame buffer is being displayed
pub fn sceDisplayIsForeground() -> i32;
}
extern "C" {
/// Test whether VBLANK is active
pub fn sceDisplayIsVblank() -> i32;
}
extern "C" {
/// Display set framebuf
///
/// @param pri - Priority
/// @param topaddr - address of start of framebuffer
/// @param bufferwidth - buffer width (must be power of 2)
/// @param pixelformat - One of ::PspDisplayPixelFormats.
/// @param sync - One of ::PspDisplaySetBufSync
///
/// @return 0 on success
pub fn sceDisplay_driver_63E22A26(pri: i32, topaddr: *mut c_void,
bufferwidth: i32,
pixelformat: i32, sync: i32)
-> i32;
}
extern "C" {
/// Get Display Framebuffer information
///
/// @param pri - Priority
/// @param topaddr - pointer to void* to receive address of start of framebuffer
/// @param bufferwidth - pointer to int to receive buffer width (must be power of 2)
/// @param pixelformat - pointer to int to receive one of ::PspDisplayPixelFormats.
/// @param sync - One of ::PspDisplaySetBufSync
///
/// @return 0 on success
pub fn sceDisplay_driver_5B5AEFAD(pri: i32,
topaddr: *mut *mut c_void,
bufferwidth: *mut i32,
pixelformat: *mut i32,
sync: i32) -> i32;
}
extern "C" {
/// Set Display brightness to a particular level
///
/// @param level - Level of the brightness. it goes from 0 (black screen) to 100 (max brightness)
/// @param unk1 - Unknown can be 0 or 1 (pass 0)
pub fn sceDisplaySetBrightness(level: i32, unk1: i32);
}
extern "C" {
/// Get current display brightness
///
/// @param level - Pointer to int to receive the current brightness level (0-100)
/// @param unk1 - Pointer to int, receives unknown, it's 1 or 0
pub fn sceDisplayGetBrightness(level: *mut i32, unk1: *mut i32);
}
extern "C" {
/// Register a default exception handler.
///
/// @param func - Pointer to the exception handler function
/// @note The exception handler function must start with a NOP
///
/// @return 0 on success, < 0 on error
pub fn sceKernelRegisterDefaultExceptionHandler(func: *mut c_void)
-> i32;
}
extern "C" {
/// Register a exception handler
///
/// @param exno - The exception number
/// @param func - Pointer to the exception handler function
///
/// @return 0 on success, < 0 on error
pub fn sceKernelRegisterExceptionHandler(exno: i32,
func: *mut c_void) -> i32;
}
extern "C" {
/// Register a exception handler with a priority
///
/// @param exno - The exception number
/// @param priority - The priority of the exception
/// @param func - Pointer to the exception handler function
///
/// @return 0 on success, < 0 on error
pub fn sceKernelRegisterPriorityExceptionHandler(exno: i32,
priority: i32,
func: *mut c_void)
-> i32;
}
#[repr(u32)]
/// Enumeration for FPU rounding modes
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspFpuRoundMode {
PSP_FPU_RN = 0,
PSP_FPU_RZ = 1,
PSP_FPU_RP = 2,
PSP_FPU_RM = 3,
}
#[repr(u32)]
/// Enumeration for FPU exceptions
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspFpuExceptions {
PSP_FPU_EXCEPTION_INEXACT = 1,
PSP_FPU_EXCEPTION_UNDERFLOW = 2,
PSP_FPU_EXCEPTION_OVERFLOW = 4,
PSP_FPU_EXCEPTION_DIVBYZERO = 8,
PSP_FPU_EXCEPTION_INVALIDOP = 16,
PSP_FPU_EXCEPTION_UNIMPOP = 32,
PSP_FPU_EXCEPTION_ALL = 63,
}
extern "C" {
/// Get the current value of the control/status register
///
/// @return The value of the control/status register
pub fn pspFpuGetFCR31() -> u32;
}
extern "C" {
/// Set the current value of the control/status register
///
/// @param var - The value to set.
pub fn pspFpuSetFCR31(var: u32);
}
extern "C" {
/// Set the current round mode
///
/// @param mode - The rounding mode to set, one of ::PspFpuRoundMode
pub fn pspFpuSetRoundmode(mode: PspFpuRoundMode);
}
extern "C" {
/// Get the current round mode
///
/// @return The round mode, one of ::PspFpuRoundMode
pub fn pspFpuGetRoundmode() -> PspFpuRoundMode;
}
extern "C" {
/// Get the exception flags (set when an exception occurs but
/// the actual exception bit is not enabled)
///
/// @return Bitmask of the flags, zero or more of ::PspFpuExceptions
pub fn pspFpuGetFlags() -> u32;
}
extern "C" {
/// Clear the flags bits
///
/// @param clear - Bitmask of the bits to clear, one or more of ::PspFpuExceptions
pub fn pspFpuClearFlags(clear: u32);
}
extern "C" {
/// Get the exception enable flags
///
/// @return Bitmask of the flags, zero or more of ::PspFpuExceptions
pub fn pspFpuGetEnable() -> u32;
}
extern "C" {
/// Set the enable flags bits
///
/// @param enable - Bitmask of exceptions to enable, zero or more of ::PspFpuExceptions
pub fn pspFpuSetEnable(enable: u32);
}
extern "C" {
/// Get the cause bits (only useful if you installed your own exception handler)
///
/// @return Bitmask of flags, zero or more of ::PspFpuExceptions
pub fn pspFpuGetCause() -> u32;
}
extern "C" {
/// Clear the cause bits
///
/// @param clear - Bitmask of the bits to clear, one or more of ::PspFpuExceptions
///
pub fn pspFpuClearCause(clear: u32);
}
extern "C" {
/// Get the current value of the FS bit (if FS is 0 then an exception occurs with
/// denormalized values, if 1 then they are rewritten as 0.
///
/// @return The current state of the FS bit (0 or 1)
pub fn pspFpuGetFS() -> u32;
}
extern "C" {
/// Set the FS bit
///
/// @param fs - 0 or 1 to unset or set fs
pub fn pspFpuSetFS(fs: u32);
}
extern "C" {
/// Get the condition flags (8 bits)
///
/// @return The current condition flags
pub fn pspFpuGetCondbits() -> u32;
}
extern "C" {
/// Clear the condition bits
///
/// @param clear - Bitmask of the bits to clear
pub fn pspFpuClearCondbits(clear: u32);
}
extern "C" {
/// returns absolute value
pub fn pspFpuAbs(f: f32) -> f32;
}
extern "C" {
/// Round up
pub fn pspFpuCeil(f: f32) -> i32;
}
extern "C" {
/// Truncate
pub fn pspFpuFloor(f: f32) -> i32;
}
extern "C" {
/// select maximum value
pub fn pspFpuMax(f1: f32, f2: f32) -> f32;
}
extern "C" {
/// select minimum value
pub fn pspFpuMin(f1: f32, f2: f32) -> f32;
}
extern "C" {
/// Sign reversal
pub fn pspFpuNeg(f: f32) -> f32;
}
extern "C" {
/// Round to nearest
pub fn pspFpuRound(f: f32) -> i32;
}
extern "C" {
pub fn pspFpuRsqrt(f: f32) -> f32;
}
extern "C" {
/// Square root
pub fn pspFpuSqrt(f: f32) -> f32;
}
extern "C" {
/// Round towards zero
pub fn pspFpuTrunc(f: f32) -> i32;
}
extern "C" {
pub fn pspFpuFmod(fs: f32, fd: f32) -> f32;
}
extern "C" {
pub fn pspFpuFrac(f: f32) -> f32;
}
extern "C" {
pub fn pspFpuReinterpretFloat(ui: u32) -> f32;
}
extern "C" {
pub fn pspFpuReinterpretUint(f: f32) -> u32;
}
extern "C" {
pub fn pspFpuIsEqual(f1: f32, f2: f32) -> i32;
}
extern "C" {
pub fn pspFpuSignFloat(f: f32) -> f32;
}
extern "C" {
pub fn pspFpuSignInt(f: f32) -> i32;
}
extern "C" {
/// Positive zero
pub fn pspFpuPositiveZero() -> f32;
}
extern "C" {
/// Negative zero
pub fn pspFpuNegativeZero() -> f32;
}
extern "C" {
/// Test for zero value
pub fn pspFpuIsZero(f: f32) -> i32;
}
extern "C" {
/// Test for positive zero
pub fn pspFpuIsPositiveZero(f: f32) -> i32;
}
extern "C" {
/// Test for negative zero
pub fn pspFpuIsNegativeZero(f: f32) -> i32;
}
extern "C" {
/// Test for denormalized number
pub fn pspFpuIsDenormal(f: f32) -> i32;
}
extern "C" {
/// Test for zero or denormalized number
pub fn pspFpuIsZeroOrDenormal(f: f32) -> i32;
}
extern "C" {
/// Positive infinity
pub fn pspFpuPositiveInf() -> f32;
}
extern "C" {
/// Negative infinity
pub fn pspFpuNegativeInf() -> f32;
}
extern "C" {
/// Test for infinity
pub fn pspFpuIsInf(f: f32) -> i32;
}
extern "C" {
/// NaN (positive SNaN)
pub fn pspFpuPositiveNaN() -> f32;
}
extern "C" {
/// NaN (negative SNaN)
pub fn pspFpuNegativeNaN() -> f32;
}
extern "C" {
/// Quiet NaN (positive QNaN)
pub fn pspFpuPositiveQNaN() -> f32;
}
extern "C" {
/// Quiet NaN (positive QNaN)
pub fn pspFpuNegativeQNaN() -> f32;
}
extern "C" {
/// Signaling NaN (positive SNaN)
pub fn pspFpuPositiveSNaN(uiSignal: u32) -> f32;
}
extern "C" {
/// Signaling NaN (negative SNaN)
pub fn pspFpuNegativeSNaN(uiSignal: u32) -> f32;
}
extern "C" {
/// Test for NaN
pub fn pspFpuIsNaN(f: f32) -> i32;
}
extern "C" {
/// Test for infinity or NaN
pub fn pspFpuIsInfOrNaN(f: f32) -> i32;
}
extern "C" {
pub fn pspFpuNormalizePhase(f: f32) -> f32;
}
extern "C" {
/// Sine
pub fn pspFpuSin(x: f32) -> f32;
}
extern "C" {
/// Cosine
pub fn pspFpuCos(x: f32) -> f32;
}
extern "C" {
/// Arc tangent
pub fn pspFpuAtan(x: f32) -> f32;
}
extern "C" {
/// Natural Logarithm
pub fn pspFpuLog(x: f32) -> f32;
}
extern "C" {
/// Exponential
pub fn pspFpuExp(x: f32) -> f32;
}
extern "C" {
/// ArcSin
pub fn pspFpuAsin(x: f32) -> f32;
}
extern "C" {
/// ArcCos
pub fn pspFpuAcos(x: f32) -> f32;
}
extern "C" {
/// convert float to double
pub fn pspFpuFloatToDouble(a: f32) -> f64;
}
extern "C" {
/// convert double to float
pub fn pspFpuDoubleToFloat(a: f64) -> f32;
}
/// Stores the state of the GE.
#[repr(C)]
#[derive(Copy)]
pub struct PspGeContext {
pub context: [u32; 512usize],
}
#[test]
fn bindgen_test_layout_PspGeContext() {
assert_eq!(::core::mem::size_of::<PspGeContext>() , 2048usize , concat ! (
"Size of: " , stringify ! ( PspGeContext ) ));
assert_eq! (::core::mem::align_of::<PspGeContext>() , 4usize , concat ! (
"Alignment of " , stringify ! ( PspGeContext ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspGeContext ) ) . context as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( PspGeContext ) , "::" ,
stringify ! ( context ) ));
}
impl Clone for PspGeContext {
fn clone(&self) -> Self { *self }
}
/// Structure storing a stack (for CALL/RET)
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceGeStack {
/// The stack buffer
pub stack: [u32; 8usize],
}
#[test]
fn bindgen_test_layout_SceGeStack() {
assert_eq!(::core::mem::size_of::<SceGeStack>() , 32usize , concat ! (
"Size of: " , stringify ! ( SceGeStack ) ));
assert_eq! (::core::mem::align_of::<SceGeStack>() , 4usize , concat ! (
"Alignment of " , stringify ! ( SceGeStack ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceGeStack ) ) . stack as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceGeStack ) , "::" ,
stringify ! ( stack ) ));
}
impl Clone for SceGeStack {
fn clone(&self) -> Self { *self }
}
/// Typedef for a GE callback
pub type PspGeCallback =
::core::option::Option<unsafe extern "C" fn(id: i32,
arg: *mut c_void)>;
/// Structure to hold the callback data
#[repr(C)]
#[derive(Debug, Copy)]
pub struct PspGeCallbackData {
/// GE callback for the signal interrupt
pub signal_func: PspGeCallback,
/// GE callback argument for signal interrupt
pub signal_arg: *mut c_void,
/// GE callback for the finish interrupt
pub finish_func: PspGeCallback,
/// GE callback argument for finish interrupt
pub finish_arg: *mut c_void,
}
#[test]
fn bindgen_test_layout_PspGeCallbackData() {
assert_eq!(::core::mem::size_of::<PspGeCallbackData>() , 32usize , concat
! ( "Size of: " , stringify ! ( PspGeCallbackData ) ));
assert_eq! (::core::mem::align_of::<PspGeCallbackData>() , 8usize , concat
! ( "Alignment of " , stringify ! ( PspGeCallbackData ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspGeCallbackData ) ) . signal_func as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( PspGeCallbackData ) ,
"::" , stringify ! ( signal_func ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspGeCallbackData ) ) . signal_arg as *
const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( PspGeCallbackData ) ,
"::" , stringify ! ( signal_arg ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspGeCallbackData ) ) . finish_func as *
const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( PspGeCallbackData ) ,
"::" , stringify ! ( finish_func ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspGeCallbackData ) ) . finish_arg as *
const _ as usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! ( PspGeCallbackData ) ,
"::" , stringify ! ( finish_arg ) ));
}
impl Clone for PspGeCallbackData {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct PspGeListArgs {
/// Size of the structure (16)
pub size: u32,
/// Pointer to a context
pub context: *mut PspGeContext,
/// Number of stacks to use
pub numStacks: u32,
/// Pointer to the stacks (unused)
pub stacks: *mut SceGeStack,
}
#[test]
fn bindgen_test_layout_PspGeListArgs() {
assert_eq!(::core::mem::size_of::<PspGeListArgs>() , 32usize , concat ! (
"Size of: " , stringify ! ( PspGeListArgs ) ));
assert_eq! (::core::mem::align_of::<PspGeListArgs>() , 8usize , concat ! (
"Alignment of " , stringify ! ( PspGeListArgs ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspGeListArgs ) ) . size as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( PspGeListArgs ) , "::"
, stringify ! ( size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspGeListArgs ) ) . context as * const _
as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( PspGeListArgs ) , "::"
, stringify ! ( context ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspGeListArgs ) ) . numStacks as * const
_ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( PspGeListArgs ) , "::"
, stringify ! ( numStacks ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspGeListArgs ) ) . stacks as * const _
as usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! ( PspGeListArgs ) , "::"
, stringify ! ( stacks ) ));
}
impl Clone for PspGeListArgs {
fn clone(&self) -> Self { *self }
}
/// Drawing queue interruption parameter
#[repr(C)]
#[derive(Debug, Copy)]
pub struct PspGeBreakParam {
pub buf: [u32; 4usize],
}
#[test]
fn bindgen_test_layout_PspGeBreakParam() {
assert_eq!(::core::mem::size_of::<PspGeBreakParam>() , 16usize , concat !
( "Size of: " , stringify ! ( PspGeBreakParam ) ));
assert_eq! (::core::mem::align_of::<PspGeBreakParam>() , 4usize , concat !
( "Alignment of " , stringify ! ( PspGeBreakParam ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspGeBreakParam ) ) . buf as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( PspGeBreakParam ) ,
"::" , stringify ! ( buf ) ));
}
impl Clone for PspGeBreakParam {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// Get the size of VRAM.
///
/// @return The size of VRAM (in bytes).
pub fn sceGeEdramGetSize() -> u32;
}
extern "C" {
/// Get the eDRAM address.
///
/// @return A pointer to the base of the eDRAM.
pub fn sceGeEdramGetAddr() -> *mut c_void;
}
extern "C" {
/// Retrieve the current value of a GE command.
///
/// @param cmd - The GE command register to retrieve (0 to 0xFF, both included).
///
/// @return The value of the GE command, < 0 on error.
pub fn sceGeGetCmd(cmd: i32) -> u32;
}
#[repr(u32)]
/// GE matrix types.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspGeMatrixTypes {
PSP_GE_MATRIX_BONE0 = 0,
PSP_GE_MATRIX_BONE1 = 1,
PSP_GE_MATRIX_BONE2 = 2,
PSP_GE_MATRIX_BONE3 = 3,
PSP_GE_MATRIX_BONE4 = 4,
PSP_GE_MATRIX_BONE5 = 5,
PSP_GE_MATRIX_BONE6 = 6,
PSP_GE_MATRIX_BONE7 = 7,
PSP_GE_MATRIX_WORLD = 8,
PSP_GE_MATRIX_VIEW = 9,
PSP_GE_MATRIX_PROJECTION = 10,
PSP_GE_MATRIX_TEXGEN = 11,
}
extern "C" {
/// Retrieve a matrix of the given type.
///
/// @param type - One of ::PspGeMatrixTypes.
/// @param matrix - Pointer to a variable to store the matrix.
///
/// @return < 0 on error.
pub fn sceGeGetMtx(type_: i32, matrix: *mut c_void) -> i32;
}
/// Structure storing a stack (for CALL/RET).
#[repr(C)]
#[derive(Debug, Copy)]
pub struct PspGeStack {
/// The stack buffer.
pub stack: [u32; 8usize],
}
#[test]
fn bindgen_test_layout_PspGeStack() {
assert_eq!(::core::mem::size_of::<PspGeStack>() , 32usize , concat ! (
"Size of: " , stringify ! ( PspGeStack ) ));
assert_eq! (::core::mem::align_of::<PspGeStack>() , 4usize , concat ! (
"Alignment of " , stringify ! ( PspGeStack ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspGeStack ) ) . stack as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( PspGeStack ) , "::" ,
stringify ! ( stack ) ));
}
impl Clone for PspGeStack {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// Retrieve the stack of the display list currently being executed.
///
/// @param stackId - The ID of the stack to retrieve.
/// @param stack - Pointer to a structure to store the stack, or NULL to not store it.
///
/// @return The number of stacks of the current display list, < 0 on error.
pub fn sceGeGetStack(stackId: i32, stack: *mut PspGeStack) -> i32;
}
extern "C" {
/// Save the GE's current state.
///
/// @param context - Pointer to a ::PspGeContext.
///
/// @return < 0 on error.
pub fn sceGeSaveContext(context: *mut PspGeContext) -> i32;
}
extern "C" {
/// Restore a previously saved GE context.
///
/// @param context - Pointer to a ::PspGeContext.
///
/// @return < 0 on error.
pub fn sceGeRestoreContext(context: *const PspGeContext) -> i32;
}
extern "C" {
/// Enqueue a display list at the tail of the GE display list queue.
///
/// @param list - The head of the list to queue.
/// @param stall - The stall address.
/// If NULL then no stall address is set and the list is transferred immediately.
/// @param cbid - ID of the callback set by calling sceGeSetCallback
/// @param arg - Structure containing GE context buffer address
///
/// @return The ID of the queue, < 0 on error.
pub fn sceGeListEnQueue(list: *const c_void, stall: *mut c_void,
cbid: i32, arg: *mut PspGeListArgs)
-> i32;
}
extern "C" {
/// Enqueue a display list at the head of the GE display list queue.
///
/// @param list - The head of the list to queue.
/// @param stall - The stall address.
/// If NULL then no stall address is set and the list is transferred immediately.
/// @param cbid - ID of the callback set by calling sceGeSetCallback
/// @param arg - Structure containing GE context buffer address
///
/// @return The ID of the queue, < 0 on error.
pub fn sceGeListEnQueueHead(list: *const c_void, stall: *mut c_void,
cbid: i32, arg: *mut PspGeListArgs)
-> i32;
}
extern "C" {
/// Cancel a queued or running list.
///
/// @param qid - The ID of the queue.
///
/// @return < 0 on error.
pub fn sceGeListDeQueue(qid: i32) -> i32;
}
extern "C" {
/// Update the stall address for the specified queue.
///
/// @param qid - The ID of the queue.
/// @param stall - The new stall address.
///
/// @return < 0 on error
pub fn sceGeListUpdateStallAddr(qid: i32, stall: *mut c_void)
-> i32;
}
#[repr(u32)]
/// List status for ::sceGeListSync() and ::sceGeDrawSync().
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspGeListState {
PSP_GE_LIST_DONE = 0,
PSP_GE_LIST_QUEUED = 1,
PSP_GE_LIST_DRAWING_DONE = 2,
PSP_GE_LIST_STALL_REACHED = 3,
PSP_GE_LIST_CANCEL_DONE = 4,
}
extern "C" {
/// Wait for syncronisation of a list.
///
/// @param qid - The queue ID of the list to sync.
/// @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.
///
/// @return The specified queue status, one of ::PspGeListState.
pub fn sceGeListSync(qid: i32, syncType: i32) -> i32;
}
extern "C" {
/// Wait for drawing to complete.
///
/// @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.
///
/// @return The current queue status, one of ::PspGeListState.
pub fn sceGeDrawSync(syncType: i32) -> i32;
}
extern "C" {
/// Register callback handlers for the the GE.
///
/// @param cb - Configured callback data structure.
///
/// @return The callback ID, < 0 on error.
pub fn sceGeSetCallback(cb: *mut PspGeCallbackData) -> i32;
}
extern "C" {
/// Unregister the callback handlers.
///
/// @param cbid - The ID of the callbacks, returned by sceGeSetCallback().
///
/// @return < 0 on error
pub fn sceGeUnsetCallback(cbid: i32) -> i32;
}
extern "C" {
/// Interrupt drawing queue.
///
/// @param mode - If set to 1, reset all the queues.
/// @param pParam - Unused (just K1-checked).
///
/// @return The stopped queue ID if mode isn't set to 0, otherwise 0, and < 0 on error.
pub fn sceGeBreak(mode: i32, pParam: *mut PspGeBreakParam) -> i32;
}
extern "C" {
/// Restart drawing queue.
///
/// @return < 0 on error.
pub fn sceGeContinue() -> i32;
}
extern "C" {
/// Set the eDRAM address translation mode.
///
/// @param width - 0 to not set the translation width, otherwise 512, 1024, 2048 or 4096.
///
/// @return The previous width if it was set, otherwise 0, < 0 on error.
pub fn sceGeEdramSetAddrTranslation(width: i32) -> i32;
}
pub type GuSwapBuffersCallback =
::core::option::Option<unsafe extern "C" fn(display: *mut *mut c_void,
render: *mut *mut c_void)>;
extern "C" {
/// Set depth buffer parameters
///
/// @param zbp - VRAM pointer where the depthbuffer should start
/// @param zbw - The width of the depth-buffer (block-aligned)
///
pub fn sceGuDepthBuffer(zbp: *mut c_void, zbw: i32);
}
extern "C" {
/// Set display buffer parameters
///
/// @par Example: Setup a standard 16-bit display buffer
/// @code
/// sceGuDispBuffer(480,272,(void*)512*272*2,512); // 480*272, skipping the draw buffer located at address 0
/// @endcode
///
/// @param width - Width of the display buffer in pixels
/// @param height - Width of the display buffer in pixels
/// @param dispbp - VRAM pointer to where the display-buffer starts
/// @param dispbw - Display buffer width (block aligned)
///
pub fn sceGuDispBuffer(width: i32, height: i32,
dispbp: *mut c_void, dispbw: i32);
}
extern "C" {
/// Set draw buffer parameters (and store in context for buffer-swap)
///
/// Available pixel formats are:
/// - GU_PSM_5650
/// - GU_PSM_5551
/// - GU_PSM_4444
/// - GU_PSM_8888
///
/// @par Example: Setup a standard 16-bit draw buffer
/// @code
/// sceGuDrawBuffer(GU_PSM_5551,(void*)0,512);
/// @endcode
///
/// @param psm - Pixel format to use for rendering (and display)
/// @param fbp - VRAM pointer to where the draw buffer starts
/// @param fbw - Frame buffer width (block aligned)
pub fn sceGuDrawBuffer(psm: i32, fbp: *mut c_void, fbw: i32);
}
extern "C" {
/// Set draw buffer directly, not storing parameters in the context
///
/// @param psm - Pixel format to use for rendering
/// @param fbp - VRAM pointer to where the draw buffer starts
/// @param fbw - Frame buffer width (block aligned)
pub fn sceGuDrawBufferList(psm: i32, fbp: *mut c_void,
fbw: i32);
}
extern "C" {
/// Turn display on or off
///
/// Available states are:
/// - GU_TRUE (1) - Turns display on
/// - GU_FALSE (0) - Turns display off
///
/// @param state - Turn display on or off
/// @return State of the display prior to this call
pub fn sceGuDisplay(state: i32) -> i32;
}
extern "C" {
/// Select which depth-test function to use
///
/// Valid choices for the depth-test are:
/// - GU_NEVER - No pixels pass the depth-test
/// - GU_ALWAYS - All pixels pass the depth-test
/// - GU_EQUAL - Pixels that match the depth-test pass
/// - GU_NOTEQUAL - Pixels that doesn't match the depth-test pass
/// - GU_LESS - Pixels that are less in depth passes
/// - GU_LEQUAL - Pixels that are less or equal in depth passes
/// - GU_GREATER - Pixels that are greater in depth passes
/// - GU_GEQUAL - Pixels that are greater or equal passes
///
/// @param function - Depth test function to use
pub fn sceGuDepthFunc(function: i32);
}
extern "C" {
/// Mask depth buffer writes
///
/// @param mask - GU_TRUE(1) to disable Z writes, GU_FALSE(0) to enable
pub fn sceGuDepthMask(mask: i32);
}
extern "C" {
pub fn sceGuDepthOffset(offset: u32);
}
extern "C" {
/// Set which range to use for depth calculations.
///
/// @note The depth buffer is inversed, and takes values from 65535 to 0.
///
/// Example: Use the entire depth-range for calculations:
/// @code
/// sceGuDepthRange(65535,0);
/// @endcode
///
/// @param near - Value to use for the near plane
/// @param far - Value to use for the far plane
pub fn sceGuDepthRange(near: i32, far: i32);
}
extern "C" {
pub fn sceGuFog(near: f32, far: f32, color: u32);
}
extern "C" {
/// Initalize the GU system
///
/// This function MUST be called as the first function, otherwise state is undetermined.
pub fn sceGuInit();
}
extern "C" {
/// Shutdown the GU system
///
/// Called when GU is no longer needed
pub fn sceGuTerm();
}
extern "C" {
pub fn sceGuBreak(a0: i32);
}
extern "C" {
pub fn sceGuContinue();
}
extern "C" {
/// Setup signal handler
///
/// Available signals are:
/// - GU_CALLBACK_SIGNAL - Called when sceGuSignal is used
/// - GU_CALLBACK_FINISH - Called when display list is finished
///
/// @param signal - Signal index to install a handler for
/// @param callback - Callback to call when signal index is triggered
/// @return The old callback handler
pub fn sceGuSetCallback(signal: i32,
callback:
::core::option::Option<unsafe extern "C" fn(arg1:
i32)>)
-> *mut c_void;
}
extern "C" {
/// Trigger signal to call code from the command stream
///
/// Available behaviors are:
/// - GU_BEHAVIOR_SUSPEND - Stops display list execution until callback function finished
/// - GU_BEHAVIOR_CONTINUE - Do not stop display list execution during callback
///
/// @param signal - Signal to trigger
/// @param behavior - Behavior type
pub fn sceGuSignal(signal: i32, behavior: i32);
}
extern "C" {
/// Send raw float-command to the GE
///
/// The argument is converted into a 24-bit float before transfer.
///
/// @param cmd - Which command to send
/// @param argument - Argument to pass along
pub fn sceGuSendCommandf(cmd: i32, argument: f32);
}
extern "C" {
/// Send raw command to the GE
///
/// Only the 24 lower bits of the argument is passed along.
///
/// @param cmd - Which command to send
/// @param argument - Argument to pass along
pub fn sceGuSendCommandi(cmd: i32, argument: i32);
}
extern "C" {
/// Allocate memory on the current display list for temporary storage
///
/// @note This function is NOT for permanent memory allocation, the
/// memory will be invalid as soon as you start filling the same display
/// list again.
///
/// @param size - How much memory to allocate
/// @return Memory-block ready for use
pub fn sceGuGetMemory(size: i32) -> *mut c_void;
}
extern "C" {
/// Start filling a new display-context
///
/// Contexts available are:
/// - GU_DIRECT - Rendering is performed as list is filled
/// - GU_CALL - List is setup to be called from the main list
/// - GU_SEND - List is buffered for a later call to sceGuSendList()
///
/// The previous context-type is stored so that it can be restored at sceGuFinish().
///
/// @param cid - Context Type
/// @param list - Pointer to display-list (16 byte aligned)
pub fn sceGuStart(cid: i32, list: *mut c_void);
}
extern "C" {
/// Finish current display list and go back to the parent context
///
/// If the context is GU_DIRECT, the stall-address is updated so that the entire list will
/// execute. Otherwise, only the terminating action is written to the list, depending on
/// context-type.
///
/// The finish-callback will get a zero as argument when using this function.
///
/// This also restores control back to whatever context that was active prior to this call.
///
/// @return Size of finished display list
pub fn sceGuFinish() -> i32;
}
extern "C" {
/// Finish current display list and go back to the parent context, sending argument id for
/// the finish callback.
///
/// If the context is GU_DIRECT, the stall-address is updated so that the entire list will
/// execute. Otherwise, only the terminating action is written to the list, depending on
/// context-type.
///
/// @param id - Finish callback id (16-bit)
/// @return Size of finished display list
pub fn sceGuFinishId(id: u32) -> i32;
}
extern "C" {
/// Call previously generated display-list
///
/// @param list - Display list to call
pub fn sceGuCallList(list: *const c_void);
}
extern "C" {
/// Set wether to use stack-based calls or signals to handle execution of called lists.
///
/// @param mode - GU_TRUE(1) to enable signals, GU_FALSE(0) to disable signals and use
/// normal calls instead.
pub fn sceGuCallMode(mode: i32);
}
extern "C" {
/// Check how large the current display-list is
///
/// @return The size of the current display list
pub fn sceGuCheckList() -> i32;
}
extern "C" {
/// Send a list to the GE directly
///
/// Available modes are:
/// - GU_TAIL - Place list last in the queue, so it executes in-order
/// - GU_HEAD - Place list first in queue so that it executes as soon as possible
///
/// @param mode - Whether to place the list first or last in queue
/// @param list - List to send
/// @param context - Temporary storage for the GE context
pub fn sceGuSendList(mode: i32, list: *const c_void,
context: *mut PspGeContext);
}
extern "C" {
/// Swap display and draw buffer
///
/// @return Pointer to the new drawbuffer
pub fn sceGuSwapBuffers() -> *mut c_void;
}
extern "C" {
/// Wait until display list has finished executing
///
/// @par Example: Wait for the currently executing display list
/// @code
/// sceGuSync(0,0);
/// @endcode
///
/// Available what are:
/// - GU_SYNC_WHAT_DONE
/// - GU_SYNC_WHAT_QUEUED
/// - GU_SYNC_WHAT_DRAW
/// - GU_SYNC_WHAT_STALL
/// - GU_SYNC_WHAT_CANCEL
///
/// Available mode are:
/// - GU_SYNC_FINISH - Wait until the last sceGuFinish command is reached
/// - GU_SYNC_SIGNAL - Wait until the last (?) signal is executed
/// - GU_SYNC_DONE - Wait until all commands currently in list are executed
/// - GU_SYNC_LIST - Wait for the currently executed display list (GU_DIRECT)
/// - GU_SYNC_SEND - Wait for the last send list
///
/// @param mode - What to wait for
/// @param what - What to sync to
/// @return Unknown at this time
pub fn sceGuSync(mode: i32, what: i32) -> i32;
}
extern "C" {
/// Draw array of vertices forming primitives
///
/// Available primitive-types are:
/// - GU_POINTS - Single pixel points (1 vertex per primitive)
/// - GU_LINES - Single pixel lines (2 vertices per primitive)
/// - GU_LINE_STRIP - Single pixel line-strip (2 vertices for the first primitive, 1 for every following)
/// - GU_TRIANGLES - Filled triangles (3 vertices per primitive)
/// - GU_TRIANGLE_STRIP - Filled triangles-strip (3 vertices for the first primitive, 1 for every following)
/// - GU_TRIANGLE_FAN - Filled triangle-fan (3 vertices for the first primitive, 1 for every following)
/// - GU_SPRITES - Filled blocks (2 vertices per primitive)
///
/// The vertex-type decides how the vertices align and what kind of information they contain.
/// The following flags are ORed together to compose the final vertex format:
/// - GU_TEXTURE_8BIT - 8-bit texture coordinates
/// - GU_TEXTURE_16BIT - 16-bit texture coordinates
/// - GU_TEXTURE_32BITF - 32-bit texture coordinates (float)
///
/// - GU_COLOR_5650 - 16-bit color (R5G6B5A0)
/// - GU_COLOR_5551 - 16-bit color (R5G5B5A1)
/// - GU_COLOR_4444 - 16-bit color (R4G4B4A4)
/// - GU_COLOR_8888 - 32-bit color (R8G8B8A8)
///
/// - GU_NORMAL_8BIT - 8-bit normals
/// - GU_NORMAL_16BIT - 16-bit normals
/// - GU_NORMAL_32BITF - 32-bit normals (float)
///
/// - GU_VERTEX_8BIT - 8-bit vertex position
/// - GU_VERTEX_16BIT - 16-bit vertex position
/// - GU_VERTEX_32BITF - 32-bit vertex position (float)
///
/// - GU_WEIGHT_8BIT - 8-bit weights
/// - GU_WEIGHT_16BIT - 16-bit weights
/// - GU_WEIGHT_32BITF - 32-bit weights (float)
///
/// - GU_INDEX_8BIT - 8-bit vertex index
/// - GU_INDEX_16BIT - 16-bit vertex index
///
/// - GU_WEIGHTS(n) - Number of weights (1-8)
/// - GU_VERTICES(n) - Number of vertices (1-8)
///
/// - GU_TRANSFORM_2D - Coordinate is passed directly to the rasterizer
/// - GU_TRANSFORM_3D - Coordinate is transformed before passed to rasterizer
///
/// @note Every vertex must align to 32 bits, which means that you HAVE to pad if it does not add up!
///
/// Vertex order:
/// [for vertices(1-8)]
/// [weights (0-8)]
/// [texture uv]
/// [color]
/// [normal]
/// [vertex]
/// [/for]
///
/// @par Example: Render 400 triangles, with floating-point texture coordinates, and floating-point position, no indices
/// @code
/// sceGuDrawArray(GU_TRIANGLES,GU_TEXTURE_32BITF|GU_VERTEX_32BITF,400*3,0,vertices);
/// @endcode
///
/// @param prim - What kind of primitives to render
/// @param vtype - Vertex type to process
/// @param count - How many vertices to process
/// @param indices - Optional pointer to an index-list
/// @param vertices - Pointer to a vertex-list
pub fn sceGuDrawArray(prim: i32, vtype: i32, count: i32,
indices: *const c_void,
vertices: *const c_void);
}
extern "C" {
/// Begin conditional rendering of object
///
/// If no vertices passed into this function are inside the scissor region, it will skip rendering
/// the object. There can be up to 32 levels of conditional testing, and all levels HAVE to
/// be terminated by sceGuEndObject().
///
/// @par Example: test a boundingbox against the frustum, and if visible, render object
/// @code
/// sceGuBeginObject(GU_VERTEX_32BITF,8,0,boundingBox);
/// sceGuDrawArray(GU_TRIANGLES,GU_TEXTURE_32BITF|GU_VERTEX_32BITF,vertexCount,0,vertices);
/// sceGuEndObject();
/// @endcode
///
/// @param vtype - Vertex type to process
/// @param count - Number of vertices to test
/// @param indices - Optional list to an index-list
/// @param vertices - Pointer to a vertex-list
pub fn sceGuBeginObject(vtype: i32, count: i32,
indices: *const c_void,
vertices: *const c_void);
}
extern "C" {
/// End conditional rendering of object
pub fn sceGuEndObject();
}
extern "C" {
/// Enable or disable GE state
///
/// Look at sceGuEnable() for a list of states
///
/// @param state - Which state to change
/// @param status - Wether to enable or disable the state
pub fn sceGuSetStatus(state: i32, status: i32);
}
extern "C" {
/// Get if state is currently enabled or disabled
///
/// Look at sceGuEnable() for a list of states
///
/// @param state - Which state to query about
/// @return Wether state is enabled or not
pub fn sceGuGetStatus(state: i32) -> i32;
}
extern "C" {
/// Set the status on all 22 available states
///
/// Look at sceGuEnable() for a list of states
///
/// @param status - Bit-mask (0-21) containing the status of all 22 states
pub fn sceGuSetAllStatus(status: i32);
}
extern "C" {
/// Query status on all 22 available states
///
/// Look at sceGuEnable() for a list of states
///
/// @return Status of all 22 states as a bitmask (0-21)
pub fn sceGuGetAllStatus() -> i32;
}
extern "C" {
/// Enable GE state
///
/// The currently available states are:
/// - GU_ALPHA_TEST
/// - GU_DEPTH_TEST
/// - GU_SCISSOR_TEST
/// - GU_BLEND
/// - GU_CULL_FACE
/// - GU_DITHER
/// - GU_CLIP_PLANES
/// - GU_TEXTURE_2D
/// - GU_LIGHTING
/// - GU_LIGHT0
/// - GU_LIGHT1
/// - GU_LIGHT2
/// - GU_LIGHT3
/// - GU_COLOR_LOGIC_OP
///
/// @param state - Which state to enable
pub fn sceGuEnable(state: i32);
}
extern "C" {
/// Disable GE state
///
/// Look at sceGuEnable() for a list of states
///
/// @param state - Which state to disable
pub fn sceGuDisable(state: i32);
}
extern "C" {
/// Set light parameters
///
/// Available light types are:
/// - GU_DIRECTIONAL - Directional light
/// - GU_POINTLIGHT - Single point of light
/// - GU_SPOTLIGHT - Point-light with a cone
///
/// Available light components are:
/// - GU_AMBIENT_AND_DIFFUSE
/// - GU_DIFFUSE_AND_SPECULAR
/// - GU_UNKNOWN_LIGHT_COMPONENT
///
/// @param light - Light index
/// @param type - Light type
/// @param components - Light components
/// @param position - Light position
pub fn sceGuLight(light: i32, type_: i32, components: i32,
position: *const ScePspFVector3);
}
extern "C" {
/// Set light attenuation
///
/// @param light - Light index
/// @param atten0 - Constant attenuation factor
/// @param atten1 - Linear attenuation factor
/// @param atten2 - Quadratic attenuation factor
pub fn sceGuLightAtt(light: i32, atten0: f32, atten1: f32,
atten2: f32);
}
extern "C" {
/// Set light color
///
/// Available light components are:
/// - GU_AMBIENT
/// - GU_DIFFUSE
/// - GU_SPECULAR
/// - GU_AMBIENT_AND_DIFFUSE
/// - GU_DIFFUSE_AND_SPECULAR
///
/// @param light - Light index
/// @param component - Which component to set
/// @param color - Which color to use
pub fn sceGuLightColor(light: i32, component: i32,
color: u32);
}
extern "C" {
/// Set light mode
///
/// Available light modes are:
/// - GU_SINGLE_COLOR
/// - GU_SEPARATE_SPECULAR_COLOR
///
/// Separate specular colors are used to interpolate the specular component
/// independently, so that it can be added to the fragment after the texture color.
///
/// @param mode - Light mode to use
pub fn sceGuLightMode(mode: i32);
}
extern "C" {
/// Set spotlight parameters
///
/// @param light - Light index
/// @param direction - Spotlight direction
/// @param exponent - Spotlight exponent
/// @param cutoff - Spotlight cutoff angle (in radians)
pub fn sceGuLightSpot(light: i32, direction: *const ScePspFVector3,
exponent: f32, cutoff: f32);
}
extern "C" {
/// Clear current drawbuffer
///
/// Available clear-flags are (OR them together to get final clear-mode):
/// - GU_COLOR_BUFFER_BIT - Clears the color-buffer
/// - GU_STENCIL_BUFFER_BIT - Clears the stencil-buffer
/// - GU_DEPTH_BUFFER_BIT - Clears the depth-buffer
///
/// @param flags - Which part of the buffer to clear
pub fn sceGuClear(flags: i32);
}
extern "C" {
/// Set the current clear-color
///
/// @param color - Color to clear with
pub fn sceGuClearColor(color: u32);
}
extern "C" {
/// Set the current clear-depth
///
/// @param depth - Set which depth to clear with (0x0000-0xffff)
pub fn sceGuClearDepth(depth: u32);
}
extern "C" {
/// Set the current stencil clear value
///
/// @param stencil - Set which stencil value to clear with (0-255)
///
pub fn sceGuClearStencil(stencil: u32);
}
extern "C" {
/// Set mask for which bits of the pixels to write
///
/// @param mask - Which bits to filter against writes
///
pub fn sceGuPixelMask(mask: u32);
}
extern "C" {
/// Set current primitive color
///
/// @param color - Which color to use (overriden by vertex-colors)
pub fn sceGuColor(color: u32);
}
extern "C" {
/// Set the color test function
///
/// The color test is only performed while GU_COLOR_TEST is enabled.
///
/// Available functions are:
/// - GU_NEVER
/// - GU_ALWAYS
/// - GU_EQUAL
/// - GU_NOTEQUAL
///
/// @par Example: Reject any pixel that does not have 0 as the blue channel
/// @code
/// sceGuColorFunc(GU_EQUAL,0,0xff0000);
/// @endcode
///
/// @param func - Color test function
/// @param color - Color to test against
/// @param mask - Mask ANDed against both source and destination when testing
pub fn sceGuColorFunc(func: i32, color: u32, mask: u32);
}
extern "C" {
/// Set which color components that the material will receive
///
/// The components are ORed together from the following values:
/// - GU_AMBIENT
/// - GU_DIFFUSE
/// - GU_SPECULAR
///
/// @param components - Which components to receive
pub fn sceGuColorMaterial(components: i32);
}
extern "C" {
/// Set the alpha test parameters
///
/// Available comparison functions are:
/// - GU_NEVER
/// - GU_ALWAYS
/// - GU_EQUAL
/// - GU_NOTEQUAL
/// - GU_LESS
/// - GU_LEQUAL
/// - GU_GREATER
/// - GU_GEQUAL
///
/// @param func - Specifies the alpha comparison function.
/// @param value - Specifies the reference value that incoming alpha values are compared to.
/// @param mask - Specifies the mask that both values are ANDed with before comparison.
pub fn sceGuAlphaFunc(func: i32, value: i32, mask: i32);
}
extern "C" {
pub fn sceGuAmbient(color: u32);
}
extern "C" {
pub fn sceGuAmbientColor(color: u32);
}
extern "C" {
/// Set the blending-mode
///
/// Keys for the blending operations:
/// - Cs - Source color
/// - Cd - Destination color
/// - Bs - Blend function for source fragment
/// - Bd - Blend function for destination fragment
///
/// Available blending-operations are:
/// - GU_ADD - (Cs*Bs) + (Cd*Bd)
/// - GU_SUBTRACT - (Cs*Bs) - (Cd*Bd)
/// - GU_REVERSE_SUBTRACT - (Cd*Bd) - (Cs*Bs)
/// - GU_MIN - Cs < Cd ? Cs : Cd
/// - GU_MAX - Cs < Cd ? Cd : Cs
/// - GU_ABS - |Cs-Cd|
///
/// Available blending-functions are:
/// - GU_SRC_COLOR
/// - GU_ONE_MINUS_SRC_COLOR
/// - GU_SRC_ALPHA
/// - GU_ONE_MINUS_SRC_ALPHA
/// - GU_DST_ALPHA
/// - GU_ONE_MINUS_DST_ALPHA
/// - GU_DST_COLOR
/// - GU_ONE_MINUS_DST_COLOR
/// - GU_FIX
///
/// @param op - Blending Operation
/// @param src - Blending function for source operand
/// @param dest - Blending function for dest operand
/// @param srcfix - Fix value for GU_FIX (source operand)
/// @param destfix - Fix value for GU_FIX (dest operand)
pub fn sceGuBlendFunc(op: i32, src: i32, dest: i32,
srcfix: u32, destfix: u32);
}
extern "C" {
pub fn sceGuMaterial(mode: i32, color: i32);
}
extern "C" {
pub fn sceGuModelColor(emissive: u32, ambient: u32,
diffuse: u32, specular: u32);
}
extern "C" {
/// Set stencil function and reference value for stencil testing
///
/// Available functions are:
/// - GU_NEVER
/// - GU_ALWAYS
/// - GU_EQUAL
/// - GU_NOTEQUAL
/// - GU_LESS
/// - GU_LEQUAL
/// - GU_GREATER
/// - GU_GEQUAL
///
/// @param func - Test function
/// @param ref - The reference value for the stencil test
/// @param mask - Mask that is ANDed with both the reference value and stored stencil value when the test is done
pub fn sceGuStencilFunc(func: i32, ref_: i32, mask: i32);
}
extern "C" {
/// Set the stencil test actions
///
/// Available actions are:
/// - GU_KEEP - Keeps the current value
/// - GU_ZERO - Sets the stencil buffer value to zero
/// - GU_REPLACE - Sets the stencil buffer value to ref, as specified by sceGuStencilFunc()
/// - GU_INCR - Increments the current stencil buffer value
/// - GU_DECR - Decrease the current stencil buffer value
/// - GU_INVERT - Bitwise invert the current stencil buffer value
///
/// As stencil buffer shares memory with framebuffer alpha, resolution of the buffer
/// is directly in relation.
///
/// @param fail - The action to take when the stencil test fails
/// @param zfail - The action to take when stencil test passes, but the depth test fails
/// @param zpass - The action to take when both stencil test and depth test passes
pub fn sceGuStencilOp(fail: i32, zfail: i32, zpass: i32);
}
extern "C" {
/// Set the specular power for the material
///
/// @param power - Specular power
///
pub fn sceGuSpecular(power: f32);
}
extern "C" {
/// Set the current face-order (for culling)
///
/// This only has effect when culling is enabled (GU_CULL_FACE)
///
/// Culling order can be:
/// - GU_CW - Clockwise primitives are not culled
/// - GU_CCW - Counter-clockwise are not culled
///
/// @param order - Which order to use
pub fn sceGuFrontFace(order: i32);
}
extern "C" {
/// Set color logical operation
///
/// Available operations are:
/// - GU_CLEAR
/// - GU_AND
/// - GU_AND_REVERSE
/// - GU_COPY
/// - GU_AND_INVERTED
/// - GU_NOOP
/// - GU_XOR
/// - GU_OR
/// - GU_NOR
/// - GU_EQUIV
/// - GU_INVERTED
/// - GU_OR_REVERSE
/// - GU_COPY_INVERTED
/// - GU_OR_INVERTED
/// - GU_NAND
/// - GU_SET
///
/// This operation only has effect if GU_COLOR_LOGIC_OP is enabled.
///
/// @param op - Operation to execute
pub fn sceGuLogicalOp(op: i32);
}
extern "C" {
/// Set ordered pixel dither matrix
///
/// This dither matrix is only applied if GU_DITHER is enabled.
///
/// @param matrix - Dither matrix
pub fn sceGuSetDither(matrix: *const ScePspIMatrix4);
}
extern "C" {
/// Set how primitives are shaded
///
/// The available shading-methods are:
/// - GU_FLAT - Primitives are flatshaded, the last vertex-color takes effet
/// - GU_SMOOTH - Primtives are gouraud-shaded, all vertex-colors take effect
///
/// @param mode - Which mode to use
pub fn sceGuShadeModel(mode: i32);
}
extern "C" {
/// Image transfer using the GE
///
/// @note Data must be aligned to 1 quad word (16 bytes)
///
/// @par Example: Copy a fullscreen 32-bit image from RAM to VRAM
/// @code
/// sceGuCopyImage(GU_PSM_8888,0,0,480,272,512,pixels,0,0,512,(void*)(((unsigned int)framebuffer)+0x4000000));
/// @endcode
///
/// @param psm - Pixel format for buffer
/// @param sx - Source X
/// @param sy - Source Y
/// @param width - Image width
/// @param height - Image height
/// @param srcw - Source buffer width (block aligned)
/// @param src - Source pointer
/// @param dx - Destination X
/// @param dy - Destination Y
/// @param destw - Destination buffer width (block aligned)
/// @param dest - Destination pointer
pub fn sceGuCopyImage(psm: i32, sx: i32, sy: i32,
width: i32, height: i32, srcw: i32,
src: *mut c_void, dx: i32, dy: i32,
destw: i32, dest: *mut c_void);
}
extern "C" {
/// Specify the texture environment color
///
/// This is used in the texture function when a constant color is needed.
///
/// See sceGuTexFunc() for more information.
///
/// @param color - Constant color (0x00BBGGRR)
pub fn sceGuTexEnvColor(color: u32);
}
extern "C" {
/// Set how the texture is filtered
///
/// Available filters are:
/// - GU_NEAREST
/// - GU_LINEAR
/// - GU_NEAREST_MIPMAP_NEAREST
/// - GU_LINEAR_MIPMAP_NEAREST
/// - GU_NEAREST_MIPMAP_LINEAR
/// - GU_LINEAR_MIPMAP_LINEAR
///
/// @param min - Minimizing filter
/// @param mag - Magnifying filter
pub fn sceGuTexFilter(min: i32, mag: i32);
}
extern "C" {
/// Flush texture page-cache
///
/// Do this if you have copied/rendered into an area currently in the texture-cache
///
pub fn sceGuTexFlush();
}
extern "C" {
/// Set how textures are applied
///
/// Key for the apply-modes:
/// - Cv - Color value result
/// - Ct - Texture color
/// - Cf - Fragment color
/// - Cc - Constant color (specified by sceGuTexEnvColor())
///
/// Available apply-modes are: (TFX)
/// - GU_TFX_MODULATE - Cv=Ct*Cf TCC_RGB: Av=Af TCC_RGBA: Av=At*Af
/// - GU_TFX_DECAL - TCC_RGB: Cv=Ct,Av=Af TCC_RGBA: Cv=Cf*(1-At)+Ct*At Av=Af
/// - GU_TFX_BLEND - Cv=(Cf*(1-Ct))+(Cc*Ct) TCC_RGB: Av=Af TCC_RGBA: Av=At*Af
/// - GU_TFX_REPLACE - Cv=Ct TCC_RGB: Av=Af TCC_RGBA: Av=At
/// - GU_TFX_ADD - Cv=Cf+Ct TCC_RGB: Av=Af TCC_RGBA: Av=At*Af
///
/// The fields TCC_RGB and TCC_RGBA specify components that differ between
/// the two different component modes.
///
/// - GU_TFX_MODULATE - The texture is multiplied with the current diffuse fragment
/// - GU_TFX_REPLACE - The texture replaces the fragment
/// - GU_TFX_ADD - The texture is added on-top of the diffuse fragment
///
/// Available component-modes are: (TCC)
/// - GU_TCC_RGB - The texture alpha does not have any effect
/// - GU_TCC_RGBA - The texture alpha is taken into account
///
/// @param tfx - Which apply-mode to use
/// @param tcc - Which component-mode to use
pub fn sceGuTexFunc(tfx: i32, tcc: i32);
}
extern "C" {
/// Set current texturemap
///
/// Textures may reside in main RAM, but it has a huge speed-penalty. Swizzle textures
/// to get maximum speed.
///
/// @note Data must be aligned to 1 quad word (16 bytes)
///
/// @param mipmap - Mipmap level
/// @param width - Width of texture (must be a power of 2)
/// @param height - Height of texture (must be a power of 2)
/// @param tbw - Texture Buffer Width (block-aligned)
/// @param tbp - Texture buffer pointer (16 byte aligned)
pub fn sceGuTexImage(mipmap: i32, width: i32, height: i32,
tbw: i32, tbp: *const c_void);
}
extern "C" {
/// Set texture-level mode (mipmapping)
///
/// Available modes are:
/// - GU_TEXTURE_AUTO
/// - GU_TEXTURE_CONST
/// - GU_TEXTURE_SLOPE
///
/// @param mode - Which mode to use
/// @param bias - Which mipmap bias to use
pub fn sceGuTexLevelMode(mode: u32, bias: f32);
}
extern "C" {
/// Set the texture-mapping mode
///
/// Available modes are:
/// - GU_TEXTURE_COORDS
/// - GU_TEXTURE_MATRIX
/// - GU_ENVIRONMENT_MAP
///
/// @param mode - Which mode to use
/// @param a1 - Unknown
/// @param a2 - Unknown
pub fn sceGuTexMapMode(mode: i32, a1: u32, a2: u32);
}
extern "C" {
/// Set texture-mode parameters
///
/// Available texture-formats are:
/// - GU_PSM_5650 - Hicolor, 16-bit
/// - GU_PSM_5551 - Hicolor, 16-bit
/// - GU_PSM_4444 - Hicolor, 16-bit
/// - GU_PSM_8888 - Truecolor, 32-bit
/// - GU_PSM_T4 - Indexed, 4-bit (2 pixels per byte)
/// - GU_PSM_T8 - Indexed, 8-bit
///
/// @param tpsm - Which texture format to use
/// @param maxmips - Number of mipmaps to use (0-8)
/// @param a2 - Unknown, set to 0
/// @param swizzle - GU_TRUE(1) to swizzle texture-reads
pub fn sceGuTexMode(tpsm: i32, maxmips: i32, a2: i32,
swizzle: i32);
}
extern "C" {
/// Set texture offset
///
/// @note Only used by the 3D T&L pipe, renders done with GU_TRANSFORM_2D are
/// not affected by this.
///
/// @param u - Offset to add to the U coordinate
/// @param v - Offset to add to the V coordinate
pub fn sceGuTexOffset(u: f32, v: f32);
}
extern "C" {
/// Set texture projection-map mode
///
/// Available modes are:
/// - GU_POSITION
/// - GU_UV
/// - GU_NORMALIZED_NORMAL
/// - GU_NORMAL
///
/// @param mode - Which mode to use
pub fn sceGuTexProjMapMode(mode: i32);
}
extern "C" {
/// Set texture scale
///
/// @note Only used by the 3D T&L pipe, renders ton with GU_TRANSFORM_2D are
/// not affected by this.
///
/// @param u - Scalar to multiply U coordinate with
/// @param v - Scalar to multiply V coordinate with
pub fn sceGuTexScale(u: f32, v: f32);
}
extern "C" {
pub fn sceGuTexSlope(slope: f32);
}
extern "C" {
/// Synchronize rendering pipeline with image upload.
///
/// This will stall the rendering pipeline until the current image upload initiated by
/// sceGuCopyImage() has completed.
pub fn sceGuTexSync();
}
extern "C" {
/// Set if the texture should repeat or clamp
///
/// Available modes are:
/// - GU_REPEAT - The texture repeats after crossing the border
/// - GU_CLAMP - Texture clamps at the border
///
/// @param u - Wrap-mode for the U direction
/// @param v - Wrap-mode for the V direction
pub fn sceGuTexWrap(u: i32, v: i32);
}
extern "C" {
/// Upload CLUT (Color Lookup Table)
///
/// @note Data must be aligned to 1 quad word (16 bytes)
///
/// @param num_blocks - How many blocks of 8 entries to upload (32*8 is 256 colors)
/// @param cbp - Pointer to palette (16 byte aligned)
pub fn sceGuClutLoad(num_blocks: i32, cbp: *const c_void);
}
extern "C" {
/// Set current CLUT mode
///
/// Available pixel formats for palettes are:
/// - GU_PSM_5650
/// - GU_PSM_5551
/// - GU_PSM_4444
/// - GU_PSM_8888
///
/// @param cpsm - Which pixel format to use for the palette
/// @param shift - Shifts color index by that many bits to the right
/// @param mask - Masks the color index with this bitmask after the shift (0-0xFF)
/// @param a3 - Unknown, set to 0
pub fn sceGuClutMode(cpsm: u32, shift: u32, mask: u32,
a3: u32);
}
extern "C" {
/// Set virtual coordinate offset
///
/// The PSP has a virtual coordinate-space of 4096x4096, this controls where rendering is performed
///
/// @par Example: Center the virtual coordinate range
/// @code
/// sceGuOffset(2048-(480/2),2048-(480/2));
/// @endcode
///
/// @param x - Offset (0-4095)
/// @param y - Offset (0-4095)
pub fn sceGuOffset(x: u32, y: u32);
}
extern "C" {
/// Set what to scissor within the current viewport
///
/// Note that scissoring is only performed if the custom scissoring is enabled (GU_SCISSOR_TEST)
///
/// @param x - Left of scissor region
/// @param y - Top of scissor region
/// @param w - Width of scissor region
/// @param h - Height of scissor region
pub fn sceGuScissor(x: i32, y: i32, w: i32, h: i32);
}
extern "C" {
/// Set current viewport
///
/// @par Example: Setup a viewport of size (480,272) with origo at (2048,2048)
/// @code
/// sceGuViewport(2048,2048,480,272);
/// @endcode
///
/// @param cx - Center for horizontal viewport
/// @param cy - Center for vertical viewport
/// @param width - Width of viewport
/// @param height - Height of viewport
pub fn sceGuViewport(cx: i32, cy: i32, width: i32,
height: i32);
}
extern "C" {
/// Draw bezier surface
///
/// @param vtype - Vertex type, look at sceGuDrawArray() for vertex definition
/// @param ucount - Number of vertices used in the U direction
/// @param vcount - Number of vertices used in the V direction
/// @param indices - Pointer to index buffer
/// @param vertices - Pointer to vertex buffer
pub fn sceGuDrawBezier(vtype: i32, ucount: i32, vcount: i32,
indices: *const c_void,
vertices: *const c_void);
}
extern "C" {
/// Set dividing for patches (beziers and splines)
///
/// @param ulevel - Number of division on u direction
/// @param vlevel - Number of division on v direction
pub fn sceGuPatchDivide(ulevel: u32, vlevel: u32);
}
extern "C" {
pub fn sceGuPatchFrontFace(a0: u32);
}
extern "C" {
/// Set primitive for patches (beziers and splines)
///
/// @param prim - Desired primitive type (GU_POINTS | GU_LINE_STRIP | GU_TRIANGLE_STRIP)
pub fn sceGuPatchPrim(prim: i32);
}
extern "C" {
pub fn sceGuDrawSpline(vtype: i32, ucount: i32, vcount: i32,
uedge: i32, vedge: i32,
indices: *const c_void,
vertices: *const c_void);
}
extern "C" {
/// Set transform matrices
///
/// Available matrices are:
/// - GU_PROJECTION - View->Projection matrix
/// - GU_VIEW - World->View matrix
/// - GU_MODEL - Model->World matrix
/// - GU_TEXTURE - Texture matrix
///
/// @param type - Which matrix-type to set
/// @param matrix - Matrix to load
pub fn sceGuSetMatrix(type_: i32, matrix: *const ScePspFMatrix4);
}
extern "C" {
/// Specify skinning matrix entry
///
/// To enable vertex skinning, pass GU_WEIGHTS(n), where n is between
/// 1-8, and pass available GU_WEIGHT_??? declaration. This will change
/// the amount of weights passed in the vertex araay, and by setting the skinning,
/// matrices, you will multiply each vertex every weight and vertex passed.
///
/// Please see sceGuDrawArray() for vertex format information.
///
/// @param index - Skinning matrix index (0-7)
/// @param matrix - Matrix to set
pub fn sceGuBoneMatrix(index: u32, matrix: *const ScePspFMatrix4);
}
extern "C" {
/// Specify morph weight entry
///
/// To enable vertex morphing, pass GU_VERTICES(n), where n is between
/// 1-8. This will change the amount of vertices passed in the vertex array,
/// and by setting the morph weights for every vertex entry in the array,
/// you can blend between them.
///
/// Please see sceGuDrawArray() for vertex format information.
///
/// @param index - Morph weight index (0-7)
/// @param weight - Weight to set
pub fn sceGuMorphWeight(index: i32, weight: f32);
}
extern "C" {
pub fn sceGuDrawArrayN(primitive_type: i32, vertex_type: i32,
count: i32, a3: i32,
indices: *const c_void,
vertices: *const c_void);
}
extern "C" {
/// Set how the display should be set
///
/// Available behaviours are:
/// - PSP_DISPLAY_SETBUF_IMMEDIATE - Display is swapped immediately
/// - PSP_DISPLAY_SETBUF_NEXTFRAME - Display is swapped on the next frame
///
/// Do remember that this swaps the pointers internally, regardless of setting, so be careful to wait until the next
/// vertical blank or use another buffering algorithm (see guSwapBuffersCallback()).
pub fn guSwapBuffersBehaviour(behaviour: i32);
}
extern "C" {
/// Set a buffer swap callback to allow for more advanced buffer methods without hacking the library.
///
/// The GuSwapBuffersCallback is defined like this:
/// @code
/// void swapBuffersCallback(void** display, void** render);
/// @endcode
/// and on entry they contain the variables that are to be set. To change the pointers that will be used, just
/// write the new pointers. Example of a triple-buffering algorithm:
/// @code
/// void* doneBuffer;
/// void swapBuffersCallback(void** display, void** render)
/// {
/// void* active = doneBuffer;
/// doneBuffer = *display;
/// display = active;
/// }
/// @endcode
///
/// @param callback - Callback to access when buffers are swapped. Pass 0 to disable.
pub fn guSwapBuffersCallback(callback: GuSwapBuffersCallback);
}
extern "C" {
pub fn sceGumDrawArray(prim: i32, vtype: i32, count: i32,
indices: *const c_void,
vertices: *const c_void);
}
extern "C" {
pub fn sceGumDrawArrayN(prim: i32, vtype: i32, count: i32,
a3: i32, indices: *const c_void,
vertices: *const c_void);
}
extern "C" {
pub fn sceGumDrawBezier(vtype: i32, ucount: i32, vcount: i32,
indices: *const c_void,
vertices: *const c_void);
}
extern "C" {
pub fn sceGumDrawSpline(vtype: i32, ucount: i32, vcount: i32,
uedge: i32, vedge: i32,
indices: *const c_void,
vertices: *const c_void);
}
extern "C" {
/// Load identity matrix
///
/// [1 0 0 0]
/// [0 1 0 0]
/// [0 0 1 0]
/// [0 0 0 1]
pub fn sceGumLoadIdentity();
}
extern "C" {
/// Load matrix
///
/// @param m - Matrix to load into stack
pub fn sceGumLoadMatrix(m: *const ScePspFMatrix4);
}
extern "C" {
pub fn sceGumLookAt(eye: *mut ScePspFVector3, center: *mut ScePspFVector3,
up: *mut ScePspFVector3);
}
extern "C" {
/// Select which matrix stack to operate on
///
/// Available matrix modes are:
/// - GU_PROJECTION
/// - GU_VIEW
/// - GU_MODEL
/// - GU_TEXTURE
///
/// @param mode - Matrix mode to use
pub fn sceGumMatrixMode(mode: i32);
}
extern "C" {
/// Multiply current matrix with input
///
/// @param m - Matrix to multiply stack with
pub fn sceGumMultMatrix(m: *const ScePspFMatrix4);
}
extern "C" {
/// Apply ortho projection matrix
///
/// @note The matrix loses its orthonogal status after executing this function.
pub fn sceGumOrtho(left: f32, right: f32, bottom: f32, top: f32,
near: f32, far: f32);
}
extern "C" {
/// Apply perspective projection matrix
///
/// @note The matrix loses its orthonogal status after executing this function.
pub fn sceGumPerspective(fovy: f32, aspect: f32, near: f32, far: f32);
}
extern "C" {
/// Pop matrix from stack
pub fn sceGumPopMatrix();
}
extern "C" {
/// Push current matrix onto stack
pub fn sceGumPushMatrix();
}
extern "C" {
/// Rotate around the X axis
///
/// @param angle - Angle in radians
pub fn sceGumRotateX(angle: f32);
}
extern "C" {
/// Rotate around the Y axis
///
/// @param angle - Angle in radians
pub fn sceGumRotateY(angle: f32);
}
extern "C" {
/// Rotate around the Z axis
///
/// @param angle - Angle in radians
pub fn sceGumRotateZ(angle: f32);
}
extern "C" {
/// Rotate around all 3 axis in order X, Y, Z
///
/// @param v - Pointer to vector containing angles
pub fn sceGumRotateXYZ(v: *const ScePspFVector3);
}
extern "C" {
/// Rotate around all 3 axis in order Z, Y, X
///
/// @param v - Pointer to vector containing angles
pub fn sceGumRotateZYX(v: *const ScePspFVector3);
}
extern "C" {
/// Scale matrix
///
/// @note The matrix loses its orthonogal status after executing this function.
pub fn sceGumScale(v: *const ScePspFVector3);
}
extern "C" {
/// Store current matrix in the stack
///
/// @param m - Matrix to write result to
pub fn sceGumStoreMatrix(m: *mut ScePspFMatrix4);
}
extern "C" {
/// Translate coordinate system
///
/// @param v - Translation coordinates
pub fn sceGumTranslate(v: *const ScePspFVector3);
}
extern "C" {
/// Explicitly flush dirty matrices to the hardware
pub fn sceGumUpdateMatrix();
}
extern "C" {
/// Invert 4x4 matrix
///
/// This invert algorithm can operate on matrices that are not orthongal (See sceGumFastInverse())
pub fn sceGumFullInverse();
}
extern "C" {
/// Invert orthonogal 4x4 matrix
///
/// Note that the matrix in the stack has to be orthonogal (that is, all rotational axises must be unit length & orthonogal against the others),
/// otherwise the result of the function cannot be depended on. If you need to invert a matrix that is not orthonogal, use sceGumFullInverse().
pub fn sceGumFastInverse();
}
extern "C" {
/// Stack-aware version of sceGuBeginObject() (look in pspgu.h for description)
///
/// @note NOT YET IMPLEMENTED
///
/// @param vtype - Vertex type to process
/// @param count - Number of vertices to test
/// @param indices - Optional index-list
/// @param vertices - Vertex-list
pub fn sceGumBeginObject(vtype: i32, count: i32,
indices: *const c_void,
vertices: *const c_void);
}
extern "C" {
/// Stack-aware version of sceGuEndObject()
///
/// @note NOT YET IMPLEMENTED
pub fn sceGumEndObject();
}
extern "C" {
pub fn gumInit();
}
extern "C" {
/// Load matrix with identity
///
/// @param m - Matrix to load with identity
pub fn gumLoadIdentity(m: *mut ScePspFMatrix4);
}
extern "C" {
pub fn gumLoadMatrix(r: *mut ScePspFMatrix4, a: *const ScePspFMatrix4);
}
extern "C" {
pub fn gumLookAt(m: *mut ScePspFMatrix4, eye: *mut ScePspFVector3,
center: *mut ScePspFVector3, up: *mut ScePspFVector3);
}
extern "C" {
pub fn gumMultMatrix(result: *mut ScePspFMatrix4,
a: *const ScePspFMatrix4, b: *const ScePspFMatrix4);
}
extern "C" {
pub fn gumOrtho(m: *mut ScePspFMatrix4, left: f32, right: f32,
bottom: f32, top: f32, near: f32, far: f32);
}
extern "C" {
pub fn gumPerspective(m: *mut ScePspFMatrix4, fovy: f32, aspect: f32,
near: f32, far: f32);
}
extern "C" {
pub fn gumRotateX(m: *mut ScePspFMatrix4, angle: f32);
}
extern "C" {
pub fn gumRotateXYZ(m: *mut ScePspFMatrix4, v: *const ScePspFVector3);
}
extern "C" {
pub fn gumRotateY(m: *mut ScePspFMatrix4, angle: f32);
}
extern "C" {
pub fn gumRotateZ(m: *mut ScePspFMatrix4, angle: f32);
}
extern "C" {
pub fn gumRotateZYX(m: *mut ScePspFMatrix4, v: *const ScePspFVector3);
}
extern "C" {
pub fn gumScale(m: *mut ScePspFMatrix4, v: *const ScePspFVector3);
}
extern "C" {
pub fn gumTranslate(m: *mut ScePspFMatrix4, v: *const ScePspFVector3);
}
extern "C" {
pub fn gumFullInverse(r: *mut ScePspFMatrix4, a: *const ScePspFMatrix4);
}
extern "C" {
/// Invert orthonogal 4x4 matrix
///
/// Note that the matrix in the stack has to be orthonogal (that is, all rotational axises must be unit length & orthonogal against the others),
/// otherwise the result of the function cannot be depended on. If you need to invert a matrix that is not orthonogal, use gumFullInverse().
///
/// @param r - Matrix receiving result
/// @param a - Orthonogal matrix that is to be inverted
pub fn gumFastInverse(r: *mut ScePspFMatrix4, a: *const ScePspFMatrix4);
}
extern "C" {
pub fn gumCrossProduct(r: *mut ScePspFVector3, a: *const ScePspFVector3,
b: *const ScePspFVector3);
}
extern "C" {
pub fn gumDotProduct(a: *const ScePspFVector3, b: *const ScePspFVector3)
-> f32;
}
extern "C" {
pub fn gumNormalize(v: *mut ScePspFVector3);
}
#[repr(u32)]
/// Enumeration of the remote keys
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspHprmKeys {
PSP_HPRM_PLAYPAUSE = 1,
PSP_HPRM_FORWARD = 4,
PSP_HPRM_BACK = 8,
PSP_HPRM_VOL_UP = 16,
PSP_HPRM_VOL_DOWN = 32,
PSP_HPRM_HOLD = 128,
}
extern "C" {
/// Peek at the current being pressed on the remote.
///
/// @param key - Pointer to the u32 to receive the key bitmap, should be one or
/// more of ::PspHprmKeys
///
/// @return < 0 on error
pub fn sceHprmPeekCurrentKey(key: *mut u32) -> i32;
}
extern "C" {
/// Peek at the current latch data.
///
/// @param latch - Pointer a to a 4 dword array to contain the latch data.
///
/// @return < 0 on error.
pub fn sceHprmPeekLatch(latch: *mut u32) -> i32;
}
extern "C" {
/// Read the current latch data.
///
/// @param latch - Pointer a to a 4 dword array to contain the latch data.
///
/// @return < 0 on error.
pub fn sceHprmReadLatch(latch: *mut u32) -> i32;
}
extern "C" {
/// Determines whether the headphones are plugged in.
///
/// @return 1 if the headphones are plugged in, else 0.
pub fn sceHprmIsHeadphoneExist() -> i32;
}
extern "C" {
/// Determines whether the remote is plugged in.
///
/// @return 1 if the remote is plugged in, else 0.
pub fn sceHprmIsRemoteExist() -> i32;
}
extern "C" {
/// Determines whether the microphone is plugged in.
///
/// @return 1 if the microphone is plugged in, else 0.
pub fn sceHprmIsMicrophoneExist() -> i32;
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspHttpHttpVersion {
PSP_HTTP_VERSION_1_0 = 0,
PSP_HTTP_VERSION_1_1 = 1,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspHttpMethod {
PSP_HTTP_METHOD_GET = 0,
PSP_HTTP_METHOD_POST = 1,
PSP_HTTP_METHOD_HEAD = 2,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspHttpAuthType {
PSP_HTTP_AUTH_BASIC = 0,
PSP_HTTP_AUTH_DIGEST = 1,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspHttpProxyMode {
PSP_HTTP_PROXY_AUTO = 0,
PSP_HTTP_PROXY_MANUAL = 1,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspHttpAddHeaderMode {
PSP_HTTP_HEADER_OVERWRITE = 0,
PSP_HTTP_HEADER_ADD = 1,
}
pub type PspHttpMallocFunction =
::core::option::Option<unsafe extern "C" fn(size: SceSize)
-> *mut c_void>;
pub type PspHttpReallocFunction =
::core::option::Option<unsafe extern "C" fn(p: *mut c_void,
size: SceSize)
-> *mut c_void>;
pub type PspHttpFreeFunction =
::core::option::Option<unsafe extern "C" fn(p: *mut c_void)>;
pub type PspHttpPasswordCB =
::core::option::Option<unsafe extern "C" fn(request: i32,
auth_type: PspHttpAuthType,
realm: *const u8,
username: *mut u8,
password: *mut u8,
need_entity: SceBool,
entity_body:
*mut *mut u8,
entity_size: *mut SceSize,
save: *mut SceBool)
-> i32>;
extern "C" {
/// Init the http library.
///
/// @param unknown1 - Memory pool size? Pass 20000
/// @return 0 on success, < 0 on error.
pub fn sceHttpInit(unknown1: u32) -> i32;
}
extern "C" {
/// Terminate the http library.
///
/// @return 0 on success, < 0 on error.
pub fn sceHttpEnd() -> i32;
}
extern "C" {
/// Create a http template.
///
/// @param agent - User agent
/// @param unknown1 - Pass 1
/// @param unknown2 - Pass 0
/// @return A template ID on success, < 0 on error.
pub fn sceHttpCreateTemplate(agent: *mut u8, unknown1: i32,
unknown2: i32) -> i32;
}
extern "C" {
/// Delete a http template.
///
/// @param templateid - ID of the template created by sceHttpCreateTemplate
/// @return 0 on success, < 0 on error.
pub fn sceHttpDeleteTemplate(templateid: i32) -> i32;
}
extern "C" {
/// Create a http connection.
///
/// @param templateid - ID of the template created by sceHttpCreateTemplate
/// @param host - Host to connect to
/// @param unknown1 - Pass "http"
/// @param port - Port to connect on
/// @param unknown2 - Pass 0
/// @return A connection ID on success, < 0 on error.
pub fn sceHttpCreateConnection(templateid: i32, host: *mut u8,
unknown1: *mut u8, port: u16,
unknown2: i32) -> i32;
}
extern "C" {
/// Create a http connection to a url.
///
/// @param templateid - ID of the template created by sceHttpCreateTemplate
/// @param url - url to connect to
/// @param unknown1 - Pass 0
/// @return A connection ID on success, < 0 on error.
pub fn sceHttpCreateConnectionWithURL(templateid: i32,
url: *const u8,
unknown1: i32) -> i32;
}
extern "C" {
/// Delete a http connection.
///
/// @param connectionid - ID of the connection created by sceHttpCreateConnection or sceHttpCreateConnectionWithURL
/// @return 0 on success, < 0 on error.
pub fn sceHttpDeleteConnection(connectionid: i32) -> i32;
}
extern "C" {
/// Create a http request.
///
/// @param connectionid - ID of the connection created by sceHttpCreateConnection or sceHttpCreateConnectionWithURL
/// @param method - One of ::PspHttpMethod
/// @param path - Path to access
/// @param contentlength - Length of the content (POST method only)
/// @return A request ID on success, < 0 on error.
pub fn sceHttpCreateRequest(connectionid: i32, method: PspHttpMethod,
path: *mut u8,
contentlength: SceULong64) -> i32;
}
extern "C" {
/// Create a http request with url.
///
/// @param connectionid - ID of the connection created by sceHttpCreateConnection or sceHttpCreateConnectionWithURL
/// @param method - One of ::PspHttpMethod
/// @param url - url to access
/// @param contentlength - Length of the content (POST method only)
/// @return A request ID on success, < 0 on error.
pub fn sceHttpCreateRequestWithURL(connectionid: i32,
method: PspHttpMethod,
url: *mut u8,
contentlength: SceULong64) -> i32;
}
extern "C" {
/// Delete a http request.
///
/// @param requestid - ID of the request created by sceHttpCreateRequest or sceHttpCreateRequestWithURL
/// @return 0 on success, < 0 on error.
pub fn sceHttpDeleteRequest(requestid: i32) -> i32;
}
extern "C" {
/// Send a http request.
///
/// @param requestid - ID of the request created by sceHttpCreateRequest or sceHttpCreateRequestWithURL
/// @param data - For POST methods specify a pointer to the post data, otherwise pass NULL
/// @param datasize - For POST methods specify the size of the post data, otherwise pass 0
/// @return 0 on success, < 0 on error.
pub fn sceHttpSendRequest(requestid: i32, data: *mut c_void,
datasize: u32) -> i32;
}
extern "C" {
/// Abort a http request.
///
/// @param requestid - ID of the request created by sceHttpCreateRequest or sceHttpCreateRequestWithURL
/// @return 0 on success, < 0 on error.
pub fn sceHttpAbortRequest(requestid: i32) -> i32;
}
extern "C" {
/// Read a http request response.
///
/// @param requestid - ID of the request created by sceHttpCreateRequest or sceHttpCreateRequestWithURL
/// @param data - Buffer for the response data to be stored
/// @param datasize - Size of the buffer
/// @return The size read into the data buffer, 0 if there is no more data, < 0 on error.
pub fn sceHttpReadData(requestid: i32, data: *mut c_void,
datasize: u32) -> i32;
}
extern "C" {
/// Get http request response length.
///
/// @param requestid - ID of the request created by sceHttpCreateRequest or sceHttpCreateRequestWithURL
/// @param contentlength - The size of the content
/// @return 0 on success, < 0 on error.
pub fn sceHttpGetContentLength(requestid: i32,
contentlength: *mut SceULong64) -> i32;
}
extern "C" {
/// Get http request status code.
///
/// @param requestid - ID of the request created by sceHttpCreateRequest or sceHttpCreateRequestWithURL
/// @param statuscode - The status code from the host (200 is ok, 404 is not found etc)
/// @return 0 on success, < 0 on error.
pub fn sceHttpGetStatusCode(requestid: i32, statuscode: *mut i32)
-> i32;
}
extern "C" {
/// Set resolver timeout
///
/// @param id - ID of the template or connection
/// @param timeout - Timeout value in microseconds
/// @return 0 on success, < 0 on error.
pub fn sceHttpSetResolveTimeOut(id: i32, timeout: u32)
-> i32;
}
extern "C" {
/// Set resolver retry
///
/// @param id - ID of the template or connection
/// @param count - Number of retries
/// @return 0 on success, < 0 on error.
pub fn sceHttpSetResolveRetry(id: i32, count: i32) -> i32;
}
extern "C" {
/// Set connect timeout
///
/// @param id - ID of the template, connection or request
/// @param timeout - Timeout value in microseconds
/// @return 0 on success, < 0 on error.
pub fn sceHttpSetConnectTimeOut(id: i32, timeout: u32)
-> i32;
}
extern "C" {
/// Set send timeout
///
/// @param id - ID of the template, connection or request
/// @param timeout - Timeout value in microseconds
/// @return 0 on success, < 0 on error.
pub fn sceHttpSetSendTimeOut(id: i32, timeout: u32) -> i32;
}
extern "C" {
/// Set receive timeout
///
/// @param id - ID of the template or connection
/// @param timeout - Timeout value in microseconds
/// @return 0 on success, < 0 on error.
pub fn sceHttpSetRecvTimeOut(id: i32, timeout: u32) -> i32;
}
extern "C" {
/// Enable keep alive
///
/// @param id - ID of the template or connection
/// @return 0 on success, < 0 on error.
pub fn sceHttpEnableKeepAlive(id: i32) -> i32;
}
extern "C" {
/// Disable keep alive
///
/// @param id - ID of the template or connection
/// @return 0 on success, < 0 on error.
pub fn sceHttpDisableKeepAlive(id: i32) -> i32;
}
extern "C" {
/// Enable redirect
///
/// @param id - ID of the template or connection
/// @return 0 on success, < 0 on error.
pub fn sceHttpEnableRedirect(id: i32) -> i32;
}
extern "C" {
/// Disable redirect
///
/// @param id - ID of the template or connection
/// @return 0 on success, < 0 on error.
pub fn sceHttpDisableRedirect(id: i32) -> i32;
}
extern "C" {
/// Enable cookie
///
/// @param id - ID of the template or connection
/// @return 0 on success, < 0 on error.
pub fn sceHttpEnableCookie(id: i32) -> i32;
}
extern "C" {
/// Disable cookie
///
/// @param id - ID of the template or connection
/// @return 0 on success, < 0 on error.
pub fn sceHttpDisableCookie(id: i32) -> i32;
}
extern "C" {
/// Save cookie
///
/// @return 0 on success, < 0 on error.
pub fn sceHttpSaveSystemCookie() -> i32;
}
extern "C" {
/// Load cookie
///
/// @return 0 on success, < 0 on error.
pub fn sceHttpLoadSystemCookie() -> i32;
}
extern "C" {
/// Add content header
///
/// @param id - ID of the template, connection or request
/// @param name - Name of the content
/// @param value - Value of the content
/// @param unknown1 - Pass 0
/// @return 0 on success, < 0 on error.
pub fn sceHttpAddExtraHeader(id: i32, name: *mut u8,
value: *mut u8, unknown1: i32)
-> i32;
}
extern "C" {
/// Delete content header
///
/// @param id - ID of the template, connection or request
/// @param name - Name of the content
/// @return 0 on success, < 0 on error.
pub fn sceHttpDeleteHeader(id: i32, name: *const u8) -> i32;
}
extern "C" {
/// Init the https library.
///
/// @param unknown1 - Pass 0
/// @param unknown2 - Pass 0
/// @param unknown3 - Pass 0
/// @param unknown4 - Pass 0
///
/// @return 0 on success, < 0 on error.
pub fn sceHttpsInit(unknown1: i32, unknown2: i32,
unknown3: i32, unknown4: i32) -> i32;
}
extern "C" {
/// Terminate the https library
///
/// @return 0 on success, < 0 on error.
pub fn sceHttpsEnd() -> i32;
}
extern "C" {
/// Load default certificate
///
/// @param unknown1 - Pass 0
/// @param unknown2 - Pass 0
/// @return 0 on success, < 0 on error.
pub fn sceHttpsLoadDefaultCert(unknown1: i32, unknown2: i32)
-> i32;
}
extern "C" {
pub fn sceHttpDisableAuth(id: i32) -> i32;
}
extern "C" {
pub fn sceHttpDisableCache(id: i32) -> i32;
}
extern "C" {
pub fn sceHttpEnableAuth(id: i32) -> i32;
}
extern "C" {
pub fn sceHttpEnableCache(id: i32) -> i32;
}
extern "C" {
pub fn sceHttpEndCache() -> i32;
}
extern "C" {
pub fn sceHttpGetAllHeader(request: i32, header: *mut *mut u8,
header_size: *mut u32) -> i32;
}
extern "C" {
pub fn sceHttpGetNetworkErrno(request: i32, err_num: *mut i32)
-> i32;
}
extern "C" {
pub fn sceHttpGetProxy(id: i32, activate_flag: *mut i32,
mode: *mut i32, proxy_host: *mut u8,
len: SceSize, proxy_port: *mut u16)
-> i32;
}
extern "C" {
pub fn sceHttpInitCache(max_size: SceSize) -> i32;
}
extern "C" {
pub fn sceHttpSetAuthInfoCB(id: i32, cbfunc: PspHttpPasswordCB)
-> i32;
}
extern "C" {
pub fn sceHttpSetProxy(id: i32, activate_flag: i32, mode: i32,
new_proxy_host: *const u8,
new_proxy_port: u16) -> i32;
}
extern "C" {
pub fn sceHttpSetResHeaderMaxSize(id: i32, header_size: u32)
-> i32;
}
extern "C" {
pub fn sceHttpSetMallocFunction(malloc_func: PspHttpMallocFunction,
free_func: PspHttpFreeFunction,
realloc_func: PspHttpReallocFunction)
-> i32;
}
extern "C" {
/// Retrieves the value associated with a key
/// @param key - idstorage key
/// @param offset - offset within the 512 byte leaf
/// @param buf - buffer with enough storage
/// @param len - amount of data to retrieve (offset + len must be <= 512 bytes)
pub fn sceIdStorageLookup(key: u16, offset: u32, buf: *mut c_void,
len: u32) -> i32;
}
extern "C" {
/// Retrieves the whole 512 byte container for the key
/// @param key - idstorage key
/// @param buf - buffer with at last 512 bytes of storage
pub fn sceIdStorageReadLeaf(key: u16, buf: *mut c_void) -> i32;
}
extern "C" {
/// sceIdStorageWriteLeaf() - Writes 512-bytes to idstorage key
/// @param key - idstorage key
/// @param buf - buffer with 512-btes of data
pub fn sceIdStorageWriteLeaf(key: u16, buf: *mut c_void) -> i32;
}
extern "C" {
/// sceIdStorageIsReadOnly() - Checks idstorage for readonly status
pub fn sceIdStorageIsReadOnly() -> i32;
}
extern "C" {
/// sceIdStorageFlush() - Finalizes a write
pub fn sceIdStorageFlush() -> i32;
}
pub type SceImposeParam = i32;
extern "C" {
/// Fetch the value of an Impose parameter.
///
/// @return value of the parameter on success, < 0 on error
pub fn sceImposeGetParam(param: SceImposeParam) -> i32;
}
extern "C" {
/// Change the value of an Impose parameter.
///
/// @param param - The parameter to change.
/// @param value - The value to set the parameter to.
/// @return < 0 on error
///
pub fn sceImposeSetParam(param: SceImposeParam, value: i32)
-> i32;
}
extern "C" {
/// Get the value of the backlight timer.
///
/// @return backlight timer in seconds or < 0 on error
///
pub fn sceImposeGetBacklightOffTime() -> i32;
}
extern "C" {
/// Set the value of the backlight timer.
///
/// @param value - The backlight timer. (30 to a lot of seconds)
/// @return < 0 on error
///
pub fn sceImposeSetBacklightOffTime(value: i32) -> i32;
}
extern "C" {
/// Get the language and button assignment parameters
///
/// @return < 0 on error
///
pub fn sceImposeGetLanguageMode(lang: *mut i32, button: *mut i32)
-> i32;
}
extern "C" {
/// Set the language and button assignment parameters
///
/// /!\ parameter values not known.
///
/// @param lang - Language
/// @param button - Button assignment
/// @return < 0 on error
///
pub fn sceImposeSetLanguageMode(lang: i32, button: i32)
-> i32;
}
extern "C" {
/// Get the value of the UMD popup.
///
/// @return umd popup state or < 0 on error
///
pub fn sceImposeGetUMDPopup() -> i32;
}
extern "C" {
/// Set the value of the UMD popup.
///
/// @param value - The popup mode.
/// @return < 0 on error
///
pub fn sceImposeSetUMDPopup(value: i32) -> i32;
}
extern "C" {
/// Get the value of the Home popup.
///
/// @return home popup state or < 0 on error
///
pub fn sceImposeGetHomePopup() -> i32;
}
extern "C" {
/// Set the value of the Home popup.
///
/// @param value - The popup mode.
/// @return < 0 on error
///
pub fn sceImposeSetHomePopup(value: i32) -> i32;
}
extern "C" {
/// Check the video out. (for psp slim?)
///
/// @param value - video out mode/status(?)
/// @return < 0 on error
///
pub fn sceImposeCheckVideoOut(value: *mut i32) -> i32;
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PSPBootFrom {
PSP_BOOT_FLASH = 0,
PSP_BOOT_DISC = 32,
PSP_BOOT_MS = 64,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PSPInitApitype {
PSP_INIT_APITYPE_DISC = 288,
PSP_INIT_APITYPE_DISC_UPDATER = 289,
PSP_INIT_APITYPE_MS1 = 320,
PSP_INIT_APITYPE_MS2 = 321,
PSP_INIT_APITYPE_MS3 = 322,
PSP_INIT_APITYPE_MS4 = 323,
PSP_INIT_APITYPE_MS5 = 324,
PSP_INIT_APITYPE_VSH1 = 528,
PSP_INIT_APITYPE_VSH2 = 544,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PSPKeyConfig {
PSP_INIT_KEYCONFIG_VSH = 256,
PSP_INIT_KEYCONFIG_GAME = 512,
PSP_INIT_KEYCONFIG_POPS = 768,
}
extern "C" {
/// Gets the api type
///
/// @return the api type in which the system has booted
pub fn sceKernelInitApitype() -> i32;
}
extern "C" {
/// Gets the filename of the executable to be launched after all modules of the api.
///
/// @return filename of executable or NULL if no executable found.
pub fn sceKernelInitFileName() -> *mut u8;
}
extern "C" {
/// Gets the device in which the application was launched.
///
/// @return the device code, one of PSPBootFrom values.
pub fn sceKernelBootFrom() -> i32;
}
extern "C" {
/// Get the key configuration in which the system has booted.
///
/// @return the key configuration code, one of PSPKeyConfig values
pub fn InitForKernel_7233B5BC() -> i32;
}
extern "C" {
/// Inits the MJpeg library
///
/// @return 0 on success, < 0 on error
pub fn sceJpegInitMJpeg() -> i32;
}
extern "C" {
/// Finishes the MJpeg library
///
/// @return 0 on success, < 0 on error
pub fn sceJpegFinishMJpeg() -> i32;
}
extern "C" {
/// Creates the decoder context.
///
/// @param width - The width of the frame
/// @param height - The height of the frame
///
/// @return 0 on success, < 0 on error
pub fn sceJpegCreateMJpeg(width: i32, height: i32) -> i32;
}
extern "C" {
/// Deletes the current decoder context.
///
/// @return 0 on success, < 0 on error
pub fn sceJpegDeleteMJpeg() -> i32;
}
extern "C" {
/// Decodes a mjpeg frame.
///
/// @param jpegbuf - the buffer with the mjpeg frame
/// @param size - size of the buffer pointed by jpegbuf
/// @param rgba - buffer where the decoded data in RGBA format will be stored.
/// It should have a size of (width * height * 4).
/// @param unk - Unknown, pass 0
///
/// @return (width * 65536) + height on success, < 0 on error
pub fn sceJpegDecodeMJpeg(jpegbuf: *mut u8, size: SceSize,
rgba: *mut c_void, unk: u32) -> i32;
}
/// Structure for LoadExecVSH* functions
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceKernelLoadExecVSHParam {
/// Size of the structure in bytes
pub size: SceSize,
/// Size of the arguments string
pub args: SceSize,
/// Pointer to the arguments strings
pub argp: *mut c_void,
/// The key, usually "game", "updater" or "vsh"
pub key: *const u8,
/// The size of the vshmain arguments
pub vshmain_args_size: u32,
/// vshmain arguments that will be passed to vshmain after the program has exited
pub vshmain_args: *mut c_void,
/// "/kd/pspbtcnf_game.txt" or "/kd/pspbtcnf.txt" if not supplied (max. 256 chars)
pub configfile: *mut u8,
/// An unknown string (max. 256 chars) probably used in 2nd stage of loadexec
pub unk4: u32,
/// unknown flag default value = 0x10000
pub unk5: u32,
}
#[test]
fn bindgen_test_layout_SceKernelLoadExecVSHParam() {
assert_eq!(::core::mem::size_of::<SceKernelLoadExecVSHParam>() , 56usize ,
concat ! (
"Size of: " , stringify ! ( SceKernelLoadExecVSHParam ) ));
assert_eq! (::core::mem::align_of::<SceKernelLoadExecVSHParam>() , 8usize
, concat ! (
"Alignment of " , stringify ! ( SceKernelLoadExecVSHParam )
));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelLoadExecVSHParam ) ) . size as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! (
SceKernelLoadExecVSHParam ) , "::" , stringify ! ( size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelLoadExecVSHParam ) ) . args as *
const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! (
SceKernelLoadExecVSHParam ) , "::" , stringify ! ( args ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelLoadExecVSHParam ) ) . argp as *
const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! (
SceKernelLoadExecVSHParam ) , "::" , stringify ! ( argp ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelLoadExecVSHParam ) ) . key as *
const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! (
SceKernelLoadExecVSHParam ) , "::" , stringify ! ( key ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelLoadExecVSHParam ) ) .
vshmain_args_size as * const _ as usize } , 24usize , concat !
(
"Alignment of field: " , stringify ! (
SceKernelLoadExecVSHParam ) , "::" , stringify ! (
vshmain_args_size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelLoadExecVSHParam ) ) .
vshmain_args as * const _ as usize } , 32usize , concat ! (
"Alignment of field: " , stringify ! (
SceKernelLoadExecVSHParam ) , "::" , stringify ! (
vshmain_args ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelLoadExecVSHParam ) ) .
configfile as * const _ as usize } , 40usize , concat ! (
"Alignment of field: " , stringify ! (
SceKernelLoadExecVSHParam ) , "::" , stringify ! ( configfile
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelLoadExecVSHParam ) ) . unk4 as *
const _ as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! (
SceKernelLoadExecVSHParam ) , "::" , stringify ! ( unk4 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelLoadExecVSHParam ) ) . unk5 as *
const _ as usize } , 52usize , concat ! (
"Alignment of field: " , stringify ! (
SceKernelLoadExecVSHParam ) , "::" , stringify ! ( unk5 ) ));
}
impl Clone for SceKernelLoadExecVSHParam {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// Executes a new executable from a buffer.
///
/// @param bufsize - Size in bytes of the buffer pointed by buf.
/// @param buf - Pointer to a buffer containing the module to execute.
/// @param param - Pointer to a ::SceKernelLoadExecParam structure, or NULL.
///
/// @return < 0 on some errors.
pub fn sceKernelLoadExecBufferPlain(bufsize: SceSize, buf: *mut c_void,
param: *mut SceKernelLoadExecParam)
-> i32;
}
extern "C" {
/// Restart the vsh.
///
/// @param param - Pointer to a ::SceKernelLoadExecVSHParam structure, or NULL
///
/// @return < 0 on some errors.
///
/// @note - when called in game mode it will have the same effect that sceKernelExitGame
///
pub fn sceKernelExitVSHVSH(param: *mut SceKernelLoadExecVSHParam)
-> i32;
}
extern "C" {
/// Executes a new executable from a disc.
/// It is the function used by the firmware to execute the EBOOT.BIN from a disc.
///
/// @param file - The file to execute.
/// @param param - Pointer to a ::SceKernelLoadExecVSHParam structure, or NULL.
///
/// @return < 0 on some errors.
pub fn sceKernelLoadExecVSHDisc(file: *const u8,
param: *mut SceKernelLoadExecVSHParam)
-> i32;
}
extern "C" {
/// Executes a new executable from a disc.
/// It is the function used by the firmware to execute an updater from a disc.
///
/// @param file - The file to execute.
/// @param param - Pointer to a ::SceKernelLoadExecVSHParam structure, or NULL.
///
/// @return < 0 on some errors.
pub fn sceKernelLoadExecVSHDiscUpdater(file: *const u8,
param:
*mut SceKernelLoadExecVSHParam)
-> i32;
}
extern "C" {
/// Executes a new executable from a memory stick.
/// It is the function used by the firmware to execute an updater from a memory stick.
///
/// @param file - The file to execute.
/// @param param - Pointer to a ::SceKernelLoadExecVSHParam structure, or NULL.
///
/// @return < 0 on some errors.
pub fn sceKernelLoadExecVSHMs1(file: *const u8,
param: *mut SceKernelLoadExecVSHParam)
-> i32;
}
extern "C" {
/// Executes a new executable from a memory stick.
/// It is the function used by the firmware to execute games (and homebrew :P) from a memory stick.
///
/// @param file - The file to execute.
/// @param param - Pointer to a ::SceKernelLoadExecVSHParam structure, or NULL.
///
/// @return < 0 on some errors.
pub fn sceKernelLoadExecVSHMs2(file: *const u8,
param: *mut SceKernelLoadExecVSHParam)
-> i32;
}
extern "C" {
/// Executes a new executable from a memory stick.
/// It is the function used by the firmware to execute ... ?
///
/// @param file - The file to execute.
/// @param param - Pointer to a ::SceKernelLoadExecVSHParam structure, or NULL.
///
/// @return < 0 on some errors.
pub fn sceKernelLoadExecVSHMs3(file: *const u8,
param: *mut SceKernelLoadExecVSHParam)
-> i32;
}
/// Structure to hold a single export entry
#[repr(C)]
#[derive(Debug, Copy)]
pub struct _PspLibraryEntry {
pub name: *const u8,
pub version: u16,
pub attribute: u16,
pub entLen: u8,
pub varCount: u8,
pub funcCount: u16,
pub entrytable: *mut c_void,
}
#[test]
fn bindgen_test_layout__PspLibraryEntry() {
assert_eq!(::core::mem::size_of::<_PspLibraryEntry>() , 24usize , concat !
( "Size of: " , stringify ! ( _PspLibraryEntry ) ));
assert_eq! (::core::mem::align_of::<_PspLibraryEntry>() , 8usize , concat
! ( "Alignment of " , stringify ! ( _PspLibraryEntry ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspLibraryEntry ) ) . name as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( _PspLibraryEntry ) ,
"::" , stringify ! ( name ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspLibraryEntry ) ) . version as * const
_ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( _PspLibraryEntry ) ,
"::" , stringify ! ( version ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspLibraryEntry ) ) . attribute as *
const _ as usize } , 10usize , concat ! (
"Alignment of field: " , stringify ! ( _PspLibraryEntry ) ,
"::" , stringify ! ( attribute ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspLibraryEntry ) ) . entLen as * const
_ as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( _PspLibraryEntry ) ,
"::" , stringify ! ( entLen ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspLibraryEntry ) ) . varCount as *
const _ as usize } , 13usize , concat ! (
"Alignment of field: " , stringify ! ( _PspLibraryEntry ) ,
"::" , stringify ! ( varCount ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspLibraryEntry ) ) . funcCount as *
const _ as usize } , 14usize , concat ! (
"Alignment of field: " , stringify ! ( _PspLibraryEntry ) ,
"::" , stringify ! ( funcCount ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspLibraryEntry ) ) . entrytable as *
const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( _PspLibraryEntry ) ,
"::" , stringify ! ( entrytable ) ));
}
impl Clone for _PspLibraryEntry {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceMp3InitArg {
/// Stream start position
pub mp3StreamStart: SceUInt32,
/// Unknown - set to 0
pub unk1: SceUInt32,
/// Stream end position
pub mp3StreamEnd: SceUInt32,
/// Unknown - set to 0
pub unk2: SceUInt32,
/// Pointer to a buffer to contain raw mp3 stream data (+1472 bytes workspace)
pub mp3Buf: *mut SceVoid,
/// Size of mp3Buf buffer (must be >= 8192)
pub mp3BufSize: SceInt32,
/// Pointer to decoded pcm samples buffer
pub pcmBuf: *mut SceVoid,
/// Size of pcmBuf buffer (must be >= 9216)
pub pcmBufSize: SceInt32,
}
#[test]
fn bindgen_test_layout_SceMp3InitArg() {
assert_eq!(::core::mem::size_of::<SceMp3InitArg>() , 48usize , concat ! (
"Size of: " , stringify ! ( SceMp3InitArg ) ));
assert_eq! (::core::mem::align_of::<SceMp3InitArg>() , 8usize , concat ! (
"Alignment of " , stringify ! ( SceMp3InitArg ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMp3InitArg ) ) . mp3StreamStart as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceMp3InitArg ) , "::"
, stringify ! ( mp3StreamStart ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMp3InitArg ) ) . unk1 as * const _ as
usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( SceMp3InitArg ) , "::"
, stringify ! ( unk1 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMp3InitArg ) ) . mp3StreamEnd as *
const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( SceMp3InitArg ) , "::"
, stringify ! ( mp3StreamEnd ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMp3InitArg ) ) . unk2 as * const _ as
usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( SceMp3InitArg ) , "::"
, stringify ! ( unk2 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMp3InitArg ) ) . mp3Buf as * const _
as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( SceMp3InitArg ) , "::"
, stringify ! ( mp3Buf ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMp3InitArg ) ) . mp3BufSize as * const
_ as usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! ( SceMp3InitArg ) , "::"
, stringify ! ( mp3BufSize ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMp3InitArg ) ) . pcmBuf as * const _
as usize } , 32usize , concat ! (
"Alignment of field: " , stringify ! ( SceMp3InitArg ) , "::"
, stringify ! ( pcmBuf ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMp3InitArg ) ) . pcmBufSize as * const
_ as usize } , 40usize , concat ! (
"Alignment of field: " , stringify ! ( SceMp3InitArg ) , "::"
, stringify ! ( pcmBufSize ) ));
}
impl Clone for SceMp3InitArg {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// sceMp3ReserveMp3Handle
///
/// @param args - Pointer to SceMp3InitArg structure
///
/// @return sceMp3 handle on success, < 0 on error.
pub fn sceMp3ReserveMp3Handle(args: *mut SceMp3InitArg) -> SceInt32;
}
extern "C" {
/// sceMp3ReleaseMp3Handle
///
/// @param handle - sceMp3 handle
///
/// @return 0 if success, < 0 on error.
pub fn sceMp3ReleaseMp3Handle(handle: SceInt32) -> SceInt32;
}
extern "C" {
/// sceMp3InitResource
///
/// @return 0 if success, < 0 on error.
pub fn sceMp3InitResource() -> SceInt32;
}
extern "C" {
/// sceMp3TermResource
///
/// @return 0 if success, < 0 on error.
pub fn sceMp3TermResource() -> SceInt32;
}
extern "C" {
/// sceMp3Init
///
/// @param handle - sceMp3 handle
///
/// @return 0 if success, < 0 on error.
pub fn sceMp3Init(handle: SceInt32) -> SceInt32;
}
extern "C" {
/// sceMp3Decode
///
/// @param handle - sceMp3 handle
/// @param dst - Pointer to destination pcm samples buffer
///
/// @return number of bytes in decoded pcm buffer, < 0 on error.
pub fn sceMp3Decode(handle: SceInt32, dst: *mut *mut SceShort16)
-> SceInt32;
}
extern "C" {
/// sceMp3GetInfoToAddStreamData
///
/// @param handle - sceMp3 handle
/// @param dst - Pointer to stream data buffer
/// @param towrite - Space remaining in stream data buffer
/// @param srcpos - Position in source stream to start reading from
///
/// @return 0 if success, < 0 on error.
pub fn sceMp3GetInfoToAddStreamData(handle: SceInt32,
dst: *mut *mut SceUChar8,
towrite: *mut SceInt32,
srcpos: *mut SceInt32) -> SceInt32;
}
extern "C" {
/// sceMp3NotifyAddStreamData
///
/// @param handle - sceMp3 handle
/// @param size - number of bytes added to the stream data buffer
///
/// @return 0 if success, < 0 on error.
pub fn sceMp3NotifyAddStreamData(handle: SceInt32, size: SceInt32)
-> SceInt32;
}
extern "C" {
/// sceMp3CheckStreamDataNeeded
///
/// @param handle - sceMp3 handle
///
/// @return 1 if more stream data is needed, < 0 on error.
pub fn sceMp3CheckStreamDataNeeded(handle: SceInt32) -> SceInt32;
}
extern "C" {
/// sceMp3SetLoopNum
///
/// @param handle - sceMp3 handle
/// @param loop - Number of loops
///
/// @return 0 if success, < 0 on error.
pub fn sceMp3SetLoopNum(handle: SceInt32, loop_: SceInt32) -> SceInt32;
}
extern "C" {
/// sceMp3GetLoopNum
///
/// @param handle - sceMp3 handle
///
/// @return Number of loops
pub fn sceMp3GetLoopNum(handle: SceInt32) -> SceInt32;
}
extern "C" {
/// sceMp3GetSumDecodedSample
///
/// @param handle - sceMp3 handle
///
/// @return Number of decoded samples
pub fn sceMp3GetSumDecodedSample(handle: SceInt32) -> SceInt32;
}
extern "C" {
/// sceMp3GetMaxOutputSample
///
/// @param handle - sceMp3 handle
///
/// @return Number of max samples to output
pub fn sceMp3GetMaxOutputSample(handle: SceInt32) -> SceInt32;
}
extern "C" {
/// sceMp3GetSamplingRate
///
/// @param handle - sceMp3 handle
///
/// @return Sampling rate of the mp3
pub fn sceMp3GetSamplingRate(handle: SceInt32) -> SceInt32;
}
extern "C" {
/// sceMp3GetBitRate
///
/// @param handle - sceMp3 handle
///
/// @return Bitrate of the mp3
pub fn sceMp3GetBitRate(handle: SceInt32) -> SceInt32;
}
extern "C" {
/// sceMp3GetMp3ChannelNum
///
/// @param handle - sceMp3 handle
///
/// @return Number of channels of the mp3
pub fn sceMp3GetMp3ChannelNum(handle: SceInt32) -> SceInt32;
}
extern "C" {
/// sceMp3ResetPlayPosition
///
/// @param handle - sceMp3 handle
///
/// @return < 0 on error
pub fn sceMp3ResetPlayPosition(handle: SceInt32) -> SceInt32;
}
#[repr(C)]
#[derive(Copy)]
pub struct SceMpegLLI {
pub pSrc: ScePVoid,
pub pDst: ScePVoid,
pub Next: ScePVoid,
pub iSize: SceInt32,
pub __bindgen_padding_0: [u32; 9usize],
}
#[test]
fn bindgen_test_layout_SceMpegLLI() {
assert_eq!(::core::mem::size_of::<SceMpegLLI>() , 64usize , concat ! (
"Size of: " , stringify ! ( SceMpegLLI ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegLLI ) ) . pSrc as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceMpegLLI ) , "::" ,
stringify ! ( pSrc ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegLLI ) ) . pDst as * const _ as
usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( SceMpegLLI ) , "::" ,
stringify ! ( pDst ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegLLI ) ) . Next as * const _ as
usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( SceMpegLLI ) , "::" ,
stringify ! ( Next ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegLLI ) ) . iSize as * const _ as
usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! ( SceMpegLLI ) , "::" ,
stringify ! ( iSize ) ));
}
impl Clone for SceMpegLLI {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Copy)]
pub struct SceMpegYCrCbBuffer {
pub iFrameBufferHeight16: SceInt32,
pub iFrameBufferWidth16: SceInt32,
pub iUnknown: SceInt32,
pub iUnknown2: SceInt32,
pub pYBuffer: ScePVoid,
pub pYBuffer2: ScePVoid,
pub pCrBuffer: ScePVoid,
pub pCbBuffer: ScePVoid,
pub pCrBuffer2: ScePVoid,
pub pCbBuffer2: ScePVoid,
pub iFrameHeight: SceInt32,
pub iFrameWidth: SceInt32,
pub iFrameBufferWidth: SceInt32,
pub iUnknown3: [SceInt32; 11usize],
pub __bindgen_padding_0: u64,
}
#[test]
fn bindgen_test_layout_SceMpegYCrCbBuffer() {
assert_eq!(::core::mem::size_of::<SceMpegYCrCbBuffer>() , 128usize ,
concat ! ( "Size of: " , stringify ! ( SceMpegYCrCbBuffer ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegYCrCbBuffer ) ) .
iFrameBufferHeight16 as * const _ as usize } , 0usize , concat
! (
"Alignment of field: " , stringify ! ( SceMpegYCrCbBuffer ) ,
"::" , stringify ! ( iFrameBufferHeight16 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegYCrCbBuffer ) ) .
iFrameBufferWidth16 as * const _ as usize } , 4usize , concat
! (
"Alignment of field: " , stringify ! ( SceMpegYCrCbBuffer ) ,
"::" , stringify ! ( iFrameBufferWidth16 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegYCrCbBuffer ) ) . iUnknown as *
const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( SceMpegYCrCbBuffer ) ,
"::" , stringify ! ( iUnknown ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegYCrCbBuffer ) ) . iUnknown2 as *
const _ as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( SceMpegYCrCbBuffer ) ,
"::" , stringify ! ( iUnknown2 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegYCrCbBuffer ) ) . pYBuffer as *
const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( SceMpegYCrCbBuffer ) ,
"::" , stringify ! ( pYBuffer ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegYCrCbBuffer ) ) . pYBuffer2 as *
const _ as usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! ( SceMpegYCrCbBuffer ) ,
"::" , stringify ! ( pYBuffer2 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegYCrCbBuffer ) ) . pCrBuffer as *
const _ as usize } , 32usize , concat ! (
"Alignment of field: " , stringify ! ( SceMpegYCrCbBuffer ) ,
"::" , stringify ! ( pCrBuffer ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegYCrCbBuffer ) ) . pCbBuffer as *
const _ as usize } , 40usize , concat ! (
"Alignment of field: " , stringify ! ( SceMpegYCrCbBuffer ) ,
"::" , stringify ! ( pCbBuffer ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegYCrCbBuffer ) ) . pCrBuffer2 as *
const _ as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! ( SceMpegYCrCbBuffer ) ,
"::" , stringify ! ( pCrBuffer2 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegYCrCbBuffer ) ) . pCbBuffer2 as *
const _ as usize } , 56usize , concat ! (
"Alignment of field: " , stringify ! ( SceMpegYCrCbBuffer ) ,
"::" , stringify ! ( pCbBuffer2 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegYCrCbBuffer ) ) . iFrameHeight as
* const _ as usize } , 64usize , concat ! (
"Alignment of field: " , stringify ! ( SceMpegYCrCbBuffer ) ,
"::" , stringify ! ( iFrameHeight ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegYCrCbBuffer ) ) . iFrameWidth as *
const _ as usize } , 68usize , concat ! (
"Alignment of field: " , stringify ! ( SceMpegYCrCbBuffer ) ,
"::" , stringify ! ( iFrameWidth ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegYCrCbBuffer ) ) .
iFrameBufferWidth as * const _ as usize } , 72usize , concat !
(
"Alignment of field: " , stringify ! ( SceMpegYCrCbBuffer ) ,
"::" , stringify ! ( iFrameBufferWidth ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegYCrCbBuffer ) ) . iUnknown3 as *
const _ as usize } , 76usize , concat ! (
"Alignment of field: " , stringify ! ( SceMpegYCrCbBuffer ) ,
"::" , stringify ! ( iUnknown3 ) ));
}
impl Clone for SceMpegYCrCbBuffer {
fn clone(&self) -> Self { *self }
}
extern "C" {
pub fn sceMpegBaseYCrCbCopyVme(YUVBuffer: ScePVoid, Buffer: *mut SceInt32,
Type: SceInt32) -> SceInt32;
}
extern "C" {
pub fn sceMpegBaseCscInit(width: SceInt32) -> SceInt32;
}
extern "C" {
pub fn sceMpegBaseCscVme(pRGBbuffer: ScePVoid, pRGBbuffer2: ScePVoid,
width: SceInt32,
pYCrCbBuffer: *mut SceMpegYCrCbBuffer)
-> SceInt32;
}
extern "C" {
pub fn sceMpegbase_BEA18F91(pLLI: *mut SceMpegLLI) -> SceInt32;
}
/// points to "LIBMPEG"
pub type SceMpeg = ScePVoid;
/// some structure
pub type SceMpegStream = SceVoid;
/// Ringbuffer callback
pub type sceMpegRingbufferCB =
::core::option::Option<unsafe extern "C" fn(pData: ScePVoid,
iNumPackets: SceInt32,
pParam: ScePVoid)
-> SceInt32>;
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceMpegRingbuffer {
/// packets
pub iPackets: SceInt32,
/// unknown
pub iUnk0: SceUInt32,
/// unknown
pub iUnk1: SceUInt32,
/// unknown
pub iUnk2: SceUInt32,
/// unknown
pub iUnk3: SceUInt32,
/// pointer to data
pub pData: ScePVoid,
/// ringbuffer callback
pub Callback: sceMpegRingbufferCB,
/// callback param
pub pCBparam: ScePVoid,
/// unknown
pub iUnk4: SceUInt32,
/// unknown
pub iUnk5: SceUInt32,
/// mpeg id
pub pSceMpeg: SceMpeg,
}
#[test]
fn bindgen_test_layout_SceMpegRingbuffer() {
assert_eq!(::core::mem::size_of::<SceMpegRingbuffer>() , 64usize , concat
! ( "Size of: " , stringify ! ( SceMpegRingbuffer ) ));
assert_eq! (::core::mem::align_of::<SceMpegRingbuffer>() , 8usize , concat
! ( "Alignment of " , stringify ! ( SceMpegRingbuffer ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegRingbuffer ) ) . iPackets as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceMpegRingbuffer ) ,
"::" , stringify ! ( iPackets ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegRingbuffer ) ) . iUnk0 as * const
_ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( SceMpegRingbuffer ) ,
"::" , stringify ! ( iUnk0 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegRingbuffer ) ) . iUnk1 as * const
_ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( SceMpegRingbuffer ) ,
"::" , stringify ! ( iUnk1 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegRingbuffer ) ) . iUnk2 as * const
_ as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( SceMpegRingbuffer ) ,
"::" , stringify ! ( iUnk2 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegRingbuffer ) ) . iUnk3 as * const
_ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( SceMpegRingbuffer ) ,
"::" , stringify ! ( iUnk3 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegRingbuffer ) ) . pData as * const
_ as usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! ( SceMpegRingbuffer ) ,
"::" , stringify ! ( pData ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegRingbuffer ) ) . Callback as *
const _ as usize } , 32usize , concat ! (
"Alignment of field: " , stringify ! ( SceMpegRingbuffer ) ,
"::" , stringify ! ( Callback ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegRingbuffer ) ) . pCBparam as *
const _ as usize } , 40usize , concat ! (
"Alignment of field: " , stringify ! ( SceMpegRingbuffer ) ,
"::" , stringify ! ( pCBparam ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegRingbuffer ) ) . iUnk4 as * const
_ as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! ( SceMpegRingbuffer ) ,
"::" , stringify ! ( iUnk4 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegRingbuffer ) ) . iUnk5 as * const
_ as usize } , 52usize , concat ! (
"Alignment of field: " , stringify ! ( SceMpegRingbuffer ) ,
"::" , stringify ! ( iUnk5 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegRingbuffer ) ) . pSceMpeg as *
const _ as usize } , 56usize , concat ! (
"Alignment of field: " , stringify ! ( SceMpegRingbuffer ) ,
"::" , stringify ! ( pSceMpeg ) ));
}
impl Clone for SceMpegRingbuffer {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceMpegAu {
/// presentation timestamp MSB
pub iPtsMSB: SceUInt32,
/// presentation timestamp LSB
pub iPts: SceUInt32,
/// decode timestamp MSB
pub iDtsMSB: SceUInt32,
/// decode timestamp LSB
pub iDts: SceUInt32,
/// Es buffer handle
pub iEsBuffer: SceUInt32,
/// Au size
pub iAuSize: SceUInt32,
}
#[test]
fn bindgen_test_layout_SceMpegAu() {
assert_eq!(::core::mem::size_of::<SceMpegAu>() , 24usize , concat ! (
"Size of: " , stringify ! ( SceMpegAu ) ));
assert_eq! (::core::mem::align_of::<SceMpegAu>() , 4usize , concat ! (
"Alignment of " , stringify ! ( SceMpegAu ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegAu ) ) . iPtsMSB as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceMpegAu ) , "::" ,
stringify ! ( iPtsMSB ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegAu ) ) . iPts as * const _ as
usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( SceMpegAu ) , "::" ,
stringify ! ( iPts ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegAu ) ) . iDtsMSB as * const _ as
usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( SceMpegAu ) , "::" ,
stringify ! ( iDtsMSB ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegAu ) ) . iDts as * const _ as
usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( SceMpegAu ) , "::" ,
stringify ! ( iDts ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegAu ) ) . iEsBuffer as * const _ as
usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( SceMpegAu ) , "::" ,
stringify ! ( iEsBuffer ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegAu ) ) . iAuSize as * const _ as
usize } , 20usize , concat ! (
"Alignment of field: " , stringify ! ( SceMpegAu ) , "::" ,
stringify ! ( iAuSize ) ));
}
impl Clone for SceMpegAu {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceMpegAvcMode {
/// unknown, set to -1
pub iUnk0: SceInt32,
/// Decode pixelformat
pub iPixelFormat: SceInt32,
}
#[test]
fn bindgen_test_layout_SceMpegAvcMode() {
assert_eq!(::core::mem::size_of::<SceMpegAvcMode>() , 8usize , concat ! (
"Size of: " , stringify ! ( SceMpegAvcMode ) ));
assert_eq! (::core::mem::align_of::<SceMpegAvcMode>() , 4usize , concat !
( "Alignment of " , stringify ! ( SceMpegAvcMode ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegAvcMode ) ) . iUnk0 as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceMpegAvcMode ) , "::"
, stringify ! ( iUnk0 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceMpegAvcMode ) ) . iPixelFormat as *
const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( SceMpegAvcMode ) , "::"
, stringify ! ( iPixelFormat ) ));
}
impl Clone for SceMpegAvcMode {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// sceMpegInit
///
/// @return 0 if success.
pub fn sceMpegInit() -> SceInt32;
}
extern "C" {
/// sceMpegFinish
pub fn sceMpegFinish() -> SceVoid;
}
extern "C" {
/// sceMpegRingbufferQueryMemSize
///
/// @param iPackets - number of packets in the ringbuffer
///
/// @return < 0 if error else ringbuffer data size.
pub fn sceMpegRingbufferQueryMemSize(iPackets: SceInt32) -> SceInt32;
}
extern "C" {
/// sceMpegRingbufferConstruct
///
/// @param Ringbuffer - pointer to a sceMpegRingbuffer struct
/// @param iPackets - number of packets in the ringbuffer
/// @param pData - pointer to allocated memory
/// @param iSize - size of allocated memory, shoud be sceMpegRingbufferQueryMemSize(iPackets)
/// @param Callback - ringbuffer callback
/// @param pCBparam - param passed to callback
///
/// @return 0 if success.
pub fn sceMpegRingbufferConstruct(Ringbuffer: *mut SceMpegRingbuffer,
iPackets: SceInt32, pData: ScePVoid,
iSize: SceInt32,
Callback: sceMpegRingbufferCB,
pCBparam: ScePVoid) -> SceInt32;
}
extern "C" {
/// sceMpegRingbufferDestruct
///
/// @param Ringbuffer - pointer to a sceMpegRingbuffer struct
pub fn sceMpegRingbufferDestruct(Ringbuffer: *mut SceMpegRingbuffer)
-> SceVoid;
}
extern "C" {
/// sceMpegQueryMemSize
///
/// @param Ringbuffer - pointer to a sceMpegRingbuffer struct
///
/// @return < 0 if error else number of free packets in the ringbuffer.
pub fn sceMpegRingbufferAvailableSize(Ringbuffer: *mut SceMpegRingbuffer)
-> SceInt32;
}
extern "C" {
/// sceMpegRingbufferPut
///
/// @param Ringbuffer - pointer to a sceMpegRingbuffer struct
/// @param iNumPackets - num packets to put into the ringbuffer
/// @param iAvailable - free packets in the ringbuffer, should be sceMpegRingbufferAvailableSize()
///
/// @return < 0 if error else number of packets.
pub fn sceMpegRingbufferPut(Ringbuffer: *mut SceMpegRingbuffer,
iNumPackets: SceInt32, iAvailable: SceInt32)
-> SceInt32;
}
extern "C" {
/// sceMpegQueryMemSize
///
/// @param iUnk - Unknown, set to 0
///
/// @return < 0 if error else decoder data size.
pub fn sceMpegQueryMemSize(iUnk: i32) -> SceInt32;
}
extern "C" {
/// sceMpegCreate
///
/// @param Mpeg - will be filled
/// @param pData - pointer to allocated memory of size = sceMpegQueryMemSize()
/// @param iSize - size of data, should be = sceMpegQueryMemSize()
/// @param Ringbuffer - a ringbuffer
/// @param iFrameWidth - display buffer width, set to 512 if writing to framebuffer
/// @param iUnk1 - unknown, set to 0
/// @param iUnk2 - unknown, set to 0
///
/// @return 0 if success.
pub fn sceMpegCreate(Mpeg: *mut SceMpeg, pData: ScePVoid, iSize: SceInt32,
Ringbuffer: *mut SceMpegRingbuffer,
iFrameWidth: SceInt32, iUnk1: SceInt32,
iUnk2: SceInt32) -> SceInt32;
}
extern "C" {
/// sceMpegDelete
///
/// @param Mpeg - SceMpeg handle
pub fn sceMpegDelete(Mpeg: *mut SceMpeg) -> SceVoid;
}
extern "C" {
/// sceMpegQueryStreamOffset
///
/// @param Mpeg - SceMpeg handle
/// @param pBuffer - pointer to file header
/// @param iOffset - will contain stream offset in bytes, usually 2048
///
/// @return 0 if success.
pub fn sceMpegQueryStreamOffset(Mpeg: *mut SceMpeg, pBuffer: ScePVoid,
iOffset: *mut SceInt32) -> SceInt32;
}
extern "C" {
/// sceMpegQueryStreamSize
///
/// @param pBuffer - pointer to file header
/// @param iSize - will contain stream size in bytes
///
/// @return 0 if success.
pub fn sceMpegQueryStreamSize(pBuffer: ScePVoid, iSize: *mut SceInt32)
-> SceInt32;
}
extern "C" {
/// sceMpegRegistStream
///
/// @param Mpeg - SceMpeg handle
/// @param iStreamID - stream id, 0 for video, 1 for audio
/// @param iUnk - unknown, set to 0
///
/// @return 0 if error.
pub fn sceMpegRegistStream(Mpeg: *mut SceMpeg, iStreamID: SceInt32,
iUnk: SceInt32) -> *mut SceMpegStream;
}
extern "C" {
/// sceMpegUnRegistStream
///
/// @param Mpeg - SceMpeg handle
/// @param pStream - pointer to stream
pub fn sceMpegUnRegistStream(Mpeg: SceMpeg, pStream: *mut SceMpegStream)
-> SceVoid;
}
extern "C" {
/// sceMpegFlushAllStreams
///
/// @return 0 if success.
pub fn sceMpegFlushAllStream(Mpeg: *mut SceMpeg) -> SceInt32;
}
extern "C" {
/// sceMpegMallocAvcEsBuf
///
/// @return 0 if error else pointer to buffer.
pub fn sceMpegMallocAvcEsBuf(Mpeg: *mut SceMpeg) -> ScePVoid;
}
extern "C" {
/// sceMpegFreeAvcEsBuf
///
pub fn sceMpegFreeAvcEsBuf(Mpeg: *mut SceMpeg, pBuf: ScePVoid) -> SceVoid;
}
extern "C" {
/// sceMpegQueryAtracEsSize
///
/// @param Mpeg - SceMpeg handle
/// @param iEsSize - will contain size of Es
/// @param iOutSize - will contain size of decoded data
///
/// @return 0 if success.
pub fn sceMpegQueryAtracEsSize(Mpeg: *mut SceMpeg, iEsSize: *mut SceInt32,
iOutSize: *mut SceInt32) -> SceInt32;
}
extern "C" {
/// sceMpegInitAu
///
/// @param Mpeg - SceMpeg handle
/// @param pEsBuffer - prevously allocated Es buffer
/// @param pAu - will contain pointer to Au
///
/// @return 0 if success.
pub fn sceMpegInitAu(Mpeg: *mut SceMpeg, pEsBuffer: ScePVoid,
pAu: *mut SceMpegAu) -> SceInt32;
}
extern "C" {
/// sceMpegGetAvcAu
///
/// @param Mpeg - SceMpeg handle
/// @param pStream - associated stream
/// @param pAu - will contain pointer to Au
/// @param iUnk - unknown
///
/// @return 0 if success.
pub fn sceMpegGetAvcAu(Mpeg: *mut SceMpeg, pStream: *mut SceMpegStream,
pAu: *mut SceMpegAu, iUnk: *mut SceInt32)
-> SceInt32;
}
extern "C" {
/// sceMpegAvcDecodeMode
///
/// @param Mpeg - SceMpeg handle
/// @param pMode - pointer to SceMpegAvcMode struct defining the decode mode (pixelformat)
/// @return 0 if success.
pub fn sceMpegAvcDecodeMode(Mpeg: *mut SceMpeg,
pMode: *mut SceMpegAvcMode) -> SceInt32;
}
extern "C" {
/// sceMpegAvcDecode
///
/// @param Mpeg - SceMpeg handle
/// @param pAu - video Au
/// @param iFrameWidth - output buffer width, set to 512 if writing to framebuffer
/// @param pBuffer - buffer that will contain the decoded frame
/// @param iInit - will be set to 0 on first call, then 1
///
/// @return 0 if success.
pub fn sceMpegAvcDecode(Mpeg: *mut SceMpeg, pAu: *mut SceMpegAu,
iFrameWidth: SceInt32, pBuffer: ScePVoid,
iInit: *mut SceInt32) -> SceInt32;
}
extern "C" {
/// sceMpegAvcDecodeStop
///
/// @param Mpeg - SceMpeg handle
/// @param iFrameWidth - output buffer width, set to 512 if writing to framebuffer
/// @param pBuffer - buffer that will contain the decoded frame
/// @param iStatus - frame number
///
/// @return 0 if success.
pub fn sceMpegAvcDecodeStop(Mpeg: *mut SceMpeg, iFrameWidth: SceInt32,
pBuffer: ScePVoid, iStatus: *mut SceInt32)
-> SceInt32;
}
extern "C" {
/// sceMpegGetAtracAu
///
/// @param Mpeg - SceMpeg handle
/// @param pStream - associated stream
/// @param pAu - will contain pointer to Au
/// @param pUnk - unknown
///
/// @return 0 if success.
pub fn sceMpegGetAtracAu(Mpeg: *mut SceMpeg, pStream: *mut SceMpegStream,
pAu: *mut SceMpegAu, pUnk: ScePVoid) -> SceInt32;
}
extern "C" {
/// sceMpegAtracDecode
///
/// @param Mpeg - SceMpeg handle
/// @param pAu - video Au
/// @param pBuffer - buffer that will contain the decoded frame
/// @param iInit - set this to 1 on first call
///
/// @return 0 if success.
pub fn sceMpegAtracDecode(Mpeg: *mut SceMpeg, pAu: *mut SceMpegAu,
pBuffer: ScePVoid, iInit: SceInt32) -> SceInt32;
}
extern "C" {
pub fn sceNandSetWriteProtect(protectFlag: i32) -> i32;
}
extern "C" {
pub fn sceNandLock(writeFlag: i32) -> i32;
}
extern "C" {
pub fn sceNandUnlock();
}
extern "C" {
pub fn sceNandReadStatus() -> i32;
}
extern "C" {
pub fn sceNandReset(flag: i32) -> i32;
}
extern "C" {
pub fn sceNandReadId(buf: *mut c_void, size: SceSize) -> i32;
}
extern "C" {
pub fn sceNandReadPages(ppn: u32, buf: *mut c_void, buf2: *mut c_void,
count: u32) -> i32;
}
extern "C" {
pub fn sceNandGetPageSize() -> i32;
}
extern "C" {
pub fn sceNandGetPagesPerBlock() -> i32;
}
extern "C" {
pub fn sceNandGetTotalBlocks() -> i32;
}
extern "C" {
pub fn sceNandReadBlockWithRetry(ppn: u32, buf: *mut c_void,
buf2: *mut c_void) -> i32;
}
extern "C" {
pub fn sceNandIsBadBlock(ppn: u32) -> i32;
}
/// Product structure
#[repr(C)]
#[derive(Debug, Copy)]
pub struct productStruct {
/// Unknown, set to 0, other values used are 1 and 2. Not sure on what they represent
pub unknown: i32,
/// The product ID string
pub product: [u8; 9usize],
pub unk: [u8; 3usize],
}
#[test]
fn bindgen_test_layout_productStruct() {
assert_eq!(::core::mem::size_of::<productStruct>() , 16usize , concat ! (
"Size of: " , stringify ! ( productStruct ) ));
assert_eq! (::core::mem::align_of::<productStruct>() , 4usize , concat ! (
"Alignment of " , stringify ! ( productStruct ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const productStruct ) ) . unknown as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( productStruct ) , "::"
, stringify ! ( unknown ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const productStruct ) ) . product as * const _
as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( productStruct ) , "::"
, stringify ! ( product ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const productStruct ) ) . unk as * const _ as
usize } , 13usize , concat ! (
"Alignment of field: " , stringify ! ( productStruct ) , "::"
, stringify ! ( unk ) ));
}
impl Clone for productStruct {
fn clone(&self) -> Self { *self }
}
/// Peer info structure
#[repr(C)]
#[derive(Copy)]
pub struct SceNetAdhocctlPeerInfo {
pub next: *mut SceNetAdhocctlPeerInfo,
/// Nickname
pub nickname: [u8; 128usize],
/// Mac address
pub mac: [u8; 6usize],
/// Unknown
pub unknown: [u8; 6usize],
/// Time stamp
pub timestamp: u32,
}
#[test]
fn bindgen_test_layout_SceNetAdhocctlPeerInfo() {
assert_eq!(::core::mem::size_of::<SceNetAdhocctlPeerInfo>() , 160usize ,
concat ! ( "Size of: " , stringify ! ( SceNetAdhocctlPeerInfo )
));
assert_eq! (::core::mem::align_of::<SceNetAdhocctlPeerInfo>() , 8usize ,
concat ! (
"Alignment of " , stringify ! ( SceNetAdhocctlPeerInfo ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetAdhocctlPeerInfo ) ) . next as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetAdhocctlPeerInfo
) , "::" , stringify ! ( next ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetAdhocctlPeerInfo ) ) . nickname as
* const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetAdhocctlPeerInfo
) , "::" , stringify ! ( nickname ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetAdhocctlPeerInfo ) ) . mac as *
const _ as usize } , 136usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetAdhocctlPeerInfo
) , "::" , stringify ! ( mac ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetAdhocctlPeerInfo ) ) . unknown as *
const _ as usize } , 142usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetAdhocctlPeerInfo
) , "::" , stringify ! ( unknown ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetAdhocctlPeerInfo ) ) . timestamp as
* const _ as usize } , 152usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetAdhocctlPeerInfo
) , "::" , stringify ! ( timestamp ) ));
}
impl Clone for SceNetAdhocctlPeerInfo {
fn clone(&self) -> Self { *self }
}
/// Scan info structure
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceNetAdhocctlScanInfo {
pub next: *mut SceNetAdhocctlScanInfo,
/// Channel number
pub channel: i32,
/// Name of the connection (alphanumeric characters only)
pub name: [u8; 8usize],
/// The BSSID
pub bssid: [u8; 6usize],
/// Unknown
pub unknown: [u8; 2usize],
/// Unknown
pub unknown2: i32,
}
#[test]
fn bindgen_test_layout_SceNetAdhocctlScanInfo() {
assert_eq!(::core::mem::size_of::<SceNetAdhocctlScanInfo>() , 32usize ,
concat ! ( "Size of: " , stringify ! ( SceNetAdhocctlScanInfo )
));
assert_eq! (::core::mem::align_of::<SceNetAdhocctlScanInfo>() , 8usize ,
concat ! (
"Alignment of " , stringify ! ( SceNetAdhocctlScanInfo ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetAdhocctlScanInfo ) ) . next as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetAdhocctlScanInfo
) , "::" , stringify ! ( next ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetAdhocctlScanInfo ) ) . channel as *
const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetAdhocctlScanInfo
) , "::" , stringify ! ( channel ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetAdhocctlScanInfo ) ) . name as *
const _ as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetAdhocctlScanInfo
) , "::" , stringify ! ( name ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetAdhocctlScanInfo ) ) . bssid as *
const _ as usize } , 20usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetAdhocctlScanInfo
) , "::" , stringify ! ( bssid ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetAdhocctlScanInfo ) ) . unknown as *
const _ as usize } , 26usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetAdhocctlScanInfo
) , "::" , stringify ! ( unknown ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetAdhocctlScanInfo ) ) . unknown2 as
* const _ as usize } , 28usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetAdhocctlScanInfo
) , "::" , stringify ! ( unknown2 ) ));
}
impl Clone for SceNetAdhocctlScanInfo {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceNetAdhocctlGameModeInfo {
/// Number of peers (including self)
pub count: i32,
/// MAC addresses of peers (including self)
pub macs: [[u8; 6usize]; 16usize],
}
#[test]
fn bindgen_test_layout_SceNetAdhocctlGameModeInfo() {
assert_eq!(::core::mem::size_of::<SceNetAdhocctlGameModeInfo>() , 100usize
, concat ! (
"Size of: " , stringify ! ( SceNetAdhocctlGameModeInfo ) ));
assert_eq! (::core::mem::align_of::<SceNetAdhocctlGameModeInfo>() , 4usize
, concat ! (
"Alignment of " , stringify ! ( SceNetAdhocctlGameModeInfo )
));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetAdhocctlGameModeInfo ) ) . count as
* const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! (
SceNetAdhocctlGameModeInfo ) , "::" , stringify ! ( count )
));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetAdhocctlGameModeInfo ) ) . macs as
* const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! (
SceNetAdhocctlGameModeInfo ) , "::" , stringify ! ( macs ) ));
}
impl Clone for SceNetAdhocctlGameModeInfo {
fn clone(&self) -> Self { *self }
}
/// Params structure
#[repr(C)]
#[derive(Copy)]
pub struct SceNetAdhocctlParams {
/// Channel number
pub channel: i32,
/// Name of the connection
pub name: [u8; 8usize],
/// The BSSID
pub bssid: [u8; 6usize],
/// Nickname
pub nickname: [u8; 128usize],
}
#[test]
fn bindgen_test_layout_SceNetAdhocctlParams() {
assert_eq!(::core::mem::size_of::<SceNetAdhocctlParams>() , 148usize ,
concat ! ( "Size of: " , stringify ! ( SceNetAdhocctlParams )
));
assert_eq! (::core::mem::align_of::<SceNetAdhocctlParams>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( SceNetAdhocctlParams ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetAdhocctlParams ) ) . channel as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetAdhocctlParams )
, "::" , stringify ! ( channel ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetAdhocctlParams ) ) . name as *
const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetAdhocctlParams )
, "::" , stringify ! ( name ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetAdhocctlParams ) ) . bssid as *
const _ as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetAdhocctlParams )
, "::" , stringify ! ( bssid ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetAdhocctlParams ) ) . nickname as *
const _ as usize } , 18usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetAdhocctlParams )
, "::" , stringify ! ( nickname ) ));
}
impl Clone for SceNetAdhocctlParams {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// Initialise the Adhoc control library
///
/// @param stacksize - Stack size of the adhocctl thread. Set to 0x2000
/// @param priority - Priority of the adhocctl thread. Set to 0x30
/// @param product - Pass a filled in ::productStruct
///
/// @return 0 on success, < 0 on error
pub fn sceNetAdhocctlInit(stacksize: i32, priority: i32,
product: *mut productStruct) -> i32;
}
extern "C" {
/// Terminate the Adhoc control library
///
/// @return 0 on success, < on error.
pub fn sceNetAdhocctlTerm() -> i32;
}
extern "C" {
/// Connect to the Adhoc control
///
/// @param name - The name of the connection (maximum 8 alphanumeric characters).
///
/// @return 0 on success, < 0 on error.
pub fn sceNetAdhocctlConnect(name: *const u8) -> i32;
}
extern "C" {
/// Disconnect from the Adhoc control
///
/// @return 0 on success, < 0 on error
pub fn sceNetAdhocctlDisconnect() -> i32;
}
extern "C" {
/// Get the state of the Adhoc control
///
/// @param event - Pointer to an integer to receive the status. Can continue when it becomes 1.
///
/// @return 0 on success, < 0 on error
pub fn sceNetAdhocctlGetState(event: *mut i32) -> i32;
}
extern "C" {
/// Connect to the Adhoc control (as a host)
///
/// @param name - The name of the connection (maximum 8 alphanumeric characters).
///
/// @return 0 on success, < 0 on error.
pub fn sceNetAdhocctlCreate(name: *const u8) -> i32;
}
extern "C" {
/// Connect to the Adhoc control (as a client)
///
/// @param scaninfo - A valid ::SceNetAdhocctlScanInfo struct that has been filled by sceNetAchocctlGetScanInfo
///
/// @return 0 on success, < 0 on error.
pub fn sceNetAdhocctlJoin(scaninfo: *mut SceNetAdhocctlScanInfo)
-> i32;
}
extern "C" {
/// Get the adhoc ID
///
/// @param product - A pointer to a ::productStruct
///
/// @return 0 on success, < 0 on error.
pub fn sceNetAdhocctlGetAdhocId(product: *mut productStruct) -> i32;
}
extern "C" {
/// Connect to the Adhoc control game mode (as a host)
///
/// @param name - The name of the connection (maximum 8 alphanumeric characters).
/// @param unknown - Pass 1.
/// @param num - The total number of players (including the host).
/// @param macs - A pointer to a list of the participating mac addresses, host first, then clients.
/// @param timeout - Timeout in microseconds.
/// @param unknown2 - pass 0.
///
/// @return 0 on success, < 0 on error.
pub fn sceNetAdhocctlCreateEnterGameMode(name: *const u8,
unknown: i32, num: i32,
macs: *mut u8,
timeout: u32,
unknown2: i32) -> i32;
}
extern "C" {
/// Connect to the Adhoc control game mode (as a client)
///
/// @param name - The name of the connection (maximum 8 alphanumeric characters).
/// @param hostmac - The mac address of the host.
/// @param timeout - Timeout in microseconds.
/// @param unknown - pass 0.
///
/// @return 0 on success, < 0 on error.
pub fn sceNetAdhocctlJoinEnterGameMode(name: *const u8,
hostmac: *mut u8,
timeout: u32,
unknown: i32) -> i32;
}
extern "C" {
/// Get game mode information
///
/// @param gamemodeinfo - Pointer to store the info.
///
/// @return 0 on success, < 0 on error.
pub fn sceNetAdhocctlGetGameModeInfo(gamemodeinfo:
*mut SceNetAdhocctlGameModeInfo)
-> i32;
}
extern "C" {
/// Exit game mode.
///
/// @return 0 on success, < 0 on error.
pub fn sceNetAdhocctlExitGameMode() -> i32;
}
extern "C" {
/// Get a list of peers
///
/// @param length - The length of the list.
/// @param buf - An allocated area of size length.
///
/// @return 0 on success, < 0 on error.
pub fn sceNetAdhocctlGetPeerList(length: *mut i32, buf: *mut c_void)
-> i32;
}
extern "C" {
/// Get peer information
///
/// @param mac - The mac address of the peer.
/// @param size - Size of peerinfo.
/// @param peerinfo - Pointer to store the information.
///
/// @return 0 on success, < 0 on error.
pub fn sceNetAdhocctlGetPeerInfo(mac: *mut u8, size: i32,
peerinfo: *mut SceNetAdhocctlPeerInfo)
-> i32;
}
extern "C" {
/// Scan the adhoc channels
///
/// @return 0 on success, < 0 on error.
pub fn sceNetAdhocctlScan() -> i32;
}
extern "C" {
/// Get the results of a scan
///
/// @param length - The length of the list.
/// @param buf - An allocated area of size length.
///
/// @return 0 on success, < 0 on error.
pub fn sceNetAdhocctlGetScanInfo(length: *mut i32, buf: *mut c_void)
-> i32;
}
pub type sceNetAdhocctlHandler =
::core::option::Option<unsafe extern "C" fn(flag: i32, error: i32,
unknown: *mut c_void)>;
extern "C" {
/// Register an adhoc event handler
///
/// @param handler - The event handler.
/// @param unknown - Pass NULL.
///
/// @return Handler id on success, < 0 on error.
pub fn sceNetAdhocctlAddHandler(handler: sceNetAdhocctlHandler,
unknown: *mut c_void) -> i32;
}
extern "C" {
/// Delete an adhoc event handler
///
/// @param id - The handler id as returned by sceNetAdhocctlAddHandler.
///
/// @return 0 on success, < 0 on error.
pub fn sceNetAdhocctlDelHandler(id: i32) -> i32;
}
extern "C" {
/// Get nickname from a mac address
///
/// @param mac - The mac address.
/// @param nickname - Pointer to a char buffer where the nickname will be stored.
///
/// @return 0 on success, < 0 on error.
pub fn sceNetAdhocctlGetNameByAddr(mac: *mut u8,
nickname: *mut u8) -> i32;
}
extern "C" {
/// Get mac address from nickname
///
/// @param nickname - The nickname.
/// @param length - The length of the list.
/// @param buf - An allocated area of size length.
///
/// @return 0 on success, < 0 on error.
pub fn sceNetAdhocctlGetAddrByName(nickname: *mut u8,
length: *mut i32,
buf: *mut c_void) -> i32;
}
extern "C" {
/// Get Adhocctl parameter
///
/// @param params - Pointer to a ::SceNetAdhocctlParams
///
/// @return 0 on success, < 0 on error.
pub fn sceNetAdhocctlGetParameter(params: *mut SceNetAdhocctlParams)
-> i32;
}
extern "C" {
/// Initialise the adhoc library.
///
/// @return 0 on success, < 0 on error
pub fn sceNetAdhocInit() -> i32;
}
extern "C" {
/// Terminate the adhoc library
///
/// @return 0 on success, < 0 on error
pub fn sceNetAdhocTerm() -> i32;
}
extern "C" {
/// Create a PDP object.
///
/// @param mac - Your MAC address (from sceWlanGetEtherAddr)
/// @param port - Port to use, lumines uses 0x309
/// @param bufsize - Socket buffer size, lumines sets to 0x400
/// @param unk1 - Unknown, lumines sets to 0
///
/// @return The ID of the PDP object (< 0 on error)
pub fn sceNetAdhocPdpCreate(mac: *mut u8, port: u16,
bufsize: u32, unk1: i32) -> i32;
}
extern "C" {
/// Delete a PDP object.
///
/// @param id - The ID returned from ::sceNetAdhocPdpCreate
/// @param unk1 - Unknown, set to 0
///
/// @return 0 on success, < 0 on error
pub fn sceNetAdhocPdpDelete(id: i32, unk1: i32) -> i32;
}
extern "C" {
/// Set a PDP packet to a destination
///
/// @param id - The ID as returned by ::sceNetAdhocPdpCreate
/// @param destMacAddr - The destination MAC address, can be set to all 0xFF for broadcast
/// @param port - The port to send to
/// @param data - The data to send
/// @param len - The length of the data.
/// @param timeout - Timeout in microseconds.
/// @param nonblock - Set to 0 to block, 1 for non-blocking.
///
/// @return Bytes sent, < 0 on error
pub fn sceNetAdhocPdpSend(id: i32, destMacAddr: *mut u8,
port: u16, data: *mut c_void,
len: u32, timeout: u32,
nonblock: i32) -> i32;
}
extern "C" {
/// Receive a PDP packet
///
/// @param id - The ID of the PDP object, as returned by ::sceNetAdhocPdpCreate
/// @param srcMacAddr - Buffer to hold the source mac address of the sender
/// @param port - Buffer to hold the port number of he received data
/// @param data - Data buffer
/// @param dataLength - The length of the data buffer
/// @param timeout - Timeout in microseconds.
/// @param nonblock - Set to 0 to block, 1 for non-blocking.
///
/// @return Number of bytes received, < 0 on error.
pub fn sceNetAdhocPdpRecv(id: i32, srcMacAddr: *mut u8,
port: *mut u16, data: *mut c_void,
dataLength: *mut c_void, timeout: u32,
nonblock: i32) -> i32;
}
/// PDP status structure
#[repr(C)]
#[derive(Debug, Copy)]
pub struct pdpStatStruct {
/// Pointer to next PDP structure in list
pub next: *mut pdpStatStruct,
/// pdp ID
pub pdpId: i32,
/// MAC address
pub mac: [u8; 6usize],
/// Port
pub port: u16,
/// Bytes received
pub rcvdData: u32,
}
#[test]
fn bindgen_test_layout_pdpStatStruct() {
assert_eq!(::core::mem::size_of::<pdpStatStruct>() , 24usize , concat ! (
"Size of: " , stringify ! ( pdpStatStruct ) ));
assert_eq! (::core::mem::align_of::<pdpStatStruct>() , 8usize , concat ! (
"Alignment of " , stringify ! ( pdpStatStruct ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pdpStatStruct ) ) . next as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( pdpStatStruct ) , "::"
, stringify ! ( next ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pdpStatStruct ) ) . pdpId as * const _ as
usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( pdpStatStruct ) , "::"
, stringify ! ( pdpId ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pdpStatStruct ) ) . mac as * const _ as
usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( pdpStatStruct ) , "::"
, stringify ! ( mac ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pdpStatStruct ) ) . port as * const _ as
usize } , 18usize , concat ! (
"Alignment of field: " , stringify ! ( pdpStatStruct ) , "::"
, stringify ! ( port ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pdpStatStruct ) ) . rcvdData as * const _
as usize } , 20usize , concat ! (
"Alignment of field: " , stringify ! ( pdpStatStruct ) , "::"
, stringify ! ( rcvdData ) ));
}
impl Clone for pdpStatStruct {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// Get the status of all PDP objects
///
/// @param size - Pointer to the size of the stat array (e.g 20 for one structure)
/// @param stat - Pointer to a list of ::pdpStatStruct structures.
///
/// @return 0 on success, < 0 on error
pub fn sceNetAdhocGetPdpStat(size: *mut i32, stat: *mut pdpStatStruct)
-> i32;
}
extern "C" {
/// Create own game object type data.
///
/// @param data - A pointer to the game object data.
/// @param size - Size of the game data.
///
/// @return 0 on success, < 0 on error.
pub fn sceNetAdhocGameModeCreateMaster(data: *mut c_void, size: i32)
-> i32;
}
extern "C" {
/// Create peer game object type data.
///
/// @param mac - The mac address of the peer.
/// @param data - A pointer to the game object data.
/// @param size - Size of the game data.
///
/// @return The id of the replica on success, < 0 on error.
pub fn sceNetAdhocGameModeCreateReplica(mac: *mut u8,
data: *mut c_void,
size: i32) -> i32;
}
extern "C" {
/// Update own game object type data.
///
/// @return 0 on success, < 0 on error.
pub fn sceNetAdhocGameModeUpdateMaster() -> i32;
}
extern "C" {
/// Update peer game object type data.
///
/// @param id - The id of the replica returned by sceNetAdhocGameModeCreateReplica.
/// @param unk1 - Pass 0.
///
/// @return 0 on success, < 0 on error.
pub fn sceNetAdhocGameModeUpdateReplica(id: i32, unk1: i32)
-> i32;
}
extern "C" {
/// Delete own game object type data.
///
/// @return 0 on success, < 0 on error.
pub fn sceNetAdhocGameModeDeleteMaster() -> i32;
}
extern "C" {
/// Delete peer game object type data.
///
/// @param id - The id of the replica.
///
/// @return 0 on success, < 0 on error.
pub fn sceNetAdhocGameModeDeleteReplica(id: i32) -> i32;
}
extern "C" {
/// Open a PTP connection
///
/// @param srcmac - Local mac address.
/// @param srcport - Local port.
/// @param destmac - Destination mac.
/// @param destport - Destination port
/// @param bufsize - Socket buffer size
/// @param delay - Interval between retrying (microseconds).
/// @param count - Number of retries.
/// @param unk1 - Pass 0.
///
/// @return A socket ID on success, < 0 on error.
pub fn sceNetAdhocPtpOpen(srcmac: *mut u8, srcport: u16,
destmac: *mut u8, destport: u16,
bufsize: u32, delay: u32,
count: i32, unk1: i32) -> i32;
}
extern "C" {
/// Wait for connection created by sceNetAdhocPtpOpen()
///
/// @param id - A socket ID.
/// @param timeout - Timeout in microseconds.
/// @param nonblock - Set to 0 to block, 1 for non-blocking.
///
/// @return 0 on success, < 0 on error.
pub fn sceNetAdhocPtpConnect(id: i32, timeout: u32,
nonblock: i32) -> i32;
}
extern "C" {
/// Wait for an incoming PTP connection
///
/// @param srcmac - Local mac address.
/// @param srcport - Local port.
/// @param bufsize - Socket buffer size
/// @param delay - Interval between retrying (microseconds).
/// @param count - Number of retries.
/// @param queue - Connection queue length.
/// @param unk1 - Pass 0.
///
/// @return A socket ID on success, < 0 on error.
pub fn sceNetAdhocPtpListen(srcmac: *mut u8, srcport: u16,
bufsize: u32, delay: u32,
count: i32, queue: i32, unk1: i32)
-> i32;
}
extern "C" {
/// Accept an incoming PTP connection
///
/// @param id - A socket ID.
/// @param mac - Connecting peers mac.
/// @param port - Connecting peers port.
/// @param timeout - Timeout in microseconds.
/// @param nonblock - Set to 0 to block, 1 for non-blocking.
///
/// @return 0 on success, < 0 on error.
pub fn sceNetAdhocPtpAccept(id: i32, mac: *mut u8,
port: *mut u16, timeout: u32,
nonblock: i32) -> i32;
}
extern "C" {
/// Send data
///
/// @param id - A socket ID.
/// @param data - Data to send.
/// @param datasize - Size of the data.
/// @param timeout - Timeout in microseconds.
/// @param nonblock - Set to 0 to block, 1 for non-blocking.
///
/// @return 0 success, < 0 on error.
pub fn sceNetAdhocPtpSend(id: i32, data: *mut c_void,
datasize: *mut i32, timeout: u32,
nonblock: i32) -> i32;
}
extern "C" {
/// Receive data
///
/// @param id - A socket ID.
/// @param data - Buffer for the received data.
/// @param datasize - Size of the data received.
/// @param timeout - Timeout in microseconds.
/// @param nonblock - Set to 0 to block, 1 for non-blocking.
///
/// @return 0 on success, < 0 on error.
pub fn sceNetAdhocPtpRecv(id: i32, data: *mut c_void,
datasize: *mut i32, timeout: u32,
nonblock: i32) -> i32;
}
extern "C" {
/// Wait for data in the buffer to be sent
///
/// @param id - A socket ID.
/// @param timeout - Timeout in microseconds.
/// @param nonblock - Set to 0 to block, 1 for non-blocking.
///
/// @return A socket ID on success, < 0 on error.
pub fn sceNetAdhocPtpFlush(id: i32, timeout: u32,
nonblock: i32) -> i32;
}
extern "C" {
/// Close a socket
///
/// @param id - A socket ID.
/// @param unk1 - Pass 0.
///
/// @return A socket ID on success, < 0 on error.
pub fn sceNetAdhocPtpClose(id: i32, unk1: i32) -> i32;
}
/// PTP status structure
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ptpStatStruct {
/// Pointer to next PTP structure in list
pub next: *mut ptpStatStruct,
/// ptp ID
pub ptpId: i32,
/// MAC address
pub mac: [u8; 6usize],
/// Peer MAC address
pub peermac: [u8; 6usize],
/// Port
pub port: u16,
/// Peer Port
pub peerport: u16,
/// Bytes sent
pub sentData: u32,
/// Bytes received
pub rcvdData: u32,
/// Unknown
pub unk1: i32,
}
#[test]
fn bindgen_test_layout_ptpStatStruct() {
assert_eq!(::core::mem::size_of::<ptpStatStruct>() , 40usize , concat ! (
"Size of: " , stringify ! ( ptpStatStruct ) ));
assert_eq! (::core::mem::align_of::<ptpStatStruct>() , 8usize , concat ! (
"Alignment of " , stringify ! ( ptpStatStruct ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ptpStatStruct ) ) . next as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ptpStatStruct ) , "::"
, stringify ! ( next ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ptpStatStruct ) ) . ptpId as * const _ as
usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( ptpStatStruct ) , "::"
, stringify ! ( ptpId ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ptpStatStruct ) ) . mac as * const _ as
usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( ptpStatStruct ) , "::"
, stringify ! ( mac ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ptpStatStruct ) ) . peermac as * const _
as usize } , 18usize , concat ! (
"Alignment of field: " , stringify ! ( ptpStatStruct ) , "::"
, stringify ! ( peermac ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ptpStatStruct ) ) . port as * const _ as
usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! ( ptpStatStruct ) , "::"
, stringify ! ( port ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ptpStatStruct ) ) . peerport as * const _
as usize } , 26usize , concat ! (
"Alignment of field: " , stringify ! ( ptpStatStruct ) , "::"
, stringify ! ( peerport ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ptpStatStruct ) ) . sentData as * const _
as usize } , 28usize , concat ! (
"Alignment of field: " , stringify ! ( ptpStatStruct ) , "::"
, stringify ! ( sentData ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ptpStatStruct ) ) . rcvdData as * const _
as usize } , 32usize , concat ! (
"Alignment of field: " , stringify ! ( ptpStatStruct ) , "::"
, stringify ! ( rcvdData ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ptpStatStruct ) ) . unk1 as * const _ as
usize } , 36usize , concat ! (
"Alignment of field: " , stringify ! ( ptpStatStruct ) , "::"
, stringify ! ( unk1 ) ));
}
impl Clone for ptpStatStruct {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// Get the status of all PTP objects
///
/// @param size - Pointer to the size of the stat array (e.g 20 for one structure)
/// @param stat - Pointer to a list of ::ptpStatStruct structures.
///
/// @return 0 on success, < 0 on error
pub fn sceNetAdhocGetPtpStat(size: *mut i32, stat: *mut ptpStatStruct)
-> i32;
}
#[repr(u32)]
/// Matching events used in pspAdhocMatchingCallback
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum pspAdhocMatchingEvents {
PSP_ADHOC_MATCHING_EVENT_HELLO = 1,
PSP_ADHOC_MATCHING_EVENT_JOIN = 2,
PSP_ADHOC_MATCHING_EVENT_LEFT = 3,
PSP_ADHOC_MATCHING_EVENT_REJECT = 4,
PSP_ADHOC_MATCHING_EVENT_CANCEL = 5,
PSP_ADHOC_MATCHING_EVENT_ACCEPT = 6,
PSP_ADHOC_MATCHING_EVENT_COMPLETE = 7,
PSP_ADHOC_MATCHING_EVENT_TIMEOUT = 8,
PSP_ADHOC_MATCHING_EVENT_ERROR = 9,
PSP_ADHOC_MATCHING_EVENT_DISCONNECT = 10,
PSP_ADHOC_MATCHING_EVENT_DATA = 11,
PSP_ADHOC_MATCHING_EVENT_DATA_CONFIRM = 12,
PSP_ADHOC_MATCHING_EVENT_DATA_TIMEOUT = 13,
}
#[repr(u32)]
/// Matching modes used in sceNetAdhocMatchingCreate
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum pspAdhocMatchingModes {
PSP_ADHOC_MATCHING_MODE_HOST = 1,
PSP_ADHOC_MATCHING_MODE_CLIENT = 2,
PSP_ADHOC_MATCHING_MODE_PTP = 3,
}
/// Linked list for sceNetAdhocMatchingGetMembers
#[repr(C)]
#[derive(Debug, Copy)]
pub struct pspAdhocMatchingMember {
pub next: *mut pspAdhocMatchingMember,
pub mac: [u8; 6usize],
pub unknown: [u8; 2usize],
}
#[test]
fn bindgen_test_layout_pspAdhocMatchingMember() {
assert_eq!(::core::mem::size_of::<pspAdhocMatchingMember>() , 16usize ,
concat ! ( "Size of: " , stringify ! ( pspAdhocMatchingMember )
));
assert_eq! (::core::mem::align_of::<pspAdhocMatchingMember>() , 8usize ,
concat ! (
"Alignment of " , stringify ! ( pspAdhocMatchingMember ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspAdhocMatchingMember ) ) . next as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( pspAdhocMatchingMember
) , "::" , stringify ! ( next ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspAdhocMatchingMember ) ) . mac as *
const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( pspAdhocMatchingMember
) , "::" , stringify ! ( mac ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspAdhocMatchingMember ) ) . unknown as *
const _ as usize } , 14usize , concat ! (
"Alignment of field: " , stringify ! ( pspAdhocMatchingMember
) , "::" , stringify ! ( unknown ) ));
}
impl Clone for pspAdhocMatchingMember {
fn clone(&self) -> Self { *self }
}
/// Linked list for sceNetAdhocMatchingGetMembers
#[repr(C)]
#[derive(Debug, Copy)]
pub struct pspAdhocPoolStat {
/// Size of the pool
pub size: i32,
/// Maximum size of the pool
pub maxsize: i32,
/// Unused memory in the pool
pub freesize: i32,
}
#[test]
fn bindgen_test_layout_pspAdhocPoolStat() {
assert_eq!(::core::mem::size_of::<pspAdhocPoolStat>() , 12usize , concat !
( "Size of: " , stringify ! ( pspAdhocPoolStat ) ));
assert_eq! (::core::mem::align_of::<pspAdhocPoolStat>() , 4usize , concat
! ( "Alignment of " , stringify ! ( pspAdhocPoolStat ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspAdhocPoolStat ) ) . size as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( pspAdhocPoolStat ) ,
"::" , stringify ! ( size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspAdhocPoolStat ) ) . maxsize as * const
_ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( pspAdhocPoolStat ) ,
"::" , stringify ! ( maxsize ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspAdhocPoolStat ) ) . freesize as *
const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( pspAdhocPoolStat ) ,
"::" , stringify ! ( freesize ) ));
}
impl Clone for pspAdhocPoolStat {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// Initialise the Adhoc matching library
///
/// @param memsize - Internal memory pool size. Lumines uses 0x20000
///
/// @return 0 on success, < 0 on error
pub fn sceNetAdhocMatchingInit(memsize: i32) -> i32;
}
extern "C" {
/// Terminate the Adhoc matching library
///
/// @return 0 on success, < 0 on error
pub fn sceNetAdhocMatchingTerm() -> i32;
}
/// Matching callback
pub type pspAdhocMatchingCallback =
::core::option::Option<unsafe extern "C" fn(matchingid: i32,
event: i32,
mac: *mut u8,
optlen: i32,
optdata: *mut c_void)>;
extern "C" {
/// Create an Adhoc matching object
///
/// @param mode - One of ::pspAdhocMatchingModes
/// @param maxpeers - Maximum number of peers to match (only used when mode is PSP_ADHOC_MATCHING_MODE_HOST)
/// @param port - Port. Lumines uses 0x22B
/// @param bufsize - Receiving buffer size
/// @param hellodelay - Hello message send delay in microseconds (only used when mode is PSP_ADHOC_MATCHING_MODE_HOST or PSP_ADHOC_MATCHING_MODE_PTP)
/// @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)
/// @param initcount - Initial count of the of the resend counter. Lumines uses 3
/// @param msgdelay - Message send delay in microseconds
/// @param callback - Callback to be called for matching
///
/// @return ID of object on success, < 0 on error.
pub fn sceNetAdhocMatchingCreate(mode: i32, maxpeers: i32,
port: u16, bufsize: i32,
hellodelay: u32,
pingdelay: u32, initcount: i32,
msgdelay: u32,
callback: pspAdhocMatchingCallback)
-> i32;
}
extern "C" {
/// Delete an Adhoc matching object
///
/// @param matchingid - The ID returned from ::sceNetAdhocMatchingCreate
///
/// @return 0 on success, < 0 on error.
pub fn sceNetAdhocMatchingDelete(matchingid: i32) -> i32;
}
extern "C" {
/// Start a matching object
///
/// @param matchingid - The ID returned from ::sceNetAdhocMatchingCreate
/// @param evthpri - Priority of the event handler thread. Lumines uses 0x10
/// @param evthstack - Stack size of the event handler thread. Lumines uses 0x2000
/// @param inthpri - Priority of the input handler thread. Lumines uses 0x10
/// @param inthstack - Stack size of the input handler thread. Lumines uses 0x2000
/// @param optlen - Size of hellodata
/// @param optdata - Pointer to block of data passed to callback
///
/// @return 0 on success, < 0 on error
pub fn sceNetAdhocMatchingStart(matchingid: i32, evthpri: i32,
evthstack: i32, inthpri: i32,
inthstack: i32, optlen: i32,
optdata: *mut c_void) -> i32;
}
extern "C" {
/// Stop a matching object
///
/// @param matchingid - The ID returned from ::sceNetAdhocMatchingCreate
///
/// @return 0 on success, < 0 on error.
pub fn sceNetAdhocMatchingStop(matchingid: i32) -> i32;
}
extern "C" {
/// Select a matching target
///
/// @param matchingid - The ID returned from ::sceNetAdhocMatchingCreate
/// @param mac - MAC address to select
/// @param optlen - Optional data length
/// @param optdata - Pointer to the optional data
///
/// @return 0 on success, < 0 on error.
pub fn sceNetAdhocMatchingSelectTarget(matchingid: i32,
mac: *mut u8,
optlen: i32,
optdata: *mut c_void) -> i32;
}
extern "C" {
/// Cancel a matching target
///
/// @param matchingid - The ID returned from ::sceNetAdhocMatchingCreate
/// @param mac - The MAC address to cancel
///
/// @return 0 on success, < 0 on error.
pub fn sceNetAdhocMatchingCancelTarget(matchingid: i32,
mac: *mut u8) -> i32;
}
extern "C" {
/// Cancel a matching target (with optional data)
///
/// @param matchingid - The ID returned from ::sceNetAdhocMatchingCreate
/// @param mac - The MAC address to cancel
/// @param optlen - Optional data length
/// @param optdata - Pointer to the optional data
///
/// @return 0 on success, < 0 on error.
pub fn sceNetAdhocMatchingCancelTargetWithOpt(matchingid: i32,
mac: *mut u8,
optlen: i32,
optdata: *mut c_void)
-> i32;
}
extern "C" {
/// Send data to a matching target
///
/// @param matchingid - The ID returned from ::sceNetAdhocMatchingCreate
/// @param mac - The MAC address to send the data to
/// @param datalen - Length of the data
/// @param data - Pointer to the data
///
/// @return 0 on success, < 0 on error.
pub fn sceNetAdhocMatchingSendData(matchingid: i32,
mac: *mut u8, datalen: i32,
data: *mut c_void) -> i32;
}
extern "C" {
/// Abort a data send to a matching target
///
/// @param matchingid - The ID returned from ::sceNetAdhocMatchingCreate
/// @param mac - The MAC address to send the data to
///
/// @return 0 on success, < 0 on error.
pub fn sceNetAdhocMatchingAbortSendData(matchingid: i32,
mac: *mut u8) -> i32;
}
extern "C" {
/// Set the optional hello message
///
/// @param matchingid - The ID returned from ::sceNetAdhocMatchingCreate
/// @param optlen - Length of the hello data
/// @param optdata - Pointer to the hello data
///
/// @return 0 on success, < 0 on error.
pub fn sceNetAdhocMatchingSetHelloOpt(matchingid: i32,
optlen: i32,
optdata: *mut c_void) -> i32;
}
extern "C" {
/// Get the optional hello message
///
/// @param matchingid - The ID returned from ::sceNetAdhocMatchingCreate
/// @param optlen - Length of the hello data
/// @param optdata - Pointer to the hello data
///
/// @return 0 on success, < 0 on error.
pub fn sceNetAdhocMatchingGetHelloOpt(matchingid: i32,
optlen: *mut i32,
optdata: *mut c_void) -> i32;
}
extern "C" {
/// Get a list of matching members
///
/// @param matchingid - The ID returned from ::sceNetAdhocMatchingCreate
/// @param length - The length of the list.
/// @param buf - An allocated area of size length.
///
/// @return 0 on success, < 0 on error.
pub fn sceNetAdhocMatchingGetMembers(matchingid: i32,
length: *mut i32,
buf: *mut c_void) -> i32;
}
extern "C" {
/// Get the maximum memory usage by the matching library
///
/// @return The memory usage on success, < 0 on error.
pub fn sceNetAdhocMatchingGetPoolMaxAlloc() -> i32;
}
extern "C" {
/// Get the status of the memory pool used by the matching library
///
/// @param poolstat - A ::pspAdhocPoolStat.
///
/// @return 0 on success, < 0 on error.
pub fn sceNetAdhocMatchingGetPoolStat(poolstat: *mut pspAdhocPoolStat)
-> i32;
}
#[repr(C)]
#[derive(Copy)]
pub union SceNetApctlInfo {
pub name: [u8; 64usize],
pub bssid: [u8; 6usize],
pub ssid: [u8; 32usize],
pub ssidLength: u32,
pub securityType: u32,
pub strength: u8,
pub channel: u8,
pub powerSave: u8,
pub ip: [u8; 16usize],
pub subNetMask: [u8; 16usize],
pub gateway: [u8; 16usize],
pub primaryDns: [u8; 16usize],
pub secondaryDns: [u8; 16usize],
pub useProxy: u32,
pub proxyUrl: [u8; 128usize],
pub proxyPort: u16,
pub eapType: u32,
pub startBrowser: u32,
pub wifisp: u32,
_bindgen_union_align: [u32; 32usize],
}
#[test]
fn bindgen_test_layout_SceNetApctlInfo() {
assert_eq!(::core::mem::size_of::<SceNetApctlInfo>() , 128usize , concat !
( "Size of: " , stringify ! ( SceNetApctlInfo ) ));
assert_eq! (::core::mem::align_of::<SceNetApctlInfo>() , 4usize , concat !
( "Alignment of " , stringify ! ( SceNetApctlInfo ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetApctlInfo ) ) . name as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
"::" , stringify ! ( name ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetApctlInfo ) ) . bssid as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
"::" , stringify ! ( bssid ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetApctlInfo ) ) . ssid as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
"::" , stringify ! ( ssid ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetApctlInfo ) ) . ssidLength as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
"::" , stringify ! ( ssidLength ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetApctlInfo ) ) . securityType as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
"::" , stringify ! ( securityType ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetApctlInfo ) ) . strength as * const
_ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
"::" , stringify ! ( strength ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetApctlInfo ) ) . channel as * const
_ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
"::" , stringify ! ( channel ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetApctlInfo ) ) . powerSave as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
"::" , stringify ! ( powerSave ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetApctlInfo ) ) . ip as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
"::" , stringify ! ( ip ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetApctlInfo ) ) . subNetMask as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
"::" , stringify ! ( subNetMask ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetApctlInfo ) ) . gateway as * const
_ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
"::" , stringify ! ( gateway ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetApctlInfo ) ) . primaryDns as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
"::" , stringify ! ( primaryDns ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetApctlInfo ) ) . secondaryDns as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
"::" , stringify ! ( secondaryDns ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetApctlInfo ) ) . useProxy as * const
_ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
"::" , stringify ! ( useProxy ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetApctlInfo ) ) . proxyUrl as * const
_ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
"::" , stringify ! ( proxyUrl ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetApctlInfo ) ) . proxyPort as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
"::" , stringify ! ( proxyPort ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetApctlInfo ) ) . eapType as * const
_ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
"::" , stringify ! ( eapType ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetApctlInfo ) ) . startBrowser as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
"::" , stringify ! ( startBrowser ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetApctlInfo ) ) . wifisp as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetApctlInfo ) ,
"::" , stringify ! ( wifisp ) ));
}
impl Clone for SceNetApctlInfo {
fn clone(&self) -> Self { *self }
}
pub type sceNetApctlHandler =
::core::option::Option<unsafe extern "C" fn(oldState: i32,
newState: i32,
event: i32,
error: i32,
pArg: *mut c_void)>;
extern "C" {
/// Init the apctl.
///
/// @param stackSize - The stack size of the internal thread.
///
/// @param initPriority - The priority of the internal thread.
///
/// @return < 0 on error.
pub fn sceNetApctlInit(stackSize: i32, initPriority: i32)
-> i32;
}
extern "C" {
/// Terminate the apctl.
///
/// @return < 0 on error.
pub fn sceNetApctlTerm() -> i32;
}
extern "C" {
/// Get the apctl information.
///
/// @param code - One of the PSP_NET_APCTL_INFO_* defines.
///
/// @param pInfo - Pointer to a ::SceNetApctlInfo.
///
/// @return < 0 on error.
pub fn sceNetApctlGetInfo(code: i32, pInfo: *mut SceNetApctlInfo)
-> i32;
}
extern "C" {
/// Add an apctl event handler.
///
/// @param handler - Pointer to the event handler function.
///
/// @param pArg - Value to be passed to the pArg parameter of the handler function.
///
/// @return A handler id or < 0 on error.
pub fn sceNetApctlAddHandler(handler: sceNetApctlHandler,
pArg: *mut c_void) -> i32;
}
extern "C" {
/// Delete an apctl event handler.
///
/// @param handlerId - A handler as created returned from sceNetApctlAddHandler.
///
/// @return < 0 on error.
pub fn sceNetApctlDelHandler(handlerId: i32) -> i32;
}
extern "C" {
/// Connect to an access point.
///
/// @param connIndex - The index of the connection.
///
/// @return < 0 on error.
pub fn sceNetApctlConnect(connIndex: i32) -> i32;
}
extern "C" {
/// Disconnect from an access point.
///
/// @return < 0 on error.
pub fn sceNetApctlDisconnect() -> i32;
}
extern "C" {
/// Get the state of the access point connection.
///
/// @param pState - Pointer to receive the current state (one of the PSP_NET_APCTL_STATE_* defines).
///
/// @return < 0 on error.
pub fn sceNetApctlGetState(pState: *mut i32) -> i32;
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceNetMallocStat {
pub pool: i32,
pub maximum: i32,
pub free: i32,
}
#[test]
fn bindgen_test_layout_SceNetMallocStat() {
assert_eq!(::core::mem::size_of::<SceNetMallocStat>() , 12usize , concat !
( "Size of: " , stringify ! ( SceNetMallocStat ) ));
assert_eq! (::core::mem::align_of::<SceNetMallocStat>() , 4usize , concat
! ( "Alignment of " , stringify ! ( SceNetMallocStat ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetMallocStat ) ) . pool as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetMallocStat ) ,
"::" , stringify ! ( pool ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetMallocStat ) ) . maximum as * const
_ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetMallocStat ) ,
"::" , stringify ! ( maximum ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceNetMallocStat ) ) . free as * const _
as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( SceNetMallocStat ) ,
"::" , stringify ! ( free ) ));
}
impl Clone for SceNetMallocStat {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// Initialise the networking library
///
/// @param poolsize - Memory pool size (appears to be for the whole of the networking library).
/// @param calloutprio - Priority of the SceNetCallout thread.
/// @param calloutstack - Stack size of the SceNetCallout thread (defaults to 4096 on non 1.5 firmware regardless of what value is passed).
/// @param netintrprio - Priority of the SceNetNetintr thread.
/// @param netintrstack - Stack size of the SceNetNetintr thread (defaults to 4096 on non 1.5 firmware regardless of what value is passed).
///
/// @return 0 on success, < 0 on error
pub fn sceNetInit(poolsize: i32, calloutprio: i32,
calloutstack: i32, netintrprio: i32,
netintrstack: i32) -> i32;
}
extern "C" {
/// Terminate the networking library
///
/// @return 0 on success, < 0 on error
pub fn sceNetTerm() -> i32;
}
extern "C" {
/// Free (delete) thread info/data
///
/// @param thid - The thread id.
///
/// @return 0 on success, < 0 on error
pub fn sceNetFreeThreadinfo(thid: i32) -> i32;
}
extern "C" {
/// Abort a thread
///
/// @param thid - The thread id.
///
/// @return 0 on success, < 0 on error
pub fn sceNetThreadAbort(thid: i32) -> i32;
}
extern "C" {
/// Convert string to a Mac address
///
/// @param name - The string to convert.
/// @param mac - Pointer to a buffer to store the result.
pub fn sceNetEtherStrton(name: *mut u8, mac: *mut u8);
}
extern "C" {
/// Convert Mac address to a string
///
/// @param mac - The Mac address to convert.
/// @param name - Pointer to a buffer to store the result.
pub fn sceNetEtherNtostr(mac: *mut u8, name: *mut u8);
}
extern "C" {
/// Retrieve the local Mac address
///
/// @param mac - Pointer to a buffer to store the result.
///
/// @return 0 on success, < 0 on error
pub fn sceNetGetLocalEtherAddr(mac: *mut u8) -> i32;
}
extern "C" {
/// Retrieve the networking library memory usage
///
/// @param stat - Pointer to a ::SceNetMallocStat type to store the result.
///
/// @return 0 on success, < 0 on error
pub fn sceNetGetMallocStat(stat: *mut SceNetMallocStat) -> i32;
}
extern "C" {
pub fn sceNetInetInit() -> i32;
}
extern "C" {
pub fn sceNetInetTerm() -> i32;
}
pub type sa_family_t = u8;
pub type socklen_t = u32;
#[repr(C)]
#[derive(Debug, Copy)]
pub struct linger {
pub l_onoff: i32,
pub l_linger: i32,
}
#[test]
fn bindgen_test_layout_linger() {
assert_eq!(::core::mem::size_of::<linger>() , 8usize , concat ! (
"Size of: " , stringify ! ( linger ) ));
assert_eq! (::core::mem::align_of::<linger>() , 4usize , concat ! (
"Alignment of " , stringify ! ( linger ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const linger ) ) . l_onoff as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( linger ) , "::" ,
stringify ! ( l_onoff ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const linger ) ) . l_linger as * const _ as
usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( linger ) , "::" ,
stringify ! ( l_linger ) ));
}
impl Clone for linger {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct sockaddr {
pub sa_len: u8,
pub sa_family: sa_family_t,
pub sa_data: [u8; 14usize],
}
#[test]
fn bindgen_test_layout_sockaddr() {
assert_eq!(::core::mem::size_of::<sockaddr>() , 16usize , concat ! (
"Size of: " , stringify ! ( sockaddr ) ));
assert_eq! (::core::mem::align_of::<sockaddr>() , 1usize , concat ! (
"Alignment of " , stringify ! ( sockaddr ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const sockaddr ) ) . sa_len as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( sockaddr ) , "::" ,
stringify ! ( sa_len ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const sockaddr ) ) . sa_family as * const _ as
usize } , 1usize , concat ! (
"Alignment of field: " , stringify ! ( sockaddr ) , "::" ,
stringify ! ( sa_family ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const sockaddr ) ) . sa_data as * const _ as
usize } , 2usize , concat ! (
"Alignment of field: " , stringify ! ( sockaddr ) , "::" ,
stringify ! ( sa_data ) ));
}
impl Clone for sockaddr {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct iovec {
pub iov_base: *mut c_void,
pub iov_len: usize,
}
#[test]
fn bindgen_test_layout_iovec() {
assert_eq!(::core::mem::size_of::<iovec>() , 16usize , concat ! (
"Size of: " , stringify ! ( iovec ) ));
assert_eq! (::core::mem::align_of::<iovec>() , 8usize , concat ! (
"Alignment of " , stringify ! ( iovec ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const iovec ) ) . iov_base as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( iovec ) , "::" ,
stringify ! ( iov_base ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const iovec ) ) . iov_len as * const _ as usize
} , 8usize , concat ! (
"Alignment of field: " , stringify ! ( iovec ) , "::" ,
stringify ! ( iov_len ) ));
}
impl Clone for iovec {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct msghdr {
pub msg_name: *mut c_void,
pub msg_namelen: socklen_t,
pub msg_iov: *mut iovec,
pub msg_iovlen: i32,
pub msg_control: *mut c_void,
pub msg_controllen: socklen_t,
pub msg_flags: i32,
}
#[test]
fn bindgen_test_layout_msghdr() {
assert_eq!(::core::mem::size_of::<msghdr>() , 48usize , concat ! (
"Size of: " , stringify ! ( msghdr ) ));
assert_eq! (::core::mem::align_of::<msghdr>() , 8usize , concat ! (
"Alignment of " , stringify ! ( msghdr ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const msghdr ) ) . msg_name as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( msghdr ) , "::" ,
stringify ! ( msg_name ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const msghdr ) ) . msg_namelen as * const _ as
usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( msghdr ) , "::" ,
stringify ! ( msg_namelen ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const msghdr ) ) . msg_iov as * const _ as
usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( msghdr ) , "::" ,
stringify ! ( msg_iov ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const msghdr ) ) . msg_iovlen as * const _ as
usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! ( msghdr ) , "::" ,
stringify ! ( msg_iovlen ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const msghdr ) ) . msg_control as * const _ as
usize } , 32usize , concat ! (
"Alignment of field: " , stringify ! ( msghdr ) , "::" ,
stringify ! ( msg_control ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const msghdr ) ) . msg_controllen as * const _
as usize } , 40usize , concat ! (
"Alignment of field: " , stringify ! ( msghdr ) , "::" ,
stringify ! ( msg_controllen ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const msghdr ) ) . msg_flags as * const _ as
usize } , 44usize , concat ! (
"Alignment of field: " , stringify ! ( msghdr ) , "::" ,
stringify ! ( msg_flags ) ));
}
impl Clone for msghdr {
fn clone(&self) -> Self { *self }
}
extern "C" {
pub fn accept(arg1: i32, arg2: *mut sockaddr, arg3: *mut socklen_t)
-> i32;
}
extern "C" {
pub fn bind(arg1: i32, arg2: *const sockaddr, arg3: socklen_t)
-> i32;
}
extern "C" {
pub fn connect(arg1: i32, arg2: *const sockaddr, arg3: socklen_t)
-> i32;
}
extern "C" {
pub fn getpeername(arg1: i32, arg2: *mut sockaddr,
arg3: *mut socklen_t) -> i32;
}
extern "C" {
pub fn getsockname(arg1: i32, arg2: *mut sockaddr,
arg3: *mut socklen_t) -> i32;
}
extern "C" {
pub fn getsockopt(arg1: i32, arg2: i32, arg3: i32,
arg4: *mut c_void, arg5: *mut socklen_t) -> i32;
}
extern "C" {
pub fn listen(arg1: i32, arg2: i32) -> i32;
}
extern "C" {
pub fn recv(arg1: i32, arg2: *mut c_void, arg3: usize,
arg4: i32) -> isize;
}
extern "C" {
pub fn recvfrom(arg1: i32, arg2: *mut c_void, arg3: usize,
arg4: i32, arg5: *mut sockaddr, arg6: *mut socklen_t)
-> isize;
}
extern "C" {
pub fn recvmsg(s: i32, msg: *mut msghdr, flags: i32) -> isize;
}
extern "C" {
pub fn send(arg1: i32, arg2: *const c_void, arg3: usize,
arg4: i32) -> isize;
}
extern "C" {
pub fn sendto(arg1: i32, arg2: *const c_void, arg3: usize,
arg4: i32, arg5: *const sockaddr, arg6: socklen_t)
-> isize;
}
extern "C" {
pub fn sendmsg(s: i32, msg: *const msghdr, flags: i32) -> isize;
}
extern "C" {
pub fn setsockopt(arg1: i32, arg2: i32, arg3: i32,
arg4: *const c_void, arg5: socklen_t) -> i32;
}
extern "C" {
pub fn shutdown(arg1: i32, arg2: i32) -> i32;
}
extern "C" {
pub fn socket(arg1: i32, arg2: i32, arg3: i32) -> i32;
}
extern "C" {
pub fn sceNetInetAccept(s: i32, addr: *mut sockaddr,
addrlen: *mut socklen_t) -> i32;
}
extern "C" {
pub fn sceNetInetBind(s: i32, my_addr: *const sockaddr,
addrlen: socklen_t) -> i32;
}
extern "C" {
pub fn sceNetInetConnect(s: i32, serv_addr: *const sockaddr,
addrlen: socklen_t) -> i32;
}
extern "C" {
pub fn sceNetInetGetsockopt(s: i32, level: i32, optname: i32,
optval: *mut c_void, optlen: *mut socklen_t)
-> i32;
}
extern "C" {
pub fn sceNetInetListen(s: i32, backlog: i32) -> i32;
}
extern "C" {
pub fn sceNetInetRecv(s: i32, buf: *mut c_void, len: usize,
flags: i32) -> isize;
}
extern "C" {
pub fn sceNetInetRecvfrom(s: i32, buf: *mut c_void, flags: usize,
arg1: i32, from: *mut sockaddr,
fromlen: *mut socklen_t) -> isize;
}
extern "C" {
pub fn sceNetInetRecvmsg(s: i32, msg: *mut msghdr, flags: i32)
-> isize;
}
extern "C" {
pub fn sceNetInetSend(s: i32, buf: *const c_void, len: usize,
flags: i32) -> isize;
}
extern "C" {
pub fn sceNetInetSendto(s: i32, buf: *const c_void, len: usize,
flags: i32, to: *const sockaddr,
tolen: socklen_t) -> isize;
}
extern "C" {
pub fn sceNetInetSendmsg(s: i32, msg: *const msghdr, flags: i32)
-> isize;
}
extern "C" {
pub fn sceNetInetSetsockopt(s: i32, level: i32, optname: i32,
optval: *const c_void, optlen: socklen_t)
-> i32;
}
extern "C" {
pub fn sceNetInetShutdown(s: i32, how: i32) -> i32;
}
extern "C" {
pub fn sceNetInetSocket(domain: i32, type_: i32,
protocol: i32) -> i32;
}
extern "C" {
pub fn sceNetInetClose(s: i32) -> i32;
}
extern "C" {
pub fn sceNetInetGetErrno() -> i32;
}
extern "C" {
pub fn sceNetInetGetsockname(s: i32, name: *mut sockaddr,
namelen: *mut socklen_t) -> i32;
}
extern "C" {
pub fn sceNetInetGetpeername(s: i32, name: *mut sockaddr,
namelen: *mut socklen_t) -> i32;
}
pub type in_addr_t = u32;
pub type in_port_t = u16;
#[repr(C, packed)]
#[derive(Debug, Copy)]
pub struct in_addr {
pub s_addr: in_addr_t,
}
#[test]
fn bindgen_test_layout_in_addr() {
assert_eq!(::core::mem::size_of::<in_addr>() , 4usize , concat ! (
"Size of: " , stringify ! ( in_addr ) ));
assert_eq! (::core::mem::align_of::<in_addr>() , 1usize , concat ! (
"Alignment of " , stringify ! ( in_addr ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const in_addr ) ) . s_addr as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( in_addr ) , "::" ,
stringify ! ( s_addr ) ));
}
impl Clone for in_addr {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct sockaddr_in {
pub sin_len: u8,
pub sin_family: sa_family_t,
pub sin_port: in_port_t,
pub sin_addr: in_addr,
pub sin_zero: [i8; 8usize],
}
#[test]
fn bindgen_test_layout_sockaddr_in() {
assert_eq!(::core::mem::size_of::<sockaddr_in>() , 16usize , concat ! (
"Size of: " , stringify ! ( sockaddr_in ) ));
assert_eq! (::core::mem::align_of::<sockaddr_in>() , 2usize , concat ! (
"Alignment of " , stringify ! ( sockaddr_in ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const sockaddr_in ) ) . sin_len as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( sockaddr_in ) , "::" ,
stringify ! ( sin_len ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const sockaddr_in ) ) . sin_family as * const _
as usize } , 1usize , concat ! (
"Alignment of field: " , stringify ! ( sockaddr_in ) , "::" ,
stringify ! ( sin_family ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const sockaddr_in ) ) . sin_port as * const _
as usize } , 2usize , concat ! (
"Alignment of field: " , stringify ! ( sockaddr_in ) , "::" ,
stringify ! ( sin_port ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const sockaddr_in ) ) . sin_addr as * const _
as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( sockaddr_in ) , "::" ,
stringify ! ( sin_addr ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const sockaddr_in ) ) . sin_zero as * const _
as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( sockaddr_in ) , "::" ,
stringify ! ( sin_zero ) ));
}
impl Clone for sockaddr_in {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Copy)]
pub struct ip_opts {
pub ip_dst: in_addr,
pub ip_opts: [i8; 40usize],
}
#[test]
fn bindgen_test_layout_ip_opts() {
assert_eq!(::core::mem::size_of::<ip_opts>() , 44usize , concat ! (
"Size of: " , stringify ! ( ip_opts ) ));
assert_eq! (::core::mem::align_of::<ip_opts>() , 1usize , concat ! (
"Alignment of " , stringify ! ( ip_opts ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ip_opts ) ) . ip_dst as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ip_opts ) , "::" ,
stringify ! ( ip_dst ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ip_opts ) ) . ip_opts as * const _ as
usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( ip_opts ) , "::" ,
stringify ! ( ip_opts ) ));
}
impl Clone for ip_opts {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ip_mreq {
pub imr_multiaddr: in_addr,
pub imr_interface: in_addr,
}
#[test]
fn bindgen_test_layout_ip_mreq() {
assert_eq!(::core::mem::size_of::<ip_mreq>() , 8usize , concat ! (
"Size of: " , stringify ! ( ip_mreq ) ));
assert_eq! (::core::mem::align_of::<ip_mreq>() , 1usize , concat ! (
"Alignment of " , stringify ! ( ip_mreq ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ip_mreq ) ) . imr_multiaddr as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ip_mreq ) , "::" ,
stringify ! ( imr_multiaddr ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ip_mreq ) ) . imr_interface as * const _
as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( ip_mreq ) , "::" ,
stringify ! ( imr_interface ) ));
}
impl Clone for ip_mreq {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// Inititalise the resolver library
///
/// @return 0 on sucess, < 0 on error.
pub fn sceNetResolverInit() -> i32;
}
extern "C" {
/// Create a resolver object
///
/// @param rid - Pointer to receive the resolver id
/// @param buf - Temporary buffer
/// @param buflen - Length of the temporary buffer
///
/// @return 0 on success, < 0 on error
pub fn sceNetResolverCreate(rid: *mut i32, buf: *mut c_void,
buflen: SceSize) -> i32;
}
extern "C" {
/// Delete a resolver
///
/// @param rid - The resolver to delete
///
/// @return 0 on success, < 0 on error
pub fn sceNetResolverDelete(rid: i32) -> i32;
}
extern "C" {
/// Begin a name to address lookup
///
/// @param rid - Resolver id
/// @param hostname - Name to resolve
/// @param addr - Pointer to in_addr structure to receive the address
/// @param timeout - Number of seconds before timeout
/// @param retry - Number of retires
///
/// @return 0 on success, < 0 on error
pub fn sceNetResolverStartNtoA(rid: i32, hostname: *const u8,
addr: *mut in_addr, timeout: u32,
retry: i32) -> i32;
}
extern "C" {
/// Begin a address to name lookup
///
/// @param rid -Resolver id
/// @param addr - Pointer to the address to resolve
/// @param hostname - Buffer to receive the name
/// @param hostname_len - Length of the buffer
/// @param timeout - Number of seconds before timeout
/// @param retry - Number of retries
///
/// @return 0 on success, < 0 on error
pub fn sceNetResolverStartAtoN(rid: i32, addr: *const in_addr,
hostname: *mut u8,
hostname_len: SceSize, timeout: u32,
retry: i32) -> i32;
}
extern "C" {
/// Stop a resolver operation
///
/// @param rid - Resolver id
///
/// @return 0 on success, < 0 on error
pub fn sceNetResolverStop(rid: i32) -> i32;
}
extern "C" {
/// Terminate the resolver library
///
/// @return 0 on success, < 0 on error
pub fn sceNetResolverTerm() -> i32;
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct PspOpenPSID {
pub data: [u8; 16usize],
}
#[test]
fn bindgen_test_layout_PspOpenPSID() {
assert_eq!(::core::mem::size_of::<PspOpenPSID>() , 16usize , concat ! (
"Size of: " , stringify ! ( PspOpenPSID ) ));
assert_eq! (::core::mem::align_of::<PspOpenPSID>() , 1usize , concat ! (
"Alignment of " , stringify ! ( PspOpenPSID ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspOpenPSID ) ) . data as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( PspOpenPSID ) , "::" ,
stringify ! ( data ) ));
}
impl Clone for PspOpenPSID {
fn clone(&self) -> Self { *self }
}
extern "C" {
pub fn sceOpenPSIDGetOpenPSID(openpsid: *mut PspOpenPSID) -> i32;
}
/// Power Callback Function Definition
///
/// @param unknown - unknown function, appears to cycle between 1,2 and 3
/// @param powerInfo - combination of PSP_POWER_CB_ flags
pub type powerCallback_t =
::core::option::Option<unsafe extern "C" fn(unknown: i32,
powerInfo: i32)>;
extern "C" {
/// Register Power Callback Function
///
/// @param slot - slot of the callback in the list, 0 to 15, pass -1 to get an auto assignment.
/// @param cbid - callback id from calling sceKernelCreateCallback
///
/// @return 0 on success, the slot number if -1 is passed, < 0 on error.
pub fn scePowerRegisterCallback(slot: i32, cbid: SceUID) -> i32;
}
extern "C" {
/// Unregister Power Callback Function
///
/// @param slot - slot of the callback
///
/// @return 0 on success, < 0 on error.
pub fn scePowerUnregisterCallback(slot: i32) -> i32;
}
extern "C" {
/// Check if unit is plugged in
///
/// @return 1 if plugged in, 0 if not plugged in, < 0 on error.
pub fn scePowerIsPowerOnline() -> i32;
}
extern "C" {
/// Check if a battery is present
///
/// @return 1 if battery present, 0 if battery not present, < 0 on error.
pub fn scePowerIsBatteryExist() -> i32;
}
extern "C" {
/// Check if the battery is charging
///
/// @return 1 if battery charging, 0 if battery not charging, < 0 on error.
pub fn scePowerIsBatteryCharging() -> i32;
}
extern "C" {
/// Get the status of the battery charging
pub fn scePowerGetBatteryChargingStatus() -> i32;
}
extern "C" {
/// Check if the battery is low
///
/// @return 1 if the battery is low, 0 if the battery is not low, < 0 on error.
pub fn scePowerIsLowBattery() -> i32;
}
extern "C" {
/// Get battery life as integer percent
///
/// @return Battery charge percentage (0-100), < 0 on error.
pub fn scePowerGetBatteryLifePercent() -> i32;
}
extern "C" {
/// Get battery life as time
///
/// @return Battery life in minutes, < 0 on error.
pub fn scePowerGetBatteryLifeTime() -> i32;
}
extern "C" {
/// Get temperature of the battery
pub fn scePowerGetBatteryTemp() -> i32;
}
extern "C" {
/// unknown? - crashes PSP in usermode
pub fn scePowerGetBatteryElec() -> i32;
}
extern "C" {
/// Get battery volt level
pub fn scePowerGetBatteryVolt() -> i32;
}
extern "C" {
/// Set CPU Frequency
/// @param cpufreq - new CPU frequency, valid values are 1 - 333
pub fn scePowerSetCpuClockFrequency(cpufreq: i32) -> i32;
}
extern "C" {
/// Set Bus Frequency
/// @param busfreq - new BUS frequency, valid values are 1 - 167
pub fn scePowerSetBusClockFrequency(busfreq: i32) -> i32;
}
extern "C" {
/// Alias for scePowerGetCpuClockFrequencyInt
/// @return frequency as int
pub fn scePowerGetCpuClockFrequency() -> i32;
}
extern "C" {
/// Get CPU Frequency as Integer
/// @return frequency as int
pub fn scePowerGetCpuClockFrequencyInt() -> i32;
}
extern "C" {
/// Get CPU Frequency as Float
/// @return frequency as float
pub fn scePowerGetCpuClockFrequencyFloat() -> f32;
}
extern "C" {
/// Alias for scePowerGetBusClockFrequencyInt
/// @return frequency as int
pub fn scePowerGetBusClockFrequency() -> i32;
}
extern "C" {
/// Get Bus fequency as Integer
/// @return frequency as int
pub fn scePowerGetBusClockFrequencyInt() -> i32;
}
extern "C" {
/// Get Bus frequency as Float
/// @return frequency as float
pub fn scePowerGetBusClockFrequencyFloat() -> f32;
}
extern "C" {
/// Set Clock Frequencies
///
/// @param pllfreq - pll frequency, valid from 19-333
/// @param cpufreq - cpu frequency, valid from 1-333
/// @param busfreq - bus frequency, valid from 1-167
///
/// and:
///
/// cpufreq <= pllfreq
/// busfreq*2 <= pllfreq
///
pub fn scePowerSetClockFrequency(pllfreq: i32, cpufreq: i32,
busfreq: i32) -> i32;
}
extern "C" {
/// Lock power switch
///
/// Note: if the power switch is toggled while locked
/// it will fire immediately after being unlocked.
///
/// @param unknown - pass 0
///
/// @return 0 on success, < 0 on error.
pub fn scePowerLock(unknown: i32) -> i32;
}
extern "C" {
/// Unlock power switch
///
/// @param unknown - pass 0
///
/// @return 0 on success, < 0 on error.
pub fn scePowerUnlock(unknown: i32) -> i32;
}
extern "C" {
/// Generate a power tick, preventing unit from
/// powering off and turning off display.
///
/// @param type - Either PSP_POWER_TICK_ALL, PSP_POWER_TICK_SUSPEND or PSP_POWER_TICK_DISPLAY
///
/// @return 0 on success, < 0 on error.
pub fn scePowerTick(type_: i32) -> i32;
}
extern "C" {
/// Get Idle timer
///
pub fn scePowerGetIdleTimer() -> i32;
}
extern "C" {
/// Enable Idle timer
///
/// @param unknown - pass 0
pub fn scePowerIdleTimerEnable(unknown: i32) -> i32;
}
extern "C" {
/// Disable Idle timer
///
/// @param unknown - pass 0
pub fn scePowerIdleTimerDisable(unknown: i32) -> i32;
}
extern "C" {
/// Request the PSP to go into standby
///
/// @return 0 always
pub fn scePowerRequestStandby() -> i32;
}
extern "C" {
/// Request the PSP to go into suspend
///
/// @return 0 always
pub fn scePowerRequestSuspend() -> i32;
}
extern "C" {
pub fn gprof_cleanup();
}
#[repr(u32)]
/// Key types
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum RegKeyTypes {
REG_TYPE_DIR = 1,
REG_TYPE_INT = 2,
REG_TYPE_STR = 3,
REG_TYPE_BIN = 4,
}
/// Typedef for a registry handle
pub type REGHANDLE = u32;
/// Struct used to open a registry
#[repr(C)]
#[derive(Copy)]
pub struct RegParam {
pub regtype: u32,
/// Seemingly never used, set to ::SYSTEM_REGISTRY
pub name: [u8; 256usize],
/// Length of the name
pub namelen: u32,
/// Unknown, set to 1
pub unk2: u32,
/// Unknown, set to 1
pub unk3: u32,
}
#[test]
fn bindgen_test_layout_RegParam() {
assert_eq!(::core::mem::size_of::<RegParam>() , 272usize , concat ! (
"Size of: " , stringify ! ( RegParam ) ));
assert_eq! (::core::mem::align_of::<RegParam>() , 4usize , concat ! (
"Alignment of " , stringify ! ( RegParam ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const RegParam ) ) . regtype as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( RegParam ) , "::" ,
stringify ! ( regtype ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const RegParam ) ) . name as * const _ as usize
} , 4usize , concat ! (
"Alignment of field: " , stringify ! ( RegParam ) , "::" ,
stringify ! ( name ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const RegParam ) ) . namelen as * const _ as
usize } , 260usize , concat ! (
"Alignment of field: " , stringify ! ( RegParam ) , "::" ,
stringify ! ( namelen ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const RegParam ) ) . unk2 as * const _ as usize
} , 264usize , concat ! (
"Alignment of field: " , stringify ! ( RegParam ) , "::" ,
stringify ! ( unk2 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const RegParam ) ) . unk3 as * const _ as usize
} , 268usize , concat ! (
"Alignment of field: " , stringify ! ( RegParam ) , "::" ,
stringify ! ( unk3 ) ));
}
impl Clone for RegParam {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// Open the registry
///
/// @param reg - A filled in ::RegParam structure
/// @param mode - Open mode (set to 1)
/// @param h - Pointer to a REGHANDLE to receive the registry handle
///
/// @return 0 on success, < 0 on error
pub fn sceRegOpenRegistry(reg: *mut RegParam, mode: i32,
h: *mut REGHANDLE) -> i32;
}
extern "C" {
/// Flush the registry to disk
///
/// @param h - The open registry handle
///
/// @return 0 on success, < 0 on error
pub fn sceRegFlushRegistry(h: REGHANDLE) -> i32;
}
extern "C" {
/// Close the registry
///
/// @param h - The open registry handle
///
/// @return 0 on success, < 0 on error
pub fn sceRegCloseRegistry(h: REGHANDLE) -> i32;
}
extern "C" {
/// Open a registry directory
///
/// @param h - The open registry handle
/// @param name - The path to the dir to open (e.g. /CONFIG/SYSTEM)
/// @param mode - Open mode (can be 1 or 2, probably read or read/write
/// @param hd - Pointer to a REGHANDLE to receive the registry dir handle
///
/// @return 0 on success, < 0 on error
pub fn sceRegOpenCategory(h: REGHANDLE, name: *const u8,
mode: i32, hd: *mut REGHANDLE) -> i32;
}
extern "C" {
/// Remove a registry dir
///
/// @param h - The open registry dir handle
/// @param name - The name of the key
///
/// @return 0 on success, < 0 on error
pub fn sceRegRemoveCategory(h: REGHANDLE, name: *const u8)
-> i32;
}
extern "C" {
/// Close the registry directory
///
/// @param hd - The open registry dir handle
///
/// @return 0 on success, < 0 on error
pub fn sceRegCloseCategory(hd: REGHANDLE) -> i32;
}
extern "C" {
/// Flush the registry directory to disk
///
/// @param hd - The open registry dir handle
///
/// @return 0 on success, < 0 on error
pub fn sceRegFlushCategory(hd: REGHANDLE) -> i32;
}
extern "C" {
/// Get a key's information
///
/// @param hd - The open registry dir handle
/// @param name - Name of the key
/// @param hk - Pointer to a REGHANDLE to get registry key handle
/// @param type - Type of the key, on of ::RegKeyTypes
/// @param size - The size of the key's value in bytes
///
/// @return 0 on success, < 0 on error
pub fn sceRegGetKeyInfo(hd: REGHANDLE, name: *const u8,
hk: *mut REGHANDLE, type_: *mut u32,
size: *mut SceSize) -> i32;
}
extern "C" {
/// Get a key's information by name
///
/// @param hd - The open registry dir handle
/// @param name - Name of the key
/// @param type - Type of the key, on of ::RegKeyTypes
/// @param size - The size of the key's value in bytes
///
/// @return 0 on success, < 0 on error
pub fn sceRegGetKeyInfoByName(hd: REGHANDLE, name: *const u8,
type_: *mut u32, size: *mut SceSize)
-> i32;
}
extern "C" {
/// Get a key's value
///
/// @param hd - The open registry dir handle
/// @param hk - The open registry key handler (from ::sceRegGetKeyInfo)
/// @param buf - Buffer to hold the value
/// @param size - The size of the buffer
///
/// @return 0 on success, < 0 on error
pub fn sceRegGetKeyValue(hd: REGHANDLE, hk: REGHANDLE, buf: *mut c_void,
size: SceSize) -> i32;
}
extern "C" {
/// Get a key's value by name
///
/// @param hd - The open registry dir handle
/// @param name - The key name
/// @param buf - Buffer to hold the value
/// @param size - The size of the buffer
///
/// @return 0 on success, < 0 on error
pub fn sceRegGetKeyValueByName(hd: REGHANDLE, name: *const u8,
buf: *mut c_void, size: SceSize)
-> i32;
}
extern "C" {
/// Set a key's value
///
/// @param hd - The open registry dir handle
/// @param name - The key name
/// @param buf - Buffer to hold the value
/// @param size - The size of the buffer
///
/// @return 0 on success, < 0 on error
pub fn sceRegSetKeyValue(hd: REGHANDLE, name: *const u8,
buf: *const c_void, size: SceSize) -> i32;
}
extern "C" {
/// Get number of subkeys in the current dir
///
/// @param hd - The open registry dir handle
/// @param num - Pointer to an integer to receive the number
///
/// @return 0 on success, < 0 on error
pub fn sceRegGetKeysNum(hd: REGHANDLE, num: *mut i32) -> i32;
}
extern "C" {
/// Get the key names in the current directory
///
/// @param hd - The open registry dir handle
/// @param buf - Buffer to hold the NUL terminated strings, should be num*REG_KEYNAME_SIZE
/// @param num - Number of elements in buf
///
/// @return 0 on success, < 0 on error
pub fn sceRegGetKeys(hd: REGHANDLE, buf: *mut u8, num: i32)
-> i32;
}
extern "C" {
/// Create a key
///
/// @param hd - The open registry dir handle
/// @param name - Name of the key to create
/// @param type - Type of key (note cannot be a directory type)
/// @param size - Size of the allocated value space
///
/// @return 0 on success, < 0 on error
pub fn sceRegCreateKey(hd: REGHANDLE, name: *const u8,
type_: i32, size: SceSize) -> i32;
}
extern "C" {
/// Remove a registry (HONESTLY, DO NOT USE)
///
/// @param reg - Filled out registry parameter
///
/// @return 0 on success, < 0 on error
pub fn sceRegRemoveRegistry(reg: *mut RegParam) -> i32;
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct pspTime {
pub year: u16,
pub month: u16,
pub day: u16,
pub hour: u16,
pub minutes: u16,
pub seconds: u16,
pub microseconds: u32,
}
#[test]
fn bindgen_test_layout_pspTime() {
assert_eq!(::core::mem::size_of::<pspTime>() , 16usize , concat ! (
"Size of: " , stringify ! ( pspTime ) ));
assert_eq! (::core::mem::align_of::<pspTime>() , 4usize , concat ! (
"Alignment of " , stringify ! ( pspTime ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspTime ) ) . year as * const _ as usize
} , 0usize , concat ! (
"Alignment of field: " , stringify ! ( pspTime ) , "::" ,
stringify ! ( year ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspTime ) ) . month as * const _ as usize
} , 2usize , concat ! (
"Alignment of field: " , stringify ! ( pspTime ) , "::" ,
stringify ! ( month ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspTime ) ) . day as * const _ as usize }
, 4usize , concat ! (
"Alignment of field: " , stringify ! ( pspTime ) , "::" ,
stringify ! ( day ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspTime ) ) . hour as * const _ as usize
} , 6usize , concat ! (
"Alignment of field: " , stringify ! ( pspTime ) , "::" ,
stringify ! ( hour ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspTime ) ) . minutes as * const _ as
usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( pspTime ) , "::" ,
stringify ! ( minutes ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspTime ) ) . seconds as * const _ as
usize } , 10usize , concat ! (
"Alignment of field: " , stringify ! ( pspTime ) , "::" ,
stringify ! ( seconds ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspTime ) ) . microseconds as * const _
as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( pspTime ) , "::" ,
stringify ! ( microseconds ) ));
}
impl Clone for pspTime {
fn clone(&self) -> Self { *self }
}
#[repr(i32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum pspRtcCheckValidErrors {
PSP_TIME_INVALID_YEAR = -1,
PSP_TIME_INVALID_MONTH = -2,
PSP_TIME_INVALID_DAY = -3,
PSP_TIME_INVALID_HOUR = -4,
PSP_TIME_INVALID_MINUTES = -5,
PSP_TIME_INVALID_SECONDS = -6,
PSP_TIME_INVALID_MICROSECONDS = -7,
}
extern "C" {
/// Get the resolution of the tick counter
///
/// @return # of ticks per second
pub fn sceRtcGetTickResolution() -> u32;
}
extern "C" {
/// Get current tick count
///
/// @param tick - pointer to u64 to receive tick count
/// @return 0 on success, < 0 on error
pub fn sceRtcGetCurrentTick(tick: *mut u64) -> i32;
}
extern "C" {
/// Get current tick count, adjusted for local time zone
///
/// @param time - pointer to pspTime struct to receive time
/// @param tz - time zone to adjust to (minutes from UTC)
/// @return 0 on success, < 0 on error
pub fn sceRtcGetCurrentClock(time: *mut pspTime, tz: i32) -> i32;
}
extern "C" {
/// Get current local time into a pspTime struct
///
/// @param time - pointer to pspTime struct to receive time
/// @return 0 on success, < 0 on error
pub fn sceRtcGetCurrentClockLocalTime(time: *mut pspTime) -> i32;
}
extern "C" {
/// Convert a UTC-based tickcount into a local time tick count
///
/// @param tickUTC - pointer to u64 tick in UTC time
/// @param tickLocal - pointer to u64 to receive tick in local time
/// @return 0 on success, < 0 on error
pub fn sceRtcConvertUtcToLocalTime(tickUTC: *const u64,
tickLocal: *mut u64) -> i32;
}
extern "C" {
/// Convert a local time based tickcount into a UTC-based tick count
///
/// @param tickLocal - pointer to u64 tick in local time
/// @param tickUTC - pointer to u64 to receive tick in UTC based time
/// @return 0 on success, < 0 on error
pub fn sceRtcConvertLocalTimeToUTC(tickLocal: *const u64,
tickUTC: *mut u64) -> i32;
}
extern "C" {
/// Check if a year is a leap year
///
/// @param year - year to check if is a leap year
/// @return 1 on leapyear, 0 if not
pub fn sceRtcIsLeapYear(year: i32) -> i32;
}
extern "C" {
/// Get number of days in a specific month
///
/// @param year - year in which to check (accounts for leap year)
/// @param month - month to get number of days for
/// @return # of days in month, <0 on error (?)
pub fn sceRtcGetDaysInMonth(year: i32, month: i32) -> i32;
}
extern "C" {
/// Get day of the week for a date
///
/// @param year - year in which to check (accounts for leap year)
/// @param month - month that day is in
/// @param day - day to get day of week for
/// @return day of week with 0 representing Monday
pub fn sceRtcGetDayOfWeek(year: i32, month: i32, day: i32)
-> i32;
}
extern "C" {
/// Validate pspDate component ranges
///
/// @param date - pointer to pspDate struct to be checked
/// @return 0 on success, one of ::pspRtcCheckValidErrors on error
pub fn sceRtcCheckValid(date: *const pspTime) -> i32;
}
extern "C" {
/// Set a pspTime struct based on ticks
///
/// @param date - pointer to pspTime struct to set
/// @param tick - pointer to ticks to convert
/// @return 0 on success, < 0 on error
pub fn sceRtcSetTick(date: *mut pspTime, tick: *const u64) -> i32;
}
extern "C" {
/// Set ticks based on a pspTime struct
///
/// @param date - pointer to pspTime to convert
/// @param tick - pointer to tick to set
/// @return 0 on success, < 0 on error
pub fn sceRtcGetTick(date: *const pspTime, tick: *mut u64) -> i32;
}
extern "C" {
/// Compare two ticks
///
/// @param tick1 - pointer to first tick
/// @param tick2 - poiinter to second tick
/// @return 0 on equal, <0 when tick1 < tick2, >0 when tick1 > tick2
pub fn sceRtcCompareTick(tick1: *const u64, tick2: *const u64) -> i32;
}
extern "C" {
/// Add two ticks
///
/// @param destTick - pointer to tick to hold result
/// @param srcTick - pointer to source tick
/// @param numTicks - number of ticks to add
/// @return 0 on success, <0 on error
pub fn sceRtcTickAddTicks(destTick: *mut u64, srcTick: *const u64,
numTicks: u64) -> i32;
}
extern "C" {
/// Add an amount of ms to a tick
///
/// @param destTick - pointer to tick to hold result
/// @param srcTick - pointer to source tick
/// @param numMS - number of ms to add
/// @return 0 on success, <0 on error
pub fn sceRtcTickAddMicroseconds(destTick: *mut u64, srcTick: *const u64,
numMS: u64) -> i32;
}
extern "C" {
/// Add an amount of seconds to a tick
///
/// @param destTick - pointer to tick to hold result
/// @param srcTick - pointer to source tick
/// @param numSecs - number of seconds to add
/// @return 0 on success, <0 on error
pub fn sceRtcTickAddSeconds(destTick: *mut u64, srcTick: *const u64,
numSecs: u64) -> i32;
}
extern "C" {
/// Add an amount of minutes to a tick
///
/// @param destTick - pointer to tick to hold result
/// @param srcTick - pointer to source tick
/// @param numMins - number of minutes to add
/// @return 0 on success, <0 on error
pub fn sceRtcTickAddMinutes(destTick: *mut u64, srcTick: *const u64,
numMins: u64) -> i32;
}
extern "C" {
/// Add an amount of hours to a tick
///
/// @param destTick - pointer to tick to hold result
/// @param srcTick - pointer to source tick
/// @param numHours - number of hours to add
/// @return 0 on success, <0 on error
pub fn sceRtcTickAddHours(destTick: *mut u64, srcTick: *const u64,
numHours: i32) -> i32;
}
extern "C" {
/// Add an amount of days to a tick
///
/// @param destTick - pointer to tick to hold result
/// @param srcTick - pointer to source tick
/// @param numDays - number of days to add
/// @return 0 on success, <0 on error
pub fn sceRtcTickAddDays(destTick: *mut u64, srcTick: *const u64,
numDays: i32) -> i32;
}
extern "C" {
/// Add an amount of weeks to a tick
///
/// @param destTick - pointer to tick to hold result
/// @param srcTick - pointer to source tick
/// @param numWeeks - number of weeks to add
/// @return 0 on success, <0 on error
pub fn sceRtcTickAddWeeks(destTick: *mut u64, srcTick: *const u64,
numWeeks: i32) -> i32;
}
extern "C" {
/// Add an amount of months to a tick
///
/// @param destTick - pointer to tick to hold result
/// @param srcTick - pointer to source tick
/// @param numMonths - number of months to add
/// @return 0 on success, <0 on error
pub fn sceRtcTickAddMonths(destTick: *mut u64, srcTick: *const u64,
numMonths: i32) -> i32;
}
extern "C" {
/// Add an amount of years to a tick
///
/// @param destTick - pointer to tick to hold result
/// @param srcTick - pointer to source tick
/// @param numYears - number of years to add
/// @return 0 on success, <0 on error
pub fn sceRtcTickAddYears(destTick: *mut u64, srcTick: *const u64,
numYears: i32) -> i32;
}
extern "C" {
pub fn sceRtcSetTime_t(date: *mut pspTime, time: time_t) -> i32;
}
extern "C" {
pub fn sceRtcGetTime_t(date: *const pspTime, time: *mut time_t)
-> i32;
}
extern "C" {
pub fn sceRtcSetDosTime(date: *mut pspTime, dosTime: u32) -> i32;
}
extern "C" {
pub fn sceRtcGetDosTime(date: *mut pspTime, dosTime: u32) -> i32;
}
extern "C" {
pub fn sceRtcSetWin32FileTime(date: *mut pspTime, win32Time: *mut u64)
-> i32;
}
extern "C" {
pub fn sceRtcGetWin32FileTime(date: *mut pspTime, win32Time: *mut u64)
-> i32;
}
extern "C" {
pub fn sceRtcParseDateTime(destTick: *mut u64,
dateString: *const u8) -> i32;
}
extern "C" {
/// Format Tick-representation UTC time in RFC2822 format
pub fn sceRtcFormatRFC2822(pszDateTime: *mut u8, pUtc: *const u64,
iTimeZoneMinutes: i32) -> i32;
}
extern "C" {
/// Format Tick-representation UTC time in RFC2822 format
pub fn sceRtcFormatRFC2822LocalTime(pszDateTime: *mut u8,
pUtc: *const u64) -> i32;
}
extern "C" {
/// Format Tick-representation UTC time in RFC3339(ISO8601) format
pub fn sceRtcFormatRFC3339(pszDateTime: *mut u8, pUtc: *const u64,
iTimeZoneMinutes: i32) -> i32;
}
extern "C" {
/// Format Tick-representation UTC time in RFC3339(ISO8601) format
pub fn sceRtcFormatRFC3339LocalTime(pszDateTime: *mut u8,
pUtc: *const u64) -> i32;
}
extern "C" {
/// Parse time information represented in RFC3339 format
pub fn sceRtcParseRFC3339(pUtc: *mut u64, pszDateTime: *const u8)
-> i32;
}
extern "C" {
/// Query a modules information from its uid.
/// @note this is a replacement function for the broken kernel sceKernelQueryModuleInfo in v1.0 firmware
/// DO NOT use on a anything above that version. This also needs kernel mode access where
/// the normal one has a user mode stub.
///
/// @param uid - The UID of the module to query.
/// @param modinfo - Pointer a module SceKernelModuleInfo structure.
///
/// @return < 0 on error.
pub fn pspSdkQueryModuleInfoV1(uid: SceUID,
modinfo: *mut SceKernelModuleInfo)
-> i32;
}
extern "C" {
/// Get the list of module IDs.
/// @note This is a replacement function for the missing v1.5 sceKernelGetModuleIdList
/// on v1.0 firmware. DO NOT use on anything above that version.
///
/// @param readbuf - Buffer to store the module list.
/// @param readbufsize - Number of elements in the readbuffer.
/// @param idcount - Returns the number of module ids
///
/// @return >= 0 on success
pub fn pspSdkGetModuleIdList(readbuf: *mut SceUID, readbufsize: i32,
idcount: *mut i32) -> i32;
}
extern "C" {
/// Patch the sceModuleManager module to nullify LoadDeviceCheck() calls.
///
/// @return 0 on success, otherwise one of ::PspKernelErrorCodes.
///
/// @note This function must be called while running in kernel mode. The program
/// must also be linked against the pspkernel library.
pub fn pspSdkInstallNoDeviceCheckPatch() -> i32;
}
extern "C" {
/// Patch sceLoadCore module to remove loading plain module checks
///
/// @note This function must be called while running in kernel mode.
///
/// @return 0 on success, otherwise one of ::PspKernelErrorCodes.
pub fn pspSdkInstallNoPlainModuleCheckPatch() -> i32;
}
extern "C" {
/// Patch sceLoadModuleWithApiType to remove the kernel check in loadmodule allowing all modules to load
///
/// @note This function must be called while running in kernel mode
///
/// @return 0 on success
pub fn pspSdkInstallKernelLoadModulePatch() -> i32;
}
extern "C" {
/// Load a module and start it.
///
/// @param filename - Path to the module.
/// @param mpid - Memory parition ID to use to load the module int.
///
/// @return - The UID of the module on success, otherwise one of ::PspKernelErrorCodes.
pub fn pspSdkLoadStartModule(filename: *const u8, mpid: i32)
-> SceUID;
}
extern "C" {
/// Load a module and start it with arguments
///
/// @param filename - Path to the module.
/// @param mpid - Memory parition ID to use to load the module int.
/// @param argc - Number of arguments to pass to start module
/// @param argv - Array of arguments
///
/// @return - The UID of the module on success, otherwise one of ::PspKernelErrorCodes.
pub fn pspSdkLoadStartModuleWithArgs(filename: *const u8,
mpid: i32, argc: i32,
argv: *const *const u8)
-> SceUID;
}
extern "C" {
/// Manually fixup library imports for late binding modules.
///
/// @param moduleId - Id of the module to fixup
pub fn pspSdkFixupImports(moduleId: i32);
}
extern "C" {
/// Load Inet related modules.
/// @note You must be in kernel mode to execute this function.
///
/// @return - 0 on success, otherwise one of ::PspKernelErrorCodes.
pub fn pspSdkLoadInetModules() -> i32;
}
extern "C" {
/// Initialize Inet related modules.
///
/// @return - 0 on success, otherwise one of ::PspKernelErrorCodes.
pub fn pspSdkInetInit() -> i32;
}
extern "C" {
/// Terminate Inet related modules.
pub fn pspSdkInetTerm();
}
extern "C" {
/// Search for a thread with the given name and retrieve it's ::SceKernelThreadInfo struct.
///
/// @param name - The name of the thread to search for.
/// @param pUID - If the thread with the given name is found, it's ::SceUID is stored here.
/// @param pInfo - If the thread with the given name is found, it's ::SceKernelThreadInfo data is stored here.
///
/// @return 0 if successful, otherwise one of ::PspKernelErrorCodes.
pub fn pspSdkReferThreadStatusByName(name: *const u8,
pUID: *mut SceUID,
pInfo: *mut SceKernelThreadInfo)
-> i32;
}
extern "C" {
/// Search for a semaphore with the given name and retrieve it's ::SceKernelSemaInfo struct.
///
/// @param name - The name of the sema to search for.
/// @param pUID - If the sema with the given name is found, it's ::SceUID is stored here.
/// @param pInfo - If the sema with the given name is found, it's ::SceKernelSemaInfo data is stored here.
///
/// @return 0 if successful, otherwise one of ::PspKernelErrorCodes.
pub fn pspSdkReferSemaStatusByName(name: *const u8,
pUID: *mut SceUID,
pInfo: *mut SceKernelSemaInfo)
-> i32;
}
extern "C" {
/// Search for an event flag with the given name and retrieve it's ::SceKernelEventFlagInfo struct.
///
/// @param name - The name of the event flag to search for.
/// @param pUID - If the event flag with the given name is found, it's ::SceUID is stored here.
/// @param pInfo - If the event flag with the given name is found, it's ::SceKernelEventFlagInfo data is stored here.
///
/// @return 0 if successful, otherwise one of ::PspKernelErrorCodes.
pub fn pspSdkReferEventFlagStatusByName(name: *const u8,
pUID: *mut SceUID,
pInfo:
*mut SceKernelEventFlagInfo)
-> i32;
}
extern "C" {
/// Search for a message box with the given name and retrieve it's ::SceKernelMbxInfo struct.
///
/// @param name - The name of the message box to search for.
/// @param pUID - If the message box with the given name is found, it's ::SceUID is stored here.
/// @param pInfo - If the message box with the given name is found, it's ::SceKernelMbxInfo data is stored here.
///
/// @return 0 if successful, otherwise one of ::PspKernelErrorCodes.
pub fn pspSdkReferMboxStatusByName(name: *const u8,
pUID: *mut SceUID,
pInfo: *mut SceKernelMbxInfo)
-> i32;
}
extern "C" {
/// Search for a VPL with the given name and retrieve it's ::SceKernelVplInfo struct.
///
/// @param name - The name of to search for.
/// @param pUID - If the given name is found, it's ::SceUID is stored here.
/// @param pInfo - If the given name is found, it's ::SceKernelVplInfo data is stored here.
///
/// @return 0 if successful, otherwise one of ::PspKernelErrorCodes.
pub fn pspSdkReferVplStatusByName(name: *const u8,
pUID: *mut SceUID,
pInfo: *mut SceKernelVplInfo)
-> i32;
}
extern "C" {
/// Search for a FPL with the given name and retrieve it's ::SceKernelFplInfo struct.
///
/// @param name - The name of to search for.
/// @param pUID - If the given name is found, it's ::SceUID is stored here.
/// @param pInfo - If the given name is found, it's ::SceKernelFplInfo data is stored here.
///
/// @return 0 if successful, otherwise one of ::PspKernelErrorCodes.
pub fn pspSdkReferFplStatusByName(name: *const u8,
pUID: *mut SceUID,
pInfo: *mut SceKernelFplInfo)
-> i32;
}
extern "C" {
/// Search for a message pipe with the given name and retrieve it's ::SceKernelMppInfo struct.
///
/// @param name - The name of to search for.
/// @param pUID - If the given name is found, it's ::SceUID is stored here.
/// @param pInfo - If the given name is found, it's ::SceKernelMppInfo data is stored here.
///
/// @return 0 if successful, otherwise one of ::PspKernelErrorCodes.
pub fn pspSdkReferMppStatusByName(name: *const u8,
pUID: *mut SceUID,
pInfo: *mut SceKernelMppInfo)
-> i32;
}
extern "C" {
/// Search for a callback with the given name and retrieve it's ::SceKernelCallbackInfo struct.
///
/// @param name - The name of to search for.
/// @param pUID - If the given name is found, it's ::SceUID is stored here.
/// @param pInfo - If the given name is found, it's ::SceKernelMppInfo data is stored here.
///
/// @return 0 if successful, otherwise one of ::PspKernelErrorCodes.
pub fn pspSdkReferCallbackStatusByName(name: *const u8,
pUID: *mut SceUID,
pInfo: *mut SceKernelCallbackInfo)
-> i32;
}
extern "C" {
/// Search for a vtimer with the given name and retrieve it's ::SceKernelVTimerInfo struct.
///
/// @param name - The name of to search for.
/// @param pUID - If the given name is found, it's ::SceUID is stored here.
/// @param pInfo - If the given name is found, it's ::SceKernelVTimerInfo data is stored here.
///
/// @return 0 if successful, otherwise one of ::PspKernelErrorCodes.
pub fn pspSdkReferVTimerStatusByName(name: *const u8,
pUID: *mut SceUID,
pInfo: *mut SceKernelVTimerInfo)
-> i32;
}
extern "C" {
/// Search for a thread event handler with the given name and retrieve it's ::SceKernelThreadEventHandlerInfo struct.
///
/// @param name - The name of to search for.
/// @param pUID - If the given name is found, it's ::SceUID is stored here.
/// @param pInfo - If the given name is found, it's ::SceKernelThreadEventHandlerInfo data is stored here.
///
/// @return 0 if successful, otherwise one of ::PspKernelErrorCodes.
pub fn pspSdkReferThreadEventHandlerStatusByName(name: *const u8,
pUID: *mut SceUID,
pInfo:
*mut SceKernelThreadEventHandlerInfo)
-> i32;
}
extern "C" {
/// Disable interrupts
///
/// @note Do not disable interrupts for too long otherwise the watchdog will get you.
///
/// @return The previous state of the interrupt enable bit (should be passed back to ::pspSdkEnableInterrupts)
pub fn pspSdkDisableInterrupts() -> u32;
}
extern "C" {
/// Enable interrupts
///
/// @param istate - The interrupt state as returned from ::pspSdkDisableInterrupts
pub fn pspSdkEnableInterrupts(istate: u32);
}
extern "C" {
/// Set the processors K1 register to a known value
///
/// @note This function is for use in kernel mode syscall exports. The kernel
/// sets the k1 register to indicate what mode called the function, i.e.
/// whether it was directly called, was called via a syscall from a kernel
/// thread or called via a syscall from a user thread. By setting k1 to 0
/// before doing anything in your code you can make the other functions think
/// you are calling from a kernel thread and therefore disable numerous
/// protections.
///
/// @param k1 - The k1 value to set
///
/// @return The previous value of k1
pub fn pspSdkSetK1(k1: u32) -> u32;
}
extern "C" {
/// Get the current value of the processors K1 register
///
/// @return The current value of K1
pub fn pspSdkGetK1() -> u32;
}
extern "C" {
/// Disable the CPUs FPU exceptions
pub fn pspSdkDisableFPUExceptions();
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct sircs_data {
pub type_: u8,
pub cmd: u8,
pub dev: u16,
}
#[test]
fn bindgen_test_layout_sircs_data() {
assert_eq!(::core::mem::size_of::<sircs_data>() , 4usize , concat ! (
"Size of: " , stringify ! ( sircs_data ) ));
assert_eq! (::core::mem::align_of::<sircs_data>() , 2usize , concat ! (
"Alignment of " , stringify ! ( sircs_data ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const sircs_data ) ) . type_ as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( sircs_data ) , "::" ,
stringify ! ( type_ ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const sircs_data ) ) . cmd as * const _ as
usize } , 1usize , concat ! (
"Alignment of field: " , stringify ! ( sircs_data ) , "::" ,
stringify ! ( cmd ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const sircs_data ) ) . dev as * const _ as
usize } , 2usize , concat ! (
"Alignment of field: " , stringify ! ( sircs_data ) , "::" ,
stringify ! ( dev ) ));
}
impl Clone for sircs_data {
fn clone(&self) -> Self { *self }
}
extern "C" {
#[link_name = "__packed__"]
pub static mut __packed__: sircs_data;
}
extern "C" {
pub fn sceSircsSend(sd: *mut sircs_data, count: i32) -> i32;
}
extern "C" {
/// Init the ssl library.
///
/// @param unknown1 - Memory size? Pass 0x28000
///
/// @return 0 on success
pub fn sceSslInit(unknown1: i32) -> i32;
}
extern "C" {
/// Terminate the ssl library.
///
/// @return 0 on success
pub fn sceSslEnd() -> i32;
}
extern "C" {
/// Get the maximum memory size used by ssl.
///
/// @param memory - Pointer where the maximum memory used value will be stored.
///
/// @return 0 on success
pub fn sceSslGetUsedMemoryMax(memory: *mut u32) -> i32;
}
extern "C" {
/// Get the current memory size used by ssl.
///
/// @param memory - Pointer where the current memory used value will be stored.
///
/// @return 0 on success
pub fn sceSslGetUsedMemoryCurrent(memory: *mut u32) -> i32;
}
extern "C" {
/// Allocate the extra 4megs of RAM
///
/// @param unk - No idea as it is never used, set to anything
/// @param ptr - Pointer to a pointer to hold the address of the memory
/// @param size - Pointer to an int which will hold the size of the memory
///
/// @return 0 on success
pub fn sceKernelVolatileMemLock(unk: i32, ptr: *mut *mut c_void,
size: *mut i32) -> i32;
}
extern "C" {
/// Try and allocate the extra 4megs of RAM, will return an error if
/// something has already allocated it
///
/// @param unk - No idea as it is never used, set to anything
/// @param ptr - Pointer to a pointer to hold the address of the memory
/// @param size - Pointer to an int which will hold the size of the memory
///
/// @return 0 on success
pub fn sceKernelVolatileMemTryLock(unk: i32, ptr: *mut *mut c_void,
size: *mut i32) -> i32;
}
extern "C" {
/// Deallocate the extra 4 megs of RAM
///
/// @param unk - Set to 0, otherwise it fails in 3.52+, possibly earlier
/// @return 0 on success
pub fn sceKernelVolatileMemUnlock(unk: i32) -> i32;
}
pub type va_list = __builtin_va_list;
pub type __gnuc_va_list = __builtin_va_list;
/// Callback type, ch is 0x200 on start of string, 0x201 on end
pub type prnt_callback =
::core::option::Option<unsafe extern "C" fn(ctx: *mut c_void,
ch: i32)>;
extern "C" {
/// Generic print routine
///
/// @param cb - Callback, called for every character printed
/// @param ctx - Context parameter passed to the callback
/// @param fmt - Format data
/// @param args - Arguments for format
///
pub fn prnt(cb: prnt_callback, ctx: *mut c_void, fmt: *const u8,
args: *mut __va_list_tag);
}
extern "C" {
/// Force the PSP to go into standby
pub fn sceSysconPowerStandby();
}
extern "C" {
/// Reset the PSP
///
/// @param unk1 - Unknown, pass 1
/// @param unk2 - Unknown, pass 1
pub fn sceSysconResetDevice(unk1: i32, unk2: i32);
}
extern "C" {
/// Control an LED
///
/// @param SceLED - The led to toggle (only SCE_LED_POWER)
/// @param state - Whether to turn on or off
pub fn sceSysconCtrlLED(SceLED: i32, state: i32) -> i32;
}
extern "C" {
/// Control the remote control power
///
/// @param power - 1 is on, 0 is off
///
/// @return < 0 on error
pub fn sceSysconCtrlHRPower(power: i32) -> i32;
}
extern "C" {
pub fn sceSysconGetHPConnect() -> i32;
}
extern "C" {
pub fn sceSysconSetHPConnectCallback(arg1:
::core::option::Option<unsafe extern "C" fn(arg1:
i32)>,
unk0: i32) -> i32;
}
extern "C" {
pub fn sceSysconSetHRPowerCallback(arg1:
::core::option::Option<unsafe extern "C" fn(arg1:
i32)>,
unk0: i32) -> i32;
}
extern "C" {
/// Get the PSP's Pommel version
/// @param version - A pointer to an int to receive the Pommel version into
pub fn sceSysconGetPommelVersion(version: *mut i32) -> i32;
}
extern "C" {
/// Get the PSP's Baryon version
/// @param version - A pointer to an int to receive the Baryon version into
pub fn sceSysconGetBaryonVersion(version: *mut i32) -> i32;
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct PspSysEventHandler {
pub size: i32,
pub name: *mut u8,
pub type_mask: i32,
pub handler: ::core::option::Option<unsafe extern "C" fn(ev_id: i32,
ev_name:
*mut u8,
param:
*mut c_void,
result:
*mut i32)
-> i32>,
pub r28: i32,
pub busy: i32,
pub next: *mut _PspSysEventHandler,
pub reserved: [i32; 9usize],
}
#[test]
fn bindgen_test_layout_PspSysEventHandler() {
assert_eq!(::core::mem::size_of::<PspSysEventHandler>() , 88usize , concat
! ( "Size of: " , stringify ! ( PspSysEventHandler ) ));
assert_eq! (::core::mem::align_of::<PspSysEventHandler>() , 8usize ,
concat ! (
"Alignment of " , stringify ! ( PspSysEventHandler ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspSysEventHandler ) ) . size as * const
_ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( PspSysEventHandler ) ,
"::" , stringify ! ( size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspSysEventHandler ) ) . name as * const
_ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( PspSysEventHandler ) ,
"::" , stringify ! ( name ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspSysEventHandler ) ) . type_mask as *
const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( PspSysEventHandler ) ,
"::" , stringify ! ( type_mask ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspSysEventHandler ) ) . handler as *
const _ as usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! ( PspSysEventHandler ) ,
"::" , stringify ! ( handler ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspSysEventHandler ) ) . r28 as * const _
as usize } , 32usize , concat ! (
"Alignment of field: " , stringify ! ( PspSysEventHandler ) ,
"::" , stringify ! ( r28 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspSysEventHandler ) ) . busy as * const
_ as usize } , 36usize , concat ! (
"Alignment of field: " , stringify ! ( PspSysEventHandler ) ,
"::" , stringify ! ( busy ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspSysEventHandler ) ) . next as * const
_ as usize } , 40usize , concat ! (
"Alignment of field: " , stringify ! ( PspSysEventHandler ) ,
"::" , stringify ! ( next ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspSysEventHandler ) ) . reserved as *
const _ as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! ( PspSysEventHandler ) ,
"::" , stringify ! ( reserved ) ));
}
impl Clone for PspSysEventHandler {
fn clone(&self) -> Self { *self }
}
pub type _PspSysEventHandler = PspSysEventHandler;
pub type PspSysEventHandlerFunc =
::core::option::Option<unsafe extern "C" fn(ev_id: i32,
ev_name: *mut u8,
param: *mut c_void,
result: *mut i32)
-> i32>;
extern "C" {
/// Dispatch a SysEvent event.
///
/// @param ev_type_mask - the event type mask
/// @param ev_id - the event id
/// @param ev_name - the event name
/// @param param - the pointer to the custom parameters
/// @param result - the pointer to the result
/// @param break_nonzero - set to 1 to interrupt the calling chain after the first non-zero return
/// @param break_handler - the pointer to the event handler having interrupted
/// @return 0 on success, < 0 on error
pub fn sceKernelSysEventDispatch(ev_type_mask: i32, ev_id: i32,
ev_name: *mut u8,
param: *mut c_void,
result: *mut i32,
break_nonzero: i32,
break_handler: *mut PspSysEventHandler)
-> i32;
}
extern "C" {
/// Get the first SysEvent handler (the rest can be found with the linked list).
///
/// @return 0 on error, handler on success
pub fn sceKernelReferSysEventHandler() -> *mut PspSysEventHandler;
}
extern "C" {
/// Check if a SysEvent handler is registered.
///
/// @param handler - the handler to check
/// @return 0 if the handler is not registered
pub fn sceKernelIsRegisterSysEventHandler(handler:
*mut PspSysEventHandler)
-> i32;
}
extern "C" {
/// Register a SysEvent handler.
///
/// @param handler - the handler to register
/// @return 0 on success, < 0 on error
pub fn sceKernelRegisterSysEventHandler(handler: *mut PspSysEventHandler)
-> i32;
}
extern "C" {
/// Unregister a SysEvent handler.
///
/// @param handler - the handler to unregister
/// @return 0 on success, < 0 on error
pub fn sceKernelUnregisterSysEventHandler(handler:
*mut PspSysEventHandler)
-> i32;
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct _PspSysmemPartitionInfo {
pub size: SceSize,
pub startaddr: u32,
pub memsize: u32,
pub attr: u32,
}
#[test]
fn bindgen_test_layout__PspSysmemPartitionInfo() {
assert_eq!(::core::mem::size_of::<_PspSysmemPartitionInfo>() , 16usize ,
concat ! (
"Size of: " , stringify ! ( _PspSysmemPartitionInfo ) ));
assert_eq! (::core::mem::align_of::<_PspSysmemPartitionInfo>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( _PspSysmemPartitionInfo ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspSysmemPartitionInfo ) ) . size as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( _PspSysmemPartitionInfo
) , "::" , stringify ! ( size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspSysmemPartitionInfo ) ) . startaddr
as * const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( _PspSysmemPartitionInfo
) , "::" , stringify ! ( startaddr ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspSysmemPartitionInfo ) ) . memsize as
* const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( _PspSysmemPartitionInfo
) , "::" , stringify ! ( memsize ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PspSysmemPartitionInfo ) ) . attr as *
const _ as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( _PspSysmemPartitionInfo
) , "::" , stringify ! ( attr ) ));
}
impl Clone for _PspSysmemPartitionInfo {
fn clone(&self) -> Self { *self }
}
pub type PspSysmemPartitionInfo = _PspSysmemPartitionInfo;
extern "C" {
/// Query the parition information
///
/// @param pid - The partition id
/// @param info - Pointer to the ::PspSysmemPartitionInfo structure
///
/// @return 0 on success.
pub fn sceKernelQueryMemoryPartitionInfo(pid: i32,
info:
*mut PspSysmemPartitionInfo)
-> i32;
}
extern "C" {
/// Get the total amount of free memory.
///
/// @param pid - The partition id
///
/// @return The total amount of free memory, in bytes.
pub fn sceKernelPartitionTotalFreeMemSize(pid: i32) -> SceSize;
}
extern "C" {
/// Get the size of the largest free memory block.
///
/// @param pid - The partition id
///
/// @return The size of the largest free memory block, in bytes.
pub fn sceKernelPartitionMaxFreeMemSize(pid: i32) -> SceSize;
}
extern "C" {
/// Get the kernel to dump the internal memory table to Kprintf
pub fn sceKernelSysMemDump();
}
extern "C" {
/// Dump the list of memory blocks
pub fn sceKernelSysMemDumpBlock();
}
extern "C" {
/// Dump the tail blocks
pub fn sceKernelSysMemDumpTail();
}
extern "C" {
/// Set the protection of a block of ddr memory
///
/// @param addr - Address to set protection on
/// @param size - Size of block
/// @param prot - Protection bitmask
///
/// @return < 0 on error
pub fn sceKernelSetDdrMemoryProtection(addr: *mut c_void, size: i32,
prot: i32) -> i32;
}
extern "C" {
/// Create a heap.
///
/// @param partitionid - The UID of the partition where allocate the heap.
/// @param size - The size in bytes of the heap.
/// @param unk - Unknown, probably some flag or type, pass 1.
/// @param name - Name assigned to the new heap.
///
/// @return The UID of the new heap, or if less than 0 an error.
pub fn sceKernelCreateHeap(partitionid: SceUID, size: SceSize,
unk: i32, name: *const u8) -> SceUID;
}
extern "C" {
/// Allocate a memory block from a heap.
///
/// @param heapid - The UID of the heap to allocate from.
/// @param size - The number of bytes to allocate.
///
/// @return The address of the allocated memory block, or NULL on error.
pub fn sceKernelAllocHeapMemory(heapid: SceUID, size: SceSize)
-> *mut c_void;
}
extern "C" {
/// Free a memory block allocated from a heap.
///
/// @param heapid - The UID of the heap where block belongs.
/// @param block - The block of memory to free from the heap.
///
/// @return 0 on success, < 0 on error.
pub fn sceKernelFreeHeapMemory(heapid: SceUID, block: *mut c_void)
-> i32;
}
extern "C" {
/// Delete a heap.
///
/// @param heapid - The UID of the heap to delete.
///
/// @return 0 on success, < 0 on error.
pub fn sceKernelDeleteHeap(heapid: SceUID) -> i32;
}
extern "C" {
/// Get the amount of free size of a heap, in bytes.
///
/// @param heapid - The UID of the heap
///
/// @return the free size of the heap, in bytes. < 0 on error.
pub fn sceKernelHeapTotalFreeSize(heapid: SceUID) -> SceSize;
}
/// Structure of a UID control block
#[repr(C, packed)]
#[derive(Debug, Copy)]
pub struct _uidControlBlock {
pub parent: *mut _uidControlBlock,
pub nextChild: *mut _uidControlBlock,
pub type_: *mut _uidControlBlock,
pub UID: u32,
pub name: *mut u8,
pub unk: u8,
pub size: u8,
pub attribute: i16,
pub nextEntry: *mut _uidControlBlock,
}
#[test]
fn bindgen_test_layout__uidControlBlock() {
assert_eq!(::core::mem::size_of::<_uidControlBlock>() , 48usize , concat !
( "Size of: " , stringify ! ( _uidControlBlock ) ));
assert_eq! (::core::mem::align_of::<_uidControlBlock>() , 1usize , concat
! ( "Alignment of " , stringify ! ( _uidControlBlock ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _uidControlBlock ) ) . parent as * const
_ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( _uidControlBlock ) ,
"::" , stringify ! ( parent ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _uidControlBlock ) ) . nextChild as *
const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( _uidControlBlock ) ,
"::" , stringify ! ( nextChild ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _uidControlBlock ) ) . type_ as * const _
as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( _uidControlBlock ) ,
"::" , stringify ! ( type_ ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _uidControlBlock ) ) . UID as * const _
as usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! ( _uidControlBlock ) ,
"::" , stringify ! ( UID ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _uidControlBlock ) ) . name as * const _
as usize } , 28usize , concat ! (
"Alignment of field: " , stringify ! ( _uidControlBlock ) ,
"::" , stringify ! ( name ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _uidControlBlock ) ) . unk as * const _
as usize } , 36usize , concat ! (
"Alignment of field: " , stringify ! ( _uidControlBlock ) ,
"::" , stringify ! ( unk ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _uidControlBlock ) ) . size as * const _
as usize } , 37usize , concat ! (
"Alignment of field: " , stringify ! ( _uidControlBlock ) ,
"::" , stringify ! ( size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _uidControlBlock ) ) . attribute as *
const _ as usize } , 38usize , concat ! (
"Alignment of field: " , stringify ! ( _uidControlBlock ) ,
"::" , stringify ! ( attribute ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _uidControlBlock ) ) . nextEntry as *
const _ as usize } , 40usize , concat ! (
"Alignment of field: " , stringify ! ( _uidControlBlock ) ,
"::" , stringify ! ( nextEntry ) ));
}
impl Clone for _uidControlBlock {
fn clone(&self) -> Self { *self }
}
pub type uidControlBlock = _uidControlBlock;
extern "C" {
/// Get a UID control block
///
/// @param uid - The UID to find
/// @param block - Pointer to hold the pointer to the block
///
/// @return 0 on success
pub fn sceKernelGetUIDcontrolBlock(uid: SceUID,
block: *mut *mut uidControlBlock)
-> i32;
}
extern "C" {
/// Get a UID control block on a particular type
///
/// @param uid - The UID to find
/// @param type - Pointer to the type UID block
/// @param block - Pointer to hold the pointer to the block
///
/// @return 0 on success
pub fn sceKernelGetUIDcontrolBlockWithType(uid: SceUID,
type_: *mut uidControlBlock,
block:
*mut *mut uidControlBlock)
-> i32;
}
extern "C" {
/// Get the root of the UID tree (1.5+ only)
///
/// @return Pointer to the UID tree root
pub fn SysMemForKernel_536AD5E1() -> *mut uidControlBlock;
}
extern "C" {
/// Delete a UID
///
/// @param uid - The UID to delete
///
/// @return 0 on success
pub fn sceKernelDeleteUID(uid: SceUID) -> i32;
}
extern "C" {
/// Get the model of PSP
///
/// @return <= 0 original, 1 slim
pub fn sceKernelGetModel() -> i32;
}
pub type SceSysTimerId = i32;
extern "C" {
/// Allocate a new SysTimer timer instance.
///
/// @return SysTimerId on success, < 0 on error
pub fn sceSTimerAlloc() -> SceSysTimerId;
}
extern "C" {
/// Free an instance of a SysTimer timer.
///
/// @param timer - The timer id.
///
pub fn sceSTimerFree(timer: SceSysTimerId);
}
extern "C" {
/// Start the SysTimer timer count.
///
/// @param timer - The timer id.
///
pub fn sceSTimerStartCount(timer: SceSysTimerId);
}
extern "C" {
/// Stop the current SysTimer timer count.
///
/// @param timer - The timer id.
///
pub fn sceSTimerStopCount(timer: SceSysTimerId);
}
extern "C" {
/// Reset the current SysTimer timer count.
///
/// @param timer - The timer id.
///
pub fn sceSTimerResetCount(timer: SceSysTimerId);
}
extern "C" {
/// Get the current SysTimer timer count.
///
/// @param timer - The timer id.
/// @param count - The pointer to an integer into which the count will be written.
///
pub fn sceSTimerGetCount(timer: SceSysTimerId, count: *mut i32);
}
extern "C" {
/// Setup a SysTimer handler
///
/// @param timer - The timer id.
/// @param cycle - The timer cycle in microseconds (???). Maximum: 4194303 which represents ~1/10 seconds.
/// @param handler - The handler function. Has to return -1.
/// @param unk1 - Unknown. Pass 0.
///
pub fn sceSTimerSetHandler(timer: SceSysTimerId, cycle: i32,
handler:
::core::option::Option<unsafe extern "C" fn()
-> i32>,
unk1: i32);
}
extern "C" {
pub fn SysTimerForKernel_53231A15(timer: SceSysTimerId, unk1: i32);
}
extern "C" {
pub fn SysTimerForKernel_B53534B4(timer: SceSysTimerId, unk1: i32,
unk2: i32);
}
extern "C" {
/// Suspend all user mode threads in the system
///
/// @return 0 on success, < 0 on error
pub fn sceKernelSuspendAllUserThreads() -> i32;
}
extern "C" {
/// Checks if the current thread is a usermode thread
///
/// @return 0 if kernel, 1 if user, < 0 on error
pub fn sceKernelIsUserModeThread() -> i32;
}
extern "C" {
/// Get the user level of the current thread
///
/// @return The user level, < 0 on error
pub fn sceKernelGetUserLevel() -> i32;
}
extern "C" {
/// Get the return address of the current thread's syscall
///
/// @return The RA, 0 on error
pub fn sceKernelGetSyscallRA() -> u32;
}
extern "C" {
/// Get the free stack space on the kernel thread
///
/// @param thid - The UID of the thread
///
/// @return The free stack space, < 0 on error
pub fn sceKernelGetThreadKernelStackFreeSize(thid: SceUID) -> i32;
}
extern "C" {
/// Check the thread kernel stack
///
/// @return Unknown
pub fn sceKernelCheckThreadKernelStack() -> i32;
}
extern "C" {
/// Extend the kernel thread stack
///
/// @param type - The type of block allocation. One of ::PspSysMemBlockTypes
/// @param cb - A pointer to a callback function
/// @param arg - A pointer to a user specified argument
///
/// @return < 0 on error
pub fn sceKernelExtendKernelStack(type_: i32,
cb:
::core::option::Option<unsafe extern "C" fn(arg1:
*mut c_void)>,
arg: *mut c_void) -> i32;
}
extern "C" {
/// Get the system status flag
///
/// @return The system status flag
pub fn sceKernelGetSystemStatusFlag() -> u32;
}
extern "C" {
/// Setup the KTLS allocator
///
/// @param id - The ID of the allocator
/// @param cb - The allocator callback
/// @param arg - User specified arg passed to the callback
///
/// @return < 0 on error, allocation id on success
pub fn sceKernelAllocateKTLS(id: i32,
cb:
::core::option::Option<unsafe extern "C" fn(size:
*mut u32,
arg:
*mut c_void)
-> i32>,
arg: *mut c_void) -> i32;
}
extern "C" {
/// Free the KTLS allocator
///
/// @param id - The allocation id returned from AllocateKTLS
///
/// @return < 0 on error
pub fn sceKernelFreeKTLS(id: i32) -> i32;
}
extern "C" {
/// Get the KTLS of the current thread
///
/// @param id - The allocation id returned from AllocateKTLS
///
/// @return The current KTLS, NULL on error
pub fn sceKernelGetKTLS(id: i32) -> *mut c_void;
}
extern "C" {
/// Get the KTLS of a thread
///
/// @param id - The allocation id returned from AllocateKTLS
/// @param thid - The thread is, 0 for current thread
/// @param mode - Perhaps? Sees to be set to 0 or 1
///
/// @return The current KTLS, NULL on error
pub fn sceKernelGetThreadKTLS(id: i32, thid: SceUID, mode: i32)
-> *mut c_void;
}
/// Thread context
/// Structues for the thread context taken from florinsasu's post on the forums
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceThreadContext {
pub type_: u32,
pub gpr: [u32; 31usize],
pub fpr: [u32; 32usize],
pub fc31: u32,
pub hi: u32,
pub lo: u32,
pub SR: u32,
pub EPC: u32,
pub field_114: u32,
pub field_118: u32,
}
#[test]
fn bindgen_test_layout_SceThreadContext() {
assert_eq!(::core::mem::size_of::<SceThreadContext>() , 284usize , concat
! ( "Size of: " , stringify ! ( SceThreadContext ) ));
assert_eq! (::core::mem::align_of::<SceThreadContext>() , 4usize , concat
! ( "Alignment of " , stringify ! ( SceThreadContext ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceThreadContext ) ) . type_ as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceThreadContext ) ,
"::" , stringify ! ( type_ ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceThreadContext ) ) . gpr as * const _
as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( SceThreadContext ) ,
"::" , stringify ! ( gpr ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceThreadContext ) ) . fpr as * const _
as usize } , 128usize , concat ! (
"Alignment of field: " , stringify ! ( SceThreadContext ) ,
"::" , stringify ! ( fpr ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceThreadContext ) ) . fc31 as * const _
as usize } , 256usize , concat ! (
"Alignment of field: " , stringify ! ( SceThreadContext ) ,
"::" , stringify ! ( fc31 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceThreadContext ) ) . hi as * const _ as
usize } , 260usize , concat ! (
"Alignment of field: " , stringify ! ( SceThreadContext ) ,
"::" , stringify ! ( hi ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceThreadContext ) ) . lo as * const _ as
usize } , 264usize , concat ! (
"Alignment of field: " , stringify ! ( SceThreadContext ) ,
"::" , stringify ! ( lo ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceThreadContext ) ) . SR as * const _ as
usize } , 268usize , concat ! (
"Alignment of field: " , stringify ! ( SceThreadContext ) ,
"::" , stringify ! ( SR ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceThreadContext ) ) . EPC as * const _
as usize } , 272usize , concat ! (
"Alignment of field: " , stringify ! ( SceThreadContext ) ,
"::" , stringify ! ( EPC ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceThreadContext ) ) . field_114 as *
const _ as usize } , 276usize , concat ! (
"Alignment of field: " , stringify ! ( SceThreadContext ) ,
"::" , stringify ! ( field_114 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceThreadContext ) ) . field_118 as *
const _ as usize } , 280usize , concat ! (
"Alignment of field: " , stringify ! ( SceThreadContext ) ,
"::" , stringify ! ( field_118 ) ));
}
impl Clone for SceThreadContext {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceSCContext {
pub status: u32,
pub epc: u32,
pub sp: u32,
pub ra: u32,
pub k1: u32,
pub unk: [u32; 3usize],
}
#[test]
fn bindgen_test_layout_SceSCContext() {
assert_eq!(::core::mem::size_of::<SceSCContext>() , 32usize , concat ! (
"Size of: " , stringify ! ( SceSCContext ) ));
assert_eq! (::core::mem::align_of::<SceSCContext>() , 4usize , concat ! (
"Alignment of " , stringify ! ( SceSCContext ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceSCContext ) ) . status as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceSCContext ) , "::" ,
stringify ! ( status ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceSCContext ) ) . epc as * const _ as
usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( SceSCContext ) , "::" ,
stringify ! ( epc ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceSCContext ) ) . sp as * const _ as
usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( SceSCContext ) , "::" ,
stringify ! ( sp ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceSCContext ) ) . ra as * const _ as
usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( SceSCContext ) , "::" ,
stringify ! ( ra ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceSCContext ) ) . k1 as * const _ as
usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( SceSCContext ) , "::" ,
stringify ! ( k1 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceSCContext ) ) . unk as * const _ as
usize } , 20usize , concat ! (
"Alignment of field: " , stringify ! ( SceSCContext ) , "::" ,
stringify ! ( unk ) ));
}
impl Clone for SceSCContext {
fn clone(&self) -> Self { *self }
}
/// Structure to hold the status information for a thread (kernel form)
/// 1.5 form
#[repr(C)]
#[derive(Debug, Copy)]
pub struct SceKernelThreadKInfo {
/// Size of the structure
pub size: SceSize,
/// Nul terminated name of the thread
pub name: [u8; 32usize],
/// Thread attributes
pub attr: SceUInt,
/// Thread status
pub status: i32,
/// Thread entry point
pub entry: SceKernelThreadEntry,
/// Thread stack pointer
pub stack: *mut c_void,
/// Thread stack size
pub stackSize: i32,
/// Kernel stack pointer
pub kstack: *mut c_void,
/// Kernel stack size
pub kstackSize: *mut c_void,
/// Pointer to the gp
pub gpReg: *mut c_void,
/// Size of args
pub args: SceSize,
/// Pointer to args
pub argp: *mut c_void,
/// Initial priority
pub initPriority: i32,
/// Current priority
pub currentPriority: i32,
/// Wait type
pub waitType: i32,
/// Wait id
pub waitId: SceUID,
/// Wakeup count
pub wakeupCount: i32,
/// Number of clock cycles run
pub runClocks: SceKernelSysClock,
/// Interrupt preemption count
pub intrPreemptCount: SceUInt,
/// Thread preemption count
pub threadPreemptCount: SceUInt,
/// Release count
pub releaseCount: SceUInt,
/// Thread Context
pub thContext: *mut SceThreadContext,
/// VFPU Context
pub vfpuContext: *mut f32,
/// Return address from syscall
pub retAddr: *mut c_void,
/// Unknown, possibly size of SC context
pub unknown1: SceUInt,
/// Syscall Context
pub scContext: *mut SceSCContext,
}
#[test]
fn bindgen_test_layout_SceKernelThreadKInfo() {
assert_eq!(::core::mem::size_of::<SceKernelThreadKInfo>() , 192usize ,
concat ! ( "Size of: " , stringify ! ( SceKernelThreadKInfo )
));
assert_eq! (::core::mem::align_of::<SceKernelThreadKInfo>() , 8usize ,
concat ! (
"Alignment of " , stringify ! ( SceKernelThreadKInfo ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadKInfo ) ) . size as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
, "::" , stringify ! ( size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadKInfo ) ) . name as *
const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
, "::" , stringify ! ( name ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadKInfo ) ) . attr as *
const _ as usize } , 36usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
, "::" , stringify ! ( attr ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadKInfo ) ) . status as *
const _ as usize } , 40usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
, "::" , stringify ! ( status ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadKInfo ) ) . entry as *
const _ as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
, "::" , stringify ! ( entry ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadKInfo ) ) . stack as *
const _ as usize } , 56usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
, "::" , stringify ! ( stack ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadKInfo ) ) . stackSize as *
const _ as usize } , 64usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
, "::" , stringify ! ( stackSize ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadKInfo ) ) . kstack as *
const _ as usize } , 72usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
, "::" , stringify ! ( kstack ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadKInfo ) ) . kstackSize as
* const _ as usize } , 80usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
, "::" , stringify ! ( kstackSize ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadKInfo ) ) . gpReg as *
const _ as usize } , 88usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
, "::" , stringify ! ( gpReg ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadKInfo ) ) . args as *
const _ as usize } , 96usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
, "::" , stringify ! ( args ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadKInfo ) ) . argp as *
const _ as usize } , 104usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
, "::" , stringify ! ( argp ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadKInfo ) ) . initPriority
as * const _ as usize } , 112usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
, "::" , stringify ! ( initPriority ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadKInfo ) ) .
currentPriority as * const _ as usize } , 116usize , concat !
(
"Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
, "::" , stringify ! ( currentPriority ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadKInfo ) ) . waitType as *
const _ as usize } , 120usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
, "::" , stringify ! ( waitType ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadKInfo ) ) . waitId as *
const _ as usize } , 124usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
, "::" , stringify ! ( waitId ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadKInfo ) ) . wakeupCount as
* const _ as usize } , 128usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
, "::" , stringify ! ( wakeupCount ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadKInfo ) ) . runClocks as *
const _ as usize } , 132usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
, "::" , stringify ! ( runClocks ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadKInfo ) ) .
intrPreemptCount as * const _ as usize } , 140usize , concat !
(
"Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
, "::" , stringify ! ( intrPreemptCount ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadKInfo ) ) .
threadPreemptCount as * const _ as usize } , 144usize , concat
! (
"Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
, "::" , stringify ! ( threadPreemptCount ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadKInfo ) ) . releaseCount
as * const _ as usize } , 148usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
, "::" , stringify ! ( releaseCount ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadKInfo ) ) . thContext as *
const _ as usize } , 152usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
, "::" , stringify ! ( thContext ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadKInfo ) ) . vfpuContext as
* const _ as usize } , 160usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
, "::" , stringify ! ( vfpuContext ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadKInfo ) ) . retAddr as *
const _ as usize } , 168usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
, "::" , stringify ! ( retAddr ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadKInfo ) ) . unknown1 as *
const _ as usize } , 176usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
, "::" , stringify ! ( unknown1 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceKernelThreadKInfo ) ) . scContext as *
const _ as usize } , 184usize , concat ! (
"Alignment of field: " , stringify ! ( SceKernelThreadKInfo )
, "::" , stringify ! ( scContext ) ));
}
impl Clone for SceKernelThreadKInfo {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// Refer kernel version of thread information
///
/// @param uid - UID to find
/// @param info - Pointer to info structure, ensure size is set before calling
///
/// @return 0 on success
pub fn ThreadManForKernel_2D69D086(uid: SceUID,
info: *mut SceKernelThreadKInfo)
-> i32;
}
/// UMD Info struct
#[repr(C)]
#[derive(Debug, Copy)]
pub struct pspUmdInfo {
/// Set to sizeof(pspUmdInfo)
pub size: u32,
/// One or more of ::pspUmdTypes
pub type_: u32,
}
#[test]
fn bindgen_test_layout_pspUmdInfo() {
assert_eq!(::core::mem::size_of::<pspUmdInfo>() , 8usize , concat ! (
"Size of: " , stringify ! ( pspUmdInfo ) ));
assert_eq! (::core::mem::align_of::<pspUmdInfo>() , 4usize , concat ! (
"Alignment of " , stringify ! ( pspUmdInfo ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspUmdInfo ) ) . size as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( pspUmdInfo ) , "::" ,
stringify ! ( size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspUmdInfo ) ) . type_ as * const _ as
usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( pspUmdInfo ) , "::" ,
stringify ! ( type_ ) ));
}
impl Clone for pspUmdInfo {
fn clone(&self) -> Self { *self }
}
#[repr(u32)]
/// Enumeration for UMD types
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum pspUmdTypes {
PSP_UMD_TYPE_GAME = 16,
PSP_UMD_TYPE_VIDEO = 32,
PSP_UMD_TYPE_AUDIO = 64,
}
#[repr(u32)]
/// Enumeration for UMD drive state
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum pspUmdState {
PSP_UMD_NOT_PRESENT = 1,
PSP_UMD_PRESENT = 2,
PSP_UMD_CHANGED = 4,
PSP_UMD_INITING = 8,
PSP_UMD_INITED = 16,
PSP_UMD_READY = 32,
}
#[repr(u32)]
/// Enumeration for UMD stats (legacy)
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum UmdDriveStat { UMD_WAITFORDISC = 2, UMD_WAITFORINIT = 32, }
/// UMD Callback function
pub type UmdCallback =
::core::option::Option<unsafe extern "C" fn(unknown: i32,
event: i32) -> i32>;
extern "C" {
/// Check whether there is a disc in the UMD drive
///
/// @return 0 if no disc present, anything else indicates a disc is inserted.
pub fn sceUmdCheckMedium() -> i32;
}
extern "C" {
/// Get the disc info
///
/// @param info - A pointer to a ::pspUmdInfo struct
///
/// @return < 0 on error
pub fn sceUmdGetDiscInfo(info: *mut pspUmdInfo) -> i32;
}
extern "C" {
/// Activates the UMD drive
///
/// @param unit - The unit to initialise (probably). Should be set to 1.
///
/// @param drive - A prefix string for the fs device to mount the UMD on (e.g. "disc0:")
///
/// @return < 0 on error
///
/// @par Example:
/// @code
/// // Wait for disc and mount to filesystem
/// int i;
/// i = sceUmdCheckMedium();
/// if(i == 0)
/// {
/// sceUmdWaitDriveStat(PSP_UMD_PRESENT);
/// }
/// sceUmdActivate(1, "disc0:"); // Mount UMD to disc0: file system
/// sceUmdWaitDriveStat(PSP_UMD_READY);
/// // Now you can access the UMD using standard sceIo functions
/// @endcode
pub fn sceUmdActivate(unit: i32, drive: *const u8) -> i32;
}
extern "C" {
/// Deativates the UMD drive
///
/// @param unit - The unit to initialise (probably). Should be set to 1.
///
/// @param drive - A prefix string for the fs device to mount the UMD on (e.g. "disc0:")
///
/// @return < 0 on error
pub fn sceUmdDeactivate(unit: i32, drive: *const u8) -> i32;
}
extern "C" {
/// Wait for the UMD drive to reach a certain state
///
/// @param stat - One or more of ::pspUmdState
///
/// @return < 0 on error
pub fn sceUmdWaitDriveStat(stat: i32) -> i32;
}
extern "C" {
/// Wait for the UMD drive to reach a certain state
///
/// @param stat - One or more of ::pspUmdState
///
/// @param timeout - Timeout value in microseconds
///
/// @return < 0 on error
pub fn sceUmdWaitDriveStatWithTimer(stat: i32, timeout: u32)
-> i32;
}
extern "C" {
/// Wait for the UMD drive to reach a certain state (plus callback)
///
/// @param stat - One or more of ::pspUmdState
///
/// @param timeout - Timeout value in microseconds
///
/// @return < 0 on error
pub fn sceUmdWaitDriveStatCB(stat: i32, timeout: u32) -> i32;
}
extern "C" {
/// Cancel a sceUmdWait* call
///
/// @return < 0 on error
pub fn sceUmdCancelWaitDriveStat() -> i32;
}
extern "C" {
/// Get (poll) the current state of the UMD drive
///
/// @return < 0 on error, one or more of ::pspUmdState on success
pub fn sceUmdGetDriveStat() -> i32;
}
extern "C" {
/// Get the error code associated with a failed event
///
/// @return < 0 on error, the error code on success
pub fn sceUmdGetErrorStat() -> i32;
}
extern "C" {
/// Register a callback for the UMD drive
/// @note Callback is of type UmdCallback
///
/// @param cbid - A callback ID created from sceKernelCreateCallback
/// @return < 0 on error
/// @par Example:
/// @code
/// int umd_callback(int unknown, int event)
/// {
/// //do something
/// }
/// int cbid = sceKernelCreateCallback("UMD Callback", umd_callback, NULL);
/// sceUmdRegisterUMDCallBack(cbid);
/// @endcode
pub fn sceUmdRegisterUMDCallBack(cbid: i32) -> i32;
}
extern "C" {
/// Un-register a callback for the UMD drive
///
/// @param cbid - A callback ID created from sceKernelCreateCallback
///
/// @return < 0 on error
pub fn sceUmdUnRegisterUMDCallBack(cbid: i32) -> i32;
}
extern "C" {
/// Permit UMD disc being replaced
///
/// @return < 0 on error
pub fn sceUmdReplacePermit() -> i32;
}
extern "C" {
/// Prohibit UMD disc being replaced
///
/// @return < 0 on error
pub fn sceUmdReplaceProhibit() -> i32;
}
/// USB driver interface
#[repr(C)]
#[derive(Debug, Copy)]
pub struct UsbInterface {
/// Expectant interface (0 or -1)
pub expect_interface: i32,
/// Unknown
pub unk8: i32,
/// Number of interfaces
pub num_interface: i32,
}
#[test]
fn bindgen_test_layout_UsbInterface() {
assert_eq!(::core::mem::size_of::<UsbInterface>() , 12usize , concat ! (
"Size of: " , stringify ! ( UsbInterface ) ));
assert_eq! (::core::mem::align_of::<UsbInterface>() , 4usize , concat ! (
"Alignment of " , stringify ! ( UsbInterface ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbInterface ) ) . expect_interface as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( UsbInterface ) , "::" ,
stringify ! ( expect_interface ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbInterface ) ) . unk8 as * const _ as
usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( UsbInterface ) , "::" ,
stringify ! ( unk8 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbInterface ) ) . num_interface as *
const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( UsbInterface ) , "::" ,
stringify ! ( num_interface ) ));
}
impl Clone for UsbInterface {
fn clone(&self) -> Self { *self }
}
/// USB driver endpoint
#[repr(C)]
#[derive(Debug, Copy)]
pub struct UsbEndpoint {
/// Endpoint number (must be filled in sequentially)
pub endpnum: i32,
/// Filled in by the bus driver
pub unk2: i32,
/// Filled in by the bus driver
pub unk3: i32,
}
#[test]
fn bindgen_test_layout_UsbEndpoint() {
assert_eq!(::core::mem::size_of::<UsbEndpoint>() , 12usize , concat ! (
"Size of: " , stringify ! ( UsbEndpoint ) ));
assert_eq! (::core::mem::align_of::<UsbEndpoint>() , 4usize , concat ! (
"Alignment of " , stringify ! ( UsbEndpoint ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbEndpoint ) ) . endpnum as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( UsbEndpoint ) , "::" ,
stringify ! ( endpnum ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbEndpoint ) ) . unk2 as * const _ as
usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( UsbEndpoint ) , "::" ,
stringify ! ( unk2 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbEndpoint ) ) . unk3 as * const _ as
usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( UsbEndpoint ) , "::" ,
stringify ! ( unk3 ) ));
}
impl Clone for UsbEndpoint {
fn clone(&self) -> Self { *self }
}
/// USB string descriptor
#[repr(C, packed)]
#[derive(Debug, Copy)]
pub struct StringDescriptor {
pub bLength: u8,
pub bDescriptorType: u8,
pub bString: [i16; 32usize],
}
#[test]
fn bindgen_test_layout_StringDescriptor() {
assert_eq!(::core::mem::size_of::<StringDescriptor>() , 66usize , concat !
( "Size of: " , stringify ! ( StringDescriptor ) ));
assert_eq! (::core::mem::align_of::<StringDescriptor>() , 1usize , concat
! ( "Alignment of " , stringify ! ( StringDescriptor ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const StringDescriptor ) ) . bLength as * const
_ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( StringDescriptor ) ,
"::" , stringify ! ( bLength ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const StringDescriptor ) ) . bDescriptorType as
* const _ as usize } , 1usize , concat ! (
"Alignment of field: " , stringify ! ( StringDescriptor ) ,
"::" , stringify ! ( bDescriptorType ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const StringDescriptor ) ) . bString as * const
_ as usize } , 2usize , concat ! (
"Alignment of field: " , stringify ! ( StringDescriptor ) ,
"::" , stringify ! ( bString ) ));
}
impl Clone for StringDescriptor {
fn clone(&self) -> Self { *self }
}
/// USB device descriptor
#[repr(C, packed)]
#[derive(Debug, Copy)]
pub struct DeviceDescriptor {
pub bLength: u8,
pub bDescriptorType: u8,
pub bcdUSB: u16,
pub bDeviceClass: u8,
pub bDeviceSubClass: u8,
pub bDeviceProtocol: u8,
pub bMaxPacketSize: u8,
pub idVendor: u16,
pub idProduct: u16,
pub bcdDevice: u16,
pub iManufacturer: u8,
pub iProduct: u8,
pub iSerialNumber: u8,
pub bNumConfigurations: u8,
}
#[test]
fn bindgen_test_layout_DeviceDescriptor() {
assert_eq!(::core::mem::size_of::<DeviceDescriptor>() , 18usize , concat !
( "Size of: " , stringify ! ( DeviceDescriptor ) ));
assert_eq! (::core::mem::align_of::<DeviceDescriptor>() , 1usize , concat
! ( "Alignment of " , stringify ! ( DeviceDescriptor ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const DeviceDescriptor ) ) . bLength as * const
_ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( DeviceDescriptor ) ,
"::" , stringify ! ( bLength ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const DeviceDescriptor ) ) . bDescriptorType as
* const _ as usize } , 1usize , concat ! (
"Alignment of field: " , stringify ! ( DeviceDescriptor ) ,
"::" , stringify ! ( bDescriptorType ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const DeviceDescriptor ) ) . bcdUSB as * const
_ as usize } , 2usize , concat ! (
"Alignment of field: " , stringify ! ( DeviceDescriptor ) ,
"::" , stringify ! ( bcdUSB ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const DeviceDescriptor ) ) . bDeviceClass as *
const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( DeviceDescriptor ) ,
"::" , stringify ! ( bDeviceClass ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const DeviceDescriptor ) ) . bDeviceSubClass as
* const _ as usize } , 5usize , concat ! (
"Alignment of field: " , stringify ! ( DeviceDescriptor ) ,
"::" , stringify ! ( bDeviceSubClass ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const DeviceDescriptor ) ) . bDeviceProtocol as
* const _ as usize } , 6usize , concat ! (
"Alignment of field: " , stringify ! ( DeviceDescriptor ) ,
"::" , stringify ! ( bDeviceProtocol ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const DeviceDescriptor ) ) . bMaxPacketSize as
* const _ as usize } , 7usize , concat ! (
"Alignment of field: " , stringify ! ( DeviceDescriptor ) ,
"::" , stringify ! ( bMaxPacketSize ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const DeviceDescriptor ) ) . idVendor as *
const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( DeviceDescriptor ) ,
"::" , stringify ! ( idVendor ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const DeviceDescriptor ) ) . idProduct as *
const _ as usize } , 10usize , concat ! (
"Alignment of field: " , stringify ! ( DeviceDescriptor ) ,
"::" , stringify ! ( idProduct ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const DeviceDescriptor ) ) . bcdDevice as *
const _ as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( DeviceDescriptor ) ,
"::" , stringify ! ( bcdDevice ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const DeviceDescriptor ) ) . iManufacturer as *
const _ as usize } , 14usize , concat ! (
"Alignment of field: " , stringify ! ( DeviceDescriptor ) ,
"::" , stringify ! ( iManufacturer ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const DeviceDescriptor ) ) . iProduct as *
const _ as usize } , 15usize , concat ! (
"Alignment of field: " , stringify ! ( DeviceDescriptor ) ,
"::" , stringify ! ( iProduct ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const DeviceDescriptor ) ) . iSerialNumber as *
const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( DeviceDescriptor ) ,
"::" , stringify ! ( iSerialNumber ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const DeviceDescriptor ) ) . bNumConfigurations
as * const _ as usize } , 17usize , concat ! (
"Alignment of field: " , stringify ! ( DeviceDescriptor ) ,
"::" , stringify ! ( bNumConfigurations ) ));
}
impl Clone for DeviceDescriptor {
fn clone(&self) -> Self { *self }
}
/// USB configuration descriptor
#[repr(C, packed)]
#[derive(Debug, Copy)]
pub struct ConfigDescriptor {
pub bLength: u8,
pub bDescriptorType: u8,
pub wTotalLength: u16,
pub bNumInterfaces: u8,
pub bConfigurationValue: u8,
pub iConfiguration: u8,
pub bmAttributes: u8,
pub bMaxPower: u8,
}
#[test]
fn bindgen_test_layout_ConfigDescriptor() {
assert_eq!(::core::mem::size_of::<ConfigDescriptor>() , 9usize , concat !
( "Size of: " , stringify ! ( ConfigDescriptor ) ));
assert_eq! (::core::mem::align_of::<ConfigDescriptor>() , 1usize , concat
! ( "Alignment of " , stringify ! ( ConfigDescriptor ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ConfigDescriptor ) ) . bLength as * const
_ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( ConfigDescriptor ) ,
"::" , stringify ! ( bLength ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ConfigDescriptor ) ) . bDescriptorType as
* const _ as usize } , 1usize , concat ! (
"Alignment of field: " , stringify ! ( ConfigDescriptor ) ,
"::" , stringify ! ( bDescriptorType ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ConfigDescriptor ) ) . wTotalLength as *
const _ as usize } , 2usize , concat ! (
"Alignment of field: " , stringify ! ( ConfigDescriptor ) ,
"::" , stringify ! ( wTotalLength ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ConfigDescriptor ) ) . bNumInterfaces as
* const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( ConfigDescriptor ) ,
"::" , stringify ! ( bNumInterfaces ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ConfigDescriptor ) ) .
bConfigurationValue as * const _ as usize } , 5usize , concat
! (
"Alignment of field: " , stringify ! ( ConfigDescriptor ) ,
"::" , stringify ! ( bConfigurationValue ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ConfigDescriptor ) ) . iConfiguration as
* const _ as usize } , 6usize , concat ! (
"Alignment of field: " , stringify ! ( ConfigDescriptor ) ,
"::" , stringify ! ( iConfiguration ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ConfigDescriptor ) ) . bmAttributes as *
const _ as usize } , 7usize , concat ! (
"Alignment of field: " , stringify ! ( ConfigDescriptor ) ,
"::" , stringify ! ( bmAttributes ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const ConfigDescriptor ) ) . bMaxPower as *
const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( ConfigDescriptor ) ,
"::" , stringify ! ( bMaxPower ) ));
}
impl Clone for ConfigDescriptor {
fn clone(&self) -> Self { *self }
}
/// USB Interface descriptor
#[repr(C, packed)]
#[derive(Debug, Copy)]
pub struct InterfaceDescriptor {
pub bLength: u8,
pub bDescriptorType: u8,
pub bInterfaceNumber: u8,
pub bAlternateSetting: u8,
pub bNumEndpoints: u8,
pub bInterfaceClass: u8,
pub bInterfaceSubClass: u8,
pub bInterfaceProtocol: u8,
pub iInterface: u8,
}
#[test]
fn bindgen_test_layout_InterfaceDescriptor() {
assert_eq!(::core::mem::size_of::<InterfaceDescriptor>() , 9usize , concat
! ( "Size of: " , stringify ! ( InterfaceDescriptor ) ));
assert_eq! (::core::mem::align_of::<InterfaceDescriptor>() , 1usize ,
concat ! (
"Alignment of " , stringify ! ( InterfaceDescriptor ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const InterfaceDescriptor ) ) . bLength as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( InterfaceDescriptor ) ,
"::" , stringify ! ( bLength ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const InterfaceDescriptor ) ) . bDescriptorType
as * const _ as usize } , 1usize , concat ! (
"Alignment of field: " , stringify ! ( InterfaceDescriptor ) ,
"::" , stringify ! ( bDescriptorType ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const InterfaceDescriptor ) ) .
bInterfaceNumber as * const _ as usize } , 2usize , concat ! (
"Alignment of field: " , stringify ! ( InterfaceDescriptor ) ,
"::" , stringify ! ( bInterfaceNumber ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const InterfaceDescriptor ) ) .
bAlternateSetting as * const _ as usize } , 3usize , concat !
(
"Alignment of field: " , stringify ! ( InterfaceDescriptor ) ,
"::" , stringify ! ( bAlternateSetting ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const InterfaceDescriptor ) ) . bNumEndpoints
as * const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( InterfaceDescriptor ) ,
"::" , stringify ! ( bNumEndpoints ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const InterfaceDescriptor ) ) . bInterfaceClass
as * const _ as usize } , 5usize , concat ! (
"Alignment of field: " , stringify ! ( InterfaceDescriptor ) ,
"::" , stringify ! ( bInterfaceClass ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const InterfaceDescriptor ) ) .
bInterfaceSubClass as * const _ as usize } , 6usize , concat !
(
"Alignment of field: " , stringify ! ( InterfaceDescriptor ) ,
"::" , stringify ! ( bInterfaceSubClass ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const InterfaceDescriptor ) ) .
bInterfaceProtocol as * const _ as usize } , 7usize , concat !
(
"Alignment of field: " , stringify ! ( InterfaceDescriptor ) ,
"::" , stringify ! ( bInterfaceProtocol ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const InterfaceDescriptor ) ) . iInterface as *
const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( InterfaceDescriptor ) ,
"::" , stringify ! ( iInterface ) ));
}
impl Clone for InterfaceDescriptor {
fn clone(&self) -> Self { *self }
}
/// USB endpoint descriptor
#[repr(C, packed)]
#[derive(Debug, Copy)]
pub struct EndpointDescriptor {
pub bLength: u8,
pub bDescriptorType: u8,
pub bEndpointAddress: u8,
pub bmAttributes: u8,
pub wMaxPacketSize: u16,
pub bInterval: u8,
}
#[test]
fn bindgen_test_layout_EndpointDescriptor() {
assert_eq!(::core::mem::size_of::<EndpointDescriptor>() , 7usize , concat
! ( "Size of: " , stringify ! ( EndpointDescriptor ) ));
assert_eq! (::core::mem::align_of::<EndpointDescriptor>() , 1usize ,
concat ! (
"Alignment of " , stringify ! ( EndpointDescriptor ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const EndpointDescriptor ) ) . bLength as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( EndpointDescriptor ) ,
"::" , stringify ! ( bLength ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const EndpointDescriptor ) ) . bDescriptorType
as * const _ as usize } , 1usize , concat ! (
"Alignment of field: " , stringify ! ( EndpointDescriptor ) ,
"::" , stringify ! ( bDescriptorType ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const EndpointDescriptor ) ) . bEndpointAddress
as * const _ as usize } , 2usize , concat ! (
"Alignment of field: " , stringify ! ( EndpointDescriptor ) ,
"::" , stringify ! ( bEndpointAddress ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const EndpointDescriptor ) ) . bmAttributes as
* const _ as usize } , 3usize , concat ! (
"Alignment of field: " , stringify ! ( EndpointDescriptor ) ,
"::" , stringify ! ( bmAttributes ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const EndpointDescriptor ) ) . wMaxPacketSize
as * const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( EndpointDescriptor ) ,
"::" , stringify ! ( wMaxPacketSize ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const EndpointDescriptor ) ) . bInterval as *
const _ as usize } , 6usize , concat ! (
"Alignment of field: " , stringify ! ( EndpointDescriptor ) ,
"::" , stringify ! ( bInterval ) ));
}
impl Clone for EndpointDescriptor {
fn clone(&self) -> Self { *self }
}
/// USB driver interfaces structure
#[repr(C)]
#[derive(Debug, Copy)]
pub struct UsbInterfaces {
/// Pointers to the individual interface descriptors
pub infp: [*mut InterfaceDescriptor; 2usize],
/// Number of interface descriptors
pub num: u32,
}
#[test]
fn bindgen_test_layout_UsbInterfaces() {
assert_eq!(::core::mem::size_of::<UsbInterfaces>() , 24usize , concat ! (
"Size of: " , stringify ! ( UsbInterfaces ) ));
assert_eq! (::core::mem::align_of::<UsbInterfaces>() , 8usize , concat ! (
"Alignment of " , stringify ! ( UsbInterfaces ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbInterfaces ) ) . infp as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( UsbInterfaces ) , "::"
, stringify ! ( infp ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbInterfaces ) ) . num as * const _ as
usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( UsbInterfaces ) , "::"
, stringify ! ( num ) ));
}
impl Clone for UsbInterfaces {
fn clone(&self) -> Self { *self }
}
/// USB driver configuration
#[repr(C)]
#[derive(Debug, Copy)]
pub struct UsbConfiguration {
/// Pointer to the configuration descriptors
pub confp: *mut ConfigDescriptor,
/// USB driver interfaces pointer
pub infs: *mut UsbInterfaces,
/// Pointer to the first interface descriptor
pub infp: *mut InterfaceDescriptor,
/// Pointer to the first endpoint descriptor (each should be 16byte aligned)
pub endp: *mut EndpointDescriptor,
}
#[test]
fn bindgen_test_layout_UsbConfiguration() {
assert_eq!(::core::mem::size_of::<UsbConfiguration>() , 32usize , concat !
( "Size of: " , stringify ! ( UsbConfiguration ) ));
assert_eq! (::core::mem::align_of::<UsbConfiguration>() , 8usize , concat
! ( "Alignment of " , stringify ! ( UsbConfiguration ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbConfiguration ) ) . confp as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( UsbConfiguration ) ,
"::" , stringify ! ( confp ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbConfiguration ) ) . infs as * const _
as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( UsbConfiguration ) ,
"::" , stringify ! ( infs ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbConfiguration ) ) . infp as * const _
as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( UsbConfiguration ) ,
"::" , stringify ! ( infp ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbConfiguration ) ) . endp as * const _
as usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! ( UsbConfiguration ) ,
"::" , stringify ! ( endp ) ));
}
impl Clone for UsbConfiguration {
fn clone(&self) -> Self { *self }
}
/// Padded data structure, padding is required otherwise the USB hardware crashes
#[repr(C, packed)]
#[derive(Debug, Copy)]
pub struct UsbData {
pub devdesc: [u8; 20usize],
pub config: UsbData_Config,
pub confdesc: UsbData_ConfDesc,
pub pad1: [u8; 8usize],
pub interfaces: UsbData_Interfaces,
pub interdesc: UsbData_InterDesc,
pub endp: [UsbData_Endp; 4usize],
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct UsbData_Config {
pub pconfdesc: *mut c_void,
pub pinterfaces: *mut c_void,
pub pinterdesc: *mut c_void,
pub pendp: *mut c_void,
}
#[test]
fn bindgen_test_layout_UsbData_Config() {
assert_eq!(::core::mem::size_of::<UsbData_Config>() , 32usize , concat ! (
"Size of: " , stringify ! ( UsbData_Config ) ));
assert_eq! (::core::mem::align_of::<UsbData_Config>() , 8usize , concat !
( "Alignment of " , stringify ! ( UsbData_Config ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbData_Config ) ) . pconfdesc as * const
_ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( UsbData_Config ) , "::"
, stringify ! ( pconfdesc ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbData_Config ) ) . pinterfaces as *
const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( UsbData_Config ) , "::"
, stringify ! ( pinterfaces ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbData_Config ) ) . pinterdesc as *
const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( UsbData_Config ) , "::"
, stringify ! ( pinterdesc ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbData_Config ) ) . pendp as * const _
as usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! ( UsbData_Config ) , "::"
, stringify ! ( pendp ) ));
}
impl Clone for UsbData_Config {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct UsbData_ConfDesc {
pub desc: [u8; 12usize],
pub pinterfaces: *mut c_void,
}
#[test]
fn bindgen_test_layout_UsbData_ConfDesc() {
assert_eq!(::core::mem::size_of::<UsbData_ConfDesc>() , 24usize , concat !
( "Size of: " , stringify ! ( UsbData_ConfDesc ) ));
assert_eq! (::core::mem::align_of::<UsbData_ConfDesc>() , 8usize , concat
! ( "Alignment of " , stringify ! ( UsbData_ConfDesc ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbData_ConfDesc ) ) . desc as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( UsbData_ConfDesc ) ,
"::" , stringify ! ( desc ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbData_ConfDesc ) ) . pinterfaces as *
const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( UsbData_ConfDesc ) ,
"::" , stringify ! ( pinterfaces ) ));
}
impl Clone for UsbData_ConfDesc {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct UsbData_Interfaces {
pub pinterdesc: [*mut c_void; 2usize],
pub intcount: u32,
}
#[test]
fn bindgen_test_layout_UsbData_Interfaces() {
assert_eq!(::core::mem::size_of::<UsbData_Interfaces>() , 24usize , concat
! ( "Size of: " , stringify ! ( UsbData_Interfaces ) ));
assert_eq! (::core::mem::align_of::<UsbData_Interfaces>() , 8usize ,
concat ! (
"Alignment of " , stringify ! ( UsbData_Interfaces ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbData_Interfaces ) ) . pinterdesc as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( UsbData_Interfaces ) ,
"::" , stringify ! ( pinterdesc ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbData_Interfaces ) ) . intcount as *
const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( UsbData_Interfaces ) ,
"::" , stringify ! ( intcount ) ));
}
impl Clone for UsbData_Interfaces {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct UsbData_InterDesc {
pub desc: [u8; 12usize],
pub pendp: *mut c_void,
pub pad: [u8; 32usize],
}
#[test]
fn bindgen_test_layout_UsbData_InterDesc() {
assert_eq!(::core::mem::size_of::<UsbData_InterDesc>() , 56usize , concat
! ( "Size of: " , stringify ! ( UsbData_InterDesc ) ));
assert_eq! (::core::mem::align_of::<UsbData_InterDesc>() , 8usize , concat
! ( "Alignment of " , stringify ! ( UsbData_InterDesc ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbData_InterDesc ) ) . desc as * const _
as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( UsbData_InterDesc ) ,
"::" , stringify ! ( desc ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbData_InterDesc ) ) . pendp as * const
_ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( UsbData_InterDesc ) ,
"::" , stringify ! ( pendp ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbData_InterDesc ) ) . pad as * const _
as usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! ( UsbData_InterDesc ) ,
"::" , stringify ! ( pad ) ));
}
impl Clone for UsbData_InterDesc {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct UsbData_Endp {
pub desc: [u8; 16usize],
}
#[test]
fn bindgen_test_layout_UsbData_Endp() {
assert_eq!(::core::mem::size_of::<UsbData_Endp>() , 16usize , concat ! (
"Size of: " , stringify ! ( UsbData_Endp ) ));
assert_eq! (::core::mem::align_of::<UsbData_Endp>() , 1usize , concat ! (
"Alignment of " , stringify ! ( UsbData_Endp ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbData_Endp ) ) . desc as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( UsbData_Endp ) , "::" ,
stringify ! ( desc ) ));
}
impl Clone for UsbData_Endp {
fn clone(&self) -> Self { *self }
}
#[test]
fn bindgen_test_layout_UsbData() {
assert_eq!(::core::mem::size_of::<UsbData>() , 228usize , concat ! (
"Size of: " , stringify ! ( UsbData ) ));
assert_eq! (::core::mem::align_of::<UsbData>() , 1usize , concat ! (
"Alignment of " , stringify ! ( UsbData ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbData ) ) . devdesc as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( UsbData ) , "::" ,
stringify ! ( devdesc ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbData ) ) . config as * const _ as
usize } , 20usize , concat ! (
"Alignment of field: " , stringify ! ( UsbData ) , "::" ,
stringify ! ( config ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbData ) ) . confdesc as * const _ as
usize } , 52usize , concat ! (
"Alignment of field: " , stringify ! ( UsbData ) , "::" ,
stringify ! ( confdesc ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbData ) ) . pad1 as * const _ as usize
} , 76usize , concat ! (
"Alignment of field: " , stringify ! ( UsbData ) , "::" ,
stringify ! ( pad1 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbData ) ) . interfaces as * const _ as
usize } , 84usize , concat ! (
"Alignment of field: " , stringify ! ( UsbData ) , "::" ,
stringify ! ( interfaces ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbData ) ) . interdesc as * const _ as
usize } , 108usize , concat ! (
"Alignment of field: " , stringify ! ( UsbData ) , "::" ,
stringify ! ( interdesc ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbData ) ) . endp as * const _ as usize
} , 164usize , concat ! (
"Alignment of field: " , stringify ! ( UsbData ) , "::" ,
stringify ! ( endp ) ));
}
impl Clone for UsbData {
fn clone(&self) -> Self { *self }
}
/// USB EP0 Device Request
#[repr(C, packed)]
#[derive(Debug, Copy)]
pub struct DeviceRequest {
pub bmRequestType: u8,
pub bRequest: u8,
pub wValue: u16,
pub wIndex: u16,
pub wLength: u16,
}
#[test]
fn bindgen_test_layout_DeviceRequest() {
assert_eq!(::core::mem::size_of::<DeviceRequest>() , 8usize , concat ! (
"Size of: " , stringify ! ( DeviceRequest ) ));
assert_eq! (::core::mem::align_of::<DeviceRequest>() , 1usize , concat ! (
"Alignment of " , stringify ! ( DeviceRequest ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const DeviceRequest ) ) . bmRequestType as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( DeviceRequest ) , "::"
, stringify ! ( bmRequestType ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const DeviceRequest ) ) . bRequest as * const _
as usize } , 1usize , concat ! (
"Alignment of field: " , stringify ! ( DeviceRequest ) , "::"
, stringify ! ( bRequest ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const DeviceRequest ) ) . wValue as * const _
as usize } , 2usize , concat ! (
"Alignment of field: " , stringify ! ( DeviceRequest ) , "::"
, stringify ! ( wValue ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const DeviceRequest ) ) . wIndex as * const _
as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( DeviceRequest ) , "::"
, stringify ! ( wIndex ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const DeviceRequest ) ) . wLength as * const _
as usize } , 6usize , concat ! (
"Alignment of field: " , stringify ! ( DeviceRequest ) , "::"
, stringify ! ( wLength ) ));
}
impl Clone for DeviceRequest {
fn clone(&self) -> Self { *self }
}
/// USB driver structure used by ::sceUsbbdRegister and ::sceUsbbdUnregister
#[repr(C)]
#[derive(Debug, Copy)]
pub struct UsbDriver {
/// Name of the USB driver
pub name: *const u8,
/// Number of endpoints in this driver (including default control)
pub endpoints: i32,
/// List of endpoint structures (used when calling other functions)
pub endp: *mut UsbEndpoint,
/// Interface list
pub intp: *mut UsbInterface,
/// Pointer to hi-speed device descriptor
pub devp_hi: *mut c_void,
/// Pointer to hi-speed device configuration
pub confp_hi: *mut c_void,
/// Pointer to full-speed device descriptor
pub devp: *mut c_void,
/// Pointer to full-speed device configuration
pub confp: *mut c_void,
/// Default String descriptor
pub str: *mut StringDescriptor,
/// Received a control request arg0 is endpoint, arg1 is possibly data arg2 is data buffer
pub recvctl: ::core::option::Option<unsafe extern "C" fn(arg1: i32,
arg2: i32,
req:
*mut DeviceRequest)
-> i32>,
/// Unknown
pub func28: ::core::option::Option<unsafe extern "C" fn(arg1: i32,
arg2: i32,
arg3: i32)
-> i32>,
/// Configuration set (attach) function
pub attach: ::core::option::Option<unsafe extern "C" fn(speed: i32,
arg2:
*mut c_void,
arg3:
*mut c_void)
-> i32>,
/// Configuration unset (detach) function
pub detach: ::core::option::Option<unsafe extern "C" fn(arg1: i32,
arg2: i32,
arg3: i32)
-> i32>,
/// Unknown set to 0
pub unk34: i32,
/// Function called when the driver is started
pub start_func: ::core::option::Option<unsafe extern "C" fn(size: i32,
args:
*mut c_void)
-> i32>,
/// Function called when the driver is stopped
pub stop_func: ::core::option::Option<unsafe extern "C" fn(size: i32,
args:
*mut c_void)
-> i32>,
/// Link to next USB driver in the chain, set to NULL
pub link: *mut UsbDriver,
}
#[test]
fn bindgen_test_layout_UsbDriver() {
assert_eq!(::core::mem::size_of::<UsbDriver>() , 136usize , concat ! (
"Size of: " , stringify ! ( UsbDriver ) ));
assert_eq! (::core::mem::align_of::<UsbDriver>() , 8usize , concat ! (
"Alignment of " , stringify ! ( UsbDriver ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbDriver ) ) . name as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( UsbDriver ) , "::" ,
stringify ! ( name ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbDriver ) ) . endpoints as * const _ as
usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( UsbDriver ) , "::" ,
stringify ! ( endpoints ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbDriver ) ) . endp as * const _ as
usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( UsbDriver ) , "::" ,
stringify ! ( endp ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbDriver ) ) . intp as * const _ as
usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! ( UsbDriver ) , "::" ,
stringify ! ( intp ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbDriver ) ) . devp_hi as * const _ as
usize } , 32usize , concat ! (
"Alignment of field: " , stringify ! ( UsbDriver ) , "::" ,
stringify ! ( devp_hi ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbDriver ) ) . confp_hi as * const _ as
usize } , 40usize , concat ! (
"Alignment of field: " , stringify ! ( UsbDriver ) , "::" ,
stringify ! ( confp_hi ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbDriver ) ) . devp as * const _ as
usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! ( UsbDriver ) , "::" ,
stringify ! ( devp ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbDriver ) ) . confp as * const _ as
usize } , 56usize , concat ! (
"Alignment of field: " , stringify ! ( UsbDriver ) , "::" ,
stringify ! ( confp ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbDriver ) ) . str as * const _ as usize
} , 64usize , concat ! (
"Alignment of field: " , stringify ! ( UsbDriver ) , "::" ,
stringify ! ( str ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbDriver ) ) . recvctl as * const _ as
usize } , 72usize , concat ! (
"Alignment of field: " , stringify ! ( UsbDriver ) , "::" ,
stringify ! ( recvctl ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbDriver ) ) . func28 as * const _ as
usize } , 80usize , concat ! (
"Alignment of field: " , stringify ! ( UsbDriver ) , "::" ,
stringify ! ( func28 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbDriver ) ) . attach as * const _ as
usize } , 88usize , concat ! (
"Alignment of field: " , stringify ! ( UsbDriver ) , "::" ,
stringify ! ( attach ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbDriver ) ) . detach as * const _ as
usize } , 96usize , concat ! (
"Alignment of field: " , stringify ! ( UsbDriver ) , "::" ,
stringify ! ( detach ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbDriver ) ) . unk34 as * const _ as
usize } , 104usize , concat ! (
"Alignment of field: " , stringify ! ( UsbDriver ) , "::" ,
stringify ! ( unk34 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbDriver ) ) . start_func as * const _
as usize } , 112usize , concat ! (
"Alignment of field: " , stringify ! ( UsbDriver ) , "::" ,
stringify ! ( start_func ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbDriver ) ) . stop_func as * const _ as
usize } , 120usize , concat ! (
"Alignment of field: " , stringify ! ( UsbDriver ) , "::" ,
stringify ! ( stop_func ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbDriver ) ) . link as * const _ as
usize } , 128usize , concat ! (
"Alignment of field: " , stringify ! ( UsbDriver ) , "::" ,
stringify ! ( link ) ));
}
impl Clone for UsbDriver {
fn clone(&self) -> Self { *self }
}
/// USB device request, used by ::sceUsbbdReqSend and ::sceUsbbdReqRecv.
#[repr(C)]
#[derive(Debug, Copy)]
pub struct UsbdDeviceReq {
/// Pointer to the endpoint to queue request on
pub endp: *mut UsbEndpoint,
/// Pointer to the data buffer to use in the request
pub data: *mut c_void,
/// Size of the data buffer (send == size of data, recv == size of max receive)
pub size: i32,
/// Unknown
pub unkc: i32,
/// Pointer to the function to call on completion
pub func: *mut c_void,
/// Resultant size (send == size of data sent, recv == size of data received)
pub recvsize: i32,
/// Return code of the request, 0 == success, -3 == cancelled
pub retcode: i32,
/// Unknown
pub unk1c: i32,
/// A user specified pointer for the device request
pub arg: *mut c_void,
/// Link pointer to next request used by the driver, set it to NULL
pub link: *mut c_void,
}
#[test]
fn bindgen_test_layout_UsbdDeviceReq() {
assert_eq!(::core::mem::size_of::<UsbdDeviceReq>() , 64usize , concat ! (
"Size of: " , stringify ! ( UsbdDeviceReq ) ));
assert_eq! (::core::mem::align_of::<UsbdDeviceReq>() , 8usize , concat ! (
"Alignment of " , stringify ! ( UsbdDeviceReq ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbdDeviceReq ) ) . endp as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( UsbdDeviceReq ) , "::"
, stringify ! ( endp ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbdDeviceReq ) ) . data as * const _ as
usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( UsbdDeviceReq ) , "::"
, stringify ! ( data ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbdDeviceReq ) ) . size as * const _ as
usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( UsbdDeviceReq ) , "::"
, stringify ! ( size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbdDeviceReq ) ) . unkc as * const _ as
usize } , 20usize , concat ! (
"Alignment of field: " , stringify ! ( UsbdDeviceReq ) , "::"
, stringify ! ( unkc ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbdDeviceReq ) ) . func as * const _ as
usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! ( UsbdDeviceReq ) , "::"
, stringify ! ( func ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbdDeviceReq ) ) . recvsize as * const _
as usize } , 32usize , concat ! (
"Alignment of field: " , stringify ! ( UsbdDeviceReq ) , "::"
, stringify ! ( recvsize ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbdDeviceReq ) ) . retcode as * const _
as usize } , 36usize , concat ! (
"Alignment of field: " , stringify ! ( UsbdDeviceReq ) , "::"
, stringify ! ( retcode ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbdDeviceReq ) ) . unk1c as * const _ as
usize } , 40usize , concat ! (
"Alignment of field: " , stringify ! ( UsbdDeviceReq ) , "::"
, stringify ! ( unk1c ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbdDeviceReq ) ) . arg as * const _ as
usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! ( UsbdDeviceReq ) , "::"
, stringify ! ( arg ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const UsbdDeviceReq ) ) . link as * const _ as
usize } , 56usize , concat ! (
"Alignment of field: " , stringify ! ( UsbdDeviceReq ) , "::"
, stringify ! ( link ) ));
}
impl Clone for UsbdDeviceReq {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// Register a USB driver.
///
/// @param drv - Pointer to a filled out USB driver
///
/// @return 0 on success, < 0 on error
pub fn sceUsbbdRegister(drv: *mut UsbDriver) -> i32;
}
extern "C" {
/// Unregister a USB driver
///
/// @param drv - Pointer to a filled out USB driver
///
/// @return 0 on success, < 0 on error
pub fn sceUsbbdUnregister(drv: *mut UsbDriver) -> i32;
}
extern "C" {
/// Clear the FIFO on an endpoint
///
/// @param endp - The endpoint to clear
///
/// @return 0 on success, < 0 on error
pub fn sceUsbbdClearFIFO(endp: *mut UsbEndpoint) -> i32;
}
extern "C" {
/// Cancel any pending requests on an endpoint.
///
/// @param endp - The endpoint to cancel
///
/// @return 0 on success, < 0 on error
pub fn sceUsbbdReqCancelAll(endp: *mut UsbEndpoint) -> i32;
}
extern "C" {
/// Stall an endpoint
///
/// @param endp - The endpoint to stall
///
/// @return 0 on success, < 0 on error
pub fn sceUsbbdStall(endp: *mut UsbEndpoint) -> i32;
}
extern "C" {
/// Queue a send request (IN from host pov)
///
/// @param req - Pointer to a filled out UsbdDeviceReq structure.
///
/// @return 0 on success, < 0 on error
pub fn sceUsbbdReqSend(req: *mut UsbdDeviceReq) -> i32;
}
extern "C" {
/// Queue a receive request (OUT from host pov)
///
/// @param req - Pointer to a filled out UsbdDeviceReq structure
///
/// @return 0 on success, < 0 on error
pub fn sceUsbbdReqRecv(req: *mut UsbdDeviceReq) -> i32;
}
#[repr(u32)]
/// Resolutions for sceUsbCamSetupStill &
/// sceUsbCamSetupVideo
/// DO NOT use on sceUsbCamSetupStillEx & sceUsbCamSetupVideoEx
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspUsbCamResolution {
PSP_USBCAM_RESOLUTION_160_120 = 0,
PSP_USBCAM_RESOLUTION_176_144 = 1,
PSP_USBCAM_RESOLUTION_320_240 = 2,
PSP_USBCAM_RESOLUTION_352_288 = 3,
PSP_USBCAM_RESOLUTION_640_480 = 4,
PSP_USBCAM_RESOLUTION_1024_768 = 5,
PSP_USBCAM_RESOLUTION_1280_960 = 6,
PSP_USBCAM_RESOLUTION_480_272 = 7,
PSP_USBCAM_RESOLUTION_360_272 = 8,
}
#[repr(u32)]
/// Resolutions for sceUsbCamSetupStillEx &
/// sceUsbCamSetupVideoEx
/// DO NOT use on sceUsbCamSetupStill & sceUsbCamSetupVideo
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspUsbCamResolutionEx {
PSP_USBCAM_RESOLUTION_EX_160_120 = 0,
PSP_USBCAM_RESOLUTION_EX_176_144 = 1,
PSP_USBCAM_RESOLUTION_EX_320_240 = 2,
PSP_USBCAM_RESOLUTION_EX_352_288 = 3,
PSP_USBCAM_RESOLUTION_EX_360_272 = 4,
PSP_USBCAM_RESOLUTION_EX_480_272 = 5,
PSP_USBCAM_RESOLUTION_EX_640_480 = 6,
PSP_USBCAM_RESOLUTION_EX_1024_768 = 7,
PSP_USBCAM_RESOLUTION_EX_1280_960 = 8,
}
#[repr(u32)]
/// Flags for reverse effects.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspUsbCamReverseFlags {
PSP_USBCAM_FLIP = 1,
PSP_USBCAM_MIRROR = 256,
}
#[repr(u32)]
/// Delay to take pictures
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspUsbCamDelay {
PSP_USBCAM_NODELAY = 0,
PSP_USBCAM_DELAY_10SEC = 1,
PSP_USBCAM_DELAY_20SEC = 2,
PSP_USBCAM_DELAY_30SEC = 3,
}
#[repr(u32)]
/// Usbcam framerates
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspUsbCamFrameRate {
PSP_USBCAM_FRAMERATE_3_75_FPS = 0,
PSP_USBCAM_FRAMERATE_5_FPS = 1,
PSP_USBCAM_FRAMERATE_7_5_FPS = 2,
PSP_USBCAM_FRAMERATE_10_FPS = 3,
PSP_USBCAM_FRAMERATE_15_FPS = 4,
PSP_USBCAM_FRAMERATE_20_FPS = 5,
PSP_USBCAM_FRAMERATE_30_FPS = 6,
PSP_USBCAM_FRAMERATE_60_FPS = 7,
}
#[repr(u32)]
/// White balance values
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspUsbCamWB {
PSP_USBCAM_WB_AUTO = 0,
PSP_USBCAM_WB_DAYLIGHT = 1,
PSP_USBCAM_WB_FLUORESCENT = 2,
PSP_USBCAM_WB_INCADESCENT = 3,
}
#[repr(u32)]
/// Effect modes
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspUsbCamEffectMode {
PSP_USBCAM_EFFECTMODE_NORMAL = 0,
PSP_USBCAM_EFFECTMODE_NEGATIVE = 1,
PSP_USBCAM_EFFECTMODE_BLACKWHITE = 2,
PSP_USBCAM_EFFECTMODE_SEPIA = 3,
PSP_USBCAM_EFFECTMODE_BLUE = 4,
PSP_USBCAM_EFFECTMODE_RED = 5,
PSP_USBCAM_EFFECTMODE_GREEN = 6,
}
#[repr(u32)]
/// Exposure levels
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspUsbCamEVLevel {
PSP_USBCAM_EVLEVEL_2_0_POSITIVE = 0,
PSP_USBCAM_EVLEVEL_1_7_POSITIVE = 1,
PSP_USBCAM_EVLEVEL_1_5_POSITIVE = 2,
PSP_USBCAM_EVLEVEL_1_3_POSITIVE = 3,
PSP_USBCAM_EVLEVEL_1_0_POSITIVE = 4,
PSP_USBCAM_EVLEVEL_0_7_POSITIVE = 5,
PSP_USBCAM_EVLEVEL_0_5_POSITIVE = 6,
PSP_USBCAM_EVLEVEL_0_3_POSITIVE = 7,
PSP_USBCAM_EVLEVEL_0_0 = 8,
PSP_USBCAM_EVLEVEL_0_3_NEGATIVE = 9,
PSP_USBCAM_EVLEVEL_0_5_NEGATIVE = 10,
PSP_USBCAM_EVLEVEL_0_7_NEGATIVE = 11,
PSP_USBCAM_EVLEVEL_1_0_NEGATIVE = 12,
PSP_USBCAM_EVLEVEL_1_3_NEGATIVE = 13,
PSP_USBCAM_EVLEVEL_1_5_NEGATIVE = 14,
PSP_USBCAM_EVLEVEL_1_7_NEGATIVE = 15,
PSP_USBCAM_EVLEVEL_2_0_NEGATIVE = 16,
}
/// Structure for sceUsbCamSetupStill
#[repr(C)]
#[derive(Debug, Copy)]
pub struct PspUsbCamSetupStillParam {
/// Size of the ::PspUsbCamSetupStillParam structure
pub size: i32,
/// Resolution. One of ::PspUsbCamResolution
pub resolution: i32,
/// Size of the jpeg image
pub jpegsize: i32,
/// Reverse effect to apply. Zero or more of ::PspUsbCamReverseFlags
pub reverseflags: i32,
/// Delay to apply to take the picture. One of ::PspUsbCamDelay
pub delay: i32,
/// JPEG compression level, a value from 1-63.
/// 1 -> less compression, better quality; 63 -> max compression, worse quality
pub complevel: i32,
}
#[test]
fn bindgen_test_layout_PspUsbCamSetupStillParam() {
assert_eq!(::core::mem::size_of::<PspUsbCamSetupStillParam>() , 24usize ,
concat ! (
"Size of: " , stringify ! ( PspUsbCamSetupStillParam ) ));
assert_eq! (::core::mem::align_of::<PspUsbCamSetupStillParam>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( PspUsbCamSetupStillParam ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupStillParam ) ) . size as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupStillParam ) , "::" , stringify ! ( size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupStillParam ) ) . resolution
as * const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupStillParam ) , "::" , stringify ! ( resolution )
));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupStillParam ) ) . jpegsize
as * const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupStillParam ) , "::" , stringify ! ( jpegsize )
));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupStillParam ) ) .
reverseflags as * const _ as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupStillParam ) , "::" , stringify ! ( reverseflags
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupStillParam ) ) . delay as *
const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupStillParam ) , "::" , stringify ! ( delay ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupStillParam ) ) . complevel
as * const _ as usize } , 20usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupStillParam ) , "::" , stringify ! ( complevel )
));
}
impl Clone for PspUsbCamSetupStillParam {
fn clone(&self) -> Self { *self }
}
/// Structure for sceUsbCamSetupStillEx
#[repr(C)]
#[derive(Debug, Copy)]
pub struct PspUsbCamSetupStillExParam {
/// Size of the ::PspUsbCamSetupStillExParam structure
pub size: i32,
/// Unknown, set it to 9 at the moment.
pub unk: u32,
/// Resolution. One of ::PspUsbCamResolutionEx
pub resolution: i32,
/// Size of the jpeg image
pub jpegsize: i32,
/// JPEG compression level, a value from 1-63.
/// 1 -> less compression, better quality; 63 -> max compression, worse quality
pub complevel: i32,
/// Unknown, set it to 0 at the moment
pub unk2: u32,
/// Unknown, set it to 1 at the moment
pub unk3: u32,
/// Flag that indicates whether to flip the image
pub flip: i32,
/// Flag that indicates whether to mirror the image
pub mirror: i32,
/// Delay to apply to take the picture. One of ::PspUsbCamDelay
pub delay: i32,
/// Unknown, set it to 0 at the moment
pub unk4: [u32; 5usize],
}
#[test]
fn bindgen_test_layout_PspUsbCamSetupStillExParam() {
assert_eq!(::core::mem::size_of::<PspUsbCamSetupStillExParam>() , 60usize
, concat ! (
"Size of: " , stringify ! ( PspUsbCamSetupStillExParam ) ));
assert_eq! (::core::mem::align_of::<PspUsbCamSetupStillExParam>() , 4usize
, concat ! (
"Alignment of " , stringify ! ( PspUsbCamSetupStillExParam )
));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupStillExParam ) ) . size as
* const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupStillExParam ) , "::" , stringify ! ( size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupStillExParam ) ) . unk as *
const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupStillExParam ) , "::" , stringify ! ( unk ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupStillExParam ) ) .
resolution as * const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupStillExParam ) , "::" , stringify ! ( resolution
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupStillExParam ) ) . jpegsize
as * const _ as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupStillExParam ) , "::" , stringify ! ( jpegsize )
));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupStillExParam ) ) .
complevel as * const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupStillExParam ) , "::" , stringify ! ( complevel
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupStillExParam ) ) . unk2 as
* const _ as usize } , 20usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupStillExParam ) , "::" , stringify ! ( unk2 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupStillExParam ) ) . unk3 as
* const _ as usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupStillExParam ) , "::" , stringify ! ( unk3 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupStillExParam ) ) . flip as
* const _ as usize } , 28usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupStillExParam ) , "::" , stringify ! ( flip ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupStillExParam ) ) . mirror
as * const _ as usize } , 32usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupStillExParam ) , "::" , stringify ! ( mirror )
));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupStillExParam ) ) . delay as
* const _ as usize } , 36usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupStillExParam ) , "::" , stringify ! ( delay )
));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupStillExParam ) ) . unk4 as
* const _ as usize } , 40usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupStillExParam ) , "::" , stringify ! ( unk4 ) ));
}
impl Clone for PspUsbCamSetupStillExParam {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct PspUsbCamSetupVideoParam {
/// Size of the ::PspUsbCamSetupVideoParam structure
pub size: i32,
/// Resolution. One of ::PspUsbCamResolution
pub resolution: i32,
/// Framerate. One of ::PspUsbCamFrameRate
pub framerate: i32,
/// White balance. One of ::PspUsbCamWB
pub wb: i32,
/// Saturarion (0-255)
pub saturation: i32,
/// Brightness (0-255)
pub brightness: i32,
/// Contrast (0-255)
pub contrast: i32,
/// Sharpness (0-255)
pub sharpness: i32,
/// Effect mode. One of ::PspUsbCamEffectMode
pub effectmode: i32,
/// Size of jpeg video frame
pub framesize: i32,
/// Unknown. Set it to 0 at the moment.
pub unk: u32,
/// Exposure value. One of ::PspUsbCamEVLevel
pub evlevel: i32,
}
#[test]
fn bindgen_test_layout_PspUsbCamSetupVideoParam() {
assert_eq!(::core::mem::size_of::<PspUsbCamSetupVideoParam>() , 48usize ,
concat ! (
"Size of: " , stringify ! ( PspUsbCamSetupVideoParam ) ));
assert_eq! (::core::mem::align_of::<PspUsbCamSetupVideoParam>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( PspUsbCamSetupVideoParam ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupVideoParam ) ) . size as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupVideoParam ) , "::" , stringify ! ( size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupVideoParam ) ) . resolution
as * const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupVideoParam ) , "::" , stringify ! ( resolution )
));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupVideoParam ) ) . framerate
as * const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupVideoParam ) , "::" , stringify ! ( framerate )
));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupVideoParam ) ) . wb as *
const _ as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupVideoParam ) , "::" , stringify ! ( wb ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupVideoParam ) ) . saturation
as * const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupVideoParam ) , "::" , stringify ! ( saturation )
));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupVideoParam ) ) . brightness
as * const _ as usize } , 20usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupVideoParam ) , "::" , stringify ! ( brightness )
));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupVideoParam ) ) . contrast
as * const _ as usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupVideoParam ) , "::" , stringify ! ( contrast )
));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupVideoParam ) ) . sharpness
as * const _ as usize } , 28usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupVideoParam ) , "::" , stringify ! ( sharpness )
));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupVideoParam ) ) . effectmode
as * const _ as usize } , 32usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupVideoParam ) , "::" , stringify ! ( effectmode )
));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupVideoParam ) ) . framesize
as * const _ as usize } , 36usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupVideoParam ) , "::" , stringify ! ( framesize )
));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupVideoParam ) ) . unk as *
const _ as usize } , 40usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupVideoParam ) , "::" , stringify ! ( unk ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupVideoParam ) ) . evlevel as
* const _ as usize } , 44usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupVideoParam ) , "::" , stringify ! ( evlevel )
));
}
impl Clone for PspUsbCamSetupVideoParam {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct PspUsbCamSetupVideoExParam {
/// Size of the ::PspUsbCamSetupVideoParam structure
pub size: i32,
pub unk: u32,
/// Resolution. One of ::PspUsbCamResolutionEx
pub resolution: i32,
/// Framerate. One of ::PspUsbCamFrameRate
pub framerate: i32,
/// Unknown. Set it to 2 at the moment
pub unk2: u32,
/// Unknown. Set it to 3 at the moment
pub unk3: u32,
/// White balance. One of ::PspUsbCamWB
pub wb: i32,
/// Saturarion (0-255)
pub saturation: i32,
/// Brightness (0-255)
pub brightness: i32,
/// Contrast (0-255)
pub contrast: i32,
/// Sharpness (0-255)
pub sharpness: i32,
/// Unknown. Set it to 0 at the moment
pub unk4: u32,
/// Unknown. Set it to 1 at the moment
pub unk5: u32,
/// Unknown. Set it to 0 at the moment
pub unk6: [u32; 3usize],
/// Effect mode. One of ::PspUsbCamEffectMode
pub effectmode: i32,
/// Unknown. Set it to 1 at the moment
pub unk7: u32,
/// Unknown. Set it to 10 at the moment
pub unk8: u32,
/// Unknown. Set it to 2 at the moment
pub unk9: u32,
/// Unknown. Set it to 500 at the moment
pub unk10: u32,
/// Unknown. Set it to 1000 at the moment
pub unk11: u32,
/// Size of jpeg video frame
pub framesize: i32,
/// Unknown. Set it to 0 at the moment
pub unk12: u32,
/// Exposure value. One of ::PspUsbCamEVLevel
pub evlevel: i32,
}
#[test]
fn bindgen_test_layout_PspUsbCamSetupVideoExParam() {
assert_eq!(::core::mem::size_of::<PspUsbCamSetupVideoExParam>() , 100usize
, concat ! (
"Size of: " , stringify ! ( PspUsbCamSetupVideoExParam ) ));
assert_eq! (::core::mem::align_of::<PspUsbCamSetupVideoExParam>() , 4usize
, concat ! (
"Alignment of " , stringify ! ( PspUsbCamSetupVideoExParam )
));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) . size as
* const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) . unk as *
const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( unk ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) .
resolution as * const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( resolution
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) .
framerate as * const _ as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( framerate
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) . unk2 as
* const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( unk2 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) . unk3 as
* const _ as usize } , 20usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( unk3 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) . wb as *
const _ as usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( wb ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) .
saturation as * const _ as usize } , 28usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( saturation
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) .
brightness as * const _ as usize } , 32usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( brightness
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) . contrast
as * const _ as usize } , 36usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( contrast )
));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) .
sharpness as * const _ as usize } , 40usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( sharpness
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) . unk4 as
* const _ as usize } , 44usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( unk4 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) . unk5 as
* const _ as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( unk5 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) . unk6 as
* const _ as usize } , 52usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( unk6 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) .
effectmode as * const _ as usize } , 64usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( effectmode
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) . unk7 as
* const _ as usize } , 68usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( unk7 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) . unk8 as
* const _ as usize } , 72usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( unk8 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) . unk9 as
* const _ as usize } , 76usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( unk9 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) . unk10 as
* const _ as usize } , 80usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( unk10 )
));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) . unk11 as
* const _ as usize } , 84usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( unk11 )
));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) .
framesize as * const _ as usize } , 88usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( framesize
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) . unk12 as
* const _ as usize } , 92usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( unk12 )
));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUsbCamSetupVideoExParam ) ) . evlevel
as * const _ as usize } , 96usize , concat ! (
"Alignment of field: " , stringify ! (
PspUsbCamSetupVideoExParam ) , "::" , stringify ! ( evlevel )
));
}
impl Clone for PspUsbCamSetupVideoExParam {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// Setups the parameters to take a still image.
///
/// @param param - pointer to a ::PspUsbCamSetupStillParam
///
/// @return 0 on success, < 0 on error
pub fn sceUsbCamSetupStill(param: *mut PspUsbCamSetupStillParam)
-> i32;
}
extern "C" {
/// Setups the parameters to take a still image (with more options)
///
/// @param param - pointer to a ::PspUsbCamSetupStillExParam
///
/// @return 0 on success, < 0 on error
pub fn sceUsbCamSetupStillEx(param: *mut PspUsbCamSetupStillExParam)
-> i32;
}
extern "C" {
/// Gets a still image. The function doesn't return until the image
/// has been acquired.
///
/// @param buf - The buffer that receives the image jpeg data
/// @param size - The size of the buffer.
///
/// @return size of acquired image on success, < 0 on error
pub fn sceUsbCamStillInputBlocking(buf: *mut u8, size: SceSize)
-> i32;
}
extern "C" {
/// Gets a still image. The function returns inmediately, and
/// the completion has to be handled by calling ::sceUsbCamStillWaitInputEnd
/// or ::sceUsbCamStillPollInputEnd.
///
/// @param buf - The buffer that receives the image jpeg data
/// @param size - The size of the buffer.
///
/// @return 0 on success, < 0 on error
pub fn sceUsbCamStillInput(buf: *mut u8, size: SceSize) -> i32;
}
extern "C" {
/// Waits untils still input has been finished.
///
/// @return the size of the acquired image on sucess, < 0 on error
pub fn sceUsbCamStillWaitInputEnd() -> i32;
}
extern "C" {
/// Polls the status of still input completion.
///
/// @return the size of the acquired image if still input has ended,
/// 0 if the input has not ended, < 0 on error.
pub fn sceUsbCamStillPollInputEnd() -> i32;
}
extern "C" {
/// Cancels the still input.
///
/// @return 0 on success, < 0 on error
pub fn sceUsbCamStillCancelInput() -> i32;
}
extern "C" {
/// Gets the size of the acquired still image.
///
/// @return the size of the acquired image on success, < 0 on error
pub fn sceUsbCamStillGetInputLength() -> i32;
}
extern "C" {
/// Set ups the parameters for video capture.
///
/// @param param - Pointer to a ::PspUsbCamSetupVideoParam structure.
/// @param workarea - Pointer to a buffer used as work area by the driver.
/// @param wasize - Size of the work area.
///
/// @return 0 on success, < 0 on error
pub fn sceUsbCamSetupVideo(param: *mut PspUsbCamSetupVideoParam,
workarea: *mut c_void, wasize: i32)
-> i32;
}
extern "C" {
/// Set ups the parameters for video capture (with more options)
///
/// @param param - Pointer to a ::PspUsbCamSetupVideoExParam structure.
/// @param workarea - Pointer to a buffer used as work area by the driver.
/// @param wasize - Size of the work area.
///
/// @return 0 on success, < 0 on error
pub fn sceUsbCamSetupVideoEx(param: *mut PspUsbCamSetupVideoExParam,
workarea: *mut c_void, wasize: i32)
-> i32;
}
extern "C" {
/// Starts video input from the camera.
///
/// @return 0 on success, < 0 on error
pub fn sceUsbCamStartVideo() -> i32;
}
extern "C" {
/// Stops video input from the camera.
///
/// @return 0 on success, < 0 on error
pub fn sceUsbCamStopVideo() -> i32;
}
extern "C" {
/// Reads a video frame. The function doesn't return until the frame
/// has been acquired.
///
/// @param buf - The buffer that receives the frame jpeg data
/// @param size - The size of the buffer.
///
/// @return size of acquired frame on success, < 0 on error
pub fn sceUsbCamReadVideoFrameBlocking(buf: *mut u8, size: SceSize)
-> i32;
}
extern "C" {
/// Reads a video frame. The function returns inmediately, and
/// the completion has to be handled by calling ::sceUsbCamWaitReadVideoFrameEnd
/// or ::sceUsbCamPollReadVideoFrameEnd.
///
/// @param buf - The buffer that receives the frame jpeg data
/// @param size - The size of the buffer.
///
/// @return 0 on success, < 0 on error
pub fn sceUsbCamReadVideoFrame(buf: *mut u8, size: SceSize) -> i32;
}
extern "C" {
/// Waits untils the current frame has been read.
///
/// @return the size of the acquired frame on sucess, < 0 on error
pub fn sceUsbCamWaitReadVideoFrameEnd() -> i32;
}
extern "C" {
/// Polls the status of video frame read completion.
///
/// @return the size of the acquired frame if it has been read,
/// 0 if the frame has not yet been read, < 0 on error.
pub fn sceUsbCamPollReadVideoFrameEnd() -> i32;
}
extern "C" {
/// Gets the size of the acquired frame.
///
/// @return the size of the acquired frame on success, < 0 on error
pub fn sceUsbCamGetReadVideoFrameSize() -> i32;
}
extern "C" {
/// Sets the saturation
///
/// @param saturation - The saturation (0-255)
///
/// @return 0 on success, < 0 on error
pub fn sceUsbCamSetSaturation(saturation: i32) -> i32;
}
extern "C" {
/// Sets the brightness
///
/// @param brightness - The brightness (0-255)
///
/// @return 0 on success, < 0 on error
pub fn sceUsbCamSetBrightness(brightness: i32) -> i32;
}
extern "C" {
/// Sets the contrast
///
/// @param contrast - The contrast (0-255)
///
/// @return 0 on success, < 0 on error
pub fn sceUsbCamSetContrast(contrast: i32) -> i32;
}
extern "C" {
/// Sets the sharpness
///
/// @param sharpness - The sharpness (0-255)
///
/// @return 0 on success, < 0 on error
pub fn sceUsbCamSetSharpness(sharpness: i32) -> i32;
}
extern "C" {
/// Sets the image effect mode
///
/// @param effectmode - The effect mode, one of ::PspUsbCamEffectMode
///
/// @return 0 on success, < 0 on error
pub fn sceUsbCamSetImageEffectMode(effectmode: i32) -> i32;
}
extern "C" {
/// Sets the exposure level
///
/// @param ev - The exposure level, one of ::PspUsbCamEVLevel
///
/// @return 0 on success, < 0 on error
pub fn sceUsbCamSetEvLevel(ev: i32) -> i32;
}
extern "C" {
/// Sets the reverse mode
///
/// @param reverseflags - The reverse flags, zero or more of ::PspUsbCamReverseFlags
///
/// @return 0 on success, < 0 on error
pub fn sceUsbCamSetReverseMode(reverseflags: i32) -> i32;
}
extern "C" {
/// Sets the zoom.
///
/// @param zoom - The zoom level starting by 10. (10 = 1X, 11 = 1.1X, etc)
///
/// @returns 0 on success, < 0 on error
pub fn sceUsbCamSetZoom(zoom: i32) -> i32;
}
extern "C" {
/// Gets the current saturation
///
/// @param saturation - pointer to a variable that receives the current saturation
///
/// @return 0 on success, < 0 on error
pub fn sceUsbCamGetSaturation(saturation: *mut i32) -> i32;
}
extern "C" {
/// Gets the current brightness
///
/// @param brightness - pointer to a variable that receives the current brightness
///
/// @return 0 on success, < 0 on error
pub fn sceUsbCamGetBrightness(brightness: *mut i32) -> i32;
}
extern "C" {
/// Gets the current contrast
///
/// @param contrast - pointer to a variable that receives the current contrast
///
/// @return 0 on success, < 0 on error
pub fn sceUsbCamGetContrast(contrast: *mut i32) -> i32;
}
extern "C" {
/// Gets the current sharpness
///
/// @param sharpness - pointer to a variable that receives the current sharpness
///
/// @return 0 on success, < 0 on error
pub fn sceUsbCamGetSharpness(sharpness: *mut i32) -> i32;
}
extern "C" {
/// Gets the current image efect mode
///
/// @param effectmode - pointer to a variable that receives the current effect mode
///
/// @return 0 on success, < 0 on error
pub fn sceUsbCamGetImageEffectMode(effectmode: *mut i32) -> i32;
}
extern "C" {
/// Gets the current exposure level.
///
/// @param ev - pointer to a variable that receives the current exposure level
///
/// @return 0 on success, < 0 on error
pub fn sceUsbCamGetEvLevel(ev: *mut i32) -> i32;
}
extern "C" {
/// Gets the current reverse mode.
///
/// @param reverseflags - pointer to a variable that receives the current reverse mode flags
///
/// @return 0 on success, < 0 on error
pub fn sceUsbCamGetReverseMode(reverseflags: *mut i32) -> i32;
}
extern "C" {
/// Gets the current zoom.
///
/// @param zoom - pointer to a variable that receives the current zoom
///
/// @return 0 on success, < 0 on error
pub fn sceUsbCamGetZoom(zoom: *mut i32) -> i32;
}
extern "C" {
/// Sets if the image should be automatically reversed, depending of the position
/// of the camera.
///
/// @param on - 1 to set the automatical reversal of the image, 0 to set it off
///
/// @return 0 on success, < 0 on error
pub fn sceUsbCamAutoImageReverseSW(on: i32) -> i32;
}
extern "C" {
/// Gets the state of the autoreversal of the image.
///
/// @return 1 if it is set to automatic, 0 otherwise
pub fn sceUsbCamGetAutoImageReverseState() -> i32;
}
extern "C" {
/// Gets the direction of the camera lens
///
/// @return 1 if the camera is "looking to you", 0 if the camera
/// is "looking to the other side".
pub fn sceUsbCamGetLensDirection() -> i32;
}
extern "C" {
/// Start a USB driver.
///
/// @param driverName - name of the USB driver to start
/// @param size - Size of arguments to pass to USB driver start
/// @param args - Arguments to pass to USB driver start
///
/// @return 0 on success
pub fn sceUsbStart(driverName: *const u8, size: i32,
args: *mut c_void) -> i32;
}
extern "C" {
/// Stop a USB driver.
///
/// @param driverName - name of the USB driver to stop
/// @param size - Size of arguments to pass to USB driver start
/// @param args - Arguments to pass to USB driver start
///
/// @return 0 on success
pub fn sceUsbStop(driverName: *const u8, size: i32,
args: *mut c_void) -> i32;
}
extern "C" {
/// Activate a USB driver.
///
/// @param pid - Product ID for the default USB Driver
///
/// @return 0 on success
pub fn sceUsbActivate(pid: u32) -> i32;
}
extern "C" {
/// Deactivate USB driver.
///
/// @param pid - Product ID for the default USB driver
///
/// @return 0 on success
pub fn sceUsbDeactivate(pid: u32) -> i32;
}
extern "C" {
/// Get USB state
///
/// @return OR'd PSP_USB_* constants
pub fn sceUsbGetState() -> i32;
}
extern "C" {
/// Get state of a specific USB driver
///
/// @param driverName - name of USB driver to get status from
///
/// @return 1 if the driver has been started, 2 if it is stopped
pub fn sceUsbGetDrvState(driverName: *const u8) -> i32;
}
extern "C" {
/// Register an eventFlag to send notifications to.
///
/// @param eventFlag - eventFlag created with sceKernelCreateEventFlag
///
/// @return 0 on success
pub fn sceUsbstorBootRegisterNotify(eventFlag: u32) -> i32;
}
extern "C" {
/// Unregister a previously registered eventFlag.
///
/// @param eventFlag - eventFlag created with sceKernelCreateEventFlag
///
/// @return 0 on success
pub fn sceUsbstorBootUnregisterNotify(eventFlag: u32) -> i32;
}
extern "C" {
/// Tell the USBstorBoot driver the size of MS
///
/// @note I'm not sure if this is the actual size of the media or not
/// as it seems to have no bearing on what size windows detects.
/// PSPPET passes 0x800000
///
/// @param size - capacity of memory stick
///
/// @return 0 on success
pub fn sceUsbstorBootSetCapacity(size: u32) -> i32;
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct pspUtilityDialogCommon {
pub size: u32,
/// Size of the structure
pub language: i32,
/// Language
pub buttonSwap: i32,
/// Set to 1 for X/O button swap
pub graphicsThread: i32,
/// Graphics thread priority
pub accessThread: i32,
/// Access/fileio thread priority (SceJobThread)
pub fontThread: i32,
/// Font thread priority (ScePafThread)
pub soundThread: i32,
/// Sound thread priority
pub result: i32,
/// Result
pub reserved: [i32; 4usize],
}
#[test]
fn bindgen_test_layout_pspUtilityDialogCommon() {
assert_eq!(::core::mem::size_of::<pspUtilityDialogCommon>() , 48usize ,
concat ! ( "Size of: " , stringify ! ( pspUtilityDialogCommon )
));
assert_eq! (::core::mem::align_of::<pspUtilityDialogCommon>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( pspUtilityDialogCommon ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspUtilityDialogCommon ) ) . size as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( pspUtilityDialogCommon
) , "::" , stringify ! ( size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspUtilityDialogCommon ) ) . language as
* const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( pspUtilityDialogCommon
) , "::" , stringify ! ( language ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspUtilityDialogCommon ) ) . buttonSwap
as * const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( pspUtilityDialogCommon
) , "::" , stringify ! ( buttonSwap ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspUtilityDialogCommon ) ) .
graphicsThread as * const _ as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( pspUtilityDialogCommon
) , "::" , stringify ! ( graphicsThread ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspUtilityDialogCommon ) ) . accessThread
as * const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( pspUtilityDialogCommon
) , "::" , stringify ! ( accessThread ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspUtilityDialogCommon ) ) . fontThread
as * const _ as usize } , 20usize , concat ! (
"Alignment of field: " , stringify ! ( pspUtilityDialogCommon
) , "::" , stringify ! ( fontThread ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspUtilityDialogCommon ) ) . soundThread
as * const _ as usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! ( pspUtilityDialogCommon
) , "::" , stringify ! ( soundThread ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspUtilityDialogCommon ) ) . result as *
const _ as usize } , 28usize , concat ! (
"Alignment of field: " , stringify ! ( pspUtilityDialogCommon
) , "::" , stringify ! ( result ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspUtilityDialogCommon ) ) . reserved as
* const _ as usize } , 32usize , concat ! (
"Alignment of field: " , stringify ! ( pspUtilityDialogCommon
) , "::" , stringify ! ( reserved ) ));
}
impl Clone for pspUtilityDialogCommon {
fn clone(&self) -> Self { *self }
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum pspUtilityMsgDialogMode {
PSP_UTILITY_MSGDIALOG_MODE_ERROR = 0,
PSP_UTILITY_MSGDIALOG_MODE_TEXT = 1,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum pspUtilityMsgDialogOption {
PSP_UTILITY_MSGDIALOG_OPTION_ERROR = 0,
PSP_UTILITY_MSGDIALOG_OPTION_TEXT = 1,
PSP_UTILITY_MSGDIALOG_OPTION_YESNO_BUTTONS = 16,
PSP_UTILITY_MSGDIALOG_OPTION_DEFAULT_NO = 256,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum pspUtilityMsgDialogPressed {
PSP_UTILITY_MSGDIALOG_RESULT_UNKNOWN1 = 0,
PSP_UTILITY_MSGDIALOG_RESULT_YES = 1,
PSP_UTILITY_MSGDIALOG_RESULT_NO = 2,
PSP_UTILITY_MSGDIALOG_RESULT_BACK = 3,
}
/// Structure to hold the parameters for a message dialog
#[repr(C)]
#[derive(Copy)]
pub struct _pspUtilityMsgDialogParams {
pub base: pspUtilityDialogCommon,
pub unknown: i32,
pub mode: pspUtilityMsgDialogMode,
pub errorValue: u32,
/// The message to display (may contain embedded linefeeds)
pub message: [u8; 512usize],
pub options: i32,
pub buttonPressed: pspUtilityMsgDialogPressed,
}
#[test]
fn bindgen_test_layout__pspUtilityMsgDialogParams() {
assert_eq!(::core::mem::size_of::<_pspUtilityMsgDialogParams>() , 580usize
, concat ! (
"Size of: " , stringify ! ( _pspUtilityMsgDialogParams ) ));
assert_eq! (::core::mem::align_of::<_pspUtilityMsgDialogParams>() , 4usize
, concat ! (
"Alignment of " , stringify ! ( _pspUtilityMsgDialogParams )
));
assert_eq! (unsafe {
& ( * ( 0 as * const _pspUtilityMsgDialogParams ) ) . base as
* const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! (
_pspUtilityMsgDialogParams ) , "::" , stringify ! ( base ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _pspUtilityMsgDialogParams ) ) . unknown
as * const _ as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! (
_pspUtilityMsgDialogParams ) , "::" , stringify ! ( unknown )
));
assert_eq! (unsafe {
& ( * ( 0 as * const _pspUtilityMsgDialogParams ) ) . mode as
* const _ as usize } , 52usize , concat ! (
"Alignment of field: " , stringify ! (
_pspUtilityMsgDialogParams ) , "::" , stringify ! ( mode ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _pspUtilityMsgDialogParams ) ) .
errorValue as * const _ as usize } , 56usize , concat ! (
"Alignment of field: " , stringify ! (
_pspUtilityMsgDialogParams ) , "::" , stringify ! ( errorValue
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _pspUtilityMsgDialogParams ) ) . message
as * const _ as usize } , 60usize , concat ! (
"Alignment of field: " , stringify ! (
_pspUtilityMsgDialogParams ) , "::" , stringify ! ( message )
));
assert_eq! (unsafe {
& ( * ( 0 as * const _pspUtilityMsgDialogParams ) ) . options
as * const _ as usize } , 572usize , concat ! (
"Alignment of field: " , stringify ! (
_pspUtilityMsgDialogParams ) , "::" , stringify ! ( options )
));
assert_eq! (unsafe {
& ( * ( 0 as * const _pspUtilityMsgDialogParams ) ) .
buttonPressed as * const _ as usize } , 576usize , concat ! (
"Alignment of field: " , stringify ! (
_pspUtilityMsgDialogParams ) , "::" , stringify ! (
buttonPressed ) ));
}
impl Clone for _pspUtilityMsgDialogParams {
fn clone(&self) -> Self { *self }
}
/// Structure to hold the parameters for a message dialog
pub type pspUtilityMsgDialogParams = _pspUtilityMsgDialogParams;
extern "C" {
/// Create a message dialog
///
/// @param params - dialog parameters
/// @return 0 on success
pub fn sceUtilityMsgDialogInitStart(params:
*mut pspUtilityMsgDialogParams)
-> i32;
}
extern "C" {
/// Remove a message dialog currently active. After calling this
/// function you need to keep calling GetStatus and Update until
/// you get a status of 4.
pub fn sceUtilityMsgDialogShutdownStart();
}
extern "C" {
/// Get the current status of a message dialog currently active.
///
/// @return 2 if the GUI is visible (you need to call sceUtilityMsgDialogGetStatus).
/// 3 if the user cancelled the dialog, and you need to call sceUtilityMsgDialogShutdownStart.
/// 4 if the dialog has been successfully shut down.
pub fn sceUtilityMsgDialogGetStatus() -> i32;
}
extern "C" {
/// Refresh the GUI for a message dialog currently active
///
/// @param n - unknown, pass 1
pub fn sceUtilityMsgDialogUpdate(n: i32);
}
extern "C" {
/// Abort a message dialog currently active
pub fn sceUtilityMsgDialogAbort() -> i32;
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum pspUtilityNetconfActions {
PSP_NETCONF_ACTION_CONNECTAP = 0,
PSP_NETCONF_ACTION_DISPLAYSTATUS = 1,
PSP_NETCONF_ACTION_CONNECT_ADHOC = 2,
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct pspUtilityNetconfAdhoc {
pub name: [u8; 8usize],
pub timeout: u32,
}
#[test]
fn bindgen_test_layout_pspUtilityNetconfAdhoc() {
assert_eq!(::core::mem::size_of::<pspUtilityNetconfAdhoc>() , 12usize ,
concat ! ( "Size of: " , stringify ! ( pspUtilityNetconfAdhoc )
));
assert_eq! (::core::mem::align_of::<pspUtilityNetconfAdhoc>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( pspUtilityNetconfAdhoc ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspUtilityNetconfAdhoc ) ) . name as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( pspUtilityNetconfAdhoc
) , "::" , stringify ! ( name ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspUtilityNetconfAdhoc ) ) . timeout as *
const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( pspUtilityNetconfAdhoc
) , "::" , stringify ! ( timeout ) ));
}
impl Clone for pspUtilityNetconfAdhoc {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct _pspUtilityNetconfData {
pub base: pspUtilityDialogCommon,
pub action: i32,
/// One of pspUtilityNetconfActions
pub adhocparam: *mut pspUtilityNetconfAdhoc,
pub hotspot: i32,
/// Set to 1 to allow connections with the 'Internet Browser' option set to 'Start' (ie. hotspot connection)
pub hotspot_connected: i32,
/// Will be set to 1 when connected to a hotspot style connection
pub wifisp: i32,
}
#[test]
fn bindgen_test_layout__pspUtilityNetconfData() {
assert_eq!(::core::mem::size_of::<_pspUtilityNetconfData>() , 80usize ,
concat ! ( "Size of: " , stringify ! ( _pspUtilityNetconfData )
));
assert_eq! (::core::mem::align_of::<_pspUtilityNetconfData>() , 8usize ,
concat ! (
"Alignment of " , stringify ! ( _pspUtilityNetconfData ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _pspUtilityNetconfData ) ) . base as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( _pspUtilityNetconfData
) , "::" , stringify ! ( base ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _pspUtilityNetconfData ) ) . action as *
const _ as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! ( _pspUtilityNetconfData
) , "::" , stringify ! ( action ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _pspUtilityNetconfData ) ) . adhocparam
as * const _ as usize } , 56usize , concat ! (
"Alignment of field: " , stringify ! ( _pspUtilityNetconfData
) , "::" , stringify ! ( adhocparam ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _pspUtilityNetconfData ) ) . hotspot as *
const _ as usize } , 64usize , concat ! (
"Alignment of field: " , stringify ! ( _pspUtilityNetconfData
) , "::" , stringify ! ( hotspot ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _pspUtilityNetconfData ) ) .
hotspot_connected as * const _ as usize } , 68usize , concat !
(
"Alignment of field: " , stringify ! ( _pspUtilityNetconfData
) , "::" , stringify ! ( hotspot_connected ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _pspUtilityNetconfData ) ) . wifisp as *
const _ as usize } , 72usize , concat ! (
"Alignment of field: " , stringify ! ( _pspUtilityNetconfData
) , "::" , stringify ! ( wifisp ) ));
}
impl Clone for _pspUtilityNetconfData {
fn clone(&self) -> Self { *self }
}
pub type pspUtilityNetconfData = _pspUtilityNetconfData;
extern "C" {
/// Init the Network Configuration Dialog Utility
///
/// @param data - pointer to pspUtilityNetconfData to be initialized
/// @return 0 on success, < 0 on error
pub fn sceUtilityNetconfInitStart(data: *mut pspUtilityNetconfData)
-> i32;
}
extern "C" {
/// Shutdown the Network Configuration Dialog Utility
///
/// @return 0 on success, < 0 on error
pub fn sceUtilityNetconfShutdownStart() -> i32;
}
extern "C" {
/// Update the Network Configuration Dialog GUI
///
/// @param unknown - unknown; set to 1
/// @return 0 on success, < 0 on error
pub fn sceUtilityNetconfUpdate(unknown: i32) -> i32;
}
extern "C" {
/// Get the status of a running Network Configuration Dialog
///
/// @return one of pspUtilityDialogState on success, < 0 on error
pub fn sceUtilityNetconfGetStatus() -> i32;
}
/// Datatype for sceUtilityGetNetParam
/// since it can return a u32 or a string
/// we use a union to avoid ugly casting
#[repr(C)]
#[derive(Copy)]
pub union netData {
pub asUint: u32,
pub asString: [u8; 128usize],
_bindgen_union_align: [u32; 32usize],
}
#[test]
fn bindgen_test_layout_netData() {
assert_eq!(::core::mem::size_of::<netData>() , 128usize , concat ! (
"Size of: " , stringify ! ( netData ) ));
assert_eq! (::core::mem::align_of::<netData>() , 4usize , concat ! (
"Alignment of " , stringify ! ( netData ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const netData ) ) . asUint as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( netData ) , "::" ,
stringify ! ( asUint ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const netData ) ) . asString as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( netData ) , "::" ,
stringify ! ( asString ) ));
}
impl Clone for netData {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// Check existance of a Net Configuration
///
/// @param id - id of net Configuration (1 to n)
/// @return 0 on success,
pub fn sceUtilityCheckNetParam(id: i32) -> i32;
}
extern "C" {
/// Get Net Configuration Parameter
///
/// @param conf - Net Configuration number (1 to n)
/// (0 returns valid but seems to be a copy of the last config requested)
/// @param param - which parameter to get
/// @param data - parameter data
/// @return 0 on success,
pub fn sceUtilityGetNetParam(conf: i32, param: i32,
data: *mut netData) -> i32;
}
extern "C" {
/// Create a new Network Configuration
/// @note This creates a new configuration at conf and clears 0
///
/// @param conf - Net Configuration number (1 to n)
///
/// @return 0 on success
pub fn sceUtilityCreateNetParam(conf: i32) -> i32;
}
extern "C" {
/// Sets a network parameter
/// @note This sets only to configuration 0
///
/// @param param - Which parameter to set
/// @param val - Pointer to the the data to set
///
/// @return 0 on success
pub fn sceUtilitySetNetParam(param: i32, val: *const c_void)
-> i32;
}
extern "C" {
/// Copies a Network Configuration to another
///
/// @param src - Source Net Configuration number (0 to n)
/// @param dest - Destination Net Configuration number (0 to n)
///
/// @return 0 on success
pub fn sceUtilityCopyNetParam(src: i32, dest: i32) -> i32;
}
extern "C" {
/// Deletes a Network Configuration
///
/// @param conf - Net Configuration number (1 to n)
///
/// @return 0 on success
pub fn sceUtilityDeleteNetParam(conf: i32) -> i32;
}
#[repr(u32)]
/// Save data utility modes
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspUtilitySavedataMode {
PSP_UTILITY_SAVEDATA_AUTOLOAD = 0,
PSP_UTILITY_SAVEDATA_AUTOSAVE = 1,
PSP_UTILITY_SAVEDATA_LOAD = 2,
PSP_UTILITY_SAVEDATA_SAVE = 3,
PSP_UTILITY_SAVEDATA_LISTLOAD = 4,
PSP_UTILITY_SAVEDATA_LISTSAVE = 5,
PSP_UTILITY_SAVEDATA_LISTDELETE = 6,
PSP_UTILITY_SAVEDATADELETE = 7,
}
#[repr(u32)]
/// Initial focus position for list selection types
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PspUtilitySavedataFocus {
PSP_UTILITY_SAVEDATA_FOCUS_UNKNOWN = 0,
PSP_UTILITY_SAVEDATA_FOCUS_FIRSTLIST = 1,
PSP_UTILITY_SAVEDATA_FOCUS_LASTLIST = 2,
PSP_UTILITY_SAVEDATA_FOCUS_LATEST = 3,
PSP_UTILITY_SAVEDATA_FOCUS_OLDEST = 4,
PSP_UTILITY_SAVEDATA_FOCUS_UNKNOWN2 = 5,
PSP_UTILITY_SAVEDATA_FOCUS_UNKNOWN3 = 6,
PSP_UTILITY_SAVEDATA_FOCUS_FIRSTEMPTY = 7,
PSP_UTILITY_SAVEDATA_FOCUS_LASTEMPTY = 8,
}
/// title, savedataTitle, detail: parts of the unencrypted SFO
/// data, it contains what the VSH and standard load screen shows
#[repr(C)]
#[derive(Copy)]
pub struct PspUtilitySavedataSFOParam {
pub title: [u8; 128usize],
pub savedataTitle: [u8; 128usize],
pub detail: [u8; 1024usize],
pub parentalLevel: u8,
pub unknown: [u8; 3usize],
}
#[test]
fn bindgen_test_layout_PspUtilitySavedataSFOParam() {
assert_eq!(::core::mem::size_of::<PspUtilitySavedataSFOParam>() ,
1284usize , concat ! (
"Size of: " , stringify ! ( PspUtilitySavedataSFOParam ) ));
assert_eq! (::core::mem::align_of::<PspUtilitySavedataSFOParam>() , 1usize
, concat ! (
"Alignment of " , stringify ! ( PspUtilitySavedataSFOParam )
));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUtilitySavedataSFOParam ) ) . title as
* const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! (
PspUtilitySavedataSFOParam ) , "::" , stringify ! ( title )
));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUtilitySavedataSFOParam ) ) .
savedataTitle as * const _ as usize } , 128usize , concat ! (
"Alignment of field: " , stringify ! (
PspUtilitySavedataSFOParam ) , "::" , stringify ! (
savedataTitle ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUtilitySavedataSFOParam ) ) . detail
as * const _ as usize } , 256usize , concat ! (
"Alignment of field: " , stringify ! (
PspUtilitySavedataSFOParam ) , "::" , stringify ! ( detail )
));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUtilitySavedataSFOParam ) ) .
parentalLevel as * const _ as usize } , 1280usize , concat ! (
"Alignment of field: " , stringify ! (
PspUtilitySavedataSFOParam ) , "::" , stringify ! (
parentalLevel ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUtilitySavedataSFOParam ) ) . unknown
as * const _ as usize } , 1281usize , concat ! (
"Alignment of field: " , stringify ! (
PspUtilitySavedataSFOParam ) , "::" , stringify ! ( unknown )
));
}
impl Clone for PspUtilitySavedataSFOParam {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct PspUtilitySavedataFileData {
pub buf: *mut c_void,
pub bufSize: SceSize,
pub size: SceSize,
pub unknown: i32,
}
#[test]
fn bindgen_test_layout_PspUtilitySavedataFileData() {
assert_eq!(::core::mem::size_of::<PspUtilitySavedataFileData>() , 24usize
, concat ! (
"Size of: " , stringify ! ( PspUtilitySavedataFileData ) ));
assert_eq! (::core::mem::align_of::<PspUtilitySavedataFileData>() , 8usize
, concat ! (
"Alignment of " , stringify ! ( PspUtilitySavedataFileData )
));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUtilitySavedataFileData ) ) . buf as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! (
PspUtilitySavedataFileData ) , "::" , stringify ! ( buf ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUtilitySavedataFileData ) ) . bufSize
as * const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! (
PspUtilitySavedataFileData ) , "::" , stringify ! ( bufSize )
));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUtilitySavedataFileData ) ) . size as
* const _ as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! (
PspUtilitySavedataFileData ) , "::" , stringify ! ( size ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUtilitySavedataFileData ) ) . unknown
as * const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! (
PspUtilitySavedataFileData ) , "::" , stringify ! ( unknown )
));
}
impl Clone for PspUtilitySavedataFileData {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct PspUtilitySavedataListSaveNewData {
pub icon0: PspUtilitySavedataFileData,
pub title: *mut u8,
}
#[test]
fn bindgen_test_layout_PspUtilitySavedataListSaveNewData() {
assert_eq!(::core::mem::size_of::<PspUtilitySavedataListSaveNewData>() ,
32usize , concat ! (
"Size of: " , stringify ! ( PspUtilitySavedataListSaveNewData )
));
assert_eq! (::core::mem::align_of::<PspUtilitySavedataListSaveNewData>() ,
8usize , concat ! (
"Alignment of " , stringify ! (
PspUtilitySavedataListSaveNewData ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUtilitySavedataListSaveNewData ) ) .
icon0 as * const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! (
PspUtilitySavedataListSaveNewData ) , "::" , stringify ! (
icon0 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PspUtilitySavedataListSaveNewData ) ) .
title as * const _ as usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! (
PspUtilitySavedataListSaveNewData ) , "::" , stringify ! (
title ) ));
}
impl Clone for PspUtilitySavedataListSaveNewData {
fn clone(&self) -> Self { *self }
}
/// Structure to hold the parameters for the ::sceUtilitySavedataInitStart function.
#[repr(C)]
#[derive(Copy)]
pub struct SceUtilitySavedataParam {
pub base: pspUtilityDialogCommon,
pub mode: PspUtilitySavedataMode,
pub unknown1: i32,
pub overwrite: i32,
/// gameName: name used from the game for saves, equal for all saves
pub gameName: [u8; 13usize],
pub reserved: [u8; 3usize],
/// saveName: name of the particular save, normally a number
pub saveName: [u8; 20usize],
/// saveNameList: used by multiple modes
pub saveNameList: *mut [u8; 20usize],
/// fileName: name of the data file of the game for example DATA.BIN
pub fileName: [u8; 13usize],
pub reserved1: [u8; 3usize],
/// pointer to a buffer that will contain data file unencrypted data
pub dataBuf: *mut c_void,
/// size of allocated space to dataBuf
pub dataBufSize: SceSize,
pub dataSize: SceSize,
pub sfoParam: PspUtilitySavedataSFOParam,
pub icon0FileData: PspUtilitySavedataFileData,
pub icon1FileData: PspUtilitySavedataFileData,
pub pic1FileData: PspUtilitySavedataFileData,
pub snd0FileData: PspUtilitySavedataFileData,
/// Pointer to an PspUtilitySavedataListSaveNewData structure
pub newData: *mut PspUtilitySavedataListSaveNewData,
/// Initial focus for lists
pub focus: PspUtilitySavedataFocus,
/// unknown2: ?
pub unknown2: [i32; 4usize],
}
#[test]
fn bindgen_test_layout_SceUtilitySavedataParam() {
assert_eq!(::core::mem::size_of::<SceUtilitySavedataParam>() , 1552usize ,
concat ! (
"Size of: " , stringify ! ( SceUtilitySavedataParam ) ));
assert_eq! (::core::mem::align_of::<SceUtilitySavedataParam>() , 8usize ,
concat ! (
"Alignment of " , stringify ! ( SceUtilitySavedataParam ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceUtilitySavedataParam ) ) . base as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( SceUtilitySavedataParam
) , "::" , stringify ! ( base ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceUtilitySavedataParam ) ) . mode as *
const _ as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! ( SceUtilitySavedataParam
) , "::" , stringify ! ( mode ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceUtilitySavedataParam ) ) . unknown1 as
* const _ as usize } , 52usize , concat ! (
"Alignment of field: " , stringify ! ( SceUtilitySavedataParam
) , "::" , stringify ! ( unknown1 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceUtilitySavedataParam ) ) . overwrite
as * const _ as usize } , 56usize , concat ! (
"Alignment of field: " , stringify ! ( SceUtilitySavedataParam
) , "::" , stringify ! ( overwrite ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceUtilitySavedataParam ) ) . gameName as
* const _ as usize } , 60usize , concat ! (
"Alignment of field: " , stringify ! ( SceUtilitySavedataParam
) , "::" , stringify ! ( gameName ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceUtilitySavedataParam ) ) . reserved as
* const _ as usize } , 73usize , concat ! (
"Alignment of field: " , stringify ! ( SceUtilitySavedataParam
) , "::" , stringify ! ( reserved ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceUtilitySavedataParam ) ) . saveName as
* const _ as usize } , 76usize , concat ! (
"Alignment of field: " , stringify ! ( SceUtilitySavedataParam
) , "::" , stringify ! ( saveName ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceUtilitySavedataParam ) ) .
saveNameList as * const _ as usize } , 96usize , concat ! (
"Alignment of field: " , stringify ! ( SceUtilitySavedataParam
) , "::" , stringify ! ( saveNameList ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceUtilitySavedataParam ) ) . fileName as
* const _ as usize } , 104usize , concat ! (
"Alignment of field: " , stringify ! ( SceUtilitySavedataParam
) , "::" , stringify ! ( fileName ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceUtilitySavedataParam ) ) . reserved1
as * const _ as usize } , 117usize , concat ! (
"Alignment of field: " , stringify ! ( SceUtilitySavedataParam
) , "::" , stringify ! ( reserved1 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceUtilitySavedataParam ) ) . dataBuf as
* const _ as usize } , 120usize , concat ! (
"Alignment of field: " , stringify ! ( SceUtilitySavedataParam
) , "::" , stringify ! ( dataBuf ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceUtilitySavedataParam ) ) . dataBufSize
as * const _ as usize } , 128usize , concat ! (
"Alignment of field: " , stringify ! ( SceUtilitySavedataParam
) , "::" , stringify ! ( dataBufSize ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceUtilitySavedataParam ) ) . dataSize as
* const _ as usize } , 132usize , concat ! (
"Alignment of field: " , stringify ! ( SceUtilitySavedataParam
) , "::" , stringify ! ( dataSize ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceUtilitySavedataParam ) ) . sfoParam as
* const _ as usize } , 136usize , concat ! (
"Alignment of field: " , stringify ! ( SceUtilitySavedataParam
) , "::" , stringify ! ( sfoParam ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceUtilitySavedataParam ) ) .
icon0FileData as * const _ as usize } , 1424usize , concat ! (
"Alignment of field: " , stringify ! ( SceUtilitySavedataParam
) , "::" , stringify ! ( icon0FileData ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceUtilitySavedataParam ) ) .
icon1FileData as * const _ as usize } , 1448usize , concat ! (
"Alignment of field: " , stringify ! ( SceUtilitySavedataParam
) , "::" , stringify ! ( icon1FileData ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceUtilitySavedataParam ) ) .
pic1FileData as * const _ as usize } , 1472usize , concat ! (
"Alignment of field: " , stringify ! ( SceUtilitySavedataParam
) , "::" , stringify ! ( pic1FileData ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceUtilitySavedataParam ) ) .
snd0FileData as * const _ as usize } , 1496usize , concat ! (
"Alignment of field: " , stringify ! ( SceUtilitySavedataParam
) , "::" , stringify ! ( snd0FileData ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceUtilitySavedataParam ) ) . newData as
* const _ as usize } , 1520usize , concat ! (
"Alignment of field: " , stringify ! ( SceUtilitySavedataParam
) , "::" , stringify ! ( newData ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceUtilitySavedataParam ) ) . focus as *
const _ as usize } , 1528usize , concat ! (
"Alignment of field: " , stringify ! ( SceUtilitySavedataParam
) , "::" , stringify ! ( focus ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const SceUtilitySavedataParam ) ) . unknown2 as
* const _ as usize } , 1532usize , concat ! (
"Alignment of field: " , stringify ! ( SceUtilitySavedataParam
) , "::" , stringify ! ( unknown2 ) ));
}
impl Clone for SceUtilitySavedataParam {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// Saves or Load savedata to/from the passed structure
/// After having called this continue calling sceUtilitySavedataGetStatus to
/// check if the operation is completed
///
/// @param params - savedata parameters
/// @return 0 on success
pub fn sceUtilitySavedataInitStart(params: *mut SceUtilitySavedataParam)
-> i32;
}
extern "C" {
/// Check the current status of the saving/loading/shutdown process
/// Continue calling this to check current status of the process
/// before calling this call also sceUtilitySavedataUpdate
/// @return 2 if the process is still being processed.
/// 3 on save/load success, then you can call sceUtilitySavedataShutdownStart.
/// 4 on complete shutdown.
pub fn sceUtilitySavedataGetStatus() -> i32;
}
extern "C" {
/// Shutdown the savedata utility. after calling this continue calling
/// ::sceUtilitySavedataGetStatus to check when it has shutdown
///
/// @return 0 on success
///
pub fn sceUtilitySavedataShutdownStart() -> i32;
}
extern "C" {
/// Refresh status of the savedata function
///
/// @param unknown - unknown, pass 1
pub fn sceUtilitySavedataUpdate(unknown: i32);
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum pspUtilityGameSharingMode {
PSP_UTILITY_GAMESHARING_MODE_SINGLE = 1,
PSP_UTILITY_GAMESHARING_MODE_MULTIPLE = 2,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum pspUtilityGameSharingDataType {
PSP_UTILITY_GAMESHARING_DATA_TYPE_FILE = 1,
PSP_UTILITY_GAMESHARING_DATA_TYPE_MEMORY = 2,
}
/// Structure to hold the parameters for Game Sharing
#[repr(C)]
#[derive(Debug, Copy)]
pub struct _pspUtilityGameSharingParams {
pub base: pspUtilityDialogCommon,
pub unknown1: i32,
pub unknown2: i32,
pub name: [u8; 8usize],
pub unknown3: i32,
pub unknown4: i32,
pub unknown5: i32,
pub result: i32,
pub filepath: *mut u8,
pub mode: pspUtilityGameSharingMode,
pub datatype: pspUtilityGameSharingDataType,
pub data: *mut c_void,
pub datasize: u32,
}
#[test]
fn bindgen_test_layout__pspUtilityGameSharingParams() {
assert_eq!(::core::mem::size_of::<_pspUtilityGameSharingParams>() ,
112usize , concat ! (
"Size of: " , stringify ! ( _pspUtilityGameSharingParams ) ));
assert_eq! (::core::mem::align_of::<_pspUtilityGameSharingParams>() ,
8usize , concat ! (
"Alignment of " , stringify ! ( _pspUtilityGameSharingParams )
));
assert_eq! (unsafe {
& ( * ( 0 as * const _pspUtilityGameSharingParams ) ) . base
as * const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! (
_pspUtilityGameSharingParams ) , "::" , stringify ! ( base )
));
assert_eq! (unsafe {
& ( * ( 0 as * const _pspUtilityGameSharingParams ) ) .
unknown1 as * const _ as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! (
_pspUtilityGameSharingParams ) , "::" , stringify ! ( unknown1
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _pspUtilityGameSharingParams ) ) .
unknown2 as * const _ as usize } , 52usize , concat ! (
"Alignment of field: " , stringify ! (
_pspUtilityGameSharingParams ) , "::" , stringify ! ( unknown2
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _pspUtilityGameSharingParams ) ) . name
as * const _ as usize } , 56usize , concat ! (
"Alignment of field: " , stringify ! (
_pspUtilityGameSharingParams ) , "::" , stringify ! ( name )
));
assert_eq! (unsafe {
& ( * ( 0 as * const _pspUtilityGameSharingParams ) ) .
unknown3 as * const _ as usize } , 64usize , concat ! (
"Alignment of field: " , stringify ! (
_pspUtilityGameSharingParams ) , "::" , stringify ! ( unknown3
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _pspUtilityGameSharingParams ) ) .
unknown4 as * const _ as usize } , 68usize , concat ! (
"Alignment of field: " , stringify ! (
_pspUtilityGameSharingParams ) , "::" , stringify ! ( unknown4
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _pspUtilityGameSharingParams ) ) .
unknown5 as * const _ as usize } , 72usize , concat ! (
"Alignment of field: " , stringify ! (
_pspUtilityGameSharingParams ) , "::" , stringify ! ( unknown5
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _pspUtilityGameSharingParams ) ) . result
as * const _ as usize } , 76usize , concat ! (
"Alignment of field: " , stringify ! (
_pspUtilityGameSharingParams ) , "::" , stringify ! ( result )
));
assert_eq! (unsafe {
& ( * ( 0 as * const _pspUtilityGameSharingParams ) ) .
filepath as * const _ as usize } , 80usize , concat ! (
"Alignment of field: " , stringify ! (
_pspUtilityGameSharingParams ) , "::" , stringify ! ( filepath
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _pspUtilityGameSharingParams ) ) . mode
as * const _ as usize } , 88usize , concat ! (
"Alignment of field: " , stringify ! (
_pspUtilityGameSharingParams ) , "::" , stringify ! ( mode )
));
assert_eq! (unsafe {
& ( * ( 0 as * const _pspUtilityGameSharingParams ) ) .
datatype as * const _ as usize } , 92usize , concat ! (
"Alignment of field: " , stringify ! (
_pspUtilityGameSharingParams ) , "::" , stringify ! ( datatype
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _pspUtilityGameSharingParams ) ) . data
as * const _ as usize } , 96usize , concat ! (
"Alignment of field: " , stringify ! (
_pspUtilityGameSharingParams ) , "::" , stringify ! ( data )
));
assert_eq! (unsafe {
& ( * ( 0 as * const _pspUtilityGameSharingParams ) ) .
datasize as * const _ as usize } , 104usize , concat ! (
"Alignment of field: " , stringify ! (
_pspUtilityGameSharingParams ) , "::" , stringify ! ( datasize
) ));
}
impl Clone for _pspUtilityGameSharingParams {
fn clone(&self) -> Self { *self }
}
/// Structure to hold the parameters for Game Sharing
pub type pspUtilityGameSharingParams = _pspUtilityGameSharingParams;
extern "C" {
/// Init the game sharing
///
/// @param params - game sharing parameters
/// @return 0 on success, < 0 on error.
pub fn sceUtilityGameSharingInitStart(params:
*mut pspUtilityGameSharingParams)
-> i32;
}
extern "C" {
/// Shutdown game sharing.
pub fn sceUtilityGameSharingShutdownStart();
}
extern "C" {
/// Get the current status of game sharing.
///
/// @return 2 if the GUI is visible (you need to call sceUtilityGameSharingGetStatus).
/// 3 if the user cancelled the dialog, and you need to call sceUtilityGameSharingShutdownStart.
/// 4 if the dialog has been successfully shut down.
pub fn sceUtilityGameSharingGetStatus() -> i32;
}
extern "C" {
/// Refresh the GUI for game sharing
///
/// @param n - unknown, pass 1
pub fn sceUtilityGameSharingUpdate(n: i32);
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum pspUtilityHtmlViewerDisconnectModes {
PSP_UTILITY_HTMLVIEWER_DISCONNECTMODE_ENABLE = 0,
PSP_UTILITY_HTMLVIEWER_DISCONNECTMODE_DISABLE = 1,
PSP_UTILITY_HTMLVIEWER_DISCONNECTMODE_CONFIRM = 2,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum pspUtilityHtmlViewerInterfaceModes {
PSP_UTILITY_HTMLVIEWER_INTERFACEMODE_FULL = 0,
PSP_UTILITY_HTMLVIEWER_INTERFACEMODE_LIMITED = 1,
PSP_UTILITY_HTMLVIEWER_INTERFACEMODE_NONE = 2,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum pspUtilityHtmlViewerCookieModes {
PSP_UTILITY_HTMLVIEWER_COOKIEMODE_DISABLED = 0,
PSP_UTILITY_HTMLVIEWER_COOKIEMODE_ENABLED = 1,
PSP_UTILITY_HTMLVIEWER_COOKIEMODE_CONFIRM = 2,
PSP_UTILITY_HTMLVIEWER_COOKIEMODE_DEFAULT = 3,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum pspUtilityHtmlViewerTextSizes {
PSP_UTILITY_HTMLVIEWER_TEXTSIZE_LARGE = 0,
PSP_UTILITY_HTMLVIEWER_TEXTSIZE_NORMAL = 1,
PSP_UTILITY_HTMLVIEWER_TEXTSIZE_SMALL = 2,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum pspUtilityHtmlViewerDisplayModes {
PSP_UTILITY_HTMLVIEWER_DISPLAYMODE_NORMAL = 0,
PSP_UTILITY_HTMLVIEWER_DISPLAYMODE_FIT = 1,
PSP_UTILITY_HTMLVIEWER_DISPLAYMODE_SMART_FIT = 2,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum pspUtilityHtmlViewerConnectModes {
PSP_UTILITY_HTMLVIEWER_CONNECTMODE_LAST = 0,
PSP_UTILITY_HTMLVIEWER_CONNECTMODE_MANUAL_ONCE = 1,
PSP_UTILITY_HTMLVIEWER_CONNECTMODE_MANUAL_ALL = 2,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum pspUtilityHtmlViewerOptions {
PSP_UTILITY_HTMLVIEWER_OPEN_SCE_START_PAGE = 1,
PSP_UTILITY_HTMLVIEWER_DISABLE_STARTUP_LIMITS = 2,
PSP_UTILITY_HTMLVIEWER_DISABLE_EXIT_DIALOG = 4,
PSP_UTILITY_HTMLVIEWER_DISABLE_CURSOR = 8,
PSP_UTILITY_HTMLVIEWER_DISABLE_DOWNLOAD_COMPLETE_DIALOG = 16,
PSP_UTILITY_HTMLVIEWER_DISABLE_DOWNLOAD_START_DIALOG = 32,
PSP_UTILITY_HTMLVIEWER_DISABLE_DOWNLOAD_DESTINATION_DIALOG = 64,
PSP_UTILITY_HTMLVIEWER_LOCK_DOWNLOAD_DESTINATION_DIALOG = 128,
PSP_UTILITY_HTMLVIEWER_DISABLE_TAB_DISPLAY = 256,
PSP_UTILITY_HTMLVIEWER_ENABLE_ANALOG_HOLD = 512,
PSP_UTILITY_HTMLVIEWER_ENABLE_FLASH = 1024,
PSP_UTILITY_HTMLVIEWER_DISABLE_LRTRIGGER = 2048,
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct pspUtilityHtmlViewerParam {
pub base: pspUtilityDialogCommon,
/// Pointer to the memory pool to be used
pub memaddr: *mut c_void,
/// Size of the memory pool
pub memsize: u32,
/// Unknown. Pass 0
pub unknown1: i32,
/// Unknown. Pass 0
pub unknown2: i32,
/// URL to be opened initially
pub initialurl: *mut u8,
/// Number of tabs (maximum of 3)
pub numtabs: u32,
/// One of ::pspUtilityHtmlViewerInterfaceModes
pub interfacemode: u32,
/// Values from ::pspUtilityHtmlViewerOptions. Bitwise OR together
pub options: u32,
/// Directory to be used for downloading
pub dldirname: *mut u8,
/// Filename to be used for downloading
pub dlfilename: *mut u8,
/// Directory to be used for uploading
pub uldirname: *mut u8,
/// Filename to be used for uploading
pub ulfilename: *mut u8,
/// One of ::pspUtilityHtmlViewerCookieModes
pub cookiemode: u32,
/// Unknown. Pass 0
pub unknown3: u32,
/// URL to set the home page to
pub homeurl: *mut u8,
/// One of ::pspUtilityHtmlViewerTextSizes
pub textsize: u32,
/// One of ::pspUtilityHtmlViewerDisplayModes
pub displaymode: u32,
/// One of ::pspUtilityHtmlViewerConnectModes
pub connectmode: u32,
/// One of ::pspUtilityHtmlViewerDisconnectModes
pub disconnectmode: u32,
/// The maximum amount of memory the browser used
pub memused: u32,
/// Unknown. Pass 0
pub unknown4: [i32; 10usize],
}
#[test]
fn bindgen_test_layout_pspUtilityHtmlViewerParam() {
assert_eq!(::core::mem::size_of::<pspUtilityHtmlViewerParam>() , 208usize
, concat ! (
"Size of: " , stringify ! ( pspUtilityHtmlViewerParam ) ));
assert_eq! (::core::mem::align_of::<pspUtilityHtmlViewerParam>() , 8usize
, concat ! (
"Alignment of " , stringify ! ( pspUtilityHtmlViewerParam )
));
assert_eq! (unsafe {
& ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) . base as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! (
pspUtilityHtmlViewerParam ) , "::" , stringify ! ( base ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) . memaddr
as * const _ as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! (
pspUtilityHtmlViewerParam ) , "::" , stringify ! ( memaddr )
));
assert_eq! (unsafe {
& ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) . memsize
as * const _ as usize } , 56usize , concat ! (
"Alignment of field: " , stringify ! (
pspUtilityHtmlViewerParam ) , "::" , stringify ! ( memsize )
));
assert_eq! (unsafe {
& ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) . unknown1
as * const _ as usize } , 60usize , concat ! (
"Alignment of field: " , stringify ! (
pspUtilityHtmlViewerParam ) , "::" , stringify ! ( unknown1 )
));
assert_eq! (unsafe {
& ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) . unknown2
as * const _ as usize } , 64usize , concat ! (
"Alignment of field: " , stringify ! (
pspUtilityHtmlViewerParam ) , "::" , stringify ! ( unknown2 )
));
assert_eq! (unsafe {
& ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) .
initialurl as * const _ as usize } , 72usize , concat ! (
"Alignment of field: " , stringify ! (
pspUtilityHtmlViewerParam ) , "::" , stringify ! ( initialurl
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) . numtabs
as * const _ as usize } , 80usize , concat ! (
"Alignment of field: " , stringify ! (
pspUtilityHtmlViewerParam ) , "::" , stringify ! ( numtabs )
));
assert_eq! (unsafe {
& ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) .
interfacemode as * const _ as usize } , 84usize , concat ! (
"Alignment of field: " , stringify ! (
pspUtilityHtmlViewerParam ) , "::" , stringify ! (
interfacemode ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) . options
as * const _ as usize } , 88usize , concat ! (
"Alignment of field: " , stringify ! (
pspUtilityHtmlViewerParam ) , "::" , stringify ! ( options )
));
assert_eq! (unsafe {
& ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) . dldirname
as * const _ as usize } , 96usize , concat ! (
"Alignment of field: " , stringify ! (
pspUtilityHtmlViewerParam ) , "::" , stringify ! ( dldirname )
));
assert_eq! (unsafe {
& ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) .
dlfilename as * const _ as usize } , 104usize , concat ! (
"Alignment of field: " , stringify ! (
pspUtilityHtmlViewerParam ) , "::" , stringify ! ( dlfilename
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) . uldirname
as * const _ as usize } , 112usize , concat ! (
"Alignment of field: " , stringify ! (
pspUtilityHtmlViewerParam ) , "::" , stringify ! ( uldirname )
));
assert_eq! (unsafe {
& ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) .
ulfilename as * const _ as usize } , 120usize , concat ! (
"Alignment of field: " , stringify ! (
pspUtilityHtmlViewerParam ) , "::" , stringify ! ( ulfilename
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) .
cookiemode as * const _ as usize } , 128usize , concat ! (
"Alignment of field: " , stringify ! (
pspUtilityHtmlViewerParam ) , "::" , stringify ! ( cookiemode
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) . unknown3
as * const _ as usize } , 132usize , concat ! (
"Alignment of field: " , stringify ! (
pspUtilityHtmlViewerParam ) , "::" , stringify ! ( unknown3 )
));
assert_eq! (unsafe {
& ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) . homeurl
as * const _ as usize } , 136usize , concat ! (
"Alignment of field: " , stringify ! (
pspUtilityHtmlViewerParam ) , "::" , stringify ! ( homeurl )
));
assert_eq! (unsafe {
& ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) . textsize
as * const _ as usize } , 144usize , concat ! (
"Alignment of field: " , stringify ! (
pspUtilityHtmlViewerParam ) , "::" , stringify ! ( textsize )
));
assert_eq! (unsafe {
& ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) .
displaymode as * const _ as usize } , 148usize , concat ! (
"Alignment of field: " , stringify ! (
pspUtilityHtmlViewerParam ) , "::" , stringify ! ( displaymode
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) .
connectmode as * const _ as usize } , 152usize , concat ! (
"Alignment of field: " , stringify ! (
pspUtilityHtmlViewerParam ) , "::" , stringify ! ( connectmode
) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) .
disconnectmode as * const _ as usize } , 156usize , concat ! (
"Alignment of field: " , stringify ! (
pspUtilityHtmlViewerParam ) , "::" , stringify ! (
disconnectmode ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) . memused
as * const _ as usize } , 160usize , concat ! (
"Alignment of field: " , stringify ! (
pspUtilityHtmlViewerParam ) , "::" , stringify ! ( memused )
));
assert_eq! (unsafe {
& ( * ( 0 as * const pspUtilityHtmlViewerParam ) ) . unknown4
as * const _ as usize } , 164usize , concat ! (
"Alignment of field: " , stringify ! (
pspUtilityHtmlViewerParam ) , "::" , stringify ! ( unknown4 )
));
}
impl Clone for pspUtilityHtmlViewerParam {
fn clone(&self) -> Self { *self }
}
extern "C" {
/// Init the html viewer
///
/// @param params - html viewer parameters
///
/// @return 0 on success, < 0 on error.
pub fn sceUtilityHtmlViewerInitStart(params:
*mut pspUtilityHtmlViewerParam)
-> i32;
}
extern "C" {
/// Shutdown html viewer.
pub fn sceUtilityHtmlViewerShutdownStart() -> i32;
}
extern "C" {
/// Refresh the GUI for html viewer
///
/// @param n - unknown, pass 1
pub fn sceUtilityHtmlViewerUpdate(n: i32) -> i32;
}
extern "C" {
/// Get the current status of the html viewer.
///
/// @return 2 if the GUI is visible (you need to call sceUtilityHtmlViewerGetStatus).
/// 3 if the user cancelled the dialog, and you need to call sceUtilityHtmlViewerShutdownStart.
/// 4 if the dialog has been successfully shut down.
pub fn sceUtilityHtmlViewerGetStatus() -> i32;
}
extern "C" {
/// Set Integer System Parameter
///
/// @param id - which parameter to set
/// @param value - integer value to set
/// @return 0 on success, PSP_SYSTEMPARAM_RETVAL_FAIL on failure
pub fn sceUtilitySetSystemParamInt(id: i32, value: i32)
-> i32;
}
extern "C" {
/// Set String System Parameter
///
/// @param id - which parameter to set
/// @param str - char * value to set
/// @return 0 on success, PSP_SYSTEMPARAM_RETVAL_FAIL on failure
pub fn sceUtilitySetSystemParamString(id: i32, str: *const u8)
-> i32;
}
extern "C" {
/// Get Integer System Parameter
///
/// @param id - which parameter to get
/// @param value - pointer to integer value to place result in
/// @return 0 on success, PSP_SYSTEMPARAM_RETVAL_FAIL on failure
pub fn sceUtilityGetSystemParamInt(id: i32, value: *mut i32)
-> i32;
}
extern "C" {
/// Get String System Parameter
///
/// @param id - which parameter to get
/// @param str - char * buffer to place result in
/// @param len - length of str buffer
/// @return 0 on success, PSP_SYSTEMPARAM_RETVAL_FAIL on failure
pub fn sceUtilityGetSystemParamString(id: i32, str: *mut u8,
len: i32) -> i32;
}
#[repr(u32)]
/// Enumeration for input language
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum SceUtilityOskInputLanguage {
PSP_UTILITY_OSK_LANGUAGE_DEFAULT = 0,
PSP_UTILITY_OSK_LANGUAGE_JAPANESE = 1,
PSP_UTILITY_OSK_LANGUAGE_ENGLISH = 2,
PSP_UTILITY_OSK_LANGUAGE_FRENCH = 3,
PSP_UTILITY_OSK_LANGUAGE_SPANISH = 4,
PSP_UTILITY_OSK_LANGUAGE_GERMAN = 5,
PSP_UTILITY_OSK_LANGUAGE_ITALIAN = 6,
PSP_UTILITY_OSK_LANGUAGE_DUTCH = 7,
PSP_UTILITY_OSK_LANGUAGE_PORTUGESE = 8,
PSP_UTILITY_OSK_LANGUAGE_RUSSIAN = 9,
PSP_UTILITY_OSK_LANGUAGE_KOREAN = 10,
}
#[repr(u32)]
/// Enumeration for OSK internal state
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum SceUtilityOskState {
PSP_UTILITY_OSK_DIALOG_NONE = 0,
PSP_UTILITY_OSK_DIALOG_INITING = 1,
PSP_UTILITY_OSK_DIALOG_INITED = 2,
PSP_UTILITY_OSK_DIALOG_VISIBLE = 3,
PSP_UTILITY_OSK_DIALOG_QUIT = 4,
PSP_UTILITY_OSK_DIALOG_FINISHED = 5,
}
#[repr(u32)]
/// Enumeration for OSK field results
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum SceUtilityOskResult {
PSP_UTILITY_OSK_RESULT_UNCHANGED = 0,
PSP_UTILITY_OSK_RESULT_CANCELLED = 1,
PSP_UTILITY_OSK_RESULT_CHANGED = 2,
}
#[repr(u32)]
/// Enumeration for input types (these are limited by initial choice of language)
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum SceUtilityOskInputType {
PSP_UTILITY_OSK_INPUTTYPE_ALL = 0,
PSP_UTILITY_OSK_INPUTTYPE_LATIN_DIGIT = 1,
PSP_UTILITY_OSK_INPUTTYPE_LATIN_SYMBOL = 2,
PSP_UTILITY_OSK_INPUTTYPE_LATIN_LOWERCASE = 4,
PSP_UTILITY_OSK_INPUTTYPE_LATIN_UPPERCASE = 8,
PSP_UTILITY_OSK_INPUTTYPE_JAPANESE_DIGIT = 256,
PSP_UTILITY_OSK_INPUTTYPE_JAPANESE_SYMBOL = 512,
PSP_UTILITY_OSK_INPUTTYPE_JAPANESE_LOWERCASE = 1024,
PSP_UTILITY_OSK_INPUTTYPE_JAPANESE_UPPERCASE = 2048,
PSP_UTILITY_OSK_INPUTTYPE_JAPANESE_HIRAGANA = 4096,
PSP_UTILITY_OSK_INPUTTYPE_JAPANESE_HALF_KATAKANA = 8192,
PSP_UTILITY_OSK_INPUTTYPE_JAPANESE_KATAKANA = 16384,
PSP_UTILITY_OSK_INPUTTYPE_JAPANESE_KANJI = 32768,
PSP_UTILITY_OSK_INPUTTYPE_RUSSIAN_LOWERCASE = 65536,
PSP_UTILITY_OSK_INPUTTYPE_RUSSIAN_UPPERCASE = 131072,
PSP_UTILITY_OSK_INPUTTYPE_KOREAN = 262144,
PSP_UTILITY_OSK_INPUTTYPE_URL = 524288,
}
/// OSK Field data
#[repr(C)]
#[derive(Debug, Copy)]
pub struct _SceUtilityOskData {
/// Unknown. Pass 0.
pub unk_00: i32,
/// Unknown. Pass 0.
pub unk_04: i32,
/// One of ::SceUtilityOskInputLanguage
pub language: i32,
/// Unknown. Pass 0.
pub unk_12: i32,
/// One or more of ::SceUtilityOskInputType (types that are selectable by pressing SELECT)
pub inputtype: i32,
/// Number of lines
pub lines: i32,
/// Unknown. Pass 0.
pub unk_24: i32,
/// Description text
pub desc: *mut u16,
/// Initial text
pub intext: *mut u16,
/// Length of output text
pub outtextlength: i32,
/// Pointer to the output text
pub outtext: *mut u16,
/// Result. One of ::SceUtilityOskResult
pub result: i32,
/// The max text that can be input
pub outtextlimit: i32,
}
#[test]
fn bindgen_test_layout__SceUtilityOskData() {
assert_eq!(::core::mem::size_of::<_SceUtilityOskData>() , 72usize , concat
! ( "Size of: " , stringify ! ( _SceUtilityOskData ) ));
assert_eq! (::core::mem::align_of::<_SceUtilityOskData>() , 8usize ,
concat ! (
"Alignment of " , stringify ! ( _SceUtilityOskData ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _SceUtilityOskData ) ) . unk_00 as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( _SceUtilityOskData ) ,
"::" , stringify ! ( unk_00 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _SceUtilityOskData ) ) . unk_04 as *
const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( _SceUtilityOskData ) ,
"::" , stringify ! ( unk_04 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _SceUtilityOskData ) ) . language as *
const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( _SceUtilityOskData ) ,
"::" , stringify ! ( language ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _SceUtilityOskData ) ) . unk_12 as *
const _ as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( _SceUtilityOskData ) ,
"::" , stringify ! ( unk_12 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _SceUtilityOskData ) ) . inputtype as *
const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( _SceUtilityOskData ) ,
"::" , stringify ! ( inputtype ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _SceUtilityOskData ) ) . lines as * const
_ as usize } , 20usize , concat ! (
"Alignment of field: " , stringify ! ( _SceUtilityOskData ) ,
"::" , stringify ! ( lines ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _SceUtilityOskData ) ) . unk_24 as *
const _ as usize } , 24usize , concat ! (
"Alignment of field: " , stringify ! ( _SceUtilityOskData ) ,
"::" , stringify ! ( unk_24 ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _SceUtilityOskData ) ) . desc as * const
_ as usize } , 32usize , concat ! (
"Alignment of field: " , stringify ! ( _SceUtilityOskData ) ,
"::" , stringify ! ( desc ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _SceUtilityOskData ) ) . intext as *
const _ as usize } , 40usize , concat ! (
"Alignment of field: " , stringify ! ( _SceUtilityOskData ) ,
"::" , stringify ! ( intext ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _SceUtilityOskData ) ) . outtextlength as
* const _ as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! ( _SceUtilityOskData ) ,
"::" , stringify ! ( outtextlength ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _SceUtilityOskData ) ) . outtext as *
const _ as usize } , 56usize , concat ! (
"Alignment of field: " , stringify ! ( _SceUtilityOskData ) ,
"::" , stringify ! ( outtext ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _SceUtilityOskData ) ) . result as *
const _ as usize } , 64usize , concat ! (
"Alignment of field: " , stringify ! ( _SceUtilityOskData ) ,
"::" , stringify ! ( result ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _SceUtilityOskData ) ) . outtextlimit as
* const _ as usize } , 68usize , concat ! (
"Alignment of field: " , stringify ! ( _SceUtilityOskData ) ,
"::" , stringify ! ( outtextlimit ) ));
}
impl Clone for _SceUtilityOskData {
fn clone(&self) -> Self { *self }
}
/// OSK Field data
pub type SceUtilityOskData = _SceUtilityOskData;
/// OSK parameters
#[repr(C)]
#[derive(Debug, Copy)]
pub struct _SceUtilityOskParams {
pub base: pspUtilityDialogCommon,
/// Number of input fields
pub datacount: i32,
/// Pointer to the start of the data for the input fields
pub data: *mut SceUtilityOskData,
/// The local OSK state, one of ::SceUtilityOskState
pub state: i32,
/// Unknown. Pass 0
pub unk_60: i32,
}
#[test]
fn bindgen_test_layout__SceUtilityOskParams() {
assert_eq!(::core::mem::size_of::<_SceUtilityOskParams>() , 72usize ,
concat ! ( "Size of: " , stringify ! ( _SceUtilityOskParams )
));
assert_eq! (::core::mem::align_of::<_SceUtilityOskParams>() , 8usize ,
concat ! (
"Alignment of " , stringify ! ( _SceUtilityOskParams ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _SceUtilityOskParams ) ) . base as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( _SceUtilityOskParams )
, "::" , stringify ! ( base ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _SceUtilityOskParams ) ) . datacount as *
const _ as usize } , 48usize , concat ! (
"Alignment of field: " , stringify ! ( _SceUtilityOskParams )
, "::" , stringify ! ( datacount ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _SceUtilityOskParams ) ) . data as *
const _ as usize } , 56usize , concat ! (
"Alignment of field: " , stringify ! ( _SceUtilityOskParams )
, "::" , stringify ! ( data ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _SceUtilityOskParams ) ) . state as *
const _ as usize } , 64usize , concat ! (
"Alignment of field: " , stringify ! ( _SceUtilityOskParams )
, "::" , stringify ! ( state ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _SceUtilityOskParams ) ) . unk_60 as *
const _ as usize } , 68usize , concat ! (
"Alignment of field: " , stringify ! ( _SceUtilityOskParams )
, "::" , stringify ! ( unk_60 ) ));
}
impl Clone for _SceUtilityOskParams {
fn clone(&self) -> Self { *self }
}
/// OSK parameters
pub type SceUtilityOskParams = _SceUtilityOskParams;
extern "C" {
/// Create an on-screen keyboard
///
/// @param params - OSK parameters.
///
/// @return < 0 on error.
pub fn sceUtilityOskInitStart(params: *mut SceUtilityOskParams)
-> i32;
}
extern "C" {
/// Remove a currently active keyboard. After calling this function you must
///
/// poll sceUtilityOskGetStatus() until it returns PSP_UTILITY_DIALOG_NONE.
///
/// @return < 0 on error.
pub fn sceUtilityOskShutdownStart() -> i32;
}
extern "C" {
/// Refresh the GUI for a keyboard currently active
///
/// @param n - Unknown, pass 1.
///
/// @return < 0 on error.
pub fn sceUtilityOskUpdate(n: i32) -> i32;
}
extern "C" {
/// Get the status of a on-screen keyboard currently active.
///
/// @return the current status of the keyboard. See ::pspUtilityDialogState for details.
pub fn sceUtilityOskGetStatus() -> i32;
}
extern "C" {
/// Load a network module (PRX) from user mode.
/// Load PSP_NET_MODULE_COMMON and PSP_NET_MODULE_INET
/// to use infrastructure WifI (via an access point).
/// Available on firmware 2.00 and higher only.
///
/// @param module - module number to load (PSP_NET_MODULE_xxx)
/// @return 0 on success, < 0 on error
pub fn sceUtilityLoadNetModule(module: i32) -> i32;
}
extern "C" {
/// Unload a network module (PRX) from user mode.
/// Available on firmware 2.00 and higher only.
///
/// @param module - module number be unloaded
/// @return 0 on success, < 0 on error
pub fn sceUtilityUnloadNetModule(module: i32) -> i32;
}
extern "C" {
/// Load an audio/video module (PRX) from user mode.
///
/// Available on firmware 2.00 and higher only.
///
/// @param module - module number to load (PSP_AV_MODULE_xxx)
/// @return 0 on success, < 0 on error
pub fn sceUtilityLoadAvModule(module: i32) -> i32;
}
extern "C" {
/// Unload an audio/video module (PRX) from user mode.
/// Available on firmware 2.00 and higher only.
///
/// @param module - module number to be unloaded
/// @return 0 on success, < 0 on error
pub fn sceUtilityUnloadAvModule(module: i32) -> i32;
}
extern "C" {
/// Load a usb module (PRX) from user mode.
/// Available on firmware 2.70 and higher only.
///
/// @param module - module number to load (PSP_USB_MODULE_xxx)
/// @return 0 on success, < 0 on error
pub fn sceUtilityLoadUsbModule(module: i32) -> i32;
}
extern "C" {
/// Unload a usb module (PRX) from user mode.
/// Available on firmware 2.70 and higher only.
///
/// @param module - module number to be unloaded
/// @return 0 on success, < 0 on error
pub fn sceUtilityUnloadUsbModule(module: i32) -> i32;
}
extern "C" {
/// Load a module (PRX) from user mode.
///
/// @param module - module to load (PSP_MODULE_xxx)
///
/// @return 0 on success, < 0 on error
pub fn sceUtilityLoadModule(module: i32) -> i32;
}
extern "C" {
/// Unload a module (PRX) from user mode.
///
/// @param module - module to unload (PSP_MODULE_xxx)
///
/// @return 0 on success, < 0 on error
pub fn sceUtilityUnloadModule(module: i32) -> i32;
}
#[repr(u32)]
/// Return-values for the various sceUtility***GetStatus() functions
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum pspUtilityDialogState {
PSP_UTILITY_DIALOG_NONE = 0,
PSP_UTILITY_DIALOG_INIT = 1,
PSP_UTILITY_DIALOG_VISIBLE = 2,
PSP_UTILITY_DIALOG_QUIT = 3,
PSP_UTILITY_DIALOG_FINISHED = 4,
}
extern "C" {
/// Decompress gzip'd data (requires kernel mode)
///
/// @param dest - pointer to destination buffer
/// @param destSize - size of destination buffer
/// @param src - pointer to source (compressed) data
/// @param unknown - unknown, pass NULL
/// @return size decompressed on success, < 0 on error
pub fn sceKernelGzipDecompress(dest: *mut u8, destSize: u32,
src: *const u8, unknown: u32) -> i32;
}
extern "C" {
/// Decompress deflate'd data (requires kernel mode)
///
/// @param dest - pointer to destination buffer
/// @param destSize - size of destination buffer
/// @param src - pointer to source (compressed) data
/// @param unknown - unknown, pass NULL
/// @return size decompressed on success, < 0 on error
pub fn sceKernelDeflateDecompress(dest: *mut u8, destSize: u32,
src: *const u8, unknown: u32)
-> i32;
}
extern "C" {
/// Invalidate the entire data cache
pub fn sceKernelDcacheInvalidateAll();
}
extern "C" {
/// Check whether the specified address is in the data cache
/// @param addr - The address to check
///
/// @return 0 = not cached, 1 = cache
pub fn sceKernelDcacheProbe(addr: *mut c_void) -> i32;
}
extern "C" {
/// Check whether the specified address is in the instruction cache
/// @param addr - The address to check
///
/// @return 0 = not cached, 1 = cache
pub fn sceKernelIcacheProbe(addr: *const c_void) -> i32;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pspvfpu_context {
_unused: [u8; 0],
}
pub type vfpumatrixset_t = u8;
extern "C" {
/// Prepare to use the VFPU. This set's the calling thread's VFPU
/// attribute, and returns a pointer to some VFPU state storage.
/// The initial value all all VFPU matrix registers is undefined.
///
/// @return A VFPU context
pub fn pspvfpu_initcontext() -> *mut pspvfpu_context;
}
extern "C" {
/// Delete a VFPU context. This frees the resources used by the VFPU
/// context.
///
/// @param context The VFPU context to be deleted.
pub fn pspvfpu_deletecontext(context: *mut pspvfpu_context);
}
extern "C" {
/// Use a set of VFPU matrices. This restores the parts of the VFPU
/// state the caller wants restored (if necessary). If the caller was
/// the previous user of the the matrix set, then this call is
/// effectively a no-op. If a matrix has never been used by this
/// context before, then it will initially have an undefined value.
///
/// @param context The VFPU context the caller wants to restore
/// from. It is valid to pass NULL as a context. This means the caller
/// wants to reserve a temporary matrix without affecting other VFPU
/// users, but doesn't want any long-term matrices itself.
///
/// @param keepset The set of matrices the caller wants to use, and
/// keep the values persistently.
///
/// @param tempset A set of matrices the callers wants to use
/// temporarily, but doesn't care about the values in the long-term.
pub fn pspvfpu_use_matrices(context: *mut pspvfpu_context,
keepset: vfpumatrixset_t,
tempset: vfpumatrixset_t);
}
extern "C" {
pub fn sceVideocodecOpen(Buffer: *mut u32, Type: i32)
-> i32;
}
extern "C" {
pub fn sceVideocodecGetEDRAM(Buffer: *mut u32, Type: i32)
-> i32;
}
extern "C" {
pub fn sceVideocodecInit(Buffer: *mut u32, Type: i32)
-> i32;
}
extern "C" {
pub fn sceVideocodecDecode(Buffer: *mut u32, Type: i32)
-> i32;
}
extern "C" {
pub fn sceVideocodecReleaseEDRAM(Buffer: *mut u32) -> i32;
}
extern "C" {
/// Determine if the wlan device is currently powered on
///
/// @return 0 if off, 1 if on
pub fn sceWlanDevIsPowerOn() -> i32;
}
extern "C" {
/// Determine the state of the Wlan power switch
///
/// @return 0 if off, 1 if on
pub fn sceWlanGetSwitchState() -> i32;
}
extern "C" {
/// Get the Ethernet Address of the wlan controller
///
/// @param etherAddr - pointer to a buffer of u8 (NOTE: it only writes to 6 bytes, but
/// requests 8 so pass it 8 bytes just in case)
/// @return 0 on success, < 0 on error
pub fn sceWlanGetEtherAddr(etherAddr: *mut u8) -> i32;
}
extern "C" {
/// Attach to the wlan device
///
/// @return 0 on success, < 0 on error.
pub fn sceWlanDevAttach() -> i32;
}
extern "C" {
/// Detach from the wlan device
///
/// @return 0 on success, < 0 on error/
pub fn sceWlanDevDetach() -> i32;
}
pub type __builtin_va_list = [__va_list_tag; 1usize];
#[repr(C)]
#[derive(Debug, Copy)]
pub struct __va_list_tag {
pub gp_offset: u32,
pub fp_offset: u32,
pub overflow_arg_area: *mut c_void,
pub reg_save_area: *mut c_void,
}
#[test]
fn bindgen_test_layout___va_list_tag() {
assert_eq!(::core::mem::size_of::<__va_list_tag>() , 24usize , concat ! (
"Size of: " , stringify ! ( __va_list_tag ) ));
assert_eq! (::core::mem::align_of::<__va_list_tag>() , 8usize , concat ! (
"Alignment of " , stringify ! ( __va_list_tag ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const __va_list_tag ) ) . gp_offset as * const
_ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( __va_list_tag ) , "::"
, stringify ! ( gp_offset ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const __va_list_tag ) ) . fp_offset as * const
_ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( __va_list_tag ) , "::"
, stringify ! ( fp_offset ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const __va_list_tag ) ) . overflow_arg_area as
* const _ as usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( __va_list_tag ) , "::"
, stringify ! ( overflow_arg_area ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const __va_list_tag ) ) . reg_save_area as *
const _ as usize } , 16usize , concat ! (
"Alignment of field: " , stringify ! ( __va_list_tag ) , "::"
, stringify ! ( reg_save_area ) ));
}
impl Clone for __va_list_tag {
fn clone(&self) -> Self { *self }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment