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
/* automatically generated by rust-bindgen */

pub const _STDINT_H: ::std::os::raw::c_uint = 1;
pub const _FEATURES_H: ::std::os::raw::c_uint = 1;
pub const _DEFAULT_SOURCE: ::std::os::raw::c_uint = 1;
pub const __USE_ISOC11: ::std::os::raw::c_uint = 1;
pub const __USE_ISOC99: ::std::os::raw::c_uint = 1;
pub const __USE_ISOC95: ::std::os::raw::c_uint = 1;
pub const __USE_POSIX_IMPLICITLY: ::std::os::raw::c_uint = 1;
pub const _POSIX_SOURCE: ::std::os::raw::c_uint = 1;
pub const _POSIX_C_SOURCE: ::std::os::raw::c_uint = 200809;
pub const __USE_POSIX: ::std::os::raw::c_uint = 1;
pub const __USE_POSIX2: ::std::os::raw::c_uint = 1;
pub const __USE_POSIX199309: ::std::os::raw::c_uint = 1;
pub const __USE_POSIX199506: ::std::os::raw::c_uint = 1;
pub const __USE_XOPEN2K: ::std::os::raw::c_uint = 1;
pub const __USE_XOPEN2K8: ::std::os::raw::c_uint = 1;
pub const _ATFILE_SOURCE: ::std::os::raw::c_uint = 1;
pub const __USE_MISC: ::std::os::raw::c_uint = 1;
pub const __USE_ATFILE: ::std::os::raw::c_uint = 1;
pub const __USE_FORTIFY_LEVEL: ::std::os::raw::c_uint = 0;
pub const _STDC_PREDEF_H: ::std::os::raw::c_uint = 1;
pub const __STDC_IEC_559__: ::std::os::raw::c_uint = 1;
pub const __STDC_IEC_559_COMPLEX__: ::std::os::raw::c_uint = 1;
pub const __STDC_ISO_10646__: ::std::os::raw::c_uint = 201605;
pub const __STDC_NO_THREADS__: ::std::os::raw::c_uint = 1;
pub const __GNU_LIBRARY__: ::std::os::raw::c_uint = 6;
pub const __GLIBC__: ::std::os::raw::c_uint = 2;
pub const __GLIBC_MINOR__: ::std::os::raw::c_uint = 24;
pub const _SYS_CDEFS_H: ::std::os::raw::c_uint = 1;
pub const __WORDSIZE: ::std::os::raw::c_uint = 64;
pub const __WORDSIZE_TIME64_COMPAT32: ::std::os::raw::c_uint = 1;
pub const __SYSCALL_WORDSIZE: ::std::os::raw::c_uint = 64;
pub const _BITS_WCHAR_H: ::std::os::raw::c_uint = 1;
pub const INT8_MIN: ::std::os::raw::c_int = -128;
pub const INT16_MIN: ::std::os::raw::c_int = -32768;
pub const INT32_MIN: ::std::os::raw::c_int = -2147483648;
pub const INT8_MAX: ::std::os::raw::c_uint = 127;
pub const INT16_MAX: ::std::os::raw::c_uint = 32767;
pub const INT32_MAX: ::std::os::raw::c_uint = 2147483647;
pub const UINT8_MAX: ::std::os::raw::c_uint = 255;
pub const UINT16_MAX: ::std::os::raw::c_uint = 65535;
pub const UINT32_MAX: ::std::os::raw::c_uint = 4294967295;
pub const INT_LEAST8_MIN: ::std::os::raw::c_int = -128;
pub const INT_LEAST16_MIN: ::std::os::raw::c_int = -32768;
pub const INT_LEAST32_MIN: ::std::os::raw::c_int = -2147483648;
pub const INT_LEAST8_MAX: ::std::os::raw::c_uint = 127;
pub const INT_LEAST16_MAX: ::std::os::raw::c_uint = 32767;
pub const INT_LEAST32_MAX: ::std::os::raw::c_uint = 2147483647;
pub const UINT_LEAST8_MAX: ::std::os::raw::c_uint = 255;
pub const UINT_LEAST16_MAX: ::std::os::raw::c_uint = 65535;
pub const UINT_LEAST32_MAX: ::std::os::raw::c_uint = 4294967295;
pub const INT_FAST8_MIN: ::std::os::raw::c_int = -128;
pub const INT_FAST16_MIN: ::std::os::raw::c_longlong = -9223372036854775808;
pub const INT_FAST32_MIN: ::std::os::raw::c_longlong = -9223372036854775808;
pub const INT_FAST8_MAX: ::std::os::raw::c_uint = 127;
pub const INT_FAST16_MAX: ::std::os::raw::c_ulonglong = 9223372036854775807;
pub const INT_FAST32_MAX: ::std::os::raw::c_ulonglong = 9223372036854775807;
pub const UINT_FAST8_MAX: ::std::os::raw::c_uint = 255;
pub const UINT_FAST16_MAX: ::std::os::raw::c_int = -1;
pub const UINT_FAST32_MAX: ::std::os::raw::c_int = -1;
pub const INTPTR_MIN: ::std::os::raw::c_longlong = -9223372036854775808;
pub const INTPTR_MAX: ::std::os::raw::c_ulonglong = 9223372036854775807;
pub const UINTPTR_MAX: ::std::os::raw::c_int = -1;
pub const PTRDIFF_MIN: ::std::os::raw::c_longlong = -9223372036854775808;
pub const PTRDIFF_MAX: ::std::os::raw::c_ulonglong = 9223372036854775807;
pub const SIG_ATOMIC_MIN: ::std::os::raw::c_int = -2147483648;
pub const SIG_ATOMIC_MAX: ::std::os::raw::c_uint = 2147483647;
pub const SIZE_MAX: ::std::os::raw::c_int = -1;
pub const WINT_MIN: ::std::os::raw::c_uint = 0;
pub const WINT_MAX: ::std::os::raw::c_uint = 4294967295;
pub const DISCORD_REPLY_NO: ::std::os::raw::c_uint = 0;
pub const DISCORD_REPLY_YES: ::std::os::raw::c_uint = 1;
pub const DISCORD_REPLY_IGNORE: ::std::os::raw::c_uint = 2;
pub type int_least8_t = ::std::os::raw::c_schar;
pub type int_least16_t = ::std::os::raw::c_short;
pub type int_least32_t = ::std::os::raw::c_int;
pub type int_least64_t = ::std::os::raw::c_long;
pub type uint_least8_t = ::std::os::raw::c_uchar;
pub type uint_least16_t = ::std::os::raw::c_ushort;
pub type uint_least32_t = ::std::os::raw::c_uint;
pub type uint_least64_t = ::std::os::raw::c_ulong;
pub type int_fast8_t = ::std::os::raw::c_schar;
pub type int_fast16_t = ::std::os::raw::c_long;
pub type int_fast32_t = ::std::os::raw::c_long;
pub type int_fast64_t = ::std::os::raw::c_long;
pub type uint_fast8_t = ::std::os::raw::c_uchar;
pub type uint_fast16_t = ::std::os::raw::c_ulong;
pub type uint_fast32_t = ::std::os::raw::c_ulong;
pub type uint_fast64_t = ::std::os::raw::c_ulong;
pub type intmax_t = ::std::os::raw::c_long;
pub type uintmax_t = ::std::os::raw::c_ulong;
#[repr(C)]
#[derive(Debug, Copy)]
pub struct DiscordRichPresence {
    pub state: *const ::std::os::raw::c_char,
    pub details: *const ::std::os::raw::c_char,
    pub startTimestamp: i64,
    pub endTimestamp: i64,
    pub largeImageKey: *const ::std::os::raw::c_char,
    pub largeImageText: *const ::std::os::raw::c_char,
    pub smallImageKey: *const ::std::os::raw::c_char,
    pub smallImageText: *const ::std::os::raw::c_char,
    pub partyId: *const ::std::os::raw::c_char,
    pub partySize: ::std::os::raw::c_int,
    pub partyMax: ::std::os::raw::c_int,
    pub matchSecret: *const ::std::os::raw::c_char,
    pub joinSecret: *const ::std::os::raw::c_char,
    pub spectateSecret: *const ::std::os::raw::c_char,
    pub instance: i8,
}
#[test]
fn bindgen_test_layout_DiscordRichPresence() {
    assert_eq!(::std::mem::size_of::<DiscordRichPresence>() , 112usize ,
               concat ! ( "Size of: " , stringify ! ( DiscordRichPresence )
               ));
    assert_eq! (::std::mem::align_of::<DiscordRichPresence>() , 8usize ,
                concat ! (
                "Alignment of " , stringify ! ( DiscordRichPresence ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const DiscordRichPresence ) ) . state as *
                const _ as usize } , 0usize , concat ! (
                "Alignment of field: " , stringify ! ( DiscordRichPresence ) ,
                "::" , stringify ! ( state ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const DiscordRichPresence ) ) . details as *
                const _ as usize } , 8usize , concat ! (
                "Alignment of field: " , stringify ! ( DiscordRichPresence ) ,
                "::" , stringify ! ( details ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const DiscordRichPresence ) ) . startTimestamp
                as * const _ as usize } , 16usize , concat ! (
                "Alignment of field: " , stringify ! ( DiscordRichPresence ) ,
                "::" , stringify ! ( startTimestamp ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const DiscordRichPresence ) ) . endTimestamp as
                * const _ as usize } , 24usize , concat ! (
                "Alignment of field: " , stringify ! ( DiscordRichPresence ) ,
                "::" , stringify ! ( endTimestamp ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const DiscordRichPresence ) ) . largeImageKey
                as * const _ as usize } , 32usize , concat ! (
                "Alignment of field: " , stringify ! ( DiscordRichPresence ) ,
                "::" , stringify ! ( largeImageKey ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const DiscordRichPresence ) ) . largeImageText
                as * const _ as usize } , 40usize , concat ! (
                "Alignment of field: " , stringify ! ( DiscordRichPresence ) ,
                "::" , stringify ! ( largeImageText ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const DiscordRichPresence ) ) . smallImageKey
                as * const _ as usize } , 48usize , concat ! (
                "Alignment of field: " , stringify ! ( DiscordRichPresence ) ,
                "::" , stringify ! ( smallImageKey ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const DiscordRichPresence ) ) . smallImageText
                as * const _ as usize } , 56usize , concat ! (
                "Alignment of field: " , stringify ! ( DiscordRichPresence ) ,
                "::" , stringify ! ( smallImageText ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const DiscordRichPresence ) ) . partyId as *
                const _ as usize } , 64usize , concat ! (
                "Alignment of field: " , stringify ! ( DiscordRichPresence ) ,
                "::" , stringify ! ( partyId ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const DiscordRichPresence ) ) . partySize as *
                const _ as usize } , 72usize , concat ! (
                "Alignment of field: " , stringify ! ( DiscordRichPresence ) ,
                "::" , stringify ! ( partySize ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const DiscordRichPresence ) ) . partyMax as *
                const _ as usize } , 76usize , concat ! (
                "Alignment of field: " , stringify ! ( DiscordRichPresence ) ,
                "::" , stringify ! ( partyMax ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const DiscordRichPresence ) ) . matchSecret as
                * const _ as usize } , 80usize , concat ! (
                "Alignment of field: " , stringify ! ( DiscordRichPresence ) ,
                "::" , stringify ! ( matchSecret ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const DiscordRichPresence ) ) . joinSecret as *
                const _ as usize } , 88usize , concat ! (
                "Alignment of field: " , stringify ! ( DiscordRichPresence ) ,
                "::" , stringify ! ( joinSecret ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const DiscordRichPresence ) ) . spectateSecret
                as * const _ as usize } , 96usize , concat ! (
                "Alignment of field: " , stringify ! ( DiscordRichPresence ) ,
                "::" , stringify ! ( spectateSecret ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const DiscordRichPresence ) ) . instance as *
                const _ as usize } , 104usize , concat ! (
                "Alignment of field: " , stringify ! ( DiscordRichPresence ) ,
                "::" , stringify ! ( instance ) ));
}
impl Clone for DiscordRichPresence {
    fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct DiscordJoinRequest {
    pub userId: *const ::std::os::raw::c_char,
    pub username: *const ::std::os::raw::c_char,
    pub discriminator: *const ::std::os::raw::c_char,
    pub avatar: *const ::std::os::raw::c_char,
}
#[test]
fn bindgen_test_layout_DiscordJoinRequest() {
    assert_eq!(::std::mem::size_of::<DiscordJoinRequest>() , 32usize , concat
               ! ( "Size of: " , stringify ! ( DiscordJoinRequest ) ));
    assert_eq! (::std::mem::align_of::<DiscordJoinRequest>() , 8usize , concat
                ! ( "Alignment of " , stringify ! ( DiscordJoinRequest ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const DiscordJoinRequest ) ) . userId as *
                const _ as usize } , 0usize , concat ! (
                "Alignment of field: " , stringify ! ( DiscordJoinRequest ) ,
                "::" , stringify ! ( userId ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const DiscordJoinRequest ) ) . username as *
                const _ as usize } , 8usize , concat ! (
                "Alignment of field: " , stringify ! ( DiscordJoinRequest ) ,
                "::" , stringify ! ( username ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const DiscordJoinRequest ) ) . discriminator as
                * const _ as usize } , 16usize , concat ! (
                "Alignment of field: " , stringify ! ( DiscordJoinRequest ) ,
                "::" , stringify ! ( discriminator ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const DiscordJoinRequest ) ) . avatar as *
                const _ as usize } , 24usize , concat ! (
                "Alignment of field: " , stringify ! ( DiscordJoinRequest ) ,
                "::" , stringify ! ( avatar ) ));
}
impl Clone for DiscordJoinRequest {
    fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct DiscordEventHandlers {
    pub ready: ::std::option::Option<unsafe extern "C" fn()>,
    pub disconnected: ::std::option::Option<unsafe extern "C" fn(errorCode:
                                                                     ::std::os::raw::c_int,
                                                                 message:
                                                                     *const ::std::os::raw::c_char)>,
    pub errored: ::std::option::Option<unsafe extern "C" fn(errorCode:
                                                                ::std::os::raw::c_int,
                                                            message:
                                                                *const ::std::os::raw::c_char)>,
    pub joinGame: ::std::option::Option<unsafe extern "C" fn(joinSecret:
                                                                 *const ::std::os::raw::c_char)>,
    pub spectateGame: ::std::option::Option<unsafe extern "C" fn(spectateSecret:
                                                                     *const ::std::os::raw::c_char)>,
    pub joinRequest: ::std::option::Option<unsafe extern "C" fn(request:
                                                                    *const DiscordJoinRequest)>,
}
#[test]
fn bindgen_test_layout_DiscordEventHandlers() {
    assert_eq!(::std::mem::size_of::<DiscordEventHandlers>() , 48usize ,
               concat ! ( "Size of: " , stringify ! ( DiscordEventHandlers )
               ));
    assert_eq! (::std::mem::align_of::<DiscordEventHandlers>() , 8usize ,
                concat ! (
                "Alignment of " , stringify ! ( DiscordEventHandlers ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const DiscordEventHandlers ) ) . ready as *
                const _ as usize } , 0usize , concat ! (
                "Alignment of field: " , stringify ! ( DiscordEventHandlers )
                , "::" , stringify ! ( ready ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const DiscordEventHandlers ) ) . disconnected
                as * const _ as usize } , 8usize , concat ! (
                "Alignment of field: " , stringify ! ( DiscordEventHandlers )
                , "::" , stringify ! ( disconnected ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const DiscordEventHandlers ) ) . errored as *
                const _ as usize } , 16usize , concat ! (
                "Alignment of field: " , stringify ! ( DiscordEventHandlers )
                , "::" , stringify ! ( errored ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const DiscordEventHandlers ) ) . joinGame as *
                const _ as usize } , 24usize , concat ! (
                "Alignment of field: " , stringify ! ( DiscordEventHandlers )
                , "::" , stringify ! ( joinGame ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const DiscordEventHandlers ) ) . spectateGame
                as * const _ as usize } , 32usize , concat ! (
                "Alignment of field: " , stringify ! ( DiscordEventHandlers )
                , "::" , stringify ! ( spectateGame ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const DiscordEventHandlers ) ) . joinRequest as
                * const _ as usize } , 40usize , concat ! (
                "Alignment of field: " , stringify ! ( DiscordEventHandlers )
                , "::" , stringify ! ( joinRequest ) ));
}
impl Clone for DiscordEventHandlers {
    fn clone(&self) -> Self { *self }
}
extern "C" {
    pub fn Discord_Initialize(applicationId: *const ::std::os::raw::c_char,
                              handlers: *mut DiscordEventHandlers,
                              autoRegister: ::std::os::raw::c_int,
                              optionalSteamId: *const ::std::os::raw::c_char);
}
extern "C" {
    pub fn Discord_Shutdown();
}
extern "C" {
    pub fn Discord_RunCallbacks();
}
extern "C" {
    pub fn Discord_UpdatePresence(presence: *const DiscordRichPresence);
}
extern "C" {
    pub fn Discord_ClearPresence();
}
extern "C" {
    pub fn Discord_Respond(userid: *const ::std::os::raw::c_char,
                           reply: ::std::os::raw::c_int);
}
extern "C" {
    pub fn Discord_UpdateHandlers(handlers: *mut DiscordEventHandlers);
}