summaryrefslogtreecommitdiff
path: root/vapi/glib-2.0.vala
blob: cdc41ba767749d1ba56877add9816340fd67a6ed (plain)
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
/* glib-2.0.vala
 *
 * Copyright (C) 2006-2007  Jürg Billeter, Raffaele Sandrini
 * Copyright (C) 2007  Mathias Hasselmann
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.

 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.

 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 * Author:
 * 	Jürg Billeter <j@bitron.ch>
 *	Raffaele Sandrini <rasa@gmx.ch>
 *	Mathias Hasselmann <mathias.hasselmann@gmx.de>
 */

[CCode (cname = "gboolean", cheader_filename = "glib.h", type_id = "G_TYPE_BOOLEAN", marshaller_type_name = "BOOLEAN", get_value_function = "g_value_get_boolean", set_value_function = "g_value_set_boolean", default_value = "FALSE")]
public struct bool {
}

[CCode (cname = "gpointer", cheader_filename = "glib.h", type_id = "G_TYPE_POINTER", marshaller_type_name = "POINTER", get_value_function = "g_value_get_pointer", set_value_function = "g_value_set_pointer", default_value = "NULL")]
public struct pointer {
	[CCode (cname ="GPOINTER_TO_INT")]
	public int to_int ();
	[CCode (cname ="GPOINTER_TO_UINT")]
	public uint to_uint ();
}

[CCode (cname = "gconstpointer", cheader_filename = "glib.h", type_id = "G_TYPE_POINTER", marshaller_type_name = "POINTER", get_value_function = "g_value_get_pointer", set_value_function = "g_value_set_pointer", default_value = "NULL")]
public struct constpointer {
}

[CCode (cname = "gchar", cprefix = "g_ascii_", cheader_filename = "glib.h", type_id = "G_TYPE_CHAR", marshaller_type_name = "CHAR", get_value_function = "g_value_get_char", set_value_function = "g_value_set_char", default_value = "\'\\0\'")]
[IntegerType (rank = 1)]
public struct char {
	[InstanceLast ()]
	[CCode (cname = "g_strdup_printf")]
	public string! to_string (string! format = "%hhi");
	public bool isalnum ();
	public bool isalpha ();
	public bool iscntrl ();
	public bool isdigit ();
	public bool isgraph ();
	public bool islower ();
	public bool isprint ();
	public bool ispunct ();
	public bool isspace ();
	public bool isupper ();
	public bool isxdigit ();
	public int digit_value ();
	public int xdigit_value ();
	public char tolower ();
	public char toupper ();
}

[CCode (cname = "guchar", cheader_filename = "glib.h", type_id = "G_TYPE_UCHAR", marshaller_type_name = "UCHAR", get_value_function = "g_value_get_uchar", set_value_function = "g_value_set_uchar", default_value = "\'\\0\'")]
[IntegerType (rank = 2)]
public struct uchar {
	[InstanceLast ()]
	[CCode (cname = "g_strdup_printf")]
	public string! to_string (string! format = "%hhu");
}

[CCode (cname = "gint", cheader_filename = "glib.h", type_id = "G_TYPE_INT", marshaller_type_name = "INT", get_value_function = "g_value_get_int", set_value_function = "g_value_set_int", default_value = "0")]
[IntegerType (rank = 9)]
public struct int {
	[CCode (cname = "G_MININT")]
	public static int MIN;
	[CCode (cname = "G_MAXINT")]
	public static int MAX;

	[InstanceLast ()]
	[CCode (cname = "g_strdup_printf")]
	public string! to_string (string! format = "%i");

	[CCode (cname = "CLAMP")]
	public int clamp (int low, int high);

	[CCode (cname ="GINT_TO_POINTER")]
	public pointer to_pointer ();
}

[CCode (cname = "guint", cheader_filename = "glib.h", type_id = "G_TYPE_UINT", marshaller_type_name = "UINT", get_value_function = "g_value_get_uint", set_value_function = "g_value_set_uint", default_value = "0U")]
[IntegerType (rank = 10)]
public struct uint {
	[CCode (cname = "0")]
	public static uint MIN;
	[CCode (cname = "G_MAXUINT")]
	public static uint MAX;

	[InstanceLast ()]
	[CCode (cname = "g_strdup_printf")]
	public string! to_string (string! format = "%u");

	[CCode (cname = "CLAMP")]
	public uint clamp (uint low, uint high);

	[CCode (cname ="GUINT_TO_POINTER")]
	public pointer to_pointer ();
}

[CCode (cname = "gshort", cheader_filename = "glib.h", default_value = "0")]
[IntegerType (rank = 5)]
public struct short {
	[CCode (cname = "G_MINSHORT")]
	public static short MIN;
	[CCode (cname = "G_MAXSHORT")]
	public static short MAX;

	[InstanceLast ()]
	[CCode (cname = "g_strdup_printf")]
	public string! to_string (string! format = "%hi");
}

[CCode (cname = "gushort", cheader_filename = "glib.h", default_value = "0U")]
[IntegerType (rank = 6)]
public struct ushort {
	[CCode (cname = "0U")]
	public static ushort MIN;
	[CCode (cname = "G_MAXUSHORT")]
	public static ushort MAX;

	[InstanceLast ()]
	[CCode (cname = "g_strdup_printf")]
	public string! to_string (string! format = "%hu");
}

[CCode (cname = "glong", cheader_filename = "glib.h", type_id = "G_TYPE_LONG", marshaller_type_name = "LONG", get_value_function = "g_value_get_long", set_value_function = "g_value_set_long", default_value = "0L")]
[IntegerType (rank = 14)]
public struct long {
	[CCode (cname = "G_MINLONG")]
	public static long MIN;
	[CCode (cname = "G_MAXLONG")]
	public static long MAX;

	[InstanceLast ()]
	[CCode (cname = "g_strdup_printf")]
	public string! to_string (string! format = "%li");
}

[CCode (cname = "gulong", cheader_filename = "glib.h", type_id = "G_TYPE_ULONG", marshaller_type_name = "ULONG", get_value_function = "g_value_get_ulong", set_value_function = "g_value_set_ulong", default_value = "0UL")]
[IntegerType (rank = 15)]
public struct ulong {
	[CCode (cname = "0UL")]
	public static ulong MIN;
	[CCode (cname = "G_MAXULONG")]
	public static ulong MAX;

	[InstanceLast ()]
	[CCode (cname = "g_strdup_printf")]
	public string! to_string (string! format = "%lu");
}

[CCode (cname = "gint8", cheader_filename = "glib.h", type_id = "G_TYPE_CHAR", marshaller_type_name = "CHAR", get_value_function = "g_value_get_char", set_value_function = "g_value_set_char", default_value = "0")]
[IntegerType (rank = 3)]
public struct int8 {
	[CCode (cname = "G_MININT8")]
	public static int8 MIN;
	[CCode (cname = "G_MAXINT8")]
	public static int8 MAX;

	[CCode (cname = "g_strdup_printf"), InstanceLast]
	public string! to_string (string! format = "%hhi");
}

[CCode (cname = "guint8", cheader_filename = "glib.h", default_value = "0U")]
[IntegerType (rank = 4)]
public struct uint8 {
	[CCode (cname = "0U")]
	public static uint8 MIN;
	[CCode (cname = "G_MAXUINT8")]
	public static uint8 MAX;

	[CCode (cname = "g_strdup_printf"), InstanceLast]
	public string! to_string (string! format = "%hhu");
}

[CCode (cname = "gint16", cheader_filename = "glib.h", default_value = "0")]
[IntegerType (rank = 7)]
public struct int16 {
	[CCode (cname = "G_MININT16")]
	public static int16 MIN;
	[CCode (cname = "G_MAXINT16")]
	public static int16 MAX;

	[CCode (cname = "g_strdup_printf"), InstanceLast]
	public string! to_string (string! format = "%hi");
}

[CCode (cname = "guint16", cheader_filename = "glib.h", default_value = "0U")]
[IntegerType (rank = 8)]
public struct uint16 {
	[CCode (cname = "0U")]
	public static uint16 MIN;
	[CCode (cname = "G_MAXUINT16")]
	public static uint16 MAX;

	[CCode (cname = "g_strdup_printf"), InstanceLast]
	public string! to_string (string! format = "%hu");
}

[CCode (cname = "gint32", cheader_filename = "glib.h", default_value = "0")]
[IntegerType (rank = 11)]
public struct int32 {
	[CCode (cname = "G_MININT32")]
	public static int32 MIN;
	[CCode (cname = "G_MAXINT32")]
	public static int32 MAX;

	[CCode (cname = "g_strdup_printf"), InstanceLast]
	public string! to_string (string! format = "%i");
}

[CCode (cname = "guint32", cheader_filename = "glib.h", default_value = "0U")]
[IntegerType (rank = 12)]
public struct uint32 {
	[CCode (cname = "0U")]
	public static uint32 MIN;
	[CCode (cname = "G_MAXUINT32")]
	public static uint32 MAX;

	[InstanceLast ()]
	[CCode (cname = "g_strdup_printf")]
	public string! to_string (string! format = "%u");
}

[CCode (cname = "gint64", cheader_filename = "glib.h", type_id = "G_TYPE_INT64", marshaller_type_name = "INT64", get_value_function = "g_value_get_int64", set_value_function = "g_value_set_int64", default_value = "0LL")]
[IntegerType (rank = 16)]
public struct int64 {
	[CCode (cname = "G_MININT64")]
	public static int64 MIN;
	[CCode (cname = "G_MAXINT64")]
	public static int64 MAX;

	[InstanceLast ()]
	[CCode (cname = "g_strdup_printf")]
	public string! to_string (string! format = "%lli");
}

[CCode (cname = "guint64", cheader_filename = "glib.h", type_id = "G_TYPE_UINT64", marshaller_type_name = "UINT64", get_value_function = "g_value_get_uint64", set_value_function = "g_value_set_uint64", default_value = "0ULL")]
[IntegerType (rank = 17)]
public struct uint64 {
	[CCode (cname = "0ULL")]
	public static uint64 MIN;
	[CCode (cname = "G_MAXUINT64")]
	public static uint64 MAX;

	[InstanceLast ()]
	[CCode (cname = "g_strdup_printf")]
	public string! to_string (string! format = "%llu");
}

[CCode (cname = "float", cheader_filename = "glib.h,float.h,math.h", type_id = "G_TYPE_FLOAT", marshaller_type_name = "FLOAT", get_value_function = "g_value_get_float", set_value_function = "g_value_set_float", default_value = "0.0F")]
[FloatingType (rank = 1)]
public struct float {
	[CCode (cname = "FLT_MANT_DIG")]
	public static int MANT_DIG;
	[CCode (cname = "FLT_DIG")]
	public static int DIG;

