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
// This file was generated by gir (https://github.com/gtk-rs/gir @ 2723216)
// from gir-files (https://github.com/gtk-rs/gir-files @ 25c8aaf)
// DO NOT EDIT

#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
#![allow(clippy::approx_constant, clippy::type_complexity, clippy::unreadable_literal)]

extern crate libc;
extern crate glib_sys as glib;
extern crate gobject_sys as gobject;

#[allow(unused_imports)]
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double,
    c_short, c_ushort, c_long, c_ulong,
    c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE};

#[allow(unused_imports)]
use glib::{gboolean, gconstpointer, gpointer, GType};

// Aliases
pub type GUdevDeviceNumber = u64;

// Enums
pub type GUdevDeviceType = c_int;
pub const G_UDEV_DEVICE_TYPE_NONE: GUdevDeviceType = 0;
pub const G_UDEV_DEVICE_TYPE_BLOCK: GUdevDeviceType = 98;
pub const G_UDEV_DEVICE_TYPE_CHAR: GUdevDeviceType = 99;

// Records
#[repr(C)]
#[derive(Copy, Clone)]
pub struct GUdevClientClass {
    pub parent_class: gobject::GObjectClass,
    pub uevent: Option<unsafe extern "C" fn(*mut GUdevClient, *const c_char, *mut GUdevDevice)>,
    pub reserved1: Option<unsafe extern "C" fn()>,
    pub reserved2: Option<unsafe extern "C" fn()>,
    pub reserved3: Option<unsafe extern "C" fn()>,
    pub reserved4: Option<unsafe extern "C" fn()>,
    pub reserved5: Option<unsafe extern "C" fn()>,
    pub reserved6: Option<unsafe extern "C" fn()>,
    pub reserved7: Option<unsafe extern "C" fn()>,
    pub reserved8: Option<unsafe extern "C" fn()>,
}

impl ::std::fmt::Debug for GUdevClientClass {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        f.debug_struct(&format!("GUdevClientClass @ {:?}", self as *const _))
         .field("parent_class", &self.parent_class)
         .field("uevent", &self.uevent)
         .field("reserved1", &self.reserved1)
         .field("reserved2", &self.reserved2)
         .field("reserved3", &self.reserved3)
         .field("reserved4", &self.reserved4)
         .field("reserved5", &self.reserved5)
         .field("reserved6", &self.reserved6)
         .field("reserved7", &self.reserved7)
         .field("reserved8", &self.reserved8)
         .finish()
    }
}

#[repr(C)]
pub struct GUdevClientPrivate(c_void);

impl ::std::fmt::Debug for GUdevClientPrivate {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        f.debug_struct(&format!("GUdevClientPrivate @ {:?}", self as *const _))
         .finish()
    }
}

#[repr(C)]
#[derive(Copy, Clone)]
pub struct GUdevDeviceClass {
    pub parent_class: gobject::GObjectClass,
    pub reserved1: Option<unsafe extern "C" fn()>,
    pub reserved2: Option<unsafe extern "C" fn()>,
    pub reserved3: Option<unsafe extern "C" fn()>,
    pub reserved4: Option<unsafe extern "C" fn()>,
    pub reserved5: Option<unsafe extern "C" fn()>,
    pub reserved6: Option<unsafe extern "C" fn()>,
    pub reserved7: Option<unsafe extern "C" fn()>,
    pub reserved8: Option<unsafe extern "C" fn()>,
}

impl ::std::fmt::Debug for GUdevDeviceClass {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        f.debug_struct(&format!("GUdevDeviceClass @ {:?}", self as *const _))
         .field("parent_class", &self.parent_class)
         .field("reserved1", &self.reserved1)
         .field("reserved2", &self.reserved2)
         .field("reserved3", &self.reserved3)
         .field("reserved4", &self.reserved4)
         .field("reserved5", &self.reserved5)
         .field("reserved6", &self.reserved6)
         .field("reserved7", &self.reserved7)
         .field("reserved8", &self.reserved8)
         .finish()
    }
}

#[repr(C)]
pub struct GUdevDevicePrivate(c_void);

impl ::std::fmt::Debug for GUdevDevicePrivate {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        f.debug_struct(&format!("GUdevDevicePrivate @ {:?}", self as *const _))
         .finish()
    }
}

#[repr(C)]
#[derive(Copy, Clone)]
pub struct GUdevEnumeratorClass {
    pub parent_class: gobject::GObjectClass,
    pub reserved1: Option<unsafe extern "C" fn()>,
    pub reserved2: Option<unsafe extern "C" fn()>,
    pub reserved3: Option<unsafe extern "C" fn()>,
    pub reserved4: Option<unsafe extern "C" fn()>,
    pub reserved5: Option<unsafe extern "C" fn()>,
    pub reserved6: Option<unsafe extern "C" fn()>,
    pub reserved7: Option<unsafe extern "C" fn()>,
    pub reserved8: Option<unsafe extern "C" fn()>,
}

