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

pub const _SAL_VERSION: u32 = 20;
pub const __SAL_H_VERSION: u32 = 180000000;
pub const _USE_DECLSPECS_FOR_SAL: u32 = 0;
pub const _USE_ATTRIBUTES_FOR_SAL: u32 = 0;
pub const _CRT_PACKING: u32 = 8;
pub const _HAS_EXCEPTIONS: u32 = 1;
pub const WCHAR_MIN: u32 = 0;
pub const WCHAR_MAX: u32 = 65535;
pub const WINT_MIN: u32 = 0;
pub const WINT_MAX: u32 = 65535;
pub const EPOLLIN: u32 = 1;
pub const EPOLLPRI: u32 = 2;
pub const EPOLLOUT: u32 = 4;
pub const EPOLLERR: u32 = 8;
pub const EPOLLHUP: u32 = 16;
pub const EPOLLRDNORM: u32 = 64;
pub const EPOLLRDBAND: u32 = 128;
pub const EPOLLWRNORM: u32 = 256;
pub const EPOLLWRBAND: u32 = 512;
pub const EPOLLMSG: u32 = 1024;
pub const EPOLLRDHUP: u32 = 8192;
pub const EPOLLONESHOT: u32 = 2147483648;
pub const EPOLL_CTL_ADD: u32 = 1;
pub const EPOLL_CTL_MOD: u32 = 2;
pub const EPOLL_CTL_DEL: u32 = 3;
pub type va_list = *mut ::std::os::raw::c_char;
extern "C" {
    pub fn __va_start(arg1: *mut *mut ::std::os::raw::c_char, ...);
}
pub type size_t = ::std::os::raw::c_ulonglong;
pub type __vcrt_bool = bool;
pub type wchar_t = ::std::os::raw::c_ushort;
extern "C" {
    pub fn __security_init_cookie();
}
extern "C" {
    pub fn __security_check_cookie(_StackCookie: usize);
}
extern "C" {
    pub fn __report_gsfailure(_StackCookie: usize);
}
extern "C" {
    pub static mut __security_cookie: usize;
}
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_longlong;
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_ulonglong;
pub type int_fast8_t = ::std::os::raw::c_schar;
pub type int_fast16_t = ::std::os::raw::c_int;
pub type int_fast32_t = ::std::os::raw::c_int;
pub type int_fast64_t = ::std::os::raw::c_longlong;
pub type uint_fast8_t = ::std::os::raw::c_uchar;
pub type uint_fast16_t = ::std::os::raw::c_uint;
pub type uint_fast32_t = ::std::os::raw::c_uint;
pub type uint_fast64_t = ::std::os::raw::c_ulonglong;
pub type intmax_t = ::std::os::raw::c_longlong;
pub type uintmax_t = ::std::os::raw::c_ulonglong;
pub const EPOLL_EVENTS_EPOLLIN: EPOLL_EVENTS = 1;
pub const EPOLL_EVENTS_EPOLLPRI: EPOLL_EVENTS = 2;
pub const EPOLL_EVENTS_EPOLLOUT: EPOLL_EVENTS = 4;
pub const EPOLL_EVENTS_EPOLLERR: EPOLL_EVENTS = 8;
pub const EPOLL_EVENTS_EPOLLHUP: EPOLL_EVENTS = 16;
pub const EPOLL_EVENTS_EPOLLRDNORM: EPOLL_EVENTS = 64;
pub const EPOLL_EVENTS_EPOLLRDBAND: EPOLL_EVENTS = 128;
pub const EPOLL_EVENTS_EPOLLWRNORM: EPOLL_EVENTS = 256;
pub const EPOLL_EVENTS_EPOLLWRBAND: EPOLL_EVENTS = 512;
pub const EPOLL_EVENTS_EPOLLMSG: EPOLL_EVENTS = 1024;
pub const EPOLL_EVENTS_EPOLLRDHUP: EPOLL_EVENTS = 8192;
pub const EPOLL_EVENTS_EPOLLONESHOT: EPOLL_EVENTS = -2147483648;
pub type EPOLL_EVENTS = i32;
pub type HANDLE = *mut ::std::os::raw::c_void;
pub type SOCKET = usize;
#[repr(C)]
#[derive(Copy, Clone)]
pub union epoll_data {
    pub ptr: *mut ::std::os::raw::c_void,
    pub fd: ::std::os::raw::c_int,
    pub u32: u32,
    pub u64: u64,
    pub sock: SOCKET,
    pub hnd: HANDLE,
    _bindgen_union_align: u64,
}
#[test]
fn bindgen_test_layout_epoll_data() {
    assert_eq!(
        ::std::mem::size_of::<epoll_data>(),
        8usize,
        concat!("Size of: ", stringify!(epoll_data))
    );
    assert_eq!(
        ::std::mem::align_of::<epoll_data>(),
        8usize,
        concat!("Alignment of ", stringify!(epoll_data))
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<epoll_data>())).ptr as *const _ as usize
        },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(epoll_data),
            "::",
            stringify!(ptr)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<epoll_data>())).fd as *const _ as usize
        },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(epoll_data),
            "::",
            stringify!(fd)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<epoll_data>())).u32 as *const _ as usize
        },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(epoll_data),
            "::",
            stringify!(u32)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<epoll_data>())).u64 as *const _ as usize
        },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(epoll_data),
            "::",
            stringify!(u64)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<epoll_data>())).sock as *const _ as usize
        },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(epoll_data),
            "::",
            stringify!(sock)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<epoll_data>())).hnd as *const _ as usize
        },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(epoll_data),
            "::",
            stringify!(hnd)
        )
    );
}
pub type epoll_data_t = epoll_data;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct epoll_event {
    pub events: u32,
    pub data: epoll_data_t,
}
#[test]
fn bindgen_test_layout_epoll_event() {
    assert_eq!(
        ::std::mem::size_of::<epoll_event>(),
        16usize,
        concat!("Size of: ", stringify!(epoll_event))
    );
    assert_eq!(
        ::std::mem::align_of::<epoll_event>(),
        8usize,
        concat!("Alignment of ", stringify!(epoll_event))
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<epoll_event>())).events as *const _ as usize
        },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(epoll_event),
            "::",
            stringify!(events)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<epoll_event>())).data as *const _ as usize
        },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(epoll_event),
            "::",
            stringify!(data)
        )
    );
}
extern "C" {
    pub fn epoll_create(size: ::std::os::raw::c_int) -> HANDLE;
}
extern "C" {
    pub fn epoll_create1(flags: ::std::os::raw::c_int) -> HANDLE;
}
extern "C" {
    pub fn epoll_close(ephnd: HANDLE) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn epoll_ctl(
        ephnd: HANDLE,
        op: ::std::os::raw::c_int,
        sock: SOCKET,
        event: *mut epoll_event,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn epoll_wait(
        ephnd: HANDLE,
        events: *mut epoll_event,
        maxevents: ::std::os::raw::c_int,
        timeout: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}