	[CCode (cname = "FLT_MIN_EXP")]
	public static int MIN_EXP;
	[CCode (cname = "FLT_MAX_EXP")]
	public static int MAX_EXP;

	[CCode (cname = "FLT_MIN_10_EXP")]
	public static int MIN_10_EXP;
	[CCode (cname = "FLT_MAX_10_EXP")]
	public static int MAX_10_EXP;

	[CCode (cname = "FLT_EPSILON")]
	public static float EPSILON;
	[CCode (cname = "FLT_MIN")]
	public static float MIN;
	[CCode (cname = "FLT_MAX")]
	public static float MAX;

	[CCode (cname = "NAN")]
	public static float NAN;
	[CCode (cname = "INFINITY")]
	public static float INFINITY;

	[CCode (cname = "isnan")]
	public bool is_nan ();
	[CCode (cname = "isfinite")]
	public bool is_finite ();
	[CCode (cname = "isnormal")]
	public bool is_normal ();
	[CCode (cname = "isinf")]
	public int is_infinity ();

	[CCode (cname = "g_strdup_printf"), InstanceLast]
	public string! to_string (string! format = "%g");
}

[CCode (cname = "double", cheader_filename = "glib.h,float.h,math.h", type_id = "G_TYPE_DOUBLE", marshaller_type_name = "DOUBLE", get_value_function = "g_value_get_double", set_value_function = "g_value_set_double", default_value = "0.0")]
[FloatingType (rank = 2)]
public struct double {
	[CCode (cname = "DBL_MANT_DIG")]
	public static int MANT_DIG;
	[CCode (cname = "DBL_DIG")]
	public static int DIG;

	[CCode (cname = "DBL_MIN_EXP")]
	public static int MIN_EXP;
	[CCode (cname = "DBL_MAX_EXP")]
	public static int MAX_EXP;

	[CCode (cname = "DBL_MIN_10_EXP")]
	public static int MIN_10_EXP;
	[CCode (cname = "DBL_MAX_10_EXP")]
	public static int MAX_10_EXP;

	[CCode (cname = "DBL_EPSILON")]
	public static double EPSILON;
	[CCode (cname = "DBL_MIN")]
	public static double MIN;
	[CCode (cname = "DBL_MAX")]
	public static double MAX;

	[CCode (cname = "((double) NAN)")]
	public static double NAN;
	[CCode (cname = "((double) INFINITY)")]
	public static double INFINITY;

	[CCode (cname = "isnan")]
	public bool is_nan ();
	[CCode (cname = "isfinite")]
	public bool is_finite ();
	[CCode (cname = "isnormal")]
	public bool is_normal ();
	[CCode (cname = "isinf")]
	public int is_infinity ();

	[CCode (cname = "g_strdup_printf"), InstanceLast]
	public string! to_string (string! format = "%g");
}

[CCode (cname = "gunichar", cprefix = "g_unichar_", cheader_filename = "glib.h", get_value_function = "g_value_get_int", set_value_function = "g_value_set_int", default_value = "0U")]
[IntegerType (rank = 13)]
public struct unichar {
	public bool validate ();
	public bool isalnum ();
	public bool isalpha ();
	public bool iscntrl ();
	public bool isdigit ();
	public bool isgraph ();
	public bool islower ();
	public bool isprint ();
	public bool ispunct ();
	public bool isspace ();
	public bool isupper ();
	public bool isxdigit ();
	public bool istitle ();
	public bool isdefined ();
	public bool iswide ();
	public bool iswide_cjk ();
	public bool iszerowidth ();
	public unichar toupper ();
	public unichar tolower ();
	public unichar totitle ();
	public int digit_value ();
	public int xdigit_value ();
	public UnicodeType type ();
	public UnicodeBreakType break_type ();

	public int to_utf8 (string outbuf);
}

[CCode (cprefix = "G_UNICODE_")]
public enum UnicodeType {
	CONTROL,
	FORMAT,
	UNASSIGNED,
	PRIVATE_USE,
	SURROGATE,
	LOWERCASE_LETTER,
	MODIFIER_LETTER,
	OTHER_LETTER,
	TITLECASE_LETTER,
	UPPERCASE_LETTER,
	COMBINING_MARK,
	ENCLOSING_MARK,
	NON_SPACING_MARK,
	DECIMAL_NUMBER,
	LETTER_NUMBER,
	OTHER_NUMBER,
	CONNECT_PUNCTUATION,
	DASH_PUNCTUATION,
	CLOSE_PUNCTUATION,
	FINAL_PUNCTUATION,
	INITIAL_PUNCTUATION,
	OTHER_PUNCTUATION,
	OPEN_PUNCTUATION,
	CURRENCY_SYMBOL,
	MODIFIER_SYMBOL,
	MATH_SYMBOL,
	OTHER_SYMBOL,
	LINE_SEPARATOR,
	PARAGRAPH_SEPARATOR,
	SPACE_SEPARATOR
}

[CCode (cprefix = "G_UNICODE_BREAK_")]
public enum UnicodeBreakType {
	MANDATORY,
	CARRIAGE_RETURN,
	LINE_FEED,
	COMBINING_MARK,
	SURROGATE,
	ZERO_WIDTH_SPACE,
	INSEPARABLE,
	NON_BREAKING_GLUE,
	CONTINGENT,
	SPACE,
	AFTER,
	BEFORE,
	BEFORE_AND_AFTER,
	HYPHEN,
	NON_STARTER,
	OPEN_PUNCTUATION,
	CLOSE_PUNCTUATION,
	QUOTATION,
	EXCLAMATION,
	IDEOGRAPHIC,
	NUMERIC,
	INFIX_SEPARATOR,
	SYMBOL,
	ALPHABETIC,
	PREFIX,
	POSTFIX,
	COMPLEX_CONTEXT,
	AMBIGUOUS,
	UNKNOWN,
	NEXT_LINE,
	WORD_JOINER,
	HANGUL_L_JAMO,
	HANGUL_V_JAMO,
	HANGUL_T_JAMO,
	HANGUL_LV_SYLLABLE,
	HANGUL_LVT_SYLLABLE
}

[CCode (cname = "char", const_cname = "const char", copy_function = "g_strdup", free_function = "g_free", cheader_filename = "stdlib.h,string.h,glib.h", type_id = "G_TYPE_STRING", marshaller_type_name = "STRING", get_value_function = "g_value_get_string", set_value_function = "g_value_set_string")]
public class string {
	[CCode (cname = "strstr")]
	public weak string str (string! needle);
	[CCode (cname = "g_str_has_prefix")]
	public bool has_prefix (string! prefix);
	[CCode (cname = "g_str_has_suffix")]
	public bool has_suffix (string! suffix);
	[CCode (cname = "g_strdup_printf"), PrintfFormat]
	public string printf (...);
	[CCode (cname = "g_strconcat")]
	public string concat (string string2, ...);
	[CCode (cname = "g_strndup")]
	public string ndup (ulong n); /* FIXME: only UTF-8 */
	[CCode (cname = "g_strcompress")]
	public string compress ();
	[CCode (cname = "g_strsplit")]
	[NoArrayLength]
	public string[] split (string! delimiter, int max_tokens = 0);
	[CCode (cname = "g_strsplit_set")]
	[NoArrayLength]
	public string[] split_set (string! delimiters, int max_tokens = 0);
	[CCode (cname = "g_strjoinv")]
	[NoArrayLength]
	public static string joinv (string! separator, string[] str_array);
	
	[CCode (cname = "g_utf8_next_char")]
	public weak string next_char ();
	[CCode (cname = "g_utf8_get_char")]
	public unichar get_char ();
	[CCode (cname = "g_utf8_get_char_validated")]
	public unichar get_char_validated (long max_len = -1);
	[CCode (cname = "g_utf8_offset_to_pointer")]
	[PlusOperator ()]
	public weak string offset (long offset);
	[CCode (cname = "g_utf8_pointer_to_offset")]
	public long pointer_to_offset (string pos);
	[CCode (cname = "g_utf8_prev_char")]
	public weak string prev_char ();
	[CCode (cname = "g_utf8_strlen")]
	public long len (long max = -1);
	[CCode (cname = "g_utf8_strchr")]
	public weak string chr (long len, unichar c);
	[CCode (cname = "g_utf8_strrchr")]
	public weak string rchr (long len, unichar c);
	[CCode (cname = "g_utf8_strreverse")]
	public string! reverse (int len = -1);
	[CCode (cname = "g_utf8_validate")]
	public bool validate (long max_len = -1, out string end = null);
	
	[CCode (cname = "g_utf8_strup")]
	public string up (long len = -1);
	[CCode (cname = "g_utf8_strdown")]
	public string down (long len = -1);
	[CCode (cname = "g_utf8_casefold")]
	public string casefold (long len = -1);
	[CCode (cname = "g_utf8_collate")]
	public int collate (string str2);

	[CCode (cname = "g_locale_to_utf8")]
	public string! locale_to_utf8 (long len, out ulong bytes_read, out ulong bytes_written, out GLib.Error error = null);
  
	[CCode (cname = "g_strchomp")]
	public weak string chomp();
	[CCode (cname = "g_strchug")]
	public weak string chug();
	[CCode (cname = "g_strstrip")]
	public weak string strip ();
	
	[CCode (cname = "g_str_hash")]
	public uint hash ();
	
	[CCode (cname = "atoi")]
	public int to_int ();
	[CCode (cname = "strtod")]
	public double to_double (out string endptr = null);
	[CCode (cname = "strtoul")]
	public ulong to_ulong (out string endptr = null, int _base = 0);
	[CCode (cname = "g_ascii_strtoll")]
	public int64 to_int64 (out string endptr = null, int _base = 0);
	[CCode (cname = "strlen")]
	public long size ();

	[CCode (cname = "g_utf8_skip")]
	public static char[] skip;

	public string! substring (long offset, long len);
}

[Import ()]
[CCode (cprefix = "G", lower_case_cprefix = "g_", cheader_filename = "glib.h")]
namespace GLib {
	[CCode (type_id = "G_TYPE_GTYPE")]
	public struct Type {
		[CCode (cname = "G_TYPE_IS_OBJECT")]
		public bool is_object ();
		[CCode (cname = "G_TYPE_IS_ABSTRACT")]
		public bool is_abstract ();
		[CCode (cname = "G_TYPE_IS_CLASSED")]
		public bool is_classed ();
		[CCode (cname = "G_TYPE_IS_DERIVABLE")]
		public bool is_derivable ();
		[CCode (cname = "G_TYPE_IS_DEEP_DERIVABLE")]
		public bool is_deep_derivable ();
		[CCode (cname = "G_TYPE_IS_DERIVED")]
		public bool is_derived ();
		[CCode (cname = "G_TYPE_IS_FUNDAMENTAL")]
		public bool is_fundamental ();
		[CCode (cname = "G_TYPE_IS_INSTANTIATABLE")]
		public bool is_instantiatable ();
		[CCode (cname = "G_TYPE_IS_INTERFACE")]
		public bool is_interface ();
		[CCode (cname = "G_TYPE_IS_VALUE_TYPE")]
		public bool is_value_type ();
		