impl ::std::fmt::Debug for GUdevEnumeratorClass {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        f.debug_struct(&format!("GUdevEnumeratorClass @ {:?}", self as *const _))
         .field("parent_class", &self.parent_class)
         .field("reserved1", &self.reserved1)
         .field("reserved2", &self.reserved2)
         .field("reserved3", &self.reserved3)
         .field("reserved4", &self.reserved4)
         .field("reserved5", &self.reserved5)
         .field("reserved6", &self.reserved6)
         .field("reserved7", &self.reserved7)
         .field("reserved8", &self.reserved8)
         .finish()
    }
}

#[repr(C)]
pub struct GUdevEnumeratorPrivate(c_void);

impl ::std::fmt::Debug for GUdevEnumeratorPrivate {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        f.debug_struct(&format!("GUdevEnumeratorPrivate @ {:?}", self as *const _))
         .finish()
    }
}

// Classes
#[repr(C)]
#[derive(Copy, Clone)]
pub struct GUdevClient {
    pub parent: gobject::GObject,
    pub priv_: *mut GUdevClientPrivate,
}

impl ::std::fmt::Debug for GUdevClient {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        f.debug_struct(&format!("GUdevClient @ {:?}", self as *const _))
         .field("parent", &self.parent)
         .finish()
    }
}

#[repr(C)]
#[derive(Copy, Clone)]
pub struct GUdevDevice {
    pub parent: gobject::GObject,
    pub priv_: *mut GUdevDevicePrivate,
}

impl ::std::fmt::Debug for GUdevDevice {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        f.debug_struct(&format!("GUdevDevice @ {:?}", self as *const _))
         .field("parent", &self.parent)
         .finish()
    }
}

#[repr(C)]
#[derive(Copy, Clone)]
pub struct GUdevEnumerator {
    pub parent: gobject::GObject,
    pub priv_: *mut GUdevEnumeratorPrivate,
}

impl ::std::fmt::Debug for GUdevEnumerator {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        f.debug_struct(&format!("GUdevEnumerator @ {:?}", self as *const _))
         .field("parent", &self.parent)
         .finish()
    }
}

