sdl2-sys 0.37.0

Raw SDL2 bindings for Rust, used internally rust-sdl2
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
/* automatically generated by rust-bindgen */

use crate::*;

pub const MIX_MAJOR_VERSION: u32 = 2;
pub const MIX_MINOR_VERSION: u32 = 0;
pub const MIX_PATCHLEVEL: u32 = 4;
pub const MIX_CHANNELS: u32 = 8;
pub const MIX_DEFAULT_FREQUENCY: u32 = 22050;
pub const MIX_DEFAULT_FORMAT: u32 = 32784;
pub const MIX_DEFAULT_CHANNELS: u32 = 2;
pub const MIX_MAX_VOLUME: u32 = 128;
pub const MIX_CHANNEL_POST: i32 = -2;
pub const MIX_EFFECTSMAXSPEED: &'static [u8; 20usize] = b"MIX_EFFECTSMAXSPEED\0";
pub type __uint8_t = libc::c_uchar;
pub type __int16_t = libc::c_short;
pub type __uint16_t = libc::c_ushort;
pub type __uint32_t = libc::c_uint;
pub type __int64_t = libc::c_long;
pub type __off_t = libc::c_long;
pub type __off64_t = libc::c_long;
pub type Uint8 = u8;
pub type Sint16 = i16;
pub type Uint16 = u16;
pub type Uint32 = u32;
pub type Sint64 = i64;
extern "C" {
    pub fn Mix_Linked_Version() -> *const SDL_version;
}
pub const MIX_InitFlags_MIX_INIT_FLAC: MIX_InitFlags = 1;
pub const MIX_InitFlags_MIX_INIT_MOD: MIX_InitFlags = 2;
pub const MIX_InitFlags_MIX_INIT_MP3: MIX_InitFlags = 8;
pub const MIX_InitFlags_MIX_INIT_OGG: MIX_InitFlags = 16;
pub const MIX_InitFlags_MIX_INIT_MID: MIX_InitFlags = 32;
pub const MIX_InitFlags_MIX_INIT_OPUS: MIX_InitFlags = 64;
pub type MIX_InitFlags = u32;
extern "C" {
    pub fn Mix_Init(flags: libc::c_int) -> libc::c_int;
}
extern "C" {
    pub fn Mix_Quit();
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Mix_Chunk {
    pub allocated: libc::c_int,
    pub abuf: *mut Uint8,
    pub alen: Uint32,
    pub volume: Uint8,
}
#[test]
fn bindgen_test_layout_Mix_Chunk() {
    assert_eq!(
        ::core::mem::size_of::<Mix_Chunk>(),
        24usize,
        concat!("Size of: ", stringify!(Mix_Chunk))
    );
    assert_eq!(
        ::core::mem::align_of::<Mix_Chunk>(),
        8usize,
        concat!("Alignment of ", stringify!(Mix_Chunk))
    );
    assert_eq!(
        unsafe { &(*(::core::ptr::null::<Mix_Chunk>())).allocated as *const _ as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(Mix_Chunk),
            "::",
            stringify!(allocated)
        )
    );
    assert_eq!(
        unsafe { &(*(::core::ptr::null::<Mix_Chunk>())).abuf as *const _ as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(Mix_Chunk),
            "::",
            stringify!(abuf)
        )
    );
    assert_eq!(
        unsafe { &(*(::core::ptr::null::<Mix_Chunk>())).alen as *const _ as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(Mix_Chunk),
            "::",
            stringify!(alen)
        )
    );
    assert_eq!(
        unsafe { &(*(::core::ptr::null::<Mix_Chunk>())).volume as *const _ as usize },
        20usize,
        concat!(
            "Offset of field: ",
            stringify!(Mix_Chunk),
            "::",
            stringify!(volume)
        )
    );
}
pub const Mix_Fading_MIX_NO_FADING: Mix_Fading = 0;
pub const Mix_Fading_MIX_FADING_OUT: Mix_Fading = 1;
pub const Mix_Fading_MIX_FADING_IN: Mix_Fading = 2;
pub type Mix_Fading = u32;
pub const Mix_MusicType_MUS_NONE: Mix_MusicType = 0;
pub const Mix_MusicType_MUS_CMD: Mix_MusicType = 1;
pub const Mix_MusicType_MUS_WAV: Mix_MusicType = 2;
pub const Mix_MusicType_MUS_MOD: Mix_MusicType = 3;
pub const Mix_MusicType_MUS_MID: Mix_MusicType = 4;
pub const Mix_MusicType_MUS_OGG: Mix_MusicType = 5;
pub const Mix_MusicType_MUS_MP3: Mix_MusicType = 6;
pub const Mix_MusicType_MUS_MP3_MAD_UNUSED: Mix_MusicType = 7;
pub const Mix_MusicType_MUS_FLAC: Mix_MusicType = 8;
pub const Mix_MusicType_MUS_MODPLUG_UNUSED: Mix_MusicType = 9;
pub const Mix_MusicType_MUS_OPUS: Mix_MusicType = 10;
pub type Mix_MusicType = u32;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _Mix_Music {
    _unused: [u8; 0],
}
pub type Mix_Music = _Mix_Music;
extern "C" {
    pub fn Mix_OpenAudio(
        frequency: libc::c_int,
        format: Uint16,
        channels: libc::c_int,
        chunksize: libc::c_int,
    ) -> libc::c_int;
}
extern "C" {
    pub fn Mix_OpenAudioDevice(
        frequency: libc::c_int,
        format: Uint16,
        channels: libc::c_int,
        chunksize: libc::c_int,
        device: *const libc::c_char,
        allowed_changes: libc::c_int,
    ) -> libc::c_int;
}
extern "C" {
    pub fn Mix_AllocateChannels(numchans: libc::c_int) -> libc::c_int;
}
extern "C" {
    pub fn Mix_QuerySpec(
        frequency: *mut libc::c_int,
        format: *mut Uint16,
        channels: *mut libc::c_int,
    ) -> libc::c_int;
}
extern "C" {
    pub fn Mix_LoadWAV_RW(src: *mut SDL_RWops, freesrc: libc::c_int) -> *mut Mix_Chunk;
}
extern "C" {
    pub fn Mix_LoadMUS(file: *const libc::c_char) -> *mut Mix_Music;
}
extern "C" {
    pub fn Mix_LoadMUS_RW(src: *mut SDL_RWops, freesrc: libc::c_int) -> *mut Mix_Music;
}
extern "C" {
    pub fn Mix_LoadMUSType_RW(
        src: *mut SDL_RWops,
        type_: Mix_MusicType,
        freesrc: libc::c_int,
    ) -> *mut Mix_Music;
}
extern "C" {
    pub fn Mix_QuickLoad_WAV(mem: *mut Uint8) -> *mut Mix_Chunk;
}
extern "C" {
    pub fn Mix_QuickLoad_RAW(mem: *mut Uint8, len: Uint32) -> *mut Mix_Chunk;
}
extern "C" {
    pub fn Mix_FreeChunk(chunk: *mut Mix_Chunk);
}
extern "C" {
    pub fn Mix_FreeMusic(music: *mut Mix_Music);
}
extern "C" {
    pub fn Mix_GetNumChunkDecoders() -> libc::c_int;
}
extern "C" {
    pub fn Mix_GetChunkDecoder(index: libc::c_int) -> *const libc::c_char;
}
extern "C" {
    pub fn Mix_HasChunkDecoder(name: *const libc::c_char) -> SDL_bool;
}
extern "C" {
    pub fn Mix_GetNumMusicDecoders() -> libc::c_int;
}
extern "C" {
    pub fn Mix_GetMusicDecoder(index: libc::c_int) -> *const libc::c_char;
}
extern "C" {
    pub fn Mix_HasMusicDecoder(name: *const libc::c_char) -> SDL_bool;
}
extern "C" {
    pub fn Mix_GetMusicType(music: *const Mix_Music) -> Mix_MusicType;
}
extern "C" {
    pub fn Mix_SetPostMix(
        mix_func: ::core::option::Option<
            unsafe extern "C" fn(udata: *mut libc::c_void, stream: *mut Uint8, len: libc::c_int),
        >,
        arg: *mut libc::c_void,
    );
}
extern "C" {
    pub fn Mix_HookMusic(
        mix_func: ::core::option::Option<
            unsafe extern "C" fn(udata: *mut libc::c_void, stream: *mut Uint8, len: libc::c_int),
        >,
        arg: *mut libc::c_void,
    );
}
extern "C" {
    pub fn Mix_HookMusicFinished(music_finished: ::core::option::Option<unsafe extern "C" fn()>);
}
extern "C" {
    pub fn Mix_GetMusicHookData() -> *mut libc::c_void;
}
extern "C" {
    pub fn Mix_ChannelFinished(
        channel_finished: ::core::option::Option<unsafe extern "C" fn(channel: libc::c_int)>,
    );
}
pub type Mix_EffectFunc_t = ::core::option::Option<
    unsafe extern "C" fn(
        chan: libc::c_int,
        stream: *mut libc::c_void,
        len: libc::c_int,
        udata: *mut libc::c_void,
    ),
>;
pub type Mix_EffectDone_t =
    ::core::option::Option<unsafe extern "C" fn(chan: libc::c_int, udata: *mut libc::c_void)>;
extern "C" {
    pub fn Mix_RegisterEffect(
        chan: libc::c_int,
        f: Mix_EffectFunc_t,
        d: Mix_EffectDone_t,
        arg: *mut libc::c_void,
    ) -> libc::c_int;
}
extern "C" {
    pub fn Mix_UnregisterEffect(channel: libc::c_int, f: Mix_EffectFunc_t) -> libc::c_int;
}
extern "C" {
    pub fn Mix_UnregisterAllEffects(channel: libc::c_int) -> libc::c_int;
}
extern "C" {
    pub fn Mix_SetPanning(channel: libc::c_int, left: Uint8, right: Uint8) -> libc::c_int;
}
extern "C" {
    pub fn Mix_SetPosition(channel: libc::c_int, angle: Sint16, distance: Uint8) -> libc::c_int;
}
extern "C" {
    pub fn Mix_SetDistance(channel: libc::c_int, distance: Uint8) -> libc::c_int;
}
extern "C" {
    pub fn Mix_SetReverseStereo(channel: libc::c_int, flip: libc::c_int) -> libc::c_int;
}
extern "C" {
    pub fn Mix_ReserveChannels(num: libc::c_int) -> libc::c_int;
}
extern "C" {
    pub fn Mix_GroupChannel(which: libc::c_int, tag: libc::c_int) -> libc::c_int;
}
extern "C" {
    pub fn Mix_GroupChannels(from: libc::c_int, to: libc::c_int, tag: libc::c_int) -> libc::c_int;
}
extern "C" {
    pub fn Mix_GroupAvailable(tag: libc::c_int) -> libc::c_int;
}
extern "C" {
    pub fn Mix_GroupCount(tag: libc::c_int) -> libc::c_int;
}
extern "C" {
    pub fn Mix_GroupOldest(tag: libc::c_int) -> libc::c_int;
}
extern "C" {
    pub fn Mix_GroupNewer(tag: libc::c_int) -> libc::c_int;
}
extern "C" {
    pub fn Mix_PlayChannelTimed(
        channel: libc::c_int,
        chunk: *mut Mix_Chunk,
        loops: libc::c_int,
        ticks: libc::c_int,
    ) -> libc::c_int;
}
extern "C" {
    pub fn Mix_PlayMusic(music: *mut Mix_Music, loops: libc::c_int) -> libc::c_int;
}
extern "C" {
    pub fn Mix_FadeInMusic(
        music: *mut Mix_Music,
        loops: libc::c_int,
        ms: libc::c_int,
    ) -> libc::c_int;
}
extern "C" {
    pub fn Mix_FadeInMusicPos(
        music: *mut Mix_Music,
        loops: libc::c_int,
        ms: libc::c_int,
        position: f64,
    ) -> libc::c_int;
}
extern "C" {
    pub fn Mix_FadeInChannelTimed(
        channel: libc::c_int,
        chunk: *mut Mix_Chunk,
        loops: libc::c_int,
        ms: libc::c_int,
        ticks: libc::c_int,
    ) -> libc::c_int;
}
extern "C" {
    pub fn Mix_Volume(channel: libc::c_int, volume: libc::c_int) -> libc::c_int;
}
extern "C" {
    pub fn Mix_VolumeChunk(chunk: *mut Mix_Chunk, volume: libc::c_int) -> libc::c_int;
}
extern "C" {
    pub fn Mix_VolumeMusic(volume: libc::c_int) -> libc::c_int;
}
extern "C" {
    pub fn Mix_HaltChannel(channel: libc::c_int) -> libc::c_int;
}
extern "C" {
    pub fn Mix_HaltGroup(tag: libc::c_int) -> libc::c_int;
}
extern "C" {
    pub fn Mix_HaltMusic() -> libc::c_int;
}
extern "C" {
    pub fn Mix_ExpireChannel(channel: libc::c_int, ticks: libc::c_int) -> libc::c_int;
}
extern "C" {
    pub fn Mix_FadeOutChannel(which: libc::c_int, ms: libc::c_int) -> libc::c_int;
}
extern "C" {
    pub fn Mix_FadeOutGroup(tag: libc::c_int, ms: libc::c_int) -> libc::c_int;
}
extern "C" {
    pub fn Mix_FadeOutMusic(ms: libc::c_int) -> libc::c_int;
}
extern "C" {
    pub fn Mix_FadingMusic() -> Mix_Fading;
}
extern "C" {
    pub fn Mix_FadingChannel(which: libc::c_int) -> Mix_Fading;
}
extern "C" {
    pub fn Mix_Pause(channel: libc::c_int);
}
extern "C" {
    pub fn Mix_Resume(channel: libc::c_int);
}
extern "C" {
    pub fn Mix_Paused(channel: libc::c_int) -> libc::c_int;
}
extern "C" {
    pub fn Mix_PauseMusic();
}
extern "C" {
    pub fn Mix_ResumeMusic();
}
extern "C" {
    pub fn Mix_RewindMusic();
}
extern "C" {
    pub fn Mix_PausedMusic() -> libc::c_int;
}
extern "C" {
    pub fn Mix_SetMusicPosition(position: f64) -> libc::c_int;
}
extern "C" {
    pub fn Mix_Playing(channel: libc::c_int) -> libc::c_int;
}
extern "C" {
    pub fn Mix_PlayingMusic() -> libc::c_int;
}
extern "C" {
    pub fn Mix_SetMusicCMD(command: *const libc::c_char) -> libc::c_int;
}
extern "C" {
    pub fn Mix_SetSynchroValue(value: libc::c_int) -> libc::c_int;
}
extern "C" {
    pub fn Mix_GetSynchroValue() -> libc::c_int;
}
extern "C" {
    pub fn Mix_SetSoundFonts(paths: *const libc::c_char) -> libc::c_int;
}
extern "C" {
    pub fn Mix_GetSoundFonts() -> *const libc::c_char;
}
extern "C" {
    pub fn Mix_EachSoundFont(
        function: ::core::option::Option<
            unsafe extern "C" fn(arg1: *const libc::c_char, arg2: *mut libc::c_void) -> libc::c_int,
        >,
        data: *mut libc::c_void,
    ) -> libc::c_int;
}
extern "C" {
    pub fn Mix_GetChunk(channel: libc::c_int) -> *mut Mix_Chunk;
}
extern "C" {
    pub fn Mix_CloseAudio();
}