		//public Type[] children (out uint n_children = null);
		public uint depth ();
		public static Type from_name (string! name);
		//public Type[] interfaces (out uint n_interfaces = null);
		public bool is_a (Type is_a_type);
		public weak string! name ();
		public Type parent ();
				
		public TypeClass class_ref ();
		
	}

	[CCode (has_type_id = true)]
	public class TypeInstance {
	}

	public class TypeClass {
		[CCode (cname = "G_TYPE_FROM_CLASS")]
		public Type get_type ();
	}

	public interface TypePlugin {
	}

	public class TypeModule : TypePlugin {
		public bool use ();
		public void unuse ();
		public void set_name (string! name);
	}

	public class ParamSpec {
		public TypeInstance g_type_instance;
		public string name;
		public ParamFlags flags;
		public Type value_type;
		public Type owner_type;
	}

	[CCode (cprefix = "G_PARAM_")]
	public enum ParamFlags {
		READABLE,
		WRITABLE,
		CONSTRUCT,
		CONSTRUCT_ONLY,
		LAX_VALIDATION,
		STATIC_NAME,
		STATIC_NICK,
		STATIC_BLURB
	}

	public class ObjectClass {
		public ParamSpec[] list_properties (out int n_properties);
	}
	
	public struct ObjectConstructParam {
	}

	public static delegate void ObjectGetPropertyFunc (Object object, uint property_id, Value value, ParamSpec pspec);
	public static delegate void ObjectSetPropertyFunc (Object object, uint property_id, Value value, ParamSpec pspec);

	[CCode (ref_function = "g_object_ref", unref_function = "g_object_unref", marshaller_type_name = "OBJECT", get_value_function = "g_value_get_object", set_value_function = "g_value_set_object", cheader_filename = "glib-object.h")]
	public class Object : TypeInstance {
		[CCode (cname = "G_TYPE_FROM_INSTANCE")]
		public Type get_type ();
		public Object @ref ();
		public void unref ();
		public Object ref_sink ();
		public void set (...);
		public void get_property (string! property_name, Value value);
		public virtual void dispose ();
		public virtual void finalize ();
		public virtual void constructed ();

		/* FIXME The notify passes a ParamSpec where the
		 * wrapper expects a string. Fortunatly Vala doesn't
		 * verify signatures of signal handlers yet.
		 * See Bug 473804.
		 */
		[HasEmitter]
		public signal void notify(string! property_name);

		public Object connect(string! signal_spec, ...);
	}

	public struct Parameter {
		public string name;
		public Value value;
	}

	public class InitiallyUnowned : Object {
	}

	[CCode (cname = "gpointer", has_type_id = true, type_id = "G_TYPE_BOXED", marshaller_type_name = "BOXED", get_value_function = "g_value_get_boxed", set_value_function = "g_value_set_boxed")]
	public abstract class Boxed {
	}

