-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlib.rs
More file actions
3855 lines (3554 loc) · 208 KB
/
lib.rs
File metadata and controls
3855 lines (3554 loc) · 208 KB
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
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// This file was generated by grust-gen 0.3.0
#![crate_name = "glib_2_0_sys"]
#![crate_type = "lib"]
#![allow(non_upper_case_globals)] // For G_CSET_a_2_z
extern crate gtypes;
extern crate libc;
use gtypes::*;
#[repr(C)]
pub struct GDate([u32; 2]);
#[repr(C)]
pub struct GDoubleIEEE754(gdouble);
#[repr(C)]
pub struct GFloatIEEE754(gfloat);
#[repr(C)]
pub struct GHookList {
pub seq_id: gulong,
// Two bit fields in the C definition here
_hook_size_is_setup: u32,
pub hooks: *mut GHook,
dummy3: gpointer,
pub finalize_hook: Option<GHookFinalizeFunc>,
dummy: [gpointer; 2]
}
#[repr(C)]
pub struct GIOChannel {
ref_count :gint,
funcs: *mut GIOFuncs,
encoding: *mut gchar,
read_cd: GIConv,
write_cd: GIConv,
line_term: *mut gchar,
line_term_len: gint,
buf_size: gsize,
read_buf: *mut GString,
encoded_read_buf: *mut GString,
write_buf: *mut GString,
partial_write_buf: [gchar; 6],
// A group of bit fields in the C definition here
// to fit after partial_write_buf
flags: u16,
reserved1: gpointer,
reserved2: gpointer
}
// This happens to get the same determinants in all Unixes I have surveyed,
// and for non-Unix GLib provides the same values.
#[repr(C)]
pub enum GIOCondition {
In = 1,
Out = 4,
Pri = 2,
Err = 8,
Hup = 16,
Nval = 32
}
pub const G_IO_IN: guint = GIOCondition::In as guint;
pub const G_IO_OUT: guint = GIOCondition::Out as guint;
pub const G_IO_PRI: guint = GIOCondition::Pri as guint;
pub const G_IO_ERR: guint = GIOCondition::Err as guint;
pub const G_IO_HUP: guint = GIOCondition::Hup as guint;
pub const G_IO_NVAL: guint = GIOCondition::Nval as guint;
#[cfg(target_pointer_width = "32")]
#[repr(C)]
pub struct GMutex([guint; 2]);
// NOTE: An ILP64 target would need GMutex defined as above
#[cfg(target_pointer_width = "64")]
#[repr(C)]
pub struct GMutex(gpointer);
#[cfg(unix)]
pub type GPid = gint;
#[cfg(windows)]
pub type GPid = *mut libc::c_void;
#[repr(C)]
pub struct GScannerConfig {
pub cset_skip_characters: *mut gchar,
pub cset_identifier_first: *mut gchar,
pub cset_identifier_nth: *mut gchar,
pub cpair_comment_single: *mut gchar,
// a group of bit fields in the C definition here
flags: u32,
padding_dummy: guint
}
#[repr(C)]
pub struct GTokenValue {
v: u64
}
pub const GLIB_SYSDEF_AF_INET: gint = libc::AF_INET;
pub const GLIB_SYSDEF_AF_INET6: gint = libc::AF_INET6;
pub const GLIB_SYSDEF_AF_UNIX: gint = libc::AF_UNIX;
mod consts {
// The BSD definitions are used everywhere,
// but we should keep an exhaustive list, just in case.
#[cfg(any(target_os = "linux",
target_os = "windows",
target_os = "macos",
target_os = "freebsd",
target_os = "dragonfly",
target_os = "openbsd",
target_os = "bitrig",
target_os = "netbsd",
target_os = "android",
target_os = "nacl"))]
pub mod os {
use gtypes::*;
pub const GLIB_SYSDEF_MSG_OOB: gint = 1;
pub const GLIB_SYSDEF_MSG_PEEK: gint = 2;
pub const GLIB_SYSDEF_MSG_DONTROUTE: gint = 4;
}
// ILP32, standard printf format modifiers
#[cfg(all(any(target_arch = "x86",
target_arch = "arm",
target_arch = "mips",
target_arch = "mipsel",
target_arch = "powerpc",
target_arch = "le32"),
not(windows)))]
pub mod datamodel {
pub const G_GINT16_MODIFIER: &'static [u8] = b"h\0";
pub const G_GINT16_FORMAT: &'static [u8] = b"hi\0";
pub const G_GUINT16_FORMAT: &'static [u8] = b"hu\0";
pub const G_GINT32_MODIFIER: &'static [u8] = b"\0";
pub const G_GINT32_FORMAT: &'static [u8] = b"i\0";
pub const G_GUINT32_FORMAT: &'static [u8] = b"u\0";
pub const G_GINT64_MODIFIER: &'static [u8] = b"ll\0";
pub const G_GINT64_FORMAT: &'static [u8] = b"lli\0";
pub const G_GUINT64_FORMAT: &'static [u8] = b"llu\0";
pub const G_GINTPTR_MODIFIER: &'static [u8] = b"\0";
pub const G_GINTPTR_FORMAT: &'static [u8] = b"i\0";
pub const G_GUINTPTR_FORMAT: &'static [u8] = b"u\0";
pub const G_GSIZE_MODIFIER: &'static [u8] = b"\0";
pub const G_GSSIZE_MODIFIER: &'static [u8] = b"\0";
pub const G_GSIZE_FORMAT: &'static [u8] = b"u\0";
pub const G_GSSIZE_FORMAT: &'static [u8] = b"i\0";
}
// On Win32, GLib uses MSVCRT-specific format modifiers for 64-bit types
#[cfg(all(windows, target_arch = "x86"))]
pub mod datamodel {
pub const G_GINT16_MODIFIER: &'static [u8] = b"h\0";
pub const G_GINT16_FORMAT: &'static [u8] = b"hi\0";
pub const G_GUINT16_FORMAT: &'static [u8] = b"hu\0";
pub const G_GINT32_MODIFIER: &'static [u8] = b"\0";
pub const G_GINT32_FORMAT: &'static [u8] = b"i\0";
pub const G_GUINT32_FORMAT: &'static [u8] = b"u\0";
pub const G_GINT64_MODIFIER: &'static [u8] = b"I64\0";
pub const G_GINT64_FORMAT: &'static [u8] = b"I64i\0";
pub const G_GUINT64_FORMAT: &'static [u8] = b"I64u\0";
pub const G_GINTPTR_MODIFIER: &'static [u8] = b"\0";
pub const G_GINTPTR_FORMAT: &'static [u8] = b"i\0";
pub const G_GUINTPTR_FORMAT: &'static [u8] = b"u\0";
pub const G_GSIZE_MODIFIER: &'static [u8] = b"\0";
pub const G_GSSIZE_MODIFIER: &'static [u8] = b"\0";
pub const G_GSIZE_FORMAT: &'static [u8] = b"u\0";
pub const G_GSSIZE_FORMAT: &'static [u8] = b"i\0";
}
// LP64
#[cfg(all(unix,
any(target_arch = "x86_64",
target_arch = "aarch64")))]
pub mod datamodel {
pub const G_GINT16_MODIFIER: &'static [u8] = b"h\0";
pub const G_GINT16_FORMAT: &'static [u8] = b"hi\0";
pub const G_GUINT16_FORMAT: &'static [u8] = b"hu\0";
pub const G_GINT32_MODIFIER: &'static [u8] = b"\0";
pub const G_GINT32_FORMAT: &'static [u8] = b"i\0";
pub const G_GUINT32_FORMAT: &'static [u8] = b"u\0";
pub const G_GINT64_MODIFIER: &'static [u8] = b"l\0";
pub const G_GINT64_FORMAT: &'static [u8] = b"li\0";
pub const G_GUINT64_FORMAT: &'static [u8] = b"lu\0";
pub const G_GINTPTR_MODIFIER: &'static [u8] = b"l\0";
pub const G_GINTPTR_FORMAT: &'static [u8] = b"li\0";
pub const G_GUINTPTR_FORMAT: &'static [u8] = b"lu\0";
pub const G_GSIZE_MODIFIER: &'static [u8] = b"l\0";
pub const G_GSSIZE_MODIFIER: &'static [u8] = b"l\0";
pub const G_GSIZE_FORMAT: &'static [u8] = b"lu\0";
pub const G_GSSIZE_FORMAT: &'static [u8] = b"li\0";
}
// 64-bit Windows
#[cfg(all(windows, target_arch = "x86_64"))]
pub mod datamodel {
pub const G_GINT16_MODIFIER: &'static [u8] = b"h\0";
pub const G_GINT16_FORMAT: &'static [u8] = b"hi\0";
pub const G_GUINT16_FORMAT: &'static [u8] = b"hu\0";
pub const G_GINT32_MODIFIER: &'static [u8] = b"\0";
pub const G_GINT32_FORMAT: &'static [u8] = b"i\0";
pub const G_GUINT32_FORMAT: &'static [u8] = b"u\0";
pub const G_GINT64_MODIFIER: &'static [u8] = b"I64\0";
pub const G_GINT64_FORMAT: &'static [u8] = b"I64i\0";
pub const G_GUINT64_FORMAT: &'static [u8] = b"I64u\0";
pub const G_GINTPTR_MODIFIER: &'static [u8] = b"I64\0";
pub const G_GINTPTR_FORMAT: &'static [u8] = b"I64i\0";
pub const G_GUINTPTR_FORMAT: &'static [u8] = b"I64u\0";
pub const G_GSIZE_MODIFIER: &'static [u8] = b"I64\0";
pub const G_GSSIZE_MODIFIER: &'static [u8] = b"I64\0";
pub const G_GSIZE_FORMAT: &'static [u8] = b"I64u\0";
pub const G_GSSIZE_FORMAT: &'static [u8] = b"I64i\0";
}
#[cfg(unix)]
pub mod filename {
pub const G_DIR_SEPARATOR: u8 = b'/';
pub const G_DIR_SEPARATOR_S: &'static [u8] = b"/\0";
pub const G_SEARCHPATH_SEPARATOR: u8 = b':';
pub const G_SEARCHPATH_SEPARATOR_S: &'static [u8] = b":\0";
pub const G_MODULE_SUFFIX: &'static [u8] = b"so\0";
}
#[cfg(windows)]
pub mod filename {
pub const G_DIR_SEPARATOR: u8 = b'\\';
pub const G_DIR_SEPARATOR_S: &'static [u8] = b"\\\0";
pub const G_SEARCHPATH_SEPARATOR: u8 = b';';
pub const G_SEARCHPATH_SEPARATOR_S: &'static [u8] = b";\0";
pub const G_MODULE_SUFFIX: &'static [u8] = b"dll\0";
}
#[cfg(unix)]
pub mod pollfd {
pub const G_POLLFD_FORMAT: &'static [u8] = b"%d\0";
}
#[cfg(windows)]
pub mod pollfd {
#[cfg(target_arch = "x86")]
pub const G_POLLFD_FORMAT: &'static [u8] = b"%#x\0";
#[cfg(target_arch = "x86_64")]
pub const G_POLLFD_FORMAT: &'static [u8] = b"%#I64x\0";
}
}
pub use consts::os::*;
pub use consts::datamodel::*;
pub use consts::filename::*;
pub use consts::pollfd::*;
pub type GDateDay = u8;
pub type GDateYear = u16;
pub type GMutexLocker = gpointer;
pub type GQuark = u32;
pub type GStrv = gpointer;
pub type GTime = i32;
pub type GTimeSpan = i64;
pub const G_ANALYZER_ANALYZING: gint = 1;
pub const G_ASCII_DTOSTR_BUF_SIZE: gint = 39;
#[repr(C)]
pub struct GArray {
pub data: *mut gchar,
pub len: guint,
}
#[repr(C)]
pub enum GAsciiType {
Alnum = 1,
Alpha = 2,
Cntrl = 4,
Digit = 8,
Graph = 16,
Lower = 32,
Print = 64,
Punct = 128,
Space = 256,
Upper = 512,
Xdigit = 1024,
}
pub const G_ASCII_ALNUM: guint = 1;
pub const G_ASCII_ALPHA: guint = 2;
pub const G_ASCII_CNTRL: guint = 4;
pub const G_ASCII_DIGIT: guint = 8;
pub const G_ASCII_GRAPH: guint = 16;
pub const G_ASCII_LOWER: guint = 32;
pub const G_ASCII_PRINT: guint = 64;
pub const G_ASCII_PUNCT: guint = 128;
pub const G_ASCII_SPACE: guint = 256;
pub const G_ASCII_UPPER: guint = 512;
pub const G_ASCII_XDIGIT: guint = 1024;
#[repr(C)]
pub struct GAsyncQueue(gpointer);
pub const G_BIG_ENDIAN: gint = 4321;
#[repr(C)]
pub struct GBookmarkFile(gpointer);
#[repr(C)]
pub enum GBookmarkFileError {
InvalidUri = 0,
InvalidValue = 1,
AppNotRegistered = 2,
UriNotFound = 3,
Read = 4,
UnknownEncoding = 5,
Write = 6,
FileNotFound = 7,
}
pub const G_BOOKMARK_FILE_ERROR_INVALID_URI: GBookmarkFileError = GBookmarkFileError::InvalidUri;
pub const G_BOOKMARK_FILE_ERROR_INVALID_VALUE: GBookmarkFileError = GBookmarkFileError::InvalidValue;
pub const G_BOOKMARK_FILE_ERROR_APP_NOT_REGISTERED: GBookmarkFileError = GBookmarkFileError::AppNotRegistered;
pub const G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND: GBookmarkFileError = GBookmarkFileError::UriNotFound;
pub const G_BOOKMARK_FILE_ERROR_READ: GBookmarkFileError = GBookmarkFileError::Read;
pub const G_BOOKMARK_FILE_ERROR_UNKNOWN_ENCODING: GBookmarkFileError = GBookmarkFileError::UnknownEncoding;
pub const G_BOOKMARK_FILE_ERROR_WRITE: GBookmarkFileError = GBookmarkFileError::Write;
pub const G_BOOKMARK_FILE_ERROR_FILE_NOT_FOUND: GBookmarkFileError = GBookmarkFileError::FileNotFound;
#[repr(C)]
pub struct GByteArray {
pub data: u8,
pub len: guint,
}
pub enum GBytes { }
pub const G_CSET_A_2_Z: &'static [u8] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZ\0";
pub const G_CSET_DIGITS: &'static [u8] = b"0123456789\0";
pub const G_CSET_a_2_z: &'static [u8] = b"abcdefghijklmnopqrstuvwxyz\0";
pub enum GChecksum { }
#[repr(C)]
pub enum GChecksumType {
Md5 = 0,
Sha1 = 1,
Sha256 = 2,
Sha512 = 3,
}
pub const G_CHECKSUM_MD5: GChecksumType = GChecksumType::Md5;
pub const G_CHECKSUM_SHA1: GChecksumType = GChecksumType::Sha1;
pub const G_CHECKSUM_SHA256: GChecksumType = GChecksumType::Sha256;
pub const G_CHECKSUM_SHA512: GChecksumType = GChecksumType::Sha512;
pub type GChildWatchFunc = extern "C" fn (GPid, gint, gpointer);
pub type GCompareDataFunc = extern "C" fn (gconstpointer, gconstpointer, gpointer) -> gint;
pub type GCompareFunc = extern "C" fn (gconstpointer, gconstpointer) -> gint;
#[repr(C)]
pub struct GCond {
p: gpointer,
i: [guint; 2],
}
#[repr(C)]
pub enum GConvertError {
NoConversion = 0,
IllegalSequence = 1,
Failed = 2,
PartialInput = 3,
BadUri = 4,
NotAbsolutePath = 5,
NoMemory = 6,
}
pub const G_CONVERT_ERROR_NO_CONVERSION: GConvertError = GConvertError::NoConversion;
pub const G_CONVERT_ERROR_ILLEGAL_SEQUENCE: GConvertError = GConvertError::IllegalSequence;
pub const G_CONVERT_ERROR_FAILED: GConvertError = GConvertError::Failed;
pub const G_CONVERT_ERROR_PARTIAL_INPUT: GConvertError = GConvertError::PartialInput;
pub const G_CONVERT_ERROR_BAD_URI: GConvertError = GConvertError::BadUri;
pub const G_CONVERT_ERROR_NOT_ABSOLUTE_PATH: GConvertError = GConvertError::NotAbsolutePath;
pub const G_CONVERT_ERROR_NO_MEMORY: GConvertError = GConvertError::NoMemory;
pub type GCopyFunc = extern "C" fn (gconstpointer, gpointer) -> gpointer;
pub const G_DATALIST_FLAGS_MASK: gint = 3;
pub const G_DATE_BAD_DAY: gint = 0;
pub const G_DATE_BAD_JULIAN: gint = 0;
pub const G_DATE_BAD_YEAR: gint = 0;
#[repr(C)]
pub struct GData(gpointer);
pub type GDataForeachFunc = extern "C" fn (GQuark, gpointer, gpointer);
#[repr(C)]
pub enum GDateDMY {
Day = 0,
Month = 1,
Year = 2,
}
pub const G_DATE_DAY: GDateDMY = GDateDMY::Day;
pub const G_DATE_MONTH: GDateDMY = GDateDMY::Month;
pub const G_DATE_YEAR: GDateDMY = GDateDMY::Year;
#[repr(C)]
pub enum GDateMonth {
BadMonth = 0,
January = 1,
February = 2,
March = 3,
April = 4,
May = 5,
June = 6,
July = 7,
August = 8,
September = 9,
October = 10,
November = 11,
December = 12,
}
pub const G_DATE_BAD_MONTH: GDateMonth = GDateMonth::BadMonth;
pub const G_DATE_JANUARY: GDateMonth = GDateMonth::January;
pub const G_DATE_FEBRUARY: GDateMonth = GDateMonth::February;
pub const G_DATE_MARCH: GDateMonth = GDateMonth::March;
pub const G_DATE_APRIL: GDateMonth = GDateMonth::April;
pub const G_DATE_MAY: GDateMonth = GDateMonth::May;
pub const G_DATE_JUNE: GDateMonth = GDateMonth::June;
pub const G_DATE_JULY: GDateMonth = GDateMonth::July;
pub const G_DATE_AUGUST: GDateMonth = GDateMonth::August;
pub const G_DATE_SEPTEMBER: GDateMonth = GDateMonth::September;
pub const G_DATE_OCTOBER: GDateMonth = GDateMonth::October;
pub const G_DATE_NOVEMBER: GDateMonth = GDateMonth::November;
pub const G_DATE_DECEMBER: GDateMonth = GDateMonth::December;
pub enum GDateTime { }
#[repr(C)]
pub enum GDateWeekday {
BadWeekday = 0,
Monday = 1,
Tuesday = 2,
Wednesday = 3,
Thursday = 4,
Friday = 5,
Saturday = 6,
Sunday = 7,
}
pub const G_DATE_BAD_WEEKDAY: GDateWeekday = GDateWeekday::BadWeekday;
pub const G_DATE_MONDAY: GDateWeekday = GDateWeekday::Monday;
pub const G_DATE_TUESDAY: GDateWeekday = GDateWeekday::Tuesday;
pub const G_DATE_WEDNESDAY: GDateWeekday = GDateWeekday::Wednesday;
pub const G_DATE_THURSDAY: GDateWeekday = GDateWeekday::Thursday;
pub const G_DATE_FRIDAY: GDateWeekday = GDateWeekday::Friday;
pub const G_DATE_SATURDAY: GDateWeekday = GDateWeekday::Saturday;
pub const G_DATE_SUNDAY: GDateWeekday = GDateWeekday::Sunday;
#[repr(C)]
pub struct GDebugKey {
pub key: *const gchar,
pub value: guint,
}
pub type GDestroyNotify = extern "C" fn (gpointer);
#[repr(C)]
pub struct GDir(gpointer);
pub type GDuplicateFunc = extern "C" fn (gpointer, gpointer) -> gpointer;
pub const G_E: gdouble = 2.718282;
pub type GEqualFunc = extern "C" fn (gconstpointer, gconstpointer) -> gboolean;
#[repr(C)]
pub struct GError {
pub domain: GQuark,
pub code: gint,
pub message: *mut gchar,
}
#[repr(C)]
pub enum GErrorType {
Unknown = 0,
UnexpEof = 1,
UnexpEofInString = 2,
UnexpEofInComment = 3,
NonDigitInConst = 4,
DigitRadix = 5,
FloatRadix = 6,
FloatMalformed = 7,
}
pub const G_ERR_UNKNOWN: GErrorType = GErrorType::Unknown;
pub const G_ERR_UNEXP_EOF: GErrorType = GErrorType::UnexpEof;
pub const G_ERR_UNEXP_EOF_IN_STRING: GErrorType = GErrorType::UnexpEofInString;
pub const G_ERR_UNEXP_EOF_IN_COMMENT: GErrorType = GErrorType::UnexpEofInComment;
pub const G_ERR_NON_DIGIT_IN_CONST: GErrorType = GErrorType::NonDigitInConst;
pub const G_ERR_DIGIT_RADIX: GErrorType = GErrorType::DigitRadix;
pub const G_ERR_FLOAT_RADIX: GErrorType = GErrorType::FloatRadix;
pub const G_ERR_FLOAT_MALFORMED: GErrorType = GErrorType::FloatMalformed;
#[repr(C)]
pub enum GFileError {
Exist = 0,
Isdir = 1,
Acces = 2,
Nametoolong = 3,
Noent = 4,
Notdir = 5,
Nxio = 6,
Nodev = 7,
Rofs = 8,
Txtbsy = 9,
Fault = 10,
Loop = 11,
Nospc = 12,
Nomem = 13,
Mfile = 14,
Nfile = 15,
Badf = 16,
Inval = 17,
Pipe = 18,
Again = 19,
Intr = 20,
Io = 21,
Perm = 22,
Nosys = 23,
Failed = 24,
}
pub const G_FILE_ERROR_EXIST: GFileError = GFileError::Exist;
pub const G_FILE_ERROR_ISDIR: GFileError = GFileError::Isdir;
pub const G_FILE_ERROR_ACCES: GFileError = GFileError::Acces;
pub const G_FILE_ERROR_NAMETOOLONG: GFileError = GFileError::Nametoolong;
pub const G_FILE_ERROR_NOENT: GFileError = GFileError::Noent;
pub const G_FILE_ERROR_NOTDIR: GFileError = GFileError::Notdir;
pub const G_FILE_ERROR_NXIO: GFileError = GFileError::Nxio;
pub const G_FILE_ERROR_NODEV: GFileError = GFileError::Nodev;
pub const G_FILE_ERROR_ROFS: GFileError = GFileError::Rofs;
pub const G_FILE_ERROR_TXTBSY: GFileError = GFileError::Txtbsy;
pub const G_FILE_ERROR_FAULT: GFileError = GFileError::Fault;
pub const G_FILE_ERROR_LOOP: GFileError = GFileError::Loop;
pub const G_FILE_ERROR_NOSPC: GFileError = GFileError::Nospc;
pub const G_FILE_ERROR_NOMEM: GFileError = GFileError::Nomem;
pub const G_FILE_ERROR_MFILE: GFileError = GFileError::Mfile;
pub const G_FILE_ERROR_NFILE: GFileError = GFileError::Nfile;
pub const G_FILE_ERROR_BADF: GFileError = GFileError::Badf;
pub const G_FILE_ERROR_INVAL: GFileError = GFileError::Inval;
pub const G_FILE_ERROR_PIPE: GFileError = GFileError::Pipe;
pub const G_FILE_ERROR_AGAIN: GFileError = GFileError::Again;
pub const G_FILE_ERROR_INTR: GFileError = GFileError::Intr;
pub const G_FILE_ERROR_IO: GFileError = GFileError::Io;
pub const G_FILE_ERROR_PERM: GFileError = GFileError::Perm;
pub const G_FILE_ERROR_NOSYS: GFileError = GFileError::Nosys;
pub const G_FILE_ERROR_FAILED: GFileError = GFileError::Failed;
#[repr(C)]
pub enum GFileTest {
IsRegular = 1,
IsSymlink = 2,
IsDir = 4,
IsExecutable = 8,
Exists = 16,
}
pub const G_FILE_TEST_IS_REGULAR: guint = 1;
pub const G_FILE_TEST_IS_SYMLINK: guint = 2;
pub const G_FILE_TEST_IS_DIR: guint = 4;
pub const G_FILE_TEST_IS_EXECUTABLE: guint = 8;
pub const G_FILE_TEST_EXISTS: guint = 16;
#[repr(C)]
pub enum GFormatSizeFlags {
Default = 0,
LongFormat = 1,
IecUnits = 2,
}
pub const G_FORMAT_SIZE_DEFAULT: guint = 0;
pub const G_FORMAT_SIZE_LONG_FORMAT: guint = 1;
pub const G_FORMAT_SIZE_IEC_UNITS: guint = 2;
pub type GFreeFunc = extern "C" fn (gpointer);
pub type GFunc = extern "C" fn (gpointer, gpointer);
pub const G_GNUC_FUNCTION: &'static [u8] = b"\0";
pub const G_GNUC_PRETTY_FUNCTION: &'static [u8] = b"\0";
pub type GHFunc = extern "C" fn (gpointer, gpointer, gpointer);
pub const G_HOOK_FLAG_USER_SHIFT: gint = 4;
pub type GHRFunc = extern "C" fn (gpointer, gpointer, gpointer) -> gboolean;
pub type GHashFunc = extern "C" fn (gconstpointer) -> guint;
pub enum GHashTable { }
#[repr(C)]
pub struct GHashTableIter {
dummy1: gpointer,
dummy2: gpointer,
dummy3: gpointer,
dummy4: gint,
dummy5: gboolean,
dummy6: gpointer,
}
#[repr(C)]
pub struct GHmac(gpointer);
#[repr(C)]
pub struct GHook {
pub data: gpointer,
pub next: *mut GHook,
pub prev: *mut GHook,
pub ref_count: guint,
pub hook_id: gulong,
pub flags: guint,
pub func: gpointer,
pub destroy: Option<GDestroyNotify>,
}
pub type GHookCheckFunc = extern "C" fn (gpointer) -> gboolean;
pub type GHookCheckMarshaller = extern "C" fn (*mut GHook, gpointer) -> gboolean;
pub type GHookCompareFunc = extern "C" fn (*mut GHook, *mut GHook) -> gint;
pub type GHookFinalizeFunc = extern "C" fn (*mut GHookList, *mut GHook);
pub type GHookFindFunc = extern "C" fn (*mut GHook, gpointer) -> gboolean;
#[repr(C)]
pub enum GHookFlagMask {
Active = 1,
InCall = 2,
Mask = 15,
}
pub const G_HOOK_FLAG_ACTIVE: guint = 1;
pub const G_HOOK_FLAG_IN_CALL: guint = 2;
pub const G_HOOK_FLAG_MASK: guint = 15;
pub type GHookFunc = extern "C" fn (gpointer);
pub type GHookMarshaller = extern "C" fn (*mut GHook, gpointer);
#[repr(C)]
pub struct GIConv(gpointer);
pub const G_IEEE754_DOUBLE_BIAS: gint = 1023;
pub const G_IEEE754_FLOAT_BIAS: gint = 127;
#[repr(C)]
pub enum GIOChannelError {
Fbig = 0,
Inval = 1,
Io = 2,
Isdir = 3,
Nospc = 4,
Nxio = 5,
Overflow = 6,
Pipe = 7,
Failed = 8,
}
pub const G_IO_CHANNEL_ERROR_FBIG: GIOChannelError = GIOChannelError::Fbig;
pub const G_IO_CHANNEL_ERROR_INVAL: GIOChannelError = GIOChannelError::Inval;
pub const G_IO_CHANNEL_ERROR_IO: GIOChannelError = GIOChannelError::Io;
pub const G_IO_CHANNEL_ERROR_ISDIR: GIOChannelError = GIOChannelError::Isdir;
pub const G_IO_CHANNEL_ERROR_NOSPC: GIOChannelError = GIOChannelError::Nospc;
pub const G_IO_CHANNEL_ERROR_NXIO: GIOChannelError = GIOChannelError::Nxio;
pub const G_IO_CHANNEL_ERROR_OVERFLOW: GIOChannelError = GIOChannelError::Overflow;
pub const G_IO_CHANNEL_ERROR_PIPE: GIOChannelError = GIOChannelError::Pipe;
pub const G_IO_CHANNEL_ERROR_FAILED: GIOChannelError = GIOChannelError::Failed;
#[repr(C)]
pub enum GIOError {
None = 0,
Again = 1,
Inval = 2,
Unknown = 3,
}
pub const G_IO_ERROR_NONE: GIOError = GIOError::None;
pub const G_IO_ERROR_AGAIN: GIOError = GIOError::Again;
pub const G_IO_ERROR_INVAL: GIOError = GIOError::Inval;
pub const G_IO_ERROR_UNKNOWN: GIOError = GIOError::Unknown;
#[repr(C)]
pub enum GIOFlags {
Append = 1,
Nonblock = 2,
SetMask = 3,
IsReadable = 4,
IsWritable = 8,
IsSeekable = 16,
Mask = 31,
}
pub const G_IO_FLAG_APPEND: guint = 1;
pub const G_IO_FLAG_NONBLOCK: guint = 2;
pub const G_IO_FLAG_IS_READABLE: guint = 4;
pub const G_IO_FLAG_IS_WRITABLE: guint = 8;
pub const G_IO_FLAG_IS_WRITEABLE: guint = 8;
pub const G_IO_FLAG_IS_SEEKABLE: guint = 16;
pub const G_IO_FLAG_MASK: guint = 31;
pub const G_IO_FLAG_GET_MASK: guint = 31;
pub const G_IO_FLAG_SET_MASK: guint = 3;
pub type GIOFunc = extern "C" fn (*mut GIOChannel, GIOCondition, gpointer) -> gboolean;
#[repr(C)]
pub struct GIOFuncs {
pub io_read: Option<extern "C" fn (*mut GIOChannel, *mut gchar, gsize, gsize, *mut *mut GError) -> GIOStatus>,
pub io_write: Option<extern "C" fn (*mut GIOChannel, *const gchar, gsize, gsize, *mut *mut GError) -> GIOStatus>,
pub io_seek: Option<extern "C" fn (*mut GIOChannel, i64, GSeekType, *mut *mut GError) -> GIOStatus>,
pub io_close: Option<extern "C" fn (*mut GIOChannel, *mut *mut GError) -> GIOStatus>,
pub io_create_watch: Option<extern "C" fn (*mut GIOChannel, GIOCondition) -> *mut GSource>,
pub io_free: Option<extern "C" fn (*mut GIOChannel)>,
pub io_set_flags: Option<extern "C" fn (*mut GIOChannel, GIOFlags, *mut *mut GError) -> GIOStatus>,
pub io_get_flags: Option<extern "C" fn (*mut GIOChannel) -> GIOFlags>,
}
#[repr(C)]
pub enum GIOStatus {
Error = 0,
Normal = 1,
Eof = 2,
Again = 3,
}
pub const G_IO_STATUS_ERROR: GIOStatus = GIOStatus::Error;
pub const G_IO_STATUS_NORMAL: GIOStatus = GIOStatus::Normal;
pub const G_IO_STATUS_EOF: GIOStatus = GIOStatus::Eof;
pub const G_IO_STATUS_AGAIN: GIOStatus = GIOStatus::Again;
pub const G_KEY_FILE_DESKTOP_GROUP: &'static [u8] = b"Desktop Entry\0";
pub const G_KEY_FILE_DESKTOP_KEY_ACTIONS: &'static [u8] = b"Actions\0";
pub const G_KEY_FILE_DESKTOP_KEY_CATEGORIES: &'static [u8] = b"Categories\0";
pub const G_KEY_FILE_DESKTOP_KEY_COMMENT: &'static [u8] = b"Comment\0";
pub const G_KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE: &'static [u8] = b"DBusActivatable\0";
pub const G_KEY_FILE_DESKTOP_KEY_EXEC: &'static [u8] = b"Exec\0";
pub const G_KEY_FILE_DESKTOP_KEY_GENERIC_NAME: &'static [u8] = b"GenericName\0";
pub const G_KEY_FILE_DESKTOP_KEY_HIDDEN: &'static [u8] = b"Hidden\0";
pub const G_KEY_FILE_DESKTOP_KEY_ICON: &'static [u8] = b"Icon\0";
pub const G_KEY_FILE_DESKTOP_KEY_MIME_TYPE: &'static [u8] = b"MimeType\0";
pub const G_KEY_FILE_DESKTOP_KEY_NAME: &'static [u8] = b"Name\0";
pub const G_KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN: &'static [u8] = b"NotShowIn\0";
pub const G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY: &'static [u8] = b"NoDisplay\0";
pub const G_KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN: &'static [u8] = b"OnlyShowIn\0";
pub const G_KEY_FILE_DESKTOP_KEY_PATH: &'static [u8] = b"Path\0";
pub const G_KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY: &'static [u8] = b"StartupNotify\0";
pub const G_KEY_FILE_DESKTOP_KEY_STARTUP_WM_CLASS: &'static [u8] = b"StartupWMClass\0";
pub const G_KEY_FILE_DESKTOP_KEY_TERMINAL: &'static [u8] = b"Terminal\0";
pub const G_KEY_FILE_DESKTOP_KEY_TRY_EXEC: &'static [u8] = b"TryExec\0";
pub const G_KEY_FILE_DESKTOP_KEY_TYPE: &'static [u8] = b"Type\0";
pub const G_KEY_FILE_DESKTOP_KEY_URL: &'static [u8] = b"URL\0";
pub const G_KEY_FILE_DESKTOP_KEY_VERSION: &'static [u8] = b"Version\0";
pub const G_KEY_FILE_DESKTOP_TYPE_APPLICATION: &'static [u8] = b"Application\0";
pub const G_KEY_FILE_DESKTOP_TYPE_DIRECTORY: &'static [u8] = b"Directory\0";
pub const G_KEY_FILE_DESKTOP_TYPE_LINK: &'static [u8] = b"Link\0";
pub enum GKeyFile { }
#[repr(C)]
pub enum GKeyFileError {
UnknownEncoding = 0,
Parse = 1,
NotFound = 2,
KeyNotFound = 3,
GroupNotFound = 4,
InvalidValue = 5,
}
pub const G_KEY_FILE_ERROR_UNKNOWN_ENCODING: GKeyFileError = GKeyFileError::UnknownEncoding;
pub const G_KEY_FILE_ERROR_PARSE: GKeyFileError = GKeyFileError::Parse;
pub const G_KEY_FILE_ERROR_NOT_FOUND: GKeyFileError = GKeyFileError::NotFound;
pub const G_KEY_FILE_ERROR_KEY_NOT_FOUND: GKeyFileError = GKeyFileError::KeyNotFound;
pub const G_KEY_FILE_ERROR_GROUP_NOT_FOUND: GKeyFileError = GKeyFileError::GroupNotFound;
pub const G_KEY_FILE_ERROR_INVALID_VALUE: GKeyFileError = GKeyFileError::InvalidValue;
#[repr(C)]
pub enum GKeyFileFlags {
None = 0,
KeepComments = 1,
KeepTranslations = 2,
}
pub const G_KEY_FILE_NONE: guint = 0;
pub const G_KEY_FILE_KEEP_COMMENTS: guint = 1;
pub const G_KEY_FILE_KEEP_TRANSLATIONS: guint = 2;
pub const G_LITTLE_ENDIAN: gint = 1234;
pub const G_LN10: gdouble = 2.302585;
pub const G_LN2: gdouble = 0.693147;
pub const G_LOG_2_BASE_10: gdouble = 0.301030;
pub const G_LOG_DOMAIN: gchar = 0;
pub const G_LOG_FATAL_MASK: gint = 0;
pub const G_LOG_LEVEL_USER_SHIFT: gint = 8;
#[repr(C)]
pub struct GList {
pub data: gpointer,
pub next: *mut GList,
pub prev: *mut GList,
}
pub type GLogFunc = extern "C" fn (*const gchar, GLogLevelFlags, *const gchar, gpointer);
#[repr(C)]
pub enum GLogLevelFlags {
LevelMask = -4,
FlagRecursion = 1,
FlagFatal = 2,
LevelError = 4,
LevelCritical = 8,
LevelWarning = 16,
LevelMessage = 32,
LevelInfo = 64,
LevelDebug = 128,
}
pub const G_LOG_FLAG_RECURSION: guint = 1;
pub const G_LOG_FLAG_FATAL: guint = 2;
pub const G_LOG_LEVEL_ERROR: guint = 4;
pub const G_LOG_LEVEL_CRITICAL: guint = 8;
pub const G_LOG_LEVEL_WARNING: guint = 16;
pub const G_LOG_LEVEL_MESSAGE: guint = 32;
pub const G_LOG_LEVEL_INFO: guint = 64;
pub const G_LOG_LEVEL_DEBUG: guint = 128;
pub const G_LOG_LEVEL_MASK: guint = -4i64 as guint;
pub const GLIB_MAJOR_VERSION: gint = 2;
pub const G_MAXINT16: i16 = 32767;
pub const G_MAXINT32: i32 = 2147483647;
pub const G_MAXINT64: i64 = 9223372036854775807;
pub const G_MAXINT8: i8 = 127;
pub const G_MAXUINT16: u16 = 65535;
pub const G_MAXUINT32: u32 = 4294967295;
pub const G_MAXUINT64: u64 = 18446744073709551615;
pub const G_MAXUINT8: u8 = 255;
pub const GLIB_MICRO_VERSION: gint = 1;
pub const G_MININT16: i16 = -32768;
pub const G_MININT32: i32 = -2147483648;
pub const G_MININT64: i64 = -9223372036854775808;
pub const G_MININT8: i8 = -128;
pub const GLIB_MINOR_VERSION: gint = 47;
pub enum GMainContext { }
pub enum GMainLoop { }
pub enum GMappedFile { }
#[repr(C)]
pub enum GMarkupCollectType {
Invalid = 0,
String = 1,
Strdup = 2,
Boolean = 3,
Tristate = 4,
Optional = 65536,
}
pub const G_MARKUP_COLLECT_INVALID: guint = 0;
pub const G_MARKUP_COLLECT_STRING: guint = 1;
pub const G_MARKUP_COLLECT_STRDUP: guint = 2;
pub const G_MARKUP_COLLECT_BOOLEAN: guint = 3;
pub const G_MARKUP_COLLECT_TRISTATE: guint = 4;
pub const G_MARKUP_COLLECT_OPTIONAL: guint = 65536;
#[repr(C)]
pub enum GMarkupError {
BadUtf8 = 0,
Empty = 1,
Parse = 2,
UnknownElement = 3,
UnknownAttribute = 4,
InvalidContent = 5,
MissingAttribute = 6,
}
pub const G_MARKUP_ERROR_BAD_UTF8: GMarkupError = GMarkupError::BadUtf8;
pub const G_MARKUP_ERROR_EMPTY: GMarkupError = GMarkupError::Empty;
pub const G_MARKUP_ERROR_PARSE: GMarkupError = GMarkupError::Parse;
pub const G_MARKUP_ERROR_UNKNOWN_ELEMENT: GMarkupError = GMarkupError::UnknownElement;
pub const G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE: GMarkupError = GMarkupError::UnknownAttribute;
pub const G_MARKUP_ERROR_INVALID_CONTENT: GMarkupError = GMarkupError::InvalidContent;
pub const G_MARKUP_ERROR_MISSING_ATTRIBUTE: GMarkupError = GMarkupError::MissingAttribute;
pub enum GMarkupParseContext { }
#[repr(C)]
pub enum GMarkupParseFlags {
DoNotUseThisUnsupportedFlag = 1,
TreatCdataAsText = 2,
PrefixErrorPosition = 4,
IgnoreQualified = 8,
}
pub const G_MARKUP_DO_NOT_USE_THIS_UNSUPPORTED_FLAG: guint = 1;
pub const G_MARKUP_TREAT_CDATA_AS_TEXT: guint = 2;
pub const G_MARKUP_PREFIX_ERROR_POSITION: guint = 4;
pub const G_MARKUP_IGNORE_QUALIFIED: guint = 8;
#[repr(C)]
pub struct GMarkupParser {
pub start_element: Option<extern "C" fn (*mut GMarkupParseContext, *const gchar, *mut *const gchar, *mut *const gchar, gpointer, *mut *mut GError)>,
pub end_element: Option<extern "C" fn (*mut GMarkupParseContext, *const gchar, gpointer, *mut *mut GError)>,
pub text: Option<extern "C" fn (*mut GMarkupParseContext, *const gchar, gsize, gpointer, *mut *mut GError)>,
pub passthrough: Option<extern "C" fn (*mut GMarkupParseContext, *const gchar, gsize, gpointer, *mut *mut GError)>,
pub error: Option<extern "C" fn (*mut GMarkupParseContext, *mut GError, gpointer)>,
}
pub enum GMatchInfo { }
#[repr(C)]
pub struct GMemVTable {
pub malloc: Option<extern "C" fn (gsize) -> gpointer>,
pub realloc: Option<extern "C" fn (gpointer, gsize) -> gpointer>,
pub free: Option<extern "C" fn (gpointer)>,
pub calloc: Option<extern "C" fn (gsize, gsize) -> gpointer>,
pub try_malloc: Option<extern "C" fn (gsize) -> gpointer>,
pub try_realloc: Option<extern "C" fn (gpointer, gsize) -> gpointer>,
}
#[repr(C)]
pub struct GNode {
pub data: gpointer,
pub next: *mut GNode,
pub prev: *mut GNode,
pub parent: *mut GNode,
pub children: *mut GNode,
}
pub type GNodeForeachFunc = extern "C" fn (*mut GNode, gpointer);
pub type GNodeTraverseFunc = extern "C" fn (*mut GNode, gpointer) -> gboolean;
#[repr(C)]
pub enum GNormalizeMode {
Default = 0,