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
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
// This file was generated by gir (https://github.com/gtk-rs/gir @ cea2f7c)
// from gir-files (https://github.com/gtk-rs/gir-files @ ???)
// 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;
extern crate gio_sys as gio;

#[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};

// Enums
pub type PolkitError = c_int;
pub const POLKIT_ERROR_FAILED: PolkitError = 0;
pub const POLKIT_ERROR_CANCELLED: PolkitError = 1;
pub const POLKIT_ERROR_NOT_SUPPORTED: PolkitError = 2;
pub const POLKIT_ERROR_NOT_AUTHORIZED: PolkitError = 3;

pub type PolkitImplicitAuthorization = c_int;
pub const POLKIT_IMPLICIT_AUTHORIZATION_UNKNOWN: PolkitImplicitAuthorization = -1;
pub const POLKIT_IMPLICIT_AUTHORIZATION_NOT_AUTHORIZED: PolkitImplicitAuthorization = 0;
pub const POLKIT_IMPLICIT_AUTHORIZATION_AUTHENTICATION_REQUIRED: PolkitImplicitAuthorization = 1;
pub const POLKIT_IMPLICIT_AUTHORIZATION_ADMINISTRATOR_AUTHENTICATION_REQUIRED: PolkitImplicitAuthorization = 2;
pub const POLKIT_IMPLICIT_AUTHORIZATION_AUTHENTICATION_REQUIRED_RETAINED: PolkitImplicitAuthorization = 3;
pub const POLKIT_IMPLICIT_AUTHORIZATION_ADMINISTRATOR_AUTHENTICATION_REQUIRED_RETAINED: PolkitImplicitAuthorization = 4;
pub const POLKIT_IMPLICIT_AUTHORIZATION_AUTHORIZED: PolkitImplicitAuthorization = 5;

// Flags
pub type PolkitAuthorityFeatures = c_uint;
pub const POLKIT_AUTHORITY_FEATURES_NONE: PolkitAuthorityFeatures = 0;
pub const POLKIT_AUTHORITY_FEATURES_TEMPORARY_AUTHORIZATION: PolkitAuthorityFeatures = 1;

pub type PolkitCheckAuthorizationFlags = c_uint;
pub const POLKIT_CHECK_AUTHORIZATION_FLAGS_NONE: PolkitCheckAuthorizationFlags = 0;
pub const POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION: PolkitCheckAuthorizationFlags = 1;

// Records
#[repr(C)]
pub struct _PolkitActionDescriptionClass(c_void);

pub type PolkitActionDescriptionClass = *mut _PolkitActionDescriptionClass;

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

pub type PolkitAuthorityClass = *mut _PolkitAuthorityClass;

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

pub type PolkitAuthorizationResultClass = *mut _PolkitAuthorizationResultClass;

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

pub type PolkitDetailsClass = *mut _PolkitDetailsClass;

#[repr(C)]
#[derive(Copy, Clone)]
pub struct PolkitIdentityIface {
    pub parent_iface: gobject::GTypeInterface,
    pub hash: Option<unsafe extern "C" fn(*mut PolkitIdentity) -> c_uint>,
    pub equal: Option<unsafe extern "C" fn(*mut PolkitIdentity, *mut PolkitIdentity) -> gboolean>,
    pub to_string: Option<unsafe extern "C" fn(*mut PolkitIdentity) -> *mut c_char>,
}

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

#[repr(C)]
#[derive(Copy, Clone)]
pub struct PolkitSubjectIface {
    pub parent_iface: gobject::GTypeInterface,
    pub hash: Option<unsafe extern "C" fn(*mut PolkitSubject) -> c_uint>,
    pub equal: Option<unsafe extern "C" fn(*mut PolkitSubject, *mut PolkitSubject) -> gboolean>,
    pub to_string: Option<unsafe extern "C" fn(*mut PolkitSubject) -> *mut c_char>,
    pub exists: Option<unsafe extern "C" fn(*mut PolkitSubject, *mut gio::GCancellable, gio::GAsyncReadyCallback, gpointer)>,
    pub exists_finish: Option<unsafe extern "C" fn(*mut PolkitSubject, *mut gio::GAsyncResult, *mut *mut glib::GError) -> gboolean>,
    pub exists_sync: Option<unsafe extern "C" fn(*mut PolkitSubject, *mut gio::GCancellable, *mut *mut glib::GError) -> gboolean>,
}

