csfml_system_sys/
lib.rs

1/* automatically generated by rust-bindgen 0.55.1 */
2
3#![allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] // added manually
4
5pub const CSFML_VERSION_MAJOR: u32 = 2;
6pub const CSFML_VERSION_MINOR: u32 = 5;
7pub const CSFML_VERSION_PATCH: u32 = 0;
8pub const sfFalse: sfBool = 0; // edited manually
9pub const sfTrue: sfBool = 1; // edited manually
10pub type sfBool = ::std::os::raw::c_int;
11pub type sfInt8 = ::std::os::raw::c_schar;
12pub type sfUint8 = ::std::os::raw::c_uchar;
13pub type sfInt16 = ::std::os::raw::c_short;
14pub type sfUint16 = ::std::os::raw::c_ushort;
15pub type sfInt32 = ::std::os::raw::c_int;
16pub type sfUint32 = ::std::os::raw::c_uint;
17pub type sfInt64 = ::std::os::raw::c_longlong;
18pub type sfUint64 = ::std::os::raw::c_ulonglong;
19#[repr(C)]
20#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
21pub struct sfTime {
22    pub microseconds: sfInt64,
23}
24#[test]
25fn bindgen_test_layout_sfTime() {
26    assert_eq!(
27        ::std::mem::size_of::<sfTime>(),
28        8usize,
29        concat!("Size of: ", stringify!(sfTime))
30    );
31    assert_eq!(
32        ::std::mem::align_of::<sfTime>(),
33        8usize,
34        concat!("Alignment of ", stringify!(sfTime))
35    );
36    assert_eq!(
37        unsafe { &(*(::std::ptr::null::<sfTime>())).microseconds as *const _ as usize },
38        0usize,
39        concat!(
40            "Offset of field: ",
41            stringify!(sfTime),
42            "::",
43            stringify!(microseconds)
44        )
45    );
46}
47extern "C" {
48    pub static mut sfTime_Zero: sfTime;
49}
50extern "C" {
51    pub fn sfTime_asSeconds(time: sfTime) -> f32;
52}
53extern "C" {
54    pub fn sfTime_asMilliseconds(time: sfTime) -> sfInt32;
55}
56extern "C" {
57    pub fn sfTime_asMicroseconds(time: sfTime) -> sfInt64;
58}
59extern "C" {
60    pub fn sfSeconds(amount: f32) -> sfTime;
61}
62extern "C" {
63    pub fn sfMilliseconds(amount: sfInt32) -> sfTime;
64}
65extern "C" {
66    pub fn sfMicroseconds(amount: sfInt64) -> sfTime;
67}
68#[repr(C)]
69#[derive(Debug, Copy, Clone)]
70pub struct sfClock {
71    _unused: [u8; 0],
72}
73#[repr(C)]
74#[derive(Debug, Copy, Clone)]
75pub struct sfMutex {
76    _unused: [u8; 0],
77}
78#[repr(C)]
79#[derive(Debug, Copy, Clone)]
80pub struct sfThread {
81    _unused: [u8; 0],
82}
83extern "C" {
84    pub fn sfClock_create() -> *mut sfClock;
85}
86extern "C" {
87    pub fn sfClock_copy(clock: *const sfClock) -> *mut sfClock;
88}
89extern "C" {
90    pub fn sfClock_destroy(clock: *mut sfClock);
91}
92extern "C" {
93    pub fn sfClock_getElapsedTime(clock: *const sfClock) -> sfTime;
94}
95extern "C" {
96    pub fn sfClock_restart(clock: *mut sfClock) -> sfTime;
97}
98pub type sfInputStreamReadFunc = ::std::option::Option<
99    unsafe extern "C" fn(
100        data: *mut ::std::os::raw::c_void,
101        size: sfInt64,
102        userData: *mut ::std::os::raw::c_void,
103    ) -> sfInt64,
104>;
105pub type sfInputStreamSeekFunc = ::std::option::Option<
106    unsafe extern "C" fn(position: sfInt64, userData: *mut ::std::os::raw::c_void) -> sfInt64,
107>;
108pub type sfInputStreamTellFunc =
109    ::std::option::Option<unsafe extern "C" fn(userData: *mut ::std::os::raw::c_void) -> sfInt64>;
110pub type sfInputStreamGetSizeFunc =
111    ::std::option::Option<unsafe extern "C" fn(userData: *mut ::std::os::raw::c_void) -> sfInt64>;
112#[repr(C)]
113#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
114pub struct sfInputStream {
115    pub read: sfInputStreamReadFunc,
116    pub seek: sfInputStreamSeekFunc,
117    pub tell: sfInputStreamTellFunc,
118    pub getSize: sfInputStreamGetSizeFunc,
119    pub userData: *mut ::std::os::raw::c_void,
120}
121#[test]
122fn bindgen_test_layout_sfInputStream() {
123    assert_eq!(
124        ::std::mem::size_of::<sfInputStream>(),
125        40usize,
126        concat!("Size of: ", stringify!(sfInputStream))
127    );
128    assert_eq!(
129        ::std::mem::align_of::<sfInputStream>(),
130        8usize,
131        concat!("Alignment of ", stringify!(sfInputStream))
132    );
133    assert_eq!(
134        unsafe { &(*(::std::ptr::null::<sfInputStream>())).read as *const _ as usize },
135        0usize,
136        concat!(
137            "Offset of field: ",
138            stringify!(sfInputStream),
139            "::",
140            stringify!(read)
141        )
142    );
143    assert_eq!(
144        unsafe { &(*(::std::ptr::null::<sfInputStream>())).seek as *const _ as usize },
145        8usize,
146        concat!(
147            "Offset of field: ",
148            stringify!(sfInputStream),
149            "::",
150            stringify!(seek)
151        )
152    );
153    assert_eq!(
154        unsafe { &(*(::std::ptr::null::<sfInputStream>())).tell as *const _ as usize },
155        16usize,
156        concat!(
157            "Offset of field: ",
158            stringify!(sfInputStream),
159            "::",
160            stringify!(tell)
161        )
162    );
163    assert_eq!(
164        unsafe { &(*(::std::ptr::null::<sfInputStream>())).getSize as *const _ as usize },
165        24usize,
166        concat!(
167            "Offset of field: ",
168            stringify!(sfInputStream),
169            "::",
170            stringify!(getSize)
171        )
172    );
173    assert_eq!(
174        unsafe { &(*(::std::ptr::null::<sfInputStream>())).userData as *const _ as usize },
175        32usize,
176        concat!(
177            "Offset of field: ",
178            stringify!(sfInputStream),
179            "::",
180            stringify!(userData)
181        )
182    );
183}
184extern "C" {
185    pub fn sfMutex_create() -> *mut sfMutex;
186}
187extern "C" {
188    pub fn sfMutex_destroy(mutex: *mut sfMutex);
189}
190extern "C" {
191    pub fn sfMutex_lock(mutex: *mut sfMutex);
192}
193extern "C" {
194    pub fn sfMutex_unlock(mutex: *mut sfMutex);
195}
196extern "C" {
197    pub fn sfSleep(duration: sfTime);
198}
199extern "C" {
200    pub fn sfThread_create(
201        function: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>,
202        userData: *mut ::std::os::raw::c_void,
203    ) -> *mut sfThread;
204}
205extern "C" {
206    pub fn sfThread_destroy(thread: *mut sfThread);
207}
208extern "C" {
209    pub fn sfThread_launch(thread: *mut sfThread);
210}
211extern "C" {
212    pub fn sfThread_wait(thread: *mut sfThread);
213}
214extern "C" {
215    pub fn sfThread_terminate(thread: *mut sfThread);
216}
217#[repr(C)]
218#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
219pub struct sfVector2i {
220    pub x: ::std::os::raw::c_int,
221    pub y: ::std::os::raw::c_int,
222}
223#[test]
224fn bindgen_test_layout_sfVector2i() {
225    assert_eq!(
226        ::std::mem::size_of::<sfVector2i>(),
227        8usize,
228        concat!("Size of: ", stringify!(sfVector2i))
229    );
230    assert_eq!(
231        ::std::mem::align_of::<sfVector2i>(),
232        4usize,
233        concat!("Alignment of ", stringify!(sfVector2i))
234    );
235    assert_eq!(
236        unsafe { &(*(::std::ptr::null::<sfVector2i>())).x as *const _ as usize },
237        0usize,
238        concat!(
239            "Offset of field: ",
240            stringify!(sfVector2i),
241            "::",
242            stringify!(x)
243        )
244    );
245    assert_eq!(
246        unsafe { &(*(::std::ptr::null::<sfVector2i>())).y as *const _ as usize },
247        4usize,
248        concat!(
249            "Offset of field: ",
250            stringify!(sfVector2i),
251            "::",
252            stringify!(y)
253        )
254    );
255}
256#[repr(C)]
257#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
258pub struct sfVector2u {
259    pub x: ::std::os::raw::c_uint,
260    pub y: ::std::os::raw::c_uint,
261}
262#[test]
263fn bindgen_test_layout_sfVector2u() {
264    assert_eq!(
265        ::std::mem::size_of::<sfVector2u>(),
266        8usize,
267        concat!("Size of: ", stringify!(sfVector2u))
268    );
269    assert_eq!(
270        ::std::mem::align_of::<sfVector2u>(),
271        4usize,
272        concat!("Alignment of ", stringify!(sfVector2u))
273    );
274    assert_eq!(
275        unsafe { &(*(::std::ptr::null::<sfVector2u>())).x as *const _ as usize },
276        0usize,
277        concat!(
278            "Offset of field: ",
279            stringify!(sfVector2u),
280            "::",
281            stringify!(x)
282        )
283    );
284    assert_eq!(
285        unsafe { &(*(::std::ptr::null::<sfVector2u>())).y as *const _ as usize },
286        4usize,
287        concat!(
288            "Offset of field: ",
289            stringify!(sfVector2u),
290            "::",
291            stringify!(y)
292        )
293    );
294}
295#[repr(C)]
296#[derive(Debug, Copy, Clone, PartialOrd, PartialEq)]
297pub struct sfVector2f {
298    pub x: f32,
299    pub y: f32,
300}
301#[test]
302fn bindgen_test_layout_sfVector2f() {
303    assert_eq!(
304        ::std::mem::size_of::<sfVector2f>(),
305        8usize,
306        concat!("Size of: ", stringify!(sfVector2f))
307    );
308    assert_eq!(
309        ::std::mem::align_of::<sfVector2f>(),
310        4usize,
311        concat!("Alignment of ", stringify!(sfVector2f))
312    );
313    assert_eq!(
314        unsafe { &(*(::std::ptr::null::<sfVector2f>())).x as *const _ as usize },
315        0usize,
316        concat!(
317            "Offset of field: ",
318            stringify!(sfVector2f),
319            "::",
320            stringify!(x)
321        )
322    );
323    assert_eq!(
324        unsafe { &(*(::std::ptr::null::<sfVector2f>())).y as *const _ as usize },
325        4usize,
326        concat!(
327            "Offset of field: ",
328            stringify!(sfVector2f),
329            "::",
330            stringify!(y)
331        )
332    );
333}
334#[repr(C)]
335#[derive(Debug, Copy, Clone, PartialOrd, PartialEq)]
336pub struct sfVector3f {
337    pub x: f32,
338    pub y: f32,
339    pub z: f32,
340}
341#[test]
342fn bindgen_test_layout_sfVector3f() {
343    assert_eq!(
344        ::std::mem::size_of::<sfVector3f>(),
345        12usize,
346        concat!("Size of: ", stringify!(sfVector3f))
347    );
348    assert_eq!(
349        ::std::mem::align_of::<sfVector3f>(),
350        4usize,
351        concat!("Alignment of ", stringify!(sfVector3f))
352    );
353    assert_eq!(
354        unsafe { &(*(::std::ptr::null::<sfVector3f>())).x as *const _ as usize },
355        0usize,
356        concat!(
357            "Offset of field: ",
358            stringify!(sfVector3f),
359            "::",
360            stringify!(x)
361        )
362    );
363    assert_eq!(
364        unsafe { &(*(::std::ptr::null::<sfVector3f>())).y as *const _ as usize },
365        4usize,
366        concat!(
367            "Offset of field: ",
368            stringify!(sfVector3f),
369            "::",
370            stringify!(y)
371        )
372    );
373    assert_eq!(
374        unsafe { &(*(::std::ptr::null::<sfVector3f>())).z as *const _ as usize },
375        8usize,
376        concat!(
377            "Offset of field: ",
378            stringify!(sfVector3f),
379            "::",
380            stringify!(z)
381        )
382    );
383}