extern "C" {

    //=========================================================================
    // GUdevDeviceType
    //=========================================================================
    pub fn g_udev_device_type_get_type() -> GType;

    //=========================================================================
    // GUdevClient
    //=========================================================================
    pub fn g_udev_client_get_type() -> GType;
    pub fn g_udev_client_new(subsystems: *mut *mut c_char) -> *mut GUdevClient;
    pub fn g_udev_client_query_by_device_file(client: *mut GUdevClient, device_file: *const c_char) -> *mut GUdevDevice;
    pub fn g_udev_client_query_by_device_number(client: *mut GUdevClient, type_: GUdevDeviceType, number: GUdevDeviceNumber) -> *mut GUdevDevice;
    pub fn g_udev_client_query_by_subsystem(client: *mut GUdevClient, subsystem: *const c_char) -> *mut glib::GList;
    pub fn g_udev_client_query_by_subsystem_and_name(client: *mut GUdevClient, subsystem: *const c_char, name: *const c_char) -> *mut GUdevDevice;
    pub fn g_udev_client_query_by_sysfs_path(client: *mut GUdevClient, sysfs_path: *const c_char) -> *mut GUdevDevice;

    //=========================================================================
    // GUdevDevice
    //=========================================================================
    pub fn g_udev_device_get_type() -> GType;
    pub fn g_udev_device_get_action(device: *mut GUdevDevice) -> *const c_char;
    pub fn g_udev_device_get_device_file(device: *mut GUdevDevice) -> *const c_char;
    pub fn g_udev_device_get_device_file_symlinks(device: *mut GUdevDevice) -> *mut *mut c_char;
    pub fn g_udev_device_get_device_number(device: *mut GUdevDevice) -> GUdevDeviceNumber;
    pub fn g_udev_device_get_device_type(device: *mut GUdevDevice) -> GUdevDeviceType;
    pub fn g_udev_device_get_devtype(device: *mut GUdevDevice) -> *const c_char;
    pub fn g_udev_device_get_driver(device: *mut GUdevDevice) -> *const c_char;
    pub fn g_udev_device_get_is_initialized(device: *mut GUdevDevice) -> gboolean;
    pub fn g_udev_device_get_name(device: *mut GUdevDevice) -> *const c_char;
    pub fn g_udev_device_get_number(device: *mut GUdevDevice) -> *const c_char;
    pub fn g_udev_device_get_parent(device: *mut GUdevDevice) -> *mut GUdevDevice;
    pub fn g_udev_device_get_parent_with_subsystem(device: *mut GUdevDevice, subsystem: *const c_char, devtype: *const c_char) -> *mut GUdevDevice;
    pub fn g_udev_device_get_property(device: *mut GUdevDevice, key: *const c_char) -> *const c_char;
    pub fn g_udev_device_get_property_as_boolean(device: *mut GUdevDevice, key: *const c_char) -> gboolean;
    pub fn g_udev_device_get_property_as_double(device: *mut GUdevDevice, key: *const c_char) -> c_double;
    pub fn g_udev_device_get_property_as_int(device: *mut GUdevDevice, key: *const c_char) -> c_int;
    pub fn g_udev_device_get_property_as_strv(device: *mut GUdevDevice, key: *const c_char) -> *mut *mut c_char;
    pub fn g_udev_device_get_property_as_uint64(device: *mut GUdevDevice, key: *const c_char) -> u64;
    pub fn g_udev_device_get_property_keys(device: *mut GUdevDevice) -> *mut *mut c_char;
    pub fn g_udev_device_get_seqnum(device: *mut GUdevDevice) -> u64;
    pub fn g_udev_device_get_subsystem(device: *mut GUdevDevice) -> *const c_char;
    pub fn g_udev_device_get_sysfs_attr(device: *mut GUdevDevice, name: *const c_char) -> *const c_char;
    pub fn g_udev_device_get_sysfs_attr_as_boolean(device: *mut GUdevDevice, name: *const c_char) -> gboolean;
    pub fn g_udev_device_get_sysfs_attr_as_double(device: *mut GUdevDevice, name: *const c_char) -> c_double;
    pub fn g_udev_device_get_sysfs_attr_as_int(device: *mut GUdevDevice, name: *const c_char) -> c_int;
    pub fn g_udev_device_get_sysfs_attr_as_strv(device: *mut GUdevDevice, name: *const c_char) -> *mut *mut c_char;
    pub fn g_udev_device_get_sysfs_attr_as_uint64(device: *mut GUdevDevice, name: *const c_char) -> u64;
    pub fn g_udev_device_get_sysfs_attr_keys(device: *mut GUdevDevice) -> *mut *mut c_char;
    pub fn g_udev_device_get_sysfs_path(device: *mut GUdevDevice) -> *const c_char;
    pub fn g_udev_device_get_tags(device: *mut GUdevDevice) -> *mut *mut c_char;
    pub fn g_udev_device_get_usec_since_initialized(device: *mut GUdevDevice) -> u64;
    pub fn g_udev_device_has_property(device: *mut GUdevDevice, key: *const c_char) -> gboolean;
    pub fn g_udev_device_has_sysfs_attr(device: *mut GUdevDevice, key: *const c_char) -> gboolean;

    //=========================================================================
    // GUdevEnumerator
    //=========================================================================
    pub fn g_udev_enumerator_get_type() -> GType;
    pub fn g_udev_enumerator_new(client: *mut GUdevClient) -> *mut GUdevEnumerator;
    pub fn g_udev_enumerator_add_match_is_initialized(enumerator: *mut GUdevEnumerator) -> *mut GUdevEnumerator;
    pub fn g_udev_enumerator_add_match_name(enumerator: *mut GUdevEnumerator, name: *const c_char) -> *mut GUdevEnumerator;
    pub fn g_udev_enumerator_add_match_property(enumerator: *mut GUdevEnumerator, name: *const c_char, value: *const c_char) -> *mut GUdevEnumerator;
    pub fn g_udev_enumerator_add_match_subsystem(enumerator: *mut GUdevEnumerator, subsystem: *const c_char) -> *mut GUdevEnumerator;
    pub fn g_udev_enumerator_add_match_sysfs_attr(enumerator: *mut GUdevEnumerator, name: *const c_char, value: *const c_char) -> *mut GUdevEnumerator;
    pub fn g_udev_enumerator_add_match_tag(enumerator: *mut GUdevEnumerator, tag: *const c_char) -> *mut GUdevEnumerator;
    pub fn g_udev_enumerator_add_nomatch_subsystem(enumerator: *mut GUdevEnumerator, subsystem: *const c_char) -> *mut GUdevEnumerator;
    pub fn g_udev_enumerator_add_nomatch_sysfs_attr(enumerator: *mut GUdevEnumerator, name: *const c_char, value: *const c_char) -> *mut GUdevEnumerator;
    pub fn g_udev_enumerator_add_sysfs_path(enumerator: *mut GUdevEnumerator, sysfs_path: *const c_char) -> *mut GUdevEnumerator;
    pub fn g_udev_enumerator_execute(enumerator: *mut GUdevEnumerator) -> *mut glib::GList;

}