impl ::std::fmt::Debug for PolkitSubjectIface {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        f.debug_struct(&format!("PolkitSubjectIface @ {:?}", self as *const _))
         .field("parent_iface", &self.parent_iface)
         .field("hash", &self.hash)
         .field("equal", &self.equal)
         .field("to_string", &self.to_string)
         .field("exists", &self.exists)
         .field("exists_finish", &self.exists_finish)
         .field("exists_sync", &self.exists_sync)
         .finish()
    }
}

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

pub type PolkitSystemBusNameClass = *mut _PolkitSystemBusNameClass;

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

pub type PolkitTemporaryAuthorizationClass = *mut _PolkitTemporaryAuthorizationClass;

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

pub type PolkitUnixGroupClass = *mut _PolkitUnixGroupClass;

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

pub type PolkitUnixNetgroupClass = *mut _PolkitUnixNetgroupClass;

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

pub type PolkitUnixProcessClass = *mut _PolkitUnixProcessClass;

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

pub type PolkitUnixSessionClass = *mut _PolkitUnixSessionClass;

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

pub type PolkitUnixUserClass = *mut _PolkitUnixUserClass;

// Classes
#[repr(C)]
pub struct PolkitActionDescription(c_void);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// Interfaces
#[repr(C)]
pub struct PolkitIdentity(c_void);

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

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

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


