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
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
// Generated by gir (https://github.com/gtk-rs/gir @ 0e476ab5c1de)
// from /usr/share/gir-1.0 (@ ???)
// 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,
    clippy::upper_case_acronyms
)]
#![cfg_attr(docsrs, feature(doc_cfg))]

use gio_sys as gio;
use glib_sys as glib;
use gobject_sys as gobject;

#[allow(unused_imports)]
use libc::{
    c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void,
    intptr_t, size_t, ssize_t, uintptr_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 {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type PolkitActionDescriptionClass = _PolkitActionDescriptionClass;

#[repr(C)]
pub struct _PolkitAuthorityClass {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type PolkitAuthorityClass = _PolkitAuthorityClass;

#[repr(C)]
pub struct _PolkitAuthorizationResultClass {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type PolkitAuthorizationResultClass = _PolkitAuthorizationResultClass;

#[repr(C)]
pub struct _PolkitDetailsClass {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type PolkitDetailsClass = _PolkitDetailsClass;

#[derive(Copy, Clone)]
#[repr(C)]
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:p}"))
            .field("parent_iface", &self.parent_iface)
            .field("hash", &self.hash)
            .field("equal", &self.equal)
            .field("to_string", &self.to_string)
            .finish()
    }
}

#[derive(Copy, Clone)]
#[repr(C)]
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:p}"))
            .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 {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type PolkitSystemBusNameClass = _PolkitSystemBusNameClass;

#[repr(C)]
pub struct _PolkitTemporaryAuthorizationClass {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type PolkitTemporaryAuthorizationClass = _PolkitTemporaryAuthorizationClass;

#[repr(C)]
pub struct _PolkitUnixGroupClass {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type PolkitUnixGroupClass = _PolkitUnixGroupClass;

#[repr(C)]
pub struct _PolkitUnixNetgroupClass {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type PolkitUnixNetgroupClass = _PolkitUnixNetgroupClass;

#[repr(C)]
pub struct _PolkitUnixProcessClass {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type PolkitUnixProcessClass = _PolkitUnixProcessClass;

#[repr(C)]
pub struct _PolkitUnixSessionClass {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type PolkitUnixSessionClass = _PolkitUnixSessionClass;

#[repr(C)]
pub struct _PolkitUnixUserClass {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type PolkitUnixUserClass = _PolkitUnixUserClass;

// Classes
#[repr(C)]
pub struct PolkitActionDescription {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

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

#[repr(C)]
pub struct PolkitAuthority {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

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

#[repr(C)]
pub struct PolkitAuthorizationResult {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

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

#[repr(C)]
pub struct PolkitDetails {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

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

#[repr(C)]
pub struct PolkitPermission {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

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

#[repr(C)]
pub struct PolkitSystemBusName {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

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

#[repr(C)]
pub struct PolkitTemporaryAuthorization {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

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

#[repr(C)]
pub struct PolkitUnixGroup {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

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

#[repr(C)]
pub struct PolkitUnixNetgroup {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

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

#[repr(C)]
pub struct PolkitUnixProcess {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

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

#[repr(C)]
pub struct PolkitUnixSession {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

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

#[repr(C)]
pub struct PolkitUnixUser {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

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

// Interfaces
#[repr(C)]
pub struct PolkitIdentity {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

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

#[repr(C)]
pub struct PolkitSubject {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

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

#[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(feature = "v0_101")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v0_101")))]
    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;

}