	[CCode (free_function = "g_free", type_id = "G_TYPE_VALUE")]
	public class Value {
		public weak Value init (Type g_type);
		public void copy (Value dest_value);
		public weak Value reset ();
		public void unset ();
		public void set_instance (pointer instance);
		public bool fits_pointer ();
		public pointer peek_pointer ();
		public static bool type_compatible (Type src_type, Type dest_type);
		public static bool type_transformable (Type src_type, Type dest_type);
		public bool transform (Value dest_value);
		[CCode (cname = "g_strdup_value_contents")]
		public string strdup_contents ();
		public void set_boolean (bool v_boolean);
		public bool get_boolean ();
		public void set_char (char v_char);
		public char get_char ();
		public void set_uchar (uchar v_uchar);
		public uchar get_uchar ();
		public void set_int (int v_int);
		public int get_int ();
		public void set_uint (uint v_uint);
		public uint get_uint ();
		public void set_long (long v_long);
		public long get_long ();
		public void set_ulong (ulong v_ulong);
		public ulong get_ulong ();
		public void set_int64 (int64 v_int64);
		public int64 get_int64 ();
		public void set_uint64 (uint64 v_uint64);
		public uint64 get_uint64 ();
		public void set_float (float v_float);
		public float get_float ();
		public void set_double (double v_double);
		public double get_double ();
		public void set_enum (int v_enum);
		public int get_enum ();
		public void set_flags (uint v_flags);
		public uint get_flags ();
		public void set_string (string v_string);
		public void set_static_string (string v_string);
		public void take_string (string# v_string);
		public weak string get_string ();
		public string dup_string ();
		public void set_pointer (pointer v_pointer);
		public pointer get_pointer ();
		public void set_object (Object v_object);
		public void take_object (Object# v_object);
		public weak Object get_object ();
		public Object dup_object ();
		public void set_gtype (Type v_gtype);
		public Type get_gtype ();
	}
	
	public struct SignalInvocationHint {
		public uint signal_id;
		public Quark detail;
		public SignalFlags run_type;
	}
	
	[NoArrayLength ()]
	public static delegate bool SignalEmissionHook (SignalInvocationHint ihint, uint n_param_values, Value[] param_values, pointer data);
	
	[CCode (cprefix = "G_SIGNAL_")]
	public enum SignalFlags {
		RUN_FIRST,
		RUN_LAST,
		RUN_CLEANUP,
		DETAILED,
		ACTION,
		NO_HOOKS
	}

	[CCode (cprefix = "G_CONNECT_")]
	public enum ConnectFlags {
		AFTER,
		SWAPPED
	}

	public static delegate void Callback ();

	public class Closure : Boxed {
	}

	public static delegate void ClosureNotify (pointer data, Closure closure);

	[CCode (type_id = "G_TYPE_VALUE_ARRAY")]
	public struct ValueArray {
	}

	[CCode (cprefix = "", cheader_filename = "math.h")]
	public static class Math {
		[CCode (cname = "G_E")]
		public static double E;
		
		[CCode (cname = "G_PI")]
		public static double PI;

		/* generated from <bits/mathcalls.h> of glibc */
		public static double acos (double x);
		public static float acosf (float x);
		public static double asin (double x);
		public static float asinf (float x);
		public static double atan (double x);
		public static float atanf (float x);
		public static double atan2 (double y, double x);
		public static float atan2f (float y, float x);
		public static double cos (double x);
		public static float cosf (float x);
		public static double sin (double x);
		public static float sinf (float x);
		public static double tan (double x);
		public static float tanf (float x);
		public static double cosh (double x);
		public static float coshf (float x);
		public static double sinh (double x);
		public static float sinhf (float x);
		public static double tanh (double x);
		public static float tanhf (float x);
		public static void sincos (double x, out double sinx, ref double cosx);
		public static void sincosf (float x, out float sinx, out float cosx);
		public static double acosh (double x);
		public static float acoshf (float x);
		public static double asinh (double x);
		public static float asinhf (float x);
		public static double atanh (double x);
		public static float atanhf (float x);
		public static double exp (double x);
		public static float expf (float x);
		public static double frexp (double x, out int exponent);
		public static float frexpf (float x, out int exponent);
		public static double ldexp (double x, int exponent);
		public static float ldexpf (float x, int exponent);
		public static double log (double x);
		public static float logf (float x);
		public static double log10 (double x);
		public static float log10f (float x);
		public static double modf (double x, out double iptr);
		public static float modff (float x, out float iptr);
		public static double exp10 (double x);
		public static float exp10f (float x);
		public static double pow10 (double x);
		public static float pow10f (float x);
		public static double expm1 (double x);
		public static float expm1f (float x);
		public static double log1p (double x);
		public static float log1pf (float x);
		public static double logb (double x);
		public static float logbf (float x);
		public static double exp2 (double x);
		public static float exp2f (float x);
		public static double log2 (double x);
		public static float log2f (float x);
		public static double pow (double x, double y);
		public static float powf (float x, float y);
		public static double sqrt (double x);
		public static float sqrtf (float x);
		public static double hypot (double x, double y);
		public static float hypotf (float x, float y);
		public static double cbrt (double x);
		public static float cbrtf (float x);
		public static double ceil (double x);
		public static float ceilf (float x);
		public static double fabs (double x);
		public static float fabsf (float x);
		public static double floor (double x);
		public static float floorf (float x);
		public static double fmod (double x, double y);
		public static float fmodf (float x, float y);
		public static int isinf (double value);
		public static int isinff (float value);
		public static int finite (double value);
		public static int finitef (float value);
		public static double drem (double x, double y);
		public static float dremf (float x, float y);
		public static double significand (double x);
		public static float significandf (float x);
		public static double copysign (double x, double y);
		public static float copysignf (float x, float y);
		public static double nan (string tagb);
		public static float nanf (string tagb);
		public static int isnan (double value);
		public static int isnanf (float value);
		public static double j0 (double x0);
		public static float j0f (float x0);
		public static double j1 (double x0);
		public static float j1f (float x0);
		public static double jn (int x0, double x1);
		public static float jnf (int x0, float x1);
		public static double y0 (double x0);
		public static float y0f (float x0);
		public static double y1 (double x0);
		public static float y1f (float x0);
		public static double yn (int x0, double x1);
		public static float ynf (int x0, float x1);
		public static double erf (double x0);
		public static float erff (float x0);
		public static double erfc (double x0);
		public static float erfcf (float x0);
		public static double lgamma (double x0);
		public static float lgammaf (float x0);
		public static double tgamma (double x0);
		public static float tgammaf (float x0);
		public static double gamma (double x0);
		public static float gammaf (float x0);
		public static double lgamma_r (double x0, out int signgamp);
		public static float lgamma_rf (float x0, out int signgamp);
		public static double rint (double x);
		public static float rintf (float x);
		public static double nextafter (double x, double y);
		public static float nextafterf (float x, float y);
		public static double nexttoward (double x, double y);
		public static float nexttowardf (float x, double y);
		public static double remainder (double x, double y);
		public static float remainderf (float x, float y);
		public static double scalbn (double x, int n);
		public static float scalbnf (float x, int n);
		public static int ilogb (double x);
		public static int ilogbf (float x);
		public static double scalbln (double x, long n);
		public static float scalblnf (float x, long n);
		public static double nearbyint (double x);
		public static float nearbyintf (float x);
		public static double round (double x);
		public static float roundf (float x);
		public static double trunc (double x);
		public static float truncf (float x);
		public static double remquo (double x, double y, out int quo);
		public static float remquof (float x, float y, out int quo);
		public static long lrint (double x);
		public static long lrintf (float x);
		public static int64 llrint (double x);
		public static int64 llrintf (float x);
		public static long lround (double x);
		public static long lroundf (float x);
		public static int64 llround (double x);
		public static int64 llroundf (float x);
		public static double fdim (double x, double y);
		public static float fdimf (float x, float y);
		public static double fmax (double x, double y);
		public static float fmaxf (float x, float y);
		public static double fmin (double x, double y);
		public static float fminf (float x, float y);
		public static double fma (double x, double y, double z);
		public static float fmaf (float x, float y, float z);
		public static double scalb (double x, double n);
		public static float scalbf (float x, float n);
	}

	/* The Main Event Loop */
	
	[CCode (ref_function = "g_main_loop_ref", unref_function = "g_main_loop_unref")]
	public class MainLoop {
		public MainLoop (MainContext context, bool is_running);
		public void run ();
		public void quit ();
		public bool is_running ();
		public weak MainContext get_context ();
	}
	
	public enum Priority {
		HIGH,
		DEFAULT,
		HIGH_IDLE,
		DEFAULT_IDLE,
		LOW
	}
	
	[CCode (ref_function = "g_main_context_ref", unref_function = "g_main_context_unref")]
	public class MainContext {
		public MainContext ();
		public static weak MainContext @default ();
		public bool iteration (bool may_block);
		public bool pending ();
		public weak Source find_source_by_id (uint source_id);
		public weak Source find_source_by_user_data (pointer user_data);
		public weak Source find_source_by_funcs_user_data (SourceFuncs funcs, pointer user_data);
		public void wakeup ();
		public bool acquire ();
		public void release ();
		public bool is_owner ();
		public bool wait (Cond cond, Mutex mutex);
		public bool prepare (out int priority);
		[NoArrayLength ()]
		public int query (int max_priority, out int timeout_, PollFD[] fds, int n_fds);
		public int check (int max_priority, PollFD[] fds, int n_fds);
		public void dispatch ();
		public void set_poll_func (PollFunc func);
		public PollFunc get_poll_func ();
		public void add_poll (ref PollFD fd, int priority);
		public void remove_poll (ref PollFD fd);
		public int depth ();
		public weak Source current_source ();
	}
	
	public static delegate int PollFunc (PollFD[] ufds, uint nfsd, int timeout_);
	
	public class TimeoutSource : Source {
		public TimeoutSource (uint interval);
	}

	public static class Timeout {
		public static uint add (uint interval, SourceFunc function, pointer data);
		public static uint add_full (int priority, uint interval, SourceFunc function, pointer data, DestroyNotify notify);
	}
	
	public class IdleSource : Source {
		public IdleSource ();
	}

	public static class Idle {
		public static uint add (SourceFunc function, pointer data);
		public static uint add_full (int priority, SourceFunc function, pointer data, DestroyNotify notify);
		public static bool remove_by_data (pointer data);
	}

	[CCode (default_value = "0")]
	public struct Pid {
	}

	public static delegate void ChildWatchFunc (Pid pid, int status, pointer data);
	
	public class ChildWatchSource : Source {
		public ChildWatchSource (Pid pid, int status, pointer data);
	}
	
	public static class ChildWatch {
		public static uint add (Pid pid, ChildWatchFunc function, pointer data);
		public static uint add_full (int priority, Pid pid, ChildWatchFunc function, pointer data, DestroyNotify notify);
	}
	
	public struct PollFD {
		public int fd;
		public IOCondition events;
		public IOCondition revents;
	}
	
	[CCode (ref_function = "g_source_ref", unref_function = "g_source_unref")]
	public class Source {
		public Source (SourceFuncs source_funcs, uint struct_size /* = sizeof (Source) */);
		public void set_funcs (SourceFuncs funcs);
		public uint attach (MainContext context);
		public void destroy ();
		public bool is_destroyed ();
		public void set_priority (int priority);
		public int get_priority ();
		public void set_can_recurse (bool can_recurse);
		public bool get_can_recurse ();
		public uint get_id ();
		public weak MainContext get_context ();
		public void set_callback (SourceFunc func, pointer data, DestroyNotify notify);
		public void set_callback_indirect (pointer callback_data, SourceCallbackFuncs callback_funcs);
		public void add_poll (ref PollFD fd);
		public void remove_poll (ref PollFD fd);
		public void get_current_time (out TimeVal timeval);
		public static void remove (uint id);
		public static bool remove_by_funcs_user_data (pointer user_data);
		public static bool remove_by_user_data (pointer user_data);
	}
	
	public static delegate void SourceDummyMarshal ();
	
	public static delegate bool SourcePrepareFunc (Source source, out int timeout_);
	public static delegate bool SourceCheckFunc (Source source);
	public static delegate bool SourceDispatchFunc (Source source, SourceFunc _callback, pointer user_data);
	public static delegate void SourceFinalizeFunc (Source source);
	
	public class SourceFuncs {
		public SourcePrepareFunc prepare;
		public SourceCheckFunc check;
		public SourceDispatchFunc dispatch;
		public SourceFinalizeFunc finalize;
	}
	
	public static delegate void SourceCallbackRefFunc (pointer cb_data);
	public static delegate void SourceCallbackUnrefFunc (pointer cb_data);
	public static delegate void SourceCallbackGetFunc (pointer cb_data, Source source, SourceFunc func, pointer data);
	
	public class SourceCallbackFuncs {
		public SourceCallbackRefFunc @ref;
		public SourceCallbackUnrefFunc unref;
		public SourceCallbackGetFunc @get;
	}
	
	public static delegate bool SourceFunc (pointer data);

	[ErrorDomain]
	public enum ThreadError {
		AGAIN
	}

	/* Thread support */
	public class ThreadFunctions {
	}
	
	public static delegate pointer ThreadFunc (pointer data);
	public static delegate void Func (pointer data, pointer user_data);
	
	public enum ThreadPriority {
		LOW,
		NORMAL,
		HIGH,
		URGENT
	}
	
	public class Thread {
		public static void init (ThreadFunctions vtable = null);
		public static bool supported ();
		public static weak Thread create (ThreadFunc func, pointer data, bool joinable) throws ThreadError;
		public static weak Thread create_full (ThreadFunc func, pointer data, ulong stack_size, bool joinable, bool bound, ThreadPriority priority) throws ThreadError;
		public static weak Thread self ();
		public pointer join ();
		public void set_priority (ThreadPriority priority);
		public static void yield ();
		public static void exit (pointer retval);
		public static void @foreach (Func thread_func, pointer user_data);
		
		[CCode (cname = "g_usleep")]
		public static void usleep (ulong microseconds);
	}
	
	[CCode (free_function = "g_mutex_free")]
	public class Mutex {
		public Mutex ();
		public void @lock ();
		public bool try_lock ();
		public void unlock ();
	}
	
	[CCode (free_function = "g_cond_free")]
	public class Cond {
		public Cond ();
		public void @signal ();
		public void broadcast ();
		public void wait (Mutex mutex);
		public bool timed_wait (Mutex mutex, TimeVal abs_time);
	}
	
	/* Thread Pools */
	
	[CCode (free_function = "g_thread_pool_free")]
	public class ThreadPool {
		public ThreadPool (Func func, pointer user_data, int max_threads, bool exclusive) throws ThreadError;
		public void push (pointer data) throws ThreadError;
		public void set_max_threads (int max_threads) throws ThreadError;
		public int get_max_threads ();
		public uint get_num_threads ();
		public uint unprocessed ();
		public static void set_max_unused_threads (int max_threads);
		public static int get_max_unused_threads ();
		public static uint get_num_unused_threads ();
		public static void stop_unused_threads ();
		public void set_sort_function (CompareDataFunc func, pointer user_data);
		public static void set_max_idle_time (uint interval);
		public static uint get_max_idle_time ();
	}
	
	/* Asynchronous Queues */
	
	[CCode (ref_function = "g_async_queue_ref", unref_function = "g_async_queue_unref")]
	public class AsyncQueue {
		public AsyncQueue ();
		public void push (pointer data);
		public void push_sorted (pointer data, CompareDataFunc func, pointer user_data);
		public pointer pop ();
		public pointer try_pop ();
		public pointer timed_pop (ref TimeVal end_time);
		public int length ();
		public void sort (CompareDataFunc func, pointer user_data);
		public void @lock ();
		public void unlock ();
		public void ref_unlocked ();
		public void unref_and_unlock ();
		public void push_unlocked (pointer data);
		public void push_sorted_unlocked (pointer data, CompareDataFunc func, pointer user_data);
		public pointer pop_unlocked ();
		public pointer try_pop_unlocked ();
		public pointer timed_pop_unlocked (ref TimeVal end_time);
		public int length_unlocked ();
		public void sort_unlocked (CompareDataFunc func, pointer user_data);
	}
	
	/* Dynamic Loading of Modules */
	
	[CCode (free_function = "g_module_close")]
	public class Module {
		public static bool supported ();
		public static string build_path (string directory, string module_name);
		public static Module open (string file_name, ModuleFlags @flags);
		public bool symbol (string! symbol_name, out pointer symbol);
		public weak string name ();
		public void make_resident ();
		public weak string error ();
	}
	
	[CCode (cprefix = "G_MODULE_")]
	public enum ModuleFlags {
		BIND_LAZY,
		BIND_LOCAL,
		BIND_MASK
	}
	
	/* Memory Allocation */
	
	public static pointer malloc (ulong n_bytes);
	public static pointer malloc0 (ulong n_bytes);
	public static pointer realloc (pointer mem, ulong n_bytes);

	public static pointer try_malloc (ulong n_bytes);
	public static pointer try_malloc0 (ulong n_bytes);
	public static pointer try_realloc (pointer mem, ulong n_bytes);
	
	public static void free (pointer mem);
	
	/* IO Channels */
	
	[CCode (ref_function = "g_io_channel_ref", unref_function = "g_io_channel_unref")]
	public class IOChannel : Boxed {
		public IOChannel.file (string! filename, string! mode) throws FileError;
		[CCode (cname = "g_io_channel_unix_new")]
		public IOChannel.unix_new (int fd);
		public int unix_get_fd ();
		public IOStatus read_chars (string! buf, ulong count, out ulong bytes_read) throws ConvertError, IOChannelError;
		public IOStatus read_unichar (out unichar thechar) throws ConvertError, IOChannelError;
		public IOStatus read_line (out string str_return, out ulong length, out ulong terminator_pos) throws ConvertError, IOChannelError;
		public IOStatus read_line_string (String! buffer, out ulong terminator_pos) throws ConvertError, IOChannelError;
		public IOStatus read_to_end (out string str_return, out ulong length) throws ConvertError, IOChannelError;
		public IOStatus write_chars (string! buf, long count, out ulong bytes_written) throws ConvertError, IOChannelError;
		public IOStatus write_unichar (unichar thechar) throws ConvertError, IOChannelError;
		public IOStatus flush () throws IOChannelError;
		public IOStatus seek_position (int64 offset, SeekType type) throws IOChannelError;
		public IOStatus shutdown (bool flush) throws IOChannelError;
	}

	[CCode (cprefix = "G_IO_", type_id = "G_TYPE_IO_CONDITION")]
	public enum IOCondition {
		IN,
		OUT,
		PRI,
		ERR,
		HUP,
		NVAL
	}

	[CCode (cprefix = "G_SEEK_")]
	public enum SeekType {
		CUR,
		SET,
		END
	}
	
	public enum IOStatus {
		ERROR,
		NORMAL,
		EOF,
		AGAIN
	}

	[ErrorDomain]
	public enum IOChannelError {
		FBIG,
		INVAL,
		IO,
		ISDIR,
		NOSPC,
		NXIO,
		OVERFLOW,
		PIPE,
		FAILED
	}

	/* Error Reporting */

	[CCode (copy_function = "g_error_copy", free_function = "g_error_free")]
	public class Error {
		public Error (Quark domain, int code, string! format, ...);
		public int code;
		public string message;
	}
	
	/* Message Output and Debugging Functions */
	
	public static void return_if_fail (bool expr);
	public static void assert (bool expr);
	public static void assert_not_reached ();

	/* Message Logging */
	
	[CCode (cprefix = "G_LOG_")]
	public enum LogLevelFlags {
		/* log flags */
		FLAG_RECURSION,
		FLAG_FATAL,

		/* GLib log levels */
		LEVEL_ERROR,
		LEVEL_CRITICAL,
		LEVEL_WARNING,
		LEVEL_MESSAGE,
		LEVEL_INFO,
		LEVEL_DEBUG,

		LEVEL_MASK
	}
	
	[Diagnostics]
	[PrintfFormat]
	public void log (string log_domain, LogLevelFlags log_level, string format, ...);
	
	[Diagnostics]
	[PrintfFormat]
	public void message (string format, ...);
	[Diagnostics]
	[PrintfFormat]
	public void warning (string format, ...);
	[Diagnostics]
	[PrintfFormat]
	public void critical (string format, ...);
	[Diagnostics]
	[PrintfFormat]
	public void error (string format, ...);
	[Diagnostics]
	[PrintfFormat]
	public void debug (string format, ...);
	
	/* Character Set Conversions */
	
	public static string convert (string! str, long len, string! to_codeset, string! from_codeset, out int bytes_read = null, out int bytes_written = null) throws ConvertError;

	public struct IConv {
		[CCode (cname = "g_iconv_open")]
		public Iconv (string to_codeset, string from_codeset);
		[CCode (cname = "g_iconv")]
		public uint iconv (out string inbuf, out uint inbytes_left, out string outbuf, out uint outbytes_left);
		public int close ();
	}

	public static class Filename {
		public static string from_uri (string! uri, out string hostname = null) throws ConvertError;
		public static string to_uri (string! filename, string hostname = null) throws ConvertError;
		public static string display_basename (string! filename);
	}

	[ErrorDomain]
	public enum ConvertError {
		NO_CONVERSION,
		ILLEGAL_SEQUENCE,
		FAILED,
		PARTIAL_INPUT,
		BAD_URI,
		NOT_ABSOLUTE_PATH
	}

	/* Base64 Encoding */
	
	public static class Base64 {
		public static int encode_step (string! _in, int len, bool break_lines, string _out, out int state, out int save);
		public static int encode_close (bool break_lines, string _out, out int state, out int save);
		public static string encode (string! data, int len);
		public static int decode_step (string! _in, int len, out int state, out uint save);
		public static string decode (string! text, out ulong out_len);
	}
	
	/* Date and Time Functions */
	
	public struct TimeVal {
		public long tv_sec;
		public long tv_usec;

		[CCode (cname = "g_get_current_time")]
		[InstanceByReference]
		public void get_current_time ();
		public void add (long microseconds);
		[InstanceByReference]
		[InstanceLast]
		public bool from_iso8601 (string iso_date);
		[InstanceByReference]
		public string! to_iso8601 ();
	}

	public struct DateDay : uchar {
		[CCode (cname = "G_DATE_BAD_DAY")]
		public static DateDay BAD_DAY;

		[CCode (cname = "g_date_valid_day")]
		public bool valid ();
	}

	[CCode (cprefix = "G_DATE_")]
	public enum DateMonth {
		BAD_MONTH,
		JANUARY,
		FEBRUARY,
		MARCH,
		APRIL,
		MAY,
		JUNE,
		JULY,
		AUGUST,
		SEPTEMBER,
		OCTOBER,
		NOVEMBER,
		DECEMBER;

		[CCode (cname = "g_date_get_days_in_month")]
		public uchar get_days_in_month (DateYear year);
		[CCode (cname = "g_date_valid_month")]
		public bool valid (); 
	}

	public struct DateYear : ushort {
		[CCode (cname = "G_DATE_BAD_YEAR")]
		public static DateDay BAD_YEAR;

		[CCode (cname = "g_date_is_leap_year")]
		public bool is_leap_year ();
		[CCode (cname = "g_date_get_monday_weeks_in_year")]
		public uchar get_monday_weeks_in_year ();
		[CCode (cname = "g_date_get_sunday_weeks_in_year")]
		public uchar get_sunday_weeks_in_year ();
		[CCode (cname = "g_date_valid_year")]
		public bool valid ();
	}

	[CCode (cprefix = "G_DATE_")]
	public enum DateWeekday {
		BAD_WEEKDAY,
		MONDAY,
		TUESDAY,
		WEDNESDAY,
		THURSDAY,
		FRIDAY,
		SATURDAY,
		SUNDAY;

		[CCode (cname = "g_date_valid_weekday")]
		public bool valid (); 
	}

	[CCode (free_function = "g_date_free")]
	public class Date : Boxed {
		public Date ();
		public Date.dmy (DateDay day, DateMonth month, DateYear year);
		public Date.julian (uint julian_day);
		public void clear (uint n_dates = 1);
		public void set_day (DateDay day);
		public void set_month (DateMonth month);
		public void set_year (DateYear year);
		public void set_dmy (DateDay day, DateMonth month, DateYear y);
		public void set_julian (uint julian_day);
		public void set_time_val (ref TimeVal timeval);
		public void set_parse (string! str);
		public void add_days (uint n_days);
		public void subtract_days (uint n_days);
		public void add_months (uint n_months);
		public void subtract_months (uint n_months);
		public void add_years (uint n_years);
		public void subtract_years (uint n_years);
		public int days_between (Date! date2);
		public int compare (Date! rhs);
		public void clamp (Date min_date, Date max_date);
		public void order (Date! date2);
		public DateDay get_day ();
		public DateMonth get_month ();
		public DateYear get_year ();
		public uint get_julian ();
		public DateWeekday get_weekday ();
		public uint get_day_of_year ();
		public bool is_first_of_month ();
		public bool is_last_of_month ();
		public uint get_monday_week_of_year ();
		public uint get_sunday_week_of_year ();
		public uint get_iso8601_week_of_year ();
		public bool valid ();
		public static uchar get_days_in_month (DateMonth month, DateYear year);
		public static bool valid_day (DateDay day);
		public static bool valid_dmy (DateDay day, DateMonth month, DateYear year);
		public static bool valid_julian (uint julian_date);
		public static bool valid_weekday (DateWeekday weekday);
	}

	public struct Time : int32 {
	}

	/* Random Numbers */
	
	[CCode (copy_function = "g_rand_copy", free_function = "g_rand_free")]
	public class Rand {
		public Rand.with_seed (uint32 seed);
		[NoArrayLength ()]
		public Rand.with_seed_array (uint32[] seed, uint seed_length);
		public Rand ();
		public void set_seed (uint32 seed);
		[NoArrayLength ()]
		public void set_seed_array (uint32[] seed, uint seed_length);
		public bool boolean ();
		public uint32 @int ();
		public int32 int_range (int32 begin, int32 end);
		public double @double ();
		public double double_range (double begin, double end);
	}
	
	public static class Random {
		public static void set_seed (uint32 seed);
		public static bool boolean ();
		public static uint32 @int ();
		public static int32 int_range (int32 begin, int32 end);
		public static double @double ();
		public static double double_range (double begin, double end);
	}
	
	/* Miscellaneous Utility Functions */
	
	public static class Environment {
		[CCode (cname = "g_get_application_name")]
		public static weak string get_application_name ();
		[CCode (cname = "g_set_application_name")]
		public static void set_application_name (string application_name);
		[CCode (cname = "g_get_prgname")]
		public static weak string get_prgname ();
		[CCode (cname = "g_set_prgname")]
		public static void set_prgname (string application_name);
		[CCode (cname = "g_getenv")]
		public static weak string get_variable (string! variable);
		[CCode (cname = "g_setenv")]
		public static bool set_variable (string! variable, string! value, bool overwrite);
		[CCode (cname = "g_listenv")]
		[NoArrayLength]
		public static string[] list_variables ();
		[CCode (cname = "g_get_user_name")]
		public static weak string get_user_name ();
		[CCode (cname = "g_get_user_data_dir")]
		public static weak string get_user_data_dir ();
		[CCode (cname = "g_get_host_name")]
		public static weak string! get_host_name ();
		[CCode (cname = "g_get_home_dir")]
		public static weak string get_home_dir ();
		[CCode (cname = "g_get_current_dir")]
		public static string get_current_dir ();
	}
	
	public static class Path {
		public static bool is_absolute (string! file_name);
		public static weak string skip_root (string! file_name);
		public static string get_basename (string file_name);
		public static string get_dirname (string file_name);
		[CCode (cname = "g_build_filename")]
		public static string build_filename (string first_element, ...);
	}

	public static class Bit {
		public static int nth_lsf (ulong mask, int nth_bit);
		public static int nth_msf (ulong mask, int nth_bit);
		public static uint storage (ulong number);
	}

	public static class SpacedPrimes {
		public static uint closest (uint num);
	}

	public static delegate void FreeFunc (pointer data);

	/* Lexical Scanner */
	
	[CCode (free_function = "g_scanner_destroy")]
	public class Scanner {
	}
	
	/* Spawning Processes */

	[ErrorDomain]
	public enum SpawnError {
		FORK,
		READ,
		CHDIR,
		ACCES,
		PERM,
		TOOBIG,
		NOEXEC,
		NAMETOOLONG,
		NOENT,
		NOMEM,
		NOTDIR,
		LOOP,
		TXTBUSY,
		IO,
		NFILE,
		MFILE,
		INVAL,
		ISDIR,
		LIBBAD,
		FAILED
	}

	[CCode (cprefix = "G_SPAWN_")]
	public enum SpawnFlags {
		LEAVE_DESCRIPTOR_OPEN,
		DO_NOT_REAP_CHILD,
		SEARCH_PATH,
		STDOUT_TO_DEV_NULL,
		STDERR_TO_DEV_NULL,
		CHILD_INHERITS_STDIN,
		FILE_AND_ARGV_ZERO
	}

	public static delegate void SpawnChildSetupFunc (pointer user_data);

	[CCode (cprefix = "g_")]
	public static class Process {
		[NoArrayLength ()]
		public static bool spawn_async_with_pipes (string working_directory, string[] argv, string[] envp, SpawnFlags _flags, SpawnChildSetupFunc child_setup, pointer user_data, out Pid child_pid, out int standard_input = null, out int standard_output = null, out int standard_error = null) throws SpawnError;
		[NoArrayLength ()]
		public static bool spawn_async (string working_directory, string[] argv, string[] envp, SpawnFlags _flags, SpawnChildSetupFunc child_setup, pointer user_data, out Pid child_pid) throws SpawnError;
		[NoArrayLength ()]
		public static bool spawn_sync (string working_directory, string[] argv, string[] envp, SpawnFlags _flags, SpawnChildSetupFunc child_setup, pointer user_data, out string standard_output = null, out string standard_error = null, out int exit_status = null) throws SpawnError;
		public static bool spawn_command_line_async (string! command_line) throws SpawnError;
		public static bool spawn_command_line_sync (string! command_line, out string standard_output = null, out string standard_error = null, out int exit_status = null) throws SpawnError;
		[CCode (cname = "g_spawn_close_pid")]
		public static void close_pid (Pid pid);
		
		/* these macros are required to examine the exit status of a process */
		[CCode (cname = "WIFEXITED")]
		public static bool if_exited (int status);
		[CCode (cname = "WEXITSTATUS")]
		public static int exit_status (int status);
		[CCode (cname = "WIFSIGNALED")]
		public static bool if_signaled (int status);
		[CCode (cname = "WTERMSIG")]
		public static ProcessSignal term_sig (int status);
		[CCode (cname = "WCOREDUMP")]
		public static bool core_dump (int status);
		[CCode (cname = "WIFSTOPPED")]
		public static bool if_stopped (int status);
		[CCode (cname = "WSTOPSIG")]
		public static ProcessSignal stop_sig (int status);
		[CCode (cname = "WIFCONTINUED")]
		public static bool if_continued (int status);
	}
	
	public enum ProcessSignal {
		HUP,
		INT,
		QUIT,
		ILL,
		TRAP,
		ABRT,
		BUS,
		FPE,
		KILL,
		SEGV,
		PIPE,
		ALRM,
		TERM,
		USR1,
		USR2,
		CHLD,
		CONT,
		STOP,
		TSTP,
		TTIN,
		TTOU
	}
		
	
	/* File Utilities */

	[ErrorDomain]
	public enum FileError {
		EXIST,
		ISDIR,
		ACCES,
		NAMETOOLONG,
		NOENT,
		NOTDIR,
		NXIO,
		NODEV,
		ROFS,
		TXTBSY,
		FAULT,
		LOOP,
		NOSPC,
		NOMEM,
		MFILE,
		NFILE,
		BADF,
		INVAL,
		PIPE,
		AGAIN,
		INTR,
		IO,
		PERM,
		NOSYS,
		FAILED
	}

	public enum FileTest {
		IS_REGULAR,
		IS_SYMLINK,
		IS_DIR,
		IS_EXECUTABLE,
		EXISTS
	}

	[CCode (cname = "FILE", free_function = "fclose", cheader_filename = "stdio.h")]
	public class FileStream {
		[CCode (cname = "fopen")]
		public static FileStream open (string path, string mode);
		[CCode (cname = "fdopen")]
		public static FileStream fdopen (int fildes, string mode);
		[CCode (cname = "fprintf")]
		[PrintfFormat ()]
		public void printf (string format, ...);
		[InstanceLast ()]
		[CCode (cname = "fputc")]
		public void putc (char c);
		[InstanceLast ()]
		[CCode (cname = "fputs")]
		public void puts (string s);
		[CCode (cname = "fclose")]
		public void close ();
		[CCode (cname = "fgetc")]
		public int getc ();
		[InstanceLast ()]
		[CCode (cname = "fgets")]
		public weak string gets (string s, int size);
		[CCode (cname = "feof")]
		public bool eof ();
	}

	[CCode (cprefix = "g_file_", cheader_filename = "glib/gstdio.h")]
	public static class FileUtils {
		public static bool get_contents (string! filename, out string contents, out ulong length = null) throws FileError;
		public static bool set_contents (string! filename, string contents, long length = -1) throws FileError;
		public static bool test (string filename, FileTest test);
		public static int open_tmp (string tmpl, out string name_used) throws FileError;
		public static string read_link (string filename) throws FileError;
		
		[CCode (cname = "g_mkstemp")]
		public static int mkstemp (string tmpl);
		[CCode (cname = "g_rename")]
		public static int rename (string oldfilename, string newfilename);
		[CCode (cname = "g_unlink")]
		public static int unlink (string filename);
		
		[CCode (cname = "symlink")]
		public static int symlink (string! oldpath, string! newpath);
	}

	[CCode (cname = "stat")]
	public struct Stat {
	}

	[CCode (free_function = "g_dir_close")]
	public class Dir {
		public static Dir open (string filename, uint _flags = 0) throws FileError;
		public weak string read_name ();
		public void rewind ();
	}
	
	public static class DirUtils {
		[CCode (cname = "g_mkdir")]
		public static int create (string pathname, int mode);
		[CCode (cname = "g_mkdir_with_parents")]
		public static int create_with_parents (string pathname, int mode);
		[CCode (cname = "mkdtemp")]
		public static weak string mkdtemp (string template);
	}
	
	[CCode (free_function = "g_mapped_file_free")]
	public class MappedFile {
		public MappedFile (string filename, bool writable) throws FileError;
		public void free ();
		public long get_length ();
		[NoArrayLength]
		public weak char[] get_contents ();
	}
	
	[CCode (cname = "char", cheader_filename = "string.h")]
	public class Memory {
		[CCode (cname = "memcmp")]
		[NoArrayLength ()]
		public static int cmp (char[] s1, char[] s2, long n);
	}

	[CCode (cname = "stdin", cheader_filename = "stdio.h")]
	public static FileStream stdin;

	[CCode (cname = "stdout", cheader_filename = "stdio.h")]
	public static FileStream stdout;
	
	[CCode (cname = "stderr", cheader_filename = "stdio.h")]
	public static FileStream stderr;

	/* Shell-related Utilities */

	[ErrorDomain]
	public enum ShellError {
		BAD_QUOTING,
		EMPTY_STRING,
		FAILED
	}

	public static class Shell {
		public static bool parse_argv (string! command_line, out int argcp, out string[] argvp) throws ShellError;
		public static string! quote (string! unquoted_string);
		public static string! unquote (string! quoted_string) throws ShellError;
	}

	/* Commandline option parser */

	[ErrorDomain]
	public enum OptionError {
		UNKNOWN_OPTION,
		BAD_VALUE,
		FAILED
	}

	[CCode (free_function = "g_option_context_free")]
	public class OptionContext {
		public OptionContext (string parameter_string);
		public bool parse (out string[] argv) throws OptionError;
		public void set_help_enabled (bool help_enabled);
		[NoArrayLength ()]
		public void add_main_entries (OptionEntry[] entries, string translation_domain);
	}
	
	public enum OptionArg {
		NONE,
		STRING,
		INT,
		CALLBACK,
		FILENAME,
		STRING_ARRAY,
		FILENAME_ARRAY
	}
	
	[Flags]
	public enum OptionFlags {
		HIDDEN,
		IN_MAIN,
		REVERSE,
		NO_ARG,
		FILENAME,
		OPTIONAL_ARG,
		NOALIAS
	}
	
	public struct OptionEntry {
		public string long_name;
		public char short_name;
		public int flags_;

		public OptionArg arg;
		public pointer arg_data;

		public string description;
		public string arg_description;
	}
	
	public class OptionGroup {
	}

	/* Perl-compatible regular expressions */

	[ErrorDomain]
	public enum RegexError {
		COMPILE,
		OPTIMIZE,
		REPLACE,
		MATCH
	}

	[CCode (cprefix = "G_REGEX_")]
	public enum RegexCompileFlags {
		CASELESS,
		MULTILINE,
		DOTALL,
		EXTENDED,
		ANCHORED,
		DOLLAR_ENDONLY,
		UNGREEDY,
		RAW,
		NO_AUTO_CAPTURE,
		OPTIMIZE,
		DUPNAMES,
		NEWLINE_CR,
		NEWLINE_LF,
		NEWLINE_CRLF
	}

	[CCode (cprefix = "G_REGEX_MATCH_")]
	public enum RegexMatchFlags {
		ANCHORED,
		NOTBOL,
		NOTEOL,
		NOTEMPTY,
		PARTIAL,
		NEWLINE_CR,
		NEWLINE_LF,
		NEWLINE_CRLF,
		NEWLINE_ANY
	}

	[CCode (ref_function = "g_regex_ref", unref_function = "g_regex_unref")]
	public class Regex : Boxed {
		public Regex (string! pattern, RegexCompileFlags compile_options = 0, RegexMatchFlags match_options = 0) throws RegexError;
		public string! get_pattern ();
		public int get_max_backref ();
		public int get_capture_count ();
		public int get_string_number (string! name);
		public string! escape_string (string! string, int length = -1);
		public static bool match_simple (string! pattern, string! string, RegexCompileFlags compile_options = 0, RegexMatchFlags match_options = 0);
		public bool match (string! string, RegexMatchFlags match_options = 0, out MatchInfo match_info = null);
		public bool match_full (string! string, long string_len = -1, int start_position = 0, RegexMatchFlags match_options = 0, out MatchInfo match_info = null) throws RegexError;
		public bool match_all (string! string, RegexMatchFlags match_options = 0, out MatchInfo match_info = null);
		public bool match_all_full (string! string, long string_len = -1, int start_position = 0, RegexMatchFlags match_options = 0, out MatchInfo match_info = null) throws RegexError;
		[NoArrayLength]
		public static string[] split_simple (string! pattern, string! string, RegexCompileFlags compile_options = 0, RegexMatchFlags match_options = 0);
		[NoArrayLength]
		public string[] split (string! string, RegexMatchFlags match_options = 0);
		[NoArrayLength]
		public bool split_full (string! string, long string_len = -1, int start_position = 0, RegexMatchFlags match_options = 0, int max_tokens = 0) throws RegexError;
		public string replace (string! string, long string_len, int start_position, string! replacement, RegexMatchFlags match_options = 0) throws RegexError;
		public string replace_literal (string! string, long string_len, int start_position, string! replacement, RegexMatchFlags match_options = 0) throws RegexError;
		public string replace_eval (string! string, long string_len, int start_position, RegexMatchFlags match_options = 0, RegexEvalCallback eval, pointer user_data) throws RegexError;
		public static bool check_replacement (out bool has_references = null) throws RegexError;
	}

	public static delegate bool RegexEvalCallback (MatchInfo match_info, String result, pointer user_data);

	[CCode (free_function = "g_match_info_free")]
	public class MatchInfo {
		public weak Regex get_regex ();
		public weak string get_string ();
		public bool matches ();
		public bool next () throws RegexError;
		public int get_match_count ();
		public bool is_partial_match ();
		public string! expand_references (string! string_to_expand) throws RegexError;
		public string fetch (int match_num);
		public bool fetch_pos (int match_num, out int start_pos, out int end_pos);
		public string fetch_named (string! name);
		public bool fetch_named_pos (string! name, out int start_pos, out int end_pos);
		[NoArrayLength]
		public string[] fetch_all ();
	}

	/* Simple XML Subset Parser */

	[ErrorDomain]
	public enum MarkupError {
		BAD_UTF8,
		EMPTY,
		PARSE,
		UNKNOWN_ELEMENT,
		UNKNOWN_ATTRIBUTE,
		INVALID_CONTENT
	}

	[CCode (cprefix = "G_MARKUP_")]
	public enum MarkupParseFlags {
		TREAT_CDATA_AS_TEXT
	}
	
	[CCode (free_function = "g_markup_parse_context_free")]
	public class MarkupParseContext {
		public MarkupParseContext (MarkupParser parser, MarkupParseFlags _flags, pointer user_data, DestroyNotify user_data_dnotify);
		public bool parse (string text, long text_len) throws MarkupError;
	}
	
	[NoArrayLength]
	public static delegate void MarkupParserStartElementFunc (MarkupParseContext context, string element_name, string[] attribute_names, string[] attribute_values, pointer user_data) throws MarkupError;
	
	public static delegate void MarkupParserEndElementFunc (MarkupParseContext context, string element_name, pointer user_data) throws MarkupError;
	
	public static delegate void MarkupParserTextFunc (MarkupParseContext context, string text, ulong text_len, pointer user_data) throws MarkupError;
	
	public static delegate void MarkupParserPassthroughFunc (MarkupParseContext context, string passthrough_text, ulong text_len, pointer user_data) throws MarkupError;
	
	public static delegate void MarkupParserErrorFunc (MarkupParseContext context, Error error, pointer user_data);
	
	public class MarkupParser {
		public MarkupParserStartElementFunc start_element;
		public MarkupParserEndElementFunc end_element;
		public MarkupParserTextFunc text;
		public MarkupParserPassthroughFunc passthrough;
		public MarkupParserErrorFunc error;
	}

	public static class Markup {
		public static string! escape_text (string! text, long length = -1);
		[PrintfFormat]
		public static string! printf_escaped (string! format, ...);
	}

	/* Key-value file parser */

	[ErrorDomain]
	public enum KeyFileError {
		UNKNOWN_ENCODING,
		PARSE,
		NOT_FOUND,
		KEY_NOT_FOUND,
		GROUP_NOT_FOUND,
		INVALID_VALUE
	}

	[CCode (free_function = "g_key_file_free")]
	public class KeyFile {
		public KeyFile ();
		public void set_list_separator (char separator);
		public bool load_from_file (string! file, KeyFileFlags @flags) throws KeyFileError;
		public bool load_from_data (string! data, ulong length, KeyFileFlags @flags) throws KeyFileError;
		public bool load_from_data_dirs (string! file, out string full_path, KeyFileFlags @flags) throws KeyFileError;
		public string to_data (out ulong length) throws KeyFileError;
		public string get_start_group ();
		public string[] get_groups (out ulong length);
		public string[] get_keys (string! group_name, out ulong length) throws KeyFileError;
		public bool has_group (string! group_name);
		public bool has_key (string! group_name, string! key) throws KeyFileError;
		public string get_value (string! group_name, string! key) throws KeyFileError;
		public string get_string (string! group_name, string! key) throws KeyFileError;
		public string get_locale_string (string! group_name, string! key, string! locale) throws KeyFileError;
		public bool get_boolean (string! group_name, string! key) throws KeyFileError;
		public int get_integer (string! group_name, string! key) throws KeyFileError;
		public double get_double (string! group_name, string! key) throws KeyFileError;
		public string[] get_string_list (string! group_name, string! key) throws KeyFileError;
		public string[] get_locale_string_list (string! group_name, string! key, string! locale) throws KeyFileError;
		public bool[] get_boolean_list (string! group_name, string! key) throws KeyFileError;
		public int[] get_integer_list (string! group_name, string! key) throws KeyFileError;
		public double[] get_double_list (string! group_name, string! key) throws KeyFileError;
		public string get_comment (string! group_name, string! key) throws KeyFileError;
		public void set_value (string! group_name, string! key, string! value);
		public void set_string (string! group_name, string! key, string! string);
		public void set_locale_string (string! group_name, string! key, string! locale, string! string);
		public void set_boolean (string! group_name, string! key, bool value);
		public void set_integer (string! group_name, string! key, int value);
		public void set_double (string! group_name, string! key, double value);
		[NoArrayLength]
		public void set_string_list (string! group_name, string! key, string[] list, ulong length);
		[NoArrayLength]
		public void set_locale_string_list (string! group_name, string! key, string! locale, string[] list, ulong length);
		[NoArrayLength]
		public void set_boolean_list (string! group_name, string! key, bool[] list, ulong length);
		[NoArrayLength]
		public void set_integer_list (string! group_name, string! key, int[] list, ulong length);
		[NoArrayLength]
		public void set_double_list (string! group_name, string! key, double[] list, ulong length);
		public void set_comment (string! group_name, string! key, string! comment);
		public void remove_group (string! group_name) throws KeyFileError;
		public void remove_key (string! group_name, string! key) throws KeyFileError;
		public void remove_comment (string! group_name, string! key) throws KeyFileError;
	}
	
	[CCode (cprefix = "G_KEY_FILE_")]
	public enum KeyFileFlags {
		NONE,
		KEEP_COMMENTS,
		KEEP_TRANSLATIONS
	}
	
	/* Doubly-Linked Lists */
	
	[CCode (dup_function = "g_list_copy", free_function = "g_list_free")]
	public class List<G> {
		[ReturnsModifiedPointer ()]
		public void append (G# data);
		[ReturnsModifiedPointer ()]
		public void prepend (G# data);
		[ReturnsModifiedPointer ()]
		public void insert (G# data, int position);
		[ReturnsModifiedPointer ()]
		public void insert_before (List<G> sibling, G# data);
		[ReturnsModifiedPointer ()]
		public void remove (G data);
		[ReturnsModifiedPointer ()]
		public void remove_link (List<G> llink);
		[ReturnsModifiedPointer ()]
		public void delete_link (List<G> link_);
		[ReturnsModifiedPointer ()]
		public void remove_all (G data);
		public void free ();
		
		public uint length ();
		public List<weak G> copy ();
		[ReturnsModifiedPointer ()]
		public void reverse ();
		[ReturnsModifiedPointer ()]
		public void sort (CompareFunc compare_func);
		[ReturnsModifiedPointer ()]
		public void concat (List<G># list2);
		
		public weak List<G> first ();
		public weak List<G> last ();
		public weak List<G> nth (uint n);
		public weak G nth_data (uint n);
		public weak List<G> nth_prev (uint n);
		
		public weak List<G> find_custom (G data, CompareFunc func);
		
		public weak List<G> find (G data);
		public int position (List<G> llink);
		public int index (G data);
		
		public G data;
		public weak List<G> next;
		public weak List<G> prev;
	}
	
	/* Singly-Linked Lists */
	
	[CCode (dup_function = "g_slist_copy", free_function = "g_slist_free")]
	public class SList<G> {
		[ReturnsModifiedPointer ()]
		public void append (G# data);
		[ReturnsModifiedPointer ()]
		public void prepend (G# data);
		[ReturnsModifiedPointer ()]
		public void insert (G# data, int position);
		[ReturnsModifiedPointer ()]
		public void insert_before (SList<G> sibling, G# data);
		[ReturnsModifiedPointer ()]
		public void remove (G data);
		[ReturnsModifiedPointer ()]
		public void remove_link (SList<G> llink);
		[ReturnsModifiedPointer ()]
		public void delete_link (SList<G> link_);
		[ReturnsModifiedPointer ()]
		public void remove_all (G data);
		public void free ();
		
		public uint length ();
		public SList<weak G> copy ();
		[ReturnsModifiedPointer ()]
		public void reverse ();
		[ReturnsModifiedPointer ()]
		public void sort (CompareFunc compare_func);
		[ReturnsModifiedPointer ()]
		public void concat (SList<G># list2);
		
		public weak SList<G> last ();
		public weak SList<G> nth (uint n);
		public weak G nth_data (uint n);
		
		public weak SList<G> find (G data);
		public weak SList<G> find_custom (G data, CompareFunc func);
		public int position (SList<G> llink);
		public int index (G data);
		
		public weak G data;
		public weak SList<G> next;
	}
	
	public static delegate int CompareFunc (pointer a, pointer b);

	public static delegate int CompareDataFunc (pointer a, pointer b, pointer user_data);
	
	[CCode (cname = "strcmp")]
	public static GLib.CompareFunc strcmp;
	
	/* Double-ended Queues */
	
	[CCode (dup_function = "g_queue_copy", free_function = "g_queue_free")]
	public class Queue<G> {
		public weak List<G> head;
		public weak List<G> tail;
		public uint length;
	
		public Queue ();
		
		public bool is_empty ();
		public uint get_length ();
		public void reverse ();
		public Queue copy ();
		public weak List<G> find (G data);
		public weak List<G> find_custom (G data, CompareFunc func);
		public void sort (CompareDataFunc compare_func, pointer user_data);
		public void push_head (G# data);
		public void push_tail (G# data);
		public void push_nth (G# data);
		public G pop_head ();
		public G pop_tail ();
		public G pop_nth ();
		public weak G peek_head ();
		public weak G peek_tail ();
		public weak G peek_nth ();
		public int index (G data);
		public void remove (G data);
		public void remove_all (G data);
		public void insert_before (List<G> sibling, G# data);
		public void insert_after (List<G> sibling, G# data);
		public void insert_sorted (List<G> sibling, G# data, CompareDataFunc func, pointer user_data);
	}
	
	/* Hash Tables */
	
	[CCode (ref_function = "g_hash_table_ref", unref_function = "g_hash_table_unref")]
	public class HashTable<K,V> : Boxed {
		public HashTable (HashFunc hash_func, EqualFunc key_equal_func);
		public HashTable.full (HashFunc hash_func, EqualFunc key_equal_func, DestroyNotify key_destroy_func, DestroyNotify value_destroy_func);
		public void insert (K# key, V# value);
		public void replace (K# key, V# value);
		public weak V lookup (K key);
		public bool remove (K key);
		public List<weak K> get_keys ();
		public List<weak V> get_values ();
		[CCode (cname = "g_hash_table_foreach")]
		public void for_each (HFunc func, pointer user_data);
	}
	
	public static delegate uint HashFunc (pointer key);
	public static delegate bool EqualFunc (pointer a, pointer b);
	public static delegate void HFunc (pointer key, pointer value, pointer user_data);

	public static delegate void DestroyNotify (pointer data);
	
	[CCode (cname = "g_direct_hash")]
	public static GLib.HashFunc direct_hash;
	[CCode (cname = "g_direct_equal")]
	public static GLib.EqualFunc direct_equal;
	[CCode (cname = "g_str_hash")]
	public static GLib.HashFunc str_hash;
	[CCode (cname = "g_str_equal")]
	public static GLib.EqualFunc str_equal;
	[CCode (cname = "g_free")]
	public static GLib.DestroyNotify g_free;
	[CCode (cname = "g_object_unref")]
	public static GLib.DestroyNotify g_object_unref;
	[CCode (cname = "g_list_free")]
	public static GLib.DestroyNotify g_list_free;

	/* Strings */
	
	[CCode (free_function = "g_string_free", type_id = "G_TYPE_GSTRING")]
	public class String : Boxed {
		public String (string init = "");
		[CCode (cname = "g_string_sized_new")]
		public String.sized (ulong dfl_size);
		public weak String assign (string! rval);
		public weak String append (string! val);
		public weak String append_c (char c);
		public weak String append_unichar (unichar wc);
		public weak String append_len (string! val, long len);
		public weak String prepend (string! val);
		public weak String prepend_c (char c);
		public weak String prepend_unichar (unichar wc);
		public weak String prepend_len (string! val, long len);
		public weak String insert (long pos, string! val);
		public weak String erase (long pos, long len);

		public void printf (string! format, ...);
		public void append_printf (string! format, ...);

		public string str;
		public long len;
		public long allocated_len;
	}
	
	/* Pointer Arrays */
	
	[CCode (free_function = "g_ptr_array_free")]
	public class PtrArray {
	}

	/* Byte Arrays */

	[CCode (free_function = "g_byte_array_free")]
	public class ByteArray {
	}

	/* Quarks */
	
	public struct Quark {
		public static Quark from_string (string string);
		public weak string to_string ();
	}
	
	/* GArray */
	
	public class Array<G> {
		public Array (bool zero_terminated, bool clear, uint element_size);
		[CCode (cname = "g_array_sized_new")]
		public Array.sized (bool zero_terminated, bool clear, uint element_size, uint reserved_size);
		[ReturnsModifiedPointer ()]
		public void append_val (G value);
		[ReturnsModifiedPointer ()]
		public void append_vals (constpointer data, uint len);
		[ReturnsModifiedPointer ()]
		public void prepend_val (G value);
		[ReturnsModifiedPointer ()]
		public void prepend_vals (constpointer data, uint len);
		[ReturnsModifiedPointer ()]
		public void insert_val (uint index, G value);
		[ReturnsModifiedPointer ()]
		public void insert_vals (uint index, constpointer data, uint len);
		[ReturnsModifiedPointer ()]
		public void remove_index (uint index);
		[ReturnsModifiedPointer ()]
		public void remove_index_fast (uint index);
		[ReturnsModifiedPointer ()]
		public void remove_range (uint index, uint length);
		public void sort (CompareFunc compare_func);
		public void sort_with_data (CompareDataFunc compare_func, pointer user_data);
		[ReturnsModifiedPointer ()]
		public void set_size (uint length);
		public string free (bool free_segment);
	}
	
	/* GTree */
	
	public static delegate int TraverseFunc (pointer key, pointer value, pointer data);
	
	[CCode (c_prefix="C_")]
	public enum TraverseType {
		IN_ORDER,
		PRE_ORDER,
		POST_ORDER,
		LEVEL_ORDER
	}
	
	[CCode (free_function = "g_tree_destroy")]
	public class Tree<K,V> {
		public Tree (CompareFunc key_compare_func);
		public Tree.with_data (CompareFunc key_compare_func, pointer key_compare_data);
		public Tree.full (CompareFunc key_compare_func, pointer key_compare_data, DestroyNotify key_destroy_func, DestroyNotify value_destroy_func);
		public void insert (K key, V value);
		public void replace (K key, V value);
		public int nnodes ();
		public int height ();
		public weak V lookup (K key);
		public bool lookup_extended (K lookup_key, K orig_key, V value);
		public void tree_foreach (TraverseFunc traverse_func, TraverseType traverse_type, pointer user_data);
		public weak V tree_search (CompareFunc search_func, pointer user_data);
		public bool remove (K key);
		public bool steal (K key);
	}
	
	/* Internationalization */
	
	[CCode (cname = "_", cheader_filename = "glib.h,glib/gi18n-lib.h")]
	public static weak string _ (string str);
	[CCode (cname = "Q_", cheader_filename = "glib.h,glib/gi18n-lib.h")]
	public static weak string Q_ (string str);
	[CCode (cname = "N_", cheader_filename = "glib.h,glib/gi18n-lib.h")]
	public static weak string N_ (string str);
	
	[CCode (cprefix = "LC_", cheader_filename = "locale.h")]
	public enum LocaleCategory {
		ALL,
		COLLATE,
		CTYPE,
		MESSAGES,
		MONETARY,
		NUMERIC,
		TIME
	}
	
	public static class Intl {
		[CCode (cname = "setlocale", cheader_filename = "locale.h")]
		public static weak string setlocale (LocaleCategory category, string locale);
		[CCode (cname = "bindtextdomain", cheader_filename = "glib/gi18n-lib.h")]
		public static weak string bindtextdomain (string domainname, string dirname);
		[CCode (cname = "textdomain", cheader_filename = "glib/gi18n-lib.h")]
		public static weak string textdomain (LocaleCategory category, string locale);
	}

	public static class Signal {
		public static void query (uint signal_id, out SignalQuery query);
		public static uint lookup (string! name, Type itype);
		public static weak string name (uint signal_id);
		public static uint[] list_ids (Type itype);
		public static void emit (pointer instance, uint signal_id, Quark detail, ...);
		public static void emit_by_name (pointer instance, string! detailed_signal, ...);
		public static ulong connect (pointer instance, string! detailed_signal, Callback! handler, pointer data);
		public static ulong connect_after (pointer instance, string! detailed_signal, Callback! handler, pointer data);
		public static ulong connect_swapped (pointer instance, string! detailed_signal, Callback! handler, pointer data);
		public static ulong connect_object (pointer instance, string! detailed_signal, Callback! handler, Object gobject, ConnectFlags flags);
		public static ulong connect_data (pointer instance, string! detailed_signal, Callback! handler, pointer data, ClosureNotify destroy_data, ConnectFlags flags);
		public static ulong connect_closure (pointer instance, string! detailed_signal, Closure! closure, bool after);
		public static ulong connect_closure_by_id (pointer instance, uint signal_id, Quark detail, Closure! closure, bool after);
		public static bool has_handler_pending (pointer instance, uint signal_id, Quark detail, bool may_be_blocked);
		public static void stop_emission (pointer instance, uint signal_id, Quark detail);
		public static void stop_emission_by_name (pointer instance, string !detailed_signal);
		public static void override_class_closure (uint signal_id, Type instance_type, Closure! class_closure);
		[NoArrayLength]
		public static void chain_from_overridden (Value[] instance_and_params, out Value return_value);
		public static ulong add_emission_hook (uint signal_id, Quark detail, SignalEmissionHook! hook_func, pointer hook_data, DestroyNotify data_destroy);
		public static void remove_emission_hook (uint signal_id, ulong hook_id);
		public static bool parse_name (string !detailed_signal, Type itype, out uint signal_id, out Quark detail, bool force_detail_quark);
	}

	public static class SignalHandler {
		public static void block (pointer instance, ulong handler_id);
		public static void unblock (pointer instance, ulong handler_id);
		public static void disconnect (pointer instance, ulong handler_id);
		public static ulong find (pointer instance, SignalMatchType mask, uint signal_id, Quark detail, Closure closure, pointer func, pointer data);
		public static bool is_connected (pointer instance, ulong handler_id);

		[CCode (cprefix = "g_signal_handlers_")]
		public static uint block_matched (pointer instance, SignalMatchType mask, uint signal_id, Quark detail, Closure closure, pointer func, pointer data);
		[CCode (cprefix = "g_signal_handlers_")]
		public static uint unblock_matched (pointer instance, SignalMatchType mask, uint signal_id, Quark detail, Closure closure, pointer func, pointer data);
		[CCode (cprefix = "g_signal_handlers_")]
		public static uint disconnect_matched (pointer instance, SignalMatchType mask, uint signal_id, Quark detail, Closure closure, pointer func, pointer data);
		[CCode (cprefix = "g_signal_handlers_")]
		public static uint block_by_func (pointer instance, pointer func, pointer data);
		[CCode (cprefix = "g_signal_handlers_")]
		public static uint unblock_by_func (pointer instance, pointer func, pointer data);
		[CCode (cprefix = "g_signal_handlers_")]
		public static uint disconnect_by_func (pointer instance, pointer func, pointer data);
	}

	public struct SignalQuery {
		public uint signal_id;
		public weak string signal_name;
		public Type itype;
		public SignalFlags signal_flags;
		public Type return_type;
                public uint n_params;
		[NoArrayLength]
		public weak Type[] param_types;
	}

	[CCode (cprefix = "G_SIGNAL_MATCH_")]
	public enum SignalMatchType {
		ID,
		DETAIL,
		CLOSURE,
		FUNC,
		DATA,
		UNBLOCKED
	}

	public class PatternSpec {
		public PatternSpec (string! pattern);
		public void free ();
		public void equal (PatternSpec! pspec);
		[CCode (cname = "g_pattern_match")]
		public bool match (uint string_length, string! str, string! str_reversed);
		[CCode (cname = "g_pattern_match_string")]
		public bool match_string (string! str);
		[CCode (cname = "g_pattern_match_simple")]
		public static bool match_simple (string! pattern, string! str);
	}
}