#[link(name = "polkit-gobject-1")]
extern "C" {

    //=========================================================================
    // PolkitError
    //=========================================================================
    pub fn polkit_error_get_type() -> GType;
    pub fn polkit_error_quark() -> glib::GQuark;

    //=========================================================================
    // PolkitImplicitAuthorization
    //=========================================================================
    pub fn polkit_implicit_authorization_get_type() -> GType;
    pub fn polkit_implicit_authorization_from_string(string: *const c_char, out_implicit_authorization: *mut PolkitImplicitAuthorization) -> gboolean;
    pub fn polkit_implicit_authorization_to_string(implicit_authorization: PolkitImplicitAuthorization) -> *const c_char;

    //=========================================================================
    // PolkitAuthorityFeatures
    //=========================================================================
    pub fn polkit_authority_features_get_type() -> GType;

    //=========================================================================
    // PolkitCheckAuthorizationFlags
    //=========================================================================
    pub fn polkit_check_authorization_flags_get_type() -> GType;

    //=========================================================================
    // PolkitActionDescription
    //=========================================================================
    pub fn polkit_action_description_get_type() -> GType;
    pub fn polkit_action_description_get_action_id(action_description: *mut PolkitActionDescription) -> *const c_char;
    pub fn polkit_action_description_get_annotation(action_description: *mut PolkitActionDescription, key: *const c_char) -> *const c_char;
    pub fn polkit_action_description_get_annotation_keys(action_description: *mut PolkitActionDescription) -> *const *const c_char;
    pub fn polkit_action_description_get_description(action_description: *mut PolkitActionDescription) -> *const c_char;
    pub fn polkit_action_description_get_icon_name(action_description: *mut PolkitActionDescription) -> *const c_char;
    pub fn polkit_action_description_get_implicit_active(action_description: *mut PolkitActionDescription) -> PolkitImplicitAuthorization;
    pub fn polkit_action_description_get_implicit_any(action_description: *mut PolkitActionDescription) -> PolkitImplicitAuthorization;
    pub fn polkit_action_description_get_implicit_inactive(action_description: *mut PolkitActionDescription) -> PolkitImplicitAuthorization;
    pub fn polkit_action_description_get_message(action_description: *mut PolkitActionDescription) -> *const c_char;
    pub fn polkit_action_description_get_vendor_name(action_description: *mut PolkitActionDescription) -> *const c_char;
    pub fn polkit_action_description_get_vendor_url(action_description: *mut PolkitActionDescription) -> *const c_char;

    //=========================================================================
    // PolkitAuthority
    //=========================================================================
    pub fn polkit_authority_get_type() -> GType;
    pub fn polkit_authority_get() -> *mut PolkitAuthority;
    pub fn polkit_authority_get_async(cancellable: *mut gio::GCancellable, callback: gio::GAsyncReadyCallback, user_data: gpointer);
    pub fn polkit_authority_get_finish(res: *mut gio::GAsyncResult, error: *mut *mut glib::GError) -> *mut PolkitAuthority;
    pub fn polkit_authority_get_sync(cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> *mut PolkitAuthority;
    pub fn polkit_authority_authentication_agent_response(authority: *mut PolkitAuthority, cookie: *const c_char, identity: *mut PolkitIdentity, cancellable: *mut gio::GCancellable, callback: gio::GAsyncReadyCallback, user_data: gpointer);
    pub fn polkit_authority_authentication_agent_response_finish(authority: *mut PolkitAuthority, res: *mut gio::GAsyncResult, error: *mut *mut glib::GError) -> gboolean;
    pub fn polkit_authority_authentication_agent_response_sync(authority: *mut PolkitAuthority, cookie: *const c_char, identity: *mut PolkitIdentity, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean;
    pub fn polkit_authority_check_authorization(authority: *mut PolkitAuthority, subject: *mut PolkitSubject, action_id: *const c_char, details: *mut PolkitDetails, flags: PolkitCheckAuthorizationFlags, cancellable: *mut gio::GCancellable, callback: gio::GAsyncReadyCallback, user_data: gpointer);
    pub fn polkit_authority_check_authorization_finish(authority: *mut PolkitAuthority, res: *mut gio::GAsyncResult, error: *mut *mut glib::GError) -> *mut PolkitAuthorizationResult;
    pub fn polkit_authority_check_authorization_sync(authority: *mut PolkitAuthority, subject: *mut PolkitSubject, action_id: *const c_char, details: *mut PolkitDetails, flags: PolkitCheckAuthorizationFlags, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> *mut PolkitAuthorizationResult;
    pub fn polkit_authority_enumerate_actions(authority: *mut PolkitAuthority, cancellable: *mut gio::GCancellable, callback: gio::GAsyncReadyCallback, user_data: gpointer);
    pub fn polkit_authority_enumerate_actions_finish(authority: *mut PolkitAuthority, res: *mut gio::GAsyncResult, error: *mut *mut glib::GError) -> *mut glib::GList;
    pub fn polkit_authority_enumerate_actions_sync(authority: *mut PolkitAuthority, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> *mut glib::GList;
    pub fn polkit_authority_enumerate_temporary_authorizations(authority: *mut PolkitAuthority, subject: *mut PolkitSubject, cancellable: *mut gio::GCancellable, callback: gio::GAsyncReadyCallback, user_data: gpointer);
    pub fn polkit_authority_enumerate_temporary_authorizations_finish(authority: *mut PolkitAuthority, res: *mut gio::GAsyncResult, error: *mut *mut glib::GError) -> *mut glib::GList;
    pub fn polkit_authority_enumerate_temporary_authorizations_sync(authority: *mut PolkitAuthority, subject: *mut PolkitSubject, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> *mut glib::GList;
    pub fn polkit_authority_get_backend_features(authority: *mut PolkitAuthority) -> PolkitAuthorityFeatures;
    pub fn polkit_authority_get_backend_name(authority: *mut PolkitAuthority) -> *const c_char;
    pub fn polkit_authority_get_backend_version(authority: *mut PolkitAuthority) -> *const c_char;
    pub fn polkit_authority_get_owner(authority: *mut PolkitAuthority) -> *mut c_char;
    pub fn polkit_authority_register_authentication_agent(authority: *mut PolkitAuthority, subject: *mut PolkitSubject, locale: *const c_char, object_path: *const c_char, cancellable: *mut gio::GCancellable, callback: gio::GAsyncReadyCallback, user_data: gpointer);
    pub fn polkit_authority_register_authentication_agent_finish(authority: *mut PolkitAuthority, res: *mut gio::GAsyncResult, error: *mut *mut glib::GError) -> gboolean;
    pub fn polkit_authority_register_authentication_agent_sync(authority: *mut PolkitAuthority, subject: *mut PolkitSubject, locale: *const c_char, object_path: *const c_char, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean;
    pub fn polkit_authority_register_authentication_agent_with_options(authority: *mut PolkitAuthority, subject: *mut PolkitSubject, locale: *const c_char, object_path: *const c_char, options: *mut glib::GVariant, cancellable: *mut gio::GCancellable, callback: gio::GAsyncReadyCallback, user_data: gpointer);
    pub fn polkit_authority_register_authentication_agent_with_options_finish(authority: *mut PolkitAuthority, res: *mut gio::GAsyncResult, error: *mut *mut glib::GError) -> gboolean;
    pub fn polkit_authority_register_authentication_agent_with_options_sync(authority: *mut PolkitAuthority, subject: *mut PolkitSubject, locale: *const c_char, object_path: *const c_char, options: *mut glib::GVariant, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean;
    pub fn polkit_authority_revoke_temporary_authorization_by_id(authority: *mut PolkitAuthority, id: *const c_char, cancellable: *mut gio::GCancellable, callback: gio::GAsyncReadyCallback, user_data: gpointer);
    pub fn polkit_authority_revoke_temporary_authorization_by_id_finish(authority: *mut PolkitAuthority, res: *mut gio::GAsyncResult, error: *mut *mut glib::GError) -> gboolean;
    pub fn polkit_authority_revoke_temporary_authorization_by_id_sync(authority: *mut PolkitAuthority, id: *const c_char, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean;
    pub fn polkit_authority_revoke_temporary_authorizations(authority: *mut PolkitAuthority, subject: *mut PolkitSubject, cancellable: *mut gio::GCancellable, callback: gio::GAsyncReadyCallback, user_data: gpointer);
    pub fn polkit_authority_revoke_temporary_authorizations_finish(authority: *mut PolkitAuthority, res: *mut gio::GAsyncResult, error: *mut *mut glib::GError) -> gboolean;
    pub fn polkit_authority_revoke_temporary_authorizations_sync(authority: *mut PolkitAuthority, subject: *mut PolkitSubject, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean;
    pub fn polkit_authority_unregister_authentication_agent(authority: *mut PolkitAuthority, subject: *mut PolkitSubject, object_path: *const c_char, cancellable: *mut gio::GCancellable, callback: gio::GAsyncReadyCallback, user_data: gpointer);
    pub fn polkit_authority_unregister_authentication_agent_finish(authority: *mut PolkitAuthority, res: *mut gio::GAsyncResult, error: *mut *mut glib::GError) -> gboolean;
    pub fn polkit_authority_unregister_authentication_agent_sync(authority: *mut PolkitAuthority, subject: *mut PolkitSubject, object_path: *const c_char, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean;

    //=========================================================================
    // PolkitAuthorizationResult
    //=========================================================================
    pub fn polkit_authorization_result_get_type() -> GType;
    pub fn polkit_authorization_result_new(is_authorized: gboolean, is_challenge: gboolean, details: *mut PolkitDetails) -> *mut PolkitAuthorizationResult;
    pub fn polkit_authorization_result_get_details(result: *mut PolkitAuthorizationResult) -> *mut PolkitDetails;
    #[cfg(any(feature = "v0_101", feature = "dox"))]
    pub fn polkit_authorization_result_get_dismissed(result: *mut PolkitAuthorizationResult) -> gboolean;
    pub fn polkit_authorization_result_get_is_authorized(result: *mut PolkitAuthorizationResult) -> gboolean;
    pub fn polkit_authorization_result_get_is_challenge(result: *mut PolkitAuthorizationResult) -> gboolean;
    pub fn polkit_authorization_result_get_retains_authorization(result: *mut PolkitAuthorizationResult) -> gboolean;
    pub fn polkit_authorization_result_get_temporary_authorization_id(result: *mut PolkitAuthorizationResult) -> *const c_char;

    //=========================================================================
    // PolkitDetails
    //=========================================================================
    pub fn polkit_details_get_type() -> GType;
    pub fn polkit_details_new() -> *mut PolkitDetails;
    pub fn polkit_details_get_keys(details: *mut PolkitDetails) -> *mut *mut c_char;
    pub fn polkit_details_insert(details: *mut PolkitDetails, key: *const c_char, value: *const c_char);
    pub fn polkit_details_lookup(details: *mut PolkitDetails, key: *const c_char) -> *const c_char;

    //=========================================================================
    // PolkitPermission
    //=========================================================================
    pub fn polkit_permission_get_type() -> GType;
    pub fn polkit_permission_new_finish(res: *mut gio::GAsyncResult, error: *mut *mut glib::GError) -> *mut gio::GPermission;
    pub fn polkit_permission_new_sync(action_id: *const c_char, subject: *mut PolkitSubject, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> *mut gio::GPermission;
    pub fn polkit_permission_new(action_id: *const c_char, subject: *mut PolkitSubject, cancellable: *mut gio::GCancellable, callback: gio::GAsyncReadyCallback, user_data: gpointer);
    pub fn polkit_permission_get_action_id(permission: *mut PolkitPermission) -> *const c_char;
    pub fn polkit_permission_get_subject(permission: *mut PolkitPermission) -> *mut PolkitSubject;

    //=========================================================================
    // PolkitSystemBusName
    //=========================================================================
    pub fn polkit_system_bus_name_get_type() -> GType;
    pub fn polkit_system_bus_name_new(name: *const c_char) -> *mut PolkitSubject;
    pub fn polkit_system_bus_name_get_name(system_bus_name: *mut PolkitSystemBusName) -> *const c_char;
    pub fn polkit_system_bus_name_get_process_sync(system_bus_name: *mut PolkitSystemBusName, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> *mut PolkitSubject;
    pub fn polkit_system_bus_name_get_user_sync(system_bus_name: *mut PolkitSystemBusName, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> *mut PolkitUnixUser;
    pub fn polkit_system_bus_name_set_name(system_bus_name: *mut PolkitSystemBusName, name: *const c_char);

    //=========================================================================
    // PolkitTemporaryAuthorization
    //=========================================================================
    pub fn polkit_temporary_authorization_get_type() -> GType;
    pub fn polkit_temporary_authorization_get_action_id(authorization: *mut PolkitTemporaryAuthorization) -> *const c_char;
    pub fn polkit_temporary_authorization_get_id(authorization: *mut PolkitTemporaryAuthorization) -> *const c_char;
    pub fn polkit_temporary_authorization_get_subject(authorization: *mut PolkitTemporaryAuthorization) -> *mut PolkitSubject;
    pub fn polkit_temporary_authorization_get_time_expires(authorization: *mut PolkitTemporaryAuthorization) -> u64;
    pub fn polkit_temporary_authorization_get_time_obtained(authorization: *mut PolkitTemporaryAuthorization) -> u64;

    //=========================================================================
    // PolkitUnixGroup
    //=========================================================================
    pub fn polkit_unix_group_get_type() -> GType;
    pub fn polkit_unix_group_new(gid: c_int) -> *mut PolkitIdentity;
    pub fn polkit_unix_group_new_for_name(name: *const c_char, error: *mut *mut glib::GError) -> *mut PolkitIdentity;
    pub fn polkit_unix_group_get_gid(group: *mut PolkitUnixGroup) -> c_int;
    pub fn polkit_unix_group_set_gid(group: *mut PolkitUnixGroup, gid: c_int);

    //=========================================================================
    // PolkitUnixNetgroup
    //=========================================================================
    pub fn polkit_unix_netgroup_get_type() -> GType;
    pub fn polkit_unix_netgroup_new(name: *const c_char) -> *mut PolkitIdentity;
    pub fn polkit_unix_netgroup_get_name(group: *mut PolkitUnixNetgroup) -> *const c_char;
    pub fn polkit_unix_netgroup_set_name(group: *mut PolkitUnixNetgroup, name: *const c_char);

    //=========================================================================
    // PolkitUnixProcess
    //=========================================================================
    pub fn polkit_unix_process_get_type() -> GType;
    pub fn polkit_unix_process_new(pid: c_int) -> *mut PolkitSubject;
    pub fn polkit_unix_process_new_for_owner(pid: c_int, start_time: u64, uid: c_int) -> *mut PolkitSubject;
    pub fn polkit_unix_process_new_full(pid: c_int, start_time: u64) -> *mut PolkitSubject;
    pub fn polkit_unix_process_get_owner(process: *mut PolkitUnixProcess, error: *mut *mut glib::GError) -> c_int;
    pub fn polkit_unix_process_get_pid(process: *mut PolkitUnixProcess) -> c_int;
    pub fn polkit_unix_process_get_start_time(process: *mut PolkitUnixProcess) -> u64;
    pub fn polkit_unix_process_get_uid(process: *mut PolkitUnixProcess) -> c_int;
    pub fn polkit_unix_process_set_pid(process: *mut PolkitUnixProcess, pid: c_int);
    pub fn polkit_unix_process_set_start_time(process: *mut PolkitUnixProcess, start_time: u64);
    pub fn polkit_unix_process_set_uid(process: *mut PolkitUnixProcess, uid: c_int);

    //=========================================================================
    // PolkitUnixSession
    //=========================================================================
    pub fn polkit_unix_session_get_type() -> GType;
    pub fn polkit_unix_session_new(session_id: *const c_char) -> *mut PolkitSubject;
    pub fn polkit_unix_session_new_for_process(pid: c_int, cancellable: *mut gio::GCancellable, callback: gio::GAsyncReadyCallback, user_data: gpointer);
    pub fn polkit_unix_session_new_for_process_finish(res: *mut gio::GAsyncResult, error: *mut *mut glib::GError) -> *mut PolkitSubject;
    pub fn polkit_unix_session_new_for_process_sync(pid: c_int, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> *mut PolkitSubject;
    pub fn polkit_unix_session_get_session_id(session: *mut PolkitUnixSession) -> *const c_char;
    pub fn polkit_unix_session_set_session_id(session: *mut PolkitUnixSession, session_id: *const c_char);

    //=========================================================================
    // PolkitUnixUser
    //=========================================================================
    pub fn polkit_unix_user_get_type() -> GType;
    pub fn polkit_unix_user_new(uid: c_int) -> *mut PolkitIdentity;
    pub fn polkit_unix_user_new_for_name(name: *const c_char, error: *mut *mut glib::GError) -> *mut PolkitIdentity;
    pub fn polkit_unix_user_get_name(user: *mut PolkitUnixUser) -> *const c_char;
    pub fn polkit_unix_user_get_uid(user: *mut PolkitUnixUser) -> c_int;
    pub fn polkit_unix_user_set_uid(user: *mut PolkitUnixUser, uid: c_int);

    //=========================================================================
    // PolkitIdentity
    //=========================================================================
    pub fn polkit_identity_get_type() -> GType;
    pub fn polkit_identity_from_string(str: *const c_char, error: *mut *mut glib::GError) -> *mut PolkitIdentity;
    pub fn polkit_identity_equal(a: *mut PolkitIdentity, b: *mut PolkitIdentity) -> gboolean;
    pub fn polkit_identity_hash(identity: *mut PolkitIdentity) -> c_uint;
    pub fn polkit_identity_to_string(identity: *mut PolkitIdentity) -> *mut c_char;

    //=========================================================================
    // PolkitSubject
    //=========================================================================
    pub fn polkit_subject_get_type() -> GType;
    pub fn polkit_subject_from_string(str: *const c_char, error: *mut *mut glib::GError) -> *mut PolkitSubject;
    pub fn polkit_subject_equal(a: *mut PolkitSubject, b: *mut PolkitSubject) -> gboolean;
    pub fn polkit_subject_exists(subject: *mut PolkitSubject, cancellable: *mut gio::GCancellable, callback: gio::GAsyncReadyCallback, user_data: gpointer);
    pub fn polkit_subject_exists_finish(subject: *mut PolkitSubject, res: *mut gio::GAsyncResult, error: *mut *mut glib::GError) -> gboolean;
    pub fn polkit_subject_exists_sync(subject: *mut PolkitSubject, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError) -> gboolean;
    pub fn polkit_subject_hash(subject: *mut PolkitSubject) -> c_uint;
    pub fn polkit_subject_to_string(subject: *mut PolkitSubject) -> *mut c_char;

}